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 |
|---|---|---|---|---|---|---|---|---|---|---|
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Range.java | Range.sumBoundaries | public Range sumBoundaries(final Range plus) {
"""
Sums the boundaries of this range with the ones of the passed. So the returned range has
this.min + plus.min as minimum and this.max + plus.max as maximum respectively.
@return a range object whose boundaries are summed
"""
int newMin = min + plus.min;
... | java | public Range sumBoundaries(final Range plus) {
int newMin = min + plus.min;
int newMax = max == RANGE_MAX || plus.max == RANGE_MAX ? RANGE_MAX : max + plus.max;
return new Range(newMin, newMax);
} | [
"public",
"Range",
"sumBoundaries",
"(",
"final",
"Range",
"plus",
")",
"{",
"int",
"newMin",
"=",
"min",
"+",
"plus",
".",
"min",
";",
"int",
"newMax",
"=",
"max",
"==",
"RANGE_MAX",
"||",
"plus",
".",
"max",
"==",
"RANGE_MAX",
"?",
"RANGE_MAX",
":",
... | Sums the boundaries of this range with the ones of the passed. So the returned range has
this.min + plus.min as minimum and this.max + plus.max as maximum respectively.
@return a range object whose boundaries are summed | [
"Sums",
"the",
"boundaries",
"of",
"this",
"range",
"with",
"the",
"ones",
"of",
"the",
"passed",
".",
"So",
"the",
"returned",
"range",
"has",
"this",
".",
"min",
"+",
"plus",
".",
"min",
"as",
"minimum",
"and",
"this",
".",
"max",
"+",
"plus",
".",... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/Range.java#L69-L73 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/Link.java | Link.andAffordance | public Link andAffordance(String name, HttpMethod httpMethod, ResolvableType inputType,
List<QueryParameter> queryMethodParameters, ResolvableType outputType) {
"""
Convenience method when chaining an existing {@link Link}.
@param name
@param httpMethod
@param inputType
@param queryMethodParameters
@para... | java | public Link andAffordance(String name, HttpMethod httpMethod, ResolvableType inputType,
List<QueryParameter> queryMethodParameters, ResolvableType outputType) {
return andAffordance(new Affordance(name, this, httpMethod, inputType, queryMethodParameters, outputType));
} | [
"public",
"Link",
"andAffordance",
"(",
"String",
"name",
",",
"HttpMethod",
"httpMethod",
",",
"ResolvableType",
"inputType",
",",
"List",
"<",
"QueryParameter",
">",
"queryMethodParameters",
",",
"ResolvableType",
"outputType",
")",
"{",
"return",
"andAffordance",
... | Convenience method when chaining an existing {@link Link}.
@param name
@param httpMethod
@param inputType
@param queryMethodParameters
@param outputType
@return | [
"Convenience",
"method",
"when",
"chaining",
"an",
"existing",
"{",
"@link",
"Link",
"}",
"."
] | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/Link.java#L224-L227 |
m-m-m/util | cli/src/main/java/net/sf/mmm/util/cli/base/CliValueContainerMap.java | CliValueContainerMap.setValueEntry | @Override
protected void setValueEntry(String entry, GenericType<?> propertyType) {
"""
{@inheritDoc}
@param entry is a single map-entry in the form "key=value".
"""
int splitIndex = entry.indexOf('=');
if (splitIndex < 0) {
throw new NlsParseException(entry, "key=value", "MapEntry");
}... | java | @Override
protected void setValueEntry(String entry, GenericType<?> propertyType) {
int splitIndex = entry.indexOf('=');
if (splitIndex < 0) {
throw new NlsParseException(entry, "key=value", "MapEntry");
}
// key
String keyString = entry.substring(0, splitIndex);
GenericType<?> keyType ... | [
"@",
"Override",
"protected",
"void",
"setValueEntry",
"(",
"String",
"entry",
",",
"GenericType",
"<",
"?",
">",
"propertyType",
")",
"{",
"int",
"splitIndex",
"=",
"entry",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"splitIndex",
"<",
"0",
"... | {@inheritDoc}
@param entry is a single map-entry in the form "key=value". | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/cli/src/main/java/net/sf/mmm/util/cli/base/CliValueContainerMap.java#L60-L85 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java | JsiiEngine.findEnumValue | @SuppressWarnings( {
"""
Given a jsii enum ref in the form "fqn/member" returns the Java enum value for it.
@param enumRef The jsii enum ref.
@return The java enum value.
""" "unchecked", "rawtypes" })
public Enum<?> findEnumValue(final String enumRef) {
int sep = enumRef.lastIndexOf('/');
... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public Enum<?> findEnumValue(final String enumRef) {
int sep = enumRef.lastIndexOf('/');
if (sep == -1) {
throw new JsiiException("Malformed enum reference: " + enumRef);
}
String typeName = enumRef.substring(0, sep);
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"Enum",
"<",
"?",
">",
"findEnumValue",
"(",
"final",
"String",
"enumRef",
")",
"{",
"int",
"sep",
"=",
"enumRef",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
... | Given a jsii enum ref in the form "fqn/member" returns the Java enum value for it.
@param enumRef The jsii enum ref.
@return The java enum value. | [
"Given",
"a",
"jsii",
"enum",
"ref",
"in",
"the",
"form",
"fqn",
"/",
"member",
"returns",
"the",
"Java",
"enum",
"value",
"for",
"it",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java#L264-L279 |
CubeEngine/Dirigent | src/main/java/org/cubeengine/dirigent/formatter/DateTimeFormatter.java | DateTimeFormatter.parseDateFormatStyle | private int parseDateFormatStyle(String text, int defaultStyle) {
"""
Parses the style of the {@link DateFormat} from a string label.
@param text The string label.
@param defaultStyle The default style.
@return the parsed style or the default style if it's an incorrect style.
"""
if (text == nul... | java | private int parseDateFormatStyle(String text, int defaultStyle)
{
if (text == null)
{
return defaultStyle;
}
if (SHORT_STYLE.equalsIgnoreCase(text))
{
return DateFormat.SHORT;
}
else if (MEDIUM_STYLE.equalsIgnoreCase(text))
{
... | [
"private",
"int",
"parseDateFormatStyle",
"(",
"String",
"text",
",",
"int",
"defaultStyle",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"defaultStyle",
";",
"}",
"if",
"(",
"SHORT_STYLE",
".",
"equalsIgnoreCase",
"(",
"text",
")",
")",
... | Parses the style of the {@link DateFormat} from a string label.
@param text The string label.
@param defaultStyle The default style.
@return the parsed style or the default style if it's an incorrect style. | [
"Parses",
"the",
"style",
"of",
"the",
"{",
"@link",
"DateFormat",
"}",
"from",
"a",
"string",
"label",
"."
] | train | https://github.com/CubeEngine/Dirigent/blob/68587a8202754a6a6b629cc15e14c516806badaa/src/main/java/org/cubeengine/dirigent/formatter/DateTimeFormatter.java#L172-L196 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/BeanUtils.java | BeanUtils.getAllProperties | public static List<PropertyNode> getAllProperties(ClassNode type, boolean includeSuperProperties, boolean includeStatic, boolean includePseudoGetters, boolean includePseudoSetters, boolean superFirst) {
"""
Get all properties including JavaBean pseudo properties matching JavaBean getter or setter conventions.
@... | java | public static List<PropertyNode> getAllProperties(ClassNode type, boolean includeSuperProperties, boolean includeStatic, boolean includePseudoGetters, boolean includePseudoSetters, boolean superFirst) {
return getAllProperties(type, type, new HashSet<String>(), includeSuperProperties, includeStatic, includePseu... | [
"public",
"static",
"List",
"<",
"PropertyNode",
">",
"getAllProperties",
"(",
"ClassNode",
"type",
",",
"boolean",
"includeSuperProperties",
",",
"boolean",
"includeStatic",
",",
"boolean",
"includePseudoGetters",
",",
"boolean",
"includePseudoSetters",
",",
"boolean",... | Get all properties including JavaBean pseudo properties matching JavaBean getter or setter conventions.
@param type the ClassNode
@param includeSuperProperties whether to include super properties
@param includeStatic whether to include static properties
@param includePseudoGetters whether to include JavaBean pseudo (g... | [
"Get",
"all",
"properties",
"including",
"JavaBean",
"pseudo",
"properties",
"matching",
"JavaBean",
"getter",
"or",
"setter",
"conventions",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/BeanUtils.java#L66-L68 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d1/dfx/AbstractRectangularShape1dfx.java | AbstractRectangularShape1dfx.heightProperty | @Pure
public DoubleProperty heightProperty() {
"""
Replies the property that is the height of the box.
@return the height property.
"""
if (this.height == null) {
this.height = new SimpleDoubleProperty(this, MathFXAttributeNames.HEIGHT);
this.height.bind(Bindings.subtract(maxYProperty(), minYProper... | java | @Pure
public DoubleProperty heightProperty() {
if (this.height == null) {
this.height = new SimpleDoubleProperty(this, MathFXAttributeNames.HEIGHT);
this.height.bind(Bindings.subtract(maxYProperty(), minYProperty()));
}
return this.height;
} | [
"@",
"Pure",
"public",
"DoubleProperty",
"heightProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"height",
"==",
"null",
")",
"{",
"this",
".",
"height",
"=",
"new",
"SimpleDoubleProperty",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"HEIGHT",
")",
";"... | Replies the property that is the height of the box.
@return the height property. | [
"Replies",
"the",
"property",
"that",
"is",
"the",
"height",
"of",
"the",
"box",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d1/dfx/AbstractRectangularShape1dfx.java#L292-L299 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/cluster/RedisClusterClient.java | RedisClusterClient.connectToNode | <K, V> StatefulRedisConnection<K, V> connectToNode(RedisCodec<K, V> codec, String nodeId, RedisChannelWriter clusterWriter,
Mono<SocketAddress> socketAddressSupplier) {
"""
Create a connection to a redis socket address.
@param codec Use this codec to encode/decode keys and values, must not be {@lite... | java | <K, V> StatefulRedisConnection<K, V> connectToNode(RedisCodec<K, V> codec, String nodeId, RedisChannelWriter clusterWriter,
Mono<SocketAddress> socketAddressSupplier) {
return getConnection(connectToNodeAsync(codec, nodeId, clusterWriter, socketAddressSupplier));
} | [
"<",
"K",
",",
"V",
">",
"StatefulRedisConnection",
"<",
"K",
",",
"V",
">",
"connectToNode",
"(",
"RedisCodec",
"<",
"K",
",",
"V",
">",
"codec",
",",
"String",
"nodeId",
",",
"RedisChannelWriter",
"clusterWriter",
",",
"Mono",
"<",
"SocketAddress",
">",
... | Create a connection to a redis socket address.
@param codec Use this codec to encode/decode keys and values, must not be {@literal null}
@param nodeId the nodeId
@param clusterWriter global cluster writer
@param socketAddressSupplier supplier for the socket address
@param <K> Key type
@param <V> Value type
@return A n... | [
"Create",
"a",
"connection",
"to",
"a",
"redis",
"socket",
"address",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/RedisClusterClient.java#L466-L469 |
spring-projects/spring-social | spring-social-core/src/main/java/org/springframework/social/oauth2/OAuth2Template.java | OAuth2Template.createRestTemplate | protected RestTemplate createRestTemplate() {
"""
Creates the {@link RestTemplate} used to communicate with the provider's OAuth 2 API.
This implementation creates a RestTemplate with a minimal set of HTTP message converters ({@link FormHttpMessageConverter} and {@link MappingJackson2HttpMessageConverter}).
May ... | java | protected RestTemplate createRestTemplate() {
ClientHttpRequestFactory requestFactory = ClientHttpRequestFactorySelector.getRequestFactory();
RestTemplate restTemplate = new RestTemplate(requestFactory);
List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>(2);
converters.add(new For... | [
"protected",
"RestTemplate",
"createRestTemplate",
"(",
")",
"{",
"ClientHttpRequestFactory",
"requestFactory",
"=",
"ClientHttpRequestFactorySelector",
".",
"getRequestFactory",
"(",
")",
";",
"RestTemplate",
"restTemplate",
"=",
"new",
"RestTemplate",
"(",
"requestFactory... | Creates the {@link RestTemplate} used to communicate with the provider's OAuth 2 API.
This implementation creates a RestTemplate with a minimal set of HTTP message converters ({@link FormHttpMessageConverter} and {@link MappingJackson2HttpMessageConverter}).
May be overridden to customize how the RestTemplate is create... | [
"Creates",
"the",
"{"
] | train | https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-core/src/main/java/org/springframework/social/oauth2/OAuth2Template.java#L210-L228 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_lines_number_dslamPort_changeProfile_POST | public OvhTask serviceName_lines_number_dslamPort_changeProfile_POST(String serviceName, String number, Long dslamProfileId) throws IOException {
"""
Change the profile of the port
REST: POST /xdsl/{serviceName}/lines/{number}/dslamPort/changeProfile
@param dslamProfileId [required] The id of the xdsl.DslamLin... | java | public OvhTask serviceName_lines_number_dslamPort_changeProfile_POST(String serviceName, String number, Long dslamProfileId) throws IOException {
String qPath = "/xdsl/{serviceName}/lines/{number}/dslamPort/changeProfile";
StringBuilder sb = path(qPath, serviceName, number);
HashMap<String, Object>o = new HashMap... | [
"public",
"OvhTask",
"serviceName_lines_number_dslamPort_changeProfile_POST",
"(",
"String",
"serviceName",
",",
"String",
"number",
",",
"Long",
"dslamProfileId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/lines/{number}/dslamPort/changeP... | Change the profile of the port
REST: POST /xdsl/{serviceName}/lines/{number}/dslamPort/changeProfile
@param dslamProfileId [required] The id of the xdsl.DslamLineProfile
@param serviceName [required] The internal name of your XDSL offer
@param number [required] The number of the line | [
"Change",
"the",
"profile",
"of",
"the",
"port"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L477-L484 |
jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageQueue.java | BaseMessageQueue.getMessageReceiver | public BaseMessageReceiver getMessageReceiver() {
"""
Get the message receiver.
Create it if it doesn't exist.
@return The message receiver.
"""
if (m_receiver == null)
{
m_receiver = this.createMessageReceiver();
if (m_receiver != null)
new Thread(m_re... | java | public BaseMessageReceiver getMessageReceiver()
{
if (m_receiver == null)
{
m_receiver = this.createMessageReceiver();
if (m_receiver != null)
new Thread(m_receiver, "MessageReceiver").start();
}
return m_receiver;
} | [
"public",
"BaseMessageReceiver",
"getMessageReceiver",
"(",
")",
"{",
"if",
"(",
"m_receiver",
"==",
"null",
")",
"{",
"m_receiver",
"=",
"this",
".",
"createMessageReceiver",
"(",
")",
";",
"if",
"(",
"m_receiver",
"!=",
"null",
")",
"new",
"Thread",
"(",
... | Get the message receiver.
Create it if it doesn't exist.
@return The message receiver. | [
"Get",
"the",
"message",
"receiver",
".",
"Create",
"it",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageQueue.java#L170-L179 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/cellprocessor/constraint/LengthBetween.java | LengthBetween.execute | @SuppressWarnings("unchecked")
public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
{@literal if value is null}
@throws SuperCsvConstraintViolationException
{@literal if length is < min or length > max}
"""
... | java | @SuppressWarnings("unchecked")
public Object execute(final Object value, final CsvContext context) {
if(value == null) {
return next.execute(value, context);
}
final String stringValue = value.toString();
final int length = stringValue.length();
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"next",
".",
"execute",
"(",
"value",... | {@inheritDoc}
@throws SuperCsvCellProcessorException
{@literal if value is null}
@throws SuperCsvConstraintViolationException
{@literal if length is < min or length > max} | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/cellprocessor/constraint/LengthBetween.java#L67-L89 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java | VirtualHubsInner.beginDelete | public void beginDelete(String resourceGroupName, String virtualHubName) {
"""
Deletes a VirtualHub.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorExc... | java | public void beginDelete(String resourceGroupName, String virtualHubName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, virtualHubName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualHubName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualHubName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
... | Deletes a VirtualHub.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorException thrown if the request is rejected by server
@throws RuntimeException all other wra... | [
"Deletes",
"a",
"VirtualHub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java#L758-L760 |
LearnLib/automatalib | util/src/main/java/net/automatalib/util/automata/minimizer/hopcroft/HopcroftMinimization.java | HopcroftMinimization.minimizeMealy | public static <S, I, T, O, A extends MealyMachine<S, I, T, O> & InputAlphabetHolder<I>> CompactMealy<I, O> minimizeMealy(A mealy) {
"""
Minimizes the given Mealy machine. The result is returned in the form of a {@link CompactMealy}, using the
alphabet obtained via <code>mealy.{@link InputAlphabetHolder#getInputAl... | java | public static <S, I, T, O, A extends MealyMachine<S, I, T, O> & InputAlphabetHolder<I>> CompactMealy<I, O> minimizeMealy(A mealy) {
return minimizeMealy(mealy, PruningMode.PRUNE_AFTER);
} | [
"public",
"static",
"<",
"S",
",",
"I",
",",
"T",
",",
"O",
",",
"A",
"extends",
"MealyMachine",
"<",
"S",
",",
"I",
",",
"T",
",",
"O",
">",
"&",
"InputAlphabetHolder",
"<",
"I",
">",
">",
"CompactMealy",
"<",
"I",
",",
"O",
">",
"minimizeMealy"... | Minimizes the given Mealy machine. The result is returned in the form of a {@link CompactMealy}, using the
alphabet obtained via <code>mealy.{@link InputAlphabetHolder#getInputAlphabet() getInputAlphabet()}</code>.
Pruning (see above) is performed after computing state equivalences.
@param mealy
the Mealy machine to m... | [
"Minimizes",
"the",
"given",
"Mealy",
"machine",
".",
"The",
"result",
"is",
"returned",
"in",
"the",
"form",
"of",
"a",
"{",
"@link",
"CompactMealy",
"}",
"using",
"the",
"alphabet",
"obtained",
"via",
"<code",
">",
"mealy",
".",
"{",
"@link",
"InputAlpha... | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/util/src/main/java/net/automatalib/util/automata/minimizer/hopcroft/HopcroftMinimization.java#L103-L105 |
undertow-io/undertow | core/src/main/java/io/undertow/util/DateUtils.java | DateUtils.parseDate | public static Date parseDate(final String date) {
"""
Attempts to pass a HTTP date.
@param date The date to parse
@return The parsed date, or null if parsing failed
"""
/*
IE9 sends a superflous lenght parameter after date in the
If-Modified-Since header, which needs to be ... | java | public static Date parseDate(final String date) {
/*
IE9 sends a superflous lenght parameter after date in the
If-Modified-Since header, which needs to be stripped before
parsing.
*/
final int semicolonIndex = date.indexOf(';');
final String trimme... | [
"public",
"static",
"Date",
"parseDate",
"(",
"final",
"String",
"date",
")",
"{",
"/*\n IE9 sends a superflous lenght parameter after date in the\n If-Modified-Since header, which needs to be stripped before\n parsing.\n\n */",
"final",
"int",
"sem... | Attempts to pass a HTTP date.
@param date The date to parse
@return The parsed date, or null if parsing failed | [
"Attempts",
"to",
"pass",
"a",
"HTTP",
"date",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/util/DateUtils.java#L126-L171 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.hasAnnotation | public static boolean hasAnnotation(final ClassNode classNode, final Class<? extends Annotation> annotationClass) {
"""
Returns true if classNode is marked with annotationClass
@param classNode A ClassNode to inspect
@param annotationClass an annotation to look for
@return true if classNode is marked with annot... | java | public static boolean hasAnnotation(final ClassNode classNode, final Class<? extends Annotation> annotationClass) {
return !classNode.getAnnotations(new ClassNode(annotationClass)).isEmpty();
} | [
"public",
"static",
"boolean",
"hasAnnotation",
"(",
"final",
"ClassNode",
"classNode",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"{",
"return",
"!",
"classNode",
".",
"getAnnotations",
"(",
"new",
"ClassNode",
"(",
... | Returns true if classNode is marked with annotationClass
@param classNode A ClassNode to inspect
@param annotationClass an annotation to look for
@return true if classNode is marked with annotationClass, otherwise false | [
"Returns",
"true",
"if",
"classNode",
"is",
"marked",
"with",
"annotationClass"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L945-L947 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java | MarshallUtil.marshallIntCollection | public static void marshallIntCollection(Collection<Integer> collection, ObjectOutput out) throws IOException {
"""
Marshalls a collection of integers.
@param collection the collection to marshall.
@param out the {@link ObjectOutput} to write to.
@throws IOException if an error occurs.
"""
fi... | java | public static void marshallIntCollection(Collection<Integer> collection, ObjectOutput out) throws IOException {
final int size = collection == null ? NULL_VALUE : collection.size();
marshallSize(out, size);
if (size <= 0) {
return;
}
for (Integer integer : collection) {
o... | [
"public",
"static",
"void",
"marshallIntCollection",
"(",
"Collection",
"<",
"Integer",
">",
"collection",
",",
"ObjectOutput",
"out",
")",
"throws",
"IOException",
"{",
"final",
"int",
"size",
"=",
"collection",
"==",
"null",
"?",
"NULL_VALUE",
":",
"collection... | Marshalls a collection of integers.
@param collection the collection to marshall.
@param out the {@link ObjectOutput} to write to.
@throws IOException if an error occurs. | [
"Marshalls",
"a",
"collection",
"of",
"integers",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java#L469-L478 |
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.beginCreateAsync | public Observable<DataLakeAnalyticsAccountInner> beginCreateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) {
"""
Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads.
@param resourceGroupName... | java | public Observable<DataLakeAnalyticsAccountInner> beginCreateAsync(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<DataLakeAnalyticsAccountInner>, DataLakeAnalyticsAcco... | [
"public",
"Observable",
"<",
"DataLakeAnalyticsAccountInner",
">",
"beginCreateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"DataLakeAnalyticsAccountInner",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroup... | Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake Analytics workloads.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.the account will be associated with.
@param name The name of the Data Lake A... | [
"Creates",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
".",
"This",
"supplies",
"the",
"user",
"with",
"computation",
"services",
"for",
"Data",
"Lake",
"Analytics",
"workloads",
"."
] | 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#L2702-L2709 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java | TypeConversion.varIntBytesToLong | public static long varIntBytesToLong(byte[] bytes, int offset) {
"""
Reads a long from the byte array in the Varint format.
@param bytes - byte buffer to read
@param offset - the offset within the bytes buffer to start reading
@return - returns the long value
"""
int shift = 0;
long result =... | java | public static long varIntBytesToLong(byte[] bytes, int offset) {
int shift = 0;
long result = 0;
while (shift < 64) {
final byte b = bytes[offset++];
result |= (long)(b & 0x7F) << shift;
if ((b & 0x80) == 0) {
return result;
}
... | [
"public",
"static",
"long",
"varIntBytesToLong",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
")",
"{",
"int",
"shift",
"=",
"0",
";",
"long",
"result",
"=",
"0",
";",
"while",
"(",
"shift",
"<",
"64",
")",
"{",
"final",
"byte",
"b",
"=",
... | Reads a long from the byte array in the Varint format.
@param bytes - byte buffer to read
@param offset - the offset within the bytes buffer to start reading
@return - returns the long value | [
"Reads",
"a",
"long",
"from",
"the",
"byte",
"array",
"in",
"the",
"Varint",
"format",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java#L156-L168 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/rule/AbstractRule.java | AbstractRule.createViolationForImport | protected Violation createViolationForImport(SourceCode sourceCode, ImportNode importNode, String message) {
"""
Create and return a new Violation for this rule and the specified import
@param sourceCode - the SourceCode
@param importNode - the ImportNode for the import triggering the violation
@return a new Vi... | java | protected Violation createViolationForImport(SourceCode sourceCode, ImportNode importNode, String message) {
Map importInfo = ImportUtil.sourceLineAndNumberForImport(sourceCode, importNode);
Violation violation = new Violation();
violation.setRule(this);
violation.setSourceLine((String) ... | [
"protected",
"Violation",
"createViolationForImport",
"(",
"SourceCode",
"sourceCode",
",",
"ImportNode",
"importNode",
",",
"String",
"message",
")",
"{",
"Map",
"importInfo",
"=",
"ImportUtil",
".",
"sourceLineAndNumberForImport",
"(",
"sourceCode",
",",
"importNode",... | Create and return a new Violation for this rule and the specified import
@param sourceCode - the SourceCode
@param importNode - the ImportNode for the import triggering the violation
@return a new Violation object | [
"Create",
"and",
"return",
"a",
"new",
"Violation",
"for",
"this",
"rule",
"and",
"the",
"specified",
"import"
] | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/rule/AbstractRule.java#L221-L229 |
jgroups-extras/jgroups-kubernetes | src/main/java/org/jgroups/protocols/kubernetes/pem/Asn1Object.java | Asn1Object.getString | public String getString() throws IOException {
"""
Get value as string. Most strings are treated
as Latin-1.
@return Java string
@throws IOException
"""
String encoding;
switch (type) {
// Not all are Latin-1 but it's the closest thing
case DerParser.NUMERIC_STRIN... | java | public String getString() throws IOException {
String encoding;
switch (type) {
// Not all are Latin-1 but it's the closest thing
case DerParser.NUMERIC_STRING:
case DerParser.PRINTABLE_STRING:
case DerParser.VIDEOTEX_STRING:
case DerParser.IA5_STRING... | [
"public",
"String",
"getString",
"(",
")",
"throws",
"IOException",
"{",
"String",
"encoding",
";",
"switch",
"(",
"type",
")",
"{",
"// Not all are Latin-1 but it's the closest thing\r",
"case",
"DerParser",
".",
"NUMERIC_STRING",
":",
"case",
"DerParser",
".",
"PR... | Get value as string. Most strings are treated
as Latin-1.
@return Java string
@throws IOException | [
"Get",
"value",
"as",
"string",
".",
"Most",
"strings",
"are",
"treated",
"as",
"Latin",
"-",
"1",
"."
] | train | https://github.com/jgroups-extras/jgroups-kubernetes/blob/f3e42b540c61e860e749c501849312c0c224f3fb/src/main/java/org/jgroups/protocols/kubernetes/pem/Asn1Object.java#L116-L149 |
overview/mime-types | src/main/java/org/overviewproject/mime_types/MimeTypeDetector.java | MimeTypeDetector.matchletMagicCompare | private boolean matchletMagicCompare(int offset, byte[] data) {
"""
Returns whether data satisfies the matchlet and its children.
"""
if (oneMatchletMagicEquals(offset, data)) {
int nChildren = content.getInt(offset + 24);
if (nChildren > 0) {
int firstChildOffset ... | java | private boolean matchletMagicCompare(int offset, byte[] data) {
if (oneMatchletMagicEquals(offset, data)) {
int nChildren = content.getInt(offset + 24);
if (nChildren > 0) {
int firstChildOffset = content.getInt(offset + 28);
return matchletMagicCompareOr(nC... | [
"private",
"boolean",
"matchletMagicCompare",
"(",
"int",
"offset",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"if",
"(",
"oneMatchletMagicEquals",
"(",
"offset",
",",
"data",
")",
")",
"{",
"int",
"nChildren",
"=",
"content",
".",
"getInt",
"(",
"offset",
... | Returns whether data satisfies the matchlet and its children. | [
"Returns",
"whether",
"data",
"satisfies",
"the",
"matchlet",
"and",
"its",
"children",
"."
] | train | https://github.com/overview/mime-types/blob/d5c45302049c0cd5e634a50954304d8ddeb9abb4/src/main/java/org/overviewproject/mime_types/MimeTypeDetector.java#L466-L479 |
keyboardsurfer/Crouton | library/src/main/java/de/keyboardsurfer/android/widget/crouton/Crouton.java | Crouton.show | public static void show(Activity activity, View customView, int viewGroupResId) {
"""
Creates a {@link Crouton} with provided text and style for a given activity
and displays it directly.
@param activity
The {@link Activity} that represents the context in which the Crouton should exist.
@param customView
Th... | java | public static void show(Activity activity, View customView, int viewGroupResId) {
make(activity, customView, viewGroupResId).show();
} | [
"public",
"static",
"void",
"show",
"(",
"Activity",
"activity",
",",
"View",
"customView",
",",
"int",
"viewGroupResId",
")",
"{",
"make",
"(",
"activity",
",",
"customView",
",",
"viewGroupResId",
")",
".",
"show",
"(",
")",
";",
"}"
] | Creates a {@link Crouton} with provided text and style for a given activity
and displays it directly.
@param activity
The {@link Activity} that represents the context in which the Crouton should exist.
@param customView
The custom {@link View} to display
@param viewGroupResId
The resource id of the {@link ViewGroup} t... | [
"Creates",
"a",
"{",
"@link",
"Crouton",
"}",
"with",
"provided",
"text",
"and",
"style",
"for",
"a",
"given",
"activity",
"and",
"displays",
"it",
"directly",
"."
] | train | https://github.com/keyboardsurfer/Crouton/blob/7806b15e4d52793e1f5aeaa4a55b1e220289e619/library/src/main/java/de/keyboardsurfer/android/widget/crouton/Crouton.java#L477-L479 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java | DatabasesInner.addPrincipals | public DatabasePrincipalListResultInner addPrincipals(String resourceGroupName, String clusterName, String databaseName) {
"""
Add Database principals permissions.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param dat... | java | public DatabasePrincipalListResultInner addPrincipals(String resourceGroupName, String clusterName, String databaseName) {
return addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body();
} | [
"public",
"DatabasePrincipalListResultInner",
"addPrincipals",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"databaseName",
")",
"{",
"return",
"addPrincipalsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
",",
"d... | Add Database principals permissions.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param databaseName The name of the database in the Kusto cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@thro... | [
"Add",
"Database",
"principals",
"permissions",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java#L1045-L1047 |
cryptomator/webdav-nio-adapter | src/main/java/org/cryptomator/frontend/webdav/mount/ProcessUtil.java | ProcessUtil.assertExitValue | public static void assertExitValue(Process proc, int expectedExitValue) throws CommandFailedException {
"""
Fails with a CommandFailedException, if the process did not finish with the expected exit code.
@param proc A finished process
@param expectedExitValue Exit code returned by the process
@throws CommandF... | java | public static void assertExitValue(Process proc, int expectedExitValue) throws CommandFailedException {
int actualExitValue = proc.exitValue();
if (actualExitValue != expectedExitValue) {
try {
String error = toString(proc.getErrorStream(), StandardCharsets.UTF_8);
throw new CommandFailedException("Comma... | [
"public",
"static",
"void",
"assertExitValue",
"(",
"Process",
"proc",
",",
"int",
"expectedExitValue",
")",
"throws",
"CommandFailedException",
"{",
"int",
"actualExitValue",
"=",
"proc",
".",
"exitValue",
"(",
")",
";",
"if",
"(",
"actualExitValue",
"!=",
"exp... | Fails with a CommandFailedException, if the process did not finish with the expected exit code.
@param proc A finished process
@param expectedExitValue Exit code returned by the process
@throws CommandFailedException Thrown in case of unexpected exit values | [
"Fails",
"with",
"a",
"CommandFailedException",
"if",
"the",
"process",
"did",
"not",
"finish",
"with",
"the",
"expected",
"exit",
"code",
"."
] | train | https://github.com/cryptomator/webdav-nio-adapter/blob/55b0d7dccea9a4ede0a30a95583d8f04c8a86d18/src/main/java/org/cryptomator/frontend/webdav/mount/ProcessUtil.java#L23-L33 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/compat/log/AbstractLogger.java | AbstractLogger.error | public void error(String message, Object... args) {
"""
Log a formatted message at debug level.
@param message the message to log
@param args the arguments for that message
"""
error(String.format(message, args), getThrowable(args));
} | java | public void error(String message, Object... args) {
error(String.format(message, args), getThrowable(args));
} | [
"public",
"void",
"error",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"error",
"(",
"String",
".",
"format",
"(",
"message",
",",
"args",
")",
",",
"getThrowable",
"(",
"args",
")",
")",
";",
"}"
] | Log a formatted message at debug level.
@param message the message to log
@param args the arguments for that message | [
"Log",
"a",
"formatted",
"message",
"at",
"debug",
"level",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/compat/log/AbstractLogger.java#L219-L221 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | FieldUtils.readStaticField | public static Object readStaticField(final Field field, final boolean forceAccess) throws IllegalAccessException {
"""
Reads a static {@link Field}.
@param field
to read
@param forceAccess
whether to break scope restrictions using the
{@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method.... | java | public static Object readStaticField(final Field field, final boolean forceAccess) throws IllegalAccessException {
Validate.isTrue(field != null, "The field must not be null");
Validate.isTrue(Modifier.isStatic(field.getModifiers()), "The field '%s' is not static", field.getName());
return readF... | [
"public",
"static",
"Object",
"readStaticField",
"(",
"final",
"Field",
"field",
",",
"final",
"boolean",
"forceAccess",
")",
"throws",
"IllegalAccessException",
"{",
"Validate",
".",
"isTrue",
"(",
"field",
"!=",
"null",
",",
"\"The field must not be null\"",
")",
... | Reads a static {@link Field}.
@param field
to read
@param forceAccess
whether to break scope restrictions using the
{@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method.
@return the field value
@throws IllegalArgumentException
if the field is {@code null} or not {@code static}
@throws IllegalAccess... | [
"Reads",
"a",
"static",
"{",
"@link",
"Field",
"}",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L296-L300 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/concurrency/CudaAffinityManager.java | CudaAffinityManager.attachThreadToDevice | @Override
public void attachThreadToDevice(long threadId, Integer deviceId) {
"""
This method pairs specified thread & device
@param threadId
@param deviceId
"""
val t = Thread.currentThread();
String name = "N/A";
if (t.getId() == threadId)
name = t.getName();
... | java | @Override
public void attachThreadToDevice(long threadId, Integer deviceId) {
val t = Thread.currentThread();
String name = "N/A";
if (t.getId() == threadId)
name = t.getName();
List<Integer> devices = new ArrayList<>(CudaEnvironment.getInstance().getConfiguration().getA... | [
"@",
"Override",
"public",
"void",
"attachThreadToDevice",
"(",
"long",
"threadId",
",",
"Integer",
"deviceId",
")",
"{",
"val",
"t",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"String",
"name",
"=",
"\"N/A\"",
";",
"if",
"(",
"t",
".",
"getId",... | This method pairs specified thread & device
@param threadId
@param deviceId | [
"This",
"method",
"pairs",
"specified",
"thread",
"&",
"device"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/concurrency/CudaAffinityManager.java#L154-L165 |
dbflute-session/tomcat-boot | src/main/java/org/dbflute/tomcat/util/BotmReflectionUtil.java | BotmReflectionUtil.getWholeMethod | public static Method getWholeMethod(Class<?> clazz, String methodName, Class<?>[] argTypes) {
"""
Get the method in whole methods that means as follows:
<pre>
o target class's methods = all
o superclass's methods = all (also contains private)
</pre>
And no cache so you should cache it yourself if you call s... | java | public static Method getWholeMethod(Class<?> clazz, String methodName, Class<?>[] argTypes) {
assertObjectNotNull("clazz", clazz);
assertStringNotNullAndNotTrimmedEmpty("methodName", methodName);
return findMethod(clazz, methodName, argTypes, VisibilityType.WHOLE, false);
} | [
"public",
"static",
"Method",
"getWholeMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"argTypes",
")",
"{",
"assertObjectNotNull",
"(",
"\"clazz\"",
",",
"clazz",
")",
";",
"assertStringNo... | Get the method in whole methods that means as follows:
<pre>
o target class's methods = all
o superclass's methods = all (also contains private)
</pre>
And no cache so you should cache it yourself if you call several times.
@param clazz The type of class that defines the method. (NotNull)
@param methodName The name o... | [
"Get",
"the",
"method",
"in",
"whole",
"methods",
"that",
"means",
"as",
"follows",
":",
"<pre",
">",
"o",
"target",
"class",
"s",
"methods",
"=",
"all",
"o",
"superclass",
"s",
"methods",
"=",
"all",
"(",
"also",
"contains",
"private",
")",
"<",
"/",
... | train | https://github.com/dbflute-session/tomcat-boot/blob/fe941f88b6be083781873126f5b12d4c16bb9073/src/main/java/org/dbflute/tomcat/util/BotmReflectionUtil.java#L402-L406 |
spring-projects/spring-boot | spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFiles.java | ClassLoaderFiles.addFile | public void addFile(String sourceFolder, String name, ClassLoaderFile file) {
"""
Add a single {@link ClassLoaderFile} to the collection.
@param sourceFolder the source folder of the file
@param name the name of the file
@param file the file to add
"""
Assert.notNull(sourceFolder, "SourceFolder must not b... | java | public void addFile(String sourceFolder, String name, ClassLoaderFile file) {
Assert.notNull(sourceFolder, "SourceFolder must not be null");
Assert.notNull(name, "Name must not be null");
Assert.notNull(file, "File must not be null");
removeAll(name);
getOrCreateSourceFolder(sourceFolder).add(name, file);
} | [
"public",
"void",
"addFile",
"(",
"String",
"sourceFolder",
",",
"String",
"name",
",",
"ClassLoaderFile",
"file",
")",
"{",
"Assert",
".",
"notNull",
"(",
"sourceFolder",
",",
"\"SourceFolder must not be null\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"name",... | Add a single {@link ClassLoaderFile} to the collection.
@param sourceFolder the source folder of the file
@param name the name of the file
@param file the file to add | [
"Add",
"a",
"single",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFiles.java#L91-L97 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/converter/MapResultSetConverter.java | MapResultSetConverter.getValue | private Object getValue(final ResultSet rs, final ResultSetMetaData rsmd, final int columnIndex)
throws SQLException {
"""
ResultSetからMapperManager経由で値を取得する
@param rs ResultSet
@param rsmd ResultSetMetadata
@param columnIndex カラムインデックス
@return 指定したカラムインデックスの値
@throws SQLException
"""
JavaType javaT... | java | private Object getValue(final ResultSet rs, final ResultSetMetaData rsmd, final int columnIndex)
throws SQLException {
JavaType javaType = this.dialect.getJavaType(rsmd.getColumnType(columnIndex),
rsmd.getColumnTypeName(columnIndex));
return this.mapperManager.getValue(javaType, rs, columnIndex);
} | [
"private",
"Object",
"getValue",
"(",
"final",
"ResultSet",
"rs",
",",
"final",
"ResultSetMetaData",
"rsmd",
",",
"final",
"int",
"columnIndex",
")",
"throws",
"SQLException",
"{",
"JavaType",
"javaType",
"=",
"this",
".",
"dialect",
".",
"getJavaType",
"(",
"... | ResultSetからMapperManager経由で値を取得する
@param rs ResultSet
@param rsmd ResultSetMetadata
@param columnIndex カラムインデックス
@return 指定したカラムインデックスの値
@throws SQLException | [
"ResultSetからMapperManager経由で値を取得する"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/converter/MapResultSetConverter.java#L91-L96 |
zxing/zxing | core/src/main/java/com/google/zxing/aztec/decoder/Decoder.java | Decoder.readCode | private static int readCode(boolean[] rawbits, int startIndex, int length) {
"""
Reads a code of given length and at given index in an array of bits
"""
int res = 0;
for (int i = startIndex; i < startIndex + length; i++) {
res <<= 1;
if (rawbits[i]) {
res |= 0x01;
}
}
... | java | private static int readCode(boolean[] rawbits, int startIndex, int length) {
int res = 0;
for (int i = startIndex; i < startIndex + length; i++) {
res <<= 1;
if (rawbits[i]) {
res |= 0x01;
}
}
return res;
} | [
"private",
"static",
"int",
"readCode",
"(",
"boolean",
"[",
"]",
"rawbits",
",",
"int",
"startIndex",
",",
"int",
"length",
")",
"{",
"int",
"res",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"startIndex",
";",
"i",
"<",
"startIndex",
"+",
"length",... | Reads a code of given length and at given index in an array of bits | [
"Reads",
"a",
"code",
"of",
"given",
"length",
"and",
"at",
"given",
"index",
"in",
"an",
"array",
"of",
"bits"
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/aztec/decoder/Decoder.java#L330-L339 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallsInner.java | AzureFirewallsInner.createOrUpdate | public AzureFirewallInner createOrUpdate(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) {
"""
Creates or updates the specified Azure Firewall.
@param resourceGroupName The name of the resource group.
@param azureFirewallName The name of the Azure Firewall.
@param parameters... | java | public AzureFirewallInner createOrUpdate(String resourceGroupName, String azureFirewallName, AzureFirewallInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, azureFirewallName, parameters).toBlocking().last().body();
} | [
"public",
"AzureFirewallInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"azureFirewallName",
",",
"AzureFirewallInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"azureFirewallName",
... | Creates or updates the specified Azure Firewall.
@param resourceGroupName The name of the resource group.
@param azureFirewallName The name of the Azure Firewall.
@param parameters Parameters supplied to the create or update Azure Firewall operation.
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Creates",
"or",
"updates",
"the",
"specified",
"Azure",
"Firewall",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/AzureFirewallsInner.java#L351-L353 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/HandlablesImpl.java | HandlablesImpl.removeSuperClass | private void removeSuperClass(Object object, Class<?> type) {
"""
Remove object parent super type.
@param object The current object to check.
@param type The current class level to check.
"""
for (final Class<?> types : type.getInterfaces())
{
remove(types, object);
... | java | private void removeSuperClass(Object object, Class<?> type)
{
for (final Class<?> types : type.getInterfaces())
{
remove(types, object);
}
final Class<?> parent = type.getSuperclass();
if (parent != null)
{
removeSuperClass(object, par... | [
"private",
"void",
"removeSuperClass",
"(",
"Object",
"object",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"for",
"(",
"final",
"Class",
"<",
"?",
">",
"types",
":",
"type",
".",
"getInterfaces",
"(",
")",
")",
"{",
"remove",
"(",
"types",
",",
... | Remove object parent super type.
@param object The current object to check.
@param type The current class level to check. | [
"Remove",
"object",
"parent",
"super",
"type",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/HandlablesImpl.java#L158-L169 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.batchMmul | public SDVariable[] batchMmul(String[] names, SDVariable[] matricesA, SDVariable[] matricesB,
boolean transposeA, boolean transposeB) {
"""
Matrix multiply a batch of matrices. matricesA and matricesB have to be arrays of same
length and each pair taken from these sets has to hav... | java | public SDVariable[] batchMmul(String[] names, SDVariable[] matricesA, SDVariable[] matricesB,
boolean transposeA, boolean transposeB) {
validateSameType("batchMmul", true, matricesA);
validateSameType("batchMmul", true, matricesB);
SDVariable[] result = f().batc... | [
"public",
"SDVariable",
"[",
"]",
"batchMmul",
"(",
"String",
"[",
"]",
"names",
",",
"SDVariable",
"[",
"]",
"matricesA",
",",
"SDVariable",
"[",
"]",
"matricesB",
",",
"boolean",
"transposeA",
",",
"boolean",
"transposeB",
")",
"{",
"validateSameType",
"("... | Matrix multiply a batch of matrices. matricesA and matricesB have to be arrays of same
length and each pair taken from these sets has to have dimensions (M, N) and (N, K),
respectively. If transposeA is true, matrices from matricesA will have shape (N, M) instead.
Likewise, if transposeB is true, matrices from matrices... | [
"Matrix",
"multiply",
"a",
"batch",
"of",
"matrices",
".",
"matricesA",
"and",
"matricesB",
"have",
"to",
"be",
"arrays",
"of",
"same",
"length",
"and",
"each",
"pair",
"taken",
"from",
"these",
"sets",
"has",
"to",
"have",
"dimensions",
"(",
"M",
"N",
"... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L247-L253 |
softindex/datakernel | core-eventloop/src/main/java/io/datakernel/util/ReflectionUtils.java | ReflectionUtils.getAnnotationString | public static String getAnnotationString(Annotation annotation) throws ReflectiveOperationException {
"""
Builds string representation of annotation with its elements.
The string looks differently depending on the number of elements, that an annotation has.
If annotation has no elements, string looks like this :... | java | public static String getAnnotationString(Annotation annotation) throws ReflectiveOperationException {
Class<? extends Annotation> annotationType = annotation.annotationType();
StringBuilder annotationString = new StringBuilder();
Method[] annotationElements = filterNonEmptyElements(annotation);
if (annotationEl... | [
"public",
"static",
"String",
"getAnnotationString",
"(",
"Annotation",
"annotation",
")",
"throws",
"ReflectiveOperationException",
"{",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
"=",
"annotation",
".",
"annotationType",
"(",
")",
";",
"Str... | Builds string representation of annotation with its elements.
The string looks differently depending on the number of elements, that an annotation has.
If annotation has no elements, string looks like this : "AnnotationName"
If annotation has a single element with the name "value", string looks like this : "AnnotationN... | [
"Builds",
"string",
"representation",
"of",
"annotation",
"with",
"its",
"elements",
".",
"The",
"string",
"looks",
"differently",
"depending",
"on",
"the",
"number",
"of",
"elements",
"that",
"an",
"annotation",
"has",
".",
"If",
"annotation",
"has",
"no",
"e... | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-eventloop/src/main/java/io/datakernel/util/ReflectionUtils.java#L336-L366 |
tdomzal/junit-docker-rule | src/main/java/pl/domzal/junit/docker/rule/WaitForContainer.java | WaitForContainer.waitForCondition | static void waitForCondition(final StartConditionCheck condition, int timeoutSeconds, final String containerDescription) throws TimeoutException {
"""
Wait till all given conditions are met.
@param condition Conditions to wait for - all must be met to continue.
@param timeoutSeconds Wait timeout.
@param conta... | java | static void waitForCondition(final StartConditionCheck condition, int timeoutSeconds, final String containerDescription) throws TimeoutException {
try {
log.info("wait for {} started", condition.describe());
new WaitForUnit(TimeUnit.SECONDS, timeoutSeconds, TimeUnit.SECONDS, 1, new WaitF... | [
"static",
"void",
"waitForCondition",
"(",
"final",
"StartConditionCheck",
"condition",
",",
"int",
"timeoutSeconds",
",",
"final",
"String",
"containerDescription",
")",
"throws",
"TimeoutException",
"{",
"try",
"{",
"log",
".",
"info",
"(",
"\"wait for {} started\""... | Wait till all given conditions are met.
@param condition Conditions to wait for - all must be met to continue.
@param timeoutSeconds Wait timeout.
@param containerDescription Container description. For log and exception message usage only. | [
"Wait",
"till",
"all",
"given",
"conditions",
"are",
"met",
"."
] | train | https://github.com/tdomzal/junit-docker-rule/blob/5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2/src/main/java/pl/domzal/junit/docker/rule/WaitForContainer.java#L25-L42 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.pressText | public static void pressText(Image srcImage, File destFile, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException {
"""
给图片添加文字水印<br>
此方法并不关闭流
@param srcImage 源图像
@param destFile 目标流
@param pressText 水印文字
@param color 水印的字体颜色
@param font {@link Font} 字体相关信息,如果默认则为{@... | java | public static void pressText(Image srcImage, File destFile, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException {
write(pressText(srcImage, pressText, color, font, x, y, alpha), destFile);
} | [
"public",
"static",
"void",
"pressText",
"(",
"Image",
"srcImage",
",",
"File",
"destFile",
",",
"String",
"pressText",
",",
"Color",
"color",
",",
"Font",
"font",
",",
"int",
"x",
",",
"int",
"y",
",",
"float",
"alpha",
")",
"throws",
"IORuntimeException"... | 给图片添加文字水印<br>
此方法并不关闭流
@param srcImage 源图像
@param destFile 目标流
@param pressText 水印文字
@param color 水印的字体颜色
@param font {@link Font} 字体相关信息,如果默认则为{@code null}
@param x 修正值。 默认在中间,偏移量相对于中间偏移
@param y 修正值。 默认在中间,偏移量相对于中间偏移
@param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字
@throws IORuntimeException IO异常
@since 3.2.... | [
"给图片添加文字水印<br",
">",
"此方法并不关闭流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L807-L809 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java | FlowControllerFactory.createSharedFlow | public SharedFlowController createSharedFlow( RequestContext context, String sharedFlowClassName )
throws ClassNotFoundException, InstantiationException, IllegalAccessException {
"""
Create a {@link SharedFlowController} of the given type.
@param context a {@link RequestContext} object which contain... | java | public SharedFlowController createSharedFlow( RequestContext context, String sharedFlowClassName )
throws ClassNotFoundException, InstantiationException, IllegalAccessException
{
Class sharedFlowClass = getFlowControllerClass( sharedFlowClassName );
return createSharedFlow( context, shar... | [
"public",
"SharedFlowController",
"createSharedFlow",
"(",
"RequestContext",
"context",
",",
"String",
"sharedFlowClassName",
")",
"throws",
"ClassNotFoundException",
",",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"Class",
"sharedFlowClass",
"=",
"getFlowC... | Create a {@link SharedFlowController} of the given type.
@param context a {@link RequestContext} object which contains the current request and response.
@param sharedFlowClassName the type name of the desired SharedFlowController.
@return the newly-created SharedFlowController, or <code>null</code> if none was found. | [
"Create",
"a",
"{",
"@link",
"SharedFlowController",
"}",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java#L402-L407 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java | SftpClient.get | public SftpFileAttributes get(String path, boolean resume)
throws FileNotFoundException, SftpStatusException, SshException,
TransferCancelledException {
"""
<p>
Download the remote file to the local computer
@param path
the path to the remote file
@param resume
attempt to resume an interrupted downloa... | java | public SftpFileAttributes get(String path, boolean resume)
throws FileNotFoundException, SftpStatusException, SshException,
TransferCancelledException {
return get(path, (FileTransferProgress) null, resume);
} | [
"public",
"SftpFileAttributes",
"get",
"(",
"String",
"path",
",",
"boolean",
"resume",
")",
"throws",
"FileNotFoundException",
",",
"SftpStatusException",
",",
"SshException",
",",
"TransferCancelledException",
"{",
"return",
"get",
"(",
"path",
",",
"(",
"FileTran... | <p>
Download the remote file to the local computer
@param path
the path to the remote file
@param resume
attempt to resume an interrupted download
@return the downloaded file's attributes
@throws FileNotFoundException
@throws SftpStatusException
@throws SshException
@throws TransferCancelledException | [
"<p",
">",
"Download",
"the",
"remote",
"file",
"to",
"the",
"local",
"computer"
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java#L854-L858 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_POST | public OvhTask serviceName_datacenter_POST(String serviceName, String commercialRangeName, String vrackName) throws IOException {
"""
Add a new Datacenter in your Private Cloud
REST: POST /dedicatedCloud/{serviceName}/datacenter
@param vrackName [required] Name of the Vrack link to the new datacenter.
@param ... | java | public OvhTask serviceName_datacenter_POST(String serviceName, String commercialRangeName, String vrackName) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "commerci... | [
"public",
"OvhTask",
"serviceName_datacenter_POST",
"(",
"String",
"serviceName",
",",
"String",
"commercialRangeName",
",",
"String",
"vrackName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/datacenter\"",
";",
"StringBuilder... | Add a new Datacenter in your Private Cloud
REST: POST /dedicatedCloud/{serviceName}/datacenter
@param vrackName [required] Name of the Vrack link to the new datacenter.
@param commercialRangeName [required] The commercial range of this new datacenter. You can see what commercial ranges are orderable on this API sectio... | [
"Add",
"a",
"new",
"Datacenter",
"in",
"your",
"Private",
"Cloud"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L1572-L1580 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/metadata/BaseMetadataHandler.java | BaseMetadataHandler.processCatalogName | private String processCatalogName(String dbProvideName, String userName, String catalogName) {
"""
Processes Catalog name so it would be compatible with database
@param dbProvideName short database name
@param userName user name
@param catalogName catalog name which would be processed
@return processe... | java | private String processCatalogName(String dbProvideName, String userName, String catalogName) {
String result = null;
if (catalogName != null) {
result = catalogName.toUpperCase();
} else {
if ("Oracle".equals(dbProvideName) == true) {
// SPRING: Or... | [
"private",
"String",
"processCatalogName",
"(",
"String",
"dbProvideName",
",",
"String",
"userName",
",",
"String",
"catalogName",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"catalogName",
"!=",
"null",
")",
"{",
"result",
"=",
"catalogName",
... | Processes Catalog name so it would be compatible with database
@param dbProvideName short database name
@param userName user name
@param catalogName catalog name which would be processed
@return processed catalog name | [
"Processes",
"Catalog",
"name",
"so",
"it",
"would",
"be",
"compatible",
"with",
"database"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/metadata/BaseMetadataHandler.java#L229-L242 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/web/ws/WSController.java | WSController.receiveCommandMessage | @Override
public void receiveCommandMessage(Session client, String json) {
"""
A message is a call service request or subscribe/unsubscribe topic
@param client
@param json
"""
MessageFromClient message = MessageFromClient.createFromJson(json);
logger.debug("Receive call message in websocket '{}' for s... | java | @Override
public void receiveCommandMessage(Session client, String json) {
MessageFromClient message = MessageFromClient.createFromJson(json);
logger.debug("Receive call message in websocket '{}' for session '{}'", message.getId(), client.getId());
callServiceManager.sendMessageToClient(message, client);
} | [
"@",
"Override",
"public",
"void",
"receiveCommandMessage",
"(",
"Session",
"client",
",",
"String",
"json",
")",
"{",
"MessageFromClient",
"message",
"=",
"MessageFromClient",
".",
"createFromJson",
"(",
"json",
")",
";",
"logger",
".",
"debug",
"(",
"\"Receive... | A message is a call service request or subscribe/unsubscribe topic
@param client
@param json | [
"A",
"message",
"is",
"a",
"call",
"service",
"request",
"or",
"subscribe",
"/",
"unsubscribe",
"topic"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/web/ws/WSController.java#L89-L94 |
s1ck/gdl | src/main/java/org/s1ck/gdl/GDLLoader.java | GDLLoader.getEdgeCache | Map<String, Edge> getEdgeCache(boolean includeUserDefined, boolean includeAutoGenerated) {
"""
Returns a cache containing a mapping from variables to edges.
@param includeUserDefined include user-defined variables
@param includeAutoGenerated include auto-generated variables
@return immutable edge cache
... | java | Map<String, Edge> getEdgeCache(boolean includeUserDefined, boolean includeAutoGenerated) {
return getCache(userEdgeCache, autoEdgeCache, includeUserDefined, includeAutoGenerated);
} | [
"Map",
"<",
"String",
",",
"Edge",
">",
"getEdgeCache",
"(",
"boolean",
"includeUserDefined",
",",
"boolean",
"includeAutoGenerated",
")",
"{",
"return",
"getCache",
"(",
"userEdgeCache",
",",
"autoEdgeCache",
",",
"includeUserDefined",
",",
"includeAutoGenerated",
... | Returns a cache containing a mapping from variables to edges.
@param includeUserDefined include user-defined variables
@param includeAutoGenerated include auto-generated variables
@return immutable edge cache | [
"Returns",
"a",
"cache",
"containing",
"a",
"mapping",
"from",
"variables",
"to",
"edges",
"."
] | train | https://github.com/s1ck/gdl/blob/c89b0f83526661823ad3392f338dbf7dc3e3f834/src/main/java/org/s1ck/gdl/GDLLoader.java#L260-L262 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/util/FileUtils.java | FileUtils.copyDirectory | public static void copyDirectory(File srcDir, File destDir, FileFilter filter) throws IOException {
"""
Copies a filtered directory to a new location preserving the file dates.
<p>
This method copies the contents of the specified source directory to
within the specified destination directory.
<p>
The destinat... | java | public static void copyDirectory(File srcDir, File destDir, FileFilter filter) throws IOException {
copyDirectory(srcDir, destDir, filter, true);
} | [
"public",
"static",
"void",
"copyDirectory",
"(",
"File",
"srcDir",
",",
"File",
"destDir",
",",
"FileFilter",
"filter",
")",
"throws",
"IOException",
"{",
"copyDirectory",
"(",
"srcDir",
",",
"destDir",
",",
"filter",
",",
"true",
")",
";",
"}"
] | Copies a filtered directory to a new location preserving the file dates.
<p>
This method copies the contents of the specified source directory to
within the specified destination directory.
<p>
The destination directory is created if it does not exist. If the
destination directory did exist, then this method merges the... | [
"Copies",
"a",
"filtered",
"directory",
"to",
"a",
"new",
"location",
"preserving",
"the",
"file",
"dates",
".",
"<p",
">",
"This",
"method",
"copies",
"the",
"contents",
"of",
"the",
"specified",
"source",
"directory",
"to",
"within",
"the",
"specified",
"d... | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/util/FileUtils.java#L350-L352 |
structurizr/java | structurizr-core/src/com/structurizr/model/DeploymentNode.java | DeploymentNode.uses | public Relationship uses(DeploymentNode destination, String description, String technology, InteractionStyle interactionStyle) {
"""
Adds a relationship between this and another deployment node.
@param destination the destination DeploymentNode
@param description a short description of the relation... | java | public Relationship uses(DeploymentNode destination, String description, String technology, InteractionStyle interactionStyle) {
return getModel().addRelationship(this, destination, description, technology, interactionStyle);
} | [
"public",
"Relationship",
"uses",
"(",
"DeploymentNode",
"destination",
",",
"String",
"description",
",",
"String",
"technology",
",",
"InteractionStyle",
"interactionStyle",
")",
"{",
"return",
"getModel",
"(",
")",
".",
"addRelationship",
"(",
"this",
",",
"des... | Adds a relationship between this and another deployment node.
@param destination the destination DeploymentNode
@param description a short description of the relationship
@param technology the technology
@param interactionStyle the interation style (Synchronous vs Asynchronous)
@return ... | [
"Adds",
"a",
"relationship",
"between",
"this",
"and",
"another",
"deployment",
"node",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/DeploymentNode.java#L141-L143 |
alkacon/opencms-core | src/org/opencms/relations/CmsLink.java | CmsLink.computeUri | private String computeUri(String target, String query, String anchor) {
"""
Helper method for creating a uri from its components.<p>
@param target the uri target
@param query the uri query component
@param anchor the uri anchor component
@return the uri
"""
StringBuffer uri = new StringBuffer(... | java | private String computeUri(String target, String query, String anchor) {
StringBuffer uri = new StringBuffer(64);
uri.append(target);
if (query != null) {
uri.append('?');
uri.append(query);
}
if (anchor != null) {
uri.append('#');
... | [
"private",
"String",
"computeUri",
"(",
"String",
"target",
",",
"String",
"query",
",",
"String",
"anchor",
")",
"{",
"StringBuffer",
"uri",
"=",
"new",
"StringBuffer",
"(",
"64",
")",
";",
"uri",
".",
"append",
"(",
"target",
")",
";",
"if",
"(",
"qu... | Helper method for creating a uri from its components.<p>
@param target the uri target
@param query the uri query component
@param anchor the uri anchor component
@return the uri | [
"Helper",
"method",
"for",
"creating",
"a",
"uri",
"from",
"its",
"components",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsLink.java#L703-L717 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/UtilDisparityScore.java | UtilDisparityScore.computeScoreRow | public static void computeScoreRow(GrayU8 left, GrayU8 right, int row, int[] scores,
int minDisparity , int maxDisparity , int regionWidth ,
int elementScore[] ) {
"""
Computes disparity score for an entire row.
For a given disparity, the score for each region on the left share many comp... | java | public static void computeScoreRow(GrayU8 left, GrayU8 right, int row, int[] scores,
int minDisparity , int maxDisparity , int regionWidth ,
int elementScore[] ) {
// disparity as the outer loop to maximize common elements in inner loops, reducing redundant calculations
for( int d = minDisp... | [
"public",
"static",
"void",
"computeScoreRow",
"(",
"GrayU8",
"left",
",",
"GrayU8",
"right",
",",
"int",
"row",
",",
"int",
"[",
"]",
"scores",
",",
"int",
"minDisparity",
",",
"int",
"maxDisparity",
",",
"int",
"regionWidth",
",",
"int",
"elementScore",
... | Computes disparity score for an entire row.
For a given disparity, the score for each region on the left share many components in common.
Because of this the scores are computed with disparity being the outer most loop
@param left left image
@param right Right image
@param row Image row being examined
@param scores S... | [
"Computes",
"disparity",
"score",
"for",
"an",
"entire",
"row",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/UtilDisparityScore.java#L47-L80 |
windup/windup | config/api/src/main/java/org/jboss/windup/config/operation/OperationUtil.java | OperationUtil.hasOperationType | public static boolean hasOperationType(Operation operation, Class<? extends Operation> operationType) {
"""
Indicates whether or not the provided {@link Operation} is or contains any {@link Operation}s of the specified type. This will recursively
check all of the suboperations on {@link CompositeOperation}s as we... | java | public static boolean hasOperationType(Operation operation, Class<? extends Operation> operationType)
{
if (operation == null)
return false;
if (operationType.isAssignableFrom(operation.getClass()))
return true;
if (operation instanceof CompositeOperation)
{... | [
"public",
"static",
"boolean",
"hasOperationType",
"(",
"Operation",
"operation",
",",
"Class",
"<",
"?",
"extends",
"Operation",
">",
"operationType",
")",
"{",
"if",
"(",
"operation",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"operationType",
"... | Indicates whether or not the provided {@link Operation} is or contains any {@link Operation}s of the specified type. This will recursively
check all of the suboperations on {@link CompositeOperation}s as well. | [
"Indicates",
"whether",
"or",
"not",
"the",
"provided",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/operation/OperationUtil.java#L19-L38 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java | ComponentFactory.newLabel | public static Label newLabel(final String id, final String label) {
"""
Factory method for create a new {@link Label} with a {@link String}.
@param id
the id
@param label
the string for the label
@return the new {@link Label}
"""
return ComponentFactory.newLabel(id, Model.of(label));
} | java | public static Label newLabel(final String id, final String label)
{
return ComponentFactory.newLabel(id, Model.of(label));
} | [
"public",
"static",
"Label",
"newLabel",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"label",
")",
"{",
"return",
"ComponentFactory",
".",
"newLabel",
"(",
"id",
",",
"Model",
".",
"of",
"(",
"label",
")",
")",
";",
"}"
] | Factory method for create a new {@link Label} with a {@link String}.
@param id
the id
@param label
the string for the label
@return the new {@link Label} | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"Label",
"}",
"with",
"a",
"{",
"@link",
"String",
"}",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java#L443-L446 |
facebookarchive/hadoop-20 | src/contrib/data_join/src/java/org/apache/hadoop/contrib/utils/join/JobBase.java | JobBase.addDoubleValue | protected Double addDoubleValue(Object name, double inc) {
"""
Increment the given counter by the given incremental value If the counter
does not exist, one is created with value 0.
@param name
the counter name
@param inc
the incremental value
@return the updated value.
"""
Double val = this.double... | java | protected Double addDoubleValue(Object name, double inc) {
Double val = this.doubleCounters.get(name);
Double retv = null;
if (val == null) {
retv = new Double(inc);
} else {
retv = new Double(val.doubleValue() + inc);
}
this.doubleCounters.put(name, retv);
return retv;
} | [
"protected",
"Double",
"addDoubleValue",
"(",
"Object",
"name",
",",
"double",
"inc",
")",
"{",
"Double",
"val",
"=",
"this",
".",
"doubleCounters",
".",
"get",
"(",
"name",
")",
";",
"Double",
"retv",
"=",
"null",
";",
"if",
"(",
"val",
"==",
"null",
... | Increment the given counter by the given incremental value If the counter
does not exist, one is created with value 0.
@param name
the counter name
@param inc
the incremental value
@return the updated value. | [
"Increment",
"the",
"given",
"counter",
"by",
"the",
"given",
"incremental",
"value",
"If",
"the",
"counter",
"does",
"not",
"exist",
"one",
"is",
"created",
"with",
"value",
"0",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/data_join/src/java/org/apache/hadoop/contrib/utils/join/JobBase.java#L121-L131 |
GCRC/nunaliit | nunaliit2-couch-utils/src/main/java/ca/carleton/gcrc/couch/utils/SubmissionUtils.java | SubmissionUtils.getSubmittedDocumentFromSubmission | static public JSONObject getSubmittedDocumentFromSubmission(JSONObject submissionDoc) throws Exception {
"""
Re-creates the document submitted by the client from
the submission document.
@param submissionDoc Submission document from the submission database
@return Document submitted by user for update
"""
... | java | static public JSONObject getSubmittedDocumentFromSubmission(JSONObject submissionDoc) throws Exception {
JSONObject submissionInfo = submissionDoc.getJSONObject("nunaliit_submission");
JSONObject doc = submissionInfo.getJSONObject("submitted_doc");
JSONObject reserved = submissionInfo.optJSONObject("submitted_... | [
"static",
"public",
"JSONObject",
"getSubmittedDocumentFromSubmission",
"(",
"JSONObject",
"submissionDoc",
")",
"throws",
"Exception",
"{",
"JSONObject",
"submissionInfo",
"=",
"submissionDoc",
".",
"getJSONObject",
"(",
"\"nunaliit_submission\"",
")",
";",
"JSONObject",
... | Re-creates the document submitted by the client from
the submission document.
@param submissionDoc Submission document from the submission database
@return Document submitted by user for update | [
"Re",
"-",
"creates",
"the",
"document",
"submitted",
"by",
"the",
"client",
"from",
"the",
"submission",
"document",
"."
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-couch-utils/src/main/java/ca/carleton/gcrc/couch/utils/SubmissionUtils.java#L45-L52 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java | ServiceEndpointPoliciesInner.beginCreateOrUpdate | public ServiceEndpointPolicyInner beginCreateOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) {
"""
Creates or updates a service Endpoint Policies.
@param resourceGroupName The name of the resource group.
@param serviceEndpointPolicyName The name of th... | java | public ServiceEndpointPolicyInner beginCreateOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).toBlocking().single().body();
} | [
"public",
"ServiceEndpointPolicyInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serviceEndpointPolicyName",
",",
"ServiceEndpointPolicyInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName... | Creates or updates a service Endpoint Policies.
@param resourceGroupName The name of the resource group.
@param serviceEndpointPolicyName The name of the service endpoint policy.
@param parameters Parameters supplied to the create or update service endpoint policy operation.
@throws IllegalArgumentException thrown if ... | [
"Creates",
"or",
"updates",
"a",
"service",
"Endpoint",
"Policies",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java#L519-L521 |
alibaba/vlayout | vlayout/src/main/java/com/alibaba/android/vlayout/layout/MarginLayoutHelper.java | MarginLayoutHelper.setPadding | public void setPadding(int leftPadding, int topPadding, int rightPadding, int bottomPadding) {
"""
set paddings for this layoutHelper
@param leftPadding left padding
@param topPadding top padding
@param rightPadding right padding
@param bottomPadding bottom padding
"""
mPaddingLeft = leftPadding;
... | java | public void setPadding(int leftPadding, int topPadding, int rightPadding, int bottomPadding) {
mPaddingLeft = leftPadding;
mPaddingRight = rightPadding;
mPaddingTop = topPadding;
mPaddingBottom = bottomPadding;
} | [
"public",
"void",
"setPadding",
"(",
"int",
"leftPadding",
",",
"int",
"topPadding",
",",
"int",
"rightPadding",
",",
"int",
"bottomPadding",
")",
"{",
"mPaddingLeft",
"=",
"leftPadding",
";",
"mPaddingRight",
"=",
"rightPadding",
";",
"mPaddingTop",
"=",
"topPa... | set paddings for this layoutHelper
@param leftPadding left padding
@param topPadding top padding
@param rightPadding right padding
@param bottomPadding bottom padding | [
"set",
"paddings",
"for",
"this",
"layoutHelper"
] | train | https://github.com/alibaba/vlayout/blob/8a5a51d9d2eeb91fed2ee331a4cf3496282452ce/vlayout/src/main/java/com/alibaba/android/vlayout/layout/MarginLayoutHelper.java#L55-L60 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.needIncrement | private static boolean needIncrement(long ldivisor, int roundingMode,
int qsign, MutableBigInteger mq, long r) {
"""
Tests if quotient has to be incremented according the roundingMode
"""
assert r != 0L;
int cmpFracHalf;
if (r <= HALF_LONG_MIN_V... | java | private static boolean needIncrement(long ldivisor, int roundingMode,
int qsign, MutableBigInteger mq, long r) {
assert r != 0L;
int cmpFracHalf;
if (r <= HALF_LONG_MIN_VALUE || r > HALF_LONG_MAX_VALUE) {
cmpFracHalf = 1; // 2 * r can't fit i... | [
"private",
"static",
"boolean",
"needIncrement",
"(",
"long",
"ldivisor",
",",
"int",
"roundingMode",
",",
"int",
"qsign",
",",
"MutableBigInteger",
"mq",
",",
"long",
"r",
")",
"{",
"assert",
"r",
"!=",
"0L",
";",
"int",
"cmpFracHalf",
";",
"if",
"(",
"... | Tests if quotient has to be incremented according the roundingMode | [
"Tests",
"if",
"quotient",
"has",
"to",
"be",
"incremented",
"according",
"the",
"roundingMode"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L4275-L4287 |
maxschuster/Vaadin-SignatureField | vaadin-signaturefield/src/main/java/eu/maxschuster/vaadin/signaturefield/SignatureField.java | SignatureField.setInternalValue | protected void setInternalValue(String newValue, boolean repaintIsNotNeeded) {
"""
Sets the internal field value. May sends the value to the client-side.
@param newValue
the new value to be set.
@param repaintIsNotNeeded
the new value should not be send to the client-side
"""
super.setInternalVal... | java | protected void setInternalValue(String newValue, boolean repaintIsNotNeeded) {
super.setInternalValue(newValue);
extension.setSignature(newValue, changingVariables || repaintIsNotNeeded);
} | [
"protected",
"void",
"setInternalValue",
"(",
"String",
"newValue",
",",
"boolean",
"repaintIsNotNeeded",
")",
"{",
"super",
".",
"setInternalValue",
"(",
"newValue",
")",
";",
"extension",
".",
"setSignature",
"(",
"newValue",
",",
"changingVariables",
"||",
"rep... | Sets the internal field value. May sends the value to the client-side.
@param newValue
the new value to be set.
@param repaintIsNotNeeded
the new value should not be send to the client-side | [
"Sets",
"the",
"internal",
"field",
"value",
".",
"May",
"sends",
"the",
"value",
"to",
"the",
"client",
"-",
"side",
"."
] | train | https://github.com/maxschuster/Vaadin-SignatureField/blob/b6f6b7042ea9c46060af54bd92d21770abfcccee/vaadin-signaturefield/src/main/java/eu/maxschuster/vaadin/signaturefield/SignatureField.java#L205-L208 |
aws/aws-sdk-java | aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchdomain/model/Hit.java | Hit.withFields | public Hit withFields(java.util.Map<String, java.util.List<String>> fields) {
"""
<p>
The fields returned from a document that matches the search request.
</p>
@param fields
The fields returned from a document that matches the search request.
@return Returns a reference to this object so that method calls c... | java | public Hit withFields(java.util.Map<String, java.util.List<String>> fields) {
setFields(fields);
return this;
} | [
"public",
"Hit",
"withFields",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"fields",
")",
"{",
"setFields",
"(",
"fields",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The fields returned from a document that matches the search request.
</p>
@param fields
The fields returned from a document that matches the search request.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"fields",
"returned",
"from",
"a",
"document",
"that",
"matches",
"the",
"search",
"request",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchdomain/model/Hit.java#L131-L134 |
weld/core | impl/src/main/java/org/jboss/weld/SimpleCDI.java | SimpleCDI.ambiguousBeanManager | protected BeanManagerImpl ambiguousBeanManager(String callerClassName, Set<BeanManagerImpl> managers) {
"""
Callback that allows to override the behavior when class that invoked CDI.current() is placed in multiple bean archives.
"""
throw BeanManagerLogger.LOG.ambiguousBeanManager(callerClassName);
... | java | protected BeanManagerImpl ambiguousBeanManager(String callerClassName, Set<BeanManagerImpl> managers) {
throw BeanManagerLogger.LOG.ambiguousBeanManager(callerClassName);
} | [
"protected",
"BeanManagerImpl",
"ambiguousBeanManager",
"(",
"String",
"callerClassName",
",",
"Set",
"<",
"BeanManagerImpl",
">",
"managers",
")",
"{",
"throw",
"BeanManagerLogger",
".",
"LOG",
".",
"ambiguousBeanManager",
"(",
"callerClassName",
")",
";",
"}"
] | Callback that allows to override the behavior when class that invoked CDI.current() is placed in multiple bean archives. | [
"Callback",
"that",
"allows",
"to",
"override",
"the",
"behavior",
"when",
"class",
"that",
"invoked",
"CDI",
".",
"current",
"()",
"is",
"placed",
"in",
"multiple",
"bean",
"archives",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/SimpleCDI.java#L95-L97 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.readOrganizationalUnit | public CmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc, String ouFqn) throws CmsException {
"""
Reads an organizational Unit based on its fully qualified name.<p>
@param dbc the current db context
@param ouFqn the fully qualified name of the organizational Unit to be read
@return the organizat... | java | public CmsOrganizationalUnit readOrganizationalUnit(CmsDbContext dbc, String ouFqn) throws CmsException {
CmsOrganizationalUnit organizationalUnit = null;
// try to read organizational unit from cache
organizationalUnit = m_monitor.getCachedOrgUnit(ouFqn);
if (organizationalUnit == null... | [
"public",
"CmsOrganizationalUnit",
"readOrganizationalUnit",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"ouFqn",
")",
"throws",
"CmsException",
"{",
"CmsOrganizationalUnit",
"organizationalUnit",
"=",
"null",
";",
"// try to read organizational unit from cache",
"organizational... | Reads an organizational Unit based on its fully qualified name.<p>
@param dbc the current db context
@param ouFqn the fully qualified name of the organizational Unit to be read
@return the organizational Unit that with the provided fully qualified name
@throws CmsException if something goes wrong | [
"Reads",
"an",
"organizational",
"Unit",
"based",
"on",
"its",
"fully",
"qualified",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L7096-L7106 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/configuration/StateUtils.java | StateUtils.jsonObjectToState | public static State jsonObjectToState(JsonObject jsonObject, String... excludeKeys) {
"""
Converts a {@link JsonObject} to a {@link State} object. It does not add any keys specified in the excludeKeys array
"""
State state = new State();
List<String> excludeKeysList = excludeKeys == null ? Lists.<Strin... | java | public static State jsonObjectToState(JsonObject jsonObject, String... excludeKeys) {
State state = new State();
List<String> excludeKeysList = excludeKeys == null ? Lists.<String>newArrayList() : Arrays.asList(excludeKeys);
for (Map.Entry<String, JsonElement> jsonObjectEntry : jsonObject.entrySet()) {
... | [
"public",
"static",
"State",
"jsonObjectToState",
"(",
"JsonObject",
"jsonObject",
",",
"String",
"...",
"excludeKeys",
")",
"{",
"State",
"state",
"=",
"new",
"State",
"(",
")",
";",
"List",
"<",
"String",
">",
"excludeKeysList",
"=",
"excludeKeys",
"==",
"... | Converts a {@link JsonObject} to a {@link State} object. It does not add any keys specified in the excludeKeys array | [
"Converts",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/StateUtils.java#L38-L47 |
infinispan/infinispan | core/src/main/java/org/infinispan/cache/impl/CacheImpl.java | CacheImpl.getInvocationContextWithImplicitTransaction | InvocationContext getInvocationContextWithImplicitTransaction(int keyCount, boolean forceCreateTransaction) {
"""
Same as {@link #getInvocationContextWithImplicitTransaction(int)} except if <b>forceCreateTransaction</b> is true
then autoCommit doesn't have to be enabled to start a new transaction.
@param keyCo... | java | InvocationContext getInvocationContextWithImplicitTransaction(int keyCount, boolean forceCreateTransaction) {
InvocationContext invocationContext;
boolean txInjected = false;
if (transactional) {
Transaction transaction = getOngoingTransaction(true);
if (transaction == null && (force... | [
"InvocationContext",
"getInvocationContextWithImplicitTransaction",
"(",
"int",
"keyCount",
",",
"boolean",
"forceCreateTransaction",
")",
"{",
"InvocationContext",
"invocationContext",
";",
"boolean",
"txInjected",
"=",
"false",
";",
"if",
"(",
"transactional",
")",
"{",... | Same as {@link #getInvocationContextWithImplicitTransaction(int)} except if <b>forceCreateTransaction</b> is true
then autoCommit doesn't have to be enabled to start a new transaction.
@param keyCount how many keys are expected to be changed
@param forceCreateTransaction if true then a transaction is alw... | [
"Same",
"as",
"{",
"@link",
"#getInvocationContextWithImplicitTransaction",
"(",
"int",
")",
"}",
"except",
"if",
"<b",
">",
"forceCreateTransaction<",
"/",
"b",
">",
"is",
"true",
"then",
"autoCommit",
"doesn",
"t",
"have",
"to",
"be",
"enabled",
"to",
"start... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/cache/impl/CacheImpl.java#L1033-L1047 |
HiddenStage/divide | Server/src/main/java/io/divide/server/endpoints/PushEndpoint.java | PushEndpoint.register | @POST
@Consumes(MediaType.APPLICATION_JSON)
public Response register(@Context Session session,EncryptedEntity.Reader entity) {
"""
/*
currently failing as the decryption key is probably different
"""
try{
Credentials credentials = session.getUser();
entity.setKey(keyMan... | java | @POST
@Consumes(MediaType.APPLICATION_JSON)
public Response register(@Context Session session,EncryptedEntity.Reader entity){
try{
Credentials credentials = session.getUser();
entity.setKey(keyManager.getPrivateKey());
credentials.setPushMessagingKey(entity.get("toke... | [
"@",
"POST",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"register",
"(",
"@",
"Context",
"Session",
"session",
",",
"EncryptedEntity",
".",
"Reader",
"entity",
")",
"{",
"try",
"{",
"Credentials",
"credentials",
"=",... | /*
currently failing as the decryption key is probably different | [
"/",
"*",
"currently",
"failing",
"as",
"the",
"decryption",
"key",
"is",
"probably",
"different"
] | train | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Server/src/main/java/io/divide/server/endpoints/PushEndpoint.java#L53-L71 |
j256/simplejmx | src/main/java/com/j256/simplejmx/common/ObjectNameUtil.java | ObjectNameUtil.makeObjectName | public static ObjectName makeObjectName(String domainName, String beanName, String[] folderNameStrings) {
"""
Constructs an object-name from a domain-name, object-name, and folder-name strings.
@param domainName
This is the top level folder name for the beans.
@param beanName
This is the bean name in the low... | java | public static ObjectName makeObjectName(String domainName, String beanName, String[] folderNameStrings) {
return makeObjectName(domainName, beanName, null, folderNameStrings);
} | [
"public",
"static",
"ObjectName",
"makeObjectName",
"(",
"String",
"domainName",
",",
"String",
"beanName",
",",
"String",
"[",
"]",
"folderNameStrings",
")",
"{",
"return",
"makeObjectName",
"(",
"domainName",
",",
"beanName",
",",
"null",
",",
"folderNameStrings... | Constructs an object-name from a domain-name, object-name, and folder-name strings.
@param domainName
This is the top level folder name for the beans.
@param beanName
This is the bean name in the lowest folder level.
@param folderNameStrings
These can be used to setup folders inside of the top folder. Each of the entr... | [
"Constructs",
"an",
"object",
"-",
"name",
"from",
"a",
"domain",
"-",
"name",
"object",
"-",
"name",
"and",
"folder",
"-",
"name",
"strings",
"."
] | train | https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/common/ObjectNameUtil.java#L102-L104 |
querydsl/querydsl | querydsl-mongodb/src/main/java/com/querydsl/mongodb/MongodbExpressions.java | MongodbExpressions.near | public static BooleanExpression near(Expression<Double[]> expr, double latVal, double longVal) {
"""
Finds the closest points relative to the given location and orders the results with decreasing proximity
@param expr location
@param latVal latitude
@param longVal longitude
@return predicate
"""
... | java | public static BooleanExpression near(Expression<Double[]> expr, double latVal, double longVal) {
return Expressions.booleanOperation(MongodbOps.NEAR, expr, ConstantImpl.create(new Double[]{latVal, longVal}));
} | [
"public",
"static",
"BooleanExpression",
"near",
"(",
"Expression",
"<",
"Double",
"[",
"]",
">",
"expr",
",",
"double",
"latVal",
",",
"double",
"longVal",
")",
"{",
"return",
"Expressions",
".",
"booleanOperation",
"(",
"MongodbOps",
".",
"NEAR",
",",
"exp... | Finds the closest points relative to the given location and orders the results with decreasing proximity
@param expr location
@param latVal latitude
@param longVal longitude
@return predicate | [
"Finds",
"the",
"closest",
"points",
"relative",
"to",
"the",
"given",
"location",
"and",
"orders",
"the",
"results",
"with",
"decreasing",
"proximity"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-mongodb/src/main/java/com/querydsl/mongodb/MongodbExpressions.java#L39-L41 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsVerticalMenu.java | CmsVerticalMenu.addMenuEntry | public Button addMenuEntry(String label, Resource icon) {
"""
Adds an entry to the menu, returns the entry button.<p>
@param label the label
@param icon the icon
@return the entry button
"""
Button button = new Button(label, icon);
button.setPrimaryStyleName(OpenCmsTheme.VERTICAL_MENU_I... | java | public Button addMenuEntry(String label, Resource icon) {
Button button = new Button(label, icon);
button.setPrimaryStyleName(OpenCmsTheme.VERTICAL_MENU_ITEM);
addComponent(button);
return button;
} | [
"public",
"Button",
"addMenuEntry",
"(",
"String",
"label",
",",
"Resource",
"icon",
")",
"{",
"Button",
"button",
"=",
"new",
"Button",
"(",
"label",
",",
"icon",
")",
";",
"button",
".",
"setPrimaryStyleName",
"(",
"OpenCmsTheme",
".",
"VERTICAL_MENU_ITEM",
... | Adds an entry to the menu, returns the entry button.<p>
@param label the label
@param icon the icon
@return the entry button | [
"Adds",
"an",
"entry",
"to",
"the",
"menu",
"returns",
"the",
"entry",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsVerticalMenu.java#L69-L75 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java | PageFlowManagedObject.create | public synchronized void create( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )
throws Exception {
"""
Initialize after object creation. This is a framework-invoked method; it should not normally be called directly.
"""
reinitialize( request, response... | java | public synchronized void create( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )
throws Exception
{
reinitialize( request, response, servletContext );
JavaControlUtils.initJavaControls( request, response, servletContext, this );
onCreate();
... | [
"public",
"synchronized",
"void",
"create",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"ServletContext",
"servletContext",
")",
"throws",
"Exception",
"{",
"reinitialize",
"(",
"request",
",",
"response",
",",
"servletContext",
... | Initialize after object creation. This is a framework-invoked method; it should not normally be called directly. | [
"Initialize",
"after",
"object",
"creation",
".",
"This",
"is",
"a",
"framework",
"-",
"invoked",
"method",
";",
"it",
"should",
"not",
"normally",
"be",
"called",
"directly",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java#L90-L96 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/matchspace/utils/TraceImpl.java | TraceImpl.internalInfo | private final void internalInfo(Object source, Class sourceClass, String methodName, String messageIdentifier, Object object) {
"""
Internal implementation of info NLS message tracing.
@param source
@param sourceClass
@param methodName
@param messageIdentifier
@param object
"""
if (usePrintWrite... | java | private final void internalInfo(Object source, Class sourceClass, String methodName, String messageIdentifier, Object object)
{
if (usePrintWriterForTrace)
{
if (printWriter != null)
{
StringBuffer stringBuffer = new StringBuffer(new java.util.Date().toString(... | [
"private",
"final",
"void",
"internalInfo",
"(",
"Object",
"source",
",",
"Class",
"sourceClass",
",",
"String",
"methodName",
",",
"String",
"messageIdentifier",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"usePrintWriterForTrace",
")",
"{",
"if",
"(",
"pri... | Internal implementation of info NLS message tracing.
@param source
@param sourceClass
@param methodName
@param messageIdentifier
@param object | [
"Internal",
"implementation",
"of",
"info",
"NLS",
"message",
"tracing",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/matchspace/utils/TraceImpl.java#L819-L847 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java | GVRCameraRig.setVec3 | public void setVec3(String key, float x, float y, float z) {
"""
Map a three-component {@code float} vector to {@code key}.
@param key
Key to map the vector to.
@param x
'X' component of vector.
@param y
'Y' component of vector.
@param z
'Z' component of vector.
"""
checkStringNotNullOrEmpty(... | java | public void setVec3(String key, float x, float y, float z) {
checkStringNotNullOrEmpty("key", key);
NativeCameraRig.setVec3(getNative(), key, x, y, z);
} | [
"public",
"void",
"setVec3",
"(",
"String",
"key",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"checkStringNotNullOrEmpty",
"(",
"\"key\"",
",",
"key",
")",
";",
"NativeCameraRig",
".",
"setVec3",
"(",
"getNative",
"(",
")",
",",
... | Map a three-component {@code float} vector to {@code key}.
@param key
Key to map the vector to.
@param x
'X' component of vector.
@param y
'Y' component of vector.
@param z
'Z' component of vector. | [
"Map",
"a",
"three",
"-",
"component",
"{",
"@code",
"float",
"}",
"vector",
"to",
"{",
"@code",
"key",
"}",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java#L276-L279 |
vigna/Sux4J | src/it/unimi/dsi/sux4j/io/ChunkedHashStore.java | ChunkedHashStore.addAll | public void addAll(final Iterator<? extends T> elements, final LongIterator values) throws IOException {
"""
Adds the elements returned by an iterator to this store, associating them with specified values.
@param elements an iterator returning elements.
@param values an iterator on values parallel to {@code el... | java | public void addAll(final Iterator<? extends T> elements, final LongIterator values) throws IOException {
addAll(elements, values, false);
} | [
"public",
"void",
"addAll",
"(",
"final",
"Iterator",
"<",
"?",
"extends",
"T",
">",
"elements",
",",
"final",
"LongIterator",
"values",
")",
"throws",
"IOException",
"{",
"addAll",
"(",
"elements",
",",
"values",
",",
"false",
")",
";",
"}"
] | Adds the elements returned by an iterator to this store, associating them with specified values.
@param elements an iterator returning elements.
@param values an iterator on values parallel to {@code elements}. | [
"Adds",
"the",
"elements",
"returned",
"by",
"an",
"iterator",
"to",
"this",
"store",
"associating",
"them",
"with",
"specified",
"values",
"."
] | train | https://github.com/vigna/Sux4J/blob/d57de8fa897c7d273e0e6dae7a3274174f175a5f/src/it/unimi/dsi/sux4j/io/ChunkedHashStore.java#L365-L367 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java | XGlobalAttributeNameMap.mapSafely | public String mapSafely(XAttribute attribute, XAttributeNameMap mapping) {
"""
Maps an attribute safely, using the given attribute mapping.
Safe mapping attempts to map the attribute using the given
mapping first. If this does not succeed, the standard mapping
(EN) will be used for mapping. If no mapping is ava... | java | public String mapSafely(XAttribute attribute, XAttributeNameMap mapping) {
return mapSafely(attribute.getKey(), mapping);
} | [
"public",
"String",
"mapSafely",
"(",
"XAttribute",
"attribute",
",",
"XAttributeNameMap",
"mapping",
")",
"{",
"return",
"mapSafely",
"(",
"attribute",
".",
"getKey",
"(",
")",
",",
"mapping",
")",
";",
"}"
] | Maps an attribute safely, using the given attribute mapping.
Safe mapping attempts to map the attribute using the given
mapping first. If this does not succeed, the standard mapping
(EN) will be used for mapping. If no mapping is available in
the standard mapping, the original attribute key is returned
unchanged. This ... | [
"Maps",
"an",
"attribute",
"safely",
"using",
"the",
"given",
"attribute",
"mapping",
".",
"Safe",
"mapping",
"attempts",
"to",
"map",
"the",
"attribute",
"using",
"the",
"given",
"mapping",
"first",
".",
"If",
"this",
"does",
"not",
"succeed",
"the",
"stand... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java#L195-L197 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.pathString | protected DocPath pathString(ClassDoc cd, DocPath name) {
"""
Return the path to the class page for a classdoc.
@param cd Class to which the path is requested.
@param name Name of the file(doesn't include path).
"""
return pathString(cd.containingPackage(), name);
} | java | protected DocPath pathString(ClassDoc cd, DocPath name) {
return pathString(cd.containingPackage(), name);
} | [
"protected",
"DocPath",
"pathString",
"(",
"ClassDoc",
"cd",
",",
"DocPath",
"name",
")",
"{",
"return",
"pathString",
"(",
"cd",
".",
"containingPackage",
"(",
")",
",",
"name",
")",
";",
"}"
] | Return the path to the class page for a classdoc.
@param cd Class to which the path is requested.
@param name Name of the file(doesn't include path). | [
"Return",
"the",
"path",
"to",
"the",
"class",
"page",
"for",
"a",
"classdoc",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L914-L916 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/core/GenericTypeResolver.java | GenericTypeResolver.getRawType | static Type getRawType(Type genericType, Map<TypeVariable, Type> typeVariableMap) {
"""
Determine the raw type for the given generic parameter type.
@param genericType the generic type to resolve
@param typeVariableMap the TypeVariable Map to resolved against
@return the resolved raw type
"""
Type resolve... | java | static Type getRawType(Type genericType, Map<TypeVariable, Type> typeVariableMap) {
Type resolvedType = genericType;
if (genericType instanceof TypeVariable) {
TypeVariable tv = (TypeVariable) genericType;
resolvedType = typeVariableMap.get(tv);
if (resolvedType == null) {
resolvedType = extractBoundFo... | [
"static",
"Type",
"getRawType",
"(",
"Type",
"genericType",
",",
"Map",
"<",
"TypeVariable",
",",
"Type",
">",
"typeVariableMap",
")",
"{",
"Type",
"resolvedType",
"=",
"genericType",
";",
"if",
"(",
"genericType",
"instanceof",
"TypeVariable",
")",
"{",
"Type... | Determine the raw type for the given generic parameter type.
@param genericType the generic type to resolve
@param typeVariableMap the TypeVariable Map to resolved against
@return the resolved raw type | [
"Determine",
"the",
"raw",
"type",
"for",
"the",
"given",
"generic",
"parameter",
"type",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/GenericTypeResolver.java#L364-L379 |
cdk/cdk | misc/extra/src/main/java/org/openscience/cdk/geometry/AtomTools.java | AtomTools.rescaleBondLength | public static Point3d rescaleBondLength(IAtom atom1, IAtom atom2, Point3d point2) {
"""
Rescales Point2 so that length 1-2 is sum of covalent radii.
if covalent radii cannot be found, use bond length of 1.0
@param atom1 stationary atom
@param atom2 movable atom
@param point2 coordinates for atom 2
@ret... | java | public static Point3d rescaleBondLength(IAtom atom1, IAtom atom2, Point3d point2) {
Point3d point1 = atom1.getPoint3d();
double d1 = atom1.getCovalentRadius();
double d2 = atom2.getCovalentRadius();
// in case we have no covalent radii, set to 1.0
double distance = (d1 < 0.1 || d... | [
"public",
"static",
"Point3d",
"rescaleBondLength",
"(",
"IAtom",
"atom1",
",",
"IAtom",
"atom2",
",",
"Point3d",
"point2",
")",
"{",
"Point3d",
"point1",
"=",
"atom1",
".",
"getPoint3d",
"(",
")",
";",
"double",
"d1",
"=",
"atom1",
".",
"getCovalentRadius",... | Rescales Point2 so that length 1-2 is sum of covalent radii.
if covalent radii cannot be found, use bond length of 1.0
@param atom1 stationary atom
@param atom2 movable atom
@param point2 coordinates for atom 2
@return new coords for atom 2 | [
"Rescales",
"Point2",
"so",
"that",
"length",
"1",
"-",
"2",
"is",
"sum",
"of",
"covalent",
"radii",
".",
"if",
"covalent",
"radii",
"cannot",
"be",
"found",
"use",
"bond",
"length",
"of",
"1",
".",
"0"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/geometry/AtomTools.java#L115-L128 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createRepositoryFile | public GitlabSimpleRepositoryFile createRepositoryFile(GitlabProject project, String path, String branchName, String commitMsg, String content) throws IOException {
"""
Creates a new file in the repository
@param project The Project
@param path The file path inside the repository
@param branchName Th... | java | public GitlabSimpleRepositoryFile createRepositoryFile(GitlabProject project, String path, String branchName, String commitMsg, String content) throws IOException {
String tailUrl = GitlabProject.URL + "/" + project.getId() + "/repository/files/" + sanitizePath(path);
GitlabHTTPRequestor requestor = dis... | [
"public",
"GitlabSimpleRepositoryFile",
"createRepositoryFile",
"(",
"GitlabProject",
"project",
",",
"String",
"path",
",",
"String",
"branchName",
",",
"String",
"commitMsg",
",",
"String",
"content",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"G... | Creates a new file in the repository
@param project The Project
@param path The file path inside the repository
@param branchName The name of a repository branch
@param commitMsg The commit message
@param content The base64 encoded content of the file
@throws IOException on gitlab api call error | [
"Creates",
"a",
"new",
"file",
"in",
"the",
"repository"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L2207-L2217 |
stephenc/redmine-java-api | src/main/java/org/redmine/ta/internal/RedmineJSONParser.java | RedmineJSONParser.parseStatus | public static IssueStatus parseStatus(JSONObject object)
throws JSONException {
"""
Parses a status.
@param object
object to parse.
@return parsed tracker.
@throws RedmineFormatException
if object is not a valid tracker.
"""
final int id = JsonInput.getInt(object, "id");
final String name = JsonI... | java | public static IssueStatus parseStatus(JSONObject object)
throws JSONException {
final int id = JsonInput.getInt(object, "id");
final String name = JsonInput.getStringNotNull(object, "name");
final IssueStatus result = new IssueStatus(id, name);
if (object.has("is_default"))
result.setDefaultStatus(JsonInp... | [
"public",
"static",
"IssueStatus",
"parseStatus",
"(",
"JSONObject",
"object",
")",
"throws",
"JSONException",
"{",
"final",
"int",
"id",
"=",
"JsonInput",
".",
"getInt",
"(",
"object",
",",
"\"id\"",
")",
";",
"final",
"String",
"name",
"=",
"JsonInput",
".... | Parses a status.
@param object
object to parse.
@return parsed tracker.
@throws RedmineFormatException
if object is not a valid tracker. | [
"Parses",
"a",
"status",
"."
] | train | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/RedmineJSONParser.java#L205-L216 |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/model/JavaUtils.java | JavaUtils.isAssignableTo | public static boolean isAssignableTo(final String leftType, final String rightType) {
"""
Checks if the left type is assignable to the right type, i.e. the right type is of the same or a sub-type.
"""
if (leftType.equals(rightType))
return true;
final boolean firstTypeArray = leftT... | java | public static boolean isAssignableTo(final String leftType, final String rightType) {
if (leftType.equals(rightType))
return true;
final boolean firstTypeArray = leftType.charAt(0) == '[';
if (firstTypeArray ^ rightType.charAt(0) == '[') {
return false;
}
... | [
"public",
"static",
"boolean",
"isAssignableTo",
"(",
"final",
"String",
"leftType",
",",
"final",
"String",
"rightType",
")",
"{",
"if",
"(",
"leftType",
".",
"equals",
"(",
"rightType",
")",
")",
"return",
"true",
";",
"final",
"boolean",
"firstTypeArray",
... | Checks if the left type is assignable to the right type, i.e. the right type is of the same or a sub-type. | [
"Checks",
"if",
"the",
"left",
"type",
"is",
"assignable",
"to",
"the",
"right",
"type",
"i",
".",
"e",
".",
"the",
"right",
"type",
"is",
"of",
"the",
"same",
"or",
"a",
"sub",
"-",
"type",
"."
] | train | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/model/JavaUtils.java#L201-L217 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.beginValidateMoveResources | public void beginValidateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
"""
Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in ... | java | public void beginValidateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
beginValidateMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginValidateMoveResources",
"(",
"String",
"sourceResourceGroupName",
",",
"ResourcesMoveInfo",
"parameters",
")",
"{",
"beginValidateMoveResourcesWithServiceResponseAsync",
"(",
"sourceResourceGroupName",
",",
"parameters",
")",
".",
"toBlocking",
"(",
")... | Validates whether resources can be moved from one resource group to another resource group.
This operation checks whether the specified resources can be moved to the target. The resources to move must be in the same source resource group. The target resource group may be in a different subscription. If validation succe... | [
"Validates",
"whether",
"resources",
"can",
"be",
"moved",
"from",
"one",
"resource",
"group",
"to",
"another",
"resource",
"group",
".",
"This",
"operation",
"checks",
"whether",
"the",
"specified",
"resources",
"can",
"be",
"moved",
"to",
"the",
"target",
".... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L655-L657 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/processors/impl/SecurityExceptionProcessor.java | SecurityExceptionProcessor.processRequest | public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception {
"""
Catches any exception thrown by the processor chain. If the exception is an instance of a {@link
SecurityProviderException}, the exception is handled to see if authentication is required
({@lin... | java | public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception {
try {
processorChain.processRequest(context);
} catch (IOException e) {
throw e;
} catch (Exception e) {
SecurityProviderException se = findSecu... | [
"public",
"void",
"processRequest",
"(",
"RequestContext",
"context",
",",
"RequestSecurityProcessorChain",
"processorChain",
")",
"throws",
"Exception",
"{",
"try",
"{",
"processorChain",
".",
"processRequest",
"(",
"context",
")",
";",
"}",
"catch",
"(",
"IOExcept... | Catches any exception thrown by the processor chain. If the exception is an instance of a {@link
SecurityProviderException}, the exception is handled to see if authentication is required
({@link AuthenticationRequiredException}), or if access to the resource is denied
({@link AccessDeniedException}).
@param context ... | [
"Catches",
"any",
"exception",
"thrown",
"by",
"the",
"processor",
"chain",
".",
"If",
"the",
"exception",
"is",
"an",
"instance",
"of",
"a",
"{",
"@link",
"SecurityProviderException",
"}",
"the",
"exception",
"is",
"handled",
"to",
"see",
"if",
"authenticatio... | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/processors/impl/SecurityExceptionProcessor.java#L80-L93 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/aromaticity/DaylightModel.java | DaylightModel.exocyclicContribution | private static int exocyclicContribution(int element, int otherElement, int charge, int nCyclic) {
"""
Defines the number of electrons contributed when a pi bond is exocyclic
(spouting). When an atom is connected to an more electronegative atom
then the electrons are 'pulled' from the ring. The preset conditions... | java | private static int exocyclicContribution(int element, int otherElement, int charge, int nCyclic) {
switch (element) {
case CARBON:
return otherElement != CARBON ? 0 : 1;
case NITROGEN:
case PHOSPHORUS:
if (charge == 1)
retur... | [
"private",
"static",
"int",
"exocyclicContribution",
"(",
"int",
"element",
",",
"int",
"otherElement",
",",
"int",
"charge",
",",
"int",
"nCyclic",
")",
"{",
"switch",
"(",
"element",
")",
"{",
"case",
"CARBON",
":",
"return",
"otherElement",
"!=",
"CARBON"... | Defines the number of electrons contributed when a pi bond is exocyclic
(spouting). When an atom is connected to an more electronegative atom
then the electrons are 'pulled' from the ring. The preset conditions are
as follows:
<ul> <li>A cyclic carbon with an exocyclic pi bond to anything but carbon
contributes 0 elec... | [
"Defines",
"the",
"number",
"of",
"electrons",
"contributed",
"when",
"a",
"pi",
"bond",
"is",
"exocyclic",
"(",
"spouting",
")",
".",
"When",
"an",
"atom",
"is",
"connected",
"to",
"an",
"more",
"electronegative",
"atom",
"then",
"the",
"electrons",
"are",
... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/aromaticity/DaylightModel.java#L215-L230 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/CauchyDistribution.java | CauchyDistribution.quantile | public static double quantile(double x, double location, double shape) {
"""
PDF function, static version.
@param x Value
@param location Location (x0)
@param shape Shape (gamma)
@return PDF value
"""
return (x == .5) ? location : (x <= .5) //
? x <= 0. ? x < 0. ? Double.NaN : Double.NEGATIVE... | java | public static double quantile(double x, double location, double shape) {
return (x == .5) ? location : (x <= .5) //
? x <= 0. ? x < 0. ? Double.NaN : Double.NEGATIVE_INFINITY //
: location - shape / FastMath.tan(Math.PI * x) //
: x >= 1. ? x > 1. ? Double.NaN : Double.POSITIVE_INFINITY /... | [
"public",
"static",
"double",
"quantile",
"(",
"double",
"x",
",",
"double",
"location",
",",
"double",
"shape",
")",
"{",
"return",
"(",
"x",
"==",
".5",
")",
"?",
"location",
":",
"(",
"x",
"<=",
".5",
")",
"//",
"?",
"x",
"<=",
"0.",
"?",
"x",... | PDF function, static version.
@param x Value
@param location Location (x0)
@param shape Shape (gamma)
@return PDF value | [
"PDF",
"function",
"static",
"version",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/CauchyDistribution.java#L174-L180 |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java | SpeakUtil.noteMessage | protected static void noteMessage (SpeakObject sender, Name username, UserMessage msg) {
"""
Notes that the specified user was privy to the specified message. If {@link
ChatMessage#timestamp} is not already filled in, it will be.
"""
// fill in the message's time stamp if necessary
if (msg.tim... | java | protected static void noteMessage (SpeakObject sender, Name username, UserMessage msg)
{
// fill in the message's time stamp if necessary
if (msg.timestamp == 0L) {
msg.timestamp = System.currentTimeMillis();
}
// Log.info("Noted that " + username + " heard " + msg + "."... | [
"protected",
"static",
"void",
"noteMessage",
"(",
"SpeakObject",
"sender",
",",
"Name",
"username",
",",
"UserMessage",
"msg",
")",
"{",
"// fill in the message's time stamp if necessary",
"if",
"(",
"msg",
".",
"timestamp",
"==",
"0L",
")",
"{",
"msg",
".",
"t... | Notes that the specified user was privy to the specified message. If {@link
ChatMessage#timestamp} is not already filled in, it will be. | [
"Notes",
"that",
"the",
"specified",
"user",
"was",
"privy",
"to",
"the",
"specified",
"message",
".",
"If",
"{"
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java#L199-L211 |
alipay/sofa-rpc | extension-impl/registry-sofa/src/main/java/com/alipay/sofa/rpc/registry/sofa/SofaRegistry.java | SofaRegistry.addAttributes | private void addAttributes(SubscriberRegistration subscriberRegistration, String group) {
"""
添加额外的属性
@param subscriberRegistration 注册或者订阅对象
@param group 分组
"""
// if group == null; group = "DEFAULT_GROUP"
if (StringUtils.isNotEmpty(group)) {
subscriberRegistration.se... | java | private void addAttributes(SubscriberRegistration subscriberRegistration, String group) {
// if group == null; group = "DEFAULT_GROUP"
if (StringUtils.isNotEmpty(group)) {
subscriberRegistration.setGroup(group);
}
subscriberRegistration.setScopeEnum(ScopeEnum.global);
} | [
"private",
"void",
"addAttributes",
"(",
"SubscriberRegistration",
"subscriberRegistration",
",",
"String",
"group",
")",
"{",
"// if group == null; group = \"DEFAULT_GROUP\"",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"group",
")",
")",
"{",
"subscriberRegistrati... | 添加额外的属性
@param subscriberRegistration 注册或者订阅对象
@param group 分组 | [
"添加额外的属性"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-sofa/src/main/java/com/alipay/sofa/rpc/registry/sofa/SofaRegistry.java#L319-L327 |
code4everything/util | src/main/java/com/zhazhapan/util/FileExecutor.java | FileExecutor.saveFile | public static void saveFile(File file, String content) throws IOException {
"""
保存文件,覆盖原内容
@param file 文件
@param content 内容
@throws IOException 异常
"""
saveFile(file, content, false);
} | java | public static void saveFile(File file, String content) throws IOException {
saveFile(file, content, false);
} | [
"public",
"static",
"void",
"saveFile",
"(",
"File",
"file",
",",
"String",
"content",
")",
"throws",
"IOException",
"{",
"saveFile",
"(",
"file",
",",
"content",
",",
"false",
")",
";",
"}"
] | 保存文件,覆盖原内容
@param file 文件
@param content 内容
@throws IOException 异常 | [
"保存文件,覆盖原内容"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/FileExecutor.java#L895-L897 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/URBridge.java | URBridge.setBaseEntry | private void setBaseEntry(Map<String, Object> configProps) throws WIMException {
"""
Set the baseEntryname from the configuration. The configuration
should have only 1 baseEntry
@param configProps Map containing the configuration information
for the baseEntries.
@throws WIMException Exception is thrown if no... | java | private void setBaseEntry(Map<String, Object> configProps) throws WIMException {
/*
* Map<String, List<Map<String, Object>>> configMap = Nester.nest(configProps, BASE_ENTRY);
*
* for (Map<String, Object> entry : configMap.get(BASE_ENTRY)) {
* baseEntryName = (String) entry.get(BASE_ENTRY_NAME);
* }
*/
bas... | [
"private",
"void",
"setBaseEntry",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"configProps",
")",
"throws",
"WIMException",
"{",
"/*\n * Map<String, List<Map<String, Object>>> configMap = Nester.nest(configProps, BASE_ENTRY);\n *\n * for (Map<String, Object> entry : configMap.get(B... | Set the baseEntryname from the configuration. The configuration
should have only 1 baseEntry
@param configProps Map containing the configuration information
for the baseEntries.
@throws WIMException Exception is thrown if no baseEntry is set. | [
"Set",
"the",
"baseEntryname",
"from",
"the",
"configuration",
".",
"The",
"configuration",
"should",
"have",
"only",
"1",
"baseEntry"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/URBridge.java#L293-L307 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/MPEGAudioFrameHeader.java | MPEGAudioFrameHeader.findFrame | private long findFrame(RandomAccessInputStream raf, int offset) throws IOException {
"""
Searches through the file and finds the first occurrence of an mpeg
frame. Returns the location of the header of the frame.
@param offset the offset to start searching from
@return the location of the header of the frame... | java | private long findFrame(RandomAccessInputStream raf, int offset) throws IOException
{
long loc = -1;
raf.seek(offset);
while (loc == -1)
{
byte test = raf.readByte();
if ((test & 0xFF) == 0xFF)
{
test = raf.readByte();
if ((test & 0xE0) == 0xE0)
{
return raf.getFilePointer() - 2;
... | [
"private",
"long",
"findFrame",
"(",
"RandomAccessInputStream",
"raf",
",",
"int",
"offset",
")",
"throws",
"IOException",
"{",
"long",
"loc",
"=",
"-",
"1",
";",
"raf",
".",
"seek",
"(",
"offset",
")",
";",
"while",
"(",
"loc",
"==",
"-",
"1",
")",
... | Searches through the file and finds the first occurrence of an mpeg
frame. Returns the location of the header of the frame.
@param offset the offset to start searching from
@return the location of the header of the frame
@exception FileNotFoundException if an error occurs
@exception IOException if an error occurs | [
"Searches",
"through",
"the",
"file",
"and",
"finds",
"the",
"first",
"occurrence",
"of",
"an",
"mpeg",
"frame",
".",
"Returns",
"the",
"location",
"of",
"the",
"header",
"of",
"the",
"frame",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/MPEGAudioFrameHeader.java#L194-L215 |
Alluxio/alluxio | core/common/src/main/java/alluxio/collections/LockCache.java | LockCache.tryGet | public Optional<LockResource> tryGet(K key, LockMode mode) {
"""
Attempts to take a lock on the given key.
@param key the key to lock
@param mode lockMode to acquire
@return either empty or a lock resource which must be closed to unlock the key
"""
ValNode valNode = getValNode(key);
ReentrantReadW... | java | public Optional<LockResource> tryGet(K key, LockMode mode) {
ValNode valNode = getValNode(key);
ReentrantReadWriteLock lock = valNode.mValue;
Lock innerLock;
switch (mode) {
case READ:
innerLock = lock.readLock();
break;
case WRITE:
innerLock = lock.writeLock();
... | [
"public",
"Optional",
"<",
"LockResource",
">",
"tryGet",
"(",
"K",
"key",
",",
"LockMode",
"mode",
")",
"{",
"ValNode",
"valNode",
"=",
"getValNode",
"(",
"key",
")",
";",
"ReentrantReadWriteLock",
"lock",
"=",
"valNode",
".",
"mValue",
";",
"Lock",
"inne... | Attempts to take a lock on the given key.
@param key the key to lock
@param mode lockMode to acquire
@return either empty or a lock resource which must be closed to unlock the key | [
"Attempts",
"to",
"take",
"a",
"lock",
"on",
"the",
"given",
"key",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/collections/LockCache.java#L143-L161 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java | ThreadLocalRandom.longs | public LongStream longs(long streamSize, long randomNumberOrigin,
long randomNumberBound) {
"""
Returns a stream producing the given {@code streamSize} number of
pseudorandom {@code long}, each conforming to the given origin
(inclusive) and bound (exclusive).
@param streamSize the ... | java | public LongStream longs(long streamSize, long randomNumberOrigin,
long randomNumberBound) {
if (streamSize < 0L)
throw new IllegalArgumentException(BAD_SIZE);
if (randomNumberOrigin >= randomNumberBound)
throw new IllegalArgumentException(BAD_RANGE);
... | [
"public",
"LongStream",
"longs",
"(",
"long",
"streamSize",
",",
"long",
"randomNumberOrigin",
",",
"long",
"randomNumberBound",
")",
"{",
"if",
"(",
"streamSize",
"<",
"0L",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"BAD_SIZE",
")",
";",
"if",
"("... | Returns a stream producing the given {@code streamSize} number of
pseudorandom {@code long}, each conforming to the given origin
(inclusive) and bound (exclusive).
@param streamSize the number of values to generate
@param randomNumberOrigin the origin (inclusive) of each random value
@param randomNumberBound the bound... | [
"Returns",
"a",
"stream",
"producing",
"the",
"given",
"{",
"@code",
"streamSize",
"}",
"number",
"of",
"pseudorandom",
"{",
"@code",
"long",
"}",
"each",
"conforming",
"to",
"the",
"given",
"origin",
"(",
"inclusive",
")",
"and",
"bound",
"(",
"exclusive",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java#L603-L613 |
knowm/XChange | xchange-lakebtc/src/main/java/org/knowm/xchange/lakebtc/LakeBTCAdapters.java | LakeBTCAdapters.adaptTrades | public static Trades adaptTrades(LakeBTCTradeResponse[] transactions, CurrencyPair currencyPair) {
"""
Adapts a Transaction[] to a Trades Object
@param transactions The LakeBtc transactions
@param currencyPair (e.g. BTC/USD)
@return The XChange Trades
"""
List<Trade> trades = new ArrayList<>();
l... | java | public static Trades adaptTrades(LakeBTCTradeResponse[] transactions, CurrencyPair currencyPair) {
List<Trade> trades = new ArrayList<>();
long lastTradeId = 0;
for (LakeBTCTradeResponse trade : transactions) {
final OrderType orderType = trade.getType().startsWith("buy") ? OrderType.BID : OrderType.... | [
"public",
"static",
"Trades",
"adaptTrades",
"(",
"LakeBTCTradeResponse",
"[",
"]",
"transactions",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"List",
"<",
"Trade",
">",
"trades",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"long",
"lastTradeId",
"=",
... | Adapts a Transaction[] to a Trades Object
@param transactions The LakeBtc transactions
@param currencyPair (e.g. BTC/USD)
@return The XChange Trades | [
"Adapts",
"a",
"Transaction",
"[]",
"to",
"a",
"Trades",
"Object"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-lakebtc/src/main/java/org/knowm/xchange/lakebtc/LakeBTCAdapters.java#L79-L96 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/internal/VirtualHostMap.java | VirtualHostMap.notifyStopped | public static synchronized void notifyStopped(HttpEndpointImpl endpoint, String resolvedHostName, int port, boolean isHttps) {
"""
Remove a port associated with an endpoint that has stopped listening,
and notify associated virtual hosts.
@param endpoint The HttpEndpointImpl that owns the stopped chain/listener... | java | public static synchronized void notifyStopped(HttpEndpointImpl endpoint, String resolvedHostName, int port, boolean isHttps) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Notify endpoint stopped: " + endpoint, resolvedHostName, port, isHttps, defaultHost.get(), a... | [
"public",
"static",
"synchronized",
"void",
"notifyStopped",
"(",
"HttpEndpointImpl",
"endpoint",
",",
"String",
"resolvedHostName",
",",
"int",
"port",
",",
"boolean",
"isHttps",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
... | Remove a port associated with an endpoint that has stopped listening,
and notify associated virtual hosts.
@param endpoint The HttpEndpointImpl that owns the stopped chain/listener
@param resolvedHostName A hostname that can be used in messages (based on endpoint configuration, something other than *)
@param port The ... | [
"Remove",
"a",
"port",
"associated",
"with",
"an",
"endpoint",
"that",
"has",
"stopped",
"listening",
"and",
"notify",
"associated",
"virtual",
"hosts",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/internal/VirtualHostMap.java#L223-L235 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java | DomainObjectMatch.setPage | public void setPage(int offset, int length) {
"""
For pagination support, set offset (start) and length of the set of matching objects to be
returned with respect to the total number of matching objects.
@param offset
@param length
"""
if (this.delegate != null)
this.delegate.setPage(offset, length);
... | java | public void setPage(int offset, int length) {
if (this.delegate != null)
this.delegate.setPage(offset, length);
else {
boolean changed = this.pageOffset != offset || this.pageLength != length;
if (changed) {
this.pageOffset = offset;
this.pageLength = length;
this.pageChanged = true;
}
}
... | [
"public",
"void",
"setPage",
"(",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"this",
".",
"delegate",
"!=",
"null",
")",
"this",
".",
"delegate",
".",
"setPage",
"(",
"offset",
",",
"length",
")",
";",
"else",
"{",
"boolean",
"change... | For pagination support, set offset (start) and length of the set of matching objects to be
returned with respect to the total number of matching objects.
@param offset
@param length | [
"For",
"pagination",
"support",
"set",
"offset",
"(",
"start",
")",
"and",
"length",
"of",
"the",
"set",
"of",
"matching",
"objects",
"to",
"be",
"returned",
"with",
"respect",
"to",
"the",
"total",
"number",
"of",
"matching",
"objects",
"."
] | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java#L184-L197 |
hawkular/hawkular-inventory | hawkular-inventory-rest-api/src/main/java/org/hawkular/inventory/rest/ResponseUtil.java | ResponseUtil.createPagingHeader | public static void createPagingHeader(final Response.ResponseBuilder builder, final UriInfo uriInfo,
final Page<?> resultList) {
"""
Create the paging headers for collections and attach them to the passed builder. Those are represented as
<i>Link:</i> http headers that ca... | java | public static void createPagingHeader(final Response.ResponseBuilder builder, final UriInfo uriInfo,
final Page<?> resultList) {
UriBuilder uriBuilder;
PageContext pc = resultList.getPageContext();
int page = pc.getPageNumber();
List<Link> lin... | [
"public",
"static",
"void",
"createPagingHeader",
"(",
"final",
"Response",
".",
"ResponseBuilder",
"builder",
",",
"final",
"UriInfo",
"uriInfo",
",",
"final",
"Page",
"<",
"?",
">",
"resultList",
")",
"{",
"UriBuilder",
"uriBuilder",
";",
"PageContext",
"pc",
... | Create the paging headers for collections and attach them to the passed builder. Those are represented as
<i>Link:</i> http headers that carry the URL for the pages and the respective relation.
<br/>In addition a <i>X-Total-Count</i> header is created that contains the whole collection size.
@param builder The Resp... | [
"Create",
"the",
"paging",
"headers",
"for",
"collections",
"and",
"attach",
"them",
"to",
"the",
"passed",
"builder",
".",
"Those",
"are",
"represented",
"as",
"<i",
">",
"Link",
":",
"<",
"/",
"i",
">",
"http",
"headers",
"that",
"carry",
"the",
"URL",... | train | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-rest-api/src/main/java/org/hawkular/inventory/rest/ResponseUtil.java#L176-L227 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java | LockSet.setLockCount | public void setLockCount(int valueNumber, int lockCount) {
"""
Set the lock count for a lock object.
@param valueNumber
value number of the lock object
@param lockCount
the lock count for the lock
"""
int index = findIndex(valueNumber);
if (index < 0) {
addEntry(index, valueNu... | java | public void setLockCount(int valueNumber, int lockCount) {
int index = findIndex(valueNumber);
if (index < 0) {
addEntry(index, valueNumber, lockCount);
} else {
array[index + 1] = lockCount;
}
} | [
"public",
"void",
"setLockCount",
"(",
"int",
"valueNumber",
",",
"int",
"lockCount",
")",
"{",
"int",
"index",
"=",
"findIndex",
"(",
"valueNumber",
")",
";",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"addEntry",
"(",
"index",
",",
"valueNumber",
",",
"... | Set the lock count for a lock object.
@param valueNumber
value number of the lock object
@param lockCount
the lock count for the lock | [
"Set",
"the",
"lock",
"count",
"for",
"a",
"lock",
"object",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/LockSet.java#L103-L110 |
bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/auth/OwnerDatabusAuthorizer.java | OwnerDatabusAuthorizer.ownerCanReadTable | private boolean ownerCanReadTable(String ownerId, String table) {
"""
Determines if an owner has read permission on a table. This always calls back to the authorizer and will not
return a cached value.
"""
return _internalAuthorizer.hasPermissionById(ownerId, getReadPermission(table));
} | java | private boolean ownerCanReadTable(String ownerId, String table) {
return _internalAuthorizer.hasPermissionById(ownerId, getReadPermission(table));
} | [
"private",
"boolean",
"ownerCanReadTable",
"(",
"String",
"ownerId",
",",
"String",
"table",
")",
"{",
"return",
"_internalAuthorizer",
".",
"hasPermissionById",
"(",
"ownerId",
",",
"getReadPermission",
"(",
"table",
")",
")",
";",
"}"
] | Determines if an owner has read permission on a table. This always calls back to the authorizer and will not
return a cached value. | [
"Determines",
"if",
"an",
"owner",
"has",
"read",
"permission",
"on",
"a",
"table",
".",
"This",
"always",
"calls",
"back",
"to",
"the",
"authorizer",
"and",
"will",
"not",
"return",
"a",
"cached",
"value",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/auth/OwnerDatabusAuthorizer.java#L187-L189 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.checkSameNameFeatureTypeStyle | public static String checkSameNameFeatureTypeStyle( List<FeatureTypeStyleWrapper> ftsWrapperList, String ftsName ) {
"""
Checks if the list of {@link FeatureTypeStyleWrapper}s supplied contains one with the supplied name.
<p>If the rule is contained it adds an index to the name.
@param ftsWrapperList the lis... | java | public static String checkSameNameFeatureTypeStyle( List<FeatureTypeStyleWrapper> ftsWrapperList, String ftsName ) {
int index = 1;
String name = ftsName.trim();
for( int i = 0; i < ftsWrapperList.size(); i++ ) {
FeatureTypeStyleWrapper ftsWrapper = ftsWrapperList.get(i);
... | [
"public",
"static",
"String",
"checkSameNameFeatureTypeStyle",
"(",
"List",
"<",
"FeatureTypeStyleWrapper",
">",
"ftsWrapperList",
",",
"String",
"ftsName",
")",
"{",
"int",
"index",
"=",
"1",
";",
"String",
"name",
"=",
"ftsName",
".",
"trim",
"(",
")",
";",
... | Checks if the list of {@link FeatureTypeStyleWrapper}s supplied contains one with the supplied name.
<p>If the rule is contained it adds an index to the name.
@param ftsWrapperList the list of featureTypeStyles to check.
@param ftsName the name of the featureTypeStyle to find.
@return the new name of the featureTypeS... | [
"Checks",
"if",
"the",
"list",
"of",
"{",
"@link",
"FeatureTypeStyleWrapper",
"}",
"s",
"supplied",
"contains",
"one",
"with",
"the",
"supplied",
"name",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L794-L821 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.getInternalState | @SuppressWarnings("unchecked")
public static <T> T getInternalState(Object object, String fieldName) {
"""
Get the value of a field using reflection. This method will iterate
through the entire class hierarchy and return the value of the first
field named <tt>fieldName</tt>. If you want to get a specific fie... | java | @SuppressWarnings("unchecked")
public static <T> T getInternalState(Object object, String fieldName) {
Field foundField = findFieldInHierarchy(object, fieldName);
try {
return (T) foundField.get(object);
} catch (IllegalAccessException e) {
throw new RuntimeException(... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getInternalState",
"(",
"Object",
"object",
",",
"String",
"fieldName",
")",
"{",
"Field",
"foundField",
"=",
"findFieldInHierarchy",
"(",
"object",
",",
"fieldName",
... | Get the value of a field using reflection. This method will iterate
through the entire class hierarchy and return the value of the first
field named <tt>fieldName</tt>. If you want to get a specific field value
at specific place in the class hierarchy please refer to
@param <T> the generic type
@param object ... | [
"Get",
"the",
"value",
"of",
"a",
"field",
"using",
"reflection",
".",
"This",
"method",
"will",
"iterate",
"through",
"the",
"entire",
"class",
"hierarchy",
"and",
"return",
"the",
"value",
"of",
"the",
"first",
"field",
"named",
"<tt",
">",
"fieldName<",
... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L424-L432 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/masterslave/MasterSlave.java | MasterSlave.connectAsync | public static <K, V> CompletableFuture<StatefulRedisMasterSlaveConnection<K, V>> connectAsync(RedisClient redisClient,
RedisCodec<K, V> codec, RedisURI redisURI) {
"""
Open asynchronously a new connection to a Redis Master-Slave server/servers using the supplied {@link RedisURI} and the
supplied {@lin... | java | public static <K, V> CompletableFuture<StatefulRedisMasterSlaveConnection<K, V>> connectAsync(RedisClient redisClient,
RedisCodec<K, V> codec, RedisURI redisURI) {
return transformAsyncConnectionException(connectAsyncSentinelOrAutodiscovery(redisClient, codec, redisURI), redisURI);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"CompletableFuture",
"<",
"StatefulRedisMasterSlaveConnection",
"<",
"K",
",",
"V",
">",
">",
"connectAsync",
"(",
"RedisClient",
"redisClient",
",",
"RedisCodec",
"<",
"K",
",",
"V",
">",
"codec",
",",
"RedisURI"... | Open asynchronously a new connection to a Redis Master-Slave server/servers using the supplied {@link RedisURI} and the
supplied {@link RedisCodec codec} to encode/decode keys.
<p>
This {@link MasterSlave} performs auto-discovery of nodes using either Redis Sentinel or Master/Slave. A {@link RedisURI}
can point to eith... | [
"Open",
"asynchronously",
"a",
"new",
"connection",
"to",
"a",
"Redis",
"Master",
"-",
"Slave",
"server",
"/",
"servers",
"using",
"the",
"supplied",
"{",
"@link",
"RedisURI",
"}",
"and",
"the",
"supplied",
"{",
"@link",
"RedisCodec",
"codec",
"}",
"to",
"... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/masterslave/MasterSlave.java#L138-L141 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/util/MergedClass.java | MergedClass.buildClassFile | public static ClassFile buildClassFile(String className, Class<?>[] classes)
throws IllegalArgumentException {
"""
Just create the bytecode for the merged class, but don't load it. Since
no ClassInjector is provided to resolve name conflicts, the class name
must be manually provided.
@param className ... | java | public static ClassFile buildClassFile(String className, Class<?>[] classes)
throws IllegalArgumentException
{
return buildClassFile(className, classes, null, null, OBSERVER_DISABLED);
} | [
"public",
"static",
"ClassFile",
"buildClassFile",
"(",
"String",
"className",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"classes",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"buildClassFile",
"(",
"className",
",",
"classes",
",",
"null",
",",
"nu... | Just create the bytecode for the merged class, but don't load it. Since
no ClassInjector is provided to resolve name conflicts, the class name
must be manually provided.
@param className name to give to merged class
@param classes Source classes used to derive merged class | [
"Just",
"create",
"the",
"bytecode",
"for",
"the",
"merged",
"class",
"but",
"don",
"t",
"load",
"it",
".",
"Since",
"no",
"ClassInjector",
"is",
"provided",
"to",
"resolve",
"name",
"conflicts",
"the",
"class",
"name",
"must",
"be",
"manually",
"provided",
... | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/MergedClass.java#L420-L424 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/CharTrie.java | CharTrie.getSurrogateOffset | @Override
protected final int getSurrogateOffset(char lead, char trail) {
"""
Gets the offset to the data which the surrogate pair points to.
@param lead lead surrogate
@param trail trailing surrogate
@return offset to data
"""
if (m_dataManipulate_ == null) {
throw new NullPointerEx... | java | @Override
protected final int getSurrogateOffset(char lead, char trail)
{
if (m_dataManipulate_ == null) {
throw new NullPointerException(
"The field DataManipulate in this Trie is null");
}
// get fold position for the next trail surrogate
... | [
"@",
"Override",
"protected",
"final",
"int",
"getSurrogateOffset",
"(",
"char",
"lead",
",",
"char",
"trail",
")",
"{",
"if",
"(",
"m_dataManipulate_",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"The field DataManipulate in this Trie is ... | Gets the offset to the data which the surrogate pair points to.
@param lead lead surrogate
@param trail trailing surrogate
@return offset to data | [
"Gets",
"the",
"offset",
"to",
"the",
"data",
"which",
"the",
"surrogate",
"pair",
"points",
"to",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/CharTrie.java#L257-L276 |
jbundle/jbundle | thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/db/converter/SecondaryRecordConverter.java | SecondaryRecordConverter.init | public void init(Converter converter, RemoteSession remoteSession, FieldList record, String strFieldName, boolean bCacheTable, String strIndexValue, String strKeyArea, String strNullValue) {
"""
Build a popup box using a remote fieldlist.
If the remote session doesn't exist, create it.
@param applet The top-leve... | java | public void init(Converter converter, RemoteSession remoteSession, FieldList record, String strFieldName, boolean bCacheTable, String strIndexValue, String strKeyArea, String strNullValue)
{
super.init(converter);
m_record = record;
m_strNullValue = strNullValue;
t... | [
"public",
"void",
"init",
"(",
"Converter",
"converter",
",",
"RemoteSession",
"remoteSession",
",",
"FieldList",
"record",
",",
"String",
"strFieldName",
",",
"boolean",
"bCacheTable",
",",
"String",
"strIndexValue",
",",
"String",
"strKeyArea",
",",
"String",
"s... | Build a popup box using a remote fieldlist.
If the remote session doesn't exist, create it.
@param applet The top-level applet.
@param remoteSession The remote parent session for this record's new table session.
@param record The record to display.
@param strDesc The description for this combo-box.
@param strFieldName ... | [
"Build",
"a",
"popup",
"box",
"using",
"a",
"remote",
"fieldlist",
".",
"If",
"the",
"remote",
"session",
"doesn",
"t",
"exist",
"create",
"it",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/db/converter/SecondaryRecordConverter.java#L84-L106 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/font/effects/EffectUtil.java | EffectUtil.intValue | static public Value intValue (String name, final int currentValue, final String description) {
"""
Prompts the user for int value
@param name The name of the dialog to show
@param currentValue The current value to be displayed
@param description The help text to provide
@return The value selected by the user... | java | static public Value intValue (String name, final int currentValue, final String description) {
return new DefaultValue(name, String.valueOf(currentValue)) {
public void showDialog () {
JSpinner spinner = new JSpinner(new SpinnerNumberModel(currentValue, Short.MIN_VALUE, Short.MAX_VALUE, 1));
if (showVa... | [
"static",
"public",
"Value",
"intValue",
"(",
"String",
"name",
",",
"final",
"int",
"currentValue",
",",
"final",
"String",
"description",
")",
"{",
"return",
"new",
"DefaultValue",
"(",
"name",
",",
"String",
".",
"valueOf",
"(",
"currentValue",
")",
")",
... | Prompts the user for int value
@param name The name of the dialog to show
@param currentValue The current value to be displayed
@param description The help text to provide
@return The value selected by the user | [
"Prompts",
"the",
"user",
"for",
"int",
"value"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/font/effects/EffectUtil.java#L85-L96 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.