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 |
|---|---|---|---|---|---|---|---|---|---|---|
infinispan/infinispan | core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java | ParseUtils.duplicateAttribute | public static XMLStreamException duplicateAttribute(final XMLStreamReader reader, final String name) {
"""
Get an exception reporting that an attribute of a given name has already
been declared in this scope.
@param reader the stream reader
@param name the name that was redeclared
@return the exception
"""... | java | public static XMLStreamException duplicateAttribute(final XMLStreamReader reader, final String name) {
return new XMLStreamException("An attribute named '" + name + "' has already been declared", reader.getLocation());
} | [
"public",
"static",
"XMLStreamException",
"duplicateAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"XMLStreamException",
"(",
"\"An attribute named '\"",
"+",
"name",
"+",
"\"' has already been declared\""... | Get an exception reporting that an attribute of a given name has already
been declared in this scope.
@param reader the stream reader
@param name the name that was redeclared
@return the exception | [
"Get",
"an",
"exception",
"reporting",
"that",
"an",
"attribute",
"of",
"a",
"given",
"name",
"has",
"already",
"been",
"declared",
"in",
"this",
"scope",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java#L154-L156 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java | DiagnosticsInner.getSiteDetectorResponseAsync | public Observable<DetectorResponseInner> getSiteDetectorResponseAsync(String resourceGroupName, String siteName, String detectorName) {
"""
Get site detector response.
Get site detector response.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@par... | java | public Observable<DetectorResponseInner> getSiteDetectorResponseAsync(String resourceGroupName, String siteName, String detectorName) {
return getSiteDetectorResponseWithServiceResponseAsync(resourceGroupName, siteName, detectorName).map(new Func1<ServiceResponse<DetectorResponseInner>, DetectorResponseInner>()... | [
"public",
"Observable",
"<",
"DetectorResponseInner",
">",
"getSiteDetectorResponseAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"detectorName",
")",
"{",
"return",
"getSiteDetectorResponseWithServiceResponseAsync",
"(",
"resourceGroupN... | Get site detector response.
Get site detector response.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param detectorName Detector Resource Name
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Detecto... | [
"Get",
"site",
"detector",
"response",
".",
"Get",
"site",
"detector",
"response",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java#L695-L702 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/PathBuilder.java | PathBuilder.get | @SuppressWarnings("unchecked")
public <A extends Comparable<?>> ComparablePath<A> get(ComparablePath<A> path) {
"""
Create a new Comparable typed path
@param <A>
@param path existing path
@return property path
"""
ComparablePath<A> newPath = getComparable(toString(path), (Class<A>) path.getTyp... | java | @SuppressWarnings("unchecked")
public <A extends Comparable<?>> ComparablePath<A> get(ComparablePath<A> path) {
ComparablePath<A> newPath = getComparable(toString(path), (Class<A>) path.getType());
return addMetadataOf(newPath, path);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"A",
"extends",
"Comparable",
"<",
"?",
">",
">",
"ComparablePath",
"<",
"A",
">",
"get",
"(",
"ComparablePath",
"<",
"A",
">",
"path",
")",
"{",
"ComparablePath",
"<",
"A",
">",
"newPath... | Create a new Comparable typed path
@param <A>
@param path existing path
@return property path | [
"Create",
"a",
"new",
"Comparable",
"typed",
"path"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/PathBuilder.java#L233-L237 |
undertow-io/undertow | core/src/main/java/io/undertow/server/Connectors.java | Connectors.ungetRequestBytes | public static void ungetRequestBytes(final HttpServerExchange exchange, PooledByteBuffer... buffers) {
"""
Attached buffered data to the exchange. The will generally be used to allow data to be re-read.
@param exchange The HTTP server exchange
@param buffers The buffers to attach
"""
PooledByteBuf... | java | public static void ungetRequestBytes(final HttpServerExchange exchange, PooledByteBuffer... buffers) {
PooledByteBuffer[] existing = exchange.getAttachment(HttpServerExchange.BUFFERED_REQUEST_DATA);
PooledByteBuffer[] newArray;
if (existing == null) {
newArray = new PooledByteBuffer[... | [
"public",
"static",
"void",
"ungetRequestBytes",
"(",
"final",
"HttpServerExchange",
"exchange",
",",
"PooledByteBuffer",
"...",
"buffers",
")",
"{",
"PooledByteBuffer",
"[",
"]",
"existing",
"=",
"exchange",
".",
"getAttachment",
"(",
"HttpServerExchange",
".",
"BU... | Attached buffered data to the exchange. The will generally be used to allow data to be re-read.
@param exchange The HTTP server exchange
@param buffers The buffers to attach | [
"Attached",
"buffered",
"data",
"to",
"the",
"exchange",
".",
"The",
"will",
"generally",
"be",
"used",
"to",
"allow",
"data",
"to",
"be",
"re",
"-",
"read",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/Connectors.java#L110-L123 |
BeholderTAF/beholder-selenium | src/main/java/br/ufmg/dcc/saotome/beholder/selenium/listener/ScreenshotListener.java | ScreenshotListener.createFile | private File createFile(ITestResult tr, File parentFolder) {
"""
Generate the file to save the screenshot taken.
@param tr Test Result
@param parentFolder Screenshot Folder
@return Screenshot Folder
"""
String path;
if (tr != null) { // tr is null only on tests purpose
path = String.format("%... | java | private File createFile(ITestResult tr, File parentFolder) {
String path;
if (tr != null) { // tr is null only on tests purpose
path = String.format("%s%c%s.png", parentFolder.getAbsolutePath(), File.separatorChar, tr.getName(), getDateSuffix());
} else {
path = String.format("%s%ctest_%d.png", parent... | [
"private",
"File",
"createFile",
"(",
"ITestResult",
"tr",
",",
"File",
"parentFolder",
")",
"{",
"String",
"path",
";",
"if",
"(",
"tr",
"!=",
"null",
")",
"{",
"// tr is null only on tests purpose",
"path",
"=",
"String",
".",
"format",
"(",
"\"%s%c%s.png\""... | Generate the file to save the screenshot taken.
@param tr Test Result
@param parentFolder Screenshot Folder
@return Screenshot Folder | [
"Generate",
"the",
"file",
"to",
"save",
"the",
"screenshot",
"taken",
"."
] | train | https://github.com/BeholderTAF/beholder-selenium/blob/8dc999e74a9c3f5c09e4e68ea0ef5634cdb760ee/src/main/java/br/ufmg/dcc/saotome/beholder/selenium/listener/ScreenshotListener.java#L133-L144 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java | ServletUtil.write | public static void write(HttpServletResponse response, String text, String contentType) {
"""
返回数据给客户端
@param response 响应对象{@link HttpServletResponse}
@param text 返回的内容
@param contentType 返回的类型
"""
response.setContentType(contentType);
Writer writer = null;
try {
writer = response.getWriter()... | java | public static void write(HttpServletResponse response, String text, String contentType) {
response.setContentType(contentType);
Writer writer = null;
try {
writer = response.getWriter();
writer.write(text);
writer.flush();
} catch (IOException e) {
throw new UtilException(e);
} finally {
... | [
"public",
"static",
"void",
"write",
"(",
"HttpServletResponse",
"response",
",",
"String",
"text",
",",
"String",
"contentType",
")",
"{",
"response",
".",
"setContentType",
"(",
"contentType",
")",
";",
"Writer",
"writer",
"=",
"null",
";",
"try",
"{",
"wr... | 返回数据给客户端
@param response 响应对象{@link HttpServletResponse}
@param text 返回的内容
@param contentType 返回的类型 | [
"返回数据给客户端"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java#L480-L492 |
twilio/twilio-java | src/main/java/com/twilio/rest/accounts/v1/credential/AwsReader.java | AwsReader.nextPage | @Override
public Page<Aws> nextPage(final Page<Aws> page,
final TwilioRestClient client) {
"""
Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page
"""
Request request... | java | @Override
public Page<Aws> nextPage(final Page<Aws> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domains.ACCOUNTS.toString(),
client.getRegion()
)
... | [
"@",
"Override",
"public",
"Page",
"<",
"Aws",
">",
"nextPage",
"(",
"final",
"Page",
"<",
"Aws",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
",",
"page",
... | Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page | [
"Retrieve",
"the",
"next",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/accounts/v1/credential/AwsReader.java#L79-L90 |
Red5/red5-server-common | src/main/java/org/red5/server/scope/Scope.java | Scope.from | public static Scope from(CompositeData cd) {
"""
Allows for reconstruction via CompositeData.
@param cd composite data
@return Scope class instance
"""
IScope parent = null;
ScopeType type = ScopeType.UNDEFINED;
String name = null;
boolean persistent = false;
if... | java | public static Scope from(CompositeData cd) {
IScope parent = null;
ScopeType type = ScopeType.UNDEFINED;
String name = null;
boolean persistent = false;
if (cd.containsKey("parent")) {
parent = (IScope) cd.get("parent");
}
if (cd.containsKey("t... | [
"public",
"static",
"Scope",
"from",
"(",
"CompositeData",
"cd",
")",
"{",
"IScope",
"parent",
"=",
"null",
";",
"ScopeType",
"type",
"=",
"ScopeType",
".",
"UNDEFINED",
";",
"String",
"name",
"=",
"null",
";",
"boolean",
"persistent",
"=",
"false",
";",
... | Allows for reconstruction via CompositeData.
@param cd composite data
@return Scope class instance | [
"Allows",
"for",
"reconstruction",
"via",
"CompositeData",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/scope/Scope.java#L1226-L1244 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java | Agg.minAll | public static <T extends Comparable<? super T>> Collector<T, ?, Seq<T>> minAll() {
"""
Get a {@link Collector} that calculates the <code>MIN()</code> function, producing multiple results.
"""
return minAllBy(t -> t, naturalOrder());
} | java | public static <T extends Comparable<? super T>> Collector<T, ?, Seq<T>> minAll() {
return minAllBy(t -> t, naturalOrder());
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
"super",
"T",
">",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Seq",
"<",
"T",
">",
">",
"minAll",
"(",
")",
"{",
"return",
"minAllBy",
"(",
"t",
"->",
"t",
",",
"naturalOrder",
"("... | Get a {@link Collector} that calculates the <code>MIN()</code> function, producing multiple results. | [
"Get",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java#L221-L223 |
bladecoder/blade-ink | src/main/java/com/bladecoder/ink/runtime/Story.java | Story.observeVariables | public void observeVariables(List<String> variableNames, VariableObserver observer)
throws StoryException, Exception {
"""
Convenience function to allow multiple variables to be observed with the same
observer delegate function. See the singular ObserveVariable for details. The
observer will get one call for ... | java | public void observeVariables(List<String> variableNames, VariableObserver observer)
throws StoryException, Exception {
for (String varName : variableNames) {
observeVariable(varName, observer);
}
} | [
"public",
"void",
"observeVariables",
"(",
"List",
"<",
"String",
">",
"variableNames",
",",
"VariableObserver",
"observer",
")",
"throws",
"StoryException",
",",
"Exception",
"{",
"for",
"(",
"String",
"varName",
":",
"variableNames",
")",
"{",
"observeVariable",... | Convenience function to allow multiple variables to be observed with the same
observer delegate function. See the singular ObserveVariable for details. The
observer will get one call for every variable that has changed.
@param variableNames
The set of variables to observe.
@param observer
The delegate function to call... | [
"Convenience",
"function",
"to",
"allow",
"multiple",
"variables",
"to",
"be",
"observed",
"with",
"the",
"same",
"observer",
"delegate",
"function",
".",
"See",
"the",
"singular",
"ObserveVariable",
"for",
"details",
".",
"The",
"observer",
"will",
"get",
"one"... | train | https://github.com/bladecoder/blade-ink/blob/930922099f7073f50f956479adaa3cbd47c70225/src/main/java/com/bladecoder/ink/runtime/Story.java#L1071-L1076 |
jblas-project/jblas | src/main/java/org/jblas/util/LibraryLoader.java | LibraryLoader.loadLibrary | public void loadLibrary(String libname, boolean withFlavor) {
"""
<p>Find the library <tt>libname</tt> as a resource, copy it to a tempfile
and load it using System.load(). The name of the library has to be the
base name, it is mapped to the corresponding system name using
System.mapLibraryName(). For example, ... | java | public void loadLibrary(String libname, boolean withFlavor) {
// preload flavor libraries
String flavor = null;
if (withFlavor) {
logger.debug("Preloading ArchFlavor library.");
flavor = ArchFlavor.archFlavor();
if (flavor != null && flavor.equals("sse2")) {
throw new Unsupp... | [
"public",
"void",
"loadLibrary",
"(",
"String",
"libname",
",",
"boolean",
"withFlavor",
")",
"{",
"// preload flavor libraries\r",
"String",
"flavor",
"=",
"null",
";",
"if",
"(",
"withFlavor",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Preloading ArchFlavor libra... | <p>Find the library <tt>libname</tt> as a resource, copy it to a tempfile
and load it using System.load(). The name of the library has to be the
base name, it is mapped to the corresponding system name using
System.mapLibraryName(). For example, the library "foo" is called "libfoo.so"
under Linux and "foo.dll" under Wi... | [
"<p",
">",
"Find",
"the",
"library",
"<tt",
">",
"libname<",
"/",
"tt",
">",
"as",
"a",
"resource",
"copy",
"it",
"to",
"a",
"tempfile",
"and",
"load",
"it",
"using",
"System",
".",
"load",
"()",
".",
"The",
"name",
"of",
"the",
"library",
"has",
"... | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/LibraryLoader.java#L146-L187 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/BlockPosUtils.java | BlockPosUtils.getAllInBox | public static Iterable<BlockPos> getAllInBox(AxisAlignedBB aabb) {
"""
Gets an iterable iterating through all the {@link BlockPos} intersecting the passed {@link AxisAlignedBB}.
@param aabb the aabb
@return the all in box
"""
return BlockPos.getAllInBox(new BlockPos(aabb.minX, aabb.minY, aabb.minZ),
... | java | public static Iterable<BlockPos> getAllInBox(AxisAlignedBB aabb)
{
return BlockPos.getAllInBox(new BlockPos(aabb.minX, aabb.minY, aabb.minZ),
new BlockPos(Math.ceil(aabb.maxX) - 1, Math.ceil(aabb.maxY) - 1, Math.ceil(aabb.maxZ) - 1));
} | [
"public",
"static",
"Iterable",
"<",
"BlockPos",
">",
"getAllInBox",
"(",
"AxisAlignedBB",
"aabb",
")",
"{",
"return",
"BlockPos",
".",
"getAllInBox",
"(",
"new",
"BlockPos",
"(",
"aabb",
".",
"minX",
",",
"aabb",
".",
"minY",
",",
"aabb",
".",
"minZ",
"... | Gets an iterable iterating through all the {@link BlockPos} intersecting the passed {@link AxisAlignedBB}.
@param aabb the aabb
@return the all in box | [
"Gets",
"an",
"iterable",
"iterating",
"through",
"all",
"the",
"{",
"@link",
"BlockPos",
"}",
"intersecting",
"the",
"passed",
"{",
"@link",
"AxisAlignedBB",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/BlockPosUtils.java#L77-L81 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java | LocalNetworkGatewaysInner.getByResourceGroup | public LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) {
"""
Gets the specified local network gateway in a resource group.
@param resourceGroupName The name of the resource group.
@param localNetworkGatewayName The name of the local network gateway.
@throw... | java | public LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().body();
} | [
"public",
"LocalNetworkGatewayInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"localNetworkGatewayName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"localNetworkGatewayName",
")",
".",
"toBlo... | Gets the specified local network gateway in a resource group.
@param resourceGroupName The name of the resource group.
@param localNetworkGatewayName The name of the local network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected... | [
"Gets",
"the",
"specified",
"local",
"network",
"gateway",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java#L285-L287 |
alibaba/ARouter | arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/utils/TypeUtils.java | TypeUtils.typeExchange | public int typeExchange(Element element) {
"""
Diagnostics out the true java type
@param element Raw type
@return Type class of java
"""
TypeMirror typeMirror = element.asType();
// Primitive
if (typeMirror.getKind().isPrimitive()) {
return element.asType().getKind().or... | java | public int typeExchange(Element element) {
TypeMirror typeMirror = element.asType();
// Primitive
if (typeMirror.getKind().isPrimitive()) {
return element.asType().getKind().ordinal();
}
switch (typeMirror.toString()) {
case BYTE:
return ... | [
"public",
"int",
"typeExchange",
"(",
"Element",
"element",
")",
"{",
"TypeMirror",
"typeMirror",
"=",
"element",
".",
"asType",
"(",
")",
";",
"// Primitive",
"if",
"(",
"typeMirror",
".",
"getKind",
"(",
")",
".",
"isPrimitive",
"(",
")",
")",
"{",
"re... | Diagnostics out the true java type
@param element Raw type
@return Type class of java | [
"Diagnostics",
"out",
"the",
"true",
"java",
"type"
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/utils/TypeUtils.java#L48-L87 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.isMonitorWait | public static boolean isMonitorWait(String methodName, String methodSig) {
"""
Determine if method whose name and signature is specified is a monitor
wait operation.
@param methodName
name of the method
@param methodSig
signature of the method
@return true if the method is a monitor wait, false if not
... | java | public static boolean isMonitorWait(String methodName, String methodSig) {
return "wait".equals(methodName) && ("()V".equals(methodSig) || "(J)V".equals(methodSig) || "(JI)V".equals(methodSig));
} | [
"public",
"static",
"boolean",
"isMonitorWait",
"(",
"String",
"methodName",
",",
"String",
"methodSig",
")",
"{",
"return",
"\"wait\"",
".",
"equals",
"(",
"methodName",
")",
"&&",
"(",
"\"()V\"",
".",
"equals",
"(",
"methodSig",
")",
"||",
"\"(J)V\"",
".",... | Determine if method whose name and signature is specified is a monitor
wait operation.
@param methodName
name of the method
@param methodSig
signature of the method
@return true if the method is a monitor wait, false if not | [
"Determine",
"if",
"method",
"whose",
"name",
"and",
"signature",
"is",
"specified",
"is",
"a",
"monitor",
"wait",
"operation",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L151-L153 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java | CmsXmlContentPropertyHelper.getUriForId | public static String getUriForId(CmsObject cms, CmsUUID id) throws CmsException {
"""
Returns a sitemap or VFS path given a sitemap entry id or structure id.<p>
This method first tries to read a sitemap entry with the given id. If this succeeds,
the sitemap entry's sitemap path will be returned. If it fails, t... | java | public static String getUriForId(CmsObject cms, CmsUUID id) throws CmsException {
CmsResource res = cms.readResource(id);
return cms.getSitePath(res);
} | [
"public",
"static",
"String",
"getUriForId",
"(",
"CmsObject",
"cms",
",",
"CmsUUID",
"id",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"res",
"=",
"cms",
".",
"readResource",
"(",
"id",
")",
";",
"return",
"cms",
".",
"getSitePath",
"(",
"res",
")"... | Returns a sitemap or VFS path given a sitemap entry id or structure id.<p>
This method first tries to read a sitemap entry with the given id. If this succeeds,
the sitemap entry's sitemap path will be returned. If it fails, the method interprets
the id as a structure id and tries to read the corresponding resource, an... | [
"Returns",
"a",
"sitemap",
"or",
"VFS",
"path",
"given",
"a",
"sitemap",
"entry",
"id",
"or",
"structure",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java#L352-L356 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/DoubleStream.java | DoubleStream.scan | @NotNull
public DoubleStream scan(final double identity,
@NotNull final DoubleBinaryOperator accumulator) {
"""
Returns a {@code DoubleStream} produced by iterative application of a accumulation function
to an initial element {@code identity} and next element of the current stream... | java | @NotNull
public DoubleStream scan(final double identity,
@NotNull final DoubleBinaryOperator accumulator) {
Objects.requireNonNull(accumulator);
return new DoubleStream(params, new DoubleScanIdentity(iterator, identity, accumulator));
} | [
"@",
"NotNull",
"public",
"DoubleStream",
"scan",
"(",
"final",
"double",
"identity",
",",
"@",
"NotNull",
"final",
"DoubleBinaryOperator",
"accumulator",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"accumulator",
")",
";",
"return",
"new",
"DoubleStream",
... | Returns a {@code DoubleStream} produced by iterative application of a accumulation function
to an initial element {@code identity} and next element of the current stream.
Produces a {@code DoubleStream} consisting of {@code identity}, {@code acc(identity, value1)},
{@code acc(acc(identity, value1), value2)}, etc.
<p>T... | [
"Returns",
"a",
"{",
"@code",
"DoubleStream",
"}",
"produced",
"by",
"iterative",
"application",
"of",
"a",
"accumulation",
"function",
"to",
"an",
"initial",
"element",
"{",
"@code",
"identity",
"}",
"and",
"next",
"element",
"of",
"the",
"current",
"stream",... | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/DoubleStream.java#L674-L679 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java | ZooKeeper.getChildren | public List<String> getChildren(final String path, Watcher watcher)
throws KeeperException, InterruptedException {
"""
Return the list of the children of the node of the given path.
<p>
If the watch is non-null and the call is successful (no exception is
thrown), a watch will be left on the node wit... | java | public List<String> getChildren(final String path, Watcher watcher)
throws KeeperException, InterruptedException {
verbotenThreadCheck();
final String clientPath = path;
PathUtils.validatePath(clientPath);
// the watch contains the un-chroot path
WatchRegistration wc... | [
"public",
"List",
"<",
"String",
">",
"getChildren",
"(",
"final",
"String",
"path",
",",
"Watcher",
"watcher",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"verbotenThreadCheck",
"(",
")",
";",
"final",
"String",
"clientPath",
"=",
"path"... | Return the list of the children of the node of the given path.
<p>
If the watch is non-null and the call is successful (no exception is
thrown), a watch will be left on the node with the given path. The watch
willbe triggered by a successful operation that deletes the node of the
given path or creates/delete a child un... | [
"Return",
"the",
"list",
"of",
"the",
"children",
"of",
"the",
"node",
"of",
"the",
"given",
"path",
".",
"<p",
">",
"If",
"the",
"watch",
"is",
"non",
"-",
"null",
"and",
"the",
"call",
"is",
"successful",
"(",
"no",
"exception",
"is",
"thrown",
")"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java#L1284-L1310 |
mlhartme/sushi | src/main/java/net/oneandone/sushi/fs/http/Proxy.java | Proxy.forPropertiesOpt | public static Proxy forPropertiesOpt(String prefix) {
"""
configures a proxy from properties; if prefix is http or https you get standard system properties
https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html
@param prefix is usually the protocol - http or https
"""
String... | java | public static Proxy forPropertiesOpt(String prefix) {
String host;
String port;
Proxy result;
host = System.getProperty(prefix + ".proxyHost");
if (host == null) {
return null;
}
port = System.getProperty(prefix + ".proxyPort");
if (port == nu... | [
"public",
"static",
"Proxy",
"forPropertiesOpt",
"(",
"String",
"prefix",
")",
"{",
"String",
"host",
";",
"String",
"port",
";",
"Proxy",
"result",
";",
"host",
"=",
"System",
".",
"getProperty",
"(",
"prefix",
"+",
"\".proxyHost\"",
")",
";",
"if",
"(",
... | configures a proxy from properties; if prefix is http or https you get standard system properties
https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html
@param prefix is usually the protocol - http or https | [
"configures",
"a",
"proxy",
"from",
"properties",
";",
"if",
"prefix",
"is",
"http",
"or",
"https",
"you",
"get",
"standard",
"system",
"properties",
"https",
":",
"//",
"docs",
".",
"oracle",
".",
"com",
"/",
"javase",
"/",
"8",
"/",
"docs",
"/",
"api... | train | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/fs/http/Proxy.java#L33-L49 |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java | SQLiteUpdateTaskHelper.getAllTables | public static Map<String, String> getAllTables(SQLiteDatabase db) {
"""
Retrieve all table as a Map of (name, sql).
@param db
the db
@return the all tables
"""
final Map<String, String> result = new LinkedHashMap<>();
query(db, null, QueryType.TABLE, new OnResultListener() {
@Override
public v... | java | public static Map<String, String> getAllTables(SQLiteDatabase db) {
final Map<String, String> result = new LinkedHashMap<>();
query(db, null, QueryType.TABLE, new OnResultListener() {
@Override
public void onRow(SQLiteDatabase db, String name, String sql) {
if (StringUtils.hasText(sql)) {
result.pu... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getAllTables",
"(",
"SQLiteDatabase",
"db",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"result",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"query",
"(",
"db",
",",... | Retrieve all table as a Map of (name, sql).
@param db
the db
@return the all tables | [
"Retrieve",
"all",
"table",
"as",
"a",
"Map",
"of",
"(",
"name",
"sql",
")",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/SQLiteUpdateTaskHelper.java#L137-L151 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.rollDateTime | public static java.util.Date rollDateTime(java.util.Date startDate, int period, int amount) {
"""
Roll the java.util.Date forward or backward.
@param startDate - The start date
@param period Calendar.YEAR etc
@param amount - Negative to rollbackwards.
"""
GregorianCalendar gc = new GregorianCalend... | java | public static java.util.Date rollDateTime(java.util.Date startDate, int period, int amount) {
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(startDate);
gc.add(period, amount);
return new java.util.Date(gc.getTime().getTime());
} | [
"public",
"static",
"java",
".",
"util",
".",
"Date",
"rollDateTime",
"(",
"java",
".",
"util",
".",
"Date",
"startDate",
",",
"int",
"period",
",",
"int",
"amount",
")",
"{",
"GregorianCalendar",
"gc",
"=",
"new",
"GregorianCalendar",
"(",
")",
";",
"gc... | Roll the java.util.Date forward or backward.
@param startDate - The start date
@param period Calendar.YEAR etc
@param amount - Negative to rollbackwards. | [
"Roll",
"the",
"java",
".",
"util",
".",
"Date",
"forward",
"or",
"backward",
"."
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L155-L160 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/DynamicDoubleArray.java | DynamicDoubleArray.setValue | public void setValue( int position, double value ) {
"""
Safe set the value in a certain position.
<p>If the array is smaller than the position, the array is extended and substituted.</p>
@param position the index in which to set the value.
@param value the value to set.
"""
if (position >= inte... | java | public void setValue( int position, double value ) {
if (position >= internalArray.length) {
double[] newArray = new double[position + growingSize];
System.arraycopy(internalArray, 0, newArray, 0, internalArray.length);
internalArray = newArray;
}
internalArra... | [
"public",
"void",
"setValue",
"(",
"int",
"position",
",",
"double",
"value",
")",
"{",
"if",
"(",
"position",
">=",
"internalArray",
".",
"length",
")",
"{",
"double",
"[",
"]",
"newArray",
"=",
"new",
"double",
"[",
"position",
"+",
"growingSize",
"]",... | Safe set the value in a certain position.
<p>If the array is smaller than the position, the array is extended and substituted.</p>
@param position the index in which to set the value.
@param value the value to set. | [
"Safe",
"set",
"the",
"value",
"in",
"a",
"certain",
"position",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/DynamicDoubleArray.java#L61-L69 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFileWidgetRenderer.java | WFileWidgetRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WFileWidget.
@param component the WFileWidget to paint.
@param renderContext the RenderContext to paint to.
"""
WFileWidget fileWidget = (WFileWidget) component;
XmlStringBuilder ... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WFileWidget fileWidget = (WFileWidget) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = fileWidget.isReadOnly();
xml.appendTagOpen(TAG_NAME);
xml.appendAttribute("id", compone... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WFileWidget",
"fileWidget",
"=",
"(",
"WFileWidget",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"re... | Paints the given WFileWidget.
@param component the WFileWidget to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WFileWidget",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFileWidgetRenderer.java#L29-L61 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsInner.java | LabAccountsInner.getRegionalAvailability | public GetRegionalAvailabilityResponseInner getRegionalAvailability(String resourceGroupName, String labAccountName) {
"""
Get regional availability information for each size category configured under a lab account.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the ... | java | public GetRegionalAvailabilityResponseInner getRegionalAvailability(String resourceGroupName, String labAccountName) {
return getRegionalAvailabilityWithServiceResponseAsync(resourceGroupName, labAccountName).toBlocking().single().body();
} | [
"public",
"GetRegionalAvailabilityResponseInner",
"getRegionalAvailability",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
")",
"{",
"return",
"getRegionalAvailabilityWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"labAccountName",
")",
".",
"t... | Get regional availability information for each size category configured under a lab account.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request... | [
"Get",
"regional",
"availability",
"information",
"for",
"each",
"size",
"category",
"configured",
"under",
"a",
"lab",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsInner.java#L1211-L1213 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileUtil.java | FileUtil.chmod | public static int chmod(String filename, String perm
) throws IOException, InterruptedException {
"""
Change the permissions on a filename.
@param filename the name of the file to change
@param perm the permission string
@return the exit code from the command
@throws IOException
@thr... | java | public static int chmod(String filename, String perm
) throws IOException, InterruptedException {
return chmod(filename, perm, false);
} | [
"public",
"static",
"int",
"chmod",
"(",
"String",
"filename",
",",
"String",
"perm",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"return",
"chmod",
"(",
"filename",
",",
"perm",
",",
"false",
")",
";",
"}"
] | Change the permissions on a filename.
@param filename the name of the file to change
@param perm the permission string
@return the exit code from the command
@throws IOException
@throws InterruptedException | [
"Change",
"the",
"permissions",
"on",
"a",
"filename",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileUtil.java#L741-L744 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/BizwifiAPI.java | BizwifiAPI.statisticsList | public static StatisticsListResult statisticsList(String accessToken, StatisticsList statisticsList) {
"""
Wi-Fi数据统计
查询一定时间范围内的WiFi连接总人数、微信方式连Wi-Fi人数、商家主页访问人数、连网后消息发送人数、新增公众号关注人数和累计公众号关注人数。
查询的最长时间跨度为30天。
@param accessToken accessToken
@param statisticsList statisticsList
@return StatisticsListResult
... | java | public static StatisticsListResult statisticsList(String accessToken, StatisticsList statisticsList) {
return statisticsList(accessToken, JsonUtil.toJSONString(statisticsList));
} | [
"public",
"static",
"StatisticsListResult",
"statisticsList",
"(",
"String",
"accessToken",
",",
"StatisticsList",
"statisticsList",
")",
"{",
"return",
"statisticsList",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"statisticsList",
")",
")",
";",
... | Wi-Fi数据统计
查询一定时间范围内的WiFi连接总人数、微信方式连Wi-Fi人数、商家主页访问人数、连网后消息发送人数、新增公众号关注人数和累计公众号关注人数。
查询的最长时间跨度为30天。
@param accessToken accessToken
@param statisticsList statisticsList
@return StatisticsListResult | [
"Wi",
"-",
"Fi数据统计",
"查询一定时间范围内的WiFi连接总人数、微信方式连Wi",
"-",
"Fi人数、商家主页访问人数、连网后消息发送人数、新增公众号关注人数和累计公众号关注人数。",
"查询的最长时间跨度为30天。"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/BizwifiAPI.java#L609-L611 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.globStatus | public FileStatus[] globStatus(Path pathPattern, PathFilter filter)
throws IOException {
"""
Return an array of FileStatus objects whose path names match pathPattern
and is accepted by the user-supplied path filter. Results are sorted by
their path names.
Return null if pathPattern has no glob and the pat... | java | public FileStatus[] globStatus(Path pathPattern, PathFilter filter)
throws IOException {
String filename = pathPattern.toUri().getPath();
List<String> filePatterns = GlobExpander.expand(filename);
if (filePatterns.size() == 1) {
return globStatusInternal(pathPattern, filter);
} else {
... | [
"public",
"FileStatus",
"[",
"]",
"globStatus",
"(",
"Path",
"pathPattern",
",",
"PathFilter",
"filter",
")",
"throws",
"IOException",
"{",
"String",
"filename",
"=",
"pathPattern",
".",
"toUri",
"(",
")",
".",
"getPath",
"(",
")",
";",
"List",
"<",
"Strin... | Return an array of FileStatus objects whose path names match pathPattern
and is accepted by the user-supplied path filter. Results are sorted by
their path names.
Return null if pathPattern has no glob and the path does not exist.
Return an empty array if pathPattern has a glob and no path matches it.
@param pathPatte... | [
"Return",
"an",
"array",
"of",
"FileStatus",
"objects",
"whose",
"path",
"names",
"match",
"pathPattern",
"and",
"is",
"accepted",
"by",
"the",
"user",
"-",
"supplied",
"path",
"filter",
".",
"Results",
"are",
"sorted",
"by",
"their",
"path",
"names",
".",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L1333-L1349 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseInt | public static int parseInt (@Nullable final String sStr, @Nonnegative final int nRadix, final int nDefault) {
"""
Parse the given {@link String} as int with the specified radix.
@param sStr
The String to parse. May be <code>null</code>.
@param nRadix
The radix to use. Must be ≥ {@link Character#MIN_RADIX}... | java | public static int parseInt (@Nullable final String sStr, @Nonnegative final int nRadix, final int nDefault)
{
if (sStr != null && sStr.length () > 0)
try
{
return Integer.parseInt (sStr, nRadix);
}
catch (final NumberFormatException ex)
{
// Fall through
}
r... | [
"public",
"static",
"int",
"parseInt",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nonnegative",
"final",
"int",
"nRadix",
",",
"final",
"int",
"nDefault",
")",
"{",
"if",
"(",
"sStr",
"!=",
"null",
"&&",
"sStr",
".",
"length",
"(",
")"... | Parse the given {@link String} as int with the specified radix.
@param sStr
The String to parse. May be <code>null</code>.
@param nRadix
The radix to use. Must be ≥ {@link Character#MIN_RADIX} and ≤
{@link Character#MAX_RADIX}.
@param nDefault
The value to be returned if the string cannot be converted to a
valid... | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"int",
"with",
"the",
"specified",
"radix",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L766-L778 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/range/DateRangeRandomizer.java | DateRangeRandomizer.aNewDateRangeRandomizer | public static DateRangeRandomizer aNewDateRangeRandomizer(final Date min, final Date max, final long seed) {
"""
Create a new {@link DateRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link DateRangeRandomizer}.
"""
return new DateRangeRandom... | java | public static DateRangeRandomizer aNewDateRangeRandomizer(final Date min, final Date max, final long seed) {
return new DateRangeRandomizer(min, max, seed);
} | [
"public",
"static",
"DateRangeRandomizer",
"aNewDateRangeRandomizer",
"(",
"final",
"Date",
"min",
",",
"final",
"Date",
"max",
",",
"final",
"long",
"seed",
")",
"{",
"return",
"new",
"DateRangeRandomizer",
"(",
"min",
",",
"max",
",",
"seed",
")",
";",
"}"... | Create a new {@link DateRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link DateRangeRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"DateRangeRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/DateRangeRandomizer.java#L76-L78 |
forge/core | ui/api/src/main/java/org/jboss/forge/addon/ui/util/Categories.java | Categories.create | public static UICategory create(String... categories) {
"""
Produce a hierarchical {@link UICategory} instance from the given sub-category names.
"""
if (categories == null || categories.length == 0)
{
return new UICategoryImpl(DEFAULT, null);
}
else if (categories.length == 1)... | java | public static UICategory create(String... categories)
{
if (categories == null || categories.length == 0)
{
return new UICategoryImpl(DEFAULT, null);
}
else if (categories.length == 1)
{
return new UICategoryImpl(categories[0], null);
}
else
{
... | [
"public",
"static",
"UICategory",
"create",
"(",
"String",
"...",
"categories",
")",
"{",
"if",
"(",
"categories",
"==",
"null",
"||",
"categories",
".",
"length",
"==",
"0",
")",
"{",
"return",
"new",
"UICategoryImpl",
"(",
"DEFAULT",
",",
"null",
")",
... | Produce a hierarchical {@link UICategory} instance from the given sub-category names. | [
"Produce",
"a",
"hierarchical",
"{"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/ui/api/src/main/java/org/jboss/forge/addon/ui/util/Categories.java#L51-L66 |
CloudSlang/cs-actions | cs-json/src/main/java/io/cloudslang/content/json/actions/GetValueFromObject.java | GetValueFromObject.execute | @Action(name = "Get Value from Object",
outputs = {
"""
This operation accepts an object in the JavaScript Object Notation format (JSON) and returns a value for the specified key.
@param object The string representation of a JSON object.
Objects in JSON are a collection of name value pairs, separat... | java | @Action(name = "Get Value from Object",
outputs = {
@Output(OutputNames.RETURN_RESULT),
@Output(OutputNames.RETURN_CODE),
@Output(OutputNames.EXCEPTION)
},
responses = {
@Response(text = ResponseNames.SUC... | [
"@",
"Action",
"(",
"name",
"=",
"\"Get Value from Object\"",
",",
"outputs",
"=",
"{",
"@",
"Output",
"(",
"OutputNames",
".",
"RETURN_RESULT",
")",
",",
"@",
"Output",
"(",
"OutputNames",
".",
"RETURN_CODE",
")",
",",
"@",
"Output",
"(",
"OutputNames",
"... | This operation accepts an object in the JavaScript Object Notation format (JSON) and returns a value for the specified key.
@param object The string representation of a JSON object.
Objects in JSON are a collection of name value pairs, separated by a colon and surrounded with curly brackets {}.
The name must be a stri... | [
"This",
"operation",
"accepts",
"an",
"object",
"in",
"the",
"JavaScript",
"Object",
"Notation",
"format",
"(",
"JSON",
")",
"and",
"returns",
"a",
"value",
"for",
"the",
"specified",
"key",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-json/src/main/java/io/cloudslang/content/json/actions/GetValueFromObject.java#L65-L110 |
mike10004/common-helper | ormlite-helper/src/main/java/com/github/mike10004/common/dbhelp/ConnectionParams.java | ConnectionParams.copy | public ConnectionParams copy() {
"""
Constructs a new object that copies the fields from this instance.
@return the new object
"""
ConnectionParams copy = new ConnectionParams(host, username, password, schema);
return copy;
} | java | public ConnectionParams copy() {
ConnectionParams copy = new ConnectionParams(host, username, password, schema);
return copy;
} | [
"public",
"ConnectionParams",
"copy",
"(",
")",
"{",
"ConnectionParams",
"copy",
"=",
"new",
"ConnectionParams",
"(",
"host",
",",
"username",
",",
"password",
",",
"schema",
")",
";",
"return",
"copy",
";",
"}"
] | Constructs a new object that copies the fields from this instance.
@return the new object | [
"Constructs",
"a",
"new",
"object",
"that",
"copies",
"the",
"fields",
"from",
"this",
"instance",
"."
] | train | https://github.com/mike10004/common-helper/blob/744f82d9b0768a9ad9c63a57a37ab2c93bf408f4/ormlite-helper/src/main/java/com/github/mike10004/common/dbhelp/ConnectionParams.java#L111-L114 |
google/closure-templates | java/src/com/google/template/soy/basetree/MixinParentNode.java | MixinParentNode.replaceChild | public void replaceChild(int index, N newChild) {
"""
Replaces the child at the given index with the given new child.
@param index The index of the child to replace.
@param newChild The new child.
"""
checkNotNull(newChild);
tryRemoveFromOldParent(newChild);
N oldChild = children.set(index, new... | java | public void replaceChild(int index, N newChild) {
checkNotNull(newChild);
tryRemoveFromOldParent(newChild);
N oldChild = children.set(index, newChild);
oldChild.setParent(null);
newChild.setParent(master);
} | [
"public",
"void",
"replaceChild",
"(",
"int",
"index",
",",
"N",
"newChild",
")",
"{",
"checkNotNull",
"(",
"newChild",
")",
";",
"tryRemoveFromOldParent",
"(",
"newChild",
")",
";",
"N",
"oldChild",
"=",
"children",
".",
"set",
"(",
"index",
",",
"newChil... | Replaces the child at the given index with the given new child.
@param index The index of the child to replace.
@param newChild The new child. | [
"Replaces",
"the",
"child",
"at",
"the",
"given",
"index",
"with",
"the",
"given",
"new",
"child",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/basetree/MixinParentNode.java#L164-L170 |
aws/aws-sdk-java | aws-java-sdk-logs/src/main/java/com/amazonaws/services/logs/model/TagLogGroupRequest.java | TagLogGroupRequest.withTags | public TagLogGroupRequest withTags(java.util.Map<String, String> tags) {
"""
<p>
The key-value pairs to use for the tags.
</p>
@param tags
The key-value pairs to use for the tags.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
... | java | public TagLogGroupRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"TagLogGroupRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The key-value pairs to use for the tags.
</p>
@param tags
The key-value pairs to use for the tags.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"key",
"-",
"value",
"pairs",
"to",
"use",
"for",
"the",
"tags",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-logs/src/main/java/com/amazonaws/services/logs/model/TagLogGroupRequest.java#L119-L122 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/LocalVariable.java | LocalVariable.store | private Statement store(final Expression expr, final Optional<Label> firstVarInstruction) {
"""
Writes the value at the top of the stack to the local variable.
"""
expr.checkAssignableTo(resultType());
return new Statement() {
@Override
protected void doGen(CodeBuilder adapter) {
ex... | java | private Statement store(final Expression expr, final Optional<Label> firstVarInstruction) {
expr.checkAssignableTo(resultType());
return new Statement() {
@Override
protected void doGen(CodeBuilder adapter) {
expr.gen(adapter);
if (firstVarInstruction.isPresent()) {
adapter... | [
"private",
"Statement",
"store",
"(",
"final",
"Expression",
"expr",
",",
"final",
"Optional",
"<",
"Label",
">",
"firstVarInstruction",
")",
"{",
"expr",
".",
"checkAssignableTo",
"(",
"resultType",
"(",
")",
")",
";",
"return",
"new",
"Statement",
"(",
")"... | Writes the value at the top of the stack to the local variable. | [
"Writes",
"the",
"value",
"at",
"the",
"top",
"of",
"the",
"stack",
"to",
"the",
"local",
"variable",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/LocalVariable.java#L146-L158 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java | Results.addStatsError | public void addStatsError(boolean moreResultAvailable) {
"""
Indicate that result is an Error, to set appropriate results.
@param moreResultAvailable indicate if other results (ResultSet or updateCount) are available.
"""
if (cmdInformation == null) {
if (batch) {
cmdInformation = new CmdI... | java | public void addStatsError(boolean moreResultAvailable) {
if (cmdInformation == null) {
if (batch) {
cmdInformation = new CmdInformationBatch(expectedSize, autoIncrement);
} else if (moreResultAvailable) {
cmdInformation = new CmdInformationMultiple(expectedSize, autoIncrement);
} e... | [
"public",
"void",
"addStatsError",
"(",
"boolean",
"moreResultAvailable",
")",
"{",
"if",
"(",
"cmdInformation",
"==",
"null",
")",
"{",
"if",
"(",
"batch",
")",
"{",
"cmdInformation",
"=",
"new",
"CmdInformationBatch",
"(",
"expectedSize",
",",
"autoIncrement",... | Indicate that result is an Error, to set appropriate results.
@param moreResultAvailable indicate if other results (ResultSet or updateCount) are available. | [
"Indicate",
"that",
"result",
"is",
"an",
"Error",
"to",
"set",
"appropriate",
"results",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java#L193-L205 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBObjectMapper.java | CouchDBObjectMapper.setFieldValue | private static void setFieldValue(Object entity, Attribute column, JsonElement value) {
"""
Sets the field value.
@param entity
the entity
@param column
the column
@param value
the value
"""
if (column.getJavaType().isAssignableFrom(byte[].class))
{
PropertyAccessorHelper.se... | java | private static void setFieldValue(Object entity, Attribute column, JsonElement value)
{
if (column.getJavaType().isAssignableFrom(byte[].class))
{
PropertyAccessorHelper.set(entity, (Field) column.getJavaMember(),
PropertyAccessorFactory.STRING.toBytes(value.getAsStri... | [
"private",
"static",
"void",
"setFieldValue",
"(",
"Object",
"entity",
",",
"Attribute",
"column",
",",
"JsonElement",
"value",
")",
"{",
"if",
"(",
"column",
".",
"getJavaType",
"(",
")",
".",
"isAssignableFrom",
"(",
"byte",
"[",
"]",
".",
"class",
")",
... | Sets the field value.
@param entity
the entity
@param column
the column
@param value
the value | [
"Sets",
"the",
"field",
"value",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBObjectMapper.java#L361-L376 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.cumprod | public SDVariable cumprod(String name, SDVariable in, boolean exclusive, boolean reverse, int... axis) {
"""
Cumulative product operation.<br>
For input: [ a, b, c], output is:<br>
exclusize=false, reverse=false: [a, a*b, a*b*c]<br>
exclusive=true, reverse=false, [0, a, a*b]<br>
exclusive=false, reverse=true: ... | java | public SDVariable cumprod(String name, SDVariable in, boolean exclusive, boolean reverse, int... axis) {
validateNumerical("cumprod", in);
SDVariable ret = f().cumprod(in, exclusive, reverse, axis);
return updateVariableNameAndReference(ret, name);
} | [
"public",
"SDVariable",
"cumprod",
"(",
"String",
"name",
",",
"SDVariable",
"in",
",",
"boolean",
"exclusive",
",",
"boolean",
"reverse",
",",
"int",
"...",
"axis",
")",
"{",
"validateNumerical",
"(",
"\"cumprod\"",
",",
"in",
")",
";",
"SDVariable",
"ret",... | Cumulative product operation.<br>
For input: [ a, b, c], output is:<br>
exclusize=false, reverse=false: [a, a*b, a*b*c]<br>
exclusive=true, reverse=false, [0, a, a*b]<br>
exclusive=false, reverse=true: [a*b*c, b*c, c]<br>
exclusive=true, reverse=true: [b*c, c, 0]<br><br>
@param name Name of the output variable
@p... | [
"Cumulative",
"product",
"operation",
".",
"<br",
">",
"For",
"input",
":",
"[",
"a",
"b",
"c",
"]",
"output",
"is",
":",
"<br",
">",
"exclusize",
"=",
"false",
"reverse",
"=",
"false",
":",
"[",
"a",
"a",
"*",
"b",
"a",
"*",
"b",
"*",
"c",
"]"... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L326-L330 |
DDTH/ddth-queue | ddth-queue-core/src/main/java/com/github/ddth/queue/impl/AbstractQueueFactory.java | AbstractQueueFactory.initQueue | protected void initQueue(T queue, QueueSpec spec) throws Exception {
"""
Initializes a newly created queue instance.
<p>
Called by {@link #createAndInitQueue(QueueSpec)}. Sub-class may override
this method to implement its own business logic.
</p>
@param queue
@param spec
"""
queue.setObserve... | java | protected void initQueue(T queue, QueueSpec spec) throws Exception {
queue.setObserver(defaultObserver);
queue.init();
} | [
"protected",
"void",
"initQueue",
"(",
"T",
"queue",
",",
"QueueSpec",
"spec",
")",
"throws",
"Exception",
"{",
"queue",
".",
"setObserver",
"(",
"defaultObserver",
")",
";",
"queue",
".",
"init",
"(",
")",
";",
"}"
] | Initializes a newly created queue instance.
<p>
Called by {@link #createAndInitQueue(QueueSpec)}. Sub-class may override
this method to implement its own business logic.
</p>
@param queue
@param spec | [
"Initializes",
"a",
"newly",
"created",
"queue",
"instance",
"."
] | train | https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/AbstractQueueFactory.java#L169-L172 |
glookast/commons-timecode | src/main/java/com/glookast/commons/timecode/TimecodeDuration.java | TimecodeDuration.valueOf | public static TimecodeDuration valueOf(String timecode, int timecodeBase, StringType stringType) throws IllegalArgumentException {
"""
Returns a TimecodeDuration instance for given timecode string and timecode base.
What is considered acceptable input varies per selected StringType
@param timecode
@param time... | java | public static TimecodeDuration valueOf(String timecode, int timecodeBase, StringType stringType) throws IllegalArgumentException
{
TimecodeDuration tc = new TimecodeDuration();
return (TimecodeDuration) tc.parse(timecode, timecodeBase, stringType);
} | [
"public",
"static",
"TimecodeDuration",
"valueOf",
"(",
"String",
"timecode",
",",
"int",
"timecodeBase",
",",
"StringType",
"stringType",
")",
"throws",
"IllegalArgumentException",
"{",
"TimecodeDuration",
"tc",
"=",
"new",
"TimecodeDuration",
"(",
")",
";",
"retur... | Returns a TimecodeDuration instance for given timecode string and timecode base.
What is considered acceptable input varies per selected StringType
@param timecode
@param timecodeBase
@param stringType
@return the TimecodeDuration
@throws IllegalArgumentException | [
"Returns",
"a",
"TimecodeDuration",
"instance",
"for",
"given",
"timecode",
"string",
"and",
"timecode",
"base",
".",
"What",
"is",
"considered",
"acceptable",
"input",
"varies",
"per",
"selected",
"StringType"
] | train | https://github.com/glookast/commons-timecode/blob/ec2f682a51d1cc435d0b42d80de48ff15adb4ee8/src/main/java/com/glookast/commons/timecode/TimecodeDuration.java#L114-L118 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.readCertificate | public static Certificate readCertificate(String type, InputStream in) {
"""
读取Certification文件<br>
Certification为证书文件<br>
see: http://snowolf.iteye.com/blog/391931
@param type 类型,例如X.509
@param in {@link InputStream} 如果想从文件读取.cer文件,使用 {@link FileUtil#getInputStream(java.io.File)} 读取
@return {@link Certifica... | java | public static Certificate readCertificate(String type, InputStream in) {
return KeyUtil.readCertificate(type, in);
} | [
"public",
"static",
"Certificate",
"readCertificate",
"(",
"String",
"type",
",",
"InputStream",
"in",
")",
"{",
"return",
"KeyUtil",
".",
"readCertificate",
"(",
"type",
",",
"in",
")",
";",
"}"
] | 读取Certification文件<br>
Certification为证书文件<br>
see: http://snowolf.iteye.com/blog/391931
@param type 类型,例如X.509
@param in {@link InputStream} 如果想从文件读取.cer文件,使用 {@link FileUtil#getInputStream(java.io.File)} 读取
@return {@link Certificate} | [
"读取Certification文件<br",
">",
"Certification为证书文件<br",
">",
"see",
":",
"http",
":",
"//",
"snowolf",
".",
"iteye",
".",
"com",
"/",
"blog",
"/",
"391931"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L377-L379 |
xwiki/xwiki-commons | xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java | XARMojo.generatePackageXml | private void generatePackageXml(File packageFile, Collection<ArchiveEntry> files) throws Exception {
"""
Create and add package configuration file to the package.
@param packageFile the package when to add configuration file.
@param files the files in the package.
@throws Exception error when writing the conf... | java | private void generatePackageXml(File packageFile, Collection<ArchiveEntry> files) throws Exception
{
getLog().info(String.format("Generating package.xml descriptor at [%s]", packageFile.getPath()));
OutputFormat outputFormat = new OutputFormat("", true);
outputFormat.setEncoding(this.encodi... | [
"private",
"void",
"generatePackageXml",
"(",
"File",
"packageFile",
",",
"Collection",
"<",
"ArchiveEntry",
">",
"files",
")",
"throws",
"Exception",
"{",
"getLog",
"(",
")",
".",
"info",
"(",
"String",
".",
"format",
"(",
"\"Generating package.xml descriptor at ... | Create and add package configuration file to the package.
@param packageFile the package when to add configuration file.
@param files the files in the package.
@throws Exception error when writing the configuration file. | [
"Create",
"and",
"add",
"package",
"configuration",
"file",
"to",
"the",
"package",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-xar/xwiki-commons-tool-xar-plugin/src/main/java/org/xwiki/tool/xar/XARMojo.java#L281-L292 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/TdeCertificatesInner.java | TdeCertificatesInner.beginCreate | public void beginCreate(String resourceGroupName, String serverName, TdeCertificateInner parameters) {
"""
Creates a TDE certificate for a given server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal... | java | public void beginCreate(String resourceGroupName, String serverName, TdeCertificateInner parameters) {
beginCreateWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"TdeCertificateInner",
"parameters",
")",
"{",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"parameters",
")",
".",
"toBloc... | Creates a TDE certificate for a given server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param parameters The requested TDE certificate to be created or updat... | [
"Creates",
"a",
"TDE",
"certificate",
"for",
"a",
"given",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/TdeCertificatesInner.java#L152-L154 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java | TypeAnnotationPosition.constructorInvocationTypeArg | public static TypeAnnotationPosition
constructorInvocationTypeArg(final List<TypePathEntry> location,
final int type_index) {
"""
Create a {@code TypeAnnotationPosition} for a constructor
invocation type argument.
@param location The type path.
@param type_index Th... | java | public static TypeAnnotationPosition
constructorInvocationTypeArg(final List<TypePathEntry> location,
final int type_index) {
return constructorInvocationTypeArg(location, null, type_index, -1);
} | [
"public",
"static",
"TypeAnnotationPosition",
"constructorInvocationTypeArg",
"(",
"final",
"List",
"<",
"TypePathEntry",
">",
"location",
",",
"final",
"int",
"type_index",
")",
"{",
"return",
"constructorInvocationTypeArg",
"(",
"location",
",",
"null",
",",
"type_i... | Create a {@code TypeAnnotationPosition} for a constructor
invocation type argument.
@param location The type path.
@param type_index The index of the type argument. | [
"Create",
"a",
"{",
"@code",
"TypeAnnotationPosition",
"}",
"for",
"a",
"constructor",
"invocation",
"type",
"argument",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java#L944-L948 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.repairCategories | public void repairCategories(CmsDbContext dbc, CmsUUID projectId, CmsResource resource) throws CmsException {
"""
Repairs broken categories.<p>
@param dbc the database context
@param projectId the project id
@param resource the resource to repair the categories for
@throws CmsException if something goes wr... | java | public void repairCategories(CmsDbContext dbc, CmsUUID projectId, CmsResource resource) throws CmsException {
CmsObject cms = OpenCms.initCmsObject(new CmsObject(getSecurityManager(), dbc.getRequestContext()));
cms.getRequestContext().setSiteRoot("");
cms.getRequestContext().setCurrentProject(r... | [
"public",
"void",
"repairCategories",
"(",
"CmsDbContext",
"dbc",
",",
"CmsUUID",
"projectId",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"CmsObject",
"cms",
"=",
"OpenCms",
".",
"initCmsObject",
"(",
"new",
"CmsObject",
"(",
"getSecurityM... | Repairs broken categories.<p>
@param dbc the database context
@param projectId the project id
@param resource the resource to repair the categories for
@throws CmsException if something goes wrong | [
"Repairs",
"broken",
"categories",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L8371-L8377 |
osiam/connector4java | src/main/java/org/osiam/client/OsiamGroupService.java | OsiamGroupService.updateGroup | @Deprecated
Group updateGroup(String id, Group group, AccessToken accessToken) {
"""
See {@link OsiamConnector#updateGroup(String, UpdateGroup, AccessToken)}
@deprecated Updating with PATCH has been removed in OSIAM 3.0. This method is going to go away with version 1.12 or 2.0.
"""
return update... | java | @Deprecated
Group updateGroup(String id, Group group, AccessToken accessToken) {
return updateResource(id, group, accessToken);
} | [
"@",
"Deprecated",
"Group",
"updateGroup",
"(",
"String",
"id",
",",
"Group",
"group",
",",
"AccessToken",
"accessToken",
")",
"{",
"return",
"updateResource",
"(",
"id",
",",
"group",
",",
"accessToken",
")",
";",
"}"
] | See {@link OsiamConnector#updateGroup(String, UpdateGroup, AccessToken)}
@deprecated Updating with PATCH has been removed in OSIAM 3.0. This method is going to go away with version 1.12 or 2.0. | [
"See",
"{",
"@link",
"OsiamConnector#updateGroup",
"(",
"String",
"UpdateGroup",
"AccessToken",
")",
"}"
] | train | https://github.com/osiam/connector4java/blob/a5e6ae1e706f4889d662a069fe2f3bf8e3848d12/src/main/java/org/osiam/client/OsiamGroupService.java#L96-L99 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java | ResourceManager.registerJobMasterInternal | private RegistrationResponse registerJobMasterInternal(
final JobMasterGateway jobMasterGateway,
JobID jobId,
String jobManagerAddress,
ResourceID jobManagerResourceId) {
"""
Registers a new JobMaster.
@param jobMasterGateway to communicate with the registering JobMaster
@param jobId of the job for whi... | java | private RegistrationResponse registerJobMasterInternal(
final JobMasterGateway jobMasterGateway,
JobID jobId,
String jobManagerAddress,
ResourceID jobManagerResourceId) {
if (jobManagerRegistrations.containsKey(jobId)) {
JobManagerRegistration oldJobManagerRegistration = jobManagerRegistrations.get(jobId);... | [
"private",
"RegistrationResponse",
"registerJobMasterInternal",
"(",
"final",
"JobMasterGateway",
"jobMasterGateway",
",",
"JobID",
"jobId",
",",
"String",
"jobManagerAddress",
",",
"ResourceID",
"jobManagerResourceId",
")",
"{",
"if",
"(",
"jobManagerRegistrations",
".",
... | Registers a new JobMaster.
@param jobMasterGateway to communicate with the registering JobMaster
@param jobId of the job for which the JobMaster is responsible
@param jobManagerAddress address of the JobMaster
@param jobManagerResourceId ResourceID of the JobMaster
@return RegistrationResponse | [
"Registers",
"a",
"new",
"JobMaster",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java#L620-L671 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/common/lib/utils/XmlFieldExtractor.java | XmlFieldExtractor.extract | @Nullable
private String extract(Document doc, String field) throws XPathExpressionException {
"""
Runs a wildcard xpath (i.e. "//field") to locate the provided field in the
document and returns the text content of the first matching node.
@param doc Document to process.
@param field Field to look for.
@re... | java | @Nullable
private String extract(Document doc, String field) throws XPathExpressionException {
XPathExpression expr = xpathSupplier.get().compile("//" + field);
NodeList nl = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
if (nl.getLength() > 0) {
return nl.item(0).getTextContent();
}
... | [
"@",
"Nullable",
"private",
"String",
"extract",
"(",
"Document",
"doc",
",",
"String",
"field",
")",
"throws",
"XPathExpressionException",
"{",
"XPathExpression",
"expr",
"=",
"xpathSupplier",
".",
"get",
"(",
")",
".",
"compile",
"(",
"\"//\"",
"+",
"field",... | Runs a wildcard xpath (i.e. "//field") to locate the provided field in the
document and returns the text content of the first matching node.
@param doc Document to process.
@param field Field to look for.
@return Text content of first matching node or null for no match.
@throws XPathExpressionException If expression i... | [
"Runs",
"a",
"wildcard",
"xpath",
"(",
"i",
".",
"e",
".",
"//",
"field",
")",
"to",
"locate",
"the",
"provided",
"field",
"in",
"the",
"document",
"and",
"returns",
"the",
"text",
"content",
"of",
"the",
"first",
"matching",
"node",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/utils/XmlFieldExtractor.java#L106-L114 |
SUSE/salt-netapi-client | src/main/java/com/suse/salt/netapi/calls/LocalCall.java | LocalCall.callSync | public CompletionStage<List<Map<String, Result<R>>>> callSync(final SaltClient client, Target<?> target,
AuthMethod auth, Optional<Batch> batch) {
"""
Calls a execution module function on the given target with batching and
synchronously waits for the result. Authentication is done with the token
ther... | java | public CompletionStage<List<Map<String, Result<R>>>> callSync(final SaltClient client, Target<?> target,
AuthMethod auth, Optional<Batch> batch) {
return callSyncHelperNonBlock(client, target, auth, batch);
} | [
"public",
"CompletionStage",
"<",
"List",
"<",
"Map",
"<",
"String",
",",
"Result",
"<",
"R",
">",
">",
">",
">",
"callSync",
"(",
"final",
"SaltClient",
"client",
",",
"Target",
"<",
"?",
">",
"target",
",",
"AuthMethod",
"auth",
",",
"Optional",
"<",... | Calls a execution module function on the given target with batching and
synchronously waits for the result. Authentication is done with the token
therefore you have to login prior to using this function.
@param client SaltClient instance
@param target the target for the function
@param auth authentication credentials ... | [
"Calls",
"a",
"execution",
"module",
"function",
"on",
"the",
"given",
"target",
"with",
"batching",
"and",
"synchronously",
"waits",
"for",
"the",
"result",
".",
"Authentication",
"is",
"done",
"with",
"the",
"token",
"therefore",
"you",
"have",
"to",
"login"... | train | https://github.com/SUSE/salt-netapi-client/blob/a0bdf643c8e34fa4def4b915366594c1491fdad5/src/main/java/com/suse/salt/netapi/calls/LocalCall.java#L367-L370 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.setMatrix | public static void setMatrix(final double[][] m1, final int[] r, final int c0, final int c1, final double[][] m2) {
"""
Set a submatrix.
@param m1 Input matrix
@param r Array of row indices.
@param c0 Initial column index
@param c1 Final column index (exclusive)
@param m2 New values for m1(r(:),c0:c1-1)
... | java | public static void setMatrix(final double[][] m1, final int[] r, final int c0, final int c1, final double[][] m2) {
assert c0 <= c1 : ERR_INVALID_RANGE;
assert c1 <= m1[0].length : ERR_MATRIX_DIMENSIONS;
for(int i = 0; i < r.length; i++) {
System.arraycopy(m2[i], 0, m1[r[i]], c0, c1 - c0);
}
} | [
"public",
"static",
"void",
"setMatrix",
"(",
"final",
"double",
"[",
"]",
"[",
"]",
"m1",
",",
"final",
"int",
"[",
"]",
"r",
",",
"final",
"int",
"c0",
",",
"final",
"int",
"c1",
",",
"final",
"double",
"[",
"]",
"[",
"]",
"m2",
")",
"{",
"as... | Set a submatrix.
@param m1 Input matrix
@param r Array of row indices.
@param c0 Initial column index
@param c1 Final column index (exclusive)
@param m2 New values for m1(r(:),c0:c1-1) | [
"Set",
"a",
"submatrix",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L1032-L1038 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.addRelationToResource | public void addRelationToResource(CmsResource resource, CmsResource target, String type) throws CmsException {
"""
Adds a new relation to the given resource.<p>
@param resource the source resource
@param target the target resource
@param type the type of the relation
@throws CmsException if something goes ... | java | public void addRelationToResource(CmsResource resource, CmsResource target, String type) throws CmsException {
createRelation(resource, target, type, false);
} | [
"public",
"void",
"addRelationToResource",
"(",
"CmsResource",
"resource",
",",
"CmsResource",
"target",
",",
"String",
"type",
")",
"throws",
"CmsException",
"{",
"createRelation",
"(",
"resource",
",",
"target",
",",
"type",
",",
"false",
")",
";",
"}"
] | Adds a new relation to the given resource.<p>
@param resource the source resource
@param target the target resource
@param type the type of the relation
@throws CmsException if something goes wrong | [
"Adds",
"a",
"new",
"relation",
"to",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L132-L135 |
jhunters/jprotobuf | android/src/main/java/com/baidu/bjf/remoting/protobuf/utils/StringUtils.java | StringUtils.removeStartIgnoreCase | public static String removeStartIgnoreCase(String str, String remove) {
"""
<p>
Case insensitive removal of a substring if it is at the begining of a
source string, otherwise returns the source string.
</p>
<p>
A <code>null</code> source string will return <code>null</code>. An empty
("") source string wil... | java | public static String removeStartIgnoreCase(String str, String remove) {
if (isEmpty(str) || isEmpty(remove)) {
return str;
}
if (startsWithIgnoreCase(str, remove)) {
return str.substring(remove.length());
}
return str;
} | [
"public",
"static",
"String",
"removeStartIgnoreCase",
"(",
"String",
"str",
",",
"String",
"remove",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"str",
")",
"||",
"isEmpty",
"(",
"remove",
")",
")",
"{",
"return",
"str",
";",
"}",
"if",
"(",
"startsWithIgnoreC... | <p>
Case insensitive removal of a substring if it is at the begining of a
source string, otherwise returns the source string.
</p>
<p>
A <code>null</code> source string will return <code>null</code>. An empty
("") source string will return the empty string. A <code>null</code>
search string will return the source stri... | [
"<p",
">",
"Case",
"insensitive",
"removal",
"of",
"a",
"substring",
"if",
"it",
"is",
"at",
"the",
"begining",
"of",
"a",
"source",
"string",
"otherwise",
"returns",
"the",
"source",
"string",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/android/src/main/java/com/baidu/bjf/remoting/protobuf/utils/StringUtils.java#L307-L315 |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/CipherUtils.java | CipherUtils.deserializePrivateKey | public static PrivateKey deserializePrivateKey(byte[] keyData, String algorithm) {
"""
converts a byte[] that originally was created using {@link PrivateKey#getEncoded()} back to the corresponding
instance.
Example: CipherUtils.deserializePrivateKey(data, "RSA")
"""
LOGGER.trace("deserialize privat... | java | public static PrivateKey deserializePrivateKey(byte[] keyData, String algorithm) {
LOGGER.trace("deserialize private key from data using algorithm \"{}\"", algorithm);
PKCS8EncodedKeySpec privSpec = new PKCS8EncodedKeySpec(keyData);
try {
KeyFactory keyFactory = KeyFactory.getInstanc... | [
"public",
"static",
"PrivateKey",
"deserializePrivateKey",
"(",
"byte",
"[",
"]",
"keyData",
",",
"String",
"algorithm",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"deserialize private key from data using algorithm \\\"{}\\\"\"",
",",
"algorithm",
")",
";",
"PKCS8EncodedK... | converts a byte[] that originally was created using {@link PrivateKey#getEncoded()} back to the corresponding
instance.
Example: CipherUtils.deserializePrivateKey(data, "RSA") | [
"converts",
"a",
"byte",
"[]",
"that",
"originally",
"was",
"created",
"using",
"{",
"@link",
"PrivateKey#getEncoded",
"()",
"}",
"back",
"to",
"the",
"corresponding",
"instance",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/CipherUtils.java#L145-L155 |
EdwardRaff/JSAT | JSAT/src/jsat/distributions/discrete/Zipf.java | Zipf.setSkew | public void setSkew(double skew) {
"""
Sets the skewness of the distribution. Lower values spread out the
probability distribution, while higher values concentrate on the lowest
ranks.
@param skew the positive value for the distribution's skew
"""
if(skew <= 0 || Double.isNaN(skew) || Double.isInf... | java | public void setSkew(double skew)
{
if(skew <= 0 || Double.isNaN(skew) || Double.isInfinite(skew))
throw new IllegalArgumentException("Skew must be a positive value, not " + skew);
this.skew = skew;
fixCache();
} | [
"public",
"void",
"setSkew",
"(",
"double",
"skew",
")",
"{",
"if",
"(",
"skew",
"<=",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"skew",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"skew",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Sk... | Sets the skewness of the distribution. Lower values spread out the
probability distribution, while higher values concentrate on the lowest
ranks.
@param skew the positive value for the distribution's skew | [
"Sets",
"the",
"skewness",
"of",
"the",
"distribution",
".",
"Lower",
"values",
"spread",
"out",
"the",
"probability",
"distribution",
"while",
"higher",
"values",
"concentrate",
"on",
"the",
"lowest",
"ranks",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/discrete/Zipf.java#L111-L117 |
knowm/XChange | xchange-bitmarket/src/main/java/org/knowm/xchange/bitmarket/BitMarketAdapters.java | BitMarketAdapters.adaptTicker | public static Ticker adaptTicker(BitMarketTicker bitMarketTicker, CurrencyPair currencyPair) {
"""
Adapts BitMarket ticker to Ticker.
@param bitMarketTicker
@param currencyPair
@return
"""
BigDecimal bid = bitMarketTicker.getBid();
BigDecimal ask = bitMarketTicker.getAsk();
BigDecimal high = ... | java | public static Ticker adaptTicker(BitMarketTicker bitMarketTicker, CurrencyPair currencyPair) {
BigDecimal bid = bitMarketTicker.getBid();
BigDecimal ask = bitMarketTicker.getAsk();
BigDecimal high = bitMarketTicker.getHigh();
BigDecimal low = bitMarketTicker.getLow();
BigDecimal volume = bitMarketT... | [
"public",
"static",
"Ticker",
"adaptTicker",
"(",
"BitMarketTicker",
"bitMarketTicker",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"BigDecimal",
"bid",
"=",
"bitMarketTicker",
".",
"getBid",
"(",
")",
";",
"BigDecimal",
"ask",
"=",
"bitMarketTicker",
".",
"get... | Adapts BitMarket ticker to Ticker.
@param bitMarketTicker
@param currencyPair
@return | [
"Adapts",
"BitMarket",
"ticker",
"to",
"Ticker",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-bitmarket/src/main/java/org/knowm/xchange/bitmarket/BitMarketAdapters.java#L67-L87 |
allure-framework/allure-java | allure-java-commons/src/main/java/io/qameta/allure/AllureLifecycle.java | AllureLifecycle.startStep | public void startStep(final String parentUuid, final String uuid, final StepResult result) {
"""
Start a new step as child of specified parent.
@param parentUuid the uuid of parent test case or step.
@param uuid the uuid of step.
@param result the step.
"""
notifier.beforeStepStart(resul... | java | public void startStep(final String parentUuid, final String uuid, final StepResult result) {
notifier.beforeStepStart(result);
result.setStage(Stage.RUNNING);
result.setStart(System.currentTimeMillis());
threadContext.start(uuid);
storage.put(uuid, result);
storage.get... | [
"public",
"void",
"startStep",
"(",
"final",
"String",
"parentUuid",
",",
"final",
"String",
"uuid",
",",
"final",
"StepResult",
"result",
")",
"{",
"notifier",
".",
"beforeStepStart",
"(",
"result",
")",
";",
"result",
".",
"setStage",
"(",
"Stage",
".",
... | Start a new step as child of specified parent.
@param parentUuid the uuid of parent test case or step.
@param uuid the uuid of step.
@param result the step. | [
"Start",
"a",
"new",
"step",
"as",
"child",
"of",
"specified",
"parent",
"."
] | train | https://github.com/allure-framework/allure-java/blob/64015ca2b789aa6f7b19c793f1512e2f11d0174e/allure-java-commons/src/main/java/io/qameta/allure/AllureLifecycle.java#L471-L487 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java | CPDefinitionOptionValueRelPersistenceImpl.findAll | @Override
public List<CPDefinitionOptionValueRel> findAll(int start, int end) {
"""
Returns a range of all the cp definition option value rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are in... | java | @Override
public List<CPDefinitionOptionValueRel> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionValueRel",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp definition option value rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definition",
"option",
"value",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java#L4654-L4657 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/EnumType.java | EnumType.defineElement | public boolean defineElement(String name, Node definingNode) {
"""
Defines a new element on this enum.
@param name the name of the new element
@param definingNode the {@code Node} that defines this new element
@return true iff the new element is added successfully
"""
elements.add(name);
return defi... | java | public boolean defineElement(String name, Node definingNode) {
elements.add(name);
return defineDeclaredProperty(name, elementsType, definingNode);
} | [
"public",
"boolean",
"defineElement",
"(",
"String",
"name",
",",
"Node",
"definingNode",
")",
"{",
"elements",
".",
"add",
"(",
"name",
")",
";",
"return",
"defineDeclaredProperty",
"(",
"name",
",",
"elementsType",
",",
"definingNode",
")",
";",
"}"
] | Defines a new element on this enum.
@param name the name of the new element
@param definingNode the {@code Node} that defines this new element
@return true iff the new element is added successfully | [
"Defines",
"a",
"new",
"element",
"on",
"this",
"enum",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/EnumType.java#L100-L103 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java | XGlobalAttributeNameMap.mapSafely | public String mapSafely(String attributeKey, String mappingName) {
"""
Maps an attribute safely, using the given attribute mapping.
Safe mapping attempts to map the attribute using the given
mapping first. If this does not succeed, the standard mapping
(EN) will be used for mapping. If no mapping is available i... | java | public String mapSafely(String attributeKey, String mappingName) {
return mapSafely(attributeKey, mappings.get(mappingName));
} | [
"public",
"String",
"mapSafely",
"(",
"String",
"attributeKey",
",",
"String",
"mappingName",
")",
"{",
"return",
"mapSafely",
"(",
"attributeKey",
",",
"mappings",
".",
"get",
"(",
"mappingName",
")",
")",
";",
"}"
] | Maps an attribute safely, using the given attribute mapping.
Safe mapping attempts to map the attribute using the given
mapping first. If this does not succeed, the standard mapping
(EN) will be used for mapping. If no mapping is available in
the standard mapping, the original attribute key is returned
unchanged. This ... | [
"Maps",
"an",
"attribute",
"safely",
"using",
"the",
"given",
"attribute",
"mapping",
".",
"Safe",
"mapping",
"attempts",
"to",
"map",
"the",
"attribute",
"using",
"the",
"given",
"mapping",
"first",
".",
"If",
"this",
"does",
"not",
"succeed",
"the",
"stand... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/info/XGlobalAttributeNameMap.java#L259-L261 |
andriusvelykis/reflow-maven-skin | reflow-velocity-tools/src/main/java/lt/velykis/maven/skins/reflow/HtmlTool.java | HtmlTool.ensureHeadingIds | public String ensureHeadingIds(String content, String idSeparator) {
"""
Transforms the given HTML content by adding IDs to all heading elements ({@code h1-6}) that
do not have one.
<p>
IDs on heading elements are used to indicate positions within a HTML page in HTML5. If a
heading tag without an {@code id} is... | java | public String ensureHeadingIds(String content, String idSeparator) {
Element body = parseContent(content);
// first find all existing IDs (to avoid generating duplicates)
List<Element> idElems = body.select("*[id]");
Set<String> ids = new HashSet<String>();
boolean modified = false;
for (Element idElem ... | [
"public",
"String",
"ensureHeadingIds",
"(",
"String",
"content",
",",
"String",
"idSeparator",
")",
"{",
"Element",
"body",
"=",
"parseContent",
"(",
"content",
")",
";",
"// first find all existing IDs (to avoid generating duplicates)",
"List",
"<",
"Element",
">",
... | Transforms the given HTML content by adding IDs to all heading elements ({@code h1-6}) that
do not have one.
<p>
IDs on heading elements are used to indicate positions within a HTML page in HTML5. If a
heading tag without an {@code id} is found, its "slug" is generated automatically based on
the heading contents and us... | [
"Transforms",
"the",
"given",
"HTML",
"content",
"by",
"adding",
"IDs",
"to",
"all",
"heading",
"elements",
"(",
"{",
"@code",
"h1",
"-",
"6",
"}",
")",
"that",
"do",
"not",
"have",
"one",
".",
"<p",
">",
"IDs",
"on",
"heading",
"elements",
"are",
"u... | train | https://github.com/andriusvelykis/reflow-maven-skin/blob/01170ae1426a1adfe7cc9c199e77aaa2ecb37ef2/reflow-velocity-tools/src/main/java/lt/velykis/maven/skins/reflow/HtmlTool.java#L1013-L1055 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/util/DroolsStreamUtils.java | DroolsStreamUtils.streamIn | public static Object streamIn(byte[] bytes, ClassLoader classLoader, boolean compressed)
throws IOException, ClassNotFoundException {
"""
This method reads the contents from the given byte array and returns the object. The contents in the given
buffer could be compressed or uncompressed depending on ... | java | public static Object streamIn(byte[] bytes, ClassLoader classLoader, boolean compressed)
throws IOException, ClassNotFoundException {
return streamIn(new ByteArrayInputStream(bytes), classLoader, compressed);
} | [
"public",
"static",
"Object",
"streamIn",
"(",
"byte",
"[",
"]",
"bytes",
",",
"ClassLoader",
"classLoader",
",",
"boolean",
"compressed",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"streamIn",
"(",
"new",
"ByteArrayInputStream",
"... | This method reads the contents from the given byte array and returns the object. The contents in the given
buffer could be compressed or uncompressed depending on the given flag. It is assumed that the content
stream was written by the corresponding streamOut methods of this class.
@param bytes
@param classLoader
@pa... | [
"This",
"method",
"reads",
"the",
"contents",
"from",
"the",
"given",
"byte",
"array",
"and",
"returns",
"the",
"object",
".",
"The",
"contents",
"in",
"the",
"given",
"buffer",
"could",
"be",
"compressed",
"or",
"uncompressed",
"depending",
"on",
"the",
"gi... | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/util/DroolsStreamUtils.java#L159-L162 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/support/HibernateVersionSupport.java | HibernateVersionSupport.createQuery | @Deprecated
public static Query createQuery(Session session, String query) {
"""
Creates a query
@param session The session
@param query The query
@return The created query
@deprecated Previously used for Hibernate backwards, will be removed in a future release.
"""
return session.createQuery... | java | @Deprecated
public static Query createQuery(Session session, String query) {
return session.createQuery(query);
} | [
"@",
"Deprecated",
"public",
"static",
"Query",
"createQuery",
"(",
"Session",
"session",
",",
"String",
"query",
")",
"{",
"return",
"session",
".",
"createQuery",
"(",
"query",
")",
";",
"}"
] | Creates a query
@param session The session
@param query The query
@return The created query
@deprecated Previously used for Hibernate backwards, will be removed in a future release. | [
"Creates",
"a",
"query"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/support/HibernateVersionSupport.java#L85-L88 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/servlet/ServletBeanContext.java | ServletBeanContext.getResourceAsStream | public InputStream getResourceAsStream(String name, BeanContextChild bcc)
throws IllegalArgumentException {
"""
Override BeanContext.getResourceAsStream() so it delegates to the current ServletContext.
@param name the resource name
@param bcc the specified child
@return an <code>InputStream</code> for... | java | public InputStream getResourceAsStream(String name, BeanContextChild bcc)
throws IllegalArgumentException
{
ServletContext sc = getServletContext();
if ( sc != null )
return sc.getResourceAsStream( name );
return null;
} | [
"public",
"InputStream",
"getResourceAsStream",
"(",
"String",
"name",
",",
"BeanContextChild",
"bcc",
")",
"throws",
"IllegalArgumentException",
"{",
"ServletContext",
"sc",
"=",
"getServletContext",
"(",
")",
";",
"if",
"(",
"sc",
"!=",
"null",
")",
"return",
... | Override BeanContext.getResourceAsStream() so it delegates to the current ServletContext.
@param name the resource name
@param bcc the specified child
@return an <code>InputStream</code> for reading the resource, or
<code>null</code> if the resource could not be found.
@throws IllegalArgumentException <code>IllegalArg... | [
"Override",
"BeanContext",
".",
"getResourceAsStream",
"()",
"so",
"it",
"delegates",
"to",
"the",
"current",
"ServletContext",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/servlet/ServletBeanContext.java#L191-L199 |
UrielCh/ovh-java-sdk | ovh-java-sdk-saascsp2/src/main/java/net/minidev/ovh/api/ApiOvhSaascsp2.java | ApiOvhSaascsp2.serviceName_changeAdministratorPassword_POST | public OvhOfficeTask serviceName_changeAdministratorPassword_POST(String serviceName, String newPassword) throws IOException {
"""
Changes the tenant administrator's password
REST: POST /saas/csp2/{serviceName}/changeAdministratorPassword
@param newPassword [required] New password for the tenant administrator
... | java | public OvhOfficeTask serviceName_changeAdministratorPassword_POST(String serviceName, String newPassword) throws IOException {
String qPath = "/saas/csp2/{serviceName}/changeAdministratorPassword";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, ... | [
"public",
"OvhOfficeTask",
"serviceName_changeAdministratorPassword_POST",
"(",
"String",
"serviceName",
",",
"String",
"newPassword",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/saas/csp2/{serviceName}/changeAdministratorPassword\"",
";",
"StringBuilder",
"s... | Changes the tenant administrator's password
REST: POST /saas/csp2/{serviceName}/changeAdministratorPassword
@param newPassword [required] New password for the tenant administrator
@param serviceName [required] The unique identifier of your Office service
API beta | [
"Changes",
"the",
"tenant",
"administrator",
"s",
"password"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-saascsp2/src/main/java/net/minidev/ovh/api/ApiOvhSaascsp2.java#L254-L261 |
riversun/d6 | src/main/java/org/riversun/d6/core/D6Crud.java | D6Crud.execInsertIgnoreDuplicate | public boolean execInsertIgnoreDuplicate(D6Model[] modelObjects) {
"""
Insert the specified model object into the DB ignoring duplicated entry
@param modelObjects
@return true:DB operation success false:failure
"""
final D6Inex includeExcludeColumnNames = null;
return execInsert(modelObjects, inclu... | java | public boolean execInsertIgnoreDuplicate(D6Model[] modelObjects) {
final D6Inex includeExcludeColumnNames = null;
return execInsert(modelObjects, includeExcludeColumnNames, true);
} | [
"public",
"boolean",
"execInsertIgnoreDuplicate",
"(",
"D6Model",
"[",
"]",
"modelObjects",
")",
"{",
"final",
"D6Inex",
"includeExcludeColumnNames",
"=",
"null",
";",
"return",
"execInsert",
"(",
"modelObjects",
",",
"includeExcludeColumnNames",
",",
"true",
")",
"... | Insert the specified model object into the DB ignoring duplicated entry
@param modelObjects
@return true:DB operation success false:failure | [
"Insert",
"the",
"specified",
"model",
"object",
"into",
"the",
"DB",
"ignoring",
"duplicated",
"entry"
] | train | https://github.com/riversun/d6/blob/2798bd876b9380dbfea8182d11ad306cb1b0e114/src/main/java/org/riversun/d6/core/D6Crud.java#L489-L492 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Element.java | Element.getElementsByAttributeValueMatching | public Elements getElementsByAttributeValueMatching(String key, Pattern pattern) {
"""
Find elements that have attributes whose values match the supplied regular expression.
@param key name of the attribute
@param pattern compiled regular expression to match against attribute values
@return elements that have a... | java | public Elements getElementsByAttributeValueMatching(String key, Pattern pattern) {
return Collector.collect(new Evaluator.AttributeWithValueMatching(key, pattern), this);
} | [
"public",
"Elements",
"getElementsByAttributeValueMatching",
"(",
"String",
"key",
",",
"Pattern",
"pattern",
")",
"{",
"return",
"Collector",
".",
"collect",
"(",
"new",
"Evaluator",
".",
"AttributeWithValueMatching",
"(",
"key",
",",
"pattern",
")",
",",
"this",... | Find elements that have attributes whose values match the supplied regular expression.
@param key name of the attribute
@param pattern compiled regular expression to match against attribute values
@return elements that have attributes matching this regular expression | [
"Find",
"elements",
"that",
"have",
"attributes",
"whose",
"values",
"match",
"the",
"supplied",
"regular",
"expression",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Element.java#L917-L920 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java | ClassesManager.mapperClassName | public static String mapperClassName(Class<?> destination, Class<?> source, String resource) {
"""
Returns the name of mapper that identifies the destination and source classes.
@param destination class of Destination
@param source class of Source
@param resource a resource that represents an xml path or a co... | java | public static String mapperClassName(Class<?> destination, Class<?> source, String resource){
String className = destination.getName().replaceAll("\\.","") + source.getName().replaceAll("\\.","");
if(isEmpty(resource))
return className;
if(!isPath(resource))
return write(className, String.... | [
"public",
"static",
"String",
"mapperClassName",
"(",
"Class",
"<",
"?",
">",
"destination",
",",
"Class",
"<",
"?",
">",
"source",
",",
"String",
"resource",
")",
"{",
"String",
"className",
"=",
"destination",
".",
"getName",
"(",
")",
".",
"replaceAll",... | Returns the name of mapper that identifies the destination and source classes.
@param destination class of Destination
@param source class of Source
@param resource a resource that represents an xml path or a content
@return Returns a string containing the names of the classes passed as input | [
"Returns",
"the",
"name",
"of",
"mapper",
"that",
"identifies",
"the",
"destination",
"and",
"source",
"classes",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java#L371-L385 |
rythmengine/rythmengine | src/main/java/org/rythmengine/toString/ToStringStyle.java | ToStringStyle.appendClassName | protected void appendClassName(StringBuilder buffer, Object object) {
"""
<p>Append to the <code>toString</code> the class name.</p>
@param buffer the <code>StringBuilder</code> to populate
@param object the <code>Object</code> whose name to output
"""
if (useClassName && object != null) {
... | java | protected void appendClassName(StringBuilder buffer, Object object) {
if (useClassName && object != null) {
register(object);
if (useShortClassName) {
buffer.append(getShortClassName(object.getClass()));
} else {
buffer.append(object.getClass()... | [
"protected",
"void",
"appendClassName",
"(",
"StringBuilder",
"buffer",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"useClassName",
"&&",
"object",
"!=",
"null",
")",
"{",
"register",
"(",
"object",
")",
";",
"if",
"(",
"useShortClassName",
")",
"{",
"bu... | <p>Append to the <code>toString</code> the class name.</p>
@param buffer the <code>StringBuilder</code> to populate
@param object the <code>Object</code> whose name to output | [
"<p",
">",
"Append",
"to",
"the",
"<code",
">",
"toString<",
"/",
"code",
">",
"the",
"class",
"name",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/toString/ToStringStyle.java#L1448-L1457 |
hellosign/hellosign-java-sdk | src/main/java/com/hellosign/sdk/HelloSignClient.java | HelloSignClient.requestEmailReminder | public SignatureRequest requestEmailReminder(String requestId, String email) throws HelloSignException {
"""
Instructs HelloSign to email the given address with a reminder to sign
the SignatureRequest referenced by the given request ID.
Note: You cannot send a reminder within 1 hours of the last reminder that
... | java | public SignatureRequest requestEmailReminder(String requestId, String email) throws HelloSignException {
String url = BASE_URI + SIGNATURE_REQUEST_REMIND_URI + "/" + requestId;
return new SignatureRequest(
httpClient.withAuth(auth).withPostField(Account.ACCOUNT_EMAIL_ADDRESS, email).post... | [
"public",
"SignatureRequest",
"requestEmailReminder",
"(",
"String",
"requestId",
",",
"String",
"email",
")",
"throws",
"HelloSignException",
"{",
"String",
"url",
"=",
"BASE_URI",
"+",
"SIGNATURE_REQUEST_REMIND_URI",
"+",
"\"/\"",
"+",
"requestId",
";",
"return",
... | Instructs HelloSign to email the given address with a reminder to sign
the SignatureRequest referenced by the given request ID.
Note: You cannot send a reminder within 1 hours of the last reminder that
was sent, manually or automatically.
@param requestId String SignatureRequest ID
@param email String email
@return S... | [
"Instructs",
"HelloSign",
"to",
"email",
"the",
"given",
"address",
"with",
"a",
"reminder",
"to",
"sign",
"the",
"SignatureRequest",
"referenced",
"by",
"the",
"given",
"request",
"ID",
"."
] | train | https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/HelloSignClient.java#L729-L733 |
qspin/qtaste | kernel/src/main/java/com/qspin/qtaste/tcom/db/impl/XMLComparator.java | XMLComparator.compare | public boolean compare(Document doc1, Document doc2, String tableName) {
"""
Check that all the rows and elements defined in the doc1 are included in doc2
@param doc1 The source document
@param doc2 The checked document
@return True if all the elements defined in the doc1 exists in the doc2
"""
No... | java | public boolean compare(Document doc1, Document doc2, String tableName) {
NodeList nl = doc1.getElementsByTagName("Row");
for (int i = 0; i < nl.getLength(); i++) {
Node n = nl.item(i);
// check if the rows belongs to the table name
Node tableNodeNameAttr = n.getParent... | [
"public",
"boolean",
"compare",
"(",
"Document",
"doc1",
",",
"Document",
"doc2",
",",
"String",
"tableName",
")",
"{",
"NodeList",
"nl",
"=",
"doc1",
".",
"getElementsByTagName",
"(",
"\"Row\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<... | Check that all the rows and elements defined in the doc1 are included in doc2
@param doc1 The source document
@param doc2 The checked document
@return True if all the elements defined in the doc1 exists in the doc2 | [
"Check",
"that",
"all",
"the",
"rows",
"and",
"elements",
"defined",
"in",
"the",
"doc1",
"are",
"included",
"in",
"doc2"
] | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/kernel/src/main/java/com/qspin/qtaste/tcom/db/impl/XMLComparator.java#L156-L173 |
aol/micro-server | micro-s3/src/main/java/com/oath/micro/server/s3/data/S3ObjectWriter.java | S3ObjectWriter.putSync | public Try<UploadResult, Throwable> putSync(String key, Object value) {
"""
Blocking call
@param key
with which to store data
@param value
Data value
@return Try with completed result of operation
"""
return put(key, value).map(FluentFunctions.ofChecked(i -> i.waitForUploadResult()));
} | java | public Try<UploadResult, Throwable> putSync(String key, Object value) {
return put(key, value).map(FluentFunctions.ofChecked(i -> i.waitForUploadResult()));
} | [
"public",
"Try",
"<",
"UploadResult",
",",
"Throwable",
">",
"putSync",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"return",
"put",
"(",
"key",
",",
"value",
")",
".",
"map",
"(",
"FluentFunctions",
".",
"ofChecked",
"(",
"i",
"->",
"i",
... | Blocking call
@param key
with which to store data
@param value
Data value
@return Try with completed result of operation | [
"Blocking",
"call"
] | train | https://github.com/aol/micro-server/blob/5c7103c5b43d2f4d16350dbd2f9802af307c63f7/micro-s3/src/main/java/com/oath/micro/server/s3/data/S3ObjectWriter.java#L111-L113 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/PersistenceBrokerFactoryDefaultImpl.java | PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker | public PersistenceBrokerInternal createPersistenceBroker(PBKey pbKey) throws PBFactoryException {
"""
Return broker instance from pool. If given {@link PBKey} was not found in pool
a new pool for given
@param pbKey
@return
@throws PBFactoryException
"""
if (log.isDebugEnabled()) log.debug("Obtain ... | java | public PersistenceBrokerInternal createPersistenceBroker(PBKey pbKey) throws PBFactoryException
{
if (log.isDebugEnabled()) log.debug("Obtain broker from pool, used PBKey is " + pbKey);
PersistenceBrokerInternal broker = null;
/*
try to find a valid PBKey, if given key does no... | [
"public",
"PersistenceBrokerInternal",
"createPersistenceBroker",
"(",
"PBKey",
"pbKey",
")",
"throws",
"PBFactoryException",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"\"Obtain broker from pool, used PBKey is \"",
"+",
"pb... | Return broker instance from pool. If given {@link PBKey} was not found in pool
a new pool for given
@param pbKey
@return
@throws PBFactoryException | [
"Return",
"broker",
"instance",
"from",
"pool",
".",
"If",
"given",
"{"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/PersistenceBrokerFactoryDefaultImpl.java#L85-L123 |
inkstand-io/scribble | scribble-net/src/main/java/io/inkstand/scribble/net/NetworkMatchers.java | NetworkMatchers.remotePort | public static NetworkPort remotePort(String hostname, int port) {
"""
Creates a type-safe tcp port pointing ot a remote host and port.
@param hostname
the hostname of the remote host
@param port
the port of the remote host
@return a {@link NetworkPort} instance describing the tcp port
"""
retu... | java | public static NetworkPort remotePort(String hostname, int port){
return new RemoteNetworkPort(hostname, port, NetworkPort.Type.TCP);
} | [
"public",
"static",
"NetworkPort",
"remotePort",
"(",
"String",
"hostname",
",",
"int",
"port",
")",
"{",
"return",
"new",
"RemoteNetworkPort",
"(",
"hostname",
",",
"port",
",",
"NetworkPort",
".",
"Type",
".",
"TCP",
")",
";",
"}"
] | Creates a type-safe tcp port pointing ot a remote host and port.
@param hostname
the hostname of the remote host
@param port
the port of the remote host
@return a {@link NetworkPort} instance describing the tcp port | [
"Creates",
"a",
"type",
"-",
"safe",
"tcp",
"port",
"pointing",
"ot",
"a",
"remote",
"host",
"and",
"port",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-net/src/main/java/io/inkstand/scribble/net/NetworkMatchers.java#L88-L90 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/IoUtil.java | IoUtil.streamResponseAndClose | public static void streamResponseAndClose(Writer pWriter, JSONStreamAware pJson, String callback)
throws IOException {
"""
Stream a JSON stream to a given writer, potentiall wrap it in a callback for a
JSONP response and then flush & close the writer. The writer is closed in any case,
also when an except... | java | public static void streamResponseAndClose(Writer pWriter, JSONStreamAware pJson, String callback)
throws IOException {
try {
if (callback == null) {
pJson.writeJSONString(pWriter);
} else {
pWriter.write(callback);
pWriter.write("("... | [
"public",
"static",
"void",
"streamResponseAndClose",
"(",
"Writer",
"pWriter",
",",
"JSONStreamAware",
"pJson",
",",
"String",
"callback",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"callback",
"==",
"null",
")",
"{",
"pJson",
".",
"writeJSONSt... | Stream a JSON stream to a given writer, potentiall wrap it in a callback for a
JSONP response and then flush & close the writer. The writer is closed in any case,
also when an exception occurs
@param pWriter writer to write to. Must be not null.
@param pJson JSON response to stream
@param callback the name of the call... | [
"Stream",
"a",
"JSON",
"stream",
"to",
"a",
"given",
"writer",
"potentiall",
"wrap",
"it",
"in",
"a",
"callback",
"for",
"a",
"JSONP",
"response",
"and",
"then",
"flush",
"&",
"close",
"the",
"writer",
".",
"The",
"writer",
"is",
"closed",
"in",
"any",
... | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/IoUtil.java#L30-L48 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java | ApiOvhEmailpro.service_domain_domainName_PUT | public void service_domain_domainName_PUT(String service, String domainName, OvhDomain body) throws IOException {
"""
Alter this object properties
REST: PUT /email/pro/{service}/domain/{domainName}
@param body [required] New object properties
@param service [required] The internal name of your pro organizatio... | java | public void service_domain_domainName_PUT(String service, String domainName, OvhDomain body) throws IOException {
String qPath = "/email/pro/{service}/domain/{domainName}";
StringBuilder sb = path(qPath, service, domainName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"service_domain_domainName_PUT",
"(",
"String",
"service",
",",
"String",
"domainName",
",",
"OvhDomain",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/pro/{service}/domain/{domainName}\"",
";",
"StringBuilder",
"sb",
"="... | Alter this object properties
REST: PUT /email/pro/{service}/domain/{domainName}
@param body [required] New object properties
@param service [required] The internal name of your pro organization
@param domainName [required] Domain name
API beta | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java#L874-L878 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java | GeometryUtilities.getAngleBetweenLinePlane | public static double getAngleBetweenLinePlane( Coordinate a, Coordinate d, Coordinate b, Coordinate c ) {
"""
Calculates the angle between line and plane.
http://geogebrawiki.wikispaces.com/3D+Geometry
@param a the 3d point.
@param d the point of intersection between line and plane.
@param b the second pla... | java | public static double getAngleBetweenLinePlane( Coordinate a, Coordinate d, Coordinate b, Coordinate c ) {
double[] rAD = {d.x - a.x, d.y - a.y, d.z - a.z};
double[] rDB = {b.x - d.x, b.y - d.y, b.z - d.z};
double[] rDC = {c.x - d.x, c.y - d.y, c.z - d.z};
double[] n = {//
... | [
"public",
"static",
"double",
"getAngleBetweenLinePlane",
"(",
"Coordinate",
"a",
",",
"Coordinate",
"d",
",",
"Coordinate",
"b",
",",
"Coordinate",
"c",
")",
"{",
"double",
"[",
"]",
"rAD",
"=",
"{",
"d",
".",
"x",
"-",
"a",
".",
"x",
",",
"d",
".",... | Calculates the angle between line and plane.
http://geogebrawiki.wikispaces.com/3D+Geometry
@param a the 3d point.
@param d the point of intersection between line and plane.
@param b the second plane coordinate.
@param c the third plane coordinate.
@return the angle in degrees between line and plane. | [
"Calculates",
"the",
"angle",
"between",
"line",
"and",
"plane",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java#L793-L810 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/util/Hashcoder.java | Hashcoder.hash | public static int hash(int seed, Object o) {
"""
<code>o</code> is a possibly-null object field, and possibly an
array.
If <code>o</code> is an array, then each element may be a primitive
or a possibly-null object.
"""
int result = seed;
//If it was null then this is the result 0
if (o == null) {
... | java | public static int hash(int seed, Object o) {
int result = seed;
//If it was null then this is the result 0
if (o == null) {
result = hash(result, 0);
}
//If it wasn't an array then calculate the hashcode
else if (!o.getClass().isArray()) {
result = hash(result, o.hashCode());
}
//Otherwise loop &
... | [
"public",
"static",
"int",
"hash",
"(",
"int",
"seed",
",",
"Object",
"o",
")",
"{",
"int",
"result",
"=",
"seed",
";",
"//If it was null then this is the result 0",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"result",
"=",
"hash",
"(",
"result",
",",
"0",
... | <code>o</code> is a possibly-null object field, and possibly an
array.
If <code>o</code> is an array, then each element may be a primitive
or a possibly-null object. | [
"<code",
">",
"o<",
"/",
"code",
">",
"is",
"a",
"possibly",
"-",
"null",
"object",
"field",
"and",
"possibly",
"an",
"array",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/util/Hashcoder.java#L106-L125 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/analysis/DataAnalysis.java | DataAnalysis.fromYaml | public static DataAnalysis fromYaml(String yaml) {
"""
Deserialize a YAML DataAnalysis String that was previously serialized with {@link #toYaml()}
"""
try{
return new YamlSerializer().getObjectMapper().readValue(yaml, DataAnalysis.class);
} catch (Exception e){
//Legacy... | java | public static DataAnalysis fromYaml(String yaml) {
try{
return new YamlSerializer().getObjectMapper().readValue(yaml, DataAnalysis.class);
} catch (Exception e){
//Legacy format
ObjectMapper om = new YamlSerializer().getObjectMapper();
return fromMapper(om... | [
"public",
"static",
"DataAnalysis",
"fromYaml",
"(",
"String",
"yaml",
")",
"{",
"try",
"{",
"return",
"new",
"YamlSerializer",
"(",
")",
".",
"getObjectMapper",
"(",
")",
".",
"readValue",
"(",
"yaml",
",",
"DataAnalysis",
".",
"class",
")",
";",
"}",
"... | Deserialize a YAML DataAnalysis String that was previously serialized with {@link #toYaml()} | [
"Deserialize",
"a",
"YAML",
"DataAnalysis",
"String",
"that",
"was",
"previously",
"serialized",
"with",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/analysis/DataAnalysis.java#L129-L137 |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java | PrimitiveUtils.readInteger | public static Integer readInteger(String value, Integer defaultValue) {
"""
Read integer.
@param value the value
@param defaultValue the default value
@return the integer
"""
if (!StringUtils.hasText(value)) return defaultValue;
return Integer.valueOf(value);
} | java | public static Integer readInteger(String value, Integer defaultValue) {
if (!StringUtils.hasText(value)) return defaultValue;
return Integer.valueOf(value);
} | [
"public",
"static",
"Integer",
"readInteger",
"(",
"String",
"value",
",",
"Integer",
"defaultValue",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"value",
")",
")",
"return",
"defaultValue",
";",
"return",
"Integer",
".",
"valueOf",
"(",
... | Read integer.
@param value the value
@param defaultValue the default value
@return the integer | [
"Read",
"integer",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/PrimitiveUtils.java#L128-L132 |
lazy-koala/java-toolkit | fast-toolkit3d/src/main/java/com/thankjava/toolkit3d/core/fastjson/FastJson.java | FastJson.toObject | public static <T> T toObject(String json, Class<T> clazz) {
"""
将json字符串转换成对象
<p>Function: toObject</p>
<p>Description: </p>
@param json
@param clazz
@return
@author acexy@thankjava.com
@date 2015年12月30日 下午12:01:44
@version 1.0
"""
if (json == null || json.trim().length() == 0) {
... | java | public static <T> T toObject(String json, Class<T> clazz) {
if (json == null || json.trim().length() == 0) {
return null;
}
T t = null;
try {
t = JSON.parseObject(json, clazz);
} catch (Exception e) {
throw new RuntimeException(e);
}
... | [
"public",
"static",
"<",
"T",
">",
"T",
"toObject",
"(",
"String",
"json",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"json",
"==",
"null",
"||",
"json",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"re... | 将json字符串转换成对象
<p>Function: toObject</p>
<p>Description: </p>
@param json
@param clazz
@return
@author acexy@thankjava.com
@date 2015年12月30日 下午12:01:44
@version 1.0 | [
"将json字符串转换成对象",
"<p",
">",
"Function",
":",
"toObject<",
"/",
"p",
">",
"<p",
">",
"Description",
":",
"<",
"/",
"p",
">"
] | train | https://github.com/lazy-koala/java-toolkit/blob/f46055fae0cc73049597a3708e515f5c6582d27a/fast-toolkit3d/src/main/java/com/thankjava/toolkit3d/core/fastjson/FastJson.java#L35-L46 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java | ExtractionUtil.extractFile | private static void extractFile(ArchiveInputStream input, File destination,
FilenameFilter filter, ArchiveEntry entry) throws ExtractionException {
"""
Extracts a file from an archive (input stream) and correctly builds the
directory structure.
@param input the archive input stream
@param destinat... | java | private static void extractFile(ArchiveInputStream input, File destination,
FilenameFilter filter, ArchiveEntry entry) throws ExtractionException {
final File file = new File(destination, entry.getName());
try {
if (filter.accept(file.getParentFile(), file.getName())) {
... | [
"private",
"static",
"void",
"extractFile",
"(",
"ArchiveInputStream",
"input",
",",
"File",
"destination",
",",
"FilenameFilter",
"filter",
",",
"ArchiveEntry",
"entry",
")",
"throws",
"ExtractionException",
"{",
"final",
"File",
"file",
"=",
"new",
"File",
"(",
... | Extracts a file from an archive (input stream) and correctly builds the
directory structure.
@param input the archive input stream
@param destination where to write the file
@param filter the file filter to apply to the files being extracted
@param entry the entry from the archive to extract
@throws ExtractionExceptio... | [
"Extracts",
"a",
"file",
"from",
"an",
"archive",
"(",
"input",
"stream",
")",
"and",
"correctly",
"builds",
"the",
"directory",
"structure",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java#L279-L307 |
morimekta/providence | providence-core/src/main/java-gen/net/morimekta/providence/util/Any.java | Any.wrapMessage | public static <M extends net.morimekta.providence.PMessage<M, F>, F extends net.morimekta.providence.descriptor.PField>
Any wrapMessage(@javax.annotation.Nonnull M message, @javax.annotation.Nonnull net.morimekta.providence.serializer.Serializer serializer) {
"""
Wrap a message into an <code>Any</code> wrapper... | java | public static <M extends net.morimekta.providence.PMessage<M, F>, F extends net.morimekta.providence.descriptor.PField>
Any wrapMessage(@javax.annotation.Nonnull M message, @javax.annotation.Nonnull net.morimekta.providence.serializer.Serializer serializer) {
try {
_Builder builder = builder();
... | [
"public",
"static",
"<",
"M",
"extends",
"net",
".",
"morimekta",
".",
"providence",
".",
"PMessage",
"<",
"M",
",",
"F",
">",
",",
"F",
"extends",
"net",
".",
"morimekta",
".",
"providence",
".",
"descriptor",
".",
"PField",
">",
"Any",
"wrapMessage",
... | Wrap a message into an <code>Any</code> wrapper message. This
will serialize the message using the provided serializer.
@param message Wrap this message.
@param serializer Use this serializer.
@param <M> The message type
@param <F> The message field type
@return The wrapped message. | [
"Wrap",
"a",
"message",
"into",
"an",
"<code",
">",
"Any<",
"/",
"code",
">",
"wrapper",
"message",
".",
"This",
"will",
"serialize",
"the",
"message",
"using",
"the",
"provided",
"serializer",
"."
] | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java-gen/net/morimekta/providence/util/Any.java#L545-L562 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.importKeyAsync | public ServiceFuture<KeyBundle> importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, final ServiceCallback<KeyBundle> serviceCallback) {
"""
Imports an externally created key, stores it, and returns key parameters and attributes to the client.
The import key operation may be used to import any key ... | java | public ServiceFuture<KeyBundle> importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, final ServiceCallback<KeyBundle> serviceCallback) {
return ServiceFuture.fromResponse(importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"KeyBundle",
">",
"importKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"JsonWebKey",
"key",
",",
"final",
"ServiceCallback",
"<",
"KeyBundle",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
"... | Imports an externally created key, stores it, and returns key parameters and attributes to the client.
The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permissio... | [
"Imports",
"an",
"externally",
"created",
"key",
"stores",
"it",
"and",
"returns",
"key",
"parameters",
"and",
"attributes",
"to",
"the",
"client",
".",
"The",
"import",
"key",
"operation",
"may",
"be",
"used",
"to",
"import",
"any",
"key",
"type",
"into",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L891-L893 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java | ExecutorManager.cancelFlow | @Override
public void cancelFlow(final ExecutableFlow exFlow, final String userId)
throws ExecutorManagerException {
"""
if flows was dispatched to an executor, cancel by calling Executor else if flow is still in
queue, remove from queue and finalize {@inheritDoc}
@see azkaban.executor.ExecutorManagerA... | java | @Override
public void cancelFlow(final ExecutableFlow exFlow, final String userId)
throws ExecutorManagerException {
synchronized (exFlow) {
if (this.runningExecutions.get().containsKey(exFlow.getExecutionId())) {
final Pair<ExecutionReference, ExecutableFlow> pair =
this.runningEx... | [
"@",
"Override",
"public",
"void",
"cancelFlow",
"(",
"final",
"ExecutableFlow",
"exFlow",
",",
"final",
"String",
"userId",
")",
"throws",
"ExecutorManagerException",
"{",
"synchronized",
"(",
"exFlow",
")",
"{",
"if",
"(",
"this",
".",
"runningExecutions",
"."... | if flows was dispatched to an executor, cancel by calling Executor else if flow is still in
queue, remove from queue and finalize {@inheritDoc}
@see azkaban.executor.ExecutorManagerAdapter#cancelFlow(azkaban.executor.ExecutableFlow,
java.lang.String) | [
"if",
"flows",
"was",
"dispatched",
"to",
"an",
"executor",
"cancel",
"by",
"calling",
"Executor",
"else",
"if",
"flow",
"is",
"still",
"in",
"queue",
"remove",
"from",
"queue",
"and",
"finalize",
"{",
"@inheritDoc",
"}"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutorManager.java#L825-L844 |
alkacon/opencms-core | src/org/opencms/file/wrapper/CmsResourceWrapperXmlPage.java | CmsResourceWrapperXmlPage.getResourceForElement | private CmsResource getResourceForElement(CmsResource xmlPage, String path, int length) {
"""
Returns a virtual resource for an element inside a locale.<p>
A new (virtual) resource is created with the given path and length. The
new created resource uses the values of the origin resource of the xml page
where ... | java | private CmsResource getResourceForElement(CmsResource xmlPage, String path, int length) {
CmsWrappedResource wrap = new CmsWrappedResource(xmlPage);
wrap.setRootPath(path);
int plainId;
try {
plainId = OpenCms.getResourceManager().getResourceType(
CmsResource... | [
"private",
"CmsResource",
"getResourceForElement",
"(",
"CmsResource",
"xmlPage",
",",
"String",
"path",
",",
"int",
"length",
")",
"{",
"CmsWrappedResource",
"wrap",
"=",
"new",
"CmsWrappedResource",
"(",
"xmlPage",
")",
";",
"wrap",
".",
"setRootPath",
"(",
"p... | Returns a virtual resource for an element inside a locale.<p>
A new (virtual) resource is created with the given path and length. The
new created resource uses the values of the origin resource of the xml page
where it is possible.<p>
@param xmlPage the xml page resource with the element to create a virtual resource
... | [
"Returns",
"a",
"virtual",
"resource",
"for",
"an",
"element",
"inside",
"a",
"locale",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/CmsResourceWrapperXmlPage.java#L1018-L1035 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/search/PathFinder.java | PathFinder.getAbsolutePath | public static String getAbsolutePath(final File file, final boolean removeLastChar) {
"""
Gets the absolute path.
@param file
the file
@param removeLastChar
the remove last char
@return the absolute path
"""
String absolutePath = file.getAbsolutePath();
if (removeLastChar)
{
absolutePath = ... | java | public static String getAbsolutePath(final File file, final boolean removeLastChar)
{
String absolutePath = file.getAbsolutePath();
if (removeLastChar)
{
absolutePath = absolutePath.substring(0, absolutePath.length() - 1);
}
return absolutePath;
} | [
"public",
"static",
"String",
"getAbsolutePath",
"(",
"final",
"File",
"file",
",",
"final",
"boolean",
"removeLastChar",
")",
"{",
"String",
"absolutePath",
"=",
"file",
".",
"getAbsolutePath",
"(",
")",
";",
"if",
"(",
"removeLastChar",
")",
"{",
"absolutePa... | Gets the absolute path.
@param file
the file
@param removeLastChar
the remove last char
@return the absolute path | [
"Gets",
"the",
"absolute",
"path",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/search/PathFinder.java#L79-L87 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/ParagraphBox.java | ParagraphBox.hitText | CharacterHit hitText(CaretOffsetX x, double y) {
"""
Hits the embedded TextFlow at the given x and y offset.
@return hit info for the given x and y coordinates
"""
return text.hit(x.value, y);
} | java | CharacterHit hitText(CaretOffsetX x, double y) {
return text.hit(x.value, y);
} | [
"CharacterHit",
"hitText",
"(",
"CaretOffsetX",
"x",
",",
"double",
"y",
")",
"{",
"return",
"text",
".",
"hit",
"(",
"x",
".",
"value",
",",
"y",
")",
";",
"}"
] | Hits the embedded TextFlow at the given x and y offset.
@return hit info for the given x and y coordinates | [
"Hits",
"the",
"embedded",
"TextFlow",
"at",
"the",
"given",
"x",
"and",
"y",
"offset",
"."
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/ParagraphBox.java#L272-L274 |
zeroturnaround/maven-jrebel-plugin | src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java | GenerateRebelMojo.getInterpolatorValue | private String getInterpolatorValue(MavenProject project, String value) {
"""
Maven versions prior to 2.0.9 don't interpolate all ${project.*} values, so we'll need to do it ourself.
@param project
@param value
@return
"""
RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
interpo... | java | private String getInterpolatorValue(MavenProject project, String value) {
RegexBasedInterpolator interpolator = new RegexBasedInterpolator();
interpolator.addValueSource(new ObjectBasedValueSource(project));
try {
return interpolator.interpolate(value, "project");
}
catch (Exception e) {
... | [
"private",
"String",
"getInterpolatorValue",
"(",
"MavenProject",
"project",
",",
"String",
"value",
")",
"{",
"RegexBasedInterpolator",
"interpolator",
"=",
"new",
"RegexBasedInterpolator",
"(",
")",
";",
"interpolator",
".",
"addValueSource",
"(",
"new",
"ObjectBase... | Maven versions prior to 2.0.9 don't interpolate all ${project.*} values, so we'll need to do it ourself.
@param project
@param value
@return | [
"Maven",
"versions",
"prior",
"to",
"2",
".",
"0",
".",
"9",
"don",
"t",
"interpolate",
"all",
"$",
"{",
"project",
".",
"*",
"}",
"values",
"so",
"we",
"ll",
"need",
"to",
"do",
"it",
"ourself",
"."
] | train | https://github.com/zeroturnaround/maven-jrebel-plugin/blob/6a0d12529a13ae6b2b772658a714398147c091ca/src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java#L789-L801 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/Sketch.java | Sketch.thetaOnCompact | static final long thetaOnCompact(final boolean empty, final int curCount, final long thetaLong) {
"""
/*
The truth table for empty, curCount and theta on compact is as follows:
<pre>
Num Theta CurCount Empty State Comments
0 1.0 0 T OK The Normal Empty State
1 1.0 0 F Error T... | java | static final long thetaOnCompact(final boolean empty, final int curCount, final long thetaLong) {
return (empty && (curCount == 0) && (thetaLong < Long.MAX_VALUE)) ? Long.MAX_VALUE : thetaLong;
} | [
"static",
"final",
"long",
"thetaOnCompact",
"(",
"final",
"boolean",
"empty",
",",
"final",
"int",
"curCount",
",",
"final",
"long",
"thetaLong",
")",
"{",
"return",
"(",
"empty",
"&&",
"(",
"curCount",
"==",
"0",
")",
"&&",
"(",
"thetaLong",
"<",
"Long... | /*
The truth table for empty, curCount and theta on compact is as follows:
<pre>
Num Theta CurCount Empty State Comments
0 1.0 0 T OK The Normal Empty State
1 1.0 0 F Error This conflicts with the normal empty state
2 1.0 !0 T Error Empty and curCount !0 should never co-e... | [
"/",
"*",
"The",
"truth",
"table",
"for",
"empty",
"curCount",
"and",
"theta",
"on",
"compact",
"is",
"as",
"follows",
":",
"<pre",
">",
"Num",
"Theta",
"CurCount",
"Empty",
"State",
"Comments",
"0",
"1",
".",
"0",
"0",
"T",
"OK",
"The",
"Normal",
"E... | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/Sketch.java#L578-L580 |
google/closure-compiler | src/com/google/javascript/jscomp/JsMessageVisitor.java | JsMessageVisitor.isLegalMessageVarAlias | private static boolean isLegalMessageVarAlias(Node msgNode, String msgKey) {
"""
Defines any special cases that are exceptions to what would otherwise be illegal message
assignments.
<p>These exceptions are generally due to the pass being designed before new syntax was
introduced.
"""
if (msgNode.isGe... | java | private static boolean isLegalMessageVarAlias(Node msgNode, String msgKey) {
if (msgNode.isGetProp()
&& msgNode.isQualifiedName()
&& msgNode.getLastChild().getString().equals(msgKey)) {
// Case: `foo.Thing.MSG_EXAMPLE = bar.OtherThing.MSG_EXAMPLE;`
//
// This kind of construct is c... | [
"private",
"static",
"boolean",
"isLegalMessageVarAlias",
"(",
"Node",
"msgNode",
",",
"String",
"msgKey",
")",
"{",
"if",
"(",
"msgNode",
".",
"isGetProp",
"(",
")",
"&&",
"msgNode",
".",
"isQualifiedName",
"(",
")",
"&&",
"msgNode",
".",
"getLastChild",
"(... | Defines any special cases that are exceptions to what would otherwise be illegal message
assignments.
<p>These exceptions are generally due to the pass being designed before new syntax was
introduced. | [
"Defines",
"any",
"special",
"cases",
"that",
"are",
"exceptions",
"to",
"what",
"would",
"otherwise",
"be",
"illegal",
"message",
"assignments",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JsMessageVisitor.java#L367-L394 |
dhanji/sitebricks | sitebricks-converter/src/main/java/com/google/sitebricks/conversion/generics/Generics.java | Generics.mapTypeParameters | private static Type mapTypeParameters(Type toMapType, Type typeAndParams) {
"""
Maps type parameters in a type to their values.
@param toMapType
Type possibly containing type arguments
@param typeAndParams
must be either ParameterizedType, or (in case there are no
type arguments, or it's a raw type) Class
... | java | private static Type mapTypeParameters(Type toMapType, Type typeAndParams)
{
if (isMissingTypeParameters(typeAndParams))
{
return erase(toMapType);
}
else
{
VarMap varMap = new VarMap();
Type handlingTypeAndParams = typeAndParams;
while (handlingTypeAndParams instanceof ParameterizedType... | [
"private",
"static",
"Type",
"mapTypeParameters",
"(",
"Type",
"toMapType",
",",
"Type",
"typeAndParams",
")",
"{",
"if",
"(",
"isMissingTypeParameters",
"(",
"typeAndParams",
")",
")",
"{",
"return",
"erase",
"(",
"toMapType",
")",
";",
"}",
"else",
"{",
"V... | Maps type parameters in a type to their values.
@param toMapType
Type possibly containing type arguments
@param typeAndParams
must be either ParameterizedType, or (in case there are no
type arguments, or it's a raw type) Class
@return toMapType, but with type parameters from typeAndParams replaced. | [
"Maps",
"type",
"parameters",
"in",
"a",
"type",
"to",
"their",
"values",
"."
] | train | https://github.com/dhanji/sitebricks/blob/8682029a78bd48fb8566173d970800499e9e5d97/sitebricks-converter/src/main/java/com/google/sitebricks/conversion/generics/Generics.java#L67-L88 |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/Layer.java | Layer.withAttributes | public Layer withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
The layer attributes.
</p>
<p>
For the <code>HaproxyStatsPassword</code>, <code>MysqlRootPassword</code>, and <code>GangliaPassword</code>
attributes, AWS OpsWorks Stacks returns <code>*****FILTERED*****</code> instead of the actu... | java | public Layer withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"Layer",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The layer attributes.
</p>
<p>
For the <code>HaproxyStatsPassword</code>, <code>MysqlRootPassword</code>, and <code>GangliaPassword</code>
attributes, AWS OpsWorks Stacks returns <code>*****FILTERED*****</code> instead of the actual value
</p>
<p>
For an ECS Cluster layer, AWS OpsWorks Stacks the <code>EcsClusterAr... | [
"<p",
">",
"The",
"layer",
"attributes",
".",
"<",
"/",
"p",
">",
"<p",
">",
"For",
"the",
"<code",
">",
"HaproxyStatsPassword<",
"/",
"code",
">",
"<code",
">",
"MysqlRootPassword<",
"/",
"code",
">",
"and",
"<code",
">",
"GangliaPassword<",
"/",
"code"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/Layer.java#L550-L553 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java | TransformerHandlerImpl.endElement | public void endElement(String uri, String localName, String qName)
throws SAXException {
"""
Filter an end element event.
@param uri The element's Namespace URI, or the empty string.
@param localName The element's local name, or the empty string.
@param qName The element's qualified (prefixed) name,... | java | public void endElement(String uri, String localName, String qName)
throws SAXException
{
if (DEBUG)
System.out.println("TransformerHandlerImpl#endElement: " + qName);
if (m_contentHandler != null)
{
m_contentHandler.endElement(uri, localName, qName);
}
} | [
"public",
"void",
"endElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"DEBUG",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"TransformerHandlerImpl#endElement: \"",
"+",
"q... | Filter an end element event.
@param uri The element's Namespace URI, or the empty string.
@param localName The element's local name, or the empty string.
@param qName The element's qualified (prefixed) name, or the empty
string.
@throws SAXException The client may throw
an exception during processing.
@see org.xml.sax... | [
"Filter",
"an",
"end",
"element",
"event",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java#L515-L526 |
line/centraldogma | client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/CentralDogmaEndpointGroup.java | CentralDogmaEndpointGroup.of | public static <T> CentralDogmaEndpointGroup<T> of(CentralDogma centralDogma,
String projectName, String repositoryName,
Query<T> query,
EndpointListDecoder<T>... | java | public static <T> CentralDogmaEndpointGroup<T> of(CentralDogma centralDogma,
String projectName, String repositoryName,
Query<T> query,
EndpointListDecoder<T>... | [
"public",
"static",
"<",
"T",
">",
"CentralDogmaEndpointGroup",
"<",
"T",
">",
"of",
"(",
"CentralDogma",
"centralDogma",
",",
"String",
"projectName",
",",
"String",
"repositoryName",
",",
"Query",
"<",
"T",
">",
"query",
",",
"EndpointListDecoder",
"<",
"T",... | Creates a new {@link CentralDogmaEndpointGroup}.
@param centralDogma a {@link CentralDogma}
@param projectName a Central Dogma project name
@param repositoryName a Central Dogma repository name
@param query a {@link Query} to route file
@param endpointListDecoder an {@link EndpointListDecoder} | [
"Creates",
"a",
"new",
"{",
"@link",
"CentralDogmaEndpointGroup",
"}",
"."
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/CentralDogmaEndpointGroup.java#L84-L89 |
tdomzal/junit-docker-rule | src/main/java/pl/domzal/junit/docker/rule/WaitFor.java | WaitFor.httpPing | public static StartCondition httpPing(final int internalHttpPort) {
"""
Wait for http endpoint availability under given <b>internal</b> container port.
Given port MUST be exposed (with {@link DockerRuleBuilder#expose(String, String)} or
{@link DockerRuleBuilder#publishAllPorts(boolean)}) (reachable from the test... | java | public static StartCondition httpPing(final int internalHttpPort) {
return new StartCondition() {
@Override
public StartConditionCheck build(DockerRule currentRule) {
String exposedPort = currentRule.getExposedContainerPort(Integer.toString(internalHttpPort));
... | [
"public",
"static",
"StartCondition",
"httpPing",
"(",
"final",
"int",
"internalHttpPort",
")",
"{",
"return",
"new",
"StartCondition",
"(",
")",
"{",
"@",
"Override",
"public",
"StartConditionCheck",
"build",
"(",
"DockerRule",
"currentRule",
")",
"{",
"String",
... | Wait for http endpoint availability under given <b>internal</b> container port.
Given port MUST be exposed (with {@link DockerRuleBuilder#expose(String, String)} or
{@link DockerRuleBuilder#publishAllPorts(boolean)}) (reachable from the test
code point of view).
<p>
Side note: Internal port is required for convenience ... | [
"Wait",
"for",
"http",
"endpoint",
"availability",
"under",
"given",
"<b",
">",
"internal<",
"/",
"b",
">",
"container",
"port",
".",
"Given",
"port",
"MUST",
"be",
"exposed",
"(",
"with",
"{",
"@link",
"DockerRuleBuilder#expose",
"(",
"String",
"String",
")... | train | https://github.com/tdomzal/junit-docker-rule/blob/5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2/src/main/java/pl/domzal/junit/docker/rule/WaitFor.java#L119-L129 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Damages.java | Damages.setDamages | public void setDamages(int min, int max) {
"""
Set the maximum damage value. Max set to min value if over.
@param min The minimum damages value (must be positive).
@param max The maximum damages value (must be positive and superior or equal to min).
"""
this.min = UtilMath.clamp(min, 0, Integer.MAX... | java | public void setDamages(int min, int max)
{
this.min = UtilMath.clamp(min, 0, Integer.MAX_VALUE);
this.max = UtilMath.clamp(max, this.min, Integer.MAX_VALUE);
} | [
"public",
"void",
"setDamages",
"(",
"int",
"min",
",",
"int",
"max",
")",
"{",
"this",
".",
"min",
"=",
"UtilMath",
".",
"clamp",
"(",
"min",
",",
"0",
",",
"Integer",
".",
"MAX_VALUE",
")",
";",
"this",
".",
"max",
"=",
"UtilMath",
".",
"clamp",
... | Set the maximum damage value. Max set to min value if over.
@param min The minimum damages value (must be positive).
@param max The maximum damages value (must be positive and superior or equal to min). | [
"Set",
"the",
"maximum",
"damage",
"value",
".",
"Max",
"set",
"to",
"min",
"value",
"if",
"over",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Damages.java#L85-L89 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/MapHelper.java | MapHelper.addValueToIn | public void addValueToIn(Object value, String name, Map<String, Object> map) {
"""
Adds a value to the end of a list.
@param value value to be passed.
@param name name to use this value for.
@param map map to store value in.
"""
Object val = getValue(map, name);
if (val instanceof Collectio... | java | public void addValueToIn(Object value, String name, Map<String, Object> map) {
Object val = getValue(map, name);
if (val instanceof Collection) {
Object cleanValue = getCleanValue(value);
((Collection) val).add(cleanValue);
} else if (val == null) {
setVa... | [
"public",
"void",
"addValueToIn",
"(",
"Object",
"value",
",",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"Object",
"val",
"=",
"getValue",
"(",
"map",
",",
"name",
")",
";",
"if",
"(",
"val",
"instanceof",
"Col... | Adds a value to the end of a list.
@param value value to be passed.
@param name name to use this value for.
@param map map to store value in. | [
"Adds",
"a",
"value",
"to",
"the",
"end",
"of",
"a",
"list",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/MapHelper.java#L107-L117 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/os/files/FileFinder.java | FileFinder.findFile | public static List<File> findFile(String pattern, boolean recurse, String ... roots) {
"""
Looks up files whose name matches the given pattern under the given set
of directories (and, if specified, their sub-directories in a recursive way).
@param pattern
the name of the file, as a regular expression.
@param... | java | public static List<File> findFile(String pattern, boolean recurse, String ... roots) {
List<File> files = new ArrayList<>();
if(roots != null) {
for(String root : roots) {
try {
Path path = FileSystems.getDefault().getPath(root);
logger.trace("scanning directory {}", path.getFileName());
Files... | [
"public",
"static",
"List",
"<",
"File",
">",
"findFile",
"(",
"String",
"pattern",
",",
"boolean",
"recurse",
",",
"String",
"...",
"roots",
")",
"{",
"List",
"<",
"File",
">",
"files",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"roots... | Looks up files whose name matches the given pattern under the given set
of directories (and, if specified, their sub-directories in a recursive way).
@param pattern
the name of the file, as a regular expression.
@param recurse
whether the finder should recurse to sub-directories.
@param roots
a set of one or more dire... | [
"Looks",
"up",
"files",
"whose",
"name",
"matches",
"the",
"given",
"pattern",
"under",
"the",
"given",
"set",
"of",
"directories",
"(",
"and",
"if",
"specified",
"their",
"sub",
"-",
"directories",
"in",
"a",
"recursive",
"way",
")",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/os/files/FileFinder.java#L101-L115 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/SystemIntents.java | SystemIntents.newMarketForAppIntent | public static Intent newMarketForAppIntent(Context context, String packageName) {
"""
Intent that should open the app store of the device on the given application
@param context The context associated to the application
@param packageName The package name of the application to find on the market
@return t... | java | public static Intent newMarketForAppIntent(Context context, String packageName) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName));
if (!IntentUtils.isIntentAvailable(context, intent)) {
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("amzn:/... | [
"public",
"static",
"Intent",
"newMarketForAppIntent",
"(",
"Context",
"context",
",",
"String",
"packageName",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"Intent",
".",
"ACTION_VIEW",
",",
"Uri",
".",
"parse",
"(",
"\"market://details?id=\"",
"+",... | Intent that should open the app store of the device on the given application
@param context The context associated to the application
@param packageName The package name of the application to find on the market
@return the intent or null if no market is available for the intent | [
"Intent",
"that",
"should",
"open",
"the",
"app",
"store",
"of",
"the",
"device",
"on",
"the",
"given",
"application"
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/SystemIntents.java#L45-L61 |
aoindustries/ao-encoding | src/main/java/com/aoindustries/encoding/ChainWriter.java | ChainWriter.printDateJS | @Deprecated
public ChainWriter printDateJS(long date, Sequence sequence, Appendable scriptOut) throws IOException {
"""
Prints a JavaScript script tag that shows a date in the user's locale. Prints <code>&#160;</code>
if the date is <code>-1</code>.
Writes to the internal <code>PrintWriter</code>.
@depr... | java | @Deprecated
public ChainWriter printDateJS(long date, Sequence sequence, Appendable scriptOut) throws IOException {
return writeDateJavaScript(date==-1 ? null : new Date(date), sequence, scriptOut);
} | [
"@",
"Deprecated",
"public",
"ChainWriter",
"printDateJS",
"(",
"long",
"date",
",",
"Sequence",
"sequence",
",",
"Appendable",
"scriptOut",
")",
"throws",
"IOException",
"{",
"return",
"writeDateJavaScript",
"(",
"date",
"==",
"-",
"1",
"?",
"null",
":",
"new... | Prints a JavaScript script tag that shows a date in the user's locale. Prints <code>&#160;</code>
if the date is <code>-1</code>.
Writes to the internal <code>PrintWriter</code>.
@deprecated
@see #writeDateJavaScript(long) | [
"Prints",
"a",
"JavaScript",
"script",
"tag",
"that",
"shows",
"a",
"date",
"in",
"the",
"user",
"s",
"locale",
".",
"Prints",
"<code",
">",
"&",
";",
"#160",
";",
"<",
"/",
"code",
">",
"if",
"the",
"date",
"is",
"<code",
">",
"-",
"1<",
"/",
... | train | https://github.com/aoindustries/ao-encoding/blob/54eeb8ff58ab7b44bb02549bbe2572625b449e4e/src/main/java/com/aoindustries/encoding/ChainWriter.java#L803-L806 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.