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 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorOptions.java | CmsMessageBundleEditorOptions.updateShownOptions | public void updateShownOptions(boolean showModeSwitch, boolean showAddKeyOption) {
"""
Update which options are shown.
@param showModeSwitch flag, indicating if the mode switch should be shown.
@param showAddKeyOption flag, indicating if the "Add key" row should be shown.
"""
if (showModeSwitch != m... | java | public void updateShownOptions(boolean showModeSwitch, boolean showAddKeyOption) {
if (showModeSwitch != m_showModeSwitch) {
m_upperLeftComponent.removeAllComponents();
m_upperLeftComponent.addComponent(m_languageSwitch);
if (showModeSwitch) {
m_upperLeftComp... | [
"public",
"void",
"updateShownOptions",
"(",
"boolean",
"showModeSwitch",
",",
"boolean",
"showAddKeyOption",
")",
"{",
"if",
"(",
"showModeSwitch",
"!=",
"m_showModeSwitch",
")",
"{",
"m_upperLeftComponent",
".",
"removeAllComponents",
"(",
")",
";",
"m_upperLeftComp... | Update which options are shown.
@param showModeSwitch flag, indicating if the mode switch should be shown.
@param showAddKeyOption flag, indicating if the "Add key" row should be shown. | [
"Update",
"which",
"options",
"are",
"shown",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorOptions.java#L170-L191 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBApplicationMetaData.java | EJBApplicationMetaData.finishStarting | private void finishStarting() throws RuntimeWarning {
"""
Notification that the application is about to finish starting. Performs processing of
singletons after all modules have been started but before the application has
finished starting. Module references are resolved, and startup singletons are
started.
... | java | private void finishStarting() throws RuntimeWarning {
boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "finishStarting: " + ivName);
// NOTE - Any state that is cleared here should also be cleared in
// stoppingModu... | [
"private",
"void",
"finishStarting",
"(",
")",
"throws",
"RuntimeWarning",
"{",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"en... | Notification that the application is about to finish starting. Performs processing of
singletons after all modules have been started but before the application has
finished starting. Module references are resolved, and startup singletons are
started.
@throws RuntimeWarning
if a dependency reference cannot be resolved ... | [
"Notification",
"that",
"the",
"application",
"is",
"about",
"to",
"finish",
"starting",
".",
"Performs",
"processing",
"of",
"singletons",
"after",
"all",
"modules",
"have",
"been",
"started",
"but",
"before",
"the",
"application",
"has",
"finished",
"starting",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBApplicationMetaData.java#L621-L647 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appqoe/appqoepolicy_binding.java | appqoepolicy_binding.get | public static appqoepolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch appqoepolicy_binding resource of given name .
"""
appqoepolicy_binding obj = new appqoepolicy_binding();
obj.set_name(name);
appqoepolicy_binding response = (appqoepolicy_binding) obj.g... | java | public static appqoepolicy_binding get(nitro_service service, String name) throws Exception{
appqoepolicy_binding obj = new appqoepolicy_binding();
obj.set_name(name);
appqoepolicy_binding response = (appqoepolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"appqoepolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"appqoepolicy_binding",
"obj",
"=",
"new",
"appqoepolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")"... | Use this API to fetch appqoepolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"appqoepolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appqoe/appqoepolicy_binding.java#L103-L108 |
JodaOrg/joda-money | src/main/java/org/joda/money/BigMoney.java | BigMoney.minusRetainScale | public BigMoney minusRetainScale(double amountToSubtract, RoundingMode roundingMode) {
"""
Returns a copy of this monetary value with the amount subtracted retaining
the scale by rounding the result.
<p>
The scale of the result will be the same as the scale of this instance.
For example,'USD 25.95' minus '3.02... | java | public BigMoney minusRetainScale(double amountToSubtract, RoundingMode roundingMode) {
if (amountToSubtract == 0) {
return this;
}
BigDecimal newAmount = amount.subtract(BigDecimal.valueOf(amountToSubtract));
newAmount = newAmount.setScale(getScale(), roundingMode);
... | [
"public",
"BigMoney",
"minusRetainScale",
"(",
"double",
"amountToSubtract",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"if",
"(",
"amountToSubtract",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"BigDecimal",
"newAmount",
"=",
"amount",
".",
"subtract",... | Returns a copy of this monetary value with the amount subtracted retaining
the scale by rounding the result.
<p>
The scale of the result will be the same as the scale of this instance.
For example,'USD 25.95' minus '3.029d' gives 'USD 22.92' with most rounding modes.
<p>
The amount is converted via {@link BigDecimal#va... | [
"Returns",
"a",
"copy",
"of",
"this",
"monetary",
"value",
"with",
"the",
"amount",
"subtracted",
"retaining",
"the",
"scale",
"by",
"rounding",
"the",
"result",
".",
"<p",
">",
"The",
"scale",
"of",
"the",
"result",
"will",
"be",
"the",
"same",
"as",
"t... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L1226-L1233 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/xml/xpath/XPathUtils.java | XPathUtils.evaluateExpression | public static Object evaluateExpression(Node node, String xPathExpression, NamespaceContext nsContext, QName returnType) {
"""
Evaluates the expression.
@param node the node.
@param xPathExpression the expression.
@param nsContext the context.
@param returnType
@return the result.
"""
try {
... | java | public static Object evaluateExpression(Node node, String xPathExpression, NamespaceContext nsContext, QName returnType) {
try {
return buildExpression(xPathExpression, nsContext).evaluate(node, returnType);
} catch (XPathExpressionException e) {
throw new CitrusRuntimeException(... | [
"public",
"static",
"Object",
"evaluateExpression",
"(",
"Node",
"node",
",",
"String",
"xPathExpression",
",",
"NamespaceContext",
"nsContext",
",",
"QName",
"returnType",
")",
"{",
"try",
"{",
"return",
"buildExpression",
"(",
"xPathExpression",
",",
"nsContext",
... | Evaluates the expression.
@param node the node.
@param xPathExpression the expression.
@param nsContext the context.
@param returnType
@return the result. | [
"Evaluates",
"the",
"expression",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/xpath/XPathUtils.java#L298-L304 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.quadTo | public SVGPath quadTo(double[] c1xy, double[] xy) {
"""
Quadratic Bezier line to the given coordinates.
@param c1xy first control point
@param xy new coordinates
@return path object, for compact syntax.
"""
return append(PATH_QUAD_TO).append(c1xy[0]).append(c1xy[1]).append(xy[0]).append(xy[1]);
} | java | public SVGPath quadTo(double[] c1xy, double[] xy) {
return append(PATH_QUAD_TO).append(c1xy[0]).append(c1xy[1]).append(xy[0]).append(xy[1]);
} | [
"public",
"SVGPath",
"quadTo",
"(",
"double",
"[",
"]",
"c1xy",
",",
"double",
"[",
"]",
"xy",
")",
"{",
"return",
"append",
"(",
"PATH_QUAD_TO",
")",
".",
"append",
"(",
"c1xy",
"[",
"0",
"]",
")",
".",
"append",
"(",
"c1xy",
"[",
"1",
"]",
")",... | Quadratic Bezier line to the given coordinates.
@param c1xy first control point
@param xy new coordinates
@return path object, for compact syntax. | [
"Quadratic",
"Bezier",
"line",
"to",
"the",
"given",
"coordinates",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L468-L470 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/util/logging/PlatformLogger.java | PlatformLogger.redirectToJavaLoggerProxy | private void redirectToJavaLoggerProxy() {
"""
Creates a new JavaLoggerProxy and redirects the platform logger to it
"""
DefaultLoggerProxy lp = DefaultLoggerProxy.class.cast(this.loggerProxy);
JavaLoggerProxy jlp = new JavaLoggerProxy(lp.name, lp.level);
// the order of assignments is ... | java | private void redirectToJavaLoggerProxy() {
DefaultLoggerProxy lp = DefaultLoggerProxy.class.cast(this.loggerProxy);
JavaLoggerProxy jlp = new JavaLoggerProxy(lp.name, lp.level);
// the order of assignments is important
this.javaLoggerProxy = jlp; // isLoggable checks javaLoggerProxy if... | [
"private",
"void",
"redirectToJavaLoggerProxy",
"(",
")",
"{",
"DefaultLoggerProxy",
"lp",
"=",
"DefaultLoggerProxy",
".",
"class",
".",
"cast",
"(",
"this",
".",
"loggerProxy",
")",
";",
"JavaLoggerProxy",
"jlp",
"=",
"new",
"JavaLoggerProxy",
"(",
"lp",
".",
... | Creates a new JavaLoggerProxy and redirects the platform logger to it | [
"Creates",
"a",
"new",
"JavaLoggerProxy",
"and",
"redirects",
"the",
"platform",
"logger",
"to",
"it"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/util/logging/PlatformLogger.java#L225-L231 |
google/error-prone | check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java | ASTHelpers.findClass | @Nullable
public static ClassTree findClass(ClassSymbol symbol, VisitorState state) {
"""
Returns the class tree that matches the given symbol within the compilation unit, or null if
none was found.
"""
return JavacTrees.instance(state.context).getTree(symbol);
} | java | @Nullable
public static ClassTree findClass(ClassSymbol symbol, VisitorState state) {
return JavacTrees.instance(state.context).getTree(symbol);
} | [
"@",
"Nullable",
"public",
"static",
"ClassTree",
"findClass",
"(",
"ClassSymbol",
"symbol",
",",
"VisitorState",
"state",
")",
"{",
"return",
"JavacTrees",
".",
"instance",
"(",
"state",
".",
"context",
")",
".",
"getTree",
"(",
"symbol",
")",
";",
"}"
] | Returns the class tree that matches the given symbol within the compilation unit, or null if
none was found. | [
"Returns",
"the",
"class",
"tree",
"that",
"matches",
"the",
"given",
"symbol",
"within",
"the",
"compilation",
"unit",
"or",
"null",
"if",
"none",
"was",
"found",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java#L548-L551 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/contextmenu/CmsEditProperties.java | CmsEditProperties.getContextMenuCommand | public static I_CmsContextMenuCommand getContextMenuCommand() {
"""
Returns the context menu command according to
{@link org.opencms.gwt.client.ui.contextmenu.I_CmsHasContextMenuCommand}.<p>
@return the context menu command
"""
return new I_CmsContextMenuCommand() {
public void execut... | java | public static I_CmsContextMenuCommand getContextMenuCommand() {
return new I_CmsContextMenuCommand() {
public void execute(CmsUUID structureId, I_CmsContextMenuHandler handler, CmsContextMenuEntryBean bean) {
editProperties(structureId, handler, false, null, true, new PropertyEdit... | [
"public",
"static",
"I_CmsContextMenuCommand",
"getContextMenuCommand",
"(",
")",
"{",
"return",
"new",
"I_CmsContextMenuCommand",
"(",
")",
"{",
"public",
"void",
"execute",
"(",
"CmsUUID",
"structureId",
",",
"I_CmsContextMenuHandler",
"handler",
",",
"CmsContextMenuE... | Returns the context menu command according to
{@link org.opencms.gwt.client.ui.contextmenu.I_CmsHasContextMenuCommand}.<p>
@return the context menu command | [
"Returns",
"the",
"context",
"menu",
"command",
"according",
"to",
"{",
"@link",
"org",
".",
"opencms",
".",
"gwt",
".",
"client",
".",
"ui",
".",
"contextmenu",
".",
"I_CmsHasContextMenuCommand",
"}",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/contextmenu/CmsEditProperties.java#L881-L903 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ReflectionUtils.java | ReflectionUtils.getClassFieldByName | static Field getClassFieldByName(Class<?> clazz, String fieldName) {
"""
Returns the Field object for the specified field name declared in the
specified class. Returns null if no such field can be found.
@param clazz
The declaring class where the field will be reflected. This
method will NOT attempt to refle... | java | static Field getClassFieldByName(Class<?> clazz, String fieldName) {
try {
return clazz.getDeclaredField(fieldName);
} catch (SecurityException e) {
throw new DynamoDBMappingException(
"Denied access to the [" + fieldName + "] field in class [" + clazz + "].",... | [
"static",
"Field",
"getClassFieldByName",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"clazz",
".",
"getDeclaredField",
"(",
"fieldName",
")",
";",
"}",
"catch",
"(",
"SecurityException",
"e",
")",
"{",... | Returns the Field object for the specified field name declared in the
specified class. Returns null if no such field can be found.
@param clazz
The declaring class where the field will be reflected. This
method will NOT attempt to reflect its superclass if such
field is not found in this class.
@param fieldName
The ca... | [
"Returns",
"the",
"Field",
"object",
"for",
"the",
"specified",
"field",
"name",
"declared",
"in",
"the",
"specified",
"class",
".",
"Returns",
"null",
"if",
"no",
"such",
"field",
"can",
"be",
"found",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/ReflectionUtils.java#L75-L84 |
MTDdk/jawn | jawn-core/src/main/java/net/javapla/jawn/core/util/StringUtil.java | StringUtil.camelize | public static String camelize(String underscored, boolean capitalizeFirstChar) {
"""
Generates a camel case version of a phrase from underscore.
<pre>
if {@code capitalicapitalizeFirstChar}
"alice_in_wonderland" becomes: "AliceInWonderLand"
else
"alice_in_wonderland" becomes: "aliceInWonderLand"
</pre>
... | java | public static String camelize(String underscored, boolean capitalizeFirstChar){
String result = "";
StringTokenizer st = new StringTokenizer(underscored, "_");
while(st.hasMoreTokens()){
result += capitalize(st.nextToken());
}
return capitalizeFirstChar? resul... | [
"public",
"static",
"String",
"camelize",
"(",
"String",
"underscored",
",",
"boolean",
"capitalizeFirstChar",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"underscored",
",",
"\"_\"",
")",
";",
"... | Generates a camel case version of a phrase from underscore.
<pre>
if {@code capitalicapitalizeFirstChar}
"alice_in_wonderland" becomes: "AliceInWonderLand"
else
"alice_in_wonderland" becomes: "aliceInWonderLand"
</pre>
@param underscored underscored version of a word to converted to camel case.
@param capitalizeFirst... | [
"Generates",
"a",
"camel",
"case",
"version",
"of",
"a",
"phrase",
"from",
"underscore",
"."
] | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core/src/main/java/net/javapla/jawn/core/util/StringUtil.java#L129-L136 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.getAzureReachabilityReport | public AzureReachabilityReportInner getAzureReachabilityReport(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) {
"""
Gets the relative latency score for internet service providers from a specified location to Azure regions.
@param resourceGroupName The name of ... | java | public AzureReachabilityReportInner getAzureReachabilityReport(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) {
return getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body();
} | [
"public",
"AzureReachabilityReportInner",
"getAzureReachabilityReport",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"AzureReachabilityReportParameters",
"parameters",
")",
"{",
"return",
"getAzureReachabilityReportWithServiceResponseAsync",
"(",
"r... | Gets the relative latency score for internet service providers from a specified location to Azure regions.
@param resourceGroupName The name of the network watcher resource group.
@param networkWatcherName The name of the network watcher resource.
@param parameters Parameters that determine Azure reachability report c... | [
"Gets",
"the",
"relative",
"latency",
"score",
"for",
"internet",
"service",
"providers",
"from",
"a",
"specified",
"location",
"to",
"Azure",
"regions",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L2308-L2310 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java | ActionUtil.removeAction | public static ActionListener removeAction(BaseComponent component, String eventName) {
"""
Removes any action associated with a component.
@param component Component whose action is to be removed.
@param eventName The event whose associated action is being removed.
@return The removed deferred event listener,... | java | public static ActionListener removeAction(BaseComponent component, String eventName) {
ActionListener listener = getListener(component, eventName);
if (listener != null) {
listener.removeAction();
}
return listener;
} | [
"public",
"static",
"ActionListener",
"removeAction",
"(",
"BaseComponent",
"component",
",",
"String",
"eventName",
")",
"{",
"ActionListener",
"listener",
"=",
"getListener",
"(",
"component",
",",
"eventName",
")",
";",
"if",
"(",
"listener",
"!=",
"null",
")... | Removes any action associated with a component.
@param component Component whose action is to be removed.
@param eventName The event whose associated action is being removed.
@return The removed deferred event listener, or null if none found. | [
"Removes",
"any",
"action",
"associated",
"with",
"a",
"component",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java#L146-L154 |
kmi/iserve | iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/ServiceManagerSparql.java | ServiceManagerSparql.addService | @Override
public URI addService(Service service) throws ServiceException {
"""
Creates a Service Description in the system.
Only needs to be fed with an MSM Service description.
After successfully adding a service, implementations of this method should raise a {@code ServiceCreatedEvent}
@param service ... | java | @Override
public URI addService(Service service) throws ServiceException {
// Check input and exit early
if (service == null)
throw new ServiceException("No service provided.");
if (!this.graphStoreManager.canBeModified()) {
log.warn("The dataset cannot be modified. ... | [
"@",
"Override",
"public",
"URI",
"addService",
"(",
"Service",
"service",
")",
"throws",
"ServiceException",
"{",
"// Check input and exit early",
"if",
"(",
"service",
"==",
"null",
")",
"throw",
"new",
"ServiceException",
"(",
"\"No service provided.\"",
")",
";"... | Creates a Service Description in the system.
Only needs to be fed with an MSM Service description.
After successfully adding a service, implementations of this method should raise a {@code ServiceCreatedEvent}
@param service the input service description in terms of MSM
@return the URI this service description was sa... | [
"Creates",
"a",
"Service",
"Description",
"in",
"the",
"system",
".",
"Only",
"needs",
"to",
"be",
"fed",
"with",
"an",
"MSM",
"Service",
"description",
"."
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/ServiceManagerSparql.java#L451-L482 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java | CommerceOrderPersistenceImpl.findByU_LtC_O | @Override
public List<CommerceOrder> findByU_LtC_O(long userId, Date createDate,
int orderStatus, int start, int end) {
"""
Returns a range of all the commerce orders where userId = ? and createDate < ? and orderStatus = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - ... | java | @Override
public List<CommerceOrder> findByU_LtC_O(long userId, Date createDate,
int orderStatus, int start, int end) {
return findByU_LtC_O(userId, createDate, orderStatus, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceOrder",
">",
"findByU_LtC_O",
"(",
"long",
"userId",
",",
"Date",
"createDate",
",",
"int",
"orderStatus",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByU_LtC_O",
"(",
"userId",
",",
"cr... | Returns a range of all the commerce orders where userId = ? and createDate < ? and orderStatus = ?.
<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... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"orders",
"where",
"userId",
"=",
"?",
";",
"and",
"createDate",
"<",
";",
"?",
";",
"and",
"orderStatus",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java#L5300-L5304 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/geometric/PGpoint.java | PGpoint.toBytes | public void toBytes(byte[] b, int offset) {
"""
Populate the byte array with PGpoint in the binary syntax expected by org.postgresql.
"""
ByteConverter.float8(b, offset, x);
ByteConverter.float8(b, offset + 8, y);
} | java | public void toBytes(byte[] b, int offset) {
ByteConverter.float8(b, offset, x);
ByteConverter.float8(b, offset + 8, y);
} | [
"public",
"void",
"toBytes",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
")",
"{",
"ByteConverter",
".",
"float8",
"(",
"b",
",",
"offset",
",",
"x",
")",
";",
"ByteConverter",
".",
"float8",
"(",
"b",
",",
"offset",
"+",
"8",
",",
"y",
")"... | Populate the byte array with PGpoint in the binary syntax expected by org.postgresql. | [
"Populate",
"the",
"byte",
"array",
"with",
"PGpoint",
"in",
"the",
"binary",
"syntax",
"expected",
"by",
"org",
".",
"postgresql",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/geometric/PGpoint.java#L121-L124 |
StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java | ViewHelper.setBackground | public static void setBackground(EfficientCacheView cacheView, int viewId, Drawable drawable) {
"""
Equivalent to calling View.setBackground
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose background should change
@param drawable The new background for the v... | java | public static void setBackground(EfficientCacheView cacheView, int viewId, Drawable drawable) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view != null) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
view.setBackgroundDrawable(drawable);
... | [
"public",
"static",
"void",
"setBackground",
"(",
"EfficientCacheView",
"cacheView",
",",
"int",
"viewId",
",",
"Drawable",
"drawable",
")",
"{",
"View",
"view",
"=",
"cacheView",
".",
"findViewByIdEfficient",
"(",
"viewId",
")",
";",
"if",
"(",
"view",
"!=",
... | Equivalent to calling View.setBackground
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose background should change
@param drawable The new background for the view | [
"Equivalent",
"to",
"calling",
"View",
".",
"setBackground"
] | train | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java#L38-L47 |
google/closure-compiler | src/com/google/javascript/refactoring/Matchers.java | Matchers.jsDocType | public static Matcher jsDocType(final String type) {
"""
Returns a Matcher that matches nodes that contain JS Doc that specify the
{@code @type} annotation equivalent to the provided type.
"""
return new Matcher() {
@Override
public boolean matches(Node node, NodeMetadata metadata) {
J... | java | public static Matcher jsDocType(final String type) {
return new Matcher() {
@Override
public boolean matches(Node node, NodeMetadata metadata) {
JSType providedJsType = getJsType(metadata, type);
if (providedJsType == null) {
return false;
}
providedJsType = pro... | [
"public",
"static",
"Matcher",
"jsDocType",
"(",
"final",
"String",
"type",
")",
"{",
"return",
"new",
"Matcher",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"Node",
"node",
",",
"NodeMetadata",
"metadata",
")",
"{",
"JSType",
"pro... | Returns a Matcher that matches nodes that contain JS Doc that specify the
{@code @type} annotation equivalent to the provided type. | [
"Returns",
"a",
"Matcher",
"that",
"matches",
"nodes",
"that",
"contain",
"JS",
"Doc",
"that",
"specify",
"the",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/refactoring/Matchers.java#L334-L357 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.pageForEntityList | public List<Entity> pageForEntityList(Entity where, Page page) throws SQLException {
"""
分页查询,结果为Entity列表,不计算总数<br>
查询条件为多个key value对表示,默认key = value,如果使用其它条件可以使用:where.put("key", " > 1"),value也可以传Condition对象,key被忽略
@param where 条件实体类(包含表名)
@param page 分页对象
@return 结果对象
@throws SQLException SQL执行异常
@sin... | java | public List<Entity> pageForEntityList(Entity where, Page page) throws SQLException {
return page(where, page, EntityListHandler.create());
} | [
"public",
"List",
"<",
"Entity",
">",
"pageForEntityList",
"(",
"Entity",
"where",
",",
"Page",
"page",
")",
"throws",
"SQLException",
"{",
"return",
"page",
"(",
"where",
",",
"page",
",",
"EntityListHandler",
".",
"create",
"(",
")",
")",
";",
"}"
] | 分页查询,结果为Entity列表,不计算总数<br>
查询条件为多个key value对表示,默认key = value,如果使用其它条件可以使用:where.put("key", " > 1"),value也可以传Condition对象,key被忽略
@param where 条件实体类(包含表名)
@param page 分页对象
@return 结果对象
@throws SQLException SQL执行异常
@since 3.2.2 | [
"分页查询,结果为Entity列表,不计算总数<br",
">",
"查询条件为多个key",
"value对表示,默认key",
"=",
"value,如果使用其它条件可以使用:where",
".",
"put",
"(",
"key",
">",
";",
"1",
")",
",value也可以传Condition对象,key被忽略"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L673-L675 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java | CmsContainerpageController.getNewOptions | public void getNewOptions(final String clientId, final I_CmsSimpleCallback<CmsDialogOptionsAndInfo> callback) {
"""
Fetches the options for creating a new element from the edit handler.<p>
@param clientId the client id of the element
@param callback the callback which is called with the result
"""
... | java | public void getNewOptions(final String clientId, final I_CmsSimpleCallback<CmsDialogOptionsAndInfo> callback) {
CmsRpcAction<CmsDialogOptionsAndInfo> action = new CmsRpcAction<CmsDialogOptionsAndInfo>() {
@Override
public void execute() {
getContainerpageService().getN... | [
"public",
"void",
"getNewOptions",
"(",
"final",
"String",
"clientId",
",",
"final",
"I_CmsSimpleCallback",
"<",
"CmsDialogOptionsAndInfo",
">",
"callback",
")",
"{",
"CmsRpcAction",
"<",
"CmsDialogOptionsAndInfo",
">",
"action",
"=",
"new",
"CmsRpcAction",
"<",
"Cm... | Fetches the options for creating a new element from the edit handler.<p>
@param clientId the client id of the element
@param callback the callback which is called with the result | [
"Fetches",
"the",
"options",
"for",
"creating",
"a",
"new",
"element",
"from",
"the",
"edit",
"handler",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java#L1771-L1793 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageDrawing.java | ImageDrawing.drawMasked | public static void drawMasked(Bitmap src, Drawable mask, Bitmap dest) {
"""
Drawing src bitmap to dest bitmap with applied mask.
@param src source bitmap
@param mask bitmap mask
@param dest destination bitmap
"""
drawMasked(src, mask, dest, CLEAR_COLOR);
} | java | public static void drawMasked(Bitmap src, Drawable mask, Bitmap dest) {
drawMasked(src, mask, dest, CLEAR_COLOR);
} | [
"public",
"static",
"void",
"drawMasked",
"(",
"Bitmap",
"src",
",",
"Drawable",
"mask",
",",
"Bitmap",
"dest",
")",
"{",
"drawMasked",
"(",
"src",
",",
"mask",
",",
"dest",
",",
"CLEAR_COLOR",
")",
";",
"}"
] | Drawing src bitmap to dest bitmap with applied mask.
@param src source bitmap
@param mask bitmap mask
@param dest destination bitmap | [
"Drawing",
"src",
"bitmap",
"to",
"dest",
"bitmap",
"with",
"applied",
"mask",
"."
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageDrawing.java#L69-L71 |
GerdHolz/TOVAL | src/de/invation/code/toval/misc/RandomUtils.java | RandomUtils.randomLongBetween | public static long randomLongBetween(long lowerBound, long upperBound) {
"""
Returns a random <code>long</code> value out of a specified range
@param lowerBound Lower bound of the target range (inclusive)
@param upperBound Upper bound of the target range (exclusive)
@return A random <code>long</code> value ou... | java | public static long randomLongBetween(long lowerBound, long upperBound) {
if (upperBound < lowerBound) {
throw new IllegalArgumentException("lower bound higher than upper bound");
}
return lowerBound + (long) (rand.nextDouble() * (upperBound - lowerBound));
} | [
"public",
"static",
"long",
"randomLongBetween",
"(",
"long",
"lowerBound",
",",
"long",
"upperBound",
")",
"{",
"if",
"(",
"upperBound",
"<",
"lowerBound",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"lower bound higher than upper bound\"",
")",
";... | Returns a random <code>long</code> value out of a specified range
@param lowerBound Lower bound of the target range (inclusive)
@param upperBound Upper bound of the target range (exclusive)
@return A random <code>long</code> value out of a specified range | [
"Returns",
"a",
"random",
"<code",
">",
"long<",
"/",
"code",
">",
"value",
"out",
"of",
"a",
"specified",
"range"
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/RandomUtils.java#L91-L96 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/RangeVariable.java | RangeVariable.findColumn | public int findColumn(String tableName, String columnName) {
"""
Returns the index for the column given the column's table name
and column name. If the table name is null, there is no table
name specified. For example, in a query "select C from T" there
is no table name, so tableName would be null. In the qu... | java | public int findColumn(String tableName, String columnName) {
// The namedJoinColumnExpressions are ExpressionColumn objects
// for columns named in USING conditions. Each range variable
// has a possibly empty list of these. If two range variables are
// operands of a join with a USING... | [
"public",
"int",
"findColumn",
"(",
"String",
"tableName",
",",
"String",
"columnName",
")",
"{",
"// The namedJoinColumnExpressions are ExpressionColumn objects",
"// for columns named in USING conditions. Each range variable",
"// has a possibly empty list of these. If two range variab... | Returns the index for the column given the column's table name
and column name. If the table name is null, there is no table
name specified. For example, in a query "select C from T" there
is no table name, so tableName would be null. In the query
"select T.C from T" tableName would be the string "T". Don't
return ... | [
"Returns",
"the",
"index",
"for",
"the",
"column",
"given",
"the",
"column",
"s",
"table",
"name",
"and",
"column",
"name",
".",
"If",
"the",
"table",
"name",
"is",
"null",
"there",
"is",
"no",
"table",
"name",
"specified",
".",
"For",
"example",
"in",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/RangeVariable.java#L244-L283 |
skjolber/3d-bin-container-packing | src/main/java/com/github/skjolberg/packing/Packager.java | Packager.pack | public Container pack(List<BoxItem> boxes, long deadline) {
"""
Return a container which holds all the boxes in the argument
@param boxes list of boxes to fit in a container
@param deadline the system time in millis at which the search should be aborted
@return index of container if match, -1 if not
""... | java | public Container pack(List<BoxItem> boxes, long deadline) {
return pack(boxes, filterByVolumeAndWeight(toBoxes(boxes, false), Arrays.asList(containers), 1), deadLinePredicate(deadline));
} | [
"public",
"Container",
"pack",
"(",
"List",
"<",
"BoxItem",
">",
"boxes",
",",
"long",
"deadline",
")",
"{",
"return",
"pack",
"(",
"boxes",
",",
"filterByVolumeAndWeight",
"(",
"toBoxes",
"(",
"boxes",
",",
"false",
")",
",",
"Arrays",
".",
"asList",
"(... | Return a container which holds all the boxes in the argument
@param boxes list of boxes to fit in a container
@param deadline the system time in millis at which the search should be aborted
@return index of container if match, -1 if not | [
"Return",
"a",
"container",
"which",
"holds",
"all",
"the",
"boxes",
"in",
"the",
"argument"
] | train | https://github.com/skjolber/3d-bin-container-packing/blob/9609bc7515322b2de2cad0dfb3d2f72607e71aae/src/main/java/com/github/skjolberg/packing/Packager.java#L85-L87 |
alipay/sofa-rpc | extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/transport/bolt/BoltClientTransport.java | BoltClientTransport.convertProviderToUrl | protected Url convertProviderToUrl(ClientTransportConfig transportConfig, ProviderInfo providerInfo) {
"""
For convert provider to bolt url.
@param transportConfig ClientTransportConfig
@param providerInfo ProviderInfo
@return Bolt Url
"""
// Url的第一个参数,如果不用事件的话,其实无所谓
Url boltUrl = new U... | java | protected Url convertProviderToUrl(ClientTransportConfig transportConfig, ProviderInfo providerInfo) {
// Url的第一个参数,如果不用事件的话,其实无所谓
Url boltUrl = new Url(providerInfo.toString(), providerInfo.getHost(), providerInfo.getPort());
boltUrl.setConnectTimeout(transportConfig.getConnectTimeout());
... | [
"protected",
"Url",
"convertProviderToUrl",
"(",
"ClientTransportConfig",
"transportConfig",
",",
"ProviderInfo",
"providerInfo",
")",
"{",
"// Url的第一个参数,如果不用事件的话,其实无所谓",
"Url",
"boltUrl",
"=",
"new",
"Url",
"(",
"providerInfo",
".",
"toString",
"(",
")",
",",
"provid... | For convert provider to bolt url.
@param transportConfig ClientTransportConfig
@param providerInfo ProviderInfo
@return Bolt Url | [
"For",
"convert",
"provider",
"to",
"bolt",
"url",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/transport/bolt/BoltClientTransport.java#L127-L146 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java | DepTreeNode.populateDepMap | void populateDepMap(Map<String, DependencyInfo> depMap) {
"""
Populates the provided map with the dependencies, keyed by
full path name. This is done to facilitate more efficient
lookups of the dependencies.
@param depMap
"""
if (uri != null) {
depMap.put(getFullPathName(), new DependencyInfo(defi... | java | void populateDepMap(Map<String, DependencyInfo> depMap) {
if (uri != null) {
depMap.put(getFullPathName(), new DependencyInfo(defineDependencies, requireDependencies, dependentFeatures, uri));
}
if (children != null) {
for (Entry<String, DepTreeNode> entry : children.entrySet()) {
entry.getValue()... | [
"void",
"populateDepMap",
"(",
"Map",
"<",
"String",
",",
"DependencyInfo",
">",
"depMap",
")",
"{",
"if",
"(",
"uri",
"!=",
"null",
")",
"{",
"depMap",
".",
"put",
"(",
"getFullPathName",
"(",
")",
",",
"new",
"DependencyInfo",
"(",
"defineDependencies",
... | Populates the provided map with the dependencies, keyed by
full path name. This is done to facilitate more efficient
lookups of the dependencies.
@param depMap | [
"Populates",
"the",
"provided",
"map",
"with",
"the",
"dependencies",
"keyed",
"by",
"full",
"path",
"name",
".",
"This",
"is",
"done",
"to",
"facilitate",
"more",
"efficient",
"lookups",
"of",
"the",
"dependencies",
"."
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/deps/DepTreeNode.java#L612-L621 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaRolloutManagement.java | JpaRolloutManagement.scheduleRolloutGroup | private boolean scheduleRolloutGroup(final JpaRollout rollout, final JpaRolloutGroup group) {
"""
Schedules a group of the rollout. Scheduled Actions are created to
achieve this. The creation of those Actions is allowed to fail.
"""
final long targetsInGroup = rolloutTargetGroupRepository.countByRollo... | java | private boolean scheduleRolloutGroup(final JpaRollout rollout, final JpaRolloutGroup group) {
final long targetsInGroup = rolloutTargetGroupRepository.countByRolloutGroup(group);
final long countOfActions = actionRepository.countByRolloutAndRolloutGroup(rollout, group);
long actionsLeft = targe... | [
"private",
"boolean",
"scheduleRolloutGroup",
"(",
"final",
"JpaRollout",
"rollout",
",",
"final",
"JpaRolloutGroup",
"group",
")",
"{",
"final",
"long",
"targetsInGroup",
"=",
"rolloutTargetGroupRepository",
".",
"countByRolloutGroup",
"(",
"group",
")",
";",
"final"... | Schedules a group of the rollout. Scheduled Actions are created to
achieve this. The creation of those Actions is allowed to fail. | [
"Schedules",
"a",
"group",
"of",
"the",
"rollout",
".",
"Scheduled",
"Actions",
"are",
"created",
"to",
"achieve",
"this",
".",
"The",
"creation",
"of",
"those",
"Actions",
"is",
"allowed",
"to",
"fail",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaRolloutManagement.java#L542-L557 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java | ExpressRouteCrossConnectionPeeringsInner.getAsync | public Observable<ExpressRouteCrossConnectionPeeringInner> getAsync(String resourceGroupName, String crossConnectionName, String peeringName) {
"""
Gets the specified peering for the ExpressRouteCrossConnection.
@param resourceGroupName The name of the resource group.
@param crossConnectionName The name of the... | java | public Observable<ExpressRouteCrossConnectionPeeringInner> getAsync(String resourceGroupName, String crossConnectionName, String peeringName) {
return getWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).map(new Func1<ServiceResponse<ExpressRouteCrossConnectionPeeringInner>, ExpressR... | [
"public",
"Observable",
"<",
"ExpressRouteCrossConnectionPeeringInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"crossConnectionName",
",",
"String",
"peeringName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",... | Gets the specified peering for the ExpressRouteCrossConnection.
@param resourceGroupName The name of the resource group.
@param crossConnectionName The name of the ExpressRouteCrossConnection.
@param peeringName The name of the peering.
@throws IllegalArgumentException thrown if parameters fail the validation
@return ... | [
"Gets",
"the",
"specified",
"peering",
"for",
"the",
"ExpressRouteCrossConnection",
"."
] | 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/ExpressRouteCrossConnectionPeeringsInner.java#L418-L425 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/Section.java | Section.setTextObjects | public void setTextObjects(int i, TextObject v) {
"""
indexed setter for textObjects - sets an indexed value - the text objects (figure, table, boxed text etc.) that are associated with a particular section
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (Secti... | java | public void setTextObjects(int i, TextObject v) {
if (Section_Type.featOkTst && ((Section_Type)jcasType).casFeat_textObjects == null)
jcasType.jcas.throwFeatMissing("textObjects", "de.julielab.jules.types.Section");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Section_Type)jcasTy... | [
"public",
"void",
"setTextObjects",
"(",
"int",
"i",
",",
"TextObject",
"v",
")",
"{",
"if",
"(",
"Section_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Section_Type",
")",
"jcasType",
")",
".",
"casFeat_textObjects",
"==",
"null",
")",
"jcasType",
".",
"jcas"... | indexed setter for textObjects - sets an indexed value - the text objects (figure, table, boxed text etc.) that are associated with a particular section
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"textObjects",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"the",
"text",
"objects",
"(",
"figure",
"table",
"boxed",
"text",
"etc",
".",
")",
"that",
"are",
"associated",
"with",
"a",
"particular",
"section"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/Section.java#L160-L164 |
ludovicroland/smartShareActionProvider-android | library/src/main/java/fr/rolandl/smartshareactionprovider/SmartActivityChooserModel.java | SmartActivityChooserModel.chooseActivity | public Intent chooseActivity(int index) {
"""
Chooses a activity to handle the current intent. This will result in
adding a historical record for that action and construct intent with
its component name set such that it can be immediately started by the
client.
<p>
<strong>Note:</strong> By calling this metho... | java | public Intent chooseActivity(int index)
{
synchronized (mInstanceLock)
{
if (mIntent == null)
{
return null;
}
ensureConsistentState();
ActivityResolveInfo chosenActivity = mActivities.get(index);
ComponentName chosenName = new ComponentName(chosenActivity.resolv... | [
"public",
"Intent",
"chooseActivity",
"(",
"int",
"index",
")",
"{",
"synchronized",
"(",
"mInstanceLock",
")",
"{",
"if",
"(",
"mIntent",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ensureConsistentState",
"(",
")",
";",
"ActivityResolveInfo",
"cho... | Chooses a activity to handle the current intent. This will result in
adding a historical record for that action and construct intent with
its component name set such that it can be immediately started by the
client.
<p>
<strong>Note:</strong> By calling this method the client guarantees
that the returned intent will be... | [
"Chooses",
"a",
"activity",
"to",
"handle",
"the",
"current",
"intent",
".",
"This",
"will",
"result",
"in",
"adding",
"a",
"historical",
"record",
"for",
"that",
"action",
"and",
"construct",
"intent",
"with",
"its",
"component",
"name",
"set",
"such",
"tha... | train | https://github.com/ludovicroland/smartShareActionProvider-android/blob/3b4bb27797ddebc845b18b525c50be24a8723445/library/src/main/java/fr/rolandl/smartshareactionprovider/SmartActivityChooserModel.java#L472-L506 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.getAsync | public Observable<CloudJob> getAsync(String jobId, JobGetOptions jobGetOptions) {
"""
Gets information about the specified job.
@param jobId The ID of the job.
@param jobGetOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the ob... | java | public Observable<CloudJob> getAsync(String jobId, JobGetOptions jobGetOptions) {
return getWithServiceResponseAsync(jobId, jobGetOptions).map(new Func1<ServiceResponseWithHeaders<CloudJob, JobGetHeaders>, CloudJob>() {
@Override
public CloudJob call(ServiceResponseWithHeaders<CloudJob, ... | [
"public",
"Observable",
"<",
"CloudJob",
">",
"getAsync",
"(",
"String",
"jobId",
",",
"JobGetOptions",
"jobGetOptions",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"jobId",
",",
"jobGetOptions",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceRes... | Gets information about the specified job.
@param jobId The ID of the job.
@param jobGetOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the CloudJob object | [
"Gets",
"information",
"about",
"the",
"specified",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L714-L721 |
apereo/cas | support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/resolver/UrlResourceMetadataResolver.java | UrlResourceMetadataResolver.getBackupMetadataFilenamePrefix | @SneakyThrows
protected String getBackupMetadataFilenamePrefix(final AbstractResource metadataResource, final SamlRegisteredService service) {
"""
Gets backup metadata filename prefix.
<p>
The metadata source may be an aggregate, representing more than on entity id
inside the single registered service defin... | java | @SneakyThrows
protected String getBackupMetadataFilenamePrefix(final AbstractResource metadataResource, final SamlRegisteredService service) {
val mdFileName = metadataResource.getFilename();
if (StringUtils.isBlank(mdFileName)) {
throw new FileNotFoundException("Unable to determine file... | [
"@",
"SneakyThrows",
"protected",
"String",
"getBackupMetadataFilenamePrefix",
"(",
"final",
"AbstractResource",
"metadataResource",
",",
"final",
"SamlRegisteredService",
"service",
")",
"{",
"val",
"mdFileName",
"=",
"metadataResource",
".",
"getFilename",
"(",
")",
"... | Gets backup metadata filename prefix.
<p>
The metadata source may be an aggregate, representing more than on entity id
inside the single registered service definition. Therefor, using the service's
name or id may not be appropriate choice as compounds in the metadata file name.
@param metadataResource the metadata res... | [
"Gets",
"backup",
"metadata",
"filename",
"prefix",
".",
"<p",
">",
"The",
"metadata",
"source",
"may",
"be",
"an",
"aggregate",
"representing",
"more",
"than",
"on",
"entity",
"id",
"inside",
"the",
"single",
"registered",
"service",
"definition",
".",
"There... | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/resolver/UrlResourceMetadataResolver.java#L211-L221 |
JodaOrg/joda-time | src/example/org/joda/example/time/DateTimeBrowser.java | DateTimeBrowser.LPad | private String LPad(String inStr, int maxLen) {
"""
/*
LPad Return a String, left padded with '0's as specified
by the caller.
"""
if (inStr.length() >= maxLen) return inStr.toUpperCase();
String zeroes = PADCHARS.substring(0, maxLen - inStr.length());
String retVal = zeroes + inStr;
... | java | private String LPad(String inStr, int maxLen) {
if (inStr.length() >= maxLen) return inStr.toUpperCase();
String zeroes = PADCHARS.substring(0, maxLen - inStr.length());
String retVal = zeroes + inStr;
return retVal.toUpperCase();
} | [
"private",
"String",
"LPad",
"(",
"String",
"inStr",
",",
"int",
"maxLen",
")",
"{",
"if",
"(",
"inStr",
".",
"length",
"(",
")",
">=",
"maxLen",
")",
"return",
"inStr",
".",
"toUpperCase",
"(",
")",
";",
"String",
"zeroes",
"=",
"PADCHARS",
".",
"su... | /*
LPad Return a String, left padded with '0's as specified
by the caller. | [
"/",
"*",
"LPad",
"Return",
"a",
"String",
"left",
"padded",
"with",
"0",
"s",
"as",
"specified",
"by",
"the",
"caller",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/example/org/joda/example/time/DateTimeBrowser.java#L380-L385 |
structr/structr | structr-core/src/main/java/org/structr/schema/action/Function.java | Function.assertArrayHasMinLengthAndMaxLengthAndAllElementsNotNull | protected void assertArrayHasMinLengthAndMaxLengthAndAllElementsNotNull(final Object[] array, final Integer minLength, final Integer maxLength) throws ArgumentCountException, ArgumentNullException {
"""
Test if the given object array has a minimum length and all its elements are not null.
@param array
@param m... | java | protected void assertArrayHasMinLengthAndMaxLengthAndAllElementsNotNull(final Object[] array, final Integer minLength, final Integer maxLength) throws ArgumentCountException, ArgumentNullException {
if (array.length < minLength || array.length > maxLength) {
throw ArgumentCountException.notBetween(array.length, m... | [
"protected",
"void",
"assertArrayHasMinLengthAndMaxLengthAndAllElementsNotNull",
"(",
"final",
"Object",
"[",
"]",
"array",
",",
"final",
"Integer",
"minLength",
",",
"final",
"Integer",
"maxLength",
")",
"throws",
"ArgumentCountException",
",",
"ArgumentNullException",
"... | Test if the given object array has a minimum length and all its elements are not null.
@param array
@param minLength
@param maxLength
@throws ArgumentCountException in case of wrong number of parameters
@throws ArgumentNullException in case of a null parameter | [
"Test",
"if",
"the",
"given",
"object",
"array",
"has",
"a",
"minimum",
"length",
"and",
"all",
"its",
"elements",
"are",
"not",
"null",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/action/Function.java#L147-L159 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getParameterValueFromStringWithPattern | public static Object getParameterValueFromStringWithPattern(String parameterClass, String value, String pattern) throws Exception {
"""
Get parameter value from a string represenation using a pattern
@param parameterClass parameter class
@param value string value representation
@param pattern value pattern
@... | java | public static Object getParameterValueFromStringWithPattern(String parameterClass, String value, String pattern) throws Exception {
if (pattern == null) {
return getParameterValueFromString(parameterClass, value);
} else {
if (QueryParameter.DATE_VALUE.equals(parameterClass) ||
QueryParameter.TIME... | [
"public",
"static",
"Object",
"getParameterValueFromStringWithPattern",
"(",
"String",
"parameterClass",
",",
"String",
"value",
",",
"String",
"pattern",
")",
"throws",
"Exception",
"{",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"return",
"getParameterValueFrom... | Get parameter value from a string represenation using a pattern
@param parameterClass parameter class
@param value string value representation
@param pattern value pattern
@return parameter value from string representation using pattern
@throws Exception if string value cannot be parse | [
"Get",
"parameter",
"value",
"from",
"a",
"string",
"represenation",
"using",
"a",
"pattern"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L1067-L1081 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/rules/Rules.java | Rules.conditionsRule | public static Rule conditionsRule(final Set<Condition> conditions, final Map<String, String> results) {
"""
Create a rule: predicate(conditions) => new state(results)
@param conditions conditions
@param results results
@return rule
"""
return conditionsRule(conditions, States.state(results));... | java | public static Rule conditionsRule(final Set<Condition> conditions, final Map<String, String> results) {
return conditionsRule(conditions, States.state(results));
} | [
"public",
"static",
"Rule",
"conditionsRule",
"(",
"final",
"Set",
"<",
"Condition",
">",
"conditions",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"results",
")",
"{",
"return",
"conditionsRule",
"(",
"conditions",
",",
"States",
".",
"state",
... | Create a rule: predicate(conditions) => new state(results)
@param conditions conditions
@param results results
@return rule | [
"Create",
"a",
"rule",
":",
"predicate",
"(",
"conditions",
")",
"=",
">",
"new",
"state",
"(",
"results",
")"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/rules/Rules.java#L140-L142 |
Netflix/conductor | common/src/main/java/com/netflix/conductor/common/metadata/tasks/TaskResult.java | TaskResult.addOutputData | public TaskResult addOutputData(String key, Object value) {
"""
Adds output
@param key output field
@param value value
@return current instance
"""
this.outputData.put(key, value);
return this;
} | java | public TaskResult addOutputData(String key, Object value) {
this.outputData.put(key, value);
return this;
} | [
"public",
"TaskResult",
"addOutputData",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"this",
".",
"outputData",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds output
@param key output field
@param value value
@return current instance | [
"Adds",
"output"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/common/src/main/java/com/netflix/conductor/common/metadata/tasks/TaskResult.java#L193-L196 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/PropertiesFile.java | PropertiesFile.put | public final void put(final String key, final String value) {
"""
Set a value for a property. If a property with the key is already known the value will be changed. Otherwise a new property will be
created.
@param key
Key to set.
@param value
Value to set.
"""
final Property prop = find(key);
... | java | public final void put(final String key, final String value) {
final Property prop = find(key);
if (prop == null) {
props.add(new Property(key, null, value));
} else {
prop.setValue(value);
}
} | [
"public",
"final",
"void",
"put",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"final",
"Property",
"prop",
"=",
"find",
"(",
"key",
")",
";",
"if",
"(",
"prop",
"==",
"null",
")",
"{",
"props",
".",
"add",
"(",
"new",
... | Set a value for a property. If a property with the key is already known the value will be changed. Otherwise a new property will be
created.
@param key
Key to set.
@param value
Value to set. | [
"Set",
"a",
"value",
"for",
"a",
"property",
".",
"If",
"a",
"property",
"with",
"the",
"key",
"is",
"already",
"known",
"the",
"value",
"will",
"be",
"changed",
".",
"Otherwise",
"a",
"new",
"property",
"will",
"be",
"created",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/PropertiesFile.java#L364-L371 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java | SessionManagerUtil.parseSipSessionKey | public static SipSessionKey parseSipSessionKey(
String sipSessionKey) throws ParseException {
"""
Parse a sip application key that was previously generated and put as an http request param
through the encodeURL method of SipApplicationSession
@param sipSessionKey the stringified version of the sip applicatio... | java | public static SipSessionKey parseSipSessionKey(
String sipSessionKey) throws ParseException {
if(logger.isDebugEnabled()) {
logger.debug("parseSipSessionKey - sipSessionKey=" + sipSessionKey);
}
int indexOfLeftParenthesis = sipSessionKey.indexOf("(");
// see http://code.google.com/p/sipservlets/... | [
"public",
"static",
"SipSessionKey",
"parseSipSessionKey",
"(",
"String",
"sipSessionKey",
")",
"throws",
"ParseException",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"parseSipSessionKey - sipSessionKey=\"",
"... | Parse a sip application key that was previously generated and put as an http request param
through the encodeURL method of SipApplicationSession
@param sipSessionKey the stringified version of the sip application key
@return the corresponding sip application session key
@throws ParseException if the stringfied key cann... | [
"Parse",
"a",
"sip",
"application",
"key",
"that",
"was",
"previously",
"generated",
"and",
"put",
"as",
"an",
"http",
"request",
"param",
"through",
"the",
"encodeURL",
"method",
"of",
"SipApplicationSession"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java#L166-L198 |
RobertStewart/privateer | src/main/java/com/wombatnation/privateer/Privateer.java | Privateer.getField | public Object getField(Object o, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
"""
Gets the specified field on Object o, even if that field is not normally accessible.
Only fields declared on the class for Object o can be accessed.
@param o Object to access
@param fieldName Nam... | java | public Object getField(Object o, String fieldName)
throws NoSuchFieldException, IllegalAccessException {
Field field = o.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
return field.get(o);
} | [
"public",
"Object",
"getField",
"(",
"Object",
"o",
",",
"String",
"fieldName",
")",
"throws",
"NoSuchFieldException",
",",
"IllegalAccessException",
"{",
"Field",
"field",
"=",
"o",
".",
"getClass",
"(",
")",
".",
"getDeclaredField",
"(",
"fieldName",
")",
";... | Gets the specified field on Object o, even if that field is not normally accessible.
Only fields declared on the class for Object o can be accessed.
@param o Object to access
@param fieldName Name of field whose value will be returned
@throws NoSuchFieldException if no field matches <code>fieldName</code>
@throws Ille... | [
"Gets",
"the",
"specified",
"field",
"on",
"Object",
"o",
"even",
"if",
"that",
"field",
"is",
"not",
"normally",
"accessible",
".",
"Only",
"fields",
"declared",
"on",
"the",
"class",
"for",
"Object",
"o",
"can",
"be",
"accessed",
"."
] | train | https://github.com/RobertStewart/privateer/blob/766603021ff406c950e798ce3fb259c9f1f460c7/src/main/java/com/wombatnation/privateer/Privateer.java#L77-L83 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/ChangeObjects.java | ChangeObjects.addPolymerNotation | public final static void addPolymerNotation(int position, PolymerNotation polymer, HELM2Notation helm2notation) {
"""
method to add a PolymerNotation at a specific position of the
HELM2Notation
@param position
position of the PolymerNotation
@param polymer
new PolymerNotation
@param helm2notation
input HE... | java | public final static void addPolymerNotation(int position, PolymerNotation polymer, HELM2Notation helm2notation) {
helm2notation.getListOfPolymers().add(position, polymer);
} | [
"public",
"final",
"static",
"void",
"addPolymerNotation",
"(",
"int",
"position",
",",
"PolymerNotation",
"polymer",
",",
"HELM2Notation",
"helm2notation",
")",
"{",
"helm2notation",
".",
"getListOfPolymers",
"(",
")",
".",
"add",
"(",
"position",
",",
"polymer",... | method to add a PolymerNotation at a specific position of the
HELM2Notation
@param position
position of the PolymerNotation
@param polymer
new PolymerNotation
@param helm2notation
input HELM2Notation | [
"method",
"to",
"add",
"a",
"PolymerNotation",
"at",
"a",
"specific",
"position",
"of",
"the",
"HELM2Notation"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/ChangeObjects.java#L410-L412 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/StreamUtil.java | StreamUtil.toLinkedMap | public static <T, K, U> Collector<T, ?, LinkedHashMap<K, U>> toLinkedMap(Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends U> valueMapper) {
"""
Collects a stream to a LinkedHashMap, each stream element is expecte... | java | public static <T, K, U> Collector<T, ?, LinkedHashMap<K, U>> toLinkedMap(Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends U> valueMapper) {
BinaryOperator<U> mergeFunction = throwingMerger();
return ... | [
"public",
"static",
"<",
"T",
",",
"K",
",",
"U",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"LinkedHashMap",
"<",
"K",
",",
"U",
">",
">",
"toLinkedMap",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"K",
">",
"keyMapper",
",",
... | Collects a stream to a LinkedHashMap, each stream element is expected to produce map entry.
@param keyMapper function to deal with keys.
@param valueMapper function to deal with values.
@param <T> type of element in input stream.
@param <K> type of key for created map.
@param <U> type of value... | [
"Collects",
"a",
"stream",
"to",
"a",
"LinkedHashMap",
"each",
"stream",
"element",
"is",
"expected",
"to",
"produce",
"map",
"entry",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/StreamUtil.java#L27-L31 |
opsmatters/newrelic-api | src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java | HttpContext.GET | public <T> Optional<T> GET(String partialUrl, GenericType<T> returnType) {
"""
Execute a GET call against the partial URL and deserialize the results.
@param <T> The type parameter used for the return object
@param partialUrl The partial URL to build
@param returnType The expected return type
@return The retur... | java | public <T> Optional<T> GET(String partialUrl, GenericType<T> returnType)
{
URI uri = buildUri(partialUrl);
return executeGetRequest(uri, returnType);
} | [
"public",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"GET",
"(",
"String",
"partialUrl",
",",
"GenericType",
"<",
"T",
">",
"returnType",
")",
"{",
"URI",
"uri",
"=",
"buildUri",
"(",
"partialUrl",
")",
";",
"return",
"executeGetRequest",
"(",
"uri",
",... | Execute a GET call against the partial URL and deserialize the results.
@param <T> The type parameter used for the return object
@param partialUrl The partial URL to build
@param returnType The expected return type
@return The return type | [
"Execute",
"a",
"GET",
"call",
"against",
"the",
"partial",
"URL",
"and",
"deserialize",
"the",
"results",
"."
] | train | https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java#L109-L113 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/linear/kernelized/CSKLRBatch.java | CSKLRBatch.setGamma | public void setGamma(double gamma) {
"""
Sets the gamma value to use. This value, depending on which
{@link CSKLR.UpdateMode} is used, controls the sparsity of the model.
@param gamma the gamma parameter, which is at least always positive
"""
if(gamma < 0 || Double.isNaN(gamma) || Double.isInfinite(g... | java | public void setGamma(double gamma)
{
if(gamma < 0 || Double.isNaN(gamma) || Double.isInfinite(gamma))
throw new IllegalArgumentException("Gamma must be in (0, Infity), not " + gamma);
this.gamma = gamma;
} | [
"public",
"void",
"setGamma",
"(",
"double",
"gamma",
")",
"{",
"if",
"(",
"gamma",
"<",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"gamma",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"gamma",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"... | Sets the gamma value to use. This value, depending on which
{@link CSKLR.UpdateMode} is used, controls the sparsity of the model.
@param gamma the gamma parameter, which is at least always positive | [
"Sets",
"the",
"gamma",
"value",
"to",
"use",
".",
"This",
"value",
"depending",
"on",
"which",
"{"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/kernelized/CSKLRBatch.java#L194-L199 |
GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/AbstractBigQueryInputFormat.java | AbstractBigQueryInputFormat.cleanupJob | public static void cleanupJob(BigQueryHelper bigQueryHelper, Configuration config)
throws IOException {
"""
Similar to {@link #cleanupJob(Configuration, JobID)}, but allows specifying the Bigquery
instance to use.
@param bigQueryHelper The Bigquery API-client helper instance to use.
@param config The jo... | java | public static void cleanupJob(BigQueryHelper bigQueryHelper, Configuration config)
throws IOException {
logger.atFine().log("cleanupJob(Bigquery, Configuration)");
String gcsPath = ConfigurationUtil.getMandatoryConfig(
config, BigQueryConfiguration.TEMP_GCS_PATH_KEY);
Export export = constru... | [
"public",
"static",
"void",
"cleanupJob",
"(",
"BigQueryHelper",
"bigQueryHelper",
",",
"Configuration",
"config",
")",
"throws",
"IOException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"cleanupJob(Bigquery, Configuration)\"",
")",
";",
"String",
... | Similar to {@link #cleanupJob(Configuration, JobID)}, but allows specifying the Bigquery
instance to use.
@param bigQueryHelper The Bigquery API-client helper instance to use.
@param config The job Configuration object which contains settings such as whether sharded
export was enabled, which GCS directory the export w... | [
"Similar",
"to",
"{",
"@link",
"#cleanupJob",
"(",
"Configuration",
"JobID",
")",
"}",
"but",
"allows",
"specifying",
"the",
"Bigquery",
"instance",
"to",
"use",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/AbstractBigQueryInputFormat.java#L227-L246 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/reflect/ClassReflectionIndexUtil.java | ClassReflectionIndexUtil.findAllMethods | public static Collection<Method> findAllMethods(final DeploymentReflectionIndex deploymentReflectionIndex, final ClassReflectionIndex classReflectionIndex, final String methodName, int paramCount) {
"""
Finds and returns all methods corresponding to the passed method <code>name</code> and method <code>paramCount</... | java | public static Collection<Method> findAllMethods(final DeploymentReflectionIndex deploymentReflectionIndex, final ClassReflectionIndex classReflectionIndex, final String methodName, int paramCount) {
Collection<Method> methods = classReflectionIndex.getAllMethods(methodName, paramCount);
if (!methods.isE... | [
"public",
"static",
"Collection",
"<",
"Method",
">",
"findAllMethods",
"(",
"final",
"DeploymentReflectionIndex",
"deploymentReflectionIndex",
",",
"final",
"ClassReflectionIndex",
"classReflectionIndex",
",",
"final",
"String",
"methodName",
",",
"int",
"paramCount",
")... | Finds and returns all methods corresponding to the passed method <code>name</code> and method <code>paramCount</code>.
The passed <code>classReflectionIndex</code> will be used to traverse the class hierarchy while finding the method.
<p/>
Returns empty collection if no such method is found
@param deploymentReflection... | [
"Finds",
"and",
"returns",
"all",
"methods",
"corresponding",
"to",
"the",
"passed",
"method",
"<code",
">",
"name<",
"/",
"code",
">",
"and",
"method",
"<code",
">",
"paramCount<",
"/",
"code",
">",
".",
"The",
"passed",
"<code",
">",
"classReflectionIndex<... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/reflect/ClassReflectionIndexUtil.java#L183-L198 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/util/StringHelper.java | StringHelper.Replace | public static String Replace(String aSrcStr, String aSearchStr, String aReplaceStr) {
"""
Replaces the 'search string' with 'replace string' in a given 'source string'
@param aSrcStr A source String value.
@param aSearchStr A String value to be searched for in the source String.
@param aReplaceStr A String va... | java | public static String Replace(String aSrcStr, String aSearchStr, String aReplaceStr) {
if (aSrcStr == null || aSearchStr == null || aReplaceStr == null)
return aSrcStr;
if (aSearchStr.length() == 0
|| aSrcStr.length() == 0
|| aSrcStr.indexOf(aSearchStr) == -1) {
... | [
"public",
"static",
"String",
"Replace",
"(",
"String",
"aSrcStr",
",",
"String",
"aSearchStr",
",",
"String",
"aReplaceStr",
")",
"{",
"if",
"(",
"aSrcStr",
"==",
"null",
"||",
"aSearchStr",
"==",
"null",
"||",
"aReplaceStr",
"==",
"null",
")",
"return",
... | Replaces the 'search string' with 'replace string' in a given 'source string'
@param aSrcStr A source String value.
@param aSearchStr A String value to be searched for in the source String.
@param aReplaceStr A String value that replaces the search String.
@return A String with the 'search string' replaced by 'replac... | [
"Replaces",
"the",
"search",
"string",
"with",
"replace",
"string",
"in",
"a",
"given",
"source",
"string"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/util/StringHelper.java#L817-L842 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/QuadTree.java | QuadTree.getIterator | public QuadTreeIterator getIterator(boolean bSorted) {
"""
Gets an iterator on the QuadTree.
\param bSorted Put true to iterate the quad tree in the order of the Element_types.
"""
if (!bSorted) {
QuadTreeImpl.QuadTreeIteratorImpl iterator = m_impl.getIterator();
return new QuadTreeIterator(iterator, ... | java | public QuadTreeIterator getIterator(boolean bSorted) {
if (!bSorted) {
QuadTreeImpl.QuadTreeIteratorImpl iterator = m_impl.getIterator();
return new QuadTreeIterator(iterator, false);
} else {
QuadTreeImpl.QuadTreeSortedIteratorImpl iterator = m_impl.getSortedIterator();
return new QuadTreeIterator(iter... | [
"public",
"QuadTreeIterator",
"getIterator",
"(",
"boolean",
"bSorted",
")",
"{",
"if",
"(",
"!",
"bSorted",
")",
"{",
"QuadTreeImpl",
".",
"QuadTreeIteratorImpl",
"iterator",
"=",
"m_impl",
".",
"getIterator",
"(",
")",
";",
"return",
"new",
"QuadTreeIterator",... | Gets an iterator on the QuadTree.
\param bSorted Put true to iterate the quad tree in the order of the Element_types. | [
"Gets",
"an",
"iterator",
"on",
"the",
"QuadTree",
".",
"\\",
"param",
"bSorted",
"Put",
"true",
"to",
"iterate",
"the",
"quad",
"tree",
"in",
"the",
"order",
"of",
"the",
"Element_types",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/QuadTree.java#L326-L334 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java | StereoTool.getSquarePlanarShape | public static SquarePlanarShape getSquarePlanarShape(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD) {
"""
<p>Given four atoms (assumed to be in the same plane), returns the
arrangement of those atoms in that plane.</p>
<p>The 'shapes' returned represent arrangements that look a little like
the characters... | java | public static SquarePlanarShape getSquarePlanarShape(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD) {
Point3d pointA = atomA.getPoint3d();
Point3d pointB = atomB.getPoint3d();
Point3d pointC = atomC.getPoint3d();
Point3d pointD = atomD.getPoint3d();
// normalA normalB norma... | [
"public",
"static",
"SquarePlanarShape",
"getSquarePlanarShape",
"(",
"IAtom",
"atomA",
",",
"IAtom",
"atomB",
",",
"IAtom",
"atomC",
",",
"IAtom",
"atomD",
")",
"{",
"Point3d",
"pointA",
"=",
"atomA",
".",
"getPoint3d",
"(",
")",
";",
"Point3d",
"pointB",
"... | <p>Given four atoms (assumed to be in the same plane), returns the
arrangement of those atoms in that plane.</p>
<p>The 'shapes' returned represent arrangements that look a little like
the characters 'U', '4', and 'Z'.</p>
@param atomA an atom in the plane
@param atomB an atom in the plane
@param atomC an atom in the... | [
"<p",
">",
"Given",
"four",
"atoms",
"(",
"assumed",
"to",
"be",
"in",
"the",
"same",
"plane",
")",
"returns",
"the",
"arrangement",
"of",
"those",
"atoms",
"in",
"that",
"plane",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java#L130-L170 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/text/TokenStream.java | TokenStream.getContentBetween | public String getContentBetween( Position starting,
Position end ) {
"""
Gets the content string starting at the first position (inclusive) and continuing up to the end position (exclusive).
@param starting the position marking the beginning of the desired content string.
@... | java | public String getContentBetween( Position starting,
Position end ) {
CheckArg.isNotNull(starting, "starting");
int startIndex = starting.getIndexInContent();
int endIndex = inputString.length();
if (end != null) {
endIndex = end.getIndexI... | [
"public",
"String",
"getContentBetween",
"(",
"Position",
"starting",
",",
"Position",
"end",
")",
"{",
"CheckArg",
".",
"isNotNull",
"(",
"starting",
",",
"\"starting\"",
")",
";",
"int",
"startIndex",
"=",
"starting",
".",
"getIndexInContent",
"(",
")",
";",... | Gets the content string starting at the first position (inclusive) and continuing up to the end position (exclusive).
@param starting the position marking the beginning of the desired content string.
@param end the position located directly after the returned content string; can be null, which means end of content
@re... | [
"Gets",
"the",
"content",
"string",
"starting",
"at",
"the",
"first",
"position",
"(",
"inclusive",
")",
"and",
"continuing",
"up",
"to",
"the",
"end",
"position",
"(",
"exclusive",
")",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/text/TokenStream.java#L1273-L1288 |
groupon/odo | proxyserver/src/main/java/com/groupon/odo/Proxy.java | Proxy.executeProxyRequest | private void executeProxyRequest(HttpMethod httpMethodProxyRequest,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse, History history) {
"""
Execute a request through Odo processing
@param httpMethodProxyRequ... | java | private void executeProxyRequest(HttpMethod httpMethodProxyRequest,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse, History history) {
try {
RequestInformation requestInfo = requestInformation.g... | [
"private",
"void",
"executeProxyRequest",
"(",
"HttpMethod",
"httpMethodProxyRequest",
",",
"HttpServletRequest",
"httpServletRequest",
",",
"HttpServletResponse",
"httpServletResponse",
",",
"History",
"history",
")",
"{",
"try",
"{",
"RequestInformation",
"requestInfo",
"... | Execute a request through Odo processing
@param httpMethodProxyRequest
@param httpServletRequest
@param httpServletResponse
@param history | [
"Execute",
"a",
"request",
"through",
"Odo",
"processing"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyserver/src/main/java/com/groupon/odo/Proxy.java#L895-L947 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.elementExp | public static void elementExp(DMatrixD1 A , DMatrixD1 C ) {
"""
<p>
Element-wise exp operation <br>
c<sub>ij</sub> = Math.log(a<sub>ij</sub>)
<p>
@param A input
@param C output (modified)
"""
if( A.numCols != C.numCols || A.numRows != C.numRows ) {
throw new MatrixDimensionExceptio... | java | public static void elementExp(DMatrixD1 A , DMatrixD1 C ) {
if( A.numCols != C.numCols || A.numRows != C.numRows ) {
throw new MatrixDimensionException("All matrices must be the same shape");
}
int size = A.getNumElements();
for( int i = 0; i < size; i++ ) {
C.d... | [
"public",
"static",
"void",
"elementExp",
"(",
"DMatrixD1",
"A",
",",
"DMatrixD1",
"C",
")",
"{",
"if",
"(",
"A",
".",
"numCols",
"!=",
"C",
".",
"numCols",
"||",
"A",
".",
"numRows",
"!=",
"C",
".",
"numRows",
")",
"{",
"throw",
"new",
"MatrixDimens... | <p>
Element-wise exp operation <br>
c<sub>ij</sub> = Math.log(a<sub>ij</sub>)
<p>
@param A input
@param C output (modified) | [
"<p",
">",
"Element",
"-",
"wise",
"exp",
"operation",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"Math",
".",
"log",
"(",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
")",
"<p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1728-L1738 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.copyToLocalFile | @Deprecated
public void copyToLocalFile(Path src, Path dst) throws IOException {
"""
The src file is under FS, and the dst is on the local disk.
Copy it from FS control to the local dst name.
"""
copyToLocalFile(false, false, src, dst);
} | java | @Deprecated
public void copyToLocalFile(Path src, Path dst) throws IOException {
copyToLocalFile(false, false, src, dst);
} | [
"@",
"Deprecated",
"public",
"void",
"copyToLocalFile",
"(",
"Path",
"src",
",",
"Path",
"dst",
")",
"throws",
"IOException",
"{",
"copyToLocalFile",
"(",
"false",
",",
"false",
",",
"src",
",",
"dst",
")",
";",
"}"
] | The src file is under FS, and the dst is on the local disk.
Copy it from FS control to the local dst name. | [
"The",
"src",
"file",
"is",
"under",
"FS",
"and",
"the",
"dst",
"is",
"on",
"the",
"local",
"disk",
".",
"Copy",
"it",
"from",
"FS",
"control",
"to",
"the",
"local",
"dst",
"name",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L1720-L1723 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/R.java | R.decorateFacetComponent | public static void decorateFacetComponent(UIComponent parent, UIComponent comp, FacesContext ctx, ResponseWriter rw)
throws IOException {
"""
Decorate the facet children with a class to render bootstrap like
"prepend" and "append" sections
@param parent
@param comp
@param ctx
@param rw
@throws IOExcepti... | java | public static void decorateFacetComponent(UIComponent parent, UIComponent comp, FacesContext ctx, ResponseWriter rw)
throws IOException {
/*
* System.out.println("COMPONENT CLASS = " + comp.getClass().getName());
* System.out.println("FAMILY = " + comp.getFamily());
* System.out.println("CHILD COUNT = " +... | [
"public",
"static",
"void",
"decorateFacetComponent",
"(",
"UIComponent",
"parent",
",",
"UIComponent",
"comp",
",",
"FacesContext",
"ctx",
",",
"ResponseWriter",
"rw",
")",
"throws",
"IOException",
"{",
"/*\n\t\t * System.out.println(\"COMPONENT CLASS = \" + comp.getClass().... | Decorate the facet children with a class to render bootstrap like
"prepend" and "append" sections
@param parent
@param comp
@param ctx
@param rw
@throws IOException | [
"Decorate",
"the",
"facet",
"children",
"with",
"a",
"class",
"to",
"render",
"bootstrap",
"like",
"prepend",
"and",
"append",
"sections"
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/R.java#L215-L241 |
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/phylo/Comparison.java | Comparison.PID | public final static float PID(String seq1, String seq2) {
"""
this is a gapped PID calculation
@param s1
SequenceI
@param s2
SequenceI
@return float
"""
return PID(seq1, seq2, 0, seq1.length());
} | java | public final static float PID(String seq1, String seq2) {
return PID(seq1, seq2, 0, seq1.length());
} | [
"public",
"final",
"static",
"float",
"PID",
"(",
"String",
"seq1",
",",
"String",
"seq2",
")",
"{",
"return",
"PID",
"(",
"seq1",
",",
"seq2",
",",
"0",
",",
"seq1",
".",
"length",
"(",
")",
")",
";",
"}"
] | this is a gapped PID calculation
@param s1
SequenceI
@param s2
SequenceI
@return float | [
"this",
"is",
"a",
"gapped",
"PID",
"calculation"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/phylo/Comparison.java#L47-L49 |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/persistence/xml/internal/StringPool.java | StringPool.get | public String get(char[] array, int start, int length) {
"""
Returns a string equal to {@code new String(array, start, length)}.
@param array the array
@param start the start
@param length the length
@return value
"""
// Compute an arbitrary hash of the content
int hashCode = 0;
for (int i = start;... | java | public String get(char[] array, int start, int length) {
// Compute an arbitrary hash of the content
int hashCode = 0;
for (int i = start; i < start + length; i++) {
hashCode = (hashCode * 31) + array[i];
}
// Pick a bucket using Doug Lea's supplemental secondaryHash function
// (from HashMap)
hashCod... | [
"public",
"String",
"get",
"(",
"char",
"[",
"]",
"array",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"// Compute an arbitrary hash of the content",
"int",
"hashCode",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"start",... | Returns a string equal to {@code new String(array, start, length)}.
@param array the array
@param start the start
@param length the length
@return value | [
"Returns",
"a",
"string",
"equal",
"to",
"{",
"@code",
"new",
"String",
"(",
"array",
"start",
"length",
")",
"}",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/persistence/xml/internal/StringPool.java#L59-L80 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/ExecutionController.java | ExecutionController.isFlowRunning | @Override
public boolean isFlowRunning(final int projectId, final String flowId) {
"""
Checks whether the given flow has an active (running, non-dispatched) execution from
database. {@inheritDoc}
"""
boolean isRunning = false;
try {
isRunning = isFlowRunningHelper(projectId, flowId,
... | java | @Override
public boolean isFlowRunning(final int projectId, final String flowId) {
boolean isRunning = false;
try {
isRunning = isFlowRunningHelper(projectId, flowId,
this.executorLoader.fetchUnfinishedFlows().values());
} catch (final ExecutorManagerException e) {
logger.error(
... | [
"@",
"Override",
"public",
"boolean",
"isFlowRunning",
"(",
"final",
"int",
"projectId",
",",
"final",
"String",
"flowId",
")",
"{",
"boolean",
"isRunning",
"=",
"false",
";",
"try",
"{",
"isRunning",
"=",
"isFlowRunningHelper",
"(",
"projectId",
",",
"flowId"... | Checks whether the given flow has an active (running, non-dispatched) execution from
database. {@inheritDoc} | [
"Checks",
"whether",
"the",
"given",
"flow",
"has",
"an",
"active",
"(",
"running",
"non",
"-",
"dispatched",
")",
"execution",
"from",
"database",
".",
"{"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/ExecutionController.java#L216-L229 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/FilterFactory.java | FilterFactory.getFilter | public static IFilter getFilter(long numElements, double maxFalsePosProbability, boolean offheap) {
"""
@return The smallest BloomFilter that can provide the given false
positive probability rate for the given number of elements.
Asserts that the given probability can be satisfied using this
filter.
"""
... | java | public static IFilter getFilter(long numElements, double maxFalsePosProbability, boolean offheap)
{
assert maxFalsePosProbability <= 1.0 : "Invalid probability";
if (maxFalsePosProbability == 1.0)
return new AlwaysPresentFilter();
int bucketsPerElement = BloomCalculations.maxBuck... | [
"public",
"static",
"IFilter",
"getFilter",
"(",
"long",
"numElements",
",",
"double",
"maxFalsePosProbability",
",",
"boolean",
"offheap",
")",
"{",
"assert",
"maxFalsePosProbability",
"<=",
"1.0",
":",
"\"Invalid probability\"",
";",
"if",
"(",
"maxFalsePosProbabili... | @return The smallest BloomFilter that can provide the given false
positive probability rate for the given number of elements.
Asserts that the given probability can be satisfied using this
filter. | [
"@return",
"The",
"smallest",
"BloomFilter",
"that",
"can",
"provide",
"the",
"given",
"false",
"positive",
"probability",
"rate",
"for",
"the",
"given",
"number",
"of",
"elements",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/FilterFactory.java#L71-L79 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAvailabilityEstimatePersistenceImpl.java | CommerceAvailabilityEstimatePersistenceImpl.fetchByUUID_G | @Override
public CommerceAvailabilityEstimate fetchByUUID_G(String uuid, long groupId) {
"""
Returns the commerce availability estimate where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return... | java | @Override
public CommerceAvailabilityEstimate fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CommerceAvailabilityEstimate",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the commerce availability estimate where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce availability estimate, or <code>null</code> if a matching commerce availability ... | [
"Returns",
"the",
"commerce",
"availability",
"estimate",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"f... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAvailabilityEstimatePersistenceImpl.java#L713-L716 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/layout/LayoutFactory.java | LayoutFactory.layoutFor | public Layout layoutFor(Class<? extends Storable> type, int generation)
throws FetchException, FetchNoneException {
"""
Returns the layout for a particular generation of the given type.
@param generation desired generation
@throws FetchNoneException if generation not found
"""
StoredLayou... | java | public Layout layoutFor(Class<? extends Storable> type, int generation)
throws FetchException, FetchNoneException
{
StoredLayout storedLayout =
mLayoutStorage.query("storableTypeName = ? & generation = ?")
.with(type.getName()).with(generation)
.loadOne();
... | [
"public",
"Layout",
"layoutFor",
"(",
"Class",
"<",
"?",
"extends",
"Storable",
">",
"type",
",",
"int",
"generation",
")",
"throws",
"FetchException",
",",
"FetchNoneException",
"{",
"StoredLayout",
"storedLayout",
"=",
"mLayoutStorage",
".",
"query",
"(",
"\"s... | Returns the layout for a particular generation of the given type.
@param generation desired generation
@throws FetchNoneException if generation not found | [
"Returns",
"the",
"layout",
"for",
"a",
"particular",
"generation",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/layout/LayoutFactory.java#L347-L355 |
Netflix/EVCache | evcache-client/src/main/java/com/netflix/evcache/pool/EVCacheClientPoolManager.java | EVCacheClientPoolManager.initEVCache | public final synchronized void initEVCache(String app) {
"""
Will init the given EVCache app call. If one is already initialized for
the given app method returns without doing anything.
@param app
- name of the evcache app
"""
if (app == null || (app = app.trim()).length() == 0) throw new IllegalA... | java | public final synchronized void initEVCache(String app) {
if (app == null || (app = app.trim()).length() == 0) throw new IllegalArgumentException(
"param app name null or space");
final String APP = getAppName(app);
if (poolMap.containsKey(APP)) return;
final EVCacheNodeLi... | [
"public",
"final",
"synchronized",
"void",
"initEVCache",
"(",
"String",
"app",
")",
"{",
"if",
"(",
"app",
"==",
"null",
"||",
"(",
"app",
"=",
"app",
".",
"trim",
"(",
")",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
"throw",
"new",
"IllegalArg... | Will init the given EVCache app call. If one is already initialized for
the given app method returns without doing anything.
@param app
- name of the evcache app | [
"Will",
"init",
"the",
"given",
"EVCache",
"app",
"call",
".",
"If",
"one",
"is",
"already",
"initialized",
"for",
"the",
"given",
"app",
"method",
"returns",
"without",
"doing",
"anything",
"."
] | train | https://github.com/Netflix/EVCache/blob/f46fdc22c8c52e0e06316c9889439d580c1d38a6/evcache-client/src/main/java/com/netflix/evcache/pool/EVCacheClientPoolManager.java#L170-L185 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.openDatabase | public static SQLiteDatabase openDatabase(String path, CursorFactory factory, int flags,
DatabaseErrorHandler errorHandler) {
"""
Open the database according to the flags {@link #OPEN_READWRITE}
{@link #OPEN_READONLY} {@link #CREATE_IF_NECESSARY} and/or {@link #NO_LOCALIZED_COLLATORS}.
<p>Sets the ... | java | public static SQLiteDatabase openDatabase(String path, CursorFactory factory, int flags,
DatabaseErrorHandler errorHandler) {
SQLiteDatabase db = new SQLiteDatabase(path, flags, factory, errorHandler);
db.open();
return db;
} | [
"public",
"static",
"SQLiteDatabase",
"openDatabase",
"(",
"String",
"path",
",",
"CursorFactory",
"factory",
",",
"int",
"flags",
",",
"DatabaseErrorHandler",
"errorHandler",
")",
"{",
"SQLiteDatabase",
"db",
"=",
"new",
"SQLiteDatabase",
"(",
"path",
",",
"flags... | Open the database according to the flags {@link #OPEN_READWRITE}
{@link #OPEN_READONLY} {@link #CREATE_IF_NECESSARY} and/or {@link #NO_LOCALIZED_COLLATORS}.
<p>Sets the locale of the database to the the system's current locale.
Call {@link #setLocale} if you would like something else.</p>
<p>Accepts input param: a c... | [
"Open",
"the",
"database",
"according",
"to",
"the",
"flags",
"{",
"@link",
"#OPEN_READWRITE",
"}",
"{",
"@link",
"#OPEN_READONLY",
"}",
"{",
"@link",
"#CREATE_IF_NECESSARY",
"}",
"and",
"/",
"or",
"{",
"@link",
"#NO_LOCALIZED_COLLATORS",
"}",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L695-L700 |
JodaOrg/joda-money | src/main/java/org/joda/money/Money.java | Money.multipliedBy | public Money multipliedBy(BigDecimal valueToMultiplyBy, RoundingMode roundingMode) {
"""
Returns a copy of this monetary value multiplied by the specified value.
<p>
This takes this amount and multiplies it by the specified value, rounding
the result is rounded as specified.
<p>
This instance is immutable and... | java | public Money multipliedBy(BigDecimal valueToMultiplyBy, RoundingMode roundingMode) {
return with(money.multiplyRetainScale(valueToMultiplyBy, roundingMode));
} | [
"public",
"Money",
"multipliedBy",
"(",
"BigDecimal",
"valueToMultiplyBy",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"return",
"with",
"(",
"money",
".",
"multiplyRetainScale",
"(",
"valueToMultiplyBy",
",",
"roundingMode",
")",
")",
";",
"}"
] | Returns a copy of this monetary value multiplied by the specified value.
<p>
This takes this amount and multiplies it by the specified value, rounding
the result is rounded as specified.
<p>
This instance is immutable and unaffected by this method.
@param valueToMultiplyBy the scalar value to multiply by, not null
@p... | [
"Returns",
"a",
"copy",
"of",
"this",
"monetary",
"value",
"multiplied",
"by",
"the",
"specified",
"value",
".",
"<p",
">",
"This",
"takes",
"this",
"amount",
"and",
"multiplies",
"it",
"by",
"the",
"specified",
"value",
"rounding",
"the",
"result",
"is",
... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/Money.java#L1018-L1020 |
apache/flink | flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSchemaConverter.java | AvroSchemaConverter.convertToTypeInfo | @SuppressWarnings("unchecked")
public static <T> TypeInformation<T> convertToTypeInfo(String avroSchemaString) {
"""
Converts an Avro schema string into a nested row structure with deterministic field order and data
types that are compatible with Flink's Table & SQL API.
@param avroSchemaString Avro schema de... | java | @SuppressWarnings("unchecked")
public static <T> TypeInformation<T> convertToTypeInfo(String avroSchemaString) {
Preconditions.checkNotNull(avroSchemaString, "Avro schema must not be null.");
final Schema schema;
try {
schema = new Schema.Parser().parse(avroSchemaString);
} catch (SchemaParseException e) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"TypeInformation",
"<",
"T",
">",
"convertToTypeInfo",
"(",
"String",
"avroSchemaString",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"avroSchemaString",
",",
"\"Avro s... | Converts an Avro schema string into a nested row structure with deterministic field order and data
types that are compatible with Flink's Table & SQL API.
@param avroSchemaString Avro schema definition string
@return type information matching the schema | [
"Converts",
"an",
"Avro",
"schema",
"string",
"into",
"a",
"nested",
"row",
"structure",
"with",
"deterministic",
"field",
"order",
"and",
"data",
"types",
"that",
"are",
"compatible",
"with",
"Flink",
"s",
"Table",
"&",
"SQL",
"API",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSchemaConverter.java#L73-L83 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/XLSReader.java | XLSReader.readExcel | public static XLSReader readExcel(File file, Integer scale) throws ReadExcelException {
"""
读取整个Excel文件,并把读取的数据放入beanMap中,
可以通过返回的{@link XLSReader}对象调用{@link XLSReader#getDatas()}方法拿到数据
@param file Excel文件
@param scale 指定若数值中含有小数则保留几位小数,四舍五入,null或者<=0表示不四舍五入
@return 返回 {@link XLSReader}对象,你可以通过此对象获取你需要的数... | java | public static XLSReader readExcel(File file, Integer scale) throws ReadExcelException {
POIFSFileSystem fs = null;
XLSReader reader = null;
try {
fs = new POIFSFileSystem(file);
reader = new XLSReader(fs, scale);
reader.process();
} catch (Exception e)... | [
"public",
"static",
"XLSReader",
"readExcel",
"(",
"File",
"file",
",",
"Integer",
"scale",
")",
"throws",
"ReadExcelException",
"{",
"POIFSFileSystem",
"fs",
"=",
"null",
";",
"XLSReader",
"reader",
"=",
"null",
";",
"try",
"{",
"fs",
"=",
"new",
"POIFSFile... | 读取整个Excel文件,并把读取的数据放入beanMap中,
可以通过返回的{@link XLSReader}对象调用{@link XLSReader#getDatas()}方法拿到数据
@param file Excel文件
@param scale 指定若数值中含有小数则保留几位小数,四舍五入,null或者<=0表示不四舍五入
@return 返回 {@link XLSReader}对象,你可以通过此对象获取你需要的数据
@throws ReadExcelException | [
"读取整个Excel文件",
"并把读取的数据放入beanMap中",
"可以通过返回的",
"{",
"@link",
"XLSReader",
"}",
"对象调用",
"{",
"@link",
"XLSReader#getDatas",
"()",
"}",
"方法拿到数据"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/XLSReader.java#L557-L576 |
cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java | XLogPDescriptor.getAromaticNitrogensCount | private int getAromaticNitrogensCount(IAtomContainer ac, IAtom atom) {
"""
Gets the aromaticNitrogensCount attribute of the XLogPDescriptor object.
@param ac Description of the Parameter
@param atom Description of the Parameter
@return The aromaticNitrogensCount value
"""
List<IAtom> n... | java | private int getAromaticNitrogensCount(IAtomContainer ac, IAtom atom) {
List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
int narocounter = 0;
for (IAtom neighbour : neighbours) {
if (neighbour.getSymbol().equals("N") && (Boolean) neighbour.getProperty("IS_IN_AROMATIC_RING")) {... | [
"private",
"int",
"getAromaticNitrogensCount",
"(",
"IAtomContainer",
"ac",
",",
"IAtom",
"atom",
")",
"{",
"List",
"<",
"IAtom",
">",
"neighbours",
"=",
"ac",
".",
"getConnectedAtomsList",
"(",
"atom",
")",
";",
"int",
"narocounter",
"=",
"0",
";",
"for",
... | Gets the aromaticNitrogensCount attribute of the XLogPDescriptor object.
@param ac Description of the Parameter
@param atom Description of the Parameter
@return The aromaticNitrogensCount value | [
"Gets",
"the",
"aromaticNitrogensCount",
"attribute",
"of",
"the",
"XLogPDescriptor",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java#L1236-L1245 |
rnorth/visible-assertions | src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java | VisibleAssertions.assertTrue | public static void assertTrue(String message, boolean value) {
"""
Assert that a value is true.
<p>
If the assertion passes, a green tick will be shown. If the assertion fails, a red cross will be shown.
@param message message to display alongside the assertion outcome
@param value value to test
"""
... | java | public static void assertTrue(String message, boolean value) {
if (value) {
pass(message);
} else {
fail(message, null);
}
} | [
"public",
"static",
"void",
"assertTrue",
"(",
"String",
"message",
",",
"boolean",
"value",
")",
"{",
"if",
"(",
"value",
")",
"{",
"pass",
"(",
"message",
")",
";",
"}",
"else",
"{",
"fail",
"(",
"message",
",",
"null",
")",
";",
"}",
"}"
] | Assert that a value is true.
<p>
If the assertion passes, a green tick will be shown. If the assertion fails, a red cross will be shown.
@param message message to display alongside the assertion outcome
@param value value to test | [
"Assert",
"that",
"a",
"value",
"is",
"true",
".",
"<p",
">",
"If",
"the",
"assertion",
"passes",
"a",
"green",
"tick",
"will",
"be",
"shown",
".",
"If",
"the",
"assertion",
"fails",
"a",
"red",
"cross",
"will",
"be",
"shown",
"."
] | train | https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L125-L131 |
alibaba/canal | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java | LogBuffer.getInt32BE | private static final int getInt32BE(byte[] buffer, final int pos) {
"""
Return 32-bit signed int from buffer. (big-endian)
@see mysql-5.1.60/include/myisampack.h - mi_sint4korr
"""
return (buffer[pos] << 24) | ((0xff & buffer[pos + 1]) << 16) | ((0xff & buffer[pos + 2]) << 8)
| (0xf... | java | private static final int getInt32BE(byte[] buffer, final int pos) {
return (buffer[pos] << 24) | ((0xff & buffer[pos + 1]) << 16) | ((0xff & buffer[pos + 2]) << 8)
| (0xff & buffer[pos + 3]);
} | [
"private",
"static",
"final",
"int",
"getInt32BE",
"(",
"byte",
"[",
"]",
"buffer",
",",
"final",
"int",
"pos",
")",
"{",
"return",
"(",
"buffer",
"[",
"pos",
"]",
"<<",
"24",
")",
"|",
"(",
"(",
"0xff",
"&",
"buffer",
"[",
"pos",
"+",
"1",
"]",
... | Return 32-bit signed int from buffer. (big-endian)
@see mysql-5.1.60/include/myisampack.h - mi_sint4korr | [
"Return",
"32",
"-",
"bit",
"signed",
"int",
"from",
"buffer",
".",
"(",
"big",
"-",
"endian",
")"
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L1209-L1212 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java | Jar.addEntry | public Jar addEntry(String path, String file) throws IOException {
"""
Adds an entry to this JAR.
@param path the entry's path within the JAR
@param file the path of the file to add as an entry
@return {@code this}
"""
try (FileInputStream fos = new FileInputStream(file)) {
return addE... | java | public Jar addEntry(String path, String file) throws IOException {
try (FileInputStream fos = new FileInputStream(file)) {
return addEntry(path, fos);
}
} | [
"public",
"Jar",
"addEntry",
"(",
"String",
"path",
",",
"String",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FileInputStream",
"fos",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
")",
"{",
"return",
"addEntry",
"(",
"path",
",",
"fos",
... | Adds an entry to this JAR.
@param path the entry's path within the JAR
@param file the path of the file to add as an entry
@return {@code this} | [
"Adds",
"an",
"entry",
"to",
"this",
"JAR",
"."
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java#L367-L371 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/CanarySettings.java | CanarySettings.withStageVariableOverrides | public CanarySettings withStageVariableOverrides(java.util.Map<String, String> stageVariableOverrides) {
"""
<p>
Stage variables overridden for a canary release deployment, including new stage variables introduced in the
canary. These stage variables are represented as a string-to-string map between stage variab... | java | public CanarySettings withStageVariableOverrides(java.util.Map<String, String> stageVariableOverrides) {
setStageVariableOverrides(stageVariableOverrides);
return this;
} | [
"public",
"CanarySettings",
"withStageVariableOverrides",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"stageVariableOverrides",
")",
"{",
"setStageVariableOverrides",
"(",
"stageVariableOverrides",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Stage variables overridden for a canary release deployment, including new stage variables introduced in the
canary. These stage variables are represented as a string-to-string map between stage variable names and their
values.
</p>
@param stageVariableOverrides
Stage variables overridden for a canary release deplo... | [
"<p",
">",
"Stage",
"variables",
"overridden",
"for",
"a",
"canary",
"release",
"deployment",
"including",
"new",
"stage",
"variables",
"introduced",
"in",
"the",
"canary",
".",
"These",
"stage",
"variables",
"are",
"represented",
"as",
"a",
"string",
"-",
"to... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/CanarySettings.java#L182-L185 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java | ReUtil.findAllGroup0 | public static List<String> findAllGroup0(Pattern pattern, CharSequence content) {
"""
取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组0的内容
@param pattern 编译后的正则模式
@param content 被查找的内容
@return 结果列表
@since 3.1.2
"""
return findAll(pattern, content, 0);
} | java | public static List<String> findAllGroup0(Pattern pattern, CharSequence content) {
return findAll(pattern, content, 0);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"findAllGroup0",
"(",
"Pattern",
"pattern",
",",
"CharSequence",
"content",
")",
"{",
"return",
"findAll",
"(",
"pattern",
",",
"content",
",",
"0",
")",
";",
"}"
] | 取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组0的内容
@param pattern 编译后的正则模式
@param content 被查找的内容
@return 结果列表
@since 3.1.2 | [
"取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组0的内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L418-L420 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java | CPSpecificationOptionPersistenceImpl.findByG_K | @Override
public CPSpecificationOption findByG_K(long groupId, String key)
throws NoSuchCPSpecificationOptionException {
"""
Returns the cp specification option where groupId = ? and key = ? or throws a {@link NoSuchCPSpecificationOptionException} if it could not be found.
@param groupId the group ID... | java | @Override
public CPSpecificationOption findByG_K(long groupId, String key)
throws NoSuchCPSpecificationOptionException {
CPSpecificationOption cpSpecificationOption = fetchByG_K(groupId, key);
if (cpSpecificationOption == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_K... | [
"@",
"Override",
"public",
"CPSpecificationOption",
"findByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"throws",
"NoSuchCPSpecificationOptionException",
"{",
"CPSpecificationOption",
"cpSpecificationOption",
"=",
"fetchByG_K",
"(",
"groupId",
",",
"key",
")... | Returns the cp specification option where groupId = ? and key = ? or throws a {@link NoSuchCPSpecificationOptionException} if it could not be found.
@param groupId the group ID
@param key the key
@return the matching cp specification option
@throws NoSuchCPSpecificationOptionException if a matching cp specific... | [
"Returns",
"the",
"cp",
"specification",
"option",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPSpecificationOptionException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java#L2551-L2577 |
apereo/cas | support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSamlObjectBuilder.java | AbstractSamlObjectBuilder.signSamlElement | private static org.jdom.Element signSamlElement(final org.jdom.Element element, final PrivateKey privKey, final PublicKey pubKey) {
"""
Sign SAML element.
@param element the element
@param privKey the priv key
@param pubKey the pub key
@return the element
"""
try {
val providerName =... | java | private static org.jdom.Element signSamlElement(final org.jdom.Element element, final PrivateKey privKey, final PublicKey pubKey) {
try {
val providerName = System.getProperty("jsr105Provider", SIGNATURE_FACTORY_PROVIDER_CLASS);
val clazz = Class.forName(providerName);
val s... | [
"private",
"static",
"org",
".",
"jdom",
".",
"Element",
"signSamlElement",
"(",
"final",
"org",
".",
"jdom",
".",
"Element",
"element",
",",
"final",
"PrivateKey",
"privKey",
",",
"final",
"PublicKey",
"pubKey",
")",
"{",
"try",
"{",
"val",
"providerName",
... | Sign SAML element.
@param element the element
@param privKey the priv key
@param pubKey the pub key
@return the element | [
"Sign",
"SAML",
"element",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSamlObjectBuilder.java#L145-L185 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java | UCharacter.codePointBefore | public static final int codePointBefore(char[] text, int index) {
"""
Same as {@link Character#codePointBefore(char[], int)}.
Returns the code point before index.
This examines only the characters at index-1 and index-2.
@param text the characters to check
@param index the index after the last or only char f... | java | public static final int codePointBefore(char[] text, int index) {
char c2 = text[--index];
if (isLowSurrogate(c2)) {
if (index > 0) {
char c1 = text[--index];
if (isHighSurrogate(c1)) {
return toCodePoint(c1, c2);
}
... | [
"public",
"static",
"final",
"int",
"codePointBefore",
"(",
"char",
"[",
"]",
"text",
",",
"int",
"index",
")",
"{",
"char",
"c2",
"=",
"text",
"[",
"--",
"index",
"]",
";",
"if",
"(",
"isLowSurrogate",
"(",
"c2",
")",
")",
"{",
"if",
"(",
"index",... | Same as {@link Character#codePointBefore(char[], int)}.
Returns the code point before index.
This examines only the characters at index-1 and index-2.
@param text the characters to check
@param index the index after the last or only char forming the code point
@return the code point before the index | [
"Same",
"as",
"{",
"@link",
"Character#codePointBefore",
"(",
"char",
"[]",
"int",
")",
"}",
".",
"Returns",
"the",
"code",
"point",
"before",
"index",
".",
"This",
"examines",
"only",
"the",
"characters",
"at",
"index",
"-",
"1",
"and",
"index",
"-",
"2... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L5414-L5425 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java | StaticTypeCheckingVisitor.extractPropertyNameFromMethodName | public static String extractPropertyNameFromMethodName(String prefix, String methodName) {
"""
Given a method name and a prefix, returns the name of the property that should be looked up,
following the java beans rules. For example, "getName" would return "name", while
"getFullName" would return "fullName".
If ... | java | public static String extractPropertyNameFromMethodName(String prefix, String methodName) {
if (prefix == null || methodName == null) return null;
if (methodName.startsWith(prefix) && prefix.length() < methodName.length()) {
String result = methodName.substring(prefix.length());
S... | [
"public",
"static",
"String",
"extractPropertyNameFromMethodName",
"(",
"String",
"prefix",
",",
"String",
"methodName",
")",
"{",
"if",
"(",
"prefix",
"==",
"null",
"||",
"methodName",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"methodName",
".",
... | Given a method name and a prefix, returns the name of the property that should be looked up,
following the java beans rules. For example, "getName" would return "name", while
"getFullName" would return "fullName".
If the prefix is not found, returns null.
@param prefix the method name prefix ("get", "is", "set", .... | [
"Given",
"a",
"method",
"name",
"and",
"a",
"prefix",
"returns",
"the",
"name",
"of",
"the",
"property",
"that",
"should",
"be",
"looked",
"up",
"following",
"the",
"java",
"beans",
"rules",
".",
"For",
"example",
"getName",
"would",
"return",
"name",
"whi... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L4886-L4894 |
pavlospt/RxFile | rxfile/src/main/java/com/pavlospt/rxfile/RxFile.java | RxFile.createFileFromUri | public static Observable<File> createFileFromUri(final Context context, final Uri data) {
"""
/*
Create a copy of the file found under the provided Uri, in the Library's cache folder.
The mime type of the resource will be determined by URLConnection.guessContentTypeFromName() method.
"""
return createF... | java | public static Observable<File> createFileFromUri(final Context context, final Uri data) {
return createFileFromUri(context, data, MimeMap.UrlConnection);
} | [
"public",
"static",
"Observable",
"<",
"File",
">",
"createFileFromUri",
"(",
"final",
"Context",
"context",
",",
"final",
"Uri",
"data",
")",
"{",
"return",
"createFileFromUri",
"(",
"context",
",",
"data",
",",
"MimeMap",
".",
"UrlConnection",
")",
";",
"}... | /*
Create a copy of the file found under the provided Uri, in the Library's cache folder.
The mime type of the resource will be determined by URLConnection.guessContentTypeFromName() method. | [
"/",
"*",
"Create",
"a",
"copy",
"of",
"the",
"file",
"found",
"under",
"the",
"provided",
"Uri",
"in",
"the",
"Library",
"s",
"cache",
"folder",
"."
] | train | https://github.com/pavlospt/RxFile/blob/54210b02631f4b27d31bea040eca86183136cf46/rxfile/src/main/java/com/pavlospt/rxfile/RxFile.java#L64-L66 |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/publish/Graphite.java | Graphite.checkNoReturnedData | private void checkNoReturnedData(Socket socket) throws IOException {
"""
The graphite protocol is a "one-way" streaming protocol and as such there is no easy way
to check that we are sending the output to the wrong place. We can aim the graphite writer
at any listening socket and it will never care if the data i... | java | private void checkNoReturnedData(Socket socket) throws IOException {
final InputStream input = socket.getInputStream();
if (input.available() > 0) {
final byte[] bytes = new byte[1000];
final int toRead = Math.min(input.available(), bytes.length);
final int read = input.read(bytes, 0, toRead);
if (read ... | [
"private",
"void",
"checkNoReturnedData",
"(",
"Socket",
"socket",
")",
"throws",
"IOException",
"{",
"final",
"InputStream",
"input",
"=",
"socket",
".",
"getInputStream",
"(",
")",
";",
"if",
"(",
"input",
".",
"available",
"(",
")",
">",
"0",
")",
"{",
... | The graphite protocol is a "one-way" streaming protocol and as such there is no easy way
to check that we are sending the output to the wrong place. We can aim the graphite writer
at any listening socket and it will never care if the data is being correctly handled. By
logging any returned bytes we can help make it obv... | [
"The",
"graphite",
"protocol",
"is",
"a",
"one",
"-",
"way",
"streaming",
"protocol",
"and",
"as",
"such",
"there",
"is",
"no",
"easy",
"way",
"to",
"check",
"that",
"we",
"are",
"sending",
"the",
"output",
"to",
"the",
"wrong",
"place",
".",
"We",
"ca... | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/publish/Graphite.java#L150-L164 |
javers/javers | javers-core/src/main/java/org/javers/common/properties/PropertiesUtil.java | PropertiesUtil.loadProperties | public static void loadProperties(String classpathName, Properties toProps) {
"""
loads a properties file from classpath using default classloader
@param classpathName classpath resource name
@throws JaversException CLASSPATH_RESOURCE_NOT_FOUND
@see ClassLoader#getResourceAsStream(String)
"""
Vali... | java | public static void loadProperties(String classpathName, Properties toProps) {
Validate.argumentIsNotNull(classpathName);
Validate.argumentIsNotNull(toProps);
InputStream inputStream = PropertiesUtil.class.getClassLoader().getResourceAsStream(classpathName);
if (inputStream == null) {
... | [
"public",
"static",
"void",
"loadProperties",
"(",
"String",
"classpathName",
",",
"Properties",
"toProps",
")",
"{",
"Validate",
".",
"argumentIsNotNull",
"(",
"classpathName",
")",
";",
"Validate",
".",
"argumentIsNotNull",
"(",
"toProps",
")",
";",
"InputStream... | loads a properties file from classpath using default classloader
@param classpathName classpath resource name
@throws JaversException CLASSPATH_RESOURCE_NOT_FOUND
@see ClassLoader#getResourceAsStream(String) | [
"loads",
"a",
"properties",
"file",
"from",
"classpath",
"using",
"default",
"classloader"
] | train | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/common/properties/PropertiesUtil.java#L71-L86 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPCalculator.java | AFPCalculator.filterTerminal | private static final boolean filterTerminal(Atom[] ca1, Atom[] ca2, int p1b, int p1e, int p2b, int p2e, int fragLen, int minLen) {
"""
filter 2 for AFP extration: the context
@param p1b
@param p1e
@param p2b
@param p2e
@return
"""
int d1 = (p1b < p2b)?p1b:p2b;
int d2 = (ca1.length - p1e) < (c... | java | private static final boolean filterTerminal(Atom[] ca1, Atom[] ca2, int p1b, int p1e, int p2b, int p2e, int fragLen, int minLen)
{
int d1 = (p1b < p2b)?p1b:p2b;
int d2 = (ca1.length - p1e) < (ca2.length - p2e)?(ca1.length - p1e):(ca2.length - p2e);
int d3 = d1 + d2 + fragLen; //maximum alignment len... | [
"private",
"static",
"final",
"boolean",
"filterTerminal",
"(",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
",",
"int",
"p1b",
",",
"int",
"p1e",
",",
"int",
"p2b",
",",
"int",
"p2e",
",",
"int",
"fragLen",
",",
"int",
"minLen",
")",
"{"... | filter 2 for AFP extration: the context
@param p1b
@param p1e
@param p2b
@param p2e
@return | [
"filter",
"2",
"for",
"AFP",
"extration",
":",
"the",
"context"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/fatcat/calc/AFPCalculator.java#L170-L182 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java | Boot.showError | @SuppressWarnings("checkstyle:regexp")
public static void showError(String message, Throwable exception) {
"""
Show an error message, and exit.
<p>This function never returns.
@param message the description of the error.
@param exception the cause of the error.
"""
try (PrintWriter logger = new Print... | java | @SuppressWarnings("checkstyle:regexp")
public static void showError(String message, Throwable exception) {
try (PrintWriter logger = new PrintWriter(getConsoleLogger())) {
if (message != null && !message.isEmpty()) {
logger.println(message);
} else if (exception != null) {
exception.printStackTrace(log... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:regexp\"",
")",
"public",
"static",
"void",
"showError",
"(",
"String",
"message",
",",
"Throwable",
"exception",
")",
"{",
"try",
"(",
"PrintWriter",
"logger",
"=",
"new",
"PrintWriter",
"(",
"getConsoleLogger",
"(",
... | Show an error message, and exit.
<p>This function never returns.
@param message the description of the error.
@param exception the cause of the error. | [
"Show",
"an",
"error",
"message",
"and",
"exit",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/Boot.java#L626-L639 |
geomajas/geomajas-project-client-gwt2 | plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/service/GeometryIndexService.java | GeometryIndexService.getLinearRingIndex | public GeometryIndex getLinearRingIndex(Geometry geometry, Coordinate location) {
"""
Get the index of the (smallest) linear ring of the geometry that contains this coordinate.
@param geometry
@param c
@return the index (empty array indicates no containment)
@since 2.1.0
"""
return fromDelegate(Geometr... | java | public GeometryIndex getLinearRingIndex(Geometry geometry, Coordinate location) {
return fromDelegate(GeometryService.getLinearRingIndex(geometry, location));
} | [
"public",
"GeometryIndex",
"getLinearRingIndex",
"(",
"Geometry",
"geometry",
",",
"Coordinate",
"location",
")",
"{",
"return",
"fromDelegate",
"(",
"GeometryService",
".",
"getLinearRingIndex",
"(",
"geometry",
",",
"location",
")",
")",
";",
"}"
] | Get the index of the (smallest) linear ring of the geometry that contains this coordinate.
@param geometry
@param c
@return the index (empty array indicates no containment)
@since 2.1.0 | [
"Get",
"the",
"index",
"of",
"the",
"(",
"smallest",
")",
"linear",
"ring",
"of",
"the",
"geometry",
"that",
"contains",
"this",
"coordinate",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/service/GeometryIndexService.java#L374-L376 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/interestrate/models/LIBORMarketModelFromCovarianceModel.java | LIBORMarketModelFromCovarianceModel.getOnePlusInterpolatedLIBORDt | private RandomVariable getOnePlusInterpolatedLIBORDt(int timeIndex, double periodStartTime, int liborPeriodIndex) throws CalculationException {
"""
Implement the interpolation of the forward rate in tenor time.
The method provides the forward rate \( F(t_{i}, S, T_{j+1}) \) where \( S \in [T_{j}, T_{j+1}] \).
... | java | private RandomVariable getOnePlusInterpolatedLIBORDt(int timeIndex, double periodStartTime, int liborPeriodIndex) throws CalculationException
{
double tenorPeriodStartTime = getLiborPeriod(liborPeriodIndex);
double tenorPeriodEndTime = getLiborPeriod(liborPeriodIndex + 1);
double tenorDt ... | [
"private",
"RandomVariable",
"getOnePlusInterpolatedLIBORDt",
"(",
"int",
"timeIndex",
",",
"double",
"periodStartTime",
",",
"int",
"liborPeriodIndex",
")",
"throws",
"CalculationException",
"{",
"double",
"tenorPeriodStartTime",
"=",
"getLiborPeriod",
"(",
"liborPeriodInd... | Implement the interpolation of the forward rate in tenor time.
The method provides the forward rate \( F(t_{i}, S, T_{j+1}) \) where \( S \in [T_{j}, T_{j+1}] \).
@param timeIndex The time index associated with the simulation time. The index i in \( t_{i} \).
@param periodStartTime The period start time S (on which we... | [
"Implement",
"the",
"interpolation",
"of",
"the",
"forward",
"rate",
"in",
"tenor",
"time",
".",
"The",
"method",
"provides",
"the",
"forward",
"rate",
"\\",
"(",
"F",
"(",
"t_",
"{",
"i",
"}",
"S",
"T_",
"{",
"j",
"+",
"1",
"}",
")",
"\\",
")",
... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/models/LIBORMarketModelFromCovarianceModel.java#L1304-L1361 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/format/FastDatePrinter.java | FastDatePrinter.applyRules | private <B extends Appendable> B applyRules(final Calendar calendar, final B buf) {
"""
<p>
Performs the formatting by applying the rules to the specified calendar.
</p>
@param calendar the calendar to format
@param buf the buffer to format into
@param <B> the Appendable class type, usually StringBuilder or... | java | private <B extends Appendable> B applyRules(final Calendar calendar, final B buf) {
try {
for (final Rule rule : this.rules) {
rule.appendTo(buf, calendar);
}
} catch (final IOException e) {
throw new DateException(e);
}
return buf;
} | [
"private",
"<",
"B",
"extends",
"Appendable",
">",
"B",
"applyRules",
"(",
"final",
"Calendar",
"calendar",
",",
"final",
"B",
"buf",
")",
"{",
"try",
"{",
"for",
"(",
"final",
"Rule",
"rule",
":",
"this",
".",
"rules",
")",
"{",
"rule",
".",
"append... | <p>
Performs the formatting by applying the rules to the specified calendar.
</p>
@param calendar the calendar to format
@param buf the buffer to format into
@param <B> the Appendable class type, usually StringBuilder or StringBuffer.
@return the specified string buffer | [
"<p",
">",
"Performs",
"the",
"formatting",
"by",
"applying",
"the",
"rules",
"to",
"the",
"specified",
"calendar",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDatePrinter.java#L372-L381 |
amaembo/streamex | src/main/java/one/util/streamex/DoubleStreamEx.java | DoubleStreamEx.minByInt | public OptionalDouble minByInt(DoubleToIntFunction keyExtractor) {
"""
Returns the minimum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalDouble} describing the f... | java | public OptionalDouble minByInt(DoubleToIntFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, d) -> {
int key = keyExtractor.applyAsInt(d);
if (!box.b || box.i > key) {
box.b = true;
box.i = key;
box.d = d;
}... | [
"public",
"OptionalDouble",
"minByInt",
"(",
"DoubleToIntFunction",
"keyExtractor",
")",
"{",
"return",
"collect",
"(",
"PrimitiveBox",
"::",
"new",
",",
"(",
"box",
",",
"d",
")",
"->",
"{",
"int",
"key",
"=",
"keyExtractor",
".",
"applyAsInt",
"(",
"d",
... | Returns the minimum element of this stream according to the provided key
extractor function.
<p>
This is a terminal operation.
@param keyExtractor a non-interfering, stateless function
@return an {@code OptionalDouble} describing the first element of this
stream for which the lowest value was returned by key extracto... | [
"Returns",
"the",
"minimum",
"element",
"of",
"this",
"stream",
"according",
"to",
"the",
"provided",
"key",
"extractor",
"function",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/DoubleStreamEx.java#L901-L910 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskLog.java | TaskLog.getRealTaskLogFilePath | static String getRealTaskLogFilePath(String location, LogName filter)
throws IOException {
"""
Get the real task-log file-path
@param location Location of the log-file. This should point to an
attempt-directory.
@param filter
@return
@throws IOException
"""
return FileUtil.makeShellPath(new Fi... | java | static String getRealTaskLogFilePath(String location, LogName filter)
throws IOException {
return FileUtil.makeShellPath(new File(getBaseDir(location),
filter.toString()));
} | [
"static",
"String",
"getRealTaskLogFilePath",
"(",
"String",
"location",
",",
"LogName",
"filter",
")",
"throws",
"IOException",
"{",
"return",
"FileUtil",
".",
"makeShellPath",
"(",
"new",
"File",
"(",
"getBaseDir",
"(",
"location",
")",
",",
"filter",
".",
"... | Get the real task-log file-path
@param location Location of the log-file. This should point to an
attempt-directory.
@param filter
@return
@throws IOException | [
"Get",
"the",
"real",
"task",
"-",
"log",
"file",
"-",
"path"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskLog.java#L115-L119 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/ColumnMappingParser.java | ColumnMappingParser.parseFieldMapping | public static FieldMapping parseFieldMapping(JsonNode mappingNode) {
"""
Parses the FieldMapping from an annotated schema field.
@param mappingNode
The value of the "mapping" node
@return FieldMapping
"""
ValidationException.check(mappingNode.isObject(),
"A column mapping must be a JSON record... | java | public static FieldMapping parseFieldMapping(JsonNode mappingNode) {
ValidationException.check(mappingNode.isObject(),
"A column mapping must be a JSON record");
ValidationException.check(mappingNode.has(SOURCE),
"Partitioners must have a %s.", SOURCE);
String source = mappingNode.get("sour... | [
"public",
"static",
"FieldMapping",
"parseFieldMapping",
"(",
"JsonNode",
"mappingNode",
")",
"{",
"ValidationException",
".",
"check",
"(",
"mappingNode",
".",
"isObject",
"(",
")",
",",
"\"A column mapping must be a JSON record\"",
")",
";",
"ValidationException",
"."... | Parses the FieldMapping from an annotated schema field.
@param mappingNode
The value of the "mapping" node
@return FieldMapping | [
"Parses",
"the",
"FieldMapping",
"from",
"an",
"annotated",
"schema",
"field",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/ColumnMappingParser.java#L187-L196 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java | OverrideService.disableAllOverrides | public void disableAllOverrides(int pathID, String clientUUID, int overrideType) {
"""
Disable all overrides for a specified path with overrideType
@param pathID ID of path containing overrides
@param clientUUID UUID of client
@param overrideType Override type identifier
"""
PreparedStatement stat... | java | public void disableAllOverrides(int pathID, String clientUUID, int overrideType) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
ArrayList<Integer> enabledOverrides = new ArrayList<Integer>();
enabledOverrides.add(Constants.PLU... | [
"public",
"void",
"disableAllOverrides",
"(",
"int",
"pathID",
",",
"String",
"clientUUID",
",",
"int",
"overrideType",
")",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"getConnection"... | Disable all overrides for a specified path with overrideType
@param pathID ID of path containing overrides
@param clientUUID UUID of client
@param overrideType Override type identifier | [
"Disable",
"all",
"overrides",
"for",
"a",
"specified",
"path",
"with",
"overrideType"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L559-L595 |
openskynetwork/java-adsb | src/main/java/org/opensky/libadsb/Decoder.java | Decoder.genericDecoder | public static ModeSReply genericDecoder (byte[] raw_message, boolean noCRC) throws BadFormatException, UnspecifiedFormatError {
"""
A easy-to-use top-down ADS-B decoder. Use msg.getType() to
check the message type and then cast to the appropriate class.
@param raw_message the Mode S message as byte array
@param... | java | public static ModeSReply genericDecoder (byte[] raw_message, boolean noCRC) throws BadFormatException, UnspecifiedFormatError {
return genericDecoder(new ModeSReply(raw_message, noCRC));
} | [
"public",
"static",
"ModeSReply",
"genericDecoder",
"(",
"byte",
"[",
"]",
"raw_message",
",",
"boolean",
"noCRC",
")",
"throws",
"BadFormatException",
",",
"UnspecifiedFormatError",
"{",
"return",
"genericDecoder",
"(",
"new",
"ModeSReply",
"(",
"raw_message",
",",... | A easy-to-use top-down ADS-B decoder. Use msg.getType() to
check the message type and then cast to the appropriate class.
@param raw_message the Mode S message as byte array
@param noCRC indicates whether the CRC has been subtracted from the parity field
@return an instance of the most specialized ModeSReply possible
@... | [
"A",
"easy",
"-",
"to",
"-",
"use",
"top",
"-",
"down",
"ADS",
"-",
"B",
"decoder",
".",
"Use",
"msg",
".",
"getType",
"()",
"to",
"check",
"the",
"message",
"type",
"and",
"then",
"cast",
"to",
"the",
"appropriate",
"class",
"."
] | train | https://github.com/openskynetwork/java-adsb/blob/01d497d3e74ad10063ab443ab583e9c8653a8b8d/src/main/java/org/opensky/libadsb/Decoder.java#L53-L55 |
strator-dev/greenpepper | greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java | ConfluenceGreenPepper.getImplementedPage | public AbstractPage getImplementedPage(Page page) throws GreenPepperServerException {
"""
Retrieves the content of the specification at the implemented version.
@param page a {@link com.atlassian.confluence.pages.Page} object.
@return the content of the specification at the implemented version.
@throws com.gr... | java | public AbstractPage getImplementedPage(Page page) throws GreenPepperServerException {
Integer version = getImplementedVersion(page);
if (version == null)
throw new GreenPepperServerException(NEVER_IMPLEMENTED, "Never Implemented");
return getPageManager().getPageByVersion(page, vers... | [
"public",
"AbstractPage",
"getImplementedPage",
"(",
"Page",
"page",
")",
"throws",
"GreenPepperServerException",
"{",
"Integer",
"version",
"=",
"getImplementedVersion",
"(",
"page",
")",
";",
"if",
"(",
"version",
"==",
"null",
")",
"throw",
"new",
"GreenPepperS... | Retrieves the content of the specification at the implemented version.
@param page a {@link com.atlassian.confluence.pages.Page} object.
@return the content of the specification at the implemented version.
@throws com.greenpepper.server.GreenPepperServerException if any. | [
"Retrieves",
"the",
"content",
"of",
"the",
"specification",
"at",
"the",
"implemented",
"version",
"."
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java#L631-L637 |
soarcn/COCOQuery | query/src/main/java/com/cocosw/query/AbstractViewQuery.java | AbstractViewQuery.doubleTap | public T doubleTap(final GestureDetector.OnDoubleTapListener listener) {
"""
Register listener on double-tap gesture for view
@param listener
@return view
"""
if (view != null) {
final GestureDetector detector = new GestureDetector(view.getContext(),
new GestureDetec... | java | public T doubleTap(final GestureDetector.OnDoubleTapListener listener) {
if (view != null) {
final GestureDetector detector = new GestureDetector(view.getContext(),
new GestureDetector.SimpleOnGestureListener());
detector.setOnDoubleTapListener(listener);
... | [
"public",
"T",
"doubleTap",
"(",
"final",
"GestureDetector",
".",
"OnDoubleTapListener",
"listener",
")",
"{",
"if",
"(",
"view",
"!=",
"null",
")",
"{",
"final",
"GestureDetector",
"detector",
"=",
"new",
"GestureDetector",
"(",
"view",
".",
"getContext",
"("... | Register listener on double-tap gesture for view
@param listener
@return view | [
"Register",
"listener",
"on",
"double",
"-",
"tap",
"gesture",
"for",
"view"
] | train | https://github.com/soarcn/COCOQuery/blob/712eac37ab65ef3dbdf55dbfae28750edfc36608/query/src/main/java/com/cocosw/query/AbstractViewQuery.java#L1001-L1015 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/nlp/AipNlp.java | AipNlp.wordSimEmbedding | public JSONObject wordSimEmbedding(String word1, String word2, HashMap<String, Object> options) {
"""
词义相似度接口
输入两个词,得到两个词的相似度结果。
@param word1 - 词1(GBK编码),最大64字节*
@param word2 - 词1(GBK编码),最大64字节
@param options - 可选参数对象,key: value都为string类型
options - options列表:
mode 预留字段,可选择不同的词义相似度模型。默认值为0,目前仅支持mode=0
@ret... | java | public JSONObject wordSimEmbedding(String word1, String word2, HashMap<String, Object> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("word_1", word1);
request.addBody("word_2", word2);
if (options != null) {
... | [
"public",
"JSONObject",
"wordSimEmbedding",
"(",
"String",
"word1",
",",
"String",
"word2",
",",
"HashMap",
"<",
"String",
",",
"Object",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"reques... | 词义相似度接口
输入两个词,得到两个词的相似度结果。
@param word1 - 词1(GBK编码),最大64字节*
@param word2 - 词1(GBK编码),最大64字节
@param options - 可选参数对象,key: value都为string类型
options - options列表:
mode 预留字段,可选择不同的词义相似度模型。默认值为0,目前仅支持mode=0
@return JSONObject | [
"词义相似度接口",
"输入两个词,得到两个词的相似度结果。"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/nlp/AipNlp.java#L174-L191 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/PeerGroup.java | PeerGroup.setStallThreshold | public void setStallThreshold(int periodSecs, int bytesPerSecond) {
"""
Configures the stall speed: the speed at which a peer is considered to be serving us the block chain
unacceptably slowly. Once a peer has served us data slower than the given data rate for the given
number of seconds, it is considered stalle... | java | public void setStallThreshold(int periodSecs, int bytesPerSecond) {
lock.lock();
try {
stallPeriodSeconds = periodSecs;
stallMinSpeedBytesSec = bytesPerSecond;
} finally {
lock.unlock();
}
} | [
"public",
"void",
"setStallThreshold",
"(",
"int",
"periodSecs",
",",
"int",
"bytesPerSecond",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"stallPeriodSeconds",
"=",
"periodSecs",
";",
"stallMinSpeedBytesSec",
"=",
"bytesPerSecond",
";",
"}",
"fi... | Configures the stall speed: the speed at which a peer is considered to be serving us the block chain
unacceptably slowly. Once a peer has served us data slower than the given data rate for the given
number of seconds, it is considered stalled and will be disconnected, forcing the chain download to continue
from a diffe... | [
"Configures",
"the",
"stall",
"speed",
":",
"the",
"speed",
"at",
"which",
"a",
"peer",
"is",
"considered",
"to",
"be",
"serving",
"us",
"the",
"block",
"chain",
"unacceptably",
"slowly",
".",
"Once",
"a",
"peer",
"has",
"served",
"us",
"data",
"slower",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/PeerGroup.java#L1718-L1726 |
paoding-code/paoding-rose | paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/GenericUtils.java | GenericUtils.resolveTypeVariable | public static final Class resolveTypeVariable(Class invocationClass, Class declaringClass,
String typeVarName) {
"""
求declaringClass类中声明的泛型类型变量在invocationClass中真正的值
@param invocationClass 编程时使用的类
@param declaringClass 声明类型变量typeVarName的类
@param typeVarName 泛型变... | java | public static final Class resolveTypeVariable(Class invocationClass, Class declaringClass,
String typeVarName) {
TypeVariable typeVariable = null;
for (TypeVariable typeParemeter : declaringClass.getTypeParameters()) {
if (typeParemeter.getNa... | [
"public",
"static",
"final",
"Class",
"resolveTypeVariable",
"(",
"Class",
"invocationClass",
",",
"Class",
"declaringClass",
",",
"String",
"typeVarName",
")",
"{",
"TypeVariable",
"typeVariable",
"=",
"null",
";",
"for",
"(",
"TypeVariable",
"typeParemeter",
":",
... | 求declaringClass类中声明的泛型类型变量在invocationClass中真正的值
@param invocationClass 编程时使用的类
@param declaringClass 声明类型变量typeVarName的类
@param typeVarName 泛型变量名
@return | [
"求declaringClass类中声明的泛型类型变量在invocationClass中真正的值"
] | train | https://github.com/paoding-code/paoding-rose/blob/8b512704174dd6cba95e544c7d6ab66105cb8ec4/paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/GenericUtils.java#L58-L71 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperations.java | KnowledgeOperations.getInputOnlyList | public static List<Object> getInputOnlyList(Message message, KnowledgeOperation operation, KnowledgeRuntimeEngine runtime) {
"""
Gets an input-only list.
@param message the message
@param operation the operation
@param runtime the runtime engine
@return the input-only list
"""
return getInputList... | java | public static List<Object> getInputOnlyList(Message message, KnowledgeOperation operation, KnowledgeRuntimeEngine runtime) {
return getInputList(message, operation.getInputOnlyExpressionMappings(), runtime);
} | [
"public",
"static",
"List",
"<",
"Object",
">",
"getInputOnlyList",
"(",
"Message",
"message",
",",
"KnowledgeOperation",
"operation",
",",
"KnowledgeRuntimeEngine",
"runtime",
")",
"{",
"return",
"getInputList",
"(",
"message",
",",
"operation",
".",
"getInputOnlyE... | Gets an input-only list.
@param message the message
@param operation the operation
@param runtime the runtime engine
@return the input-only list | [
"Gets",
"an",
"input",
"-",
"only",
"list",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperations.java#L200-L202 |
alkacon/opencms-core | src/org/opencms/i18n/CmsEncoder.java | CmsEncoder.changeEncoding | public static byte[] changeEncoding(byte[] input, String oldEncoding, String newEncoding) {
"""
Changes the encoding of a byte array that represents a String.<p>
@param input the byte array to convert
@param oldEncoding the current encoding of the byte array
@param newEncoding the new encoding of the byte arr... | java | public static byte[] changeEncoding(byte[] input, String oldEncoding, String newEncoding) {
if ((oldEncoding == null) || (newEncoding == null)) {
return input;
}
if (oldEncoding.trim().equalsIgnoreCase(newEncoding.trim())) {
return input;
}
byte[] result ... | [
"public",
"static",
"byte",
"[",
"]",
"changeEncoding",
"(",
"byte",
"[",
"]",
"input",
",",
"String",
"oldEncoding",
",",
"String",
"newEncoding",
")",
"{",
"if",
"(",
"(",
"oldEncoding",
"==",
"null",
")",
"||",
"(",
"newEncoding",
"==",
"null",
")",
... | Changes the encoding of a byte array that represents a String.<p>
@param input the byte array to convert
@param oldEncoding the current encoding of the byte array
@param newEncoding the new encoding of the byte array
@return the byte array encoded in the new encoding | [
"Changes",
"the",
"encoding",
"of",
"a",
"byte",
"array",
"that",
"represents",
"a",
"String",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsEncoder.java#L150-L165 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/main/Enforcer.java | Enforcer.addRoleForUserInDomain | public boolean addRoleForUserInDomain(String user, String role, String domain) {
"""
addRoleForUserInDomain adds a role for a user inside a domain.
Returns false if the user already has the role (aka not affected).
@param user the user.
@param role the role.
@param domain the domain.
@return succeeds or not... | java | public boolean addRoleForUserInDomain(String user, String role, String domain) {
return addGroupingPolicy(user, role, domain);
} | [
"public",
"boolean",
"addRoleForUserInDomain",
"(",
"String",
"user",
",",
"String",
"role",
",",
"String",
"domain",
")",
"{",
"return",
"addGroupingPolicy",
"(",
"user",
",",
"role",
",",
"domain",
")",
";",
"}"
] | addRoleForUserInDomain adds a role for a user inside a domain.
Returns false if the user already has the role (aka not affected).
@param user the user.
@param role the role.
@param domain the domain.
@return succeeds or not. | [
"addRoleForUserInDomain",
"adds",
"a",
"role",
"for",
"a",
"user",
"inside",
"a",
"domain",
".",
"Returns",
"false",
"if",
"the",
"user",
"already",
"has",
"the",
"role",
"(",
"aka",
"not",
"affected",
")",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/Enforcer.java#L387-L389 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/utils/ESResponseWrapper.java | ESResponseWrapper.validateBucket | private boolean validateBucket(boolean left, boolean right, String logicalOperation) {
"""
Validate bucket.
@param left
the left
@param right
the right
@param logicalOperation
the logical operation
@return true, if successful
"""
logger.debug("Logical opertation " + logicalOperation + " found ... | java | private boolean validateBucket(boolean left, boolean right, String logicalOperation)
{
logger.debug("Logical opertation " + logicalOperation + " found in having clause");
if (Expression.AND.equalsIgnoreCase(logicalOperation))
{
return left && right;
}
else if (Exp... | [
"private",
"boolean",
"validateBucket",
"(",
"boolean",
"left",
",",
"boolean",
"right",
",",
"String",
"logicalOperation",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Logical opertation \"",
"+",
"logicalOperation",
"+",
"\" found in having clause\"",
")",
";",
"if",... | Validate bucket.
@param left
the left
@param right
the right
@param logicalOperation
the logical operation
@return true, if successful | [
"Validate",
"bucket",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/utils/ESResponseWrapper.java#L446-L462 |
citrusframework/citrus | modules/citrus-jms/src/main/java/com/consol/citrus/jms/actions/PurgeJmsQueuesAction.java | PurgeJmsQueuesAction.purgeQueue | private void purgeQueue(String queueName, Session session) throws JMSException {
"""
Purges a queue destination identified by its name.
@param queueName
@param session
@throws JMSException
"""
purgeDestination(getDestination(session, queueName), session, queueName);
} | java | private void purgeQueue(String queueName, Session session) throws JMSException {
purgeDestination(getDestination(session, queueName), session, queueName);
} | [
"private",
"void",
"purgeQueue",
"(",
"String",
"queueName",
",",
"Session",
"session",
")",
"throws",
"JMSException",
"{",
"purgeDestination",
"(",
"getDestination",
"(",
"session",
",",
"queueName",
")",
",",
"session",
",",
"queueName",
")",
";",
"}"
] | Purges a queue destination identified by its name.
@param queueName
@param session
@throws JMSException | [
"Purges",
"a",
"queue",
"destination",
"identified",
"by",
"its",
"name",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/actions/PurgeJmsQueuesAction.java#L107-L109 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.scalarFloorMod | public SDVariable scalarFloorMod(SDVariable in, Number value) {
"""
Element-wise scalar floor modulus operation: out = floorMod(in, value).
i.e., returns the remainder after division by 'value'
@param in Input variable
@param value Scalar value to compare
@return Output variable
"""
return sca... | java | public SDVariable scalarFloorMod(SDVariable in, Number value) {
return scalarFloorMod(null, in, value);
} | [
"public",
"SDVariable",
"scalarFloorMod",
"(",
"SDVariable",
"in",
",",
"Number",
"value",
")",
"{",
"return",
"scalarFloorMod",
"(",
"null",
",",
"in",
",",
"value",
")",
";",
"}"
] | Element-wise scalar floor modulus operation: out = floorMod(in, value).
i.e., returns the remainder after division by 'value'
@param in Input variable
@param value Scalar value to compare
@return Output variable | [
"Element",
"-",
"wise",
"scalar",
"floor",
"modulus",
"operation",
":",
"out",
"=",
"floorMod",
"(",
"in",
"value",
")",
".",
"i",
".",
"e",
".",
"returns",
"the",
"remainder",
"after",
"division",
"by",
"value"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L1917-L1919 |
elbkind/osgi | reporting/api/src/main/java/eu/elbkind/osgi/reporting/api/ReportFormatter.java | ReportFormatter.format | public void format(PrintStream out, String[] headers, String[]... rows) {
"""
Prints a table
@param out PrintStream to write to, not null
@param headers Array of not null values
@param rows Array of not null values, row length must always be headers length
"""
int[] columnWidth = computeEachColumn... | java | public void format(PrintStream out, String[] headers, String[]... rows) {
int[] columnWidth = computeEachColumnWidth(this.defaultColumnWidth, headers, rows);
printRow(out, columnWidth, headers);
printTableSeperatir(out, headers, columnWidth);
for (String[] row : rows) {
pri... | [
"public",
"void",
"format",
"(",
"PrintStream",
"out",
",",
"String",
"[",
"]",
"headers",
",",
"String",
"[",
"]",
"...",
"rows",
")",
"{",
"int",
"[",
"]",
"columnWidth",
"=",
"computeEachColumnWidth",
"(",
"this",
".",
"defaultColumnWidth",
",",
"header... | Prints a table
@param out PrintStream to write to, not null
@param headers Array of not null values
@param rows Array of not null values, row length must always be headers length | [
"Prints",
"a",
"table"
] | train | https://github.com/elbkind/osgi/blob/206fdcb4587556c289d3cee54ef36c7f1ed93920/reporting/api/src/main/java/eu/elbkind/osgi/reporting/api/ReportFormatter.java#L52-L61 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.