repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 218 | func_name stringlengths 5 140 | whole_func_string stringlengths 79 3.99k | language stringclasses 1
value | func_code_string stringlengths 79 3.99k | func_code_tokens listlengths 20 624 | func_documentation_string stringlengths 61 1.96k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 107 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.resizeAsync | public Observable<Void> resizeAsync(String poolId, PoolResizeParameter poolResizeParameter) {
return resizeWithServiceResponseAsync(poolId, poolResizeParameter).map(new Func1<ServiceResponseWithHeaders<Void, PoolResizeHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHead... | java | public Observable<Void> resizeAsync(String poolId, PoolResizeParameter poolResizeParameter) {
return resizeWithServiceResponseAsync(poolId, poolResizeParameter).map(new Func1<ServiceResponseWithHeaders<Void, PoolResizeHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHead... | [
"public",
"Observable",
"<",
"Void",
">",
"resizeAsync",
"(",
"String",
"poolId",
",",
"PoolResizeParameter",
"poolResizeParameter",
")",
"{",
"return",
"resizeWithServiceResponseAsync",
"(",
"poolId",
",",
"poolResizeParameter",
")",
".",
"map",
"(",
"new",
"Func1"... | Changes the number of compute nodes that are assigned to a pool.
You can only resize a pool when its allocation state is steady. If the pool is already resizing, the request fails with status code 409. When you resize a pool, the pool's allocation state changes from steady to resizing. You cannot resize pools which are... | [
"Changes",
"the",
"number",
"of",
"compute",
"nodes",
"that",
"are",
"assigned",
"to",
"a",
"pool",
".",
"You",
"can",
"only",
"resize",
"a",
"pool",
"when",
"its",
"allocation",
"state",
"is",
"steady",
".",
"If",
"the",
"pool",
"is",
"already",
"resizi... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L2748-L2755 |
fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/ArchiveService.java | ArchiveService.createDockerBuildArchive | public File createDockerBuildArchive(ImageConfiguration imageConfig, MojoParameters params, ArchiverCustomizer customizer)
throws MojoExecutionException {
File ret = createArchive(imageConfig.getName(), imageConfig.getBuildConfiguration(), params, log, customizer);
log.info("%s: Created dock... | java | public File createDockerBuildArchive(ImageConfiguration imageConfig, MojoParameters params, ArchiverCustomizer customizer)
throws MojoExecutionException {
File ret = createArchive(imageConfig.getName(), imageConfig.getBuildConfiguration(), params, log, customizer);
log.info("%s: Created dock... | [
"public",
"File",
"createDockerBuildArchive",
"(",
"ImageConfiguration",
"imageConfig",
",",
"MojoParameters",
"params",
",",
"ArchiverCustomizer",
"customizer",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"ret",
"=",
"createArchive",
"(",
"imageConfig",
".",
... | Create the tar file container the source for building an image. This tar can be used directly for
uploading to a Docker daemon for creating the image
@param imageConfig the image configuration
@param params mojo params for the project
@param customizer final customizer to be applied to the tar before being generated
@... | [
"Create",
"the",
"tar",
"file",
"container",
"the",
"source",
"for",
"building",
"an",
"image",
".",
"This",
"tar",
"can",
"be",
"used",
"directly",
"for",
"uploading",
"to",
"a",
"Docker",
"daemon",
"for",
"creating",
"the",
"image"
] | train | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/ArchiveService.java#L73-L78 |
js-lib-com/commons | src/main/java/js/lang/Config.java | Config.getProperty | public <T> T getProperty(String name, Class<T> type, T defaultValue)
{
Params.notNullOrEmpty(name, "Property name");
Params.notNull(type, "Property type");
String value = getProperty(name);
if(value != null) {
return converter.asObject(value, type);
}
return defaultValue;
} | java | public <T> T getProperty(String name, Class<T> type, T defaultValue)
{
Params.notNullOrEmpty(name, "Property name");
Params.notNull(type, "Property type");
String value = getProperty(name);
if(value != null) {
return converter.asObject(value, type);
}
return defaultValue;
} | [
"public",
"<",
"T",
">",
"T",
"getProperty",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"defaultValue",
")",
"{",
"Params",
".",
"notNullOrEmpty",
"(",
"name",
",",
"\"Property name\"",
")",
";",
"Params",
".",
"notNull",
"("... | Get configuration object property converter to requested type or default value if there is no property with given
name.
@param name property name.
@param type type to convert property value to,
@param defaultValue default value, possible null or empty.
@param <T> value type.
@return newly created value object or defau... | [
"Get",
"configuration",
"object",
"property",
"converter",
"to",
"requested",
"type",
"or",
"default",
"value",
"if",
"there",
"is",
"no",
"property",
"with",
"given",
"name",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/lang/Config.java#L427-L436 |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/rest/RestClient.java | RestClient.doHttpSendRequest | public MuleMessage doHttpSendRequest(String url, String method, String payload, String contentType) {
Map<String, String> properties = new HashMap<String, String>();
properties.put("http.method", method);
properties.put("Content-Type", contentType);
MuleMessage response = send(url, payload,... | java | public MuleMessage doHttpSendRequest(String url, String method, String payload, String contentType) {
Map<String, String> properties = new HashMap<String, String>();
properties.put("http.method", method);
properties.put("Content-Type", contentType);
MuleMessage response = send(url, payload,... | [
"public",
"MuleMessage",
"doHttpSendRequest",
"(",
"String",
"url",
",",
"String",
"method",
",",
"String",
"payload",
",",
"String",
"contentType",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
"=",
"new",
"HashMap",
"<",
"String",
",",
... | Perform a HTTP call sending information to the server using POST or PUT
@param url
@param method, e.g. "POST" or "PUT"
@param payload
@param contentType
@return
@throws MuleException | [
"Perform",
"a",
"HTTP",
"call",
"sending",
"information",
"to",
"the",
"server",
"using",
"POST",
"or",
"PUT"
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/rest/RestClient.java#L159-L168 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/SyntacticCategory.java | SyntacticCategory.assignAllFeatures | public SyntacticCategory assignAllFeatures(String value) {
Set<Integer> featureVars = Sets.newHashSet();
getAllFeatureVariables(featureVars);
Map<Integer, String> valueMap = Maps.newHashMap();
for (Integer var : featureVars) {
valueMap.put(var, value);
}
return assignFeatures(valueMap, Co... | java | public SyntacticCategory assignAllFeatures(String value) {
Set<Integer> featureVars = Sets.newHashSet();
getAllFeatureVariables(featureVars);
Map<Integer, String> valueMap = Maps.newHashMap();
for (Integer var : featureVars) {
valueMap.put(var, value);
}
return assignFeatures(valueMap, Co... | [
"public",
"SyntacticCategory",
"assignAllFeatures",
"(",
"String",
"value",
")",
"{",
"Set",
"<",
"Integer",
">",
"featureVars",
"=",
"Sets",
".",
"newHashSet",
"(",
")",
";",
"getAllFeatureVariables",
"(",
"featureVars",
")",
";",
"Map",
"<",
"Integer",
",",
... | Assigns value to all unfilled feature variables.
@param value
@return | [
"Assigns",
"value",
"to",
"all",
"unfilled",
"feature",
"variables",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/SyntacticCategory.java#L299-L308 |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/service/TechnologyTagService.java | TechnologyTagService.addTagToFileModel | public TechnologyTagModel addTagToFileModel(FileModel fileModel, String tagName, TechnologyTagLevel level)
{
Traversable<Vertex, Vertex> q = getGraphContext().getQuery(TechnologyTagModel.class)
.traverse(g -> g.has(TechnologyTagModel.NAME, tagName));
TechnologyTagModel technology... | java | public TechnologyTagModel addTagToFileModel(FileModel fileModel, String tagName, TechnologyTagLevel level)
{
Traversable<Vertex, Vertex> q = getGraphContext().getQuery(TechnologyTagModel.class)
.traverse(g -> g.has(TechnologyTagModel.NAME, tagName));
TechnologyTagModel technology... | [
"public",
"TechnologyTagModel",
"addTagToFileModel",
"(",
"FileModel",
"fileModel",
",",
"String",
"tagName",
",",
"TechnologyTagLevel",
"level",
")",
"{",
"Traversable",
"<",
"Vertex",
",",
"Vertex",
">",
"q",
"=",
"getGraphContext",
"(",
")",
".",
"getQuery",
... | Adds the provided tag to the provided {@link FileModel}. If a {@link TechnologyTagModel} cannot be found with the provided name, then one will
be created. | [
"Adds",
"the",
"provided",
"tag",
"to",
"the",
"provided",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/service/TechnologyTagService.java#L44-L60 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/utils/H2DBLock.java | H2DBLock.readLockFile | private String readLockFile() {
String msg = null;
try (RandomAccessFile f = new RandomAccessFile(lockFile, "rw")) {
msg = f.readLine();
} catch (IOException ex) {
LOGGER.debug(String.format("Error reading lock file: %s", lockFile), ex);
}
return msg;
... | java | private String readLockFile() {
String msg = null;
try (RandomAccessFile f = new RandomAccessFile(lockFile, "rw")) {
msg = f.readLine();
} catch (IOException ex) {
LOGGER.debug(String.format("Error reading lock file: %s", lockFile), ex);
}
return msg;
... | [
"private",
"String",
"readLockFile",
"(",
")",
"{",
"String",
"msg",
"=",
"null",
";",
"try",
"(",
"RandomAccessFile",
"f",
"=",
"new",
"RandomAccessFile",
"(",
"lockFile",
",",
"\"rw\"",
")",
")",
"{",
"msg",
"=",
"f",
".",
"readLine",
"(",
")",
";",
... | Reads the first line from the lock file and returns the results as a
string.
@return the first line from the lock file; or null if the contents could
not be read | [
"Reads",
"the",
"first",
"line",
"from",
"the",
"lock",
"file",
"and",
"returns",
"the",
"results",
"as",
"a",
"string",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/H2DBLock.java#L231-L239 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/config/executor/PooledExecutionServiceConfiguration.java | PooledExecutionServiceConfiguration.addPool | public void addPool(String alias, int minSize, int maxSize) {
if (alias == null) {
throw new NullPointerException("Pool alias cannot be null");
}
if (poolConfigurations.containsKey(alias)) {
throw new IllegalArgumentException("A pool with the alias '" + alias + "' is already configured");
} ... | java | public void addPool(String alias, int minSize, int maxSize) {
if (alias == null) {
throw new NullPointerException("Pool alias cannot be null");
}
if (poolConfigurations.containsKey(alias)) {
throw new IllegalArgumentException("A pool with the alias '" + alias + "' is already configured");
} ... | [
"public",
"void",
"addPool",
"(",
"String",
"alias",
",",
"int",
"minSize",
",",
"int",
"maxSize",
")",
"{",
"if",
"(",
"alias",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Pool alias cannot be null\"",
")",
";",
"}",
"if",
"(",... | Adds a new pool with the provided minimum and maximum.
@param alias the pool alias
@param minSize the minimum size
@param maxSize the maximum size
@throws NullPointerException if alias is null
@throws IllegalArgumentException if another pool with the same alias was configured already | [
"Adds",
"a",
"new",
"pool",
"with",
"the",
"provided",
"minimum",
"and",
"maximum",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/config/executor/PooledExecutionServiceConfiguration.java#L82-L91 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.saxpyi | @Override
protected void saxpyi(long N, double alpha, INDArray X, DataBuffer pointers, INDArray Y) {
cblas_saxpyi((int) N, (float) alpha, (FloatPointer) X.data().addressPointer(), (IntPointer) pointers.addressPointer(),
(FloatPointer) Y.data().addressPointer());
} | java | @Override
protected void saxpyi(long N, double alpha, INDArray X, DataBuffer pointers, INDArray Y) {
cblas_saxpyi((int) N, (float) alpha, (FloatPointer) X.data().addressPointer(), (IntPointer) pointers.addressPointer(),
(FloatPointer) Y.data().addressPointer());
} | [
"@",
"Override",
"protected",
"void",
"saxpyi",
"(",
"long",
"N",
",",
"double",
"alpha",
",",
"INDArray",
"X",
",",
"DataBuffer",
"pointers",
",",
"INDArray",
"Y",
")",
"{",
"cblas_saxpyi",
"(",
"(",
"int",
")",
"N",
",",
"(",
"float",
")",
"alpha",
... | Adds a scalar multiple of float compressed sparse vector to a full-storage vector.
@param N The number of elements in vector X
@param alpha
@param X a sparse vector
@param pointers A DataBuffer that specifies the indices for the elements of x.
@param Y a dense vector | [
"Adds",
"a",
"scalar",
"multiple",
"of",
"float",
"compressed",
"sparse",
"vector",
"to",
"a",
"full",
"-",
"storage",
"vector",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L211-L215 |
Alluxio/alluxio | core/common/src/main/java/alluxio/grpc/GrpcManagedChannelPool.java | GrpcManagedChannelPool.releaseManagedChannel | public void releaseManagedChannel(ChannelKey channelKey, long shutdownTimeoutMs) {
boolean shutdownManagedChannel;
try (LockResource lockShared = new LockResource(mLock.readLock())) {
Verify.verify(mChannels.containsKey(channelKey));
ManagedChannelReference channelRef = mChannels.get(channelKey);
... | java | public void releaseManagedChannel(ChannelKey channelKey, long shutdownTimeoutMs) {
boolean shutdownManagedChannel;
try (LockResource lockShared = new LockResource(mLock.readLock())) {
Verify.verify(mChannels.containsKey(channelKey));
ManagedChannelReference channelRef = mChannels.get(channelKey);
... | [
"public",
"void",
"releaseManagedChannel",
"(",
"ChannelKey",
"channelKey",
",",
"long",
"shutdownTimeoutMs",
")",
"{",
"boolean",
"shutdownManagedChannel",
";",
"try",
"(",
"LockResource",
"lockShared",
"=",
"new",
"LockResource",
"(",
"mLock",
".",
"readLock",
"("... | Decreases the ref-count of the {@link ManagedChannel} for the given address.
It shuts down and releases the {@link ManagedChannel} if reference count reaches zero.
@param channelKey host address
@param shutdownTimeoutMs shutdown timeout in milliseconds | [
"Decreases",
"the",
"ref",
"-",
"count",
"of",
"the",
"{",
"@link",
"ManagedChannel",
"}",
"for",
"the",
"given",
"address",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/grpc/GrpcManagedChannelPool.java#L192-L212 |
MenoData/Time4J | base/src/main/java/net/time4j/calendar/astro/SolarTime.java | SolarTime.ofLocation | public static SolarTime ofLocation(
double latitude,
double longitude,
int altitude,
String calculator
) {
check(latitude, longitude, altitude, calculator);
return new SolarTime(latitude, longitude, altitude, calculator, null);
} | java | public static SolarTime ofLocation(
double latitude,
double longitude,
int altitude,
String calculator
) {
check(latitude, longitude, altitude, calculator);
return new SolarTime(latitude, longitude, altitude, calculator, null);
} | [
"public",
"static",
"SolarTime",
"ofLocation",
"(",
"double",
"latitude",
",",
"double",
"longitude",
",",
"int",
"altitude",
",",
"String",
"calculator",
")",
"{",
"check",
"(",
"latitude",
",",
"longitude",
",",
"altitude",
",",
"calculator",
")",
";",
"re... | /*[deutsch]
<p>Liefert die Sonnenzeit zur angegebenen geographischen Position. </p>
<p>Diese Methode nimmt geographische Angaben nur in Dezimalgrad entgegen. Wenn diese Daten aber
in Grad, Bogenminuten und Bogensekunden vorliegen, sollten Anwender den {@link #ofLocation() Builder-Ansatz}
bevorzugen. </p>
@param lat... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Liefert",
"die",
"Sonnenzeit",
"zur",
"angegebenen",
"geographischen",
"Position",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/astro/SolarTime.java#L400-L410 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.beginCreateOrUpdateWorkerPoolAsync | public Observable<WorkerPoolResourceInner> beginCreateOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
return beginCreateOrUpdateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).map(... | java | public Observable<WorkerPoolResourceInner> beginCreateOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
return beginCreateOrUpdateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).map(... | [
"public",
"Observable",
"<",
"WorkerPoolResourceInner",
">",
"beginCreateOrUpdateWorkerPoolAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"workerPoolName",
",",
"WorkerPoolResourceInner",
"workerPoolEnvelope",
")",
"{",
"return",
"beginCre... | Create or update a worker pool.
Create or update a worker pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param workerPoolName Name of the worker pool.
@param workerPoolEnvelope Properties of the worker pool.
@throws IllegalArgu... | [
"Create",
"or",
"update",
"a",
"worker",
"pool",
".",
"Create",
"or",
"update",
"a",
"worker",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L5309-L5316 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesInner.java | RegistriesInner.scheduleRun | public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) {
return scheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).toBlocking().last().body();
} | java | public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) {
return scheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).toBlocking().last().body();
} | [
"public",
"RunInner",
"scheduleRun",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"RunRequest",
"runRequest",
")",
"{",
"return",
"scheduleRunWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"runRequest",
")",
"."... | Schedules a new run based on the request parameters and add it to the run queue.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param runRequest The parameters of a run that needs to scheduled.
@throws IllegalArg... | [
"Schedules",
"a",
"new",
"run",
"based",
"on",
"the",
"request",
"parameters",
"and",
"add",
"it",
"to",
"the",
"run",
"queue",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RegistriesInner.java#L1727-L1729 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java | DefaultFeatureForm.getValue | @Api
public void getValue(String name, StringAttribute attribute) {
attribute.setValue((String) formWidget.getValue(name));
} | java | @Api
public void getValue(String name, StringAttribute attribute) {
attribute.setValue((String) formWidget.getValue(name));
} | [
"@",
"Api",
"public",
"void",
"getValue",
"(",
"String",
"name",
",",
"StringAttribute",
"attribute",
")",
"{",
"attribute",
".",
"setValue",
"(",
"(",
"String",
")",
"formWidget",
".",
"getValue",
"(",
"name",
")",
")",
";",
"}"
] | Get a string value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1 | [
"Get",
"a",
"string",
"value",
"from",
"the",
"form",
"and",
"place",
"it",
"in",
"<code",
">",
"attribute<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java#L728-L731 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java | EditManager.getEditSet | private static Element getEditSet(Element node, Document plf, IPerson person, boolean create)
throws PortalException {
Node child = node.getFirstChild();
while (child != null) {
if (child.getNodeName().equals(Constants.ELM_EDIT_SET)) return (Element) child;
child = c... | java | private static Element getEditSet(Element node, Document plf, IPerson person, boolean create)
throws PortalException {
Node child = node.getFirstChild();
while (child != null) {
if (child.getNodeName().equals(Constants.ELM_EDIT_SET)) return (Element) child;
child = c... | [
"private",
"static",
"Element",
"getEditSet",
"(",
"Element",
"node",
",",
"Document",
"plf",
",",
"IPerson",
"person",
",",
"boolean",
"create",
")",
"throws",
"PortalException",
"{",
"Node",
"child",
"=",
"node",
".",
"getFirstChild",
"(",
")",
";",
"while... | Get the edit set if any stored in the passed in node. If not found and if the create flag is
true then create a new edit set and add it as a child to the passed in node. Then return it. | [
"Get",
"the",
"edit",
"set",
"if",
"any",
"stored",
"in",
"the",
"passed",
"in",
"node",
".",
"If",
"not",
"found",
"and",
"if",
"the",
"create",
"flag",
"is",
"true",
"then",
"create",
"a",
"new",
"edit",
"set",
"and",
"add",
"it",
"as",
"a",
"chi... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/EditManager.java#L54-L82 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPP14Reader.java | MPP14Reader.readSubProjects | private void readSubProjects(byte[] data, int uniqueIDOffset, int filePathOffset, int fileNameOffset, int subprojectIndex)
{
while (uniqueIDOffset < filePathOffset)
{
readSubProject(data, uniqueIDOffset, filePathOffset, fileNameOffset, subprojectIndex++);
uniqueIDOffset += 4;
}
... | java | private void readSubProjects(byte[] data, int uniqueIDOffset, int filePathOffset, int fileNameOffset, int subprojectIndex)
{
while (uniqueIDOffset < filePathOffset)
{
readSubProject(data, uniqueIDOffset, filePathOffset, fileNameOffset, subprojectIndex++);
uniqueIDOffset += 4;
}
... | [
"private",
"void",
"readSubProjects",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"uniqueIDOffset",
",",
"int",
"filePathOffset",
",",
"int",
"fileNameOffset",
",",
"int",
"subprojectIndex",
")",
"{",
"while",
"(",
"uniqueIDOffset",
"<",
"filePathOffset",
")",
... | Read a list of sub projects.
@param data byte array
@param uniqueIDOffset offset of unique ID
@param filePathOffset offset of file path
@param fileNameOffset offset of file name
@param subprojectIndex index of the subproject, used to calculate unique id offset | [
"Read",
"a",
"list",
"of",
"sub",
"projects",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP14Reader.java#L559-L566 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/MonitoringAspect.java | MonitoringAspect.doProfilingMethod | @Around(value = "execution(* *(..)) && (@annotation(method))")
public Object doProfilingMethod(ProceedingJoinPoint pjp, Monitor method) throws Throwable {
return doProfiling(pjp, method.producerId(), method.subsystem(), method.category());
} | java | @Around(value = "execution(* *(..)) && (@annotation(method))")
public Object doProfilingMethod(ProceedingJoinPoint pjp, Monitor method) throws Throwable {
return doProfiling(pjp, method.producerId(), method.subsystem(), method.category());
} | [
"@",
"Around",
"(",
"value",
"=",
"\"execution(* *(..)) && (@annotation(method))\"",
")",
"public",
"Object",
"doProfilingMethod",
"(",
"ProceedingJoinPoint",
"pjp",
",",
"Monitor",
"method",
")",
"throws",
"Throwable",
"{",
"return",
"doProfiling",
"(",
"pjp",
",",
... | Common method profiling entry-point.
@param pjp
{@link ProceedingJoinPoint}
@param method
{@link Monitor}
@return call result
@throws Throwable
in case of error during {@link ProceedingJoinPoint#proceed()} | [
"Common",
"method",
"profiling",
"entry",
"-",
"point",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/MonitoringAspect.java#L36-L39 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java | ModelsEngine.sourcesNet | public static boolean sourcesNet( RandomIter flowIterator, int[] colRow, int num, RandomIter netNum ) {
int[][] dir = {{0, 0, 0}, {1, 0, 5}, {1, -1, 6}, {0, -1, 7}, {-1, -1, 8}, {-1, 0, 1}, {-1, 1, 2}, {0, 1, 3}, {1, 1, 4}};
if (flowIterator.getSampleDouble(colRow[0], colRow[1], 0) <= 10.0
... | java | public static boolean sourcesNet( RandomIter flowIterator, int[] colRow, int num, RandomIter netNum ) {
int[][] dir = {{0, 0, 0}, {1, 0, 5}, {1, -1, 6}, {0, -1, 7}, {-1, -1, 8}, {-1, 0, 1}, {-1, 1, 2}, {0, 1, 3}, {1, 1, 4}};
if (flowIterator.getSampleDouble(colRow[0], colRow[1], 0) <= 10.0
... | [
"public",
"static",
"boolean",
"sourcesNet",
"(",
"RandomIter",
"flowIterator",
",",
"int",
"[",
"]",
"colRow",
",",
"int",
"num",
",",
"RandomIter",
"netNum",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"dir",
"=",
"{",
"{",
"0",
",",
"0",
",",
"0",
"}",... | Controls if the considered point is a source in the network map.
@param flowIterator
{@link RandomIter iterator} of flowdirections map
@param colRow the col and row of the point to check.
@param num
channel number
@param netNum
{@link RandomIter iterator} of the netnumbering map.
@return | [
"Controls",
"if",
"the",
"considered",
"point",
"is",
"a",
"source",
"in",
"the",
"network",
"map",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java#L442-L458 |
fabiomaffioletti/jsondoc | jsondoc-core/src/main/java/org/jsondoc/core/scanner/AbstractJSONDocScanner.java | AbstractJSONDocScanner.getApiDoc | private ApiDoc getApiDoc(Class<?> controller, MethodDisplay displayMethodAs) {
log.debug("Getting JSONDoc for class: " + controller.getName());
ApiDoc apiDoc = initApiDoc(controller);
apiDoc.setSupportedversions(JSONDocApiVersionDocBuilder.build(controller));
apiDoc.setAuth(JSONDocApiAuthDocBuilder.getApiAuthD... | java | private ApiDoc getApiDoc(Class<?> controller, MethodDisplay displayMethodAs) {
log.debug("Getting JSONDoc for class: " + controller.getName());
ApiDoc apiDoc = initApiDoc(controller);
apiDoc.setSupportedversions(JSONDocApiVersionDocBuilder.build(controller));
apiDoc.setAuth(JSONDocApiAuthDocBuilder.getApiAuthD... | [
"private",
"ApiDoc",
"getApiDoc",
"(",
"Class",
"<",
"?",
">",
"controller",
",",
"MethodDisplay",
"displayMethodAs",
")",
"{",
"log",
".",
"debug",
"(",
"\"Getting JSONDoc for class: \"",
"+",
"controller",
".",
"getName",
"(",
")",
")",
";",
"ApiDoc",
"apiDo... | Gets the API documentation for a single class annotated with @Api and for its methods, annotated with @ApiMethod
@param controller
@return | [
"Gets",
"the",
"API",
"documentation",
"for",
"a",
"single",
"class",
"annotated",
"with"
] | train | https://github.com/fabiomaffioletti/jsondoc/blob/26bf413c236e7c3b66f534c2451b157783c1f45e/jsondoc-core/src/main/java/org/jsondoc/core/scanner/AbstractJSONDocScanner.java#L135-L148 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/adt/Try.java | Try.withResources | public static <A extends AutoCloseable, B extends AutoCloseable, C> Try<Exception, C> withResources(
CheckedSupplier<? extends Exception, ? extends A> aSupplier,
CheckedFn1<? extends Exception, ? super A, ? extends B> bFn,
CheckedFn1<? extends Exception, ? super B, ? extends Try<? ex... | java | public static <A extends AutoCloseable, B extends AutoCloseable, C> Try<Exception, C> withResources(
CheckedSupplier<? extends Exception, ? extends A> aSupplier,
CheckedFn1<? extends Exception, ? super A, ? extends B> bFn,
CheckedFn1<? extends Exception, ? super B, ? extends Try<? ex... | [
"public",
"static",
"<",
"A",
"extends",
"AutoCloseable",
",",
"B",
"extends",
"AutoCloseable",
",",
"C",
">",
"Try",
"<",
"Exception",
",",
"C",
">",
"withResources",
"(",
"CheckedSupplier",
"<",
"?",
"extends",
"Exception",
",",
"?",
"extends",
"A",
">",... | Convenience overload of {@link Try#withResources(CheckedSupplier, CheckedFn1) withResources} that cascades
dependent resource creation via nested calls.
@param aSupplier the first resource supplier
@param bFn the dependent resource function
@param fn the function body
@param <A> the first resource t... | [
"Convenience",
"overload",
"of",
"{",
"@link",
"Try#withResources",
"(",
"CheckedSupplier",
"CheckedFn1",
")",
"withResources",
"}",
"that",
"cascades",
"dependent",
"resource",
"creation",
"via",
"nested",
"calls",
"."
] | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/Try.java#L342-L347 |
camunda/camunda-xml-model | src/main/java/org/camunda/bpm/model/xml/impl/util/ModelUtil.java | ModelUtil.setGeneratedUniqueIdentifier | public static void setGeneratedUniqueIdentifier(ModelElementType type, ModelElementInstance modelElementInstance, boolean withReferenceUpdate) {
setNewIdentifier(type, modelElementInstance, ModelUtil.getUniqueIdentifier(type), withReferenceUpdate);
} | java | public static void setGeneratedUniqueIdentifier(ModelElementType type, ModelElementInstance modelElementInstance, boolean withReferenceUpdate) {
setNewIdentifier(type, modelElementInstance, ModelUtil.getUniqueIdentifier(type), withReferenceUpdate);
} | [
"public",
"static",
"void",
"setGeneratedUniqueIdentifier",
"(",
"ModelElementType",
"type",
",",
"ModelElementInstance",
"modelElementInstance",
",",
"boolean",
"withReferenceUpdate",
")",
"{",
"setNewIdentifier",
"(",
"type",
",",
"modelElementInstance",
",",
"ModelUtil",... | Set unique identifier if the type has a String id attribute
@param type the type of the model element
@param modelElementInstance the model element instance to set the id
@param withReferenceUpdate true to update id references in other elements, false otherwise | [
"Set",
"unique",
"identifier",
"if",
"the",
"type",
"has",
"a",
"String",
"id",
"attribute"
] | train | https://github.com/camunda/camunda-xml-model/blob/85b3f879e26d063f71c94cfd21ac17d9ff6baf4d/src/main/java/org/camunda/bpm/model/xml/impl/util/ModelUtil.java#L263-L265 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java | StandardGenerator.getColorProperty | static Color getColorProperty(IChemObject object, String key) {
Object value = object.getProperty(key);
if (value instanceof Color) return (Color) value;
if (value != null) throw new IllegalArgumentException(key + " property should be a java.awt.Color");
return null;
} | java | static Color getColorProperty(IChemObject object, String key) {
Object value = object.getProperty(key);
if (value instanceof Color) return (Color) value;
if (value != null) throw new IllegalArgumentException(key + " property should be a java.awt.Color");
return null;
} | [
"static",
"Color",
"getColorProperty",
"(",
"IChemObject",
"object",
",",
"String",
"key",
")",
"{",
"Object",
"value",
"=",
"object",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"value",
"instanceof",
"Color",
")",
"return",
"(",
"Color",
")",
... | Safely access a chem object color property for a chem object.
@param object chem object
@return the highlight color
@throws java.lang.IllegalArgumentException the highlight property was set but was not a
{@link Color} instance | [
"Safely",
"access",
"a",
"chem",
"object",
"color",
"property",
"for",
"a",
"chem",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java#L635-L640 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java | LibraryCacheManager.registerInternal | private void registerInternal(final JobID id, final Path[] clientPaths) throws IOException {
final String[] cacheNames = new String[clientPaths.length];
for (int i = 0; i < clientPaths.length; ++i) {
final LibraryTranslationKey key = new LibraryTranslationKey(id, clientPaths[i]);
cacheNames[i] = this.client... | java | private void registerInternal(final JobID id, final Path[] clientPaths) throws IOException {
final String[] cacheNames = new String[clientPaths.length];
for (int i = 0; i < clientPaths.length; ++i) {
final LibraryTranslationKey key = new LibraryTranslationKey(id, clientPaths[i]);
cacheNames[i] = this.client... | [
"private",
"void",
"registerInternal",
"(",
"final",
"JobID",
"id",
",",
"final",
"Path",
"[",
"]",
"clientPaths",
")",
"throws",
"IOException",
"{",
"final",
"String",
"[",
"]",
"cacheNames",
"=",
"new",
"String",
"[",
"clientPaths",
".",
"length",
"]",
"... | Registers a job ID with a set of library paths that are required to run the job. The library paths are given in
terms
of client paths, so the method first translates the client paths into the corresponding internal cache names. For
every registered
job the library cache manager creates a class loader that is used to in... | [
"Registers",
"a",
"job",
"ID",
"with",
"a",
"set",
"of",
"library",
"paths",
"that",
"are",
"required",
"to",
"run",
"the",
"job",
".",
"The",
"library",
"paths",
"are",
"given",
"in",
"terms",
"of",
"client",
"paths",
"so",
"the",
"method",
"first",
"... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/execution/librarycache/LibraryCacheManager.java#L246-L260 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/endpoint/resolver/DynamicEndpointUriResolver.java | DynamicEndpointUriResolver.appendRequestPath | private String appendRequestPath(String uri, Map<String, Object> headers) {
if (!headers.containsKey(REQUEST_PATH_HEADER_NAME)) {
return uri;
}
String requestUri = uri;
String path = headers.get(REQUEST_PATH_HEADER_NAME).toString();
while (requestUri.endsWith("/")) ... | java | private String appendRequestPath(String uri, Map<String, Object> headers) {
if (!headers.containsKey(REQUEST_PATH_HEADER_NAME)) {
return uri;
}
String requestUri = uri;
String path = headers.get(REQUEST_PATH_HEADER_NAME).toString();
while (requestUri.endsWith("/")) ... | [
"private",
"String",
"appendRequestPath",
"(",
"String",
"uri",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
")",
"{",
"if",
"(",
"!",
"headers",
".",
"containsKey",
"(",
"REQUEST_PATH_HEADER_NAME",
")",
")",
"{",
"return",
"uri",
";",
"}",
... | Appends optional request path to endpoint uri.
@param uri
@param headers
@return | [
"Appends",
"optional",
"request",
"path",
"to",
"endpoint",
"uri",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/endpoint/resolver/DynamicEndpointUriResolver.java#L76-L93 |
lessthanoptimal/ddogleg | src/org/ddogleg/solver/PolynomialSolver.java | PolynomialSolver.cubicDiscriminant | public static double cubicDiscriminant(double a, double b, double c, double d) {
return 18.0*d*c*b*a -4*c*c*c*a + c*c*b*b -4*d*b*b*b - 27*d*d*a*a;
} | java | public static double cubicDiscriminant(double a, double b, double c, double d) {
return 18.0*d*c*b*a -4*c*c*c*a + c*c*b*b -4*d*b*b*b - 27*d*d*a*a;
} | [
"public",
"static",
"double",
"cubicDiscriminant",
"(",
"double",
"a",
",",
"double",
"b",
",",
"double",
"c",
",",
"double",
"d",
")",
"{",
"return",
"18.0",
"*",
"d",
"*",
"c",
"*",
"b",
"*",
"a",
"-",
"4",
"*",
"c",
"*",
"c",
"*",
"c",
"*",
... | <p>The cubic discriminant is used to determine the type of roots.</p>
<ul>
<li>if d {@code >} 0, then three distinct real roots</li>
<li>if d = 0, then it has a multiple root and all will be real</li>
<li>if d {@code <} 0, then one real and two non-real complex conjugate roots</li>
</ul>
<p>
From http://en.wikipedia.o... | [
"<p",
">",
"The",
"cubic",
"discriminant",
"is",
"used",
"to",
"determine",
"the",
"type",
"of",
"roots",
".",
"<",
"/",
"p",
">",
"<ul",
">",
"<li",
">",
"if",
"d",
"{",
"@code",
">",
"}",
"0",
"then",
"three",
"distinct",
"real",
"roots<",
"/",
... | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/solver/PolynomialSolver.java#L159-L161 |
landawn/AbacusUtil | src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java | PoolablePreparedStatement.setRef | @Override
public void setRef(int parameterIndex, Ref x) throws SQLException {
internalStmt.setRef(parameterIndex, x);
} | java | @Override
public void setRef(int parameterIndex, Ref x) throws SQLException {
internalStmt.setRef(parameterIndex, x);
} | [
"@",
"Override",
"public",
"void",
"setRef",
"(",
"int",
"parameterIndex",
",",
"Ref",
"x",
")",
"throws",
"SQLException",
"{",
"internalStmt",
".",
"setRef",
"(",
"parameterIndex",
",",
"x",
")",
";",
"}"
] | Method setRef.
@param parameterIndex
@param x
@throws SQLException
@see java.sql.PreparedStatement#setRef(int, Ref) | [
"Method",
"setRef",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolablePreparedStatement.java#L939-L942 |
sarxos/v4l4j | src/main/java/au/edu/jcu/v4l4j/ImageFormatList.java | ImageFormatList.getFormat | private ImageFormat getFormat(List<ImageFormat> l, String n){
for(ImageFormat f:l)
if(f.getName().equals(n))
return f;
return null;
} | java | private ImageFormat getFormat(List<ImageFormat> l, String n){
for(ImageFormat f:l)
if(f.getName().equals(n))
return f;
return null;
} | [
"private",
"ImageFormat",
"getFormat",
"(",
"List",
"<",
"ImageFormat",
">",
"l",
",",
"String",
"n",
")",
"{",
"for",
"(",
"ImageFormat",
"f",
":",
"l",
")",
"if",
"(",
"f",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"n",
")",
")",
"return",
... | this method returns a format in a list given its name
@param l the image format list
@param n the name of the format
@return the image format with the given name, or null | [
"this",
"method",
"returns",
"a",
"format",
"in",
"a",
"list",
"given",
"its",
"name"
] | train | https://github.com/sarxos/v4l4j/blob/4fc0eec2c3a1a4260593f6ac03b7a8013e3804c9/src/main/java/au/edu/jcu/v4l4j/ImageFormatList.java#L208-L213 |
scireum/parsii | src/main/java/parsii/tokenizer/Tokenizer.java | Tokenizer.handleStringEscape | protected boolean handleStringEscape(char separator, char escapeChar, Token stringToken) {
if (input.current().is(separator)) {
stringToken.addToContent(separator);
stringToken.addToSource(input.consume());
return true;
} else if (input.current().is(escapeChar)) {
... | java | protected boolean handleStringEscape(char separator, char escapeChar, Token stringToken) {
if (input.current().is(separator)) {
stringToken.addToContent(separator);
stringToken.addToSource(input.consume());
return true;
} else if (input.current().is(escapeChar)) {
... | [
"protected",
"boolean",
"handleStringEscape",
"(",
"char",
"separator",
",",
"char",
"escapeChar",
",",
"Token",
"stringToken",
")",
"{",
"if",
"(",
"input",
".",
"current",
"(",
")",
".",
"is",
"(",
"separator",
")",
")",
"{",
"stringToken",
".",
"addToCo... | Evaluates an string escape like \n
<p>
The escape character is already consumed. Therefore the input points at the character to escape. This method
must consume all escaped characters.
@param separator the delimiter of this string constant
@param escapeChar the escape character used
@param stringToken the resulting... | [
"Evaluates",
"an",
"string",
"escape",
"like",
"\\",
"n",
"<p",
">",
"The",
"escape",
"character",
"is",
"already",
"consumed",
".",
"Therefore",
"the",
"input",
"points",
"at",
"the",
"character",
"to",
"escape",
".",
"This",
"method",
"must",
"consume",
... | train | https://github.com/scireum/parsii/blob/fbf686155b1147b9e07ae21dcd02820b15c79a8c/src/main/java/parsii/tokenizer/Tokenizer.java#L361-L381 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/ReferenceDataUrl.java | ReferenceDataUrl.getBehaviorsUrl | public static MozuUrl getBehaviorsUrl(String responseFields, String userType)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/reference/behaviors?userType={userType}&responseFields={responseFields}");
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("userType", userType);... | java | public static MozuUrl getBehaviorsUrl(String responseFields, String userType)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/reference/behaviors?userType={userType}&responseFields={responseFields}");
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("userType", userType);... | [
"public",
"static",
"MozuUrl",
"getBehaviorsUrl",
"(",
"String",
"responseFields",
",",
"String",
"userType",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/reference/behaviors?userType={userType}&responseFields={responseFields}\"",
")"... | Get Resource Url for GetBehaviors
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@param userType The user typ... | [
"Get",
"Resource",
"Url",
"for",
"GetBehaviors"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/ReferenceDataUrl.java#L88-L94 |
aoindustries/semanticcms-openfile-servlet | src/main/java/com/semanticcms/openfile/servlet/OpenFile.java | OpenFile.isAllowed | public static boolean isAllowed(ServletContext servletContext, ServletRequest request) {
return
Boolean.parseBoolean(servletContext.getInitParameter(ENABLE_INIT_PARAM))
&& isAllowedAddr(request.getRemoteAddr())
;
} | java | public static boolean isAllowed(ServletContext servletContext, ServletRequest request) {
return
Boolean.parseBoolean(servletContext.getInitParameter(ENABLE_INIT_PARAM))
&& isAllowedAddr(request.getRemoteAddr())
;
} | [
"public",
"static",
"boolean",
"isAllowed",
"(",
"ServletContext",
"servletContext",
",",
"ServletRequest",
"request",
")",
"{",
"return",
"Boolean",
".",
"parseBoolean",
"(",
"servletContext",
".",
"getInitParameter",
"(",
"ENABLE_INIT_PARAM",
")",
")",
"&&",
"isAl... | Checks if the given request is allowed to open files on the server.
The servlet init param must have it enabled, as well as be from an allowed IP. | [
"Checks",
"if",
"the",
"given",
"request",
"is",
"allowed",
"to",
"open",
"files",
"on",
"the",
"server",
".",
"The",
"servlet",
"init",
"param",
"must",
"have",
"it",
"enabled",
"as",
"well",
"as",
"be",
"from",
"an",
"allowed",
"IP",
"."
] | train | https://github.com/aoindustries/semanticcms-openfile-servlet/blob/d22b2580b57708311949ac1088e3275355774921/src/main/java/com/semanticcms/openfile/servlet/OpenFile.java#L70-L75 |
contentful/contentful.java | src/main/java/com/contentful/java/cda/rich/RichTextFactory.java | RichTextFactory.resolveRichDocument | private static void resolveRichDocument(CDAEntry entry, CDAField field) {
final Map<String, Object> rawValue = (Map<String, Object>) entry.rawFields().get(field.id());
if (rawValue == null) {
return;
}
for (final String locale : rawValue.keySet()) {
final Object raw = rawValue.get(locale);
... | java | private static void resolveRichDocument(CDAEntry entry, CDAField field) {
final Map<String, Object> rawValue = (Map<String, Object>) entry.rawFields().get(field.id());
if (rawValue == null) {
return;
}
for (final String locale : rawValue.keySet()) {
final Object raw = rawValue.get(locale);
... | [
"private",
"static",
"void",
"resolveRichDocument",
"(",
"CDAEntry",
"entry",
",",
"CDAField",
"field",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"rawValue",
"=",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"entry",
".",
"rawFi... | Resolve all children of the top most document block.
@param entry the entry to contain the field to be walked
@param field the id of the field to be walked. | [
"Resolve",
"all",
"children",
"of",
"the",
"top",
"most",
"document",
"block",
"."
] | train | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/rich/RichTextFactory.java#L285-L301 |
sahan/IckleBot | icklebot/src/main/java/com/lonepulse/icklebot/injector/IllegalContextException.java | IllegalContextException.createMessage | private static final String createMessage(Object illegalContext, Set<Class<?>> applicableContexts) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("The given context ");
stringBuilder.append(illegalContext.getClass().getName());
stringBuilder.append(" is illegal");
if(applic... | java | private static final String createMessage(Object illegalContext, Set<Class<?>> applicableContexts) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("The given context ");
stringBuilder.append(illegalContext.getClass().getName());
stringBuilder.append(" is illegal");
if(applic... | [
"private",
"static",
"final",
"String",
"createMessage",
"(",
"Object",
"illegalContext",
",",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"applicableContexts",
")",
"{",
"StringBuilder",
"stringBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"stringBuilder",... | <p>Creates the message to be used in {@link #IllegalContextException(Object, Set)}.
@since 1.0.0 | [
"<p",
">",
"Creates",
"the",
"message",
"to",
"be",
"used",
"in",
"{",
"@link",
"#IllegalContextException",
"(",
"Object",
"Set",
")",
"}",
"."
] | train | https://github.com/sahan/IckleBot/blob/a19003ceb3ad7c7ee508dc23a8cb31b5676aa499/icklebot/src/main/java/com/lonepulse/icklebot/injector/IllegalContextException.java#L48-L70 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.updateTaskStatus | void updateTaskStatus(Tenant tenant, TaskRecord taskRecord, boolean bDeleteClaimRecord) {
String taskID = taskRecord.getTaskID();
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
Map<String, String> propMap = taskRecord.getProperties();
for (String name : propMap.key... | java | void updateTaskStatus(Tenant tenant, TaskRecord taskRecord, boolean bDeleteClaimRecord) {
String taskID = taskRecord.getTaskID();
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
Map<String, String> propMap = taskRecord.getProperties();
for (String name : propMap.key... | [
"void",
"updateTaskStatus",
"(",
"Tenant",
"tenant",
",",
"TaskRecord",
"taskRecord",
",",
"boolean",
"bDeleteClaimRecord",
")",
"{",
"String",
"taskID",
"=",
"taskRecord",
".",
"getTaskID",
"(",
")",
";",
"DBTransaction",
"dbTran",
"=",
"DBService",
".",
"insta... | Add or update a task status record and optionally delete the task's claim record at
the same time.
@param tenant {@link Tenant} that owns the task's application.
@param taskRecord {@link TaskRecord} containing task properties to be
written to the database. A null/empty property value
causes t... | [
"Add",
"or",
"update",
"a",
"task",
"status",
"record",
"and",
"optionally",
"delete",
"the",
"task",
"s",
"claim",
"record",
"at",
"the",
"same",
"time",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L263-L279 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/JUnit3FloatingPointComparisonWithoutDelta.java | JUnit3FloatingPointComparisonWithoutDelta.isDouble | private boolean isDouble(VisitorState state, Type type) {
Type trueType = unboxedTypeOrType(state, type);
return trueType.getKind() == TypeKind.DOUBLE;
} | java | private boolean isDouble(VisitorState state, Type type) {
Type trueType = unboxedTypeOrType(state, type);
return trueType.getKind() == TypeKind.DOUBLE;
} | [
"private",
"boolean",
"isDouble",
"(",
"VisitorState",
"state",
",",
"Type",
"type",
")",
"{",
"Type",
"trueType",
"=",
"unboxedTypeOrType",
"(",
"state",
",",
"type",
")",
";",
"return",
"trueType",
".",
"getKind",
"(",
")",
"==",
"TypeKind",
".",
"DOUBLE... | Determines if the type is a double, including reference types. | [
"Determines",
"if",
"the",
"type",
"is",
"a",
"double",
"including",
"reference",
"types",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/JUnit3FloatingPointComparisonWithoutDelta.java#L170-L173 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiViewRobust.java | FactoryMultiViewRobust.trifocalRansac | public static Ransac<TrifocalTensor, AssociatedTriple>
trifocalRansac( @Nullable ConfigTrifocal trifocal ,
@Nullable ConfigTrifocalError error,
@Nonnull ConfigRansac ransac ) {
if( trifocal == null )
trifocal = new ConfigTrifocal();
if( error == null )
error = new ConfigTrifocalError();
trifocal... | java | public static Ransac<TrifocalTensor, AssociatedTriple>
trifocalRansac( @Nullable ConfigTrifocal trifocal ,
@Nullable ConfigTrifocalError error,
@Nonnull ConfigRansac ransac ) {
if( trifocal == null )
trifocal = new ConfigTrifocal();
if( error == null )
error = new ConfigTrifocalError();
trifocal... | [
"public",
"static",
"Ransac",
"<",
"TrifocalTensor",
",",
"AssociatedTriple",
">",
"trifocalRansac",
"(",
"@",
"Nullable",
"ConfigTrifocal",
"trifocal",
",",
"@",
"Nullable",
"ConfigTrifocalError",
"error",
",",
"@",
"Nonnull",
"ConfigRansac",
"ransac",
")",
"{",
... | Robust RANSAC based estimator for
@see FactoryMultiView#trifocal_1
@param trifocal Configuration for trifocal tensor calculation
@param error Configuration for how trifocal error is computed
@param ransac Configuration for RANSAC
@return RANSAC | [
"Robust",
"RANSAC",
"based",
"estimator",
"for"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiViewRobust.java#L399-L435 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.createCompositeEntityRoleWithServiceResponseAsync | public Observable<ServiceResponse<UUID>> createCompositeEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, CreateCompositeEntityRoleOptionalParameter createCompositeEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("... | java | public Observable<ServiceResponse<UUID>> createCompositeEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID cEntityId, CreateCompositeEntityRoleOptionalParameter createCompositeEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"UUID",
">",
">",
"createCompositeEntityRoleWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"cEntityId",
",",
"CreateCompositeEntityRoleOptionalParameter",
"createCompositeEntityRol... | Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@param createCompositeEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws Illeg... | [
"Create",
"an",
"entity",
"role",
"for",
"an",
"entity",
"in",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L8920-L8936 |
GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/impl/GoogleCloudStorageReduceInput.java | GoogleCloudStorageReduceInput.createReaderForShard | private MergingReader<K, V> createReaderForShard(
Marshaller<KeyValue<ByteBuffer, ? extends Iterable<V>>> marshaller,
GoogleCloudStorageFileSet reducerInputFileSet) {
ArrayList<PeekingInputReader<KeyValue<ByteBuffer, ? extends Iterable<V>>>> inputFiles =
new ArrayList<>();
GoogleCloudStorage... | java | private MergingReader<K, V> createReaderForShard(
Marshaller<KeyValue<ByteBuffer, ? extends Iterable<V>>> marshaller,
GoogleCloudStorageFileSet reducerInputFileSet) {
ArrayList<PeekingInputReader<KeyValue<ByteBuffer, ? extends Iterable<V>>>> inputFiles =
new ArrayList<>();
GoogleCloudStorage... | [
"private",
"MergingReader",
"<",
"K",
",",
"V",
">",
"createReaderForShard",
"(",
"Marshaller",
"<",
"KeyValue",
"<",
"ByteBuffer",
",",
"?",
"extends",
"Iterable",
"<",
"V",
">",
">",
">",
"marshaller",
",",
"GoogleCloudStorageFileSet",
"reducerInputFileSet",
"... | Create a {@link MergingReader} that combines all the input files the reducer to provide a
global sort over all data for the shard.
(There are multiple input files in the event that the data didn't fit into the sorter's
memory)
A {@link MergingReader} is used to combine contents while maintaining key-order. This requi... | [
"Create",
"a",
"{",
"@link",
"MergingReader",
"}",
"that",
"combines",
"all",
"the",
"input",
"files",
"the",
"reducer",
"to",
"provide",
"a",
"global",
"sort",
"over",
"all",
"data",
"for",
"the",
"shard",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/GoogleCloudStorageReduceInput.java#L71-L82 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/canvas/CanvasRenderer.java | CanvasRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
Canvas canvas = (Canvas) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = canvas.getClientId();
rw.startElement("canvas",... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
Canvas canvas = (Canvas) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = canvas.getClientId();
rw.startElement("canvas",... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"Canvas",
"canvas",
... | This methods generates the HTML code of the current b:canvas.
@param context the FacesContext.
@param component the current b:canvas.
@throws IOException thrown if something goes wrong when writing the HTML code. | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"canvas",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/canvas/CanvasRenderer.java#L42-L79 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java | SecurityUtils.getPrivateKey | public static PrivateKey getPrivateKey(KeyStore keyStore, String alias, String keyPass)
throws GeneralSecurityException {
return (PrivateKey) keyStore.getKey(alias, keyPass.toCharArray());
} | java | public static PrivateKey getPrivateKey(KeyStore keyStore, String alias, String keyPass)
throws GeneralSecurityException {
return (PrivateKey) keyStore.getKey(alias, keyPass.toCharArray());
} | [
"public",
"static",
"PrivateKey",
"getPrivateKey",
"(",
"KeyStore",
"keyStore",
",",
"String",
"alias",
",",
"String",
"keyPass",
")",
"throws",
"GeneralSecurityException",
"{",
"return",
"(",
"PrivateKey",
")",
"keyStore",
".",
"getKey",
"(",
"alias",
",",
"key... | Returns the private key from the key store.
@param keyStore key store
@param alias alias under which the key is stored
@param keyPass password protecting the key
@return private key | [
"Returns",
"the",
"private",
"key",
"from",
"the",
"key",
"store",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java#L92-L95 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.loadBalancing_serviceName_backend_backend_GET | public OvhLoadBalancingBackendIp loadBalancing_serviceName_backend_backend_GET(String serviceName, String backend) throws IOException {
String qPath = "/ip/loadBalancing/{serviceName}/backend/{backend}";
StringBuilder sb = path(qPath, serviceName, backend);
String resp = exec(qPath, "GET", sb.toString(), null);
... | java | public OvhLoadBalancingBackendIp loadBalancing_serviceName_backend_backend_GET(String serviceName, String backend) throws IOException {
String qPath = "/ip/loadBalancing/{serviceName}/backend/{backend}";
StringBuilder sb = path(qPath, serviceName, backend);
String resp = exec(qPath, "GET", sb.toString(), null);
... | [
"public",
"OvhLoadBalancingBackendIp",
"loadBalancing_serviceName_backend_backend_GET",
"(",
"String",
"serviceName",
",",
"String",
"backend",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/loadBalancing/{serviceName}/backend/{backend}\"",
";",
"StringBuilder"... | Get this object properties
REST: GET /ip/loadBalancing/{serviceName}/backend/{backend}
@param serviceName [required] The internal name of your IP load balancing
@param backend [required] IP of your backend | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L1398-L1403 |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/search/SearchBuilderLegacy.java | SearchBuilderLegacy.fromJson | static SearchBuilder fromJson(String json) {
try {
return JsonSerializer.fromString(json, SearchBuilderLegacy.class).builder;
} catch (IOException e) {
throw new IndexException(e, "Unparseable JSON search: {}", json);
}
} | java | static SearchBuilder fromJson(String json) {
try {
return JsonSerializer.fromString(json, SearchBuilderLegacy.class).builder;
} catch (IOException e) {
throw new IndexException(e, "Unparseable JSON search: {}", json);
}
} | [
"static",
"SearchBuilder",
"fromJson",
"(",
"String",
"json",
")",
"{",
"try",
"{",
"return",
"JsonSerializer",
".",
"fromString",
"(",
"json",
",",
"SearchBuilderLegacy",
".",
"class",
")",
".",
"builder",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
... | Returns the {@link SearchBuilder} represented by the specified JSON {@code String}.
@param json the JSON {@code String} representing a {@link SearchBuilder}
@return the {@link SearchBuilder} represented by the specified JSON {@code String} | [
"Returns",
"the",
"{",
"@link",
"SearchBuilder",
"}",
"represented",
"by",
"the",
"specified",
"JSON",
"{",
"@code",
"String",
"}",
"."
] | train | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/search/SearchBuilderLegacy.java#L97-L103 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.resumeAsync | public Observable<Page<SiteInner>> resumeAsync(final String resourceGroupName, final String name) {
return resumeWithServiceResponseAsync(resourceGroupName, name)
.map(new Func1<ServiceResponse<Page<SiteInner>>, Page<SiteInner>>() {
@Override
public Page<SiteInner> ca... | java | public Observable<Page<SiteInner>> resumeAsync(final String resourceGroupName, final String name) {
return resumeWithServiceResponseAsync(resourceGroupName, name)
.map(new Func1<ServiceResponse<Page<SiteInner>>, Page<SiteInner>>() {
@Override
public Page<SiteInner> ca... | [
"public",
"Observable",
"<",
"Page",
"<",
"SiteInner",
">",
">",
"resumeAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"resumeWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"m... | Resume an App Service Environment.
Resume an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<... | [
"Resume",
"an",
"App",
"Service",
"Environment",
".",
"Resume",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L3850-L3858 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.openTagHtmlContent | public static String openTagHtmlContent(String tag, String clazz, String style, String... content) {
return openTag(tag, clazz, style, true, content);
} | java | public static String openTagHtmlContent(String tag, String clazz, String style, String... content) {
return openTag(tag, clazz, style, true, content);
} | [
"public",
"static",
"String",
"openTagHtmlContent",
"(",
"String",
"tag",
",",
"String",
"clazz",
",",
"String",
"style",
",",
"String",
"...",
"content",
")",
"{",
"return",
"openTag",
"(",
"tag",
",",
"clazz",
",",
"style",
",",
"true",
",",
"content",
... | Build a String containing a HTML opening tag with given CSS class and/or
style and concatenates the given HTML content.
@param tag String name of HTML tag
@param clazz CSS class of the tag
@param style style for tag (plain CSS)
@param content content string
@return HTML tag element as string | [
"Build",
"a",
"String",
"containing",
"a",
"HTML",
"opening",
"tag",
"with",
"given",
"CSS",
"class",
"and",
"/",
"or",
"style",
"and",
"concatenates",
"the",
"given",
"HTML",
"content",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L404-L406 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java | SubsystemSuspensionLevels.setLevels | public void setLevels(Map<Integer, Long> levels) {
SystemAssert.requireArgument(levels != null, "Levels cannot be null");
this.levels.clear();
this.levels.putAll(levels);
} | java | public void setLevels(Map<Integer, Long> levels) {
SystemAssert.requireArgument(levels != null, "Levels cannot be null");
this.levels.clear();
this.levels.putAll(levels);
} | [
"public",
"void",
"setLevels",
"(",
"Map",
"<",
"Integer",
",",
"Long",
">",
"levels",
")",
"{",
"SystemAssert",
".",
"requireArgument",
"(",
"levels",
"!=",
"null",
",",
"\"Levels cannot be null\"",
")",
";",
"this",
".",
"levels",
".",
"clear",
"(",
")",... | Sets the suspension time in milliseconds for the corresponding infraction count.
@param levels The map of infraction counts to suspension times. | [
"Sets",
"the",
"suspension",
"time",
"in",
"milliseconds",
"for",
"the",
"corresponding",
"infraction",
"count",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java#L195-L199 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmModelCompleter.java | JvmModelCompleter.replaceVariables | protected String replaceVariables(String commentForGenerated, JvmDeclaredType jvmType) {
String result = commentForGenerated;
if (result.contains(GENERATED_COMMENT_VAR_SOURCE_FILE)) {
Resource resource = jvmType.eResource();
if (resource != null) {
URI uri = resource.getURI();
if (uri != null) {
... | java | protected String replaceVariables(String commentForGenerated, JvmDeclaredType jvmType) {
String result = commentForGenerated;
if (result.contains(GENERATED_COMMENT_VAR_SOURCE_FILE)) {
Resource resource = jvmType.eResource();
if (resource != null) {
URI uri = resource.getURI();
if (uri != null) {
... | [
"protected",
"String",
"replaceVariables",
"(",
"String",
"commentForGenerated",
",",
"JvmDeclaredType",
"jvmType",
")",
"{",
"String",
"result",
"=",
"commentForGenerated",
";",
"if",
"(",
"result",
".",
"contains",
"(",
"GENERATED_COMMENT_VAR_SOURCE_FILE",
")",
")",... | Replace the variables contained in the comment to be written to the <code>@Generated</code> annotation. | [
"Replace",
"the",
"variables",
"contained",
"in",
"the",
"comment",
"to",
"be",
"written",
"to",
"the",
"<code",
">"
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmModelCompleter.java#L275-L290 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/view/DateUtils.java | DateUtils.convertTwoDigitYearToFour | @IntRange(from = 1000, to = 9999)
static int convertTwoDigitYearToFour(@IntRange(from = 0, to = 99) int inputYear) {
return convertTwoDigitYearToFour(inputYear, Calendar.getInstance());
} | java | @IntRange(from = 1000, to = 9999)
static int convertTwoDigitYearToFour(@IntRange(from = 0, to = 99) int inputYear) {
return convertTwoDigitYearToFour(inputYear, Calendar.getInstance());
} | [
"@",
"IntRange",
"(",
"from",
"=",
"1000",
",",
"to",
"=",
"9999",
")",
"static",
"int",
"convertTwoDigitYearToFour",
"(",
"@",
"IntRange",
"(",
"from",
"=",
"0",
",",
"to",
"=",
"99",
")",
"int",
"inputYear",
")",
"{",
"return",
"convertTwoDigitYearToFo... | Converts a two-digit input year to a four-digit year. As the current calendar year
approaches a century, we assume small values to mean the next century. For instance, if
the current year is 2090, and the input value is "18", the user probably means 2118,
not 2018. However, in 2017, the input "18" probably means 2018. ... | [
"Converts",
"a",
"two",
"-",
"digit",
"input",
"year",
"to",
"a",
"four",
"-",
"digit",
"year",
".",
"As",
"the",
"current",
"calendar",
"year",
"approaches",
"a",
"century",
"we",
"assume",
"small",
"values",
"to",
"mean",
"the",
"next",
"century",
".",... | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/DateUtils.java#L143-L146 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueFeatureHandler.java | KeyValueFeatureHandler.helloRequest | private FullBinaryMemcacheRequest helloRequest(int connId) throws Exception {
byte[] key = generateAgentJson(
ctx.environment().userAgent(),
ctx.coreId(),
connId
);
short keyLength = (short) key.length;
ByteBuf wanted = Unpooled.buffer(features.size()... | java | private FullBinaryMemcacheRequest helloRequest(int connId) throws Exception {
byte[] key = generateAgentJson(
ctx.environment().userAgent(),
ctx.coreId(),
connId
);
short keyLength = (short) key.length;
ByteBuf wanted = Unpooled.buffer(features.size()... | [
"private",
"FullBinaryMemcacheRequest",
"helloRequest",
"(",
"int",
"connId",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"key",
"=",
"generateAgentJson",
"(",
"ctx",
".",
"environment",
"(",
")",
".",
"userAgent",
"(",
")",
",",
"ctx",
".",
"coreId",... | Creates the HELLO request to ask for certain supported features.
@param connId the connection id
@return the request to send over the wire | [
"Creates",
"the",
"HELLO",
"request",
"to",
"ask",
"for",
"certain",
"supported",
"features",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueFeatureHandler.java#L130-L149 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/volatilities/AbstractVolatilitySurfaceParametric.java | AbstractVolatilitySurfaceParametric.getCloneCalibrated | public AbstractVolatilitySurfaceParametric getCloneCalibrated(final AnalyticModel calibrationModel, final Vector<AnalyticProduct> calibrationProducts, final List<Double> calibrationTargetValues, Map<String,Object> calibrationParameters, final ParameterTransformation parameterTransformation, OptimizerFactory optimizerFa... | java | public AbstractVolatilitySurfaceParametric getCloneCalibrated(final AnalyticModel calibrationModel, final Vector<AnalyticProduct> calibrationProducts, final List<Double> calibrationTargetValues, Map<String,Object> calibrationParameters, final ParameterTransformation parameterTransformation, OptimizerFactory optimizerFa... | [
"public",
"AbstractVolatilitySurfaceParametric",
"getCloneCalibrated",
"(",
"final",
"AnalyticModel",
"calibrationModel",
",",
"final",
"Vector",
"<",
"AnalyticProduct",
">",
"calibrationProducts",
",",
"final",
"List",
"<",
"Double",
">",
"calibrationTargetValues",
",",
... | Create a clone of this volatility surface using a generic calibration
of its parameters to given market data.
@param calibrationModel The model used during calibration (contains additional objects required during valuation, e.g. curves).
@param calibrationProducts The calibration products.
@param calibrationTargetValu... | [
"Create",
"a",
"clone",
"of",
"this",
"volatility",
"surface",
"using",
"a",
"generic",
"calibration",
"of",
"its",
"parameters",
"to",
"given",
"market",
"data",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/volatilities/AbstractVolatilitySurfaceParametric.java#L81-L110 |
liuyukuai/commons | commons-core/src/main/java/com/itxiaoer/commons/core/beans/ProcessUtils.java | ProcessUtils.processObject | public static <T, R> void processObject(R r, T src) {
processObject(r, src, (r1, src1) -> {
});
} | java | public static <T, R> void processObject(R r, T src) {
processObject(r, src, (r1, src1) -> {
});
} | [
"public",
"static",
"<",
"T",
",",
"R",
">",
"void",
"processObject",
"(",
"R",
"r",
",",
"T",
"src",
")",
"{",
"processObject",
"(",
"r",
",",
"src",
",",
"(",
"r1",
",",
"src1",
")",
"->",
"{",
"}",
")",
";",
"}"
] | 拷贝单个对象
@param r 目标对象
@param src 原对象
@param <T> 原数据类型
@param <R> 目标数据类型 | [
"拷贝单个对象"
] | train | https://github.com/liuyukuai/commons/blob/ba67eddb542446b12f419f1866dbaa82e47fbf35/commons-core/src/main/java/com/itxiaoer/commons/core/beans/ProcessUtils.java#L115-L118 |
elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/LinearScaling.java | LinearScaling.fromMinMax | public static LinearScaling fromMinMax(double min, double max) {
double zoom = 1.0 / (max - min);
return new LinearScaling(zoom, -min * zoom);
} | java | public static LinearScaling fromMinMax(double min, double max) {
double zoom = 1.0 / (max - min);
return new LinearScaling(zoom, -min * zoom);
} | [
"public",
"static",
"LinearScaling",
"fromMinMax",
"(",
"double",
"min",
",",
"double",
"max",
")",
"{",
"double",
"zoom",
"=",
"1.0",
"/",
"(",
"max",
"-",
"min",
")",
";",
"return",
"new",
"LinearScaling",
"(",
"zoom",
",",
"-",
"min",
"*",
"zoom",
... | Make a linear scaling from a given minimum and maximum. The minimum will be
mapped to zero, the maximum to one.
@param min Minimum
@param max Maximum
@return New linear scaling. | [
"Make",
"a",
"linear",
"scaling",
"from",
"a",
"given",
"minimum",
"and",
"maximum",
".",
"The",
"minimum",
"will",
"be",
"mapped",
"to",
"zero",
"the",
"maximum",
"to",
"one",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/LinearScaling.java#L102-L105 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/SequenceFile.java | SequenceFile.createWriter | private static Writer
createWriter(Configuration conf, FSDataOutputStream out,
Class keyClass, Class valClass, boolean compress, boolean blockCompress,
CompressionCodec codec, Metadata metadata)
throws IOException {
if (codec != null && (codec instanceof GzipCodec) &&
... | java | private static Writer
createWriter(Configuration conf, FSDataOutputStream out,
Class keyClass, Class valClass, boolean compress, boolean blockCompress,
CompressionCodec codec, Metadata metadata)
throws IOException {
if (codec != null && (codec instanceof GzipCodec) &&
... | [
"private",
"static",
"Writer",
"createWriter",
"(",
"Configuration",
"conf",
",",
"FSDataOutputStream",
"out",
",",
"Class",
"keyClass",
",",
"Class",
"valClass",
",",
"boolean",
"compress",
",",
"boolean",
"blockCompress",
",",
"CompressionCodec",
"codec",
",",
"... | Construct the preferred type of 'raw' SequenceFile Writer.
@param out The stream on top which the writer is to be constructed.
@param keyClass The 'key' type.
@param valClass The 'value' type.
@param compress Compress data?
@param blockCompress Compress blocks?
@param metadata The metadata of the file.
@return Returns ... | [
"Construct",
"the",
"preferred",
"type",
"of",
"raw",
"SequenceFile",
"Writer",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/SequenceFile.java#L571-L594 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java | CPFriendlyURLEntryPersistenceImpl.countByG_C_U | @Override
public int countByG_C_U(long groupId, long classNameId, String urlTitle) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_C_U;
Object[] finderArgs = new Object[] { groupId, classNameId, urlTitle };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
Stri... | java | @Override
public int countByG_C_U(long groupId, long classNameId, String urlTitle) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_C_U;
Object[] finderArgs = new Object[] { groupId, classNameId, urlTitle };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
Stri... | [
"@",
"Override",
"public",
"int",
"countByG_C_U",
"(",
"long",
"groupId",
",",
"long",
"classNameId",
",",
"String",
"urlTitle",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_G_C_U",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",... | Returns the number of cp friendly url entries where groupId = ? and classNameId = ? and urlTitle = ?.
@param groupId the group ID
@param classNameId the class name ID
@param urlTitle the url title
@return the number of matching cp friendly url entries | [
"Returns",
"the",
"number",
"of",
"cp",
"friendly",
"url",
"entries",
"where",
"groupId",
"=",
"?",
";",
"and",
"classNameId",
"=",
"?",
";",
"and",
"urlTitle",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java#L3191-L3256 |
molgenis/molgenis | molgenis-ontology-core/src/main/java/org/molgenis/ontology/core/importer/repository/OntologyRepositoryCollection.java | OntologyRepositoryCollection.createNodePaths | private void createNodePaths() {
TreeTraverser<OWLClassContainer> traverser =
new TreeTraverser<OWLClassContainer>() {
@Override
public Iterable<OWLClassContainer> children(OWLClassContainer container) {
int count = 0;
List<OWLClassContainer> containers = new Arra... | java | private void createNodePaths() {
TreeTraverser<OWLClassContainer> traverser =
new TreeTraverser<OWLClassContainer>() {
@Override
public Iterable<OWLClassContainer> children(OWLClassContainer container) {
int count = 0;
List<OWLClassContainer> containers = new Arra... | [
"private",
"void",
"createNodePaths",
"(",
")",
"{",
"TreeTraverser",
"<",
"OWLClassContainer",
">",
"traverser",
"=",
"new",
"TreeTraverser",
"<",
"OWLClassContainer",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Iterable",
"<",
"OWLClassContainer",
">",
"ch... | Creates {@link OntologyTermNodePathMetadata} {@link Entity}s for an entire ontology tree and
writes them to the {@link #nodePathsPerOntologyTerm} {@link Multimap}. | [
"Creates",
"{"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-ontology-core/src/main/java/org/molgenis/ontology/core/importer/repository/OntologyRepositoryCollection.java#L166-L194 |
jsurfer/JsonSurfer | jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java | JsonSurfer.collectAll | public Collection<Object> collectAll(InputStream inputStream, String... paths) {
return collectAll(inputStream, compile(paths));
} | java | public Collection<Object> collectAll(InputStream inputStream, String... paths) {
return collectAll(inputStream, compile(paths));
} | [
"public",
"Collection",
"<",
"Object",
">",
"collectAll",
"(",
"InputStream",
"inputStream",
",",
"String",
"...",
"paths",
")",
"{",
"return",
"collectAll",
"(",
"inputStream",
",",
"compile",
"(",
"paths",
")",
")",
";",
"}"
] | Collect all matched value into a collection
@param inputStream Json reader
@param paths JsonPath
@return values | [
"Collect",
"all",
"matched",
"value",
"into",
"a",
"collection"
] | train | https://github.com/jsurfer/JsonSurfer/blob/52bd75a453338b86e115092803da140bf99cee62/jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java#L347-L349 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTextFieldRenderer.java | WTextFieldRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTextField textField = (WTextField) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = textField.isReadOnly();
xml.appendTagOpen("ui:textfield");
xml.appendAttribute("id", compo... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTextField textField = (WTextField) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = textField.isReadOnly();
xml.appendTagOpen("ui:textfield");
xml.appendAttribute("id", compo... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WTextField",
"textField",
"=",
"(",
"WTextField",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"rende... | Paints the given WTextField.
@param component the WTextField to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WTextField",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTextFieldRenderer.java#L25-L73 |
landawn/AbacusUtil | src/com/landawn/abacus/dataSource/PoolableConnection.java | PoolableConnection.prepareStatement | @Override
public PoolablePreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
return new PoolablePreparedStatement(internalConn.prepareStatement(sql, columnIndexes), this, null);
} | java | @Override
public PoolablePreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
return new PoolablePreparedStatement(internalConn.prepareStatement(sql, columnIndexes), this, null);
} | [
"@",
"Override",
"public",
"PoolablePreparedStatement",
"prepareStatement",
"(",
"String",
"sql",
",",
"int",
"[",
"]",
"columnIndexes",
")",
"throws",
"SQLException",
"{",
"return",
"new",
"PoolablePreparedStatement",
"(",
"internalConn",
".",
"prepareStatement",
"("... | Method prepareStatement.
@param sql
@param columnIndexes
@return PreparedStatement
@throws SQLException
@see java.sql.Connection#prepareStatement(String, int[]) | [
"Method",
"prepareStatement",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolableConnection.java#L522-L525 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/PipelineBuilder.java | PipelineBuilder.addUnionExpression | public void addUnionExpression(final INodeReadTrx mTransaction) {
assert getPipeStack().size() >= 2;
final AbsAxis mOperand2 = getPipeStack().pop().getExpr();
final AbsAxis mOperand1 = getPipeStack().pop().getExpr();
if (getPipeStack().empty() || getExpression().getSize() != 0) {
... | java | public void addUnionExpression(final INodeReadTrx mTransaction) {
assert getPipeStack().size() >= 2;
final AbsAxis mOperand2 = getPipeStack().pop().getExpr();
final AbsAxis mOperand1 = getPipeStack().pop().getExpr();
if (getPipeStack().empty() || getExpression().getSize() != 0) {
... | [
"public",
"void",
"addUnionExpression",
"(",
"final",
"INodeReadTrx",
"mTransaction",
")",
"{",
"assert",
"getPipeStack",
"(",
")",
".",
"size",
"(",
")",
">=",
"2",
";",
"final",
"AbsAxis",
"mOperand2",
"=",
"getPipeStack",
"(",
")",
".",
"pop",
"(",
")",... | Adds a union expression to the pipeline.
@param mTransaction
Transaction to operate with. | [
"Adds",
"a",
"union",
"expression",
"to",
"the",
"pipeline",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/PipelineBuilder.java#L401-L412 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxJSONObject.java | BoxJSONObject.addPendingChange | private void addPendingChange(String key, JsonValue value) {
if (this.pendingChanges == null) {
this.pendingChanges = new JsonObject();
}
this.pendingChanges.set(key, value);
} | java | private void addPendingChange(String key, JsonValue value) {
if (this.pendingChanges == null) {
this.pendingChanges = new JsonObject();
}
this.pendingChanges.set(key, value);
} | [
"private",
"void",
"addPendingChange",
"(",
"String",
"key",
",",
"JsonValue",
"value",
")",
"{",
"if",
"(",
"this",
".",
"pendingChanges",
"==",
"null",
")",
"{",
"this",
".",
"pendingChanges",
"=",
"new",
"JsonObject",
"(",
")",
";",
"}",
"this",
".",
... | Adds a pending field change that needs to be sent to the API. It will be included in the JSON string the next
time {@link #getPendingChanges} is called.
@param key the name of the field.
@param value the JsonValue of the field. | [
"Adds",
"a",
"pending",
"field",
"change",
"that",
"needs",
"to",
"be",
"sent",
"to",
"the",
"API",
".",
"It",
"will",
"be",
"included",
"in",
"the",
"JSON",
"string",
"the",
"next",
"time",
"{"
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxJSONObject.java#L169-L175 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/ServiceTaskBase.java | ServiceTaskBase.sendReturnWave | @SuppressWarnings("unchecked")
private void sendReturnWave(final T res) throws CoreException {
Wave returnWave = null;
// Try to retrieve the return Wave type, could be null
final WaveType responseWaveType = this.wave.waveType().returnWaveType();
final Class<? extends Command> res... | java | @SuppressWarnings("unchecked")
private void sendReturnWave(final T res) throws CoreException {
Wave returnWave = null;
// Try to retrieve the return Wave type, could be null
final WaveType responseWaveType = this.wave.waveType().returnWaveType();
final Class<? extends Command> res... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"sendReturnWave",
"(",
"final",
"T",
"res",
")",
"throws",
"CoreException",
"{",
"Wave",
"returnWave",
"=",
"null",
";",
"// Try to retrieve the return Wave type, could be null",
"final",
"WaveType",... | Send a wave that will carry the service result.
2 Kinds of wave can be sent according to service configuration
@param res the service result
@throws CoreException if the wave generation has failed | [
"Send",
"a",
"wave",
"that",
"will",
"carry",
"the",
"service",
"result",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/ServiceTaskBase.java#L239-L297 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/locking/CommonsOJBLockManager.java | CommonsOJBLockManager.mapLockLevelDependendOnIsolationLevel | int mapLockLevelDependendOnIsolationLevel(Integer isolationId, int lockLevel)
{
int result = 0;
switch(isolationId.intValue())
{
case LockManager.IL_READ_UNCOMMITTED:
result = ReadUncommittedLock.mapLockLevel(lockLevel);
break;
... | java | int mapLockLevelDependendOnIsolationLevel(Integer isolationId, int lockLevel)
{
int result = 0;
switch(isolationId.intValue())
{
case LockManager.IL_READ_UNCOMMITTED:
result = ReadUncommittedLock.mapLockLevel(lockLevel);
break;
... | [
"int",
"mapLockLevelDependendOnIsolationLevel",
"(",
"Integer",
"isolationId",
",",
"int",
"lockLevel",
")",
"{",
"int",
"result",
"=",
"0",
";",
"switch",
"(",
"isolationId",
".",
"intValue",
"(",
")",
")",
"{",
"case",
"LockManager",
".",
"IL_READ_UNCOMMITTED"... | Helper method to map the specified common lock level (e.g like
{@link #COMMON_READ_LOCK}, {@link #COMMON_UPGRADE_LOCK, ...}) based
on the isolation level to the internal used lock level value by the
{@link org.apache.commons.transaction.locking.MultiLevelLock2} implementation.
@param isolationId
@param lockLevel
@retu... | [
"Helper",
"method",
"to",
"map",
"the",
"specified",
"common",
"lock",
"level",
"(",
"e",
".",
"g",
"like",
"{",
"@link",
"#COMMON_READ_LOCK",
"}",
"{",
"@link",
"#COMMON_UPGRADE_LOCK",
"...",
"}",
")",
"based",
"on",
"the",
"isolation",
"level",
"to",
"th... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/locking/CommonsOJBLockManager.java#L228-L251 |
jbundle/jbundle | base/db/physical/src/main/java/org/jbundle/base/db/physical/PhysicalDatabase.java | PhysicalDatabase.doMakeTable | public BaseTable doMakeTable(Record record)
{
BaseTable table = null;
boolean bIsQueryRecord = record.isQueryRecord();
if (m_pDatabase == null)
{
try {
this.open();
} catch (DBException ex) {
return null; // No datab... | java | public BaseTable doMakeTable(Record record)
{
BaseTable table = null;
boolean bIsQueryRecord = record.isQueryRecord();
if (m_pDatabase == null)
{
try {
this.open();
} catch (DBException ex) {
return null; // No datab... | [
"public",
"BaseTable",
"doMakeTable",
"(",
"Record",
"record",
")",
"{",
"BaseTable",
"table",
"=",
"null",
";",
"boolean",
"bIsQueryRecord",
"=",
"record",
".",
"isQueryRecord",
"(",
")",
";",
"if",
"(",
"m_pDatabase",
"==",
"null",
")",
"{",
"try",
"{",
... | Make a table for this database.
@param record The record to make a table for.
@return BaseTable The new table. | [
"Make",
"a",
"table",
"for",
"this",
"database",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/physical/src/main/java/org/jbundle/base/db/physical/PhysicalDatabase.java#L143-L163 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java | ODataRendererUtils.getContextURL | public static String getContextURL(ODataUri oDataUri, EntityDataModel entityDataModel, boolean isPrimitive)
throws ODataRenderException {
if (ODataUriUtil.isActionCallUri(oDataUri) ||
ODataUriUtil.isFunctionCallUri(oDataUri)) {
return buildContextUrlFromOperationCall(oDat... | java | public static String getContextURL(ODataUri oDataUri, EntityDataModel entityDataModel, boolean isPrimitive)
throws ODataRenderException {
if (ODataUriUtil.isActionCallUri(oDataUri) ||
ODataUriUtil.isFunctionCallUri(oDataUri)) {
return buildContextUrlFromOperationCall(oDat... | [
"public",
"static",
"String",
"getContextURL",
"(",
"ODataUri",
"oDataUri",
",",
"EntityDataModel",
"entityDataModel",
",",
"boolean",
"isPrimitive",
")",
"throws",
"ODataRenderException",
"{",
"if",
"(",
"ODataUriUtil",
".",
"isActionCallUri",
"(",
"oDataUri",
")",
... | This method returns odata context based on oDataUri.
Throws ODataRenderException in case context is not defined.
@param entityDataModel The entity data model.
@param oDataUri is object which is the root of an abstract syntax tree that describes
@param isPrimitive True if the context URL is for primitive.
@r... | [
"This",
"method",
"returns",
"odata",
"context",
"based",
"on",
"oDataUri",
".",
"Throws",
"ODataRenderException",
"in",
"case",
"context",
"is",
"not",
"defined",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java#L65-L77 |
haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/image/ContentNegotiationFilter.java | ContentNegotiationFilter.adjustQuality | private static void adjustQuality(Map<String, Float> pFormatQuality, String pFormat, float pFactor) {
Float oldValue = pFormatQuality.get(pFormat);
if (oldValue != null) {
pFormatQuality.put(pFormat, oldValue * pFactor);
//System.out.println("New vallue after multiplying with... | java | private static void adjustQuality(Map<String, Float> pFormatQuality, String pFormat, float pFactor) {
Float oldValue = pFormatQuality.get(pFormat);
if (oldValue != null) {
pFormatQuality.put(pFormat, oldValue * pFactor);
//System.out.println("New vallue after multiplying with... | [
"private",
"static",
"void",
"adjustQuality",
"(",
"Map",
"<",
"String",
",",
"Float",
">",
"pFormatQuality",
",",
"String",
"pFormat",
",",
"float",
"pFactor",
")",
"{",
"Float",
"oldValue",
"=",
"pFormatQuality",
".",
"get",
"(",
"pFormat",
")",
";",
"if... | Updates the quality in the map.
@param pFormatQuality Map<String,Float>
@param pFormat the format
@param pFactor the quality factor | [
"Updates",
"the",
"quality",
"in",
"the",
"map",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/image/ContentNegotiationFilter.java#L419-L425 |
VoltDB/voltdb | src/frontend/org/voltcore/messaging/HostMessenger.java | HostMessenger.waitForJoiningHostsToBeReady | public void waitForJoiningHostsToBeReady(int expectedHosts, int localHostId) {
try {
//register this host as joining. The host registration will be deleted after joining is completed.
m_zk.create(ZKUtil.joinZKPath(CoreZK.readyjoininghosts, Integer.toString(localHostId)) , null, Ids.OPEN_... | java | public void waitForJoiningHostsToBeReady(int expectedHosts, int localHostId) {
try {
//register this host as joining. The host registration will be deleted after joining is completed.
m_zk.create(ZKUtil.joinZKPath(CoreZK.readyjoininghosts, Integer.toString(localHostId)) , null, Ids.OPEN_... | [
"public",
"void",
"waitForJoiningHostsToBeReady",
"(",
"int",
"expectedHosts",
",",
"int",
"localHostId",
")",
"{",
"try",
"{",
"//register this host as joining. The host registration will be deleted after joining is completed.",
"m_zk",
".",
"create",
"(",
"ZKUtil",
".",
"jo... | For elastic join. Block on this call until the number of ready hosts is
equal to the number of expected joining hosts. | [
"For",
"elastic",
"join",
".",
"Block",
"on",
"this",
"call",
"until",
"the",
"number",
"of",
"ready",
"hosts",
"is",
"equal",
"to",
"the",
"number",
"of",
"expected",
"joining",
"hosts",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/messaging/HostMessenger.java#L1675-L1690 |
roboconf/roboconf-platform | core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/factory/MessagingClientFactoryRegistry.java | MessagingClientFactoryRegistry.notifyListeners | private void notifyListeners(IMessagingClientFactory factory, boolean isAdded) {
for (MessagingClientFactoryListener listener : this.listeners) {
try {
if (isAdded)
listener.addMessagingClientFactory(factory);
else
listener.removeMessagingClientFactory(factory);
} catch (Throwable t) {
/... | java | private void notifyListeners(IMessagingClientFactory factory, boolean isAdded) {
for (MessagingClientFactoryListener listener : this.listeners) {
try {
if (isAdded)
listener.addMessagingClientFactory(factory);
else
listener.removeMessagingClientFactory(factory);
} catch (Throwable t) {
/... | [
"private",
"void",
"notifyListeners",
"(",
"IMessagingClientFactory",
"factory",
",",
"boolean",
"isAdded",
")",
"{",
"for",
"(",
"MessagingClientFactoryListener",
"listener",
":",
"this",
".",
"listeners",
")",
"{",
"try",
"{",
"if",
"(",
"isAdded",
")",
"liste... | Notifies the messaging client factory listeners that a factory has been added/removed.
@param factory the incoming/outgoing messaging client factory.
@param isAdded flag indicating whether the factory has been added or removed. | [
"Notifies",
"the",
"messaging",
"client",
"factory",
"listeners",
"that",
"a",
"factory",
"has",
"been",
"added",
"/",
"removed",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/factory/MessagingClientFactoryRegistry.java#L137-L152 |
apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/CompileStack.java | CompileStack.defineVariable | public BytecodeVariable defineVariable(Variable v, boolean initFromStack) {
return defineVariable(v, v.getOriginType(), initFromStack);
} | java | public BytecodeVariable defineVariable(Variable v, boolean initFromStack) {
return defineVariable(v, v.getOriginType(), initFromStack);
} | [
"public",
"BytecodeVariable",
"defineVariable",
"(",
"Variable",
"v",
",",
"boolean",
"initFromStack",
")",
"{",
"return",
"defineVariable",
"(",
"v",
",",
"v",
".",
"getOriginType",
"(",
")",
",",
"initFromStack",
")",
";",
"}"
] | Defines a new Variable using an AST variable.
@param initFromStack if true the last element of the
stack will be used to initialize
the new variable. If false null
will be used. | [
"Defines",
"a",
"new",
"Variable",
"using",
"an",
"AST",
"variable",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/CompileStack.java#L662-L664 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/lang/Strings.java | Strings.splitToLong | public static Long[] splitToLong(final String ids) {
if (isEmpty(ids)) {
return new Long[0];
} else {
return transformToLong(split(ids, ','));
}
} | java | public static Long[] splitToLong(final String ids) {
if (isEmpty(ids)) {
return new Long[0];
} else {
return transformToLong(split(ids, ','));
}
} | [
"public",
"static",
"Long",
"[",
"]",
"splitToLong",
"(",
"final",
"String",
"ids",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"ids",
")",
")",
"{",
"return",
"new",
"Long",
"[",
"0",
"]",
";",
"}",
"else",
"{",
"return",
"transformToLong",
"(",
"split",
... | <p>
splitToLong.
</p>
@param ids
a {@link java.lang.String} object.
@return an array of {@link java.lang.Long} objects. | [
"<p",
">",
"splitToLong",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/Strings.java#L954-L960 |
phax/ph-datetime | ph-holiday/src/main/java/com/helger/holiday/parser/AbstractHolidayParser.java | AbstractHolidayParser.moveDate | protected static final LocalDate moveDate (final MoveableHoliday aMoveableHoliday, final LocalDate aFixed)
{
for (final MovingCondition aMoveCond : aMoveableHoliday.getMovingCondition ())
if (shallBeMoved (aFixed, aMoveCond))
return _moveDate (aMoveCond, aFixed);
return aFixed;
} | java | protected static final LocalDate moveDate (final MoveableHoliday aMoveableHoliday, final LocalDate aFixed)
{
for (final MovingCondition aMoveCond : aMoveableHoliday.getMovingCondition ())
if (shallBeMoved (aFixed, aMoveCond))
return _moveDate (aMoveCond, aFixed);
return aFixed;
} | [
"protected",
"static",
"final",
"LocalDate",
"moveDate",
"(",
"final",
"MoveableHoliday",
"aMoveableHoliday",
",",
"final",
"LocalDate",
"aFixed",
")",
"{",
"for",
"(",
"final",
"MovingCondition",
"aMoveCond",
":",
"aMoveableHoliday",
".",
"getMovingCondition",
"(",
... | Moves a date if there are any moving conditions for this holiday and any of
them fit.
@param aMoveableHoliday
Date
@param aFixed
Optional fixed date
@return the moved date | [
"Moves",
"a",
"date",
"if",
"there",
"are",
"any",
"moving",
"conditions",
"for",
"this",
"holiday",
"and",
"any",
"of",
"them",
"fit",
"."
] | train | https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/parser/AbstractHolidayParser.java#L162-L168 |
web3j/web3j | core/src/main/java/org/web3j/ens/EnsResolver.java | EnsResolver.obtainPublicResolver | public PublicResolver obtainPublicResolver(String ensName) {
if (isValidEnsName(ensName)) {
try {
if (!isSynced()) {
throw new EnsResolutionException("Node is not currently synced");
} else {
return lookupResolver(ensName);
... | java | public PublicResolver obtainPublicResolver(String ensName) {
if (isValidEnsName(ensName)) {
try {
if (!isSynced()) {
throw new EnsResolutionException("Node is not currently synced");
} else {
return lookupResolver(ensName);
... | [
"public",
"PublicResolver",
"obtainPublicResolver",
"(",
"String",
"ensName",
")",
"{",
"if",
"(",
"isValidEnsName",
"(",
"ensName",
")",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"isSynced",
"(",
")",
")",
"{",
"throw",
"new",
"EnsResolutionException",
"(",
"... | Provides an access to a valid public resolver in order to access other API methods.
@param ensName our user input ENS name
@return PublicResolver | [
"Provides",
"an",
"access",
"to",
"a",
"valid",
"public",
"resolver",
"in",
"order",
"to",
"access",
"other",
"API",
"methods",
"."
] | train | https://github.com/web3j/web3j/blob/f99ceb19cdd65895c18e0a565034767ca18ea9fc/core/src/main/java/org/web3j/ens/EnsResolver.java#L52-L67 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.getBranch | public Branch getBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches", urlEncode(branchName));
return (response.readEntity(Branch.class));
... | java | public Branch getBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches", urlEncode(branchName));
return (response.readEntity(Branch.class));
... | [
"public",
"Branch",
"getBranch",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"branchName",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"projects\"",
",",
"get... | Get a single project repository branch.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/branches/:branch</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param branchName the name of the branch to get
@return the branch info for the specified p... | [
"Get",
"a",
"single",
"project",
"repository",
"branch",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L104-L108 |
jboss/jboss-el-api_spec | src/main/java/javax/el/ELContext.java | ELContext.notifyPropertyResolved | public void notifyPropertyResolved(Object base, Object property) {
if (getEvaluationListeners() == null)
return;
for (EvaluationListener listener: getEvaluationListeners()) {
listener.propertyResolved(this, base, property);
}
} | java | public void notifyPropertyResolved(Object base, Object property) {
if (getEvaluationListeners() == null)
return;
for (EvaluationListener listener: getEvaluationListeners()) {
listener.propertyResolved(this, base, property);
}
} | [
"public",
"void",
"notifyPropertyResolved",
"(",
"Object",
"base",
",",
"Object",
"property",
")",
"{",
"if",
"(",
"getEvaluationListeners",
"(",
")",
"==",
"null",
")",
"return",
";",
"for",
"(",
"EvaluationListener",
"listener",
":",
"getEvaluationListeners",
... | Notifies the listeners when the (base, property) pair is resolved
@param base The base object
@param property The property Object | [
"Notifies",
"the",
"listeners",
"when",
"the",
"(",
"base",
"property",
")",
"pair",
"is",
"resolved"
] | train | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/ELContext.java#L361-L367 |
sangupta/jerry-services | src/main/java/com/sangupta/jerry/quartz/service/impl/DefaultQuartzServiceImpl.java | DefaultQuartzServiceImpl.executeJob | public boolean executeJob(String jobName, String jobGroupName) {
try {
this.scheduler.triggerJob(new JobKey(jobName, jobGroupName));
return true;
} catch (SchedulerException e) {
logger.error("error executing job: " + jobName + " in group: " + jobGroupName, e);
... | java | public boolean executeJob(String jobName, String jobGroupName) {
try {
this.scheduler.triggerJob(new JobKey(jobName, jobGroupName));
return true;
} catch (SchedulerException e) {
logger.error("error executing job: " + jobName + " in group: " + jobGroupName, e);
... | [
"public",
"boolean",
"executeJob",
"(",
"String",
"jobName",
",",
"String",
"jobGroupName",
")",
"{",
"try",
"{",
"this",
".",
"scheduler",
".",
"triggerJob",
"(",
"new",
"JobKey",
"(",
"jobName",
",",
"jobGroupName",
")",
")",
";",
"return",
"true",
";",
... | Fire the given job in given group.
@param jobName
the name of the job
@param jobGroupName
the group name of the job
@return <code>true</code> if job was fired, <code>false</code> otherwise
@see QuartzService#executeJob(String, String) | [
"Fire",
"the",
"given",
"job",
"in",
"given",
"group",
"."
] | train | https://github.com/sangupta/jerry-services/blob/25ff6577445850916425c72068d654c08eba9bcc/src/main/java/com/sangupta/jerry/quartz/service/impl/DefaultQuartzServiceImpl.java#L197-L205 |
mguymon/naether | src/main/java/com/tobedevoured/naether/maven/Project.java | Project.loadPOM | public static Model loadPOM(String pomPath, String localRepo, Collection<RemoteRepository> repositories) throws ProjectException {
RepositoryClient repoClient = new RepositoryClient(localRepo);
NaetherModelResolver resolver = new NaetherModelResolver(repoClient, repositories);
ModelBuildingRequ... | java | public static Model loadPOM(String pomPath, String localRepo, Collection<RemoteRepository> repositories) throws ProjectException {
RepositoryClient repoClient = new RepositoryClient(localRepo);
NaetherModelResolver resolver = new NaetherModelResolver(repoClient, repositories);
ModelBuildingRequ... | [
"public",
"static",
"Model",
"loadPOM",
"(",
"String",
"pomPath",
",",
"String",
"localRepo",
",",
"Collection",
"<",
"RemoteRepository",
">",
"repositories",
")",
"throws",
"ProjectException",
"{",
"RepositoryClient",
"repoClient",
"=",
"new",
"RepositoryClient",
"... | Load Maven pom
@param pomPath String path
@param localRepo String
@param repositories {@link Collection}
@return {@link Model}
@throws ProjectException if fails to open, read, or parse the POM | [
"Load",
"Maven",
"pom"
] | train | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/maven/Project.java#L132-L148 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/Projection.java | Projection.rotateAndScalePoint | public Point rotateAndScalePoint(int x, int y, Point reuse) {
return applyMatrixToPoint(x, y, reuse, mRotateAndScaleMatrix, mOrientation != 0);
} | java | public Point rotateAndScalePoint(int x, int y, Point reuse) {
return applyMatrixToPoint(x, y, reuse, mRotateAndScaleMatrix, mOrientation != 0);
} | [
"public",
"Point",
"rotateAndScalePoint",
"(",
"int",
"x",
",",
"int",
"y",
",",
"Point",
"reuse",
")",
"{",
"return",
"applyMatrixToPoint",
"(",
"x",
",",
"y",
",",
"reuse",
",",
"mRotateAndScaleMatrix",
",",
"mOrientation",
"!=",
"0",
")",
";",
"}"
] | This will apply the current map's scaling and rotation for a point. This can be useful when
converting MotionEvents to a screen point. | [
"This",
"will",
"apply",
"the",
"current",
"map",
"s",
"scaling",
"and",
"rotation",
"for",
"a",
"point",
".",
"This",
"can",
"be",
"useful",
"when",
"converting",
"MotionEvents",
"to",
"a",
"screen",
"point",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L374-L376 |
yannrichet/rsession | src/main/java/org/math/R/RserverConf.java | RserverConf.newLocalInstance | public static RserverConf newLocalInstance(Properties p) {
RserverConf server = null;
if (RserveDaemon.isWindows() || !UNIX_OPTIMIZE) {
while (!isPortAvailable(RserverPort)) {
RserverPort++;
}
server = new RserverConf(null, RserverPort, null, null, p);... | java | public static RserverConf newLocalInstance(Properties p) {
RserverConf server = null;
if (RserveDaemon.isWindows() || !UNIX_OPTIMIZE) {
while (!isPortAvailable(RserverPort)) {
RserverPort++;
}
server = new RserverConf(null, RserverPort, null, null, p);... | [
"public",
"static",
"RserverConf",
"newLocalInstance",
"(",
"Properties",
"p",
")",
"{",
"RserverConf",
"server",
"=",
"null",
";",
"if",
"(",
"RserveDaemon",
".",
"isWindows",
"(",
")",
"||",
"!",
"UNIX_OPTIMIZE",
")",
"{",
"while",
"(",
"!",
"isPortAvailab... | if we want to re-use older sessions. May wrongly fil if older session is already stucked... | [
"if",
"we",
"want",
"to",
"re",
"-",
"use",
"older",
"sessions",
".",
"May",
"wrongly",
"fil",
"if",
"older",
"session",
"is",
"already",
"stucked",
"..."
] | train | https://github.com/yannrichet/rsession/blob/acaa47f4da1644e0d067634130c0e88e38cb9035/src/main/java/org/math/R/RserverConf.java#L216-L227 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.deleteProjectBadge | public void deleteProjectBadge(Serializable projectId, Integer badgeId) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabBadge.URL
+ "/" + badgeId;
retrieve().method(DELETE).to(tailUrl, Void.class);
} | java | public void deleteProjectBadge(Serializable projectId, Integer badgeId) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabBadge.URL
+ "/" + badgeId;
retrieve().method(DELETE).to(tailUrl, Void.class);
} | [
"public",
"void",
"deleteProjectBadge",
"(",
"Serializable",
"projectId",
",",
"Integer",
"badgeId",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabProject",
".",
"URL",
"+",
"\"/\"",
"+",
"sanitizeProjectId",
"(",
"projectId",
")",
"+",
"Gi... | Delete project badge
@param projectId The id of the project for which the badge should be deleted
@param badgeId The id of the badge that should be deleted
@throws IOException on GitLab API call error | [
"Delete",
"project",
"badge"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L2667-L2671 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java | IndexChangeAdapters.forPrimaryType | public static IndexChangeAdapter forPrimaryType( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
ProvidedIndex<?> index ) {
re... | java | public static IndexChangeAdapter forPrimaryType( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
ProvidedIndex<?> index ) {
re... | [
"public",
"static",
"IndexChangeAdapter",
"forPrimaryType",
"(",
"ExecutionContext",
"context",
",",
"NodeTypePredicate",
"matcher",
",",
"String",
"workspaceName",
",",
"ProvidedIndex",
"<",
"?",
">",
"index",
")",
"{",
"return",
"new",
"PrimaryTypeChangeAdapter",
"(... | Create an {@link IndexChangeAdapter} implementation that handles the "jcr:primaryType" property.
@param context the execution context; may not be null
@param matcher the node type matcher used to determine which nodes should be included in the index; may not be null
@param workspaceName the name of the workspace; may ... | [
"Create",
"an",
"{",
"@link",
"IndexChangeAdapter",
"}",
"implementation",
"that",
"handles",
"the",
"jcr",
":",
"primaryType",
"property",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java#L144-L149 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java | ReviewsImpl.createVideoReviews | public List<String> createVideoReviews(String teamName, String contentType, List<CreateVideoReviewsBodyItem> createVideoReviewsBody, CreateVideoReviewsOptionalParameter createVideoReviewsOptionalParameter) {
return createVideoReviewsWithServiceResponseAsync(teamName, contentType, createVideoReviewsBody, createV... | java | public List<String> createVideoReviews(String teamName, String contentType, List<CreateVideoReviewsBodyItem> createVideoReviewsBody, CreateVideoReviewsOptionalParameter createVideoReviewsOptionalParameter) {
return createVideoReviewsWithServiceResponseAsync(teamName, contentType, createVideoReviewsBody, createV... | [
"public",
"List",
"<",
"String",
">",
"createVideoReviews",
"(",
"String",
"teamName",
",",
"String",
"contentType",
",",
"List",
"<",
"CreateVideoReviewsBodyItem",
">",
"createVideoReviewsBody",
",",
"CreateVideoReviewsOptionalParameter",
"createVideoReviewsOptionalParameter... | The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.
<h3>CallBack Schemas </h3>
<h4>Review Completion CallBack Sample</h4>
<p>
{<br/>
"ReviewId": "<R... | [
"The",
"reviews",
"created",
"would",
"show",
"up",
"for",
"Reviewers",
"on",
"your",
"team",
".",
"As",
"Reviewers",
"complete",
"reviewing",
"results",
"of",
"the",
"Review",
"would",
"be",
"POSTED",
"(",
"i",
".",
"e",
".",
"HTTP",
"POST",
")",
"on",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java#L1908-L1910 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java | DateFunctions.dateDiffStr | public static Expression dateDiffStr(Expression expression1, Expression expression2, DatePart part) {
return x("DATE_DIFF_STR(" + expression1.toString() + ", " + expression2.toString()
+ ", \"" + part.toString() + "\")");
} | java | public static Expression dateDiffStr(Expression expression1, Expression expression2, DatePart part) {
return x("DATE_DIFF_STR(" + expression1.toString() + ", " + expression2.toString()
+ ", \"" + part.toString() + "\")");
} | [
"public",
"static",
"Expression",
"dateDiffStr",
"(",
"Expression",
"expression1",
",",
"Expression",
"expression2",
",",
"DatePart",
"part",
")",
"{",
"return",
"x",
"(",
"\"DATE_DIFF_STR(\"",
"+",
"expression1",
".",
"toString",
"(",
")",
"+",
"\", \"",
"+",
... | Returned expression results in Performs Date arithmetic.
Returns the elapsed time between two date strings in a supported format, as an integer whose unit is part. | [
"Returned",
"expression",
"results",
"in",
"Performs",
"Date",
"arithmetic",
".",
"Returns",
"the",
"elapsed",
"time",
"between",
"two",
"date",
"strings",
"in",
"a",
"supported",
"format",
"as",
"an",
"integer",
"whose",
"unit",
"is",
"part",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java#L123-L126 |
playn/playn | html/src/playn/html/HtmlGraphics.java | HtmlGraphics.setSize | public void setSize (int width, int height) {
rootElement.getStyle().setWidth(width, Unit.PX);
rootElement.getStyle().setHeight(height, Unit.PX);
// the frame buffer may be larger (or smaller) than the logical size, depending on whether
// we're on a HiDPI display, or how the game has configured things ... | java | public void setSize (int width, int height) {
rootElement.getStyle().setWidth(width, Unit.PX);
rootElement.getStyle().setHeight(height, Unit.PX);
// the frame buffer may be larger (or smaller) than the logical size, depending on whether
// we're on a HiDPI display, or how the game has configured things ... | [
"public",
"void",
"setSize",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"rootElement",
".",
"getStyle",
"(",
")",
".",
"setWidth",
"(",
"width",
",",
"Unit",
".",
"PX",
")",
";",
"rootElement",
".",
"getStyle",
"(",
")",
".",
"setHeight",
"... | Sizes or resizes the root element that contains the game view. This is specified in pixels as
understood by page elements. If the page is actually being dispalyed on a HiDPI (Retina)
device, the actual framebuffer may be 2x (or larger) the specified size. | [
"Sizes",
"or",
"resizes",
"the",
"root",
"element",
"that",
"contains",
"the",
"game",
"view",
".",
"This",
"is",
"specified",
"in",
"pixels",
"as",
"understood",
"by",
"page",
"elements",
".",
"If",
"the",
"page",
"is",
"actually",
"being",
"dispalyed",
"... | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/html/src/playn/html/HtmlGraphics.java#L145-L158 |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.getMultiTilePolygon | public static Polygon getMultiTilePolygon (MisoSceneMetrics metrics,
Point sp1, Point sp2)
{
int x = Math.min(sp1.x, sp2.x), y = Math.min(sp1.y, sp2.y);
int width = Math.abs(sp1.x-sp2.x)+1, height = Math.abs(sp1.y-sp2.y)+1;
return getFootprintPo... | java | public static Polygon getMultiTilePolygon (MisoSceneMetrics metrics,
Point sp1, Point sp2)
{
int x = Math.min(sp1.x, sp2.x), y = Math.min(sp1.y, sp2.y);
int width = Math.abs(sp1.x-sp2.x)+1, height = Math.abs(sp1.y-sp2.y)+1;
return getFootprintPo... | [
"public",
"static",
"Polygon",
"getMultiTilePolygon",
"(",
"MisoSceneMetrics",
"metrics",
",",
"Point",
"sp1",
",",
"Point",
"sp2",
")",
"{",
"int",
"x",
"=",
"Math",
".",
"min",
"(",
"sp1",
".",
"x",
",",
"sp2",
".",
"x",
")",
",",
"y",
"=",
"Math",... | Return a screen-coordinates polygon framing the two specified
tile-coordinate points. | [
"Return",
"a",
"screen",
"-",
"coordinates",
"polygon",
"framing",
"the",
"two",
"specified",
"tile",
"-",
"coordinate",
"points",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L417-L423 |
lucee/Lucee | core/src/main/java/lucee/runtime/converter/JSONConverter.java | JSONConverter._serializeDateTime | private void _serializeDateTime(DateTime dateTime, StringBuilder sb) {
sb.append(StringUtil.escapeJS(JSONDateFormat.format(dateTime, null), '"', charsetEncoder));
/*
* try { sb.append(goIn()); sb.append("createDateTime(");
* sb.append(DateFormat.call(null,dateTime,"yyyy,m,d")); sb.append(' ');
* sb.append(Tim... | java | private void _serializeDateTime(DateTime dateTime, StringBuilder sb) {
sb.append(StringUtil.escapeJS(JSONDateFormat.format(dateTime, null), '"', charsetEncoder));
/*
* try { sb.append(goIn()); sb.append("createDateTime(");
* sb.append(DateFormat.call(null,dateTime,"yyyy,m,d")); sb.append(' ');
* sb.append(Tim... | [
"private",
"void",
"_serializeDateTime",
"(",
"DateTime",
"dateTime",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"StringUtil",
".",
"escapeJS",
"(",
"JSONDateFormat",
".",
"format",
"(",
"dateTime",
",",
"null",
")",
",",
"'",
"'",
","... | serialize a DateTime
@param dateTime DateTime to serialize
@param sb
@throws ConverterException | [
"serialize",
"a",
"DateTime"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/JSONConverter.java#L179-L190 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java | BridgeMethodResolver.searchForMatch | private static Method searchForMatch(Class<?> type, Method bridgeMethod) {
return ReflectionUtils.findMethod(type, bridgeMethod.getName(), bridgeMethod.getParameterTypes());
} | java | private static Method searchForMatch(Class<?> type, Method bridgeMethod) {
return ReflectionUtils.findMethod(type, bridgeMethod.getName(), bridgeMethod.getParameterTypes());
} | [
"private",
"static",
"Method",
"searchForMatch",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Method",
"bridgeMethod",
")",
"{",
"return",
"ReflectionUtils",
".",
"findMethod",
"(",
"type",
",",
"bridgeMethod",
".",
"getName",
"(",
")",
",",
"bridgeMethod",
".... | If the supplied {@link Class} has a declared {@link Method} whose signature matches
that of the supplied {@link Method}, then this matching {@link Method} is returned,
otherwise {@code null} is returned. | [
"If",
"the",
"supplied",
"{"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java#L198-L200 |
alkacon/opencms-core | src/org/opencms/i18n/CmsEncoder.java | CmsEncoder.lookupEncoding | public static String lookupEncoding(String encoding, String fallback) {
String result = m_encodingCache.get(encoding);
if (result != null) {
return result;
}
try {
result = Charset.forName(encoding).name();
m_encodingCache.put(encoding, result);
... | java | public static String lookupEncoding(String encoding, String fallback) {
String result = m_encodingCache.get(encoding);
if (result != null) {
return result;
}
try {
result = Charset.forName(encoding).name();
m_encodingCache.put(encoding, result);
... | [
"public",
"static",
"String",
"lookupEncoding",
"(",
"String",
"encoding",
",",
"String",
"fallback",
")",
"{",
"String",
"result",
"=",
"m_encodingCache",
".",
"get",
"(",
"encoding",
")",
";",
"if",
"(",
"result",
"!=",
"null",
")",
"{",
"return",
"resul... | Checks if a given encoding name is actually supported, and if so
resolves it to it's canonical name, if not it returns the given fallback
value.<p>
Charsets have a set of aliases. For example, valid aliases for "UTF-8"
are "UTF8", "utf-8" or "utf8". This method resolves any given valid charset name
to it's "canonical"... | [
"Checks",
"if",
"a",
"given",
"encoding",
"name",
"is",
"actually",
"supported",
"and",
"if",
"so",
"resolves",
"it",
"to",
"it",
"s",
"canonical",
"name",
"if",
"not",
"it",
"returns",
"the",
"given",
"fallback",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsEncoder.java#L821-L837 |
geomajas/geomajas-project-client-gwt2 | common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/Dom.java | Dom.createElement | public static Element createElement(String tagName, String id) {
return IMPL.createElement(tagName, id);
} | java | public static Element createElement(String tagName, String id) {
return IMPL.createElement(tagName, id);
} | [
"public",
"static",
"Element",
"createElement",
"(",
"String",
"tagName",
",",
"String",
"id",
")",
"{",
"return",
"IMPL",
".",
"createElement",
"(",
"tagName",
",",
"id",
")",
";",
"}"
] | Creates an HTML element with the given id.
@param tagName the HTML tag of the element to be created
@return the newly-created element | [
"Creates",
"an",
"HTML",
"element",
"with",
"the",
"given",
"id",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/Dom.java#L126-L128 |
jeremiehuchet/nominatim-java-api | src/main/java/fr/dudie/nominatim/client/request/NominatimSearchRequest.java | NominatimSearchRequest.setViewBox | public void setViewBox(final int westE6, final int northE6, final int eastE6, final int southE6) {
this.viewBox = new BoundingBox();
this.viewBox.setWestE6(westE6);
this.viewBox.setNorthE6(northE6);
this.viewBox.setEastE6(eastE6);
this.viewBox.setSouthE6(southE6);
} | java | public void setViewBox(final int westE6, final int northE6, final int eastE6, final int southE6) {
this.viewBox = new BoundingBox();
this.viewBox.setWestE6(westE6);
this.viewBox.setNorthE6(northE6);
this.viewBox.setEastE6(eastE6);
this.viewBox.setSouthE6(southE6);
} | [
"public",
"void",
"setViewBox",
"(",
"final",
"int",
"westE6",
",",
"final",
"int",
"northE6",
",",
"final",
"int",
"eastE6",
",",
"final",
"int",
"southE6",
")",
"{",
"this",
".",
"viewBox",
"=",
"new",
"BoundingBox",
"(",
")",
";",
"this",
".",
"view... | Sets the preferred area to find search results;
@param westE6
the west bound
@param northE6
the north bound
@param eastE6
the east bound
@param southE6
the south bound | [
"Sets",
"the",
"preferred",
"area",
"to",
"find",
"search",
"results",
";"
] | train | https://github.com/jeremiehuchet/nominatim-java-api/blob/faf3ff1003a9989eb5cc48f449b3a22c567843bf/src/main/java/fr/dudie/nominatim/client/request/NominatimSearchRequest.java#L235-L241 |
mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Main.java | Main.mainEmbedded | public static Main mainEmbedded(ContextFactory factory,
ScopeProvider scopeProvider,
String title) {
return mainEmbeddedImpl(factory, scopeProvider, title);
} | java | public static Main mainEmbedded(ContextFactory factory,
ScopeProvider scopeProvider,
String title) {
return mainEmbeddedImpl(factory, scopeProvider, title);
} | [
"public",
"static",
"Main",
"mainEmbedded",
"(",
"ContextFactory",
"factory",
",",
"ScopeProvider",
"scopeProvider",
",",
"String",
"title",
")",
"{",
"return",
"mainEmbeddedImpl",
"(",
"factory",
",",
"scopeProvider",
",",
"title",
")",
";",
"}"
] | Entry point for embedded applications. This method attaches
to the given {@link ContextFactory} with the given scope. No
I/O redirection is performed as with {@link #main(String[])}. | [
"Entry",
"point",
"for",
"embedded",
"applications",
".",
"This",
"method",
"attaches",
"to",
"the",
"given",
"{"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Main.java#L262-L266 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java | ProxyDataSourceBuilder.logSlowQueryByJUL | public ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit, String loggerName) {
return logSlowQueryByJUL(thresholdTime, timeUnit, null, loggerName);
} | java | public ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit, String loggerName) {
return logSlowQueryByJUL(thresholdTime, timeUnit, null, loggerName);
} | [
"public",
"ProxyDataSourceBuilder",
"logSlowQueryByJUL",
"(",
"long",
"thresholdTime",
",",
"TimeUnit",
"timeUnit",
",",
"String",
"loggerName",
")",
"{",
"return",
"logSlowQueryByJUL",
"(",
"thresholdTime",
",",
"timeUnit",
",",
"null",
",",
"loggerName",
")",
";",... | Register {@link JULSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@param loggerName JUL logger name
@return builder
@since 1.4.1 | [
"Register",
"{",
"@link",
"JULSlowQueryListener",
"}",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java#L465-L467 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java | DateTimePatternGenerator.getCanonicalChar | private static char getCanonicalChar(int field, char reference) {
// Special case: distinguish between 12-hour and 24-hour
if (reference == 'h' || reference == 'K') {
return 'h';
}
// Linear search over types (return the top entry for each field)
for (int i = 0; i < ... | java | private static char getCanonicalChar(int field, char reference) {
// Special case: distinguish between 12-hour and 24-hour
if (reference == 'h' || reference == 'K') {
return 'h';
}
// Linear search over types (return the top entry for each field)
for (int i = 0; i < ... | [
"private",
"static",
"char",
"getCanonicalChar",
"(",
"int",
"field",
",",
"char",
"reference",
")",
"{",
"// Special case: distinguish between 12-hour and 24-hour",
"if",
"(",
"reference",
"==",
"'",
"'",
"||",
"reference",
"==",
"'",
"'",
")",
"{",
"return",
"... | Gets the canonical character associated with the specified field (ERA, YEAR, etc). | [
"Gets",
"the",
"canonical",
"character",
"associated",
"with",
"the",
"specified",
"field",
"(",
"ERA",
"YEAR",
"etc",
")",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java#L2112-L2126 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java | DwgUtil.getDefaultDouble | public static Vector getDefaultDouble(int[] data, int offset, double defVal) throws Exception {
int flags = ((Integer)getBits(data, 2, offset)).intValue();
int read = 2;
double val;
if (flags==0x0) {
val = defVal;
} else {
int _offset = offset + 2;
String dstr;
if (flags... | java | public static Vector getDefaultDouble(int[] data, int offset, double defVal) throws Exception {
int flags = ((Integer)getBits(data, 2, offset)).intValue();
int read = 2;
double val;
if (flags==0x0) {
val = defVal;
} else {
int _offset = offset + 2;
String dstr;
if (flags... | [
"public",
"static",
"Vector",
"getDefaultDouble",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"double",
"defVal",
")",
"throws",
"Exception",
"{",
"int",
"flags",
"=",
"(",
"(",
"Integer",
")",
"getBits",
"(",
"data",
",",
"2",
",",
"offse... | Read a double value from a group of unsigned bytes and a default double
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@param defVal Default double value
@throws Exception If an unexpected bit value is found in the DWG file. Occurs
when... | [
"Read",
"a",
"double",
"value",
"from",
"a",
"group",
"of",
"unsigned",
"bytes",
"and",
"a",
"default",
"double"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java#L177-L239 |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraphException.java | ClassGraphException.newClassGraphException | public static ClassGraphException newClassGraphException(final String message, final Throwable cause)
throws ClassGraphException {
return new ClassGraphException(message, cause);
} | java | public static ClassGraphException newClassGraphException(final String message, final Throwable cause)
throws ClassGraphException {
return new ClassGraphException(message, cause);
} | [
"public",
"static",
"ClassGraphException",
"newClassGraphException",
"(",
"final",
"String",
"message",
",",
"final",
"Throwable",
"cause",
")",
"throws",
"ClassGraphException",
"{",
"return",
"new",
"ClassGraphException",
"(",
"message",
",",
"cause",
")",
";",
"}"... | Static factory method to stop IDEs from auto-completing ClassGraphException after "new ClassGraph".
@param message
the message
@param cause
the cause
@return the ClassGraphException
@throws ClassGraphException
the class graph exception | [
"Static",
"factory",
"method",
"to",
"stop",
"IDEs",
"from",
"auto",
"-",
"completing",
"ClassGraphException",
"after",
"new",
"ClassGraph",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraphException.java#L87-L90 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/StringUtils.java | StringUtils.printToFileLn | public static void printToFileLn(String filename, String message, boolean append) {
printToFileLn(new File(filename), message, append);
} | java | public static void printToFileLn(String filename, String message, boolean append) {
printToFileLn(new File(filename), message, append);
} | [
"public",
"static",
"void",
"printToFileLn",
"(",
"String",
"filename",
",",
"String",
"message",
",",
"boolean",
"append",
")",
"{",
"printToFileLn",
"(",
"new",
"File",
"(",
"filename",
")",
",",
"message",
",",
"append",
")",
";",
"}"
] | Prints to a file. If the file already exists, appends if
<code>append=true</code>, and overwrites if <code>append=false</code> | [
"Prints",
"to",
"a",
"file",
".",
"If",
"the",
"file",
"already",
"exists",
"appends",
"if",
"<code",
">",
"append",
"=",
"true<",
"/",
"code",
">",
"and",
"overwrites",
"if",
"<code",
">",
"append",
"=",
"false<",
"/",
"code",
">"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L968-L970 |
bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java | LocationUtil.getStashLocation | public static StashLocation getStashLocation(URI location) {
checkArgument(getLocationType(location) == LocationType.STASH, "Not a stash location");
String host, path;
boolean useLatestDirectory;
Matcher matcher = getLocatorMatcher(location);
if (matcher.matches()) {
... | java | public static StashLocation getStashLocation(URI location) {
checkArgument(getLocationType(location) == LocationType.STASH, "Not a stash location");
String host, path;
boolean useLatestDirectory;
Matcher matcher = getLocatorMatcher(location);
if (matcher.matches()) {
... | [
"public",
"static",
"StashLocation",
"getStashLocation",
"(",
"URI",
"location",
")",
"{",
"checkArgument",
"(",
"getLocationType",
"(",
"location",
")",
"==",
"LocationType",
".",
"STASH",
",",
"\"Not a stash location\"",
")",
";",
"String",
"host",
",",
"path",
... | Returns location information for a given location of type {@link LocationType#STASH}. | [
"Returns",
"location",
"information",
"for",
"a",
"given",
"location",
"of",
"type",
"{"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java#L317-L350 |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/Generator.java | Generator.generatePassphrase | public static String generatePassphrase(final String delimiter, final int words, final Dictionary dictionary)
{
String result = "";
final SecureRandom rnd = new SecureRandom();
final int high = dictionary.getSortedDictionary().size();
for (int i = 1; i <= words; i++)
{
... | java | public static String generatePassphrase(final String delimiter, final int words, final Dictionary dictionary)
{
String result = "";
final SecureRandom rnd = new SecureRandom();
final int high = dictionary.getSortedDictionary().size();
for (int i = 1; i <= words; i++)
{
... | [
"public",
"static",
"String",
"generatePassphrase",
"(",
"final",
"String",
"delimiter",
",",
"final",
"int",
"words",
",",
"final",
"Dictionary",
"dictionary",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"final",
"SecureRandom",
"rnd",
"=",
"new",
"Secure... | Generates a passphrase from the supplied dictionary with the requested word count.
@param delimiter delimiter to place between words
@param words the count of words you want in your passphrase
@param dictionary the dictionary to use for generating this passphrase
@return the passphrase | [
"Generates",
"a",
"passphrase",
"from",
"the",
"supplied",
"dictionary",
"with",
"the",
"requested",
"word",
"count",
"."
] | train | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/Generator.java#L32-L46 |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java | DatatypeConverter.getInt | public static final int getInt(InputStream is) throws IOException
{
byte[] data = new byte[4];
is.read(data);
return getInt(data, 0);
} | java | public static final int getInt(InputStream is) throws IOException
{
byte[] data = new byte[4];
is.read(data);
return getInt(data, 0);
} | [
"public",
"static",
"final",
"int",
"getInt",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"data",
"=",
"new",
"byte",
"[",
"4",
"]",
";",
"is",
".",
"read",
"(",
"data",
")",
";",
"return",
"getInt",
"(",
"data",
... | Read an int from an input stream.
@param is input stream
@return int value | [
"Read",
"an",
"int",
"from",
"an",
"input",
"stream",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L132-L137 |
biezhi/anima | src/main/java/io/github/biezhi/anima/Anima.java | Anima.deleteBatch | public static <T extends Model, S extends Serializable> void deleteBatch(Class<T> model, List<S> idList) {
deleteBatch(model, AnimaUtils.toArray(idList));
} | java | public static <T extends Model, S extends Serializable> void deleteBatch(Class<T> model, List<S> idList) {
deleteBatch(model, AnimaUtils.toArray(idList));
} | [
"public",
"static",
"<",
"T",
"extends",
"Model",
",",
"S",
"extends",
"Serializable",
">",
"void",
"deleteBatch",
"(",
"Class",
"<",
"T",
">",
"model",
",",
"List",
"<",
"S",
">",
"idList",
")",
"{",
"deleteBatch",
"(",
"model",
",",
"AnimaUtils",
"."... | Batch delete model with List
@param model model class type
@param idList mode primary id list
@param <T>
@param <S> | [
"Batch",
"delete",
"model",
"with",
"List"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/Anima.java#L432-L434 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/util/ProcessUtil.java | ProcessUtil.onProcessExited | public static void onProcessExited(Process process, Listener<Integer> exitValueListener) {
Application app = LCCore.getApplication();
Mutable<Thread> mt = new Mutable<>(null);
Thread t = app.getThreadFactory().newThread(() -> {
try { exitValueListener.fire(Integer.valueOf(process.waitFor())); }
catch (... | java | public static void onProcessExited(Process process, Listener<Integer> exitValueListener) {
Application app = LCCore.getApplication();
Mutable<Thread> mt = new Mutable<>(null);
Thread t = app.getThreadFactory().newThread(() -> {
try { exitValueListener.fire(Integer.valueOf(process.waitFor())); }
catch (... | [
"public",
"static",
"void",
"onProcessExited",
"(",
"Process",
"process",
",",
"Listener",
"<",
"Integer",
">",
"exitValueListener",
")",
"{",
"Application",
"app",
"=",
"LCCore",
".",
"getApplication",
"(",
")",
";",
"Mutable",
"<",
"Thread",
">",
"mt",
"="... | Create a thread that wait for the given process to end, and call the given listener. | [
"Create",
"a",
"thread",
"that",
"wait",
"for",
"the",
"given",
"process",
"to",
"end",
"and",
"call",
"the",
"given",
"listener",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/util/ProcessUtil.java#L22-L34 |
eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/GenericDao.java | GenericDao.getUniqueByAttribute | protected <Y> T getUniqueByAttribute(String attributeName, Y value) {
try {
return getDatabaseSupport().getUniqueByAttribute(getEntityClass(), attributeName, value);
} catch (NoResultException ex) {
return null;
}
} | java | protected <Y> T getUniqueByAttribute(String attributeName, Y value) {
try {
return getDatabaseSupport().getUniqueByAttribute(getEntityClass(), attributeName, value);
} catch (NoResultException ex) {
return null;
}
} | [
"protected",
"<",
"Y",
">",
"T",
"getUniqueByAttribute",
"(",
"String",
"attributeName",
",",
"Y",
"value",
")",
"{",
"try",
"{",
"return",
"getDatabaseSupport",
"(",
")",
".",
"getUniqueByAttribute",
"(",
"getEntityClass",
"(",
")",
",",
"attributeName",
",",... | Gets the entity that has the target value of the specified attribute.
@param <Y> the type of the attribute and target value.
@param attributeName the name of the attribute.
@param value the target value of the given attribute.
@return the matching entity, or <code>null</code> if there is none. | [
"Gets",
"the",
"entity",
"that",
"has",
"the",
"target",
"value",
"of",
"the",
"specified",
"attribute",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/GenericDao.java#L237-L243 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.createCipher | private static Cipher createCipher(final String algorithm, final int mode, final char[] password, final byte[] salt, final int count)
throws GeneralSecurityException {
final SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(algorithm);
final PBEKeySpec keySpec = new PBEKeySpec(... | java | private static Cipher createCipher(final String algorithm, final int mode, final char[] password, final byte[] salt, final int count)
throws GeneralSecurityException {
final SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(algorithm);
final PBEKeySpec keySpec = new PBEKeySpec(... | [
"private",
"static",
"Cipher",
"createCipher",
"(",
"final",
"String",
"algorithm",
",",
"final",
"int",
"mode",
",",
"final",
"char",
"[",
"]",
"password",
",",
"final",
"byte",
"[",
"]",
"salt",
",",
"final",
"int",
"count",
")",
"throws",
"GeneralSecuri... | Creates a cipher for encryption or decryption.
@param algorithm
PBE algorithm like "PBEWithMD5AndDES" or "PBEWithMD5AndTripleDES".
@param mode
Encyrption or decyrption.
@param password
Password.
@param salt
Salt usable with algorithm.
@param count
Iterations.
@return Ready initialized cipher.
@throws GeneralSecurity... | [
"Creates",
"a",
"cipher",
"for",
"encryption",
"or",
"decryption",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L383-L394 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/webapp/views/LicenseListView.java | LicenseListView.getTable | public Table getTable(){
final Table table = new Table("Name", "Long Name", "URL", "Comment");
// Create row(s) per dependency
for(final License license: licenses){
table.addRow(license.getName(), license.getLongName(), license.getUrl(), license.getComments());
}
re... | java | public Table getTable(){
final Table table = new Table("Name", "Long Name", "URL", "Comment");
// Create row(s) per dependency
for(final License license: licenses){
table.addRow(license.getName(), license.getLongName(), license.getUrl(), license.getComments());
}
re... | [
"public",
"Table",
"getTable",
"(",
")",
"{",
"final",
"Table",
"table",
"=",
"new",
"Table",
"(",
"\"Name\"",
",",
"\"Long Name\"",
",",
"\"URL\"",
",",
"\"Comment\"",
")",
";",
"// Create row(s) per dependency",
"for",
"(",
"final",
"License",
"license",
":"... | Generate a table that contains the dependencies information with the column that match the configured filters
@return Table | [
"Generate",
"a",
"table",
"that",
"contains",
"the",
"dependencies",
"information",
"with",
"the",
"column",
"that",
"match",
"the",
"configured",
"filters"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/views/LicenseListView.java#L58-L67 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.