repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 196 | func_name stringlengths 7 107 | whole_func_string stringlengths 76 3.82k | language stringclasses 1
value | func_code_string stringlengths 76 3.82k | func_code_tokens listlengths 22 717 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 508 | split_name stringclasses 1
value | func_code_url stringlengths 111 310 |
|---|---|---|---|---|---|---|---|---|---|---|
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.executeGraphPathRequestAsync | @Deprecated
public static RequestAsyncTask executeGraphPathRequestAsync(Session session, String graphPath, Callback callback) {
return newGraphPathRequest(session, graphPath, callback).executeAsync();
} | java | @Deprecated
public static RequestAsyncTask executeGraphPathRequestAsync(Session session, String graphPath, Callback callback) {
return newGraphPathRequest(session, graphPath, callback).executeAsync();
} | [
"@",
"Deprecated",
"public",
"static",
"RequestAsyncTask",
"executeGraphPathRequestAsync",
"(",
"Session",
"session",
",",
"String",
"graphPath",
",",
"Callback",
"callback",
")",
"{",
"return",
"newGraphPathRequest",
"(",
"session",
",",
"graphPath",
",",
"callback",... | Starts a new Request configured to retrieve a particular graph path.
<p/>
This should only be called from the UI thread.
This method is deprecated. Prefer to call Request.newGraphPathRequest(...).executeAsync();
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param gra... | [
"Starts",
"a",
"new",
"Request",
"configured",
"to",
"retrieve",
"a",
"particular",
"graph",
"path",
".",
"<p",
"/",
">",
"This",
"should",
"only",
"be",
"called",
"from",
"the",
"UI",
"thread",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L1192-L1195 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java | DefaultElementProducer.makeImageTranslucent | public static BufferedImage makeImageTranslucent(BufferedImage source, float opacity) {
if (opacity == 1) {
return source;
}
BufferedImage translucent = new BufferedImage(source.getWidth(), source.getHeight(), BufferedImage.TRANSLUCENT);
Graphics2D g = translucent.createGraphics();
... | java | public static BufferedImage makeImageTranslucent(BufferedImage source, float opacity) {
if (opacity == 1) {
return source;
}
BufferedImage translucent = new BufferedImage(source.getWidth(), source.getHeight(), BufferedImage.TRANSLUCENT);
Graphics2D g = translucent.createGraphics();
... | [
"public",
"static",
"BufferedImage",
"makeImageTranslucent",
"(",
"BufferedImage",
"source",
",",
"float",
"opacity",
")",
"{",
"if",
"(",
"opacity",
"==",
"1",
")",
"{",
"return",
"source",
";",
"}",
"BufferedImage",
"translucent",
"=",
"new",
"BufferedImage",
... | returns a transparent image when opacity < 1
@param source
@param opacity
@return | [
"returns",
"a",
"transparent",
"image",
"when",
"opacity",
"<",
";",
"1"
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java#L426-L436 |
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/BackupEnginesInner.java | BackupEnginesInner.listAsync | public Observable<Page<BackupEngineBaseResourceInner>> listAsync(final String vaultName, final String resourceGroupName) {
return listWithServiceResponseAsync(vaultName, resourceGroupName)
.map(new Func1<ServiceResponse<Page<BackupEngineBaseResourceInner>>, Page<BackupEngineBaseResourceInner>>() {
... | java | public Observable<Page<BackupEngineBaseResourceInner>> listAsync(final String vaultName, final String resourceGroupName) {
return listWithServiceResponseAsync(vaultName, resourceGroupName)
.map(new Func1<ServiceResponse<Page<BackupEngineBaseResourceInner>>, Page<BackupEngineBaseResourceInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"BackupEngineBaseResourceInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"vaultName",
",",
"final",
"String",
"resourceGroupName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"vaultName",
",",
"resourceGrou... | Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@throws IllegalArgumentException thrown if parameters fail... | [
"Backup",
"management",
"servers",
"registered",
"to",
"Recovery",
"Services",
"Vault",
".",
"Returns",
"a",
"pageable",
"list",
"of",
"servers",
"."
] | 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/BackupEnginesInner.java#L123-L131 |
roboconf/roboconf-platform | core/roboconf-agent/src/main/java/net/roboconf/agent/internal/misc/UserDataHelper.java | UserDataHelper.findParametersFromUrl | public AgentProperties findParametersFromUrl( String url, Logger logger ) {
logger.info( "User data are being retrieved from URL: " + url );
AgentProperties result = null;
try {
URI uri = UriUtils.urlToUri( url );
Properties props = new Properties();
InputStream in = null;
try {
in = uri.toURL().... | java | public AgentProperties findParametersFromUrl( String url, Logger logger ) {
logger.info( "User data are being retrieved from URL: " + url );
AgentProperties result = null;
try {
URI uri = UriUtils.urlToUri( url );
Properties props = new Properties();
InputStream in = null;
try {
in = uri.toURL().... | [
"public",
"AgentProperties",
"findParametersFromUrl",
"(",
"String",
"url",
",",
"Logger",
"logger",
")",
"{",
"logger",
".",
"info",
"(",
"\"User data are being retrieved from URL: \"",
"+",
"url",
")",
";",
"AgentProperties",
"result",
"=",
"null",
";",
"try",
"... | Retrieve the agent's configuration from an URL.
@param logger a logger
@return the agent's data, or null if they could not be parsed | [
"Retrieve",
"the",
"agent",
"s",
"configuration",
"from",
"an",
"URL",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent/src/main/java/net/roboconf/agent/internal/misc/UserDataHelper.java#L213-L237 |
allcolor/YaHP-Converter | YaHPConverter/src/org/allcolor/yahp/converter/CClassLoader.java | CClassLoader.createMemoryURL | public static URL createMemoryURL(final String entryName, final byte[] entry) {
try {
final Class c = ClassLoader.getSystemClassLoader().loadClass(
"org.allcolor.yahp.converter.CMemoryURLHandler");
final Method m = c.getDeclaredMethod("createMemoryURL",
new Class[] { String.class, byte[].class });
... | java | public static URL createMemoryURL(final String entryName, final byte[] entry) {
try {
final Class c = ClassLoader.getSystemClassLoader().loadClass(
"org.allcolor.yahp.converter.CMemoryURLHandler");
final Method m = c.getDeclaredMethod("createMemoryURL",
new Class[] { String.class, byte[].class });
... | [
"public",
"static",
"URL",
"createMemoryURL",
"(",
"final",
"String",
"entryName",
",",
"final",
"byte",
"[",
"]",
"entry",
")",
"{",
"try",
"{",
"final",
"Class",
"c",
"=",
"ClassLoader",
".",
"getSystemClassLoader",
"(",
")",
".",
"loadClass",
"(",
"\"or... | Creates and allocates a memory URL
@param entryName
name of the entry
@param entry
byte array of the entry
@return the created URL or null if an error occurs. | [
"Creates",
"and",
"allocates",
"a",
"memory",
"URL"
] | train | https://github.com/allcolor/YaHP-Converter/blob/d72745281766a784a6b319f3787aa1d8de7cd0fe/YaHPConverter/src/org/allcolor/yahp/converter/CClassLoader.java#L143-L155 |
elastic/elasticsearch-metrics-reporter-java | src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java | ElasticsearchReporter.writeJsonMetric | private void writeJsonMetric(JsonMetric jsonMetric, ObjectWriter writer, OutputStream out) throws IOException {
writer.writeValue(out, new BulkIndexOperationHeader(currentIndexName, jsonMetric.type()));
out.write("\n".getBytes());
writer.writeValue(out, jsonMetric);
out.write("\n".getByt... | java | private void writeJsonMetric(JsonMetric jsonMetric, ObjectWriter writer, OutputStream out) throws IOException {
writer.writeValue(out, new BulkIndexOperationHeader(currentIndexName, jsonMetric.type()));
out.write("\n".getBytes());
writer.writeValue(out, jsonMetric);
out.write("\n".getByt... | [
"private",
"void",
"writeJsonMetric",
"(",
"JsonMetric",
"jsonMetric",
",",
"ObjectWriter",
"writer",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"writer",
".",
"writeValue",
"(",
"out",
",",
"new",
"BulkIndexOperationHeader",
"(",
"currentIndexNa... | serialize a JSON metric over the outputstream in a bulk request | [
"serialize",
"a",
"JSON",
"metric",
"over",
"the",
"outputstream",
"in",
"a",
"bulk",
"request"
] | train | https://github.com/elastic/elasticsearch-metrics-reporter-java/blob/4018eaef6fc7721312f7440b2bf5a19699a6cb56/src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java#L424-L431 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/chunklistener/ChunkListener.java | ChunkListener.isValidPostListener | public boolean isValidPostListener(Chunk chunk, BlockPos listener, BlockPos modified, IBlockState oldState, IBlockState newState)
{
if (listener.equals(modified))
return false;
IBlockListener.Post bl = IComponent.getComponent(IBlockListener.Post.class, chunk.getWorld().getBlockState(listener).getBlock());
if ... | java | public boolean isValidPostListener(Chunk chunk, BlockPos listener, BlockPos modified, IBlockState oldState, IBlockState newState)
{
if (listener.equals(modified))
return false;
IBlockListener.Post bl = IComponent.getComponent(IBlockListener.Post.class, chunk.getWorld().getBlockState(listener).getBlock());
if ... | [
"public",
"boolean",
"isValidPostListener",
"(",
"Chunk",
"chunk",
",",
"BlockPos",
"listener",
",",
"BlockPos",
"modified",
",",
"IBlockState",
"oldState",
",",
"IBlockState",
"newState",
")",
"{",
"if",
"(",
"listener",
".",
"equals",
"(",
"modified",
")",
"... | Checks if the listener {@link BlockPos} has a {@link IBlockListener.Pre} component and if the modified {@code BlockPos} is in range.
@param chunk the chunk
@param listener the listener
@param modified the modified
@param oldState the old state
@param newState the new state
@return true, if is valid post listener | [
"Checks",
"if",
"the",
"listener",
"{",
"@link",
"BlockPos",
"}",
"has",
"a",
"{",
"@link",
"IBlockListener",
".",
"Pre",
"}",
"component",
"and",
"if",
"the",
"modified",
"{",
"@code",
"BlockPos",
"}",
"is",
"in",
"range",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/chunklistener/ChunkListener.java#L126-L135 |
lucee/Lucee | core/src/main/java/lucee/commons/io/IOUtil.java | IOUtil.merge | public static final void merge(InputStream in1, InputStream in2, OutputStream out, boolean closeIS1, boolean closeIS2, boolean closeOS) throws IOException {
try {
merge(in1, in2, out, 0xffff);
}
finally {
if (closeIS1) closeEL(in1);
if (closeIS2) closeEL(in2);
if (closeOS) closeEL(out);
}
} | java | public static final void merge(InputStream in1, InputStream in2, OutputStream out, boolean closeIS1, boolean closeIS2, boolean closeOS) throws IOException {
try {
merge(in1, in2, out, 0xffff);
}
finally {
if (closeIS1) closeEL(in1);
if (closeIS2) closeEL(in2);
if (closeOS) closeEL(out);
}
} | [
"public",
"static",
"final",
"void",
"merge",
"(",
"InputStream",
"in1",
",",
"InputStream",
"in2",
",",
"OutputStream",
"out",
",",
"boolean",
"closeIS1",
",",
"boolean",
"closeIS2",
",",
"boolean",
"closeOS",
")",
"throws",
"IOException",
"{",
"try",
"{",
... | copy a inputstream to a outputstream
@param in
@param out
@param closeIS
@param closeOS
@throws IOException | [
"copy",
"a",
"inputstream",
"to",
"a",
"outputstream"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L93-L102 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201811/exchangerateservice/CreateExchangeRates.java | CreateExchangeRates.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the ExchangeRateService.
ExchangeRateServiceInterface exchangeRateService =
adManagerServices.get(session, ExchangeRateServiceInterface.class);
// Create an exchange ra... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the ExchangeRateService.
ExchangeRateServiceInterface exchangeRateService =
adManagerServices.get(session, ExchangeRateServiceInterface.class);
// Create an exchange ra... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the ExchangeRateService.",
"ExchangeRateServiceInterface",
"exchangeRateService",
"=",
"adManagerServices",
... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201811/exchangerateservice/CreateExchangeRates.java#L52-L86 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java | LoggerRegistry.getLogger | public T getLogger(final String name, final MessageFactory messageFactory) {
return getOrCreateInnerMap(factoryKey(messageFactory)).get(name);
} | java | public T getLogger(final String name, final MessageFactory messageFactory) {
return getOrCreateInnerMap(factoryKey(messageFactory)).get(name);
} | [
"public",
"T",
"getLogger",
"(",
"final",
"String",
"name",
",",
"final",
"MessageFactory",
"messageFactory",
")",
"{",
"return",
"getOrCreateInnerMap",
"(",
"factoryKey",
"(",
"messageFactory",
")",
")",
".",
"get",
"(",
"name",
")",
";",
"}"
] | Returns an ExtendedLogger.
@param name The name of the Logger to return.
@param messageFactory The message factory is used only when creating a logger, subsequent use does not change
the logger but will log a warning if mismatched.
@return The logger with the specified name. | [
"Returns",
"an",
"ExtendedLogger",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java#L124-L126 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/UnionFindRemSP.java | UnionFindRemSP.link | @Override
public int link(int x, int y) {
if (x < y) {
p[x] = y;
return y;
}
p[y] = x;
return x;
} | java | @Override
public int link(int x, int y) {
if (x < y) {
p[x] = y;
return y;
}
p[y] = x;
return x;
} | [
"@",
"Override",
"public",
"int",
"link",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"x",
"<",
"y",
")",
"{",
"p",
"[",
"x",
"]",
"=",
"y",
";",
"return",
"y",
";",
"}",
"p",
"[",
"y",
"]",
"=",
"x",
";",
"return",
"x",
";",... | Unites two given sets. Note that the behavior of this method is not specified if the given parameters are normal
elements and no set identifiers.
@param x
the first set
@param y
the second set
@return the identifier of the resulting set (either {@code x} or {@code y}) | [
"Unites",
"two",
"given",
"sets",
".",
"Note",
"that",
"the",
"behavior",
"of",
"this",
"method",
"is",
"not",
"specified",
"if",
"the",
"given",
"parameters",
"are",
"normal",
"elements",
"and",
"no",
"set",
"identifiers",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/UnionFindRemSP.java#L140-L148 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/executors/IteratorExecutor.java | IteratorExecutor.verifyAllSuccessful | public static <T> boolean verifyAllSuccessful(List<Either<T, ExecutionException>> results) {
return Iterables.all(results, new Predicate<Either<T, ExecutionException>>() {
@Override
public boolean apply(@Nullable Either<T, ExecutionException> input) {
return input instanceof Either.Left;
}... | java | public static <T> boolean verifyAllSuccessful(List<Either<T, ExecutionException>> results) {
return Iterables.all(results, new Predicate<Either<T, ExecutionException>>() {
@Override
public boolean apply(@Nullable Either<T, ExecutionException> input) {
return input instanceof Either.Left;
}... | [
"public",
"static",
"<",
"T",
">",
"boolean",
"verifyAllSuccessful",
"(",
"List",
"<",
"Either",
"<",
"T",
",",
"ExecutionException",
">",
">",
"results",
")",
"{",
"return",
"Iterables",
".",
"all",
"(",
"results",
",",
"new",
"Predicate",
"<",
"Either",
... | Utility method that checks whether all tasks succeeded from the output of {@link #executeAndGetResults()}.
@return true if all tasks succeeded. | [
"Utility",
"method",
"that",
"checks",
"whether",
"all",
"tasks",
"succeeded",
"from",
"the",
"output",
"of",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/executors/IteratorExecutor.java#L140-L147 |
infinispan/infinispan | server/hotrod/src/main/java/org/infinispan/server/hotrod/transport/ExtendedByteBuf.java | ExtendedByteBuf.readOptString | public static Optional<String> readOptString(ByteBuf bf) {
Optional<byte[]> bytes = readOptRangedBytes(bf);
return bytes.map(b -> new String(b, CharsetUtil.UTF_8));
} | java | public static Optional<String> readOptString(ByteBuf bf) {
Optional<byte[]> bytes = readOptRangedBytes(bf);
return bytes.map(b -> new String(b, CharsetUtil.UTF_8));
} | [
"public",
"static",
"Optional",
"<",
"String",
">",
"readOptString",
"(",
"ByteBuf",
"bf",
")",
"{",
"Optional",
"<",
"byte",
"[",
"]",
">",
"bytes",
"=",
"readOptRangedBytes",
"(",
"bf",
")",
";",
"return",
"bytes",
".",
"map",
"(",
"b",
"->",
"new",
... | Reads an optional String. 0 length is an empty string, negative length is translated to None. | [
"Reads",
"an",
"optional",
"String",
".",
"0",
"length",
"is",
"an",
"empty",
"string",
"negative",
"length",
"is",
"translated",
"to",
"None",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/hotrod/src/main/java/org/infinispan/server/hotrod/transport/ExtendedByteBuf.java#L67-L70 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/tools/WikipediaCleaner.java | WikipediaCleaner.removeWikiLinkMarkup | public void removeWikiLinkMarkup(StringBuilder article, String title) {
int bracketStart = article.indexOf("[[");
boolean includeLinkText =
options.contains(CleanerOption.INCLUDE_LINK_TEXT);
while (bracketStart >= 0) {
// grab the linked article name which i... | java | public void removeWikiLinkMarkup(StringBuilder article, String title) {
int bracketStart = article.indexOf("[[");
boolean includeLinkText =
options.contains(CleanerOption.INCLUDE_LINK_TEXT);
while (bracketStart >= 0) {
// grab the linked article name which i... | [
"public",
"void",
"removeWikiLinkMarkup",
"(",
"StringBuilder",
"article",
",",
"String",
"title",
")",
"{",
"int",
"bracketStart",
"=",
"article",
".",
"indexOf",
"(",
"\"[[\"",
")",
";",
"boolean",
"includeLinkText",
"=",
"options",
".",
"contains",
"(",
"Cl... | Replace [[link]] tags with link name and track what articles this article
links to.
@param text The article text to clean and process link structure of.
@return A Duple containing the cleaned text and the outgoing link count. | [
"Replace",
"[[",
"link",
"]]",
"tags",
"with",
"link",
"name",
"and",
"track",
"what",
"articles",
"this",
"article",
"links",
"to",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/tools/WikipediaCleaner.java#L362-L407 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/EnumHelper.java | EnumHelper.getFromNameCaseInsensitiveOrNull | @Nullable
public static <ENUMTYPE extends Enum <ENUMTYPE> & IHasName> ENUMTYPE getFromNameCaseInsensitiveOrNull (@Nonnull final Class <ENUMTYPE> aClass,
@Nullable final String sName)
{
return getFromNameCase... | java | @Nullable
public static <ENUMTYPE extends Enum <ENUMTYPE> & IHasName> ENUMTYPE getFromNameCaseInsensitiveOrNull (@Nonnull final Class <ENUMTYPE> aClass,
@Nullable final String sName)
{
return getFromNameCase... | [
"@",
"Nullable",
"public",
"static",
"<",
"ENUMTYPE",
"extends",
"Enum",
"<",
"ENUMTYPE",
">",
"&",
"IHasName",
">",
"ENUMTYPE",
"getFromNameCaseInsensitiveOrNull",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"ENUMTYPE",
">",
"aClass",
",",
"@",
"Nullable",
"f... | Get the enum value with the passed name case insensitive
@param <ENUMTYPE>
The enum type
@param aClass
The enum class
@param sName
The name to search
@return <code>null</code> if no enum item with the given ID is present. | [
"Get",
"the",
"enum",
"value",
"with",
"the",
"passed",
"name",
"case",
"insensitive"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/EnumHelper.java#L418-L423 |
EdwardRaff/JSAT | JSAT/src/jsat/io/JSATData.java | JSATData.loadRegression | public static RegressionDataSet loadRegression(InputStream inRaw, DataStore backingStore) throws IOException
{
return (RegressionDataSet) load(inRaw, backingStore);
} | java | public static RegressionDataSet loadRegression(InputStream inRaw, DataStore backingStore) throws IOException
{
return (RegressionDataSet) load(inRaw, backingStore);
} | [
"public",
"static",
"RegressionDataSet",
"loadRegression",
"(",
"InputStream",
"inRaw",
",",
"DataStore",
"backingStore",
")",
"throws",
"IOException",
"{",
"return",
"(",
"RegressionDataSet",
")",
"load",
"(",
"inRaw",
",",
"backingStore",
")",
";",
"}"
] | Loads in a JSAT dataset as a {@link RegressionDataSet}. An exception
will be thrown if the original dataset in the file was not a
{@link RegressionDataSet}.
@param inRaw the input stream, caller should buffer it
@param backingStore the data store to put all data points in
@return a RegressionDataSet object
@throws IOE... | [
"Loads",
"in",
"a",
"JSAT",
"dataset",
"as",
"a",
"{",
"@link",
"RegressionDataSet",
"}",
".",
"An",
"exception",
"will",
"be",
"thrown",
"if",
"the",
"original",
"dataset",
"in",
"the",
"file",
"was",
"not",
"a",
"{",
"@link",
"RegressionDataSet",
"}",
... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/JSATData.java#L599-L602 |
cdapio/netty-http | src/main/java/io/cdap/http/internal/ParamConvertUtils.java | ParamConvertUtils.createPrimitiveTypeConverter | @Nullable
private static Converter<List<String>, Object> createPrimitiveTypeConverter(final Class<?> resultClass) {
Object defaultValue = defaultValue(resultClass);
if (defaultValue == null) {
// For primitive type, the default value shouldn't be null
return null;
}
return new BasicConve... | java | @Nullable
private static Converter<List<String>, Object> createPrimitiveTypeConverter(final Class<?> resultClass) {
Object defaultValue = defaultValue(resultClass);
if (defaultValue == null) {
// For primitive type, the default value shouldn't be null
return null;
}
return new BasicConve... | [
"@",
"Nullable",
"private",
"static",
"Converter",
"<",
"List",
"<",
"String",
">",
",",
"Object",
">",
"createPrimitiveTypeConverter",
"(",
"final",
"Class",
"<",
"?",
">",
"resultClass",
")",
"{",
"Object",
"defaultValue",
"=",
"defaultValue",
"(",
"resultCl... | Creates a converter function that converts value into primitive type.
@return A converter function or {@code null} if the given type is not primitive type or boxed type | [
"Creates",
"a",
"converter",
"function",
"that",
"converts",
"value",
"into",
"primitive",
"type",
"."
] | train | https://github.com/cdapio/netty-http/blob/02fdbb45bdd51d3dd58c0efbb2f27195d265cd0f/src/main/java/io/cdap/http/internal/ParamConvertUtils.java#L158-L173 |
flow/commons | src/main/java/com/flowpowered/commons/ViewFrustum.java | ViewFrustum.intersectsCuboid | public boolean intersectsCuboid(Vector3f[] vertices, float x, float y, float z) {
if (vertices.length != 8) {
throw new IllegalArgumentException("A cuboid has 8 vertices, not " + vertices.length);
}
planes:
for (int i = 0; i < 6; i++) {
for (Vector3f vertex : vert... | java | public boolean intersectsCuboid(Vector3f[] vertices, float x, float y, float z) {
if (vertices.length != 8) {
throw new IllegalArgumentException("A cuboid has 8 vertices, not " + vertices.length);
}
planes:
for (int i = 0; i < 6; i++) {
for (Vector3f vertex : vert... | [
"public",
"boolean",
"intersectsCuboid",
"(",
"Vector3f",
"[",
"]",
"vertices",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"if",
"(",
"vertices",
".",
"length",
"!=",
"8",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",... | Checks if the frustum of this camera intersects the given cuboid vertices.
@param vertices The cuboid local vertices to check the frustum against
@param x The x coordinate of the cuboid position
@param y The y coordinate of the cuboid position
@param z The z coordinate of the cuboid position
@return Whether or not the... | [
"Checks",
"if",
"the",
"frustum",
"of",
"this",
"camera",
"intersects",
"the",
"given",
"cuboid",
"vertices",
"."
] | train | https://github.com/flow/commons/blob/0690efdac06fd728fcd7e9cf10f2b1319379c45b/src/main/java/com/flowpowered/commons/ViewFrustum.java#L240-L254 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Signature.java | Signature.appendArgs | public Signature appendArgs(String[] names, Class<?>... types) {
assert names.length == types.length : "names and types must be of the same length";
String[] newArgNames = new String[argNames.length + names.length];
System.arraycopy(argNames, 0, newArgNames, 0, argNames.length);
System.... | java | public Signature appendArgs(String[] names, Class<?>... types) {
assert names.length == types.length : "names and types must be of the same length";
String[] newArgNames = new String[argNames.length + names.length];
System.arraycopy(argNames, 0, newArgNames, 0, argNames.length);
System.... | [
"public",
"Signature",
"appendArgs",
"(",
"String",
"[",
"]",
"names",
",",
"Class",
"<",
"?",
">",
"...",
"types",
")",
"{",
"assert",
"names",
".",
"length",
"==",
"types",
".",
"length",
":",
"\"names and types must be of the same length\"",
";",
"String",
... | Append an argument (name + type) to the signature.
@param names the names of the arguments
@param types the types of the argument
@return a new signature with the added arguments | [
"Append",
"an",
"argument",
"(",
"name",
"+",
"type",
")",
"to",
"the",
"signature",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L202-L210 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.createTransferMessageSenderFromEntityPathAsync | public static CompletableFuture<IMessageSender> createTransferMessageSenderFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, String viaEntityPath)
{
Utils.assertNonNull("messagingFactory", messagingFactory);
MessageSender sender = new MessageSender(messagingFactory, viaEntity... | java | public static CompletableFuture<IMessageSender> createTransferMessageSenderFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath, String viaEntityPath)
{
Utils.assertNonNull("messagingFactory", messagingFactory);
MessageSender sender = new MessageSender(messagingFactory, viaEntity... | [
"public",
"static",
"CompletableFuture",
"<",
"IMessageSender",
">",
"createTransferMessageSenderFromEntityPathAsync",
"(",
"MessagingFactory",
"messagingFactory",
",",
"String",
"entityPath",
",",
"String",
"viaEntityPath",
")",
"{",
"Utils",
".",
"assertNonNull",
"(",
"... | Creates a transfer message sender asynchronously. This sender sends message to destination entity via another entity.
This is mainly to be used when sending messages in a transaction.
When messages need to be sent across entities in a single transaction, this can be used to ensure
all the messages land initially in th... | [
"Creates",
"a",
"transfer",
"message",
"sender",
"asynchronously",
".",
"This",
"sender",
"sends",
"message",
"to",
"destination",
"entity",
"via",
"another",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L209-L214 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/JobmanagerInfoServlet.java | JobmanagerInfoServlet.writeJsonForJobs | private void writeJsonForJobs(PrintWriter wrt, List<RecentJobEvent> jobs) {
try {
wrt.write("[");
// Loop Jobs
for (int i = 0; i < jobs.size(); i++) {
RecentJobEvent jobEvent = jobs.get(i);
writeJsonForJob(wrt, jobEvent);
//Write seperator between json objects
if(i != jobs.size(... | java | private void writeJsonForJobs(PrintWriter wrt, List<RecentJobEvent> jobs) {
try {
wrt.write("[");
// Loop Jobs
for (int i = 0; i < jobs.size(); i++) {
RecentJobEvent jobEvent = jobs.get(i);
writeJsonForJob(wrt, jobEvent);
//Write seperator between json objects
if(i != jobs.size(... | [
"private",
"void",
"writeJsonForJobs",
"(",
"PrintWriter",
"wrt",
",",
"List",
"<",
"RecentJobEvent",
">",
"jobs",
")",
"{",
"try",
"{",
"wrt",
".",
"write",
"(",
"\"[\"",
")",
";",
"// Loop Jobs",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"jo... | Writes ManagementGraph as Json for all recent jobs
@param wrt
@param jobs | [
"Writes",
"ManagementGraph",
"as",
"Json",
"for",
"all",
"recent",
"jobs"
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/web/JobmanagerInfoServlet.java#L119-L144 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java | SpiceManager.putDataInCache | public <T> Future<T> putDataInCache(final Object cacheKey, final T data) throws CacheSavingException, CacheCreationException {
return executeCommand(new PutDataInCacheCommand<T>(this, data, cacheKey));
} | java | public <T> Future<T> putDataInCache(final Object cacheKey, final T data) throws CacheSavingException, CacheCreationException {
return executeCommand(new PutDataInCacheCommand<T>(this, data, cacheKey));
} | [
"public",
"<",
"T",
">",
"Future",
"<",
"T",
">",
"putDataInCache",
"(",
"final",
"Object",
"cacheKey",
",",
"final",
"T",
"data",
")",
"throws",
"CacheSavingException",
",",
"CacheCreationException",
"{",
"return",
"executeCommand",
"(",
"new",
"PutDataInCacheC... | Put some new data in cache using cache key <i>requestCacheKey</i>. This
method doesn't perform any network processing, it just data in cache,
erasing any previsouly saved date in cache using the same class and key.
Don't call this method in the main thread because you could block it.
Instead, use the asynchronous versi... | [
"Put",
"some",
"new",
"data",
"in",
"cache",
"using",
"cache",
"key",
"<i",
">",
"requestCacheKey<",
"/",
"i",
">",
".",
"This",
"method",
"doesn",
"t",
"perform",
"any",
"network",
"processing",
"it",
"just",
"data",
"in",
"cache",
"erasing",
"any",
"pr... | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L925-L927 |
Appendium/objectlabkit | utils/src/main/java/net/objectlab/kit/console/ConsoleMenu.java | ConsoleMenu.getBoolean | public static boolean getBoolean(final String title, final boolean defaultValue) {
final String val = ConsoleMenu.selectOne(title, new String[] { "Yes", "No" },
new String[] { Boolean.TRUE.toString(), Boolean.FALSE.toString() }, defaultValue ? 1 : 2);
return Boolean.valueOf(val);
... | java | public static boolean getBoolean(final String title, final boolean defaultValue) {
final String val = ConsoleMenu.selectOne(title, new String[] { "Yes", "No" },
new String[] { Boolean.TRUE.toString(), Boolean.FALSE.toString() }, defaultValue ? 1 : 2);
return Boolean.valueOf(val);
... | [
"public",
"static",
"boolean",
"getBoolean",
"(",
"final",
"String",
"title",
",",
"final",
"boolean",
"defaultValue",
")",
"{",
"final",
"String",
"val",
"=",
"ConsoleMenu",
".",
"selectOne",
"(",
"title",
",",
"new",
"String",
"[",
"]",
"{",
"\"Yes\"",
"... | Gets a boolean from the System.in
@param title
for the command line
@return boolean as selected by the user of the console app | [
"Gets",
"a",
"boolean",
"from",
"the",
"System",
".",
"in"
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/console/ConsoleMenu.java#L244-L249 |
aoindustries/ao-taglib | src/main/java/com/aoindustries/taglib/AttributeUtils.java | AttributeUtils.resolveValue | public static <T> T resolveValue(Object value, Class<T> type, ELContext elContext) {
if(value == null) {
return null;
} else if(value instanceof ValueExpression) {
return resolveValue((ValueExpression)value, type, elContext);
} else {
return type.cast(value);
}
} | java | public static <T> T resolveValue(Object value, Class<T> type, ELContext elContext) {
if(value == null) {
return null;
} else if(value instanceof ValueExpression) {
return resolveValue((ValueExpression)value, type, elContext);
} else {
return type.cast(value);
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"resolveValue",
"(",
"Object",
"value",
",",
"Class",
"<",
"T",
">",
"type",
",",
"ELContext",
"elContext",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",... | Casts or evaluates an expression then casts to the provided type. | [
"Casts",
"or",
"evaluates",
"an",
"expression",
"then",
"casts",
"to",
"the",
"provided",
"type",
"."
] | train | https://github.com/aoindustries/ao-taglib/blob/5670eba8485196bd42d31d3ff09a42deacb025f8/src/main/java/com/aoindustries/taglib/AttributeUtils.java#L61-L69 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java | JvmTypesBuilder.newTypeRef | @Deprecated
public JvmTypeReference newTypeRef(EObject ctx, Class<?> clazz, JvmTypeReference... typeArgs) {
return references.getTypeForName(clazz, ctx, typeArgs);
} | java | @Deprecated
public JvmTypeReference newTypeRef(EObject ctx, Class<?> clazz, JvmTypeReference... typeArgs) {
return references.getTypeForName(clazz, ctx, typeArgs);
} | [
"@",
"Deprecated",
"public",
"JvmTypeReference",
"newTypeRef",
"(",
"EObject",
"ctx",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"JvmTypeReference",
"...",
"typeArgs",
")",
"{",
"return",
"references",
".",
"getTypeForName",
"(",
"clazz",
",",
"ctx",
",",
"t... | Creates a new {@link JvmTypeReference} pointing to the given class and containing the given type arguments.
@param ctx
an EMF context, which is used to look up the {@link org.eclipse.xtext.common.types.JvmType} for the
given clazz.
@param clazz
the class the type reference shall point to.
@param typeArgs
type argument... | [
"Creates",
"a",
"new",
"{",
"@link",
"JvmTypeReference",
"}",
"pointing",
"to",
"the",
"given",
"class",
"and",
"containing",
"the",
"given",
"type",
"arguments",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java#L1298-L1301 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/RunnableUtils.java | RunnableUtils.runWithSleep | public static boolean runWithSleep(long milliseconds, Runnable runnable) {
Assert.isTrue(milliseconds > 0, "Milliseconds [%d] must be greater than 0", milliseconds);
runnable.run();
return ThreadUtils.sleep(milliseconds, 0);
} | java | public static boolean runWithSleep(long milliseconds, Runnable runnable) {
Assert.isTrue(milliseconds > 0, "Milliseconds [%d] must be greater than 0", milliseconds);
runnable.run();
return ThreadUtils.sleep(milliseconds, 0);
} | [
"public",
"static",
"boolean",
"runWithSleep",
"(",
"long",
"milliseconds",
",",
"Runnable",
"runnable",
")",
"{",
"Assert",
".",
"isTrue",
"(",
"milliseconds",
">",
"0",
",",
"\"Milliseconds [%d] must be greater than 0\"",
",",
"milliseconds",
")",
";",
"runnable",... | Runs the given {@link Runnable} object and then causes the current, calling {@link Thread} to sleep
for the given number of milliseconds.
This utility method can be used to simulate a long running, expensive operation.
@param milliseconds a long value with the number of milliseconds for the current {@link Thread} to ... | [
"Runs",
"the",
"given",
"{",
"@link",
"Runnable",
"}",
"object",
"and",
"then",
"causes",
"the",
"current",
"calling",
"{",
"@link",
"Thread",
"}",
"to",
"sleep",
"for",
"the",
"given",
"number",
"of",
"milliseconds",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RunnableUtils.java#L50-L57 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java | BoxApiFolder.getAddToCollectionRequest | public BoxRequestsFolder.AddFolderToCollection getAddToCollectionRequest(String folderId, String collectionId) {
BoxRequestsFolder.AddFolderToCollection request = new BoxRequestsFolder.AddFolderToCollection(folderId, collectionId, getFolderInfoUrl(folderId), mSession);
return request;
} | java | public BoxRequestsFolder.AddFolderToCollection getAddToCollectionRequest(String folderId, String collectionId) {
BoxRequestsFolder.AddFolderToCollection request = new BoxRequestsFolder.AddFolderToCollection(folderId, collectionId, getFolderInfoUrl(folderId), mSession);
return request;
} | [
"public",
"BoxRequestsFolder",
".",
"AddFolderToCollection",
"getAddToCollectionRequest",
"(",
"String",
"folderId",
",",
"String",
"collectionId",
")",
"{",
"BoxRequestsFolder",
".",
"AddFolderToCollection",
"request",
"=",
"new",
"BoxRequestsFolder",
".",
"AddFolderToColl... | Gets a request that adds a folder to a collection
@param folderId id of folder to add to collection
@param collectionId id of collection to add the folder to
@return request to add a folder to a collection | [
"Gets",
"a",
"request",
"that",
"adds",
"a",
"folder",
"to",
"a",
"collection"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L228-L231 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.toBean | public static <T> T toBean(String jsonString, Class<T> beanClass) {
return toBean(parseObj(jsonString), beanClass);
} | java | public static <T> T toBean(String jsonString, Class<T> beanClass) {
return toBean(parseObj(jsonString), beanClass);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"toBean",
"(",
"String",
"jsonString",
",",
"Class",
"<",
"T",
">",
"beanClass",
")",
"{",
"return",
"toBean",
"(",
"parseObj",
"(",
"jsonString",
")",
",",
"beanClass",
")",
";",
"}"
] | JSON字符串转为实体类对象,转换异常将被抛出
@param <T> Bean类型
@param jsonString JSON字符串
@param beanClass 实体类对象
@return 实体类对象
@since 3.1.2 | [
"JSON字符串转为实体类对象,转换异常将被抛出"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L330-L332 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/asm/AsmUtils.java | AsmUtils.changeFieldAccess | public static Field changeFieldAccess(Class<?> clazz, String fieldName)
{
return changeFieldAccess(clazz, fieldName, fieldName, false);
} | java | public static Field changeFieldAccess(Class<?> clazz, String fieldName)
{
return changeFieldAccess(clazz, fieldName, fieldName, false);
} | [
"public",
"static",
"Field",
"changeFieldAccess",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"return",
"changeFieldAccess",
"(",
"clazz",
",",
"fieldName",
",",
"fieldName",
",",
"false",
")",
";",
"}"
] | Changes the access level for the specified field for a class.
@param clazz the clazz
@param fieldName the field name
@return the field | [
"Changes",
"the",
"access",
"level",
"for",
"the",
"specified",
"field",
"for",
"a",
"class",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/asm/AsmUtils.java#L312-L315 |
biojava/biojava | biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/profeat/ProfeatProperties.java | ProfeatProperties.getTransition | public static double getTransition(ProteinSequence sequence, ATTRIBUTE attribute, TRANSITION transition) throws Exception{
return new ProfeatPropertiesImpl().getTransition(sequence, attribute, transition);
} | java | public static double getTransition(ProteinSequence sequence, ATTRIBUTE attribute, TRANSITION transition) throws Exception{
return new ProfeatPropertiesImpl().getTransition(sequence, attribute, transition);
} | [
"public",
"static",
"double",
"getTransition",
"(",
"ProteinSequence",
"sequence",
",",
"ATTRIBUTE",
"attribute",
",",
"TRANSITION",
"transition",
")",
"throws",
"Exception",
"{",
"return",
"new",
"ProfeatPropertiesImpl",
"(",
")",
".",
"getTransition",
"(",
"sequen... | An adaptor method which returns the number of transition between the specified groups for the given attribute with respect to the length of sequence.
@param sequence
a protein sequence consisting of non-ambiguous characters only
@param attribute
one of the seven attributes (Hydrophobicity, Volume, Polarity, Polarizabi... | [
"An",
"adaptor",
"method",
"which",
"returns",
"the",
"number",
"of",
"transition",
"between",
"the",
"specified",
"groups",
"for",
"the",
"given",
"attribute",
"with",
"respect",
"to",
"the",
"length",
"of",
"sequence",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/profeat/ProfeatProperties.java#L94-L96 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java | StateAssignmentOperation.checkParallelismPreconditions | private static void checkParallelismPreconditions(OperatorState operatorState, ExecutionJobVertex executionJobVertex) {
//----------------------------------------max parallelism preconditions-------------------------------------
if (operatorState.getMaxParallelism() < executionJobVertex.getParallelism()) {
thro... | java | private static void checkParallelismPreconditions(OperatorState operatorState, ExecutionJobVertex executionJobVertex) {
//----------------------------------------max parallelism preconditions-------------------------------------
if (operatorState.getMaxParallelism() < executionJobVertex.getParallelism()) {
thro... | [
"private",
"static",
"void",
"checkParallelismPreconditions",
"(",
"OperatorState",
"operatorState",
",",
"ExecutionJobVertex",
"executionJobVertex",
")",
"{",
"//----------------------------------------max parallelism preconditions-------------------------------------",
"if",
"(",
"op... | Verifies conditions in regards to parallelism and maxParallelism that must be met when restoring state.
@param operatorState state to restore
@param executionJobVertex task for which the state should be restored | [
"Verifies",
"conditions",
"in",
"regards",
"to",
"parallelism",
"and",
"maxParallelism",
"that",
"must",
"be",
"met",
"when",
"restoring",
"state",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java#L510-L541 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java | ApplicationGatewaysInner.beginUpdateTags | public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body();
} | java | public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body();
} | [
"public",
"ApplicationGatewayInner",
"beginUpdateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"applicationGatewayName",
")",
"{",
"return",
"beginUpdateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"applicationGatewayName",
")",
".",
"toBlocking",
... | Updates the specified application gateway tags.
@param resourceGroupName The name of the resource group.
@param applicationGatewayName The name of the application gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throw... | [
"Updates",
"the",
"specified",
"application",
"gateway",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java#L716-L718 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc.management.j2ee/src/com/ibm/ws/jdbc/management/j2ee/internal/JDBCResourceMBeanImpl.java | JDBCResourceMBeanImpl.setDataSourceChild | protected JDBCDataSourceMBeanImpl setDataSourceChild(String key, JDBCDataSourceMBeanImpl ds) {
return dataSourceMBeanChildrenList.put(key, ds);
} | java | protected JDBCDataSourceMBeanImpl setDataSourceChild(String key, JDBCDataSourceMBeanImpl ds) {
return dataSourceMBeanChildrenList.put(key, ds);
} | [
"protected",
"JDBCDataSourceMBeanImpl",
"setDataSourceChild",
"(",
"String",
"key",
",",
"JDBCDataSourceMBeanImpl",
"ds",
")",
"{",
"return",
"dataSourceMBeanChildrenList",
".",
"put",
"(",
"key",
",",
"ds",
")",
";",
"}"
] | setDataSourceChild add a child of type JDBCDataSourceMBeanImpl to this MBean.
@param key the String value which will be used as the key for the JDBCDataSourceMBeanImpl item
@param ds the JDBCDataSourceMBeanImpl value to be associated with the specified key
@return The previous value associated with key, or null if the... | [
"setDataSourceChild",
"add",
"a",
"child",
"of",
"type",
"JDBCDataSourceMBeanImpl",
"to",
"this",
"MBean",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc.management.j2ee/src/com/ibm/ws/jdbc/management/j2ee/internal/JDBCResourceMBeanImpl.java#L234-L236 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/impl/common/DefaultFileCopierUtil.java | DefaultFileCopierUtil.writeTempFile | @Override
public File writeTempFile(
ExecutionContext context, File original, InputStream input,
String script
) throws FileCopierException {
File tempfile = null;
try {
tempfile = ScriptfileUtils.createTempFile(context.getFramework());
} catch (IOExc... | java | @Override
public File writeTempFile(
ExecutionContext context, File original, InputStream input,
String script
) throws FileCopierException {
File tempfile = null;
try {
tempfile = ScriptfileUtils.createTempFile(context.getFramework());
} catch (IOExc... | [
"@",
"Override",
"public",
"File",
"writeTempFile",
"(",
"ExecutionContext",
"context",
",",
"File",
"original",
",",
"InputStream",
"input",
",",
"String",
"script",
")",
"throws",
"FileCopierException",
"{",
"File",
"tempfile",
"=",
"null",
";",
"try",
"{",
... | Write the file, stream, or text to a local temp file and return the file
@param context context
@param original source file, or null
@param input source inputstream or null
@param script source text, or null
@return temp file, this file should later be cleaned up by calling
{@link com.dtolabs.rundeck.core.execution.scr... | [
"Write",
"the",
"file",
"stream",
"or",
"text",
"to",
"a",
"local",
"temp",
"file",
"and",
"return",
"the",
"file"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/impl/common/DefaultFileCopierUtil.java#L427-L440 |
MGunlogson/CuckooFilter4J | src/main/java/com/github/mgunlogson/cuckoofilter4j/RamUsageEstimator.java | RamUsageEstimator.humanReadableUnits | static String humanReadableUnits(long bytes) {
return humanReadableUnits(bytes,
new DecimalFormat("0.#", DecimalFormatSymbols.getInstance(Locale.ROOT)));
} | java | static String humanReadableUnits(long bytes) {
return humanReadableUnits(bytes,
new DecimalFormat("0.#", DecimalFormatSymbols.getInstance(Locale.ROOT)));
} | [
"static",
"String",
"humanReadableUnits",
"(",
"long",
"bytes",
")",
"{",
"return",
"humanReadableUnits",
"(",
"bytes",
",",
"new",
"DecimalFormat",
"(",
"\"0.#\"",
",",
"DecimalFormatSymbols",
".",
"getInstance",
"(",
"Locale",
".",
"ROOT",
")",
")",
")",
";"... | Returns <code>size</code> in human-readable units (GB, MB, KB or bytes). | [
"Returns",
"<code",
">",
"size<",
"/",
"code",
">",
"in",
"human",
"-",
"readable",
"units",
"(",
"GB",
"MB",
"KB",
"or",
"bytes",
")",
"."
] | train | https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/RamUsageEstimator.java#L386-L389 |
atomix/atomix | core/src/main/java/io/atomix/core/registry/ClasspathScanningRegistry.java | ClasspathScanningRegistry.newInstance | @SuppressWarnings("unchecked")
private static <T> T newInstance(Class<?> type) {
try {
return (T) type.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
throw new ServiceException("Cannot instantiate service class " + type, e);
}
} | java | @SuppressWarnings("unchecked")
private static <T> T newInstance(Class<?> type) {
try {
return (T) type.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
throw new ServiceException("Cannot instantiate service class " + type, e);
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"try",
"{",
"return",
"(",
"T",
")",
"type",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
... | Instantiates the given type using a no-argument constructor.
@param type the type to instantiate
@param <T> the generic type
@return the instantiated object
@throws ServiceException if the type cannot be instantiated | [
"Instantiates",
"the",
"given",
"type",
"using",
"a",
"no",
"-",
"argument",
"constructor",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/core/src/main/java/io/atomix/core/registry/ClasspathScanningRegistry.java#L128-L135 |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/currency/CurrencyHelper.java | CurrencyHelper.parseValueFormat | @Nullable
public static BigDecimal parseValueFormat (@Nullable final ECurrency eCurrency,
@Nullable final String sTextValue,
@Nullable final BigDecimal aDefault)
{
final PerCurrencySettings aPCS = getSettings (eCurrency);
... | java | @Nullable
public static BigDecimal parseValueFormat (@Nullable final ECurrency eCurrency,
@Nullable final String sTextValue,
@Nullable final BigDecimal aDefault)
{
final PerCurrencySettings aPCS = getSettings (eCurrency);
... | [
"@",
"Nullable",
"public",
"static",
"BigDecimal",
"parseValueFormat",
"(",
"@",
"Nullable",
"final",
"ECurrency",
"eCurrency",
",",
"@",
"Nullable",
"final",
"String",
"sTextValue",
",",
"@",
"Nullable",
"final",
"BigDecimal",
"aDefault",
")",
"{",
"final",
"Pe... | Try to parse a string value formatted by the {@link DecimalFormat} object
returned from {@link #getValueFormat(ECurrency)}
@param eCurrency
The currency it is about. If <code>null</code> is provided
{@link #DEFAULT_CURRENCY} is used instead.
@param sTextValue
The string value. It will be trimmed, and the decimal separ... | [
"Try",
"to",
"parse",
"a",
"string",
"value",
"formatted",
"by",
"the",
"{",
"@link",
"DecimalFormat",
"}",
"object",
"returned",
"from",
"{",
"@link",
"#getValueFormat",
"(",
"ECurrency",
")",
"}"
] | train | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/currency/CurrencyHelper.java#L528-L546 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/ExpectedObjectInputStream.java | ExpectedObjectInputStream.resolveClass | @Override
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
if (!this.expected.contains(desc.getName())) {
throw new InvalidClassException("Unexpected deserialization ", desc.getName());
}
return super.resolveClass(desc);
} | java | @Override
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
if (!this.expected.contains(desc.getName())) {
throw new InvalidClassException("Unexpected deserialization ", desc.getName());
}
return super.resolveClass(desc);
} | [
"@",
"Override",
"protected",
"Class",
"<",
"?",
">",
"resolveClass",
"(",
"ObjectStreamClass",
"desc",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"if",
"(",
"!",
"this",
".",
"expected",
".",
"contains",
"(",
"desc",
".",
"getName",
"... | {@inheritDoc}
Only deserialize instances of expected classes by validating the class name prior to deserialization. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/ExpectedObjectInputStream.java#L61-L67 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/LayerValidation.java | LayerValidation.assertNInNOutSet | public static void assertNInNOutSet(String layerType, String layerName, long layerIndex, long nIn, long nOut) {
if (nIn <= 0 || nOut <= 0) {
if (layerName == null)
layerName = "(name not set)";
throw new DL4JInvalidConfigException(layerType + " (index=" + layerIndex + ", ... | java | public static void assertNInNOutSet(String layerType, String layerName, long layerIndex, long nIn, long nOut) {
if (nIn <= 0 || nOut <= 0) {
if (layerName == null)
layerName = "(name not set)";
throw new DL4JInvalidConfigException(layerType + " (index=" + layerIndex + ", ... | [
"public",
"static",
"void",
"assertNInNOutSet",
"(",
"String",
"layerType",
",",
"String",
"layerName",
",",
"long",
"layerIndex",
",",
"long",
"nIn",
",",
"long",
"nOut",
")",
"{",
"if",
"(",
"nIn",
"<=",
"0",
"||",
"nOut",
"<=",
"0",
")",
"{",
"if",
... | Asserts that the layer nIn and nOut values are set for the layer
@param layerType Type of layer ("DenseLayer", etc)
@param layerName Name of the layer (may be null if not set)
@param layerIndex Index of the layer
@param nIn nIn value
@param nOut nOut value | [
"Asserts",
"that",
"the",
"layer",
"nIn",
"and",
"nOut",
"values",
"are",
"set",
"for",
"the",
"layer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/LayerValidation.java#L50-L57 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java | ImplicitObjectUtil.loadOutputFormBean | public static void loadOutputFormBean(ServletRequest request, Object bean) {
if(bean != null)
request.setAttribute(OUTPUT_FORM_BEAN_OBJECT_KEY, bean);
} | java | public static void loadOutputFormBean(ServletRequest request, Object bean) {
if(bean != null)
request.setAttribute(OUTPUT_FORM_BEAN_OBJECT_KEY, bean);
} | [
"public",
"static",
"void",
"loadOutputFormBean",
"(",
"ServletRequest",
"request",
",",
"Object",
"bean",
")",
"{",
"if",
"(",
"bean",
"!=",
"null",
")",
"request",
".",
"setAttribute",
"(",
"OUTPUT_FORM_BEAN_OBJECT_KEY",
",",
"bean",
")",
";",
"}"
] | Load the output form bean into the request.
@param request the request
@param bean the output form bean | [
"Load",
"the",
"output",
"form",
"bean",
"into",
"the",
"request",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java#L165-L168 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jaspic/src/com/ibm/ws/security/jaspi/XMLJaspiConfiguration.java | XMLJaspiConfiguration.writeConfigFile | synchronized private void writeConfigFile(final JaspiConfig jaspiConfig) {
if (tc.isEntryEnabled())
Tr.entry(tc, "writeConfigFile", new Object[] { jaspiConfig });
if (configFile == null) {
// TODO handle persistence
//String msg = MessageFormatHelper.getFormattedMessa... | java | synchronized private void writeConfigFile(final JaspiConfig jaspiConfig) {
if (tc.isEntryEnabled())
Tr.entry(tc, "writeConfigFile", new Object[] { jaspiConfig });
if (configFile == null) {
// TODO handle persistence
//String msg = MessageFormatHelper.getFormattedMessa... | [
"synchronized",
"private",
"void",
"writeConfigFile",
"(",
"final",
"JaspiConfig",
"jaspiConfig",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"writeConfigFile\"",
",",
"new",
"Object",
"[",
"]",
"{... | Store the in-memory Java representation of the JASPI persistent providers into the given configuration file.
@param jaspiConfig
@throws RuntimeException if an exception occurs in method AccessController.doPrivileged. | [
"Store",
"the",
"in",
"-",
"memory",
"Java",
"representation",
"of",
"the",
"JASPI",
"persistent",
"providers",
"into",
"the",
"given",
"configuration",
"file",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jaspic/src/com/ibm/ws/security/jaspi/XMLJaspiConfiguration.java#L290-L317 |
d-michail/jheaps | src/main/java/org/jheaps/tree/ReflectedHeap.java | ReflectedHeap.decreaseKey | @SuppressWarnings("unchecked")
private void decreaseKey(ReflectedHandle<K, V> n, K newKey) {
if (n.inner == null && free != n) {
throw new IllegalArgumentException("Invalid handle!");
}
int c;
if (comparator == null) {
c = ((Comparable<? super K>) newKey).com... | java | @SuppressWarnings("unchecked")
private void decreaseKey(ReflectedHandle<K, V> n, K newKey) {
if (n.inner == null && free != n) {
throw new IllegalArgumentException("Invalid handle!");
}
int c;
if (comparator == null) {
c = ((Comparable<? super K>) newKey).com... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"decreaseKey",
"(",
"ReflectedHandle",
"<",
"K",
",",
"V",
">",
"n",
",",
"K",
"newKey",
")",
"{",
"if",
"(",
"n",
".",
"inner",
"==",
"null",
"&&",
"free",
"!=",
"n",
")",
"{",
... | Decrease the key of an element.
@param n
the element
@param newKey
the new key | [
"Decrease",
"the",
"key",
"of",
"an",
"element",
"."
] | train | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/tree/ReflectedHeap.java#L587-L632 |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/traverson/Traverson.java | Traverson.streamAs | public <T extends HalRepresentation> Stream<T> streamAs(final Class<T> type) throws IOException {
return streamAs(type, null);
} | java | public <T extends HalRepresentation> Stream<T> streamAs(final Class<T> type) throws IOException {
return streamAs(type, null);
} | [
"public",
"<",
"T",
"extends",
"HalRepresentation",
">",
"Stream",
"<",
"T",
">",
"streamAs",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"IOException",
"{",
"return",
"streamAs",
"(",
"type",
",",
"null",
")",
";",
"}"
] | Follow the {@link Link}s of the current resource, selected by its link-relation type and returns a {@link Stream}
containing the returned {@link HalRepresentation HalRepresentations}.
<p>
Templated links are expanded to URIs using the specified template variables.
</p>
<p>
If the current node has {@link Embedded embedd... | [
"Follow",
"the",
"{"
] | train | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/traverson/Traverson.java#L1004-L1006 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/LoggerFactory.java | LoggerFactory.getLogger | public static Logger getLogger(final Class<?> aClass, final String aBundleName) {
return getLogger(aClass.getName(), aBundleName);
} | java | public static Logger getLogger(final Class<?> aClass, final String aBundleName) {
return getLogger(aClass.getName(), aBundleName);
} | [
"public",
"static",
"Logger",
"getLogger",
"(",
"final",
"Class",
"<",
"?",
">",
"aClass",
",",
"final",
"String",
"aBundleName",
")",
"{",
"return",
"getLogger",
"(",
"aClass",
".",
"getName",
"(",
")",
",",
"aBundleName",
")",
";",
"}"
] | Gets an {@link XMLResourceBundle} wrapped SLF4J {@link org.slf4j.Logger}.
@param aClass A class to use for the logger name
@param aBundleName The name of the resource bundle to use
@return A resource bundle aware logger | [
"Gets",
"an",
"{",
"@link",
"XMLResourceBundle",
"}",
"wrapped",
"SLF4J",
"{",
"@link",
"org",
".",
"slf4j",
".",
"Logger",
"}",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/LoggerFactory.java#L43-L45 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/plugins/PluginBase.java | PluginBase.configureThresholdEvaluatorBuilder | protected void configureThresholdEvaluatorBuilder(final ThresholdsEvaluatorBuilder thrb, final ICommandLine cl) throws BadThresholdException {
if (cl.hasOption("th")) {
for (Object obj : cl.getOptionValues("th")) {
thrb.withThreshold(obj.toString());
}
}
} | java | protected void configureThresholdEvaluatorBuilder(final ThresholdsEvaluatorBuilder thrb, final ICommandLine cl) throws BadThresholdException {
if (cl.hasOption("th")) {
for (Object obj : cl.getOptionValues("th")) {
thrb.withThreshold(obj.toString());
}
}
} | [
"protected",
"void",
"configureThresholdEvaluatorBuilder",
"(",
"final",
"ThresholdsEvaluatorBuilder",
"thrb",
",",
"final",
"ICommandLine",
"cl",
")",
"throws",
"BadThresholdException",
"{",
"if",
"(",
"cl",
".",
"hasOption",
"(",
"\"th\"",
")",
")",
"{",
"for",
... | Override this method if you don't use the new threshold syntax. Here you
must tell the threshold evaluator all the threshold it must be able to
evaluate. Give a look at the source of the CheckOracle plugin for an
example of a plugin that supports both old and new syntax.
@param thrb
The {@link ThresholdsEvaluatorBuild... | [
"Override",
"this",
"method",
"if",
"you",
"don",
"t",
"use",
"the",
"new",
"threshold",
"syntax",
".",
"Here",
"you",
"must",
"tell",
"the",
"threshold",
"evaluator",
"all",
"the",
"threshold",
"it",
"must",
"be",
"able",
"to",
"evaluate",
".",
"Give",
... | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/plugins/PluginBase.java#L81-L87 |
kiswanij/jk-util | src/main/java/com/jk/util/JKConversionUtil.java | JKConversionUtil.toDouble | public static double toDouble(Object value, double defaultValue) {
if (value == null || value.toString().trim().equals("")) {
return defaultValue;
}
if (value instanceof Double) {
return (double) value;
}
if (value instanceof Date) {
final Date date = (Date) value;
return date.getTime();
... | java | public static double toDouble(Object value, double defaultValue) {
if (value == null || value.toString().trim().equals("")) {
return defaultValue;
}
if (value instanceof Double) {
return (double) value;
}
if (value instanceof Date) {
final Date date = (Date) value;
return date.getTime();
... | [
"public",
"static",
"double",
"toDouble",
"(",
"Object",
"value",
",",
"double",
"defaultValue",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"toString",
"(",
")",
".",
"trim",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
... | To double.
@param value the value
@param defaultValue the default value
@return the double | [
"To",
"double",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKConversionUtil.java#L158-L170 |
foundation-runtime/logging | logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java | LoggingHelper.warn | public static void warn(final Logger logger, final String format, final Object... params) {
warn(logger, format, null, params);
} | java | public static void warn(final Logger logger, final String format, final Object... params) {
warn(logger, format, null, params);
} | [
"public",
"static",
"void",
"warn",
"(",
"final",
"Logger",
"logger",
",",
"final",
"String",
"format",
",",
"final",
"Object",
"...",
"params",
")",
"{",
"warn",
"(",
"logger",
",",
"format",
",",
"null",
",",
"params",
")",
";",
"}"
] | log message using the String.format API
@param logger
the logger that will be used to log the message
@param format
the format string (the template string)
@param params
the parameters to be formatted into it the string format | [
"log",
"message",
"using",
"the",
"String",
".",
"format",
"API"
] | train | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java#L262-L264 |
jeremylong/DependencyCheck | maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java | BaseDependencyCheckMojo.scanArtifacts | protected ExceptionCollection scanArtifacts(MavenProject project, Engine engine, boolean aggregate) {
try {
final List<String> filterItems = Collections.singletonList(String.format("%s:%s", project.getGroupId(), project.getArtifactId()));
final ProjectBuildingRequest buildingRequest = ne... | java | protected ExceptionCollection scanArtifacts(MavenProject project, Engine engine, boolean aggregate) {
try {
final List<String> filterItems = Collections.singletonList(String.format("%s:%s", project.getGroupId(), project.getArtifactId()));
final ProjectBuildingRequest buildingRequest = ne... | [
"protected",
"ExceptionCollection",
"scanArtifacts",
"(",
"MavenProject",
"project",
",",
"Engine",
"engine",
",",
"boolean",
"aggregate",
")",
"{",
"try",
"{",
"final",
"List",
"<",
"String",
">",
"filterItems",
"=",
"Collections",
".",
"singletonList",
"(",
"S... | Scans the project's artifacts and adds them to the engine's dependency
list.
@param project the project to scan the dependencies of
@param engine the engine to use to scan the dependencies
@param aggregate whether the scan is part of an aggregate build
@return a collection of exceptions that may have occurred while re... | [
"Scans",
"the",
"project",
"s",
"artifacts",
"and",
"adds",
"them",
"to",
"the",
"engine",
"s",
"dependency",
"list",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L843-L870 |
joniles/mpxj | src/main/java/net/sf/mpxj/RecurringData.java | RecurringData.getMonthlyAbsoluteDates | private void getMonthlyAbsoluteDates(Calendar calendar, int frequency, List<Date> dates)
{
int currentDayNumber = calendar.get(Calendar.DAY_OF_MONTH);
calendar.set(Calendar.DAY_OF_MONTH, 1);
int requiredDayNumber = NumberHelper.getInt(m_dayNumber);
if (requiredDayNumber < currentDayNumber)
... | java | private void getMonthlyAbsoluteDates(Calendar calendar, int frequency, List<Date> dates)
{
int currentDayNumber = calendar.get(Calendar.DAY_OF_MONTH);
calendar.set(Calendar.DAY_OF_MONTH, 1);
int requiredDayNumber = NumberHelper.getInt(m_dayNumber);
if (requiredDayNumber < currentDayNumber)
... | [
"private",
"void",
"getMonthlyAbsoluteDates",
"(",
"Calendar",
"calendar",
",",
"int",
"frequency",
",",
"List",
"<",
"Date",
">",
"dates",
")",
"{",
"int",
"currentDayNumber",
"=",
"calendar",
".",
"get",
"(",
"Calendar",
".",
"DAY_OF_MONTH",
")",
";",
"cal... | Calculate start dates for a monthly absolute recurrence.
@param calendar current date
@param frequency frequency
@param dates array of start dates | [
"Calculate",
"start",
"dates",
"for",
"a",
"monthly",
"absolute",
"recurrence",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/RecurringData.java#L520-L543 |
podio/podio-java | src/main/java/com/podio/conversation/ConversationAPI.java | ConversationAPI.createConversation | public int createConversation(String subject, String text,
List<Integer> participants, Reference reference) {
WebResource resource;
if (reference != null) {
resource = getResourceFactory().getApiResource(
"/conversation/" + reference.toURLFragment());
} else {
resource = getResourceFactory().getApiR... | java | public int createConversation(String subject, String text,
List<Integer> participants, Reference reference) {
WebResource resource;
if (reference != null) {
resource = getResourceFactory().getApiResource(
"/conversation/" + reference.toURLFragment());
} else {
resource = getResourceFactory().getApiR... | [
"public",
"int",
"createConversation",
"(",
"String",
"subject",
",",
"String",
"text",
",",
"List",
"<",
"Integer",
">",
"participants",
",",
"Reference",
"reference",
")",
"{",
"WebResource",
"resource",
";",
"if",
"(",
"reference",
"!=",
"null",
")",
"{",... | Creates a new conversation with a list of users. Once a conversation is
started, the participants cannot (yet) be changed.
@param subject
The subject of the conversation
@param text
The text of the first message in the conversation
@param participants
List of participants in the conversation (not including the
sender)... | [
"Creates",
"a",
"new",
"conversation",
"with",
"a",
"list",
"of",
"users",
".",
"Once",
"a",
"conversation",
"is",
"started",
"the",
"participants",
"cannot",
"(",
"yet",
")",
"be",
"changed",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/conversation/ConversationAPI.java#L52-L66 |
ocelotds/ocelot | ocelot-core/src/main/java/org/ocelotds/messaging/JsTopicInterceptor.java | JsTopicInterceptor.computeTopic | String computeTopic(JsTopicName jsTopicName, String topic) {
StringBuilder result = new StringBuilder();
if (!jsTopicName.prefix().isEmpty()) {
result.append(jsTopicName.prefix()).append(Constants.Topic.COLON);
}
result.append(topic);
if (!jsTopicName.postfix().isEmpty()) {
result.append(Constant... | java | String computeTopic(JsTopicName jsTopicName, String topic) {
StringBuilder result = new StringBuilder();
if (!jsTopicName.prefix().isEmpty()) {
result.append(jsTopicName.prefix()).append(Constants.Topic.COLON);
}
result.append(topic);
if (!jsTopicName.postfix().isEmpty()) {
result.append(Constant... | [
"String",
"computeTopic",
"(",
"JsTopicName",
"jsTopicName",
",",
"String",
"topic",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"!",
"jsTopicName",
".",
"prefix",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"... | Compute full topicname from jsTopicName.prefix, topic and jsTopicName.postfix
@param jsTopicName
@param topic
@return | [
"Compute",
"full",
"topicname",
"from",
"jsTopicName",
".",
"prefix",
"topic",
"and",
"jsTopicName",
".",
"postfix"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-core/src/main/java/org/ocelotds/messaging/JsTopicInterceptor.java#L131-L141 |
spotify/crtauth-java | src/main/java/com/spotify/crtauth/CrtAuthClient.java | CrtAuthClient.createResponse | public String createResponse(String challenge)
throws IllegalArgumentException, KeyNotFoundException, ProtocolVersionException {
byte[] decodedChallenge = decode(challenge);
Challenge deserializedChallenge = CrtAuthCodec.deserializeChallenge(decodedChallenge);
if (!deserializedChallenge.getServerName(... | java | public String createResponse(String challenge)
throws IllegalArgumentException, KeyNotFoundException, ProtocolVersionException {
byte[] decodedChallenge = decode(challenge);
Challenge deserializedChallenge = CrtAuthCodec.deserializeChallenge(decodedChallenge);
if (!deserializedChallenge.getServerName(... | [
"public",
"String",
"createResponse",
"(",
"String",
"challenge",
")",
"throws",
"IllegalArgumentException",
",",
"KeyNotFoundException",
",",
"ProtocolVersionException",
"{",
"byte",
"[",
"]",
"decodedChallenge",
"=",
"decode",
"(",
"challenge",
")",
";",
"Challenge"... | Generate a response String using the Signer of this instance, additionally verifying that the
embedded serverName matches the serverName of this instance.
@param challenge A challenge String obtained from a server.
@return The response String to be returned to the server.
@throws IllegalArgumentException if there is s... | [
"Generate",
"a",
"response",
"String",
"using",
"the",
"Signer",
"of",
"this",
"instance",
"additionally",
"verifying",
"that",
"the",
"embedded",
"serverName",
"matches",
"the",
"serverName",
"of",
"this",
"instance",
"."
] | train | https://github.com/spotify/crtauth-java/blob/90f3b40323848740c915b195ad1b547fbeb41700/src/main/java/com/spotify/crtauth/CrtAuthClient.java#L60-L72 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.updateState | private void updateState(CmsDbContext dbc, CmsResource resource, boolean resourceState)
throws CmsDataAccessException {
CmsUUID projectId = ((dbc.getProjectId() == null) || dbc.getProjectId().isNullUUID())
? dbc.currentProject().getUuid()
: dbc.getProjectId();
resource.setUserLastMo... | java | private void updateState(CmsDbContext dbc, CmsResource resource, boolean resourceState)
throws CmsDataAccessException {
CmsUUID projectId = ((dbc.getProjectId() == null) || dbc.getProjectId().isNullUUID())
? dbc.currentProject().getUuid()
: dbc.getProjectId();
resource.setUserLastMo... | [
"private",
"void",
"updateState",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"boolean",
"resourceState",
")",
"throws",
"CmsDataAccessException",
"{",
"CmsUUID",
"projectId",
"=",
"(",
"(",
"dbc",
".",
"getProjectId",
"(",
")",
"==",
"null"... | Updates the state of a resource, depending on the <code>resourceState</code> parameter.<p>
@param dbc the db context
@param resource the resource
@param resourceState if <code>true</code> the resource state will be updated, if not just the structure state.
@throws CmsDataAccessException if something goes wrong | [
"Updates",
"the",
"state",
"of",
"a",
"resource",
"depending",
"on",
"the",
"<code",
">",
"resourceState<",
"/",
"code",
">",
"parameter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L11962-L11976 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableDocument.java | MutableDocument.setBoolean | @NonNull
@Override
public MutableDocument setBoolean(@NonNull String key, boolean value) {
return setValue(key, value);
} | java | @NonNull
@Override
public MutableDocument setBoolean(@NonNull String key, boolean value) {
return setValue(key, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableDocument",
"setBoolean",
"(",
"@",
"NonNull",
"String",
"key",
",",
"boolean",
"value",
")",
"{",
"return",
"setValue",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set a boolean value for the given key
@param key the key.
@param key the boolean value.
@return this MutableDocument instance | [
"Set",
"a",
"boolean",
"value",
"for",
"the",
"given",
"key"
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDocument.java#L236-L240 |
MenoData/Time4J | base/src/main/java/net/time4j/tz/model/GregorianTimezoneRule.java | GregorianTimezoneRule.ofFixedDay | public static GregorianTimezoneRule ofFixedDay(
Month month,
int dayOfMonth,
int timeOfDay,
OffsetIndicator indicator,
int savings
) {
return new FixedDayPattern(month, dayOfMonth, timeOfDay, indicator, savings);
} | java | public static GregorianTimezoneRule ofFixedDay(
Month month,
int dayOfMonth,
int timeOfDay,
OffsetIndicator indicator,
int savings
) {
return new FixedDayPattern(month, dayOfMonth, timeOfDay, indicator, savings);
} | [
"public",
"static",
"GregorianTimezoneRule",
"ofFixedDay",
"(",
"Month",
"month",
",",
"int",
"dayOfMonth",
",",
"int",
"timeOfDay",
",",
"OffsetIndicator",
"indicator",
",",
"int",
"savings",
")",
"{",
"return",
"new",
"FixedDayPattern",
"(",
"month",
",",
"day... | /*[deutsch]
<p>Konstruiert ein Muster für einen festen Tag im angegebenen
Monat. </p>
@param month calendar month
@param dayOfMonth day of month (1 - 31)
@param timeOfDay clock time in seconds after midnight when time switch happens
@param indicator offset indicator
@param savings fixed D... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Konstruiert",
"ein",
"Muster",
"fü",
";",
"r",
"einen",
"festen",
"Tag",
"im",
"angegebenen",
"Monat",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/tz/model/GregorianTimezoneRule.java#L166-L176 |
mhshams/jnbis | src/main/java/org/jnbis/api/handler/FileHandler.java | FileHandler.asFile | public File asFile(String fileName) {
File file = new File(fileName);
try (FileOutputStream bos = new FileOutputStream(file)) {
bos.write(data);
} catch (IOException e) {
throw new RuntimeException("unexpected error", e);
}
return file;
} | java | public File asFile(String fileName) {
File file = new File(fileName);
try (FileOutputStream bos = new FileOutputStream(file)) {
bos.write(data);
} catch (IOException e) {
throw new RuntimeException("unexpected error", e);
}
return file;
} | [
"public",
"File",
"asFile",
"(",
"String",
"fileName",
")",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"fileName",
")",
";",
"try",
"(",
"FileOutputStream",
"bos",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
")",
"{",
"bos",
".",
"write",
"(",... | Writes the file data in the specified file and returns the final <code>File</code>.
@param fileName the given file name, not null
@return the final File, not null | [
"Writes",
"the",
"file",
"data",
"in",
"the",
"specified",
"file",
"and",
"returns",
"the",
"final",
"<code",
">",
"File<",
"/",
"code",
">",
"."
] | train | https://github.com/mhshams/jnbis/blob/e0f4ac750cc98a0363507395a121183fface330e/src/main/java/org/jnbis/api/handler/FileHandler.java#L26-L34 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createSSHKey | public GitlabSSHKey createSSHKey(Integer targetUserId, String title, String key) throws IOException {
Query query = new Query()
.append("title", title)
.append("key", key);
String tailUrl = GitlabUser.USERS_URL + "/" + targetUserId + GitlabSSHKey.KEYS_URL + query.toStri... | java | public GitlabSSHKey createSSHKey(Integer targetUserId, String title, String key) throws IOException {
Query query = new Query()
.append("title", title)
.append("key", key);
String tailUrl = GitlabUser.USERS_URL + "/" + targetUserId + GitlabSSHKey.KEYS_URL + query.toStri... | [
"public",
"GitlabSSHKey",
"createSSHKey",
"(",
"Integer",
"targetUserId",
",",
"String",
"title",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"Query",
"query",
"=",
"new",
"Query",
"(",
")",
".",
"append",
"(",
"\"title\"",
",",
"title",
")",
... | Create a new ssh key for the user
@param targetUserId The id of the Gitlab user
@param title The title of the ssh key
@param key The public key
@return The new GitlabSSHKey
@throws IOException on gitlab api call error | [
"Create",
"a",
"new",
"ssh",
"key",
"for",
"the",
"user"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L385-L394 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java | DeploymentsInner.createOrUpdate | public DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deploymentName, DeploymentProperties properties) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, deploymentName, properties).toBlocking().last().body();
} | java | public DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deploymentName, DeploymentProperties properties) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, deploymentName, properties).toBlocking().last().body();
} | [
"public",
"DeploymentExtendedInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"deploymentName",
",",
"DeploymentProperties",
"properties",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"deploymentName",
... | Deploys resources to a resource group.
You can provide the template and parameters directly in the request or link to JSON files.
@param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.
@param deploymentName The name of th... | [
"Deploys",
"resources",
"to",
"a",
"resource",
"group",
".",
"You",
"can",
"provide",
"the",
"template",
"and",
"parameters",
"directly",
"in",
"the",
"request",
"or",
"link",
"to",
"JSON",
"files",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/DeploymentsInner.java#L376-L378 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java | PlatformBitmapFactory.createBitmap | public CloseableReference<Bitmap> createBitmap(
Bitmap source,
int x,
int y,
int width,
int height,
@Nullable Object callerContext) {
return createBitmap(source, x, y, width, height, null, false, callerContext);
} | java | public CloseableReference<Bitmap> createBitmap(
Bitmap source,
int x,
int y,
int width,
int height,
@Nullable Object callerContext) {
return createBitmap(source, x, y, width, height, null, false, callerContext);
} | [
"public",
"CloseableReference",
"<",
"Bitmap",
">",
"createBitmap",
"(",
"Bitmap",
"source",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
",",
"@",
"Nullable",
"Object",
"callerContext",
")",
"{",
"return",
"createBitmap",
"... | Creates a bitmap from the specified subset of the source
bitmap. It is initialized with the same density as the original bitmap.
@param source The bitmap we are subsetting
@param x The x coordinate of the first pixel in source
@param y The y coordinate of the first pixel in source
@param width The n... | [
"Creates",
"a",
"bitmap",
"from",
"the",
"specified",
"subset",
"of",
"the",
"source",
"bitmap",
".",
"It",
"is",
"initialized",
"with",
"the",
"same",
"density",
"as",
"the",
"original",
"bitmap",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/bitmaps/PlatformBitmapFactory.java#L170-L178 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/BaseWorkflowExecutor.java | BaseWorkflowExecutor.addStepFailureContextData | protected void addStepFailureContextData(
StepExecutionResult stepResult,
ExecutionContextImpl.Builder builder
)
{
HashMap<String, String>
resultData = new HashMap<>();
if (null != stepResult.getFailureData()) {
//convert values to string
... | java | protected void addStepFailureContextData(
StepExecutionResult stepResult,
ExecutionContextImpl.Builder builder
)
{
HashMap<String, String>
resultData = new HashMap<>();
if (null != stepResult.getFailureData()) {
//convert values to string
... | [
"protected",
"void",
"addStepFailureContextData",
"(",
"StepExecutionResult",
"stepResult",
",",
"ExecutionContextImpl",
".",
"Builder",
"builder",
")",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"resultData",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
... | Add step result failure information to the data context
@param stepResult result
@return new context | [
"Add",
"step",
"result",
"failure",
"information",
"to",
"the",
"data",
"context"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/BaseWorkflowExecutor.java#L381-L407 |
apache/groovy | src/main/groovy/groovy/lang/GroovyClassLoader.java | GroovyClassLoader.parseClass | public Class parseClass(File file) throws CompilationFailedException, IOException {
return parseClass(new GroovyCodeSource(file, config.getSourceEncoding()));
} | java | public Class parseClass(File file) throws CompilationFailedException, IOException {
return parseClass(new GroovyCodeSource(file, config.getSourceEncoding()));
} | [
"public",
"Class",
"parseClass",
"(",
"File",
"file",
")",
"throws",
"CompilationFailedException",
",",
"IOException",
"{",
"return",
"parseClass",
"(",
"new",
"GroovyCodeSource",
"(",
"file",
",",
"config",
".",
"getSourceEncoding",
"(",
")",
")",
")",
";",
"... | Parses the given file into a Java class capable of being run
@param file the file name to parse
@return the main class defined in the given script | [
"Parses",
"the",
"given",
"file",
"into",
"a",
"Java",
"class",
"capable",
"of",
"being",
"run"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/GroovyClassLoader.java#L233-L235 |
m-m-m/util | validation/src/main/java/net/sf/mmm/util/validation/base/ValidatorJsr303.java | ValidatorJsr303.createValidationFailure | protected ValidationFailure createValidationFailure(ConstraintViolation<?> violation, Object valueSource) {
String code = violation.getConstraintDescriptor().getAnnotation().annotationType().getSimpleName();
return new ValidationFailureImpl(code, valueSource, violation.getMessage());
} | java | protected ValidationFailure createValidationFailure(ConstraintViolation<?> violation, Object valueSource) {
String code = violation.getConstraintDescriptor().getAnnotation().annotationType().getSimpleName();
return new ValidationFailureImpl(code, valueSource, violation.getMessage());
} | [
"protected",
"ValidationFailure",
"createValidationFailure",
"(",
"ConstraintViolation",
"<",
"?",
">",
"violation",
",",
"Object",
"valueSource",
")",
"{",
"String",
"code",
"=",
"violation",
".",
"getConstraintDescriptor",
"(",
")",
".",
"getAnnotation",
"(",
")",... | Creates a {@link ValidationFailure} for the given {@link ConstraintViolation}.
@param violation is the {@link ConstraintViolation}.
@param valueSource is the source of the value. May be {@code null}.
@return the created {@link ValidationFailure}. | [
"Creates",
"a",
"{",
"@link",
"ValidationFailure",
"}",
"for",
"the",
"given",
"{",
"@link",
"ConstraintViolation",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/validation/src/main/java/net/sf/mmm/util/validation/base/ValidatorJsr303.java#L226-L230 |
aws/aws-sdk-java | aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/Step.java | Step.withScreenshots | public Step withScreenshots(java.util.Map<String, String> screenshots) {
setScreenshots(screenshots);
return this;
} | java | public Step withScreenshots(java.util.Map<String, String> screenshots) {
setScreenshots(screenshots);
return this;
} | [
"public",
"Step",
"withScreenshots",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"screenshots",
")",
"{",
"setScreenshots",
"(",
"screenshots",
")",
";",
"return",
"this",
";",
"}"
] | <p>
List of screenshot Urls for the execution step, if relevant.
</p>
@param screenshots
List of screenshot Urls for the execution step, if relevant.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"List",
"of",
"screenshot",
"Urls",
"for",
"the",
"execution",
"step",
"if",
"relevant",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/Step.java#L367-L370 |
QNJR-GROUP/EasyTransaction | easytrans-demo/rpc-dubbo/rpcdubbo-order-service/src/main/java/com/yiqiniu/easytrans/demos/order/impl/OrderApplication.java | OrderApplication.dubboConsumerCustomizationer | @Bean
public DubboReferanceCustomizationer dubboConsumerCustomizationer() {
return new DubboReferanceCustomizationer() {
@Override
public void customDubboReferance(String appId, String busCode, ReferenceConfig<GenericService> referenceConfig) {
Logger logger = LoggerFactory.getLogger(getClass());
l... | java | @Bean
public DubboReferanceCustomizationer dubboConsumerCustomizationer() {
return new DubboReferanceCustomizationer() {
@Override
public void customDubboReferance(String appId, String busCode, ReferenceConfig<GenericService> referenceConfig) {
Logger logger = LoggerFactory.getLogger(getClass());
l... | [
"@",
"Bean",
"public",
"DubboReferanceCustomizationer",
"dubboConsumerCustomizationer",
"(",
")",
"{",
"return",
"new",
"DubboReferanceCustomizationer",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"customDubboReferance",
"(",
"String",
"appId",
",",
"String",
"b... | This is an optional bean, you can modify Dubbo reference here to change the behavior of consumer
@return | [
"This",
"is",
"an",
"optional",
"bean",
"you",
"can",
"modify",
"Dubbo",
"reference",
"here",
"to",
"change",
"the",
"behavior",
"of",
"consumer"
] | train | https://github.com/QNJR-GROUP/EasyTransaction/blob/53b031724a3fd1145f32b9a7b5c6fb8138d6a426/easytrans-demo/rpc-dubbo/rpcdubbo-order-service/src/main/java/com/yiqiniu/easytrans/demos/order/impl/OrderApplication.java#L30-L40 |
aggregateknowledge/java-hll | src/main/java/net/agkn/hll/util/HLLUtil.java | HLLUtil.largeEstimator | public static double largeEstimator(final int log2m, final int registerSizeInBits, final double estimator) {
final double twoToL = TWO_TO_L[(REG_WIDTH_INDEX_MULTIPLIER * registerSizeInBits) + log2m];
return -1 * twoToL * Math.log(1.0 - (estimator/twoToL));
} | java | public static double largeEstimator(final int log2m, final int registerSizeInBits, final double estimator) {
final double twoToL = TWO_TO_L[(REG_WIDTH_INDEX_MULTIPLIER * registerSizeInBits) + log2m];
return -1 * twoToL * Math.log(1.0 - (estimator/twoToL));
} | [
"public",
"static",
"double",
"largeEstimator",
"(",
"final",
"int",
"log2m",
",",
"final",
"int",
"registerSizeInBits",
",",
"final",
"double",
"estimator",
")",
"{",
"final",
"double",
"twoToL",
"=",
"TWO_TO_L",
"[",
"(",
"REG_WIDTH_INDEX_MULTIPLIER",
"*",
"re... | The "large range correction" formula from the HyperLogLog algorithm, adapted
for 64 bit hashes. Only appropriate for estimators whose value exceeds
the return of {@link #largeEstimatorCutoff(int, int)}.
@param log2m log-base-2 of the number of registers in the HLL. <em>b<em> in the paper.
@param registerSizeInBits t... | [
"The",
"large",
"range",
"correction",
"formula",
"from",
"the",
"HyperLogLog",
"algorithm",
"adapted",
"for",
"64",
"bit",
"hashes",
".",
"Only",
"appropriate",
"for",
"estimators",
"whose",
"value",
"exceeds",
"the",
"return",
"of",
"{",
"@link",
"#largeEstima... | train | https://github.com/aggregateknowledge/java-hll/blob/1f4126e79a85b79581460c75bf1c1634b8a7402d/src/main/java/net/agkn/hll/util/HLLUtil.java#L198-L201 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.setNoDisturb | public ResponseWrapper setNoDisturb(String username, NoDisturbPayload payload)
throws APIConnectionException, APIRequestException {
return _userClient.setNoDisturb(username, payload);
} | java | public ResponseWrapper setNoDisturb(String username, NoDisturbPayload payload)
throws APIConnectionException, APIRequestException {
return _userClient.setNoDisturb(username, payload);
} | [
"public",
"ResponseWrapper",
"setNoDisturb",
"(",
"String",
"username",
",",
"NoDisturbPayload",
"payload",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_userClient",
".",
"setNoDisturb",
"(",
"username",
",",
"payload",
")",
";... | Set don't disturb service while receiving messages.
You can Add or remove single conversation or group conversation
@param username Necessary
@param payload NoDisturbPayload
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Set",
"don",
"t",
"disturb",
"service",
"while",
"receiving",
"messages",
".",
"You",
"can",
"Add",
"or",
"remove",
"single",
"conversation",
"or",
"group",
"conversation"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L277-L280 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/hc/ext/HCConditionalCommentNode.java | HCConditionalCommentNode.getAsConditionalCommentNode | @Nonnull
public static HCConditionalCommentNode getAsConditionalCommentNode (@Nonnull @Nonempty final String sCondition,
@Nonnull final IHCNode aNode)
{
if (aNode instanceof HCConditionalCommentNode)
return (HCConditionalCommentNode) aN... | java | @Nonnull
public static HCConditionalCommentNode getAsConditionalCommentNode (@Nonnull @Nonempty final String sCondition,
@Nonnull final IHCNode aNode)
{
if (aNode instanceof HCConditionalCommentNode)
return (HCConditionalCommentNode) aN... | [
"@",
"Nonnull",
"public",
"static",
"HCConditionalCommentNode",
"getAsConditionalCommentNode",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sCondition",
",",
"@",
"Nonnull",
"final",
"IHCNode",
"aNode",
")",
"{",
"if",
"(",
"aNode",
"instanceof",
"HCC... | Get the passed node wrapped in a conditional comment. This is a sanity
method for <code>new HCConditionalCommentNode (this, sCondition)</code>. If
this node is already an {@link HCConditionalCommentNode} the object is
simply casted.
@param sCondition
The condition to us. May neither be <code>null</code> nor empty.
@pa... | [
"Get",
"the",
"passed",
"node",
"wrapped",
"in",
"a",
"conditional",
"comment",
".",
"This",
"is",
"a",
"sanity",
"method",
"for",
"<code",
">",
"new",
"HCConditionalCommentNode",
"(",
"this",
"sCondition",
")",
"<",
"/",
"code",
">",
".",
"If",
"this",
... | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/ext/HCConditionalCommentNode.java#L423-L430 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/StreamingJobsInner.java | StreamingJobsInner.beginCreateOrReplaceAsync | public Observable<StreamingJobInner> beginCreateOrReplaceAsync(String resourceGroupName, String jobName, StreamingJobInner streamingJob, String ifMatch, String ifNoneMatch) {
return beginCreateOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, streamingJob, ifMatch, ifNoneMatch).map(new Func1<Service... | java | public Observable<StreamingJobInner> beginCreateOrReplaceAsync(String resourceGroupName, String jobName, StreamingJobInner streamingJob, String ifMatch, String ifNoneMatch) {
return beginCreateOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, streamingJob, ifMatch, ifNoneMatch).map(new Func1<Service... | [
"public",
"Observable",
"<",
"StreamingJobInner",
">",
"beginCreateOrReplaceAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"StreamingJobInner",
"streamingJob",
",",
"String",
"ifMatch",
",",
"String",
"ifNoneMatch",
")",
"{",
"return",
"beg... | Creates a streaming job or replaces an already existing streaming job.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param jobName The name of the streaming job.
@param streamingJob The definition of the... | [
"Creates",
"a",
"streaming",
"job",
"or",
"replaces",
"an",
"already",
"existing",
"streaming",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/StreamingJobsInner.java#L428-L435 |
op4j/op4j | src/main/java/org/op4j/Op.java | Op.onArrayFor | public static <T> Level0ArrayOperator<Date[],Date> onArrayFor(final Date... elements) {
return onArrayOf(Types.DATE, VarArgsUtil.asRequiredObjectArray(elements));
} | java | public static <T> Level0ArrayOperator<Date[],Date> onArrayFor(final Date... elements) {
return onArrayOf(Types.DATE, VarArgsUtil.asRequiredObjectArray(elements));
} | [
"public",
"static",
"<",
"T",
">",
"Level0ArrayOperator",
"<",
"Date",
"[",
"]",
",",
"Date",
">",
"onArrayFor",
"(",
"final",
"Date",
"...",
"elements",
")",
"{",
"return",
"onArrayOf",
"(",
"Types",
".",
"DATE",
",",
"VarArgsUtil",
".",
"asRequiredObject... | <p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining | [
"<p",
">",
"Creates",
"an",
"array",
"with",
"the",
"specified",
"elements",
"and",
"an",
"<i",
">",
"operation",
"expression<",
"/",
"i",
">",
"on",
"it",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L1036-L1038 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java | AmazonSQSMessagingClientWrapper.deleteMessage | public void deleteMessage(DeleteMessageRequest deleteMessageRequest) throws JMSException {
try {
prepareRequest(deleteMessageRequest);
amazonSQSClient.deleteMessage(deleteMessageRequest);
} catch (AmazonClientException e) {
throw handleException(e, "deleteMessage");
... | java | public void deleteMessage(DeleteMessageRequest deleteMessageRequest) throws JMSException {
try {
prepareRequest(deleteMessageRequest);
amazonSQSClient.deleteMessage(deleteMessageRequest);
} catch (AmazonClientException e) {
throw handleException(e, "deleteMessage");
... | [
"public",
"void",
"deleteMessage",
"(",
"DeleteMessageRequest",
"deleteMessageRequest",
")",
"throws",
"JMSException",
"{",
"try",
"{",
"prepareRequest",
"(",
"deleteMessageRequest",
")",
";",
"amazonSQSClient",
".",
"deleteMessage",
"(",
"deleteMessageRequest",
")",
";... | Calls <code>deleteMessage</code> and wraps <code>AmazonClientException</code>. This is used to
acknowledge single messages, so that they can be deleted from SQS queue.
@param deleteMessageRequest
Container for the necessary parameters to execute the
deleteMessage service method on AmazonSQS.
@throws JMSException | [
"Calls",
"<code",
">",
"deleteMessage<",
"/",
"code",
">",
"and",
"wraps",
"<code",
">",
"AmazonClientException<",
"/",
"code",
">",
".",
"This",
"is",
"used",
"to",
"acknowledge",
"single",
"messages",
"so",
"that",
"they",
"can",
"be",
"deleted",
"from",
... | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java#L156-L163 |
sahasbhop/formatted-log | formatted-log/src/main/java/com/github/sahasbhop/flog/FLog.java | FLog.setEnableFileLog | public static void setEnableFileLog(boolean enable, String path, String fileName) {
sEnableFileLog = enable;
if (enable && path != null && fileName != null) {
sLogFilePath = path.trim();
sLogFileName = fileName.trim();
if (!sLogFilePath.endsWith("/")) {
... | java | public static void setEnableFileLog(boolean enable, String path, String fileName) {
sEnableFileLog = enable;
if (enable && path != null && fileName != null) {
sLogFilePath = path.trim();
sLogFileName = fileName.trim();
if (!sLogFilePath.endsWith("/")) {
... | [
"public",
"static",
"void",
"setEnableFileLog",
"(",
"boolean",
"enable",
",",
"String",
"path",
",",
"String",
"fileName",
")",
"{",
"sEnableFileLog",
"=",
"enable",
";",
"if",
"(",
"enable",
"&&",
"path",
"!=",
"null",
"&&",
"fileName",
"!=",
"null",
")"... | Enable writing debugging log to a target file
@param enable enabling a file log
@param path directory path to create and save a log file
@param fileName target log file name | [
"Enable",
"writing",
"debugging",
"log",
"to",
"a",
"target",
"file"
] | train | https://github.com/sahasbhop/formatted-log/blob/0a3952df6b68fbfa0bbb2c0ea0a8bf9ea26ea6e3/formatted-log/src/main/java/com/github/sahasbhop/flog/FLog.java#L75-L86 |
selenide/selenide | src/main/java/com/codeborne/selenide/Condition.java | Condition.matchText | public static Condition matchText(final String regex) {
return new Condition("match text") {
@Override
public boolean apply(Driver driver, WebElement element) {
return Html.text.matches(element.getText(), regex);
}
@Override
public String toString() {
return name + " '... | java | public static Condition matchText(final String regex) {
return new Condition("match text") {
@Override
public boolean apply(Driver driver, WebElement element) {
return Html.text.matches(element.getText(), regex);
}
@Override
public String toString() {
return name + " '... | [
"public",
"static",
"Condition",
"matchText",
"(",
"final",
"String",
"regex",
")",
"{",
"return",
"new",
"Condition",
"(",
"\"match text\"",
")",
"{",
"@",
"Override",
"public",
"boolean",
"apply",
"(",
"Driver",
"driver",
",",
"WebElement",
"element",
")",
... | Assert that given element's text matches given regular expression
<p>Sample: <code>$("h1").should(matchText("Hello\s*John"))</code></p>
@param regex e.g. Kicked.*Chuck Norris - in this case ".*" can contain any characters including spaces, tabs, CR etc. | [
"Assert",
"that",
"given",
"element",
"s",
"text",
"matches",
"given",
"regular",
"expression"
] | train | https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/src/main/java/com/codeborne/selenide/Condition.java#L231-L243 |
google/flogger | api/src/main/java/com/google/common/flogger/parser/DefaultPrintfMessageParser.java | DefaultPrintfMessageParser.wrapHexParameter | private static Parameter wrapHexParameter(final FormatOptions options, int index) {
// %h / %H is really just %x / %X on the hashcode.
return new Parameter(options, index) {
@Override
protected void accept(ParameterVisitor visitor, Object value) {
visitor.visit(value.hashCode(), FormatChar.H... | java | private static Parameter wrapHexParameter(final FormatOptions options, int index) {
// %h / %H is really just %x / %X on the hashcode.
return new Parameter(options, index) {
@Override
protected void accept(ParameterVisitor visitor, Object value) {
visitor.visit(value.hashCode(), FormatChar.H... | [
"private",
"static",
"Parameter",
"wrapHexParameter",
"(",
"final",
"FormatOptions",
"options",
",",
"int",
"index",
")",
"{",
"// %h / %H is really just %x / %X on the hashcode.",
"return",
"new",
"Parameter",
"(",
"options",
",",
"index",
")",
"{",
"@",
"Override",
... | Static method so the anonymous synthetic parameter is static, rather than an inner class. | [
"Static",
"method",
"so",
"the",
"anonymous",
"synthetic",
"parameter",
"is",
"static",
"rather",
"than",
"an",
"inner",
"class",
"."
] | train | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/DefaultPrintfMessageParser.java#L103-L116 |
JodaOrg/joda-time | src/main/java/org/joda/time/convert/CalendarConverter.java | CalendarConverter.getChronology | public Chronology getChronology(Object object, DateTimeZone zone) {
if (object.getClass().getName().endsWith(".BuddhistCalendar")) {
return BuddhistChronology.getInstance(zone);
} else if (object instanceof GregorianCalendar) {
GregorianCalendar gc = (GregorianCalendar) object;
... | java | public Chronology getChronology(Object object, DateTimeZone zone) {
if (object.getClass().getName().endsWith(".BuddhistCalendar")) {
return BuddhistChronology.getInstance(zone);
} else if (object instanceof GregorianCalendar) {
GregorianCalendar gc = (GregorianCalendar) object;
... | [
"public",
"Chronology",
"getChronology",
"(",
"Object",
"object",
",",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"object",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
".",
"endsWith",
"(",
"\".BuddhistCalendar\"",
")",
")",
"{",
"return",
"Budd... | Gets the chronology, which is the GJChronology if a GregorianCalendar is used,
BuddhistChronology if a BuddhistCalendar is used or ISOChronology otherwise.
The time zone specified is used in preference to that on the calendar.
@param object the Calendar to convert, must not be null
@param zone the specified zone to ... | [
"Gets",
"the",
"chronology",
"which",
"is",
"the",
"GJChronology",
"if",
"a",
"GregorianCalendar",
"is",
"used",
"BuddhistChronology",
"if",
"a",
"BuddhistCalendar",
"is",
"used",
"or",
"ISOChronology",
"otherwise",
".",
"The",
"time",
"zone",
"specified",
"is",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/CalendarConverter.java#L93-L109 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java | EmvParser.getGetProcessingOptions | protected byte[] getGetProcessingOptions(final byte[] pPdol) throws CommunicationException {
// List Tag and length from PDOL
List<TagAndLength> list = TlvUtil.parseTagAndLength(pPdol);
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
out.write(EmvTags.COMMAND_TEMPLATE.getTagBytes()); // COMMAN... | java | protected byte[] getGetProcessingOptions(final byte[] pPdol) throws CommunicationException {
// List Tag and length from PDOL
List<TagAndLength> list = TlvUtil.parseTagAndLength(pPdol);
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
out.write(EmvTags.COMMAND_TEMPLATE.getTagBytes()); // COMMAN... | [
"protected",
"byte",
"[",
"]",
"getGetProcessingOptions",
"(",
"final",
"byte",
"[",
"]",
"pPdol",
")",
"throws",
"CommunicationException",
"{",
"// List Tag and length from PDOL",
"List",
"<",
"TagAndLength",
">",
"list",
"=",
"TlvUtil",
".",
"parseTagAndLength",
"... | Method used to create GPO command and execute it
@param pPdol
PDOL raw data
@return return data
@throws CommunicationException communication error | [
"Method",
"used",
"to",
"create",
"GPO",
"command",
"and",
"execute",
"it"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L275-L292 |
sd4324530/fastweixin | src/main/java/com/github/sd4324530/fastweixin/api/OauthAPI.java | OauthAPI.validToken | public boolean validToken(String token, String openid) {
BeanUtil.requireNonNull(token, "token is null");
BeanUtil.requireNonNull(openid, "openid is null");
String url = BASE_API_URL + "sns/auth?access_token=" + token + "&openid=" + openid;
BaseResponse r = executeGet(url);
retur... | java | public boolean validToken(String token, String openid) {
BeanUtil.requireNonNull(token, "token is null");
BeanUtil.requireNonNull(openid, "openid is null");
String url = BASE_API_URL + "sns/auth?access_token=" + token + "&openid=" + openid;
BaseResponse r = executeGet(url);
retur... | [
"public",
"boolean",
"validToken",
"(",
"String",
"token",
",",
"String",
"openid",
")",
"{",
"BeanUtil",
".",
"requireNonNull",
"(",
"token",
",",
"\"token is null\"",
")",
";",
"BeanUtil",
".",
"requireNonNull",
"(",
"openid",
",",
"\"openid is null\"",
")",
... | 校验token是否合法有效
@param token token
@param openid 用户openid
@return 是否合法有效 | [
"校验token是否合法有效"
] | train | https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/api/OauthAPI.java#L115-L121 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRecordBrowser.java | LogRecordBrowser.restartRecordsInProcess | private OnePidRecordListImpl restartRecordsInProcess(final RepositoryLogRecord after, long max, final IInternalRecordFilter recFilter) {
if (!(after instanceof RepositoryLogRecordImpl)) {
throw new IllegalArgumentException("Specified location does not belong to this repository.");
}
RepositoryLogRecordImpl rea... | java | private OnePidRecordListImpl restartRecordsInProcess(final RepositoryLogRecord after, long max, final IInternalRecordFilter recFilter) {
if (!(after instanceof RepositoryLogRecordImpl)) {
throw new IllegalArgumentException("Specified location does not belong to this repository.");
}
RepositoryLogRecordImpl rea... | [
"private",
"OnePidRecordListImpl",
"restartRecordsInProcess",
"(",
"final",
"RepositoryLogRecord",
"after",
",",
"long",
"max",
",",
"final",
"IInternalRecordFilter",
"recFilter",
")",
"{",
"if",
"(",
"!",
"(",
"after",
"instanceof",
"RepositoryLogRecordImpl",
")",
")... | continue the list of the records after a record from another repository filtered with <code>recFilter</code> | [
"continue",
"the",
"list",
"of",
"the",
"records",
"after",
"a",
"record",
"from",
"another",
"repository",
"filtered",
"with",
"<code",
">",
"recFilter<",
"/",
"code",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRecordBrowser.java#L180-L191 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/FileUtils.java | FileUtils.getRelativeUnixPath | @Deprecated
public static String getRelativeUnixPath(final String basePath, final String refPath) {
return getRelativePath(basePath, refPath, UNIX_SEPARATOR);
} | java | @Deprecated
public static String getRelativeUnixPath(final String basePath, final String refPath) {
return getRelativePath(basePath, refPath, UNIX_SEPARATOR);
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"getRelativeUnixPath",
"(",
"final",
"String",
"basePath",
",",
"final",
"String",
"refPath",
")",
"{",
"return",
"getRelativePath",
"(",
"basePath",
",",
"refPath",
",",
"UNIX_SEPARATOR",
")",
";",
"}"
] | Resolves a path reference against a base path.
@param basePath base path
@param refPath reference path
@return relative path using {@link Constants#UNIX_SEPARATOR} path separator | [
"Resolves",
"a",
"path",
"reference",
"against",
"a",
"base",
"path",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/FileUtils.java#L182-L185 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/entitylists/ListViewUrl.java | ListViewUrl.getEntityListViewUrl | public static MozuUrl getEntityListViewUrl(String entityListFullName, String responseFields, String viewName)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/entitylists/{entityListFullName}/views/{viewName}?responseFields={responseFields}");
formatter.formatUrl("entityListFullName", entityListFullNa... | java | public static MozuUrl getEntityListViewUrl(String entityListFullName, String responseFields, String viewName)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/entitylists/{entityListFullName}/views/{viewName}?responseFields={responseFields}");
formatter.formatUrl("entityListFullName", entityListFullNa... | [
"public",
"static",
"MozuUrl",
"getEntityListViewUrl",
"(",
"String",
"entityListFullName",
",",
"String",
"responseFields",
",",
"String",
"viewName",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/entitylists/{entityListFullName}/... | Get Resource Url for GetEntityListView
@param entityListFullName The full name of the EntityList including namespace in name@nameSpace format
@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 ret... | [
"Get",
"Resource",
"Url",
"for",
"GetEntityListView"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/entitylists/ListViewUrl.java#L103-L110 |
HeidelTime/heideltime | src/jvntextpro/util/StringUtils.java | StringUtils.isContained | public static boolean isContained( String[] array, String s )
{
for (String string : array)
{
if( string.equals( s ) )
{
return true;
}
}
return false;
} | java | public static boolean isContained( String[] array, String s )
{
for (String string : array)
{
if( string.equals( s ) )
{
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isContained",
"(",
"String",
"[",
"]",
"array",
",",
"String",
"s",
")",
"{",
"for",
"(",
"String",
"string",
":",
"array",
")",
"{",
"if",
"(",
"string",
".",
"equals",
"(",
"s",
")",
")",
"{",
"return",
"true",
";"... | Indicates whether the specified array of <tt>String</tt>s contains
a given <tt>String</tt>.
@param array the array
@param s the s
@return otherwise. | [
"Indicates",
"whether",
"the",
"specified",
"array",
"of",
"<tt",
">",
"String<",
"/",
"tt",
">",
"s",
"contains",
"a",
"given",
"<tt",
">",
"String<",
"/",
"tt",
">",
"."
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L556-L566 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java | ArrayHelper.getAllExceptFirst | @Nullable
@ReturnsMutableCopy
public static double [] getAllExceptFirst (@Nullable final double [] aArray, @Nonnegative final int nElementsToSkip)
{
ValueEnforcer.isGE0 (nElementsToSkip, "ElementsToSkip");
if (nElementsToSkip == 0)
return aArray;
if (aArray == null || nElementsToSkip >= aArray.... | java | @Nullable
@ReturnsMutableCopy
public static double [] getAllExceptFirst (@Nullable final double [] aArray, @Nonnegative final int nElementsToSkip)
{
ValueEnforcer.isGE0 (nElementsToSkip, "ElementsToSkip");
if (nElementsToSkip == 0)
return aArray;
if (aArray == null || nElementsToSkip >= aArray.... | [
"@",
"Nullable",
"@",
"ReturnsMutableCopy",
"public",
"static",
"double",
"[",
"]",
"getAllExceptFirst",
"(",
"@",
"Nullable",
"final",
"double",
"[",
"]",
"aArray",
",",
"@",
"Nonnegative",
"final",
"int",
"nElementsToSkip",
")",
"{",
"ValueEnforcer",
".",
"i... | Get an array that contains all elements, except for the first <em>n</em>
elements.
@param aArray
The source array. May be <code>null</code>.
@param nElementsToSkip
The number of elements to skip. Must be >= 0!
@return <code>null</code> if the passed array is <code>null</code> or has
≤ elements than elements to b... | [
"Get",
"an",
"array",
"that",
"contains",
"all",
"elements",
"except",
"for",
"the",
"first",
"<em",
">",
"n<",
"/",
"em",
">",
"elements",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java#L3172-L3183 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/LocaleUtils.java | LocaleUtils.getAvailableLocaleSuffixesForBundle | public static List<String> getAvailableLocaleSuffixesForBundle(String messageBundlePath, String fileSuffix) {
return getAvailableLocaleSuffixesForBundle(messageBundlePath, fileSuffix, null);
} | java | public static List<String> getAvailableLocaleSuffixesForBundle(String messageBundlePath, String fileSuffix) {
return getAvailableLocaleSuffixesForBundle(messageBundlePath, fileSuffix, null);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getAvailableLocaleSuffixesForBundle",
"(",
"String",
"messageBundlePath",
",",
"String",
"fileSuffix",
")",
"{",
"return",
"getAvailableLocaleSuffixesForBundle",
"(",
"messageBundlePath",
",",
"fileSuffix",
",",
"null",
"... | Returns the list of available locale suffixes for a message resource
bundle
@param messageBundlePath
the resource bundle path
@param fileSuffix
the file suffix
@return the list of available locale suffixes for a message resource
bundle | [
"Returns",
"the",
"list",
"of",
"available",
"locale",
"suffixes",
"for",
"a",
"message",
"resource",
"bundle"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/LocaleUtils.java#L129-L131 |
elki-project/elki | elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java | GeneratorSingleCluster.addRotation | public void addRotation(int axis1, int axis2, double angle) {
if(trans == null) {
trans = new AffineTransformation(dim);
}
trans.addRotation(axis1, axis2, angle);
} | java | public void addRotation(int axis1, int axis2, double angle) {
if(trans == null) {
trans = new AffineTransformation(dim);
}
trans.addRotation(axis1, axis2, angle);
} | [
"public",
"void",
"addRotation",
"(",
"int",
"axis1",
",",
"int",
"axis2",
",",
"double",
"angle",
")",
"{",
"if",
"(",
"trans",
"==",
"null",
")",
"{",
"trans",
"=",
"new",
"AffineTransformation",
"(",
"dim",
")",
";",
"}",
"trans",
".",
"addRotation"... | Apply a rotation to the generator
@param axis1 First axis (0 <= axis1 < dim)
@param axis2 Second axis (0 <= axis2 < dim)
@param angle Angle in Radians | [
"Apply",
"a",
"rotation",
"to",
"the",
"generator"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java#L134-L139 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/collection/MapConverter.java | MapConverter.getBoolean | public Boolean getBoolean(Map<String, Object> data, String name) {
return get(data, name, Boolean.class);
} | java | public Boolean getBoolean(Map<String, Object> data, String name) {
return get(data, name, Boolean.class);
} | [
"public",
"Boolean",
"getBoolean",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
",",
"String",
"name",
")",
"{",
"return",
"get",
"(",
"data",
",",
"name",
",",
"Boolean",
".",
"class",
")",
";",
"}"
] | <p>
getBoolean.
</p>
@param data a {@link java.util.Map} object.
@param name a {@link java.lang.String} object.
@return a {@link java.lang.Boolean} object. | [
"<p",
">",
"getBoolean",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/collection/MapConverter.java#L191-L193 |
JavaMoney/jsr354-api | src/main/java/javax/money/format/AmountFormatQuery.java | AmountFormatQuery.of | public static AmountFormatQuery of(Locale locale, String... providers) {
return AmountFormatQueryBuilder.of(locale).setProviderNames(providers).build();
} | java | public static AmountFormatQuery of(Locale locale, String... providers) {
return AmountFormatQueryBuilder.of(locale).setProviderNames(providers).build();
} | [
"public",
"static",
"AmountFormatQuery",
"of",
"(",
"Locale",
"locale",
",",
"String",
"...",
"providers",
")",
"{",
"return",
"AmountFormatQueryBuilder",
".",
"of",
"(",
"locale",
")",
".",
"setProviderNames",
"(",
"providers",
")",
".",
"build",
"(",
")",
... | Creates a simple format query based on a single Locale, similar to {@link java.text.DecimalFormat#getInstance
(java.util.Locale)}.
@param locale the target locale, not null.
@param providers the providers to be used, not null.
@return a new query instance | [
"Creates",
"a",
"simple",
"format",
"query",
"based",
"on",
"a",
"single",
"Locale",
"similar",
"to",
"{",
"@link",
"java",
".",
"text",
".",
"DecimalFormat#getInstance",
"(",
"java",
".",
"util",
".",
"Locale",
")",
"}",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/format/AmountFormatQuery.java#L96-L98 |
windup/windup | forks/jdt/src/main/java/org/eclipse/jdt/internal/compiler/Compiler.java | Compiler.accept | @Override
public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) {
// Switch the current policy and compilation result for this unit to the requested one.
CompilationResult unitResult =
new CompilationResult(sourceUnit, this.totalUnits, this.totalUnits, this... | java | @Override
public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) {
// Switch the current policy and compilation result for this unit to the requested one.
CompilationResult unitResult =
new CompilationResult(sourceUnit, this.totalUnits, this.totalUnits, this... | [
"@",
"Override",
"public",
"void",
"accept",
"(",
"ICompilationUnit",
"sourceUnit",
",",
"AccessRestriction",
"accessRestriction",
")",
"{",
"// Switch the current policy and compilation result for this unit to the requested one.",
"CompilationResult",
"unitResult",
"=",
"new",
"... | Add an additional compilation unit into the loop
-> build compilation unit declarations, their bindings and record their results. | [
"Add",
"an",
"additional",
"compilation",
"unit",
"into",
"the",
"loop",
"-",
">",
"build",
"compilation",
"unit",
"declarations",
"their",
"bindings",
"and",
"record",
"their",
"results",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/forks/jdt/src/main/java/org/eclipse/jdt/internal/compiler/Compiler.java#L329-L368 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/model/AccountParams.java | AccountParams.createAccountParams | @NonNull
public static AccountParams createAccountParams(
boolean tosShownAndAccepted,
@NonNull BusinessType businessType,
@Nullable Map<String, Object> businessData) {
return new AccountParams(businessType, businessData, tosShownAndAccepted);
} | java | @NonNull
public static AccountParams createAccountParams(
boolean tosShownAndAccepted,
@NonNull BusinessType businessType,
@Nullable Map<String, Object> businessData) {
return new AccountParams(businessType, businessData, tosShownAndAccepted);
} | [
"@",
"NonNull",
"public",
"static",
"AccountParams",
"createAccountParams",
"(",
"boolean",
"tosShownAndAccepted",
",",
"@",
"NonNull",
"BusinessType",
"businessType",
",",
"@",
"Nullable",
"Map",
"<",
"String",
",",
"Object",
">",
"businessData",
")",
"{",
"retur... | Create an {@link AccountParams} instance for a {@link BusinessType#Individual} or
{@link BusinessType#Company}
Note: API version {@code 2019-02-19} [0] replaced {@code legal_entity} with
{@code individual} and {@code company}.
@param tosShownAndAccepted Whether the user described by the data in the token has been sho... | [
"Create",
"an",
"{",
"@link",
"AccountParams",
"}",
"instance",
"for",
"a",
"{",
"@link",
"BusinessType#Individual",
"}",
"or",
"{",
"@link",
"BusinessType#Company",
"}"
] | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/model/AccountParams.java#L49-L55 |
lucee/Lucee | core/src/main/java/lucee/runtime/security/SecurityManagerImpl.java | SecurityManagerImpl.toStringAccessValue | public static String toStringAccessValue(short accessValue) throws SecurityException {
switch (accessValue) {
case VALUE_NONE:
return "none";
// case VALUE_NO: return "no";
case VALUE_YES:
return "yes";
// case VALUE_ALL: return "all";
case VALUE_LOCAL:
return "local";
case VALUE_1:
return "1... | java | public static String toStringAccessValue(short accessValue) throws SecurityException {
switch (accessValue) {
case VALUE_NONE:
return "none";
// case VALUE_NO: return "no";
case VALUE_YES:
return "yes";
// case VALUE_ALL: return "all";
case VALUE_LOCAL:
return "local";
case VALUE_1:
return "1... | [
"public",
"static",
"String",
"toStringAccessValue",
"(",
"short",
"accessValue",
")",
"throws",
"SecurityException",
"{",
"switch",
"(",
"accessValue",
")",
"{",
"case",
"VALUE_NONE",
":",
"return",
"\"none\"",
";",
"// case VALUE_NO: return \"no\";",
"case",
"VALUE_... | translate a short access value (all,local,none,no,yes) to String type
@param accessValue
@return return int access value (VALUE_ALL,VALUE_LOCAL,VALUE_NO,VALUE_NONE,VALUE_YES)
@throws SecurityException | [
"translate",
"a",
"short",
"access",
"value",
"(",
"all",
"local",
"none",
"no",
"yes",
")",
"to",
"String",
"type"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/security/SecurityManagerImpl.java#L263-L296 |
petergeneric/stdlib | service-manager/configuration/src/main/java/com/peterphi/configuration/service/git/ConfigRepository.java | ConfigRepository.set | public void set(final String name,
final String email,
final Map<String, Map<String, ConfigPropertyValue>> data,
final ConfigChangeMode changeMode,
final String message)
{
try
{
RepoHelper.write(repo, name, email, data, changeMode, message);
... | java | public void set(final String name,
final String email,
final Map<String, Map<String, ConfigPropertyValue>> data,
final ConfigChangeMode changeMode,
final String message)
{
try
{
RepoHelper.write(repo, name, email, data, changeMode, message);
... | [
"public",
"void",
"set",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"email",
",",
"final",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"ConfigPropertyValue",
">",
">",
"data",
",",
"final",
"ConfigChangeMode",
"changeMode",
",",
"fin... | Create a new commit reflecting the provided properties
@param name
@param email
@param data
@param erase
if true all existing properties will be erased
@param message | [
"Create",
"a",
"new",
"commit",
"reflecting",
"the",
"provided",
"properties"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/service-manager/configuration/src/main/java/com/peterphi/configuration/service/git/ConfigRepository.java#L101-L137 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java | ReactionSetManipulator.getRelevantReactions | public static IReactionSet getRelevantReactions(IReactionSet reactSet, IAtomContainer molecule) {
IReactionSet newReactSet = reactSet.getBuilder().newInstance(IReactionSet.class);
IReactionSet reactSetProd = getRelevantReactionsAsProduct(reactSet, molecule);
for (IReaction reaction : reactSetPro... | java | public static IReactionSet getRelevantReactions(IReactionSet reactSet, IAtomContainer molecule) {
IReactionSet newReactSet = reactSet.getBuilder().newInstance(IReactionSet.class);
IReactionSet reactSetProd = getRelevantReactionsAsProduct(reactSet, molecule);
for (IReaction reaction : reactSetPro... | [
"public",
"static",
"IReactionSet",
"getRelevantReactions",
"(",
"IReactionSet",
"reactSet",
",",
"IAtomContainer",
"molecule",
")",
"{",
"IReactionSet",
"newReactSet",
"=",
"reactSet",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IReactionSet",
".",
"clas... | Get all Reactions object containing a Molecule from a set of Reactions.
@param reactSet The set of reaction to inspect
@param molecule The molecule to find
@return The IReactionSet | [
"Get",
"all",
"Reactions",
"object",
"containing",
"a",
"Molecule",
"from",
"a",
"set",
"of",
"Reactions",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java#L144-L153 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findAll | public static <T> List<T> findAll(List<T> self) {
return findAll(self, Closure.IDENTITY);
} | java | public static <T> List<T> findAll(List<T> self) {
return findAll(self, Closure.IDENTITY);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"findAll",
"(",
"List",
"<",
"T",
">",
"self",
")",
"{",
"return",
"findAll",
"(",
"self",
",",
"Closure",
".",
"IDENTITY",
")",
";",
"}"
] | Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).
<p>
Example:
<pre class="groovyTestCase">
def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null]
assert items.findAll() == [1, 2, true, 'foo', [4, 5]]
</pre>
@param self a List
@return a List of the values found
@since 2.4.0
@... | [
"Finds",
"the",
"items",
"matching",
"the",
"IDENTITY",
"Closure",
"(",
"i",
".",
"e",
".",
" ",
";",
"matching",
"Groovy",
"truth",
")",
".",
"<p",
">",
"Example",
":",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"def",
"items",
"=",
"[",
"1",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L4829-L4831 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.getIndirectionTableColName | private String getIndirectionTableColName(TableAlias mnAlias, String path)
{
int dotIdx = path.lastIndexOf(".");
String column = path.substring(dotIdx);
return mnAlias.alias + column;
} | java | private String getIndirectionTableColName(TableAlias mnAlias, String path)
{
int dotIdx = path.lastIndexOf(".");
String column = path.substring(dotIdx);
return mnAlias.alias + column;
} | [
"private",
"String",
"getIndirectionTableColName",
"(",
"TableAlias",
"mnAlias",
",",
"String",
"path",
")",
"{",
"int",
"dotIdx",
"=",
"path",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
"String",
"column",
"=",
"path",
".",
"substring",
"(",
"dotIdx",
")",... | Get the column name from the indirection table.
@param mnAlias
@param path | [
"Get",
"the",
"column",
"name",
"from",
"the",
"indirection",
"table",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L748-L753 |
Bedework/bw-util | bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java | DirRecord.addAttr | public void addAttr(String attr, Object val) throws NamingException {
// System.out.println("addAttr " + attr);
Attribute a = findAttr(attr);
if (a == null) {
setAttr(attr, val);
} else {
a.add(val);
}
} | java | public void addAttr(String attr, Object val) throws NamingException {
// System.out.println("addAttr " + attr);
Attribute a = findAttr(attr);
if (a == null) {
setAttr(attr, val);
} else {
a.add(val);
}
} | [
"public",
"void",
"addAttr",
"(",
"String",
"attr",
",",
"Object",
"val",
")",
"throws",
"NamingException",
"{",
"// System.out.println(\"addAttr \" + attr);",
"Attribute",
"a",
"=",
"findAttr",
"(",
"attr",
")",
";",
"if",
"(",
"a",
"==",
"null",
")",
"{",
... | Add the attribute value to the table. If an attribute already exists
add it to the end of its values.
@param attr String attribute name
@param val Object value
@throws NamingException | [
"Add",
"the",
"attribute",
"value",
"to",
"the",
"table",
".",
"If",
"an",
"attribute",
"already",
"exists",
"add",
"it",
"to",
"the",
"end",
"of",
"its",
"values",
"."
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-directory/src/main/java/org/bedework/util/directory/common/DirRecord.java#L479-L489 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.recoverDeletedKeyAsync | public ServiceFuture<KeyBundle> recoverDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<KeyBundle> serviceCallback) {
return ServiceFuture.fromResponse(recoverDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback);
} | java | public ServiceFuture<KeyBundle> recoverDeletedKeyAsync(String vaultBaseUrl, String keyName, final ServiceCallback<KeyBundle> serviceCallback) {
return ServiceFuture.fromResponse(recoverDeletedKeyWithServiceResponseAsync(vaultBaseUrl, keyName), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"KeyBundle",
">",
"recoverDeletedKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"final",
"ServiceCallback",
"<",
"KeyBundle",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
"fromResponse",
... | Recovers the deleted key to its latest version.
The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete opera... | [
"Recovers",
"the",
"deleted",
"key",
"to",
"its",
"latest",
"version",
".",
"The",
"Recover",
"Deleted",
"Key",
"operation",
"is",
"applicable",
"for",
"deleted",
"keys",
"in",
"soft",
"-",
"delete",
"enabled",
"vaults",
".",
"It",
"recovers",
"the",
"delete... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3247-L3249 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsUserDriver.java | CmsUserDriver.internalCreateResourceForOrgUnit | protected CmsResource internalCreateResourceForOrgUnit(CmsDbContext dbc, String path, int flags)
throws CmsException {
// create the offline folder
CmsResource resource = new CmsFolder(
new CmsUUID(),
new CmsUUID(),
path,
CmsResourceTypeFolder.RESOURC... | java | protected CmsResource internalCreateResourceForOrgUnit(CmsDbContext dbc, String path, int flags)
throws CmsException {
// create the offline folder
CmsResource resource = new CmsFolder(
new CmsUUID(),
new CmsUUID(),
path,
CmsResourceTypeFolder.RESOURC... | [
"protected",
"CmsResource",
"internalCreateResourceForOrgUnit",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"path",
",",
"int",
"flags",
")",
"throws",
"CmsException",
"{",
"// create the offline folder",
"CmsResource",
"resource",
"=",
"new",
"CmsFolder",
"(",
"new",
... | Creates a folder with the given path an properties, offline AND online.<p>
@param dbc the current database context
@param path the path to create the folder
@param flags the resource flags
@return the new created offline folder
@throws CmsException if something goes wrong | [
"Creates",
"a",
"folder",
"with",
"the",
"given",
"path",
"an",
"properties",
"offline",
"AND",
"online",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsUserDriver.java#L2449-L2495 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toDate | public static DateTime toDate(Object o, TimeZone tz) throws PageException {
return DateCaster.toDateAdvanced(o, tz);
} | java | public static DateTime toDate(Object o, TimeZone tz) throws PageException {
return DateCaster.toDateAdvanced(o, tz);
} | [
"public",
"static",
"DateTime",
"toDate",
"(",
"Object",
"o",
",",
"TimeZone",
"tz",
")",
"throws",
"PageException",
"{",
"return",
"DateCaster",
".",
"toDateAdvanced",
"(",
"o",
",",
"tz",
")",
";",
"}"
] | cast a Object to a DateTime Object
@param o Object to cast
@param tz
@return casted DateTime Object
@throws PageException | [
"cast",
"a",
"Object",
"to",
"a",
"DateTime",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L2873-L2875 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/RuleConditions.java | RuleConditions.createAndCondition | public static Node createAndCondition(Node left, Node right) {
checkNode(left, IN, AND, OR);
checkNode(right, IN, AND, OR);
return new Condition(Node.Type.AND, left, right);
} | java | public static Node createAndCondition(Node left, Node right) {
checkNode(left, IN, AND, OR);
checkNode(right, IN, AND, OR);
return new Condition(Node.Type.AND, left, right);
} | [
"public",
"static",
"Node",
"createAndCondition",
"(",
"Node",
"left",
",",
"Node",
"right",
")",
"{",
"checkNode",
"(",
"left",
",",
"IN",
",",
"AND",
",",
"OR",
")",
";",
"checkNode",
"(",
"right",
",",
"IN",
",",
"AND",
",",
"OR",
")",
";",
"ret... | Create an "AND" condition.
<p>
@param left left side of condition
@param right right side of condition
@return the "and" condition | [
"Create",
"an",
"AND",
"condition",
".",
"<p",
">"
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/RuleConditions.java#L52-L56 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAzureADAdministratorsInner.java | ServerAzureADAdministratorsInner.listByServerAsync | public Observable<List<ServerAzureADAdministratorInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<ServerAzureADAdministratorInner>>, List<ServerAzureADAdministratorInner>>() {
... | java | public Observable<List<ServerAzureADAdministratorInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<ServerAzureADAdministratorInner>>, List<ServerAzureADAdministratorInner>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"ServerAzureADAdministratorInner",
">",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverN... | Returns a list of server Administrators.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation
@... | [
"Returns",
"a",
"list",
"of",
"server",
"Administrators",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAzureADAdministratorsInner.java#L542-L549 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/NetworkUtil.java | NetworkUtil.findLocalAddressListeningOnPort | private static InetAddress findLocalAddressListeningOnPort(String pHost, int pPort) throws UnknownHostException, SocketException {
InetAddress address = InetAddress.getByName(pHost);
if (address.isLoopbackAddress()) {
// First check local address
InetAddress localAddress = getLoc... | java | private static InetAddress findLocalAddressListeningOnPort(String pHost, int pPort) throws UnknownHostException, SocketException {
InetAddress address = InetAddress.getByName(pHost);
if (address.isLoopbackAddress()) {
// First check local address
InetAddress localAddress = getLoc... | [
"private",
"static",
"InetAddress",
"findLocalAddressListeningOnPort",
"(",
"String",
"pHost",
",",
"int",
"pPort",
")",
"throws",
"UnknownHostException",
",",
"SocketException",
"{",
"InetAddress",
"address",
"=",
"InetAddress",
".",
"getByName",
"(",
"pHost",
")",
... | Check for an non-loopback, local adress listening on the given port | [
"Check",
"for",
"an",
"non",
"-",
"loopback",
"local",
"adress",
"listening",
"on",
"the",
"given",
"port"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/NetworkUtil.java#L236-L252 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java | ProfilesConfigFileWriter.modifyOrInsertProfiles | public static void modifyOrInsertProfiles(File destination, Profile... profiles) {
final Map<String, Profile> modifications = new LinkedHashMap<String, Profile>();
for (Profile profile : profiles) {
modifications.put(profile.getProfileName(), profile);
}
modifyProfiles(desti... | java | public static void modifyOrInsertProfiles(File destination, Profile... profiles) {
final Map<String, Profile> modifications = new LinkedHashMap<String, Profile>();
for (Profile profile : profiles) {
modifications.put(profile.getProfileName(), profile);
}
modifyProfiles(desti... | [
"public",
"static",
"void",
"modifyOrInsertProfiles",
"(",
"File",
"destination",
",",
"Profile",
"...",
"profiles",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Profile",
">",
"modifications",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"Profile",
">",... | Modify or insert new profiles into an existing credentials file by
in-place modification. Only the properties of the affected profiles will
be modified; all the unaffected profiles and comment lines will remain
the same. This method does not support renaming a profile.
@param destination
The destination file to modify... | [
"Modify",
"or",
"insert",
"new",
"profiles",
"into",
"an",
"existing",
"credentials",
"file",
"by",
"in",
"-",
"place",
"modification",
".",
"Only",
"the",
"properties",
"of",
"the",
"affected",
"profiles",
"will",
"be",
"modified",
";",
"all",
"the",
"unaff... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java#L105-L112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.