repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 201 | func_name stringlengths 4 126 | whole_func_string stringlengths 75 3.57k | language stringclasses 1
value | func_code_string stringlengths 75 3.57k | func_code_tokens listlengths 21 599 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.findFirstElement | @Nullable
public static Element findFirstElement(@Nonnull final Element node, @Nonnull final String elementName) {
Element result = null;
for (final Element l : Utils.findDirectChildrenForName(node, elementName)) {
result = l;
break;
}
return result;
} | java | @Nullable
public static Element findFirstElement(@Nonnull final Element node, @Nonnull final String elementName) {
Element result = null;
for (final Element l : Utils.findDirectChildrenForName(node, elementName)) {
result = l;
break;
}
return result;
} | [
"@",
"Nullable",
"public",
"static",
"Element",
"findFirstElement",
"(",
"@",
"Nonnull",
"final",
"Element",
"node",
",",
"@",
"Nonnull",
"final",
"String",
"elementName",
")",
"{",
"Element",
"result",
"=",
"null",
";",
"for",
"(",
"final",
"Element",
"l",
... | Get first direct child for name.
@param node element to find children
@param elementName name of child element
@return found first child or null if not found
@since 1.4.0 | [
"Get",
"first",
"direct",
"child",
"for",
"name",
"."
] | train | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L209-L217 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/KeyRange.java | KeyRange.closedClosed | public static KeyRange closedClosed(Key start, Key end) {
return new KeyRange(checkNotNull(start), Endpoint.CLOSED, checkNotNull(end), Endpoint.CLOSED);
} | java | public static KeyRange closedClosed(Key start, Key end) {
return new KeyRange(checkNotNull(start), Endpoint.CLOSED, checkNotNull(end), Endpoint.CLOSED);
} | [
"public",
"static",
"KeyRange",
"closedClosed",
"(",
"Key",
"start",
",",
"Key",
"end",
")",
"{",
"return",
"new",
"KeyRange",
"(",
"checkNotNull",
"(",
"start",
")",
",",
"Endpoint",
".",
"CLOSED",
",",
"checkNotNull",
"(",
"end",
")",
",",
"Endpoint",
... | Returns a key range from {@code start} inclusive to {@code end} inclusive. | [
"Returns",
"a",
"key",
"range",
"from",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/KeyRange.java#L157-L159 |
tvesalainen/util | util/src/main/java/org/vesalainen/bean/BeanHelper.java | BeanHelper.getParameterTypes | public static final Class[] getParameterTypes(Object bean, String property)
{
Type type = (Type) doFor(
bean,
property,
null,
(Object a, int i)->{Object o = Array.get(a, i);return o!=null?o.getClass().getComponentType():null;},
(List l, in... | java | public static final Class[] getParameterTypes(Object bean, String property)
{
Type type = (Type) doFor(
bean,
property,
null,
(Object a, int i)->{Object o = Array.get(a, i);return o!=null?o.getClass().getComponentType():null;},
(List l, in... | [
"public",
"static",
"final",
"Class",
"[",
"]",
"getParameterTypes",
"(",
"Object",
"bean",
",",
"String",
"property",
")",
"{",
"Type",
"type",
"=",
"(",
"Type",
")",
"doFor",
"(",
"bean",
",",
"property",
",",
"null",
",",
"(",
"Object",
"a",
",",
... | Returns actual parameter types for property
@param bean
@param property
@return | [
"Returns",
"actual",
"parameter",
"types",
"for",
"property"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/bean/BeanHelper.java#L227-L261 |
killbill/killbill | api/src/main/java/org/killbill/billing/callcontext/InternalCallContext.java | InternalCallContext.toCallContext | public CallContext toCallContext(final UUID accountId, final UUID tenantId) {
return new DefaultCallContext(accountId, tenantId, createdBy, callOrigin, contextUserType, reasonCode, comments, userToken, createdDate, updatedDate);
} | java | public CallContext toCallContext(final UUID accountId, final UUID tenantId) {
return new DefaultCallContext(accountId, tenantId, createdBy, callOrigin, contextUserType, reasonCode, comments, userToken, createdDate, updatedDate);
} | [
"public",
"CallContext",
"toCallContext",
"(",
"final",
"UUID",
"accountId",
",",
"final",
"UUID",
"tenantId",
")",
"{",
"return",
"new",
"DefaultCallContext",
"(",
"accountId",
",",
"tenantId",
",",
"createdBy",
",",
"callOrigin",
",",
"contextUserType",
",",
"... | Unfortunately not true as some APIs ae hidden in object -- e.g OverdueStateApplicator is doing subscription.cancelEntitlementWithDateOverrideBillingPolicy | [
"Unfortunately",
"not",
"true",
"as",
"some",
"APIs",
"ae",
"hidden",
"in",
"object",
"--",
"e",
".",
"g",
"OverdueStateApplicator",
"is",
"doing",
"subscription",
".",
"cancelEntitlementWithDateOverrideBillingPolicy"
] | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/api/src/main/java/org/killbill/billing/callcontext/InternalCallContext.java#L107-L109 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/FindingReplacing.java | FindingReplacing.setBetnNext | public AsymmMultiPos<S, String, String> setBetnNext(String leftSameWithRight) {
return new AsymmMultiPos<S, String, String>(leftSameWithRight, leftSameWithRight) {
@Override protected S result() {
if (Strs.isEmpty(asymmLR)) {
return delegateQueue('N', left, right, pos, position, inclusive, plusminus, ... | java | public AsymmMultiPos<S, String, String> setBetnNext(String leftSameWithRight) {
return new AsymmMultiPos<S, String, String>(leftSameWithRight, leftSameWithRight) {
@Override protected S result() {
if (Strs.isEmpty(asymmLR)) {
return delegateQueue('N', left, right, pos, position, inclusive, plusminus, ... | [
"public",
"AsymmMultiPos",
"<",
"S",
",",
"String",
",",
"String",
">",
"setBetnNext",
"(",
"String",
"leftSameWithRight",
")",
"{",
"return",
"new",
"AsymmMultiPos",
"<",
"S",
",",
"String",
",",
"String",
">",
"(",
"leftSameWithRight",
",",
"leftSameWithRigh... | Sets the substrings in given same left tag and right tag as the result string, Adjacent tag matches
<p><b>The look result same as {@link StrMatcher#finder()}'s behavior</b>
@see StrMatcher#finder()
@param leftSameWithRight
@return | [
"Sets",
"the",
"substrings",
"in",
"given",
"same",
"left",
"tag",
"and",
"right",
"tag",
"as",
"the",
"result",
"string",
"Adjacent",
"tag",
"matches",
"<p",
">",
"<b",
">",
"The",
"look",
"result",
"same",
"as",
"{",
"@link",
"StrMatcher#finder",
"()",
... | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/FindingReplacing.java#L454-L463 |
mbenson/therian | core/src/main/java/therian/util/Types.java | Types.resolveAt | public static Type resolveAt(Object o, TypeVariable<?> var) {
Validate.notNull(var, "no variable to read");
final GenericDeclaration genericDeclaration = var.getGenericDeclaration();
Validate.isInstanceOf(Class.class, genericDeclaration, "%s is not declared by a Class",
TypeUtils.toL... | java | public static Type resolveAt(Object o, TypeVariable<?> var) {
Validate.notNull(var, "no variable to read");
final GenericDeclaration genericDeclaration = var.getGenericDeclaration();
Validate.isInstanceOf(Class.class, genericDeclaration, "%s is not declared by a Class",
TypeUtils.toL... | [
"public",
"static",
"Type",
"resolveAt",
"(",
"Object",
"o",
",",
"TypeVariable",
"<",
"?",
">",
"var",
")",
"{",
"Validate",
".",
"notNull",
"(",
"var",
",",
"\"no variable to read\"",
")",
";",
"final",
"GenericDeclaration",
"genericDeclaration",
"=",
"var",... | Tries to "read" a {@link TypeVariable} from an object instance, taking into account {@link BindTypeVariable} and
{@link Typed} before falling back to basic type
@param o
@param var
@return Type resolved or {@code null} | [
"Tries",
"to",
"read",
"a",
"{",
"@link",
"TypeVariable",
"}",
"from",
"an",
"object",
"instance",
"taking",
"into",
"account",
"{",
"@link",
"BindTypeVariable",
"}",
"and",
"{",
"@link",
"Typed",
"}",
"before",
"falling",
"back",
"to",
"basic",
"type"
] | train | https://github.com/mbenson/therian/blob/0653505f73e2a6f5b0abc394ea6d83af03408254/core/src/main/java/therian/util/Types.java#L94-L100 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/MergeTableHandler.java | MergeTableHandler.init | public void init(BaseField field, Record mergeTable, Record subTable, ScreenParent gridScreen)
{
super.init(field);
m_gridScreen = gridScreen;
m_mergeRecord = mergeTable;
m_subRecord = subTable;
if (subTable != null)
{ // Remove this listener when the file closes
... | java | public void init(BaseField field, Record mergeTable, Record subTable, ScreenParent gridScreen)
{
super.init(field);
m_gridScreen = gridScreen;
m_mergeRecord = mergeTable;
m_subRecord = subTable;
if (subTable != null)
{ // Remove this listener when the file closes
... | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"Record",
"mergeTable",
",",
"Record",
"subTable",
",",
"ScreenParent",
"gridScreen",
")",
"{",
"super",
".",
"init",
"(",
"field",
")",
";",
"m_gridScreen",
"=",
"gridScreen",
";",
"m_mergeRecord",
"... | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param mergeTable The parent merge record.
@param subTable The sub-record to add and remove from the parent merge record.
@param gridScreen The (optional) grid screen to requery on change. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/MergeTableHandler.java#L71-L82 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/PropertiesField.java | PropertiesField.getNewValue | public String getNewValue(String strKey, String strReadValue, String strOrigValue, String strCurrentValue)
{
String strNewValue = null;
if (((strCurrentValue != null) && (strCurrentValue.equals(strOrigValue)))
|| ((strCurrentValue == null) && (strOrigValue == null)))
{ // I hav... | java | public String getNewValue(String strKey, String strReadValue, String strOrigValue, String strCurrentValue)
{
String strNewValue = null;
if (((strCurrentValue != null) && (strCurrentValue.equals(strOrigValue)))
|| ((strCurrentValue == null) && (strOrigValue == null)))
{ // I hav... | [
"public",
"String",
"getNewValue",
"(",
"String",
"strKey",
",",
"String",
"strReadValue",
",",
"String",
"strOrigValue",
",",
"String",
"strCurrentValue",
")",
"{",
"String",
"strNewValue",
"=",
"null",
";",
"if",
"(",
"(",
"(",
"strCurrentValue",
"!=",
"null... | Given the read, original, and current values for this key, decide which to use.
@param strKey
@param strReadValue
@param strOrigValue
@param strCurrentValue
@return | [
"Given",
"the",
"read",
"original",
"and",
"current",
"values",
"for",
"this",
"key",
"decide",
"which",
"to",
"use",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/PropertiesField.java#L557-L580 |
vladmihalcea/flexy-pool | flexy-dropwizard3-metrics/src/main/java/com/vladmihalcea/flexypool/metric/codahale/Slf4jMetricReporter.java | Slf4jMetricReporter.init | @Override
public Slf4jMetricReporter init(ConfigurationProperties configurationProperties, MetricRegistry metricRegistry) {
metricLogReporterMillis = configurationProperties.getMetricLogReporterMillis();
if (metricLogReporterMillis > 0) {
this.slf4jReporter = Slf4jReporter
... | java | @Override
public Slf4jMetricReporter init(ConfigurationProperties configurationProperties, MetricRegistry metricRegistry) {
metricLogReporterMillis = configurationProperties.getMetricLogReporterMillis();
if (metricLogReporterMillis > 0) {
this.slf4jReporter = Slf4jReporter
... | [
"@",
"Override",
"public",
"Slf4jMetricReporter",
"init",
"(",
"ConfigurationProperties",
"configurationProperties",
",",
"MetricRegistry",
"metricRegistry",
")",
"{",
"metricLogReporterMillis",
"=",
"configurationProperties",
".",
"getMetricLogReporterMillis",
"(",
")",
";",... | Create a Log Reporter and activate it if the metricLogReporterMillis property is greater than zero.
@param configurationProperties configuration properties
@param metricRegistry metric registry
@return {@link Slf4jMetricReporter} | [
"Create",
"a",
"Log",
"Reporter",
"and",
"activate",
"it",
"if",
"the",
"metricLogReporterMillis",
"property",
"is",
"greater",
"than",
"zero",
"."
] | train | https://github.com/vladmihalcea/flexy-pool/blob/d763d359e68299c2b4e28e4b67770581ae083431/flexy-dropwizard3-metrics/src/main/java/com/vladmihalcea/flexypool/metric/codahale/Slf4jMetricReporter.java#L32-L42 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.noNullElements | public <T extends Iterable<?>> T noNullElements(final T iterable, final String message, final Object... values) {
notNull(iterable);
final int index = indexOfNullElement(iterable);
if (index != -1) {
fail(String.format(message, ArrayUtils.addAll(this, values, index)));
}
... | java | public <T extends Iterable<?>> T noNullElements(final T iterable, final String message, final Object... values) {
notNull(iterable);
final int index = indexOfNullElement(iterable);
if (index != -1) {
fail(String.format(message, ArrayUtils.addAll(this, values, index)));
}
... | [
"public",
"<",
"T",
"extends",
"Iterable",
"<",
"?",
">",
">",
"T",
"noNullElements",
"(",
"final",
"T",
"iterable",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"notNull",
"(",
"iterable",
")",
";",
"final",
"i... | <p>Validate that the specified argument iterable is neither {@code null} nor contains any elements that are {@code null}; otherwise throwing an exception with the specified message. </p>
<pre>Validate.noNullElements(myCollection, "The collection contains null at position %d");</pre>
<p>If the iterable is {@code null}, ... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"iterable",
"is",
"neither",
"{",
"@code",
"null",
"}",
"nor",
"contains",
"any",
"elements",
"that",
"are",
"{",
"@code",
"null",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L892-L900 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java | SelectBooleanCheckboxRenderer.renderInputTagEnd | protected void renderInputTagEnd(ResponseWriter rw, SelectBooleanCheckbox selectBooleanCheckbox)
throws IOException {
rw.endElement("input");
String caption = selectBooleanCheckbox.getCaption();
if (null != caption) {
if (selectBooleanCheckbox.isEscape()) {
rw.writeText(" " + caption, null);
} else {... | java | protected void renderInputTagEnd(ResponseWriter rw, SelectBooleanCheckbox selectBooleanCheckbox)
throws IOException {
rw.endElement("input");
String caption = selectBooleanCheckbox.getCaption();
if (null != caption) {
if (selectBooleanCheckbox.isEscape()) {
rw.writeText(" " + caption, null);
} else {... | [
"protected",
"void",
"renderInputTagEnd",
"(",
"ResponseWriter",
"rw",
",",
"SelectBooleanCheckbox",
"selectBooleanCheckbox",
")",
"throws",
"IOException",
"{",
"rw",
".",
"endElement",
"(",
"\"input\"",
")",
";",
"String",
"caption",
"=",
"selectBooleanCheckbox",
"."... | Closes the input tag. This method is protected in order to allow
third-party frameworks to derive from it.
@param rw
the response writer
@param selectBooleanCheckbox
the component to render
@throws IOException
may be thrown by the response writer | [
"Closes",
"the",
"input",
"tag",
".",
"This",
"method",
"is",
"protected",
"in",
"order",
"to",
"allow",
"third",
"-",
"party",
"frameworks",
"to",
"derive",
"from",
"it",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java#L340-L353 |
icode/ameba | src/main/java/ameba/container/Container.java | Container.registerBinder | protected void registerBinder(ResourceConfig configuration) {
configuration.register(new AbstractBinder() {
@Override
protected void configure() {
bind(Container.this).to(Container.class).proxy(false);
}
});
configuration.registerInstances(new ... | java | protected void registerBinder(ResourceConfig configuration) {
configuration.register(new AbstractBinder() {
@Override
protected void configure() {
bind(Container.this).to(Container.class).proxy(false);
}
});
configuration.registerInstances(new ... | [
"protected",
"void",
"registerBinder",
"(",
"ResourceConfig",
"configuration",
")",
"{",
"configuration",
".",
"register",
"(",
"new",
"AbstractBinder",
"(",
")",
"{",
"@",
"Override",
"protected",
"void",
"configure",
"(",
")",
"{",
"bind",
"(",
"Container",
... | <p>registerBinder.</p>
@param configuration a {@link org.glassfish.jersey.server.ResourceConfig} object.
@since 0.1.6e | [
"<p",
">",
"registerBinder",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/container/Container.java#L75-L102 |
liferay/com-liferay-commerce | commerce-product-type-grouped-service/src/main/java/com/liferay/commerce/product/type/grouped/service/persistence/impl/CPDefinitionGroupedEntryPersistenceImpl.java | CPDefinitionGroupedEntryPersistenceImpl.removeByUuid_C | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPDefinitionGroupedEntry cpDefinitionGroupedEntry : findByUuid_C(
uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpDefinitionGroupedEntry);
}
} | java | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPDefinitionGroupedEntry cpDefinitionGroupedEntry : findByUuid_C(
uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpDefinitionGroupedEntry);
}
} | [
"@",
"Override",
"public",
"void",
"removeByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
")",
"{",
"for",
"(",
"CPDefinitionGroupedEntry",
"cpDefinitionGroupedEntry",
":",
"findByUuid_C",
"(",
"uuid",
",",
"companyId",
",",
"QueryUtil",
".",
"ALL_POS"... | Removes all the cp definition grouped entries where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID | [
"Removes",
"all",
"the",
"cp",
"definition",
"grouped",
"entries",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-grouped-service/src/main/java/com/liferay/commerce/product/type/grouped/service/persistence/impl/CPDefinitionGroupedEntryPersistenceImpl.java#L1418-L1424 |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/internal/rendering/writer/vml/geometry/PointWriter.java | PointWriter.writeObject | public void writeObject(Object o, GraphicsDocument document, boolean asChild) throws RenderException {
document.writeElement("vml:shape", asChild);
Point p = (Point) o;
String adj = document.getFormatter().format(p.getX()) + ","
+ document.getFormatter().format(p.getY());
document.writeAttribute("adj", adj)... | java | public void writeObject(Object o, GraphicsDocument document, boolean asChild) throws RenderException {
document.writeElement("vml:shape", asChild);
Point p = (Point) o;
String adj = document.getFormatter().format(p.getX()) + ","
+ document.getFormatter().format(p.getY());
document.writeAttribute("adj", adj)... | [
"public",
"void",
"writeObject",
"(",
"Object",
"o",
",",
"GraphicsDocument",
"document",
",",
"boolean",
"asChild",
")",
"throws",
"RenderException",
"{",
"document",
".",
"writeElement",
"(",
"\"vml:shape\"",
",",
"asChild",
")",
";",
"Point",
"p",
"=",
"(",... | Writes the object to the specified document, optionally creating a child
element. The object in this case should be a point.
@param o the object (of type Point).
@param document the document to write to.
@param asChild create child element if true.
@throws RenderException | [
"Writes",
"the",
"object",
"to",
"the",
"specified",
"document",
"optionally",
"creating",
"a",
"child",
"element",
".",
"The",
"object",
"in",
"this",
"case",
"should",
"be",
"a",
"point",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/rendering/writer/vml/geometry/PointWriter.java#L38-L44 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/autoscale/autoscalepolicy_stats.java | autoscalepolicy_stats.get | public static autoscalepolicy_stats get(nitro_service service, String name) throws Exception{
autoscalepolicy_stats obj = new autoscalepolicy_stats();
obj.set_name(name);
autoscalepolicy_stats response = (autoscalepolicy_stats) obj.stat_resource(service);
return response;
} | java | public static autoscalepolicy_stats get(nitro_service service, String name) throws Exception{
autoscalepolicy_stats obj = new autoscalepolicy_stats();
obj.set_name(name);
autoscalepolicy_stats response = (autoscalepolicy_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"autoscalepolicy_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"autoscalepolicy_stats",
"obj",
"=",
"new",
"autoscalepolicy_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
... | Use this API to fetch statistics of autoscalepolicy_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"autoscalepolicy_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/autoscale/autoscalepolicy_stats.java#L169-L174 |
google/closure-templates | java/src/com/google/template/soy/error/SoyErrors.java | SoyErrors.getClosest | @Nullable
@VisibleForTesting
static String getClosest(Iterable<String> allNames, String wrongName) {
// only suggest matches that are closer than this. This magic heuristic is based on what llvm
// and javac do
int shortest = (wrongName.length() + 2) / 3 + 1;
String closestName = null;
for (Str... | java | @Nullable
@VisibleForTesting
static String getClosest(Iterable<String> allNames, String wrongName) {
// only suggest matches that are closer than this. This magic heuristic is based on what llvm
// and javac do
int shortest = (wrongName.length() + 2) / 3 + 1;
String closestName = null;
for (Str... | [
"@",
"Nullable",
"@",
"VisibleForTesting",
"static",
"String",
"getClosest",
"(",
"Iterable",
"<",
"String",
">",
"allNames",
",",
"String",
"wrongName",
")",
"{",
"// only suggest matches that are closer than this. This magic heuristic is based on what llvm",
"// and javac do... | Returns the member of {@code allNames} that is closest to {@code wrongName}, or {@code null} if
{@code allNames} is empty.
<p>The distance metric is a case insensitive Levenshtein distance.
@throws IllegalArgumentException if {@code wrongName} is a member of {@code allNames} | [
"Returns",
"the",
"member",
"of",
"{",
"@code",
"allNames",
"}",
"that",
"is",
"closest",
"to",
"{",
"@code",
"wrongName",
"}",
"or",
"{",
"@code",
"null",
"}",
"if",
"{",
"@code",
"allNames",
"}",
"is",
"empty",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/error/SoyErrors.java#L69-L90 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java | CacheConfigurationBuilder.withValueCopier | public CacheConfigurationBuilder<K, V> withValueCopier(Copier<V> valueCopier) {
return withCopier(new DefaultCopierConfiguration<>(requireNonNull(valueCopier, "Null value copier"), DefaultCopierConfiguration.Type.VALUE));
} | java | public CacheConfigurationBuilder<K, V> withValueCopier(Copier<V> valueCopier) {
return withCopier(new DefaultCopierConfiguration<>(requireNonNull(valueCopier, "Null value copier"), DefaultCopierConfiguration.Type.VALUE));
} | [
"public",
"CacheConfigurationBuilder",
"<",
"K",
",",
"V",
">",
"withValueCopier",
"(",
"Copier",
"<",
"V",
">",
"valueCopier",
")",
"{",
"return",
"withCopier",
"(",
"new",
"DefaultCopierConfiguration",
"<>",
"(",
"requireNonNull",
"(",
"valueCopier",
",",
"\"N... | Adds by-value semantic using the provided {@link Copier} for the value on heap.
<p>
{@link Copier}s are what enable control of by-reference / by-value semantics for on-heap tier.
@param valueCopier the value copier to use
@return a new builder with the added value copier | [
"Adds",
"by",
"-",
"value",
"semantic",
"using",
"the",
"provided",
"{",
"@link",
"Copier",
"}",
"for",
"the",
"value",
"on",
"heap",
".",
"<p",
">",
"{",
"@link",
"Copier",
"}",
"s",
"are",
"what",
"enable",
"control",
"of",
"by",
"-",
"reference",
... | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java#L432-L434 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java | BoofConcurrency.loopFor | public static void loopFor(int start , int endExclusive , int step , IntConsumer consumer ) {
try {
int range = endExclusive-start;
pool.submit(() ->IntStream.range(0, range/step).parallel().forEach(i-> consumer.accept(start+i*step))).get();
} catch (InterruptedException | ExecutionException e) {
e.printSt... | java | public static void loopFor(int start , int endExclusive , int step , IntConsumer consumer ) {
try {
int range = endExclusive-start;
pool.submit(() ->IntStream.range(0, range/step).parallel().forEach(i-> consumer.accept(start+i*step))).get();
} catch (InterruptedException | ExecutionException e) {
e.printSt... | [
"public",
"static",
"void",
"loopFor",
"(",
"int",
"start",
",",
"int",
"endExclusive",
",",
"int",
"step",
",",
"IntConsumer",
"consumer",
")",
"{",
"try",
"{",
"int",
"range",
"=",
"endExclusive",
"-",
"start",
";",
"pool",
".",
"submit",
"(",
"(",
"... | Concurrent for loop. Each loop with spawn as a thread up to the maximum number of threads.
@param start starting value, inclusive
@param endExclusive ending value, exclusive
@param consumer The consumer | [
"Concurrent",
"for",
"loop",
".",
"Each",
"loop",
"with",
"spawn",
"as",
"a",
"thread",
"up",
"to",
"the",
"maximum",
"number",
"of",
"threads",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java#L75-L82 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vpc/VpcClient.java | VpcClient.createVpc | public CreateVpcResponse createVpc(String name, String cidr) {
CreateVpcRequest request = new CreateVpcRequest();
request.withName(name).withCidr(cidr);
return createVpc(request);
} | java | public CreateVpcResponse createVpc(String name, String cidr) {
CreateVpcRequest request = new CreateVpcRequest();
request.withName(name).withCidr(cidr);
return createVpc(request);
} | [
"public",
"CreateVpcResponse",
"createVpc",
"(",
"String",
"name",
",",
"String",
"cidr",
")",
"{",
"CreateVpcRequest",
"request",
"=",
"new",
"CreateVpcRequest",
"(",
")",
";",
"request",
".",
"withName",
"(",
"name",
")",
".",
"withCidr",
"(",
"cidr",
")",... | Create a vpc with the specified options.
@param name The name of vpc
@param cidr The CIDR of vpc
@return List of vpcId newly created | [
"Create",
"a",
"vpc",
"with",
"the",
"specified",
"options",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vpc/VpcClient.java#L156-L160 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/plugins/JarPluginProviderLoader.java | JarPluginProviderLoader.createCachedJar | protected File createCachedJar(final File dir, final String jarName) throws PluginException {
File cachedJar;
try {
cachedJar = new File(dir, jarName);
cachedJar.deleteOnExit();
FileUtils.fileCopy(pluginJar, cachedJar, true);
} catch (IOException e) {
... | java | protected File createCachedJar(final File dir, final String jarName) throws PluginException {
File cachedJar;
try {
cachedJar = new File(dir, jarName);
cachedJar.deleteOnExit();
FileUtils.fileCopy(pluginJar, cachedJar, true);
} catch (IOException e) {
... | [
"protected",
"File",
"createCachedJar",
"(",
"final",
"File",
"dir",
",",
"final",
"String",
"jarName",
")",
"throws",
"PluginException",
"{",
"File",
"cachedJar",
";",
"try",
"{",
"cachedJar",
"=",
"new",
"File",
"(",
"dir",
",",
"jarName",
")",
";",
"cac... | Creates a single cached version of the pluginJar located within pluginJarCacheDirectory
deleting all existing versions of pluginJar
@param jarName | [
"Creates",
"a",
"single",
"cached",
"version",
"of",
"the",
"pluginJar",
"located",
"within",
"pluginJarCacheDirectory",
"deleting",
"all",
"existing",
"versions",
"of",
"pluginJar"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/plugins/JarPluginProviderLoader.java#L405-L415 |
structurizr/java | structurizr-core/src/com/structurizr/model/DeploymentNode.java | DeploymentNode.addDeploymentNode | public DeploymentNode addDeploymentNode(String name, String description, String technology, int instances) {
return addDeploymentNode(name, description, technology, instances, null);
} | java | public DeploymentNode addDeploymentNode(String name, String description, String technology, int instances) {
return addDeploymentNode(name, description, technology, instances, null);
} | [
"public",
"DeploymentNode",
"addDeploymentNode",
"(",
"String",
"name",
",",
"String",
"description",
",",
"String",
"technology",
",",
"int",
"instances",
")",
"{",
"return",
"addDeploymentNode",
"(",
"name",
",",
"description",
",",
"technology",
",",
"instances... | Adds a child deployment node.
@param name the name of the deployment node
@param description a short description
@param technology the technology
@param instances the number of instances
@return a DeploymentNode object | [
"Adds",
"a",
"child",
"deployment",
"node",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/DeploymentNode.java#L78-L80 |
Samsung/GearVRf | GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/TimeSensor.java | TimeSensor.setEnabled | public void setEnabled(boolean enable, GVRContext gvrContext) {
if (this.enabled != enabled ) {
// a change in the animation stopping / starting
for (GVRNodeAnimation gvrKeyFrameAnimation : gvrKeyFrameAnimations) {
if (enable) gvrKeyFrameAnimation.start(gvrContext.getAnim... | java | public void setEnabled(boolean enable, GVRContext gvrContext) {
if (this.enabled != enabled ) {
// a change in the animation stopping / starting
for (GVRNodeAnimation gvrKeyFrameAnimation : gvrKeyFrameAnimations) {
if (enable) gvrKeyFrameAnimation.start(gvrContext.getAnim... | [
"public",
"void",
"setEnabled",
"(",
"boolean",
"enable",
",",
"GVRContext",
"gvrContext",
")",
"{",
"if",
"(",
"this",
".",
"enabled",
"!=",
"enabled",
")",
"{",
"// a change in the animation stopping / starting",
"for",
"(",
"GVRNodeAnimation",
"gvrKeyFrameAnimation... | setEnabled will set the TimeSensor enable variable.
if true, then it will started the animation
if fase, then it changes repeat mode to ONCE so the animation will conclude.
There is no simple stop() animation
@param enable
@param gvrContext | [
"setEnabled",
"will",
"set",
"the",
"TimeSensor",
"enable",
"variable",
".",
"if",
"true",
"then",
"it",
"will",
"started",
"the",
"animation",
"if",
"fase",
"then",
"it",
"changes",
"repeat",
"mode",
"to",
"ONCE",
"so",
"the",
"animation",
"will",
"conclude... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/TimeSensor.java#L76-L87 |
mguymon/naether | src/main/java/com/tobedevoured/naether/maven/Project.java | Project.toXml | public String toXml() throws ProjectException {
log.debug("Writing xml");
Project copy = this;
copy.removeProperty( "project.basedir" );
StringWriter writer = new StringWriter();
MavenXpp3Writer pomWriter = new MavenXpp3Writer();
try {
pomWriter.write(write... | java | public String toXml() throws ProjectException {
log.debug("Writing xml");
Project copy = this;
copy.removeProperty( "project.basedir" );
StringWriter writer = new StringWriter();
MavenXpp3Writer pomWriter = new MavenXpp3Writer();
try {
pomWriter.write(write... | [
"public",
"String",
"toXml",
"(",
")",
"throws",
"ProjectException",
"{",
"log",
".",
"debug",
"(",
"\"Writing xml\"",
")",
";",
"Project",
"copy",
"=",
"this",
";",
"copy",
".",
"removeProperty",
"(",
"\"project.basedir\"",
")",
";",
"StringWriter",
"writer",... | Convert Project to POM XML
@return String
@throws ProjectException exception | [
"Convert",
"Project",
"to",
"POM",
"XML"
] | train | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/maven/Project.java#L543-L560 |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/BitemporalMapper.java | BitemporalMapper.readBitemporalDate | BitemporalDateTime readBitemporalDate(Columns columns, String field) {
return parseBitemporalDate(columns.valueForField(field));
} | java | BitemporalDateTime readBitemporalDate(Columns columns, String field) {
return parseBitemporalDate(columns.valueForField(field));
} | [
"BitemporalDateTime",
"readBitemporalDate",
"(",
"Columns",
"columns",
",",
"String",
"field",
")",
"{",
"return",
"parseBitemporalDate",
"(",
"columns",
".",
"valueForField",
"(",
"field",
")",
")",
";",
"}"
] | Returns a {@link BitemporalDateTime} read from the specified {@link Columns}.
@param columns the column where the data is
@param field the name of the field to be read from {@code columns}
@return a bitemporal date time | [
"Returns",
"a",
"{",
"@link",
"BitemporalDateTime",
"}",
"read",
"from",
"the",
"specified",
"{",
"@link",
"Columns",
"}",
"."
] | train | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/BitemporalMapper.java#L173-L175 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/DocumentationUtils.java | DocumentationUtils.createLinkToServiceDocumentation | public static String createLinkToServiceDocumentation(Metadata metadata, String name) {
if (isCrossLinkingEnabledForService(metadata)) {
return String.format("@see <a href=\"http://%s/goto/WebAPI/%s/%s\" target=\"_top\">AWS API Documentation</a>",
AWS_DOCS_HOST,
... | java | public static String createLinkToServiceDocumentation(Metadata metadata, String name) {
if (isCrossLinkingEnabledForService(metadata)) {
return String.format("@see <a href=\"http://%s/goto/WebAPI/%s/%s\" target=\"_top\">AWS API Documentation</a>",
AWS_DOCS_HOST,
... | [
"public",
"static",
"String",
"createLinkToServiceDocumentation",
"(",
"Metadata",
"metadata",
",",
"String",
"name",
")",
"{",
"if",
"(",
"isCrossLinkingEnabledForService",
"(",
"metadata",
")",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"@see <a href=\\\"... | Create the HTML for a link to the operation/shape core AWS docs site
@param metadata the UID for the service from that services metadata
@param name the name of the shape/request/operation
@return a '@see also' HTML link to the doc | [
"Create",
"the",
"HTML",
"for",
"a",
"link",
"to",
"the",
"operation",
"/",
"shape",
"core",
"AWS",
"docs",
"site"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/DocumentationUtils.java#L130-L138 |
primefaces/primefaces | src/main/java/org/primefaces/expression/SearchExpressionFacade.java | SearchExpressionFacade.resolveComponent | public static UIComponent resolveComponent(FacesContext context, UIComponent source, String expression) {
return resolveComponent(context, source, expression, SearchExpressionHint.NONE);
} | java | public static UIComponent resolveComponent(FacesContext context, UIComponent source, String expression) {
return resolveComponent(context, source, expression, SearchExpressionHint.NONE);
} | [
"public",
"static",
"UIComponent",
"resolveComponent",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"source",
",",
"String",
"expression",
")",
"{",
"return",
"resolveComponent",
"(",
"context",
",",
"source",
",",
"expression",
",",
"SearchExpressionHint",
"... | Resolves a {@link UIComponent} for the given expression.
@param context The {@link FacesContext}.
@param source The source component. E.g. a button.
@param expression The search expression.
@return A resolved {@link UIComponent} or <code>null</code>. | [
"Resolves",
"a",
"{",
"@link",
"UIComponent",
"}",
"for",
"the",
"given",
"expression",
"."
] | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/expression/SearchExpressionFacade.java#L419-L422 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/SigninPanel.java | SigninPanel.newPasswordTextField | protected LabeledPasswordTextFieldPanel<String, T> newPasswordTextField(final String id,
final IModel<T> model)
{
final IModel<String> labelModel = ResourceModelFactory
.newResourceModel("global.password.label", this);
final IModel<String> placeholderModel = ResourceModelFactory
.newResourceModel("global.e... | java | protected LabeledPasswordTextFieldPanel<String, T> newPasswordTextField(final String id,
final IModel<T> model)
{
final IModel<String> labelModel = ResourceModelFactory
.newResourceModel("global.password.label", this);
final IModel<String> placeholderModel = ResourceModelFactory
.newResourceModel("global.e... | [
"protected",
"LabeledPasswordTextFieldPanel",
"<",
"String",
",",
"T",
">",
"newPasswordTextField",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"final",
"IModel",
"<",
"String",
">",
"labelModel",
"=",
"ResourceModel... | Factory method for creating the EmailTextField for the password. This method is invoked in
the constructor from the derived classes and can be overridden so users can provide their own
version of a EmailTextField for the password.
@param id
the id
@param model
the model
@return the text field LabeledPasswordTextFieldP... | [
"Factory",
"method",
"for",
"creating",
"the",
"EmailTextField",
"for",
"the",
"password",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/SigninPanel.java#L121-L152 |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/document/DocClassifierCrossValidator.java | DocClassifierCrossValidator.evaluate | public void evaluate(ObjectStream<DocSample> samples, int nFolds)
throws IOException {
CrossValidationPartitioner<DocSample> partitioner = new CrossValidationPartitioner<>(
samples, nFolds);
while (partitioner.hasNext()) {
CrossValidationPartitioner.TrainingSampleStream<DocSample> trainin... | java | public void evaluate(ObjectStream<DocSample> samples, int nFolds)
throws IOException {
CrossValidationPartitioner<DocSample> partitioner = new CrossValidationPartitioner<>(
samples, nFolds);
while (partitioner.hasNext()) {
CrossValidationPartitioner.TrainingSampleStream<DocSample> trainin... | [
"public",
"void",
"evaluate",
"(",
"ObjectStream",
"<",
"DocSample",
">",
"samples",
",",
"int",
"nFolds",
")",
"throws",
"IOException",
"{",
"CrossValidationPartitioner",
"<",
"DocSample",
">",
"partitioner",
"=",
"new",
"CrossValidationPartitioner",
"<>",
"(",
"... | Starts the evaluation.
@param samples
the data to train and test
@param nFolds
number of folds
@throws IOException if io error | [
"Starts",
"the",
"evaluation",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/document/DocClassifierCrossValidator.java#L60-L83 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getRewrittenHrefURI | public static String getRewrittenHrefURI( ServletContext servletContext, HttpServletRequest request,
HttpServletResponse response, String path, Map params,
String fragment, boolean forXML )
throws URISyntaxException
... | java | public static String getRewrittenHrefURI( ServletContext servletContext, HttpServletRequest request,
HttpServletResponse response, String path, Map params,
String fragment, boolean forXML )
throws URISyntaxException
... | [
"public",
"static",
"String",
"getRewrittenHrefURI",
"(",
"ServletContext",
"servletContext",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"path",
",",
"Map",
"params",
",",
"String",
"fragment",
",",
"boolean",
"forXML"... | Create a fully-rewritten URI given a path and parameters.
<p> Calls the rewriter service using a type of {@link URLType#ACTION}. </p>
@param servletContext the current ServletContext.
@param request the current HttpServletRequest.
@param response the current HttpServletResponse.
@param path the path to process into a... | [
"Create",
"a",
"fully",
"-",
"rewritten",
"URI",
"given",
"a",
"path",
"and",
"parameters",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L1571-L1577 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/form/SigninFormPanel.java | SigninFormPanel.newPasswordForgottenLink | protected MarkupContainer newPasswordForgottenLink(final String id, final IModel<T> model)
{
final LinkPanel linkPanel = new LinkPanel(id,
ResourceModelFactory.newResourceModel(ResourceBundleKey.builder()
.key("password.forgotten.label").defaultValue("Password forgotten").build()))
{
/**
* The serial... | java | protected MarkupContainer newPasswordForgottenLink(final String id, final IModel<T> model)
{
final LinkPanel linkPanel = new LinkPanel(id,
ResourceModelFactory.newResourceModel(ResourceBundleKey.builder()
.key("password.forgotten.label").defaultValue("Password forgotten").build()))
{
/**
* The serial... | [
"protected",
"MarkupContainer",
"newPasswordForgottenLink",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"final",
"LinkPanel",
"linkPanel",
"=",
"new",
"LinkPanel",
"(",
"id",
",",
"ResourceModelFactory",
".",
"newResou... | Factory method for create the new {@link MarkupContainer} of the {@link Link} for the
password forgotten. This method is invoked in the constructor from the derived classes and
can be overridden so users can provide their own version of a new {@link MarkupContainer} of
the {@link Link} for the password forgotten.
@par... | [
"Factory",
"method",
"for",
"create",
"the",
"new",
"{",
"@link",
"MarkupContainer",
"}",
"of",
"the",
"{",
"@link",
"Link",
"}",
"for",
"the",
"password",
"forgotten",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"der... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/in/form/SigninFormPanel.java#L173-L195 |
amaembo/streamex | src/main/java/one/util/streamex/MoreCollectors.java | MoreCollectors.onlyOne | public static <T> Collector<T, ?, Optional<T>> onlyOne(Predicate<? super T> predicate) {
return filtering(predicate, onlyOne());
} | java | public static <T> Collector<T, ?, Optional<T>> onlyOne(Predicate<? super T> predicate) {
return filtering(predicate, onlyOne());
} | [
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Optional",
"<",
"T",
">",
">",
"onlyOne",
"(",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"return",
"filtering",
"(",
"predicate",
",",
"onlyOne",
"(",
... | Returns a {@code Collector} which collects the stream element satisfying the predicate
if there is only one such element.
<p>
This method returns a
<a href="package-summary.html#ShortCircuitReduction">short-circuiting
collector</a>.
@param predicate a predicate to be applied to the stream elements
@param <T> the type... | [
"Returns",
"a",
"{",
"@code",
"Collector",
"}",
"which",
"collects",
"the",
"stream",
"element",
"satisfying",
"the",
"predicate",
"if",
"there",
"is",
"only",
"one",
"such",
"element",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/MoreCollectors.java#L531-L533 |
ltsopensource/light-task-scheduler | lts-core/src/main/java/com/github/ltsopensource/core/commons/utils/WebUtils.java | WebUtils.decode | public static String decode(String value, String charset) {
String result = null;
if (!StringUtils.isEmpty(value)) {
try {
result = URLDecoder.decode(value, charset);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
... | java | public static String decode(String value, String charset) {
String result = null;
if (!StringUtils.isEmpty(value)) {
try {
result = URLDecoder.decode(value, charset);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
... | [
"public",
"static",
"String",
"decode",
"(",
"String",
"value",
",",
"String",
"charset",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"value",
")",
")",
"{",
"try",
"{",
"result",
"=",
"URLDecoder... | 使用指定的字符集反编码请求参数值。
@param value 参数值
@param charset 字符集
@return 反编码后的参数值 | [
"使用指定的字符集反编码请求参数值。"
] | train | https://github.com/ltsopensource/light-task-scheduler/blob/64d3aa000ff5022be5e94f511b58f405e5f4c8eb/lts-core/src/main/java/com/github/ltsopensource/core/commons/utils/WebUtils.java#L313-L323 |
onepf/OpenIAB | library/src/main/java/org/onepf/oms/OpenIabHelper.java | OpenIabHelper.getStoreSku | @NotNull
public static String getStoreSku(@NotNull final String appStoreName, @NotNull String sku) {
return SkuManager.getInstance().getStoreSku(appStoreName, sku);
} | java | @NotNull
public static String getStoreSku(@NotNull final String appStoreName, @NotNull String sku) {
return SkuManager.getInstance().getStoreSku(appStoreName, sku);
} | [
"@",
"NotNull",
"public",
"static",
"String",
"getStoreSku",
"(",
"@",
"NotNull",
"final",
"String",
"appStoreName",
",",
"@",
"NotNull",
"String",
"sku",
")",
"{",
"return",
"SkuManager",
".",
"getInstance",
"(",
")",
".",
"getStoreSku",
"(",
"appStoreName",
... | Return the previously mapped store SKU for the internal SKU
@param appStoreName The store name
@param sku The internal SKU
@return SKU used in the store for the specified internal SKU
@see org.onepf.oms.SkuManager#mapSku(String, String, String)
@deprecated Use {@link org.onepf.oms.SkuManager#getStoreSku(Strin... | [
"Return",
"the",
"previously",
"mapped",
"store",
"SKU",
"for",
"the",
"internal",
"SKU"
] | train | https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/OpenIabHelper.java#L367-L370 |
JOML-CI/JOML | src/org/joml/Matrix3x2d.java | Matrix3x2d.scaleAround | public Matrix3x2d scaleAround(double sx, double sy, double ox, double oy) {
return scaleAround(sx, sy, ox, oy, this);
} | java | public Matrix3x2d scaleAround(double sx, double sy, double ox, double oy) {
return scaleAround(sx, sy, ox, oy, this);
} | [
"public",
"Matrix3x2d",
"scaleAround",
"(",
"double",
"sx",
",",
"double",
"sy",
",",
"double",
"ox",
",",
"double",
"oy",
")",
"{",
"return",
"scaleAround",
"(",
"sx",
",",
"sy",
",",
"ox",
",",
"oy",
",",
"this",
")",
";",
"}"
] | Apply scaling to this matrix by scaling the base axes by the given sx and
sy factors while using <code>(ox, oy)</code> as the scaling origin.
<p>
If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix,
then the new matrix will be <code>M * S</code>. So when transforming a
vector <code>v</co... | [
"Apply",
"scaling",
"to",
"this",
"matrix",
"by",
"scaling",
"the",
"base",
"axes",
"by",
"the",
"given",
"sx",
"and",
"sy",
"factors",
"while",
"using",
"<code",
">",
"(",
"ox",
"oy",
")",
"<",
"/",
"code",
">",
"as",
"the",
"scaling",
"origin",
"."... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2d.java#L1464-L1466 |
konmik/solid | streams/src/main/java/solid/stream/Stream.java | Stream.distinct | public Stream<T> distinct() {
final ArrayList<T> passed = new ArrayList<>();
return filter(new Func1<T, Boolean>() {
@Override
public Boolean call(T value) {
if (passed.contains(value))
return false;
passed.add(value);
... | java | public Stream<T> distinct() {
final ArrayList<T> passed = new ArrayList<>();
return filter(new Func1<T, Boolean>() {
@Override
public Boolean call(T value) {
if (passed.contains(value))
return false;
passed.add(value);
... | [
"public",
"Stream",
"<",
"T",
">",
"distinct",
"(",
")",
"{",
"final",
"ArrayList",
"<",
"T",
">",
"passed",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"return",
"filter",
"(",
"new",
"Func1",
"<",
"T",
",",
"Boolean",
">",
"(",
")",
"{",
"@",... | Returns a new stream that filters out duplicate items off the current stream.
<p/>
This operator keeps a list of all items that has been passed to
compare it against next items.
@return a new stream that filters out duplicate items off the current stream. | [
"Returns",
"a",
"new",
"stream",
"that",
"filters",
"out",
"duplicate",
"items",
"off",
"the",
"current",
"stream",
".",
"<p",
"/",
">",
"This",
"operator",
"keeps",
"a",
"list",
"of",
"all",
"items",
"that",
"has",
"been",
"passed",
"to",
"compare",
"it... | train | https://github.com/konmik/solid/blob/3d6c452ef3219fd843547f3590b3d2e1ad3f1d17/streams/src/main/java/solid/stream/Stream.java#L482-L493 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/msg/ReadFileRecordRequest.java | ReadFileRecordRequest.readData | public void readData(DataInput din) throws IOException {
int byteCount = din.readUnsignedByte();
int recordCount = byteCount / 7;
records = new RecordRequest[recordCount];
for (int i = 0; i < recordCount; i++) {
if (din.readByte() != 6) {
throw new IOExcepti... | java | public void readData(DataInput din) throws IOException {
int byteCount = din.readUnsignedByte();
int recordCount = byteCount / 7;
records = new RecordRequest[recordCount];
for (int i = 0; i < recordCount; i++) {
if (din.readByte() != 6) {
throw new IOExcepti... | [
"public",
"void",
"readData",
"(",
"DataInput",
"din",
")",
"throws",
"IOException",
"{",
"int",
"byteCount",
"=",
"din",
".",
"readUnsignedByte",
"(",
")",
";",
"int",
"recordCount",
"=",
"byteCount",
"/",
"7",
";",
"records",
"=",
"new",
"RecordRequest",
... | readData -- read all the data for this request.
@throws java.io.IOException If the data cannot be read | [
"readData",
"--",
"read",
"all",
"the",
"data",
"for",
"this",
"request",
"."
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/msg/ReadFileRecordRequest.java#L175-L196 |
Javen205/IJPay | src/main/java/com/jpay/util/IOUtils.java | IOUtils.toFile | public static void toFile(InputStream input, File file) throws IOException {
OutputStream os = new FileOutputStream(file);
int bytesRead = 0;
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
while ((bytesRead = input.read(buffer, 0, DEFAULT_BUFFER_SIZE)) != -1) {
os.write(buffer, 0, bytesRead);
}
IOUtils.c... | java | public static void toFile(InputStream input, File file) throws IOException {
OutputStream os = new FileOutputStream(file);
int bytesRead = 0;
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
while ((bytesRead = input.read(buffer, 0, DEFAULT_BUFFER_SIZE)) != -1) {
os.write(buffer, 0, bytesRead);
}
IOUtils.c... | [
"public",
"static",
"void",
"toFile",
"(",
"InputStream",
"input",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"OutputStream",
"os",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
";",
"int",
"bytesRead",
"=",
"0",
";",
"byte",
"[",
"]",
"... | InputStream to File
@param input the <code>InputStream</code> to read from
@param file the File to write
@throws IOException id异常 | [
"InputStream",
"to",
"File"
] | train | https://github.com/Javen205/IJPay/blob/78da6be4b70675abc6a41df74817532fa257ef29/src/main/java/com/jpay/util/IOUtils.java#L66-L75 |
stapler/stapler | groovy/src/main/java/org/kohsuke/stapler/jelly/groovy/SimpleTemplateParser.java | SimpleTemplateParser.groovySection | private void groovySection(Reader reader, StringWriter sw) throws IOException {
sw.write("\"\"\");");
int c;
while ((c = reader.read()) != -1) {
if (c == '%') {
c = reader.read();
if (c != '>') {
sw.write('%');
} els... | java | private void groovySection(Reader reader, StringWriter sw) throws IOException {
sw.write("\"\"\");");
int c;
while ((c = reader.read()) != -1) {
if (c == '%') {
c = reader.read();
if (c != '>') {
sw.write('%');
} els... | [
"private",
"void",
"groovySection",
"(",
"Reader",
"reader",
",",
"StringWriter",
"sw",
")",
"throws",
"IOException",
"{",
"sw",
".",
"write",
"(",
"\"\\\"\\\"\\\");\"",
")",
";",
"int",
"c",
";",
"while",
"(",
"(",
"c",
"=",
"reader",
".",
"read",
"(",
... | Closes the currently open write and writes the following text as normal Groovy script code until it reaches an end %>.
@param reader a reader for the template text
@param sw a StringWriter to write expression content
@throws IOException if something goes wrong | [
"Closes",
"the",
"currently",
"open",
"write",
"and",
"writes",
"the",
"following",
"text",
"as",
"normal",
"Groovy",
"script",
"code",
"until",
"it",
"reaches",
"an",
"end",
"%",
">",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/groovy/src/main/java/org/kohsuke/stapler/jelly/groovy/SimpleTemplateParser.java#L161-L181 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlGroupContainer.java | CmsXmlGroupContainer.fillResource | protected void fillResource(CmsObject cms, Element element, CmsResource res) {
String xpath = element.getPath();
int pos = xpath.lastIndexOf("/" + XmlNode.GroupContainers.name() + "/");
if (pos > 0) {
xpath = xpath.substring(pos + 1);
}
CmsRelationType type = getHand... | java | protected void fillResource(CmsObject cms, Element element, CmsResource res) {
String xpath = element.getPath();
int pos = xpath.lastIndexOf("/" + XmlNode.GroupContainers.name() + "/");
if (pos > 0) {
xpath = xpath.substring(pos + 1);
}
CmsRelationType type = getHand... | [
"protected",
"void",
"fillResource",
"(",
"CmsObject",
"cms",
",",
"Element",
"element",
",",
"CmsResource",
"res",
")",
"{",
"String",
"xpath",
"=",
"element",
".",
"getPath",
"(",
")",
";",
"int",
"pos",
"=",
"xpath",
".",
"lastIndexOf",
"(",
"\"/\"",
... | Fills a {@link CmsXmlVfsFileValue} with the resource identified by the given id.<p>
@param cms the current CMS context
@param element the XML element to fill
@param res the resource to use | [
"Fills",
"a",
"{",
"@link",
"CmsXmlVfsFileValue",
"}",
"with",
"the",
"resource",
"identified",
"by",
"the",
"given",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlGroupContainer.java#L281-L290 |
pmayweg/sonar-groovy | sonar-groovy-plugin/src/main/java/org/sonar/plugins/groovy/jacoco/JaCoCoReportMerger.java | JaCoCoReportMerger.mergeReports | public static void mergeReports(File reportOverall, File... reports) {
SessionInfoStore infoStore = new SessionInfoStore();
ExecutionDataStore dataStore = new ExecutionDataStore();
boolean isCurrentVersionFormat = loadSourceFiles(infoStore, dataStore, reports);
try (BufferedOutputStream outputStream = ... | java | public static void mergeReports(File reportOverall, File... reports) {
SessionInfoStore infoStore = new SessionInfoStore();
ExecutionDataStore dataStore = new ExecutionDataStore();
boolean isCurrentVersionFormat = loadSourceFiles(infoStore, dataStore, reports);
try (BufferedOutputStream outputStream = ... | [
"public",
"static",
"void",
"mergeReports",
"(",
"File",
"reportOverall",
",",
"File",
"...",
"reports",
")",
"{",
"SessionInfoStore",
"infoStore",
"=",
"new",
"SessionInfoStore",
"(",
")",
";",
"ExecutionDataStore",
"dataStore",
"=",
"new",
"ExecutionDataStore",
... | Merge all reports in reportOverall.
@param reportOverall destination file of merge.
@param reports files to be merged. | [
"Merge",
"all",
"reports",
"in",
"reportOverall",
"."
] | train | https://github.com/pmayweg/sonar-groovy/blob/2d78d6578304601613db928795d81de340e6fa34/sonar-groovy-plugin/src/main/java/org/sonar/plugins/groovy/jacoco/JaCoCoReportMerger.java#L49-L66 |
kite-sdk/kite | kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/tool/SchemaTool.java | SchemaTool.getSchemaStringsFromJar | private List<String> getSchemaStringsFromJar(String jarPath,
String directoryPath) {
LOG.info("Getting schema strings in: " + directoryPath + ", from jar: "
+ jarPath);
JarFile jar;
try {
jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"));
} catch (UnsupportedEncodingException e)... | java | private List<String> getSchemaStringsFromJar(String jarPath,
String directoryPath) {
LOG.info("Getting schema strings in: " + directoryPath + ", from jar: "
+ jarPath);
JarFile jar;
try {
jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"));
} catch (UnsupportedEncodingException e)... | [
"private",
"List",
"<",
"String",
">",
"getSchemaStringsFromJar",
"(",
"String",
"jarPath",
",",
"String",
"directoryPath",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Getting schema strings in: \"",
"+",
"directoryPath",
"+",
"\", from jar: \"",
"+",
"jarPath",
")",
";... | Gets the list of HBase Common Avro schema strings from a directory in the
Jar. It recursively searches the directory in the jar to find files that
end in .avsc to locate thos strings.
@param jarPath
The path to the jar to search
@param directoryPath
The directory in the jar to find avro schema strings
@return The list... | [
"Gets",
"the",
"list",
"of",
"HBase",
"Common",
"Avro",
"schema",
"strings",
"from",
"a",
"directory",
"in",
"the",
"Jar",
".",
"It",
"recursively",
"searches",
"the",
"directory",
"in",
"the",
"jar",
"to",
"find",
"files",
"that",
"end",
"in",
".",
"avs... | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/tool/SchemaTool.java#L497-L527 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/CertificateOperations.java | CertificateOperations.cancelDeleteCertificate | public void cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint) throws BatchErrorException, IOException {
cancelDeleteCertificate(thumbprintAlgorithm, thumbprint, null);
} | java | public void cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint) throws BatchErrorException, IOException {
cancelDeleteCertificate(thumbprintAlgorithm, thumbprint, null);
} | [
"public",
"void",
"cancelDeleteCertificate",
"(",
"String",
"thumbprintAlgorithm",
",",
"String",
"thumbprint",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"cancelDeleteCertificate",
"(",
"thumbprintAlgorithm",
",",
"thumbprint",
",",
"null",
")",
";"... | Cancels a failed deletion of the specified certificate. This operation can be performed only when
the certificate is in the {@link com.microsoft.azure.batch.protocol.models.CertificateState#DELETE_FAILED Delete Failed} state, and restores
the certificate to the {@link com.microsoft.azure.batch.protocol.models.Certifica... | [
"Cancels",
"a",
"failed",
"deletion",
"of",
"the",
"specified",
"certificate",
".",
"This",
"operation",
"can",
"be",
"performed",
"only",
"when",
"the",
"certificate",
"is",
"in",
"the",
"{",
"@link",
"com",
".",
"microsoft",
".",
"azure",
".",
"batch",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/CertificateOperations.java#L165-L167 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/util/JspFunctions.java | JspFunctions.buildQueryParamsMapForSortExpression | public static Map buildQueryParamsMapForSortExpression(DataGridURLBuilder urlBuilder, String sortExpression) {
if(urlBuilder == null || sortExpression == null)
return null;
return urlBuilder.buildSortQueryParamsMap(sortExpression);
} | java | public static Map buildQueryParamsMapForSortExpression(DataGridURLBuilder urlBuilder, String sortExpression) {
if(urlBuilder == null || sortExpression == null)
return null;
return urlBuilder.buildSortQueryParamsMap(sortExpression);
} | [
"public",
"static",
"Map",
"buildQueryParamsMapForSortExpression",
"(",
"DataGridURLBuilder",
"urlBuilder",
",",
"String",
"sortExpression",
")",
"{",
"if",
"(",
"urlBuilder",
"==",
"null",
"||",
"sortExpression",
"==",
"null",
")",
"return",
"null",
";",
"return",
... | <p>
Utility method used to build a query parameter map which includes the list of parameters needed to change the
direction of a sort related to the given sort expression. This method uses a {@link DataGridURLBuilder}
instance to call its {@link DataGridURLBuilder#buildSortQueryParamsMap(String)} method from JSP EL.
<... | [
"<p",
">",
"Utility",
"method",
"used",
"to",
"build",
"a",
"query",
"parameter",
"map",
"which",
"includes",
"the",
"list",
"of",
"parameters",
"needed",
"to",
"change",
"the",
"direction",
"of",
"a",
"sort",
"related",
"to",
"the",
"given",
"sort",
"expr... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/util/JspFunctions.java#L99-L104 |
aalmiray/Json-lib | src/main/java/net/sf/json/JsonConfig.java | JsonConfig.registerJsonValueProcessor | public void registerJsonValueProcessor( String key, JsonValueProcessor jsonValueProcessor ) {
if( key != null && jsonValueProcessor != null ) {
keyMap.put( key, jsonValueProcessor );
}
} | java | public void registerJsonValueProcessor( String key, JsonValueProcessor jsonValueProcessor ) {
if( key != null && jsonValueProcessor != null ) {
keyMap.put( key, jsonValueProcessor );
}
} | [
"public",
"void",
"registerJsonValueProcessor",
"(",
"String",
"key",
",",
"JsonValueProcessor",
"jsonValueProcessor",
")",
"{",
"if",
"(",
"key",
"!=",
"null",
"&&",
"jsonValueProcessor",
"!=",
"null",
")",
"{",
"keyMap",
".",
"put",
"(",
"key",
",",
"jsonVal... | Registers a JsonValueProcessor.<br>
[Java -> JSON]
@param key the property name to use as key
@param jsonValueProcessor the processor to register | [
"Registers",
"a",
"JsonValueProcessor",
".",
"<br",
">",
"[",
"Java",
"-",
">",
";",
"JSON",
"]"
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JsonConfig.java#L853-L857 |
finnyb/javampd | src/main/java/org/bff/javampd/monitor/MPDConnectionMonitor.java | MPDConnectionMonitor.fireConnectionChangeEvent | protected synchronized void fireConnectionChangeEvent(boolean isConnected) {
ConnectionChangeEvent cce = new ConnectionChangeEvent(this, isConnected);
for (ConnectionChangeListener ccl : connectionListeners) {
ccl.connectionChangeEventReceived(cce);
}
} | java | protected synchronized void fireConnectionChangeEvent(boolean isConnected) {
ConnectionChangeEvent cce = new ConnectionChangeEvent(this, isConnected);
for (ConnectionChangeListener ccl : connectionListeners) {
ccl.connectionChangeEventReceived(cce);
}
} | [
"protected",
"synchronized",
"void",
"fireConnectionChangeEvent",
"(",
"boolean",
"isConnected",
")",
"{",
"ConnectionChangeEvent",
"cce",
"=",
"new",
"ConnectionChangeEvent",
"(",
"this",
",",
"isConnected",
")",
";",
"for",
"(",
"ConnectionChangeListener",
"ccl",
":... | Sends the appropriate {@link org.bff.javampd.server.ConnectionChangeEvent} to all registered
{@link ConnectionChangeListener}s.
@param isConnected the connection status | [
"Sends",
"the",
"appropriate",
"{",
"@link",
"org",
".",
"bff",
".",
"javampd",
".",
"server",
".",
"ConnectionChangeEvent",
"}",
"to",
"all",
"registered",
"{",
"@link",
"ConnectionChangeListener",
"}",
"s",
"."
] | train | https://github.com/finnyb/javampd/blob/186736e85fc238b4208cc9ee23373f9249376b4c/src/main/java/org/bff/javampd/monitor/MPDConnectionMonitor.java#L48-L54 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.document_id_PUT | public void document_id_PUT(String id, OvhDocument body) throws IOException {
String qPath = "/me/document/{id}";
StringBuilder sb = path(qPath, id);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void document_id_PUT(String id, OvhDocument body) throws IOException {
String qPath = "/me/document/{id}";
StringBuilder sb = path(qPath, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"document_id_PUT",
"(",
"String",
"id",
",",
"OvhDocument",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/document/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"id",
")",
";",
"exec",
"(",... | Alter this object properties
REST: PUT /me/document/{id}
@param body [required] New object properties
@param id [required] Document id | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2559-L2563 |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/databinding/RenderingHelper.java | RenderingHelper.addHighlight | Integer addHighlight(@NonNull View view, @NonNull String attribute, @ColorInt int colorId) {
final Pair<Integer, String> pair = new Pair<>(view.getId(), attribute);
highlightedAttributes.add(pair);
return attributeColors.put(pair, colorId);
} | java | Integer addHighlight(@NonNull View view, @NonNull String attribute, @ColorInt int colorId) {
final Pair<Integer, String> pair = new Pair<>(view.getId(), attribute);
highlightedAttributes.add(pair);
return attributeColors.put(pair, colorId);
} | [
"Integer",
"addHighlight",
"(",
"@",
"NonNull",
"View",
"view",
",",
"@",
"NonNull",
"String",
"attribute",
",",
"@",
"ColorInt",
"int",
"colorId",
")",
"{",
"final",
"Pair",
"<",
"Integer",
",",
"String",
">",
"pair",
"=",
"new",
"Pair",
"<>",
"(",
"v... | Enables highlighting for this view/attribute pair.
@param attribute the attribute to color.
@param colorId a {@link ColorInt} to associate with this attribute.
@return the previous color associated with this attribute or {@code null} if there was none. | [
"Enables",
"highlighting",
"for",
"this",
"view",
"/",
"attribute",
"pair",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/databinding/RenderingHelper.java#L108-L112 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.serviceName_glueRecord_host_DELETE | public net.minidev.ovh.api.domain.OvhTask serviceName_glueRecord_host_DELETE(String serviceName, String host) throws IOException {
String qPath = "/domain/{serviceName}/glueRecord/{host}";
StringBuilder sb = path(qPath, serviceName, host);
String resp = exec(qPath, "DELETE", sb.toString(), null);
return convert... | java | public net.minidev.ovh.api.domain.OvhTask serviceName_glueRecord_host_DELETE(String serviceName, String host) throws IOException {
String qPath = "/domain/{serviceName}/glueRecord/{host}";
StringBuilder sb = path(qPath, serviceName, host);
String resp = exec(qPath, "DELETE", sb.toString(), null);
return convert... | [
"public",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"domain",
".",
"OvhTask",
"serviceName_glueRecord_host_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"host",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/{serviceName}/g... | Delete the glue record
REST: DELETE /domain/{serviceName}/glueRecord/{host}
@param serviceName [required] The internal name of your domain
@param host [required] Host of the glue record | [
"Delete",
"the",
"glue",
"record"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L1212-L1217 |
leancloud/java-sdk-all | android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/push/DeleteTokenApi.java | DeleteTokenApi.onConnect | @Override
public void onConnect(final int rst, final HuaweiApiClient client) {
//需要在子线程中执行删除TOKEN操作
ThreadUtil.INST.excute(new Runnable() {
@Override
public void run() {
//调用删除TOKEN需要传入通过getToken接口获取到TOKEN,并且需要对TOKEN进行非空判断
if (!TextUtils... | java | @Override
public void onConnect(final int rst, final HuaweiApiClient client) {
//需要在子线程中执行删除TOKEN操作
ThreadUtil.INST.excute(new Runnable() {
@Override
public void run() {
//调用删除TOKEN需要传入通过getToken接口获取到TOKEN,并且需要对TOKEN进行非空判断
if (!TextUtils... | [
"@",
"Override",
"public",
"void",
"onConnect",
"(",
"final",
"int",
"rst",
",",
"final",
"HuaweiApiClient",
"client",
")",
"{",
"//需要在子线程中执行删除TOKEN操作\r",
"ThreadUtil",
".",
"INST",
".",
"excute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"publ... | HuaweiApiClient 连接结果回调
@param rst 结果码
@param client HuaweiApiClient 实例 | [
"HuaweiApiClient",
"连接结果回调"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/push/DeleteTokenApi.java#L39-L65 |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/event/PacketDistributer.java | PacketDistributer.addHandler | public synchronized void addHandler(final short packetID, final PacketHandler packetHandler)
{
if (registry.containsKey(packetID)) throw new IllegalArgumentException("Handler for ID: " + packetID + " already exists");
registry.put(packetID, packetHandler);
} | java | public synchronized void addHandler(final short packetID, final PacketHandler packetHandler)
{
if (registry.containsKey(packetID)) throw new IllegalArgumentException("Handler for ID: " + packetID + " already exists");
registry.put(packetID, packetHandler);
} | [
"public",
"synchronized",
"void",
"addHandler",
"(",
"final",
"short",
"packetID",
",",
"final",
"PacketHandler",
"packetHandler",
")",
"{",
"if",
"(",
"registry",
".",
"containsKey",
"(",
"packetID",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\... | Adds a new handler for this specific Packet ID
@param packetID Packet ID to add handler for
@param packetHandler Handler for given Packet ID
@throws IllegalArgumentException when Packet ID already has a registered handler | [
"Adds",
"a",
"new",
"handler",
"for",
"this",
"specific",
"Packet",
"ID"
] | train | https://github.com/PvdBerg1998/PNet/blob/d3dfff2ceaf69c244e0593e3f7606f171ec718bb/src/main/java/nl/pvdberg/pnet/event/PacketDistributer.java#L70-L74 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/run/Notifier.java | Notifier.notifyOne | public static void notifyOne(String correlationId, Object component, Parameters args) throws ApplicationException {
if (component instanceof INotifiable)
((INotifiable) component).notify(correlationId, args);
} | java | public static void notifyOne(String correlationId, Object component, Parameters args) throws ApplicationException {
if (component instanceof INotifiable)
((INotifiable) component).notify(correlationId, args);
} | [
"public",
"static",
"void",
"notifyOne",
"(",
"String",
"correlationId",
",",
"Object",
"component",
",",
"Parameters",
"args",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"component",
"instanceof",
"INotifiable",
")",
"(",
"(",
"INotifiable",
")",
"c... | Notifies specific component.
To be notiied components must implement INotifiable interface. If they don't
the call to this method has no effect.
@param correlationId (optional) transaction id to trace execution through
call chain.
@param component the component that is to be notified.
@param args notifia... | [
"Notifies",
"specific",
"component",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/run/Notifier.java#L25-L29 |
pmwmedia/tinylog | tinylog-impl/src/main/java/org/tinylog/writers/AbstractFormatPatternWriter.java | AbstractFormatPatternWriter.getFileName | protected static String getFileName(final Map<String, String> properties) {
String fileName = properties.get("file");
if (fileName == null) {
throw new IllegalArgumentException("File name is missing for file writer");
} else {
return fileName;
}
} | java | protected static String getFileName(final Map<String, String> properties) {
String fileName = properties.get("file");
if (fileName == null) {
throw new IllegalArgumentException("File name is missing for file writer");
} else {
return fileName;
}
} | [
"protected",
"static",
"String",
"getFileName",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"String",
"fileName",
"=",
"properties",
".",
"get",
"(",
"\"file\"",
")",
";",
"if",
"(",
"fileName",
"==",
"null",
")",
"{",... | Extracts the log file name from configuration.
@param properties
Configuration for writer
@return Log file name
@throws IllegalArgumentException
Log file is not defined in configuration | [
"Extracts",
"the",
"log",
"file",
"name",
"from",
"configuration",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-impl/src/main/java/org/tinylog/writers/AbstractFormatPatternWriter.java#L81-L88 |
fuwjax/ev-oss | funco/src/main/java/org/fuwjax/oss/util/assertion/Assert2.java | Assert2.assertEquals | public static void assertEquals(final Path expected, final Path actual) throws IOException {
containsAll(actual, expected);
if(Files.exists(expected)) {
containsAll(expected, actual);
walkFileTree(expected, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(final Path file, fin... | java | public static void assertEquals(final Path expected, final Path actual) throws IOException {
containsAll(actual, expected);
if(Files.exists(expected)) {
containsAll(expected, actual);
walkFileTree(expected, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(final Path file, fin... | [
"public",
"static",
"void",
"assertEquals",
"(",
"final",
"Path",
"expected",
",",
"final",
"Path",
"actual",
")",
"throws",
"IOException",
"{",
"containsAll",
"(",
"actual",
",",
"expected",
")",
";",
"if",
"(",
"Files",
".",
"exists",
"(",
"expected",
")... | Asserts that two paths are deeply byte-equivalent.
@param expected one of the paths
@param actual the other path
@throws IOException if the paths cannot be traversed | [
"Asserts",
"that",
"two",
"paths",
"are",
"deeply",
"byte",
"-",
"equivalent",
"."
] | train | https://github.com/fuwjax/ev-oss/blob/cbd88592e9b2fa9547c3bdd41e52e790061a2253/funco/src/main/java/org/fuwjax/oss/util/assertion/Assert2.java#L126-L143 |
libgdx/gdx-ai | gdx-ai/src/com/badlogic/gdx/ai/steer/behaviors/Jump.java | Jump.calculateAirborneTimeAndVelocity | public float calculateAirborneTimeAndVelocity (T outVelocity, JumpDescriptor<T> jumpDescriptor, float maxLinearSpeed) {
float g = gravityComponentHandler.getComponent(gravity);
// Calculate the first jump time, see time of flight at http://hyperphysics.phy-astr.gsu.edu/hbase/traj.html
// Notice that the equation... | java | public float calculateAirborneTimeAndVelocity (T outVelocity, JumpDescriptor<T> jumpDescriptor, float maxLinearSpeed) {
float g = gravityComponentHandler.getComponent(gravity);
// Calculate the first jump time, see time of flight at http://hyperphysics.phy-astr.gsu.edu/hbase/traj.html
// Notice that the equation... | [
"public",
"float",
"calculateAirborneTimeAndVelocity",
"(",
"T",
"outVelocity",
",",
"JumpDescriptor",
"<",
"T",
">",
"jumpDescriptor",
",",
"float",
"maxLinearSpeed",
")",
"{",
"float",
"g",
"=",
"gravityComponentHandler",
".",
"getComponent",
"(",
"gravity",
")",
... | Returns the airborne time and sets the {@code outVelocity} vector to the airborne planar velocity required to achieve the
jump. If the jump is not achievable -1 is returned and the {@code outVelocity} vector remains unchanged.
<p>
Be aware that you should avoid using unlimited or very high max velocity, because this mi... | [
"Returns",
"the",
"airborne",
"time",
"and",
"sets",
"the",
"{"
] | train | https://github.com/libgdx/gdx-ai/blob/2d1523a97193a45e18e11a4837c6800d08f177c5/gdx-ai/src/com/badlogic/gdx/ai/steer/behaviors/Jump.java#L134-L157 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/Binomial.java | Binomial.scoreToPvalue | private static double scoreToPvalue(double score, int n, double p) {
/*
if(n<=20) {
//calculate it from binomial distribution
}
*/
double z=(score+0.5-n*p)/Math.sqrt(n*p*(1.0-p));
return ContinuousDistributions.gaussCdf(z);
} | java | private static double scoreToPvalue(double score, int n, double p) {
/*
if(n<=20) {
//calculate it from binomial distribution
}
*/
double z=(score+0.5-n*p)/Math.sqrt(n*p*(1.0-p));
return ContinuousDistributions.gaussCdf(z);
} | [
"private",
"static",
"double",
"scoreToPvalue",
"(",
"double",
"score",
",",
"int",
"n",
",",
"double",
"p",
")",
"{",
"/*\n if(n<=20) {\n //calculate it from binomial distribution\n }\n */",
"double",
"z",
"=",
"(",
"score",
"+",
"0.5",
... | Returns the Pvalue for a particular score
@param score
@param n
@param p
@return | [
"Returns",
"the",
"Pvalue",
"for",
"a",
"particular",
"score"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/Binomial.java#L64-L74 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/OptionalInt.java | OptionalInt.ifPresentOrElse | public void ifPresentOrElse(@NotNull IntConsumer consumer, @NotNull Runnable emptyAction) {
if (isPresent) {
consumer.accept(value);
} else {
emptyAction.run();
}
} | java | public void ifPresentOrElse(@NotNull IntConsumer consumer, @NotNull Runnable emptyAction) {
if (isPresent) {
consumer.accept(value);
} else {
emptyAction.run();
}
} | [
"public",
"void",
"ifPresentOrElse",
"(",
"@",
"NotNull",
"IntConsumer",
"consumer",
",",
"@",
"NotNull",
"Runnable",
"emptyAction",
")",
"{",
"if",
"(",
"isPresent",
")",
"{",
"consumer",
".",
"accept",
"(",
"value",
")",
";",
"}",
"else",
"{",
"emptyActi... | If a value is present, performs the given action with the value,
otherwise performs the empty-based action.
@param consumer the consumer function to be executed, if a value is present
@param emptyAction the empty-based action to be performed, if no value is present
@throws NullPointerException if a value is present ... | [
"If",
"a",
"value",
"is",
"present",
"performs",
"the",
"given",
"action",
"with",
"the",
"value",
"otherwise",
"performs",
"the",
"empty",
"-",
"based",
"action",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/OptionalInt.java#L141-L147 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DCacheBase.java | DCacheBase.setValue | public void setValue(EntryInfo entryInfo, Object value, boolean directive) {
setValue(entryInfo, value, !shouldPull(entryInfo.getSharingPolicy(), entryInfo.id), directive);
} | java | public void setValue(EntryInfo entryInfo, Object value, boolean directive) {
setValue(entryInfo, value, !shouldPull(entryInfo.getSharingPolicy(), entryInfo.id), directive);
} | [
"public",
"void",
"setValue",
"(",
"EntryInfo",
"entryInfo",
",",
"Object",
"value",
",",
"boolean",
"directive",
")",
"{",
"setValue",
"(",
"entryInfo",
",",
"value",
",",
"!",
"shouldPull",
"(",
"entryInfo",
".",
"getSharingPolicy",
"(",
")",
",",
"entryIn... | This sets the actual value (JSP or command) of an entry in the cache.
@param entryInfo
The cache entry
@param value
The value to cache in the entry
@param directive
boolean to indicate CACHE_NEW_CONTENT or USE_CACHED_VALUE | [
"This",
"sets",
"the",
"actual",
"value",
"(",
"JSP",
"or",
"command",
")",
"of",
"an",
"entry",
"in",
"the",
"cache",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DCacheBase.java#L535-L537 |
looly/hutool | hutool-log/src/main/java/cn/hutool/log/dialect/jdk/JdkLog.java | JdkLog.logIfEnabled | private void logIfEnabled(String callerFQCN, Level level, Throwable throwable, String format, Object[] arguments){
if(logger.isLoggable(level)){
LogRecord record = new LogRecord(level, StrUtil.format(format, arguments));
record.setLoggerName(getName());
record.setThrown(throwable);
fillCallerData(cal... | java | private void logIfEnabled(String callerFQCN, Level level, Throwable throwable, String format, Object[] arguments){
if(logger.isLoggable(level)){
LogRecord record = new LogRecord(level, StrUtil.format(format, arguments));
record.setLoggerName(getName());
record.setThrown(throwable);
fillCallerData(cal... | [
"private",
"void",
"logIfEnabled",
"(",
"String",
"callerFQCN",
",",
"Level",
"level",
",",
"Throwable",
"throwable",
",",
"String",
"format",
",",
"Object",
"[",
"]",
"arguments",
")",
"{",
"if",
"(",
"logger",
".",
"isLoggable",
"(",
"level",
")",
")",
... | 打印对应等级的日志
@param callerFQCN
@param level 等级
@param throwable 异常对象
@param format 消息模板
@param arguments 参数 | [
"打印对应等级的日志"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-log/src/main/java/cn/hutool/log/dialect/jdk/JdkLog.java#L180-L188 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/request/JmxListRequest.java | JmxListRequest.newCreator | static RequestCreator<JmxListRequest> newCreator() {
return new RequestCreator<JmxListRequest>() {
/** {@inheritDoc} */
public JmxListRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException {
return new JmxListRequest(
... | java | static RequestCreator<JmxListRequest> newCreator() {
return new RequestCreator<JmxListRequest>() {
/** {@inheritDoc} */
public JmxListRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException {
return new JmxListRequest(
... | [
"static",
"RequestCreator",
"<",
"JmxListRequest",
">",
"newCreator",
"(",
")",
"{",
"return",
"new",
"RequestCreator",
"<",
"JmxListRequest",
">",
"(",
")",
"{",
"/** {@inheritDoc} */",
"public",
"JmxListRequest",
"create",
"(",
"Stack",
"<",
"String",
">",
"pS... | Create a new creator used for creating list requests
@return creator | [
"Create",
"a",
"new",
"creator",
"used",
"for",
"creating",
"list",
"requests"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxListRequest.java#L72-L87 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/samplers/ProbabilitySampler.java | ProbabilitySampler.create | static ProbabilitySampler create(double probability) {
Utils.checkArgument(
probability >= 0.0 && probability <= 1.0, "probability must be in range [0.0, 1.0]");
long idUpperBound;
// Special case the limits, to avoid any possible issues with lack of precision across
// double/long boundaries. F... | java | static ProbabilitySampler create(double probability) {
Utils.checkArgument(
probability >= 0.0 && probability <= 1.0, "probability must be in range [0.0, 1.0]");
long idUpperBound;
// Special case the limits, to avoid any possible issues with lack of precision across
// double/long boundaries. F... | [
"static",
"ProbabilitySampler",
"create",
"(",
"double",
"probability",
")",
"{",
"Utils",
".",
"checkArgument",
"(",
"probability",
">=",
"0.0",
"&&",
"probability",
"<=",
"1.0",
",",
"\"probability must be in range [0.0, 1.0]\"",
")",
";",
"long",
"idUpperBound",
... | Returns a new {@link ProbabilitySampler}. The probability of sampling a trace is equal to that
of the specified probability.
@param probability The desired probability of sampling. Must be within [0.0, 1.0].
@return a new {@link ProbabilitySampler}.
@throws IllegalArgumentException if {@code probability} is out of ran... | [
"Returns",
"a",
"new",
"{",
"@link",
"ProbabilitySampler",
"}",
".",
"The",
"probability",
"of",
"sampling",
"a",
"trace",
"is",
"equal",
"to",
"that",
"of",
"the",
"specified",
"probability",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/samplers/ProbabilitySampler.java#L55-L71 |
ludovicianul/selenium-on-steroids | src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java | WebDriverHelper.authenticateOnNextAlert | public void authenticateOnNextAlert(String username, String password) {
Credentials credentials = new UserAndPassword(username, password);
Alert alert = driver.switchTo().alert();
alert.authenticateUsing(credentials);
} | java | public void authenticateOnNextAlert(String username, String password) {
Credentials credentials = new UserAndPassword(username, password);
Alert alert = driver.switchTo().alert();
alert.authenticateUsing(credentials);
} | [
"public",
"void",
"authenticateOnNextAlert",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"Credentials",
"credentials",
"=",
"new",
"UserAndPassword",
"(",
"username",
",",
"password",
")",
";",
"Alert",
"alert",
"=",
"driver",
".",
"switchTo"... | Authenticates the user using the given username and password. This will
work only if the credentials are requested through an alert window.
@param username
the user name
@param password
the password | [
"Authenticates",
"the",
"user",
"using",
"the",
"given",
"username",
"and",
"password",
".",
"This",
"will",
"work",
"only",
"if",
"the",
"credentials",
"are",
"requested",
"through",
"an",
"alert",
"window",
"."
] | train | https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java#L165-L170 |
Samsung/GearVRf | GVRf/Extensions/script/src/main/java/org/gearvrf/script/GVRScriptManager.java | GVRScriptManager.attachScriptFile | @Override
public void attachScriptFile(IScriptable target, IScriptFile scriptFile) {
mScriptMap.put(target, scriptFile);
scriptFile.invokeFunction("onAttach", new Object[] { target });
} | java | @Override
public void attachScriptFile(IScriptable target, IScriptFile scriptFile) {
mScriptMap.put(target, scriptFile);
scriptFile.invokeFunction("onAttach", new Object[] { target });
} | [
"@",
"Override",
"public",
"void",
"attachScriptFile",
"(",
"IScriptable",
"target",
",",
"IScriptFile",
"scriptFile",
")",
"{",
"mScriptMap",
".",
"put",
"(",
"target",
",",
"scriptFile",
")",
";",
"scriptFile",
".",
"invokeFunction",
"(",
"\"onAttach\"",
",",
... | Attach a script file to a scriptable target.
@param target The scriptable target.
@param scriptFile The script file object. | [
"Attach",
"a",
"script",
"file",
"to",
"a",
"scriptable",
"target",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/script/src/main/java/org/gearvrf/script/GVRScriptManager.java#L186-L190 |
damianszczepanik/cucumber-reporting | src/main/java/net/masterthought/cucumber/Configuration.java | Configuration.addClassifications | public void addClassifications(String name, String value) {
classifications.add(new AbstractMap.SimpleEntry<>(name, value));
} | java | public void addClassifications(String name, String value) {
classifications.add(new AbstractMap.SimpleEntry<>(name, value));
} | [
"public",
"void",
"addClassifications",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"classifications",
".",
"add",
"(",
"new",
"AbstractMap",
".",
"SimpleEntry",
"<>",
"(",
"name",
",",
"value",
")",
")",
";",
"}"
] | Adds metadata that will be displayed at the main page of the report. It is useful when there is a few reports are
generated at the same time but with different parameters/configurations.
@param name name of the property
@param value value of the property | [
"Adds",
"metadata",
"that",
"will",
"be",
"displayed",
"at",
"the",
"main",
"page",
"of",
"the",
"report",
".",
"It",
"is",
"useful",
"when",
"there",
"is",
"a",
"few",
"reports",
"are",
"generated",
"at",
"the",
"same",
"time",
"but",
"with",
"different... | train | https://github.com/damianszczepanik/cucumber-reporting/blob/9ffe0d4a9c0aec161b0988a930a8312ba36dc742/src/main/java/net/masterthought/cucumber/Configuration.java#L197-L199 |
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.listAsync | public Observable<Page<ExpressRouteCrossConnectionPeeringInner>> listAsync(final String resourceGroupName, final String crossConnectionName) {
return listWithServiceResponseAsync(resourceGroupName, crossConnectionName)
.map(new Func1<ServiceResponse<Page<ExpressRouteCrossConnectionPeeringInner>>, Pa... | java | public Observable<Page<ExpressRouteCrossConnectionPeeringInner>> listAsync(final String resourceGroupName, final String crossConnectionName) {
return listWithServiceResponseAsync(resourceGroupName, crossConnectionName)
.map(new Func1<ServiceResponse<Page<ExpressRouteCrossConnectionPeeringInner>>, Pa... | [
"public",
"Observable",
"<",
"Page",
"<",
"ExpressRouteCrossConnectionPeeringInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"crossConnectionName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupN... | Gets all peerings in a specified ExpressRouteCrossConnection.
@param resourceGroupName The name of the resource group.
@param crossConnectionName The name of the ExpressRouteCrossConnection.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<ExpressRout... | [
"Gets",
"all",
"peerings",
"in",
"a",
"specified",
"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#L143-L151 |
kiegroup/drools | kie-pmml/src/main/java/org/kie/pmml/assembler/PMMLAssemblerService.java | PMMLAssemblerService.generatedResourcesToPackageDescr | private List<PackageDescr> generatedResourcesToPackageDescr(Resource resource, List<PMMLResource> resources)
throws DroolsParserException {
List<PackageDescr> pkgDescrs = new ArrayList<>();
DrlParser parser = new DrlParser(configuration.getLanguageLevel());
for (PMMLResource res : re... | java | private List<PackageDescr> generatedResourcesToPackageDescr(Resource resource, List<PMMLResource> resources)
throws DroolsParserException {
List<PackageDescr> pkgDescrs = new ArrayList<>();
DrlParser parser = new DrlParser(configuration.getLanguageLevel());
for (PMMLResource res : re... | [
"private",
"List",
"<",
"PackageDescr",
">",
"generatedResourcesToPackageDescr",
"(",
"Resource",
"resource",
",",
"List",
"<",
"PMMLResource",
">",
"resources",
")",
"throws",
"DroolsParserException",
"{",
"List",
"<",
"PackageDescr",
">",
"pkgDescrs",
"=",
"new",
... | Creates a list of PackageDescr objects from the PMMLResources (which includes the generated DRL)
@param resource
@param resources
@return
@throws DroolsParserException | [
"Creates",
"a",
"list",
"of",
"PackageDescr",
"objects",
"from",
"the",
"PMMLResources",
"(",
"which",
"includes",
"the",
"generated",
"DRL",
")"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-pmml/src/main/java/org/kie/pmml/assembler/PMMLAssemblerService.java#L139-L159 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java | TermOfUsePanel.newFulfilmentAndJurisdictionPlacePanel | protected Component newFulfilmentAndJurisdictionPlacePanel(final String id,
final IModel<HeaderContentListModelBean> model)
{
return new FulfilmentAndJurisdictionPlacePanel(id, Model.of(model.getObject()));
} | java | protected Component newFulfilmentAndJurisdictionPlacePanel(final String id,
final IModel<HeaderContentListModelBean> model)
{
return new FulfilmentAndJurisdictionPlacePanel(id, Model.of(model.getObject()));
} | [
"protected",
"Component",
"newFulfilmentAndJurisdictionPlacePanel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"HeaderContentListModelBean",
">",
"model",
")",
"{",
"return",
"new",
"FulfilmentAndJurisdictionPlacePanel",
"(",
"id",
",",
"Model",
".",
"... | Factory method for creating the new {@link Component} for the fulfilment and jurisdiction
place. This method is invoked in the constructor from the derived classes and can be
overridden so users can provide their own version of a new {@link Component} for the
fulfilment and jurisdiction place.
@param id
the id
@param ... | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"Component",
"}",
"for",
"the",
"fulfilment",
"and",
"jurisdiction",
"place",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java#L260-L264 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedClient.java | MemcachedClient.getBulk | @Override
public Map<String, Object> getBulk(Iterator<String> keyIter) {
return getBulk(keyIter, transcoder);
} | java | @Override
public Map<String, Object> getBulk(Iterator<String> keyIter) {
return getBulk(keyIter, transcoder);
} | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getBulk",
"(",
"Iterator",
"<",
"String",
">",
"keyIter",
")",
"{",
"return",
"getBulk",
"(",
"keyIter",
",",
"transcoder",
")",
";",
"}"
] | Get the values for multiple keys from the cache.
@param keyIter Iterator that produces the keys
@return a map of the values (for each value that exists)
@throws OperationTimeoutException if the global operation timeout is
exceeded
@throws IllegalStateException in the rare circumstance where queue is too
full to accept... | [
"Get",
"the",
"values",
"for",
"multiple",
"keys",
"from",
"the",
"cache",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedClient.java#L1581-L1584 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContextProperties.java | ProcessContextProperties.addDataUsage | private String addDataUsage(String attribute, Set<DataUsage> usages) throws PropertyException {
Validate.notNull(attribute);
Validate.notEmpty(attribute);
Validate.notNull(usages);
Validate.noNullElements(usages);
String dataUsageName = String.format(DATA_USAGE_FORMAT, getNextDat... | java | private String addDataUsage(String attribute, Set<DataUsage> usages) throws PropertyException {
Validate.notNull(attribute);
Validate.notEmpty(attribute);
Validate.notNull(usages);
Validate.noNullElements(usages);
String dataUsageName = String.format(DATA_USAGE_FORMAT, getNextDat... | [
"private",
"String",
"addDataUsage",
"(",
"String",
"attribute",
",",
"Set",
"<",
"DataUsage",
">",
"usages",
")",
"throws",
"PropertyException",
"{",
"Validate",
".",
"notNull",
"(",
"attribute",
")",
";",
"Validate",
".",
"notEmpty",
"(",
"attribute",
")",
... | Adds the given data usage to the context properties.<br>
This requires to generate a new name for the data usage (e.g.
DATA_USAGE_1) <br>
and storing a string-representation of this data usage under this
name.<br>
Additionally, the new data usage name is stored in the property field
which is summing up all data usage n... | [
"Adds",
"the",
"given",
"data",
"usage",
"to",
"the",
"context",
"properties",
".",
"<br",
">",
"This",
"requires",
"to",
"generate",
"a",
"new",
"name",
"for",
"the",
"data",
"usage",
"(",
"e",
".",
"g",
".",
"DATA_USAGE_1",
")",
"<br",
">",
"and",
... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContextProperties.java#L103-L112 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java | TimeZoneFormat.parseAbuttingOffsetFields | private int parseAbuttingOffsetFields(String text, int start, int[] parsedLen) {
final int MAXDIGITS = 6;
int[] digits = new int[MAXDIGITS];
int[] parsed = new int[MAXDIGITS]; // accumulative offsets
// Parse digits into int[]
int idx = start;
int[] len = {0};
i... | java | private int parseAbuttingOffsetFields(String text, int start, int[] parsedLen) {
final int MAXDIGITS = 6;
int[] digits = new int[MAXDIGITS];
int[] parsed = new int[MAXDIGITS]; // accumulative offsets
// Parse digits into int[]
int idx = start;
int[] len = {0};
i... | [
"private",
"int",
"parseAbuttingOffsetFields",
"(",
"String",
"text",
",",
"int",
"start",
",",
"int",
"[",
"]",
"parsedLen",
")",
"{",
"final",
"int",
"MAXDIGITS",
"=",
"6",
";",
"int",
"[",
"]",
"digits",
"=",
"new",
"int",
"[",
"MAXDIGITS",
"]",
";"... | Parses abutting localized GMT offset fields (such as 0800) into offset.
@param text the input text
@param start the start index
@param parsedLen the parsed length, or 0 on failure
@return the parsed offset in milliseconds. | [
"Parses",
"abutting",
"localized",
"GMT",
"offset",
"fields",
"(",
"such",
"as",
"0800",
")",
"into",
"offset",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java#L2492-L2558 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/B2BAccountUrl.java | B2BAccountUrl.removeUserRoleAsyncUrl | public static MozuUrl removeUserRoleAsyncUrl(Integer accountId, Integer roleId, String userId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/b2baccounts/{accountId}/user/{userId}/roles/{roleId}");
formatter.formatUrl("accountId", accountId);
formatter.formatUrl("roleId", roleId);
formatte... | java | public static MozuUrl removeUserRoleAsyncUrl(Integer accountId, Integer roleId, String userId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/b2baccounts/{accountId}/user/{userId}/roles/{roleId}");
formatter.formatUrl("accountId", accountId);
formatter.formatUrl("roleId", roleId);
formatte... | [
"public",
"static",
"MozuUrl",
"removeUserRoleAsyncUrl",
"(",
"Integer",
"accountId",
",",
"Integer",
"roleId",
",",
"String",
"userId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/customer/b2baccounts/{accountId}/user/{userId}/r... | Get Resource Url for RemoveUserRoleAsync
@param accountId Unique identifier of the customer account.
@param roleId
@param userId Unique identifier of the user whose tenant scopes you want to retrieve.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"RemoveUserRoleAsync"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/B2BAccountUrl.java#L273-L280 |
JCTools/JCTools | jctools-core/src/main/java/org/jctools/queues/atomic/BaseMpscLinkedAtomicArrayQueue.java | BaseMpscLinkedAtomicArrayQueue.offerSlowPath | private int offerSlowPath(long mask, long pIndex, long producerLimit) {
final long cIndex = lvConsumerIndex();
long bufferCapacity = getCurrentBufferCapacity(mask);
if (cIndex + bufferCapacity > pIndex) {
if (!casProducerLimit(producerLimit, cIndex + bufferCapacity)) {
... | java | private int offerSlowPath(long mask, long pIndex, long producerLimit) {
final long cIndex = lvConsumerIndex();
long bufferCapacity = getCurrentBufferCapacity(mask);
if (cIndex + bufferCapacity > pIndex) {
if (!casProducerLimit(producerLimit, cIndex + bufferCapacity)) {
... | [
"private",
"int",
"offerSlowPath",
"(",
"long",
"mask",
",",
"long",
"pIndex",
",",
"long",
"producerLimit",
")",
"{",
"final",
"long",
"cIndex",
"=",
"lvConsumerIndex",
"(",
")",
";",
"long",
"bufferCapacity",
"=",
"getCurrentBufferCapacity",
"(",
"mask",
")"... | We do not inline resize into this method because we do not resize on fill. | [
"We",
"do",
"not",
"inline",
"resize",
"into",
"this",
"method",
"because",
"we",
"do",
"not",
"resize",
"on",
"fill",
"."
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-core/src/main/java/org/jctools/queues/atomic/BaseMpscLinkedAtomicArrayQueue.java#L339-L362 |
lightoze/gwt-i18n-server | src/main/java/net/lightoze/gwt/i18n/client/LocaleFactory.java | LocaleFactory.getEncoder | public static <T extends Messages> T getEncoder(Class<T> cls) {
return get(cls, ENCODER);
} | java | public static <T extends Messages> T getEncoder(Class<T> cls) {
return get(cls, ENCODER);
} | [
"public",
"static",
"<",
"T",
"extends",
"Messages",
">",
"T",
"getEncoder",
"(",
"Class",
"<",
"T",
">",
"cls",
")",
"{",
"return",
"get",
"(",
"cls",
",",
"ENCODER",
")",
";",
"}"
] | Get <em>encoding</em> localization object, which will encode all requests so that they can be decoded later by {@link net.lightoze.gwt.i18n.server.LocaleProxy#decode}.
<p>
The purpose is to separate complex (e.g. template-based) text generation and its localization for particular locale into two separate phases.
<p>
<s... | [
"Get",
"<em",
">",
"encoding<",
"/",
"em",
">",
"localization",
"object",
"which",
"will",
"encode",
"all",
"requests",
"so",
"that",
"they",
"can",
"be",
"decoded",
"later",
"by",
"{",
"@link",
"net",
".",
"lightoze",
".",
"gwt",
".",
"i18n",
".",
"se... | train | https://github.com/lightoze/gwt-i18n-server/blob/96de53288e9bf31721d7b0e2a1d9f7b6ce1a7e83/src/main/java/net/lightoze/gwt/i18n/client/LocaleFactory.java#L46-L48 |
biojava/biojava | biojava-structure-gui/src/main/java/demo/DemoShowLargeAssembly.java | DemoShowLargeAssembly.readStructure | public static Structure readStructure(String pdbId, int bioAssemblyId) {
// pre-computed files use lower case PDB IDs
pdbId = pdbId.toLowerCase();
// we just need this to track where to store PDB files
// this checks the PDB_DIR property (and uses a tmp location if not set)
AtomCache cache = new AtomCache(... | java | public static Structure readStructure(String pdbId, int bioAssemblyId) {
// pre-computed files use lower case PDB IDs
pdbId = pdbId.toLowerCase();
// we just need this to track where to store PDB files
// this checks the PDB_DIR property (and uses a tmp location if not set)
AtomCache cache = new AtomCache(... | [
"public",
"static",
"Structure",
"readStructure",
"(",
"String",
"pdbId",
",",
"int",
"bioAssemblyId",
")",
"{",
"// pre-computed files use lower case PDB IDs",
"pdbId",
"=",
"pdbId",
".",
"toLowerCase",
"(",
")",
";",
"// we just need this to track where to store PDB files... | Load a specific biological assembly for a PDB entry
@param pdbId .. the PDB ID
@param bioAssemblyId .. the first assembly has the bioAssemblyId 1
@return a Structure object or null if something went wrong. | [
"Load",
"a",
"specific",
"biological",
"assembly",
"for",
"a",
"PDB",
"entry"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/demo/DemoShowLargeAssembly.java#L72-L101 |
amaembo/streamex | src/main/java/one/util/streamex/DoubleStreamEx.java | DoubleStreamEx.of | public static DoubleStreamEx of(DoubleStream stream) {
return stream instanceof DoubleStreamEx ? (DoubleStreamEx) stream
: new DoubleStreamEx(stream, StreamContext.of(stream));
} | java | public static DoubleStreamEx of(DoubleStream stream) {
return stream instanceof DoubleStreamEx ? (DoubleStreamEx) stream
: new DoubleStreamEx(stream, StreamContext.of(stream));
} | [
"public",
"static",
"DoubleStreamEx",
"of",
"(",
"DoubleStream",
"stream",
")",
"{",
"return",
"stream",
"instanceof",
"DoubleStreamEx",
"?",
"(",
"DoubleStreamEx",
")",
"stream",
":",
"new",
"DoubleStreamEx",
"(",
"stream",
",",
"StreamContext",
".",
"of",
"(",... | Returns a {@code DoubleStreamEx} object which wraps given
{@link DoubleStream}.
<p>
The supplied stream must not be consumed or closed when this method is
called. No operation must be performed on the supplied stream after it's
wrapped.
@param stream original stream
@return the wrapped stream
@since 0.0.8 | [
"Returns",
"a",
"{",
"@code",
"DoubleStreamEx",
"}",
"object",
"which",
"wraps",
"given",
"{",
"@link",
"DoubleStream",
"}",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/DoubleStreamEx.java#L1607-L1610 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.getResource | public static URL getResource(final Class<?> clasz, final String name) {
checkNotNull("clasz", clasz);
checkNotNull("name", name);
final String nameAndPath = SLASH + getPackagePath(clasz) + SLASH + name;
return clasz.getResource(nameAndPath);
} | java | public static URL getResource(final Class<?> clasz, final String name) {
checkNotNull("clasz", clasz);
checkNotNull("name", name);
final String nameAndPath = SLASH + getPackagePath(clasz) + SLASH + name;
return clasz.getResource(nameAndPath);
} | [
"public",
"static",
"URL",
"getResource",
"(",
"final",
"Class",
"<",
"?",
">",
"clasz",
",",
"final",
"String",
"name",
")",
"{",
"checkNotNull",
"(",
"\"clasz\"",
",",
"clasz",
")",
";",
"checkNotNull",
"(",
"\"name\"",
",",
"name",
")",
";",
"final",
... | Get the path to a resource located in the same package as a given class.
@param clasz
Class with the same package where the resource is located - Cannot be <code>null</code>.
@param name
Filename of the resource - Cannot be <code>null</code>.
@return Resource URL. | [
"Get",
"the",
"path",
"to",
"a",
"resource",
"located",
"in",
"the",
"same",
"package",
"as",
"a",
"given",
"class",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L133-L138 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/api/PalDB.java | PalDB.createReader | public static StoreReader createReader(File file, Configuration config) {
return StoreImpl.createReader(file, config);
} | java | public static StoreReader createReader(File file, Configuration config) {
return StoreImpl.createReader(file, config);
} | [
"public",
"static",
"StoreReader",
"createReader",
"(",
"File",
"file",
",",
"Configuration",
"config",
")",
"{",
"return",
"StoreImpl",
".",
"createReader",
"(",
"file",
",",
"config",
")",
";",
"}"
] | Creates a store reader from the specified <code>file</code>.
<p>
The file must exists.
@param file a PalDB store file
@param config configuration
@return a store reader | [
"Creates",
"a",
"store",
"reader",
"from",
"the",
"specified",
"<code",
">",
"file<",
"/",
"code",
">",
".",
"<p",
">",
"The",
"file",
"must",
"exists",
"."
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/api/PalDB.java#L58-L60 |
vkostyukov/la4j | src/main/java/org/la4j/matrix/ColumnMajorSparseMatrix.java | ColumnMajorSparseMatrix.from1DArray | public static ColumnMajorSparseMatrix from1DArray(int rows, int columns, double[] array) {
return CCSMatrix.from1DArray(rows, columns, array);
} | java | public static ColumnMajorSparseMatrix from1DArray(int rows, int columns, double[] array) {
return CCSMatrix.from1DArray(rows, columns, array);
} | [
"public",
"static",
"ColumnMajorSparseMatrix",
"from1DArray",
"(",
"int",
"rows",
",",
"int",
"columns",
",",
"double",
"[",
"]",
"array",
")",
"{",
"return",
"CCSMatrix",
".",
"from1DArray",
"(",
"rows",
",",
"columns",
",",
"array",
")",
";",
"}"
] | Creates a new {@link ColumnMajorSparseMatrix} from the given 1D {@code array} with
compressing (copying) the underlying array. | [
"Creates",
"a",
"new",
"{"
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/matrix/ColumnMajorSparseMatrix.java#L99-L101 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java | VisualStudioNETProjectWriter.addAttribute | private static void addAttribute(final AttributesImpl attributes, final String attrName, final String attrValue) {
if (attrName == null) {
throw new IllegalArgumentException("attrName");
}
if (attrValue != null) {
attributes.addAttribute(null, attrName, attrName, "#PCDATA", attrValue);
}
} | java | private static void addAttribute(final AttributesImpl attributes, final String attrName, final String attrValue) {
if (attrName == null) {
throw new IllegalArgumentException("attrName");
}
if (attrValue != null) {
attributes.addAttribute(null, attrName, attrName, "#PCDATA", attrValue);
}
} | [
"private",
"static",
"void",
"addAttribute",
"(",
"final",
"AttributesImpl",
"attributes",
",",
"final",
"String",
"attrName",
",",
"final",
"String",
"attrValue",
")",
"{",
"if",
"(",
"attrName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException... | Adds an non-namespace-qualified attribute to attribute list.
@param attributes
list of attributes.
@param attrName
attribute name, may not be null.
@param attrValue
attribute value, if null attribute is not added. | [
"Adds",
"an",
"non",
"-",
"namespace",
"-",
"qualified",
"attribute",
"to",
"attribute",
"list",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L65-L72 |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java | BaseBundleActivator.getService | public Object getService(String interfaceClassName, String serviceClassName, String versionRange, Dictionary<String,String> filter)
{
return ClassServiceUtility.getClassService().getClassFinder(context).getClassBundleService(interfaceClassName, serviceClassName, versionRange, filter, -1);
} | java | public Object getService(String interfaceClassName, String serviceClassName, String versionRange, Dictionary<String,String> filter)
{
return ClassServiceUtility.getClassService().getClassFinder(context).getClassBundleService(interfaceClassName, serviceClassName, versionRange, filter, -1);
} | [
"public",
"Object",
"getService",
"(",
"String",
"interfaceClassName",
",",
"String",
"serviceClassName",
",",
"String",
"versionRange",
",",
"Dictionary",
"<",
"String",
",",
"String",
">",
"filter",
")",
"{",
"return",
"ClassServiceUtility",
".",
"getClassService"... | Convenience method to get the service for this implementation class.
@param interfaceClassName
@return | [
"Convenience",
"method",
"to",
"get",
"the",
"service",
"for",
"this",
"implementation",
"class",
"."
] | train | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java#L284-L287 |
groovy/groovy-core | src/main/org/codehaus/groovy/syntax/Types.java | Types.canMean | public static boolean canMean( int actual, int preferred ) {
if( actual == preferred ) {
return true;
}
switch( preferred ) {
case SYNTH_PARAMETER_DECLARATION:
case IDENTIFIER:
switch( actual ) {
case IDENTIFIER:
... | java | public static boolean canMean( int actual, int preferred ) {
if( actual == preferred ) {
return true;
}
switch( preferred ) {
case SYNTH_PARAMETER_DECLARATION:
case IDENTIFIER:
switch( actual ) {
case IDENTIFIER:
... | [
"public",
"static",
"boolean",
"canMean",
"(",
"int",
"actual",
",",
"int",
"preferred",
")",
"{",
"if",
"(",
"actual",
"==",
"preferred",
")",
"{",
"return",
"true",
";",
"}",
"switch",
"(",
"preferred",
")",
"{",
"case",
"SYNTH_PARAMETER_DECLARATION",
":... | Given two types, returns true if the first can be viewed as the second.
NOTE that <code>canMean()</code> is orthogonal to <code>ofType()</code>. | [
"Given",
"two",
"types",
"returns",
"true",
"if",
"the",
"first",
"can",
"be",
"viewed",
"as",
"the",
"second",
".",
"NOTE",
"that",
"<code",
">",
"canMean",
"()",
"<",
"/",
"code",
">",
"is",
"orthogonal",
"to",
"<code",
">",
"ofType",
"()",
"<",
"/... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/syntax/Types.java#L854-L901 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalTime | public Time getInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case TIMESTAMP:
case DATETIME:
Timestamp ts = getInternalTimestamp(columnInfo, cal, ... | java | public Time getInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case TIMESTAMP:
case DATETIME:
Timestamp ts = getInternalTimestamp(columnInfo, cal, ... | [
"public",
"Time",
"getInternalTime",
"(",
"ColumnInformation",
"columnInfo",
",",
"Calendar",
"cal",
",",
"TimeZone",
"timeZone",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"(",
... | Get time from raw binary format.
@param columnInfo column information
@param cal calendar
@param timeZone time zone
@return Time value
@throws SQLException if column cannot be converted to Time | [
"Get",
"time",
"from",
"raw",
"binary",
"format",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L801-L851 |
tzaeschke/zoodb | src/org/zoodb/internal/util/FormattedStringBuilder.java | FormattedStringBuilder.fill | public FormattedStringBuilder fill(int newLength, char c) {
int lineStart = _delegate.lastIndexOf(NL);
if (lineStart == -1) {
return fillBuffer(newLength, c);
}
lineStart += NL.length();
return fillBuffer(lineStart + newLength, c);
} | java | public FormattedStringBuilder fill(int newLength, char c) {
int lineStart = _delegate.lastIndexOf(NL);
if (lineStart == -1) {
return fillBuffer(newLength, c);
}
lineStart += NL.length();
return fillBuffer(lineStart + newLength, c);
} | [
"public",
"FormattedStringBuilder",
"fill",
"(",
"int",
"newLength",
",",
"char",
"c",
")",
"{",
"int",
"lineStart",
"=",
"_delegate",
".",
"lastIndexOf",
"(",
"NL",
")",
";",
"if",
"(",
"lineStart",
"==",
"-",
"1",
")",
"{",
"return",
"fillBuffer",
"(",... | Attempts to append <tt>c</tt> until the current line gets the length <tt>
newLength</tt>. If the line is already as long or longer than <tt>
newLength</tt>, then nothing is appended.
@param newLength Minimal new length of the last line.
@param c Character to append.
@return The updated instance of FormattedStringBuilde... | [
"Attempts",
"to",
"append",
"<tt",
">",
"c<",
"/",
"tt",
">",
"until",
"the",
"current",
"line",
"gets",
"the",
"length",
"<tt",
">",
"newLength<",
"/",
"tt",
">",
".",
"If",
"the",
"line",
"is",
"already",
"as",
"long",
"or",
"longer",
"than",
"<tt"... | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/FormattedStringBuilder.java#L191-L198 |
cycorp/api-suite | core-api/src/main/java/com/cyc/session/exception/SessionCommunicationException.java | SessionCommunicationException.fromThrowable | public static SessionCommunicationException fromThrowable(String message, Throwable cause) {
return (cause instanceof SessionCommunicationException && Objects.equals(message, cause.getMessage()))
? (SessionCommunicationException) cause
: new SessionCommunicationException(messag... | java | public static SessionCommunicationException fromThrowable(String message, Throwable cause) {
return (cause instanceof SessionCommunicationException && Objects.equals(message, cause.getMessage()))
? (SessionCommunicationException) cause
: new SessionCommunicationException(messag... | [
"public",
"static",
"SessionCommunicationException",
"fromThrowable",
"(",
"String",
"message",
",",
"Throwable",
"cause",
")",
"{",
"return",
"(",
"cause",
"instanceof",
"SessionCommunicationException",
"&&",
"Objects",
".",
"equals",
"(",
"message",
",",
"cause",
... | Converts a Throwable to a SessionCommunicationException with the specified detail message. If the
Throwable is a SessionCommunicationException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in
a new SessionCommunicationExce... | [
"Converts",
"a",
"Throwable",
"to",
"a",
"SessionCommunicationException",
"with",
"the",
"specified",
"detail",
"message",
".",
"If",
"the",
"Throwable",
"is",
"a",
"SessionCommunicationException",
"and",
"if",
"the",
"Throwable",
"s",
"message",
"is",
"identical",
... | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/session/exception/SessionCommunicationException.java#L62-L66 |
vekexasia/android-edittext-validator | library/src/com/andreabaccega/widget/FormAutoCompleteTextView.java | FormAutoCompleteTextView.setError | @Override
public void setError(CharSequence error, Drawable icon) {
super.setError(error, icon);
lastErrorIcon = icon;
// if the error is not null, and we are in JB, force
// the error to show
if (error != null /* !isFocused() && */) {
showErrorIconHax(icon);
... | java | @Override
public void setError(CharSequence error, Drawable icon) {
super.setError(error, icon);
lastErrorIcon = icon;
// if the error is not null, and we are in JB, force
// the error to show
if (error != null /* !isFocused() && */) {
showErrorIconHax(icon);
... | [
"@",
"Override",
"public",
"void",
"setError",
"(",
"CharSequence",
"error",
",",
"Drawable",
"icon",
")",
"{",
"super",
".",
"setError",
"(",
"error",
",",
"icon",
")",
";",
"lastErrorIcon",
"=",
"icon",
";",
"// if the error is not null, and we are in JB, force"... | Resolve an issue where the error icon is hidden under some cases in JB
due to a bug http://code.google.com/p/android/issues/detail?id=40417 | [
"Resolve",
"an",
"issue",
"where",
"the",
"error",
"icon",
"is",
"hidden",
"under",
"some",
"cases",
"in",
"JB",
"due",
"to",
"a",
"bug",
"http",
":",
"//",
"code",
".",
"google",
".",
"com",
"/",
"p",
"/",
"android",
"/",
"issues",
"/",
"detail?id",... | train | https://github.com/vekexasia/android-edittext-validator/blob/4a100e3d708b232133f4dd8ceb37ad7447fc7a1b/library/src/com/andreabaccega/widget/FormAutoCompleteTextView.java#L92-L102 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/HubVirtualNetworkConnectionsInner.java | HubVirtualNetworkConnectionsInner.listAsync | public Observable<Page<HubVirtualNetworkConnectionInner>> listAsync(final String resourceGroupName, final String virtualHubName) {
return listWithServiceResponseAsync(resourceGroupName, virtualHubName)
.map(new Func1<ServiceResponse<Page<HubVirtualNetworkConnectionInner>>, Page<HubVirtualNetworkConn... | java | public Observable<Page<HubVirtualNetworkConnectionInner>> listAsync(final String resourceGroupName, final String virtualHubName) {
return listWithServiceResponseAsync(resourceGroupName, virtualHubName)
.map(new Func1<ServiceResponse<Page<HubVirtualNetworkConnectionInner>>, Page<HubVirtualNetworkConn... | [
"public",
"Observable",
"<",
"Page",
"<",
"HubVirtualNetworkConnectionInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"virtualHubName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",... | Retrieves the details of all HubVirtualNetworkConnections.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<HubVirtualNetworkConnecti... | [
"Retrieves",
"the",
"details",
"of",
"all",
"HubVirtualNetworkConnections",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/HubVirtualNetworkConnectionsInner.java#L214-L222 |
wildfly-extras/wildfly-camel | subsystem/core/src/main/java/org/wildfly/extension/camel/service/CamelEndpointDeployerService.java | CamelEndpointDeployerService.doDeploy | void doDeploy(URI uri, Consumer<EndpointServlet> endpointServletConsumer, Consumer<DeploymentInfo> deploymentInfoConsumer, Consumer<DeploymentImpl> deploymentConsumer) {
final ServletInfo servletInfo = Servlets.servlet(EndpointServlet.NAME, EndpointServlet.class).addMapping("/*")
.setAsyncSuppo... | java | void doDeploy(URI uri, Consumer<EndpointServlet> endpointServletConsumer, Consumer<DeploymentInfo> deploymentInfoConsumer, Consumer<DeploymentImpl> deploymentConsumer) {
final ServletInfo servletInfo = Servlets.servlet(EndpointServlet.NAME, EndpointServlet.class).addMapping("/*")
.setAsyncSuppo... | [
"void",
"doDeploy",
"(",
"URI",
"uri",
",",
"Consumer",
"<",
"EndpointServlet",
">",
"endpointServletConsumer",
",",
"Consumer",
"<",
"DeploymentInfo",
">",
"deploymentInfoConsumer",
",",
"Consumer",
"<",
"DeploymentImpl",
">",
"deploymentConsumer",
")",
"{",
"final... | The stuff common for {@link #deploy(URI, EndpointHttpHandler)} and {@link #deploy(URI, HttpHandler)}.
@param uri
@param endpointServletConsumer customize the {@link EndpointServlet}
@param deploymentInfoConsumer customize the {@link DeploymentInfo}
@param deploymentConsumer customize the {@link DeploymentImpl} | [
"The",
"stuff",
"common",
"for",
"{",
"@link",
"#deploy",
"(",
"URI",
"EndpointHttpHandler",
")",
"}",
"and",
"{",
"@link",
"#deploy",
"(",
"URI",
"HttpHandler",
")",
"}",
"."
] | train | https://github.com/wildfly-extras/wildfly-camel/blob/9ebd7e28574f277a6d5b583e8a4c357e1538c370/subsystem/core/src/main/java/org/wildfly/extension/camel/service/CamelEndpointDeployerService.java#L465-L501 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsImportExportUserDialog.java | CmsImportExportUserDialog.getExportUserDialogForOU | public static CmsImportExportUserDialog getExportUserDialogForOU(
String ou,
Window window,
boolean allowTechnicalFieldsExport) {
CmsImportExportUserDialog res = new CmsImportExportUserDialog(ou, null, window, allowTechnicalFieldsExport);
return res;
} | java | public static CmsImportExportUserDialog getExportUserDialogForOU(
String ou,
Window window,
boolean allowTechnicalFieldsExport) {
CmsImportExportUserDialog res = new CmsImportExportUserDialog(ou, null, window, allowTechnicalFieldsExport);
return res;
} | [
"public",
"static",
"CmsImportExportUserDialog",
"getExportUserDialogForOU",
"(",
"String",
"ou",
",",
"Window",
"window",
",",
"boolean",
"allowTechnicalFieldsExport",
")",
"{",
"CmsImportExportUserDialog",
"res",
"=",
"new",
"CmsImportExportUserDialog",
"(",
"ou",
",",
... | Gets an dialog instance for fixed group.<p>
@param ou ou name
@param window window
@param allowTechnicalFieldsExport flag indicates if technical field export option should be available
@return an instance of this class | [
"Gets",
"an",
"dialog",
"instance",
"for",
"fixed",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsImportExportUserDialog.java#L471-L478 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.appendParameter | private void appendParameter(Object value, StringBuffer buf)
{
if (value instanceof Query)
{
appendSubQuery((Query) value, buf);
}
else
{
buf.append("?");
}
} | java | private void appendParameter(Object value, StringBuffer buf)
{
if (value instanceof Query)
{
appendSubQuery((Query) value, buf);
}
else
{
buf.append("?");
}
} | [
"private",
"void",
"appendParameter",
"(",
"Object",
"value",
",",
"StringBuffer",
"buf",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Query",
")",
"{",
"appendSubQuery",
"(",
"(",
"Query",
")",
"value",
",",
"buf",
")",
";",
"}",
"else",
"{",
"buf",
"... | Append the Parameter
Add the place holder ? or the SubQuery
@param value the value of the criteria | [
"Append",
"the",
"Parameter",
"Add",
"the",
"place",
"holder",
"?",
"or",
"the",
"SubQuery"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L955-L965 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.logf | public void logf(String loggerFqcn, Level level, Throwable t, String format, Object... params) {
doLogf(level, loggerFqcn, format, params, t);
} | java | public void logf(String loggerFqcn, Level level, Throwable t, String format, Object... params) {
doLogf(level, loggerFqcn, format, params, t);
} | [
"public",
"void",
"logf",
"(",
"String",
"loggerFqcn",
",",
"Level",
"level",
",",
"Throwable",
"t",
",",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLogf",
"(",
"level",
",",
"loggerFqcn",
",",
"format",
",",
"params",
",",
"t",
"... | Log a message at the given level.
@param loggerFqcn the logger class name
@param level the level
@param t the throwable cause
@param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor
@param params the message parameters | [
"Log",
"a",
"message",
"at",
"the",
"given",
"level",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L2444-L2446 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/util/AbstractLog.java | AbstractLog.mandatoryNote | public void mandatoryNote(final JavaFileObject file, String key, Object ... args) {
report(diags.mandatoryNote(getSource(file), key, args));
} | java | public void mandatoryNote(final JavaFileObject file, String key, Object ... args) {
report(diags.mandatoryNote(getSource(file), key, args));
} | [
"public",
"void",
"mandatoryNote",
"(",
"final",
"JavaFileObject",
"file",
",",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"report",
"(",
"diags",
".",
"mandatoryNote",
"(",
"getSource",
"(",
"file",
")",
",",
"key",
",",
"args",
")",
")",
... | Provide a non-fatal notification, unless suppressed by the -nowarn option.
@param key The key for the localized notification message.
@param args Fields of the notification message. | [
"Provide",
"a",
"non",
"-",
"fatal",
"notification",
"unless",
"suppressed",
"by",
"the",
"-",
"nowarn",
"option",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/util/AbstractLog.java#L238-L240 |
alkacon/opencms-core | src/org/opencms/ui/apps/sitemanager/CmsCreateSiteThread.java | CmsCreateSiteThread.createSitemapContentFolder | private void createSitemapContentFolder(CmsObject cms, CmsResource subSitemapFolder, String contentFolder)
throws CmsException, CmsLoaderException {
CmsResource configFile = null;
String sitePath = cms.getSitePath(subSitemapFolder);
String folderName = CmsStringUtil.joinPaths(sitePath, CmsA... | java | private void createSitemapContentFolder(CmsObject cms, CmsResource subSitemapFolder, String contentFolder)
throws CmsException, CmsLoaderException {
CmsResource configFile = null;
String sitePath = cms.getSitePath(subSitemapFolder);
String folderName = CmsStringUtil.joinPaths(sitePath, CmsA... | [
"private",
"void",
"createSitemapContentFolder",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"subSitemapFolder",
",",
"String",
"contentFolder",
")",
"throws",
"CmsException",
",",
"CmsLoaderException",
"{",
"CmsResource",
"configFile",
"=",
"null",
";",
"String",
"s... | Helper method for creating the .content folder of a sub-sitemap.<p>
@param cms the current CMS context
@param subSitemapFolder the sub-sitemap folder in which the .content folder should be created
@param contentFolder the content folder path
@throws CmsException if something goes wrong
@throws CmsLoaderException if so... | [
"Helper",
"method",
"for",
"creating",
"the",
".",
"content",
"folder",
"of",
"a",
"sub",
"-",
"sitemap",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sitemanager/CmsCreateSiteThread.java#L334-L392 |
osglworks/java-tool | src/main/java/org/osgl/util/IO.java | IO.zipInto | public static void zipInto(File target, File... files) {
ZipOutputStream zos = null;
try {
zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(target)));
byte[] buffer = new byte[128];
for (File f : files) {
ZipEntry entry = new Zip... | java | public static void zipInto(File target, File... files) {
ZipOutputStream zos = null;
try {
zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(target)));
byte[] buffer = new byte[128];
for (File f : files) {
ZipEntry entry = new Zip... | [
"public",
"static",
"void",
"zipInto",
"(",
"File",
"target",
",",
"File",
"...",
"files",
")",
"{",
"ZipOutputStream",
"zos",
"=",
"null",
";",
"try",
"{",
"zos",
"=",
"new",
"ZipOutputStream",
"(",
"new",
"BufferedOutputStream",
"(",
"new",
"FileOutputStre... | Zip a list of files into specified target file.
@param target
the target file as the zip package
@param files
the files to be zipped. | [
"Zip",
"a",
"list",
"of",
"files",
"into",
"specified",
"target",
"file",
"."
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/IO.java#L2131-L2152 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/NewOnChangeHandler.java | NewOnChangeHandler.fieldChanged | public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
try {
m_recTarget.addNew();
} catch (DBException e) {
return e.getErrorCode();
}
return DBConstants.NORMAL_RETURN;
} | java | public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
try {
m_recTarget.addNew();
} catch (DBException e) {
return e.getErrorCode();
}
return DBConstants.NORMAL_RETURN;
} | [
"public",
"int",
"fieldChanged",
"(",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"try",
"{",
"m_recTarget",
".",
"addNew",
"(",
")",
";",
"}",
"catch",
"(",
"DBException",
"e",
")",
"{",
"return",
"e",
".",
"getErrorCode",
"(",
")",
... | The Field has Changed.
Do an addNew() on the target record.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay).
Field Changed, do an addNew on this record. | [
"The",
"Field",
"has",
"Changed",
".",
"Do",
"an",
"addNew",
"()",
"on",
"the",
"target",
"record",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/NewOnChangeHandler.java#L75-L83 |
revelc/formatter-maven-plugin | src/main/java/net/revelc/code/formatter/FormatterMojo.java | FormatterMojo.formatFile | private void formatFile(File file, ResultCollector rc, Properties hashCache, String basedirPath)
throws MojoFailureException, MojoExecutionException {
try {
doFormatFile(file, rc, hashCache, basedirPath, false);
} catch (IOException | MalformedTreeException | BadLocationException... | java | private void formatFile(File file, ResultCollector rc, Properties hashCache, String basedirPath)
throws MojoFailureException, MojoExecutionException {
try {
doFormatFile(file, rc, hashCache, basedirPath, false);
} catch (IOException | MalformedTreeException | BadLocationException... | [
"private",
"void",
"formatFile",
"(",
"File",
"file",
",",
"ResultCollector",
"rc",
",",
"Properties",
"hashCache",
",",
"String",
"basedirPath",
")",
"throws",
"MojoFailureException",
",",
"MojoExecutionException",
"{",
"try",
"{",
"doFormatFile",
"(",
"file",
",... | Format file.
@param file
the file
@param rc
the rc
@param hashCache
the hash cache
@param basedirPath
the basedir path | [
"Format",
"file",
"."
] | train | https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/FormatterMojo.java#L461-L469 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java | JaxWsUtils.getServiceQName | public static QName getServiceQName(ClassInfo classInfo, String seiClassName, String targetNamespace) {
AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, "Service QName");
if (annotationInfo == null) {
return null;
}
//serviceName can only be defined in i... | java | public static QName getServiceQName(ClassInfo classInfo, String seiClassName, String targetNamespace) {
AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, "Service QName");
if (annotationInfo == null) {
return null;
}
//serviceName can only be defined in i... | [
"public",
"static",
"QName",
"getServiceQName",
"(",
"ClassInfo",
"classInfo",
",",
"String",
"seiClassName",
",",
"String",
"targetNamespace",
")",
"{",
"AnnotationInfo",
"annotationInfo",
"=",
"getAnnotationInfoFromClass",
"(",
"classInfo",
",",
"\"Service QName\"",
"... | Get serviceName's QName of Web Service
@param classInfo
@return | [
"Get",
"serviceName",
"s",
"QName",
"of",
"Web",
"Service"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L92-L102 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/ImageHeaderReaderAbstract.java | ImageHeaderReaderAbstract.checkHeader | private static boolean checkHeader(InputStream input, int[] header) throws IOException
{
for (final int b : header)
{
if (b != input.read())
{
return false;
}
}
return true;
} | java | private static boolean checkHeader(InputStream input, int[] header) throws IOException
{
for (final int b : header)
{
if (b != input.read())
{
return false;
}
}
return true;
} | [
"private",
"static",
"boolean",
"checkHeader",
"(",
"InputStream",
"input",
",",
"int",
"[",
"]",
"header",
")",
"throws",
"IOException",
"{",
"for",
"(",
"final",
"int",
"b",
":",
"header",
")",
"{",
"if",
"(",
"b",
"!=",
"input",
".",
"read",
"(",
... | Check header data.
@param input The input stream to check.
@param header The expected header.
@return <code>true</code> if right header, <code>false</code> else.
@throws IOException If unable to read header. | [
"Check",
"header",
"data",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/ImageHeaderReaderAbstract.java#L104-L114 |
baratine/baratine | core/src/main/java/com/caucho/v5/inject/impl/InjectorImpl.java | InjectorImpl.addBinding | private <T> void addBinding(Class<T> type, BindingAmp<T> binding)
{
synchronized (_bindingSetMap) {
BindingSet<T> set = (BindingSet) _bindingSetMap.get(type);
if (set == null) {
set = new BindingSet<>(type);
_bindingSetMap.put(type, set);
}
set.addBinding(binding);
}
... | java | private <T> void addBinding(Class<T> type, BindingAmp<T> binding)
{
synchronized (_bindingSetMap) {
BindingSet<T> set = (BindingSet) _bindingSetMap.get(type);
if (set == null) {
set = new BindingSet<>(type);
_bindingSetMap.put(type, set);
}
set.addBinding(binding);
}
... | [
"private",
"<",
"T",
">",
"void",
"addBinding",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"BindingAmp",
"<",
"T",
">",
"binding",
")",
"{",
"synchronized",
"(",
"_bindingSetMap",
")",
"{",
"BindingSet",
"<",
"T",
">",
"set",
"=",
"(",
"BindingSet",
"... | Adds a new injection producer to the discovered producer list. | [
"Adds",
"a",
"new",
"injection",
"producer",
"to",
"the",
"discovered",
"producer",
"list",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/inject/impl/InjectorImpl.java#L754-L766 |
eyp/serfj | src/main/java/net/sf/serfj/ServletHelper.java | ServletHelper.inheritedStrategy | private Object inheritedStrategy(UrlInfo urlInfo, ResponseHelper responseHelper) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {
Class<?> clazz = Class.forName(urlInfo.getController());
Method setResponseHelper = clazz.getMet... | java | private Object inheritedStrategy(UrlInfo urlInfo, ResponseHelper responseHelper) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException {
Class<?> clazz = Class.forName(urlInfo.getController());
Method setResponseHelper = clazz.getMet... | [
"private",
"Object",
"inheritedStrategy",
"(",
"UrlInfo",
"urlInfo",
",",
"ResponseHelper",
"responseHelper",
")",
"throws",
"ClassNotFoundException",
",",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
"InstantiationException",
... | Invokes URL's action using INHERIT strategy. It means that controller
inherits from {@link RestController}, so the framework will inject
{@link ResponseHelper} to controller by RestAction.setResposeHelper
method. Furthermore, controller's actions signatures don't have
arguments.
@param urlInfo
Information of REST's U... | [
"Invokes",
"URL",
"s",
"action",
"using",
"INHERIT",
"strategy",
".",
"It",
"means",
"that",
"controller",
"inherits",
"from",
"{",
"@link",
"RestController",
"}",
"so",
"the",
"framework",
"will",
"inject",
"{",
"@link",
"ResponseHelper",
"}",
"to",
"controll... | train | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/ServletHelper.java#L170-L182 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildSerialUIDInfo | public void buildSerialUIDInfo(XMLNode node, Content classTree) {
Content serialUidTree = writer.getSerialUIDInfoHeader();
FieldDoc[] fields = currentClass.fields(false);
for (int i = 0; i < fields.length; i++) {
if (fields[i].name().equals("serialVersionUID") &&
fiel... | java | public void buildSerialUIDInfo(XMLNode node, Content classTree) {
Content serialUidTree = writer.getSerialUIDInfoHeader();
FieldDoc[] fields = currentClass.fields(false);
for (int i = 0; i < fields.length; i++) {
if (fields[i].name().equals("serialVersionUID") &&
fiel... | [
"public",
"void",
"buildSerialUIDInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"classTree",
")",
"{",
"Content",
"serialUidTree",
"=",
"writer",
".",
"getSerialUIDInfoHeader",
"(",
")",
";",
"FieldDoc",
"[",
"]",
"fields",
"=",
"currentClass",
".",
"fields",
... | Build the serial UID information for the given class.
@param node the XML element that specifies which components to document
@param classTree content tree to which the serial UID information will be added | [
"Build",
"the",
"serial",
"UID",
"information",
"for",
"the",
"given",
"class",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java#L240-L252 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.listAsync | public Observable<Page<WorkflowInner>> listAsync(final Integer top, final String filter) {
return listWithServiceResponseAsync(top, filter)
.map(new Func1<ServiceResponse<Page<WorkflowInner>>, Page<WorkflowInner>>() {
@Override
public Page<WorkflowInner> call(ServiceR... | java | public Observable<Page<WorkflowInner>> listAsync(final Integer top, final String filter) {
return listWithServiceResponseAsync(top, filter)
.map(new Func1<ServiceResponse<Page<WorkflowInner>>, Page<WorkflowInner>>() {
@Override
public Page<WorkflowInner> call(ServiceR... | [
"public",
"Observable",
"<",
"Page",
"<",
"WorkflowInner",
">",
">",
"listAsync",
"(",
"final",
"Integer",
"top",
",",
"final",
"String",
"filter",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"top",
",",
"filter",
")",
".",
"map",
"(",
"new",
... | Gets a list of workflows by subscription.
@param top The number of items to be included in the result.
@param filter The filter to apply on the operation. Options for filters include: State, Trigger, and ReferencedResourceId.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observa... | [
"Gets",
"a",
"list",
"of",
"workflows",
"by",
"subscription",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L294-L302 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.