repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 218 | func_name stringlengths 5 140 | whole_func_string stringlengths 79 3.99k | language stringclasses 1
value | func_code_string stringlengths 79 3.99k | func_code_tokens listlengths 20 624 | func_documentation_string stringlengths 61 1.96k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 107 339 |
|---|---|---|---|---|---|---|---|---|---|---|
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/comp/Resolve.java | Resolve.resolveOperator | Symbol resolveOperator(DiagnosticPosition pos, JCTree.Tag optag,
Env<AttrContext> env, List<Type> argtypes) {
MethodResolutionContext prevResolutionContext = currentResolutionContext;
try {
currentResolutionContext = new MethodResolutionContext();
Name ... | java | Symbol resolveOperator(DiagnosticPosition pos, JCTree.Tag optag,
Env<AttrContext> env, List<Type> argtypes) {
MethodResolutionContext prevResolutionContext = currentResolutionContext;
try {
currentResolutionContext = new MethodResolutionContext();
Name ... | [
"Symbol",
"resolveOperator",
"(",
"DiagnosticPosition",
"pos",
",",
"JCTree",
".",
"Tag",
"optag",
",",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"List",
"<",
"Type",
">",
"argtypes",
")",
"{",
"MethodResolutionContext",
"prevResolutionContext",
"=",
"currentR... | Resolve operator.
@param pos The position to use for error reporting.
@param optag The tag of the operation tree.
@param env The environment current at the operation.
@param argtypes The types of the operands. | [
"Resolve",
"operator",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/Resolve.java#L2679-L2702 |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/LengthOperation.java | LengthOperation.getLengthOfObject | private Object getLengthOfObject(Object object, String functionName) throws TransformationOperationException {
try {
Method method = object.getClass().getMethod(functionName);
return method.invoke(object);
} catch (NoSuchMethodException e) {
StringBuilder builder = ne... | java | private Object getLengthOfObject(Object object, String functionName) throws TransformationOperationException {
try {
Method method = object.getClass().getMethod(functionName);
return method.invoke(object);
} catch (NoSuchMethodException e) {
StringBuilder builder = ne... | [
"private",
"Object",
"getLengthOfObject",
"(",
"Object",
"object",
",",
"String",
"functionName",
")",
"throws",
"TransformationOperationException",
"{",
"try",
"{",
"Method",
"method",
"=",
"object",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"functionName... | Returns the length of the given object got through the method of the given function name | [
"Returns",
"the",
"length",
"of",
"the",
"given",
"object",
"got",
"through",
"the",
"method",
"of",
"the",
"given",
"function",
"name"
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/LengthOperation.java#L69-L85 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.findAll | @Override
public List<CommerceDiscount> findAll(int start, int end) {
return findAll(start, end, null);
} | java | @Override
public List<CommerceDiscount> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscount",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce discounts.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>st... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"discounts",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L5171-L5174 |
dottydingo/hyperion | core/src/main/java/com/dottydingo/hyperion/core/endpoint/pipeline/phase/UpdatePhase.java | UpdatePhase.processLegacyRequest | protected void processLegacyRequest(HyperionContext hyperionContext)
{
EndpointRequest request = hyperionContext.getEndpointRequest();
EndpointResponse response = hyperionContext.getEndpointResponse();
ApiVersionPlugin<ApiObject<Serializable>,PersistentObject<Serializable>,Serializable> api... | java | protected void processLegacyRequest(HyperionContext hyperionContext)
{
EndpointRequest request = hyperionContext.getEndpointRequest();
EndpointResponse response = hyperionContext.getEndpointResponse();
ApiVersionPlugin<ApiObject<Serializable>,PersistentObject<Serializable>,Serializable> api... | [
"protected",
"void",
"processLegacyRequest",
"(",
"HyperionContext",
"hyperionContext",
")",
"{",
"EndpointRequest",
"request",
"=",
"hyperionContext",
".",
"getEndpointRequest",
"(",
")",
";",
"EndpointResponse",
"response",
"=",
"hyperionContext",
".",
"getEndpointRespo... | Process a legacy V1 request (single item)
@param hyperionContext The context | [
"Process",
"a",
"legacy",
"V1",
"request",
"(",
"single",
"item",
")"
] | train | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/core/src/main/java/com/dottydingo/hyperion/core/endpoint/pipeline/phase/UpdatePhase.java#L48-L88 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeCRI.java | TreeCRI.preRequest | public void preRequest(RequestInterceptorContext ctxt, InterceptorChain chain) throws InterceptorException
{
HttpServletRequest request = ctxt.getRequest();
String cmd = parseCommand(request.getRequestURI());
render(request, ctxt.getResponse(), ctxt.getServletContext(), cmd);
chain... | java | public void preRequest(RequestInterceptorContext ctxt, InterceptorChain chain) throws InterceptorException
{
HttpServletRequest request = ctxt.getRequest();
String cmd = parseCommand(request.getRequestURI());
render(request, ctxt.getResponse(), ctxt.getServletContext(), cmd);
chain... | [
"public",
"void",
"preRequest",
"(",
"RequestInterceptorContext",
"ctxt",
",",
"InterceptorChain",
"chain",
")",
"throws",
"InterceptorException",
"{",
"HttpServletRequest",
"request",
"=",
"ctxt",
".",
"getRequest",
"(",
")",
";",
"String",
"cmd",
"=",
"parseComman... | Implementation of the {@link RequestInterceptor#preRequest(org.apache.beehive.netui.pageflow.interceptor.request.RequestInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain)}
method for using this class as part of a request interceptor chain.
@param ctxt the interceptor's context object
@... | [
"Implementation",
"of",
"the",
"{",
"@link",
"RequestInterceptor#preRequest",
"(",
"org",
".",
"apache",
".",
"beehive",
".",
"netui",
".",
"pageflow",
".",
"interceptor",
".",
"request",
".",
"RequestInterceptorContext",
"org",
".",
"apache",
".",
"beehive",
".... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeCRI.java#L89-L97 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.isFalse | public static void isFalse(Boolean condition, Supplier<String> message) {
if (isNotFalse(condition)) {
throw new IllegalArgumentException(message.get());
}
} | java | public static void isFalse(Boolean condition, Supplier<String> message) {
if (isNotFalse(condition)) {
throw new IllegalArgumentException(message.get());
}
} | [
"public",
"static",
"void",
"isFalse",
"(",
"Boolean",
"condition",
",",
"Supplier",
"<",
"String",
">",
"message",
")",
"{",
"if",
"(",
"isNotFalse",
"(",
"condition",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",
".",
"get",
... | Asserts that the condition is {@literal false}.
The assertion holds if and only if the value is equal to {@literal false}.
@param condition {@link Boolean} value being evaluated.
@param message {@link Supplier} containing the message used in the {@link IllegalArgumentException} thrown
if the assertion fails.
@throws ... | [
"Asserts",
"that",
"the",
"condition",
"is",
"{",
"@literal",
"false",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L649-L653 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/OrmElf.java | OrmElf.resultSetToObject | public static <T> T resultSetToObject(ResultSet resultSet, T target, Set<String> ignoredColumns) throws SQLException
{
return OrmReader.resultSetToObject(resultSet, target, ignoredColumns);
} | java | public static <T> T resultSetToObject(ResultSet resultSet, T target, Set<String> ignoredColumns) throws SQLException
{
return OrmReader.resultSetToObject(resultSet, target, ignoredColumns);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"resultSetToObject",
"(",
"ResultSet",
"resultSet",
",",
"T",
"target",
",",
"Set",
"<",
"String",
">",
"ignoredColumns",
")",
"throws",
"SQLException",
"{",
"return",
"OrmReader",
".",
"resultSetToObject",
"(",
"resultS... | Get an object from the specified ResultSet. ResultSet.next() is <i>NOT</i> called,
this should be done by the caller. <b>The ResultSet is not closed as a result of this
method.</b>
@param resultSet a {@link ResultSet}
@param target the target object to set values on
@param ignoredColumns the columns in the result se... | [
"Get",
"an",
"object",
"from",
"the",
"specified",
"ResultSet",
".",
"ResultSet",
".",
"next",
"()",
"is",
"<i",
">",
"NOT<",
"/",
"i",
">",
"called",
"this",
"should",
"be",
"done",
"by",
"the",
"caller",
".",
"<b",
">",
"The",
"ResultSet",
"is",
"n... | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/OrmElf.java#L185-L188 |
apache/flink | flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/SqlClient.java | SqlClient.openCli | private void openCli(SessionContext context, Executor executor) {
CliClient cli = null;
try {
cli = new CliClient(context, executor);
// interactive CLI mode
if (options.getUpdateStatement() == null) {
cli.open();
}
// execute single update statement
else {
final boolean success = cli.subm... | java | private void openCli(SessionContext context, Executor executor) {
CliClient cli = null;
try {
cli = new CliClient(context, executor);
// interactive CLI mode
if (options.getUpdateStatement() == null) {
cli.open();
}
// execute single update statement
else {
final boolean success = cli.subm... | [
"private",
"void",
"openCli",
"(",
"SessionContext",
"context",
",",
"Executor",
"executor",
")",
"{",
"CliClient",
"cli",
"=",
"null",
";",
"try",
"{",
"cli",
"=",
"new",
"CliClient",
"(",
"context",
",",
"executor",
")",
";",
"// interactive CLI mode",
"if... | Opens the CLI client for executing SQL statements.
@param context session context
@param executor executor | [
"Opens",
"the",
"CLI",
"client",
"for",
"executing",
"SQL",
"statements",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/SqlClient.java#L117-L137 |
google/error-prone | check_api/src/main/java/com/google/errorprone/JavacErrorDescriptionListener.java | JavacErrorDescriptionListener.shouldSkipImportTreeFix | private static boolean shouldSkipImportTreeFix(DiagnosticPosition position, Fix f) {
if (position.getTree() != null && position.getTree().getKind() != Kind.IMPORT) {
return false;
}
return !f.getImportsToAdd().isEmpty() || !f.getImportsToRemove().isEmpty();
} | java | private static boolean shouldSkipImportTreeFix(DiagnosticPosition position, Fix f) {
if (position.getTree() != null && position.getTree().getKind() != Kind.IMPORT) {
return false;
}
return !f.getImportsToAdd().isEmpty() || !f.getImportsToRemove().isEmpty();
} | [
"private",
"static",
"boolean",
"shouldSkipImportTreeFix",
"(",
"DiagnosticPosition",
"position",
",",
"Fix",
"f",
")",
"{",
"if",
"(",
"position",
".",
"getTree",
"(",
")",
"!=",
"null",
"&&",
"position",
".",
"getTree",
"(",
")",
".",
"getKind",
"(",
")"... | be fixed if they were specified via SuggestedFix.replace, for example. | [
"be",
"fixed",
"if",
"they",
"were",
"specified",
"via",
"SuggestedFix",
".",
"replace",
"for",
"example",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/JavacErrorDescriptionListener.java#L119-L125 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java | AbstractLog.note | public void note(DiagnosticPosition pos, String key, Object ... args) {
note(pos, diags.noteKey(key, args));
} | java | public void note(DiagnosticPosition pos, String key, Object ... args) {
note(pos, diags.noteKey(key, args));
} | [
"public",
"void",
"note",
"(",
"DiagnosticPosition",
"pos",
",",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"note",
"(",
"pos",
",",
"diags",
".",
"noteKey",
"(",
"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/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java#L340-L342 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/HELM1Utils.java | HELM1Utils.setCanonicalHELMSecondSection | private static String setCanonicalHELMSecondSection(Map<String, String> convertsortedIdstoIds, List<ConnectionNotation> connectionNotations) throws HELM1ConverterException {
StringBuilder notation = new StringBuilder();
for (ConnectionNotation connectionNotation : connectionNotations) {
/* canonicalize... | java | private static String setCanonicalHELMSecondSection(Map<String, String> convertsortedIdstoIds, List<ConnectionNotation> connectionNotations) throws HELM1ConverterException {
StringBuilder notation = new StringBuilder();
for (ConnectionNotation connectionNotation : connectionNotations) {
/* canonicalize... | [
"private",
"static",
"String",
"setCanonicalHELMSecondSection",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"convertsortedIdstoIds",
",",
"List",
"<",
"ConnectionNotation",
">",
"connectionNotations",
")",
"throws",
"HELM1ConverterException",
"{",
"StringBuilder",
"n... | method to generate a canonical HELM 1 connection section
@param convertsortedIdstoIds Map of old ids with the equivalent new ids
@return second section of HELM
@throws HELM1ConverterException | [
"method",
"to",
"generate",
"a",
"canonical",
"HELM",
"1",
"connection",
"section"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/HELM1Utils.java#L299-L320 |
jbundle/jbundle | base/screen/control/servlet/src/main/java/org/jbundle/base/screen/control/servlet/BaseHttpTask.java | BaseHttpTask.initTask | public void initTask(App application, Map<String, Object> properties)
{
Utility.getLogger().warning("error: initTask() can never be called for a Servlet");
new Exception().printStackTrace();
} | java | public void initTask(App application, Map<String, Object> properties)
{
Utility.getLogger().warning("error: initTask() can never be called for a Servlet");
new Exception().printStackTrace();
} | [
"public",
"void",
"initTask",
"(",
"App",
"application",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"Utility",
".",
"getLogger",
"(",
")",
".",
"warning",
"(",
"\"error: initTask() can never be called for a Servlet\"",
")",
";",
"new"... | If this task object was created from a class name, call init(xxx) for the task.
You may want to put logic in here that checks to make sure this object was not already inited.
Typically, you init a Task object and pass it to the job scheduler. The job scheduler
will check to see if this task is owned by an application..... | [
"If",
"this",
"task",
"object",
"was",
"created",
"from",
"a",
"class",
"name",
"call",
"init",
"(",
"xxx",
")",
"for",
"the",
"task",
".",
"You",
"may",
"want",
"to",
"put",
"logic",
"in",
"here",
"that",
"checks",
"to",
"make",
"sure",
"this",
"obj... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/control/servlet/src/main/java/org/jbundle/base/screen/control/servlet/BaseHttpTask.java#L475-L479 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ResourceBundle.java | ResourceBundle.getBundle | public static ResourceBundle getBundle(String baseName,
Locale targetLocale, ClassLoader loader,
ResourceBundle.Control control) {
boolean expired = false;
String bundleName = control.toBundleName(baseName, targetLocale);
Object cacheKey = loader != null ? loader : "null"... | java | public static ResourceBundle getBundle(String baseName,
Locale targetLocale, ClassLoader loader,
ResourceBundle.Control control) {
boolean expired = false;
String bundleName = control.toBundleName(baseName, targetLocale);
Object cacheKey = loader != null ? loader : "null"... | [
"public",
"static",
"ResourceBundle",
"getBundle",
"(",
"String",
"baseName",
",",
"Locale",
"targetLocale",
",",
"ClassLoader",
"loader",
",",
"ResourceBundle",
".",
"Control",
"control",
")",
"{",
"boolean",
"expired",
"=",
"false",
";",
"String",
"bundleName",
... | Finds the named resource bundle for the specified base name and control.
@param baseName
the base name of a resource bundle
@param targetLocale
the target locale of the resource bundle
@param loader
the class loader to load resource
@param control
the control that control the access sequence
@return the named resource... | [
"Finds",
"the",
"named",
"resource",
"bundle",
"for",
"the",
"specified",
"base",
"name",
"and",
"control",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ResourceBundle.java#L297-L328 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionVertex.java | ExecutionVertex.insertInputGate | void insertInputGate(final int pos, final ExecutionGate inputGate) {
if (this.inputGates[pos] != null) {
throw new IllegalStateException("Input gate at position " + pos + " is not null");
}
this.inputGates[pos] = inputGate;
} | java | void insertInputGate(final int pos, final ExecutionGate inputGate) {
if (this.inputGates[pos] != null) {
throw new IllegalStateException("Input gate at position " + pos + " is not null");
}
this.inputGates[pos] = inputGate;
} | [
"void",
"insertInputGate",
"(",
"final",
"int",
"pos",
",",
"final",
"ExecutionGate",
"inputGate",
")",
"{",
"if",
"(",
"this",
".",
"inputGates",
"[",
"pos",
"]",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Input gate at position ... | Inserts the input gate at the given position.
@param pos
the position to insert the input gate
@param outputGate
the input gate to be inserted | [
"Inserts",
"the",
"input",
"gate",
"at",
"the",
"given",
"position",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionVertex.java#L268-L275 |
petergeneric/stdlib | util/carbon-client/src/main/java/com/peterphi/carbon/type/mutable/CarbonSource.java | CarbonSource.setInOutPoint | public void setInOutPoint(long in, long out)
{
// Remove in/out point (we're replacing it)
removeInOutPoint();
// Build a new InOutPoints element
Element filter = buildInOutElement(in, out);
element.addContent(filter);
} | java | public void setInOutPoint(long in, long out)
{
// Remove in/out point (we're replacing it)
removeInOutPoint();
// Build a new InOutPoints element
Element filter = buildInOutElement(in, out);
element.addContent(filter);
} | [
"public",
"void",
"setInOutPoint",
"(",
"long",
"in",
",",
"long",
"out",
")",
"{",
"// Remove in/out point (we're replacing it)",
"removeInOutPoint",
"(",
")",
";",
"// Build a new InOutPoints element",
"Element",
"filter",
"=",
"buildInOutElement",
"(",
"in",
",",
"... | Set the in/out frame points (expressed in timebase of 1/27,000,000)
@param in
@param out | [
"Set",
"the",
"in",
"/",
"out",
"frame",
"points",
"(",
"expressed",
"in",
"timebase",
"of",
"1",
"/",
"27",
"000",
"000",
")"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/util/carbon-client/src/main/java/com/peterphi/carbon/type/mutable/CarbonSource.java#L70-L79 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/VsanUpgradeSystem.java | VsanUpgradeSystem.performVsanUpgradePreflightCheck | public VsanUpgradeSystemPreflightCheckResult performVsanUpgradePreflightCheck(ClusterComputeResource cluster, Boolean downgradeFormat) throws RuntimeFault, VsanFault, RemoteException {
return getVimService().performVsanUpgradePreflightCheck(getMOR(), cluster.getMOR(), downgradeFormat);
} | java | public VsanUpgradeSystemPreflightCheckResult performVsanUpgradePreflightCheck(ClusterComputeResource cluster, Boolean downgradeFormat) throws RuntimeFault, VsanFault, RemoteException {
return getVimService().performVsanUpgradePreflightCheck(getMOR(), cluster.getMOR(), downgradeFormat);
} | [
"public",
"VsanUpgradeSystemPreflightCheckResult",
"performVsanUpgradePreflightCheck",
"(",
"ClusterComputeResource",
"cluster",
",",
"Boolean",
"downgradeFormat",
")",
"throws",
"RuntimeFault",
",",
"VsanFault",
",",
"RemoteException",
"{",
"return",
"getVimService",
"(",
")... | Perform an upgrade pre-flight check on a cluster.
@param cluster The cluster for which to perform the check.
@param downgradeFormat Intend to perform a on-disk format downgrade instead of upgrade. Adds additional checks.
@return Pre-flight check result.
@throws RuntimeFault
@throws VsanFault
@throws RemoteExce... | [
"Perform",
"an",
"upgrade",
"pre",
"-",
"flight",
"check",
"on",
"a",
"cluster",
"."
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/VsanUpgradeSystem.java#L194-L196 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java | SARLValidator.reportCastWarnings | protected void reportCastWarnings(JvmTypeReference concreteSyntax, LightweightTypeReference toType, LightweightTypeReference fromType) {
if (!isIgnored(OBSOLETE_CAST) && toType.isAssignableFrom(fromType)) {
addIssue(MessageFormat.format(Messages.SARLValidator_96, fromType.getHumanReadableName(),
toType.getHum... | java | protected void reportCastWarnings(JvmTypeReference concreteSyntax, LightweightTypeReference toType, LightweightTypeReference fromType) {
if (!isIgnored(OBSOLETE_CAST) && toType.isAssignableFrom(fromType)) {
addIssue(MessageFormat.format(Messages.SARLValidator_96, fromType.getHumanReadableName(),
toType.getHum... | [
"protected",
"void",
"reportCastWarnings",
"(",
"JvmTypeReference",
"concreteSyntax",
",",
"LightweightTypeReference",
"toType",
",",
"LightweightTypeReference",
"fromType",
")",
"{",
"if",
"(",
"!",
"isIgnored",
"(",
"OBSOLETE_CAST",
")",
"&&",
"toType",
".",
"isAssi... | Report the warnings associated to the casted expressions.
@param concreteSyntax the type specified into the casted expression.
@param toType the type specified into the casted expression.
@param fromType the type of the source expression. | [
"Report",
"the",
"warnings",
"associated",
"to",
"the",
"casted",
"expressions",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java#L3036-L3041 |
HubSpot/jinjava | src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java | JinjavaInterpreter.resolveObject | public Object resolveObject(String variable, int lineNumber, int startPosition) {
if (StringUtils.isBlank(variable)) {
return "";
}
if (WhitespaceUtils.isQuoted(variable)) {
return WhitespaceUtils.unquote(variable);
} else {
Object val = retraceVariable(variable, lineNumber, startPosit... | java | public Object resolveObject(String variable, int lineNumber, int startPosition) {
if (StringUtils.isBlank(variable)) {
return "";
}
if (WhitespaceUtils.isQuoted(variable)) {
return WhitespaceUtils.unquote(variable);
} else {
Object val = retraceVariable(variable, lineNumber, startPosit... | [
"public",
"Object",
"resolveObject",
"(",
"String",
"variable",
",",
"int",
"lineNumber",
",",
"int",
"startPosition",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"variable",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"WhitespaceUti... | Resolve a variable into an object value. If given a string literal (e.g. 'foo' or "foo"), this method returns the literal unquoted. If the variable is undefined in the context, this method returns the given variable string.
@param variable
name of variable in context
@param lineNumber
current line number, for error re... | [
"Resolve",
"a",
"variable",
"into",
"an",
"object",
"value",
".",
"If",
"given",
"a",
"string",
"literal",
"(",
"e",
".",
"g",
".",
"foo",
"or",
"foo",
")",
"this",
"method",
"returns",
"the",
"literal",
"unquoted",
".",
"If",
"the",
"variable",
"is",
... | train | https://github.com/HubSpot/jinjava/blob/ce570935630f49c666170d2330b0b9ba4eddb955/src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java#L359-L372 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgVertex2D.java | DwgVertex2D.readDwgVertex2DV15 | public void readDwgVertex2DV15(int[] data, int offset) throws Exception {
//System.out.println("readDwgVertex2D executing ...");
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getRawChar(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
int flags = ((Integer)v.get(... | java | public void readDwgVertex2DV15(int[] data, int offset) throws Exception {
//System.out.println("readDwgVertex2D executing ...");
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getRawChar(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
int flags = ((Integer)v.get(... | [
"public",
"void",
"readDwgVertex2DV15",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"throws",
"Exception",
"{",
"//System.out.println(\"readDwgVertex2D executing ...\");",
"int",
"bitPos",
"=",
"offset",
";",
"bitPos",
"=",
"readObjectHeaderV15",
"(",
"... | Read a Vertex2D in the DWG format Version 15
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@throws Exception If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines. | [
"Read",
"a",
"Vertex2D",
"in",
"the",
"DWG",
"format",
"Version",
"15"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgVertex2D.java#L47-L89 |
google/closure-templates | java/src/com/google/template/soy/base/SourceLocation.java | SourceLocation.extend | public SourceLocation extend(SourceLocation other) {
checkState(
filePath.equals(other.filePath),
"Mismatched files paths: %s and %s",
filePath,
other.filePath);
return new SourceLocation(filePath, begin, other.end);
} | java | public SourceLocation extend(SourceLocation other) {
checkState(
filePath.equals(other.filePath),
"Mismatched files paths: %s and %s",
filePath,
other.filePath);
return new SourceLocation(filePath, begin, other.end);
} | [
"public",
"SourceLocation",
"extend",
"(",
"SourceLocation",
"other",
")",
"{",
"checkState",
"(",
"filePath",
".",
"equals",
"(",
"other",
".",
"filePath",
")",
",",
"\"Mismatched files paths: %s and %s\"",
",",
"filePath",
",",
"other",
".",
"filePath",
")",
"... | Returns a new SourceLocation that starts where this SourceLocation starts and ends where {@code
other} ends. | [
"Returns",
"a",
"new",
"SourceLocation",
"that",
"starts",
"where",
"this",
"SourceLocation",
"starts",
"and",
"ends",
"where",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/base/SourceLocation.java#L187-L194 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLocalizationPersistenceImpl.java | CPDefinitionLocalizationPersistenceImpl.fetchByCPDefinitionId_LanguageId | @Override
public CPDefinitionLocalization fetchByCPDefinitionId_LanguageId(
long CPDefinitionId, String languageId) {
return fetchByCPDefinitionId_LanguageId(CPDefinitionId, languageId, true);
} | java | @Override
public CPDefinitionLocalization fetchByCPDefinitionId_LanguageId(
long CPDefinitionId, String languageId) {
return fetchByCPDefinitionId_LanguageId(CPDefinitionId, languageId, true);
} | [
"@",
"Override",
"public",
"CPDefinitionLocalization",
"fetchByCPDefinitionId_LanguageId",
"(",
"long",
"CPDefinitionId",
",",
"String",
"languageId",
")",
"{",
"return",
"fetchByCPDefinitionId_LanguageId",
"(",
"CPDefinitionId",
",",
"languageId",
",",
"true",
")",
";",
... | Returns the cp definition localization where CPDefinitionId = ? and languageId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param CPDefinitionId the cp definition ID
@param languageId the language ID
@return the matching cp definition localization, or <code>null</code> if ... | [
"Returns",
"the",
"cp",
"definition",
"localization",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"languageId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"t... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLocalizationPersistenceImpl.java#L676-L680 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/http/client/SimpleClientHttpRequestFactory.java | SimpleClientHttpRequestFactory.openConnection | protected HttpURLConnection openConnection(URL url, Proxy proxy) throws IOException {
URLConnection urlConnection = (proxy != null ? url.openConnection(proxy) : url.openConnection());
Assert.isInstanceOf(HttpURLConnection.class, urlConnection);
return (HttpURLConnection) urlConnection;
} | java | protected HttpURLConnection openConnection(URL url, Proxy proxy) throws IOException {
URLConnection urlConnection = (proxy != null ? url.openConnection(proxy) : url.openConnection());
Assert.isInstanceOf(HttpURLConnection.class, urlConnection);
return (HttpURLConnection) urlConnection;
} | [
"protected",
"HttpURLConnection",
"openConnection",
"(",
"URL",
"url",
",",
"Proxy",
"proxy",
")",
"throws",
"IOException",
"{",
"URLConnection",
"urlConnection",
"=",
"(",
"proxy",
"!=",
"null",
"?",
"url",
".",
"openConnection",
"(",
"proxy",
")",
":",
"url"... | Opens and returns a connection to the given URL.
<p>The default implementation uses the given {@linkplain #setProxy(java.net.Proxy) proxy} -
if any - to open a connection.
@param url the URL to open a connection to
@param proxy the proxy to use, may be {@code null}
@return the opened connection
@throws IOException in c... | [
"Opens",
"and",
"returns",
"a",
"connection",
"to",
"the",
"given",
"URL",
".",
"<p",
">",
"The",
"default",
"implementation",
"uses",
"the",
"given",
"{"
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/http/client/SimpleClientHttpRequestFactory.java#L165-L169 |
liferay/com-liferay-commerce | commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountPersistenceImpl.java | CommerceAccountPersistenceImpl.findAll | @Override
public List<CommerceAccount> findAll(int start, int end) {
return findAll(start, end, null);
} | java | @Override
public List<CommerceAccount> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceAccount",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce accounts.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>sta... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"accounts",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-account-service/src/main/java/com/liferay/commerce/account/service/persistence/impl/CommerceAccountPersistenceImpl.java#L2760-L2763 |
xqbase/util | util/src/main/java/com/xqbase/util/Numbers.java | Numbers.parseLong | public static long parseLong(String s, long l) {
if (s == null) {
return l;
}
try {
return Long.parseLong(s.trim());
} catch (NumberFormatException e) {
return l;
}
} | java | public static long parseLong(String s, long l) {
if (s == null) {
return l;
}
try {
return Long.parseLong(s.trim());
} catch (NumberFormatException e) {
return l;
}
} | [
"public",
"static",
"long",
"parseLong",
"(",
"String",
"s",
",",
"long",
"l",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"l",
";",
"}",
"try",
"{",
"return",
"Long",
".",
"parseLong",
"(",
"s",
".",
"trim",
"(",
")",
")",
";",... | Parse a <b>long</b> with a given default value <b>l</b>
@return default value if null or not parsable | [
"Parse",
"a",
"<b",
">",
"long<",
"/",
"b",
">",
"with",
"a",
"given",
"default",
"value",
"<b",
">",
"l<",
"/",
"b",
">"
] | train | https://github.com/xqbase/util/blob/e7b9167b6c701b9eec988a9d1e68446cef5ef420/util/src/main/java/com/xqbase/util/Numbers.java#L74-L83 |
GII/broccoli | broccoli-owls/src/main/java/com/hi3project/broccoli/bsdf/impl/owl/OWLValueObject.java | OWLValueObject.buildAsResultFromObject | public static OWLValueObject buildAsResultFromObject(OWLModel model, Object object) throws NotYetImplementedException, OWLTranslationException {
if (ObjectOWLSTranslator.isJenaBean(object)) {
try {
return new OWLValueObject(
model,
OWLU... | java | public static OWLValueObject buildAsResultFromObject(OWLModel model, Object object) throws NotYetImplementedException, OWLTranslationException {
if (ObjectOWLSTranslator.isJenaBean(object)) {
try {
return new OWLValueObject(
model,
OWLU... | [
"public",
"static",
"OWLValueObject",
"buildAsResultFromObject",
"(",
"OWLModel",
"model",
",",
"Object",
"object",
")",
"throws",
"NotYetImplementedException",
",",
"OWLTranslationException",
"{",
"if",
"(",
"ObjectOWLSTranslator",
".",
"isJenaBean",
"(",
"object",
")"... | Builds an instance
@param model
@param object
@return
@throws NotYetImplementedException
@throws OWLTranslationException | [
"Builds",
"an",
"instance"
] | train | https://github.com/GII/broccoli/blob/a3033a90322cbcee4dc0f1719143b84b822bc4ba/broccoli-owls/src/main/java/com/hi3project/broccoli/bsdf/impl/owl/OWLValueObject.java#L174-L187 |
lucee/Lucee | core/src/main/java/lucee/commons/io/IOUtil.java | IOUtil._getReader | private static Reader _getReader(InputStream is, Charset charset) throws IOException {
if (charset == null) charset = SystemUtil.getCharset();
return new BufferedReader(new InputStreamReader(is, charset));
} | java | private static Reader _getReader(InputStream is, Charset charset) throws IOException {
if (charset == null) charset = SystemUtil.getCharset();
return new BufferedReader(new InputStreamReader(is, charset));
} | [
"private",
"static",
"Reader",
"_getReader",
"(",
"InputStream",
"is",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"if",
"(",
"charset",
"==",
"null",
")",
"charset",
"=",
"SystemUtil",
".",
"getCharset",
"(",
")",
";",
"return",
"new",
"... | returns a Reader for the given InputStream
@param is
@param charset
@return Reader
@throws IOException | [
"returns",
"a",
"Reader",
"for",
"the",
"given",
"InputStream"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L667-L670 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java | IDNA.convertIDNToUnicode | @Deprecated
public static StringBuffer convertIDNToUnicode(UCharacterIterator src, int options)
throws StringPrepParseException{
return convertIDNToUnicode(src.getText(), options);
} | java | @Deprecated
public static StringBuffer convertIDNToUnicode(UCharacterIterator src, int options)
throws StringPrepParseException{
return convertIDNToUnicode(src.getText(), options);
} | [
"@",
"Deprecated",
"public",
"static",
"StringBuffer",
"convertIDNToUnicode",
"(",
"UCharacterIterator",
"src",
",",
"int",
"options",
")",
"throws",
"StringPrepParseException",
"{",
"return",
"convertIDNToUnicode",
"(",
"src",
".",
"getText",
"(",
")",
",",
"option... | IDNA2003: Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC.
This operation is done on complete domain names, e.g: "www.example.com".
<b>Note:</b> IDNA RFC specifies that a conformant application should divide a domain name
into separate labels, decide whether to apply allowUna... | [
"IDNA2003",
":",
"Convenience",
"function",
"that",
"implements",
"the",
"IDNToUnicode",
"operation",
"as",
"defined",
"in",
"the",
"IDNA",
"RFC",
".",
"This",
"operation",
"is",
"done",
"on",
"complete",
"domain",
"names",
"e",
".",
"g",
":",
"www",
".",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java#L780-L784 |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.didMoveTo | public void didMoveTo (int placeId, PlaceConfig config)
{
if (_moveListener != null) {
_moveListener.requestCompleted(config);
_moveListener = null;
}
// keep track of our previous place id
_previousPlaceId = _placeId;
// clear out our last request t... | java | public void didMoveTo (int placeId, PlaceConfig config)
{
if (_moveListener != null) {
_moveListener.requestCompleted(config);
_moveListener = null;
}
// keep track of our previous place id
_previousPlaceId = _placeId;
// clear out our last request t... | [
"public",
"void",
"didMoveTo",
"(",
"int",
"placeId",
",",
"PlaceConfig",
"config",
")",
"{",
"if",
"(",
"_moveListener",
"!=",
"null",
")",
"{",
"_moveListener",
".",
"requestCompleted",
"(",
"config",
")",
";",
"_moveListener",
"=",
"null",
";",
"}",
"//... | This can be called by cooperating directors that need to coopt the moving process to extend
it in some way or other. In such situations, they will be responsible for receiving the
successful move response and they should let the location director know that the move has
been effected.
@param placeId the place oid of ou... | [
"This",
"can",
"be",
"called",
"by",
"cooperating",
"directors",
"that",
"need",
"to",
"coopt",
"the",
"moving",
"process",
"to",
"extend",
"it",
"in",
"some",
"way",
"or",
"other",
".",
"In",
"such",
"situations",
"they",
"will",
"be",
"responsible",
"for... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L282-L317 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java | AttributeDefinition.addCapabilityRequirements | public void addCapabilityRequirements(OperationContext context, Resource resource, ModelNode attributeValue) {
@SuppressWarnings("deprecation")
CapabilityReferenceRecorder refRecorder = getReferenceRecorder();
if (refRecorder != null) {
// We can't process expressions
if ... | java | public void addCapabilityRequirements(OperationContext context, Resource resource, ModelNode attributeValue) {
@SuppressWarnings("deprecation")
CapabilityReferenceRecorder refRecorder = getReferenceRecorder();
if (refRecorder != null) {
// We can't process expressions
if ... | [
"public",
"void",
"addCapabilityRequirements",
"(",
"OperationContext",
"context",
",",
"Resource",
"resource",
",",
"ModelNode",
"attributeValue",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"CapabilityReferenceRecorder",
"refRecorder",
"=",
"getRefer... | Based on the given attribute value, add capability requirements. If this definition
is for an attribute whose value is or contains a reference to the name of some capability,
this method should record the addition of a requirement for the capability.
<p>
This is a no-op in this base class. Subclasses that support attri... | [
"Based",
"on",
"the",
"given",
"attribute",
"value",
"add",
"capability",
"requirements",
".",
"If",
"this",
"definition",
"is",
"for",
"an",
"attribute",
"whose",
"value",
"is",
"or",
"contains",
"a",
"reference",
"to",
"the",
"name",
"of",
"some",
"capabil... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java#L1059-L1069 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPLepetitEPnP.java | PnPLepetitEPnP.process | public void process( List<Point3D_F64> worldPts , List<Point2D_F64> observed , Se3_F64 solutionModel )
{
if( worldPts.size() < 4 )
throw new IllegalArgumentException("Must provide at least 4 points");
if( worldPts.size() != observed.size() )
throw new IllegalArgumentException("Must have the same number of ob... | java | public void process( List<Point3D_F64> worldPts , List<Point2D_F64> observed , Se3_F64 solutionModel )
{
if( worldPts.size() < 4 )
throw new IllegalArgumentException("Must provide at least 4 points");
if( worldPts.size() != observed.size() )
throw new IllegalArgumentException("Must have the same number of ob... | [
"public",
"void",
"process",
"(",
"List",
"<",
"Point3D_F64",
">",
"worldPts",
",",
"List",
"<",
"Point2D_F64",
">",
"observed",
",",
"Se3_F64",
"solutionModel",
")",
"{",
"if",
"(",
"worldPts",
".",
"size",
"(",
")",
"<",
"4",
")",
"throw",
"new",
"Il... | Compute camera motion given a set of features with observations and 3D locations
@param worldPts Known location of features in 3D world coordinates
@param observed Observed location of features in normalized camera coordinates
@param solutionModel Output: Storage for the found solution. | [
"Compute",
"camera",
"motion",
"given",
"a",
"set",
"of",
"features",
"with",
"observations",
"and",
"3D",
"locations"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PnPLepetitEPnP.java#L210-L252 |
mozilla/rhino | src/org/mozilla/javascript/UintMap.java | UintMap.put | public void put(int key, int value) {
if (key < 0) Kit.codeBug();
int index = ensureIndex(key, true);
if (ivaluesShift == 0) {
int N = 1 << power;
// keys.length can be N * 2 after clear which set ivaluesShift to 0
if (keys.length != N * 2) {
i... | java | public void put(int key, int value) {
if (key < 0) Kit.codeBug();
int index = ensureIndex(key, true);
if (ivaluesShift == 0) {
int N = 1 << power;
// keys.length can be N * 2 after clear which set ivaluesShift to 0
if (keys.length != N * 2) {
i... | [
"public",
"void",
"put",
"(",
"int",
"key",
",",
"int",
"value",
")",
"{",
"if",
"(",
"key",
"<",
"0",
")",
"Kit",
".",
"codeBug",
"(",
")",
";",
"int",
"index",
"=",
"ensureIndex",
"(",
"key",
",",
"true",
")",
";",
"if",
"(",
"ivaluesShift",
... | Set int value of the key.
If key does not exist, also set its object value to null. | [
"Set",
"int",
"value",
"of",
"the",
"key",
".",
"If",
"key",
"does",
"not",
"exist",
"also",
"set",
"its",
"object",
"value",
"to",
"null",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/UintMap.java#L126-L140 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/core/request/SofaRequest.java | SofaRequest.addRequestProp | public void addRequestProp(String key, Object value) {
if (key == null || value == null) {
return;
}
if (requestProps == null) {
requestProps = new HashMap<String, Object>(16);
}
requestProps.put(key, value);
} | java | public void addRequestProp(String key, Object value) {
if (key == null || value == null) {
return;
}
if (requestProps == null) {
requestProps = new HashMap<String, Object>(16);
}
requestProps.put(key, value);
} | [
"public",
"void",
"addRequestProp",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
"||",
"value",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"requestProps",
"==",
"null",
")",
"{",
"requestProps",
... | Add request prop.
@param key the key
@param value the value | [
"Add",
"request",
"prop",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/core/request/SofaRequest.java#L65-L73 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java | ConditionalFunctions.posInfIf | public static Expression posInfIf(Expression expression1, Expression expression2) {
return x("POSINFIF(" + expression1.toString() + ", " + expression2.toString() + ")");
} | java | public static Expression posInfIf(Expression expression1, Expression expression2) {
return x("POSINFIF(" + expression1.toString() + ", " + expression2.toString() + ")");
} | [
"public",
"static",
"Expression",
"posInfIf",
"(",
"Expression",
"expression1",
",",
"Expression",
"expression2",
")",
"{",
"return",
"x",
"(",
"\"POSINFIF(\"",
"+",
"expression1",
".",
"toString",
"(",
")",
"+",
"\", \"",
"+",
"expression2",
".",
"toString",
... | Returned expression results in PosInf if expression1 = expression2, otherwise returns expression1.
Returns MISSING or NULL if either input is MISSING or NULL. | [
"Returned",
"expression",
"results",
"in",
"PosInf",
"if",
"expression1",
"=",
"expression2",
"otherwise",
"returns",
"expression1",
".",
"Returns",
"MISSING",
"or",
"NULL",
"if",
"either",
"input",
"is",
"MISSING",
"or",
"NULL",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java#L140-L142 |
sporniket/core | sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java | XmlStringTools.appendCdataSection | public static StringBuffer appendCdataSection(StringBuffer buffer, String cdataContent)
{
StringBuffer _buffer = initStringBufferIfNecessary(buffer);
return doAppendCdataSection(_buffer, cdataContent);
} | java | public static StringBuffer appendCdataSection(StringBuffer buffer, String cdataContent)
{
StringBuffer _buffer = initStringBufferIfNecessary(buffer);
return doAppendCdataSection(_buffer, cdataContent);
} | [
"public",
"static",
"StringBuffer",
"appendCdataSection",
"(",
"StringBuffer",
"buffer",
",",
"String",
"cdataContent",
")",
"{",
"StringBuffer",
"_buffer",
"=",
"initStringBufferIfNecessary",
"(",
"buffer",
")",
";",
"return",
"doAppendCdataSection",
"(",
"_buffer",
... | Add a cdata section to a StringBuffer.
If the buffer is null, a new one is created.
@param buffer
StringBuffer to fill
@param cdataContent
the cdata content
@return the buffer | [
"Add",
"a",
"cdata",
"section",
"to",
"a",
"StringBuffer",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java#L301-L305 |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java | AbstractOptionsForSelect.withOptionalOutgoingPayload | public T withOptionalOutgoingPayload(Optional<Map<String, ByteBuffer>> outgoingPayload) {
getOptions().setOutgoingPayLoad(outgoingPayload);
return getThis();
} | java | public T withOptionalOutgoingPayload(Optional<Map<String, ByteBuffer>> outgoingPayload) {
getOptions().setOutgoingPayLoad(outgoingPayload);
return getThis();
} | [
"public",
"T",
"withOptionalOutgoingPayload",
"(",
"Optional",
"<",
"Map",
"<",
"String",
",",
"ByteBuffer",
">",
">",
"outgoingPayload",
")",
"{",
"getOptions",
"(",
")",
".",
"setOutgoingPayLoad",
"(",
"outgoingPayload",
")",
";",
"return",
"getThis",
"(",
"... | Set the given outgoing payload map on the generated statement IF NOT NULL | [
"Set",
"the",
"given",
"outgoing",
"payload",
"map",
"on",
"the",
"generated",
"statement",
"IF",
"NOT",
"NULL"
] | train | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L111-L114 |
datastax/java-driver | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java | SchemaBuilder.alterMaterializedView | @NonNull
public static AlterMaterializedViewStart alterMaterializedView(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier viewName) {
return new DefaultAlterMaterializedView(keyspace, viewName);
} | java | @NonNull
public static AlterMaterializedViewStart alterMaterializedView(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier viewName) {
return new DefaultAlterMaterializedView(keyspace, viewName);
} | [
"@",
"NonNull",
"public",
"static",
"AlterMaterializedViewStart",
"alterMaterializedView",
"(",
"@",
"Nullable",
"CqlIdentifier",
"keyspace",
",",
"@",
"NonNull",
"CqlIdentifier",
"viewName",
")",
"{",
"return",
"new",
"DefaultAlterMaterializedView",
"(",
"keyspace",
",... | Starts an ALTER MATERIALIZED VIEW query with the given view name for the given keyspace name. | [
"Starts",
"an",
"ALTER",
"MATERIALIZED",
"VIEW",
"query",
"with",
"the",
"given",
"view",
"name",
"for",
"the",
"given",
"keyspace",
"name",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L259-L263 |
Netflix/Nicobar | nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java | GraphUtils.addIncomingEdges | public static <N> void addIncomingEdges(DirectedGraph<N, DefaultEdge> graph, N target, Set<N> sources) {
if (!graph.containsVertex(target)) {
graph.addVertex(target);
}
for (N source : sources) {
if (!graph.containsVertex(source)) {
graph.addVertex(source)... | java | public static <N> void addIncomingEdges(DirectedGraph<N, DefaultEdge> graph, N target, Set<N> sources) {
if (!graph.containsVertex(target)) {
graph.addVertex(target);
}
for (N source : sources) {
if (!graph.containsVertex(source)) {
graph.addVertex(source)... | [
"public",
"static",
"<",
"N",
">",
"void",
"addIncomingEdges",
"(",
"DirectedGraph",
"<",
"N",
",",
"DefaultEdge",
">",
"graph",
",",
"N",
"target",
",",
"Set",
"<",
"N",
">",
"sources",
")",
"{",
"if",
"(",
"!",
"graph",
".",
"containsVertex",
"(",
... | Add dependents on the give target vertex. Whether duplicates are created is dependent
on the underlying {@link DirectedGraph} implementation.
@param graph graph to be mutated
@param target target vertex for the new edges
@param sources source vertices for the new edges | [
"Add",
"dependents",
"on",
"the",
"give",
"target",
"vertex",
".",
"Whether",
"duplicates",
"are",
"created",
"is",
"dependent",
"on",
"the",
"underlying",
"{"
] | train | https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java#L112-L122 |
stapler/stapler | jelly/src/main/java/org/kohsuke/stapler/jelly/ResourceBundle.java | ResourceBundle.getFormatStringWithoutDefaulting | public String getFormatStringWithoutDefaulting(Locale locale, String key) {
for (String s : toStrings(locale)) {
String msg = get(s).getProperty(key);
if(msg!=null && msg.length()>0)
return msg;
}
return null;
} | java | public String getFormatStringWithoutDefaulting(Locale locale, String key) {
for (String s : toStrings(locale)) {
String msg = get(s).getProperty(key);
if(msg!=null && msg.length()>0)
return msg;
}
return null;
} | [
"public",
"String",
"getFormatStringWithoutDefaulting",
"(",
"Locale",
"locale",
",",
"String",
"key",
")",
"{",
"for",
"(",
"String",
"s",
":",
"toStrings",
"(",
"locale",
")",
")",
"{",
"String",
"msg",
"=",
"get",
"(",
"s",
")",
".",
"getProperty",
"(... | Works like {@link #getFormatString(Locale, String)} except there's no
searching up the delegation chain. | [
"Works",
"like",
"{"
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/jelly/src/main/java/org/kohsuke/stapler/jelly/ResourceBundle.java#L107-L114 |
datacleaner/DataCleaner | desktop/api/src/main/java/org/datacleaner/widgets/properties/FormPanel.java | FormPanel.addFormEntry | public void addFormEntry(final JLabel mainLabel, final JLabel minorLabel, final JComponent component) {
add(mainLabel, new GridBagConstraints(0, _rowCounter, 1, 1, 0d, 0d, GridBagConstraints.NORTHWEST,
GridBagConstraints.BOTH, INSETS, 0, 0));
if (minorLabel != null) {
add(mi... | java | public void addFormEntry(final JLabel mainLabel, final JLabel minorLabel, final JComponent component) {
add(mainLabel, new GridBagConstraints(0, _rowCounter, 1, 1, 0d, 0d, GridBagConstraints.NORTHWEST,
GridBagConstraints.BOTH, INSETS, 0, 0));
if (minorLabel != null) {
add(mi... | [
"public",
"void",
"addFormEntry",
"(",
"final",
"JLabel",
"mainLabel",
",",
"final",
"JLabel",
"minorLabel",
",",
"final",
"JComponent",
"component",
")",
"{",
"add",
"(",
"mainLabel",
",",
"new",
"GridBagConstraints",
"(",
"0",
",",
"_rowCounter",
",",
"1",
... | Adds a form entry to the panel
@param mainLabel
@param minorLabel
@param component | [
"Adds",
"a",
"form",
"entry",
"to",
"the",
"panel"
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/api/src/main/java/org/datacleaner/widgets/properties/FormPanel.java#L100-L114 |
jsurfer/JsonSurfer | jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java | JsonSurfer.collectAll | public Collection<Object> collectAll(String json, String... paths) {
return collectAll(json, compile(paths));
} | java | public Collection<Object> collectAll(String json, String... paths) {
return collectAll(json, compile(paths));
} | [
"public",
"Collection",
"<",
"Object",
">",
"collectAll",
"(",
"String",
"json",
",",
"String",
"...",
"paths",
")",
"{",
"return",
"collectAll",
"(",
"json",
",",
"compile",
"(",
"paths",
")",
")",
";",
"}"
] | Collect all matched value into a collection
@param json Json string
@param paths JsonPath
@return collection | [
"Collect",
"all",
"matched",
"value",
"into",
"a",
"collection"
] | train | https://github.com/jsurfer/JsonSurfer/blob/52bd75a453338b86e115092803da140bf99cee62/jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java#L261-L263 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java | SightResourcesImpl.setPublishStatus | public SightPublish setPublishStatus(long sightId, SightPublish sightPublish) throws SmartsheetException {
Util.throwIfNull(sightPublish);
return this.updateResource("sights/" + sightId + "/publish", SightPublish.class, sightPublish);
} | java | public SightPublish setPublishStatus(long sightId, SightPublish sightPublish) throws SmartsheetException {
Util.throwIfNull(sightPublish);
return this.updateResource("sights/" + sightId + "/publish", SightPublish.class, sightPublish);
} | [
"public",
"SightPublish",
"setPublishStatus",
"(",
"long",
"sightId",
",",
"SightPublish",
"sightPublish",
")",
"throws",
"SmartsheetException",
"{",
"Util",
".",
"throwIfNull",
"(",
"sightPublish",
")",
";",
"return",
"this",
".",
"updateResource",
"(",
"\"sights/\... | Sets the publish status of a Sight and returns the new status, including the URLs of any enabled publishing.
It mirrors to the following Smartsheet REST API method: POST /sights/{sightId}/publish
@param sightId the Id of the Sight
@param sightPublish the SightPublish object containing publish status
@return the Sight... | [
"Sets",
"the",
"publish",
"status",
"of",
"a",
"Sight",
"and",
"returns",
"the",
"new",
"status",
"including",
"the",
"URLs",
"of",
"any",
"enabled",
"publishing",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SightResourcesImpl.java#L240-L243 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/DateChangedHandler.java | DateChangedHandler.doRecordChange | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
{ // Write/Update a record
switch (iChangeType)
{
case DBConstants.FIELD_CHANGED_TYPE:
if (!onFieldChange)
break;
case DBConstants.REFRESH_TYPE:
... | java | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
{ // Write/Update a record
switch (iChangeType)
{
case DBConstants.FIELD_CHANGED_TYPE:
if (!onFieldChange)
break;
case DBConstants.REFRESH_TYPE:
... | [
"public",
"int",
"doRecordChange",
"(",
"FieldInfo",
"field",
",",
"int",
"iChangeType",
",",
"boolean",
"bDisplayOption",
")",
"{",
"// Write/Update a record",
"switch",
"(",
"iChangeType",
")",
"{",
"case",
"DBConstants",
".",
"FIELD_CHANGED_TYPE",
":",
"if",
"(... | Called when a change is the record status is about to happen/has happened.
This method sets the field to the current time on an add or update.
@param field If this file change is due to a field, this is the field.
@param iChangeType The type of change that occurred.
@param bDisplayOption If true, display any changes.
@... | [
"Called",
"when",
"a",
"change",
"is",
"the",
"record",
"status",
"is",
"about",
"to",
"happen",
"/",
"has",
"happened",
".",
"This",
"method",
"sets",
"the",
"field",
"to",
"the",
"current",
"time",
"on",
"an",
"add",
"or",
"update",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/DateChangedHandler.java#L97-L117 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java | ArrayUtils.boundsCheck | public static void boundsCheck(int capacity, int index, int length) {
if (capacity < 0 || index < 0 || length < 0 || (index > (capacity - length))) {
throw new IndexOutOfBoundsException(String.format("index=%d, length=%d, capacity=%d", index, length, capacity));
}
} | java | public static void boundsCheck(int capacity, int index, int length) {
if (capacity < 0 || index < 0 || length < 0 || (index > (capacity - length))) {
throw new IndexOutOfBoundsException(String.format("index=%d, length=%d, capacity=%d", index, length, capacity));
}
} | [
"public",
"static",
"void",
"boundsCheck",
"(",
"int",
"capacity",
",",
"int",
"index",
",",
"int",
"length",
")",
"{",
"if",
"(",
"capacity",
"<",
"0",
"||",
"index",
"<",
"0",
"||",
"length",
"<",
"0",
"||",
"(",
"index",
">",
"(",
"capacity",
"-... | Bounds check when copying to/from a buffer
@param capacity capacity of the buffer
@param index index of copying will start from/to
@param length length of the buffer that will be read/writen | [
"Bounds",
"check",
"when",
"copying",
"to",
"/",
"from",
"a",
"buffer"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java#L184-L188 |
ontop/ontop | client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/action/WrappedAction.java | WrappedAction.getKeyForActionMap | private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke) {
for (int i = 0; i < 3; i++) {
InputMap inputMap = component.getInputMap(i);
if (inputMap != null) {
Object key = inputMap.get(keyStroke);
if (key != null) {
return key;
}
}
}
return null;
} | java | private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke) {
for (int i = 0; i < 3; i++) {
InputMap inputMap = component.getInputMap(i);
if (inputMap != null) {
Object key = inputMap.get(keyStroke);
if (key != null) {
return key;
}
}
}
return null;
} | [
"private",
"Object",
"getKeyForActionMap",
"(",
"JComponent",
"component",
",",
"KeyStroke",
"keyStroke",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"InputMap",
"inputMap",
"=",
"component",
".",
"getInputMa... | /*
Search the 3 InputMaps to find the KeyStroke binding.
1. WHEN_IN_FOCUSED_WINDOW,
2. WHEN_FOCUSED,
3. WHEN_ANCESTOR_OF_FOCUSED_COMPONENT | [
"/",
"*",
"Search",
"the",
"3",
"InputMaps",
"to",
"find",
"the",
"KeyStroke",
"binding",
".",
"1",
".",
"WHEN_IN_FOCUSED_WINDOW",
"2",
".",
"WHEN_FOCUSED",
"3",
".",
"WHEN_ANCESTOR_OF_FOCUSED_COMPONENT"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/action/WrappedAction.java#L74-L85 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/util/Util.java | Util.copyData | public static int copyData(InputStream in, OutputStream out, int limit, int bufSize) throws IOException {
if (bufSize < 1) {
throw new IllegalArgumentException("Invalid buffer size: " + bufSize);
}
byte[] buf = new byte[bufSize];
int total = 0;
while (limit < 0 || t... | java | public static int copyData(InputStream in, OutputStream out, int limit, int bufSize) throws IOException {
if (bufSize < 1) {
throw new IllegalArgumentException("Invalid buffer size: " + bufSize);
}
byte[] buf = new byte[bufSize];
int total = 0;
while (limit < 0 || t... | [
"public",
"static",
"int",
"copyData",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
",",
"int",
"limit",
",",
"int",
"bufSize",
")",
"throws",
"IOException",
"{",
"if",
"(",
"bufSize",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Copies up to {@code limit} bytes of data from {@code in} to {@code out}.
<p>
May copy less than {@code limit} bytes if {@code in} does not have that much data available.
</p> <p>
Allocates a temporary memory buffer of {@code bufSize} bytes for this.
</p>
@param in
input stream to copy data from.
@param out
output stre... | [
"Copies",
"up",
"to",
"{",
"@code",
"limit",
"}",
"bytes",
"of",
"data",
"from",
"{",
"@code",
"in",
"}",
"to",
"{",
"@code",
"out",
"}",
".",
"<p",
">",
"May",
"copy",
"less",
"than",
"{",
"@code",
"limit",
"}",
"bytes",
"if",
"{",
"@code",
"in"... | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/util/Util.java#L599-L617 |
umano/AndroidSlidingUpPanel | library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java | ViewDragHelper.dispatchViewReleased | private void dispatchViewReleased(float xvel, float yvel) {
mReleaseInProgress = true;
mCallback.onViewReleased(mCapturedView, xvel, yvel);
mReleaseInProgress = false;
if (mDragState == STATE_DRAGGING) {
// onViewReleased didn't call a method that would have changed this. Go... | java | private void dispatchViewReleased(float xvel, float yvel) {
mReleaseInProgress = true;
mCallback.onViewReleased(mCapturedView, xvel, yvel);
mReleaseInProgress = false;
if (mDragState == STATE_DRAGGING) {
// onViewReleased didn't call a method that would have changed this. Go... | [
"private",
"void",
"dispatchViewReleased",
"(",
"float",
"xvel",
",",
"float",
"yvel",
")",
"{",
"mReleaseInProgress",
"=",
"true",
";",
"mCallback",
".",
"onViewReleased",
"(",
"mCapturedView",
",",
"xvel",
",",
"yvel",
")",
";",
"mReleaseInProgress",
"=",
"f... | Like all callback events this must happen on the UI thread, but release
involves some extra semantics. During a release (mReleaseInProgress)
is the only time it is valid to call {@link #settleCapturedViewAt(int, int)}
or {@link #flingCapturedView(int, int, int, int)}. | [
"Like",
"all",
"callback",
"events",
"this",
"must",
"happen",
"on",
"the",
"UI",
"thread",
"but",
"release",
"involves",
"some",
"extra",
"semantics",
".",
"During",
"a",
"release",
"(",
"mReleaseInProgress",
")",
"is",
"the",
"only",
"time",
"it",
"is",
... | train | https://github.com/umano/AndroidSlidingUpPanel/blob/45a460435b07e764138a700328836cafc1ed5c42/library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java#L799-L808 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/alias/AliasType.java | AliasType.transformKey | private String transformKey(String key, String src, String tgt) {
StringBuilder sb = new StringBuilder();
String[] srcTokens = src.split(WILDCARD_DELIM_REGEX);
String[] tgtTokens = tgt.split(WILDCARD_DELIM_REGEX);
int len = Math.max(srcTokens.length, tgtTokens.length);
int pos = ... | java | private String transformKey(String key, String src, String tgt) {
StringBuilder sb = new StringBuilder();
String[] srcTokens = src.split(WILDCARD_DELIM_REGEX);
String[] tgtTokens = tgt.split(WILDCARD_DELIM_REGEX);
int len = Math.max(srcTokens.length, tgtTokens.length);
int pos = ... | [
"private",
"String",
"transformKey",
"(",
"String",
"key",
",",
"String",
"src",
",",
"String",
"tgt",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"[",
"]",
"srcTokens",
"=",
"src",
".",
"split",
"(",
"WILDCARD_... | Uses the source and target wildcard masks to transform an input key.
@param key The input key.
@param src The source wildcard mask.
@param tgt The target wildcard mask.
@return The transformed key. | [
"Uses",
"the",
"source",
"and",
"target",
"wildcard",
"masks",
"to",
"transform",
"an",
"input",
"key",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/alias/AliasType.java#L117-L146 |
igniterealtime/Smack | smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java | AgentSession.setStatus | public void setStatus(Presence.Mode presenceMode, int maxChats, String status)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
if (!online) {
throw new IllegalStateException("Cannot set status when the agent is not online.");
... | java | public void setStatus(Presence.Mode presenceMode, int maxChats, String status)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
if (!online) {
throw new IllegalStateException("Cannot set status when the agent is not online.");
... | [
"public",
"void",
"setStatus",
"(",
"Presence",
".",
"Mode",
"presenceMode",
",",
"int",
"maxChats",
",",
"String",
"status",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"if",
"(",
... | Sets the agent's current status with the workgroup. The presence mode affects how offers
are routed to the agent. The possible presence modes with their meanings are as follows:<ul>
<li>Presence.Mode.AVAILABLE -- (Default) the agent is available for more chats
(equivalent to Presence.Mode.CHAT).
<li>Presence.Mode.DO_N... | [
"Sets",
"the",
"agent",
"s",
"current",
"status",
"with",
"the",
"workgroup",
".",
"The",
"presence",
"mode",
"affects",
"how",
"offers",
"are",
"routed",
"to",
"the",
"agent",
".",
"The",
"possible",
"presence",
"modes",
"with",
"their",
"meanings",
"are",
... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java#L418-L450 |
haifengl/smile | math/src/main/java/smile/math/Math.java | Math.KullbackLeiblerDivergence | public static double KullbackLeiblerDivergence(SparseArray x, double[] y) {
if (x.isEmpty()) {
throw new IllegalArgumentException("List x is empty.");
}
Iterator<SparseArray.Entry> iter = x.iterator();
boolean intersection = false;
double kl = 0.0;
while (it... | java | public static double KullbackLeiblerDivergence(SparseArray x, double[] y) {
if (x.isEmpty()) {
throw new IllegalArgumentException("List x is empty.");
}
Iterator<SparseArray.Entry> iter = x.iterator();
boolean intersection = false;
double kl = 0.0;
while (it... | [
"public",
"static",
"double",
"KullbackLeiblerDivergence",
"(",
"SparseArray",
"x",
",",
"double",
"[",
"]",
"y",
")",
"{",
"if",
"(",
"x",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"List x is empty.\"",
")",
";",... | Kullback-Leibler divergence. The Kullback-Leibler divergence (also
information divergence, information gain, relative entropy, or KLIC)
is a non-symmetric measure of the difference between two probability
distributions P and Q. KL measures the expected number of extra bits
required to code samples from P when using a c... | [
"Kullback",
"-",
"Leibler",
"divergence",
".",
"The",
"Kullback",
"-",
"Leibler",
"divergence",
"(",
"also",
"information",
"divergence",
"information",
"gain",
"relative",
"entropy",
"or",
"KLIC",
")",
"is",
"a",
"non",
"-",
"symmetric",
"measure",
"of",
"the... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/Math.java#L2361-L2384 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java | CPRulePersistenceImpl.findByGroupId | @Override
public List<CPRule> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPRule> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPRule",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp rules where groupId = ?.
@param groupId the group ID
@return the matching cp rules | [
"Returns",
"all",
"the",
"cp",
"rules",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java#L122-L125 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java | HtmlWriter.getResource | public Content getResource(String key, Object o0, Object o1) {
return configuration.getResource(key, o0, o1);
} | java | public Content getResource(String key, Object o0, Object o1) {
return configuration.getResource(key, o0, o1);
} | [
"public",
"Content",
"getResource",
"(",
"String",
"key",
",",
"Object",
"o0",
",",
"Object",
"o1",
")",
"{",
"return",
"configuration",
".",
"getResource",
"(",
"key",
",",
"o0",
",",
"o1",
")",
";",
"}"
] | Get the configuration string as a content.
@param key the key to look for in the configuration file
@param o1 string or content argument added to configuration text
@param o2 string or content argument added to configuration text
@return a content tree for the text | [
"Get",
"the",
"configuration",
"string",
"as",
"a",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java#L277-L279 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.orthoLH | public Matrix4f orthoLH(float left, float right, float bottom, float top, float zNear, float zFar, boolean zZeroToOne, Matrix4f dest) {
if ((properties & PROPERTY_IDENTITY) != 0)
return dest.setOrthoLH(left, right, bottom, top, zNear, zFar, zZeroToOne);
return orthoLHGeneric(left, right, bot... | java | public Matrix4f orthoLH(float left, float right, float bottom, float top, float zNear, float zFar, boolean zZeroToOne, Matrix4f dest) {
if ((properties & PROPERTY_IDENTITY) != 0)
return dest.setOrthoLH(left, right, bottom, top, zNear, zFar, zZeroToOne);
return orthoLHGeneric(left, right, bot... | [
"public",
"Matrix4f",
"orthoLH",
"(",
"float",
"left",
",",
"float",
"right",
",",
"float",
"bottom",
",",
"float",
"top",
",",
"float",
"zNear",
",",
"float",
"zFar",
",",
"boolean",
"zZeroToOne",
",",
"Matrix4f",
"dest",
")",
"{",
"if",
"(",
"(",
"pr... | Apply an orthographic projection transformation for a left-handed coordiante system
using the given NDC z range to this matrix and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>O</code> the orthographic projection matrix,
then the new matrix will be <code>M * O</code... | [
"Apply",
"an",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordiante",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
"to",
"this",
"matrix",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"dest<",
"/",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L7016-L7020 |
wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java | AbstractCommandBuilder.normalizePath | protected Path normalizePath(final Path parent, final String path) {
return parent.resolve(path).toAbsolutePath().normalize();
} | java | protected Path normalizePath(final Path parent, final String path) {
return parent.resolve(path).toAbsolutePath().normalize();
} | [
"protected",
"Path",
"normalizePath",
"(",
"final",
"Path",
"parent",
",",
"final",
"String",
"path",
")",
"{",
"return",
"parent",
".",
"resolve",
"(",
"path",
")",
".",
"toAbsolutePath",
"(",
")",
".",
"normalize",
"(",
")",
";",
"}"
] | Resolves the path relative to the parent and normalizes it.
@param parent the parent path
@param path the path
@return the normalized path | [
"Resolves",
"the",
"path",
"relative",
"to",
"the",
"parent",
"and",
"normalizes",
"it",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java#L564-L566 |
casmi/casmi | src/main/java/casmi/util/FileUtil.java | FileUtil.searchFilePath | public static String searchFilePath(String fileName) {
java.io.File dir = new java.io.File(System.getProperty("user.dir"));
return recursiveSearch(dir, fileName);
} | java | public static String searchFilePath(String fileName) {
java.io.File dir = new java.io.File(System.getProperty("user.dir"));
return recursiveSearch(dir, fileName);
} | [
"public",
"static",
"String",
"searchFilePath",
"(",
"String",
"fileName",
")",
"{",
"java",
".",
"io",
".",
"File",
"dir",
"=",
"new",
"java",
".",
"io",
".",
"File",
"(",
"System",
".",
"getProperty",
"(",
"\"user.dir\"",
")",
")",
";",
"return",
"re... | Search an absolute file path from current working directory recursively.
@param fileName file name to search.
@return an absolute file path. | [
"Search",
"an",
"absolute",
"file",
"path",
"from",
"current",
"working",
"directory",
"recursively",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/util/FileUtil.java#L189-L192 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java | SpiderTransaction.addShardStart | public void addShardStart(TableDefinition tableDef, int shardNumber, Date startDate) {
assert tableDef.isSharded() && shardNumber > 0;
addColumn(SpiderService.termsStoreName(tableDef),
SHARDS_ROW_KEY,
Integer.toString(shardNumber),
Utils.toBytes... | java | public void addShardStart(TableDefinition tableDef, int shardNumber, Date startDate) {
assert tableDef.isSharded() && shardNumber > 0;
addColumn(SpiderService.termsStoreName(tableDef),
SHARDS_ROW_KEY,
Integer.toString(shardNumber),
Utils.toBytes... | [
"public",
"void",
"addShardStart",
"(",
"TableDefinition",
"tableDef",
",",
"int",
"shardNumber",
",",
"Date",
"startDate",
")",
"{",
"assert",
"tableDef",
".",
"isSharded",
"(",
")",
"&&",
"shardNumber",
">",
"0",
";",
"addColumn",
"(",
"SpiderService",
".",
... | Add a column to the "_shards" row for the given shard number and date, indicating
that this shard is being used. The "_shards" row lives in the table's Terms store
and uses the format:
<pre>
_shards = {{shard 1}:{date 1}, {shard 1}:{date 2}, ...}
</pre>
Dates are stored as {@link Date#getTime()} values, converted to st... | [
"Add",
"a",
"column",
"to",
"the",
"_shards",
"row",
"for",
"the",
"given",
"shard",
"number",
"and",
"date",
"indicating",
"that",
"this",
"shard",
"is",
"being",
"used",
".",
"The",
"_shards",
"row",
"lives",
"in",
"the",
"table",
"s",
"Terms",
"store"... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java#L307-L313 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcResultSet.java | WSJdbcResultSet.updateClob | public void updateClob(String columnName, java.sql.Clob c) throws SQLException {
try {
rsetImpl.updateClob(columnName, c);
} catch (SQLException ex) {
FFDCFilter.processException(ex, "com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.updateClob", "4123", this);
throw WSJdbcU... | java | public void updateClob(String columnName, java.sql.Clob c) throws SQLException {
try {
rsetImpl.updateClob(columnName, c);
} catch (SQLException ex) {
FFDCFilter.processException(ex, "com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.updateClob", "4123", this);
throw WSJdbcU... | [
"public",
"void",
"updateClob",
"(",
"String",
"columnName",
",",
"java",
".",
"sql",
".",
"Clob",
"c",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"rsetImpl",
".",
"updateClob",
"(",
"columnName",
",",
"c",
")",
";",
"}",
"catch",
"(",
"SQLException... | <p>Updates the designated column with a java.sql.Clob value. The updater methods
are used to update column values in the current row or the insert row. The updater
methods do not update the underlying database; instead the updateRow or insertRow
methods are called to update the database.
@param columnName the name of ... | [
"<p",
">",
"Updates",
"the",
"designated",
"column",
"with",
"a",
"java",
".",
"sql",
".",
"Clob",
"value",
".",
"The",
"updater",
"methods",
"are",
"used",
"to",
"update",
"column",
"values",
"in",
"the",
"current",
"row",
"or",
"the",
"insert",
"row",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcResultSet.java#L4686-L4696 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventSubscriptions.java | EventSubscriptions.invokeCallbacks | public void invokeCallbacks(String eventName, T eventData) {
String name = eventName;
while (!StringUtils.isEmpty(name)) {
Iterable<IGenericEvent<T>> subscribers = getSubscribers(name);
if (subscribers != null) {
for (IGenericEvent<T> subscri... | java | public void invokeCallbacks(String eventName, T eventData) {
String name = eventName;
while (!StringUtils.isEmpty(name)) {
Iterable<IGenericEvent<T>> subscribers = getSubscribers(name);
if (subscribers != null) {
for (IGenericEvent<T> subscri... | [
"public",
"void",
"invokeCallbacks",
"(",
"String",
"eventName",
",",
"T",
"eventData",
")",
"{",
"String",
"name",
"=",
"eventName",
";",
"while",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"name",
")",
")",
"{",
"Iterable",
"<",
"IGenericEvent",
"<",
... | Invokes callbacks on all subscribers of this and parent events.
@param eventName Name of the event.
@param eventData The associated event data. | [
"Invokes",
"callbacks",
"on",
"all",
"subscribers",
"of",
"this",
"and",
"parent",
"events",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/event/EventSubscriptions.java#L150-L171 |
palaima/DebugDrawer | debugdrawer/src/main/java/io/palaima/debugdrawer/util/UIUtils.java | UIUtils.getThemeAttributeDimensionSize | public static int getThemeAttributeDimensionSize(Context context, int attr) {
TypedArray a = null;
try {
a = context.getTheme().obtainStyledAttributes(new int[]{attr});
return a.getDimensionPixelSize(0, 0);
} finally {
if (a != null) {
a.recycl... | java | public static int getThemeAttributeDimensionSize(Context context, int attr) {
TypedArray a = null;
try {
a = context.getTheme().obtainStyledAttributes(new int[]{attr});
return a.getDimensionPixelSize(0, 0);
} finally {
if (a != null) {
a.recycl... | [
"public",
"static",
"int",
"getThemeAttributeDimensionSize",
"(",
"Context",
"context",
",",
"int",
"attr",
")",
"{",
"TypedArray",
"a",
"=",
"null",
";",
"try",
"{",
"a",
"=",
"context",
".",
"getTheme",
"(",
")",
".",
"obtainStyledAttributes",
"(",
"new",
... | Returns the size in pixels of an attribute dimension
@param context the context to get the resources from
@param attr is the attribute dimension we want to know the size from
@return the size in pixels of an attribute dimension | [
"Returns",
"the",
"size",
"in",
"pixels",
"of",
"an",
"attribute",
"dimension"
] | train | https://github.com/palaima/DebugDrawer/blob/49b5992a1148757bd740c4a0b7df10ef70ade6d8/debugdrawer/src/main/java/io/palaima/debugdrawer/util/UIUtils.java#L123-L133 |
axibase/atsd-api-java | src/main/java/com/axibase/tsd/client/AtsdPropertyExtractor.java | AtsdPropertyExtractor.getAsInt | public int getAsInt(final String name, final int defaultValue) {
return AtsdUtil.getPropertyIntValue(fullName(name), clientProperties, defaultValue);
} | java | public int getAsInt(final String name, final int defaultValue) {
return AtsdUtil.getPropertyIntValue(fullName(name), clientProperties, defaultValue);
} | [
"public",
"int",
"getAsInt",
"(",
"final",
"String",
"name",
",",
"final",
"int",
"defaultValue",
")",
"{",
"return",
"AtsdUtil",
".",
"getPropertyIntValue",
"(",
"fullName",
"(",
"name",
")",
",",
"clientProperties",
",",
"defaultValue",
")",
";",
"}"
] | Get property by name as int value
@param name name of property without the prefix.
@param defaultValue default value for case when the property is not set.
@return property's value. | [
"Get",
"property",
"by",
"name",
"as",
"int",
"value"
] | train | https://github.com/axibase/atsd-api-java/blob/63a0767d08b202dad2ebef4372ff947d6fba0246/src/main/java/com/axibase/tsd/client/AtsdPropertyExtractor.java#L34-L36 |
micronaut-projects/micronaut-core | http-server-netty/src/main/java/io/micronaut/http/server/netty/websocket/NettyServerWebSocketUpgradeHandler.java | NettyServerWebSocketUpgradeHandler.getWebSocketURL | protected String getWebSocketURL(ChannelHandlerContext ctx, HttpRequest req) {
boolean isSecure = ctx.pipeline().get(SslHandler.class) != null;
return (isSecure ? SCHEME_SECURE_WEBSOCKET : SCHEME_WEBSOCKET) + req.getHeaders().get(HttpHeaderNames.HOST) + req.getUri() ;
} | java | protected String getWebSocketURL(ChannelHandlerContext ctx, HttpRequest req) {
boolean isSecure = ctx.pipeline().get(SslHandler.class) != null;
return (isSecure ? SCHEME_SECURE_WEBSOCKET : SCHEME_WEBSOCKET) + req.getHeaders().get(HttpHeaderNames.HOST) + req.getUri() ;
} | [
"protected",
"String",
"getWebSocketURL",
"(",
"ChannelHandlerContext",
"ctx",
",",
"HttpRequest",
"req",
")",
"{",
"boolean",
"isSecure",
"=",
"ctx",
".",
"pipeline",
"(",
")",
".",
"get",
"(",
"SslHandler",
".",
"class",
")",
"!=",
"null",
";",
"return",
... | Obtains the web socket URL.
@param ctx The context
@param req The request
@return The socket URL | [
"Obtains",
"the",
"web",
"socket",
"URL",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/websocket/NettyServerWebSocketUpgradeHandler.java#L266-L269 |
Jasig/uPortal | uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java | FileSystemGroupStore.find | @Override
public IEntityGroup find(String key) throws GroupsException {
if (log.isDebugEnabled()) {
log.debug(DEBUG_CLASS_NAME + ".find(): group key: " + key);
}
String path = getFilePathFromKey(key);
File f = new File(path);
GroupHolder groupHolder = cacheGet(k... | java | @Override
public IEntityGroup find(String key) throws GroupsException {
if (log.isDebugEnabled()) {
log.debug(DEBUG_CLASS_NAME + ".find(): group key: " + key);
}
String path = getFilePathFromKey(key);
File f = new File(path);
GroupHolder groupHolder = cacheGet(k... | [
"@",
"Override",
"public",
"IEntityGroup",
"find",
"(",
"String",
"key",
")",
"throws",
"GroupsException",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"DEBUG_CLASS_NAME",
"+",
"\".find(): group key: \"",
"+",
"... | Returns an instance of the <code>IEntityGroup</code> from the data store.
@return org.apereo.portal.groups.IEntityGroup
@param key java.lang.String | [
"Returns",
"an",
"instance",
"of",
"the",
"<code",
">",
"IEntityGroup<",
"/",
"code",
">",
"from",
"the",
"data",
"store",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-filesystem/src/main/java/org/apereo/portal/groups/filesystem/FileSystemGroupStore.java#L240-L271 |
jriecken/gae-java-mini-profiler | src/main/java/ca/jimr/gae/profiler/resources/MiniProfilerResourceLoader.java | MiniProfilerResourceLoader.getResource | public String getResource(String resource, Map<String, String> replacements)
{
String result = cache.get(resource);
if (result == null)
{
try
{
InputStream is = MiniProfilerResourceLoader.class.getResourceAsStream(resource);
try
{
result = new Scanner(is).useD... | java | public String getResource(String resource, Map<String, String> replacements)
{
String result = cache.get(resource);
if (result == null)
{
try
{
InputStream is = MiniProfilerResourceLoader.class.getResourceAsStream(resource);
try
{
result = new Scanner(is).useD... | [
"public",
"String",
"getResource",
"(",
"String",
"resource",
",",
"Map",
"<",
"String",
",",
"String",
">",
"replacements",
")",
"{",
"String",
"result",
"=",
"cache",
".",
"get",
"(",
"resource",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",... | Get the specified resource (if it exists) and perform the specified string
replacements on it.
@param resource
The name of the resource to load.
@param replacements
The map of string replacements to do.
@return The text of the resource, or {@code null} if it could not be
loaded. | [
"Get",
"the",
"specified",
"resource",
"(",
"if",
"it",
"exists",
")",
"and",
"perform",
"the",
"specified",
"string",
"replacements",
"on",
"it",
"."
] | train | https://github.com/jriecken/gae-java-mini-profiler/blob/184e3d2470104e066919960d6fbfe0cdc05921d5/src/main/java/ca/jimr/gae/profiler/resources/MiniProfilerResourceLoader.java#L52-L83 |
jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/NagiosWriter.java | NagiosWriter.valueCheck | protected boolean valueCheck(double value, String simpleRange) {
if (simpleRange.isEmpty()) {
return false;
}
if (simpleRange.endsWith(":")) {
return value < Double.parseDouble(simpleRange.replace(":", ""));
}
if (simpleRange.startsWith("~:")) {
return value > Double.parseDouble(simpleRange.replac... | java | protected boolean valueCheck(double value, String simpleRange) {
if (simpleRange.isEmpty()) {
return false;
}
if (simpleRange.endsWith(":")) {
return value < Double.parseDouble(simpleRange.replace(":", ""));
}
if (simpleRange.startsWith("~:")) {
return value > Double.parseDouble(simpleRange.replac... | [
"protected",
"boolean",
"valueCheck",
"(",
"double",
"value",
",",
"String",
"simpleRange",
")",
"{",
"if",
"(",
"simpleRange",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"simpleRange",
".",
"endsWith",
"(",
"\":\"",
")",... | Check if a value is inside of a range defined in the thresholds.
This check is based on Nagios range definition.
http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT | [
"Check",
"if",
"a",
"value",
"is",
"inside",
"of",
"a",
"range",
"defined",
"in",
"the",
"thresholds",
".",
"This",
"check",
"is",
"based",
"on",
"Nagios",
"range",
"definition",
".",
"http",
":",
"//",
"nagiosplug",
".",
"sourceforge",
".",
"net",
"/",
... | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/NagiosWriter.java#L275-L301 |
JodaOrg/joda-time | src/main/java/org/joda/time/convert/ReadablePeriodConverter.java | ReadablePeriodConverter.setInto | public void setInto(ReadWritablePeriod duration, Object object, Chronology chrono) {
duration.setPeriod((ReadablePeriod) object);
} | java | public void setInto(ReadWritablePeriod duration, Object object, Chronology chrono) {
duration.setPeriod((ReadablePeriod) object);
} | [
"public",
"void",
"setInto",
"(",
"ReadWritablePeriod",
"duration",
",",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"duration",
".",
"setPeriod",
"(",
"(",
"ReadablePeriod",
")",
"object",
")",
";",
"}"
] | Extracts duration values from an object of this converter's type, and
sets them into the given ReadWritablePeriod.
@param duration duration to get modified
@param object the object to convert, must not be null
@param chrono the chronology to use
@throws NullPointerException if the duration or object is null
@throws ... | [
"Extracts",
"duration",
"values",
"from",
"an",
"object",
"of",
"this",
"converter",
"s",
"type",
"and",
"sets",
"them",
"into",
"the",
"given",
"ReadWritablePeriod",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ReadablePeriodConverter.java#L57-L59 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/strategy/properties/HystrixPropertiesFactory.java | HystrixPropertiesFactory.getThreadPoolProperties | public static HystrixThreadPoolProperties getThreadPoolProperties(HystrixThreadPoolKey key, HystrixThreadPoolProperties.Setter builder) {
HystrixPropertiesStrategy hystrixPropertiesStrategy = HystrixPlugins.getInstance().getPropertiesStrategy();
String cacheKey = hystrixPropertiesStrategy.getThreadPoolP... | java | public static HystrixThreadPoolProperties getThreadPoolProperties(HystrixThreadPoolKey key, HystrixThreadPoolProperties.Setter builder) {
HystrixPropertiesStrategy hystrixPropertiesStrategy = HystrixPlugins.getInstance().getPropertiesStrategy();
String cacheKey = hystrixPropertiesStrategy.getThreadPoolP... | [
"public",
"static",
"HystrixThreadPoolProperties",
"getThreadPoolProperties",
"(",
"HystrixThreadPoolKey",
"key",
",",
"HystrixThreadPoolProperties",
".",
"Setter",
"builder",
")",
"{",
"HystrixPropertiesStrategy",
"hystrixPropertiesStrategy",
"=",
"HystrixPlugins",
".",
"getIn... | Get an instance of {@link HystrixThreadPoolProperties} with the given factory {@link HystrixPropertiesStrategy} implementation for each {@link HystrixThreadPool} instance.
@param key
Pass-thru to {@link HystrixPropertiesStrategy#getThreadPoolProperties} implementation.
@param builder
Pass-thru to {@link HystrixPropert... | [
"Get",
"an",
"instance",
"of",
"{",
"@link",
"HystrixThreadPoolProperties",
"}",
"with",
"the",
"given",
"factory",
"{",
"@link",
"HystrixPropertiesStrategy",
"}",
"implementation",
"for",
"each",
"{",
"@link",
"HystrixThreadPool",
"}",
"instance",
"."
] | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/properties/HystrixPropertiesFactory.java#L100-L125 |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/traverson/Traverson.java | Traverson.startWith | public Traverson startWith(final String uriTemplate, final Map<String, Object> vars) {
return startWith(fromTemplate(uriTemplate).expand(vars));
} | java | public Traverson startWith(final String uriTemplate, final Map<String, Object> vars) {
return startWith(fromTemplate(uriTemplate).expand(vars));
} | [
"public",
"Traverson",
"startWith",
"(",
"final",
"String",
"uriTemplate",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"vars",
")",
"{",
"return",
"startWith",
"(",
"fromTemplate",
"(",
"uriTemplate",
")",
".",
"expand",
"(",
"vars",
")",
")",
... | Start traversal at the application/hal+json resource idenfied by {@code uri}.
@param uriTemplate the {@code URI} of the initial HAL resource.
@param vars uri-template variables used to build links.
@return Traverson initialized with the {@link HalRepresentation} identified by {@code uri}. | [
"Start",
"traversal",
"at",
"the",
"application",
"/",
"hal",
"+",
"json",
"resource",
"idenfied",
"by",
"{",
"@code",
"uri",
"}",
"."
] | train | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/traverson/Traverson.java#L272-L274 |
apache/groovy | subprojects/groovy-dateutil/src/main/java/org/apache/groovy/dateutil/extensions/DateUtilExtensions.java | DateUtilExtensions.minus | public static java.sql.Date minus(java.sql.Date self, int days) {
return new java.sql.Date(minus((Date) self, days).getTime());
} | java | public static java.sql.Date minus(java.sql.Date self, int days) {
return new java.sql.Date(minus((Date) self, days).getTime());
} | [
"public",
"static",
"java",
".",
"sql",
".",
"Date",
"minus",
"(",
"java",
".",
"sql",
".",
"Date",
"self",
",",
"int",
"days",
")",
"{",
"return",
"new",
"java",
".",
"sql",
".",
"Date",
"(",
"minus",
"(",
"(",
"Date",
")",
"self",
",",
"days",
... | Subtract a number of days from this date and returns the new date.
@param self a java.sql.Date
@param days the number of days to subtract
@return the new date
@since 1.0 | [
"Subtract",
"a",
"number",
"of",
"days",
"from",
"this",
"date",
"and",
"returns",
"the",
"new",
"date",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-dateutil/src/main/java/org/apache/groovy/dateutil/extensions/DateUtilExtensions.java#L432-L434 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.addTemplate | public void addTemplate(PdfTemplate template, float a, float b, float c, float d, float e, float f) {
checkWriter();
checkNoPattern(template);
PdfName name = writer.addDirectTemplateSimple(template, null);
PageResources prs = getPageResources();
name = prs.addXObject(name, templa... | java | public void addTemplate(PdfTemplate template, float a, float b, float c, float d, float e, float f) {
checkWriter();
checkNoPattern(template);
PdfName name = writer.addDirectTemplateSimple(template, null);
PageResources prs = getPageResources();
name = prs.addXObject(name, templa... | [
"public",
"void",
"addTemplate",
"(",
"PdfTemplate",
"template",
",",
"float",
"a",
",",
"float",
"b",
",",
"float",
"c",
",",
"float",
"d",
",",
"float",
"e",
",",
"float",
"f",
")",
"{",
"checkWriter",
"(",
")",
";",
"checkNoPattern",
"(",
"template"... | Adds a template to this content.
@param template the template
@param a an element of the transformation matrix
@param b an element of the transformation matrix
@param c an element of the transformation matrix
@param d an element of the transformation matrix
@param e an element of the transformation matrix
@param f an ... | [
"Adds",
"a",
"template",
"to",
"this",
"content",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L2049-L2063 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java | TrainsImpl.trainVersionAsync | public Observable<EnqueueTrainingResponse> trainVersionAsync(UUID appId, String versionId) {
return trainVersionWithServiceResponseAsync(appId, versionId).map(new Func1<ServiceResponse<EnqueueTrainingResponse>, EnqueueTrainingResponse>() {
@Override
public EnqueueTrainingResponse call(Se... | java | public Observable<EnqueueTrainingResponse> trainVersionAsync(UUID appId, String versionId) {
return trainVersionWithServiceResponseAsync(appId, versionId).map(new Func1<ServiceResponse<EnqueueTrainingResponse>, EnqueueTrainingResponse>() {
@Override
public EnqueueTrainingResponse call(Se... | [
"public",
"Observable",
"<",
"EnqueueTrainingResponse",
">",
"trainVersionAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
")",
"{",
"return",
"trainVersionWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
")",
".",
"map",
"(",
"new",
"Func1",
"<... | Sends a training request for a version of a specified LUIS app. This POST request initiates a request asynchronously. To determine whether the training request is successful, submit a GET request to get training status. Note: The application version is not fully trained unless all the models (intents and entities) are ... | [
"Sends",
"a",
"training",
"request",
"for",
"a",
"version",
"of",
"a",
"specified",
"LUIS",
"app",
".",
"This",
"POST",
"request",
"initiates",
"a",
"request",
"asynchronously",
".",
"To",
"determine",
"whether",
"the",
"training",
"request",
"is",
"successful... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java#L105-L112 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.setString | @PublicEvolving
public void setString(ConfigOption<String> key, String value) {
setValueInternal(key.key(), value);
} | java | @PublicEvolving
public void setString(ConfigOption<String> key, String value) {
setValueInternal(key.key(), value);
} | [
"@",
"PublicEvolving",
"public",
"void",
"setString",
"(",
"ConfigOption",
"<",
"String",
">",
"key",
",",
"String",
"value",
")",
"{",
"setValueInternal",
"(",
"key",
".",
"key",
"(",
")",
",",
"value",
")",
";",
"}"
] | Adds the given value to the configuration object.
The main key of the config option will be used to map the value.
@param key
the option specifying the key to be added
@param value
the value of the key/value pair to be added | [
"Adds",
"the",
"given",
"value",
"to",
"the",
"configuration",
"object",
".",
"The",
"main",
"key",
"of",
"the",
"config",
"option",
"will",
"be",
"used",
"to",
"map",
"the",
"value",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L190-L193 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/text/SpanSet.java | SpanSet.hasSpansIntersecting | public boolean hasSpansIntersecting(int start, int end) {
for (int i = 0; i < numberOfSpans; i++) {
// equal test is valid since both intervals are not empty by construction
if (spanStarts[i] >= end || spanEnds[i] <= start) continue;
return true;
}
return fals... | java | public boolean hasSpansIntersecting(int start, int end) {
for (int i = 0; i < numberOfSpans; i++) {
// equal test is valid since both intervals are not empty by construction
if (spanStarts[i] >= end || spanEnds[i] <= start) continue;
return true;
}
return fals... | [
"public",
"boolean",
"hasSpansIntersecting",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numberOfSpans",
";",
"i",
"++",
")",
"{",
"// equal test is valid since both intervals are not empty by construction",
... | Returns true if there are spans intersecting the given interval.
@param end must be strictly greater than start | [
"Returns",
"true",
"if",
"there",
"are",
"spans",
"intersecting",
"the",
"given",
"interval",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/text/SpanSet.java#L80-L87 |
voldemort/voldemort | src/java/voldemort/server/storage/prunejob/VersionedPutPruneJob.java | VersionedPutPruneJob.pruneNonReplicaEntries | public static List<Versioned<byte[]>> pruneNonReplicaEntries(List<Versioned<byte[]>> vals,
List<Integer> keyReplicas,
MutableBoolean didPrune) {
List<Versioned<byte[]>> prunedVals = ... | java | public static List<Versioned<byte[]>> pruneNonReplicaEntries(List<Versioned<byte[]>> vals,
List<Integer> keyReplicas,
MutableBoolean didPrune) {
List<Versioned<byte[]>> prunedVals = ... | [
"public",
"static",
"List",
"<",
"Versioned",
"<",
"byte",
"[",
"]",
">",
">",
"pruneNonReplicaEntries",
"(",
"List",
"<",
"Versioned",
"<",
"byte",
"[",
"]",
">",
">",
"vals",
",",
"List",
"<",
"Integer",
">",
"keyReplicas",
",",
"MutableBoolean",
"didP... | Remove all non replica clock entries from the list of versioned values
provided
@param vals list of versioned values to prune replicas from
@param keyReplicas list of current replicas for the given key
@param didPrune flag to mark if we did actually prune something
@return pruned list | [
"Remove",
"all",
"non",
"replica",
"clock",
"entries",
"from",
"the",
"list",
"of",
"versioned",
"values",
"provided"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/storage/prunejob/VersionedPutPruneJob.java#L181-L199 |
JoeKerouac/utils | src/main/java/com/joe/utils/reflect/ClassUtils.java | ClassUtils.getInstance | public static <T> T getInstance(Class<T> clazz, Class<?>[] paramTypes, Object[] params) {
Assert.isTrue(CollectionUtil.safeSizeOf(paramTypes) == CollectionUtil.safeSizeOf(params));
try {
Constructor<T> constructor = clazz.getConstructor(paramTypes);
ReflectUtil.allowAccess(constr... | java | public static <T> T getInstance(Class<T> clazz, Class<?>[] paramTypes, Object[] params) {
Assert.isTrue(CollectionUtil.safeSizeOf(paramTypes) == CollectionUtil.safeSizeOf(params));
try {
Constructor<T> constructor = clazz.getConstructor(paramTypes);
ReflectUtil.allowAccess(constr... | [
"public",
"static",
"<",
"T",
">",
"T",
"getInstance",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"Assert",
".",
"isTrue",
"(",
"CollectionUtil",
".",
"saf... | 获取class的实例
@param clazz class
@param paramTypes 构造器参数类型
@param params 参数
@param <T> class类型
@return Class实例 | [
"获取class的实例"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/reflect/ClassUtils.java#L153-L162 |
buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/metadata/MetadataProviderImpl.java | MetadataProviderImpl.createTypeMetadata | private TypeMetadata createTypeMetadata(AnnotatedType annotatedType) {
Class<?> currentClass = annotatedType.getAnnotatedElement();
Collection<AnnotatedMethod> annotatedMethods = this.annotatedMethods.get(currentClass);
if (annotatedMethods == null) {
throw new XOException("XO unit d... | java | private TypeMetadata createTypeMetadata(AnnotatedType annotatedType) {
Class<?> currentClass = annotatedType.getAnnotatedElement();
Collection<AnnotatedMethod> annotatedMethods = this.annotatedMethods.get(currentClass);
if (annotatedMethods == null) {
throw new XOException("XO unit d... | [
"private",
"TypeMetadata",
"createTypeMetadata",
"(",
"AnnotatedType",
"annotatedType",
")",
"{",
"Class",
"<",
"?",
">",
"currentClass",
"=",
"annotatedType",
".",
"getAnnotatedElement",
"(",
")",
";",
"Collection",
"<",
"AnnotatedMethod",
">",
"annotatedMethods",
... | Create the {@link TypeMetadata} for the given {@link AnnotatedType}.
@param annotatedType
The {@link AnnotatedType}.
@return The corresponding metadata. | [
"Create",
"the",
"{",
"@link",
"TypeMetadata",
"}",
"for",
"the",
"given",
"{",
"@link",
"AnnotatedType",
"}",
"."
] | train | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/metadata/MetadataProviderImpl.java#L187-L207 |
sarxos/webcam-capture | webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java | Webcam.getImageBytes | public ByteBuffer getImageBytes() {
if (!isReady()) {
return null;
}
assert driver != null;
assert device != null;
long t1 = 0;
long t2 = 0;
// some devices can support direct image buffers, and for those call
// processor task, and for those which does not support direct image
//... | java | public ByteBuffer getImageBytes() {
if (!isReady()) {
return null;
}
assert driver != null;
assert device != null;
long t1 = 0;
long t2 = 0;
// some devices can support direct image buffers, and for those call
// processor task, and for those which does not support direct image
//... | [
"public",
"ByteBuffer",
"getImageBytes",
"(",
")",
"{",
"if",
"(",
"!",
"isReady",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"assert",
"driver",
"!=",
"null",
";",
"assert",
"device",
"!=",
"null",
";",
"long",
"t1",
"=",
"0",
";",
"long",
"t... | Get RAW image ByteBuffer. It will always return buffer with 3 x 1 bytes per each pixel, where
RGB components are on (0, 1, 2) and color space is sRGB.<br>
<br>
<b>IMPORTANT!</b><br>
Some drivers can return direct ByteBuffer, so there is no guarantee that underlying bytes
will not be released in next read image operatio... | [
"Get",
"RAW",
"image",
"ByteBuffer",
".",
"It",
"will",
"always",
"return",
"buffer",
"with",
"3",
"x",
"1",
"bytes",
"per",
"each",
"pixel",
"where",
"RGB",
"components",
"are",
"on",
"(",
"0",
"1",
"2",
")",
"and",
"color",
"space",
"is",
"sRGB",
"... | train | https://github.com/sarxos/webcam-capture/blob/efbdae04f9ba48db9ec621e94a9bcd6f031882c8/webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java#L711-L742 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/ProviderRest.java | ProviderRest.createProvider | @POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response createProvider(@Context HttpHeaders hh,@Context UriInfo uriInfo, String payload)
throws IOException, JAXBException {
logger.debug("StartOf createProvider - REQUEST Insert /providers")... | java | @POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response createProvider(@Context HttpHeaders hh,@Context UriInfo uriInfo, String payload)
throws IOException, JAXBException {
logger.debug("StartOf createProvider - REQUEST Insert /providers")... | [
"@",
"POST",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"public",
"Response",
"createProvider",
"(",
"@",
"Context",
"HttpHeaders",
"hh",
",",
"@",
"Context",
"UriInfo",
"uriI... | Creates a new provider
<pre>
POST /providers
Request:
POST /providers HTTP/1.1
Accept: application/xml
Response:
{@code
<provider>
<uuid>fc993580-03fe-41eb-8a21-a56709f9370f</uuid>
<name>provider-3</name>
</provider>
}
</pre>
Example: <li>curl -H "Content-type: application/xml" -X POST -d
@provider.xml localhos... | [
"Creates",
"a",
"new",
"provider"
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/ProviderRest.java#L201-L224 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlGroupContainer.java | CmsXmlGroupContainer.saveGroupContainer | protected void saveGroupContainer(CmsObject cms, Element parent, CmsGroupContainerBean groupContainer)
throws CmsException {
parent.clearContent();
Element groupContainerElem = parent.addElement(XmlNode.GroupContainers.name());
groupContainerElem.addElement(XmlNode.Title.name()).addCDATA(g... | java | protected void saveGroupContainer(CmsObject cms, Element parent, CmsGroupContainerBean groupContainer)
throws CmsException {
parent.clearContent();
Element groupContainerElem = parent.addElement(XmlNode.GroupContainers.name());
groupContainerElem.addElement(XmlNode.Title.name()).addCDATA(g... | [
"protected",
"void",
"saveGroupContainer",
"(",
"CmsObject",
"cms",
",",
"Element",
"parent",
",",
"CmsGroupContainerBean",
"groupContainer",
")",
"throws",
"CmsException",
"{",
"parent",
".",
"clearContent",
"(",
")",
";",
"Element",
"groupContainerElem",
"=",
"par... | Adds the given container page to the given element.<p>
@param cms the current CMS object
@param parent the element to add it
@param groupContainer the container page to add
@throws CmsException if something goes wrong | [
"Adds",
"the",
"given",
"container",
"page",
"to",
"the",
"given",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlGroupContainer.java#L410-L443 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/LookupManagerImpl.java | LookupManagerImpl.addNotificationHandler | @Override
public void addNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException {
if(! isStarted){
ServiceDirectoryError error = new ServiceDirectoryError(ErrorCode.SERVICE_DIRECTORY_MANAGER_FACTORY_CLOSED);
throw new ServiceException(error);
... | java | @Override
public void addNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException {
if(! isStarted){
ServiceDirectoryError error = new ServiceDirectoryError(ErrorCode.SERVICE_DIRECTORY_MANAGER_FACTORY_CLOSED);
throw new ServiceException(error);
... | [
"@",
"Override",
"public",
"void",
"addNotificationHandler",
"(",
"String",
"serviceName",
",",
"NotificationHandler",
"handler",
")",
"throws",
"ServiceException",
"{",
"if",
"(",
"!",
"isStarted",
")",
"{",
"ServiceDirectoryError",
"error",
"=",
"new",
"ServiceDir... | Add a NotificationHandler to the Service.
This method can check the duplicate NotificationHandler for the serviceName, if the NotificationHandler
already exists in the serviceName, do nothing.
Throw IllegalArgumentException if serviceName or handler is null.
@param serviceName
the service name.
@param handler
the No... | [
"Add",
"a",
"NotificationHandler",
"to",
"the",
"Service",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/LookupManagerImpl.java#L419-L437 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/convert/LongConverter.java | LongConverter.toLongWithDefault | public static long toLongWithDefault(Object value, long defaultValue) {
Long result = toNullableLong(value);
return result != null ? (long) result : defaultValue;
} | java | public static long toLongWithDefault(Object value, long defaultValue) {
Long result = toNullableLong(value);
return result != null ? (long) result : defaultValue;
} | [
"public",
"static",
"long",
"toLongWithDefault",
"(",
"Object",
"value",
",",
"long",
"defaultValue",
")",
"{",
"Long",
"result",
"=",
"toNullableLong",
"(",
"value",
")",
";",
"return",
"result",
"!=",
"null",
"?",
"(",
"long",
")",
"result",
":",
"defaul... | Converts value into integer or returns default when conversion is not
possible.
@param value the value to convert.
@param defaultValue the default value.
@return long value or default when conversion is not supported
@see LongConverter#toNullableLong(Object) | [
"Converts",
"value",
"into",
"integer",
"or",
"returns",
"default",
"when",
"conversion",
"is",
"not",
"possible",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/convert/LongConverter.java#L90-L93 |
Impetus/Kundera | src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java | OracleNoSQLClient.createRow | private Row createRow(EntityMetadata entityMetadata, Object entity, Object id, List<RelationHolder> rlHolders)
{
String schema = entityMetadata.getSchema(); // Irrelevant for this
// datastore
String table = entityMetadata.getTableName();
MetamodelImpl metamodel = (MetamodelImpl) Ku... | java | private Row createRow(EntityMetadata entityMetadata, Object entity, Object id, List<RelationHolder> rlHolders)
{
String schema = entityMetadata.getSchema(); // Irrelevant for this
// datastore
String table = entityMetadata.getTableName();
MetamodelImpl metamodel = (MetamodelImpl) Ku... | [
"private",
"Row",
"createRow",
"(",
"EntityMetadata",
"entityMetadata",
",",
"Object",
"entity",
",",
"Object",
"id",
",",
"List",
"<",
"RelationHolder",
">",
"rlHolders",
")",
"{",
"String",
"schema",
"=",
"entityMetadata",
".",
"getSchema",
"(",
")",
";",
... | Creates the row.
@param entityMetadata
the entity metadata
@param entity
the entity
@param id
the id
@param rlHolders
the rl holders
@return the row | [
"Creates",
"the",
"row",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java#L1513-L1558 |
Patreon/patreon-java | src/main/java/com/patreon/PatreonAPI.java | PatreonAPI.addFieldsParam | private URIBuilder addFieldsParam(URIBuilder builder, Class<? extends BaseResource> type, Collection<? extends Field> fields) {
List<String> fieldNames = new ArrayList<>();
for (Field f : fields) {
fieldNames.add(f.getPropertyName());
}
String typeStr = BaseResource.getType(type);
builder.addP... | java | private URIBuilder addFieldsParam(URIBuilder builder, Class<? extends BaseResource> type, Collection<? extends Field> fields) {
List<String> fieldNames = new ArrayList<>();
for (Field f : fields) {
fieldNames.add(f.getPropertyName());
}
String typeStr = BaseResource.getType(type);
builder.addP... | [
"private",
"URIBuilder",
"addFieldsParam",
"(",
"URIBuilder",
"builder",
",",
"Class",
"<",
"?",
"extends",
"BaseResource",
">",
"type",
",",
"Collection",
"<",
"?",
"extends",
"Field",
">",
"fields",
")",
"{",
"List",
"<",
"String",
">",
"fieldNames",
"=",
... | Add fields[type]=fieldName,fieldName,fieldName as a query parameter to the request represented by builder
@param builder A URIBuilder building a request to the API
@param type A BaseResource annotated with {@link com.github.jasminb.jsonapi.annotations.Type}
@param fields A list of fields to include. Only fields in thi... | [
"Add",
"fields",
"[",
"type",
"]",
"=",
"fieldName",
"fieldName",
"fieldName",
"as",
"a",
"query",
"parameter",
"to",
"the",
"request",
"represented",
"by",
"builder"
] | train | https://github.com/Patreon/patreon-java/blob/669104b3389f19635ffab75c593db9c022334092/src/main/java/com/patreon/PatreonAPI.java#L211-L220 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/DefaultExceptionResolver.java | DefaultExceptionResolver.createThrowable | private Throwable createThrowable(String typeName, String message) throws IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException {
Class<? extends Throwable> clazz = resolveThrowableClass(typeName);
Constructor<? extends Throwable> defaultCtr = getDefaultConstructor(clazz... | java | private Throwable createThrowable(String typeName, String message) throws IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException {
Class<? extends Throwable> clazz = resolveThrowableClass(typeName);
Constructor<? extends Throwable> defaultCtr = getDefaultConstructor(clazz... | [
"private",
"Throwable",
"createThrowable",
"(",
"String",
"typeName",
",",
"String",
"message",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
"InstantiationException",
",",
"ClassNotFoundException",
"{",
"Class",
"<",
"?",
"extends",
"T... | Attempts to create an {@link Throwable} of the given type with the given message. For this method to create a
{@link Throwable} it must have either a default (no-args) constructor or a constructor that takes a {@code String}
as the message name. null is returned if a {@link Throwable} can't be created.
@param type... | [
"Attempts",
"to",
"create",
"an",
"{",
"@link",
"Throwable",
"}",
"of",
"the",
"given",
"type",
"with",
"the",
"given",
"message",
".",
"For",
"this",
"method",
"to",
"create",
"a",
"{",
"@link",
"Throwable",
"}",
"it",
"must",
"have",
"either",
"a",
"... | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/DefaultExceptionResolver.java#L69-L89 |
KyoriPowered/text | api/src/main/java/net/kyori/text/TranslatableComponent.java | TranslatableComponent.of | public static TranslatableComponent of(final @NonNull String key, final @Nullable TextColor color) {
return builder(key)
.color(color)
.build();
} | java | public static TranslatableComponent of(final @NonNull String key, final @Nullable TextColor color) {
return builder(key)
.color(color)
.build();
} | [
"public",
"static",
"TranslatableComponent",
"of",
"(",
"final",
"@",
"NonNull",
"String",
"key",
",",
"final",
"@",
"Nullable",
"TextColor",
"color",
")",
"{",
"return",
"builder",
"(",
"key",
")",
".",
"color",
"(",
"color",
")",
".",
"build",
"(",
")"... | Creates a translatable component with a translation key.
@param key the translation key
@param color the color
@return the translatable component | [
"Creates",
"a",
"translatable",
"component",
"with",
"a",
"translation",
"key",
"."
] | train | https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/TranslatableComponent.java#L93-L97 |
epam/parso | src/main/java/com/epam/parso/impl/CSVDataWriterImpl.java | CSVDataWriterImpl.writeRowsArray | @Override
public void writeRowsArray(List<Column> columns, Object[][] rows) throws IOException {
for (Object[] currentRow : rows) {
if (currentRow != null) {
writeRow(columns, currentRow);
} else {
break;
}
}
} | java | @Override
public void writeRowsArray(List<Column> columns, Object[][] rows) throws IOException {
for (Object[] currentRow : rows) {
if (currentRow != null) {
writeRow(columns, currentRow);
} else {
break;
}
}
} | [
"@",
"Override",
"public",
"void",
"writeRowsArray",
"(",
"List",
"<",
"Column",
">",
"columns",
",",
"Object",
"[",
"]",
"[",
"]",
"rows",
")",
"throws",
"IOException",
"{",
"for",
"(",
"Object",
"[",
"]",
"currentRow",
":",
"rows",
")",
"{",
"if",
... | The method to export a parsed sas7bdat file (stored as an object of the {@link SasFileReaderImpl} class)
using {@link CSVDataWriterImpl#writer}.
@param columns the {@link Column} class variables list that stores columns description from the sas7bdat file.
@param rows the Objects arrays array that stores data from t... | [
"The",
"method",
"to",
"export",
"a",
"parsed",
"sas7bdat",
"file",
"(",
"stored",
"as",
"an",
"object",
"of",
"the",
"{",
"@link",
"SasFileReaderImpl",
"}",
"class",
")",
"using",
"{",
"@link",
"CSVDataWriterImpl#writer",
"}",
"."
] | train | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/CSVDataWriterImpl.java#L121-L130 |
whizzosoftware/WZWave | src/main/java/com/whizzosoftware/wzwave/commandclass/CommandClass.java | CommandClass.createSendDataFrame | static protected DataFrame createSendDataFrame(String name, byte nodeId, byte[] data, boolean isResponseExpected) {
return new SendData(name, nodeId, data, (byte)(SendData.TRANSMIT_OPTION_ACK | SendData.TRANSMIT_OPTION_AUTO_ROUTE), isResponseExpected);
} | java | static protected DataFrame createSendDataFrame(String name, byte nodeId, byte[] data, boolean isResponseExpected) {
return new SendData(name, nodeId, data, (byte)(SendData.TRANSMIT_OPTION_ACK | SendData.TRANSMIT_OPTION_AUTO_ROUTE), isResponseExpected);
} | [
"static",
"protected",
"DataFrame",
"createSendDataFrame",
"(",
"String",
"name",
",",
"byte",
"nodeId",
",",
"byte",
"[",
"]",
"data",
",",
"boolean",
"isResponseExpected",
")",
"{",
"return",
"new",
"SendData",
"(",
"name",
",",
"nodeId",
",",
"data",
",",... | Convenience method for creating SendData frames
@param name the name for logging purposes
@param nodeId the destination node ID
@param data the data portion of the SendData frame
@param isResponseExpected indicates whether sending this data frame should require a response
@return a DataFrame instance | [
"Convenience",
"method",
"for",
"creating",
"SendData",
"frames"
] | train | https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/commandclass/CommandClass.java#L136-L138 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/printer/FormulaStringRepresentation.java | FormulaStringRepresentation.binaryOperator | protected String binaryOperator(final BinaryOperator operator, final String opString) {
final String leftString = operator.type().precedence() < operator.left().type().precedence()
? this.toString(operator.left()) : this.bracket(operator.left());
final String rightString = operator.type(... | java | protected String binaryOperator(final BinaryOperator operator, final String opString) {
final String leftString = operator.type().precedence() < operator.left().type().precedence()
? this.toString(operator.left()) : this.bracket(operator.left());
final String rightString = operator.type(... | [
"protected",
"String",
"binaryOperator",
"(",
"final",
"BinaryOperator",
"operator",
",",
"final",
"String",
"opString",
")",
"{",
"final",
"String",
"leftString",
"=",
"operator",
".",
"type",
"(",
")",
".",
"precedence",
"(",
")",
"<",
"operator",
".",
"le... | Returns the string representation of a binary operator.
@param operator the binary operator
@param opString the operator string
@return the string representation | [
"Returns",
"the",
"string",
"representation",
"of",
"a",
"binary",
"operator",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/printer/FormulaStringRepresentation.java#L98-L104 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRAnimationChannel.java | GVRAnimationChannel.animate | public void animate(float animationTime, Matrix4f mat)
{
mRotInterpolator.animate(animationTime, mRotKey);
mPosInterpolator.animate(animationTime, mPosKey);
mSclInterpolator.animate(animationTime, mScaleKey);
mat.translationRotateScale(mPosKey[0], mPosKey[1], mPosKey[2], mRotKey[0], ... | java | public void animate(float animationTime, Matrix4f mat)
{
mRotInterpolator.animate(animationTime, mRotKey);
mPosInterpolator.animate(animationTime, mPosKey);
mSclInterpolator.animate(animationTime, mScaleKey);
mat.translationRotateScale(mPosKey[0], mPosKey[1], mPosKey[2], mRotKey[0], ... | [
"public",
"void",
"animate",
"(",
"float",
"animationTime",
",",
"Matrix4f",
"mat",
")",
"{",
"mRotInterpolator",
".",
"animate",
"(",
"animationTime",
",",
"mRotKey",
")",
";",
"mPosInterpolator",
".",
"animate",
"(",
"animationTime",
",",
"mPosKey",
")",
";"... | Obtains the transform for a specific time in animation.
@param animationTime The time in animation.
@return The transform. | [
"Obtains",
"the",
"transform",
"for",
"a",
"specific",
"time",
"in",
"animation",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRAnimationChannel.java#L291-L298 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamFilenameHelper.java | DatastreamFilenameHelper.getFilenameFromLabel | private final String getFilenameFromLabel(Context context, String pid, String dsid, Date asOfDateTime, String MIMETYPE) throws Exception {
// can't get datastream label directly from datastream as this is an API-M call
// instead get list of datastream defs, as these contain labels
DOReader rea... | java | private final String getFilenameFromLabel(Context context, String pid, String dsid, Date asOfDateTime, String MIMETYPE) throws Exception {
// can't get datastream label directly from datastream as this is an API-M call
// instead get list of datastream defs, as these contain labels
DOReader rea... | [
"private",
"final",
"String",
"getFilenameFromLabel",
"(",
"Context",
"context",
",",
"String",
"pid",
",",
"String",
"dsid",
",",
"Date",
"asOfDateTime",
",",
"String",
"MIMETYPE",
")",
"throws",
"Exception",
"{",
"// can't get datastream label directly from datastream... | Get filename based on datastream label
@param context
@param pid
@param dsid
@param asOfDateTime
@param MIMETYPE
@return
@throws Exception | [
"Get",
"filename",
"based",
"on",
"datastream",
"label"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/rest/DatastreamFilenameHelper.java#L344-L352 |
buschmais/jqa-core-framework | rule/src/main/java/com/buschmais/jqassistant/core/rule/api/executor/RuleSetExecutor.java | RuleSetExecutor.executeGroup | private void executeGroup(RuleSet ruleSet, Group group, Severity parentSeverity) throws RuleException {
if (!executedGroups.contains(group)) {
ruleVisitor.beforeGroup(group, getEffectiveSeverity(group, parentSeverity, parentSeverity));
for (Map.Entry<String, Severity> conceptEntry : grou... | java | private void executeGroup(RuleSet ruleSet, Group group, Severity parentSeverity) throws RuleException {
if (!executedGroups.contains(group)) {
ruleVisitor.beforeGroup(group, getEffectiveSeverity(group, parentSeverity, parentSeverity));
for (Map.Entry<String, Severity> conceptEntry : grou... | [
"private",
"void",
"executeGroup",
"(",
"RuleSet",
"ruleSet",
",",
"Group",
"group",
",",
"Severity",
"parentSeverity",
")",
"throws",
"RuleException",
"{",
"if",
"(",
"!",
"executedGroups",
".",
"contains",
"(",
"group",
")",
")",
"{",
"ruleVisitor",
".",
"... | Executes the given group.
@param ruleSet
The rule set.
@param group
The group.
@param parentSeverity
The severity. | [
"Executes",
"the",
"given",
"group",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/rule/src/main/java/com/buschmais/jqassistant/core/rule/api/executor/RuleSetExecutor.java#L70-L86 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/geom/Polygon.java | Polygon.addPoint | public void addPoint(double x, double y)
{
if (npoints >= xpoints.length)
{
final int newLength = npoints * 2;
xpoints = Arrays.copyOf(xpoints, newLength);
ypoints = Arrays.copyOf(ypoints, newLength);
}
xpoints[npoints] = x;
ypoint... | java | public void addPoint(double x, double y)
{
if (npoints >= xpoints.length)
{
final int newLength = npoints * 2;
xpoints = Arrays.copyOf(xpoints, newLength);
ypoints = Arrays.copyOf(ypoints, newLength);
}
xpoints[npoints] = x;
ypoint... | [
"public",
"void",
"addPoint",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"if",
"(",
"npoints",
">=",
"xpoints",
".",
"length",
")",
"{",
"final",
"int",
"newLength",
"=",
"npoints",
"*",
"2",
";",
"xpoints",
"=",
"Arrays",
".",
"copyOf",
"(",
... | Add a point to the polygon.
@param x The horizontal location.
@param y The vertical location. | [
"Add",
"a",
"point",
"to",
"the",
"polygon",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/geom/Polygon.java#L57-L69 |
lucee/Lucee | core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java | CFMLTransformer.comment | private static void comment(SourceCode cfml, boolean removeSpace) throws TemplateException {
if (!removeSpace) {
comment(cfml);
}
else {
cfml.removeSpace();
if (comment(cfml)) cfml.removeSpace();
}
} | java | private static void comment(SourceCode cfml, boolean removeSpace) throws TemplateException {
if (!removeSpace) {
comment(cfml);
}
else {
cfml.removeSpace();
if (comment(cfml)) cfml.removeSpace();
}
} | [
"private",
"static",
"void",
"comment",
"(",
"SourceCode",
"cfml",
",",
"boolean",
"removeSpace",
")",
"throws",
"TemplateException",
"{",
"if",
"(",
"!",
"removeSpace",
")",
"{",
"comment",
"(",
"cfml",
")",
";",
"}",
"else",
"{",
"cfml",
".",
"removeSpac... | Liest einen Kommentar ein, Kommentare werden nicht in die CFXD uebertragen sondern verworfen.
Komentare koennen auch Kommentare enthalten. <br />
EBNF:<br />
<code>"<!---" {?-"--->"} "--->";</code>
@throws TemplateException | [
"Liest",
"einen",
"Kommentar",
"ein",
"Kommentare",
"werden",
"nicht",
"in",
"die",
"CFXD",
"uebertragen",
"sondern",
"verworfen",
".",
"Komentare",
"koennen",
"auch",
"Kommentare",
"enthalten",
".",
"<br",
"/",
">",
"EBNF",
":",
"<br",
"/",
">",
"<code",
">... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java#L396-L405 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java | AbstractAsymmetricCrypto.encryptBase64 | public String encryptBase64(String data, KeyType keyType) {
return Base64.encode(encrypt(data, keyType));
} | java | public String encryptBase64(String data, KeyType keyType) {
return Base64.encode(encrypt(data, keyType));
} | [
"public",
"String",
"encryptBase64",
"(",
"String",
"data",
",",
"KeyType",
"keyType",
")",
"{",
"return",
"Base64",
".",
"encode",
"(",
"encrypt",
"(",
"data",
",",
"keyType",
")",
")",
";",
"}"
] | 编码为Base64字符串,使用UTF-8编码
@param data 被加密的字符串
@param keyType 私钥或公钥 {@link KeyType}
@return Base64字符串
@since 4.0.1 | [
"编码为Base64字符串,使用UTF",
"-",
"8编码"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java#L137-L139 |
tiesebarrell/process-assertions | process-assertions-api/src/main/java/org/toxos/processassertions/api/ProcessAssert.java | ProcessAssert.assertProcessEndedAndInEndEvents | public static void assertProcessEndedAndInEndEvents(final String processInstanceId, final String... endEventIds) {
Validate.notNull(processInstanceId);
Validate.notNull(endEventIds);
apiCallback.debug(LogMessage.PROCESS_11, processInstanceId, AssertUtils.arrayToString(endEventIds));
try... | java | public static void assertProcessEndedAndInEndEvents(final String processInstanceId, final String... endEventIds) {
Validate.notNull(processInstanceId);
Validate.notNull(endEventIds);
apiCallback.debug(LogMessage.PROCESS_11, processInstanceId, AssertUtils.arrayToString(endEventIds));
try... | [
"public",
"static",
"void",
"assertProcessEndedAndInEndEvents",
"(",
"final",
"String",
"processInstanceId",
",",
"final",
"String",
"...",
"endEventIds",
")",
"{",
"Validate",
".",
"notNull",
"(",
"processInstanceId",
")",
";",
"Validate",
".",
"notNull",
"(",
"e... | Asserts the process instance with the provided id is ended and has reached <strong>all</strong> end events with
the provided ids.
<p>
<strong>Note:</strong> this assertion assumes the process has one or more end events and that all of them have
been reached (in other words, the exact set of provided end event ids is c... | [
"Asserts",
"the",
"process",
"instance",
"with",
"the",
"provided",
"id",
"is",
"ended",
"and",
"has",
"reached",
"<strong",
">",
"all<",
"/",
"strong",
">",
"end",
"events",
"with",
"the",
"provided",
"ids",
"."
] | train | https://github.com/tiesebarrell/process-assertions/blob/932a8443982e356cdf5a230165a35c725d9306ab/process-assertions-api/src/main/java/org/toxos/processassertions/api/ProcessAssert.java#L210-L220 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java | AsyncMutateInBuilder.arrayInsertAll | public <T> AsyncMutateInBuilder arrayInsertAll(String path, Collection<T> values) {
if (StringUtil.isNullOrEmpty(path)) {
throw new IllegalArgumentException("Path must not be empty for arrayInsert");
}
this.mutationSpecs.add(new MutationSpec(Mutation.ARRAY_INSERT, path, new MultiValu... | java | public <T> AsyncMutateInBuilder arrayInsertAll(String path, Collection<T> values) {
if (StringUtil.isNullOrEmpty(path)) {
throw new IllegalArgumentException("Path must not be empty for arrayInsert");
}
this.mutationSpecs.add(new MutationSpec(Mutation.ARRAY_INSERT, path, new MultiValu... | [
"public",
"<",
"T",
">",
"AsyncMutateInBuilder",
"arrayInsertAll",
"(",
"String",
"path",
",",
"Collection",
"<",
"T",
">",
"values",
")",
"{",
"if",
"(",
"StringUtil",
".",
"isNullOrEmpty",
"(",
"path",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | Insert multiple values at once in an existing array at a specified position (denoted in the
path, eg. "sub.array[2]"), inserting all values in the collection's iteration order at the given
position and shifting existing values beyond the position by the number of elements in the collection.
Each item in the collection... | [
"Insert",
"multiple",
"values",
"at",
"once",
"in",
"an",
"existing",
"array",
"at",
"a",
"specified",
"position",
"(",
"denoted",
"in",
"the",
"path",
"eg",
".",
"sub",
".",
"array",
"[",
"2",
"]",
")",
"inserting",
"all",
"values",
"in",
"the",
"coll... | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java#L1115-L1121 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/client/AsyncLoggerSet.java | AsyncLoggerSet.setCommittedTxId | public void setCommittedTxId(long txid, boolean force) {
for (AsyncLogger logger : loggers) {
logger.setCommittedTxId(txid, force);
}
} | java | public void setCommittedTxId(long txid, boolean force) {
for (AsyncLogger logger : loggers) {
logger.setCommittedTxId(txid, force);
}
} | [
"public",
"void",
"setCommittedTxId",
"(",
"long",
"txid",
",",
"boolean",
"force",
")",
"{",
"for",
"(",
"AsyncLogger",
"logger",
":",
"loggers",
")",
"{",
"logger",
".",
"setCommittedTxId",
"(",
"txid",
",",
"force",
")",
";",
"}",
"}"
] | Set the highest successfully committed txid seen by the writer.
This should be called after a successful write to a quorum, and is used
for extra sanity checks against the protocol. See HDFS-3863. | [
"Set",
"the",
"highest",
"successfully",
"committed",
"txid",
"seen",
"by",
"the",
"writer",
".",
"This",
"should",
"be",
"called",
"after",
"a",
"successful",
"write",
"to",
"a",
"quorum",
"and",
"is",
"used",
"for",
"extra",
"sanity",
"checks",
"against",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/client/AsyncLoggerSet.java#L81-L85 |
strator-dev/greenpepper | greenpepper/greenpepper-server/src/main/java/com/greenpepper/server/GreenPepperServerServiceImpl.java | GreenPepperServerServiceImpl.getAllSpecificationRepositories | public List<Repository> getAllSpecificationRepositories() throws GreenPepperServerException {
try {
sessionService.startSession();
List<Repository> repositories = repositoryDao.getAllRepositories(ContentType.TEST);
log.debug("Retrieved All Specification Repositories number:... | java | public List<Repository> getAllSpecificationRepositories() throws GreenPepperServerException {
try {
sessionService.startSession();
List<Repository> repositories = repositoryDao.getAllRepositories(ContentType.TEST);
log.debug("Retrieved All Specification Repositories number:... | [
"public",
"List",
"<",
"Repository",
">",
"getAllSpecificationRepositories",
"(",
")",
"throws",
"GreenPepperServerException",
"{",
"try",
"{",
"sessionService",
".",
"startSession",
"(",
")",
";",
"List",
"<",
"Repository",
">",
"repositories",
"=",
"repositoryDao"... | <p>getAllSpecificationRepositories.</p>
@inheritDoc NO NEEDS TO SECURE THIS
@return a {@link java.util.List} object.
@throws com.greenpepper.server.GreenPepperServerException if any. | [
"<p",
">",
"getAllSpecificationRepositories",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-server/src/main/java/com/greenpepper/server/GreenPepperServerServiceImpl.java#L454-L467 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionManager.java | RaftSessionManager.resetConnections | public void resetConnections(MemberId leader, Collection<MemberId> servers) {
selectorManager.resetAll(leader, servers);
} | java | public void resetConnections(MemberId leader, Collection<MemberId> servers) {
selectorManager.resetAll(leader, servers);
} | [
"public",
"void",
"resetConnections",
"(",
"MemberId",
"leader",
",",
"Collection",
"<",
"MemberId",
">",
"servers",
")",
"{",
"selectorManager",
".",
"resetAll",
"(",
"leader",
",",
"servers",
")",
";",
"}"
] | Resets the session manager's cluster information.
@param leader The leader address.
@param servers The collection of servers. | [
"Resets",
"the",
"session",
"manager",
"s",
"cluster",
"information",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionManager.java#L131-L133 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzleResultSet.java | DrizzleResultSet.updateNClob | public void updateNClob(final String columnLabel, final java.sql.NClob nClob) throws SQLException {
throw SQLExceptionMapper.getFeatureNotSupportedException("Updates are not supported");
} | java | public void updateNClob(final String columnLabel, final java.sql.NClob nClob) throws SQLException {
throw SQLExceptionMapper.getFeatureNotSupportedException("Updates are not supported");
} | [
"public",
"void",
"updateNClob",
"(",
"final",
"String",
"columnLabel",
",",
"final",
"java",
".",
"sql",
".",
"NClob",
"nClob",
")",
"throws",
"SQLException",
"{",
"throw",
"SQLExceptionMapper",
".",
"getFeatureNotSupportedException",
"(",
"\"Updates are not supporte... | Updates the designated column with a <code>java.sql.NClob</code> value. The updater methods are used to update
column values in the current row or the insert row. The updater methods do not update the underlying database;
instead the <code>updateRow</code> or <code>insertRow</code> methods are called to update the dat... | [
"Updates",
"the",
"designated",
"column",
"with",
"a",
"<code",
">",
"java",
".",
"sql",
".",
"NClob<",
"/",
"code",
">",
"value",
".",
"The",
"updater",
"methods",
"are",
"used",
"to",
"update",
"column",
"values",
"in",
"the",
"current",
"row",
"or",
... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleResultSet.java#L2563-L2565 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java | StructureTools.getAllAtomArray | public static final Atom[] getAllAtomArray(Structure s, int model) {
List<Atom> atoms = new ArrayList<Atom>();
AtomIterator iter = new AtomIterator(s,model);
while (iter.hasNext()) {
Atom a = iter.next();
atoms.add(a);
}
return atoms.toArray(new Atom[atoms.size()]);
} | java | public static final Atom[] getAllAtomArray(Structure s, int model) {
List<Atom> atoms = new ArrayList<Atom>();
AtomIterator iter = new AtomIterator(s,model);
while (iter.hasNext()) {
Atom a = iter.next();
atoms.add(a);
}
return atoms.toArray(new Atom[atoms.size()]);
} | [
"public",
"static",
"final",
"Atom",
"[",
"]",
"getAllAtomArray",
"(",
"Structure",
"s",
",",
"int",
"model",
")",
"{",
"List",
"<",
"Atom",
">",
"atoms",
"=",
"new",
"ArrayList",
"<",
"Atom",
">",
"(",
")",
";",
"AtomIterator",
"iter",
"=",
"new",
"... | Convert all atoms of the structure (specified model) into an Atom array
@param s
input structure
@return all atom array | [
"Convert",
"all",
"atoms",
"of",
"the",
"structure",
"(",
"specified",
"model",
")",
"into",
"an",
"Atom",
"array"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java#L377-L387 |
zmarko/sss | src/main/java/rs/in/zivanovic/sss/SasUtils.java | SasUtils.encodeToBinary | public static byte[] encodeToBinary(SecretShare share) {
if (share.getN() < 0 || share.getN() > 255) {
throw new IllegalArgumentException("Invalid share number, must be between 0 and 255");
}
byte[] shareData = share.getShare().toByteArray();
byte[] primeData = share.getPrim... | java | public static byte[] encodeToBinary(SecretShare share) {
if (share.getN() < 0 || share.getN() > 255) {
throw new IllegalArgumentException("Invalid share number, must be between 0 and 255");
}
byte[] shareData = share.getShare().toByteArray();
byte[] primeData = share.getPrim... | [
"public",
"static",
"byte",
"[",
"]",
"encodeToBinary",
"(",
"SecretShare",
"share",
")",
"{",
"if",
"(",
"share",
".",
"getN",
"(",
")",
"<",
"0",
"||",
"share",
".",
"getN",
"(",
")",
">",
"255",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Serialize secret share to binary message format. The message consists of the following fields:
<ul>
<li>header (ASCII string "SS")</li>
<li>single byte indicating the ordinal number of this specific share in the series</li>
<li>single integer (four bytes) indicating the length of the share data</li>
<li>variable number... | [
"Serialize",
"secret",
"share",
"to",
"binary",
"message",
"format",
".",
"The",
"message",
"consists",
"of",
"the",
"following",
"fields",
":",
"<ul",
">",
"<li",
">",
"header",
"(",
"ASCII",
"string",
"SS",
")",
"<",
"/",
"li",
">",
"<li",
">",
"sing... | train | https://github.com/zmarko/sss/blob/a41d9d39ca9a4ca1a2719c441c88e209ffc511f5/src/main/java/rs/in/zivanovic/sss/SasUtils.java#L150-L173 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.