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 |
|---|---|---|---|---|---|---|---|---|---|---|
jenkinsci/jenkins | core/src/main/java/hudson/XmlFile.java | XmlFile.readRaw | public Reader readRaw() throws IOException {
"""
Opens a {@link Reader} that loads XML.
This method uses {@link #sniffEncoding() the right encoding},
not just the system default encoding.
@throws IOException Encoding issues
@return Reader for the file. should be close externally once read.
"""
try ... | java | public Reader readRaw() throws IOException {
try {
InputStream fileInputStream = Files.newInputStream(file.toPath());
try {
return new InputStreamReader(fileInputStream, sniffEncoding());
} catch (IOException ex) {
// Exception may happen if we... | [
"public",
"Reader",
"readRaw",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"InputStream",
"fileInputStream",
"=",
"Files",
".",
"newInputStream",
"(",
"file",
".",
"toPath",
"(",
")",
")",
";",
"try",
"{",
"return",
"new",
"InputStreamReader",
"(",
... | Opens a {@link Reader} that loads XML.
This method uses {@link #sniffEncoding() the right encoding},
not just the system default encoding.
@throws IOException Encoding issues
@return Reader for the file. should be close externally once read. | [
"Opens",
"a",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/XmlFile.java#L251-L265 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BaseField.java | BaseField.setupTableLookup | public ScreenComponent setupTableLookup(ScreenLoc itsLocation, ComponentParent targetScreen, int iDisplayFieldDesc, Rec record, String iQueryKeySeq, String iDisplayFieldSeq, boolean bIncludeFormButton) {
"""
Same as setupTablePopup for larger files (that don't fit in a popup).
@return Return the component or Scr... | java | public ScreenComponent setupTableLookup(ScreenLoc itsLocation, ComponentParent targetScreen, int iDisplayFieldDesc, Rec record, String iQueryKeySeq, String iDisplayFieldSeq, boolean bIncludeFormButton)
{
return this.setupTableLookup(itsLocation, targetScreen, this, iDisplayFieldDesc, record, iQueryKeySeq, i... | [
"public",
"ScreenComponent",
"setupTableLookup",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"int",
"iDisplayFieldDesc",
",",
"Rec",
"record",
",",
"String",
"iQueryKeySeq",
",",
"String",
"iDisplayFieldSeq",
",",
"boolean",
"bIncludeFo... | Same as setupTablePopup for larger files (that don't fit in a popup).
@return Return the component or ScreenField that is created for this field. | [
"Same",
"as",
"setupTablePopup",
"for",
"larger",
"files",
"(",
"that",
"don",
"t",
"fit",
"in",
"a",
"popup",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1254-L1257 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlPathDecoder.java | VmlPathDecoder.decodeLine | private static String decodeLine(LineString line, float scale) {
"""
Convert {@link LineString} to a VML string.
@param line
line to convert
@param scale
scale to use
@return vml string representation of linestring
"""
if (line == null || line.isEmpty()) {
return "";
}
StringBuilder buffer = ne... | java | private static String decodeLine(LineString line, float scale) {
if (line == null || line.isEmpty()) {
return "";
}
StringBuilder buffer = new StringBuilder();
addCoordinates(buffer, line.getCoordinates(), scale);
buffer.append(" e ");
return buffer.toString();
} | [
"private",
"static",
"String",
"decodeLine",
"(",
"LineString",
"line",
",",
"float",
"scale",
")",
"{",
"if",
"(",
"line",
"==",
"null",
"||",
"line",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"buffer",
"=",
"new... | Convert {@link LineString} to a VML string.
@param line
line to convert
@param scale
scale to use
@return vml string representation of linestring | [
"Convert",
"{",
"@link",
"LineString",
"}",
"to",
"a",
"VML",
"string",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlPathDecoder.java#L86-L94 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java | WorkspacePersistentDataManager.doDelete | protected void doDelete(final ItemData item, final WorkspaceStorageConnection con, ChangedSizeHandler sizeHandler)
throws RepositoryException, InvalidItemStateException {
"""
Performs actual item data deleting.
@param item
to delete
@param con
@param sizeHandler
@throws RepositoryException
@throws In... | java | protected void doDelete(final ItemData item, final WorkspaceStorageConnection con, ChangedSizeHandler sizeHandler)
throws RepositoryException, InvalidItemStateException
{
if (item.isNode())
{
con.delete((NodeData)item);
}
else
{
con.delete((PropertyData)item, si... | [
"protected",
"void",
"doDelete",
"(",
"final",
"ItemData",
"item",
",",
"final",
"WorkspaceStorageConnection",
"con",
",",
"ChangedSizeHandler",
"sizeHandler",
")",
"throws",
"RepositoryException",
",",
"InvalidItemStateException",
"{",
"if",
"(",
"item",
".",
"isNode... | Performs actual item data deleting.
@param item
to delete
@param con
@param sizeHandler
@throws RepositoryException
@throws InvalidItemStateException
if the item is already deleted | [
"Performs",
"actual",
"item",
"data",
"deleting",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java#L1137-L1149 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.contains | public static boolean contains(Collection<?> collection, Object value) {
"""
判断指定集合是否包含指定值,如果集合为空(null或者空),返回{@code false},否则找到元素返回{@code true}
@param collection 集合
@param value 需要查找的值
@return 如果集合为空(null或者空),返回{@code false},否则找到元素返回{@code true}
@since 4.1.10
"""
return isNotEmpty(collection) && colle... | java | public static boolean contains(Collection<?> collection, Object value) {
return isNotEmpty(collection) && collection.contains(value);
} | [
"public",
"static",
"boolean",
"contains",
"(",
"Collection",
"<",
"?",
">",
"collection",
",",
"Object",
"value",
")",
"{",
"return",
"isNotEmpty",
"(",
"collection",
")",
"&&",
"collection",
".",
"contains",
"(",
"value",
")",
";",
"}"
] | 判断指定集合是否包含指定值,如果集合为空(null或者空),返回{@code false},否则找到元素返回{@code true}
@param collection 集合
@param value 需要查找的值
@return 如果集合为空(null或者空),返回{@code false},否则找到元素返回{@code true}
@since 4.1.10 | [
"判断指定集合是否包含指定值,如果集合为空(null或者空),返回",
"{",
"@code",
"false",
"}",
",否则找到元素返回",
"{",
"@code",
"true",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L216-L218 |
cdk/cdk | storage/ctab/src/main/java/org/openscience/cdk/io/MDLRXNWriter.java | MDLRXNWriter.formatMDLInt | private String formatMDLInt(int i, int l) {
"""
Formats an int to fit into the connectiontable and changes it
to a String.
@param i The int to be formated
@param l Length of the String
@return The String to be written into the connectiontable
"""
String s = "", fs = "";
NumberFo... | java | private String formatMDLInt(int i, int l) {
String s = "", fs = "";
NumberFormat nf = NumberFormat.getNumberInstance(Locale.ENGLISH);
nf.setParseIntegerOnly(true);
nf.setMinimumIntegerDigits(1);
nf.setMaximumIntegerDigits(l);
nf.setGroupingUsed(false);
s = nf.form... | [
"private",
"String",
"formatMDLInt",
"(",
"int",
"i",
",",
"int",
"l",
")",
"{",
"String",
"s",
"=",
"\"\"",
",",
"fs",
"=",
"\"\"",
";",
"NumberFormat",
"nf",
"=",
"NumberFormat",
".",
"getNumberInstance",
"(",
"Locale",
".",
"ENGLISH",
")",
";",
"nf"... | Formats an int to fit into the connectiontable and changes it
to a String.
@param i The int to be formated
@param l Length of the String
@return The String to be written into the connectiontable | [
"Formats",
"an",
"int",
"to",
"fit",
"into",
"the",
"connectiontable",
"and",
"changes",
"it",
"to",
"a",
"String",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLRXNWriter.java#L310-L323 |
bazaarvoice/emodb | databus/src/main/java/com/bazaarvoice/emodb/databus/repl/ReplicationClientFactory.java | ReplicationClientFactory.usingApiKey | public ReplicationClientFactory usingApiKey(String apiKey) {
"""
Creates a view of this instance using the given API Key and sharing the same underlying resources.
Note that this method may return a new instance so the caller must use the returned value.
"""
if (Objects.equal(_apiKey, apiKey)) {
... | java | public ReplicationClientFactory usingApiKey(String apiKey) {
if (Objects.equal(_apiKey, apiKey)) {
return this;
}
return new ReplicationClientFactory(_jerseyClient, apiKey);
} | [
"public",
"ReplicationClientFactory",
"usingApiKey",
"(",
"String",
"apiKey",
")",
"{",
"if",
"(",
"Objects",
".",
"equal",
"(",
"_apiKey",
",",
"apiKey",
")",
")",
"{",
"return",
"this",
";",
"}",
"return",
"new",
"ReplicationClientFactory",
"(",
"_jerseyClie... | Creates a view of this instance using the given API Key and sharing the same underlying resources.
Note that this method may return a new instance so the caller must use the returned value. | [
"Creates",
"a",
"view",
"of",
"this",
"instance",
"using",
"the",
"given",
"API",
"Key",
"and",
"sharing",
"the",
"same",
"underlying",
"resources",
".",
"Note",
"that",
"this",
"method",
"may",
"return",
"a",
"new",
"instance",
"so",
"the",
"caller",
"mus... | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus/src/main/java/com/bazaarvoice/emodb/databus/repl/ReplicationClientFactory.java#L38-L43 |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/VortexWorkerManager.java | VortexWorkerManager.launchTasklet | <TInput, TOutput> void launchTasklet(final Tasklet<TInput, TOutput> tasklet) {
"""
Sends a request to launch a Tasklet on a {@link org.apache.reef.vortex.evaluator.VortexWorker}.
"""
assert !runningTasklets.containsKey(tasklet.getId());
runningTasklets.put(tasklet.getId(), tasklet);
if (tasklet.ge... | java | <TInput, TOutput> void launchTasklet(final Tasklet<TInput, TOutput> tasklet) {
assert !runningTasklets.containsKey(tasklet.getId());
runningTasklets.put(tasklet.getId(), tasklet);
if (tasklet.getAggregateFunctionId().isPresent()) {
// function is aggregateable.
final TaskletAggregateExecutionRe... | [
"<",
"TInput",
",",
"TOutput",
">",
"void",
"launchTasklet",
"(",
"final",
"Tasklet",
"<",
"TInput",
",",
"TOutput",
">",
"tasklet",
")",
"{",
"assert",
"!",
"runningTasklets",
".",
"containsKey",
"(",
"tasklet",
".",
"getId",
"(",
")",
")",
";",
"runnin... | Sends a request to launch a Tasklet on a {@link org.apache.reef.vortex.evaluator.VortexWorker}. | [
"Sends",
"a",
"request",
"to",
"launch",
"a",
"Tasklet",
"on",
"a",
"{"
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/VortexWorkerManager.java#L69-L85 |
lets-blade/blade | src/main/java/com/blade/kit/AsmKit.java | AsmKit.getMethodParamNames | public static String[] getMethodParamNames(final Method m) {
"""
get method param names
@param m method
@return return method param names
"""
if (METHOD_NAMES_POOL.containsKey(m)) return METHOD_NAMES_POOL.get(m);
final String[] paramNames = new String[m.getParameterTypes().length];
... | java | public static String[] getMethodParamNames(final Method m) {
if (METHOD_NAMES_POOL.containsKey(m)) return METHOD_NAMES_POOL.get(m);
final String[] paramNames = new String[m.getParameterTypes().length];
final String n = m.getDeclaringClass().getName();
ClassReader cr;
... | [
"public",
"static",
"String",
"[",
"]",
"getMethodParamNames",
"(",
"final",
"Method",
"m",
")",
"{",
"if",
"(",
"METHOD_NAMES_POOL",
".",
"containsKey",
"(",
"m",
")",
")",
"return",
"METHOD_NAMES_POOL",
".",
"get",
"(",
"m",
")",
";",
"final",
"String",
... | get method param names
@param m method
@return return method param names | [
"get",
"method",
"param",
"names"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/AsmKit.java#L63-L102 |
helun/Ektorp | org.ektorp/src/main/java/org/ektorp/util/Documents.java | Documents.setId | public static void setId(Object document, String id) {
"""
Will set the id property on the document IF a mutator exists. Otherwise
nothing happens.
@param document
@param id
"""
DocumentAccessor d = getAccessor(document);
if (d.hasIdMutator()) {
d.setId(document, id);
}
} | java | public static void setId(Object document, String id) {
DocumentAccessor d = getAccessor(document);
if (d.hasIdMutator()) {
d.setId(document, id);
}
} | [
"public",
"static",
"void",
"setId",
"(",
"Object",
"document",
",",
"String",
"id",
")",
"{",
"DocumentAccessor",
"d",
"=",
"getAccessor",
"(",
"document",
")",
";",
"if",
"(",
"d",
".",
"hasIdMutator",
"(",
")",
")",
"{",
"d",
".",
"setId",
"(",
"d... | Will set the id property on the document IF a mutator exists. Otherwise
nothing happens.
@param document
@param id | [
"Will",
"set",
"the",
"id",
"property",
"on",
"the",
"document",
"IF",
"a",
"mutator",
"exists",
".",
"Otherwise",
"nothing",
"happens",
"."
] | train | https://github.com/helun/Ektorp/blob/b822c0d656aefb90a5e0cb5ec2de3daa969e3eaa/org.ektorp/src/main/java/org/ektorp/util/Documents.java#L69-L74 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.bitSet | public static void bitSet(MemorySegment[] segments, int baseOffset, int index) {
"""
set bit from segments.
@param segments target segments.
@param baseOffset bits base offset.
@param index bit index from base offset.
"""
if (segments.length == 1) {
int offset = baseOffset + ((index & BIT_BYTE_POSITI... | java | public static void bitSet(MemorySegment[] segments, int baseOffset, int index) {
if (segments.length == 1) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
MemorySegment segment = segments[0];
byte current = segment.get(offset);
current |= (1 << (index & BIT_BYTE_INDEX_MASK));
segm... | [
"public",
"static",
"void",
"bitSet",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"baseOffset",
",",
"int",
"index",
")",
"{",
"if",
"(",
"segments",
".",
"length",
"==",
"1",
")",
"{",
"int",
"offset",
"=",
"baseOffset",
"+",
"(",
"(",
"... | set bit from segments.
@param segments target segments.
@param baseOffset bits base offset.
@param index bit index from base offset. | [
"set",
"bit",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L491-L501 |
modelmapper/modelmapper | core/src/main/java/org/modelmapper/internal/TypeInfoRegistry.java | TypeInfoRegistry.typeInfoFor | static <T> TypeInfoImpl<T> typeInfoFor(T source, Class<T> sourceType,
InheritingConfiguration configuration) {
"""
Returns a non-cached TypeInfoImpl instance if there is no supported ValueAccessReader for the
{@code sourceType}, else a cached TypeInfoImpl instance is returned.
"""
if (configuratio... | java | static <T> TypeInfoImpl<T> typeInfoFor(T source, Class<T> sourceType,
InheritingConfiguration configuration) {
if (configuration.valueAccessStore.getFirstSupportedReader(sourceType) != null)
return new TypeInfoImpl<T>(source, sourceType, configuration);
return typeInfoFor(sourceType, configurati... | [
"static",
"<",
"T",
">",
"TypeInfoImpl",
"<",
"T",
">",
"typeInfoFor",
"(",
"T",
"source",
",",
"Class",
"<",
"T",
">",
"sourceType",
",",
"InheritingConfiguration",
"configuration",
")",
"{",
"if",
"(",
"configuration",
".",
"valueAccessStore",
".",
"getFir... | Returns a non-cached TypeInfoImpl instance if there is no supported ValueAccessReader for the
{@code sourceType}, else a cached TypeInfoImpl instance is returned. | [
"Returns",
"a",
"non",
"-",
"cached",
"TypeInfoImpl",
"instance",
"if",
"there",
"is",
"no",
"supported",
"ValueAccessReader",
"for",
"the",
"{"
] | train | https://github.com/modelmapper/modelmapper/blob/491d165ded9dc9aba7ce8b56984249e1a1363204/core/src/main/java/org/modelmapper/internal/TypeInfoRegistry.java#L66-L71 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentPersistenceImpl.java | CommerceShipmentPersistenceImpl.findAll | @Override
public List<CommerceShipment> findAll(int start, int end) {
"""
Returns a range of all the commerce shipments.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set... | java | @Override
public List<CommerceShipment> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceShipment",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce shipments.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>st... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"shipments",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentPersistenceImpl.java#L1682-L1685 |
kefirfromperm/kefirbb | src/org/kefirsf/bb/DomConfigurationFactory.java | DomConfigurationFactory.parseNesting | private void parseNesting(Configuration configuration, Document dc) {
"""
Parse nesting element, which describes nesting behavior.
@param configuration parser configuration
@param dc DOM-document
"""
NodeList list = dc.getElementsByTagNameNS(SCHEMA_LOCATION, TAG_NESTING);
if (lis... | java | private void parseNesting(Configuration configuration, Document dc) {
NodeList list = dc.getElementsByTagNameNS(SCHEMA_LOCATION, TAG_NESTING);
if (list.getLength() > 0) {
Node el = list.item(0);
configuration.setNestingLimit(nodeAttribute(el, TAG_NESTING_ATTR_LIMIT, Configuration... | [
"private",
"void",
"parseNesting",
"(",
"Configuration",
"configuration",
",",
"Document",
"dc",
")",
"{",
"NodeList",
"list",
"=",
"dc",
".",
"getElementsByTagNameNS",
"(",
"SCHEMA_LOCATION",
",",
"TAG_NESTING",
")",
";",
"if",
"(",
"list",
".",
"getLength",
... | Parse nesting element, which describes nesting behavior.
@param configuration parser configuration
@param dc DOM-document | [
"Parse",
"nesting",
"element",
"which",
"describes",
"nesting",
"behavior",
"."
] | train | https://github.com/kefirfromperm/kefirbb/blob/8c36fc3d3dc27459b0cdc179b87582df30420856/src/org/kefirsf/bb/DomConfigurationFactory.java#L152-L161 |
grpc/grpc-java | core/src/main/java/io/grpc/internal/TransportFrameUtil.java | TransportFrameUtil.toHttp2Headers | public static byte[][] toHttp2Headers(Metadata headers) {
"""
Transform the given headers to a format where only spec-compliant ASCII characters are allowed.
Binary header values are encoded by Base64 in the result. It is safe to modify the returned
array, but not to modify any of the underlying byte arrays.
... | java | public static byte[][] toHttp2Headers(Metadata headers) {
byte[][] serializedHeaders = InternalMetadata.serialize(headers);
// TODO(carl-mastrangelo): eventually remove this once all callers are updated.
if (serializedHeaders == null) {
return new byte[][]{};
}
int k = 0;
for (int i = 0; i... | [
"public",
"static",
"byte",
"[",
"]",
"[",
"]",
"toHttp2Headers",
"(",
"Metadata",
"headers",
")",
"{",
"byte",
"[",
"]",
"[",
"]",
"serializedHeaders",
"=",
"InternalMetadata",
".",
"serialize",
"(",
"headers",
")",
";",
"// TODO(carl-mastrangelo): eventually r... | Transform the given headers to a format where only spec-compliant ASCII characters are allowed.
Binary header values are encoded by Base64 in the result. It is safe to modify the returned
array, but not to modify any of the underlying byte arrays.
@return the interleaved keys and values. | [
"Transform",
"the",
"given",
"headers",
"to",
"a",
"format",
"where",
"only",
"spec",
"-",
"compliant",
"ASCII",
"characters",
"are",
"allowed",
".",
"Binary",
"header",
"values",
"are",
"encoded",
"by",
"Base64",
"in",
"the",
"result",
".",
"It",
"is",
"s... | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/TransportFrameUtil.java#L50-L86 |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/ServerHelper.java | ServerHelper.shutdownStandalone | public static void shutdownStandalone(final ModelControllerClient client, final int timeout) throws IOException {
"""
Shuts down a standalone server.
@param client the client used to communicate with the server
@param timeout the graceful shutdown timeout, a value of {@code -1} will wait indefinitely and a va... | java | public static void shutdownStandalone(final ModelControllerClient client, final int timeout) throws IOException {
final ModelNode op = Operations.createOperation("shutdown");
op.get("timeout").set(timeout);
final ModelNode response = client.execute(op);
if (Operations.isSuccessfulOutcome... | [
"public",
"static",
"void",
"shutdownStandalone",
"(",
"final",
"ModelControllerClient",
"client",
",",
"final",
"int",
"timeout",
")",
"throws",
"IOException",
"{",
"final",
"ModelNode",
"op",
"=",
"Operations",
".",
"createOperation",
"(",
"\"shutdown\"",
")",
"... | Shuts down a standalone server.
@param client the client used to communicate with the server
@param timeout the graceful shutdown timeout, a value of {@code -1} will wait indefinitely and a value of
{@code 0} will not attempt a graceful shutdown
@throws IOException if an error occurs communicating with the server | [
"Shuts",
"down",
"a",
"standalone",
"server",
"."
] | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/ServerHelper.java#L372-L391 |
NoraUi/NoraUi | src/main/java/com/github/noraui/utils/Context.java | Context.initDataId | private static void initDataId(String scenarioName) throws TechnicalException {
"""
init all Data index (by model).
@param scenarioName
name of scenario.
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
"""
final List<DataIndex> ind... | java | private static void initDataId(String scenarioName) throws TechnicalException {
final List<DataIndex> indexData = new ArrayList<>();
try {
Context.getDataInputProvider().prepare(scenarioName);
final Class<Model> model = Context.getDataInputProvider().getModel(Context.getModelPack... | [
"private",
"static",
"void",
"initDataId",
"(",
"String",
"scenarioName",
")",
"throws",
"TechnicalException",
"{",
"final",
"List",
"<",
"DataIndex",
">",
"indexData",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"Context",
".",
"getDataInputProv... | init all Data index (by model).
@param scenarioName
name of scenario.
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi. | [
"init",
"all",
"Data",
"index",
"(",
"by",
"model",
")",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/utils/Context.java#L790-L819 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/IntCounter.java | IntCounter.setCounts | public void setCounts(Collection<E> keys, int count) {
"""
Sets the current count for each of the given keys. This will wipe out
any existing counts for these keys.
<p/>
To add to the counts of a collection of objects instead of replacing them,
use {@link #incrementCounts(Collection,int)}.
"""
for (E ... | java | public void setCounts(Collection<E> keys, int count) {
for (E key : keys) {
setCount(key, count);
}
} | [
"public",
"void",
"setCounts",
"(",
"Collection",
"<",
"E",
">",
"keys",
",",
"int",
"count",
")",
"{",
"for",
"(",
"E",
"key",
":",
"keys",
")",
"{",
"setCount",
"(",
"key",
",",
"count",
")",
";",
"}",
"}"
] | Sets the current count for each of the given keys. This will wipe out
any existing counts for these keys.
<p/>
To add to the counts of a collection of objects instead of replacing them,
use {@link #incrementCounts(Collection,int)}. | [
"Sets",
"the",
"current",
"count",
"for",
"each",
"of",
"the",
"given",
"keys",
".",
"This",
"will",
"wipe",
"out",
"any",
"existing",
"counts",
"for",
"these",
"keys",
".",
"<p",
"/",
">",
"To",
"add",
"to",
"the",
"counts",
"of",
"a",
"collection",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/IntCounter.java#L218-L222 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java | JedisUtils.newShardedJedisPool | public static ShardedJedisPool newShardedJedisPool(JedisPoolConfig poolConfig,
String hostsAndPorts, int timeoutMs) {
"""
Create a new {@link ShardedJedisPool} with specified pool configs.
@param poolConfig
@param hostsAndPorts
format {@code host1:port1,host2:port2,...}, default Redis port is used... | java | public static ShardedJedisPool newShardedJedisPool(JedisPoolConfig poolConfig,
String hostsAndPorts, int timeoutMs) {
return newShardedJedisPool(poolConfig, hostsAndPorts, null, timeoutMs);
} | [
"public",
"static",
"ShardedJedisPool",
"newShardedJedisPool",
"(",
"JedisPoolConfig",
"poolConfig",
",",
"String",
"hostsAndPorts",
",",
"int",
"timeoutMs",
")",
"{",
"return",
"newShardedJedisPool",
"(",
"poolConfig",
",",
"hostsAndPorts",
",",
"null",
",",
"timeout... | Create a new {@link ShardedJedisPool} with specified pool configs.
@param poolConfig
@param hostsAndPorts
format {@code host1:port1,host2:port2,...}, default Redis port is used if not
specified
@param timeoutMs
@return | [
"Create",
"a",
"new",
"{",
"@link",
"ShardedJedisPool",
"}",
"with",
"specified",
"pool",
"configs",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/redis/JedisUtils.java#L380-L383 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java | PlanNode.hasAncestorOfType | public boolean hasAncestorOfType( Type firstType,
Type... additionalTypes ) {
"""
Determine whether this node has an ancestor with any of the supplied types.
@param firstType the first type; may not be null
@param additionalTypes the additional types; may not be null
@ret... | java | public boolean hasAncestorOfType( Type firstType,
Type... additionalTypes ) {
return hasAncestorOfType(EnumSet.of(firstType, additionalTypes));
} | [
"public",
"boolean",
"hasAncestorOfType",
"(",
"Type",
"firstType",
",",
"Type",
"...",
"additionalTypes",
")",
"{",
"return",
"hasAncestorOfType",
"(",
"EnumSet",
".",
"of",
"(",
"firstType",
",",
"additionalTypes",
")",
")",
";",
"}"
] | Determine whether this node has an ancestor with any of the supplied types.
@param firstType the first type; may not be null
@param additionalTypes the additional types; may not be null
@return true if there is at least one ancestor that has any of the supplied types, or false otherwise | [
"Determine",
"whether",
"this",
"node",
"has",
"an",
"ancestor",
"with",
"any",
"of",
"the",
"supplied",
"types",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L928-L931 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doHttpPut | public void doHttpPut(String url, String templateName, Object model, HttpResponse result) {
"""
Performs PUT to supplied url of result of applying template with model.
@param url url to put to.
@param templateName name of template to use.
@param model model for template.
@param result result to populate with r... | java | public void doHttpPut(String url, String templateName, Object model, HttpResponse result) {
doHttpPut(url, templateName, model, result, null, XmlHttpResponse.CONTENT_TYPE_XML_TEXT_UTF8);
} | [
"public",
"void",
"doHttpPut",
"(",
"String",
"url",
",",
"String",
"templateName",
",",
"Object",
"model",
",",
"HttpResponse",
"result",
")",
"{",
"doHttpPut",
"(",
"url",
",",
"templateName",
",",
"model",
",",
"result",
",",
"null",
",",
"XmlHttpResponse... | Performs PUT to supplied url of result of applying template with model.
@param url url to put to.
@param templateName name of template to use.
@param model model for template.
@param result result to populate with response. | [
"Performs",
"PUT",
"to",
"supplied",
"url",
"of",
"result",
"of",
"applying",
"template",
"with",
"model",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L318-L320 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutParser.java | LayoutParser.parseDocument | public static Layout parseDocument(Document document) {
"""
Parse the layout from an XML document.
@param document An XML document.
@return The root layout element.
"""
return new Layout(instance.parseChildren(document, null, Tag.LAYOUT));
} | java | public static Layout parseDocument(Document document) {
return new Layout(instance.parseChildren(document, null, Tag.LAYOUT));
} | [
"public",
"static",
"Layout",
"parseDocument",
"(",
"Document",
"document",
")",
"{",
"return",
"new",
"Layout",
"(",
"instance",
".",
"parseChildren",
"(",
"document",
",",
"null",
",",
"Tag",
".",
"LAYOUT",
")",
")",
";",
"}"
] | Parse the layout from an XML document.
@param document An XML document.
@return The root layout element. | [
"Parse",
"the",
"layout",
"from",
"an",
"XML",
"document",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutParser.java#L150-L152 |
JodaOrg/joda-time | src/main/java/org/joda/time/Period.java | Period.withPeriodType | public Period withPeriodType(PeriodType type) {
"""
Creates a new Period instance with the same field values but
different PeriodType.
<p>
This period instance is immutable and unaffected by this method call.
@param type the period type to use, null means standard
@return the new period instance
@throws I... | java | public Period withPeriodType(PeriodType type) {
type = DateTimeUtils.getPeriodType(type);
if (type.equals(getPeriodType())) {
return this;
}
return new Period(this, type);
} | [
"public",
"Period",
"withPeriodType",
"(",
"PeriodType",
"type",
")",
"{",
"type",
"=",
"DateTimeUtils",
".",
"getPeriodType",
"(",
"type",
")",
";",
"if",
"(",
"type",
".",
"equals",
"(",
"getPeriodType",
"(",
")",
")",
")",
"{",
"return",
"this",
";",
... | Creates a new Period instance with the same field values but
different PeriodType.
<p>
This period instance is immutable and unaffected by this method call.
@param type the period type to use, null means standard
@return the new period instance
@throws IllegalArgumentException if the new period won't accept all of th... | [
"Creates",
"a",
"new",
"Period",
"instance",
"with",
"the",
"same",
"field",
"values",
"but",
"different",
"PeriodType",
".",
"<p",
">",
"This",
"period",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L835-L841 |
avarabyeu/restendpoint | src/main/java/com/github/avarabyeu/restendpoint/http/PreemptiveAuthInterceptor.java | PreemptiveAuthInterceptor.process | @Override
public final void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException {
"""
Adds provided auth scheme to the client if there are no another provided
auth schemes
"""
AuthState authState = (AuthState) context.getAttribute(HttpClientContext.TARG... | java | @Override
public final void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException {
AuthState authState = (AuthState) context.getAttribute(HttpClientContext.TARGET_AUTH_STATE);
if (authState.getAuthScheme() == null) {
HttpHost targetHost = (Htt... | [
"@",
"Override",
"public",
"final",
"void",
"process",
"(",
"final",
"HttpRequest",
"request",
",",
"final",
"HttpContext",
"context",
")",
"throws",
"HttpException",
",",
"IOException",
"{",
"AuthState",
"authState",
"=",
"(",
"AuthState",
")",
"context",
".",
... | Adds provided auth scheme to the client if there are no another provided
auth schemes | [
"Adds",
"provided",
"auth",
"scheme",
"to",
"the",
"client",
"if",
"there",
"are",
"no",
"another",
"provided",
"auth",
"schemes"
] | train | https://github.com/avarabyeu/restendpoint/blob/e11fc0813ea4cefbe4d8bca292cd48b40abf185d/src/main/java/com/github/avarabyeu/restendpoint/http/PreemptiveAuthInterceptor.java#L44-L55 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildMethodTags | public void buildMethodTags(XMLNode node, Content methodsContentTree) {
"""
Build the method tags.
@param node the XML element that specifies which components to document
@param methodsContentTree content tree to which the documentation will be added
"""
methodWriter.addMemberTags((MethodDoc) curre... | java | public void buildMethodTags(XMLNode node, Content methodsContentTree) {
methodWriter.addMemberTags((MethodDoc) currentMember, methodsContentTree);
MethodDoc method = (MethodDoc)currentMember;
if (method.name().compareTo("writeExternal") == 0
&& method.tags("serialData").length ==... | [
"public",
"void",
"buildMethodTags",
"(",
"XMLNode",
"node",
",",
"Content",
"methodsContentTree",
")",
"{",
"methodWriter",
".",
"addMemberTags",
"(",
"(",
"MethodDoc",
")",
"currentMember",
",",
"methodsContentTree",
")",
";",
"MethodDoc",
"method",
"=",
"(",
... | Build the method tags.
@param node the XML element that specifies which components to document
@param methodsContentTree content tree to which the documentation will be added | [
"Build",
"the",
"method",
"tags",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java#L351-L362 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java | MessageFormat.parseObject | @Override
public Object parseObject(String source, ParsePosition pos) {
"""
Parses text from a string to produce an object array or Map.
<p>
The method attempts to parse text starting at the index given by
<code>pos</code>.
If parsing succeeds, then the index of <code>pos</code> is updated
to the index af... | java | @Override
public Object parseObject(String source, ParsePosition pos) {
if (!msgPattern.hasNamedArguments()) {
return parse(source, pos);
} else {
return parseToMap(source, pos);
}
} | [
"@",
"Override",
"public",
"Object",
"parseObject",
"(",
"String",
"source",
",",
"ParsePosition",
"pos",
")",
"{",
"if",
"(",
"!",
"msgPattern",
".",
"hasNamedArguments",
"(",
")",
")",
"{",
"return",
"parse",
"(",
"source",
",",
"pos",
")",
";",
"}",
... | Parses text from a string to produce an object array or Map.
<p>
The method attempts to parse text starting at the index given by
<code>pos</code>.
If parsing succeeds, then the index of <code>pos</code> is updated
to the index after the last character used (parsing does not necessarily
use all characters up to the end... | [
"Parses",
"text",
"from",
"a",
"string",
"to",
"produce",
"an",
"object",
"array",
"or",
"Map",
".",
"<p",
">",
"The",
"method",
"attempts",
"to",
"parse",
"text",
"starting",
"at",
"the",
"index",
"given",
"by",
"<code",
">",
"pos<",
"/",
"code",
">",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java#L1379-L1386 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.addProjectBadge | public GitlabBadge addProjectBadge(Serializable projectId, String linkUrl, String imageUrl) throws IOException {
"""
Add project badge
@param projectId The id of the project for which the badge should be added
@param linkUrl The URL that the badge should link to
@param imageUrl The URL to the badge image
... | java | public GitlabBadge addProjectBadge(Serializable projectId, String linkUrl, String imageUrl) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabBadge.URL;
return dispatch().with("link_url", linkUrl)
.with("image_url", imageUrl)
... | [
"public",
"GitlabBadge",
"addProjectBadge",
"(",
"Serializable",
"projectId",
",",
"String",
"linkUrl",
",",
"String",
"imageUrl",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"URL",
"+",
"\"/\"",
"+",
"sanitizeProjectId",
"("... | Add project badge
@param projectId The id of the project for which the badge should be added
@param linkUrl The URL that the badge should link to
@param imageUrl The URL to the badge image
@return The created badge
@throws IOException on GitLab API call error | [
"Add",
"project",
"badge"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L2633-L2638 |
unbescape/unbescape | src/main/java/org/unbescape/css/CssEscape.java | CssEscape.escapeCssStringMinimal | public static void escapeCssStringMinimal(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform a CSS String level 1 (only basic set) <strong>escape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this meth... | java | public static void escapeCssStringMinimal(final String text, final Writer writer)
throws IOException {
escapeCssString(text, writer,
CssStringEscapeType.BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA,
CssStringEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET);
} | [
"public",
"static",
"void",
"escapeCssStringMinimal",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeCssString",
"(",
"text",
",",
"writer",
",",
"CssStringEscapeType",
".",
"BACKSLASH_ESCAPES_DEFAULT_TO_COM... | <p>
Perform a CSS String level 1 (only basic set) <strong>escape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this method will only escape the CSS String basic escape set:
</p>
<ul>
<li>The <em>Backslash Escapes</em>:
<tt>\"</tt> (<tt>U+00... | [
"<p",
">",
"Perform",
"a",
"CSS",
"String",
"level",
"1",
"(",
"only",
"basic",
"set",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/css/CssEscape.java#L344-L349 |
dihedron/dihedron-commons | src/main/java/org/dihedron/patterns/cache/handlers/MultiCacheMissHandler.java | MultiCacheMissHandler.getAsStream | public InputStream getAsStream() throws CacheException {
"""
Attempts a resource retrieval from each of the provided
<code>CacheMissHandler</code>s; as soon as one succeeds, it returns it as
an <code>InputStream</code>.
@return
the resource as an <code>InputStream</code>, as soon as any of the
<code>CacheMi... | java | public InputStream getAsStream() throws CacheException {
List<Exception> exceptions = new ArrayList<Exception>();
for (CacheMissHandler handler : handlers) {
try {
logger.debug("trying handler of class '{}'", handler.getClass());
InputStream stream = handler.getAsStream();
if(stream != null) {
... | [
"public",
"InputStream",
"getAsStream",
"(",
")",
"throws",
"CacheException",
"{",
"List",
"<",
"Exception",
">",
"exceptions",
"=",
"new",
"ArrayList",
"<",
"Exception",
">",
"(",
")",
";",
"for",
"(",
"CacheMissHandler",
"handler",
":",
"handlers",
")",
"{... | Attempts a resource retrieval from each of the provided
<code>CacheMissHandler</code>s; as soon as one succeeds, it returns it as
an <code>InputStream</code>.
@return
the resource as an <code>InputStream</code>, as soon as any of the
<code>CacheMissHandler</code>s succeeds, null otherwise. | [
"Attempts",
"a",
"resource",
"retrieval",
"from",
"each",
"of",
"the",
"provided",
"<code",
">",
"CacheMissHandler<",
"/",
"code",
">",
"s",
";",
"as",
"soon",
"as",
"one",
"succeeds",
"it",
"returns",
"it",
"as",
"an",
"<code",
">",
"InputStream<",
"/",
... | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/patterns/cache/handlers/MultiCacheMissHandler.java#L101-L123 |
scireum/s3ninja | src/main/java/ninja/AwsLegacyHashCalculator.java | AwsLegacyHashCalculator.computeHash | public String computeHash(WebContext ctx, String pathPrefix) throws Exception {
"""
Computes the authentication hash as specified by the AWS SDK for verification purposes.
@param ctx the current request to fetch parameters from
@param pathPrefix the path prefix to preped to the {@link S3Dispatcher#getEf... | java | public String computeHash(WebContext ctx, String pathPrefix) throws Exception {
StringBuilder stringToSign = new StringBuilder(ctx.getRequest().method().name());
stringToSign.append("\n");
stringToSign.append(ctx.getHeaderValue("Content-MD5").asString(""));
stringToSign.append("\n");
... | [
"public",
"String",
"computeHash",
"(",
"WebContext",
"ctx",
",",
"String",
"pathPrefix",
")",
"throws",
"Exception",
"{",
"StringBuilder",
"stringToSign",
"=",
"new",
"StringBuilder",
"(",
"ctx",
".",
"getRequest",
"(",
")",
".",
"method",
"(",
")",
".",
"n... | Computes the authentication hash as specified by the AWS SDK for verification purposes.
@param ctx the current request to fetch parameters from
@param pathPrefix the path prefix to preped to the {@link S3Dispatcher#getEffectiveURI(WebContext) effective URI}
of the request
@return the computes hash value
@throws... | [
"Computes",
"the",
"authentication",
"hash",
"as",
"specified",
"by",
"the",
"AWS",
"SDK",
"for",
"verification",
"purposes",
"."
] | train | https://github.com/scireum/s3ninja/blob/445eec55c91780267a7f987818b3fedecae009c5/src/main/java/ninja/AwsLegacyHashCalculator.java#L71-L118 |
enioka/jqm | jqm-all/jqm-model/src/main/java/com/enioka/jqm/model/Cl.java | Cl.map | static Cl map(ResultSet rs, int colShift) {
"""
ResultSet is not modified (no rs.next called).
@param rs
@return
"""
Cl tmp = new Cl();
try
{
tmp.id = rs.getInt(1 + colShift);
tmp.name = rs.getString(2 + colShift);
tmp.childFirst = rs.getBoolean(... | java | static Cl map(ResultSet rs, int colShift)
{
Cl tmp = new Cl();
try
{
tmp.id = rs.getInt(1 + colShift);
tmp.name = rs.getString(2 + colShift);
tmp.childFirst = rs.getBoolean(3 + colShift);
tmp.hiddenClasses = rs.getString(4 + colShift);
... | [
"static",
"Cl",
"map",
"(",
"ResultSet",
"rs",
",",
"int",
"colShift",
")",
"{",
"Cl",
"tmp",
"=",
"new",
"Cl",
"(",
")",
";",
"try",
"{",
"tmp",
".",
"id",
"=",
"rs",
".",
"getInt",
"(",
"1",
"+",
"colShift",
")",
";",
"tmp",
".",
"name",
"=... | ResultSet is not modified (no rs.next called).
@param rs
@return | [
"ResultSet",
"is",
"not",
"modified",
"(",
"no",
"rs",
".",
"next",
"called",
")",
"."
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-model/src/main/java/com/enioka/jqm/model/Cl.java#L171-L190 |
finmath/finmath-lib | src/main/java6/net/finmath/fouriermethod/products/AbstractProductFourierTransform.java | AbstractProductFourierTransform.getValue | public double getValue(ProcessCharacteristicFunctionInterface model) {
"""
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is... | java | public double getValue(ProcessCharacteristicFunctionInterface model) {
final CharacteristicFunctionInterface modelCF = model.apply(getMaturity());
final CharacteristicFunctionInterface productCF = this;
final double lineOfIntegration = 0.5 * getIntegrationDomainImagUpperBound()+getIntegrationDomainImagLowerBo... | [
"public",
"double",
"getValue",
"(",
"ProcessCharacteristicFunctionInterface",
"model",
")",
"{",
"final",
"CharacteristicFunctionInterface",
"modelCF",
"=",
"model",
".",
"apply",
"(",
"getMaturity",
"(",
")",
")",
";",
"final",
"CharacteristicFunctionInterface",
"prod... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/fouriermethod/products/AbstractProductFourierTransform.java#L32-L49 |
alkacon/opencms-core | src/org/opencms/main/OpenCmsServlet.java | OpenCmsServlet.invokeHandler | protected void invokeHandler(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
"""
Manages requests to internal OpenCms request handlers.<p>
@param req the current request
@param res the current response
@throws ServletException in case an error occurs
@throws ServletExc... | java | protected void invokeHandler(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
String name = OpenCmsCore.getInstance().getPathInfo(req).substring(HANDLE_PATH.length());
I_CmsRequestHandler handler = OpenCmsCore.getInstance().getRequestHandler(name);
if ((ha... | [
"protected",
"void",
"invokeHandler",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"String",
"name",
"=",
"OpenCmsCore",
".",
"getInstance",
"(",
")",
".",
"getPathInfo",
"(",
"req... | Manages requests to internal OpenCms request handlers.<p>
@param req the current request
@param res the current response
@throws ServletException in case an error occurs
@throws ServletException in case an error occurs
@throws IOException in case an error occurs | [
"Manages",
"requests",
"to",
"internal",
"OpenCms",
"request",
"handlers",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/OpenCmsServlet.java#L282-L296 |
WiQuery/wiquery | wiquery-core/src/main/java/org/odlabs/wiquery/core/behavior/WiQueryAbstractAjaxBehavior.java | WiQueryAbstractAjaxBehavior.renderHead | @Override
public void renderHead(Component component, IHeaderResponse response) {
"""
<p>
Since wicket 6.0 {@link #statement()} is no longer needed, nearly all of WiQuery
core's inner workings have been ported to Wicket 6.0. Use
{@link #renderHead(Component, IHeaderResponse)} to render your statement.
</p>
<... | java | @Override
public void renderHead(Component component, IHeaderResponse response)
{
super.renderHead(component, response);
JsStatement statement = statement();
if (statement != null)
{
String statementString = statement.render().toString();
if (!Strings.isEmpty(statementString))
{
response.render(... | [
"@",
"Override",
"public",
"void",
"renderHead",
"(",
"Component",
"component",
",",
"IHeaderResponse",
"response",
")",
"{",
"super",
".",
"renderHead",
"(",
"component",
",",
"response",
")",
";",
"JsStatement",
"statement",
"=",
"statement",
"(",
")",
";",
... | <p>
Since wicket 6.0 {@link #statement()} is no longer needed, nearly all of WiQuery
core's inner workings have been ported to Wicket 6.0. Use
{@link #renderHead(Component, IHeaderResponse)} to render your statement.
</p>
<p>
For backward compatibility we render the output of this function in an
{@link OnDomReadyHeader... | [
"<p",
">",
"Since",
"wicket",
"6",
".",
"0",
"{"
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/behavior/WiQueryAbstractAjaxBehavior.java#L75-L89 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/lang/parser/StandardCoercionManager.java | StandardCoercionManager.verifyTypesComparable | public IType verifyTypesComparable( IType lhsType, IType rhsType, boolean bBiDirectional ) throws ParseException {
"""
private TypeSystemAwareCache<TypesComp, IType> getCompCache() { return _compCache; }
"""
return verifyTypesComparable( lhsType, rhsType, bBiDirectional, null );
} | java | public IType verifyTypesComparable( IType lhsType, IType rhsType, boolean bBiDirectional ) throws ParseException
{
return verifyTypesComparable( lhsType, rhsType, bBiDirectional, null );
} | [
"public",
"IType",
"verifyTypesComparable",
"(",
"IType",
"lhsType",
",",
"IType",
"rhsType",
",",
"boolean",
"bBiDirectional",
")",
"throws",
"ParseException",
"{",
"return",
"verifyTypesComparable",
"(",
"lhsType",
",",
"rhsType",
",",
"bBiDirectional",
",",
"null... | private TypeSystemAwareCache<TypesComp, IType> getCompCache() { return _compCache; } | [
"private",
"TypeSystemAwareCache<TypesComp",
"IType",
">",
"getCompCache",
"()",
"{",
"return",
"_compCache",
";",
"}"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/lang/parser/StandardCoercionManager.java#L672-L675 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java | ResourceInjectionBinding.setEnvEntryType | public void setEnvEntryType(ResourceImpl annotation, Object type) // F743-32443
throws InjectionException {
"""
Sets the type of this binding.
@param annotation the merged data
@param type a type object returned from {@link #getEnvEntryType}
"""
if (type instanceof String)
{
... | java | public void setEnvEntryType(ResourceImpl annotation, Object type) // F743-32443
throws InjectionException
{
if (type instanceof String)
{
setInjectionClassTypeName((String) type);
}
else
{
Class<?> classType = (Class<?>) type;
annotatio... | [
"public",
"void",
"setEnvEntryType",
"(",
"ResourceImpl",
"annotation",
",",
"Object",
"type",
")",
"// F743-32443",
"throws",
"InjectionException",
"{",
"if",
"(",
"type",
"instanceof",
"String",
")",
"{",
"setInjectionClassTypeName",
"(",
"(",
"String",
")",
"ty... | Sets the type of this binding.
@param annotation the merged data
@param type a type object returned from {@link #getEnvEntryType} | [
"Sets",
"the",
"type",
"of",
"this",
"binding",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java#L1718-L1732 |
elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseEventManager.java | DatabaseEventManager.fireObjectsChanged | private void fireObjectsChanged(DBIDs objects, Type type) {
"""
Handles a DataStoreEvent with the specified type. If the current event type
is not equal to the specified type, the events accumulated up to now will
be fired first.
The new event will be aggregated and fired on demand if
{@link #accumulateDataS... | java | private void fireObjectsChanged(DBIDs objects, Type type) {
// flush first
if(currentDataStoreEventType != null && !currentDataStoreEventType.equals(type)) {
flushDataStoreEvents();
}
if(accumulateDataStoreEvents) {
if(this.dataStoreObjects == null) {
this.dataStoreObjects = DBIDUtil... | [
"private",
"void",
"fireObjectsChanged",
"(",
"DBIDs",
"objects",
",",
"Type",
"type",
")",
"{",
"// flush first",
"if",
"(",
"currentDataStoreEventType",
"!=",
"null",
"&&",
"!",
"currentDataStoreEventType",
".",
"equals",
"(",
"type",
")",
")",
"{",
"flushData... | Handles a DataStoreEvent with the specified type. If the current event type
is not equal to the specified type, the events accumulated up to now will
be fired first.
The new event will be aggregated and fired on demand if
{@link #accumulateDataStoreEvents} is set, otherwise all registered
<code>DataStoreListener</code... | [
"Handles",
"a",
"DataStoreEvent",
"with",
"the",
"specified",
"type",
".",
"If",
"the",
"current",
"event",
"type",
"is",
"not",
"equal",
"to",
"the",
"specified",
"type",
"the",
"events",
"accumulated",
"up",
"to",
"now",
"will",
"be",
"fired",
"first",
"... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseEventManager.java#L242-L274 |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/table/BlockIterator.java | BlockIterator.readEntry | private static BlockEntry readEntry(SliceInput data, BlockEntry previousEntry) {
"""
Reads the entry at the current data readIndex.
After this method, data readIndex is positioned at the beginning of the next entry
or at the end of data if there was not a next entry.
@return true if an entry was read
"""
... | java | private static BlockEntry readEntry(SliceInput data, BlockEntry previousEntry)
{
requireNonNull(data, "data is null");
// read entry header
int sharedKeyLength = VariableLengthQuantity.readVariableLengthInt(data);
int nonSharedKeyLength = VariableLengthQuantity.readVariableLengthInt... | [
"private",
"static",
"BlockEntry",
"readEntry",
"(",
"SliceInput",
"data",
",",
"BlockEntry",
"previousEntry",
")",
"{",
"requireNonNull",
"(",
"data",
",",
"\"data is null\"",
")",
";",
"// read entry header",
"int",
"sharedKeyLength",
"=",
"VariableLengthQuantity",
... | Reads the entry at the current data readIndex.
After this method, data readIndex is positioned at the beginning of the next entry
or at the end of data if there was not a next entry.
@return true if an entry was read | [
"Reads",
"the",
"entry",
"at",
"the",
"current",
"data",
"readIndex",
".",
"After",
"this",
"method",
"data",
"readIndex",
"is",
"positioned",
"at",
"the",
"beginning",
"of",
"the",
"next",
"entry",
"or",
"at",
"the",
"end",
"of",
"data",
"if",
"there",
... | train | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/table/BlockIterator.java#L182-L204 |
hudson3-plugins/warnings-plugin | src/main/java/hudson/plugins/warnings/parser/MsBuildParser.java | MsBuildParser.isOfType | private boolean isOfType(final Matcher matcher, final String type) {
"""
Returns whether the warning type is of the specified type.
@param matcher
the matcher
@param type
the type to match with
@return <code>true</code> if the warning type is of the specified type
"""
return StringUtils.contains... | java | private boolean isOfType(final Matcher matcher, final String type) {
return StringUtils.containsIgnoreCase(matcher.group(4), type);
} | [
"private",
"boolean",
"isOfType",
"(",
"final",
"Matcher",
"matcher",
",",
"final",
"String",
"type",
")",
"{",
"return",
"StringUtils",
".",
"containsIgnoreCase",
"(",
"matcher",
".",
"group",
"(",
"4",
")",
",",
"type",
")",
";",
"}"
] | Returns whether the warning type is of the specified type.
@param matcher
the matcher
@param type
the type to match with
@return <code>true</code> if the warning type is of the specified type | [
"Returns",
"whether",
"the",
"warning",
"type",
"is",
"of",
"the",
"specified",
"type",
"."
] | train | https://github.com/hudson3-plugins/warnings-plugin/blob/462c9f3dffede9120173935567392b22520b0966/src/main/java/hudson/plugins/warnings/parser/MsBuildParser.java#L110-L112 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java | SftpClient.getFiles | public SftpFile[] getFiles(String remote, String local,
FileTransferProgress progress, boolean resume)
throws FileNotFoundException, SftpStatusException, SshException,
TransferCancelledException {
"""
<p>
Download the remote file to the local computer. If the paths provided are
not absolute the current ... | java | public SftpFile[] getFiles(String remote, String local,
FileTransferProgress progress, boolean resume)
throws FileNotFoundException, SftpStatusException, SshException,
TransferCancelledException {
return getFileMatches(remote, local, progress, resume);
} | [
"public",
"SftpFile",
"[",
"]",
"getFiles",
"(",
"String",
"remote",
",",
"String",
"local",
",",
"FileTransferProgress",
"progress",
",",
"boolean",
"resume",
")",
"throws",
"FileNotFoundException",
",",
"SftpStatusException",
",",
"SshException",
",",
"TransferCan... | <p>
Download the remote file to the local computer. If the paths provided are
not absolute the current working directory is used.
</p>
@param remote
the regular expression path/name of the remote files
@param local
the path/name to place the file on the local computer
@param progress
@return SftpFile[]
@throws SftpS... | [
"<p",
">",
"Download",
"the",
"remote",
"file",
"to",
"the",
"local",
"computer",
".",
"If",
"the",
"paths",
"provided",
"are",
"not",
"absolute",
"the",
"current",
"working",
"directory",
"is",
"used",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java#L3018-L3023 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java | GlobalUsersInner.getPersonalPreferences | public GetPersonalPreferencesResponseInner getPersonalPreferences(String userName, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload) {
"""
Get personal preferences for a user.
@param userName The name of the user.
@param personalPreferencesOperationsPayload Represents payload for any E... | java | public GetPersonalPreferencesResponseInner getPersonalPreferences(String userName, PersonalPreferencesOperationsPayload personalPreferencesOperationsPayload) {
return getPersonalPreferencesWithServiceResponseAsync(userName, personalPreferencesOperationsPayload).toBlocking().single().body();
} | [
"public",
"GetPersonalPreferencesResponseInner",
"getPersonalPreferences",
"(",
"String",
"userName",
",",
"PersonalPreferencesOperationsPayload",
"personalPreferencesOperationsPayload",
")",
"{",
"return",
"getPersonalPreferencesWithServiceResponseAsync",
"(",
"userName",
",",
"pers... | Get personal preferences for a user.
@param userName The name of the user.
@param personalPreferencesOperationsPayload Represents payload for any Environment operations like get, start, stop, connect
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request ... | [
"Get",
"personal",
"preferences",
"for",
"a",
"user",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L467-L469 |
grpc/grpc-java | core/src/main/java/io/grpc/internal/GrpcUtil.java | GrpcUtil.authorityToUri | public static URI authorityToUri(String authority) {
"""
Parse an authority into a URI for retrieving the host and port.
"""
Preconditions.checkNotNull(authority, "authority");
URI uri;
try {
uri = new URI(null, authority, null, null, null);
} catch (URISyntaxException ex) {
throw n... | java | public static URI authorityToUri(String authority) {
Preconditions.checkNotNull(authority, "authority");
URI uri;
try {
uri = new URI(null, authority, null, null, null);
} catch (URISyntaxException ex) {
throw new IllegalArgumentException("Invalid authority: " + authority, ex);
}
ret... | [
"public",
"static",
"URI",
"authorityToUri",
"(",
"String",
"authority",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"authority",
",",
"\"authority\"",
")",
";",
"URI",
"uri",
";",
"try",
"{",
"uri",
"=",
"new",
"URI",
"(",
"null",
",",
"authority... | Parse an authority into a URI for retrieving the host and port. | [
"Parse",
"an",
"authority",
"into",
"a",
"URI",
"for",
"retrieving",
"the",
"host",
"and",
"port",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/GrpcUtil.java#L472-L481 |
aol/cyclops | cyclops-futurestream/src/main/java/cyclops/stream/StreamSource.java | StreamSource.reactiveSeq | public <T> PushableReactiveSeq<T> reactiveSeq() {
"""
Create a pushable {@link PushableReactiveSeq}
<pre>
{@code
PushableReactiveSeq<Integer> pushable = StreamSource.ofUnbounded()
.reactiveSeq();
pushable.getInput()
.add(10);
on another thread
pushable.getStream()
.collect(CyclopsCollectors.toList()) ... | java | public <T> PushableReactiveSeq<T> reactiveSeq() {
final Queue<T> q = createQueue();
return new PushableReactiveSeq<T>(
q, q.stream());
} | [
"public",
"<",
"T",
">",
"PushableReactiveSeq",
"<",
"T",
">",
"reactiveSeq",
"(",
")",
"{",
"final",
"Queue",
"<",
"T",
">",
"q",
"=",
"createQueue",
"(",
")",
";",
"return",
"new",
"PushableReactiveSeq",
"<",
"T",
">",
"(",
"q",
",",
"q",
".",
"s... | Create a pushable {@link PushableReactiveSeq}
<pre>
{@code
PushableReactiveSeq<Integer> pushable = StreamSource.ofUnbounded()
.reactiveSeq();
pushable.getInput()
.add(10);
on another thread
pushable.getStream()
.collect(CyclopsCollectors.toList()) //[10]
}
</pre>
@return PushableStream that can accept data to pus... | [
"Create",
"a",
"pushable",
"{",
"@link",
"PushableReactiveSeq",
"}"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-futurestream/src/main/java/cyclops/stream/StreamSource.java#L524-L528 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/ri/GetMethodsLookup.java | GetMethodsLookup.collectAll | private void collectAll(MethodProvider methodProvider, Map<String, Invoker> found) {
"""
Collect all public methods from methodProvider and its supertypes into the 'found' hasmap, indexed by
"name+descriptor".
"""
// We do this in inverse order as in 'GetMethodLookup'. This is because GetMethodLookup
// i... | java | private void collectAll(MethodProvider methodProvider, Map<String, Invoker> found) {
// We do this in inverse order as in 'GetMethodLookup'. This is because GetMethodLookup
// is lazy and wants to stop when a method is found, but here we instead collect
// everything bottom up and 'overwrite' earlier results so t... | [
"private",
"void",
"collectAll",
"(",
"MethodProvider",
"methodProvider",
",",
"Map",
"<",
"String",
",",
"Invoker",
">",
"found",
")",
"{",
"// We do this in inverse order as in 'GetMethodLookup'. This is because GetMethodLookup",
"// is lazy and wants to stop when a method is fou... | Collect all public methods from methodProvider and its supertypes into the 'found' hasmap, indexed by
"name+descriptor". | [
"Collect",
"all",
"public",
"methods",
"from",
"methodProvider",
"and",
"its",
"supertypes",
"into",
"the",
"found",
"hasmap",
"indexed",
"by",
"name",
"+",
"descriptor",
"."
] | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/ri/GetMethodsLookup.java#L40-L65 |
konvergeio/cofoja | src/main/java/com/google/java/contract/core/agent/SpecificationMethodAdapter.java | SpecificationMethodAdapter.invokeOldValues | @Requires( {
"""
Injects calls to old value contract methods. old value contract
methods get called with, in this order:
<ul>
<li>the {@code this} pointer, if any;
<li>and the original method's parameters.
</ul>
@param kind either OLD or SIGNAL_OLD
@param list the list that holds the allocated old value... | java | @Requires({
"kind != null",
"kind.isOld()",
"list != null"
})
protected void invokeOldValues(ContractKind kind, List<Integer> list) {
List<MethodContractHandle> olds =
contracts.getMethodHandles(kind, methodName, methodDesc, 0);
if (olds.isEmpty()) {
return;
}
for (MethodC... | [
"@",
"Requires",
"(",
"{",
"\"kind != null\"",
",",
"\"kind.isOld()\"",
",",
"\"list != null\"",
"}",
")",
"protected",
"void",
"invokeOldValues",
"(",
"ContractKind",
"kind",
",",
"List",
"<",
"Integer",
">",
"list",
")",
"{",
"List",
"<",
"MethodContractHandle... | Injects calls to old value contract methods. old value contract
methods get called with, in this order:
<ul>
<li>the {@code this} pointer, if any;
<li>and the original method's parameters.
</ul>
@param kind either OLD or SIGNAL_OLD
@param list the list that holds the allocated old value variable
indexes | [
"Injects",
"calls",
"to",
"old",
"value",
"contract",
"methods",
".",
"old",
"value",
"contract",
"methods",
"get",
"called",
"with",
"in",
"this",
"order",
":"
] | train | https://github.com/konvergeio/cofoja/blob/6ded58fa05eb5bf85f16353c8dd4c70bee59121a/src/main/java/com/google/java/contract/core/agent/SpecificationMethodAdapter.java#L354-L378 |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/nodemodel/util/NodeModelUtils.java | NodeModelUtils.compactDump | public static String compactDump(INode node, boolean showHidden) {
"""
Creates a string representation of the given node. Useful for debugging.
@return a debug string for the given node.
"""
StringBuilder result = new StringBuilder();
try {
compactDump(node, showHidden, "", result);
} catch (IOExce... | java | public static String compactDump(INode node, boolean showHidden) {
StringBuilder result = new StringBuilder();
try {
compactDump(node, showHidden, "", result);
} catch (IOException e) {
return e.getMessage();
}
return result.toString();
} | [
"public",
"static",
"String",
"compactDump",
"(",
"INode",
"node",
",",
"boolean",
"showHidden",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"{",
"compactDump",
"(",
"node",
",",
"showHidden",
",",
"\"\"",
",",
"... | Creates a string representation of the given node. Useful for debugging.
@return a debug string for the given node. | [
"Creates",
"a",
"string",
"representation",
"of",
"the",
"given",
"node",
".",
"Useful",
"for",
"debugging",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/nodemodel/util/NodeModelUtils.java#L341-L349 |
knowm/Yank | src/main/java/org/knowm/yank/Yank.java | Yank.executeBatchSQLKey | public static int[] executeBatchSQLKey(String poolName, String sqlKey, Object[][] params)
throws SQLStatementNotFoundException, YankSQLException {
"""
Batch executes the given INSERT, UPDATE, DELETE, REPLACE or UPSERT SQL statement matching the
sqlKey String in a properties file loaded via Yank.addSQLStatem... | java | public static int[] executeBatchSQLKey(String poolName, String sqlKey, Object[][] params)
throws SQLStatementNotFoundException, YankSQLException {
String sql = YANK_POOL_MANAGER.getMergedSqlProperties().getProperty(sqlKey);
if (sql == null || sql.equalsIgnoreCase("")) {
throw new SQLStatementNotFou... | [
"public",
"static",
"int",
"[",
"]",
"executeBatchSQLKey",
"(",
"String",
"poolName",
",",
"String",
"sqlKey",
",",
"Object",
"[",
"]",
"[",
"]",
"params",
")",
"throws",
"SQLStatementNotFoundException",
",",
"YankSQLException",
"{",
"String",
"sql",
"=",
"YAN... | Batch executes the given INSERT, UPDATE, DELETE, REPLACE or UPSERT SQL statement matching the
sqlKey String in a properties file loaded via Yank.addSQLStatements(...).
@param poolName The name of the connection pool to query against
@param sqlKey The SQL Key found in a properties file corresponding to the desired SQL ... | [
"Batch",
"executes",
"the",
"given",
"INSERT",
"UPDATE",
"DELETE",
"REPLACE",
"or",
"UPSERT",
"SQL",
"statement",
"matching",
"the",
"sqlKey",
"String",
"in",
"a",
"properties",
"file",
"loaded",
"via",
"Yank",
".",
"addSQLStatements",
"(",
"...",
")",
"."
] | train | https://github.com/knowm/Yank/blob/b2071dcd94da99db6904355f9557456b8b292a6b/src/main/java/org/knowm/yank/Yank.java#L733-L742 |
Bernardo-MG/maven-site-fixer | src/main/java/com/bernardomg/velocity/tool/SiteTool.java | SiteTool.fixAnchorLinks | public final void fixAnchorLinks(final Element root) {
"""
Fixes links to anchors in the same page.
<p>
Any link such as {@code <a href=\"#An_Internal.Link\">A link</a>} will be
transformed into {@code <a href=\"#aninternallink\">A link</a>}.
<p>
The href value will receive the following modifications, only i... | java | public final void fixAnchorLinks(final Element root) {
String ref; // Value of the href attribute
checkNotNull(root, "Received a null pointer as root element");
// Anchors
for (final Element anchor : root.getElementsByTag("a")) {
// If the attribute doesn't exist th... | [
"public",
"final",
"void",
"fixAnchorLinks",
"(",
"final",
"Element",
"root",
")",
"{",
"String",
"ref",
";",
"// Value of the href attribute",
"checkNotNull",
"(",
"root",
",",
"\"Received a null pointer as root element\"",
")",
";",
"// Anchors",
"for",
"(",
"final"... | Fixes links to anchors in the same page.
<p>
Any link such as {@code <a href=\"#An_Internal.Link\">A link</a>} will be
transformed into {@code <a href=\"#aninternallink\">A link</a>}.
<p>
The href value will receive the following modifications, only if it is an
internal link:
<ul>
<li>Text will be set to lower case</li... | [
"Fixes",
"links",
"to",
"anchors",
"in",
"the",
"same",
"page",
".",
"<p",
">",
"Any",
"link",
"such",
"as",
"{",
"@code",
"<a",
"href",
"=",
"\\",
"#An_Internal",
".",
"Link",
"\\",
">",
"A",
"link<",
"/",
"a",
">",
"}",
"will",
"be",
"transformed... | train | https://github.com/Bernardo-MG/maven-site-fixer/blob/e064472faa7edb0fca11647a22d90ad72089baa3/src/main/java/com/bernardomg/velocity/tool/SiteTool.java#L92-L108 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpSubsystemChannel.java | SftpSubsystemChannel.sendExtensionMessage | public SftpMessage sendExtensionMessage(String request, byte[] requestData)
throws SshException, SftpStatusException {
"""
Send an extension message and return the response. This is for advanced
use only.
@param request
String
@param requestData
byte[]
@return SftpMessage
@throws SshException
@throws ... | java | public SftpMessage sendExtensionMessage(String request, byte[] requestData)
throws SshException, SftpStatusException {
try {
UnsignedInteger32 id = nextRequestId();
Packet packet = createPacket();
packet.write(SSH_FXP_EXTENDED);
packet.writeUINT32(id);
packet.writeString(request);
sendMessage(p... | [
"public",
"SftpMessage",
"sendExtensionMessage",
"(",
"String",
"request",
",",
"byte",
"[",
"]",
"requestData",
")",
"throws",
"SshException",
",",
"SftpStatusException",
"{",
"try",
"{",
"UnsignedInteger32",
"id",
"=",
"nextRequestId",
"(",
")",
";",
"Packet",
... | Send an extension message and return the response. This is for advanced
use only.
@param request
String
@param requestData
byte[]
@return SftpMessage
@throws SshException
@throws SftpStatusException | [
"Send",
"an",
"extension",
"message",
"and",
"return",
"the",
"response",
".",
"This",
"is",
"for",
"advanced",
"use",
"only",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpSubsystemChannel.java#L380-L396 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java | NeighbourhoodSearch.updateCurrentSolution | @Override
protected void updateCurrentSolution(SolutionType solution, Evaluation evaluation, Validation validation) {
"""
When updating the current solution in a neighbourhood search, the evaluated move cache is
cleared because it is no longer valid for the new current solution.
@param solution new current... | java | @Override
protected void updateCurrentSolution(SolutionType solution, Evaluation evaluation, Validation validation){
// call super
super.updateCurrentSolution(solution, evaluation, validation);
// clear evaluated move cache
if(cache != null){
cache.clear();
}
... | [
"@",
"Override",
"protected",
"void",
"updateCurrentSolution",
"(",
"SolutionType",
"solution",
",",
"Evaluation",
"evaluation",
",",
"Validation",
"validation",
")",
"{",
"// call super",
"super",
".",
"updateCurrentSolution",
"(",
"solution",
",",
"evaluation",
",",... | When updating the current solution in a neighbourhood search, the evaluated move cache is
cleared because it is no longer valid for the new current solution.
@param solution new current solution
@param evaluation evaluation of new current solution
@param validation validation of new current solution | [
"When",
"updating",
"the",
"current",
"solution",
"in",
"a",
"neighbourhood",
"search",
"the",
"evaluated",
"move",
"cache",
"is",
"cleared",
"because",
"it",
"is",
"no",
"longer",
"valid",
"for",
"the",
"new",
"current",
"solution",
"."
] | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/NeighbourhoodSearch.java#L220-L228 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/internal/provisioning/api/UsersApi.java | UsersApi.getUserWithHttpInfo | public ApiResponse<GetUsersSuccessResponse> getUserWithHttpInfo(String dbid) throws ApiException {
"""
Get a user.
Get the specified [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) object.
@param dbid The user's DBID. (required)
@return ApiResponse<GetUsersSuccess... | java | public ApiResponse<GetUsersSuccessResponse> getUserWithHttpInfo(String dbid) throws ApiException {
com.squareup.okhttp.Call call = getUserValidateBeforeCall(dbid, null, null);
Type localVarReturnType = new TypeToken<GetUsersSuccessResponse>(){}.getType();
return apiClient.execute(call, localVarR... | [
"public",
"ApiResponse",
"<",
"GetUsersSuccessResponse",
">",
"getUserWithHttpInfo",
"(",
"String",
"dbid",
")",
"throws",
"ApiException",
"{",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"call",
"=",
"getUserValidateBeforeCall",
"(",
"dbid",
",",
"null",
... | Get a user.
Get the specified [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) object.
@param dbid The user's DBID. (required)
@return ApiResponse<GetUsersSuccessResponse>
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response... | [
"Get",
"a",
"user",
".",
"Get",
"the",
"specified",
"[",
"CfgPerson",
"]",
"(",
"https",
":",
"//",
"docs",
".",
"genesys",
".",
"com",
"/",
"Documentation",
"/",
"PSDK",
"/",
"latest",
"/",
"ConfigLayerRef",
"/",
"CfgPerson",
")",
"object",
"."
] | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/UsersApi.java#L509-L513 |
thelinmichael/spotify-web-api-java | src/main/java/com/wrapper/spotify/SpotifyApi.java | SpotifyApi.addTracksToPlaylist | @Deprecated
public AddTracksToPlaylistRequest.Builder addTracksToPlaylist(String user_id, String playlist_id, String[] uris) {
"""
Add tracks to a playlist.
@deprecated Playlist IDs are unique for themselves. This parameter is thus no longer used.
(https://developer.spotify.com/community/news/2018/06/12/chan... | java | @Deprecated
public AddTracksToPlaylistRequest.Builder addTracksToPlaylist(String user_id, String playlist_id, String[] uris) {
return new AddTracksToPlaylistRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.user_id(user_id)
.playlist_id(playlist_id)
... | [
"@",
"Deprecated",
"public",
"AddTracksToPlaylistRequest",
".",
"Builder",
"addTracksToPlaylist",
"(",
"String",
"user_id",
",",
"String",
"playlist_id",
",",
"String",
"[",
"]",
"uris",
")",
"{",
"return",
"new",
"AddTracksToPlaylistRequest",
".",
"Builder",
"(",
... | Add tracks to a playlist.
@deprecated Playlist IDs are unique for themselves. This parameter is thus no longer used.
(https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)
@param user_id The owners username.
@param playlist_id The playlists ID.
@param uris URIs of the tracks to ... | [
"Add",
"tracks",
"to",
"a",
"playlist",
"."
] | train | https://github.com/thelinmichael/spotify-web-api-java/blob/c06b8512344c0310d0c1df362fa267879021da2e/src/main/java/com/wrapper/spotify/SpotifyApi.java#L1060-L1067 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/MaterialAPI.java | MaterialAPI.add_material | public static Media add_material(String access_token,MediaType mediaType,File media,Description description) {
"""
新增其他类型永久素材
@param access_token access_token
@param mediaType mediaType
@param media 多媒体文件有格式和大小限制,如下:
图片(image): 2M,支持bmp/png/jpeg/jpg/gif格式
语音(voice):5M,播放长度不超过60s,支持AMR\MP3格式
视频(video):10MB,... | java | public static Media add_material(String access_token,MediaType mediaType,File media,Description description){
HttpPost httpPost = new HttpPost(BASE_URI+"/cgi-bin/material/add_material");
FileBody bin = new FileBody(media);
MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create()
... | [
"public",
"static",
"Media",
"add_material",
"(",
"String",
"access_token",
",",
"MediaType",
"mediaType",
",",
"File",
"media",
",",
"Description",
"description",
")",
"{",
"HttpPost",
"httpPost",
"=",
"new",
"HttpPost",
"(",
"BASE_URI",
"+",
"\"/cgi-bin/material... | 新增其他类型永久素材
@param access_token access_token
@param mediaType mediaType
@param media 多媒体文件有格式和大小限制,如下:
图片(image): 2M,支持bmp/png/jpeg/jpg/gif格式
语音(voice):5M,播放长度不超过60s,支持AMR\MP3格式
视频(video):10MB,支持MP4格式
缩略图(thumb):64KB,支持JPG格式
@param description 视频文件类型额外字段,其它类型不用添加
@return Media | [
"新增其他类型永久素材"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MaterialAPI.java#L80-L93 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/cdn/CdnClient.java | CdnClient.setDomainLimitRate | public void setDomainLimitRate(String domain, int limitRate) {
"""
Set the rate limit of specified domain acceleration.
@param domain Name of the domain.
@param limitRate The limit of downloading rate, in Bytes/s.
"""
SetDomainLimitRateRequest request = new SetDomainLimitRateRequest()
... | java | public void setDomainLimitRate(String domain, int limitRate) {
SetDomainLimitRateRequest request = new SetDomainLimitRateRequest()
.withDomain(domain)
.withLimitRate(limitRate);
setDomainLimitRate(request);
} | [
"public",
"void",
"setDomainLimitRate",
"(",
"String",
"domain",
",",
"int",
"limitRate",
")",
"{",
"SetDomainLimitRateRequest",
"request",
"=",
"new",
"SetDomainLimitRateRequest",
"(",
")",
".",
"withDomain",
"(",
"domain",
")",
".",
"withLimitRate",
"(",
"limitR... | Set the rate limit of specified domain acceleration.
@param domain Name of the domain.
@param limitRate The limit of downloading rate, in Bytes/s. | [
"Set",
"the",
"rate",
"limit",
"of",
"specified",
"domain",
"acceleration",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/cdn/CdnClient.java#L426-L431 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/tx/concurrency/LockTable.java | LockTable.isLock | void isLock(Object obj, long txNum) {
"""
Grants an islock on the specified item. If any conflict lock exists when
the method is called, then the calling thread will be placed on a wait
list until the lock is released. If the thread remains on the wait list
for a certain amount of time, then an exception is thr... | java | void isLock(Object obj, long txNum) {
Object anchor = getAnchor(obj);
txWaitMap.put(txNum, anchor);
synchronized (anchor) {
Lockers lks = prepareLockers(obj);
if (hasIsLock(lks, txNum))
return;
try {
long timestamp = System.currentTimeMillis();
while (!isLockable(lks, txNum) && !wait... | [
"void",
"isLock",
"(",
"Object",
"obj",
",",
"long",
"txNum",
")",
"{",
"Object",
"anchor",
"=",
"getAnchor",
"(",
"obj",
")",
";",
"txWaitMap",
".",
"put",
"(",
"txNum",
",",
"anchor",
")",
";",
"synchronized",
"(",
"anchor",
")",
"{",
"Lockers",
"l... | Grants an islock on the specified item. If any conflict lock exists when
the method is called, then the calling thread will be placed on a wait
list until the lock is released. If the thread remains on the wait list
for a certain amount of time, then an exception is thrown.
@param obj
a lockable item
@param txNum
a tr... | [
"Grants",
"an",
"islock",
"on",
"the",
"specified",
"item",
".",
"If",
"any",
"conflict",
"lock",
"exists",
"when",
"the",
"method",
"is",
"called",
"then",
"the",
"calling",
"thread",
"will",
"be",
"placed",
"on",
"a",
"wait",
"list",
"until",
"the",
"l... | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/tx/concurrency/LockTable.java#L308-L333 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/randomprojection/RPUtils.java | RPUtils.queryAll | public static INDArray queryAll(INDArray toQuery,INDArray X,List<RPTree> trees,int n,String similarityFunction) {
"""
Query all trees using the given input and data
@param toQuery the query vector
@param X the input data to query
@param trees the trees to query
@param n the number of results to search for
@pa... | java | public static INDArray queryAll(INDArray toQuery,INDArray X,List<RPTree> trees,int n,String similarityFunction) {
if(trees.isEmpty()) {
throw new ND4JIllegalArgumentException("Trees is empty!");
}
List<Integer> candidates = getCandidates(toQuery, trees,similarityFunction);
v... | [
"public",
"static",
"INDArray",
"queryAll",
"(",
"INDArray",
"toQuery",
",",
"INDArray",
"X",
",",
"List",
"<",
"RPTree",
">",
"trees",
",",
"int",
"n",
",",
"String",
"similarityFunction",
")",
"{",
"if",
"(",
"trees",
".",
"isEmpty",
"(",
")",
")",
"... | Query all trees using the given input and data
@param toQuery the query vector
@param X the input data to query
@param trees the trees to query
@param n the number of results to search for
@param similarityFunction the similarity function to use
@return the indices (in order) in the ndarray | [
"Query",
"all",
"trees",
"using",
"the",
"given",
"input",
"and",
"data"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/randomprojection/RPUtils.java#L170-L186 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java | FileUtils.siblingDirectory | public static File siblingDirectory(final File f, final String siblingDirName) {
"""
Given a file, returns a File representing a sibling directory with the specified name.
@param f If f is the filesystem root, a runtime exeption will be thrown.
@param siblingDirName The non-empty name of the sibli... | java | public static File siblingDirectory(final File f, final String siblingDirName) {
checkNotNull(f);
checkNotNull(siblingDirName);
checkArgument(!siblingDirName.isEmpty());
final File parent = f.getParentFile();
if (parent != null) {
return new File(parent, siblingDirName);
} else {
th... | [
"public",
"static",
"File",
"siblingDirectory",
"(",
"final",
"File",
"f",
",",
"final",
"String",
"siblingDirName",
")",
"{",
"checkNotNull",
"(",
"f",
")",
";",
"checkNotNull",
"(",
"siblingDirName",
")",
";",
"checkArgument",
"(",
"!",
"siblingDirName",
"."... | Given a file, returns a File representing a sibling directory with the specified name.
@param f If f is the filesystem root, a runtime exeption will be thrown.
@param siblingDirName The non-empty name of the sibling directory. | [
"Given",
"a",
"file",
"returns",
"a",
"File",
"representing",
"a",
"sibling",
"directory",
"with",
"the",
"specified",
"name",
"."
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java#L530-L543 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.doLikePattern | private ZealotKhala doLikePattern(String prefix, String field, String pattern, boolean match, boolean positive) {
"""
执行根据传入模式来生成like匹配SQL片段的方法.
@param prefix 前缀
@param field 数据库字段
@param pattern 值
@param match 是否匹配
@param positive true则表示是like,否则是not like
@return ZealotKhala实例的当前实例
"""
if (match... | java | private ZealotKhala doLikePattern(String prefix, String field, String pattern, boolean match, boolean positive) {
if (match) {
String suffix = positive ? ZealotConst.LIKE_KEY : ZealotConst.NOT_LIKE_KEY;
SqlInfoBuilder.newInstace(this.source.setPrefix(prefix).setSuffix(suffix))
... | [
"private",
"ZealotKhala",
"doLikePattern",
"(",
"String",
"prefix",
",",
"String",
"field",
",",
"String",
"pattern",
",",
"boolean",
"match",
",",
"boolean",
"positive",
")",
"{",
"if",
"(",
"match",
")",
"{",
"String",
"suffix",
"=",
"positive",
"?",
"Ze... | 执行根据传入模式来生成like匹配SQL片段的方法.
@param prefix 前缀
@param field 数据库字段
@param pattern 值
@param match 是否匹配
@param positive true则表示是like,否则是not like
@return ZealotKhala实例的当前实例 | [
"执行根据传入模式来生成like匹配SQL片段的方法",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L410-L418 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/MultiPolygon.java | MultiPolygon.fromPolygon | public static MultiPolygon fromPolygon(@NonNull Polygon polygon) {
"""
Create a new instance of this class by defining a single {@link Polygon} objects and passing
it in as a parameter in this method. The Polygon should comply with the GeoJson
specifications described in the documentation.
@param polygon a si... | java | public static MultiPolygon fromPolygon(@NonNull Polygon polygon) {
List<List<List<Point>>> coordinates = Arrays.asList(polygon.coordinates());
return new MultiPolygon(TYPE, null, coordinates);
} | [
"public",
"static",
"MultiPolygon",
"fromPolygon",
"(",
"@",
"NonNull",
"Polygon",
"polygon",
")",
"{",
"List",
"<",
"List",
"<",
"List",
"<",
"Point",
">>>",
"coordinates",
"=",
"Arrays",
".",
"asList",
"(",
"polygon",
".",
"coordinates",
"(",
")",
")",
... | Create a new instance of this class by defining a single {@link Polygon} objects and passing
it in as a parameter in this method. The Polygon should comply with the GeoJson
specifications described in the documentation.
@param polygon a single Polygon which make up this MultiPolygon
@return a new instance of this clas... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"defining",
"a",
"single",
"{",
"@link",
"Polygon",
"}",
"objects",
"and",
"passing",
"it",
"in",
"as",
"a",
"parameter",
"in",
"this",
"method",
".",
"The",
"Polygon",
"should",
"comply",
"w... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/MultiPolygon.java#L148-L151 |
seedstack/business | core/src/main/java/org/seedstack/business/spi/BaseDtoInfoResolver.java | BaseDtoInfoResolver.createIdentifier | @SuppressWarnings("unchecked")
protected <I> I createIdentifier(Class<I> aggregateIdClass, I id, Object... parameters) {
"""
Implements the logic to create an aggregate identifier, using a factory if the identifier class
implements {@link Producible}.
@param aggregateIdClass the identifier class.
@param i... | java | @SuppressWarnings("unchecked")
protected <I> I createIdentifier(Class<I> aggregateIdClass, I id, Object... parameters) {
if (id != null) {
if (aggregateIdClass.isAssignableFrom(id.getClass())) {
return id;
} else {
throw BusinessException.createNew(Bus... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"<",
"I",
">",
"I",
"createIdentifier",
"(",
"Class",
"<",
"I",
">",
"aggregateIdClass",
",",
"I",
"id",
",",
"Object",
"...",
"parameters",
")",
"{",
"if",
"(",
"id",
"!=",
"null",
")",
... | Implements the logic to create an aggregate identifier, using a factory if the identifier class
implements {@link Producible}.
@param aggregateIdClass the identifier class.
@param id the existing identifier if any.
@param parameters the parameters to pass to the factory if any.
@param <I> ... | [
"Implements",
"the",
"logic",
"to",
"create",
"an",
"aggregate",
"identifier",
"using",
"a",
"factory",
"if",
"the",
"identifier",
"class",
"implements",
"{",
"@link",
"Producible",
"}",
"."
] | train | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/spi/BaseDtoInfoResolver.java#L45-L65 |
lightblue-platform/lightblue-client | core/src/main/java/com/redhat/lightblue/client/Query.java | Query.withStrings | public static Query withStrings(String field, String[] values, boolean caseInsensitive) {
"""
<pre>
{ "$or": [{ field: <field>, regex: <^string$>, caseInsensitive: <caseInsensitive>, ... }, ... ]}
</pre>
"""
if (caseInsensitive) {
List<Query> regexList = new ArrayList<Query>();
... | java | public static Query withStrings(String field, String[] values, boolean caseInsensitive) {
if (caseInsensitive) {
List<Query> regexList = new ArrayList<Query>();
for (String value : values) {
regexList.add(withString(field, value, true));
}
return Q... | [
"public",
"static",
"Query",
"withStrings",
"(",
"String",
"field",
",",
"String",
"[",
"]",
"values",
",",
"boolean",
"caseInsensitive",
")",
"{",
"if",
"(",
"caseInsensitive",
")",
"{",
"List",
"<",
"Query",
">",
"regexList",
"=",
"new",
"ArrayList",
"<"... | <pre>
{ "$or": [{ field: <field>, regex: <^string$>, caseInsensitive: <caseInsensitive>, ... }, ... ]}
</pre> | [
"<pre",
">",
"{",
"$or",
":",
"[",
"{",
"field",
":",
"<field",
">",
"regex",
":",
"<^string$",
">",
"caseInsensitive",
":",
"<caseInsensitive",
">",
"...",
"}",
"...",
"]",
"}",
"<",
"/",
"pre",
">"
] | train | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/core/src/main/java/com/redhat/lightblue/client/Query.java#L220-L230 |
apache/incubator-druid | server/src/main/java/org/apache/druid/server/coordination/ChangeRequestHistory.java | ChangeRequestHistory.getRequestsSince | public synchronized ListenableFuture<ChangeRequestsSnapshot<T>> getRequestsSince(final Counter counter) {
"""
Returns a Future that, on completion, returns list of segment updates and associated counter.
If there are no update since given counter then Future completion waits till an updates is provided.
If cou... | java | public synchronized ListenableFuture<ChangeRequestsSnapshot<T>> getRequestsSince(final Counter counter)
{
final CustomSettableFuture<T> future = new CustomSettableFuture<>(waitingFutures);
if (counter.counter < 0) {
future.setException(new IAE("counter[%s] must be >= 0", counter));
return future;... | [
"public",
"synchronized",
"ListenableFuture",
"<",
"ChangeRequestsSnapshot",
"<",
"T",
">",
">",
"getRequestsSince",
"(",
"final",
"Counter",
"counter",
")",
"{",
"final",
"CustomSettableFuture",
"<",
"T",
">",
"future",
"=",
"new",
"CustomSettableFuture",
"<>",
"... | Returns a Future that, on completion, returns list of segment updates and associated counter.
If there are no update since given counter then Future completion waits till an updates is provided.
If counter is older than max number of changes maintained then {@link ChangeRequestsSnapshot} is returned
with {@link Change... | [
"Returns",
"a",
"Future",
"that",
"on",
"completion",
"returns",
"list",
"of",
"segment",
"updates",
"and",
"associated",
"counter",
".",
"If",
"there",
"are",
"no",
"update",
"since",
"given",
"counter",
"then",
"Future",
"completion",
"waits",
"till",
"an",
... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/server/coordination/ChangeRequestHistory.java#L108-L140 |
apache/reef | lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/util/walk/graphviz/GraphvizConfigVisitor.java | GraphvizConfigVisitor.visit | @Override
public boolean visit(final Node nodeFrom, final Node nodeTo) {
"""
Process current edge of the configuration graph.
@param nodeFrom Current configuration node.
@param nodeTo Destination configuration node.
@return true to proceed with the next node, false to cancel.
"""
if (!nodeFrom.get... | java | @Override
public boolean visit(final Node nodeFrom, final Node nodeTo) {
if (!nodeFrom.getName().isEmpty()) {
this.graphStr
.append(" ")
.append(nodeFrom.getName())
.append(" -> ")
.append(nodeTo.getName())
.append(" [style=solid, dir=back, arrowtail=diamon... | [
"@",
"Override",
"public",
"boolean",
"visit",
"(",
"final",
"Node",
"nodeFrom",
",",
"final",
"Node",
"nodeTo",
")",
"{",
"if",
"(",
"!",
"nodeFrom",
".",
"getName",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"this",
".",
"graphStr",
".",
"append... | Process current edge of the configuration graph.
@param nodeFrom Current configuration node.
@param nodeTo Destination configuration node.
@return true to proceed with the next node, false to cancel. | [
"Process",
"current",
"edge",
"of",
"the",
"configuration",
"graph",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/util/walk/graphviz/GraphvizConfigVisitor.java#L232-L243 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/property/A_CmsPropertyEditor.java | A_CmsPropertyEditor.getTitle | protected String getTitle(Map<String, String> fieldValues) {
"""
Gets the title from a map of field values.<p>
@param fieldValues the map of field values
@return the title
"""
for (Map.Entry<String, String> entry : fieldValues.entrySet()) {
if (entry.getKey().contains("/NavText/")) {
... | java | protected String getTitle(Map<String, String> fieldValues) {
for (Map.Entry<String, String> entry : fieldValues.entrySet()) {
if (entry.getKey().contains("/NavText/")) {
return entry.getValue();
}
}
return null;
} | [
"protected",
"String",
"getTitle",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"fieldValues",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"fieldValues",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"("... | Gets the title from a map of field values.<p>
@param fieldValues the map of field values
@return the title | [
"Gets",
"the",
"title",
"from",
"a",
"map",
"of",
"field",
"values",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/property/A_CmsPropertyEditor.java#L269-L277 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/utils/PcsUtils.java | PcsUtils.downloadDataToSink | public static void downloadDataToSink( CResponse response, ByteSink byteSink ) {
"""
Server has answered OK with a file to download as stream.
Open byte sink stream, and copy data from server stream to sink stream
@param response server response to read from
@param byteSink destination
"""
Input... | java | public static void downloadDataToSink( CResponse response, ByteSink byteSink )
{
InputStream is = null;
ByteSinkStream bss = null;
boolean success = false;
try {
long contentLength = response.getContentLength();
if ( contentLength >= 0 ) {
// ... | [
"public",
"static",
"void",
"downloadDataToSink",
"(",
"CResponse",
"response",
",",
"ByteSink",
"byteSink",
")",
"{",
"InputStream",
"is",
"=",
"null",
";",
"ByteSinkStream",
"bss",
"=",
"null",
";",
"boolean",
"success",
"=",
"false",
";",
"try",
"{",
"lon... | Server has answered OK with a file to download as stream.
Open byte sink stream, and copy data from server stream to sink stream
@param response server response to read from
@param byteSink destination | [
"Server",
"has",
"answered",
"OK",
"with",
"a",
"file",
"to",
"download",
"as",
"stream",
"."
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/utils/PcsUtils.java#L167-L212 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/InternalJSONUtil.java | InternalJSONUtil.propertyPut | protected static JSONObject propertyPut(JSONObject jsonObject, Object key, Object value) {
"""
将Property的键转化为JSON形式<br>
用于识别类似于:com.luxiaolei.package.hutool这类用点隔开的键
@param jsonObject JSONObject
@param key 键
@param value 值
@return JSONObject
"""
String keyStr = Convert.toStr(key);
String[] path = S... | java | protected static JSONObject propertyPut(JSONObject jsonObject, Object key, Object value) {
String keyStr = Convert.toStr(key);
String[] path = StrUtil.split(keyStr, StrUtil.DOT);
int last = path.length - 1;
JSONObject target = jsonObject;
for (int i = 0; i < last; i += 1) {
String segment = path[i];
... | [
"protected",
"static",
"JSONObject",
"propertyPut",
"(",
"JSONObject",
"jsonObject",
",",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"String",
"keyStr",
"=",
"Convert",
".",
"toStr",
"(",
"key",
")",
";",
"String",
"[",
"]",
"path",
"=",
"StrUtil",... | 将Property的键转化为JSON形式<br>
用于识别类似于:com.luxiaolei.package.hutool这类用点隔开的键
@param jsonObject JSONObject
@param key 键
@param value 值
@return JSONObject | [
"将Property的键转化为JSON形式<br",
">",
"用于识别类似于:com",
".",
"luxiaolei",
".",
"package",
".",
"hutool这类用点隔开的键"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/InternalJSONUtil.java#L191-L207 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/CreateMojo.java | CreateMojo.execute | @Override
public void execute() throws MojoExecutionException {
"""
Generates the project structure.
If a directory with the 'artifactId\ name already exist, nothing is generated as we don't want to overridde
anything.
@throws MojoExecutionException
"""
try {
ensureNotExisting();
... | java | @Override
public void execute() throws MojoExecutionException {
try {
ensureNotExisting();
createDirectories();
if ("blank".equalsIgnoreCase(skel)) {
createApplicationConfiguration();
createBlankPomFile();
createPackageStru... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"try",
"{",
"ensureNotExisting",
"(",
")",
";",
"createDirectories",
"(",
")",
";",
"if",
"(",
"\"blank\"",
".",
"equalsIgnoreCase",
"(",
"skel",
")",
")",
"{",
... | Generates the project structure.
If a directory with the 'artifactId\ name already exist, nothing is generated as we don't want to overridde
anything.
@throws MojoExecutionException | [
"Generates",
"the",
"project",
"structure",
".",
"If",
"a",
"directory",
"with",
"the",
"artifactId",
"\\",
"name",
"already",
"exist",
"nothing",
"is",
"generated",
"as",
"we",
"don",
"t",
"want",
"to",
"overridde",
"anything",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/CreateMojo.java#L89-L115 |
ops4j/org.ops4j.base | ops4j-base-lang/src/main/java/org/ops4j/lang/PreConditionException.java | PreConditionException.validateEqualTo | public static void validateEqualTo( Number value, Number condition, String identifier )
throws PreConditionException {
"""
Validates that the value under test is a particular value.
<p/>
This method ensures that <code>value == condition</code>.
@param identifier The name of the object.
@param conditi... | java | public static void validateEqualTo( Number value, Number condition, String identifier )
throws PreConditionException
{
if( value.doubleValue() == condition.doubleValue() )
{
return;
}
throw new PreConditionException( identifier + " was not equal to " + condition +... | [
"public",
"static",
"void",
"validateEqualTo",
"(",
"Number",
"value",
",",
"Number",
"condition",
",",
"String",
"identifier",
")",
"throws",
"PreConditionException",
"{",
"if",
"(",
"value",
".",
"doubleValue",
"(",
")",
"==",
"condition",
".",
"doubleValue",
... | Validates that the value under test is a particular value.
<p/>
This method ensures that <code>value == condition</code>.
@param identifier The name of the object.
@param condition The condition value.
@param value The value to be tested.
@throws PreConditionException if the condition is not met. | [
"Validates",
"that",
"the",
"value",
"under",
"test",
"is",
"a",
"particular",
"value",
".",
"<p",
"/",
">",
"This",
"method",
"ensures",
"that",
"<code",
">",
"value",
"==",
"condition<",
"/",
"code",
">",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/PreConditionException.java#L253-L261 |
DDTH/ddth-redis | src/main/java/com/github/ddth/redis/RedisClientFactory.java | RedisClientFactory.getRedisClient | public IRedisClient getRedisClient(String host, int port) {
"""
Gets or Creates a {@link IRedisClient} object.
@param host
@param port
@return
"""
return getRedisClient(host, port, null, null);
} | java | public IRedisClient getRedisClient(String host, int port) {
return getRedisClient(host, port, null, null);
} | [
"public",
"IRedisClient",
"getRedisClient",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"return",
"getRedisClient",
"(",
"host",
",",
"port",
",",
"null",
",",
"null",
")",
";",
"}"
] | Gets or Creates a {@link IRedisClient} object.
@param host
@param port
@return | [
"Gets",
"or",
"Creates",
"a",
"{",
"@link",
"IRedisClient",
"}",
"object",
"."
] | train | https://github.com/DDTH/ddth-redis/blob/7e6abc3e43c9efe7e9c293d421c94227253ded87/src/main/java/com/github/ddth/redis/RedisClientFactory.java#L162-L164 |
watson-developer-cloud/java-sdk | discovery/src/main/java/com/ibm/watson/discovery/v1/query/AggregationDeserializer.java | AggregationDeserializer.parseObject | private void parseObject(JsonReader in, HashMap<String, Object> objMap, String name) throws IOException {
"""
Parses a JSON object and adds it to the main object map.
@param in {@link JsonReader} object used for parsing
@param objMap Map used to build the structure for the resulting {@link QueryAggregation} ob... | java | private void parseObject(JsonReader in, HashMap<String, Object> objMap, String name) throws IOException {
HashMap<String, Object> innerObject = new HashMap<>();
in.beginObject();
while (in.peek() != JsonToken.END_OBJECT) {
parseNext(in, innerObject);
}
in.endObject();
objMap.put(name, in... | [
"private",
"void",
"parseObject",
"(",
"JsonReader",
"in",
",",
"HashMap",
"<",
"String",
",",
"Object",
">",
"objMap",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"HashMap",
"<",
"String",
",",
"Object",
">",
"innerObject",
"=",
"new",
"Hash... | Parses a JSON object and adds it to the main object map.
@param in {@link JsonReader} object used for parsing
@param objMap Map used to build the structure for the resulting {@link QueryAggregation} object
@param name key value to go with the resulting value of this method pass
@throws IOException signals that there h... | [
"Parses",
"a",
"JSON",
"object",
"and",
"adds",
"it",
"to",
"the",
"main",
"object",
"map",
"."
] | train | https://github.com/watson-developer-cloud/java-sdk/blob/c926117afd20e2002b69942537720ab733a914f3/discovery/src/main/java/com/ibm/watson/discovery/v1/query/AggregationDeserializer.java#L179-L189 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/StringUtils.java | StringUtils.tokenizeToStringArray | public static String[] tokenizeToStringArray(String str, String delimiters) {
"""
Tokenize the given String into a String array via a StringTokenizer.
Trims tokens and omits empty tokens.
<p>The given delimiters string is supposed to consist of any number of
delimiter characters. Each of those characters can be... | java | public static String[] tokenizeToStringArray(String str, String delimiters) {
return tokenizeToStringArray(str, delimiters, true, true);
} | [
"public",
"static",
"String",
"[",
"]",
"tokenizeToStringArray",
"(",
"String",
"str",
",",
"String",
"delimiters",
")",
"{",
"return",
"tokenizeToStringArray",
"(",
"str",
",",
"delimiters",
",",
"true",
",",
"true",
")",
";",
"}"
] | Tokenize the given String into a String array via a StringTokenizer.
Trims tokens and omits empty tokens.
<p>The given delimiters string is supposed to consist of any number of
delimiter characters. Each of those characters can be used to separate
tokens. A delimiter is always a single character; for multi-character
de... | [
"Tokenize",
"the",
"given",
"String",
"into",
"a",
"String",
"array",
"via",
"a",
"StringTokenizer",
".",
"Trims",
"tokens",
"and",
"omits",
"empty",
"tokens",
".",
"<p",
">",
"The",
"given",
"delimiters",
"string",
"is",
"supposed",
"to",
"consist",
"of",
... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/StringUtils.java#L169-L171 |
jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/util/WordReplacer.java | WordReplacer.replaceWords | public static void replaceWords(StringBuilder input, String[] words, String[] replaces) {
"""
See {@link #replaceWords(String, String[], String[])}
@param input the text where the replacements take place
@param words the words to look for and replace
@param replaces the new words to use
"""
replaceW... | java | public static void replaceWords(StringBuilder input, String[] words, String[] replaces) {
replaceWords(input, words, replaces, false);
} | [
"public",
"static",
"void",
"replaceWords",
"(",
"StringBuilder",
"input",
",",
"String",
"[",
"]",
"words",
",",
"String",
"[",
"]",
"replaces",
")",
"{",
"replaceWords",
"(",
"input",
",",
"words",
",",
"replaces",
",",
"false",
")",
";",
"}"
] | See {@link #replaceWords(String, String[], String[])}
@param input the text where the replacements take place
@param words the words to look for and replace
@param replaces the new words to use | [
"See",
"{"
] | train | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/util/WordReplacer.java#L40-L42 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/spec/DESedeKeySpec.java | DESedeKeySpec.isParityAdjusted | public static boolean isParityAdjusted(byte[] key, int offset)
throws InvalidKeyException {
"""
Checks if the given DES-EDE key, starting at <code>offset</code>
inclusive, is parity-adjusted.
@param key a byte array which holds the key value
@param offset the offset into the byte array
@return tru... | java | public static boolean isParityAdjusted(byte[] key, int offset)
throws InvalidKeyException {
if (key.length - offset < 24) {
throw new InvalidKeyException("Wrong key size");
}
if (DESKeySpec.isParityAdjusted(key, offset) == false
|| DESKeySpec.i... | [
"public",
"static",
"boolean",
"isParityAdjusted",
"(",
"byte",
"[",
"]",
"key",
",",
"int",
"offset",
")",
"throws",
"InvalidKeyException",
"{",
"if",
"(",
"key",
".",
"length",
"-",
"offset",
"<",
"24",
")",
"{",
"throw",
"new",
"InvalidKeyException",
"(... | Checks if the given DES-EDE key, starting at <code>offset</code>
inclusive, is parity-adjusted.
@param key a byte array which holds the key value
@param offset the offset into the byte array
@return true if the given DES-EDE key is parity-adjusted, false
otherwise
@exception NullPointerException if <code>key</code... | [
"Checks",
"if",
"the",
"given",
"DES",
"-",
"EDE",
"key",
"starting",
"at",
"<code",
">",
"offset<",
"/",
"code",
">",
"inclusive",
"is",
"parity",
"-",
"adjusted",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/spec/DESedeKeySpec.java#L114-L125 |
CubeEngine/Dirigent | src/main/java/org/cubeengine/dirigent/formatter/StringFormatter.java | StringFormatter.parseObjectToString | protected String parseObjectToString(Object object, Locale locale, Arguments args) {
"""
Parses the given object to a string depending on the context.
@param object The object to parse.
@param locale The locale to use.
@return The object as a string.
"""
final String string = String.valueOf(obje... | java | protected String parseObjectToString(Object object, Locale locale, Arguments args)
{
final String string = String.valueOf(object);
if (args.has(LOWERCASE_FLAG))
{
return string.toLowerCase(locale);
}
if (args.has(UPPERCASE_FLAG))
{
return strin... | [
"protected",
"String",
"parseObjectToString",
"(",
"Object",
"object",
",",
"Locale",
"locale",
",",
"Arguments",
"args",
")",
"{",
"final",
"String",
"string",
"=",
"String",
".",
"valueOf",
"(",
"object",
")",
";",
"if",
"(",
"args",
".",
"has",
"(",
"... | Parses the given object to a string depending on the context.
@param object The object to parse.
@param locale The locale to use.
@return The object as a string. | [
"Parses",
"the",
"given",
"object",
"to",
"a",
"string",
"depending",
"on",
"the",
"context",
"."
] | train | https://github.com/CubeEngine/Dirigent/blob/68587a8202754a6a6b629cc15e14c516806badaa/src/main/java/org/cubeengine/dirigent/formatter/StringFormatter.java#L80-L92 |
igniterealtime/REST-API-Client | src/main/java/org/igniterealtime/restclient/RestClient.java | RestClient.call | @SuppressWarnings("unchecked")
public <T> T call(String methodName, String restPath, Class<T> expectedResponse, Object payload,
Map<String, String> queryParams) {
"""
Gets the.
@param <T>
the generic type
@param methodName
the method name
@param restPath
the rest path
@param expectedResponse
the claz... | java | @SuppressWarnings("unchecked")
public <T> T call(String methodName, String restPath, Class<T> expectedResponse, Object payload,
Map<String, String> queryParams) {
WebTarget webTarget = createWebTarget(restPath, queryParams);
Response result = webTarget.request().headers(headers).accept(mediaType.getMediaType())... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"call",
"(",
"String",
"methodName",
",",
"String",
"restPath",
",",
"Class",
"<",
"T",
">",
"expectedResponse",
",",
"Object",
"payload",
",",
"Map",
"<",
"String",
",",
"... | Gets the.
@param <T>
the generic type
@param methodName
the method name
@param restPath
the rest path
@param expectedResponse
the clazz
@param payload
the payload
@param queryParams
the query params
@return the t | [
"Gets",
"the",
"."
] | train | https://github.com/igniterealtime/REST-API-Client/blob/fd544dd770ec2ababa47fef51579522ddce09f05/src/main/java/org/igniterealtime/restclient/RestClient.java#L151-L169 |
alkacon/opencms-core | src/org/opencms/cache/CmsVfsMemoryObjectCache.java | CmsVfsMemoryObjectCache.getCacheKey | private String getCacheKey(String systemId, boolean online) {
"""
Returns a cache key for the given system id (filename) based on the status
of the given project flag.<p>
@param systemId the system id (filename) to get the cache key for
@param online indicates if this key is generated for the online project
... | java | private String getCacheKey(String systemId, boolean online) {
if (online) {
return "online_(" + m_id + ")_" + systemId;
}
return "offline_(" + m_id + ")_" + systemId;
} | [
"private",
"String",
"getCacheKey",
"(",
"String",
"systemId",
",",
"boolean",
"online",
")",
"{",
"if",
"(",
"online",
")",
"{",
"return",
"\"online_(\"",
"+",
"m_id",
"+",
"\")_\"",
"+",
"systemId",
";",
"}",
"return",
"\"offline_(\"",
"+",
"m_id",
"+",
... | Returns a cache key for the given system id (filename) based on the status
of the given project flag.<p>
@param systemId the system id (filename) to get the cache key for
@param online indicates if this key is generated for the online project
@return the cache key for the system id | [
"Returns",
"a",
"cache",
"key",
"for",
"the",
"given",
"system",
"id",
"(",
"filename",
")",
"based",
"on",
"the",
"status",
"of",
"the",
"given",
"project",
"flag",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cache/CmsVfsMemoryObjectCache.java#L155-L161 |
thorntail/thorntail | core/bootstrap/src/main/java/org/jboss/modules/Environment.java | Environment.getModuleResourceLoader | public static ResourceLoader getModuleResourceLoader(final String rootPath, final String loaderPath, final String loaderName) {
"""
Creates a new resource loader for the environment.
<p>
In an archive a {@link JarFileResourceLoader} is returned. Otherwise a file system based loader is returned.
</p>
@param... | java | public static ResourceLoader getModuleResourceLoader(final String rootPath, final String loaderPath, final String loaderName) {
if (Holder.JAR_FILE != null) {
return new JarFileResourceLoader(loaderName, Holder.JAR_FILE, Holder.FILE_SYSTEM.getPath(rootPath, loaderPath).toString());
}
... | [
"public",
"static",
"ResourceLoader",
"getModuleResourceLoader",
"(",
"final",
"String",
"rootPath",
",",
"final",
"String",
"loaderPath",
",",
"final",
"String",
"loaderName",
")",
"{",
"if",
"(",
"Holder",
".",
"JAR_FILE",
"!=",
"null",
")",
"{",
"return",
"... | Creates a new resource loader for the environment.
<p>
In an archive a {@link JarFileResourceLoader} is returned. Otherwise a file system based loader is returned.
</p>
@param rootPath the root path to the module
@param loaderPath the path to the module
@param loaderName the module name
@return a resource loader fo... | [
"Creates",
"a",
"new",
"resource",
"loader",
"for",
"the",
"environment",
"."
] | train | https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/bootstrap/src/main/java/org/jboss/modules/Environment.java#L65-L70 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java | StringUtil.isLetter | public static boolean isLetter(String str, int beginIndex, int endIndex) {
"""
check if the specified string is Latin letter
@param str
@param beginIndex
@param endIndex
@return boolean
"""
for ( int i = beginIndex; i < endIndex; i++ ) {
char chr = str.charAt(i);
if... | java | public static boolean isLetter(String str, int beginIndex, int endIndex)
{
for ( int i = beginIndex; i < endIndex; i++ ) {
char chr = str.charAt(i);
if ( ! StringUtil.isEnLetter(chr) ) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"isLetter",
"(",
"String",
"str",
",",
"int",
"beginIndex",
",",
"int",
"endIndex",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"beginIndex",
";",
"i",
"<",
"endIndex",
";",
"i",
"++",
")",
"{",
"char",
"chr",
"=",
"str",
... | check if the specified string is Latin letter
@param str
@param beginIndex
@param endIndex
@return boolean | [
"check",
"if",
"the",
"specified",
"string",
"is",
"Latin",
"letter"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java#L397-L407 |
Harium/keel | src/main/java/com/harium/keel/core/helper/ColorHelper.java | ColorHelper.fromYCbCr | public static int fromYCbCr(int y, int cb, int cr, int alpha) {
"""
YCbCr conversion from: https://en.wikipedia.org/wiki/YUV
@param y - Y channel
@param cb - CB channel
@param cr - CR channel
@return rgb
"""
int cbc = cb - YUV_OFFSET;
int crc = cr - YUV_OFFSET;
int r = y + crc + ... | java | public static int fromYCbCr(int y, int cb, int cr, int alpha) {
int cbc = cb - YUV_OFFSET;
int crc = cr - YUV_OFFSET;
int r = y + crc + (crc >> 2) + (crc >> 3) + (crc >> 5);
int g = y - ((cbc >> 2) + (cbc >> 4) + (cbc >> 5)) - ((crc >> 1) + (crc >> 3) + (crc >> 4) + (crc >> 5));
... | [
"public",
"static",
"int",
"fromYCbCr",
"(",
"int",
"y",
",",
"int",
"cb",
",",
"int",
"cr",
",",
"int",
"alpha",
")",
"{",
"int",
"cbc",
"=",
"cb",
"-",
"YUV_OFFSET",
";",
"int",
"crc",
"=",
"cr",
"-",
"YUV_OFFSET",
";",
"int",
"r",
"=",
"y",
... | YCbCr conversion from: https://en.wikipedia.org/wiki/YUV
@param y - Y channel
@param cb - CB channel
@param cr - CR channel
@return rgb | [
"YCbCr",
"conversion",
"from",
":",
"https",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"YUV"
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/core/helper/ColorHelper.java#L185-L202 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/IOUtils.java | IOUtils.copyStream | public static void copyStream(final File aFile, final OutputStream aOutStream) throws IOException {
"""
Writes a file to an output stream. You're responsible for closing the <code>OutputStream</code>; the input
stream is closed for you since just a <code>File</code> was passed in.
@param aFile A file from whic... | java | public static void copyStream(final File aFile, final OutputStream aOutStream) throws IOException {
final FileInputStream input = new FileInputStream(aFile);
final FileChannel channel = input.getChannel();
final byte[] buffer = new byte[256 * 1024];
final ByteBuffer byteBuffer = ByteBuff... | [
"public",
"static",
"void",
"copyStream",
"(",
"final",
"File",
"aFile",
",",
"final",
"OutputStream",
"aOutStream",
")",
"throws",
"IOException",
"{",
"final",
"FileInputStream",
"input",
"=",
"new",
"FileInputStream",
"(",
"aFile",
")",
";",
"final",
"FileChan... | Writes a file to an output stream. You're responsible for closing the <code>OutputStream</code>; the input
stream is closed for you since just a <code>File</code> was passed in.
@param aFile A file from which to read
@param aOutStream An output stream to which to write
@throws IOException If there is a problem reading... | [
"Writes",
"a",
"file",
"to",
"an",
"output",
"stream",
".",
"You",
"re",
"responsible",
"for",
"closing",
"the",
"<code",
">",
"OutputStream<",
"/",
"code",
">",
";",
"the",
"input",
"stream",
"is",
"closed",
"for",
"you",
"since",
"just",
"a",
"<code",
... | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/IOUtils.java#L176-L190 |
Azure/azure-sdk-for-java | cognitiveservices/resource-manager/v2016_02_01_preview/src/main/java/com/microsoft/azure/management/cognitiveservices/v2016_02_01_preview/implementation/CognitiveServicesAccountsInner.java | CognitiveServicesAccountsInner.regenerateKeyAsync | public Observable<CognitiveServicesAccountKeysInner> regenerateKeyAsync(String resourceGroupName, String accountName) {
"""
Regenerates the specified account key for the specified Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountN... | java | public Observable<CognitiveServicesAccountKeysInner> regenerateKeyAsync(String resourceGroupName, String accountName) {
return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<CognitiveServicesAccountKeysInner>, CognitiveServicesAccountKeysInner>() {
... | [
"public",
"Observable",
"<",
"CognitiveServicesAccountKeysInner",
">",
"regenerateKeyAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
")",
"{",
"return",
"regenerateKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
")",
"."... | Regenerates the specified account key for the specified Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of the cognitive services account within the specified resource group. Cognitive Services account names must be between... | [
"Regenerates",
"the",
"specified",
"account",
"key",
"for",
"the",
"specified",
"Cognitive",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/resource-manager/v2016_02_01_preview/src/main/java/com/microsoft/azure/management/cognitiveservices/v2016_02_01_preview/implementation/CognitiveServicesAccountsInner.java#L850-L857 |
ReactiveX/RxNetty | rxnetty-common/src/main/java/io/reactivex/netty/events/ListenersHolder.java | ListenersHolder.invokeListeners | public void invokeListeners(Action3<T, Long, TimeUnit> invocationAction, long duration, TimeUnit timeUnit) {
"""
Invoke listeners with an action expressed by the passed {@code invocationAction}. This method does the necessary
validations required for invoking a listener and also guards against a listener throwing... | java | public void invokeListeners(Action3<T, Long, TimeUnit> invocationAction, long duration, TimeUnit timeUnit) {
ListenerInvocationException exception = null;
for (ListenerHolder<T> listener : listeners) {
if (!listener.subscription.isUnsubscribed()) {
try {
i... | [
"public",
"void",
"invokeListeners",
"(",
"Action3",
"<",
"T",
",",
"Long",
",",
"TimeUnit",
">",
"invocationAction",
",",
"long",
"duration",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"ListenerInvocationException",
"exception",
"=",
"null",
";",
"for",
"(",
"Lis... | Invoke listeners with an action expressed by the passed {@code invocationAction}. This method does the necessary
validations required for invoking a listener and also guards against a listener throwing exceptions on invocation.
@param invocationAction The action to perform on all listeners.
@param duration Duration.
@... | [
"Invoke",
"listeners",
"with",
"an",
"action",
"expressed",
"by",
"the",
"passed",
"{",
"@code",
"invocationAction",
"}",
".",
"This",
"method",
"does",
"the",
"necessary",
"validations",
"required",
"for",
"invoking",
"a",
"listener",
"and",
"also",
"guards",
... | train | https://github.com/ReactiveX/RxNetty/blob/a7ca9a9c1d544a79c82f7b17036daf6958bf1cd6/rxnetty-common/src/main/java/io/reactivex/netty/events/ListenersHolder.java#L134-L151 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/ParameterValue.java | ParameterValue.toSet | public <T> Set<T> toSet(Class<T> classOfT) {
"""
Converts a string value(s) to a Set of the target type.
@param classOfT
@return a set of the values
"""
return toSet(classOfT, null);
} | java | public <T> Set<T> toSet(Class<T> classOfT) {
return toSet(classOfT, null);
} | [
"public",
"<",
"T",
">",
"Set",
"<",
"T",
">",
"toSet",
"(",
"Class",
"<",
"T",
">",
"classOfT",
")",
"{",
"return",
"toSet",
"(",
"classOfT",
",",
"null",
")",
";",
"}"
] | Converts a string value(s) to a Set of the target type.
@param classOfT
@return a set of the values | [
"Converts",
"a",
"string",
"value",
"(",
"s",
")",
"to",
"a",
"Set",
"of",
"the",
"target",
"type",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/ParameterValue.java#L288-L290 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/sat/CleaneLingSolver.java | CleaneLingSolver.strengthen | private void strengthen(final CLClause c, final int remove) {
"""
Removes a literal in a clause.
@param c the clause
@param remove the literal to remove
"""
if (c.dumped() || satisfied(c)) { return; }
assert this.addedlits.empty();
for (int i = 0; i < c.lits().size(); i++) {
... | java | private void strengthen(final CLClause c, final int remove) {
if (c.dumped() || satisfied(c)) { return; }
assert this.addedlits.empty();
for (int i = 0; i < c.lits().size(); i++) {
final int lit = c.lits().get(i);
if (lit != remove && val(lit) == 0) { this.addedlits.push(... | [
"private",
"void",
"strengthen",
"(",
"final",
"CLClause",
"c",
",",
"final",
"int",
"remove",
")",
"{",
"if",
"(",
"c",
".",
"dumped",
"(",
")",
"||",
"satisfied",
"(",
"c",
")",
")",
"{",
"return",
";",
"}",
"assert",
"this",
".",
"addedlits",
".... | Removes a literal in a clause.
@param c the clause
@param remove the literal to remove | [
"Removes",
"a",
"literal",
"in",
"a",
"clause",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/sat/CleaneLingSolver.java#L768-L778 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesInner.java | BackupShortTermRetentionPoliciesInner.updateAsync | public Observable<BackupShortTermRetentionPolicyInner> updateAsync(String resourceGroupName, String serverName, String databaseName, Integer retentionDays) {
"""
Updates a database's short term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain t... | java | public Observable<BackupShortTermRetentionPolicyInner> updateAsync(String resourceGroupName, String serverName, String databaseName, Integer retentionDays) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, retentionDays).map(new Func1<ServiceResponse<BackupShortTermRetentionPo... | [
"public",
"Observable",
"<",
"BackupShortTermRetentionPolicyInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"Integer",
"retentionDays",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"... | Updates a database's short term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param retentionDays... | [
"Updates",
"a",
"database",
"s",
"short",
"term",
"retention",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/BackupShortTermRetentionPoliciesInner.java#L660-L667 |
primefaces/primefaces | src/main/java/org/primefaces/component/picklist/PickList.java | PickList.checkDisabled | protected void checkDisabled(FacesContext facesContext, String label, List<?> newEntries, List<?> oldEntries) {
"""
Prohibits client-side manipulation of disabled entries, when CSS style-class ui-state-disabled is removed. See
<a href="https://github.com/primefaces/primefaces/issues/2127">https://github.com/prime... | java | protected void checkDisabled(FacesContext facesContext, String label, List<?> newEntries, List<?> oldEntries) {
if (!isValid()) {
return;
}
Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
String varName = getVar();
String clientId ... | [
"protected",
"void",
"checkDisabled",
"(",
"FacesContext",
"facesContext",
",",
"String",
"label",
",",
"List",
"<",
"?",
">",
"newEntries",
",",
"List",
"<",
"?",
">",
"oldEntries",
")",
"{",
"if",
"(",
"!",
"isValid",
"(",
")",
")",
"{",
"return",
";... | Prohibits client-side manipulation of disabled entries, when CSS style-class ui-state-disabled is removed. See
<a href="https://github.com/primefaces/primefaces/issues/2127">https://github.com/primefaces/primefaces/issues/2127</a>
@param newEntries new/set entries of model source/target list
@param oldEntries old/form... | [
"Prohibits",
"client",
"-",
"side",
"manipulation",
"of",
"disabled",
"entries",
"when",
"CSS",
"style",
"-",
"class",
"ui",
"-",
"state",
"-",
"disabled",
"is",
"removed",
".",
"See",
"<a",
"href",
"=",
"https",
":",
"//",
"github",
".",
"com",
"/",
"... | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/component/picklist/PickList.java#L151-L177 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/spout/CheckPointState.java | CheckPointState.nextState | public CheckPointState nextState(boolean recovering) {
"""
Get the next state based on this checkpoint state.
@param recovering if in recovering phase
@return the next checkpoint state based on this state.
"""
CheckPointState nextState;
switch (state) {
case PREPARING:
... | java | public CheckPointState nextState(boolean recovering) {
CheckPointState nextState;
switch (state) {
case PREPARING:
nextState = recovering ? new CheckPointState(txid - 1, State.COMMITTED) : new CheckPointState(txid, State.COMMITTING);
break;
case CO... | [
"public",
"CheckPointState",
"nextState",
"(",
"boolean",
"recovering",
")",
"{",
"CheckPointState",
"nextState",
";",
"switch",
"(",
"state",
")",
"{",
"case",
"PREPARING",
":",
"nextState",
"=",
"recovering",
"?",
"new",
"CheckPointState",
"(",
"txid",
"-",
... | Get the next state based on this checkpoint state.
@param recovering if in recovering phase
@return the next checkpoint state based on this state. | [
"Get",
"the",
"next",
"state",
"based",
"on",
"this",
"checkpoint",
"state",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/spout/CheckPointState.java#L100-L116 |
citrusframework/citrus | modules/citrus-kubernetes/src/main/java/com/consol/citrus/kubernetes/command/AbstractKubernetesCommand.java | AbstractKubernetesCommand.withParam | public T withParam(String name, String value) {
"""
Adds command parameter to current command.
@param name
@param value
@return
"""
parameters.put(name, value);
return self;
} | java | public T withParam(String name, String value) {
parameters.put(name, value);
return self;
} | [
"public",
"T",
"withParam",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"parameters",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"self",
";",
"}"
] | Adds command parameter to current command.
@param name
@param value
@return | [
"Adds",
"command",
"parameter",
"to",
"current",
"command",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-kubernetes/src/main/java/com/consol/citrus/kubernetes/command/AbstractKubernetesCommand.java#L120-L123 |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/ResponseConversionUtil.java | ResponseConversionUtil.aggregateFrom | public static HttpResponseWriter aggregateFrom(Stream<?> stream,
HttpHeaders headers, HttpHeaders trailingHeaders,
Function<Object, HttpData> contentConverter,
Executo... | java | public static HttpResponseWriter aggregateFrom(Stream<?> stream,
HttpHeaders headers, HttpHeaders trailingHeaders,
Function<Object, HttpData> contentConverter,
Executo... | [
"public",
"static",
"HttpResponseWriter",
"aggregateFrom",
"(",
"Stream",
"<",
"?",
">",
"stream",
",",
"HttpHeaders",
"headers",
",",
"HttpHeaders",
"trailingHeaders",
",",
"Function",
"<",
"Object",
",",
"HttpData",
">",
"contentConverter",
",",
"Executor",
"exe... | Returns a new {@link HttpResponseWriter} which has a content converted from the collected objects.
@param stream a sequence of objects
@param headers to be written to the returned {@link HttpResponseWriter}
@param trailingHeaders to be written to the returned {@link HttpResponseWriter}
@param contentConverter converts... | [
"Returns",
"a",
"new",
"{",
"@link",
"HttpResponseWriter",
"}",
"which",
"has",
"a",
"content",
"converted",
"from",
"the",
"collected",
"objects",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/ResponseConversionUtil.java#L52-L64 |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/ObjectWrapper.java | ObjectWrapper.setMappedValue | public void setMappedValue(Property property, Object key, Object value) {
"""
Sets the value of the specified mapped property in the wrapped object.
@param property the mapped property whose value is to be updated, cannot be {@code null}
@param key the mapped key of the property value to be set
@param va... | java | public void setMappedValue(Property property, Object key, Object value) {
setMappedValue(object, property, key, value, this);
} | [
"public",
"void",
"setMappedValue",
"(",
"Property",
"property",
",",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"setMappedValue",
"(",
"object",
",",
"property",
",",
"key",
",",
"value",
",",
"this",
")",
";",
"}"
] | Sets the value of the specified mapped property in the wrapped object.
@param property the mapped property whose value is to be updated, cannot be {@code null}
@param key the mapped key of the property value to be set
@param value the property value to set
@throws ReflectionException if a reflection error... | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"mapped",
"property",
"in",
"the",
"wrapped",
"object",
"."
] | train | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L391-L393 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslRequestWithoutPath.java | PactDslRequestWithoutPath.matchPath | public PactDslRequestWithPath matchPath(String pathRegex, String path) {
"""
The path of the request
@param path string path to use when generating requests
@param pathRegex regular expression to use to match paths
"""
requestMatchers.addCategory("path").addRule(new RegexMatcher(pathRegex));
... | java | public PactDslRequestWithPath matchPath(String pathRegex, String path) {
requestMatchers.addCategory("path").addRule(new RegexMatcher(pathRegex));
return new PactDslRequestWithPath(consumerPactBuilder, consumerName, providerName, pactDslWithState.state,
description, path, requestMethod, reques... | [
"public",
"PactDslRequestWithPath",
"matchPath",
"(",
"String",
"pathRegex",
",",
"String",
"path",
")",
"{",
"requestMatchers",
".",
"addCategory",
"(",
"\"path\"",
")",
".",
"addRule",
"(",
"new",
"RegexMatcher",
"(",
"pathRegex",
")",
")",
";",
"return",
"n... | The path of the request
@param path string path to use when generating requests
@param pathRegex regular expression to use to match paths | [
"The",
"path",
"of",
"the",
"request"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslRequestWithoutPath.java#L270-L275 |
apache/incubator-gobblin | gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/metrics/kafka/PusherUtils.java | PusherUtils.getPusher | public static Pusher getPusher(String pusherClassName, String brokers, String topic, Optional<Config> config) {
"""
Create a {@link Pusher}
@param pusherClassName the {@link Pusher} class to instantiate
@param brokers brokers to connect to
@param topic the topic to write to
@param config additional configurati... | java | public static Pusher getPusher(String pusherClassName, String brokers, String topic, Optional<Config> config) {
try {
Class<?> pusherClass = Class.forName(pusherClassName);
return (Pusher) GobblinConstructorUtils.invokeLongestConstructor(pusherClass,
brokers, topic, config);
} catch (Refle... | [
"public",
"static",
"Pusher",
"getPusher",
"(",
"String",
"pusherClassName",
",",
"String",
"brokers",
",",
"String",
"topic",
",",
"Optional",
"<",
"Config",
">",
"config",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"pusherClass",
"=",
"Class",
".",
... | Create a {@link Pusher}
@param pusherClassName the {@link Pusher} class to instantiate
@param brokers brokers to connect to
@param topic the topic to write to
@param config additional configuration for configuring the {@link Pusher}
@return a {@link Pusher} | [
"Create",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/metrics/kafka/PusherUtils.java#L38-L47 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/MethodUtils.java | MethodUtils.invokeStaticMethod | public static Object invokeStaticMethod(Class<?> objectClass, String methodName, Object arg)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
"""
<p>Invoke a named static method whose parameter type matches the object type.</p>
<p>The behaviour of this method is less... | java | public static Object invokeStaticMethod(Class<?> objectClass, String methodName, Object arg)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Object[] args = { arg };
return invokeStaticMethod(objectClass, methodName, args);
} | [
"public",
"static",
"Object",
"invokeStaticMethod",
"(",
"Class",
"<",
"?",
">",
"objectClass",
",",
"String",
"methodName",
",",
"Object",
"arg",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"Object",
... | <p>Invoke a named static method whose parameter type matches the object type.</p>
<p>The behaviour of this method is less deterministic
than {@link #invokeExactMethod(Object, String, Object[], Class[])}.
It loops through all methods with names that match
and then executes the first it finds with compatible parameters.... | [
"<p",
">",
"Invoke",
"a",
"named",
"static",
"method",
"whose",
"parameter",
"type",
"matches",
"the",
"object",
"type",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/MethodUtils.java#L429-L433 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/ArrayUtil.java | ArrayUtil.startsWith | public static int startsWith(String str, String[] arr) {
"""
check if there is an element that starts with the specified string
@param str
@return int
"""
if ( arr == null ) {
return -1;
}
for ( int i = 0; i < arr.length; i++ ) {
if ( arr[i].start... | java | public static int startsWith(String str, String[] arr)
{
if ( arr == null ) {
return -1;
}
for ( int i = 0; i < arr.length; i++ ) {
if ( arr[i].startsWith(str) ) {
return i;
}
}
return -1;
} | [
"public",
"static",
"int",
"startsWith",
"(",
"String",
"str",
",",
"String",
"[",
"]",
"arr",
")",
"{",
"if",
"(",
"arr",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"arr",
".",
"len... | check if there is an element that starts with the specified string
@param str
@return int | [
"check",
"if",
"there",
"is",
"an",
"element",
"that",
"starts",
"with",
"the",
"specified",
"string"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/ArrayUtil.java#L63-L76 |
datasift/datasift-java | src/main/java/com/datasift/client/accounts/DataSiftAccount.java | DataSiftAccount.getLimit | public FutureData<Limit> getLimit(String identity, String service) {
"""
/*
Fetch a Limit
@param identity the ID of the identity
@param service the name of the service
@return The limit for the service in that identity
"""
FutureData<Limit> future = new FutureData<>();
URI uri = newParams... | java | public FutureData<Limit> getLimit(String identity, String service) {
FutureData<Limit> future = new FutureData<>();
URI uri = newParams().forURL(config.newAPIEndpointURI(IDENTITY + "/" + identity + "/limit/" + service));
Request request = config.http().
GET(uri, new PageReader(ne... | [
"public",
"FutureData",
"<",
"Limit",
">",
"getLimit",
"(",
"String",
"identity",
",",
"String",
"service",
")",
"{",
"FutureData",
"<",
"Limit",
">",
"future",
"=",
"new",
"FutureData",
"<>",
"(",
")",
";",
"URI",
"uri",
"=",
"newParams",
"(",
")",
".... | /*
Fetch a Limit
@param identity the ID of the identity
@param service the name of the service
@return The limit for the service in that identity | [
"/",
"*",
"Fetch",
"a",
"Limit"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/accounts/DataSiftAccount.java#L308-L315 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java | BaseBigtableTableAdminClient.createTable | public final Table createTable(InstanceName parent, String tableId, Table table) {
"""
Creates a new table in the specified instance. The table can be created with a full set of
initial column families, specified in the request.
<p>Sample code:
<pre><code>
try (BaseBigtableTableAdminClient baseBigtableTabl... | java | public final Table createTable(InstanceName parent, String tableId, Table table) {
CreateTableRequest request =
CreateTableRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setTableId(tableId)
.setTable(table)
.build();
return cr... | [
"public",
"final",
"Table",
"createTable",
"(",
"InstanceName",
"parent",
",",
"String",
"tableId",
",",
"Table",
"table",
")",
"{",
"CreateTableRequest",
"request",
"=",
"CreateTableRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
"==",
... | Creates a new table in the specified instance. The table can be created with a full set of
initial column families, specified in the request.
<p>Sample code:
<pre><code>
try (BaseBigtableTableAdminClient baseBigtableTableAdminClient = BaseBigtableTableAdminClient.create()) {
InstanceName parent = InstanceName.of("[PR... | [
"Creates",
"a",
"new",
"table",
"in",
"the",
"specified",
"instance",
".",
"The",
"table",
"can",
"be",
"created",
"with",
"a",
"full",
"set",
"of",
"initial",
"column",
"families",
"specified",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java#L160-L169 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/util/HttpUtil.java | HttpUtil.parseQueryString | public static JSONObject parseQueryString(String queryString, boolean hasPath) {
"""
parse the given http query string
@param queryString the standard http query string
@param hasPath whether the query string contains uri
@return the parsed json object. if the given query string is empty then an empty jso... | java | public static JSONObject parseQueryString(String queryString, boolean hasPath) {
JSONObject uriParameters = new JSONObject();
if (queryString == null) return uriParameters;
QueryStringDecoder queryStringDecoder = new QueryStringDecoder(queryString, hasPath);
Map<String, List<String>> par... | [
"public",
"static",
"JSONObject",
"parseQueryString",
"(",
"String",
"queryString",
",",
"boolean",
"hasPath",
")",
"{",
"JSONObject",
"uriParameters",
"=",
"new",
"JSONObject",
"(",
")",
";",
"if",
"(",
"queryString",
"==",
"null",
")",
"return",
"uriParameters... | parse the given http query string
@param queryString the standard http query string
@param hasPath whether the query string contains uri
@return the parsed json object. if the given query string is empty then an empty json object is returned. | [
"parse",
"the",
"given",
"http",
"query",
"string"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/util/HttpUtil.java#L72-L87 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java | ControlBean.enforceVersionRequired | protected static void enforceVersionRequired(String intfName, Version version, VersionRequired versionRequired) {
"""
Enforces the VersionRequired annotation at runtime (called from each ControlBean).
@param intfName
@param version
@param versionRequired
"""
if ( versionRequired != null )
{
... | java | protected static void enforceVersionRequired(String intfName, Version version, VersionRequired versionRequired)
{
if ( versionRequired != null )
{
int majorRequired = versionRequired.major();
int minorRequired = versionRequired.minor();
if ( majorRequired < 0 ) ... | [
"protected",
"static",
"void",
"enforceVersionRequired",
"(",
"String",
"intfName",
",",
"Version",
"version",
",",
"VersionRequired",
"versionRequired",
")",
"{",
"if",
"(",
"versionRequired",
"!=",
"null",
")",
"{",
"int",
"majorRequired",
"=",
"versionRequired",
... | Enforces the VersionRequired annotation at runtime (called from each ControlBean).
@param intfName
@param version
@param versionRequired | [
"Enforces",
"the",
"VersionRequired",
"annotation",
"at",
"runtime",
"(",
"called",
"from",
"each",
"ControlBean",
")",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L847-L879 |
JodaOrg/joda-time | src/main/java/org/joda/time/field/AbstractReadableInstantFieldProperty.java | AbstractReadableInstantFieldProperty.toInterval | public Interval toInterval() {
"""
Returns the interval that represents the range of the minimum
and maximum values of this field.
<p>
For example, <code>datetime.monthOfYear().toInterval()</code>
will return an interval over the whole month.
@return the interval of this field
@since 1.2
"""
Da... | java | public Interval toInterval() {
DateTimeField field = getField();
long start = field.roundFloor(getMillis());
long end = field.add(start, 1);
Interval interval = new Interval(start, end, getChronology());
return interval;
} | [
"public",
"Interval",
"toInterval",
"(",
")",
"{",
"DateTimeField",
"field",
"=",
"getField",
"(",
")",
";",
"long",
"start",
"=",
"field",
".",
"roundFloor",
"(",
"getMillis",
"(",
")",
")",
";",
"long",
"end",
"=",
"field",
".",
"add",
"(",
"start",
... | Returns the interval that represents the range of the minimum
and maximum values of this field.
<p>
For example, <code>datetime.monthOfYear().toInterval()</code>
will return an interval over the whole month.
@return the interval of this field
@since 1.2 | [
"Returns",
"the",
"interval",
"that",
"represents",
"the",
"range",
"of",
"the",
"minimum",
"and",
"maximum",
"values",
"of",
"this",
"field",
".",
"<p",
">",
"For",
"example",
"<code",
">",
"datetime",
".",
"monthOfYear",
"()",
".",
"toInterval",
"()",
"<... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/AbstractReadableInstantFieldProperty.java#L369-L375 |
Samsung/GearVRf | GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFVec3f.java | MFVec3f.get1Value | public void get1Value(int index, float[] valueDestination) {
"""
Get an individual value from the existing field array.
@param index -
@param valueDestination - where the SFVec3f value is returned
"""
try {
SFVec3f sfVec3f = value.get(index);
valueDestination[0] = sfVec3f.x;
... | java | public void get1Value(int index, float[] valueDestination) {
try {
SFVec3f sfVec3f = value.get(index);
valueDestination[0] = sfVec3f.x;
valueDestination[1] = sfVec3f.y;
valueDestination[2] = sfVec3f.z;
}
catch (IndexOutOfBoundsException e) {
... | [
"public",
"void",
"get1Value",
"(",
"int",
"index",
",",
"float",
"[",
"]",
"valueDestination",
")",
"{",
"try",
"{",
"SFVec3f",
"sfVec3f",
"=",
"value",
".",
"get",
"(",
"index",
")",
";",
"valueDestination",
"[",
"0",
"]",
"=",
"sfVec3f",
".",
"x",
... | Get an individual value from the existing field array.
@param index -
@param valueDestination - where the SFVec3f value is returned | [
"Get",
"an",
"individual",
"value",
"from",
"the",
"existing",
"field",
"array",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFVec3f.java#L85-L98 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.