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 |
|---|---|---|---|---|---|---|---|---|---|---|
kaazing/java.client | transport/src/main/java/org/kaazing/gateway/client/transport/ws/WsFrameEncodingSupport.java | WsFrameEncodingSupport.rfc6455Encode | public static ByteBuffer rfc6455Encode(WsMessage message, int maskValue) {
"""
Encode WebSocket message as a single frame, with the provided masking value applied.
"""
final boolean mask = true;
boolean fin = true; // TODO continued frames?
ByteBuffer buf = message.getBytes();
... | java | public static ByteBuffer rfc6455Encode(WsMessage message, int maskValue) {
final boolean mask = true;
boolean fin = true; // TODO continued frames?
ByteBuffer buf = message.getBytes();
int remaining = buf.remaining();
int offset = 2 + (mask ? 4 : 0) + calculateLengt... | [
"public",
"static",
"ByteBuffer",
"rfc6455Encode",
"(",
"WsMessage",
"message",
",",
"int",
"maskValue",
")",
"{",
"final",
"boolean",
"mask",
"=",
"true",
";",
"boolean",
"fin",
"=",
"true",
";",
"// TODO continued frames?",
"ByteBuffer",
"buf",
"=",
"message",... | Encode WebSocket message as a single frame, with the provided masking value applied. | [
"Encode",
"WebSocket",
"message",
"as",
"a",
"single",
"frame",
"with",
"the",
"provided",
"masking",
"value",
"applied",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/transport/src/main/java/org/kaazing/gateway/client/transport/ws/WsFrameEncodingSupport.java#L26-L65 |
aalmiray/Json-lib | src/main/java/net/sf/json/JsonConfig.java | JsonConfig.registerDefaultValueProcessor | public void registerDefaultValueProcessor( Class target, DefaultValueProcessor defaultValueProcessor ) {
"""
Registers a DefaultValueProcessor.<br>
[Java -> JSON]
@param target the class to use as key
@param defaultValueProcessor the processor to register
"""
if( target != null && defaultValuePro... | java | public void registerDefaultValueProcessor( Class target, DefaultValueProcessor defaultValueProcessor ) {
if( target != null && defaultValueProcessor != null ) {
defaultValueMap.put( target, defaultValueProcessor );
}
} | [
"public",
"void",
"registerDefaultValueProcessor",
"(",
"Class",
"target",
",",
"DefaultValueProcessor",
"defaultValueProcessor",
")",
"{",
"if",
"(",
"target",
"!=",
"null",
"&&",
"defaultValueProcessor",
"!=",
"null",
")",
"{",
"defaultValueMap",
".",
"put",
"(",
... | Registers a DefaultValueProcessor.<br>
[Java -> JSON]
@param target the class to use as key
@param defaultValueProcessor the processor to register | [
"Registers",
"a",
"DefaultValueProcessor",
".",
"<br",
">",
"[",
"Java",
"-",
">",
";",
"JSON",
"]"
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JsonConfig.java#L760-L764 |
joelittlejohn/jsonschema2pojo | jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/TypeRule.java | TypeRule.getNumberType | private JType getNumberType(JCodeModel owner, GenerationConfig config) {
"""
Returns the JType for a number field. Handles type lookup and unboxing.
"""
if (config.isUseBigDecimals()) {
return unboxIfNecessary(owner.ref(BigDecimal.class), config);
} else if (config.isUseDoubleNumbers()) {
... | java | private JType getNumberType(JCodeModel owner, GenerationConfig config) {
if (config.isUseBigDecimals()) {
return unboxIfNecessary(owner.ref(BigDecimal.class), config);
} else if (config.isUseDoubleNumbers()) {
return unboxIfNecessary(owner.ref(Double.class), config);
} else {
return unbox... | [
"private",
"JType",
"getNumberType",
"(",
"JCodeModel",
"owner",
",",
"GenerationConfig",
"config",
")",
"{",
"if",
"(",
"config",
".",
"isUseBigDecimals",
"(",
")",
")",
"{",
"return",
"unboxIfNecessary",
"(",
"owner",
".",
"ref",
"(",
"BigDecimal",
".",
"c... | Returns the JType for a number field. Handles type lookup and unboxing. | [
"Returns",
"the",
"JType",
"for",
"a",
"number",
"field",
".",
"Handles",
"type",
"lookup",
"and",
"unboxing",
"."
] | train | https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/TypeRule.java#L162-L172 |
protostuff/protostuff | protostuff-xml/src/main/java/io/protostuff/XmlXIOUtil.java | XmlXIOUtil.toByteArray | public static <T> byte[] toByteArray(T message, Schema<T> schema, LinkedBuffer buffer) {
"""
Serializes the {@code message} into a byte array using the given schema.
@return the byte array containing the data.
"""
if (buffer.start != buffer.offset)
throw new IllegalArgumentException("Buf... | java | public static <T> byte[] toByteArray(T message, Schema<T> schema, LinkedBuffer buffer)
{
if (buffer.start != buffer.offset)
throw new IllegalArgumentException("Buffer previously used and had not been reset.");
final XmlXOutput output = new XmlXOutput(buffer, schema);
final Stri... | [
"public",
"static",
"<",
"T",
">",
"byte",
"[",
"]",
"toByteArray",
"(",
"T",
"message",
",",
"Schema",
"<",
"T",
">",
"schema",
",",
"LinkedBuffer",
"buffer",
")",
"{",
"if",
"(",
"buffer",
".",
"start",
"!=",
"buffer",
".",
"offset",
")",
"throw",
... | Serializes the {@code message} into a byte array using the given schema.
@return the byte array containing the data. | [
"Serializes",
"the",
"{",
"@code",
"message",
"}",
"into",
"a",
"byte",
"array",
"using",
"the",
"given",
"schema",
"."
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-xml/src/main/java/io/protostuff/XmlXIOUtil.java#L39-L69 |
OpenFeign/feign | core/src/main/java/feign/Feign.java | Feign.configKey | public static String configKey(Class targetType, Method method) {
"""
Configuration keys are formatted as unresolved <a href=
"http://docs.oracle.com/javase/6/docs/jdk/api/javadoc/doclet/com/sun/javadoc/SeeTag.html" >see
tags</a>. This method exposes that format, in case you need to create the same value as
{@l... | java | public static String configKey(Class targetType, Method method) {
StringBuilder builder = new StringBuilder();
builder.append(targetType.getSimpleName());
builder.append('#').append(method.getName()).append('(');
for (Type param : method.getGenericParameterTypes()) {
param = Types.resolve(targetTy... | [
"public",
"static",
"String",
"configKey",
"(",
"Class",
"targetType",
",",
"Method",
"method",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"targetType",
".",
"getSimpleName",
"(",
")",
")"... | Configuration keys are formatted as unresolved <a href=
"http://docs.oracle.com/javase/6/docs/jdk/api/javadoc/doclet/com/sun/javadoc/SeeTag.html" >see
tags</a>. This method exposes that format, in case you need to create the same value as
{@link MethodMetadata#configKey()} for correlation purposes.
<p>
Here are some s... | [
"Configuration",
"keys",
"are",
"formatted",
"as",
"unresolved",
"<a",
"href",
"=",
"http",
":",
"//",
"docs",
".",
"oracle",
".",
"com",
"/",
"javase",
"/",
"6",
"/",
"docs",
"/",
"jdk",
"/",
"api",
"/",
"javadoc",
"/",
"doclet",
"/",
"com",
"/",
... | train | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/Feign.java#L67-L79 |
motown-io/motown | chargingstation-configuration/view-model/src/main/java/io/motown/chargingstationconfiguration/viewmodel/domain/DomainService.java | DomainService.updateConnector | public Connector updateConnector(Long chargingStationTypeId, Long evseId, Connector connector) {
"""
Update a connector.
@param chargingStationTypeId charging station type identifier.
@param evseId the id of the evse that contains the connector.
@param connector the payload from the... | java | public Connector updateConnector(Long chargingStationTypeId, Long evseId, Connector connector) {
ChargingStationType chargingStationType = chargingStationTypeRepository.findOne(chargingStationTypeId);
Evse evse = getEvseById(chargingStationType, evseId);
Connector existingConnector = getConnect... | [
"public",
"Connector",
"updateConnector",
"(",
"Long",
"chargingStationTypeId",
",",
"Long",
"evseId",
",",
"Connector",
"connector",
")",
"{",
"ChargingStationType",
"chargingStationType",
"=",
"chargingStationTypeRepository",
".",
"findOne",
"(",
"chargingStationTypeId",
... | Update a connector.
@param chargingStationTypeId charging station type identifier.
@param evseId the id of the evse that contains the connector.
@param connector the payload from the request.
@return updated connector. | [
"Update",
"a",
"connector",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/chargingstation-configuration/view-model/src/main/java/io/motown/chargingstationconfiguration/viewmodel/domain/DomainService.java#L222-L236 |
jenkinsci/jenkins | core/src/main/java/hudson/util/FileVisitor.java | FileVisitor.visitSymlink | public void visitSymlink(File link, String target, String relativePath) throws IOException {
"""
Some visitors can handle symlinks as symlinks. Those visitors should implement
this method to provide a different handling for symlink.
<p>
This method is invoked by those {@link DirScanner}s that can handle symlink... | java | public void visitSymlink(File link, String target, String relativePath) throws IOException {
visit(link,relativePath);
} | [
"public",
"void",
"visitSymlink",
"(",
"File",
"link",
",",
"String",
"target",
",",
"String",
"relativePath",
")",
"throws",
"IOException",
"{",
"visit",
"(",
"link",
",",
"relativePath",
")",
";",
"}"
] | Some visitors can handle symlinks as symlinks. Those visitors should implement
this method to provide a different handling for symlink.
<p>
This method is invoked by those {@link DirScanner}s that can handle symlinks as symlinks.
(Not every {@link DirScanner}s are capable of doing that, as proper symlink handling requi... | [
"Some",
"visitors",
"can",
"handle",
"symlinks",
"as",
"symlinks",
".",
"Those",
"visitors",
"should",
"implement",
"this",
"method",
"to",
"provide",
"a",
"different",
"handling",
"for",
"symlink",
".",
"<p",
">",
"This",
"method",
"is",
"invoked",
"by",
"t... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FileVisitor.java#L33-L35 |
apereo/cas | support/cas-server-support-consent-webflow/src/main/java/org/apereo/cas/web/flow/AbstractConsentAction.java | AbstractConsentAction.getRegisteredServiceForConsent | protected RegisteredService getRegisteredServiceForConsent(final RequestContext requestContext, final Service service) {
"""
Gets registered service for consent.
@param requestContext the request context
@param service the service
@return the registered service for consent
"""
val serviceTo... | java | protected RegisteredService getRegisteredServiceForConsent(final RequestContext requestContext, final Service service) {
val serviceToUse = this.authenticationRequestServiceSelectionStrategies.resolveService(service);
val registeredService = this.servicesManager.findServiceBy(serviceToUse);
Regi... | [
"protected",
"RegisteredService",
"getRegisteredServiceForConsent",
"(",
"final",
"RequestContext",
"requestContext",
",",
"final",
"Service",
"service",
")",
"{",
"val",
"serviceToUse",
"=",
"this",
".",
"authenticationRequestServiceSelectionStrategies",
".",
"resolveService... | Gets registered service for consent.
@param requestContext the request context
@param service the service
@return the registered service for consent | [
"Gets",
"registered",
"service",
"for",
"consent",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-consent-webflow/src/main/java/org/apereo/cas/web/flow/AbstractConsentAction.java#L53-L58 |
znerd/xmlenc | src/main/java/org/znerd/xmlenc/XMLChecker.java | XMLChecker.checkName | public static final void checkName(char[] ch, int start, int length) throws NullPointerException, IndexOutOfBoundsException, InvalidXMLException {
"""
Checks if the specified part of a character array matches the <em>Name</em> production. See:
<a href="http://www.w3.org/TR/REC-xml#NT-Name">Definition of Name</a>.... | java | public static final void checkName(char[] ch, int start, int length) throws NullPointerException, IndexOutOfBoundsException, InvalidXMLException {
// Minimum length is 1
if (length < 1) {
throw new InvalidXMLException("An empty string does not match the 'Name' production.");
}
... | [
"public",
"static",
"final",
"void",
"checkName",
"(",
"char",
"[",
"]",
"ch",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"NullPointerException",
",",
"IndexOutOfBoundsException",
",",
"InvalidXMLException",
"{",
"// Minimum length is 1",
"if",
"(",... | Checks if the specified part of a character array matches the <em>Name</em> production. See:
<a href="http://www.w3.org/TR/REC-xml#NT-Name">Definition of Name</a>.
@param ch the character array that contains the characters to be checked, cannot be
<code>null</code>.
@param start the start index into <code>ch</cod... | [
"Checks",
"if",
"the",
"specified",
"part",
"of",
"a",
"character",
"array",
"matches",
"the",
"<em",
">",
"Name<",
"/",
"em",
">",
"production",
".",
"See",
":",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"TR",
"/",
... | train | https://github.com/znerd/xmlenc/blob/6ff483777d9467db9990b7c7ae0158f21a243c31/src/main/java/org/znerd/xmlenc/XMLChecker.java#L97-L119 |
meltmedia/cadmium | maven/src/main/java/com/meltmedia/cadmium/maven/ArtifactResolver.java | ArtifactResolver.resolveMavenArtifact | public File resolveMavenArtifact(String artifact) throws ArtifactResolutionException {
"""
Fetches a maven artifact and returns a File Object that points to its location.
@param artifact The maven coordinates in the format of <code>groupId:artifactId:type:version</code>
@return A File Object that points to the... | java | public File resolveMavenArtifact(String artifact) throws ArtifactResolutionException {
// NOTE: This page on Aether (https://docs.sonatype.org/display/AETHER/Home) states that
// the plexus container uses the context class loader.
ClassLoader oldContext = Thread.currentThread().getContextClassLoader();
... | [
"public",
"File",
"resolveMavenArtifact",
"(",
"String",
"artifact",
")",
"throws",
"ArtifactResolutionException",
"{",
"// NOTE: This page on Aether (https://docs.sonatype.org/display/AETHER/Home) states that",
"// the plexus container uses the context class loader.",
"ClassLoader",
"oldC... | Fetches a maven artifact and returns a File Object that points to its location.
@param artifact The maven coordinates in the format of <code>groupId:artifactId:type:version</code>
@return A File Object that points to the artifact.
@throws ArtifactResolutionException | [
"Fetches",
"a",
"maven",
"artifact",
"and",
"returns",
"a",
"File",
"Object",
"that",
"points",
"to",
"its",
"location",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/maven/src/main/java/com/meltmedia/cadmium/maven/ArtifactResolver.java#L79-L109 |
schallee/alib4j | osgi/core/src/main/java/net/darkmist/alib/osgi/MiscUtil.java | MiscUtil.castOrNull | public static <T> T castOrNull(Object o, Class<T> cls) {
"""
Cast object to class or return null.
@param o The object to cast
@param cls The class to cast o to
@return o cast as cls. null if o is null or not a instance of cls.
"""
if(o == null)
return null;
if(cls.isInstance(o))
return cls.cast(o)... | java | public static <T> T castOrNull(Object o, Class<T> cls)
{
if(o == null)
return null;
if(cls.isInstance(o))
return cls.cast(o);
return null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"castOrNull",
"(",
"Object",
"o",
",",
"Class",
"<",
"T",
">",
"cls",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"cls",
".",
"isInstance",
"(",
"o",
")",
")",
"return",... | Cast object to class or return null.
@param o The object to cast
@param cls The class to cast o to
@return o cast as cls. null if o is null or not a instance of cls. | [
"Cast",
"object",
"to",
"class",
"or",
"return",
"null",
"."
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/osgi/core/src/main/java/net/darkmist/alib/osgi/MiscUtil.java#L57-L64 |
chocotan/datepicker4j | src/main/java/io/loli/datepicker/DatePicker.java | DatePicker.dateTimePicker | public static void dateTimePicker(JTextField field, String format,
DateFilter filter) {
"""
Add a time picker to a text field with time format
@param field
the text field you want to add to
@param format
time format string
@param filter
to make some days unclickable
"""
new DateTime... | java | public static void dateTimePicker(JTextField field, String format,
DateFilter filter) {
new DateTimePicker(field, format, filter);
} | [
"public",
"static",
"void",
"dateTimePicker",
"(",
"JTextField",
"field",
",",
"String",
"format",
",",
"DateFilter",
"filter",
")",
"{",
"new",
"DateTimePicker",
"(",
"field",
",",
"format",
",",
"filter",
")",
";",
"}"
] | Add a time picker to a text field with time format
@param field
the text field you want to add to
@param format
time format string
@param filter
to make some days unclickable | [
"Add",
"a",
"time",
"picker",
"to",
"a",
"text",
"field",
"with",
"time",
"format"
] | train | https://github.com/chocotan/datepicker4j/blob/d65d7a6b29f9efe77aeec2024dc31a38a7852676/src/main/java/io/loli/datepicker/DatePicker.java#L211-L214 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ComparableTimSort.java | ComparableTimSort.countRunAndMakeAscending | @SuppressWarnings( {
"""
Returns the length of the run beginning at the specified position in
the specified array and reverses the run if it is descending (ensuring
that the run will always be ascending when the method returns).
A run is the longest ascending sequence with:
a[lo] <= a[lo + 1] <= a[lo + 2] ... | java | @SuppressWarnings({"unchecked", "rawtypes"})
private static int countRunAndMakeAscending(Object[] a, int lo, int hi) {
assert lo < hi;
int runHi = lo + 1;
if (runHi == hi)
return 1;
// Find end of run, and reverse range if descending
if (((Comparable) a[runHi++])... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"private",
"static",
"int",
"countRunAndMakeAscending",
"(",
"Object",
"[",
"]",
"a",
",",
"int",
"lo",
",",
"int",
"hi",
")",
"{",
"assert",
"lo",
"<",
"hi",
";",
"int",
... | Returns the length of the run beginning at the specified position in
the specified array and reverses the run if it is descending (ensuring
that the run will always be ascending when the method returns).
A run is the longest ascending sequence with:
a[lo] <= a[lo + 1] <= a[lo + 2] <= ...
or the longest descending se... | [
"Returns",
"the",
"length",
"of",
"the",
"run",
"beginning",
"at",
"the",
"specified",
"position",
"in",
"the",
"specified",
"array",
"and",
"reverses",
"the",
"run",
"if",
"it",
"is",
"descending",
"(",
"ensuring",
"that",
"the",
"run",
"will",
"always",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ComparableTimSort.java#L312-L330 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/schedule/CronSequenceGenerator.java | CronSequenceGenerator.setNumberHits | private void setNumberHits(BitSet bits, String value, int min, int max) {
"""
Sets the number hits.
@param bits the bits
@param value the value
@param min the min
@param max the max
"""
String[] fields = StringUtils.delimitedListToStringArray(value, ",");
for (String field : fields) {
... | java | private void setNumberHits(BitSet bits, String value, int min, int max) {
String[] fields = StringUtils.delimitedListToStringArray(value, ",");
for (String field : fields) {
if (!field.contains("/")) {
// Not an incrementer so it must be a range (possibly empty)
... | [
"private",
"void",
"setNumberHits",
"(",
"BitSet",
"bits",
",",
"String",
"value",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"String",
"[",
"]",
"fields",
"=",
"StringUtils",
".",
"delimitedListToStringArray",
"(",
"value",
",",
"\",\"",
")",
";",
... | Sets the number hits.
@param bits the bits
@param value the value
@param min the min
@param max the max | [
"Sets",
"the",
"number",
"hits",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/schedule/CronSequenceGenerator.java#L322-L345 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.createPatternAnyEntityModelAsync | public Observable<UUID> createPatternAnyEntityModelAsync(UUID appId, String versionId, PatternAnyModelCreateObject extractorCreateObject) {
"""
Adds a pattern.any entity extractor to the application.
@param appId The application ID.
@param versionId The version ID.
@param extractorCreateObject A model object ... | java | public Observable<UUID> createPatternAnyEntityModelAsync(UUID appId, String versionId, PatternAnyModelCreateObject extractorCreateObject) {
return createPatternAnyEntityModelWithServiceResponseAsync(appId, versionId, extractorCreateObject).map(new Func1<ServiceResponse<UUID>, UUID>() {
@Override
... | [
"public",
"Observable",
"<",
"UUID",
">",
"createPatternAnyEntityModelAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"PatternAnyModelCreateObject",
"extractorCreateObject",
")",
"{",
"return",
"createPatternAnyEntityModelWithServiceResponseAsync",
"(",
"appId"... | Adds a pattern.any entity extractor to the application.
@param appId The application ID.
@param versionId The version ID.
@param extractorCreateObject A model object containing the name and explicit list for the new Pattern.Any entity extractor.
@throws IllegalArgumentException thrown if parameters fail the validation... | [
"Adds",
"a",
"pattern",
".",
"any",
"entity",
"extractor",
"to",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L7594-L7601 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsInner.java | RunsInner.beginCancel | public void beginCancel(String resourceGroupName, String registryName, String runId) {
"""
Cancel an existing run.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param runId The run ID.
@throws IllegalA... | java | public void beginCancel(String resourceGroupName, String registryName, String runId) {
beginCancelWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().single().body();
} | [
"public",
"void",
"beginCancel",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"runId",
")",
"{",
"beginCancelWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"runId",
")",
".",
"toBlocking",
"(",
")"... | Cancel an existing run.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param runId The run ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the reques... | [
"Cancel",
"an",
"existing",
"run",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsInner.java#L951-L953 |
PunchThrough/bean-sdk-android | sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java | Bean.setRadioConfig | public void setRadioConfig(RadioConfig config, boolean save) {
"""
Set the radio config.
@param config the {@link com.punchthrough.bean.sdk.message.RadioConfig} to set
@param save true to save the config in non-volatile storage, false otherwise.
"""
sendMessage(save ? BeanMessageID.BT_SET_CONFIG ... | java | public void setRadioConfig(RadioConfig config, boolean save) {
sendMessage(save ? BeanMessageID.BT_SET_CONFIG : BeanMessageID.BT_SET_CONFIG_NOSAVE, config);
} | [
"public",
"void",
"setRadioConfig",
"(",
"RadioConfig",
"config",
",",
"boolean",
"save",
")",
"{",
"sendMessage",
"(",
"save",
"?",
"BeanMessageID",
".",
"BT_SET_CONFIG",
":",
"BeanMessageID",
".",
"BT_SET_CONFIG_NOSAVE",
",",
"config",
")",
";",
"}"
] | Set the radio config.
@param config the {@link com.punchthrough.bean.sdk.message.RadioConfig} to set
@param save true to save the config in non-volatile storage, false otherwise. | [
"Set",
"the",
"radio",
"config",
"."
] | train | https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java#L965-L967 |
alkacon/opencms-core | src/org/opencms/relations/CmsExternalLinksValidator.java | CmsExternalLinksValidator.validateLinks | @SuppressWarnings("deprecation")
public void validateLinks(CmsObject cms) throws CmsException {
"""
Validate all links.<p>
@param cms a OpenCms context object
@throws CmsException if something goes wrong
"""
if (m_report == null) {
m_report = new CmsLogReport(cms.getRequestContex... | java | @SuppressWarnings("deprecation")
public void validateLinks(CmsObject cms) throws CmsException {
if (m_report == null) {
m_report = new CmsLogReport(cms.getRequestContext().getLocale(), CmsExternalLinksValidator.class);
}
m_report.println(
Messages.get().container(Me... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"void",
"validateLinks",
"(",
"CmsObject",
"cms",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"m_report",
"==",
"null",
")",
"{",
"m_report",
"=",
"new",
"CmsLogReport",
"(",
"cms",
".",
"get... | Validate all links.<p>
@param cms a OpenCms context object
@throws CmsException if something goes wrong | [
"Validate",
"all",
"links",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsExternalLinksValidator.java#L135-L198 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/validate/PropertyValidator.java | PropertyValidator.assertOneOrLess | public void assertOneOrLess(final String propertyName,
final PropertyList properties) throws ValidationException {
"""
Ensure a property occurs no more than once.
@param propertyName
the property name
@param properties
a list of properties to query
@throws ValidationException
when the specified... | java | public void assertOneOrLess(final String propertyName,
final PropertyList properties) throws ValidationException {
if (properties.getProperties(propertyName).size() > 1) {
throw new ValidationException(ASSERT_ONE_OR_LESS_MESSAGE, new Object[] {propertyName});
}
} | [
"public",
"void",
"assertOneOrLess",
"(",
"final",
"String",
"propertyName",
",",
"final",
"PropertyList",
"properties",
")",
"throws",
"ValidationException",
"{",
"if",
"(",
"properties",
".",
"getProperties",
"(",
"propertyName",
")",
".",
"size",
"(",
")",
">... | Ensure a property occurs no more than once.
@param propertyName
the property name
@param properties
a list of properties to query
@throws ValidationException
when the specified property occurs more than once | [
"Ensure",
"a",
"property",
"occurs",
"no",
"more",
"than",
"once",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/validate/PropertyValidator.java#L71-L77 |
jfinal/jfinal | src/main/java/com/jfinal/core/Controller.java | Controller.getParaToDate | public Date getParaToDate(String name, Date defaultValue) {
"""
Returns the value of a request parameter and convert to Date with a default value if it is null.
@param name a String specifying the name of the parameter
@return a Date representing the single value of the parameter
"""
return toDate(request... | java | public Date getParaToDate(String name, Date defaultValue) {
return toDate(request.getParameter(name), defaultValue);
} | [
"public",
"Date",
"getParaToDate",
"(",
"String",
"name",
",",
"Date",
"defaultValue",
")",
"{",
"return",
"toDate",
"(",
"request",
".",
"getParameter",
"(",
"name",
")",
",",
"defaultValue",
")",
";",
"}"
] | Returns the value of a request parameter and convert to Date with a default value if it is null.
@param name a String specifying the name of the parameter
@return a Date representing the single value of the parameter | [
"Returns",
"the",
"value",
"of",
"a",
"request",
"parameter",
"and",
"convert",
"to",
"Date",
"with",
"a",
"default",
"value",
"if",
"it",
"is",
"null",
"."
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/core/Controller.java#L429-L431 |
cache2k/cache2k | cache2k-core/src/main/java/org/cache2k/core/InternalCache2kBuilder.java | InternalCache2kBuilder.configureViaSettersDirect | @SuppressWarnings("unchecked")
private void configureViaSettersDirect(HeapCache<K,V> c) {
"""
The generic wiring code is not working on android.
Explicitly call the wiring methods.
"""
if (config.getLoader() != null) {
Object obj = c.createCustomization(config.getLoader());
if (obj instance... | java | @SuppressWarnings("unchecked")
private void configureViaSettersDirect(HeapCache<K,V> c) {
if (config.getLoader() != null) {
Object obj = c.createCustomization(config.getLoader());
if (obj instanceof CacheLoader) {
final CacheLoader<K,V> _loader = (CacheLoader) obj;
c.setAdvancedLoader... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"configureViaSettersDirect",
"(",
"HeapCache",
"<",
"K",
",",
"V",
">",
"c",
")",
"{",
"if",
"(",
"config",
".",
"getLoader",
"(",
")",
"!=",
"null",
")",
"{",
"Object",
"obj",
"=",
... | The generic wiring code is not working on android.
Explicitly call the wiring methods. | [
"The",
"generic",
"wiring",
"code",
"is",
"not",
"working",
"on",
"android",
".",
"Explicitly",
"call",
"the",
"wiring",
"methods",
"."
] | train | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/InternalCache2kBuilder.java#L111-L142 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlContentTypeManager.java | CmsXmlContentTypeManager.getContentHandler | public I_CmsXmlContentHandler getContentHandler(String className, String schemaLocation) throws CmsXmlException {
"""
Returns the XML content handler instance class for the specified class name.<p>
Only one instance of an XML content handler class per content definition name will be generated,
and that instanc... | java | public I_CmsXmlContentHandler getContentHandler(String className, String schemaLocation) throws CmsXmlException {
// create a unique key for the content deinition / class name combo
StringBuffer buffer = new StringBuffer(128);
buffer.append(schemaLocation);
buffer.append('#');
b... | [
"public",
"I_CmsXmlContentHandler",
"getContentHandler",
"(",
"String",
"className",
",",
"String",
"schemaLocation",
")",
"throws",
"CmsXmlException",
"{",
"// create a unique key for the content deinition / class name combo",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer"... | Returns the XML content handler instance class for the specified class name.<p>
Only one instance of an XML content handler class per content definition name will be generated,
and that instance will be cached and re-used for all operations.<p>
@param className the name of the XML content handler to return
@param sch... | [
"Returns",
"the",
"XML",
"content",
"handler",
"instance",
"class",
"for",
"the",
"specified",
"class",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlContentTypeManager.java#L283-L314 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/CmsElementUtil.java | CmsElementUtil.checkGroupAllowed | public static boolean checkGroupAllowed(String containerType, CmsGroupContainerBean groupContainer) {
"""
Checks if a group element is allowed in a container with a given type.<p>
@param containerType the container type spec (comma separated)
@param groupContainer the group
@return true if the group is allo... | java | public static boolean checkGroupAllowed(String containerType, CmsGroupContainerBean groupContainer) {
return !Sets.intersection(CmsContainer.splitType(containerType), groupContainer.getTypes()).isEmpty();
} | [
"public",
"static",
"boolean",
"checkGroupAllowed",
"(",
"String",
"containerType",
",",
"CmsGroupContainerBean",
"groupContainer",
")",
"{",
"return",
"!",
"Sets",
".",
"intersection",
"(",
"CmsContainer",
".",
"splitType",
"(",
"containerType",
")",
",",
"groupCon... | Checks if a group element is allowed in a container with a given type.<p>
@param containerType the container type spec (comma separated)
@param groupContainer the group
@return true if the group is allowed in the container | [
"Checks",
"if",
"a",
"group",
"element",
"is",
"allowed",
"in",
"a",
"container",
"with",
"a",
"given",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsElementUtil.java#L284-L287 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkVariableDeclaration | private Environment checkVariableDeclaration(Decl.Variable decl, Environment environment) {
"""
Type check a variable declaration statement. In particular, when an
initialiser is given we must check it is well-formed and that it is a subtype
of the declared type.
@param decl
Statement to type check
@param e... | java | private Environment checkVariableDeclaration(Decl.Variable decl, Environment environment) {
// Check type is sensible
checkNonEmpty(decl, environment);
// Check type of initialiser.
if (decl.hasInitialiser()) {
SemanticType type = checkExpression(decl.getInitialiser(), environment);
checkIsSubtype(decl.ge... | [
"private",
"Environment",
"checkVariableDeclaration",
"(",
"Decl",
".",
"Variable",
"decl",
",",
"Environment",
"environment",
")",
"{",
"// Check type is sensible",
"checkNonEmpty",
"(",
"decl",
",",
"environment",
")",
";",
"// Check type of initialiser.",
"if",
"(",
... | Type check a variable declaration statement. In particular, when an
initialiser is given we must check it is well-formed and that it is a subtype
of the declared type.
@param decl
Statement to type check
@param environment
Determines the type of all variables immediately going into this
block
@return | [
"Type",
"check",
"a",
"variable",
"declaration",
"statement",
".",
"In",
"particular",
"when",
"an",
"initialiser",
"is",
"given",
"we",
"must",
"check",
"it",
"is",
"well",
"-",
"formed",
"and",
"that",
"it",
"is",
"a",
"subtype",
"of",
"the",
"declared",... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L419-L429 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/dynamic/support/ResolvableType.java | ResolvableType.getNested | public ResolvableType getNested(int nestingLevel, Map<Integer, Integer> typeIndexesPerLevel) {
"""
Return a {@link ResolvableType} for the specified nesting level. The nesting level refers to the specific generic
parameter that should be returned. A nesting level of 1 indicates this type; 2 indicates the first ne... | java | public ResolvableType getNested(int nestingLevel, Map<Integer, Integer> typeIndexesPerLevel) {
ResolvableType result = this;
for (int i = 2; i <= nestingLevel; i++) {
if (result.isArray()) {
result = result.getComponentType();
} else {
// Handle de... | [
"public",
"ResolvableType",
"getNested",
"(",
"int",
"nestingLevel",
",",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"typeIndexesPerLevel",
")",
"{",
"ResolvableType",
"result",
"=",
"this",
";",
"for",
"(",
"int",
"i",
"=",
"2",
";",
"i",
"<=",
"nestingL... | Return a {@link ResolvableType} for the specified nesting level. The nesting level refers to the specific generic
parameter that should be returned. A nesting level of 1 indicates this type; 2 indicates the first nested generic; 3 the
second; and so on. For example, given {@code List<Set<Integer>>} level 1 refers to th... | [
"Return",
"a",
"{",
"@link",
"ResolvableType",
"}",
"for",
"the",
"specified",
"nesting",
"level",
".",
"The",
"nesting",
"level",
"refers",
"to",
"the",
"specific",
"generic",
"parameter",
"that",
"should",
"be",
"returned",
".",
"A",
"nesting",
"level",
"o... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/dynamic/support/ResolvableType.java#L518-L534 |
SeleniumHQ/fluent-selenium | java/src/main/java/org/seleniumhq/selenium/fluent/FluentSelect.java | FluentSelect.deselectByVisibleText | public FluentSelect deselectByVisibleText(final String text) {
"""
<p>
Deselect all options that display text matching the argument. That is, when given "Bar" this
would deselect an option like:
</p>
<option value="foo">Bar</option>
@param text The visible text to match against
"""
e... | java | public FluentSelect deselectByVisibleText(final String text) {
executeAndWrapReThrowIfNeeded(new DeselectByVisibleText(text), Context.singular(context, "deselectByVisibleText", null, text), true);
return new FluentSelect(super.delegate, currentElement.getFound(), this.context, monitor, booleanInsteadOfN... | [
"public",
"FluentSelect",
"deselectByVisibleText",
"(",
"final",
"String",
"text",
")",
"{",
"executeAndWrapReThrowIfNeeded",
"(",
"new",
"DeselectByVisibleText",
"(",
"text",
")",
",",
"Context",
".",
"singular",
"(",
"context",
",",
"\"deselectByVisibleText\"",
",",... | <p>
Deselect all options that display text matching the argument. That is, when given "Bar" this
would deselect an option like:
</p>
<option value="foo">Bar</option>
@param text The visible text to match against | [
"<p",
">",
"Deselect",
"all",
"options",
"that",
"display",
"text",
"matching",
"the",
"argument",
".",
"That",
"is",
"when",
"given",
"Bar",
"this",
"would",
"deselect",
"an",
"option",
"like",
":",
"<",
"/",
"p",
">",
"<",
";",
"option",
"value",
"... | train | https://github.com/SeleniumHQ/fluent-selenium/blob/fcb171471a7d1abb2800bcbca21b3ae3e6c12472/java/src/main/java/org/seleniumhq/selenium/fluent/FluentSelect.java#L166-L169 |
fengwenyi/JavaLib | bak/HttpUtils.java | HttpUtil.buildUrl | private static String buildUrl(String host, String path, String param) {
"""
Build URL
@param host 服务器
@param path 虚拟站点
@param param 参数
@return 拼接后的URL
"""
try {
StringBuilder sbUrl = new StringBuilder();
sbUrl.append(host);
if (StringUtil.isNotEmpty(path)) {
... | java | private static String buildUrl(String host, String path, String param) {
try {
StringBuilder sbUrl = new StringBuilder();
sbUrl.append(host);
if (StringUtil.isNotEmpty(path)) {
sbUrl.append(path);
}
if (StringUtil.isNotEmpty(param)) {
... | [
"private",
"static",
"String",
"buildUrl",
"(",
"String",
"host",
",",
"String",
"path",
",",
"String",
"param",
")",
"{",
"try",
"{",
"StringBuilder",
"sbUrl",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sbUrl",
".",
"append",
"(",
"host",
")",
";",
... | Build URL
@param host 服务器
@param path 虚拟站点
@param param 参数
@return 拼接后的URL | [
"Build",
"URL"
] | train | https://github.com/fengwenyi/JavaLib/blob/14838b13fb11c024e41be766aa3e13ead4be1703/bak/HttpUtils.java#L446-L466 |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsTabDialog.java | CmsTabDialog.dialogTabContent | public String dialogTabContent(int segment, String title, String attributes) {
"""
Builds the tab content area of the dialog window.<p>
@param segment the HTML segment (START / END)
@param title the title String for the dialog window
@param attributes additional attributes for the content <div> area of ... | java | public String dialogTabContent(int segment, String title, String attributes) {
if (segment == HTML_START) {
StringBuffer result = new StringBuffer(512);
// null title is ok, we always want the title headline
result.append(dialogHead(title));
result.append("<div c... | [
"public",
"String",
"dialogTabContent",
"(",
"int",
"segment",
",",
"String",
"title",
",",
"String",
"attributes",
")",
"{",
"if",
"(",
"segment",
"==",
"HTML_START",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"512",
")",
";",
"/... | Builds the tab content area of the dialog window.<p>
@param segment the HTML segment (START / END)
@param title the title String for the dialog window
@param attributes additional attributes for the content <div> area of the tab dialog
@return a tab content area start / end segment | [
"Builds",
"the",
"tab",
"content",
"area",
"of",
"the",
"dialog",
"window",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsTabDialog.java#L115-L134 |
gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/UploadFile.java | UploadFile.getProperty | public String getProperty(String key, String defaultValue) {
"""
Gets a property associated to this file.
@param key property key
@param defaultValue default value to use if the key does not exist or the value is null
@return property value or the default value passed
"""
String val = properties.get... | java | public String getProperty(String key, String defaultValue) {
String val = properties.get(key);
if (val == null) {
val = defaultValue;
}
return val;
} | [
"public",
"String",
"getProperty",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"properties",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"val",
"=",
"defaultValue",
";",
"}",
"r... | Gets a property associated to this file.
@param key property key
@param defaultValue default value to use if the key does not exist or the value is null
@return property value or the default value passed | [
"Gets",
"a",
"property",
"associated",
"to",
"this",
"file",
"."
] | train | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/UploadFile.java#L161-L169 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/io/CredentialInterceptorCache.java | CredentialInterceptorCache.getCredentialsInterceptor | public synchronized ClientInterceptor getCredentialsInterceptor(
CredentialOptions credentialOptions, RetryOptions retryOptions)
throws IOException, GeneralSecurityException {
"""
Given {@link com.google.cloud.bigtable.config.CredentialOptions} that define how to look up credentials, do the following:
... | java | public synchronized ClientInterceptor getCredentialsInterceptor(
CredentialOptions credentialOptions, RetryOptions retryOptions)
throws IOException, GeneralSecurityException {
// Default credentials is the most likely CredentialType. It's also the only CredentialType
// that can be safely cached.
... | [
"public",
"synchronized",
"ClientInterceptor",
"getCredentialsInterceptor",
"(",
"CredentialOptions",
"credentialOptions",
",",
"RetryOptions",
"retryOptions",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"// Default credentials is the most likely CredentialTyp... | Given {@link com.google.cloud.bigtable.config.CredentialOptions} that define how to look up credentials, do the following:
<ol>
<li> Look up the credentials
<li> If there are credentials, create a gRPC interceptor that gets OAuth2 security tokens
and add that token as a header on all calls.
<br>NOTE: {@link com.google... | [
"Given",
"{",
"@link",
"com",
".",
"google",
".",
"cloud",
".",
"bigtable",
".",
"config",
".",
"CredentialOptions",
"}",
"that",
"define",
"how",
"to",
"look",
"up",
"credentials",
"do",
"the",
"following",
":"
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/io/CredentialInterceptorCache.java#L87-L137 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java | DestinationManager.createTemporaryDestination | protected SIDestinationAddress createTemporaryDestination(Distribution distribution, String destinationPrefix) throws SIResourceException, SIMPDestinationAlreadyExistsException {
"""
The Temporary Destination Name that is created is of the form
_T<User prefix>_<MEId>_<TempDestId> for Topicspace Destinations
or
... | java | protected SIDestinationAddress createTemporaryDestination(Distribution distribution, String destinationPrefix) throws SIResourceException, SIMPDestinationAlreadyExistsException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createTemporaryDestination", new Ob... | [
"protected",
"SIDestinationAddress",
"createTemporaryDestination",
"(",
"Distribution",
"distribution",
",",
"String",
"destinationPrefix",
")",
"throws",
"SIResourceException",
",",
"SIMPDestinationAlreadyExistsException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEn... | The Temporary Destination Name that is created is of the form
_T<User prefix>_<MEId>_<TempDestId> for Topicspace Destinations
or
_Q<User prefix>_<MEId>_<TempDestId> for Queue Destinations
Where the User prefix is limited to 12 characters (others are ignored)
The MEId is the ME Uuid which will is a SIBUuid8
The TempDes... | [
"The",
"Temporary",
"Destination",
"Name",
"that",
"is",
"created",
"is",
"of",
"the",
"form",
"_T<User",
"prefix",
">",
"_<MEId",
">",
"_<TempDestId",
">",
"for",
"Topicspace",
"Destinations",
"or",
"_Q<User",
"prefix",
">",
"_<MEId",
">",
"_<TempDestId",
">"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java#L1976-L2042 |
salesforce/Argus | ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/NamespaceService.java | NamespaceService.updateNamespaceMembers | public Namespace updateNamespaceMembers(BigInteger id, Set<String> users) throws IOException, TokenExpiredException {
"""
Updates a the members of a namespace.
@param id The ID of the namespace to update.
@param users The updated members of the namespace.
@return The updated namespace.
@throws ... | java | public Namespace updateNamespaceMembers(BigInteger id, Set<String> users) throws IOException, TokenExpiredException {
String requestUrl = RESOURCE + "/" + id.toString() + "/users";
ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.PUT, requestUrl, users);
asser... | [
"public",
"Namespace",
"updateNamespaceMembers",
"(",
"BigInteger",
"id",
",",
"Set",
"<",
"String",
">",
"users",
")",
"throws",
"IOException",
",",
"TokenExpiredException",
"{",
"String",
"requestUrl",
"=",
"RESOURCE",
"+",
"\"/\"",
"+",
"id",
".",
"toString",... | Updates a the members of a namespace.
@param id The ID of the namespace to update.
@param users The updated members of the namespace.
@return The updated namespace.
@throws IOException If the server cannot be reached.
@throws TokenExpiredException If the token sent along with the request has expired | [
"Updates",
"a",
"the",
"members",
"of",
"a",
"namespace",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/NamespaceService.java#L132-L138 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsInner.java | ManagedInstanceEncryptionProtectorsInner.createOrUpdateAsync | public Observable<ManagedInstanceEncryptionProtectorInner> createOrUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceEncryptionProtectorInner parameters) {
"""
Updates an existing encryption protector.
@param resourceGroupName The name of the resource group that contains the resou... | java | public Observable<ManagedInstanceEncryptionProtectorInner> createOrUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceEncryptionProtectorInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).map(new Func1<ServiceRespon... | [
"public",
"Observable",
"<",
"ManagedInstanceEncryptionProtectorInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"ManagedInstanceEncryptionProtectorInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServi... | Updates an existing encryption protector.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param managedInstanceName The name of the managed instance.
@param parameters The requested encryption protector re... | [
"Updates",
"an",
"existing",
"encryption",
"protector",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedInstanceEncryptionProtectorsInner.java#L333-L340 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java | State.getPropAsInt | public int getPropAsInt(String key, int def) {
"""
Get the value of a property as an integer, using the given default value if the property is not set.
@param key property key
@param def default value
@return integer value associated with the key or the default value if the property is not set
"""
ret... | java | public int getPropAsInt(String key, int def) {
return Integer.parseInt(getProp(key, String.valueOf(def)));
} | [
"public",
"int",
"getPropAsInt",
"(",
"String",
"key",
",",
"int",
"def",
")",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"getProp",
"(",
"key",
",",
"String",
".",
"valueOf",
"(",
"def",
")",
")",
")",
";",
"}"
] | Get the value of a property as an integer, using the given default value if the property is not set.
@param key property key
@param def default value
@return integer value associated with the key or the default value if the property is not set | [
"Get",
"the",
"value",
"of",
"a",
"property",
"as",
"an",
"integer",
"using",
"the",
"given",
"default",
"value",
"if",
"the",
"property",
"is",
"not",
"set",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L384-L386 |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobWorkspaceRestore.java | JobWorkspaceRestore.removeWorkspace | protected void removeWorkspace(ManageableRepository mr, String workspaceName) throws RepositoryException {
"""
Remove workspace.
@param mr
ManageableRepository, the manageable repository
@param workspaceName
String, the workspace name
@throws RepositoryException
will be generated the RepositoryException
... | java | protected void removeWorkspace(ManageableRepository mr, String workspaceName) throws RepositoryException
{
boolean isExists = false;
for (String wsName : mr.getWorkspaceNames())
if (workspaceName.equals(wsName))
{
isExists = true;
break;
}
if (is... | [
"protected",
"void",
"removeWorkspace",
"(",
"ManageableRepository",
"mr",
",",
"String",
"workspaceName",
")",
"throws",
"RepositoryException",
"{",
"boolean",
"isExists",
"=",
"false",
";",
"for",
"(",
"String",
"wsName",
":",
"mr",
".",
"getWorkspaceNames",
"("... | Remove workspace.
@param mr
ManageableRepository, the manageable repository
@param workspaceName
String, the workspace name
@throws RepositoryException
will be generated the RepositoryException | [
"Remove",
"workspace",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobWorkspaceRestore.java#L248-L270 |
elki-project/elki | elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/SharedNearestNeighborSimilarityFunction.java | SharedNearestNeighborSimilarityFunction.countSharedNeighbors | static protected int countSharedNeighbors(DBIDs neighbors1, DBIDs neighbors2) {
"""
Compute the intersection size
@param neighbors1 SORTED neighbors of first
@param neighbors2 SORTED neighbors of second
@return Intersection size
"""
int intersection = 0;
DBIDIter iter1 = neighbors1.iter();
DBI... | java | static protected int countSharedNeighbors(DBIDs neighbors1, DBIDs neighbors2) {
int intersection = 0;
DBIDIter iter1 = neighbors1.iter();
DBIDIter iter2 = neighbors2.iter();
while(iter1.valid() && iter2.valid()) {
final int comp = DBIDUtil.compare(iter1, iter2);
if(comp == 0) {
inter... | [
"static",
"protected",
"int",
"countSharedNeighbors",
"(",
"DBIDs",
"neighbors1",
",",
"DBIDs",
"neighbors2",
")",
"{",
"int",
"intersection",
"=",
"0",
";",
"DBIDIter",
"iter1",
"=",
"neighbors1",
".",
"iter",
"(",
")",
";",
"DBIDIter",
"iter2",
"=",
"neigh... | Compute the intersection size
@param neighbors1 SORTED neighbors of first
@param neighbors2 SORTED neighbors of second
@return Intersection size | [
"Compute",
"the",
"intersection",
"size"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/SharedNearestNeighborSimilarityFunction.java#L61-L81 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/StringUtils.java | StringUtils.toUpcaseString | public static String toUpcaseString(final int aInt) {
"""
Returns an up-cased human-friendly string representation for the supplied int; for instance, "1" becomes
"First", "2" becomes "Second", etc.
@param aInt An int to convert into a string
@return The string form of the supplied int
"""
switch ... | java | public static String toUpcaseString(final int aInt) {
switch (aInt) {
case 1:
return "First";
case 2:
return "Second";
case 3:
return "Third";
case 4:
return "Fourth";
case 5:
... | [
"public",
"static",
"String",
"toUpcaseString",
"(",
"final",
"int",
"aInt",
")",
"{",
"switch",
"(",
"aInt",
")",
"{",
"case",
"1",
":",
"return",
"\"First\"",
";",
"case",
"2",
":",
"return",
"\"Second\"",
";",
"case",
"3",
":",
"return",
"\"Third\"",
... | Returns an up-cased human-friendly string representation for the supplied int; for instance, "1" becomes
"First", "2" becomes "Second", etc.
@param aInt An int to convert into a string
@return The string form of the supplied int | [
"Returns",
"an",
"up",
"-",
"cased",
"human",
"-",
"friendly",
"string",
"representation",
"for",
"the",
"supplied",
"int",
";",
"for",
"instance",
"1",
"becomes",
"First",
"2",
"becomes",
"Second",
"etc",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/StringUtils.java#L567-L612 |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/ShapePath.java | ShapePath.lineTo | public void lineTo(float x, float y) {
"""
Add a line to the ShapePath.
@param x the x to which the line should be drawn.
@param y the y to which the line should be drawn.
"""
PathLineOperation operation = new PathLineOperation();
operation.x = x;
operation.y = y;
operations... | java | public void lineTo(float x, float y) {
PathLineOperation operation = new PathLineOperation();
operation.x = x;
operation.y = y;
operations.add(operation);
LineShadowOperation shadowOperation = new LineShadowOperation(operation, endX, endY);
// The previous endX and endY... | [
"public",
"void",
"lineTo",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"PathLineOperation",
"operation",
"=",
"new",
"PathLineOperation",
"(",
")",
";",
"operation",
".",
"x",
"=",
"x",
";",
"operation",
".",
"y",
"=",
"y",
";",
"operations",
".",... | Add a line to the ShapePath.
@param x the x to which the line should be drawn.
@param y the y to which the line should be drawn. | [
"Add",
"a",
"line",
"to",
"the",
"ShapePath",
"."
] | train | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/ShapePath.java#L79-L95 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java | BaseProfile.generateMultiAdminObjectClassCode | void generateMultiAdminObjectClassCode(Definition def, String className, int num) {
"""
generate multi admin object class code
@param def Definition
@param className class name
@param num number of order
"""
if (className == null || className.equals(""))
return;
try
... | java | void generateMultiAdminObjectClassCode(Definition def, String className, int num)
{
if (className == null || className.equals(""))
return;
try
{
String clazzName = this.getClass().getPackage().getName() + ".code." + className + "CodeGen";
Class<?> clazz = Class.forName(... | [
"void",
"generateMultiAdminObjectClassCode",
"(",
"Definition",
"def",
",",
"String",
"className",
",",
"int",
"num",
")",
"{",
"if",
"(",
"className",
"==",
"null",
"||",
"className",
".",
"equals",
"(",
"\"\"",
")",
")",
"return",
";",
"try",
"{",
"Strin... | generate multi admin object class code
@param def Definition
@param className class name
@param num number of order | [
"generate",
"multi",
"admin",
"object",
"class",
"code"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java#L295-L329 |
fuinorg/objects4j | src/main/java/org/fuin/objects4j/vo/LocaleConverter.java | LocaleConverter.asLocale | public static Locale asLocale(final String value) {
"""
Returns the given string as locale. The locale is NOT checked against the Java list of avilable locales.
@param value
Value to convert into a locale.
@return Locale.
"""
final Locale locale;
final int p = value.indexOf("__");
... | java | public static Locale asLocale(final String value) {
final Locale locale;
final int p = value.indexOf("__");
if (p > -1) {
locale = new Locale(value.substring(0, p), null, value.substring(p + 2));
} else {
final StringTokenizer tok = new StringTokenizer(value... | [
"public",
"static",
"Locale",
"asLocale",
"(",
"final",
"String",
"value",
")",
"{",
"final",
"Locale",
"locale",
";",
"final",
"int",
"p",
"=",
"value",
".",
"indexOf",
"(",
"\"__\"",
")",
";",
"if",
"(",
"p",
">",
"-",
"1",
")",
"{",
"locale",
"=... | Returns the given string as locale. The locale is NOT checked against the Java list of avilable locales.
@param value
Value to convert into a locale.
@return Locale. | [
"Returns",
"the",
"given",
"string",
"as",
"locale",
".",
"The",
"locale",
"is",
"NOT",
"checked",
"against",
"the",
"Java",
"list",
"of",
"avilable",
"locales",
"."
] | train | https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/vo/LocaleConverter.java#L67-L85 |
ihaolin/session | session-api/src/main/java/me/hao0/session/core/HttpServletRequest2.java | HttpServletRequest2.buildSession | private HttpSession2 buildSession(String id, boolean refresh) {
"""
build a new session from session id
@param id session id
@param refresh refresh cookie or not
@return session
"""
HttpSession2 session = new HttpSession2(id, sessionManager, request.getServletContext());
session.setMaxInact... | java | private HttpSession2 buildSession(String id, boolean refresh) {
HttpSession2 session = new HttpSession2(id, sessionManager, request.getServletContext());
session.setMaxInactiveInterval(maxInactiveInterval);
if (refresh) {
WebUtil.addCookie(this, response, getSessionCookieName(), id,
... | [
"private",
"HttpSession2",
"buildSession",
"(",
"String",
"id",
",",
"boolean",
"refresh",
")",
"{",
"HttpSession2",
"session",
"=",
"new",
"HttpSession2",
"(",
"id",
",",
"sessionManager",
",",
"request",
".",
"getServletContext",
"(",
")",
")",
";",
"session... | build a new session from session id
@param id session id
@param refresh refresh cookie or not
@return session | [
"build",
"a",
"new",
"session",
"from",
"session",
"id"
] | train | https://github.com/ihaolin/session/blob/322c3a9f47b305a39345135fa8163dd7e065b4f8/session-api/src/main/java/me/hao0/session/core/HttpServletRequest2.java#L155-L163 |
apereo/cas | support/cas-server-support-gauth-couchdb/src/main/java/org/apereo/cas/couchdb/gauth/token/GoogleAuthenticatorTokenCouchDbRepository.java | GoogleAuthenticatorTokenCouchDbRepository.findByUserId | @View(name = "by_userId", map = "function(doc) {
"""
Find tokens by user id.
@param userId user id to search for
@return tokens belonging to use id
""" if(doc.token && doc.userId) { emit(doc.userId, doc) } }")
public List<CouchDbGoogleAuthenticatorToken> findByUserId(final String userId) {
retu... | java | @View(name = "by_userId", map = "function(doc) { if(doc.token && doc.userId) { emit(doc.userId, doc) } }")
public List<CouchDbGoogleAuthenticatorToken> findByUserId(final String userId) {
return queryView("by_userId", userId);
} | [
"@",
"View",
"(",
"name",
"=",
"\"by_userId\"",
",",
"map",
"=",
"\"function(doc) { if(doc.token && doc.userId) { emit(doc.userId, doc) } }\"",
")",
"public",
"List",
"<",
"CouchDbGoogleAuthenticatorToken",
">",
"findByUserId",
"(",
"final",
"String",
"userId",
")",
"{",
... | Find tokens by user id.
@param userId user id to search for
@return tokens belonging to use id | [
"Find",
"tokens",
"by",
"user",
"id",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-gauth-couchdb/src/main/java/org/apereo/cas/couchdb/gauth/token/GoogleAuthenticatorTokenCouchDbRepository.java#L57-L60 |
kiegroup/drools | kie-pmml/src/main/java/org/kie/pmml/assembler/PMMLAssemblerService.java | PMMLAssemblerService.getPackageDescrs | private List<PackageDescr> getPackageDescrs(Resource resource) throws DroolsParserException, IOException {
"""
This method calls the PMML compiler to get PMMLResource objects which are used to
create one or more PackageDescr objects
@param resource
@return
@throws DroolsParserException
@throws IOException
... | java | private List<PackageDescr> getPackageDescrs(Resource resource) throws DroolsParserException, IOException {
List<PMMLResource> resources = pmmlCompiler.precompile(resource.getInputStream(), null, null);
if (resources != null && !resources.isEmpty()) {
return generatedResourcesToPackageDescr(r... | [
"private",
"List",
"<",
"PackageDescr",
">",
"getPackageDescrs",
"(",
"Resource",
"resource",
")",
"throws",
"DroolsParserException",
",",
"IOException",
"{",
"List",
"<",
"PMMLResource",
">",
"resources",
"=",
"pmmlCompiler",
".",
"precompile",
"(",
"resource",
"... | This method calls the PMML compiler to get PMMLResource objects which are used to
create one or more PackageDescr objects
@param resource
@return
@throws DroolsParserException
@throws IOException | [
"This",
"method",
"calls",
"the",
"PMML",
"compiler",
"to",
"get",
"PMMLResource",
"objects",
"which",
"are",
"used",
"to",
"create",
"one",
"or",
"more",
"PackageDescr",
"objects"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-pmml/src/main/java/org/kie/pmml/assembler/PMMLAssemblerService.java#L124-L130 |
alkacon/opencms-core | src-setup/org/opencms/setup/CmsSetupBean.java | CmsSetupBean.checkFilesExists | private boolean checkFilesExists(String[] requiredFiles, File childResource) {
"""
Checks if the necessary files for the configuration are existent or not.<p>
@param requiredFiles the required files
@param childResource the folder to check
@return true if the files are existent
"""
File setupFi... | java | private boolean checkFilesExists(String[] requiredFiles, File childResource) {
File setupFile = null;
boolean hasMissingSetupFiles = false;
for (int j = 0; j < requiredFiles.length; j++) {
setupFile = new File(childResource.getPath() + File.separatorChar + requiredFiles[j]);
... | [
"private",
"boolean",
"checkFilesExists",
"(",
"String",
"[",
"]",
"requiredFiles",
",",
"File",
"childResource",
")",
"{",
"File",
"setupFile",
"=",
"null",
";",
"boolean",
"hasMissingSetupFiles",
"=",
"false",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
... | Checks if the necessary files for the configuration are existent or not.<p>
@param requiredFiles the required files
@param childResource the folder to check
@return true if the files are existent | [
"Checks",
"if",
"the",
"necessary",
"files",
"for",
"the",
"configuration",
"are",
"existent",
"or",
"not",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/CmsSetupBean.java#L2768-L2788 |
DDTH/ddth-kafka | src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java | KafkaMsgConsumer._checkAndSubscribe | private void _checkAndSubscribe(KafkaConsumer<?, ?> consumer, String topic) {
"""
Subscribes to a topic.
@param consumer
@param topic
@since 1.3.2
"""
synchronized (consumer) {
Set<String> subscription = consumer.subscription();
if (subscription == null || !subscription.con... | java | private void _checkAndSubscribe(KafkaConsumer<?, ?> consumer, String topic) {
synchronized (consumer) {
Set<String> subscription = consumer.subscription();
if (subscription == null || !subscription.contains(topic)) {
consumer.subscribe(Arrays.asList(topic));
}... | [
"private",
"void",
"_checkAndSubscribe",
"(",
"KafkaConsumer",
"<",
"?",
",",
"?",
">",
"consumer",
",",
"String",
"topic",
")",
"{",
"synchronized",
"(",
"consumer",
")",
"{",
"Set",
"<",
"String",
">",
"subscription",
"=",
"consumer",
".",
"subscription",
... | Subscribes to a topic.
@param consumer
@param topic
@since 1.3.2 | [
"Subscribes",
"to",
"a",
"topic",
"."
] | train | https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java#L422-L429 |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/Cached.java | Cached.startCleansing | public static void startCleansing(AuthzEnv env, CachedDAO<?,?,?> ... dao) {
"""
Each Cached object has multiple Segments that need cleaning. Derive each, and add to Cleansing Thread
@param env
@param dao
"""
for(CachedDAO<?,?,?> d : dao) {
for(int i=0;i<d.segSize;++i) {
startCleansing(env, d.tabl... | java | public static void startCleansing(AuthzEnv env, CachedDAO<?,?,?> ... dao) {
for(CachedDAO<?,?,?> d : dao) {
for(int i=0;i<d.segSize;++i) {
startCleansing(env, d.table()+i);
}
}
} | [
"public",
"static",
"void",
"startCleansing",
"(",
"AuthzEnv",
"env",
",",
"CachedDAO",
"<",
"?",
",",
"?",
",",
"?",
">",
"...",
"dao",
")",
"{",
"for",
"(",
"CachedDAO",
"<",
"?",
",",
"?",
",",
"?",
">",
"d",
":",
"dao",
")",
"{",
"for",
"("... | Each Cached object has multiple Segments that need cleaning. Derive each, and add to Cleansing Thread
@param env
@param dao | [
"Each",
"Cached",
"object",
"has",
"multiple",
"Segments",
"that",
"need",
"cleaning",
".",
"Derive",
"each",
"and",
"add",
"to",
"Cleansing",
"Thread"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/Cached.java#L119-L125 |
meltmedia/cadmium | email/src/main/java/com/meltmedia/cadmium/email/EmailUtil.java | EmailUtil.newAttachmentBodyPart | public static MimeBodyPart newAttachmentBodyPart( String content, String contentId, String mimeType, String fileName)
throws MessagingException, IOException {
"""
Creates a body part for an attachment that is downloaded by the user.
@throws IOException
"""
MimeBodyPart mimeBodyPart = new MimeBodyPart(... | java | public static MimeBodyPart newAttachmentBodyPart( String content, String contentId, String mimeType, String fileName)
throws MessagingException, IOException
{
MimeBodyPart mimeBodyPart = new MimeBodyPart();
// log.debug("Creating an attachment for content '{}', mimeType '{}', fileName '{}'.", new Object[] ... | [
"public",
"static",
"MimeBodyPart",
"newAttachmentBodyPart",
"(",
"String",
"content",
",",
"String",
"contentId",
",",
"String",
"mimeType",
",",
"String",
"fileName",
")",
"throws",
"MessagingException",
",",
"IOException",
"{",
"MimeBodyPart",
"mimeBodyPart",
"=",
... | Creates a body part for an attachment that is downloaded by the user.
@throws IOException | [
"Creates",
"a",
"body",
"part",
"for",
"an",
"attachment",
"that",
"is",
"downloaded",
"by",
"the",
"user",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/email/src/main/java/com/meltmedia/cadmium/email/EmailUtil.java#L136-L150 |
infinispan/infinispan | client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java | RemoteCacheManager.initRemoteCache | private void initRemoteCache(RemoteCacheImpl remoteCache, OperationsFactory operationsFactory) {
"""
Method that handles cache initialization - needed as a placeholder
"""
if (configuration.statistics().jmxEnabled()) {
remoteCache.init(marshaller, operationsFactory, configuration.keySizeEstimate... | java | private void initRemoteCache(RemoteCacheImpl remoteCache, OperationsFactory operationsFactory) {
if (configuration.statistics().jmxEnabled()) {
remoteCache.init(marshaller, operationsFactory, configuration.keySizeEstimate(),
configuration.valueSizeEstimate(), configuration.batchSize(), mbe... | [
"private",
"void",
"initRemoteCache",
"(",
"RemoteCacheImpl",
"remoteCache",
",",
"OperationsFactory",
"operationsFactory",
")",
"{",
"if",
"(",
"configuration",
".",
"statistics",
"(",
")",
".",
"jmxEnabled",
"(",
")",
")",
"{",
"remoteCache",
".",
"init",
"(",... | Method that handles cache initialization - needed as a placeholder | [
"Method",
"that",
"handles",
"cache",
"initialization",
"-",
"needed",
"as",
"a",
"placeholder"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java#L465-L473 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java | DateRangeParam.setLowerBoundInclusive | public DateRangeParam setLowerBoundInclusive(Date theLowerBound) {
"""
Sets the lower bound to be greaterthan or equal to the given date
"""
validateAndSet(new DateParam(ParamPrefixEnum.GREATERTHAN_OR_EQUALS, theLowerBound), myUpperBound);
return this;
} | java | public DateRangeParam setLowerBoundInclusive(Date theLowerBound) {
validateAndSet(new DateParam(ParamPrefixEnum.GREATERTHAN_OR_EQUALS, theLowerBound), myUpperBound);
return this;
} | [
"public",
"DateRangeParam",
"setLowerBoundInclusive",
"(",
"Date",
"theLowerBound",
")",
"{",
"validateAndSet",
"(",
"new",
"DateParam",
"(",
"ParamPrefixEnum",
".",
"GREATERTHAN_OR_EQUALS",
",",
"theLowerBound",
")",
",",
"myUpperBound",
")",
";",
"return",
"this",
... | Sets the lower bound to be greaterthan or equal to the given date | [
"Sets",
"the",
"lower",
"bound",
"to",
"be",
"greaterthan",
"or",
"equal",
"to",
"the",
"given",
"date"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java#L227-L230 |
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/report/XReportBreakScreen.java | XReportBreakScreen.printControlStartForm | public void printControlStartForm(PrintWriter out, int iPrintOptions) {
"""
Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes.
"""
//? Record record = ((ReportBreakScreen)this.getScreenField()).getMainRecord();
//? S... | java | public void printControlStartForm(PrintWriter out, int iPrintOptions)
{
//? Record record = ((ReportBreakScreen)this.getScreenField()).getMainRecord();
//? String strFile = record.getTableNames(false);
if ((iPrintOptions & HtmlConstants.FOOTING_SCREEN) == HtmlConstants.FOOTING_SC... | [
"public",
"void",
"printControlStartForm",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"//? Record record = ((ReportBreakScreen)this.getScreenField()).getMainRecord();",
"//? String strFile = record.getTableNames(false);",
"if",
"(",
"(",
"iPrintOp... | Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes. | [
"Display",
"the",
"start",
"form",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/report/XReportBreakScreen.java#L64-L73 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/DBUpdate.java | DBUpdate.pullAll | public static Builder pullAll(String field, List<?> values) {
"""
Remove all occurances of the values from the array at field
@param field The field to remove the values from
@param values The values to remove
@return this object
"""
return new Builder().pullAll(field, values);
} | java | public static Builder pullAll(String field, List<?> values) {
return new Builder().pullAll(field, values);
} | [
"public",
"static",
"Builder",
"pullAll",
"(",
"String",
"field",
",",
"List",
"<",
"?",
">",
"values",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"pullAll",
"(",
"field",
",",
"values",
")",
";",
"}"
] | Remove all occurances of the values from the array at field
@param field The field to remove the values from
@param values The values to remove
@return this object | [
"Remove",
"all",
"occurances",
"of",
"the",
"values",
"from",
"the",
"array",
"at",
"field"
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/DBUpdate.java#L198-L200 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuFuncSetBlockShape | @Deprecated
public static int cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) {
"""
Sets the block-dimensions for the function.
<pre>
CUresult cuFuncSetBlockShape (
CUfunction hfunc,
int x,
int y,
int z )
</pre>
<div>
<p>Sets the block-dimensions for the
function.
Deprecated Specifi... | java | @Deprecated
public static int cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z)
{
return checkResult(cuFuncSetBlockShapeNative(hfunc, x, y, z));
} | [
"@",
"Deprecated",
"public",
"static",
"int",
"cuFuncSetBlockShape",
"(",
"CUfunction",
"hfunc",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"z",
")",
"{",
"return",
"checkResult",
"(",
"cuFuncSetBlockShapeNative",
"(",
"hfunc",
",",
"x",
",",
"y",
",",
... | Sets the block-dimensions for the function.
<pre>
CUresult cuFuncSetBlockShape (
CUfunction hfunc,
int x,
int y,
int z )
</pre>
<div>
<p>Sets the block-dimensions for the
function.
Deprecated Specifies the <tt>x</tt>, <tt>y</tt>, and <tt>z</tt> dimensions of the thread blocks that are
created when the kernel given ... | [
"Sets",
"the",
"block",
"-",
"dimensions",
"for",
"the",
"function",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L8218-L8222 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java | ExtraLanguagePreferenceAccess.hasProjectSpecificOptions | public boolean hasProjectSpecificOptions(String preferenceContainerID, IProject project) {
"""
Replies if the project has specific configuration for extra language generation provided by the given container.
<p>This code is copied from {@link AbstractGeneratorConfigurationBlock} and its super types.
@param p... | java | public boolean hasProjectSpecificOptions(String preferenceContainerID, IProject project) {
final IPreferenceStore store = getWritablePreferenceStore(project);
// Compute the key
String key = IS_PROJECT_SPECIFIC;
if (preferenceContainerID != null) {
key = getPropertyPrefix(preferenceContainerID) + "." + IS_PR... | [
"public",
"boolean",
"hasProjectSpecificOptions",
"(",
"String",
"preferenceContainerID",
",",
"IProject",
"project",
")",
"{",
"final",
"IPreferenceStore",
"store",
"=",
"getWritablePreferenceStore",
"(",
"project",
")",
";",
"// Compute the key",
"String",
"key",
"=",... | Replies if the project has specific configuration for extra language generation provided by the given container.
<p>This code is copied from {@link AbstractGeneratorConfigurationBlock} and its super types.
@param preferenceContainerID the identifier of the generator's preference container.
@param project the context.... | [
"Replies",
"if",
"the",
"project",
"has",
"specific",
"configuration",
"for",
"extra",
"language",
"generation",
"provided",
"by",
"the",
"given",
"container",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java#L221-L236 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java | ValueFileIOHelper.writeByteArrayValue | protected long writeByteArrayValue(File file, ValueData value) throws IOException {
"""
Write value array of bytes to a file.
@param file
File
@param value
ValueData
@return size of wrote content
@throws IOException
if error occurs
"""
OutputStream out = new FileOutputStream(file);
try
... | java | protected long writeByteArrayValue(File file, ValueData value) throws IOException
{
OutputStream out = new FileOutputStream(file);
try
{
byte[] data = value.getAsByteArray();
out.write(data);
return data.length;
}
finally
{
out.clos... | [
"protected",
"long",
"writeByteArrayValue",
"(",
"File",
"file",
",",
"ValueData",
"value",
")",
"throws",
"IOException",
"{",
"OutputStream",
"out",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
";",
"try",
"{",
"byte",
"[",
"]",
"data",
"=",
"value",
... | Write value array of bytes to a file.
@param file
File
@param value
ValueData
@return size of wrote content
@throws IOException
if error occurs | [
"Write",
"value",
"array",
"of",
"bytes",
"to",
"a",
"file",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java#L94-L108 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsEditorDisplayOptions.java | CmsEditorDisplayOptions.getOptionValue | public String getOptionValue(String key, String defaultValue, Properties displayOptions) {
"""
Returns the value for the given key from the display options.<p>
@param key he element key name which should be read
@param defaultValue the default value to use in case the property is not found
@param displayOptio... | java | public String getOptionValue(String key, String defaultValue, Properties displayOptions) {
if (displayOptions == null) {
return defaultValue;
}
return displayOptions.getProperty(key, defaultValue);
} | [
"public",
"String",
"getOptionValue",
"(",
"String",
"key",
",",
"String",
"defaultValue",
",",
"Properties",
"displayOptions",
")",
"{",
"if",
"(",
"displayOptions",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return",
"displayOptions",
".",
... | Returns the value for the given key from the display options.<p>
@param key he element key name which should be read
@param defaultValue the default value to use in case the property is not found
@param displayOptions the display options for the current user
@return the value for the given key from the display option... | [
"Returns",
"the",
"value",
"for",
"the",
"given",
"key",
"from",
"the",
"display",
"options",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsEditorDisplayOptions.java#L223-L229 |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java | StringUtils.ifNotEmptyPrepend | public static String ifNotEmptyPrepend(String chekString, String value) {
"""
<p>
If <code>checkString</code> has text, returns checkString+value string. Otherwise
empty string was returned
</p>
@param chekString the chek string
@param value the value
@return the string
"""
if (hasText(chekString)) {... | java | public static String ifNotEmptyPrepend(String chekString, String value) {
if (hasText(chekString)) {
return chekString+value;
} else {
return "";
}
} | [
"public",
"static",
"String",
"ifNotEmptyPrepend",
"(",
"String",
"chekString",
",",
"String",
"value",
")",
"{",
"if",
"(",
"hasText",
"(",
"chekString",
")",
")",
"{",
"return",
"chekString",
"+",
"value",
";",
"}",
"else",
"{",
"return",
"\"\"",
";",
... | <p>
If <code>checkString</code> has text, returns checkString+value string. Otherwise
empty string was returned
</p>
@param chekString the chek string
@param value the value
@return the string | [
"<p",
">",
"If",
"<code",
">",
"checkString<",
"/",
"code",
">",
"has",
"text",
"returns",
"checkString",
"+",
"value",
"string",
".",
"Otherwise",
"empty",
"string",
"was",
"returned",
"<",
"/",
"p",
">"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L267-L273 |
jenkinsci/pipeline-maven-plugin | jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java | WithMavenStepExecution2.globalSettingsFromConfig | private void globalSettingsFromConfig(String mavenGlobalSettingsConfigId, FilePath mavenGlobalSettingsFile, Collection<Credentials> credentials) throws AbortException {
"""
Reads the global config file from Config File Provider, expands the credentials and stores it in a file on the temp
folder to use it with the... | java | private void globalSettingsFromConfig(String mavenGlobalSettingsConfigId, FilePath mavenGlobalSettingsFile, Collection<Credentials> credentials) throws AbortException {
Config c = ConfigFiles.getByIdOrNull(build, mavenGlobalSettingsConfigId);
if (c == null) {
throw new AbortException("C... | [
"private",
"void",
"globalSettingsFromConfig",
"(",
"String",
"mavenGlobalSettingsConfigId",
",",
"FilePath",
"mavenGlobalSettingsFile",
",",
"Collection",
"<",
"Credentials",
">",
"credentials",
")",
"throws",
"AbortException",
"{",
"Config",
"c",
"=",
"ConfigFiles",
"... | Reads the global config file from Config File Provider, expands the credentials and stores it in a file on the temp
folder to use it with the maven wrapper script
@param mavenGlobalSettingsConfigId global config file id from Config File Provider
@param mavenGlobalSettingsFile path to write te content to
@param cre... | [
"Reads",
"the",
"global",
"config",
"file",
"from",
"Config",
"File",
"Provider",
"expands",
"the",
"credentials",
"and",
"stores",
"it",
"in",
"a",
"file",
"on",
"the",
"temp",
"folder",
"to",
"use",
"it",
"with",
"the",
"maven",
"wrapper",
"script"
] | train | https://github.com/jenkinsci/pipeline-maven-plugin/blob/685d7dbb894fb4c976dbfa922e3caba8e8d5bed8/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java#L972-L1015 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/comparison/CmpUtil.java | CmpUtil.canonicalCompare | public static <U> int canonicalCompare(List<? extends U> o1,
List<? extends U> o2,
Comparator<? super U> elemComparator) {
"""
Compares two {@link List}s with respect to canonical ordering.
<p>
In canonical ordering, a sequence... | java | public static <U> int canonicalCompare(List<? extends U> o1,
List<? extends U> o2,
Comparator<? super U> elemComparator) {
int siz1 = o1.size(), siz2 = o2.size();
if (siz1 != siz2) {
return siz1 - siz2;
... | [
"public",
"static",
"<",
"U",
">",
"int",
"canonicalCompare",
"(",
"List",
"<",
"?",
"extends",
"U",
">",
"o1",
",",
"List",
"<",
"?",
"extends",
"U",
">",
"o2",
",",
"Comparator",
"<",
"?",
"super",
"U",
">",
"elemComparator",
")",
"{",
"int",
"si... | Compares two {@link List}s with respect to canonical ordering.
<p>
In canonical ordering, a sequence {@code o1} is less than a sequence {@code o2} if {@code o1} is shorter than
{@code o2}, or if they have the same length and {@code o1} is lexicographically smaller than {@code o2}.
@param o1
the first list
@param o2
th... | [
"Compares",
"two",
"{",
"@link",
"List",
"}",
"s",
"with",
"respect",
"to",
"canonical",
"ordering",
".",
"<p",
">",
"In",
"canonical",
"ordering",
"a",
"sequence",
"{",
"@code",
"o1",
"}",
"is",
"less",
"than",
"a",
"sequence",
"{",
"@code",
"o2",
"}"... | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/comparison/CmpUtil.java#L47-L57 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java | GVRFrustumPicker.setFrustum | public void setFrustum(float fovy, float aspect, float znear, float zfar) {
"""
Set the view frustum to pick against from the field of view, aspect
ratio and near, far clip planes. The viewpoint of the frustum
is the center of the scene object the picker is attached to.
The view direction is the forward directi... | java | public void setFrustum(float fovy, float aspect, float znear, float zfar)
{
Matrix4f projMatrix = new Matrix4f();
projMatrix.perspective((float) Math.toRadians(fovy), aspect, znear, zfar);
setFrustum(projMatrix);
} | [
"public",
"void",
"setFrustum",
"(",
"float",
"fovy",
",",
"float",
"aspect",
",",
"float",
"znear",
",",
"float",
"zfar",
")",
"{",
"Matrix4f",
"projMatrix",
"=",
"new",
"Matrix4f",
"(",
")",
";",
"projMatrix",
".",
"perspective",
"(",
"(",
"float",
")"... | Set the view frustum to pick against from the field of view, aspect
ratio and near, far clip planes. The viewpoint of the frustum
is the center of the scene object the picker is attached to.
The view direction is the forward direction of that scene object.
The frustum will pick what a camera attached to the scene objec... | [
"Set",
"the",
"view",
"frustum",
"to",
"pick",
"against",
"from",
"the",
"field",
"of",
"view",
"aspect",
"ratio",
"and",
"near",
"far",
"clip",
"planes",
".",
"The",
"viewpoint",
"of",
"the",
"frustum",
"is",
"the",
"center",
"of",
"the",
"scene",
"obje... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java#L112-L117 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationFileUtil.java | ValidationFileUtil.readFileToString | public static String readFileToString(File file, final Charset charset) throws IOException {
"""
Read file to string string.
@param file the file
@param charset the charset
@return the string
@throws IOException the io exception
"""
String line = null;
BufferedReader reader = getBuffer... | java | public static String readFileToString(File file, final Charset charset) throws IOException {
String line = null;
BufferedReader reader = getBufferReader(file, charset);
StringBuffer strBuffer = new StringBuffer();
while ((line = reader.readLine()) != null) {
strBuffer.append... | [
"public",
"static",
"String",
"readFileToString",
"(",
"File",
"file",
",",
"final",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"String",
"line",
"=",
"null",
";",
"BufferedReader",
"reader",
"=",
"getBufferReader",
"(",
"file",
",",
"charset",
"... | Read file to string string.
@param file the file
@param charset the charset
@return the string
@throws IOException the io exception | [
"Read",
"file",
"to",
"string",
"string",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationFileUtil.java#L37-L46 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java | SpiderService.shardedLinkTermRowKey | public static String shardedLinkTermRowKey(FieldDefinition linkDef, String objID, int shardNumber) {
"""
Return the row key for the Terms record that represents a link shard record for the
given link, owned by the given object ID, referencing target objects in the given
shard. The key format is:
<pre>
{shard n... | java | public static String shardedLinkTermRowKey(FieldDefinition linkDef, String objID, int shardNumber) {
assert linkDef.isLinkField() && linkDef.isSharded() && shardNumber > 0;
StringBuilder shardPrefix = new StringBuilder();
shardPrefix.append(shardNumber);
shardPrefix.append("/");
... | [
"public",
"static",
"String",
"shardedLinkTermRowKey",
"(",
"FieldDefinition",
"linkDef",
",",
"String",
"objID",
",",
"int",
"shardNumber",
")",
"{",
"assert",
"linkDef",
".",
"isLinkField",
"(",
")",
"&&",
"linkDef",
".",
"isSharded",
"(",
")",
"&&",
"shardN... | Return the row key for the Terms record that represents a link shard record for the
given link, owned by the given object ID, referencing target objects in the given
shard. The key format is:
<pre>
{shard number}/{link name}/{object ID}
</pre>
@param linkDef {@link FieldDefinition} of a sharded link.
@param objI... | [
"Return",
"the",
"row",
"key",
"for",
"the",
"Terms",
"record",
"that",
"represents",
"a",
"link",
"shard",
"record",
"for",
"the",
"given",
"link",
"owned",
"by",
"the",
"given",
"object",
"ID",
"referencing",
"target",
"objects",
"in",
"the",
"given",
"s... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java#L362-L369 |
Alluxio/alluxio | underfs/kodo/src/main/java/alluxio/underfs/kodo/KodoClient.java | KodoClient.uploadFile | public void uploadFile(String Key, File File) throws QiniuException {
"""
Puts Object to Qiniu kodo.
@param Key Object key for kodo
@param File Alluxio File
"""
com.qiniu.http.Response response =
mUploadManager.put(File, Key, mAuth.uploadToken(mBucketName, Key));
response.close();
} | java | public void uploadFile(String Key, File File) throws QiniuException {
com.qiniu.http.Response response =
mUploadManager.put(File, Key, mAuth.uploadToken(mBucketName, Key));
response.close();
} | [
"public",
"void",
"uploadFile",
"(",
"String",
"Key",
",",
"File",
"File",
")",
"throws",
"QiniuException",
"{",
"com",
".",
"qiniu",
".",
"http",
".",
"Response",
"response",
"=",
"mUploadManager",
".",
"put",
"(",
"File",
",",
"Key",
",",
"mAuth",
".",... | Puts Object to Qiniu kodo.
@param Key Object key for kodo
@param File Alluxio File | [
"Puts",
"Object",
"to",
"Qiniu",
"kodo",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/kodo/src/main/java/alluxio/underfs/kodo/KodoClient.java#L133-L137 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/data/CalendarParserImpl.java | CalendarParserImpl.nextToken | private int nextToken(StreamTokenizer tokeniser, Reader in, boolean ignoreEOF) throws IOException, ParserException {
"""
Reads the next token from the tokeniser.
This method throws a ParseException when reading EOF.
@param tokeniser
@param in
@param ignoreEOF
@return int value of the ttype field of the toke... | java | private int nextToken(StreamTokenizer tokeniser, Reader in, boolean ignoreEOF) throws IOException, ParserException {
int token = tokeniser.nextToken();
if (!ignoreEOF && token == StreamTokenizer.TT_EOF) {
throw new ParserException("Unexpected end of file", getLineNumber(tokeniser, in));
... | [
"private",
"int",
"nextToken",
"(",
"StreamTokenizer",
"tokeniser",
",",
"Reader",
"in",
",",
"boolean",
"ignoreEOF",
")",
"throws",
"IOException",
",",
"ParserException",
"{",
"int",
"token",
"=",
"tokeniser",
".",
"nextToken",
"(",
")",
";",
"if",
"(",
"!"... | Reads the next token from the tokeniser.
This method throws a ParseException when reading EOF.
@param tokeniser
@param in
@param ignoreEOF
@return int value of the ttype field of the tokeniser
@throws ParseException When reading EOF. | [
"Reads",
"the",
"next",
"token",
"from",
"the",
"tokeniser",
".",
"This",
"method",
"throws",
"a",
"ParseException",
"when",
"reading",
"EOF",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/data/CalendarParserImpl.java#L634-L640 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getMasteries | public Future<MasteryList> getMasteries(MasteryData data, String version, String locale) {
"""
<p>
Get a listing of all masteries
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param data Additional information to retrieve
@param version Data dragon version for ret... | java | public Future<MasteryList> getMasteries(MasteryData data, String version, String locale) {
return new DummyFuture<>(handler.getMasteries(data, version, locale));
} | [
"public",
"Future",
"<",
"MasteryList",
">",
"getMasteries",
"(",
"MasteryData",
"data",
",",
"String",
"version",
",",
"String",
"locale",
")",
"{",
"return",
"new",
"DummyFuture",
"<>",
"(",
"handler",
".",
"getMasteries",
"(",
"data",
",",
"version",
",",... | <p>
Get a listing of all masteries
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param data Additional information to retrieve
@param version Data dragon version for returned data
@param locale Locale code for returned data
@return The masteries
@see <a href=https://develop... | [
"<p",
">",
"Get",
"a",
"listing",
"of",
"all",
"masteries",
"<",
"/",
"p",
">",
"This",
"method",
"does",
"not",
"count",
"towards",
"the",
"rate",
"limit",
"and",
"is",
"not",
"affected",
"by",
"the",
"throttle"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L562-L564 |
caspervg/SC4D-LEX4J | lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java | UserRoute.postRegistration | public void postRegistration(String username, String password, String email, String fullname) {
"""
Registers a new user for the SC4D LEX
@param username the username for the new user
@param password the password for the new user
@param email the e-mail for the new user
@param fullname the name for the new u... | java | public void postRegistration(String username, String password, String email, String fullname) {
ClientResource resource = new ClientResource(Route.REGISTER.url());
Form form = new Form();
form.add("username", username);
form.add("password_1", password);
form.add("password_2", pa... | [
"public",
"void",
"postRegistration",
"(",
"String",
"username",
",",
"String",
"password",
",",
"String",
"email",
",",
"String",
"fullname",
")",
"{",
"ClientResource",
"resource",
"=",
"new",
"ClientResource",
"(",
"Route",
".",
"REGISTER",
".",
"url",
"(",... | Registers a new user for the SC4D LEX
@param username the username for the new user
@param password the password for the new user
@param email the e-mail for the new user
@param fullname the name for the new user (can be blank) | [
"Registers",
"a",
"new",
"user",
"for",
"the",
"SC4D",
"LEX"
] | train | https://github.com/caspervg/SC4D-LEX4J/blob/3d086ec70c817119a88573c2e23af27276cdb1d6/lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java#L168-L179 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.listUsageMetricsNext | public PagedList<PoolUsageMetrics> listUsageMetricsNext(final String nextPageLink, final PoolListUsageMetricsNextOptions poolListUsageMetricsNextOptions) {
"""
Lists the usage metrics, aggregated by pool across individual time intervals, for the specified account.
If you do not specify a $filter clause including ... | java | public PagedList<PoolUsageMetrics> listUsageMetricsNext(final String nextPageLink, final PoolListUsageMetricsNextOptions poolListUsageMetricsNextOptions) {
ServiceResponseWithHeaders<Page<PoolUsageMetrics>, PoolListUsageMetricsHeaders> response = listUsageMetricsNextSinglePageAsync(nextPageLink, poolListUsageMe... | [
"public",
"PagedList",
"<",
"PoolUsageMetrics",
">",
"listUsageMetricsNext",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"PoolListUsageMetricsNextOptions",
"poolListUsageMetricsNextOptions",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"PoolUsageMetrics... | Lists the usage metrics, aggregated by pool across individual time intervals, for the specified account.
If you do not specify a $filter clause including a poolId, the response includes all pools that existed in the account in the time range of the returned aggregation intervals. If you do not specify a $filter clause ... | [
"Lists",
"the",
"usage",
"metrics",
"aggregated",
"by",
"pool",
"across",
"individual",
"time",
"intervals",
"for",
"the",
"specified",
"account",
".",
"If",
"you",
"do",
"not",
"specify",
"a",
"$filter",
"clause",
"including",
"a",
"poolId",
"the",
"response"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L3767-L3775 |
brettonw/Bag | src/main/java/com/brettonw/bag/BagObject.java | BagObject.put | public BagObject put (String key, Object object) {
"""
Store an object at the requested key value. The key may be a simple name, or it may be a path
(with keys separated by "/") to create a hierarchical "bag-of-bags" that is indexed
recursively.
<p>
Using a binary search of the underlying store, finds where th... | java | public BagObject put (String key, Object object) {
// convert the element to internal storage format, and don't bother with the rest if that's
// a null value (per the docs above)
object = objectify (object);
if (object != null) {
// separate the key into path components... | [
"public",
"BagObject",
"put",
"(",
"String",
"key",
",",
"Object",
"object",
")",
"{",
"// convert the element to internal storage format, and don't bother with the rest if that's\r",
"// a null value (per the docs above)\r",
"object",
"=",
"objectify",
"(",
"object",
")",
";",... | Store an object at the requested key value. The key may be a simple name, or it may be a path
(with keys separated by "/") to create a hierarchical "bag-of-bags" that is indexed
recursively.
<p>
Using a binary search of the underlying store, finds where the first component of the path
should be. If it does not already ... | [
"Store",
"an",
"object",
"at",
"the",
"requested",
"key",
"value",
".",
"The",
"key",
"may",
"be",
"a",
"simple",
"name",
"or",
"it",
"may",
"be",
"a",
"path",
"(",
"with",
"keys",
"separated",
"by",
"/",
")",
"to",
"create",
"a",
"hierarchical",
"ba... | train | https://github.com/brettonw/Bag/blob/25c0ff74893b6c9a2c61bf0f97189ab82e0b2f56/src/main/java/com/brettonw/bag/BagObject.java#L185-L209 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java | FeatureOverlayQuery.buildMapClickMessageWithMapBounds | public String buildMapClickMessageWithMapBounds(LatLng latLng, double zoom, BoundingBox mapBounds, double tolerance, Projection projection) {
"""
Perform a query based upon the map click location and build a info message
@param latLng location
@param zoom current zoom level
@param mapBounds map vie... | java | public String buildMapClickMessageWithMapBounds(LatLng latLng, double zoom, BoundingBox mapBounds, double tolerance, Projection projection) {
// Build a bounding box to represent the click location
BoundingBox boundingBox = buildClickBoundingBox(latLng, mapBounds);
String message = buildMapCli... | [
"public",
"String",
"buildMapClickMessageWithMapBounds",
"(",
"LatLng",
"latLng",
",",
"double",
"zoom",
",",
"BoundingBox",
"mapBounds",
",",
"double",
"tolerance",
",",
"Projection",
"projection",
")",
"{",
"// Build a bounding box to represent the click location",
"Bound... | Perform a query based upon the map click location and build a info message
@param latLng location
@param zoom current zoom level
@param mapBounds map view bounds
@param tolerance tolerance distance
@param projection desired geometry projection
@return information message on what was clicked, or nil
@since ... | [
"Perform",
"a",
"query",
"based",
"upon",
"the",
"map",
"click",
"location",
"and",
"build",
"a",
"info",
"message"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java#L397-L405 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java | TaskOperations.reactivateTask | public void reactivateTask(String jobId, String taskId, Iterable<BatchClientBehavior> additionalBehaviors)
throws BatchErrorException, IOException {
"""
Reactivates a task, allowing it to run again even if its retry count has been
exhausted.
@param jobId
The ID of the job containing the task.
@pa... | java | public void reactivateTask(String jobId, String taskId, Iterable<BatchClientBehavior> additionalBehaviors)
throws BatchErrorException, IOException {
TaskReactivateOptions options = new TaskReactivateOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBeha... | [
"public",
"void",
"reactivateTask",
"(",
"String",
"jobId",
",",
"String",
"taskId",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"TaskReactivateOptions",
"options",
"=",
"new",... | Reactivates a task, allowing it to run again even if its retry count has been
exhausted.
@param jobId
The ID of the job containing the task.
@param taskId
The ID of the task.
@param additionalBehaviors
A collection of {@link BatchClientBehavior} instances that are
applied to the Batch service request.
@throws BatchErr... | [
"Reactivates",
"a",
"task",
"allowing",
"it",
"to",
"run",
"again",
"even",
"if",
"its",
"retry",
"count",
"has",
"been",
"exhausted",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java#L799-L806 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/search/UserSearch.java | UserSearch.getSearchForm | public Form getSearchForm(XMPPConnection con, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Returns the form for all search fields supported by the search service.
@param con the current XMPPConnection.
@param searchServ... | java | public Form getSearchForm(XMPPConnection con, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
UserSearch search = new UserSearch();
search.setType(IQ.Type.get);
search.setTo(searchService);
IQ response = con.crea... | [
"public",
"Form",
"getSearchForm",
"(",
"XMPPConnection",
"con",
",",
"DomainBareJid",
"searchService",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"UserSearch",
"search",
"=",
"new",
"... | Returns the form for all search fields supported by the search service.
@param con the current XMPPConnection.
@param searchService the search service to use. (ex. search.jivesoftware.com)
@return the search form received by the server.
@throws XMPPErrorException
@throws NoResponseException
@throws NotConnec... | [
"Returns",
"the",
"form",
"for",
"all",
"search",
"fields",
"supported",
"by",
"the",
"search",
"service",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/search/UserSearch.java#L73-L80 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMultiFileWidget.java | WMultiFileWidget.selectionsEqual | private boolean selectionsEqual(final List<?> list1, final List<?> list2) {
"""
Selection lists are considered equal if they have the same items (order is not important). An empty list is
considered equal to a null list.
@param list1 the first list to check.
@param list2 the second list to check.
@return tru... | java | private boolean selectionsEqual(final List<?> list1, final List<?> list2) {
return (list1 == null || list1.isEmpty()) && (list2 == null || list2.isEmpty())
|| (list1 != null && list2 != null && list1.size() == list2.size() && list1.
containsAll(list2));
} | [
"private",
"boolean",
"selectionsEqual",
"(",
"final",
"List",
"<",
"?",
">",
"list1",
",",
"final",
"List",
"<",
"?",
">",
"list2",
")",
"{",
"return",
"(",
"list1",
"==",
"null",
"||",
"list1",
".",
"isEmpty",
"(",
")",
")",
"&&",
"(",
"list2",
"... | Selection lists are considered equal if they have the same items (order is not important). An empty list is
considered equal to a null list.
@param list1 the first list to check.
@param list2 the second list to check.
@return true if the lists are equal, false otherwise. | [
"Selection",
"lists",
"are",
"considered",
"equal",
"if",
"they",
"have",
"the",
"same",
"items",
"(",
"order",
"is",
"not",
"important",
")",
".",
"An",
"empty",
"list",
"is",
"considered",
"equal",
"to",
"a",
"null",
"list",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMultiFileWidget.java#L931-L935 |
JoanZapata/android-pdfview | android-pdfview/src/main/java/com/joanzapata/pdfview/PDFView.java | PDFView.zoomCenteredTo | public void zoomCenteredTo(float zoom, PointF pivot) {
"""
Change the zoom level, relatively to a pivot point.
It will call moveTo() to make sure the given point stays
in the middle of the screen.
@param zoom The zoom level.
@param pivot The point on the screen that should stays.
"""
float dzoom ... | java | public void zoomCenteredTo(float zoom, PointF pivot) {
float dzoom = zoom / this.zoom;
zoomTo(zoom);
float baseX = currentXOffset * dzoom;
float baseY = currentYOffset * dzoom;
baseX += (pivot.x - pivot.x * dzoom);
baseY += (pivot.y - pivot.y * dzoom);
move... | [
"public",
"void",
"zoomCenteredTo",
"(",
"float",
"zoom",
",",
"PointF",
"pivot",
")",
"{",
"float",
"dzoom",
"=",
"zoom",
"/",
"this",
".",
"zoom",
";",
"zoomTo",
"(",
"zoom",
")",
";",
"float",
"baseX",
"=",
"currentXOffset",
"*",
"dzoom",
";",
"floa... | Change the zoom level, relatively to a pivot point.
It will call moveTo() to make sure the given point stays
in the middle of the screen.
@param zoom The zoom level.
@param pivot The point on the screen that should stays. | [
"Change",
"the",
"zoom",
"level",
"relatively",
"to",
"a",
"pivot",
"point",
".",
"It",
"will",
"call",
"moveTo",
"()",
"to",
"make",
"sure",
"the",
"given",
"point",
"stays",
"in",
"the",
"middle",
"of",
"the",
"screen",
"."
] | train | https://github.com/JoanZapata/android-pdfview/blob/8f239bb91ab56ff3066739dc44bccf8b1753b0ba/android-pdfview/src/main/java/com/joanzapata/pdfview/PDFView.java#L897-L905 |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/session/SessionManager.java | SessionManager.getNewSession | public ExtWebDriver getNewSession(String key, String value) throws Exception {
"""
Create and return a new ExtWebDriver instance. The instance is
constructed with default options, with the provided key/value pair
overriding the corresponding key and value in the options, and will
become the current session. Thi... | java | public ExtWebDriver getNewSession(String key, String value) throws Exception {
return getNewSession(key, value, true);
} | [
"public",
"ExtWebDriver",
"getNewSession",
"(",
"String",
"key",
",",
"String",
"value",
")",
"throws",
"Exception",
"{",
"return",
"getNewSession",
"(",
"key",
",",
"value",
",",
"true",
")",
";",
"}"
] | Create and return a new ExtWebDriver instance. The instance is
constructed with default options, with the provided key/value pair
overriding the corresponding key and value in the options, and will
become the current session. This is a convenience method for use when
only a single option needs to be overridden. If over... | [
"Create",
"and",
"return",
"a",
"new",
"ExtWebDriver",
"instance",
".",
"The",
"instance",
"is",
"constructed",
"with",
"default",
"options",
"with",
"the",
"provided",
"key",
"/",
"value",
"pair",
"overriding",
"the",
"corresponding",
"key",
"and",
"value",
"... | train | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/session/SessionManager.java#L270-L272 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/entitylists/ListViewUrl.java | ListViewUrl.deleteEntityListViewUrl | public static MozuUrl deleteEntityListViewUrl(String entityListFullName, String viewName) {
"""
Get Resource Url for DeleteEntityListView
@param entityListFullName The full name of the EntityList including namespace in name@nameSpace format
@param viewName The name for a view. Views are used to render data in , ... | java | public static MozuUrl deleteEntityListViewUrl(String entityListFullName, String viewName)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/entitylists/{entityListFullName}/views/{viewName}");
formatter.formatUrl("entityListFullName", entityListFullName);
formatter.formatUrl("viewName", viewName);
... | [
"public",
"static",
"MozuUrl",
"deleteEntityListViewUrl",
"(",
"String",
"entityListFullName",
",",
"String",
"viewName",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/entitylists/{entityListFullName}/views/{viewName}\"",
")",
";",
... | Get Resource Url for DeleteEntityListView
@param entityListFullName The full name of the EntityList including namespace in name@nameSpace format
@param viewName The name for a view. Views are used to render data in , such as document and entity lists. Each view includes a schema, format, name, ID, and associated data t... | [
"Get",
"Resource",
"Url",
"for",
"DeleteEntityListView"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/entitylists/ListViewUrl.java#L162-L168 |
alkacon/opencms-core | src/org/opencms/workplace/explorer/CmsExplorerTypeAccess.java | CmsExplorerTypeAccess.addAccessEntry | public void addAccessEntry(String key, String value) {
"""
Adds a single access entry to the map of access entries of the explorer type setting.<p>
This stores the configuration data in a map which is used in the initialize process
to create the access control list.<p>
@param key the principal of the ace
@... | java | public void addAccessEntry(String key, String value) {
m_accessControl.put(key, value);
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.get().getBundle().key(Messages.LOG_ADD_ACCESS_ENTRY_2, key, value));
}
} | [
"public",
"void",
"addAccessEntry",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"m_accessControl",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"Mes... | Adds a single access entry to the map of access entries of the explorer type setting.<p>
This stores the configuration data in a map which is used in the initialize process
to create the access control list.<p>
@param key the principal of the ace
@param value the permissions for the principal | [
"Adds",
"a",
"single",
"access",
"entry",
"to",
"the",
"map",
"of",
"access",
"entries",
"of",
"the",
"explorer",
"type",
"setting",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/explorer/CmsExplorerTypeAccess.java#L105-L111 |
wdtinc/mapbox-vector-tile-java | src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/MvtReader.java | MvtReader.loadMvt | public static JtsMvt loadMvt(InputStream is,
GeometryFactory geomFactory,
ITagConverter tagConverter) throws IOException {
"""
Load an MVT to JTS geometries using coordinates. Uses {@code tagConverter} to create user data
from feature properties.
... | java | public static JtsMvt loadMvt(InputStream is,
GeometryFactory geomFactory,
ITagConverter tagConverter) throws IOException {
return loadMvt(is, geomFactory, tagConverter, RING_CLASSIFIER_V2_1);
} | [
"public",
"static",
"JtsMvt",
"loadMvt",
"(",
"InputStream",
"is",
",",
"GeometryFactory",
"geomFactory",
",",
"ITagConverter",
"tagConverter",
")",
"throws",
"IOException",
"{",
"return",
"loadMvt",
"(",
"is",
",",
"geomFactory",
",",
"tagConverter",
",",
"RING_C... | Load an MVT to JTS geometries using coordinates. Uses {@code tagConverter} to create user data
from feature properties.
@param is stream with MVT data
@param geomFactory allows for JTS geometry creation
@param tagConverter converts MVT feature tags to JTS user data object.
@return JTS MVT with geometry in MVT coordina... | [
"Load",
"an",
"MVT",
"to",
"JTS",
"geometries",
"using",
"coordinates",
".",
"Uses",
"{",
"@code",
"tagConverter",
"}",
"to",
"create",
"user",
"data",
"from",
"feature",
"properties",
"."
] | train | https://github.com/wdtinc/mapbox-vector-tile-java/blob/e5e3df3fc2260709e289f972a1348c0a1ea30339/src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/MvtReader.java#L94-L98 |
m-m-m/util | value/src/main/java/net/sf/mmm/util/value/impl/AbstractValueConverterToCompatiblePojo.java | AbstractValueConverterToCompatiblePojo.handleNoGetterForSetter | protected void handleNoGetterForSetter(PojoPropertyAccessorOneArg setter, Class<?> targetClass, Object sourceObject, Class<?> sourceClass) {
"""
Called if the target object of the conversion has a setter that has no corresponding getter in the source
object to convert.
@param setter is the existing setter.
@p... | java | protected void handleNoGetterForSetter(PojoPropertyAccessorOneArg setter, Class<?> targetClass, Object sourceObject, Class<?> sourceClass) {
throw new PojoPropertyNotFoundException(sourceClass, setter.getName());
} | [
"protected",
"void",
"handleNoGetterForSetter",
"(",
"PojoPropertyAccessorOneArg",
"setter",
",",
"Class",
"<",
"?",
">",
"targetClass",
",",
"Object",
"sourceObject",
",",
"Class",
"<",
"?",
">",
"sourceClass",
")",
"{",
"throw",
"new",
"PojoPropertyNotFoundExcepti... | Called if the target object of the conversion has a setter that has no corresponding getter in the source
object to convert.
@param setter is the existing setter.
@param targetClass is the {@link Class} reflecting the target object to convert to.
@param sourceObject is the source object to convert that has no correspo... | [
"Called",
"if",
"the",
"target",
"object",
"of",
"the",
"conversion",
"has",
"a",
"setter",
"that",
"has",
"no",
"corresponding",
"getter",
"in",
"the",
"source",
"object",
"to",
"convert",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/value/src/main/java/net/sf/mmm/util/value/impl/AbstractValueConverterToCompatiblePojo.java#L115-L118 |
Netflix/suro | suro-localfile/src/main/java/com/netflix/suro/sink/localfile/FileWriterBase.java | FileWriterBase.setDone | public void setDone(String oldName, String newName) throws IOException {
"""
Implementation of {@link FileWriter#setDone(String, String)}
@param oldName
@param newName
@throws java.io.IOException
"""
Path oldPath = new Path(oldName);
fs.rename(oldPath, new Path(newName));
} | java | public void setDone(String oldName, String newName) throws IOException {
Path oldPath = new Path(oldName);
fs.rename(oldPath, new Path(newName));
} | [
"public",
"void",
"setDone",
"(",
"String",
"oldName",
",",
"String",
"newName",
")",
"throws",
"IOException",
"{",
"Path",
"oldPath",
"=",
"new",
"Path",
"(",
"oldName",
")",
";",
"fs",
".",
"rename",
"(",
"oldPath",
",",
"new",
"Path",
"(",
"newName",
... | Implementation of {@link FileWriter#setDone(String, String)}
@param oldName
@param newName
@throws java.io.IOException | [
"Implementation",
"of",
"{",
"@link",
"FileWriter#setDone",
"(",
"String",
"String",
")",
"}"
] | train | https://github.com/Netflix/suro/blob/e73d1a2e5b0492e41feb5a57d9e2a2e741a38453/suro-localfile/src/main/java/com/netflix/suro/sink/localfile/FileWriterBase.java#L67-L70 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CSVUtil.java | CSVUtil.loadCSV | public static <E extends Exception> DataSet loadCSV(final InputStream csvInputStream, final Collection<String> selectColumnNames, final long offset,
final long count, final Try.Predicate<String[], E> filter) throws UncheckedIOException, E {
"""
Load the data from CSV.
@param csvInputStream
@param ... | java | public static <E extends Exception> DataSet loadCSV(final InputStream csvInputStream, final Collection<String> selectColumnNames, final long offset,
final long count, final Try.Predicate<String[], E> filter) throws UncheckedIOException, E {
final Reader csvReader = new InputStreamReader(csvInputSt... | [
"public",
"static",
"<",
"E",
"extends",
"Exception",
">",
"DataSet",
"loadCSV",
"(",
"final",
"InputStream",
"csvInputStream",
",",
"final",
"Collection",
"<",
"String",
">",
"selectColumnNames",
",",
"final",
"long",
"offset",
",",
"final",
"long",
"count",
... | Load the data from CSV.
@param csvInputStream
@param selectColumnNames
@param offset
@param count
@param filter
@return | [
"Load",
"the",
"data",
"from",
"CSV",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CSVUtil.java#L126-L131 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/GraphicalModel.java | GraphicalModel.addStaticNormalizedFactor | public StaticFactor addStaticNormalizedFactor(int[] neighborIndices, int[] neighborDimensions, Function<int[], Double> assignmentFeaturizer) {
"""
This adds a static factor to the model, which will always produce the same value regardless of the assignment of
weights during inference.
This additionally normalize... | java | public StaticFactor addStaticNormalizedFactor(int[] neighborIndices, int[] neighborDimensions, Function<int[], Double> assignmentFeaturizer) {
NDArrayDoubles doubleArray = new NDArrayDoubles(neighborDimensions);
double localPartitionFunction = 0.0;
for (int[] assignment : doubleArray) {
localPartition... | [
"public",
"StaticFactor",
"addStaticNormalizedFactor",
"(",
"int",
"[",
"]",
"neighborIndices",
",",
"int",
"[",
"]",
"neighborDimensions",
",",
"Function",
"<",
"int",
"[",
"]",
",",
"Double",
">",
"assignmentFeaturizer",
")",
"{",
"NDArrayDoubles",
"doubleArray"... | This adds a static factor to the model, which will always produce the same value regardless of the assignment of
weights during inference.
This additionally normalizes the factor, so that it will maintain a normalized partition function; e.g.,
after a call to {@link CliqueTree#compileNormalizedModel()}.
@param neighbo... | [
"This",
"adds",
"a",
"static",
"factor",
"to",
"the",
"model",
"which",
"will",
"always",
"produce",
"the",
"same",
"value",
"regardless",
"of",
"the",
"assignment",
"of",
"weights",
"during",
"inference",
".",
"This",
"additionally",
"normalizes",
"the",
"fac... | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/GraphicalModel.java#L338-L348 |
voldemort/voldemort | src/java/voldemort/store/slop/HintedHandoff.java | HintedHandoff.sendHintParallel | public void sendHintParallel(Node failedNode, Version version, Slop slop) {
"""
Like
{@link #sendHintSerial(voldemort.cluster.Node, voldemort.versioning.Version, Slop)}
, but doesn't block the pipeline. Intended for handling prolonged
failures without incurring a performance cost.
@see #sendHintSerial(voldem... | java | public void sendHintParallel(Node failedNode, Version version, Slop slop) {
List<Node> nodes = new LinkedList<Node>();
nodes.addAll(handoffStrategy.routeHint(failedNode));
if(logger.isDebugEnabled()) {
List<Integer> nodeIds = new ArrayList<Integer>();
for(Node node: nodes... | [
"public",
"void",
"sendHintParallel",
"(",
"Node",
"failedNode",
",",
"Version",
"version",
",",
"Slop",
"slop",
")",
"{",
"List",
"<",
"Node",
">",
"nodes",
"=",
"new",
"LinkedList",
"<",
"Node",
">",
"(",
")",
";",
"nodes",
".",
"addAll",
"(",
"hando... | Like
{@link #sendHintSerial(voldemort.cluster.Node, voldemort.versioning.Version, Slop)}
, but doesn't block the pipeline. Intended for handling prolonged
failures without incurring a performance cost.
@see #sendHintSerial(voldemort.cluster.Node,
voldemort.versioning.Version, Slop) | [
"Like",
"{",
"@link",
"#sendHintSerial",
"(",
"voldemort",
".",
"cluster",
".",
"Node",
"voldemort",
".",
"versioning",
".",
"Version",
"Slop",
")",
"}",
"but",
"doesn",
"t",
"block",
"the",
"pipeline",
".",
"Intended",
"for",
"handling",
"prolonged",
"failu... | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/slop/HintedHandoff.java#L103-L115 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WRadioButtonSelectRenderer.java | WRadioButtonSelectRenderer.paintAjax | private void paintAjax(final WRadioButtonSelect rbSelect, final XmlStringBuilder xml) {
"""
Paints the AJAX information for the given WRadioButtonSelect.
@param rbSelect the WRadioButtonSelect to paint.
@param xml the XmlStringBuilder to paint to.
"""
// Start tag
xml.appendTagOpen("ui:ajaxtrigger");
... | java | private void paintAjax(final WRadioButtonSelect rbSelect, final XmlStringBuilder xml) {
// Start tag
xml.appendTagOpen("ui:ajaxtrigger");
xml.appendAttribute("triggerId", rbSelect.getId());
xml.appendClose();
// Target
xml.appendTagOpen("ui:ajaxtargetid");
xml.appendAttribute("targetId", rbSelect.getAjax... | [
"private",
"void",
"paintAjax",
"(",
"final",
"WRadioButtonSelect",
"rbSelect",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"// Start tag",
"xml",
".",
"appendTagOpen",
"(",
"\"ui:ajaxtrigger\"",
")",
";",
"xml",
".",
"appendAttribute",
"(",
"\"triggerId\"",
... | Paints the AJAX information for the given WRadioButtonSelect.
@param rbSelect the WRadioButtonSelect to paint.
@param xml the XmlStringBuilder to paint to. | [
"Paints",
"the",
"AJAX",
"information",
"for",
"the",
"given",
"WRadioButtonSelect",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WRadioButtonSelectRenderer.java#L133-L146 |
percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/DialogUtils.java | DialogUtils.quickDialog | public static AlertDialog quickDialog(final Activity context, final String message) {
"""
Show a model dialog box. The <code>android.app.AlertDialog</code> object is returned so that
you can specify an OnDismissListener (or other listeners) if required.
<b>Note:</b> show() is already called on the AlertDialog b... | java | public static AlertDialog quickDialog(final Activity context, final String message) {
final SpannableString s = new SpannableString(message); //Make links clickable
Linkify.addLinks(s, Linkify.ALL);
final Builder builder = new AlertDialog.Builder(context);
builder.setMessage(s);
... | [
"public",
"static",
"AlertDialog",
"quickDialog",
"(",
"final",
"Activity",
"context",
",",
"final",
"String",
"message",
")",
"{",
"final",
"SpannableString",
"s",
"=",
"new",
"SpannableString",
"(",
"message",
")",
";",
"//Make links clickable",
"Linkify",
".",
... | Show a model dialog box. The <code>android.app.AlertDialog</code> object is returned so that
you can specify an OnDismissListener (or other listeners) if required.
<b>Note:</b> show() is already called on the AlertDialog being returned.
@param context The current Context or Activity that this method is called from.
@... | [
"Show",
"a",
"model",
"dialog",
"box",
".",
"The",
"<code",
">",
"android",
".",
"app",
".",
"AlertDialog<",
"/",
"code",
">",
"object",
"is",
"returned",
"so",
"that",
"you",
"can",
"specify",
"an",
"OnDismissListener",
"(",
"or",
"other",
"listeners",
... | train | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/DialogUtils.java#L30-L47 |
instacount/appengine-counter | src/main/java/io/instacount/appengine/counter/service/ShardedCounterServiceImpl.java | ShardedCounterServiceImpl.assertCounterAmountMutatable | @VisibleForTesting
protected void assertCounterAmountMutatable(final String counterName, final CounterStatus counterStatus) {
"""
Helper method to determine if a counter's incrementAmount can be mutated (incremented or decremented). In order
for that to happen, the counter's status must be {@link CounterStatus#A... | java | @VisibleForTesting
protected void assertCounterAmountMutatable(final String counterName, final CounterStatus counterStatus)
{
if (counterStatus != CounterStatus.AVAILABLE)
{
final String msg = String.format(
"Can't mutate the amount of counter '%s' because it's currently in the %s state but must be in in "... | [
"@",
"VisibleForTesting",
"protected",
"void",
"assertCounterAmountMutatable",
"(",
"final",
"String",
"counterName",
",",
"final",
"CounterStatus",
"counterStatus",
")",
"{",
"if",
"(",
"counterStatus",
"!=",
"CounterStatus",
".",
"AVAILABLE",
")",
"{",
"final",
"S... | Helper method to determine if a counter's incrementAmount can be mutated (incremented or decremented). In order
for that to happen, the counter's status must be {@link CounterStatus#AVAILABLE}.
@param counterName
@param counterStatus
@return | [
"Helper",
"method",
"to",
"determine",
"if",
"a",
"counter",
"s",
"incrementAmount",
"can",
"be",
"mutated",
"(",
"incremented",
"or",
"decremented",
")",
".",
"In",
"order",
"for",
"that",
"to",
"happen",
"the",
"counter",
"s",
"status",
"must",
"be",
"{"... | train | https://github.com/instacount/appengine-counter/blob/60aa86ab28f173ec1642539926b69924b8bda238/src/main/java/io/instacount/appengine/counter/service/ShardedCounterServiceImpl.java#L1427-L1438 |
SonarSource/sonarqube | sonar-core/src/main/java/org/sonar/core/util/stream/MoreCollectors.java | MoreCollectors.index | public static <K, E> Collector<E, ImmutableListMultimap.Builder<K, E>, ImmutableListMultimap<K, E>> index(Function<? super E, K> keyFunction) {
"""
Creates an {@link com.google.common.collect.ImmutableListMultimap} from the stream where the values are the values
in the stream and the keys are the result of the pr... | java | public static <K, E> Collector<E, ImmutableListMultimap.Builder<K, E>, ImmutableListMultimap<K, E>> index(Function<? super E, K> keyFunction) {
return index(keyFunction, Function.<E>identity());
} | [
"public",
"static",
"<",
"K",
",",
"E",
">",
"Collector",
"<",
"E",
",",
"ImmutableListMultimap",
".",
"Builder",
"<",
"K",
",",
"E",
">",
",",
"ImmutableListMultimap",
"<",
"K",
",",
"E",
">",
">",
"index",
"(",
"Function",
"<",
"?",
"super",
"E",
... | Creates an {@link com.google.common.collect.ImmutableListMultimap} from the stream where the values are the values
in the stream and the keys are the result of the provided {@link Function keyFunction} applied to each value in the
stream.
<p>
Neither {@link Function keyFunction} nor {@link Function valueFunction} can ... | [
"Creates",
"an",
"{",
"@link",
"com",
".",
"google",
".",
"common",
".",
"collect",
".",
"ImmutableListMultimap",
"}",
"from",
"the",
"stream",
"where",
"the",
"values",
"are",
"the",
"values",
"in",
"the",
"stream",
"and",
"the",
"keys",
"are",
"the",
"... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-core/src/main/java/org/sonar/core/util/stream/MoreCollectors.java#L316-L318 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/internal/EvaluateConcordantPairs.java | EvaluateConcordantPairs.countTies | protected int countTies(double[] withinDistances, int[] withinTies) {
"""
Count (and annotate) the number of tied values.
@param withinDistances Distances array
@param withinTies Output array of tie counts.
@return Number of tied values.
"""
int wties = 0, running = 1;
for(int i = 1; i <= withinDi... | java | protected int countTies(double[] withinDistances, int[] withinTies) {
int wties = 0, running = 1;
for(int i = 1; i <= withinDistances.length; ++i) {
if(i == withinDistances.length || withinDistances[i - 1] != withinDistances[i]) {
for(int j = i - running; j < i; j++) {
withinTies[j] = ru... | [
"protected",
"int",
"countTies",
"(",
"double",
"[",
"]",
"withinDistances",
",",
"int",
"[",
"]",
"withinTies",
")",
"{",
"int",
"wties",
"=",
"0",
",",
"running",
"=",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<=",
"withinDistances",
... | Count (and annotate) the number of tied values.
@param withinDistances Distances array
@param withinTies Output array of tie counts.
@return Number of tied values. | [
"Count",
"(",
"and",
"annotate",
")",
"the",
"number",
"of",
"tied",
"values",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/internal/EvaluateConcordantPairs.java#L223-L238 |
att/AAF | cadi/aaf/src/main/java/com/att/cadi/aaf/PermEval.java | PermEval.evalAction | public static boolean evalAction(String sAction,String pAction) {
"""
Evaluate Action
sAction = Stored Action...
pAction = Present Action... the Permission to validate against.
Action is not quite as complex. But we write it in this function so it can be consistent
"""
if(ASTERIX.equals(sAction))retu... | java | public static boolean evalAction(String sAction,String pAction) {
if(ASTERIX.equals(sAction))return true; // If Server's String is "*", then it accepts every Action
for(String sItem : Split.split(LIST_SEP,sAction)) { // allow for "," definition in Action
if (pAction.charAt(0)==START_REGEX_CHAR? ... | [
"public",
"static",
"boolean",
"evalAction",
"(",
"String",
"sAction",
",",
"String",
"pAction",
")",
"{",
"if",
"(",
"ASTERIX",
".",
"equals",
"(",
"sAction",
")",
")",
"return",
"true",
";",
"// If Server's String is \"*\", then it accepts every Action",
"for",
... | Evaluate Action
sAction = Stored Action...
pAction = Present Action... the Permission to validate against.
Action is not quite as complex. But we write it in this function so it can be consistent | [
"Evaluate",
"Action"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/aaf/src/main/java/com/att/cadi/aaf/PermEval.java#L113-L122 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java | ConstructorBuilder.buildConstructorComments | public void buildConstructorComments(XMLNode node, Content constructorDocTree) {
"""
Build the comments for the constructor. Do nothing if
{@link Configuration#nocomment} is set to true.
@param node the XML element that specifies which components to document
@param constructorDocTree the content tree to whic... | java | public void buildConstructorComments(XMLNode node, Content constructorDocTree) {
if (!configuration.nocomment) {
writer.addComments(
(ConstructorDoc) constructors.get(currentConstructorIndex),
constructorDocTree);
}
} | [
"public",
"void",
"buildConstructorComments",
"(",
"XMLNode",
"node",
",",
"Content",
"constructorDocTree",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"nocomment",
")",
"{",
"writer",
".",
"addComments",
"(",
"(",
"ConstructorDoc",
")",
"constructors",
".",... | Build the comments for the constructor. Do nothing if
{@link Configuration#nocomment} is set to true.
@param node the XML element that specifies which components to document
@param constructorDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"comments",
"for",
"the",
"constructor",
".",
"Do",
"nothing",
"if",
"{",
"@link",
"Configuration#nocomment",
"}",
"is",
"set",
"to",
"true",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java#L213-L219 |
mikepenz/Materialize | library/src/main/java/com/mikepenz/materialize/holder/ImageHolder.java | ImageHolder.applyMultiIconTo | public static void applyMultiIconTo(Drawable icon, int iconColor, Drawable selectedIcon, int selectedIconColor, boolean tinted, ImageView imageView) {
"""
a small static helper to set a multi state drawable on a view
@param icon
@param iconColor
@param selectedIcon
@param selectedIconColor
@param tinted
@p... | java | public static void applyMultiIconTo(Drawable icon, int iconColor, Drawable selectedIcon, int selectedIconColor, boolean tinted, ImageView imageView) {
//if we have an icon then we want to set it
if (icon != null) {
//if we got a different color for the selectedIcon we need a StateList
... | [
"public",
"static",
"void",
"applyMultiIconTo",
"(",
"Drawable",
"icon",
",",
"int",
"iconColor",
",",
"Drawable",
"selectedIcon",
",",
"int",
"selectedIconColor",
",",
"boolean",
"tinted",
",",
"ImageView",
"imageView",
")",
"{",
"//if we have an icon then we want to... | a small static helper to set a multi state drawable on a view
@param icon
@param iconColor
@param selectedIcon
@param selectedIconColor
@param tinted
@param imageView | [
"a",
"small",
"static",
"helper",
"to",
"set",
"a",
"multi",
"state",
"drawable",
"on",
"a",
"view"
] | train | https://github.com/mikepenz/Materialize/blob/2612c10c7570191a78d57f23620e945d61370e3d/library/src/main/java/com/mikepenz/materialize/holder/ImageHolder.java#L286-L307 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/creation/CreationShanksAgentCapability.java | CreationShanksAgentCapability.addNewAgent | public static void addNewAgent(ShanksSimulation sim, ShanksAgent agent)
throws ShanksException {
"""
Adds an agent to the simulation
@param sim
- The shanks simulation
@param agent
- The new agent
@throws DuplicatedAgentIDException
"""
sim.registerShanksAgent(agent);
if (sim.... | java | public static void addNewAgent(ShanksSimulation sim, ShanksAgent agent)
throws ShanksException {
sim.registerShanksAgent(agent);
if (sim.schedule.getTime() < 0) {
sim.schedule.scheduleRepeating(Schedule.EPOCH, 2, agent, 1);
} else {
sim.schedule.scheduleRepeat... | [
"public",
"static",
"void",
"addNewAgent",
"(",
"ShanksSimulation",
"sim",
",",
"ShanksAgent",
"agent",
")",
"throws",
"ShanksException",
"{",
"sim",
".",
"registerShanksAgent",
"(",
"agent",
")",
";",
"if",
"(",
"sim",
".",
"schedule",
".",
"getTime",
"(",
... | Adds an agent to the simulation
@param sim
- The shanks simulation
@param agent
- The new agent
@throws DuplicatedAgentIDException | [
"Adds",
"an",
"agent",
"to",
"the",
"simulation"
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/creation/CreationShanksAgentCapability.java#L48-L58 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.saveWithTrainingConfig | public void saveWithTrainingConfig(TrainingConfig trainingConfig,OutputStream outputStream) throws IOException {
"""
Save this samediff instance as a zip file
with the training configuration
@param trainingConfig the training configuration to save
@param outputStream the output stream to write to
@throws IOEx... | java | public void saveWithTrainingConfig(TrainingConfig trainingConfig,OutputStream outputStream) throws IOException {
ObjectMapper objectMapper = ObjectMapperHolder.getJsonMapper();
String configJson = objectMapper.writeValueAsString(trainingConfig);
ZipOutputStream zipfile = new ZipOutputStream(new... | [
"public",
"void",
"saveWithTrainingConfig",
"(",
"TrainingConfig",
"trainingConfig",
",",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"ObjectMapper",
"objectMapper",
"=",
"ObjectMapperHolder",
".",
"getJsonMapper",
"(",
")",
";",
"String",
"config... | Save this samediff instance as a zip file
with the training configuration
@param trainingConfig the training configuration to save
@param outputStream the output stream to write to
@throws IOException | [
"Save",
"this",
"samediff",
"instance",
"as",
"a",
"zip",
"file",
"with",
"the",
"training",
"configuration"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L4416-L4436 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/spi/discovery/AbstractDiscoveryStrategy.java | AbstractDiscoveryStrategy.getOrDefault | protected <T extends Comparable> T getOrDefault(PropertyDefinition property, T defaultValue) {
"""
Returns the value of the requested {@link PropertyDefinition} if available in the
declarative or programmatic configuration (XML or Config API), otherwise it will
return the given <tt>defaultValue</tt>.
<p/>
<b>T... | java | protected <T extends Comparable> T getOrDefault(PropertyDefinition property, T defaultValue) {
return getOrDefault(null, property, defaultValue);
} | [
"protected",
"<",
"T",
"extends",
"Comparable",
">",
"T",
"getOrDefault",
"(",
"PropertyDefinition",
"property",
",",
"T",
"defaultValue",
")",
"{",
"return",
"getOrDefault",
"(",
"null",
",",
"property",
",",
"defaultValue",
")",
";",
"}"
] | Returns the value of the requested {@link PropertyDefinition} if available in the
declarative or programmatic configuration (XML or Config API), otherwise it will
return the given <tt>defaultValue</tt>.
<p/>
<b>This method overload won't do environment or JVM property lookup.</b> A call to
this overload is equivalent t... | [
"Returns",
"the",
"value",
"of",
"the",
"requested",
"{",
"@link",
"PropertyDefinition",
"}",
"if",
"available",
"in",
"the",
"declarative",
"or",
"programmatic",
"configuration",
"(",
"XML",
"or",
"Config",
"API",
")",
"otherwise",
"it",
"will",
"return",
"th... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/discovery/AbstractDiscoveryStrategy.java#L143-L145 |
davidmoten/rxjava-jdbc | src/main/java/com/github/davidmoten/rx/jdbc/QueryUpdateOnSubscribe.java | QueryUpdateOnSubscribe.performRollback | @SuppressWarnings("unchecked")
private void performRollback(Subscriber<? super T> subscriber, State state) {
"""
Rolls back the current transaction. Throws {@link RuntimeException} if
connection is in autoCommit mode.
@param subscriber
@param state
"""
debug("rolling back");
query.cont... | java | @SuppressWarnings("unchecked")
private void performRollback(Subscriber<? super T> subscriber, State state) {
debug("rolling back");
query.context().endTransactionObserve();
Conditions.checkTrue(!Util.isAutoCommit(state.con));
Util.rollback(state.con);
// must close before onN... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"performRollback",
"(",
"Subscriber",
"<",
"?",
"super",
"T",
">",
"subscriber",
",",
"State",
"state",
")",
"{",
"debug",
"(",
"\"rolling back\"",
")",
";",
"query",
".",
"context",
"(",... | Rolls back the current transaction. Throws {@link RuntimeException} if
connection is in autoCommit mode.
@param subscriber
@param state | [
"Rolls",
"back",
"the",
"current",
"transaction",
".",
"Throws",
"{",
"@link",
"RuntimeException",
"}",
"if",
"connection",
"is",
"in",
"autoCommit",
"mode",
"."
] | train | https://github.com/davidmoten/rxjava-jdbc/blob/81e157d7071a825086bde81107b8694684cdff14/src/main/java/com/github/davidmoten/rx/jdbc/QueryUpdateOnSubscribe.java#L188-L200 |
EMCECS/nfs-client-java | src/main/java/com/emc/ecs/nfsclient/rpc/RpcWrapper.java | RpcWrapper.callRpcChecked | private void callRpcChecked(S request, RpcResponseHandler<? extends T> responseHandler, String ipAddress)
throws IOException {
"""
The base functionality used by all NFS calls, which does basic return
code checking and throws an exception if this does not pass. Verbose
logging is also handled here. T... | java | private void callRpcChecked(S request, RpcResponseHandler<? extends T> responseHandler, String ipAddress)
throws IOException {
LOG.debug("server {}, port {}, request {}", _server, _port, request);
callRpcNaked(request, responseHandler.getNewResponse(), ipAddress);
if (LOG.isDebugEn... | [
"private",
"void",
"callRpcChecked",
"(",
"S",
"request",
",",
"RpcResponseHandler",
"<",
"?",
"extends",
"T",
">",
"responseHandler",
",",
"String",
"ipAddress",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"debug",
"(",
"\"server {}, port {}, request {}\"",
",... | The base functionality used by all NFS calls, which does basic return
code checking and throws an exception if this does not pass. Verbose
logging is also handled here. This method is not used by Portmap, Mount,
and Unmount calls.
@param request
The request to send.
@param responseHandler
A response handler.
@param ip... | [
"The",
"base",
"functionality",
"used",
"by",
"all",
"NFS",
"calls",
"which",
"does",
"basic",
"return",
"code",
"checking",
"and",
"throws",
"an",
"exception",
"if",
"this",
"does",
"not",
"pass",
".",
"Verbose",
"logging",
"is",
"also",
"handled",
"here",
... | train | https://github.com/EMCECS/nfs-client-java/blob/7ba25bad5052b95cd286052745327729288b2843/src/main/java/com/emc/ecs/nfsclient/rpc/RpcWrapper.java#L266-L277 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/LocalDate.java | LocalDate.plusMonths | public LocalDate plusMonths(long monthsToAdd) {
"""
Returns a copy of this {@code LocalDate} with the specified period in months added.
<p>
This method adds the specified amount to the months field in three steps:
<ol>
<li>Add the input months to the month-of-year field</li>
<li>Check if the resulting date wo... | java | public LocalDate plusMonths(long monthsToAdd) {
if (monthsToAdd == 0) {
return this;
}
long monthCount = year * 12L + (month - 1);
long calcMonths = monthCount + monthsToAdd; // safe overflow
int newYear = YEAR.checkValidIntValue(Jdk8Methods.floorDiv(calcMonths, 12))... | [
"public",
"LocalDate",
"plusMonths",
"(",
"long",
"monthsToAdd",
")",
"{",
"if",
"(",
"monthsToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"long",
"monthCount",
"=",
"year",
"*",
"12L",
"+",
"(",
"month",
"-",
"1",
")",
";",
"long",
"calcM... | Returns a copy of this {@code LocalDate} with the specified period in months added.
<p>
This method adds the specified amount to the months field in three steps:
<ol>
<li>Add the input months to the month-of-year field</li>
<li>Check if the resulting date would be invalid</li>
<li>Adjust the day-of-month to the last va... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalDate",
"}",
"with",
"the",
"specified",
"period",
"in",
"months",
"added",
".",
"<p",
">",
"This",
"method",
"adds",
"the",
"specified",
"amount",
"to",
"the",
"months",
"field",
"in",
"three",
"s... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/LocalDate.java#L1133-L1142 |
alkacon/opencms-core | src/org/opencms/module/CmsModuleImportExportHandler.java | CmsModuleImportExportHandler.importData | @Deprecated
public void importData(CmsObject cms, String importFile, String importPath, I_CmsReport report)
throws CmsXmlException, CmsImportExportException, CmsRoleViolationException, CmsException {
"""
@see org.opencms.importexport.I_CmsImportExportHandler#importData(org.opencms.file.CmsObject, java.lang... | java | @Deprecated
public void importData(CmsObject cms, String importFile, String importPath, I_CmsReport report)
throws CmsXmlException, CmsImportExportException, CmsRoleViolationException, CmsException {
CmsImportParameters parameters = new CmsImportParameters(importFile, importPath, true);
setImpo... | [
"@",
"Deprecated",
"public",
"void",
"importData",
"(",
"CmsObject",
"cms",
",",
"String",
"importFile",
",",
"String",
"importPath",
",",
"I_CmsReport",
"report",
")",
"throws",
"CmsXmlException",
",",
"CmsImportExportException",
",",
"CmsRoleViolationException",
","... | @see org.opencms.importexport.I_CmsImportExportHandler#importData(org.opencms.file.CmsObject, java.lang.String, java.lang.String, org.opencms.report.I_CmsReport)
@deprecated use {@link #importData(CmsObject, I_CmsReport)} instead | [
"@see",
"org",
".",
"opencms",
".",
"importexport",
".",
"I_CmsImportExportHandler#importData",
"(",
"org",
".",
"opencms",
".",
"file",
".",
"CmsObject",
"java",
".",
"lang",
".",
"String",
"java",
".",
"lang",
".",
"String",
"org",
".",
"opencms",
".",
"... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/module/CmsModuleImportExportHandler.java#L574-L582 |
strator-dev/greenpepper | greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java | ConfluenceGreenPepper.isCredentialsValid | public boolean isCredentialsValid(String username, String password) {
"""
<p>isCredentialsValid.</p>
@param username a {@link java.lang.String} object.
@param password a {@link java.lang.String} object.
@return a boolean.
"""
try {
String token = getTokenAuthenticationManager().login(S... | java | public boolean isCredentialsValid(String username, String password) {
try {
String token = getTokenAuthenticationManager().login(StringUtil.toEmptyIfNull(username), StringUtil.toEmptyIfNull(password));
getTokenAuthenticationManager().logout(token);
return true;
} cat... | [
"public",
"boolean",
"isCredentialsValid",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"try",
"{",
"String",
"token",
"=",
"getTokenAuthenticationManager",
"(",
")",
".",
"login",
"(",
"StringUtil",
".",
"toEmptyIfNull",
"(",
"username",
")",... | <p>isCredentialsValid.</p>
@param username a {@link java.lang.String} object.
@param password a {@link java.lang.String} object.
@return a boolean. | [
"<p",
">",
"isCredentialsValid",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java#L915-L924 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/dataTable/DataTableRenderer.java | DataTableRenderer.determineLanguage | private String determineLanguage(FacesContext fc, DataTable dataTable) {
"""
Determine if the user specify a lang Otherwise return null to avoid language
settings.
@param fc
@param dataTable
@return
"""
final List<String> availableLanguages = Arrays.asList("de", "en", "es", "fr", "hu", "it", "nl", "pl"... | java | private String determineLanguage(FacesContext fc, DataTable dataTable) {
final List<String> availableLanguages = Arrays.asList("de", "en", "es", "fr", "hu", "it", "nl", "pl", "pt",
"ru");
if (BsfUtils.isStringValued(dataTable.getCustomLangUrl())) {
return dataTable.getCustomLangUrl();
} else if (BsfUtils.i... | [
"private",
"String",
"determineLanguage",
"(",
"FacesContext",
"fc",
",",
"DataTable",
"dataTable",
")",
"{",
"final",
"List",
"<",
"String",
">",
"availableLanguages",
"=",
"Arrays",
".",
"asList",
"(",
"\"de\"",
",",
"\"en\"",
",",
"\"es\"",
",",
"\"fr\"",
... | Determine if the user specify a lang Otherwise return null to avoid language
settings.
@param fc
@param dataTable
@return | [
"Determine",
"if",
"the",
"user",
"specify",
"a",
"lang",
"Otherwise",
"return",
"null",
"to",
"avoid",
"language",
"settings",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/dataTable/DataTableRenderer.java#L851-L868 |
ZuInnoTe/hadoopoffice | fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/HadoopKeyStoreManager.java | HadoopKeyStoreManager.getPassword | public String getPassword(String alias, String passwordPassword) throws NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException, InvalidKeySpecException {
"""
*
Retrieves a password from the currently opened keystore
@param alias
@param passwordPassword
@return
@throws NoSuchAlgorithmExcept... | java | public String getPassword(String alias, String passwordPassword) throws NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException, InvalidKeySpecException {
SecretKey sk = (SecretKey) this.keystore.getKey(alias,passwordPassword.toCharArray());
return new String(sk.getEncoded());
} | [
"public",
"String",
"getPassword",
"(",
"String",
"alias",
",",
"String",
"passwordPassword",
")",
"throws",
"NoSuchAlgorithmException",
",",
"UnrecoverableEntryException",
",",
"KeyStoreException",
",",
"InvalidKeySpecException",
"{",
"SecretKey",
"sk",
"=",
"(",
"Secr... | *
Retrieves a password from the currently opened keystore
@param alias
@param passwordPassword
@return
@throws NoSuchAlgorithmException
@throws UnrecoverableEntryException
@throws KeyStoreException
@throws InvalidKeySpecException | [
"*",
"Retrieves",
"a",
"password",
"from",
"the",
"currently",
"opened",
"keystore"
] | train | https://github.com/ZuInnoTe/hadoopoffice/blob/58fc9223ee290bcb14847aaaff3fadf39c465e46/fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/HadoopKeyStoreManager.java#L131-L134 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.fromMap | @SuppressWarnings("unchecked")
public static <E, N extends Number> Counter<E> fromMap(final Map<E, N> map) {
"""
Returns a counter view of the given map. Infers the numeric type of the
values from the first element in map.values().
"""
if (map.isEmpty()) {
throw new IllegalArgumentException("Ma... | java | @SuppressWarnings("unchecked")
public static <E, N extends Number> Counter<E> fromMap(final Map<E, N> map) {
if (map.isEmpty()) {
throw new IllegalArgumentException("Map must have at least one element" + " to infer numeric type; add an element first or use e.g." + " fromMap(map, Integer.class)");
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"E",
",",
"N",
"extends",
"Number",
">",
"Counter",
"<",
"E",
">",
"fromMap",
"(",
"final",
"Map",
"<",
"E",
",",
"N",
">",
"map",
")",
"{",
"if",
"(",
"map",
".",
"isEmpt... | Returns a counter view of the given map. Infers the numeric type of the
values from the first element in map.values(). | [
"Returns",
"a",
"counter",
"view",
"of",
"the",
"given",
"map",
".",
"Infers",
"the",
"numeric",
"type",
"of",
"the",
"values",
"from",
"the",
"first",
"element",
"in",
"map",
".",
"values",
"()",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L2290-L2296 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.