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 |
|---|---|---|---|---|---|---|---|---|---|---|
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java | PayloadNameRequestWrapper.parseGwtRpcMethodName | @SuppressWarnings("resource")
private static String parseGwtRpcMethodName(InputStream stream, String charEncoding) {
"""
Try to parse GWT-RPC method name from request body stream. Does not close the stream.
@param stream GWT-RPC request body stream @nonnull
@param charEncoding character encoding of stream, ... | java | @SuppressWarnings("resource")
private static String parseGwtRpcMethodName(InputStream stream, String charEncoding) {
//commented out code uses GWT-user library for a more 'proper' approach.
//GWT-user library approach is more future-proof, but requires more dependency management.
// RPCRequest decodeReque... | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"private",
"static",
"String",
"parseGwtRpcMethodName",
"(",
"InputStream",
"stream",
",",
"String",
"charEncoding",
")",
"{",
"//commented out code uses GWT-user library for a more 'proper' approach.\r",
"//GWT-user library appr... | Try to parse GWT-RPC method name from request body stream. Does not close the stream.
@param stream GWT-RPC request body stream @nonnull
@param charEncoding character encoding of stream, or null for platform default @null
@return GWT-RPC method name, or null if unable to parse @null | [
"Try",
"to",
"parse",
"GWT",
"-",
"RPC",
"method",
"name",
"from",
"request",
"body",
"stream",
".",
"Does",
"not",
"close",
"the",
"stream",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java#L152-L191 |
bluelinelabs/Conductor | conductor/src/main/java/com/bluelinelabs/conductor/Controller.java | Controller.handleBack | public boolean handleBack() {
"""
Should be overridden if this Controller needs to handle the back button being pressed.
@return True if this Controller has consumed the back button press, otherwise false
"""
List<RouterTransaction> childTransactions = new ArrayList<>();
for (ControllerHost... | java | public boolean handleBack() {
List<RouterTransaction> childTransactions = new ArrayList<>();
for (ControllerHostedRouter childRouter : childRouters) {
childTransactions.addAll(childRouter.getBackstack());
}
Collections.sort(childTransactions, new Comparator<RouterTransactio... | [
"public",
"boolean",
"handleBack",
"(",
")",
"{",
"List",
"<",
"RouterTransaction",
">",
"childTransactions",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"ControllerHostedRouter",
"childRouter",
":",
"childRouters",
")",
"{",
"childTransactions",
"... | Should be overridden if this Controller needs to handle the back button being pressed.
@return True if this Controller has consumed the back button press, otherwise false | [
"Should",
"be",
"overridden",
"if",
"this",
"Controller",
"needs",
"to",
"handle",
"the",
"back",
"button",
"being",
"pressed",
"."
] | train | https://github.com/bluelinelabs/Conductor/blob/94c9121bb16f93b481954513a8e3905846829fb2/conductor/src/main/java/com/bluelinelabs/conductor/Controller.java#L596-L619 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.expectPrivate | public static synchronized <T> IExpectationSetters<T> expectPrivate(Object instance, String methodName,
Object... arguments) throws Exception {
"""
Used to specify expectations on methods using the method name. Works on
for example private or... | java | public static synchronized <T> IExpectationSetters<T> expectPrivate(Object instance, String methodName,
Object... arguments) throws Exception {
if (instance == null) {
throw new IllegalArgumentException("Instance or class cannot... | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"IExpectationSetters",
"<",
"T",
">",
"expectPrivate",
"(",
"Object",
"instance",
",",
"String",
"methodName",
",",
"Object",
"...",
"arguments",
")",
"throws",
"Exception",
"{",
"if",
"(",
"instance",
"==",
... | Used to specify expectations on methods using the method name. Works on
for example private or package private methods. | [
"Used",
"to",
"specify",
"expectations",
"on",
"methods",
"using",
"the",
"method",
"name",
".",
"Works",
"on",
"for",
"example",
"private",
"or",
"package",
"private",
"methods",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1184-L1191 |
atteo/classindex | classindex/src/main/java/org/atteo/classindex/ClassIndex.java | ClassIndex.getAnnotated | public static Iterable<Class<?>> getAnnotated(Class<? extends Annotation> annotation) {
"""
Retrieves a list of classes annotated by given annotation.
<p/>
<p>
The annotation must be annotated with {@link IndexAnnotated} for annotated classes
to be indexed at compile-time by {@link org.atteo.classindex.process... | java | public static Iterable<Class<?>> getAnnotated(Class<? extends Annotation> annotation) {
return getAnnotated(annotation, Thread.currentThread().getContextClassLoader());
} | [
"public",
"static",
"Iterable",
"<",
"Class",
"<",
"?",
">",
">",
"getAnnotated",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
")",
"{",
"return",
"getAnnotated",
"(",
"annotation",
",",
"Thread",
".",
"currentThread",
"(",
")",
".",... | Retrieves a list of classes annotated by given annotation.
<p/>
<p>
The annotation must be annotated with {@link IndexAnnotated} for annotated classes
to be indexed at compile-time by {@link org.atteo.classindex.processor.ClassIndexProcessor}.
</p>
@param annotation annotation to search class for
@return list of annot... | [
"Retrieves",
"a",
"list",
"of",
"classes",
"annotated",
"by",
"given",
"annotation",
".",
"<p",
"/",
">",
"<p",
">",
"The",
"annotation",
"must",
"be",
"annotated",
"with",
"{",
"@link",
"IndexAnnotated",
"}",
"for",
"annotated",
"classes",
"to",
"be",
"in... | train | https://github.com/atteo/classindex/blob/ad76c6bd8b4e84c594d94e48f466a095ffe2306a/classindex/src/main/java/org/atteo/classindex/ClassIndex.java#L248-L250 |
Bedework/bw-util | bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java | DateTimeUtil.fromRfcDateTime | @SuppressWarnings("unused")
public static Date fromRfcDateTime(final String val) throws BadDateException {
"""
Get Date from "yyyy-MM-ddThh:mm:ss"
@param val String "yyyy-MM-ddThh:mm:ss"
@return Date
@throws BadDateException on format error
"""
try {
return fromRfcDateTime(val, Timezones.getDe... | java | @SuppressWarnings("unused")
public static Date fromRfcDateTime(final String val) throws BadDateException {
try {
return fromRfcDateTime(val, Timezones.getDefaultTz());
} catch (BadDateException bde) {
throw bde;
} catch (Throwable t) {
throw new BadDateException();
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"static",
"Date",
"fromRfcDateTime",
"(",
"final",
"String",
"val",
")",
"throws",
"BadDateException",
"{",
"try",
"{",
"return",
"fromRfcDateTime",
"(",
"val",
",",
"Timezones",
".",
"getDefaultTz",
"("... | Get Date from "yyyy-MM-ddThh:mm:ss"
@param val String "yyyy-MM-ddThh:mm:ss"
@return Date
@throws BadDateException on format error | [
"Get",
"Date",
"from",
"yyyy",
"-",
"MM",
"-",
"ddThh",
":",
"mm",
":",
"ss"
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-timezones/src/main/java/org/bedework/util/timezones/DateTimeUtil.java#L335-L344 |
pravega/pravega | common/src/main/java/io/pravega/common/util/btree/PageWrapper.java | PageWrapper.wrapNew | static PageWrapper wrapNew(BTreePage page, PageWrapper parent, PagePointer pointer) {
"""
Creates a new instance of the PageWrapper class for a new Page.
@param page Page to wrap.
@param parent Page's Parent.
@param pointer Page Pointer.
"""
return new PageWrapper(page, parent, pointer, true);... | java | static PageWrapper wrapNew(BTreePage page, PageWrapper parent, PagePointer pointer) {
return new PageWrapper(page, parent, pointer, true);
} | [
"static",
"PageWrapper",
"wrapNew",
"(",
"BTreePage",
"page",
",",
"PageWrapper",
"parent",
",",
"PagePointer",
"pointer",
")",
"{",
"return",
"new",
"PageWrapper",
"(",
"page",
",",
"parent",
",",
"pointer",
",",
"true",
")",
";",
"}"
] | Creates a new instance of the PageWrapper class for a new Page.
@param page Page to wrap.
@param parent Page's Parent.
@param pointer Page Pointer. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"PageWrapper",
"class",
"for",
"a",
"new",
"Page",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/PageWrapper.java#L69-L71 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/ServletUtil.java | ServletUtil.getParameter | public static String getParameter(ServletRequest request, String name) {
"""
Get a parameter from a ServletRequest.
Return null if the parameter contains only white spaces.
"""
String s = request.getParameter(name);
if (s == null) {
return null;
}
s = s.trim();
return s.length() == 0... | java | public static String getParameter(ServletRequest request, String name) {
String s = request.getParameter(name);
if (s == null) {
return null;
}
s = s.trim();
return s.length() == 0? null: s;
} | [
"public",
"static",
"String",
"getParameter",
"(",
"ServletRequest",
"request",
",",
"String",
"name",
")",
"{",
"String",
"s",
"=",
"request",
".",
"getParameter",
"(",
"name",
")",
";",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"null",
";",
"... | Get a parameter from a ServletRequest.
Return null if the parameter contains only white spaces. | [
"Get",
"a",
"parameter",
"from",
"a",
"ServletRequest",
".",
"Return",
"null",
"if",
"the",
"parameter",
"contains",
"only",
"white",
"spaces",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/ServletUtil.java#L45-L52 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.requestFlushAtSource | public void requestFlushAtSource(SIBUuid8 source,
SIBUuid12 destID,
SIBUuid8 busID,
SIBUuid12 stream,
boolean indoubtDiscard)
throws SIException, SIResourceException {
"""... | java | public void requestFlushAtSource(SIBUuid8 source,
SIBUuid12 destID,
SIBUuid8 busID,
SIBUuid12 stream,
boolean indoubtDiscard)
throws SIException, SIResourceException
{
i... | [
"public",
"void",
"requestFlushAtSource",
"(",
"SIBUuid8",
"source",
",",
"SIBUuid12",
"destID",
",",
"SIBUuid8",
"busID",
",",
"SIBUuid12",
"stream",
",",
"boolean",
"indoubtDiscard",
")",
"throws",
"SIException",
",",
"SIResourceException",
"{",
"if",
"(",
"Trac... | Send a request to flush a stream. The originator of the stream,
and the ID for the stream must be known. This method is public
because it's not clear who's going to call this yet.
@param source The originator of the stream (may be multiple hops
away).
@param stream The UUID of the stream to flush. | [
"Send",
"a",
"request",
"to",
"flush",
"a",
"stream",
".",
"The",
"originator",
"of",
"the",
"stream",
"and",
"the",
"ID",
"for",
"the",
"stream",
"must",
"be",
"known",
".",
"This",
"method",
"is",
"public",
"because",
"it",
"s",
"not",
"clear",
"who"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L685-L728 |
google/closure-compiler | src/com/google/javascript/jscomp/PolymerPassSuppressBehaviors.java | PolymerPassSuppressBehaviors.suppressBehavior | private void suppressBehavior(Node behaviorValue, Node reportNode) {
"""
Strip property type annotations and add suppressions on functions.
"""
if (behaviorValue == null) {
compiler.report(JSError.make(reportNode, PolymerPassErrors.POLYMER_UNQUALIFIED_BEHAVIOR));
return;
}
if (behavior... | java | private void suppressBehavior(Node behaviorValue, Node reportNode) {
if (behaviorValue == null) {
compiler.report(JSError.make(reportNode, PolymerPassErrors.POLYMER_UNQUALIFIED_BEHAVIOR));
return;
}
if (behaviorValue.isArrayLit()) {
for (Node child : behaviorValue.children()) {
su... | [
"private",
"void",
"suppressBehavior",
"(",
"Node",
"behaviorValue",
",",
"Node",
"reportNode",
")",
"{",
"if",
"(",
"behaviorValue",
"==",
"null",
")",
"{",
"compiler",
".",
"report",
"(",
"JSError",
".",
"make",
"(",
"reportNode",
",",
"PolymerPassErrors",
... | Strip property type annotations and add suppressions on functions. | [
"Strip",
"property",
"type",
"annotations",
"and",
"add",
"suppressions",
"on",
"functions",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PolymerPassSuppressBehaviors.java#L58-L72 |
ysc/word | src/main/java/org/apdplat/word/segmentation/impl/AbstractSegmentation.java | AbstractSegmentation.addWord | protected void addWord(Stack<Word> result, String text, int start, int len) {
"""
将识别出的词入栈
@param result 栈
@param text 文本
@param start 词开始索引
@param len 词长度
"""
Word word = getWord(text, start, len);
if(word != null){
result.push(word);
}
} | java | protected void addWord(Stack<Word> result, String text, int start, int len){
Word word = getWord(text, start, len);
if(word != null){
result.push(word);
}
} | [
"protected",
"void",
"addWord",
"(",
"Stack",
"<",
"Word",
">",
"result",
",",
"String",
"text",
",",
"int",
"start",
",",
"int",
"len",
")",
"{",
"Word",
"word",
"=",
"getWord",
"(",
"text",
",",
"start",
",",
"len",
")",
";",
"if",
"(",
"word",
... | 将识别出的词入栈
@param result 栈
@param text 文本
@param start 词开始索引
@param len 词长度 | [
"将识别出的词入栈"
] | train | https://github.com/ysc/word/blob/5e45607f4e97207f55d1e3bc561abda6b34f7c54/src/main/java/org/apdplat/word/segmentation/impl/AbstractSegmentation.java#L213-L218 |
aws/aws-sdk-java | src/samples/AmazonKinesisFirehose/AbstractAmazonKinesisFirehoseDelivery.java | AbstractAmazonKinesisFirehoseDelivery.readResource | private static String readResource(String name) {
"""
Method to read the resource for the given filename.
@param name the file name
@return the input stream as string
"""
try {
return IOUtils.toString(AmazonKinesisFirehoseToRedshiftSample.class.getResourceAsStream(name));
} catc... | java | private static String readResource(String name) {
try {
return IOUtils.toString(AmazonKinesisFirehoseToRedshiftSample.class.getResourceAsStream(name));
} catch (IOException e) {
throw new RuntimeException("Failed to read document resource: " + name, e);
}
} | [
"private",
"static",
"String",
"readResource",
"(",
"String",
"name",
")",
"{",
"try",
"{",
"return",
"IOUtils",
".",
"toString",
"(",
"AmazonKinesisFirehoseToRedshiftSample",
".",
"class",
".",
"getResourceAsStream",
"(",
"name",
")",
")",
";",
"}",
"catch",
... | Method to read the resource for the given filename.
@param name the file name
@return the input stream as string | [
"Method",
"to",
"read",
"the",
"resource",
"for",
"the",
"given",
"filename",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/src/samples/AmazonKinesisFirehose/AbstractAmazonKinesisFirehoseDelivery.java#L462-L468 |
icode/ameba | src/main/java/ameba/feature/AmebaFeature.java | AmebaFeature.subscribeEvent | protected <E extends Event> Listener subscribeEvent(Class<E> eventClass, final Class<? extends Listener<E>> listenerClass) {
"""
<p>subscribeEvent.</p>
@param eventClass a {@link java.lang.Class} object.
@param listenerClass a {@link java.lang.Class} object.
@return a {@link ameba.event.Listener} object.
... | java | protected <E extends Event> Listener subscribeEvent(Class<E> eventClass, final Class<? extends Listener<E>> listenerClass) {
Listener<E> listener = locator.createAndInitialize(listenerClass);
subscribe(eventClass, listener);
return listener;
} | [
"protected",
"<",
"E",
"extends",
"Event",
">",
"Listener",
"subscribeEvent",
"(",
"Class",
"<",
"E",
">",
"eventClass",
",",
"final",
"Class",
"<",
"?",
"extends",
"Listener",
"<",
"E",
">",
">",
"listenerClass",
")",
"{",
"Listener",
"<",
"E",
">",
"... | <p>subscribeEvent.</p>
@param eventClass a {@link java.lang.Class} object.
@param listenerClass a {@link java.lang.Class} object.
@return a {@link ameba.event.Listener} object.
@since 0.1.6e
@param <E> a E object. | [
"<p",
">",
"subscribeEvent",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/feature/AmebaFeature.java#L102-L106 |
cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java | ParameterMetaData.Float | public static ParameterDef Float(final float f) {
"""
Float constructor.
@param f the float value for the parameter
@return Parameter definition for given float value
"""
final BigDecimal bd = new BigDecimal(Float.toString(f));
return Scaled(Types.FLOAT, bd.scale());
} | java | public static ParameterDef Float(final float f) {
final BigDecimal bd = new BigDecimal(Float.toString(f));
return Scaled(Types.FLOAT, bd.scale());
} | [
"public",
"static",
"ParameterDef",
"Float",
"(",
"final",
"float",
"f",
")",
"{",
"final",
"BigDecimal",
"bd",
"=",
"new",
"BigDecimal",
"(",
"Float",
".",
"toString",
"(",
"f",
")",
")",
";",
"return",
"Scaled",
"(",
"Types",
".",
"FLOAT",
",",
"bd",... | Float constructor.
@param f the float value for the parameter
@return Parameter definition for given float value | [
"Float",
"constructor",
"."
] | train | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/ParameterMetaData.java#L266-L270 |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/RestProxy.java | RestProxy.createHttpRequest | @SuppressWarnings("unchecked")
private HttpRequest createHttpRequest(OperationDescription operationDescription, SwaggerMethodParser methodParser, Object[] args) throws IOException {
"""
Create a HttpRequest for the provided Swagger method using the provided arguments.
@param methodParser the Swagger method ... | java | @SuppressWarnings("unchecked")
private HttpRequest createHttpRequest(OperationDescription operationDescription, SwaggerMethodParser methodParser, Object[] args) throws IOException {
final HttpRequest request = configRequest(new HttpRequest(methodParser.httpMethod(), operationDescription.url()), methodParser... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"HttpRequest",
"createHttpRequest",
"(",
"OperationDescription",
"operationDescription",
",",
"SwaggerMethodParser",
"methodParser",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"IOException",
"{",
"final... | Create a HttpRequest for the provided Swagger method using the provided arguments.
@param methodParser the Swagger method parser to use
@param args the arguments to use to populate the method's annotation values
@return a HttpRequest
@throws IOException thrown if the body contents cannot be serialized | [
"Create",
"a",
"HttpRequest",
"for",
"the",
"provided",
"Swagger",
"method",
"using",
"the",
"provided",
"arguments",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/RestProxy.java#L210-L220 |
Azure/azure-sdk-for-java | privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetsInner.java | RecordSetsInner.listByTypeWithServiceResponseAsync | public Observable<ServiceResponse<Page<RecordSetInner>>> listByTypeWithServiceResponseAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType) {
"""
Lists the record sets of a specified type in a Private DNS zone.
@param resourceGroupName The name of the resource group.
... | java | public Observable<ServiceResponse<Page<RecordSetInner>>> listByTypeWithServiceResponseAsync(final String resourceGroupName, final String privateZoneName, final RecordType recordType) {
return listByTypeSinglePageAsync(resourceGroupName, privateZoneName, recordType)
.concatMap(new Func1<ServiceRespon... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"RecordSetInner",
">",
">",
">",
"listByTypeWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"privateZoneName",
",",
"final",
"RecordType",
"recordType",
"... | Lists the record sets of a specified type in a Private DNS zone.
@param resourceGroupName The name of the resource group.
@param privateZoneName The name of the Private DNS zone (without a terminating dot).
@param recordType The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PT... | [
"Lists",
"the",
"record",
"sets",
"of",
"a",
"specified",
"type",
"in",
"a",
"Private",
"DNS",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/RecordSetsInner.java#L902-L914 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java | DiscordApiImpl.getOrCreateUser | public User getOrCreateUser(JsonNode data) {
"""
Gets a user or creates a new one from the given data.
@param data The json data of the user.
@return The user.
"""
long id = Long.parseLong(data.get("id").asText());
synchronized (users) {
return getCachedUserById(id).orElseGet(()... | java | public User getOrCreateUser(JsonNode data) {
long id = Long.parseLong(data.get("id").asText());
synchronized (users) {
return getCachedUserById(id).orElseGet(() -> {
if (!data.has("username")) {
throw new IllegalStateException("Couldn't get or created user... | [
"public",
"User",
"getOrCreateUser",
"(",
"JsonNode",
"data",
")",
"{",
"long",
"id",
"=",
"Long",
".",
"parseLong",
"(",
"data",
".",
"get",
"(",
"\"id\"",
")",
".",
"asText",
"(",
")",
")",
";",
"synchronized",
"(",
"users",
")",
"{",
"return",
"ge... | Gets a user or creates a new one from the given data.
@param data The json data of the user.
@return The user. | [
"Gets",
"a",
"user",
"or",
"creates",
"a",
"new",
"one",
"from",
"the",
"given",
"data",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java#L794-L804 |
cogroo/cogroo4 | cogroo-nlp/src/main/java/org/cogroo/tools/sentdetect/PortugueseSDContextGenerator.java | PortugueseSDContextGenerator.previousSpaceIndex | private static final int previousSpaceIndex(CharSequence sb, int seek) {
"""
Finds the index of the nearest space before a specified index which is not
itself preceded by a space.
@param sb
The string buffer which contains the text being examined.
@param seek
The index to begin searching from.
@return The ... | java | private static final int previousSpaceIndex(CharSequence sb, int seek) {
seek--;
while (seek > 0 && !StringUtil.isWhitespace(sb.charAt(seek))) {
seek--;
}
if (seek > 0 && StringUtil.isWhitespace(sb.charAt(seek))) {
while (seek > 0 && StringUtil.isWhitespace(sb.charAt(seek - 1)))
seek... | [
"private",
"static",
"final",
"int",
"previousSpaceIndex",
"(",
"CharSequence",
"sb",
",",
"int",
"seek",
")",
"{",
"seek",
"--",
";",
"while",
"(",
"seek",
">",
"0",
"&&",
"!",
"StringUtil",
".",
"isWhitespace",
"(",
"sb",
".",
"charAt",
"(",
"seek",
... | Finds the index of the nearest space before a specified index which is not
itself preceded by a space.
@param sb
The string buffer which contains the text being examined.
@param seek
The index to begin searching from.
@return The index which contains the nearest space. | [
"Finds",
"the",
"index",
"of",
"the",
"nearest",
"space",
"before",
"a",
"specified",
"index",
"which",
"is",
"not",
"itself",
"preceded",
"by",
"a",
"space",
"."
] | train | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-nlp/src/main/java/org/cogroo/tools/sentdetect/PortugueseSDContextGenerator.java#L257-L268 |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/values/IcalParseUtil.java | IcalParseUtil.parseDateValue | public static DateValue parseDateValue(String s, TimeZone tzid)
throws ParseException {
"""
parses a date of the form yyyymmdd or yyyymmdd'T'hhMMss converting from
the given timezone to UTC.
"""
Matcher m = DATE_VALUE.matcher(s);
if (!m.matches()) {
throw new ParseExcep... | java | public static DateValue parseDateValue(String s, TimeZone tzid)
throws ParseException {
Matcher m = DATE_VALUE.matcher(s);
if (!m.matches()) {
throw new ParseException(s, 0);
}
int year = Integer.parseInt(m.group(1)),
month = Integer.parseInt(m.gro... | [
"public",
"static",
"DateValue",
"parseDateValue",
"(",
"String",
"s",
",",
"TimeZone",
"tzid",
")",
"throws",
"ParseException",
"{",
"Matcher",
"m",
"=",
"DATE_VALUE",
".",
"matcher",
"(",
"s",
")",
";",
"if",
"(",
"!",
"m",
".",
"matches",
"(",
")",
... | parses a date of the form yyyymmdd or yyyymmdd'T'hhMMss converting from
the given timezone to UTC. | [
"parses",
"a",
"date",
"of",
"the",
"form",
"yyyymmdd",
"or",
"yyyymmdd",
"T",
"hhMMss",
"converting",
"from",
"the",
"given",
"timezone",
"to",
"UTC",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/values/IcalParseUtil.java#L51-L75 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java | FrameworkManager.handleEquinoxRuntimeException | private boolean handleEquinoxRuntimeException(RuntimeException ex) {
"""
Attempt to diagnose Equinox exceptions and issue a sane error message rather than a massive equinox stack
@param ex The RuntimeException thrown by Equinox
@return true if we understand the exception and issued an error message, false othe... | java | private boolean handleEquinoxRuntimeException(RuntimeException ex) {
Throwable cause = ex.getCause();
if (cause != null) {
if (cause instanceof IOException) {
// Check common causes for IOExceptions
File osgiDir = config.getWorkareaFile(OSGI_DIR_NAME);
... | [
"private",
"boolean",
"handleEquinoxRuntimeException",
"(",
"RuntimeException",
"ex",
")",
"{",
"Throwable",
"cause",
"=",
"ex",
".",
"getCause",
"(",
")",
";",
"if",
"(",
"cause",
"!=",
"null",
")",
"{",
"if",
"(",
"cause",
"instanceof",
"IOException",
")",... | Attempt to diagnose Equinox exceptions and issue a sane error message rather than a massive equinox stack
@param ex The RuntimeException thrown by Equinox
@return true if we understand the exception and issued an error message, false otherwise | [
"Attempt",
"to",
"diagnose",
"Equinox",
"exceptions",
"and",
"issue",
"a",
"sane",
"error",
"message",
"rather",
"than",
"a",
"massive",
"equinox",
"stack"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java#L586-L607 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java | ExceptionUtils.getStackFrames | @GwtIncompatible("incompatible method")
static String[] getStackFrames(final String stackTrace) {
"""
<p>Returns an array where each element is a line from the argument.</p>
<p>The end of line is determined by the value of {@link System#lineSeparator()}.</p>
@param stackTrace a stack trace String
@retu... | java | @GwtIncompatible("incompatible method")
static String[] getStackFrames(final String stackTrace) {
final String linebreak = System.lineSeparator();
final StringTokenizer frames = new StringTokenizer(stackTrace, linebreak);
final List<String> list = new ArrayList<>();
while (frames.has... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"static",
"String",
"[",
"]",
"getStackFrames",
"(",
"final",
"String",
"stackTrace",
")",
"{",
"final",
"String",
"linebreak",
"=",
"System",
".",
"lineSeparator",
"(",
")",
";",
"final",
"StringToken... | <p>Returns an array where each element is a line from the argument.</p>
<p>The end of line is determined by the value of {@link System#lineSeparator()}.</p>
@param stackTrace a stack trace String
@return an array where each element is a line from the argument | [
"<p",
">",
"Returns",
"an",
"array",
"where",
"each",
"element",
"is",
"a",
"line",
"from",
"the",
"argument",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java#L633-L642 |
drewwills/cernunnos | cernunnos-core/src/main/java/org/danann/cernunnos/runtime/ScriptRunner.java | ScriptRunner.compileTask | public Task compileTask(String location) {
"""
Prepares a <code>Task</code> for (subsequent) execution.
@param location Absolute or relative location of a Cernunnos script file.
"""
// Assertions.
if (location == null) {
String msg = "Argument 'location' cannot be null.";
... | java | public Task compileTask(String location) {
// Assertions.
if (location == null) {
String msg = "Argument 'location' cannot be null.";
throw new IllegalArgumentException(msg);
}
Document doc = null;
URL origin = null;
try {
origin = ne... | [
"public",
"Task",
"compileTask",
"(",
"String",
"location",
")",
"{",
"// Assertions.",
"if",
"(",
"location",
"==",
"null",
")",
"{",
"String",
"msg",
"=",
"\"Argument 'location' cannot be null.\"",
";",
"throw",
"new",
"IllegalArgumentException",
"(",
"msg",
")"... | Prepares a <code>Task</code> for (subsequent) execution.
@param location Absolute or relative location of a Cernunnos script file. | [
"Prepares",
"a",
"<code",
">",
"Task<",
"/",
"code",
">",
"for",
"(",
"subsequent",
")",
"execution",
"."
] | train | https://github.com/drewwills/cernunnos/blob/dc6848e0253775e22b6c869fd06506d4ddb6d728/cernunnos-core/src/main/java/org/danann/cernunnos/runtime/ScriptRunner.java#L91-L112 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/model/AbstractContentFactory.java | AbstractContentFactory.registerExtendedFactory | @Deprecated
protected final void registerExtendedFactory(String key, T factory) {
"""
Register a non-standard content factory.
@deprecated Define extensions in META-INF/services/net.fortuna.ical4j.model.[Type]Factory
"""
extendedFactories.put(key, factory);
} | java | @Deprecated
protected final void registerExtendedFactory(String key, T factory) {
extendedFactories.put(key, factory);
} | [
"@",
"Deprecated",
"protected",
"final",
"void",
"registerExtendedFactory",
"(",
"String",
"key",
",",
"T",
"factory",
")",
"{",
"extendedFactories",
".",
"put",
"(",
"key",
",",
"factory",
")",
";",
"}"
] | Register a non-standard content factory.
@deprecated Define extensions in META-INF/services/net.fortuna.ical4j.model.[Type]Factory | [
"Register",
"a",
"non",
"-",
"standard",
"content",
"factory",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/model/AbstractContentFactory.java#L69-L72 |
czyzby/gdx-lml | lml/src/main/java/com/github/czyzby/lml/parser/impl/tag/Dtd.java | Dtd.saveMinifiedSchema | public static void saveMinifiedSchema(final LmlParser parser, final Appendable appendable) {
"""
Saves DTD schema file containing all possible tags and their attributes. Any problems with the generation will
be logged. This is a relatively heavy operation and should be done only during development. Comments will ... | java | public static void saveMinifiedSchema(final LmlParser parser, final Appendable appendable) {
try {
new Dtd().setAppendComments(false).getDtdSchema(parser, appendable);
} catch (final IOException exception) {
throw new GdxRuntimeException("Unable to append to file.", exception);
... | [
"public",
"static",
"void",
"saveMinifiedSchema",
"(",
"final",
"LmlParser",
"parser",
",",
"final",
"Appendable",
"appendable",
")",
"{",
"try",
"{",
"new",
"Dtd",
"(",
")",
".",
"setAppendComments",
"(",
"false",
")",
".",
"getDtdSchema",
"(",
"parser",
",... | Saves DTD schema file containing all possible tags and their attributes. Any problems with the generation will
be logged. This is a relatively heavy operation and should be done only during development. Comments will not be
appended, which will reduce the size of DTD file.
@param parser contains parsing data. Used to ... | [
"Saves",
"DTD",
"schema",
"file",
"containing",
"all",
"possible",
"tags",
"and",
"their",
"attributes",
".",
"Any",
"problems",
"with",
"the",
"generation",
"will",
"be",
"logged",
".",
"This",
"is",
"a",
"relatively",
"heavy",
"operation",
"and",
"should",
... | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/lml/src/main/java/com/github/czyzby/lml/parser/impl/tag/Dtd.java#L71-L77 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java | AppsImpl.updateSettingsAsync | public Observable<OperationStatus> updateSettingsAsync(UUID appId, UpdateSettingsOptionalParameter updateSettingsOptionalParameter) {
"""
Updates the application settings.
@param appId The application ID.
@param updateSettingsOptionalParameter the object representing the optional parameters to be set before ca... | java | public Observable<OperationStatus> updateSettingsAsync(UUID appId, UpdateSettingsOptionalParameter updateSettingsOptionalParameter) {
return updateSettingsWithServiceResponseAsync(appId, updateSettingsOptionalParameter).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"updateSettingsAsync",
"(",
"UUID",
"appId",
",",
"UpdateSettingsOptionalParameter",
"updateSettingsOptionalParameter",
")",
"{",
"return",
"updateSettingsWithServiceResponseAsync",
"(",
"appId",
",",
"updateSettingsOptionalP... | Updates the application settings.
@param appId The application ID.
@param updateSettingsOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Updates",
"the",
"application",
"settings",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java#L1335-L1342 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/concurrent/ConcurrentUtils.java | ConcurrentUtils.createIfAbsent | public static <K, V> V createIfAbsent(final ConcurrentMap<K, V> map, final K key,
final ConcurrentInitializer<V> init) throws ConcurrentException {
"""
Checks if a concurrent map contains a key and creates a corresponding
value if not. This method first checks the presence of the key in the
given map... | java | public static <K, V> V createIfAbsent(final ConcurrentMap<K, V> map, final K key,
final ConcurrentInitializer<V> init) throws ConcurrentException {
if (map == null || init == null) {
return null;
}
final V value = map.get(key);
if (value == null) {
re... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"createIfAbsent",
"(",
"final",
"ConcurrentMap",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"K",
"key",
",",
"final",
"ConcurrentInitializer",
"<",
"V",
">",
"init",
")",
"throws",
"ConcurrentException... | Checks if a concurrent map contains a key and creates a corresponding
value if not. This method first checks the presence of the key in the
given map. If it is already contained, its value is returned. Otherwise
the {@code get()} method of the passed in {@link ConcurrentInitializer}
is called. With the resulting object... | [
"Checks",
"if",
"a",
"concurrent",
"map",
"contains",
"a",
"key",
"and",
"creates",
"a",
"corresponding",
"value",
"if",
"not",
".",
"This",
"method",
"first",
"checks",
"the",
"presence",
"of",
"the",
"key",
"in",
"the",
"given",
"map",
".",
"If",
"it",... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/concurrent/ConcurrentUtils.java#L274-L285 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/FilterByteBuffer.java | FilterByteBuffer.putString | public FilterByteBuffer putString(String str, Charset charset) throws IOException {
"""
Puts string as null terminated byte array
@param str
@param charset
@return
@throws IOException
"""
byte[] bytes = str.getBytes(charset);
put(bytes).put((byte)0);
return this;
} | java | public FilterByteBuffer putString(String str, Charset charset) throws IOException
{
byte[] bytes = str.getBytes(charset);
put(bytes).put((byte)0);
return this;
} | [
"public",
"FilterByteBuffer",
"putString",
"(",
"String",
"str",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"str",
".",
"getBytes",
"(",
"charset",
")",
";",
"put",
"(",
"bytes",
")",
".",
"put",
"(",
... | Puts string as null terminated byte array
@param str
@param charset
@return
@throws IOException | [
"Puts",
"string",
"as",
"null",
"terminated",
"byte",
"array"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/FilterByteBuffer.java#L190-L195 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpRequestFactory.java | HttpRequestFactory.buildGetRequest | public HttpRequest buildGetRequest(GenericUrl url) throws IOException {
"""
Builds a {@code GET} request for the given URL.
@param url HTTP request URL or {@code null} for none
@return new HTTP request
"""
return buildRequest(HttpMethods.GET, url, null);
} | java | public HttpRequest buildGetRequest(GenericUrl url) throws IOException {
return buildRequest(HttpMethods.GET, url, null);
} | [
"public",
"HttpRequest",
"buildGetRequest",
"(",
"GenericUrl",
"url",
")",
"throws",
"IOException",
"{",
"return",
"buildRequest",
"(",
"HttpMethods",
".",
"GET",
",",
"url",
",",
"null",
")",
";",
"}"
] | Builds a {@code GET} request for the given URL.
@param url HTTP request URL or {@code null} for none
@return new HTTP request | [
"Builds",
"a",
"{",
"@code",
"GET",
"}",
"request",
"for",
"the",
"given",
"URL",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpRequestFactory.java#L116-L118 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.upgrade_privateCloud_serviceName_planCode_GET | public OvhOrderUpgradeOperationAndOrder upgrade_privateCloud_serviceName_planCode_GET(String serviceName, String planCode, Long quantity) throws IOException {
"""
Get a provisional order for the selected upgrade of your service
REST: GET /order/upgrade/privateCloud/{serviceName}/{planCode}
@param planCode [req... | java | public OvhOrderUpgradeOperationAndOrder upgrade_privateCloud_serviceName_planCode_GET(String serviceName, String planCode, Long quantity) throws IOException {
String qPath = "/order/upgrade/privateCloud/{serviceName}/{planCode}";
StringBuilder sb = path(qPath, serviceName, planCode);
query(sb, "quantity", quantit... | [
"public",
"OvhOrderUpgradeOperationAndOrder",
"upgrade_privateCloud_serviceName_planCode_GET",
"(",
"String",
"serviceName",
",",
"String",
"planCode",
",",
"Long",
"quantity",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/upgrade/privateCloud/{serviceNam... | Get a provisional order for the selected upgrade of your service
REST: GET /order/upgrade/privateCloud/{serviceName}/{planCode}
@param planCode [required] Plan code of the offer you want to upgrade to
@param quantity [required] Quantity you want to upgrade to
@param serviceName [required] The private cloud service nam... | [
"Get",
"a",
"provisional",
"order",
"for",
"the",
"selected",
"upgrade",
"of",
"your",
"service"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L4368-L4374 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/RestClient.java | RestClient.updateState | @Override
public void updateState(final String assetId, final StateAction action) throws IOException, RequestFailureException {
"""
This method will update the state of an object by taking the supplied
action.
@param assetId
The ID of the asset to update
@param action
The action to take to modify the st... | java | @Override
public void updateState(final String assetId, final StateAction action) throws IOException, RequestFailureException {
StateUpdateAction newState = new StateUpdateAction(action);
HttpURLConnection connection = createHttpURLConnectionToMassive("/assets/"
... | [
"@",
"Override",
"public",
"void",
"updateState",
"(",
"final",
"String",
"assetId",
",",
"final",
"StateAction",
"action",
")",
"throws",
"IOException",
",",
"RequestFailureException",
"{",
"StateUpdateAction",
"newState",
"=",
"new",
"StateUpdateAction",
"(",
"act... | This method will update the state of an object by taking the supplied
action.
@param assetId
The ID of the asset to update
@param action
The action to take to modify the state
@return <code>true</code> if the update was successful (currently always
returns <code>true</code> from Massive)
@throws IOException
@throws Re... | [
"This",
"method",
"will",
"update",
"the",
"state",
"of",
"an",
"object",
"by",
"taking",
"the",
"supplied",
"action",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/RestClient.java#L609-L621 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java | ConfigurationFile.findMainFileFromSnapshotPrefix | private String findMainFileFromSnapshotPrefix(final String prefix) {
"""
Finds a single file in the snapshots directory whose name starts with {@code prefix} and
returns its name with the prefix removed.
@param prefix the prefix
@return the single file that meets the criterion {@code null} if none do
@throws... | java | private String findMainFileFromSnapshotPrefix(final String prefix) {
File[] files = null;
if (snapshotsDirectory.exists() && snapshotsDirectory.isDirectory()) {
files = snapshotsDirectory.listFiles(new FilenameFilter() {
@Override
public boolean accept(File d... | [
"private",
"String",
"findMainFileFromSnapshotPrefix",
"(",
"final",
"String",
"prefix",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"null",
";",
"if",
"(",
"snapshotsDirectory",
".",
"exists",
"(",
")",
"&&",
"snapshotsDirectory",
".",
"isDirectory",
"(",
")",
... | Finds a single file in the snapshots directory whose name starts with {@code prefix} and
returns its name with the prefix removed.
@param prefix the prefix
@return the single file that meets the criterion {@code null} if none do
@throws IllegalStateException if more than one file meets the criteria | [
"Finds",
"a",
"single",
"file",
"in",
"the",
"snapshots",
"directory",
"whose",
"name",
"starts",
"with",
"{",
"@code",
"prefix",
"}",
"and",
"returns",
"its",
"name",
"with",
"the",
"prefix",
"removed",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java#L390-L411 |
kstateome/canvas-api | src/main/java/edu/ksu/canvas/model/BaseCanvasModel.java | BaseCanvasModel.toPostMap | public Map<String, List<String>> toPostMap(boolean includeNulls) {
"""
/* Canvas has post parameter keys in non consistent formats. Occasionally they are 'class[field]' and other times
they are just 'field'. This method will create a map with the correct post keys and values based on the
@CanvasField and @Canvas... | java | public Map<String, List<String>> toPostMap(boolean includeNulls) {
Class<? extends BaseCanvasModel> clazz = this.getClass();
Map<String, List<String>> postMap = new HashMap<>();
for (Method method : clazz.getMethods()) {
CanvasField canvasFieldAnnotation = method.getAnnotation(Canvas... | [
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"toPostMap",
"(",
"boolean",
"includeNulls",
")",
"{",
"Class",
"<",
"?",
"extends",
"BaseCanvasModel",
">",
"clazz",
"=",
"this",
".",
"getClass",
"(",
")",
";",
"Map",
"<",
"String... | /* Canvas has post parameter keys in non consistent formats. Occasionally they are 'class[field]' and other times
they are just 'field'. This method will create a map with the correct post keys and values based on the
@CanvasField and @CanvasObject annotations. | [
"/",
"*",
"Canvas",
"has",
"post",
"parameter",
"keys",
"in",
"non",
"consistent",
"formats",
".",
"Occasionally",
"they",
"are",
"class",
"[",
"field",
"]",
"and",
"other",
"times",
"they",
"are",
"just",
"field",
".",
"This",
"method",
"will",
"create",
... | train | https://github.com/kstateome/canvas-api/blob/426bf403a8fd7aca3f170348005feda25b374e5a/src/main/java/edu/ksu/canvas/model/BaseCanvasModel.java#L26-L50 |
ironjacamar/ironjacamar | sjc/src/main/java/org/ironjacamar/sjc/maven/AbstractHostPortMojo.java | AbstractHostPortMojo.executeCommand | protected Serializable executeCommand(String command, Serializable[] arguments) throws Throwable {
"""
Execute command
@param command The command
@param arguments The arguments
@return The result
@exception Throwable If an error occurs
"""
Socket socket = null;
try
{
socket = new... | java | protected Serializable executeCommand(String command, Serializable[] arguments) throws Throwable
{
Socket socket = null;
try
{
socket = new Socket(host, port);
ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
oos.writeUTF(command);
... | [
"protected",
"Serializable",
"executeCommand",
"(",
"String",
"command",
",",
"Serializable",
"[",
"]",
"arguments",
")",
"throws",
"Throwable",
"{",
"Socket",
"socket",
"=",
"null",
";",
"try",
"{",
"socket",
"=",
"new",
"Socket",
"(",
"host",
",",
"port",
... | Execute command
@param command The command
@param arguments The arguments
@return The result
@exception Throwable If an error occurs | [
"Execute",
"command"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/sjc/src/main/java/org/ironjacamar/sjc/maven/AbstractHostPortMojo.java#L166-L214 |
google/closure-compiler | src/com/google/javascript/jscomp/regex/RegExpTree.java | RegExpTree.matchesWholeInput | public static boolean matchesWholeInput(RegExpTree t, String flags) {
"""
True if, but not necessarily always when the, given regular expression
must match the whole input or none of it.
"""
if (flags.indexOf('m') >= 0) { return false; }
if (!(t instanceof Concatenation)) {
return false;
}
... | java | public static boolean matchesWholeInput(RegExpTree t, String flags) {
if (flags.indexOf('m') >= 0) { return false; }
if (!(t instanceof Concatenation)) {
return false;
}
Concatenation c = (Concatenation) t;
if (c.elements.isEmpty()) { return false; }
RegExpTree first = c.elements.get(0),... | [
"public",
"static",
"boolean",
"matchesWholeInput",
"(",
"RegExpTree",
"t",
",",
"String",
"flags",
")",
"{",
"if",
"(",
"flags",
".",
"indexOf",
"(",
"'",
"'",
")",
">=",
"0",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"(",
"t",
"insta... | True if, but not necessarily always when the, given regular expression
must match the whole input or none of it. | [
"True",
"if",
"but",
"not",
"necessarily",
"always",
"when",
"the",
"given",
"regular",
"expression",
"must",
"match",
"the",
"whole",
"input",
"or",
"none",
"of",
"it",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/regex/RegExpTree.java#L759-L771 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/util/AstUtil.java | AstUtil.isConstant | public static boolean isConstant(Expression expression, Object expected) {
"""
Tells you if an expression is the expected constant.
@param expression
any expression
@param expected
the expected int or String
@return
as described
"""
return expression instanceof ConstantExpression && expected.equ... | java | public static boolean isConstant(Expression expression, Object expected) {
return expression instanceof ConstantExpression && expected.equals(((ConstantExpression) expression).getValue());
} | [
"public",
"static",
"boolean",
"isConstant",
"(",
"Expression",
"expression",
",",
"Object",
"expected",
")",
"{",
"return",
"expression",
"instanceof",
"ConstantExpression",
"&&",
"expected",
".",
"equals",
"(",
"(",
"(",
"ConstantExpression",
")",
"expression",
... | Tells you if an expression is the expected constant.
@param expression
any expression
@param expected
the expected int or String
@return
as described | [
"Tells",
"you",
"if",
"an",
"expression",
"is",
"the",
"expected",
"constant",
"."
] | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/util/AstUtil.java#L156-L158 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/matchers/structure/node/BaseNodeMatcher.java | BaseNodeMatcher.parseFormula | protected ArrayList<ArrayList<String>> parseFormula(HashMap<IAtomicConceptOfLabel, String> hashConceptNumber,
Map<String, IAtomicConceptOfLabel> acolsMap, INode node) {
"""
Parses a c@node formula replacing references to acols with references to the DIMACS v... | java | protected ArrayList<ArrayList<String>> parseFormula(HashMap<IAtomicConceptOfLabel, String> hashConceptNumber,
Map<String, IAtomicConceptOfLabel> acolsMap, INode node) {
ArrayList<ArrayList<String>> representation = new ArrayList<ArrayList<String>>();
... | [
"protected",
"ArrayList",
"<",
"ArrayList",
"<",
"String",
">",
">",
"parseFormula",
"(",
"HashMap",
"<",
"IAtomicConceptOfLabel",
",",
"String",
">",
"hashConceptNumber",
",",
"Map",
"<",
"String",
",",
"IAtomicConceptOfLabel",
">",
"acolsMap",
",",
"INode",
"n... | Parses a c@node formula replacing references to acols with references to the DIMACS variables. Uses and depends
on CNF representation which is "conjunction of disjunctions", that is the first level list represents
conjunction of second-level lists representing disjunction clauses.
@param hashConceptNumber HashMap aco... | [
"Parses",
"a",
"c@node",
"formula",
"replacing",
"references",
"to",
"acols",
"with",
"references",
"to",
"the",
"DIMACS",
"variables",
".",
"Uses",
"and",
"depends",
"on",
"CNF",
"representation",
"which",
"is",
"conjunction",
"of",
"disjunctions",
"that",
"is"... | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/matchers/structure/node/BaseNodeMatcher.java#L172-L200 |
gallandarakhneorg/afc | advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableGraphicsContext.java | ZoomableGraphicsContext.strokeLine | public void strokeLine(double x1, double y1, double x2, double y2) {
"""
Strokes a line using the current stroke paint.
<p>This method will be affected by any of the
global common or stroke attributes as specified in the
Rendering Attributes Table of {@link GraphicsContext}.
@param x1 the X coordinate of t... | java | public void strokeLine(double x1, double y1, double x2, double y2) {
this.gc.strokeLine(
doc2fxX(x1), doc2fxY(y1),
doc2fxX(x2), doc2fxY(y2));
} | [
"public",
"void",
"strokeLine",
"(",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x2",
",",
"double",
"y2",
")",
"{",
"this",
".",
"gc",
".",
"strokeLine",
"(",
"doc2fxX",
"(",
"x1",
")",
",",
"doc2fxY",
"(",
"y1",
")",
",",
"doc2fxX",
"(",... | Strokes a line using the current stroke paint.
<p>This method will be affected by any of the
global common or stroke attributes as specified in the
Rendering Attributes Table of {@link GraphicsContext}.
@param x1 the X coordinate of the starting point of the line.
@param y1 the Y coordinate of the starting point of t... | [
"Strokes",
"a",
"line",
"using",
"the",
"current",
"stroke",
"paint",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableGraphicsContext.java#L1641-L1645 |
geomajas/geomajas-project-client-gwt | plugin/widget-layer/layer-gwt/src/main/java/org/geomajas/widget/layer/client/widget/CombinedLayertree.java | CombinedLayertree.processNode | protected void processNode(final ClientAbstractNodeInfo treeNode, final TreeNode nodeRoot, final boolean refresh) {
"""
Processes a treeNode (add it to the TreeGrid).
@param treeNode
The treeNode to process
@param nodeRoot
The root node to which the treeNode has to be added
@param refresh
True if the tree ... | java | protected void processNode(final ClientAbstractNodeInfo treeNode, final TreeNode nodeRoot, final boolean refresh) {
// Branches
if (null != treeNode && treeNode instanceof ClientBranchNodeInfo) {
String treeNodeLabel = ((ClientBranchNodeInfo) treeNode).getLabel();
final TreeNode node = new TreeNode(treeNodeLa... | [
"protected",
"void",
"processNode",
"(",
"final",
"ClientAbstractNodeInfo",
"treeNode",
",",
"final",
"TreeNode",
"nodeRoot",
",",
"final",
"boolean",
"refresh",
")",
"{",
"// Branches",
"if",
"(",
"null",
"!=",
"treeNode",
"&&",
"treeNode",
"instanceof",
"ClientB... | Processes a treeNode (add it to the TreeGrid).
@param treeNode
The treeNode to process
@param nodeRoot
The root node to which the treeNode has to be added
@param refresh
True if the tree is refreshed (causing it to keep its expanded state) | [
"Processes",
"a",
"treeNode",
"(",
"add",
"it",
"to",
"the",
"TreeGrid",
")",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-layer/layer-gwt/src/main/java/org/geomajas/widget/layer/client/widget/CombinedLayertree.java#L115-L140 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/service/TaskServiceImpl.java | TaskServiceImpl.getPendingTaskForWorkflow | @Service
public Task getPendingTaskForWorkflow(String workflowId, String taskReferenceName) {
"""
Get in progress task for a given workflow id.
@param workflowId Id of the workflow
@param taskReferenceName Task reference name.
@return instance of {@link Task}
"""
return executionService... | java | @Service
public Task getPendingTaskForWorkflow(String workflowId, String taskReferenceName) {
return executionService.getPendingTaskForWorkflow(taskReferenceName, workflowId);
} | [
"@",
"Service",
"public",
"Task",
"getPendingTaskForWorkflow",
"(",
"String",
"workflowId",
",",
"String",
"taskReferenceName",
")",
"{",
"return",
"executionService",
".",
"getPendingTaskForWorkflow",
"(",
"taskReferenceName",
",",
"workflowId",
")",
";",
"}"
] | Get in progress task for a given workflow id.
@param workflowId Id of the workflow
@param taskReferenceName Task reference name.
@return instance of {@link Task} | [
"Get",
"in",
"progress",
"task",
"for",
"a",
"given",
"workflow",
"id",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/service/TaskServiceImpl.java#L121-L124 |
btrplace/scheduler | api/src/main/java/org/btrplace/model/view/network/StaticRouting.java | StaticRouting.setStaticRoute | public void setStaticRoute(NodesMap nm, Map<Link, Boolean> links) {
"""
Manually add a static route between two nodes.
@param nm a node mapping containing two nodes: the source and the destination node.
@param links an insert-ordered map of link<->direction representing the path between the two nodes.
"... | java | public void setStaticRoute(NodesMap nm, Map<Link, Boolean> links) {
routes.put(nm, links); // Only one route between two nodes (replace the old route)
} | [
"public",
"void",
"setStaticRoute",
"(",
"NodesMap",
"nm",
",",
"Map",
"<",
"Link",
",",
"Boolean",
">",
"links",
")",
"{",
"routes",
".",
"put",
"(",
"nm",
",",
"links",
")",
";",
"// Only one route between two nodes (replace the old route)",
"}"
] | Manually add a static route between two nodes.
@param nm a node mapping containing two nodes: the source and the destination node.
@param links an insert-ordered map of link<->direction representing the path between the two nodes. | [
"Manually",
"add",
"a",
"static",
"route",
"between",
"two",
"nodes",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/network/StaticRouting.java#L78-L80 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java | SARLFormatter._format | protected void _format(SarlCapacity capacity, IFormattableDocument document) {
"""
Format the given SARL capacity.
@param capacity the SARL component.
@param document the document.
"""
formatAnnotations(capacity, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations);
formatModifiers(capa... | java | protected void _format(SarlCapacity capacity, IFormattableDocument document) {
formatAnnotations(capacity, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations);
formatModifiers(capacity, document);
final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(capacity);
document... | [
"protected",
"void",
"_format",
"(",
"SarlCapacity",
"capacity",
",",
"IFormattableDocument",
"document",
")",
"{",
"formatAnnotations",
"(",
"capacity",
",",
"document",
",",
"XbaseFormatterPreferenceKeys",
".",
"newLineAfterClassAnnotations",
")",
";",
"formatModifiers"... | Format the given SARL capacity.
@param capacity the SARL component.
@param document the document. | [
"Format",
"the",
"given",
"SARL",
"capacity",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L213-L225 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/CertificatesInner.java | CertificatesInner.createOrUpdate | public CertificateInner createOrUpdate(String resourceGroupName, String automationAccountName, String certificateName, CertificateCreateOrUpdateParameters parameters) {
"""
Create a certificate.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation ac... | java | public CertificateInner createOrUpdate(String resourceGroupName, String automationAccountName, String certificateName, CertificateCreateOrUpdateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, certificateName, parameters).toBlocking().single().body... | [
"public",
"CertificateInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"certificateName",
",",
"CertificateCreateOrUpdateParameters",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
... | Create a certificate.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param certificateName The parameters supplied to the create or update certificate operation.
@param parameters The parameters supplied to the create or update certificate op... | [
"Create",
"a",
"certificate",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/CertificatesInner.java#L286-L288 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/types/Version.java | Version.getField | public int getField(int index, int defaultValue) {
"""
Retrieves the given field from this Version
@param index
int The index to retrieve (based at 0)
@param defaultValue
int The default value to return if the index doesn't exist
@return int The value of the version segment
"""
if (index >= 0 && ind... | java | public int getField(int index, int defaultValue)
{
if (index >= 0 && index < this.version.length)
{
return version[index];
}
else
{
return defaultValue;
}
} | [
"public",
"int",
"getField",
"(",
"int",
"index",
",",
"int",
"defaultValue",
")",
"{",
"if",
"(",
"index",
">=",
"0",
"&&",
"index",
"<",
"this",
".",
"version",
".",
"length",
")",
"{",
"return",
"version",
"[",
"index",
"]",
";",
"}",
"else",
"{... | Retrieves the given field from this Version
@param index
int The index to retrieve (based at 0)
@param defaultValue
int The default value to return if the index doesn't exist
@return int The value of the version segment | [
"Retrieves",
"the",
"given",
"field",
"from",
"this",
"Version"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/Version.java#L141-L151 |
tomgibara/bits | src/main/java/com/tomgibara/bits/Bits.java | Bits.asStore | public static BitStore asStore(boolean[] bits) {
"""
Exposes an array of booleans as a {@link BitStore}. The returned bit
store is a live view over the booleans; changes made to the array are
reflected in bit store and vice versa. The size of the returned bit
vector equals the length of the array with the bits ... | java | public static BitStore asStore(boolean[] bits) {
if (bits == null) throw new IllegalArgumentException("null bits");
return new BooleansBitStore(bits, 0, bits.length, true);
} | [
"public",
"static",
"BitStore",
"asStore",
"(",
"boolean",
"[",
"]",
"bits",
")",
"{",
"if",
"(",
"bits",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null bits\"",
")",
";",
"return",
"new",
"BooleansBitStore",
"(",
"bits",
",",
... | Exposes an array of booleans as a {@link BitStore}. The returned bit
store is a live view over the booleans; changes made to the array are
reflected in bit store and vice versa. The size of the returned bit
vector equals the length of the array with the bits of the
{@link BitStore} indexed as per the underlying array.
... | [
"Exposes",
"an",
"array",
"of",
"booleans",
"as",
"a",
"{",
"@link",
"BitStore",
"}",
".",
"The",
"returned",
"bit",
"store",
"is",
"a",
"live",
"view",
"over",
"the",
"booleans",
";",
"changes",
"made",
"to",
"the",
"array",
"are",
"reflected",
"in",
... | train | https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/Bits.java#L558-L561 |
zxing/zxing | core/src/main/java/com/google/zxing/aztec/detector/Detector.java | Detector.getFirstDifferent | private Point getFirstDifferent(Point init, boolean color, int dx, int dy) {
"""
Gets the coordinate of the first point with a different color in the given direction
"""
int x = init.getX() + dx;
int y = init.getY() + dy;
while (isValid(x, y) && image.get(x, y) == color) {
x += dx;
y +... | java | private Point getFirstDifferent(Point init, boolean color, int dx, int dy) {
int x = init.getX() + dx;
int y = init.getY() + dy;
while (isValid(x, y) && image.get(x, y) == color) {
x += dx;
y += dy;
}
x -= dx;
y -= dy;
while (isValid(x, y) && image.get(x, y) == color) {
... | [
"private",
"Point",
"getFirstDifferent",
"(",
"Point",
"init",
",",
"boolean",
"color",
",",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"int",
"x",
"=",
"init",
".",
"getX",
"(",
")",
"+",
"dx",
";",
"int",
"y",
"=",
"init",
".",
"getY",
"(",
")",
... | Gets the coordinate of the first point with a different color in the given direction | [
"Gets",
"the",
"coordinate",
"of",
"the",
"first",
"point",
"with",
"a",
"different",
"color",
"in",
"the",
"given",
"direction"
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/aztec/detector/Detector.java#L494-L517 |
glyptodon/guacamole-client | guacamole-ext/src/main/java/org/apache/guacamole/net/auth/credentials/UserCredentials.java | UserCredentials.setValue | public String setValue(Field field, String value) {
"""
Sets the value of the given field. Any existing value for that field is
replaced.
@param field
The field whose value should be assigned.
@param value
The value to assign to the given field.
@return
The previous value of the field, or null if the ... | java | public String setValue(Field field, String value) {
return setValue(field.getName(), value);
} | [
"public",
"String",
"setValue",
"(",
"Field",
"field",
",",
"String",
"value",
")",
"{",
"return",
"setValue",
"(",
"field",
".",
"getName",
"(",
")",
",",
"value",
")",
";",
"}"
] | Sets the value of the given field. Any existing value for that field is
replaced.
@param field
The field whose value should be assigned.
@param value
The value to assign to the given field.
@return
The previous value of the field, or null if the value of the field
was not previously defined. | [
"Sets",
"the",
"value",
"of",
"the",
"given",
"field",
".",
"Any",
"existing",
"value",
"for",
"that",
"field",
"is",
"replaced",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/credentials/UserCredentials.java#L182-L184 |
crnk-project/crnk-framework | crnk-gen/crnk-gen-typescript/src/main/java/io/crnk/gen/typescript/internal/TypescriptUtils.java | TypescriptUtils.getNestedInterface | public static TSInterfaceType getNestedInterface(TSType type, String name, boolean create) {
"""
Creates a nested interface for the given type (using a module with the same name as the type).
"""
TSModule module = getNestedTypeContainer(type, create);
if (module == null && !create) {
return null;
} el... | java | public static TSInterfaceType getNestedInterface(TSType type, String name, boolean create) {
TSModule module = getNestedTypeContainer(type, create);
if (module == null && !create) {
return null;
} else if (module == null) {
throw new IllegalStateException("cannot setup interface as no parent container is av... | [
"public",
"static",
"TSInterfaceType",
"getNestedInterface",
"(",
"TSType",
"type",
",",
"String",
"name",
",",
"boolean",
"create",
")",
"{",
"TSModule",
"module",
"=",
"getNestedTypeContainer",
"(",
"type",
",",
"create",
")",
";",
"if",
"(",
"module",
"==",... | Creates a nested interface for the given type (using a module with the same name as the type). | [
"Creates",
"a",
"nested",
"interface",
"for",
"the",
"given",
"type",
"(",
"using",
"a",
"module",
"with",
"the",
"same",
"name",
"as",
"the",
"type",
")",
"."
] | train | https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-gen/crnk-gen-typescript/src/main/java/io/crnk/gen/typescript/internal/TypescriptUtils.java#L62-L85 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.getInheritedContainerState | public CmsInheritedContainerState getInheritedContainerState(CmsObject cms, CmsResource resource, String name) {
"""
Returns the inheritance state for the given inheritance name and resource.<p>
@param cms the current cms context
@param resource the resource
@param name the inheritance name
@return the inh... | java | public CmsInheritedContainerState getInheritedContainerState(CmsObject cms, CmsResource resource, String name) {
String rootPath = resource.getRootPath();
if (!resource.isFolder()) {
rootPath = CmsResource.getParentFolder(rootPath);
}
CmsInheritedContainerState result = new ... | [
"public",
"CmsInheritedContainerState",
"getInheritedContainerState",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"String",
"name",
")",
"{",
"String",
"rootPath",
"=",
"resource",
".",
"getRootPath",
"(",
")",
";",
"if",
"(",
"!",
"resource",
... | Returns the inheritance state for the given inheritance name and resource.<p>
@param cms the current cms context
@param resource the resource
@param name the inheritance name
@return the inheritance state | [
"Returns",
"the",
"inheritance",
"state",
"for",
"the",
"given",
"inheritance",
"name",
"and",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L661-L675 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/TypeScriptCompilerMojo.java | TypeScriptCompilerMojo.fileCreated | @Override
public boolean fileCreated(File file) throws WatchingException {
"""
A file is created - process it.
@param file the file
@return {@literal true} as the pipeline should continue
@throws WatchingException if the processing failed
"""
if (WatcherUtils.isInDirectory(file, internalSource... | java | @Override
public boolean fileCreated(File file) throws WatchingException {
if (WatcherUtils.isInDirectory(file, internalSources)) {
processDirectory(internalSources, destinationForInternals);
} else if (WatcherUtils.isInDirectory(file, externalSources)) {
processDirectory(ext... | [
"@",
"Override",
"public",
"boolean",
"fileCreated",
"(",
"File",
"file",
")",
"throws",
"WatchingException",
"{",
"if",
"(",
"WatcherUtils",
".",
"isInDirectory",
"(",
"file",
",",
"internalSources",
")",
")",
"{",
"processDirectory",
"(",
"internalSources",
",... | A file is created - process it.
@param file the file
@return {@literal true} as the pipeline should continue
@throws WatchingException if the processing failed | [
"A",
"file",
"is",
"created",
"-",
"process",
"it",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/TypeScriptCompilerMojo.java#L150-L158 |
grails/grails-core | grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java | UrlMappingUtils.resolveView | public static View resolveView(HttpServletRequest request, UrlMappingInfo info, String viewName, ViewResolver viewResolver) throws Exception {
"""
Resolves a view for the given view and UrlMappingInfo instance
@param request The request
@param info The info
@param viewName The view name
@param viewResolver T... | java | public static View resolveView(HttpServletRequest request, UrlMappingInfo info, String viewName, ViewResolver viewResolver) throws Exception {
String controllerName = info.getControllerName();
return WebUtils.resolveView(request, viewName, controllerName, viewResolver);
} | [
"public",
"static",
"View",
"resolveView",
"(",
"HttpServletRequest",
"request",
",",
"UrlMappingInfo",
"info",
",",
"String",
"viewName",
",",
"ViewResolver",
"viewResolver",
")",
"throws",
"Exception",
"{",
"String",
"controllerName",
"=",
"info",
".",
"getControl... | Resolves a view for the given view and UrlMappingInfo instance
@param request The request
@param info The info
@param viewName The view name
@param viewResolver The view resolver
@return The view or null
@throws Exception | [
"Resolves",
"a",
"view",
"for",
"the",
"given",
"view",
"and",
"UrlMappingInfo",
"instance"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/UrlMappingUtils.java#L104-L107 |
kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java | Asn1Utils.encodeBitString | public static int encodeBitString(BitSet value, int nbits, ByteBuffer buf) {
"""
Encode an ASN.1 BIT STRING.
@param value
the value to be encoded
@param nbits
the number of bits in the bit string
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the l... | java | public static int encodeBitString(BitSet value, int nbits, ByteBuffer buf) {
if (value == null || nbits < value.length()) {
throw new IllegalArgumentException();
}
int pos = buf.position();
int contentLength = (int) Math.ceil(nbits / 8.0d);
for (int i = contentLength... | [
"public",
"static",
"int",
"encodeBitString",
"(",
"BitSet",
"value",
",",
"int",
"nbits",
",",
"ByteBuffer",
"buf",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"nbits",
"<",
"value",
".",
"length",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArg... | Encode an ASN.1 BIT STRING.
@param value
the value to be encoded
@param nbits
the number of bits in the bit string
@param buf
the buffer with space to the left of current position where the value will be encoded
@return the length of the encoded data | [
"Encode",
"an",
"ASN",
".",
"1",
"BIT",
"STRING",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/asn1/Asn1Utils.java#L241-L268 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/datastructures/AbstractSearchStructure.java | AbstractSearchStructure.getGeolocation | public LatLng getGeolocation(int iid) {
"""
Returns a {@link LatLng} object with the geolocation of the vector with the given internal id or null
if the internal id does not exist. Accesses the BDB store!
@param iid
The internal id of the vector
@return The geolocation mapped to the given internal id or null... | java | public LatLng getGeolocation(int iid) {
if (iid < 0 || iid > loadCounter) {
System.out.println("Internal id " + iid + " is out of range!");
return null;
}
DatabaseEntry key = new DatabaseEntry();
IntegerBinding.intToEntry(iid, key);
DatabaseEntry data = new DatabaseEntry();
if ((iidToGeolocati... | [
"public",
"LatLng",
"getGeolocation",
"(",
"int",
"iid",
")",
"{",
"if",
"(",
"iid",
"<",
"0",
"||",
"iid",
">",
"loadCounter",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Internal id \"",
"+",
"iid",
"+",
"\" is out of range!\"",
")",
";",
... | Returns a {@link LatLng} object with the geolocation of the vector with the given internal id or null
if the internal id does not exist. Accesses the BDB store!
@param iid
The internal id of the vector
@return The geolocation mapped to the given internal id or null if the internal id does not exist | [
"Returns",
"a",
"{",
"@link",
"LatLng",
"}",
"object",
"with",
"the",
"geolocation",
"of",
"the",
"vector",
"with",
"the",
"given",
"internal",
"id",
"or",
"null",
"if",
"the",
"internal",
"id",
"does",
"not",
"exist",
".",
"Accesses",
"the",
"BDB",
"sto... | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/AbstractSearchStructure.java#L429-L447 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java | ConditionalCheck.isNumeric | @ArgumentsChecked
@Throws( {
"""
Ensures that a readable sequence of {@code char} values is numeric. Numeric arguments consist only of the
characters 0-9 and may start with 0 (compared to number arguments, which must be valid numbers - think of a bank
account number).
@param condition
condition must be {@co... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalNumericArgumentException.class })
public static <T extends CharSequence> void isNumeric(final boolean condition, @Nonnull final T value, @Nullable final String name) {
if (condition) {
Check.isNumeric(value, name);
}
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalNumericArgumentException",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"void",
"isNumeric",
"(",
"final",
"boolea... | Ensures that a readable sequence of {@code char} values is numeric. Numeric arguments consist only of the
characters 0-9 and may start with 0 (compared to number arguments, which must be valid numbers - think of a bank
account number).
@param condition
condition must be {@code true}^ so that the check will be performe... | [
"Ensures",
"that",
"a",
"readable",
"sequence",
"of",
"{",
"@code",
"char",
"}",
"values",
"is",
"numeric",
".",
"Numeric",
"arguments",
"consist",
"only",
"of",
"the",
"characters",
"0",
"-",
"9",
"and",
"may",
"start",
"with",
"0",
"(",
"compared",
"to... | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L933-L939 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/convert/MicroTypeConverterRegistry.java | MicroTypeConverterRegistry.iterateAllRegisteredMicroTypeConverters | public void iterateAllRegisteredMicroTypeConverters (@Nonnull final IMicroTypeConverterCallback aCallback) {
"""
Iterate all registered micro type converters. For informational purposes
only.
@param aCallback
The callback invoked for all iterations.
"""
// Create a static copy of the map (HashMap not ... | java | public void iterateAllRegisteredMicroTypeConverters (@Nonnull final IMicroTypeConverterCallback aCallback)
{
// Create a static copy of the map (HashMap not weak!)
final ICommonsMap <Class <?>, IMicroTypeConverter <?>> aCopy = m_aRWLock.readLocked (m_aMap::getClone);
// And iterate the copy
for (fina... | [
"public",
"void",
"iterateAllRegisteredMicroTypeConverters",
"(",
"@",
"Nonnull",
"final",
"IMicroTypeConverterCallback",
"aCallback",
")",
"{",
"// Create a static copy of the map (HashMap not weak!)",
"final",
"ICommonsMap",
"<",
"Class",
"<",
"?",
">",
",",
"IMicroTypeConv... | Iterate all registered micro type converters. For informational purposes
only.
@param aCallback
The callback invoked for all iterations. | [
"Iterate",
"all",
"registered",
"micro",
"type",
"converters",
".",
"For",
"informational",
"purposes",
"only",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/convert/MicroTypeConverterRegistry.java#L210-L219 |
jeffreyning/nh-micro | nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java | MicroServiceTemplateSupport.updateInfoServiceInner | public Integer updateInfoServiceInner(String id,Map requestParamMap,String tableName,String cusCondition,String cusSetStr,String modelName) throws Exception {
"""
������ݼ�¼
@param requestParamMap �ύ����
@param tableName �����
@param cusCondition ���������ַ�
@param cusSetStr ����set�ַ�
@param modelName ����
... | java | public Integer updateInfoServiceInner(String id,Map requestParamMap,String tableName,String cusCondition,String cusSetStr,String modelName) throws Exception{
String tempKeyId=calcuIdKey();
//add 20170829 ninghao
Integer filterViewRet=filterView(tableName,requestParamMap,id,tempKeyId,TYPE_UPDATE_ID);
if(filt... | [
"public",
"Integer",
"updateInfoServiceInner",
"(",
"String",
"id",
",",
"Map",
"requestParamMap",
",",
"String",
"tableName",
",",
"String",
"cusCondition",
",",
"String",
"cusSetStr",
",",
"String",
"modelName",
")",
"throws",
"Exception",
"{",
"String",
"tempKe... | ������ݼ�¼
@param requestParamMap �ύ����
@param tableName �����
@param cusCondition ���������ַ�
@param cusSetStr ����set�ַ�
@param modelName ����
@return
@throws Exception | [
"������ݼ�¼"
] | train | https://github.com/jeffreyning/nh-micro/blob/f1cb420a092f8ba94317519ede739974decb5617/nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java#L1600-L1638 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java | ImmatureClass.checkIDEGeneratedParmNames | private void checkIDEGeneratedParmNames(JavaClass cls) {
"""
looks for methods that have it's parameters all follow the form arg0, arg1,
arg2, or parm0, parm1, parm2 etc, where the method actually has code in it
@param cls the class to check
"""
for (Method m : cls.getMethods()) {
if (isIDEGeneratedMe... | java | private void checkIDEGeneratedParmNames(JavaClass cls) {
for (Method m : cls.getMethods()) {
if (isIDEGeneratedMethodWithCode(m)) {
bugReporter.reportBug(
new BugInstance(this, BugType.IMC_IMMATURE_CLASS_IDE_GENERATED_PARAMETER_NAMES.name(),
NORMAL_PRIORITY).addClass(cls).addMethod(cls, m));
... | [
"private",
"void",
"checkIDEGeneratedParmNames",
"(",
"JavaClass",
"cls",
")",
"{",
"for",
"(",
"Method",
"m",
":",
"cls",
".",
"getMethods",
"(",
")",
")",
"{",
"if",
"(",
"isIDEGeneratedMethodWithCode",
"(",
"m",
")",
")",
"{",
"bugReporter",
".",
"repor... | looks for methods that have it's parameters all follow the form arg0, arg1,
arg2, or parm0, parm1, parm2 etc, where the method actually has code in it
@param cls the class to check | [
"looks",
"for",
"methods",
"that",
"have",
"it",
"s",
"parameters",
"all",
"follow",
"the",
"form",
"arg0",
"arg1",
"arg2",
"or",
"parm0",
"parm1",
"parm2",
"etc",
"where",
"the",
"method",
"actually",
"has",
"code",
"in",
"it"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ImmatureClass.java#L377-L386 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArrayPageFile.java | OnDiskArrayPageFile.readPage | @Override
public P readPage(int pageID) {
"""
Reads the page with the given id from this file.
@param pageID the id of the page to be returned
@return the page with the given pageId
"""
try {
countRead();
return byteBufferToPage(this.file.getRecordBuffer(pageID));
} catch (IOException... | java | @Override
public P readPage(int pageID) {
try {
countRead();
return byteBufferToPage(this.file.getRecordBuffer(pageID));
} catch (IOException e) {
throw new RuntimeException("IOException occurred during reading of page " + pageID, e);
}
} | [
"@",
"Override",
"public",
"P",
"readPage",
"(",
"int",
"pageID",
")",
"{",
"try",
"{",
"countRead",
"(",
")",
";",
"return",
"byteBufferToPage",
"(",
"this",
".",
"file",
".",
"getRecordBuffer",
"(",
"pageID",
")",
")",
";",
"}",
"catch",
"(",
"IOExce... | Reads the page with the given id from this file.
@param pageID the id of the page to be returned
@return the page with the given pageId | [
"Reads",
"the",
"page",
"with",
"the",
"given",
"id",
"from",
"this",
"file",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArrayPageFile.java#L107-L115 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/BaseSerializer.java | BaseSerializer.deserializeFilterList | public List<Filter> deserializeFilterList(String str) {
"""
Deserialize a Filter List serialized using {@link #serializeFilterList(List)}, or
an array serialized using {@link #serialize(Filter[])}
@param str String representation (YAML/JSON) of the Filter list
@return {@code List<Filter>}
"""
retu... | java | public List<Filter> deserializeFilterList(String str) {
return load(str, ListWrappers.FilterList.class).getList();
} | [
"public",
"List",
"<",
"Filter",
">",
"deserializeFilterList",
"(",
"String",
"str",
")",
"{",
"return",
"load",
"(",
"str",
",",
"ListWrappers",
".",
"FilterList",
".",
"class",
")",
".",
"getList",
"(",
")",
";",
"}"
] | Deserialize a Filter List serialized using {@link #serializeFilterList(List)}, or
an array serialized using {@link #serialize(Filter[])}
@param str String representation (YAML/JSON) of the Filter list
@return {@code List<Filter>} | [
"Deserialize",
"a",
"Filter",
"List",
"serialized",
"using",
"{",
"@link",
"#serializeFilterList",
"(",
"List",
")",
"}",
"or",
"an",
"array",
"serialized",
"using",
"{",
"@link",
"#serialize",
"(",
"Filter",
"[]",
")",
"}"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/BaseSerializer.java#L289-L291 |
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/ExtensionsInner.java | ExtensionsInner.beginEnableMonitoring | public void beginEnableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) {
"""
Enables the Operations Management Suite (OMS) on the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param paramet... | java | public void beginEnableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) {
beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginEnableMonitoring",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"ClusterMonitoringRequest",
"parameters",
")",
"{",
"beginEnableMonitoringWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
",",
"parameter... | Enables the Operations Management Suite (OMS) on the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param parameters The Operations Management Suite (OMS) workspace parameters.
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Enables",
"the",
"Operations",
"Management",
"Suite",
"(",
"OMS",
")",
"on",
"the",
"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/ExtensionsInner.java#L187-L189 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.lookAlong | public Matrix4f lookAlong(float dirX, float dirY, float dirZ,
float upX, float upY, float upZ) {
"""
Apply a rotation transformation to this matrix to make <code>-z</code> point along <code>dir</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookalon... | java | public Matrix4f lookAlong(float dirX, float dirY, float dirZ,
float upX, float upY, float upZ) {
return lookAlong(dirX, dirY, dirZ, upX, upY, upZ, thisOrNew());
} | [
"public",
"Matrix4f",
"lookAlong",
"(",
"float",
"dirX",
",",
"float",
"dirY",
",",
"float",
"dirZ",
",",
"float",
"upX",
",",
"float",
"upY",
",",
"float",
"upZ",
")",
"{",
"return",
"lookAlong",
"(",
"dirX",
",",
"dirY",
",",
"dirZ",
",",
"upX",
",... | Apply a rotation transformation to this matrix to make <code>-z</code> point along <code>dir</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookalong rotation matrix,
then the new matrix will be <code>M * L</code>. So when transforming a
vector <code>v</code> with the new matrix by usi... | [
"Apply",
"a",
"rotation",
"transformation",
"to",
"this",
"matrix",
"to",
"make",
"<code",
">",
"-",
"z<",
"/",
"code",
">",
"point",
"along",
"<code",
">",
"dir<",
"/",
"code",
">",
".",
"<p",
">",
"If",
"<code",
">",
"M<",
"/",
"code",
">",
"is",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L8235-L8238 |
alkacon/opencms-core | src/org/opencms/security/CmsRoleManager.java | CmsRoleManager.addUserToRole | public void addUserToRole(CmsObject cms, CmsRole role, String username) throws CmsException {
"""
Adds a user to the given role.<p>
@param cms the opencms context
@param role the role
@param username the name of the user that is to be added to the role
@throws CmsException if something goes wrong
"""
... | java | public void addUserToRole(CmsObject cms, CmsRole role, String username) throws CmsException {
m_securityManager.addUserToGroup(cms.getRequestContext(), username, role.getGroupName(), true);
} | [
"public",
"void",
"addUserToRole",
"(",
"CmsObject",
"cms",
",",
"CmsRole",
"role",
",",
"String",
"username",
")",
"throws",
"CmsException",
"{",
"m_securityManager",
".",
"addUserToGroup",
"(",
"cms",
".",
"getRequestContext",
"(",
")",
",",
"username",
",",
... | Adds a user to the given role.<p>
@param cms the opencms context
@param role the role
@param username the name of the user that is to be added to the role
@throws CmsException if something goes wrong | [
"Adds",
"a",
"user",
"to",
"the",
"given",
"role",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsRoleManager.java#L75-L78 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static <R> Func0<Observable<R>> toAsync(Func0<? extends R> func) {
"""
Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <R> the result valu... | java | public static <R> Func0<Observable<R>> toAsync(Func0<? extends R> func) {
return toAsync(func, Schedulers.computation());
} | [
"public",
"static",
"<",
"R",
">",
"Func0",
"<",
"Observable",
"<",
"R",
">",
">",
"toAsync",
"(",
"Func0",
"<",
"?",
"extends",
"R",
">",
"func",
")",
"{",
"return",
"toAsync",
"(",
"func",
",",
"Schedulers",
".",
"computation",
"(",
")",
")",
";"... | Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <R> the result value type
@param func the function to convert
@return a function that returns an Observabl... | [
"Convert",
"a",
"synchronous",
"function",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki"... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L161-L163 |
jcuda/jnvgraph | JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java | JNvgraph.nvgraphAllocateEdgeData | public static int nvgraphAllocateEdgeData(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
long numsets,
Pointer settypes) {
"""
Allocate numsets vectors of size E reprensenting Edge Data and attached them the graph.
settypes[i] is the type of vector #i, currently all Vertex and... | java | public static int nvgraphAllocateEdgeData(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
long numsets,
Pointer settypes)
{
return checkResult(nvgraphAllocateEdgeDataNative(handle, descrG, numsets, settypes));
} | [
"public",
"static",
"int",
"nvgraphAllocateEdgeData",
"(",
"nvgraphHandle",
"handle",
",",
"nvgraphGraphDescr",
"descrG",
",",
"long",
"numsets",
",",
"Pointer",
"settypes",
")",
"{",
"return",
"checkResult",
"(",
"nvgraphAllocateEdgeDataNative",
"(",
"handle",
",",
... | Allocate numsets vectors of size E reprensenting Edge Data and attached them the graph.
settypes[i] is the type of vector #i, currently all Vertex and Edge data should have the same type | [
"Allocate",
"numsets",
"vectors",
"of",
"size",
"E",
"reprensenting",
"Edge",
"Data",
"and",
"attached",
"them",
"the",
"graph",
".",
"settypes",
"[",
"i",
"]",
"is",
"the",
"type",
"of",
"vector",
"#i",
"currently",
"all",
"Vertex",
"and",
"Edge",
"data",... | train | https://github.com/jcuda/jnvgraph/blob/2c6bd7c58edac181753bacf30af2cceeb1989a78/JNvgraphJava/src/main/java/jcuda/jnvgraph/JNvgraph.java#L256-L263 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.toSorted | public static <T> List<T> toSorted(Iterable<T> self, @ClosureParams(value=FromString.class, options= {
"""
Sorts this Iterable using the given Closure to determine the correct ordering. The elements are first placed
into a new list which is then sorted and returned - leaving the original Iterable unchanged.
<p>
... | java | public static <T> List<T> toSorted(Iterable<T> self, @ClosureParams(value=FromString.class, options={"T","T,T"}) Closure closure) {
Comparator<T> comparator = (closure.getMaximumNumberOfParameters() == 1) ? new OrderBy<T>(closure) : new ClosureComparator<T>(closure);
return toSorted(self, comparator);
... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"toSorted",
"(",
"Iterable",
"<",
"T",
">",
"self",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"{",
"\"T\"",
",",
"\"T,T\"",
"}",
")",
"Cl... | Sorts this Iterable using the given Closure to determine the correct ordering. The elements are first placed
into a new list which is then sorted and returned - leaving the original Iterable unchanged.
<p>
If the Closure has two parameters
it is used like a traditional Comparator. I.e. it should compare
its two paramet... | [
"Sorts",
"this",
"Iterable",
"using",
"the",
"given",
"Closure",
"to",
"determine",
"the",
"correct",
"ordering",
".",
"The",
"elements",
"are",
"first",
"placed",
"into",
"a",
"new",
"list",
"which",
"is",
"then",
"sorted",
"and",
"returned",
"-",
"leaving"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L9438-L9441 |
iipc/webarchive-commons | src/main/java/org/archive/io/RecordingOutputStream.java | RecordingOutputStream.tailRecord | private void tailRecord(byte[] b, int off, int len) throws IOException {
"""
Record without digesting.
@param b Buffer to record.
@param off Offset into buffer at which to start recording.
@param len Length of buffer to record.
@exception IOException Failed write to backing file.
"""
if(this.po... | java | private void tailRecord(byte[] b, int off, int len) throws IOException {
if(this.position >= this.buffer.length){
this.ensureDiskStream().write(b, off, len);
this.position += len;
} else {
assert this.buffer != null: "Buffer is null";
int toCopy = (int)Mat... | [
"private",
"void",
"tailRecord",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"position",
">=",
"this",
".",
"buffer",
".",
"length",
")",
"{",
"this",
".",
"ensureDiskSt... | Record without digesting.
@param b Buffer to record.
@param off Offset into buffer at which to start recording.
@param len Length of buffer to record.
@exception IOException Failed write to backing file. | [
"Record",
"without",
"digesting",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/RecordingOutputStream.java#L388-L403 |
VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.processWatcher | private void processWatcher(MethodSpec.Builder createdMethodBuilder, ExecutableElement method) {
"""
Process a watcher from the Component Class.
@param createdMethodBuilder Builder for the created hook method
@param method The method we are currently processing
"""
Watch watch = method.getAnnotation(Wa... | java | private void processWatcher(MethodSpec.Builder createdMethodBuilder, ExecutableElement method) {
Watch watch = method.getAnnotation(Watch.class);
String exposedMethodName = exposeExistingJavaMethodToJs(method);
String watcherTriggerMethodName = addNewMethodToProto();
MethodSpec.Builder watcherMethodBu... | [
"private",
"void",
"processWatcher",
"(",
"MethodSpec",
".",
"Builder",
"createdMethodBuilder",
",",
"ExecutableElement",
"method",
")",
"{",
"Watch",
"watch",
"=",
"method",
".",
"getAnnotation",
"(",
"Watch",
".",
"class",
")",
";",
"String",
"exposedMethodName"... | Process a watcher from the Component Class.
@param createdMethodBuilder Builder for the created hook method
@param method The method we are currently processing | [
"Process",
"a",
"watcher",
"from",
"the",
"Component",
"Class",
"."
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L465-L494 |
threerings/narya | core/src/main/java/com/threerings/presents/peer/server/PeerManager.java | PeerManager.invokeNodeAction | public void invokeNodeAction (String nodeName, NodeAction action) {
"""
Invokes a node action on a specific node <em>without</em> executing {@link
NodeAction#isApplicable} to determine whether the action is applicable.
"""
PeerNode peer = _peers.get(nodeName);
if (peer != null) {
i... | java | public void invokeNodeAction (String nodeName, NodeAction action)
{
PeerNode peer = _peers.get(nodeName);
if (peer != null) {
if (peer.nodeobj != null) {
peer.nodeobj.peerService.invokeAction(flattenAction(action));
} else {
log.warning("Dropp... | [
"public",
"void",
"invokeNodeAction",
"(",
"String",
"nodeName",
",",
"NodeAction",
"action",
")",
"{",
"PeerNode",
"peer",
"=",
"_peers",
".",
"get",
"(",
"nodeName",
")",
";",
"if",
"(",
"peer",
"!=",
"null",
")",
"{",
"if",
"(",
"peer",
".",
"nodeob... | Invokes a node action on a specific node <em>without</em> executing {@link
NodeAction#isApplicable} to determine whether the action is applicable. | [
"Invokes",
"a",
"node",
"action",
"on",
"a",
"specific",
"node",
"<em",
">",
"without<",
"/",
"em",
">",
"executing",
"{"
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L522-L536 |
micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java | PathMatchingResourcePatternResolver.doFindPathMatchingFileResources | protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource, String subPattern)
throws IOException {
"""
Find all resources in the file system that match the given location pattern
via the Ant-style PathMatcher.
@param rootDirResource the root directory as Resource
@param subPatte... | java | protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource, String subPattern)
throws IOException {
File rootDir;
try {
rootDir = rootDirResource.getFile().getAbsoluteFile();
} catch (IOException ex) {
return Collections.emptySet();
... | [
"protected",
"Set",
"<",
"Resource",
">",
"doFindPathMatchingFileResources",
"(",
"Resource",
"rootDirResource",
",",
"String",
"subPattern",
")",
"throws",
"IOException",
"{",
"File",
"rootDir",
";",
"try",
"{",
"rootDir",
"=",
"rootDirResource",
".",
"getFile",
... | Find all resources in the file system that match the given location pattern
via the Ant-style PathMatcher.
@param rootDirResource the root directory as Resource
@param subPattern the sub pattern to match (below the root directory)
@return the Set of matching Resource instances
@throws IOException in case of I/O e... | [
"Find",
"all",
"resources",
"in",
"the",
"file",
"system",
"that",
"match",
"the",
"given",
"location",
"pattern",
"via",
"the",
"Ant",
"-",
"style",
"PathMatcher",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/PathMatchingResourcePatternResolver.java#L467-L477 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/text/StrSpliter.java | StrSpliter.splitPath | public static List<String> splitPath(String str, int limit) {
"""
切分字符串路径,仅支持Unix分界符:/
@param str 被切分的字符串
@param limit 限制分片数
@return 切分后的集合
@since 3.0.8
"""
return split(str, StrUtil.C_SLASH, limit, true, true);
} | java | public static List<String> splitPath(String str, int limit){
return split(str, StrUtil.C_SLASH, limit, true, true);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"splitPath",
"(",
"String",
"str",
",",
"int",
"limit",
")",
"{",
"return",
"split",
"(",
"str",
",",
"StrUtil",
".",
"C_SLASH",
",",
"limit",
",",
"true",
",",
"true",
")",
";",
"}"
] | 切分字符串路径,仅支持Unix分界符:/
@param str 被切分的字符串
@param limit 限制分片数
@return 切分后的集合
@since 3.0.8 | [
"切分字符串路径,仅支持Unix分界符:",
"/"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/StrSpliter.java#L51-L53 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.leftPad | public static String leftPad(final String value, final String pad, final int length) {
"""
Returns a new string of a given length such that the beginning of the string is padded.
@param value The input String
@param pad The pad
@param length Length of the String we want
@return Padded String
"""
... | java | public static String leftPad(final String value, final String pad, final int length) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
validate(pad, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
if (value.length() > length) {
return value;
}
retu... | [
"public",
"static",
"String",
"leftPad",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"pad",
",",
"final",
"int",
"length",
")",
"{",
"validate",
"(",
"value",
",",
"NULL_STRING_PREDICATE",
",",
"NULL_STRING_MSG_SUPPLIER",
")",
";",
"validate",
"("... | Returns a new string of a given length such that the beginning of the string is padded.
@param value The input String
@param pad The pad
@param length Length of the String we want
@return Padded String | [
"Returns",
"a",
"new",
"string",
"of",
"a",
"given",
"length",
"such",
"that",
"the",
"beginning",
"of",
"the",
"string",
"is",
"padded",
"."
] | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L584-L591 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/PresignUrlDownloadCallable.java | PresignUrlDownloadCallable.updateDownloadStatus | private void updateDownloadStatus(S3Object result) {
"""
Takes the result from serial download,
updates the transfer state and monitor in downloadImpl object
based on the result.
"""
if (result == null) {
download.setState(Transfer.TransferState.Canceled);
download.setMonitor(... | java | private void updateDownloadStatus(S3Object result) {
if (result == null) {
download.setState(Transfer.TransferState.Canceled);
download.setMonitor(new DownloadMonitor(download, null));
} else {
download.setState(Transfer.TransferState.Completed);
}
} | [
"private",
"void",
"updateDownloadStatus",
"(",
"S3Object",
"result",
")",
"{",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"download",
".",
"setState",
"(",
"Transfer",
".",
"TransferState",
".",
"Canceled",
")",
";",
"download",
".",
"setMonitor",
"(",
... | Takes the result from serial download,
updates the transfer state and monitor in downloadImpl object
based on the result. | [
"Takes",
"the",
"result",
"from",
"serial",
"download",
"updates",
"the",
"transfer",
"state",
"and",
"monitor",
"in",
"downloadImpl",
"object",
"based",
"on",
"the",
"result",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/PresignUrlDownloadCallable.java#L99-L106 |
twilio/twilio-java | src/main/java/com/twilio/rest/serverless/v1/service/environment/VariableReader.java | VariableReader.previousPage | @Override
public Page<Variable> previousPage(final Page<Variable> page,
final TwilioRestClient client) {
"""
Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page
... | java | @Override
public Page<Variable> previousPage(final Page<Variable> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.SERVERLESS.toString(),
clie... | [
"@",
"Override",
"public",
"Page",
"<",
"Variable",
">",
"previousPage",
"(",
"final",
"Page",
"<",
"Variable",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
"... | Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"Retrieve",
"the",
"previous",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/serverless/v1/service/environment/VariableReader.java#L119-L130 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java | JacksonUtils.toJson | public static JsonNode toJson(Object obj, ClassLoader classLoader) {
"""
Serialize an object to {@link JsonNode}, with a custom class loader.
@param obj
@param classLoader
@return
"""
return SerializationUtils.toJson(obj, classLoader);
} | java | public static JsonNode toJson(Object obj, ClassLoader classLoader) {
return SerializationUtils.toJson(obj, classLoader);
} | [
"public",
"static",
"JsonNode",
"toJson",
"(",
"Object",
"obj",
",",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"SerializationUtils",
".",
"toJson",
"(",
"obj",
",",
"classLoader",
")",
";",
"}"
] | Serialize an object to {@link JsonNode}, with a custom class loader.
@param obj
@param classLoader
@return | [
"Serialize",
"an",
"object",
"to",
"{",
"@link",
"JsonNode",
"}",
"with",
"a",
"custom",
"class",
"loader",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/JacksonUtils.java#L53-L55 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/CommonUtils.java | CommonUtils.modifyBean | public static <T> T modifyBean(Map<String, ?> property, T bean) {
"""
将Bean的属性值修改为Map中对应的值
@param property 一个Map对象,封装了相应的Bean类中的属性
@param bean 需要修改的Bean类
@return 返回一个属性已修改的Bean类实例
"""
try {
BeanUtils.populate(bean, property);
return bean;
} catch (Exception e) {... | java | public static <T> T modifyBean(Map<String, ?> property, T bean) {
try {
BeanUtils.populate(bean, property);
return bean;
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"modifyBean",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"property",
",",
"T",
"bean",
")",
"{",
"try",
"{",
"BeanUtils",
".",
"populate",
"(",
"bean",
",",
"property",
")",
";",
"return",
"bean",
";",
"}",
... | 将Bean的属性值修改为Map中对应的值
@param property 一个Map对象,封装了相应的Bean类中的属性
@param bean 需要修改的Bean类
@return 返回一个属性已修改的Bean类实例 | [
"将Bean的属性值修改为Map中对应的值"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/CommonUtils.java#L72-L79 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java | SerializationUtils.fromJsonString | public static <T> T fromJsonString(String jsonString, Class<T> clazz, ClassLoader classLoader) {
"""
Deserialize a JSON string, with custom class loader.
@param jsonString
@param clazz
@return
"""
if (jsonString == null) {
return null;
}
ClassLoader oldClassLoader = Thr... | java | public static <T> T fromJsonString(String jsonString, Class<T> clazz, ClassLoader classLoader) {
if (jsonString == null) {
return null;
}
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
if (classLoader != null) {
Thread.currentThread()... | [
"public",
"static",
"<",
"T",
">",
"T",
"fromJsonString",
"(",
"String",
"jsonString",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"ClassLoader",
"classLoader",
")",
"{",
"if",
"(",
"jsonString",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Clas... | Deserialize a JSON string, with custom class loader.
@param jsonString
@param clazz
@return | [
"Deserialize",
"a",
"JSON",
"string",
"with",
"custom",
"class",
"loader",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java#L657-L681 |
derari/cthul | objects/src/main/java/org/cthul/objects/reflection/Signatures.java | Signatures.bestMethod | public static Method bestMethod(Method[] methods, Class<?>[] argTypes) throws AmbiguousMethodMatchException {
"""
Selects the best method for the given argument types.
@param methods
@param argTypes
@return method
@throws AmbiguousSignatureMatchException if multiple methods match equally
"""
try {... | java | public static Method bestMethod(Method[] methods, Class<?>[] argTypes) throws AmbiguousMethodMatchException {
try {
return best(methods, collectSignatures(methods), collectVarArgs(methods), argTypes);
} catch (AmbiguousSignatureMatchException e) {
throw new AmbiguousMethodMat... | [
"public",
"static",
"Method",
"bestMethod",
"(",
"Method",
"[",
"]",
"methods",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"argTypes",
")",
"throws",
"AmbiguousMethodMatchException",
"{",
"try",
"{",
"return",
"best",
"(",
"methods",
",",
"collectSignatures",
"(... | Selects the best method for the given argument types.
@param methods
@param argTypes
@return method
@throws AmbiguousSignatureMatchException if multiple methods match equally | [
"Selects",
"the",
"best",
"method",
"for",
"the",
"given",
"argument",
"types",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L161-L167 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java | KeyVaultClientImpl.createKey | public KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags) {
"""
Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be... | java | public KeyBundle createKey(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags) {
return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty, keySize, keyOps, keyAttributes, tags).toBlocking().... | [
"public",
"KeyBundle",
"createKey",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"JsonWebKeyType",
"kty",
",",
"Integer",
"keySize",
",",
"List",
"<",
"JsonWebKeyOperation",
">",
"keyOps",
",",
"KeyAttributes",
"keyAttributes",
",",
"Map",
"<",
... | Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. Authorization: Requires the keys/create permission.
@param vaultBase... | [
"Creates",
"a",
"new",
"key",
"stores",
"it",
"then",
"returns",
"key",
"parameters",
"and",
"attributes",
"to",
"the",
"client",
".",
"The",
"create",
"key",
"operation",
"can",
"be",
"used",
"to",
"create",
"any",
"key",
"type",
"in",
"Azure",
"Key",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java#L539-L541 |
zaproxy/zaproxy | src/org/parosproxy/paros/network/HttpSender.java | HttpSender.setMaxRetriesOnIOError | public void setMaxRetriesOnIOError(int retries) {
"""
Sets the maximum number of retries of an unsuccessful request caused by I/O errors.
<p>
The default number of retries is 3.
@param retries the number of retries
@throws IllegalArgumentException if {@code retries} is negative.
@since 2.4.0
"""
... | java | public void setMaxRetriesOnIOError(int retries) {
if (retries < 0) {
throw new IllegalArgumentException("Parameter retries must be greater or equal to zero.");
}
HttpMethodRetryHandler retryHandler = new DefaultHttpMethodRetryHandler(retries, false);
client.getParams()... | [
"public",
"void",
"setMaxRetriesOnIOError",
"(",
"int",
"retries",
")",
"{",
"if",
"(",
"retries",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parameter retries must be greater or equal to zero.\"",
")",
";",
"}",
"HttpMethodRetryHandler",
... | Sets the maximum number of retries of an unsuccessful request caused by I/O errors.
<p>
The default number of retries is 3.
@param retries the number of retries
@throws IllegalArgumentException if {@code retries} is negative.
@since 2.4.0 | [
"Sets",
"the",
"maximum",
"number",
"of",
"retries",
"of",
"an",
"unsuccessful",
"request",
"caused",
"by",
"I",
"/",
"O",
"errors",
".",
"<p",
">",
"The",
"default",
"number",
"of",
"retries",
"is",
"3",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/HttpSender.java#L824-L832 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java | MLLibUtil.pointOf | public static LabeledPoint pointOf(Collection<Writable> writables) {
"""
Returns a labeled point of the writables
where the final item is the point and the rest of the items are
features
@param writables the writables
@return the labeled point
"""
double[] ret = new double[writables.size() - 1];
... | java | public static LabeledPoint pointOf(Collection<Writable> writables) {
double[] ret = new double[writables.size() - 1];
int count = 0;
double target = 0;
for (Writable w : writables) {
if (count < writables.size() - 1)
ret[count++] = Float.parseFloat(w.toString(... | [
"public",
"static",
"LabeledPoint",
"pointOf",
"(",
"Collection",
"<",
"Writable",
">",
"writables",
")",
"{",
"double",
"[",
"]",
"ret",
"=",
"new",
"double",
"[",
"writables",
".",
"size",
"(",
")",
"-",
"1",
"]",
";",
"int",
"count",
"=",
"0",
";"... | Returns a labeled point of the writables
where the final item is the point and the rest of the items are
features
@param writables the writables
@return the labeled point | [
"Returns",
"a",
"labeled",
"point",
"of",
"the",
"writables",
"where",
"the",
"final",
"item",
"is",
"the",
"point",
"and",
"the",
"rest",
"of",
"the",
"items",
"are",
"features"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/util/MLLibUtil.java#L185-L199 |
alkacon/opencms-core | src-setup/org/opencms/setup/CmsUpdateBean.java | CmsUpdateBean.init | @Override
public void init(String webAppRfsPath, String servletMapping, String defaultWebApplication) {
"""
Creates a new instance of the setup Bean.<p>
@param webAppRfsPath path to the OpenCms web application
@param servletMapping the OpenCms servlet mapping
@param defaultWebApplication the name of the d... | java | @Override
public void init(String webAppRfsPath, String servletMapping, String defaultWebApplication) {
try {
super.init(webAppRfsPath, servletMapping, defaultWebApplication);
CmsUpdateInfo.INSTANCE.setAdeModuleVersion(getInstalledModules().get("org.opencms.ade.containerpage"));
... | [
"@",
"Override",
"public",
"void",
"init",
"(",
"String",
"webAppRfsPath",
",",
"String",
"servletMapping",
",",
"String",
"defaultWebApplication",
")",
"{",
"try",
"{",
"super",
".",
"init",
"(",
"webAppRfsPath",
",",
"servletMapping",
",",
"defaultWebApplication... | Creates a new instance of the setup Bean.<p>
@param webAppRfsPath path to the OpenCms web application
@param servletMapping the OpenCms servlet mapping
@param defaultWebApplication the name of the default web application | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"setup",
"Bean",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/CmsUpdateBean.java#L586-L611 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocument.java | ReadOnlyStyledDocument.replace | private Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>> replace(
BiIndex start, BiIndex end, UnaryOperator<ReadOnlyStyledDocument<PS, SEG, S>> f) {
"""
Note: there must be a "ensureValid_()" call preceding the call of this meth... | java | private Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>> replace(
BiIndex start, BiIndex end, UnaryOperator<ReadOnlyStyledDocument<PS, SEG, S>> f) {
int pos = tree.getSummaryBetween(0, start.major).map(s -> s.length() + 1).or... | [
"private",
"Tuple3",
"<",
"ReadOnlyStyledDocument",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
",",
"RichTextChange",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
",",
"MaterializedListModification",
"<",
"Paragraph",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
">",
">"... | Note: there must be a "ensureValid_()" call preceding the call of this method | [
"Note",
":",
"there",
"must",
"be",
"a",
"ensureValid_",
"()",
"call",
"preceding",
"the",
"call",
"of",
"this",
"method"
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocument.java#L411-L429 |
mfornos/humanize | humanize-slim/src/main/java/humanize/Humanize.java | Humanize.naturalDay | public static String naturalDay(final int style, final Date then, final Locale locale) {
"""
Same as {@link #naturalDay(int, Date)} with the given locale.
@param style
The style of the Date
@param then
The date (GMT)
@param locale
Target locale
@return String with 'today', 'tomorrow' or 'yesterday' compar... | java | public static String naturalDay(final int style, final Date then, final Locale locale)
{
return withinLocale(new Callable<String>()
{
public String call() throws Exception
{
return naturalDay(style, then);
}
}, locale);
} | [
"public",
"static",
"String",
"naturalDay",
"(",
"final",
"int",
"style",
",",
"final",
"Date",
"then",
",",
"final",
"Locale",
"locale",
")",
"{",
"return",
"withinLocale",
"(",
"new",
"Callable",
"<",
"String",
">",
"(",
")",
"{",
"public",
"String",
"... | Same as {@link #naturalDay(int, Date)} with the given locale.
@param style
The style of the Date
@param then
The date (GMT)
@param locale
Target locale
@return String with 'today', 'tomorrow' or 'yesterday' compared to
current day. Otherwise, returns a string formatted according to a
locale sensitive DateFormat. | [
"Same",
"as",
"{",
"@link",
"#naturalDay",
"(",
"int",
"Date",
")",
"}",
"with",
"the",
"given",
"locale",
"."
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-slim/src/main/java/humanize/Humanize.java#L1521-L1530 |
hazelcast/hazelcast | hazelcast-client/src/main/java/com/hazelcast/client/util/ClientStateListener.java | ClientStateListener.awaitDisconnected | public boolean awaitDisconnected(long timeout, TimeUnit unit)
throws InterruptedException {
"""
Waits until the client is disconnected from the cluster or the timeout expires.
Does not wait if the client is already shutting down or shutdown.
@param timeout the maximum time to wait
@param unit t... | java | public boolean awaitDisconnected(long timeout, TimeUnit unit)
throws InterruptedException {
lock.lock();
try {
if (currentState.equals(CLIENT_DISCONNECTED) || currentState.equals(SHUTTING_DOWN) || currentState.equals(SHUTDOWN)) {
return true;
}
... | [
"public",
"boolean",
"awaitDisconnected",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"currentState",
".",
"equals",
"(",
"CLIENT_DISCONNECTED",
")",
... | Waits until the client is disconnected from the cluster or the timeout expires.
Does not wait if the client is already shutting down or shutdown.
@param timeout the maximum time to wait
@param unit the time unit of the {@code timeout} argument
@return true if the client is disconnected to the cluster. On returning ... | [
"Waits",
"until",
"the",
"client",
"is",
"disconnected",
"from",
"the",
"cluster",
"or",
"the",
"timeout",
"expires",
".",
"Does",
"not",
"wait",
"if",
"the",
"client",
"is",
"already",
"shutting",
"down",
"or",
"shutdown",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/util/ClientStateListener.java#L137-L159 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_task_mailinglist_GET | public ArrayList<Long> domain_task_mailinglist_GET(String domain, String account) throws IOException {
"""
Get Mailing List tasks
REST: GET /email/domain/{domain}/task/mailinglist
@param account [required] Account name
@param domain [required] Name of your domain name
"""
String qPath = "/email/domain/{... | java | public ArrayList<Long> domain_task_mailinglist_GET(String domain, String account) throws IOException {
String qPath = "/email/domain/{domain}/task/mailinglist";
StringBuilder sb = path(qPath, domain);
query(sb, "account", account);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, ... | [
"public",
"ArrayList",
"<",
"Long",
">",
"domain_task_mailinglist_GET",
"(",
"String",
"domain",
",",
"String",
"account",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/task/mailinglist\"",
";",
"StringBuilder",
"sb",
"=",
"path"... | Get Mailing List tasks
REST: GET /email/domain/{domain}/task/mailinglist
@param account [required] Account name
@param domain [required] Name of your domain name | [
"Get",
"Mailing",
"List",
"tasks"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L1114-L1120 |
unbescape/unbescape | src/main/java/org/unbescape/json/JsonEscape.java | JsonEscape.escapeJsonMinimal | public static void escapeJsonMinimal(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
"""
<p>
Perform a JSON level 1 (only basic set) <strong>escape</strong> operation
on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 1</em> me... | java | public static void escapeJsonMinimal(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapeJson(text, offset, len, writer,
JsonEscapeType.SINGLE_ESCAPE_CHARS_DEFAULT_TO_UHEXA,
JsonEscapeL... | [
"public",
"static",
"void",
"escapeJsonMinimal",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeJson",
"(",
"text",
",",
"offset... | <p>
Perform a JSON level 1 (only basic set) <strong>escape</strong> operation
on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 1</em> means this method will only escape the JSON basic escape set:
</p>
<ul>
<li>The <em>Single Escape Characters</em>:
<tt>\b</tt> (<tt>U+0008</tt>),
<tt>\t</tt> (<tt>U+0009</tt>),
<tt... | [
"<p",
">",
"Perform",
"a",
"JSON",
"level",
"1",
"(",
"only",
"basic",
"set",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/json/JsonEscape.java#L725-L730 |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.appendRegion | @SuppressWarnings("static-method")
protected IStyleAppendable appendRegion(IStyleAppendable it, boolean addNewLine, String name, String start, String[] end, String... contains) {
"""
Append a Vim region.
@param it the receiver of the generated elements.
@param addNewLine indicates if a new line must be append... | java | @SuppressWarnings("static-method")
protected IStyleAppendable appendRegion(IStyleAppendable it, boolean addNewLine, String name, String start, String[] end, String... contains) {
it.append("syn region "); //$NON-NLS-1$
it.append(name);
it.append(" start="); //$NON-NLS-1$
it.append(regexString(start));
for (... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"protected",
"IStyleAppendable",
"appendRegion",
"(",
"IStyleAppendable",
"it",
",",
"boolean",
"addNewLine",
",",
"String",
"name",
",",
"String",
"start",
",",
"String",
"[",
"]",
"end",
",",
"String",
".... | Append a Vim region.
@param it the receiver of the generated elements.
@param addNewLine indicates if a new line must be appended.
@param name the name of the pattern.
@param start the start pattern.
@param end the end pattern.
@param contains the contained elements.
@return {@code it}. | [
"Append",
"a",
"Vim",
"region",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L414-L434 |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.reserveAndWriteUtf8 | public static int reserveAndWriteUtf8(ByteBuf buf, CharSequence seq, int reserveBytes) {
"""
Encode a {@link CharSequence} in <a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a> and write
it into {@code reserveBytes} of a {@link ByteBuf}.
<p>
The {@code reserveBytes} must be computed (ie eagerly using {@link... | java | public static int reserveAndWriteUtf8(ByteBuf buf, CharSequence seq, int reserveBytes) {
for (;;) {
if (buf instanceof WrappedCompositeByteBuf) {
// WrappedCompositeByteBuf is a sub-class of AbstractByteBuf so it needs special handling.
buf = buf.unwrap();
... | [
"public",
"static",
"int",
"reserveAndWriteUtf8",
"(",
"ByteBuf",
"buf",
",",
"CharSequence",
"seq",
",",
"int",
"reserveBytes",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"if",
"(",
"buf",
"instanceof",
"WrappedCompositeByteBuf",
")",
"{",
"// WrappedComposite... | Encode a {@link CharSequence} in <a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a> and write
it into {@code reserveBytes} of a {@link ByteBuf}.
<p>
The {@code reserveBytes} must be computed (ie eagerly using {@link #utf8MaxBytes(CharSequence)}
or exactly with {@link #utf8Bytes(CharSequence)}) to ensure this method... | [
"Encode",
"a",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L511-L531 |
GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystemBase.java | GoogleHadoopFileSystemBase.mkdirs | @Override
public boolean mkdirs(Path hadoopPath, FsPermission permission)
throws IOException {
"""
Makes the given path and all non-existent parents directories.
Has the semantics of Unix 'mkdir -p'.
@param hadoopPath Given path.
@param permission Permissions to set on the given directory.
@return tr... | java | @Override
public boolean mkdirs(Path hadoopPath, FsPermission permission)
throws IOException {
long startTime = System.nanoTime();
Preconditions.checkArgument(hadoopPath != null, "hadoopPath must not be null");
checkOpen();
logger.atFine().log("GHFS.mkdirs: %s, perm: %s", hadoopPath, permissi... | [
"@",
"Override",
"public",
"boolean",
"mkdirs",
"(",
"Path",
"hadoopPath",
",",
"FsPermission",
"permission",
")",
"throws",
"IOException",
"{",
"long",
"startTime",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"ha... | Makes the given path and all non-existent parents directories.
Has the semantics of Unix 'mkdir -p'.
@param hadoopPath Given path.
@param permission Permissions to set on the given directory.
@return true on success, false otherwise.
@throws IOException if an error occurs. | [
"Makes",
"the",
"given",
"path",
"and",
"all",
"non",
"-",
"existent",
"parents",
"directories",
".",
"Has",
"the",
"semantics",
"of",
"Unix",
"mkdir",
"-",
"p",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystemBase.java#L1046-L1070 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/security/CredentialReference.java | CredentialReference.getAttributeBuilder | public static ObjectTypeAttributeDefinition.Builder getAttributeBuilder(String name, String xmlName, boolean allowNull) {
"""
Get an attribute builder for a credential-reference attribute with the specified characteristics. The
{@code store} field in the attribute does not register any requirement for a credentia... | java | public static ObjectTypeAttributeDefinition.Builder getAttributeBuilder(String name, String xmlName, boolean allowNull) {
return getAttributeBuilder(name, xmlName, allowNull, false);
} | [
"public",
"static",
"ObjectTypeAttributeDefinition",
".",
"Builder",
"getAttributeBuilder",
"(",
"String",
"name",
",",
"String",
"xmlName",
",",
"boolean",
"allowNull",
")",
"{",
"return",
"getAttributeBuilder",
"(",
"name",
",",
"xmlName",
",",
"allowNull",
",",
... | Get an attribute builder for a credential-reference attribute with the specified characteristics. The
{@code store} field in the attribute does not register any requirement for a credential store capability.
@param name name of attribute
@param xmlName name of xml element
@param allowNull {@code false} if the attribut... | [
"Get",
"an",
"attribute",
"builder",
"for",
"a",
"credential",
"-",
"reference",
"attribute",
"with",
"the",
"specified",
"characteristics",
".",
"The",
"{",
"@code",
"store",
"}",
"field",
"in",
"the",
"attribute",
"does",
"not",
"register",
"any",
"requireme... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/security/CredentialReference.java#L200-L202 |
xiancloud/xian | xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/ConfigurationSupport.java | ConfigurationSupport.setMdcFields | public static void setMdcFields(String spec, GelfMessageAssembler gelfMessageAssembler) {
"""
Set the MDC fields.
@param spec field, field2, field3
@param gelfMessageAssembler the Gelf message assembler to apply the configuration
"""
if (null != spec) {
String[] fields = spec.split(MULT... | java | public static void setMdcFields(String spec, GelfMessageAssembler gelfMessageAssembler) {
if (null != spec) {
String[] fields = spec.split(MULTI_VALUE_DELIMITTER);
for (String field : fields) {
gelfMessageAssembler.addField(new MdcMessageField(field.trim(), field.trim())... | [
"public",
"static",
"void",
"setMdcFields",
"(",
"String",
"spec",
",",
"GelfMessageAssembler",
"gelfMessageAssembler",
")",
"{",
"if",
"(",
"null",
"!=",
"spec",
")",
"{",
"String",
"[",
"]",
"fields",
"=",
"spec",
".",
"split",
"(",
"MULTI_VALUE_DELIMITTER",... | Set the MDC fields.
@param spec field, field2, field3
@param gelfMessageAssembler the Gelf message assembler to apply the configuration | [
"Set",
"the",
"MDC",
"fields",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/ConfigurationSupport.java#L45-L53 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/HttpResourceConnection.java | HttpResourceConnection.obtainConnection | private HttpURLConnection obtainConnection(URL url) throws DownloadFailedException {
"""
Obtains the HTTP URL Connection.
@param url the URL
@return the HTTP URL Connection
@throws DownloadFailedException thrown if there is an error creating the
HTTP URL Connection
"""
HttpURLConnection conn = nu... | java | private HttpURLConnection obtainConnection(URL url) throws DownloadFailedException {
HttpURLConnection conn = null;
try {
LOGGER.debug("Attempting retrieval of {}", url.toString());
conn = connFactory.createHttpURLConnection(url, this.usesProxy);
conn.setRequestProper... | [
"private",
"HttpURLConnection",
"obtainConnection",
"(",
"URL",
"url",
")",
"throws",
"DownloadFailedException",
"{",
"HttpURLConnection",
"conn",
"=",
"null",
";",
"try",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Attempting retrieval of {}\"",
",",
"url",
".",
"toString... | Obtains the HTTP URL Connection.
@param url the URL
@return the HTTP URL Connection
@throws DownloadFailedException thrown if there is an error creating the
HTTP URL Connection | [
"Obtains",
"the",
"HTTP",
"URL",
"Connection",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/HttpResourceConnection.java#L166-L221 |
eurekaclinical/eurekaclinical-common | src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java | EurekaClinicalClient.doPut | protected void doPut(String path, Object o) throws ClientException {
"""
Updates the resource specified by the path. Sends to the server a Content
Type header for JSON.
@param o the updated object, will be transmitted as JSON. It must be a
Java bean or an object that the object mapper that is in use knows abo... | java | protected void doPut(String path, Object o) throws ClientException {
doPut(path, o, null);
} | [
"protected",
"void",
"doPut",
"(",
"String",
"path",
",",
"Object",
"o",
")",
"throws",
"ClientException",
"{",
"doPut",
"(",
"path",
",",
"o",
",",
"null",
")",
";",
"}"
] | Updates the resource specified by the path. Sends to the server a Content
Type header for JSON.
@param o the updated object, will be transmitted as JSON. It must be a
Java bean or an object that the object mapper that is in use knows about.
@param path the path to the resource. Cannot be <code>null</code>.
@throws Cl... | [
"Updates",
"the",
"resource",
"specified",
"by",
"the",
"path",
".",
"Sends",
"to",
"the",
"server",
"a",
"Content",
"Type",
"header",
"for",
"JSON",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L179-L181 |
alkacon/opencms-core | src/org/opencms/search/CmsVfsIndexer.java | CmsVfsIndexer.deleteResource | protected void deleteResource(I_CmsIndexWriter indexWriter, CmsPublishedResource resource) {
"""
Deletes a resource with the given index writer.<p>
@param indexWriter the index writer to resource the resource with
@param resource the root path of the resource to delete
"""
try {
if (LO... | java | protected void deleteResource(I_CmsIndexWriter indexWriter, CmsPublishedResource resource) {
try {
if (LOG.isInfoEnabled()) {
LOG.info(Messages.get().getBundle().key(Messages.LOG_DELETING_FROM_INDEX_1, resource.getRootPath()));
}
// delete all documents with ... | [
"protected",
"void",
"deleteResource",
"(",
"I_CmsIndexWriter",
"indexWriter",
",",
"CmsPublishedResource",
"resource",
")",
"{",
"try",
"{",
"if",
"(",
"LOG",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"info",
"(",
"Messages",
".",
"get",
"(",
... | Deletes a resource with the given index writer.<p>
@param indexWriter the index writer to resource the resource with
@param resource the root path of the resource to delete | [
"Deletes",
"a",
"resource",
"with",
"the",
"given",
"index",
"writer",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsVfsIndexer.java#L304-L322 |
matthewhorridge/mdock | src/main/java/org/coode/mdock/SplitterNode.java | SplitterNode.replaceChild | public void replaceChild(Node current, Node with) {
"""
Replaces a child node with another node
@param current The child node which should be replaced
@param with The node that the child node should be replaced with
"""
double currentSplit = nodeSplits.get(current);
int index = children.in... | java | public void replaceChild(Node current, Node with) {
double currentSplit = nodeSplits.get(current);
int index = children.indexOf(current);
children.remove(current);
addChild(with, index, currentSplit);
notifyStateChange();
} | [
"public",
"void",
"replaceChild",
"(",
"Node",
"current",
",",
"Node",
"with",
")",
"{",
"double",
"currentSplit",
"=",
"nodeSplits",
".",
"get",
"(",
"current",
")",
";",
"int",
"index",
"=",
"children",
".",
"indexOf",
"(",
"current",
")",
";",
"childr... | Replaces a child node with another node
@param current The child node which should be replaced
@param with The node that the child node should be replaced with | [
"Replaces",
"a",
"child",
"node",
"with",
"another",
"node"
] | train | https://github.com/matthewhorridge/mdock/blob/37839a56f30bdb73d56d82c4d1afe548d66b404b/src/main/java/org/coode/mdock/SplitterNode.java#L318-L324 |
Alluxio/alluxio | core/client/fs/src/main/java/alluxio/client/block/AlluxioBlockStore.java | AlluxioBlockStore.getInStream | public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException {
"""
Gets a stream to read the data of a block. This method is primarily responsible for
determining the data source and type of data source. The latest BlockInfo will be fetched
from the master to ensure the locations ar... | java | public BlockInStream getInStream(long blockId, InStreamOptions options) throws IOException {
return getInStream(blockId, options, ImmutableMap.of());
} | [
"public",
"BlockInStream",
"getInStream",
"(",
"long",
"blockId",
",",
"InStreamOptions",
"options",
")",
"throws",
"IOException",
"{",
"return",
"getInStream",
"(",
"blockId",
",",
"options",
",",
"ImmutableMap",
".",
"of",
"(",
")",
")",
";",
"}"
] | Gets a stream to read the data of a block. This method is primarily responsible for
determining the data source and type of data source. The latest BlockInfo will be fetched
from the master to ensure the locations are up to date.
@param blockId the id of the block to read
@param options the options associated with the... | [
"Gets",
"a",
"stream",
"to",
"read",
"the",
"data",
"of",
"a",
"block",
".",
"This",
"method",
"is",
"primarily",
"responsible",
"for",
"determining",
"the",
"data",
"source",
"and",
"type",
"of",
"data",
"source",
".",
"The",
"latest",
"BlockInfo",
"will"... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/block/AlluxioBlockStore.java#L148-L150 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/provider/HdfsBasedUpdateProvider.java | HdfsBasedUpdateProvider.getUpdateTime | @Override
public long getUpdateTime(Partition partition) throws UpdateNotFoundException {
"""
Get the update time of a {@link Partition}
@return the update time if available, 0 otherwise
{@inheritDoc}
@see HiveUnitUpdateProvider#getUpdateTime(org.apache.hadoop.hive.ql.metadata.Partition)
"""
try ... | java | @Override
public long getUpdateTime(Partition partition) throws UpdateNotFoundException {
try {
return getUpdateTime(partition.getDataLocation());
} catch (IOException e) {
throw new UpdateNotFoundException(String.format("Failed to get update time for %s", partition.getCompleteName()),
... | [
"@",
"Override",
"public",
"long",
"getUpdateTime",
"(",
"Partition",
"partition",
")",
"throws",
"UpdateNotFoundException",
"{",
"try",
"{",
"return",
"getUpdateTime",
"(",
"partition",
".",
"getDataLocation",
"(",
")",
")",
";",
"}",
"catch",
"(",
"IOException... | Get the update time of a {@link Partition}
@return the update time if available, 0 otherwise
{@inheritDoc}
@see HiveUnitUpdateProvider#getUpdateTime(org.apache.hadoop.hive.ql.metadata.Partition) | [
"Get",
"the",
"update",
"time",
"of",
"a",
"{",
"@link",
"Partition",
"}"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/provider/HdfsBasedUpdateProvider.java#L56-L65 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/common/abstracts/AbstractTrainer.java | AbstractTrainer.createKnowledgeBaseName | protected final String createKnowledgeBaseName(String storageName, String separator) {
"""
Generates a name for the KnowledgeBase.
@param storageName
@param separator
@return
"""
return storageName + separator + getClass().getSimpleName();
} | java | protected final String createKnowledgeBaseName(String storageName, String separator) {
return storageName + separator + getClass().getSimpleName();
} | [
"protected",
"final",
"String",
"createKnowledgeBaseName",
"(",
"String",
"storageName",
",",
"String",
"separator",
")",
"{",
"return",
"storageName",
"+",
"separator",
"+",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
";",
"}"
] | Generates a name for the KnowledgeBase.
@param storageName
@param separator
@return | [
"Generates",
"a",
"name",
"for",
"the",
"KnowledgeBase",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/common/abstracts/AbstractTrainer.java#L175-L177 |
kiegroup/jbpm | jbpm-services/jbpm-services-cdi/src/main/java/org/jbpm/services/cdi/impl/manager/InjectableRegisterableItemsFactory.java | InjectableRegisterableItemsFactory.getFactory | public static RegisterableItemsFactory getFactory(BeanManager beanManager, AuditEventBuilder eventBuilder) {
"""
Allows to create instance of this class dynamically via <code>BeanManager</code>. This is useful in case multiple
independent instances are required on runtime and that need cannot be satisfied with re... | java | public static RegisterableItemsFactory getFactory(BeanManager beanManager, AuditEventBuilder eventBuilder) {
InjectableRegisterableItemsFactory instance = getInstanceByType(beanManager, InjectableRegisterableItemsFactory.class, new Annotation[]{});
instance.setAuditBuilder(eventBuilder);
return ... | [
"public",
"static",
"RegisterableItemsFactory",
"getFactory",
"(",
"BeanManager",
"beanManager",
",",
"AuditEventBuilder",
"eventBuilder",
")",
"{",
"InjectableRegisterableItemsFactory",
"instance",
"=",
"getInstanceByType",
"(",
"beanManager",
",",
"InjectableRegisterableItems... | Allows to create instance of this class dynamically via <code>BeanManager</code>. This is useful in case multiple
independent instances are required on runtime and that need cannot be satisfied with regular CDI practices.
@param beanManager - bean manager instance of the container
@param eventBuilder - <code>AuditEvent... | [
"Allows",
"to",
"create",
"instance",
"of",
"this",
"class",
"dynamically",
"via",
"<code",
">",
"BeanManager<",
"/",
"code",
">",
".",
"This",
"is",
"useful",
"in",
"case",
"multiple",
"independent",
"instances",
"are",
"required",
"on",
"runtime",
"and",
"... | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-services/jbpm-services-cdi/src/main/java/org/jbpm/services/cdi/impl/manager/InjectableRegisterableItemsFactory.java#L321-L325 |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java | AbstractMessage.setHeaders | @Override
public void setHeaders(Map<String, String> headers) {
"""
Sets headers that will be sent with the message when the message gets delivered.
This completely replaces any existing headers already associated with this message.
Note that the given name/value pairs will be copied to an internal map.
If ... | java | @Override
public void setHeaders(Map<String, String> headers) {
if (headers == null || headers.isEmpty()) {
this._headers = null;
} else {
if (this._headers == null) {
this._headers = new HashMap<String, String>(headers);
} else {
/... | [
"@",
"Override",
"public",
"void",
"setHeaders",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"if",
"(",
"headers",
"==",
"null",
"||",
"headers",
".",
"isEmpty",
"(",
")",
")",
"{",
"this",
".",
"_headers",
"=",
"null",
";",
... | Sets headers that will be sent with the message when the message gets delivered.
This completely replaces any existing headers already associated with this message.
Note that the given name/value pairs will be copied to an internal map.
If the given map is null or empty, this message's internal map will be destroyed
an... | [
"Sets",
"headers",
"that",
"will",
"be",
"sent",
"with",
"the",
"message",
"when",
"the",
"message",
"gets",
"delivered",
".",
"This",
"completely",
"replaces",
"any",
"existing",
"headers",
"already",
"associated",
"with",
"this",
"message",
".",
"Note",
"tha... | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java#L236-L249 |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/AbstractHasTopLevelRules.java | AbstractHasTopLevelRules.addRule | @Nonnull
public AbstractHasTopLevelRules addRule (@Nonnegative final int nIndex, @Nonnull final ICSSTopLevelRule aRule) {
"""
Add a new top-level rule at the specified index. This method only considers
top-level rules and not <code>@import</code> and <code>@namespace</code>
rules!
@param nIndex
The index w... | java | @Nonnull
public AbstractHasTopLevelRules addRule (@Nonnegative final int nIndex, @Nonnull final ICSSTopLevelRule aRule)
{
ValueEnforcer.isGE0 (nIndex, "Index");
ValueEnforcer.notNull (aRule, "Rule");
if (nIndex >= getRuleCount ())
m_aRules.add (aRule);
else
m_aRules.add (nIndex, aRule);... | [
"@",
"Nonnull",
"public",
"AbstractHasTopLevelRules",
"addRule",
"(",
"@",
"Nonnegative",
"final",
"int",
"nIndex",
",",
"@",
"Nonnull",
"final",
"ICSSTopLevelRule",
"aRule",
")",
"{",
"ValueEnforcer",
".",
"isGE0",
"(",
"nIndex",
",",
"\"Index\"",
")",
";",
"... | Add a new top-level rule at the specified index. This method only considers
top-level rules and not <code>@import</code> and <code>@namespace</code>
rules!
@param nIndex
The index where the top-level rule should be added. Must be ≥ 0.
@param aRule
The rule to be added. May not be <code>null</code>.
@return this | [
"Add",
"a",
"new",
"top",
"-",
"level",
"rule",
"at",
"the",
"specified",
"index",
".",
"This",
"method",
"only",
"considers",
"top",
"-",
"level",
"rules",
"and",
"not",
"<code",
">",
"@import<",
"/",
"code",
">",
"and",
"<code",
">",
"@namespace<",
"... | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/AbstractHasTopLevelRules.java#L132-L143 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java | AbstractJsonDeserializer.getTypedParam | protected <A> A getTypedParam(String paramName, String errorMessage, Class<A> clazz, Map<String, Object> mapToUse)
throws IOException {
"""
Convenience method for subclasses.
@param paramName the name of the parameter
@param errorMessage the errormessage to add to the exception if the param does... | java | protected <A> A getTypedParam(String paramName, String errorMessage, Class<A> clazz, Map<String, Object> mapToUse)
throws IOException {
Object o = mapToUse.get(paramName);
if (o != null && clazz.isAssignableFrom(o.getClass())) {
return (A) o;
} else {
if (erro... | [
"protected",
"<",
"A",
">",
"A",
"getTypedParam",
"(",
"String",
"paramName",
",",
"String",
"errorMessage",
",",
"Class",
"<",
"A",
">",
"clazz",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"mapToUse",
")",
"throws",
"IOException",
"{",
"Object",
"o"... | Convenience method for subclasses.
@param paramName the name of the parameter
@param errorMessage the errormessage to add to the exception if the param does not exist.
@param clazz the class of the parameter that should be parsed.
@param mapToUse the map to use as inputparameter source
@param <A> ... | [
"Convenience",
"method",
"for",
"subclasses",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java#L274-L286 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.