repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/OutputLayerUtil.java | OutputLayerUtil.validateOutputLayerForClassifierEvaluation | public static void validateOutputLayerForClassifierEvaluation(Layer outputLayer, Class<? extends IEvaluation> classifierEval) {
"""
Validates if the output layer configuration is valid for classifier evaluation.
This is used to try and catch invalid evaluation - i.e., trying to use classifier evaluation on a regr... | java | public static void validateOutputLayerForClassifierEvaluation(Layer outputLayer, Class<? extends IEvaluation> classifierEval){
if(outputLayer instanceof Yolo2OutputLayer){
throw new IllegalStateException("Classifier evaluation using " + classifierEval.getSimpleName() + " class cannot be applied for ... | [
"public",
"static",
"void",
"validateOutputLayerForClassifierEvaluation",
"(",
"Layer",
"outputLayer",
",",
"Class",
"<",
"?",
"extends",
"IEvaluation",
">",
"classifierEval",
")",
"{",
"if",
"(",
"outputLayer",
"instanceof",
"Yolo2OutputLayer",
")",
"{",
"throw",
"... | Validates if the output layer configuration is valid for classifier evaluation.
This is used to try and catch invalid evaluation - i.e., trying to use classifier evaluation on a regression model.
This method won't catch all possible invalid cases, but should catch some common problems.
@param outputLayer Outp... | [
"Validates",
"if",
"the",
"output",
"layer",
"configuration",
"is",
"valid",
"for",
"classifier",
"evaluation",
".",
"This",
"is",
"used",
"to",
"try",
"and",
"catch",
"invalid",
"evaluation",
"-",
"i",
".",
"e",
".",
"trying",
"to",
"use",
"classifier",
"... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/OutputLayerUtil.java#L173-L193 |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateBeanMonthlyWeeks.java | CmsSerialDateBeanMonthlyWeeks.toCorrectDateWithDay | private void toCorrectDateWithDay(Calendar date, WeekOfMonth week) {
"""
Sets the day of the month that matches the condition, i.e., the day of month of the 2nd Saturday.
If the day does not exist in the current month, the last possible date is set, i.e.,
instead of the fifth Saturday, the fourth is chosen.
@... | java | private void toCorrectDateWithDay(Calendar date, WeekOfMonth week) {
date.set(Calendar.DAY_OF_MONTH, 1);
int daysToFirstWeekDayMatch = ((m_weekDay.toInt() + I_CmsSerialDateValue.NUM_OF_WEEKDAYS)
- (date.get(Calendar.DAY_OF_WEEK))) % I_CmsSerialDateValue.NUM_OF_WEEKDAYS;
date.add(Cal... | [
"private",
"void",
"toCorrectDateWithDay",
"(",
"Calendar",
"date",
",",
"WeekOfMonth",
"week",
")",
"{",
"date",
".",
"set",
"(",
"Calendar",
".",
"DAY_OF_MONTH",
",",
"1",
")",
";",
"int",
"daysToFirstWeekDayMatch",
"=",
"(",
"(",
"m_weekDay",
".",
"toInt"... | Sets the day of the month that matches the condition, i.e., the day of month of the 2nd Saturday.
If the day does not exist in the current month, the last possible date is set, i.e.,
instead of the fifth Saturday, the fourth is chosen.
@param date date that has the correct year and month already set.
@param week the n... | [
"Sets",
"the",
"day",
"of",
"the",
"month",
"that",
"matches",
"the",
"condition",
"i",
".",
"e",
".",
"the",
"day",
"of",
"month",
"of",
"the",
"2nd",
"Saturday",
".",
"If",
"the",
"day",
"does",
"not",
"exist",
"in",
"the",
"current",
"month",
"the... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateBeanMonthlyWeeks.java#L128-L142 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/declarative/utils/DeclarativePipelineUtils.java | DeclarativePipelineUtils.readBuildDataFile | public static BuildDataFile readBuildDataFile(FilePath ws, final String buildNumber, final String stepName, final String stepId) throws IOException, InterruptedException {
"""
Read pipeline build data from @tmp/artifactory-pipeline-cache/build-number directory.
Used to transfer data between different steps in dec... | java | public static BuildDataFile readBuildDataFile(FilePath ws, final String buildNumber, final String stepName, final String stepId) throws IOException, InterruptedException {
return createAndGetTempDir(ws).act(new ReadBuildDataFileCallable(buildNumber, stepName, stepId));
} | [
"public",
"static",
"BuildDataFile",
"readBuildDataFile",
"(",
"FilePath",
"ws",
",",
"final",
"String",
"buildNumber",
",",
"final",
"String",
"stepName",
",",
"final",
"String",
"stepId",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"return",
... | Read pipeline build data from @tmp/artifactory-pipeline-cache/build-number directory.
Used to transfer data between different steps in declarative pipelines.
@param buildNumber - The build number.
@param stepName - The step name - One of 'artifactoryMaven', 'mavenDeploy', 'mavenResolve', 'buildInfo' and other decla... | [
"Read",
"pipeline",
"build",
"data",
"from",
"@tmp",
"/",
"artifactory",
"-",
"pipeline",
"-",
"cache",
"/",
"build",
"-",
"number",
"directory",
".",
"Used",
"to",
"transfer",
"data",
"between",
"different",
"steps",
"in",
"declarative",
"pipelines",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/declarative/utils/DeclarativePipelineUtils.java#L53-L55 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java | AkkaInvocationHandler.invokeRpc | private Object invokeRpc(Method method, Object[] args) throws Exception {
"""
Invokes a RPC method by sending the RPC invocation details to the rpc endpoint.
@param method to call
@param args of the method call
@return result of the RPC
@throws Exception if the RPC invocation fails
"""
String methodNam... | java | private Object invokeRpc(Method method, Object[] args) throws Exception {
String methodName = method.getName();
Class<?>[] parameterTypes = method.getParameterTypes();
Annotation[][] parameterAnnotations = method.getParameterAnnotations();
Time futureTimeout = extractRpcTimeout(parameterAnnotations, args, timeo... | [
"private",
"Object",
"invokeRpc",
"(",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"String",
"methodName",
"=",
"method",
".",
"getName",
"(",
")",
";",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
"=",
... | Invokes a RPC method by sending the RPC invocation details to the rpc endpoint.
@param method to call
@param args of the method call
@return result of the RPC
@throws Exception if the RPC invocation fails | [
"Invokes",
"a",
"RPC",
"method",
"by",
"sending",
"the",
"RPC",
"invocation",
"details",
"to",
"the",
"rpc",
"endpoint",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java#L194-L240 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java | ST_AddPoint.insertVertexInMultipoint | private static Geometry insertVertexInMultipoint(Geometry g, Point vertexPoint) {
"""
Adds a Point into a MultiPoint geometry.
@param g
@param vertexPoint
@return
"""
ArrayList<Point> geoms = new ArrayList<Point>();
for (int i = 0; i < g.getNumGeometries(); i++) {
Point geom = ... | java | private static Geometry insertVertexInMultipoint(Geometry g, Point vertexPoint) {
ArrayList<Point> geoms = new ArrayList<Point>();
for (int i = 0; i < g.getNumGeometries(); i++) {
Point geom = (Point) g.getGeometryN(i);
geoms.add(geom);
}
geoms.add(FACTORY.createP... | [
"private",
"static",
"Geometry",
"insertVertexInMultipoint",
"(",
"Geometry",
"g",
",",
"Point",
"vertexPoint",
")",
"{",
"ArrayList",
"<",
"Point",
">",
"geoms",
"=",
"new",
"ArrayList",
"<",
"Point",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0"... | Adds a Point into a MultiPoint geometry.
@param g
@param vertexPoint
@return | [
"Adds",
"a",
"Point",
"into",
"a",
"MultiPoint",
"geometry",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_AddPoint.java#L135-L143 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/ViolationRest.java | ViolationRest.getViolationsXML | @GET
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response getViolationsXML(
@QueryParam("agreementId") String agreementId,
@QueryParam("guaranteeTerm") String guaranteeTerm,
@QueryParam("providerId") String providerUuid,
@Q... | java | @GET
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response getViolationsXML(
@QueryParam("agreementId") String agreementId,
@QueryParam("guaranteeTerm") String guaranteeTerm,
@QueryParam("providerId") String providerUuid,
@Q... | [
"@",
"GET",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"public",
"Response",
"getViolationsXML",
"(",
"@",
"QueryParam",
"(",
"\"agreementId\"",
")",
"String",
"agreementId",
",... | Search violations given an agreementId as query string.
If no parameters specified, return all violations.
<pre>
GET /violations{?agreementId,guaranteeTerm,providerId,begin,end}
Request:
GET /violation HTTP/1.1
Accept: application/xml
Response:
HTTP/1.1 200 OK
Content-type: application/xml
{@code
<?xml version="1.... | [
"Search",
"violations",
"given",
"an",
"agreementId",
"as",
"query",
"string",
"."
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/ViolationRest.java#L186-L215 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java | ClassesManager.isAssignableFrom | public static boolean isAssignableFrom(Class<?> destination,Class<?> source) {
"""
Returns true if destination is assignable from source analyzing autoboxing also.
@param destination destination class
@param source source class
@return true if destination is assignable from source analyzing autoboxing also.
... | java | public static boolean isAssignableFrom(Class<?> destination,Class<?> source){
return destination.isAssignableFrom(source) || isBoxing(destination,source) || isUnBoxing(destination,source);
} | [
"public",
"static",
"boolean",
"isAssignableFrom",
"(",
"Class",
"<",
"?",
">",
"destination",
",",
"Class",
"<",
"?",
">",
"source",
")",
"{",
"return",
"destination",
".",
"isAssignableFrom",
"(",
"source",
")",
"||",
"isBoxing",
"(",
"destination",
",",
... | Returns true if destination is assignable from source analyzing autoboxing also.
@param destination destination class
@param source source class
@return true if destination is assignable from source analyzing autoboxing also. | [
"Returns",
"true",
"if",
"destination",
"is",
"assignable",
"from",
"source",
"analyzing",
"autoboxing",
"also",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java#L125-L127 |
gallandarakhneorg/afc | maven/tag-replacer/src/main/java/org/arakhne/maven/plugins/tagreplacer/AbstractReplaceMojo.java | AbstractReplaceMojo.replaceMacro | protected final String replaceMacro(String macroName, String text, String replacement, ReplacementType type,
File sourceFile, int sourceLine) {
"""
Utility function that replace the macros by the replacement text in the given text.
@param macroName
is the name of the macro to replace.
@param text
is the t... | java | protected final String replaceMacro(String macroName, String text, String replacement, ReplacementType type,
File sourceFile, int sourceLine) {
return replaceMacro(macroName, text, replacement, type, false, sourceFile, sourceLine);
} | [
"protected",
"final",
"String",
"replaceMacro",
"(",
"String",
"macroName",
",",
"String",
"text",
",",
"String",
"replacement",
",",
"ReplacementType",
"type",
",",
"File",
"sourceFile",
",",
"int",
"sourceLine",
")",
"{",
"return",
"replaceMacro",
"(",
"macroN... | Utility function that replace the macros by the replacement text in the given text.
@param macroName
is the name of the macro to replace.
@param text
is the text in which the replacement should occur
@param replacement
is the replacement text.
@param type
is the type of replacement to be done.
@param sourceFile
is the... | [
"Utility",
"function",
"that",
"replace",
"the",
"macros",
"by",
"the",
"replacement",
"text",
"in",
"the",
"given",
"text",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/maven/tag-replacer/src/main/java/org/arakhne/maven/plugins/tagreplacer/AbstractReplaceMojo.java#L476-L479 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java | AbstractRegionPainter.createRadialGradient | protected final RadialGradientPaint createRadialGradient(float x, float y, float r, float[] midpoints, Color[] colors) {
"""
Given parameters for creating a RadialGradientPaint, this method will
create and return a radial gradient paint. One primary purpose for this
method is to avoid creating a RadialGradientPa... | java | protected final RadialGradientPaint createRadialGradient(float x, float y, float r, float[] midpoints, Color[] colors) {
if (r == 0f) {
r = .00001f;
}
return new RadialGradientPaint(x, y, r, midpoints, colors);
} | [
"protected",
"final",
"RadialGradientPaint",
"createRadialGradient",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"r",
",",
"float",
"[",
"]",
"midpoints",
",",
"Color",
"[",
"]",
"colors",
")",
"{",
"if",
"(",
"r",
"==",
"0f",
")",
"{",
"r",
... | Given parameters for creating a RadialGradientPaint, this method will
create and return a radial gradient paint. One primary purpose for this
method is to avoid creating a RadialGradientPaint where the radius is
non-positive. In such a case, the radius is just slightly increased to
avoid 0.
@param x
@param y
@param ... | [
"Given",
"parameters",
"for",
"creating",
"a",
"RadialGradientPaint",
"this",
"method",
"will",
"create",
"and",
"return",
"a",
"radial",
"gradient",
"paint",
".",
"One",
"primary",
"purpose",
"for",
"this",
"method",
"is",
"to",
"avoid",
"creating",
"a",
"Rad... | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java#L359-L365 |
js-lib-com/commons | src/main/java/js/util/Params.java | Params.GT | public static void GT(long parameter, long value, String name) throws IllegalArgumentException {
"""
Test if numeric parameter is strictly greater than given threshold value.
@param parameter invocation numeric parameter,
@param value threshold value,
@param name the name of invocation parameter.
@throws Ill... | java | public static void GT(long parameter, long value, String name) throws IllegalArgumentException {
if (parameter <= value) {
throw new IllegalArgumentException(String.format("%s is not greater than %d.", name, value));
}
} | [
"public",
"static",
"void",
"GT",
"(",
"long",
"parameter",
",",
"long",
"value",
",",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"parameter",
"<=",
"value",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",... | Test if numeric parameter is strictly greater than given threshold value.
@param parameter invocation numeric parameter,
@param value threshold value,
@param name the name of invocation parameter.
@throws IllegalArgumentException if <code>parameter</code> is not greater than threshold value. | [
"Test",
"if",
"numeric",
"parameter",
"is",
"strictly",
"greater",
"than",
"given",
"threshold",
"value",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L345-L349 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java | EnvironmentsInner.beginStop | public void beginStop(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) {
"""
Stops an environment by stopping all resources inside the environment This operation can take a while to complete.
@param resourceGroupName The name of the resource... | java | public void beginStop(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String environmentName) {
beginStopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentName).toBlocking().single().body();
} | [
"public",
"void",
"beginStop",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
",",
"String",
"environmentName",
")",
"{",
"beginStopWithServiceResponseAsync",
"(",
"resourceGroupName"... | Stops an environment by stopping all resources inside the environment This operation can take a while to complete.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment Se... | [
"Stops",
"an",
"environment",
"by",
"stopping",
"all",
"resources",
"inside",
"the",
"environment",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentsInner.java#L1675-L1677 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/PatternElement.java | PatternElement.addOrCheckDefinition | protected static BindingSet addOrCheckDefinition(String varName, Variable variable, BindingSet bindingSet) {
"""
Add a variable definition to the given BindingSet, or if there is an
existing definition, make sure it is consistent with the new definition.
@param varName
the name of the variable
@param variabl... | java | protected static BindingSet addOrCheckDefinition(String varName, Variable variable, BindingSet bindingSet) {
Variable existingVariable = lookup(varName, bindingSet);
if (existingVariable == null) {
bindingSet = new BindingSet(new Binding(varName, variable), bindingSet);
} else {
... | [
"protected",
"static",
"BindingSet",
"addOrCheckDefinition",
"(",
"String",
"varName",
",",
"Variable",
"variable",
",",
"BindingSet",
"bindingSet",
")",
"{",
"Variable",
"existingVariable",
"=",
"lookup",
"(",
"varName",
",",
"bindingSet",
")",
";",
"if",
"(",
... | Add a variable definition to the given BindingSet, or if there is an
existing definition, make sure it is consistent with the new definition.
@param varName
the name of the variable
@param variable
the Variable which should be added or checked for consistency
@param bindingSet
the existing set of bindings
@return the ... | [
"Add",
"a",
"variable",
"definition",
"to",
"the",
"given",
"BindingSet",
"or",
"if",
"there",
"is",
"an",
"existing",
"definition",
"make",
"sure",
"it",
"is",
"consistent",
"with",
"the",
"new",
"definition",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/PatternElement.java#L209-L221 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListUserSegmentEntryRelPersistenceImpl.java | CommercePriceListUserSegmentEntryRelPersistenceImpl.findByCommercePriceListId | @Override
public List<CommercePriceListUserSegmentEntryRel> findByCommercePriceListId(
long commercePriceListId, int start, int end) {
"""
Returns a range of all the commerce price list user segment entry rels where commercePriceListId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>... | java | @Override
public List<CommercePriceListUserSegmentEntryRel> findByCommercePriceListId(
long commercePriceListId, int start, int end) {
return findByCommercePriceListId(commercePriceListId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceListUserSegmentEntryRel",
">",
"findByCommercePriceListId",
"(",
"long",
"commercePriceListId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCommercePriceListId",
"(",
"commercePriceListId",
","... | Returns a range of all the commerce price list user segment entry rels where commercePriceListId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> r... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"price",
"list",
"user",
"segment",
"entry",
"rels",
"where",
"commercePriceListId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListUserSegmentEntryRelPersistenceImpl.java#L1570-L1574 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.setDateExpired | public void setDateExpired(CmsResource resource, long dateExpired, boolean recursive) throws CmsException {
"""
Changes the "expire" date of a resource.<p>
@param resource the resource to change
@param dateExpired the new expire date of the changed resource
@param recursive if this operation is to be applied ... | java | public void setDateExpired(CmsResource resource, long dateExpired, boolean recursive) throws CmsException {
getResourceType(resource).setDateExpired(this, m_securityManager, resource, dateExpired, recursive);
} | [
"public",
"void",
"setDateExpired",
"(",
"CmsResource",
"resource",
",",
"long",
"dateExpired",
",",
"boolean",
"recursive",
")",
"throws",
"CmsException",
"{",
"getResourceType",
"(",
"resource",
")",
".",
"setDateExpired",
"(",
"this",
",",
"m_securityManager",
... | Changes the "expire" date of a resource.<p>
@param resource the resource to change
@param dateExpired the new expire date of the changed resource
@param recursive if this operation is to be applied recursively to all resources in a folder
@throws CmsException if something goes wrong | [
"Changes",
"the",
"expire",
"date",
"of",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L3753-L3756 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/metrics/MetricsServlet.java | MetricsServlet.makeMap | Map<String, Map<String, List<TagsMetricsPair>>> makeMap(
Collection<MetricsContext> contexts) throws IOException {
"""
Collects all metric data, and returns a map:
contextName -> recordName -> [ (tag->tagValue), (metric->metricValue) ].
The values are either String or Number. The final value is implement... | java | Map<String, Map<String, List<TagsMetricsPair>>> makeMap(
Collection<MetricsContext> contexts) throws IOException {
Map<String, Map<String, List<TagsMetricsPair>>> map =
new TreeMap<String, Map<String, List<TagsMetricsPair>>>();
for (MetricsContext context : contexts) {
Map<String, List<Tags... | [
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"TagsMetricsPair",
">",
">",
">",
"makeMap",
"(",
"Collection",
"<",
"MetricsContext",
">",
"contexts",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",... | Collects all metric data, and returns a map:
contextName -> recordName -> [ (tag->tagValue), (metric->metricValue) ].
The values are either String or Number. The final value is implemented
as a list of TagsMetricsPair. | [
"Collects",
"all",
"metric",
"data",
"and",
"returns",
"a",
"map",
":",
"contextName",
"-",
">",
"recordName",
"-",
">",
"[",
"(",
"tag",
"-",
">",
"tagValue",
")",
"(",
"metric",
"-",
">",
"metricValue",
")",
"]",
".",
"The",
"values",
"are",
"eithe... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/MetricsServlet.java#L75-L98 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.scaleAroundLocal | public Matrix4d scaleAroundLocal(double factor, double ox, double oy, double oz) {
"""
Pre-multiply scaling to this matrix by scaling all three base axes by the given <code>factor</code>
while using <code>(ox, oy, oz)</code> as the scaling origin.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</c... | java | public Matrix4d scaleAroundLocal(double factor, double ox, double oy, double oz) {
return scaleAroundLocal(factor, factor, factor, ox, oy, oz, this);
} | [
"public",
"Matrix4d",
"scaleAroundLocal",
"(",
"double",
"factor",
",",
"double",
"ox",
",",
"double",
"oy",
",",
"double",
"oz",
")",
"{",
"return",
"scaleAroundLocal",
"(",
"factor",
",",
"factor",
",",
"factor",
",",
"ox",
",",
"oy",
",",
"oz",
",",
... | Pre-multiply scaling to this matrix by scaling all three base axes by the given <code>factor</code>
while using <code>(ox, oy, oz)</code> as the scaling origin.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>S * M</code>. So when transforming a... | [
"Pre",
"-",
"multiply",
"scaling",
"to",
"this",
"matrix",
"by",
"scaling",
"all",
"three",
"base",
"axes",
"by",
"the",
"given",
"<code",
">",
"factor<",
"/",
"code",
">",
"while",
"using",
"<code",
">",
"(",
"ox",
"oy",
"oz",
")",
"<",
"/",
"code",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L4681-L4683 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java | FormValidator.fileExists | public FormInputValidator fileExists (VisValidatableTextField field, FileHandle relativeTo, String errorMsg) {
"""
Validates if relative path entered in text field points to an existing file.
@param relativeTo path of this file is used to create absolute path from entered in field (see {@link FileExistsValidator}... | java | public FormInputValidator fileExists (VisValidatableTextField field, FileHandle relativeTo, String errorMsg) {
FileExistsValidator validator = new FileExistsValidator(relativeTo.file(), errorMsg);
field.addValidator(validator);
add(field);
return validator;
} | [
"public",
"FormInputValidator",
"fileExists",
"(",
"VisValidatableTextField",
"field",
",",
"FileHandle",
"relativeTo",
",",
"String",
"errorMsg",
")",
"{",
"FileExistsValidator",
"validator",
"=",
"new",
"FileExistsValidator",
"(",
"relativeTo",
".",
"file",
"(",
")"... | Validates if relative path entered in text field points to an existing file.
@param relativeTo path of this file is used to create absolute path from entered in field (see {@link FileExistsValidator}). | [
"Validates",
"if",
"relative",
"path",
"entered",
"in",
"text",
"field",
"points",
"to",
"an",
"existing",
"file",
"."
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java#L103-L109 |
tango-controls/JTango | server/src/main/java/org/tango/server/device/DeviceManager.java | DeviceManager.pushEvent | public void pushEvent(final String attributeName, final AttributeValue value, final EventType eventType)
throws DevFailed {
"""
Push an event if some client had register it.
@param attributeName The attribute name
@param eventType The type of event to fire
@throws DevFailed
"""
swi... | java | public void pushEvent(final String attributeName, final AttributeValue value, final EventType eventType)
throws DevFailed {
switch (eventType) {
case CHANGE_EVENT:
case ARCHIVE_EVENT:
case USER_EVENT:
// set attribute value
final At... | [
"public",
"void",
"pushEvent",
"(",
"final",
"String",
"attributeName",
",",
"final",
"AttributeValue",
"value",
",",
"final",
"EventType",
"eventType",
")",
"throws",
"DevFailed",
"{",
"switch",
"(",
"eventType",
")",
"{",
"case",
"CHANGE_EVENT",
":",
"case",
... | Push an event if some client had register it.
@param attributeName The attribute name
@param eventType The type of event to fire
@throws DevFailed | [
"Push",
"an",
"event",
"if",
"some",
"client",
"had",
"register",
"it",
"."
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/device/DeviceManager.java#L264-L287 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindTableGenerator.java | BindTableGenerator.tableClassName | public static ClassName tableClassName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
"""
Table class name.
@param dao
the dao
@param entity
the entity
@return the class name
"""
String entityName = BindDataSourceSubProcessor.generateEntityQualifiedName(dao, entity);
return TypeUtility.className(e... | java | public static ClassName tableClassName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
String entityName = BindDataSourceSubProcessor.generateEntityQualifiedName(dao, entity);
return TypeUtility.className(entityName + SUFFIX);
} | [
"public",
"static",
"ClassName",
"tableClassName",
"(",
"SQLiteDaoDefinition",
"dao",
",",
"SQLiteEntity",
"entity",
")",
"{",
"String",
"entityName",
"=",
"BindDataSourceSubProcessor",
".",
"generateEntityQualifiedName",
"(",
"dao",
",",
"entity",
")",
";",
"return",... | Table class name.
@param dao
the dao
@param entity
the entity
@return the class name | [
"Table",
"class",
"name",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindTableGenerator.java#L381-L386 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatter.java | PeriodFormatter.parseMutablePeriod | public MutablePeriod parseMutablePeriod(String text) {
"""
Parses a period from the given text, returning a new MutablePeriod.
@param text text to parse
@return parsed value in a MutablePeriod object
@throws IllegalArgumentException if any field is out of range
"""
checkParser();
... | java | public MutablePeriod parseMutablePeriod(String text) {
checkParser();
MutablePeriod period = new MutablePeriod(0, iParseType);
int newPos = getParser().parseInto(period, text, 0, iLocale);
if (newPos >= 0) {
if (newPos >= text.length()) {
return perio... | [
"public",
"MutablePeriod",
"parseMutablePeriod",
"(",
"String",
"text",
")",
"{",
"checkParser",
"(",
")",
";",
"MutablePeriod",
"period",
"=",
"new",
"MutablePeriod",
"(",
"0",
",",
"iParseType",
")",
";",
"int",
"newPos",
"=",
"getParser",
"(",
")",
".",
... | Parses a period from the given text, returning a new MutablePeriod.
@param text text to parse
@return parsed value in a MutablePeriod object
@throws IllegalArgumentException if any field is out of range | [
"Parses",
"a",
"period",
"from",
"the",
"given",
"text",
"returning",
"a",
"new",
"MutablePeriod",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatter.java#L318-L331 |
tango-controls/JTango | client/src/main/java/org/tango/client/database/DatabaseFactory.java | DatabaseFactory.getDatabase | public static synchronized ITangoDB getDatabase(final String host, final String port) throws DevFailed {
"""
Get the database object created for specified host and port.
@param host
host where database is running.
@param port
port for database connection.
"""
final ITangoDB dbase;
if (use... | java | public static synchronized ITangoDB getDatabase(final String host, final String port) throws DevFailed {
final ITangoDB dbase;
if (useDb) {
final String tangoHost = host + ":" + port;
// Search if database object already created for this host and port
if (databaseMap.... | [
"public",
"static",
"synchronized",
"ITangoDB",
"getDatabase",
"(",
"final",
"String",
"host",
",",
"final",
"String",
"port",
")",
"throws",
"DevFailed",
"{",
"final",
"ITangoDB",
"dbase",
";",
"if",
"(",
"useDb",
")",
"{",
"final",
"String",
"tangoHost",
"... | Get the database object created for specified host and port.
@param host
host where database is running.
@param port
port for database connection. | [
"Get",
"the",
"database",
"object",
"created",
"for",
"specified",
"host",
"and",
"port",
"."
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/client/src/main/java/org/tango/client/database/DatabaseFactory.java#L38-L53 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.updateSecurityPolicy | public UpdateSecurityPolicyResponse updateSecurityPolicy(UpdateSecurityPolicyRequest request) {
"""
Update your live security policy by live security policy name.
@param request The request object containing all parameters for updating live security policy.
@return the response
"""
checkNotNull(req... | java | public UpdateSecurityPolicyResponse updateSecurityPolicy(UpdateSecurityPolicyRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getName(), "The parameter name should NOT be null or empty string.");
UpdateSecurityPolicyInnerRequest i... | [
"public",
"UpdateSecurityPolicyResponse",
"updateSecurityPolicy",
"(",
"UpdateSecurityPolicyRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getName",
"(... | Update your live security policy by live security policy name.
@param request The request object containing all parameters for updating live security policy.
@return the response | [
"Update",
"your",
"live",
"security",
"policy",
"by",
"live",
"security",
"policy",
"name",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1300-L1310 |
lastaflute/lasta-di | src/main/java/org/lastaflute/di/util/LdiSrl.java | LdiSrl.substringFirstFrontIgnoreCase | public static String substringFirstFrontIgnoreCase(final String str, final String... delimiters) {
"""
Extract front sub-string from first-found delimiter ignoring case.
<pre>
substringFirstFront("foo.bar/baz.qux", "A", "U")
returns "foo.b"
</pre>
@param str The target string. (NotNull)
@param delimiters The... | java | public static String substringFirstFrontIgnoreCase(final String str, final String... delimiters) {
assertStringNotNull(str);
return doSubstringFirstRear(false, false, true, str, delimiters);
} | [
"public",
"static",
"String",
"substringFirstFrontIgnoreCase",
"(",
"final",
"String",
"str",
",",
"final",
"String",
"...",
"delimiters",
")",
"{",
"assertStringNotNull",
"(",
"str",
")",
";",
"return",
"doSubstringFirstRear",
"(",
"false",
",",
"false",
",",
"... | Extract front sub-string from first-found delimiter ignoring case.
<pre>
substringFirstFront("foo.bar/baz.qux", "A", "U")
returns "foo.b"
</pre>
@param str The target string. (NotNull)
@param delimiters The array of delimiters. (NotNull)
@return The part of string. (NotNull: if delimiter not found, returns argument-pla... | [
"Extract",
"front",
"sub",
"-",
"string",
"from",
"first",
"-",
"found",
"delimiter",
"ignoring",
"case",
".",
"<pre",
">",
"substringFirstFront",
"(",
"foo",
".",
"bar",
"/",
"baz",
".",
"qux",
"A",
"U",
")",
"returns",
"foo",
".",
"b",
"<",
"/",
"p... | train | https://github.com/lastaflute/lasta-di/blob/c4e123610c53a04cc836c5e456660e32d613447b/src/main/java/org/lastaflute/di/util/LdiSrl.java#L642-L645 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java | File.setReadable | public boolean setReadable(boolean readable, boolean ownerOnly) {
"""
Manipulates the read permissions for the abstract path designated by this
file.
@param readable
To allow read permission if true, otherwise disallow
@param ownerOnly
To manipulate read permission only for owner if true,
otherwise for eve... | java | public boolean setReadable(boolean readable, boolean ownerOnly) {
return doChmod(ownerOnly ? S_IRUSR : (S_IRUSR | S_IRGRP | S_IROTH), readable);
} | [
"public",
"boolean",
"setReadable",
"(",
"boolean",
"readable",
",",
"boolean",
"ownerOnly",
")",
"{",
"return",
"doChmod",
"(",
"ownerOnly",
"?",
"S_IRUSR",
":",
"(",
"S_IRUSR",
"|",
"S_IRGRP",
"|",
"S_IROTH",
")",
",",
"readable",
")",
";",
"}"
] | Manipulates the read permissions for the abstract path designated by this
file.
@param readable
To allow read permission if true, otherwise disallow
@param ownerOnly
To manipulate read permission only for owner if true,
otherwise for everyone. The manipulation will apply to
everyone regardless of this value if the und... | [
"Manipulates",
"the",
"read",
"permissions",
"for",
"the",
"abstract",
"path",
"designated",
"by",
"this",
"file",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java#L726-L728 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/token/JsonTokenUtil.java | JsonTokenUtil.validateTokenString | public static void validateTokenString(String tokenString, String alg, @Sensitive Key key, long secondsClockSkew, boolean forSignatureOnly) throws InvalidJwtException {
"""
check Signature, iat, and exp only, which is what the old net.oauth code used to do.
Will throw an exception if the token fails to validate.
... | java | public static void validateTokenString(String tokenString, String alg, @Sensitive Key key, long secondsClockSkew, boolean forSignatureOnly) throws InvalidJwtException {
// alg is HS256 or RS256 which is consistent with AlgorithmIdentifiers
AlgorithmConstraints algorithmConstraints = new AlgorithmConstr... | [
"public",
"static",
"void",
"validateTokenString",
"(",
"String",
"tokenString",
",",
"String",
"alg",
",",
"@",
"Sensitive",
"Key",
"key",
",",
"long",
"secondsClockSkew",
",",
"boolean",
"forSignatureOnly",
")",
"throws",
"InvalidJwtException",
"{",
"// alg is HS2... | check Signature, iat, and exp only, which is what the old net.oauth code used to do.
Will throw an exception if the token fails to validate.
@param tokenString
@param alg
@param key
@param secondsClockSkew
@param forSignatureOnly
@throws InvalidJwtException | [
"check",
"Signature",
"iat",
"and",
"exp",
"only",
"which",
"is",
"what",
"the",
"old",
"net",
".",
"oauth",
"code",
"used",
"to",
"do",
".",
"Will",
"throw",
"an",
"exception",
"if",
"the",
"token",
"fails",
"to",
"validate",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/token/JsonTokenUtil.java#L350-L381 |
signit-wesign/java-sdk | src/main/java/cn/signit/sdk/util/FastjsonEncoder.java | FastjsonEncoder.encodeAsString | public static String encodeAsString(Object obj,boolean useUnicode) {
"""
将指定java对象序列化成相应字符串<br>
(默认:使用NamingStyle.CAMEL命名风格)
@param obj java对象
@param useUnicode 是否使用unicode编码(当有中文字段时)
@return 序列化后的json字符串
@author Zhanghongdong
"""
return encodeAsString(obj, NamingStyle.CAMEL, useUnicode);
} | java | public static String encodeAsString(Object obj,boolean useUnicode){
return encodeAsString(obj, NamingStyle.CAMEL, useUnicode);
} | [
"public",
"static",
"String",
"encodeAsString",
"(",
"Object",
"obj",
",",
"boolean",
"useUnicode",
")",
"{",
"return",
"encodeAsString",
"(",
"obj",
",",
"NamingStyle",
".",
"CAMEL",
",",
"useUnicode",
")",
";",
"}"
] | 将指定java对象序列化成相应字符串<br>
(默认:使用NamingStyle.CAMEL命名风格)
@param obj java对象
@param useUnicode 是否使用unicode编码(当有中文字段时)
@return 序列化后的json字符串
@author Zhanghongdong | [
"将指定java对象序列化成相应字符串<br",
">",
"(",
"默认:使用NamingStyle",
".",
"CAMEL命名风格",
")"
] | train | https://github.com/signit-wesign/java-sdk/blob/6f3196c9d444818a953396fdaa8ffed9794d9530/src/main/java/cn/signit/sdk/util/FastjsonEncoder.java#L53-L55 |
sahan/ZombieLink | zombielink/src/main/java/com/lonepulse/zombielink/util/Components.java | Components.isDetached | public static boolean isDetached(InvocationContext context, Class<? extends Annotation> type) {
"""
<p>Determines whether the request definition has <i>detached</i> the given {@link Annotation} type.
This will mute any annotations of the given type which are defined on the endpoint.</p>
<p>See {@link Detach}.<... | java | public static boolean isDetached(InvocationContext context, Class<? extends Annotation> type) {
Method request = context.getRequest();
return request.isAnnotationPresent(Detach.class) &&
Arrays.asList(request.getAnnotation(Detach.class).value()).contains(type);
} | [
"public",
"static",
"boolean",
"isDetached",
"(",
"InvocationContext",
"context",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"type",
")",
"{",
"Method",
"request",
"=",
"context",
".",
"getRequest",
"(",
")",
";",
"return",
"request",
".",
"isAnno... | <p>Determines whether the request definition has <i>detached</i> the given {@link Annotation} type.
This will mute any annotations of the given type which are defined on the endpoint.</p>
<p>See {@link Detach}.</p>
@param context
the {@link InvocationContext} which provides the request definition
<br><br>
@param type... | [
"<p",
">",
"Determines",
"whether",
"the",
"request",
"definition",
"has",
"<i",
">",
"detached<",
"/",
"i",
">",
"the",
"given",
"{",
"@link",
"Annotation",
"}",
"type",
".",
"This",
"will",
"mute",
"any",
"annotations",
"of",
"the",
"given",
"type",
"w... | train | https://github.com/sahan/ZombieLink/blob/a9971add56d4f6919a4a5e84c78e9220011d8982/zombielink/src/main/java/com/lonepulse/zombielink/util/Components.java#L66-L72 |
dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleControl.java | SimpleControl.toggleTooltip | @Override
protected void toggleTooltip(Node reference, Control below) {
"""
Sets the error message as tooltip for the matching control.
@param below The control needed for positioning the tooltip.
@param reference The control which gets the tooltip.
"""
String fieldTooltip = field.getTooltip();
... | java | @Override
protected void toggleTooltip(Node reference, Control below) {
String fieldTooltip = field.getTooltip();
if ((reference.isFocused() || reference.isHover())
&& (!fieldTooltip.equals("") || field.getErrorMessages().size() > 0)) {
tooltip.setText((!fieldTooltip.equals("") ? fieldTooltip +... | [
"@",
"Override",
"protected",
"void",
"toggleTooltip",
"(",
"Node",
"reference",
",",
"Control",
"below",
")",
"{",
"String",
"fieldTooltip",
"=",
"field",
".",
"getTooltip",
"(",
")",
";",
"if",
"(",
"(",
"reference",
".",
"isFocused",
"(",
")",
"||",
"... | Sets the error message as tooltip for the matching control.
@param below The control needed for positioning the tooltip.
@param reference The control which gets the tooltip. | [
"Sets",
"the",
"error",
"message",
"as",
"tooltip",
"for",
"the",
"matching",
"control",
"."
] | train | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/formsfx/view/controls/SimpleControl.java#L161-L185 |
wildfly/wildfly-core | cli/src/main/java/org/jboss/as/cli/impl/VaultConfig.java | VaultConfig.loadExternalFile | static VaultConfig loadExternalFile(File f) throws XMLStreamException {
"""
In the 2.0 xsd the vault is in an external file, which has no namespace, using the output of the vault tool.
@param f the file containing the external vault configuration as generated by the vault tool
@return the vault config
"""
... | java | static VaultConfig loadExternalFile(File f) throws XMLStreamException {
if(f == null) {
throw new IllegalArgumentException("File is null");
}
if(!f.exists()) {
throw new XMLStreamException("Failed to locate vault file " + f.getAbsolutePath());
}
final Vau... | [
"static",
"VaultConfig",
"loadExternalFile",
"(",
"File",
"f",
")",
"throws",
"XMLStreamException",
"{",
"if",
"(",
"f",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"File is null\"",
")",
";",
"}",
"if",
"(",
"!",
"f",
".",
"... | In the 2.0 xsd the vault is in an external file, which has no namespace, using the output of the vault tool.
@param f the file containing the external vault configuration as generated by the vault tool
@return the vault config | [
"In",
"the",
"2",
".",
"0",
"xsd",
"the",
"vault",
"is",
"in",
"an",
"external",
"file",
"which",
"has",
"no",
"namespace",
"using",
"the",
"output",
"of",
"the",
"vault",
"tool",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/impl/VaultConfig.java#L68-L95 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java | SerializationUtils.toJsonString | public static String toJsonString(Object obj, ClassLoader classLoader) {
"""
Serialize an object to JSON string, with a custom class loader.
@param obj
@param classLoader
@return
"""
if (obj == null) {
return "null";
}
ClassLoader oldClassLoader = Thread.currentThread()... | java | public static String toJsonString(Object obj, ClassLoader classLoader) {
if (obj == null) {
return "null";
}
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
if (classLoader != null) {
Thread.currentThread().setContextClassLoader(classL... | [
"public",
"static",
"String",
"toJsonString",
"(",
"Object",
"obj",
",",
"ClassLoader",
"classLoader",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"return",
"\"null\"",
";",
"}",
"ClassLoader",
"oldClassLoader",
"=",
"Thread",
".",
"currentThread",
"... | Serialize an object to JSON string, with a custom class loader.
@param obj
@param classLoader
@return | [
"Serialize",
"an",
"object",
"to",
"JSON",
"string",
"with",
"a",
"custom",
"class",
"loader",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java#L367-L391 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newSecurityException | public static SecurityException newSecurityException(String message, Object... args) {
"""
Constructs and initializes a new {@link SecurityException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link SecurityException ... | java | public static SecurityException newSecurityException(String message, Object... args) {
return newSecurityException(null, message, args);
} | [
"public",
"static",
"SecurityException",
"newSecurityException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newSecurityException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link SecurityException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link SecurityException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {@lin... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"SecurityException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L641-L643 |
facebookarchive/hive-dwrf | hive-dwrf/src/main/java/com/facebook/hive/orc/InStream.java | InStream.create | public static InStream create(String name, FSDataInputStream file, long streamOffset,
int streamLength, CompressionCodec codec, int bufferSize) throws IOException {
"""
This should be used for creating streams to read file metadata, e.g. the footer, not for
data in columns.
"""
return create(name, ... | java | public static InStream create(String name, FSDataInputStream file, long streamOffset,
int streamLength, CompressionCodec codec, int bufferSize) throws IOException {
return create(name, file, streamOffset, streamLength, codec, bufferSize, true, 1);
} | [
"public",
"static",
"InStream",
"create",
"(",
"String",
"name",
",",
"FSDataInputStream",
"file",
",",
"long",
"streamOffset",
",",
"int",
"streamLength",
",",
"CompressionCodec",
"codec",
",",
"int",
"bufferSize",
")",
"throws",
"IOException",
"{",
"return",
"... | This should be used for creating streams to read file metadata, e.g. the footer, not for
data in columns. | [
"This",
"should",
"be",
"used",
"for",
"creating",
"streams",
"to",
"read",
"file",
"metadata",
"e",
".",
"g",
".",
"the",
"footer",
"not",
"for",
"data",
"in",
"columns",
"."
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf/src/main/java/com/facebook/hive/orc/InStream.java#L462-L466 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java | ExpressRouteCrossConnectionsInner.updateTagsAsync | public Observable<ExpressRouteCrossConnectionInner> updateTagsAsync(String resourceGroupName, String crossConnectionName) {
"""
Updates an express route cross connection tags.
@param resourceGroupName The name of the resource group.
@param crossConnectionName The name of the cross connection.
@throws IllegalA... | java | public Observable<ExpressRouteCrossConnectionInner> updateTagsAsync(String resourceGroupName, String crossConnectionName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1<ServiceResponse<ExpressRouteCrossConnectionInner>, ExpressRouteCrossConnectionInner>() {
... | [
"public",
"Observable",
"<",
"ExpressRouteCrossConnectionInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"crossConnectionName",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"crossConnectionName",
"... | Updates an express route cross connection tags.
@param resourceGroupName The name of the resource group.
@param crossConnectionName The name of the cross connection.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"an",
"express",
"route",
"cross",
"connection",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java#L635-L642 |
HeidelTime/heideltime | src/de/unihd/dbs/uima/annotator/heideltime/utilities/DateCalculator.java | DateCalculator.getXNextDay | public static String getXNextDay(String date, Integer x) {
"""
get the x-next day of date.
@param date given date to get new date from
@param x type of temporal event to search for
@return
"""
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String newDate = "";
Calendar c = Calendar... | java | public static String getXNextDay(String date, Integer x) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String newDate = "";
Calendar c = Calendar.getInstance();
try {
c.setTime(formatter.parse(date));
c.add(Calendar.DAY_OF_MONTH, x);
c.getTime();
newDate = formatter.format(c.get... | [
"public",
"static",
"String",
"getXNextDay",
"(",
"String",
"date",
",",
"Integer",
"x",
")",
"{",
"SimpleDateFormat",
"formatter",
"=",
"new",
"SimpleDateFormat",
"(",
"\"yyyy-MM-dd\"",
")",
";",
"String",
"newDate",
"=",
"\"\"",
";",
"Calendar",
"c",
"=",
... | get the x-next day of date.
@param date given date to get new date from
@param x type of temporal event to search for
@return | [
"get",
"the",
"x",
"-",
"next",
"day",
"of",
"date",
"."
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/utilities/DateCalculator.java#L149-L162 |
JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/FloatEvaluator.java | FloatEvaluator.evaluate | public Float evaluate(float fraction, Number startValue, Number endValue) {
"""
This function returns the result of linearly interpolating the start and end values, with
<code>fraction</code> representing the proportion between the start and end values. The
calculation is a simple parametric calculation: <code>r... | java | public Float evaluate(float fraction, Number startValue, Number endValue) {
float startFloat = startValue.floatValue();
return startFloat + fraction * (endValue.floatValue() - startFloat);
} | [
"public",
"Float",
"evaluate",
"(",
"float",
"fraction",
",",
"Number",
"startValue",
",",
"Number",
"endValue",
")",
"{",
"float",
"startFloat",
"=",
"startValue",
".",
"floatValue",
"(",
")",
";",
"return",
"startFloat",
"+",
"fraction",
"*",
"(",
"endValu... | This function returns the result of linearly interpolating the start and end values, with
<code>fraction</code> representing the proportion between the start and end values. The
calculation is a simple parametric calculation: <code>result = x0 + t * (v1 - v0)</code>,
where <code>x0</code> is <code>startValue</code>, <c... | [
"This",
"function",
"returns",
"the",
"result",
"of",
"linearly",
"interpolating",
"the",
"start",
"and",
"end",
"values",
"with",
"<code",
">",
"fraction<",
"/",
"code",
">",
"representing",
"the",
"proportion",
"between",
"the",
"start",
"and",
"end",
"value... | train | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/FloatEvaluator.java#L38-L41 |
google/closure-templates | java/src/com/google/template/soy/soytree/LetContentNode.java | LetContentNode.forVariable | public static LetContentNode forVariable(
int id,
SourceLocation sourceLocation,
String varName,
SourceLocation varNameLocation,
@Nullable SanitizedContentKind contentKind) {
"""
Creates a LetContentNode for a compiler-generated variable. Use this in passes that rewrite the
tree and ... | java | public static LetContentNode forVariable(
int id,
SourceLocation sourceLocation,
String varName,
SourceLocation varNameLocation,
@Nullable SanitizedContentKind contentKind) {
LetContentNode node =
new LetContentNode(id, sourceLocation, varName, varNameLocation, contentKind);
... | [
"public",
"static",
"LetContentNode",
"forVariable",
"(",
"int",
"id",
",",
"SourceLocation",
"sourceLocation",
",",
"String",
"varName",
",",
"SourceLocation",
"varNameLocation",
",",
"@",
"Nullable",
"SanitizedContentKind",
"contentKind",
")",
"{",
"LetContentNode",
... | Creates a LetContentNode for a compiler-generated variable. Use this in passes that rewrite the
tree and introduce local temporary variables. | [
"Creates",
"a",
"LetContentNode",
"for",
"a",
"compiler",
"-",
"generated",
"variable",
".",
"Use",
"this",
"in",
"passes",
"that",
"rewrite",
"the",
"tree",
"and",
"introduce",
"local",
"temporary",
"variables",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/soytree/LetContentNode.java#L46-L60 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/swing/clipboard/ClipboardUtil.java | ClipboardUtil.get | public static Object get(Transferable content, DataFlavor flavor) {
"""
获取剪贴板内容
@param content {@link Transferable}
@param flavor 数据元信息,标识数据类型
@return 剪贴板内容,类型根据flavor不同而不同
"""
if (null != content && content.isDataFlavorSupported(flavor)) {
try {
return content.getTransferData(flavor);
} c... | java | public static Object get(Transferable content, DataFlavor flavor) {
if (null != content && content.isDataFlavorSupported(flavor)) {
try {
return content.getTransferData(flavor);
} catch (UnsupportedFlavorException | IOException e) {
throw new UtilException(e);
}
}
return null;
} | [
"public",
"static",
"Object",
"get",
"(",
"Transferable",
"content",
",",
"DataFlavor",
"flavor",
")",
"{",
"if",
"(",
"null",
"!=",
"content",
"&&",
"content",
".",
"isDataFlavorSupported",
"(",
"flavor",
")",
")",
"{",
"try",
"{",
"return",
"content",
".... | 获取剪贴板内容
@param content {@link Transferable}
@param flavor 数据元信息,标识数据类型
@return 剪贴板内容,类型根据flavor不同而不同 | [
"获取剪贴板内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/swing/clipboard/ClipboardUtil.java#L68-L77 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/ShortField.java | ShortField.getSQLType | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties) {
"""
Get the SQL type of this field.
Typically SHORT or SMALLINT.
@param bIncludeLength Include the field length in this description.
@param properties Database properties to determine the SQL type.
@return The SQL Type.
"""
... | java | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties)
{
String strType = (String)properties.get(DBSQLTypes.SHORT);
if (strType == null)
strType = DBSQLTypes.SMALLINT; // The default SQL Type (Byte)
return strType; // The default SQL Type
... | [
"public",
"String",
"getSQLType",
"(",
"boolean",
"bIncludeLength",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"strType",
"=",
"(",
"String",
")",
"properties",
".",
"get",
"(",
"DBSQLTypes",
".",
"SHORT",
")",
";",
... | Get the SQL type of this field.
Typically SHORT or SMALLINT.
@param bIncludeLength Include the field length in this description.
@param properties Database properties to determine the SQL type.
@return The SQL Type. | [
"Get",
"the",
"SQL",
"type",
"of",
"this",
"field",
".",
"Typically",
"SHORT",
"or",
"SMALLINT",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/ShortField.java#L296-L302 |
google/error-prone | check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java | ASTHelpers.getUpperBound | public static Type getUpperBound(Type type, Types types) {
"""
Returns the upper bound of a type if it has one, or the type itself if not. Correctly handles
wildcards and capture variables.
"""
if (type.hasTag(TypeTag.WILDCARD)) {
return types.wildUpperBound(type);
}
if (type.hasTag(TypeTag... | java | public static Type getUpperBound(Type type, Types types) {
if (type.hasTag(TypeTag.WILDCARD)) {
return types.wildUpperBound(type);
}
if (type.hasTag(TypeTag.TYPEVAR) && ((TypeVar) type).isCaptured()) {
return types.cvarUpperBound(type);
}
if (type.getUpperBound() != null) {
retur... | [
"public",
"static",
"Type",
"getUpperBound",
"(",
"Type",
"type",
",",
"Types",
"types",
")",
"{",
"if",
"(",
"type",
".",
"hasTag",
"(",
"TypeTag",
".",
"WILDCARD",
")",
")",
"{",
"return",
"types",
".",
"wildUpperBound",
"(",
"type",
")",
";",
"}",
... | Returns the upper bound of a type if it has one, or the type itself if not. Correctly handles
wildcards and capture variables. | [
"Returns",
"the",
"upper",
"bound",
"of",
"a",
"type",
"if",
"it",
"has",
"one",
"or",
"the",
"type",
"itself",
"if",
"not",
".",
"Correctly",
"handles",
"wildcards",
"and",
"capture",
"variables",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java#L1004-L1019 |
Shusshu/Android-RecurrencePicker | library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java | Utils.setUpSearchView | public static void setUpSearchView(SearchView view, Activity act) {
"""
This sets up a search view to use Calendar's search suggestions provider
and to allow refining the search.
@param view The {@link android.widget.SearchView} to set up
@param act The activity using the view
"""
SearchManager s... | java | public static void setUpSearchView(SearchView view, Activity act) {
SearchManager searchManager = (SearchManager) act.getSystemService(Context.SEARCH_SERVICE);
view.setSearchableInfo(searchManager.getSearchableInfo(act.getComponentName()));
view.setQueryRefinementEnabled(true);
} | [
"public",
"static",
"void",
"setUpSearchView",
"(",
"SearchView",
"view",
",",
"Activity",
"act",
")",
"{",
"SearchManager",
"searchManager",
"=",
"(",
"SearchManager",
")",
"act",
".",
"getSystemService",
"(",
"Context",
".",
"SEARCH_SERVICE",
")",
";",
"view",... | This sets up a search view to use Calendar's search suggestions provider
and to allow refining the search.
@param view The {@link android.widget.SearchView} to set up
@param act The activity using the view | [
"This",
"sets",
"up",
"a",
"search",
"view",
"to",
"use",
"Calendar",
"s",
"search",
"suggestions",
"provider",
"and",
"to",
"allow",
"refining",
"the",
"search",
"."
] | train | https://github.com/Shusshu/Android-RecurrencePicker/blob/4f0ae74482e4d46d57a8fb13b4b7980a8613f4af/library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java#L682-L686 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/handlers/FileStatusTaskStatusHandler.java | FileStatusTaskStatusHandler.allStatus | private void allStatus(RESTRequest request, RESTResponse response) {
"""
Returns a JSON array of {taskID,taskStatus,taskURL} tuples, representing all the IDs currently being stored.
[ { "taskID" : "123", "taskStatus" : "status" , "taskURL" : "url" }* ]
This method allows for query params to be specified as f... | java | private void allStatus(RESTRequest request, RESTResponse response) {
MultipleRoutingHelper helper = getMultipleRoutingHelper();
Map<String, List<String>> queryParams = new HashMap<String, List<String>>();
for (Entry<String, String[]> entry : request.getParameterMap().entrySet()) {
q... | [
"private",
"void",
"allStatus",
"(",
"RESTRequest",
"request",
",",
"RESTResponse",
"response",
")",
"{",
"MultipleRoutingHelper",
"helper",
"=",
"getMultipleRoutingHelper",
"(",
")",
";",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"queryParams"... | Returns a JSON array of {taskID,taskStatus,taskURL} tuples, representing all the IDs currently being stored.
[ { "taskID" : "123", "taskStatus" : "status" , "taskURL" : "url" }* ]
This method allows for query params to be specified as filters. They key/value of the query param will
represent a property pertaining to ... | [
"Returns",
"a",
"JSON",
"array",
"of",
"{",
"taskID",
"taskStatus",
"taskURL",
"}",
"tuples",
"representing",
"all",
"the",
"IDs",
"currently",
"being",
"stored",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/handlers/FileStatusTaskStatusHandler.java#L97-L113 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicated_server_serviceName_traffic_GET | public ArrayList<String> dedicated_server_serviceName_traffic_GET(String serviceName, OvhTrafficOrderEnum traffic) throws IOException {
"""
Get allowed durations for 'traffic' option
REST: GET /order/dedicated/server/{serviceName}/traffic
@param traffic [required] amount of traffic to allocate
@param serviceN... | java | public ArrayList<String> dedicated_server_serviceName_traffic_GET(String serviceName, OvhTrafficOrderEnum traffic) throws IOException {
String qPath = "/order/dedicated/server/{serviceName}/traffic";
StringBuilder sb = path(qPath, serviceName);
query(sb, "traffic", traffic);
String resp = exec(qPath, "GET", sb.... | [
"public",
"ArrayList",
"<",
"String",
">",
"dedicated_server_serviceName_traffic_GET",
"(",
"String",
"serviceName",
",",
"OvhTrafficOrderEnum",
"traffic",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/dedicated/server/{serviceName}/traffic\"",
";",
"... | Get allowed durations for 'traffic' option
REST: GET /order/dedicated/server/{serviceName}/traffic
@param traffic [required] amount of traffic to allocate
@param serviceName [required] The internal name of your dedicated server | [
"Get",
"allowed",
"durations",
"for",
"traffic",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2241-L2247 |
infinispan/infinispan | query/src/main/java/org/infinispan/query/affinity/FixedShardsDistribution.java | FixedShardsDistribution.populateSegments | private void populateSegments(int[] shardsNumPerServer, List<Set<Integer>> segmentsPerServer, List<Address> nodes) {
"""
Associates segments to each shard.
@param shardsNumPerServer numbers of shards allocated for each server
@param segmentsPerServer the primary owned segments of each server
@param nodes ... | java | private void populateSegments(int[] shardsNumPerServer, List<Set<Integer>> segmentsPerServer, List<Address> nodes) {
int shardId = 0;
int n = 0;
Set<Integer> remainingSegments = new HashSet<>();
for (Address node : nodes) {
Collection<Integer> primarySegments = segmentsPerServer.get(n);... | [
"private",
"void",
"populateSegments",
"(",
"int",
"[",
"]",
"shardsNumPerServer",
",",
"List",
"<",
"Set",
"<",
"Integer",
">",
">",
"segmentsPerServer",
",",
"List",
"<",
"Address",
">",
"nodes",
")",
"{",
"int",
"shardId",
"=",
"0",
";",
"int",
"n",
... | Associates segments to each shard.
@param shardsNumPerServer numbers of shards allocated for each server
@param segmentsPerServer the primary owned segments of each server
@param nodes the members of the cluster | [
"Associates",
"segments",
"to",
"each",
"shard",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/affinity/FixedShardsDistribution.java#L66-L92 |
m-m-m/util | scanner/src/main/java/net/sf/mmm/util/scanner/base/CharSequenceScanner.java | CharSequenceScanner.getOriginalString | public String getOriginalString() {
"""
This method gets the original string to parse.
@see CharSequenceScanner#CharSequenceScanner(String)
@return the original string.
"""
if (this.string != null) {
this.string = new String(this.buffer, this.initialOffset, getLength());
}
return ... | java | public String getOriginalString() {
if (this.string != null) {
this.string = new String(this.buffer, this.initialOffset, getLength());
}
return this.string;
} | [
"public",
"String",
"getOriginalString",
"(",
")",
"{",
"if",
"(",
"this",
".",
"string",
"!=",
"null",
")",
"{",
"this",
".",
"string",
"=",
"new",
"String",
"(",
"this",
".",
"buffer",
",",
"this",
".",
"initialOffset",
",",
"getLength",
"(",
")",
... | This method gets the original string to parse.
@see CharSequenceScanner#CharSequenceScanner(String)
@return the original string. | [
"This",
"method",
"gets",
"the",
"original",
"string",
"to",
"parse",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/scanner/src/main/java/net/sf/mmm/util/scanner/base/CharSequenceScanner.java#L391-L397 |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPCoreUtils.java | MPCoreUtils.getResourceFromJson | public static <T> T getResourceFromJson(Class clazz, JsonObject jsonEntity) {
"""
Static method that transforms a Json Object in a MP Resource.
@param clazz Java Class type of the resource
@param jsonEntity JsonObject to be transformed
@param <T>
@return
"""
return (T) gson.fro... | java | public static <T> T getResourceFromJson(Class clazz, JsonObject jsonEntity) {
return (T) gson.fromJson(jsonEntity, clazz);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getResourceFromJson",
"(",
"Class",
"clazz",
",",
"JsonObject",
"jsonEntity",
")",
"{",
"return",
"(",
"T",
")",
"gson",
".",
"fromJson",
"(",
"jsonEntity",
",",
"clazz",
")",
";",
"}"
] | Static method that transforms a Json Object in a MP Resource.
@param clazz Java Class type of the resource
@param jsonEntity JsonObject to be transformed
@param <T>
@return | [
"Static",
"method",
"that",
"transforms",
"a",
"Json",
"Object",
"in",
"a",
"MP",
"Resource",
"."
] | train | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPCoreUtils.java#L70-L72 |
apereo/cas | support/cas-server-support-throttle-core/src/main/java/org/apereo/cas/web/support/AbstractInMemoryThrottledSubmissionHandlerInterceptorAdapter.java | AbstractInMemoryThrottledSubmissionHandlerInterceptorAdapter.submissionRate | private static double submissionRate(final ZonedDateTime a, final ZonedDateTime b) {
"""
Computes the instantaneous rate in between two given dates corresponding to two submissions.
@param a First date.
@param b Second date.
@return Instantaneous submission rate in submissions/sec, e.g. {@code a - b}.
"""... | java | private static double submissionRate(final ZonedDateTime a, final ZonedDateTime b) {
return SUBMISSION_RATE_DIVIDEND / (a.toInstant().toEpochMilli() - b.toInstant().toEpochMilli());
} | [
"private",
"static",
"double",
"submissionRate",
"(",
"final",
"ZonedDateTime",
"a",
",",
"final",
"ZonedDateTime",
"b",
")",
"{",
"return",
"SUBMISSION_RATE_DIVIDEND",
"/",
"(",
"a",
".",
"toInstant",
"(",
")",
".",
"toEpochMilli",
"(",
")",
"-",
"b",
".",
... | Computes the instantaneous rate in between two given dates corresponding to two submissions.
@param a First date.
@param b Second date.
@return Instantaneous submission rate in submissions/sec, e.g. {@code a - b}. | [
"Computes",
"the",
"instantaneous",
"rate",
"in",
"between",
"two",
"given",
"dates",
"corresponding",
"to",
"two",
"submissions",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-throttle-core/src/main/java/org/apereo/cas/web/support/AbstractInMemoryThrottledSubmissionHandlerInterceptorAdapter.java#L40-L42 |
JohnPersano/SuperToasts | demo/src/main/java/com/github/johnpersano/supertoasts/demo/fragments/PagerFragment.java | PagerFragment.addFragment | @SuppressWarnings( {
"""
Add a Fragment to this PagerFragment.
@param title The title of the {@link android.app.Fragment} to be added
@param fragment The {@link android.app.Fragment} to be added
@return The current PagerFragmentInstance
""""UnusedReturnValue", "WeakerAccess"})
public PagerFragment ... | java | @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public PagerFragment addFragment(String title, Fragment fragment) {
this.mFragmentTitles.add(title);
this.mFragments.add(fragment);
return this;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"UnusedReturnValue\"",
",",
"\"WeakerAccess\"",
"}",
")",
"public",
"PagerFragment",
"addFragment",
"(",
"String",
"title",
",",
"Fragment",
"fragment",
")",
"{",
"this",
".",
"mFragmentTitles",
".",
"add",
"(",
"title",
")",... | Add a Fragment to this PagerFragment.
@param title The title of the {@link android.app.Fragment} to be added
@param fragment The {@link android.app.Fragment} to be added
@return The current PagerFragmentInstance | [
"Add",
"a",
"Fragment",
"to",
"this",
"PagerFragment",
"."
] | train | https://github.com/JohnPersano/SuperToasts/blob/5394db6a2f5c38410586d5d001d61f731da1132a/demo/src/main/java/com/github/johnpersano/supertoasts/demo/fragments/PagerFragment.java#L74-L80 |
icode/ameba | src/main/java/ameba/core/ws/rs/OptionsMethodProcessor.java | OptionsMethodProcessor.generateRespBuilder | protected static Response.ResponseBuilder generateRespBuilder(ExtendedUriInfo extendedUriInfo, MediaType mediaType) {
"""
<p>generateRespBuilder.</p>
@param extendedUriInfo a {@link org.glassfish.jersey.server.ExtendedUriInfo} object.
@param mediaType a {@link javax.ws.rs.core.MediaType} object.
@return... | java | protected static Response.ResponseBuilder generateRespBuilder(ExtendedUriInfo extendedUriInfo, MediaType mediaType) {
return generateRespBuilder(null, extendedUriInfo, mediaType, null);
} | [
"protected",
"static",
"Response",
".",
"ResponseBuilder",
"generateRespBuilder",
"(",
"ExtendedUriInfo",
"extendedUriInfo",
",",
"MediaType",
"mediaType",
")",
"{",
"return",
"generateRespBuilder",
"(",
"null",
",",
"extendedUriInfo",
",",
"mediaType",
",",
"null",
"... | <p>generateRespBuilder.</p>
@param extendedUriInfo a {@link org.glassfish.jersey.server.ExtendedUriInfo} object.
@param mediaType a {@link javax.ws.rs.core.MediaType} object.
@return a {@link javax.ws.rs.core.Response.ResponseBuilder} object. | [
"<p",
">",
"generateRespBuilder",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/core/ws/rs/OptionsMethodProcessor.java#L137-L139 |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/IndexCleanHelper.java | IndexCleanHelper.removeWorkspaceIndex | public void removeWorkspaceIndex(WorkspaceEntry wsConfig, boolean isSystem) throws RepositoryConfigurationException,
IOException {
"""
Remove all file of workspace index.
@param wsConfig - workspace configuration.
@param isSystem - 'true' to clean system workspace.
@throws RepositoryConfigurationE... | java | public void removeWorkspaceIndex(WorkspaceEntry wsConfig, boolean isSystem) throws RepositoryConfigurationException,
IOException
{
String indexDirName = wsConfig.getQueryHandler().getParameterValue(QueryHandlerParams.PARAM_INDEX_DIR);
File indexDir = new File(indexDirName);
if (P... | [
"public",
"void",
"removeWorkspaceIndex",
"(",
"WorkspaceEntry",
"wsConfig",
",",
"boolean",
"isSystem",
")",
"throws",
"RepositoryConfigurationException",
",",
"IOException",
"{",
"String",
"indexDirName",
"=",
"wsConfig",
".",
"getQueryHandler",
"(",
")",
".",
"getP... | Remove all file of workspace index.
@param wsConfig - workspace configuration.
@param isSystem - 'true' to clean system workspace.
@throws RepositoryConfigurationException - exception on parsing workspace configuration
@throws IOException - exception on remove index folder | [
"Remove",
"all",
"file",
"of",
"workspace",
"index",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/IndexCleanHelper.java#L48-L67 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/ShapeModel.java | ShapeModel.tryFindMemberModelByC2jName | private MemberModel tryFindMemberModelByC2jName(String memberC2jName, boolean ignoreCase) {
"""
Tries to find the member model associated with the given c2j member name from this shape
model. Returns the member model if present else returns null.
"""
final List<MemberModel> memberModels = getMembers(... | java | private MemberModel tryFindMemberModelByC2jName(String memberC2jName, boolean ignoreCase) {
final List<MemberModel> memberModels = getMembers();
final String expectedName = ignoreCase ? StringUtils.lowerCase(memberC2jName)
: memberC2jName;
if (me... | [
"private",
"MemberModel",
"tryFindMemberModelByC2jName",
"(",
"String",
"memberC2jName",
",",
"boolean",
"ignoreCase",
")",
"{",
"final",
"List",
"<",
"MemberModel",
">",
"memberModels",
"=",
"getMembers",
"(",
")",
";",
"final",
"String",
"expectedName",
"=",
"ig... | Tries to find the member model associated with the given c2j member name from this shape
model. Returns the member model if present else returns null. | [
"Tries",
"to",
"find",
"the",
"member",
"model",
"associated",
"with",
"the",
"given",
"c2j",
"member",
"name",
"from",
"this",
"shape",
"model",
".",
"Returns",
"the",
"member",
"model",
"if",
"present",
"else",
"returns",
"null",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/model/intermediate/ShapeModel.java#L353-L370 |
samskivert/samskivert | src/main/java/com/samskivert/util/Config.java | Config.instantiateValue | public Object instantiateValue (String name, String defcname)
throws Exception {
"""
Looks up the specified string-valued configuration entry, loads the class with that name and
instantiates a new instance of that class, which is returned.
@param name the name of the property to be fetched.
@param def... | java | public Object instantiateValue (String name, String defcname)
throws Exception
{
return Class.forName(getValue(name, defcname)).newInstance();
} | [
"public",
"Object",
"instantiateValue",
"(",
"String",
"name",
",",
"String",
"defcname",
")",
"throws",
"Exception",
"{",
"return",
"Class",
".",
"forName",
"(",
"getValue",
"(",
"name",
",",
"defcname",
")",
")",
".",
"newInstance",
"(",
")",
";",
"}"
] | Looks up the specified string-valued configuration entry, loads the class with that name and
instantiates a new instance of that class, which is returned.
@param name the name of the property to be fetched.
@param defcname the class name to use if the property is not specified in the config file.
@exception Exception... | [
"Looks",
"up",
"the",
"specified",
"string",
"-",
"valued",
"configuration",
"entry",
"loads",
"the",
"class",
"with",
"that",
"name",
"and",
"instantiates",
"a",
"new",
"instance",
"of",
"that",
"class",
"which",
"is",
"returned",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Config.java#L336-L340 |
korpling/ANNIS | annis-service/src/main/java/annis/administration/AdministrationDao.java | AdministrationDao.listIndexesOnTables | private List<String> listIndexesOnTables(List<String> tables) {
"""
exploits the fact that the index has the same name as the constraint
"""
String sql
= ""
+ "SELECT indexname "
+ "FROM pg_indexes "
+ "WHERE tablename IN (" + StringUtils.repeat("?", ",", tables.size())
+ ") "... | java | private List<String> listIndexesOnTables(List<String> tables)
{
String sql
= ""
+ "SELECT indexname "
+ "FROM pg_indexes "
+ "WHERE tablename IN (" + StringUtils.repeat("?", ",", tables.size())
+ ") "
+ "AND lower(indexname) NOT IN "
+ " (SELECT lower(conname) FROM pg_con... | [
"private",
"List",
"<",
"String",
">",
"listIndexesOnTables",
"(",
"List",
"<",
"String",
">",
"tables",
")",
"{",
"String",
"sql",
"=",
"\"\"",
"+",
"\"SELECT indexname \"",
"+",
"\"FROM pg_indexes \"",
"+",
"\"WHERE tablename IN (\"",
"+",
"StringUtils",
".",
... | exploits the fact that the index has the same name as the constraint | [
"exploits",
"the",
"fact",
"that",
"the",
"index",
"has",
"the",
"same",
"name",
"as",
"the",
"constraint"
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L1781-L1793 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java | ToStringBuilder.reflectionToString | @GwtIncompatible("incompatible method")
public static String reflectionToString(final Object object, final ToStringStyle style, final boolean outputTransients) {
"""
<p>Uses <code>ReflectionToStringBuilder</code> to generate a
<code>toString</code> for the specified object.</p>
@param object the Object to... | java | @GwtIncompatible("incompatible method")
public static String reflectionToString(final Object object, final ToStringStyle style, final boolean outputTransients) {
return ReflectionToStringBuilder.toString(object, style, outputTransients, false, null);
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"String",
"reflectionToString",
"(",
"final",
"Object",
"object",
",",
"final",
"ToStringStyle",
"style",
",",
"final",
"boolean",
"outputTransients",
")",
"{",
"return",
"ReflectionToStr... | <p>Uses <code>ReflectionToStringBuilder</code> to generate a
<code>toString</code> for the specified object.</p>
@param object the Object to be output
@param style the style of the <code>toString</code> to create, may be <code>null</code>
@param outputTransients whether to include transient fields
@return the Strin... | [
"<p",
">",
"Uses",
"<code",
">",
"ReflectionToStringBuilder<",
"/",
"code",
">",
"to",
"generate",
"a",
"<code",
">",
"toString<",
"/",
"code",
">",
"for",
"the",
"specified",
"object",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java#L180-L183 |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/Sprite.java | Sprite.cancelMove | public void cancelMove () {
"""
Cancels any path that the sprite may currently be moving along.
"""
if (_path != null) {
Path oldpath = _path;
_path = null;
oldpath.wasRemoved(this);
if (_observers != null) {
_observers.apply(new Cancelled... | java | public void cancelMove ()
{
if (_path != null) {
Path oldpath = _path;
_path = null;
oldpath.wasRemoved(this);
if (_observers != null) {
_observers.apply(new CancelledOp(this, oldpath));
}
}
} | [
"public",
"void",
"cancelMove",
"(",
")",
"{",
"if",
"(",
"_path",
"!=",
"null",
")",
"{",
"Path",
"oldpath",
"=",
"_path",
";",
"_path",
"=",
"null",
";",
"oldpath",
".",
"wasRemoved",
"(",
"this",
")",
";",
"if",
"(",
"_observers",
"!=",
"null",
... | Cancels any path that the sprite may currently be moving along. | [
"Cancels",
"any",
"path",
"that",
"the",
"sprite",
"may",
"currently",
"be",
"moving",
"along",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/Sprite.java#L240-L250 |
facebook/fresco | drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java | GenericDraweeHierarchy.setChildDrawableAtIndex | private void setChildDrawableAtIndex(int index, @Nullable Drawable drawable) {
"""
Sets the drawable at the specified index while keeping the old scale type and rounding.
In case the given drawable is null, scale type gets cleared too.
"""
if (drawable == null) {
mFadeDrawable.setDrawable(index, nul... | java | private void setChildDrawableAtIndex(int index, @Nullable Drawable drawable) {
if (drawable == null) {
mFadeDrawable.setDrawable(index, null);
return;
}
drawable = WrappingUtils.maybeApplyLeafRounding(drawable, mRoundingParams, mResources);
getParentDrawableAtIndex(index).setDrawable(drawabl... | [
"private",
"void",
"setChildDrawableAtIndex",
"(",
"int",
"index",
",",
"@",
"Nullable",
"Drawable",
"drawable",
")",
"{",
"if",
"(",
"drawable",
"==",
"null",
")",
"{",
"mFadeDrawable",
".",
"setDrawable",
"(",
"index",
",",
"null",
")",
";",
"return",
";... | Sets the drawable at the specified index while keeping the old scale type and rounding.
In case the given drawable is null, scale type gets cleared too. | [
"Sets",
"the",
"drawable",
"at",
"the",
"specified",
"index",
"while",
"keeping",
"the",
"old",
"scale",
"type",
"and",
"rounding",
".",
"In",
"case",
"the",
"given",
"drawable",
"is",
"null",
"scale",
"type",
"gets",
"cleared",
"too",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java#L341-L348 |
Mangopay/mangopay2-java-sdk | src/main/java/com/mangopay/core/UrlTool.java | UrlTool.getRestUrl | public String getRestUrl(String urlKey, Boolean addClientId, Pagination pagination) throws UnsupportedEncodingException {
"""
Gets REST url.
@param urlKey Url key.
@param addClientId Denotes whether client identifier should be composed into final url.
@param pagination Pagination object.
@return Final ... | java | public String getRestUrl(String urlKey, Boolean addClientId, Pagination pagination) throws UnsupportedEncodingException {
return getRestUrl(urlKey, addClientId, pagination, null);
} | [
"public",
"String",
"getRestUrl",
"(",
"String",
"urlKey",
",",
"Boolean",
"addClientId",
",",
"Pagination",
"pagination",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"getRestUrl",
"(",
"urlKey",
",",
"addClientId",
",",
"pagination",
",",
"null",
... | Gets REST url.
@param urlKey Url key.
@param addClientId Denotes whether client identifier should be composed into final url.
@param pagination Pagination object.
@return Final REST url.
@throws UnsupportedEncodingException | [
"Gets",
"REST",
"url",
"."
] | train | https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/UrlTool.java#L71-L73 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.getNetworkConfigurationDiagnosticAsync | public Observable<NetworkConfigurationDiagnosticResponseInner> getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) {
"""
Get network configuration diagnostic.
@param resourceGroupName The name of the resource group.
@p... | java | public Observable<NetworkConfigurationDiagnosticResponseInner> getNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) {
return getNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName... | [
"public",
"Observable",
"<",
"NetworkConfigurationDiagnosticResponseInner",
">",
"getNetworkConfigurationDiagnosticAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"NetworkConfigurationDiagnosticParameters",
"parameters",
")",
"{",
"return",
"... | Get network configuration diagnostic.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param parameters Parameters to get network configuration diagnostic.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observabl... | [
"Get",
"network",
"configuration",
"diagnostic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersInner.java#L2684-L2691 |
micronaut-projects/micronaut-core | aop/src/main/java/io/micronaut/aop/chain/InterceptorChain.java | InterceptorChain.resolveIntroductionInterceptors | @Internal
public static Interceptor[] resolveIntroductionInterceptors(BeanContext beanContext, ExecutableMethod<?, ?> method, Interceptor... interceptors) {
"""
Resolves the interceptors for a method for {@link Introduction} advise. For {@link Introduction} advise
any {@link Around} advise interceptors are ap... | java | @Internal
public static Interceptor[] resolveIntroductionInterceptors(BeanContext beanContext, ExecutableMethod<?, ?> method, Interceptor... interceptors) {
instrumentAnnotationMetadata(beanContext, method);
Interceptor[] aroundInterceptors = resolveAroundInterceptors(beanContext, method, intercepto... | [
"@",
"Internal",
"public",
"static",
"Interceptor",
"[",
"]",
"resolveIntroductionInterceptors",
"(",
"BeanContext",
"beanContext",
",",
"ExecutableMethod",
"<",
"?",
",",
"?",
">",
"method",
",",
"Interceptor",
"...",
"interceptors",
")",
"{",
"instrumentAnnotation... | Resolves the interceptors for a method for {@link Introduction} advise. For {@link Introduction} advise
any {@link Around} advise interceptors are applied first
@param beanContext Bean Context
@param method The method
@param interceptors The array of interceptors
@return The filtered array of interceptors | [
"Resolves",
"the",
"interceptors",
"for",
"a",
"method",
"for",
"{",
"@link",
"Introduction",
"}",
"advise",
".",
"For",
"{",
"@link",
"Introduction",
"}",
"advise",
"any",
"{",
"@link",
"Around",
"}",
"advise",
"interceptors",
"are",
"applied",
"first"
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/aop/src/main/java/io/micronaut/aop/chain/InterceptorChain.java#L185-L199 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/filesystem/PathAlterationObserver.java | PathAlterationObserver.doMatch | private void doMatch(final FileStatusEntry entry, final Path path)
throws IOException {
"""
Fire directory/file change events to the registered listeners.
@param entry The previous file system entry
@param path The current file
"""
if (entry.refresh(path)) {
for (final PathAlterationListene... | java | private void doMatch(final FileStatusEntry entry, final Path path)
throws IOException {
if (entry.refresh(path)) {
for (final PathAlterationListener listener : listeners.values()) {
if (entry.isDirectory()) {
listener.onDirectoryChange(path);
} else {
listener.onFileC... | [
"private",
"void",
"doMatch",
"(",
"final",
"FileStatusEntry",
"entry",
",",
"final",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"entry",
".",
"refresh",
"(",
"path",
")",
")",
"{",
"for",
"(",
"final",
"PathAlterationListener",
"listener"... | Fire directory/file change events to the registered listeners.
@param entry The previous file system entry
@param path The current file | [
"Fire",
"directory",
"/",
"file",
"change",
"events",
"to",
"the",
"registered",
"listeners",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/filesystem/PathAlterationObserver.java#L291-L302 |
bmwcarit/joynr | java/javaapi/src/main/java/io/joynr/provider/AbstractSubscriptionPublisher.java | AbstractSubscriptionPublisher.onAttributeValueChanged | protected void onAttributeValueChanged(String attributeName, Object value) {
"""
Called by generated {@code <Interface>AbstractProvider} classes to notify
all registered listeners about the attribute change.
<p>
NOTE: Provider implementations should _not_ call this method but use
attribute specific {@code <Int... | java | protected void onAttributeValueChanged(String attributeName, Object value) {
if (!attributeListeners.containsKey(attributeName)) {
return;
}
List<AttributeListener> listeners = attributeListeners.get(attributeName);
synchronized (listeners) {
for (AttributeListene... | [
"protected",
"void",
"onAttributeValueChanged",
"(",
"String",
"attributeName",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"!",
"attributeListeners",
".",
"containsKey",
"(",
"attributeName",
")",
")",
"{",
"return",
";",
"}",
"List",
"<",
"AttributeListener",... | Called by generated {@code <Interface>AbstractProvider} classes to notify
all registered listeners about the attribute change.
<p>
NOTE: Provider implementations should _not_ call this method but use
attribute specific {@code <Interface>AbstractProvider.<attribute>Changed}
methods.
@param attributeName the attribute n... | [
"Called",
"by",
"generated",
"{",
"@code",
"<Interface",
">",
"AbstractProvider",
"}",
"classes",
"to",
"notify",
"all",
"registered",
"listeners",
"about",
"the",
"attribute",
"change",
".",
"<p",
">",
"NOTE",
":",
"Provider",
"implementations",
"should",
"_not... | train | https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/javaapi/src/main/java/io/joynr/provider/AbstractSubscriptionPublisher.java#L61-L71 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java | ZooKeeper.setACL | public Stat setACL(final String path, List<ACL> acl, int version)
throws KeeperException, InterruptedException {
"""
Set the ACL for the node of the given path if such a node exists and the
given version matches the version of the node. Return the stat of the
node.
<p>
A KeeperException with error ... | java | public Stat setACL(final String path, List<ACL> acl, int version)
throws KeeperException, InterruptedException {
verbotenThreadCheck();
final String clientPath = path;
PathUtils.validatePath(clientPath);
final String serverPath = prependChroot(clientPath);
RequestHe... | [
"public",
"Stat",
"setACL",
"(",
"final",
"String",
"path",
",",
"List",
"<",
"ACL",
">",
"acl",
",",
"int",
"version",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"verbotenThreadCheck",
"(",
")",
";",
"final",
"String",
"clientPath",
... | Set the ACL for the node of the given path if such a node exists and the
given version matches the version of the node. Return the stat of the
node.
<p>
A KeeperException with error code KeeperException.NoNode will be thrown
if no node with the given path exists.
<p>
A KeeperException with error code KeeperException.Ba... | [
"Set",
"the",
"ACL",
"for",
"the",
"node",
"of",
"the",
"given",
"path",
"if",
"such",
"a",
"node",
"exists",
"and",
"the",
"given",
"version",
"matches",
"the",
"version",
"of",
"the",
"node",
".",
"Return",
"the",
"stat",
"of",
"the",
"node",
".",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java#L1208-L1232 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/util/threading/DispatchQueue.java | DispatchQueue.dispatchAsyncOnce | public boolean dispatchAsyncOnce(DispatchTask task, long delayMillis) {
"""
Add <code>{@link DispatchTask}</code> to the queue if it's not already on the queue (this
way you can ensure only one instance of the task is scheduled at a time). After the task is
executed you can schedule it again.
@return true if ... | java | public boolean dispatchAsyncOnce(DispatchTask task, long delayMillis) {
if (!task.isScheduled()) {
dispatchAsync(task, delayMillis);
return true;
}
return false;
} | [
"public",
"boolean",
"dispatchAsyncOnce",
"(",
"DispatchTask",
"task",
",",
"long",
"delayMillis",
")",
"{",
"if",
"(",
"!",
"task",
".",
"isScheduled",
"(",
")",
")",
"{",
"dispatchAsync",
"(",
"task",
",",
"delayMillis",
")",
";",
"return",
"true",
";",
... | Add <code>{@link DispatchTask}</code> to the queue if it's not already on the queue (this
way you can ensure only one instance of the task is scheduled at a time). After the task is
executed you can schedule it again.
@return true if task was scheduled | [
"Add",
"<code",
">",
"{",
"@link",
"DispatchTask",
"}",
"<",
"/",
"code",
">",
"to",
"the",
"queue",
"if",
"it",
"s",
"not",
"already",
"on",
"the",
"queue",
"(",
"this",
"way",
"you",
"can",
"ensure",
"only",
"one",
"instance",
"of",
"the",
"task",
... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/threading/DispatchQueue.java#L83-L89 |
tango-controls/JTango | server/src/main/java/org/tango/server/events/EventImpl.java | EventImpl.pushDevFailedEvent | protected void pushDevFailedEvent(final DevFailed devFailed, ZMQ.Socket eventSocket) throws DevFailed {
"""
Fire an event containing a DevFailed.
@param devFailed the failed object to be sent.
@param eventSocket
@throws DevFailed
"""
xlogger.entry();
eventTrigger.updateProperties();
... | java | protected void pushDevFailedEvent(final DevFailed devFailed, ZMQ.Socket eventSocket) throws DevFailed {
xlogger.entry();
eventTrigger.updateProperties();
eventTrigger.setError(devFailed);
if (isSendEvent()) {
try {
synchronized (eventSocket) {
... | [
"protected",
"void",
"pushDevFailedEvent",
"(",
"final",
"DevFailed",
"devFailed",
",",
"ZMQ",
".",
"Socket",
"eventSocket",
")",
"throws",
"DevFailed",
"{",
"xlogger",
".",
"entry",
"(",
")",
";",
"eventTrigger",
".",
"updateProperties",
"(",
")",
";",
"event... | Fire an event containing a DevFailed.
@param devFailed the failed object to be sent.
@param eventSocket
@throws DevFailed | [
"Fire",
"an",
"event",
"containing",
"a",
"DevFailed",
"."
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventImpl.java#L261-L275 |
vinta/pangu.java | src/main/java/ws/vinta/pangu/Pangu.java | Pangu.spacingFile | public void spacingFile(File inputFile, File outputFile) throws IOException {
"""
Performs a paranoid text spacing on {@code inputFile} and generate a new file {@code outputFile}.
@param inputFile an existing file to process, must not be {@code null}.
@param outputFile the processed file, must not be {@code ... | java | public void spacingFile(File inputFile, File outputFile) throws IOException {
// TODO: support charset
FileReader fr = new FileReader(inputFile);
BufferedReader br = new BufferedReader(fr);
outputFile.getParentFile().mkdirs();
FileWriter fw = new FileWriter(outputFile, false);
... | [
"public",
"void",
"spacingFile",
"(",
"File",
"inputFile",
",",
"File",
"outputFile",
")",
"throws",
"IOException",
"{",
"// TODO: support charset",
"FileReader",
"fr",
"=",
"new",
"FileReader",
"(",
"inputFile",
")",
";",
"BufferedReader",
"br",
"=",
"new",
"Bu... | Performs a paranoid text spacing on {@code inputFile} and generate a new file {@code outputFile}.
@param inputFile an existing file to process, must not be {@code null}.
@param outputFile the processed file, must not be {@code null}.
@throws IOException if an error occurs.
@since 1.1.0 | [
"Performs",
"a",
"paranoid",
"text",
"spacing",
"on",
"{",
"@code",
"inputFile",
"}",
"and",
"generate",
"a",
"new",
"file",
"{",
"@code",
"outputFile",
"}",
"."
] | train | https://github.com/vinta/pangu.java/blob/a81ce9c0cfd5122a3d4234b95c250fd57afd7f34/src/main/java/ws/vinta/pangu/Pangu.java#L143-L174 |
recruit-mp/android-RMP-Appirater | library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java | RmpAppirater.setReminderClickDate | public static void setReminderClickDate(Context context, Date reminderClickDate) {
"""
Modify internal value.
<p/>
If you use this method, you might need to have a good understanding of this class code.
@param context Context
@param reminderClickDate Date of "Remind me later" button clicked.
""... | java | public static void setReminderClickDate(Context context, Date reminderClickDate) {
final long reminderClickDateMills = ((reminderClickDate != null) ? reminderClickDate.getTime() : 0);
SharedPreferences prefs = getSharedPreferences(context);
SharedPreferences.Editor prefsEditor = prefs.edit();
... | [
"public",
"static",
"void",
"setReminderClickDate",
"(",
"Context",
"context",
",",
"Date",
"reminderClickDate",
")",
"{",
"final",
"long",
"reminderClickDateMills",
"=",
"(",
"(",
"reminderClickDate",
"!=",
"null",
")",
"?",
"reminderClickDate",
".",
"getTime",
"... | Modify internal value.
<p/>
If you use this method, you might need to have a good understanding of this class code.
@param context Context
@param reminderClickDate Date of "Remind me later" button clicked. | [
"Modify",
"internal",
"value",
".",
"<p",
"/",
">",
"If",
"you",
"use",
"this",
"method",
"you",
"might",
"need",
"to",
"have",
"a",
"good",
"understanding",
"of",
"this",
"class",
"code",
"."
] | train | https://github.com/recruit-mp/android-RMP-Appirater/blob/14fcdf110dfb97120303f39aab1de9393e84b90a/library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java#L377-L386 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeHelpers.java | TreeHelpers.setSelected | protected static void setSelected(TreeElement node, String selected, ServletRequest request) {
"""
Recursive routine to set the selected node. This will set the selected node
and clear the selection on all other nodes. It will walk the full tree.
@param node
@param selected
"""
assert(node != null... | java | protected static void setSelected(TreeElement node, String selected, ServletRequest request)
{
assert(node != null) : "parameter 'node' must not be null";
assert(selected != null) : "parameter 'selected' must not be null";
assert(request != null) : "parameter 'requested' must not be null";
... | [
"protected",
"static",
"void",
"setSelected",
"(",
"TreeElement",
"node",
",",
"String",
"selected",
",",
"ServletRequest",
"request",
")",
"{",
"assert",
"(",
"node",
"!=",
"null",
")",
":",
"\"parameter 'node' must not be null\"",
";",
"assert",
"(",
"selected",... | Recursive routine to set the selected node. This will set the selected node
and clear the selection on all other nodes. It will walk the full tree.
@param node
@param selected | [
"Recursive",
"routine",
"to",
"set",
"the",
"selected",
"node",
".",
"This",
"will",
"set",
"the",
"selected",
"node",
"and",
"clear",
"the",
"selection",
"on",
"all",
"other",
"nodes",
".",
"It",
"will",
"walk",
"the",
"full",
"tree",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeHelpers.java#L83-L105 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/config/ServiceKernel.java | ServiceKernel.defineService | protected <T extends IService, Q extends T> void defineService(Class<? extends T> service, Q defaultImplementation) {
"""
Defines a service provided by this ServiceKernel
@param service - the service to provide
@param defaultImplementation - the default implementation of this service
"""
if( !_defining... | java | protected <T extends IService, Q extends T> void defineService(Class<? extends T> service, Q defaultImplementation)
{
if( !_definingServices )
{
throw new IllegalStateException( "Service definition must be done only in the defineServices() method." );
}
if( !service.isInterface() )
{
t... | [
"protected",
"<",
"T",
"extends",
"IService",
",",
"Q",
"extends",
"T",
">",
"void",
"defineService",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"service",
",",
"Q",
"defaultImplementation",
")",
"{",
"if",
"(",
"!",
"_definingServices",
")",
"{",
"thr... | Defines a service provided by this ServiceKernel
@param service - the service to provide
@param defaultImplementation - the default implementation of this service | [
"Defines",
"a",
"service",
"provided",
"by",
"this",
"ServiceKernel"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/config/ServiceKernel.java#L123-L143 |
facebookarchive/hive-dwrf | hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java | Slice.compareTo | @SuppressWarnings("ObjectEquality")
public int compareTo(int offset, int length, Slice that, int otherOffset, int otherLength) {
"""
Compares a portion of this slice with a portion of the specified slice. Equality is
solely based on the contents of the slice.
"""
return compareTo(offset, length, ... | java | @SuppressWarnings("ObjectEquality")
public int compareTo(int offset, int length, Slice that, int otherOffset, int otherLength)
{
return compareTo(offset, length, that.base, otherOffset, otherLength);
} | [
"@",
"SuppressWarnings",
"(",
"\"ObjectEquality\"",
")",
"public",
"int",
"compareTo",
"(",
"int",
"offset",
",",
"int",
"length",
",",
"Slice",
"that",
",",
"int",
"otherOffset",
",",
"int",
"otherLength",
")",
"{",
"return",
"compareTo",
"(",
"offset",
","... | Compares a portion of this slice with a portion of the specified slice. Equality is
solely based on the contents of the slice. | [
"Compares",
"a",
"portion",
"of",
"this",
"slice",
"with",
"a",
"portion",
"of",
"the",
"specified",
"slice",
".",
"Equality",
"is",
"solely",
"based",
"on",
"the",
"contents",
"of",
"the",
"slice",
"."
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java#L600-L604 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java | LineSegment.subSegment | public LineSegment subSegment(double offset, double length) {
"""
LineSegment that starts at offset from start and runs for length towards end point
@param offset offset applied at begin of line
@param length length of the new segment
@return new LineSegment computed
"""
Point subSegmentStart = po... | java | public LineSegment subSegment(double offset, double length) {
Point subSegmentStart = pointAlongLineSegment(offset);
Point subSegmentEnd = pointAlongLineSegment(offset + length);
return new LineSegment(subSegmentStart, subSegmentEnd);
} | [
"public",
"LineSegment",
"subSegment",
"(",
"double",
"offset",
",",
"double",
"length",
")",
"{",
"Point",
"subSegmentStart",
"=",
"pointAlongLineSegment",
"(",
"offset",
")",
";",
"Point",
"subSegmentEnd",
"=",
"pointAlongLineSegment",
"(",
"offset",
"+",
"lengt... | LineSegment that starts at offset from start and runs for length towards end point
@param offset offset applied at begin of line
@param length length of the new segment
@return new LineSegment computed | [
"LineSegment",
"that",
"starts",
"at",
"offset",
"from",
"start",
"and",
"runs",
"for",
"length",
"towards",
"end",
"point"
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/LineSegment.java#L231-L235 |
ivanceras/orm | src/main/java/com/ivanceras/db/server/core/DB_Jdbc.java | DB_Jdbc.executeSelect | public DAO[] executeSelect(String sql, Object[] parameters)
throws DatabaseException {
"""
Execute generic SQL statement
@param sql
@param parameters
@return
@throws DatabaseException
"""
ResultSet rs = executeSelectSQL(sql, parameters, null, false);
return resultSetToDAO(rs, null);
} | java | public DAO[] executeSelect(String sql, Object[] parameters)
throws DatabaseException {
ResultSet rs = executeSelectSQL(sql, parameters, null, false);
return resultSetToDAO(rs, null);
} | [
"public",
"DAO",
"[",
"]",
"executeSelect",
"(",
"String",
"sql",
",",
"Object",
"[",
"]",
"parameters",
")",
"throws",
"DatabaseException",
"{",
"ResultSet",
"rs",
"=",
"executeSelectSQL",
"(",
"sql",
",",
"parameters",
",",
"null",
",",
"false",
")",
";"... | Execute generic SQL statement
@param sql
@param parameters
@return
@throws DatabaseException | [
"Execute",
"generic",
"SQL",
"statement"
] | train | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/core/DB_Jdbc.java#L330-L334 |
CloudSlang/cs-actions | cs-powershell/src/main/java/io/cloudslang/content/entities/EncoderDecoder.java | EncoderDecoder.encodeStringInBase64 | public static String encodeStringInBase64(String str, Charset charset) {
"""
Encodes a string to base64.
@param str The string value to encode.
@param charset The encoding charset used to obtain the byte sequence of the string.
@return The encoded byte sequence using the base64 encoding.
"""
r... | java | public static String encodeStringInBase64(String str, Charset charset) {
return new String(Base64.encodeBase64(str.getBytes(charset)));
} | [
"public",
"static",
"String",
"encodeStringInBase64",
"(",
"String",
"str",
",",
"Charset",
"charset",
")",
"{",
"return",
"new",
"String",
"(",
"Base64",
".",
"encodeBase64",
"(",
"str",
".",
"getBytes",
"(",
"charset",
")",
")",
")",
";",
"}"
] | Encodes a string to base64.
@param str The string value to encode.
@param charset The encoding charset used to obtain the byte sequence of the string.
@return The encoded byte sequence using the base64 encoding. | [
"Encodes",
"a",
"string",
"to",
"base64",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-powershell/src/main/java/io/cloudslang/content/entities/EncoderDecoder.java#L36-L38 |
m-m-m/util | reflect/src/main/java/net/sf/mmm/util/reflect/base/AbstractGenericType.java | AbstractGenericType.resolveTypeVariable | protected Type resolveTypeVariable(TypeVariable<?> typeVariable, GenericType<?> declaringType) {
"""
This method resolves the given {@code typeVariable} in the context of the given {@code declaringType}.
@param typeVariable the {@link TypeVariable} to resolve.
@param declaringType the {@link GenericType} where... | java | protected Type resolveTypeVariable(TypeVariable<?> typeVariable, GenericType<?> declaringType) {
GenericDeclaration genericDeclaration = typeVariable.getGenericDeclaration();
if (genericDeclaration instanceof Class<?>) {
Class<?> declaringClass = (Class<?>) genericDeclaration;
return resolveTy... | [
"protected",
"Type",
"resolveTypeVariable",
"(",
"TypeVariable",
"<",
"?",
">",
"typeVariable",
",",
"GenericType",
"<",
"?",
">",
"declaringType",
")",
"{",
"GenericDeclaration",
"genericDeclaration",
"=",
"typeVariable",
".",
"getGenericDeclaration",
"(",
")",
";"... | This method resolves the given {@code typeVariable} in the context of the given {@code declaringType}.
@param typeVariable the {@link TypeVariable} to resolve.
@param declaringType the {@link GenericType} where the given {@code typeVariable} occurs or is replaced.
@return the resolved {@link Type} or {@code null} if t... | [
"This",
"method",
"resolves",
"the",
"given",
"{",
"@code",
"typeVariable",
"}",
"in",
"the",
"context",
"of",
"the",
"given",
"{",
"@code",
"declaringType",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/reflect/src/main/java/net/sf/mmm/util/reflect/base/AbstractGenericType.java#L255-L263 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java | BytecodeUtils.numericConversion | public static Expression numericConversion(final Expression expr, final Type to) {
"""
Returns an expression that does a numeric conversion cast from the given expression to the
given type.
@throws IllegalArgumentException if either the expression or the target type is not a numeric
primitive
"""
if (... | java | public static Expression numericConversion(final Expression expr, final Type to) {
if (to.equals(expr.resultType())) {
return expr;
}
if (!isNumericPrimitive(to) || !isNumericPrimitive(expr.resultType())) {
throw new IllegalArgumentException("Cannot convert from " + expr.resultType() + " to " + ... | [
"public",
"static",
"Expression",
"numericConversion",
"(",
"final",
"Expression",
"expr",
",",
"final",
"Type",
"to",
")",
"{",
"if",
"(",
"to",
".",
"equals",
"(",
"expr",
".",
"resultType",
"(",
")",
")",
")",
"{",
"return",
"expr",
";",
"}",
"if",
... | Returns an expression that does a numeric conversion cast from the given expression to the
given type.
@throws IllegalArgumentException if either the expression or the target type is not a numeric
primitive | [
"Returns",
"an",
"expression",
"that",
"does",
"a",
"numeric",
"conversion",
"cast",
"from",
"the",
"given",
"expression",
"to",
"the",
"given",
"type",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/BytecodeUtils.java#L409-L423 |
vsima/uber-java-client | src/main/java/com/victorsima/uber/Utils.java | Utils.generateAuthorizeUrl | public static String generateAuthorizeUrl(String oAuthUri, String clientId, String[] scope) {
"""
Generates the initial url for the OAuth authorization flow
@return oauth authorize url
"""
StringBuilder sb = new StringBuilder(oAuthUri);
sb.append("/oauth/authorize?response_type=code");
... | java | public static String generateAuthorizeUrl(String oAuthUri, String clientId, String[] scope){
StringBuilder sb = new StringBuilder(oAuthUri);
sb.append("/oauth/authorize?response_type=code");
sb.append("&client_id=" + clientId);
if (scope != null) {
sb.append("&scope=");
... | [
"public",
"static",
"String",
"generateAuthorizeUrl",
"(",
"String",
"oAuthUri",
",",
"String",
"clientId",
",",
"String",
"[",
"]",
"scope",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"oAuthUri",
")",
";",
"sb",
".",
"append",
"(",
... | Generates the initial url for the OAuth authorization flow
@return oauth authorize url | [
"Generates",
"the",
"initial",
"url",
"for",
"the",
"OAuth",
"authorization",
"flow"
] | train | https://github.com/vsima/uber-java-client/blob/7cb081728db6286d949024c1b4c85dd74d275472/src/main/java/com/victorsima/uber/Utils.java#L40-L54 |
blackfizz/EazeGraph | EazeGraphLibrary/src/main/java/org/eazegraph/lib/utils/Utils.java | Utils.calculatePointDiff | public static void calculatePointDiff(Point2D _P1, Point2D _P2, Point2D _Result, float _Multiplier) {
"""
Calculates the middle point between two points and multiplies its coordinates with the given
smoothness _Mulitplier.
@param _P1 First point
@param _P2 Second point
@param _Result ... | java | public static void calculatePointDiff(Point2D _P1, Point2D _P2, Point2D _Result, float _Multiplier) {
float diffX = _P2.getX() - _P1.getX();
float diffY = _P2.getY() - _P1.getY();
_Result.setX(_P1.getX() + (diffX * _Multiplier));
_Result.setY(_P1.getY() + (diffY * _Multiplier));
} | [
"public",
"static",
"void",
"calculatePointDiff",
"(",
"Point2D",
"_P1",
",",
"Point2D",
"_P2",
",",
"Point2D",
"_Result",
",",
"float",
"_Multiplier",
")",
"{",
"float",
"diffX",
"=",
"_P2",
".",
"getX",
"(",
")",
"-",
"_P1",
".",
"getX",
"(",
")",
";... | Calculates the middle point between two points and multiplies its coordinates with the given
smoothness _Mulitplier.
@param _P1 First point
@param _P2 Second point
@param _Result Resulting point
@param _Multiplier Smoothness multiplier | [
"Calculates",
"the",
"middle",
"point",
"between",
"two",
"points",
"and",
"multiplies",
"its",
"coordinates",
"with",
"the",
"given",
"smoothness",
"_Mulitplier",
"."
] | train | https://github.com/blackfizz/EazeGraph/blob/ce5e68ecc70e154f83bbb2fcce1a970db125c1e6/EazeGraphLibrary/src/main/java/org/eazegraph/lib/utils/Utils.java#L58-L63 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/Preconditions.java | Preconditions.isNotNull | public static <E> E isNotNull(E argument, String argName) {
"""
Tests if a string is not null.
@param argument the string tested to see if it is not null.
@param argName the string name (used in message if an error is thrown).
@return the string argument that was tested.
@throws java.lang.IllegalArgumentExc... | java | public static <E> E isNotNull(E argument, String argName) {
if (argument == null) {
throw new IllegalArgumentException(format("argument '%s' can't be null", argName));
}
return argument;
} | [
"public",
"static",
"<",
"E",
">",
"E",
"isNotNull",
"(",
"E",
"argument",
",",
"String",
"argName",
")",
"{",
"if",
"(",
"argument",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"format",
"(",
"\"argument '%s' can't be null\"",
"... | Tests if a string is not null.
@param argument the string tested to see if it is not null.
@param argName the string name (used in message if an error is thrown).
@return the string argument that was tested.
@throws java.lang.IllegalArgumentException if the string is null. | [
"Tests",
"if",
"a",
"string",
"is",
"not",
"null",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/Preconditions.java#L105-L111 |
xqbase/util | util/src/main/java/com/xqbase/util/Numbers.java | Numbers.parseInt | public static int parseInt(String s, int i) {
"""
Parse an <b>int</b> with a given default value <b>i</b>
@return default value if null or not parsable
"""
if (s == null) {
return i;
}
try {
return Integer.parseInt(s.trim());
} catch (NumberFormatException e) {
return i;
}
} | java | public static int parseInt(String s, int i) {
if (s == null) {
return i;
}
try {
return Integer.parseInt(s.trim());
} catch (NumberFormatException e) {
return i;
}
} | [
"public",
"static",
"int",
"parseInt",
"(",
"String",
"s",
",",
"int",
"i",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"i",
";",
"}",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"s",
".",
"trim",
"(",
")",
")",
";",
... | Parse an <b>int</b> with a given default value <b>i</b>
@return default value if null or not parsable | [
"Parse",
"an",
"<b",
">",
"int<",
"/",
"b",
">",
"with",
"a",
"given",
"default",
"value",
"<b",
">",
"i<",
"/",
"b",
">"
] | train | https://github.com/xqbase/util/blob/e7b9167b6c701b9eec988a9d1e68446cef5ef420/util/src/main/java/com/xqbase/util/Numbers.java#L29-L38 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java | ConfigurationReader.parseFilterConfig | private void parseFilterConfig(final Node node, final ConfigSettings config) {
"""
Parses the filter parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings
"""
String name;
Node nnode;
final NodeList list = node.getChildNodes();
final ... | java | private void parseFilterConfig(final Node node, final ConfigSettings config)
{
String name;
Node nnode;
final NodeList list = node.getChildNodes();
final int length = list.getLength();
for (int i = 0; i < length; i++) {
nnode = list.item(i);
name = nnode.getNodeName().toUpperCase();
if (name.equ... | [
"private",
"void",
"parseFilterConfig",
"(",
"final",
"Node",
"node",
",",
"final",
"ConfigSettings",
"config",
")",
"{",
"String",
"name",
";",
"Node",
"nnode",
";",
"final",
"NodeList",
"list",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
"final",
"... | Parses the filter parameter section.
@param node
Reference to the current used xml node
@param config
Reference to the ConfigSettings | [
"Parses",
"the",
"filter",
"parameter",
"section",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/ConfigurationReader.java#L265-L283 |
lessthanoptimal/BoofCV | main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/EstimatePlaneAtInfinityGivenK.java | EstimatePlaneAtInfinityGivenK.estimatePlaneAtInfinity | public boolean estimatePlaneAtInfinity( DMatrixRMaj P2 , Vector3D_F64 v ) {
"""
Computes the plane at infinity
@param P2 (Input) projective camera matrix for view 2. Not modified.
@param v (Output) plane at infinity
@return true if successful or false if it failed
"""
PerspectiveOps.projectionSplit(P2,Q... | java | public boolean estimatePlaneAtInfinity( DMatrixRMaj P2 , Vector3D_F64 v ) {
PerspectiveOps.projectionSplit(P2,Q2,q2);
// inv(K2)*(Q2*K1 + q2*v')
CommonOps_DDF3.mult(K2_inv,q2,t2);
CommonOps_DDF3.mult(K2_inv,Q2,tmpA);
CommonOps_DDF3.mult(tmpA,K1,tmpB);
// Find the rotation matrix R*t2 = [||t2||,0,0]^T
co... | [
"public",
"boolean",
"estimatePlaneAtInfinity",
"(",
"DMatrixRMaj",
"P2",
",",
"Vector3D_F64",
"v",
")",
"{",
"PerspectiveOps",
".",
"projectionSplit",
"(",
"P2",
",",
"Q2",
",",
"q2",
")",
";",
"// inv(K2)*(Q2*K1 + q2*v')",
"CommonOps_DDF3",
".",
"mult",
"(",
"... | Computes the plane at infinity
@param P2 (Input) projective camera matrix for view 2. Not modified.
@param v (Output) plane at infinity
@return true if successful or false if it failed | [
"Computes",
"the",
"plane",
"at",
"infinity"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-calibration/src/main/java/boofcv/alg/geo/selfcalib/EstimatePlaneAtInfinityGivenK.java#L88-L116 |
zerodhatech/javakiteconnect | kiteconnect/src/com/zerodhatech/kiteconnect/KiteConnect.java | KiteConnect.renewAccessToken | public TokenSet renewAccessToken(String refreshToken, String apiSecret) throws IOException, KiteException, JSONException {
"""
Get a new access token using refresh token.
@param refreshToken is the refresh token obtained after generateSession.
@param apiSecret is unique for each app.
@return TokenSet contains u... | java | public TokenSet renewAccessToken(String refreshToken, String apiSecret) throws IOException, KiteException, JSONException {
String hashableText = this.apiKey + refreshToken + apiSecret;
String sha256hex = sha256Hex(hashableText);
Map<String, Object> params = new HashMap<>();
params.put("... | [
"public",
"TokenSet",
"renewAccessToken",
"(",
"String",
"refreshToken",
",",
"String",
"apiSecret",
")",
"throws",
"IOException",
",",
"KiteException",
",",
"JSONException",
"{",
"String",
"hashableText",
"=",
"this",
".",
"apiKey",
"+",
"refreshToken",
"+",
"api... | Get a new access token using refresh token.
@param refreshToken is the refresh token obtained after generateSession.
@param apiSecret is unique for each app.
@return TokenSet contains user id, refresh token, api secret.
@throws IOException is thrown when there is connection error.
@throws KiteException is thrown for al... | [
"Get",
"a",
"new",
"access",
"token",
"using",
"refresh",
"token",
"."
] | train | https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/kiteconnect/KiteConnect.java#L189-L200 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/MPXReader.java | MPXReader.populateCurrencySettings | private void populateCurrencySettings(Record record, ProjectProperties properties) {
"""
Populates currency settings.
@param record MPX record
@param properties project properties
"""
properties.setCurrencySymbol(record.getString(0));
properties.setSymbolPosition(record.getCurrencySymbolPositio... | java | private void populateCurrencySettings(Record record, ProjectProperties properties)
{
properties.setCurrencySymbol(record.getString(0));
properties.setSymbolPosition(record.getCurrencySymbolPosition(1));
properties.setCurrencyDigits(record.getInteger(2));
Character c = record.getCharacter(3);... | [
"private",
"void",
"populateCurrencySettings",
"(",
"Record",
"record",
",",
"ProjectProperties",
"properties",
")",
"{",
"properties",
".",
"setCurrencySymbol",
"(",
"record",
".",
"getString",
"(",
"0",
")",
")",
";",
"properties",
".",
"setSymbolPosition",
"(",... | Populates currency settings.
@param record MPX record
@param properties project properties | [
"Populates",
"currency",
"settings",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/MPXReader.java#L483-L500 |
talsma-ict/umldoclet | src/main/java/nl/talsmasoftware/umldoclet/rendering/indent/IndentingWriter.java | IndentingWriter.withIndentation | public IndentingWriter withIndentation(Indentation newIndentation) {
"""
Returns an indenting writer with the new indentation.
<p>
Please note: Already written lines will not be modified to accomodate the new indentation.
@param newIndentation The new indentation to apply to this writer (optional).
@return E... | java | public IndentingWriter withIndentation(Indentation newIndentation) {
return newIndentation == null || this.indentation.equals(newIndentation) ? this
: new IndentingWriter(delegate, newIndentation, lastWritten, addWhitespace.get());
} | [
"public",
"IndentingWriter",
"withIndentation",
"(",
"Indentation",
"newIndentation",
")",
"{",
"return",
"newIndentation",
"==",
"null",
"||",
"this",
".",
"indentation",
".",
"equals",
"(",
"newIndentation",
")",
"?",
"this",
":",
"new",
"IndentingWriter",
"(",
... | Returns an indenting writer with the new indentation.
<p>
Please note: Already written lines will not be modified to accomodate the new indentation.
@param newIndentation The new indentation to apply to this writer (optional).
@return Either this writer if the indentation is already correct,
or a new IndentingWriter w... | [
"Returns",
"an",
"indenting",
"writer",
"with",
"the",
"new",
"indentation",
".",
"<p",
">",
"Please",
"note",
":",
"Already",
"written",
"lines",
"will",
"not",
"be",
"modified",
"to",
"accomodate",
"the",
"new",
"indentation",
"."
] | train | https://github.com/talsma-ict/umldoclet/blob/373b23f2646603fddca4a495e9eccbb4a4491fdf/src/main/java/nl/talsmasoftware/umldoclet/rendering/indent/IndentingWriter.java#L82-L85 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/Mac.java | Mac.update | public final void update(byte[] input, int offset, int len)
throws IllegalStateException {
"""
Processes the first <code>len</code> bytes in <code>input</code>,
starting at <code>offset</code> inclusive.
@param input the input buffer.
@param offset the offset in <code>input</code> where the input ... | java | public final void update(byte[] input, int offset, int len)
throws IllegalStateException {
chooseFirstProvider();
if (initialized == false) {
throw new IllegalStateException("MAC not initialized");
}
if (input != null) {
if ((offset < 0) || (len > (in... | [
"public",
"final",
"void",
"update",
"(",
"byte",
"[",
"]",
"input",
",",
"int",
"offset",
",",
"int",
"len",
")",
"throws",
"IllegalStateException",
"{",
"chooseFirstProvider",
"(",
")",
";",
"if",
"(",
"initialized",
"==",
"false",
")",
"{",
"throw",
"... | Processes the first <code>len</code> bytes in <code>input</code>,
starting at <code>offset</code> inclusive.
@param input the input buffer.
@param offset the offset in <code>input</code> where the input starts.
@param len the number of bytes to process.
@exception IllegalStateException if this <code>Mac</code> has no... | [
"Processes",
"the",
"first",
"<code",
">",
"len<",
"/",
"code",
">",
"bytes",
"in",
"<code",
">",
"input<",
"/",
"code",
">",
"starting",
"at",
"<code",
">",
"offset<",
"/",
"code",
">",
"inclusive",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/javax/crypto/Mac.java#L557-L569 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java | ReviewsImpl.addVideoTranscriptModerationResultAsync | public Observable<Void> addVideoTranscriptModerationResultAsync(String teamName, String reviewId, String contentType, List<TranscriptModerationBodyItem> transcriptModerationBody) {
"""
This API adds a transcript screen text result file for a video review. Transcript screen text result file is a result of Screen Te... | java | public Observable<Void> addVideoTranscriptModerationResultAsync(String teamName, String reviewId, String contentType, List<TranscriptModerationBodyItem> transcriptModerationBody) {
return addVideoTranscriptModerationResultWithServiceResponseAsync(teamName, reviewId, contentType, transcriptModerationBody).map(ne... | [
"public",
"Observable",
"<",
"Void",
">",
"addVideoTranscriptModerationResultAsync",
"(",
"String",
"teamName",
",",
"String",
"reviewId",
",",
"String",
"contentType",
",",
"List",
"<",
"TranscriptModerationBodyItem",
">",
"transcriptModerationBody",
")",
"{",
"return"... | This API adds a transcript screen text result file for a video review. Transcript screen text result file is a result of Screen Text API . In order to generate transcript screen text result file , a transcript file has to be screened for profanity using Screen Text API.
@param teamName Your team name.
@param reviewId ... | [
"This",
"API",
"adds",
"a",
"transcript",
"screen",
"text",
"result",
"file",
"for",
"a",
"video",
"review",
".",
"Transcript",
"screen",
"text",
"result",
"file",
"is",
"a",
"result",
"of",
"Screen",
"Text",
"API",
".",
"In",
"order",
"to",
"generate",
... | 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#L1724-L1731 |
vkostyukov/la4j | src/main/java/org/la4j/matrix/dense/Basic1DMatrix.java | Basic1DMatrix.fromBinary | public static Basic1DMatrix fromBinary(byte[] array) {
"""
Decodes {@link Basic1DMatrix} from the given byte {@code array}.
@param array the byte array representing a matrix
@return a decoded matrix
"""
ByteBuffer buffer = ByteBuffer.wrap(array);
if (buffer.get() != MATRIX_TAG) {
... | java | public static Basic1DMatrix fromBinary(byte[] array) {
ByteBuffer buffer = ByteBuffer.wrap(array);
if (buffer.get() != MATRIX_TAG) {
throw new IllegalArgumentException("Can not decode Basic1DMatrix from the given byte array.");
}
int rows = buffer.getInt();
int colu... | [
"public",
"static",
"Basic1DMatrix",
"fromBinary",
"(",
"byte",
"[",
"]",
"array",
")",
"{",
"ByteBuffer",
"buffer",
"=",
"ByteBuffer",
".",
"wrap",
"(",
"array",
")",
";",
"if",
"(",
"buffer",
".",
"get",
"(",
")",
"!=",
"MATRIX_TAG",
")",
"{",
"throw... | Decodes {@link Basic1DMatrix} from the given byte {@code array}.
@param array the byte array representing a matrix
@return a decoded matrix | [
"Decodes",
"{",
"@link",
"Basic1DMatrix",
"}",
"from",
"the",
"given",
"byte",
"{",
"@code",
"array",
"}",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/matrix/dense/Basic1DMatrix.java#L201-L218 |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.createLoggingAction | protected static boolean createLoggingAction(final Logger logger, final Logger auditor, final TransactionLogger instance) {
"""
Create new logging action
This method check if there is an old instance for this thread-local
If not - Initialize new instance and set it as this thread-local's instance
@param logger
... | java | protected static boolean createLoggingAction(final Logger logger, final Logger auditor, final TransactionLogger instance) {
TransactionLogger oldInstance = getInstance();
if (oldInstance == null || oldInstance.finished) {
if(loggingKeys == null) {
synchronized (TransactionLogger.class) {
... | [
"protected",
"static",
"boolean",
"createLoggingAction",
"(",
"final",
"Logger",
"logger",
",",
"final",
"Logger",
"auditor",
",",
"final",
"TransactionLogger",
"instance",
")",
"{",
"TransactionLogger",
"oldInstance",
"=",
"getInstance",
"(",
")",
";",
"if",
"(",... | Create new logging action
This method check if there is an old instance for this thread-local
If not - Initialize new instance and set it as this thread-local's instance
@param logger
@param auditor
@param instance
@return whether new instance was set to thread-local | [
"Create",
"new",
"logging",
"action",
"This",
"method",
"check",
"if",
"there",
"is",
"an",
"old",
"instance",
"for",
"this",
"thread",
"-",
"local",
"If",
"not",
"-",
"Initialize",
"new",
"instance",
"and",
"set",
"it",
"as",
"this",
"thread",
"-",
"loc... | train | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L264-L280 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java | DatabasesInner.beginExport | public ImportExportOperationResultInner beginExport(String resourceGroupName, String serverName, String databaseName, ImportExportDatabaseDefinition parameters) {
"""
Exports a database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure ... | java | public ImportExportOperationResultInner beginExport(String resourceGroupName, String serverName, String databaseName, ImportExportDatabaseDefinition parameters) {
return beginExportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().single().body();
} | [
"public",
"ImportExportOperationResultInner",
"beginExport",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"ImportExportDatabaseDefinition",
"parameters",
")",
"{",
"return",
"beginExportWithServiceResponseAsync",
"(",
"r... | Exports a database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param parameters The database export request para... | [
"Exports",
"a",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java#L997-L999 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistryImpl.java | MetricRegistryImpl.startQueryService | public void startQueryService(RpcService rpcService, ResourceID resourceID) {
"""
Initializes the MetricQueryService.
@param rpcService RpcService to create the MetricQueryService on
@param resourceID resource ID used to disambiguate the actor name
"""
synchronized (lock) {
Preconditions.checkState(!i... | java | public void startQueryService(RpcService rpcService, ResourceID resourceID) {
synchronized (lock) {
Preconditions.checkState(!isShutdown(), "The metric registry has already been shut down.");
try {
metricQueryServiceRpcService = rpcService;
queryService = MetricQueryService.createMetricQueryService(rpc... | [
"public",
"void",
"startQueryService",
"(",
"RpcService",
"rpcService",
",",
"ResourceID",
"resourceID",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"isShutdown",
"(",
")",
",",
"\"The metric registry has already be... | Initializes the MetricQueryService.
@param rpcService RpcService to create the MetricQueryService on
@param resourceID resource ID used to disambiguate the actor name | [
"Initializes",
"the",
"MetricQueryService",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistryImpl.java#L170-L182 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/util/BitVector.java | BitVector.setBit | public void setBit(int index, boolean b) throws IndexOutOfBoundsException {
"""
Sets the state of the bit at the given index of
this <tt>BitVector</tt>.
<p>
@param index the index of the bit to be set.
@param b true if the bit should be set, false if it should be reset.
@throws IndexOutOfBoundsExcepti... | java | public void setBit(int index, boolean b) throws IndexOutOfBoundsException {
index = translateIndex(index);
logger.debug("Set bit #{}", index);
int value = ((b) ? 1 : 0);
int byteNum = byteIndex(index);
int bitNum = bitIndex(index);
data[byteNum] = (byte)((data[byteNum] & ... | [
"public",
"void",
"setBit",
"(",
"int",
"index",
",",
"boolean",
"b",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"index",
"=",
"translateIndex",
"(",
"index",
")",
";",
"logger",
".",
"debug",
"(",
"\"Set bit #{}\"",
",",
"index",
")",
";",
"int",
"v... | Sets the state of the bit at the given index of
this <tt>BitVector</tt>.
<p>
@param index the index of the bit to be set.
@param b true if the bit should be set, false if it should be reset.
@throws IndexOutOfBoundsException if the index is out of bounds. | [
"Sets",
"the",
"state",
"of",
"the",
"bit",
"at",
"the",
"given",
"index",
"of",
"this",
"<tt",
">",
"BitVector<",
"/",
"tt",
">",
".",
"<p",
">"
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/util/BitVector.java#L219-L228 |
apache/flink | flink-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java | PackagedProgram.createPlanFromProgram | private static Plan createPlanFromProgram(Program program, String[] options) throws ProgramInvocationException {
"""
Takes the jar described by the given file and invokes its pact assembler class to
assemble a plan. The assembler class name is either passed through a parameter,
or it is read from the manifest of... | java | private static Plan createPlanFromProgram(Program program, String[] options) throws ProgramInvocationException {
try {
return program.getPlan(options);
} catch (Throwable t) {
throw new ProgramInvocationException("Error while calling the program: " + t.getMessage(), t);
}
} | [
"private",
"static",
"Plan",
"createPlanFromProgram",
"(",
"Program",
"program",
",",
"String",
"[",
"]",
"options",
")",
"throws",
"ProgramInvocationException",
"{",
"try",
"{",
"return",
"program",
".",
"getPlan",
"(",
"options",
")",
";",
"}",
"catch",
"(",... | Takes the jar described by the given file and invokes its pact assembler class to
assemble a plan. The assembler class name is either passed through a parameter,
or it is read from the manifest of the jar. The assembler is handed the given options
for its assembly.
@param program The program to create the plan for.
@p... | [
"Takes",
"the",
"jar",
"described",
"by",
"the",
"given",
"file",
"and",
"invokes",
"its",
"pact",
"assembler",
"class",
"to",
"assemble",
"a",
"plan",
".",
"The",
"assembler",
"class",
"name",
"is",
"either",
"passed",
"through",
"a",
"parameter",
"or",
"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java#L651-L657 |
cketti/ckChangeLog | ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java | ChangeLog.readChangeLogFromResource | protected final SparseArray<ReleaseItem> readChangeLogFromResource(int resId, boolean full) {
"""
Read change log from XML resource file.
@param resId
Resource ID of the XML file to read the change log from.
@param full
If this is {@code true} the full change log is returned. Otherwise only changes for
vers... | java | protected final SparseArray<ReleaseItem> readChangeLogFromResource(int resId, boolean full) {
XmlResourceParser xml = mContext.getResources().getXml(resId);
try {
return readChangeLog(xml, full);
} finally {
xml.close();
}
} | [
"protected",
"final",
"SparseArray",
"<",
"ReleaseItem",
">",
"readChangeLogFromResource",
"(",
"int",
"resId",
",",
"boolean",
"full",
")",
"{",
"XmlResourceParser",
"xml",
"=",
"mContext",
".",
"getResources",
"(",
")",
".",
"getXml",
"(",
"resId",
")",
";",... | Read change log from XML resource file.
@param resId
Resource ID of the XML file to read the change log from.
@param full
If this is {@code true} the full change log is returned. Otherwise only changes for
versions newer than the last version are returned.
@return A {@code SparseArray} containing {@link ReleaseItem}s... | [
"Read",
"change",
"log",
"from",
"XML",
"resource",
"file",
"."
] | train | https://github.com/cketti/ckChangeLog/blob/e9a81ad3e043357e80922aa7c149241af73223d3/ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java#L455-L462 |
facebook/fresco | imagepipeline/src/main/java/com/facebook/imagepipeline/producers/ThumbnailSizeChecker.java | ThumbnailSizeChecker.isImageBigEnough | public static boolean isImageBigEnough(int width, int height, ResizeOptions resizeOptions) {
"""
Checks whether the producer may be able to produce images of the specified size. This makes no
promise about being able to produce images for a particular source, only generally being able
to produce output of the de... | java | public static boolean isImageBigEnough(int width, int height, ResizeOptions resizeOptions) {
if (resizeOptions == null) {
return getAcceptableSize(width) >= BitmapUtil.MAX_BITMAP_SIZE
&& getAcceptableSize(height) >= (int) BitmapUtil.MAX_BITMAP_SIZE;
} else {
return getAcceptableSize(width)... | [
"public",
"static",
"boolean",
"isImageBigEnough",
"(",
"int",
"width",
",",
"int",
"height",
",",
"ResizeOptions",
"resizeOptions",
")",
"{",
"if",
"(",
"resizeOptions",
"==",
"null",
")",
"{",
"return",
"getAcceptableSize",
"(",
"width",
")",
">=",
"BitmapUt... | Checks whether the producer may be able to produce images of the specified size. This makes no
promise about being able to produce images for a particular source, only generally being able
to produce output of the desired resolution.
@param width the desired width
@param height the desired height
@return true if the p... | [
"Checks",
"whether",
"the",
"producer",
"may",
"be",
"able",
"to",
"produce",
"images",
"of",
"the",
"specified",
"size",
".",
"This",
"makes",
"no",
"promise",
"about",
"being",
"able",
"to",
"produce",
"images",
"for",
"a",
"particular",
"source",
"only",
... | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/producers/ThumbnailSizeChecker.java#L39-L47 |
ops4j/org.ops4j.pax.exam1 | pax-exam/src/main/java/org/ops4j/pax/exam/CoreOptions.java | CoreOptions.mavenConfiguration | public static MavenPluginGeneratedConfigOption mavenConfiguration( String url ) {
"""
Creates a {@link org.ops4j.pax.exam.options.MavenPluginGeneratedConfigOption}.
@param url of configuration to be used
@return Args option with file written from paxexam plugin
"""
validateNotEmpty( url, "specifi... | java | public static MavenPluginGeneratedConfigOption mavenConfiguration( String url )
{
validateNotEmpty( url, "specified configuration url must not be empty " );
try
{
return mavenConfiguration( new URL( url ) );
} catch( MalformedURLException mE )
{
throw ... | [
"public",
"static",
"MavenPluginGeneratedConfigOption",
"mavenConfiguration",
"(",
"String",
"url",
")",
"{",
"validateNotEmpty",
"(",
"url",
",",
"\"specified configuration url must not be empty \"",
")",
";",
"try",
"{",
"return",
"mavenConfiguration",
"(",
"new",
"URL"... | Creates a {@link org.ops4j.pax.exam.options.MavenPluginGeneratedConfigOption}.
@param url of configuration to be used
@return Args option with file written from paxexam plugin | [
"Creates",
"a",
"{",
"@link",
"org",
".",
"ops4j",
".",
"pax",
".",
"exam",
".",
"options",
".",
"MavenPluginGeneratedConfigOption",
"}",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.exam1/blob/7c8742208117ff91bd24bcd3a185d2d019f7000f/pax-exam/src/main/java/org/ops4j/pax/exam/CoreOptions.java#L672-L682 |
dvasilen/Hive-XML-SerDe | src/main/java/com/ibm/spss/hive/serde2/xml/processor/XmlUtils.java | XmlUtils.getPrimitiveValue | public static Object getPrimitiveValue(String value, PrimitiveCategory primitiveCategory) {
"""
Converts the string value to the java object for the given primitive category
@param value
the value
@param primitiveCategory
the primitive category
@return the java object
"""
if (value != null) {
... | java | public static Object getPrimitiveValue(String value, PrimitiveCategory primitiveCategory) {
if (value != null) {
try {
switch (primitiveCategory) {
case BOOLEAN:
return Boolean.valueOf(value);
case BYTE:
... | [
"public",
"static",
"Object",
"getPrimitiveValue",
"(",
"String",
"value",
",",
"PrimitiveCategory",
"primitiveCategory",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"try",
"{",
"switch",
"(",
"primitiveCategory",
")",
"{",
"case",
"BOOLEAN",
":",
... | Converts the string value to the java object for the given primitive category
@param value
the value
@param primitiveCategory
the primitive category
@return the java object | [
"Converts",
"the",
"string",
"value",
"to",
"the",
"java",
"object",
"for",
"the",
"given",
"primitive",
"category"
] | train | https://github.com/dvasilen/Hive-XML-SerDe/blob/2a7a184b2cfaeb63008529a9851cd72edb8025d9/src/main/java/com/ibm/spss/hive/serde2/xml/processor/XmlUtils.java#L41-L68 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/services/JiraService.java | JiraService.fixJiraIssueTransitionId | private void fixJiraIssueTransitionId(Map<String, Object> properties) {
"""
Make sure jiraIssueTransitionId is an integer and not an empty string.
@param properties the Map holding the properties
"""
if (properties != null) {
Object jiraIssueTransitionId = properties.get(JIRA_ISSUE_TRA... | java | private void fixJiraIssueTransitionId(Map<String, Object> properties) {
if (properties != null) {
Object jiraIssueTransitionId = properties.get(JIRA_ISSUE_TRANSITION_ID_PROP);
if (jiraIssueTransitionId instanceof String) {
if (((String)jiraIssueTransitionId).trim().... | [
"private",
"void",
"fixJiraIssueTransitionId",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"Object",
"jiraIssueTransitionId",
"=",
"properties",
".",
"get",
"(",
"JIRA_ISSUE_TRANSITION_I... | Make sure jiraIssueTransitionId is an integer and not an empty string.
@param properties the Map holding the properties | [
"Make",
"sure",
"jiraIssueTransitionId",
"is",
"an",
"integer",
"and",
"not",
"an",
"empty",
"string",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/services/JiraService.java#L119-L131 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.getMediaResource | public GetMediaResourceResponse getMediaResource(GetMediaResourceRequest request) {
"""
Gets the properties of specific media resource managed by VOD service.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param request The request wrapper object containing all opti... | java | public GetMediaResourceResponse getMediaResource(GetMediaResourceRequest request) {
checkStringNotEmpty(request.getMediaId(), "Media ID should not be null or empty!");
InternalRequest internalRequest =
createRequest(HttpMethodName.GET, request, PATH_MEDIA, request.getMediaId());
... | [
"public",
"GetMediaResourceResponse",
"getMediaResource",
"(",
"GetMediaResourceRequest",
"request",
")",
"{",
"checkStringNotEmpty",
"(",
"request",
".",
"getMediaId",
"(",
")",
",",
"\"Media ID should not be null or empty!\"",
")",
";",
"InternalRequest",
"internalRequest",... | Gets the properties of specific media resource managed by VOD service.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param request The request wrapper object containing all options.
@return The properties of the specific media resource | [
"Gets",
"the",
"properties",
"of",
"specific",
"media",
"resource",
"managed",
"by",
"VOD",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L486-L492 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/InterceptorMetaDataFactory.java | InterceptorMetaDataFactory.addInterceptorProxy | private void addInterceptorProxy
(InterceptorMethodKind kind
, Method m
, int index
, Map<InterceptorMethodKind, InterceptorProxy> classProxies
, Map<InterceptorMethodKind, List<InterceptorProxy>> proxyMap) // F743-1... | java | private void addInterceptorProxy
(InterceptorMethodKind kind
, Method m
, int index
, Map<InterceptorMethodKind, InterceptorProxy> classProxies
, Map<InterceptorMethodKind, List<InterceptorProxy>> proxyMap) // F743-1... | [
"private",
"void",
"addInterceptorProxy",
"(",
"InterceptorMethodKind",
"kind",
",",
"Method",
"m",
",",
"int",
"index",
",",
"Map",
"<",
"InterceptorMethodKind",
",",
"InterceptorProxy",
">",
"classProxies",
",",
"Map",
"<",
"InterceptorMethodKind",
",",
"List",
... | Adds a new interceptor proxy to:
<ul>
<li>the interceptor map for the class currently being processed
<li>the list of all interceptors for the bean
<li>the bean lifecycle methods (if needed)
</ul>
@param kind the interceptor kind
@param m the interceptor method
@param index is the interceptor index into InterceptorMet... | [
"Adds",
"a",
"new",
"interceptor",
"proxy",
"to",
":",
"<ul",
">",
"<li",
">",
"the",
"interceptor",
"map",
"for",
"the",
"class",
"currently",
"being",
"processed",
"<li",
">",
"the",
"list",
"of",
"all",
"interceptors",
"for",
"the",
"bean",
"<li",
">"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/InterceptorMetaDataFactory.java#L1892-L1914 |
calimero-project/calimero-core | src/tuwien/auto/calimero/mgmt/PropertyClient.java | PropertyClient.getDescriptionByIndex | @Override
public Description getDescriptionByIndex(final int objIndex, final int propIndex)
throws KNXException, InterruptedException {
"""
Gets the property description based on the property index.
@param objIndex interface object index in the device
@param propIndex property index in the object
@return a... | java | @Override
public Description getDescriptionByIndex(final int objIndex, final int propIndex)
throws KNXException, InterruptedException
{
return createDesc(objIndex, pa.getDescription(objIndex, 0, propIndex));
} | [
"@",
"Override",
"public",
"Description",
"getDescriptionByIndex",
"(",
"final",
"int",
"objIndex",
",",
"final",
"int",
"propIndex",
")",
"throws",
"KNXException",
",",
"InterruptedException",
"{",
"return",
"createDesc",
"(",
"objIndex",
",",
"pa",
".",
"getDesc... | Gets the property description based on the property index.
@param objIndex interface object index in the device
@param propIndex property index in the object
@return a property description object
@throws KNXException on adapter errors while querying the description | [
"Gets",
"the",
"property",
"description",
"based",
"on",
"the",
"property",
"index",
"."
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/mgmt/PropertyClient.java#L601-L606 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.setStorageAccountAsync | public ServiceFuture<StorageBundle> setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map<String, String> tags, final ServiceCallback<StorageBundle> serv... | java | public ServiceFuture<StorageBundle> setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map<String, String> tags, final ServiceCallback<StorageBundle> serv... | [
"public",
"ServiceFuture",
"<",
"StorageBundle",
">",
"setStorageAccountAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"resourceId",
",",
"String",
"activeKeyName",
",",
"boolean",
"autoRegenerateKey",
",",
"String",
"regenera... | Creates or updates a new storage account. This operation requires the storage/set permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@param resourceId Storage account resource id.
@param activeKeyName Current active st... | [
"Creates",
"or",
"updates",
"a",
"new",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"set",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L9995-L9997 |
googlearchive/firebase-simple-login-java | src/main/java/com/firebase/simplelogin/SimpleLogin.java | SimpleLogin.loginWithTwitter | public void loginWithTwitter(final String oauth_token, final String oauth_token_secret, final Long user_id, final SimpleLoginAuthenticatedHandler completionHandler) {
"""
Login to Firebase using a Twitter token. The returned FirebaseSimpleLoginUser object will contain pertinent
Twitter data accessible with getThi... | java | public void loginWithTwitter(final String oauth_token, final String oauth_token_secret, final Long user_id, final SimpleLoginAuthenticatedHandler completionHandler) {
if(oauth_token == null || oauth_token_secret == null || user_id == null) {
handleInvalidInvalidToken(completionHandler);
}
else {
... | [
"public",
"void",
"loginWithTwitter",
"(",
"final",
"String",
"oauth_token",
",",
"final",
"String",
"oauth_token_secret",
",",
"final",
"Long",
"user_id",
",",
"final",
"SimpleLoginAuthenticatedHandler",
"completionHandler",
")",
"{",
"if",
"(",
"oauth_token",
"==",
... | Login to Firebase using a Twitter token. The returned FirebaseSimpleLoginUser object will contain pertinent
Twitter data accessible with getThirdPartyUserData().
@param oauth_token Twitter oauth token.
@param oauth_token_secret Twitter token secret.
@param user_id Twitter numeric user id.
@param completionHandler Hand... | [
"Login",
"to",
"Firebase",
"using",
"a",
"Twitter",
"token",
".",
"The",
"returned",
"FirebaseSimpleLoginUser",
"object",
"will",
"contain",
"pertinent",
"Twitter",
"data",
"accessible",
"with",
"getThirdPartyUserData",
"()",
"."
] | train | https://github.com/googlearchive/firebase-simple-login-java/blob/40498ad173b5fa69c869ba0d29cec187271fda13/src/main/java/com/firebase/simplelogin/SimpleLogin.java#L699-L711 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.