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 |
|---|---|---|---|---|---|---|---|---|---|---|
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LRImporter.java | LRImporter.getObtainJSONData | public LRResult getObtainJSONData(String resumptionToken) throws LRException {
"""
Get a result from an obtain request
@param resumptionToken the "resumption_token" value to use for this request
@return the result from this request
"""
return getObtainJSONData(null, null, null, null, resumptionToke... | java | public LRResult getObtainJSONData(String resumptionToken) throws LRException
{
return getObtainJSONData(null, null, null, null, resumptionToken);
} | [
"public",
"LRResult",
"getObtainJSONData",
"(",
"String",
"resumptionToken",
")",
"throws",
"LRException",
"{",
"return",
"getObtainJSONData",
"(",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"resumptionToken",
")",
";",
"}"
] | Get a result from an obtain request
@param resumptionToken the "resumption_token" value to use for this request
@return the result from this request | [
"Get",
"a",
"result",
"from",
"an",
"obtain",
"request"
] | train | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRImporter.java#L217-L220 |
Red5/red5-server-common | src/main/java/org/red5/server/util/ScopeUtils.java | ScopeUtils.isAncestor | public static boolean isAncestor(IBasicScope from, IBasicScope ancestor) {
"""
Check whether one scope is an ancestor of another
@param from
Scope
@param ancestor
Scope to check
@return <pre>
true
</pre>
if ancestor scope is really an ancestor of scope passed as from parameter,
<pre>
false
</pre>
... | java | public static boolean isAncestor(IBasicScope from, IBasicScope ancestor) {
IBasicScope current = from;
while (current.hasParent()) {
current = current.getParent();
if (current.equals(ancestor)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isAncestor",
"(",
"IBasicScope",
"from",
",",
"IBasicScope",
"ancestor",
")",
"{",
"IBasicScope",
"current",
"=",
"from",
";",
"while",
"(",
"current",
".",
"hasParent",
"(",
")",
")",
"{",
"current",
"=",
"current",
".",
"g... | Check whether one scope is an ancestor of another
@param from
Scope
@param ancestor
Scope to check
@return <pre>
true
</pre>
if ancestor scope is really an ancestor of scope passed as from parameter,
<pre>
false
</pre>
otherwise. | [
"Check",
"whether",
"one",
"scope",
"is",
"an",
"ancestor",
"of",
"another"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/ScopeUtils.java#L151-L160 |
ivanceras/orm | src/main/java/com/ivanceras/db/api/ModelDef.java | ModelDef.getPlainProperties | public String[] getPlainProperties() {
"""
Get the properties that are pertaining to the model, this does not include linker columns
@return
"""
String[] commonColumns = {"created", "createdby", "updated","updatedby", "isactive"};
String[] referencedProperties = getReferencedColumns();
List<String> plai... | java | public String[] getPlainProperties(){
String[] commonColumns = {"created", "createdby", "updated","updatedby", "isactive"};
String[] referencedProperties = getReferencedColumns();
List<String> plainProperties = new ArrayList<String>();
for(String att : attributes){
if(CStringUtils.indexOf(referencedPropertie... | [
"public",
"String",
"[",
"]",
"getPlainProperties",
"(",
")",
"{",
"String",
"[",
"]",
"commonColumns",
"=",
"{",
"\"created\"",
",",
"\"createdby\"",
",",
"\"updated\"",
",",
"\"updatedby\"",
",",
"\"isactive\"",
"}",
";",
"String",
"[",
"]",
"referencedPrope... | Get the properties that are pertaining to the model, this does not include linker columns
@return | [
"Get",
"the",
"properties",
"that",
"are",
"pertaining",
"to",
"the",
"model",
"this",
"does",
"not",
"include",
"linker",
"columns"
] | train | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/api/ModelDef.java#L342-L361 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java | Notification.isActiveForTriggerAndMetric | public boolean isActiveForTriggerAndMetric(Trigger trigger, Metric metric) {
"""
Given a metric,notification combination, indicates whether a triggering condition associated with this notification is still in a triggering state.
@param trigger The Trigger that caused this notification
@param metric The metric ... | java | public boolean isActiveForTriggerAndMetric(Trigger trigger, Metric metric) {
String key = _hashTriggerAndMetric(trigger, metric);
return this.activeStatusByTriggerAndMetric.containsKey(key) ? activeStatusByTriggerAndMetric.get(key) : false;
} | [
"public",
"boolean",
"isActiveForTriggerAndMetric",
"(",
"Trigger",
"trigger",
",",
"Metric",
"metric",
")",
"{",
"String",
"key",
"=",
"_hashTriggerAndMetric",
"(",
"trigger",
",",
"metric",
")",
";",
"return",
"this",
".",
"activeStatusByTriggerAndMetric",
".",
... | Given a metric,notification combination, indicates whether a triggering condition associated with this notification is still in a triggering state.
@param trigger The Trigger that caused this notification
@param metric The metric that caused this notification
@return True if the triggering condition is still in a tri... | [
"Given",
"a",
"metric",
"notification",
"combination",
"indicates",
"whether",
"a",
"triggering",
"condition",
"associated",
"with",
"this",
"notification",
"is",
"still",
"in",
"a",
"triggering",
"state",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Notification.java#L600-L603 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/cli/CommandLineParser.java | CommandLineParser.processSystemArg | protected void processSystemArg(DefaultCommandLine cl, String arg) {
"""
Process System property arg.
@param cl cl
@param arg system arg
"""
int i = arg.indexOf("=");
String name = arg.substring(2, i);
String value = arg.substring(i + 1, arg.length());
cl.addSystemProperty(nam... | java | protected void processSystemArg(DefaultCommandLine cl, String arg) {
int i = arg.indexOf("=");
String name = arg.substring(2, i);
String value = arg.substring(i + 1, arg.length());
cl.addSystemProperty(name, value);
} | [
"protected",
"void",
"processSystemArg",
"(",
"DefaultCommandLine",
"cl",
",",
"String",
"arg",
")",
"{",
"int",
"i",
"=",
"arg",
".",
"indexOf",
"(",
"\"=\"",
")",
";",
"String",
"name",
"=",
"arg",
".",
"substring",
"(",
"2",
",",
"i",
")",
";",
"S... | Process System property arg.
@param cl cl
@param arg system arg | [
"Process",
"System",
"property",
"arg",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/cli/CommandLineParser.java#L192-L197 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/StringUtils.java | StringUtils.replaceAll | @NullSafe
public static String replaceAll(String value, String pattern, String replacement) {
"""
Null-safe method to replace the specified pattern in the given {@link String} value with
the replacement {@link String}.
For example, given the following String...
<code>
"///absolute//path/to/////some////fi... | java | @NullSafe
public static String replaceAll(String value, String pattern, String replacement) {
if (!ObjectUtils.areAnyNull(value, pattern, replacement)) {
value = Pattern.compile(pattern).matcher(value).replaceAll(replacement);
}
return value;
} | [
"@",
"NullSafe",
"public",
"static",
"String",
"replaceAll",
"(",
"String",
"value",
",",
"String",
"pattern",
",",
"String",
"replacement",
")",
"{",
"if",
"(",
"!",
"ObjectUtils",
".",
"areAnyNull",
"(",
"value",
",",
"pattern",
",",
"replacement",
")",
... | Null-safe method to replace the specified pattern in the given {@link String} value with
the replacement {@link String}.
For example, given the following String...
<code>
"///absolute//path/to/////some////file.ext"
</code>
When 'pattern' is "/+" and 'replacement' is "/", the resulting, returned String value will be.... | [
"Null",
"-",
"safe",
"method",
"to",
"replace",
"the",
"specified",
"pattern",
"in",
"the",
"given",
"{",
"@link",
"String",
"}",
"value",
"with",
"the",
"replacement",
"{",
"@link",
"String",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/StringUtils.java#L490-L498 |
hazelcast/hazelcast | hazelcast-client/src/main/java/com/hazelcast/client/cache/impl/ClientCacheHelper.java | ClientCacheHelper.enableStatisticManagementOnNodes | static void enableStatisticManagementOnNodes(HazelcastClientInstanceImpl client, String cacheName,
boolean statOrMan, boolean enabled) {
"""
Enables/disables statistics or management support of cache on the all servers in the cluster.
@param client the client ... | java | static void enableStatisticManagementOnNodes(HazelcastClientInstanceImpl client, String cacheName,
boolean statOrMan, boolean enabled) {
Collection<Member> members = client.getClientClusterService().getMemberList();
Collection<Future> futures = new ArrayL... | [
"static",
"void",
"enableStatisticManagementOnNodes",
"(",
"HazelcastClientInstanceImpl",
"client",
",",
"String",
"cacheName",
",",
"boolean",
"statOrMan",
",",
"boolean",
"enabled",
")",
"{",
"Collection",
"<",
"Member",
">",
"members",
"=",
"client",
".",
"getCli... | Enables/disables statistics or management support of cache on the all servers in the cluster.
@param client the client instance which will send the operation to server
@param cacheName full cache name with prefixes
@param statOrMan flag that represents which one of the statistics or management will be enabled
@para... | [
"Enables",
"/",
"disables",
"statistics",
"or",
"management",
"support",
"of",
"cache",
"on",
"the",
"all",
"servers",
"in",
"the",
"cluster",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/cache/impl/ClientCacheHelper.java#L242-L259 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainImpl.java | JsMainImpl.stopMessagingEngine | public void stopMessagingEngine(String busName, String name, String mode)
throws Exception {
"""
Stop a messaging engine
@param busName
@param name
@param mode
"""
String thisMethodName = CLASS_NAME
+ ".stopMessagingEngine(String, String, String... | java | public void stopMessagingEngine(String busName, String name, String mode)
throws Exception {
String thisMethodName = CLASS_NAME
+ ".stopMessagingEngine(String, String, String)";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
... | [
"public",
"void",
"stopMessagingEngine",
"(",
"String",
"busName",
",",
"String",
"name",
",",
"String",
"mode",
")",
"throws",
"Exception",
"{",
"String",
"thisMethodName",
"=",
"CLASS_NAME",
"+",
"\".stopMessagingEngine(String, String, String)\"",
";",
"if",
"(",
... | Stop a messaging engine
@param busName
@param name
@param mode | [
"Stop",
"a",
"messaging",
"engine"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainImpl.java#L883-L900 |
jbossas/jboss-invocation | src/main/java/org/jboss/invocation/proxy/AbstractSubclassFactory.java | AbstractSubclassFactory.overrideToString | protected boolean overrideToString(MethodBodyCreator creator) {
"""
Override the toString method using the given {@link MethodBodyCreator}.
@param creator the method body creator to use
@return true if the method was not already overridden
"""
Method toString = null;
final ClassMetadataSour... | java | protected boolean overrideToString(MethodBodyCreator creator) {
Method toString = null;
final ClassMetadataSource data = reflectionMetadataSource.getClassMetadata(Object.class);
try {
toString = data.getMethod("toString", String.class);
} catch (Exception e) {
thr... | [
"protected",
"boolean",
"overrideToString",
"(",
"MethodBodyCreator",
"creator",
")",
"{",
"Method",
"toString",
"=",
"null",
";",
"final",
"ClassMetadataSource",
"data",
"=",
"reflectionMetadataSource",
".",
"getClassMetadata",
"(",
"Object",
".",
"class",
")",
";"... | Override the toString method using the given {@link MethodBodyCreator}.
@param creator the method body creator to use
@return true if the method was not already overridden | [
"Override",
"the",
"toString",
"method",
"using",
"the",
"given",
"{",
"@link",
"MethodBodyCreator",
"}",
"."
] | train | https://github.com/jbossas/jboss-invocation/blob/f72586a554264cbc78fcdad9fdd3e84b833249c9/src/main/java/org/jboss/invocation/proxy/AbstractSubclassFactory.java#L299-L308 |
kkopacz/agiso-tempel | bundles/tempel-support-file/src/main/java/org/agiso/tempel/support/file/provider/UsrTemplateProviderElement.java | UsrTemplateProviderElement.readUsrTemplates | private boolean readUsrTemplates(final ITemplateRepository templateRepository) throws IOException {
"""
Odczytuje szablony repozytorium użytkownika (katalogu .tempel w lokalizacji
domowej użytkownika) opisane w pliku .tempel/template.xml. Jeśli pliku nie
ma zakłada odpowiednie struktury w katalogu domowym.
@p... | java | private boolean readUsrTemplates(final ITemplateRepository templateRepository) throws IOException {
// Mapa szablonów użytkownika (katalog domowy użytkownika):
File usrSettingsFile = new File(settingsPath);
if(usrSettingsFile.exists()) {
try {
tempelFileProcessor.process(usrSettingsFile, new ITempelEntryPr... | [
"private",
"boolean",
"readUsrTemplates",
"(",
"final",
"ITemplateRepository",
"templateRepository",
")",
"throws",
"IOException",
"{",
"// Mapa szablonów użytkownika (katalog domowy użytkownika):",
"File",
"usrSettingsFile",
"=",
"new",
"File",
"(",
"settingsPath",
")",
";",... | Odczytuje szablony repozytorium użytkownika (katalogu .tempel w lokalizacji
domowej użytkownika) opisane w pliku .tempel/template.xml. Jeśli pliku nie
ma zakłada odpowiednie struktury w katalogu domowym.
@param templateRepository
@throws IOException | [
"Odczytuje",
"szablony",
"repozytorium",
"użytkownika",
"(",
"katalogu",
".",
"tempel",
"w",
"lokalizacji",
"domowej",
"użytkownika",
")",
"opisane",
"w",
"pliku",
".",
"tempel",
"/",
"template",
".",
"xml",
".",
"Jeśli",
"pliku",
"nie",
"ma",
"zakłada",
"odpo... | train | https://github.com/kkopacz/agiso-tempel/blob/ff7a96153153b6bc07212d776816b87d9538f6fa/bundles/tempel-support-file/src/main/java/org/agiso/tempel/support/file/provider/UsrTemplateProviderElement.java#L137-L179 |
SUSE/salt-netapi-client | src/main/java/com/suse/salt/netapi/calls/LocalCall.java | LocalCall.callAsync | public CompletionStage<Optional<LocalAsyncResult<R>>> callAsync(final SaltClient client, Target<?> target,
AuthMethod auth, Batch batch) {
"""
Calls a execution module function on the given target asynchronously and
returns information about the ... | java | public CompletionStage<Optional<LocalAsyncResult<R>>> callAsync(final SaltClient client, Target<?> target,
AuthMethod auth, Batch batch) {
return callAsync(client, target, auth, Optional.of(batch));
} | [
"public",
"CompletionStage",
"<",
"Optional",
"<",
"LocalAsyncResult",
"<",
"R",
">",
">",
">",
"callAsync",
"(",
"final",
"SaltClient",
"client",
",",
"Target",
"<",
"?",
">",
"target",
",",
"AuthMethod",
"auth",
",",
"Batch",
"batch",
")",
"{",
"return",... | Calls a execution module function on the given target asynchronously and
returns information about the scheduled job that can be used to query the result.
Authentication is done with the token therefore you have to login prior
to using this function.
@param client SaltClient instance
@param target the target for the f... | [
"Calls",
"a",
"execution",
"module",
"function",
"on",
"the",
"given",
"target",
"asynchronously",
"and",
"returns",
"information",
"about",
"the",
"scheduled",
"job",
"that",
"can",
"be",
"used",
"to",
"query",
"the",
"result",
".",
"Authentication",
"is",
"d... | train | https://github.com/SUSE/salt-netapi-client/blob/a0bdf643c8e34fa4def4b915366594c1491fdad5/src/main/java/com/suse/salt/netapi/calls/LocalCall.java#L128-L131 |
Azure/azure-sdk-for-java | authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java | RoleAssignmentsInner.createById | public RoleAssignmentInner createById(String roleAssignmentId, RoleAssignmentProperties properties) {
"""
Creates a role assignment by ID.
@param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and resource type. Use the format, /{scope}/providers/Microsoft.Aut... | java | public RoleAssignmentInner createById(String roleAssignmentId, RoleAssignmentProperties properties) {
return createByIdWithServiceResponseAsync(roleAssignmentId, properties).toBlocking().single().body();
} | [
"public",
"RoleAssignmentInner",
"createById",
"(",
"String",
"roleAssignmentId",
",",
"RoleAssignmentProperties",
"properties",
")",
"{",
"return",
"createByIdWithServiceResponseAsync",
"(",
"roleAssignmentId",
",",
"properties",
")",
".",
"toBlocking",
"(",
")",
".",
... | Creates a role assignment by ID.
@param roleAssignmentId The fully qualified ID of the role assignment, including the scope, resource name and resource type. Use the format, /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: /subscriptions/{subId}/resourcegroups/{rgname}//provide... | [
"Creates",
"a",
"role",
"assignment",
"by",
"ID",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java#L993-L995 |
landawn/AbacusUtil | src/com/landawn/abacus/util/LongList.java | LongList.noneMatch | public <E extends Exception> boolean noneMatch(Try.LongPredicate<E> filter) throws E {
"""
Returns whether no elements of this List match the provided predicate.
@param filter
@return
"""
return noneMatch(0, size(), filter);
} | java | public <E extends Exception> boolean noneMatch(Try.LongPredicate<E> filter) throws E {
return noneMatch(0, size(), filter);
} | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"boolean",
"noneMatch",
"(",
"Try",
".",
"LongPredicate",
"<",
"E",
">",
"filter",
")",
"throws",
"E",
"{",
"return",
"noneMatch",
"(",
"0",
",",
"size",
"(",
")",
",",
"filter",
")",
";",
"}"
] | Returns whether no elements of this List match the provided predicate.
@param filter
@return | [
"Returns",
"whether",
"no",
"elements",
"of",
"this",
"List",
"match",
"the",
"provided",
"predicate",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/LongList.java#L968-L970 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/asm/AsmUtils.java | AsmUtils.findInstruction | public static AbstractInsnNode findInstruction(MethodNode method, InsnList matches, int index) {
"""
Finds instruction a specific instruction list inside a method, starting from the specified index.
@param method the method
@param matches the matches
@param index the index
@return the abstract insn node
... | java | public static AbstractInsnNode findInstruction(MethodNode method, InsnList matches, int index)
{
AbstractInsnNode node = method.instructions.get(index);
AbstractInsnNode match = matches.getFirst();
while (node != null)
{
if (insnEqual(node, match))
{
AbstractInsnNode m = match.getNext();
Abstract... | [
"public",
"static",
"AbstractInsnNode",
"findInstruction",
"(",
"MethodNode",
"method",
",",
"InsnList",
"matches",
",",
"int",
"index",
")",
"{",
"AbstractInsnNode",
"node",
"=",
"method",
".",
"instructions",
".",
"get",
"(",
"index",
")",
";",
"AbstractInsnNo... | Finds instruction a specific instruction list inside a method, starting from the specified index.
@param method the method
@param matches the matches
@param index the index
@return the abstract insn node | [
"Finds",
"instruction",
"a",
"specific",
"instruction",
"list",
"inside",
"a",
"method",
"starting",
"from",
"the",
"specified",
"index",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/asm/AsmUtils.java#L116-L138 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java | MappingUtils.callGetter | public static Object callGetter(Object target, PropertyDescriptor prop) {
"""
Invokes Property Descriptor Getter and returns value returned by that function.
@param target Object Getter of which would be executed
@param prop Property Descriptor which would be used to invoke Getter
@return Value returned fro... | java | public static Object callGetter(Object target, PropertyDescriptor prop) {
Object result = null;
Method getter = prop.getReadMethod();
if (getter == null) {
throw new RuntimeException("No read method for bean property "
+ target.getClass() + " " + prop.get... | [
"public",
"static",
"Object",
"callGetter",
"(",
"Object",
"target",
",",
"PropertyDescriptor",
"prop",
")",
"{",
"Object",
"result",
"=",
"null",
";",
"Method",
"getter",
"=",
"prop",
".",
"getReadMethod",
"(",
")",
";",
"if",
"(",
"getter",
"==",
"null",... | Invokes Property Descriptor Getter and returns value returned by that function.
@param target Object Getter of which would be executed
@param prop Property Descriptor which would be used to invoke Getter
@return Value returned from Getter | [
"Invokes",
"Property",
"Descriptor",
"Getter",
"and",
"returns",
"value",
"returned",
"by",
"that",
"function",
"."
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java#L120-L143 |
b3dgs/lionengine | lionengine-network/src/main/java/com/b3dgs/lionengine/network/message/NetworkMessageEntity.java | NetworkMessageEntity.addAction | public void addAction(M element, byte value) {
"""
Add an action.
@param element The action type.
@param value The action value.
"""
actions.put(element, Byte.valueOf(value));
} | java | public void addAction(M element, byte value)
{
actions.put(element, Byte.valueOf(value));
} | [
"public",
"void",
"addAction",
"(",
"M",
"element",
",",
"byte",
"value",
")",
"{",
"actions",
".",
"put",
"(",
"element",
",",
"Byte",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"}"
] | Add an action.
@param element The action type.
@param value The action value. | [
"Add",
"an",
"action",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-network/src/main/java/com/b3dgs/lionengine/network/message/NetworkMessageEntity.java#L133-L136 |
nats-io/java-nats-streaming | src/examples/java/io/nats/streaming/examples/Subscriber.java | Subscriber.parseDuration | private static Duration parseDuration(String duration) throws ParseException {
"""
Parses a duration string of the form "98d 01h 23m 45s" into milliseconds.
@throws ParseException if the duration can't be parsed
"""
Matcher matcher = pattern.matcher(duration);
long nanoseconds = 0L;
... | java | private static Duration parseDuration(String duration) throws ParseException {
Matcher matcher = pattern.matcher(duration);
long nanoseconds = 0L;
if (matcher.find() && matcher.groupCount() == 4) {
int days = Integer.parseInt(matcher.group(1));
nanoseconds += TimeUnit.N... | [
"private",
"static",
"Duration",
"parseDuration",
"(",
"String",
"duration",
")",
"throws",
"ParseException",
"{",
"Matcher",
"matcher",
"=",
"pattern",
".",
"matcher",
"(",
"duration",
")",
";",
"long",
"nanoseconds",
"=",
"0L",
";",
"if",
"(",
"matcher",
"... | Parses a duration string of the form "98d 01h 23m 45s" into milliseconds.
@throws ParseException if the duration can't be parsed | [
"Parses",
"a",
"duration",
"string",
"of",
"the",
"form",
"98d",
"01h",
"23m",
"45s",
"into",
"milliseconds",
"."
] | train | https://github.com/nats-io/java-nats-streaming/blob/72f964e9093622875d7f1c85ce60820e028863e7/src/examples/java/io/nats/streaming/examples/Subscriber.java#L243-L264 |
apiman/apiman | common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java | PluginUtils.getUserM2Repository | public static File getUserM2Repository() {
"""
Gets the user's local m2 directory or null if not found.
@return user's M2 repo
"""
// if there is m2override system propery, use it.
String m2Override = System.getProperty("apiman.gateway.m2-repository-path"); //$NON-NLS-1$
if (m2Override != ... | java | public static File getUserM2Repository() {
// if there is m2override system propery, use it.
String m2Override = System.getProperty("apiman.gateway.m2-repository-path"); //$NON-NLS-1$
if (m2Override != null) {
return new File(m2Override).getAbsoluteFile();
}
String userH... | [
"public",
"static",
"File",
"getUserM2Repository",
"(",
")",
"{",
"// if there is m2override system propery, use it.",
"String",
"m2Override",
"=",
"System",
".",
"getProperty",
"(",
"\"apiman.gateway.m2-repository-path\"",
")",
";",
"//$NON-NLS-1$",
"if",
"(",
"m2Override"... | Gets the user's local m2 directory or null if not found.
@return user's M2 repo | [
"Gets",
"the",
"user",
"s",
"local",
"m2",
"directory",
"or",
"null",
"if",
"not",
"found",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/plugin/src/main/java/io/apiman/common/plugin/PluginUtils.java#L100-L118 |
Gagravarr/VorbisJava | core/src/main/java/org/gagravarr/vorbis/VorbisPacketFactory.java | VorbisPacketFactory.populateMetadataHeader | protected static void populateMetadataHeader(byte[] b, int type, int dataLength) {
"""
Popupulates the metadata packet header,
which is "#vorbis" where # is the type.
"""
b[0] = IOUtils.fromInt(type);
b[1] = (byte)'v';
b[2] = (byte)'o';
b[3] = (byte)'r';
b[4] = (byte)'b... | java | protected static void populateMetadataHeader(byte[] b, int type, int dataLength) {
b[0] = IOUtils.fromInt(type);
b[1] = (byte)'v';
b[2] = (byte)'o';
b[3] = (byte)'r';
b[4] = (byte)'b';
b[5] = (byte)'i';
b[6] = (byte)'s';
} | [
"protected",
"static",
"void",
"populateMetadataHeader",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"type",
",",
"int",
"dataLength",
")",
"{",
"b",
"[",
"0",
"]",
"=",
"IOUtils",
".",
"fromInt",
"(",
"type",
")",
";",
"b",
"[",
"1",
"]",
"=",
"(",
... | Popupulates the metadata packet header,
which is "#vorbis" where # is the type. | [
"Popupulates",
"the",
"metadata",
"packet",
"header",
"which",
"is",
"#vorbis",
"where",
"#",
"is",
"the",
"type",
"."
] | train | https://github.com/Gagravarr/VorbisJava/blob/22b4d645b00386d59d17a336a2bc9d54db08df16/core/src/main/java/org/gagravarr/vorbis/VorbisPacketFactory.java#L31-L39 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/JsonMapper.java | JsonMapper.addClassDeserializer | public <T> void addClassDeserializer(Class<T> classToMap, JsonDeserializer<? extends T> classDeserializer) {
"""
Adds a deserializer to this mapper. Allows a user to alter the deserialization behavior for a certain type.
@param classToMap the class for which the given serializer is meant
@param classDeser... | java | public <T> void addClassDeserializer(Class<T> classToMap, JsonDeserializer<? extends T> classDeserializer) {
setNewObjectMapper(); // Is this right, setting a new object mapper on each add operation?
SimpleModule mod = new SimpleModule("GeolatteCommonModule-" + classDeserializer.getClass().getSimpleName... | [
"public",
"<",
"T",
">",
"void",
"addClassDeserializer",
"(",
"Class",
"<",
"T",
">",
"classToMap",
",",
"JsonDeserializer",
"<",
"?",
"extends",
"T",
">",
"classDeserializer",
")",
"{",
"setNewObjectMapper",
"(",
")",
";",
"// Is this right, setting a new object ... | Adds a deserializer to this mapper. Allows a user to alter the deserialization behavior for a certain type.
@param classToMap the class for which the given serializer is meant
@param classDeserializer the serializer
@param <T> the type of objects that will be serialized by the given serializer | [
"Adds",
"a",
"deserializer",
"to",
"this",
"mapper",
".",
"Allows",
"a",
"user",
"to",
"alter",
"the",
"deserialization",
"behavior",
"for",
"a",
"certain",
"type",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/JsonMapper.java#L248-L253 |
alb-i986/selenium-tinafw | src/main/java/me/alb_i986/selenium/tinafw/ui/PageHelper.java | PageHelper.assertElementIsNotDisplayed | public static void assertElementIsNotDisplayed(By locator, WebDriver driver) {
"""
Explicitly wait until the given element is visible.
If it is, throw {@link AssertionError}; else, do nothing.
@param locator
@param driver
@throws AssertionError if element is visible
"""
try {
waitUntil(ExpectedCon... | java | public static void assertElementIsNotDisplayed(By locator, WebDriver driver) {
try {
waitUntil(ExpectedConditions.visibilityOfElementLocated(locator), driver);
throw new AssertionError("[assert KO] element " + locator + " is displayed; expected: NOT displayed");
} catch(TimeoutException e) {
logger.info("[... | [
"public",
"static",
"void",
"assertElementIsNotDisplayed",
"(",
"By",
"locator",
",",
"WebDriver",
"driver",
")",
"{",
"try",
"{",
"waitUntil",
"(",
"ExpectedConditions",
".",
"visibilityOfElementLocated",
"(",
"locator",
")",
",",
"driver",
")",
";",
"throw",
"... | Explicitly wait until the given element is visible.
If it is, throw {@link AssertionError}; else, do nothing.
@param locator
@param driver
@throws AssertionError if element is visible | [
"Explicitly",
"wait",
"until",
"the",
"given",
"element",
"is",
"visible",
".",
"If",
"it",
"is",
"throw",
"{",
"@link",
"AssertionError",
"}",
";",
"else",
"do",
"nothing",
"."
] | train | https://github.com/alb-i986/selenium-tinafw/blob/91c66720cda9f69751f96c58c0a0624b2222186e/src/main/java/me/alb_i986/selenium/tinafw/ui/PageHelper.java#L94-L101 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/MessagingMBeanFactoryImpl.java | MessagingMBeanFactoryImpl.createTopicMBean | private Controllable createTopicMBean(Controllable c) {
"""
Create an instance of the required MBean and register it
@param c
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createPublicationPointMBean", new Object[] { c });
TopicImpl pp = ne... | java | private Controllable createTopicMBean(Controllable c) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createPublicationPointMBean", new Object[] { c });
TopicImpl pp = new TopicImpl(_me, c);
controllableMap.put(c, pp);
try {
Dic... | [
"private",
"Controllable",
"createTopicMBean",
"(",
"Controllable",
"c",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createPublicationP... | Create an instance of the required MBean and register it
@param c | [
"Create",
"an",
"instance",
"of",
"the",
"required",
"MBean",
"and",
"register",
"it"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/MessagingMBeanFactoryImpl.java#L321-L340 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/DateTimeUtil.java | DateTimeUtil.parseEmbedded | public static DateTime parseEmbedded(String string0, String pattern, DateTimeZone zone) throws IllegalArgumentException {
"""
Parses a string for an embedded date and/or time contained within a
string such as "app.2008-05-01.log" or "app-20090624-051112.log.gz".
This method accepts a variety of date and time pat... | java | public static DateTime parseEmbedded(String string0, String pattern, DateTimeZone zone) throws IllegalArgumentException {
// compile a date time formatter -- which also will check that pattern
DateTimeFormatter fmt = DateTimeFormat.forPattern(pattern).withZone(zone);
//
// use the patte... | [
"public",
"static",
"DateTime",
"parseEmbedded",
"(",
"String",
"string0",
",",
"String",
"pattern",
",",
"DateTimeZone",
"zone",
")",
"throws",
"IllegalArgumentException",
"{",
"// compile a date time formatter -- which also will check that pattern",
"DateTimeFormatter",
"fmt"... | Parses a string for an embedded date and/or time contained within a
string such as "app.2008-05-01.log" or "app-20090624-051112.log.gz".
This method accepts a variety of date and time patterns that are valid
within the Joda DateTime library. For example, the string "app.2008-05-01.log"
would be a pattern of "yyyy-MM-d... | [
"Parses",
"a",
"string",
"for",
"an",
"embedded",
"date",
"and",
"/",
"or",
"time",
"contained",
"within",
"a",
"string",
"such",
"as",
"app",
".",
"2008",
"-",
"05",
"-",
"01",
".",
"log",
"or",
"app",
"-",
"20090624",
"-",
"051112",
".",
"log",
"... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/DateTimeUtil.java#L121-L153 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/orders/OrderItemUrl.java | OrderItemUrl.updateItemQuantityUrl | public static MozuUrl updateItemQuantityUrl(String orderId, String orderItemId, Integer quantity, String responseFields, String updateMode, String version) {
"""
Get Resource Url for UpdateItemQuantity
@param orderId Unique identifier of the order.
@param orderItemId Unique identifier of the item to remove from ... | java | public static MozuUrl updateItemQuantityUrl(String orderId, String orderItemId, Integer quantity, String responseFields, String updateMode, String version)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/items/{orderItemId}/quantity/{quantity}?updatemode={updateMode}&version={version}&r... | [
"public",
"static",
"MozuUrl",
"updateItemQuantityUrl",
"(",
"String",
"orderId",
",",
"String",
"orderItemId",
",",
"Integer",
"quantity",
",",
"String",
"responseFields",
",",
"String",
"updateMode",
",",
"String",
"version",
")",
"{",
"UrlFormatter",
"formatter",... | Get Resource Url for UpdateItemQuantity
@param orderId Unique identifier of the order.
@param orderItemId Unique identifier of the item to remove from the order.
@param quantity The number of cart items in the shopper's active cart.
@param responseFields Filtering syntax appended to an API call to increase or decrease ... | [
"Get",
"Resource",
"Url",
"for",
"UpdateItemQuantity"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/orders/OrderItemUrl.java#L185-L195 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/closure/support/Algorithms.java | Algorithms.findAll | public Collection findAll(Iterator it, Constraint constraint) {
"""
Find all the elements in the collection that match the specified
constraint.
@param it the iterator
@param constraint the constraint
@return The objects that match, or a empty collection if none match
"""
ElementGenerator finder = new ... | java | public Collection findAll(Iterator it, Constraint constraint) {
ElementGenerator finder = new IteratorTemplate(it).findAll(constraint);
final Collection results = new ArrayList();
finder.run(new Block() {
protected void handle(Object element) {
results.add(element);
}
});
return results;
} | [
"public",
"Collection",
"findAll",
"(",
"Iterator",
"it",
",",
"Constraint",
"constraint",
")",
"{",
"ElementGenerator",
"finder",
"=",
"new",
"IteratorTemplate",
"(",
"it",
")",
".",
"findAll",
"(",
"constraint",
")",
";",
"final",
"Collection",
"results",
"=... | Find all the elements in the collection that match the specified
constraint.
@param it the iterator
@param constraint the constraint
@return The objects that match, or a empty collection if none match | [
"Find",
"all",
"the",
"elements",
"in",
"the",
"collection",
"that",
"match",
"the",
"specified",
"constraint",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/closure/support/Algorithms.java#L147-L156 |
OpenTSDB/opentsdb | src/tools/OpenTSDBMain.java | OpenTSDBMain.insertPattern | protected static String insertPattern(final String logFileName, final String rollPattern) {
"""
Merges the roll pattern name into the file name
@param logFileName The log file name
@param rollPattern The rolling log file appender roll pattern
@return the merged file pattern
"""
int index = logFileNam... | java | protected static String insertPattern(final String logFileName, final String rollPattern) {
int index = logFileName.lastIndexOf('.');
if(index==-1) return logFileName + rollPattern;
return logFileName.substring(0, index) + rollPattern + logFileName.substring(index);
} | [
"protected",
"static",
"String",
"insertPattern",
"(",
"final",
"String",
"logFileName",
",",
"final",
"String",
"rollPattern",
")",
"{",
"int",
"index",
"=",
"logFileName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
... | Merges the roll pattern name into the file name
@param logFileName The log file name
@param rollPattern The rolling log file appender roll pattern
@return the merged file pattern | [
"Merges",
"the",
"roll",
"pattern",
"name",
"into",
"the",
"file",
"name"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/OpenTSDBMain.java#L526-L530 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/ArrayUtils.java | ArrayUtils.deepCopy | @SuppressWarnings("unchecked")
public static <T> T[] deepCopy(T[] array) {
"""
Deeply copies the given array into a new array of the same {@link Class type}.
This function performs a deep copy by {@literal cloning} each element from the original array.
@param <T> {@link Class type} of the array elements.
... | java | @SuppressWarnings("unchecked")
public static <T> T[] deepCopy(T[] array) {
Assert.notNull(array, "Array is required");
return deepCopy(array, element -> element != null ? ObjectUtils.clone(element) : null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"deepCopy",
"(",
"T",
"[",
"]",
"array",
")",
"{",
"Assert",
".",
"notNull",
"(",
"array",
",",
"\"Array is required\"",
")",
";",
"return",
"deepCopy",... | Deeply copies the given array into a new array of the same {@link Class type}.
This function performs a deep copy by {@literal cloning} each element from the original array.
@param <T> {@link Class type} of the array elements.
@param array array to copy.
@return a deep copy of the given array.
@throws IllegalArgument... | [
"Deeply",
"copies",
"the",
"given",
"array",
"into",
"a",
"new",
"array",
"of",
"the",
"same",
"{",
"@link",
"Class",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/ArrayUtils.java#L276-L282 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/impl/DirectSchedulerFactory.java | DirectSchedulerFactory.createVolatileScheduler | public void createVolatileScheduler (final int nMaxThreads) throws SchedulerException {
"""
Creates an in memory job store (<code>{@link RAMJobStore}</code>) The
thread priority is set to Thread.NORM_PRIORITY
@param nMaxThreads
The number of threads in the thread pool
@throws SchedulerException
if initializ... | java | public void createVolatileScheduler (final int nMaxThreads) throws SchedulerException
{
final SimpleThreadPool aThreadPool = new SimpleThreadPool (nMaxThreads, Thread.NORM_PRIORITY);
aThreadPool.initialize ();
final IJobStore jobStore = new RAMJobStore ();
createScheduler (aThreadPool, jobStore);
} | [
"public",
"void",
"createVolatileScheduler",
"(",
"final",
"int",
"nMaxThreads",
")",
"throws",
"SchedulerException",
"{",
"final",
"SimpleThreadPool",
"aThreadPool",
"=",
"new",
"SimpleThreadPool",
"(",
"nMaxThreads",
",",
"Thread",
".",
"NORM_PRIORITY",
")",
";",
... | Creates an in memory job store (<code>{@link RAMJobStore}</code>) The
thread priority is set to Thread.NORM_PRIORITY
@param nMaxThreads
The number of threads in the thread pool
@throws SchedulerException
if initialization failed. | [
"Creates",
"an",
"in",
"memory",
"job",
"store",
"(",
"<code",
">",
"{",
"@link",
"RAMJobStore",
"}",
"<",
"/",
"code",
">",
")",
"The",
"thread",
"priority",
"is",
"set",
"to",
"Thread",
".",
"NORM_PRIORITY"
] | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/DirectSchedulerFactory.java#L140-L146 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/util/Util.java | Util.printQuery | public static void printQuery(JcQuery query, QueryToObserve toObserve, Format format) {
"""
map to CYPHER statements and map to JSON, print the mapping results to System.out
@param queries
@param toObserve
@param format
"""
boolean titlePrinted = false;
ContentToObserve tob = QueriesPrintObserver.conten... | java | public static void printQuery(JcQuery query, QueryToObserve toObserve, Format format) {
boolean titlePrinted = false;
ContentToObserve tob = QueriesPrintObserver.contentToObserve(toObserve);
if (tob == ContentToObserve.CYPHER || tob == ContentToObserve.CYPHER_JSON) {
titlePrinted = true;
QueriesPrintObserve... | [
"public",
"static",
"void",
"printQuery",
"(",
"JcQuery",
"query",
",",
"QueryToObserve",
"toObserve",
",",
"Format",
"format",
")",
"{",
"boolean",
"titlePrinted",
"=",
"false",
";",
"ContentToObserve",
"tob",
"=",
"QueriesPrintObserver",
".",
"contentToObserve",
... | map to CYPHER statements and map to JSON, print the mapping results to System.out
@param queries
@param toObserve
@param format | [
"map",
"to",
"CYPHER",
"statements",
"and",
"map",
"to",
"JSON",
"print",
"the",
"mapping",
"results",
"to",
"System",
".",
"out"
] | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/util/Util.java#L72-L95 |
Erudika/para | para-server/src/main/java/com/erudika/para/security/filters/LdapAuthFilter.java | LdapAuthFilter.attemptAuthentication | @Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
throws IOException {
"""
Handles an authentication request.
@param request HTTP request
@param response HTTP response
@return an authentication object that contains the principal object if success... | java | @Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
throws IOException {
final String requestURI = request.getRequestURI();
UserAuthentication userAuth = null;
String username = request.getParameter(USERNAME);
String password = request.getParameter... | [
"@",
"Override",
"public",
"Authentication",
"attemptAuthentication",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"final",
"String",
"requestURI",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";",... | Handles an authentication request.
@param request HTTP request
@param response HTTP response
@return an authentication object that contains the principal object if successful.
@throws IOException ex | [
"Handles",
"an",
"authentication",
"request",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/filters/LdapAuthFilter.java#L74-L102 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/modules/CmsModulesUploadFromServer.java | CmsModulesUploadFromServer.getModulesFromServer | private List getModulesFromServer() {
"""
Returns the list of all modules available on the server in prepared CmsSelectWidgetOption objects.<p>
@return List of module names in CmsSelectWidgetOption objects
"""
List result = new ArrayList();
// get the systems-exportpath
String expo... | java | private List getModulesFromServer() {
List result = new ArrayList();
// get the systems-exportpath
String exportpath = OpenCms.getSystemInfo().getPackagesRfsPath();
exportpath = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(exportpath + "modules");
File folder = ne... | [
"private",
"List",
"getModulesFromServer",
"(",
")",
"{",
"List",
"result",
"=",
"new",
"ArrayList",
"(",
")",
";",
"// get the systems-exportpath",
"String",
"exportpath",
"=",
"OpenCms",
".",
"getSystemInfo",
"(",
")",
".",
"getPackagesRfsPath",
"(",
")",
";",... | Returns the list of all modules available on the server in prepared CmsSelectWidgetOption objects.<p>
@return List of module names in CmsSelectWidgetOption objects | [
"Returns",
"the",
"list",
"of",
"all",
"modules",
"available",
"on",
"the",
"server",
"in",
"prepared",
"CmsSelectWidgetOption",
"objects",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/modules/CmsModulesUploadFromServer.java#L258-L287 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/MediaAPI.java | MediaAPI.mediaUploadnews | public static Media mediaUploadnews(String access_token,List<Article> articles) {
"""
高级群发 构成 MassMPnewsMessage 对象的前置请求接口
@param access_token access_token
@param articles 图文信息 1-10 个
@return Media
"""
String str = JsonUtil.toJSONString(articles);
String messageJson = "{\"articles\":"+str+"}";
return m... | java | public static Media mediaUploadnews(String access_token,List<Article> articles){
String str = JsonUtil.toJSONString(articles);
String messageJson = "{\"articles\":"+str+"}";
return mediaUploadnews(access_token, messageJson);
} | [
"public",
"static",
"Media",
"mediaUploadnews",
"(",
"String",
"access_token",
",",
"List",
"<",
"Article",
">",
"articles",
")",
"{",
"String",
"str",
"=",
"JsonUtil",
".",
"toJSONString",
"(",
"articles",
")",
";",
"String",
"messageJson",
"=",
"\"{\\\"artic... | 高级群发 构成 MassMPnewsMessage 对象的前置请求接口
@param access_token access_token
@param articles 图文信息 1-10 个
@return Media | [
"高级群发",
"构成",
"MassMPnewsMessage",
"对象的前置请求接口"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MediaAPI.java#L272-L276 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApi.java | GitLabApi.enableRequestResponseLogging | public void enableRequestResponseLogging(Logger logger, Level level, int maxEntitySize, List<String> maskedHeaderNames) {
"""
Enable the logging of the requests to and the responses from the GitLab server API using the
specified logger.
@param logger the Logger instance to log to
@param level the logging leve... | java | public void enableRequestResponseLogging(Logger logger, Level level, int maxEntitySize, List<String> maskedHeaderNames) {
apiClient.enableRequestResponseLogging(logger, level, maxEntitySize, maskedHeaderNames);
} | [
"public",
"void",
"enableRequestResponseLogging",
"(",
"Logger",
"logger",
",",
"Level",
"level",
",",
"int",
"maxEntitySize",
",",
"List",
"<",
"String",
">",
"maskedHeaderNames",
")",
"{",
"apiClient",
".",
"enableRequestResponseLogging",
"(",
"logger",
",",
"le... | Enable the logging of the requests to and the responses from the GitLab server API using the
specified logger.
@param logger the Logger instance to log to
@param level the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
@param maxEntitySize maximum number of entity bytes to be logged. When logging ... | [
"Enable",
"the",
"logging",
"of",
"the",
"requests",
"to",
"and",
"the",
"responses",
"from",
"the",
"GitLab",
"server",
"API",
"using",
"the",
"specified",
"logger",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApi.java#L719-L721 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.scale | public Matrix4f scale(float x, float y, float z) {
"""
Apply scaling to this matrix by scaling the base axes by the given sx,
sy and sz factors.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>M * S</code>. So when transforming a
vecto... | java | public Matrix4f scale(float x, float y, float z) {
return scale(x, y, z, thisOrNew());
} | [
"public",
"Matrix4f",
"scale",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"return",
"scale",
"(",
"x",
",",
"y",
",",
"z",
",",
"thisOrNew",
"(",
")",
")",
";",
"}"
] | Apply scaling to this matrix by scaling the base axes by the given sx,
sy and sz factors.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>M * S</code>. So when transforming a
vector <code>v</code> with the new matrix by using <code>M * S * v</co... | [
"Apply",
"scaling",
"to",
"this",
"matrix",
"by",
"scaling",
"the",
"base",
"axes",
"by",
"the",
"given",
"sx",
"sy",
"and",
"sz",
"factors",
".",
"<p",
">",
"If",
"<code",
">",
"M<",
"/",
"code",
">",
"is",
"<code",
">",
"this<",
"/",
"code",
">",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L4782-L4784 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.acceptSessionFromEntityPathAsync | public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync(String namespaceName, String entityPath, String sessionId, ClientSettings clientSettings) {
"""
Asynchronously accepts a session in PeekLock mode from service bus using the client settings. Session Id can be null, if null, service wi... | java | public static CompletableFuture<IMessageSession> acceptSessionFromEntityPathAsync(String namespaceName, String entityPath, String sessionId, ClientSettings clientSettings) {
return acceptSessionFromEntityPathAsync(namespaceName, entityPath, sessionId, clientSettings, DEFAULTRECEIVEMODE);
} | [
"public",
"static",
"CompletableFuture",
"<",
"IMessageSession",
">",
"acceptSessionFromEntityPathAsync",
"(",
"String",
"namespaceName",
",",
"String",
"entityPath",
",",
"String",
"sessionId",
",",
"ClientSettings",
"clientSettings",
")",
"{",
"return",
"acceptSessionFr... | Asynchronously accepts a session in PeekLock mode from service bus using the client settings. Session Id can be null, if null, service will return the first available session.
@param namespaceName namespace of entity
@param entityPath path of entity
@param sessionId session id, if null, service will return the first av... | [
"Asynchronously",
"accepts",
"a",
"session",
"in",
"PeekLock",
"mode",
"from",
"service",
"bus",
"using",
"the",
"client",
"settings",
".",
"Session",
"Id",
"can",
"be",
"null",
"if",
"null",
"service",
"will",
"return",
"the",
"first",
"available",
"session",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L671-L673 |
raphw/byte-buddy | byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractUserConfiguration.java | AbstractUserConfiguration.getClassPath | public Iterable<? extends File> getClassPath(File root, Iterable<? extends File> classPath) {
"""
Returns the class path or builds a class path from the supplied arguments if no class path was set.
@param root The root directory of the project being built.
@param classPath The class path dependencies.
@r... | java | public Iterable<? extends File> getClassPath(File root, Iterable<? extends File> classPath) {
return this.classPath == null
? new PrefixIterable(root, classPath)
: this.classPath;
} | [
"public",
"Iterable",
"<",
"?",
"extends",
"File",
">",
"getClassPath",
"(",
"File",
"root",
",",
"Iterable",
"<",
"?",
"extends",
"File",
">",
"classPath",
")",
"{",
"return",
"this",
".",
"classPath",
"==",
"null",
"?",
"new",
"PrefixIterable",
"(",
"r... | Returns the class path or builds a class path from the supplied arguments if no class path was set.
@param root The root directory of the project being built.
@param classPath The class path dependencies.
@return An iterable of all elements of the class path to be used. | [
"Returns",
"the",
"class",
"path",
"or",
"builds",
"a",
"class",
"path",
"from",
"the",
"supplied",
"arguments",
"if",
"no",
"class",
"path",
"was",
"set",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractUserConfiguration.java#L38-L42 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java | RegularPactTask.logAndThrowException | public static void logAndThrowException(Exception ex, AbstractInvokable parent) throws Exception {
"""
Prints an error message and throws the given exception. If the exception is of the type
{@link ExceptionInChainedStubException} then the chain of contained exceptions is followed
until an exception of a differe... | java | public static void logAndThrowException(Exception ex, AbstractInvokable parent) throws Exception {
String taskName;
if (ex instanceof ExceptionInChainedStubException) {
do {
ExceptionInChainedStubException cex = (ExceptionInChainedStubException) ex;
taskName = cex.getTaskName();
ex = cex.getWrappedEx... | [
"public",
"static",
"void",
"logAndThrowException",
"(",
"Exception",
"ex",
",",
"AbstractInvokable",
"parent",
")",
"throws",
"Exception",
"{",
"String",
"taskName",
";",
"if",
"(",
"ex",
"instanceof",
"ExceptionInChainedStubException",
")",
"{",
"do",
"{",
"Exce... | Prints an error message and throws the given exception. If the exception is of the type
{@link ExceptionInChainedStubException} then the chain of contained exceptions is followed
until an exception of a different type is found.
@param ex The exception to be thrown.
@param parent The parent task, whose information is i... | [
"Prints",
"an",
"error",
"message",
"and",
"throws",
"the",
"given",
"exception",
".",
"If",
"the",
"exception",
"is",
"of",
"the",
"type",
"{",
"@link",
"ExceptionInChainedStubException",
"}",
"then",
"the",
"chain",
"of",
"contained",
"exceptions",
"is",
"fo... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java#L1193-L1210 |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dal/use/UseParserFactory.java | UseParserFactory.newInstance | public static AbstractUseParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine) {
"""
Create use parser instance.
@param dbType database type
@param shardingRule databases and tables sharding rule
@param lexerEngine lexical analysis engine.
@return use p... | java | public static AbstractUseParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine) {
switch (dbType) {
case H2:
case MySQL:
return new MySQLUseParser(lexerEngine);
default:
throw new Unsupport... | [
"public",
"static",
"AbstractUseParser",
"newInstance",
"(",
"final",
"DatabaseType",
"dbType",
",",
"final",
"ShardingRule",
"shardingRule",
",",
"final",
"LexerEngine",
"lexerEngine",
")",
"{",
"switch",
"(",
"dbType",
")",
"{",
"case",
"H2",
":",
"case",
"MyS... | Create use parser instance.
@param dbType database type
@param shardingRule databases and tables sharding rule
@param lexerEngine lexical analysis engine.
@return use parser instance | [
"Create",
"use",
"parser",
"instance",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/sql/dal/use/UseParserFactory.java#L43-L51 |
b3log/latke | latke-core/src/main/java/org/json/JSONObject.java | JSONObject.optFloat | public float optFloat(String key, float defaultValue) {
"""
Get the optional double value associated with an index. The defaultValue
is returned if there is no value for the index, or if the value is not a
number and cannot be converted to a number.
@param key
A key string.
@param defaultValue
The default ... | java | public float optFloat(String key, float defaultValue) {
Number val = this.optNumber(key);
if (val == null) {
return defaultValue;
}
final float floatValue = val.floatValue();
// if (Float.isNaN(floatValue) || Float.isInfinite(floatValue)) {
// return defaultVa... | [
"public",
"float",
"optFloat",
"(",
"String",
"key",
",",
"float",
"defaultValue",
")",
"{",
"Number",
"val",
"=",
"this",
".",
"optNumber",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"final",
... | Get the optional double value associated with an index. The defaultValue
is returned if there is no value for the index, or if the value is not a
number and cannot be converted to a number.
@param key
A key string.
@param defaultValue
The default value.
@return The value. | [
"Get",
"the",
"optional",
"double",
"value",
"associated",
"with",
"an",
"index",
".",
"The",
"defaultValue",
"is",
"returned",
"if",
"there",
"is",
"no",
"value",
"for",
"the",
"index",
"or",
"if",
"the",
"value",
"is",
"not",
"a",
"number",
"and",
"can... | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONObject.java#L1269-L1279 |
sdl/odata | odata_processor/src/main/java/com/sdl/odata/processor/write/WriteMethodHandler.java | WriteMethodHandler.validateProperties | protected void validateProperties(final Object entity, final EntityDataModel edm)
throws ODataException {
"""
Checks if all non-nullable properties of an entity are non-empty.
@param entity The entity to check.
@throws ODataBadRequestException If any of the non-nullable properties of the entity are... | java | protected void validateProperties(final Object entity, final EntityDataModel edm)
throws ODataException {
final Type type = edm.getType(entity.getClass());
// No validation needed if it is not a structured type
if (!(type instanceof StructuredType)) {
return;
}
... | [
"protected",
"void",
"validateProperties",
"(",
"final",
"Object",
"entity",
",",
"final",
"EntityDataModel",
"edm",
")",
"throws",
"ODataException",
"{",
"final",
"Type",
"type",
"=",
"edm",
".",
"getType",
"(",
"entity",
".",
"getClass",
"(",
")",
")",
";"... | Checks if all non-nullable properties of an entity are non-empty.
@param entity The entity to check.
@throws ODataBadRequestException If any of the non-nullable properties of the entity are empty. | [
"Checks",
"if",
"all",
"non",
"-",
"nullable",
"properties",
"of",
"an",
"entity",
"are",
"non",
"-",
"empty",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_processor/src/main/java/com/sdl/odata/processor/write/WriteMethodHandler.java#L199-L221 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyEncoder.java | KeyEncoder.encodeDesc | public static int encodeDesc(byte[] value, byte[] dst, int dstOffset) {
"""
Encodes the given optional unsigned byte array into a variable amount of
bytes for descending order. If the byte array is null, exactly 1 byte is
written. Otherwise, the amount written is determined by calling
calculateEncodedLength.
... | java | public static int encodeDesc(byte[] value, byte[] dst, int dstOffset) {
if (value == null) {
dst[dstOffset] = NULL_BYTE_LOW;
return 1;
}
return encode(value, 0, value.length, dst, dstOffset, -1);
} | [
"public",
"static",
"int",
"encodeDesc",
"(",
"byte",
"[",
"]",
"value",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstOffset",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"dst",
"[",
"dstOffset",
"]",
"=",
"NULL_BYTE_LOW",
";",
"return",
... | Encodes the given optional unsigned byte array into a variable amount of
bytes for descending order. If the byte array is null, exactly 1 byte is
written. Otherwise, the amount written is determined by calling
calculateEncodedLength.
@param value byte array value to encode, may be null
@param dst destination for encod... | [
"Encodes",
"the",
"given",
"optional",
"unsigned",
"byte",
"array",
"into",
"a",
"variable",
"amount",
"of",
"bytes",
"for",
"descending",
"order",
".",
"If",
"the",
"byte",
"array",
"is",
"null",
"exactly",
"1",
"byte",
"is",
"written",
".",
"Otherwise",
... | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L728-L734 |
seedstack/seed | core/src/main/java/org/seedstack/seed/core/internal/guice/BindingUtils.java | BindingUtils.resolveBindingDefinitions | @SuppressWarnings("unchecked")
public static <T> Map<Key<T>, Class<? extends T>> resolveBindingDefinitions(Class<T> injecteeClass,
Collection<Class<? extends T>> implClasses) {
"""
Same as {@link #resolveBindingDefinitions(Class, Class, Class...)}.
@param injecteeClass the parent class to reach
... | java | @SuppressWarnings("unchecked")
public static <T> Map<Key<T>, Class<? extends T>> resolveBindingDefinitions(Class<T> injecteeClass,
Collection<Class<? extends T>> implClasses) {
if (implClasses != null && !implClasses.isEmpty()) {
return resolveBindingDefinitions(injecteeClass, null, ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Map",
"<",
"Key",
"<",
"T",
">",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
">",
"resolveBindingDefinitions",
"(",
"Class",
"<",
"T",
">",
"injecteeClass",
",",
"... | Same as {@link #resolveBindingDefinitions(Class, Class, Class...)}.
@param injecteeClass the parent class to reach
@param implClasses the sub classes collection
@return a multimap with typeliterals for keys and a list of associated subclasses for values | [
"Same",
"as",
"{",
"@link",
"#resolveBindingDefinitions",
"(",
"Class",
"Class",
"Class",
"...",
")",
"}",
"."
] | train | https://github.com/seedstack/seed/blob/d9cf33bfb2fffcdbb0976f4726e943acda90e828/core/src/main/java/org/seedstack/seed/core/internal/guice/BindingUtils.java#L128-L135 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/GetGatewayResponseResult.java | GetGatewayResponseResult.withResponseParameters | public GetGatewayResponseResult withResponseParameters(java.util.Map<String, String> responseParameters) {
"""
<p>
Response parameters (paths, query strings and headers) of the <a>GatewayResponse</a> as a string-to-string map of
key-value pairs.
</p>
@param responseParameters
Response parameters (paths, que... | java | public GetGatewayResponseResult withResponseParameters(java.util.Map<String, String> responseParameters) {
setResponseParameters(responseParameters);
return this;
} | [
"public",
"GetGatewayResponseResult",
"withResponseParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"responseParameters",
")",
"{",
"setResponseParameters",
"(",
"responseParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Response parameters (paths, query strings and headers) of the <a>GatewayResponse</a> as a string-to-string map of
key-value pairs.
</p>
@param responseParameters
Response parameters (paths, query strings and headers) of the <a>GatewayResponse</a> as a string-to-string
map of key-value pairs.
@return Returns a refe... | [
"<p",
">",
"Response",
"parameters",
"(",
"paths",
"query",
"strings",
"and",
"headers",
")",
"of",
"the",
"<a",
">",
"GatewayResponse<",
"/",
"a",
">",
"as",
"a",
"string",
"-",
"to",
"-",
"string",
"map",
"of",
"key",
"-",
"value",
"pairs",
".",
"<... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/GetGatewayResponseResult.java#L483-L486 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/RecordChangedHandler.java | RecordChangedHandler.init | public void init(Record record, DateTimeField field) {
"""
Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param iMainFilesField The sequence of the date changed field in this record.
@param field The date changed field in this record.
"""
super.i... | java | public void init(Record record, DateTimeField field)
{
super.init(record);
m_field = field;
FieldDataScratchHandler listener = new FieldDataScratchHandler(null);
listener.setAlwaysEnabled(true); // Since this holds the current key
m_field.addListener(listener); // I will n... | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"DateTimeField",
"field",
")",
"{",
"super",
".",
"init",
"(",
"record",
")",
";",
"m_field",
"=",
"field",
";",
"FieldDataScratchHandler",
"listener",
"=",
"new",
"FieldDataScratchHandler",
"(",
"null",
... | Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param iMainFilesField The sequence of the date changed field in this record.
@param field The date changed field in this record. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/RecordChangedHandler.java#L74-L82 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java | EventSubscriptionsInner.listRegionalByResourceGroupAsync | public Observable<List<EventSubscriptionInner>> listRegionalByResourceGroupAsync(String resourceGroupName, String location) {
"""
List all regional event subscriptions under an Azure subscription and resource group.
List all event subscriptions from the given location under a specific Azure subscription and resou... | java | public Observable<List<EventSubscriptionInner>> listRegionalByResourceGroupAsync(String resourceGroupName, String location) {
return listRegionalByResourceGroupWithServiceResponseAsync(resourceGroupName, location).map(new Func1<ServiceResponse<List<EventSubscriptionInner>>, List<EventSubscriptionInner>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"EventSubscriptionInner",
">",
">",
"listRegionalByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"location",
")",
"{",
"return",
"listRegionalByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName"... | List all regional event subscriptions under an Azure subscription and resource group.
List all event subscriptions from the given location under a specific Azure subscription and resource group.
@param resourceGroupName The name of the resource group within the user's subscription.
@param location Name of the location... | [
"List",
"all",
"regional",
"event",
"subscriptions",
"under",
"an",
"Azure",
"subscription",
"and",
"resource",
"group",
".",
"List",
"all",
"event",
"subscriptions",
"from",
"the",
"given",
"location",
"under",
"a",
"specific",
"Azure",
"subscription",
"and",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java#L1299-L1306 |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/time/runtime/RuntimeClock.java | RuntimeClock.scheduleAlarm | @Override
public Time scheduleAlarm(final int offset, final EventHandler<Alarm> handler) {
"""
Schedule a new Alarm event in `offset` milliseconds into the future,
and supply an event handler to be called at that time.
@param offset Number of milliseconds into the future relative to current time.
@param handl... | java | @Override
public Time scheduleAlarm(final int offset, final EventHandler<Alarm> handler) {
final Time alarm = new ClientAlarm(this.timer.getCurrent() + offset, handler);
if (LOG.isLoggable(Level.FINEST)) {
final int eventQueueLen;
synchronized (this.schedule) {
eventQueueLen = this.numC... | [
"@",
"Override",
"public",
"Time",
"scheduleAlarm",
"(",
"final",
"int",
"offset",
",",
"final",
"EventHandler",
"<",
"Alarm",
">",
"handler",
")",
"{",
"final",
"Time",
"alarm",
"=",
"new",
"ClientAlarm",
"(",
"this",
".",
"timer",
".",
"getCurrent",
"(",... | Schedule a new Alarm event in `offset` milliseconds into the future,
and supply an event handler to be called at that time.
@param offset Number of milliseconds into the future relative to current time.
@param handler Event handler to be invoked.
@return Newly scheduled alarm.
@throws IllegalStateException if the clock... | [
"Schedule",
"a",
"new",
"Alarm",
"event",
"in",
"offset",
"milliseconds",
"into",
"the",
"future",
"and",
"supply",
"an",
"event",
"handler",
"to",
"be",
"called",
"at",
"that",
"time",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/time/runtime/RuntimeClock.java#L121-L156 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.listObjects | public Iterable<Result<Item>> listObjects(final String bucketName, final String prefix)
throws XmlPullParserException {
"""
Lists object information in given bucket and prefix.
@param bucketName Bucket name.
@param prefix Prefix string. List objects whose name starts with `prefix`.
@return an itera... | java | public Iterable<Result<Item>> listObjects(final String bucketName, final String prefix)
throws XmlPullParserException {
// list all objects recursively
return listObjects(bucketName, prefix, true);
} | [
"public",
"Iterable",
"<",
"Result",
"<",
"Item",
">",
">",
"listObjects",
"(",
"final",
"String",
"bucketName",
",",
"final",
"String",
"prefix",
")",
"throws",
"XmlPullParserException",
"{",
"// list all objects recursively",
"return",
"listObjects",
"(",
"bucketN... | Lists object information in given bucket and prefix.
@param bucketName Bucket name.
@param prefix Prefix string. List objects whose name starts with `prefix`.
@return an iterator of Result Items.
@throws XmlPullParserException upon parsing response xml | [
"Lists",
"object",
"information",
"in",
"given",
"bucket",
"and",
"prefix",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L2812-L2816 |
vdmeer/asciitable | src/main/java/de/vandermeer/asciitable/AT_Row.java | AT_Row.createContentRow | public static AT_Row createContentRow(Object[] content, TableRowStyle style) {
"""
Creates a new row with content with given cell context and a normal row style.
@param content the content for the row, each member of the array represents the content for a cell in the row, must not be null but can contain null mem... | java | public static AT_Row createContentRow(Object[] content, TableRowStyle style){
Validate.notNull(content);
Validate.notNull(style);
Validate.validState(style!=TableRowStyle.UNKNOWN);
LinkedList<AT_Cell> cells = new LinkedList<AT_Cell>();
for(Object o : content){
cells.add(new AT_Cell(o));
}
r... | [
"public",
"static",
"AT_Row",
"createContentRow",
"(",
"Object",
"[",
"]",
"content",
",",
"TableRowStyle",
"style",
")",
"{",
"Validate",
".",
"notNull",
"(",
"content",
")",
";",
"Validate",
".",
"notNull",
"(",
"style",
")",
";",
"Validate",
".",
"valid... | Creates a new row with content with given cell context and a normal row style.
@param content the content for the row, each member of the array represents the content for a cell in the row, must not be null but can contain null members
@return a new row with content
@throws {@link NullPointerException} if content was n... | [
"Creates",
"a",
"new",
"row",
"with",
"content",
"with",
"given",
"cell",
"context",
"and",
"a",
"normal",
"row",
"style",
"."
] | train | https://github.com/vdmeer/asciitable/blob/b6a73710271c89f9c749603be856ba84a969ed5f/src/main/java/de/vandermeer/asciitable/AT_Row.java#L96-L122 |
jbundle/webapp | proxy/src/main/java/org/jbundle/util/webapp/proxy/ProxyServlet.java | ProxyServlet.setProperties | public boolean setProperties(Dictionary<String, String> properties) {
"""
Set the properties. Override this to set any configuration up.
"""
boolean success = super.setProperties(properties);
proxyURLPrefix = this.getProperty(PROXY);
if (proxyURLPrefix != null)
if (proxyURLP... | java | public boolean setProperties(Dictionary<String, String> properties)
{
boolean success = super.setProperties(properties);
proxyURLPrefix = this.getProperty(PROXY);
if (proxyURLPrefix != null)
if (proxyURLPrefix.endsWith("/"))
proxyURLPrefix = proxyURLPrefix.substri... | [
"public",
"boolean",
"setProperties",
"(",
"Dictionary",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"boolean",
"success",
"=",
"super",
".",
"setProperties",
"(",
"properties",
")",
";",
"proxyURLPrefix",
"=",
"this",
".",
"getProperty",
"(",
... | Set the properties. Override this to set any configuration up. | [
"Set",
"the",
"properties",
".",
"Override",
"this",
"to",
"set",
"any",
"configuration",
"up",
"."
] | train | https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/proxy/src/main/java/org/jbundle/util/webapp/proxy/ProxyServlet.java#L246-L254 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/QueryBuilder.java | QueryBuilder.getAttributeQuery | public AttributeQuery getAttributeQuery(final String _attributeName) {
"""
Method to get an Attribute Query.
@param _attributeName name of the attribute the value is wanted for,
if null the id attribute will be used automatically
@return Attribute Query
"""
if (this.query == null) {
try ... | java | public AttributeQuery getAttributeQuery(final String _attributeName)
{
if (this.query == null) {
try {
final String attribute = getAttr4Select(_attributeName);
this.query = new AttributeQuery(this.typeUUID, attribute.isEmpty() ? _attributeName : attribute)
... | [
"public",
"AttributeQuery",
"getAttributeQuery",
"(",
"final",
"String",
"_attributeName",
")",
"{",
"if",
"(",
"this",
".",
"query",
"==",
"null",
")",
"{",
"try",
"{",
"final",
"String",
"attribute",
"=",
"getAttr4Select",
"(",
"_attributeName",
")",
";",
... | Method to get an Attribute Query.
@param _attributeName name of the attribute the value is wanted for,
if null the id attribute will be used automatically
@return Attribute Query | [
"Method",
"to",
"get",
"an",
"Attribute",
"Query",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/QueryBuilder.java#L1040-L1053 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Flowable.java | Flowable.fromCallable | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> fromCallable(Callable<? extends T> supplier) {
"""
Returns a Flowable that, when a Subscriber subscribes to it, invokes a function you specify and then
emits the value r... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> fromCallable(Callable<? extends T> supplier) {
ObjectHelper.requireNonNull(supplier, "supplier is null");
return RxJavaPlugins.onAssembly(new FlowableFromCalla... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"static",
"<",
"T",
">",
"Flowable",
"<",
"T",
">",
"fromCallable",
"(",
"Callable",
"... | Returns a Flowable that, when a Subscriber subscribes to it, invokes a function you specify and then
emits the value returned from that function.
<p>
<img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromCallable.png" alt="">
<p>
This allows you to defer the execution o... | [
"Returns",
"a",
"Flowable",
"that",
"when",
"a",
"Subscriber",
"subscribes",
"to",
"it",
"invokes",
"a",
"function",
"you",
"specify",
"and",
"then",
"emits",
"the",
"value",
"returned",
"from",
"that",
"function",
".",
"<p",
">",
"<img",
"width",
"=",
"64... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Flowable.java#L1976-L1982 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseOutgoingBufferSize | private void parseOutgoingBufferSize(Map<Object, Object> props) {
"""
Check the input configuration for the maximum buffer size allowed for
marshalling headers outbound.
@param props
"""
Object value = props.get(HttpConfigConstants.PROPNAME_OUTGOING_HDR_BUFFSIZE);
if (null != value) {
... | java | private void parseOutgoingBufferSize(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_OUTGOING_HDR_BUFFSIZE);
if (null != value) {
try {
this.outgoingHdrBuffSize = rangeLimit(convertInteger(value), HttpConfigConstants.MIN_BUFFER_SIZE, HttpCon... | [
"private",
"void",
"parseOutgoingBufferSize",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_OUTGOING_HDR_BUFFSIZE",
")",
";",
"if",
"(",
"null",
"!=",
... | Check the input configuration for the maximum buffer size allowed for
marshalling headers outbound.
@param props | [
"Check",
"the",
"input",
"configuration",
"for",
"the",
"maximum",
"buffer",
"size",
"allowed",
"for",
"marshalling",
"headers",
"outbound",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L566-L581 |
lucee/Lucee | core/src/main/java/lucee/runtime/reflection/Reflector.java | Reflector.getConstructorInstance | public static ConstructorInstance getConstructorInstance(Class clazz, Object[] args) throws NoSuchMethodException {
"""
gets Constructor Instance matching given parameter
@param clazz Clazz to Invoke
@param args Matching args
@return Matching ConstructorInstance
@throws NoSuchMethodException
@throws PageExc... | java | public static ConstructorInstance getConstructorInstance(Class clazz, Object[] args) throws NoSuchMethodException {
ConstructorInstance ci = getConstructorInstance(clazz, args, null);
if (ci != null) return ci;
throw new NoSuchMethodException("No matching Constructor for " + clazz.getName() + "(" + getDspMethods(get... | [
"public",
"static",
"ConstructorInstance",
"getConstructorInstance",
"(",
"Class",
"clazz",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"NoSuchMethodException",
"{",
"ConstructorInstance",
"ci",
"=",
"getConstructorInstance",
"(",
"clazz",
",",
"args",
",",
"nul... | gets Constructor Instance matching given parameter
@param clazz Clazz to Invoke
@param args Matching args
@return Matching ConstructorInstance
@throws NoSuchMethodException
@throws PageException | [
"gets",
"Constructor",
"Instance",
"matching",
"given",
"parameter"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L420-L424 |
kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java | URIUtils.getCanonicalizedURI | public static String getCanonicalizedURI(String uri, boolean canonicalizePath) {
"""
Create a canonical URI from a given URI. A canonical URI is a URI with:<ul> <li>the host part of the authority
lower-case since URI semantics dictate that hostnames are case insensitive <li>(optionally, NOT appropriate for Orig... | java | public static String getCanonicalizedURI(String uri, boolean canonicalizePath) {
String canonicalURI = uri;
if (uri != null) {
String host = getHost(uri);
String path = getPath(uri);
final boolean emptyPath = "".equals(path);
final boolean noPathToCanonica... | [
"public",
"static",
"String",
"getCanonicalizedURI",
"(",
"String",
"uri",
",",
"boolean",
"canonicalizePath",
")",
"{",
"String",
"canonicalURI",
"=",
"uri",
";",
"if",
"(",
"uri",
"!=",
"null",
")",
"{",
"String",
"host",
"=",
"getHost",
"(",
"uri",
")",... | Create a canonical URI from a given URI. A canonical URI is a URI with:<ul> <li>the host part of the authority
lower-case since URI semantics dictate that hostnames are case insensitive <li>(optionally, NOT appropriate for Origin
headers) the path part set to "/" except for tcp uris if there was no path in the input ... | [
"Create",
"a",
"canonical",
"URI",
"from",
"a",
"given",
"URI",
".",
"A",
"canonical",
"URI",
"is",
"a",
"URI",
"with",
":",
"<ul",
">",
"<li",
">",
"the",
"host",
"part",
"of",
"the",
"authority",
"lower",
"-",
"case",
"since",
"URI",
"semantics",
"... | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/uri/URIUtils.java#L661-L686 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/NumericUtil.java | NumericUtil.isCNNumericString | public static boolean isCNNumericString(String str , int sIdx, int eIdx) {
"""
check if the specified string is a Chinese numeric string
@param str
@return boolean
"""
for ( int i = sIdx; i < eIdx; i++ ) {
if ( ! cnNumeric.containsKey(str.charAt(i)) ) {
return false;
... | java | public static boolean isCNNumericString(String str , int sIdx, int eIdx)
{
for ( int i = sIdx; i < eIdx; i++ ) {
if ( ! cnNumeric.containsKey(str.charAt(i)) ) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"isCNNumericString",
"(",
"String",
"str",
",",
"int",
"sIdx",
",",
"int",
"eIdx",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"sIdx",
";",
"i",
"<",
"eIdx",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"cnNumeric",
".",
"c... | check if the specified string is a Chinese numeric string
@param str
@return boolean | [
"check",
"if",
"the",
"specified",
"string",
"is",
"a",
"Chinese",
"numeric",
"string"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/NumericUtil.java#L67-L75 |
ironjacamar/ironjacamar | validator/src/main/java/org/ironjacamar/validator/Validation.java | Validation.createAdminObject | private static List<Validate> createAdminObject(Connector cmd,
List<Failure> failures, ResourceBundle rb, ClassLoader cl) {
"""
createAdminObject
@param cmd connector metadata
@param failures list of failures
@param rb ResourceBundle
@param cl classloador
@return list of validate objects
"""
... | java | private static List<Validate> createAdminObject(Connector cmd,
List<Failure> failures, ResourceBundle rb, ClassLoader cl)
{
List<Validate> result = new ArrayList<Validate>();
if (cmd.getVersion() != Version.V_10 &&
cmd.getResourceadapter() != null &&
cmd.getResourceadapter()... | [
"private",
"static",
"List",
"<",
"Validate",
">",
"createAdminObject",
"(",
"Connector",
"cmd",
",",
"List",
"<",
"Failure",
">",
"failures",
",",
"ResourceBundle",
"rb",
",",
"ClassLoader",
"cl",
")",
"{",
"List",
"<",
"Validate",
">",
"result",
"=",
"ne... | createAdminObject
@param cmd connector metadata
@param failures list of failures
@param rb ResourceBundle
@param cl classloador
@return list of validate objects | [
"createAdminObject"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/validator/src/main/java/org/ironjacamar/validator/Validation.java#L444-L483 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java | DataFactory.getEnum | @SuppressWarnings("unchecked")
private static IKeyEnum getEnum(final AnnotationData pAnnotation, final BitUtils pBit) {
"""
This method is used to get an enum with his key
@param pAnnotation
annotation
@param pBit
bit array
"""
int val = 0;
try {
val = Integer.parseInt(pBit.getNextHexaString(pAnn... | java | @SuppressWarnings("unchecked")
private static IKeyEnum getEnum(final AnnotationData pAnnotation, final BitUtils pBit) {
int val = 0;
try {
val = Integer.parseInt(pBit.getNextHexaString(pAnnotation.getSize()), pAnnotation.isReadHexa() ? 16 : 10);
} catch (NumberFormatException nfe) {
// do nothing
}
ret... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"IKeyEnum",
"getEnum",
"(",
"final",
"AnnotationData",
"pAnnotation",
",",
"final",
"BitUtils",
"pBit",
")",
"{",
"int",
"val",
"=",
"0",
";",
"try",
"{",
"val",
"=",
"Integer",
".",
... | This method is used to get an enum with his key
@param pAnnotation
annotation
@param pBit
bit array | [
"This",
"method",
"is",
"used",
"to",
"get",
"an",
"enum",
"with",
"his",
"key"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/apdu/impl/DataFactory.java#L192-L201 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.checkSameNameRule | public static String checkSameNameRule( List<RuleWrapper> rulesWrapper, String ruleName ) {
"""
Checks if the list of {@link Rule}s supplied contains one with the supplied name.
<p>If the rule is contained it adds an index to the name.
@param rulesWrapper the list of rules to check.
@param ruleName the name... | java | public static String checkSameNameRule( List<RuleWrapper> rulesWrapper, String ruleName ) {
int index = 1;
String name = ruleName.trim();
for( int i = 0; i < rulesWrapper.size(); i++ ) {
RuleWrapper ruleWrapper = rulesWrapper.get(i);
String tmpName = ruleWrapper.getName()... | [
"public",
"static",
"String",
"checkSameNameRule",
"(",
"List",
"<",
"RuleWrapper",
">",
"rulesWrapper",
",",
"String",
"ruleName",
")",
"{",
"int",
"index",
"=",
"1",
";",
"String",
"name",
"=",
"ruleName",
".",
"trim",
"(",
")",
";",
"for",
"(",
"int",... | Checks if the list of {@link Rule}s supplied contains one with the supplied name.
<p>If the rule is contained it adds an index to the name.
@param rulesWrapper the list of rules to check.
@param ruleName the name of the rule to find.
@return the new name of the rule. | [
"Checks",
"if",
"the",
"list",
"of",
"{",
"@link",
"Rule",
"}",
"s",
"supplied",
"contains",
"one",
"with",
"the",
"supplied",
"name",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L756-L783 |
nikhaldi/android-view-selector | src/main/java/com/nikhaldimann/viewselector/ViewSelectorAssertions.java | ViewSelectorAssertions.assertThatSelection | public static ViewSelectionAssert assertThatSelection(String selector, View view) {
"""
Fluent assertion entry point for a selection of views from the given view
based on the given selector. It may be helpful to statically import this rather
than {@link #assertThat(ViewSelection)} to avoid conflicts with other s... | java | public static ViewSelectionAssert assertThatSelection(String selector, View view) {
return assertThat(selection(selector, view));
} | [
"public",
"static",
"ViewSelectionAssert",
"assertThatSelection",
"(",
"String",
"selector",
",",
"View",
"view",
")",
"{",
"return",
"assertThat",
"(",
"selection",
"(",
"selector",
",",
"view",
")",
")",
";",
"}"
] | Fluent assertion entry point for a selection of views from the given view
based on the given selector. It may be helpful to statically import this rather
than {@link #assertThat(ViewSelection)} to avoid conflicts with other statically
imported {@code assertThat()} methods. | [
"Fluent",
"assertion",
"entry",
"point",
"for",
"a",
"selection",
"of",
"views",
"from",
"the",
"given",
"view",
"based",
"on",
"the",
"given",
"selector",
".",
"It",
"may",
"be",
"helpful",
"to",
"statically",
"import",
"this",
"rather",
"than",
"{"
] | train | https://github.com/nikhaldi/android-view-selector/blob/d3e4bf05f6111d116c6b0c1a8c51396e8bfae9b5/src/main/java/com/nikhaldimann/viewselector/ViewSelectorAssertions.java#L63-L65 |
dropwizard/dropwizard | dropwizard-client/src/main/java/io/dropwizard/client/JerseyClientBuilder.java | JerseyClientBuilder.withProperty | public JerseyClientBuilder withProperty(String propertyName, Object propertyValue) {
"""
Sets the state of the given Jersey property.
<p/>
<p/><b>WARNING:</b> The default connector ignores Jersey properties.
Use {@link JerseyClientConfiguration} instead.
@param propertyName the name of the Jersey property
... | java | public JerseyClientBuilder withProperty(String propertyName, Object propertyValue) {
properties.put(propertyName, propertyValue);
return this;
} | [
"public",
"JerseyClientBuilder",
"withProperty",
"(",
"String",
"propertyName",
",",
"Object",
"propertyValue",
")",
"{",
"properties",
".",
"put",
"(",
"propertyName",
",",
"propertyValue",
")",
";",
"return",
"this",
";",
"}"
] | Sets the state of the given Jersey property.
<p/>
<p/><b>WARNING:</b> The default connector ignores Jersey properties.
Use {@link JerseyClientConfiguration} instead.
@param propertyName the name of the Jersey property
@param propertyValue the state of the Jersey property
@return {@code this} | [
"Sets",
"the",
"state",
"of",
"the",
"given",
"Jersey",
"property",
".",
"<p",
"/",
">",
"<p",
"/",
">",
"<b",
">",
"WARNING",
":",
"<",
"/",
"b",
">",
"The",
"default",
"connector",
"ignores",
"Jersey",
"properties",
".",
"Use",
"{",
"@link",
"Jerse... | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-client/src/main/java/io/dropwizard/client/JerseyClientBuilder.java#L124-L127 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/StreamHandler.java | StreamHandler.setEncoding | @Override
public synchronized void setEncoding(String encoding)
throws SecurityException, java.io.UnsupportedEncodingException {
"""
Set (or change) the character encoding used by this <tt>Handler</tt>.
<p>
The encoding should be set before any <tt>LogRecords</tt> are written
to the ... | java | @Override
public synchronized void setEncoding(String encoding)
throws SecurityException, java.io.UnsupportedEncodingException {
super.setEncoding(encoding);
if (output == null) {
return;
}
// Replace the current writer with a writer for the new en... | [
"@",
"Override",
"public",
"synchronized",
"void",
"setEncoding",
"(",
"String",
"encoding",
")",
"throws",
"SecurityException",
",",
"java",
".",
"io",
".",
"UnsupportedEncodingException",
"{",
"super",
".",
"setEncoding",
"(",
"encoding",
")",
";",
"if",
"(",
... | Set (or change) the character encoding used by this <tt>Handler</tt>.
<p>
The encoding should be set before any <tt>LogRecords</tt> are written
to the <tt>Handler</tt>.
@param encoding The name of a supported character encoding.
May be null, to indicate the default platform encoding.
@exception SecurityException if... | [
"Set",
"(",
"or",
"change",
")",
"the",
"character",
"encoding",
"used",
"by",
"this",
"<tt",
">",
"Handler<",
"/",
"tt",
">",
".",
"<p",
">",
"The",
"encoding",
"should",
"be",
"set",
"before",
"any",
"<tt",
">",
"LogRecords<",
"/",
"tt",
">",
"are"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/StreamHandler.java#L171-L185 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.bezierArc | public static ArrayList bezierArc(float x1, float y1, float x2, float y2, float startAng, float extent) {
"""
Generates an array of bezier curves to draw an arc.
<P>
(x1, y1) and (x2, y2) are the corners of the enclosing rectangle.
Angles, measured in degrees, start with 0 to the right (the positive X
axis) an... | java | public static ArrayList bezierArc(float x1, float y1, float x2, float y2, float startAng, float extent) {
float tmp;
if (x1 > x2) {
tmp = x1;
x1 = x2;
x2 = tmp;
}
if (y2 > y1) {
tmp = y1;
y1 = y2;
y2 = tmp;
}... | [
"public",
"static",
"ArrayList",
"bezierArc",
"(",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"x2",
",",
"float",
"y2",
",",
"float",
"startAng",
",",
"float",
"extent",
")",
"{",
"float",
"tmp",
";",
"if",
"(",
"x1",
">",
"x2",
")",
"{",
"tm... | Generates an array of bezier curves to draw an arc.
<P>
(x1, y1) and (x2, y2) are the corners of the enclosing rectangle.
Angles, measured in degrees, start with 0 to the right (the positive X
axis) and increase counter-clockwise. The arc extends from startAng
to startAng+extent. I.e. startAng=0 and extent=180 yields... | [
"Generates",
"an",
"array",
"of",
"bezier",
"curves",
"to",
"draw",
"an",
"arc",
".",
"<P",
">",
"(",
"x1",
"y1",
")",
"and",
"(",
"x2",
"y2",
")",
"are",
"the",
"corners",
"of",
"the",
"enclosing",
"rectangle",
".",
"Angles",
"measured",
"in",
"degr... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L1810-L1869 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceService.java | BaseTraceService.jsonEscape | private void jsonEscape(StringBuilder sb, String s) {
"""
Escape \b, \f, \n, \r, \t, ", \, / characters and appends to a string builder
@param sb String builder to append to
@param s String to escape
"""
if (s == null) {
sb.append(s);
return;
}
for (int i = 0... | java | private void jsonEscape(StringBuilder sb, String s) {
if (s == null) {
sb.append(s);
return;
}
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
switch (c) {
case '\b':
sb.append("\\b");
... | [
"private",
"void",
"jsonEscape",
"(",
"StringBuilder",
"sb",
",",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"s",
")",
";",
"return",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"... | Escape \b, \f, \n, \r, \t, ", \, / characters and appends to a string builder
@param sb String builder to append to
@param s String to escape | [
"Escape",
"\\",
"b",
"\\",
"f",
"\\",
"n",
"\\",
"r",
"\\",
"t",
"\\",
"/",
"characters",
"and",
"appends",
"to",
"a",
"string",
"builder"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceService.java#L1127-L1162 |
joniles/mpxj | src/main/java/net/sf/mpxj/Resource.java | Resource.setBaselineWork | public void setBaselineWork(int baselineNumber, Duration value) {
"""
Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value
"""
set(selectField(ResourceFieldLists.BASELINE_WORKS, baselineNumber), value);
} | java | public void setBaselineWork(int baselineNumber, Duration value)
{
set(selectField(ResourceFieldLists.BASELINE_WORKS, baselineNumber), value);
} | [
"public",
"void",
"setBaselineWork",
"(",
"int",
"baselineNumber",
",",
"Duration",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"ResourceFieldLists",
".",
"BASELINE_WORKS",
",",
"baselineNumber",
")",
",",
"value",
")",
";",
"}"
] | Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value | [
"Set",
"a",
"baseline",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L2205-L2208 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.seleniumDelete | @When("^I delete the text '(.+?)' on the element on index '(\\d+?)'( and replace it for '(.+?)')?$")
public void seleniumDelete(String text, Integer index, String foo, String replacement) {
"""
Delete or replace the text on a numbered {@code index} previously found element.
@param index
"""
asse... | java | @When("^I delete the text '(.+?)' on the element on index '(\\d+?)'( and replace it for '(.+?)')?$")
public void seleniumDelete(String text, Integer index, String foo, String replacement) {
assertThat(this.commonspec, commonspec.getPreviousWebElements()).as("There are less found elements than required")
... | [
"@",
"When",
"(",
"\"^I delete the text '(.+?)' on the element on index '(\\\\d+?)'( and replace it for '(.+?)')?$\"",
")",
"public",
"void",
"seleniumDelete",
"(",
"String",
"text",
",",
"Integer",
"index",
",",
"String",
"foo",
",",
"String",
"replacement",
")",
"{",
"a... | Delete or replace the text on a numbered {@code index} previously found element.
@param index | [
"Delete",
"or",
"replace",
"the",
"text",
"on",
"a",
"numbered",
"{",
"@code",
"index",
"}",
"previously",
"found",
"element",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L254-L273 |
playn/playn | html/src/playn/super/java/nio/CharBuffer.java | CharBuffer.put | public CharBuffer put (String str, int start, int end) {
"""
Writes chars of the given string to the current position of this buffer, and increases the
position by the number of chars written.
@param str the string to write.
@param start the first char to write, must not be negative and not greater than {@cod... | java | public CharBuffer put (String str, int start, int end) {
int length = str.length();
if (start < 0 || end < start || end > length) {
throw new IndexOutOfBoundsException();
}
if (end - start > remaining()) {
throw new BufferOverflowException();
}
fo... | [
"public",
"CharBuffer",
"put",
"(",
"String",
"str",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"length",
"=",
"str",
".",
"length",
"(",
")",
";",
"if",
"(",
"start",
"<",
"0",
"||",
"end",
"<",
"start",
"||",
"end",
">",
"length",... | Writes chars of the given string to the current position of this buffer, and increases the
position by the number of chars written.
@param str the string to write.
@param start the first char to write, must not be negative and not greater than {@code
str.length()}.
@param end the last char to write (excluding), must b... | [
"Writes",
"chars",
"of",
"the",
"given",
"string",
"to",
"the",
"current",
"position",
"of",
"this",
"buffer",
"and",
"increases",
"the",
"position",
"by",
"the",
"number",
"of",
"chars",
"written",
"."
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/html/src/playn/super/java/nio/CharBuffer.java#L413-L426 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java | ClustersInner.beginRotateDiskEncryptionKeyAsync | public Observable<Void> beginRotateDiskEncryptionKeyAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) {
"""
Rotate disk encryption key of the specified HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cl... | java | public Observable<Void> beginRotateDiskEncryptionKeyAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) {
return beginRotateDiskEncryptionKeyWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
... | [
"public",
"Observable",
"<",
"Void",
">",
"beginRotateDiskEncryptionKeyAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"ClusterDiskEncryptionParameters",
"parameters",
")",
"{",
"return",
"beginRotateDiskEncryptionKeyWithServiceResponseAsync",
"("... | Rotate disk encryption key of the specified HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param parameters The parameters for the disk encryption operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {... | [
"Rotate",
"disk",
"encryption",
"key",
"of",
"the",
"specified",
"HDInsight",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ClustersInner.java#L1396-L1403 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.awaitAnswered | public static void awaitAnswered(final String msg, final SipCall call) {
"""
Awaits that the given incoming or outgoing call leg was answered. Assertion failure output
includes the given message text.
@param msg message text to output if the assertion fails.
@param call The incoming or outgoing call leg.
... | java | public static void awaitAnswered(final String msg, final SipCall call) {
await().until(new Runnable() {
@Override
public void run() {
assertAnswered(msg, call);
}
});
} | [
"public",
"static",
"void",
"awaitAnswered",
"(",
"final",
"String",
"msg",
",",
"final",
"SipCall",
"call",
")",
"{",
"await",
"(",
")",
".",
"until",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"a... | Awaits that the given incoming or outgoing call leg was answered. Assertion failure output
includes the given message text.
@param msg message text to output if the assertion fails.
@param call The incoming or outgoing call leg. | [
"Awaits",
"that",
"the",
"given",
"incoming",
"or",
"outgoing",
"call",
"leg",
"was",
"answered",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L591-L599 |
jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/server/connection/socket/module/StandardSocketServer.java | StandardSocketServer.run | public void run() {
"""
Contains the loop that waits for and handles incoming connections.
"""
try {
while (true) {
//server thread blocks until a client connects
Socket socket = server.accept();
System.out.println(new LogEntry("client (" + socket.getInetAddress().getHostAddress() + ") attem... | java | public void run() {
try {
while (true) {
//server thread blocks until a client connects
Socket socket = server.accept();
System.out.println(new LogEntry("client (" + socket.getInetAddress().getHostAddress() + ") attempts to connect..."));
Connection c = establishConnection(socket);
updateConn... | [
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"while",
"(",
"true",
")",
"{",
"//server thread blocks until a client connects",
"Socket",
"socket",
"=",
"server",
".",
"accept",
"(",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"new",
"LogEnt... | Contains the loop that waits for and handles incoming connections. | [
"Contains",
"the",
"loop",
"that",
"waits",
"for",
"and",
"handles",
"incoming",
"connections",
"."
] | train | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/server/connection/socket/module/StandardSocketServer.java#L104-L120 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java | BaseXmlImporter.removeVersionHistory | private void removeVersionHistory(NodeData mixVersionableNode) throws RepositoryException,
ConstraintViolationException, VersionException {
"""
Remove version history of versionable node.
@param mixVersionableNode - node
@throws RepositoryException
@throws ConstraintViolationException
@throws VersionEx... | java | private void removeVersionHistory(NodeData mixVersionableNode) throws RepositoryException,
ConstraintViolationException, VersionException
{
try
{
PropertyData vhpd =
(PropertyData)dataConsumer.getItemData(mixVersionableNode, new QPathEntry(Constants.JCR_VERSIONHISTORY, 1),
... | [
"private",
"void",
"removeVersionHistory",
"(",
"NodeData",
"mixVersionableNode",
")",
"throws",
"RepositoryException",
",",
"ConstraintViolationException",
",",
"VersionException",
"{",
"try",
"{",
"PropertyData",
"vhpd",
"=",
"(",
"PropertyData",
")",
"dataConsumer",
... | Remove version history of versionable node.
@param mixVersionableNode - node
@throws RepositoryException
@throws ConstraintViolationException
@throws VersionException | [
"Remove",
"version",
"history",
"of",
"versionable",
"node",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java#L767-L786 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java | CirculantTracker.get_subwindow | protected void get_subwindow( T image , GrayF64 output ) {
"""
Copies the target into the output image and applies the cosine window to it.
"""
// copy the target region
interp.setImage(image);
int index = 0;
for( int y = 0; y < workRegionSize; y++ ) {
float yy = regionTrack.y0 + y*stepY;
for(... | java | protected void get_subwindow( T image , GrayF64 output ) {
// copy the target region
interp.setImage(image);
int index = 0;
for( int y = 0; y < workRegionSize; y++ ) {
float yy = regionTrack.y0 + y*stepY;
for( int x = 0; x < workRegionSize; x++ ) {
float xx = regionTrack.x0 + x*stepX;
if( inte... | [
"protected",
"void",
"get_subwindow",
"(",
"T",
"image",
",",
"GrayF64",
"output",
")",
"{",
"// copy the target region",
"interp",
".",
"setImage",
"(",
"image",
")",
";",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",... | Copies the target into the output image and applies the cosine window to it. | [
"Copies",
"the",
"target",
"into",
"the",
"output",
"image",
"and",
"applies",
"the",
"cosine",
"window",
"to",
"it",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/circulant/CirculantTracker.java#L577-L606 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.offerCapabilities_GET | public OvhCapabilities offerCapabilities_GET(OvhOfferCapabilitiesEnum offer) throws IOException {
"""
Get offer capabilities
REST: GET /hosting/web/offerCapabilities
@param offer [required] Describe offer capabilities
"""
String qPath = "/hosting/web/offerCapabilities";
StringBuilder sb = path(qPath);
... | java | public OvhCapabilities offerCapabilities_GET(OvhOfferCapabilitiesEnum offer) throws IOException {
String qPath = "/hosting/web/offerCapabilities";
StringBuilder sb = path(qPath);
query(sb, "offer", offer);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhCapabilities.class);
... | [
"public",
"OvhCapabilities",
"offerCapabilities_GET",
"(",
"OvhOfferCapabilitiesEnum",
"offer",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/offerCapabilities\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"query",
"... | Get offer capabilities
REST: GET /hosting/web/offerCapabilities
@param offer [required] Describe offer capabilities | [
"Get",
"offer",
"capabilities"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L2194-L2200 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ie/AbstractSequenceClassifier.java | AbstractSequenceClassifier.classifyAndWriteViterbiSearchGraph | public void classifyAndWriteViterbiSearchGraph(String testFile, String searchGraphPrefix, DocumentReaderAndWriter<IN> readerAndWriter) throws IOException {
"""
Load a test file, run the classifier on it, and then write a Viterbi search
graph for each sequence.
@param testFile
The file to test on.
"""
... | java | public void classifyAndWriteViterbiSearchGraph(String testFile, String searchGraphPrefix, DocumentReaderAndWriter<IN> readerAndWriter) throws IOException {
Timing timer = new Timing();
ObjectBank<List<IN>> documents =
makeObjectBankFromFile(testFile, readerAndWriter);
int numWords = 0;
int nu... | [
"public",
"void",
"classifyAndWriteViterbiSearchGraph",
"(",
"String",
"testFile",
",",
"String",
"searchGraphPrefix",
",",
"DocumentReaderAndWriter",
"<",
"IN",
">",
"readerAndWriter",
")",
"throws",
"IOException",
"{",
"Timing",
"timer",
"=",
"new",
"Timing",
"(",
... | Load a test file, run the classifier on it, and then write a Viterbi search
graph for each sequence.
@param testFile
The file to test on. | [
"Load",
"a",
"test",
"file",
"run",
"the",
"classifier",
"on",
"it",
"and",
"then",
"write",
"a",
"Viterbi",
"search",
"graph",
"for",
"each",
"sequence",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/AbstractSequenceClassifier.java#L1205-L1231 |
vlingo/vlingo-actors | src/main/java/io/vlingo/actors/Stage.java | Stage.commonSupervisorOr | Supervisor commonSupervisorOr(final Class<?> protocol, final Supervisor defaultSupervisor) {
"""
Answers the common Supervisor for the given protocol or the defaultSupervisor if there is
no registered common Supervisor. (INTERNAL ONLY)
@param protocol the {@code Class<?>} protocol to supervise
@param defaultSup... | java | Supervisor commonSupervisorOr(final Class<?> protocol, final Supervisor defaultSupervisor) {
final Supervisor common = commonSupervisors.get(protocol);
if (common != null) {
return common;
}
return defaultSupervisor;
} | [
"Supervisor",
"commonSupervisorOr",
"(",
"final",
"Class",
"<",
"?",
">",
"protocol",
",",
"final",
"Supervisor",
"defaultSupervisor",
")",
"{",
"final",
"Supervisor",
"common",
"=",
"commonSupervisors",
".",
"get",
"(",
"protocol",
")",
";",
"if",
"(",
"commo... | Answers the common Supervisor for the given protocol or the defaultSupervisor if there is
no registered common Supervisor. (INTERNAL ONLY)
@param protocol the {@code Class<?>} protocol to supervise
@param defaultSupervisor the Supervisor default to be used if there is no registered common Supervisor
@return Supervisor | [
"Answers",
"the",
"common",
"Supervisor",
"for",
"the",
"given",
"protocol",
"or",
"the",
"defaultSupervisor",
"if",
"there",
"is",
"no",
"registered",
"common",
"Supervisor",
".",
"(",
"INTERNAL",
"ONLY",
")"
] | train | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/Stage.java#L505-L513 |
aws/aws-sdk-java | aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/model/GetDocumentVersionResult.java | GetDocumentVersionResult.withCustomMetadata | public GetDocumentVersionResult withCustomMetadata(java.util.Map<String, String> customMetadata) {
"""
<p>
The custom metadata on the document version.
</p>
@param customMetadata
The custom metadata on the document version.
@return Returns a reference to this object so that method calls can be chained toget... | java | public GetDocumentVersionResult withCustomMetadata(java.util.Map<String, String> customMetadata) {
setCustomMetadata(customMetadata);
return this;
} | [
"public",
"GetDocumentVersionResult",
"withCustomMetadata",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"customMetadata",
")",
"{",
"setCustomMetadata",
"(",
"customMetadata",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The custom metadata on the document version.
</p>
@param customMetadata
The custom metadata on the document version.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"custom",
"metadata",
"on",
"the",
"document",
"version",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/model/GetDocumentVersionResult.java#L114-L117 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_voipLine_services_domain_GET | public OvhVoipLineService packName_voipLine_services_domain_GET(String packName, String domain) throws IOException {
"""
Get this object properties
REST: GET /pack/xdsl/{packName}/voipLine/services/{domain}
@param packName [required] The internal name of your pack
@param domain [required]
"""
String qPa... | java | public OvhVoipLineService packName_voipLine_services_domain_GET(String packName, String domain) throws IOException {
String qPath = "/pack/xdsl/{packName}/voipLine/services/{domain}";
StringBuilder sb = path(qPath, packName, domain);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, ... | [
"public",
"OvhVoipLineService",
"packName_voipLine_services_domain_GET",
"(",
"String",
"packName",
",",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/pack/xdsl/{packName}/voipLine/services/{domain}\"",
";",
"StringBuilder",
"sb",
"=",
"... | Get this object properties
REST: GET /pack/xdsl/{packName}/voipLine/services/{domain}
@param packName [required] The internal name of your pack
@param domain [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L274-L279 |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java | SchemaImpl.makeBuiltinMode | private Mode makeBuiltinMode(String name, Class cls) {
"""
Makes a built in mode.
@param name The mode name.
@param cls The action class.
@return A Mode object.
"""
// lookup/create a mode with the given name.
Mode mode = lookupCreateMode(name);
// Init the element action set for this mode.
... | java | private Mode makeBuiltinMode(String name, Class cls) {
// lookup/create a mode with the given name.
Mode mode = lookupCreateMode(name);
// Init the element action set for this mode.
ActionSet actions = new ActionSet();
// from the current mode we will use further the built in mode.
ModeUsage mod... | [
"private",
"Mode",
"makeBuiltinMode",
"(",
"String",
"name",
",",
"Class",
"cls",
")",
"{",
"// lookup/create a mode with the given name.",
"Mode",
"mode",
"=",
"lookupCreateMode",
"(",
"name",
")",
";",
"// Init the element action set for this mode.",
"ActionSet",
"actio... | Makes a built in mode.
@param name The mode name.
@param cls The action class.
@return A Mode object. | [
"Makes",
"a",
"built",
"in",
"mode",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java#L1170-L1202 |
eBay/xcelite | src/main/java/com/ebay/xcelite/Xcelite.java | Xcelite.getSheet | public XceliteSheet getSheet(int sheetIndex) {
"""
Gets the sheet at the specified index.
@param sheetIndex the sheet index
@return XceliteSheet object
"""
Sheet sheet = workbook.getSheetAt(sheetIndex);
if (sheet == null) {
throw new XceliteException(String.format("Could not find sheet at ... | java | public XceliteSheet getSheet(int sheetIndex) {
Sheet sheet = workbook.getSheetAt(sheetIndex);
if (sheet == null) {
throw new XceliteException(String.format("Could not find sheet at index %s", sheetIndex));
}
return new XceliteSheetImpl(sheet, file);
} | [
"public",
"XceliteSheet",
"getSheet",
"(",
"int",
"sheetIndex",
")",
"{",
"Sheet",
"sheet",
"=",
"workbook",
".",
"getSheetAt",
"(",
"sheetIndex",
")",
";",
"if",
"(",
"sheet",
"==",
"null",
")",
"{",
"throw",
"new",
"XceliteException",
"(",
"String",
".",... | Gets the sheet at the specified index.
@param sheetIndex the sheet index
@return XceliteSheet object | [
"Gets",
"the",
"sheet",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/eBay/xcelite/blob/0362f4cf9c5b8dee73e8ec00a860f0fef0f0c2e1/src/main/java/com/ebay/xcelite/Xcelite.java#L85-L91 |
apereo/cas | support/cas-server-support-duo-core/src/main/java/org/apereo/cas/adaptors/duo/authn/BaseDuoSecurityAuthenticationService.java | BaseDuoSecurityAuthenticationService.signHttpAuthRequest | @SneakyThrows
protected Http signHttpAuthRequest(final Http request, final String id) {
"""
Sign http request.
@param request the request
@param id the id
@return the http
"""
request.addParam("username", id);
request.addParam("factor", "auto");
request.addParam("device", ... | java | @SneakyThrows
protected Http signHttpAuthRequest(final Http request, final String id) {
request.addParam("username", id);
request.addParam("factor", "auto");
request.addParam("device", "auto");
request.signRequest(
duoProperties.getDuoIntegrationKey(),
duoProp... | [
"@",
"SneakyThrows",
"protected",
"Http",
"signHttpAuthRequest",
"(",
"final",
"Http",
"request",
",",
"final",
"String",
"id",
")",
"{",
"request",
".",
"addParam",
"(",
"\"username\"",
",",
"id",
")",
";",
"request",
".",
"addParam",
"(",
"\"factor\"",
","... | Sign http request.
@param request the request
@param id the id
@return the http | [
"Sign",
"http",
"request",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-duo-core/src/main/java/org/apereo/cas/adaptors/duo/authn/BaseDuoSecurityAuthenticationService.java#L207-L216 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/container/impl/metadata/PropertyHelper.java | PropertyHelper.applyProperties | public static void applyProperties(Object configuration, Map<String, String> properties) {
"""
Sets an objects fields via reflection from String values.
Depending on the field's type the respective values are converted to int or boolean.
@param configuration
@param properties
@throws ProcessEngineException i... | java | public static void applyProperties(Object configuration, Map<String, String> properties) {
for (Map.Entry<String, String> property : properties.entrySet()) {
applyProperty(configuration, property.getKey(), property.getValue());
}
} | [
"public",
"static",
"void",
"applyProperties",
"(",
"Object",
"configuration",
",",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"property",
":",
"properties",
".",
... | Sets an objects fields via reflection from String values.
Depending on the field's type the respective values are converted to int or boolean.
@param configuration
@param properties
@throws ProcessEngineException if a property is supplied that matches no field or
if the field's type is not String, nor int, nor boolean... | [
"Sets",
"an",
"objects",
"fields",
"via",
"reflection",
"from",
"String",
"values",
".",
"Depending",
"on",
"the",
"field",
"s",
"type",
"the",
"respective",
"values",
"are",
"converted",
"to",
"int",
"or",
"boolean",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/container/impl/metadata/PropertyHelper.java#L108-L112 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_user_GET | public ArrayList<OvhUser> project_serviceName_user_GET(String serviceName) throws IOException {
"""
Get all users
REST: GET /cloud/project/{serviceName}/user
@param serviceName [required] Service name
"""
String qPath = "/cloud/project/{serviceName}/user";
StringBuilder sb = path(qPath, serviceName);
... | java | public ArrayList<OvhUser> project_serviceName_user_GET(String serviceName) throws IOException {
String qPath = "/cloud/project/{serviceName}/user";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t4);
} | [
"public",
"ArrayList",
"<",
"OvhUser",
">",
"project_serviceName_user_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/user\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
... | Get all users
REST: GET /cloud/project/{serviceName}/user
@param serviceName [required] Service name | [
"Get",
"all",
"users"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L493-L498 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.logException | public static void logException( Logger logger, Level logLevel, Throwable t ) {
"""
Logs an exception with the given logger and the given level.
<p>
Writing a stack trace may be time-consuming in some environments.
To prevent useless computing, this method checks the current log level
before trying to log anyt... | java | public static void logException( Logger logger, Level logLevel, Throwable t ) {
logException( logger, logLevel, t, null );
} | [
"public",
"static",
"void",
"logException",
"(",
"Logger",
"logger",
",",
"Level",
"logLevel",
",",
"Throwable",
"t",
")",
"{",
"logException",
"(",
"logger",
",",
"logLevel",
",",
"t",
",",
"null",
")",
";",
"}"
] | Logs an exception with the given logger and the given level.
<p>
Writing a stack trace may be time-consuming in some environments.
To prevent useless computing, this method checks the current log level
before trying to log anything.
</p>
@param logger the logger
@param t an exception or a throwable
@param logLevel the... | [
"Logs",
"an",
"exception",
"with",
"the",
"given",
"logger",
"and",
"the",
"given",
"level",
".",
"<p",
">",
"Writing",
"a",
"stack",
"trace",
"may",
"be",
"time",
"-",
"consuming",
"in",
"some",
"environments",
".",
"To",
"prevent",
"useless",
"computing"... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L1126-L1128 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java | CShareableResource.capOverbookRatio | public double capOverbookRatio(int nIdx, double d) {
"""
Cap the overbooking ratio for a given node.
@param nIdx the node
@param d the new ratio. {@code >= 1}
@return the resulting ratio. Will be lower than {@code d} if a previous cap stated a lower value
"""
if (d < 1) {
return ratios.g... | java | public double capOverbookRatio(int nIdx, double d) {
if (d < 1) {
return ratios.get(nIdx);
}
double v = Math.min(ratios.get(nIdx), d);
ratios.set(nIdx, v);
return v;
} | [
"public",
"double",
"capOverbookRatio",
"(",
"int",
"nIdx",
",",
"double",
"d",
")",
"{",
"if",
"(",
"d",
"<",
"1",
")",
"{",
"return",
"ratios",
".",
"get",
"(",
"nIdx",
")",
";",
"}",
"double",
"v",
"=",
"Math",
".",
"min",
"(",
"ratios",
".",
... | Cap the overbooking ratio for a given node.
@param nIdx the node
@param d the new ratio. {@code >= 1}
@return the resulting ratio. Will be lower than {@code d} if a previous cap stated a lower value | [
"Cap",
"the",
"overbooking",
"ratio",
"for",
"a",
"given",
"node",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java#L243-L250 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/registry/CachingCodecRegistry.java | CachingCodecRegistry.codecFor | protected <JavaTypeT> TypeCodec<JavaTypeT> codecFor(
DataType cqlType, GenericType<JavaTypeT> javaType, boolean isJavaCovariant) {
"""
Not exposed publicly, (isJavaCovariant=true) is only used for internal recursion
"""
LOG.trace("[{}] Looking up codec for {} <-> {}", logPrefix, cqlType, javaType);
... | java | protected <JavaTypeT> TypeCodec<JavaTypeT> codecFor(
DataType cqlType, GenericType<JavaTypeT> javaType, boolean isJavaCovariant) {
LOG.trace("[{}] Looking up codec for {} <-> {}", logPrefix, cqlType, javaType);
TypeCodec<?> primitiveCodec = primitiveCodecsByCode.get(cqlType.getProtocolCode());
if (pri... | [
"protected",
"<",
"JavaTypeT",
">",
"TypeCodec",
"<",
"JavaTypeT",
">",
"codecFor",
"(",
"DataType",
"cqlType",
",",
"GenericType",
"<",
"JavaTypeT",
">",
"javaType",
",",
"boolean",
"isJavaCovariant",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"[{}] Looking up codec... | Not exposed publicly, (isJavaCovariant=true) is only used for internal recursion | [
"Not",
"exposed",
"publicly",
"(",
"isJavaCovariant",
"=",
"true",
")",
"is",
"only",
"used",
"for",
"internal",
"recursion"
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/registry/CachingCodecRegistry.java#L98-L113 |
alibaba/canal | client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/support/ESTemplate.java | ESTemplate.getESDataFromDmlData | public Object getESDataFromDmlData(ESMapping mapping, Map<String, Object> dmlData,
Map<String, Object> esFieldData) {
"""
将dml的data转换为es的data
@param mapping 配置mapping
@param dmlData dml data
@param esFieldData es data
@return 返回 id 值
"""
SchemaItem schemaIte... | java | public Object getESDataFromDmlData(ESMapping mapping, Map<String, Object> dmlData,
Map<String, Object> esFieldData) {
SchemaItem schemaItem = mapping.getSchemaItem();
String idFieldName = mapping.get_id() == null ? mapping.getPk() : mapping.get_id();
Object... | [
"public",
"Object",
"getESDataFromDmlData",
"(",
"ESMapping",
"mapping",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"dmlData",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"esFieldData",
")",
"{",
"SchemaItem",
"schemaItem",
"=",
"mapping",
".",
"getSc... | 将dml的data转换为es的data
@param mapping 配置mapping
@param dmlData dml data
@param esFieldData es data
@return 返回 id 值 | [
"将dml的data转换为es的data"
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/support/ESTemplate.java#L371-L393 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/URLEncodedUtils.java | URLEncodedUtils.encUric | static String encUric(final String content, final Charset charset) {
"""
Encode a String using the {@link #URIC} set of characters.
<p>
Used by URIBuilder to encode the query and fragment segments.
@param content the string to encode, does not convert space to '+'
@param charset the charset to use
@return t... | java | static String encUric(final String content, final Charset charset) {
return urlEncode(content, charset, URIC, false);
} | [
"static",
"String",
"encUric",
"(",
"final",
"String",
"content",
",",
"final",
"Charset",
"charset",
")",
"{",
"return",
"urlEncode",
"(",
"content",
",",
"charset",
",",
"URIC",
",",
"false",
")",
";",
"}"
] | Encode a String using the {@link #URIC} set of characters.
<p>
Used by URIBuilder to encode the query and fragment segments.
@param content the string to encode, does not convert space to '+'
@param charset the charset to use
@return the encoded string | [
"Encode",
"a",
"String",
"using",
"the",
"{",
"@link",
"#URIC",
"}",
"set",
"of",
"characters",
".",
"<p",
">",
"Used",
"by",
"URIBuilder",
"to",
"encode",
"the",
"query",
"and",
"fragment",
"segments",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/URLEncodedUtils.java#L331-L333 |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/internal/layer/feature/AttributeService.java | AttributeService.getAttributes | public InternalFeature getAttributes(VectorLayer layer, InternalFeature feature, Object featureBean)
throws LayerException {
"""
Get the attributes for a feature, and put them in the feature object.
<p/>
The attributes are converted lazily if requested by the layer.
<p/>
The feature is filled into the passe... | java | public InternalFeature getAttributes(VectorLayer layer, InternalFeature feature, Object featureBean)
throws LayerException {
String layerId = layer.getId();
Map<String, Attribute> featureAttributes = getRealAttributes(layer, featureBean);
feature.setAttributes(featureAttributes); // to allow isAttributeReadab... | [
"public",
"InternalFeature",
"getAttributes",
"(",
"VectorLayer",
"layer",
",",
"InternalFeature",
"feature",
",",
"Object",
"featureBean",
")",
"throws",
"LayerException",
"{",
"String",
"layerId",
"=",
"layer",
".",
"getId",
"(",
")",
";",
"Map",
"<",
"String"... | Get the attributes for a feature, and put them in the feature object.
<p/>
The attributes are converted lazily if requested by the layer.
<p/>
The feature is filled into the passed feature object. If the feature should not be visible according to security,
null is returned (the original (passed) feature should be disca... | [
"Get",
"the",
"attributes",
"for",
"a",
"feature",
"and",
"put",
"them",
"in",
"the",
"feature",
"object",
".",
"<p",
"/",
">",
"The",
"attributes",
"are",
"converted",
"lazily",
"if",
"requested",
"by",
"the",
"layer",
".",
"<p",
"/",
">",
"The",
"fea... | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/layer/feature/AttributeService.java#L79-L97 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoSparse3D.java | StereoSparse3D.process | @Override
public boolean process(double x, double y) {
"""
Takes in pixel coordinates from the left camera in the original image coordinate system
@param x x-coordinate of the pixel
@param y y-coordinate of the pixel
@return true if successful
"""
leftPixelToRect.compute(x,y,pixelRect);
// round to t... | java | @Override
public boolean process(double x, double y) {
leftPixelToRect.compute(x,y,pixelRect);
// round to the nearest pixel
if( !disparity.process((int)(pixelRect.x+0.5),(int)(pixelRect.y+0.5)) )
return false;
// Compute coordinate in camera frame
this.w = disparity.getDisparity();
computeHomo3D(pix... | [
"@",
"Override",
"public",
"boolean",
"process",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"leftPixelToRect",
".",
"compute",
"(",
"x",
",",
"y",
",",
"pixelRect",
")",
";",
"// round to the nearest pixel",
"if",
"(",
"!",
"disparity",
".",
"proces... | Takes in pixel coordinates from the left camera in the original image coordinate system
@param x x-coordinate of the pixel
@param y y-coordinate of the pixel
@return true if successful | [
"Takes",
"in",
"pixel",
"coordinates",
"from",
"the",
"left",
"camera",
"in",
"the",
"original",
"image",
"coordinate",
"system"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/StereoSparse3D.java#L81-L95 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hll/AbstractCoupons.java | AbstractCoupons.getEstimate | @Override
double getEstimate() {
"""
This is the estimator for the Coupon List mode and Coupon Hash Set mode.
<p>Note: This is an approximation to the true mapping from numCoupons to N,
which has a range of validity roughly from 0 to 6 million coupons.</p>
<p>The k of the implied coupon sketch, which must... | java | @Override
double getEstimate() {
final int couponCount = getCouponCount();
final double est = CubicInterpolation.usingXAndYTables(CouponMapping.xArr,
CouponMapping.yArr, couponCount);
return max(est, couponCount);
} | [
"@",
"Override",
"double",
"getEstimate",
"(",
")",
"{",
"final",
"int",
"couponCount",
"=",
"getCouponCount",
"(",
")",
";",
"final",
"double",
"est",
"=",
"CubicInterpolation",
".",
"usingXAndYTables",
"(",
"CouponMapping",
".",
"xArr",
",",
"CouponMapping",
... | This is the estimator for the Coupon List mode and Coupon Hash Set mode.
<p>Note: This is an approximation to the true mapping from numCoupons to N,
which has a range of validity roughly from 0 to 6 million coupons.</p>
<p>The k of the implied coupon sketch, which must not be confused with the k of the HLL
sketch. I... | [
"This",
"is",
"the",
"estimator",
"for",
"the",
"Coupon",
"List",
"mode",
"and",
"Coupon",
"Hash",
"Set",
"mode",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hll/AbstractCoupons.java#L46-L52 |
fengwenyi/JavaLib | src/main/java/com/fengwenyi/javalib/util/FileUtil.java | FileUtil.write | public static void write(String path, String str, boolean isNewMode) throws IOException {
"""
将字符串写入到文件中
@param path 文件位置
@param str 字符串
@param isNewMode 写入方式(true追加; false覆盖)
@throws IOException 写入失败
"""
File file = new File(path);
// 如果文件不存在就创建
if (!file.exists()) file.createNewFi... | java | public static void write(String path, String str, boolean isNewMode) throws IOException {
File file = new File(path);
// 如果文件不存在就创建
if (!file.exists()) file.createNewFile();
FileOutputStream out = new FileOutputStream(file, isNewMode);
StringBuffer sb = new StringBuffer();
... | [
"public",
"static",
"void",
"write",
"(",
"String",
"path",
",",
"String",
"str",
",",
"boolean",
"isNewMode",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"path",
")",
";",
"// 如果文件不存在就创建",
"if",
"(",
"!",
"file",
".",
"... | 将字符串写入到文件中
@param path 文件位置
@param str 字符串
@param isNewMode 写入方式(true追加; false覆盖)
@throws IOException 写入失败 | [
"将字符串写入到文件中"
] | train | https://github.com/fengwenyi/JavaLib/blob/14838b13fb11c024e41be766aa3e13ead4be1703/src/main/java/com/fengwenyi/javalib/util/FileUtil.java#L19-L29 |
OpenLiberty/open-liberty | dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/AppClassLoader.java | AppClassLoader.definePackage | @FFDCIgnore(value = {
"""
This method will define the package using the byteResourceInformation for a class to get the URL for this package to try to load a manifest. If a manifest can't be loaded
from the URL it will create the package with no package versioning or sealing information.
@param byteResourceInfo... | java | @FFDCIgnore(value = { IllegalArgumentException.class })
private void definePackage(ByteResourceInformation byteResourceInformation, String packageName) {
// If the package is in a JAR then we can load the JAR manifest to see what package definitions it's got
Manifest manifest = byteResourceInformati... | [
"@",
"FFDCIgnore",
"(",
"value",
"=",
"{",
"IllegalArgumentException",
".",
"class",
"}",
")",
"private",
"void",
"definePackage",
"(",
"ByteResourceInformation",
"byteResourceInformation",
",",
"String",
"packageName",
")",
"{",
"// If the package is in a JAR then we can... | This method will define the package using the byteResourceInformation for a class to get the URL for this package to try to load a manifest. If a manifest can't be loaded
from the URL it will create the package with no package versioning or sealing information.
@param byteResourceInformation The information about the ... | [
"This",
"method",
"will",
"define",
"the",
"package",
"using",
"the",
"byteResourceInformation",
"for",
"a",
"class",
"to",
"get",
"the",
"URL",
"for",
"this",
"package",
"to",
"try",
"to",
"load",
"a",
"manifest",
".",
"If",
"a",
"manifest",
"can",
"t",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/AppClassLoader.java#L439-L455 |
pravega/pravega | controller/src/main/java/io/pravega/controller/metrics/TransactionMetrics.java | TransactionMetrics.createTransaction | public void createTransaction(String scope, String streamName, Duration latency) {
"""
This method increments the global and Stream-related counters of created Transactions and reports the latency of
the operation.
@param scope Scope.
@param streamName Name of the Stream.
@param latency Latency of th... | java | public void createTransaction(String scope, String streamName, Duration latency) {
DYNAMIC_LOGGER.incCounterValue(globalMetricName(CREATE_TRANSACTION), 1);
DYNAMIC_LOGGER.incCounterValue(CREATE_TRANSACTION, 1, streamTags(scope, streamName));
createTransactionLatency.reportSuccessValue(latency.to... | [
"public",
"void",
"createTransaction",
"(",
"String",
"scope",
",",
"String",
"streamName",
",",
"Duration",
"latency",
")",
"{",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
"(",
"globalMetricName",
"(",
"CREATE_TRANSACTION",
")",
",",
"1",
")",
";",
"DYNAMIC_LOGGER... | This method increments the global and Stream-related counters of created Transactions and reports the latency of
the operation.
@param scope Scope.
@param streamName Name of the Stream.
@param latency Latency of the create Transaction operation. | [
"This",
"method",
"increments",
"the",
"global",
"and",
"Stream",
"-",
"related",
"counters",
"of",
"created",
"Transactions",
"and",
"reports",
"the",
"latency",
"of",
"the",
"operation",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/TransactionMetrics.java#L46-L50 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/reflection/EntityClassReader.java | EntityClassReader.getPropertyValue | public Object getPropertyValue(Object objectToGet, String propertyPath) throws InvalidObjectReaderException {
"""
Returns the value of the property with a given name from the given object
@param objectToGet The object from which the property value is to be retrieved
@param propertyPath The dot-separated path ... | java | public Object getPropertyValue(Object objectToGet, String propertyPath) throws InvalidObjectReaderException {
if (objectToGet == null || propertyPath == null) {
throw new IllegalArgumentException("Given object/propertyname may not be null");
}
if (objectToGet.getClass() != entityCla... | [
"public",
"Object",
"getPropertyValue",
"(",
"Object",
"objectToGet",
",",
"String",
"propertyPath",
")",
"throws",
"InvalidObjectReaderException",
"{",
"if",
"(",
"objectToGet",
"==",
"null",
"||",
"propertyPath",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalA... | Returns the value of the property with a given name from the given object
@param objectToGet The object from which the property value is to be retrieved
@param propertyPath The dot-separated path of the property to retrieve. E.g. directly property: "name",
sub property: "streetAddress.number"
@return The value of the... | [
"Returns",
"the",
"value",
"of",
"the",
"property",
"with",
"a",
"given",
"name",
"from",
"the",
"given",
"object"
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/reflection/EntityClassReader.java#L323-L334 |
alkacon/opencms-core | src-gwt/org/opencms/ugc/client/export/CmsClientUgcSession.java | CmsClientUgcSession.getLink | public void getLink(String path, final I_CmsStringCallback callback) {
"""
Fetches the link for a given path from the server.<p>
@param path the path for which we want the link
@param callback the callback to call with the result
"""
m_apiRoot.getRpcHelper().executeRpc(CmsXmlContentUgcApi.SERVIC... | java | public void getLink(String path, final I_CmsStringCallback callback) {
m_apiRoot.getRpcHelper().executeRpc(CmsXmlContentUgcApi.SERVICE.getLink(path, new AsyncCallback<String>() {
@SuppressWarnings("synthetic-access")
public void onFailure(Throwable caught) {
m_apiRoot.... | [
"public",
"void",
"getLink",
"(",
"String",
"path",
",",
"final",
"I_CmsStringCallback",
"callback",
")",
"{",
"m_apiRoot",
".",
"getRpcHelper",
"(",
")",
".",
"executeRpc",
"(",
"CmsXmlContentUgcApi",
".",
"SERVICE",
".",
"getLink",
"(",
"path",
",",
"new",
... | Fetches the link for a given path from the server.<p>
@param path the path for which we want the link
@param callback the callback to call with the result | [
"Fetches",
"the",
"link",
"for",
"a",
"given",
"path",
"from",
"the",
"server",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ugc/client/export/CmsClientUgcSession.java#L121-L136 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/listeners/JobChainingJobListener.java | JobChainingJobListener.addJobChainLink | public void addJobChainLink (final JobKey firstJob, final JobKey secondJob) {
"""
Add a chain mapping - when the Job identified by the first key completes
the job identified by the second key will be triggered.
@param firstJob
a JobKey with the name and group of the first job
@param secondJob
a JobKey with ... | java | public void addJobChainLink (final JobKey firstJob, final JobKey secondJob)
{
ValueEnforcer.notNull (firstJob, "FirstJob");
ValueEnforcer.notNull (firstJob.getName (), "FirstJob.Name");
ValueEnforcer.notNull (secondJob, "SecondJob");
ValueEnforcer.notNull (secondJob.getName (), "SecondJob.Name");
... | [
"public",
"void",
"addJobChainLink",
"(",
"final",
"JobKey",
"firstJob",
",",
"final",
"JobKey",
"secondJob",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"firstJob",
",",
"\"FirstJob\"",
")",
";",
"ValueEnforcer",
".",
"notNull",
"(",
"firstJob",
".",
"get... | Add a chain mapping - when the Job identified by the first key completes
the job identified by the second key will be triggered.
@param firstJob
a JobKey with the name and group of the first job
@param secondJob
a JobKey with the name and group of the follow-up job | [
"Add",
"a",
"chain",
"mapping",
"-",
"when",
"the",
"Job",
"identified",
"by",
"the",
"first",
"key",
"completes",
"the",
"job",
"identified",
"by",
"the",
"second",
"key",
"will",
"be",
"triggered",
"."
] | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/listeners/JobChainingJobListener.java#L87-L95 |
52inc/android-52Kit | library/src/main/java/com/ftinc/kit/font/FontLoader.java | FontLoader.getTypeface | public static Typeface getTypeface(Context ctx, String fontName) {
"""
Get a typeface for a given the font name/path
@param ctx the context to load the typeface from assets
@param fontName the name/path of of the typeface to load
@return the loaded typeface, or null
"""
... | java | public static Typeface getTypeface(Context ctx, String fontName){
Typeface existing = mLoadedTypefaces.get(fontName);
if(existing == null){
existing = Typeface.createFromAsset(ctx.getAssets(), fontName);
mLoadedTypefaces.put(fontName, existing);
}
return existing;... | [
"public",
"static",
"Typeface",
"getTypeface",
"(",
"Context",
"ctx",
",",
"String",
"fontName",
")",
"{",
"Typeface",
"existing",
"=",
"mLoadedTypefaces",
".",
"get",
"(",
"fontName",
")",
";",
"if",
"(",
"existing",
"==",
"null",
")",
"{",
"existing",
"=... | Get a typeface for a given the font name/path
@param ctx the context to load the typeface from assets
@param fontName the name/path of of the typeface to load
@return the loaded typeface, or null | [
"Get",
"a",
"typeface",
"for",
"a",
"given",
"the",
"font",
"name",
"/",
"path"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/font/FontLoader.java#L115-L122 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ScheduleExpressionParser.java | ScheduleExpressionParser.findNamedValue | private int findNamedValue(int begin, String[] namedValues, int min) {
"""
Case-insensitively search the specified list of named values for a
substring of the parse string. The substring of the parse string is the
range [begin, ivPos).
@param begin the beginning index of the substring, inclusive
@param named... | java | private int findNamedValue(int begin, String[] namedValues, int min)
{
int length = ivPos - begin;
for (int i = 0; i < namedValues.length; i++)
{
String namedValue = namedValues[i];
if (length == namedValue.length() && ivString.regionMatches(true, begin, namedValue,... | [
"private",
"int",
"findNamedValue",
"(",
"int",
"begin",
",",
"String",
"[",
"]",
"namedValues",
",",
"int",
"min",
")",
"{",
"int",
"length",
"=",
"ivPos",
"-",
"begin",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"namedValues",
".",
"le... | Case-insensitively search the specified list of named values for a
substring of the parse string. The substring of the parse string is the
range [begin, ivPos).
@param begin the beginning index of the substring, inclusive
@param namedValues the values to search
@param min the non-negative adjustment for the return val... | [
"Case",
"-",
"insensitively",
"search",
"the",
"specified",
"list",
"of",
"named",
"values",
"for",
"a",
"substring",
"of",
"the",
"parse",
"string",
".",
"The",
"substring",
"of",
"the",
"parse",
"string",
"is",
"the",
"range",
"[",
"begin",
"ivPos",
")",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ScheduleExpressionParser.java#L655-L670 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/converter/avro/JsonElementConversionFactory.java | JsonElementConversionFactory.getConvertor | public static JsonElementConverter getConvertor(JsonSchema schemaNode, String namespace, WorkUnitState state)
throws UnsupportedDateTypeException {
"""
Use to create a converter for a single field from a schema.
@param schemaNode
@param namespace
@param state
@return {@link JsonElementConverter}
@throws... | java | public static JsonElementConverter getConvertor(JsonSchema schemaNode, String namespace, WorkUnitState state)
throws UnsupportedDateTypeException {
Type type = schemaNode.getType();
DateTimeZone timeZone = getTimeZone(state.getProp(ConfigurationKeys.CONVERTER_AVRO_DATE_TIMEZONE, "UTC"));
switch (typ... | [
"public",
"static",
"JsonElementConverter",
"getConvertor",
"(",
"JsonSchema",
"schemaNode",
",",
"String",
"namespace",
",",
"WorkUnitState",
"state",
")",
"throws",
"UnsupportedDateTypeException",
"{",
"Type",
"type",
"=",
"schemaNode",
".",
"getType",
"(",
")",
"... | Use to create a converter for a single field from a schema.
@param schemaNode
@param namespace
@param state
@return {@link JsonElementConverter}
@throws UnsupportedDateTypeException | [
"Use",
"to",
"create",
"a",
"converter",
"for",
"a",
"single",
"field",
"from",
"a",
"schema",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/converter/avro/JsonElementConversionFactory.java#L101-L165 |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/AbstractSecureRedirectStrategy.java | AbstractSecureRedirectStrategy.insecureUrl | public String insecureUrl(HttpServletRequest request, HttpServletResponse response) throws IOException {
"""
Returns the insecure version of the original URL for the request.
@param request the secure request that was made.
@param response the response for the request.
@return the insecure version of the orig... | java | public String insecureUrl(HttpServletRequest request, HttpServletResponse response) throws IOException {
String protocol = getProtocol(request);
if( protocol.equalsIgnoreCase(HTTPS_PROTOCOL) ) {
int port = mapPort(TO_INSECURE_PORT_MAP, getPort(request));
try {
return changeProtocolAndPort(HT... | [
"public",
"String",
"insecureUrl",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"String",
"protocol",
"=",
"getProtocol",
"(",
"request",
")",
";",
"if",
"(",
"protocol",
".",
"equalsIgnoreCase",
... | Returns the insecure version of the original URL for the request.
@param request the secure request that was made.
@param response the response for the request.
@return the insecure version of the original URL for the request.
@throws IOException if the url could not be created. | [
"Returns",
"the",
"insecure",
"version",
"of",
"the",
"original",
"URL",
"for",
"the",
"request",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/AbstractSecureRedirectStrategy.java#L133-L146 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPP14Reader.java | MPP14Reader.processTableData | private void processTableData() throws IOException {
"""
This method extracts table data from the MPP file.
@throws java.io.IOException
"""
DirectoryEntry dir = (DirectoryEntry) m_viewDir.getEntry("CTable");
VarMeta varMeta = new VarMeta12(new DocumentInputStream(((DocumentEntry) dir.getEntry("... | java | private void processTableData() throws IOException
{
DirectoryEntry dir = (DirectoryEntry) m_viewDir.getEntry("CTable");
VarMeta varMeta = new VarMeta12(new DocumentInputStream(((DocumentEntry) dir.getEntry("VarMeta"))));
Var2Data varData = new Var2Data(varMeta, new DocumentInputStream(((DocumentE... | [
"private",
"void",
"processTableData",
"(",
")",
"throws",
"IOException",
"{",
"DirectoryEntry",
"dir",
"=",
"(",
"DirectoryEntry",
")",
"m_viewDir",
".",
"getEntry",
"(",
"\"CTable\"",
")",
";",
"VarMeta",
"varMeta",
"=",
"new",
"VarMeta12",
"(",
"new",
"Docu... | This method extracts table data from the MPP file.
@throws java.io.IOException | [
"This",
"method",
"extracts",
"table",
"data",
"from",
"the",
"MPP",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP14Reader.java#L1838-L1859 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.