repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 196 | func_name stringlengths 7 107 | whole_func_string stringlengths 76 3.82k | language stringclasses 1
value | func_code_string stringlengths 76 3.82k | func_code_tokens listlengths 22 717 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 508 | split_name stringclasses 1
value | func_code_url stringlengths 111 310 |
|---|---|---|---|---|---|---|---|---|---|---|
zaproxy/zaproxy | src/org/parosproxy/paros/core/scanner/ScannerParamFilter.java | ScannerParamFilter.isToExclude | public boolean isToExclude(HttpMessage msg, NameValuePair param) {
return ((paramType == NameValuePair.TYPE_UNDEFINED) || (param.getType() == paramType)) &&
((urlPattern == null) || urlPattern.matcher(msg.getRequestHeader().getURI().toString().toUpperCase(Locale.ROOT)).matches()) &&
... | java | public boolean isToExclude(HttpMessage msg, NameValuePair param) {
return ((paramType == NameValuePair.TYPE_UNDEFINED) || (param.getType() == paramType)) &&
((urlPattern == null) || urlPattern.matcher(msg.getRequestHeader().getURI().toString().toUpperCase(Locale.ROOT)).matches()) &&
... | [
"public",
"boolean",
"isToExclude",
"(",
"HttpMessage",
"msg",
",",
"NameValuePair",
"param",
")",
"{",
"return",
"(",
"(",
"paramType",
"==",
"NameValuePair",
".",
"TYPE_UNDEFINED",
")",
"||",
"(",
"param",
".",
"getType",
"(",
")",
"==",
"paramType",
")",
... | Check if the parameter should be excluded by the scanner
@param msg the message that is currently under scanning
@param param the Value/Name param object that is currently under scanning
@return true if the parameter should be excluded | [
"Check",
"if",
"the",
"parameter",
"should",
"be",
"excluded",
"by",
"the",
"scanner"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/ScannerParamFilter.java#L131-L135 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/ipv4/IPv4AddressSection.java | IPv4AddressSection.bitwiseOrNetwork | public IPv4AddressSection bitwiseOrNetwork(IPv4AddressSection mask, int networkPrefixLength) throws IncompatibleAddressException, SizeMismatchException {
checkMaskSectionCount(mask);
if(getNetwork().getPrefixConfiguration().allPrefixedAddressesAreSubnets()) {
return getOredSegments(
this,
networkPrefix... | java | public IPv4AddressSection bitwiseOrNetwork(IPv4AddressSection mask, int networkPrefixLength) throws IncompatibleAddressException, SizeMismatchException {
checkMaskSectionCount(mask);
if(getNetwork().getPrefixConfiguration().allPrefixedAddressesAreSubnets()) {
return getOredSegments(
this,
networkPrefix... | [
"public",
"IPv4AddressSection",
"bitwiseOrNetwork",
"(",
"IPv4AddressSection",
"mask",
",",
"int",
"networkPrefixLength",
")",
"throws",
"IncompatibleAddressException",
",",
"SizeMismatchException",
"{",
"checkMaskSectionCount",
"(",
"mask",
")",
";",
"if",
"(",
"getNetwo... | Does the bitwise disjunction with this address section. Useful when subnetting. Similar to {@link #maskNetwork(IPv4AddressSection, int)} which does the bitwise conjunction.
<p>
Any existing prefix length is dropped for the new prefix length and the disjunction is applied up to the end the new prefix length.
@param m... | [
"Does",
"the",
"bitwise",
"disjunction",
"with",
"this",
"address",
"section",
".",
"Useful",
"when",
"subnetting",
".",
"Similar",
"to",
"{",
"@link",
"#maskNetwork",
"(",
"IPv4AddressSection",
"int",
")",
"}",
"which",
"does",
"the",
"bitwise",
"conjunction",
... | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv4/IPv4AddressSection.java#L1356-L1380 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java | GroupOf.setOffset | @Override
public C setOffset(final double x, final double y)
{
getAttributes().setOffset(x, y);
return cast();
} | java | @Override
public C setOffset(final double x, final double y)
{
getAttributes().setOffset(x, y);
return cast();
} | [
"@",
"Override",
"public",
"C",
"setOffset",
"(",
"final",
"double",
"x",
",",
"final",
"double",
"y",
")",
"{",
"getAttributes",
"(",
")",
".",
"setOffset",
"(",
"x",
",",
"y",
")",
";",
"return",
"cast",
"(",
")",
";",
"}"
] | Sets this group's offset, at the given x and y coordinates.
@param x
@param y
@return Group this Group | [
"Sets",
"this",
"group",
"s",
"offset",
"at",
"the",
"given",
"x",
"and",
"y",
"coordinates",
"."
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/GroupOf.java#L544-L550 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/operations/ClassPath.java | ClassPath.newInstance | public static <T> T newInstance(String className, Object... initargs)
throws SetupException
{
return newInstance(toClass(className),initargs);
} | java | public static <T> T newInstance(String className, Object... initargs)
throws SetupException
{
return newInstance(toClass(className),initargs);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"String",
"className",
",",
"Object",
"...",
"initargs",
")",
"throws",
"SetupException",
"{",
"return",
"newInstance",
"(",
"toClass",
"(",
"className",
")",
",",
"initargs",
")",
";",
"}"
] | Create a new instance of a given object
@param className the class the create
@param initargs the initial constructor arguments
@param <T> the class type
@return the create instance
@throws SetupException when an initialize issue occurs | [
"Create",
"a",
"new",
"instance",
"of",
"a",
"given",
"object"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/operations/ClassPath.java#L181-L185 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java | PoolOperations.getPool | public CloudPool getPool(String poolId) throws BatchErrorException, IOException {
return getPool(poolId, null, null);
} | java | public CloudPool getPool(String poolId) throws BatchErrorException, IOException {
return getPool(poolId, null, null);
} | [
"public",
"CloudPool",
"getPool",
"(",
"String",
"poolId",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"getPool",
"(",
"poolId",
",",
"null",
",",
"null",
")",
";",
"}"
] | Gets the specified {@link CloudPool}.
@param poolId
The ID of the pool to get.
@return A {@link CloudPool} containing information about the specified Azure
Batch pool.
@throws BatchErrorException
Exception thrown when an error response is received from the
Batch service.
@throws IOException
Exception thrown when there... | [
"Gets",
"the",
"specified",
"{",
"@link",
"CloudPool",
"}",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java#L168-L170 |
bramp/ffmpeg-cli-wrapper | src/main/java/net/bramp/ffmpeg/builder/FFmpegBuilder.java | FFmpegBuilder.addOutput | public FFmpegOutputBuilder addOutput(URI uri) {
FFmpegOutputBuilder output = new FFmpegOutputBuilder(this, uri);
outputs.add(output);
return output;
} | java | public FFmpegOutputBuilder addOutput(URI uri) {
FFmpegOutputBuilder output = new FFmpegOutputBuilder(this, uri);
outputs.add(output);
return output;
} | [
"public",
"FFmpegOutputBuilder",
"addOutput",
"(",
"URI",
"uri",
")",
"{",
"FFmpegOutputBuilder",
"output",
"=",
"new",
"FFmpegOutputBuilder",
"(",
"this",
",",
"uri",
")",
";",
"outputs",
".",
"add",
"(",
"output",
")",
";",
"return",
"output",
";",
"}"
] | Adds new output file.
@param uri output file uri typically a stream
@return A new {@link FFmpegOutputBuilder} | [
"Adds",
"new",
"output",
"file",
"."
] | train | https://github.com/bramp/ffmpeg-cli-wrapper/blob/3819b155edf9132acc75bb6af66dcef1b98c64b2/src/main/java/net/bramp/ffmpeg/builder/FFmpegBuilder.java#L238-L242 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java | CleverTapAPI.createNotificationChannelGroup | @SuppressWarnings("unused")
public static void createNotificationChannelGroup(final Context context, final String groupId, final CharSequence groupName) {
final CleverTapAPI instance = getDefaultInstanceOrFirstOther(context);
if (instance == null) {
Logger.v("No CleverTap Instance found ... | java | @SuppressWarnings("unused")
public static void createNotificationChannelGroup(final Context context, final String groupId, final CharSequence groupName) {
final CleverTapAPI instance = getDefaultInstanceOrFirstOther(context);
if (instance == null) {
Logger.v("No CleverTap Instance found ... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"static",
"void",
"createNotificationChannelGroup",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"groupId",
",",
"final",
"CharSequence",
"groupName",
")",
"{",
"final",
"CleverTapAPI",
"insta... | Launches an asynchronous task to create the notification channel group from CleverTap
<p/>
Use this method when implementing your own FCM/GCM handling mechanism. Refer to the
SDK documentation for usage scenarios and examples.
@param context A reference to an Android context
@param groupId A String for setting the id ... | [
"Launches",
"an",
"asynchronous",
"task",
"to",
"create",
"the",
"notification",
"channel",
"group",
"from",
"CleverTap",
"<p",
"/",
">",
"Use",
"this",
"method",
"when",
"implementing",
"your",
"own",
"FCM",
"/",
"GCM",
"handling",
"mechanism",
".",
"Refer",
... | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L5774-L5799 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/validators/ValidateCreditCard.java | ValidateCreditCard.buildRanges | private static void buildRanges() {
// careful, no lead zeros allowed
// low high len vendor mod-10?
ranges = new LCR[] { new LCR(4000000000000L, 4999999999999L, 13, VISA, true), new LCR(30000000000000L, 30599999999999L, 14, DINERS, true),
new LCR(36000000000000L, 36999999999999L, 14, DINERS, true), new LCR(380000... | java | private static void buildRanges() {
// careful, no lead zeros allowed
// low high len vendor mod-10?
ranges = new LCR[] { new LCR(4000000000000L, 4999999999999L, 13, VISA, true), new LCR(30000000000000L, 30599999999999L, 14, DINERS, true),
new LCR(36000000000000L, 36999999999999L, 14, DINERS, true), new LCR(380000... | [
"private",
"static",
"void",
"buildRanges",
"(",
")",
"{",
"// careful, no lead zeros allowed",
"// low high len vendor mod-10?",
"ranges",
"=",
"new",
"LCR",
"[",
"]",
"{",
"new",
"LCR",
"(",
"4000000000000L",
",",
"4999999999999L",
",",
"13",
",",
"VISA",
",",
... | build table of which ranges of credit card number belong to which vendor | [
"build",
"table",
"of",
"which",
"ranges",
"of",
"credit",
"card",
"number",
"belong",
"to",
"which",
"vendor"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/validators/ValidateCreditCard.java#L112-L123 |
alkacon/opencms-core | src/org/opencms/search/galleries/CmsGallerySearch.java | CmsGallerySearch.searchByPath | public CmsGallerySearchResult searchByPath(String path, Locale locale) throws CmsException {
I_CmsSearchDocument sDoc = m_index.getDocument(CmsSearchField.FIELD_PATH, path);
CmsGallerySearchResult result = null;
if ((sDoc != null) && (sDoc.getDocument() != null)) {
result = new CmsG... | java | public CmsGallerySearchResult searchByPath(String path, Locale locale) throws CmsException {
I_CmsSearchDocument sDoc = m_index.getDocument(CmsSearchField.FIELD_PATH, path);
CmsGallerySearchResult result = null;
if ((sDoc != null) && (sDoc.getDocument() != null)) {
result = new CmsG... | [
"public",
"CmsGallerySearchResult",
"searchByPath",
"(",
"String",
"path",
",",
"Locale",
"locale",
")",
"throws",
"CmsException",
"{",
"I_CmsSearchDocument",
"sDoc",
"=",
"m_index",
".",
"getDocument",
"(",
"CmsSearchField",
".",
"FIELD_PATH",
",",
"path",
")",
"... | Searches by structure id.<p>
@param path the resource path
@param locale the locale for which the search result should be returned
@return the search result
@throws CmsException if something goes wrong | [
"Searches",
"by",
"structure",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/galleries/CmsGallerySearch.java#L196-L207 |
woo-j/OkapiBarcode | src/main/java/uk/org/okapibarcode/backend/Code128.java | Code128.combineSubsetBlocks | private int combineSubsetBlocks(Mode[] mode_type, int[] mode_length, int index_point) {
/* bring together same type blocks */
if (index_point > 1) {
for (int i = 1; i < index_point; i++) {
if (mode_type[i - 1] == mode_type[i]) {
/* bring together */
... | java | private int combineSubsetBlocks(Mode[] mode_type, int[] mode_length, int index_point) {
/* bring together same type blocks */
if (index_point > 1) {
for (int i = 1; i < index_point; i++) {
if (mode_type[i - 1] == mode_type[i]) {
/* bring together */
... | [
"private",
"int",
"combineSubsetBlocks",
"(",
"Mode",
"[",
"]",
"mode_type",
",",
"int",
"[",
"]",
"mode_length",
",",
"int",
"index_point",
")",
"{",
"/* bring together same type blocks */",
"if",
"(",
"index_point",
">",
"1",
")",
"{",
"for",
"(",
"int",
"... | Modifies the specified mode and length arrays to combine adjacent modes of the same type, returning the updated index point. | [
"Modifies",
"the",
"specified",
"mode",
"and",
"length",
"arrays",
"to",
"combine",
"adjacent",
"modes",
"of",
"the",
"same",
"type",
"returning",
"the",
"updated",
"index",
"point",
"."
] | train | https://github.com/woo-j/OkapiBarcode/blob/d1cb4f4ab64557cd3db64d9a473528a52ce58081/src/main/java/uk/org/okapibarcode/backend/Code128.java#L818-L836 |
etourdot/xincproc | xinclude/src/main/java/org/etourdot/xincproc/xinclude/sax/XIncludeContext.java | XIncludeContext.addInInclusionChain | public void addInInclusionChain(final URI path, final String pointer)
throws XIncludeFatalException
{
final String xincludePath = path.toASCIIString() + ((null != pointer) ? ('#' + pointer) : "");
if (this.xincludeDeque.contains(xincludePath))
{
throw new XIncludeFata... | java | public void addInInclusionChain(final URI path, final String pointer)
throws XIncludeFatalException
{
final String xincludePath = path.toASCIIString() + ((null != pointer) ? ('#' + pointer) : "");
if (this.xincludeDeque.contains(xincludePath))
{
throw new XIncludeFata... | [
"public",
"void",
"addInInclusionChain",
"(",
"final",
"URI",
"path",
",",
"final",
"String",
"pointer",
")",
"throws",
"XIncludeFatalException",
"{",
"final",
"String",
"xincludePath",
"=",
"path",
".",
"toASCIIString",
"(",
")",
"+",
"(",
"(",
"null",
"!=",
... | Add in inclusion chain.
@param path the path
@param pointer the pointer
@throws XIncludeFatalException the x include fatal exception | [
"Add",
"in",
"inclusion",
"chain",
"."
] | train | https://github.com/etourdot/xincproc/blob/6e9e9352e1975957ae6821a04c248ea49c7323ec/xinclude/src/main/java/org/etourdot/xincproc/xinclude/sax/XIncludeContext.java#L174-L183 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/Converter.java | Converter.setupDefaultView | public final ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, int iDisplayFieldDesc) // Add this view to the list
{
return this.setupDefaultView(itsLocation, targetScreen, this, iDisplayFieldDesc, null);
} | java | public final ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, int iDisplayFieldDesc) // Add this view to the list
{
return this.setupDefaultView(itsLocation, targetScreen, this, iDisplayFieldDesc, null);
} | [
"public",
"final",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"int",
"iDisplayFieldDesc",
")",
"// Add this view to the list",
"{",
"return",
"this",
".",
"setupDefaultView",
"(",
"itsLocation",
","... | Set up the default control for this field.
Calls setupDefaultView with this as the converter (Convenience method).
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param iDisplayFieldDesc... | [
"Set",
"up",
"the",
"default",
"control",
"for",
"this",
"field",
".",
"Calls",
"setupDefaultView",
"with",
"this",
"as",
"the",
"converter",
"(",
"Convenience",
"method",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/Converter.java#L354-L357 |
agmip/agmip-common-functions | src/main/java/org/agmip/functions/PTSaxton2006.java | PTSaxton2006.calcNormalDensity | public static String calcNormalDensity(String slsnd, String slcly, String omPct) {
String satMt = calcSaturatedMoisture(slsnd, slcly, omPct);
String ret = product(substract("100", satMt), "0.0265");
LOG.debug("Calculate result for Normal density, g/cm-3 is {}", ret);
return ret;
} | java | public static String calcNormalDensity(String slsnd, String slcly, String omPct) {
String satMt = calcSaturatedMoisture(slsnd, slcly, omPct);
String ret = product(substract("100", satMt), "0.0265");
LOG.debug("Calculate result for Normal density, g/cm-3 is {}", ret);
return ret;
} | [
"public",
"static",
"String",
"calcNormalDensity",
"(",
"String",
"slsnd",
",",
"String",
"slcly",
",",
"String",
"omPct",
")",
"{",
"String",
"satMt",
"=",
"calcSaturatedMoisture",
"(",
"slsnd",
",",
"slcly",
",",
"omPct",
")",
";",
"String",
"ret",
"=",
... | Equation 6 for calculating Normal density, g/cm-3
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentage by layer ([0,100]%), (=
SLOC * 1.72) | [
"Equation",
"6",
"for",
"calculating",
"Normal",
"density",
"g",
"/",
"cm",
"-",
"3"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/functions/PTSaxton2006.java#L225-L232 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/extraction/caduceus/CaduceusRelationPoint.java | CaduceusRelationPoint.getAnnotations | List<Annotation> getAnnotations(Multimap<String, Annotation> groups, TokenMatcher matcher) {
if (relationType == null) {
return getAnnotationStream(groups, matcher).filter(constraint).collect(Collectors.toList());
}
return getAnnotationStream(groups, matcher)
.flatMap(a -> {
... | java | List<Annotation> getAnnotations(Multimap<String, Annotation> groups, TokenMatcher matcher) {
if (relationType == null) {
return getAnnotationStream(groups, matcher).filter(constraint).collect(Collectors.toList());
}
return getAnnotationStream(groups, matcher)
.flatMap(a -> {
... | [
"List",
"<",
"Annotation",
">",
"getAnnotations",
"(",
"Multimap",
"<",
"String",
",",
"Annotation",
">",
"groups",
",",
"TokenMatcher",
"matcher",
")",
"{",
"if",
"(",
"relationType",
"==",
"null",
")",
"{",
"return",
"getAnnotationStream",
"(",
"groups",
"... | Gets annotations.
@param groups the groups
@return the annotations | [
"Gets",
"annotations",
"."
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/extraction/caduceus/CaduceusRelationPoint.java#L126-L146 |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/PlanNodeTree.java | PlanNodeTree.loadPlanNodesFromJSONArrays | private void loadPlanNodesFromJSONArrays(int stmtId, JSONArray jArray, Database db) {
List<AbstractPlanNode> planNodes = new ArrayList<>();
int size = jArray.length();
try {
for (int i = 0; i < size; i++) {
JSONObject jobj = jArray.getJSONObject(i);
S... | java | private void loadPlanNodesFromJSONArrays(int stmtId, JSONArray jArray, Database db) {
List<AbstractPlanNode> planNodes = new ArrayList<>();
int size = jArray.length();
try {
for (int i = 0; i < size; i++) {
JSONObject jobj = jArray.getJSONObject(i);
S... | [
"private",
"void",
"loadPlanNodesFromJSONArrays",
"(",
"int",
"stmtId",
",",
"JSONArray",
"jArray",
",",
"Database",
"db",
")",
"{",
"List",
"<",
"AbstractPlanNode",
">",
"planNodes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"size",
"=",
"jArray"... | Load plan nodes from the "PLAN_NODE" array. All the nodes are from
a substatement with the id = stmtId
@param stmtId
@param jArray - PLAN_NODES
@param db
@throws JSONException | [
"Load",
"plan",
"nodes",
"from",
"the",
"PLAN_NODE",
"array",
".",
"All",
"the",
"nodes",
"are",
"from",
"a",
"substatement",
"with",
"the",
"id",
"=",
"stmtId"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/PlanNodeTree.java#L255-L287 |
johncarl81/parceler | parceler-api/src/main/java/org/parceler/InjectionUtil.java | InjectionUtil.callConstructor | public static <T> T callConstructor(Class<T> targetClass, Class[] argClasses, Object[] args) {
T output;
try {
Constructor classConstructor = targetClass.getDeclaredConstructor(argClasses);
output = AccessController.doPrivileged(
new SetConstructorPrivileged... | java | public static <T> T callConstructor(Class<T> targetClass, Class[] argClasses, Object[] args) {
T output;
try {
Constructor classConstructor = targetClass.getDeclaredConstructor(argClasses);
output = AccessController.doPrivileged(
new SetConstructorPrivileged... | [
"public",
"static",
"<",
"T",
">",
"T",
"callConstructor",
"(",
"Class",
"<",
"T",
">",
"targetClass",
",",
"Class",
"[",
"]",
"argClasses",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"T",
"output",
";",
"try",
"{",
"Constructor",
"classConstructor",
"... | Instantiates a class by calling the constructor.
@param targetClass instance type to construct
@param argClasses argument types accepted by the constructor
@param args constructor argument values
@param <T> relating type parameter
@return instance created by constructor | [
"Instantiates",
"a",
"class",
"by",
"calling",
"the",
"constructor",
"."
] | train | https://github.com/johncarl81/parceler/blob/39624b2b71e2f06e1c556e9d9d198afb9a705912/parceler-api/src/main/java/org/parceler/InjectionUtil.java#L190-L207 |
ag-gipp/MathMLTools | mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/node/MathNodeGenerator.java | MathNodeGenerator.createMathNode | private static MathNode createMathNode(Node node, int depth) {
MathNode mathNode = new MathNode();
mathNode.setName(node.getNodeName());
if (mathNode.getName().equalsIgnoreCase("annotation-xml")) {
// this can be an additional tag from the strict cmml conversion
// - node... | java | private static MathNode createMathNode(Node node, int depth) {
MathNode mathNode = new MathNode();
mathNode.setName(node.getNodeName());
if (mathNode.getName().equalsIgnoreCase("annotation-xml")) {
// this can be an additional tag from the strict cmml conversion
// - node... | [
"private",
"static",
"MathNode",
"createMathNode",
"(",
"Node",
"node",
",",
"int",
"depth",
")",
"{",
"MathNode",
"mathNode",
"=",
"new",
"MathNode",
"(",
")",
";",
"mathNode",
".",
"setName",
"(",
"node",
".",
"getNodeName",
"(",
")",
")",
";",
"if",
... | Recursive method to create a math expression tree (MEXT). Every child
and all attributes are considered in the conversion.
@param node current xml node in cmml, typically the root element
@param depth current depth of the math tree
@return converted MathNode we use in this application | [
"Recursive",
"method",
"to",
"create",
"a",
"math",
"expression",
"tree",
"(",
"MEXT",
")",
".",
"Every",
"child",
"and",
"all",
"attributes",
"are",
"considered",
"in",
"the",
"conversion",
"."
] | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/node/MathNodeGenerator.java#L73-L88 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/StyleSet.java | StyleSet.setFont | public StyleSet setFont(short color, short fontSize, String fontName, boolean ignoreHead) {
final Font font = StyleUtil.createFont(this.workbook, color, fontSize, fontName);
return setFont(font, ignoreHead);
} | java | public StyleSet setFont(short color, short fontSize, String fontName, boolean ignoreHead) {
final Font font = StyleUtil.createFont(this.workbook, color, fontSize, fontName);
return setFont(font, ignoreHead);
} | [
"public",
"StyleSet",
"setFont",
"(",
"short",
"color",
",",
"short",
"fontSize",
",",
"String",
"fontName",
",",
"boolean",
"ignoreHead",
")",
"{",
"final",
"Font",
"font",
"=",
"StyleUtil",
".",
"createFont",
"(",
"this",
".",
"workbook",
",",
"color",
"... | 设置全局字体
@param color 字体颜色
@param fontSize 字体大小,-1表示默认大小
@param fontName 字体名,null表示默认字体
@param ignoreHead 是否跳过头部样式
@return this | [
"设置全局字体"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/StyleSet.java#L149-L152 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java | JavacTaskImpl.parseType | public Type parseType(String expr, TypeElement scope) {
if (expr == null || expr.equals(""))
throw new IllegalArgumentException();
compiler = JavaCompiler.instance(context);
JavaFileObject prev = compiler.log.useSource(null);
ParserFactory parserFactory = ParserFactory.instan... | java | public Type parseType(String expr, TypeElement scope) {
if (expr == null || expr.equals(""))
throw new IllegalArgumentException();
compiler = JavaCompiler.instance(context);
JavaFileObject prev = compiler.log.useSource(null);
ParserFactory parserFactory = ParserFactory.instan... | [
"public",
"Type",
"parseType",
"(",
"String",
"expr",
",",
"TypeElement",
"scope",
")",
"{",
"if",
"(",
"expr",
"==",
"null",
"||",
"expr",
".",
"equals",
"(",
"\"\"",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"compiler",
"=",
... | For internal use only. This method will be
removed without warning.
@param expr the type expression to be analyzed
@param scope the scope in which to analyze the type expression
@return the type
@throws IllegalArgumentException if the type expression of null or empty | [
"For",
"internal",
"use",
"only",
".",
"This",
"method",
"will",
"be",
"removed",
"without",
"warning",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java#L518-L533 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/util/LevelDBProvider.java | LevelDBProvider.checkVersion | public static void checkVersion(DB db, StoreVersion newversion, ObjectMapper mapper) throws
IOException {
byte[] bytes = db.get(StoreVersion.KEY);
if (bytes == null) {
storeVersion(db, newversion, mapper);
} else {
StoreVersion version = mapper.readValue(bytes, StoreVersion.class);
i... | java | public static void checkVersion(DB db, StoreVersion newversion, ObjectMapper mapper) throws
IOException {
byte[] bytes = db.get(StoreVersion.KEY);
if (bytes == null) {
storeVersion(db, newversion, mapper);
} else {
StoreVersion version = mapper.readValue(bytes, StoreVersion.class);
i... | [
"public",
"static",
"void",
"checkVersion",
"(",
"DB",
"db",
",",
"StoreVersion",
"newversion",
",",
"ObjectMapper",
"mapper",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"db",
".",
"get",
"(",
"StoreVersion",
".",
"KEY",
")",
";",
... | Simple major.minor versioning scheme. Any incompatible changes should be across major
versions. Minor version differences are allowed -- meaning we should be able to read
dbs that are either earlier *or* later on the minor version. | [
"Simple",
"major",
".",
"minor",
"versioning",
"scheme",
".",
"Any",
"incompatible",
"changes",
"should",
"be",
"across",
"major",
"versions",
".",
"Minor",
"version",
"differences",
"are",
"allowed",
"--",
"meaning",
"we",
"should",
"be",
"able",
"to",
"read"... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/util/LevelDBProvider.java#L102-L115 |
vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiParser.java | EmojiParser.removeEmojis | public static String removeEmojis(
String str,
final Collection<Emoji> emojisToRemove
) {
EmojiTransformer emojiTransformer = new EmojiTransformer() {
public String transform(UnicodeCandidate unicodeCandidate) {
if (!emojisToRemove.contains(unicodeCandidate.getEmoji())) {
return un... | java | public static String removeEmojis(
String str,
final Collection<Emoji> emojisToRemove
) {
EmojiTransformer emojiTransformer = new EmojiTransformer() {
public String transform(UnicodeCandidate unicodeCandidate) {
if (!emojisToRemove.contains(unicodeCandidate.getEmoji())) {
return un... | [
"public",
"static",
"String",
"removeEmojis",
"(",
"String",
"str",
",",
"final",
"Collection",
"<",
"Emoji",
">",
"emojisToRemove",
")",
"{",
"EmojiTransformer",
"emojiTransformer",
"=",
"new",
"EmojiTransformer",
"(",
")",
"{",
"public",
"String",
"transform",
... | Removes a set of emojis from a String
@param str the string to process
@param emojisToRemove the emojis to remove from this string
@return the string without the emojis that were removed | [
"Removes",
"a",
"set",
"of",
"emojis",
"from",
"a",
"String"
] | train | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiParser.java#L308-L323 |
riversun/d6 | src/main/java/org/riversun/d6/core/ModelWrapper.java | ModelWrapper.setValue | public void setValue(String columnName, Object value) {
D6ModelClassFieldInfo fieldInfo = mFieldMap.get(columnName);
if (fieldInfo != null) {
fieldInfo.value = value;
}
else {
// case field info is null
final String[] parts = columnN... | java | public void setValue(String columnName, Object value) {
D6ModelClassFieldInfo fieldInfo = mFieldMap.get(columnName);
if (fieldInfo != null) {
fieldInfo.value = value;
}
else {
// case field info is null
final String[] parts = columnN... | [
"public",
"void",
"setValue",
"(",
"String",
"columnName",
",",
"Object",
"value",
")",
"{",
"D6ModelClassFieldInfo",
"fieldInfo",
"=",
"mFieldMap",
".",
"get",
"(",
"columnName",
")",
";",
"if",
"(",
"fieldInfo",
"!=",
"null",
")",
"{",
"fieldInfo",
".",
... | Set the value to a field of the model object.The field is associated with
DB column name by DBColumn annotation.
@param columnName
@param value | [
"Set",
"the",
"value",
"to",
"a",
"field",
"of",
"the",
"model",
"object",
".",
"The",
"field",
"is",
"associated",
"with",
"DB",
"column",
"name",
"by",
"DBColumn",
"annotation",
"."
] | train | https://github.com/riversun/d6/blob/2798bd876b9380dbfea8182d11ad306cb1b0e114/src/main/java/org/riversun/d6/core/ModelWrapper.java#L74-L101 |
jeppetto/jeppetto | jeppetto-enhance/src/main/java/org/iternine/jeppetto/enhance/ClassLoadingUtil.java | ClassLoadingUtil.toClass | public static <T> Class<T> toClass(CtClass ctClass, ClassLoader loader, ProtectionDomain domain) throws CannotCompileException {
try {
byte[] byteCode = ctClass.toBytecode();
if (domain == null) {
return bruteForceDefineClass(DEFINE_METHOD_NO_DOMAIN, loader, ctClass.getN... | java | public static <T> Class<T> toClass(CtClass ctClass, ClassLoader loader, ProtectionDomain domain) throws CannotCompileException {
try {
byte[] byteCode = ctClass.toBytecode();
if (domain == null) {
return bruteForceDefineClass(DEFINE_METHOD_NO_DOMAIN, loader, ctClass.getN... | [
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"toClass",
"(",
"CtClass",
"ctClass",
",",
"ClassLoader",
"loader",
",",
"ProtectionDomain",
"domain",
")",
"throws",
"CannotCompileException",
"{",
"try",
"{",
"byte",
"[",
"]",
"byteCode",
"=",
"... | Installs the given {@code CtClass} into the given class-loader and returns
it as a new class.
@param ctClass class to load
@param loader class-loader to install into
@param domain protection domain, may be null
@param <T> class type
@return new class
@throws CannotCompileException if the class cannot be compiled | [
"Installs",
"the",
"given",
"{",
"@code",
"CtClass",
"}",
"into",
"the",
"given",
"class",
"-",
"loader",
"and",
"returns",
"it",
"as",
"a",
"new",
"class",
"."
] | train | https://github.com/jeppetto/jeppetto/blob/bd2796dcf53376052f590e727931990a2902a933/jeppetto-enhance/src/main/java/org/iternine/jeppetto/enhance/ClassLoadingUtil.java#L134-L151 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.readJSONArray | public static JSONArray readJSONArray(File file, Charset charset) throws IORuntimeException {
return parseArray(FileReader.create(file, charset).readString());
} | java | public static JSONArray readJSONArray(File file, Charset charset) throws IORuntimeException {
return parseArray(FileReader.create(file, charset).readString());
} | [
"public",
"static",
"JSONArray",
"readJSONArray",
"(",
"File",
"file",
",",
"Charset",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"parseArray",
"(",
"FileReader",
".",
"create",
"(",
"file",
",",
"charset",
")",
".",
"readString",
"(",
")",... | 读取JSONArray
@param file JSON文件
@param charset 编码
@return JSONArray
@throws IORuntimeException IO异常 | [
"读取JSONArray"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L236-L238 |
bazaarvoice/emodb | queue-client-common/src/main/java/com/bazaarvoice/emodb/queue/client/AbstractQueueClient.java | AbstractQueueClient.sendAll | public void sendAll(String apiKey, Map<String, ? extends Collection<?>> messagesByQueue) {
checkNotNull(messagesByQueue, "messagesByQueue");
if (messagesByQueue.isEmpty()) {
return;
}
if (messagesByQueue.size() == 1) {
// Prefer the single queue REST call because ... | java | public void sendAll(String apiKey, Map<String, ? extends Collection<?>> messagesByQueue) {
checkNotNull(messagesByQueue, "messagesByQueue");
if (messagesByQueue.isEmpty()) {
return;
}
if (messagesByQueue.size() == 1) {
// Prefer the single queue REST call because ... | [
"public",
"void",
"sendAll",
"(",
"String",
"apiKey",
",",
"Map",
"<",
"String",
",",
"?",
"extends",
"Collection",
"<",
"?",
">",
">",
"messagesByQueue",
")",
"{",
"checkNotNull",
"(",
"messagesByQueue",
",",
"\"messagesByQueue\"",
")",
";",
"if",
"(",
"m... | Any server can handle sending messages, no need for @PartitionKey | [
"Any",
"server",
"can",
"handle",
"sending",
"messages",
"no",
"need",
"for"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/queue-client-common/src/main/java/com/bazaarvoice/emodb/queue/client/AbstractQueueClient.java#L79-L101 |
gallandarakhneorg/afc | core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/AbstractForest.java | AbstractForest.fireTreeAddition | protected synchronized void fireTreeAddition(Tree<D, ?> tree) {
if (this.listeners != null) {
final ForestListener[] list = new ForestListener[this.listeners.size()];
this.listeners.toArray(list);
final ForestEvent event = new ForestEvent(this, null, tree);
for (final ForestListener listener : list) {
... | java | protected synchronized void fireTreeAddition(Tree<D, ?> tree) {
if (this.listeners != null) {
final ForestListener[] list = new ForestListener[this.listeners.size()];
this.listeners.toArray(list);
final ForestEvent event = new ForestEvent(this, null, tree);
for (final ForestListener listener : list) {
... | [
"protected",
"synchronized",
"void",
"fireTreeAddition",
"(",
"Tree",
"<",
"D",
",",
"?",
">",
"tree",
")",
"{",
"if",
"(",
"this",
".",
"listeners",
"!=",
"null",
")",
"{",
"final",
"ForestListener",
"[",
"]",
"list",
"=",
"new",
"ForestListener",
"[",
... | Fire the addition event.
@param tree is the new tree in the forest. | [
"Fire",
"the",
"addition",
"event",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/AbstractForest.java#L351-L360 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/util/TwoDHashMap.java | TwoDHashMap.containsKey | public boolean containsKey(final K1 firstKey, final K2 secondKey) {
// existence check on inner map
final HashMap<K2, V> innerMap = map.get(firstKey);
if( innerMap == null ) {
return false;
}
return innerMap.containsKey(secondKey);
} | java | public boolean containsKey(final K1 firstKey, final K2 secondKey) {
// existence check on inner map
final HashMap<K2, V> innerMap = map.get(firstKey);
if( innerMap == null ) {
return false;
}
return innerMap.containsKey(secondKey);
} | [
"public",
"boolean",
"containsKey",
"(",
"final",
"K1",
"firstKey",
",",
"final",
"K2",
"secondKey",
")",
"{",
"// existence check on inner map",
"final",
"HashMap",
"<",
"K2",
",",
"V",
">",
"innerMap",
"=",
"map",
".",
"get",
"(",
"firstKey",
")",
";",
"... | Existence check of a value (or <tt>null</tt>) mapped to the keys.
@param firstKey
first key
@param secondKey
second key
@return true when an element (or <tt>null</tt>) has been stored with the keys | [
"Existence",
"check",
"of",
"a",
"value",
"(",
"or",
"<tt",
">",
"null<",
"/",
"tt",
">",
")",
"mapped",
"to",
"the",
"keys",
"."
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/util/TwoDHashMap.java#L70-L77 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java | JdbcCpoXaAdapter.existsObject | @Override
public <T> long existsObject(String name, T obj) throws CpoException {
return getCurrentResource().existsObject( name, obj);
} | java | @Override
public <T> long existsObject(String name, T obj) throws CpoException {
return getCurrentResource().existsObject( name, obj);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"long",
"existsObject",
"(",
"String",
"name",
",",
"T",
"obj",
")",
"throws",
"CpoException",
"{",
"return",
"getCurrentResource",
"(",
")",
".",
"existsObject",
"(",
"name",
",",
"obj",
")",
";",
"}"
] | The CpoAdapter will check to see if this object exists in the datasource.
<p>
<pre>Example:
<code>
<p>
class SomeObject so = new SomeObject();
long count = 0;
class CpoAdapter cpo = null;
<p>
<p>
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false));
} catch (CpoException ce) {
/... | [
"The",
"CpoAdapter",
"will",
"check",
"to",
"see",
"if",
"this",
"object",
"exists",
"in",
"the",
"datasource",
".",
"<p",
">",
"<pre",
">",
"Example",
":",
"<code",
">",
"<p",
">",
"class",
"SomeObject",
"so",
"=",
"new",
"SomeObject",
"()",
";",
"lon... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java#L910-L913 |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/web/JobSubmissionServlet.java | JobSubmissionServlet.showErrorPage | private void showErrorPage(HttpServletResponse resp, String message) throws IOException {
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(GUIServletStub.CONTENT_TYPE_HTML);
PrintWriter writer = resp.getWriter();
writer
.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transition... | java | private void showErrorPage(HttpServletResponse resp, String message) throws IOException {
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType(GUIServletStub.CONTENT_TYPE_HTML);
PrintWriter writer = resp.getWriter();
writer
.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transition... | [
"private",
"void",
"showErrorPage",
"(",
"HttpServletResponse",
"resp",
",",
"String",
"message",
")",
"throws",
"IOException",
"{",
"resp",
".",
"setStatus",
"(",
"HttpServletResponse",
".",
"SC_OK",
")",
";",
"resp",
".",
"setContentType",
"(",
"GUIServletStub",... | Prints the error page, containing the given message.
@param resp
The response handler.
@param message
The message to display.
@throws IOException
Thrown, if the error page could not be printed due to an I/O problem. | [
"Prints",
"the",
"error",
"page",
"containing",
"the",
"given",
"message",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/web/JobSubmissionServlet.java#L343-L373 |
EdwardRaff/JSAT | JSAT/src/jsat/clustering/hierarchical/PriorityHAC.java | PriorityHAC.getClusterDesignations | public List<List<DataPoint>> getClusterDesignations(int clusters)
{
if(!hasStoredClustering())
return null;
int[] assignments = new int[curDataSet.size()];
return createClusterListFromAssignmentArray(assignments, curDataSet);
} | java | public List<List<DataPoint>> getClusterDesignations(int clusters)
{
if(!hasStoredClustering())
return null;
int[] assignments = new int[curDataSet.size()];
return createClusterListFromAssignmentArray(assignments, curDataSet);
} | [
"public",
"List",
"<",
"List",
"<",
"DataPoint",
">",
">",
"getClusterDesignations",
"(",
"int",
"clusters",
")",
"{",
"if",
"(",
"!",
"hasStoredClustering",
"(",
")",
")",
"return",
"null",
";",
"int",
"[",
"]",
"assignments",
"=",
"new",
"int",
"[",
... | Returns the assignment array for that would have been computed for the
previous data set with the desired number of clusters.
@param clusters the number of clusters desired
@return the list of data points in each cluster, or <tt>null</tt> if no
data set has been clustered.
@see #hasStoredClustering() | [
"Returns",
"the",
"assignment",
"array",
"for",
"that",
"would",
"have",
"been",
"computed",
"for",
"the",
"previous",
"data",
"set",
"with",
"the",
"desired",
"number",
"of",
"clusters",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/clustering/hierarchical/PriorityHAC.java#L278-L284 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.generateSource | public static void generateSource(String data, File sourceOutputPath) {
ProtoFile protoFile = ProtoParser.parse(DEFAULT_FILE_NAME, data);
List<CodeDependent> cds = new ArrayList<CodeDependent>();
try {
doCreate(protoFile, true, false, null, true, sourceOutputPath, cds, new HashMa... | java | public static void generateSource(String data, File sourceOutputPath) {
ProtoFile protoFile = ProtoParser.parse(DEFAULT_FILE_NAME, data);
List<CodeDependent> cds = new ArrayList<CodeDependent>();
try {
doCreate(protoFile, true, false, null, true, sourceOutputPath, cds, new HashMa... | [
"public",
"static",
"void",
"generateSource",
"(",
"String",
"data",
",",
"File",
"sourceOutputPath",
")",
"{",
"ProtoFile",
"protoFile",
"=",
"ProtoParser",
".",
"parse",
"(",
"DEFAULT_FILE_NAME",
",",
"data",
")",
";",
"List",
"<",
"CodeDependent",
">",
"cds... | Generate source.
@param data the data
@param sourceOutputPath the source output path | [
"Generate",
"source",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L1485-L1493 |
GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/BigQueryHelper.java | BigQueryHelper.insertJobOrFetchDuplicate | public Job insertJobOrFetchDuplicate(String projectId, Job job) throws IOException {
Preconditions.checkArgument(
job.getJobReference() != null && job.getJobReference().getJobId() != null,
"Require non-null JobReference and JobId inside; getJobReference() == '%s'",
job.getJobReference());
... | java | public Job insertJobOrFetchDuplicate(String projectId, Job job) throws IOException {
Preconditions.checkArgument(
job.getJobReference() != null && job.getJobReference().getJobId() != null,
"Require non-null JobReference and JobId inside; getJobReference() == '%s'",
job.getJobReference());
... | [
"public",
"Job",
"insertJobOrFetchDuplicate",
"(",
"String",
"projectId",
",",
"Job",
"job",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"job",
".",
"getJobReference",
"(",
")",
"!=",
"null",
"&&",
"job",
".",
"getJobReference"... | Tries to run jobs().insert(...) with the provided {@code projectId} and {@code job}, which
returns a {@code Job} under normal operation, which is then returned from this method.
In case of an exception being thrown, if the cause was "409 conflict", then we issue a
separate "jobs().get(...)" request and return the resul... | [
"Tries",
"to",
"run",
"jobs",
"()",
".",
"insert",
"(",
"...",
")",
"with",
"the",
"provided",
"{"
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/BigQueryHelper.java#L323-L346 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDatatypeImpl_CustomFieldSerializer.java | OWLDatatypeImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDatatypeImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDatatypeImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDatatypeImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user.clie... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDatatypeImpl_CustomFieldSerializer.java#L83-L86 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java | MicroWriter.writeToFile | @Nonnull
public static ESuccess writeToFile (@Nonnull final IMicroNode aNode,
@Nonnull final File aFile,
@Nonnull final IXMLWriterSettings aSettings)
{
ValueEnforcer.notNull (aFile, "File");
final OutputStream aOS = FileHelper.getO... | java | @Nonnull
public static ESuccess writeToFile (@Nonnull final IMicroNode aNode,
@Nonnull final File aFile,
@Nonnull final IXMLWriterSettings aSettings)
{
ValueEnforcer.notNull (aFile, "File");
final OutputStream aOS = FileHelper.getO... | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"writeToFile",
"(",
"@",
"Nonnull",
"final",
"IMicroNode",
"aNode",
",",
"@",
"Nonnull",
"final",
"File",
"aFile",
",",
"@",
"Nonnull",
"final",
"IXMLWriterSettings",
"aSettings",
")",
"{",
"ValueEnforcer",
".",
... | Write a Micro Node to a file.
@param aNode
The node to be serialized. May be any kind of node (incl.
documents). May not be <code>null</code>.
@param aFile
The file to write to. May not be <code>null</code>.
@param aSettings
The settings to be used for the creation. May not be
<code>null</code>.
@return {@link ESucces... | [
"Write",
"a",
"Micro",
"Node",
"to",
"a",
"file",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java#L89-L103 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.stopInstance | public void stopInstance(String instanceId, boolean forceStop) {
this.stopInstance(new StopInstanceRequest()
.withInstanceId(instanceId).withForceStop(forceStop));
} | java | public void stopInstance(String instanceId, boolean forceStop) {
this.stopInstance(new StopInstanceRequest()
.withInstanceId(instanceId).withForceStop(forceStop));
} | [
"public",
"void",
"stopInstance",
"(",
"String",
"instanceId",
",",
"boolean",
"forceStop",
")",
"{",
"this",
".",
"stopInstance",
"(",
"new",
"StopInstanceRequest",
"(",
")",
".",
"withInstanceId",
"(",
"instanceId",
")",
".",
"withForceStop",
"(",
"forceStop",... | Stopping the instance owned by the user.
You can stop the instance only when the instance is Running,
otherwise,it's will get <code>409</code> errorCode.
This is an asynchronous interface,
you can get the latest status by invoke {@link #getInstance(GetInstanceRequest)}
@param instanceId The id of the instance.
@para... | [
"Stopping",
"the",
"instance",
"owned",
"by",
"the",
"user",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L425-L428 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getMaterialStorage | public void getMaterialStorage(String API, Callback<List<MaterialStorage>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API));
gw2API.getMaterialBank(API).enqueue(callback);
} | java | public void getMaterialStorage(String API, Callback<List<MaterialStorage>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API));
gw2API.getMaterialBank(API).enqueue(callback);
} | [
"public",
"void",
"getMaterialStorage",
"(",
"String",
"API",
",",
"Callback",
"<",
"List",
"<",
"MaterialStorage",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"Para... | For more info on MaterialCategory Storage API go <a href="https://wiki.guildwars2.com/wiki/API:2/account/materials">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param API API key
@param callback c... | [
"For",
"more",
"info",
"on",
"MaterialCategory",
"Storage",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"account",
"/",
"materials",
">",
"here<",
"/",
"a",
">",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L340-L343 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/PathUtils.java | PathUtils.isSymbolicLink | private static boolean isSymbolicLink(final File file, File parentFile) throws PrivilegedActionException {
File canonicalParentDir = getCanonicalFile(parentFile);
File fileInCanonicalParentDir = new File(canonicalParentDir, file.getName());
File canonicalFile = getCanonicalFile(fileInCanonicalPa... | java | private static boolean isSymbolicLink(final File file, File parentFile) throws PrivilegedActionException {
File canonicalParentDir = getCanonicalFile(parentFile);
File fileInCanonicalParentDir = new File(canonicalParentDir, file.getName());
File canonicalFile = getCanonicalFile(fileInCanonicalPa... | [
"private",
"static",
"boolean",
"isSymbolicLink",
"(",
"final",
"File",
"file",
",",
"File",
"parentFile",
")",
"throws",
"PrivilegedActionException",
"{",
"File",
"canonicalParentDir",
"=",
"getCanonicalFile",
"(",
"parentFile",
")",
";",
"File",
"fileInCanonicalPare... | Test if a file is a symbolic link. Test only the file.
A symbolic link elsewhere in the path to the file is not detected.
Gets the canonical form of the parent directory and appends the file name.
Then compares that canonical form of the file to the "Absolute" file. If
it doesn't match, then it is a symbolic link.
@p... | [
"Test",
"if",
"a",
"file",
"is",
"a",
"symbolic",
"link",
".",
"Test",
"only",
"the",
"file",
".",
"A",
"symbolic",
"link",
"elsewhere",
"in",
"the",
"path",
"to",
"the",
"file",
"is",
"not",
"detected",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/PathUtils.java#L1399-L1405 |
census-instrumentation/opencensus-java | benchmarks/src/jmh/java/io/opencensus/benchmarks/tags/TagsBenchmarksUtil.java | TagsBenchmarksUtil.getTagContextBinarySerializer | @VisibleForTesting
public static TagContextBinarySerializer getTagContextBinarySerializer(String implementation) {
if (implementation.equals("impl")) {
// We can return the global tracer here because if impl is linked the global tracer will be
// the impl one.
// TODO(bdrutu): Make everything no... | java | @VisibleForTesting
public static TagContextBinarySerializer getTagContextBinarySerializer(String implementation) {
if (implementation.equals("impl")) {
// We can return the global tracer here because if impl is linked the global tracer will be
// the impl one.
// TODO(bdrutu): Make everything no... | [
"@",
"VisibleForTesting",
"public",
"static",
"TagContextBinarySerializer",
"getTagContextBinarySerializer",
"(",
"String",
"implementation",
")",
"{",
"if",
"(",
"implementation",
".",
"equals",
"(",
"\"impl\"",
")",
")",
"{",
"// We can return the global tracer here becau... | Gets the {@link TagContextBinarySerializer} for the specified 'implementation'. | [
"Gets",
"the",
"{"
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/benchmarks/src/jmh/java/io/opencensus/benchmarks/tags/TagsBenchmarksUtil.java#L62-L75 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.productUpdateContSign | public JSONObject productUpdateContSign(String contSign, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("cont_sign", contSign);
if (options != null) {
request.addBody(options);
}
reques... | java | public JSONObject productUpdateContSign(String contSign, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("cont_sign", contSign);
if (options != null) {
request.addBody(options);
}
reques... | [
"public",
"JSONObject",
"productUpdateContSign",
"(",
"String",
"contSign",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"r... | 商品检索—更新接口
**更新图库中图片的摘要和分类信息(具体变量为brief、class_id1/class_id2)**
@param contSign - 图片签名
@param options - 可选参数对象,key: value都为string类型
options - options列表:
brief 更新的摘要信息,最长256B。样例:{"name":"周杰伦", "id":"666"}
class_id1 更新的商品分类1,支持1-60范围内的整数。
class_id2 更新的商品分类2,支持1-60范围内的整数。
@return JSONObject | [
"商品检索—更新接口",
"**",
"更新图库中图片的摘要和分类信息(具体变量为brief、class_id1",
"/",
"class_id2)",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L918-L929 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java | ZipUtil.unzipFileBytes | @SuppressWarnings("unchecked")
public static byte[] unzipFileBytes(File zipFile, Charset charset, String name) {
ZipFile zipFileObj = null;
try {
zipFileObj = new ZipFile(zipFile, charset);
final Enumeration<ZipEntry> em = (Enumeration<ZipEntry>) zipFileObj.entries();
ZipEntry zipEntry = null;
w... | java | @SuppressWarnings("unchecked")
public static byte[] unzipFileBytes(File zipFile, Charset charset, String name) {
ZipFile zipFileObj = null;
try {
zipFileObj = new ZipFile(zipFile, charset);
final Enumeration<ZipEntry> em = (Enumeration<ZipEntry>) zipFileObj.entries();
ZipEntry zipEntry = null;
w... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"byte",
"[",
"]",
"unzipFileBytes",
"(",
"File",
"zipFile",
",",
"Charset",
"charset",
",",
"String",
"name",
")",
"{",
"ZipFile",
"zipFileObj",
"=",
"null",
";",
"try",
"{",
"zipFileObj... | 从Zip文件中提取指定的文件为bytes
@param zipFile Zip文件
@param charset 编码
@param name 文件名,如果存在于子文件夹中,此文件名必须包含目录名,例如images/aaa.txt
@return 文件内容bytes
@since 4.1.8 | [
"从Zip文件中提取指定的文件为bytes"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L459-L480 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java | MemberSummaryBuilder.buildEnumConstantsSummary | public void buildEnumConstantsSummary(XMLNode node, Content memberSummaryTree) {
MemberSummaryWriter writer =
memberSummaryWriters.get(VisibleMemberMap.Kind.ENUM_CONSTANTS);
VisibleMemberMap visibleMemberMap =
getVisibleMemberMap(VisibleMemberMap.Kind.ENUM_CONSTANTS);
... | java | public void buildEnumConstantsSummary(XMLNode node, Content memberSummaryTree) {
MemberSummaryWriter writer =
memberSummaryWriters.get(VisibleMemberMap.Kind.ENUM_CONSTANTS);
VisibleMemberMap visibleMemberMap =
getVisibleMemberMap(VisibleMemberMap.Kind.ENUM_CONSTANTS);
... | [
"public",
"void",
"buildEnumConstantsSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"memberSummaryTree",
")",
"{",
"MemberSummaryWriter",
"writer",
"=",
"memberSummaryWriters",
".",
"get",
"(",
"VisibleMemberMap",
".",
"Kind",
".",
"ENUM_CONSTANTS",
")",
";",
"Vi... | Build the summary for the enum constants.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added | [
"Build",
"the",
"summary",
"for",
"the",
"enum",
"constants",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java#L209-L215 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/contentcensor/AipContentCensor.java | AipContentCensor.faceAudit | public JSONObject faceAudit(List<String> imgPaths, EImgType type,
HashMap<String, String> options) {
if (type == EImgType.FILE) {
try {
byte[][] imgData = new byte[imgPaths.size()][];
int idx = 0;
for (String path : imgP... | java | public JSONObject faceAudit(List<String> imgPaths, EImgType type,
HashMap<String, String> options) {
if (type == EImgType.FILE) {
try {
byte[][] imgData = new byte[imgPaths.size()][];
int idx = 0;
for (String path : imgP... | [
"public",
"JSONObject",
"faceAudit",
"(",
"List",
"<",
"String",
">",
"imgPaths",
",",
"EImgType",
"type",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"if",
"(",
"type",
"==",
"EImgType",
".",
"FILE",
")",
"{",
"try",
"{",
... | 头像审核接口
@param imgPaths 本地图片路径或图片url列表
@param type imgPaths参数类型:FILE或URL
@param options 可选参数
@return JSONObject | [
"头像审核接口"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/contentcensor/AipContentCensor.java#L219-L240 |
NoraUi/NoraUi | src/main/java/com/github/noraui/data/CommonDataProvider.java | CommonDataProvider.writeFailedResult | public void writeFailedResult(int line, String value) {
logger.debug("Write Failed result => line:{} value:{}", line, value);
writeValue(resultColumnName, line, value);
} | java | public void writeFailedResult(int line, String value) {
logger.debug("Write Failed result => line:{} value:{}", line, value);
writeValue(resultColumnName, line, value);
} | [
"public",
"void",
"writeFailedResult",
"(",
"int",
"line",
",",
"String",
"value",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Write Failed result => line:{} value:{}\"",
",",
"line",
",",
"value",
")",
";",
"writeValue",
"(",
"resultColumnName",
",",
"line",
",",... | Writes a fail result
@param line
The line number
@param value
The value | [
"Writes",
"a",
"fail",
"result"
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/data/CommonDataProvider.java#L143-L146 |
alibaba/canal | client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/support/ESTemplate.java | ESTemplate.updateByQuery | public void updateByQuery(ESSyncConfig config, Map<String, Object> paramsTmp, Map<String, Object> esFieldData) {
if (paramsTmp.isEmpty()) {
return;
}
ESMapping mapping = config.getEsMapping();
BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
paramsTmp.forEac... | java | public void updateByQuery(ESSyncConfig config, Map<String, Object> paramsTmp, Map<String, Object> esFieldData) {
if (paramsTmp.isEmpty()) {
return;
}
ESMapping mapping = config.getEsMapping();
BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
paramsTmp.forEac... | [
"public",
"void",
"updateByQuery",
"(",
"ESSyncConfig",
"config",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paramsTmp",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"esFieldData",
")",
"{",
"if",
"(",
"paramsTmp",
".",
"isEmpty",
"(",
")",
")",
... | update by query
@param config 配置对象
@param paramsTmp sql查询条件
@param esFieldData 数据Map | [
"update",
"by",
"query"
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/support/ESTemplate.java#L130-L166 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getPatternAnyEntityRole | public EntityRole getPatternAnyEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId) {
return getPatternAnyEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).toBlocking().single().body();
} | java | public EntityRole getPatternAnyEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId) {
return getPatternAnyEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).toBlocking().single().body();
} | [
"public",
"EntityRole",
"getPatternAnyEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"getPatternAnyEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"entityId",... | Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity ID.
@param roleId entity role ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws... | [
"Get",
"one",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L12757-L12759 |
unbescape/unbescape | src/main/java/org/unbescape/javascript/JavaScriptEscape.java | JavaScriptEscape.unescapeJavaScript | public static void unescapeJavaScript(final String text, final Writer writer)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (text == null) {
return;
}
if (text.indexOf('... | java | public static void unescapeJavaScript(final String text, final Writer writer)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (text == null) {
return;
}
if (text.indexOf('... | [
"public",
"static",
"void",
"unescapeJavaScript",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument 'writ... | <p>
Perform a JavaScript <strong>unescape</strong> operation on a <tt>String</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
No additional configuration arguments are required. Unescape operations
will always perform <em>complete</em> JavaScript unescape of SECs, x-based, u-based
and octal escapes.
</p>
<p>
... | [
"<p",
">",
"Perform",
"a",
"JavaScript",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
"/",
"tt",
">",
".",
"<",
"/",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/javascript/JavaScriptEscape.java#L992-L1009 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java | AsyncMutateInBuilder.upsert | public <T> AsyncMutateInBuilder upsert(String path, T fragment) {
if (StringUtil.isNullOrEmpty(path)) {
throw new IllegalArgumentException("Path must not be empty for upsert");
}
this.mutationSpecs.add(new MutationSpec(Mutation.DICT_UPSERT, path, fragment));
return this;
... | java | public <T> AsyncMutateInBuilder upsert(String path, T fragment) {
if (StringUtil.isNullOrEmpty(path)) {
throw new IllegalArgumentException("Path must not be empty for upsert");
}
this.mutationSpecs.add(new MutationSpec(Mutation.DICT_UPSERT, path, fragment));
return this;
... | [
"public",
"<",
"T",
">",
"AsyncMutateInBuilder",
"upsert",
"(",
"String",
"path",
",",
"T",
"fragment",
")",
"{",
"if",
"(",
"StringUtil",
".",
"isNullOrEmpty",
"(",
"path",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Path must not be em... | Insert a fragment, replacing the old value if the path exists.
@param path the path where to insert (or replace) a dictionary value.
@param fragment the new dictionary value to be applied. | [
"Insert",
"a",
"fragment",
"replacing",
"the",
"old",
"value",
"if",
"the",
"path",
"exists",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/subdoc/AsyncMutateInBuilder.java#L734-L740 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java | TiledMap.getObjectHeight | public int getObjectHeight(int groupID, int objectID) {
if (groupID >= 0 && groupID < objectGroups.size()) {
ObjectGroup grp = (ObjectGroup) objectGroups.get(groupID);
if (objectID >= 0 && objectID < grp.objects.size()) {
GroupObject object = (GroupObject) grp.objects.get(objectID);
return object.h... | java | public int getObjectHeight(int groupID, int objectID) {
if (groupID >= 0 && groupID < objectGroups.size()) {
ObjectGroup grp = (ObjectGroup) objectGroups.get(groupID);
if (objectID >= 0 && objectID < grp.objects.size()) {
GroupObject object = (GroupObject) grp.objects.get(objectID);
return object.h... | [
"public",
"int",
"getObjectHeight",
"(",
"int",
"groupID",
",",
"int",
"objectID",
")",
"{",
"if",
"(",
"groupID",
">=",
"0",
"&&",
"groupID",
"<",
"objectGroups",
".",
"size",
"(",
")",
")",
"{",
"ObjectGroup",
"grp",
"=",
"(",
"ObjectGroup",
")",
"ob... | Returns the height of a specific object from a specific group.
@param groupID
Index of a group
@param objectID
Index of an object
@return The height of an object, or -1, when error occurred | [
"Returns",
"the",
"height",
"of",
"a",
"specific",
"object",
"from",
"a",
"specific",
"group",
"."
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/tiled/TiledMap.java#L906-L915 |
BlueBrain/bluima | modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java | diff_match_patch.match_bitapScore | @SuppressWarnings("unused")
private static double match_bitapScore(int e, int x, int loc, String pattern) {
float accuracy = (float) e / pattern.length();
int proximity = Math.abs(loc - x);
if (Match_Distance == 0) {
// Dodge divide by zero error.
return proximity == ... | java | @SuppressWarnings("unused")
private static double match_bitapScore(int e, int x, int loc, String pattern) {
float accuracy = (float) e / pattern.length();
int proximity = Math.abs(loc - x);
if (Match_Distance == 0) {
// Dodge divide by zero error.
return proximity == ... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"static",
"double",
"match_bitapScore",
"(",
"int",
"e",
",",
"int",
"x",
",",
"int",
"loc",
",",
"String",
"pattern",
")",
"{",
"float",
"accuracy",
"=",
"(",
"float",
")",
"e",
"/",
"pattern",... | Compute and return the score for a match with e errors and x location.
@param e
Number of errors in match.
@param x
Location of match.
@param loc
Expected location of match.
@param pattern
Pattern being sought.
@return Overall score for match (0.0 = good, 1.0 = bad). | [
"Compute",
"and",
"return",
"the",
"score",
"for",
"a",
"match",
"with",
"e",
"errors",
"and",
"x",
"location",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java#L1832-L1841 |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java | IOUtils.writeGzipObjectToStream | public static void writeGzipObjectToStream(final Object o, OutputStream out) {
out = new BufferedOutputStream(out);
try {
out = new GZIPOutputStream(out, true);
final ObjectOutputStream oos = new ObjectOutputStream(out);
oos.writeObject(o);
oos.flush();
} catch (final IOException e) ... | java | public static void writeGzipObjectToStream(final Object o, OutputStream out) {
out = new BufferedOutputStream(out);
try {
out = new GZIPOutputStream(out, true);
final ObjectOutputStream oos = new ObjectOutputStream(out);
oos.writeObject(o);
oos.flush();
} catch (final IOException e) ... | [
"public",
"static",
"void",
"writeGzipObjectToStream",
"(",
"final",
"Object",
"o",
",",
"OutputStream",
"out",
")",
"{",
"out",
"=",
"new",
"BufferedOutputStream",
"(",
"out",
")",
";",
"try",
"{",
"out",
"=",
"new",
"GZIPOutputStream",
"(",
"out",
",",
"... | Serialized gzipped java object to an ObjectOutputStream. The stream remains
open.
@param o
the java object
@param out
the output stream | [
"Serialized",
"gzipped",
"java",
"object",
"to",
"an",
"ObjectOutputStream",
".",
"The",
"stream",
"remains",
"open",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java#L330-L340 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java | TmdbTV.getTVImages | public ResultList<Artwork> getTVImages(int tvID, String language, String... includeImageLanguage) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, tvID);
parameters.add(Param.LANGUAGE, language);
parameters.add(Param.INCLUDE_IMAGE_LANGU... | java | public ResultList<Artwork> getTVImages(int tvID, String language, String... includeImageLanguage) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, tvID);
parameters.add(Param.LANGUAGE, language);
parameters.add(Param.INCLUDE_IMAGE_LANGU... | [
"public",
"ResultList",
"<",
"Artwork",
">",
"getTVImages",
"(",
"int",
"tvID",
",",
"String",
"language",
",",
"String",
"...",
"includeImageLanguage",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",... | Get the images (posters and backdrops) for a TV series.
@param tvID
@param language
@param includeImageLanguage
@return
@throws com.omertron.themoviedbapi.MovieDbException | [
"Get",
"the",
"images",
"(",
"posters",
"and",
"backdrops",
")",
"for",
"a",
"TV",
"series",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java#L222-L239 |
cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/BeamToCDK.java | BeamToCDK.toCDKAtom | IAtom toCDKAtom(Atom beamAtom, int hCount) {
IAtom cdkAtom = newCDKAtom(beamAtom);
cdkAtom.setImplicitHydrogenCount(hCount);
cdkAtom.setFormalCharge(beamAtom.charge());
if (beamAtom.isotope() >= 0) cdkAtom.setMassNumber(beamAtom.isotope());
if (beamAtom.aromatic()) cdkAtom.se... | java | IAtom toCDKAtom(Atom beamAtom, int hCount) {
IAtom cdkAtom = newCDKAtom(beamAtom);
cdkAtom.setImplicitHydrogenCount(hCount);
cdkAtom.setFormalCharge(beamAtom.charge());
if (beamAtom.isotope() >= 0) cdkAtom.setMassNumber(beamAtom.isotope());
if (beamAtom.aromatic()) cdkAtom.se... | [
"IAtom",
"toCDKAtom",
"(",
"Atom",
"beamAtom",
",",
"int",
"hCount",
")",
"{",
"IAtom",
"cdkAtom",
"=",
"newCDKAtom",
"(",
"beamAtom",
")",
";",
"cdkAtom",
".",
"setImplicitHydrogenCount",
"(",
"hCount",
")",
";",
"cdkAtom",
".",
"setFormalCharge",
"(",
"bea... | Create a new CDK {@link IAtom} from the Beam Atom.
@param beamAtom an Atom from the Beam ChemicalGraph
@param hCount hydrogen count for the atom
@return the CDK atom to have it's properties set | [
"Create",
"a",
"new",
"CDK",
"{",
"@link",
"IAtom",
"}",
"from",
"the",
"Beam",
"Atom",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/BeamToCDK.java#L603-L617 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/CollectionUtils.java | CollectionUtils.sampleWithoutReplacement | public static <E> Collection<E> sampleWithoutReplacement(Collection<E> c, int n, Random r) {
if (n < 0)
throw new IllegalArgumentException("n < 0: " + n);
if (n > c.size())
throw new IllegalArgumentException("n > size of collection: " + n + ", " + c.size());
List<E> copy = new ArrayList<E>(... | java | public static <E> Collection<E> sampleWithoutReplacement(Collection<E> c, int n, Random r) {
if (n < 0)
throw new IllegalArgumentException("n < 0: " + n);
if (n > c.size())
throw new IllegalArgumentException("n > size of collection: " + n + ", " + c.size());
List<E> copy = new ArrayList<E>(... | [
"public",
"static",
"<",
"E",
">",
"Collection",
"<",
"E",
">",
"sampleWithoutReplacement",
"(",
"Collection",
"<",
"E",
">",
"c",
",",
"int",
"n",
",",
"Random",
"r",
")",
"{",
"if",
"(",
"n",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",... | Samples without replacement from a collection, using your own
{@link Random} number generator.
@param c
The collection to be sampled from
@param n
The number of samples to take
@param r
the random number generator
@return a new collection with the sample | [
"Samples",
"without",
"replacement",
"from",
"a",
"collection",
"using",
"your",
"own",
"{",
"@link",
"Random",
"}",
"number",
"generator",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/CollectionUtils.java#L347-L361 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.attachVolume | public AttachVolumeResponse attachVolume(AttachVolumeRequest request) {
checkNotNull(request, "request should not be null.");
checkStringNotEmpty(request.getVolumeId(), "request volumeId should not be empty.");
checkStringNotEmpty(request.getInstanceId(), "request instanceId should not be empty.... | java | public AttachVolumeResponse attachVolume(AttachVolumeRequest request) {
checkNotNull(request, "request should not be null.");
checkStringNotEmpty(request.getVolumeId(), "request volumeId should not be empty.");
checkStringNotEmpty(request.getInstanceId(), "request instanceId should not be empty.... | [
"public",
"AttachVolumeResponse",
"attachVolume",
"(",
"AttachVolumeRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getVolumeId",
"(",
")",
",",
"\"request volu... | Attaching the specified volume to a specified instance.
You can attach the specified volume to a specified instance only
when the volume is Available and the instance is Running or Stopped ,
otherwise,it's will get <code>409</code> errorCode.
@param request The request containing all options for attaching the specifi... | [
"Attaching",
"the",
"specified",
"volume",
"to",
"a",
"specified",
"instance",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L977-L986 |
to2mbn/JMCCC | jmccc-yggdrasil-authenticator/src/main/java/org/to2mbn/jmccc/auth/yggdrasil/YggdrasilAuthenticator.java | YggdrasilAuthenticator.refreshWithPassword | public synchronized void refreshWithPassword(String username, String password, CharacterSelector characterSelector) throws AuthenticationException {
refreshWithPassword(createPasswordProvider(username, password, characterSelector));
} | java | public synchronized void refreshWithPassword(String username, String password, CharacterSelector characterSelector) throws AuthenticationException {
refreshWithPassword(createPasswordProvider(username, password, characterSelector));
} | [
"public",
"synchronized",
"void",
"refreshWithPassword",
"(",
"String",
"username",
",",
"String",
"password",
",",
"CharacterSelector",
"characterSelector",
")",
"throws",
"AuthenticationException",
"{",
"refreshWithPassword",
"(",
"createPasswordProvider",
"(",
"username"... | Refreshes the current session manually using password.
@param username the username
@param password the password
@param characterSelector the character selector
@throws AuthenticationException If an exception occurs during the
authentication | [
"Refreshes",
"the",
"current",
"session",
"manually",
"using",
"password",
"."
] | train | https://github.com/to2mbn/JMCCC/blob/17e5b1b56ff18255cfd60976dca1a24598946647/jmccc-yggdrasil-authenticator/src/main/java/org/to2mbn/jmccc/auth/yggdrasil/YggdrasilAuthenticator.java#L339-L341 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.objLongConsumer | public static <T> ObjLongConsumer<T> objLongConsumer(CheckedObjLongConsumer<T> consumer) {
return objLongConsumer(consumer, THROWABLE_TO_RUNTIME_EXCEPTION);
} | java | public static <T> ObjLongConsumer<T> objLongConsumer(CheckedObjLongConsumer<T> consumer) {
return objLongConsumer(consumer, THROWABLE_TO_RUNTIME_EXCEPTION);
} | [
"public",
"static",
"<",
"T",
">",
"ObjLongConsumer",
"<",
"T",
">",
"objLongConsumer",
"(",
"CheckedObjLongConsumer",
"<",
"T",
">",
"consumer",
")",
"{",
"return",
"objLongConsumer",
"(",
"consumer",
",",
"THROWABLE_TO_RUNTIME_EXCEPTION",
")",
";",
"}"
] | Wrap a {@link CheckedObjLongConsumer} in a {@link ObjLongConsumer}. | [
"Wrap",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L269-L271 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/common/abstracts/featureselectors/AbstractScoreBasedFeatureSelector.java | AbstractScoreBasedFeatureSelector.keepTopFeatures | protected void keepTopFeatures(Map<Object, Double> featureScores, int maxFeatures) {
logger.debug("keepTopFeatures()");
logger.debug("Estimating the minPermittedScore");
Double minPermittedScore = SelectKth.largest(featureScores.values().iterator(), maxFeatures);
//remove any entry wit... | java | protected void keepTopFeatures(Map<Object, Double> featureScores, int maxFeatures) {
logger.debug("keepTopFeatures()");
logger.debug("Estimating the minPermittedScore");
Double minPermittedScore = SelectKth.largest(featureScores.values().iterator(), maxFeatures);
//remove any entry wit... | [
"protected",
"void",
"keepTopFeatures",
"(",
"Map",
"<",
"Object",
",",
"Double",
">",
"featureScores",
",",
"int",
"maxFeatures",
")",
"{",
"logger",
".",
"debug",
"(",
"\"keepTopFeatures()\"",
")",
";",
"logger",
".",
"debug",
"(",
"\"Estimating the minPermitt... | This method keeps the highest scoring features of the provided feature map
and removes all the others.
@param featureScores
@param maxFeatures | [
"This",
"method",
"keeps",
"the",
"highest",
"scoring",
"features",
"of",
"the",
"provided",
"feature",
"map",
"and",
"removes",
"all",
"the",
"others",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/common/abstracts/featureselectors/AbstractScoreBasedFeatureSelector.java#L176-L205 |
jenkinsci/jenkins | core/src/main/java/hudson/Util.java | Util.loadFile | @Nonnull
@Deprecated
public static String loadFile(@Nonnull File logfile) throws IOException {
return loadFile(logfile, Charset.defaultCharset());
} | java | @Nonnull
@Deprecated
public static String loadFile(@Nonnull File logfile) throws IOException {
return loadFile(logfile, Charset.defaultCharset());
} | [
"@",
"Nonnull",
"@",
"Deprecated",
"public",
"static",
"String",
"loadFile",
"(",
"@",
"Nonnull",
"File",
"logfile",
")",
"throws",
"IOException",
"{",
"return",
"loadFile",
"(",
"logfile",
",",
"Charset",
".",
"defaultCharset",
"(",
")",
")",
";",
"}"
] | Reads the entire contents of the text file at <code>logfile</code> into a
string using the {@link Charset#defaultCharset() default charset} for
decoding. If no such file exists, an empty string is returned.
@param logfile The text file to read in its entirety.
@return The entire text content of <code>logfile</code>.
@t... | [
"Reads",
"the",
"entire",
"contents",
"of",
"the",
"text",
"file",
"at",
"<code",
">",
"logfile<",
"/",
"code",
">",
"into",
"a",
"string",
"using",
"the",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Util.java#L198-L202 |
sarxos/win-registry | src/main/java/com/github/sarxos/winreg/WindowsRegistry.java | WindowsRegistry.readStringValues | public Map<String, String> readStringValues(HKey hk, String key, String charsetName) throws RegistryException {
try {
return ReflectedMethods.readStringValues(hk.root(), hk.hex(), key, charsetName);
} catch (Exception e) {
throw new RegistryException("Cannot read values from key " + key, e);
}
} | java | public Map<String, String> readStringValues(HKey hk, String key, String charsetName) throws RegistryException {
try {
return ReflectedMethods.readStringValues(hk.root(), hk.hex(), key, charsetName);
} catch (Exception e) {
throw new RegistryException("Cannot read values from key " + key, e);
}
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"readStringValues",
"(",
"HKey",
"hk",
",",
"String",
"key",
",",
"String",
"charsetName",
")",
"throws",
"RegistryException",
"{",
"try",
"{",
"return",
"ReflectedMethods",
".",
"readStringValues",
"(",
"hk"... | Read value(s) and value name(s) form given key
@param hk the HKEY
@param key the key
@param charsetName which charset to use
@return the value name(s) plus the value(s)
@throws RegistryException when something is not right | [
"Read",
"value",
"(",
"s",
")",
"and",
"value",
"name",
"(",
"s",
")",
"form",
"given",
"key"
] | train | https://github.com/sarxos/win-registry/blob/5ccbe2157ae0ee894de7c41bec4bd7b1e0f5c437/src/main/java/com/github/sarxos/winreg/WindowsRegistry.java#L88-L94 |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/energybalance/OmsEnergyBalance.java | OmsEnergyBalance.dpVap | private double dpVap( double T, double P ) {
double A = 6.1121 * (1.0007 + 3.46E-6 * P);
double b = 17.502;
double c = 240.97;
double De = (A * exp(b * T / (c + T))) * (b / (c + T) - b * T / pow(c + T, 2.0));
return De;
} | java | private double dpVap( double T, double P ) {
double A = 6.1121 * (1.0007 + 3.46E-6 * P);
double b = 17.502;
double c = 240.97;
double De = (A * exp(b * T / (c + T))) * (b / (c + T) - b * T / pow(c + T, 2.0));
return De;
} | [
"private",
"double",
"dpVap",
"(",
"double",
"T",
",",
"double",
"P",
")",
"{",
"double",
"A",
"=",
"6.1121",
"*",
"(",
"1.0007",
"+",
"3.46E-6",
"*",
"P",
")",
";",
"double",
"b",
"=",
"17.502",
";",
"double",
"c",
"=",
"240.97",
";",
"double",
... | Calcola la derivata della pressione di vapore [mbar] a saturazione
rispetto dalla temperatura [gradi Celsius].
@param T
@param P
@return derivata della pressione di vapore. | [
"Calcola",
"la",
"derivata",
"della",
"pressione",
"di",
"vapore",
"[",
"mbar",
"]",
"a",
"saturazione",
"rispetto",
"dalla",
"temperatura",
"[",
"gradi",
"Celsius",
"]",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/energybalance/OmsEnergyBalance.java#L1270-L1277 |
kmi/iserve | iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/util/caching/impl/RedisCache.java | RedisCache.putIfAbsent | @Override
public V putIfAbsent(K key, V value) {
return rMap.putIfAbsent(key, value);
} | java | @Override
public V putIfAbsent(K key, V value) {
return rMap.putIfAbsent(key, value);
} | [
"@",
"Override",
"public",
"V",
"putIfAbsent",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"return",
"rMap",
".",
"putIfAbsent",
"(",
"key",
",",
"value",
")",
";",
"}"
] | If the specified key is not already associated
with a value, associate it with the given value.
This is equivalent to
<pre>
if (!map.containsKey(key))
return map.put(key, value);
else
return map.get(key);</pre>
except that the action is performed atomically.
@param key key with which the specified value is to be assoc... | [
"If",
"the",
"specified",
"key",
"is",
"not",
"already",
"associated",
"with",
"a",
"value",
"associate",
"it",
"with",
"the",
"given",
"value",
".",
"This",
"is",
"equivalent",
"to",
"<pre",
">",
"if",
"(",
"!map",
".",
"containsKey",
"(",
"key",
"))",
... | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/util/caching/impl/RedisCache.java#L374-L377 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java | StructureDiagramGenerator.newCrossingBracket | private SgroupBracket newCrossingBracket(IBond bond, Multimap<IBond,Sgroup> bonds, Map<IBond,Integer> counter, boolean vert) {
final IAtom beg = bond.getBegin();
final IAtom end = bond.getEnd();
final Point2d begXy = beg.getPoint2d();
final Point2d endXy = end.getPoint2d();
final... | java | private SgroupBracket newCrossingBracket(IBond bond, Multimap<IBond,Sgroup> bonds, Map<IBond,Integer> counter, boolean vert) {
final IAtom beg = bond.getBegin();
final IAtom end = bond.getEnd();
final Point2d begXy = beg.getPoint2d();
final Point2d endXy = end.getPoint2d();
final... | [
"private",
"SgroupBracket",
"newCrossingBracket",
"(",
"IBond",
"bond",
",",
"Multimap",
"<",
"IBond",
",",
"Sgroup",
">",
"bonds",
",",
"Map",
"<",
"IBond",
",",
"Integer",
">",
"counter",
",",
"boolean",
"vert",
")",
"{",
"final",
"IAtom",
"beg",
"=",
... | Generate a new bracket across the provided bond.
@param bond bond
@param bonds bond map to Sgroups
@param counter count how many brackets this group has already
@param vert vertical align bonds
@return the new bracket | [
"Generate",
"a",
"new",
"bracket",
"across",
"the",
"provided",
"bond",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/StructureDiagramGenerator.java#L2676-L2718 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/autoupdate/AddOnWrapper.java | AddOnWrapper.setRunningIssues | public void setRunningIssues(String runningIssues, boolean addOnIssues) {
Validate.notNull(runningIssues, "Parameter runningIssues must not be null.");
this.runningIssues = runningIssues;
this.addOnRunningIssues = addOnIssues;
} | java | public void setRunningIssues(String runningIssues, boolean addOnIssues) {
Validate.notNull(runningIssues, "Parameter runningIssues must not be null.");
this.runningIssues = runningIssues;
this.addOnRunningIssues = addOnIssues;
} | [
"public",
"void",
"setRunningIssues",
"(",
"String",
"runningIssues",
",",
"boolean",
"addOnIssues",
")",
"{",
"Validate",
".",
"notNull",
"(",
"runningIssues",
",",
"\"Parameter runningIssues must not be null.\"",
")",
";",
"this",
".",
"runningIssues",
"=",
"running... | Sets the issues that the wrapped add-on or its extensions might have that prevent them from being run.
<p>
The contents should be in HTML.
@param runningIssues the running issues of the add-on or its extensions, empty if there's no issues.
@param addOnIssues {@code true} if the issues are caused by the add-on, {@code ... | [
"Sets",
"the",
"issues",
"that",
"the",
"wrapped",
"add",
"-",
"on",
"or",
"its",
"extensions",
"might",
"have",
"that",
"prevent",
"them",
"from",
"being",
"run",
".",
"<p",
">",
"The",
"contents",
"should",
"be",
"in",
"HTML",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/autoupdate/AddOnWrapper.java#L216-L221 |
b3dgs/lionengine | lionengine-audio-wav/src/main/java/com/b3dgs/lionengine/audio/wav/WavImpl.java | WavImpl.createPlayback | private static Playback createPlayback(Media media, Align alignment, int volume) throws IOException
{
final AudioInputStream input = openStream(media);
final SourceDataLine dataLine = getDataLine(input);
dataLine.start();
updateAlignment(dataLine, alignment);
updateVolume(dat... | java | private static Playback createPlayback(Media media, Align alignment, int volume) throws IOException
{
final AudioInputStream input = openStream(media);
final SourceDataLine dataLine = getDataLine(input);
dataLine.start();
updateAlignment(dataLine, alignment);
updateVolume(dat... | [
"private",
"static",
"Playback",
"createPlayback",
"(",
"Media",
"media",
",",
"Align",
"alignment",
",",
"int",
"volume",
")",
"throws",
"IOException",
"{",
"final",
"AudioInputStream",
"input",
"=",
"openStream",
"(",
"media",
")",
";",
"final",
"SourceDataLin... | Play a sound.
@param media The audio media.
@param alignment The alignment type.
@param volume The audio volume value.
@return The created and opened playback ready to be played.
@throws IOException If playback error. | [
"Play",
"a",
"sound",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-audio-wav/src/main/java/com/b3dgs/lionengine/audio/wav/WavImpl.java#L62-L71 |
DigitalPebble/TextClassification | src/main/java/com/digitalpebble/classification/util/scorers/logLikelihoodAttributeScorer.java | logLikelihoodAttributeScorer.getValueForRank | public static double getValueForRank(int rank,double[] scores){
double[] copy = new double[scores.length];
System.arraycopy(scores,0,copy,0,scores.length);
java.util.Arrays.sort(copy);
rank = scores.length-rank;
return copy[rank];
} | java | public static double getValueForRank(int rank,double[] scores){
double[] copy = new double[scores.length];
System.arraycopy(scores,0,copy,0,scores.length);
java.util.Arrays.sort(copy);
rank = scores.length-rank;
return copy[rank];
} | [
"public",
"static",
"double",
"getValueForRank",
"(",
"int",
"rank",
",",
"double",
"[",
"]",
"scores",
")",
"{",
"double",
"[",
"]",
"copy",
"=",
"new",
"double",
"[",
"scores",
".",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"scores",
",",
... | Returns the value of the nth score once sorted
Used to determine whether or not to keep an attribute
* | [
"Returns",
"the",
"value",
"of",
"the",
"nth",
"score",
"once",
"sorted",
"Used",
"to",
"determine",
"whether",
"or",
"not",
"to",
"keep",
"an",
"attribute",
"*"
] | train | https://github.com/DigitalPebble/TextClassification/blob/c510719c31633841af2bf393a20707d4624f865d/src/main/java/com/digitalpebble/classification/util/scorers/logLikelihoodAttributeScorer.java#L129-L135 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Transaction.java | Transaction.hashForWitnessSignature | public synchronized Sha256Hash hashForWitnessSignature(
int inputIndex,
Script scriptCode,
Coin prevValue,
SigHash type,
boolean anyoneCanPay) {
return hashForWitnessSignature(inputIndex, scriptCode.getProgram(), prevValue, type, anyoneCanPay);
} | java | public synchronized Sha256Hash hashForWitnessSignature(
int inputIndex,
Script scriptCode,
Coin prevValue,
SigHash type,
boolean anyoneCanPay) {
return hashForWitnessSignature(inputIndex, scriptCode.getProgram(), prevValue, type, anyoneCanPay);
} | [
"public",
"synchronized",
"Sha256Hash",
"hashForWitnessSignature",
"(",
"int",
"inputIndex",
",",
"Script",
"scriptCode",
",",
"Coin",
"prevValue",
",",
"SigHash",
"type",
",",
"boolean",
"anyoneCanPay",
")",
"{",
"return",
"hashForWitnessSignature",
"(",
"inputIndex"... | <p>Calculates a signature hash, that is, a hash of a simplified form of the transaction. How exactly the transaction
is simplified is specified by the type and anyoneCanPay parameters.</p>
<p>This is a low level API and when using the regular {@link Wallet} class you don't have to call this yourself.
When working with... | [
"<p",
">",
"Calculates",
"a",
"signature",
"hash",
"that",
"is",
"a",
"hash",
"of",
"a",
"simplified",
"form",
"of",
"the",
"transaction",
".",
"How",
"exactly",
"the",
"transaction",
"is",
"simplified",
"is",
"specified",
"by",
"the",
"type",
"and",
"anyo... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Transaction.java#L1345-L1352 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/scripting/ScriptingUtils.java | ScriptingUtils.executeGroovyShellScript | public static <T> T executeGroovyShellScript(final String script,
final Map<String, Object> variables,
final Class<T> clazz) {
try {
val binding = new Binding();
val shell = new GroovyShell(... | java | public static <T> T executeGroovyShellScript(final String script,
final Map<String, Object> variables,
final Class<T> clazz) {
try {
val binding = new Binding();
val shell = new GroovyShell(... | [
"public",
"static",
"<",
"T",
">",
"T",
"executeGroovyShellScript",
"(",
"final",
"String",
"script",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"variables",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"try",
"{",
"val",
"bind... | Execute groovy shell script t.
@param <T> the type parameter
@param script the script
@param variables the variables
@param clazz the clazz
@return the t | [
"Execute",
"groovy",
"shell",
"script",
"t",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/scripting/ScriptingUtils.java#L103-L123 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.filemonitor/src/com/ibm/ws/kernel/filemonitor/internal/MonitorHolder.java | MonitorHolder.scanForUpdates | private void scanForUpdates(Collection<File> created, Collection<File> deleted, Collection<File> modified) {
for (UpdateMonitor m : updateMonitors.keySet()) {
try {
m.scanForUpdates(created, modified, deleted);
} catch (RuntimeException e) {
// Don't let o... | java | private void scanForUpdates(Collection<File> created, Collection<File> deleted, Collection<File> modified) {
for (UpdateMonitor m : updateMonitors.keySet()) {
try {
m.scanForUpdates(created, modified, deleted);
} catch (RuntimeException e) {
// Don't let o... | [
"private",
"void",
"scanForUpdates",
"(",
"Collection",
"<",
"File",
">",
"created",
",",
"Collection",
"<",
"File",
">",
"deleted",
",",
"Collection",
"<",
"File",
">",
"modified",
")",
"{",
"for",
"(",
"UpdateMonitor",
"m",
":",
"updateMonitors",
".",
"k... | Find changes to monitored resources.
Not thread safe: please ensure you're calling this only from
one thread (i.e. within the scanLock)
@param created the list to which created files will be added
@param deleted the list to which deleted files will be added
@param modified the list to which modified files will be adde... | [
"Find",
"changes",
"to",
"monitored",
"resources",
".",
"Not",
"thread",
"safe",
":",
"please",
"ensure",
"you",
"re",
"calling",
"this",
"only",
"from",
"one",
"thread",
"(",
"i",
".",
"e",
".",
"within",
"the",
"scanLock",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.filemonitor/src/com/ibm/ws/kernel/filemonitor/internal/MonitorHolder.java#L1091-L1100 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/CheckedExceptionsFactory.java | CheckedExceptionsFactory.newCloneNotSupportedException | public static CloneNotSupportedException newCloneNotSupportedException(Throwable cause,
String message, Object... args) {
return (CloneNotSupportedException) new CloneNotSupportedException(format(message, args)).initCause(cause);
} | java | public static CloneNotSupportedException newCloneNotSupportedException(Throwable cause,
String message, Object... args) {
return (CloneNotSupportedException) new CloneNotSupportedException(format(message, args)).initCause(cause);
} | [
"public",
"static",
"CloneNotSupportedException",
"newCloneNotSupportedException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"(",
"CloneNotSupportedException",
")",
"new",
"CloneNotSupportedException",
"(",
"f... | Constructs and initializes a new {@link CloneNotSupportedException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link CloneNotSupportedException} was thrown.
@param message {@link St... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"CloneNotSupportedException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/CheckedExceptionsFactory.java#L59-L63 |
btrplace/scheduler | btrpsl/src/main/java/org/btrplace/btrpsl/constraint/SplitBuilder.java | SplitBuilder.buildConstraint | @Override
public List<? extends SatConstraint> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) {
if (checkConformance(t, args)) {
@SuppressWarnings("unchecked") Collection<Collection<VM>> s = (Collection<Collection<VM>>) params[0].transform(this, t, args.get(0));
return s != ... | java | @Override
public List<? extends SatConstraint> buildConstraint(BtrPlaceTree t, List<BtrpOperand> args) {
if (checkConformance(t, args)) {
@SuppressWarnings("unchecked") Collection<Collection<VM>> s = (Collection<Collection<VM>>) params[0].transform(this, t, args.get(0));
return s != ... | [
"@",
"Override",
"public",
"List",
"<",
"?",
"extends",
"SatConstraint",
">",
"buildConstraint",
"(",
"BtrPlaceTree",
"t",
",",
"List",
"<",
"BtrpOperand",
">",
"args",
")",
"{",
"if",
"(",
"checkConformance",
"(",
"t",
",",
"args",
")",
")",
"{",
"@",
... | Build a constraint.
@param args the parameters of the constraint. Must be 2 non-empty set of virtual machines.
@return the constraint | [
"Build",
"a",
"constraint",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/constraint/SplitBuilder.java#L51-L58 |
google/closure-compiler | src/com/google/javascript/jscomp/Es6ConvertSuperConstructorCalls.java | Es6ConvertSuperConstructorCalls.isUnextendableNativeClass | private boolean isUnextendableNativeClass(NodeTraversal t, String className) {
// This list originally taken from the list of built-in objects at
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
// as of 2016-10-22.
// - Intl.* classes were left out, because it doesn't seem worth the... | java | private boolean isUnextendableNativeClass(NodeTraversal t, String className) {
// This list originally taken from the list of built-in objects at
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
// as of 2016-10-22.
// - Intl.* classes were left out, because it doesn't seem worth the... | [
"private",
"boolean",
"isUnextendableNativeClass",
"(",
"NodeTraversal",
"t",
",",
"String",
"className",
")",
"{",
"// This list originally taken from the list of built-in objects at",
"// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference",
"// as of 2016-10-22.",
"// - ... | Is the given class a native class for which we cannot properly transpile extension?
@param t
@param className | [
"Is",
"the",
"given",
"class",
"a",
"native",
"class",
"for",
"which",
"we",
"cannot",
"properly",
"transpile",
"extension?"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Es6ConvertSuperConstructorCalls.java#L434-L474 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/utils/TempUtils.java | TempUtils.copyIntoTempFile | public static File copyIntoTempFile(String fileName, InputStream inputStream)
throws IOException {
BufferedInputStream bufferedStream = inputStream instanceof BufferedInputStream ? (BufferedInputStream) inputStream
: new BufferedInputStream(inputStream);
File destFile = null;
try {
destF... | java | public static File copyIntoTempFile(String fileName, InputStream inputStream)
throws IOException {
BufferedInputStream bufferedStream = inputStream instanceof BufferedInputStream ? (BufferedInputStream) inputStream
: new BufferedInputStream(inputStream);
File destFile = null;
try {
destF... | [
"public",
"static",
"File",
"copyIntoTempFile",
"(",
"String",
"fileName",
",",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"BufferedInputStream",
"bufferedStream",
"=",
"inputStream",
"instanceof",
"BufferedInputStream",
"?",
"(",
"BufferedInputStrea... | Copies <code>inputStream</code> into a temporary file <code>fileName</code>.
@param fileName file name
@param inputStream stream to copy from
@return temporary file
@throws IOException if an IO error occurs | [
"Copies",
"<code",
">",
"inputStream<",
"/",
"code",
">",
"into",
"a",
"temporary",
"file",
"<code",
">",
"fileName<",
"/",
"code",
">",
"."
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/utils/TempUtils.java#L64-L90 |
betfair/cougar | cougar-framework/cougar-client/src/main/java/com/betfair/cougar/client/socket/IoSessionFactory.java | IoSessionFactory.closeSession | public void closeSession(SocketAddress endpoint, boolean reconnect) {
synchronized (lock) {
// Submit a reconnect task for this address if one is not already present
if (pendingConnections.containsKey(endpoint)) {
final ReconnectTask task = pendingConnections.get(endpoint... | java | public void closeSession(SocketAddress endpoint, boolean reconnect) {
synchronized (lock) {
// Submit a reconnect task for this address if one is not already present
if (pendingConnections.containsKey(endpoint)) {
final ReconnectTask task = pendingConnections.get(endpoint... | [
"public",
"void",
"closeSession",
"(",
"SocketAddress",
"endpoint",
",",
"boolean",
"reconnect",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"// Submit a reconnect task for this address if one is not already present",
"if",
"(",
"pendingConnections",
".",
"containsKey"... | If there is an active session to the specified endpoint, it will be closed
If not the reconnection task for the endpoint will be stopped
@param endpoint
@param reconnect whether to reconnect after closing the current session.
Only used if the session is active | [
"If",
"there",
"is",
"an",
"active",
"session",
"to",
"the",
"specified",
"endpoint",
"it",
"will",
"be",
"closed",
"If",
"not",
"the",
"reconnection",
"task",
"for",
"the",
"endpoint",
"will",
"be",
"stopped"
] | train | https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-framework/cougar-client/src/main/java/com/betfair/cougar/client/socket/IoSessionFactory.java#L202-L217 |
infinispan/infinispan | core/src/main/java/org/infinispan/io/GridFilesystem.java | GridFilesystem.getOutput | public OutputStream getOutput(String pathname, boolean append) throws IOException {
return getOutput(pathname, append, defaultChunkSize);
} | java | public OutputStream getOutput(String pathname, boolean append) throws IOException {
return getOutput(pathname, append, defaultChunkSize);
} | [
"public",
"OutputStream",
"getOutput",
"(",
"String",
"pathname",
",",
"boolean",
"append",
")",
"throws",
"IOException",
"{",
"return",
"getOutput",
"(",
"pathname",
",",
"append",
",",
"defaultChunkSize",
")",
";",
"}"
] | Opens an OutputStream for writing to the file denoted by pathname. The OutputStream can either overwrite the
existing file or append to it.
@param pathname the path to write to
@param append if true, the bytes written to the OutputStream will be appended to the end of the file. If false,
the bytes will overwrite the or... | [
"Opens",
"an",
"OutputStream",
"for",
"writing",
"to",
"the",
"file",
"denoted",
"by",
"pathname",
".",
"The",
"OutputStream",
"can",
"either",
"overwrite",
"the",
"existing",
"file",
"or",
"append",
"to",
"it",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/io/GridFilesystem.java#L106-L108 |
alibaba/canal | server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java | CanalServerWithEmbedded.rollback | @Override
public void rollback(ClientIdentity clientIdentity, Long batchId) throws CanalServerException {
checkStart(clientIdentity.getDestination());
CanalInstance canalInstance = canalInstances.get(clientIdentity.getDestination());
// 因为存在第一次链接时自动rollback的情况,所以需要忽略未订阅
boolean hasS... | java | @Override
public void rollback(ClientIdentity clientIdentity, Long batchId) throws CanalServerException {
checkStart(clientIdentity.getDestination());
CanalInstance canalInstance = canalInstances.get(clientIdentity.getDestination());
// 因为存在第一次链接时自动rollback的情况,所以需要忽略未订阅
boolean hasS... | [
"@",
"Override",
"public",
"void",
"rollback",
"(",
"ClientIdentity",
"clientIdentity",
",",
"Long",
"batchId",
")",
"throws",
"CanalServerException",
"{",
"checkStart",
"(",
"clientIdentity",
".",
"getDestination",
"(",
")",
")",
";",
"CanalInstance",
"canalInstanc... | 回滚到未进行 {@link #ack} 的地方,下次fetch的时候,可以从最后一个没有 {@link #ack} 的地方开始拿 | [
"回滚到未进行",
"{"
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java#L464-L494 |
jbundle/jbundle | thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHelpPane.java | JHelpPane.handleAction | public boolean handleAction(String strAction, Component source, int iOptions)
{
if (source == this.getParent())
return false; // Don't handle commands coming from the outside
if (source.getParent() == this)
source = this.getParent(); // This will keep my commands from bein... | java | public boolean handleAction(String strAction, Component source, int iOptions)
{
if (source == this.getParent())
return false; // Don't handle commands coming from the outside
if (source.getParent() == this)
source = this.getParent(); // This will keep my commands from bein... | [
"public",
"boolean",
"handleAction",
"(",
"String",
"strAction",
",",
"Component",
"source",
",",
"int",
"iOptions",
")",
"{",
"if",
"(",
"source",
"==",
"this",
".",
"getParent",
"(",
")",
")",
"return",
"false",
";",
"// Don't handle commands coming from the o... | Do some applet-wide action.
For example, submit or reset.
Here are how actions are handled:
When a BasePanel receives a command it calls it's doAction method. If the doAction
doesn't handle the action, it is passed to the parent's doAction method, until it
hits the (this) applet method. This applet method tries to pass... | [
"Do",
"some",
"applet",
"-",
"wide",
"action",
".",
"For",
"example",
"submit",
"or",
"reset",
".",
"Here",
"are",
"how",
"actions",
"are",
"handled",
":",
"When",
"a",
"BasePanel",
"receives",
"a",
"command",
"it",
"calls",
"it",
"s",
"doAction",
"metho... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHelpPane.java#L106-L113 |
prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/SimpleCollector.java | SimpleCollector.setChild | public <T extends Collector> T setChild(Child child, String... labelValues) {
if (labelValues.length != labelNames.size()) {
throw new IllegalArgumentException("Incorrect number of labels.");
}
children.put(Arrays.asList(labelValues), child);
return (T)this;
} | java | public <T extends Collector> T setChild(Child child, String... labelValues) {
if (labelValues.length != labelNames.size()) {
throw new IllegalArgumentException("Incorrect number of labels.");
}
children.put(Arrays.asList(labelValues), child);
return (T)this;
} | [
"public",
"<",
"T",
"extends",
"Collector",
">",
"T",
"setChild",
"(",
"Child",
"child",
",",
"String",
"...",
"labelValues",
")",
"{",
"if",
"(",
"labelValues",
".",
"length",
"!=",
"labelNames",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"Illeg... | Replace the Child with the given labels.
<p>
This is intended for advanced uses, in particular proxying metrics
from another monitoring system. This allows for callbacks for returning
values for {@link Counter} and {@link Gauge} without having to implement
a full {@link Collector}.
<p>
An example with {@link Gauge}:
<p... | [
"Replace",
"the",
"Child",
"with",
"the",
"given",
"labels",
".",
"<p",
">",
"This",
"is",
"intended",
"for",
"advanced",
"uses",
"in",
"particular",
"proxying",
"metrics",
"from",
"another",
"monitoring",
"system",
".",
"This",
"allows",
"for",
"callbacks",
... | train | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/SimpleCollector.java#L134-L140 |
threerings/playn | robovm/src/playn/robovm/RoboPlatform.java | RoboPlatform.willRotate | void willRotate(UIInterfaceOrientation toOrient, double duration) {
if (orientListener != null) {
orientListener.willRotate(toOrient, duration);
}
} | java | void willRotate(UIInterfaceOrientation toOrient, double duration) {
if (orientListener != null) {
orientListener.willRotate(toOrient, duration);
}
} | [
"void",
"willRotate",
"(",
"UIInterfaceOrientation",
"toOrient",
",",
"double",
"duration",
")",
"{",
"if",
"(",
"orientListener",
"!=",
"null",
")",
"{",
"orientListener",
".",
"willRotate",
"(",
"toOrient",
",",
"duration",
")",
";",
"}",
"}"
] | with iOS for rotation notifications, game loop callbacks, and app lifecycle events | [
"with",
"iOS",
"for",
"rotation",
"notifications",
"game",
"loop",
"callbacks",
"and",
"app",
"lifecycle",
"events"
] | train | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/robovm/src/playn/robovm/RoboPlatform.java#L257-L261 |
zxing/zxing | core/src/main/java/com/google/zxing/oned/UPCEANReader.java | UPCEANReader.checkStandardUPCEANChecksum | static boolean checkStandardUPCEANChecksum(CharSequence s) throws FormatException {
int length = s.length();
if (length == 0) {
return false;
}
int check = Character.digit(s.charAt(length - 1), 10);
return getStandardUPCEANChecksum(s.subSequence(0, length - 1)) == check;
} | java | static boolean checkStandardUPCEANChecksum(CharSequence s) throws FormatException {
int length = s.length();
if (length == 0) {
return false;
}
int check = Character.digit(s.charAt(length - 1), 10);
return getStandardUPCEANChecksum(s.subSequence(0, length - 1)) == check;
} | [
"static",
"boolean",
"checkStandardUPCEANChecksum",
"(",
"CharSequence",
"s",
")",
"throws",
"FormatException",
"{",
"int",
"length",
"=",
"s",
".",
"length",
"(",
")",
";",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"int",
"c... | Computes the UPC/EAN checksum on a string of digits, and reports
whether the checksum is correct or not.
@param s string of digits to check
@return true iff string of digits passes the UPC/EAN checksum algorithm
@throws FormatException if the string does not contain only digits | [
"Computes",
"the",
"UPC",
"/",
"EAN",
"checksum",
"on",
"a",
"string",
"of",
"digits",
"and",
"reports",
"whether",
"the",
"checksum",
"is",
"correct",
"or",
"not",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/oned/UPCEANReader.java#L263-L270 |
opsgenie/opsgenieclient | sdk/src/main/java/com/ifountain/opsgenie/client/rest/RestApiRequest.java | RestApiRequest.convertObject | private <T> T convertObject(byte[] json, Class<T> claz) throws IOException {
TypeReference<RestSuccessResult<Map<?, ?>>> typeReference = new TypeReference<RestSuccessResult<Map<?, ?>>>() {
};
RestSuccessResult<T> successResponse = MAPPER.readValue(json, typeReference);
Map<?, ?> data = (... | java | private <T> T convertObject(byte[] json, Class<T> claz) throws IOException {
TypeReference<RestSuccessResult<Map<?, ?>>> typeReference = new TypeReference<RestSuccessResult<Map<?, ?>>>() {
};
RestSuccessResult<T> successResponse = MAPPER.readValue(json, typeReference);
Map<?, ?> data = (... | [
"private",
"<",
"T",
">",
"T",
"convertObject",
"(",
"byte",
"[",
"]",
"json",
",",
"Class",
"<",
"T",
">",
"claz",
")",
"throws",
"IOException",
"{",
"TypeReference",
"<",
"RestSuccessResult",
"<",
"Map",
"<",
"?",
",",
"?",
">",
">",
">",
"typeRefe... | Map is used for generic deserialization (jackson returns LinkedHashMap by default when
generic type is used) | [
"Map",
"is",
"used",
"for",
"generic",
"deserialization",
"(",
"jackson",
"returns",
"LinkedHashMap",
"by",
"default",
"when",
"generic",
"type",
"is",
"used",
")"
] | train | https://github.com/opsgenie/opsgenieclient/blob/6d94efb16bbc74be189c86e9329af510ac8a048c/sdk/src/main/java/com/ifountain/opsgenie/client/rest/RestApiRequest.java#L207-L213 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java | ParameterizedMessageFactory.newMessage | @Override
public Message newMessage(final String message, final Object... params) {
return new ParameterizedMessage(message, params);
} | java | @Override
public Message newMessage(final String message, final Object... params) {
return new ParameterizedMessage(message, params);
} | [
"@",
"Override",
"public",
"Message",
"newMessage",
"(",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"params",
")",
"{",
"return",
"new",
"ParameterizedMessage",
"(",
"message",
",",
"params",
")",
";",
"}"
] | Creates {@link ParameterizedMessage} instances.
@param message The message pattern.
@param params The message parameters.
@return The Message.
@see MessageFactory#newMessage(String, Object...) | [
"Creates",
"{",
"@link",
"ParameterizedMessage",
"}",
"instances",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessageFactory.java#L61-L64 |
bramp/ffmpeg-cli-wrapper | src/main/java/net/bramp/ffmpeg/builder/FFmpegBuilder.java | FFmpegBuilder.addOutput | public FFmpegOutputBuilder addOutput(String filename) {
FFmpegOutputBuilder output = new FFmpegOutputBuilder(this, filename);
outputs.add(output);
return output;
} | java | public FFmpegOutputBuilder addOutput(String filename) {
FFmpegOutputBuilder output = new FFmpegOutputBuilder(this, filename);
outputs.add(output);
return output;
} | [
"public",
"FFmpegOutputBuilder",
"addOutput",
"(",
"String",
"filename",
")",
"{",
"FFmpegOutputBuilder",
"output",
"=",
"new",
"FFmpegOutputBuilder",
"(",
"this",
",",
"filename",
")",
";",
"outputs",
".",
"add",
"(",
"output",
")",
";",
"return",
"output",
"... | Adds new output file.
@param filename output file path
@return A new {@link FFmpegOutputBuilder} | [
"Adds",
"new",
"output",
"file",
"."
] | train | https://github.com/bramp/ffmpeg-cli-wrapper/blob/3819b155edf9132acc75bb6af66dcef1b98c64b2/src/main/java/net/bramp/ffmpeg/builder/FFmpegBuilder.java#L226-L230 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/PackageInspectorImpl.java | PackageInspectorImpl.listKernelBlackListApiPackages | public Iterator<String> listKernelBlackListApiPackages() {
ProductPackages index = packageIndex;
if (index != null) {
return index.packageIterator(new Filter<PackageInfo>() {
@Override
public boolean includeValue(String packageName, PackageInfo value) {
... | java | public Iterator<String> listKernelBlackListApiPackages() {
ProductPackages index = packageIndex;
if (index != null) {
return index.packageIterator(new Filter<PackageInfo>() {
@Override
public boolean includeValue(String packageName, PackageInfo value) {
... | [
"public",
"Iterator",
"<",
"String",
">",
"listKernelBlackListApiPackages",
"(",
")",
"{",
"ProductPackages",
"index",
"=",
"packageIndex",
";",
"if",
"(",
"index",
"!=",
"null",
")",
"{",
"return",
"index",
".",
"packageIterator",
"(",
"new",
"Filter",
"<",
... | This iterator will walk the package index, returning only packages that indicate
they are API packages and are included both by the kernel (core)feature and
another enabled liberty feature or features.
@see com.ibm.ws.kernel.provisioning.packages.SharedPackageInspector#listKernelApiPackages() | [
"This",
"iterator",
"will",
"walk",
"the",
"package",
"index",
"returning",
"only",
"packages",
"that",
"indicate",
"they",
"are",
"API",
"packages",
"and",
"are",
"included",
"both",
"by",
"the",
"kernel",
"(",
"core",
")",
"feature",
"and",
"another",
"ena... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/PackageInspectorImpl.java#L475-L487 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbEpisodes.java | TmdbEpisodes.getEpisodeAccountState | public MediaState getEpisodeAccountState(int tvID, int seasonNumber, int episodeNumber, String sessionID) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, tvID);
parameters.add(Param.SESSION_ID, sessionID);
parameters.add(Param.SEASON_N... | java | public MediaState getEpisodeAccountState(int tvID, int seasonNumber, int episodeNumber, String sessionID) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, tvID);
parameters.add(Param.SESSION_ID, sessionID);
parameters.add(Param.SEASON_N... | [
"public",
"MediaState",
"getEpisodeAccountState",
"(",
"int",
"tvID",
",",
"int",
"seasonNumber",
",",
"int",
"episodeNumber",
",",
"String",
"sessionID",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",... | This method lets users get the status of whether or not the TV episode
has been rated.
A valid session id is required.
@param tvID
@param seasonNumber
@param episodeNumber
@param sessionID
@return
@throws MovieDbException | [
"This",
"method",
"lets",
"users",
"get",
"the",
"status",
"of",
"whether",
"or",
"not",
"the",
"TV",
"episode",
"has",
"been",
"rated",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbEpisodes.java#L122-L137 |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java | MBTilesDb.getBounds | public Envelope getBounds() throws Exception {
checkMetadata();
String boundsWSEN = metadataMap.get("bounds");
String[] split = boundsWSEN.split(",");
double w = Double.parseDouble(split[0]);
double s = Double.parseDouble(split[1]);
double e = Double.parseDouble(split[2])... | java | public Envelope getBounds() throws Exception {
checkMetadata();
String boundsWSEN = metadataMap.get("bounds");
String[] split = boundsWSEN.split(",");
double w = Double.parseDouble(split[0]);
double s = Double.parseDouble(split[1]);
double e = Double.parseDouble(split[2])... | [
"public",
"Envelope",
"getBounds",
"(",
")",
"throws",
"Exception",
"{",
"checkMetadata",
"(",
")",
";",
"String",
"boundsWSEN",
"=",
"metadataMap",
".",
"get",
"(",
"\"bounds\"",
")",
";",
"String",
"[",
"]",
"split",
"=",
"boundsWSEN",
".",
"split",
"(",... | Get the db envelope.
@return the Envelope of the dataset.
@throws Exception | [
"Get",
"the",
"db",
"envelope",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/mbtiles/MBTilesDb.java#L294-L303 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java | JdbcCpoXaAdapter.persistObject | @Override
public <T> long persistObject(String name, T bean) throws CpoException {
return getCurrentResource().persistObject(name, bean);
} | java | @Override
public <T> long persistObject(String name, T bean) throws CpoException {
return getCurrentResource().persistObject(name, bean);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"long",
"persistObject",
"(",
"String",
"name",
",",
"T",
"bean",
")",
"throws",
"CpoException",
"{",
"return",
"getCurrentResource",
"(",
")",
".",
"persistObject",
"(",
"name",
",",
"bean",
")",
";",
"}"
] | Persists the Object into the datasource. The CpoAdapter will check to see if this object exists in the datasource.
If it exists, the object is updated in the datasource If the object does not exist, then it is created in the
datasource. This method stores the object in the datasource.
<p>
<pre>Example:
<code>
<p>
class... | [
"Persists",
"the",
"Object",
"into",
"the",
"datasource",
".",
"The",
"CpoAdapter",
"will",
"check",
"to",
"see",
"if",
"this",
"object",
"exists",
"in",
"the",
"datasource",
".",
"If",
"it",
"exists",
"the",
"object",
"is",
"updated",
"in",
"the",
"dataso... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java#L1154-L1157 |
b3log/latke | latke-core/src/main/java/org/json/XML.java | XML.toJSONObject | public static JSONObject toJSONObject(String string, boolean keepStrings) throws JSONException {
return toJSONObject(new StringReader(string), keepStrings);
} | java | public static JSONObject toJSONObject(String string, boolean keepStrings) throws JSONException {
return toJSONObject(new StringReader(string), keepStrings);
} | [
"public",
"static",
"JSONObject",
"toJSONObject",
"(",
"String",
"string",
",",
"boolean",
"keepStrings",
")",
"throws",
"JSONException",
"{",
"return",
"toJSONObject",
"(",
"new",
"StringReader",
"(",
"string",
")",
",",
"keepStrings",
")",
";",
"}"
] | Convert a well-formed (but not necessarily valid) XML string into a
JSONObject. Some information may be lost in this transformation because
JSON is a data format and XML is a document format. XML uses elements,
attributes, and content text, while JSON uses unordered collections of
name/value pairs and arrays of values.... | [
"Convert",
"a",
"well",
"-",
"formed",
"(",
"but",
"not",
"necessarily",
"valid",
")",
"XML",
"string",
"into",
"a",
"JSONObject",
".",
"Some",
"information",
"may",
"be",
"lost",
"in",
"this",
"transformation",
"because",
"JSON",
"is",
"a",
"data",
"forma... | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/XML.java#L547-L549 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java | ReportGenerator.pretifyJson | private void pretifyJson(String pathToJson) throws ReportException {
final String outputPath = pathToJson + ".pretty";
final File in = new File(pathToJson);
final File out = new File(outputPath);
try (JsonReader reader = new JsonReader(new InputStreamReader(new FileInputStream(in), Stand... | java | private void pretifyJson(String pathToJson) throws ReportException {
final String outputPath = pathToJson + ".pretty";
final File in = new File(pathToJson);
final File out = new File(outputPath);
try (JsonReader reader = new JsonReader(new InputStreamReader(new FileInputStream(in), Stand... | [
"private",
"void",
"pretifyJson",
"(",
"String",
"pathToJson",
")",
"throws",
"ReportException",
"{",
"final",
"String",
"outputPath",
"=",
"pathToJson",
"+",
"\".pretty\"",
";",
"final",
"File",
"in",
"=",
"new",
"File",
"(",
"pathToJson",
")",
";",
"final",
... | Reformats the given JSON file.
@param pathToJson the path to the JSON file to be reformatted
@throws ReportException thrown if the given JSON file is malformed | [
"Reformats",
"the",
"given",
"JSON",
"file",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java#L400-L418 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java | Symtab.packageExists | public boolean packageExists(ModuleSymbol msym, Name fullname) {
Assert.checkNonNull(msym);
return lookupPackage(msym, fullname).exists();
} | java | public boolean packageExists(ModuleSymbol msym, Name fullname) {
Assert.checkNonNull(msym);
return lookupPackage(msym, fullname).exists();
} | [
"public",
"boolean",
"packageExists",
"(",
"ModuleSymbol",
"msym",
",",
"Name",
"fullname",
")",
"{",
"Assert",
".",
"checkNonNull",
"(",
"msym",
")",
";",
"return",
"lookupPackage",
"(",
"msym",
",",
"fullname",
")",
".",
"exists",
"(",
")",
";",
"}"
] | Check to see if a package exists, given its fully qualified name. | [
"Check",
"to",
"see",
"if",
"a",
"package",
"exists",
"given",
"its",
"fully",
"qualified",
"name",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java#L721-L724 |
walkmod/walkmod-core | src/main/java/org/walkmod/WalkModFacade.java | WalkModFacade.inspectPlugin | public List<BeanDefinition> inspectPlugin(PluginConfig plugin) {
Configuration conf = new ConfigurationImpl();
Collection<PluginConfig> plugins = new LinkedList<PluginConfig>();
plugins.add(plugin);
conf.setPlugins(plugins);
ConfigurationManager manager = new ConfigurationMa... | java | public List<BeanDefinition> inspectPlugin(PluginConfig plugin) {
Configuration conf = new ConfigurationImpl();
Collection<PluginConfig> plugins = new LinkedList<PluginConfig>();
plugins.add(plugin);
conf.setPlugins(plugins);
ConfigurationManager manager = new ConfigurationMa... | [
"public",
"List",
"<",
"BeanDefinition",
">",
"inspectPlugin",
"(",
"PluginConfig",
"plugin",
")",
"{",
"Configuration",
"conf",
"=",
"new",
"ConfigurationImpl",
"(",
")",
";",
"Collection",
"<",
"PluginConfig",
">",
"plugins",
"=",
"new",
"LinkedList",
"<",
"... | Retrieves the bean definitions that contains an specific plugin.
@param plugin
Plugin container of bean definitions.
@return List of bean definitions. | [
"Retrieves",
"the",
"bean",
"definitions",
"that",
"contains",
"an",
"specific",
"plugin",
"."
] | train | https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L983-L991 |
wkgcass/Style | src/main/java/net/cassite/style/aggregation/ListFuncSup.java | ListFuncSup.forEach | public <R> R forEach(RFunc2<R, T, IteratorInfo<R>> func, int index) {
return forEach($(func), index);
} | java | public <R> R forEach(RFunc2<R, T, IteratorInfo<R>> func, int index) {
return forEach($(func), index);
} | [
"public",
"<",
"R",
">",
"R",
"forEach",
"(",
"RFunc2",
"<",
"R",
",",
"T",
",",
"IteratorInfo",
"<",
"R",
">",
">",
"func",
",",
"int",
"index",
")",
"{",
"return",
"forEach",
"(",
"$",
"(",
"func",
")",
",",
"index",
")",
";",
"}"
] | define a function to deal with each element in the list with given
start index
@param func
a function takes in each element from list and
iterator info<br>
and returns last loop value
@param index
the index where to start iteration
@return return 'last loop value'.<br>
check
<a href="https://github.com/wkgcass/Style/"... | [
"define",
"a",
"function",
"to",
"deal",
"with",
"each",
"element",
"in",
"the",
"list",
"with",
"given",
"start",
"index"
] | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/aggregation/ListFuncSup.java#L123-L125 |
gallandarakhneorg/afc | advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileReader.java | DBaseFileReader.readDateRecordValue | @SuppressWarnings("checkstyle:magicnumber")
private static int readDateRecordValue(DBaseFileField field, int nrecord, int nfield, byte[] rawData,
int rawOffset, OutputParameter<Date> value) throws IOException {
final GregorianCalendar cal = new GregorianCalendar();
final int year = ((rawData[rawOffset] & 0xFF) ... | java | @SuppressWarnings("checkstyle:magicnumber")
private static int readDateRecordValue(DBaseFileField field, int nrecord, int nfield, byte[] rawData,
int rawOffset, OutputParameter<Date> value) throws IOException {
final GregorianCalendar cal = new GregorianCalendar();
final int year = ((rawData[rawOffset] & 0xFF) ... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"private",
"static",
"int",
"readDateRecordValue",
"(",
"DBaseFileField",
"field",
",",
"int",
"nrecord",
",",
"int",
"nfield",
",",
"byte",
"[",
"]",
"rawData",
",",
"int",
"rawOffset",
",",
"Outp... | Read a DATE record value.
@param field is the current parsed field.
@param nrecord is the number of the record
@param nfield is the number of the field
@param rawData raw data
@param rawOffset is the index at which the data could be obtained
@param value will be set with the value extracted from the dBASE file
@return... | [
"Read",
"a",
"DATE",
"record",
"value",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/dbasefile/src/main/java/org/arakhne/afc/io/dbase/DBaseFileReader.java#L1086-L1109 |
micronaut-projects/micronaut-core | discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java | Route53AutoNamingRegistrationClient.createService | public String createService(AWSServiceDiscovery serviceDiscovery, String name, String description, String namespaceId, Long ttl) {
if (serviceDiscovery == null) {
serviceDiscovery = AWSServiceDiscoveryClient.builder().withClientConfiguration(clientConfiguration.getClientConfiguration()).build();
... | java | public String createService(AWSServiceDiscovery serviceDiscovery, String name, String description, String namespaceId, Long ttl) {
if (serviceDiscovery == null) {
serviceDiscovery = AWSServiceDiscoveryClient.builder().withClientConfiguration(clientConfiguration.getClientConfiguration()).build();
... | [
"public",
"String",
"createService",
"(",
"AWSServiceDiscovery",
"serviceDiscovery",
",",
"String",
"name",
",",
"String",
"description",
",",
"String",
"namespaceId",
",",
"Long",
"ttl",
")",
"{",
"if",
"(",
"serviceDiscovery",
"==",
"null",
")",
"{",
"serviceD... | Create service, helper for integration tests.
@param serviceDiscovery service discovery instance
@param name name of the service
@param description description of the service
@param namespaceId namespaceId to attach it to (get via cli or api call)
@param ttl time to live for checking pulse
@return serviceId | [
"Create",
"service",
"helper",
"for",
"integration",
"tests",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/registration/Route53AutoNamingRegistrationClient.java#L359-L371 |
Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/kdtrees/KMeansInpiredMethod.java | KMeansInpiredMethod.quickSort | protected static void quickSort(Instances insts, int[] indices, int attidx, int left, int right) {
if (left < right) {
int middle = partition(insts, indices, attidx, left, right);
quickSort(insts, indices, attidx, left, middle);
quickSort(insts, indices, attidx, middle + 1, right);
}
} | java | protected static void quickSort(Instances insts, int[] indices, int attidx, int left, int right) {
if (left < right) {
int middle = partition(insts, indices, attidx, left, right);
quickSort(insts, indices, attidx, left, middle);
quickSort(insts, indices, attidx, middle + 1, right);
}
} | [
"protected",
"static",
"void",
"quickSort",
"(",
"Instances",
"insts",
",",
"int",
"[",
"]",
"indices",
",",
"int",
"attidx",
",",
"int",
"left",
",",
"int",
"right",
")",
"{",
"if",
"(",
"left",
"<",
"right",
")",
"{",
"int",
"middle",
"=",
"partiti... | Sorts the instances according to the given attribute/dimension.
The sorting is done on the master index array and not on the
actual instances object.
@param insts The instances on which the tree is (or is
to be) built.
@param indices The master index array containing indices
of the instances.
@param attidx The dimensi... | [
"Sorts",
"the",
"instances",
"according",
"to",
"the",
"given",
"attribute",
"/",
"dimension",
".",
"The",
"sorting",
"is",
"done",
"on",
"the",
"master",
"index",
"array",
"and",
"not",
"on",
"the",
"actual",
"instances",
"object",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/kdtrees/KMeansInpiredMethod.java#L273-L280 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/config/IsotopeFactory.java | IsotopeFactory.getExactMass | public double getExactMass(Integer atomicNumber, Integer massNumber) {
if (atomicNumber == null || massNumber == null)
return 0;
for (IIsotope isotope : this.isotopes[atomicNumber]) {
if (isotope.getMassNumber().equals(massNumber))
return isotope.getExactMass();
... | java | public double getExactMass(Integer atomicNumber, Integer massNumber) {
if (atomicNumber == null || massNumber == null)
return 0;
for (IIsotope isotope : this.isotopes[atomicNumber]) {
if (isotope.getMassNumber().equals(massNumber))
return isotope.getExactMass();
... | [
"public",
"double",
"getExactMass",
"(",
"Integer",
"atomicNumber",
",",
"Integer",
"massNumber",
")",
"{",
"if",
"(",
"atomicNumber",
"==",
"null",
"||",
"massNumber",
"==",
"null",
")",
"return",
"0",
";",
"for",
"(",
"IIsotope",
"isotope",
":",
"this",
... | Get the exact mass of a specified isotope for an atom.
@param atomicNumber atomic number
@param massNumber the mass number
@return the exact mass | [
"Get",
"the",
"exact",
"mass",
"of",
"a",
"specified",
"isotope",
"for",
"an",
"atom",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/config/IsotopeFactory.java#L243-L251 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/Collectors.java | Collectors.groupingBy | public static <T, K, A, D>
Collector<T, ?, Map<K, D>> groupingBy(Function<? super T, ? extends K> classifier,
Collector<? super T, A, D> downstream) {
return groupingBy(classifier, HashMap::new, downstream);
} | java | public static <T, K, A, D>
Collector<T, ?, Map<K, D>> groupingBy(Function<? super T, ? extends K> classifier,
Collector<? super T, A, D> downstream) {
return groupingBy(classifier, HashMap::new, downstream);
} | [
"public",
"static",
"<",
"T",
",",
"K",
",",
"A",
",",
"D",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Map",
"<",
"K",
",",
"D",
">",
">",
"groupingBy",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"K",
">",
"classifier",
",... | Returns a {@code Collector} implementing a cascaded "group by" operation
on input elements of type {@code T}, grouping elements according to a
classification function, and then performing a reduction operation on
the values associated with a given key using the specified downstream
{@code Collector}.
<p>The classifica... | [
"Returns",
"a",
"{",
"@code",
"Collector",
"}",
"implementing",
"a",
"cascaded",
"group",
"by",
"operation",
"on",
"input",
"elements",
"of",
"type",
"{",
"@code",
"T",
"}",
"grouping",
"elements",
"according",
"to",
"a",
"classification",
"function",
"and",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/Collectors.java#L850-L854 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/content/CmsMergePages.java | CmsMergePages.getResourceNameInOtherFolder | private String getResourceNameInOtherFolder(String resName, String sourceMergeFolder, String targetMergefolder) {
// get the resourcename of the resouce to test without the source merge folder
String resourcename = resName.substring(sourceMergeFolder.length());
// get the complete path of the r... | java | private String getResourceNameInOtherFolder(String resName, String sourceMergeFolder, String targetMergefolder) {
// get the resourcename of the resouce to test without the source merge folder
String resourcename = resName.substring(sourceMergeFolder.length());
// get the complete path of the r... | [
"private",
"String",
"getResourceNameInOtherFolder",
"(",
"String",
"resName",
",",
"String",
"sourceMergeFolder",
",",
"String",
"targetMergefolder",
")",
"{",
"// get the resourcename of the resouce to test without the source merge folder",
"String",
"resourcename",
"=",
"resNa... | Gets the name of a resource in the other merge folder.<p>
@param resName the complete path of a resource
@param sourceMergeFolder the path to the source merge folder
@param targetMergefolder the path to the target merge folder
@return the name of a resource in the other merge folder | [
"Gets",
"the",
"name",
"of",
"a",
"resource",
"in",
"the",
"other",
"merge",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/content/CmsMergePages.java#L551-L557 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/common/AbstractShortColumn.java | AbstractShortColumn.readShort | protected int readShort(int offset, byte[] data)
{
int result = 0;
int i = offset + m_offset;
for (int shiftBy = 0; shiftBy < 16; shiftBy += 8)
{
result |= ((data[i] & 0xff)) << shiftBy;
++i;
}
return result;
} | java | protected int readShort(int offset, byte[] data)
{
int result = 0;
int i = offset + m_offset;
for (int shiftBy = 0; shiftBy < 16; shiftBy += 8)
{
result |= ((data[i] & 0xff)) << shiftBy;
++i;
}
return result;
} | [
"protected",
"int",
"readShort",
"(",
"int",
"offset",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"int",
"result",
"=",
"0",
";",
"int",
"i",
"=",
"offset",
"+",
"m_offset",
";",
"for",
"(",
"int",
"shiftBy",
"=",
"0",
";",
"shiftBy",
"<",
"16",
";... | Read a two byte integer from the data.
@param offset current offset into data block
@param data data block
@return int value | [
"Read",
"a",
"two",
"byte",
"integer",
"from",
"the",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/common/AbstractShortColumn.java#L49-L59 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.runUninterruptibly | public static void runUninterruptibly(final long timeout, final TimeUnit unit, final Try.BiConsumer<Long, TimeUnit, InterruptedException> cmd) {
N.checkArgNotNull(unit, "unit");
N.checkArgNotNull(cmd);
boolean interrupted = false;
try {
long remainingNanos = unit.toN... | java | public static void runUninterruptibly(final long timeout, final TimeUnit unit, final Try.BiConsumer<Long, TimeUnit, InterruptedException> cmd) {
N.checkArgNotNull(unit, "unit");
N.checkArgNotNull(cmd);
boolean interrupted = false;
try {
long remainingNanos = unit.toN... | [
"public",
"static",
"void",
"runUninterruptibly",
"(",
"final",
"long",
"timeout",
",",
"final",
"TimeUnit",
"unit",
",",
"final",
"Try",
".",
"BiConsumer",
"<",
"Long",
",",
"TimeUnit",
",",
"InterruptedException",
">",
"cmd",
")",
"{",
"N",
".",
"checkArgN... | Note: Copied from Google Guava under Apache License v2.0
<br />
<br />
If a thread is interrupted during such a call, the call continues to block until the result is available or the
timeout elapses, and only then re-interrupts the thread.
@param timeout
@param unit
@param cmd | [
"Note",
":",
"Copied",
"from",
"Google",
"Guava",
"under",
"Apache",
"License",
"v2",
".",
"0",
"<br",
"/",
">",
"<br",
"/",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L28000-L28025 |
allure-framework/allure1 | allure-model/src/main/java/ru/yandex/qatools/allure/config/AllureNamingUtils.java | AllureNamingUtils.replaceBadXmlCharactersBySpace | public static void replaceBadXmlCharactersBySpace(char[] cbuf, int off, int len) {
for (int i = off; i < off + len; i++) {
if (isBadXmlCharacter(cbuf[i])) {
cbuf[i] = '\u0020';
}
}
} | java | public static void replaceBadXmlCharactersBySpace(char[] cbuf, int off, int len) {
for (int i = off; i < off + len; i++) {
if (isBadXmlCharacter(cbuf[i])) {
cbuf[i] = '\u0020';
}
}
} | [
"public",
"static",
"void",
"replaceBadXmlCharactersBySpace",
"(",
"char",
"[",
"]",
"cbuf",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"off",
";",
"i",
"<",
"off",
"+",
"len",
";",
"i",
"++",
")",
"{",
"if",
"("... | Replace bad xml charactes in given array by space
@param cbuf buffer to replace in
@param off Offset from which to start reading characters
@param len Number of characters to be replaced | [
"Replace",
"bad",
"xml",
"charactes",
"in",
"given",
"array",
"by",
"space"
] | train | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-model/src/main/java/ru/yandex/qatools/allure/config/AllureNamingUtils.java#L63-L69 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.