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 |
|---|---|---|---|---|---|---|---|---|---|---|
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java | AsyncMutateInBuilder.withDurability | public AsyncMutateInBuilder withDurability(PersistTo persistTo, ReplicateTo replicateTo) {
"""
Set both a persistence and a replication durability constraints for the whole mutation.
@param persistTo the persistence durability constraint to observe.
@param replicateTo the replication durability constraint to o... | java | public AsyncMutateInBuilder withDurability(PersistTo persistTo, ReplicateTo replicateTo) {
this.persistTo = persistTo;
this.replicateTo = replicateTo;
return this;
} | [
"public",
"AsyncMutateInBuilder",
"withDurability",
"(",
"PersistTo",
"persistTo",
",",
"ReplicateTo",
"replicateTo",
")",
"{",
"this",
".",
"persistTo",
"=",
"persistTo",
";",
"this",
".",
"replicateTo",
"=",
"replicateTo",
";",
"return",
"this",
";",
"}"
] | Set both a persistence and a replication durability constraints for the whole mutation.
@param persistTo the persistence durability constraint to observe.
@param replicateTo the replication durability constraint to observe.
@return this builder for chaining. | [
"Set",
"both",
"a",
"persistence",
"and",
"a",
"replication",
"durability",
"constraints",
"for",
"the",
"whole",
"mutation",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java#L599-L603 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/api/scanner/MavenRepositoryResolver.java | MavenRepositoryResolver.resolve | public static MavenRepositoryDescriptor resolve(Store store, String url) {
"""
Finds or creates a repository descriptor for the given url.
@param store
the {@link Store}
@param url
the repository url
@return a {@link MavenRepositoryDescriptor} for the given url.
"""
MavenRepositoryDescriptor rep... | java | public static MavenRepositoryDescriptor resolve(Store store, String url) {
MavenRepositoryDescriptor repositoryDescriptor = store.find(MavenRepositoryDescriptor.class, url);
if (repositoryDescriptor == null) {
repositoryDescriptor = store.create(MavenRepositoryDescriptor.class);
... | [
"public",
"static",
"MavenRepositoryDescriptor",
"resolve",
"(",
"Store",
"store",
",",
"String",
"url",
")",
"{",
"MavenRepositoryDescriptor",
"repositoryDescriptor",
"=",
"store",
".",
"find",
"(",
"MavenRepositoryDescriptor",
".",
"class",
",",
"url",
")",
";",
... | Finds or creates a repository descriptor for the given url.
@param store
the {@link Store}
@param url
the repository url
@return a {@link MavenRepositoryDescriptor} for the given url. | [
"Finds",
"or",
"creates",
"a",
"repository",
"descriptor",
"for",
"the",
"given",
"url",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/scanner/MavenRepositoryResolver.java#L20-L27 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPreference.java | GVRPreference.getProperty | public String getProperty(String key, String defaultValue) {
"""
Gets a property with a default value.
@param key
The key string.
@param defaultValue
The default value.
@return The property string.
"""
return mProperties.getProperty(key, defaultValue);
} | java | public String getProperty(String key, String defaultValue) {
return mProperties.getProperty(key, defaultValue);
} | [
"public",
"String",
"getProperty",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"return",
"mProperties",
".",
"getProperty",
"(",
"key",
",",
"defaultValue",
")",
";",
"}"
] | Gets a property with a default value.
@param key
The key string.
@param defaultValue
The default value.
@return The property string. | [
"Gets",
"a",
"property",
"with",
"a",
"default",
"value",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPreference.java#L63-L65 |
belaban/JGroups | src/org/jgroups/protocols/pbcast/ServerGmsImpl.java | ServerGmsImpl.handleViewChange | public void handleViewChange(View view, Digest digest) {
"""
Called by the GMS when a VIEW is received.
@param view The view to be installed
@param digest If view is a MergeView, the digest contains the seqnos of all members and has to be set by GMS
"""
if(gms.isLeaving() && !view.containsMember(gm... | java | public void handleViewChange(View view, Digest digest) {
if(gms.isLeaving() && !view.containsMember(gms.local_addr))
return;
View prev_view=gms.view();
gms.installView(view, digest);
Address prev_coord=prev_view != null? prev_view.getCoord() : null, curr_coord=view.getCoord()... | [
"public",
"void",
"handleViewChange",
"(",
"View",
"view",
",",
"Digest",
"digest",
")",
"{",
"if",
"(",
"gms",
".",
"isLeaving",
"(",
")",
"&&",
"!",
"view",
".",
"containsMember",
"(",
"gms",
".",
"local_addr",
")",
")",
"return",
";",
"View",
"prev_... | Called by the GMS when a VIEW is received.
@param view The view to be installed
@param digest If view is a MergeView, the digest contains the seqnos of all members and has to be set by GMS | [
"Called",
"by",
"the",
"GMS",
"when",
"a",
"VIEW",
"is",
"received",
"."
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/protocols/pbcast/ServerGmsImpl.java#L63-L71 |
xiaosunzhu/resource-utils | src/main/java/net/sunyijun/resource/config/Configs.java | Configs.modifyHavePathSelfConfig | public static void modifyHavePathSelfConfig(Map<IConfigKeyWithPath, String> modifyConfig) throws IOException {
"""
Modify self configs.
@param modifyConfig need update configs. If one value is null, will not update that one.
@throws IOException
"""
Map<String, Map<IConfigKeyWithPath, String>> conf... | java | public static void modifyHavePathSelfConfig(Map<IConfigKeyWithPath, String> modifyConfig) throws IOException {
Map<String, Map<IConfigKeyWithPath, String>> configPaths =
new HashMap<String, Map<IConfigKeyWithPath, String>>();
for (IConfigKeyWithPath configKeyWithPath : modifyConfig.ke... | [
"public",
"static",
"void",
"modifyHavePathSelfConfig",
"(",
"Map",
"<",
"IConfigKeyWithPath",
",",
"String",
">",
"modifyConfig",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Map",
"<",
"IConfigKeyWithPath",
",",
"String",
">",
">",
"configPat... | Modify self configs.
@param modifyConfig need update configs. If one value is null, will not update that one.
@throws IOException | [
"Modify",
"self",
"configs",
"."
] | train | https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/config/Configs.java#L549-L568 |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/ObjectWrapper.java | ObjectWrapper.setMappedValue | @SuppressWarnings("unchecked")
private static void setMappedValue(Object obj, Property property, Object key, Object value, ObjectWrapper options) {
"""
/*
Internal: Static version of {@link ObjectWrapper#setMappedValue(Property, Object, Object)}.
"""
if (property == null) {
throw new I... | java | @SuppressWarnings("unchecked")
private static void setMappedValue(Object obj, Property property, Object key, Object value, ObjectWrapper options) {
if (property == null) {
throw new IllegalArgumentException("Cannot set a new mapped value to a 'null' property.");
}
if (Map.class.... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"void",
"setMappedValue",
"(",
"Object",
"obj",
",",
"Property",
"property",
",",
"Object",
"key",
",",
"Object",
"value",
",",
"ObjectWrapper",
"options",
")",
"{",
"if",
"(",
"property"... | /*
Internal: Static version of {@link ObjectWrapper#setMappedValue(Property, Object, Object)}. | [
"/",
"*",
"Internal",
":",
"Static",
"version",
"of",
"{"
] | train | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L824-L849 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/JNRPELogger.java | JNRPELogger.fatal | public void fatal(final IJNRPEExecutionContext ctx, final String message) {
"""
Sends error level messages.
@param ctx the JNRPE context
@param message the message
"""
postEvent(ctx, new LogEvent(source, LogEventType.FATAL, message));
} | java | public void fatal(final IJNRPEExecutionContext ctx, final String message) {
postEvent(ctx, new LogEvent(source, LogEventType.FATAL, message));
} | [
"public",
"void",
"fatal",
"(",
"final",
"IJNRPEExecutionContext",
"ctx",
",",
"final",
"String",
"message",
")",
"{",
"postEvent",
"(",
"ctx",
",",
"new",
"LogEvent",
"(",
"source",
",",
"LogEventType",
".",
"FATAL",
",",
"message",
")",
")",
";",
"}"
] | Sends error level messages.
@param ctx the JNRPE context
@param message the message | [
"Sends",
"error",
"level",
"messages",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/JNRPELogger.java#L154-L156 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java | GlUtil.loadShader | public static int loadShader(int shaderType, String source) {
"""
Compiles the provided shader source.
@return A handle to the shader, or 0 on failure.
"""
int shader = GLES20.glCreateShader(shaderType);
checkGlError("glCreateShader type=" + shaderType);
GLES20.glShaderSource(shader,... | java | public static int loadShader(int shaderType, String source) {
int shader = GLES20.glCreateShader(shaderType);
checkGlError("glCreateShader type=" + shaderType);
GLES20.glShaderSource(shader, source);
GLES20.glCompileShader(shader);
int[] compiled = new int[1];
GLES20.glGe... | [
"public",
"static",
"int",
"loadShader",
"(",
"int",
"shaderType",
",",
"String",
"source",
")",
"{",
"int",
"shader",
"=",
"GLES20",
".",
"glCreateShader",
"(",
"shaderType",
")",
";",
"checkGlError",
"(",
"\"glCreateShader type=\"",
"+",
"shaderType",
")",
"... | Compiles the provided shader source.
@return A handle to the shader, or 0 on failure. | [
"Compiles",
"the",
"provided",
"shader",
"source",
"."
] | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/GlUtil.java#L86-L100 |
aboutsip/pkts | pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipParser.java | SipParser.consumeLWS | public static int consumeLWS(final Buffer buffer) throws SipParseException {
"""
Consume linear whitespace (LWS), which according to RFC3261 section 25.1
Basic Rules is:
LWS = [*WSP CRLF] 1*WSP ; linear whitespace
@param buffer
@return the number of bytes consumed
"""
final int i = buffer.getRe... | java | public static int consumeLWS(final Buffer buffer) throws SipParseException {
final int i = buffer.getReaderIndex();
consumeWS(buffer);
// if we consume a CRLF we expect at least ONE WS to be present next
if (consumeCRLF(buffer) > 0) {
expectWS(buffer);
}
cons... | [
"public",
"static",
"int",
"consumeLWS",
"(",
"final",
"Buffer",
"buffer",
")",
"throws",
"SipParseException",
"{",
"final",
"int",
"i",
"=",
"buffer",
".",
"getReaderIndex",
"(",
")",
";",
"consumeWS",
"(",
"buffer",
")",
";",
"// if we consume a CRLF we expect... | Consume linear whitespace (LWS), which according to RFC3261 section 25.1
Basic Rules is:
LWS = [*WSP CRLF] 1*WSP ; linear whitespace
@param buffer
@return the number of bytes consumed | [
"Consume",
"linear",
"whitespace",
"(",
"LWS",
")",
"which",
"according",
"to",
"RFC3261",
"section",
"25",
".",
"1",
"Basic",
"Rules",
"is",
":"
] | train | https://github.com/aboutsip/pkts/blob/0f06bb0dac76c812187829f580a8d476ca99a1a1/pkts-sip/src/main/java/io/pkts/packet/sip/impl/SipParser.java#L1668-L1681 |
Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaBatchOperations.java | MediaBatchOperations.parseParts | private List<DataSource> parseParts(final InputStream entityInputStream,
final String contentType) {
"""
Parses the parts.
@param entityInputStream
the entity input stream
@param contentType
the content type
@return the list
"""
try {
return parsePartsCore(entityInputStre... | java | private List<DataSource> parseParts(final InputStream entityInputStream,
final String contentType) {
try {
return parsePartsCore(entityInputStream, contentType);
} catch (IOException e) {
throw new RuntimeException(e);
} catch (MessagingException e) {
... | [
"private",
"List",
"<",
"DataSource",
">",
"parseParts",
"(",
"final",
"InputStream",
"entityInputStream",
",",
"final",
"String",
"contentType",
")",
"{",
"try",
"{",
"return",
"parsePartsCore",
"(",
"entityInputStream",
",",
"contentType",
")",
";",
"}",
"catc... | Parses the parts.
@param entityInputStream
the entity input stream
@param contentType
the content type
@return the list | [
"Parses",
"the",
"parts",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaBatchOperations.java#L433-L442 |
gresrun/jesque | src/main/java/net/greghaines/jesque/client/AbstractClient.java | AbstractClient.doEnqueue | public static void doEnqueue(final Jedis jedis, final String namespace, final String queue, final String jobJson) {
"""
Helper method that encapsulates the minimum logic for adding a job to a
queue.
@param jedis
the connection to Redis
@param namespace
the Resque namespace
@param queue
the Resque queue na... | java | public static void doEnqueue(final Jedis jedis, final String namespace, final String queue, final String jobJson) {
jedis.sadd(JesqueUtils.createKey(namespace, QUEUES), queue);
jedis.rpush(JesqueUtils.createKey(namespace, QUEUE, queue), jobJson);
} | [
"public",
"static",
"void",
"doEnqueue",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"namespace",
",",
"final",
"String",
"queue",
",",
"final",
"String",
"jobJson",
")",
"{",
"jedis",
".",
"sadd",
"(",
"JesqueUtils",
".",
"createKey",
"(",
"na... | Helper method that encapsulates the minimum logic for adding a job to a
queue.
@param jedis
the connection to Redis
@param namespace
the Resque namespace
@param queue
the Resque queue name
@param jobJson
the job serialized as JSON | [
"Helper",
"method",
"that",
"encapsulates",
"the",
"minimum",
"logic",
"for",
"adding",
"a",
"job",
"to",
"a",
"queue",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/client/AbstractClient.java#L217-L220 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optCharArray | @Nullable
public static char[] optCharArray(@Nullable Bundle bundle, @Nullable String key) {
"""
Returns a optional char array value. In other words, returns the value mapped by key if it exists and is a char array.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns ... | java | @Nullable
public static char[] optCharArray(@Nullable Bundle bundle, @Nullable String key) {
return optCharArray(bundle, key, new char[0]);
} | [
"@",
"Nullable",
"public",
"static",
"char",
"[",
"]",
"optCharArray",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
")",
"{",
"return",
"optCharArray",
"(",
"bundle",
",",
"key",
",",
"new",
"char",
"[",
"0",
"]",
")... | Returns a optional char array value. In other words, returns the value mapped by key if it exists and is a char array.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null.
@param bundle a bundle. If the bundle is null, this method will return null.
@param key a key for the... | [
"Returns",
"a",
"optional",
"char",
"array",
"value",
".",
"In",
"other",
"words",
"returns",
"the",
"value",
"mapped",
"by",
"key",
"if",
"it",
"exists",
"and",
"is",
"a",
"char",
"array",
".",
"The",
"bundle",
"argument",
"is",
"allowed",
"to",
"be",
... | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L299-L302 |
amaembo/streamex | src/main/java/one/util/streamex/EntryStream.java | EntryStream.ofPairs | public static <T> EntryStream<T, T> ofPairs(List<T> list) {
"""
Returns a sequential ordered {@code EntryStream} containing the possible
pairs of elements taken from the provided list.
<p>
Both keys and values are taken from the input list. The index of the key
is always strictly less than the index of the v... | java | public static <T> EntryStream<T, T> ofPairs(List<T> list) {
return of(new PairPermutationSpliterator<>(list, SimpleImmutableEntry::new));
} | [
"public",
"static",
"<",
"T",
">",
"EntryStream",
"<",
"T",
",",
"T",
">",
"ofPairs",
"(",
"List",
"<",
"T",
">",
"list",
")",
"{",
"return",
"of",
"(",
"new",
"PairPermutationSpliterator",
"<>",
"(",
"list",
",",
"SimpleImmutableEntry",
"::",
"new",
"... | Returns a sequential ordered {@code EntryStream} containing the possible
pairs of elements taken from the provided list.
<p>
Both keys and values are taken from the input list. The index of the key
is always strictly less than the index of the value. The pairs in the
stream are lexicographically ordered. For example, ... | [
"Returns",
"a",
"sequential",
"ordered",
"{",
"@code",
"EntryStream",
"}",
"containing",
"the",
"possible",
"pairs",
"of",
"elements",
"taken",
"from",
"the",
"provided",
"list",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/EntryStream.java#L2035-L2037 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.cherryPick | public GitlabCommit cherryPick(Serializable projectId, String sha, String targetBranchName) throws IOException {
"""
Cherry picks a commit.
@param projectId The id of the project
@param sha The sha of the commit
@param targetBranchName The branch on which the commit must be cherry-picked
... | java | public GitlabCommit cherryPick(Serializable projectId, String sha, String targetBranchName) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + "/repository/commits/" + sha + "/cherry_pick";
return retrieve().with("branch", targetBranchName).to(tailUrl, GitlabC... | [
"public",
"GitlabCommit",
"cherryPick",
"(",
"Serializable",
"projectId",
",",
"String",
"sha",
",",
"String",
"targetBranchName",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"URL",
"+",
"\"/\"",
"+",
"sanitizeProjectId",
"("... | Cherry picks a commit.
@param projectId The id of the project
@param sha The sha of the commit
@param targetBranchName The branch on which the commit must be cherry-picked
@return the commit of the cherry-pick.
@throws IOException on gitlab api call error | [
"Cherry",
"picks",
"a",
"commit",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L1539-L1542 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java | DiagnosticsInner.getSiteDetectorResponseSlotAsync | public Observable<DetectorResponseInner> getSiteDetectorResponseSlotAsync(String resourceGroupName, String siteName, String detectorName, String slot, DateTime startTime, DateTime endTime, String timeGrain) {
"""
Get site detector response.
Get site detector response.
@param resourceGroupName Name of the resou... | java | public Observable<DetectorResponseInner> getSiteDetectorResponseSlotAsync(String resourceGroupName, String siteName, String detectorName, String slot, DateTime startTime, DateTime endTime, String timeGrain) {
return getSiteDetectorResponseSlotWithServiceResponseAsync(resourceGroupName, siteName, detectorName, s... | [
"public",
"Observable",
"<",
"DetectorResponseInner",
">",
"getSiteDetectorResponseSlotAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"detectorName",
",",
"String",
"slot",
",",
"DateTime",
"startTime",
",",
"DateTime",
"endTime",
... | Get site detector response.
Get site detector response.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param detectorName Detector Resource Name
@param slot Slot Name
@param startTime Start Time
@param endTime End Time
@param timeGrain Time Grain
@throws I... | [
"Get",
"site",
"detector",
"response",
".",
"Get",
"site",
"detector",
"response",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java#L2322-L2329 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java | ChannelUpdateHandler.handleServerVoiceChannel | private void handleServerVoiceChannel(JsonNode jsonChannel) {
"""
Handles a server voice channel update.
@param jsonChannel The channel data.
"""
long channelId = jsonChannel.get("id").asLong();
api.getServerVoiceChannelById(channelId).map(ServerVoiceChannelImpl.class::cast).ifPresent(channe... | java | private void handleServerVoiceChannel(JsonNode jsonChannel) {
long channelId = jsonChannel.get("id").asLong();
api.getServerVoiceChannelById(channelId).map(ServerVoiceChannelImpl.class::cast).ifPresent(channel -> {
int oldBitrate = channel.getBitrate();
int newBitrate = jsonChann... | [
"private",
"void",
"handleServerVoiceChannel",
"(",
"JsonNode",
"jsonChannel",
")",
"{",
"long",
"channelId",
"=",
"jsonChannel",
".",
"get",
"(",
"\"id\"",
")",
".",
"asLong",
"(",
")",
";",
"api",
".",
"getServerVoiceChannelById",
"(",
"channelId",
")",
".",... | Handles a server voice channel update.
@param jsonChannel The channel data. | [
"Handles",
"a",
"server",
"voice",
"channel",
"update",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java#L318-L343 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_serviceInfos_GET | public OvhService organizationName_service_exchangeService_serviceInfos_GET(String organizationName, String exchangeService) throws IOException {
"""
Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/serviceInfos
@param organizationName [required] The internal na... | java | public OvhService organizationName_service_exchangeService_serviceInfos_GET(String organizationName, String exchangeService) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/serviceInfos";
StringBuilder sb = path(qPath, organizationName, exchangeService);
String re... | [
"public",
"OvhService",
"organizationName_service_exchangeService_serviceInfos_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/exchange/{organizationName}/service/{exchangeService}/service... | Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/serviceInfos
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L336-L341 |
dadoonet/fscrawler | framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/FsCrawlerUtil.java | FsCrawlerUtil.isExcluded | public static boolean isExcluded(String filename, List<String> excludes) {
"""
We check if we can index the file or if we should ignore it
@param filename The filename to scan
@param excludes exclude rules, may be empty not null
"""
logger.debug("filename = [{}], excludes = [{}]", filename, exclude... | java | public static boolean isExcluded(String filename, List<String> excludes) {
logger.debug("filename = [{}], excludes = [{}]", filename, excludes);
// No rules ? Fine, we index everything
if (excludes == null || excludes.isEmpty()) {
logger.trace("no rules");
return false;
... | [
"public",
"static",
"boolean",
"isExcluded",
"(",
"String",
"filename",
",",
"List",
"<",
"String",
">",
"excludes",
")",
"{",
"logger",
".",
"debug",
"(",
"\"filename = [{}], excludes = [{}]\"",
",",
"filename",
",",
"excludes",
")",
";",
"// No rules ? Fine, we ... | We check if we can index the file or if we should ignore it
@param filename The filename to scan
@param excludes exclude rules, may be empty not null | [
"We",
"check",
"if",
"we",
"can",
"index",
"the",
"file",
"or",
"if",
"we",
"should",
"ignore",
"it"
] | train | https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/FsCrawlerUtil.java#L200-L221 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java | DefaultReconfigurationProblem.buildReconfigurationPlan | @Override
@SuppressWarnings("squid:S3346")
public ReconfigurationPlan buildReconfigurationPlan(Solution s, Model src) throws SchedulerException {
"""
Build a plan for a solution.
@param s the solution
@param src the source model
@return the resulting plan
@throws SchedulerException if a error occurred
... | java | @Override
@SuppressWarnings("squid:S3346")
public ReconfigurationPlan buildReconfigurationPlan(Solution s, Model src) throws SchedulerException {
ReconfigurationPlan plan = new DefaultReconfigurationPlan(src);
for (NodeTransition action : nodeActions) {
action.insertActions(s, plan);... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"squid:S3346\"",
")",
"public",
"ReconfigurationPlan",
"buildReconfigurationPlan",
"(",
"Solution",
"s",
",",
"Model",
"src",
")",
"throws",
"SchedulerException",
"{",
"ReconfigurationPlan",
"plan",
"=",
"new",
"Default... | Build a plan for a solution.
@param s the solution
@param src the source model
@return the resulting plan
@throws SchedulerException if a error occurred | [
"Build",
"a",
"plan",
"for",
"a",
"solution",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/DefaultReconfigurationProblem.java#L304-L319 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleryField.java | CmsGalleryField.displayResourceInfo | void displayResourceInfo(CmsResultItemBean info) {
"""
Displays the resource info.<p>
@param info the resource info
"""
if (m_hasImage) {
setImagePreview(info.getPath(), info.getViewLink());
m_resourceInfoPanel.add(new CmsImageInfo(info, info.getDimension()));
} else... | java | void displayResourceInfo(CmsResultItemBean info) {
if (m_hasImage) {
setImagePreview(info.getPath(), info.getViewLink());
m_resourceInfoPanel.add(new CmsImageInfo(info, info.getDimension()));
} else {
CmsListItemWidget widget = new CmsListItemWidget(info);
... | [
"void",
"displayResourceInfo",
"(",
"CmsResultItemBean",
"info",
")",
"{",
"if",
"(",
"m_hasImage",
")",
"{",
"setImagePreview",
"(",
"info",
".",
"getPath",
"(",
")",
",",
"info",
".",
"getViewLink",
"(",
")",
")",
";",
"m_resourceInfoPanel",
".",
"add",
... | Displays the resource info.<p>
@param info the resource info | [
"Displays",
"the",
"resource",
"info",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsGalleryField.java#L674-L691 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java | DateFormat.getDateTimeInstance | static final public DateFormat getDateTimeInstance(Calendar cal, int dateStyle, int timeStyle) {
"""
Creates a {@link DateFormat} object for the default locale that can be used to format
dates and times in the calendar system specified by <code>cal</code>.
@param cal The calendar system for which a date/time f... | java | static final public DateFormat getDateTimeInstance(Calendar cal, int dateStyle, int timeStyle) {
return getDateTimeInstance(cal, dateStyle, timeStyle, ULocale.getDefault(Category.FORMAT));
} | [
"static",
"final",
"public",
"DateFormat",
"getDateTimeInstance",
"(",
"Calendar",
"cal",
",",
"int",
"dateStyle",
",",
"int",
"timeStyle",
")",
"{",
"return",
"getDateTimeInstance",
"(",
"cal",
",",
"dateStyle",
",",
"timeStyle",
",",
"ULocale",
".",
"getDefaul... | Creates a {@link DateFormat} object for the default locale that can be used to format
dates and times in the calendar system specified by <code>cal</code>.
@param cal The calendar system for which a date/time format is desired.
@param dateStyle The type of date format desired. This can be
{@link DateFormat#SHORT}, ... | [
"Creates",
"a",
"{",
"@link",
"DateFormat",
"}",
"object",
"for",
"the",
"default",
"locale",
"that",
"can",
"be",
"used",
"to",
"format",
"dates",
"and",
"times",
"in",
"the",
"calendar",
"system",
"specified",
"by",
"<code",
">",
"cal<",
"/",
"code",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java#L1937-L1939 |
alkacon/opencms-core | src/org/opencms/file/CmsLinkRewriter.java | CmsLinkRewriter.rewriteContent | protected void rewriteContent(CmsFile file, Collection<CmsRelation> relations) throws CmsException {
"""
Rewrites the links included in the content itself.<p>
@param file the file for which the links should be replaced
@param relations the original relations
@throws CmsException if something goes wrong
... | java | protected void rewriteContent(CmsFile file, Collection<CmsRelation> relations) throws CmsException {
LOG.info("Rewriting in-content links for " + file.getRootPath());
CmsPair<String, String> contentAndEncoding = decode(file);
String content = "";
if (OpenCms.getResourceManager().getRe... | [
"protected",
"void",
"rewriteContent",
"(",
"CmsFile",
"file",
",",
"Collection",
"<",
"CmsRelation",
">",
"relations",
")",
"throws",
"CmsException",
"{",
"LOG",
".",
"info",
"(",
"\"Rewriting in-content links for \"",
"+",
"file",
".",
"getRootPath",
"(",
")",
... | Rewrites the links included in the content itself.<p>
@param file the file for which the links should be replaced
@param relations the original relations
@throws CmsException if something goes wrong | [
"Rewrites",
"the",
"links",
"included",
"in",
"the",
"content",
"itself",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsLinkRewriter.java#L607-L644 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.deleteRelationsForResource | public void deleteRelationsForResource(CmsDbContext dbc, CmsResource resource, CmsRelationFilter filter)
throws CmsException {
"""
Deletes all relations for the given resource matching the given filter.<p>
@param dbc the current db context
@param resource the resource to delete the relations for
@param fi... | java | public void deleteRelationsForResource(CmsDbContext dbc, CmsResource resource, CmsRelationFilter filter)
throws CmsException {
if (filter.includesDefinedInContent()) {
throw new CmsIllegalArgumentException(
Messages.get().container(
Messages.ERR_DELETE_RELATI... | [
"public",
"void",
"deleteRelationsForResource",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"CmsRelationFilter",
"filter",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"filter",
".",
"includesDefinedInContent",
"(",
")",
")",
"{",
"throw",
"... | Deletes all relations for the given resource matching the given filter.<p>
@param dbc the current db context
@param resource the resource to delete the relations for
@param filter the filter to use for deletion
@throws CmsException if something goes wrong
@see CmsSecurityManager#deleteRelationsForResource(CmsRequest... | [
"Deletes",
"all",
"relations",
"for",
"the",
"given",
"resource",
"matching",
"the",
"given",
"filter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L2803-L2823 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/HELM2NotationUtils.java | HELM2NotationUtils.combineHELM2notation | public final static void combineHELM2notation(HELM2Notation helm2notation, HELM2Notation newHELM2Notation) throws NotationException {
"""
method to add a new HELMNotation to another HELM2Notation, the new
HELM2Notation will be merged to the first HELM2Notation
@param helm2notation HELM2Notation
@param newHELM... | java | public final static void combineHELM2notation(HELM2Notation helm2notation, HELM2Notation newHELM2Notation) throws NotationException {
HELM2NotationUtils.helm2notation = helm2notation;
Map<String, String> mapIds = generateMapChangeIds(newHELM2Notation.getPolymerAndGroupingIDs());
/* method to merge the ne... | [
"public",
"final",
"static",
"void",
"combineHELM2notation",
"(",
"HELM2Notation",
"helm2notation",
",",
"HELM2Notation",
"newHELM2Notation",
")",
"throws",
"NotationException",
"{",
"HELM2NotationUtils",
".",
"helm2notation",
"=",
"helm2notation",
";",
"Map",
"<",
"Str... | method to add a new HELMNotation to another HELM2Notation, the new
HELM2Notation will be merged to the first HELM2Notation
@param helm2notation HELM2Notation
@param newHELM2Notation new HELMNotation
@throws NotationException if the HELMNotation is not valid | [
"method",
"to",
"add",
"a",
"new",
"HELMNotation",
"to",
"another",
"HELM2Notation",
"the",
"new",
"HELM2Notation",
"will",
"be",
"merged",
"to",
"the",
"first",
"HELM2Notation"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/HELM2NotationUtils.java#L199-L212 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray.toArray | public static Object toArray( JSONArray jsonArray, Class objectClass, Map classMap ) {
"""
Creates a java array from a JSONArray.<br>
Any attribute is a JSONObject and matches a key in the classMap, it will
be converted to that target class.<br>
The classMap has the following conventions:
<ul>
<li>Every key m... | java | public static Object toArray( JSONArray jsonArray, Class objectClass, Map classMap ) {
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.setRootClass( objectClass );
jsonConfig.setClassMap( classMap );
return toArray( jsonArray, jsonConfig );
} | [
"public",
"static",
"Object",
"toArray",
"(",
"JSONArray",
"jsonArray",
",",
"Class",
"objectClass",
",",
"Map",
"classMap",
")",
"{",
"JsonConfig",
"jsonConfig",
"=",
"new",
"JsonConfig",
"(",
")",
";",
"jsonConfig",
".",
"setRootClass",
"(",
"objectClass",
"... | Creates a java array from a JSONArray.<br>
Any attribute is a JSONObject and matches a key in the classMap, it will
be converted to that target class.<br>
The classMap has the following conventions:
<ul>
<li>Every key must be an String.</li>
<li>Every value must be a Class.</li>
<li>A key may be a regular expression.</... | [
"Creates",
"a",
"java",
"array",
"from",
"a",
"JSONArray",
".",
"<br",
">",
"Any",
"attribute",
"is",
"a",
"JSONObject",
"and",
"matches",
"a",
"key",
"in",
"the",
"classMap",
"it",
"will",
"be",
"converted",
"to",
"that",
"target",
"class",
".",
"<br",
... | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L215-L220 |
grpc/grpc-java | alts/src/main/java/io/grpc/alts/internal/AltsFraming.java | AltsFraming.toFrame | static ByteBuffer toFrame(ByteBuffer input, int dataSize) throws GeneralSecurityException {
"""
Creates a frame of length dataSize + FRAME_HEADER_SIZE using the input bytes, if dataSize <=
input.remaining(). Otherwise, a frame of length input.remaining() + FRAME_HEADER_SIZE is
created.
"""
Preconditions.... | java | static ByteBuffer toFrame(ByteBuffer input, int dataSize) throws GeneralSecurityException {
Preconditions.checkNotNull(input);
if (dataSize > input.remaining()) {
dataSize = input.remaining();
}
Producer producer = new Producer();
ByteBuffer inputAlias = input.duplicate();
inputAlias.limit... | [
"static",
"ByteBuffer",
"toFrame",
"(",
"ByteBuffer",
"input",
",",
"int",
"dataSize",
")",
"throws",
"GeneralSecurityException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"input",
")",
";",
"if",
"(",
"dataSize",
">",
"input",
".",
"remaining",
"(",
")"... | Creates a frame of length dataSize + FRAME_HEADER_SIZE using the input bytes, if dataSize <=
input.remaining(). Otherwise, a frame of length input.remaining() + FRAME_HEADER_SIZE is
created. | [
"Creates",
"a",
"frame",
"of",
"length",
"dataSize",
"+",
"FRAME_HEADER_SIZE",
"using",
"the",
"input",
"bytes",
"if",
"dataSize",
"<",
"=",
"input",
".",
"remaining",
"()",
".",
"Otherwise",
"a",
"frame",
"of",
"length",
"input",
".",
"remaining",
"()",
"... | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/alts/src/main/java/io/grpc/alts/internal/AltsFraming.java#L59-L72 |
Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java | AbstractHostPartitionConnectionPool.removeHost | @Override
public synchronized boolean removeHost(Host host, boolean refresh) {
"""
Remove host from the system. Shuts down pool associated with the host and rebuilds partition map
@param host
@param refresh
"""
HostConnectionPool<CL> pool = hosts.remove(host);
if (pool != null) {
... | java | @Override
public synchronized boolean removeHost(Host host, boolean refresh) {
HostConnectionPool<CL> pool = hosts.remove(host);
if (pool != null) {
topology.removePool(pool);
rebuildPartitions();
monitor.onHostRemoved(host);
pool.shutdown();
... | [
"@",
"Override",
"public",
"synchronized",
"boolean",
"removeHost",
"(",
"Host",
"host",
",",
"boolean",
"refresh",
")",
"{",
"HostConnectionPool",
"<",
"CL",
">",
"pool",
"=",
"hosts",
".",
"remove",
"(",
"host",
")",
";",
"if",
"(",
"pool",
"!=",
"null... | Remove host from the system. Shuts down pool associated with the host and rebuilds partition map
@param host
@param refresh | [
"Remove",
"host",
"from",
"the",
"system",
".",
"Shuts",
"down",
"pool",
"associated",
"with",
"the",
"host",
"and",
"rebuilds",
"partition",
"map"
] | train | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java#L277-L290 |
liferay/com-liferay-commerce | commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java | CommerceWishListPersistenceImpl.countByG_U_D | @Override
public int countByG_U_D(long groupId, long userId, boolean defaultWishList) {
"""
Returns the number of commerce wish lists where groupId = ? and userId = ? and defaultWishList = ?.
@param groupId the group ID
@param userId the user ID
@param defaultWishList the default wish list
@retu... | java | @Override
public int countByG_U_D(long groupId, long userId, boolean defaultWishList) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_U_D;
Object[] finderArgs = new Object[] { groupId, userId, defaultWishList };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
... | [
"@",
"Override",
"public",
"int",
"countByG_U_D",
"(",
"long",
"groupId",
",",
"long",
"userId",
",",
"boolean",
"defaultWishList",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_G_U_D",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Objec... | Returns the number of commerce wish lists where groupId = ? and userId = ? and defaultWishList = ?.
@param groupId the group ID
@param userId the user ID
@param defaultWishList the default wish list
@return the number of matching commerce wish lists | [
"Returns",
"the",
"number",
"of",
"commerce",
"wish",
"lists",
"where",
"groupId",
"=",
"?",
";",
"and",
"userId",
"=",
"?",
";",
"and",
"defaultWishList",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java#L4149-L4200 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/QuantilesHelper.java | QuantilesHelper.searchForChunkContainingPos | private static int searchForChunkContainingPos(final long[] arr, final long pos, final int l, final int r) {
"""
Observe that they are satisfied by the initial conditions: l = 0 and r = len.
"""
// the following three asserts can probably go away eventually, since it is fairly clear
// that if these i... | java | private static int searchForChunkContainingPos(final long[] arr, final long pos, final int l, final int r) {
// the following three asserts can probably go away eventually, since it is fairly clear
// that if these invariants hold at the beginning of the search, they will be maintained
assert l < r;
ass... | [
"private",
"static",
"int",
"searchForChunkContainingPos",
"(",
"final",
"long",
"[",
"]",
"arr",
",",
"final",
"long",
"pos",
",",
"final",
"int",
"l",
",",
"final",
"int",
"r",
")",
"{",
"// the following three asserts can probably go away eventually, since it is fa... | Observe that they are satisfied by the initial conditions: l = 0 and r = len. | [
"Observe",
"that",
"they",
"are",
"satisfied",
"by",
"the",
"initial",
"conditions",
":",
"l",
"=",
"0",
"and",
"r",
"=",
"len",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/QuantilesHelper.java#L74-L88 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.applyMethodTarget | public static MethodCallExpression applyMethodTarget(final MethodCallExpression methodCallExpression, final ClassNode targetClassNode, final ClassNode... targetParameterTypes) {
"""
Set the method target of a MethodCallExpression to the first matching method with same number and type of arguments.
A null parame... | java | public static MethodCallExpression applyMethodTarget(final MethodCallExpression methodCallExpression, final ClassNode targetClassNode, final ClassNode... targetParameterTypes) {
String methodName = methodCallExpression.getMethodAsString();
if(methodName==null) return methodCallExpression;
int ar... | [
"public",
"static",
"MethodCallExpression",
"applyMethodTarget",
"(",
"final",
"MethodCallExpression",
"methodCallExpression",
",",
"final",
"ClassNode",
"targetClassNode",
",",
"final",
"ClassNode",
"...",
"targetParameterTypes",
")",
"{",
"String",
"methodName",
"=",
"m... | Set the method target of a MethodCallExpression to the first matching method with same number and type of arguments.
A null parameter type will match any type
@param methodCallExpression
@param targetClassNode
@param targetParameterTypes
@return The method call expression | [
"Set",
"the",
"method",
"target",
"of",
"a",
"MethodCallExpression",
"to",
"the",
"first",
"matching",
"method",
"with",
"same",
"number",
"and",
"type",
"of",
"arguments",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1225-L1246 |
ksclarke/vertx-pairtree | src/main/java/info/freelibrary/pairtree/s3/S3Client.java | S3Client.createDeleteRequest | public S3ClientRequest createDeleteRequest(final String aBucket, final String aKey,
final Handler<HttpClientResponse> aHandler) {
"""
Creates an S3 DELETE request.
<p>
<code>create DELETE -> request Object</code>
</p>
@param aBucket An S3 bucket
@param aKey An S3 key
@param aHandler An S3 ha... | java | public S3ClientRequest createDeleteRequest(final String aBucket, final String aKey,
final Handler<HttpClientResponse> aHandler) {
final HttpClientRequest httpRequest = myHTTPClient.delete(PATH_SEP + aBucket + PATH_SEP + aKey, aHandler);
return new S3ClientRequest("DELETE", aBucket, aKey, htt... | [
"public",
"S3ClientRequest",
"createDeleteRequest",
"(",
"final",
"String",
"aBucket",
",",
"final",
"String",
"aKey",
",",
"final",
"Handler",
"<",
"HttpClientResponse",
">",
"aHandler",
")",
"{",
"final",
"HttpClientRequest",
"httpRequest",
"=",
"myHTTPClient",
".... | Creates an S3 DELETE request.
<p>
<code>create DELETE -> request Object</code>
</p>
@param aBucket An S3 bucket
@param aKey An S3 key
@param aHandler An S3 handler
@return An S3 client request | [
"Creates",
"an",
"S3",
"DELETE",
"request",
".",
"<p",
">",
"<code",
">",
"create",
"DELETE",
"-",
">",
";",
"request",
"Object<",
"/",
"code",
">",
"<",
"/",
"p",
">"
] | train | https://github.com/ksclarke/vertx-pairtree/blob/b2ea1e32057e5df262e9265540d346a732b718df/src/main/java/info/freelibrary/pairtree/s3/S3Client.java#L302-L306 |
google/closure-compiler | src/com/google/javascript/jscomp/DestructuredTarget.java | DestructuredTarget.createAllNonEmptyTargetsInPattern | static ImmutableList<DestructuredTarget> createAllNonEmptyTargetsInPattern(
JSTypeRegistry registry, JSType patternType, Node pattern) {
"""
Returns all the targets directly in the given pattern, except for EMPTY nodes
<p>EMPTY nodes occur in array patterns with elisions, e.g. `[, , a] = []`
"""
r... | java | static ImmutableList<DestructuredTarget> createAllNonEmptyTargetsInPattern(
JSTypeRegistry registry, JSType patternType, Node pattern) {
return createAllNonEmptyTargetsInPattern(registry, () -> patternType, pattern);
} | [
"static",
"ImmutableList",
"<",
"DestructuredTarget",
">",
"createAllNonEmptyTargetsInPattern",
"(",
"JSTypeRegistry",
"registry",
",",
"JSType",
"patternType",
",",
"Node",
"pattern",
")",
"{",
"return",
"createAllNonEmptyTargetsInPattern",
"(",
"registry",
",",
"(",
"... | Returns all the targets directly in the given pattern, except for EMPTY nodes
<p>EMPTY nodes occur in array patterns with elisions, e.g. `[, , a] = []` | [
"Returns",
"all",
"the",
"targets",
"directly",
"in",
"the",
"given",
"pattern",
"except",
"for",
"EMPTY",
"nodes"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DestructuredTarget.java#L240-L243 |
micrometer-metrics/micrometer | micrometer-spring-legacy/src/main/java/io/micrometer/spring/cache/ConcurrentMapCacheMetrics.java | ConcurrentMapCacheMetrics.monitor | public static ConcurrentMapCache monitor(MeterRegistry registry, ConcurrentMapCache cache, String... tags) {
"""
Record metrics on a ConcurrentMapCache cache.
@param registry The registry to bind metrics to.
@param cache The cache to instrument.
@param tags Tags to apply to all recorded metrics. Must b... | java | public static ConcurrentMapCache monitor(MeterRegistry registry, ConcurrentMapCache cache, String... tags) {
return monitor(registry, cache, Tags.of(tags));
} | [
"public",
"static",
"ConcurrentMapCache",
"monitor",
"(",
"MeterRegistry",
"registry",
",",
"ConcurrentMapCache",
"cache",
",",
"String",
"...",
"tags",
")",
"{",
"return",
"monitor",
"(",
"registry",
",",
"cache",
",",
"Tags",
".",
"of",
"(",
"tags",
")",
"... | Record metrics on a ConcurrentMapCache cache.
@param registry The registry to bind metrics to.
@param cache The cache to instrument.
@param tags Tags to apply to all recorded metrics. Must be an even number of arguments representing key/value pairs of tags.
@return The instrumented cache, unchanged. The origina... | [
"Record",
"metrics",
"on",
"a",
"ConcurrentMapCache",
"cache",
"."
] | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-spring-legacy/src/main/java/io/micrometer/spring/cache/ConcurrentMapCacheMetrics.java#L42-L44 |
quattor/pan | panc/src/main/java/org/quattor/pan/ttemplate/CompileTimeContext.java | CompileTimeContext.setLocalVariable | public void setLocalVariable(String name, Element value)
throws EvaluationException {
"""
Set the local variable to the given value. If the value is null, then the
corresponding variable will be removed. If there is a global variable of
the same name, then an EvaluationException will be thrown. This method
d... | java | public void setLocalVariable(String name, Element value)
throws EvaluationException {
assert (name != null);
localVariables.put(name, value);
} | [
"public",
"void",
"setLocalVariable",
"(",
"String",
"name",
",",
"Element",
"value",
")",
"throws",
"EvaluationException",
"{",
"assert",
"(",
"name",
"!=",
"null",
")",
";",
"localVariables",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Set the local variable to the given value. If the value is null, then the
corresponding variable will be removed. If there is a global variable of
the same name, then an EvaluationException will be thrown. This method
does not allow children of the referenced value to be set.
@param name
name of the local variable
@pa... | [
"Set",
"the",
"local",
"variable",
"to",
"the",
"given",
"value",
".",
"If",
"the",
"value",
"is",
"null",
"then",
"the",
"corresponding",
"variable",
"will",
"be",
"removed",
".",
"If",
"there",
"is",
"a",
"global",
"variable",
"of",
"the",
"same",
"nam... | train | https://github.com/quattor/pan/blob/009934a603dd0c08d3fa4bb7d9389c380a916f54/panc/src/main/java/org/quattor/pan/ttemplate/CompileTimeContext.java#L767-L773 |
radkovo/CSSBox | src/main/java/org/fit/cssbox/layout/HTMLBoxFactory.java | HTMLBoxFactory.createBox | public ElementBox createBox(ElementBox parent, Element e, Viewport viewport, NodeData style) {
"""
Creates the box according to the HTML element.
@param parent The box in the main box tree to be used as a parent box for the new box.
@param e The element to be processed.
@param viewport The viewport to be used f... | java | public ElementBox createBox(ElementBox parent, Element e, Viewport viewport, NodeData style)
{
String name = e.getNodeName().toLowerCase();
if (name.equals("object"))
return createSubtreeObject(parent, e, viewport, style);
else if (name.equals("img"))
return createSub... | [
"public",
"ElementBox",
"createBox",
"(",
"ElementBox",
"parent",
",",
"Element",
"e",
",",
"Viewport",
"viewport",
",",
"NodeData",
"style",
")",
"{",
"String",
"name",
"=",
"e",
".",
"getNodeName",
"(",
")",
".",
"toLowerCase",
"(",
")",
";",
"if",
"("... | Creates the box according to the HTML element.
@param parent The box in the main box tree to be used as a parent box for the new box.
@param e The element to be processed.
@param viewport The viewport to be used for the new box.
@param style The style of the element.
@return The newly created box or <code>null</code> w... | [
"Creates",
"the",
"box",
"according",
"to",
"the",
"HTML",
"element",
"."
] | train | https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/HTMLBoxFactory.java#L96-L113 |
pmlopes/yoke | framework/src/main/java/com/jetdrone/vertx/yoke/Yoke.java | Yoke.set | public Yoke set(@NotNull String key, Object value) {
"""
When you need to share global properties with your requests you can add them
to Yoke and on every request they will be available as request.get(String)
@param key unique identifier
@param value Any non null value, nulls are not saved
"""
i... | java | public Yoke set(@NotNull String key, Object value) {
if (value == null) {
defaultContext.remove(key);
} else {
defaultContext.put(key, value);
}
return this;
} | [
"public",
"Yoke",
"set",
"(",
"@",
"NotNull",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"defaultContext",
".",
"remove",
"(",
"key",
")",
";",
"}",
"else",
"{",
"defaultContext",
".",
"put",
"(",
... | When you need to share global properties with your requests you can add them
to Yoke and on every request they will be available as request.get(String)
@param key unique identifier
@param value Any non null value, nulls are not saved | [
"When",
"you",
"need",
"to",
"share",
"global",
"properties",
"with",
"your",
"requests",
"you",
"can",
"add",
"them",
"to",
"Yoke",
"and",
"on",
"every",
"request",
"they",
"will",
"be",
"available",
"as",
"request",
".",
"get",
"(",
"String",
")"
] | train | https://github.com/pmlopes/yoke/blob/fe8a64036f09fb745f0644faddd46162d64faf3c/framework/src/main/java/com/jetdrone/vertx/yoke/Yoke.java#L385-L393 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.importData | public static <E extends Exception> int importData(final DataSet dataset, final int offset, final int count,
final Try.Predicate<? super Object[], E> filter, final Connection conn, final String insertSQL, final int batchSize, final int batchInterval,
final Try.BiConsumer<? super PreparedStatem... | java | public static <E extends Exception> int importData(final DataSet dataset, final int offset, final int count,
final Try.Predicate<? super Object[], E> filter, final Connection conn, final String insertSQL, final int batchSize, final int batchInterval,
final Try.BiConsumer<? super PreparedStatem... | [
"public",
"static",
"<",
"E",
"extends",
"Exception",
">",
"int",
"importData",
"(",
"final",
"DataSet",
"dataset",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"count",
",",
"final",
"Try",
".",
"Predicate",
"<",
"?",
"super",
"Object",
"[",
"]",... | Imports the data from <code>DataSet</code> to database.
@param dataset
@param offset
@param count
@param filter
@param conn
@param insertSQL the column order in the sql must be consistent with the column order in the DataSet. Here is sample about how to create the sql:
<pre><code>
List<String> columnNameList = new Arr... | [
"Imports",
"the",
"data",
"from",
"<code",
">",
"DataSet<",
"/",
"code",
">",
"to",
"database",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L2152-L2166 |
integration-technology/amazon-mws-orders | src/main/java/com/amazonservices/mws/client/MwsConnection.java | MwsConnection.getServiceEndpoint | ServiceEndpoint getServiceEndpoint(String servicePath) {
"""
Get a MwsServiceUri for the servicePath.
@param servicePath
The service name and version as name/version, no leading or
trailing slash.
@return The service endpoint instance.
"""
synchronized (serviceMap) {
ServiceEndpoint... | java | ServiceEndpoint getServiceEndpoint(String servicePath) {
synchronized (serviceMap) {
ServiceEndpoint sep = serviceMap.get(servicePath);
if (sep == null) {
sep = new ServiceEndpoint(endpoint, servicePath);
serviceMap.put(servicePath, sep);
}
... | [
"ServiceEndpoint",
"getServiceEndpoint",
"(",
"String",
"servicePath",
")",
"{",
"synchronized",
"(",
"serviceMap",
")",
"{",
"ServiceEndpoint",
"sep",
"=",
"serviceMap",
".",
"get",
"(",
"servicePath",
")",
";",
"if",
"(",
"sep",
"==",
"null",
")",
"{",
"se... | Get a MwsServiceUri for the servicePath.
@param servicePath
The service name and version as name/version, no leading or
trailing slash.
@return The service endpoint instance. | [
"Get",
"a",
"MwsServiceUri",
"for",
"the",
"servicePath",
"."
] | train | https://github.com/integration-technology/amazon-mws-orders/blob/042e8cd5b10588a30150222bf9c91faf4f130b3c/src/main/java/com/amazonservices/mws/client/MwsConnection.java#L394-L403 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java | GlobalUsersInner.getOperationBatchStatus | public OperationBatchStatusResponseInner getOperationBatchStatus(String userName, List<String> urls) {
"""
Get batch operation status.
@param userName The name of the user.
@param urls The operation url of long running operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throw... | java | public OperationBatchStatusResponseInner getOperationBatchStatus(String userName, List<String> urls) {
return getOperationBatchStatusWithServiceResponseAsync(userName, urls).toBlocking().single().body();
} | [
"public",
"OperationBatchStatusResponseInner",
"getOperationBatchStatus",
"(",
"String",
"userName",
",",
"List",
"<",
"String",
">",
"urls",
")",
"{",
"return",
"getOperationBatchStatusWithServiceResponseAsync",
"(",
"userName",
",",
"urls",
")",
".",
"toBlocking",
"("... | Get batch operation status.
@param userName The name of the user.
@param urls The operation url of long running operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked excep... | [
"Get",
"batch",
"operation",
"status",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L296-L298 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/utils/TextUtils.java | TextUtils.joinEscaped | public static String joinEscaped(String[] input, char separator, char echar, char[] special) {
"""
Join an array of strings with the given separator, escape char, and other special chars for escaping
@param input input string
@param separator separator
@param echar escape char
@param special all sp... | java | public static String joinEscaped(String[] input, char separator, char echar, char[] special) {
StringBuilder sb = new StringBuilder();
char[] schars = new char[(special != null ? special.length : 0) + 1];
if (special != null && special.length > 0) {
System.arraycopy(special, 0, schar... | [
"public",
"static",
"String",
"joinEscaped",
"(",
"String",
"[",
"]",
"input",
",",
"char",
"separator",
",",
"char",
"echar",
",",
"char",
"[",
"]",
"special",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"char",
"[",
"... | Join an array of strings with the given separator, escape char, and other special chars for escaping
@param input input string
@param separator separator
@param echar escape char
@param special all special chars not necessarily including the echar or separator
@return joined string | [
"Join",
"an",
"array",
"of",
"strings",
"with",
"the",
"given",
"separator",
"escape",
"char",
"and",
"other",
"special",
"chars",
"for",
"escaping"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/utils/TextUtils.java#L192-L206 |
davidmoten/geo | geo/src/main/java/com/github/davidmoten/geo/GeoHash.java | GeoHash.adjacentHash | public static String adjacentHash(String hash, Direction direction, int steps) {
"""
Returns the adjacent hash N steps in the given {@link Direction}. A
negative N will use the opposite {@link Direction}.
@param hash
origin hash
@param direction
to desired hash
@param steps
number of hashes distance to de... | java | public static String adjacentHash(String hash, Direction direction, int steps) {
if (steps < 0)
return adjacentHash(hash, direction.opposite(), Math.abs(steps));
else {
String h = hash;
for (int i = 0; i < steps; i++)
h = adjacentHash(h, direction);
... | [
"public",
"static",
"String",
"adjacentHash",
"(",
"String",
"hash",
",",
"Direction",
"direction",
",",
"int",
"steps",
")",
"{",
"if",
"(",
"steps",
"<",
"0",
")",
"return",
"adjacentHash",
"(",
"hash",
",",
"direction",
".",
"opposite",
"(",
")",
",",... | Returns the adjacent hash N steps in the given {@link Direction}. A
negative N will use the opposite {@link Direction}.
@param hash
origin hash
@param direction
to desired hash
@param steps
number of hashes distance to desired hash
@return hash at position in direction a number of hashes away (steps) | [
"Returns",
"the",
"adjacent",
"hash",
"N",
"steps",
"in",
"the",
"given",
"{",
"@link",
"Direction",
"}",
".",
"A",
"negative",
"N",
"will",
"use",
"the",
"opposite",
"{",
"@link",
"Direction",
"}",
"."
] | train | https://github.com/davidmoten/geo/blob/e90d2f406133cd9b60d54a3e6bdb7423d7fcce37/geo/src/main/java/com/github/davidmoten/geo/GeoHash.java#L261-L270 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java | MiniTemplator.setVariable | public void setVariable(String variableName, int variableValue) throws VariableNotDefinedException {
"""
Sets a template variable to an integer value.
<p>
Convenience method for: <code>setVariable (variableName, Integer.toString(variableValue))</code>
@param variableName the name of the variable to be set. Ca... | java | public void setVariable(String variableName, int variableValue) throws VariableNotDefinedException {
setVariable(variableName, Integer.toString(variableValue));
} | [
"public",
"void",
"setVariable",
"(",
"String",
"variableName",
",",
"int",
"variableValue",
")",
"throws",
"VariableNotDefinedException",
"{",
"setVariable",
"(",
"variableName",
",",
"Integer",
".",
"toString",
"(",
"variableValue",
")",
")",
";",
"}"
] | Sets a template variable to an integer value.
<p>
Convenience method for: <code>setVariable (variableName, Integer.toString(variableValue))</code>
@param variableName the name of the variable to be set. Case-insensitive.
@param variableValue the new value of the variable.
@throws VariableNotDefinedException when no va... | [
"Sets",
"a",
"template",
"variable",
"to",
"an",
"integer",
"value",
".",
"<p",
">",
"Convenience",
"method",
"for",
":",
"<code",
">",
"setVariable",
"(",
"variableName",
"Integer",
".",
"toString",
"(",
"variableValue",
"))",
"<",
"/",
"code",
">"
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L400-L402 |
graphql-java/graphql-java | src/main/java/graphql/execution/ExecutionStrategy.java | ExecutionStrategy.getFieldDef | protected GraphQLFieldDefinition getFieldDef(ExecutionContext executionContext, ExecutionStrategyParameters parameters, Field field) {
"""
Called to discover the field definition give the current parameters and the AST {@link Field}
@param executionContext contains the top level execution parameters
@param par... | java | protected GraphQLFieldDefinition getFieldDef(ExecutionContext executionContext, ExecutionStrategyParameters parameters, Field field) {
GraphQLObjectType parentType = (GraphQLObjectType) parameters.getExecutionStepInfo().getUnwrappedNonNullType();
return getFieldDef(executionContext.getGraphQLSchema(), p... | [
"protected",
"GraphQLFieldDefinition",
"getFieldDef",
"(",
"ExecutionContext",
"executionContext",
",",
"ExecutionStrategyParameters",
"parameters",
",",
"Field",
"field",
")",
"{",
"GraphQLObjectType",
"parentType",
"=",
"(",
"GraphQLObjectType",
")",
"parameters",
".",
... | Called to discover the field definition give the current parameters and the AST {@link Field}
@param executionContext contains the top level execution parameters
@param parameters contains the parameters holding the fields to be executed and source object
@param field the field to find the definition ... | [
"Called",
"to",
"discover",
"the",
"field",
"definition",
"give",
"the",
"current",
"parameters",
"and",
"the",
"AST",
"{",
"@link",
"Field",
"}"
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/ExecutionStrategy.java#L699-L702 |
Labs64/swid-generator | src/main/java/com/labs64/utils/swid/support/SwidUtils.java | SwidUtils.generateRegId | public static String generateRegId(final String domainCreationDate, final String reverseDomainName) {
"""
Generate RegId.
@param domainCreationDate
the date at which the entity creating the regid first owned the domain that is also used in the regid
in year-month format; e.g. 2010-04
@param reverseDomainName... | java | public static String generateRegId(final String domainCreationDate, final String reverseDomainName) {
return generateRegId(domainCreationDate, reverseDomainName, null);
} | [
"public",
"static",
"String",
"generateRegId",
"(",
"final",
"String",
"domainCreationDate",
",",
"final",
"String",
"reverseDomainName",
")",
"{",
"return",
"generateRegId",
"(",
"domainCreationDate",
",",
"reverseDomainName",
",",
"null",
")",
";",
"}"
] | Generate RegId.
@param domainCreationDate
the date at which the entity creating the regid first owned the domain that is also used in the regid
in year-month format; e.g. 2010-04
@param reverseDomainName
the domain of the entity, in reverse order; e.g. com.labs64
@return generated RegId | [
"Generate",
"RegId",
"."
] | train | https://github.com/Labs64/swid-generator/blob/cf78d2469469a09701bce7c5f966ac6de2b7c613/src/main/java/com/labs64/utils/swid/support/SwidUtils.java#L59-L61 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Math.java | Math.max | public static float max(float a, float b) {
"""
Returns the greater of two {@code float} values. That is,
the result is the argument closer to positive infinity. If the
arguments have the same value, the result is that same
value. If either value is NaN, then the result is NaN. Unlike
the numerical compariso... | java | public static float max(float a, float b) {
if (a != a)
return a; // a is NaN
if ((a == 0.0f) &&
(b == 0.0f) &&
(Float.floatToRawIntBits(a) == negativeZeroFloatBits)) {
// Raw conversion ok since NaN can't map to -0.0.
return b;
}
... | [
"public",
"static",
"float",
"max",
"(",
"float",
"a",
",",
"float",
"b",
")",
"{",
"if",
"(",
"a",
"!=",
"a",
")",
"return",
"a",
";",
"// a is NaN",
"if",
"(",
"(",
"a",
"==",
"0.0f",
")",
"&&",
"(",
"b",
"==",
"0.0f",
")",
"&&",
"(",
"Floa... | Returns the greater of two {@code float} values. That is,
the result is the argument closer to positive infinity. If the
arguments have the same value, the result is that same
value. If either value is NaN, then the result is NaN. Unlike
the numerical comparison operators, this method considers
negative zero to be st... | [
"Returns",
"the",
"greater",
"of",
"two",
"{",
"@code",
"float",
"}",
"values",
".",
"That",
"is",
"the",
"result",
"is",
"the",
"argument",
"closer",
"to",
"positive",
"infinity",
".",
"If",
"the",
"arguments",
"have",
"the",
"same",
"value",
"the",
"re... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Math.java#L1298-L1308 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/slave/ModbusSlaveFactory.java | ModbusSlaveFactory.createTCPSlave | public static synchronized ModbusSlave createTCPSlave(InetAddress address, int port, int poolSize, boolean useRtuOverTcp) throws ModbusException {
"""
Creates a TCP modbus slave or returns the one already allocated to this port
@param address IP address to listen on
@param port Port to listen on... | java | public static synchronized ModbusSlave createTCPSlave(InetAddress address, int port, int poolSize, boolean useRtuOverTcp) throws ModbusException {
String key = ModbusSlaveType.TCP.getKey(port);
if (slaves.containsKey(key)) {
return slaves.get(key);
}
else {
Modbus... | [
"public",
"static",
"synchronized",
"ModbusSlave",
"createTCPSlave",
"(",
"InetAddress",
"address",
",",
"int",
"port",
",",
"int",
"poolSize",
",",
"boolean",
"useRtuOverTcp",
")",
"throws",
"ModbusException",
"{",
"String",
"key",
"=",
"ModbusSlaveType",
".",
"T... | Creates a TCP modbus slave or returns the one already allocated to this port
@param address IP address to listen on
@param port Port to listen on
@param poolSize Pool size of listener threads
@param useRtuOverTcp True if the RTU protocol should be used over TCP
@return new or existing TCP modbus sl... | [
"Creates",
"a",
"TCP",
"modbus",
"slave",
"or",
"returns",
"the",
"one",
"already",
"allocated",
"to",
"this",
"port"
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/slave/ModbusSlaveFactory.java#L81-L91 |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.setClientInfo | protected void setClientInfo (ChatMessage msg, String localType) {
"""
Set the "client info" on the specified message, if not already set.
"""
if (msg.localtype == null) {
msg.setClientInfo(xlate(msg.bundle, msg.message), localType);
}
} | java | protected void setClientInfo (ChatMessage msg, String localType)
{
if (msg.localtype == null) {
msg.setClientInfo(xlate(msg.bundle, msg.message), localType);
}
} | [
"protected",
"void",
"setClientInfo",
"(",
"ChatMessage",
"msg",
",",
"String",
"localType",
")",
"{",
"if",
"(",
"msg",
".",
"localtype",
"==",
"null",
")",
"{",
"msg",
".",
"setClientInfo",
"(",
"xlate",
"(",
"msg",
".",
"bundle",
",",
"msg",
".",
"m... | Set the "client info" on the specified message, if not already set. | [
"Set",
"the",
"client",
"info",
"on",
"the",
"specified",
"message",
"if",
"not",
"already",
"set",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L1058-L1063 |
jtrfp/jfdt | src/main/java/org/jtrfp/jfdt/Parser.java | Parser.readToNewBean | public <CLASS extends ThirdPartyParseable> CLASS readToNewBean(InputStream is, Class <CLASS> clazz)
throws IllegalAccessException, UnrecognizedFormatException {
"""
Read the specified InputStream, parsing it and writing its property values to a newly-created bean of the specified class.<br>
When finished, the... | java | public <CLASS extends ThirdPartyParseable> CLASS readToNewBean(InputStream is, Class <CLASS> clazz)
throws IllegalAccessException, UnrecognizedFormatException{
return readToNewBean(new EndianAwareDataInputStream(new DataInputStream(is)),clazz);
} | [
"public",
"<",
"CLASS",
"extends",
"ThirdPartyParseable",
">",
"CLASS",
"readToNewBean",
"(",
"InputStream",
"is",
",",
"Class",
"<",
"CLASS",
">",
"clazz",
")",
"throws",
"IllegalAccessException",
",",
"UnrecognizedFormatException",
"{",
"return",
"readToNewBean",
... | Read the specified InputStream, parsing it and writing its property values to a newly-created bean of the specified class.<br>
When finished, the current position of the stream will be immediately after the data extracted.
@param is
@param clazz Class of the bean to which this data is to be parsed. Implied format... | [
"Read",
"the",
"specified",
"InputStream",
"parsing",
"it",
"and",
"writing",
"its",
"property",
"values",
"to",
"a",
"newly",
"-",
"created",
"bean",
"of",
"the",
"specified",
"class",
".",
"<br",
">",
"When",
"finished",
"the",
"current",
"position",
"of",... | train | https://github.com/jtrfp/jfdt/blob/64e665669b5fcbfe96736346b4e7893e466dd8a0/src/main/java/org/jtrfp/jfdt/Parser.java#L135-L138 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/types/parser/DoubleParser.java | DoubleParser.parseField | public static final double parseField(byte[] bytes, int startPos, int length, char delimiter) {
"""
Static utility to parse a field of type double from a byte sequence that represents text characters
(such as when read from a file stream).
@param bytes The bytes containing the text data that should be parsed.
... | java | public static final double parseField(byte[] bytes, int startPos, int length, char delimiter) {
if (length <= 0) {
throw new NumberFormatException("Invalid input: Empty string");
}
int i = 0;
final byte delByte = (byte) delimiter;
while (i < length && bytes[i] != delByte) {
i++;
}
String str =... | [
"public",
"static",
"final",
"double",
"parseField",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"int",
"length",
",",
"char",
"delimiter",
")",
"{",
"if",
"(",
"length",
"<=",
"0",
")",
"{",
"throw",
"new",
"NumberFormatException",
"(",... | Static utility to parse a field of type double from a byte sequence that represents text characters
(such as when read from a file stream).
@param bytes The bytes containing the text data that should be parsed.
@param startPos The offset to start the parsing.
@param length The length of the byte sequence (counting fro... | [
"Static",
"utility",
"to",
"parse",
"a",
"field",
"of",
"type",
"double",
"from",
"a",
"byte",
"sequence",
"that",
"represents",
"text",
"characters",
"(",
"such",
"as",
"when",
"read",
"from",
"a",
"file",
"stream",
")",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/types/parser/DoubleParser.java#L84-L97 |
JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java | SuggestionsAdapter.getColumnString | public static String getColumnString(Cursor cursor, String columnName) {
"""
Gets the value of a string column by name.
@param cursor Cursor to read the value from.
@param columnName The name of the column to read.
@return The value of the given column, or <code>null</null>
if the cursor does not contain the... | java | public static String getColumnString(Cursor cursor, String columnName) {
int col = cursor.getColumnIndex(columnName);
return getStringOrNull(cursor, col);
} | [
"public",
"static",
"String",
"getColumnString",
"(",
"Cursor",
"cursor",
",",
"String",
"columnName",
")",
"{",
"int",
"col",
"=",
"cursor",
".",
"getColumnIndex",
"(",
"columnName",
")",
";",
"return",
"getStringOrNull",
"(",
"cursor",
",",
"col",
")",
";"... | Gets the value of a string column by name.
@param cursor Cursor to read the value from.
@param columnName The name of the column to read.
@return The value of the given column, or <code>null</null>
if the cursor does not contain the given column. | [
"Gets",
"the",
"value",
"of",
"a",
"string",
"column",
"by",
"name",
"."
] | train | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java#L740-L743 |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/QueryReportPageController.java | QueryReportPageController.appendQueryPageComments | protected void appendQueryPageComments(RequestContext requestContext, final QueryPage queryPage, ReportPageCommentProcessor processor) {
"""
Appends query page comment to request.
@param requestContext request contract
@param queryPage query page
@param processor comment processor
"""
QueryQuestionCom... | java | protected void appendQueryPageComments(RequestContext requestContext, final QueryPage queryPage, ReportPageCommentProcessor processor) {
QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO();
processor.processComments();
List<QueryQuestionComment> rootComments = processor.getRootCo... | [
"protected",
"void",
"appendQueryPageComments",
"(",
"RequestContext",
"requestContext",
",",
"final",
"QueryPage",
"queryPage",
",",
"ReportPageCommentProcessor",
"processor",
")",
"{",
"QueryQuestionCommentDAO",
"queryQuestionCommentDAO",
"=",
"new",
"QueryQuestionCommentDAO"... | Appends query page comment to request.
@param requestContext request contract
@param queryPage query page
@param processor comment processor | [
"Appends",
"query",
"page",
"comment",
"to",
"request",
"."
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/QueryReportPageController.java#L45-L52 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryFileApi.java | RepositoryFileApi.updateFile | @Deprecated
public RepositoryFile updateFile(RepositoryFile file, Integer projectId, String branchName, String commitMessage) throws GitLabApiException {
"""
Update existing file in repository
<pre><code>GitLab Endpoint: PUT /projects/:id/repository/files</code></pre>
file_path (required) - Full path to ... | java | @Deprecated
public RepositoryFile updateFile(RepositoryFile file, Integer projectId, String branchName, String commitMessage) throws GitLabApiException {
return (updateFile(projectId, file, branchName, commitMessage));
} | [
"@",
"Deprecated",
"public",
"RepositoryFile",
"updateFile",
"(",
"RepositoryFile",
"file",
",",
"Integer",
"projectId",
",",
"String",
"branchName",
",",
"String",
"commitMessage",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"updateFile",
"(",
"project... | Update existing file in repository
<pre><code>GitLab Endpoint: PUT /projects/:id/repository/files</code></pre>
file_path (required) - Full path to new file. Ex. lib/class.rb
branch_name (required) - The name of branch
encoding (optional) - 'text' or 'base64'. Text is default.
content (required) - File content
commit_... | [
"Update",
"existing",
"file",
"in",
"repository"
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryFileApi.java#L297-L300 |
apache/reef | lang/java/reef-webserver/src/main/java/org/apache/reef/webserver/HttpServerReefEventHandler.java | HttpServerReefEventHandler.writeLines | private void writeLines(final HttpServletResponse response, final ArrayList<String> lines, final String header)
throws IOException {
"""
Write lines in ArrayList to the response writer.
@param response
@param lines
@param header
@throws IOException
"""
LOG.log(Level.INFO, "HttpServerReefEventHand... | java | private void writeLines(final HttpServletResponse response, final ArrayList<String> lines, final String header)
throws IOException {
LOG.log(Level.INFO, "HttpServerReefEventHandler writeLines is called");
final PrintWriter writer = response.getWriter();
writer.println("<h1>" + header + "</h1>");
... | [
"private",
"void",
"writeLines",
"(",
"final",
"HttpServletResponse",
"response",
",",
"final",
"ArrayList",
"<",
"String",
">",
"lines",
",",
"final",
"String",
"header",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"INFO",
",",
... | Write lines in ArrayList to the response writer.
@param response
@param lines
@param header
@throws IOException | [
"Write",
"lines",
"in",
"ArrayList",
"to",
"the",
"response",
"writer",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-webserver/src/main/java/org/apache/reef/webserver/HttpServerReefEventHandler.java#L401-L414 |
getsentry/sentry-java | sentry/src/main/java/io/sentry/event/EventBuilder.java | EventBuilder.withContexts | public EventBuilder withContexts(Map<String, Map<String, Object>> contexts) {
"""
Adds a map of map of context objects to the event.
@param contexts map of map of contexts
@return the current {@code EventBuilder} for chained calls.
"""
event.setContexts(contexts);
return this;
} | java | public EventBuilder withContexts(Map<String, Map<String, Object>> contexts) {
event.setContexts(contexts);
return this;
} | [
"public",
"EventBuilder",
"withContexts",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"contexts",
")",
"{",
"event",
".",
"setContexts",
"(",
"contexts",
")",
";",
"return",
"this",
";",
"}"
] | Adds a map of map of context objects to the event.
@param contexts map of map of contexts
@return the current {@code EventBuilder} for chained calls. | [
"Adds",
"a",
"map",
"of",
"map",
"of",
"context",
"objects",
"to",
"the",
"event",
"."
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/event/EventBuilder.java#L325-L328 |
lucee/Lucee | core/src/main/java/lucee/commons/management/MemoryInfo.java | MemoryInfo.deepMemoryUsageOf | public static long deepMemoryUsageOf(Instrumentation inst, final Object obj, final int referenceFilter) {
"""
Returns an estimation, in bytes, of the memory usage of the given object plus (recursively)
objects it references via non-static references. Which references are traversed depends on the
Visibility Filte... | java | public static long deepMemoryUsageOf(Instrumentation inst, final Object obj, final int referenceFilter) {
return deepMemoryUsageOf0(inst, new HashSet<Integer>(), obj, referenceFilter);
} | [
"public",
"static",
"long",
"deepMemoryUsageOf",
"(",
"Instrumentation",
"inst",
",",
"final",
"Object",
"obj",
",",
"final",
"int",
"referenceFilter",
")",
"{",
"return",
"deepMemoryUsageOf0",
"(",
"inst",
",",
"new",
"HashSet",
"<",
"Integer",
">",
"(",
")",... | Returns an estimation, in bytes, of the memory usage of the given object plus (recursively)
objects it references via non-static references. Which references are traversed depends on the
Visibility Filter passed in. The estimate for each individual object is provided by the running
JVM and is likely to be as accurate a... | [
"Returns",
"an",
"estimation",
"in",
"bytes",
"of",
"the",
"memory",
"usage",
"of",
"the",
"given",
"object",
"plus",
"(",
"recursively",
")",
"objects",
"it",
"references",
"via",
"non",
"-",
"static",
"references",
".",
"Which",
"references",
"are",
"trave... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/management/MemoryInfo.java#L86-L88 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/MethodAnnotation.java | MethodAnnotation.fromForeignMethod | public static MethodAnnotation fromForeignMethod(String className, String methodName, String methodSig, boolean isStatic) {
"""
Factory method to create the MethodAnnotation from the classname, method
name, signature, etc. The method tries to look up source line information
for the method.
@param className
n... | java | public static MethodAnnotation fromForeignMethod(String className, String methodName, String methodSig, boolean isStatic) {
// FIXME: would be nice to do this without using BCEL
className = ClassName.toDottedClassName(className);
// Create MethodAnnotation.
// It won't have source lin... | [
"public",
"static",
"MethodAnnotation",
"fromForeignMethod",
"(",
"String",
"className",
",",
"String",
"methodName",
",",
"String",
"methodSig",
",",
"boolean",
"isStatic",
")",
"{",
"// FIXME: would be nice to do this without using BCEL",
"className",
"=",
"ClassName",
... | Factory method to create the MethodAnnotation from the classname, method
name, signature, etc. The method tries to look up source line information
for the method.
@param className
name of the class containing the method
@param methodName
name of the method
@param methodSig
signature of the method
@param isStatic
true ... | [
"Factory",
"method",
"to",
"create",
"the",
"MethodAnnotation",
"from",
"the",
"classname",
"method",
"name",
"signature",
"etc",
".",
"The",
"method",
"tries",
"to",
"look",
"up",
"source",
"line",
"information",
"for",
"the",
"method",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/MethodAnnotation.java#L212-L230 |
VoltDB/voltdb | third_party/java/src/org/apache/jute_voltpatches/compiler/CppGenerator.java | CppGenerator.genCode | void genCode() throws IOException {
"""
Generate C++ code. This method only creates the requested file(s) and
spits-out file-level elements (such as include statements etc.)
record-level code is generated by JRecord.
"""
if (!outputDirectory.exists()) {
if (!outputDirectory.mkdirs()) {
... | java | void genCode() throws IOException {
if (!outputDirectory.exists()) {
if (!outputDirectory.mkdirs()) {
throw new IOException("unable to create output directory "
+ outputDirectory);
}
}
FileWriter cc = new FileWriter(new File(outputD... | [
"void",
"genCode",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"outputDirectory",
".",
"exists",
"(",
")",
")",
"{",
"if",
"(",
"!",
"outputDirectory",
".",
"mkdirs",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"unable to create... | Generate C++ code. This method only creates the requested file(s) and
spits-out file-level elements (such as include statements etc.)
record-level code is generated by JRecord. | [
"Generate",
"C",
"++",
"code",
".",
"This",
"method",
"only",
"creates",
"the",
"requested",
"file",
"(",
"s",
")",
"and",
"spits",
"-",
"out",
"file",
"-",
"level",
"elements",
"(",
"such",
"as",
"include",
"statements",
"etc",
".",
")",
"record",
"-"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/jute_voltpatches/compiler/CppGenerator.java#L60-L127 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/util/XMLContentHandler.java | XMLContentHandler.addProperty | private void addProperty(final Node node, final PropertyDescriptor propDesc) throws RepositoryException {
"""
Adds a property to the node. The property's name, type and value is defined in the {@link PropertyDescriptor}.
@param node
the node to which the property should be added
@param propDesc
the {@link Pr... | java | private void addProperty(final Node node, final PropertyDescriptor propDesc) throws RepositoryException {
LOG.info("Node {} adding property {}", node.getPath(), propDesc.getName());
node.setProperty(propDesc.getName(), (Value) propDesc.getValue());
} | [
"private",
"void",
"addProperty",
"(",
"final",
"Node",
"node",
",",
"final",
"PropertyDescriptor",
"propDesc",
")",
"throws",
"RepositoryException",
"{",
"LOG",
".",
"info",
"(",
"\"Node {} adding property {}\"",
",",
"node",
".",
"getPath",
"(",
")",
",",
"pro... | Adds a property to the node. The property's name, type and value is defined in the {@link PropertyDescriptor}.
@param node
the node to which the property should be added
@param propDesc
the {@link PropertyDescriptor} containing the details of the property
@throws RepositoryException
if the path of the node can not be... | [
"Adds",
"a",
"property",
"to",
"the",
"node",
".",
"The",
"property",
"s",
"name",
"type",
"and",
"value",
"is",
"defined",
"in",
"the",
"{",
"@link",
"PropertyDescriptor",
"}",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/util/XMLContentHandler.java#L269-L273 |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/utilities/BitCount.java | BitCount.count_2 | public static int count_2(int[] buffer, int n) {
"""
Population count, skipping words at even positions
<p>
It counts 24 words at a time, then 3 at a time, then 1 at a time
@param buffer
array of <code>int</code>
@param n
number of elements of <code>buffer</code> to count
@return population count
"""
... | java | public static int count_2(int[] buffer, int n) {
final int n1 = n - n % 48;
final int n2 = n - n % 6;
int cnt = 0;
int i;
for (i = 0; i < n1; i += 48)
cnt += merging3_2(buffer, i);
for (; i < n2; i += 6)
cnt += merging2_2(buffer, i);
cnt += popcount_fbsd2_2(buffer, i, n);
return cnt;
... | [
"public",
"static",
"int",
"count_2",
"(",
"int",
"[",
"]",
"buffer",
",",
"int",
"n",
")",
"{",
"final",
"int",
"n1",
"=",
"n",
"-",
"n",
"%",
"48",
";",
"final",
"int",
"n2",
"=",
"n",
"-",
"n",
"%",
"6",
";",
"int",
"cnt",
"=",
"0",
";",... | Population count, skipping words at even positions
<p>
It counts 24 words at a time, then 3 at a time, then 1 at a time
@param buffer
array of <code>int</code>
@param n
number of elements of <code>buffer</code> to count
@return population count | [
"Population",
"count",
"skipping",
"words",
"at",
"even",
"positions",
"<p",
">",
"It",
"counts",
"24",
"words",
"at",
"a",
"time",
"then",
"3",
"at",
"a",
"time",
"then",
"1",
"at",
"a",
"time"
] | train | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/utilities/BitCount.java#L138-L150 |
JosePaumard/streams-utils | src/main/java/org/paumard/streams/StreamsUtils.java | StreamsUtils.shiftingWindowSummarizingInt | public static <E> Stream<IntSummaryStatistics> shiftingWindowSummarizingInt(Stream<E> stream, int rollingFactor, ToIntFunction<? super E> mapper) {
"""
<p>Generates a stream that is computed from a provided stream following two steps.</p>
<p>The first steps maps this stream to an <code>IntStream</code> that is th... | java | public static <E> Stream<IntSummaryStatistics> shiftingWindowSummarizingInt(Stream<E> stream, int rollingFactor, ToIntFunction<? super E> mapper) {
Objects.requireNonNull(stream);
Objects.requireNonNull(mapper);
IntStream intStream = stream.mapToInt(mapper);
return shiftingWindowSummari... | [
"public",
"static",
"<",
"E",
">",
"Stream",
"<",
"IntSummaryStatistics",
">",
"shiftingWindowSummarizingInt",
"(",
"Stream",
"<",
"E",
">",
"stream",
",",
"int",
"rollingFactor",
",",
"ToIntFunction",
"<",
"?",
"super",
"E",
">",
"mapper",
")",
"{",
"Object... | <p>Generates a stream that is computed from a provided stream following two steps.</p>
<p>The first steps maps this stream to an <code>IntStream</code> that is then rolled following
the same principle as the <code>roll()</code> method. This steps builds a <code>Stream<IntStream></code>.
</p>
<p>Then int summary s... | [
"<p",
">",
"Generates",
"a",
"stream",
"that",
"is",
"computed",
"from",
"a",
"provided",
"stream",
"following",
"two",
"steps",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"first",
"steps",
"maps",
"this",
"stream",
"to",
"an",
"<code",
">",
"IntStream... | train | https://github.com/JosePaumard/streams-utils/blob/56152574af0aca44c5f679761202a8f90984ab73/src/main/java/org/paumard/streams/StreamsUtils.java#L698-L704 |
davetcc/tcMenu | tcMenuJavaApi/src/main/java/com/thecoderscorner/menu/remote/StreamRemoteConnector.java | StreamRemoteConnector.logByteBuffer | protected void logByteBuffer(String msg, ByteBuffer inBuffer) {
"""
Helper method that logs the entire message buffer when at debug logging level.
@param msg the message to print first
@param inBuffer the buffer to be logged
"""
if(!logger.isLoggable(DEBUG)) return;
ByteBuffer bb = inBuffer.... | java | protected void logByteBuffer(String msg, ByteBuffer inBuffer) {
if(!logger.isLoggable(DEBUG)) return;
ByteBuffer bb = inBuffer.duplicate();
byte[] byData = new byte[512];
int len = Math.min(byData.length, bb.remaining());
byte dataByte = bb.get();
int pos = 0;
w... | [
"protected",
"void",
"logByteBuffer",
"(",
"String",
"msg",
",",
"ByteBuffer",
"inBuffer",
")",
"{",
"if",
"(",
"!",
"logger",
".",
"isLoggable",
"(",
"DEBUG",
")",
")",
"return",
";",
"ByteBuffer",
"bb",
"=",
"inBuffer",
".",
"duplicate",
"(",
")",
";",... | Helper method that logs the entire message buffer when at debug logging level.
@param msg the message to print first
@param inBuffer the buffer to be logged | [
"Helper",
"method",
"that",
"logs",
"the",
"entire",
"message",
"buffer",
"when",
"at",
"debug",
"logging",
"level",
"."
] | train | https://github.com/davetcc/tcMenu/blob/61546e4b982b25ceaff384073fe9ec1fff55e64a/tcMenuJavaApi/src/main/java/com/thecoderscorner/menu/remote/StreamRemoteConnector.java#L208-L224 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/system/exec/Exec.java | Exec.start | public Execed start() throws IOException {
"""
Launches the process, returning a handle to it for IO ops, etc.<br />
The finish condition for the OutputProcess is that all processes outputting to standard out must be complete before
proceeding
@return
@throws IOException
"""
Process p = getProcessBui... | java | public Execed start() throws IOException
{
Process p = getProcessBuilder().start();
return new Execed(cmd, p, builder.redirectErrorStream());
} | [
"public",
"Execed",
"start",
"(",
")",
"throws",
"IOException",
"{",
"Process",
"p",
"=",
"getProcessBuilder",
"(",
")",
".",
"start",
"(",
")",
";",
"return",
"new",
"Execed",
"(",
"cmd",
",",
"p",
",",
"builder",
".",
"redirectErrorStream",
"(",
")",
... | Launches the process, returning a handle to it for IO ops, etc.<br />
The finish condition for the OutputProcess is that all processes outputting to standard out must be complete before
proceeding
@return
@throws IOException | [
"Launches",
"the",
"process",
"returning",
"a",
"handle",
"to",
"it",
"for",
"IO",
"ops",
"etc",
".",
"<br",
"/",
">",
"The",
"finish",
"condition",
"for",
"the",
"OutputProcess",
"is",
"that",
"all",
"processes",
"outputting",
"to",
"standard",
"out",
"mu... | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/system/exec/Exec.java#L147-L152 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java | AbstractRadial.create_LCD_Image | protected BufferedImage create_LCD_Image(final int WIDTH, final int HEIGHT, final LcdColor LCD_COLOR, final Paint CUSTOM_LCD_BACKGROUND) {
"""
Returns the image with the given lcd color.
@param WIDTH
@param HEIGHT
@param LCD_COLOR
@param CUSTOM_LCD_BACKGROUND
@return buffered image containing the lcd with the... | java | protected BufferedImage create_LCD_Image(final int WIDTH, final int HEIGHT, final LcdColor LCD_COLOR, final Paint CUSTOM_LCD_BACKGROUND) {
return createLcdImage(new Rectangle2D.Double(0, 0, WIDTH, HEIGHT), LCD_COLOR, CUSTOM_LCD_BACKGROUND, null);
} | [
"protected",
"BufferedImage",
"create_LCD_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"int",
"HEIGHT",
",",
"final",
"LcdColor",
"LCD_COLOR",
",",
"final",
"Paint",
"CUSTOM_LCD_BACKGROUND",
")",
"{",
"return",
"createLcdImage",
"(",
"new",
"Rectangle2D",
"... | Returns the image with the given lcd color.
@param WIDTH
@param HEIGHT
@param LCD_COLOR
@param CUSTOM_LCD_BACKGROUND
@return buffered image containing the lcd with the selected lcd color | [
"Returns",
"the",
"image",
"with",
"the",
"given",
"lcd",
"color",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java#L1491-L1493 |
Drivemode/TypefaceHelper | TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java | TypefaceHelper.setTypeface | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public <F extends android.app.Fragment> void setTypeface(F fragment, String typefaceName, int style) {
"""
Set the typeface to the all text views belong to the fragment.
Make sure to call this method after fragment view creation.
If you use fragments in the support pack... | java | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public <F extends android.app.Fragment> void setTypeface(F fragment, String typefaceName, int style) {
View root = fragment.getView();
if (root instanceof TextView) {
setTypeface((TextView) root, typefaceName, style);
} else if (root instanceof ViewGroup) {
setType... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"public",
"<",
"F",
"extends",
"android",
".",
"app",
".",
"Fragment",
">",
"void",
"setTypeface",
"(",
"F",
"fragment",
",",
"String",
"typefaceName",
",",
"int",
"style",
")",
... | Set the typeface to the all text views belong to the fragment.
Make sure to call this method after fragment view creation.
If you use fragments in the support package,
call {@link com.drivemode.android.typeface.TypefaceHelper#supportSetTypeface(android.support.v4.app.Fragment, String, int)} instead.
@param fragment the... | [
"Set",
"the",
"typeface",
"to",
"the",
"all",
"text",
"views",
"belong",
"to",
"the",
"fragment",
".",
"Make",
"sure",
"to",
"call",
"this",
"method",
"after",
"fragment",
"view",
"creation",
".",
"If",
"you",
"use",
"fragments",
"in",
"the",
"support",
... | train | https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java#L386-L394 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.getHtml | public String getHtml(Formatter formatter, String value) {
"""
Formats supplied value for display as pre-formatted text in FitNesse page.
@param formatter formatter to use to generate pre-formatted text.
@param value value to format.
@return HTML formatted version of value.
"""
String result = null;... | java | public String getHtml(Formatter formatter, String value) {
String result = null;
if (value != null) {
if ("".equals(value)) {
result = "";
} else {
String formattedResponse = formatter.format(value);
result = "<pre>" + StringEscapeU... | [
"public",
"String",
"getHtml",
"(",
"Formatter",
"formatter",
",",
"String",
"value",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"\"\"",
".",
"equals",
"(",
"value",
")",
")",
"{",
"result",... | Formats supplied value for display as pre-formatted text in FitNesse page.
@param formatter formatter to use to generate pre-formatted text.
@param value value to format.
@return HTML formatted version of value. | [
"Formats",
"supplied",
"value",
"for",
"display",
"as",
"pre",
"-",
"formatted",
"text",
"in",
"FitNesse",
"page",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L526-L537 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsFormatterConfiguration.java | CmsFormatterConfiguration.create | public static CmsFormatterConfiguration create(CmsObject cms, List<I_CmsFormatterBean> formatters) {
"""
Returns the formatter configuration for the current project based on the given list of formatters.<p>
@param cms the current users OpenCms context, required to know which project to read the JSP from
@param... | java | public static CmsFormatterConfiguration create(CmsObject cms, List<I_CmsFormatterBean> formatters) {
if ((formatters != null) && (formatters.size() > 0) && (cms != null)) {
return new CmsFormatterConfiguration(cms, formatters);
} else {
return EMPTY_CONFIGURATION;
}
... | [
"public",
"static",
"CmsFormatterConfiguration",
"create",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"I_CmsFormatterBean",
">",
"formatters",
")",
"{",
"if",
"(",
"(",
"formatters",
"!=",
"null",
")",
"&&",
"(",
"formatters",
".",
"size",
"(",
")",
">",
"... | Returns the formatter configuration for the current project based on the given list of formatters.<p>
@param cms the current users OpenCms context, required to know which project to read the JSP from
@param formatters the list of configured formatters
@return the formatter configuration for the current project based ... | [
"Returns",
"the",
"formatter",
"configuration",
"for",
"the",
"current",
"project",
"based",
"on",
"the",
"given",
"list",
"of",
"formatters",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsFormatterConfiguration.java#L212-L219 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/quota/PathPatternUtils.java | PathPatternUtils.acceptDescendant | public static boolean acceptDescendant(String pattern, String absPath) {
"""
Returns <code>true</code> if a specified path or any descendant path
is matched by pattern.
@param pattern
pattern for node path
@param absPath
node absolute path
@return a <code>boolean</code>.
"""
absPath = normalizePa... | java | public static boolean acceptDescendant(String pattern, String absPath)
{
absPath = normalizePath(absPath);
pattern = adopt2JavaPattern(pattern);
// allows any descendants after
pattern += "(/.+)?";
return absPath.matches(pattern);
} | [
"public",
"static",
"boolean",
"acceptDescendant",
"(",
"String",
"pattern",
",",
"String",
"absPath",
")",
"{",
"absPath",
"=",
"normalizePath",
"(",
"absPath",
")",
";",
"pattern",
"=",
"adopt2JavaPattern",
"(",
"pattern",
")",
";",
"// allows any descendants af... | Returns <code>true</code> if a specified path or any descendant path
is matched by pattern.
@param pattern
pattern for node path
@param absPath
node absolute path
@return a <code>boolean</code>. | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"a",
"specified",
"path",
"or",
"any",
"descendant",
"path",
"is",
"matched",
"by",
"pattern",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/quota/PathPatternUtils.java#L84-L93 |
Netflix/karyon | karyon2-core/src/main/java/netflix/karyon/transport/http/ServletStyleUriConstraintKey.java | ServletStyleUriConstraintKey.getServletPath | public String getServletPath(HttpServerRequest<I> request, HttpKeyEvaluationContext context) {
"""
This must be called if and only if {@link #apply(HttpServerRequest, HttpKeyEvaluationContext)}
returned for the same request.
@param request Request which satisfies this key.
@param context The key evaluation co... | java | public String getServletPath(HttpServerRequest<I> request, HttpKeyEvaluationContext context) {
String requestUriPath = context.getRequestUriPath(request);
if (null != requestUriPath) {
return matcher.getServletPath(requestUriPath);
}
return "";
} | [
"public",
"String",
"getServletPath",
"(",
"HttpServerRequest",
"<",
"I",
">",
"request",
",",
"HttpKeyEvaluationContext",
"context",
")",
"{",
"String",
"requestUriPath",
"=",
"context",
".",
"getRequestUriPath",
"(",
"request",
")",
";",
"if",
"(",
"null",
"!=... | This must be called if and only if {@link #apply(HttpServerRequest, HttpKeyEvaluationContext)}
returned for the same request.
@param request Request which satisfies this key.
@param context The key evaluation context.
@return The servlet path. | [
"This",
"must",
"be",
"called",
"if",
"and",
"only",
"if",
"{",
"@link",
"#apply",
"(",
"HttpServerRequest",
"HttpKeyEvaluationContext",
")",
"}",
"returned",
"for",
"the",
"same",
"request",
"."
] | train | https://github.com/Netflix/karyon/blob/d50bc0ff37693ef3fbda373e90a109d1f92e0b9a/karyon2-core/src/main/java/netflix/karyon/transport/http/ServletStyleUriConstraintKey.java#L79-L85 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/TransactionWriteRequest.java | TransactionWriteRequest.addDelete | public TransactionWriteRequest addDelete(Object key,
DynamoDBTransactionWriteExpression transactionWriteExpression,
ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure ) {
"""
Adds delete operation (to be ... | java | public TransactionWriteRequest addDelete(Object key,
DynamoDBTransactionWriteExpression transactionWriteExpression,
ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure ) {
transactionWriteOperations.add... | [
"public",
"TransactionWriteRequest",
"addDelete",
"(",
"Object",
"key",
",",
"DynamoDBTransactionWriteExpression",
"transactionWriteExpression",
",",
"ReturnValuesOnConditionCheckFailure",
"returnValuesOnConditionCheckFailure",
")",
"{",
"transactionWriteOperations",
".",
"add",
"(... | Adds delete operation (to be executed on the object represented by key) to the list of transaction write operations.
transactionWriteExpression is used to conditionally delete the object represented by key.
returnValuesOnConditionCheckFailure specifies which attributes values (of existing item) should be returned if co... | [
"Adds",
"delete",
"operation",
"(",
"to",
"be",
"executed",
"on",
"the",
"object",
"represented",
"by",
"key",
")",
"to",
"the",
"list",
"of",
"transaction",
"write",
"operations",
".",
"transactionWriteExpression",
"is",
"used",
"to",
"conditionally",
"delete",... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/TransactionWriteRequest.java#L121-L126 |
requery/requery | requery/src/main/java/io/requery/sql/SchemaModifier.java | SchemaModifier.createIndexes | public void createIndexes(Connection connection, TableCreationMode mode) {
"""
Creates all indexes in the model.
@param connection to use
@param mode creation mode.
@throws TableModificationException if the creation fails.
"""
ArrayList<Type<?>> sorted = sortTypes();
for (Type<?> type : so... | java | public void createIndexes(Connection connection, TableCreationMode mode) {
ArrayList<Type<?>> sorted = sortTypes();
for (Type<?> type : sorted) {
createIndexes(connection, mode, type);
}
} | [
"public",
"void",
"createIndexes",
"(",
"Connection",
"connection",
",",
"TableCreationMode",
"mode",
")",
"{",
"ArrayList",
"<",
"Type",
"<",
"?",
">",
">",
"sorted",
"=",
"sortTypes",
"(",
")",
";",
"for",
"(",
"Type",
"<",
"?",
">",
"type",
":",
"so... | Creates all indexes in the model.
@param connection to use
@param mode creation mode.
@throws TableModificationException if the creation fails. | [
"Creates",
"all",
"indexes",
"in",
"the",
"model",
"."
] | train | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery/src/main/java/io/requery/sql/SchemaModifier.java#L173-L178 |
alkacon/opencms-core | src/org/opencms/ui/dialogs/history/CmsHistoryDialog.java | CmsHistoryDialog.canCompare | private boolean canCompare(CheckBox check1, CheckBox check2) {
"""
Checks if two different versions are selected, and so can be compared.<p>
@param check1 the first selected check box
@param check2 the second selected check box
@return true if the check boxes correspond to two different versions
"""
... | java | private boolean canCompare(CheckBox check1, CheckBox check2) {
return !((check1 == null) || (check2 == null) || (check1.getData() == check2.getData()));
} | [
"private",
"boolean",
"canCompare",
"(",
"CheckBox",
"check1",
",",
"CheckBox",
"check2",
")",
"{",
"return",
"!",
"(",
"(",
"check1",
"==",
"null",
")",
"||",
"(",
"check2",
"==",
"null",
")",
"||",
"(",
"check1",
".",
"getData",
"(",
")",
"==",
"ch... | Checks if two different versions are selected, and so can be compared.<p>
@param check1 the first selected check box
@param check2 the second selected check box
@return true if the check boxes correspond to two different versions | [
"Checks",
"if",
"two",
"different",
"versions",
"are",
"selected",
"and",
"so",
"can",
"be",
"compared",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dialogs/history/CmsHistoryDialog.java#L432-L435 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java | ComponentFactory.newCheckBox | public static CheckBox newCheckBox(final String id, final IModel<Boolean> model) {
"""
Factory method for create a new {@link CheckBox}.
@param id
the id
@param model
the model
@return the new {@link CheckBox}
"""
final CheckBox checkBox = new CheckBox(id, model);
checkBox.setOutputMarkupId(true);
... | java | public static CheckBox newCheckBox(final String id, final IModel<Boolean> model)
{
final CheckBox checkBox = new CheckBox(id, model);
checkBox.setOutputMarkupId(true);
return checkBox;
} | [
"public",
"static",
"CheckBox",
"newCheckBox",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"Boolean",
">",
"model",
")",
"{",
"final",
"CheckBox",
"checkBox",
"=",
"new",
"CheckBox",
"(",
"id",
",",
"model",
")",
";",
"checkBox",
".",
"set... | Factory method for create a new {@link CheckBox}.
@param id
the id
@param model
the model
@return the new {@link CheckBox} | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"CheckBox",
"}",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/factory/ComponentFactory.java#L71-L76 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/UnitQuaternions.java | UnitQuaternions.dotProduct | public static double dotProduct(Quat4d q1, Quat4d q2) {
"""
Compute the dot (inner) product of two quaternions.
@param q1
quaternion as Quat4d object
@param q2
quaternion as Quat4d object
@return the value of the quaternion dot product
"""
return q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w;
... | java | public static double dotProduct(Quat4d q1, Quat4d q2) {
return q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w;
} | [
"public",
"static",
"double",
"dotProduct",
"(",
"Quat4d",
"q1",
",",
"Quat4d",
"q2",
")",
"{",
"return",
"q1",
".",
"x",
"*",
"q2",
".",
"x",
"+",
"q1",
".",
"y",
"*",
"q2",
".",
"y",
"+",
"q1",
".",
"z",
"*",
"q2",
".",
"z",
"+",
"q1",
".... | Compute the dot (inner) product of two quaternions.
@param q1
quaternion as Quat4d object
@param q2
quaternion as Quat4d object
@return the value of the quaternion dot product | [
"Compute",
"the",
"dot",
"(",
"inner",
")",
"product",
"of",
"two",
"quaternions",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/UnitQuaternions.java#L218-L220 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AgentRegistrationInformationsInner.java | AgentRegistrationInformationsInner.getAsync | public Observable<AgentRegistrationInner> getAsync(String resourceGroupName, String automationAccountName) {
"""
Retrieve the automation agent registration information.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArg... | java | public Observable<AgentRegistrationInner> getAsync(String resourceGroupName, String automationAccountName) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName).map(new Func1<ServiceResponse<AgentRegistrationInner>, AgentRegistrationInner>() {
@Override
public Ag... | [
"public",
"Observable",
"<",
"AgentRegistrationInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
")",
".",
"map",
... | Retrieve the automation agent registration information.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the AgentRegistrationInner object | [
"Retrieve",
"the",
"automation",
"agent",
"registration",
"information",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AgentRegistrationInformationsInner.java#L103-L110 |
voldemort/voldemort | src/java/voldemort/tools/Repartitioner.java | Repartitioner.greedyShufflePartitions | public static Cluster greedyShufflePartitions(final Cluster nextCandidateCluster,
final int greedyAttempts,
final int greedySwapMaxPartitionsPerNode,
final int greedySwap... | java | public static Cluster greedyShufflePartitions(final Cluster nextCandidateCluster,
final int greedyAttempts,
final int greedySwapMaxPartitionsPerNode,
final int greedySwap... | [
"public",
"static",
"Cluster",
"greedyShufflePartitions",
"(",
"final",
"Cluster",
"nextCandidateCluster",
",",
"final",
"int",
"greedyAttempts",
",",
"final",
"int",
"greedySwapMaxPartitionsPerNode",
",",
"final",
"int",
"greedySwapMaxPartitionsPerZone",
",",
"List",
"<"... | Within a single zone, tries swapping some minimum number of random
partitions per node with some minimum number of random partitions from
other nodes within the zone. Chooses the best swap in each iteration.
Large values of the greedSwapMaxPartitions... arguments make this method
equivalent to comparing every possible ... | [
"Within",
"a",
"single",
"zone",
"tries",
"swapping",
"some",
"minimum",
"number",
"of",
"random",
"partitions",
"per",
"node",
"with",
"some",
"minimum",
"number",
"of",
"random",
"partitions",
"from",
"other",
"nodes",
"within",
"the",
"zone",
".",
"Chooses"... | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/Repartitioner.java#L862-L907 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDecoratedLabel.java | WDecoratedLabel.setText | public void setText(final String text, final Serializable... args) {
"""
Attempts to set the text contained in the body component. This works only for simple components types:
<ul>
<li>{@link WButton}</li>
<li>{@link WLink}</li>
<li>{@link WLabel}</li>
<li>{@link WText}</li>
</ul>
@param text the new body... | java | public void setText(final String text, final Serializable... args) {
WComponent body = getBody();
if (body instanceof WText) {
((WText) body).setText(text, args);
} else if (body instanceof WLabel) {
((WLabel) body).setText(text, args);
} else if (body instanceof WButton) {
((WButton) body).setText(te... | [
"public",
"void",
"setText",
"(",
"final",
"String",
"text",
",",
"final",
"Serializable",
"...",
"args",
")",
"{",
"WComponent",
"body",
"=",
"getBody",
"(",
")",
";",
"if",
"(",
"body",
"instanceof",
"WText",
")",
"{",
"(",
"(",
"WText",
")",
"body",... | Attempts to set the text contained in the body component. This works only for simple components types:
<ul>
<li>{@link WButton}</li>
<li>{@link WLink}</li>
<li>{@link WLabel}</li>
<li>{@link WText}</li>
</ul>
@param text the new body text, using {@link MessageFormat} syntax.
@param args optional arguments for the mess... | [
"Attempts",
"to",
"set",
"the",
"text",
"contained",
"in",
"the",
"body",
"component",
".",
"This",
"works",
"only",
"for",
"simple",
"components",
"types",
":",
"<ul",
">",
"<li",
">",
"{",
"@link",
"WButton",
"}",
"<",
"/",
"li",
">",
"<li",
">",
"... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDecoratedLabel.java#L154-L168 |
killbill/killbill | util/src/main/java/org/killbill/billing/util/entity/DefaultPagination.java | DefaultPagination.build | public static <T> Pagination<T> build(final Long offset, final Long limit, final Collection<T> elements) {
"""
Notes: elements should be the entire records set (regardless of filtering) otherwise maxNbRecords won't be accurate
"""
return build(offset, limit, elements.size(), elements);
} | java | public static <T> Pagination<T> build(final Long offset, final Long limit, final Collection<T> elements) {
return build(offset, limit, elements.size(), elements);
} | [
"public",
"static",
"<",
"T",
">",
"Pagination",
"<",
"T",
">",
"build",
"(",
"final",
"Long",
"offset",
",",
"final",
"Long",
"limit",
",",
"final",
"Collection",
"<",
"T",
">",
"elements",
")",
"{",
"return",
"build",
"(",
"offset",
",",
"limit",
"... | Notes: elements should be the entire records set (regardless of filtering) otherwise maxNbRecords won't be accurate | [
"Notes",
":",
"elements",
"should",
"be",
"the",
"entire",
"records",
"set",
"(",
"regardless",
"of",
"filtering",
")",
"otherwise",
"maxNbRecords",
"won",
"t",
"be",
"accurate"
] | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/util/src/main/java/org/killbill/billing/util/entity/DefaultPagination.java#L42-L44 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.populateLogicalFilterBuilder | private QueryBuilder populateLogicalFilterBuilder(Expression logicalExp, EntityMetadata m) {
"""
Populate logical filter builder.
@param logicalExp
the logical exp
@param m
the m
@param entity
the entity
@return the filter builder
"""
String identifier = ((LogicalExpression) logicalExp).getIde... | java | private QueryBuilder populateLogicalFilterBuilder(Expression logicalExp, EntityMetadata m)
{
String identifier = ((LogicalExpression) logicalExp).getIdentifier();
return (identifier.equalsIgnoreCase(LogicalExpression.AND)) ? getAndFilterBuilder(logicalExp, m) : (identifier
.equalsIg... | [
"private",
"QueryBuilder",
"populateLogicalFilterBuilder",
"(",
"Expression",
"logicalExp",
",",
"EntityMetadata",
"m",
")",
"{",
"String",
"identifier",
"=",
"(",
"(",
"LogicalExpression",
")",
"logicalExp",
")",
".",
"getIdentifier",
"(",
")",
";",
"return",
"("... | Populate logical filter builder.
@param logicalExp
the logical exp
@param m
the m
@param entity
the entity
@return the filter builder | [
"Populate",
"logical",
"filter",
"builder",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L339-L345 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/dfx/Segment3dfx.java | Segment3dfx.y2Property | @Pure
public DoubleProperty y2Property() {
"""
Replies the property that is the y coordinate of the second segment point.
@return the y2 property.
"""
if (this.p2.y == null) {
this.p2.y = new SimpleDoubleProperty(this, MathFXAttributeNames.Y2);
}
return this.p2.y;
} | java | @Pure
public DoubleProperty y2Property() {
if (this.p2.y == null) {
this.p2.y = new SimpleDoubleProperty(this, MathFXAttributeNames.Y2);
}
return this.p2.y;
} | [
"@",
"Pure",
"public",
"DoubleProperty",
"y2Property",
"(",
")",
"{",
"if",
"(",
"this",
".",
"p2",
".",
"y",
"==",
"null",
")",
"{",
"this",
".",
"p2",
".",
"y",
"=",
"new",
"SimpleDoubleProperty",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"Y2",
... | Replies the property that is the y coordinate of the second segment point.
@return the y2 property. | [
"Replies",
"the",
"property",
"that",
"is",
"the",
"y",
"coordinate",
"of",
"the",
"second",
"segment",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/dfx/Segment3dfx.java#L277-L283 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/BrokerHelper.java | BrokerHelper.getValuesForObject | public ValueContainer[] getValuesForObject(FieldDescriptor[] fields, Object obj, boolean convertToSql, boolean assignAutoincrement) throws PersistenceBrokerException {
"""
Get the values of the fields for an obj
Autoincrement values are automatically set.
@param fields
@param obj
@throws PersistenceBrokerExcep... | java | public ValueContainer[] getValuesForObject(FieldDescriptor[] fields, Object obj, boolean convertToSql, boolean assignAutoincrement) throws PersistenceBrokerException
{
ValueContainer[] result = new ValueContainer[fields.length];
for(int i = 0; i < fields.length; i++)
{
Fie... | [
"public",
"ValueContainer",
"[",
"]",
"getValuesForObject",
"(",
"FieldDescriptor",
"[",
"]",
"fields",
",",
"Object",
"obj",
",",
"boolean",
"convertToSql",
",",
"boolean",
"assignAutoincrement",
")",
"throws",
"PersistenceBrokerException",
"{",
"ValueContainer",
"["... | Get the values of the fields for an obj
Autoincrement values are automatically set.
@param fields
@param obj
@throws PersistenceBrokerException | [
"Get",
"the",
"values",
"of",
"the",
"fields",
"for",
"an",
"obj",
"Autoincrement",
"values",
"are",
"automatically",
"set",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L349-L384 |
code4everything/util | src/main/java/com/zhazhapan/util/NetUtils.java | NetUtils.addCookie | public static boolean addCookie(Cookie cookie, HttpServletResponse response) {
"""
添加Cookie
@param cookie {@link Cookie}
@param response {@link HttpServletResponse}
@return {@link Boolean}
@since 1.0.8
"""
if (Checker.isNotNull(cookie) && Checker.isNotNull(response)) {
response.ad... | java | public static boolean addCookie(Cookie cookie, HttpServletResponse response) {
if (Checker.isNotNull(cookie) && Checker.isNotNull(response)) {
response.addCookie(cookie);
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"addCookie",
"(",
"Cookie",
"cookie",
",",
"HttpServletResponse",
"response",
")",
"{",
"if",
"(",
"Checker",
".",
"isNotNull",
"(",
"cookie",
")",
"&&",
"Checker",
".",
"isNotNull",
"(",
"response",
")",
")",
"{",
"response",
... | 添加Cookie
@param cookie {@link Cookie}
@param response {@link HttpServletResponse}
@return {@link Boolean}
@since 1.0.8 | [
"添加Cookie"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/NetUtils.java#L572-L578 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java | CommonOps_DDF4.subtractEquals | public static void subtractEquals( DMatrix4 a , DMatrix4 b ) {
"""
<p>Performs the following operation:<br>
<br>
a = a - b <br>
a<sub>i</sub> = a<sub>i</sub> - b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified.
"""
a.a1 -= b.a1;
a.a2 -= b.a2;
a... | java | public static void subtractEquals( DMatrix4 a , DMatrix4 b ) {
a.a1 -= b.a1;
a.a2 -= b.a2;
a.a3 -= b.a3;
a.a4 -= b.a4;
} | [
"public",
"static",
"void",
"subtractEquals",
"(",
"DMatrix4",
"a",
",",
"DMatrix4",
"b",
")",
"{",
"a",
".",
"a1",
"-=",
"b",
".",
"a1",
";",
"a",
".",
"a2",
"-=",
"b",
".",
"a2",
";",
"a",
".",
"a3",
"-=",
"b",
".",
"a3",
";",
"a",
".",
"... | <p>Performs the following operation:<br>
<br>
a = a - b <br>
a<sub>i</sub> = a<sub>i</sub> - b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"a",
"=",
"a",
"-",
"b",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"-",
"b<sub",
">",
"i<",
"/",
"sub",
">",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java#L229-L234 |
stapler/stapler | jelly/src/main/java/org/kohsuke/stapler/framework/adjunct/AdjunctManager.java | AdjunctManager.get | public Adjunct get(String name) throws IOException {
"""
Obtains the adjunct.
@return
always non-null.
@throws IOException
if failed to locate {@link Adjunct}.
"""
Adjunct a = adjuncts.get(name);
if(a!=null) return a; // found it
synchronized (this) {
a = adjuncts.g... | java | public Adjunct get(String name) throws IOException {
Adjunct a = adjuncts.get(name);
if(a!=null) return a; // found it
synchronized (this) {
a = adjuncts.get(name);
if(a!=null) return a; // one more check before we start loading
a = new Adjunct(this,name,... | [
"public",
"Adjunct",
"get",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"Adjunct",
"a",
"=",
"adjuncts",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"a",
"!=",
"null",
")",
"return",
"a",
";",
"// found it",
"synchronized",
"(",
"this",... | Obtains the adjunct.
@return
always non-null.
@throws IOException
if failed to locate {@link Adjunct}. | [
"Obtains",
"the",
"adjunct",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/jelly/src/main/java/org/kohsuke/stapler/framework/adjunct/AdjunctManager.java#L140-L151 |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.createNetworkResourceBundle | protected ResourceBundle createNetworkResourceBundle (
String root, String path, Set<String> rsrcList) {
"""
Creates an appropriate bundle for fetching resources from the network.
"""
return new NetworkResourceBundle(root, path, rsrcList);
} | java | protected ResourceBundle createNetworkResourceBundle (
String root, String path, Set<String> rsrcList)
{
return new NetworkResourceBundle(root, path, rsrcList);
} | [
"protected",
"ResourceBundle",
"createNetworkResourceBundle",
"(",
"String",
"root",
",",
"String",
"path",
",",
"Set",
"<",
"String",
">",
"rsrcList",
")",
"{",
"return",
"new",
"NetworkResourceBundle",
"(",
"root",
",",
"path",
",",
"rsrcList",
")",
";",
"}"... | Creates an appropriate bundle for fetching resources from the network. | [
"Creates",
"an",
"appropriate",
"bundle",
"for",
"fetching",
"resources",
"from",
"the",
"network",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L850-L854 |
OpenLiberty/open-liberty | dev/com.ibm.ws.concurrent.mp.1.0/src/com/ibm/ws/concurrent/mp/ManagedCompletableFuture.java | ManagedCompletableFuture.supplyAsync | @Trivial
public static <U> CompletableFuture<U> supplyAsync(Supplier<U> action) {
"""
Because CompletableFuture.supplyAsync is static, this is not a true override.
It will be difficult for the user to invoke this method because they would need to get the class
of the CompletableFuture implementation and loca... | java | @Trivial
public static <U> CompletableFuture<U> supplyAsync(Supplier<U> action) {
throw new UnsupportedOperationException(Tr.formatMessage(tc, "CWWKC1156.not.supported", "ManagedExecutor.supplyAsync"));
} | [
"@",
"Trivial",
"public",
"static",
"<",
"U",
">",
"CompletableFuture",
"<",
"U",
">",
"supplyAsync",
"(",
"Supplier",
"<",
"U",
">",
"action",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"Tr",
".",
"formatMessage",
"(",
"tc",
",",
"\"C... | Because CompletableFuture.supplyAsync is static, this is not a true override.
It will be difficult for the user to invoke this method because they would need to get the class
of the CompletableFuture implementation and locate the static supplyAsync method on that.
@throws UnsupportedOperationException directing the us... | [
"Because",
"CompletableFuture",
".",
"supplyAsync",
"is",
"static",
"this",
"is",
"not",
"a",
"true",
"override",
".",
"It",
"will",
"be",
"difficult",
"for",
"the",
"user",
"to",
"invoke",
"this",
"method",
"because",
"they",
"would",
"need",
"to",
"get",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent.mp.1.0/src/com/ibm/ws/concurrent/mp/ManagedCompletableFuture.java#L490-L493 |
groupon/odo | client/src/main/java/com/groupon/odo/client/Client.java | Client.getNextOrdinalForMethodId | private Integer getNextOrdinalForMethodId(int methodId, String pathName) throws Exception {
"""
Get the next available ordinal for a method ID
@param methodId ID of method
@return value of next ordinal
@throws Exception exception
"""
String pathInfo = doGet(BASE_PATH + uriEncode(pathName), new Bas... | java | private Integer getNextOrdinalForMethodId(int methodId, String pathName) throws Exception {
String pathInfo = doGet(BASE_PATH + uriEncode(pathName), new BasicNameValuePair[0]);
JSONObject pathResponse = new JSONObject(pathInfo);
JSONArray enabledEndpoints = pathResponse.getJSONArray("enabledEnd... | [
"private",
"Integer",
"getNextOrdinalForMethodId",
"(",
"int",
"methodId",
",",
"String",
"pathName",
")",
"throws",
"Exception",
"{",
"String",
"pathInfo",
"=",
"doGet",
"(",
"BASE_PATH",
"+",
"uriEncode",
"(",
"pathName",
")",
",",
"new",
"BasicNameValuePair",
... | Get the next available ordinal for a method ID
@param methodId ID of method
@return value of next ordinal
@throws Exception exception | [
"Get",
"the",
"next",
"available",
"ordinal",
"for",
"a",
"method",
"ID"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L932-L944 |
adyliu/jafka | src/main/java/io/jafka/utils/Utils.java | Utils.registerMBean | static boolean registerMBean(Object mbean, String name) {
"""
Register the given mbean with the platform mbean server,
unregistering any mbean that was there before. Note, this method
will not throw an exception if the registration fails (since there
is nothing you can do and it isn't fatal), instead it just re... | java | static boolean registerMBean(Object mbean, String name) {
try {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
synchronized (mbs) {
ObjectName objName = new ObjectName(name);
if (mbs.isRegistered(objName)) {
mbs.unregiste... | [
"static",
"boolean",
"registerMBean",
"(",
"Object",
"mbean",
",",
"String",
"name",
")",
"{",
"try",
"{",
"MBeanServer",
"mbs",
"=",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
";",
"synchronized",
"(",
"mbs",
")",
"{",
"ObjectName",
"objNam... | Register the given mbean with the platform mbean server,
unregistering any mbean that was there before. Note, this method
will not throw an exception if the registration fails (since there
is nothing you can do and it isn't fatal), instead it just returns
false indicating the registration failed.
@param mbean The obje... | [
"Register",
"the",
"given",
"mbean",
"with",
"the",
"platform",
"mbean",
"server",
"unregistering",
"any",
"mbean",
"that",
"was",
"there",
"before",
".",
"Note",
"this",
"method",
"will",
"not",
"throw",
"an",
"exception",
"if",
"the",
"registration",
"fails"... | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/utils/Utils.java#L371-L386 |
duracloud/mill | common/src/main/java/org/duracloud/mill/util/PropertyFileHelper.java | PropertyFileHelper.loadFromSystemProperty | public static void loadFromSystemProperty(String propertyFileSystemProperty, String defaultPropertyFilePath) {
"""
Ensures that a specified system property is set with a valid file path.
If the system property is not set, the specified default value will set instead.
If the resulting system property value does n... | java | public static void loadFromSystemProperty(String propertyFileSystemProperty, String defaultPropertyFilePath) {
String path = System.getProperty(propertyFileSystemProperty);
if (path == null) {
path = defaultPropertyFilePath;
System.setProperty(propertyFileSystemProperty, path);
... | [
"public",
"static",
"void",
"loadFromSystemProperty",
"(",
"String",
"propertyFileSystemProperty",
",",
"String",
"defaultPropertyFilePath",
")",
"{",
"String",
"path",
"=",
"System",
".",
"getProperty",
"(",
"propertyFileSystemProperty",
")",
";",
"if",
"(",
"path",
... | Ensures that a specified system property is set with a valid file path.
If the system property is not set, the specified default value will set instead.
If the resulting system property value does not resolve to an existing file,
The system will exit after logging the error.
@param profileFileSystemProperty The system... | [
"Ensures",
"that",
"a",
"specified",
"system",
"property",
"is",
"set",
"with",
"a",
"valid",
"file",
"path",
".",
"If",
"the",
"system",
"property",
"is",
"not",
"set",
"the",
"specified",
"default",
"value",
"will",
"set",
"instead",
".",
"If",
"the",
... | train | https://github.com/duracloud/mill/blob/854ac6edcba7fa2cab60993f172e82c2d1dad4bd/common/src/main/java/org/duracloud/mill/util/PropertyFileHelper.java#L35-L58 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java | JsonModelCoder.getList | public List<T> getList(JsonPullParser parser, OnJsonObjectAddListener listener)
throws IOException, JsonFormatException {
"""
Attempts to parse the given data as {@link List} of objects.<br>
Accepts {@link OnJsonObjectAddListener}; allows you to peek various intermittent instances as parsing goes.
@param pa... | java | public List<T> getList(JsonPullParser parser, OnJsonObjectAddListener listener)
throws IOException, JsonFormatException {
List<T> list = new ArrayList<T>();
State eventType = parser.getEventType();
if (eventType == State.VALUE_NULL) {
return null;
}
if (eventType != State.START_ARRAY) {
if (eventType... | [
"public",
"List",
"<",
"T",
">",
"getList",
"(",
"JsonPullParser",
"parser",
",",
"OnJsonObjectAddListener",
"listener",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"List",
"<",
"T",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"("... | Attempts to parse the given data as {@link List} of objects.<br>
Accepts {@link OnJsonObjectAddListener}; allows you to peek various intermittent instances as parsing goes.
@param parser {@link JsonPullParser} with some JSON-formatted data
@param listener {@link OnJsonObjectAddListener} to notify
@return {@link List} ... | [
"Attempts",
"to",
"parse",
"the",
"given",
"data",
"as",
"{",
"@link",
"List",
"}",
"of",
"objects",
".",
"<br",
">",
"Accepts",
"{",
"@link",
"OnJsonObjectAddListener",
"}",
";",
"allows",
"you",
"to",
"peek",
"various",
"intermittent",
"instances",
"as",
... | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java#L126-L147 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.logUserOut | public Boolean logUserOut(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Log a user out of any and all sessions.
@param id
Id of the user to be modified
@return true if success
@throws OAuthSystemException - if there is a IOException reading parameters of the httpUR... | java | public Boolean logUserOut(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
cleanError();
prepareToken();
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient();
OAuthClient oAuthClient = new OAuthClient(httpClient);
URIBuilder url = new URIBuilder(setting... | [
"public",
"Boolean",
"logUserOut",
"(",
"long",
"id",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"OneloginURLConnectionClient",
"httpClient",
"=",
"... | Log a user out of any and all sessions.
@param id
Id of the user to be modified
@return true if success
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and throwOA... | [
"Log",
"a",
"user",
"out",
"of",
"any",
"and",
"all",
"sessions",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L1399-L1423 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.translateDereference | private Context translateDereference(WyilFile.Expr.Dereference lval, Expr rval, Context context) {
"""
Translate an indirect assignment through a reference.
@param lval
The array assignment expression
@param result
The value being assigned to the given array element
@param context
The enclosing context
@r... | java | private Context translateDereference(WyilFile.Expr.Dereference lval, Expr rval, Context context) {
Expr e = translateDereference(lval, context.getEnvironment());
return context.assume(new Expr.Equal(e, rval));
} | [
"private",
"Context",
"translateDereference",
"(",
"WyilFile",
".",
"Expr",
".",
"Dereference",
"lval",
",",
"Expr",
"rval",
",",
"Context",
"context",
")",
"{",
"Expr",
"e",
"=",
"translateDereference",
"(",
"lval",
",",
"context",
".",
"getEnvironment",
"(",... | Translate an indirect assignment through a reference.
@param lval
The array assignment expression
@param result
The value being assigned to the given array element
@param context
The enclosing context
@return | [
"Translate",
"an",
"indirect",
"assignment",
"through",
"a",
"reference",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L666-L669 |
VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/factory/AbstractVueComponentFactoryGenerator.java | AbstractVueComponentFactoryGenerator.createProperties | private void createProperties(ClassName vueFactoryType, Builder vueFactoryBuilder) {
"""
Create the static properties used in our {@link VueComponentFactory}.
@param vueFactoryType The generated type name for our {@link VueComponentFactory}
@param vueFactoryBuilder The builder to create our {@link VueComponent... | java | private void createProperties(ClassName vueFactoryType, Builder vueFactoryBuilder) {
vueFactoryBuilder.addField(FieldSpec
.builder(vueFactoryType, INSTANCE_PROP, Modifier.PRIVATE, Modifier.STATIC)
.build());
} | [
"private",
"void",
"createProperties",
"(",
"ClassName",
"vueFactoryType",
",",
"Builder",
"vueFactoryBuilder",
")",
"{",
"vueFactoryBuilder",
".",
"addField",
"(",
"FieldSpec",
".",
"builder",
"(",
"vueFactoryType",
",",
"INSTANCE_PROP",
",",
"Modifier",
".",
"PRIV... | Create the static properties used in our {@link VueComponentFactory}.
@param vueFactoryType The generated type name for our {@link VueComponentFactory}
@param vueFactoryBuilder The builder to create our {@link VueComponentFactory} class | [
"Create",
"the",
"static",
"properties",
"used",
"in",
"our",
"{",
"@link",
"VueComponentFactory",
"}",
"."
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/factory/AbstractVueComponentFactoryGenerator.java#L149-L153 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/model/JBBPFieldStruct.java | JBBPFieldStruct.mapTo | public Object mapTo(final Object objectToMap, final JBBPMapperCustomFieldProcessor customFieldProcessor) {
"""
Map the structure fields to object fields.
@param objectToMap an object to map fields of the structure, must not be
null
@param customFieldProcessor a custom field processor to provide value... | java | public Object mapTo(final Object objectToMap, final JBBPMapperCustomFieldProcessor customFieldProcessor) {
return JBBPMapper.map(this, objectToMap, customFieldProcessor);
} | [
"public",
"Object",
"mapTo",
"(",
"final",
"Object",
"objectToMap",
",",
"final",
"JBBPMapperCustomFieldProcessor",
"customFieldProcessor",
")",
"{",
"return",
"JBBPMapper",
".",
"map",
"(",
"this",
",",
"objectToMap",
",",
"customFieldProcessor",
")",
";",
"}"
] | Map the structure fields to object fields.
@param objectToMap an object to map fields of the structure, must not be
null
@param customFieldProcessor a custom field processor to provide values for
custom mapping fields, it can be null if there is not any custom field
@return the same object from the arguments ... | [
"Map",
"the",
"structure",
"fields",
"to",
"object",
"fields",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/model/JBBPFieldStruct.java#L378-L380 |
plume-lib/options | src/main/java/org/plumelib/options/Options.java | Options.formatOptions | private String formatOptions(List<OptionInfo> optList, int maxLength, boolean showUnpublicized) {
"""
Format a list of options for use in generating usage messages. Also sets {@link #hasListOption}
if any option has list type.
@param optList the options to format
@param maxLength the maximum number of charact... | java | private String formatOptions(List<OptionInfo> optList, int maxLength, boolean showUnpublicized) {
StringJoiner buf = new StringJoiner(lineSeparator);
for (OptionInfo oi : optList) {
if (oi.unpublicized && !showUnpublicized) {
continue;
}
String defaultStr = "";
if (oi.defaultStr ... | [
"private",
"String",
"formatOptions",
"(",
"List",
"<",
"OptionInfo",
">",
"optList",
",",
"int",
"maxLength",
",",
"boolean",
"showUnpublicized",
")",
"{",
"StringJoiner",
"buf",
"=",
"new",
"StringJoiner",
"(",
"lineSeparator",
")",
";",
"for",
"(",
"OptionI... | Format a list of options for use in generating usage messages. Also sets {@link #hasListOption}
if any option has list type.
@param optList the options to format
@param maxLength the maximum number of characters in the output
@param showUnpublicized if true, include unpublicized options in the output
@return the forma... | [
"Format",
"a",
"list",
"of",
"options",
"for",
"use",
"in",
"generating",
"usage",
"messages",
".",
"Also",
"sets",
"{",
"@link",
"#hasListOption",
"}",
"if",
"any",
"option",
"has",
"list",
"type",
"."
] | train | https://github.com/plume-lib/options/blob/1bdd0ac7a1794bdf9dd373e279f69d43395154f0/src/main/java/org/plumelib/options/Options.java#L1199-L1220 |
banq/jdonframework | JdonAccessory/jdon-hibernate3x/src/main/java/com/jdon/model/query/block/BlockStrategy.java | BlockStrategy.getBlock | private Block getBlock(QueryConditonDatakey qcdk) {
"""
get the current block being avaliable to the query condition
@param qcdk
@return
"""
Block clientBlock = new Block(qcdk.getStart(), qcdk.getCount());
if (clientBlock.getCount() > this.blockLength)
clientBlock.setCount(this.blockLength);
... | java | private Block getBlock(QueryConditonDatakey qcdk) {
Block clientBlock = new Block(qcdk.getStart(), qcdk.getCount());
if (clientBlock.getCount() > this.blockLength)
clientBlock.setCount(this.blockLength);
// create dataBlock get DataBase or cache;
List list = getBlockKeys(qcdk);
Block dataBlock = ne... | [
"private",
"Block",
"getBlock",
"(",
"QueryConditonDatakey",
"qcdk",
")",
"{",
"Block",
"clientBlock",
"=",
"new",
"Block",
"(",
"qcdk",
".",
"getStart",
"(",
")",
",",
"qcdk",
".",
"getCount",
"(",
")",
")",
";",
"if",
"(",
"clientBlock",
".",
"getCount... | get the current block being avaliable to the query condition
@param qcdk
@return | [
"get",
"the",
"current",
"block",
"being",
"avaliable",
"to",
"the",
"query",
"condition"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-hibernate3x/src/main/java/com/jdon/model/query/block/BlockStrategy.java#L167-L217 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/network/NetworkUtil.java | NetworkUtil.toURI | public static URI toURI(InetAddress adr) {
"""
Convert an inet address to an URI.
@param adr address to convert to URI.
@return the URI.
"""
try {
return new URI("tcp", adr.getHostAddress(), null, null); //$NON-NLS-1$
} catch (URISyntaxException e) {
throw new IOError(e);
}
} | java | public static URI toURI(InetAddress adr) {
try {
return new URI("tcp", adr.getHostAddress(), null, null); //$NON-NLS-1$
} catch (URISyntaxException e) {
throw new IOError(e);
}
} | [
"public",
"static",
"URI",
"toURI",
"(",
"InetAddress",
"adr",
")",
"{",
"try",
"{",
"return",
"new",
"URI",
"(",
"\"tcp\"",
",",
"adr",
".",
"getHostAddress",
"(",
")",
",",
"null",
",",
"null",
")",
";",
"//$NON-NLS-1$",
"}",
"catch",
"(",
"URISyntax... | Convert an inet address to an URI.
@param adr address to convert to URI.
@return the URI. | [
"Convert",
"an",
"inet",
"address",
"to",
"an",
"URI",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/network/NetworkUtil.java#L170-L176 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/RuntimeUtil.java | RuntimeUtil.getResult | public static String getResult(Process process, Charset charset) {
"""
获取命令执行结果,获取后销毁进程
@param process {@link Process} 进程
@param charset 编码
@return 命令执行结果列表
@since 3.1.2
"""
InputStream in = null;
try {
in = process.getInputStream();
return IoUtil.read(in, charset);
} finally {
IoUti... | java | public static String getResult(Process process, Charset charset) {
InputStream in = null;
try {
in = process.getInputStream();
return IoUtil.read(in, charset);
} finally {
IoUtil.close(in);
destroy(process);
}
} | [
"public",
"static",
"String",
"getResult",
"(",
"Process",
"process",
",",
"Charset",
"charset",
")",
"{",
"InputStream",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"process",
".",
"getInputStream",
"(",
")",
";",
"return",
"IoUtil",
".",
"read",
"("... | 获取命令执行结果,获取后销毁进程
@param process {@link Process} 进程
@param charset 编码
@return 命令执行结果列表
@since 3.1.2 | [
"获取命令执行结果,获取后销毁进程"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/RuntimeUtil.java#L191-L200 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAvatar.java | GVRAvatar.loadAnimation | public void loadAnimation(GVRAndroidResource animResource, String boneMap) {
"""
Load an animation for the current avatar.
@param animResource resource with the animation
@param boneMap optional bone map to map animation skeleton to avatar
"""
String filePath = animResource.getResourcePath();
... | java | public void loadAnimation(GVRAndroidResource animResource, String boneMap)
{
String filePath = animResource.getResourcePath();
GVRContext ctx = mAvatarRoot.getGVRContext();
GVRResourceVolume volume = new GVRResourceVolume(ctx, animResource);
if (filePath.endsWith(".bvh"))
{
... | [
"public",
"void",
"loadAnimation",
"(",
"GVRAndroidResource",
"animResource",
",",
"String",
"boneMap",
")",
"{",
"String",
"filePath",
"=",
"animResource",
".",
"getResourcePath",
"(",
")",
";",
"GVRContext",
"ctx",
"=",
"mAvatarRoot",
".",
"getGVRContext",
"(",
... | Load an animation for the current avatar.
@param animResource resource with the animation
@param boneMap optional bone map to map animation skeleton to avatar | [
"Load",
"an",
"animation",
"for",
"the",
"current",
"avatar",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAvatar.java#L251-L308 |
google/error-prone | check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java | ASTHelpers.binaryNumericPromotion | @Nullable
private static Type binaryNumericPromotion(Type leftType, Type rightType, VisitorState state) {
"""
Implementation of binary numeric promotion rules.
<p><a href="https://docs.oracle.com/javase/specs/jls/se9/html/jls-5.html#jls-5.6.2">JLS
§5.6.2</a>
"""
Type unboxedLeft = unboxAndEnsureNumer... | java | @Nullable
private static Type binaryNumericPromotion(Type leftType, Type rightType, VisitorState state) {
Type unboxedLeft = unboxAndEnsureNumeric(leftType, state);
Type unboxedRight = unboxAndEnsureNumeric(rightType, state);
Set<TypeTag> tags = EnumSet.of(unboxedLeft.getTag(), unboxedRight.getTag());
... | [
"@",
"Nullable",
"private",
"static",
"Type",
"binaryNumericPromotion",
"(",
"Type",
"leftType",
",",
"Type",
"rightType",
",",
"VisitorState",
"state",
")",
"{",
"Type",
"unboxedLeft",
"=",
"unboxAndEnsureNumeric",
"(",
"leftType",
",",
"state",
")",
";",
"Type... | Implementation of binary numeric promotion rules.
<p><a href="https://docs.oracle.com/javase/specs/jls/se9/html/jls-5.html#jls-5.6.2">JLS
§5.6.2</a> | [
"Implementation",
"of",
"binary",
"numeric",
"promotion",
"rules",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java#L1272-L1286 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/linear/STGD.java | STGD.setThreshold | public void setThreshold(double threshold) {
"""
Sets the threshold for a coefficient value to avoid regularization. While
a coefficient reaches this magnitude, regularization will not be applied.
@param threshold the coefficient regularization threshold in
( 0, Infinity ]
"""
if(Double.isNaN(thresh... | java | public void setThreshold(double threshold)
{
if(Double.isNaN(threshold) || threshold <= 0)
throw new IllegalArgumentException("Threshold must be positive, not " + threshold);
this.threshold = threshold;
} | [
"public",
"void",
"setThreshold",
"(",
"double",
"threshold",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"threshold",
")",
"||",
"threshold",
"<=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Threshold must be positive, not \"",
"+",
"th... | Sets the threshold for a coefficient value to avoid regularization. While
a coefficient reaches this magnitude, regularization will not be applied.
@param threshold the coefficient regularization threshold in
( 0, Infinity ] | [
"Sets",
"the",
"threshold",
"for",
"a",
"coefficient",
"value",
"to",
"avoid",
"regularization",
".",
"While",
"a",
"coefficient",
"reaches",
"this",
"magnitude",
"regularization",
"will",
"not",
"be",
"applied",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/STGD.java#L130-L135 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.