repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java | CmsDomUtil.internalHasClass | private static boolean internalHasClass(String className, Element element) {
"""
Internal method to indicate if the given element has a CSS class.<p>
@param className the class name to look for
@param element the element
@return <code>true</code> if the element has the given CSS class
"""
boole... | java | private static boolean internalHasClass(String className, Element element) {
boolean hasClass = false;
try {
String elementClass = element.getClassName().trim();
hasClass = elementClass.equals(className);
hasClass |= elementClass.contains(" " + className + " ");
... | [
"private",
"static",
"boolean",
"internalHasClass",
"(",
"String",
"className",
",",
"Element",
"element",
")",
"{",
"boolean",
"hasClass",
"=",
"false",
";",
"try",
"{",
"String",
"elementClass",
"=",
"element",
".",
"getClassName",
"(",
")",
".",
"trim",
"... | Internal method to indicate if the given element has a CSS class.<p>
@param className the class name to look for
@param element the element
@return <code>true</code> if the element has the given CSS class | [
"Internal",
"method",
"to",
"indicate",
"if",
"the",
"given",
"element",
"has",
"a",
"CSS",
"class",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java#L2167-L2180 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/FeatureCollection.java | FeatureCollection.fromFeature | public static FeatureCollection fromFeature(@NonNull Feature feature,
@Nullable BoundingBox bbox) {
"""
Create a new instance of this class by giving the feature collection a single {@link Feature}.
@param feature a single feature
@param bbox optionally include ... | java | public static FeatureCollection fromFeature(@NonNull Feature feature,
@Nullable BoundingBox bbox) {
List<Feature> featureList = Arrays.asList(feature);
return new FeatureCollection(TYPE, bbox, featureList);
} | [
"public",
"static",
"FeatureCollection",
"fromFeature",
"(",
"@",
"NonNull",
"Feature",
"feature",
",",
"@",
"Nullable",
"BoundingBox",
"bbox",
")",
"{",
"List",
"<",
"Feature",
">",
"featureList",
"=",
"Arrays",
".",
"asList",
"(",
"feature",
")",
";",
"ret... | Create a new instance of this class by giving the feature collection a single {@link Feature}.
@param feature a single feature
@param bbox optionally include a bbox definition as a double array
@return a new instance of this class defined by the values passed inside this static factory
method
@since 3.0.0 | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"giving",
"the",
"feature",
"collection",
"a",
"single",
"{",
"@link",
"Feature",
"}",
"."
] | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/FeatureCollection.java#L152-L156 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeValidator.java | TypeValidator.expectCanAssignTo | boolean expectCanAssignTo(Node n, JSType rightType, JSType leftType, String msg) {
"""
Expect that the first type can be assigned to a symbol of the second type.
@param t The node traversal.
@param n The node to issue warnings on.
@param rightType The type on the RHS of the assign.
@param leftType The type o... | java | boolean expectCanAssignTo(Node n, JSType rightType, JSType leftType, String msg) {
if (!rightType.isSubtypeOf(leftType)) {
mismatch(n, msg, rightType, leftType);
return false;
} else if (!rightType.isSubtypeWithoutStructuralTyping(leftType)) {
TypeMismatch.recordImplicitInterfaceUses(this.impl... | [
"boolean",
"expectCanAssignTo",
"(",
"Node",
"n",
",",
"JSType",
"rightType",
",",
"JSType",
"leftType",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"!",
"rightType",
".",
"isSubtypeOf",
"(",
"leftType",
")",
")",
"{",
"mismatch",
"(",
"n",
",",
"msg",
... | Expect that the first type can be assigned to a symbol of the second type.
@param t The node traversal.
@param n The node to issue warnings on.
@param rightType The type on the RHS of the assign.
@param leftType The type of the symbol on the LHS of the assign.
@param msg An extra message for the mismatch warning, if n... | [
"Expect",
"that",
"the",
"first",
"type",
"can",
"be",
"assigned",
"to",
"a",
"symbol",
"of",
"the",
"second",
"type",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L634-L643 |
cdapio/tephra | tephra-hbase-compat-1.1/src/main/java/co/cask/tephra/hbase11/coprocessor/TransactionProcessor.java | TransactionProcessor.getTransactionFilter | protected Filter getTransactionFilter(Transaction tx, ScanType type, Filter filter) {
"""
Derived classes can override this method to customize the filter used to return data visible for the current
transaction.
@param tx the current transaction to apply
@param type the type of scan being performed
"""
... | java | protected Filter getTransactionFilter(Transaction tx, ScanType type, Filter filter) {
return TransactionFilters.getVisibilityFilter(tx, ttlByFamily, allowEmptyValues, type, filter);
} | [
"protected",
"Filter",
"getTransactionFilter",
"(",
"Transaction",
"tx",
",",
"ScanType",
"type",
",",
"Filter",
"filter",
")",
"{",
"return",
"TransactionFilters",
".",
"getVisibilityFilter",
"(",
"tx",
",",
"ttlByFamily",
",",
"allowEmptyValues",
",",
"type",
",... | Derived classes can override this method to customize the filter used to return data visible for the current
transaction.
@param tx the current transaction to apply
@param type the type of scan being performed | [
"Derived",
"classes",
"can",
"override",
"this",
"method",
"to",
"customize",
"the",
"filter",
"used",
"to",
"return",
"data",
"visible",
"for",
"the",
"current",
"transaction",
"."
] | train | https://github.com/cdapio/tephra/blob/082c56c15c6ece15002631ff6f89206a00d8915c/tephra-hbase-compat-1.1/src/main/java/co/cask/tephra/hbase11/coprocessor/TransactionProcessor.java#L314-L316 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/httpsessions/HttpSession.java | HttpSession.matchesToken | public boolean matchesToken(String tokenName, HttpCookie cookie) {
"""
Checks if a particular cookie has the same value as one of the token values in the HTTP
session. If the {@literal cookie} parameter is null, the session matches the token if it does
not have a value for the corresponding token.
@param toke... | java | public boolean matchesToken(String tokenName, HttpCookie cookie) {
// Check if the cookie is null
if (cookie == null) {
return tokenValues.containsKey(tokenName) ? false : true;
}
// Check the value of the token from the cookie
String tokenValue = getTokenValue(tokenName);
if (tokenValue != null && toke... | [
"public",
"boolean",
"matchesToken",
"(",
"String",
"tokenName",
",",
"HttpCookie",
"cookie",
")",
"{",
"// Check if the cookie is null",
"if",
"(",
"cookie",
"==",
"null",
")",
"{",
"return",
"tokenValues",
".",
"containsKey",
"(",
"tokenName",
")",
"?",
"false... | Checks if a particular cookie has the same value as one of the token values in the HTTP
session. If the {@literal cookie} parameter is null, the session matches the token if it does
not have a value for the corresponding token.
@param tokenName the token name
@param cookie the cookie
@return true, if true | [
"Checks",
"if",
"a",
"particular",
"cookie",
"has",
"the",
"same",
"value",
"as",
"one",
"of",
"the",
"token",
"values",
"in",
"the",
"HTTP",
"session",
".",
"If",
"the",
"{",
"@literal",
"cookie",
"}",
"parameter",
"is",
"null",
"the",
"session",
"match... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/httpsessions/HttpSession.java#L147-L159 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getRaidInfo | public void getRaidInfo(String[] ids, Callback<List<Raid>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on raids API go <a href="https://wiki.guildwars2.com/wiki/API:2/raids">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onF... | java | public void getRaidInfo(String[] ids, Callback<List<Raid>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getRaidInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getRaidInfo",
"(",
"String",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Raid",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ids",
... | For more info on raids API go <a href="https://wiki.guildwars2.com/wiki/API:2/raids">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of raid id(s)
@param callback callback that is goin... | [
"For",
"more",
"info",
"on",
"raids",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"raids",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",
"the... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2277-L2280 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findResult | public static Object findResult(Object self, Object defaultResult, Closure closure) {
"""
Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns the defaultResult.
@param self an Object with an itera... | java | public static Object findResult(Object self, Object defaultResult, Closure closure) {
Object result = findResult(self, closure);
if (result == null) return defaultResult;
return result;
} | [
"public",
"static",
"Object",
"findResult",
"(",
"Object",
"self",
",",
"Object",
"defaultResult",
",",
"Closure",
"closure",
")",
"{",
"Object",
"result",
"=",
"findResult",
"(",
"self",
",",
"closure",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
... | Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns the defaultResult.
@param self an Object with an iterator returning its values
@param defaultResult an Object that should be returned if all closure re... | [
"Treats",
"the",
"object",
"as",
"iterable",
"iterating",
"through",
"the",
"values",
"it",
"represents",
"and",
"returns",
"the",
"first",
"non",
"-",
"null",
"result",
"obtained",
"from",
"calling",
"the",
"closure",
"otherwise",
"returns",
"the",
"defaultResu... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L3845-L3849 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java | CharSequences.equalsChars | @Deprecated
public static boolean equalsChars(CharSequence a, CharSequence b) {
"""
Utility for comparing the contents of CharSequences
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android
"""
// do length test first for fast path
return ... | java | @Deprecated
public static boolean equalsChars(CharSequence a, CharSequence b) {
// do length test first for fast path
return a.length() == b.length() && compare(a,b) == 0;
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"equalsChars",
"(",
"CharSequence",
"a",
",",
"CharSequence",
"b",
")",
"{",
"// do length test first for fast path",
"return",
"a",
".",
"length",
"(",
")",
"==",
"b",
".",
"length",
"(",
")",
"&&",
"compare",... | Utility for comparing the contents of CharSequences
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android | [
"Utility",
"for",
"comparing",
"the",
"contents",
"of",
"CharSequences"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java#L239-L243 |
WASdev/standards.jsr352.jbatch | com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/jobinstance/RuntimeJobExecution.java | RuntimeJobExecution.prepareForExecution | public void prepareForExecution(JobContextImpl jobContext, String restartOn) {
"""
/*
Non-spec'd methods (not on the interface, but maybe we should
put on a second interface).
"""
this.jobContext = jobContext;
this.jobNavigator = jobContext.getNavigator();
jobContext.setExecutionId(executionId);
... | java | public void prepareForExecution(JobContextImpl jobContext, String restartOn) {
this.jobContext = jobContext;
this.jobNavigator = jobContext.getNavigator();
jobContext.setExecutionId(executionId);
jobContext.setInstanceId(jobInstance.getInstanceId());
this.restartOn = restartOn;
operatorJobExecution.se... | [
"public",
"void",
"prepareForExecution",
"(",
"JobContextImpl",
"jobContext",
",",
"String",
"restartOn",
")",
"{",
"this",
".",
"jobContext",
"=",
"jobContext",
";",
"this",
".",
"jobNavigator",
"=",
"jobContext",
".",
"getNavigator",
"(",
")",
";",
"jobContext... | /*
Non-spec'd methods (not on the interface, but maybe we should
put on a second interface). | [
"/",
"*",
"Non",
"-",
"spec",
"d",
"methods",
"(",
"not",
"on",
"the",
"interface",
"but",
"maybe",
"we",
"should",
"put",
"on",
"a",
"second",
"interface",
")",
"."
] | train | https://github.com/WASdev/standards.jsr352.jbatch/blob/e267e79dccd4f0bd4bf9c2abc41a8a47b65be28f/com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/jobinstance/RuntimeJobExecution.java#L55-L62 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatterBuilder.java | PeriodFormatterBuilder.appendSeparator | public PeriodFormatterBuilder appendSeparator(String text, String finalText) {
"""
Append a separator, which is output if fields are printed both before
and after the separator.
<p>
This method changes the separator depending on whether it is the last separator
to be output.
<p>
For example, <code>builder.ap... | java | public PeriodFormatterBuilder appendSeparator(String text, String finalText) {
return appendSeparator(text, finalText, null, true, true);
} | [
"public",
"PeriodFormatterBuilder",
"appendSeparator",
"(",
"String",
"text",
",",
"String",
"finalText",
")",
"{",
"return",
"appendSeparator",
"(",
"text",
",",
"finalText",
",",
"null",
",",
"true",
",",
"true",
")",
";",
"}"
] | Append a separator, which is output if fields are printed both before
and after the separator.
<p>
This method changes the separator depending on whether it is the last separator
to be output.
<p>
For example, <code>builder.appendDays().appendSeparator(",", "&").appendHours().appendSeparator(",", "&").appendMinutes()</... | [
"Append",
"a",
"separator",
"which",
"is",
"output",
"if",
"fields",
"are",
"printed",
"both",
"before",
"and",
"after",
"the",
"separator",
".",
"<p",
">",
"This",
"method",
"changes",
"the",
"separator",
"depending",
"on",
"whether",
"it",
"is",
"the",
"... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatterBuilder.java#L792-L794 |
square/flow | flow/src/main/java/flow/Flow.java | Flow.setHistory | public void setHistory(@NonNull final History history, @NonNull final Direction direction) {
"""
Replaces the history with the one given and dispatches in the given direction.
"""
move(new PendingTraversal() {
@Override void doExecute() {
dispatch(preserveEquivalentPrefix(getHistory(), histor... | java | public void setHistory(@NonNull final History history, @NonNull final Direction direction) {
move(new PendingTraversal() {
@Override void doExecute() {
dispatch(preserveEquivalentPrefix(getHistory(), history), direction);
}
});
} | [
"public",
"void",
"setHistory",
"(",
"@",
"NonNull",
"final",
"History",
"history",
",",
"@",
"NonNull",
"final",
"Direction",
"direction",
")",
"{",
"move",
"(",
"new",
"PendingTraversal",
"(",
")",
"{",
"@",
"Override",
"void",
"doExecute",
"(",
")",
"{"... | Replaces the history with the one given and dispatches in the given direction. | [
"Replaces",
"the",
"history",
"with",
"the",
"one",
"given",
"and",
"dispatches",
"in",
"the",
"given",
"direction",
"."
] | train | https://github.com/square/flow/blob/1656288d1cb4a92dfbcff8276f4d7f9e3390419b/flow/src/main/java/flow/Flow.java#L197-L203 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java | HBasePanel.printHtmlFooter | public void printHtmlFooter(PrintWriter out, ResourceBundle reg) {
"""
Bottom of HTML form.
@param out The html out stream.
@param reg The resources object.
"""
String strHTML = reg.getString("htmlFooter");
if ((strHTML == null) || (strHTML.length() == 0))
strHTML = "</body>\n</ht... | java | public void printHtmlFooter(PrintWriter out, ResourceBundle reg)
{
String strHTML = reg.getString("htmlFooter");
if ((strHTML == null) || (strHTML.length() == 0))
strHTML = "</body>\n</html>";
out.println(strHTML);
out.flush();
} | [
"public",
"void",
"printHtmlFooter",
"(",
"PrintWriter",
"out",
",",
"ResourceBundle",
"reg",
")",
"{",
"String",
"strHTML",
"=",
"reg",
".",
"getString",
"(",
"\"htmlFooter\"",
")",
";",
"if",
"(",
"(",
"strHTML",
"==",
"null",
")",
"||",
"(",
"strHTML",
... | Bottom of HTML form.
@param out The html out stream.
@param reg The resources object. | [
"Bottom",
"of",
"HTML",
"form",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java#L237-L244 |
nemerosa/ontrack | ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/ui/PropertyController.java | PropertyController.deleteProperty | @RequestMapping(value = " {
"""
Deletes the value of a property.
@param entityType Type of the entity to edit
@param id ID of the entity to edit
@param propertyTypeName Fully qualified name of the property to delete
"""entityType}/{id}/{propertyTypeName}/edit", method = RequestMethod.D... | java | @RequestMapping(value = "{entityType}/{id}/{propertyTypeName}/edit", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.ACCEPTED)
public Ack deleteProperty(@PathVariable ProjectEntityType entityType, @PathVariable ID id, @PathVariable String propertyTypeName) {
return propertyService.deleteProper... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"{entityType}/{id}/{propertyTypeName}/edit\"",
",",
"method",
"=",
"RequestMethod",
".",
"DELETE",
")",
"@",
"ResponseStatus",
"(",
"HttpStatus",
".",
"ACCEPTED",
")",
"public",
"Ack",
"deleteProperty",
"(",
"@",
"PathVari... | Deletes the value of a property.
@param entityType Type of the entity to edit
@param id ID of the entity to edit
@param propertyTypeName Fully qualified name of the property to delete | [
"Deletes",
"the",
"value",
"of",
"a",
"property",
"."
] | train | https://github.com/nemerosa/ontrack/blob/37b0874cbf387b58aba95cd3c1bc3b15e11bc913/ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/ui/PropertyController.java#L127-L134 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java | TypeRegistry.getReloadableType | @UsedByGeneratedCode
public static ReloadableType getReloadableType(int typeRegistryId, int typeId) {
"""
This method discovers the reloadable type instance for the registry and type id specified.
@param typeRegistryId the type registry id
@param typeId the type id
@return the ReloadableType (if there is no ... | java | @UsedByGeneratedCode
public static ReloadableType getReloadableType(int typeRegistryId, int typeId) {
if (GlobalConfiguration.verboseMode && log.isLoggable(Level.INFO)) {
log.info(
">TypeRegistry.getReloadableType(typeRegistryId=" + typeRegistryId + ",typeId=" + typeId + ")");
}
TypeRegistry typeRegistry... | [
"@",
"UsedByGeneratedCode",
"public",
"static",
"ReloadableType",
"getReloadableType",
"(",
"int",
"typeRegistryId",
",",
"int",
"typeId",
")",
"{",
"if",
"(",
"GlobalConfiguration",
".",
"verboseMode",
"&&",
"log",
".",
"isLoggable",
"(",
"Level",
".",
"INFO",
... | This method discovers the reloadable type instance for the registry and type id specified.
@param typeRegistryId the type registry id
@param typeId the type id
@return the ReloadableType (if there is no ReloadableType an exception will be thrown) | [
"This",
"method",
"discovers",
"the",
"reloadable",
"type",
"instance",
"for",
"the",
"registry",
"and",
"type",
"id",
"specified",
"."
] | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java#L1906-L1929 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java | SimpleDateFormat.subParse | protected int subParse(String text, int start, char ch, int count,
boolean obeyCount, boolean allowNegative,
boolean[] ambiguousYear, Calendar cal) {
"""
Protected method that converts one field of the input string into a
numeric field value in <code>cal</code... | java | protected int subParse(String text, int start, char ch, int count,
boolean obeyCount, boolean allowNegative,
boolean[] ambiguousYear, Calendar cal)
{
return subParse(text, start, ch, count, obeyCount, allowNegative, ambiguousYear, cal, null, null);
} | [
"protected",
"int",
"subParse",
"(",
"String",
"text",
",",
"int",
"start",
",",
"char",
"ch",
",",
"int",
"count",
",",
"boolean",
"obeyCount",
",",
"boolean",
"allowNegative",
",",
"boolean",
"[",
"]",
"ambiguousYear",
",",
"Calendar",
"cal",
")",
"{",
... | Protected method that converts one field of the input string into a
numeric field value in <code>cal</code>. Returns -start (for
ParsePosition) if failed. Subclasses may override this method to
modify or add parsing capabilities.
@param text the time text to be parsed.
@param start where to start parsing.
@param ch t... | [
"Protected",
"method",
"that",
"converts",
"one",
"field",
"of",
"the",
"input",
"string",
"into",
"a",
"numeric",
"field",
"value",
"in",
"<code",
">",
"cal<",
"/",
"code",
">",
".",
"Returns",
"-",
"start",
"(",
"for",
"ParsePosition",
")",
"if",
"fail... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleDateFormat.java#L3038-L3043 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/AttList.java | AttList.getValue | public String getValue(String uri, String localName) {
"""
Look up an attribute's value by Namespace name.
@param uri The Namespace URI, or the empty String if the
name has no Namespace URI.
@param localName The local name of the attribute.
@return The attribute value as a string, or null if the
attribute i... | java | public String getValue(String uri, String localName)
{
Node a=m_attrs.getNamedItemNS(uri,localName);
return (a==null) ? null : a.getNodeValue();
} | [
"public",
"String",
"getValue",
"(",
"String",
"uri",
",",
"String",
"localName",
")",
"{",
"Node",
"a",
"=",
"m_attrs",
".",
"getNamedItemNS",
"(",
"uri",
",",
"localName",
")",
";",
"return",
"(",
"a",
"==",
"null",
")",
"?",
"null",
":",
"a",
".",... | Look up an attribute's value by Namespace name.
@param uri The Namespace URI, or the empty String if the
name has no Namespace URI.
@param localName The local name of the attribute.
@return The attribute value as a string, or null if the
attribute is not in the list. | [
"Look",
"up",
"an",
"attribute",
"s",
"value",
"by",
"Namespace",
"name",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/AttList.java#L217-L221 |
lucee/Lucee | core/src/main/java/lucee/commons/collection/LinkedHashMapPro.java | LinkedHashMapPro.addEntry | @Override
void addEntry(int hash, K key, V value, int bucketIndex) {
"""
This override alters behavior of superclass put method. It causes newly allocated entry to get
inserted at the end of the linked list and removes the eldest entry if appropriate.
"""
super.addEntry(hash, key, value, bucketIndex);
... | java | @Override
void addEntry(int hash, K key, V value, int bucketIndex) {
super.addEntry(hash, key, value, bucketIndex);
// Remove eldest entry if instructed
Entry<K, V> eldest = header.after;
if (removeEldestEntry(eldest)) {
removeEntryForKey(eldest.key);
}
} | [
"@",
"Override",
"void",
"addEntry",
"(",
"int",
"hash",
",",
"K",
"key",
",",
"V",
"value",
",",
"int",
"bucketIndex",
")",
"{",
"super",
".",
"addEntry",
"(",
"hash",
",",
"key",
",",
"value",
",",
"bucketIndex",
")",
";",
"// Remove eldest entry if in... | This override alters behavior of superclass put method. It causes newly allocated entry to get
inserted at the end of the linked list and removes the eldest entry if appropriate. | [
"This",
"override",
"alters",
"behavior",
"of",
"superclass",
"put",
"method",
".",
"It",
"causes",
"newly",
"allocated",
"entry",
"to",
"get",
"inserted",
"at",
"the",
"end",
"of",
"the",
"linked",
"list",
"and",
"removes",
"the",
"eldest",
"entry",
"if",
... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/collection/LinkedHashMapPro.java#L353-L362 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEventsSync.java | XMLStreamEventsSync.nextInnerElement | public boolean nextInnerElement(ElementContext parent, String childName) throws XMLException, IOException {
"""
Go to the next inner element having the given name. Return true if one is found, false if the closing tag of the parent is found.
"""
while (nextInnerElement(parent)) {
if (event.text.equals(c... | java | public boolean nextInnerElement(ElementContext parent, String childName) throws XMLException, IOException {
while (nextInnerElement(parent)) {
if (event.text.equals(childName))
return true;
}
return false;
} | [
"public",
"boolean",
"nextInnerElement",
"(",
"ElementContext",
"parent",
",",
"String",
"childName",
")",
"throws",
"XMLException",
",",
"IOException",
"{",
"while",
"(",
"nextInnerElement",
"(",
"parent",
")",
")",
"{",
"if",
"(",
"event",
".",
"text",
".",
... | Go to the next inner element having the given name. Return true if one is found, false if the closing tag of the parent is found. | [
"Go",
"to",
"the",
"next",
"inner",
"element",
"having",
"the",
"given",
"name",
".",
"Return",
"true",
"if",
"one",
"is",
"found",
"false",
"if",
"the",
"closing",
"tag",
"of",
"the",
"parent",
"is",
"found",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEventsSync.java#L63-L69 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/RestartParentResourceRemoveHandler.java | RestartParentResourceRemoveHandler.updateModel | protected void updateModel(final OperationContext context, final ModelNode operation) throws OperationFailedException {
"""
Performs the update to the persistent configuration model. This default implementation simply removes
the targeted resource.
@param context the operation context
@param operation the op... | java | protected void updateModel(final OperationContext context, final ModelNode operation) throws OperationFailedException {
// verify that the resource exist before removing it
context.readResource(PathAddress.EMPTY_ADDRESS, false);
Resource resource = context.removeResource(PathAddress.EMPTY_ADDRES... | [
"protected",
"void",
"updateModel",
"(",
"final",
"OperationContext",
"context",
",",
"final",
"ModelNode",
"operation",
")",
"throws",
"OperationFailedException",
"{",
"// verify that the resource exist before removing it",
"context",
".",
"readResource",
"(",
"PathAddress",... | Performs the update to the persistent configuration model. This default implementation simply removes
the targeted resource.
@param context the operation context
@param operation the operation
@throws OperationFailedException if there is a problem updating the model | [
"Performs",
"the",
"update",
"to",
"the",
"persistent",
"configuration",
"model",
".",
"This",
"default",
"implementation",
"simply",
"removes",
"the",
"targeted",
"resource",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/RestartParentResourceRemoveHandler.java#L62-L67 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spyRes | public static <T> Predicate<T> spyRes(Predicate<T> predicate, Box<Boolean> result) {
"""
Proxies a predicate spying for result.
@param <T> the predicate parameter type
@param predicate the predicate that will be spied
@param result a box that will be containing spied result
@return the proxied predicate
... | java | public static <T> Predicate<T> spyRes(Predicate<T> predicate, Box<Boolean> result) {
return spy(predicate, result, Box.<T>empty());
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"spyRes",
"(",
"Predicate",
"<",
"T",
">",
"predicate",
",",
"Box",
"<",
"Boolean",
">",
"result",
")",
"{",
"return",
"spy",
"(",
"predicate",
",",
"result",
",",
"Box",
".",
"<",
"T",... | Proxies a predicate spying for result.
@param <T> the predicate parameter type
@param predicate the predicate that will be spied
@param result a box that will be containing spied result
@return the proxied predicate | [
"Proxies",
"a",
"predicate",
"spying",
"for",
"result",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L494-L496 |
j256/ormlite-core | src/main/java/com/j256/ormlite/table/TableUtils.java | TableUtils.createTableIfNotExists | public static <T> int createTableIfNotExists(ConnectionSource connectionSource, Class<T> dataClass)
throws SQLException {
"""
Create a table if it does not already exist. This is not supported by all databases.
"""
Dao<T, ?> dao = DaoManager.createDao(connectionSource, dataClass);
return doCreateTable(d... | java | public static <T> int createTableIfNotExists(ConnectionSource connectionSource, Class<T> dataClass)
throws SQLException {
Dao<T, ?> dao = DaoManager.createDao(connectionSource, dataClass);
return doCreateTable(dao, true);
} | [
"public",
"static",
"<",
"T",
">",
"int",
"createTableIfNotExists",
"(",
"ConnectionSource",
"connectionSource",
",",
"Class",
"<",
"T",
">",
"dataClass",
")",
"throws",
"SQLException",
"{",
"Dao",
"<",
"T",
",",
"?",
">",
"dao",
"=",
"DaoManager",
".",
"c... | Create a table if it does not already exist. This is not supported by all databases. | [
"Create",
"a",
"table",
"if",
"it",
"does",
"not",
"already",
"exist",
".",
"This",
"is",
"not",
"supported",
"by",
"all",
"databases",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L72-L76 |
lucee/Lucee | loader/src/main/java/lucee/loader/osgi/BundleUtil.java | BundleUtil.addBundle | public static Bundle addBundle(final CFMLEngineFactory factory, final BundleContext context, final File bundle, final Log log) throws IOException, BundleException {
"""
/*
public static Bundle addBundlex(BundleContext context,File bundle, boolean start) throws
IOException, BundleException { return addBundle(cont... | java | public static Bundle addBundle(final CFMLEngineFactory factory, final BundleContext context, final File bundle, final Log log) throws IOException, BundleException {
return addBundle(factory, context, bundle.getAbsolutePath(), new FileInputStream(bundle), true, log);
} | [
"public",
"static",
"Bundle",
"addBundle",
"(",
"final",
"CFMLEngineFactory",
"factory",
",",
"final",
"BundleContext",
"context",
",",
"final",
"File",
"bundle",
",",
"final",
"Log",
"log",
")",
"throws",
"IOException",
",",
"BundleException",
"{",
"return",
"a... | /*
public static Bundle addBundlex(BundleContext context,File bundle, boolean start) throws
IOException, BundleException { return addBundle(context,bundle.getAbsolutePath(),bundle,start); } | [
"/",
"*",
"public",
"static",
"Bundle",
"addBundlex",
"(",
"BundleContext",
"context",
"File",
"bundle",
"boolean",
"start",
")",
"throws",
"IOException",
"BundleException",
"{",
"return",
"addBundle",
"(",
"context",
"bundle",
".",
"getAbsolutePath",
"()",
"bundl... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/loader/src/main/java/lucee/loader/osgi/BundleUtil.java#L45-L48 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/LevenbergMarquardt.java | LevenbergMarquardt.adjustParam | private boolean adjustParam(DenseMatrix64F X, DenseMatrix64F Y,
double prevCost) {
"""
Iterate until the difference between the costs is insignificant
or it iterates too many times
"""
// lambda adjusts how big of a step it takes
double lambda = initialLambda... | java | private boolean adjustParam(DenseMatrix64F X, DenseMatrix64F Y,
double prevCost) {
// lambda adjusts how big of a step it takes
double lambda = initialLambda;
// the difference between the current and previous cost
double difference = 1000;
... | [
"private",
"boolean",
"adjustParam",
"(",
"DenseMatrix64F",
"X",
",",
"DenseMatrix64F",
"Y",
",",
"double",
"prevCost",
")",
"{",
"// lambda adjusts how big of a step it takes\r",
"double",
"lambda",
"=",
"initialLambda",
";",
"// the difference between the current and previo... | Iterate until the difference between the costs is insignificant
or it iterates too many times | [
"Iterate",
"until",
"the",
"difference",
"between",
"the",
"costs",
"is",
"insignificant",
"or",
"it",
"iterates",
"too",
"many",
"times"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/LevenbergMarquardt.java#L158-L200 |
nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java | FontData.deriveFont | public FontData deriveFont(float size, int style) {
"""
Derive a new version of this font based on a new size
@param size The size of the new font
@param style The style of the new font
@return The new font data
"""
FontData original = getStyled(getFamilyName(), style);
FontData data = new FontData(... | java | public FontData deriveFont(float size, int style) {
FontData original = getStyled(getFamilyName(), style);
FontData data = new FontData();
data.size = size;
data.javaFont = original.javaFont.deriveFont(style, size);
data.upem = upem;
data.ansiKerning = ansiKerning;
data.charWidth = charWidth;
... | [
"public",
"FontData",
"deriveFont",
"(",
"float",
"size",
",",
"int",
"style",
")",
"{",
"FontData",
"original",
"=",
"getStyled",
"(",
"getFamilyName",
"(",
")",
",",
"style",
")",
";",
"FontData",
"data",
"=",
"new",
"FontData",
"(",
")",
";",
"data",
... | Derive a new version of this font based on a new size
@param size The size of the new font
@param style The style of the new font
@return The new font data | [
"Derive",
"a",
"new",
"version",
"of",
"this",
"font",
"based",
"on",
"a",
"new",
"size"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java#L438-L448 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.getNumberedName | protected String getNumberedName(String name, int number) {
"""
Adds a numeric suffix to the end of a string, unless the number passed as a parameter is 0.<p>
@param name the base name
@param number the number from which to form the suffix
@return the concatenation of the base name and possibly the numeric ... | java | protected String getNumberedName(String name, int number) {
if (number == 0) {
return name;
}
PrintfFormat fmt = new PrintfFormat("%0.6d");
return name + "_" + fmt.sprintf(number);
} | [
"protected",
"String",
"getNumberedName",
"(",
"String",
"name",
",",
"int",
"number",
")",
"{",
"if",
"(",
"number",
"==",
"0",
")",
"{",
"return",
"name",
";",
"}",
"PrintfFormat",
"fmt",
"=",
"new",
"PrintfFormat",
"(",
"\"%0.6d\"",
")",
";",
"return"... | Adds a numeric suffix to the end of a string, unless the number passed as a parameter is 0.<p>
@param name the base name
@param number the number from which to form the suffix
@return the concatenation of the base name and possibly the numeric suffix | [
"Adds",
"a",
"numeric",
"suffix",
"to",
"the",
"end",
"of",
"a",
"string",
"unless",
"the",
"number",
"passed",
"as",
"a",
"parameter",
"is",
"0",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L10503-L10510 |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/parser/GosuParser.java | GosuParser.maybeParseImpliedThisMethod | private boolean maybeParseImpliedThisMethod( int iOffset, int iLineNum, int iColumn, LazyLightweightParserState state, String strFunction, int markBeforeTypeArgs, int iLocBeforeTypeArgs ) {
"""
e.g., void setFoo( String value ) {} and void setFoo( Integer value ) {} are defined in the super class.
"""
if( ... | java | private boolean maybeParseImpliedThisMethod( int iOffset, int iLineNum, int iColumn, LazyLightweightParserState state, String strFunction, int markBeforeTypeArgs, int iLocBeforeTypeArgs )
{
if( getTokenizerInstructor() != null || getScriptPart() != null && TemplateGenerator.GS_TEMPLATE_PARSED.equals( getScriptPar... | [
"private",
"boolean",
"maybeParseImpliedThisMethod",
"(",
"int",
"iOffset",
",",
"int",
"iLineNum",
",",
"int",
"iColumn",
",",
"LazyLightweightParserState",
"state",
",",
"String",
"strFunction",
",",
"int",
"markBeforeTypeArgs",
",",
"int",
"iLocBeforeTypeArgs",
")"... | e.g., void setFoo( String value ) {} and void setFoo( Integer value ) {} are defined in the super class. | [
"e",
".",
"g",
".",
"void",
"setFoo",
"(",
"String",
"value",
")",
"{}",
"and",
"void",
"setFoo",
"(",
"Integer",
"value",
")",
"{}",
"are",
"defined",
"in",
"the",
"super",
"class",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/parser/GosuParser.java#L5951-L5979 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CustomerAccountUrl.java | CustomerAccountUrl.changePasswordUrl | public static MozuUrl changePasswordUrl(Integer accountId, Boolean unlockAccount, String userId) {
"""
Get Resource Url for ChangePassword
@param accountId Unique identifier of the customer account.
@param unlockAccount Specifies whether to unlock the specified customer account.
@param userId Unique identifier ... | java | public static MozuUrl changePasswordUrl(Integer accountId, Boolean unlockAccount, String userId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/Change-Password?unlockAccount={unlockAccount}&userId={userId}");
formatter.formatUrl("accountId", accountId);
formatter.for... | [
"public",
"static",
"MozuUrl",
"changePasswordUrl",
"(",
"Integer",
"accountId",
",",
"Boolean",
"unlockAccount",
",",
"String",
"userId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/customer/accounts/{accountId}/Change-Password?... | Get Resource Url for ChangePassword
@param accountId Unique identifier of the customer account.
@param unlockAccount Specifies whether to unlock the specified customer account.
@param userId Unique identifier of the user whose tenant scopes you want to retrieve.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"ChangePassword"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CustomerAccountUrl.java#L95-L102 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/utils/IoBufferDecoder.java | IoBufferDecoder.setContentLength | public void setContentLength(int contentLength, boolean resetMatchCount) {
"""
Sets the the length of the content line to be decoded.
When set, it overrides the dynamic delimiter setting and content length
method will be used for decoding on the next decodeOnce call.
The default value is <tt>-1</tt>.
@param ... | java | public void setContentLength(int contentLength, boolean resetMatchCount) {
if (contentLength <= 0) {
throw new IllegalArgumentException("contentLength: "
+ contentLength);
}
ctx.setContentLength(contentLength);
if (resetMatchCount) {
ctx.setMa... | [
"public",
"void",
"setContentLength",
"(",
"int",
"contentLength",
",",
"boolean",
"resetMatchCount",
")",
"{",
"if",
"(",
"contentLength",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"contentLength: \"",
"+",
"contentLength",
")",
";",... | Sets the the length of the content line to be decoded.
When set, it overrides the dynamic delimiter setting and content length
method will be used for decoding on the next decodeOnce call.
The default value is <tt>-1</tt>.
@param contentLength the content length to match
@param resetMatchCount delimiter matching is re... | [
"Sets",
"the",
"the",
"length",
"of",
"the",
"content",
"line",
"to",
"be",
"decoded",
".",
"When",
"set",
"it",
"overrides",
"the",
"dynamic",
"delimiter",
"setting",
"and",
"content",
"length",
"method",
"will",
"be",
"used",
"for",
"decoding",
"on",
"th... | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/IoBufferDecoder.java#L134-L144 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CPDAvailabilityEstimatePersistenceImpl.java | CPDAvailabilityEstimatePersistenceImpl.findByUUID_G | @Override
public CPDAvailabilityEstimate findByUUID_G(String uuid, long groupId)
throws NoSuchCPDAvailabilityEstimateException {
"""
Returns the cpd availability estimate where uuid = ? and groupId = ? or throws a {@link NoSuchCPDAvailabilityEstimateException} if it could not be found.
@param uuid th... | java | @Override
public CPDAvailabilityEstimate findByUUID_G(String uuid, long groupId)
throws NoSuchCPDAvailabilityEstimateException {
CPDAvailabilityEstimate cpdAvailabilityEstimate = fetchByUUID_G(uuid,
groupId);
if (cpdAvailabilityEstimate == null) {
StringBundler msg = new StringBundler(6);
msg.append(... | [
"@",
"Override",
"public",
"CPDAvailabilityEstimate",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPDAvailabilityEstimateException",
"{",
"CPDAvailabilityEstimate",
"cpdAvailabilityEstimate",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
... | Returns the cpd availability estimate where uuid = ? and groupId = ? or throws a {@link NoSuchCPDAvailabilityEstimateException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cpd availability estimate
@throws NoSuchCPDAvailabilityEstimateException if a matching ... | [
"Returns",
"the",
"cpd",
"availability",
"estimate",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPDAvailabilityEstimateException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CPDAvailabilityEstimatePersistenceImpl.java#L669-L696 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.addDateHeader | @Deprecated
public static void addDateHeader(HttpMessage message, String name, Date value) {
"""
@deprecated Use {@link #add(CharSequence, Object)} instead.
@see #addDateHeader(HttpMessage, CharSequence, Date)
"""
message.headers().add(name, value);
} | java | @Deprecated
public static void addDateHeader(HttpMessage message, String name, Date value) {
message.headers().add(name, value);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"addDateHeader",
"(",
"HttpMessage",
"message",
",",
"String",
"name",
",",
"Date",
"value",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"add",
"(",
"name",
",",
"value",
")",
";",
"}"
] | @deprecated Use {@link #add(CharSequence, Object)} instead.
@see #addDateHeader(HttpMessage, CharSequence, Date) | [
"@deprecated",
"Use",
"{",
"@link",
"#add",
"(",
"CharSequence",
"Object",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L937-L940 |
ribot/easy-adapter | library/src/main/java/uk/co/ribot/easyadapter/annotations/FieldAnnotationParser.java | FieldAnnotationParser.setViewFields | public static void setViewFields(final Object object, final Activity activity) {
"""
Parse {@link ViewId} annotation and try to assign the view with that id to the annotated field.
It will throw a {@link ClassCastException} if the field and the view with the given ID have different types.
@param object objec... | java | public static void setViewFields(final Object object, final Activity activity) {
setViewFields(object, new ViewFinder() {
@Override
public View findViewById(int viewId) {
return activity.findViewById(viewId);
}
});
} | [
"public",
"static",
"void",
"setViewFields",
"(",
"final",
"Object",
"object",
",",
"final",
"Activity",
"activity",
")",
"{",
"setViewFields",
"(",
"object",
",",
"new",
"ViewFinder",
"(",
")",
"{",
"@",
"Override",
"public",
"View",
"findViewById",
"(",
"i... | Parse {@link ViewId} annotation and try to assign the view with that id to the annotated field.
It will throw a {@link ClassCastException} if the field and the view with the given ID have different types.
@param object object where the annotation is.
@param activity activity that contains a view with the viewId give... | [
"Parse",
"{",
"@link",
"ViewId",
"}",
"annotation",
"and",
"try",
"to",
"assign",
"the",
"view",
"with",
"that",
"id",
"to",
"the",
"annotated",
"field",
".",
"It",
"will",
"throw",
"a",
"{",
"@link",
"ClassCastException",
"}",
"if",
"the",
"field",
"and... | train | https://github.com/ribot/easy-adapter/blob/8cf85023a79c781aa2013e9dc39fd66734fb2019/library/src/main/java/uk/co/ribot/easyadapter/annotations/FieldAnnotationParser.java#L49-L56 |
infinispan/infinispan | server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/RemoveAliasCommand.java | RemoveAliasCommand.removeAliasFromList | private ModelNode removeAliasFromList(ModelNode list, String alias) throws OperationFailedException {
"""
Remove an alias from a LIST ModelNode of existing aliases.
@param list LIST ModelNode of aliases
@param alias
@return LIST ModelNode with the alias removed
"""
// check for empty string
... | java | private ModelNode removeAliasFromList(ModelNode list, String alias) throws OperationFailedException {
// check for empty string
if (alias == null || alias.equals(""))
return list ;
// check for undefined list (AS7-3476)
if (!list.isDefined()) {
throw InfinispanM... | [
"private",
"ModelNode",
"removeAliasFromList",
"(",
"ModelNode",
"list",
",",
"String",
"alias",
")",
"throws",
"OperationFailedException",
"{",
"// check for empty string",
"if",
"(",
"alias",
"==",
"null",
"||",
"alias",
".",
"equals",
"(",
"\"\"",
")",
")",
"... | Remove an alias from a LIST ModelNode of existing aliases.
@param list LIST ModelNode of aliases
@param alias
@return LIST ModelNode with the alias removed | [
"Remove",
"an",
"alias",
"from",
"a",
"LIST",
"ModelNode",
"of",
"existing",
"aliases",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/RemoveAliasCommand.java#L98-L118 |
samskivert/samskivert | src/main/java/com/samskivert/util/PrefsConfig.java | PrefsConfig.setValue | public void setValue (String name, boolean value) {
"""
Sets the value of the specified preference, overriding the value defined in the
configuration files shipped with the application.
"""
Boolean oldValue = null;
if (_prefs.get(name, null) != null || _props.getProperty(name) != null) {
... | java | public void setValue (String name, boolean value)
{
Boolean oldValue = null;
if (_prefs.get(name, null) != null || _props.getProperty(name) != null) {
oldValue = Boolean.valueOf(_prefs.getBoolean(name, super.getValue(name, false)));
}
_prefs.putBoolean(name, value);
... | [
"public",
"void",
"setValue",
"(",
"String",
"name",
",",
"boolean",
"value",
")",
"{",
"Boolean",
"oldValue",
"=",
"null",
";",
"if",
"(",
"_prefs",
".",
"get",
"(",
"name",
",",
"null",
")",
"!=",
"null",
"||",
"_props",
".",
"getProperty",
"(",
"n... | Sets the value of the specified preference, overriding the value defined in the
configuration files shipped with the application. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"preference",
"overriding",
"the",
"value",
"defined",
"in",
"the",
"configuration",
"files",
"shipped",
"with",
"the",
"application",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/PrefsConfig.java#L114-L123 |
marklogic/marklogic-contentpump | mlcp/src/main/java/com/marklogic/contentpump/utilities/OptionsFileUtil.java | OptionsFileUtil.removeQuotesEncolosingOption | private static String removeQuotesEncolosingOption(
String fileName, String option) throws Exception {
"""
Removes the surrounding quote characters as needed. It first attempts to
remove surrounding double quotes. If successful, the resultant string is
returned. If no surrounding double quotes are fo... | java | private static String removeQuotesEncolosingOption(
String fileName, String option) throws Exception {
// Attempt to remove double quotes. If successful, return.
String option1 = removeQuoteCharactersIfNecessary(fileName, option, '"');
if (!option1.equals(option)) {
// Q... | [
"private",
"static",
"String",
"removeQuotesEncolosingOption",
"(",
"String",
"fileName",
",",
"String",
"option",
")",
"throws",
"Exception",
"{",
"// Attempt to remove double quotes. If successful, return.",
"String",
"option1",
"=",
"removeQuoteCharactersIfNecessary",
"(",
... | Removes the surrounding quote characters as needed. It first attempts to
remove surrounding double quotes. If successful, the resultant string is
returned. If no surrounding double quotes are found, it attempts to remove
surrounding single quote characters. If successful, the resultant string
is returned. If not the or... | [
"Removes",
"the",
"surrounding",
"quote",
"characters",
"as",
"needed",
".",
"It",
"first",
"attempts",
"to",
"remove",
"surrounding",
"double",
"quotes",
".",
"If",
"successful",
"the",
"resultant",
"string",
"is",
"returned",
".",
"If",
"no",
"surrounding",
... | train | https://github.com/marklogic/marklogic-contentpump/blob/4c41e4a953301f81a4c655efb2a847603dee8afc/mlcp/src/main/java/com/marklogic/contentpump/utilities/OptionsFileUtil.java#L129-L141 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.getValueForField | @SuppressWarnings("WeakerAccess")
@Internal
@UsedByGeneratedCode
protected final Object getValueForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex) {
"""
Obtains a value for the given field from the bean context
<p>
Warning: this method is used by internal generated... | java | @SuppressWarnings("WeakerAccess")
@Internal
@UsedByGeneratedCode
protected final Object getValueForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex) {
FieldInjectionPoint injectionPoint = fieldInjectionPoints.get(fieldIndex);
BeanResolutionContext.Path path ... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"@",
"Internal",
"@",
"UsedByGeneratedCode",
"protected",
"final",
"Object",
"getValueForField",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
"int",
"fieldIndex",
")",
"{",
... | Obtains a value for the given field from the bean context
<p>
Warning: this method is used by internal generated code and should not be called by user code.
@param resolutionContext The resolution context
@param context The context
@param fieldIndex The index of the field
@return The resolved bean | [
"Obtains",
"a",
"value",
"for",
"the",
"given",
"field",
"from",
"the",
"bean",
"context",
"<p",
">",
"Warning",
":",
"this",
"method",
"is",
"used",
"by",
"internal",
"generated",
"code",
"and",
"should",
"not",
"be",
"called",
"by",
"user",
"code",
"."... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L1161-L1200 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/selector/ExecutorComparator.java | ExecutorComparator.getMemoryComparator | private static FactorComparator<Executor> getMemoryComparator(final int weight) {
"""
<pre>
function defines the Memory comparator.
Note: comparator firstly take the absolute value of the remaining memory, if both sides have
the same value,
it go further to check the percent of the remaining memory.
</pre>
... | java | private static FactorComparator<Executor> getMemoryComparator(final int weight) {
return FactorComparator.create(MEMORY_COMPARATOR_NAME, weight, new Comparator<Executor>() {
@Override
public int compare(final Executor o1, final Executor o2) {
final ExecutorInfo stat1 = o1.getExecutorInfo();
... | [
"private",
"static",
"FactorComparator",
"<",
"Executor",
">",
"getMemoryComparator",
"(",
"final",
"int",
"weight",
")",
"{",
"return",
"FactorComparator",
".",
"create",
"(",
"MEMORY_COMPARATOR_NAME",
",",
"weight",
",",
"new",
"Comparator",
"<",
"Executor",
">"... | <pre>
function defines the Memory comparator.
Note: comparator firstly take the absolute value of the remaining memory, if both sides have
the same value,
it go further to check the percent of the remaining memory.
</pre>
@param weight weight of the comparator. | [
"<pre",
">",
"function",
"defines",
"the",
"Memory",
"comparator",
".",
"Note",
":",
"comparator",
"firstly",
"take",
"the",
"absolute",
"value",
"of",
"the",
"remaining",
"memory",
"if",
"both",
"sides",
"have",
"the",
"same",
"value",
"it",
"go",
"further"... | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/selector/ExecutorComparator.java#L226-L246 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.notEquals | @Throws(IllegalEqualException.class)
public static boolean notEquals(final boolean expected, final boolean check, @Nonnull final String message) {
"""
Ensures that a passed boolean is not equal to another boolean. The comparison is made using
<code>expected == check</code>.
@param expected
Expected value
@p... | java | @Throws(IllegalEqualException.class)
public static boolean notEquals(final boolean expected, final boolean check, @Nonnull final String message) {
if (expected == check) {
throw new IllegalEqualException(message, check);
}
return check;
} | [
"@",
"Throws",
"(",
"IllegalEqualException",
".",
"class",
")",
"public",
"static",
"boolean",
"notEquals",
"(",
"final",
"boolean",
"expected",
",",
"final",
"boolean",
"check",
",",
"@",
"Nonnull",
"final",
"String",
"message",
")",
"{",
"if",
"(",
"expect... | Ensures that a passed boolean is not equal to another boolean. The comparison is made using
<code>expected == check</code>.
@param expected
Expected value
@param check
boolean to be checked
@param message
an error message describing why the booleans must equal (will be passed to
{@code IllegalEqualException})
@return ... | [
"Ensures",
"that",
"a",
"passed",
"boolean",
"is",
"not",
"equal",
"to",
"another",
"boolean",
".",
"The",
"comparison",
"is",
"made",
"using",
"<code",
">",
"expected",
"==",
"check<",
"/",
"code",
">",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L2272-L2279 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java | DAGraph.initializeDependentKeys | private void initializeDependentKeys() {
"""
Initializes dependents of all nodes.
<p>
The DAG will be explored in DFS order and all node's dependents will be identified,
this prepares the DAG for traversal using getNext method, each call to getNext returns next node
in the DAG with no dependencies.
"""
... | java | private void initializeDependentKeys() {
visit(new Visitor<NodeT>() {
@Override
public void visitNode(NodeT node) {
if (node.dependencyKeys().isEmpty()) {
return;
}
String dependentKey = node.key();
for ... | [
"private",
"void",
"initializeDependentKeys",
"(",
")",
"{",
"visit",
"(",
"new",
"Visitor",
"<",
"NodeT",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"visitNode",
"(",
"NodeT",
"node",
")",
"{",
"if",
"(",
"node",
".",
"dependencyKeys",
"(",
... | Initializes dependents of all nodes.
<p>
The DAG will be explored in DFS order and all node's dependents will be identified,
this prepares the DAG for traversal using getNext method, each call to getNext returns next node
in the DAG with no dependencies. | [
"Initializes",
"dependents",
"of",
"all",
"nodes",
".",
"<p",
">",
"The",
"DAG",
"will",
"be",
"explored",
"in",
"DFS",
"order",
"and",
"all",
"node",
"s",
"dependents",
"will",
"be",
"identified",
"this",
"prepares",
"the",
"DAG",
"for",
"traversal",
"usi... | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/DAGraph.java#L206-L228 |
cloudinary/cloudinary_java | cloudinary-core/src/main/java/com/cloudinary/Api.java | Api.updateResourcesAccessModeByPrefix | public ApiResponse updateResourcesAccessModeByPrefix(String accessMode, String prefix, Map options) throws Exception {
"""
Update access mode of one or more resources by prefix
@param accessMode The new access mode, "public" or "authenticated"
@param prefix The prefix by which to filter applicable resourc... | java | public ApiResponse updateResourcesAccessModeByPrefix(String accessMode, String prefix, Map options) throws Exception {
return updateResourcesAccessMode(accessMode, "prefix", prefix, options);
} | [
"public",
"ApiResponse",
"updateResourcesAccessModeByPrefix",
"(",
"String",
"accessMode",
",",
"String",
"prefix",
",",
"Map",
"options",
")",
"throws",
"Exception",
"{",
"return",
"updateResourcesAccessMode",
"(",
"accessMode",
",",
"\"prefix\"",
",",
"prefix",
",",... | Update access mode of one or more resources by prefix
@param accessMode The new access mode, "public" or "authenticated"
@param prefix The prefix by which to filter applicable resources
@param options additional options
<ul>
<li>resource_type - (default "image") - the type of resources to modify</li>
<li>max_r... | [
"Update",
"access",
"mode",
"of",
"one",
"or",
"more",
"resources",
"by",
"prefix"
] | train | https://github.com/cloudinary/cloudinary_java/blob/58ee1823180da2dea6a2eb7e5cf00d5a760f8aef/cloudinary-core/src/main/java/com/cloudinary/Api.java#L496-L498 |
Impetus/Kundera | src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java | HBaseDataHandler.getObjectFromByteArray | private Object getObjectFromByteArray(EntityType entityType, byte[] value, String jpaColumnName, EntityMetadata m) {
"""
Gets the object from byte array.
@param entityType
the entity type
@param value
the value
@param jpaColumnName
the jpa column name
@param m
the m
@return the object from byte array
... | java | private Object getObjectFromByteArray(EntityType entityType, byte[] value, String jpaColumnName, EntityMetadata m)
{
if (jpaColumnName != null)
{
String fieldName = m.getFieldName(jpaColumnName);
if (fieldName != null)
{
Attribute attribute = field... | [
"private",
"Object",
"getObjectFromByteArray",
"(",
"EntityType",
"entityType",
",",
"byte",
"[",
"]",
"value",
",",
"String",
"jpaColumnName",
",",
"EntityMetadata",
"m",
")",
"{",
"if",
"(",
"jpaColumnName",
"!=",
"null",
")",
"{",
"String",
"fieldName",
"="... | Gets the object from byte array.
@param entityType
the entity type
@param value
the value
@param jpaColumnName
the jpa column name
@param m
the m
@return the object from byte array | [
"Gets",
"the",
"object",
"from",
"byte",
"array",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/admin/HBaseDataHandler.java#L969-L987 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/olap/OLAPService.java | OLAPService.deleteShard | public void deleteShard(ApplicationDefinition appDef, String shard) {
"""
Delete the shard for the given application, including all of its data. This method
is a no-op if the given shard does not exist or has no data.
@param appDef {@link ApplicationDefinition} of application.
@param shard Shard name.
... | java | public void deleteShard(ApplicationDefinition appDef, String shard) {
checkServiceState();
m_olap.deleteShard(appDef, shard);
} | [
"public",
"void",
"deleteShard",
"(",
"ApplicationDefinition",
"appDef",
",",
"String",
"shard",
")",
"{",
"checkServiceState",
"(",
")",
";",
"m_olap",
".",
"deleteShard",
"(",
"appDef",
",",
"shard",
")",
";",
"}"
] | Delete the shard for the given application, including all of its data. This method
is a no-op if the given shard does not exist or has no data.
@param appDef {@link ApplicationDefinition} of application.
@param shard Shard name. | [
"Delete",
"the",
"shard",
"for",
"the",
"given",
"application",
"including",
"all",
"of",
"its",
"data",
".",
"This",
"method",
"is",
"a",
"no",
"-",
"op",
"if",
"the",
"given",
"shard",
"does",
"not",
"exist",
"or",
"has",
"no",
"data",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/olap/OLAPService.java#L249-L252 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/ContactsApi.java | ContactsApi.getTaggingSuggestions | public Contacts getTaggingSuggestions(int page, int perPage) throws JinxException {
"""
Get suggestions for tagging people in photos based on the calling user's contacts.
<br>
This method requires authentication with 'read' permission.
@param page Optional. The page of results to return. If this argument i... | java | public Contacts getTaggingSuggestions(int page, int perPage) throws JinxException {
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.contacts.getTaggingSuggestions");
if (page > 0) {
params.put("page", Integer.toString(page));
}
if (perPage > 0) {
params.put("pe... | [
"public",
"Contacts",
"getTaggingSuggestions",
"(",
"int",
"page",
",",
"int",
"perPage",
")",
"throws",
"JinxException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"params",
".",
"put",
"(",
"\"m... | Get suggestions for tagging people in photos based on the calling user's contacts.
<br>
This method requires authentication with 'read' permission.
@param page Optional. The page of results to return. If this argument is ≤= zero, it defaults to 1.
@param perPage Optional. Number of contacts to return per page. I... | [
"Get",
"suggestions",
"for",
"tagging",
"people",
"in",
"photos",
"based",
"on",
"the",
"calling",
"user",
"s",
"contacts",
".",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"read",
"permission",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/ContactsApi.java#L143-L153 |
mangstadt/biweekly | src/main/java/biweekly/util/XmlUtils.java | XmlUtils.toWriter | public static void toWriter(Node node, Writer writer) throws TransformerException {
"""
Writes an XML node to a writer.
@param node the XML node
@param writer the writer
@throws TransformerException if there's a problem writing to the writer
"""
toWriter(node, writer, new HashMap<String, String>());
} | java | public static void toWriter(Node node, Writer writer) throws TransformerException {
toWriter(node, writer, new HashMap<String, String>());
} | [
"public",
"static",
"void",
"toWriter",
"(",
"Node",
"node",
",",
"Writer",
"writer",
")",
"throws",
"TransformerException",
"{",
"toWriter",
"(",
"node",
",",
"writer",
",",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
")",
";",
"}"
] | Writes an XML node to a writer.
@param node the XML node
@param writer the writer
@throws TransformerException if there's a problem writing to the writer | [
"Writes",
"an",
"XML",
"node",
"to",
"a",
"writer",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/XmlUtils.java#L273-L275 |
spockframework/spock | spock-core/src/main/java/spock/util/concurrent/BlockingVariable.java | BlockingVariable.get | public T get() throws InterruptedException {
"""
Blocks until a value has been set for this variable, or a timeout expires.
@return the variable's value
@throws InterruptedException if the calling thread is interrupted
"""
if (!valueReady.await((long) (timeout * 1000), TimeUnit.MILLISECONDS)) {
... | java | public T get() throws InterruptedException {
if (!valueReady.await((long) (timeout * 1000), TimeUnit.MILLISECONDS)) {
String msg = String.format("BlockingVariable.get() timed out after %1.2f seconds", timeout);
throw new SpockTimeoutError(timeout, msg);
}
return value;
} | [
"public",
"T",
"get",
"(",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"!",
"valueReady",
".",
"await",
"(",
"(",
"long",
")",
"(",
"timeout",
"*",
"1000",
")",
",",
"TimeUnit",
".",
"MILLISECONDS",
")",
")",
"{",
"String",
"msg",
"=",
"St... | Blocks until a value has been set for this variable, or a timeout expires.
@return the variable's value
@throws InterruptedException if the calling thread is interrupted | [
"Blocks",
"until",
"a",
"value",
"has",
"been",
"set",
"for",
"this",
"variable",
"or",
"a",
"timeout",
"expires",
"."
] | train | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/spock/util/concurrent/BlockingVariable.java#L110-L116 |
ops4j/org.ops4j.pax.swissbox | pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java | ServiceLookup.getService | public static <T> T getService( BundleContext bc, Class<T> type, long timeout, String filter ) {
"""
Returns a service matching the given criteria.
@param <T> class implemented or extended by the service
@param bc bundle context for accessing the OSGi registry
@param type class implemented or extended by the ... | java | public static <T> T getService( BundleContext bc, Class<T> type, long timeout, String filter )
{
return ServiceLookup.<T> getService( bc, type.getName(), timeout, filter );
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getService",
"(",
"BundleContext",
"bc",
",",
"Class",
"<",
"T",
">",
"type",
",",
"long",
"timeout",
",",
"String",
"filter",
")",
"{",
"return",
"ServiceLookup",
".",
"<",
"T",
">",
"getService",
"(",
"bc",
... | Returns a service matching the given criteria.
@param <T> class implemented or extended by the service
@param bc bundle context for accessing the OSGi registry
@param type class implemented or extended by the service
@param timeout maximum wait period in milliseconds
@param filter LDAP filter to be matched by the serv... | [
"Returns",
"a",
"service",
"matching",
"the",
"given",
"criteria",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.swissbox/blob/00b0ee16cdbe8017984a4d7ba808b10d985c5b5c/pax-swissbox-tracker/src/main/java/org/ops4j/pax/swissbox/tracker/ServiceLookup.java#L134-L137 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadPoolExecutor.java | ThreadPoolExecutor.processWorkerExit | private void processWorkerExit(Worker w, boolean completedAbruptly) {
"""
Performs cleanup and bookkeeping for a dying worker. Called
only from worker threads. Unless completedAbruptly is set,
assumes that workerCount has already been adjusted to account
for exit. This method removes thread from worker set, an... | java | private void processWorkerExit(Worker w, boolean completedAbruptly) {
if (completedAbruptly) // If abrupt, then workerCount wasn't adjusted
decrementWorkerCount();
final ReentrantLock mainLock = this.mainLock;
mainLock.lock();
try {
completedTaskCount += w.comple... | [
"private",
"void",
"processWorkerExit",
"(",
"Worker",
"w",
",",
"boolean",
"completedAbruptly",
")",
"{",
"if",
"(",
"completedAbruptly",
")",
"// If abrupt, then workerCount wasn't adjusted",
"decrementWorkerCount",
"(",
")",
";",
"final",
"ReentrantLock",
"mainLock",
... | Performs cleanup and bookkeeping for a dying worker. Called
only from worker threads. Unless completedAbruptly is set,
assumes that workerCount has already been adjusted to account
for exit. This method removes thread from worker set, and
possibly terminates the pool or replaces the worker if either
it exited due to u... | [
"Performs",
"cleanup",
"and",
"bookkeeping",
"for",
"a",
"dying",
"worker",
".",
"Called",
"only",
"from",
"worker",
"threads",
".",
"Unless",
"completedAbruptly",
"is",
"set",
"assumes",
"that",
"workerCount",
"has",
"already",
"been",
"adjusted",
"to",
"accoun... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadPoolExecutor.java#L729-L755 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Searches.java | Searches.findOne | public static <E> E findOne(Iterable<E> iterable, Predicate<E> predicate) {
"""
Searches the only matching element returning it.
@param <E> the element type parameter
@param iterable the iterable to be searched
@param predicate the predicate to be applied to each element
@throws IllegalStateException if more... | java | public static <E> E findOne(Iterable<E> iterable, Predicate<E> predicate) {
dbc.precondition(iterable != null, "cannot findOne with a null iterable");
final Iterator<E> filtered = new FilteringIterator<E>(iterable.iterator(), predicate);
return new OneElement<E>().apply(filtered);
} | [
"public",
"static",
"<",
"E",
">",
"E",
"findOne",
"(",
"Iterable",
"<",
"E",
">",
"iterable",
",",
"Predicate",
"<",
"E",
">",
"predicate",
")",
"{",
"dbc",
".",
"precondition",
"(",
"iterable",
"!=",
"null",
",",
"\"cannot findOne with a null iterable\"",
... | Searches the only matching element returning it.
@param <E> the element type parameter
@param iterable the iterable to be searched
@param predicate the predicate to be applied to each element
@throws IllegalStateException if more than one element is found
@throws IllegalArgumentException if no element matches
@return ... | [
"Searches",
"the",
"only",
"matching",
"element",
"returning",
"it",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Searches.java#L525-L529 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listMultiRolePoolSkusAsync | public Observable<Page<SkuInfoInner>> listMultiRolePoolSkusAsync(final String resourceGroupName, final String name) {
"""
Get available SKUs for scaling a multi-role pool.
Get available SKUs for scaling a multi-role pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@para... | java | public Observable<Page<SkuInfoInner>> listMultiRolePoolSkusAsync(final String resourceGroupName, final String name) {
return listMultiRolePoolSkusWithServiceResponseAsync(resourceGroupName, name)
.map(new Func1<ServiceResponse<Page<SkuInfoInner>>, Page<SkuInfoInner>>() {
@Override
... | [
"public",
"Observable",
"<",
"Page",
"<",
"SkuInfoInner",
">",
">",
"listMultiRolePoolSkusAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"listMultiRolePoolSkusWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Get available SKUs for scaling a multi-role pool.
Get available SKUs for scaling a multi-role pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the o... | [
"Get",
"available",
"SKUs",
"for",
"scaling",
"a",
"multi",
"-",
"role",
"pool",
".",
"Get",
"available",
"SKUs",
"for",
"scaling",
"a",
"multi",
"-",
"role",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L3412-L3420 |
gliga/ekstazi | ekstazi-maven-plugin/src/main/java/org/ekstazi/maven/StaticSelectEkstaziMojo.java | StaticSelectEkstaziMojo.appendExcludesListToExcludesFile | private void appendExcludesListToExcludesFile(Plugin plugin, List<String> nonAffectedClasses) throws MojoExecutionException {
"""
Appends list of classes that should be excluded to the given
file.
"""
String excludesFileName = extractParamValue(plugin, EXCLUDES_FILE_PARAM_NAME);
File excludesF... | java | private void appendExcludesListToExcludesFile(Plugin plugin, List<String> nonAffectedClasses) throws MojoExecutionException {
String excludesFileName = extractParamValue(plugin, EXCLUDES_FILE_PARAM_NAME);
File excludesFileFile = new File(excludesFileName);
// First restore file in case it has b... | [
"private",
"void",
"appendExcludesListToExcludesFile",
"(",
"Plugin",
"plugin",
",",
"List",
"<",
"String",
">",
"nonAffectedClasses",
")",
"throws",
"MojoExecutionException",
"{",
"String",
"excludesFileName",
"=",
"extractParamValue",
"(",
"plugin",
",",
"EXCLUDES_FIL... | Appends list of classes that should be excluded to the given
file. | [
"Appends",
"list",
"of",
"classes",
"that",
"should",
"be",
"excluded",
"to",
"the",
"given",
"file",
"."
] | train | https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/ekstazi-maven-plugin/src/main/java/org/ekstazi/maven/StaticSelectEkstaziMojo.java#L190-L218 |
misha/iroh | src/main/java/com/github/msoliter/iroh/container/services/Injector.java | Injector.lazilyInject | public void lazilyInject(Object target, Field field) {
"""
Lazily injects the target object's target field.
@param target The target object containing the field to be injected.
@param field The target field to be injected in the target object.
"""
field.setAccessible(true);
... | java | public void lazilyInject(Object target, Field field) {
field.setAccessible(true);
/**
* We don't need to check for an
* {@link com.github.msoliter.iroh.container.annotations.Autowired}
* annotation because only those fields are capable of having a
*... | [
"public",
"void",
"lazilyInject",
"(",
"Object",
"target",
",",
"Field",
"field",
")",
"{",
"field",
".",
"setAccessible",
"(",
"true",
")",
";",
"/**\n * We don't need to check for an \n * {@link com.github.msoliter.iroh.container.annotations.Autowired}\n ... | Lazily injects the target object's target field.
@param target The target object containing the field to be injected.
@param field The target field to be injected in the target object. | [
"Lazily",
"injects",
"the",
"target",
"object",
"s",
"target",
"field",
"."
] | train | https://github.com/misha/iroh/blob/5dc92a01d3b2f3ba63e8ad1bf9b5fe342d0b679a/src/main/java/com/github/msoliter/iroh/container/services/Injector.java#L104-L119 |
wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java | RadialPickerLayout.reselectSelector | private void reselectSelector(Timepoint newSelection, boolean forceDrawDot, int index) {
"""
For the currently showing view (either hours, minutes or seconds), re-calculate the position
for the selector, and redraw it at that position. The text representing the currently
selected value will be redrawn if require... | java | private void reselectSelector(Timepoint newSelection, boolean forceDrawDot, int index) {
switch(index) {
case HOUR_INDEX:
// The selection might have changed, recalculate the degrees and innerCircle values
int hour = newSelection.getHour();
boolean isI... | [
"private",
"void",
"reselectSelector",
"(",
"Timepoint",
"newSelection",
",",
"boolean",
"forceDrawDot",
",",
"int",
"index",
")",
"{",
"switch",
"(",
"index",
")",
"{",
"case",
"HOUR_INDEX",
":",
"// The selection might have changed, recalculate the degrees and innerCirc... | For the currently showing view (either hours, minutes or seconds), re-calculate the position
for the selector, and redraw it at that position. The text representing the currently
selected value will be redrawn if required.
@param newSelection Timpoint - Time which should be selected.
@param forceDrawDot The dot in the ... | [
"For",
"the",
"currently",
"showing",
"view",
"(",
"either",
"hours",
"minutes",
"or",
"seconds",
")",
"re",
"-",
"calculate",
"the",
"position",
"for",
"the",
"selector",
"and",
"redraw",
"it",
"at",
"that",
"position",
".",
"The",
"text",
"representing",
... | train | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/RadialPickerLayout.java#L458-L517 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/optics/lenses/MapLens.java | MapLens.asCopy | public static <M extends Map<K, V>, K, V> Lens<Map<K, V>, M, M, M> asCopy(
Function<? super Map<K, V>, ? extends M> copyFn) {
"""
A lens that focuses on a copy of a {@link Map} as a subtype <code>M</code>. Useful for composition to avoid
mutating a map reference.
@param <M> the map subtype
@par... | java | public static <M extends Map<K, V>, K, V> Lens<Map<K, V>, M, M, M> asCopy(
Function<? super Map<K, V>, ? extends M> copyFn) {
return lens(copyFn, (__, copy) -> copy);
} | [
"public",
"static",
"<",
"M",
"extends",
"Map",
"<",
"K",
",",
"V",
">",
",",
"K",
",",
"V",
">",
"Lens",
"<",
"Map",
"<",
"K",
",",
"V",
">",
",",
"M",
",",
"M",
",",
"M",
">",
"asCopy",
"(",
"Function",
"<",
"?",
"super",
"Map",
"<",
"K... | A lens that focuses on a copy of a {@link Map} as a subtype <code>M</code>. Useful for composition to avoid
mutating a map reference.
@param <M> the map subtype
@param <K> the key type
@param <V> the value type
@param copyFn the copy function
@return a lens that focuses on copies of maps as a specific subtype | [
"A",
"lens",
"that",
"focuses",
"on",
"a",
"copy",
"of",
"a",
"{",
"@link",
"Map",
"}",
"as",
"a",
"subtype",
"<code",
">",
"M<",
"/",
"code",
">",
".",
"Useful",
"for",
"composition",
"to",
"avoid",
"mutating",
"a",
"map",
"reference",
"."
] | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/optics/lenses/MapLens.java#L49-L52 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java | CDKMCS.getSubgraphMaps | public static List<List<CDKRMap>> getSubgraphMaps(IAtomContainer sourceGraph, IAtomContainer targetGraph,
boolean shouldMatchBonds) throws CDKException {
"""
Returns all the subgraph 'bondA1 mappings' found for targetGraph in sourceGraph.
This is an ArrayList of ArrayLists of CDKRMap objects.
@para... | java | public static List<List<CDKRMap>> getSubgraphMaps(IAtomContainer sourceGraph, IAtomContainer targetGraph,
boolean shouldMatchBonds) throws CDKException {
return search(sourceGraph, targetGraph, new BitSet(), getBitSet(targetGraph), true, true, shouldMatchBonds);
} | [
"public",
"static",
"List",
"<",
"List",
"<",
"CDKRMap",
">",
">",
"getSubgraphMaps",
"(",
"IAtomContainer",
"sourceGraph",
",",
"IAtomContainer",
"targetGraph",
",",
"boolean",
"shouldMatchBonds",
")",
"throws",
"CDKException",
"{",
"return",
"search",
"(",
"sour... | Returns all the subgraph 'bondA1 mappings' found for targetGraph in sourceGraph.
This is an ArrayList of ArrayLists of CDKRMap objects.
@param sourceGraph first molecule. Must not be an IQueryAtomContainer.
@param targetGraph second molecule. May be an IQueryAtomContainer.
@param shouldMatchBonds
@return the l... | [
"Returns",
"all",
"the",
"subgraph",
"bondA1",
"mappings",
"found",
"for",
"targetGraph",
"in",
"sourceGraph",
".",
"This",
"is",
"an",
"ArrayList",
"of",
"ArrayLists",
"of",
"CDKRMap",
"objects",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKMCS.java#L266-L269 |
liferay/com-liferay-commerce | commerce-currency-api/src/main/java/com/liferay/commerce/currency/service/persistence/CommerceCurrencyUtil.java | CommerceCurrencyUtil.removeByG_C | public static CommerceCurrency removeByG_C(long groupId, String code)
throws com.liferay.commerce.currency.exception.NoSuchCurrencyException {
"""
Removes the commerce currency where groupId = ? and code = ? from the database.
@param groupId the group ID
@param code the code
@return the commerce cur... | java | public static CommerceCurrency removeByG_C(long groupId, String code)
throws com.liferay.commerce.currency.exception.NoSuchCurrencyException {
return getPersistence().removeByG_C(groupId, code);
} | [
"public",
"static",
"CommerceCurrency",
"removeByG_C",
"(",
"long",
"groupId",
",",
"String",
"code",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"currency",
".",
"exception",
".",
"NoSuchCurrencyException",
"{",
"return",
"getPersistence",
"(",
... | Removes the commerce currency where groupId = ? and code = ? from the database.
@param groupId the group ID
@param code the code
@return the commerce currency that was removed | [
"Removes",
"the",
"commerce",
"currency",
"where",
"groupId",
"=",
"?",
";",
"and",
"code",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-api/src/main/java/com/liferay/commerce/currency/service/persistence/CommerceCurrencyUtil.java#L707-L710 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/fit/OurColumnFixture.java | OurColumnFixture.getStringArg | protected String getStringArg(int index, String defaultValue) {
"""
Gets fixture parameter (i.e. extra column in header row).
Please note this can not be called from a constructor, as the parameters will not have been initialized yet!
@param index index (zero based) to get value from.
@param defaultValue value ... | java | protected String getStringArg(int index, String defaultValue) {
String result = defaultValue;
String[] arg = getArgs();
if (arg != null) {
if (arg.length > index) {
result = arg[index];
}
}
return result;
} | [
"protected",
"String",
"getStringArg",
"(",
"int",
"index",
",",
"String",
"defaultValue",
")",
"{",
"String",
"result",
"=",
"defaultValue",
";",
"String",
"[",
"]",
"arg",
"=",
"getArgs",
"(",
")",
";",
"if",
"(",
"arg",
"!=",
"null",
")",
"{",
"if",... | Gets fixture parameter (i.e. extra column in header row).
Please note this can not be called from a constructor, as the parameters will not have been initialized yet!
@param index index (zero based) to get value from.
@param defaultValue value to use if parameter is not present.
@return parameter value, if present, def... | [
"Gets",
"fixture",
"parameter",
"(",
"i",
".",
"e",
".",
"extra",
"column",
"in",
"header",
"row",
")",
".",
"Please",
"note",
"this",
"can",
"not",
"be",
"called",
"from",
"a",
"constructor",
"as",
"the",
"parameters",
"will",
"not",
"have",
"been",
"... | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/fit/OurColumnFixture.java#L75-L84 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/utils/social/ConnectionUtils.java | ConnectionUtils.removeConnectionData | public static void removeConnectionData(Profile profile, String providerId) {
"""
Remove all {@link ConnectionData} associated to the specified provider ID.
@param profile the profile where to remove the data from
@param providerId the provider ID of the connection
"""
Map<String, List<Map... | java | public static void removeConnectionData(Profile profile, String providerId) {
Map<String, List<Map<String, Object>>> allConnections = profile.getAttribute(CONNECTIONS_ATTRIBUTE_NAME);
if (MapUtils.isNotEmpty(allConnections)) {
allConnections.remove(providerId);
}
} | [
"public",
"static",
"void",
"removeConnectionData",
"(",
"Profile",
"profile",
",",
"String",
"providerId",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
">",
"allConnections",
"=",
"profile",
".",
"getAtt... | Remove all {@link ConnectionData} associated to the specified provider ID.
@param profile the profile where to remove the data from
@param providerId the provider ID of the connection | [
"Remove",
"all",
"{",
"@link",
"ConnectionData",
"}",
"associated",
"to",
"the",
"specified",
"provider",
"ID",
"."
] | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/utils/social/ConnectionUtils.java#L179-L184 |
alibaba/java-dns-cache-manipulator | library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java | DnsCacheManipulator.getWholeDnsCache | public static DnsCache getWholeDnsCache() {
"""
Get whole dns cache info.
@return dns cache entries
@throws DnsCacheManipulatorException Operation fail
@since 1.2.0
"""
try {
return InetAddressCacheUtil.listInetAddressCache();
} catch (Exception e) {
throw new DnsCa... | java | public static DnsCache getWholeDnsCache() {
try {
return InetAddressCacheUtil.listInetAddressCache();
} catch (Exception e) {
throw new DnsCacheManipulatorException("Fail to getWholeDnsCache, cause: " + e.toString(), e);
}
} | [
"public",
"static",
"DnsCache",
"getWholeDnsCache",
"(",
")",
"{",
"try",
"{",
"return",
"InetAddressCacheUtil",
".",
"listInetAddressCache",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"DnsCacheManipulatorException",
"(",
"\"Fa... | Get whole dns cache info.
@return dns cache entries
@throws DnsCacheManipulatorException Operation fail
@since 1.2.0 | [
"Get",
"whole",
"dns",
"cache",
"info",
"."
] | train | https://github.com/alibaba/java-dns-cache-manipulator/blob/eab50ee5c27671f9159b55458301f9429b2fcc47/library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java#L177-L183 |
citrusframework/citrus | modules/citrus-integration/src/it/java/com/consol/citrus/rmi/HelloServiceClient.java | HelloServiceClient.sayHello | public BeanInvocation sayHello(String message) {
"""
Creates bean invocation for hello service call.
@param message
@return
"""
BeanInvocation invocation = new BeanInvocation();
try {
invocation.setMethod(HelloService.class.getMethod("sayHello", String.class));
invocat... | java | public BeanInvocation sayHello(String message) {
BeanInvocation invocation = new BeanInvocation();
try {
invocation.setMethod(HelloService.class.getMethod("sayHello", String.class));
invocation.setArgs(new Object[] { message });
} catch (NoSuchMethodException e) {
... | [
"public",
"BeanInvocation",
"sayHello",
"(",
"String",
"message",
")",
"{",
"BeanInvocation",
"invocation",
"=",
"new",
"BeanInvocation",
"(",
")",
";",
"try",
"{",
"invocation",
".",
"setMethod",
"(",
"HelloService",
".",
"class",
".",
"getMethod",
"(",
"\"sa... | Creates bean invocation for hello service call.
@param message
@return | [
"Creates",
"bean",
"invocation",
"for",
"hello",
"service",
"call",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-integration/src/it/java/com/consol/citrus/rmi/HelloServiceClient.java#L32-L41 |
stratosphere/stratosphere | stratosphere-addons/hbase/src/main/java/eu/stratosphere/addons/hbase/TableInputFormat.java | TableInputFormat.createTable | protected HTable createTable(Configuration parameters) {
"""
Create an {@link HTable} instance and set it into this format.
@param parameters
a {@link Configuration} that holds at least the table name.
"""
String configLocation = parameters.getString(TableInputFormat.CONFIG_LOCATION, null);
LOG.info("G... | java | protected HTable createTable(Configuration parameters) {
String configLocation = parameters.getString(TableInputFormat.CONFIG_LOCATION, null);
LOG.info("Got config location: " + configLocation);
if (configLocation != null)
{
org.apache.hadoop.conf.Configuration dummyConf = new org.apache.hadoop.conf.Configur... | [
"protected",
"HTable",
"createTable",
"(",
"Configuration",
"parameters",
")",
"{",
"String",
"configLocation",
"=",
"parameters",
".",
"getString",
"(",
"TableInputFormat",
".",
"CONFIG_LOCATION",
",",
"null",
")",
";",
"LOG",
".",
"info",
"(",
"\"Got config loca... | Create an {@link HTable} instance and set it into this format.
@param parameters
a {@link Configuration} that holds at least the table name. | [
"Create",
"an",
"{",
"@link",
"HTable",
"}",
"instance",
"and",
"set",
"it",
"into",
"this",
"format",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/hbase/src/main/java/eu/stratosphere/addons/hbase/TableInputFormat.java#L174-L199 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/ServerCache.java | ServerCache.normalizeCacheName | @Trivial
public static String normalizeCacheName(String cacheName, CacheConfig cacheConfig) {
"""
Since the cache instances are stored with key as cacheName, it has to change default cache JNDI name to internal
cache name.
"""
String tempCacheName = cacheName;
if (cacheName.equalsIgnoreC... | java | @Trivial
public static String normalizeCacheName(String cacheName, CacheConfig cacheConfig) {
String tempCacheName = cacheName;
if (cacheName.equalsIgnoreCase(DCacheBase.DEFAULT_BASE_JNDI_NAME)) {
tempCacheName = DCacheBase.DEFAULT_CACHE_NAME;
} else if (cacheName.equalsIgnore... | [
"@",
"Trivial",
"public",
"static",
"String",
"normalizeCacheName",
"(",
"String",
"cacheName",
",",
"CacheConfig",
"cacheConfig",
")",
"{",
"String",
"tempCacheName",
"=",
"cacheName",
";",
"if",
"(",
"cacheName",
".",
"equalsIgnoreCase",
"(",
"DCacheBase",
".",
... | Since the cache instances are stored with key as cacheName, it has to change default cache JNDI name to internal
cache name. | [
"Since",
"the",
"cache",
"instances",
"are",
"stored",
"with",
"key",
"as",
"cacheName",
"it",
"has",
"to",
"change",
"default",
"cache",
"JNDI",
"name",
"to",
"internal",
"cache",
"name",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/ServerCache.java#L371-L393 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ModifyColumnFamiliesRequest.java | ModifyColumnFamiliesRequest.addFamily | public ModifyColumnFamiliesRequest addFamily(String familyId, GCRule gcRule) {
"""
Configures the name and GcRule of the new ColumnFamily to be created
@param familyId
@param gcRule
@return
"""
Preconditions.checkNotNull(gcRule);
Modification.Builder modification = Modification.newBuilder().setId(... | java | public ModifyColumnFamiliesRequest addFamily(String familyId, GCRule gcRule) {
Preconditions.checkNotNull(gcRule);
Modification.Builder modification = Modification.newBuilder().setId(familyId);
modification.getCreateBuilder().setGcRule(gcRule.toProto());
modFamilyRequest.addModifications(modification.bu... | [
"public",
"ModifyColumnFamiliesRequest",
"addFamily",
"(",
"String",
"familyId",
",",
"GCRule",
"gcRule",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"gcRule",
")",
";",
"Modification",
".",
"Builder",
"modification",
"=",
"Modification",
".",
"newBuilder",... | Configures the name and GcRule of the new ColumnFamily to be created
@param familyId
@param gcRule
@return | [
"Configures",
"the",
"name",
"and",
"GcRule",
"of",
"the",
"new",
"ColumnFamily",
"to",
"be",
"created"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ModifyColumnFamiliesRequest.java#L72-L78 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/internal/provisioning/api/UsersApi.java | UsersApi.addUserAsync | public com.squareup.okhttp.Call addUserAsync(AddUserData body, final ApiCallback<CreateUserSuccessResponse> callback) throws ApiException {
"""
Create a user. (asynchronously)
Create a user ([CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson)) with the specified attributes.
@... | java | public com.squareup.okhttp.Call addUserAsync(AddUserData body, final ApiCallback<CreateUserSuccessResponse> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback !=... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"addUserAsync",
"(",
"AddUserData",
"body",
",",
"final",
"ApiCallback",
"<",
"CreateUserSuccessResponse",
">",
"callback",
")",
"throws",
"ApiException",
"{",
"ProgressResponseBody",
".",
"ProgressListen... | Create a user. (asynchronously)
Create a user ([CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson)) with the specified attributes.
@param body Body Data (required)
@param callback The callback to be executed when the API call finishes
@return The request call
@throws ApiException If... | [
"Create",
"a",
"user",
".",
"(",
"asynchronously",
")",
"Create",
"a",
"user",
"(",
"[",
"CfgPerson",
"]",
"(",
"https",
":",
"//",
"docs",
".",
"genesys",
".",
"com",
"/",
"Documentation",
"/",
"PSDK",
"/",
"latest",
"/",
"ConfigLayerRef",
"/",
"CfgPe... | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/UsersApi.java#L158-L183 |
j-easy/easy-batch | easybatch-extensions/easybatch-quartz/src/main/java/org/easybatch/extensions/quartz/JobScheduler.java | JobScheduler.scheduleCron | public void scheduleCron(final org.easybatch.core.job.Job job, final String cronExpression) throws JobSchedulerException {
"""
Schedule a job with a unix-like cron expression.
@param job the job to schedule
@param cronExpression the cron expression to use.
For a complete tutorial about cron express... | java | public void scheduleCron(final org.easybatch.core.job.Job job, final String cronExpression) throws JobSchedulerException {
checkNotNull(job, "job");
checkNotNull(cronExpression, "cronExpression");
String name = job.getName();
String jobName = JOB_NAME_PREFIX + name;
String trigg... | [
"public",
"void",
"scheduleCron",
"(",
"final",
"org",
".",
"easybatch",
".",
"core",
".",
"job",
".",
"Job",
"job",
",",
"final",
"String",
"cronExpression",
")",
"throws",
"JobSchedulerException",
"{",
"checkNotNull",
"(",
"job",
",",
"\"job\"",
")",
";",
... | Schedule a job with a unix-like cron expression.
@param job the job to schedule
@param cronExpression the cron expression to use.
For a complete tutorial about cron expressions, please refer to
<a href="http://quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/crontrigger">quartz reference documentat... | [
"Schedule",
"a",
"job",
"with",
"a",
"unix",
"-",
"like",
"cron",
"expression",
"."
] | train | https://github.com/j-easy/easy-batch/blob/46286e1091dae1206674e2a30e0609c31feae36c/easybatch-extensions/easybatch-quartz/src/main/java/org/easybatch/extensions/quartz/JobScheduler.java#L273-L295 |
Azure/azure-sdk-for-java | privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java | VirtualNetworkLinksInner.createOrUpdate | public VirtualNetworkLinkInner createOrUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch) {
"""
Creates or updates a virtual network link to the specified Private DNS zone.
@param resourceGroupName The n... | java | public VirtualNetworkLinkInner createOrUpdate(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch, String ifNoneMatch) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, param... | [
"public",
"VirtualNetworkLinkInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"privateZoneName",
",",
"String",
"virtualNetworkLinkName",
",",
"VirtualNetworkLinkInner",
"parameters",
",",
"String",
"ifMatch",
",",
"String",
"ifNoneMatch",
")",
... | Creates or updates a virtual network link to the specified Private DNS zone.
@param resourceGroupName The name of the resource group.
@param privateZoneName The name of the Private DNS zone (without a terminating dot).
@param virtualNetworkLinkName The name of the virtual network link.
@param parameters Parameters sup... | [
"Creates",
"or",
"updates",
"a",
"virtual",
"network",
"link",
"to",
"the",
"specified",
"Private",
"DNS",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java#L202-L204 |
blackducksoftware/blackduck-common | src/main/java/com/synopsys/integration/blackduck/service/PolicyRuleService.java | PolicyRuleService.createPolicyRuleForExternalId | public String createPolicyRuleForExternalId(ComponentService componentService, ExternalId externalId, String policyName) throws IntegrationException {
"""
This will create a policy rule that will be violated by the existence of a matching external id in the project's BOM.
"""
Optional<ComponentVersionV... | java | public String createPolicyRuleForExternalId(ComponentService componentService, ExternalId externalId, String policyName) throws IntegrationException {
Optional<ComponentVersionView> componentVersionView = componentService.getComponentVersion(externalId);
if (!componentVersionView.isPresent()) {
... | [
"public",
"String",
"createPolicyRuleForExternalId",
"(",
"ComponentService",
"componentService",
",",
"ExternalId",
"externalId",
",",
"String",
"policyName",
")",
"throws",
"IntegrationException",
"{",
"Optional",
"<",
"ComponentVersionView",
">",
"componentVersionView",
... | This will create a policy rule that will be violated by the existence of a matching external id in the project's BOM. | [
"This",
"will",
"create",
"a",
"policy",
"rule",
"that",
"will",
"be",
"violated",
"by",
"the",
"existence",
"of",
"a",
"matching",
"external",
"id",
"in",
"the",
"project",
"s",
"BOM",
"."
] | train | https://github.com/blackducksoftware/blackduck-common/blob/4ea4e90b52b75470b71c597b65cf4e2d73887bcc/src/main/java/com/synopsys/integration/blackduck/service/PolicyRuleService.java#L62-L79 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/libcore/io/IoUtils.java | IoUtils.setBlocking | public static void setBlocking(FileDescriptor fd, boolean blocking) throws IOException {
"""
Sets 'fd' to be blocking or non-blocking, according to the state of 'blocking'.
"""
try {
int flags = Libcore.os.fcntlVoid(fd, F_GETFL);
if (!blocking) {
flags |= O_NONBL... | java | public static void setBlocking(FileDescriptor fd, boolean blocking) throws IOException {
try {
int flags = Libcore.os.fcntlVoid(fd, F_GETFL);
if (!blocking) {
flags |= O_NONBLOCK;
} else {
flags &= ~O_NONBLOCK;
}
Libcore... | [
"public",
"static",
"void",
"setBlocking",
"(",
"FileDescriptor",
"fd",
",",
"boolean",
"blocking",
")",
"throws",
"IOException",
"{",
"try",
"{",
"int",
"flags",
"=",
"Libcore",
".",
"os",
".",
"fcntlVoid",
"(",
"fd",
",",
"F_GETFL",
")",
";",
"if",
"("... | Sets 'fd' to be blocking or non-blocking, according to the state of 'blocking'. | [
"Sets",
"fd",
"to",
"be",
"blocking",
"or",
"non",
"-",
"blocking",
"according",
"to",
"the",
"state",
"of",
"blocking",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/libcore/io/IoUtils.java#L87-L99 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optIntArray | @Nullable
public static int[] optIntArray(@Nullable Bundle bundle, @Nullable String key) {
"""
Returns a optional int array value. In other words, returns the value mapped by key if it exists and is a int array.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null... | java | @Nullable
public static int[] optIntArray(@Nullable Bundle bundle, @Nullable String key) {
return optIntArray(bundle, key, new int[0]);
} | [
"@",
"Nullable",
"public",
"static",
"int",
"[",
"]",
"optIntArray",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
")",
"{",
"return",
"optIntArray",
"(",
"bundle",
",",
"key",
",",
"new",
"int",
"[",
"0",
"]",
")",
... | Returns a optional int array value. In other words, returns the value mapped by key if it exists and is a int array.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null.
@param bundle a bundle. If the bundle is null, this method will return null.
@param key a key for the v... | [
"Returns",
"a",
"optional",
"int",
"array",
"value",
".",
"In",
"other",
"words",
"returns",
"the",
"value",
"mapped",
"by",
"key",
"if",
"it",
"exists",
"and",
"is",
"a",
"int",
"array",
".",
"The",
"bundle",
"argument",
"is",
"allowed",
"to",
"be",
"... | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L569-L572 |
JodaOrg/joda-time | src/main/java/org/joda/time/convert/StringConverter.java | StringConverter.setInto | public void setInto(ReadWritablePeriod period, Object object, Chronology chrono) {
"""
Extracts duration values from an object of this converter's type, and
sets them into the given ReadWritableDuration.
@param period period to get modified
@param object the String to convert, must not be null
@param chron... | java | public void setInto(ReadWritablePeriod period, Object object, Chronology chrono) {
String str = (String) object;
PeriodFormatter parser = ISOPeriodFormat.standard();
period.clear();
int pos = parser.parseInto(period, str, 0);
if (pos < str.length()) {
if (pos < 0) {
... | [
"public",
"void",
"setInto",
"(",
"ReadWritablePeriod",
"period",
",",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"String",
"str",
"=",
"(",
"String",
")",
"object",
";",
"PeriodFormatter",
"parser",
"=",
"ISOPeriodFormat",
".",
"standard",
"("... | Extracts duration values from an object of this converter's type, and
sets them into the given ReadWritableDuration.
@param period period to get modified
@param object the String to convert, must not be null
@param chrono the chronology to use
@return the millisecond duration
@throws ClassCastException if the objec... | [
"Extracts",
"duration",
"values",
"from",
"an",
"object",
"of",
"this",
"converter",
"s",
"type",
"and",
"sets",
"them",
"into",
"the",
"given",
"ReadWritableDuration",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/StringConverter.java#L161-L173 |
alkacon/opencms-core | src/org/opencms/relations/CmsCategoryService.java | CmsCategoryService.getCategory | public CmsCategory getCategory(CmsObject cms, String categoryRootPath) throws CmsException {
"""
Creates a category from the given category root path.<p>
@param cms the cms context
@param categoryRootPath the category root path
@return a category object
@throws CmsException if something goes wrong
""... | java | public CmsCategory getCategory(CmsObject cms, String categoryRootPath) throws CmsException {
CmsResource resource = cms.readResource(cms.getRequestContext().removeSiteRoot(categoryRootPath));
return getCategory(cms, resource);
} | [
"public",
"CmsCategory",
"getCategory",
"(",
"CmsObject",
"cms",
",",
"String",
"categoryRootPath",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"resource",
"=",
"cms",
".",
"readResource",
"(",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"removeSiteRoot... | Creates a category from the given category root path.<p>
@param cms the cms context
@param categoryRootPath the category root path
@return a category object
@throws CmsException if something goes wrong | [
"Creates",
"a",
"category",
"from",
"the",
"given",
"category",
"root",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsCategoryService.java#L293-L297 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/BatchTask.java | BatchTask.openChainedTasks | public static void openChainedTasks(List<ChainedDriver<?, ?>> tasks, AbstractInvokable parent) throws Exception {
"""
Opens all chained tasks, in the order as they are stored in the array. The opening process
creates a standardized log info message.
@param tasks The tasks to be opened.
@param parent The paren... | java | public static void openChainedTasks(List<ChainedDriver<?, ?>> tasks, AbstractInvokable parent) throws Exception {
// start all chained tasks
for (int i = 0; i < tasks.size(); i++) {
final ChainedDriver<?, ?> task = tasks.get(i);
if (LOG.isDebugEnabled()) {
LOG.debug(constructLogString("Start task code", t... | [
"public",
"static",
"void",
"openChainedTasks",
"(",
"List",
"<",
"ChainedDriver",
"<",
"?",
",",
"?",
">",
">",
"tasks",
",",
"AbstractInvokable",
"parent",
")",
"throws",
"Exception",
"{",
"// start all chained tasks",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Opens all chained tasks, in the order as they are stored in the array. The opening process
creates a standardized log info message.
@param tasks The tasks to be opened.
@param parent The parent task, used to obtain parameters to include in the log message.
@throws Exception Thrown, if the opening encounters an excepti... | [
"Opens",
"all",
"chained",
"tasks",
"in",
"the",
"order",
"as",
"they",
"are",
"stored",
"in",
"the",
"array",
".",
"The",
"opening",
"process",
"creates",
"a",
"standardized",
"log",
"info",
"message",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/BatchTask.java#L1384-L1393 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/ColumnLayoutExample.java | ColumnLayoutExample.addResponsiveExample | private void addResponsiveExample() {
"""
Add a column layout which will change its rendering on small screens.
"""
add(new WHeading(HeadingLevel.H2, "Default responsive design"));
add(new ExplanatoryText("This example applies the theme's default responsive design rules for ColumnLayout.\n "
+ "The col... | java | private void addResponsiveExample() {
add(new WHeading(HeadingLevel.H2, "Default responsive design"));
add(new ExplanatoryText("This example applies the theme's default responsive design rules for ColumnLayout.\n "
+ "The columns have width and alignment and there is also a hgap and a vgap."));
WPanel panel... | [
"private",
"void",
"addResponsiveExample",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H2",
",",
"\"Default responsive design\"",
")",
")",
";",
"add",
"(",
"new",
"ExplanatoryText",
"(",
"\"This example applies the theme's default respons... | Add a column layout which will change its rendering on small screens. | [
"Add",
"a",
"column",
"layout",
"which",
"will",
"change",
"its",
"rendering",
"on",
"small",
"screens",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/ColumnLayoutExample.java#L72-L87 |
apereo/cas | support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/flow/DelegatedClientAuthenticationAction.java | DelegatedClientAuthenticationAction.hasDelegationRequestFailed | public static Optional<ModelAndView> hasDelegationRequestFailed(final HttpServletRequest request, final int status) {
"""
Determine if request has errors.
@param request the request
@param status the status
@return the optional model and view, if request is an error.
"""
val params = request.getP... | java | public static Optional<ModelAndView> hasDelegationRequestFailed(final HttpServletRequest request, final int status) {
val params = request.getParameterMap();
if (Stream.of("error", "error_code", "error_description", "error_message").anyMatch(params::containsKey)) {
val model = new HashMap<St... | [
"public",
"static",
"Optional",
"<",
"ModelAndView",
">",
"hasDelegationRequestFailed",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"int",
"status",
")",
"{",
"val",
"params",
"=",
"request",
".",
"getParameterMap",
"(",
")",
";",
"if",
"(",
"... | Determine if request has errors.
@param request the request
@param status the status
@return the optional model and view, if request is an error. | [
"Determine",
"if",
"request",
"has",
"errors",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/flow/DelegatedClientAuthenticationAction.java#L480-L502 |
GCRC/nunaliit | nunaliit2-couch-command/src/main/java/ca/carleton/gcrc/couch/command/impl/PathComputer.java | PathComputer.computeSiteDesignDir | static public File computeSiteDesignDir(File installDir) {
"""
Finds the "siteDesign" directory from the installation location
and returns it. If the command-line tool is packaged and
deployed, then the "siteDesign" directory is found at the
root of the installation. If the command-line tool is run
from the de... | java | static public File computeSiteDesignDir(File installDir) {
if( null != installDir ) {
// Command-line package
File templatesDir = new File(installDir, "internal/siteDesign");
if( templatesDir.exists() && templatesDir.isDirectory() ) {
return templatesDir;
}
// Development environment
File nu... | [
"static",
"public",
"File",
"computeSiteDesignDir",
"(",
"File",
"installDir",
")",
"{",
"if",
"(",
"null",
"!=",
"installDir",
")",
"{",
"// Command-line package",
"File",
"templatesDir",
"=",
"new",
"File",
"(",
"installDir",
",",
"\"internal/siteDesign\"",
")",... | Finds the "siteDesign" directory from the installation location
and returns it. If the command-line tool is packaged and
deployed, then the "siteDesign" directory is found at the
root of the installation. If the command-line tool is run
from the development environment, then the "siteDesign" directory
is found in the S... | [
"Finds",
"the",
"siteDesign",
"directory",
"from",
"the",
"installation",
"location",
"and",
"returns",
"it",
".",
"If",
"the",
"command",
"-",
"line",
"tool",
"is",
"packaged",
"and",
"deployed",
"then",
"the",
"siteDesign",
"directory",
"is",
"found",
"at",
... | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-couch-command/src/main/java/ca/carleton/gcrc/couch/command/impl/PathComputer.java#L203-L220 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/TerminalTextUtils.java | TerminalTextUtils.getANSIControlSequenceAt | public static String getANSIControlSequenceAt(String string, int index) {
"""
Given a string and an index in that string, returns the ANSI control sequence beginning on this index. If there
is no control sequence starting there, the method will return null. The returned value is the complete escape
sequence incl... | java | public static String getANSIControlSequenceAt(String string, int index) {
int len = getANSIControlSequenceLength(string, index);
return len == 0 ? null : string.substring(index,index+len);
} | [
"public",
"static",
"String",
"getANSIControlSequenceAt",
"(",
"String",
"string",
",",
"int",
"index",
")",
"{",
"int",
"len",
"=",
"getANSIControlSequenceLength",
"(",
"string",
",",
"index",
")",
";",
"return",
"len",
"==",
"0",
"?",
"null",
":",
"string"... | Given a string and an index in that string, returns the ANSI control sequence beginning on this index. If there
is no control sequence starting there, the method will return null. The returned value is the complete escape
sequence including the ESC prefix.
@param string String to scan for control sequences
@param index... | [
"Given",
"a",
"string",
"and",
"an",
"index",
"in",
"that",
"string",
"returns",
"the",
"ANSI",
"control",
"sequence",
"beginning",
"on",
"this",
"index",
".",
"If",
"there",
"is",
"no",
"control",
"sequence",
"starting",
"there",
"the",
"method",
"will",
... | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/TerminalTextUtils.java#L51-L54 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java | ChunkedIntArray.appendSlot | int appendSlot(int w0, int w1, int w2, int w3) {
"""
Append a 4-integer record to the CIA, starting with record 1. (Since
arrays are initialized to all-0, 0 has been reserved as the "unknown"
value in DTM.)
@return the index at which this record was inserted.
"""
/*
try
{
int newoffset = (... | java | int appendSlot(int w0, int w1, int w2, int w3)
{
/*
try
{
int newoffset = (lastUsed+1)*slotsize;
fastArray[newoffset] = w0;
fastArray[newoffset+1] = w1;
fastArray[newoffset+2] = w2;
fastArray[newoffset+3] = w3;
return ++lastUsed;
}
catch(ArrayIndexOutOfBoundsExc... | [
"int",
"appendSlot",
"(",
"int",
"w0",
",",
"int",
"w1",
",",
"int",
"w2",
",",
"int",
"w3",
")",
"{",
"/*\n try\n {\n int newoffset = (lastUsed+1)*slotsize;\n fastArray[newoffset] = w0;\n fastArray[newoffset+1] = w1;\n fastArray[newoffset+2] = w2;\n fa... | Append a 4-integer record to the CIA, starting with record 1. (Since
arrays are initialized to all-0, 0 has been reserved as the "unknown"
value in DTM.)
@return the index at which this record was inserted. | [
"Append",
"a",
"4",
"-",
"integer",
"record",
"to",
"the",
"CIA",
"starting",
"with",
"record",
"1",
".",
"(",
"Since",
"arrays",
"are",
"initialized",
"to",
"all",
"-",
"0",
"0",
"has",
"been",
"reserved",
"as",
"the",
"unknown",
"value",
"in",
"DTM",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java#L71-L102 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java | PlanNode.findAtOrBelow | public PlanNode findAtOrBelow( Traversal order,
Type typeToFind ) {
"""
Find the first node with the specified type that are at or below this node.
@param order the order to traverse; may not be null
@param typeToFind the type of node to find; may not be null
@return the fir... | java | public PlanNode findAtOrBelow( Traversal order,
Type typeToFind ) {
return findAtOrBelow(order, EnumSet.of(typeToFind));
} | [
"public",
"PlanNode",
"findAtOrBelow",
"(",
"Traversal",
"order",
",",
"Type",
"typeToFind",
")",
"{",
"return",
"findAtOrBelow",
"(",
"order",
",",
"EnumSet",
".",
"of",
"(",
"typeToFind",
")",
")",
";",
"}"
] | Find the first node with the specified type that are at or below this node.
@param order the order to traverse; may not be null
@param typeToFind the type of node to find; may not be null
@return the first node that is at or below this node that has the supplied type; or null if there is no such node | [
"Find",
"the",
"first",
"node",
"with",
"the",
"specified",
"type",
"that",
"are",
"at",
"or",
"below",
"this",
"node",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1484-L1487 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java | ImageIOHelper.createTiffFiles | public static List<File> createTiffFiles(List<IIOImage> imageList, int index) throws IOException {
"""
Creates a list of TIFF image files from a list of <code>IIOImage</code>
objects.
@param imageList a list of <code>IIOImage</code> objects
@param index an index of the page; -1 means all pages
@return a list... | java | public static List<File> createTiffFiles(List<IIOImage> imageList, int index) throws IOException {
return createTiffFiles(imageList, index, 0, 0);
} | [
"public",
"static",
"List",
"<",
"File",
">",
"createTiffFiles",
"(",
"List",
"<",
"IIOImage",
">",
"imageList",
",",
"int",
"index",
")",
"throws",
"IOException",
"{",
"return",
"createTiffFiles",
"(",
"imageList",
",",
"index",
",",
"0",
",",
"0",
")",
... | Creates a list of TIFF image files from a list of <code>IIOImage</code>
objects.
@param imageList a list of <code>IIOImage</code> objects
@param index an index of the page; -1 means all pages
@return a list of TIFF image files
@throws IOException | [
"Creates",
"a",
"list",
"of",
"TIFF",
"image",
"files",
"from",
"a",
"list",
"of",
"<code",
">",
"IIOImage<",
"/",
"code",
">",
"objects",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java#L162-L164 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java | AbstractTagLibrary.addTagHandler | protected final void addTagHandler(String name, Class<? extends TagHandler> handlerType) {
"""
Use the specified HandlerType in compiling Facelets. HandlerType must extend TagHandler.
@see TagHandler
@param name
name to use, "foo" would be <my:foo />
@param handlerType
must extend TagHandler
"""
... | java | protected final void addTagHandler(String name, Class<? extends TagHandler> handlerType)
{
_factories.put(name, new HandlerFactory(handlerType));
} | [
"protected",
"final",
"void",
"addTagHandler",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
"extends",
"TagHandler",
">",
"handlerType",
")",
"{",
"_factories",
".",
"put",
"(",
"name",
",",
"new",
"HandlerFactory",
"(",
"handlerType",
")",
")",
";",
"}"... | Use the specified HandlerType in compiling Facelets. HandlerType must extend TagHandler.
@see TagHandler
@param name
name to use, "foo" would be <my:foo />
@param handlerType
must extend TagHandler | [
"Use",
"the",
"specified",
"HandlerType",
"in",
"compiling",
"Facelets",
".",
"HandlerType",
"must",
"extend",
"TagHandler",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java#L262-L265 |
Red5/red5-server-common | src/main/java/org/red5/server/scope/Scope.java | Scope.registerServiceHandler | public void registerServiceHandler(String name, Object handler) {
"""
Register service handler by name
@param name Service handler name
@param handler Service handler
"""
Map<String, Object> serviceHandlers = getServiceHandlers();
serviceHandlers.put(name, handler);
} | java | public void registerServiceHandler(String name, Object handler) {
Map<String, Object> serviceHandlers = getServiceHandlers();
serviceHandlers.put(name, handler);
} | [
"public",
"void",
"registerServiceHandler",
"(",
"String",
"name",
",",
"Object",
"handler",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"serviceHandlers",
"=",
"getServiceHandlers",
"(",
")",
";",
"serviceHandlers",
".",
"put",
"(",
"name",
",",
"ha... | Register service handler by name
@param name Service handler name
@param handler Service handler | [
"Register",
"service",
"handler",
"by",
"name"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/scope/Scope.java#L933-L936 |
authlete/authlete-java-common | src/main/java/com/authlete/common/util/TypedProperties.java | TypedProperties.getEnum | public <TEnum extends Enum<TEnum>> TEnum getEnum(String key, Class<TEnum> enumClass) {
"""
Equivalent to {@link #getEnum(String, Class, Enum)
getEnum}{@code (key, enumClass, null)}.
"""
return getEnum(key, enumClass, null);
} | java | public <TEnum extends Enum<TEnum>> TEnum getEnum(String key, Class<TEnum> enumClass)
{
return getEnum(key, enumClass, null);
} | [
"public",
"<",
"TEnum",
"extends",
"Enum",
"<",
"TEnum",
">",
">",
"TEnum",
"getEnum",
"(",
"String",
"key",
",",
"Class",
"<",
"TEnum",
">",
"enumClass",
")",
"{",
"return",
"getEnum",
"(",
"key",
",",
"enumClass",
",",
"null",
")",
";",
"}"
] | Equivalent to {@link #getEnum(String, Class, Enum)
getEnum}{@code (key, enumClass, null)}. | [
"Equivalent",
"to",
"{"
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/TypedProperties.java#L413-L416 |
unbescape/unbescape | src/main/java/org/unbescape/properties/PropertiesEscape.java | PropertiesEscape.escapePropertiesKeyMinimal | public static void escapePropertiesKeyMinimal(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
"""
<p>
Perform a Java Properties Key level 1 (only basic set) <strong>escape</strong> operation
on a <tt>char[]</tt> input... | java | public static void escapePropertiesKeyMinimal(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapePropertiesKey(text, offset, len, writer, PropertiesKeyEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET);
} | [
"public",
"static",
"void",
"escapePropertiesKeyMinimal",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapePropertiesKey",
"(",
"text"... | <p>
Perform a Java Properties Key level 1 (only basic set) <strong>escape</strong> operation
on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 1</em> means this method will only escape the Java Properties Key basic escape set:
</p>
<ul>
<li>The <em>Single Escape Characters</em>:
<tt>\t</tt> (<tt>U+0009</tt>),
<tt>\... | [
"<p",
">",
"Perform",
"a",
"Java",
"Properties",
"Key",
"level",
"1",
"(",
"only",
"basic",
"set",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L1230-L1233 |
Alfresco/alfresco-sdk | plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AbstractRefreshWebappMojo.java | AbstractRefreshWebappMojo.clearDependencyCaches | protected void clearDependencyCaches(String url) {
"""
Perform a Clear Dependency Caches call on Share webapp.
Called by specific refresh mojo implementation, currently only applicable to Share webapp.
@param url the relative path to clear cache
"""
// Create the Clear Cache URL for the Alfresco To... | java | protected void clearDependencyCaches(String url) {
// Create the Clear Cache URL for the Alfresco Tomcat server
URL alfrescoTomcatUrl = buildFinalUrl(url);
if (alfrescoTomcatUrl == null) {
getLog().error("Could not build clear dependency caches URL for " +
refresh... | [
"protected",
"void",
"clearDependencyCaches",
"(",
"String",
"url",
")",
"{",
"// Create the Clear Cache URL for the Alfresco Tomcat server",
"URL",
"alfrescoTomcatUrl",
"=",
"buildFinalUrl",
"(",
"url",
")",
";",
"if",
"(",
"alfrescoTomcatUrl",
"==",
"null",
")",
"{",
... | Perform a Clear Dependency Caches call on Share webapp.
Called by specific refresh mojo implementation, currently only applicable to Share webapp.
@param url the relative path to clear cache | [
"Perform",
"a",
"Clear",
"Dependency",
"Caches",
"call",
"on",
"Share",
"webapp",
".",
"Called",
"by",
"specific",
"refresh",
"mojo",
"implementation",
"currently",
"only",
"applicable",
"to",
"Share",
"webapp",
"."
] | train | https://github.com/Alfresco/alfresco-sdk/blob/7f861a96726edb776293e2363ee85ef05643368b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AbstractRefreshWebappMojo.java#L192-L202 |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/scoping/impl/ImportUriGlobalScopeProvider.java | ImportUriGlobalScopeProvider.createURICollector | protected IAcceptor<String> createURICollector(Resource resource, Set<URI> collectInto) {
"""
Provides the acceptor for import URI strings that will populate the given {@link Set set of URIs}.
The default implementation
creates a new {@link URICollector}. I creates the imported URIs and normalizes
potentially... | java | protected IAcceptor<String> createURICollector(Resource resource, Set<URI> collectInto) {
ResourceSet resourceSet = resource.getResourceSet();
return new URICollector(resourceSet, collectInto);
} | [
"protected",
"IAcceptor",
"<",
"String",
">",
"createURICollector",
"(",
"Resource",
"resource",
",",
"Set",
"<",
"URI",
">",
"collectInto",
")",
"{",
"ResourceSet",
"resourceSet",
"=",
"resource",
".",
"getResourceSet",
"(",
")",
";",
"return",
"new",
"URICol... | Provides the acceptor for import URI strings that will populate the given {@link Set set of URIs}.
The default implementation
creates a new {@link URICollector}. I creates the imported URIs and normalizes
potentially given class-path URIs to platform or file URIs.
@since 2.5 | [
"Provides",
"the",
"acceptor",
"for",
"import",
"URI",
"strings",
"that",
"will",
"populate",
"the",
"given",
"{",
"@link",
"Set",
"set",
"of",
"URIs",
"}",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/scoping/impl/ImportUriGlobalScopeProvider.java#L165-L168 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/introspection/DeprecatedCheckUberspector.java | DeprecatedCheckUberspector.logWarning | private void logWarning(String deprecationType, Object object, String methodName, Info info) {
"""
Helper method to log a warning when a deprecation has been found.
@param deprecationType the type of deprecation (eg "getter", "setter", "method")
@param object the object that has a deprecation
@param methodNam... | java | private void logWarning(String deprecationType, Object object, String methodName, Info info)
{
this.log.warn(String.format("Deprecated usage of %s [%s] in %s@%d,%d", deprecationType, object.getClass()
.getCanonicalName() + "." + methodName, info.getTemplateName(), info.getLine(), info.getColumn(... | [
"private",
"void",
"logWarning",
"(",
"String",
"deprecationType",
",",
"Object",
"object",
",",
"String",
"methodName",
",",
"Info",
"info",
")",
"{",
"this",
".",
"log",
".",
"warn",
"(",
"String",
".",
"format",
"(",
"\"Deprecated usage of %s [%s] in %s@%d,%d... | Helper method to log a warning when a deprecation has been found.
@param deprecationType the type of deprecation (eg "getter", "setter", "method")
@param object the object that has a deprecation
@param methodName the deprecated method's name
@param info a Velocity {@link org.apache.velocity.util.introspection.Info} ob... | [
"Helper",
"method",
"to",
"log",
"a",
"warning",
"when",
"a",
"deprecation",
"has",
"been",
"found",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/introspection/DeprecatedCheckUberspector.java#L112-L116 |
modelmapper/modelmapper | core/src/main/java/org/modelmapper/Conditions.java | Conditions.isType | public static Condition<?, ?> isType(final Class<?> type) {
"""
Returns a condition that applies when the mapping source is of the type {@code type}.
"""
return new Condition<Object, Object>() {
public boolean applies(MappingContext<Object, Object> context) {
return type.isAssignableFrom(c... | java | public static Condition<?, ?> isType(final Class<?> type) {
return new Condition<Object, Object>() {
public boolean applies(MappingContext<Object, Object> context) {
return type.isAssignableFrom(context.getSourceType());
}
};
} | [
"public",
"static",
"Condition",
"<",
"?",
",",
"?",
">",
"isType",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"new",
"Condition",
"<",
"Object",
",",
"Object",
">",
"(",
")",
"{",
"public",
"boolean",
"applies",
"(",
"MappingC... | Returns a condition that applies when the mapping source is of the type {@code type}. | [
"Returns",
"a",
"condition",
"that",
"applies",
"when",
"the",
"mapping",
"source",
"is",
"of",
"the",
"type",
"{"
] | train | https://github.com/modelmapper/modelmapper/blob/491d165ded9dc9aba7ce8b56984249e1a1363204/core/src/main/java/org/modelmapper/Conditions.java#L175-L181 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/dialogs/TextInputDialogBuilder.java | TextInputDialogBuilder.setValidationPattern | public TextInputDialogBuilder setValidationPattern(final Pattern pattern, final String errorMessage) {
"""
Helper method that assigned a validator to the text box the dialog will have which matches the pattern supplied
@param pattern Pattern to validate the text box
@param errorMessage Error message to show when... | java | public TextInputDialogBuilder setValidationPattern(final Pattern pattern, final String errorMessage) {
return setValidator(new TextInputDialogResultValidator() {
@Override
public String validate(String content) {
Matcher matcher = pattern.matcher(content);
... | [
"public",
"TextInputDialogBuilder",
"setValidationPattern",
"(",
"final",
"Pattern",
"pattern",
",",
"final",
"String",
"errorMessage",
")",
"{",
"return",
"setValidator",
"(",
"new",
"TextInputDialogResultValidator",
"(",
")",
"{",
"@",
"Override",
"public",
"String"... | Helper method that assigned a validator to the text box the dialog will have which matches the pattern supplied
@param pattern Pattern to validate the text box
@param errorMessage Error message to show when the pattern doesn't match
@return Itself | [
"Helper",
"method",
"that",
"assigned",
"a",
"validator",
"to",
"the",
"text",
"box",
"the",
"dialog",
"will",
"have",
"which",
"matches",
"the",
"pattern",
"supplied"
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/dialogs/TextInputDialogBuilder.java#L127-L141 |
rythmengine/rythmengine | src/main/java/org/rythmengine/toString/ToStringStyle.java | ToStringStyle.appendIdentityHashCode | protected void appendIdentityHashCode(StringBuilder buffer, Object object) {
"""
<p>Append the {@link System#identityHashCode(Object)}.</p>
@param buffer the <code>StringBuilder</code> to populate
@param object the <code>Object</code> whose id to output
"""
if (this.isUseIdentityHashCode() && objec... | java | protected void appendIdentityHashCode(StringBuilder buffer, Object object) {
if (this.isUseIdentityHashCode() && object != null) {
register(object);
buffer.append('@');
buffer.append(Integer.toHexString(System.identityHashCode(object)));
}
} | [
"protected",
"void",
"appendIdentityHashCode",
"(",
"StringBuilder",
"buffer",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"this",
".",
"isUseIdentityHashCode",
"(",
")",
"&&",
"object",
"!=",
"null",
")",
"{",
"register",
"(",
"object",
")",
";",
"buffer"... | <p>Append the {@link System#identityHashCode(Object)}.</p>
@param buffer the <code>StringBuilder</code> to populate
@param object the <code>Object</code> whose id to output | [
"<p",
">",
"Append",
"the",
"{",
"@link",
"System#identityHashCode",
"(",
"Object",
")",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/toString/ToStringStyle.java#L1465-L1471 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java | AbstractLinear.create_MEASURED_VALUE_Image | protected BufferedImage create_MEASURED_VALUE_Image(final int WIDTH, final int HEIGHT, final Color COLOR) {
"""
Returns the image of the MinMeasuredValue and MaxMeasuredValue dependend
on the given color
@param WIDTH
@param HEIGHT
@param COLOR
@return a buffered image of either the min measured value or the m... | java | protected BufferedImage create_MEASURED_VALUE_Image(final int WIDTH, final int HEIGHT, final Color COLOR) {
if (WIDTH <= 20 || HEIGHT <= 20) // 20 is needed otherwise the image size could be smaller than 1
{
return UTIL.createImage(1, 1, Transparency.TRANSLUCENT);
}
final in... | [
"protected",
"BufferedImage",
"create_MEASURED_VALUE_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"int",
"HEIGHT",
",",
"final",
"Color",
"COLOR",
")",
"{",
"if",
"(",
"WIDTH",
"<=",
"20",
"||",
"HEIGHT",
"<=",
"20",
")",
"// 20 is needed otherwise the im... | Returns the image of the MinMeasuredValue and MaxMeasuredValue dependend
on the given color
@param WIDTH
@param HEIGHT
@param COLOR
@return a buffered image of either the min measured value or the max measured value indicator | [
"Returns",
"the",
"image",
"of",
"the",
"MinMeasuredValue",
"and",
"MaxMeasuredValue",
"dependend",
"on",
"the",
"given",
"color"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java#L1293-L1334 |
zerodhatech/javakiteconnect | kiteconnect/src/com/zerodhatech/kiteconnect/KiteConnect.java | KiteConnect.placeMFOrder | public MFOrder placeMFOrder(String tradingsymbol, String transactionType, double amount, double quantity, String tag) throws KiteException, IOException, JSONException {
"""
Place a mutualfunds order.
@return MFOrder object contains only orderId.
@param tradingsymbol Tradingsymbol (ISIN) of the fund.
@param tran... | java | public MFOrder placeMFOrder(String tradingsymbol, String transactionType, double amount, double quantity, String tag) throws KiteException, IOException, JSONException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("tradingsymbol", tradingsymbol);
params.put("transaction... | [
"public",
"MFOrder",
"placeMFOrder",
"(",
"String",
"tradingsymbol",
",",
"String",
"transactionType",
",",
"double",
"amount",
",",
"double",
"quantity",
",",
"String",
"tag",
")",
"throws",
"KiteException",
",",
"IOException",
",",
"JSONException",
"{",
"Map",
... | Place a mutualfunds order.
@return MFOrder object contains only orderId.
@param tradingsymbol Tradingsymbol (ISIN) of the fund.
@param transactionType BUY or SELL.
@param amount Amount worth of units to purchase. Not applicable on SELLs.
@param quantity Quantity to SELL. Not applicable on BUYs. If the holding is less t... | [
"Place",
"a",
"mutualfunds",
"order",
"."
] | train | https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/kiteconnect/KiteConnect.java#L628-L640 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/listeners/OnBindViewHolderListenerImpl.java | OnBindViewHolderListenerImpl.unBindViewHolder | @Override
public void unBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
"""
is called in onViewRecycled to unbind the data on the ViewHolder
@param viewHolder the viewHolder for the type at this position
@param position the position of this viewHolder
"""
IItem item = FastA... | java | @Override
public void unBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
IItem item = FastAdapter.getHolderAdapterItemTag(viewHolder);
if (item != null) {
item.unbindView(viewHolder);
if (viewHolder instanceof FastAdapter.ViewHolder) {
((Fast... | [
"@",
"Override",
"public",
"void",
"unBindViewHolder",
"(",
"RecyclerView",
".",
"ViewHolder",
"viewHolder",
",",
"int",
"position",
")",
"{",
"IItem",
"item",
"=",
"FastAdapter",
".",
"getHolderAdapterItemTag",
"(",
"viewHolder",
")",
";",
"if",
"(",
"item",
... | is called in onViewRecycled to unbind the data on the ViewHolder
@param viewHolder the viewHolder for the type at this position
@param position the position of this viewHolder | [
"is",
"called",
"in",
"onViewRecycled",
"to",
"unbind",
"the",
"data",
"on",
"the",
"ViewHolder"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/listeners/OnBindViewHolderListenerImpl.java#L44-L58 |
diffplug/durian | src/com/diffplug/common/base/TreeComparison.java | TreeComparison.isEqualMappedBy | public boolean isEqualMappedBy(Function<? super E, ?> expectedMapper, Function<? super A, ?> actualMapper) {
"""
Returns true if the two trees are equal, by calling {@link Objects#equals(Object, Object)} on the results of both mappers.
"""
return isEqualBasedOn((expected, actual) -> {
return Objects.equal... | java | public boolean isEqualMappedBy(Function<? super E, ?> expectedMapper, Function<? super A, ?> actualMapper) {
return isEqualBasedOn((expected, actual) -> {
return Objects.equals(expectedMapper.apply(expected), actualMapper.apply(actual));
});
} | [
"public",
"boolean",
"isEqualMappedBy",
"(",
"Function",
"<",
"?",
"super",
"E",
",",
"?",
">",
"expectedMapper",
",",
"Function",
"<",
"?",
"super",
"A",
",",
"?",
">",
"actualMapper",
")",
"{",
"return",
"isEqualBasedOn",
"(",
"(",
"expected",
",",
"ac... | Returns true if the two trees are equal, by calling {@link Objects#equals(Object, Object)} on the results of both mappers. | [
"Returns",
"true",
"if",
"the",
"two",
"trees",
"are",
"equal",
"by",
"calling",
"{"
] | train | https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/TreeComparison.java#L45-L49 |
cojen/Cojen | src/main/java/org/cojen/util/ThrowUnchecked.java | ThrowUnchecked.fireDeclaredRootCause | public static void fireDeclaredRootCause(Throwable t, Class... declaredTypes) {
"""
Throws the root cause of the given exception if it is unchecked or an
instance of any of the given declared types. Otherwise, it is thrown as
an UndeclaredThrowableException. If the root cause is null, then the
original exceptio... | java | public static void fireDeclaredRootCause(Throwable t, Class... declaredTypes) {
Throwable root = t;
while (root != null) {
Throwable cause = root.getCause();
if (cause == null) {
break;
}
root = cause;
}
fireDeclared(root, d... | [
"public",
"static",
"void",
"fireDeclaredRootCause",
"(",
"Throwable",
"t",
",",
"Class",
"...",
"declaredTypes",
")",
"{",
"Throwable",
"root",
"=",
"t",
";",
"while",
"(",
"root",
"!=",
"null",
")",
"{",
"Throwable",
"cause",
"=",
"root",
".",
"getCause"... | Throws the root cause of the given exception if it is unchecked or an
instance of any of the given declared types. Otherwise, it is thrown as
an UndeclaredThrowableException. If the root cause is null, then the
original exception is thrown. This method only returns normally if the
exception is null.
@param t exception... | [
"Throws",
"the",
"root",
"cause",
"of",
"the",
"given",
"exception",
"if",
"it",
"is",
"unchecked",
"or",
"an",
"instance",
"of",
"any",
"of",
"the",
"given",
"declared",
"types",
".",
"Otherwise",
"it",
"is",
"thrown",
"as",
"an",
"UndeclaredThrowableExcept... | train | https://github.com/cojen/Cojen/blob/ddee9a0fde83870b97e0ed04c58270aa665f3a62/src/main/java/org/cojen/util/ThrowUnchecked.java#L283-L293 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.smoothCubicTo | public SVGPath smoothCubicTo(double[] c2xy, double[] xy) {
"""
Smooth Cubic Bezier line to the given coordinates.
@param c2xy second control point
@param xy new coordinates
@return path object, for compact syntax.
"""
return append(PATH_SMOOTH_CUBIC_TO).append(c2xy[0]).append(c2xy[1]).append(xy[0]).ap... | java | public SVGPath smoothCubicTo(double[] c2xy, double[] xy) {
return append(PATH_SMOOTH_CUBIC_TO).append(c2xy[0]).append(c2xy[1]).append(xy[0]).append(xy[1]);
} | [
"public",
"SVGPath",
"smoothCubicTo",
"(",
"double",
"[",
"]",
"c2xy",
",",
"double",
"[",
"]",
"xy",
")",
"{",
"return",
"append",
"(",
"PATH_SMOOTH_CUBIC_TO",
")",
".",
"append",
"(",
"c2xy",
"[",
"0",
"]",
")",
".",
"append",
"(",
"c2xy",
"[",
"1"... | Smooth Cubic Bezier line to the given coordinates.
@param c2xy second control point
@param xy new coordinates
@return path object, for compact syntax. | [
"Smooth",
"Cubic",
"Bezier",
"line",
"to",
"the",
"given",
"coordinates",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L420-L422 |
rackerlabs/clouddocs-maven-plugin | src/main/java/com/rackspace/cloud/api/docs/calabash/extensions/util/RelativePath.java | RelativePath.getRelativePath | public static String getRelativePath(File home,File f) {
"""
get relative path of File 'f' with respect to 'home' directory
example : home = /a/b/c
f = /a/d/e/x.txt
s = getRelativePath(home,f) = ../../d/e/x.txt
@param home base path, should be a directory, not a file, or it doesn't
make sense
@param f fil... | java | public static String getRelativePath(File home,File f){
List<String> homelist = getPathList(home);
List<String> filelist = getPathList(f);
String s = matchPathLists(homelist,filelist);
return s;
} | [
"public",
"static",
"String",
"getRelativePath",
"(",
"File",
"home",
",",
"File",
"f",
")",
"{",
"List",
"<",
"String",
">",
"homelist",
"=",
"getPathList",
"(",
"home",
")",
";",
"List",
"<",
"String",
">",
"filelist",
"=",
"getPathList",
"(",
"f",
"... | get relative path of File 'f' with respect to 'home' directory
example : home = /a/b/c
f = /a/d/e/x.txt
s = getRelativePath(home,f) = ../../d/e/x.txt
@param home base path, should be a directory, not a file, or it doesn't
make sense
@param f file to generate path for
@return path from home to f as a string | [
"get",
"relative",
"path",
"of",
"File",
"f",
"with",
"respect",
"to",
"home",
"directory",
"example",
":",
"home",
"=",
"/",
"a",
"/",
"b",
"/",
"c",
"f",
"=",
"/",
"a",
"/",
"d",
"/",
"e",
"/",
"x",
".",
"txt",
"s",
"=",
"getRelativePath",
"(... | train | https://github.com/rackerlabs/clouddocs-maven-plugin/blob/ba8554dc340db674307efdaac647c6fd2b58a34b/src/main/java/com/rackspace/cloud/api/docs/calabash/extensions/util/RelativePath.java#L83-L89 |
icode/ameba | src/main/java/ameba/lib/Strands.java | Strands.printStackTrace | public static void printStackTrace(StackTraceElement[] trace, java.io.PrintStream out) {
"""
This utility method prints a stack-trace into a {@link java.io.PrintStream}
@param trace a stack trace (such as returned from {@link Strand#getStackTrace()}.
@param out the {@link java.io.PrintStream} into which the ... | java | public static void printStackTrace(StackTraceElement[] trace, java.io.PrintStream out) {
Strand.printStackTrace(trace, out);
} | [
"public",
"static",
"void",
"printStackTrace",
"(",
"StackTraceElement",
"[",
"]",
"trace",
",",
"java",
".",
"io",
".",
"PrintStream",
"out",
")",
"{",
"Strand",
".",
"printStackTrace",
"(",
"trace",
",",
"out",
")",
";",
"}"
] | This utility method prints a stack-trace into a {@link java.io.PrintStream}
@param trace a stack trace (such as returned from {@link Strand#getStackTrace()}.
@param out the {@link java.io.PrintStream} into which the stack trace will be printed. | [
"This",
"utility",
"method",
"prints",
"a",
"stack",
"-",
"trace",
"into",
"a",
"{",
"@link",
"java",
".",
"io",
".",
"PrintStream",
"}"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/lib/Strands.java#L527-L529 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzleStatement.java | DrizzleStatement.executeQuery | public ResultSet executeQuery(final String query) throws SQLException {
"""
executes a select query.
@param query the query to send to the server
@return a result set
@throws SQLException if something went wrong
"""
startTimer();
try {
if (queryResult != null) {
... | java | public ResultSet executeQuery(final String query) throws SQLException {
startTimer();
try {
if (queryResult != null) {
queryResult.close();
}
final Query queryToSend = queryFactory.createQuery(query);
queryResult = protocol.executeQuery(que... | [
"public",
"ResultSet",
"executeQuery",
"(",
"final",
"String",
"query",
")",
"throws",
"SQLException",
"{",
"startTimer",
"(",
")",
";",
"try",
"{",
"if",
"(",
"queryResult",
"!=",
"null",
")",
"{",
"queryResult",
".",
"close",
"(",
")",
";",
"}",
"final... | executes a select query.
@param query the query to send to the server
@return a result set
@throws SQLException if something went wrong | [
"executes",
"a",
"select",
"query",
"."
] | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleStatement.java#L122-L137 |
gaixie/jibu-core | src/main/java/org/gaixie/jibu/mail/JavaMailSender.java | JavaMailSender.send | public void send(String recipients, String subj, String text) {
"""
通过 javax.mail 发送邮件。
@param recipients 接收方邮件地址,多个邮件地址以逗号分隔。
@param subj 邮件标题。
@param text 邮件正文。
"""
final String usr = JibuConfig.getProperty("mail.username");
final String pwd = JibuConfig.getProperty("mail.password");
... | java | public void send(String recipients, String subj, String text) {
final String usr = JibuConfig.getProperty("mail.username");
final String pwd = JibuConfig.getProperty("mail.password");
Session session =
Session.getDefaultInstance(JibuConfig.getProperties(),
... | [
"public",
"void",
"send",
"(",
"String",
"recipients",
",",
"String",
"subj",
",",
"String",
"text",
")",
"{",
"final",
"String",
"usr",
"=",
"JibuConfig",
".",
"getProperty",
"(",
"\"mail.username\"",
")",
";",
"final",
"String",
"pwd",
"=",
"JibuConfig",
... | 通过 javax.mail 发送邮件。
@param recipients 接收方邮件地址,多个邮件地址以逗号分隔。
@param subj 邮件标题。
@param text 邮件正文。 | [
"通过",
"javax",
".",
"mail",
"发送邮件。"
] | train | https://github.com/gaixie/jibu-core/blob/d5462f2883321c82d898c8752b7e5eba4b7dc184/src/main/java/org/gaixie/jibu/mail/JavaMailSender.java#L43-L63 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToTextStream.java | ToTextStream.processingInstruction | public void processingInstruction(String target, String data)
throws org.xml.sax.SAXException {
"""
Receive notification of a processing instruction.
<p>The Parser will invoke this method once for each processing
instruction found: note that processing instructions may occur
before or after the main... | java | public void processingInstruction(String target, String data)
throws org.xml.sax.SAXException
{
// flush anything pending first
flushPending();
if (m_tracer != null)
super.fireEscapingEvent(target, data);
} | [
"public",
"void",
"processingInstruction",
"(",
"String",
"target",
",",
"String",
"data",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException",
"{",
"// flush anything pending first",
"flushPending",
"(",
")",
";",
"if",
"(",
"m_tracer",
"!=",
"n... | Receive notification of a processing instruction.
<p>The Parser will invoke this method once for each processing
instruction found: note that processing instructions may occur
before or after the main document element.</p>
<p>A SAX parser should never report an XML declaration (XML 1.0,
section 2.8) or a text declara... | [
"Receive",
"notification",
"of",
"a",
"processing",
"instruction",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToTextStream.java#L451-L459 |
kiswanij/jk-util | src/main/java/com/jk/util/JKFormatUtil.java | JKFormatUtil.formatTime | public synchronized static String formatTime(final Time object, String pattern) {
"""
Format time.
@param object the object
@param pattern the pattern
@return the string
"""
if (pattern == null || pattern.equals("")) {
pattern = JKFormatUtil.DEFAULT_TIME_PATTERN;
}
return JKFormatUtil.getDateFor... | java | public synchronized static String formatTime(final Time object, String pattern) {
if (pattern == null || pattern.equals("")) {
pattern = JKFormatUtil.DEFAULT_TIME_PATTERN;
}
return JKFormatUtil.getDateFormatter(pattern).format(object);
} | [
"public",
"synchronized",
"static",
"String",
"formatTime",
"(",
"final",
"Time",
"object",
",",
"String",
"pattern",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
"||",
"pattern",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"pattern",
"=",
"JKFormatUtil",
... | Format time.
@param object the object
@param pattern the pattern
@return the string | [
"Format",
"time",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKFormatUtil.java#L124-L129 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.getDiagnosticsItemAsync | public Observable<HostingEnvironmentDiagnosticsInner> getDiagnosticsItemAsync(String resourceGroupName, String name, String diagnosticsName) {
"""
Get a diagnostics item for an App Service Environment.
Get a diagnostics item for an App Service Environment.
@param resourceGroupName Name of the resource group to... | java | public Observable<HostingEnvironmentDiagnosticsInner> getDiagnosticsItemAsync(String resourceGroupName, String name, String diagnosticsName) {
return getDiagnosticsItemWithServiceResponseAsync(resourceGroupName, name, diagnosticsName).map(new Func1<ServiceResponse<HostingEnvironmentDiagnosticsInner>, HostingEnv... | [
"public",
"Observable",
"<",
"HostingEnvironmentDiagnosticsInner",
">",
"getDiagnosticsItemAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"diagnosticsName",
")",
"{",
"return",
"getDiagnosticsItemWithServiceResponseAsync",
"(",
"resourceGrou... | Get a diagnostics item for an App Service Environment.
Get a diagnostics item for an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param diagnosticsName Name of the diagnostics item.
@throws IllegalArgumentE... | [
"Get",
"a",
"diagnostics",
"item",
"for",
"an",
"App",
"Service",
"Environment",
".",
"Get",
"a",
"diagnostics",
"item",
"for",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L1636-L1643 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.