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 |
|---|---|---|---|---|---|---|---|---|---|---|
dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLUtils.java | XMLUtils.addOrSetAttribute | public static void addOrSetAttribute(final AttributesImpl atts, final String localName, final String value) {
"""
Add or set attribute. Convenience method for {@link #addOrSetAttribute(AttributesImpl, String, String, String, String, String)}.
@param atts attributes
@param localName local name
@param value att... | java | public static void addOrSetAttribute(final AttributesImpl atts, final String localName, final String value) {
addOrSetAttribute(atts, NULL_NS_URI, localName, localName, "CDATA", value);
} | [
"public",
"static",
"void",
"addOrSetAttribute",
"(",
"final",
"AttributesImpl",
"atts",
",",
"final",
"String",
"localName",
",",
"final",
"String",
"value",
")",
"{",
"addOrSetAttribute",
"(",
"atts",
",",
"NULL_NS_URI",
",",
"localName",
",",
"localName",
","... | Add or set attribute. Convenience method for {@link #addOrSetAttribute(AttributesImpl, String, String, String, String, String)}.
@param atts attributes
@param localName local name
@param value attribute value | [
"Add",
"or",
"set",
"attribute",
".",
"Convenience",
"method",
"for",
"{",
"@link",
"#addOrSetAttribute",
"(",
"AttributesImpl",
"String",
"String",
"String",
"String",
"String",
")",
"}",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLUtils.java#L380-L382 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/read/ReadFileExtensions.java | ReadFileExtensions.readLinesInList | public static List<String> readLinesInList(final InputStream input, final boolean trim)
throws IOException {
"""
Reads every line from the given InputStream and puts them to the List.
@param input
The InputStream from where the input comes.
@param trim
the flag trim if the lines shell be trimed.
@return T... | java | public static List<String> readLinesInList(final InputStream input, final boolean trim)
throws IOException
{
// return the list with all lines from the file.
return readLinesInList(input, Charset.forName("UTF-8"), trim);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"readLinesInList",
"(",
"final",
"InputStream",
"input",
",",
"final",
"boolean",
"trim",
")",
"throws",
"IOException",
"{",
"// return the list with all lines from the file.",
"return",
"readLinesInList",
"(",
"input",
... | Reads every line from the given InputStream and puts them to the List.
@param input
The InputStream from where the input comes.
@param trim
the flag trim if the lines shell be trimed.
@return The List with all lines from the file.
@throws IOException
When a io-problem occurs. | [
"Reads",
"every",
"line",
"from",
"the",
"given",
"InputStream",
"and",
"puts",
"them",
"to",
"the",
"List",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/read/ReadFileExtensions.java#L312-L317 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaStringGenerator.java | SibRaStringGenerator.addField | void addField(final String name, final Object value)
throws IllegalStateException {
"""
Adds a string representation of the given object field.
@param name
the name of the field
@param value
the value of the field
@throws IllegalStateException
if the string representation has already been compl... | java | void addField(final String name, final Object value)
throws IllegalStateException {
checkNotCompleted();
_buffer.append(" <");
_buffer.append(name);
_buffer.append("=");
_buffer.append(value);
_buffer.append(">");
} | [
"void",
"addField",
"(",
"final",
"String",
"name",
",",
"final",
"Object",
"value",
")",
"throws",
"IllegalStateException",
"{",
"checkNotCompleted",
"(",
")",
";",
"_buffer",
".",
"append",
"(",
"\" <\"",
")",
";",
"_buffer",
".",
"append",
"(",
"name",
... | Adds a string representation of the given object field.
@param name
the name of the field
@param value
the value of the field
@throws IllegalStateException
if the string representation has already been completed | [
"Adds",
"a",
"string",
"representation",
"of",
"the",
"given",
"object",
"field",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaStringGenerator.java#L75-L85 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/SystemIntents.java | SystemIntents.newMarketForAppIntent | public static Intent newMarketForAppIntent(Context context) {
"""
Intent that should open the app store of the device on the current application page
@param context The context associated to the application
@return the intent
"""
String packageName = context.getApplicationContext().getPackageName()... | java | public static Intent newMarketForAppIntent(Context context) {
String packageName = context.getApplicationContext().getPackageName();
return newMarketForAppIntent(context, packageName);
} | [
"public",
"static",
"Intent",
"newMarketForAppIntent",
"(",
"Context",
"context",
")",
"{",
"String",
"packageName",
"=",
"context",
".",
"getApplicationContext",
"(",
")",
".",
"getPackageName",
"(",
")",
";",
"return",
"newMarketForAppIntent",
"(",
"context",
",... | Intent that should open the app store of the device on the current application page
@param context The context associated to the application
@return the intent | [
"Intent",
"that",
"should",
"open",
"the",
"app",
"store",
"of",
"the",
"device",
"on",
"the",
"current",
"application",
"page"
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/SystemIntents.java#L33-L36 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.executeQuery | public <T> T executeQuery(@NotNull ResultSetProcessor<T> processor, @NotNull @SQL String sql, Object... args) {
"""
Executes a query and processes the results with given {@link ResultSetProcessor}.
@see #executeQuery(ResultSetProcessor, SqlQuery)
"""
return executeQuery(processor, SqlQuery.query(sql... | java | public <T> T executeQuery(@NotNull ResultSetProcessor<T> processor, @NotNull @SQL String sql, Object... args) {
return executeQuery(processor, SqlQuery.query(sql, args));
} | [
"public",
"<",
"T",
">",
"T",
"executeQuery",
"(",
"@",
"NotNull",
"ResultSetProcessor",
"<",
"T",
">",
"processor",
",",
"@",
"NotNull",
"@",
"SQL",
"String",
"sql",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"executeQuery",
"(",
"processor",
","... | Executes a query and processes the results with given {@link ResultSetProcessor}.
@see #executeQuery(ResultSetProcessor, SqlQuery) | [
"Executes",
"a",
"query",
"and",
"processes",
"the",
"results",
"with",
"given",
"{",
"@link",
"ResultSetProcessor",
"}",
"."
] | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L292-L294 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/CompositeBundlePathMappingBuilder.java | CompositeBundlePathMappingBuilder.addFilePathMapping | private void addFilePathMapping(BundlePathMapping bundlePathMapping, Set<String> paths) {
"""
Adds paths to the file path mapping
@param bundlePathMapping
the bundle path mapping
@param paths
the paths to add
"""
for (String path : paths) {
addFilePathMapping(bundlePathMapping, path);
}
} | java | private void addFilePathMapping(BundlePathMapping bundlePathMapping, Set<String> paths) {
for (String path : paths) {
addFilePathMapping(bundlePathMapping, path);
}
} | [
"private",
"void",
"addFilePathMapping",
"(",
"BundlePathMapping",
"bundlePathMapping",
",",
"Set",
"<",
"String",
">",
"paths",
")",
"{",
"for",
"(",
"String",
"path",
":",
"paths",
")",
"{",
"addFilePathMapping",
"(",
"bundlePathMapping",
",",
"path",
")",
"... | Adds paths to the file path mapping
@param bundlePathMapping
the bundle path mapping
@param paths
the paths to add | [
"Adds",
"paths",
"to",
"the",
"file",
"path",
"mapping"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/CompositeBundlePathMappingBuilder.java#L83-L87 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/modal/ModalRenderer.java | ModalRenderer.encodeEnd | @Override
public void encodeEnd(FacesContext context, UIComponent component)
throws IOException {
"""
This methods generates the HTML code of the current b:modal.
<code>encodeBegin</code> generates the start of the component. After the,
the JSF framework calls <code>encodeChildren()</code> to generate the
H... | java | @Override
public void encodeEnd(FacesContext context, UIComponent component)
throws IOException {
if (!component.isRendered()) {
return;
}
ResponseWriter rw = context.getResponseWriter();
rw.endElement("div"); // modal-body
String cid=component.getClientId(context);
U... | [
"@",
"Override",
"public",
"void",
"encodeEnd",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"ResponseWriter",
"rw"... | This methods generates the HTML code of the current b:modal.
<code>encodeBegin</code> generates the start of the component. After the,
the JSF framework calls <code>encodeChildren()</code> to generate the
HTML code between the beginning and the end of the component. For
instance, in the case of a panel component the co... | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"modal",
".",
"<code",
">",
"encodeBegin<",
"/",
"code",
">",
"generates",
"the",
"start",
"of",
"the",
"component",
".",
"After",
"the",
"the",
"JSF",
"framework",
... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/modal/ModalRenderer.java#L175-L200 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionBase.java | AddressDivisionBase.getRadixPower | protected static BigInteger getRadixPower(BigInteger radix, int power) {
"""
Caches the results of radix to the given power.
@param radix
@param power
@return
"""
long key = (((long) radix.intValue()) << 32) | power;
BigInteger result = radixPowerMap.get(key);
if(result == null) {
if(power == 1) ... | java | protected static BigInteger getRadixPower(BigInteger radix, int power) {
long key = (((long) radix.intValue()) << 32) | power;
BigInteger result = radixPowerMap.get(key);
if(result == null) {
if(power == 1) {
result = radix;
} else if((power & 1) == 0) {
BigInteger halfPower = getRadixPower(radix, p... | [
"protected",
"static",
"BigInteger",
"getRadixPower",
"(",
"BigInteger",
"radix",
",",
"int",
"power",
")",
"{",
"long",
"key",
"=",
"(",
"(",
"(",
"long",
")",
"radix",
".",
"intValue",
"(",
")",
")",
"<<",
"32",
")",
"|",
"power",
";",
"BigInteger",
... | Caches the results of radix to the given power.
@param radix
@param power
@return | [
"Caches",
"the",
"results",
"of",
"radix",
"to",
"the",
"given",
"power",
"."
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/AddressDivisionBase.java#L351-L367 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/gyroscope/GyroscopeRenderer.java | GyroscopeRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
"""
This methods generates the HTML code of the current b:gyroscope.
@param context the FacesContext.
@param component the current b:gyroscope.
@throws IOException thrown if something goes wrong when writing the... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
Gyroscope gyroscope = (Gyroscope) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = gyroscope.getClientId();
rw.startElement("input", ... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"Gyroscope",
"gyrosc... | This methods generates the HTML code of the current b:gyroscope.
@param context the FacesContext.
@param component the current b:gyroscope.
@throws IOException thrown if something goes wrong when writing the HTML code. | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"gyroscope",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/gyroscope/GyroscopeRenderer.java#L135-L194 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/PerlinNoise.java | PerlinNoise.CosineInterpolate | private double CosineInterpolate(double x1, double x2, double a) {
"""
Cosine interpolation.
@param x1 X1 Value.
@param x2 X2 Value.
@param a Value.
@return Value.
"""
double f = (1 - Math.cos(a * Math.PI)) * 0.5;
return x1 * (1 - f) + x2 * f;
} | java | private double CosineInterpolate(double x1, double x2, double a) {
double f = (1 - Math.cos(a * Math.PI)) * 0.5;
return x1 * (1 - f) + x2 * f;
} | [
"private",
"double",
"CosineInterpolate",
"(",
"double",
"x1",
",",
"double",
"x2",
",",
"double",
"a",
")",
"{",
"double",
"f",
"=",
"(",
"1",
"-",
"Math",
".",
"cos",
"(",
"a",
"*",
"Math",
".",
"PI",
")",
")",
"*",
"0.5",
";",
"return",
"x1",
... | Cosine interpolation.
@param x1 X1 Value.
@param x2 X2 Value.
@param a Value.
@return Value. | [
"Cosine",
"interpolation",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/PerlinNoise.java#L258-L262 |
theHilikus/JRoboCom | jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/player/Bank.java | Bank.plugInterfaces | final public void plugInterfaces(RobotAction newControl, RobotStatus newStatus, WorldInfo newWorld) {
"""
Attaches a control to a bank
@param newControl control to attach
@param newStatus status provider to attach
@param newWorld world info provider to attach
"""
SecurityManager sm = System.getSecurityMa... | java | final public void plugInterfaces(RobotAction newControl, RobotStatus newStatus, WorldInfo newWorld) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new GamePermission("connectBank"));
}
control = newControl;
info = newStatus;
world = newWorld;
} | [
"final",
"public",
"void",
"plugInterfaces",
"(",
"RobotAction",
"newControl",
",",
"RobotStatus",
"newStatus",
",",
"WorldInfo",
"newWorld",
")",
"{",
"SecurityManager",
"sm",
"=",
"System",
".",
"getSecurityManager",
"(",
")",
";",
"if",
"(",
"sm",
"!=",
"nu... | Attaches a control to a bank
@param newControl control to attach
@param newStatus status provider to attach
@param newWorld world info provider to attach | [
"Attaches",
"a",
"control",
"to",
"a",
"bank"
] | train | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/player/Bank.java#L75-L84 |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitFlowGraphMonitor.java | GitFlowGraphMonitor.getEdgeId | private String getEdgeId(String source, String destination, String edgeName) {
"""
Get an edge label from the edge properties
@param source source data node id
@param destination destination data node id
@param edgeName simple name of the edge (e.g. file name without extension of the edge file)
@return a strin... | java | private String getEdgeId(String source, String destination, String edgeName) {
return Joiner.on(FLOW_EDGE_LABEL_JOINER_CHAR).join(source, destination, edgeName);
} | [
"private",
"String",
"getEdgeId",
"(",
"String",
"source",
",",
"String",
"destination",
",",
"String",
"edgeName",
")",
"{",
"return",
"Joiner",
".",
"on",
"(",
"FLOW_EDGE_LABEL_JOINER_CHAR",
")",
".",
"join",
"(",
"source",
",",
"destination",
",",
"edgeName... | Get an edge label from the edge properties
@param source source data node id
@param destination destination data node id
@param edgeName simple name of the edge (e.g. file name without extension of the edge file)
@return a string label identifying the edge | [
"Get",
"an",
"edge",
"label",
"from",
"the",
"edge",
"properties"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitFlowGraphMonitor.java#L382-L384 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java | HtmlTree.UL | public static HtmlTree UL(HtmlStyle styleClass, Content first, Content... more) {
"""
Generates a UL tag with the style class attribute and some content.
@param styleClass style for the tag
@param first initial content to be added
@param more a series of additional content nodes to be added
@return an HtmlTr... | java | public static HtmlTree UL(HtmlStyle styleClass, Content first, Content... more) {
HtmlTree htmlTree = new HtmlTree(HtmlTag.UL);
htmlTree.addContent(nullCheck(first));
for (Content c : more) {
htmlTree.addContent(nullCheck(c));
}
htmlTree.addStyle(nullCheck(styleClass)... | [
"public",
"static",
"HtmlTree",
"UL",
"(",
"HtmlStyle",
"styleClass",
",",
"Content",
"first",
",",
"Content",
"...",
"more",
")",
"{",
"HtmlTree",
"htmlTree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"UL",
")",
";",
"htmlTree",
".",
"addContent",
"(",... | Generates a UL tag with the style class attribute and some content.
@param styleClass style for the tag
@param first initial content to be added
@param more a series of additional content nodes to be added
@return an HtmlTree object for the UL tag | [
"Generates",
"a",
"UL",
"tag",
"with",
"the",
"style",
"class",
"attribute",
"and",
"some",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L866-L874 |
square/mortar | mortar-sample/src/main/java/com/example/mortar/screen/Layouts.java | Layouts.createView | public static android.view.View createView(Context context, Class<?> screenType) {
"""
Create an instance of the view specified in a {@link Layout} annotation.
"""
Layout screen = screenType.getAnnotation(Layout.class);
if (screen == null) {
throw new IllegalArgumentException(
String.fo... | java | public static android.view.View createView(Context context, Class<?> screenType) {
Layout screen = screenType.getAnnotation(Layout.class);
if (screen == null) {
throw new IllegalArgumentException(
String.format("@%s annotation not found on class %s", Layout.class.getSimpleName(),
s... | [
"public",
"static",
"android",
".",
"view",
".",
"View",
"createView",
"(",
"Context",
"context",
",",
"Class",
"<",
"?",
">",
"screenType",
")",
"{",
"Layout",
"screen",
"=",
"screenType",
".",
"getAnnotation",
"(",
"Layout",
".",
"class",
")",
";",
"if... | Create an instance of the view specified in a {@link Layout} annotation. | [
"Create",
"an",
"instance",
"of",
"the",
"view",
"specified",
"in",
"a",
"{"
] | train | https://github.com/square/mortar/blob/c968b99eb96ba56c47e29912c07841be8e2cf97a/mortar-sample/src/main/java/com/example/mortar/screen/Layouts.java#L29-L39 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java | TmdbPeople.getPersonImages | public ResultList<Artwork> getPersonImages(int personId) throws MovieDbException {
"""
Get the images for a specific person id.
@param personId
@return
@throws MovieDbException
"""
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
URL url = new ... | java | public ResultList<Artwork> getPersonImages(int personId) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, personId);
URL url = new ApiUrl(apiKey, MethodBase.PERSON).subMethod(MethodSub.IMAGES).buildUrl(parameters);
String webpage = htt... | [
"public",
"ResultList",
"<",
"Artwork",
">",
"getPersonImages",
"(",
"int",
"personId",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",
"Param",
".",
"ID",
",",... | Get the images for a specific person id.
@param personId
@return
@throws MovieDbException | [
"Get",
"the",
"images",
"for",
"a",
"specific",
"person",
"id",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java#L216-L231 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java | CleverTapAPI.pushError | @SuppressWarnings( {
"""
Internally records an "Error Occurred" event, which can be viewed in the dashboard.
@param errorMessage The error message
@param errorCode The error code
""""unused", "WeakerAccess"})
public void pushError(final String errorMessage, final int errorCode) {
final HashM... | java | @SuppressWarnings({"unused", "WeakerAccess"})
public void pushError(final String errorMessage, final int errorCode) {
final HashMap<String, Object> props = new HashMap<>();
props.put("Error Message", errorMessage);
props.put("Error Code", errorCode);
try {
final String a... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unused\"",
",",
"\"WeakerAccess\"",
"}",
")",
"public",
"void",
"pushError",
"(",
"final",
"String",
"errorMessage",
",",
"final",
"int",
"errorCode",
")",
"{",
"final",
"HashMap",
"<",
"String",
",",
"Object",
">",
"pro... | Internally records an "Error Occurred" event, which can be viewed in the dashboard.
@param errorMessage The error message
@param errorCode The error code | [
"Internally",
"records",
"an",
"Error",
"Occurred",
"event",
"which",
"can",
"be",
"viewed",
"in",
"the",
"dashboard",
"."
] | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L4569-L4588 |
Waikato/moa | moa/src/main/java/moa/clusterers/kmeanspm/CuckooHashing.java | CuckooHashing.fileElement | private void fileElement(Entry<T> currentElement, boolean rehash) {
"""
Adds an element to one of the tables for Cuckoo Hashing.
@param currentElement
entry to add in a table
@param rehash
if <code>true</code> the hash table will be rebuild when the
stash became too big.
"""
int maxFailures = Math.max... | java | private void fileElement(Entry<T> currentElement, boolean rehash) {
int maxFailures = Math.max((int) Math.log(this.numElements),
this.numTables * 2);
int currentTable = 0;
for (int i = 0; i < maxFailures; i++) {
int hash = this.hashfunctions.get(currentTable).hash(
currentElement.getKey());
current... | [
"private",
"void",
"fileElement",
"(",
"Entry",
"<",
"T",
">",
"currentElement",
",",
"boolean",
"rehash",
")",
"{",
"int",
"maxFailures",
"=",
"Math",
".",
"max",
"(",
"(",
"int",
")",
"Math",
".",
"log",
"(",
"this",
".",
"numElements",
")",
",",
"... | Adds an element to one of the tables for Cuckoo Hashing.
@param currentElement
entry to add in a table
@param rehash
if <code>true</code> the hash table will be rebuild when the
stash became too big. | [
"Adds",
"an",
"element",
"to",
"one",
"of",
"the",
"tables",
"for",
"Cuckoo",
"Hashing",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/kmeanspm/CuckooHashing.java#L132-L156 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/parser/JSONParserInputStream.java | JSONParserInputStream.parse | public <T> T parse(InputStream in, JsonReaderI<T> mapper) throws ParseException, UnsupportedEncodingException {
"""
use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory
"""
InputStreamReader i2 = new InputStreamReader(in, "utf8");
//
return super.parse(i2, ... | java | public <T> T parse(InputStream in, JsonReaderI<T> mapper) throws ParseException, UnsupportedEncodingException {
InputStreamReader i2 = new InputStreamReader(in, "utf8");
//
return super.parse(i2, mapper);
} | [
"public",
"<",
"T",
">",
"T",
"parse",
"(",
"InputStream",
"in",
",",
"JsonReaderI",
"<",
"T",
">",
"mapper",
")",
"throws",
"ParseException",
",",
"UnsupportedEncodingException",
"{",
"InputStreamReader",
"i2",
"=",
"new",
"InputStreamReader",
"(",
"in",
",",... | use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory | [
"use",
"to",
"return",
"Primitive",
"Type",
"or",
"String",
"Or",
"JsonObject",
"or",
"JsonArray",
"generated",
"by",
"a",
"ContainerFactory"
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/parser/JSONParserInputStream.java#L50-L54 |
keshrath/Giphy4J | src/main/java/at/mukprojects/giphy4j/util/UrlUtil.java | UrlUtil.buildUrlQuery | public static String buildUrlQuery(String baseUrl, Map<String, String> params) {
"""
Builds the URL String.
@param baseUrl
the base URL.
@param params
the URL parameter.
@return the URL as String.
"""
if (baseUrl.isEmpty() || params.isEmpty()) {
return baseUrl;
} else {
String query = baseUr... | java | public static String buildUrlQuery(String baseUrl, Map<String, String> params) {
if (baseUrl.isEmpty() || params.isEmpty()) {
return baseUrl;
} else {
String query = baseUrl;
query += QUERY_STRING_SEPARATOR;
for (String key : params.keySet()) {
query += key;
query += PAIR_SEPARATOR;
query +... | [
"public",
"static",
"String",
"buildUrlQuery",
"(",
"String",
"baseUrl",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"if",
"(",
"baseUrl",
".",
"isEmpty",
"(",
")",
"||",
"params",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
... | Builds the URL String.
@param baseUrl
the base URL.
@param params
the URL parameter.
@return the URL as String. | [
"Builds",
"the",
"URL",
"String",
"."
] | train | https://github.com/keshrath/Giphy4J/blob/e56b67f161e2184ccff9b9e8f95a70ef89cec897/src/main/java/at/mukprojects/giphy4j/util/UrlUtil.java#L48-L64 |
alkacon/opencms-core | src/org/opencms/file/wrapper/CmsObjectWrapper.java | CmsObjectWrapper.readFile | public CmsFile readFile(String resourcename, CmsResourceFilter filter) throws CmsException {
"""
Reads a file resource (including it's binary content) from the VFS,
using the specified resource filter.<p>
Iterates through all configured resource wrappers till the first returns not <code>null</code>.<p>
If t... | java | public CmsFile readFile(String resourcename, CmsResourceFilter filter) throws CmsException {
CmsFile res = null;
// iterate through all wrappers and call "readFile" till one does not return null
List<I_CmsResourceWrapper> wrappers = getWrappers();
Iterator<I_CmsResourceWrapper> iter = ... | [
"public",
"CmsFile",
"readFile",
"(",
"String",
"resourcename",
",",
"CmsResourceFilter",
"filter",
")",
"throws",
"CmsException",
"{",
"CmsFile",
"res",
"=",
"null",
";",
"// iterate through all wrappers and call \"readFile\" till one does not return null",
"List",
"<",
"I... | Reads a file resource (including it's binary content) from the VFS,
using the specified resource filter.<p>
Iterates through all configured resource wrappers till the first returns not <code>null</code>.<p>
If the resource contains textual content and the encoding is UTF-8, then the byte order mask
for UTF-8 is added... | [
"Reads",
"a",
"file",
"resource",
"(",
"including",
"it",
"s",
"binary",
"content",
")",
"from",
"the",
"VFS",
"using",
"the",
"specified",
"resource",
"filter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/CmsObjectWrapper.java#L549-L581 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/csskit/antlr4/CSSErrorStrategy.java | CSSErrorStrategy.recoverInline | public Token recoverInline(Parser recognizer) throws RecognitionException {
"""
throws RecognitionException to handle in parser's catch block
"""
throw new RecognitionException(recognizer, recognizer.getInputStream(), recognizer.getContext());
} | java | public Token recoverInline(Parser recognizer) throws RecognitionException {
throw new RecognitionException(recognizer, recognizer.getInputStream(), recognizer.getContext());
} | [
"public",
"Token",
"recoverInline",
"(",
"Parser",
"recognizer",
")",
"throws",
"RecognitionException",
"{",
"throw",
"new",
"RecognitionException",
"(",
"recognizer",
",",
"recognizer",
".",
"getInputStream",
"(",
")",
",",
"recognizer",
".",
"getContext",
"(",
"... | throws RecognitionException to handle in parser's catch block | [
"throws",
"RecognitionException",
"to",
"handle",
"in",
"parser",
"s",
"catch",
"block"
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/csskit/antlr4/CSSErrorStrategy.java#L49-L51 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toInteger | public static Integer toInteger(Object o, Integer defaultValue) {
"""
casts a Object to a Integer
@param o Object to cast to Integer
@param defaultValue
@return Integer from Object
"""
if (defaultValue != null) return Integer.valueOf(toIntValue(o, defaultValue.intValue()));
int res = toIntValue(o, Integ... | java | public static Integer toInteger(Object o, Integer defaultValue) {
if (defaultValue != null) return Integer.valueOf(toIntValue(o, defaultValue.intValue()));
int res = toIntValue(o, Integer.MIN_VALUE);
if (res == Integer.MIN_VALUE) return defaultValue;
return Integer.valueOf(res);
} | [
"public",
"static",
"Integer",
"toInteger",
"(",
"Object",
"o",
",",
"Integer",
"defaultValue",
")",
"{",
"if",
"(",
"defaultValue",
"!=",
"null",
")",
"return",
"Integer",
".",
"valueOf",
"(",
"toIntValue",
"(",
"o",
",",
"defaultValue",
".",
"intValue",
... | casts a Object to a Integer
@param o Object to cast to Integer
@param defaultValue
@return Integer from Object | [
"casts",
"a",
"Object",
"to",
"a",
"Integer"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L4400-L4405 |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/core/Shutterbug.java | Shutterbug.shootPage | public static PageSnapshot shootPage(WebDriver driver, ScrollStrategy scroll, boolean useDevicePixelRatio) {
"""
To be used when screen shooting the page
and need to scroll while making screen shots, either vertically or
horizontally or both directions (Chrome).
@param driver WebDriver instance
@param scroll... | java | public static PageSnapshot shootPage(WebDriver driver, ScrollStrategy scroll, boolean useDevicePixelRatio) {
return shootPage(driver,scroll,0,useDevicePixelRatio);
} | [
"public",
"static",
"PageSnapshot",
"shootPage",
"(",
"WebDriver",
"driver",
",",
"ScrollStrategy",
"scroll",
",",
"boolean",
"useDevicePixelRatio",
")",
"{",
"return",
"shootPage",
"(",
"driver",
",",
"scroll",
",",
"0",
",",
"useDevicePixelRatio",
")",
";",
"}... | To be used when screen shooting the page
and need to scroll while making screen shots, either vertically or
horizontally or both directions (Chrome).
@param driver WebDriver instance
@param scroll ScrollStrategy How you need to scroll
@param useDevicePixelRatio whether or not take into account device pixel ratio
@ret... | [
"To",
"be",
"used",
"when",
"screen",
"shooting",
"the",
"page",
"and",
"need",
"to",
"scroll",
"while",
"making",
"screen",
"shots",
"either",
"vertically",
"or",
"horizontally",
"or",
"both",
"directions",
"(",
"Chrome",
")",
"."
] | train | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/core/Shutterbug.java#L85-L87 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/util/SQSMessagingClientThreadFactory.java | SQSMessagingClientThreadFactory.newThread | public Thread newThread(Runnable r) {
"""
Constructs a new Thread. Initializes name, daemon status, and ThreadGroup
if there is any.
@param r
A runnable to be executed by new thread instance
@return The constructed thread
"""
Thread t;
if (threadGroup == null) {
t = new Thread... | java | public Thread newThread(Runnable r) {
Thread t;
if (threadGroup == null) {
t = new Thread(r, threadBaseName + threadCounter.incrementAndGet());
t.setDaemon(isDaemon);
} else {
t = new Thread(threadGroup, r, threadBaseName + threadCounter.incrementAndGet());
... | [
"public",
"Thread",
"newThread",
"(",
"Runnable",
"r",
")",
"{",
"Thread",
"t",
";",
"if",
"(",
"threadGroup",
"==",
"null",
")",
"{",
"t",
"=",
"new",
"Thread",
"(",
"r",
",",
"threadBaseName",
"+",
"threadCounter",
".",
"incrementAndGet",
"(",
")",
"... | Constructs a new Thread. Initializes name, daemon status, and ThreadGroup
if there is any.
@param r
A runnable to be executed by new thread instance
@return The constructed thread | [
"Constructs",
"a",
"new",
"Thread",
".",
"Initializes",
"name",
"daemon",
"status",
"and",
"ThreadGroup",
"if",
"there",
"is",
"any",
"."
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/util/SQSMessagingClientThreadFactory.java#L61-L71 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/face/AipFace.java | AipFace.detect | public JSONObject detect(String image, String imageType, HashMap<String, String> options) {
"""
人脸检测接口
@param image - 图片信息(**总数据大小应小于10M**),图片上传方式根据image_type来判断
@param imageType - 图片类型 **BASE64**:图片的base64值,base64编码后的图片数据,需urlencode,编码后的图片大小不超过2M;**URL**:图片的 URL地址( 可能由于网络等原因导致下载图片时间过长)**;FACE_TOKEN**: 人脸图片的唯一... | java | public JSONObject detect(String image, String imageType, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("image", image);
request.addBody("image_type", imageType);
if (options != null) {
... | [
"public",
"JSONObject",
"detect",
"(",
"String",
"image",
",",
"String",
"imageType",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
... | 人脸检测接口
@param image - 图片信息(**总数据大小应小于10M**),图片上传方式根据image_type来判断
@param imageType - 图片类型 **BASE64**:图片的base64值,base64编码后的图片数据,需urlencode,编码后的图片大小不超过2M;**URL**:图片的 URL地址( 可能由于网络等原因导致下载图片时间过长)**;FACE_TOKEN**: 人脸图片的唯一标识,调用人脸检测接口时,会为每个人脸图片赋予一个唯一的FACE_TOKEN,同一张图片多次检测得到的FACE_TOKEN是同一个
@param options - 可选参数对象,key: value都为st... | [
"人脸检测接口"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/face/AipFace.java#L47-L61 |
zalando-nakadi/fahrschein | fahrschein/src/main/java/org/zalando/fahrschein/StreamParameters.java | StreamParameters.withBatchFlushTimeout | public StreamParameters withBatchFlushTimeout(int batchFlushTimeout) throws IllegalArgumentException {
"""
Maximum time in seconds to wait for the flushing of each chunk (per partition).
@param batchFlushTimeout
If the amount of buffered Events reaches batch_limit before this batch_flush_timeout is reached,
t... | java | public StreamParameters withBatchFlushTimeout(int batchFlushTimeout) throws IllegalArgumentException {
if (streamTimeout != null && streamTimeout < batchFlushTimeout){
throw new IllegalArgumentException("stream_timeout is lower than batch_flush_timeout.");
}
return new StreamParamet... | [
"public",
"StreamParameters",
"withBatchFlushTimeout",
"(",
"int",
"batchFlushTimeout",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"streamTimeout",
"!=",
"null",
"&&",
"streamTimeout",
"<",
"batchFlushTimeout",
")",
"{",
"throw",
"new",
"IllegalArgumentE... | Maximum time in seconds to wait for the flushing of each chunk (per partition).
@param batchFlushTimeout
If the amount of buffered Events reaches batch_limit before this batch_flush_timeout is reached,
the messages are immediately flushed to the client and batch flush timer is reset.
If 0 or undefined, will assume 30 ... | [
"Maximum",
"time",
"in",
"seconds",
"to",
"wait",
"for",
"the",
"flushing",
"of",
"each",
"chunk",
"(",
"per",
"partition",
")",
"."
] | train | https://github.com/zalando-nakadi/fahrschein/blob/b55ae0ff79aacb300548a88f3969fd11a0904804/fahrschein/src/main/java/org/zalando/fahrschein/StreamParameters.java#L126-L132 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java | NetworkEnvironmentConfiguration.calculateNetworkBufferMemory | @SuppressWarnings("deprecation")
public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) {
"""
Calculates the amount of memory used for network buffers based on the total memory to use and
the according configuration parameters.
<p>The following configuration parameters... | java | @SuppressWarnings("deprecation")
public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) {
final int segmentSize = getPageSize(config);
final long networkBufBytes;
if (hasNewNetworkConfig(config)) {
float networkBufFraction = config.getFloat(TaskManagerOptions.NETWORK_... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"long",
"calculateNetworkBufferMemory",
"(",
"long",
"totalJavaMemorySize",
",",
"Configuration",
"config",
")",
"{",
"final",
"int",
"segmentSize",
"=",
"getPageSize",
"(",
"config",
")",
";"... | Calculates the amount of memory used for network buffers based on the total memory to use and
the according configuration parameters.
<p>The following configuration parameters are involved:
<ul>
<li>{@link TaskManagerOptions#NETWORK_BUFFERS_MEMORY_FRACTION},</li>
<li>{@link TaskManagerOptions#NETWORK_BUFFERS_MEMORY_MI... | [
"Calculates",
"the",
"amount",
"of",
"memory",
"used",
"for",
"network",
"buffers",
"based",
"on",
"the",
"total",
"memory",
"to",
"use",
"and",
"the",
"according",
"configuration",
"parameters",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java#L236-L259 |
JodaOrg/joda-time | src/main/java/org/joda/time/TimeOfDay.java | TimeOfDay.withMillisOfSecond | public TimeOfDay withMillisOfSecond(int millis) {
"""
Returns a copy of this time with the millis of second field updated.
<p>
TimeOfDay is immutable, so there are no set methods.
Instead, this method returns a new instance with the value of
millis of second changed.
@param millis the millis of second to s... | java | public TimeOfDay withMillisOfSecond(int millis) {
int[] newValues = getValues();
newValues = getChronology().millisOfSecond().set(this, MILLIS_OF_SECOND, newValues, millis);
return new TimeOfDay(this, newValues);
} | [
"public",
"TimeOfDay",
"withMillisOfSecond",
"(",
"int",
"millis",
")",
"{",
"int",
"[",
"]",
"newValues",
"=",
"getValues",
"(",
")",
";",
"newValues",
"=",
"getChronology",
"(",
")",
".",
"millisOfSecond",
"(",
")",
".",
"set",
"(",
"this",
",",
"MILLI... | Returns a copy of this time with the millis of second field updated.
<p>
TimeOfDay is immutable, so there are no set methods.
Instead, this method returns a new instance with the value of
millis of second changed.
@param millis the millis of second to set
@return a copy of this object with the field set
@throws Illeg... | [
"Returns",
"a",
"copy",
"of",
"this",
"time",
"with",
"the",
"millis",
"of",
"second",
"field",
"updated",
".",
"<p",
">",
"TimeOfDay",
"is",
"immutable",
"so",
"there",
"are",
"no",
"set",
"methods",
".",
"Instead",
"this",
"method",
"returns",
"a",
"ne... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/TimeOfDay.java#L954-L958 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfDictionary.java | PdfDictionary.toPdf | public void toPdf(PdfWriter writer, OutputStream os) throws IOException {
"""
Writes the PDF representation of this <CODE>PdfDictionary</CODE> as an
array of <CODE>byte</CODE> to the given <CODE>OutputStream</CODE>.
@param writer for backwards compatibility
@param os the <CODE>OutputStream</CODE> to write the... | java | public void toPdf(PdfWriter writer, OutputStream os) throws IOException {
os.write('<');
os.write('<');
// loop over all the object-pairs in the HashMap
for (Map.Entry<PdfName, PdfObject> entry: hashMap.entrySet()){
PdfName key = entry.getKey();
PdfObje... | [
"public",
"void",
"toPdf",
"(",
"PdfWriter",
"writer",
",",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"os",
".",
"write",
"(",
"'",
"'",
")",
";",
"os",
".",
"write",
"(",
"'",
"'",
")",
";",
"// loop over all the object-pairs in the HashMap",... | Writes the PDF representation of this <CODE>PdfDictionary</CODE> as an
array of <CODE>byte</CODE> to the given <CODE>OutputStream</CODE>.
@param writer for backwards compatibility
@param os the <CODE>OutputStream</CODE> to write the bytes to.
@throws IOException | [
"Writes",
"the",
"PDF",
"representation",
"of",
"this",
"<CODE",
">",
"PdfDictionary<",
"/",
"CODE",
">",
"as",
"an",
"array",
"of",
"<CODE",
">",
"byte<",
"/",
"CODE",
">",
"to",
"the",
"given",
"<CODE",
">",
"OutputStream<",
"/",
"CODE",
">",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfDictionary.java#L138-L156 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/mgmt/domain/HostControllerClient.java | HostControllerClient.resolveBootUpdates | void resolveBootUpdates(final ModelController controller, final ActiveOperation.CompletedCallback<ModelNode> callback) throws Exception {
"""
Resolve the boot updates and register at the local HC.
@param controller the model controller
@param callback the completed callback
@throws Exception for any error
... | java | void resolveBootUpdates(final ModelController controller, final ActiveOperation.CompletedCallback<ModelNode> callback) throws Exception {
connection.openConnection(controller, callback);
// Keep a reference to the the controller
this.controller = controller;
} | [
"void",
"resolveBootUpdates",
"(",
"final",
"ModelController",
"controller",
",",
"final",
"ActiveOperation",
".",
"CompletedCallback",
"<",
"ModelNode",
">",
"callback",
")",
"throws",
"Exception",
"{",
"connection",
".",
"openConnection",
"(",
"controller",
",",
"... | Resolve the boot updates and register at the local HC.
@param controller the model controller
@param callback the completed callback
@throws Exception for any error | [
"Resolve",
"the",
"boot",
"updates",
"and",
"register",
"at",
"the",
"local",
"HC",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/mgmt/domain/HostControllerClient.java#L111-L115 |
janus-project/guava.janusproject.io | guava/src/com/google/common/util/concurrent/MoreExecutors.java | MoreExecutors.renamingDecorator | static Executor renamingDecorator(final Executor executor, final Supplier<String> nameSupplier) {
"""
Creates an {@link Executor} that renames the {@link Thread threads} that its tasks run in.
<p>The names are retrieved from the {@code nameSupplier} on the thread that is being renamed
right before each task is... | java | static Executor renamingDecorator(final Executor executor, final Supplier<String> nameSupplier) {
checkNotNull(executor);
checkNotNull(nameSupplier);
if (isAppEngine()) {
// AppEngine doesn't support thread renaming, so don't even try
return executor;
}
return new Executor() {
@Ove... | [
"static",
"Executor",
"renamingDecorator",
"(",
"final",
"Executor",
"executor",
",",
"final",
"Supplier",
"<",
"String",
">",
"nameSupplier",
")",
"{",
"checkNotNull",
"(",
"executor",
")",
";",
"checkNotNull",
"(",
"nameSupplier",
")",
";",
"if",
"(",
"isApp... | Creates an {@link Executor} that renames the {@link Thread threads} that its tasks run in.
<p>The names are retrieved from the {@code nameSupplier} on the thread that is being renamed
right before each task is run. The renaming is best effort, if a {@link SecurityManager}
prevents the renaming then it will be skipped... | [
"Creates",
"an",
"{",
"@link",
"Executor",
"}",
"that",
"renames",
"the",
"{",
"@link",
"Thread",
"threads",
"}",
"that",
"its",
"tasks",
"run",
"in",
"."
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/util/concurrent/MoreExecutors.java#L840-L852 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Base.java | Base.withDb | public static <T> T withDb(String driver, String url, Properties properties, Supplier<T> supplier) {
"""
Same as {@link DB#withDb(String, Properties, Supplier)}, but with db name {@link DB#DEFAULT_NAME}.
"""
return new DB(DB.DEFAULT_NAME).withDb(driver, url, properties, supplier);
} | java | public static <T> T withDb(String driver, String url, Properties properties, Supplier<T> supplier) {
return new DB(DB.DEFAULT_NAME).withDb(driver, url, properties, supplier);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withDb",
"(",
"String",
"driver",
",",
"String",
"url",
",",
"Properties",
"properties",
",",
"Supplier",
"<",
"T",
">",
"supplier",
")",
"{",
"return",
"new",
"DB",
"(",
"DB",
".",
"DEFAULT_NAME",
")",
".",
"... | Same as {@link DB#withDb(String, Properties, Supplier)}, but with db name {@link DB#DEFAULT_NAME}. | [
"Same",
"as",
"{"
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Base.java#L413-L415 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java | HashCodeBuilder.reflectionHashCode | public static <T> int reflectionHashCode(final int initialNonZeroOddNumber, final int multiplierNonZeroOddNumber, final T object,
final boolean testTransients, final Class<? super T> reflectUpToClass, final String... excludeFields) {
"""
<p>
Uses reflection to build a valid hash code from the fields o... | java | public static <T> int reflectionHashCode(final int initialNonZeroOddNumber, final int multiplierNonZeroOddNumber, final T object,
final boolean testTransients, final Class<? super T> reflectUpToClass, final String... excludeFields) {
if (object == null) {
throw new IllegalArgumentExcept... | [
"public",
"static",
"<",
"T",
">",
"int",
"reflectionHashCode",
"(",
"final",
"int",
"initialNonZeroOddNumber",
",",
"final",
"int",
"multiplierNonZeroOddNumber",
",",
"final",
"T",
"object",
",",
"final",
"boolean",
"testTransients",
",",
"final",
"Class",
"<",
... | <p>
Uses reflection to build a valid hash code from the fields of {@code object}.
</p>
<p>
It uses <code>AccessibleObject.setAccessible</code> to gain access to private fields. This means that it will
throw a security exception if run under a security manager, if the permissions are not set up correctly. It is
also no... | [
"<p",
">",
"Uses",
"reflection",
"to",
"build",
"a",
"valid",
"hash",
"code",
"from",
"the",
"fields",
"of",
"{",
"@code",
"object",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java#L331-L345 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseUnionType | private Type parseUnionType(EnclosingScope scope) {
"""
Parse a union type, which is of the form:
<pre>
UnionType ::= IntersectionType ('|' IntersectionType)*
</pre>
@return
"""
int start = index;
Type t = parseIntersectionType(scope);
// Now, attempt to look for union and/or intersection types
... | java | private Type parseUnionType(EnclosingScope scope) {
int start = index;
Type t = parseIntersectionType(scope);
// Now, attempt to look for union and/or intersection types
if (tryAndMatch(true, VerticalBar) != null) {
// This is a union type
ArrayList<Type> types = new ArrayList<>();
types.add(t);
do ... | [
"private",
"Type",
"parseUnionType",
"(",
"EnclosingScope",
"scope",
")",
"{",
"int",
"start",
"=",
"index",
";",
"Type",
"t",
"=",
"parseIntersectionType",
"(",
"scope",
")",
";",
"// Now, attempt to look for union and/or intersection types",
"if",
"(",
"tryAndMatch"... | Parse a union type, which is of the form:
<pre>
UnionType ::= IntersectionType ('|' IntersectionType)*
</pre>
@return | [
"Parse",
"a",
"union",
"type",
"which",
"is",
"of",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L3569-L3585 |
redkale/redkale | src/org/redkale/source/EntityInfo.java | EntityInfo.getSQLValue | public Serializable getSQLValue(Attribute<T, Serializable> attr, T entity) {
"""
字段值转换成数据库的值
@param attr Attribute
@param entity 记录对象
@return Object
"""
Serializable val = attr.get(entity);
CryptHandler cryptHandler = attr.attach();
if (cryptHandler != null) val = (Serializa... | java | public Serializable getSQLValue(Attribute<T, Serializable> attr, T entity) {
Serializable val = attr.get(entity);
CryptHandler cryptHandler = attr.attach();
if (cryptHandler != null) val = (Serializable) cryptHandler.encrypt(val);
return val;
} | [
"public",
"Serializable",
"getSQLValue",
"(",
"Attribute",
"<",
"T",
",",
"Serializable",
">",
"attr",
",",
"T",
"entity",
")",
"{",
"Serializable",
"val",
"=",
"attr",
".",
"get",
"(",
"entity",
")",
";",
"CryptHandler",
"cryptHandler",
"=",
"attr",
".",
... | 字段值转换成数据库的值
@param attr Attribute
@param entity 记录对象
@return Object | [
"字段值转换成数据库的值"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/source/EntityInfo.java#L905-L910 |
wiselenium/wiselenium | wiselenium-factory/src/main/java/com/github/wiselenium/factory/RootInjector.java | RootInjector.rootElement | public static <E> void rootElement(WebElement root, E element) {
"""
Injects the root webelement into an element.
@param root The root webelement.
@param element The element.
@since 0.3.0
"""
if (element == null || root == null) return;
if (element instanceof WebElement) return;
for (Class<?> clazz... | java | public static <E> void rootElement(WebElement root, E element) {
if (element == null || root == null) return;
if (element instanceof WebElement) return;
for (Class<?> clazz = element.getClass(); !clazz.equals(Object.class);
clazz = clazz.getSuperclass()) {
if (Enhancer.isEnhanced(clazz)) continue;
... | [
"public",
"static",
"<",
"E",
">",
"void",
"rootElement",
"(",
"WebElement",
"root",
",",
"E",
"element",
")",
"{",
"if",
"(",
"element",
"==",
"null",
"||",
"root",
"==",
"null",
")",
"return",
";",
"if",
"(",
"element",
"instanceof",
"WebElement",
")... | Injects the root webelement into an element.
@param root The root webelement.
@param element The element.
@since 0.3.0 | [
"Injects",
"the",
"root",
"webelement",
"into",
"an",
"element",
"."
] | train | https://github.com/wiselenium/wiselenium/blob/15de6484d8f516b3d02391d3bd6a56a03e632706/wiselenium-factory/src/main/java/com/github/wiselenium/factory/RootInjector.java#L50-L64 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/web/JwtEndpointServices.java | JwtEndpointServices.processTokenRequest | private void processTokenRequest(HttpServletResponse response, JwtConfig jwtConfig) throws IOException {
"""
produces a JWT token based upon the jwt Configuration, and the security
credentials of the authenticated user that called this method. Returns
the token as JSON in the response.
@param response
@param... | java | private void processTokenRequest(HttpServletResponse response, JwtConfig jwtConfig) throws IOException {
String tokenString = new TokenBuilder().createTokenString(jwtConfig);
addNoCacheHeaders(response);
response.setStatus(200);
if (tokenString == null) {
return;
}
try {
PrintWriter pw = response.ge... | [
"private",
"void",
"processTokenRequest",
"(",
"HttpServletResponse",
"response",
",",
"JwtConfig",
"jwtConfig",
")",
"throws",
"IOException",
"{",
"String",
"tokenString",
"=",
"new",
"TokenBuilder",
"(",
")",
".",
"createTokenString",
"(",
"jwtConfig",
")",
";",
... | produces a JWT token based upon the jwt Configuration, and the security
credentials of the authenticated user that called this method. Returns
the token as JSON in the response.
@param response
@param jwtConfig
@throws IOException | [
"produces",
"a",
"JWT",
"token",
"based",
"upon",
"the",
"jwt",
"Configuration",
"and",
"the",
"security",
"credentials",
"of",
"the",
"authenticated",
"user",
"that",
"called",
"this",
"method",
".",
"Returns",
"the",
"token",
"as",
"JSON",
"in",
"the",
"re... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/web/JwtEndpointServices.java#L224-L244 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-parameterserver/src/main/java/org/deeplearning4j/spark/parameterserver/networking/v1/WiredEncodingHandler.java | WiredEncodingHandler.sendMessage | @Override
protected void sendMessage(INDArray message, int iterationNumber, int epochNumber) {
"""
This method sends given message to all registered recipients
@param message
"""
// here we'll send our stuff to other executores over the wire
// and let's pray for udp broadcast availabili... | java | @Override
protected void sendMessage(INDArray message, int iterationNumber, int epochNumber) {
// here we'll send our stuff to other executores over the wire
// and let's pray for udp broadcast availability
// Send this message away
// FIXME: do something with unsafe duplication, wh... | [
"@",
"Override",
"protected",
"void",
"sendMessage",
"(",
"INDArray",
"message",
",",
"int",
"iterationNumber",
",",
"int",
"epochNumber",
")",
"{",
"// here we'll send our stuff to other executores over the wire",
"// and let's pray for udp broadcast availability",
"// Send this... | This method sends given message to all registered recipients
@param message | [
"This",
"method",
"sends",
"given",
"message",
"to",
"all",
"registered",
"recipients"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-parameterserver/src/main/java/org/deeplearning4j/spark/parameterserver/networking/v1/WiredEncodingHandler.java#L57-L74 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/helper/JMOptional.java | JMOptional.orElseIfNull | public static <T> T orElseIfNull(T target, T elseTarget) {
"""
Or else if null t.
@param <T> the type parameter
@param target the target
@param elseTarget the else target
@return the t
"""
return Optional.ofNullable(target).orElse(elseTarget);
} | java | public static <T> T orElseIfNull(T target, T elseTarget) {
return Optional.ofNullable(target).orElse(elseTarget);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"orElseIfNull",
"(",
"T",
"target",
",",
"T",
"elseTarget",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"target",
")",
".",
"orElse",
"(",
"elseTarget",
")",
";",
"}"
] | Or else if null t.
@param <T> the type parameter
@param target the target
@param elseTarget the else target
@return the t | [
"Or",
"else",
"if",
"null",
"t",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/helper/JMOptional.java#L241-L243 |
JCTools/JCTools | jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicQueueGenerator.java | JavaParsingAtomicQueueGenerator.declareLongFieldUpdater | protected FieldDeclaration declareLongFieldUpdater(String className, String variableName) {
"""
Generates something like
<code>private static final AtomicLongFieldUpdater<MpmcAtomicArrayQueueProducerIndexField> P_INDEX_UPDATER = AtomicLongFieldUpdater.newUpdater(MpmcAtomicArrayQueueProducerIndexField.class, "prod... | java | protected FieldDeclaration declareLongFieldUpdater(String className, String variableName) {
MethodCallExpr initializer = newAtomicLongFieldUpdater(className, variableName);
ClassOrInterfaceType type = simpleParametricType("AtomicLongFieldUpdater", className);
FieldDeclaration newField = fieldDe... | [
"protected",
"FieldDeclaration",
"declareLongFieldUpdater",
"(",
"String",
"className",
",",
"String",
"variableName",
")",
"{",
"MethodCallExpr",
"initializer",
"=",
"newAtomicLongFieldUpdater",
"(",
"className",
",",
"variableName",
")",
";",
"ClassOrInterfaceType",
"ty... | Generates something like
<code>private static final AtomicLongFieldUpdater<MpmcAtomicArrayQueueProducerIndexField> P_INDEX_UPDATER = AtomicLongFieldUpdater.newUpdater(MpmcAtomicArrayQueueProducerIndexField.class, "producerIndex");</code>
@param className
@param variableName
@return | [
"Generates",
"something",
"like",
"<code",
">",
"private",
"static",
"final",
"AtomicLongFieldUpdater<MpmcAtomicArrayQueueProducerIndexField",
">",
"P_INDEX_UPDATER",
"=",
"AtomicLongFieldUpdater",
".",
"newUpdater",
"(",
"MpmcAtomicArrayQueueProducerIndexField",
".",
"class",
... | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicQueueGenerator.java#L247-L254 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/StructurizrDocumentationTemplate.java | StructurizrDocumentationTemplate.addCodeSection | @Nonnull
public Section addCodeSection(@Nullable Component component, File... files) throws IOException {
"""
Adds a "Code" section relating to a {@link Component} from one or more files.
@param component the {@link Component} the documentation content relates to
@param files one or more File o... | java | @Nonnull
public Section addCodeSection(@Nullable Component component, File... files) throws IOException {
return addSection(component, "Code", files);
} | [
"@",
"Nonnull",
"public",
"Section",
"addCodeSection",
"(",
"@",
"Nullable",
"Component",
"component",
",",
"File",
"...",
"files",
")",
"throws",
"IOException",
"{",
"return",
"addSection",
"(",
"component",
",",
"\"Code\"",
",",
"files",
")",
";",
"}"
] | Adds a "Code" section relating to a {@link Component} from one or more files.
@param component the {@link Component} the documentation content relates to
@param files one or more File objects that point to the documentation content
@return a documentation {@link Section}
@throws IOException ... | [
"Adds",
"a",
"Code",
"section",
"relating",
"to",
"a",
"{",
"@link",
"Component",
"}",
"from",
"one",
"or",
"more",
"files",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/StructurizrDocumentationTemplate.java#L265-L268 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeValidator.java | TypeValidator.expectSwitchMatchesCase | void expectSwitchMatchesCase(Node n, JSType switchType, JSType caseType) {
"""
Expect that the type of a switch condition matches the type of its case condition.
"""
// ECMA-262, page 68, step 3 of evaluation of CaseBlock,
// but allowing extra autoboxing.
// TODO(user): remove extra conditions whe... | java | void expectSwitchMatchesCase(Node n, JSType switchType, JSType caseType) {
// ECMA-262, page 68, step 3 of evaluation of CaseBlock,
// but allowing extra autoboxing.
// TODO(user): remove extra conditions when type annotations
// in the code base have adapted to the change in the compiler.
if (!swit... | [
"void",
"expectSwitchMatchesCase",
"(",
"Node",
"n",
",",
"JSType",
"switchType",
",",
"JSType",
"caseType",
")",
"{",
"// ECMA-262, page 68, step 3 of evaluation of CaseBlock,",
"// but allowing extra autoboxing.",
"// TODO(user): remove extra conditions when type annotations",
"// ... | Expect that the type of a switch condition matches the type of its case condition. | [
"Expect",
"that",
"the",
"type",
"of",
"a",
"switch",
"condition",
"matches",
"the",
"type",
"of",
"its",
"case",
"condition",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L519-L533 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/stream/AbstractStreamMessage.java | AbstractStreamMessage.cleanupQueue | void cleanupQueue(SubscriptionImpl subscription, Queue<Object> queue) {
"""
Helper method for the common case of cleaning up all elements in a queue when shutting down the stream.
"""
final Throwable cause = ClosedPublisherException.get();
for (;;) {
final Object e = queue.poll();
... | java | void cleanupQueue(SubscriptionImpl subscription, Queue<Object> queue) {
final Throwable cause = ClosedPublisherException.get();
for (;;) {
final Object e = queue.poll();
if (e == null) {
break;
}
try {
if (e instanceof Clos... | [
"void",
"cleanupQueue",
"(",
"SubscriptionImpl",
"subscription",
",",
"Queue",
"<",
"Object",
">",
"queue",
")",
"{",
"final",
"Throwable",
"cause",
"=",
"ClosedPublisherException",
".",
"get",
"(",
")",
";",
"for",
"(",
";",
";",
")",
"{",
"final",
"Objec... | Helper method for the common case of cleaning up all elements in a queue when shutting down the stream. | [
"Helper",
"method",
"for",
"the",
"common",
"case",
"of",
"cleaning",
"up",
"all",
"elements",
"in",
"a",
"queue",
"when",
"shutting",
"down",
"the",
"stream",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/stream/AbstractStreamMessage.java#L190-L215 |
graknlabs/grakn | server/src/server/kb/concept/ConceptUtils.java | ConceptUtils.areDisjointTypes | public static boolean areDisjointTypes(SchemaConcept parent, SchemaConcept child, boolean direct) {
"""
determines disjointness of parent-child types, parent defines the bound on the child
@param parent {@link SchemaConcept}
@param child {@link SchemaConcept}
@return true if types do not belong to the same type... | java | public static boolean areDisjointTypes(SchemaConcept parent, SchemaConcept child, boolean direct) {
return parent != null && child == null || !typesCompatible(parent, child, direct) && !typesCompatible(child, parent, direct);
} | [
"public",
"static",
"boolean",
"areDisjointTypes",
"(",
"SchemaConcept",
"parent",
",",
"SchemaConcept",
"child",
",",
"boolean",
"direct",
")",
"{",
"return",
"parent",
"!=",
"null",
"&&",
"child",
"==",
"null",
"||",
"!",
"typesCompatible",
"(",
"parent",
",... | determines disjointness of parent-child types, parent defines the bound on the child
@param parent {@link SchemaConcept}
@param child {@link SchemaConcept}
@return true if types do not belong to the same type hierarchy, also true if parent is null and false if parent non-null and child null | [
"determines",
"disjointness",
"of",
"parent",
"-",
"child",
"types",
"parent",
"defines",
"the",
"bound",
"on",
"the",
"child"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/kb/concept/ConceptUtils.java#L108-L110 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/velocity/VelocityEngineFactory.java | VelocityEngineFactory.getVelocityEngine | public static synchronized VelocityEngine getVelocityEngine() {
"""
<p>
Returns the VelocityEngine associated with this factory. If this is the first time we are using the engine,
create it and initialise it.</p>
<p>
Note that velocity engines are hugely resource intensive, so we don't want too many of them.... | java | public static synchronized VelocityEngine getVelocityEngine() {
if (engine == null) {
String fileTemplates = ConfigurationProperties.getVelocityFileTemplates();
boolean cacheTemplates = ConfigurationProperties.getVelocityCacheTemplates();
VelocityEngine newEngine = new VelocityEngine();
Properties props ... | [
"public",
"static",
"synchronized",
"VelocityEngine",
"getVelocityEngine",
"(",
")",
"{",
"if",
"(",
"engine",
"==",
"null",
")",
"{",
"String",
"fileTemplates",
"=",
"ConfigurationProperties",
".",
"getVelocityFileTemplates",
"(",
")",
";",
"boolean",
"cacheTemplat... | <p>
Returns the VelocityEngine associated with this factory. If this is the first time we are using the engine,
create it and initialise it.</p>
<p>
Note that velocity engines are hugely resource intensive, so we don't want too many of them. For the time being
we have a single instance stored as a static variable. Thi... | [
"<p",
">",
"Returns",
"the",
"VelocityEngine",
"associated",
"with",
"this",
"factory",
".",
"If",
"this",
"is",
"the",
"first",
"time",
"we",
"are",
"using",
"the",
"engine",
"create",
"it",
"and",
"initialise",
"it",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/velocity/VelocityEngineFactory.java#L51-L107 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/streaming/IcyInputStream.java | IcyInputStream.readInitialHeaders | protected void readInitialHeaders() throws IOException {
"""
Assuming we're at the top of the stream, read lines one
by one until we hit a completely blank \r\n. Parse the
data as IcyTags.
"""
String line;
while ((line = readCRLFLine()).length()!=0)
{
int colonIndex = line.indexOf(':');
// does ... | java | protected void readInitialHeaders() throws IOException
{
String line;
while ((line = readCRLFLine()).length()!=0)
{
int colonIndex = line.indexOf(':');
// does it have a ':' separator
if (colonIndex == -1) continue;
String tagName = line.substring(0, colonIndex);
String value = line.substring(colo... | [
"protected",
"void",
"readInitialHeaders",
"(",
")",
"throws",
"IOException",
"{",
"String",
"line",
";",
"while",
"(",
"(",
"line",
"=",
"readCRLFLine",
"(",
")",
")",
".",
"length",
"(",
")",
"!=",
"0",
")",
"{",
"int",
"colonIndex",
"=",
"line",
"."... | Assuming we're at the top of the stream, read lines one
by one until we hit a completely blank \r\n. Parse the
data as IcyTags. | [
"Assuming",
"we",
"re",
"at",
"the",
"top",
"of",
"the",
"stream",
"read",
"lines",
"one",
"by",
"one",
"until",
"we",
"hit",
"a",
"completely",
"blank",
"\\",
"r",
"\\",
"n",
".",
"Parse",
"the",
"data",
"as",
"IcyTags",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/streaming/IcyInputStream.java#L183-L197 |
apereo/cas | support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/authentication/SecurityTokenServiceClientBuilder.java | SecurityTokenServiceClientBuilder.buildClientForSecurityTokenRequests | public SecurityTokenServiceClient buildClientForSecurityTokenRequests(final WSFederationRegisteredService service) {
"""
Build client for security token requests.
@param service the rp
@return the security token service client
"""
val cxfBus = BusFactory.getDefaultBus();
val sts = new Secur... | java | public SecurityTokenServiceClient buildClientForSecurityTokenRequests(final WSFederationRegisteredService service) {
val cxfBus = BusFactory.getDefaultBus();
val sts = new SecurityTokenServiceClient(cxfBus);
sts.setAddressingNamespace(StringUtils.defaultIfBlank(service.getAddressingNamespace(), ... | [
"public",
"SecurityTokenServiceClient",
"buildClientForSecurityTokenRequests",
"(",
"final",
"WSFederationRegisteredService",
"service",
")",
"{",
"val",
"cxfBus",
"=",
"BusFactory",
".",
"getDefaultBus",
"(",
")",
";",
"val",
"sts",
"=",
"new",
"SecurityTokenServiceClien... | Build client for security token requests.
@param service the rp
@return the security token service client | [
"Build",
"client",
"for",
"security",
"token",
"requests",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/authentication/SecurityTokenServiceClientBuilder.java#L34-L49 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.and | private WyalFile.Stmt and(WyalFile.Stmt lhs, WyalFile.Stmt rhs) {
"""
Construct a conjunction of two expressions
@param lhs
@param rhs
@return
"""
if (lhs == null) {
return rhs;
} else if (rhs == null) {
return rhs;
} else {
return new WyalFile.Stmt.Block(lhs, rhs);
}
} | java | private WyalFile.Stmt and(WyalFile.Stmt lhs, WyalFile.Stmt rhs) {
if (lhs == null) {
return rhs;
} else if (rhs == null) {
return rhs;
} else {
return new WyalFile.Stmt.Block(lhs, rhs);
}
} | [
"private",
"WyalFile",
".",
"Stmt",
"and",
"(",
"WyalFile",
".",
"Stmt",
"lhs",
",",
"WyalFile",
".",
"Stmt",
"rhs",
")",
"{",
"if",
"(",
"lhs",
"==",
"null",
")",
"{",
"return",
"rhs",
";",
"}",
"else",
"if",
"(",
"rhs",
"==",
"null",
")",
"{",
... | Construct a conjunction of two expressions
@param lhs
@param rhs
@return | [
"Construct",
"a",
"conjunction",
"of",
"two",
"expressions"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L1738-L1746 |
samskivert/samskivert | src/main/java/com/samskivert/util/CompactIntListUtil.java | CompactIntListUtil.contains | public static boolean contains (int[] list, int value) {
"""
Looks for an element that is equal to the supplied value.
@return true if a matching value was found, false otherwise.
"""
int llength = list.length; // no optimizing bastards
for (int i = 0; i < llength; i++) {
if (lis... | java | public static boolean contains (int[] list, int value)
{
int llength = list.length; // no optimizing bastards
for (int i = 0; i < llength; i++) {
if (list[i] == value) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"contains",
"(",
"int",
"[",
"]",
"list",
",",
"int",
"value",
")",
"{",
"int",
"llength",
"=",
"list",
".",
"length",
";",
"// no optimizing bastards",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"llength",
";",
"... | Looks for an element that is equal to the supplied value.
@return true if a matching value was found, false otherwise. | [
"Looks",
"for",
"an",
"element",
"that",
"is",
"equal",
"to",
"the",
"supplied",
"value",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CompactIntListUtil.java#L54-L63 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/stat/TimePeriod.java | TimePeriod.from | static public TimePeriod from(String quantityAndUnit) {
"""
Parse strings like '1 hour', '2 days', '3 Years', '12 minute' into TimePeriod.
Short formats like '1H', '2 D', '3y' are also supported.
@param quantityAndUnit the string to be parsed
@return Both quantity and unit
"""
String trimed = quantityAndU... | java | static public TimePeriod from(String quantityAndUnit) {
String trimed = quantityAndUnit.trim();
String allExceptLast = trimed.substring(0, trimed.length() - 1);
if (StringUtils.isNumericSpace(allExceptLast)){ // short format
long quantity = Long.parseLong(allExceptLast.trim());
TimePeriodUnit unit = TimePer... | [
"static",
"public",
"TimePeriod",
"from",
"(",
"String",
"quantityAndUnit",
")",
"{",
"String",
"trimed",
"=",
"quantityAndUnit",
".",
"trim",
"(",
")",
";",
"String",
"allExceptLast",
"=",
"trimed",
".",
"substring",
"(",
"0",
",",
"trimed",
".",
"length",
... | Parse strings like '1 hour', '2 days', '3 Years', '12 minute' into TimePeriod.
Short formats like '1H', '2 D', '3y' are also supported.
@param quantityAndUnit the string to be parsed
@return Both quantity and unit | [
"Parse",
"strings",
"like",
"1",
"hour",
"2",
"days",
"3",
"Years",
"12",
"minute",
"into",
"TimePeriod",
".",
"Short",
"formats",
"like",
"1H",
"2",
"D",
"3y",
"are",
"also",
"supported",
"."
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/stat/TimePeriod.java#L104-L117 |
bwkimmel/jdcp | jdcp-console/src/main/java/ca/eandb/jdcp/client/ScriptFacade.java | ScriptFacade.submitJob | public UUID submitJob(ParallelizableJob job) throws Exception {
"""
Submits a job to be processed.
@param job The <code>ParallelizableJob</code> to submit.
@return The <code>UUID</code> identifying the submitted job.
@throws Exception if an error occurs in delegating the request to the
configured job service
... | java | public UUID submitJob(ParallelizableJob job) throws Exception {
return submitJob(job, job.getClass().getSimpleName());
} | [
"public",
"UUID",
"submitJob",
"(",
"ParallelizableJob",
"job",
")",
"throws",
"Exception",
"{",
"return",
"submitJob",
"(",
"job",
",",
"job",
".",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
")",
";",
"}"
] | Submits a job to be processed.
@param job The <code>ParallelizableJob</code> to submit.
@return The <code>UUID</code> identifying the submitted job.
@throws Exception if an error occurs in delegating the request to the
configured job service | [
"Submits",
"a",
"job",
"to",
"be",
"processed",
"."
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-console/src/main/java/ca/eandb/jdcp/client/ScriptFacade.java#L103-L105 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getRolesBatch | public OneLoginResponse<Role> getRolesBatch(int batchSize, String afterCursor)
throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Get a batch of Roles.
@param batchSize Size of the Batch
@param afterCursor Reference to continue collecting items of next page
@return OneLoginRespo... | java | public OneLoginResponse<Role> getRolesBatch(int batchSize, String afterCursor)
throws OAuthSystemException, OAuthProblemException, URISyntaxException {
return getRolesBatch(new HashMap<String, String>(), batchSize, afterCursor);
} | [
"public",
"OneLoginResponse",
"<",
"Role",
">",
"getRolesBatch",
"(",
"int",
"batchSize",
",",
"String",
"afterCursor",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"return",
"getRolesBatch",
"(",
"new",
"HashMap... | Get a batch of Roles.
@param batchSize Size of the Batch
@param afterCursor Reference to continue collecting items of next page
@return OneLoginResponse of Role (Batch)
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are er... | [
"Get",
"a",
"batch",
"of",
"Roles",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L1758-L1761 |
vipshop/vjtools | vjmap/src/main/java/com/vip/vjtools/vjmap/VJMap.java | VJMap.triggerGc | private static void triggerGc(Integer pid) {
"""
Trigger a remote gc using HotSpotVirtualMachine, inspired by jcmd's source code.
@param pid
"""
VirtualMachine vm = null;
try {
vm = VirtualMachine.attach(String.valueOf(pid));
HotSpotVirtualMachine hvm = (HotSpotVirtualMachine) vm;
try (InputStr... | java | private static void triggerGc(Integer pid) {
VirtualMachine vm = null;
try {
vm = VirtualMachine.attach(String.valueOf(pid));
HotSpotVirtualMachine hvm = (HotSpotVirtualMachine) vm;
try (InputStream in = hvm.executeJCmd("GC.run");) {
byte b[] = new byte[256];
int n;
do {
n = in.read(b);
... | [
"private",
"static",
"void",
"triggerGc",
"(",
"Integer",
"pid",
")",
"{",
"VirtualMachine",
"vm",
"=",
"null",
";",
"try",
"{",
"vm",
"=",
"VirtualMachine",
".",
"attach",
"(",
"String",
".",
"valueOf",
"(",
"pid",
")",
")",
";",
"HotSpotVirtualMachine",
... | Trigger a remote gc using HotSpotVirtualMachine, inspired by jcmd's source code.
@param pid | [
"Trigger",
"a",
"remote",
"gc",
"using",
"HotSpotVirtualMachine",
"inspired",
"by",
"jcmd",
"s",
"source",
"code",
"."
] | train | https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjmap/src/main/java/com/vip/vjtools/vjmap/VJMap.java#L243-L271 |
forge/core | scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/inspector/propertystyle/ForgePropertyStyle.java | ForgePropertyStyle.isSetter | protected String isSetter(final Method<?, ?> method) {
"""
Returns whether the given method is a 'setter' method.
@param method a single-parametered method. May return non-void (ie. for Fluent interfaces)
@return the property name
"""
String methodName = method.getName();
if (!methodName.start... | java | protected String isSetter(final Method<?, ?> method)
{
String methodName = method.getName();
if (!methodName.startsWith(ClassUtils.JAVABEAN_SET_PREFIX))
{
return null;
}
String propertyName = methodName.substring(ClassUtils.JAVABEAN_SET_PREFIX.length());
return StringU... | [
"protected",
"String",
"isSetter",
"(",
"final",
"Method",
"<",
"?",
",",
"?",
">",
"method",
")",
"{",
"String",
"methodName",
"=",
"method",
".",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"methodName",
".",
"startsWith",
"(",
"ClassUtils",
".",
"JAVA... | Returns whether the given method is a 'setter' method.
@param method a single-parametered method. May return non-void (ie. for Fluent interfaces)
@return the property name | [
"Returns",
"whether",
"the",
"given",
"method",
"is",
"a",
"setter",
"method",
"."
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/scaffold/spi/src/main/java/org/jboss/forge/addon/scaffold/metawidget/inspector/propertystyle/ForgePropertyStyle.java#L361-L373 |
esigate/esigate | esigate-core/src/main/java/org/esigate/impl/FragmentRedirectStrategy.java | FragmentRedirectStrategy.getLocationURI | @Override
public URI getLocationURI(HttpRequest request, HttpResponse response, HttpContext context) throws ProtocolException {
"""
For local redirects, converts to relative urls.
@param request
must be an {@link OutgoingRequest}.
"""
URI uri = this.redirectStrategy.getLocationURI(request, resp... | java | @Override
public URI getLocationURI(HttpRequest request, HttpResponse response, HttpContext context) throws ProtocolException {
URI uri = this.redirectStrategy.getLocationURI(request, response, context);
String resultingPageUrl = uri.toString();
DriverRequest driverRequest = ((OutgoingRequ... | [
"@",
"Override",
"public",
"URI",
"getLocationURI",
"(",
"HttpRequest",
"request",
",",
"HttpResponse",
"response",
",",
"HttpContext",
"context",
")",
"throws",
"ProtocolException",
"{",
"URI",
"uri",
"=",
"this",
".",
"redirectStrategy",
".",
"getLocationURI",
"... | For local redirects, converts to relative urls.
@param request
must be an {@link OutgoingRequest}. | [
"For",
"local",
"redirects",
"converts",
"to",
"relative",
"urls",
"."
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/impl/FragmentRedirectStrategy.java#L78-L96 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java | SocketBindingJBossASClient.addSocketBinding | public void addSocketBinding(String socketBindingGroupName, String socketBindingName, String sysPropName, int port)
throws Exception {
"""
Adds a socket binding with the given name in the named socket binding group.
If sysPropName is null, this simply sets the port number explicitly to the given port numb... | java | public void addSocketBinding(String socketBindingGroupName, String socketBindingName, String sysPropName, int port)
throws Exception {
if (isSocketBinding(socketBindingGroupName, socketBindingName)) {
return;
}
String portValue;
if (sysPropName != null) {
... | [
"public",
"void",
"addSocketBinding",
"(",
"String",
"socketBindingGroupName",
",",
"String",
"socketBindingName",
",",
"String",
"sysPropName",
",",
"int",
"port",
")",
"throws",
"Exception",
"{",
"if",
"(",
"isSocketBinding",
"(",
"socketBindingGroupName",
",",
"s... | Adds a socket binding with the given name in the named socket binding group.
If sysPropName is null, this simply sets the port number explicitly to the given port number.
If sysPropName is not null, this sets the port to the expression "${sysPropName:port}".
If a socket binding with the given name already exists, this... | [
"Adds",
"a",
"socket",
"binding",
"with",
"the",
"given",
"name",
"in",
"the",
"named",
"socket",
"binding",
"group",
".",
"If",
"sysPropName",
"is",
"null",
"this",
"simply",
"sets",
"the",
"port",
"number",
"explicitly",
"to",
"the",
"given",
"port",
"nu... | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java#L133-L159 |
alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/ZookeeperUtils.java | ZookeeperUtils.buildQuorum | public static String buildQuorum(List<HostAndPort> hostAndPorts, int defaultPort) {
"""
Build a quorum list, injecting a ":defaultPort" ref if needed on
any entry without one
@param hostAndPorts
@param defaultPort
@return
"""
List<String> entries = new ArrayList<String>(hostAndPorts.size());
for (H... | java | public static String buildQuorum(List<HostAndPort> hostAndPorts, int defaultPort) {
List<String> entries = new ArrayList<String>(hostAndPorts.size());
for (HostAndPort hostAndPort : hostAndPorts) {
entries.add(buildQuorumEntry(hostAndPort, defaultPort));
}
return JstormYarnUtils.join(entries, ",",... | [
"public",
"static",
"String",
"buildQuorum",
"(",
"List",
"<",
"HostAndPort",
">",
"hostAndPorts",
",",
"int",
"defaultPort",
")",
"{",
"List",
"<",
"String",
">",
"entries",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"hostAndPorts",
".",
"size",
"(... | Build a quorum list, injecting a ":defaultPort" ref if needed on
any entry without one
@param hostAndPorts
@param defaultPort
@return | [
"Build",
"a",
"quorum",
"list",
"injecting",
"a",
":",
"defaultPort",
"ref",
"if",
"needed",
"on",
"any",
"entry",
"without",
"one"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/ZookeeperUtils.java#L114-L120 |
lucee/Lucee | loader/src/main/java/lucee/runtime/ext/tag/TagSupport.java | TagSupport.required | public void required(final String tagName, final String actionName, final String attributeName, final Object attribute) throws PageException {
"""
check if value is not empty
@param tagName
@param actionName
@param attributeName
@param attribute
@throws PageException
"""
if (attribute == null) {
f... | java | public void required(final String tagName, final String actionName, final String attributeName, final Object attribute) throws PageException {
if (attribute == null) {
final Excepton util = CFMLEngineFactory.getInstance().getExceptionUtil();
throw util.createApplicationException("Attribute [" + attributeName... | [
"public",
"void",
"required",
"(",
"final",
"String",
"tagName",
",",
"final",
"String",
"actionName",
",",
"final",
"String",
"attributeName",
",",
"final",
"Object",
"attribute",
")",
"throws",
"PageException",
"{",
"if",
"(",
"attribute",
"==",
"null",
")",... | check if value is not empty
@param tagName
@param actionName
@param attributeName
@param attribute
@throws PageException | [
"check",
"if",
"value",
"is",
"not",
"empty"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/loader/src/main/java/lucee/runtime/ext/tag/TagSupport.java#L108-L113 |
allengeorge/libraft | libraft-core/src/main/java/io/libraft/algorithm/RaftAlgorithm.java | RaftAlgorithm.becomeFollower | synchronized void becomeFollower(long newCurrentTerm, @Nullable String newLeader) throws StorageException {
"""
Transition this server from {@link Role#CANDIDATE} or {@link Role#LEADER} to {@link Role#FOLLOWER}.
<p/>
<strong>This method is package-private for testing
reasons only!</strong> It should <strong>nev... | java | synchronized void becomeFollower(long newCurrentTerm, @Nullable String newLeader) throws StorageException {
long currentTerm = store.getCurrentTerm();
checkArgument(currentTerm < newCurrentTerm, "currentTerm:%s newCurrentTerm:%s", currentTerm, newCurrentTerm);
logRoleChange(newCurrentTerm, rol... | [
"synchronized",
"void",
"becomeFollower",
"(",
"long",
"newCurrentTerm",
",",
"@",
"Nullable",
"String",
"newLeader",
")",
"throws",
"StorageException",
"{",
"long",
"currentTerm",
"=",
"store",
".",
"getCurrentTerm",
"(",
")",
";",
"checkArgument",
"(",
"currentT... | Transition this server from {@link Role#CANDIDATE} or {@link Role#LEADER} to {@link Role#FOLLOWER}.
<p/>
<strong>This method is package-private for testing
reasons only!</strong> It should <strong>never</strong>
be called in a non-test context!
@param newCurrentTerm new election term for this {@code RaftAlgorithm} ins... | [
"Transition",
"this",
"server",
"from",
"{",
"@link",
"Role#CANDIDATE",
"}",
"or",
"{",
"@link",
"Role#LEADER",
"}",
"to",
"{",
"@link",
"Role#FOLLOWER",
"}",
".",
"<p",
"/",
">",
"<strong",
">",
"This",
"method",
"is",
"package",
"-",
"private",
"for",
... | train | https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-core/src/main/java/io/libraft/algorithm/RaftAlgorithm.java#L1037-L1049 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.unpackEntry | public static boolean unpackEntry(File zip, String name, File file, Charset charset) {
"""
Unpacks a single file from a ZIP archive to a file.
@param zip
ZIP file.
@param name
entry name.
@param file
target file to be created or overwritten.
@param charset
charset to be used processing the zip
@return... | java | public static boolean unpackEntry(File zip, String name, File file, Charset charset) {
ZipFile zf = null;
try {
if (charset != null) {
zf = new ZipFile(zip, charset);
}
else {
zf = new ZipFile(zip);
}
return doUnpackEntry(zf, name, file);
}
catch (IOExceptio... | [
"public",
"static",
"boolean",
"unpackEntry",
"(",
"File",
"zip",
",",
"String",
"name",
",",
"File",
"file",
",",
"Charset",
"charset",
")",
"{",
"ZipFile",
"zf",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"charset",
"!=",
"null",
")",
"{",
"zf",
"=",... | Unpacks a single file from a ZIP archive to a file.
@param zip
ZIP file.
@param name
entry name.
@param file
target file to be created or overwritten.
@param charset
charset to be used processing the zip
@return <code>true</code> if the entry was found and unpacked,
<code>false</code> if the entry was not found. | [
"Unpacks",
"a",
"single",
"file",
"from",
"a",
"ZIP",
"archive",
"to",
"a",
"file",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L337-L354 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/internal/http/JsonErrorCodeParser.java | JsonErrorCodeParser.parseErrorCode | public String parseErrorCode(HttpResponse response, JsonContent jsonContent) {
"""
Parse the error code from the response.
@return Error Code of exceptional response or null if it can't be determined
"""
String errorCodeFromHeader = parseErrorCodeFromHeader(response.getHeaders());
if (errorC... | java | public String parseErrorCode(HttpResponse response, JsonContent jsonContent) {
String errorCodeFromHeader = parseErrorCodeFromHeader(response.getHeaders());
if (errorCodeFromHeader != null) {
return errorCodeFromHeader;
} else if (jsonContent != null) {
return parseErrorC... | [
"public",
"String",
"parseErrorCode",
"(",
"HttpResponse",
"response",
",",
"JsonContent",
"jsonContent",
")",
"{",
"String",
"errorCodeFromHeader",
"=",
"parseErrorCodeFromHeader",
"(",
"response",
".",
"getHeaders",
"(",
")",
")",
";",
"if",
"(",
"errorCodeFromHea... | Parse the error code from the response.
@return Error Code of exceptional response or null if it can't be determined | [
"Parse",
"the",
"error",
"code",
"from",
"the",
"response",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/internal/http/JsonErrorCodeParser.java#L48-L57 |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/widget/element/html/CheckBox.java | CheckBox.setValue | @Override
public void setValue(Object value) throws WidgetException {
"""
Sets the value of the CheckBox
@param value
- String that can be one of two values: CHECK - sets checkbox
from UNCHECKED to CHECK UNCHECK - sets checkbox from CHECKED
to UNCHECKED
"""
boolean set = false;
try {
... | java | @Override
public void setValue(Object value) throws WidgetException {
boolean set = false;
try {
if (value instanceof String) {
if (((String) value).equalsIgnoreCase(UNCHECK)) {
doAction(true);
} else if (((String) value).equalsIgnoreCa... | [
"@",
"Override",
"public",
"void",
"setValue",
"(",
"Object",
"value",
")",
"throws",
"WidgetException",
"{",
"boolean",
"set",
"=",
"false",
";",
"try",
"{",
"if",
"(",
"value",
"instanceof",
"String",
")",
"{",
"if",
"(",
"(",
"(",
"String",
")",
"va... | Sets the value of the CheckBox
@param value
- String that can be one of two values: CHECK - sets checkbox
from UNCHECKED to CHECK UNCHECK - sets checkbox from CHECKED
to UNCHECKED | [
"Sets",
"the",
"value",
"of",
"the",
"CheckBox"
] | train | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/widget/element/html/CheckBox.java#L83-L107 |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java | VisualizeBinaryData.renderContours | public static BufferedImage renderContours(List<Contour> contours , int colorExternal, int colorInternal ,
int width , int height , BufferedImage out) {
"""
Draws contours. Internal and external contours are different user specified colors.
@param contours List of contours
@param colorExternal RG... | java | public static BufferedImage renderContours(List<Contour> contours , int colorExternal, int colorInternal ,
int width , int height , BufferedImage out) {
if( out == null ) {
out = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
} else {
Graphics2D g2 = out.createGraphics();
g2.set... | [
"public",
"static",
"BufferedImage",
"renderContours",
"(",
"List",
"<",
"Contour",
">",
"contours",
",",
"int",
"colorExternal",
",",
"int",
"colorInternal",
",",
"int",
"width",
",",
"int",
"height",
",",
"BufferedImage",
"out",
")",
"{",
"if",
"(",
"out",... | Draws contours. Internal and external contours are different user specified colors.
@param contours List of contours
@param colorExternal RGB color
@param colorInternal RGB color
@param width Image width
@param height Image height
@param out (Optional) storage for output image
@return Rendered contours | [
"Draws",
"contours",
".",
"Internal",
"and",
"external",
"contours",
"are",
"different",
"user",
"specified",
"colors",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/binary/VisualizeBinaryData.java#L77-L100 |
tomgibara/bits | src/main/java/com/tomgibara/bits/BitVector.java | BitVector.fromBitSet | public static BitVector fromBitSet(BitSet bitSet, int size) {
"""
Creates a {@link BitVector} by copying the bits in a <code>BitSet</code>.
@param bitSet
a <code>BitSet</code>
@param size
the size of {@link BitVector} to create, in bits
@return a bit vector containing the bits of the bit set.
@see Bits#asS... | java | public static BitVector fromBitSet(BitSet bitSet, int size) {
if (bitSet == null) throw new IllegalArgumentException();
if (size < 0) throw new IllegalArgumentException();
final int length = bitSet.length();
return fromBitSetImpl(bitSet, size, length);
} | [
"public",
"static",
"BitVector",
"fromBitSet",
"(",
"BitSet",
"bitSet",
",",
"int",
"size",
")",
"{",
"if",
"(",
"bitSet",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"if",
"(",
"size",
"<",
"0",
")",
"throw",
"new",
"... | Creates a {@link BitVector} by copying the bits in a <code>BitSet</code>.
@param bitSet
a <code>BitSet</code>
@param size
the size of {@link BitVector} to create, in bits
@return a bit vector containing the bits of the bit set.
@see Bits#asStore(BitSet, int) | [
"Creates",
"a",
"{",
"@link",
"BitVector",
"}",
"by",
"copying",
"the",
"bits",
"in",
"a",
"<code",
">",
"BitSet<",
"/",
"code",
">",
"."
] | train | https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/BitVector.java#L217-L222 |
Cornutum/tcases | tcases-maven-plugin/src/main/java/org/cornutum/tcases/maven/TcasesMojo.java | TcasesMojo.getBaseDir | private File getBaseDir( File path) {
"""
If the given path is not absolute, returns it as an absolute path relative to the
project base directory. Otherwise, returns the given absolute path.
"""
return
path == null?
baseDir_ :
path.isAbsolute()?
path :
new File( base... | java | private File getBaseDir( File path)
{
return
path == null?
baseDir_ :
path.isAbsolute()?
path :
new File( baseDir_, path.getPath());
} | [
"private",
"File",
"getBaseDir",
"(",
"File",
"path",
")",
"{",
"return",
"path",
"==",
"null",
"?",
"baseDir_",
":",
"path",
".",
"isAbsolute",
"(",
")",
"?",
"path",
":",
"new",
"File",
"(",
"baseDir_",
",",
"path",
".",
"getPath",
"(",
")",
")",
... | If the given path is not absolute, returns it as an absolute path relative to the
project base directory. Otherwise, returns the given absolute path. | [
"If",
"the",
"given",
"path",
"is",
"not",
"absolute",
"returns",
"it",
"as",
"an",
"absolute",
"path",
"relative",
"to",
"the",
"project",
"base",
"directory",
".",
"Otherwise",
"returns",
"the",
"given",
"absolute",
"path",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-maven-plugin/src/main/java/org/cornutum/tcases/maven/TcasesMojo.java#L181-L191 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java | MavenModelScannerPlugin.addConfiguration | private void addConfiguration(ConfigurableDescriptor configurableDescriptor, Xpp3Dom config, Store store) {
"""
Adds configuration information.
@param configurableDescriptor
The descriptor for the configured element (Plugin,
PluginExecution).
@param config
The configuration information.
@param store
The d... | java | private void addConfiguration(ConfigurableDescriptor configurableDescriptor, Xpp3Dom config, Store store) {
if (null == config) {
return;
}
MavenConfigurationDescriptor configDescriptor = store.create(MavenConfigurationDescriptor.class);
configurableDescriptor.setConfiguratio... | [
"private",
"void",
"addConfiguration",
"(",
"ConfigurableDescriptor",
"configurableDescriptor",
",",
"Xpp3Dom",
"config",
",",
"Store",
"store",
")",
"{",
"if",
"(",
"null",
"==",
"config",
")",
"{",
"return",
";",
"}",
"MavenConfigurationDescriptor",
"configDescrip... | Adds configuration information.
@param configurableDescriptor
The descriptor for the configured element (Plugin,
PluginExecution).
@param config
The configuration information.
@param store
The database. | [
"Adds",
"configuration",
"information",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L237-L247 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java | XsdAsmInterfaces.createElement | private void createElement(XsdElement element, String apiName) {
"""
Creates a class based on a {@link XsdElement} if it wasn't been already.
@param element The element that serves as base to creating the class.
@param apiName The name of the generated fluent interface.
"""
String elementName = eleme... | java | private void createElement(XsdElement element, String apiName) {
String elementName = element.getName();
if (!createdElements.containsKey(getCleanName(elementName))){
createdElements.put(getCleanName(elementName), element);
xsdAsmInstance.generateClassFromElement(element, apiNam... | [
"private",
"void",
"createElement",
"(",
"XsdElement",
"element",
",",
"String",
"apiName",
")",
"{",
"String",
"elementName",
"=",
"element",
".",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"createdElements",
".",
"containsKey",
"(",
"getCleanName",
"(",
"el... | Creates a class based on a {@link XsdElement} if it wasn't been already.
@param element The element that serves as base to creating the class.
@param apiName The name of the generated fluent interface. | [
"Creates",
"a",
"class",
"based",
"on",
"a",
"{"
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java#L798-L805 |
geomajas/geomajas-project-client-gwt2 | server-extension/src/main/java/org/geomajas/gwt2/client/widget/exception/ExceptionCallbackImpl.java | ExceptionCallbackImpl.showDialog | private void showDialog(String msg, String stack) {
"""
Makes a dialog box to show exception message and stack trace.
@param msg
error message
@param stack
stack trace
"""
ExceptionDialog warning = new ExceptionDialog(msg, stack);
warning.show();
} | java | private void showDialog(String msg, String stack) {
ExceptionDialog warning = new ExceptionDialog(msg, stack);
warning.show();
} | [
"private",
"void",
"showDialog",
"(",
"String",
"msg",
",",
"String",
"stack",
")",
"{",
"ExceptionDialog",
"warning",
"=",
"new",
"ExceptionDialog",
"(",
"msg",
",",
"stack",
")",
";",
"warning",
".",
"show",
"(",
")",
";",
"}"
] | Makes a dialog box to show exception message and stack trace.
@param msg
error message
@param stack
stack trace | [
"Makes",
"a",
"dialog",
"box",
"to",
"show",
"exception",
"message",
"and",
"stack",
"trace",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/server-extension/src/main/java/org/geomajas/gwt2/client/widget/exception/ExceptionCallbackImpl.java#L115-L118 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java | ApiOvhDedicatednas.serviceName_partition_POST | public OvhTask serviceName_partition_POST(String serviceName, String partitionName, OvhProtocolEnum protocol, Long size) throws IOException {
"""
Create a new partition
REST: POST /dedicated/nas/{serviceName}/partition
@param partitionName [required] Partition name
@param protocol [required]
@param size [re... | java | public OvhTask serviceName_partition_POST(String serviceName, String partitionName, OvhProtocolEnum protocol, Long size) throws IOException {
String qPath = "/dedicated/nas/{serviceName}/partition";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o,... | [
"public",
"OvhTask",
"serviceName_partition_POST",
"(",
"String",
"serviceName",
",",
"String",
"partitionName",
",",
"OvhProtocolEnum",
"protocol",
",",
"Long",
"size",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/nas/{serviceName}/partition\"... | Create a new partition
REST: POST /dedicated/nas/{serviceName}/partition
@param partitionName [required] Partition name
@param protocol [required]
@param size [required] Partition size
@param serviceName [required] The internal name of your storage | [
"Create",
"a",
"new",
"partition"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java#L328-L337 |
google/gson | gson/src/main/java/com/google/gson/internal/bind/TypeAdapters.java | TypeAdapters.newTypeHierarchyFactory | public static <T1> TypeAdapterFactory newTypeHierarchyFactory(
final Class<T1> clazz, final TypeAdapter<T1> typeAdapter) {
"""
Returns a factory for all subtypes of {@code typeAdapter}. We do a runtime check to confirm
that the deserialized type matches the type requested.
"""
return new TypeAdapter... | java | public static <T1> TypeAdapterFactory newTypeHierarchyFactory(
final Class<T1> clazz, final TypeAdapter<T1> typeAdapter) {
return new TypeAdapterFactory() {
@SuppressWarnings("unchecked")
@Override public <T2> TypeAdapter<T2> create(Gson gson, TypeToken<T2> typeToken) {
final Class<? super... | [
"public",
"static",
"<",
"T1",
">",
"TypeAdapterFactory",
"newTypeHierarchyFactory",
"(",
"final",
"Class",
"<",
"T1",
">",
"clazz",
",",
"final",
"TypeAdapter",
"<",
"T1",
">",
"typeAdapter",
")",
"{",
"return",
"new",
"TypeAdapterFactory",
"(",
")",
"{",
"... | Returns a factory for all subtypes of {@code typeAdapter}. We do a runtime check to confirm
that the deserialized type matches the type requested. | [
"Returns",
"a",
"factory",
"for",
"all",
"subtypes",
"of",
"{"
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/bind/TypeAdapters.java#L879-L907 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.checkExistenceAsync | public Observable<Boolean> checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
"""
Checks whether a resource exists.
@param resourceGroupName The name of the resource group containing the resour... | java | public Observable<Boolean> checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
return checkExistenceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, res... | [
"public",
"Observable",
"<",
"Boolean",
">",
"checkExistenceAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceProviderNamespace",
",",
"String",
"parentResourcePath",
",",
"String",
"resourceType",
",",
"String",
"resourceName",
",",
"String",
"apiVers... | Checks whether a resource exists.
@param resourceGroupName The name of the resource group containing the resource to check. The name is case insensitive.
@param resourceProviderNamespace The resource provider of the resource to check.
@param parentResourcePath The parent resource identity.
@param resourceType The reso... | [
"Checks",
"whether",
"a",
"resource",
"exists",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L1009-L1016 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java | SecStrucCalc.calculateHBonds | private void calculateHBonds() {
"""
Calculate the HBonds between different groups.
see Creighton page 147 f
Modified to use only the contact map
"""
/**
* More efficient method for calculating C-Alpha pairs
*/
if (groups.length < 5) return;
Iterator<AtomContact> otu = contactSet.iterator();
wh... | java | private void calculateHBonds() {
/**
* More efficient method for calculating C-Alpha pairs
*/
if (groups.length < 5) return;
Iterator<AtomContact> otu = contactSet.iterator();
while(otu.hasNext()){
AtomContact ac = otu.next();
Pair<Atom> pair = ac.getPair();
Group g1 = pair.getFirst().getGroup();... | [
"private",
"void",
"calculateHBonds",
"(",
")",
"{",
"/**\n\t\t * More efficient method for calculating C-Alpha pairs\n\t\t */",
"if",
"(",
"groups",
".",
"length",
"<",
"5",
")",
"return",
";",
"Iterator",
"<",
"AtomContact",
">",
"otu",
"=",
"contactSet",
".",
"it... | Calculate the HBonds between different groups.
see Creighton page 147 f
Modified to use only the contact map | [
"Calculate",
"the",
"HBonds",
"between",
"different",
"groups",
".",
"see",
"Creighton",
"page",
"147",
"f",
"Modified",
"to",
"use",
"only",
"the",
"contact",
"map"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L775-L794 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/Category.java | Category.l7dlog | public void l7dlog(Priority priority, String key, Object[] params, Throwable t) {
"""
Log a localized and parameterized message. First, the user supplied <code>key</code> is searched in the resource bundle. Next, the
resulting pattern is formatted using {@link java.text.MessageFormat#format(String,Object[])} meth... | java | public void l7dlog(Priority priority, String key, Object[] params, Throwable t) {
if (repository.isDisabled(priority.level)) {
return;
}
if (priority.isGreaterOrEqual(this.getEffectiveLevel())) {
String pattern = getResourceBundleString(key);
String msg;
... | [
"public",
"void",
"l7dlog",
"(",
"Priority",
"priority",
",",
"String",
"key",
",",
"Object",
"[",
"]",
"params",
",",
"Throwable",
"t",
")",
"{",
"if",
"(",
"repository",
".",
"isDisabled",
"(",
"priority",
".",
"level",
")",
")",
"{",
"return",
";",
... | Log a localized and parameterized message. First, the user supplied <code>key</code> is searched in the resource bundle. Next, the
resulting pattern is formatted using {@link java.text.MessageFormat#format(String,Object[])} method with the user supplied object
array <code>params</code>.
@since 0.8.4 | [
"Log",
"a",
"localized",
"and",
"parameterized",
"message",
".",
"First",
"the",
"user",
"supplied",
"<code",
">",
"key<",
"/",
"code",
">",
"is",
"searched",
"in",
"the",
"resource",
"bundle",
".",
"Next",
"the",
"resulting",
"pattern",
"is",
"formatted",
... | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/Category.java#L674-L687 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java | TimeZoneFormat.parseOffsetISO8601 | public final int parseOffsetISO8601(String text, ParsePosition pos) {
"""
Returns offset from GMT(UTC) in milliseconds for the given ISO 8601
basic or extended time zone string. When the given string is not an ISO 8601 time
zone string, this method sets the current position as the error index
to <code>ParsePosi... | java | public final int parseOffsetISO8601(String text, ParsePosition pos) {
return parseOffsetISO8601(text, pos, false, null);
} | [
"public",
"final",
"int",
"parseOffsetISO8601",
"(",
"String",
"text",
",",
"ParsePosition",
"pos",
")",
"{",
"return",
"parseOffsetISO8601",
"(",
"text",
",",
"pos",
",",
"false",
",",
"null",
")",
";",
"}"
] | Returns offset from GMT(UTC) in milliseconds for the given ISO 8601
basic or extended time zone string. When the given string is not an ISO 8601 time
zone string, this method sets the current position as the error index
to <code>ParsePosition pos</code> and returns 0.
@param text the text contains ISO 8601 style time ... | [
"Returns",
"offset",
"from",
"GMT",
"(",
"UTC",
")",
"in",
"milliseconds",
"for",
"the",
"given",
"ISO",
"8601",
"basic",
"or",
"extended",
"time",
"zone",
"string",
".",
"When",
"the",
"given",
"string",
"is",
"not",
"an",
"ISO",
"8601",
"time",
"zone",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java#L960-L962 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.booleanConstant | public static Matcher<ExpressionTree> booleanConstant(final boolean value) {
"""
Matches the boolean constant ({@link Boolean#TRUE} or {@link Boolean#FALSE}) corresponding to
the given value.
"""
return new Matcher<ExpressionTree>() {
@Override
public boolean matches(ExpressionTree expressionT... | java | public static Matcher<ExpressionTree> booleanConstant(final boolean value) {
return new Matcher<ExpressionTree>() {
@Override
public boolean matches(ExpressionTree expressionTree, VisitorState state) {
if (expressionTree instanceof JCFieldAccess) {
Symbol symbol = ASTHelpers.getSymbol(... | [
"public",
"static",
"Matcher",
"<",
"ExpressionTree",
">",
"booleanConstant",
"(",
"final",
"boolean",
"value",
")",
"{",
"return",
"new",
"Matcher",
"<",
"ExpressionTree",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"ExpressionTr... | Matches the boolean constant ({@link Boolean#TRUE} or {@link Boolean#FALSE}) corresponding to
the given value. | [
"Matches",
"the",
"boolean",
"constant",
"(",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L653-L668 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java | CorsConfigBuilder.preflightResponseHeader | public <T> CorsConfigBuilder preflightResponseHeader(final CharSequence name, final Callable<T> valueGenerator) {
"""
Returns HTTP response headers that should be added to a CORS preflight response.
An intermediary like a load balancer might require that a CORS preflight request
have certain headers set. This ... | java | public <T> CorsConfigBuilder preflightResponseHeader(final CharSequence name, final Callable<T> valueGenerator) {
preflightHeaders.put(name, valueGenerator);
return this;
} | [
"public",
"<",
"T",
">",
"CorsConfigBuilder",
"preflightResponseHeader",
"(",
"final",
"CharSequence",
"name",
",",
"final",
"Callable",
"<",
"T",
">",
"valueGenerator",
")",
"{",
"preflightHeaders",
".",
"put",
"(",
"name",
",",
"valueGenerator",
")",
";",
"r... | Returns HTTP response headers that should be added to a CORS preflight response.
An intermediary like a load balancer might require that a CORS preflight request
have certain headers set. This enables such headers to be added.
Some values must be dynamically created when the HTTP response is created, for
example the ... | [
"Returns",
"HTTP",
"response",
"headers",
"that",
"should",
"be",
"added",
"to",
"a",
"CORS",
"preflight",
"response",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java#L323-L326 |
OrienteerBAP/orientdb-oda-birt | org.orienteer.birt.orientdb.ui/src/org/orienteer/birt/orientdb/ui/impl/CustomDataSetWizardPage.java | CustomDataSetWizardPage.validateData | private void validateData( ) {
"""
Validates the user-defined value in the page control exists
and not a blank text.
Set page message accordingly.
"""
boolean isValid = ( m_queryTextField != null &&
getQueryText() != null && getQueryText().trim().length() > 0 );
if( isValid )
... | java | private void validateData( )
{
boolean isValid = ( m_queryTextField != null &&
getQueryText() != null && getQueryText().trim().length() > 0 );
if( isValid )
setMessage( DEFAULT_MESSAGE );
else
setMessage( "Requires input value.", ERROR );
setPageComplete(... | [
"private",
"void",
"validateData",
"(",
")",
"{",
"boolean",
"isValid",
"=",
"(",
"m_queryTextField",
"!=",
"null",
"&&",
"getQueryText",
"(",
")",
"!=",
"null",
"&&",
"getQueryText",
"(",
")",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
... | Validates the user-defined value in the page control exists
and not a blank text.
Set page message accordingly. | [
"Validates",
"the",
"user",
"-",
"defined",
"value",
"in",
"the",
"page",
"control",
"exists",
"and",
"not",
"a",
"blank",
"text",
".",
"Set",
"page",
"message",
"accordingly",
"."
] | train | https://github.com/OrienteerBAP/orientdb-oda-birt/blob/62820c256fa1d221265e68b8ebb60f291a9a1405/org.orienteer.birt.orientdb.ui/src/org/orienteer/birt/orientdb/ui/impl/CustomDataSetWizardPage.java#L201-L212 |
jayantk/jklol | src/com/jayantkrish/jklol/models/AbstractFactorGraphBuilder.java | AbstractFactorGraphBuilder.addFactor | public void addFactor(String factorName, T factor, VariablePattern factorPattern) {
"""
Adds a parameterized factor to the log linear model being
constructed.
@param factor
"""
parametricFactors.add(factor);
factorPatterns.add(factorPattern);
parametricFactorNames.add(factorName);
} | java | public void addFactor(String factorName, T factor, VariablePattern factorPattern) {
parametricFactors.add(factor);
factorPatterns.add(factorPattern);
parametricFactorNames.add(factorName);
} | [
"public",
"void",
"addFactor",
"(",
"String",
"factorName",
",",
"T",
"factor",
",",
"VariablePattern",
"factorPattern",
")",
"{",
"parametricFactors",
".",
"add",
"(",
"factor",
")",
";",
"factorPatterns",
".",
"add",
"(",
"factorPattern",
")",
";",
"parametr... | Adds a parameterized factor to the log linear model being
constructed.
@param factor | [
"Adds",
"a",
"parameterized",
"factor",
"to",
"the",
"log",
"linear",
"model",
"being",
"constructed",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/AbstractFactorGraphBuilder.java#L106-L110 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java | GoogleMapShape.expandBoundingBox | private void expandBoundingBox(BoundingBox boundingBox, List<LatLng> latLngs) {
"""
Expand the bounding box by the LatLngs
@param boundingBox bounding box
@param latLngs lat lngs
"""
for (LatLng latLng : latLngs) {
expandBoundingBox(boundingBox, latLng);
}
} | java | private void expandBoundingBox(BoundingBox boundingBox, List<LatLng> latLngs) {
for (LatLng latLng : latLngs) {
expandBoundingBox(boundingBox, latLng);
}
} | [
"private",
"void",
"expandBoundingBox",
"(",
"BoundingBox",
"boundingBox",
",",
"List",
"<",
"LatLng",
">",
"latLngs",
")",
"{",
"for",
"(",
"LatLng",
"latLng",
":",
"latLngs",
")",
"{",
"expandBoundingBox",
"(",
"boundingBox",
",",
"latLng",
")",
";",
"}",
... | Expand the bounding box by the LatLngs
@param boundingBox bounding box
@param latLngs lat lngs | [
"Expand",
"the",
"bounding",
"box",
"by",
"the",
"LatLngs"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShape.java#L515-L519 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/net/JNRPEIdleStateHandler.java | JNRPEIdleStateHandler.userEventTriggered | @Override
public void userEventTriggered(final ChannelHandlerContext ctx, final Object evt) {
"""
Method userEventTriggered.
@param ctx ChannelHandlerContext
@param evt Object
@see io.netty.channel.ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object)
"""
if (evt instanceof Idl... | java | @Override
public void userEventTriggered(final ChannelHandlerContext ctx, final Object evt) {
if (evt instanceof IdleStateEvent) {
IdleStateEvent e = (IdleStateEvent) evt;
if (e.state() == IdleState.READER_IDLE) {
ctx.close();
LOG.warn(jnrpeContext, "R... | [
"@",
"Override",
"public",
"void",
"userEventTriggered",
"(",
"final",
"ChannelHandlerContext",
"ctx",
",",
"final",
"Object",
"evt",
")",
"{",
"if",
"(",
"evt",
"instanceof",
"IdleStateEvent",
")",
"{",
"IdleStateEvent",
"e",
"=",
"(",
"IdleStateEvent",
")",
... | Method userEventTriggered.
@param ctx ChannelHandlerContext
@param evt Object
@see io.netty.channel.ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object) | [
"Method",
"userEventTriggered",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/net/JNRPEIdleStateHandler.java#L59-L75 |
syphr42/prom | src/main/java/org/syphr/prom/PropertiesManager.java | PropertiesManager.setProperty | public void setProperty(T property, Object value) throws IllegalArgumentException {
"""
Set the given property using an object's string representation. This will not write
the new value to the file system.
@see #saveProperty(Object, Object)
@param property
the property whose value is being set
@param valu... | java | public void setProperty(T property, Object value) throws IllegalArgumentException
{
if (value == null)
{
throw new IllegalArgumentException("Cannot set a null value, use reset instead");
}
setProperty(property, value.toString());
} | [
"public",
"void",
"setProperty",
"(",
"T",
"property",
",",
"Object",
"value",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot set a null value, use reset instead\""... | Set the given property using an object's string representation. This will not write
the new value to the file system.
@see #saveProperty(Object, Object)
@param property
the property whose value is being set
@param value
the value to set
@throws IllegalArgumentException
if a <code>null</code> value is given (see
{@lin... | [
"Set",
"the",
"given",
"property",
"using",
"an",
"object",
"s",
"string",
"representation",
".",
"This",
"will",
"not",
"write",
"the",
"new",
"value",
"to",
"the",
"file",
"system",
"."
] | train | https://github.com/syphr42/prom/blob/074d67c4ebb3afb0b163fcb0bc4826ee577ac803/src/main/java/org/syphr/prom/PropertiesManager.java#L915-L923 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.debugv | public void debugv(String format, Object param1) {
"""
Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting.
@param format the message format string
@param param1 the sole parameter
"""
if (isEnabled(Level.DEBUG)) {
doLog(Level.DEBUG, FQCN, fo... | java | public void debugv(String format, Object param1) {
if (isEnabled(Level.DEBUG)) {
doLog(Level.DEBUG, FQCN, format, new Object[] { param1 }, null);
}
} | [
"public",
"void",
"debugv",
"(",
"String",
"format",
",",
"Object",
"param1",
")",
"{",
"if",
"(",
"isEnabled",
"(",
"Level",
".",
"DEBUG",
")",
")",
"{",
"doLog",
"(",
"Level",
".",
"DEBUG",
",",
"FQCN",
",",
"format",
",",
"new",
"Object",
"[",
"... | Issue a log message with a level of DEBUG using {@link java.text.MessageFormat}-style formatting.
@param format the message format string
@param param1 the sole parameter | [
"Issue",
"a",
"log",
"message",
"with",
"a",
"level",
"of",
"DEBUG",
"using",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"-",
"style",
"formatting",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L608-L612 |
michael-rapp/AndroidMaterialDialog | library/src/main/java/de/mrapp/android/dialog/AbstractMaterialDialog.java | AbstractMaterialDialog.createCanceledOnTouchListener | private View.OnTouchListener createCanceledOnTouchListener() {
"""
Creates and returns a listener, which allows to cancel the dialog, when touched outside the
window.
@return The listener, which has been created, as an instance of the type {@link
View.OnTouchListener}
"""
return new View.OnTouchLi... | java | private View.OnTouchListener createCanceledOnTouchListener() {
return new View.OnTouchListener() {
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(final View v, final MotionEvent event) {
return isCanceledOnTouchOutside() && !isFu... | [
"private",
"View",
".",
"OnTouchListener",
"createCanceledOnTouchListener",
"(",
")",
"{",
"return",
"new",
"View",
".",
"OnTouchListener",
"(",
")",
"{",
"@",
"SuppressLint",
"(",
"\"ClickableViewAccessibility\"",
")",
"@",
"Override",
"public",
"boolean",
"onTouch... | Creates and returns a listener, which allows to cancel the dialog, when touched outside the
window.
@return The listener, which has been created, as an instance of the type {@link
View.OnTouchListener} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"cancel",
"the",
"dialog",
"when",
"touched",
"outside",
"the",
"window",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/library/src/main/java/de/mrapp/android/dialog/AbstractMaterialDialog.java#L94-L104 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AccessAuditContext.java | AccessAuditContext.doAs | public static <T> T doAs(final boolean inflowed, final SecurityIdentity securityIdentity, final InetAddress remoteAddress, final PrivilegedAction<T> action) {
"""
Perform work with a new {@code AccessAuditContext} as a particular {@code SecurityIdentity}
@param inflowed was the identity inflowed from a remote pro... | java | public static <T> T doAs(final boolean inflowed, final SecurityIdentity securityIdentity, final InetAddress remoteAddress, final PrivilegedAction<T> action) {
final AccessAuditContext previous = contextThreadLocal.get();
try {
contextThreadLocal.set(new AccessAuditContext(inflowed, securityI... | [
"public",
"static",
"<",
"T",
">",
"T",
"doAs",
"(",
"final",
"boolean",
"inflowed",
",",
"final",
"SecurityIdentity",
"securityIdentity",
",",
"final",
"InetAddress",
"remoteAddress",
",",
"final",
"PrivilegedAction",
"<",
"T",
">",
"action",
")",
"{",
"final... | Perform work with a new {@code AccessAuditContext} as a particular {@code SecurityIdentity}
@param inflowed was the identity inflowed from a remote process?
@param securityIdentity the {@code SecurityIdentity} that the specified {@code action} will run as. May be {@code null}
@param remoteAddress the remote address of ... | [
"Perform",
"work",
"with",
"a",
"new",
"{",
"@code",
"AccessAuditContext",
"}",
"as",
"a",
"particular",
"{",
"@code",
"SecurityIdentity",
"}",
"@param",
"inflowed",
"was",
"the",
"identity",
"inflowed",
"from",
"a",
"remote",
"process?",
"@param",
"securityIden... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AccessAuditContext.java#L194-L202 |
lucee/Lucee | core/src/main/java/lucee/commons/sql/SQLUtil.java | SQLUtil.toBlob | public static Blob toBlob(Connection conn, Object value) throws PageException, SQLException {
"""
create a blog Object
@param conn
@param value
@return
@throws PageException
@throws SQLException
"""
if (value instanceof Blob) return (Blob) value;
// Java >= 1.6
if (SystemUtil.JAVA_VERSION >= SystemU... | java | public static Blob toBlob(Connection conn, Object value) throws PageException, SQLException {
if (value instanceof Blob) return (Blob) value;
// Java >= 1.6
if (SystemUtil.JAVA_VERSION >= SystemUtil.JAVA_VERSION_6) {
try {
Blob blob = conn.createBlob();
blob.setBytes(1, Caster.toBinary(value));
return bl... | [
"public",
"static",
"Blob",
"toBlob",
"(",
"Connection",
"conn",
",",
"Object",
"value",
")",
"throws",
"PageException",
",",
"SQLException",
"{",
"if",
"(",
"value",
"instanceof",
"Blob",
")",
"return",
"(",
"Blob",
")",
"value",
";",
"// Java >= 1.6",
"if"... | create a blog Object
@param conn
@param value
@return
@throws PageException
@throws SQLException | [
"create",
"a",
"blog",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/sql/SQLUtil.java#L124-L146 |
maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/TooltipHelper.java | TooltipHelper.setup | public static void setup(View view, final int textResId) {
"""
Sets up a cheat sheet (tooltip) for the given view by setting its {@link android.view.View.OnLongClickListener}.
When the view is long-pressed, a {@link Toast} with the given text will be shown either above (default) or below
the view (if there isn't... | java | public static void setup(View view, final int textResId) {
view.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
return showCheatSheet(view, view.getContext().getString(textResId));
}
});
} | [
"public",
"static",
"void",
"setup",
"(",
"View",
"view",
",",
"final",
"int",
"textResId",
")",
"{",
"view",
".",
"setOnLongClickListener",
"(",
"new",
"View",
".",
"OnLongClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onLongClick",
"... | Sets up a cheat sheet (tooltip) for the given view by setting its {@link android.view.View.OnLongClickListener}.
When the view is long-pressed, a {@link Toast} with the given text will be shown either above (default) or below
the view (if there isn't room above it).
@param view The view to add a cheat sheet for.
@para... | [
"Sets",
"up",
"a",
"cheat",
"sheet",
"(",
"tooltip",
")",
"for",
"the",
"given",
"view",
"by",
"setting",
"its",
"{",
"@link",
"android",
".",
"view",
".",
"View",
".",
"OnLongClickListener",
"}",
".",
"When",
"the",
"view",
"is",
"long",
"-",
"pressed... | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/TooltipHelper.java#L53-L61 |
mangstadt/biweekly | src/main/java/biweekly/util/XmlUtils.java | XmlUtils.hasQName | public static boolean hasQName(Node node, QName qname) {
"""
Determines if a node has a particular qualified name.
@param node the node
@param qname the qualified name
@return true if the node has the given qualified name, false if not
"""
return qname.getNamespaceURI().equals(node.getNamespaceURI()) && q... | java | public static boolean hasQName(Node node, QName qname) {
return qname.getNamespaceURI().equals(node.getNamespaceURI()) && qname.getLocalPart().equals(node.getLocalName());
} | [
"public",
"static",
"boolean",
"hasQName",
"(",
"Node",
"node",
",",
"QName",
"qname",
")",
"{",
"return",
"qname",
".",
"getNamespaceURI",
"(",
")",
".",
"equals",
"(",
"node",
".",
"getNamespaceURI",
"(",
")",
")",
"&&",
"qname",
".",
"getLocalPart",
"... | Determines if a node has a particular qualified name.
@param node the node
@param qname the qualified name
@return true if the node has the given qualified name, false if not | [
"Determines",
"if",
"a",
"node",
"has",
"a",
"particular",
"qualified",
"name",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/XmlUtils.java#L352-L354 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.updateProperties | public void updateProperties(String poolId, PoolUpdatePropertiesParameter poolUpdatePropertiesParameter) {
"""
Updates the properties of the specified pool.
This fully replaces all the updatable properties of the pool. For example, if the pool has a start task associated with it and if start task is not specified... | java | public void updateProperties(String poolId, PoolUpdatePropertiesParameter poolUpdatePropertiesParameter) {
updatePropertiesWithServiceResponseAsync(poolId, poolUpdatePropertiesParameter).toBlocking().single().body();
} | [
"public",
"void",
"updateProperties",
"(",
"String",
"poolId",
",",
"PoolUpdatePropertiesParameter",
"poolUpdatePropertiesParameter",
")",
"{",
"updatePropertiesWithServiceResponseAsync",
"(",
"poolId",
",",
"poolUpdatePropertiesParameter",
")",
".",
"toBlocking",
"(",
")",
... | Updates the properties of the specified pool.
This fully replaces all the updatable properties of the pool. For example, if the pool has a start task associated with it and if start task is not specified with this request, then the Batch service will remove the existing start task.
@param poolId The ID of the pool to ... | [
"Updates",
"the",
"properties",
"of",
"the",
"specified",
"pool",
".",
"This",
"fully",
"replaces",
"all",
"the",
"updatable",
"properties",
"of",
"the",
"pool",
".",
"For",
"example",
"if",
"the",
"pool",
"has",
"a",
"start",
"task",
"associated",
"with",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L3195-L3197 |
voldemort/voldemort | src/java/voldemort/routing/ZoneRoutingStrategy.java | ZoneRoutingStrategy.checkZoneRequirement | private boolean checkZoneRequirement(HashMap<Integer, Integer> requiredRepFactor, int zoneId) {
"""
Check if we still need more nodes from the given zone and reduce the
zoneReplicationFactor count accordingly.
@param requiredRepFactor
@param zoneId
@return
"""
if(requiredRepFactor.containsKey(zon... | java | private boolean checkZoneRequirement(HashMap<Integer, Integer> requiredRepFactor, int zoneId) {
if(requiredRepFactor.containsKey(zoneId)) {
if(requiredRepFactor.get(zoneId) == 0) {
return false;
} else {
requiredRepFactor.put(zoneId, requiredRepFactor.get(... | [
"private",
"boolean",
"checkZoneRequirement",
"(",
"HashMap",
"<",
"Integer",
",",
"Integer",
">",
"requiredRepFactor",
",",
"int",
"zoneId",
")",
"{",
"if",
"(",
"requiredRepFactor",
".",
"containsKey",
"(",
"zoneId",
")",
")",
"{",
"if",
"(",
"requiredRepFac... | Check if we still need more nodes from the given zone and reduce the
zoneReplicationFactor count accordingly.
@param requiredRepFactor
@param zoneId
@return | [
"Check",
"if",
"we",
"still",
"need",
"more",
"nodes",
"from",
"the",
"given",
"zone",
"and",
"reduce",
"the",
"zoneReplicationFactor",
"count",
"accordingly",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/routing/ZoneRoutingStrategy.java#L108-L119 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.logErrorChanges | public void logErrorChanges(ErrorLog errorLog, Set<String> removed, Set<String> added) throws IOException {
"""
Log unindexed changes into error.log
@param removed
set of removed node uuids
@param added
map of added node states and uuids
@throws IOException
"""
// backup the remove and add iterato... | java | public void logErrorChanges(ErrorLog errorLog, Set<String> removed, Set<String> added) throws IOException
{
// backup the remove and add iterators
if(errorLog != null)
{
errorLog.writeChanges(removed, added);
}
} | [
"public",
"void",
"logErrorChanges",
"(",
"ErrorLog",
"errorLog",
",",
"Set",
"<",
"String",
">",
"removed",
",",
"Set",
"<",
"String",
">",
"added",
")",
"throws",
"IOException",
"{",
"// backup the remove and add iterators",
"if",
"(",
"errorLog",
"!=",
"null"... | Log unindexed changes into error.log
@param removed
set of removed node uuids
@param added
map of added node states and uuids
@throws IOException | [
"Log",
"unindexed",
"changes",
"into",
"error",
".",
"log"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L3439-L3446 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/CacheControlBuilder.java | CacheControlBuilder.validateDuration | protected static long validateDuration(@Nullable Duration value, String name) {
"""
Makes sure the specified {@link Duration} is not negative.
@param value the duration
@param name the name of the parameter
@return the duration converted into seconds
"""
if (value == null) {
return -1;... | java | protected static long validateDuration(@Nullable Duration value, String name) {
if (value == null) {
return -1;
}
checkArgument(!value.isNegative(), "%s: %s (expected: >= 0)", name, value);
return value.getSeconds();
} | [
"protected",
"static",
"long",
"validateDuration",
"(",
"@",
"Nullable",
"Duration",
"value",
",",
"String",
"name",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"checkArgument",
"(",
"!",
"value",
".",
"isNegative"... | Makes sure the specified {@link Duration} is not negative.
@param value the duration
@param name the name of the parameter
@return the duration converted into seconds | [
"Makes",
"sure",
"the",
"specified",
"{",
"@link",
"Duration",
"}",
"is",
"not",
"negative",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/CacheControlBuilder.java#L133-L140 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.loginUser | public CmsUser loginUser(CmsRequestContext context, String username, String password, String remoteAddress)
throws CmsException {
"""
Attempts to authenticate a user into OpenCms with the given password.<p>
@param context the current request context
@param username the name of the user to be logged in
@pa... | java | public CmsUser loginUser(CmsRequestContext context, String username, String password, String remoteAddress)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsUser result = null;
try {
result = m_driverManager.loginUser(
dbc,
... | [
"public",
"CmsUser",
"loginUser",
"(",
"CmsRequestContext",
"context",
",",
"String",
"username",
",",
"String",
"password",
",",
"String",
"remoteAddress",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(... | Attempts to authenticate a user into OpenCms with the given password.<p>
@param context the current request context
@param username the name of the user to be logged in
@param password the password of the user
@param remoteAddress the ip address of the request
@return the logged in user
@throws CmsException if the l... | [
"Attempts",
"to",
"authenticate",
"a",
"user",
"into",
"OpenCms",
"with",
"the",
"given",
"password",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L3597-L3612 |
petergeneric/stdlib | guice/webapp/src/main/java/com/peterphi/std/guice/web/HttpCallContext.java | HttpCallContext.set | public static HttpCallContext set(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) {
"""
Creates and associates an HttpCallContext with the current Thread
@param request
@param response
@return
"""
final HttpCallContext ctx = new HttpCallContext(generateTraceId(... | java | public static HttpCallContext set(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
{
final HttpCallContext ctx = new HttpCallContext(generateTraceId(request), request, response, servletContext);
contexts.set(ctx);
return ctx;
} | [
"public",
"static",
"HttpCallContext",
"set",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"ServletContext",
"servletContext",
")",
"{",
"final",
"HttpCallContext",
"ctx",
"=",
"new",
"HttpCallContext",
"(",
"generateTraceId",
"(",
... | Creates and associates an HttpCallContext with the current Thread
@param request
@param response
@return | [
"Creates",
"and",
"associates",
"an",
"HttpCallContext",
"with",
"the",
"current",
"Thread"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/webapp/src/main/java/com/peterphi/std/guice/web/HttpCallContext.java#L70-L77 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/model/RolloutGroupConditionBuilder.java | RolloutGroupConditionBuilder.successAction | public RolloutGroupConditionBuilder successAction(final RolloutGroupSuccessAction action, final String expression) {
"""
Sets the success action and expression on the builder.
@param action
the success action
@param expression
the error expression
@return the builder itself
"""
conditions.setSuc... | java | public RolloutGroupConditionBuilder successAction(final RolloutGroupSuccessAction action, final String expression) {
conditions.setSuccessAction(action);
conditions.setSuccessActionExp(expression);
return this;
} | [
"public",
"RolloutGroupConditionBuilder",
"successAction",
"(",
"final",
"RolloutGroupSuccessAction",
"action",
",",
"final",
"String",
"expression",
")",
"{",
"conditions",
".",
"setSuccessAction",
"(",
"action",
")",
";",
"conditions",
".",
"setSuccessActionExp",
"(",... | Sets the success action and expression on the builder.
@param action
the success action
@param expression
the error expression
@return the builder itself | [
"Sets",
"the",
"success",
"action",
"and",
"expression",
"on",
"the",
"builder",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/model/RolloutGroupConditionBuilder.java#L55-L59 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/manager/QuoteManager.java | QuoteManager.handleCandlestickCollection | public void handleCandlestickCollection(final BitfinexCandlestickSymbol symbol, final Collection<BitfinexCandle> ticksBuffer) {
"""
Process a list with candlesticks
@param symbol
@param ticksArray
"""
candleCallbacks.handleEventsCollection(symbol, ticksBuffer);
} | java | public void handleCandlestickCollection(final BitfinexCandlestickSymbol symbol, final Collection<BitfinexCandle> ticksBuffer) {
candleCallbacks.handleEventsCollection(symbol, ticksBuffer);
} | [
"public",
"void",
"handleCandlestickCollection",
"(",
"final",
"BitfinexCandlestickSymbol",
"symbol",
",",
"final",
"Collection",
"<",
"BitfinexCandle",
">",
"ticksBuffer",
")",
"{",
"candleCallbacks",
".",
"handleEventsCollection",
"(",
"symbol",
",",
"ticksBuffer",
")... | Process a list with candlesticks
@param symbol
@param ticksArray | [
"Process",
"a",
"list",
"with",
"candlesticks"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/manager/QuoteManager.java#L238-L240 |
Azure/azure-sdk-for-java | signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java | SignalRsInner.regenerateKey | public SignalRKeysInner regenerateKey(String resourceGroupName, String resourceName, KeyType keyType) {
"""
Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time.
@param resourceGroupName The name of the resource group that contains the resource. You can obtai... | java | public SignalRKeysInner regenerateKey(String resourceGroupName, String resourceName, KeyType keyType) {
return regenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName, keyType).toBlocking().last().body();
} | [
"public",
"SignalRKeysInner",
"regenerateKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"KeyType",
"keyType",
")",
"{",
"return",
"regenerateKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",",
"keyType",
")",
... | Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param resourceName The name of the SignalR resourc... | [
"Regenerate",
"SignalR",
"service",
"access",
"key",
".",
"PrimaryKey",
"and",
"SecondaryKey",
"cannot",
"be",
"regenerated",
"at",
"the",
"same",
"time",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java#L665-L667 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/markdown/MarkdownHelper.java | MarkdownHelper.skipSpaces | public static int skipSpaces (final String sIn, final int nStart) {
"""
Skips spaces in the given String.
@param sIn
Input String.
@param nStart
Starting position.
@return The new position or -1 if EOL has been reached.
"""
int pos = nStart;
while (pos < sIn.length () && (sIn.charAt (pos) == ' '... | java | public static int skipSpaces (final String sIn, final int nStart)
{
int pos = nStart;
while (pos < sIn.length () && (sIn.charAt (pos) == ' ' || sIn.charAt (pos) == '\n'))
pos++;
return pos < sIn.length () ? pos : -1;
} | [
"public",
"static",
"int",
"skipSpaces",
"(",
"final",
"String",
"sIn",
",",
"final",
"int",
"nStart",
")",
"{",
"int",
"pos",
"=",
"nStart",
";",
"while",
"(",
"pos",
"<",
"sIn",
".",
"length",
"(",
")",
"&&",
"(",
"sIn",
".",
"charAt",
"(",
"pos"... | Skips spaces in the given String.
@param sIn
Input String.
@param nStart
Starting position.
@return The new position or -1 if EOL has been reached. | [
"Skips",
"spaces",
"in",
"the",
"given",
"String",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/markdown/MarkdownHelper.java#L72-L78 |
iipc/webarchive-commons | src/main/java/org/archive/io/ObjectPlusFilesOutputStream.java | ObjectPlusFilesOutputStream.snapshotAppendOnlyFile | public void snapshotAppendOnlyFile(File file) throws IOException {
"""
Store a snapshot of an object's supporting file to the
current auxiliary directory. Should only be used for
files which are strictly appended-to, because it tries
to use a "hard link" where possible (meaning that
future edits to the origina... | java | public void snapshotAppendOnlyFile(File file) throws IOException {
// write filename
String name = file.getName();
writeUTF(name);
// write current file length
writeLong(file.length());
File auxDir = getAuxiliaryDirectory();
if(!auxDir.exists()) {
File... | [
"public",
"void",
"snapshotAppendOnlyFile",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"// write filename",
"String",
"name",
"=",
"file",
".",
"getName",
"(",
")",
";",
"writeUTF",
"(",
"name",
")",
";",
"// write current file length",
"writeLong",
... | Store a snapshot of an object's supporting file to the
current auxiliary directory. Should only be used for
files which are strictly appended-to, because it tries
to use a "hard link" where possible (meaning that
future edits to the original file's contents will
also affect the snapshot).
Remembers current file extent... | [
"Store",
"a",
"snapshot",
"of",
"an",
"object",
"s",
"supporting",
"file",
"to",
"the",
"current",
"auxiliary",
"directory",
".",
"Should",
"only",
"be",
"used",
"for",
"files",
"which",
"are",
"strictly",
"appended",
"-",
"to",
"because",
"it",
"tries",
"... | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/ObjectPlusFilesOutputStream.java#L94-L106 |
jenetics/jenetics | jenetics/src/main/java/io/jenetics/Phenotype.java | Phenotype.newInstance | @Deprecated
public Phenotype<G, C> newInstance(
final long generation,
final Function<? super Genotype<G>, ? extends C> function
) {
"""
Return a new phenotype with the the genotype of this and with new
fitness function and generation.
@param generation the generation of the new phenotype.
@param functi... | java | @Deprecated
public Phenotype<G, C> newInstance(
final long generation,
final Function<? super Genotype<G>, ? extends C> function
) {
return of(_genotype, generation, function, a -> a);
} | [
"@",
"Deprecated",
"public",
"Phenotype",
"<",
"G",
",",
"C",
">",
"newInstance",
"(",
"final",
"long",
"generation",
",",
"final",
"Function",
"<",
"?",
"super",
"Genotype",
"<",
"G",
">",
",",
"?",
"extends",
"C",
">",
"function",
")",
"{",
"return",... | Return a new phenotype with the the genotype of this and with new
fitness function and generation.
@param generation the generation of the new phenotype.
@param function the (new) fitness scaler of the created phenotype.
@return a new phenotype with the given values.
@throws NullPointerException if one of the values i... | [
"Return",
"a",
"new",
"phenotype",
"with",
"the",
"the",
"genotype",
"of",
"this",
"and",
"with",
"new",
"fitness",
"function",
"and",
"generation",
"."
] | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics/src/main/java/io/jenetics/Phenotype.java#L371-L377 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/password/PasswordManager.java | PasswordManager.getInstance | public static PasswordManager getInstance(State state) {
"""
Get an instance. The location of the master password file is provided via "encrypt.key.loc".
"""
try {
return CACHED_INSTANCES
.get(new CachedInstanceKey(state));
} catch (ExecutionException e) {
throw new RuntimeExcepti... | java | public static PasswordManager getInstance(State state) {
try {
return CACHED_INSTANCES
.get(new CachedInstanceKey(state));
} catch (ExecutionException e) {
throw new RuntimeException("Unable to get an instance of PasswordManager", e);
}
} | [
"public",
"static",
"PasswordManager",
"getInstance",
"(",
"State",
"state",
")",
"{",
"try",
"{",
"return",
"CACHED_INSTANCES",
".",
"get",
"(",
"new",
"CachedInstanceKey",
"(",
"state",
")",
")",
";",
"}",
"catch",
"(",
"ExecutionException",
"e",
")",
"{",... | Get an instance. The location of the master password file is provided via "encrypt.key.loc". | [
"Get",
"an",
"instance",
".",
"The",
"location",
"of",
"the",
"master",
"password",
"file",
"is",
"provided",
"via",
"encrypt",
".",
"key",
".",
"loc",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/password/PasswordManager.java#L159-L166 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.