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 |
|---|---|---|---|---|---|---|---|---|---|---|
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/list/Interval.java | Interval.oneToBy | public static Interval oneToBy(int count, int step) {
"""
Returns an Interval starting from 1 to the specified count value with a step value of step.
"""
if (count < 1)
{
throw new IllegalArgumentException("Only positive ranges allowed using oneToBy");
}
return Inter... | java | public static Interval oneToBy(int count, int step)
{
if (count < 1)
{
throw new IllegalArgumentException("Only positive ranges allowed using oneToBy");
}
return Interval.fromToBy(1, count, step);
} | [
"public",
"static",
"Interval",
"oneToBy",
"(",
"int",
"count",
",",
"int",
"step",
")",
"{",
"if",
"(",
"count",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Only positive ranges allowed using oneToBy\"",
")",
";",
"}",
"return",
"I... | Returns an Interval starting from 1 to the specified count value with a step value of step. | [
"Returns",
"an",
"Interval",
"starting",
"from",
"1",
"to",
"the",
"specified",
"count",
"value",
"with",
"a",
"step",
"value",
"of",
"step",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/list/Interval.java#L148-L155 |
JodaOrg/joda-time | src/main/java/org/joda/time/LocalDate.java | LocalDate.withField | public LocalDate withField(DateTimeFieldType fieldType, int value) {
"""
Returns a copy of this date with the specified field set to a new value.
<p>
For example, if the field type is <code>monthOfYear</code> then the
month of year field will be changed in the returned instance.
If the field type is null, then... | java | public LocalDate withField(DateTimeFieldType fieldType, int value) {
if (fieldType == null) {
throw new IllegalArgumentException("Field must not be null");
}
if (isSupported(fieldType) == false) {
throw new IllegalArgumentException("Field '" + fieldType + "' is not suppor... | [
"public",
"LocalDate",
"withField",
"(",
"DateTimeFieldType",
"fieldType",
",",
"int",
"value",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field must not be null\"",
")",
";",
"}",
"if",
"(",
"... | Returns a copy of this date with the specified field set to a new value.
<p>
For example, if the field type is <code>monthOfYear</code> then the
month of year field will be changed in the returned instance.
If the field type is null, then <code>this</code> is returned.
<p>
These two lines are equivalent:
<pre>
LocalDat... | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"with",
"the",
"specified",
"field",
"set",
"to",
"a",
"new",
"value",
".",
"<p",
">",
"For",
"example",
"if",
"the",
"field",
"type",
"is",
"<code",
">",
"monthOfYear<",
"/",
"code",
">",
"then",
"the",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDate.java#L1097-L1106 |
prestodb/presto | presto-orc/src/main/java/com/facebook/presto/orc/OrcDataSourceUtils.java | OrcDataSourceUtils.mergeAdjacentDiskRanges | public static List<DiskRange> mergeAdjacentDiskRanges(Collection<DiskRange> diskRanges, DataSize maxMergeDistance, DataSize maxReadSize) {
"""
Merge disk ranges that are closer than {@code maxMergeDistance}.
"""
// sort ranges by start offset
List<DiskRange> ranges = new ArrayList<>(diskRanges)... | java | public static List<DiskRange> mergeAdjacentDiskRanges(Collection<DiskRange> diskRanges, DataSize maxMergeDistance, DataSize maxReadSize)
{
// sort ranges by start offset
List<DiskRange> ranges = new ArrayList<>(diskRanges);
Collections.sort(ranges, new Comparator<DiskRange>()
{
... | [
"public",
"static",
"List",
"<",
"DiskRange",
">",
"mergeAdjacentDiskRanges",
"(",
"Collection",
"<",
"DiskRange",
">",
"diskRanges",
",",
"DataSize",
"maxMergeDistance",
",",
"DataSize",
"maxReadSize",
")",
"{",
"// sort ranges by start offset",
"List",
"<",
"DiskRan... | Merge disk ranges that are closer than {@code maxMergeDistance}. | [
"Merge",
"disk",
"ranges",
"that",
"are",
"closer",
"than",
"{"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-orc/src/main/java/com/facebook/presto/orc/OrcDataSourceUtils.java#L40-L72 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseBigDecimal | @Nullable
public static BigDecimal parseBigDecimal (@Nullable final String sStr, @Nullable final BigDecimal aDefault) {
"""
Parse the given {@link String} as {@link BigDecimal}.
@param sStr
The String to parse. May be <code>null</code>.
@param aDefault
The default value to be returned if the passed string ... | java | @Nullable
public static BigDecimal parseBigDecimal (@Nullable final String sStr, @Nullable final BigDecimal aDefault)
{
if (sStr != null && sStr.length () > 0)
try
{
return new BigDecimal (_getUnifiedDecimal (sStr));
}
catch (final NumberFormatException ex)
{
// Fal... | [
"@",
"Nullable",
"public",
"static",
"BigDecimal",
"parseBigDecimal",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nullable",
"final",
"BigDecimal",
"aDefault",
")",
"{",
"if",
"(",
"sStr",
"!=",
"null",
"&&",
"sStr",
".",
"length",
"(",
")"... | Parse the given {@link String} as {@link BigDecimal}.
@param sStr
The String to parse. May be <code>null</code>.
@param aDefault
The default value to be returned if the passed string could not be
converted to a valid value. May be <code>null</code>.
@return <code>aDefault</code> if the string does not represent a vali... | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"{",
"@link",
"BigDecimal",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L1481-L1494 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/ArrayUtils.java | ArrayUtils.indexOf | @NullSafe
public static <T> int indexOf(T[] array, T element) {
"""
Null-safe method to find the index of the given {@code element} in the given {@code array}.
@param <T> {@link Class} type of elements in the array.
@param array array used to search for {@code element}.
@param element {@link Object} element... | java | @NullSafe
public static <T> int indexOf(T[] array, T element) {
for (int index = 0, length = nullSafeLength(array); index < length; index++) {
if (equalsIgnoreNull(array[index], element)) {
return index;
}
}
return -1;
} | [
"@",
"NullSafe",
"public",
"static",
"<",
"T",
">",
"int",
"indexOf",
"(",
"T",
"[",
"]",
"array",
",",
"T",
"element",
")",
"{",
"for",
"(",
"int",
"index",
"=",
"0",
",",
"length",
"=",
"nullSafeLength",
"(",
"array",
")",
";",
"index",
"<",
"l... | Null-safe method to find the index of the given {@code element} in the given {@code array}.
@param <T> {@link Class} type of elements in the array.
@param array array used to search for {@code element}.
@param element {@link Object} element to search for in the given {@code array}.
@return the index of the given {@cod... | [
"Null",
"-",
"safe",
"method",
"to",
"find",
"the",
"index",
"of",
"the",
"given",
"{",
"@code",
"element",
"}",
"in",
"the",
"given",
"{",
"@code",
"array",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/ArrayUtils.java#L510-L520 |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java | DocBookBuilder.addRevisionToRevHistory | private void addRevisionToRevHistory(final Node revHistory, final Node revision) {
"""
Adds a revision element to the list of revisions in a revhistory element. This method ensures that the new revision is at
the top of the revhistory list.
@param revHistory The revhistory element to add the revision to.
@par... | java | private void addRevisionToRevHistory(final Node revHistory, final Node revision) {
if (revHistory.hasChildNodes()) {
revHistory.insertBefore(revision, revHistory.getFirstChild());
} else {
revHistory.appendChild(revision);
}
} | [
"private",
"void",
"addRevisionToRevHistory",
"(",
"final",
"Node",
"revHistory",
",",
"final",
"Node",
"revision",
")",
"{",
"if",
"(",
"revHistory",
".",
"hasChildNodes",
"(",
")",
")",
"{",
"revHistory",
".",
"insertBefore",
"(",
"revision",
",",
"revHistor... | Adds a revision element to the list of revisions in a revhistory element. This method ensures that the new revision is at
the top of the revhistory list.
@param revHistory The revhistory element to add the revision to.
@param revision The revision element to be added into the revisionhistory element. | [
"Adds",
"a",
"revision",
"element",
"to",
"the",
"list",
"of",
"revisions",
"in",
"a",
"revhistory",
"element",
".",
"This",
"method",
"ensures",
"that",
"the",
"new",
"revision",
"is",
"at",
"the",
"top",
"of",
"the",
"revhistory",
"list",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocBookBuilder.java#L3148-L3154 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listFromJobScheduleNext | public PagedList<CloudJob> listFromJobScheduleNext(final String nextPageLink) {
"""
Lists the jobs that have been created under the specified job schedule.
@param nextPageLink The NextLink from the previous successful call to List operation.
@throws IllegalArgumentException thrown if parameters fail the valida... | java | public PagedList<CloudJob> listFromJobScheduleNext(final String nextPageLink) {
ServiceResponseWithHeaders<Page<CloudJob>, JobListFromJobScheduleHeaders> response = listFromJobScheduleNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<CloudJob>(response.body()) {
@... | [
"public",
"PagedList",
"<",
"CloudJob",
">",
"listFromJobScheduleNext",
"(",
"final",
"String",
"nextPageLink",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"CloudJob",
">",
",",
"JobListFromJobScheduleHeaders",
">",
"response",
"=",
"listFromJobScheduleNex... | Lists the jobs that have been created under the specified job schedule.
@param nextPageLink The NextLink from the previous successful call to List operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws BatchErrorException thrown if the request is rejected by server
@throws Runtime... | [
"Lists",
"the",
"jobs",
"that",
"have",
"been",
"created",
"under",
"the",
"specified",
"job",
"schedule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L3559-L3567 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/message/process/MessageProcessRunnerTask.java | MessageProcessRunnerTask.runProcess | public void runProcess(BaseProcess job, Map<String,Object> properties) {
"""
Run this process.
@param job The process to run.
@param properties The properties to pass to this process.
"""
if (properties == null)
properties = new HashMap<String,Object>();
Map<String,Object> propMes... | java | public void runProcess(BaseProcess job, Map<String,Object> properties)
{
if (properties == null)
properties = new HashMap<String,Object>();
Map<String,Object> propMessage = m_message.getMessageHeader().getProperties();
if (propMessage != null)
properties.putAll(propMe... | [
"public",
"void",
"runProcess",
"(",
"BaseProcess",
"job",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
")",
"properties",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
"... | Run this process.
@param job The process to run.
@param properties The properties to pass to this process. | [
"Run",
"this",
"process",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/message/process/MessageProcessRunnerTask.java#L84-L97 |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/GridFTPClient.java | GridFTPClient.mlsr | public void mlsr(String path, MlsxEntryWriter writer)
throws ServerException, ClientException, IOException {
"""
Performs a recursive directory listing starting at the given path
(or, if path is null, at the current directory of the FTP server).
MlsxEntry instances for all of the files in the subtree wil... | java | public void mlsr(String path, MlsxEntryWriter writer)
throws ServerException, ClientException, IOException {
if (gSession.parallel > 1) {
throw new ClientException(
ClientException.BAD_MODE,
"mlsr cannot be called with parallelism");
}
... | [
"public",
"void",
"mlsr",
"(",
"String",
"path",
",",
"MlsxEntryWriter",
"writer",
")",
"throws",
"ServerException",
",",
"ClientException",
",",
"IOException",
"{",
"if",
"(",
"gSession",
".",
"parallel",
">",
"1",
")",
"{",
"throw",
"new",
"ClientException",... | Performs a recursive directory listing starting at the given path
(or, if path is null, at the current directory of the FTP server).
MlsxEntry instances for all of the files in the subtree will be
written through the passed MlsxEntryWriter.
@param path path to begin recursive directory listing
@param writer sink for c... | [
"Performs",
"a",
"recursive",
"directory",
"listing",
"starting",
"at",
"the",
"given",
"path",
"(",
"or",
"if",
"path",
"is",
"null",
"at",
"the",
"current",
"directory",
"of",
"the",
"FTP",
"server",
")",
".",
"MlsxEntry",
"instances",
"for",
"all",
"of"... | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/GridFTPClient.java#L1026-L1040 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/distort/impl/DistortSupport.java | DistortSupport.transformRotate | public static PixelTransformAffine_F32 transformRotate( float x0 , float y0 , float x1 , float y1 , float angle ) {
"""
Creates a {@link boofcv.alg.distort.PixelTransformAffine_F32} from the dst image into the src image.
@param x0 Center of rotation in input image coordinates.
@param y0 Center of rotation in i... | java | public static PixelTransformAffine_F32 transformRotate( float x0 , float y0 , float x1 , float y1 , float angle )
{
// make the coordinate system's origin the image center
Se2_F32 imageToCenter = new Se2_F32(-x0,-y0,0);
Se2_F32 rotate = new Se2_F32(0,0,angle);
Se2_F32 centerToImage = new Se2_F32(x1,y1,0);
I... | [
"public",
"static",
"PixelTransformAffine_F32",
"transformRotate",
"(",
"float",
"x0",
",",
"float",
"y0",
",",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"angle",
")",
"{",
"// make the coordinate system's origin the image center",
"Se2_F32",
"imageToCenter",
"... | Creates a {@link boofcv.alg.distort.PixelTransformAffine_F32} from the dst image into the src image.
@param x0 Center of rotation in input image coordinates.
@param y0 Center of rotation in input image coordinates.
@param x1 Center of rotation in output image coordinates.
@param y1 Center of rotation in output image c... | [
"Creates",
"a",
"{",
"@link",
"boofcv",
".",
"alg",
".",
"distort",
".",
"PixelTransformAffine_F32",
"}",
"from",
"the",
"dst",
"image",
"into",
"the",
"src",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/impl/DistortSupport.java#L71-L92 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/misc/Pattern.java | Pattern.repeat | public static Pattern repeat(Pattern pattern, int min, int max) {
"""
A pattern which matches <code>pattern</code> as many times as possible
but at least <code>min</code> times and at most <code>max</code> times.
@param pattern
@param min
@param max
@return
"""
if (pattern == null)
{
... | java | public static Pattern repeat(Pattern pattern, int min, int max)
{
if (pattern == null)
{
throw new IllegalArgumentException("Pattern can not be null");
}
return new RepeatPattern(pattern, min, max);
} | [
"public",
"static",
"Pattern",
"repeat",
"(",
"Pattern",
"pattern",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Pattern can not be null\"",
")",
";",
"}",
... | A pattern which matches <code>pattern</code> as many times as possible
but at least <code>min</code> times and at most <code>max</code> times.
@param pattern
@param min
@param max
@return | [
"A",
"pattern",
"which",
"matches",
"<code",
">",
"pattern<",
"/",
"code",
">",
"as",
"many",
"times",
"as",
"possible",
"but",
"at",
"least",
"<code",
">",
"min<",
"/",
"code",
">",
"times",
"and",
"at",
"most",
"<code",
">",
"max<",
"/",
"code",
">... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/misc/Pattern.java#L209-L216 |
googlegenomics/gatk-tools-java | src/main/java/com/google/cloud/genomics/gatk/picard/runner/GA4GHPicardRunner.java | GA4GHPicardRunner.processGA4GHInput | private Input processGA4GHInput(String input) throws IOException, GeneralSecurityException, URISyntaxException {
"""
Processes GA4GH based input, creates required API connections and data pump
"""
GA4GHUrl url = new GA4GHUrl(input);
SAMFilePump pump;
if (usingGrpc) {
factoryGrpc.configure(url... | java | private Input processGA4GHInput(String input) throws IOException, GeneralSecurityException, URISyntaxException {
GA4GHUrl url = new GA4GHUrl(input);
SAMFilePump pump;
if (usingGrpc) {
factoryGrpc.configure(url.getRootUrl(),
new Settings(clientSecretsFilename, apiKey, noLocalServer));
pu... | [
"private",
"Input",
"processGA4GHInput",
"(",
"String",
"input",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
",",
"URISyntaxException",
"{",
"GA4GHUrl",
"url",
"=",
"new",
"GA4GHUrl",
"(",
"input",
")",
";",
"SAMFilePump",
"pump",
";",
"if",
"... | Processes GA4GH based input, creates required API connections and data pump | [
"Processes",
"GA4GH",
"based",
"input",
"creates",
"required",
"API",
"connections",
"and",
"data",
"pump"
] | train | https://github.com/googlegenomics/gatk-tools-java/blob/5521664e8d6274b113962659f2737c27cc361065/src/main/java/com/google/cloud/genomics/gatk/picard/runner/GA4GHPicardRunner.java#L212-L237 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/reader/JsonWriter.java | JsonWriter.registerWriterInterfaceLast | public void registerWriterInterfaceLast(Class<?> interFace, JsonWriterI<?> writer) {
"""
associate an Writer to a interface With Low priority
@param interFace interface to map
@param writer writer Object
"""
writerInterfaces.addLast(new WriterByInterface(interFace, writer));
} | java | public void registerWriterInterfaceLast(Class<?> interFace, JsonWriterI<?> writer) {
writerInterfaces.addLast(new WriterByInterface(interFace, writer));
} | [
"public",
"void",
"registerWriterInterfaceLast",
"(",
"Class",
"<",
"?",
">",
"interFace",
",",
"JsonWriterI",
"<",
"?",
">",
"writer",
")",
"{",
"writerInterfaces",
".",
"addLast",
"(",
"new",
"WriterByInterface",
"(",
"interFace",
",",
"writer",
")",
")",
... | associate an Writer to a interface With Low priority
@param interFace interface to map
@param writer writer Object | [
"associate",
"an",
"Writer",
"to",
"a",
"interface",
"With",
"Low",
"priority"
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/reader/JsonWriter.java#L343-L345 |
stagemonitor/stagemonitor | stagemonitor-tracing/src/main/java/org/stagemonitor/tracing/soap/SoapHandlerTransformer.java | SoapHandlerTransformer.addHandlers | @Advice.OnMethodEnter
private static void addHandlers(@Advice.Argument(value = 0, readOnly = false) List<Handler> handlerChain, @Advice.This Binding binding) {
"""
This code might be executed in the context of the bootstrap class loader. That's why we have to make sure we only
call code which is visible. For exa... | java | @Advice.OnMethodEnter
private static void addHandlers(@Advice.Argument(value = 0, readOnly = false) List<Handler> handlerChain, @Advice.This Binding binding) {
final java.util.logging.Logger logger = java.util.logging.Logger.getLogger("org.stagemonitor.tracing.soap.SoapHandlerTransformer");
final List<Handler<?>> ... | [
"@",
"Advice",
".",
"OnMethodEnter",
"private",
"static",
"void",
"addHandlers",
"(",
"@",
"Advice",
".",
"Argument",
"(",
"value",
"=",
"0",
",",
"readOnly",
"=",
"false",
")",
"List",
"<",
"Handler",
">",
"handlerChain",
",",
"@",
"Advice",
".",
"This"... | This code might be executed in the context of the bootstrap class loader. That's why we have to make sure we only
call code which is visible. For example, we can't use slf4j or directly reference stagemonitor classes | [
"This",
"code",
"might",
"be",
"executed",
"in",
"the",
"context",
"of",
"the",
"bootstrap",
"class",
"loader",
".",
"That",
"s",
"why",
"we",
"have",
"to",
"make",
"sure",
"we",
"only",
"call",
"code",
"which",
"is",
"visible",
".",
"For",
"example",
... | train | https://github.com/stagemonitor/stagemonitor/blob/7a1bf6848906f816aa465983f602ea1f1e8f2b7b/stagemonitor-tracing/src/main/java/org/stagemonitor/tracing/soap/SoapHandlerTransformer.java#L85-L108 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/user/UserCoreDao.java | UserCoreDao.buildColumnsAs | public String[] buildColumnsAs(String[] columns, String value) {
"""
Build "columns as" values for the table columns with the specified
columns as the specified value
@param columns
columns to include as value
@param value
"columns as" value for specified columns
@return "columns as" values
@since 2.0.0
... | java | public String[] buildColumnsAs(String[] columns, String value) {
String[] values = new String[columns.length];
for (int i = 0; i < columns.length; i++) {
values[i] = value;
}
return buildColumnsAs(columns, values);
} | [
"public",
"String",
"[",
"]",
"buildColumnsAs",
"(",
"String",
"[",
"]",
"columns",
",",
"String",
"value",
")",
"{",
"String",
"[",
"]",
"values",
"=",
"new",
"String",
"[",
"columns",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Build "columns as" values for the table columns with the specified
columns as the specified value
@param columns
columns to include as value
@param value
"columns as" value for specified columns
@return "columns as" values
@since 2.0.0 | [
"Build",
"columns",
"as",
"values",
"for",
"the",
"table",
"columns",
"with",
"the",
"specified",
"columns",
"as",
"the",
"specified",
"value"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/user/UserCoreDao.java#L1584-L1592 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201902/customfieldservice/CreateCustomFieldsAndOptions.java | CreateCustomFieldsAndOptions.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the CustomFieldService.
CustomFieldServiceInterface customFieldService =
adManagerServices.get(session, CustomFieldServiceInterface.class);
// Create a number custom fi... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the CustomFieldService.",
"CustomFieldServiceInterface",
"customFieldService",
"=",
"adManagerServices",
"... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/customfieldservice/CreateCustomFieldsAndOptions.java#L55-L111 |
knightliao/disconf | disconf-client/src/main/java/com/baidu/disconf/client/support/utils/StringUtil.java | StringUtil.startsWithChar | public static boolean startsWithChar(String str, char ch) {
"""
判断字符串<code>str</code>是否以字符<code>ch</code>开头
@param str 要比较的字符串
@param ch 开头字符
@return 如果字符串<code>str</code>是否以字符<code>ch</code> 开头,则返回<code>true</code>
"""
if (StringUtils.isEmpty(str)) {
return false;
}
... | java | public static boolean startsWithChar(String str, char ch) {
if (StringUtils.isEmpty(str)) {
return false;
}
return str.charAt(0) == ch;
} | [
"public",
"static",
"boolean",
"startsWithChar",
"(",
"String",
"str",
",",
"char",
"ch",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"str",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"str",
".",
"charAt",
"(",
"0",
")",
"==",... | 判断字符串<code>str</code>是否以字符<code>ch</code>开头
@param str 要比较的字符串
@param ch 开头字符
@return 如果字符串<code>str</code>是否以字符<code>ch</code> 开头,则返回<code>true</code> | [
"判断字符串<code",
">",
"str<",
"/",
"code",
">",
"是否以字符<code",
">",
"ch<",
"/",
"code",
">",
"开头"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-client/src/main/java/com/baidu/disconf/client/support/utils/StringUtil.java#L566-L572 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/ConfigUtil.java | ConfigUtil.discoverProxyLocation | public static String discoverProxyLocation() {
"""
Tries to discover user proxy location.
If a UID system property is set, and running on a Unix machine it
returns /tmp/x509up_u${UID}. If any other machine then Unix, it returns
${tempdir}/x509up_u${UID}, where tempdir is a platform-specific
temporary directory... | java | public static String discoverProxyLocation() {
String dir = null;
if (getOS() == UNIX_OS) {
dir = "/tmp/";
} else {
String tmpDir = System.getProperty("java.io.tmpdir");
dir = (tmpDir == null) ? globus_dir : tmpDir;
}
String uid = System.get... | [
"public",
"static",
"String",
"discoverProxyLocation",
"(",
")",
"{",
"String",
"dir",
"=",
"null",
";",
"if",
"(",
"getOS",
"(",
")",
"==",
"UNIX_OS",
")",
"{",
"dir",
"=",
"\"/tmp/\"",
";",
"}",
"else",
"{",
"String",
"tmpDir",
"=",
"System",
".",
... | Tries to discover user proxy location.
If a UID system property is set, and running on a Unix machine it
returns /tmp/x509up_u${UID}. If any other machine then Unix, it returns
${tempdir}/x509up_u${UID}, where tempdir is a platform-specific
temporary directory as indicated by the java.io.tmpdir system property.
If a UI... | [
"Tries",
"to",
"discover",
"user",
"proxy",
"location",
".",
"If",
"a",
"UID",
"system",
"property",
"is",
"set",
"and",
"running",
"on",
"a",
"Unix",
"machine",
"it",
"returns",
"/",
"tmp",
"/",
"x509up_u$",
"{",
"UID",
"}",
".",
"If",
"any",
"other",... | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/ConfigUtil.java#L74-L105 |
PawelAdamski/HttpClientMock | src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java | HttpClientResponseBuilder.doReturn | public HttpClientResponseBuilder doReturn(String response, Charset charset) {
"""
Adds action which returns provided response in provided charset and status 200.
@param response response to return
@return response builder
"""
newRule.addAction(new StringResponse(response, charset));
return ... | java | public HttpClientResponseBuilder doReturn(String response, Charset charset) {
newRule.addAction(new StringResponse(response, charset));
return new HttpClientResponseBuilder(newRule);
} | [
"public",
"HttpClientResponseBuilder",
"doReturn",
"(",
"String",
"response",
",",
"Charset",
"charset",
")",
"{",
"newRule",
".",
"addAction",
"(",
"new",
"StringResponse",
"(",
"response",
",",
"charset",
")",
")",
";",
"return",
"new",
"HttpClientResponseBuilde... | Adds action which returns provided response in provided charset and status 200.
@param response response to return
@return response builder | [
"Adds",
"action",
"which",
"returns",
"provided",
"response",
"in",
"provided",
"charset",
"and",
"status",
"200",
"."
] | train | https://github.com/PawelAdamski/HttpClientMock/blob/0205498434bbc0c78c187a51181cac9b266a28fb/src/main/java/com/github/paweladamski/httpclientmock/HttpClientResponseBuilder.java#L99-L102 |
apache/fluo-recipes | modules/spark/src/main/java/org/apache/fluo/recipes/spark/FluoSparkHelper.java | FluoSparkHelper.bulkImportKvToAccumulo | public void bulkImportKvToAccumulo(JavaPairRDD<Key, Value> data, String accumuloTable,
BulkImportOptions opts) {
"""
Bulk import Key/Value data into specified Accumulo table. This method does not repartition
data. One RFile will be created for each partition in the passed in RDD. Ensure the RDD is
reasonab... | java | public void bulkImportKvToAccumulo(JavaPairRDD<Key, Value> data, String accumuloTable,
BulkImportOptions opts) {
Path tempDir = getTempDir(opts);
Connector conn = chooseConnector(opts);
try {
if (hdfs.exists(tempDir)) {
throw new IllegalArgumentException("HDFS temp dir already exists: ... | [
"public",
"void",
"bulkImportKvToAccumulo",
"(",
"JavaPairRDD",
"<",
"Key",
",",
"Value",
">",
"data",
",",
"String",
"accumuloTable",
",",
"BulkImportOptions",
"opts",
")",
"{",
"Path",
"tempDir",
"=",
"getTempDir",
"(",
"opts",
")",
";",
"Connector",
"conn",... | Bulk import Key/Value data into specified Accumulo table. This method does not repartition
data. One RFile will be created for each partition in the passed in RDD. Ensure the RDD is
reasonably partitioned before calling this method.
@param data Key/value data to import
@param accumuloTable Accumulo table used for impo... | [
"Bulk",
"import",
"Key",
"/",
"Value",
"data",
"into",
"specified",
"Accumulo",
"table",
".",
"This",
"method",
"does",
"not",
"repartition",
"data",
".",
"One",
"RFile",
"will",
"be",
"created",
"for",
"each",
"partition",
"in",
"the",
"passed",
"in",
"RD... | train | https://github.com/apache/fluo-recipes/blob/24c11234c9654b16d999437ff49ddc3db86665f8/modules/spark/src/main/java/org/apache/fluo/recipes/spark/FluoSparkHelper.java#L213-L257 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java | DateFunctions.datePartStr | public static Expression datePartStr(String expression, DatePartExt part) {
"""
Returned expression results in Date part as an integer.
The date expression is a string in a supported format, and part is one of the supported date part strings.
"""
return datePartStr(x(expression), part);
} | java | public static Expression datePartStr(String expression, DatePartExt part) {
return datePartStr(x(expression), part);
} | [
"public",
"static",
"Expression",
"datePartStr",
"(",
"String",
"expression",
",",
"DatePartExt",
"part",
")",
"{",
"return",
"datePartStr",
"(",
"x",
"(",
"expression",
")",
",",
"part",
")",
";",
"}"
] | Returned expression results in Date part as an integer.
The date expression is a string in a supported format, and part is one of the supported date part strings. | [
"Returned",
"expression",
"results",
"in",
"Date",
"part",
"as",
"an",
"integer",
".",
"The",
"date",
"expression",
"is",
"a",
"string",
"in",
"a",
"supported",
"format",
"and",
"part",
"is",
"one",
"of",
"the",
"supported",
"date",
"part",
"strings",
"."
... | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java#L164-L166 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java | DeIdentifyUtil.deidentifyEdge | public static String deidentifyEdge(String str, int start, int end) {
"""
Deidentify edge.
@param str the str
@param start the start
@param end the end
@return the string
@since 2.0.0
"""
return deidentifyLeft(deidentifyRight(str, end), start);
} | java | public static String deidentifyEdge(String str, int start, int end) {
return deidentifyLeft(deidentifyRight(str, end), start);
} | [
"public",
"static",
"String",
"deidentifyEdge",
"(",
"String",
"str",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"deidentifyLeft",
"(",
"deidentifyRight",
"(",
"str",
",",
"end",
")",
",",
"start",
")",
";",
"}"
] | Deidentify edge.
@param str the str
@param start the start
@param end the end
@return the string
@since 2.0.0 | [
"Deidentify",
"edge",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java#L150-L152 |
hdecarne/java-default | src/main/java/de/carne/util/SystemProperties.java | SystemProperties.longValue | public static long longValue(String key, long defaultValue) {
"""
Gets a {@code long} system property value.
@param key the property key to retrieve.
@param defaultValue the default value to return in case the property is not defined.
@return the property value or the submitted default value if the property i... | java | public static long longValue(String key, long defaultValue) {
String value = System.getProperty(key);
long longValue = defaultValue;
if (value != null) {
try {
longValue = Long.parseLong(value);
} catch (NumberFormatException e) {
LOG.warning(e, "Ignoring invalid long system propert: ''{0}'' = ''{1... | [
"public",
"static",
"long",
"longValue",
"(",
"String",
"key",
",",
"long",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"System",
".",
"getProperty",
"(",
"key",
")",
";",
"long",
"longValue",
"=",
"defaultValue",
";",
"if",
"(",
"value",
"!=",
"nu... | Gets a {@code long} system property value.
@param key the property key to retrieve.
@param defaultValue the default value to return in case the property is not defined.
@return the property value or the submitted default value if the property is not defined. | [
"Gets",
"a",
"{",
"@code",
"long",
"}",
"system",
"property",
"value",
"."
] | train | https://github.com/hdecarne/java-default/blob/ca16f6fdb0436e90e9e2df3106055e320bb3c9e3/src/main/java/de/carne/util/SystemProperties.java#L189-L201 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.setUser | public void setUser(String user, boolean isSIBServerSubject) {
"""
Sets the user.
@param user The user to set
@param isSIBServerSubject
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setUser", user);
this.user = user;
this.is... | java | public void setUser(String user, boolean isSIBServerSubject)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setUser", user);
this.user = user;
this.isSIBServerSubject = isSIBServerSubject;
if (TraceComponent.isAnyTracingEnabled(... | [
"public",
"void",
"setUser",
"(",
"String",
"user",
",",
"boolean",
"isSIBServerSubject",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
","... | Sets the user.
@param user The user to set
@param isSIBServerSubject | [
"Sets",
"the",
"user",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L427-L436 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/CallbackHandlerInterceptor.java | CallbackHandlerInterceptor.getDownloadedFile | private InputStream getDownloadedFile(String response) throws FMSException {
"""
Method to get the input stream from the download URL returned from service
@param response the download URL string
@return InputStream the downloaded file
@throws FMSException
"""
if (response != null) {
try {
URL ur... | java | private InputStream getDownloadedFile(String response) throws FMSException {
if (response != null) {
try {
URL url = new URL(response);
return url.openStream();
} catch (Exception e) {
throw new FMSException("Exception while downloading the file from URL.", e);
}
}
return null;
} | [
"private",
"InputStream",
"getDownloadedFile",
"(",
"String",
"response",
")",
"throws",
"FMSException",
"{",
"if",
"(",
"response",
"!=",
"null",
")",
"{",
"try",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"response",
")",
";",
"return",
"url",
".",
"op... | Method to get the input stream from the download URL returned from service
@param response the download URL string
@return InputStream the downloaded file
@throws FMSException | [
"Method",
"to",
"get",
"the",
"input",
"stream",
"from",
"the",
"download",
"URL",
"returned",
"from",
"service"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/CallbackHandlerInterceptor.java#L309-L320 |
Azure/azure-sdk-for-java | common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/AzureProxy.java | AzureProxy.createDefaultPipeline | public static HttpPipeline createDefaultPipeline(Class<?> swaggerInterface, HttpPipelinePolicy credentialsPolicy) {
"""
Create the default HttpPipeline.
@param swaggerInterface The interface that the pipeline will use to generate a user-agent
string.
@param credentialsPolicy The credentials policy factory to us... | java | public static HttpPipeline createDefaultPipeline(Class<?> swaggerInterface, HttpPipelinePolicy credentialsPolicy) {
// Order in which policies applied will be the order in which they appear in the array
//
List<HttpPipelinePolicy> policies = new ArrayList<HttpPipelinePolicy>();
policies.... | [
"public",
"static",
"HttpPipeline",
"createDefaultPipeline",
"(",
"Class",
"<",
"?",
">",
"swaggerInterface",
",",
"HttpPipelinePolicy",
"credentialsPolicy",
")",
"{",
"// Order in which policies applied will be the order in which they appear in the array",
"//",
"List",
"<",
"... | Create the default HttpPipeline.
@param swaggerInterface The interface that the pipeline will use to generate a user-agent
string.
@param credentialsPolicy The credentials policy factory to use to apply authentication to the
pipeline.
@return the default HttpPipeline. | [
"Create",
"the",
"default",
"HttpPipeline",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common-mgmt/src/main/java/com/azure/common/mgmt/AzureProxy.java#L192-L203 |
alipay/sofa-rpc | core/common/src/main/java/com/alipay/sofa/rpc/common/utils/BeanUtils.java | BeanUtils.getProperty | public static <T> T getProperty(Object bean, String name, Class<T> clazz) throws Exception {
"""
得到属性的值
@param bean 对象
@param name 属性名
@param clazz 设置值的类
@param <T> 和返回值对应的类型
@return 属性值
@throws Exception 取值异常
"""
Method method = ReflectUtils.getPropertyGetterMethod(bean.getClass(), name);
... | java | public static <T> T getProperty(Object bean, String name, Class<T> clazz) throws Exception {
Method method = ReflectUtils.getPropertyGetterMethod(bean.getClass(), name);
if (method.isAccessible()) {
return (T) method.invoke(bean);
} else {
try {
method.set... | [
"public",
"static",
"<",
"T",
">",
"T",
"getProperty",
"(",
"Object",
"bean",
",",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"Exception",
"{",
"Method",
"method",
"=",
"ReflectUtils",
".",
"getPropertyGetterMethod",
"(",
"bean"... | 得到属性的值
@param bean 对象
@param name 属性名
@param clazz 设置值的类
@param <T> 和返回值对应的类型
@return 属性值
@throws Exception 取值异常 | [
"得到属性的值"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/common/src/main/java/com/alipay/sofa/rpc/common/utils/BeanUtils.java#L71-L83 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableConfig.java | PathfindableConfig.exports | public static Xml exports(Map<String, PathData> pathData) {
"""
Export the pathfindable data to node.
@param pathData The pathfindable data (must not be <code>null</code>).
@return The path data node.
@throws LionEngineException If unable to read node.
"""
Check.notNull(pathData);
fina... | java | public static Xml exports(Map<String, PathData> pathData)
{
Check.notNull(pathData);
final Xml node = new Xml(NODE_PATHFINDABLE);
for (final PathData data : pathData.values())
{
node.add(exportPathData(data));
}
return node;
} | [
"public",
"static",
"Xml",
"exports",
"(",
"Map",
"<",
"String",
",",
"PathData",
">",
"pathData",
")",
"{",
"Check",
".",
"notNull",
"(",
"pathData",
")",
";",
"final",
"Xml",
"node",
"=",
"new",
"Xml",
"(",
"NODE_PATHFINDABLE",
")",
";",
"for",
"(",
... | Export the pathfindable data to node.
@param pathData The pathfindable data (must not be <code>null</code>).
@return The path data node.
@throws LionEngineException If unable to read node. | [
"Export",
"the",
"pathfindable",
"data",
"to",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableConfig.java#L89-L100 |
deephacks/confit | provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanReferences.java | HBeanReferences.getReferenceKeyValue | public static KeyValue getReferenceKeyValue(byte[] rowkey, String propertyName,
String schemaName, List<BeanId> refs, UniqueIds uids) {
"""
Get a particular type of references identified by propertyName into key value
form.
@param schemaName
"""
final byte[] pid = uids.getUsid().getId(pro... | java | public static KeyValue getReferenceKeyValue(byte[] rowkey, String propertyName,
String schemaName, List<BeanId> refs, UniqueIds uids) {
final byte[] pid = uids.getUsid().getId(propertyName);
final byte[] sid = uids.getUsid().getId(schemaName);
final byte[] qual = new byte[] { sid[0],... | [
"public",
"static",
"KeyValue",
"getReferenceKeyValue",
"(",
"byte",
"[",
"]",
"rowkey",
",",
"String",
"propertyName",
",",
"String",
"schemaName",
",",
"List",
"<",
"BeanId",
">",
"refs",
",",
"UniqueIds",
"uids",
")",
"{",
"final",
"byte",
"[",
"]",
"pi... | Get a particular type of references identified by propertyName into key value
form.
@param schemaName | [
"Get",
"a",
"particular",
"type",
"of",
"references",
"identified",
"by",
"propertyName",
"into",
"key",
"value",
"form",
"."
] | train | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-hbase/src/main/java/org/deephacks/confit/internal/hbase/HBeanReferences.java#L82-L89 |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/SkewedInfo.java | SkewedInfo.withSkewedColumnValueLocationMaps | public SkewedInfo withSkewedColumnValueLocationMaps(java.util.Map<String, String> skewedColumnValueLocationMaps) {
"""
<p>
A mapping of skewed values to the columns that contain them.
</p>
@param skewedColumnValueLocationMaps
A mapping of skewed values to the columns that contain them.
@return Returns a ref... | java | public SkewedInfo withSkewedColumnValueLocationMaps(java.util.Map<String, String> skewedColumnValueLocationMaps) {
setSkewedColumnValueLocationMaps(skewedColumnValueLocationMaps);
return this;
} | [
"public",
"SkewedInfo",
"withSkewedColumnValueLocationMaps",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"skewedColumnValueLocationMaps",
")",
"{",
"setSkewedColumnValueLocationMaps",
"(",
"skewedColumnValueLocationMaps",
")",
";",
"return",
... | <p>
A mapping of skewed values to the columns that contain them.
</p>
@param skewedColumnValueLocationMaps
A mapping of skewed values to the columns that contain them.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"mapping",
"of",
"skewed",
"values",
"to",
"the",
"columns",
"that",
"contain",
"them",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/SkewedInfo.java#L225-L228 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java | AbstractMoskitoAspect.createAccumulators | private void createAccumulators(final OnDemandStatsProducer<S> producer, final Class producerClass, AccumulateWithSubClasses... annotations) {
"""
Create class level accumulators from {@link AccumulateWithSubClasses} annotations.
@param producer
{@link OnDemandStatsProducer}
@param producerClass
producer cla... | java | private void createAccumulators(final OnDemandStatsProducer<S> producer, final Class producerClass, AccumulateWithSubClasses... annotations) {
for (final AccumulateWithSubClasses annotation : annotations)
if (annotation != null)
AccumulatorUtil.getInstance(producerClass).createAccumulator(producer, annotation)... | [
"private",
"void",
"createAccumulators",
"(",
"final",
"OnDemandStatsProducer",
"<",
"S",
">",
"producer",
",",
"final",
"Class",
"producerClass",
",",
"AccumulateWithSubClasses",
"...",
"annotations",
")",
"{",
"for",
"(",
"final",
"AccumulateWithSubClasses",
"annota... | Create class level accumulators from {@link AccumulateWithSubClasses} annotations.
@param producer
{@link OnDemandStatsProducer}
@param producerClass
producer class
@param annotations
{@link AccumulateWithSubClasses} annotations to process | [
"Create",
"class",
"level",
"accumulators",
"from",
"{",
"@link",
"AccumulateWithSubClasses",
"}",
"annotations",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java#L281-L285 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PandaApi.java | PandaApi.getPhotos | public Photos getPhotos(String pandaName, EnumSet<JinxConstants.PhotoExtras> extras, int perPage, int page, boolean sign) throws Exception {
"""
Ask the Flickr Pandas for a list of recent public (and "safe") photos.
<br>
More information about the pandas can be found on the
<a href="http://code.flickr.com/blog/... | java | public Photos getPhotos(String pandaName, EnumSet<JinxConstants.PhotoExtras> extras, int perPage, int page, boolean sign) throws Exception {
JinxUtils.validateParams(pandaName);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.panda.getPhotos");
params.put("panda_name", pandaNa... | [
"public",
"Photos",
"getPhotos",
"(",
"String",
"pandaName",
",",
"EnumSet",
"<",
"JinxConstants",
".",
"PhotoExtras",
">",
"extras",
",",
"int",
"perPage",
",",
"int",
"page",
",",
"boolean",
"sign",
")",
"throws",
"Exception",
"{",
"JinxUtils",
".",
"valid... | Ask the Flickr Pandas for a list of recent public (and "safe") photos.
<br>
More information about the pandas can be found on the
<a href="http://code.flickr.com/blog/2009/03/03/panda-tuesday-the-history-of-the-panda-new-apis-explore-and-you/">dev blog</a>. Authentication
<br>
This method does not require authentic... | [
"Ask",
"the",
"Flickr",
"Pandas",
"for",
"a",
"list",
"of",
"recent",
"public",
"(",
"and",
"safe",
")",
"photos",
".",
"<br",
">",
"More",
"information",
"about",
"the",
"pandas",
"can",
"be",
"found",
"on",
"the",
"<a",
"href",
"=",
"http",
":",
"/... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PandaApi.java#L82-L97 |
beihaifeiwu/dolphin | dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/ContentMergePlugin.java | ContentMergePlugin.mergeExistedElement | protected void mergeExistedElement(XmlElement src, XmlElement dest) {
"""
合并已经存在的Xml元素
@param src The source xml element for merging
@param dest The dest xml element for merging
"""
// 合并属性
List<Attribute> srcAttributes = src.getAttributes();
List<Attribute> destAttributes = dest.getAttribute... | java | protected void mergeExistedElement(XmlElement src, XmlElement dest) {
// 合并属性
List<Attribute> srcAttributes = src.getAttributes();
List<Attribute> destAttributes = dest.getAttributes();
for (Attribute srcAttr : srcAttributes) {
Attribute matched = null;
for (Attribute destAttr : destAttribu... | [
"protected",
"void",
"mergeExistedElement",
"(",
"XmlElement",
"src",
",",
"XmlElement",
"dest",
")",
"{",
"// 合并属性",
"List",
"<",
"Attribute",
">",
"srcAttributes",
"=",
"src",
".",
"getAttributes",
"(",
")",
";",
"List",
"<",
"Attribute",
">",
"destAttribute... | 合并已经存在的Xml元素
@param src The source xml element for merging
@param dest The dest xml element for merging | [
"合并已经存在的Xml元素"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/ContentMergePlugin.java#L132-L156 |
wonderpush/wonderpush-android-sdk | sdk/src/main/java/com/wonderpush/sdk/WonderPushJobQueue.java | WonderPushJobQueue.postJobWithDescription | protected Job postJobWithDescription(JSONObject jobDescription, long notBeforeRealtimeElapsed) {
"""
Creates and stores a job in the queue based on the provided description
@return The stored job or null if something went wrong (the queue is full for instance)
"""
String jobId = UUID.randomUUID().to... | java | protected Job postJobWithDescription(JSONObject jobDescription, long notBeforeRealtimeElapsed) {
String jobId = UUID.randomUUID().toString();
InternalJob job = new InternalJob(jobId, jobDescription, notBeforeRealtimeElapsed);
return post(job);
} | [
"protected",
"Job",
"postJobWithDescription",
"(",
"JSONObject",
"jobDescription",
",",
"long",
"notBeforeRealtimeElapsed",
")",
"{",
"String",
"jobId",
"=",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
";",
"InternalJob",
"job",
"=",
"new",
... | Creates and stores a job in the queue based on the provided description
@return The stored job or null if something went wrong (the queue is full for instance) | [
"Creates",
"and",
"stores",
"a",
"job",
"in",
"the",
"queue",
"based",
"on",
"the",
"provided",
"description"
] | train | https://github.com/wonderpush/wonderpush-android-sdk/blob/ba0a1568f705cdd6206639bfab1e5cf529084b59/sdk/src/main/java/com/wonderpush/sdk/WonderPushJobQueue.java#L80-L84 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/spi/LobEngine.java | LobEngine.setClobValue | public void setClobValue(long locator, Clob data) throws PersistException, IOException {
"""
Stores a value into a Clob, replacing anything that was there
before. Passing null deletes the Clob, which is a convenience for
auto-generated code that may call this method.
@param locator lob locator as created by c... | java | public void setClobValue(long locator, Clob data) throws PersistException, IOException {
if (data == null) {
deleteLob(locator);
return;
}
if (locator == 0) {
throw new IllegalArgumentException("Cannot use locator zero");
}
if (data... | [
"public",
"void",
"setClobValue",
"(",
"long",
"locator",
",",
"Clob",
"data",
")",
"throws",
"PersistException",
",",
"IOException",
"{",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"deleteLob",
"(",
"locator",
")",
";",
"return",
";",
"}",
"if",
"(",
... | Stores a value into a Clob, replacing anything that was there
before. Passing null deletes the Clob, which is a convenience for
auto-generated code that may call this method.
@param locator lob locator as created by createNewClob
@param data source of data for Clob, which may be null to delete
@throws IllegalArgumentE... | [
"Stores",
"a",
"value",
"into",
"a",
"Clob",
"replacing",
"anything",
"that",
"was",
"there",
"before",
".",
"Passing",
"null",
"deletes",
"the",
"Clob",
"which",
"is",
"a",
"convenience",
"for",
"auto",
"-",
"generated",
"code",
"that",
"may",
"call",
"th... | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/spi/LobEngine.java#L333-L356 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java | Shape.sub2Ind | public static long sub2Ind(int[] shape, int[] indices) {
"""
Convert the given index (such as 1,1)
to a linear index
@param shape the shape of the indexes to convert
@param indices the index to convert
@return the linear index given the shape
and indices
"""
long index = 0;
int shift = 1;
... | java | public static long sub2Ind(int[] shape, int[] indices) {
long index = 0;
int shift = 1;
for (int i = 0; i < shape.length; i++) {
index += shift * indices[i];
shift *= shape[i];
}
return index;
} | [
"public",
"static",
"long",
"sub2Ind",
"(",
"int",
"[",
"]",
"shape",
",",
"int",
"[",
"]",
"indices",
")",
"{",
"long",
"index",
"=",
"0",
";",
"int",
"shift",
"=",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"shape",
".",
"le... | Convert the given index (such as 1,1)
to a linear index
@param shape the shape of the indexes to convert
@param indices the index to convert
@return the linear index given the shape
and indices | [
"Convert",
"the",
"given",
"index",
"(",
"such",
"as",
"1",
"1",
")",
"to",
"a",
"linear",
"index"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java#L2245-L2253 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/position/PositionAlignmentOptions.java | PositionAlignmentOptions.setHorizontalAlignment | public PositionAlignmentOptions setHorizontalAlignment(PositionRelation horizontalAlignment, int offsetLeft) {
"""
Set the horizontalAlignment property with an offset. One of LEFT, CENTER, RIGHT.
@param horizontalAlignment
@param offsetLeft
@return the instance
"""
switch (horizontalAlignment)
{
ca... | java | public PositionAlignmentOptions setHorizontalAlignment(PositionRelation horizontalAlignment, int offsetLeft)
{
switch (horizontalAlignment)
{
case LEFT:
case CENTER:
case RIGHT:
break;
default:
throw new IllegalArgumentException("Illegal value for the horizontal alignment property");
}
thi... | [
"public",
"PositionAlignmentOptions",
"setHorizontalAlignment",
"(",
"PositionRelation",
"horizontalAlignment",
",",
"int",
"offsetLeft",
")",
"{",
"switch",
"(",
"horizontalAlignment",
")",
"{",
"case",
"LEFT",
":",
"case",
"CENTER",
":",
"case",
"RIGHT",
":",
"bre... | Set the horizontalAlignment property with an offset. One of LEFT, CENTER, RIGHT.
@param horizontalAlignment
@param offsetLeft
@return the instance | [
"Set",
"the",
"horizontalAlignment",
"property",
"with",
"an",
"offset",
".",
"One",
"of",
"LEFT",
"CENTER",
"RIGHT",
"."
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/position/PositionAlignmentOptions.java#L208-L223 |
glyptodon/guacamole-client | extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusConnectionService.java | RadiusConnectionService.createRadiusConnection | private RadiusClient createRadiusConnection() throws GuacamoleException {
"""
Creates a new instance of RadiusClient, configured with parameters
from guacamole.properties.
@return
A RadiusClient instance, configured with server, shared secret,
ports, and timeout, as configured in guacamole.properties.
@th... | java | private RadiusClient createRadiusConnection() throws GuacamoleException {
// Create the RADIUS client with the configuration parameters
try {
return new RadiusClient(InetAddress.getByName(confService.getRadiusServer()),
confService.getRadiusShared... | [
"private",
"RadiusClient",
"createRadiusConnection",
"(",
")",
"throws",
"GuacamoleException",
"{",
"// Create the RADIUS client with the configuration parameters",
"try",
"{",
"return",
"new",
"RadiusClient",
"(",
"InetAddress",
".",
"getByName",
"(",
"confService",
".",
"... | Creates a new instance of RadiusClient, configured with parameters
from guacamole.properties.
@return
A RadiusClient instance, configured with server, shared secret,
ports, and timeout, as configured in guacamole.properties.
@throws GuacamoleException
If an error occurs while parsing guacamole.properties, or if the
c... | [
"Creates",
"a",
"new",
"instance",
"of",
"RadiusClient",
"configured",
"with",
"parameters",
"from",
"guacamole",
".",
"properties",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusConnectionService.java#L79-L98 |
playn/playn | scene/src/playn/scene/Layer.java | Layer.absorbHits | public Layer absorbHits () {
"""
Configures a hit tester for this layer which hits this layer any time a hit does not hit a
child of this layer. This absorbs all hits that would otherwise propagate up to this layer's
parent. Note that this does not do any calculations to determine whether the hit is within the
... | java | public Layer absorbHits () {
return setHitTester(new Layer.HitTester() {
public Layer hitTest (Layer layer, Point p) {
Layer hit = hitTestDefault(p);
return (hit == null) ? Layer.this : hit;
}
@Override public String toString () { return "<all>"; }
});
} | [
"public",
"Layer",
"absorbHits",
"(",
")",
"{",
"return",
"setHitTester",
"(",
"new",
"Layer",
".",
"HitTester",
"(",
")",
"{",
"public",
"Layer",
"hitTest",
"(",
"Layer",
"layer",
",",
"Point",
"p",
")",
"{",
"Layer",
"hit",
"=",
"hitTestDefault",
"(",
... | Configures a hit tester for this layer which hits this layer any time a hit does not hit a
child of this layer. This absorbs all hits that would otherwise propagate up to this layer's
parent. Note that this does not do any calculations to determine whether the hit is within the
bounds of this layer, as those may or may... | [
"Configures",
"a",
"hit",
"tester",
"for",
"this",
"layer",
"which",
"hits",
"this",
"layer",
"any",
"time",
"a",
"hit",
"does",
"not",
"hit",
"a",
"child",
"of",
"this",
"layer",
".",
"This",
"absorbs",
"all",
"hits",
"that",
"would",
"otherwise",
"prop... | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/scene/src/playn/scene/Layer.java#L684-L692 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.removeAll | @SafeVarargs
public static float[] removeAll(final float[] a, final float... elements) {
"""
Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection)
"""
if (N.isNullOrEmpty(a)) {
... | java | @SafeVarargs
public static float[] removeAll(final float[] a, final float... elements) {
if (N.isNullOrEmpty(a)) {
return N.EMPTY_FLOAT_ARRAY;
} else if (N.isNullOrEmpty(elements)) {
return a.clone();
} else if (elements.length == 1) {
return remove... | [
"@",
"SafeVarargs",
"public",
"static",
"float",
"[",
"]",
"removeAll",
"(",
"final",
"float",
"[",
"]",
"a",
",",
"final",
"float",
"...",
"elements",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"a",
")",
")",
"{",
"return",
"N",
".",
"EM... | Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection) | [
"Returns",
"a",
"new",
"array",
"with",
"removes",
"all",
"the",
"occurrences",
"of",
"specified",
"elements",
"from",
"<code",
">",
"a<",
"/",
"code",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L23489-L23502 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.examplesMethodWithServiceResponseAsync | public Observable<ServiceResponse<List<LabelTextObject>>> examplesMethodWithServiceResponseAsync(UUID appId, String versionId, String modelId, ExamplesMethodOptionalParameter examplesMethodOptionalParameter) {
"""
Gets the utterances for the given model in the given app version.
@param appId The application ID.... | java | public Observable<ServiceResponse<List<LabelTextObject>>> examplesMethodWithServiceResponseAsync(UUID appId, String versionId, String modelId, ExamplesMethodOptionalParameter examplesMethodOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.c... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"LabelTextObject",
">",
">",
">",
"examplesMethodWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"String",
"modelId",
",",
"ExamplesMethodOptionalParameter",
"examplesMet... | Gets the utterances for the given model in the given app version.
@param appId The application ID.
@param versionId The version ID.
@param modelId The ID (GUID) of the model.
@param examplesMethodOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgument... | [
"Gets",
"the",
"utterances",
"for",
"the",
"given",
"model",
"in",
"the",
"given",
"app",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L2672-L2689 |
johncarl81/transfuse | transfuse-support/src/main/java/org/androidtransfuse/util/Contract.java | Contract.notZero | public static void notZero(final Integer input, final String inputName) {
"""
Checks that the input value is non-zero
@param input the input to check
@param inputName the name of the input
@throws IllegalArgumentException if input is null or if the input is zero
"""
notNull(input, inputName);
... | java | public static void notZero(final Integer input, final String inputName) {
notNull(input, inputName);
if (input == 0) {
throw new IllegalArgumentException("a zero value for was unexpected for " + maskNullArgument(inputName) + ", it is expected to be non zero");
}
} | [
"public",
"static",
"void",
"notZero",
"(",
"final",
"Integer",
"input",
",",
"final",
"String",
"inputName",
")",
"{",
"notNull",
"(",
"input",
",",
"inputName",
")",
";",
"if",
"(",
"input",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException"... | Checks that the input value is non-zero
@param input the input to check
@param inputName the name of the input
@throws IllegalArgumentException if input is null or if the input is zero | [
"Checks",
"that",
"the",
"input",
"value",
"is",
"non",
"-",
"zero"
] | train | https://github.com/johncarl81/transfuse/blob/a5f837504797a6c4f8628f7e1dde09b8e6368c8b/transfuse-support/src/main/java/org/androidtransfuse/util/Contract.java#L177-L183 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/adaptor/ESAAdaptor.java | ESAAdaptor.isScript | private static boolean isScript(String base, ZipFile zip) {
"""
Look for matching *.bat files in zip file. If there is then assume it is a script
@return true if matching *.bat file is found, false otherwise.
"""
Enumeration<? extends ZipEntry> files = zip.entries();
while (files.hasMoreElem... | java | private static boolean isScript(String base, ZipFile zip) {
Enumeration<? extends ZipEntry> files = zip.entries();
while (files.hasMoreElements()) {
ZipEntry f = files.nextElement();
if ((f.getName()).equals(base + ".bat") || (f.getName()).contains("/" + base + ".bat")) {
... | [
"private",
"static",
"boolean",
"isScript",
"(",
"String",
"base",
",",
"ZipFile",
"zip",
")",
"{",
"Enumeration",
"<",
"?",
"extends",
"ZipEntry",
">",
"files",
"=",
"zip",
".",
"entries",
"(",
")",
";",
"while",
"(",
"files",
".",
"hasMoreElements",
"(... | Look for matching *.bat files in zip file. If there is then assume it is a script
@return true if matching *.bat file is found, false otherwise. | [
"Look",
"for",
"matching",
"*",
".",
"bat",
"files",
"in",
"zip",
"file",
".",
"If",
"there",
"is",
"then",
"assume",
"it",
"is",
"a",
"script"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/adaptor/ESAAdaptor.java#L682-L691 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/text/inflector/RuleBasedPluralizer.java | RuleBasedPluralizer.pluralize | public String pluralize(String word, int number) {
"""
{@inheritDoc}
<p>
Converts a noun or pronoun to its plural form for the given number of instances. If
<code>number</code> is 1, <code>word</code> is returned unchanged.
</p>
<p>
The return value is not defined if this method is passed a plural form.
</p... | java | public String pluralize(String word, int number) {
if (number == 1) { return word; }
Matcher matcher = pattern.matcher(word);
if (matcher.matches()) {
String pre = matcher.group(1);
String trimmedWord = matcher.group(2);
String post = matcher.group(3);
String plural = pluralizeIntern... | [
"public",
"String",
"pluralize",
"(",
"String",
"word",
",",
"int",
"number",
")",
"{",
"if",
"(",
"number",
"==",
"1",
")",
"{",
"return",
"word",
";",
"}",
"Matcher",
"matcher",
"=",
"pattern",
".",
"matcher",
"(",
"word",
")",
";",
"if",
"(",
"m... | {@inheritDoc}
<p>
Converts a noun or pronoun to its plural form for the given number of instances. If
<code>number</code> is 1, <code>word</code> is returned unchanged.
</p>
<p>
The return value is not defined if this method is passed a plural form.
</p> | [
"{"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/text/inflector/RuleBasedPluralizer.java#L193-L205 |
amaembo/streamex | src/main/java/one/util/streamex/IntStreamEx.java | IntStreamEx.minByDouble | public OptionalInt minByDouble(IntToDoubleFunction keyExtractor) {
"""
Returns the minimum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalInt} describing some ele... | java | public OptionalInt minByDouble(IntToDoubleFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, i) -> {
double key = keyExtractor.applyAsDouble(i);
if (!box.b || Double.compare(box.d, key) > 0) {
box.b = true;
box.d = key;
box.i ... | [
"public",
"OptionalInt",
"minByDouble",
"(",
"IntToDoubleFunction",
"keyExtractor",
")",
"{",
"return",
"collect",
"(",
"PrimitiveBox",
"::",
"new",
",",
"(",
"box",
",",
"i",
")",
"->",
"{",
"double",
"key",
"=",
"keyExtractor",
".",
"applyAsDouble",
"(",
"... | Returns the minimum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalInt} describing some element of this stream for
which the lowest value was returned by key extractor, or an... | [
"Returns",
"the",
"minimum",
"element",
"of",
"this",
"stream",
"according",
"to",
"the",
"provided",
"key",
"extractor",
"function",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/IntStreamEx.java#L1061-L1070 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.createMediaResource | public CreateMediaResourceResponse createMediaResource(
String title,
String description,
File file,
String transcodingPresetGroupName,
int priority)
throws FileNotFoundException {
"""
Uploads the specified file to Bos under the specified buck... | java | public CreateMediaResourceResponse createMediaResource(
String title,
String description,
File file,
String transcodingPresetGroupName,
int priority)
throws FileNotFoundException {
return createMediaResource(title, description, file, transc... | [
"public",
"CreateMediaResourceResponse",
"createMediaResource",
"(",
"String",
"title",
",",
"String",
"description",
",",
"File",
"file",
",",
"String",
"transcodingPresetGroupName",
",",
"int",
"priority",
")",
"throws",
"FileNotFoundException",
"{",
"return",
"create... | Uploads the specified file to Bos under the specified bucket and key name.
@param title media title.
@param description media description.
@param file The file containing the data to be uploaded to VOD.
@param transcodingPresetGroupName set transcoding presetgroup name, if NULL, use default
@param priority set transco... | [
"Uploads",
"the",
"specified",
"file",
"to",
"Bos",
"under",
"the",
"specified",
"bucket",
"and",
"key",
"name",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L206-L214 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/AccountsApi.java | AccountsApi.updateSharedAccess | public AccountSharedAccess updateSharedAccess(String accountId, AccountSharedAccess accountSharedAccess) throws ApiException {
"""
Reserved: Sets the shared access information for users.
Reserved: Sets the shared access information for one or more users.
@param accountId The external account number (int) or acco... | java | public AccountSharedAccess updateSharedAccess(String accountId, AccountSharedAccess accountSharedAccess) throws ApiException {
return updateSharedAccess(accountId, accountSharedAccess, null);
} | [
"public",
"AccountSharedAccess",
"updateSharedAccess",
"(",
"String",
"accountId",
",",
"AccountSharedAccess",
"accountSharedAccess",
")",
"throws",
"ApiException",
"{",
"return",
"updateSharedAccess",
"(",
"accountId",
",",
"accountSharedAccess",
",",
"null",
")",
";",
... | Reserved: Sets the shared access information for users.
Reserved: Sets the shared access information for one or more users.
@param accountId The external account number (int) or account ID Guid. (required)
@param accountSharedAccess (optional)
@return AccountSharedAccess | [
"Reserved",
":",
"Sets",
"the",
"shared",
"access",
"information",
"for",
"users",
".",
"Reserved",
":",
"Sets",
"the",
"shared",
"access",
"information",
"for",
"one",
"or",
"more",
"users",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/AccountsApi.java#L3043-L3045 |
Pi4J/pi4j | pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/base/DacGpioProviderBase.java | DacGpioProviderBase.setValue | @Override
public void setValue(Pin pin, Number value) {
"""
Set the requested analog output pin's conversion value.
@param pin to get conversion values for
@param value analog output pin conversion value
"""
super.setValue(pin, value.doubleValue());
} | java | @Override
public void setValue(Pin pin, Number value) {
super.setValue(pin, value.doubleValue());
} | [
"@",
"Override",
"public",
"void",
"setValue",
"(",
"Pin",
"pin",
",",
"Number",
"value",
")",
"{",
"super",
".",
"setValue",
"(",
"pin",
",",
"value",
".",
"doubleValue",
"(",
")",
")",
";",
"}"
] | Set the requested analog output pin's conversion value.
@param pin to get conversion values for
@param value analog output pin conversion value | [
"Set",
"the",
"requested",
"analog",
"output",
"pin",
"s",
"conversion",
"value",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/base/DacGpioProviderBase.java#L111-L114 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasLayerUtils.java | KerasLayerUtils.getKerasLayerFromConfig | public static KerasLayer getKerasLayerFromConfig(Map<String, Object> layerConfig,
KerasLayerConfiguration conf,
Map<String, Class<? extends KerasLayer>> customLayers,
... | java | public static KerasLayer getKerasLayerFromConfig(Map<String, Object> layerConfig,
KerasLayerConfiguration conf,
Map<String, Class<? extends KerasLayer>> customLayers,
... | [
"public",
"static",
"KerasLayer",
"getKerasLayerFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
",",
"KerasLayerConfiguration",
"conf",
",",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
"extends",
"KerasLayer",
">",
">",
"customLayers... | Build KerasLayer from a Keras layer configuration.
@param layerConfig map containing Keras layer properties
@return KerasLayer
@see Layer | [
"Build",
"KerasLayer",
"from",
"a",
"Keras",
"layer",
"configuration",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasLayerUtils.java#L160-L167 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java | TableCellStyleBuilder.borderRight | public TableCellStyleBuilder borderRight(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
"""
Add a border style for the right border of this cell.
@param size the size of the line
@param borderColor the color to be used in for... | java | public TableCellStyleBuilder borderRight(final Length size, final Color borderColor,
final BorderAttribute.Style style) {
final BorderAttribute bs = new BorderAttribute(size, borderColor, style);
this.bordersBuilder.right(bs);
return this;
} | [
"public",
"TableCellStyleBuilder",
"borderRight",
"(",
"final",
"Length",
"size",
",",
"final",
"Color",
"borderColor",
",",
"final",
"BorderAttribute",
".",
"Style",
"style",
")",
"{",
"final",
"BorderAttribute",
"bs",
"=",
"new",
"BorderAttribute",
"(",
"size",
... | Add a border style for the right border of this cell.
@param size the size of the line
@param borderColor the color to be used in format #rrggbb e.g. '#ff0000' for a red border
@param style the style of the border line, either BorderAttribute.BORDER_SOLID or BorderAttribute.BORDER_DOUBLE
@return this for ... | [
"Add",
"a",
"border",
"style",
"for",
"the",
"right",
"border",
"of",
"this",
"cell",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/style/TableCellStyleBuilder.java#L143-L148 |
akquinet/needle | src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java | ReflectionUtil.getFieldValue | public static Object getFieldValue(final Object object, final Class<?> clazz, final String fieldName) {
"""
Get the value of a given field on a given object via reflection.
@param object
-- target object of field access
@param clazz
-- type of argument object
@param fieldName
-- name of the field
@return ... | java | public static Object getFieldValue(final Object object, final Class<?> clazz, final String fieldName) {
try {
final Field field = clazz.getDeclaredField(fieldName);
return getFieldValue(object, field);
} catch (final Exception e) {
throw new IllegalArgumentException("... | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"final",
"Object",
"object",
",",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"String",
"fieldName",
")",
"{",
"try",
"{",
"final",
"Field",
"field",
"=",
"clazz",
".",
"getDeclaredField",
"("... | Get the value of a given field on a given object via reflection.
@param object
-- target object of field access
@param clazz
-- type of argument object
@param fieldName
-- name of the field
@return -- the value of the represented field in object; primitive values
are wrapped in an appropriate object before being retur... | [
"Get",
"the",
"value",
"of",
"a",
"given",
"field",
"on",
"a",
"given",
"object",
"via",
"reflection",
"."
] | train | https://github.com/akquinet/needle/blob/8b411c521246b8212882485edc01644f9aac7e24/src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java#L235-L242 |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java | CachingXmlDataStore.createCachingXmlDataStore | @Nonnull
public static CachingXmlDataStore createCachingXmlDataStore(@Nonnull final URL dataUrl, @Nonnull final URL versionURL, @Nonnull final DataStore fallback) {
"""
Constructs a new instance of {@code CachingXmlDataStore} with the given arguments. The given {@code cacheFile}
can be empty or filled with previ... | java | @Nonnull
public static CachingXmlDataStore createCachingXmlDataStore(@Nonnull final URL dataUrl, @Nonnull final URL versionURL, @Nonnull final DataStore fallback) {
return createCachingXmlDataStore(findOrCreateCacheFile(), dataUrl, versionURL, DEFAULT_CHARSET,
fallback);
} | [
"@",
"Nonnull",
"public",
"static",
"CachingXmlDataStore",
"createCachingXmlDataStore",
"(",
"@",
"Nonnull",
"final",
"URL",
"dataUrl",
",",
"@",
"Nonnull",
"final",
"URL",
"versionURL",
",",
"@",
"Nonnull",
"final",
"DataStore",
"fallback",
")",
"{",
"return",
... | Constructs a new instance of {@code CachingXmlDataStore} with the given arguments. The given {@code cacheFile}
can be empty or filled with previously cached data in XML format. The file must be writable otherwise an
exception will be thrown.
@param dataUrl
URL for online version of <em>UAS data</em>
@param versionURL
... | [
"Constructs",
"a",
"new",
"instance",
"of",
"{",
"@code",
"CachingXmlDataStore",
"}",
"with",
"the",
"given",
"arguments",
".",
"The",
"given",
"{",
"@code",
"cacheFile",
"}",
"can",
"be",
"empty",
"or",
"filled",
"with",
"previously",
"cached",
"data",
"in"... | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java#L115-L119 |
geomajas/geomajas-project-server | plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java | PdfContext.getTextSize | public Rectangle getTextSize(String text, Font font) {
"""
Return the text box for the specified text and font.
@param text text
@param font font
@return text box
"""
template.saveState();
// get the font
DefaultFontMapper mapper = new DefaultFontMapper();
BaseFont bf = mapper.awtToPdf(font);
te... | java | public Rectangle getTextSize(String text, Font font) {
template.saveState();
// get the font
DefaultFontMapper mapper = new DefaultFontMapper();
BaseFont bf = mapper.awtToPdf(font);
template.setFontAndSize(bf, font.getSize());
// calculate text width and height
float textWidth = template.getEffectiveStrin... | [
"public",
"Rectangle",
"getTextSize",
"(",
"String",
"text",
",",
"Font",
"font",
")",
"{",
"template",
".",
"saveState",
"(",
")",
";",
"// get the font",
"DefaultFontMapper",
"mapper",
"=",
"new",
"DefaultFontMapper",
"(",
")",
";",
"BaseFont",
"bf",
"=",
... | Return the text box for the specified text and font.
@param text text
@param font font
@return text box | [
"Return",
"the",
"text",
"box",
"for",
"the",
"specified",
"text",
"and",
"font",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java#L137-L150 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/internal/RandomAccessListIterate.java | RandomAccessListIterate.detectIndexWith | public static <T, IV> int detectIndexWith(List<T> list, Predicate2<? super T, ? super IV> predicate, IV injectedValue) {
"""
Searches for the first occurrence where the predicate evaluates to true.
@see Iterate#detectIndexWith(Iterable, Predicate2, Object)
"""
int size = list.size();
for (in... | java | public static <T, IV> int detectIndexWith(List<T> list, Predicate2<? super T, ? super IV> predicate, IV injectedValue)
{
int size = list.size();
for (int i = 0; i < size; i++)
{
if (predicate.accept(list.get(i), injectedValue))
{
return i;
... | [
"public",
"static",
"<",
"T",
",",
"IV",
">",
"int",
"detectIndexWith",
"(",
"List",
"<",
"T",
">",
"list",
",",
"Predicate2",
"<",
"?",
"super",
"T",
",",
"?",
"super",
"IV",
">",
"predicate",
",",
"IV",
"injectedValue",
")",
"{",
"int",
"size",
"... | Searches for the first occurrence where the predicate evaluates to true.
@see Iterate#detectIndexWith(Iterable, Predicate2, Object) | [
"Searches",
"for",
"the",
"first",
"occurrence",
"where",
"the",
"predicate",
"evaluates",
"to",
"true",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/internal/RandomAccessListIterate.java#L1148-L1159 |
tweea/matrixjavalib-main-web | src/main/java/net/matrix/web/html/HTMLs.java | HTMLs.fitToLength | public static String fitToLength(final String html, final int length) {
"""
将 HTML 文本适配到指定长度。
@param html
HTML 文本
@param length
目标长度
@return 适配结果
"""
if (html == null) {
return StringUtils.repeat(SPACE, length);
}
int len = html.length();
if (len >= length) {
return html;
}
StringBuil... | java | public static String fitToLength(final String html, final int length) {
if (html == null) {
return StringUtils.repeat(SPACE, length);
}
int len = html.length();
if (len >= length) {
return html;
}
StringBuilder sb = new StringBuilder();
sb.append(html);
for (int i = 0; i < length - len; i++) {
... | [
"public",
"static",
"String",
"fitToLength",
"(",
"final",
"String",
"html",
",",
"final",
"int",
"length",
")",
"{",
"if",
"(",
"html",
"==",
"null",
")",
"{",
"return",
"StringUtils",
".",
"repeat",
"(",
"SPACE",
",",
"length",
")",
";",
"}",
"int",
... | 将 HTML 文本适配到指定长度。
@param html
HTML 文本
@param length
目标长度
@return 适配结果 | [
"将",
"HTML",
"文本适配到指定长度。"
] | train | https://github.com/tweea/matrixjavalib-main-web/blob/c3386e728e6f97ff3a3d2cd94769e82840b1266f/src/main/java/net/matrix/web/html/HTMLs.java#L33-L48 |
andrehertwig/admintool | admin-tools-core/src/main/java/de/chandre/admintool/core/utils/ReflectUtils.java | ReflectUtils.invokeSetter | public static void invokeSetter(Object object, String fieldName, Object value, boolean ignoreNonExisting) {
"""
invokes the setter on the filed
@param object
@param field
@return
"""
Field field = ReflectionUtils.findField(object.getClass(), fieldName);
if(null == field) {
if (ignoreNonExisting) {
... | java | public static void invokeSetter(Object object, String fieldName, Object value, boolean ignoreNonExisting)
{
Field field = ReflectionUtils.findField(object.getClass(), fieldName);
if(null == field) {
if (ignoreNonExisting) {
return;
} else {
throw new NullPointerException("no field with name " + field... | [
"public",
"static",
"void",
"invokeSetter",
"(",
"Object",
"object",
",",
"String",
"fieldName",
",",
"Object",
"value",
",",
"boolean",
"ignoreNonExisting",
")",
"{",
"Field",
"field",
"=",
"ReflectionUtils",
".",
"findField",
"(",
"object",
".",
"getClass",
... | invokes the setter on the filed
@param object
@param field
@return | [
"invokes",
"the",
"setter",
"on",
"the",
"filed"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-core/src/main/java/de/chandre/admintool/core/utils/ReflectUtils.java#L180-L191 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/OpenSslX509KeyManagerFactory.java | OpenSslX509KeyManagerFactory.newEngineBased | public static OpenSslX509KeyManagerFactory newEngineBased(File certificateChain, String password)
throws CertificateException, IOException,
KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException {
"""
Create a new initialized {@link OpenSslX509KeyManagerFactory} which... | java | public static OpenSslX509KeyManagerFactory newEngineBased(File certificateChain, String password)
throws CertificateException, IOException,
KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException {
return newEngineBased(SslContext.toX509Certificates(certificateChain... | [
"public",
"static",
"OpenSslX509KeyManagerFactory",
"newEngineBased",
"(",
"File",
"certificateChain",
",",
"String",
"password",
")",
"throws",
"CertificateException",
",",
"IOException",
",",
"KeyStoreException",
",",
"NoSuchAlgorithmException",
",",
"UnrecoverableKeyExcept... | Create a new initialized {@link OpenSslX509KeyManagerFactory} which loads its {@link PrivateKey} directly from
an {@code OpenSSL engine} via the
<a href="https://www.openssl.org/docs/man1.1.0/crypto/ENGINE_load_private_key.html">ENGINE_load_private_key</a>
function. | [
"Create",
"a",
"new",
"initialized",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/OpenSslX509KeyManagerFactory.java#L240-L244 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java | SegmentAggregator.mergeCompleted | private void mergeCompleted(SegmentProperties segmentProperties, UpdateableSegmentMetadata transactionMetadata, MergeSegmentOperation mergeOp) {
"""
Executes post-Storage merge tasks, including state and metadata updates.
"""
// We have processed a MergeSegmentOperation, pop the first operation off and... | java | private void mergeCompleted(SegmentProperties segmentProperties, UpdateableSegmentMetadata transactionMetadata, MergeSegmentOperation mergeOp) {
// We have processed a MergeSegmentOperation, pop the first operation off and decrement the counter.
StorageOperation processedOperation = this.operations.remo... | [
"private",
"void",
"mergeCompleted",
"(",
"SegmentProperties",
"segmentProperties",
",",
"UpdateableSegmentMetadata",
"transactionMetadata",
",",
"MergeSegmentOperation",
"mergeOp",
")",
"{",
"// We have processed a MergeSegmentOperation, pop the first operation off and decrement the cou... | Executes post-Storage merge tasks, including state and metadata updates. | [
"Executes",
"post",
"-",
"Storage",
"merge",
"tasks",
"including",
"state",
"and",
"metadata",
"updates",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/writer/SegmentAggregator.java#L987-L1011 |
softindex/datakernel | core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBuf.java | ByteBuf.getString | @Contract(pure = true)
public String getString(@NotNull Charset charset) {
"""
Returns a {@code String} created from this {@code ByteBuf} using given charset.
Does not recycle this {@code ByteBuf}.
@param charset charset which is used to create {@code String} from this {@code ByteBuf}.
@return {@code String}... | java | @Contract(pure = true)
public String getString(@NotNull Charset charset) {
return new String(array, head, readRemaining(), charset);
} | [
"@",
"Contract",
"(",
"pure",
"=",
"true",
")",
"public",
"String",
"getString",
"(",
"@",
"NotNull",
"Charset",
"charset",
")",
"{",
"return",
"new",
"String",
"(",
"array",
",",
"head",
",",
"readRemaining",
"(",
")",
",",
"charset",
")",
";",
"}"
] | Returns a {@code String} created from this {@code ByteBuf} using given charset.
Does not recycle this {@code ByteBuf}.
@param charset charset which is used to create {@code String} from this {@code ByteBuf}.
@return {@code String} from this {@code ByteBuf} in a given charset. | [
"Returns",
"a",
"{",
"@code",
"String",
"}",
"created",
"from",
"this",
"{",
"@code",
"ByteBuf",
"}",
"using",
"given",
"charset",
".",
"Does",
"not",
"recycle",
"this",
"{",
"@code",
"ByteBuf",
"}",
"."
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBuf.java#L799-L802 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.lookaheadSequence | private boolean lookaheadSequence(boolean terminated, Token.Kind... kinds) {
"""
Attempt to match a given sequence of tokens in the given order, whilst
ignoring any whitespace in between. Note that, in any case, the index
will be unchanged!
@param terminated
Indicates whether or not this function should be c... | java | private boolean lookaheadSequence(boolean terminated, Token.Kind... kinds) {
int next = index;
for (Token.Kind k : kinds) {
next = terminated ? skipWhiteSpace(next) : skipLineSpace(next);
if (next >= tokens.size() || tokens.get(next++).kind != k) {
return false;
}
}
return true;
} | [
"private",
"boolean",
"lookaheadSequence",
"(",
"boolean",
"terminated",
",",
"Token",
".",
"Kind",
"...",
"kinds",
")",
"{",
"int",
"next",
"=",
"index",
";",
"for",
"(",
"Token",
".",
"Kind",
"k",
":",
"kinds",
")",
"{",
"next",
"=",
"terminated",
"?... | Attempt to match a given sequence of tokens in the given order, whilst
ignoring any whitespace in between. Note that, in any case, the index
will be unchanged!
@param terminated
Indicates whether or not this function should be concerned
with new lines. The terminated flag indicates whether or not
the current construct... | [
"Attempt",
"to",
"match",
"a",
"given",
"sequence",
"of",
"tokens",
"in",
"the",
"given",
"order",
"whilst",
"ignoring",
"any",
"whitespace",
"in",
"between",
".",
"Note",
"that",
"in",
"any",
"case",
"the",
"index",
"will",
"be",
"unchanged!"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L4295-L4304 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/cellprocessor/format/ParseProcessor.java | ParseProcessor.checkPreconditions | private static <T> void checkPreconditions(final Class<T> type, final TextParser<T> parser) {
"""
コンスタによるインスタンスを生成する際の前提条件となる引数のチェックを行う。
@throws NullPointerException type or parser is null.
"""
if(type == null) {
throw new NullPointerException("type is null.");
}
... | java | private static <T> void checkPreconditions(final Class<T> type, final TextParser<T> parser) {
if(type == null) {
throw new NullPointerException("type is null.");
}
if(parser == null) {
throw new NullPointerException("parser is null.");
}
} | [
"private",
"static",
"<",
"T",
">",
"void",
"checkPreconditions",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"final",
"TextParser",
"<",
"T",
">",
"parser",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerExcept... | コンスタによるインスタンスを生成する際の前提条件となる引数のチェックを行う。
@throws NullPointerException type or parser is null. | [
"コンスタによるインスタンスを生成する際の前提条件となる引数のチェックを行う。",
"@throws",
"NullPointerException",
"type",
"or",
"parser",
"is",
"null",
"."
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/cellprocessor/format/ParseProcessor.java#L43-L51 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java | JBBPUtils.assertNotNull | public static void assertNotNull(final Object object, final String message) {
"""
Check that an object is null and throw NullPointerException in the case.
@param object an object to be checked
@param message message to be used as the exception message
@throws NullPointerException it will be thrown if the obj... | java | public static void assertNotNull(final Object object, final String message) {
if (object == null) {
throw new NullPointerException(message == null ? "Object is null" : message);
}
} | [
"public",
"static",
"void",
"assertNotNull",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"message",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"message",
"==",
"null",
"?",
"\"Object is n... | Check that an object is null and throw NullPointerException in the case.
@param object an object to be checked
@param message message to be used as the exception message
@throws NullPointerException it will be thrown if the object is null | [
"Check",
"that",
"an",
"object",
"is",
"null",
"and",
"throw",
"NullPointerException",
"in",
"the",
"case",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java#L478-L482 |
cubedtear/aritzh | aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java | Configuration.setProperty | public void setProperty(String category, String key, Object value) {
"""
Sets a property in the configuration
@param category The category of the property
@param key The key to identify the property
@param value The value associated with it
"""
this.setProperty(category, key, value.toString());
... | java | public void setProperty(String category, String key, Object value) {
this.setProperty(category, key, value.toString());
} | [
"public",
"void",
"setProperty",
"(",
"String",
"category",
",",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"this",
".",
"setProperty",
"(",
"category",
",",
"key",
",",
"value",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Sets a property in the configuration
@param category The category of the property
@param key The key to identify the property
@param value The value associated with it | [
"Sets",
"a",
"property",
"in",
"the",
"configuration"
] | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java#L215-L217 |
mqlight/java-mqlight | mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/logback/LogbackLoggingImpl.java | LogbackLoggingImpl.createPatternLayoutEncoder | private static PatternLayoutEncoder createPatternLayoutEncoder(LoggerContext context, String patternProperty) {
"""
Creates a {@link PatternLayoutEncoder} for the pattern specified for the pattern property.
@param context Logger context to associate the pattern layout encoder with.
@param patternProperty Logge... | java | private static PatternLayoutEncoder createPatternLayoutEncoder(LoggerContext context, String patternProperty) {
final String pattern = context.getProperty(patternProperty);
final PatternLayoutEncoder patternLayoutEncoder = new PatternLayoutEncoder();
patternLayoutEncoder.setContext(context);
patternLayo... | [
"private",
"static",
"PatternLayoutEncoder",
"createPatternLayoutEncoder",
"(",
"LoggerContext",
"context",
",",
"String",
"patternProperty",
")",
"{",
"final",
"String",
"pattern",
"=",
"context",
".",
"getProperty",
"(",
"patternProperty",
")",
";",
"final",
"Patter... | Creates a {@link PatternLayoutEncoder} for the pattern specified for the pattern property.
@param context Logger context to associate the pattern layout encoder with.
@param patternProperty Logger context property that contains the required pattern.
@return A {@link PatternLayoutEncoder} for the required pattern. | [
"Creates",
"a",
"{",
"@link",
"PatternLayoutEncoder",
"}",
"for",
"the",
"pattern",
"specified",
"for",
"the",
"pattern",
"property",
"."
] | train | https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/logback/LogbackLoggingImpl.java#L238-L245 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java | Postconditions.checkPostconditionsD | public static double checkPostconditionsD(
final double value,
final ContractDoubleConditionType... conditions)
throws PostconditionViolationException {
"""
A {@code double} specialized version of {@link #checkPostconditions(Object,
ContractConditionType[])}
@param value The value
@param cond... | java | public static double checkPostconditionsD(
final double value,
final ContractDoubleConditionType... conditions)
throws PostconditionViolationException
{
final Violations violations = innerCheckAllDouble(value, conditions);
if (violations != null) {
throw failed(null, Double.valueOf(value), v... | [
"public",
"static",
"double",
"checkPostconditionsD",
"(",
"final",
"double",
"value",
",",
"final",
"ContractDoubleConditionType",
"...",
"conditions",
")",
"throws",
"PostconditionViolationException",
"{",
"final",
"Violations",
"violations",
"=",
"innerCheckAllDouble",
... | A {@code double} specialized version of {@link #checkPostconditions(Object,
ContractConditionType[])}
@param value The value
@param conditions The conditions the value must obey
@return value
@throws PostconditionViolationException If any of the conditions are false | [
"A",
"{",
"@code",
"double",
"}",
"specialized",
"version",
"of",
"{",
"@link",
"#checkPostconditions",
"(",
"Object",
"ContractConditionType",
"[]",
")",
"}"
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java#L146-L156 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/NullNotificationService.java | NullNotificationService.batchUpdate | public void batchUpdate(HashMap invalidateIdEvents, HashMap invalidateTemplateEvents, ArrayList pushEntryEvents, ArrayList aliasEntryEvents, CacheUnit cacheUnit) {
"""
This applies a set of invalidations and new entries to this CacheUnit,
including the local internal cache and external caches registered
with thi... | java | public void batchUpdate(HashMap invalidateIdEvents, HashMap invalidateTemplateEvents, ArrayList pushEntryEvents, ArrayList aliasEntryEvents, CacheUnit cacheUnit) { //CCC
// nothing to do for NullNotification
} | [
"public",
"void",
"batchUpdate",
"(",
"HashMap",
"invalidateIdEvents",
",",
"HashMap",
"invalidateTemplateEvents",
",",
"ArrayList",
"pushEntryEvents",
",",
"ArrayList",
"aliasEntryEvents",
",",
"CacheUnit",
"cacheUnit",
")",
"{",
"//CCC",
"// nothing to do for NullNotifica... | This applies a set of invalidations and new entries to this CacheUnit,
including the local internal cache and external caches registered
with this CacheUnit.
@param invalidateIdEvents A Vector of invalidate by id events.
@param invalidateTemplateEvents A Vector of invalidate by template events.
@param pushEntryEvents ... | [
"This",
"applies",
"a",
"set",
"of",
"invalidations",
"and",
"new",
"entries",
"to",
"this",
"CacheUnit",
"including",
"the",
"local",
"internal",
"cache",
"and",
"external",
"caches",
"registered",
"with",
"this",
"CacheUnit",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/NullNotificationService.java#L35-L37 |
threerings/nenya | core/src/main/java/com/threerings/media/MediaPanel.java | MediaPanel.paintBits | protected void paintBits (Graphics2D gfx, int layer, Rectangle dirty) {
"""
Renders the sprites and animations that intersect the supplied dirty region in the specified
layer. Derived classes can override this method if they need to do custom sprite or
animation rendering (if they need to do special sprite z-ord... | java | protected void paintBits (Graphics2D gfx, int layer, Rectangle dirty)
{
_metamgr.paintMedia(gfx, layer, dirty);
} | [
"protected",
"void",
"paintBits",
"(",
"Graphics2D",
"gfx",
",",
"int",
"layer",
",",
"Rectangle",
"dirty",
")",
"{",
"_metamgr",
".",
"paintMedia",
"(",
"gfx",
",",
"layer",
",",
"dirty",
")",
";",
"}"
] | Renders the sprites and animations that intersect the supplied dirty region in the specified
layer. Derived classes can override this method if they need to do custom sprite or
animation rendering (if they need to do special sprite z-order handling, for example). The
clipping region will already be set appropriately. | [
"Renders",
"the",
"sprites",
"and",
"animations",
"that",
"intersect",
"the",
"supplied",
"dirty",
"region",
"in",
"the",
"specified",
"layer",
".",
"Derived",
"classes",
"can",
"override",
"this",
"method",
"if",
"they",
"need",
"to",
"do",
"custom",
"sprite"... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MediaPanel.java#L548-L551 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/UpdateExpressionGenerator.java | UpdateExpressionGenerator.getBaseToken | private String getBaseToken(List<String> sortedNonKeyNonNullAttributeNames,
List<String> sortedNullValuedNonKeyAttributeNames) {
"""
Uses attribute names from sortedNonKeyNonNullAttributeNames and sortedNullValuedNonKeyAttributeNames to generate an {@link Adler32} checkSum
Adler32 ... | java | private String getBaseToken(List<String> sortedNonKeyNonNullAttributeNames,
List<String> sortedNullValuedNonKeyAttributeNames) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOu... | [
"private",
"String",
"getBaseToken",
"(",
"List",
"<",
"String",
">",
"sortedNonKeyNonNullAttributeNames",
",",
"List",
"<",
"String",
">",
"sortedNullValuedNonKeyAttributeNames",
")",
"{",
"ByteArrayOutputStream",
"byteArrayOutputStream",
"=",
"new",
"ByteArrayOutputStream... | Uses attribute names from sortedNonKeyNonNullAttributeNames and sortedNullValuedNonKeyAttributeNames to generate an {@link Adler32} checkSum
Adler32 generates checksum that is unique enough to be used as a token within an update item and faster to compute than CRC32. | [
"Uses",
"attribute",
"names",
"from",
"sortedNonKeyNonNullAttributeNames",
"and",
"sortedNullValuedNonKeyAttributeNames",
"to",
"generate",
"an",
"{"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/UpdateExpressionGenerator.java#L179-L196 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java | CommerceNotificationTemplatePersistenceImpl.removeByG_T_E | @Override
public void removeByG_T_E(long groupId, String type, boolean enabled) {
"""
Removes all the commerce notification templates where groupId = ? and type = ? and enabled = ? from the database.
@param groupId the group ID
@param type the type
@param enabled the enabled
"""
for (Commer... | java | @Override
public void removeByG_T_E(long groupId, String type, boolean enabled) {
for (CommerceNotificationTemplate commerceNotificationTemplate : findByG_T_E(
groupId, type, enabled, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
null)) {
remove(commerceNotificationTemplate);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_T_E",
"(",
"long",
"groupId",
",",
"String",
"type",
",",
"boolean",
"enabled",
")",
"{",
"for",
"(",
"CommerceNotificationTemplate",
"commerceNotificationTemplate",
":",
"findByG_T_E",
"(",
"groupId",
",",
"type",
","... | Removes all the commerce notification templates where groupId = ? and type = ? and enabled = ? from the database.
@param groupId the group ID
@param type the type
@param enabled the enabled | [
"Removes",
"all",
"the",
"commerce",
"notification",
"templates",
"where",
"groupId",
"=",
"?",
";",
"and",
"type",
"=",
"?",
";",
"and",
"enabled",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java#L4279-L4286 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Tools.java | Tools.Scale | public static double Scale(DoubleRange from, DoubleRange to, int x) {
"""
Converts the value x (which is measured in the scale 'from') to another value measured in the scale 'to'.
@param from Scale from.
@param to Scale to.
@param x Value.
@return Result.
"""
if (from.length() == 0) return ... | java | public static double Scale(DoubleRange from, DoubleRange to, int x) {
if (from.length() == 0) return 0;
return ((to.length()) * (x - from.getMin()) / from.length() + to.getMin());
} | [
"public",
"static",
"double",
"Scale",
"(",
"DoubleRange",
"from",
",",
"DoubleRange",
"to",
",",
"int",
"x",
")",
"{",
"if",
"(",
"from",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"0",
";",
"return",
"(",
"(",
"to",
".",
"length",
"(",
... | Converts the value x (which is measured in the scale 'from') to another value measured in the scale 'to'.
@param from Scale from.
@param to Scale to.
@param x Value.
@return Result. | [
"Converts",
"the",
"value",
"x",
"(",
"which",
"is",
"measured",
"in",
"the",
"scale",
"from",
")",
"to",
"another",
"value",
"measured",
"in",
"the",
"scale",
"to",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L422-L425 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/config/TriggerDefinition.java | TriggerDefinition.fromSchema | public static List<TriggerDefinition> fromSchema(Row serializedTriggers) {
"""
Deserialize triggers from storage-level representation.
@param serializedTriggers storage-level partition containing the trigger definitions
@return the list of processed TriggerDefinitions
"""
List<TriggerDefinition> tr... | java | public static List<TriggerDefinition> fromSchema(Row serializedTriggers)
{
List<TriggerDefinition> triggers = new ArrayList<>();
String query = String.format("SELECT * FROM %s.%s", Keyspace.SYSTEM_KS, SystemKeyspace.SCHEMA_TRIGGERS_CF);
for (UntypedResultSet.Row row : QueryProcessor.resultif... | [
"public",
"static",
"List",
"<",
"TriggerDefinition",
">",
"fromSchema",
"(",
"Row",
"serializedTriggers",
")",
"{",
"List",
"<",
"TriggerDefinition",
">",
"triggers",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"String",
"query",
"=",
"String",
".",
"form... | Deserialize triggers from storage-level representation.
@param serializedTriggers storage-level partition containing the trigger definitions
@return the list of processed TriggerDefinitions | [
"Deserialize",
"triggers",
"from",
"storage",
"-",
"level",
"representation",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/TriggerDefinition.java#L61-L72 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/internal/io/SchemaTypeAdapter.java | SchemaTypeAdapter.readArray | private Schema readArray(JsonReader reader, Set<String> knownRecords) throws IOException {
"""
Constructs {@link Schema.Type#ARRAY ARRAY} type schema from the json input.
@param reader The {@link JsonReader} for streaming json input tokens.
@param knownRecords Set of record name already encountered during the ... | java | private Schema readArray(JsonReader reader, Set<String> knownRecords) throws IOException {
return Schema.arrayOf(readInnerSchema(reader, "items", knownRecords));
} | [
"private",
"Schema",
"readArray",
"(",
"JsonReader",
"reader",
",",
"Set",
"<",
"String",
">",
"knownRecords",
")",
"throws",
"IOException",
"{",
"return",
"Schema",
".",
"arrayOf",
"(",
"readInnerSchema",
"(",
"reader",
",",
"\"items\"",
",",
"knownRecords",
... | Constructs {@link Schema.Type#ARRAY ARRAY} type schema from the json input.
@param reader The {@link JsonReader} for streaming json input tokens.
@param knownRecords Set of record name already encountered during the reading.
@return A {@link Schema} of type {@link Schema.Type#ARRAY ARRAY}.
@throws java.io.IOException ... | [
"Constructs",
"{",
"@link",
"Schema",
".",
"Type#ARRAY",
"ARRAY",
"}",
"type",
"schema",
"from",
"the",
"json",
"input",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/internal/io/SchemaTypeAdapter.java#L165-L167 |
i-net-software/jlessc | src/com/inet/lib/less/Operation.java | Operation.putConvertion | private static void putConvertion( HashMap<String, Double> group, String unit, double factor ) {
"""
Helper for creating static unit conversions.
@param group the unit group like length, duration or angles. Units of one group can convert in another.
@param unit the unit name
@param factor the convert factor
... | java | private static void putConvertion( HashMap<String, Double> group, String unit, double factor ) {
UNIT_CONVERSIONS.put(unit, group );
group.put( unit, factor );
} | [
"private",
"static",
"void",
"putConvertion",
"(",
"HashMap",
"<",
"String",
",",
"Double",
">",
"group",
",",
"String",
"unit",
",",
"double",
"factor",
")",
"{",
"UNIT_CONVERSIONS",
".",
"put",
"(",
"unit",
",",
"group",
")",
";",
"group",
".",
"put",
... | Helper for creating static unit conversions.
@param group the unit group like length, duration or angles. Units of one group can convert in another.
@param unit the unit name
@param factor the convert factor | [
"Helper",
"for",
"creating",
"static",
"unit",
"conversions",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/Operation.java#L74-L77 |
xiancloud/xian | xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/ConfigurationSupport.java | ConfigurationSupport.setAdditionalFields | public static void setAdditionalFields(String spec, GelfMessageAssembler gelfMessageAssembler) {
"""
Set the additional (static) fields.
@param spec field=value,field1=value1, ...
@param gelfMessageAssembler the Gelf message assembler to apply the configuration
"""
if (null != spec) {
S... | java | public static void setAdditionalFields(String spec, GelfMessageAssembler gelfMessageAssembler) {
if (null != spec) {
String[] properties = spec.split(MULTI_VALUE_DELIMITTER);
for (String field : properties) {
final int index = field.indexOf(EQ);
if (-1 ==... | [
"public",
"static",
"void",
"setAdditionalFields",
"(",
"String",
"spec",
",",
"GelfMessageAssembler",
"gelfMessageAssembler",
")",
"{",
"if",
"(",
"null",
"!=",
"spec",
")",
"{",
"String",
"[",
"]",
"properties",
"=",
"spec",
".",
"split",
"(",
"MULTI_VALUE_D... | Set the additional (static) fields.
@param spec field=value,field1=value1, ...
@param gelfMessageAssembler the Gelf message assembler to apply the configuration | [
"Set",
"the",
"additional",
"(",
"static",
")",
"fields",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/ConfigurationSupport.java#L25-L37 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/dptxlator/TranslatorTypes.java | TranslatorTypes.createTranslator | public static DPTXlator createTranslator(int mainNumber, String dptID)
throws KNXException {
"""
Creates a DPT translator for the given datapoint type ID.
<p>
The translation behavior of a DPT translator instance is uniquely defined by the
supplied datapoint type ID.
<p>
If the <code>dptID</code> argument ... | java | public static DPTXlator createTranslator(int mainNumber, String dptID)
throws KNXException
{
try {
final int main = getMainNumber(mainNumber, dptID);
final MainType type = (MainType) map.get(new Integer(main));
if (type != null)
return type.createTranslator(dptID);
}
catch (final NumberFo... | [
"public",
"static",
"DPTXlator",
"createTranslator",
"(",
"int",
"mainNumber",
",",
"String",
"dptID",
")",
"throws",
"KNXException",
"{",
"try",
"{",
"final",
"int",
"main",
"=",
"getMainNumber",
"(",
"mainNumber",
",",
"dptID",
")",
";",
"final",
"MainType",... | Creates a DPT translator for the given datapoint type ID.
<p>
The translation behavior of a DPT translator instance is uniquely defined by the
supplied datapoint type ID.
<p>
If the <code>dptID</code> argument is built up the recommended way, that is "<i>main
number</i>.<i>sub number</i>", the <code>mainNumber</code> a... | [
"Creates",
"a",
"DPT",
"translator",
"for",
"the",
"given",
"datapoint",
"type",
"ID",
".",
"<p",
">",
"The",
"translation",
"behavior",
"of",
"a",
"DPT",
"translator",
"instance",
"is",
"uniquely",
"defined",
"by",
"the",
"supplied",
"datapoint",
"type",
"I... | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/dptxlator/TranslatorTypes.java#L460-L471 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/privatejgoodies/common/base/Preconditions.java | Preconditions.checkNotNull | public static <T> T checkNotNull(T reference, String message) {
"""
Checks that the given object reference is not {@code null} and throws a customized
{@link NullPointerException} if it is. Intended for doing parameter validation in methods and
constructors, e.g.:
<blockquote><pre>
public void foo(Bar bar, Baz... | java | public static <T> T checkNotNull(T reference, String message) {
if (reference == null) {
throw new NullPointerException(message);
}
return reference;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"checkNotNull",
"(",
"T",
"reference",
",",
"String",
"message",
")",
"{",
"if",
"(",
"reference",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"message",
")",
";",
"}",
"return",
"reference... | Checks that the given object reference is not {@code null} and throws a customized
{@link NullPointerException} if it is. Intended for doing parameter validation in methods and
constructors, e.g.:
<blockquote><pre>
public void foo(Bar bar, Baz baz) {
this.bar = Preconditions.checkNotNull(bar, "bar must not be null.");
... | [
"Checks",
"that",
"the",
"given",
"object",
"reference",
"is",
"not",
"{",
"@code",
"null",
"}",
"and",
"throws",
"a",
"customized",
"{",
"@link",
"NullPointerException",
"}",
"if",
"it",
"is",
".",
"Intended",
"for",
"doing",
"parameter",
"validation",
"in"... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/common/base/Preconditions.java#L110-L115 |
networknt/light-rest-4j | openapi-validator/src/main/java/com/networknt/openapi/ResponseValidator.java | ResponseValidator.validateResponseContent | public Status validateResponseContent(Object responseContent, String uri, String httpMethod, String statusCode) {
"""
validate a given response content object with media content type "application/json"
uri, httpMethod, statusCode, DEFAULT_MEDIA_TYPE is to locate the schema to validate
@param responseContent resp... | java | public Status validateResponseContent(Object responseContent, String uri, String httpMethod, String statusCode) {
return validateResponseContent(responseContent, uri, httpMethod, statusCode, JSON_MEDIA_TYPE);
} | [
"public",
"Status",
"validateResponseContent",
"(",
"Object",
"responseContent",
",",
"String",
"uri",
",",
"String",
"httpMethod",
",",
"String",
"statusCode",
")",
"{",
"return",
"validateResponseContent",
"(",
"responseContent",
",",
"uri",
",",
"httpMethod",
","... | validate a given response content object with media content type "application/json"
uri, httpMethod, statusCode, DEFAULT_MEDIA_TYPE is to locate the schema to validate
@param responseContent response content needs to be validated
@param uri original uri of the request
@param httpMethod eg. "put" or "get"
@param statusC... | [
"validate",
"a",
"given",
"response",
"content",
"object",
"with",
"media",
"content",
"type",
"application",
"/",
"json",
"uri",
"httpMethod",
"statusCode",
"DEFAULT_MEDIA_TYPE",
"is",
"to",
"locate",
"the",
"schema",
"to",
"validate"
] | train | https://github.com/networknt/light-rest-4j/blob/06b15128e6101351e617284a636ef5d632e6b1fe/openapi-validator/src/main/java/com/networknt/openapi/ResponseValidator.java#L80-L82 |
stagemonitor/stagemonitor | stagemonitor-tracing/src/main/java/org/stagemonitor/tracing/metrics/MetricsSpanEventListener.java | MetricsSpanEventListener.trackExternalRequestRate | private void trackExternalRequestRate(Span span, String operationName, SpanContextInformation spanContext, boolean trackMetricsByOperationName) {
"""
/*
tracks the external requests grouped by the parent request name
this helps to analyze which requests issue a lot of external requests like jdbc calls
"""
... | java | private void trackExternalRequestRate(Span span, String operationName, SpanContextInformation spanContext, boolean trackMetricsByOperationName) {
int totalCount = 0;
for (SpanContextInformation.ExternalRequestStats externalRequestStats : spanContext.getExternalRequestStats()) {
long durationNanos = externalReque... | [
"private",
"void",
"trackExternalRequestRate",
"(",
"Span",
"span",
",",
"String",
"operationName",
",",
"SpanContextInformation",
"spanContext",
",",
"boolean",
"trackMetricsByOperationName",
")",
"{",
"int",
"totalCount",
"=",
"0",
";",
"for",
"(",
"SpanContextInfor... | /*
tracks the external requests grouped by the parent request name
this helps to analyze which requests issue a lot of external requests like jdbc calls | [
"/",
"*",
"tracks",
"the",
"external",
"requests",
"grouped",
"by",
"the",
"parent",
"request",
"name",
"this",
"helps",
"to",
"analyze",
"which",
"requests",
"issue",
"a",
"lot",
"of",
"external",
"requests",
"like",
"jdbc",
"calls"
] | train | https://github.com/stagemonitor/stagemonitor/blob/7a1bf6848906f816aa465983f602ea1f1e8f2b7b/stagemonitor-tracing/src/main/java/org/stagemonitor/tracing/metrics/MetricsSpanEventListener.java#L116-L130 |
js-lib-com/commons | src/main/java/js/lang/Config.java | Config.hasAttribute | public boolean hasAttribute(String name, String value) {
"""
Test if configuration object has an attribute with requested name and value.
@param name name of the attribute to search for,
@param value attribute value.
@return true if configuration object has an attribute with requested name and value.
@throws... | java | public boolean hasAttribute(String name, String value)
{
Params.notNullOrEmpty(name, "Attribute name");
Params.notNullOrEmpty(value, "Attribute value");
return value.equals(attributes.get(name));
} | [
"public",
"boolean",
"hasAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Params",
".",
"notNullOrEmpty",
"(",
"name",
",",
"\"Attribute name\"",
")",
";",
"Params",
".",
"notNullOrEmpty",
"(",
"value",
",",
"\"Attribute value\"",
")",
";"... | Test if configuration object has an attribute with requested name and value.
@param name name of the attribute to search for,
@param value attribute value.
@return true if configuration object has an attribute with requested name and value.
@throws IllegalArgumentException if <code>name</code> argument is null or empt... | [
"Test",
"if",
"configuration",
"object",
"has",
"an",
"attribute",
"with",
"requested",
"name",
"and",
"value",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/lang/Config.java#L252-L257 |
jwtk/jjwt | impl/src/main/java/io/jsonwebtoken/impl/crypto/RsaProvider.java | RsaProvider.generateKeyPair | @SuppressWarnings("unused") //used by io.jsonwebtoken.security.Keys
public static KeyPair generateKeyPair(SignatureAlgorithm alg) {
"""
Generates a new RSA secure-randomly key pair suitable for the specified SignatureAlgorithm using JJWT's
default {@link SignatureProvider#DEFAULT_SECURE_RANDOM SecureRandom in... | java | @SuppressWarnings("unused") //used by io.jsonwebtoken.security.Keys
public static KeyPair generateKeyPair(SignatureAlgorithm alg) {
Assert.isTrue(alg.isRsa(), "Only RSA algorithms are supported by this method.");
int keySizeInBits = 4096;
switch (alg) {
case RS256:
ca... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"//used by io.jsonwebtoken.security.Keys",
"public",
"static",
"KeyPair",
"generateKeyPair",
"(",
"SignatureAlgorithm",
"alg",
")",
"{",
"Assert",
".",
"isTrue",
"(",
"alg",
".",
"isRsa",
"(",
")",
",",
"\"Only RSA al... | Generates a new RSA secure-randomly key pair suitable for the specified SignatureAlgorithm using JJWT's
default {@link SignatureProvider#DEFAULT_SECURE_RANDOM SecureRandom instance}. This is a convenience method
that immediately delegates to {@link #generateKeyPair(int)} based on the relevant key size for the specifie... | [
"Generates",
"a",
"new",
"RSA",
"secure",
"-",
"randomly",
"key",
"pair",
"suitable",
"for",
"the",
"specified",
"SignatureAlgorithm",
"using",
"JJWT",
"s",
"default",
"{",
"@link",
"SignatureProvider#DEFAULT_SECURE_RANDOM",
"SecureRandom",
"instance",
"}",
".",
"Th... | train | https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/impl/src/main/java/io/jsonwebtoken/impl/crypto/RsaProvider.java#L135-L150 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSchema.java | JSchema.setAccessors | private void setAccessors(int bias, JMFSchema schema) {
"""
permits retrieval of accessors relative to box schemas as well as the public schema.
"""
int nextBoxBias = bias + fields.length + variants.length;
for (int i = 0; i < fields.length; i++) {
JSField field = fields[i];
if (field insta... | java | private void setAccessors(int bias, JMFSchema schema) {
int nextBoxBias = bias + fields.length + variants.length;
for (int i = 0; i < fields.length; i++) {
JSField field = fields[i];
if (field instanceof JSVariant) {
JSchema boxed = (JSchema) ((JSVariant)field).getBoxed();
boxed.setA... | [
"private",
"void",
"setAccessors",
"(",
"int",
"bias",
",",
"JMFSchema",
"schema",
")",
"{",
"int",
"nextBoxBias",
"=",
"bias",
"+",
"fields",
".",
"length",
"+",
"variants",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"field... | permits retrieval of accessors relative to box schemas as well as the public schema. | [
"permits",
"retrieval",
"of",
"accessors",
"relative",
"to",
"box",
"schemas",
"as",
"well",
"as",
"the",
"public",
"schema",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSchema.java#L672-L691 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | StrBuilder.lastIndexOf | public int lastIndexOf(final StrMatcher matcher, int startIndex) {
"""
Searches the string builder using the matcher to find the last
match searching from the given index.
<p>
Matchers can be used to perform advanced searching behaviour.
For example you could write a matcher to find the character 'a'
followed... | java | public int lastIndexOf(final StrMatcher matcher, int startIndex) {
startIndex = (startIndex >= size ? size - 1 : startIndex);
if (matcher == null || startIndex < 0) {
return -1;
}
final char[] buf = buffer;
final int endIndex = startIndex + 1;
for (int i = sta... | [
"public",
"int",
"lastIndexOf",
"(",
"final",
"StrMatcher",
"matcher",
",",
"int",
"startIndex",
")",
"{",
"startIndex",
"=",
"(",
"startIndex",
">=",
"size",
"?",
"size",
"-",
"1",
":",
"startIndex",
")",
";",
"if",
"(",
"matcher",
"==",
"null",
"||",
... | Searches the string builder using the matcher to find the last
match searching from the given index.
<p>
Matchers can be used to perform advanced searching behaviour.
For example you could write a matcher to find the character 'a'
followed by a number.
@param matcher the matcher to use, null returns -1
@param startIn... | [
"Searches",
"the",
"string",
"builder",
"using",
"the",
"matcher",
"to",
"find",
"the",
"last",
"match",
"searching",
"from",
"the",
"given",
"index",
".",
"<p",
">",
"Matchers",
"can",
"be",
"used",
"to",
"perform",
"advanced",
"searching",
"behaviour",
"."... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2629-L2642 |
osglworks/java-tool-ext | src/main/java/org/osgl/util/Token.java | Token.generateToken | @Deprecated
public static String generateToken(String secret, Life tl, String oid, String... payload) {
"""
This method is deprecated, please use {@link #generateToken(byte[], Life, String, String...)} instead
Generate a token string with secret key, ID and optionally payloads
@param secret the secret to e... | java | @Deprecated
public static String generateToken(String secret, Life tl, String oid, String... payload) {
return generateToken(secret, tl.seconds, oid, payload);
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"generateToken",
"(",
"String",
"secret",
",",
"Life",
"tl",
",",
"String",
"oid",
",",
"String",
"...",
"payload",
")",
"{",
"return",
"generateToken",
"(",
"secret",
",",
"tl",
".",
"seconds",
",",
"oid",
... | This method is deprecated, please use {@link #generateToken(byte[], Life, String, String...)} instead
Generate a token string with secret key, ID and optionally payloads
@param secret the secret to encrypt to token string
@param tl the expiration of the token
@param oid the ID of the token (could be customer ID etc)
@... | [
"This",
"method",
"is",
"deprecated",
"please",
"use",
"{",
"@link",
"#generateToken",
"(",
"byte",
"[]",
"Life",
"String",
"String",
"...",
")",
"}",
"instead"
] | train | https://github.com/osglworks/java-tool-ext/blob/43f034bd0a42e571e437f44aa20487d45248a30b/src/main/java/org/osgl/util/Token.java#L296-L299 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/SegmentKeyCache.java | SegmentKeyCache.includeUpdateBatch | List<Long> includeUpdateBatch(TableKeyBatch batch, long batchOffset, int generation) {
"""
Updates the tail cache for with the contents of the given {@link TableKeyBatch}.
Each {@link TableKeyBatch.Item} is updated only if no previous entry exists with its {@link TableKeyBatch.Item#getHash()}
or if its {@link Ta... | java | List<Long> includeUpdateBatch(TableKeyBatch batch, long batchOffset, int generation) {
val result = new ArrayList<Long>(batch.getItems().size());
synchronized (this) {
for (TableKeyBatch.Item item : batch.getItems()) {
long itemOffset = batchOffset + item.getOffset();
... | [
"List",
"<",
"Long",
">",
"includeUpdateBatch",
"(",
"TableKeyBatch",
"batch",
",",
"long",
"batchOffset",
",",
"int",
"generation",
")",
"{",
"val",
"result",
"=",
"new",
"ArrayList",
"<",
"Long",
">",
"(",
"batch",
".",
"getItems",
"(",
")",
".",
"size... | Updates the tail cache for with the contents of the given {@link TableKeyBatch}.
Each {@link TableKeyBatch.Item} is updated only if no previous entry exists with its {@link TableKeyBatch.Item#getHash()}
or if its {@link TableKeyBatch.Item#getOffset()} is greater than the existing entry's offset.
This method should be ... | [
"Updates",
"the",
"tail",
"cache",
"for",
"with",
"the",
"contents",
"of",
"the",
"given",
"{",
"@link",
"TableKeyBatch",
"}",
".",
"Each",
"{",
"@link",
"TableKeyBatch",
".",
"Item",
"}",
"is",
"updated",
"only",
"if",
"no",
"previous",
"entry",
"exists",... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/SegmentKeyCache.java#L148-L171 |
joelittlejohn/jsonschema2pojo | jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/PropertiesRule.java | PropertiesRule.apply | @Override
public JDefinedClass apply(String nodeName, JsonNode node, JsonNode parent, JDefinedClass jclass, Schema schema) {
"""
Applies this schema rule to take the required code generation steps.
<p>
For each property present within the properties node, this rule will
invoke the 'property' rule provided b... | java | @Override
public JDefinedClass apply(String nodeName, JsonNode node, JsonNode parent, JDefinedClass jclass, Schema schema) {
if (node == null) {
node = JsonNodeFactory.instance.objectNode();
}
for (Iterator<String> properties = node.fieldNames(); properties.hasNext(); ) {
... | [
"@",
"Override",
"public",
"JDefinedClass",
"apply",
"(",
"String",
"nodeName",
",",
"JsonNode",
"node",
",",
"JsonNode",
"parent",
",",
"JDefinedClass",
"jclass",
",",
"Schema",
"schema",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"node",
"=",
... | Applies this schema rule to take the required code generation steps.
<p>
For each property present within the properties node, this rule will
invoke the 'property' rule provided by the given schema mapper.
@param nodeName
the name of the node for which properties are being added
@param node
the properties node, contai... | [
"Applies",
"this",
"schema",
"rule",
"to",
"take",
"the",
"required",
"code",
"generation",
"steps",
".",
"<p",
">",
"For",
"each",
"property",
"present",
"within",
"the",
"properties",
"node",
"this",
"rule",
"will",
"invoke",
"the",
"property",
"rule",
"pr... | train | https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/PropertiesRule.java#L61-L80 |
carewebframework/carewebframework-vista | org.carewebframework.vista.plugin-parent/org.carewebframework.vista.plugin.documents/src/main/java/org/carewebframework/vista/plugin/documents/DocumentDisplayRenderer.java | DocumentDisplayRenderer.renderItem | @Override
public void renderItem(final Listitem item, final Document doc) {
"""
Render the list item for the specified document.
@param item List item to render.
@param doc The document associated with the list item.
"""
final Listcell cell = new Listcell();
item.appendChild(cell);
... | java | @Override
public void renderItem(final Listitem item, final Document doc) {
final Listcell cell = new Listcell();
item.appendChild(cell);
final Div sep = new Div();
sep.setSclass("vista-documents-sep");
cell.appendChild(sep);
final Div div = new Div();
div.set... | [
"@",
"Override",
"public",
"void",
"renderItem",
"(",
"final",
"Listitem",
"item",
",",
"final",
"Document",
"doc",
")",
"{",
"final",
"Listcell",
"cell",
"=",
"new",
"Listcell",
"(",
")",
";",
"item",
".",
"appendChild",
"(",
"cell",
")",
";",
"final",
... | Render the list item for the specified document.
@param item List item to render.
@param doc The document associated with the list item. | [
"Render",
"the",
"list",
"item",
"for",
"the",
"specified",
"document",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.plugin-parent/org.carewebframework.vista.plugin.documents/src/main/java/org/carewebframework/vista/plugin/documents/DocumentDisplayRenderer.java#L52-L71 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java | MainScene.addChildObjectToCamera | public void addChildObjectToCamera(final GVRSceneObject child, int camera) {
"""
Adds a scene object to one or both of the left and right cameras.
@param child The {@link GVRSceneObject} to add.
@param camera {@link #LEFT_CAMERA} or {@link #RIGHT_CAMERA}; these can be
or'd together to add {@code child} to bo... | java | public void addChildObjectToCamera(final GVRSceneObject child, int camera) {
switch (camera) {
case LEFT_CAMERA:
mLeftCameraRootObject.addChildObject(child);
break;
case RIGHT_CAMERA:
mRightCameraRootObject.addChildObject(child);
... | [
"public",
"void",
"addChildObjectToCamera",
"(",
"final",
"GVRSceneObject",
"child",
",",
"int",
"camera",
")",
"{",
"switch",
"(",
"camera",
")",
"{",
"case",
"LEFT_CAMERA",
":",
"mLeftCameraRootObject",
".",
"addChildObject",
"(",
"child",
")",
";",
"break",
... | Adds a scene object to one or both of the left and right cameras.
@param child The {@link GVRSceneObject} to add.
@param camera {@link #LEFT_CAMERA} or {@link #RIGHT_CAMERA}; these can be
or'd together to add {@code child} to both cameras. | [
"Adds",
"a",
"scene",
"object",
"to",
"one",
"or",
"both",
"of",
"the",
"left",
"and",
"right",
"cameras",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java#L311-L323 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java | CPOptionPersistenceImpl.removeByG_K | @Override
public CPOption removeByG_K(long groupId, String key)
throws NoSuchCPOptionException {
"""
Removes the cp option where groupId = ? and key = ? from the database.
@param groupId the group ID
@param key the key
@return the cp option that was removed
"""
CPOption cpOption = findByG_K(g... | java | @Override
public CPOption removeByG_K(long groupId, String key)
throws NoSuchCPOptionException {
CPOption cpOption = findByG_K(groupId, key);
return remove(cpOption);
} | [
"@",
"Override",
"public",
"CPOption",
"removeByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"throws",
"NoSuchCPOptionException",
"{",
"CPOption",
"cpOption",
"=",
"findByG_K",
"(",
"groupId",
",",
"key",
")",
";",
"return",
"remove",
"(",
"cpOptio... | Removes the cp option where groupId = ? and key = ? from the database.
@param groupId the group ID
@param key the key
@return the cp option that was removed | [
"Removes",
"the",
"cp",
"option",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java#L2138-L2144 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/EmailUtils.java | EmailUtils.sendJobFailureAlertEmail | public static void sendJobFailureAlertEmail(String jobName, String message, int failures, State jobState)
throws EmailException {
"""
Send a job failure alert email.
@param jobName job name
@param message email message
@param failures number of consecutive job failures
@param jobState a {@link State} o... | java | public static void sendJobFailureAlertEmail(String jobName, String message, int failures, State jobState)
throws EmailException {
sendEmail(jobState, String.format("Gobblin alert: job %s has failed %d %s consecutively in the past", jobName,
failures, failures > 1 ? "times" : "time"), message);
} | [
"public",
"static",
"void",
"sendJobFailureAlertEmail",
"(",
"String",
"jobName",
",",
"String",
"message",
",",
"int",
"failures",
",",
"State",
"jobState",
")",
"throws",
"EmailException",
"{",
"sendEmail",
"(",
"jobState",
",",
"String",
".",
"format",
"(",
... | Send a job failure alert email.
@param jobName job name
@param message email message
@param failures number of consecutive job failures
@param jobState a {@link State} object carrying job configuration properties
@throws EmailException if there is anything wrong sending the email | [
"Send",
"a",
"job",
"failure",
"alert",
"email",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/EmailUtils.java#L120-L124 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java | SAX2DTM2.copyTextNode | protected final void copyTextNode(final int nodeID, SerializationHandler handler)
throws SAXException {
"""
Copy the String value of a Text node to a SerializationHandler
"""
if (nodeID != DTM.NULL) {
int dataIndex = m_dataOrQName.elementAt(nodeID);
if (dataIndex >= 0) {
... | java | protected final void copyTextNode(final int nodeID, SerializationHandler handler)
throws SAXException
{
if (nodeID != DTM.NULL) {
int dataIndex = m_dataOrQName.elementAt(nodeID);
if (dataIndex >= 0) {
m_chars.sendSAXcharacters(handler,
... | [
"protected",
"final",
"void",
"copyTextNode",
"(",
"final",
"int",
"nodeID",
",",
"SerializationHandler",
"handler",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"nodeID",
"!=",
"DTM",
".",
"NULL",
")",
"{",
"int",
"dataIndex",
"=",
"m_dataOrQName",
".",
"... | Copy the String value of a Text node to a SerializationHandler | [
"Copy",
"the",
"String",
"value",
"of",
"a",
"Text",
"node",
"to",
"a",
"SerializationHandler"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java#L3168-L3182 |
samskivert/samskivert | src/main/java/com/samskivert/util/ClassUtil.java | ClassUtil.getFields | public static void getFields (Class<?> clazz, List<Field> addTo) {
"""
Add all the fields of the specifed class (and its ancestors) to the list. Note, if we are
running in a sandbox, this will only enumerate public members.
"""
// first get the fields of the superclass
Class<?> pclazz = clazz.... | java | public static void getFields (Class<?> clazz, List<Field> addTo)
{
// first get the fields of the superclass
Class<?> pclazz = clazz.getSuperclass();
if (pclazz != null && !pclazz.equals(Object.class)) {
getFields(pclazz, addTo);
}
// then reflect on this class's... | [
"public",
"static",
"void",
"getFields",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"List",
"<",
"Field",
">",
"addTo",
")",
"{",
"// first get the fields of the superclass",
"Class",
"<",
"?",
">",
"pclazz",
"=",
"clazz",
".",
"getSuperclass",
"(",
")",
"... | Add all the fields of the specifed class (and its ancestors) to the list. Note, if we are
running in a sandbox, this will only enumerate public members. | [
"Add",
"all",
"the",
"fields",
"of",
"the",
"specifed",
"class",
"(",
"and",
"its",
"ancestors",
")",
"to",
"the",
"list",
".",
"Note",
"if",
"we",
"are",
"running",
"in",
"a",
"sandbox",
"this",
"will",
"only",
"enumerate",
"public",
"members",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ClassUtil.java#L48-L79 |
jbundle/jbundle | thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/BaseSessionProxy.java | BaseSessionProxy.doRemoteAction | public Object doRemoteAction(String strCommand, Map<String, Object> properties) throws DBException, RemoteException {
"""
Do a remote action.
@param strCommand Command to perform remotely.
@return boolean success.
"""
BaseTransport transport = this.createProxyTransport(DO_REMOTE_ACTION);
tran... | java | public Object doRemoteAction(String strCommand, Map<String, Object> properties) throws DBException, RemoteException
{
BaseTransport transport = this.createProxyTransport(DO_REMOTE_ACTION);
transport.addParam(NAME, strCommand); // Don't use COMMAND
transport.addParam(PROPERTIES, properties)... | [
"public",
"Object",
"doRemoteAction",
"(",
"String",
"strCommand",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"BaseTransport",
"transport",
"=",
"this",
".",
"createProxyTransport",
"(",
... | Do a remote action.
@param strCommand Command to perform remotely.
@return boolean success. | [
"Do",
"a",
"remote",
"action",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/BaseSessionProxy.java#L82-L96 |
TheHortonMachine/hortonmachine | gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java | GuiUtilities.colorButton | public static void colorButton( JButton button, Color color, Integer size ) {
"""
Create an image to make a color picker button.
@param button the button.
@param color the color to set.
@param size the optional size of the image.
"""
if (size == null)
size = 15;
BufferedImage b... | java | public static void colorButton( JButton button, Color color, Integer size ) {
if (size == null)
size = 15;
BufferedImage bi = new BufferedImage(size, size, BufferedImage.TYPE_INT_RGB);
Graphics2D gr = (Graphics2D) bi.getGraphics();
gr.setColor(color);
gr.fillRect(0, 0... | [
"public",
"static",
"void",
"colorButton",
"(",
"JButton",
"button",
",",
"Color",
"color",
",",
"Integer",
"size",
")",
"{",
"if",
"(",
"size",
"==",
"null",
")",
"size",
"=",
"15",
";",
"BufferedImage",
"bi",
"=",
"new",
"BufferedImage",
"(",
"size",
... | Create an image to make a color picker button.
@param button the button.
@param color the color to set.
@param size the optional size of the image. | [
"Create",
"an",
"image",
"to",
"make",
"a",
"color",
"picker",
"button",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gui/src/main/java/org/hortonmachine/gui/utils/GuiUtilities.java#L484-L494 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java | MathBindings.nextAfter | public static DoubleBinding nextAfter(final ObservableDoubleValue start, final ObservableDoubleValue direction) {
"""
Binding for {@link java.lang.Math#nextAfter(double, double)}
@param start starting floating-point value
@param direction value indicating which of
{@code start}'s neighbors or {@code start} s... | java | public static DoubleBinding nextAfter(final ObservableDoubleValue start, final ObservableDoubleValue direction) {
return createDoubleBinding(() -> Math.nextAfter(start.get(), direction.get()), start, direction);
} | [
"public",
"static",
"DoubleBinding",
"nextAfter",
"(",
"final",
"ObservableDoubleValue",
"start",
",",
"final",
"ObservableDoubleValue",
"direction",
")",
"{",
"return",
"createDoubleBinding",
"(",
"(",
")",
"->",
"Math",
".",
"nextAfter",
"(",
"start",
".",
"get"... | Binding for {@link java.lang.Math#nextAfter(double, double)}
@param start starting floating-point value
@param direction value indicating which of
{@code start}'s neighbors or {@code start} should
be returned
@return The floating-point number adjacent to {@code start} in the
direction of {@code direction}. | [
"Binding",
"for",
"{",
"@link",
"java",
".",
"lang",
".",
"Math#nextAfter",
"(",
"double",
"double",
")",
"}"
] | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java#L1084-L1086 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleCache.java | StyleCache.setFeatureStyle | public boolean setFeatureStyle(PolygonOptions polygonOptions, FeatureStyle featureStyle) {
"""
Set the feature style into the polygon options
@param polygonOptions polygon options
@param featureStyle feature style
@return true if style was set into the polygon options
"""
return StyleUtils.setFe... | java | public boolean setFeatureStyle(PolygonOptions polygonOptions, FeatureStyle featureStyle) {
return StyleUtils.setFeatureStyle(polygonOptions, featureStyle, density);
} | [
"public",
"boolean",
"setFeatureStyle",
"(",
"PolygonOptions",
"polygonOptions",
",",
"FeatureStyle",
"featureStyle",
")",
"{",
"return",
"StyleUtils",
".",
"setFeatureStyle",
"(",
"polygonOptions",
",",
"featureStyle",
",",
"density",
")",
";",
"}"
] | Set the feature style into the polygon options
@param polygonOptions polygon options
@param featureStyle feature style
@return true if style was set into the polygon options | [
"Set",
"the",
"feature",
"style",
"into",
"the",
"polygon",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleCache.java#L313-L315 |
camunda/camunda-bpm-jbehave | camunda-bpm-jbehave/src/main/java/org/camunda/bpm/data/Guards.java | Guards.checkIsSetLocal | public static void checkIsSetLocal(final DelegateExecution execution, final String variableName) {
"""
Checks, if a local variable with specified name is set.
@param execution
process execution.
@param variableName
name of the variable to check.
"""
Preconditions.checkArgument(variableName != null, V... | java | public static void checkIsSetLocal(final DelegateExecution execution, final String variableName) {
Preconditions.checkArgument(variableName != null, VARIABLE_NAME_MUST_BE_NOT_NULL);
final Object variableLocal = execution.getVariableLocal(variableName);
Preconditions.checkState(variableLocal != null,
... | [
"public",
"static",
"void",
"checkIsSetLocal",
"(",
"final",
"DelegateExecution",
"execution",
",",
"final",
"String",
"variableName",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"variableName",
"!=",
"null",
",",
"VARIABLE_NAME_MUST_BE_NOT_NULL",
")",
";",
... | Checks, if a local variable with specified name is set.
@param execution
process execution.
@param variableName
name of the variable to check. | [
"Checks",
"if",
"a",
"local",
"variable",
"with",
"specified",
"name",
"is",
"set",
"."
] | train | https://github.com/camunda/camunda-bpm-jbehave/blob/ffad22471418e2c7f161f8976ca8a042114138ab/camunda-bpm-jbehave/src/main/java/org/camunda/bpm/data/Guards.java#L62-L68 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_mailingList_mailingListAddress_DELETE | public OvhTask organizationName_service_exchangeService_mailingList_mailingListAddress_DELETE(String organizationName, String exchangeService, String mailingListAddress) throws IOException {
"""
Delete mailing list
REST: DELETE /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingLis... | java | public OvhTask organizationName_service_exchangeService_mailingList_mailingListAddress_DELETE(String organizationName, String exchangeService, String mailingListAddress) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}";
StringBuilder... | [
"public",
"OvhTask",
"organizationName_service_exchangeService_mailingList_mailingListAddress_DELETE",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"mailingListAddress",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/... | Delete mailing list
REST: DELETE /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service
@param mailingListAddress [requi... | [
"Delete",
"mailing",
"list"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L1354-L1359 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/Validate.java | Validate.isTrue | public static void isTrue(final boolean expression, final String message, final long value) {
"""
<p>Validate that the argument condition is {@code true}; otherwise
throwing an exception with the specified message. This method is useful when
validating according to an arbitrary boolean expression, such as valida... | java | public static void isTrue(final boolean expression, final String message, final long value) {
if (!expression) {
throw new IllegalArgumentException(StringUtils.simpleFormat(message, Long.valueOf(value)));
}
} | [
"public",
"static",
"void",
"isTrue",
"(",
"final",
"boolean",
"expression",
",",
"final",
"String",
"message",
",",
"final",
"long",
"value",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"StringUtils",
"... | <p>Validate that the argument condition is {@code true}; otherwise
throwing an exception with the specified message. This method is useful when
validating according to an arbitrary boolean expression, such as validating a
primitive number or using your own custom validation expression.</p>
<pre>Validate.isTrue(i > ... | [
"<p",
">",
"Validate",
"that",
"the",
"argument",
"condition",
"is",
"{",
"@code",
"true",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"This",
"method",
"is",
"useful",
"when",
"validating",
"according",
... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L109-L113 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withLong | public Postcard withLong(@Nullable String key, long value) {
"""
Inserts a long value into the mapping of this Bundle, replacing
any existing value for the given key.
@param key a String, or null
@param value a long
@return current
"""
mBundle.putLong(key, value);
return this;
} | java | public Postcard withLong(@Nullable String key, long value) {
mBundle.putLong(key, value);
return this;
} | [
"public",
"Postcard",
"withLong",
"(",
"@",
"Nullable",
"String",
"key",
",",
"long",
"value",
")",
"{",
"mBundle",
".",
"putLong",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a long value into the mapping of this Bundle, replacing
any existing value for the given key.
@param key a String, or null
@param value a long
@return current | [
"Inserts",
"a",
"long",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L296-L299 |
google/auto | value/src/main/java/com/google/auto/value/processor/ErrorReporter.java | ErrorReporter.reportWarning | void reportWarning(String msg, Element e) {
"""
Issue a compilation warning.
@param msg the text of the warning
@param e the element to which it pertains
"""
messager.printMessage(Diagnostic.Kind.WARNING, msg, e);
} | java | void reportWarning(String msg, Element e) {
messager.printMessage(Diagnostic.Kind.WARNING, msg, e);
} | [
"void",
"reportWarning",
"(",
"String",
"msg",
",",
"Element",
"e",
")",
"{",
"messager",
".",
"printMessage",
"(",
"Diagnostic",
".",
"Kind",
".",
"WARNING",
",",
"msg",
",",
"e",
")",
";",
"}"
] | Issue a compilation warning.
@param msg the text of the warning
@param e the element to which it pertains | [
"Issue",
"a",
"compilation",
"warning",
"."
] | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/value/src/main/java/com/google/auto/value/processor/ErrorReporter.java#L52-L54 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.