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 |
|---|---|---|---|---|---|---|---|---|---|---|
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/SystemExiter.java | SystemExiter.logAndExit | public static void logAndExit(ExitLogger logger, int status) {
"""
Calls {@link #logBeforeExit(ExitLogger)} and then invokes the {@link Exiter}.
@param logger logger the logger. Cannot be {@code null}
@param status the status code to provide to the exiter
"""
logBeforeExit(logger);
getExiter(... | java | public static void logAndExit(ExitLogger logger, int status) {
logBeforeExit(logger);
getExiter().exit(status);
// If we get here, the exiter didn't really exit. So we
// must be embedded or something, or perhaps in a test case
// Reset the logged flag so we can log again the nex... | [
"public",
"static",
"void",
"logAndExit",
"(",
"ExitLogger",
"logger",
",",
"int",
"status",
")",
"{",
"logBeforeExit",
"(",
"logger",
")",
";",
"getExiter",
"(",
")",
".",
"exit",
"(",
"status",
")",
";",
"// If we get here, the exiter didn't really exit. So we",... | Calls {@link #logBeforeExit(ExitLogger)} and then invokes the {@link Exiter}.
@param logger logger the logger. Cannot be {@code null}
@param status the status code to provide to the exiter | [
"Calls",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/SystemExiter.java#L96-L104 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/BermudanDigitalOption.java | BermudanDigitalOption.getValue | @Override
public RandomVariable getValue(double evaluationTime, AssetModelMonteCarloSimulationModel model) throws CalculationException {
"""
This method returns the value random variable of the product within the specified model,
evaluated at a given evalutationTime.
Cash-flows prior evaluationTime are not cons... | java | @Override
public RandomVariable getValue(double evaluationTime, AssetModelMonteCarloSimulationModel model) throws CalculationException {
if(exerciseMethod == ExerciseMethod.UPPER_BOUND_METHOD) {
// Find optimal lambda
GoldenSectionSearch optimizer = new GoldenSectionSearch(-1.0, 1.0);
while(!optimizer.isDon... | [
"@",
"Override",
"public",
"RandomVariable",
"getValue",
"(",
"double",
"evaluationTime",
",",
"AssetModelMonteCarloSimulationModel",
"model",
")",
"throws",
"CalculationException",
"{",
"if",
"(",
"exerciseMethod",
"==",
"ExerciseMethod",
".",
"UPPER_BOUND_METHOD",
")",
... | This method returns the value random variable of the product within the specified model,
evaluated at a given evalutationTime.
Cash-flows prior evaluationTime are not considered.
@param evaluationTime The time on which this products value should be observed.
@param model The model used to price the product.
@return Th... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Cash",
"-",
"flows",
"prior",
"evaluationTime",
"are",
"not",
"considered"... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/BermudanDigitalOption.java#L96-L111 |
oasp/oasp4j | modules/rest/src/main/java/io/oasp/module/rest/service/api/RequestParameters.java | RequestParameters.getList | public List<String> getList(String key) {
"""
Gets the {@link List} of all value for the parameter with with the given <code>key</code>. In general you should
avoid multi-valued parameters (e.g. http://host/path?query=a&query=b). The JAX-RS API supports this exotic case as
first citizen so we expose it here but ... | java | public List<String> getList(String key) {
List<String> list = this.parameters.get(key);
if (list == null) {
list = Collections.emptyList();
}
return list;
} | [
"public",
"List",
"<",
"String",
">",
"getList",
"(",
"String",
"key",
")",
"{",
"List",
"<",
"String",
">",
"list",
"=",
"this",
".",
"parameters",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"list",
"=",
"Collec... | Gets the {@link List} of all value for the parameter with with the given <code>key</code>. In general you should
avoid multi-valued parameters (e.g. http://host/path?query=a&query=b). The JAX-RS API supports this exotic case as
first citizen so we expose it here but only use it if you know exactly what you are doing.
... | [
"Gets",
"the",
"{",
"@link",
"List",
"}",
"of",
"all",
"value",
"for",
"the",
"parameter",
"with",
"with",
"the",
"given",
"<code",
">",
"key<",
"/",
"code",
">",
".",
"In",
"general",
"you",
"should",
"avoid",
"multi",
"-",
"valued",
"parameters",
"("... | train | https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/rest/src/main/java/io/oasp/module/rest/service/api/RequestParameters.java#L186-L193 |
gliga/ekstazi | org.ekstazi.core/src/main/java/org/ekstazi/agent/EkstaziAgent.java | EkstaziAgent.initSingleCoverageMode | private static boolean initSingleCoverageMode(final String runName, Instrumentation instrumentation) {
"""
Initialize SingleMode run. We first check if run is affected and
only in that case start coverage, otherwise we remove bodies of all main
methods to avoid any execution.
"""
// Check if run is a... | java | private static boolean initSingleCoverageMode(final String runName, Instrumentation instrumentation) {
// Check if run is affected and if not start coverage.
if (Ekstazi.inst().checkIfAffected(runName)) {
Ekstazi.inst().startCollectingDependencies(runName);
// End coverage when V... | [
"private",
"static",
"boolean",
"initSingleCoverageMode",
"(",
"final",
"String",
"runName",
",",
"Instrumentation",
"instrumentation",
")",
"{",
"// Check if run is affected and if not start coverage.",
"if",
"(",
"Ekstazi",
".",
"inst",
"(",
")",
".",
"checkIfAffected",... | Initialize SingleMode run. We first check if run is affected and
only in that case start coverage, otherwise we remove bodies of all main
methods to avoid any execution. | [
"Initialize",
"SingleMode",
"run",
".",
"We",
"first",
"check",
"if",
"run",
"is",
"affected",
"and",
"only",
"in",
"that",
"case",
"start",
"coverage",
"otherwise",
"we",
"remove",
"bodies",
"of",
"all",
"main",
"methods",
"to",
"avoid",
"any",
"execution",... | train | https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/agent/EkstaziAgent.java#L171-L187 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.fetchByG_Tw | @Override
public CommerceCountry fetchByG_Tw(long groupId, String twoLettersISOCode) {
"""
Returns the commerce country where groupId = ? and twoLettersISOCode = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param twoLettersISOCode the two... | java | @Override
public CommerceCountry fetchByG_Tw(long groupId, String twoLettersISOCode) {
return fetchByG_Tw(groupId, twoLettersISOCode, true);
} | [
"@",
"Override",
"public",
"CommerceCountry",
"fetchByG_Tw",
"(",
"long",
"groupId",
",",
"String",
"twoLettersISOCode",
")",
"{",
"return",
"fetchByG_Tw",
"(",
"groupId",
",",
"twoLettersISOCode",
",",
"true",
")",
";",
"}"
] | Returns the commerce country where groupId = ? and twoLettersISOCode = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param twoLettersISOCode the two letters iso code
@return the matching commerce country, or <code>null</code> if a matching commerce... | [
"Returns",
"the",
"commerce",
"country",
"where",
"groupId",
"=",
"?",
";",
"and",
"twoLettersISOCode",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder"... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L2044-L2047 |
aws/aws-sdk-java | aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/InputSecurityGroup.java | InputSecurityGroup.withTags | public InputSecurityGroup withTags(java.util.Map<String, String> tags) {
"""
A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public InputSecurityGroup withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"InputSecurityGroup",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together. | [
"A",
"collection",
"of",
"key",
"-",
"value",
"pairs",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/InputSecurityGroup.java#L252-L255 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java | ImageModerationsImpl.matchUrlInput | public MatchResponse matchUrlInput(String contentType, BodyModelModel imageUrl, MatchUrlInputOptionalParameter matchUrlInputOptionalParameter) {
"""
Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using <a href="/docs/services/578ff44d270374156856... | java | public MatchResponse matchUrlInput(String contentType, BodyModelModel imageUrl, MatchUrlInputOptionalParameter matchUrlInputOptionalParameter) {
return matchUrlInputWithServiceResponseAsync(contentType, imageUrl, matchUrlInputOptionalParameter).toBlocking().single().body();
} | [
"public",
"MatchResponse",
"matchUrlInput",
"(",
"String",
"contentType",
",",
"BodyModelModel",
"imageUrl",
",",
"MatchUrlInputOptionalParameter",
"matchUrlInputOptionalParameter",
")",
"{",
"return",
"matchUrlInputWithServiceResponseAsync",
"(",
"contentType",
",",
"imageUrl"... | Fuzzily match an image against one of your custom Image Lists. You can create and manage your custom image lists using <a href="/docs/services/578ff44d2703741568569ab9/operations/578ff7b12703741568569abe">this</a> API.
Returns ID and tags of matching image.<br/>
<br/>
Note: Refresh Index must be... | [
"Fuzzily",
"match",
"an",
"image",
"against",
"one",
"of",
"your",
"custom",
"Image",
"Lists",
".",
"You",
"can",
"create",
"and",
"manage",
"your",
"custom",
"image",
"lists",
"using",
"<",
";",
"a",
"href",
"=",
"/",
"docs",
"/",
"services",
"/",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L1753-L1755 |
michael-rapp/AndroidMaterialDialog | example/src/main/java/de/mrapp/android/dialog/example/PreferenceFragment.java | PreferenceFragment.addFragment | private void addFragment(@NonNull final WizardDialog.Builder builder, final int index) {
"""
Adds a new fragment to a builder, which allows to create wizard dialogs.
@param builder
The builder, the fragment should be added to, as an instance of the class {@link
WizardDialog.Builder}
@param index
The index o... | java | private void addFragment(@NonNull final WizardDialog.Builder builder, final int index) {
Bundle arguments = new Bundle();
arguments.putInt(DialogFragment.INDEX_EXTRA, index);
CharSequence title = shouldHeaderBeShown() ? null :
String.format(getString(R.string.dialog_tab_text), in... | [
"private",
"void",
"addFragment",
"(",
"@",
"NonNull",
"final",
"WizardDialog",
".",
"Builder",
"builder",
",",
"final",
"int",
"index",
")",
"{",
"Bundle",
"arguments",
"=",
"new",
"Bundle",
"(",
")",
";",
"arguments",
".",
"putInt",
"(",
"DialogFragment",
... | Adds a new fragment to a builder, which allows to create wizard dialogs.
@param builder
The builder, the fragment should be added to, as an instance of the class {@link
WizardDialog.Builder}
@param index
The index of the fragment, which should be added | [
"Adds",
"a",
"new",
"fragment",
"to",
"a",
"builder",
"which",
"allows",
"to",
"create",
"wizard",
"dialogs",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/example/src/main/java/de/mrapp/android/dialog/example/PreferenceFragment.java#L664-L670 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java | AbstractManagedConnectionPool.getCount | protected int getCount(int type, Collection<ConnectionListener> listeners) {
"""
Get count
@param type The type
@param listeners The listeners
@return The value
"""
int count = 0;
for (ConnectionListener cl : listeners)
{
if (cl.getState() == type)
count++;
}
... | java | protected int getCount(int type, Collection<ConnectionListener> listeners)
{
int count = 0;
for (ConnectionListener cl : listeners)
{
if (cl.getState() == type)
count++;
}
return count;
} | [
"protected",
"int",
"getCount",
"(",
"int",
"type",
",",
"Collection",
"<",
"ConnectionListener",
">",
"listeners",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"ConnectionListener",
"cl",
":",
"listeners",
")",
"{",
"if",
"(",
"cl",
".",
"getSta... | Get count
@param type The type
@param listeners The listeners
@return The value | [
"Get",
"count"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java#L235-L246 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java | MarshallUtil.marshallString | public static void marshallString(String string, ObjectOutput out) throws IOException {
"""
Marshall the {@link String}.
<p>
Same behavior as {@link ObjectOutput#writeUTF(String)} but it checks for {@code null}. If the {@code string} is
never {@code null}, it is better to use {@link ObjectOutput#writeUTF(String... | java | public static void marshallString(String string, ObjectOutput out) throws IOException {
if (string == null) {
out.writeBoolean(true);
return;
}
out.writeBoolean(false);
out.writeUTF(string);
} | [
"public",
"static",
"void",
"marshallString",
"(",
"String",
"string",
",",
"ObjectOutput",
"out",
")",
"throws",
"IOException",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"out",
".",
"writeBoolean",
"(",
"true",
")",
";",
"return",
";",
"}",
"out... | Marshall the {@link String}.
<p>
Same behavior as {@link ObjectOutput#writeUTF(String)} but it checks for {@code null}. If the {@code string} is
never {@code null}, it is better to use {@link ObjectOutput#writeUTF(String)}.
@param string {@link String} to marshall.
@param out {@link ObjectOutput} to write.
@throws ... | [
"Marshall",
"the",
"{",
"@link",
"String",
"}",
".",
"<p",
">",
"Same",
"behavior",
"as",
"{",
"@link",
"ObjectOutput#writeUTF",
"(",
"String",
")",
"}",
"but",
"it",
"checks",
"for",
"{",
"@code",
"null",
"}",
".",
"If",
"the",
"{",
"@code",
"string",... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java#L326-L333 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/PemPrivateKey.java | PemPrivateKey.toPEM | static PemEncoded toPEM(ByteBufAllocator allocator, boolean useDirect, PrivateKey key) {
"""
Creates a {@link PemEncoded} value from the {@link PrivateKey}.
"""
// We can take a shortcut if the private key happens to be already
// PEM/PKCS#8 encoded. This is the ideal case and reason why all
... | java | static PemEncoded toPEM(ByteBufAllocator allocator, boolean useDirect, PrivateKey key) {
// We can take a shortcut if the private key happens to be already
// PEM/PKCS#8 encoded. This is the ideal case and reason why all
// this exists. It allows the user to pass pre-encoded bytes straight
... | [
"static",
"PemEncoded",
"toPEM",
"(",
"ByteBufAllocator",
"allocator",
",",
"boolean",
"useDirect",
",",
"PrivateKey",
"key",
")",
"{",
"// We can take a shortcut if the private key happens to be already",
"// PEM/PKCS#8 encoded. This is the ideal case and reason why all",
"// this e... | Creates a {@link PemEncoded} value from the {@link PrivateKey}. | [
"Creates",
"a",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/PemPrivateKey.java#L54-L69 |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java | ControllerUtils.convertPathIdentifier | public static Integer convertPathIdentifier(String identifier, Integer profileId) throws Exception {
"""
Obtain the path ID for a profile
@param identifier Can be the path ID, or friendly name
@param profileId
@return
@throws Exception
"""
Integer pathId = -1;
try {
pathId = I... | java | public static Integer convertPathIdentifier(String identifier, Integer profileId) throws Exception {
Integer pathId = -1;
try {
pathId = Integer.parseInt(identifier);
} catch (NumberFormatException ne) {
// this is OK.. just means it's not a #
if (profileId ==... | [
"public",
"static",
"Integer",
"convertPathIdentifier",
"(",
"String",
"identifier",
",",
"Integer",
"profileId",
")",
"throws",
"Exception",
"{",
"Integer",
"pathId",
"=",
"-",
"1",
";",
"try",
"{",
"pathId",
"=",
"Integer",
".",
"parseInt",
"(",
"identifier"... | Obtain the path ID for a profile
@param identifier Can be the path ID, or friendly name
@param profileId
@return
@throws Exception | [
"Obtain",
"the",
"path",
"ID",
"for",
"a",
"profile"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java#L36-L49 |
ACRA/acra | acra-core/src/main/java/org/acra/collector/ReflectionCollector.java | ReflectionCollector.collectStaticGettersResults | private void collectStaticGettersResults(@NonNull Class<?> someClass, @NonNull JSONObject container) throws JSONException {
"""
Retrieves key/value pairs from static getters of a class (get*() or is*()).
@param someClass the class to be inspected.
"""
final Method[] methods = someClass.getMethods();... | java | private void collectStaticGettersResults(@NonNull Class<?> someClass, @NonNull JSONObject container) throws JSONException {
final Method[] methods = someClass.getMethods();
for (final Method method : methods) {
if (method.getParameterTypes().length == 0
&& (method.getName... | [
"private",
"void",
"collectStaticGettersResults",
"(",
"@",
"NonNull",
"Class",
"<",
"?",
">",
"someClass",
",",
"@",
"NonNull",
"JSONObject",
"container",
")",
"throws",
"JSONException",
"{",
"final",
"Method",
"[",
"]",
"methods",
"=",
"someClass",
".",
"get... | Retrieves key/value pairs from static getters of a class (get*() or is*()).
@param someClass the class to be inspected. | [
"Retrieves",
"key",
"/",
"value",
"pairs",
"from",
"static",
"getters",
"of",
"a",
"class",
"(",
"get",
"*",
"()",
"or",
"is",
"*",
"()",
")",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/collector/ReflectionCollector.java#L107-L124 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.savePGM | public static void savePGM(GrayU8 gray , String fileName ) throws IOException {
"""
Saves an image in PGM format.
@param gray Gray scale image
@param fileName Location where the image is to be written to.
@throws IOException Thrown if there is a problem reading the image
"""
File out = new File(fileName... | java | public static void savePGM(GrayU8 gray , String fileName ) throws IOException {
File out = new File(fileName);
DataOutputStream os = new DataOutputStream(new FileOutputStream(out));
String header = String.format("P5\n%d %d\n255\n", gray.width, gray.height);
os.write(header.getBytes());
os.write(gray.data,0,... | [
"public",
"static",
"void",
"savePGM",
"(",
"GrayU8",
"gray",
",",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"File",
"out",
"=",
"new",
"File",
"(",
"fileName",
")",
";",
"DataOutputStream",
"os",
"=",
"new",
"DataOutputStream",
"(",
"new",
... | Saves an image in PGM format.
@param gray Gray scale image
@param fileName Location where the image is to be written to.
@throws IOException Thrown if there is a problem reading the image | [
"Saves",
"an",
"image",
"in",
"PGM",
"format",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L500-L510 |
JM-Lab/utils-elasticsearch | src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchSearchAndCount.java | JMElasticsearchSearchAndCount.getSearchRequestBuilder | public SearchRequestBuilder getSearchRequestBuilder(QueryBuilder
queryBuilder, String... indices) {
"""
Gets search request builder.
@param queryBuilder the query builder
@param indices the indices
@return the search request builder
"""
return getSearchRequestBuilder(indices, null... | java | public SearchRequestBuilder getSearchRequestBuilder(QueryBuilder
queryBuilder, String... indices) {
return getSearchRequestBuilder(indices, null, queryBuilder);
} | [
"public",
"SearchRequestBuilder",
"getSearchRequestBuilder",
"(",
"QueryBuilder",
"queryBuilder",
",",
"String",
"...",
"indices",
")",
"{",
"return",
"getSearchRequestBuilder",
"(",
"indices",
",",
"null",
",",
"queryBuilder",
")",
";",
"}"
] | Gets search request builder.
@param queryBuilder the query builder
@param indices the indices
@return the search request builder | [
"Gets",
"search",
"request",
"builder",
"."
] | train | https://github.com/JM-Lab/utils-elasticsearch/blob/6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638/src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchSearchAndCount.java#L124-L127 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesInner.java | FavoritesInner.listAsync | public Observable<List<ApplicationInsightsComponentFavoriteInner>> listAsync(String resourceGroupName, String resourceName, FavoriteType favoriteType, FavoriteSourceType sourceType, Boolean canFetchContent, List<String> tags) {
"""
Gets a list of favorites defined within an Application Insights component.
@para... | java | public Observable<List<ApplicationInsightsComponentFavoriteInner>> listAsync(String resourceGroupName, String resourceName, FavoriteType favoriteType, FavoriteSourceType sourceType, Boolean canFetchContent, List<String> tags) {
return listWithServiceResponseAsync(resourceGroupName, resourceName, favoriteType, s... | [
"public",
"Observable",
"<",
"List",
"<",
"ApplicationInsightsComponentFavoriteInner",
">",
">",
"listAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"FavoriteType",
"favoriteType",
",",
"FavoriteSourceType",
"sourceType",
",",
"Boolean",
... | Gets a list of favorites defined within an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param favoriteType The type of favorite. Value can be either shared or user. Possible values include: 'shared... | [
"Gets",
"a",
"list",
"of",
"favorites",
"defined",
"within",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/FavoritesInner.java#L216-L223 |
jbundle/jbundle | base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java | ClientTable.setProperty | public void setProperty(String strProperty, String strValue) {
"""
Set a property for this table.
Usually used to Enable/Disable autosequence for this table.
<p />Sets the remote properties and also sets the local properties.
@param strProperty The key to set.
@param strValue The value to set.
"""
... | java | public void setProperty(String strProperty, String strValue)
{
try {
synchronized (this.getSyncObject())
{ // In case this is called from another task
m_tableRemote.setRemoteProperty(strProperty, strValue);
}
} catch (Exception ex) {
... | [
"public",
"void",
"setProperty",
"(",
"String",
"strProperty",
",",
"String",
"strValue",
")",
"{",
"try",
"{",
"synchronized",
"(",
"this",
".",
"getSyncObject",
"(",
")",
")",
"{",
"// In case this is called from another task",
"m_tableRemote",
".",
"setRemoteProp... | Set a property for this table.
Usually used to Enable/Disable autosequence for this table.
<p />Sets the remote properties and also sets the local properties.
@param strProperty The key to set.
@param strValue The value to set. | [
"Set",
"a",
"property",
"for",
"this",
"table",
".",
"Usually",
"used",
"to",
"Enable",
"/",
"Disable",
"autosequence",
"for",
"this",
"table",
".",
"<p",
"/",
">",
"Sets",
"the",
"remote",
"properties",
"and",
"also",
"sets",
"the",
"local",
"properties",... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java#L619-L630 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/cert/CertClient.java | CertClient.attachRequestToBody | private void attachRequestToBody(AbstractBceRequest request, InternalRequest httpRequest) {
"""
put json object into http content for put or post request.
@param request json object of rest request
@param httpRequest http request object
"""
byte[] content;
try {
content = Js... | java | private void attachRequestToBody(AbstractBceRequest request, InternalRequest httpRequest) {
byte[] content;
try {
content = JsonUtils.toJsonString(request).getBytes("utf-8");
} catch (UnsupportedEncodingException e) {
throw new BceClientException("utf-8 encoding not suppo... | [
"private",
"void",
"attachRequestToBody",
"(",
"AbstractBceRequest",
"request",
",",
"InternalRequest",
"httpRequest",
")",
"{",
"byte",
"[",
"]",
"content",
";",
"try",
"{",
"content",
"=",
"JsonUtils",
".",
"toJsonString",
"(",
"request",
")",
".",
"getBytes",... | put json object into http content for put or post request.
@param request json object of rest request
@param httpRequest http request object | [
"put",
"json",
"object",
"into",
"http",
"content",
"for",
"put",
"or",
"post",
"request",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/cert/CertClient.java#L124-L134 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.getUniqueCouponCodes | public Coupons getUniqueCouponCodes(final String couponCode, final QueryParams params) {
"""
Lookup all unique codes for a bulk coupon given query params.
@param couponCode String coupon code
@param params {@link QueryParams}
@return the unique coupon codes for the coupon code on success, null otherwise
"... | java | public Coupons getUniqueCouponCodes(final String couponCode, final QueryParams params) {
return doGET(Coupon.COUPON_RESOURCE + "/" + couponCode + Coupon.UNIQUE_CODES_RESOURCE,
Coupons.class, params);
} | [
"public",
"Coupons",
"getUniqueCouponCodes",
"(",
"final",
"String",
"couponCode",
",",
"final",
"QueryParams",
"params",
")",
"{",
"return",
"doGET",
"(",
"Coupon",
".",
"COUPON_RESOURCE",
"+",
"\"/\"",
"+",
"couponCode",
"+",
"Coupon",
".",
"UNIQUE_CODES_RESOURC... | Lookup all unique codes for a bulk coupon given query params.
@param couponCode String coupon code
@param params {@link QueryParams}
@return the unique coupon codes for the coupon code on success, null otherwise | [
"Lookup",
"all",
"unique",
"codes",
"for",
"a",
"bulk",
"coupon",
"given",
"query",
"params",
"."
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1743-L1746 |
haifengl/smile | math/src/main/java/smile/math/Math.java | Math.axpy | public static double[] axpy(double a, double[] x, double[] y) {
"""
Update an array by adding a multiple of another array y = a * x + y.
"""
if (x.length != y.length) {
throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
... | java | public static double[] axpy(double a, double[] x, double[] y) {
if (x.length != y.length) {
throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
}
for (int i = 0; i < x.length; i++) {
y[i] += a * x[i];
... | [
"public",
"static",
"double",
"[",
"]",
"axpy",
"(",
"double",
"a",
",",
"double",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"y",
")",
"{",
"if",
"(",
"x",
".",
"length",
"!=",
"y",
".",
"length",
")",
"{",
"throw",
"new",
"IllegalArgumentException",... | Update an array by adding a multiple of another array y = a * x + y. | [
"Update",
"an",
"array",
"by",
"adding",
"a",
"multiple",
"of",
"another",
"array",
"y",
"=",
"a",
"*",
"x",
"+",
"y",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/Math.java#L3806-L3816 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/internal/AbstractPendingLinkingCandidate.java | AbstractPendingLinkingCandidate.compareByArgumentTypes | protected CandidateCompareResult compareByArgumentTypes(AbstractPendingLinkingCandidate<?> other, int leftBoxing, int rightBoxing, int leftDemand, int rightDemand) {
"""
Compare this linking candidate with the given {@code other} candidate at {@code argumentIndex}
Returns {@code CandidateCompareResult#THIS} if ... | java | protected CandidateCompareResult compareByArgumentTypes(AbstractPendingLinkingCandidate<?> other, int leftBoxing, int rightBoxing, int leftDemand, int rightDemand) {
if (leftDemand != rightDemand) {
if (leftDemand < rightDemand)
return CandidateCompareResult.THIS;
return CandidateCompareResult.OTHER;
}
... | [
"protected",
"CandidateCompareResult",
"compareByArgumentTypes",
"(",
"AbstractPendingLinkingCandidate",
"<",
"?",
">",
"other",
",",
"int",
"leftBoxing",
",",
"int",
"rightBoxing",
",",
"int",
"leftDemand",
",",
"int",
"rightDemand",
")",
"{",
"if",
"(",
"leftDeman... | Compare this linking candidate with the given {@code other} candidate at {@code argumentIndex}
Returns {@code CandidateCompareResult#THIS} if this candidate is better, {@code CandidateCompareResult#OTHER} if the
right candidate was better, {@code CandidateCompareResult#AMBIGUOUS} if both candidates are valid
but ambig... | [
"Compare",
"this",
"linking",
"candidate",
"with",
"the",
"given",
"{",
"@code",
"other",
"}",
"candidate",
"at",
"{",
"@code",
"argumentIndex",
"}"
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/internal/AbstractPendingLinkingCandidate.java#L946-L953 |
Pi4J/pi4j | pi4j-device/src/main/java/com/pi4j/component/potentiometer/microchip/impl/MicrochipPotentiometerDeviceController.java | MicrochipPotentiometerDeviceController.setBit | private int setBit(final int mem, final int mask, final boolean value) {
"""
Sets or clears a bit in the given memory (integer).
@param mem The memory to modify
@param mask The mask which defines to bit to be set/cleared
@param value Whether to set the bit (true) or clear the bit (false)
@return The modified... | java | private int setBit(final int mem, final int mask, final boolean value) {
final int result;
if (value) {
result = mem | mask; // set bit by using OR
} else {
result = mem & ~mask; // clear bit by using AND with the inverted mask
}
return result;
} | [
"private",
"int",
"setBit",
"(",
"final",
"int",
"mem",
",",
"final",
"int",
"mask",
",",
"final",
"boolean",
"value",
")",
"{",
"final",
"int",
"result",
";",
"if",
"(",
"value",
")",
"{",
"result",
"=",
"mem",
"|",
"mask",
";",
"// set bit by using O... | Sets or clears a bit in the given memory (integer).
@param mem The memory to modify
@param mask The mask which defines to bit to be set/cleared
@param value Whether to set the bit (true) or clear the bit (false)
@return The modified memory | [
"Sets",
"or",
"clears",
"a",
"bit",
"in",
"the",
"given",
"memory",
"(",
"integer",
")",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-device/src/main/java/com/pi4j/component/potentiometer/microchip/impl/MicrochipPotentiometerDeviceController.java#L377-L387 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/io/serial/impl/SerialImpl.java | SerialImpl.write | @Override
public void write(byte[] data, int offset, int length) throws IllegalStateException, IOException {
"""
<p>Sends an array of bytes to the serial port/device identified by the given file descriptor.</p>
@param data
A ByteBuffer of data to be transmitted.
@param offset
The starting index (inclusiv... | java | @Override
public void write(byte[] data, int offset, int length) throws IllegalStateException, IOException{
// validate state
if (isClosed()) {
throw new IllegalStateException("Serial connection is not open; cannot 'write()'.");
}
// write serial data to transmit buffer
... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IllegalStateException",
",",
"IOException",
"{",
"// validate state",
"if",
"(",
"isClosed",
"(",
")",
")",
"{",
"throw",... | <p>Sends an array of bytes to the serial port/device identified by the given file descriptor.</p>
@param data
A ByteBuffer of data to be transmitted.
@param offset
The starting index (inclusive) in the array to send from.
@param length
The number of bytes from the byte array to transmit to the serial port.
@throws Ill... | [
"<p",
">",
"Sends",
"an",
"array",
"of",
"bytes",
"to",
"the",
"serial",
"port",
"/",
"device",
"identified",
"by",
"the",
"given",
"file",
"descriptor",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/io/serial/impl/SerialImpl.java#L722-L731 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.filter/src/com/ibm/ws/security/authentication/filter/internal/IPAddressRange.java | IPAddressRange.belowRange | public boolean belowRange(InetAddress ip) {
"""
Is the given ip address numerically below the address range?
Is it below ipLower?
@param ip
@return
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "belowRange, ip is " + ip);
Tr.debug(tc, "... | java | public boolean belowRange(InetAddress ip) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "belowRange, ip is " + ip);
Tr.debug(tc, "belowRange, ipLower is " + ipLower);
}
return lessThan(ip, ipLower);
} | [
"public",
"boolean",
"belowRange",
"(",
"InetAddress",
"ip",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"belowRange, ip is \"",
"... | Is the given ip address numerically below the address range?
Is it below ipLower?
@param ip
@return | [
"Is",
"the",
"given",
"ip",
"address",
"numerically",
"below",
"the",
"address",
"range?",
"Is",
"it",
"below",
"ipLower?"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.filter/src/com/ibm/ws/security/authentication/filter/internal/IPAddressRange.java#L248-L254 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/config/CommonConfigUtils.java | CommonConfigUtils.getRequiredConfigAttributeWithConfigId | public String getRequiredConfigAttributeWithConfigId(Map<String, Object> props, String key, String configId) {
"""
Returns the value for the configuration attribute matching the key provided. If the value does not exist or is empty, the
resulting value will be {@code null} and an error message will be logged.
... | java | public String getRequiredConfigAttributeWithConfigId(Map<String, Object> props, String key, String configId) {
return getRequiredConfigAttributeWithDefaultValueAndConfigId(props, key, null, configId);
} | [
"public",
"String",
"getRequiredConfigAttributeWithConfigId",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
",",
"String",
"key",
",",
"String",
"configId",
")",
"{",
"return",
"getRequiredConfigAttributeWithDefaultValueAndConfigId",
"(",
"props",
",",
"key"... | Returns the value for the configuration attribute matching the key provided. If the value does not exist or is empty, the
resulting value will be {@code null} and an error message will be logged. | [
"Returns",
"the",
"value",
"for",
"the",
"configuration",
"attribute",
"matching",
"the",
"key",
"provided",
".",
"If",
"the",
"value",
"does",
"not",
"exist",
"or",
"is",
"empty",
"the",
"resulting",
"value",
"will",
"be",
"{"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/config/CommonConfigUtils.java#L68-L70 |
database-rider/database-rider | rider-core/src/main/java/com/github/database/rider/core/api/dataset/ScriptableTable.java | ScriptableTable.getScriptResult | private Object getScriptResult(String script, ScriptEngine engine) throws ScriptException {
"""
Evaluates the script expression
@return script expression result
"""
String scriptToExecute = script.substring(script.indexOf(":") + 1);
return engine.eval(scriptToExecute);
} | java | private Object getScriptResult(String script, ScriptEngine engine) throws ScriptException {
String scriptToExecute = script.substring(script.indexOf(":") + 1);
return engine.eval(scriptToExecute);
} | [
"private",
"Object",
"getScriptResult",
"(",
"String",
"script",
",",
"ScriptEngine",
"engine",
")",
"throws",
"ScriptException",
"{",
"String",
"scriptToExecute",
"=",
"script",
".",
"substring",
"(",
"script",
".",
"indexOf",
"(",
"\":\"",
")",
"+",
"1",
")"... | Evaluates the script expression
@return script expression result | [
"Evaluates",
"the",
"script",
"expression"
] | train | https://github.com/database-rider/database-rider/blob/7545cc31118df9cfef3f89e27223b433a24fb5dd/rider-core/src/main/java/com/github/database/rider/core/api/dataset/ScriptableTable.java#L94-L97 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLNotEqual | public static void assertXMLNotEqual(String control, String test)
throws SAXException, IOException {
"""
Assert that two XML documents are NOT similar
@param control XML to be compared against
@param test XML to be tested
@throws SAXException
@throws IOException
"""
assertXMLNotEqual(null, ... | java | public static void assertXMLNotEqual(String control, String test)
throws SAXException, IOException {
assertXMLNotEqual(null, control, test);
} | [
"public",
"static",
"void",
"assertXMLNotEqual",
"(",
"String",
"control",
",",
"String",
"test",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"assertXMLNotEqual",
"(",
"null",
",",
"control",
",",
"test",
")",
";",
"}"
] | Assert that two XML documents are NOT similar
@param control XML to be compared against
@param test XML to be tested
@throws SAXException
@throws IOException | [
"Assert",
"that",
"two",
"XML",
"documents",
"are",
"NOT",
"similar"
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L281-L284 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.inbound.security/src/com/ibm/ws/jca/security/internal/J2CSecurityHelper.java | J2CSecurityHelper.validateCallbackInformation | private static boolean validateCallbackInformation(Hashtable<String, Object> credData, String securityName, Invocation isInvoked) {
"""
This method validates whether the user security name provided by the CallerPrincipalCallback and
the PasswordValidationCallback match. It does this check only in case the CallerP... | java | private static boolean validateCallbackInformation(Hashtable<String, Object> credData, String securityName, Invocation isInvoked) {
boolean status = true;
if (isInvoked == Invocation.CALLERPRINCIPALCALLBACK) {
String existingName = (String) credData.get(AttributeNameConstants.WSCREDENTIAL_SE... | [
"private",
"static",
"boolean",
"validateCallbackInformation",
"(",
"Hashtable",
"<",
"String",
",",
"Object",
">",
"credData",
",",
"String",
"securityName",
",",
"Invocation",
"isInvoked",
")",
"{",
"boolean",
"status",
"=",
"true",
";",
"if",
"(",
"isInvoked"... | This method validates whether the user security name provided by the CallerPrincipalCallback and
the PasswordValidationCallback match. It does this check only in case the CallerPrincipalCallback
was invoked prior to the current invocation of the PasswordValidationCallback.
@param credData The custom hashtable that wil... | [
"This",
"method",
"validates",
"whether",
"the",
"user",
"security",
"name",
"provided",
"by",
"the",
"CallerPrincipalCallback",
"and",
"the",
"PasswordValidationCallback",
"match",
".",
"It",
"does",
"this",
"check",
"only",
"in",
"case",
"the",
"CallerPrincipalCal... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.inbound.security/src/com/ibm/ws/jca/security/internal/J2CSecurityHelper.java#L643-L653 |
jbundle/jbundle | thin/base/screen/cal/grid/src/main/java/org/jbundle/thin/base/screen/cal/grid/CalendarThinTableModel.java | CalendarThinTableModel.getFieldListProxy | public CalendarItem getFieldListProxy(FieldList fieldList) {
"""
Create a CalendarItem Proxy using this field list.
Usually, you use CalendarItemFieldListProxy, or override it.
"""
return new CalendarItemFieldListProxy(fieldList, m_strStartDateTimeField, m_strEndDateTimeField, m_strDescriptionField, m... | java | public CalendarItem getFieldListProxy(FieldList fieldList)
{
return new CalendarItemFieldListProxy(fieldList, m_strStartDateTimeField, m_strEndDateTimeField, m_strDescriptionField, m_strStatusField);
} | [
"public",
"CalendarItem",
"getFieldListProxy",
"(",
"FieldList",
"fieldList",
")",
"{",
"return",
"new",
"CalendarItemFieldListProxy",
"(",
"fieldList",
",",
"m_strStartDateTimeField",
",",
"m_strEndDateTimeField",
",",
"m_strDescriptionField",
",",
"m_strStatusField",
")",... | Create a CalendarItem Proxy using this field list.
Usually, you use CalendarItemFieldListProxy, or override it. | [
"Create",
"a",
"CalendarItem",
"Proxy",
"using",
"this",
"field",
"list",
".",
"Usually",
"you",
"use",
"CalendarItemFieldListProxy",
"or",
"override",
"it",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/cal/grid/src/main/java/org/jbundle/thin/base/screen/cal/grid/CalendarThinTableModel.java#L129-L132 |
apache/groovy | src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java | ClassNodeUtils.addGeneratedInnerClass | public static void addGeneratedInnerClass(ClassNode cNode, ClassNode inner) {
"""
Add an inner class that is marked as @Generated.
@see org.codehaus.groovy.ast.ModuleNode#addClass(ClassNode)
"""
cNode.getModule().addClass(inner);
markAsGenerated(cNode, inner);
} | java | public static void addGeneratedInnerClass(ClassNode cNode, ClassNode inner) {
cNode.getModule().addClass(inner);
markAsGenerated(cNode, inner);
} | [
"public",
"static",
"void",
"addGeneratedInnerClass",
"(",
"ClassNode",
"cNode",
",",
"ClassNode",
"inner",
")",
"{",
"cNode",
".",
"getModule",
"(",
")",
".",
"addClass",
"(",
"inner",
")",
";",
"markAsGenerated",
"(",
"cNode",
",",
"inner",
")",
";",
"}"... | Add an inner class that is marked as @Generated.
@see org.codehaus.groovy.ast.ModuleNode#addClass(ClassNode) | [
"Add",
"an",
"inner",
"class",
"that",
"is",
"marked",
"as",
"@Generated",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java#L111-L114 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/HELM2NotationUtils.java | HELM2NotationUtils.changeIDs | private static String changeIDs(String text, Map<String, String> mapIds) {
"""
method to change the ids in a text according to map
@param text input text
@param mapIds Map of old Id's value and new Id's
@return text with changed ids
"""
String result = text;
for (String key : mapIds.keySet()) {
... | java | private static String changeIDs(String text, Map<String, String> mapIds) {
String result = text;
for (String key : mapIds.keySet()) {
result = result.replace(key, mapIds.get(key));
}
return result;
} | [
"private",
"static",
"String",
"changeIDs",
"(",
"String",
"text",
",",
"Map",
"<",
"String",
",",
"String",
">",
"mapIds",
")",
"{",
"String",
"result",
"=",
"text",
";",
"for",
"(",
"String",
"key",
":",
"mapIds",
".",
"keySet",
"(",
")",
")",
"{",... | method to change the ids in a text according to map
@param text input text
@param mapIds Map of old Id's value and new Id's
@return text with changed ids | [
"method",
"to",
"change",
"the",
"ids",
"in",
"a",
"text",
"according",
"to",
"map"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/HELM2NotationUtils.java#L341-L347 |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnGetRNNWorkspaceSize | public static int cudnnGetRNNWorkspaceSize(
cudnnHandle handle,
cudnnRNNDescriptor rnnDesc,
int seqLength,
cudnnTensorDescriptor[] xDesc,
long[] sizeInBytes) {
"""
dataType in weight descriptors and input descriptors is used to describe storage
"""
return che... | java | public static int cudnnGetRNNWorkspaceSize(
cudnnHandle handle,
cudnnRNNDescriptor rnnDesc,
int seqLength,
cudnnTensorDescriptor[] xDesc,
long[] sizeInBytes)
{
return checkResult(cudnnGetRNNWorkspaceSizeNative(handle, rnnDesc, seqLength, xDesc, sizeInBytes));
... | [
"public",
"static",
"int",
"cudnnGetRNNWorkspaceSize",
"(",
"cudnnHandle",
"handle",
",",
"cudnnRNNDescriptor",
"rnnDesc",
",",
"int",
"seqLength",
",",
"cudnnTensorDescriptor",
"[",
"]",
"xDesc",
",",
"long",
"[",
"]",
"sizeInBytes",
")",
"{",
"return",
"checkRes... | dataType in weight descriptors and input descriptors is used to describe storage | [
"dataType",
"in",
"weight",
"descriptors",
"and",
"input",
"descriptors",
"is",
"used",
"to",
"describe",
"storage"
] | train | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L3336-L3344 |
Clivern/Racter | src/main/java/com/clivern/racter/senders/templates/ReceiptTemplate.java | ReceiptTemplate.setAdjustment | public void setAdjustment(String name, String amount) {
"""
Set Adjustment
@param name the adjustment name
@param amount the adjustment amount
"""
HashMap<String, String> adjustment = new HashMap<String, String>();
adjustment.put("name", name);
adjustment.put("amount", amount);
... | java | public void setAdjustment(String name, String amount)
{
HashMap<String, String> adjustment = new HashMap<String, String>();
adjustment.put("name", name);
adjustment.put("amount", amount);
this.adjustments.add(adjustment);
} | [
"public",
"void",
"setAdjustment",
"(",
"String",
"name",
",",
"String",
"amount",
")",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"adjustment",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"adjustment",
".",
"put",
... | Set Adjustment
@param name the adjustment name
@param amount the adjustment amount | [
"Set",
"Adjustment"
] | train | https://github.com/Clivern/Racter/blob/bbde02f0c2a8a80653ad6b1607376d8408acd71c/src/main/java/com/clivern/racter/senders/templates/ReceiptTemplate.java#L186-L192 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java | TableKeysAndAttributes.withHashOnlyKeys | public TableKeysAndAttributes withHashOnlyKeys(String hashKeyName, Object ... hashKeyValues) {
"""
Used to specify multiple hash-only primary keys.
@param hashKeyName hash-only key name
@param hashKeyValues a list of hash key values
"""
if (hashKeyName == null)
throw new IllegalArgumentEx... | java | public TableKeysAndAttributes withHashOnlyKeys(String hashKeyName, Object ... hashKeyValues) {
if (hashKeyName == null)
throw new IllegalArgumentException();
PrimaryKey[] primaryKeys = new PrimaryKey[hashKeyValues.length];
for (int i=0; i < hashKeyValues.length; i++)
prim... | [
"public",
"TableKeysAndAttributes",
"withHashOnlyKeys",
"(",
"String",
"hashKeyName",
",",
"Object",
"...",
"hashKeyValues",
")",
"{",
"if",
"(",
"hashKeyName",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"PrimaryKey",
"[",
"]",
... | Used to specify multiple hash-only primary keys.
@param hashKeyName hash-only key name
@param hashKeyValues a list of hash key values | [
"Used",
"to",
"specify",
"multiple",
"hash",
"-",
"only",
"primary",
"keys",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/TableKeysAndAttributes.java#L84-L91 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/attributedefinition/producttypes/ProductTypeOptionUrl.java | ProductTypeOptionUrl.getOptionUrl | public static MozuUrl getOptionUrl(String attributeFQN, Integer productTypeId, String responseFields) {
"""
Get Resource Url for GetOption
@param attributeFQN Fully qualified name for an attribute.
@param productTypeId Identifier of the product type.
@param responseFields Filtering syntax appended to an API cal... | java | public static MozuUrl getOptionUrl(String attributeFQN, Integer productTypeId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options/{attributeFQN}?responseFields={responseFields}");
formatter.formatUrl("attribute... | [
"public",
"static",
"MozuUrl",
"getOptionUrl",
"(",
"String",
"attributeFQN",
",",
"Integer",
"productTypeId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/attributedefinition/product... | Get Resource Url for GetOption
@param attributeFQN Fully qualified name for an attribute.
@param productTypeId Identifier of the product type.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to re... | [
"Get",
"Resource",
"Url",
"for",
"GetOption"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/attributedefinition/producttypes/ProductTypeOptionUrl.java#L35-L42 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/ImgCompressUtils.java | ImgCompressUtils.imgCompressByScale | public static void imgCompressByScale(String srcFile, String desFile, double base, int wh, Float quality) {
"""
根据宽或者高和指定压缩质量进行等比例压缩,注意如果指定的宽或者高大于源图片的高或者宽,
那么压缩图片将直接使用源图片的宽高
@param srcFile 源图片地址
@param desFile 目标图片地址,包括图片名称
@param base 指定压缩后图片的宽或者高
@param wh 此参数用于指定base参数是宽还是高,该参数应由{@link ImgCompres... | java | public static void imgCompressByScale(String srcFile, String desFile, double base, int wh, Float quality) {
ImgCompressUtils.imgCompressByScale(srcFile, desFile, base, wh, quality, false);
} | [
"public",
"static",
"void",
"imgCompressByScale",
"(",
"String",
"srcFile",
",",
"String",
"desFile",
",",
"double",
"base",
",",
"int",
"wh",
",",
"Float",
"quality",
")",
"{",
"ImgCompressUtils",
".",
"imgCompressByScale",
"(",
"srcFile",
",",
"desFile",
","... | 根据宽或者高和指定压缩质量进行等比例压缩,注意如果指定的宽或者高大于源图片的高或者宽,
那么压缩图片将直接使用源图片的宽高
@param srcFile 源图片地址
@param desFile 目标图片地址,包括图片名称
@param base 指定压缩后图片的宽或者高
@param wh 此参数用于指定base参数是宽还是高,该参数应由{@link ImgCompressUtils}里的
静态常量指定
@param quality 指定压缩质量,范围[0.0,1.0],如果指定为null则按照默认值 | [
"根据宽或者高和指定压缩质量进行等比例压缩",
"注意如果指定的宽或者高大于源图片的高或者宽",
"那么压缩图片将直接使用源图片的宽高"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/ImgCompressUtils.java#L230-L232 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Project.java | Project.createTheme | public Theme createTheme(String name, Map<String, Object> attributes) {
"""
Create a new Theme in this Project.
@param name The initial name of the Theme.
@param attributes additional attributes for Theme.
@return A new Theme.
"""
return getInstance().create().theme(name, this, attributes);
... | java | public Theme createTheme(String name, Map<String, Object> attributes) {
return getInstance().create().theme(name, this, attributes);
} | [
"public",
"Theme",
"createTheme",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"return",
"getInstance",
"(",
")",
".",
"create",
"(",
")",
".",
"theme",
"(",
"name",
",",
"this",
",",
"attributes",
")",
... | Create a new Theme in this Project.
@param name The initial name of the Theme.
@param attributes additional attributes for Theme.
@return A new Theme. | [
"Create",
"a",
"new",
"Theme",
"in",
"this",
"Project",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Project.java#L251-L253 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/HelpParser.java | HelpParser.printHtmlPackageDir | public void printHtmlPackageDir(PrintWriter out, String strTag, String strParams, String strData) {
"""
Print the package as a directory (ie., app.test -> app/test).
"""
if (m_recDetail.getField("ClassPackage") != null)
{
String string = m_recDetail.getField("ClassPackage").toString... | java | public void printHtmlPackageDir(PrintWriter out, String strTag, String strParams, String strData)
{
if (m_recDetail.getField("ClassPackage") != null)
{
String string = m_recDetail.getField("ClassPackage").toString();
string = string.replace('.', '/');
out.print(st... | [
"public",
"void",
"printHtmlPackageDir",
"(",
"PrintWriter",
"out",
",",
"String",
"strTag",
",",
"String",
"strParams",
",",
"String",
"strData",
")",
"{",
"if",
"(",
"m_recDetail",
".",
"getField",
"(",
"\"ClassPackage\"",
")",
"!=",
"null",
")",
"{",
"Str... | Print the package as a directory (ie., app.test -> app/test). | [
"Print",
"the",
"package",
"as",
"a",
"directory",
"(",
"ie",
".",
"app",
".",
"test",
"-",
">",
"app",
"/",
"test",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/HelpParser.java#L148-L156 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/CommonUtils.java | CommonUtils.closeAndRethrow | public static RuntimeException closeAndRethrow(Closer closer, Throwable t) throws IOException {
"""
Closes the Closer and re-throws the Throwable. Any exceptions thrown while closing the Closer
will be added as suppressed exceptions to the Throwable. This method always throws the given
Throwable, wrapping it in ... | java | public static RuntimeException closeAndRethrow(Closer closer, Throwable t) throws IOException {
try {
throw closer.rethrow(t);
} finally {
closer.close();
}
} | [
"public",
"static",
"RuntimeException",
"closeAndRethrow",
"(",
"Closer",
"closer",
",",
"Throwable",
"t",
")",
"throws",
"IOException",
"{",
"try",
"{",
"throw",
"closer",
".",
"rethrow",
"(",
"t",
")",
";",
"}",
"finally",
"{",
"closer",
".",
"close",
"(... | Closes the Closer and re-throws the Throwable. Any exceptions thrown while closing the Closer
will be added as suppressed exceptions to the Throwable. This method always throws the given
Throwable, wrapping it in a RuntimeException if it's a non-IOException checked exception.
Note: This method will wrap non-IOExceptio... | [
"Closes",
"the",
"Closer",
"and",
"re",
"-",
"throws",
"the",
"Throwable",
".",
"Any",
"exceptions",
"thrown",
"while",
"closing",
"the",
"Closer",
"will",
"be",
"added",
"as",
"suppressed",
"exceptions",
"to",
"the",
"Throwable",
".",
"This",
"method",
"alw... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L536-L542 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/service/ActiveRepairService.java | ActiveRepairService.submitRepairSession | public RepairFuture submitRepairSession(UUID parentRepairSession, Range<Token> range, String keyspace, RepairParallelism parallelismDegree, Set<InetAddress> endpoints, String... cfnames) {
"""
Requests repairs for the given keyspace and column families.
@return Future for asynchronous call or null if there is n... | java | public RepairFuture submitRepairSession(UUID parentRepairSession, Range<Token> range, String keyspace, RepairParallelism parallelismDegree, Set<InetAddress> endpoints, String... cfnames)
{
if (cfnames.length == 0)
return null;
RepairSession session = new RepairSession(parentRepairSession... | [
"public",
"RepairFuture",
"submitRepairSession",
"(",
"UUID",
"parentRepairSession",
",",
"Range",
"<",
"Token",
">",
"range",
",",
"String",
"keyspace",
",",
"RepairParallelism",
"parallelismDegree",
",",
"Set",
"<",
"InetAddress",
">",
"endpoints",
",",
"String",
... | Requests repairs for the given keyspace and column families.
@return Future for asynchronous call or null if there is no need to repair | [
"Requests",
"repairs",
"for",
"the",
"given",
"keyspace",
"and",
"column",
"families",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/service/ActiveRepairService.java#L123-L133 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/InstructionsOutgoingEdges.java | InstructionsOutgoingEdges.isLeavingCurrentStreet | public boolean isLeavingCurrentStreet(String prevName, String name) {
"""
If the name and prevName changes this method checks if either the current street is continued on a
different edge or if the edge we are turning onto is continued on a different edge.
If either of these properties is true, we can be quite c... | java | public boolean isLeavingCurrentStreet(String prevName, String name) {
if (InstructionsHelper.isNameSimilar(name, prevName)) {
return false;
}
// If flags are changing, there might be a chance we find these flags on a different edge
boolean checkFlag = currentEdge.getFlags() ... | [
"public",
"boolean",
"isLeavingCurrentStreet",
"(",
"String",
"prevName",
",",
"String",
"name",
")",
"{",
"if",
"(",
"InstructionsHelper",
".",
"isNameSimilar",
"(",
"name",
",",
"prevName",
")",
")",
"{",
"return",
"false",
";",
"}",
"// If flags are changing,... | If the name and prevName changes this method checks if either the current street is continued on a
different edge or if the edge we are turning onto is continued on a different edge.
If either of these properties is true, we can be quite certain that a turn instruction should be provided. | [
"If",
"the",
"name",
"and",
"prevName",
"changes",
"this",
"method",
"checks",
"if",
"either",
"the",
"current",
"street",
"is",
"continued",
"on",
"a",
"different",
"edge",
"or",
"if",
"the",
"edge",
"we",
"are",
"turning",
"onto",
"is",
"continued",
"on"... | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/InstructionsOutgoingEdges.java#L181-L198 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java | Node.getSubscriptionOptions | public SubscribeForm getSubscriptionOptions(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Get the options for configuring the specified subscription.
@param jid JID the subscription is registered under
@param subscriptionId ... | java | public SubscribeForm getSubscriptionOptions(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub packet = sendPubsubPacket(createPubsubPacket(Type.get, new OptionsExtension(jid, getId(), subscriptionId)));
FormNode ext = ... | [
"public",
"SubscribeForm",
"getSubscriptionOptions",
"(",
"String",
"jid",
",",
"String",
"subscriptionId",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"PubSub",
"packet",
"=",
"sendPubsu... | Get the options for configuring the specified subscription.
@param jid JID the subscription is registered under
@param subscriptionId The subscription id
@return The subscription option form
@throws XMPPErrorException
@throws NoResponseException
@throws NotConnectedException
@throws InterruptedException | [
"Get",
"the",
"options",
"for",
"configuring",
"the",
"specified",
"subscription",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java#L484-L488 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ServiceAccount.java | ServiceAccount.of | public static ServiceAccount of(String email, String... scopes) {
"""
Returns a {@code ServiceAccount} object for the provided email and scopes.
"""
return of(email, Arrays.asList(scopes));
} | java | public static ServiceAccount of(String email, String... scopes) {
return of(email, Arrays.asList(scopes));
} | [
"public",
"static",
"ServiceAccount",
"of",
"(",
"String",
"email",
",",
"String",
"...",
"scopes",
")",
"{",
"return",
"of",
"(",
"email",
",",
"Arrays",
".",
"asList",
"(",
"scopes",
")",
")",
";",
"}"
] | Returns a {@code ServiceAccount} object for the provided email and scopes. | [
"Returns",
"a",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ServiceAccount.java#L103-L105 |
e-biz/spring-dbunit | spring-dbunit-core/src/main/java/com/excilys/ebi/spring/dbunit/dataset/xml/flyweight/FlyWeightFlatXmlProducer.java | FlyWeightFlatXmlProducer.mergeTableMetaData | private ITableMetaData mergeTableMetaData(List<Column> columnsToMerge, ITableMetaData originalMetaData) throws DataSetException {
"""
merges the existing columns with the potentially new ones.
@param columnsToMerge List of extra columns found, which need to be merge back into the metadata.
@return ITableMetaDa... | java | private ITableMetaData mergeTableMetaData(List<Column> columnsToMerge, ITableMetaData originalMetaData) throws DataSetException {
Column[] columns = new Column[originalMetaData.getColumns().length + columnsToMerge.size()];
System.arraycopy(originalMetaData.getColumns(), 0, columns, 0, originalMetaData.g... | [
"private",
"ITableMetaData",
"mergeTableMetaData",
"(",
"List",
"<",
"Column",
">",
"columnsToMerge",
",",
"ITableMetaData",
"originalMetaData",
")",
"throws",
"DataSetException",
"{",
"Column",
"[",
"]",
"columns",
"=",
"new",
"Column",
"[",
"originalMetaData",
"."... | merges the existing columns with the potentially new ones.
@param columnsToMerge List of extra columns found, which need to be merge back into the metadata.
@return ITableMetaData The merged metadata object containing the new columns
@throws DataSetException | [
"merges",
"the",
"existing",
"columns",
"with",
"the",
"potentially",
"new",
"ones",
"."
] | train | https://github.com/e-biz/spring-dbunit/blob/1ec51222ecdd5dbd6daa4bd6879c6eabe76dfb6b/spring-dbunit-core/src/main/java/com/excilys/ebi/spring/dbunit/dataset/xml/flyweight/FlyWeightFlatXmlProducer.java#L227-L237 |
wcm-io/wcm-io-handler | link/src/main/java/io/wcm/handler/link/type/ExternalLinkType.java | ExternalLinkType.getSyntheticLinkResource | public static @NotNull Resource getSyntheticLinkResource(@NotNull ResourceResolver resourceResolver, @NotNull String url) {
"""
Get synthetic link resource for this link type.
@param resourceResolver Resource resolver
@param url Link URL
@return Synthetic link resource
"""
Map<String, Object> map = new ... | java | public static @NotNull Resource getSyntheticLinkResource(@NotNull ResourceResolver resourceResolver, @NotNull String url) {
Map<String, Object> map = new HashMap<>();
map.put(LinkNameConstants.PN_LINK_TYPE, ID);
map.put(LinkNameConstants.PN_LINK_EXTERNAL_REF, url);
return new SyntheticLinkResource(resou... | [
"public",
"static",
"@",
"NotNull",
"Resource",
"getSyntheticLinkResource",
"(",
"@",
"NotNull",
"ResourceResolver",
"resourceResolver",
",",
"@",
"NotNull",
"String",
"url",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<>... | Get synthetic link resource for this link type.
@param resourceResolver Resource resolver
@param url Link URL
@return Synthetic link resource | [
"Get",
"synthetic",
"link",
"resource",
"for",
"this",
"link",
"type",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/link/src/main/java/io/wcm/handler/link/type/ExternalLinkType.java#L113-L118 |
mozilla/rhino | src/org/mozilla/javascript/UintMap.java | UintMap.put | public void put(int key, Object value) {
"""
Set object value of the key.
If key does not exist, also set its int value to 0.
"""
if (key < 0) Kit.codeBug();
int index = ensureIndex(key, false);
if (values == null) {
values = new Object[1 << power];
}
values... | java | public void put(int key, Object value) {
if (key < 0) Kit.codeBug();
int index = ensureIndex(key, false);
if (values == null) {
values = new Object[1 << power];
}
values[index] = value;
} | [
"public",
"void",
"put",
"(",
"int",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"key",
"<",
"0",
")",
"Kit",
".",
"codeBug",
"(",
")",
";",
"int",
"index",
"=",
"ensureIndex",
"(",
"key",
",",
"false",
")",
";",
"if",
"(",
"values",
"=... | Set object value of the key.
If key does not exist, also set its int value to 0. | [
"Set",
"object",
"value",
"of",
"the",
"key",
".",
"If",
"key",
"does",
"not",
"exist",
"also",
"set",
"its",
"int",
"value",
"to",
"0",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/UintMap.java#L113-L120 |
sgroschupf/zkclient | src/main/java/org/I0Itec/zkclient/ZkClient.java | ZkClient.getAcl | public Map.Entry<List<ACL>, Stat> getAcl(final String path) throws ZkException {
"""
Gets the acl on path
@param path
@return an entry instance with key = list of acls on node and value = stats.
@throws ZkException
if any ZooKeeper exception occurred
@throws RuntimeException
if any other exception occurs
... | java | public Map.Entry<List<ACL>, Stat> getAcl(final String path) throws ZkException {
if (path == null) {
throw new NullPointerException("Missing value for path");
}
if (!exists(path)) {
throw new RuntimeException("trying to get acls on non existing node " + path);
}
... | [
"public",
"Map",
".",
"Entry",
"<",
"List",
"<",
"ACL",
">",
",",
"Stat",
">",
"getAcl",
"(",
"final",
"String",
"path",
")",
"throws",
"ZkException",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Missi... | Gets the acl on path
@param path
@return an entry instance with key = list of acls on node and value = stats.
@throws ZkException
if any ZooKeeper exception occurred
@throws RuntimeException
if any other exception occurs | [
"Gets",
"the",
"acl",
"on",
"path"
] | train | https://github.com/sgroschupf/zkclient/blob/03ccf12c70aca2f771bfcd94d44dc7c4d4a1495e/src/main/java/org/I0Itec/zkclient/ZkClient.java#L354-L369 |
gresrun/jesque | src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java | ReflectionUtils.isAssignable | public static boolean isAssignable(final Class<?> lhsType, final Class<?> rhsType) {
"""
Check if the right-hand side type may be assigned to the left-hand side
type, assuming setting by reflection. Considers primitive wrapper classes
as assignable to the corresponding primitive types.
@param lhsType
the tar... | java | public static boolean isAssignable(final Class<?> lhsType, final Class<?> rhsType) {
final boolean assignable;
if (lhsType.isAssignableFrom(rhsType)) {
assignable = true;
} else if (lhsType.isPrimitive()) {
final Class<?> resolvedPrimitive = wrapperTypeToPrimitiveMap.get(... | [
"public",
"static",
"boolean",
"isAssignable",
"(",
"final",
"Class",
"<",
"?",
">",
"lhsType",
",",
"final",
"Class",
"<",
"?",
">",
"rhsType",
")",
"{",
"final",
"boolean",
"assignable",
";",
"if",
"(",
"lhsType",
".",
"isAssignableFrom",
"(",
"rhsType",... | Check if the right-hand side type may be assigned to the left-hand side
type, assuming setting by reflection. Considers primitive wrapper classes
as assignable to the corresponding primitive types.
@param lhsType
the target type
@param rhsType
the value type that should be assigned to the target type
@return if the ta... | [
"Check",
"if",
"the",
"right",
"-",
"hand",
"side",
"type",
"may",
"be",
"assigned",
"to",
"the",
"left",
"-",
"hand",
"side",
"type",
"assuming",
"setting",
"by",
"reflection",
".",
"Considers",
"primitive",
"wrapper",
"classes",
"as",
"assignable",
"to",
... | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java#L274-L286 |
JodaOrg/joda-time | src/main/java/org/joda/time/LocalDate.java | LocalDate.toDateTimeAtCurrentTime | public DateTime toDateTimeAtCurrentTime(DateTimeZone zone) {
"""
Converts this LocalDate to a full datetime using the specified time zone
setting the date fields from this instance and the time fields from
the current time.
<p>
This method uses the chronology from this instance plus the time zone
specified.
... | java | public DateTime toDateTimeAtCurrentTime(DateTimeZone zone) {
zone = DateTimeUtils.getZone(zone);
Chronology chrono = getChronology().withZone(zone);
long instantMillis = DateTimeUtils.currentTimeMillis();
long resolved = chrono.set(this, instantMillis);
return new DateTime(resolv... | [
"public",
"DateTime",
"toDateTimeAtCurrentTime",
"(",
"DateTimeZone",
"zone",
")",
"{",
"zone",
"=",
"DateTimeUtils",
".",
"getZone",
"(",
"zone",
")",
";",
"Chronology",
"chrono",
"=",
"getChronology",
"(",
")",
".",
"withZone",
"(",
"zone",
")",
";",
"long... | Converts this LocalDate to a full datetime using the specified time zone
setting the date fields from this instance and the time fields from
the current time.
<p>
This method uses the chronology from this instance plus the time zone
specified.
<p>
This method will throw an exception if the datetime that would be
create... | [
"Converts",
"this",
"LocalDate",
"to",
"a",
"full",
"datetime",
"using",
"the",
"specified",
"time",
"zone",
"setting",
"the",
"date",
"fields",
"from",
"this",
"instance",
"and",
"the",
"time",
"fields",
"from",
"the",
"current",
"time",
".",
"<p",
">",
"... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDate.java#L814-L820 |
l0s/fernet-java8 | fernet-java8/src/main/java/com/macasaet/fernet/Key.java | Key.generateKey | public static Key generateKey(final Random random) {
"""
Generate a random key
@param random
source of entropy
@return a new shared secret key
"""
final byte[] signingKey = new byte[signingKeyBytes];
random.nextBytes(signingKey);
final byte[] encryptionKey = new byte[encryptionKeyB... | java | public static Key generateKey(final Random random) {
final byte[] signingKey = new byte[signingKeyBytes];
random.nextBytes(signingKey);
final byte[] encryptionKey = new byte[encryptionKeyBytes];
random.nextBytes(encryptionKey);
return new Key(signingKey, encryptionKey);
} | [
"public",
"static",
"Key",
"generateKey",
"(",
"final",
"Random",
"random",
")",
"{",
"final",
"byte",
"[",
"]",
"signingKey",
"=",
"new",
"byte",
"[",
"signingKeyBytes",
"]",
";",
"random",
".",
"nextBytes",
"(",
"signingKey",
")",
";",
"final",
"byte",
... | Generate a random key
@param random
source of entropy
@return a new shared secret key | [
"Generate",
"a",
"random",
"key"
] | train | https://github.com/l0s/fernet-java8/blob/427244bc1af605ffca0ac2469d66b297ea9f77b3/fernet-java8/src/main/java/com/macasaet/fernet/Key.java#L109-L115 |
google/closure-templates | java/src/com/google/template/soy/data/SanitizedContents.java | SanitizedContents.constantUri | public static SanitizedContent constantUri(@CompileTimeConstant final String constant) {
"""
Wraps an assumed-safe URI constant.
<p>This only accepts compile-time constants, based on the assumption that URLs that are
controlled by the application (and not user input) are considered safe.
"""
return fro... | java | public static SanitizedContent constantUri(@CompileTimeConstant final String constant) {
return fromConstant(constant, ContentKind.URI, Dir.LTR);
} | [
"public",
"static",
"SanitizedContent",
"constantUri",
"(",
"@",
"CompileTimeConstant",
"final",
"String",
"constant",
")",
"{",
"return",
"fromConstant",
"(",
"constant",
",",
"ContentKind",
".",
"URI",
",",
"Dir",
".",
"LTR",
")",
";",
"}"
] | Wraps an assumed-safe URI constant.
<p>This only accepts compile-time constants, based on the assumption that URLs that are
controlled by the application (and not user input) are considered safe. | [
"Wraps",
"an",
"assumed",
"-",
"safe",
"URI",
"constant",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SanitizedContents.java#L188-L190 |
paypal/SeLion | server/src/main/java/com/paypal/selion/utils/ServletHelper.java | ServletHelper.respondAsJsonWithHttpStatus | public static void respondAsJsonWithHttpStatus(HttpServletResponse resp, Object response, int statusCode)
throws IOException {
"""
Sends a HTTP response as a application/json document and with a HTTP status code.
@param resp
A {@link HttpServletResponse} object that the servlet is responding on.
@... | java | public static void respondAsJsonWithHttpStatus(HttpServletResponse resp, Object response, int statusCode)
throws IOException {
String json = new GsonBuilder().serializeNulls().create().toJson(response);
String jsonUtf8 = new String(json.getBytes(), "UTF-8");
resp.setContentType("appl... | [
"public",
"static",
"void",
"respondAsJsonWithHttpStatus",
"(",
"HttpServletResponse",
"resp",
",",
"Object",
"response",
",",
"int",
"statusCode",
")",
"throws",
"IOException",
"{",
"String",
"json",
"=",
"new",
"GsonBuilder",
"(",
")",
".",
"serializeNulls",
"("... | Sends a HTTP response as a application/json document and with a HTTP status code.
@param resp
A {@link HttpServletResponse} object that the servlet is responding on.
@param response
The response object which will be serialized to a JSON document
@param statusCode
The HTTP status code to send with the response
@throws ... | [
"Sends",
"a",
"HTTP",
"response",
"as",
"a",
"application",
"/",
"json",
"document",
"and",
"with",
"a",
"HTTP",
"status",
"code",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/utils/ServletHelper.java#L74-L83 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/adminuser/TenantAdminUserAuthTicketUrl.java | TenantAdminUserAuthTicketUrl.createUserAuthTicketUrl | public static MozuUrl createUserAuthTicketUrl(String responseFields, Integer tenantId) {
"""
Get Resource Url for CreateUserAuthTicket
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retr... | java | public static MozuUrl createUserAuthTicketUrl(String responseFields, Integer tenantId)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/adminuser/authtickets/tenants?tenantId={tenantId}&responseFields={responseFields}");
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("te... | [
"public",
"static",
"MozuUrl",
"createUserAuthTicketUrl",
"(",
"String",
"responseFields",
",",
"Integer",
"tenantId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/adminuser/authtickets/tenants?tenantId={tenantId}&responseFields={respon... | Get Resource Url for CreateUserAuthTicket
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@param tenantId Uniq... | [
"Get",
"Resource",
"Url",
"for",
"CreateUserAuthTicket"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/adminuser/TenantAdminUserAuthTicketUrl.java#L22-L28 |
elki-project/elki | addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTree.java | AbstractXTree.overflowTreatment | private N overflowTreatment(N node, IndexTreePath<SpatialEntry> path, int[] splitAxis) {
"""
Treatment of overflow in the specified node: if the node is not the root
node and this is the first call of overflowTreatment in the given level
during insertion the specified node will be reinserted, otherwise the node
... | java | private N overflowTreatment(N node, IndexTreePath<SpatialEntry> path, int[] splitAxis) {
if(node.isSuperNode()) {
// only extend supernode; no re-insertions
assert node.getCapacity() == node.getNumEntries();
assert node.getCapacity() > dirCapacity;
node.growSuperNode();
return null;
... | [
"private",
"N",
"overflowTreatment",
"(",
"N",
"node",
",",
"IndexTreePath",
"<",
"SpatialEntry",
">",
"path",
",",
"int",
"[",
"]",
"splitAxis",
")",
"{",
"if",
"(",
"node",
".",
"isSuperNode",
"(",
")",
")",
"{",
"// only extend supernode; no re-insertions",... | Treatment of overflow in the specified node: if the node is not the root
node and this is the first call of overflowTreatment in the given level
during insertion the specified node will be reinserted, otherwise the node
will be split.
@param node the node where an overflow occurred
@param path the path to the specifie... | [
"Treatment",
"of",
"overflow",
"in",
"the",
"specified",
"node",
":",
"if",
"the",
"node",
"is",
"not",
"the",
"root",
"node",
"and",
"this",
"is",
"the",
"first",
"call",
"of",
"overflowTreatment",
"in",
"the",
"given",
"level",
"during",
"insertion",
"th... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTree.java#L821-L834 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java | SpiceManager.removeDataFromCache | public <T> Future<?> removeDataFromCache(final Class<T> clazz, final Object cacheKey) {
"""
Remove some specific content from cache
@param clazz
the Type of data you want to remove from cache
@param cacheKey
the key of the object in cache
"""
if (clazz == null || cacheKey == null) {
thr... | java | public <T> Future<?> removeDataFromCache(final Class<T> clazz, final Object cacheKey) {
if (clazz == null || cacheKey == null) {
throw new IllegalArgumentException("Both parameters must be non null.");
}
return executeCommand(new RemoveDataFromCacheCommand(this, clazz, cacheKey));
... | [
"public",
"<",
"T",
">",
"Future",
"<",
"?",
">",
"removeDataFromCache",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"cacheKey",
")",
"{",
"if",
"(",
"clazz",
"==",
"null",
"||",
"cacheKey",
"==",
"null",
")",
"{",
"throw",... | Remove some specific content from cache
@param clazz
the Type of data you want to remove from cache
@param cacheKey
the key of the object in cache | [
"Remove",
"some",
"specific",
"content",
"from",
"cache"
] | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L976-L982 |
joniles/mpxj | src/main/java/net/sf/mpxj/common/FieldTypeHelper.java | FieldTypeHelper.valueIsNotDefault | public static final boolean valueIsNotDefault(FieldType type, Object value) {
"""
Determines if this value is the default value for the given field type.
@param type field type
@param value value
@return true if the value is not default
"""
boolean result = true;
if (value == null)
{
... | java | public static final boolean valueIsNotDefault(FieldType type, Object value)
{
boolean result = true;
if (value == null)
{
result = false;
}
else
{
DataType dataType = type.getDataType();
switch (dataType)
{
case BOOLEAN:
... | [
"public",
"static",
"final",
"boolean",
"valueIsNotDefault",
"(",
"FieldType",
"type",
",",
"Object",
"value",
")",
"{",
"boolean",
"result",
"=",
"true",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"result",
"=",
"false",
";",
"}",
"else",
"{",
"... | Determines if this value is the default value for the given field type.
@param type field type
@param value value
@return true if the value is not default | [
"Determines",
"if",
"this",
"value",
"is",
"the",
"default",
"value",
"for",
"the",
"given",
"field",
"type",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/common/FieldTypeHelper.java#L313-L353 |
networknt/light-4j | dump/src/main/java/com/networknt/dump/DumpHelper.java | DumpHelper.getTabBasedOnLevel | private static String getTabBasedOnLevel(int level, int indentSize) {
"""
calculate indent for formatting
@return " " string of empty spaces
"""
StringBuilder sb = new StringBuilder();
for(int i = 0; i < level; i ++) {
for(int j = 0; j < indentSize; j++) {
sb.appe... | java | private static String getTabBasedOnLevel(int level, int indentSize) {
StringBuilder sb = new StringBuilder();
for(int i = 0; i < level; i ++) {
for(int j = 0; j < indentSize; j++) {
sb.append(" ");
}
}
return sb.toString();
} | [
"private",
"static",
"String",
"getTabBasedOnLevel",
"(",
"int",
"level",
",",
"int",
"indentSize",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"level",
";",
"i",
"++",
... | calculate indent for formatting
@return " " string of empty spaces | [
"calculate",
"indent",
"for",
"formatting"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/DumpHelper.java#L101-L109 |
michel-kraemer/citeproc-java | citeproc-java/src/main/java/de/undercouch/citeproc/helper/CSLUtils.java | CSLUtils.readStreamToString | public static String readStreamToString(InputStream is, String encoding) throws IOException {
"""
Reads a string from a stream. Closes the stream after reading.
@param is the stream
@param encoding the character encoding
@return the string
@throws IOException if the stream contents could not be read
"""
... | java | public static String readStreamToString(InputStream is, String encoding) throws IOException {
try {
StringBuilder sb = new StringBuilder();
byte[] buf = new byte[1024 * 10];
int read;
while ((read = is.read(buf)) >= 0) {
sb.append(new String(buf, 0, read, encoding));
}
return sb.toString();
} ... | [
"public",
"static",
"String",
"readStreamToString",
"(",
"InputStream",
"is",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"try",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"new",
... | Reads a string from a stream. Closes the stream after reading.
@param is the stream
@param encoding the character encoding
@return the string
@throws IOException if the stream contents could not be read | [
"Reads",
"a",
"string",
"from",
"a",
"stream",
".",
"Closes",
"the",
"stream",
"after",
"reading",
"."
] | train | https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/helper/CSLUtils.java#L84-L96 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/TileCollisionModel.java | TileCollisionModel.getCollisionX | private Double getCollisionX(CollisionRange range, CollisionFunction function, double x, double y, int offsetX) {
"""
Get the horizontal collision location between the tile and the current location.
@param range The collision range.
@param function The collision function.
@param x The current horizontal locat... | java | private Double getCollisionX(CollisionRange range, CollisionFunction function, double x, double y, int offsetX)
{
final double yOnTile = getInputValue(Axis.Y, x, y);
if (UtilMath.isBetween(yOnTile, range.getMinY(), range.getMaxY()))
{
final double xOnTile = getInputValue(Axis.X, ... | [
"private",
"Double",
"getCollisionX",
"(",
"CollisionRange",
"range",
",",
"CollisionFunction",
"function",
",",
"double",
"x",
",",
"double",
"y",
",",
"int",
"offsetX",
")",
"{",
"final",
"double",
"yOnTile",
"=",
"getInputValue",
"(",
"Axis",
".",
"Y",
",... | Get the horizontal collision location between the tile and the current location.
@param range The collision range.
@param function The collision function.
@param x The current horizontal location.
@param y The current vertical location.
@param offsetX The horizontal offset.
@return The horizontal collision (<code>null... | [
"Get",
"the",
"horizontal",
"collision",
"location",
"between",
"the",
"tile",
"and",
"the",
"current",
"location",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/TileCollisionModel.java#L85-L100 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupStatusInner.java | BackupStatusInner.getAsync | public Observable<BackupStatusResponseInner> getAsync(String azureRegion, BackupStatusRequest parameters) {
"""
Get the container backup status.
@param azureRegion Azure region to hit Api
@param parameters Container Backup Status Request
@throws IllegalArgumentException thrown if parameters fail the validatio... | java | public Observable<BackupStatusResponseInner> getAsync(String azureRegion, BackupStatusRequest parameters) {
return getWithServiceResponseAsync(azureRegion, parameters).map(new Func1<ServiceResponse<BackupStatusResponseInner>, BackupStatusResponseInner>() {
@Override
public BackupStatusRe... | [
"public",
"Observable",
"<",
"BackupStatusResponseInner",
">",
"getAsync",
"(",
"String",
"azureRegion",
",",
"BackupStatusRequest",
"parameters",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"azureRegion",
",",
"parameters",
")",
".",
"map",
"(",
"new",
... | Get the container backup status.
@param azureRegion Azure region to hit Api
@param parameters Container Backup Status Request
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the BackupStatusResponseInner object | [
"Get",
"the",
"container",
"backup",
"status",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupStatusInner.java#L98-L105 |
httl/httl | httl/src/main/java/httl/spi/codecs/json/JSONObject.java | JSONObject.getFloat | public float getFloat(String key, float def) {
"""
get float value.
@param key key.
@param def default value.
@return value or default value.
"""
Object tmp = objectMap.get(key);
return tmp != null && tmp instanceof Number ? ((Number) tmp)
.floatValue() : def;
} | java | public float getFloat(String key, float def) {
Object tmp = objectMap.get(key);
return tmp != null && tmp instanceof Number ? ((Number) tmp)
.floatValue() : def;
} | [
"public",
"float",
"getFloat",
"(",
"String",
"key",
",",
"float",
"def",
")",
"{",
"Object",
"tmp",
"=",
"objectMap",
".",
"get",
"(",
"key",
")",
";",
"return",
"tmp",
"!=",
"null",
"&&",
"tmp",
"instanceof",
"Number",
"?",
"(",
"(",
"Number",
")",... | get float value.
@param key key.
@param def default value.
@return value or default value. | [
"get",
"float",
"value",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/spi/codecs/json/JSONObject.java#L89-L93 |
StefanLiebenberg/kute | kute-core/src/main/java/slieb/kute/Kute.java | Kute.inputStreamResource | public static InputStreamResource inputStreamResource(final String path,
final SupplierWithThrowable<InputStream, IOException> supplier) {
"""
Create resources from input stream.
@param path The path name for this resource.
@param supplier The input... | java | public static InputStreamResource inputStreamResource(final String path,
final SupplierWithThrowable<InputStream, IOException> supplier) {
return new InputStreamResource(path, supplier);
} | [
"public",
"static",
"InputStreamResource",
"inputStreamResource",
"(",
"final",
"String",
"path",
",",
"final",
"SupplierWithThrowable",
"<",
"InputStream",
",",
"IOException",
">",
"supplier",
")",
"{",
"return",
"new",
"InputStreamResource",
"(",
"path",
",",
"sup... | Create resources from input stream.
@param path The path name for this resource.
@param supplier The input stream to supply content.
@return a readable resource that reads from provided input stream. | [
"Create",
"resources",
"from",
"input",
"stream",
"."
] | train | https://github.com/StefanLiebenberg/kute/blob/1db0e8d2c76459d22c7d4b0ba99c18f74748f6fd/kute-core/src/main/java/slieb/kute/Kute.java#L188-L191 |
UrielCh/ovh-java-sdk | ovh-java-sdk-newAccount/src/main/java/net/minidev/ovh/api/ApiOvhNewAccount.java | ApiOvhNewAccount.area_GET | public ArrayList<String> area_GET(OvhCountryEnum country) throws IOException {
"""
All available areas for a given country
REST: GET /newAccount/area
@param country [required]
"""
String qPath = "/newAccount/area";
StringBuilder sb = path(qPath);
query(sb, "country", country);
String resp = execN(q... | java | public ArrayList<String> area_GET(OvhCountryEnum country) throws IOException {
String qPath = "/newAccount/area";
StringBuilder sb = path(qPath);
query(sb, "country", country);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, t1);
} | [
"public",
"ArrayList",
"<",
"String",
">",
"area_GET",
"(",
"OvhCountryEnum",
"country",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/newAccount/area\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"query",
"(",
"sb",
"... | All available areas for a given country
REST: GET /newAccount/area
@param country [required] | [
"All",
"available",
"areas",
"for",
"a",
"given",
"country"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-newAccount/src/main/java/net/minidev/ovh/api/ApiOvhNewAccount.java#L150-L156 |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/AccountManager.java | AccountManager.generatePassword | public SecureUTF8String generatePassword(CharSequence masterPassword, String inputText, String username) {
"""
Generate the password based on the masterPassword from the matching account from the inputtext
@param masterPassword - the masterpassword to use
@param inputText - the input text // url to use to find... | java | public SecureUTF8String generatePassword(CharSequence masterPassword, String inputText, String username) {
SecureUTF8String securedMasterPassword;
if ( ! (masterPassword instanceof SecureUTF8String) ) {
securedMasterPassword = new SecureUTF8String(masterPassword.toString());
} else {... | [
"public",
"SecureUTF8String",
"generatePassword",
"(",
"CharSequence",
"masterPassword",
",",
"String",
"inputText",
",",
"String",
"username",
")",
"{",
"SecureUTF8String",
"securedMasterPassword",
";",
"if",
"(",
"!",
"(",
"masterPassword",
"instanceof",
"SecureUTF8St... | Generate the password based on the masterPassword from the matching account from the inputtext
@param masterPassword - the masterpassword to use
@param inputText - the input text // url to use to find the account and generate the password
@param username - (optional) the username to override the account's username unl... | [
"Generate",
"the",
"password",
"based",
"on",
"the",
"masterPassword",
"from",
"the",
"matching",
"account",
"from",
"the",
"inputtext"
] | train | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/AccountManager.java#L84-L106 |
lemire/JavaFastPFOR | src/main/java/me/lemire/integercompression/S16.java | S16.estimatecompress | public static int estimatecompress(final int[] in, int currentPos, int inlength) {
"""
Estimate size of the compressed output.
@param in
array to compress
@param currentPos
where to start reading
@param inlength
how many integers to read
@return estimated size of the output (in 32-bit integers)
"""
... | java | public static int estimatecompress(final int[] in, int currentPos, int inlength) {
final int finalin = currentPos + inlength;
int counter = 0;
while (currentPos < finalin) {
int inoffset = fakecompressblock(in, currentPos, inlength);
if (inoffset == -1)
throw new RuntimeException("Too big a number");
... | [
"public",
"static",
"int",
"estimatecompress",
"(",
"final",
"int",
"[",
"]",
"in",
",",
"int",
"currentPos",
",",
"int",
"inlength",
")",
"{",
"final",
"int",
"finalin",
"=",
"currentPos",
"+",
"inlength",
";",
"int",
"counter",
"=",
"0",
";",
"while",
... | Estimate size of the compressed output.
@param in
array to compress
@param currentPos
where to start reading
@param inlength
how many integers to read
@return estimated size of the output (in 32-bit integers) | [
"Estimate",
"size",
"of",
"the",
"compressed",
"output",
"."
] | train | https://github.com/lemire/JavaFastPFOR/blob/ffeea61ab2fdb3854da7b0a557f8d22d674477f4/src/main/java/me/lemire/integercompression/S16.java#L58-L70 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java | ActionUtil.disableAction | public static void disableAction(BaseComponent component, String eventName, boolean disable) {
"""
Enables or disables the deferred event listener associated with the component.
@param component The component.
@param eventName The name of the event.
@param disable Disable state for listener.
"""
A... | java | public static void disableAction(BaseComponent component, String eventName, boolean disable) {
ActionListener listener = getListener(component, eventName);
if (listener != null) {
listener.setDisabled(disable);
}
} | [
"public",
"static",
"void",
"disableAction",
"(",
"BaseComponent",
"component",
",",
"String",
"eventName",
",",
"boolean",
"disable",
")",
"{",
"ActionListener",
"listener",
"=",
"getListener",
"(",
"component",
",",
"eventName",
")",
";",
"if",
"(",
"listener"... | Enables or disables the deferred event listener associated with the component.
@param component The component.
@param eventName The name of the event.
@param disable Disable state for listener. | [
"Enables",
"or",
"disables",
"the",
"deferred",
"event",
"listener",
"associated",
"with",
"the",
"component",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java#L173-L179 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderItemPersistenceImpl.java | CommerceOrderItemPersistenceImpl.removeByC_I | @Override
public void removeByC_I(long commerceOrderId, long CPInstanceId) {
"""
Removes all the commerce order items where commerceOrderId = ? and CPInstanceId = ? from the database.
@param commerceOrderId the commerce order ID
@param CPInstanceId the cp instance ID
"""
for (CommerceOrderItem c... | java | @Override
public void removeByC_I(long commerceOrderId, long CPInstanceId) {
for (CommerceOrderItem commerceOrderItem : findByC_I(commerceOrderId,
CPInstanceId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceOrderItem);
}
} | [
"@",
"Override",
"public",
"void",
"removeByC_I",
"(",
"long",
"commerceOrderId",
",",
"long",
"CPInstanceId",
")",
"{",
"for",
"(",
"CommerceOrderItem",
"commerceOrderItem",
":",
"findByC_I",
"(",
"commerceOrderId",
",",
"CPInstanceId",
",",
"QueryUtil",
".",
"AL... | Removes all the commerce order items where commerceOrderId = ? and CPInstanceId = ? from the database.
@param commerceOrderId the commerce order ID
@param CPInstanceId the cp instance ID | [
"Removes",
"all",
"the",
"commerce",
"order",
"items",
"where",
"commerceOrderId",
"=",
"?",
";",
"and",
"CPInstanceId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderItemPersistenceImpl.java#L2129-L2135 |
morfologik/morfologik-stemming | morfologik-fsa-builders/src/main/java/morfologik/fsa/builders/FSAUtils.java | FSAUtils.toDot | public static String toDot(FSA fsa, int node) {
"""
Returns the right-language reachable from a given FSA node, formatted as an
input for the graphviz package (expressed in the <code>dot</code>
language).
@param fsa The automaton to visualize.
@param node Starting node (subgraph will be visualized unless it'... | java | public static String toDot(FSA fsa, int node) {
try {
StringWriter w = new StringWriter();
toDot(w, fsa, node);
return w.toString();
} catch (IOException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"String",
"toDot",
"(",
"FSA",
"fsa",
",",
"int",
"node",
")",
"{",
"try",
"{",
"StringWriter",
"w",
"=",
"new",
"StringWriter",
"(",
")",
";",
"toDot",
"(",
"w",
",",
"fsa",
",",
"node",
")",
";",
"return",
"w",
".",
"toString"... | Returns the right-language reachable from a given FSA node, formatted as an
input for the graphviz package (expressed in the <code>dot</code>
language).
@param fsa The automaton to visualize.
@param node Starting node (subgraph will be visualized unless it's the automaton's root node).
@return Returns the dot language... | [
"Returns",
"the",
"right",
"-",
"language",
"reachable",
"from",
"a",
"given",
"FSA",
"node",
"formatted",
"as",
"an",
"input",
"for",
"the",
"graphviz",
"package",
"(",
"expressed",
"in",
"the",
"<code",
">",
"dot<",
"/",
"code",
">",
"language",
")",
"... | train | https://github.com/morfologik/morfologik-stemming/blob/9d9099cc5ec4155a0eb8dfecdc23d01cbd734f6e/morfologik-fsa-builders/src/main/java/morfologik/fsa/builders/FSAUtils.java#L42-L50 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/web/SelectionPageGenerator.java | SelectionPageGenerator.sendDisplayError | void sendDisplayError(HttpServletResponse response, String msgKey, Object... args) throws IOException {
"""
Traces that there was an error displaying the sign in page, and includes the provided NLS message information to include as
an insert (e.g. Will output "CWWKSxxxxE: The default social media sign in page can... | java | void sendDisplayError(HttpServletResponse response, String msgKey, Object... args) throws IOException {
if (msgKey == null) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "No message key was provided for sub-message, so no sub-message will be included");
}
msgKey =... | [
"void",
"sendDisplayError",
"(",
"HttpServletResponse",
"response",
",",
"String",
"msgKey",
",",
"Object",
"...",
"args",
")",
"throws",
"IOException",
"{",
"if",
"(",
"msgKey",
"==",
"null",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")"... | Traces that there was an error displaying the sign in page, and includes the provided NLS message information to include as
an insert (e.g. Will output "CWWKSxxxxE: The default social media sign in page cannot be displayed. {0}", where {0} is
replaced with the properly formatted NLS message using the {@code msgKey} and... | [
"Traces",
"that",
"there",
"was",
"an",
"error",
"displaying",
"the",
"sign",
"in",
"page",
"and",
"includes",
"the",
"provided",
"NLS",
"message",
"information",
"to",
"include",
"as",
"an",
"insert",
"(",
"e",
".",
"g",
".",
"Will",
"output",
"CWWKSxxxxE... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/web/SelectionPageGenerator.java#L515-L525 |
Azure/azure-sdk-for-java | compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/DisksInner.java | DisksInner.updateAsync | public Observable<DiskInner> updateAsync(String resourceGroupName, String diskName, DiskUpdate disk) {
"""
Updates (patches) a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. ... | java | public Observable<DiskInner> updateAsync(String resourceGroupName, String diskName, DiskUpdate disk) {
return updateWithServiceResponseAsync(resourceGroupName, diskName, disk).map(new Func1<ServiceResponse<DiskInner>, DiskInner>() {
@Override
public DiskInner call(ServiceResponse<DiskInn... | [
"public",
"Observable",
"<",
"DiskInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"diskName",
",",
"DiskUpdate",
"disk",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"diskName",
",",
"disk",
")",... | Updates (patches) a disk.
@param resourceGroupName The name of the resource group.
@param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@param disk Di... | [
"Updates",
"(",
"patches",
")",
"a",
"disk",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/DisksInner.java#L343-L350 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/Validators.java | Validators.beginsWithUppercaseLetter | public static Validator<CharSequence> beginsWithUppercaseLetter(@NonNull final Context context,
@StringRes final int resourceId) {
"""
Creates and returns a validator, which allows to validate texts to ensure, that they begin
with an uppercase le... | java | public static Validator<CharSequence> beginsWithUppercaseLetter(@NonNull final Context context,
@StringRes final int resourceId) {
return new BeginsWithUppercaseLetterValidator(context, resourceId);
} | [
"public",
"static",
"Validator",
"<",
"CharSequence",
">",
"beginsWithUppercaseLetter",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"StringRes",
"final",
"int",
"resourceId",
")",
"{",
"return",
"new",
"BeginsWithUppercaseLetterValidator",
"(",
"co... | Creates and returns a validator, which allows to validate texts to ensure, that they begin
with an uppercase letter. Empty texts are also accepted.
@param context
The context, which should be used to retrieve the error message, as an instance of
the class {@link Context}. The context may not be null
@param resourceId
... | [
"Creates",
"and",
"returns",
"a",
"validator",
"which",
"allows",
"to",
"validate",
"texts",
"to",
"ensure",
"that",
"they",
"begin",
"with",
"an",
"uppercase",
"letter",
".",
"Empty",
"texts",
"are",
"also",
"accepted",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/Validators.java#L809-L812 |
line/armeria | kafka/src/main/java/com/linecorp/armeria/server/logging/structured/kafka/KafkaStructuredLoggingService.java | KafkaStructuredLoggingService.newDecorator | public static <I extends Request, O extends Response, L>
Function<Service<I, O>, StructuredLoggingService<I, O, L>> newDecorator(
Producer<byte[], L> producer, String topic,
StructuredLogBuilder<L> logBuilder) {
"""
Creates a decorator which provides {@link StructuredLoggingService} wit... | java | public static <I extends Request, O extends Response, L>
Function<Service<I, O>, StructuredLoggingService<I, O, L>> newDecorator(
Producer<byte[], L> producer, String topic,
StructuredLogBuilder<L> logBuilder) {
return newDecorator(producer, topic, logBuilder, null);
} | [
"public",
"static",
"<",
"I",
"extends",
"Request",
",",
"O",
"extends",
"Response",
",",
"L",
">",
"Function",
"<",
"Service",
"<",
"I",
",",
"O",
">",
",",
"StructuredLoggingService",
"<",
"I",
",",
"O",
",",
"L",
">",
">",
"newDecorator",
"(",
"Pr... | Creates a decorator which provides {@link StructuredLoggingService} with defaulting key to null.
@param producer a kafka {@link Producer} producer which is used to send logs to Kafka
@param topic a name of topic which is used to send logs
@param logBuilder an instance of {@link StructuredLogBuilder} which is used to c... | [
"Creates",
"a",
"decorator",
"which",
"provides",
"{",
"@link",
"StructuredLoggingService",
"}",
"with",
"defaulting",
"key",
"to",
"null",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/kafka/src/main/java/com/linecorp/armeria/server/logging/structured/kafka/KafkaStructuredLoggingService.java#L111-L116 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/URLHandler.java | URLHandler.restoreHostNameToURL | @Sensitive
protected String restoreHostNameToURL(@Sensitive String referrerURL, String url) {
"""
Updates the referrerURL with the host for the current request
if one is missing. If referrerURL is relative or an empty String,
use the host for the current request and append the referrerURL.
Otherwise, inject... | java | @Sensitive
protected String restoreHostNameToURL(@Sensitive String referrerURL, String url) {
if ((referrerURL.startsWith("/")) || (referrerURL.length() == 0)) {
int doubleSlash = url.indexOf("//");
int firstSingleSlash = url.indexOf("/", doubleSlash + 2);
referrerURL = u... | [
"@",
"Sensitive",
"protected",
"String",
"restoreHostNameToURL",
"(",
"@",
"Sensitive",
"String",
"referrerURL",
",",
"String",
"url",
")",
"{",
"if",
"(",
"(",
"referrerURL",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"||",
"(",
"referrerURL",
".",
"length"... | Updates the referrerURL with the host for the current request
if one is missing. If referrerURL is relative or an empty String,
use the host for the current request and append the referrerURL.
Otherwise, inject into the referrer URL String the host for the
current request.
Note, this method does not handle the followi... | [
"Updates",
"the",
"referrerURL",
"with",
"the",
"host",
"for",
"the",
"current",
"request",
"if",
"one",
"is",
"missing",
".",
"If",
"referrerURL",
"is",
"relative",
"or",
"an",
"empty",
"String",
"use",
"the",
"host",
"for",
"the",
"current",
"request",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/URLHandler.java#L125-L150 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/resource/ResourceResolver.java | ResourceResolver.resolve | public static File resolve(Class<?> clazz, String path) {
"""
Return target file path from class and resource's path.
@param clazz Target class
@param path resource's path
@return File object
"""
URL url = clazz.getResource(path);
if (url == null)
{
return null;
... | java | public static File resolve(Class<?> clazz, String path)
{
URL url = clazz.getResource(path);
if (url == null)
{
return null;
}
File result;
try
{
result = Paths.get(url.toURI()).toFile();
}
catch (URISyntaxException ex)... | [
"public",
"static",
"File",
"resolve",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"path",
")",
"{",
"URL",
"url",
"=",
"clazz",
".",
"getResource",
"(",
"path",
")",
";",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"return",
"null",
";",
... | Return target file path from class and resource's path.
@param clazz Target class
@param path resource's path
@return File object | [
"Return",
"target",
"file",
"path",
"from",
"class",
"and",
"resource",
"s",
"path",
"."
] | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/resource/ResourceResolver.java#L45-L64 |
wwadge/bonecp | bonecp/src/main/java/com/jolbox/bonecp/MemorizeTransactionProxy.java | MemorizeTransactionProxy.memorize | protected static CallableStatement memorize(final CallableStatement target, final ConnectionHandle connectionHandle) {
"""
Wrap CallableStatement with a proxy.
@param target statement handle
@param connectionHandle originating bonecp connection
@return Proxy to a Callablestatement.
"""
return (CallableSta... | java | protected static CallableStatement memorize(final CallableStatement target, final ConnectionHandle connectionHandle) {
return (CallableStatement) Proxy.newProxyInstance(
CallableStatementProxy.class.getClassLoader(),
new Class[] {CallableStatementProxy.class},
new MemorizeTransactionProxy(target, connecti... | [
"protected",
"static",
"CallableStatement",
"memorize",
"(",
"final",
"CallableStatement",
"target",
",",
"final",
"ConnectionHandle",
"connectionHandle",
")",
"{",
"return",
"(",
"CallableStatement",
")",
"Proxy",
".",
"newProxyInstance",
"(",
"CallableStatementProxy",
... | Wrap CallableStatement with a proxy.
@param target statement handle
@param connectionHandle originating bonecp connection
@return Proxy to a Callablestatement. | [
"Wrap",
"CallableStatement",
"with",
"a",
"proxy",
"."
] | train | https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/MemorizeTransactionProxy.java#L117-L122 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/channel/ChannelConsumer.java | ChannelConsumer.resolveChannelName | protected MessageChannel resolveChannelName(String channelName, TestContext context) {
"""
Resolve the channel by name.
@param channelName the name to resolve
@param context
@return the MessageChannel object
"""
if (endpointConfiguration.getChannelResolver() == null) {
if (endpointConfig... | java | protected MessageChannel resolveChannelName(String channelName, TestContext context) {
if (endpointConfiguration.getChannelResolver() == null) {
if (endpointConfiguration.getBeanFactory() != null) {
endpointConfiguration.setChannelResolver(new BeanFactoryChannelResolver(endpointConfi... | [
"protected",
"MessageChannel",
"resolveChannelName",
"(",
"String",
"channelName",
",",
"TestContext",
"context",
")",
"{",
"if",
"(",
"endpointConfiguration",
".",
"getChannelResolver",
"(",
")",
"==",
"null",
")",
"{",
"if",
"(",
"endpointConfiguration",
".",
"g... | Resolve the channel by name.
@param channelName the name to resolve
@param context
@return the MessageChannel object | [
"Resolve",
"the",
"channel",
"by",
"name",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/channel/ChannelConsumer.java#L147-L157 |
sporniket/core | sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java | XmlStringTools.doAppendCdataSection | private static StringBuffer doAppendCdataSection(StringBuffer buffer, String cdataContent) {
"""
Add a cdata section to a StringBuffer.
If the buffer is null, a new one is created.
@param buffer
StringBuffer to fill
@param cdataContent
the cdata content
@return the buffer
"""
buffer.append(SEQUENCE... | java | private static StringBuffer doAppendCdataSection(StringBuffer buffer, String cdataContent)
{
buffer.append(SEQUENCE__CDATA__OPEN).append(cdataContent).append(SEQUENCE__CDATA__CLOSE);
return buffer;
} | [
"private",
"static",
"StringBuffer",
"doAppendCdataSection",
"(",
"StringBuffer",
"buffer",
",",
"String",
"cdataContent",
")",
"{",
"buffer",
".",
"append",
"(",
"SEQUENCE__CDATA__OPEN",
")",
".",
"append",
"(",
"cdataContent",
")",
".",
"append",
"(",
"SEQUENCE_... | Add a cdata section to a StringBuffer.
If the buffer is null, a new one is created.
@param buffer
StringBuffer to fill
@param cdataContent
the cdata content
@return the buffer | [
"Add",
"a",
"cdata",
"section",
"to",
"a",
"StringBuffer",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java#L436-L440 |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/entityjson/EntityJsonParser.java | EntityJsonParser.parseEntityJson | public EntityJson parseEntityJson(URL instanceUrl) throws SchemaValidationException, InvalidInstanceException {
"""
Parse an EntityJSON instance from the given URL.
Callers may prefer to catch EntityJSONException and treat all failures in the same way.
@param instanceUrl A URL pointing to the JSON representa... | java | public EntityJson parseEntityJson(URL instanceUrl) throws SchemaValidationException, InvalidInstanceException
{
try
{
return new EntityJson(validate(ENTITY_JSON_SCHEMA_URL, instanceUrl));
}
catch (NoSchemaException | InvalidSchemaException e)
{
// In theory this cannot happen
thr... | [
"public",
"EntityJson",
"parseEntityJson",
"(",
"URL",
"instanceUrl",
")",
"throws",
"SchemaValidationException",
",",
"InvalidInstanceException",
"{",
"try",
"{",
"return",
"new",
"EntityJson",
"(",
"validate",
"(",
"ENTITY_JSON_SCHEMA_URL",
",",
"instanceUrl",
")",
... | Parse an EntityJSON instance from the given URL.
Callers may prefer to catch EntityJSONException and treat all failures in the same way.
@param instanceUrl A URL pointing to the JSON representation of an EntityJSON instance.
@return An EntityJSON instance.
@throws SchemaValidationException If the given instance d... | [
"Parse",
"an",
"EntityJSON",
"instance",
"from",
"the",
"given",
"URL",
"."
] | train | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/entityjson/EntityJsonParser.java#L108-L119 |
cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java | DepictionGenerator.withParam | public <T extends IGeneratorParameter<S>, S, U extends S> DepictionGenerator withParam(Class<T> key, U value) {
"""
Low-level option method to set a rendering model parameter.
@param key option key
@param value option value
@param <T> option key type
@param <U> option value type
@return new generator ... | java | public <T extends IGeneratorParameter<S>, S, U extends S> DepictionGenerator withParam(Class<T> key, U value) {
DepictionGenerator copy = new DepictionGenerator(this);
copy.setParam(key, value);
return copy;
} | [
"public",
"<",
"T",
"extends",
"IGeneratorParameter",
"<",
"S",
">",
",",
"S",
",",
"U",
"extends",
"S",
">",
"DepictionGenerator",
"withParam",
"(",
"Class",
"<",
"T",
">",
"key",
",",
"U",
"value",
")",
"{",
"DepictionGenerator",
"copy",
"=",
"new",
... | Low-level option method to set a rendering model parameter.
@param key option key
@param value option value
@param <T> option key type
@param <U> option value type
@return new generator for method chaining | [
"Low",
"-",
"level",
"option",
"method",
"to",
"set",
"a",
"rendering",
"model",
"parameter",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java#L1075-L1079 |
datastax/java-driver | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/QueryBuilder.java | QueryBuilder.multiply | @NonNull
public static Term multiply(@NonNull Term left, @NonNull Term right) {
"""
The product of two terms, as in {@code WHERE k = left * right}.
"""
return new BinaryArithmeticTerm(ArithmeticOperator.PRODUCT, left, right);
} | java | @NonNull
public static Term multiply(@NonNull Term left, @NonNull Term right) {
return new BinaryArithmeticTerm(ArithmeticOperator.PRODUCT, left, right);
} | [
"@",
"NonNull",
"public",
"static",
"Term",
"multiply",
"(",
"@",
"NonNull",
"Term",
"left",
",",
"@",
"NonNull",
"Term",
"right",
")",
"{",
"return",
"new",
"BinaryArithmeticTerm",
"(",
"ArithmeticOperator",
".",
"PRODUCT",
",",
"left",
",",
"right",
")",
... | The product of two terms, as in {@code WHERE k = left * right}. | [
"The",
"product",
"of",
"two",
"terms",
"as",
"in",
"{"
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/QueryBuilder.java#L201-L204 |
tempodb/tempodb-java | src/main/java/com/tempodb/Client.java | Client.readMultiDataPoints | public Cursor<MultiDataPoint> readMultiDataPoints(Filter filter, Interval interval, DateTimeZone timezone, Rollup rollup, Interpolation interpolation) {
"""
Returns a cursor of multi-datapoints specified by a series filter.
This endpoint allows one to request datapoints for multiple series in one call.
@para... | java | public Cursor<MultiDataPoint> readMultiDataPoints(Filter filter, Interval interval, DateTimeZone timezone, Rollup rollup, Interpolation interpolation) {
checkNotNull(filter);
checkNotNull(interval);
checkNotNull(timezone);
URI uri = null;
try {
URIBuilder builder = new URIBuilder(String.forma... | [
"public",
"Cursor",
"<",
"MultiDataPoint",
">",
"readMultiDataPoints",
"(",
"Filter",
"filter",
",",
"Interval",
"interval",
",",
"DateTimeZone",
"timezone",
",",
"Rollup",
"rollup",
",",
"Interpolation",
"interpolation",
")",
"{",
"checkNotNull",
"(",
"filter",
"... | Returns a cursor of multi-datapoints specified by a series filter.
This endpoint allows one to request datapoints for multiple series in one call.
@param filter The series filter
@param interval An interval of time for the query (start/end datetimes)
@param timezone The time zone for the returned datapoints.
@param r... | [
"Returns",
"a",
"cursor",
"of",
"multi",
"-",
"datapoints",
"specified",
"by",
"a",
"series",
"filter",
"."
] | train | https://github.com/tempodb/tempodb-java/blob/5733f204fe4c8dda48916ba1f67cf44f5a3f9c69/src/main/java/com/tempodb/Client.java#L934-L955 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.ptts_GET | public OvhPttDetails ptts_GET(Long ptt) throws IOException {
"""
Get informations about the given ptt code
REST: GET /sms/ptts
@param ptt [required] The premium transaction tracking code
"""
String qPath = "/sms/ptts";
StringBuilder sb = path(qPath);
query(sb, "ptt", ptt);
String resp = exec(qPath,... | java | public OvhPttDetails ptts_GET(Long ptt) throws IOException {
String qPath = "/sms/ptts";
StringBuilder sb = path(qPath);
query(sb, "ptt", ptt);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPttDetails.class);
} | [
"public",
"OvhPttDetails",
"ptts_GET",
"(",
"Long",
"ptt",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/sms/ptts\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"query",
"(",
"sb",
",",
"\"ptt\"",
",",
"ptt",
")",
"... | Get informations about the given ptt code
REST: GET /sms/ptts
@param ptt [required] The premium transaction tracking code | [
"Get",
"informations",
"about",
"the",
"given",
"ptt",
"code"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L1721-L1727 |
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/WebSocketSerializer.java | WebSocketSerializer.getResponseSerializer | public static ResponseSerializer getResponseSerializer(ResponseHeader header, Response response) throws JsonGenerationException, JsonMappingException, IOException {
"""
Serialize the Response.
@param header
the ResponseHeader.
@param response
the Response.
@return
the ResponseSerializer.
@throws JsonGener... | java | public static ResponseSerializer getResponseSerializer(ResponseHeader header, Response response) throws JsonGenerationException, JsonMappingException, IOException{
final String s = serializeResponse(header, response);
return new ResponseSerializer(){
@Override
public String sear... | [
"public",
"static",
"ResponseSerializer",
"getResponseSerializer",
"(",
"ResponseHeader",
"header",
",",
"Response",
"response",
")",
"throws",
"JsonGenerationException",
",",
"JsonMappingException",
",",
"IOException",
"{",
"final",
"String",
"s",
"=",
"serializeResponse... | Serialize the Response.
@param header
the ResponseHeader.
@param response
the Response.
@return
the ResponseSerializer.
@throws JsonGenerationException
@throws JsonMappingException
@throws IOException | [
"Serialize",
"the",
"Response",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/WebSocketSerializer.java#L54-L64 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicatedCloud_serviceName_filer_duration_GET | public OvhOrder dedicatedCloud_serviceName_filer_duration_GET(String serviceName, String duration, Long datacenterId, String name, Long quantity) throws IOException {
"""
Get prices and contracts information
REST: GET /order/dedicatedCloud/{serviceName}/filer/{duration}
@param name [required] Filer profile you... | java | public OvhOrder dedicatedCloud_serviceName_filer_duration_GET(String serviceName, String duration, Long datacenterId, String name, Long quantity) throws IOException {
String qPath = "/order/dedicatedCloud/{serviceName}/filer/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "datacenter... | [
"public",
"OvhOrder",
"dedicatedCloud_serviceName_filer_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"Long",
"datacenterId",
",",
"String",
"name",
",",
"Long",
"quantity",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\... | Get prices and contracts information
REST: GET /order/dedicatedCloud/{serviceName}/filer/{duration}
@param name [required] Filer profile you want to order ("name" field in a profile returned by /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/orderableFilerProfiles)
@param quantity [required] Quantity of filer ... | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5561-L5569 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java | BoofConcurrency.loopBlocks | public static void loopBlocks(int start , int endExclusive , int minBlock,
IntRangeConsumer consumer ) {
"""
Automatically breaks the problem up into blocks based on the number of threads available. It is assumed
that there is some cost associated with processing a block and the number of blocks is mini... | java | public static void loopBlocks(int start , int endExclusive , int minBlock,
IntRangeConsumer consumer ) {
final ForkJoinPool pool = BoofConcurrency.pool;
int numThreads = pool.getParallelism();
int range = endExclusive-start;
if( range == 0 ) // nothing to do here!
return;
if( range < 0 )
thro... | [
"public",
"static",
"void",
"loopBlocks",
"(",
"int",
"start",
",",
"int",
"endExclusive",
",",
"int",
"minBlock",
",",
"IntRangeConsumer",
"consumer",
")",
"{",
"final",
"ForkJoinPool",
"pool",
"=",
"BoofConcurrency",
".",
"pool",
";",
"int",
"numThreads",
"=... | Automatically breaks the problem up into blocks based on the number of threads available. It is assumed
that there is some cost associated with processing a block and the number of blocks is minimized.
Examples:
<ul>
<li>Given a range of 0 to 100, and minBlock is 5, and 10 threads. Blocks will be size 10.</li>
<li>Giv... | [
"Automatically",
"breaks",
"the",
"problem",
"up",
"into",
"blocks",
"based",
"on",
"the",
"number",
"of",
"threads",
"available",
".",
"It",
"is",
"assumed",
"that",
"there",
"is",
"some",
"cost",
"associated",
"with",
"processing",
"a",
"block",
"and",
"th... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java#L101-L119 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Parameters.java | Parameters.setInt | @NonNull
public Parameters setInt(@NonNull String name, int value) {
"""
Set an int value to the query parameter referenced by the given name. A query parameter
is defined by using the Expression's parameter(String name) function.
@param name The parameter name.
@param value The int value.
@return The s... | java | @NonNull
public Parameters setInt(@NonNull String name, int value) {
return setValue(name, value);
} | [
"@",
"NonNull",
"public",
"Parameters",
"setInt",
"(",
"@",
"NonNull",
"String",
"name",
",",
"int",
"value",
")",
"{",
"return",
"setValue",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Set an int value to the query parameter referenced by the given name. A query parameter
is defined by using the Expression's parameter(String name) function.
@param name The parameter name.
@param value The int value.
@return The self object. | [
"Set",
"an",
"int",
"value",
"to",
"the",
"query",
"parameter",
"referenced",
"by",
"the",
"given",
"name",
".",
"A",
"query",
"parameter",
"is",
"defined",
"by",
"using",
"the",
"Expression",
"s",
"parameter",
"(",
"String",
"name",
")",
"function",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Parameters.java#L105-L108 |
j-a-w-r/jawr-main-repo | jawr-tools/jawr-bundle-processor/src/main/java/net/jawr/web/bundle/processor/BundleProcessor.java | BundleProcessor.createLinkToBundle | protected List<RenderedLink> createLinkToBundle(
ResourceBundlesHandler handler, String path, String resourceType,
Map<String, String> variantMap) throws IOException {
"""
Returns the link to the bundle
@param handler
the resource bundles handler
@param path
the path
@param variantKey
the local varia... | java | protected List<RenderedLink> createLinkToBundle(
ResourceBundlesHandler handler, String path, String resourceType,
Map<String, String> variantMap) throws IOException {
ArrayList<RenderedLink> linksToBundle = new ArrayList<RenderedLink>();
BasicBundleRenderer bundleRenderer = new BasicBundleRenderer(handler,... | [
"protected",
"List",
"<",
"RenderedLink",
">",
"createLinkToBundle",
"(",
"ResourceBundlesHandler",
"handler",
",",
"String",
"path",
",",
"String",
"resourceType",
",",
"Map",
"<",
"String",
",",
"String",
">",
"variantMap",
")",
"throws",
"IOException",
"{",
"... | Returns the link to the bundle
@param handler
the resource bundles handler
@param path
the path
@param variantKey
the local variant key
@return the link to the bundle
@throws IOException
if an IO exception occurs | [
"Returns",
"the",
"link",
"to",
"the",
"bundle"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr-tools/jawr-bundle-processor/src/main/java/net/jawr/web/bundle/processor/BundleProcessor.java#L1130-L1179 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/internal/PageFlowTagUtils.java | PageFlowTagUtils.rewriteHrefURL | public static String rewriteHrefURL(PageContext pageContext, String url, Map params, String location)
throws URISyntaxException {
"""
Create a fully-rewritten url from an initial href url with query parameters
and an anchor (location on page), checking if it needs to be secure then call
the rewriter ... | java | public static String rewriteHrefURL(PageContext pageContext, String url, Map params, String location)
throws URISyntaxException
{
ServletContext servletContext = pageContext.getServletContext();
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
HttpServl... | [
"public",
"static",
"String",
"rewriteHrefURL",
"(",
"PageContext",
"pageContext",
",",
"String",
"url",
",",
"Map",
"params",
",",
"String",
"location",
")",
"throws",
"URISyntaxException",
"{",
"ServletContext",
"servletContext",
"=",
"pageContext",
".",
"getServl... | Create a fully-rewritten url from an initial href url with query parameters
and an anchor (location on page), checking if it needs to be secure then call
the rewriter service using a type of {@link org.apache.beehive.netui.core.urls.URLType#ACTION}.
@param pageContext the current PageContext.
@param url the hre... | [
"Create",
"a",
"fully",
"-",
"rewritten",
"url",
"from",
"an",
"initial",
"href",
"url",
"with",
"query",
"parameters",
"and",
"an",
"anchor",
"(",
"location",
"on",
"page",
")",
"checking",
"if",
"it",
"needs",
"to",
"be",
"secure",
"then",
"call",
"the... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/internal/PageFlowTagUtils.java#L83-L91 |
morfologik/morfologik-stemming | morfologik-fsa-builders/src/main/java/morfologik/fsa/builders/FSABuilder.java | FSABuilder.equivalent | private boolean equivalent(int start1, int start2, int len) {
"""
Return <code>true</code> if two regions in {@link #serialized} are
identical.
"""
if (start1 + len > size || start2 + len > size)
return false;
while (len-- > 0)
if (serialized[start1++] != serialized[start2++])
ret... | java | private boolean equivalent(int start1, int start2, int len) {
if (start1 + len > size || start2 + len > size)
return false;
while (len-- > 0)
if (serialized[start1++] != serialized[start2++])
return false;
return true;
} | [
"private",
"boolean",
"equivalent",
"(",
"int",
"start1",
",",
"int",
"start2",
",",
"int",
"len",
")",
"{",
"if",
"(",
"start1",
"+",
"len",
">",
"size",
"||",
"start2",
"+",
"len",
">",
"size",
")",
"return",
"false",
";",
"while",
"(",
"len",
"-... | Return <code>true</code> if two regions in {@link #serialized} are
identical. | [
"Return",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"two",
"regions",
"in",
"{"
] | train | https://github.com/morfologik/morfologik-stemming/blob/9d9099cc5ec4155a0eb8dfecdc23d01cbd734f6e/morfologik-fsa-builders/src/main/java/morfologik/fsa/builders/FSABuilder.java#L398-L407 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/Tesseract.java | Tesseract.setImage | protected void setImage(int xsize, int ysize, ByteBuffer buf, Rectangle rect, int bpp) {
"""
Sets image to be processed.
@param xsize width of image
@param ysize height of image
@param buf pixel data
@param rect the bounding rectangle defines the region of the image to be
recognized. A rectangle of zero dim... | java | protected void setImage(int xsize, int ysize, ByteBuffer buf, Rectangle rect, int bpp) {
int bytespp = bpp / 8;
int bytespl = (int) Math.ceil(xsize * bpp / 8.0);
api.TessBaseAPISetImage(handle, buf, xsize, ysize, bytespp, bytespl);
if (rect != null && !rect.isEmpty()) {
... | [
"protected",
"void",
"setImage",
"(",
"int",
"xsize",
",",
"int",
"ysize",
",",
"ByteBuffer",
"buf",
",",
"Rectangle",
"rect",
",",
"int",
"bpp",
")",
"{",
"int",
"bytespp",
"=",
"bpp",
"/",
"8",
";",
"int",
"bytespl",
"=",
"(",
"int",
")",
"Math",
... | Sets image to be processed.
@param xsize width of image
@param ysize height of image
@param buf pixel data
@param rect the bounding rectangle defines the region of the image to be
recognized. A rectangle of zero dimension or <code>null</code> indicates
the whole image.
@param bpp bits per pixel, represents the bit dep... | [
"Sets",
"image",
"to",
"be",
"processed",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract.java#L479-L487 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/optics/lenses/MapLens.java | MapLens.valueAt | public static <K, V> Lens.Simple<Map<K, V>, Maybe<V>> valueAt(K k) {
"""
A lens that focuses on a value at a key in a map, as a {@link Maybe}.
@param <K> the key type
@param <V> the value type
@param k the key to focus on
@return a lens that focuses on the value at key, as a {@link Maybe}
"""
r... | java | public static <K, V> Lens.Simple<Map<K, V>, Maybe<V>> valueAt(K k) {
return adapt(valueAt(HashMap::new, k));
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Lens",
".",
"Simple",
"<",
"Map",
"<",
"K",
",",
"V",
">",
",",
"Maybe",
"<",
"V",
">",
">",
"valueAt",
"(",
"K",
"k",
")",
"{",
"return",
"adapt",
"(",
"valueAt",
"(",
"HashMap",
"::",
"new",
","... | A lens that focuses on a value at a key in a map, as a {@link Maybe}.
@param <K> the key type
@param <V> the value type
@param k the key to focus on
@return a lens that focuses on the value at key, as a {@link Maybe} | [
"A",
"lens",
"that",
"focuses",
"on",
"a",
"value",
"at",
"a",
"key",
"in",
"a",
"map",
"as",
"a",
"{",
"@link",
"Maybe",
"}",
"."
] | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/optics/lenses/MapLens.java#L93-L95 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Invariants.java | Invariants.checkInvariant | public static <T> T checkInvariant(
final T value,
final boolean condition,
final Function<T, String> describer) {
"""
<p>Evaluate the given {@code predicate} using {@code value} as input.</p>
<p>The function throws {@link InvariantViolationException} if the predicate
is false.</p>
@param value ... | java | public static <T> T checkInvariant(
final T value,
final boolean condition,
final Function<T, String> describer)
{
return innerCheckInvariant(value, condition, describer);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"checkInvariant",
"(",
"final",
"T",
"value",
",",
"final",
"boolean",
"condition",
",",
"final",
"Function",
"<",
"T",
",",
"String",
">",
"describer",
")",
"{",
"return",
"innerCheckInvariant",
"(",
"value",
",",
... | <p>Evaluate the given {@code predicate} using {@code value} as input.</p>
<p>The function throws {@link InvariantViolationException} if the predicate
is false.</p>
@param value The value
@param condition The predicate
@param describer A describer for the predicate
@param <T> The type of values
@return valu... | [
"<p",
">",
"Evaluate",
"the",
"given",
"{",
"@code",
"predicate",
"}",
"using",
"{",
"@code",
"value",
"}",
"as",
"input",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Invariants.java#L237-L243 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateLowerCase | public static <T extends CharSequence> T validateLowerCase(T value, String errorMsg) throws ValidateException {
"""
验证字符串是否全部为小写字母
@param <T> 字符串类型
@param value 表单值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
@since 3.3.0
"""
if (false == isLowerCase(value)) {
throw new ... | java | public static <T extends CharSequence> T validateLowerCase(T value, String errorMsg) throws ValidateException {
if (false == isLowerCase(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateLowerCase",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isLowerCase",
"(",
"value",
")",
")",
"{",
"throw",
"n... | 验证字符串是否全部为小写字母
@param <T> 字符串类型
@param value 表单值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
@since 3.3.0 | [
"验证字符串是否全部为小写字母"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L519-L524 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java | VirtualMachineScaleSetVMsInner.listAsync | public Observable<Page<VirtualMachineScaleSetVMInner>> listAsync(final String resourceGroupName, final String virtualMachineScaleSetName) {
"""
Gets a list of all virtual machines in a VM scale sets.
@param resourceGroupName The name of the resource group.
@param virtualMachineScaleSetName The name of the VM s... | java | public Observable<Page<VirtualMachineScaleSetVMInner>> listAsync(final String resourceGroupName, final String virtualMachineScaleSetName) {
return listWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName)
.map(new Func1<ServiceResponse<Page<VirtualMachineScaleSetVMInner>>, Page<Vir... | [
"public",
"Observable",
"<",
"Page",
"<",
"VirtualMachineScaleSetVMInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"virtualMachineScaleSetName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName... | Gets a list of all virtual machines in a VM scale sets.
@param resourceGroupName The name of the resource group.
@param virtualMachineScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<VirtualMachineScaleSetVMI... | [
"Gets",
"a",
"list",
"of",
"all",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"sets",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java#L1265-L1273 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/record/RecordFile.java | RecordFile.currentRecordId | public RecordId currentRecordId() {
"""
Returns the record ID of the current record.
@return a record ID
"""
int id = rp.currentId();
return new RecordId(new BlockId(fileName, currentBlkNum), id);
} | java | public RecordId currentRecordId() {
int id = rp.currentId();
return new RecordId(new BlockId(fileName, currentBlkNum), id);
} | [
"public",
"RecordId",
"currentRecordId",
"(",
")",
"{",
"int",
"id",
"=",
"rp",
".",
"currentId",
"(",
")",
";",
"return",
"new",
"RecordId",
"(",
"new",
"BlockId",
"(",
"fileName",
",",
"currentBlkNum",
")",
",",
"id",
")",
";",
"}"
] | Returns the record ID of the current record.
@return a record ID | [
"Returns",
"the",
"record",
"ID",
"of",
"the",
"current",
"record",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/record/RecordFile.java#L340-L343 |
haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java | ServletUtil.getParameter | public static String getParameter(final ServletRequest pReq, final String pName, final String pDefault) {
"""
Gets the value of the given parameter from the request, or if the
parameter is not set, the default value.
@param pReq the servlet request
@param pName the parameter name
@param pDefault the d... | java | public static String getParameter(final ServletRequest pReq, final String pName, final String pDefault) {
String str = pReq.getParameter(pName);
return str != null ? str : pDefault;
} | [
"public",
"static",
"String",
"getParameter",
"(",
"final",
"ServletRequest",
"pReq",
",",
"final",
"String",
"pName",
",",
"final",
"String",
"pDefault",
")",
"{",
"String",
"str",
"=",
"pReq",
".",
"getParameter",
"(",
"pName",
")",
";",
"return",
"str",
... | Gets the value of the given parameter from the request, or if the
parameter is not set, the default value.
@param pReq the servlet request
@param pName the parameter name
@param pDefault the default value
@return the value of the parameter, or the default value, if the
parameter is not set. | [
"Gets",
"the",
"value",
"of",
"the",
"given",
"parameter",
"from",
"the",
"request",
"or",
"if",
"the",
"parameter",
"is",
"not",
"set",
"the",
"default",
"value",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java#L128-L132 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java | TypeConverter.convertToDouble | public static double convertToDouble (@Nonnull final Object aSrcValue) {
"""
Convert the passed source value to double
@param aSrcValue
The source value. May not be <code>null</code>.
@return The converted value.
@throws TypeConverterException
if the source value is <code>null</code> or if no converter was
... | java | public static double convertToDouble (@Nonnull final Object aSrcValue)
{
if (aSrcValue == null)
throw new TypeConverterException (double.class, EReason.NULL_SOURCE_NOT_ALLOWED);
final Double aValue = convert (aSrcValue, Double.class);
return aValue.doubleValue ();
} | [
"public",
"static",
"double",
"convertToDouble",
"(",
"@",
"Nonnull",
"final",
"Object",
"aSrcValue",
")",
"{",
"if",
"(",
"aSrcValue",
"==",
"null",
")",
"throw",
"new",
"TypeConverterException",
"(",
"double",
".",
"class",
",",
"EReason",
".",
"NULL_SOURCE_... | Convert the passed source value to double
@param aSrcValue
The source value. May not be <code>null</code>.
@return The converted value.
@throws TypeConverterException
if the source value is <code>null</code> or if no converter was
found or if the converter returned a <code>null</code> object.
@throws RuntimeException
... | [
"Convert",
"the",
"passed",
"source",
"value",
"to",
"double"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java#L234-L240 |
roboconf/roboconf-platform | core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/extensions/AbstractRoutingClient.java | AbstractRoutingClient.subscribe | protected void subscribe( String id, MessagingContext ctx ) throws IOException {
"""
Registers a subscription between an ID and a context.
@param id a client ID
@param ctx a messaging context
@throws IOException
"""
if( ! canProceed())
return;
Set<MessagingContext> sub = this.routingContext.subscri... | java | protected void subscribe( String id, MessagingContext ctx ) throws IOException {
if( ! canProceed())
return;
Set<MessagingContext> sub = this.routingContext.subscriptions.get( id );
if( sub == null ) {
sub = new HashSet<> ();
this.routingContext.subscriptions.put( id, sub );
}
sub.add( ctx );
} | [
"protected",
"void",
"subscribe",
"(",
"String",
"id",
",",
"MessagingContext",
"ctx",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"canProceed",
"(",
")",
")",
"return",
";",
"Set",
"<",
"MessagingContext",
">",
"sub",
"=",
"this",
".",
"routingCont... | Registers a subscription between an ID and a context.
@param id a client ID
@param ctx a messaging context
@throws IOException | [
"Registers",
"a",
"subscription",
"between",
"an",
"ID",
"and",
"a",
"context",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/extensions/AbstractRoutingClient.java#L265-L277 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/ResultUtil.java | ResultUtil.getAggAttribute | public static Object getAggAttribute(Map<String,?> map ,String metrics,String attribute) {
"""
{
"key": "demoproject",
"doc_count": 30,
"successsums": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": 0,
"doc_count": 30
}
]
}
}
@param map
@param metrics successsum... | java | public static Object getAggAttribute(Map<String,?> map ,String metrics,String attribute){
if(map != null) {
Map<String, Object> metrics_ = (Map<String, Object>) map.get(metrics);
if (metrics_ != null) {
return metrics_.get(attribute);
}
}
return null;
} | [
"public",
"static",
"Object",
"getAggAttribute",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"map",
",",
"String",
"metrics",
",",
"String",
"attribute",
")",
"{",
"if",
"(",
"map",
"!=",
"null",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"met... | {
"key": "demoproject",
"doc_count": 30,
"successsums": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": 0,
"doc_count": 30
}
]
}
}
@param map
@param metrics successsums->doc_count_error_upper_bound
successsums->sum_other_doc_count
@param attribute maybe doc_count_error_upper_bound s... | [
"{",
"key",
":",
"demoproject",
"doc_count",
":",
"30",
"successsums",
":",
"{",
"doc_count_error_upper_bound",
":",
"0",
"sum_other_doc_count",
":",
"0",
"buckets",
":",
"[",
"{",
"key",
":",
"0",
"doc_count",
":",
"30",
"}",
"]",
"}",
"}"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/ResultUtil.java#L822-L830 |
alkacon/opencms-core | src/org/opencms/file/wrapper/CmsObjectWrapper.java | CmsObjectWrapper.createResource | public CmsResource createResource(String resourcename, int type) throws CmsException, CmsIllegalArgumentException {
"""
Creates a new resource of the given resource type with empty content and no properties.<p>
@see #createResource(String, int, byte[], List)
@param resourcename the name of the resource to cr... | java | public CmsResource createResource(String resourcename, int type) throws CmsException, CmsIllegalArgumentException {
return createResource(resourcename, type, new byte[0], new ArrayList<CmsProperty>(0));
} | [
"public",
"CmsResource",
"createResource",
"(",
"String",
"resourcename",
",",
"int",
"type",
")",
"throws",
"CmsException",
",",
"CmsIllegalArgumentException",
"{",
"return",
"createResource",
"(",
"resourcename",
",",
"type",
",",
"new",
"byte",
"[",
"0",
"]",
... | Creates a new resource of the given resource type with empty content and no properties.<p>
@see #createResource(String, int, byte[], List)
@param resourcename the name of the resource to create (full path)
@param type the type of the resource to create
@return the created resource
@throws CmsException if something ... | [
"Creates",
"a",
"new",
"resource",
"of",
"the",
"given",
"resource",
"type",
"with",
"empty",
"content",
"and",
"no",
"properties",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/CmsObjectWrapper.java#L161-L164 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.