repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MeasureFormat.java | MeasureFormat.getInstance | public static MeasureFormat getInstance(ULocale locale, FormatWidth formatWidth) {
"""
Create a format from the locale, formatWidth, and format.
@param locale the locale.
@param formatWidth hints how long formatted strings should be.
@return The new MeasureFormat object.
"""
return getInstance(loc... | java | public static MeasureFormat getInstance(ULocale locale, FormatWidth formatWidth) {
return getInstance(locale, formatWidth, NumberFormat.getInstance(locale));
} | [
"public",
"static",
"MeasureFormat",
"getInstance",
"(",
"ULocale",
"locale",
",",
"FormatWidth",
"formatWidth",
")",
"{",
"return",
"getInstance",
"(",
"locale",
",",
"formatWidth",
",",
"NumberFormat",
".",
"getInstance",
"(",
"locale",
")",
")",
";",
"}"
] | Create a format from the locale, formatWidth, and format.
@param locale the locale.
@param formatWidth hints how long formatted strings should be.
@return The new MeasureFormat object. | [
"Create",
"a",
"format",
"from",
"the",
"locale",
"formatWidth",
"and",
"format",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MeasureFormat.java#L212-L214 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java | HBasePanel.printDataStartForm | public void printDataStartForm(PrintWriter out, int iPrintOptions) {
"""
Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes.
"""
if ((iPrintOptions & HtmlConstants.MAIN_SCREEN) == HtmlConstants.MAIN_SCREEN)
{
}
... | java | public void printDataStartForm(PrintWriter out, int iPrintOptions)
{
if ((iPrintOptions & HtmlConstants.MAIN_SCREEN) == HtmlConstants.MAIN_SCREEN)
{
}
else if ((iPrintOptions & HtmlConstants.DETAIL_SCREEN) == HtmlConstants.DETAIL_SCREEN)
{
out.println("<tr>\n<td c... | [
"public",
"void",
"printDataStartForm",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"if",
"(",
"(",
"iPrintOptions",
"&",
"HtmlConstants",
".",
"MAIN_SCREEN",
")",
"==",
"HtmlConstants",
".",
"MAIN_SCREEN",
")",
"{",
"}",
"else",
"if",
... | Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes. | [
"Display",
"the",
"start",
"form",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java#L524-L543 |
biojava/biojava | biojava-survival/src/main/java/org/biojava/nbio/survival/kaplanmeier/figure/NumbersAtRiskPanel.java | NumbersAtRiskPanel.setKaplanMeierFigure | public void setKaplanMeierFigure(KaplanMeierFigure kmf) {
"""
Pick up needed info and details from the KM Figure
@param kmf
"""
this.kmf = kmf;
int numRows = kmf.getSurvivalFitInfo().getStrataInfoHashMap().size();
int height = (numRows + 1) * getFontMetrics(getFont()).getHeight();
int width = kmf.get... | java | public void setKaplanMeierFigure(KaplanMeierFigure kmf) {
this.kmf = kmf;
int numRows = kmf.getSurvivalFitInfo().getStrataInfoHashMap().size();
int height = (numRows + 1) * getFontMetrics(getFont()).getHeight();
int width = kmf.getWidth();
setPreferredSize(new Dimension(width,height));
this.setSize(width, ... | [
"public",
"void",
"setKaplanMeierFigure",
"(",
"KaplanMeierFigure",
"kmf",
")",
"{",
"this",
".",
"kmf",
"=",
"kmf",
";",
"int",
"numRows",
"=",
"kmf",
".",
"getSurvivalFitInfo",
"(",
")",
".",
"getStrataInfoHashMap",
"(",
")",
".",
"size",
"(",
")",
";",
... | Pick up needed info and details from the KM Figure
@param kmf | [
"Pick",
"up",
"needed",
"info",
"and",
"details",
"from",
"the",
"KM",
"Figure"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/kaplanmeier/figure/NumbersAtRiskPanel.java#L52-L61 |
h2oai/h2o-3 | h2o-core/src/main/java/hex/Distribution.java | Distribution.gammaDenom | public double gammaDenom(double w, double y, double z, double f) {
"""
Contribution to denominator for GBM's leaf node prediction
@param w weight
@param y response
@param z residual
@param f predicted value (including offset)
@return weighted contribution to denominator
"""
switch (distribution) {
... | java | public double gammaDenom(double w, double y, double z, double f) {
switch (distribution) {
case gaussian:
case gamma:
return w;
case bernoulli:
case quasibinomial:
double ff = y-z;
return w * ff*(1-ff);
case multinomial:
double absz = Math.abs(z);
... | [
"public",
"double",
"gammaDenom",
"(",
"double",
"w",
",",
"double",
"y",
",",
"double",
"z",
",",
"double",
"f",
")",
"{",
"switch",
"(",
"distribution",
")",
"{",
"case",
"gaussian",
":",
"case",
"gamma",
":",
"return",
"w",
";",
"case",
"bernoulli",... | Contribution to denominator for GBM's leaf node prediction
@param w weight
@param y response
@param z residual
@param f predicted value (including offset)
@return weighted contribution to denominator | [
"Contribution",
"to",
"denominator",
"for",
"GBM",
"s",
"leaf",
"node",
"prediction"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/Distribution.java#L291-L315 |
alkacon/opencms-core | src-gwt/org/opencms/ugc/client/CmsUgcWrapper.java | CmsUgcWrapper.uploadFields | public void uploadFields(
final Set<String> fields,
final Function<Map<String, String>, Void> filenameCallback,
final I_CmsErrorCallback errorCallback) {
"""
Uploads files from the given file input fields.<p<
@param fields the set of names of fields containing the files to upload
@param... | java | public void uploadFields(
final Set<String> fields,
final Function<Map<String, String>, Void> filenameCallback,
final I_CmsErrorCallback errorCallback) {
disableAllFileFieldsExcept(fields);
final String id = CmsJsUtils.generateRandomId();
updateFormAction(id);
//... | [
"public",
"void",
"uploadFields",
"(",
"final",
"Set",
"<",
"String",
">",
"fields",
",",
"final",
"Function",
"<",
"Map",
"<",
"String",
",",
"String",
">",
",",
"Void",
">",
"filenameCallback",
",",
"final",
"I_CmsErrorCallback",
"errorCallback",
")",
"{",... | Uploads files from the given file input fields.<p<
@param fields the set of names of fields containing the files to upload
@param filenameCallback the callback to call with the resulting map from field names to file paths
@param errorCallback the callback to call with an error message | [
"Uploads",
"files",
"from",
"the",
"given",
"file",
"input",
"fields",
".",
"<p<"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ugc/client/CmsUgcWrapper.java#L99-L141 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/GetInstance.java | GetInstance.getInstance | public static Instance getInstance(String type, Class<?> clazz,
String algorithm) throws NoSuchAlgorithmException {
"""
/*
For all the getInstance() methods below:
@param type the type of engine (e.g. MessageDigest)
@param clazz the Spi class that the implementation must subclass
(e.g. MessageDiges... | java | public static Instance getInstance(String type, Class<?> clazz,
String algorithm) throws NoSuchAlgorithmException {
// in the almost all cases, the first service will work
// avoid taking long path if so
ProviderList list = Providers.getProviderList();
Service firstService = ... | [
"public",
"static",
"Instance",
"getInstance",
"(",
"String",
"type",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"// in the almost all cases, the first service will work",
"// avoid taking long path if s... | /*
For all the getInstance() methods below:
@param type the type of engine (e.g. MessageDigest)
@param clazz the Spi class that the implementation must subclass
(e.g. MessageDigestSpi.class) or null if no superclass check
is required
@param algorithm the name of the algorithm (or alias), e.g. MD5
@param provider the pr... | [
"/",
"*",
"For",
"all",
"the",
"getInstance",
"()",
"methods",
"below",
":",
"@param",
"type",
"the",
"type",
"of",
"engine",
"(",
"e",
".",
"g",
".",
"MessageDigest",
")",
"@param",
"clazz",
"the",
"Spi",
"class",
"that",
"the",
"implementation",
"must"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/jca/GetInstance.java#L152-L182 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/sax/ExcelSaxUtil.java | ExcelSaxUtil.formatCellContent | public static String formatCellContent(String value, int numFmtIndex, String numFmtString) {
"""
格式化数字或日期值
@param value 值
@param numFmtIndex 数字格式索引
@param numFmtString 数字格式名
@return 格式化后的值
"""
if (null != numFmtString) {
try {
value = new DataFormatter().formatRawCellContents(Double.parseDoub... | java | public static String formatCellContent(String value, int numFmtIndex, String numFmtString) {
if (null != numFmtString) {
try {
value = new DataFormatter().formatRawCellContents(Double.parseDouble(value), numFmtIndex, numFmtString);
} catch (NumberFormatException e) {
// ignore
}
}
return ... | [
"public",
"static",
"String",
"formatCellContent",
"(",
"String",
"value",
",",
"int",
"numFmtIndex",
",",
"String",
"numFmtString",
")",
"{",
"if",
"(",
"null",
"!=",
"numFmtString",
")",
"{",
"try",
"{",
"value",
"=",
"new",
"DataFormatter",
"(",
")",
".... | 格式化数字或日期值
@param value 值
@param numFmtIndex 数字格式索引
@param numFmtString 数字格式名
@return 格式化后的值 | [
"格式化数字或日期值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/sax/ExcelSaxUtil.java#L85-L94 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularTools_F32.java | EquirectangularTools_F32.equiToNorm | public void equiToNorm(float x , float y , Point3D_F32 norm ) {
"""
Converts equirectangular into normalized pointing vector
@param x pixel coordinate in equirectangular image
@param y pixel coordinate in equirectangular image
@param norm Normalized pointing vector
"""
equiToLatLon(x,y, temp);
Convert... | java | public void equiToNorm(float x , float y , Point3D_F32 norm ) {
equiToLatLon(x,y, temp);
ConvertCoordinates3D_F32.latlonToUnitVector(temp.lat,temp.lon, norm);
} | [
"public",
"void",
"equiToNorm",
"(",
"float",
"x",
",",
"float",
"y",
",",
"Point3D_F32",
"norm",
")",
"{",
"equiToLatLon",
"(",
"x",
",",
"y",
",",
"temp",
")",
";",
"ConvertCoordinates3D_F32",
".",
"latlonToUnitVector",
"(",
"temp",
".",
"lat",
",",
"t... | Converts equirectangular into normalized pointing vector
@param x pixel coordinate in equirectangular image
@param y pixel coordinate in equirectangular image
@param norm Normalized pointing vector | [
"Converts",
"equirectangular",
"into",
"normalized",
"pointing",
"vector"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularTools_F32.java#L84-L87 |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanPODocBookBuilder.java | PublicanPODocBookBuilder.formatTranslationString | protected String formatTranslationString(POBuildData buildData, final String translationString) {
"""
Formats a string so that it will be compatible with publicans expectations.
@param buildData Information and data structures for the build.
@param translationString The string to be formatted.
@retu... | java | protected String formatTranslationString(POBuildData buildData, final String translationString) {
try {
final Document doc = TopicUtilities.convertXMLStringToDocument("<temp>" + translationString + "</temp>",
buildData.getDocBookVersion().getId());
return XMLUtilitie... | [
"protected",
"String",
"formatTranslationString",
"(",
"POBuildData",
"buildData",
",",
"final",
"String",
"translationString",
")",
"{",
"try",
"{",
"final",
"Document",
"doc",
"=",
"TopicUtilities",
".",
"convertXMLStringToDocument",
"(",
"\"<temp>\"",
"+",
"transla... | Formats a string so that it will be compatible with publicans expectations.
@param buildData Information and data structures for the build.
@param translationString The string to be formatted.
@return The formatted string. | [
"Formats",
"a",
"string",
"so",
"that",
"it",
"will",
"be",
"compatible",
"with",
"publicans",
"expectations",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/PublicanPODocBookBuilder.java#L1083-L1092 |
spockframework/spock | spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java | GroovyRuntimeUtil.invokeConstructor | public static Object invokeConstructor(Class<?> clazz, Object... args) {
"""
Note: This method may throw checked exceptions although it doesn't say so.
"""
try {
return InvokerHelper.invokeConstructorOf(clazz, args);
} catch (InvokerInvocationException e) {
ExceptionUtil.sneakyThrow(e.getCa... | java | public static Object invokeConstructor(Class<?> clazz, Object... args) {
try {
return InvokerHelper.invokeConstructorOf(clazz, args);
} catch (InvokerInvocationException e) {
ExceptionUtil.sneakyThrow(e.getCause());
return null; // never reached
}
} | [
"public",
"static",
"Object",
"invokeConstructor",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Object",
"...",
"args",
")",
"{",
"try",
"{",
"return",
"InvokerHelper",
".",
"invokeConstructorOf",
"(",
"clazz",
",",
"args",
")",
";",
"}",
"catch",
"(",
"I... | Note: This method may throw checked exceptions although it doesn't say so. | [
"Note",
":",
"This",
"method",
"may",
"throw",
"checked",
"exceptions",
"although",
"it",
"doesn",
"t",
"say",
"so",
"."
] | train | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java#L157-L164 |
languagetool-org/languagetool | languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AvsAnData.java | AvsAnData.loadWords | private static Set<String> loadWords(String path) {
"""
Load words, normalized to lowercase unless starting with '*'.
"""
Set<String> set = new HashSet<>();
InputStream stream = JLanguageTool.getDataBroker().getFromRulesDirAsStream(path);
try (Scanner scanner = new Scanner(stream, "utf-8")) {
... | java | private static Set<String> loadWords(String path) {
Set<String> set = new HashSet<>();
InputStream stream = JLanguageTool.getDataBroker().getFromRulesDirAsStream(path);
try (Scanner scanner = new Scanner(stream, "utf-8")) {
while (scanner.hasNextLine()) {
String line = scanner.nextLine().trim(... | [
"private",
"static",
"Set",
"<",
"String",
">",
"loadWords",
"(",
"String",
"path",
")",
"{",
"Set",
"<",
"String",
">",
"set",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"InputStream",
"stream",
"=",
"JLanguageTool",
".",
"getDataBroker",
"(",
")",
"... | Load words, normalized to lowercase unless starting with '*'. | [
"Load",
"words",
"normalized",
"to",
"lowercase",
"unless",
"starting",
"with",
"*",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AvsAnData.java#L52-L69 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/CustomFieldValueReader9.java | CustomFieldValueReader9.populateContainer | private void populateContainer(FieldType field, List<Pair<String, String>> items) {
"""
Populate the container from outline code data.
@param field field type
@param items pairs of values and descriptions
"""
CustomField config = m_container.getCustomField(field);
CustomFieldLookupTable table =... | java | private void populateContainer(FieldType field, List<Pair<String, String>> items)
{
CustomField config = m_container.getCustomField(field);
CustomFieldLookupTable table = config.getLookupTable();
for (Pair<String, String> pair : items)
{
CustomFieldValueItem item = new CustomFieldVa... | [
"private",
"void",
"populateContainer",
"(",
"FieldType",
"field",
",",
"List",
"<",
"Pair",
"<",
"String",
",",
"String",
">",
">",
"items",
")",
"{",
"CustomField",
"config",
"=",
"m_container",
".",
"getCustomField",
"(",
"field",
")",
";",
"CustomFieldLo... | Populate the container from outline code data.
@param field field type
@param items pairs of values and descriptions | [
"Populate",
"the",
"container",
"from",
"outline",
"code",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CustomFieldValueReader9.java#L229-L241 |
xcesco/kripton | kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonDatabaseWrapper.java | KriptonDatabaseWrapper.updateDelete | public static int updateDelete(SQLContext context, String sql, KriptonContentValues contentValues) {
"""
Update delete.
@param context the context
@param sql the sql
@param contentValues the content values
@return the int
"""
SQLiteStatement ps = context.database().compileStatement(sql);
try {
con... | java | public static int updateDelete(SQLContext context, String sql, KriptonContentValues contentValues) {
SQLiteStatement ps = context.database().compileStatement(sql);
try {
contentValues.bind(ps);
return ps.executeUpdateDelete();
} finally {
ps.close();
}
} | [
"public",
"static",
"int",
"updateDelete",
"(",
"SQLContext",
"context",
",",
"String",
"sql",
",",
"KriptonContentValues",
"contentValues",
")",
"{",
"SQLiteStatement",
"ps",
"=",
"context",
".",
"database",
"(",
")",
".",
"compileStatement",
"(",
"sql",
")",
... | Update delete.
@param context the context
@param sql the sql
@param contentValues the content values
@return the int | [
"Update",
"delete",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/KriptonDatabaseWrapper.java#L92-L100 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/config/ServiceDirectoryConfig.java | ServiceDirectoryConfig.getBoolean | public boolean getBoolean(String name, boolean defaultVal) {
"""
Get the property object as Boolean, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as boolean, return defaultVal if property is undefined.
"""
... | java | public boolean getBoolean(String name, boolean defaultVal){
if(this.configuration.containsKey(name)){
return this.configuration.getBoolean(name);
} else {
return defaultVal;
}
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"name",
",",
"boolean",
"defaultVal",
")",
"{",
"if",
"(",
"this",
".",
"configuration",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"this",
".",
"configuration",
".",
"getBoolean",
"(",
"name... | Get the property object as Boolean, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as boolean, return defaultVal if property is undefined. | [
"Get",
"the",
"property",
"object",
"as",
"Boolean",
"or",
"return",
"defaultVal",
"if",
"property",
"is",
"not",
"defined",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/config/ServiceDirectoryConfig.java#L117-L123 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/stereo/ExampleFundamentalMatrix.java | ExampleFundamentalMatrix.computeMatches | public static List<AssociatedPair> computeMatches( BufferedImage left , BufferedImage right ) {
"""
Use the associate point feature example to create a list of {@link AssociatedPair} for use in computing the
fundamental matrix.
"""
DetectDescribePoint detDesc = FactoryDetectDescribe.surfStable(
new Conf... | java | public static List<AssociatedPair> computeMatches( BufferedImage left , BufferedImage right ) {
DetectDescribePoint detDesc = FactoryDetectDescribe.surfStable(
new ConfigFastHessian(0, 2, 400, 1, 9, 4, 4), null,null, GrayF32.class);
// DetectDescribePoint detDesc = FactoryDetectDescribe.sift(null,new ConfigSiftD... | [
"public",
"static",
"List",
"<",
"AssociatedPair",
">",
"computeMatches",
"(",
"BufferedImage",
"left",
",",
"BufferedImage",
"right",
")",
"{",
"DetectDescribePoint",
"detDesc",
"=",
"FactoryDetectDescribe",
".",
"surfStable",
"(",
"new",
"ConfigFastHessian",
"(",
... | Use the associate point feature example to create a list of {@link AssociatedPair} for use in computing the
fundamental matrix. | [
"Use",
"the",
"associate",
"point",
"feature",
"example",
"to",
"create",
"a",
"list",
"of",
"{"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/stereo/ExampleFundamentalMatrix.java#L131-L154 |
wcm-io/wcm-io-wcm | ui/extjs/src/main/java/io/wcm/wcm/ui/extjs/provider/impl/servlets/TemplateFilterPageTreeProvider.java | TemplateFilterPageTreeProvider.searchNodesByTemplate | @SuppressWarnings("null")
private NodeIterator searchNodesByTemplate(String[] templates, String rootPath, SlingHttpServletRequest request) throws RepositoryException {
"""
Searches for page content nodes under the {@code pRootPath} with given
template It uses a XPATH query and return the node iterator of result... | java | @SuppressWarnings("null")
private NodeIterator searchNodesByTemplate(String[] templates, String rootPath, SlingHttpServletRequest request) throws RepositoryException {
String queryString = "/jcr:root" + ISO9075.encodePath(rootPath) + "//*"
+ "[@cq:template='" + StringUtils.join(escapeXPathQueryExpressions... | [
"@",
"SuppressWarnings",
"(",
"\"null\"",
")",
"private",
"NodeIterator",
"searchNodesByTemplate",
"(",
"String",
"[",
"]",
"templates",
",",
"String",
"rootPath",
",",
"SlingHttpServletRequest",
"request",
")",
"throws",
"RepositoryException",
"{",
"String",
"querySt... | Searches for page content nodes under the {@code pRootPath} with given
template It uses a XPATH query and return the node iterator of results.
@param templates
@param rootPath
@return results node iterator
@throws RepositoryException | [
"Searches",
"for",
"page",
"content",
"nodes",
"under",
"the",
"{",
"@code",
"pRootPath",
"}",
"with",
"given",
"template",
"It",
"uses",
"a",
"XPATH",
"query",
"and",
"return",
"the",
"node",
"iterator",
"of",
"results",
"."
] | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/ui/extjs/src/main/java/io/wcm/wcm/ui/extjs/provider/impl/servlets/TemplateFilterPageTreeProvider.java#L128-L137 |
badamowicz/sonar-hla | sonar-hla-maven-plugin/src/main/java/com/github/badamowicz/sonar/hla/plugin/helper/LogHelper.java | LogHelper.logCSV | public static void logCSV(String csvData, final Logger log) {
"""
Log CSV data with some additional information.
@param csvData A string expected to contain CSV data. Actually no checks are done if this is really CSV.
@param log A {@link Logger} which will be used for output.
"""
log.info("");
... | java | public static void logCSV(String csvData, final Logger log) {
log.info("");
log.info("**** Here we go with CSV:");
log.info("");
log.info(csvData);
log.info("");
log.info("**** End of CSV data. Have a nice day!");
log.info("");
LogHelper.moo(log);
} | [
"public",
"static",
"void",
"logCSV",
"(",
"String",
"csvData",
",",
"final",
"Logger",
"log",
")",
"{",
"log",
".",
"info",
"(",
"\"\"",
")",
";",
"log",
".",
"info",
"(",
"\"**** Here we go with CSV:\"",
")",
";",
"log",
".",
"info",
"(",
"\"\"",
")"... | Log CSV data with some additional information.
@param csvData A string expected to contain CSV data. Actually no checks are done if this is really CSV.
@param log A {@link Logger} which will be used for output. | [
"Log",
"CSV",
"data",
"with",
"some",
"additional",
"information",
"."
] | train | https://github.com/badamowicz/sonar-hla/blob/21bd8a853d81966b47e96b518430abbc07ccd5f3/sonar-hla-maven-plugin/src/main/java/com/github/badamowicz/sonar/hla/plugin/helper/LogHelper.java#L73-L83 |
kejunxia/AndroidMvc | samples/simple-mvp/app/src/main/java/com/shipdream/lib/android/mvc/samples/simple/mvp/view/CounterMasterScreen.java | CounterMasterScreen.onViewReady | @Override
public void onViewReady(View view, Bundle savedInstanceState, Reason reason) {
"""
Lifecycle similar to onViewCreated by with more granular control with an extra argument to
indicate why this view is created: 1. first time created, or 2. rotated or 3. restored
@param view The root view of the fragm... | java | @Override
public void onViewReady(View view, Bundle savedInstanceState, Reason reason) {
super.onViewReady(view, savedInstanceState, reason);
if (reason.isFirstTime()) {
CounterMasterInsideView f = new CounterMasterInsideView();
getChildFragmentManager().beginTransaction()
... | [
"@",
"Override",
"public",
"void",
"onViewReady",
"(",
"View",
"view",
",",
"Bundle",
"savedInstanceState",
",",
"Reason",
"reason",
")",
"{",
"super",
".",
"onViewReady",
"(",
"view",
",",
"savedInstanceState",
",",
"reason",
")",
";",
"if",
"(",
"reason",
... | Lifecycle similar to onViewCreated by with more granular control with an extra argument to
indicate why this view is created: 1. first time created, or 2. rotated or 3. restored
@param view The root view of the fragment
@param savedInstanceState The savedInstanceState when the fragment is being recreated after
its encl... | [
"Lifecycle",
"similar",
"to",
"onViewCreated",
"by",
"with",
"more",
"granular",
"control",
"with",
"an",
"extra",
"argument",
"to",
"indicate",
"why",
"this",
"view",
"is",
"created",
":",
"1",
".",
"first",
"time",
"created",
"or",
"2",
".",
"rotated",
"... | train | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/samples/simple-mvp/app/src/main/java/com/shipdream/lib/android/mvc/samples/simple/mvp/view/CounterMasterScreen.java#L92-L103 |
xvik/dropwizard-guicey | src/main/java/ru/vyarus/dropwizard/guice/module/installer/util/JerseyBinding.java | JerseyBinding.isHK2Managed | public static boolean isHK2Managed(final Class<?> type, final boolean guiceFirstMode) {
"""
When guice-first mode used (default) all jersey extensions are instantiated by guice and only if
{@linkplain HK2Managed} annotation set on bean - it will be instantiated by HK2.
<p>
When HK2-first mode used
({@linkplain... | java | public static boolean isHK2Managed(final Class<?> type, final boolean guiceFirstMode) {
return guiceFirstMode
? type.isAnnotationPresent(HK2Managed.class)
: !type.isAnnotationPresent(GuiceManaged.class);
} | [
"public",
"static",
"boolean",
"isHK2Managed",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"boolean",
"guiceFirstMode",
")",
"{",
"return",
"guiceFirstMode",
"?",
"type",
".",
"isAnnotationPresent",
"(",
"HK2Managed",
".",
"class",
")",
":",
... | When guice-first mode used (default) all jersey extensions are instantiated by guice and only if
{@linkplain HK2Managed} annotation set on bean - it will be instantiated by HK2.
<p>
When HK2-first mode used
({@linkplain ru.vyarus.dropwizard.guice.module.installer.InstallersOptions#JerseyExtensionsManagedByGuice})
all j... | [
"When",
"guice",
"-",
"first",
"mode",
"used",
"(",
"default",
")",
"all",
"jersey",
"extensions",
"are",
"instantiated",
"by",
"guice",
"and",
"only",
"if",
"{",
"@linkplain",
"HK2Managed",
"}",
"annotation",
"set",
"on",
"bean",
"-",
"it",
"will",
"be",
... | train | https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/installer/util/JerseyBinding.java#L63-L67 |
centic9/commons-dost | src/main/java/org/dstadler/commons/graphviz/DotUtils.java | DotUtils.writeHeader | public static void writeHeader(Writer writer, int dpi, String rankDir, String id, List<String> attribLines) throws IOException {
"""
Write the header structure.
@param writer A writer where the header is written to.
@param dpi The resulting resolution, can be 0 for using the default DPI-setting of dot
@param ... | java | public static void writeHeader(Writer writer, int dpi, String rankDir, String id, List<String> attribLines) throws IOException {
// Default settings
if (attribLines == null) {
attribLines = new ArrayList<>();
} else {
attribLines = new ArrayList<>(attribLines);
}
... | [
"public",
"static",
"void",
"writeHeader",
"(",
"Writer",
"writer",
",",
"int",
"dpi",
",",
"String",
"rankDir",
",",
"String",
"id",
",",
"List",
"<",
"String",
">",
"attribLines",
")",
"throws",
"IOException",
"{",
"// Default settings",
"if",
"(",
"attrib... | Write the header structure.
@param writer A writer where the header is written to.
@param dpi The resulting resolution, can be 0 for using the default DPI-setting of dot
@param rankDir The direction of the graph, can be null
@param id The id of the graph, cannot be null, needs to start with a alphabetical character, c... | [
"Write",
"the",
"header",
"structure",
"."
] | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/graphviz/DotUtils.java#L61-L84 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.accessRestriction_sms_POST | public OvhSmsSecret accessRestriction_sms_POST(String phone) throws IOException {
"""
Add a SMS access restriction
REST: POST /me/accessRestriction/sms
@param phone [required] Cell phone number to register
"""
String qPath = "/me/accessRestriction/sms";
StringBuilder sb = path(qPath);
HashMap<String,... | java | public OvhSmsSecret accessRestriction_sms_POST(String phone) throws IOException {
String qPath = "/me/accessRestriction/sms";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "phone", phone);
String resp = exec(qPath, "POST", sb.toString(), o);
return conv... | [
"public",
"OvhSmsSecret",
"accessRestriction_sms_POST",
"(",
"String",
"phone",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/accessRestriction/sms\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"HashMap",
"<",
"String",
"... | Add a SMS access restriction
REST: POST /me/accessRestriction/sms
@param phone [required] Cell phone number to register | [
"Add",
"a",
"SMS",
"access",
"restriction"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3767-L3774 |
fuinorg/event-store-commons | spi/src/main/java/org/fuin/esc/spi/EscSpiUtils.java | EscSpiUtils.mimeType | public static EnhancedMimeType mimeType(@NotNull final SerializerRegistry registry, @NotNull final List<CommonEvent> commonEvents) {
"""
Returns the mime types shared by all events in the list.
@param registry
Registry used to peek the mime type used to serialize the event.
@param commonEvents
List to test.
... | java | public static EnhancedMimeType mimeType(@NotNull final SerializerRegistry registry, @NotNull final List<CommonEvent> commonEvents) {
Contract.requireArgNotNull("registry", registry);
Contract.requireArgNotNull("commonEvents", commonEvents);
EnhancedMimeType mimeType = null;
for (final ... | [
"public",
"static",
"EnhancedMimeType",
"mimeType",
"(",
"@",
"NotNull",
"final",
"SerializerRegistry",
"registry",
",",
"@",
"NotNull",
"final",
"List",
"<",
"CommonEvent",
">",
"commonEvents",
")",
"{",
"Contract",
".",
"requireArgNotNull",
"(",
"\"registry\"",
... | Returns the mime types shared by all events in the list.
@param registry
Registry used to peek the mime type used to serialize the event.
@param commonEvents
List to test.
@return Mime type if all events share the same type or <code>null</code> if there are events with different mime types. | [
"Returns",
"the",
"mime",
"types",
"shared",
"by",
"all",
"events",
"in",
"the",
"list",
"."
] | train | https://github.com/fuinorg/event-store-commons/blob/ea175582d8cda2b5a6d2fe52bbb2f1c183eee77c/spi/src/main/java/org/fuin/esc/spi/EscSpiUtils.java#L111-L128 |
mikepenz/FastAdapter | app/src/main/java/com/mikepenz/fastadapter/app/helpers/HeaderPositionCalculator.java | HeaderPositionCalculator.hasNewHeader | public boolean hasNewHeader(int position, boolean isReverseLayout) {
"""
Determines if an item in the list should have a header that is different than the item in the
list that immediately precedes it. Items with no headers will always return false.
@param position of the list item in questions
@param ... | java | public boolean hasNewHeader(int position, boolean isReverseLayout) {
if (indexOutOfBounds(position)) {
return false;
}
int originalPosition = moPubRecyclerAdapter.getOriginalPosition(position);
if (originalPosition < 0) {
return false;
}
long hea... | [
"public",
"boolean",
"hasNewHeader",
"(",
"int",
"position",
",",
"boolean",
"isReverseLayout",
")",
"{",
"if",
"(",
"indexOutOfBounds",
"(",
"position",
")",
")",
"{",
"return",
"false",
";",
"}",
"int",
"originalPosition",
"=",
"moPubRecyclerAdapter",
".",
"... | Determines if an item in the list should have a header that is different than the item in the
list that immediately precedes it. Items with no headers will always return false.
@param position of the list item in questions
@param isReverseLayout TRUE if layout manager has flag isReverseLayout
@return true if th... | [
"Determines",
"if",
"an",
"item",
"in",
"the",
"list",
"should",
"have",
"a",
"header",
"that",
"is",
"different",
"than",
"the",
"item",
"in",
"the",
"list",
"that",
"immediately",
"precedes",
"it",
".",
"Items",
"with",
"no",
"headers",
"will",
"always",... | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/helpers/HeaderPositionCalculator.java#L81-L105 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.updateComputeNodeUser | private void updateComputeNodeUser(String poolId, String nodeId, String userName, NodeUpdateUserParameter nodeUpdateUserParameter, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Updates the specified user account on the specified compute node.
@param poolId The ... | java | private void updateComputeNodeUser(String poolId, String nodeId, String userName, NodeUpdateUserParameter nodeUpdateUserParameter, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
ComputeNodeUpdateUserOptions options = new ComputeNodeUpdateUserOptions();
Behav... | [
"private",
"void",
"updateComputeNodeUser",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"userName",
",",
"NodeUpdateUserParameter",
"nodeUpdateUserParameter",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"B... | Updates the specified user account on the specified compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node where the user account will be updated.
@param userName The name of the user account to update.
@param nodeUpdateUserParameter The set of changes t... | [
"Updates",
"the",
"specified",
"user",
"account",
"on",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L213-L219 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/cache/TileCache.java | TileCache.calcCodesForBounds | protected List<TileCode> calcCodesForBounds(Bbox bounds) {
"""
Saves the complete array of TileCode objects for the given bounds (and the current scale).
@param bounds
view bounds
@return list of tiles in these bounds
"""
// Calculate tile width and height for tileLevel=currentTileLevel
double div = M... | java | protected List<TileCode> calcCodesForBounds(Bbox bounds) {
// Calculate tile width and height for tileLevel=currentTileLevel
double div = Math.pow(2, currentTileLevel); // tile level must be correct!
double scale = layer.getMapModel().getMapView().getCurrentScale();
double tileWidth = Math.ceil((scale * layerBo... | [
"protected",
"List",
"<",
"TileCode",
">",
"calcCodesForBounds",
"(",
"Bbox",
"bounds",
")",
"{",
"// Calculate tile width and height for tileLevel=currentTileLevel",
"double",
"div",
"=",
"Math",
".",
"pow",
"(",
"2",
",",
"currentTileLevel",
")",
";",
"// tile level... | Saves the complete array of TileCode objects for the given bounds (and the current scale).
@param bounds
view bounds
@return list of tiles in these bounds | [
"Saves",
"the",
"complete",
"array",
"of",
"TileCode",
"objects",
"for",
"the",
"given",
"bounds",
"(",
"and",
"the",
"current",
"scale",
")",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/cache/TileCache.java#L316-L349 |
liferay/com-liferay-commerce | commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java | CommerceVirtualOrderItemPersistenceImpl.removeByUuid_C | @Override
public void removeByUuid_C(String uuid, long companyId) {
"""
Removes all the commerce virtual order items where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID
"""
for (CommerceVirtualOrderItem commerceVirtualOrderItem : findByUuid_C(... | java | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CommerceVirtualOrderItem commerceVirtualOrderItem : findByUuid_C(
uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceVirtualOrderItem);
}
} | [
"@",
"Override",
"public",
"void",
"removeByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
")",
"{",
"for",
"(",
"CommerceVirtualOrderItem",
"commerceVirtualOrderItem",
":",
"findByUuid_C",
"(",
"uuid",
",",
"companyId",
",",
"QueryUtil",
".",
"ALL_POS"... | Removes all the commerce virtual order items where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID | [
"Removes",
"all",
"the",
"commerce",
"virtual",
"order",
"items",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java#L1418-L1424 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_mailingList_name_DELETE | public OvhTaskMl domain_mailingList_name_DELETE(String domain, String name) throws IOException {
"""
Delete existing Mailing list
REST: DELETE /email/domain/{domain}/mailingList/{name}
@param domain [required] Name of your domain name
@param name [required] Name of mailing list
"""
String qPath = "/emai... | java | public OvhTaskMl domain_mailingList_name_DELETE(String domain, String name) throws IOException {
String qPath = "/email/domain/{domain}/mailingList/{name}";
StringBuilder sb = path(qPath, domain, name);
String resp = exec(qPath, "DELETE", sb.toString(), null);
return convertTo(resp, OvhTaskMl.class);
} | [
"public",
"OvhTaskMl",
"domain_mailingList_name_DELETE",
"(",
"String",
"domain",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/mailingList/{name}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | Delete existing Mailing list
REST: DELETE /email/domain/{domain}/mailingList/{name}
@param domain [required] Name of your domain name
@param name [required] Name of mailing list | [
"Delete",
"existing",
"Mailing",
"list"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L1554-L1559 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/UserAPI.java | UserAPI.userInfoBatchget | public static UserInfoList userInfoBatchget(String access_token,String lang,List<String> openids,int emoji) {
"""
批量获取用户基本信息
@since 2.7.1
@param access_token access_token
@param lang zh-CN
@param openids 最多支持一次拉取100条
@param emoji 表情解析方式<br>
0 不设置 <br>
1 HtmlHex 格式<br>
2 HtmlTag 格式<br>
3 Alias 格式<br>
... | java | public static UserInfoList userInfoBatchget(String access_token,String lang,List<String> openids,int emoji){
StringBuilder sb = new StringBuilder();
sb.append("{\"user_list\": [");
for(int i = 0;i < openids.size();i++){
sb.append("{")
.append("\"openid\": \"").append(openids.get(i)).append("\",")
.ap... | [
"public",
"static",
"UserInfoList",
"userInfoBatchget",
"(",
"String",
"access_token",
",",
"String",
"lang",
",",
"List",
"<",
"String",
">",
"openids",
",",
"int",
"emoji",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
... | 批量获取用户基本信息
@since 2.7.1
@param access_token access_token
@param lang zh-CN
@param openids 最多支持一次拉取100条
@param emoji 表情解析方式<br>
0 不设置 <br>
1 HtmlHex 格式<br>
2 HtmlTag 格式<br>
3 Alias 格式<br>
4 HtmlDec 格式<br>
5 PureText 纯文本<br>
@return UserInfoList | [
"批量获取用户基本信息"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/UserAPI.java#L99-L124 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/request/impl/ApacheHttpRequestFactory.java | ApacheHttpRequestFactory.addProxyConfig | private void addProxyConfig(RequestConfig.Builder requestConfigBuilder, HttpClientSettings settings) {
"""
Update the provided request configuration builder to specify the proxy authentication schemes that should be used when
authenticating against the HTTP proxy.
@see ClientConfiguration#setProxyAuthenticatio... | java | private void addProxyConfig(RequestConfig.Builder requestConfigBuilder, HttpClientSettings settings) {
if (settings.isProxyEnabled() && settings.isAuthenticatedProxy() && settings.getProxyAuthenticationMethods() != null) {
List<String> apacheAuthenticationSchemes = new ArrayList<String>();
... | [
"private",
"void",
"addProxyConfig",
"(",
"RequestConfig",
".",
"Builder",
"requestConfigBuilder",
",",
"HttpClientSettings",
"settings",
")",
"{",
"if",
"(",
"settings",
".",
"isProxyEnabled",
"(",
")",
"&&",
"settings",
".",
"isAuthenticatedProxy",
"(",
")",
"&&... | Update the provided request configuration builder to specify the proxy authentication schemes that should be used when
authenticating against the HTTP proxy.
@see ClientConfiguration#setProxyAuthenticationMethods(List) | [
"Update",
"the",
"provided",
"request",
"configuration",
"builder",
"to",
"specify",
"the",
"proxy",
"authentication",
"schemes",
"that",
"should",
"be",
"used",
"when",
"authenticating",
"against",
"the",
"HTTP",
"proxy",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/http/apache/request/impl/ApacheHttpRequestFactory.java#L237-L247 |
roboconf/roboconf-platform | core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/extensions/MessagingContext.java | MessagingContext.forExportedVariables | public static List<MessagingContext> forExportedVariables(
String domain,
String applicationName,
Instance instance,
Map<String,String> externalExports,
ThoseThat thoseThat ) {
"""
Builds a list of messaging contexts.
@param domain the domain
@param applicationName the name of the agent's applicat... | java | public static List<MessagingContext> forExportedVariables(
String domain,
String applicationName,
Instance instance,
Map<String,String> externalExports,
ThoseThat thoseThat ) {
List<MessagingContext> result = new ArrayList<> ();
// For inter-app messages, the real question is about whether we need
... | [
"public",
"static",
"List",
"<",
"MessagingContext",
">",
"forExportedVariables",
"(",
"String",
"domain",
",",
"String",
"applicationName",
",",
"Instance",
"instance",
",",
"Map",
"<",
"String",
",",
"String",
">",
"externalExports",
",",
"ThoseThat",
"thoseThat... | Builds a list of messaging contexts.
@param domain the domain
@param applicationName the name of the agent's application
@param instance the current instance
@param externalExports a non-null map that associates internal exported variables with global ones
@param thoseThat whether we target "those that import" or "thos... | [
"Builds",
"a",
"list",
"of",
"messaging",
"contexts",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/extensions/MessagingContext.java#L267-L306 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateNumber | public static String validateNumber(String value, String errorMsg) throws ValidateException {
"""
验证是否为数字
@param value 表单值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
"""
if (false == isNumber(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | java | public static String validateNumber(String value, String errorMsg) throws ValidateException {
if (false == isNumber(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"String",
"validateNumber",
"(",
"String",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isNumber",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"ValidateException",
"(",
"errorMsg",... | 验证是否为数字
@param value 表单值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常 | [
"验证是否为数字"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L544-L549 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/ringbuffer/impl/ReadResultSetImpl.java | ReadResultSetImpl.addItem | public void addItem(long seq, Object item) {
"""
Applies the {@link Projection} and adds an item to this {@link ReadResultSetImpl} if
it passes the {@link Predicate} and {@link IFunction} with which it was constructed.
The {@code item} may be in serialized or deserialized format as this method will
adapt the pa... | java | public void addItem(long seq, Object item) {
assert size < maxSize;
readCount++;
Data resultItem;
if (filter != null || predicate != null || projection != null) {
final O objectItem = serializationService.toObject(item);
final boolean passesFilter = filter == nul... | [
"public",
"void",
"addItem",
"(",
"long",
"seq",
",",
"Object",
"item",
")",
"{",
"assert",
"size",
"<",
"maxSize",
";",
"readCount",
"++",
";",
"Data",
"resultItem",
";",
"if",
"(",
"filter",
"!=",
"null",
"||",
"predicate",
"!=",
"null",
"||",
"proje... | Applies the {@link Projection} and adds an item to this {@link ReadResultSetImpl} if
it passes the {@link Predicate} and {@link IFunction} with which it was constructed.
The {@code item} may be in serialized or deserialized format as this method will
adapt the parameter if necessary before providing it to the predicate... | [
"Applies",
"the",
"{",
"@link",
"Projection",
"}",
"and",
"adds",
"an",
"item",
"to",
"this",
"{",
"@link",
"ReadResultSetImpl",
"}",
"if",
"it",
"passes",
"the",
"{",
"@link",
"Predicate",
"}",
"and",
"{",
"@link",
"IFunction",
"}",
"with",
"which",
"it... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/ringbuffer/impl/ReadResultSetImpl.java#L151-L175 |
JoeKerouac/utils | src/main/java/com/joe/utils/concurrent/ThreadUtil.java | ThreadUtil.getOrCreatePool | public static ExecutorService getOrCreatePool(PoolType type, String format) {
"""
从缓存中查找指定类型的线程池,如果存在那么直接返回,如果不存在那么创建返回
@param type 线程池类型
@param format 线程名格式,格式为:format-%d,其中%d将被替换为从0开始的数字序列,不能为null
@return 指定类型的线程池
"""
ExecutorService service = cache.get(type);
if (service == null || se... | java | public static ExecutorService getOrCreatePool(PoolType type, String format) {
ExecutorService service = cache.get(type);
if (service == null || service.isTerminated() || service.isShutdown()) {
//检查是否符合格式
String.format(format, 0);
synchronized (cache) {
... | [
"public",
"static",
"ExecutorService",
"getOrCreatePool",
"(",
"PoolType",
"type",
",",
"String",
"format",
")",
"{",
"ExecutorService",
"service",
"=",
"cache",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"service",
"==",
"null",
"||",
"service",
".",
"... | 从缓存中查找指定类型的线程池,如果存在那么直接返回,如果不存在那么创建返回
@param type 线程池类型
@param format 线程名格式,格式为:format-%d,其中%d将被替换为从0开始的数字序列,不能为null
@return 指定类型的线程池 | [
"从缓存中查找指定类型的线程池,如果存在那么直接返回,如果不存在那么创建返回"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/concurrent/ThreadUtil.java#L67-L83 |
pravega/pravega | common/src/main/java/io/pravega/common/util/ByteArraySegment.java | ByteArraySegment.copyFrom | public void copyFrom(ByteArraySegment source, int targetOffset, int length) {
"""
Copies a specified number of bytes from the given ByteArraySegment into this ByteArraySegment.
@param source The ByteArraySegment to copy bytes from.
@param targetOffset The offset within this ByteArraySegment to start copy... | java | public void copyFrom(ByteArraySegment source, int targetOffset, int length) {
Preconditions.checkState(!this.readOnly, "Cannot modify a read-only ByteArraySegment.");
Exceptions.checkArrayRange(targetOffset, length, this.length, "index", "values.length");
Preconditions.checkElementIndex(length, ... | [
"public",
"void",
"copyFrom",
"(",
"ByteArraySegment",
"source",
",",
"int",
"targetOffset",
",",
"int",
"length",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"this",
".",
"readOnly",
",",
"\"Cannot modify a read-only ByteArraySegment.\"",
")",
";",
"E... | Copies a specified number of bytes from the given ByteArraySegment into this ByteArraySegment.
@param source The ByteArraySegment to copy bytes from.
@param targetOffset The offset within this ByteArraySegment to start copying at.
@param length The number of bytes to copy.
@throws IllegalStateException ... | [
"Copies",
"a",
"specified",
"number",
"of",
"bytes",
"from",
"the",
"given",
"ByteArraySegment",
"into",
"this",
"ByteArraySegment",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/ByteArraySegment.java#L180-L186 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.stringFromFile | public static String stringFromFile(String filename, String encoding) {
"""
Returns the contents of a file as a single string. The string may be
empty, if the file is empty. If there is an IOException, it is caught
and null is returned. Encoding can also be specified.
"""
try {
StringBuilder s... | java | public static String stringFromFile(String filename, String encoding) {
try {
StringBuilder sb = new StringBuilder();
BufferedReader in = new BufferedReader(new EncodingFileReader(filename,encoding));
String line;
while ((line = in.readLine()) != null) {
sb.append(line);
... | [
"public",
"static",
"String",
"stringFromFile",
"(",
"String",
"filename",
",",
"String",
"encoding",
")",
"{",
"try",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"BufferedReader",
"in",
"=",
"new",
"BufferedReader",
"(",
"new",
"... | Returns the contents of a file as a single string. The string may be
empty, if the file is empty. If there is an IOException, it is caught
and null is returned. Encoding can also be specified. | [
"Returns",
"the",
"contents",
"of",
"a",
"file",
"as",
"a",
"single",
"string",
".",
"The",
"string",
"may",
"be",
"empty",
"if",
"the",
"file",
"is",
"empty",
".",
"If",
"there",
"is",
"an",
"IOException",
"it",
"is",
"caught",
"and",
"null",
"is",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L1198-L1214 |
structurizr/java | structurizr-core/src/com/structurizr/model/Model.java | Model.addSoftwareSystem | @Nonnull
public SoftwareSystem addSoftwareSystem(@Nullable Location location, @Nonnull String name, @Nullable String description) {
"""
Creates a software system and adds it to the model.
@param location the location of the software system (e.g. internal, external, etc)
@param name the name of th... | java | @Nonnull
public SoftwareSystem addSoftwareSystem(@Nullable Location location, @Nonnull String name, @Nullable String description) {
if (getSoftwareSystemWithName(name) == null) {
SoftwareSystem softwareSystem = new SoftwareSystem();
softwareSystem.setLocation(location);
s... | [
"@",
"Nonnull",
"public",
"SoftwareSystem",
"addSoftwareSystem",
"(",
"@",
"Nullable",
"Location",
"location",
",",
"@",
"Nonnull",
"String",
"name",
",",
"@",
"Nullable",
"String",
"description",
")",
"{",
"if",
"(",
"getSoftwareSystemWithName",
"(",
"name",
")... | Creates a software system and adds it to the model.
@param location the location of the software system (e.g. internal, external, etc)
@param name the name of the software system
@param description a short description of the software system
@return the SoftwareSystem instance created and added to the model (... | [
"Creates",
"a",
"software",
"system",
"and",
"adds",
"it",
"to",
"the",
"model",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Model.java#L68-L85 |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/RaidUtils.java | RaidUtils.sourcePathFromParityPath | public static Path sourcePathFromParityPath(Path parityPath, FileSystem fs)
throws IOException {
"""
returns the source file corresponding to a parity file
@throws IOException
"""
String parityPathStr = parityPath.toUri().getPath();
for (Codec codec : Codec.getCodecs()) {
String prefix ... | java | public static Path sourcePathFromParityPath(Path parityPath, FileSystem fs)
throws IOException {
String parityPathStr = parityPath.toUri().getPath();
for (Codec codec : Codec.getCodecs()) {
String prefix = codec.getParityPrefix();
if (parityPathStr.startsWith(prefix)) {
// Remove th... | [
"public",
"static",
"Path",
"sourcePathFromParityPath",
"(",
"Path",
"parityPath",
",",
"FileSystem",
"fs",
")",
"throws",
"IOException",
"{",
"String",
"parityPathStr",
"=",
"parityPath",
".",
"toUri",
"(",
")",
".",
"getPath",
"(",
")",
";",
"for",
"(",
"C... | returns the source file corresponding to a parity file
@throws IOException | [
"returns",
"the",
"source",
"file",
"corresponding",
"to",
"a",
"parity",
"file"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/RaidUtils.java#L375-L390 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/permission/GroupPermissionDao.java | GroupPermissionDao.selectAllPermissionsByGroupId | public void selectAllPermissionsByGroupId(DbSession dbSession, String organizationUuid, Integer groupId, ResultHandler resultHandler) {
"""
Select global and project permissions of a given group (Anyone group is NOT supported)
Each row returns a {@link GroupPermissionDto}
"""
mapper(dbSession).selectAllPe... | java | public void selectAllPermissionsByGroupId(DbSession dbSession, String organizationUuid, Integer groupId, ResultHandler resultHandler) {
mapper(dbSession).selectAllPermissionsByGroupId(organizationUuid, groupId, resultHandler);
} | [
"public",
"void",
"selectAllPermissionsByGroupId",
"(",
"DbSession",
"dbSession",
",",
"String",
"organizationUuid",
",",
"Integer",
"groupId",
",",
"ResultHandler",
"resultHandler",
")",
"{",
"mapper",
"(",
"dbSession",
")",
".",
"selectAllPermissionsByGroupId",
"(",
... | Select global and project permissions of a given group (Anyone group is NOT supported)
Each row returns a {@link GroupPermissionDto} | [
"Select",
"global",
"and",
"project",
"permissions",
"of",
"a",
"given",
"group",
"(",
"Anyone",
"group",
"is",
"NOT",
"supported",
")",
"Each",
"row",
"returns",
"a",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/GroupPermissionDao.java#L72-L74 |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.getXidImpl | public XidImpl getXidImpl(boolean createIfAbsent) {
"""
Returns a global identifier that represents the TransactionImpl's transaction.
@return The global transaction identifier.
"""
if (tc.isEntryEnabled())
Tr.entry(tc, "getXidImpl", new Object[] { this, createIfAbsent });
if (c... | java | public XidImpl getXidImpl(boolean createIfAbsent) {
if (tc.isEntryEnabled())
Tr.entry(tc, "getXidImpl", new Object[] { this, createIfAbsent });
if (createIfAbsent && (_xid == null)) {
// Create an XID as this transaction identifier.
_xid = new XidImpl(new TxPrimaryKe... | [
"public",
"XidImpl",
"getXidImpl",
"(",
"boolean",
"createIfAbsent",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"getXidImpl\"",
",",
"new",
"Object",
"[",
"]",
"{",
"this",
",",
"createIfAbsent"... | Returns a global identifier that represents the TransactionImpl's transaction.
@return The global transaction identifier. | [
"Returns",
"a",
"global",
"identifier",
"that",
"represents",
"the",
"TransactionImpl",
"s",
"transaction",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L2386-L2398 |
wildfly/wildfly-core | security-manager/src/main/java/org/wildfly/extension/security/manager/deployment/PermissionsParser.java | PermissionsParser.unexpectedAttribute | private static XMLStreamException unexpectedAttribute(final XMLStreamReader reader, final int index) {
"""
Gets an exception reporting an unexpected XML attribute.
@param reader a reference to the stream reader.
@param index the attribute index.
@return the constructed {@link javax.xml.stream.XMLStreamExcepti... | java | private static XMLStreamException unexpectedAttribute(final XMLStreamReader reader, final int index) {
return SecurityManagerLogger.ROOT_LOGGER.unexpectedAttribute(reader.getAttributeName(index), reader.getLocation());
} | [
"private",
"static",
"XMLStreamException",
"unexpectedAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"int",
"index",
")",
"{",
"return",
"SecurityManagerLogger",
".",
"ROOT_LOGGER",
".",
"unexpectedAttribute",
"(",
"reader",
".",
"getAttributeName"... | Gets an exception reporting an unexpected XML attribute.
@param reader a reference to the stream reader.
@param index the attribute index.
@return the constructed {@link javax.xml.stream.XMLStreamException}. | [
"Gets",
"an",
"exception",
"reporting",
"an",
"unexpected",
"XML",
"attribute",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/security-manager/src/main/java/org/wildfly/extension/security/manager/deployment/PermissionsParser.java#L274-L276 |
jbundle/webapp | base/src/main/java/org/jbundle/util/webapp/base/MultipleHttpServiceActivator.java | MultipleHttpServiceActivator.shutdownService | @Override
public boolean shutdownService(Object service, BundleContext context) {
"""
Start this service.
Override this to do all the startup.
@return true if successful.
"""
for (String alias : getAliases())
{
HttpServiceTracker serviceTracker = getServiceTracker(context, Bas... | java | @Override
public boolean shutdownService(Object service, BundleContext context)
{
for (String alias : getAliases())
{
HttpServiceTracker serviceTracker = getServiceTracker(context, BaseWebappServlet.ALIAS, alias);
if (serviceTracker != null)
serviceTracker... | [
"@",
"Override",
"public",
"boolean",
"shutdownService",
"(",
"Object",
"service",
",",
"BundleContext",
"context",
")",
"{",
"for",
"(",
"String",
"alias",
":",
"getAliases",
"(",
")",
")",
"{",
"HttpServiceTracker",
"serviceTracker",
"=",
"getServiceTracker",
... | Start this service.
Override this to do all the startup.
@return true if successful. | [
"Start",
"this",
"service",
".",
"Override",
"this",
"to",
"do",
"all",
"the",
"startup",
"."
] | train | https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/MultipleHttpServiceActivator.java#L53-L63 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.setPerspectiveOffCenter | public Matrix4f setPerspectiveOffCenter(float fovy, float offAngleX, float offAngleY,
float aspect, float zNear, float zFar) {
"""
Set this matrix to be an asymmetric off-center perspective projection frustum transformation for a right-handed
coordinate system using OpenGL's NDC z range of <code>[-1..... | java | public Matrix4f setPerspectiveOffCenter(float fovy, float offAngleX, float offAngleY,
float aspect, float zNear, float zFar) {
return setPerspectiveOffCenter(fovy, offAngleX, offAngleY, aspect, zNear, zFar, false);
} | [
"public",
"Matrix4f",
"setPerspectiveOffCenter",
"(",
"float",
"fovy",
",",
"float",
"offAngleX",
",",
"float",
"offAngleY",
",",
"float",
"aspect",
",",
"float",
"zNear",
",",
"float",
"zFar",
")",
"{",
"return",
"setPerspectiveOffCenter",
"(",
"fovy",
",",
"... | Set this matrix to be an asymmetric off-center perspective projection frustum transformation for a right-handed
coordinate system using OpenGL's NDC z range of <code>[-1..+1]</code>.
<p>
The given angles <code>offAngleX</code> and <code>offAngleY</code> are the horizontal and vertical angles between
the line of sight a... | [
"Set",
"this",
"matrix",
"to",
"be",
"an",
"asymmetric",
"off",
"-",
"center",
"perspective",
"projection",
"frustum",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L9966-L9969 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/renderer/QuadBasedLineStripRenderer.java | QuadBasedLineStripRenderer.renderLines | public void renderLines(float[] points, int count) {
"""
Render the lines applying antialiasing if required
@param points The points to be rendered as lines
@param count The number of points to render
"""
if (antialias) {
GL.glEnable(SGL.GL_POLYGON_SMOOTH);
renderLinesImpl(points,count,width+1f)... | java | public void renderLines(float[] points, int count) {
if (antialias) {
GL.glEnable(SGL.GL_POLYGON_SMOOTH);
renderLinesImpl(points,count,width+1f);
}
GL.glDisable(SGL.GL_POLYGON_SMOOTH);
renderLinesImpl(points,count,width);
if (antialias) {
GL.glEnable(SGL.GL_POLYGON_SMOOTH);
}
} | [
"public",
"void",
"renderLines",
"(",
"float",
"[",
"]",
"points",
",",
"int",
"count",
")",
"{",
"if",
"(",
"antialias",
")",
"{",
"GL",
".",
"glEnable",
"(",
"SGL",
".",
"GL_POLYGON_SMOOTH",
")",
";",
"renderLinesImpl",
"(",
"points",
",",
"count",
"... | Render the lines applying antialiasing if required
@param points The points to be rendered as lines
@param count The number of points to render | [
"Render",
"the",
"lines",
"applying",
"antialiasing",
"if",
"required"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/renderer/QuadBasedLineStripRenderer.java#L119-L131 |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/MonitoringProxy.java | MonitoringProxy.createProxy | public static <T> T createProxy(T facade, String name) {
"""
Création d'un proxy de monitoring pour une façade, en spécifiant le nom qui sera affiché dans le monitoring.
@param <T> Type de la façade (une interface en général).
@param facade Instance de la façade
@param name override of the interface name in the... | java | public static <T> T createProxy(T facade, String name) {
return createProxy(facade, new MonitoringProxy(facade, name));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"createProxy",
"(",
"T",
"facade",
",",
"String",
"name",
")",
"{",
"return",
"createProxy",
"(",
"facade",
",",
"new",
"MonitoringProxy",
"(",
"facade",
",",
"name",
")",
")",
";",
"}"
] | Création d'un proxy de monitoring pour une façade, en spécifiant le nom qui sera affiché dans le monitoring.
@param <T> Type de la façade (une interface en général).
@param facade Instance de la façade
@param name override of the interface name in the statistics
@return Proxy de la façade | [
"Création",
"d",
"un",
"proxy",
"de",
"monitoring",
"pour",
"une",
"façade",
"en",
"spécifiant",
"le",
"nom",
"qui",
"sera",
"affiché",
"dans",
"le",
"monitoring",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/MonitoringProxy.java#L116-L118 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/project/JdbcProjectImpl.java | JdbcProjectImpl.createNewProject | @Override
public synchronized Project createNewProject(final String name, final String description,
final User creator)
throws ProjectManagerException {
"""
Creates a Project in the db.
It will throw an exception if it finds an active project of the same name, or the SQL fails
"""
final Pr... | java | @Override
public synchronized Project createNewProject(final String name, final String description,
final User creator)
throws ProjectManagerException {
final ProjectResultHandler handler = new ProjectResultHandler();
// Check if the same project name exists.
try {
final List<Project> p... | [
"@",
"Override",
"public",
"synchronized",
"Project",
"createNewProject",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"description",
",",
"final",
"User",
"creator",
")",
"throws",
"ProjectManagerException",
"{",
"final",
"ProjectResultHandler",
"handler",... | Creates a Project in the db.
It will throw an exception if it finds an active project of the same name, or the SQL fails | [
"Creates",
"a",
"Project",
"in",
"the",
"db",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/project/JdbcProjectImpl.java#L203-L243 |
beanshell/beanshell | src/main/java/bsh/ExternalNameSpace.java | ExternalNameSpace.getVariableImpl | protected Variable getVariableImpl( String name, boolean recurse )
throws UtilEvalError {
"""
/*
Notes: This implementation of getVariableImpl handles the following
cases:
1) var in map not in local scope - var was added through map
2) var in map and in local scope - var was added through namespace
3)... | java | protected Variable getVariableImpl( String name, boolean recurse )
throws UtilEvalError
{
// check the external map for the variable name
Object value = externalMap.get( name );
if ( value == null && externalMap.containsKey( name ) )
value = Primitive.NULL;
Vari... | [
"protected",
"Variable",
"getVariableImpl",
"(",
"String",
"name",
",",
"boolean",
"recurse",
")",
"throws",
"UtilEvalError",
"{",
"// check the external map for the variable name",
"Object",
"value",
"=",
"externalMap",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",... | /*
Notes: This implementation of getVariableImpl handles the following
cases:
1) var in map not in local scope - var was added through map
2) var in map and in local scope - var was added through namespace
3) var not in map but in local scope - var was removed via map
4) var not in map and not in local scope - non-exis... | [
"/",
"*",
"Notes",
":",
"This",
"implementation",
"of",
"getVariableImpl",
"handles",
"the",
"following",
"cases",
":",
"1",
")",
"var",
"in",
"map",
"not",
"in",
"local",
"scope",
"-",
"var",
"was",
"added",
"through",
"map",
"2",
")",
"var",
"in",
"m... | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/ExternalNameSpace.java#L147-L182 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/proxy/SessionHolder.java | SessionHolder.doProcess | public void doProcess(InputStream in, PrintWriter out, Map<String, Object> properties)
throws RemoteException {
"""
Handle the command send from my client peer.
@param in The (optional) Inputstream to get the params from.
@param out The stream to write the results.
"""
String strCommand = thi... | java | public void doProcess(InputStream in, PrintWriter out, Map<String, Object> properties)
throws RemoteException
{
String strCommand = this.getProperty(REMOTE_COMMAND, properties);
if (GET_REMOTE_TABLE.equals(strCommand))
{
String strName = this.getNextStringParam(in, NAME, ... | [
"public",
"void",
"doProcess",
"(",
"InputStream",
"in",
",",
"PrintWriter",
"out",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"throws",
"RemoteException",
"{",
"String",
"strCommand",
"=",
"this",
".",
"getProperty",
"(",
"REMOTE_COMMAN... | Handle the command send from my client peer.
@param in The (optional) Inputstream to get the params from.
@param out The stream to write the results. | [
"Handle",
"the",
"command",
"send",
"from",
"my",
"client",
"peer",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/proxy/SessionHolder.java#L60-L82 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/StatementBuilder.java | StatementBuilder.prepareStatementInfo | public StatementInfo prepareStatementInfo() throws SQLException {
"""
Build and return all of the information about the prepared statement. See {@link StatementInfo} for more details.
"""
List<ArgumentHolder> argList = new ArrayList<ArgumentHolder>();
String statement = buildStatementString(argList);
ret... | java | public StatementInfo prepareStatementInfo() throws SQLException {
List<ArgumentHolder> argList = new ArrayList<ArgumentHolder>();
String statement = buildStatementString(argList);
return new StatementInfo(statement, argList);
} | [
"public",
"StatementInfo",
"prepareStatementInfo",
"(",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"ArgumentHolder",
">",
"argList",
"=",
"new",
"ArrayList",
"<",
"ArgumentHolder",
">",
"(",
")",
";",
"String",
"statement",
"=",
"buildStatementString",
"(",
... | Build and return all of the information about the prepared statement. See {@link StatementInfo} for more details. | [
"Build",
"and",
"return",
"all",
"of",
"the",
"information",
"about",
"the",
"prepared",
"statement",
".",
"See",
"{"
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementBuilder.java#L101-L105 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java | DiagnosticsInner.getHostingEnvironmentDetectorResponseAsync | public Observable<DetectorResponseInner> getHostingEnvironmentDetectorResponseAsync(String resourceGroupName, String name, String detectorName, DateTime startTime, DateTime endTime, String timeGrain) {
"""
Get Hosting Environment Detector Response.
Get Hosting Environment Detector Response.
@param resourceGrou... | java | public Observable<DetectorResponseInner> getHostingEnvironmentDetectorResponseAsync(String resourceGroupName, String name, String detectorName, DateTime startTime, DateTime endTime, String timeGrain) {
return getHostingEnvironmentDetectorResponseWithServiceResponseAsync(resourceGroupName, name, detectorName, st... | [
"public",
"Observable",
"<",
"DetectorResponseInner",
">",
"getHostingEnvironmentDetectorResponseAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"detectorName",
",",
"DateTime",
"startTime",
",",
"DateTime",
"endTime",
",",
"String",
"t... | Get Hosting Environment Detector Response.
Get Hosting Environment Detector Response.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name App Service Environment Name
@param detectorName Detector Resource Name
@param startTime Start Time
@param endTime End Time
@param timeGra... | [
"Get",
"Hosting",
"Environment",
"Detector",
"Response",
".",
"Get",
"Hosting",
"Environment",
"Detector",
"Response",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java#L467-L474 |
knowm/XChange | xchange-exx/src/main/java/org/knowm/xchange/exx/utils/AuthUtils.java | AuthUtils.setApiAndSecretKey | public static void setApiAndSecretKey(ExchangeSpecification exchangeSpec, String prefix) {
"""
Read the API & Secret key from a resource called {@code prefix}-{@code secret.keys}. NOTE: This
file MUST NEVER be commited to source control. It is therefore added to .gitignore.
"""
Properties props = getSecr... | java | public static void setApiAndSecretKey(ExchangeSpecification exchangeSpec, String prefix) {
Properties props = getSecretProperties(prefix);
if (props != null) {
exchangeSpec.setApiKey(props.getProperty("apiKey"));
exchangeSpec.setSecretKey(props.getProperty("secretKey"));
}
} | [
"public",
"static",
"void",
"setApiAndSecretKey",
"(",
"ExchangeSpecification",
"exchangeSpec",
",",
"String",
"prefix",
")",
"{",
"Properties",
"props",
"=",
"getSecretProperties",
"(",
"prefix",
")",
";",
"if",
"(",
"props",
"!=",
"null",
")",
"{",
"exchangeSp... | Read the API & Secret key from a resource called {@code prefix}-{@code secret.keys}. NOTE: This
file MUST NEVER be commited to source control. It is therefore added to .gitignore. | [
"Read",
"the",
"API",
"&",
"Secret",
"key",
"from",
"a",
"resource",
"called",
"{"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-exx/src/main/java/org/knowm/xchange/exx/utils/AuthUtils.java#L35-L43 |
zaproxy/zaproxy | src/org/zaproxy/zap/control/AddOnLoaderUtils.java | AddOnLoaderUtils.loadAndInstantiateClass | public static <T> T loadAndInstantiateClass(
AddOnClassLoader addOnClassLoader,
String classname,
Class<T> clazz,
String type) {
"""
Loads, using the given {@code addOnClassLoader}, and creates an instance with the given {@code classname} of the
(expected) given {@c... | java | public static <T> T loadAndInstantiateClass(
AddOnClassLoader addOnClassLoader,
String classname,
Class<T> clazz,
String type) {
validateNotNull(addOnClassLoader, "addOnClassLoader");
validateNotNull(classname, "classname");
validateNotNull(clazz, ... | [
"public",
"static",
"<",
"T",
">",
"T",
"loadAndInstantiateClass",
"(",
"AddOnClassLoader",
"addOnClassLoader",
",",
"String",
"classname",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"type",
")",
"{",
"validateNotNull",
"(",
"addOnClassLoader",
",",
... | Loads, using the given {@code addOnClassLoader}, and creates an instance with the given {@code classname} of the
(expected) given {@code clazz}. The {@code type} is used in error log messages, to indicate the expected type being
loaded.
@param <T> the type of the class that will be instantiated
@param addOnClassLoader... | [
"Loads",
"using",
"the",
"given",
"{",
"@code",
"addOnClassLoader",
"}",
"and",
"creates",
"an",
"instance",
"with",
"the",
"given",
"{",
"@code",
"classname",
"}",
"of",
"the",
"(",
"expected",
")",
"given",
"{",
"@code",
"clazz",
"}",
".",
"The",
"{",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/control/AddOnLoaderUtils.java#L58-L69 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/MethodUtils.java | MethodUtils.getAccessibleMethod | public static Method getAccessibleMethod(Class<?> clazz, String methodName, Class<?>[] paramTypes) {
"""
<p>Return an accessible method (that is, one that can be invoked via
reflection) with given name and parameters. If no such method
can be found, return {@code null}.
This is just a convenient wrapper for
{... | java | public static Method getAccessibleMethod(Class<?> clazz, String methodName, Class<?>[] paramTypes) {
MethodDescriptor md = new MethodDescriptor(clazz, methodName, paramTypes, true);
Method[] result = cache.get(md);
if (result == null) {
try {
Method method = getAccess... | [
"public",
"static",
"Method",
"getAccessibleMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
")",
"{",
"MethodDescriptor",
"md",
"=",
"new",
"MethodDescriptor",
"(",
"clazz",
"... | <p>Return an accessible method (that is, one that can be invoked via
reflection) with given name and parameters. If no such method
can be found, return {@code null}.
This is just a convenient wrapper for
{@link #getAccessibleMethod(Method method)}.</p>
@param clazz get method from this class
@param methodName get met... | [
"<p",
">",
"Return",
"an",
"accessible",
"method",
"(",
"that",
"is",
"one",
"that",
"can",
"be",
"invoked",
"via",
"reflection",
")",
"with",
"given",
"name",
"and",
"parameters",
".",
"If",
"no",
"such",
"method",
"can",
"be",
"found",
"return",
"{",
... | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/MethodUtils.java#L640-L653 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/distort/DistortImageOps.java | DistortImageOps.boundBox | public static RectangleLength2D_I32 boundBox( int srcWidth , int srcHeight ,
int dstWidth , int dstHeight ,
Point2D_F32 work,
PixelTransform<Point2D_F32> transform ) {
"""
Finds an axis-aligned bounding box which would contain a image after it has been transformed.
A sani... | java | public static RectangleLength2D_I32 boundBox( int srcWidth , int srcHeight ,
int dstWidth , int dstHeight ,
Point2D_F32 work,
PixelTransform<Point2D_F32> transform )
{
RectangleLength2D_I32 ret = boundBox(srcWidth,srcHeight,work,transform);
int x0 = ret.x0;
int y0 = ret... | [
"public",
"static",
"RectangleLength2D_I32",
"boundBox",
"(",
"int",
"srcWidth",
",",
"int",
"srcHeight",
",",
"int",
"dstWidth",
",",
"int",
"dstHeight",
",",
"Point2D_F32",
"work",
",",
"PixelTransform",
"<",
"Point2D_F32",
">",
"transform",
")",
"{",
"Rectang... | Finds an axis-aligned bounding box which would contain a image after it has been transformed.
A sanity check is done to made sure it is contained inside the destination image's bounds.
If it is totally outside then a rectangle with negative width or height is returned.
@param srcWidth Width of the source image
@param ... | [
"Finds",
"an",
"axis",
"-",
"aligned",
"bounding",
"box",
"which",
"would",
"contain",
"a",
"image",
"after",
"it",
"has",
"been",
"transformed",
".",
"A",
"sanity",
"check",
"is",
"done",
"to",
"made",
"sure",
"it",
"is",
"contained",
"inside",
"the",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/DistortImageOps.java#L289-L307 |
OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/client/ClientWorldConnection.java | ClientWorldConnection.getStreamRequest | public synchronized StepResponse getStreamRequest(final String idRegex,
final long start, final long interval, String... attributes) {
"""
Sends a stream request to the world model for the specified identifier and
attribute regular expressions, beginning with data at time {@code start},
and updating no mor... | java | public synchronized StepResponse getStreamRequest(final String idRegex,
final long start, final long interval, String... attributes) {
StreamRequestMessage req = new StreamRequestMessage();
req.setIdRegex(idRegex);
req.setBeginTimestamp(start);
req.setUpdateInterval(interval);
if (attributes !... | [
"public",
"synchronized",
"StepResponse",
"getStreamRequest",
"(",
"final",
"String",
"idRegex",
",",
"final",
"long",
"start",
",",
"final",
"long",
"interval",
",",
"String",
"...",
"attributes",
")",
"{",
"StreamRequestMessage",
"req",
"=",
"new",
"StreamReques... | Sends a stream request to the world model for the specified identifier and
attribute regular expressions, beginning with data at time {@code start},
and updating no more frequently than every {@code interval} milliseconds.
@param idRegex
the regular expression for matching identifiers
@param start
the earliest data to... | [
"Sends",
"a",
"stream",
"request",
"to",
"the",
"world",
"model",
"for",
"the",
"specified",
"identifier",
"and",
"attribute",
"regular",
"expressions",
"beginning",
"with",
"data",
"at",
"time",
"{",
"@code",
"start",
"}",
"and",
"updating",
"no",
"more",
"... | train | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/client/ClientWorldConnection.java#L396-L427 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/PropertiesField.java | PropertiesField.setProperty | public int setProperty(String strProperty, String strValue, boolean bDisplayOption, int iMoveMode) {
"""
Set this property in the user's property area.
@param strProperty The property key.
@param strValue The property value.
@param iDisplayOption If true, display the new field.
@param iMoveMove The move mode.
... | java | public int setProperty(String strProperty, String strValue, boolean bDisplayOption, int iMoveMode)
{
if (m_propertiesCache == null)
m_propertiesCache = this.loadProperties();
boolean bChanged = false;
// If strValue == null, delete; if = '', it's okay (key='') [a blank property]!... | [
"public",
"int",
"setProperty",
"(",
"String",
"strProperty",
",",
"String",
"strValue",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"if",
"(",
"m_propertiesCache",
"==",
"null",
")",
"m_propertiesCache",
"=",
"this",
".",
"loadPropertie... | Set this property in the user's property area.
@param strProperty The property key.
@param strValue The property value.
@param iDisplayOption If true, display the new field.
@param iMoveMove The move mode.
@return An error code (NORMAL_RETURN for success). | [
"Set",
"this",
"property",
"in",
"the",
"user",
"s",
"property",
"area",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/PropertiesField.java#L140-L171 |
datacleaner/DataCleaner | desktop/ui/src/main/java/org/datacleaner/widgets/tabs/Packer.java | Packer.fillboth | public Packer fillboth(final double wtx, final double wty) {
"""
Add fill=BOTH, weighty=1, weightx=1 to the constraints for the current
component.
"""
gc.fill = GridBagConstraints.BOTH;
gc.weightx = wtx;
gc.weighty = wty;
setConstraints(comp, gc);
return this;
} | java | public Packer fillboth(final double wtx, final double wty) {
gc.fill = GridBagConstraints.BOTH;
gc.weightx = wtx;
gc.weighty = wty;
setConstraints(comp, gc);
return this;
} | [
"public",
"Packer",
"fillboth",
"(",
"final",
"double",
"wtx",
",",
"final",
"double",
"wty",
")",
"{",
"gc",
".",
"fill",
"=",
"GridBagConstraints",
".",
"BOTH",
";",
"gc",
".",
"weightx",
"=",
"wtx",
";",
"gc",
".",
"weighty",
"=",
"wty",
";",
"set... | Add fill=BOTH, weighty=1, weightx=1 to the constraints for the current
component. | [
"Add",
"fill",
"=",
"BOTH",
"weighty",
"=",
"1",
"weightx",
"=",
"1",
"to",
"the",
"constraints",
"for",
"the",
"current",
"component",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/ui/src/main/java/org/datacleaner/widgets/tabs/Packer.java#L775-L781 |
Azure/azure-sdk-for-java | mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java | SpatialAnchorsAccountsInner.regenerateKeys | public SpatialAnchorsAccountKeysInner regenerateKeys(String resourceGroupName, String spatialAnchorsAccountName, Integer serial) {
"""
Regenerate 1 Key of a Spatial Anchors Account.
@param resourceGroupName Name of an Azure resource group.
@param spatialAnchorsAccountName Name of an Mixed Reality Spatial Ancho... | java | public SpatialAnchorsAccountKeysInner regenerateKeys(String resourceGroupName, String spatialAnchorsAccountName, Integer serial) {
return regenerateKeysWithServiceResponseAsync(resourceGroupName, spatialAnchorsAccountName, serial).toBlocking().single().body();
} | [
"public",
"SpatialAnchorsAccountKeysInner",
"regenerateKeys",
"(",
"String",
"resourceGroupName",
",",
"String",
"spatialAnchorsAccountName",
",",
"Integer",
"serial",
")",
"{",
"return",
"regenerateKeysWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"spatialAnchorsAc... | Regenerate 1 Key of a Spatial Anchors Account.
@param resourceGroupName Name of an Azure resource group.
@param spatialAnchorsAccountName Name of an Mixed Reality Spatial Anchors Account.
@param serial serial of key to be regenerated
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Err... | [
"Regenerate",
"1",
"Key",
"of",
"a",
"Spatial",
"Anchors",
"Account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java#L874-L876 |
k0shk0sh/PermissionHelper | permission/src/main/java/com/fastaccess/permission/base/activity/BasePermissionActivity.java | BasePermissionActivity.onActivityResult | @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {
"""
Used to determine if the user accepted {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} or no.
<p/>
if you never passed the permission this method won't be called.
"""
permissionHelper.onActivityForRe... | java | @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {
permissionHelper.onActivityForResult(requestCode);
super.onActivityResult(requestCode, resultCode, data);
} | [
"@",
"Override",
"protected",
"void",
"onActivityResult",
"(",
"int",
"requestCode",
",",
"int",
"resultCode",
",",
"Intent",
"data",
")",
"{",
"permissionHelper",
".",
"onActivityForResult",
"(",
"requestCode",
")",
";",
"super",
".",
"onActivityResult",
"(",
"... | Used to determine if the user accepted {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} or no.
<p/>
if you never passed the permission this method won't be called. | [
"Used",
"to",
"determine",
"if",
"the",
"user",
"accepted",
"{"
] | train | https://github.com/k0shk0sh/PermissionHelper/blob/04edce2af49981d1dd321bcdfbe981a1000b29d7/permission/src/main/java/com/fastaccess/permission/base/activity/BasePermissionActivity.java#L122-L125 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/ScopeContext.java | ScopeContext.getSessionScope | public Session getSessionScope(PageContext pc, RefBoolean isNew) throws PageException {
"""
return the session Scope for this context (cfid,cftoken,contextname)
@param pc PageContext
@return session matching the context
@throws PageException
"""
if (pc.getSessionType() == Config.SESSION_TYPE_APPLICATION)... | java | public Session getSessionScope(PageContext pc, RefBoolean isNew) throws PageException {
if (pc.getSessionType() == Config.SESSION_TYPE_APPLICATION) return getCFSessionScope(pc, isNew);
return getJSessionScope(pc, isNew);
} | [
"public",
"Session",
"getSessionScope",
"(",
"PageContext",
"pc",
",",
"RefBoolean",
"isNew",
")",
"throws",
"PageException",
"{",
"if",
"(",
"pc",
".",
"getSessionType",
"(",
")",
"==",
"Config",
".",
"SESSION_TYPE_APPLICATION",
")",
"return",
"getCFSessionScope"... | return the session Scope for this context (cfid,cftoken,contextname)
@param pc PageContext
@return session matching the context
@throws PageException | [
"return",
"the",
"session",
"Scope",
"for",
"this",
"context",
"(",
"cfid",
"cftoken",
"contextname",
")"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java#L487-L490 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.suspendAsync | public Observable<Page<SiteInner>> suspendAsync(final String resourceGroupName, final String name) {
"""
Suspend an App Service Environment.
Suspend an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
... | java | public Observable<Page<SiteInner>> suspendAsync(final String resourceGroupName, final String name) {
return suspendWithServiceResponseAsync(resourceGroupName, name)
.map(new Func1<ServiceResponse<Page<SiteInner>>, Page<SiteInner>>() {
@Override
public Page<SiteInner> ... | [
"public",
"Observable",
"<",
"Page",
"<",
"SiteInner",
">",
">",
"suspendAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"suspendWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
... | Suspend an App Service Environment.
Suspend an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList&l... | [
"Suspend",
"an",
"App",
"Service",
"Environment",
".",
"Suspend",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L4491-L4499 |
database-rider/database-rider | rider-core/src/main/java/com/github/database/rider/core/dataset/DataSetExecutorImpl.java | DataSetExecutorImpl.performReplacements | private IDataSet performReplacements(IDataSet dataSet, List<Replacer> replacersList) {
"""
Perform replacements from all {@link Replacer} implementations to given dataset
registered in {@link #dbUnitConfig}.
"""
if (replacersList == null || replacersList.isEmpty())
return dataSet;
... | java | private IDataSet performReplacements(IDataSet dataSet, List<Replacer> replacersList) {
if (replacersList == null || replacersList.isEmpty())
return dataSet;
ReplacementDataSet replacementSet = new ReplacementDataSet(dataSet);
// convert to set to remove duplicates
Set<Repla... | [
"private",
"IDataSet",
"performReplacements",
"(",
"IDataSet",
"dataSet",
",",
"List",
"<",
"Replacer",
">",
"replacersList",
")",
"{",
"if",
"(",
"replacersList",
"==",
"null",
"||",
"replacersList",
".",
"isEmpty",
"(",
")",
")",
"return",
"dataSet",
";",
... | Perform replacements from all {@link Replacer} implementations to given dataset
registered in {@link #dbUnitConfig}. | [
"Perform",
"replacements",
"from",
"all",
"{"
] | train | https://github.com/database-rider/database-rider/blob/7545cc31118df9cfef3f89e27223b433a24fb5dd/rider-core/src/main/java/com/github/database/rider/core/dataset/DataSetExecutorImpl.java#L458-L471 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/ElevationUtil.java | ElevationUtil.getCornerBounds | private static RectF getCornerBounds(@NonNull final Orientation orientation, final int size) {
"""
Returns the bounds, which should be used to draw a shadow, which is located at a corner of an
elevated view.
@param orientation
The orientation of the shadow in relation to the elevated view as a value of the en... | java | private static RectF getCornerBounds(@NonNull final Orientation orientation, final int size) {
switch (orientation) {
case TOP_LEFT:
return new RectF(0, 0, 2 * size, 2 * size);
case TOP_RIGHT:
return new RectF(-size, 0, size, 2 * size);
case BO... | [
"private",
"static",
"RectF",
"getCornerBounds",
"(",
"@",
"NonNull",
"final",
"Orientation",
"orientation",
",",
"final",
"int",
"size",
")",
"{",
"switch",
"(",
"orientation",
")",
"{",
"case",
"TOP_LEFT",
":",
"return",
"new",
"RectF",
"(",
"0",
",",
"0... | Returns the bounds, which should be used to draw a shadow, which is located at a corner of an
elevated view.
@param orientation
The orientation of the shadow in relation to the elevated view as a value of the enum
{@link Orientation}. The orientation may either be <code>TOP_LEFT</code>,
<code>TOP_RIGHT</code>, <code>B... | [
"Returns",
"the",
"bounds",
"which",
"should",
"be",
"used",
"to",
"draw",
"a",
"shadow",
"which",
"is",
"located",
"at",
"a",
"corner",
"of",
"an",
"elevated",
"view",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L387-L400 |
j256/simplejmx | src/main/java/com/j256/simplejmx/client/JmxClient.java | JmxClient.getBeanNames | public Set<ObjectName> getBeanNames(String domain) throws JMException {
"""
Return a set of the various bean ObjectName objects associated with the Jmx server.
"""
checkClientConnected();
try {
return mbeanConn.queryNames(ObjectName.getInstance(domain + ":*"), null);
} catch (IOException e) {
throw... | java | public Set<ObjectName> getBeanNames(String domain) throws JMException {
checkClientConnected();
try {
return mbeanConn.queryNames(ObjectName.getInstance(domain + ":*"), null);
} catch (IOException e) {
throw createJmException("Problems querying for jmx bean names: " + e, e);
}
} | [
"public",
"Set",
"<",
"ObjectName",
">",
"getBeanNames",
"(",
"String",
"domain",
")",
"throws",
"JMException",
"{",
"checkClientConnected",
"(",
")",
";",
"try",
"{",
"return",
"mbeanConn",
".",
"queryNames",
"(",
"ObjectName",
".",
"getInstance",
"(",
"domai... | Return a set of the various bean ObjectName objects associated with the Jmx server. | [
"Return",
"a",
"set",
"of",
"the",
"various",
"bean",
"ObjectName",
"objects",
"associated",
"with",
"the",
"Jmx",
"server",
"."
] | train | https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/client/JmxClient.java#L228-L235 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplaceManager.java | CmsWorkplaceManager.checkWorkplaceRequest | public void checkWorkplaceRequest(HttpServletRequest request, CmsObject cms) {
"""
Checks whether the workplace is accessed through the workplace server, and sends an error message otherwise.<p>
@param request the request to check
@param cms the CmsObject to use
"""
try {
if ((OpenCms.... | java | public void checkWorkplaceRequest(HttpServletRequest request, CmsObject cms) {
try {
if ((OpenCms.getSiteManager().getSites().size() > 1)
&& !OpenCms.getSiteManager().isWorkplaceRequest(request)) {
// this is a multi site-configuration, but not a request to the confi... | [
"public",
"void",
"checkWorkplaceRequest",
"(",
"HttpServletRequest",
"request",
",",
"CmsObject",
"cms",
")",
"{",
"try",
"{",
"if",
"(",
"(",
"OpenCms",
".",
"getSiteManager",
"(",
")",
".",
"getSites",
"(",
")",
".",
"size",
"(",
")",
">",
"1",
")",
... | Checks whether the workplace is accessed through the workplace server, and sends an error message otherwise.<p>
@param request the request to check
@param cms the CmsObject to use | [
"Checks",
"whether",
"the",
"workplace",
"is",
"accessed",
"through",
"the",
"workplace",
"server",
"and",
"sends",
"an",
"error",
"message",
"otherwise",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceManager.java#L675-L699 |
fommil/matrix-toolkits-java | src/main/java/no/uib/cipr/matrix/io/MatrixVectorReader.java | MatrixVectorReader.readVectorCoordinateSize | public VectorSize readVectorCoordinateSize() throws IOException {
"""
Reads in the size of a coordinate vector. Skips initial comments
"""
int size = getInt(), numEntries = getInt();
return new VectorSize(size, numEntries);
} | java | public VectorSize readVectorCoordinateSize() throws IOException {
int size = getInt(), numEntries = getInt();
return new VectorSize(size, numEntries);
} | [
"public",
"VectorSize",
"readVectorCoordinateSize",
"(",
")",
"throws",
"IOException",
"{",
"int",
"size",
"=",
"getInt",
"(",
")",
",",
"numEntries",
"=",
"getInt",
"(",
")",
";",
"return",
"new",
"VectorSize",
"(",
"size",
",",
"numEntries",
")",
";",
"}... | Reads in the size of a coordinate vector. Skips initial comments | [
"Reads",
"in",
"the",
"size",
"of",
"a",
"coordinate",
"vector",
".",
"Skips",
"initial",
"comments"
] | train | https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/io/MatrixVectorReader.java#L318-L322 |
google/closure-compiler | src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java | TypeTransformationParser.validConditionalExpression | private boolean validConditionalExpression(Node expr) {
"""
A conditional type transformation expression must be of the
form cond(BoolExp, TTLExp, TTLExp)
"""
// The expression must have four children:
// - The cond keyword
// - A boolean expression
// - A type transformation expression with t... | java | private boolean validConditionalExpression(Node expr) {
// The expression must have four children:
// - The cond keyword
// - A boolean expression
// - A type transformation expression with the 'if' branch
// - A type transformation expression with the 'else' branch
if (!checkParameterCount(expr... | [
"private",
"boolean",
"validConditionalExpression",
"(",
"Node",
"expr",
")",
"{",
"// The expression must have four children:",
"// - The cond keyword",
"// - A boolean expression",
"// - A type transformation expression with the 'if' branch",
"// - A type transformation expression with the... | A conditional type transformation expression must be of the
form cond(BoolExp, TTLExp, TTLExp) | [
"A",
"conditional",
"type",
"transformation",
"expression",
"must",
"be",
"of",
"the",
"form",
"cond",
"(",
"BoolExp",
"TTLExp",
"TTLExp",
")"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java#L605-L628 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.getMethodByName | public static Method getMethodByName(Class<?> clazz, boolean ignoreCase, String methodName) throws SecurityException {
"""
按照方法名查找指定方法名的方法,只返回匹配到的第一个方法,如果找不到对应的方法则返回<code>null</code>
<p>
此方法只检查方法名是否一致,并不检查参数的一致性。
</p>
@param clazz 类,如果为{@code null}返回{@code null}
@param ignoreCase 是否忽略大小写
@param methodNam... | java | public static Method getMethodByName(Class<?> clazz, boolean ignoreCase, String methodName) throws SecurityException {
if (null == clazz || StrUtil.isBlank(methodName)) {
return null;
}
final Method[] methods = getMethods(clazz);
if (ArrayUtil.isNotEmpty(methods)) {
for (Method method : methods) {... | [
"public",
"static",
"Method",
"getMethodByName",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"boolean",
"ignoreCase",
",",
"String",
"methodName",
")",
"throws",
"SecurityException",
"{",
"if",
"(",
"null",
"==",
"clazz",
"||",
"StrUtil",
".",
"isBlank",
"(",... | 按照方法名查找指定方法名的方法,只返回匹配到的第一个方法,如果找不到对应的方法则返回<code>null</code>
<p>
此方法只检查方法名是否一致,并不检查参数的一致性。
</p>
@param clazz 类,如果为{@code null}返回{@code null}
@param ignoreCase 是否忽略大小写
@param methodName 方法名,如果为空字符串返回{@code null}
@return 方法
@throws SecurityException 无权访问抛出异常
@since 4.3.2 | [
"按照方法名查找指定方法名的方法,只返回匹配到的第一个方法,如果找不到对应的方法则返回<code",
">",
"null<",
"/",
"code",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L516-L530 |
lucee/Lucee | core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java | ResourceUtil.checkCopyToOK | public static void checkCopyToOK(Resource source, Resource target) throws IOException {
"""
check if copying a file is ok with the rules for the Resource interface, to not change this
rules.
@param source
@param target
@throws IOException
"""
if (!source.isFile()) {
if (source.isDirectory()) throw ... | java | public static void checkCopyToOK(Resource source, Resource target) throws IOException {
if (!source.isFile()) {
if (source.isDirectory()) throw new IOException("can't copy [" + source.getPath() + "] to [" + target.getPath() + "], source is a directory");
throw new IOException("can't copy [" + source.getPath(... | [
"public",
"static",
"void",
"checkCopyToOK",
"(",
"Resource",
"source",
",",
"Resource",
"target",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"source",
".",
"isFile",
"(",
")",
")",
"{",
"if",
"(",
"source",
".",
"isDirectory",
"(",
")",
")",
"... | check if copying a file is ok with the rules for the Resource interface, to not change this
rules.
@param source
@param target
@throws IOException | [
"check",
"if",
"copying",
"a",
"file",
"is",
"ok",
"with",
"the",
"rules",
"for",
"the",
"Resource",
"interface",
"to",
"not",
"change",
"this",
"rules",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java#L1322-L1330 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.BrayCurtis | public static double BrayCurtis(double x1, double y1, double x2, double y2) {
"""
Gets the Bray Curtis distance between two points.
@param x1 X1 axis coordinate.
@param y1 Y1 axis coordinate.
@param x2 X2 axis coordinate.
@param y2 X2 axis coordinate.
@return The Bray Curtis distance between x and y.
""... | java | public static double BrayCurtis(double x1, double y1, double x2, double y2) {
double sumN = Math.abs(x1 - x2) + Math.abs(y1 - y2);
double sumP = Math.abs(x1 + x2) + Math.abs(y1 + y2);
return sumN / sumP;
} | [
"public",
"static",
"double",
"BrayCurtis",
"(",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x2",
",",
"double",
"y2",
")",
"{",
"double",
"sumN",
"=",
"Math",
".",
"abs",
"(",
"x1",
"-",
"x2",
")",
"+",
"Math",
".",
"abs",
"(",
"y1",
"-... | Gets the Bray Curtis distance between two points.
@param x1 X1 axis coordinate.
@param y1 Y1 axis coordinate.
@param x2 X2 axis coordinate.
@param y2 X2 axis coordinate.
@return The Bray Curtis distance between x and y. | [
"Gets",
"the",
"Bray",
"Curtis",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L107-L112 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/xml/XmlRepositoryFactory.java | XmlRepositoryFactory.findElement | private static Element findElement(Document document, String name) {
"""
Searches XML document and returns specified query as {@link Element}
@param document document which would be read
@param name query name to search
@return query as {@link Element}
"""
Element result = null;
Li... | java | private static Element findElement(Document document, String name) {
Element result = null;
List<Element> elementList = getElements(document);
for (Element element : elementList) {
if (element.getAttribute("id").equalsIgnoreCase(name) == true) {
result = elem... | [
"private",
"static",
"Element",
"findElement",
"(",
"Document",
"document",
",",
"String",
"name",
")",
"{",
"Element",
"result",
"=",
"null",
";",
"List",
"<",
"Element",
">",
"elementList",
"=",
"getElements",
"(",
"document",
")",
";",
"for",
"(",
"Elem... | Searches XML document and returns specified query as {@link Element}
@param document document which would be read
@param name query name to search
@return query as {@link Element} | [
"Searches",
"XML",
"document",
"and",
"returns",
"specified",
"query",
"as",
"{",
"@link",
"Element",
"}"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/xml/XmlRepositoryFactory.java#L426-L439 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/ResourceHealthMetadatasInner.java | ResourceHealthMetadatasInner.listBySiteWithServiceResponseAsync | public Observable<ServiceResponse<Page<ResourceHealthMetadataInner>>> listBySiteWithServiceResponseAsync(final String resourceGroupName, final String name) {
"""
Gets the category of ResourceHealthMetadata to use for the given site as a collection.
Gets the category of ResourceHealthMetadata to use for the given ... | java | public Observable<ServiceResponse<Page<ResourceHealthMetadataInner>>> listBySiteWithServiceResponseAsync(final String resourceGroupName, final String name) {
return listBySiteSinglePageAsync(resourceGroupName, name)
.concatMap(new Func1<ServiceResponse<Page<ResourceHealthMetadataInner>>, Observable<... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"ResourceHealthMetadataInner",
">",
">",
">",
"listBySiteWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"listBySiteSinglePageAs... | Gets the category of ResourceHealthMetadata to use for the given site as a collection.
Gets the category of ResourceHealthMetadata to use for the given site as a collection.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of web app.
@throws IllegalArgumentException ... | [
"Gets",
"the",
"category",
"of",
"ResourceHealthMetadata",
"to",
"use",
"for",
"the",
"given",
"site",
"as",
"a",
"collection",
".",
"Gets",
"the",
"category",
"of",
"ResourceHealthMetadata",
"to",
"use",
"for",
"the",
"given",
"site",
"as",
"a",
"collection",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/ResourceHealthMetadatasInner.java#L406-L418 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.getDisplayVariant | public static String getDisplayVariant(String localeID, String displayLocaleID) {
"""
<strong>[icu]</strong> Returns a locale's variant localized for display in the provided locale.
This is a cover for the ICU4C API.
@param localeID the id of the locale whose variant will be displayed
@param displayLocaleID the... | java | public static String getDisplayVariant(String localeID, String displayLocaleID){
return getDisplayVariantInternal(new ULocale(localeID), new ULocale(displayLocaleID));
} | [
"public",
"static",
"String",
"getDisplayVariant",
"(",
"String",
"localeID",
",",
"String",
"displayLocaleID",
")",
"{",
"return",
"getDisplayVariantInternal",
"(",
"new",
"ULocale",
"(",
"localeID",
")",
",",
"new",
"ULocale",
"(",
"displayLocaleID",
")",
")",
... | <strong>[icu]</strong> Returns a locale's variant localized for display in the provided locale.
This is a cover for the ICU4C API.
@param localeID the id of the locale whose variant will be displayed
@param displayLocaleID the id of the locale in which to display the name.
@return the localized variant name. | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"a",
"locale",
"s",
"variant",
"localized",
"for",
"display",
"in",
"the",
"provided",
"locale",
".",
"This",
"is",
"a",
"cover",
"for",
"the",
"ICU4C",
"API",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1641-L1643 |
EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java | ObjectSpace.registerClasses | static public void registerClasses (final Kryo kryo) {
"""
Registers the classes needed to use ObjectSpaces. This should be called before any connections are opened.
@see Kryo#register(Class, Serializer)
"""
kryo.register(Object[].class);
kryo.register(InvokeMethod.class);
FieldSerializer<InvokeMethodR... | java | static public void registerClasses (final Kryo kryo) {
kryo.register(Object[].class);
kryo.register(InvokeMethod.class);
FieldSerializer<InvokeMethodResult> resultSerializer = new FieldSerializer<InvokeMethodResult>(kryo,
InvokeMethodResult.class) {
public void write (Kryo kryo, Output output, InvokeMethod... | [
"static",
"public",
"void",
"registerClasses",
"(",
"final",
"Kryo",
"kryo",
")",
"{",
"kryo",
".",
"register",
"(",
"Object",
"[",
"]",
".",
"class",
")",
";",
"kryo",
".",
"register",
"(",
"InvokeMethod",
".",
"class",
")",
";",
"FieldSerializer",
"<",... | Registers the classes needed to use ObjectSpaces. This should be called before any connections are opened.
@see Kryo#register(Class, Serializer) | [
"Registers",
"the",
"classes",
"needed",
"to",
"use",
"ObjectSpaces",
".",
"This",
"should",
"be",
"called",
"before",
"any",
"connections",
"are",
"opened",
"."
] | train | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java#L687-L721 |
ehcache/ehcache3 | clustered/server/src/main/java/org/ehcache/clustered/server/management/ClusterTierManagement.java | ClusterTierManagement.init | private void init() {
"""
the goal of the following code is to send the management metadata from the entity into the monitoring tree AFTER the entity creation
"""
ServerSideServerStore serverStore = ehcacheStateService.getStore(storeIdentifier);
ServerStoreBinding serverStoreBinding = new ServerStoreBi... | java | private void init() {
ServerSideServerStore serverStore = ehcacheStateService.getStore(storeIdentifier);
ServerStoreBinding serverStoreBinding = new ServerStoreBinding(storeIdentifier, serverStore);
CompletableFuture<Void> r1 = managementRegistry.register(serverStoreBinding);
ServerSideConfiguration.Poo... | [
"private",
"void",
"init",
"(",
")",
"{",
"ServerSideServerStore",
"serverStore",
"=",
"ehcacheStateService",
".",
"getStore",
"(",
"storeIdentifier",
")",
";",
"ServerStoreBinding",
"serverStoreBinding",
"=",
"new",
"ServerStoreBinding",
"(",
"storeIdentifier",
",",
... | the goal of the following code is to send the management metadata from the entity into the monitoring tree AFTER the entity creation | [
"the",
"goal",
"of",
"the",
"following",
"code",
"is",
"to",
"send",
"the",
"management",
"metadata",
"from",
"the",
"entity",
"into",
"the",
"monitoring",
"tree",
"AFTER",
"the",
"entity",
"creation"
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/clustered/server/src/main/java/org/ehcache/clustered/server/management/ClusterTierManagement.java#L91-L106 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/NotesApi.java | NotesApi.deleteMergeRequestNote | public void deleteMergeRequestNote(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId) throws GitLabApiException {
"""
Delete the specified merge request's note.
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param mergeRequestIid the merge req... | java | public void deleteMergeRequestNote(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId) throws GitLabApiException {
if (mergeRequestIid == null) {
throw new RuntimeException("mergeRequestIid cannot be null");
}
if (noteId == null) {
throw new RuntimeExceptio... | [
"public",
"void",
"deleteMergeRequestNote",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"mergeRequestIid",
",",
"Integer",
"noteId",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"mergeRequestIid",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeExcepti... | Delete the specified merge request's note.
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param mergeRequestIid the merge request IID to delete the notes for
@param noteId the ID of the node to delete
@throws GitLabApiException if any exception occurs | [
"Delete",
"the",
"specified",
"merge",
"request",
"s",
"note",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/NotesApi.java#L419-L432 |
srikalyc/Sql4D | Sql4DCompiler/src/main/java/com/yahoo/sql4d/converter/druidGParser.java | druidGParser.anyValue | public final Object anyValue() throws RecognitionException {
"""
druidG.g:265:1: anyValue returns [Object obj] : (a= SINGLE_QUOTE_STRING |b= ( LONG | FLOAT ) );
"""
Object obj = null;
Token a=null;
Token b=null;
try {
// druidG.g:266:2: (a= SINGLE_QUOTE_STRING |b= ( LONG | FLOAT ) )
int alt128... | java | public final Object anyValue() throws RecognitionException {
Object obj = null;
Token a=null;
Token b=null;
try {
// druidG.g:266:2: (a= SINGLE_QUOTE_STRING |b= ( LONG | FLOAT ) )
int alt128=2;
int LA128_0 = input.LA(1);
if ( (LA128_0==SINGLE_QUOTE_STRING) ) {
alt128=1;
}
else if ( (LA1... | [
"public",
"final",
"Object",
"anyValue",
"(",
")",
"throws",
"RecognitionException",
"{",
"Object",
"obj",
"=",
"null",
";",
"Token",
"a",
"=",
"null",
";",
"Token",
"b",
"=",
"null",
";",
"try",
"{",
"// druidG.g:266:2: (a= SINGLE_QUOTE_STRING |b= ( LONG | FLOAT ... | druidG.g:265:1: anyValue returns [Object obj] : (a= SINGLE_QUOTE_STRING |b= ( LONG | FLOAT ) ); | [
"druidG",
".",
"g",
":",
"265",
":",
"1",
":",
"anyValue",
"returns",
"[",
"Object",
"obj",
"]",
":",
"(",
"a",
"=",
"SINGLE_QUOTE_STRING",
"|b",
"=",
"(",
"LONG",
"|",
"FLOAT",
")",
")",
";"
] | train | https://github.com/srikalyc/Sql4D/blob/2c052fe60ead5a16277c798a3440de7d4f6f24f6/Sql4DCompiler/src/main/java/com/yahoo/sql4d/converter/druidGParser.java#L3545-L3603 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java | TimeZoneFormat.parseShortZoneID | private static String parseShortZoneID(String text, ParsePosition pos) {
"""
Parse a short zone ID.
@param text the text contains a time zone ID string at the position.
@param pos the position.
@return The zone ID for the parsed short zone ID.
"""
String resolvedID = null;
if (SHORT_ZONE_ID_... | java | private static String parseShortZoneID(String text, ParsePosition pos) {
String resolvedID = null;
if (SHORT_ZONE_ID_TRIE == null) {
synchronized (TimeZoneFormat.class) {
if (SHORT_ZONE_ID_TRIE == null) {
// Build short zone ID trie
Tex... | [
"private",
"static",
"String",
"parseShortZoneID",
"(",
"String",
"text",
",",
"ParsePosition",
"pos",
")",
"{",
"String",
"resolvedID",
"=",
"null",
";",
"if",
"(",
"SHORT_ZONE_ID_TRIE",
"==",
"null",
")",
"{",
"synchronized",
"(",
"TimeZoneFormat",
".",
"cla... | Parse a short zone ID.
@param text the text contains a time zone ID string at the position.
@param pos the position.
@return The zone ID for the parsed short zone ID. | [
"Parse",
"a",
"short",
"zone",
"ID",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java#L2966-L2997 |
BellaDati/belladati-sdk-api | src/main/java/com/belladati/sdk/dataset/data/DataRow.java | DataRow.setAll | public DataRow setAll(int offset, String... values) throws TooManyColumnsException {
"""
Sets multiple columns of this row, starting from the given offset.
@param offset represents offset
@param values the column values to set
@return this row, to allow chaining
@throws TooManyColumnsException if more values... | java | public DataRow setAll(int offset, String... values) throws TooManyColumnsException {
if (offset + values.length > columns.size()) {
throw new TooManyColumnsException(columns.size(), offset + values.length);
}
for (int i = 0; i + offset < columns.size() && i < values.length; i++) {
content.put(columns.get(i)... | [
"public",
"DataRow",
"setAll",
"(",
"int",
"offset",
",",
"String",
"...",
"values",
")",
"throws",
"TooManyColumnsException",
"{",
"if",
"(",
"offset",
"+",
"values",
".",
"length",
">",
"columns",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"TooMa... | Sets multiple columns of this row, starting from the given offset.
@param offset represents offset
@param values the column values to set
@return this row, to allow chaining
@throws TooManyColumnsException if more values are given than columns are
available after the offset | [
"Sets",
"multiple",
"columns",
"of",
"this",
"row",
"starting",
"from",
"the",
"given",
"offset",
"."
] | train | https://github.com/BellaDati/belladati-sdk-api/blob/ec45a42048d8255838ad0200aa6784a8e8a121c1/src/main/java/com/belladati/sdk/dataset/data/DataRow.java#L119-L127 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_image_GET | public ArrayList<OvhImage> project_serviceName_image_GET(String serviceName, String flavorType, OvhOSTypeEnum osType, String region) throws IOException {
"""
Get images
REST: GET /cloud/project/{serviceName}/image
@param flavorType [required] Get compatible images with flavor type
@param osType [required] Ima... | java | public ArrayList<OvhImage> project_serviceName_image_GET(String serviceName, String flavorType, OvhOSTypeEnum osType, String region) throws IOException {
String qPath = "/cloud/project/{serviceName}/image";
StringBuilder sb = path(qPath, serviceName);
query(sb, "flavorType", flavorType);
query(sb, "osType", osT... | [
"public",
"ArrayList",
"<",
"OvhImage",
">",
"project_serviceName_image_GET",
"(",
"String",
"serviceName",
",",
"String",
"flavorType",
",",
"OvhOSTypeEnum",
"osType",
",",
"String",
"region",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/pro... | Get images
REST: GET /cloud/project/{serviceName}/image
@param flavorType [required] Get compatible images with flavor type
@param osType [required] Image OS
@param region [required] Image region
@param serviceName [required] Project id | [
"Get",
"images"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1020-L1028 |
alkacon/opencms-core | src/org/opencms/search/fields/CmsLuceneField.java | CmsLuceneField.createField | public Field createField(String name, String content) {
"""
Creates a field with the given name from the configuration and the provided content.<p>
If no valid content is provided (that is the content is either <code>null</code> or
only whitespace), then no field is created and <code>null</code> is returned.<p... | java | public Field createField(String name, String content) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(content)) {
content = getDefaultValue();
}
if (content != null) {
final FieldType ft = new FieldType();
if (isIndexed()) {
if (isTokenizedAndInde... | [
"public",
"Field",
"createField",
"(",
"String",
"name",
",",
"String",
"content",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"content",
")",
")",
"{",
"content",
"=",
"getDefaultValue",
"(",
")",
";",
"}",
"if",
"(",
"conte... | Creates a field with the given name from the configuration and the provided content.<p>
If no valid content is provided (that is the content is either <code>null</code> or
only whitespace), then no field is created and <code>null</code> is returned.<p>
@param name the name of the field to create
@param content the co... | [
"Creates",
"a",
"field",
"with",
"the",
"given",
"name",
"from",
"the",
"configuration",
"and",
"the",
"provided",
"content",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/fields/CmsLuceneField.java#L196-L217 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/provisioning/OperationsApi.java | OperationsApi.getUsersAsync | public void getUsersAsync(Integer limit, Integer offset, String order, String sortBy, String filterName, String filterParameters, String roles, String skills, Boolean userEnabled, String userValid, AsyncCallback callback) throws ProvisioningApiException {
"""
Get users.
Get [CfgPerson](https://docs.genesys.com/Do... | java | public void getUsersAsync(Integer limit, Integer offset, String order, String sortBy, String filterName, String filterParameters, String roles, String skills, Boolean userEnabled, String userValid, AsyncCallback callback) throws ProvisioningApiException {
String aioId = UUID.randomUUID().toString();
asyncCallback... | [
"public",
"void",
"getUsersAsync",
"(",
"Integer",
"limit",
",",
"Integer",
"offset",
",",
"String",
"order",
",",
"String",
"sortBy",
",",
"String",
"filterName",
",",
"String",
"filterParameters",
",",
"String",
"roles",
",",
"String",
"skills",
",",
"Boolea... | Get users.
Get [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) objects based on the specified filters.
@param limit Limit the number of users the Provisioning API should return. (optional)
@param offset The number of matches the Provisioning API should skip in the returned users... | [
"Get",
"users",
".",
"Get",
"[",
"CfgPerson",
"]",
"(",
"https",
":",
"//",
"docs",
".",
"genesys",
".",
"com",
"/",
"Documentation",
"/",
"PSDK",
"/",
"latest",
"/",
"ConfigLayerRef",
"/",
"CfgPerson",
")",
"objects",
"based",
"on",
"the",
"specified",
... | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/OperationsApi.java#L62-L87 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java | DependencyBundlingAnalyzer.vulnerabilitiesMatch | private boolean vulnerabilitiesMatch(Dependency dependency1, Dependency dependency2) {
"""
Returns true if the two dependencies have the same vulnerabilities.
@param dependency1 a dependency2 to compare
@param dependency2 a dependency2 to compare
@return true if the two dependencies have the same vulnerabilit... | java | private boolean vulnerabilitiesMatch(Dependency dependency1, Dependency dependency2) {
final Set<Vulnerability> one = dependency1.getVulnerabilities();
final Set<Vulnerability> two = dependency2.getVulnerabilities();
return one != null && two != null
&& one.size() == two.size()
... | [
"private",
"boolean",
"vulnerabilitiesMatch",
"(",
"Dependency",
"dependency1",
",",
"Dependency",
"dependency2",
")",
"{",
"final",
"Set",
"<",
"Vulnerability",
">",
"one",
"=",
"dependency1",
".",
"getVulnerabilities",
"(",
")",
";",
"final",
"Set",
"<",
"Vuln... | Returns true if the two dependencies have the same vulnerabilities.
@param dependency1 a dependency2 to compare
@param dependency2 a dependency2 to compare
@return true if the two dependencies have the same vulnerabilities | [
"Returns",
"true",
"if",
"the",
"two",
"dependencies",
"have",
"the",
"same",
"vulnerabilities",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java#L285-L291 |
apache/reef | lang/java/reef-bridge-proto-java/src/main/java/org/apache/reef/bridge/driver/client/JavaDriverClientLauncher.java | JavaDriverClientLauncher.main | @SuppressWarnings("checkstyle:illegalcatch")
public static void main(final String[] args) {
"""
Launches a REEF client process (Driver or Evaluator).
@param args Command-line arguments.
Must be a single element containing local path to the configuration file.
"""
LOG.log(Level.INFO, "Entering JavaDriv... | java | @SuppressWarnings("checkstyle:illegalcatch")
public static void main(final String[] args) {
LOG.log(Level.INFO, "Entering JavaDriverClientLauncher.main().");
LOG.log(Level.FINE, "JavaDriverClientLauncher started with user name [{0}]", System.getProperty("user.name"));
LOG.log(Level.FINE, "JavaDriverClie... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:illegalcatch\"",
")",
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"INFO",
",",
"\"Entering JavaDriverClientLauncher.main().\"",
")",
";"... | Launches a REEF client process (Driver or Evaluator).
@param args Command-line arguments.
Must be a single element containing local path to the configuration file. | [
"Launches",
"a",
"REEF",
"client",
"process",
"(",
"Driver",
"or",
"Evaluator",
")",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-bridge-proto-java/src/main/java/org/apache/reef/bridge/driver/client/JavaDriverClientLauncher.java#L169-L214 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java | ZooKeeperStateHandleStore.releaseAndTryRemoveAll | public void releaseAndTryRemoveAll() throws Exception {
"""
Releases all lock nodes of this ZooKeeperStateHandleStores and tries to remove all state nodes which
are not locked anymore.
<p>The delete operation is executed asynchronously
@throws Exception if the delete operation fails
"""
Collection<Str... | java | public void releaseAndTryRemoveAll() throws Exception {
Collection<String> children = getAllPaths();
Exception exception = null;
for (String child : children) {
try {
releaseAndTryRemove('/' + child);
} catch (Exception e) {
exception = ExceptionUtils.firstOrSuppressed(e, exception);
}
}
i... | [
"public",
"void",
"releaseAndTryRemoveAll",
"(",
")",
"throws",
"Exception",
"{",
"Collection",
"<",
"String",
">",
"children",
"=",
"getAllPaths",
"(",
")",
";",
"Exception",
"exception",
"=",
"null",
";",
"for",
"(",
"String",
"child",
":",
"children",
")"... | Releases all lock nodes of this ZooKeeperStateHandleStores and tries to remove all state nodes which
are not locked anymore.
<p>The delete operation is executed asynchronously
@throws Exception if the delete operation fails | [
"Releases",
"all",
"lock",
"nodes",
"of",
"this",
"ZooKeeperStateHandleStores",
"and",
"tries",
"to",
"remove",
"all",
"state",
"nodes",
"which",
"are",
"not",
"locked",
"anymore",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java#L369-L385 |
icode/ameba | src/main/java/ameba/lib/Fibers.java | Fibers.runInFiber | public static void runInFiber(FiberScheduler scheduler, SuspendableRunnable target) throws ExecutionException, InterruptedException {
"""
Runs an action in a new fiber and awaits the fiber's termination.
@param scheduler the {@link FiberScheduler} to use when scheduling the fiber.
@param target the operatio... | java | public static void runInFiber(FiberScheduler scheduler, SuspendableRunnable target) throws ExecutionException, InterruptedException {
FiberUtil.runInFiber(scheduler, target);
} | [
"public",
"static",
"void",
"runInFiber",
"(",
"FiberScheduler",
"scheduler",
",",
"SuspendableRunnable",
"target",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
"{",
"FiberUtil",
".",
"runInFiber",
"(",
"scheduler",
",",
"target",
")",
";",
"}"
... | Runs an action in a new fiber and awaits the fiber's termination.
@param scheduler the {@link FiberScheduler} to use when scheduling the fiber.
@param target the operation
@throws ExecutionException
@throws InterruptedException | [
"Runs",
"an",
"action",
"in",
"a",
"new",
"fiber",
"and",
"awaits",
"the",
"fiber",
"s",
"termination",
"."
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/lib/Fibers.java#L287-L289 |
coursera/courier | android/generator/src/main/java/org/coursera/courier/android/JavaSyntax.java | JavaSyntax.toOptionalType | public String toOptionalType(ClassTemplateSpec spec, boolean optional) {
"""
Returns the Java type of an optional field for the given {@link ClassTemplateSpec} as a
Java source code string.
If the field is optional it is always represented as a
{@link AndroidProperties.Optionality#REQUIRED_FIELDS_MAY_BE_ABSEN... | java | public String toOptionalType(ClassTemplateSpec spec, boolean optional) {
return toType(
spec,
optional ? Optionality.REQUIRED_FIELDS_MAY_BE_ABSENT : androidProperties.optionality);
} | [
"public",
"String",
"toOptionalType",
"(",
"ClassTemplateSpec",
"spec",
",",
"boolean",
"optional",
")",
"{",
"return",
"toType",
"(",
"spec",
",",
"optional",
"?",
"Optionality",
".",
"REQUIRED_FIELDS_MAY_BE_ABSENT",
":",
"androidProperties",
".",
"optionality",
")... | Returns the Java type of an optional field for the given {@link ClassTemplateSpec} as a
Java source code string.
If the field is optional it is always represented as a
{@link AndroidProperties.Optionality#REQUIRED_FIELDS_MAY_BE_ABSENT} type else it is
represented using the {@link AndroidProperties.Optionality} for thi... | [
"Returns",
"the",
"Java",
"type",
"of",
"an",
"optional",
"field",
"for",
"the",
"given",
"{",
"@link",
"ClassTemplateSpec",
"}",
"as",
"a",
"Java",
"source",
"code",
"string",
"."
] | train | https://github.com/coursera/courier/blob/749674fa7ee33804ad11b6c8ecb560f455cb4c22/android/generator/src/main/java/org/coursera/courier/android/JavaSyntax.java#L117-L121 |
j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java | OrmLiteConfigUtil.writeConfigFile | public static void writeConfigFile(String fileName, boolean sortClasses) throws SQLException, IOException {
"""
Finds the annotated classes in the current directory or below and writes a configuration file to the file-name in
the raw folder.
@param sortClasses
Set to true to sort the classes by name before th... | java | public static void writeConfigFile(String fileName, boolean sortClasses) throws SQLException, IOException {
List<Class<?>> classList = new ArrayList<Class<?>>();
findAnnotatedClasses(classList, new File("."), 0);
writeConfigFile(fileName, classList.toArray(new Class[classList.size()]), sortClasses);
} | [
"public",
"static",
"void",
"writeConfigFile",
"(",
"String",
"fileName",
",",
"boolean",
"sortClasses",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"classList",
"=",
"new",
"ArrayList",
"<",
"Class",
"<"... | Finds the annotated classes in the current directory or below and writes a configuration file to the file-name in
the raw folder.
@param sortClasses
Set to true to sort the classes by name before the file is generated. | [
"Finds",
"the",
"annotated",
"classes",
"in",
"the",
"current",
"directory",
"or",
"below",
"and",
"writes",
"a",
"configuration",
"file",
"to",
"the",
"file",
"-",
"name",
"in",
"the",
"raw",
"folder",
"."
] | train | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java#L115-L119 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/AcroFields.java | AcroFields.renameField | public boolean renameField(String oldName, String newName) {
"""
Renames a field. Only the last part of the name can be renamed. For example,
if the original field is "ab.cd.ef" only the "ef" part can be renamed.
@param oldName the old field name
@param newName the new field name
@return <CODE>true</CODE> if... | java | public boolean renameField(String oldName, String newName) {
int idx1 = oldName.lastIndexOf('.') + 1;
int idx2 = newName.lastIndexOf('.') + 1;
if (idx1 != idx2)
return false;
if (!oldName.substring(0, idx1).equals(newName.substring(0, idx2)))
return false;
... | [
"public",
"boolean",
"renameField",
"(",
"String",
"oldName",
",",
"String",
"newName",
")",
"{",
"int",
"idx1",
"=",
"oldName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
"+",
"1",
";",
"int",
"idx2",
"=",
"newName",
".",
"lastIndexOf",
"(",
"'",
"'",
... | Renames a field. Only the last part of the name can be renamed. For example,
if the original field is "ab.cd.ef" only the "ef" part can be renamed.
@param oldName the old field name
@param newName the new field name
@return <CODE>true</CODE> if the renaming was successful, <CODE>false</CODE>
otherwise | [
"Renames",
"a",
"field",
".",
"Only",
"the",
"last",
"part",
"of",
"the",
"name",
"can",
"be",
"renamed",
".",
"For",
"example",
"if",
"the",
"original",
"field",
"is",
"ab",
".",
"cd",
".",
"ef",
"only",
"the",
"ef",
"part",
"can",
"be",
"renamed",
... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/AcroFields.java#L483-L505 |
kiswanij/jk-util | src/main/java/com/jk/util/activedirectory/ADAuthenticator.java | ADAuthenticator.isAuthenticed | public static boolean isAuthenticed(String host, int port, String userName, String password) throws NamingException {
"""
Checks if is authenticed.
@param host the host
@param port the port
@param userName the user name
@param password the password
@return true, if is authenticed
@throws NamingExce... | java | public static boolean isAuthenticed(String host, int port, String userName, String password) throws NamingException {
log.info("isAuthenticed");
// Set up the environment for creating the initial context
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "c... | [
"public",
"static",
"boolean",
"isAuthenticed",
"(",
"String",
"host",
",",
"int",
"port",
",",
"String",
"userName",
",",
"String",
"password",
")",
"throws",
"NamingException",
"{",
"log",
".",
"info",
"(",
"\"isAuthenticed\"",
")",
";",
"// Set up the environ... | Checks if is authenticed.
@param host the host
@param port the port
@param userName the user name
@param password the password
@return true, if is authenticed
@throws NamingException the naming exception | [
"Checks",
"if",
"is",
"authenticed",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/activedirectory/ADAuthenticator.java#L48-L67 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/records/converter/RecordReaderConverter.java | RecordReaderConverter.convert | public static void convert(RecordReader reader, RecordWriter writer) throws IOException {
"""
Write all values from the specified record reader to the specified record writer.
Closes the record writer on completion
@param reader Record reader (source of data)
@param writer Record writer (location to write dat... | java | public static void convert(RecordReader reader, RecordWriter writer) throws IOException {
convert(reader, writer, true);
} | [
"public",
"static",
"void",
"convert",
"(",
"RecordReader",
"reader",
",",
"RecordWriter",
"writer",
")",
"throws",
"IOException",
"{",
"convert",
"(",
"reader",
",",
"writer",
",",
"true",
")",
";",
"}"
] | Write all values from the specified record reader to the specified record writer.
Closes the record writer on completion
@param reader Record reader (source of data)
@param writer Record writer (location to write data)
@throws IOException If underlying reader/writer throws an exception | [
"Write",
"all",
"values",
"from",
"the",
"specified",
"record",
"reader",
"to",
"the",
"specified",
"record",
"writer",
".",
"Closes",
"the",
"record",
"writer",
"on",
"completion"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/records/converter/RecordReaderConverter.java#L44-L46 |
infinispan/infinispan | remote-query/remote-query-server/src/main/java/org/infinispan/query/remote/impl/ProtobufMetadataManagerImpl.java | ProtobufMetadataManagerImpl.init | @Inject
protected void init(EmbeddedCacheManager cacheManager, InternalCacheRegistry internalCacheRegistry) {
"""
Defines the configuration of the ___protobuf_metadata internal cache.
"""
this.cacheManager = cacheManager;
internalCacheRegistry.registerInternalCache(PROTOBUF_METADATA_CACHE_NAME,
... | java | @Inject
protected void init(EmbeddedCacheManager cacheManager, InternalCacheRegistry internalCacheRegistry) {
this.cacheManager = cacheManager;
internalCacheRegistry.registerInternalCache(PROTOBUF_METADATA_CACHE_NAME,
getProtobufMetadataCacheConfig().build(),
EnumSet.of(Flag.USER,... | [
"@",
"Inject",
"protected",
"void",
"init",
"(",
"EmbeddedCacheManager",
"cacheManager",
",",
"InternalCacheRegistry",
"internalCacheRegistry",
")",
"{",
"this",
".",
"cacheManager",
"=",
"cacheManager",
";",
"internalCacheRegistry",
".",
"registerInternalCache",
"(",
"... | Defines the configuration of the ___protobuf_metadata internal cache. | [
"Defines",
"the",
"configuration",
"of",
"the",
"___protobuf_metadata",
"internal",
"cache",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/remote-query/remote-query-server/src/main/java/org/infinispan/query/remote/impl/ProtobufMetadataManagerImpl.java#L76-L82 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Comment.java | Comment.inlineTagFound | private static int inlineTagFound(DocImpl holder, String inlinetext, int start) {
"""
Recursively search for the characters '{', '@', followed by
name of inline tag and white space,
if found
return the index of the text following the white space.
else
return -1.
"""
DocEnv docenv = holder.env;
... | java | private static int inlineTagFound(DocImpl holder, String inlinetext, int start) {
DocEnv docenv = holder.env;
int linkstart = inlinetext.indexOf("{@", start);
if (start == inlinetext.length() || linkstart == -1) {
return -1;
} else if (inlinetext.indexOf('}', linkstart) == -1... | [
"private",
"static",
"int",
"inlineTagFound",
"(",
"DocImpl",
"holder",
",",
"String",
"inlinetext",
",",
"int",
"start",
")",
"{",
"DocEnv",
"docenv",
"=",
"holder",
".",
"env",
";",
"int",
"linkstart",
"=",
"inlinetext",
".",
"indexOf",
"(",
"\"{@\"",
",... | Recursively search for the characters '{', '@', followed by
name of inline tag and white space,
if found
return the index of the text following the white space.
else
return -1. | [
"Recursively",
"search",
"for",
"the",
"characters",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Comment.java#L429-L442 |
alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/animation/ViewPosition.java | ViewPosition.apply | public static void apply(@NonNull ViewPosition pos, @NonNull Point point) {
"""
Computes minimal view position for given point.
@param pos Output view position
@param point Target point
"""
pos.view.set(point.x, point.y, point.x + 1, point.y + 1);
pos.viewport.set(pos.view);
pos.vis... | java | public static void apply(@NonNull ViewPosition pos, @NonNull Point point) {
pos.view.set(point.x, point.y, point.x + 1, point.y + 1);
pos.viewport.set(pos.view);
pos.visible.set(pos.view);
pos.image.set(pos.view);
} | [
"public",
"static",
"void",
"apply",
"(",
"@",
"NonNull",
"ViewPosition",
"pos",
",",
"@",
"NonNull",
"Point",
"point",
")",
"{",
"pos",
".",
"view",
".",
"set",
"(",
"point",
".",
"x",
",",
"point",
".",
"y",
",",
"point",
".",
"x",
"+",
"1",
",... | Computes minimal view position for given point.
@param pos Output view position
@param point Target point | [
"Computes",
"minimal",
"view",
"position",
"for",
"given",
"point",
"."
] | train | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/animation/ViewPosition.java#L168-L173 |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/BasicFileServlet.java | BasicFileServlet.copyPartialContent | public static void copyPartialContent(InputStream in, OutputStream out, Range r) throws IOException {
"""
Copies the given range of bytes from the input stream to the output stream.
@param in
@param out
@param r
@throws IOException
"""
IOUtils.copyLarge(in, out, r.start, r.length);
} | java | public static void copyPartialContent(InputStream in, OutputStream out, Range r) throws IOException {
IOUtils.copyLarge(in, out, r.start, r.length);
} | [
"public",
"static",
"void",
"copyPartialContent",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
",",
"Range",
"r",
")",
"throws",
"IOException",
"{",
"IOUtils",
".",
"copyLarge",
"(",
"in",
",",
"out",
",",
"r",
".",
"start",
",",
"r",
".",
"leng... | Copies the given range of bytes from the input stream to the output stream.
@param in
@param out
@param r
@throws IOException | [
"Copies",
"the",
"given",
"range",
"of",
"bytes",
"from",
"the",
"input",
"stream",
"to",
"the",
"output",
"stream",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/BasicFileServlet.java#L225-L227 |
playn/playn | core/src/playn/core/GLBatch.java | GLBatch.begin | public void begin (float fbufWidth, float fbufHeight, boolean flip) {
"""
Must be called before this batch is used to accumulate and send drawing commands.
@param flip whether or not to flip the y-axis. This is generally true when rendering to the
default frame buffer (the screen), and false when rendering to ... | java | public void begin (float fbufWidth, float fbufHeight, boolean flip) {
if (begun) throw new IllegalStateException(getClass().getSimpleName() + " mismatched begin()");
begun = true;
} | [
"public",
"void",
"begin",
"(",
"float",
"fbufWidth",
",",
"float",
"fbufHeight",
",",
"boolean",
"flip",
")",
"{",
"if",
"(",
"begun",
")",
"throw",
"new",
"IllegalStateException",
"(",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
"+",
"\" mismat... | Must be called before this batch is used to accumulate and send drawing commands.
@param flip whether or not to flip the y-axis. This is generally true when rendering to the
default frame buffer (the screen), and false when rendering to textures. | [
"Must",
"be",
"called",
"before",
"this",
"batch",
"is",
"used",
"to",
"accumulate",
"and",
"send",
"drawing",
"commands",
"."
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/GLBatch.java#L32-L35 |
HtmlUnit/htmlunit-cssparser | src/main/java/com/gargoylesoftware/css/parser/AbstractCSSParser.java | AbstractCSSParser.hexcolorInternal | protected LexicalUnit hexcolorInternal(final LexicalUnit prev, final Token t) {
"""
Processes a hexadecimal color definition.
@param prev the previous lexical unit
@param t the token
@return a new lexical unit
"""
// Step past the hash at the beginning
final int i = 1;
int r = 0;
... | java | protected LexicalUnit hexcolorInternal(final LexicalUnit prev, final Token t) {
// Step past the hash at the beginning
final int i = 1;
int r = 0;
int g = 0;
int b = 0;
final int len = t.image.length() - 1;
try {
if (len == 3) {
r = Int... | [
"protected",
"LexicalUnit",
"hexcolorInternal",
"(",
"final",
"LexicalUnit",
"prev",
",",
"final",
"Token",
"t",
")",
"{",
"// Step past the hash at the beginning",
"final",
"int",
"i",
"=",
"1",
";",
"int",
"r",
"=",
"0",
";",
"int",
"g",
"=",
"0",
";",
"... | Processes a hexadecimal color definition.
@param prev the previous lexical unit
@param t the token
@return a new lexical unit | [
"Processes",
"a",
"hexadecimal",
"color",
"definition",
"."
] | train | https://github.com/HtmlUnit/htmlunit-cssparser/blob/384e4170737169b5b4c87c5766495d9b8a6d3866/src/main/java/com/gargoylesoftware/css/parser/AbstractCSSParser.java#L698-L743 |
aws/aws-sdk-java | aws-java-sdk-discovery/src/main/java/com/amazonaws/services/applicationdiscovery/model/StartContinuousExportResult.java | StartContinuousExportResult.withSchemaStorageConfig | public StartContinuousExportResult withSchemaStorageConfig(java.util.Map<String, String> schemaStorageConfig) {
"""
<p>
A dictionary which describes how the data is stored.
</p>
<ul>
<li>
<p>
<code>databaseName</code> - the name of the Glue database used to store the schema.
</p>
</li>
</ul>
@param sch... | java | public StartContinuousExportResult withSchemaStorageConfig(java.util.Map<String, String> schemaStorageConfig) {
setSchemaStorageConfig(schemaStorageConfig);
return this;
} | [
"public",
"StartContinuousExportResult",
"withSchemaStorageConfig",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"schemaStorageConfig",
")",
"{",
"setSchemaStorageConfig",
"(",
"schemaStorageConfig",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A dictionary which describes how the data is stored.
</p>
<ul>
<li>
<p>
<code>databaseName</code> - the name of the Glue database used to store the schema.
</p>
</li>
</ul>
@param schemaStorageConfig
A dictionary which describes how the data is stored.</p>
<ul>
<li>
<p>
<code>databaseName</code> - the name of the ... | [
"<p",
">",
"A",
"dictionary",
"which",
"describes",
"how",
"the",
"data",
"is",
"stored",
".",
"<",
"/",
"p",
">",
"<ul",
">",
"<li",
">",
"<p",
">",
"<code",
">",
"databaseName<",
"/",
"code",
">",
"-",
"the",
"name",
"of",
"the",
"Glue",
"databas... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-discovery/src/main/java/com/amazonaws/services/applicationdiscovery/model/StartContinuousExportResult.java#L312-L315 |
osglworks/java-tool | src/main/java/org/osgl/util/E.java | E.invalidConfigurationIf | public static void invalidConfigurationIf(boolean tester, String msg, Object... args) {
"""
Throws out a {@link ConfigurationException} with message specified if `tester` evaluated to `true`.
@param tester
when `true` then throw out the exception
@param msg
the error message format pattern.
@param args
the e... | java | public static void invalidConfigurationIf(boolean tester, String msg, Object... args) {
if (tester) {
invalidConfiguration(msg, args);
}
} | [
"public",
"static",
"void",
"invalidConfigurationIf",
"(",
"boolean",
"tester",
",",
"String",
"msg",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"tester",
")",
"{",
"invalidConfiguration",
"(",
"msg",
",",
"args",
")",
";",
"}",
"}"
] | Throws out a {@link ConfigurationException} with message specified if `tester` evaluated to `true`.
@param tester
when `true` then throw out the exception
@param msg
the error message format pattern.
@param args
the error message format arguments. | [
"Throws",
"out",
"a",
"{"
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/E.java#L312-L316 |
vkostyukov/la4j | src/main/java/org/la4j/Matrix.java | Matrix.transformRow | public Matrix transformRow(int i, VectorFunction function) {
"""
Builds a new matrix by applying given {@code function} to each element of specified
row in this matrix.
@param i the row index
@param function the vector function
@return the transformed matrix
"""
Matrix result = copy();
... | java | public Matrix transformRow(int i, VectorFunction function) {
Matrix result = copy();
VectorIterator it = result.iteratorOfRow(i);
while (it.hasNext()) {
double x = it.next();
int j = it.index();
it.set(function.evaluate(j, x));
}
return resul... | [
"public",
"Matrix",
"transformRow",
"(",
"int",
"i",
",",
"VectorFunction",
"function",
")",
"{",
"Matrix",
"result",
"=",
"copy",
"(",
")",
";",
"VectorIterator",
"it",
"=",
"result",
".",
"iteratorOfRow",
"(",
"i",
")",
";",
"while",
"(",
"it",
".",
... | Builds a new matrix by applying given {@code function} to each element of specified
row in this matrix.
@param i the row index
@param function the vector function
@return the transformed matrix | [
"Builds",
"a",
"new",
"matrix",
"by",
"applying",
"given",
"{",
"@code",
"function",
"}",
"to",
"each",
"element",
"of",
"specified",
"row",
"in",
"this",
"matrix",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L1502-L1513 |
algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataFile.java | DataFile.put | public void put(String data,Charset charset) throws APIException {
"""
Upload string data to this file as text using a custom Charset
@param data the data to upload
@throws APIException if there were any problems communicating with the Algorithmia API
"""
HttpResponse response = client.put(getUrl(), ... | java | public void put(String data,Charset charset) throws APIException {
HttpResponse response = client.put(getUrl(), new StringEntity(data, charset));
HttpClientHelpers.throwIfNotOk(response);
} | [
"public",
"void",
"put",
"(",
"String",
"data",
",",
"Charset",
"charset",
")",
"throws",
"APIException",
"{",
"HttpResponse",
"response",
"=",
"client",
".",
"put",
"(",
"getUrl",
"(",
")",
",",
"new",
"StringEntity",
"(",
"data",
",",
"charset",
")",
"... | Upload string data to this file as text using a custom Charset
@param data the data to upload
@throws APIException if there were any problems communicating with the Algorithmia API | [
"Upload",
"string",
"data",
"to",
"this",
"file",
"as",
"text",
"using",
"a",
"custom",
"Charset"
] | train | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataFile.java#L133-L136 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.