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 |
|---|---|---|---|---|---|---|---|---|---|---|
mguymon/naether | src/main/java/com/tobedevoured/naether/maven/Project.java | Project.addDependency | public void addDependency(String notation, String scope ) {
"""
Add a Dependency by String notation
@param notation String
@param scope String
"""
Map<String, String> notationMap = Notation.parse(notation);
Dependency dependency = new Dependency();
dependency.setGroupId(notationMap.... | java | public void addDependency(String notation, String scope ) {
Map<String, String> notationMap = Notation.parse(notation);
Dependency dependency = new Dependency();
dependency.setGroupId(notationMap.get("groupId"));
dependency.setArtifactId(notationMap.get("artifactId"));
dependency... | [
"public",
"void",
"addDependency",
"(",
"String",
"notation",
",",
"String",
"scope",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"notationMap",
"=",
"Notation",
".",
"parse",
"(",
"notation",
")",
";",
"Dependency",
"dependency",
"=",
"new",
"Depe... | Add a Dependency by String notation
@param notation String
@param scope String | [
"Add",
"a",
"Dependency",
"by",
"String",
"notation"
] | train | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/maven/Project.java#L401-L410 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/InstanceHelpers.java | InstanceHelpers.findInstanceByPath | public static Instance findInstanceByPath( Instance rootInstance, String instancePath ) {
"""
Finds an instance by name.
@param rootInstance a root instance
@param instancePath the instance path
@return an instance, or null if it was not found
"""
Application tempApplication = new Application( new Applic... | java | public static Instance findInstanceByPath( Instance rootInstance, String instancePath ) {
Application tempApplication = new Application( new ApplicationTemplate());
if( rootInstance != null )
tempApplication.getRootInstances().add( rootInstance );
return findInstanceByPath( tempApplication, instancePath );
... | [
"public",
"static",
"Instance",
"findInstanceByPath",
"(",
"Instance",
"rootInstance",
",",
"String",
"instancePath",
")",
"{",
"Application",
"tempApplication",
"=",
"new",
"Application",
"(",
"new",
"ApplicationTemplate",
"(",
")",
")",
";",
"if",
"(",
"rootInst... | Finds an instance by name.
@param rootInstance a root instance
@param instancePath the instance path
@return an instance, or null if it was not found | [
"Finds",
"an",
"instance",
"by",
"name",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/InstanceHelpers.java#L297-L304 |
mockito/mockito | src/main/java/org/mockito/internal/invocation/TypeSafeMatching.java | TypeSafeMatching.isCompatible | private static boolean isCompatible(ArgumentMatcher<?> argumentMatcher, Object argument) {
"""
Returns <code>true</code> if the given <b>argument</b> can be passed to
the given <code>argumentMatcher</code> without causing a
{@link ClassCastException}.
"""
if (argument == null)
return true... | java | private static boolean isCompatible(ArgumentMatcher<?> argumentMatcher, Object argument) {
if (argument == null)
return true;
Class<?> expectedArgumentType = getArgumentType(argumentMatcher);
return expectedArgumentType.isInstance(argument);
} | [
"private",
"static",
"boolean",
"isCompatible",
"(",
"ArgumentMatcher",
"<",
"?",
">",
"argumentMatcher",
",",
"Object",
"argument",
")",
"{",
"if",
"(",
"argument",
"==",
"null",
")",
"return",
"true",
";",
"Class",
"<",
"?",
">",
"expectedArgumentType",
"=... | Returns <code>true</code> if the given <b>argument</b> can be passed to
the given <code>argumentMatcher</code> without causing a
{@link ClassCastException}. | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"given",
"<b",
">",
"argument<",
"/",
"b",
">",
"can",
"be",
"passed",
"to",
"the",
"given",
"<code",
">",
"argumentMatcher<",
"/",
"code",
">",
"without",
"causing",
"a",
"{"
] | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/invocation/TypeSafeMatching.java#L33-L40 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRSkeleton.java | GVRSkeleton.setBoneName | public void setBoneName(int boneindex, String bonename) {
"""
Sets the name of the designated bone.
@param boneindex zero based index of bone to rotate.
@param bonename string with name of bone.
. * @see #getBoneName
"""
mBoneNames[boneindex] = bonename;
NativeSkeleton.setBoneName(get... | java | public void setBoneName(int boneindex, String bonename)
{
mBoneNames[boneindex] = bonename;
NativeSkeleton.setBoneName(getNative(), boneindex, bonename);
} | [
"public",
"void",
"setBoneName",
"(",
"int",
"boneindex",
",",
"String",
"bonename",
")",
"{",
"mBoneNames",
"[",
"boneindex",
"]",
"=",
"bonename",
";",
"NativeSkeleton",
".",
"setBoneName",
"(",
"getNative",
"(",
")",
",",
"boneindex",
",",
"bonename",
")"... | Sets the name of the designated bone.
@param boneindex zero based index of bone to rotate.
@param bonename string with name of bone.
. * @see #getBoneName | [
"Sets",
"the",
"name",
"of",
"the",
"designated",
"bone",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRSkeleton.java#L776-L780 |
eclipse/xtext-extras | org.eclipse.xtext.smap/src/org/eclipse/xtext/smap/SmapStratum.java | SmapStratum.addFile | public void addFile(String filename, String filePath) {
"""
Adds record of a new file, by filename and path. The path
may be relative to a source compilation path.
@param filename the filename to add, unqualified by path
@param filePath the path for the filename, potentially relative
to a source compilation... | java | public void addFile(String filename, String filePath) {
int pathIndex = filePathList.indexOf(filePath);
if (pathIndex == -1) {
fileNameList.add(filename);
filePathList.add(filePath);
}
} | [
"public",
"void",
"addFile",
"(",
"String",
"filename",
",",
"String",
"filePath",
")",
"{",
"int",
"pathIndex",
"=",
"filePathList",
".",
"indexOf",
"(",
"filePath",
")",
";",
"if",
"(",
"pathIndex",
"==",
"-",
"1",
")",
"{",
"fileNameList",
".",
"add",... | Adds record of a new file, by filename and path. The path
may be relative to a source compilation path.
@param filename the filename to add, unqualified by path
@param filePath the path for the filename, potentially relative
to a source compilation path | [
"Adds",
"record",
"of",
"a",
"new",
"file",
"by",
"filename",
"and",
"path",
".",
"The",
"path",
"may",
"be",
"relative",
"to",
"a",
"source",
"compilation",
"path",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.smap/src/org/eclipse/xtext/smap/SmapStratum.java#L161-L167 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java | JsonModelCoder.getList | public List<T> getList(String json) throws IOException, JsonFormatException {
"""
Attempts to parse the given data as {@link List} of objects.
@param json JSON-formatted data
@return {@link List} of objects
@throws IOException
@throws JsonFormatException The given data is malformed, or its type is unexpected... | java | public List<T> getList(String json) throws IOException, JsonFormatException {
JsonPullParser parser = JsonPullParser.newParser(json);
return getList(parser, null);
} | [
"public",
"List",
"<",
"T",
">",
"getList",
"(",
"String",
"json",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"JsonPullParser",
"parser",
"=",
"JsonPullParser",
".",
"newParser",
"(",
"json",
")",
";",
"return",
"getList",
"(",
"parser",
... | Attempts to parse the given data as {@link List} of objects.
@param json JSON-formatted data
@return {@link List} of objects
@throws IOException
@throws JsonFormatException The given data is malformed, or its type is unexpected | [
"Attempts",
"to",
"parse",
"the",
"given",
"data",
"as",
"{",
"@link",
"List",
"}",
"of",
"objects",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java#L54-L57 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldSetRenderer.java | WFieldSetRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WFieldSet.
@param component the WFieldSet to paint.
@param renderContext the RenderContext to paint to.
"""
WFieldSet fieldSet = (WFieldSet) component;
XmlStringBuilder xml = rend... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WFieldSet fieldSet = (WFieldSet) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:fieldset");
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("cla... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WFieldSet",
"fieldSet",
"=",
"(",
"WFieldSet",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderCo... | Paints the given WFieldSet.
@param component the WFieldSet to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WFieldSet",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WFieldSetRenderer.java#L23-L78 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java | ThinTableModel.getColumnValue | public Object getColumnValue(int iColumnIndex, int iEditMode) {
"""
Get the value of the field at the column.
This is NOT a TableModel override, this is my method.
@param iColumnIndex The column.
@return The string at this location.
"""
Convert fieldInfo = this.getFieldInfo(iColumnIndex);
if... | java | public Object getColumnValue(int iColumnIndex, int iEditMode)
{
Convert fieldInfo = this.getFieldInfo(iColumnIndex);
if (fieldInfo != null)
return fieldInfo.getString();
return Constants.BLANK;
} | [
"public",
"Object",
"getColumnValue",
"(",
"int",
"iColumnIndex",
",",
"int",
"iEditMode",
")",
"{",
"Convert",
"fieldInfo",
"=",
"this",
".",
"getFieldInfo",
"(",
"iColumnIndex",
")",
";",
"if",
"(",
"fieldInfo",
"!=",
"null",
")",
"return",
"fieldInfo",
".... | Get the value of the field at the column.
This is NOT a TableModel override, this is my method.
@param iColumnIndex The column.
@return The string at this location. | [
"Get",
"the",
"value",
"of",
"the",
"field",
"at",
"the",
"column",
".",
"This",
"is",
"NOT",
"a",
"TableModel",
"override",
"this",
"is",
"my",
"method",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java#L336-L342 |
pravega/pravega | common/src/main/java/io/pravega/common/util/ToStringUtils.java | ToStringUtils.mapToString | public static <K, V> String mapToString(Map<K, V> map) {
"""
Transforms a map into a string of the from:
"K1=V1, K2=V2, K3=V3"
Where the string versions of the key and value are derived from their toString() function.
@param <K> The type of the keys of the map.
@param <V> The type of the values of the map.
... | java | public static <K, V> String mapToString(Map<K, V> map) {
Map<String, String> asStrings = map.entrySet()
.stream()
.collect(toMap(e -> e.getKey().toString(), e -> e.getValue().toString()));
asStrings.forEach((k, v) -> {... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"String",
"mapToString",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"asStrings",
"=",
"map",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
"... | Transforms a map into a string of the from:
"K1=V1, K2=V2, K3=V3"
Where the string versions of the key and value are derived from their toString() function.
@param <K> The type of the keys of the map.
@param <V> The type of the values of the map.
@param map The map to be serialized to a string
@return A string represe... | [
"Transforms",
"a",
"map",
"into",
"a",
"string",
"of",
"the",
"from",
":",
"K1",
"=",
"V1",
"K2",
"=",
"V2",
"K3",
"=",
"V3",
"Where",
"the",
"string",
"versions",
"of",
"the",
"key",
"and",
"value",
"are",
"derived",
"from",
"their",
"toString",
"()... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ToStringUtils.java#L50-L59 |
auth0/java-jwt | lib/src/main/java/com/auth0/jwt/algorithms/CryptoHelper.java | CryptoHelper.createSignatureFor | byte[] createSignatureFor(String algorithm, byte[] secretBytes, byte[] headerBytes, byte[] payloadBytes) throws NoSuchAlgorithmException, InvalidKeyException {
"""
Create signature for JWT header and payload.
@param algorithm algorithm name.
@param secretBytes algorithm secret.
@param headerBytes JWT header.
... | java | byte[] createSignatureFor(String algorithm, byte[] secretBytes, byte[] headerBytes, byte[] payloadBytes) throws NoSuchAlgorithmException, InvalidKeyException {
final Mac mac = Mac.getInstance(algorithm);
mac.init(new SecretKeySpec(secretBytes, algorithm));
mac.update(headerBytes);
mac.up... | [
"byte",
"[",
"]",
"createSignatureFor",
"(",
"String",
"algorithm",
",",
"byte",
"[",
"]",
"secretBytes",
",",
"byte",
"[",
"]",
"headerBytes",
",",
"byte",
"[",
"]",
"payloadBytes",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"... | Create signature for JWT header and payload.
@param algorithm algorithm name.
@param secretBytes algorithm secret.
@param headerBytes JWT header.
@param payloadBytes JWT payload.
@return the signature bytes.
@throws NoSuchAlgorithmException if the algorithm is not supported.
@throws InvalidKeyException if the given ke... | [
"Create",
"signature",
"for",
"JWT",
"header",
"and",
"payload",
"."
] | train | https://github.com/auth0/java-jwt/blob/890538970a9699b7251a4bfe4f26e8d7605ad530/lib/src/main/java/com/auth0/jwt/algorithms/CryptoHelper.java#L59-L65 |
apereo/cas | support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/AbstractMetadataResolverAdapter.java | AbstractMetadataResolverAdapter.loadMetadataFromResource | private List<MetadataResolver> loadMetadataFromResource(final MetadataFilter metadataFilter, final Resource resource, final String entityId) {
"""
Load metadata from resource.
@param metadataFilter the metadata filter
@param resource the resource
@param entityId the entity id
@return the list
... | java | private List<MetadataResolver> loadMetadataFromResource(final MetadataFilter metadataFilter, final Resource resource, final String entityId) {
LOGGER.debug("Evaluating metadata resource [{}]", resource.getFilename());
try (val in = getResourceInputStream(resource, entityId)) {
if (in.availab... | [
"private",
"List",
"<",
"MetadataResolver",
">",
"loadMetadataFromResource",
"(",
"final",
"MetadataFilter",
"metadataFilter",
",",
"final",
"Resource",
"resource",
",",
"final",
"String",
"entityId",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Evaluating metadata resou... | Load metadata from resource.
@param metadataFilter the metadata filter
@param resource the resource
@param entityId the entity id
@return the list | [
"Load",
"metadata",
"from",
"resource",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/AbstractMetadataResolverAdapter.java#L139-L152 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getDayOfCycle | private static int getDayOfCycle(long epochDay, int cycleNumber) {
"""
Returns day of cycle from the epoch day and cycle number.
@param epochDay an epoch day
@param cycleNumber a cycle number
@return a day of cycle
"""
Long day;
try {
day = ADJUSTED_CYCLES[cycleNumber];
... | java | private static int getDayOfCycle(long epochDay, int cycleNumber) {
Long day;
try {
day = ADJUSTED_CYCLES[cycleNumber];
} catch (ArrayIndexOutOfBoundsException e) {
day = null;
}
if (day == null) {
day = Long.valueOf(cycleNumber * 10631);
... | [
"private",
"static",
"int",
"getDayOfCycle",
"(",
"long",
"epochDay",
",",
"int",
"cycleNumber",
")",
"{",
"Long",
"day",
";",
"try",
"{",
"day",
"=",
"ADJUSTED_CYCLES",
"[",
"cycleNumber",
"]",
";",
"}",
"catch",
"(",
"ArrayIndexOutOfBoundsException",
"e",
... | Returns day of cycle from the epoch day and cycle number.
@param epochDay an epoch day
@param cycleNumber a cycle number
@return a day of cycle | [
"Returns",
"day",
"of",
"cycle",
"from",
"the",
"epoch",
"day",
"and",
"cycle",
"number",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L919-L931 |
lemire/JavaFastPFOR | src/main/java/me/lemire/integercompression/Simple16.java | Simple16.compressblock | public static final int compressblock(int[] out, int outOffset, int[] in, int inOffset, int n) {
"""
Compress an integer array using Simple16
@param out
the compressed output
@param outOffset
the offset of the output in the number of integers
@param in
the integer input array
@param inOffset
the offset o... | java | public static final int compressblock(int[] out, int outOffset, int[] in, int inOffset, int n) {
int numIdx, j, num, bits;
for (numIdx = 0; numIdx < S16_NUMSIZE; numIdx++) {
out[outOffset] = numIdx << S16_BITSSIZE;
num = (S16_NUM[numIdx] < n) ? S16_NUM[numIdx] : n;
for (j = 0, bits = 0; (j < num) && (in[i... | [
"public",
"static",
"final",
"int",
"compressblock",
"(",
"int",
"[",
"]",
"out",
",",
"int",
"outOffset",
",",
"int",
"[",
"]",
"in",
",",
"int",
"inOffset",
",",
"int",
"n",
")",
"{",
"int",
"numIdx",
",",
"j",
",",
"num",
",",
"bits",
";",
"fo... | Compress an integer array using Simple16
@param out
the compressed output
@param outOffset
the offset of the output in the number of integers
@param in
the integer input array
@param inOffset
the offset of the input in the number of integers
@param n
the number of elements to be compressed
@return the number of compre... | [
"Compress",
"an",
"integer",
"array",
"using",
"Simple16"
] | train | https://github.com/lemire/JavaFastPFOR/blob/ffeea61ab2fdb3854da7b0a557f8d22d674477f4/src/main/java/me/lemire/integercompression/Simple16.java#L46-L64 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/util/FileUtils.java | FileUtils.readToString | public static String readToString(InputStream inputStream, Charset charset) throws IOException {
"""
Read file input stream to string value.
@param inputStream
@param charset
@return
@throws IOException
"""
return new String(FileCopyUtils.copyToByteArray(inputStream), charset);
} | java | public static String readToString(InputStream inputStream, Charset charset) throws IOException {
return new String(FileCopyUtils.copyToByteArray(inputStream), charset);
} | [
"public",
"static",
"String",
"readToString",
"(",
"InputStream",
"inputStream",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"return",
"new",
"String",
"(",
"FileCopyUtils",
".",
"copyToByteArray",
"(",
"inputStream",
")",
",",
"charset",
")",
... | Read file input stream to string value.
@param inputStream
@param charset
@return
@throws IOException | [
"Read",
"file",
"input",
"stream",
"to",
"string",
"value",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/util/FileUtils.java#L125-L127 |
Teddy-Zhu/SilentGo | framework/src/main/java/com/silentgo/servlet/oreilly/multipart/BufferedServletInputStream.java | BufferedServletInputStream.findeol | private static int findeol(byte b[], int pos, int len) {
"""
Attempt to find the '\n' end of line marker as defined in the comment of
the <code>readLine</code> method of <code>ServletInputStream</code>.
@param b byte array to search.
@param pos position in byte array to search from.
@param len maximum number... | java | private static int findeol(byte b[], int pos, int len) {
int end = pos + len;
int i = pos;
while (i < end) {
if (b[i++] == '\n') {
return i - pos;
}
}
return -1;
} | [
"private",
"static",
"int",
"findeol",
"(",
"byte",
"b",
"[",
"]",
",",
"int",
"pos",
",",
"int",
"len",
")",
"{",
"int",
"end",
"=",
"pos",
"+",
"len",
";",
"int",
"i",
"=",
"pos",
";",
"while",
"(",
"i",
"<",
"end",
")",
"{",
"if",
"(",
"... | Attempt to find the '\n' end of line marker as defined in the comment of
the <code>readLine</code> method of <code>ServletInputStream</code>.
@param b byte array to search.
@param pos position in byte array to search from.
@param len maximum number of bytes to search.
@return the number of bytes including the \n, or ... | [
"Attempt",
"to",
"find",
"the",
"\\",
"n",
"end",
"of",
"line",
"marker",
"as",
"defined",
"in",
"the",
"comment",
"of",
"the",
"<code",
">",
"readLine<",
"/",
"code",
">",
"method",
"of",
"<code",
">",
"ServletInputStream<",
"/",
"code",
">",
"."
] | train | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/framework/src/main/java/com/silentgo/servlet/oreilly/multipart/BufferedServletInputStream.java#L151-L160 |
Dempsy/dempsy | dempsy-framework.api/src/main/java/net/dempsy/lifecycle/simple/MessageProcessor.java | MessageProcessor.invokeOutput | @Override
public List<KeyedMessageWithType> invokeOutput(final Mp instance) throws DempsyException {
"""
This lifecycle phase is implemented by invoking the {@link Mp#output()} method on the instance
@see MessageProcessorLifecycle#invokeOutput(Object)
"""
try {
return Arrays.asList(O... | java | @Override
public List<KeyedMessageWithType> invokeOutput(final Mp instance) throws DempsyException {
try {
return Arrays.asList(Optional.ofNullable(instance.output()).orElse(EMPTY_KEYED_MESSAGE_WITH_TYPE));
} catch(final RuntimeException rte) {
throw new DempsyException(rte, ... | [
"@",
"Override",
"public",
"List",
"<",
"KeyedMessageWithType",
">",
"invokeOutput",
"(",
"final",
"Mp",
"instance",
")",
"throws",
"DempsyException",
"{",
"try",
"{",
"return",
"Arrays",
".",
"asList",
"(",
"Optional",
".",
"ofNullable",
"(",
"instance",
".",... | This lifecycle phase is implemented by invoking the {@link Mp#output()} method on the instance
@see MessageProcessorLifecycle#invokeOutput(Object) | [
"This",
"lifecycle",
"phase",
"is",
"implemented",
"by",
"invoking",
"the",
"{",
"@link",
"Mp#output",
"()",
"}",
"method",
"on",
"the",
"instance"
] | train | https://github.com/Dempsy/dempsy/blob/cd3415b51b6787a6a9d9589b15f00ce674b6f113/dempsy-framework.api/src/main/java/net/dempsy/lifecycle/simple/MessageProcessor.java#L127-L134 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/AbstractList.java | AbstractList.checkRangeFromTo | protected static void checkRangeFromTo(int from, int to, int theSize) {
"""
Checks if the given range is within the contained array's bounds.
@throws IndexOutOfBoundsException if <tt>to!=from-1 || from<0 || from>to || to>=size()</tt>.
"""
if (to==from-1) return;
if (from<0 || from>to || to>=theSi... | java | protected static void checkRangeFromTo(int from, int to, int theSize) {
if (to==from-1) return;
if (from<0 || from>to || to>=theSize)
throw new IndexOutOfBoundsException("from: "+from+", to: "+to+", size="+theSize);
} | [
"protected",
"static",
"void",
"checkRangeFromTo",
"(",
"int",
"from",
",",
"int",
"to",
",",
"int",
"theSize",
")",
"{",
"if",
"(",
"to",
"==",
"from",
"-",
"1",
")",
"return",
";",
"if",
"(",
"from",
"<",
"0",
"||",
"from",
">",
"to",
"||",
"to... | Checks if the given range is within the contained array's bounds.
@throws IndexOutOfBoundsException if <tt>to!=from-1 || from<0 || from>to || to>=size()</tt>. | [
"Checks",
"if",
"the",
"given",
"range",
"is",
"within",
"the",
"contained",
"array",
"s",
"bounds",
"."
] | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/AbstractList.java#L75-L79 |
phax/ph-oton | ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageSimpleForm.java | AbstractWebPageSimpleForm.createViewToolbar | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createViewToolbar (@Nonnull final WPECTYPE aWPEC, @Nonnull final DATATYPE aObject) {
"""
Create toolbar for viewing an existing object. Contains the back button and
the edit button.
@param aWPEC
The web page execution context. Never <code>null</code>.
@pa... | java | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createViewToolbar (@Nonnull final WPECTYPE aWPEC, @Nonnull final DATATYPE aObject)
{
final Locale aDisplayLocale = aWPEC.getDisplayLocale ();
final TOOLBAR_TYPE aToolbar = createNewViewToolbar (aWPEC);
if (isActionAllowed (aWPEC, EWebPageSimpleFormAct... | [
"@",
"Nonnull",
"@",
"OverrideOnDemand",
"protected",
"TOOLBAR_TYPE",
"createViewToolbar",
"(",
"@",
"Nonnull",
"final",
"WPECTYPE",
"aWPEC",
",",
"@",
"Nonnull",
"final",
"DATATYPE",
"aObject",
")",
"{",
"final",
"Locale",
"aDisplayLocale",
"=",
"aWPEC",
".",
"... | Create toolbar for viewing an existing object. Contains the back button and
the edit button.
@param aWPEC
The web page execution context. Never <code>null</code>.
@param aObject
The object
@return Never <code>null</code>. | [
"Create",
"toolbar",
"for",
"viewing",
"an",
"existing",
"object",
".",
"Contains",
"the",
"back",
"button",
"and",
"the",
"edit",
"button",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageSimpleForm.java#L277-L293 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java | DeprecatedListWriter.addAnchor | private void addAnchor(DeprecatedAPIListBuilder builder, DeprElementKind kind, Content htmlTree) {
"""
Add the anchor.
@param builder the deprecated list builder
@param type the type of list being documented
@param htmlTree the content tree to which the anchor will be added
"""
if (builder.hasDocu... | java | private void addAnchor(DeprecatedAPIListBuilder builder, DeprElementKind kind, Content htmlTree) {
if (builder.hasDocumentation(kind)) {
htmlTree.addContent(getMarkerAnchor(getAnchorName(kind)));
}
} | [
"private",
"void",
"addAnchor",
"(",
"DeprecatedAPIListBuilder",
"builder",
",",
"DeprElementKind",
"kind",
",",
"Content",
"htmlTree",
")",
"{",
"if",
"(",
"builder",
".",
"hasDocumentation",
"(",
"kind",
")",
")",
"{",
"htmlTree",
".",
"addContent",
"(",
"ge... | Add the anchor.
@param builder the deprecated list builder
@param type the type of list being documented
@param htmlTree the content tree to which the anchor will be added | [
"Add",
"the",
"anchor",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java#L362-L366 |
HiddenStage/divide | Client/java-client/src/main/java/io/divide/client/BackendUser.java | BackendUser.signUp | public static SignUpResponse signUp(String username, String email, String password) {
"""
Perform syncronously sign up attempt.
@param username user name user will be identified by.
@param email user email address
@param password user password
@return login results.
"""
return signUp(new SignUpCred... | java | public static SignUpResponse signUp(String username, String email, String password){
return signUp(new SignUpCredentials(username,email,password));
} | [
"public",
"static",
"SignUpResponse",
"signUp",
"(",
"String",
"username",
",",
"String",
"email",
",",
"String",
"password",
")",
"{",
"return",
"signUp",
"(",
"new",
"SignUpCredentials",
"(",
"username",
",",
"email",
",",
"password",
")",
")",
";",
"}"
] | Perform syncronously sign up attempt.
@param username user name user will be identified by.
@param email user email address
@param password user password
@return login results. | [
"Perform",
"syncronously",
"sign",
"up",
"attempt",
"."
] | train | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Client/java-client/src/main/java/io/divide/client/BackendUser.java#L172-L174 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/DataChecksum.java | DataChecksum.newDataChecksum | public static DataChecksum newDataChecksum( byte bytes[], int offset ) {
"""
Creates a DataChecksum from HEADER_LEN bytes from arr[offset].
@return DataChecksum of the type in the array or null in case of an error.
"""
if ( offset < 0 || bytes.length < offset + HEADER_LEN ) {
return null;
}
... | java | public static DataChecksum newDataChecksum( byte bytes[], int offset ) {
if ( offset < 0 || bytes.length < offset + HEADER_LEN ) {
return null;
}
// like readInt():
int bytesPerChecksum = getIntFromBytes(bytes, offset + 1);
return newDataChecksum( bytes[offset], bytesPerChecksum );... | [
"public",
"static",
"DataChecksum",
"newDataChecksum",
"(",
"byte",
"bytes",
"[",
"]",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"offset",
"<",
"0",
"||",
"bytes",
".",
"length",
"<",
"offset",
"+",
"HEADER_LEN",
")",
"{",
"return",
"null",
";",
"}",
... | Creates a DataChecksum from HEADER_LEN bytes from arr[offset].
@return DataChecksum of the type in the array or null in case of an error. | [
"Creates",
"a",
"DataChecksum",
"from",
"HEADER_LEN",
"bytes",
"from",
"arr",
"[",
"offset",
"]",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/DataChecksum.java#L115-L123 |
OpenTSDB/opentsdb | src/meta/TSMeta.java | TSMeta.getStorageJSON | private byte[] getStorageJSON() {
"""
Formats the JSON output for writing to storage. It drops objects we don't
need or want to store (such as the UIDMeta objects or the total dps) to
save space. It also serializes in order so that we can make a proper CAS
call. Otherwise the POJO serializer may place the field... | java | private byte[] getStorageJSON() {
// 256 bytes is a good starting value, assumes default info
final ByteArrayOutputStream output = new ByteArrayOutputStream(256);
try {
final JsonGenerator json = JSON.getFactory().createGenerator(output);
json.writeStartObject();
json.writeStringField("ts... | [
"private",
"byte",
"[",
"]",
"getStorageJSON",
"(",
")",
"{",
"// 256 bytes is a good starting value, assumes default info",
"final",
"ByteArrayOutputStream",
"output",
"=",
"new",
"ByteArrayOutputStream",
"(",
"256",
")",
";",
"try",
"{",
"final",
"JsonGenerator",
"jso... | Formats the JSON output for writing to storage. It drops objects we don't
need or want to store (such as the UIDMeta objects or the total dps) to
save space. It also serializes in order so that we can make a proper CAS
call. Otherwise the POJO serializer may place the fields in any order
and CAS calls would fail all th... | [
"Formats",
"the",
"JSON",
"output",
"for",
"writing",
"to",
"storage",
".",
"It",
"drops",
"objects",
"we",
"don",
"t",
"need",
"or",
"want",
"to",
"store",
"(",
"such",
"as",
"the",
"UIDMeta",
"objects",
"or",
"the",
"total",
"dps",
")",
"to",
"save",... | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/meta/TSMeta.java#L845-L877 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java | CDKMCS.getSubgraphAtomsMaps | public static List<List<CDKRMap>> getSubgraphAtomsMaps(IAtomContainer sourceGraph, IAtomContainer targetGraph,
boolean shouldMatchBonds) throws CDKException {
"""
Returns all subgraph 'atom mappings' found for targetGraph in sourceGraph.
This is an ArrayList of ArrayLists of CDKRMap objects.
@param... | java | public static List<List<CDKRMap>> getSubgraphAtomsMaps(IAtomContainer sourceGraph, IAtomContainer targetGraph,
boolean shouldMatchBonds) throws CDKException {
List<CDKRMap> list = checkSingleAtomCases(sourceGraph, targetGraph);
if (list == null) {
return makeAtomsMapsOfBondsMaps(... | [
"public",
"static",
"List",
"<",
"List",
"<",
"CDKRMap",
">",
">",
"getSubgraphAtomsMaps",
"(",
"IAtomContainer",
"sourceGraph",
",",
"IAtomContainer",
"targetGraph",
",",
"boolean",
"shouldMatchBonds",
")",
"throws",
"CDKException",
"{",
"List",
"<",
"CDKRMap",
"... | Returns all subgraph 'atom mappings' found for targetGraph in sourceGraph.
This is an ArrayList of ArrayLists of CDKRMap objects.
@param sourceGraph first molecule. Must not be an IQueryAtomContainer.
@param targetGraph second molecule. May be an IQueryAtomContainer.
@param shouldMatchBonds
@return all subgrap... | [
"Returns",
"all",
"subgraph",
"atom",
"mappings",
"found",
"for",
"targetGraph",
"in",
"sourceGraph",
".",
"This",
"is",
"an",
"ArrayList",
"of",
"ArrayLists",
"of",
"CDKRMap",
"objects",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java#L304-L315 |
paypal/SeLion | common/src/main/java/com/paypal/selion/platform/utilities/FileAssistant.java | FileAssistant.writeStreamToFile | public static void writeStreamToFile(InputStream isr, String fileName, String outputFolder) throws IOException {
"""
Write an {@link InputStream} to a file
@param isr the {@link InputStream}
@param fileName The target file name to use. Do not include the path.
@param outputFolder The target folder to use.
@thr... | java | public static void writeStreamToFile(InputStream isr, String fileName, String outputFolder) throws IOException {
logger.entering(new Object[] { isr, fileName, outputFolder });
FileUtils.copyInputStreamToFile(isr, new File(outputFolder + "/" + fileName));
logger.exiting();
} | [
"public",
"static",
"void",
"writeStreamToFile",
"(",
"InputStream",
"isr",
",",
"String",
"fileName",
",",
"String",
"outputFolder",
")",
"throws",
"IOException",
"{",
"logger",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"isr",
",",
"fileName",
"... | Write an {@link InputStream} to a file
@param isr the {@link InputStream}
@param fileName The target file name to use. Do not include the path.
@param outputFolder The target folder to use.
@throws IOException | [
"Write",
"an",
"{"
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/common/src/main/java/com/paypal/selion/platform/utilities/FileAssistant.java#L114-L118 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationRootElements.java | CollationRootElements.getPrimaryAfter | long getPrimaryAfter(long p, int index, boolean isCompressible) {
"""
Returns the primary weight after p where index=findPrimary(p).
p must be at least the first root primary.
"""
assert(p == (elements[index] & 0xffffff00L) || isEndOfPrimaryRange(elements[index + 1]));
long q = elements[++inde... | java | long getPrimaryAfter(long p, int index, boolean isCompressible) {
assert(p == (elements[index] & 0xffffff00L) || isEndOfPrimaryRange(elements[index + 1]));
long q = elements[++index];
int step;
if((q & SEC_TER_DELTA_FLAG) == 0 && (step = (int)q & PRIMARY_STEP_MASK) != 0) {
//... | [
"long",
"getPrimaryAfter",
"(",
"long",
"p",
",",
"int",
"index",
",",
"boolean",
"isCompressible",
")",
"{",
"assert",
"(",
"p",
"==",
"(",
"elements",
"[",
"index",
"]",
"&",
"0xffffff00",
"L",
")",
"||",
"isEndOfPrimaryRange",
"(",
"elements",
"[",
"i... | Returns the primary weight after p where index=findPrimary(p).
p must be at least the first root primary. | [
"Returns",
"the",
"primary",
"weight",
"after",
"p",
"where",
"index",
"=",
"findPrimary",
"(",
"p",
")",
".",
"p",
"must",
"be",
"at",
"least",
"the",
"first",
"root",
"primary",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationRootElements.java#L323-L342 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseImportDeclaration | private Decl parseImportDeclaration() {
"""
Parse an import declaration, which is of the form:
<pre>
ImportDecl ::= Identifier ["from" ('*' | Identifier)] ( '::' ('*' | Identifier) )*
</pre>
"""
int start = index;
EnclosingScope scope = new EnclosingScope();
match(Import);
Identifier fromName = pa... | java | private Decl parseImportDeclaration() {
int start = index;
EnclosingScope scope = new EnclosingScope();
match(Import);
Identifier fromName = parseOptionalFrom(scope);
Tuple<Identifier >filterPath = parseFilterPath(scope);
int end = index;
matchEndLine();
Decl.Import imprt;
if(fromName != null) {
im... | [
"private",
"Decl",
"parseImportDeclaration",
"(",
")",
"{",
"int",
"start",
"=",
"index",
";",
"EnclosingScope",
"scope",
"=",
"new",
"EnclosingScope",
"(",
")",
";",
"match",
"(",
"Import",
")",
";",
"Identifier",
"fromName",
"=",
"parseOptionalFrom",
"(",
... | Parse an import declaration, which is of the form:
<pre>
ImportDecl ::= Identifier ["from" ('*' | Identifier)] ( '::' ('*' | Identifier) )*
</pre> | [
"Parse",
"an",
"import",
"declaration",
"which",
"is",
"of",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L148-L163 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/SailthruClient.java | SailthruClient.deleteAlert | public JsonResponse deleteAlert(String email, String alertId) throws IOException {
"""
Delete existing user alert
@param email User.java Email
@param alertId Alert ID
@throws IOException
"""
Map<String, Object> data = new HashMap<String, Object>();
data.put(Alert.PARAM_EMAIL, email);
... | java | public JsonResponse deleteAlert(String email, String alertId) throws IOException {
Map<String, Object> data = new HashMap<String, Object>();
data.put(Alert.PARAM_EMAIL, email);
data.put(Alert.PARAM_ALERT_ID, alertId);
return apiDelete(ApiAction.alert, data);
} | [
"public",
"JsonResponse",
"deleteAlert",
"(",
"String",
"email",
",",
"String",
"alertId",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"data... | Delete existing user alert
@param email User.java Email
@param alertId Alert ID
@throws IOException | [
"Delete",
"existing",
"user",
"alert"
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/SailthruClient.java#L353-L358 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_output_graylog_stream_streamId_rule_ruleId_GET | public ArrayList<OvhStreamRule> serviceName_output_graylog_stream_streamId_rule_ruleId_GET(String serviceName, String streamId, String ruleId) throws IOException {
"""
Returns details of specified graylog stream rule
REST: GET /dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/rule/{ruleId}
@param serv... | java | public ArrayList<OvhStreamRule> serviceName_output_graylog_stream_streamId_rule_ruleId_GET(String serviceName, String streamId, String ruleId) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/rule/{ruleId}";
StringBuilder sb = path(qPath, serviceName, streamId, ruleId)... | [
"public",
"ArrayList",
"<",
"OvhStreamRule",
">",
"serviceName_output_graylog_stream_streamId_rule_ruleId_GET",
"(",
"String",
"serviceName",
",",
"String",
"streamId",
",",
"String",
"ruleId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/logs/{ser... | Returns details of specified graylog stream rule
REST: GET /dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/rule/{ruleId}
@param serviceName [required] Service name
@param streamId [required] Stream ID
@param ruleId [required] Rule ID | [
"Returns",
"details",
"of",
"specified",
"graylog",
"stream",
"rule"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L1530-L1535 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java | RobustLoaderWriterResilienceStrategy.removeAllFailure | @Override
public void removeAllFailure(Iterable<? extends K> keys, StoreAccessException e) {
"""
Delete all keys from the loader-writer.
@param keys the keys being removed
@param e the triggered failure
"""
try {
loaderWriter.deleteAll(keys);
} catch(BulkCacheWritingException e1) {
th... | java | @Override
public void removeAllFailure(Iterable<? extends K> keys, StoreAccessException e) {
try {
loaderWriter.deleteAll(keys);
} catch(BulkCacheWritingException e1) {
throw e1;
} catch (Exception e1) {
throw ExceptionFactory.newCacheWritingException(e1, e);
} finally {
cleanu... | [
"@",
"Override",
"public",
"void",
"removeAllFailure",
"(",
"Iterable",
"<",
"?",
"extends",
"K",
">",
"keys",
",",
"StoreAccessException",
"e",
")",
"{",
"try",
"{",
"loaderWriter",
".",
"deleteAll",
"(",
"keys",
")",
";",
"}",
"catch",
"(",
"BulkCacheWri... | Delete all keys from the loader-writer.
@param keys the keys being removed
@param e the triggered failure | [
"Delete",
"all",
"keys",
"from",
"the",
"loader",
"-",
"writer",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/resilience/RobustLoaderWriterResilienceStrategy.java#L309-L320 |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java | NwwUtilities.insertBeforeCompass | public static void insertBeforeCompass( WorldWindow wwd, Layer layer ) {
"""
Insert a layer before the compass layer.
@param wwd the {@link WorldWindow}.
@param layer the layer to insert.
"""
// Insert the layer into the layer list just before the compass.
int compassPosition = 0;
L... | java | public static void insertBeforeCompass( WorldWindow wwd, Layer layer ) {
// Insert the layer into the layer list just before the compass.
int compassPosition = 0;
LayerList layers = wwd.getModel().getLayers();
for( Layer l : layers ) {
if (l instanceof CompassLayer)
... | [
"public",
"static",
"void",
"insertBeforeCompass",
"(",
"WorldWindow",
"wwd",
",",
"Layer",
"layer",
")",
"{",
"// Insert the layer into the layer list just before the compass.",
"int",
"compassPosition",
"=",
"0",
";",
"LayerList",
"layers",
"=",
"wwd",
".",
"getModel"... | Insert a layer before the compass layer.
@param wwd the {@link WorldWindow}.
@param layer the layer to insert. | [
"Insert",
"a",
"layer",
"before",
"the",
"compass",
"layer",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/nww/utils/NwwUtilities.java#L353-L362 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java | TldVarianceFilter.computeVariance | protected double computeVariance(int x0, int y0, int x1, int y1) {
"""
Computes the variance inside the specified rectangle. x0 and y0 must be > 0.
@return variance
"""
// can use unsafe operations here since x0 > 0 and y0 > 0
double square = GIntegralImageOps.block_unsafe(integralSq, x0 - 1, y0 - 1... | java | protected double computeVariance(int x0, int y0, int x1, int y1) {
// can use unsafe operations here since x0 > 0 and y0 > 0
double square = GIntegralImageOps.block_unsafe(integralSq, x0 - 1, y0 - 1, x1 - 1, y1 - 1);
double area = (x1-x0)*(y1-y0);
double mean = GIntegralImageOps.block_unsafe(integral, x0 - 1, ... | [
"protected",
"double",
"computeVariance",
"(",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"// can use unsafe operations here since x0 > 0 and y0 > 0",
"double",
"square",
"=",
"GIntegralImageOps",
".",
"block_unsafe",
"(",
"integral... | Computes the variance inside the specified rectangle. x0 and y0 must be > 0.
@return variance | [
"Computes",
"the",
"variance",
"inside",
"the",
"specified",
"rectangle",
".",
"x0",
"and",
"y0",
"must",
"be",
">",
";",
"0",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java#L106-L114 |
UrielCh/ovh-java-sdk | ovh-java-sdk-licenseworklight/src/main/java/net/minidev/ovh/api/ApiOvhLicenseworklight.java | ApiOvhLicenseworklight.serviceName_tasks_GET | public ArrayList<Long> serviceName_tasks_GET(String serviceName, OvhActionType action, OvhTaskStateEnum status) throws IOException {
"""
Tasks linked to this license
REST: GET /license/worklight/{serviceName}/tasks
@param status [required] Filter the value of status property (=)
@param action [required] Filte... | java | public ArrayList<Long> serviceName_tasks_GET(String serviceName, OvhActionType action, OvhTaskStateEnum status) throws IOException {
String qPath = "/license/worklight/{serviceName}/tasks";
StringBuilder sb = path(qPath, serviceName);
query(sb, "action", action);
query(sb, "status", status);
String resp = exe... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_tasks_GET",
"(",
"String",
"serviceName",
",",
"OvhActionType",
"action",
",",
"OvhTaskStateEnum",
"status",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/license/worklight/{serviceName}/tasks\"",
";... | Tasks linked to this license
REST: GET /license/worklight/{serviceName}/tasks
@param status [required] Filter the value of status property (=)
@param action [required] Filter the value of action property (=)
@param serviceName [required] The name of your WorkLight license | [
"Tasks",
"linked",
"to",
"this",
"license"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-licenseworklight/src/main/java/net/minidev/ovh/api/ApiOvhLicenseworklight.java#L78-L85 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationRequest.java | PutIntegrationRequest.withRequestTemplates | public PutIntegrationRequest withRequestTemplates(java.util.Map<String, String> requestTemplates) {
"""
<p>
Represents a map of Velocity templates that are applied on the request payload based on the value of the
Content-Type header sent by the client. The content type value is the key in this map, and the templ... | java | public PutIntegrationRequest withRequestTemplates(java.util.Map<String, String> requestTemplates) {
setRequestTemplates(requestTemplates);
return this;
} | [
"public",
"PutIntegrationRequest",
"withRequestTemplates",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestTemplates",
")",
"{",
"setRequestTemplates",
"(",
"requestTemplates",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Represents a map of Velocity templates that are applied on the request payload based on the value of the
Content-Type header sent by the client. The content type value is the key in this map, and the template (as a
String) is the value.
</p>
@param requestTemplates
Represents a map of Velocity templates that are a... | [
"<p",
">",
"Represents",
"a",
"map",
"of",
"Velocity",
"templates",
"that",
"are",
"applied",
"on",
"the",
"request",
"payload",
"based",
"on",
"the",
"value",
"of",
"the",
"Content",
"-",
"Type",
"header",
"sent",
"by",
"the",
"client",
".",
"The",
"con... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationRequest.java#L978-L981 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java | MessageFormat.setCustomArgStartFormat | private void setCustomArgStartFormat(int argStart, Format formatter) {
"""
Sets a custom formatter for a MessagePattern ARG_START part index.
"Custom" formatters are provided by the user via setFormat() or similar APIs.
"""
setArgStartFormat(argStart, formatter);
if (customFormatArgStarts == n... | java | private void setCustomArgStartFormat(int argStart, Format formatter) {
setArgStartFormat(argStart, formatter);
if (customFormatArgStarts == null) {
customFormatArgStarts = new HashSet<Integer>();
}
customFormatArgStarts.add(argStart);
} | [
"private",
"void",
"setCustomArgStartFormat",
"(",
"int",
"argStart",
",",
"Format",
"formatter",
")",
"{",
"setArgStartFormat",
"(",
"argStart",
",",
"formatter",
")",
";",
"if",
"(",
"customFormatArgStarts",
"==",
"null",
")",
"{",
"customFormatArgStarts",
"=",
... | Sets a custom formatter for a MessagePattern ARG_START part index.
"Custom" formatters are provided by the user via setFormat() or similar APIs. | [
"Sets",
"a",
"custom",
"formatter",
"for",
"a",
"MessagePattern",
"ARG_START",
"part",
"index",
".",
"Custom",
"formatters",
"are",
"provided",
"by",
"the",
"user",
"via",
"setFormat",
"()",
"or",
"similar",
"APIs",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java#L2400-L2406 |
cdk/cdk | base/dict/src/main/java/org/openscience/cdk/dict/DictionaryDatabase.java | DictionaryDatabase.readDictionary | public void readDictionary(Reader reader, String name) {
"""
Reads a custom dictionary into the database.
@param reader The reader from which the dictionary data will be read
@param name The name of the dictionary
"""
name = name.toLowerCase();
logger.debug("Reading dictionary: ", name);
... | java | public void readDictionary(Reader reader, String name) {
name = name.toLowerCase();
logger.debug("Reading dictionary: ", name);
if (!dictionaries.containsKey(name)) {
try {
Dictionary dictionary = Dictionary.unmarshal(reader);
dictionaries.put(name, di... | [
"public",
"void",
"readDictionary",
"(",
"Reader",
"reader",
",",
"String",
"name",
")",
"{",
"name",
"=",
"name",
".",
"toLowerCase",
"(",
")",
";",
"logger",
".",
"debug",
"(",
"\"Reading dictionary: \"",
",",
"name",
")",
";",
"if",
"(",
"!",
"diction... | Reads a custom dictionary into the database.
@param reader The reader from which the dictionary data will be read
@param name The name of the dictionary | [
"Reads",
"a",
"custom",
"dictionary",
"into",
"the",
"database",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/dict/src/main/java/org/openscience/cdk/dict/DictionaryDatabase.java#L112-L127 |
actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/ActorSystem.java | ActorSystem.addDispatcher | public void addDispatcher(String dispatcherId, int threadsCount) {
"""
Adding dispatcher with specific threads count
@param dispatcherId dispatcher id
@param threadsCount threads count
"""
synchronized (dispatchers) {
if (dispatchers.containsKey(dispatcherId)) {
return;
... | java | public void addDispatcher(String dispatcherId, int threadsCount) {
synchronized (dispatchers) {
if (dispatchers.containsKey(dispatcherId)) {
return;
}
dispatchers.put(dispatcherId, new ActorDispatcher(dispatcherId, this, threadsCount));
}
} | [
"public",
"void",
"addDispatcher",
"(",
"String",
"dispatcherId",
",",
"int",
"threadsCount",
")",
"{",
"synchronized",
"(",
"dispatchers",
")",
"{",
"if",
"(",
"dispatchers",
".",
"containsKey",
"(",
"dispatcherId",
")",
")",
"{",
"return",
";",
"}",
"dispa... | Adding dispatcher with specific threads count
@param dispatcherId dispatcher id
@param threadsCount threads count | [
"Adding",
"dispatcher",
"with",
"specific",
"threads",
"count"
] | train | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/ActorSystem.java#L59-L66 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsPatternPanelMonthlyController.java | CmsPatternPanelMonthlyController.weeksChange | public void weeksChange(String week, Boolean value) {
"""
Handle a change in the weeks of month.
@param week the changed weeks checkbox's internal value.
@param value the new value of the changed checkbox.
"""
final WeekOfMonth changedWeek = WeekOfMonth.valueOf(week);
boolean newValue = (nul... | java | public void weeksChange(String week, Boolean value) {
final WeekOfMonth changedWeek = WeekOfMonth.valueOf(week);
boolean newValue = (null != value) && value.booleanValue();
boolean currentValue = m_model.getWeeksOfMonth().contains(changedWeek);
if (newValue != currentValue) {
... | [
"public",
"void",
"weeksChange",
"(",
"String",
"week",
",",
"Boolean",
"value",
")",
"{",
"final",
"WeekOfMonth",
"changedWeek",
"=",
"WeekOfMonth",
".",
"valueOf",
"(",
"week",
")",
";",
"boolean",
"newValue",
"=",
"(",
"null",
"!=",
"value",
")",
"&&",
... | Handle a change in the weeks of month.
@param week the changed weeks checkbox's internal value.
@param value the new value of the changed checkbox. | [
"Handle",
"a",
"change",
"in",
"the",
"weeks",
"of",
"month",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsPatternPanelMonthlyController.java#L115-L136 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_leaf.java | Dcs_leaf.cs_leaf | public static int cs_leaf(int i, int j, int[] first, int first_offset, int[] maxfirst, int maxfirst_offset,
int[] prevleaf, int prevleaf_offset, int[] ancestor, int ancestor_offset, int[] jleaf) {
"""
Determines if j is a leaf of the skeleton matrix and find lowest common
ancestor (lca).
@param i
... | java | public static int cs_leaf(int i, int j, int[] first, int first_offset, int[] maxfirst, int maxfirst_offset,
int[] prevleaf, int prevleaf_offset, int[] ancestor, int ancestor_offset, int[] jleaf) {
int q, s, sparent, jprev;
if (first == null || maxfirst == null || prevleaf == null || ances... | [
"public",
"static",
"int",
"cs_leaf",
"(",
"int",
"i",
",",
"int",
"j",
",",
"int",
"[",
"]",
"first",
",",
"int",
"first_offset",
",",
"int",
"[",
"]",
"maxfirst",
",",
"int",
"maxfirst_offset",
",",
"int",
"[",
"]",
"prevleaf",
",",
"int",
"prevlea... | Determines if j is a leaf of the skeleton matrix and find lowest common
ancestor (lca).
@param i
@param j
@param first
@param first_offset
@param maxfirst
@param maxfirst_offset
@param prevleaf
@param prevleaf_offset
@param ancestor
@param ancestor_offset
@param jleaf
@return lca(jprev,j) | [
"Determines",
"if",
"j",
"is",
"a",
"leaf",
"of",
"the",
"skeleton",
"matrix",
"and",
"find",
"lowest",
"common",
"ancestor",
"(",
"lca",
")",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_leaf.java#L53-L74 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/internal/ResourceLoader.java | ResourceLoader.getResource | public ResourceHandle getResource(URL[] sources, String name) {
"""
Gets resource with given name at the given search path. The path is searched iteratively, one URL at a time. If
the URL points to a directory, the name is the file path relative to this directory. If the URL points to the JAR
file, the name iden... | java | public ResourceHandle getResource(URL[] sources, String name)
{
Set<URL> visited = new HashSet<>();
for (URL source : sources) {
ResourceHandle h = getResource(source, name, visited, null);
if (h != null) {
return h;
}
}
return null... | [
"public",
"ResourceHandle",
"getResource",
"(",
"URL",
"[",
"]",
"sources",
",",
"String",
"name",
")",
"{",
"Set",
"<",
"URL",
">",
"visited",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"URL",
"source",
":",
"sources",
")",
"{",
"Resour... | Gets resource with given name at the given search path. The path is searched iteratively, one URL at a time. If
the URL points to a directory, the name is the file path relative to this directory. If the URL points to the JAR
file, the name identifies an entry in that JAR file. If the URL points to the JAR file, the re... | [
"Gets",
"resource",
"with",
"given",
"name",
"at",
"the",
"given",
"search",
"path",
".",
"The",
"path",
"is",
"searched",
"iteratively",
"one",
"URL",
"at",
"a",
"time",
".",
"If",
"the",
"URL",
"points",
"to",
"a",
"directory",
"the",
"name",
"is",
"... | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-api/src/main/java/org/xwiki/classloader/internal/ResourceLoader.java#L131-L141 |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/ForkedJvm.java | ForkedJvm._getClassSource | private static File _getClassSource (final String className) {
"""
Gets the JAR file or directory that contains the specified class.
@param className
The qualified name of the class/interface to find, may be
<code>null</code>.
@return The absolute path to the class source location or <code>null</code>
if un... | java | private static File _getClassSource (final String className)
{
if (className != null)
{
final String classResource = className.replace ('.', '/') + ".class";
return _getResourceSource (classResource, Thread.currentThread ().getContextClassLoader ());
}
return null;
} | [
"private",
"static",
"File",
"_getClassSource",
"(",
"final",
"String",
"className",
")",
"{",
"if",
"(",
"className",
"!=",
"null",
")",
"{",
"final",
"String",
"classResource",
"=",
"className",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
"+",
... | Gets the JAR file or directory that contains the specified class.
@param className
The qualified name of the class/interface to find, may be
<code>null</code>.
@return The absolute path to the class source location or <code>null</code>
if unknown. | [
"Gets",
"the",
"JAR",
"file",
"or",
"directory",
"that",
"contains",
"the",
"specified",
"class",
"."
] | train | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/ForkedJvm.java#L213-L221 |
OpenTSDB/opentsdb | src/tools/ConfigArgP.java | ConfigArgP.loadConfig | protected static Properties loadConfig(String source, InputStream is) {
"""
Loads properties from the passed input stream
@param source The name of the source the properties are being loaded from
@param is The input stream to load from
@return the loaded properties
"""
try {
Properties p = new Pro... | java | protected static Properties loadConfig(String source, InputStream is) {
try {
Properties p = new Properties();
p.load(is);
// trim the value as it may have trailing white-space
Set<String> keys = p.stringPropertyNames();
for(String key: keys) {
p.setProperty(key, p.getProperty(... | [
"protected",
"static",
"Properties",
"loadConfig",
"(",
"String",
"source",
",",
"InputStream",
"is",
")",
"{",
"try",
"{",
"Properties",
"p",
"=",
"new",
"Properties",
"(",
")",
";",
"p",
".",
"load",
"(",
"is",
")",
";",
"// trim the value as it may have t... | Loads properties from the passed input stream
@param source The name of the source the properties are being loaded from
@param is The input stream to load from
@return the loaded properties | [
"Loads",
"properties",
"from",
"the",
"passed",
"input",
"stream"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/ConfigArgP.java#L240-L255 |
beanshell/beanshell | src/main/java/bsh/BSHAllocationExpression.java | BSHAllocationExpression.arrayNewInstance | private Object arrayNewInstance(
Class<?> type, BSHArrayDimensions dimensionsNode,
CallStack callstack, Interpreter interpreter) throws EvalError {
"""
Create an array of the dimensions specified in dimensionsNode.
dimensionsNode may contain a number of "undefined" as well as "defined"
di... | java | private Object arrayNewInstance(
Class<?> type, BSHArrayDimensions dimensionsNode,
CallStack callstack, Interpreter interpreter) throws EvalError {
if ( dimensionsNode.numUndefinedDims > 0 ) {
Object proto = Array.newInstance(
type, new int [dimensionsNode.num... | [
"private",
"Object",
"arrayNewInstance",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"BSHArrayDimensions",
"dimensionsNode",
",",
"CallStack",
"callstack",
",",
"Interpreter",
"interpreter",
")",
"throws",
"EvalError",
"{",
"if",
"(",
"dimensionsNode",
".",
"numUnde... | Create an array of the dimensions specified in dimensionsNode.
dimensionsNode may contain a number of "undefined" as well as "defined"
dimensions.
<p>
Background: in Java arrays are implemented in arrays-of-arrays style
where, for example, a two dimensional array is a an array of arrays of
some base type. Each dimens... | [
"Create",
"an",
"array",
"of",
"the",
"dimensions",
"specified",
"in",
"dimensionsNode",
".",
"dimensionsNode",
"may",
"contain",
"a",
"number",
"of",
"undefined",
"as",
"well",
"as",
"defined",
"dimensions",
".",
"<p",
">"
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/BSHAllocationExpression.java#L292-L313 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HiveJdbcConnector.java | HiveJdbcConnector.addHiveSiteDirToClasspath | private static void addHiveSiteDirToClasspath(String hiveSiteDir) {
"""
Helper method to add the directory containing the hive-site.xml file to the classpath
@param hiveSiteDir is the path to to the folder containing the hive-site.xml file
"""
LOG.info("Adding " + hiveSiteDir + " to CLASSPATH");
File ... | java | private static void addHiveSiteDirToClasspath(String hiveSiteDir) {
LOG.info("Adding " + hiveSiteDir + " to CLASSPATH");
File f = new File(hiveSiteDir);
try {
URL u = f.toURI().toURL();
URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
Class<URLClassLoade... | [
"private",
"static",
"void",
"addHiveSiteDirToClasspath",
"(",
"String",
"hiveSiteDir",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Adding \"",
"+",
"hiveSiteDir",
"+",
"\" to CLASSPATH\"",
")",
";",
"File",
"f",
"=",
"new",
"File",
"(",
"hiveSiteDir",
")",
";",
"... | Helper method to add the directory containing the hive-site.xml file to the classpath
@param hiveSiteDir is the path to to the folder containing the hive-site.xml file | [
"Helper",
"method",
"to",
"add",
"the",
"directory",
"containing",
"the",
"hive",
"-",
"site",
".",
"xml",
"file",
"to",
"the",
"classpath"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HiveJdbcConnector.java#L195-L208 |
upwork/java-upwork | src/com/Upwork/api/Routers/Workdiary.java | Workdiary.getByContract | public JSONObject getByContract(String contract, String date, HashMap<String, String> params) throws JSONException {
"""
Get Work Diary by Contract
@param contract Contract ID
@param date Date
@param params (Optional) Parameters
@throws JSONException If error occurred
@return {@link JSONObject}
""... | java | public JSONObject getByContract(String contract, String date, HashMap<String, String> params) throws JSONException {
return oClient.get("/team/v3/workdiaries/contracts/" + contract + "/" + date, params);
} | [
"public",
"JSONObject",
"getByContract",
"(",
"String",
"contract",
",",
"String",
"date",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"get",
"(",
"\"/team/v3/workdiaries/contracts/\""... | Get Work Diary by Contract
@param contract Contract ID
@param date Date
@param params (Optional) Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Get",
"Work",
"Diary",
"by",
"Contract"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Workdiary.java#L68-L70 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java | AbstractJsonDeserializer.getDateParam | protected Date getDateParam(String paramName, String errorMessage, Map<String, Object> mapToUse) throws IOException {
"""
Parses a date from either dd/MM/yyyy or yyyy-MM-dd format
@param paramName the name of the parameter containing the date
@param errorMessage the message to put in an error if one occurs
... | java | protected Date getDateParam(String paramName, String errorMessage, Map<String, Object> mapToUse) throws IOException {
String dateInString = getStringParam(paramName, errorMessage, mapToUse);
if (dateInString == null) {
if (errorMessage == null) {
return null;
} el... | [
"protected",
"Date",
"getDateParam",
"(",
"String",
"paramName",
",",
"String",
"errorMessage",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"mapToUse",
")",
"throws",
"IOException",
"{",
"String",
"dateInString",
"=",
"getStringParam",
"(",
"paramName",
",",
... | Parses a date from either dd/MM/yyyy or yyyy-MM-dd format
@param paramName the name of the parameter containing the date
@param errorMessage the message to put in an error if one occurs
@param mapToUse the external map that should be used as inputsource for parameters
@return a date object correcponding with th... | [
"Parses",
"a",
"date",
"from",
"either",
"dd",
"/",
"MM",
"/",
"yyyy",
"or",
"yyyy",
"-",
"MM",
"-",
"dd",
"format"
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java#L357-L381 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/OrmElf.java | OrmElf.objectById | public static <T> T objectById(Connection connection, Class<T> clazz, Object... args) throws SQLException {
"""
Load an object by it's ID. The @Id annotated field(s) of the object is used to
set query parameters.
@param connection a SQL Connection object
@param clazz the class of the object to load
@param a... | java | public static <T> T objectById(Connection connection, Class<T> clazz, Object... args) throws SQLException
{
return OrmReader.objectById(connection, clazz, args);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"objectById",
"(",
"Connection",
"connection",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"Object",
"...",
"args",
")",
"throws",
"SQLException",
"{",
"return",
"OrmReader",
".",
"objectById",
"(",
"connection",
",",... | Load an object by it's ID. The @Id annotated field(s) of the object is used to
set query parameters.
@param connection a SQL Connection object
@param clazz the class of the object to load
@param args the query parameter used to find the object by it's ID
@param <T> the type of the object to load
@return the populated... | [
"Load",
"an",
"object",
"by",
"it",
"s",
"ID",
".",
"The",
"@Id",
"annotated",
"field",
"(",
"s",
")",
"of",
"the",
"object",
"is",
"used",
"to",
"set",
"query",
"parameters",
"."
] | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/OrmElf.java#L61-L64 |
geomajas/geomajas-project-client-gwt2 | impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java | JsonService.getShortValue | public static Short getShortValue(JSONObject jsonObject, String key) throws JSONException {
"""
Get a short value from a {@link JSONObject}.
@param jsonObject The object to get the key value from.
@param key The name of the key to search the value for.
@return Returns the value for the key in the object .
@t... | java | public static Short getShortValue(JSONObject jsonObject, String key) throws JSONException {
checkArguments(jsonObject, key);
JSONValue value = jsonObject.get(key);
if (value != null && value.isNumber() != null) {
double number = ((JSONNumber) value).doubleValue();
return new Short((short) number);
}
ret... | [
"public",
"static",
"Short",
"getShortValue",
"(",
"JSONObject",
"jsonObject",
",",
"String",
"key",
")",
"throws",
"JSONException",
"{",
"checkArguments",
"(",
"jsonObject",
",",
"key",
")",
";",
"JSONValue",
"value",
"=",
"jsonObject",
".",
"get",
"(",
"key"... | Get a short value from a {@link JSONObject}.
@param jsonObject The object to get the key value from.
@param key The name of the key to search the value for.
@return Returns the value for the key in the object .
@throws JSONException Thrown in case the key could not be found in the JSON object. | [
"Get",
"a",
"short",
"value",
"from",
"a",
"{",
"@link",
"JSONObject",
"}",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java#L313-L321 |
CubeEngine/Dirigent | src/main/java/org/cubeengine/dirigent/formatter/DateTimeFormatter.java | DateTimeFormatter.parseFormatter | private DateFormat parseFormatter(Context context, Arguments args) {
"""
Parses the {@link DateFormat} to use from the context arguments.
@param context The context.
@param args The arguments of the macro.
@return the {@link DateFormat}.
"""
final String format = args.get(FORMAT_PARAM_NAME);
... | java | private DateFormat parseFormatter(Context context, Arguments args)
{
final String format = args.get(FORMAT_PARAM_NAME);
final Locale locale = context.get(LOCALE);
if (format != null)
{
return new SimpleDateFormat(format, locale);
}
final int defaultFormat... | [
"private",
"DateFormat",
"parseFormatter",
"(",
"Context",
"context",
",",
"Arguments",
"args",
")",
"{",
"final",
"String",
"format",
"=",
"args",
".",
"get",
"(",
"FORMAT_PARAM_NAME",
")",
";",
"final",
"Locale",
"locale",
"=",
"context",
".",
"get",
"(",
... | Parses the {@link DateFormat} to use from the context arguments.
@param context The context.
@param args The arguments of the macro.
@return the {@link DateFormat}. | [
"Parses",
"the",
"{",
"@link",
"DateFormat",
"}",
"to",
"use",
"from",
"the",
"context",
"arguments",
"."
] | train | https://github.com/CubeEngine/Dirigent/blob/68587a8202754a6a6b629cc15e14c516806badaa/src/main/java/org/cubeengine/dirigent/formatter/DateTimeFormatter.java#L136-L162 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java | CPDefinitionOptionValueRelPersistenceImpl.removeByUuid_C | @Override
public void removeByUuid_C(String uuid, long companyId) {
"""
Removes all the cp definition option value rels where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID
"""
for (CPDefinitionOptionValueRel cpDefinitionOptionValueRel : findBy... | java | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPDefinitionOptionValueRel cpDefinitionOptionValueRel : findByUuid_C(
uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpDefinitionOptionValueRel);
}
} | [
"@",
"Override",
"public",
"void",
"removeByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
")",
"{",
"for",
"(",
"CPDefinitionOptionValueRel",
"cpDefinitionOptionValueRel",
":",
"findByUuid_C",
"(",
"uuid",
",",
"companyId",
",",
"QueryUtil",
".",
"ALL_... | Removes all the cp definition option value rels where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID | [
"Removes",
"all",
"the",
"cp",
"definition",
"option",
"value",
"rels",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | 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#L1426-L1432 |
alkacon/opencms-core | src/org/opencms/util/CmsUriSplitter.java | CmsUriSplitter.toURI | public URI toURI() throws URISyntaxException {
"""
Returns an URI object created from the original input String.<p>
This method will do a "best effort" to convert the original input String to a legal URI.
Most notably, it will be able to handle original input Strings that contain a space " "
and other usually... | java | public URI toURI() throws URISyntaxException {
if (m_isStrict && m_errorFree) {
// we have already verified that the URI contains no errors
return new URI(m_uri);
}
// create a new URI from the components
// using this constructor the input will be escaped if req... | [
"public",
"URI",
"toURI",
"(",
")",
"throws",
"URISyntaxException",
"{",
"if",
"(",
"m_isStrict",
"&&",
"m_errorFree",
")",
"{",
"// we have already verified that the URI contains no errors",
"return",
"new",
"URI",
"(",
"m_uri",
")",
";",
"}",
"// create a new URI fr... | Returns an URI object created from the original input String.<p>
This method will do a "best effort" to convert the original input String to a legal URI.
Most notably, it will be able to handle original input Strings that contain a space " "
and other usually illegal characters.<p>
@return an URI object created from ... | [
"Returns",
"an",
"URI",
"object",
"created",
"from",
"the",
"original",
"input",
"String",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsUriSplitter.java#L347-L356 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/PgCallableStatement.java | PgCallableStatement.registerOutParameter | @Override
public void registerOutParameter(int parameterIndex, int sqlType)
throws SQLException {
"""
{@inheritDoc}
<p>Before executing a stored procedure call you must explicitly call registerOutParameter to
register the java.sql.Type of each out parameter.</p>
<p>Note: When reading the value of an... | java | @Override
public void registerOutParameter(int parameterIndex, int sqlType)
throws SQLException {
checkClosed();
switch (sqlType) {
case Types.TINYINT:
// we don't have a TINYINT type use SMALLINT
sqlType = Types.SMALLINT;
break;
case Types.LONGVARCHAR:
sqlTyp... | [
"@",
"Override",
"public",
"void",
"registerOutParameter",
"(",
"int",
"parameterIndex",
",",
"int",
"sqlType",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"switch",
"(",
"sqlType",
")",
"{",
"case",
"Types",
".",
"TINYINT",
":",
"// we... | {@inheritDoc}
<p>Before executing a stored procedure call you must explicitly call registerOutParameter to
register the java.sql.Type of each out parameter.</p>
<p>Note: When reading the value of an out parameter, you must use the getXXX method whose Java
type XXX corresponds to the parameter's registered SQL type.</... | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/PgCallableStatement.java#L174-L225 |
ManfredTremmel/gwt-bean-validators | mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/IsbnValidator.java | IsbnValidator.isValid | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
"""
{@inheritDoc} check if given string is a valid isbn.
@see javax.validation.ConstraintValidator#isValid(java.lang.Object,
javax.validation.ConstraintValidatorContext)
"""
final String valueAsSt... | java | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
final String valueAsString;
if (ignoreSeparators) {
valueAsString =
Objects.toString(pvalue, StringUtils.EMPTY).replaceAll("-", StringUtils.EMPTY);
} else {
valueAsString = Object... | [
"@",
"Override",
"public",
"final",
"boolean",
"isValid",
"(",
"final",
"Object",
"pvalue",
",",
"final",
"ConstraintValidatorContext",
"pcontext",
")",
"{",
"final",
"String",
"valueAsString",
";",
"if",
"(",
"ignoreSeparators",
")",
"{",
"valueAsString",
"=",
... | {@inheritDoc} check if given string is a valid isbn.
@see javax.validation.ConstraintValidator#isValid(java.lang.Object,
javax.validation.ConstraintValidatorContext) | [
"{",
"@inheritDoc",
"}",
"check",
"if",
"given",
"string",
"is",
"a",
"valid",
"isbn",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/IsbnValidator.java#L68-L93 |
eirbjo/jetty-console | jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsoleBootstrapMainClass.java | JettyConsoleBootstrapMainClass.startJettyConsole | private void startJettyConsole(ClassLoader cl, String[] arguments, File tempDirectory) {
"""
Load {@link org.simplericity.jettyconsole.JettyConsoleStarter} and execute its main method.
@param cl The class loader to use for loading {@link JettyConsoleStarter}
@param arguments the arguments to pass to the main met... | java | private void startJettyConsole(ClassLoader cl, String[] arguments, File tempDirectory) {
try {
Class starterClass = cl.loadClass("org.simplericity.jettyconsole.JettyConsoleStarter");
starterClass.getField("jettyWorkDirectory").set(null, tempDirectory);
Method main = starterCl... | [
"private",
"void",
"startJettyConsole",
"(",
"ClassLoader",
"cl",
",",
"String",
"[",
"]",
"arguments",
",",
"File",
"tempDirectory",
")",
"{",
"try",
"{",
"Class",
"starterClass",
"=",
"cl",
".",
"loadClass",
"(",
"\"org.simplericity.jettyconsole.JettyConsoleStarte... | Load {@link org.simplericity.jettyconsole.JettyConsoleStarter} and execute its main method.
@param cl The class loader to use for loading {@link JettyConsoleStarter}
@param arguments the arguments to pass to the main method | [
"Load",
"{"
] | train | https://github.com/eirbjo/jetty-console/blob/5bd32ecab12837394dd45fd15c51c3934afcd76b/jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsoleBootstrapMainClass.java#L218-L227 |
rubenlagus/TelegramBots | telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistry.java | CommandRegistry.executeCommand | public final boolean executeCommand(AbsSender absSender, Message message) {
"""
Executes a command action if the command is registered.
@note If the command is not registered and there is a default consumer,
that action will be performed
@param absSender absSender
@param message input message
@return True... | java | public final boolean executeCommand(AbsSender absSender, Message message) {
if (message.hasText()) {
String text = message.getText();
if (text.startsWith(BotCommand.COMMAND_INIT_CHARACTER)) {
String commandMessage = text.substring(1);
String[] commandSplit... | [
"public",
"final",
"boolean",
"executeCommand",
"(",
"AbsSender",
"absSender",
",",
"Message",
"message",
")",
"{",
"if",
"(",
"message",
".",
"hasText",
"(",
")",
")",
"{",
"String",
"text",
"=",
"message",
".",
"getText",
"(",
")",
";",
"if",
"(",
"t... | Executes a command action if the command is registered.
@note If the command is not registered and there is a default consumer,
that action will be performed
@param absSender absSender
@param message input message
@return True if a command or default action is executed, false otherwise | [
"Executes",
"a",
"command",
"action",
"if",
"the",
"command",
"is",
"registered",
"."
] | train | https://github.com/rubenlagus/TelegramBots/blob/d62354915d7664597a40fd9858f16bce67ef1478/telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistry.java#L95-L115 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermListsImpl.java | ListManagementTermListsImpl.refreshIndexMethodAsync | public Observable<RefreshIndex> refreshIndexMethodAsync(String listId, String language) {
"""
Refreshes the index of the list with list Id equal to list ID passed.
@param listId List Id of the image list.
@param language Language of the terms.
@throws IllegalArgumentException thrown if parameters fail the val... | java | public Observable<RefreshIndex> refreshIndexMethodAsync(String listId, String language) {
return refreshIndexMethodWithServiceResponseAsync(listId, language).map(new Func1<ServiceResponse<RefreshIndex>, RefreshIndex>() {
@Override
public RefreshIndex call(ServiceResponse<RefreshIndex> re... | [
"public",
"Observable",
"<",
"RefreshIndex",
">",
"refreshIndexMethodAsync",
"(",
"String",
"listId",
",",
"String",
"language",
")",
"{",
"return",
"refreshIndexMethodWithServiceResponseAsync",
"(",
"listId",
",",
"language",
")",
".",
"map",
"(",
"new",
"Func1",
... | Refreshes the index of the list with list Id equal to list ID passed.
@param listId List Id of the image list.
@param language Language of the terms.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RefreshIndex object | [
"Refreshes",
"the",
"index",
"of",
"the",
"list",
"with",
"list",
"Id",
"equal",
"to",
"list",
"ID",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermListsImpl.java#L527-L534 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java | TileBoundingBoxUtils.getBoundingBox | public static BoundingBox getBoundingBox(BoundingBox totalBox,
TileMatrix tileMatrix, long tileColumn, long tileRow) {
"""
Get the bounding box of the tile column and row in the tile matrix using
the total bounding box with constant units
@param totalBox
total bounding box
@param tileMatrix
tile matrix
... | java | public static BoundingBox getBoundingBox(BoundingBox totalBox,
TileMatrix tileMatrix, long tileColumn, long tileRow) {
return getBoundingBox(totalBox, tileMatrix.getMatrixWidth(),
tileMatrix.getMatrixHeight(), tileColumn, tileRow);
} | [
"public",
"static",
"BoundingBox",
"getBoundingBox",
"(",
"BoundingBox",
"totalBox",
",",
"TileMatrix",
"tileMatrix",
",",
"long",
"tileColumn",
",",
"long",
"tileRow",
")",
"{",
"return",
"getBoundingBox",
"(",
"totalBox",
",",
"tileMatrix",
".",
"getMatrixWidth",
... | Get the bounding box of the tile column and row in the tile matrix using
the total bounding box with constant units
@param totalBox
total bounding box
@param tileMatrix
tile matrix
@param tileColumn
tile column
@param tileRow
tile row
@return bounding box
@since 1.2.0 | [
"Get",
"the",
"bounding",
"box",
"of",
"the",
"tile",
"column",
"and",
"row",
"in",
"the",
"tile",
"matrix",
"using",
"the",
"total",
"bounding",
"box",
"with",
"constant",
"units"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java#L915-L919 |
finnyb/javampd | src/main/java/org/bff/javampd/playlist/MPDPlaylist.java | MPDPlaylist.firePlaylistChangeEvent | protected synchronized void firePlaylistChangeEvent(PlaylistChangeEvent.Event event) {
"""
Sends the appropriate {@link PlaylistChangeEvent} to all registered
{@link PlaylistChangeListener}.
@param event the {@link PlaylistChangeEvent.Event} to send
"""
PlaylistChangeEvent pce = new PlaylistChangeE... | java | protected synchronized void firePlaylistChangeEvent(PlaylistChangeEvent.Event event) {
PlaylistChangeEvent pce = new PlaylistChangeEvent(this, event);
for (PlaylistChangeListener pcl : listeners) {
pcl.playlistChanged(pce);
}
} | [
"protected",
"synchronized",
"void",
"firePlaylistChangeEvent",
"(",
"PlaylistChangeEvent",
".",
"Event",
"event",
")",
"{",
"PlaylistChangeEvent",
"pce",
"=",
"new",
"PlaylistChangeEvent",
"(",
"this",
",",
"event",
")",
";",
"for",
"(",
"PlaylistChangeListener",
"... | Sends the appropriate {@link PlaylistChangeEvent} to all registered
{@link PlaylistChangeListener}.
@param event the {@link PlaylistChangeEvent.Event} to send | [
"Sends",
"the",
"appropriate",
"{",
"@link",
"PlaylistChangeEvent",
"}",
"to",
"all",
"registered",
"{",
"@link",
"PlaylistChangeListener",
"}",
"."
] | train | https://github.com/finnyb/javampd/blob/186736e85fc238b4208cc9ee23373f9249376b4c/src/main/java/org/bff/javampd/playlist/MPDPlaylist.java#L82-L88 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java | TransformerImpl.transformNode | public void transformNode(int node, Result outputTarget)
throws TransformerException {
"""
Process the source node to the output result, if the
processor supports the "http://xml.org/trax/features/dom/input"
feature.
%REVIEW% Do we need a Node version of this?
@param node The input source node, whic... | java | public void transformNode(int node, Result outputTarget)
throws TransformerException
{
SerializationHandler xoh = createSerializationHandler(outputTarget);
this.setSerializationHandler(xoh);
m_outputTarget = outputTarget;
transformNode(node);
} | [
"public",
"void",
"transformNode",
"(",
"int",
"node",
",",
"Result",
"outputTarget",
")",
"throws",
"TransformerException",
"{",
"SerializationHandler",
"xoh",
"=",
"createSerializationHandler",
"(",
"outputTarget",
")",
";",
"this",
".",
"setSerializationHandler",
"... | Process the source node to the output result, if the
processor supports the "http://xml.org/trax/features/dom/input"
feature.
%REVIEW% Do we need a Node version of this?
@param node The input source node, which can be any valid DTM node.
@param outputTarget The output source target.
@throws TransformerException | [
"Process",
"the",
"source",
"node",
"to",
"the",
"output",
"result",
"if",
"the",
"processor",
"supports",
"the",
"http",
":",
"//",
"xml",
".",
"org",
"/",
"trax",
"/",
"features",
"/",
"dom",
"/",
"input",
"feature",
".",
"%REVIEW%",
"Do",
"we",
"nee... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1161-L1172 |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/CreateLayerRequest.java | CreateLayerRequest.withAttributes | public CreateLayerRequest withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
One or more user-defined key-value pairs to be added to the stack attributes.
</p>
<p>
To create a cluster layer, set the <code>EcsClusterArn</code> attribute to the cluster's ARN.
</p>
@param attributes
One or mo... | java | public CreateLayerRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"CreateLayerRequest",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
One or more user-defined key-value pairs to be added to the stack attributes.
</p>
<p>
To create a cluster layer, set the <code>EcsClusterArn</code> attribute to the cluster's ARN.
</p>
@param attributes
One or more user-defined key-value pairs to be added to the stack attributes.</p>
<p>
To create a cluster layer... | [
"<p",
">",
"One",
"or",
"more",
"user",
"-",
"defined",
"key",
"-",
"value",
"pairs",
"to",
"be",
"added",
"to",
"the",
"stack",
"attributes",
".",
"<",
"/",
"p",
">",
"<p",
">",
"To",
"create",
"a",
"cluster",
"layer",
"set",
"the",
"<code",
">",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/CreateLayerRequest.java#L465-L468 |
spring-projects/spring-flex | spring-flex-core/src/main/java/org/springframework/flex/http/AmfView.java | AmfView.filterModel | protected Object filterModel(Map<String, Object> model) {
"""
Filters out undesired attributes from the given model. The return value can be either another {@link Map}, or a
single value object. If only a single attribute is present in the model map, that value will be returned instead
of the full map.
<p>De... | java | protected Object filterModel(Map<String, Object> model) {
Map<String, Object> result = new HashMap<String, Object>(model.size());
Set<String> renderedAttributes =
!CollectionUtils.isEmpty(this.renderedAttributes) ? this.renderedAttributes : model.keySet();
for (Map.Entry<String, ... | [
"protected",
"Object",
"filterModel",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"model",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
"model",
".",
"size",
"(",
")",... | Filters out undesired attributes from the given model. The return value can be either another {@link Map}, or a
single value object. If only a single attribute is present in the model map, that value will be returned instead
of the full map.
<p>Default implementation removes {@link BindingResult} instances and entrie... | [
"Filters",
"out",
"undesired",
"attributes",
"from",
"the",
"given",
"model",
".",
"The",
"return",
"value",
"can",
"be",
"either",
"another",
"{",
"@link",
"Map",
"}",
"or",
"a",
"single",
"value",
"object",
".",
"If",
"only",
"a",
"single",
"attribute",
... | train | https://github.com/spring-projects/spring-flex/blob/85f2bff300d74e2d77d565f97a09d12d18e19adc/spring-flex-core/src/main/java/org/springframework/flex/http/AmfView.java#L150-L164 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/GeoPackageCache.java | GeoPackageCache.getOrOpen | private GeoPackage getOrOpen(String name, File file, boolean cache) {
"""
Get the cached GeoPackage or open the GeoPackage file without caching it
@param name
GeoPackage name
@param file
GeoPackage file
@param cache
true to cache opened GeoPackages
@return GeoPackage
"""
GeoPackage geoPackage = get(... | java | private GeoPackage getOrOpen(String name, File file, boolean cache) {
GeoPackage geoPackage = get(name);
if (geoPackage == null) {
geoPackage = GeoPackageManager.open(name, file);
if (cache) {
add(geoPackage);
}
}
return geoPackage;
} | [
"private",
"GeoPackage",
"getOrOpen",
"(",
"String",
"name",
",",
"File",
"file",
",",
"boolean",
"cache",
")",
"{",
"GeoPackage",
"geoPackage",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"geoPackage",
"==",
"null",
")",
"{",
"geoPackage",
"=",
"GeoPa... | Get the cached GeoPackage or open the GeoPackage file without caching it
@param name
GeoPackage name
@param file
GeoPackage file
@param cache
true to cache opened GeoPackages
@return GeoPackage | [
"Get",
"the",
"cached",
"GeoPackage",
"or",
"open",
"the",
"GeoPackage",
"file",
"without",
"caching",
"it"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/GeoPackageCache.java#L83-L92 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java | DomHelper.drawGroup | public Element drawGroup(Object parent, Object object, String tagName) {
"""
Creates a group element in the technology (SVG/VML/...) of this context with the specified tag name.
@param parent
parent group object
@param object
group object
@param tagName
the tag name
@return element for the group
"""
... | java | public Element drawGroup(Object parent, Object object, String tagName) {
switch (namespace) {
case SVG:
return createGroup(Dom.NS_SVG, parent, object, tagName);
case VML:
return createGroup(Dom.NS_VML, parent, object, tagName);
case HTML:
default:
return createGroup(Dom.NS_HTML, parent, object... | [
"public",
"Element",
"drawGroup",
"(",
"Object",
"parent",
",",
"Object",
"object",
",",
"String",
"tagName",
")",
"{",
"switch",
"(",
"namespace",
")",
"{",
"case",
"SVG",
":",
"return",
"createGroup",
"(",
"Dom",
".",
"NS_SVG",
",",
"parent",
",",
"obj... | Creates a group element in the technology (SVG/VML/...) of this context with the specified tag name.
@param parent
parent group object
@param object
group object
@param tagName
the tag name
@return element for the group | [
"Creates",
"a",
"group",
"element",
"in",
"the",
"technology",
"(",
"SVG",
"/",
"VML",
"/",
"...",
")",
"of",
"this",
"context",
"with",
"the",
"specified",
"tag",
"name",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/DomHelper.java#L212-L222 |
aws/aws-sdk-java | aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/RestoreDBInstanceFromS3Request.java | RestoreDBInstanceFromS3Request.getEnableCloudwatchLogsExports | public java.util.List<String> getEnableCloudwatchLogsExports() {
"""
<p>
The list of logs that the restored DB instance is to export to CloudWatch Logs. The values in the list depend on
the DB engine being used. For more information, see <a href=
"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogA... | java | public java.util.List<String> getEnableCloudwatchLogsExports() {
if (enableCloudwatchLogsExports == null) {
enableCloudwatchLogsExports = new com.amazonaws.internal.SdkInternalList<String>();
}
return enableCloudwatchLogsExports;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"getEnableCloudwatchLogsExports",
"(",
")",
"{",
"if",
"(",
"enableCloudwatchLogsExports",
"==",
"null",
")",
"{",
"enableCloudwatchLogsExports",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal"... | <p>
The list of logs that the restored DB instance is to export to CloudWatch Logs. The values in the list depend on
the DB engine being used. For more information, see <a href=
"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch"
>Publishing Database... | [
"<p",
">",
"The",
"list",
"of",
"logs",
"that",
"the",
"restored",
"DB",
"instance",
"is",
"to",
"export",
"to",
"CloudWatch",
"Logs",
".",
"The",
"values",
"in",
"the",
"list",
"depend",
"on",
"the",
"DB",
"engine",
"being",
"used",
".",
"For",
"more"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/RestoreDBInstanceFromS3Request.java#L3621-L3626 |
cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/QueryChemObject.java | QueryChemObject.setProperty | @Override
public void setProperty(Object description, Object property) {
"""
Sets a property for a IChemObject.
@param description An object description of the property (most likely a
unique string)
@param property An object with the property itself
@see #getProperty
@see ... | java | @Override
public void setProperty(Object description, Object property) {
lazyProperties().put(description, property);
notifyChanged();
} | [
"@",
"Override",
"public",
"void",
"setProperty",
"(",
"Object",
"description",
",",
"Object",
"property",
")",
"{",
"lazyProperties",
"(",
")",
".",
"put",
"(",
"description",
",",
"property",
")",
";",
"notifyChanged",
"(",
")",
";",
"}"
] | Sets a property for a IChemObject.
@param description An object description of the property (most likely a
unique string)
@param property An object with the property itself
@see #getProperty
@see #removeProperty | [
"Sets",
"a",
"property",
"for",
"a",
"IChemObject",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/QueryChemObject.java#L191-L195 |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/core/Snapshot.java | Snapshot.withThumbnail | public T withThumbnail(Path path, String name, double scale) {
"""
Generate a thumbnail of the original screenshot.
Will save different thumbnails depends on when it was called in the chain.
@param path to save thumbnail image to
@param name of the resulting image
@param scale to apply
@return instance of t... | java | public T withThumbnail(Path path, String name, double scale) {
return withThumbnail(path.toString(),name,scale);
} | [
"public",
"T",
"withThumbnail",
"(",
"Path",
"path",
",",
"String",
"name",
",",
"double",
"scale",
")",
"{",
"return",
"withThumbnail",
"(",
"path",
".",
"toString",
"(",
")",
",",
"name",
",",
"scale",
")",
";",
"}"
] | Generate a thumbnail of the original screenshot.
Will save different thumbnails depends on when it was called in the chain.
@param path to save thumbnail image to
@param name of the resulting image
@param scale to apply
@return instance of type Snapshot | [
"Generate",
"a",
"thumbnail",
"of",
"the",
"original",
"screenshot",
".",
"Will",
"save",
"different",
"thumbnails",
"depends",
"on",
"when",
"it",
"was",
"called",
"in",
"the",
"chain",
"."
] | train | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/Snapshot.java#L158-L160 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataDecoder.java | DataDecoder.decodeBoolean | public static boolean decodeBoolean(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a boolean from exactly 1 byte.
@param src source of encoded bytes
@param srcOffset offset into source array
@return boolean value
"""
try {
return src[srcOffset] == (... | java | public static boolean decodeBoolean(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
return src[srcOffset] == (byte)128;
} catch (IndexOutOfBoundsException e) {
throw new CorruptEncodingException(null, e);
}
} | [
"public",
"static",
"boolean",
"decodeBoolean",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"return",
"src",
"[",
"srcOffset",
"]",
"==",
"(",
"byte",
")",
"128",
";",
"}",
"catch",
"... | Decodes a boolean from exactly 1 byte.
@param src source of encoded bytes
@param srcOffset offset into source array
@return boolean value | [
"Decodes",
"a",
"boolean",
"from",
"exactly",
"1",
"byte",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L252-L260 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/Matrix.java | Matrix.transposeMultiply | public Matrix transposeMultiply(Matrix B, ExecutorService threadPool) {
"""
Computes the result matrix of <i>A'*B</i>, or the same result as <br>
<code>
A.{@link #transpose() transpose()}.{@link #multiply(jsat.linear.Matrix) multiply(B)}
</code>
@param B the matrix to multiply by
@param threadPool the sourc... | java | public Matrix transposeMultiply(Matrix B, ExecutorService threadPool)
{
Matrix C = new DenseMatrix(this.cols(), B.cols());
transposeMultiply(B, C, threadPool);
return C;
} | [
"public",
"Matrix",
"transposeMultiply",
"(",
"Matrix",
"B",
",",
"ExecutorService",
"threadPool",
")",
"{",
"Matrix",
"C",
"=",
"new",
"DenseMatrix",
"(",
"this",
".",
"cols",
"(",
")",
",",
"B",
".",
"cols",
"(",
")",
")",
";",
"transposeMultiply",
"("... | Computes the result matrix of <i>A'*B</i>, or the same result as <br>
<code>
A.{@link #transpose() transpose()}.{@link #multiply(jsat.linear.Matrix) multiply(B)}
</code>
@param B the matrix to multiply by
@param threadPool the source of threads to do computation in parallel
@return a new matrix equal to <i>A'*B</i> | [
"Computes",
"the",
"result",
"matrix",
"of",
"<i",
">",
"A",
"*",
"B<",
"/",
"i",
">",
"or",
"the",
"same",
"result",
"as",
"<br",
">",
"<code",
">",
"A",
".",
"{",
"@link",
"#transpose",
"()",
"transpose",
"()",
"}",
".",
"{",
"@link",
"#multiply"... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L489-L494 |
wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResourceFactory.java | HalResourceFactory.createResource | @Deprecated
public static HalResource createResource(Object model, String href) {
"""
Creates a HAL resource with state and a self link.
@param model The state of the resource
@param href The self link for the resource
@return New HAL resource
@deprecated just create {@link HalResource} and {@link Link} inst... | java | @Deprecated
public static HalResource createResource(Object model, String href) {
return new HalResource(new HalResource(model).getModel(), href);
} | [
"@",
"Deprecated",
"public",
"static",
"HalResource",
"createResource",
"(",
"Object",
"model",
",",
"String",
"href",
")",
"{",
"return",
"new",
"HalResource",
"(",
"new",
"HalResource",
"(",
"model",
")",
".",
"getModel",
"(",
")",
",",
"href",
")",
";",... | Creates a HAL resource with state and a self link.
@param model The state of the resource
@param href The self link for the resource
@return New HAL resource
@deprecated just create {@link HalResource} and {@link Link} instances using the new constructors | [
"Creates",
"a",
"HAL",
"resource",
"with",
"state",
"and",
"a",
"self",
"link",
"."
] | train | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResourceFactory.java#L79-L82 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java | SqlBuilderHelper.generateSQLForInsertDynamic | public static void generateSQLForInsertDynamic(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
"""
<p>
Generate log for INSERT operations
</p>
.
@param method
the method
@param methodBuilder
the method builder
"""
methodBuilder.addComment("generate SQL for insert");
JQLChecker ... | java | public static void generateSQLForInsertDynamic(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
methodBuilder.addComment("generate SQL for insert");
JQLChecker checker = JQLChecker.getInstance();
// replace the table name, other pieces will be removed
String sql = checker.replace(method, met... | [
"public",
"static",
"void",
"generateSQLForInsertDynamic",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
")",
"{",
"methodBuilder",
".",
"addComment",
"(",
"\"generate SQL for insert\"",
")",
";",
"JQLChecker",
"checker... | <p>
Generate log for INSERT operations
</p>
.
@param method
the method
@param methodBuilder
the method builder | [
"<p",
">",
"Generate",
"log",
"for",
"INSERT",
"operations",
"<",
"/",
"p",
">",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlBuilderHelper.java#L667-L702 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java | ValueEnforcer.isTrue | public static void isTrue (@Nonnull final BooleanSupplier aValue, @Nonnull final Supplier <? extends String> aMsg) {
"""
Check that the passed value is <code>true</code>.
@param aValue
The value to check.
@param aMsg
The message to be emitted in case the value is <code>false</code>
@throws IllegalArgumentEx... | java | public static void isTrue (@Nonnull final BooleanSupplier aValue, @Nonnull final Supplier <? extends String> aMsg)
{
if (isEnabled ())
if (!aValue.getAsBoolean ())
throw new IllegalArgumentException ("The expression must be true but it is not: " + aMsg.get ());
} | [
"public",
"static",
"void",
"isTrue",
"(",
"@",
"Nonnull",
"final",
"BooleanSupplier",
"aValue",
",",
"@",
"Nonnull",
"final",
"Supplier",
"<",
"?",
"extends",
"String",
">",
"aMsg",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
")",
"if",
"(",
"!",
"aVa... | Check that the passed value is <code>true</code>.
@param aValue
The value to check.
@param aMsg
The message to be emitted in case the value is <code>false</code>
@throws IllegalArgumentException
if the passed value is not <code>null</code>. | [
"Check",
"that",
"the",
"passed",
"value",
"is",
"<code",
">",
"true<",
"/",
"code",
">",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java#L135-L140 |
jbundle/jbundle | app/program/script/src/main/java/org/jbundle/app/program/script/data/importfix/base/MergeData.java | MergeData.readDestRecord | public boolean readDestRecord(FieldList recSource, Record recDest) {
"""
Given this source record, read the destination record.
@param recSource The source record
@param recDest The destination record
@return True if found.
"""
FieldInfo fldSecond = recSource.getField("Name");
if (fldSecond ... | java | public boolean readDestRecord(FieldList recSource, Record recDest)
{
FieldInfo fldSecond = recSource.getField("Name");
if (fldSecond == null)
fldSecond = recSource.getField("Description");
if (fldSecond == null)
return false;
recDest = BaseFixData.getRecordFro... | [
"public",
"boolean",
"readDestRecord",
"(",
"FieldList",
"recSource",
",",
"Record",
"recDest",
")",
"{",
"FieldInfo",
"fldSecond",
"=",
"recSource",
".",
"getField",
"(",
"\"Name\"",
")",
";",
"if",
"(",
"fldSecond",
"==",
"null",
")",
"fldSecond",
"=",
"re... | Given this source record, read the destination record.
@param recSource The source record
@param recDest The destination record
@return True if found. | [
"Given",
"this",
"source",
"record",
"read",
"the",
"destination",
"record",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/script/src/main/java/org/jbundle/app/program/script/data/importfix/base/MergeData.java#L139-L148 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsPositionBean.java | CmsPositionBean.checkCollision | public static boolean checkCollision(CmsPositionBean posA, CmsPositionBean posB, int margin) {
"""
Checks whether the two position rectangles collide.<p>
@param posA the first position to check
@param posB the second position to check
@param margin the required margin
@return <code>true</code> if the two p... | java | public static boolean checkCollision(CmsPositionBean posA, CmsPositionBean posB, int margin) {
// check for non collision is easier
if ((posA.getLeft() - margin) >= (posB.getLeft() + posB.getWidth())) {
// posA is right of posB
return false;
}
if ((posA.getLeft()... | [
"public",
"static",
"boolean",
"checkCollision",
"(",
"CmsPositionBean",
"posA",
",",
"CmsPositionBean",
"posB",
",",
"int",
"margin",
")",
"{",
"// check for non collision is easier",
"if",
"(",
"(",
"posA",
".",
"getLeft",
"(",
")",
"-",
"margin",
")",
">=",
... | Checks whether the two position rectangles collide.<p>
@param posA the first position to check
@param posB the second position to check
@param margin the required margin
@return <code>true</code> if the two position rectangles collide | [
"Checks",
"whether",
"the",
"two",
"position",
"rectangles",
"collide",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsPositionBean.java#L206-L228 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.monitor/src/com/ibm/ws/webcontainer/monitor/WebContainerMonitor.java | WebContainerMonitor.initServletStats | public synchronized ServletStats initServletStats(String _app, String _ser) {
"""
Method : initServletStats()
@param _app = Application Name
@param _ser = Servlet Name
This method will create ServletStats object for current servlet.
This method needs to be synchronised.
This method gets called only at f... | java | public synchronized ServletStats initServletStats(String _app, String _ser) {
String _key = _app + "." + _ser;
ServletStats nStats = this.servletCountByName.get(_key);
if (nStats == null) {
nStats = new ServletStats(_app, _ser);
this.servletCountByName.put(_key, nStats);... | [
"public",
"synchronized",
"ServletStats",
"initServletStats",
"(",
"String",
"_app",
",",
"String",
"_ser",
")",
"{",
"String",
"_key",
"=",
"_app",
"+",
"\".\"",
"+",
"_ser",
";",
"ServletStats",
"nStats",
"=",
"this",
".",
"servletCountByName",
".",
"get",
... | Method : initServletStats()
@param _app = Application Name
@param _ser = Servlet Name
This method will create ServletStats object for current servlet.
This method needs to be synchronised.
This method gets called only at first request. | [
"Method",
":",
"initServletStats",
"()"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.monitor/src/com/ibm/ws/webcontainer/monitor/WebContainerMonitor.java#L89-L97 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/component/aspect/pointcut/AbstractPointcut.java | AbstractPointcut.matches | protected boolean matches(PointcutPatternRule pointcutPatternRule, String transletName,
String beanId, String className, String methodName) {
"""
Returns whether or not corresponding to the point cut pattern rules.
It is recognized to {@code true} if the operands are {@code null}.
... | java | protected boolean matches(PointcutPatternRule pointcutPatternRule, String transletName,
String beanId, String className, String methodName) {
if ((transletName == null && pointcutPatternRule.getTransletNamePattern() != null)
|| (beanId == null && pointcutPatternRule... | [
"protected",
"boolean",
"matches",
"(",
"PointcutPatternRule",
"pointcutPatternRule",
",",
"String",
"transletName",
",",
"String",
"beanId",
",",
"String",
"className",
",",
"String",
"methodName",
")",
"{",
"if",
"(",
"(",
"transletName",
"==",
"null",
"&&",
"... | Returns whether or not corresponding to the point cut pattern rules.
It is recognized to {@code true} if the operands are {@code null}.
@param pointcutPatternRule the pointcut pattern
@param transletName the translet name
@param beanId the bean id
@param className the bean class name
@param methodName the name of the ... | [
"Returns",
"whether",
"or",
"not",
"corresponding",
"to",
"the",
"point",
"cut",
"pattern",
"rules",
".",
"It",
"is",
"recognized",
"to",
"{",
"@code",
"true",
"}",
"if",
"the",
"operands",
"are",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/component/aspect/pointcut/AbstractPointcut.java#L100-L110 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listPreparationAndReleaseTaskStatusNext | public PagedList<JobPreparationAndReleaseTaskExecutionInformation> listPreparationAndReleaseTaskStatusNext(final String nextPageLink, final JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions) {
"""
Lists the execution status of the Job Preparation and Job Release ta... | java | public PagedList<JobPreparationAndReleaseTaskExecutionInformation> listPreparationAndReleaseTaskStatusNext(final String nextPageLink, final JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions) {
ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecution... | [
"public",
"PagedList",
"<",
"JobPreparationAndReleaseTaskExecutionInformation",
">",
"listPreparationAndReleaseTaskStatusNext",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"JobListPreparationAndReleaseTaskStatusNextOptions",
"jobListPreparationAndReleaseTaskStatusNextOptions",
... | Lists the execution status of the Job Preparation and Job Release task for the specified job across the compute nodes where the job has run.
This API returns the Job Preparation and Job Release task status on all compute nodes that have run the Job Preparation or Job Release task. This includes nodes which have since b... | [
"Lists",
"the",
"execution",
"status",
"of",
"the",
"Job",
"Preparation",
"and",
"Job",
"Release",
"task",
"for",
"the",
"specified",
"job",
"across",
"the",
"compute",
"nodes",
"where",
"the",
"job",
"has",
"run",
".",
"This",
"API",
"returns",
"the",
"Jo... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L3923-L3931 |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/operator/impl/mutation/BitFlipMutation.java | BitFlipMutation.doMutation | public void doMutation(double probability, BinarySolution solution) {
"""
Perform the mutation operation
@param probability Mutation setProbability
@param solution The solution to mutate
"""
for (int i = 0; i < solution.getNumberOfVariables(); i++) {
for (int j = 0; j < solution.getVariableV... | java | public void doMutation(double probability, BinarySolution solution) {
for (int i = 0; i < solution.getNumberOfVariables(); i++) {
for (int j = 0; j < solution.getVariableValue(i).getBinarySetLength(); j++) {
if (randomGenerator.getRandomValue() <= probability) {
solution.getVariableValu... | [
"public",
"void",
"doMutation",
"(",
"double",
"probability",
",",
"BinarySolution",
"solution",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"solution",
".",
"getNumberOfVariables",
"(",
")",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
... | Perform the mutation operation
@param probability Mutation setProbability
@param solution The solution to mutate | [
"Perform",
"the",
"mutation",
"operation"
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/operator/impl/mutation/BitFlipMutation.java#L61-L69 |
sahan/RoboZombie | robozombie/src/main/java/org/apache/http42/client/utils/URLEncodedUtils.java | URLEncodedUtils.decodeFormFields | private static String decodeFormFields (final String content, final String charset) {
"""
Decode/unescape www-url-form-encoded content.
@param content the content to decode, will decode '+' as space
@param charset the charset to use
@return
"""
if (content == null) {
return null;
... | java | private static String decodeFormFields (final String content, final String charset) {
if (content == null) {
return null;
}
return urldecode(content, charset != null ? Charset.forName(charset) : Consts.UTF_8, true);
} | [
"private",
"static",
"String",
"decodeFormFields",
"(",
"final",
"String",
"content",
",",
"final",
"String",
"charset",
")",
"{",
"if",
"(",
"content",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"urldecode",
"(",
"content",
",",
"charse... | Decode/unescape www-url-form-encoded content.
@param content the content to decode, will decode '+' as space
@param charset the charset to use
@return | [
"Decode",
"/",
"unescape",
"www",
"-",
"url",
"-",
"form",
"-",
"encoded",
"content",
"."
] | train | https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/org/apache/http42/client/utils/URLEncodedUtils.java#L447-L452 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java | TransformerImpl.getShouldStripSpace | public short getShouldStripSpace(int elementHandle, DTM dtm) {
"""
Test whether whitespace-only text nodes are visible in the logical
view of <code>DTM</code>. Normally, this function
will be called by the implementation of <code>DTM</code>;
it is not normally called directly from
user code.
@param elementH... | java | public short getShouldStripSpace(int elementHandle, DTM dtm)
{
try
{
org.apache.xalan.templates.WhiteSpaceInfo info =
m_stylesheetRoot.getWhiteSpaceInfo(m_xcontext, elementHandle, dtm);
if (null == info)
{
return DTMWSFilter.INHERIT;
}
else
{
// S... | [
"public",
"short",
"getShouldStripSpace",
"(",
"int",
"elementHandle",
",",
"DTM",
"dtm",
")",
"{",
"try",
"{",
"org",
".",
"apache",
".",
"xalan",
".",
"templates",
".",
"WhiteSpaceInfo",
"info",
"=",
"m_stylesheetRoot",
".",
"getWhiteSpaceInfo",
"(",
"m_xcon... | Test whether whitespace-only text nodes are visible in the logical
view of <code>DTM</code>. Normally, this function
will be called by the implementation of <code>DTM</code>;
it is not normally called directly from
user code.
@param elementHandle int Handle of the element.
@return one of NOTSTRIP, STRIP, or INHERIT. | [
"Test",
"whether",
"whitespace",
"-",
"only",
"text",
"nodes",
"are",
"visible",
"in",
"the",
"logical",
"view",
"of",
"<code",
">",
"DTM<",
"/",
"code",
">",
".",
"Normally",
"this",
"function",
"will",
"be",
"called",
"by",
"the",
"implementation",
"of",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L3159-L3183 |
Azure/azure-sdk-for-java | resources/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/resources/v2016_09_01/implementation/ProvidersInner.java | ProvidersInner.listAsync | public Observable<Page<ProviderInner>> listAsync(final Integer top, final String expand) {
"""
Gets all resource providers for a subscription.
@param top The number of results to return. If null is passed returns all deployments.
@param expand The properties to include in the results. For example, use &$ex... | java | public Observable<Page<ProviderInner>> listAsync(final Integer top, final String expand) {
return listWithServiceResponseAsync(top, expand)
.map(new Func1<ServiceResponse<Page<ProviderInner>>, Page<ProviderInner>>() {
@Override
public Page<ProviderInner> call(ServiceR... | [
"public",
"Observable",
"<",
"Page",
"<",
"ProviderInner",
">",
">",
"listAsync",
"(",
"final",
"Integer",
"top",
",",
"final",
"String",
"expand",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"top",
",",
"expand",
")",
".",
"map",
"(",
"new",
... | Gets all resource providers for a subscription.
@param top The number of results to return. If null is passed returns all deployments.
@param expand The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider metadata. To include property aliases i... | [
"Gets",
"all",
"resource",
"providers",
"for",
"a",
"subscription",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/resources/v2016_09_01/implementation/ProvidersInner.java#L392-L400 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/buttons/AjaxIndicatingButtonPanel.java | AjaxIndicatingButtonPanel.newButton | @Override
protected Button newButton(final String id) {
"""
Factory method for creating the Button. This method is invoked in the constructor from the
derived classes and can be overridden so users can provide their own version of a Button.
@param id
the wicket id
@return the Button
"""
return new Ind... | java | @Override
protected Button newButton(final String id)
{
return new IndicatingAjaxButton(id, getForm())
{
/**
* The serialVersionUID.
*/
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
protected void onError(final AjaxRequestTarget target, final For... | [
"@",
"Override",
"protected",
"Button",
"newButton",
"(",
"final",
"String",
"id",
")",
"{",
"return",
"new",
"IndicatingAjaxButton",
"(",
"id",
",",
"getForm",
"(",
")",
")",
"{",
"/**\n\t\t\t * The serialVersionUID.\n\t\t\t */",
"private",
"static",
"final",
"lo... | Factory method for creating the Button. This method is invoked in the constructor from the
derived classes and can be overridden so users can provide their own version of a Button.
@param id
the wicket id
@return the Button | [
"Factory",
"method",
"for",
"creating",
"the",
"Button",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"their",
"own",
"version",
"o... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/buttons/AjaxIndicatingButtonPanel.java#L57-L85 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/file/FileMgr.java | FileMgr.getFileChannel | private IoChannel getFileChannel(String fileName) throws IOException {
"""
Returns the file channel for the specified filename. The file channel is
stored in a map keyed on the filename. If the file is not open, then it
is opened and the file channel is added to the map.
@param fileName
the specified filenam... | java | private IoChannel getFileChannel(String fileName) throws IOException {
synchronized (prepareAnchor(fileName)) {
IoChannel fileChannel = openFiles.get(fileName);
if (fileChannel == null) {
File dbFile = fileName.equals(DEFAULT_LOG_FILE) ? new File(logDirectory, fileName)
: new File(dbDirectory, ... | [
"private",
"IoChannel",
"getFileChannel",
"(",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"prepareAnchor",
"(",
"fileName",
")",
")",
"{",
"IoChannel",
"fileChannel",
"=",
"openFiles",
".",
"get",
"(",
"fileName",
")",
";",
"... | Returns the file channel for the specified filename. The file channel is
stored in a map keyed on the filename. If the file is not open, then it
is opened and the file channel is added to the map.
@param fileName
the specified filename
@return the file channel associated with the open file.
@throws IOException | [
"Returns",
"the",
"file",
"channel",
"for",
"the",
"specified",
"filename",
".",
"The",
"file",
"channel",
"is",
"stored",
"in",
"a",
"map",
"keyed",
"on",
"the",
"filename",
".",
"If",
"the",
"file",
"is",
"not",
"open",
"then",
"it",
"is",
"opened",
... | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/file/FileMgr.java#L241-L255 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.pack | public static void pack(File sourceDir, OutputStream os, int compressionLevel) {
"""
Compresses the given directory and all of its sub-directories into the passed in
stream. It is the responsibility of the caller to close the passed in
stream properly.
@param sourceDir
root directory.
@param os
output stre... | java | public static void pack(File sourceDir, OutputStream os, int compressionLevel) {
pack(sourceDir, os, IdentityNameMapper.INSTANCE, compressionLevel);
} | [
"public",
"static",
"void",
"pack",
"(",
"File",
"sourceDir",
",",
"OutputStream",
"os",
",",
"int",
"compressionLevel",
")",
"{",
"pack",
"(",
"sourceDir",
",",
"os",
",",
"IdentityNameMapper",
".",
"INSTANCE",
",",
"compressionLevel",
")",
";",
"}"
] | Compresses the given directory and all of its sub-directories into the passed in
stream. It is the responsibility of the caller to close the passed in
stream properly.
@param sourceDir
root directory.
@param os
output stream (will be buffered in this method).
@param compressionLevel
compression level
@since 1.10 | [
"Compresses",
"the",
"given",
"directory",
"and",
"all",
"of",
"its",
"sub",
"-",
"directories",
"into",
"the",
"passed",
"in",
"stream",
".",
"It",
"is",
"the",
"responsibility",
"of",
"the",
"caller",
"to",
"close",
"the",
"passed",
"in",
"stream",
"prop... | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L1652-L1654 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/sasl/SaslEncryption.java | SaslEncryption.addToChannel | static void addToChannel(
Channel channel,
SaslEncryptionBackend backend,
int maxOutboundBlockSize) {
"""
Adds channel handlers that perform encryption / decryption of data using SASL.
@param channel The channel.
@param backend The SASL backend.
@param maxOutboundBlockSize Max size in bytes ... | java | static void addToChannel(
Channel channel,
SaslEncryptionBackend backend,
int maxOutboundBlockSize) {
channel.pipeline()
.addFirst(ENCRYPTION_HANDLER_NAME, new EncryptionHandler(backend, maxOutboundBlockSize))
.addFirst("saslDecryption", new DecryptionHandler(backend))
.addFirst(... | [
"static",
"void",
"addToChannel",
"(",
"Channel",
"channel",
",",
"SaslEncryptionBackend",
"backend",
",",
"int",
"maxOutboundBlockSize",
")",
"{",
"channel",
".",
"pipeline",
"(",
")",
".",
"addFirst",
"(",
"ENCRYPTION_HANDLER_NAME",
",",
"new",
"EncryptionHandler"... | Adds channel handlers that perform encryption / decryption of data using SASL.
@param channel The channel.
@param backend The SASL backend.
@param maxOutboundBlockSize Max size in bytes of outgoing encrypted blocks, to control
memory usage. | [
"Adds",
"channel",
"handlers",
"that",
"perform",
"encryption",
"/",
"decryption",
"of",
"data",
"using",
"SASL",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/sasl/SaslEncryption.java#L57-L65 |
ManfredTremmel/gwt-bean-validators | mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/MustNotBeEqualValidator.java | MustNotBeEqualValidator.isValid | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
"""
{@inheritDoc} check if given object is valid.
@see javax.validation.ConstraintValidator#isValid(Object,
javax.validation.ConstraintValidatorContext)
"""
if (pvalue == null) {
return true... | java | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
if (pvalue == null) {
return true;
}
try {
final Object field1Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field1Name);
final Object field2Value = BeanPropertyReaderUtil... | [
"@",
"Override",
"public",
"final",
"boolean",
"isValid",
"(",
"final",
"Object",
"pvalue",
",",
"final",
"ConstraintValidatorContext",
"pcontext",
")",
"{",
"if",
"(",
"pvalue",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"try",
"{",
"final",
"Obj... | {@inheritDoc} check if given object is valid.
@see javax.validation.ConstraintValidator#isValid(Object,
javax.validation.ConstraintValidatorContext) | [
"{",
"@inheritDoc",
"}",
"check",
"if",
"given",
"object",
"is",
"valid",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/MustNotBeEqualValidator.java#L79-L102 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/SessionNode.java | SessionNode.getSegment | protected final Segment getSegment( NodeCache cache,
CachedNode parent ) {
"""
Get the segment for this node.
@param cache the cache
@param parent the parent node
@return the segment
@throws NodeNotFoundInParentException if the node doesn't exist in the referenced pare... | java | protected final Segment getSegment( NodeCache cache,
CachedNode parent ) {
if (parent != null) {
ChildReference ref = parent.getChildReferences(cache).getChild(key);
if (ref == null) {
// This node doesn't exist in the parent
... | [
"protected",
"final",
"Segment",
"getSegment",
"(",
"NodeCache",
"cache",
",",
"CachedNode",
"parent",
")",
"{",
"if",
"(",
"parent",
"!=",
"null",
")",
"{",
"ChildReference",
"ref",
"=",
"parent",
".",
"getChildReferences",
"(",
"cache",
")",
".",
"getChild... | Get the segment for this node.
@param cache the cache
@param parent the parent node
@return the segment
@throws NodeNotFoundInParentException if the node doesn't exist in the referenced parent | [
"Get",
"the",
"segment",
"for",
"this",
"node",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/SessionNode.java#L429-L441 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java | RingPlacer.getRingCenterOfFirstRing | Vector2d getRingCenterOfFirstRing(IRing ring, Vector2d bondVector, double bondLength) {
"""
Calculated the center for the first ring so that it can
layed out. Only then, all other rings can be assigned
coordinates relative to it.
@param ring The ring for which the center is to be calculated
@return A Vec... | java | Vector2d getRingCenterOfFirstRing(IRing ring, Vector2d bondVector, double bondLength) {
int size = ring.getAtomCount();
double radius = bondLength / (2 * Math.sin((Math.PI) / size));
double newRingPerpendicular = Math.sqrt(Math.pow(radius, 2) - Math.pow(bondLength / 2, 2));
/* get the an... | [
"Vector2d",
"getRingCenterOfFirstRing",
"(",
"IRing",
"ring",
",",
"Vector2d",
"bondVector",
",",
"double",
"bondLength",
")",
"{",
"int",
"size",
"=",
"ring",
".",
"getAtomCount",
"(",
")",
";",
"double",
"radius",
"=",
"bondLength",
"/",
"(",
"2",
"*",
"... | Calculated the center for the first ring so that it can
layed out. Only then, all other rings can be assigned
coordinates relative to it.
@param ring The ring for which the center is to be calculated
@return A Vector2d pointing to the new ringcenter | [
"Calculated",
"the",
"center",
"for",
"the",
"first",
"ring",
"so",
"that",
"it",
"can",
"layed",
"out",
".",
"Only",
"then",
"all",
"other",
"rings",
"can",
"be",
"assigned",
"coordinates",
"relative",
"to",
"it",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java#L700-L712 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/BandwidthSchedulesInner.java | BandwidthSchedulesInner.beginCreateOrUpdateAsync | public Observable<BandwidthScheduleInner> beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) {
"""
Creates or updates a bandwidth schedule.
@param deviceName The device name.
@param name The bandwidth schedule name which needs to be added/updat... | java | public Observable<BandwidthScheduleInner> beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters).map(new Func1<ServiceResponse<BandwidthScheduleInn... | [
"public",
"Observable",
"<",
"BandwidthScheduleInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"deviceName",
",",
"String",
"name",
",",
"String",
"resourceGroupName",
",",
"BandwidthScheduleInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceRe... | Creates or updates a bandwidth schedule.
@param deviceName The device name.
@param name The bandwidth schedule name which needs to be added/updated.
@param resourceGroupName The resource group name.
@param parameters The bandwidth schedule to be added or updated.
@throws IllegalArgumentException thrown if parameters f... | [
"Creates",
"or",
"updates",
"a",
"bandwidth",
"schedule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/BandwidthSchedulesInner.java#L435-L442 |
UrielCh/ovh-java-sdk | ovh-java-sdk-store/src/main/java/net/minidev/ovh/api/ApiOvhStore.java | ApiOvhStore.contact_contactId_document_POST | public ArrayList<String> contact_contactId_document_POST(String contactId, String documentId) throws IOException {
"""
Add a document to a contact
REST: POST /store/contact/{contactId}/document
@param documentId [required] Document id to link
@param contactId [required] Id of the contact to fetch
API beta
... | java | public ArrayList<String> contact_contactId_document_POST(String contactId, String documentId) throws IOException {
String qPath = "/store/contact/{contactId}/document";
StringBuilder sb = path(qPath, contactId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "documentId", documentId);
St... | [
"public",
"ArrayList",
"<",
"String",
">",
"contact_contactId_document_POST",
"(",
"String",
"contactId",
",",
"String",
"documentId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/store/contact/{contactId}/document\"",
";",
"StringBuilder",
"sb",
"=",
... | Add a document to a contact
REST: POST /store/contact/{contactId}/document
@param documentId [required] Document id to link
@param contactId [required] Id of the contact to fetch
API beta | [
"Add",
"a",
"document",
"to",
"a",
"contact"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-store/src/main/java/net/minidev/ovh/api/ApiOvhStore.java#L196-L203 |
czyzby/gdx-lml | lml/src/main/java/com/github/czyzby/lml/parser/impl/tag/AbstractListenerLmlTag.java | AbstractListenerLmlTag.onEvent | @Override
public boolean onEvent(final LmlParser parser, final Array<Actor> parsingResult) {
"""
Invoked after template parsing. Hooks up the listener to actors registered by "attachTo" attribute.
@param parser parsed the template.
@param parsingResult parsed actors.
@return {@link LmlParserListener#REMOV... | java | @Override
public boolean onEvent(final LmlParser parser, final Array<Actor> parsingResult) {
final ObjectMap<String, Actor> actorsByIds = parser.getActorsMappedByIds();
for (final String id : ids) {
final Actor actor = actorsByIds.get(id);
if (actor != null) {
... | [
"@",
"Override",
"public",
"boolean",
"onEvent",
"(",
"final",
"LmlParser",
"parser",
",",
"final",
"Array",
"<",
"Actor",
">",
"parsingResult",
")",
"{",
"final",
"ObjectMap",
"<",
"String",
",",
"Actor",
">",
"actorsByIds",
"=",
"parser",
".",
"getActorsMa... | Invoked after template parsing. Hooks up the listener to actors registered by "attachTo" attribute.
@param parser parsed the template.
@param parsingResult parsed actors.
@return {@link LmlParserListener#REMOVE} by default. See {@link #setKeepListener(boolean)}. | [
"Invoked",
"after",
"template",
"parsing",
".",
"Hooks",
"up",
"the",
"listener",
"to",
"actors",
"registered",
"by",
"attachTo",
"attribute",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/lml/src/main/java/com/github/czyzby/lml/parser/impl/tag/AbstractListenerLmlTag.java#L114-L126 |
RestComm/media-core | resource/media-player/src/main/java/org/restcomm/media/core/resource/player/audio/tone/ToneTrackImpl.java | ToneTrackImpl.readPacket | private int readPacket(byte[] packet, int offset, int psize) throws IOException {
"""
Reads packet from currently opened stream.
@param packet
the packet to read
@param offset
the offset from which new data will be inserted
@return the number of actualy read bytes.
@throws java.io.IOException
"""
... | java | private int readPacket(byte[] packet, int offset, int psize) throws IOException {
int length = 0;
if(position+psize<source.length)
{
length=psize;
System.arraycopy(source, position, packet, offset, length);
position+=psize;
}
else if(position<source.length)
{
... | [
"private",
"int",
"readPacket",
"(",
"byte",
"[",
"]",
"packet",
",",
"int",
"offset",
",",
"int",
"psize",
")",
"throws",
"IOException",
"{",
"int",
"length",
"=",
"0",
";",
"if",
"(",
"position",
"+",
"psize",
"<",
"source",
".",
"length",
")",
"{"... | Reads packet from currently opened stream.
@param packet
the packet to read
@param offset
the offset from which new data will be inserted
@return the number of actualy read bytes.
@throws java.io.IOException | [
"Reads",
"packet",
"from",
"currently",
"opened",
"stream",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/resource/media-player/src/main/java/org/restcomm/media/core/resource/player/audio/tone/ToneTrackImpl.java#L132-L148 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/StructurizrDocumentationTemplate.java | StructurizrDocumentationTemplate.addDataSection | @Nonnull
public Section addDataSection(@Nullable SoftwareSystem softwareSystem, File... files) throws IOException {
"""
Adds a "Data" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param files ... | java | @Nonnull
public Section addDataSection(@Nullable SoftwareSystem softwareSystem, File... files) throws IOException {
return addSection(softwareSystem, "Data", files);
} | [
"@",
"Nonnull",
"public",
"Section",
"addDataSection",
"(",
"@",
"Nullable",
"SoftwareSystem",
"softwareSystem",
",",
"File",
"...",
"files",
")",
"throws",
"IOException",
"{",
"return",
"addSection",
"(",
"softwareSystem",
",",
"\"Data\"",
",",
"files",
")",
";... | Adds a "Data" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param files one or more File objects that point to the documentation content
@return a documentation {@link Section}
... | [
"Adds",
"a",
"Data",
"section",
"relating",
"to",
"a",
"{",
"@link",
"SoftwareSystem",
"}",
"from",
"one",
"or",
"more",
"files",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/StructurizrDocumentationTemplate.java#L291-L294 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java | RingPlacer.partitionNonRingPartners | public void partitionNonRingPartners(IAtom atom, IRing ring, IAtomContainer ringAtoms, IAtomContainer nonRingAtoms) {
"""
Partition the bonding partners of a given atom into ring atoms and non-ring atoms
@param atom The atom whose bonding partners are to be partitioned
@param ring The ring against which ... | java | public void partitionNonRingPartners(IAtom atom, IRing ring, IAtomContainer ringAtoms, IAtomContainer nonRingAtoms) {
List atoms = molecule.getConnectedAtomsList(atom);
for (int i = 0; i < atoms.size(); i++) {
IAtom curAtom = (IAtom) atoms.get(i);
if (!ring.contains(curAtom)) {
... | [
"public",
"void",
"partitionNonRingPartners",
"(",
"IAtom",
"atom",
",",
"IRing",
"ring",
",",
"IAtomContainer",
"ringAtoms",
",",
"IAtomContainer",
"nonRingAtoms",
")",
"{",
"List",
"atoms",
"=",
"molecule",
".",
"getConnectedAtomsList",
"(",
"atom",
")",
";",
... | Partition the bonding partners of a given atom into ring atoms and non-ring atoms
@param atom The atom whose bonding partners are to be partitioned
@param ring The ring against which the bonding partners are checked
@param ringAtoms An AtomContainer to store the ring bonding partners
@param nonRingAtoms An... | [
"Partition",
"the",
"bonding",
"partners",
"of",
"a",
"given",
"atom",
"into",
"ring",
"atoms",
"and",
"non",
"-",
"ring",
"atoms"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java#L666-L676 |
apache/incubator-druid | indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java | SupervisorManager.createAndStartSupervisorInternal | private boolean createAndStartSupervisorInternal(SupervisorSpec spec, boolean persistSpec) {
"""
Creates a supervisor from the provided spec and starts it if there is not already a supervisor with that id.
<p/>
Caller should have acquired [lock] before invoking this method to avoid contention with other threads ... | java | private boolean createAndStartSupervisorInternal(SupervisorSpec spec, boolean persistSpec)
{
String id = spec.getId();
if (supervisors.containsKey(id)) {
return false;
}
if (persistSpec) {
metadataSupervisorManager.insert(id, spec);
}
Supervisor supervisor;
try {
superv... | [
"private",
"boolean",
"createAndStartSupervisorInternal",
"(",
"SupervisorSpec",
"spec",
",",
"boolean",
"persistSpec",
")",
"{",
"String",
"id",
"=",
"spec",
".",
"getId",
"(",
")",
";",
"if",
"(",
"supervisors",
".",
"containsKey",
"(",
"id",
")",
")",
"{"... | Creates a supervisor from the provided spec and starts it if there is not already a supervisor with that id.
<p/>
Caller should have acquired [lock] before invoking this method to avoid contention with other threads that may be
starting, stopping, suspending and resuming supervisors.
@return true if a new supervisor w... | [
"Creates",
"a",
"supervisor",
"from",
"the",
"provided",
"spec",
"and",
"starts",
"it",
"if",
"there",
"is",
"not",
"already",
"a",
"supervisor",
"with",
"that",
"id",
".",
"<p",
"/",
">",
"Caller",
"should",
"have",
"acquired",
"[",
"lock",
"]",
"before... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java#L283-L309 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ffdc/SibDiagnosticModule.java | SibDiagnosticModule.ffdcDumpDefault | public void ffdcDumpDefault(Throwable t, IncidentStream is, Object callerThis, Object[] objs, String sourceId) {
"""
Capture information about this problem into the incidentStream
@param t The exception which triggered the FFDC capture process.
@param is The IncidentStream. Data to be captured... | java | public void ffdcDumpDefault(Throwable t, IncidentStream is, Object callerThis, Object[] objs, String sourceId)
{
is.writeLine("SIB FFDC dump for:", t);
captureDefaultInformation(is,t);
if (callerThis != null)
{
is.writeLine("SibDiagnosticModule :: Dump of callerThis (DiagnosticModule)", toFFDC... | [
"public",
"void",
"ffdcDumpDefault",
"(",
"Throwable",
"t",
",",
"IncidentStream",
"is",
",",
"Object",
"callerThis",
",",
"Object",
"[",
"]",
"objs",
",",
"String",
"sourceId",
")",
"{",
"is",
".",
"writeLine",
"(",
"\"SIB FFDC dump for:\"",
",",
"t",
")",
... | Capture information about this problem into the incidentStream
@param t The exception which triggered the FFDC capture process.
@param is The IncidentStream. Data to be captured is written to this stream.
@param callerThis The 'this' pointer for the object which invoked the filter. The value
will be n... | [
"Capture",
"information",
"about",
"this",
"problem",
"into",
"the",
"incidentStream"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ffdc/SibDiagnosticModule.java#L255-L277 |
graphql-java/java-dataloader | src/main/java/org/dataloader/DataLoader.java | DataLoader.newDataLoaderWithTry | public static <K, V> DataLoader<K, V> newDataLoaderWithTry(BatchLoaderWithContext<K, Try<V>> batchLoadFunction) {
"""
Creates new DataLoader with the specified batch loader function and default options
(batching, caching and unlimited batch size) where the batch loader function returns a list of
{@link org.datal... | java | public static <K, V> DataLoader<K, V> newDataLoaderWithTry(BatchLoaderWithContext<K, Try<V>> batchLoadFunction) {
return newDataLoaderWithTry(batchLoadFunction, null);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"DataLoader",
"<",
"K",
",",
"V",
">",
"newDataLoaderWithTry",
"(",
"BatchLoaderWithContext",
"<",
"K",
",",
"Try",
"<",
"V",
">",
">",
"batchLoadFunction",
")",
"{",
"return",
"newDataLoaderWithTry",
"(",
"batc... | Creates new DataLoader with the specified batch loader function and default options
(batching, caching and unlimited batch size) where the batch loader function returns a list of
{@link org.dataloader.Try} objects.
<p>
If its important you to know the exact status of each item in a batch call and whether it threw excep... | [
"Creates",
"new",
"DataLoader",
"with",
"the",
"specified",
"batch",
"loader",
"function",
"and",
"default",
"options",
"(",
"batching",
"caching",
"and",
"unlimited",
"batch",
"size",
")",
"where",
"the",
"batch",
"loader",
"function",
"returns",
"a",
"list",
... | train | https://github.com/graphql-java/java-dataloader/blob/dfdc8133ead10aa723f896b4a1fa4a1cec9a6fbc/src/main/java/org/dataloader/DataLoader.java#L177-L179 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendClose | public static void sendClose(final int code, String reason, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) {
"""
Sends a complete close message, invoking the callback when complete
@param code The close code
@param wsChannel The web socket channel
@param callback The callback to inv... | java | public static void sendClose(final int code, String reason, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) {
sendClose(new CloseMessage(code, reason), wsChannel, callback);
} | [
"public",
"static",
"void",
"sendClose",
"(",
"final",
"int",
"code",
",",
"String",
"reason",
",",
"final",
"WebSocketChannel",
"wsChannel",
",",
"final",
"WebSocketCallback",
"<",
"Void",
">",
"callback",
")",
"{",
"sendClose",
"(",
"new",
"CloseMessage",
"(... | Sends a complete close message, invoking the callback when complete
@param code The close code
@param wsChannel The web socket channel
@param callback The callback to invoke on completion | [
"Sends",
"a",
"complete",
"close",
"message",
"invoking",
"the",
"callback",
"when",
"complete"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L818-L820 |
kiegroup/droolsjbpm-integration | kie-maven-plugin/src/main/java/org/kie/maven/plugin/BytecodeInjectReactive.java | BytecodeInjectReactive.addMethod | private static int addMethod(ConstPool cPool, CtMethod method) {
"""
Add Method to ConstPool. If method was not in the ConstPool will add and return index, otherwise will return index of already existing entry of constpool
"""
// addMethodrefInfo is a safe add, if constant already present it return the... | java | private static int addMethod(ConstPool cPool, CtMethod method) {
// addMethodrefInfo is a safe add, if constant already present it return the existing value without adding.
return cPool.addMethodrefInfo( cPool.getThisClassInfo(), method.getName(), method.getSignature() );
} | [
"private",
"static",
"int",
"addMethod",
"(",
"ConstPool",
"cPool",
",",
"CtMethod",
"method",
")",
"{",
"// addMethodrefInfo is a safe add, if constant already present it return the existing value without adding.",
"return",
"cPool",
".",
"addMethodrefInfo",
"(",
"cPool",
".",... | Add Method to ConstPool. If method was not in the ConstPool will add and return index, otherwise will return index of already existing entry of constpool | [
"Add",
"Method",
"to",
"ConstPool",
".",
"If",
"method",
"was",
"not",
"in",
"the",
"ConstPool",
"will",
"add",
"and",
"return",
"index",
"otherwise",
"will",
"return",
"index",
"of",
"already",
"existing",
"entry",
"of",
"constpool"
] | train | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-maven-plugin/src/main/java/org/kie/maven/plugin/BytecodeInjectReactive.java#L215-L218 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java | ChannelFrameworkImpl.doesChannelReferenceChain | public synchronized boolean doesChannelReferenceChain(String channelName, String chainName) {
"""
Determine if a channel references a chain in the runtime config.
@param channelName
@param chainName
@return boolean true if channel is referenced by chain, false otherwise
"""
boolean foundRef = fals... | java | public synchronized boolean doesChannelReferenceChain(String channelName, String chainName) {
boolean foundRef = false;
Chain chain = this.chainRunningMap.get(chainName);
if (chain != null) {
ChannelData channelsData[] = chain.getChannelsData();
ChildChannelDataImpl child... | [
"public",
"synchronized",
"boolean",
"doesChannelReferenceChain",
"(",
"String",
"channelName",
",",
"String",
"chainName",
")",
"{",
"boolean",
"foundRef",
"=",
"false",
";",
"Chain",
"chain",
"=",
"this",
".",
"chainRunningMap",
".",
"get",
"(",
"chainName",
"... | Determine if a channel references a chain in the runtime config.
@param channelName
@param chainName
@return boolean true if channel is referenced by chain, false otherwise | [
"Determine",
"if",
"a",
"channel",
"references",
"a",
"chain",
"in",
"the",
"runtime",
"config",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java#L4116-L4134 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.noneSatisfy | @Deprecated
public static boolean noneSatisfy(String string, CharPredicate predicate) {
"""
@return true if none of the characters in the {@code string} answer true for the specified {@code predicate}.
@deprecated since 7.0. Use {@link #noneSatisfyChar(String, CharPredicate)} instead.
"""
return... | java | @Deprecated
public static boolean noneSatisfy(String string, CharPredicate predicate)
{
return StringIterate.noneSatisfyChar(string, predicate);
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"noneSatisfy",
"(",
"String",
"string",
",",
"CharPredicate",
"predicate",
")",
"{",
"return",
"StringIterate",
".",
"noneSatisfyChar",
"(",
"string",
",",
"predicate",
")",
";",
"}"
] | @return true if none of the characters in the {@code string} answer true for the specified {@code predicate}.
@deprecated since 7.0. Use {@link #noneSatisfyChar(String, CharPredicate)} instead. | [
"@return",
"true",
"if",
"none",
"of",
"the",
"characters",
"in",
"the",
"{",
"@code",
"string",
"}",
"answer",
"true",
"for",
"the",
"specified",
"{",
"@code",
"predicate",
"}",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L910-L914 |
EdwardRaff/JSAT | JSAT/src/jsat/lossfunctions/LogisticLoss.java | LogisticLoss.deriv2 | public static double deriv2(double pred, double y) {
"""
Computes the second derivative of the logistic loss
@param pred the predicted value
@param y the true value
@return the second derivative of the logistic loss
"""
final double x = y * pred;
if (x >= 30)
return 0;
... | java | public static double deriv2(double pred, double y)
{
final double x = y * pred;
if (x >= 30)
return 0;
else if (x <= -30)
return 0;
final double p = 1 / (1 + exp(y * pred));
return p * (1 - p);
} | [
"public",
"static",
"double",
"deriv2",
"(",
"double",
"pred",
",",
"double",
"y",
")",
"{",
"final",
"double",
"x",
"=",
"y",
"*",
"pred",
";",
"if",
"(",
"x",
">=",
"30",
")",
"return",
"0",
";",
"else",
"if",
"(",
"x",
"<=",
"-",
"30",
")",
... | Computes the second derivative of the logistic loss
@param pred the predicted value
@param y the true value
@return the second derivative of the logistic loss | [
"Computes",
"the",
"second",
"derivative",
"of",
"the",
"logistic",
"loss"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/lossfunctions/LogisticLoss.java#L65-L76 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.