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 |
|---|---|---|---|---|---|---|---|---|---|---|
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/AbstractController.java | AbstractController.getSource | protected <T> Optional<T> getSource(Event event, Class<T> type) {
"""
Gets the source.
@param event the event
@param type the cls
@param <T> the generic type
@return the source
"""
return getValue(event, event::getSource, type);
} | java | protected <T> Optional<T> getSource(Event event, Class<T> type) {
return getValue(event, event::getSource, type);
} | [
"protected",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"getSource",
"(",
"Event",
"event",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"getValue",
"(",
"event",
",",
"event",
"::",
"getSource",
",",
"type",
")",
";",
"}"
] | Gets the source.
@param event the event
@param type the cls
@param <T> the generic type
@return the source | [
"Gets",
"the",
"source",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/AbstractController.java#L333-L335 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/text/csv/CsvUtil.java | CsvUtil.getWriter | public static CsvWriter getWriter(File file, Charset charset, boolean isAppend, CsvWriteConfig config) {
"""
获取CSV生成器(写出器)
@param file File CSV文件
@param charset 编码
@param isAppend 是否追加
@param config 写出配置,null则使用默认配置
"""
return new CsvWriter(file, charset, isAppend, config);
} | java | public static CsvWriter getWriter(File file, Charset charset, boolean isAppend, CsvWriteConfig config) {
return new CsvWriter(file, charset, isAppend, config);
} | [
"public",
"static",
"CsvWriter",
"getWriter",
"(",
"File",
"file",
",",
"Charset",
"charset",
",",
"boolean",
"isAppend",
",",
"CsvWriteConfig",
"config",
")",
"{",
"return",
"new",
"CsvWriter",
"(",
"file",
",",
"charset",
",",
"isAppend",
",",
"config",
")... | 获取CSV生成器(写出器)
@param file File CSV文件
@param charset 编码
@param isAppend 是否追加
@param config 写出配置,null则使用默认配置 | [
"获取CSV生成器(写出器)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/csv/CsvUtil.java#L86-L88 |
alkacon/opencms-core | src/org/opencms/i18n/CmsEncoder.java | CmsEncoder.encodeJavaEntities | public static String encodeJavaEntities(String input, String encoding) {
"""
Encodes all characters that are contained in the String which can not displayed
in the given encodings charset with Java escaping like <code>\u20ac</code>.<p>
This can be used to escape values used in Java property files.<p>
@param... | java | public static String encodeJavaEntities(String input, String encoding) {
StringBuffer result = new StringBuffer(input.length() * 2);
CharBuffer buffer = CharBuffer.wrap(input.toCharArray());
Charset charset = Charset.forName(encoding);
CharsetEncoder encoder = charset.newEncoder();
... | [
"public",
"static",
"String",
"encodeJavaEntities",
"(",
"String",
"input",
",",
"String",
"encoding",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"input",
".",
"length",
"(",
")",
"*",
"2",
")",
";",
"CharBuffer",
"buffer",
"=",
"... | Encodes all characters that are contained in the String which can not displayed
in the given encodings charset with Java escaping like <code>\u20ac</code>.<p>
This can be used to escape values used in Java property files.<p>
@param input the input to encode for Java
@param encoding the charset to encode the result wi... | [
"Encodes",
"all",
"characters",
"that",
"are",
"contained",
"in",
"the",
"String",
"which",
"can",
"not",
"displayed",
"in",
"the",
"given",
"encodings",
"charset",
"with",
"Java",
"escaping",
"like",
"<code",
">",
"\\",
"u20ac<",
"/",
"code",
">",
".",
"<... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsEncoder.java#L468-L496 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/ScrollPanePainter.java | ScrollPanePainter.paintBorderEnabled | private void paintBorderEnabled(Graphics2D g, int width, int height) {
"""
DOCUMENT ME!
@param g DOCUMENT ME!
@param width DOCUMENT ME!
@param height DOCUMENT ME!
"""
Shape s;
s = shapeGenerator.createRoundRectangle(0, 0, width - 1, height - 1, CornerSize.BORDER);
g.setPain... | java | private void paintBorderEnabled(Graphics2D g, int width, int height) {
Shape s;
s = shapeGenerator.createRoundRectangle(0, 0, width - 1, height - 1, CornerSize.BORDER);
g.setPaint(borderColor);
g.draw(s);
} | [
"private",
"void",
"paintBorderEnabled",
"(",
"Graphics2D",
"g",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Shape",
"s",
";",
"s",
"=",
"shapeGenerator",
".",
"createRoundRectangle",
"(",
"0",
",",
"0",
",",
"width",
"-",
"1",
",",
"height",
... | DOCUMENT ME!
@param g DOCUMENT ME!
@param width DOCUMENT ME!
@param height DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/ScrollPanePainter.java#L115-L120 |
alkacon/opencms-core | src/org/opencms/i18n/CmsLocaleManager.java | CmsLocaleManager.getDefaultLocale | public Locale getDefaultLocale(CmsObject cms, CmsResource resource) {
"""
Returns the "the" default locale for the given resource.<p>
It's possible to override the system default (see {@link #getDefaultLocale()}) by setting the property
<code>{@link CmsPropertyDefinition#PROPERTY_LOCALE}</code> to a comma sepa... | java | public Locale getDefaultLocale(CmsObject cms, CmsResource resource) {
List<Locale> defaultLocales = getDefaultLocales(cms, resource);
Locale result;
if (defaultLocales.size() > 0) {
result = defaultLocales.get(0);
} else {
result = getDefaultLocale();
}
... | [
"public",
"Locale",
"getDefaultLocale",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"{",
"List",
"<",
"Locale",
">",
"defaultLocales",
"=",
"getDefaultLocales",
"(",
"cms",
",",
"resource",
")",
";",
"Locale",
"result",
";",
"if",
"(",
"def... | Returns the "the" default locale for the given resource.<p>
It's possible to override the system default (see {@link #getDefaultLocale()}) by setting the property
<code>{@link CmsPropertyDefinition#PROPERTY_LOCALE}</code> to a comma separated list of locale names.
This property is inherited from the parent folders.
Th... | [
"Returns",
"the",
"the",
"default",
"locale",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsLocaleManager.java#L728-L738 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/property/CmsVfsModePropertyEditor.java | CmsVfsModePropertyEditor.createStringModel | private I_CmsStringModel createStringModel(final CmsUUID id, final String propName, final boolean isStructure) {
"""
Creates a string model which uses a field of a CmsClientProperty for storing its value.<p>
@param id the structure id
@param propName the property id
@param isStructure if true, the structure v... | java | private I_CmsStringModel createStringModel(final CmsUUID id, final String propName, final boolean isStructure) {
final CmsClientProperty property = m_properties.get(propName);
return new I_CmsStringModel() {
private boolean m_active;
private EventBus m_eventBus = new SimpleEv... | [
"private",
"I_CmsStringModel",
"createStringModel",
"(",
"final",
"CmsUUID",
"id",
",",
"final",
"String",
"propName",
",",
"final",
"boolean",
"isStructure",
")",
"{",
"final",
"CmsClientProperty",
"property",
"=",
"m_properties",
".",
"get",
"(",
"propName",
")"... | Creates a string model which uses a field of a CmsClientProperty for storing its value.<p>
@param id the structure id
@param propName the property id
@param isStructure if true, the structure value field should be used, else the resource value field
@return the new model object | [
"Creates",
"a",
"string",
"model",
"which",
"uses",
"a",
"field",
"of",
"a",
"CmsClientProperty",
"for",
"storing",
"its",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/property/CmsVfsModePropertyEditor.java#L450-L508 |
threerings/nenya | tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundler.java | ComponentBundler.saveBroker | protected void saveBroker (File mapfile, HashMapIDBroker broker)
throws RuntimeException {
"""
Stores a persistent representation of the supplied hashmap ID
broker in the specified file.
"""
// bail if the broker wasn't modified
if (!broker.isModified()) {
return;
}... | java | protected void saveBroker (File mapfile, HashMapIDBroker broker)
throws RuntimeException
{
// bail if the broker wasn't modified
if (!broker.isModified()) {
return;
}
try {
BufferedWriter bout = new BufferedWriter(new FileWriter(mapfile));
... | [
"protected",
"void",
"saveBroker",
"(",
"File",
"mapfile",
",",
"HashMapIDBroker",
"broker",
")",
"throws",
"RuntimeException",
"{",
"// bail if the broker wasn't modified",
"if",
"(",
"!",
"broker",
".",
"isModified",
"(",
")",
")",
"{",
"return",
";",
"}",
"tr... | Stores a persistent representation of the supplied hashmap ID
broker in the specified file. | [
"Stores",
"a",
"persistent",
"representation",
"of",
"the",
"supplied",
"hashmap",
"ID",
"broker",
"in",
"the",
"specified",
"file",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundler.java#L372-L388 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/util/SelectorHelper.java | SelectorHelper.getValue | public static <T> T getValue(Class<T> type, Selector selector) throws ExecutionException {
"""
Return the selector value represents in the type class.
@param type the type in witch the value will be return.
@param selector the selector.
@return the type value.
@throws ExecutionException if an error happe... | java | public static <T> T getValue(Class<T> type, Selector selector) throws ExecutionException {
return convert(getValue(selector), type);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getValue",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Selector",
"selector",
")",
"throws",
"ExecutionException",
"{",
"return",
"convert",
"(",
"getValue",
"(",
"selector",
")",
",",
"type",
")",
";",
"}"
] | Return the selector value represents in the type class.
@param type the type in witch the value will be return.
@param selector the selector.
@return the type value.
@throws ExecutionException if an error happens. | [
"Return",
"the",
"selector",
"value",
"represents",
"in",
"the",
"type",
"class",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/util/SelectorHelper.java#L53-L56 |
linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/DexMaker.java | DexMaker.generateAndLoad | public ClassLoader generateAndLoad(ClassLoader parent, File dexCache) throws IOException {
"""
Generates a dex file and loads its types into the current process.
<h3>Picking a dex cache directory</h3>
The {@code dexCache} should be an application-private directory. If
you pass a world-writable directory like ... | java | public ClassLoader generateAndLoad(ClassLoader parent, File dexCache) throws IOException {
if (dexCache == null) {
String property = System.getProperty("dexmaker.dexcache");
if (property != null) {
dexCache = new File(property);
} else {
dexCac... | [
"public",
"ClassLoader",
"generateAndLoad",
"(",
"ClassLoader",
"parent",
",",
"File",
"dexCache",
")",
"throws",
"IOException",
"{",
"if",
"(",
"dexCache",
"==",
"null",
")",
"{",
"String",
"property",
"=",
"System",
".",
"getProperty",
"(",
"\"dexmaker.dexcach... | Generates a dex file and loads its types into the current process.
<h3>Picking a dex cache directory</h3>
The {@code dexCache} should be an application-private directory. If
you pass a world-writable directory like {@code /sdcard} a malicious app
could inject code into your process. Most applications should use this:
... | [
"Generates",
"a",
"dex",
"file",
"and",
"loads",
"its",
"types",
"into",
"the",
"current",
"process",
"."
] | train | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/DexMaker.java#L500-L539 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java | DefaultElementProducer.createParagraph | public Paragraph createParagraph(Object data, Collection<? extends BaseStyler> stylers) throws VectorPrintException {
"""
Create a Paragraph, style it and add the data
@param data
@param stylers
@return
@throws VectorPrintException
"""
return initTextElementArray(styleHelper.style(new Paragraph(Flo... | java | public Paragraph createParagraph(Object data, Collection<? extends BaseStyler> stylers) throws VectorPrintException {
return initTextElementArray(styleHelper.style(new Paragraph(Float.NaN), data, stylers), data, stylers);
} | [
"public",
"Paragraph",
"createParagraph",
"(",
"Object",
"data",
",",
"Collection",
"<",
"?",
"extends",
"BaseStyler",
">",
"stylers",
")",
"throws",
"VectorPrintException",
"{",
"return",
"initTextElementArray",
"(",
"styleHelper",
".",
"style",
"(",
"new",
"Para... | Create a Paragraph, style it and add the data
@param data
@param stylers
@return
@throws VectorPrintException | [
"Create",
"a",
"Paragraph",
"style",
"it",
"and",
"add",
"the",
"data"
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java#L225-L227 |
wuman/orientdb-android | commons/src/main/java/com/orientechnologies/common/parser/OBaseParser.java | OBaseParser.parseOptionalWord | protected String parseOptionalWord(final boolean iUpperCase, final String... iWords) {
"""
Parses the next word. If any word is parsed it's checked against the word array received as parameter. If the parsed word is
not enlisted in it a SyntaxError exception is thrown. It returns the word parsed if any.
@param... | java | protected String parseOptionalWord(final boolean iUpperCase, final String... iWords) {
parserNextWord(iUpperCase);
if (iWords.length > 0) {
if (parserLastWord.length() == 0)
return null;
boolean found = false;
for (String w : iWords) {
if (parserLastWord.toString().e... | [
"protected",
"String",
"parseOptionalWord",
"(",
"final",
"boolean",
"iUpperCase",
",",
"final",
"String",
"...",
"iWords",
")",
"{",
"parserNextWord",
"(",
"iUpperCase",
")",
";",
"if",
"(",
"iWords",
".",
"length",
">",
"0",
")",
"{",
"if",
"(",
"parserL... | Parses the next word. If any word is parsed it's checked against the word array received as parameter. If the parsed word is
not enlisted in it a SyntaxError exception is thrown. It returns the word parsed if any.
@param iUpperCase
True if must return UPPERCASE, otherwise false
@return The word parsed if any, otherwis... | [
"Parses",
"the",
"next",
"word",
".",
"If",
"any",
"word",
"is",
"parsed",
"it",
"s",
"checked",
"against",
"the",
"word",
"array",
"received",
"as",
"parameter",
".",
"If",
"the",
"parsed",
"word",
"is",
"not",
"enlisted",
"in",
"it",
"a",
"SyntaxError"... | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/commons/src/main/java/com/orientechnologies/common/parser/OBaseParser.java#L71-L91 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.checkBucketName | private void checkBucketName(String name) throws InvalidBucketNameException {
"""
Validates if given bucket name is DNS compatible.
@throws InvalidBucketNameException upon invalid bucket name is given
"""
if (name == null) {
throw new InvalidBucketNameException(NULL_STRING, "null bucket name");
... | java | private void checkBucketName(String name) throws InvalidBucketNameException {
if (name == null) {
throw new InvalidBucketNameException(NULL_STRING, "null bucket name");
}
// Bucket names cannot be no less than 3 and no more than 63 characters long.
if (name.length() < 3 || name.length() > 63) {
... | [
"private",
"void",
"checkBucketName",
"(",
"String",
"name",
")",
"throws",
"InvalidBucketNameException",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidBucketNameException",
"(",
"NULL_STRING",
",",
"\"null bucket name\"",
")",
";",
"}",
... | Validates if given bucket name is DNS compatible.
@throws InvalidBucketNameException upon invalid bucket name is given | [
"Validates",
"if",
"given",
"bucket",
"name",
"is",
"DNS",
"compatible",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L759-L781 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java | ExcelUtil.readBySax | public static void readBySax(File file, int sheetIndex, RowHandler rowHandler) {
"""
通过Sax方式读取Excel,同时支持03和07格式
@param file Excel文件
@param sheetIndex sheet序号
@param rowHandler 行处理器
@since 3.2.0
"""
BufferedInputStream in = null;
try {
in = FileUtil.getInputStream(file);
readBySax(in, sheetI... | java | public static void readBySax(File file, int sheetIndex, RowHandler rowHandler) {
BufferedInputStream in = null;
try {
in = FileUtil.getInputStream(file);
readBySax(in, sheetIndex, rowHandler);
} finally {
IoUtil.close(in);
}
} | [
"public",
"static",
"void",
"readBySax",
"(",
"File",
"file",
",",
"int",
"sheetIndex",
",",
"RowHandler",
"rowHandler",
")",
"{",
"BufferedInputStream",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"FileUtil",
".",
"getInputStream",
"(",
"file",
")",
";... | 通过Sax方式读取Excel,同时支持03和07格式
@param file Excel文件
@param sheetIndex sheet序号
@param rowHandler 行处理器
@since 3.2.0 | [
"通过Sax方式读取Excel,同时支持03和07格式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java#L53-L61 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java | SvgGraphicsContext.drawGroup | public Element drawGroup(Object parent, Object object, String tagName) {
"""
Creates a group element in the technology (SVG/VML/...) of this context with the specified tag name.
@param parent
parent group object
@param object
group object
@param tagName
the tag name
@return element which was drawn
"""... | java | public Element drawGroup(Object parent, Object object, String tagName) {
if (isAttached()) {
return helper.drawGroup(parent, object, tagName);
} else {
return null;
}
} | [
"public",
"Element",
"drawGroup",
"(",
"Object",
"parent",
",",
"Object",
"object",
",",
"String",
"tagName",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"return",
"helper",
".",
"drawGroup",
"(",
"parent",
",",
"object",
",",
"tagName",
")",
... | Creates a group element in the technology (SVG/VML/...) of this context with the specified tag name.
@param parent
parent group object
@param object
group object
@param tagName
the tag name
@return element which was drawn | [
"Creates",
"a",
"group",
"element",
"in",
"the",
"technology",
"(",
"SVG",
"/",
"VML",
"/",
"...",
")",
"of",
"this",
"context",
"with",
"the",
"specified",
"tag",
"name",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java#L194-L200 |
stevespringett/Alpine | alpine/src/main/java/alpine/persistence/AlpineQueryManager.java | AlpineQueryManager.createEventServiceLog | public EventServiceLog createEventServiceLog(Class<? extends Subscriber> clazz) {
"""
Creates a new EventServiceLog. This method will automatically determine
if the subscriber is an implementation of {@link LoggableSubscriber} and
if so, will log the event. If not, then nothing will be logged and this
method wi... | java | public EventServiceLog createEventServiceLog(Class<? extends Subscriber> clazz) {
if (LoggableSubscriber.class.isAssignableFrom(clazz)) {
pm.currentTransaction().begin();
final EventServiceLog log = new EventServiceLog();
log.setSubscriberClass(clazz.getCanonicalName());
... | [
"public",
"EventServiceLog",
"createEventServiceLog",
"(",
"Class",
"<",
"?",
"extends",
"Subscriber",
">",
"clazz",
")",
"{",
"if",
"(",
"LoggableSubscriber",
".",
"class",
".",
"isAssignableFrom",
"(",
"clazz",
")",
")",
"{",
"pm",
".",
"currentTransaction",
... | Creates a new EventServiceLog. This method will automatically determine
if the subscriber is an implementation of {@link LoggableSubscriber} and
if so, will log the event. If not, then nothing will be logged and this
method will return null.
@param clazz the class of the subscriber task that handles the event
@return a... | [
"Creates",
"a",
"new",
"EventServiceLog",
".",
"This",
"method",
"will",
"automatically",
"determine",
"if",
"the",
"subscriber",
"is",
"an",
"implementation",
"of",
"{"
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/persistence/AlpineQueryManager.java#L659-L670 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/SubstructureIdentifier.java | SubstructureIdentifier.copyLigandsByProximity | protected static void copyLigandsByProximity(Structure full, Structure reduced, double cutoff, int fromModel, int toModel) {
"""
Supplements the reduced structure with ligands from the full structure based on
a distance cutoff. Ligand groups are moved (destructively) from full to reduced
if they fall within the ... | java | protected static void copyLigandsByProximity(Structure full, Structure reduced, double cutoff, int fromModel, int toModel) {
// Geometric hashing of the reduced structure
Grid grid = new Grid(cutoff);
Atom[] nonwaters = StructureTools.getAllNonHAtomArray(reduced,true,toModel);
if( nonwaters.length < 1 )
retu... | [
"protected",
"static",
"void",
"copyLigandsByProximity",
"(",
"Structure",
"full",
",",
"Structure",
"reduced",
",",
"double",
"cutoff",
",",
"int",
"fromModel",
",",
"int",
"toModel",
")",
"{",
"// Geometric hashing of the reduced structure",
"Grid",
"grid",
"=",
"... | Supplements the reduced structure with ligands from the full structure based on
a distance cutoff. Ligand groups are moved (destructively) from full to reduced
if they fall within the cutoff of any atom in the reduced structure.
@param full Structure containing all ligands
@param reduced Structure with a subset of the ... | [
"Supplements",
"the",
"reduced",
"structure",
"with",
"ligands",
"from",
"the",
"full",
"structure",
"based",
"on",
"a",
"distance",
"cutoff",
".",
"Ligand",
"groups",
"are",
"moved",
"(",
"destructively",
")",
"from",
"full",
"to",
"reduced",
"if",
"they",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/SubstructureIdentifier.java#L327-L362 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/delegated/zos/NativeMethodHelper.java | NativeMethodHelper.deregisterNatives | public static long deregisterNatives(long dllHandle, Class<?> clazz, String nativeDescriptorName, Object[] extraInfo) {
"""
Drive the deregistration hooks the native methods from the core DLL for the specified class.
@param clazz the class cleanup should occur for
@param nativeDescriptorName the name of the st... | java | public static long deregisterNatives(long dllHandle, Class<?> clazz, String nativeDescriptorName, Object[] extraInfo) {
if (!initialized) {
if (loadFailure != null) {
Error e = new UnsatisfiedLinkError();
e.initCause(loadFailure);
throw e;
... | [
"public",
"static",
"long",
"deregisterNatives",
"(",
"long",
"dllHandle",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"nativeDescriptorName",
",",
"Object",
"[",
"]",
"extraInfo",
")",
"{",
"if",
"(",
"!",
"initialized",
")",
"{",
"if",
"(",
"l... | Drive the deregistration hooks the native methods from the core DLL for the specified class.
@param clazz the class cleanup should occur for
@param nativeDescriptorName the name of the structure used for registration
@param dllHandle the DLL handle that was used during registration
@param extraInfo extra information p... | [
"Drive",
"the",
"deregistration",
"hooks",
"the",
"native",
"methods",
"from",
"the",
"core",
"DLL",
"for",
"the",
"specified",
"class",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/delegated/zos/NativeMethodHelper.java#L82-L94 |
haifengl/smile | demo/src/main/java/smile/demo/mds/SammonMappingDemo.java | SammonMappingDemo.learn | public JComponent learn() {
"""
Execute the MDS algorithm and return a swing JComponent representing
the clusters.
"""
JPanel pane = new JPanel(new GridLayout(1, 2));
double[][] data = dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]);
String[] labels = dataset[... | java | public JComponent learn() {
JPanel pane = new JPanel(new GridLayout(1, 2));
double[][] data = dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]);
String[] labels = dataset[datasetIndex].toArray(new String[dataset[datasetIndex].size()]);
if (labels[0] == null) {
... | [
"public",
"JComponent",
"learn",
"(",
")",
"{",
"JPanel",
"pane",
"=",
"new",
"JPanel",
"(",
"new",
"GridLayout",
"(",
"1",
",",
"2",
")",
")",
";",
"double",
"[",
"]",
"[",
"]",
"data",
"=",
"dataset",
"[",
"datasetIndex",
"]",
".",
"toArray",
"("... | Execute the MDS algorithm and return a swing JComponent representing
the clusters. | [
"Execute",
"the",
"MDS",
"algorithm",
"and",
"return",
"a",
"swing",
"JComponent",
"representing",
"the",
"clusters",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/demo/src/main/java/smile/demo/mds/SammonMappingDemo.java#L95-L124 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java | MathBindings.floorMod | public static LongBinding floorMod(final ObservableLongValue x, final ObservableLongValue y) {
"""
Binding for {@link java.lang.Math#floorMod(long, long)}
@param x the dividend
@param y the divisor
@return the floor modulus {@code x - (floorDiv(x, y) * y)}
@throws ArithmeticException if the divisor {@code y}... | java | public static LongBinding floorMod(final ObservableLongValue x, final ObservableLongValue y) {
return createLongBinding(() -> Math.floorMod(x.get(), y.get()), x, y);
} | [
"public",
"static",
"LongBinding",
"floorMod",
"(",
"final",
"ObservableLongValue",
"x",
",",
"final",
"ObservableLongValue",
"y",
")",
"{",
"return",
"createLongBinding",
"(",
"(",
")",
"->",
"Math",
".",
"floorMod",
"(",
"x",
".",
"get",
"(",
")",
",",
"... | Binding for {@link java.lang.Math#floorMod(long, long)}
@param x the dividend
@param y the divisor
@return the floor modulus {@code x - (floorDiv(x, y) * y)}
@throws ArithmeticException if the divisor {@code y} is zero | [
"Binding",
"for",
"{",
"@link",
"java",
".",
"lang",
".",
"Math#floorMod",
"(",
"long",
"long",
")",
"}"
] | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java#L530-L532 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java | EventSubscriptionsInner.listRegionalBySubscriptionForTopicTypeAsync | public Observable<List<EventSubscriptionInner>> listRegionalBySubscriptionForTopicTypeAsync(String location, String topicTypeName) {
"""
List all regional event subscriptions under an Azure subscription for a topic type.
List all event subscriptions from the given location under a specific Azure subscription and ... | java | public Observable<List<EventSubscriptionInner>> listRegionalBySubscriptionForTopicTypeAsync(String location, String topicTypeName) {
return listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync(location, topicTypeName).map(new Func1<ServiceResponse<List<EventSubscriptionInner>>, List<EventSubscriptionI... | [
"public",
"Observable",
"<",
"List",
"<",
"EventSubscriptionInner",
">",
">",
"listRegionalBySubscriptionForTopicTypeAsync",
"(",
"String",
"location",
",",
"String",
"topicTypeName",
")",
"{",
"return",
"listRegionalBySubscriptionForTopicTypeWithServiceResponseAsync",
"(",
"... | List all regional event subscriptions under an Azure subscription for a topic type.
List all event subscriptions from the given location under a specific Azure subscription and topic type.
@param location Name of the location
@param topicTypeName Name of the topic type
@throws IllegalArgumentException thrown if parame... | [
"List",
"all",
"regional",
"event",
"subscriptions",
"under",
"an",
"Azure",
"subscription",
"for",
"a",
"topic",
"type",
".",
"List",
"all",
"event",
"subscriptions",
"from",
"the",
"given",
"location",
"under",
"a",
"specific",
"Azure",
"subscription",
"and",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java#L1394-L1401 |
notnoop/java-apns | src/main/java/com/notnoop/apns/PayloadBuilder.java | PayloadBuilder.resizeAlertBody | public PayloadBuilder resizeAlertBody(final int payloadLength, final String postfix) {
"""
Shrinks the alert message body so that the resulting payload
message fits within the passed expected payload length.
This method performs best-effort approach, and its behavior
is unspecified when handling alerts where ... | java | public PayloadBuilder resizeAlertBody(final int payloadLength, final String postfix) {
int currLength = length();
if (currLength <= payloadLength) {
return this;
}
// now we are sure that truncation is required
String body = (String)customAlert.get("body");
... | [
"public",
"PayloadBuilder",
"resizeAlertBody",
"(",
"final",
"int",
"payloadLength",
",",
"final",
"String",
"postfix",
")",
"{",
"int",
"currLength",
"=",
"length",
"(",
")",
";",
"if",
"(",
"currLength",
"<=",
"payloadLength",
")",
"{",
"return",
"this",
"... | Shrinks the alert message body so that the resulting payload
message fits within the passed expected payload length.
This method performs best-effort approach, and its behavior
is unspecified when handling alerts where the payload
without body is already longer than the permitted size, or
if the break occurs within wo... | [
"Shrinks",
"the",
"alert",
"message",
"body",
"so",
"that",
"the",
"resulting",
"payload",
"message",
"fits",
"within",
"the",
"passed",
"expected",
"payload",
"length",
"."
] | train | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/PayloadBuilder.java#L401-L428 |
demidenko05/beigesoft-orm | src/main/java/org/beigesoft/orm/service/ASrvOrm.java | ASrvOrm.retrieveListForField | @Override
public final <T> List<T> retrieveListForField(
final Map<String, Object> pAddParam,
final T pEntity, final String pFieldFor) throws Exception {
"""
<p>Entity's lists with filter "field" (e.g. invoice lines for invoice).</p>
@param <T> - type of entity
@param pAddParam additional param, e.g.... | java | @Override
public final <T> List<T> retrieveListForField(
final Map<String, Object> pAddParam,
final T pEntity, final String pFieldFor) throws Exception {
String whereStr = evalWhereForField(pAddParam, pEntity, pFieldFor);
String query = evalSqlSelect(pAddParam, pEntity.getClass())
+ whereStr +... | [
"@",
"Override",
"public",
"final",
"<",
"T",
">",
"List",
"<",
"T",
">",
"retrieveListForField",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"pAddParam",
",",
"final",
"T",
"pEntity",
",",
"final",
"String",
"pFieldFor",
")",
"throws",
"Exce... | <p>Entity's lists with filter "field" (e.g. invoice lines for invoice).</p>
@param <T> - type of entity
@param pAddParam additional param, e.g. already retrieved TableSql
@param pEntity - Entity e.g. an invoice line with filled invoice
@param pFieldFor - Field For name e.g. "invoice"
@return list of business objects or... | [
"<p",
">",
"Entity",
"s",
"lists",
"with",
"filter",
"field",
"(",
"e",
".",
"g",
".",
"invoice",
"lines",
"for",
"invoice",
")",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-orm/blob/f1b2c70701a111741a436911ca24ef9d38eba0b9/src/main/java/org/beigesoft/orm/service/ASrvOrm.java#L379-L389 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/model/BaseDescribeableDrawerItem.java | BaseDescribeableDrawerItem.bindViewHelper | protected void bindViewHelper(BaseViewHolder viewHolder) {
"""
a helper method to have the logic for all secondaryDrawerItems only once
@param viewHolder
"""
Context ctx = viewHolder.itemView.getContext();
//set the identifier from the drawerItem here. It can be used to run tests
vi... | java | protected void bindViewHelper(BaseViewHolder viewHolder) {
Context ctx = viewHolder.itemView.getContext();
//set the identifier from the drawerItem here. It can be used to run tests
viewHolder.itemView.setId(hashCode());
//set the item selected if it is
viewHolder.itemView.setS... | [
"protected",
"void",
"bindViewHelper",
"(",
"BaseViewHolder",
"viewHolder",
")",
"{",
"Context",
"ctx",
"=",
"viewHolder",
".",
"itemView",
".",
"getContext",
"(",
")",
";",
"//set the identifier from the drawerItem here. It can be used to run tests",
"viewHolder",
".",
"... | a helper method to have the logic for all secondaryDrawerItems only once
@param viewHolder | [
"a",
"helper",
"method",
"to",
"have",
"the",
"logic",
"for",
"all",
"secondaryDrawerItems",
"only",
"once"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/model/BaseDescribeableDrawerItem.java#L58-L108 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.eachLine | public static <T> T eachLine(CharSequence self, @ClosureParams(value=FromString.class, options= {
"""
Iterates through this CharSequence line by line. Each line is passed
to the given 1 or 2 arg closure. If a 2 arg closure is found
the line count is passed as the second argument.
@param self a CharSequenc... | java | public static <T> T eachLine(CharSequence self, @ClosureParams(value=FromString.class, options={"String","String,Integer"}) Closure<T> closure) throws IOException {
return eachLine(self.toString(), 0, closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"eachLine",
"(",
"CharSequence",
"self",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"{",
"\"String\"",
",",
"\"String,Integer\"",
"}",
")",
"Closure",
"<",
"T",
"... | Iterates through this CharSequence line by line. Each line is passed
to the given 1 or 2 arg closure. If a 2 arg closure is found
the line count is passed as the second argument.
@param self a CharSequence
@param closure a closure
@return the last value returned by the closure
@throws java.io.IOException if an err... | [
"Iterates",
"through",
"this",
"CharSequence",
"line",
"by",
"line",
".",
"Each",
"line",
"is",
"passed",
"to",
"the",
"given",
"1",
"or",
"2",
"arg",
"closure",
".",
"If",
"a",
"2",
"arg",
"closure",
"is",
"found",
"the",
"line",
"count",
"is",
"passe... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L594-L596 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/MembershipHandlerImpl.java | MembershipHandlerImpl.findMembershipsByUserAndGroup | private Collection<Membership> findMembershipsByUserAndGroup(Session session, String userName, String groupId) throws Exception {
"""
Use this method to find all the memberships of an user in a group.
"""
Node groupNode;
Node refUserNode;
try
{
groupNode = utils.getGroupNode(s... | java | private Collection<Membership> findMembershipsByUserAndGroup(Session session, String userName, String groupId) throws Exception
{
Node groupNode;
Node refUserNode;
try
{
groupNode = utils.getGroupNode(session, groupId);
refUserNode = groupNode.getNode(JCROrganizationService... | [
"private",
"Collection",
"<",
"Membership",
">",
"findMembershipsByUserAndGroup",
"(",
"Session",
"session",
",",
"String",
"userName",
",",
"String",
"groupId",
")",
"throws",
"Exception",
"{",
"Node",
"groupNode",
";",
"Node",
"refUserNode",
";",
"try",
"{",
"... | Use this method to find all the memberships of an user in a group. | [
"Use",
"this",
"method",
"to",
"find",
"all",
"the",
"memberships",
"of",
"an",
"user",
"in",
"a",
"group",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/MembershipHandlerImpl.java#L427-L443 |
aws/aws-sdk-java | aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/model/EnhancedMetrics.java | EnhancedMetrics.getShardLevelMetrics | public java.util.List<String> getShardLevelMetrics() {
"""
<p>
List of shard-level metrics.
</p>
<p>
The following are the valid shard-level metrics. The value "<code>ALL</code>" enhances every metric.
</p>
<ul>
<li>
<p>
<code>IncomingBytes</code>
</p>
</li>
<li>
<p>
<code>IncomingRecords</code>
</p... | java | public java.util.List<String> getShardLevelMetrics() {
if (shardLevelMetrics == null) {
shardLevelMetrics = new com.amazonaws.internal.SdkInternalList<String>();
}
return shardLevelMetrics;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"getShardLevelMetrics",
"(",
")",
"{",
"if",
"(",
"shardLevelMetrics",
"==",
"null",
")",
"{",
"shardLevelMetrics",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalList",
... | <p>
List of shard-level metrics.
</p>
<p>
The following are the valid shard-level metrics. The value "<code>ALL</code>" enhances every metric.
</p>
<ul>
<li>
<p>
<code>IncomingBytes</code>
</p>
</li>
<li>
<p>
<code>IncomingRecords</code>
</p>
</li>
<li>
<p>
<code>OutgoingBytes</code>
</p>
</li>
<li>
<p>
<code>OutgoingR... | [
"<p",
">",
"List",
"of",
"shard",
"-",
"level",
"metrics",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"following",
"are",
"the",
"valid",
"shard",
"-",
"level",
"metrics",
".",
"The",
"value",
"<code",
">",
"ALL<",
"/",
"code",
">",
"enhances",
"ev... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/model/EnhancedMetrics.java#L199-L204 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java | SARLOperationHelper._hasSideEffects | protected Boolean _hasSideEffects(XAssignment expression, ISideEffectContext context) {
"""
Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects.
"""
if (internalHasOperati... | java | protected Boolean _hasSideEffects(XAssignment expression, ISideEffectContext context) {
if (internalHasOperationSideEffects(expression, context, true)) {
return true;
}
if (hasSideEffects(expression.getValue(), context)) {
return true;
}
final JvmIdentifiableElement feature = expression.getFeature();
... | [
"protected",
"Boolean",
"_hasSideEffects",
"(",
"XAssignment",
"expression",
",",
"ISideEffectContext",
"context",
")",
"{",
"if",
"(",
"internalHasOperationSideEffects",
"(",
"expression",
",",
"context",
",",
"true",
")",
")",
"{",
"return",
"true",
";",
"}",
... | Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects. | [
"Test",
"if",
"the",
"given",
"expression",
"has",
"side",
"effects",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java#L568-L580 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyRawHelper.java | ModifyRawHelper.generateWhereCondition | public static void generateWhereCondition(MethodSpec.Builder methodBuilder, SQLiteModelMethod method, Pair<String, List<Pair<String, TypeName>>> where) {
"""
Generate where condition.
@param methodBuilder
the method builder
@param method
the method
@param where
the where
"""
boolean nullable;
// m... | java | public static void generateWhereCondition(MethodSpec.Builder methodBuilder, SQLiteModelMethod method, Pair<String, List<Pair<String, TypeName>>> where) {
boolean nullable;
// methodBuilder.addStatement("$T<String>
// _sqlWhereParams=getWhereParamsArray()", ArrayList.class);
for (Pair<String, TypeName> item : ... | [
"public",
"static",
"void",
"generateWhereCondition",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"SQLiteModelMethod",
"method",
",",
"Pair",
"<",
"String",
",",
"List",
"<",
"Pair",
"<",
"String",
",",
"TypeName",
">",
">",
">",
"where",
")",
"... | Generate where condition.
@param methodBuilder
the method builder
@param method
the method
@param where
the where | [
"Generate",
"where",
"condition",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyRawHelper.java#L589-L620 |
groundupworks/wings | wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookEndpoint.java | FacebookEndpoint.startPublishPermissionsRequest | private boolean startPublishPermissionsRequest(Activity activity, Fragment fragment) {
"""
Requests for permissions to publish publicly. Requires an opened active {@link Session}.
@param activity the {@link Activity}.
@param fragment the {@link Fragment}. May be null.
@return true if the request is made; fals... | java | private boolean startPublishPermissionsRequest(Activity activity, Fragment fragment) {
boolean isSuccessful = false;
// State transition.
mLinkRequestState = STATE_PUBLISH_PERMISSIONS_REQUEST;
Session session = Session.getActiveSession();
if (session != null && session.isOpened... | [
"private",
"boolean",
"startPublishPermissionsRequest",
"(",
"Activity",
"activity",
",",
"Fragment",
"fragment",
")",
"{",
"boolean",
"isSuccessful",
"=",
"false",
";",
"// State transition.",
"mLinkRequestState",
"=",
"STATE_PUBLISH_PERMISSIONS_REQUEST",
";",
"Session",
... | Requests for permissions to publish publicly. Requires an opened active {@link Session}.
@param activity the {@link Activity}.
@param fragment the {@link Fragment}. May be null.
@return true if the request is made; false if no opened {@link Session} is active. | [
"Requests",
"for",
"permissions",
"to",
"publish",
"publicly",
".",
"Requires",
"an",
"opened",
"active",
"{",
"@link",
"Session",
"}",
"."
] | train | https://github.com/groundupworks/wings/blob/03d2827c30ef55f2db4e23f7500e016c7771fa39/wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookEndpoint.java#L386-L416 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/text/PlainTextMessageValidator.java | PlainTextMessageValidator.processVariableStatements | private String processVariableStatements(String control, String result, TestContext context) {
"""
Processes nested ignore statements in control value and replaces that ignore placeholder with the actual value at this position.
This way we can ignore words in a plaintext value.
@param control
@param result
@pa... | java | private String processVariableStatements(String control, String result, TestContext context) {
if (control.equals(Citrus.IGNORE_PLACEHOLDER)) {
return control;
}
Pattern whitespacePattern = Pattern.compile("[^a-zA-Z_0-9\\-\\.]");
Pattern variablePattern = Pattern.compile("@v... | [
"private",
"String",
"processVariableStatements",
"(",
"String",
"control",
",",
"String",
"result",
",",
"TestContext",
"context",
")",
"{",
"if",
"(",
"control",
".",
"equals",
"(",
"Citrus",
".",
"IGNORE_PLACEHOLDER",
")",
")",
"{",
"return",
"control",
";"... | Processes nested ignore statements in control value and replaces that ignore placeholder with the actual value at this position.
This way we can ignore words in a plaintext value.
@param control
@param result
@param context
@return | [
"Processes",
"nested",
"ignore",
"statements",
"in",
"control",
"value",
"and",
"replaces",
"that",
"ignore",
"placeholder",
"with",
"the",
"actual",
"value",
"at",
"this",
"position",
".",
"This",
"way",
"we",
"can",
"ignore",
"words",
"in",
"a",
"plaintext",... | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/text/PlainTextMessageValidator.java#L138-L160 |
lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigWebFactory.java | XMLConfigWebFactory.toBoolean | private static boolean toBoolean(String value, boolean defaultValue) {
"""
cast a string value to a boolean
@param value String value represent a booolean ("yes", "no","true" aso.)
@param defaultValue if can't cast to a boolean is value will be returned
@return boolean value
"""
if (value == null || val... | java | private static boolean toBoolean(String value, boolean defaultValue) {
if (value == null || value.trim().length() == 0) return defaultValue;
try {
return Caster.toBooleanValue(value.trim());
}
catch (PageException e) {
return defaultValue;
}
} | [
"private",
"static",
"boolean",
"toBoolean",
"(",
"String",
"value",
",",
"boolean",
"defaultValue",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
"return",
"defaultValue",
";... | cast a string value to a boolean
@param value String value represent a booolean ("yes", "no","true" aso.)
@param defaultValue if can't cast to a boolean is value will be returned
@return boolean value | [
"cast",
"a",
"string",
"value",
"to",
"a",
"boolean"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigWebFactory.java#L4891-L4901 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java | DynamicReportBuilder.addField | public DynamicReportBuilder addField(String name, String className) {
"""
Registers a field that is not necesary bound to a column, it can be used
in a custom expression
@param name
@param className
@return
"""
return addField(new ColumnProperty(name, className));
} | java | public DynamicReportBuilder addField(String name, String className) {
return addField(new ColumnProperty(name, className));
} | [
"public",
"DynamicReportBuilder",
"addField",
"(",
"String",
"name",
",",
"String",
"className",
")",
"{",
"return",
"addField",
"(",
"new",
"ColumnProperty",
"(",
"name",
",",
"className",
")",
")",
";",
"}"
] | Registers a field that is not necesary bound to a column, it can be used
in a custom expression
@param name
@param className
@return | [
"Registers",
"a",
"field",
"that",
"is",
"not",
"necesary",
"bound",
"to",
"a",
"column",
"it",
"can",
"be",
"used",
"in",
"a",
"custom",
"expression"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java#L909-L911 |
google/closure-templates | java/src/com/google/template/soy/data/UnsafeSanitizedContentOrdainer.java | UnsafeSanitizedContentOrdainer.ordainAsSafe | public static SanitizedContent ordainAsSafe(String value, ContentKind kind) {
"""
Faithfully assumes the provided value is "safe" and marks it not to be re-escaped. The value's
direction is assumed to be LTR for JS, URI, ATTRIBUTES, and CSS content, and otherwise unknown.
<p>When you "ordain" a string as safe ... | java | public static SanitizedContent ordainAsSafe(String value, ContentKind kind) {
return ordainAsSafe(value, kind, kind.getDefaultDir());
} | [
"public",
"static",
"SanitizedContent",
"ordainAsSafe",
"(",
"String",
"value",
",",
"ContentKind",
"kind",
")",
"{",
"return",
"ordainAsSafe",
"(",
"value",
",",
"kind",
",",
"kind",
".",
"getDefaultDir",
"(",
")",
")",
";",
"}"
] | Faithfully assumes the provided value is "safe" and marks it not to be re-escaped. The value's
direction is assumed to be LTR for JS, URI, ATTRIBUTES, and CSS content, and otherwise unknown.
<p>When you "ordain" a string as safe content, it means that Soy will NOT re-escape or validate
the contents if printed in the r... | [
"Faithfully",
"assumes",
"the",
"provided",
"value",
"is",
"safe",
"and",
"marks",
"it",
"not",
"to",
"be",
"re",
"-",
"escaped",
".",
"The",
"value",
"s",
"direction",
"is",
"assumed",
"to",
"be",
"LTR",
"for",
"JS",
"URI",
"ATTRIBUTES",
"and",
"CSS",
... | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/UnsafeSanitizedContentOrdainer.java#L60-L62 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/util/ProjectUtilities.java | ProjectUtilities.addFindBugsNature | public static void addFindBugsNature(IProject project, IProgressMonitor monitor) throws CoreException {
"""
Adds a FindBugs nature to a project.
@param project
The project the nature will be applied to.
@param monitor
A progress monitor. Must not be null.
@throws CoreException
"""
if (hasFindBug... | java | public static void addFindBugsNature(IProject project, IProgressMonitor monitor) throws CoreException {
if (hasFindBugsNature(project)) {
return;
}
IProjectDescription description = project.getDescription();
String[] prevNatures = description.getNatureIds();
for (int ... | [
"public",
"static",
"void",
"addFindBugsNature",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"CoreException",
"{",
"if",
"(",
"hasFindBugsNature",
"(",
"project",
")",
")",
"{",
"return",
";",
"}",
"IProjectDescription",
"descrip... | Adds a FindBugs nature to a project.
@param project
The project the nature will be applied to.
@param monitor
A progress monitor. Must not be null.
@throws CoreException | [
"Adds",
"a",
"FindBugs",
"nature",
"to",
"a",
"project",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/util/ProjectUtilities.java#L56-L79 |
haifengl/smile | math/src/main/java/smile/math/matrix/PowerIteration.java | PowerIteration.ax | private static double ax(Matrix A, double[] x, double[] y, double p) {
"""
Calculate and normalize y = (A - pI) x.
Returns the largest element of y in magnitude.
"""
A.ax(x, y);
if (p != 0.0) {
for (int i = 0; i < y.length; i++) {
y[i] -= p * x[i];
}
... | java | private static double ax(Matrix A, double[] x, double[] y, double p) {
A.ax(x, y);
if (p != 0.0) {
for (int i = 0; i < y.length; i++) {
y[i] -= p * x[i];
}
}
double lambda = y[0];
for (int i = 1; i < y.length; i++) {
if (Math.... | [
"private",
"static",
"double",
"ax",
"(",
"Matrix",
"A",
",",
"double",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"y",
",",
"double",
"p",
")",
"{",
"A",
".",
"ax",
"(",
"x",
",",
"y",
")",
";",
"if",
"(",
"p",
"!=",
"0.0",
")",
"{",
"for",
... | Calculate and normalize y = (A - pI) x.
Returns the largest element of y in magnitude. | [
"Calculate",
"and",
"normalize",
"y",
"=",
"(",
"A",
"-",
"pI",
")",
"x",
".",
"Returns",
"the",
"largest",
"element",
"of",
"y",
"in",
"magnitude",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/matrix/PowerIteration.java#L174-L195 |
jamesagnew/hapi-fhir | hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Meta.java | Meta.addTag | public Meta addTag(String theSystem, String theCode, String theDisplay) {
"""
Convenience method which adds a tag
@param theSystem The code system
@param theCode The code
@param theDisplay The display name
@return Returns a reference to <code>this</code> for easy chaining
"""
addTag().setSystem(the... | java | public Meta addTag(String theSystem, String theCode, String theDisplay) {
addTag().setSystem(theSystem).setCode(theCode).setDisplay(theDisplay);
return this;
} | [
"public",
"Meta",
"addTag",
"(",
"String",
"theSystem",
",",
"String",
"theCode",
",",
"String",
"theDisplay",
")",
"{",
"addTag",
"(",
")",
".",
"setSystem",
"(",
"theSystem",
")",
".",
"setCode",
"(",
"theCode",
")",
".",
"setDisplay",
"(",
"theDisplay",... | Convenience method which adds a tag
@param theSystem The code system
@param theCode The code
@param theDisplay The display name
@return Returns a reference to <code>this</code> for easy chaining | [
"Convenience",
"method",
"which",
"adds",
"a",
"tag"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/Meta.java#L371-L374 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/lb/lbvserver_stats.java | lbvserver_stats.get | public static lbvserver_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of lbvserver_stats resource of given name .
"""
lbvserver_stats obj = new lbvserver_stats();
obj.set_name(name);
lbvserver_stats response = (lbvserver_stats) obj.stat_resource(ser... | java | public static lbvserver_stats get(nitro_service service, String name) throws Exception{
lbvserver_stats obj = new lbvserver_stats();
obj.set_name(name);
lbvserver_stats response = (lbvserver_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"lbvserver_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"lbvserver_stats",
"obj",
"=",
"new",
"lbvserver_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"lbv... | Use this API to fetch statistics of lbvserver_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"lbvserver_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/lb/lbvserver_stats.java#L517-L522 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/ApiUtils.java | ApiUtils.getContextByName | public static Context getContextByName(String contextName) throws ApiException {
"""
Returns the {@code Context} with the given name.
@param contextName the name of the context
@return the {@code Context} with the given name
@throws ApiException If the context with the given name does not exist
@since 2.4.3
... | java | public static Context getContextByName(String contextName) throws ApiException {
Context context = Model.getSingleton().getSession().getContext(contextName);
if (context == null) {
throw new ApiException(ApiException.Type.DOES_NOT_EXIST, contextName);
}
return context;
} | [
"public",
"static",
"Context",
"getContextByName",
"(",
"String",
"contextName",
")",
"throws",
"ApiException",
"{",
"Context",
"context",
"=",
"Model",
".",
"getSingleton",
"(",
")",
".",
"getSession",
"(",
")",
".",
"getContext",
"(",
"contextName",
")",
";"... | Returns the {@code Context} with the given name.
@param contextName the name of the context
@return the {@code Context} with the given name
@throws ApiException If the context with the given name does not exist
@since 2.4.3
@see #getContextByName(JSONObject, String) | [
"Returns",
"the",
"{",
"@code",
"Context",
"}",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/ApiUtils.java#L186-L192 |
moparisthebest/beehive | beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java | GenStrutsApp.getMatchingFormBeans | List getMatchingFormBeans( TypeDeclaration formType, Boolean usesPageFlowScopedFormBean ) {
"""
Returns a non-empty List of FormBeanModels that match the given form
bean type. The <code>usesPageFlowScopedFormBean</code> parameter can
be used to get the FormBeanModel for either a page flow scoped bean
(<code>tru... | java | List getMatchingFormBeans( TypeDeclaration formType, Boolean usesPageFlowScopedFormBean )
{
//
// Use the actual type of form to create the name.
// This avoids conflicts if there are multiple forms using the
// ANY_FORM_CLASS_NAME type.
//
String actualType = Compile... | [
"List",
"getMatchingFormBeans",
"(",
"TypeDeclaration",
"formType",
",",
"Boolean",
"usesPageFlowScopedFormBean",
")",
"{",
"//",
"// Use the actual type of form to create the name.",
"// This avoids conflicts if there are multiple forms using the",
"// ANY_FORM_CLASS_NAME type.",
"//",
... | Returns a non-empty List of FormBeanModels that match the given form
bean type. The <code>usesPageFlowScopedFormBean</code> parameter can
be used to get the FormBeanModel for either a page flow scoped bean
(<code>true</code>), not flow scoped (<code>false</code>), or both
(<code>null</code>).
@param formType the form b... | [
"Returns",
"a",
"non",
"-",
"empty",
"List",
"of",
"FormBeanModels",
"that",
"match",
"the",
"given",
"form",
"bean",
"type",
".",
"The",
"<code",
">",
"usesPageFlowScopedFormBean<",
"/",
"code",
">",
"parameter",
"can",
"be",
"used",
"to",
"get",
"the",
"... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java#L153-L181 |
augustd/burp-suite-utils | src/main/java/com/codemagi/burp/ActiveScan.java | ActiveScan.consolidateDuplicateIssues | @Override
public int consolidateDuplicateIssues(IScanIssue existingIssue, IScanIssue newIssue) {
"""
This method is called when multiple issues are reported for the same URL
path by the same extension-provided check. The value we return from this
method determines how/whether Burp consolidates the multiple issu... | java | @Override
public int consolidateDuplicateIssues(IScanIssue existingIssue, IScanIssue newIssue) {
if (existingIssue.getIssueDetail().equals(newIssue.getIssueDetail())) {
callbacks.printOutput("DUPLICATE ISSUE! Consolidating...");
return -1;
} else {
return 0;
}
} | [
"@",
"Override",
"public",
"int",
"consolidateDuplicateIssues",
"(",
"IScanIssue",
"existingIssue",
",",
"IScanIssue",
"newIssue",
")",
"{",
"if",
"(",
"existingIssue",
".",
"getIssueDetail",
"(",
")",
".",
"equals",
"(",
"newIssue",
".",
"getIssueDetail",
"(",
... | This method is called when multiple issues are reported for the same URL
path by the same extension-provided check. The value we return from this
method determines how/whether Burp consolidates the multiple issues to
prevent duplication.
Since the issue detail is sufficient to identify our issues as different,
if both... | [
"This",
"method",
"is",
"called",
"when",
"multiple",
"issues",
"are",
"reported",
"for",
"the",
"same",
"URL",
"path",
"by",
"the",
"same",
"extension",
"-",
"provided",
"check",
".",
"The",
"value",
"we",
"return",
"from",
"this",
"method",
"determines",
... | train | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/ActiveScan.java#L160-L168 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java | VirtualMachineScaleSetVMsInner.beginUpdateAsync | public Observable<VirtualMachineScaleSetVMInner> beginUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) {
"""
Updates a virtual machine of a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The n... | java | public Observable<VirtualMachineScaleSetVMInner> beginUpdateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).map(new Func1<ServiceResponse<Vi... | [
"public",
"Observable",
"<",
"VirtualMachineScaleSetVMInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"String",
"instanceId",
",",
"VirtualMachineScaleSetVMInner",
"parameters",
")",
"{",
"return",
"beginUpdateWithS... | Updates a virtual machine of a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set where the extension should be create or updated.
@param instanceId The instance ID of the virtual machine.
@param parameters Parameters supplied to the Update Virtual... | [
"Updates",
"a",
"virtual",
"machine",
"of",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java#L798-L805 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.andLessThan | public ZealotKhala andLessThan(String field, Object value) {
"""
生成带" AND "前缀小于查询的SQL片段.
@param field 数据库字段
@param value 值
@return ZealotKhala实例
"""
return this.doNormal(ZealotConst.AND_PREFIX, field, value, ZealotConst.LT_SUFFIX, true);
} | java | public ZealotKhala andLessThan(String field, Object value) {
return this.doNormal(ZealotConst.AND_PREFIX, field, value, ZealotConst.LT_SUFFIX, true);
} | [
"public",
"ZealotKhala",
"andLessThan",
"(",
"String",
"field",
",",
"Object",
"value",
")",
"{",
"return",
"this",
".",
"doNormal",
"(",
"ZealotConst",
".",
"AND_PREFIX",
",",
"field",
",",
"value",
",",
"ZealotConst",
".",
"LT_SUFFIX",
",",
"true",
")",
... | 生成带" AND "前缀小于查询的SQL片段.
@param field 数据库字段
@param value 值
@return ZealotKhala实例 | [
"生成带",
"AND",
"前缀小于查询的SQL片段",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L732-L734 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java | ST_LineIntersector.addGeometryToSegments | public static void addGeometryToSegments(Geometry geometry, int flag, ArrayList<SegmentString> segments) {
"""
Convert the a geometry as a list of segments and mark it with a flag
@param geometry
@param flag
@param segments
"""
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geom... | java | public static void addGeometryToSegments(Geometry geometry, int flag, ArrayList<SegmentString> segments) {
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geometry component = geometry.getGeometryN(i);
if (component instanceof Polygon) {
add((Polygon) component, f... | [
"public",
"static",
"void",
"addGeometryToSegments",
"(",
"Geometry",
"geometry",
",",
"int",
"flag",
",",
"ArrayList",
"<",
"SegmentString",
">",
"segments",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"geometry",
".",
"getNumGeometries",
"... | Convert the a geometry as a list of segments and mark it with a flag
@param geometry
@param flag
@param segments | [
"Convert",
"the",
"a",
"geometry",
"as",
"a",
"list",
"of",
"segments",
"and",
"mark",
"it",
"with",
"a",
"flag"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java#L114-L123 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/EventCollector.java | EventCollector.addEvent | private void addEvent(JobID jobID, AbstractEvent event) {
"""
Adds an event to the job's event list.
@param jobID
the ID of the job the event belongs to
@param event
the event to be added to the job's event list
"""
synchronized (this.collectedEvents) {
List<AbstractEvent> eventList = this.collect... | java | private void addEvent(JobID jobID, AbstractEvent event) {
synchronized (this.collectedEvents) {
List<AbstractEvent> eventList = this.collectedEvents.get(jobID);
if (eventList == null) {
eventList = new ArrayList<AbstractEvent>();
this.collectedEvents.put(jobID, eventList);
}
eventList.add(event... | [
"private",
"void",
"addEvent",
"(",
"JobID",
"jobID",
",",
"AbstractEvent",
"event",
")",
"{",
"synchronized",
"(",
"this",
".",
"collectedEvents",
")",
"{",
"List",
"<",
"AbstractEvent",
">",
"eventList",
"=",
"this",
".",
"collectedEvents",
".",
"get",
"("... | Adds an event to the job's event list.
@param jobID
the ID of the job the event belongs to
@param event
the event to be added to the job's event list | [
"Adds",
"an",
"event",
"to",
"the",
"job",
"s",
"event",
"list",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/EventCollector.java#L407-L419 |
ruifigueira/platypus | src/main/java/platypus/internal/Classes.java | Classes.getAllInterfaces | private static void getAllInterfaces(Class<?> cls, Collection<Class<?>> interfacesFound) {
"""
Get the interfaces for the specified class.
@param cls the class to look up, may be <code>null</code>
@param interfacesFound the <code>Set</code> of interfaces for the class
"""
while (cls != null) {
... | java | private static void getAllInterfaces(Class<?> cls, Collection<Class<?>> interfacesFound) {
while (cls != null) {
Class<?>[] interfaces = cls.getInterfaces();
for (int i = 0; i < interfaces.length; i++) {
interfacesFound.add(interfaces[i]);
getAllInterface... | [
"private",
"static",
"void",
"getAllInterfaces",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"Collection",
"<",
"Class",
"<",
"?",
">",
">",
"interfacesFound",
")",
"{",
"while",
"(",
"cls",
"!=",
"null",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"i... | Get the interfaces for the specified class.
@param cls the class to look up, may be <code>null</code>
@param interfacesFound the <code>Set</code> of interfaces for the class | [
"Get",
"the",
"interfaces",
"for",
"the",
"specified",
"class",
"."
] | train | https://github.com/ruifigueira/platypus/blob/d848de1a7af1171307e955cb73783efd626a8af8/src/main/java/platypus/internal/Classes.java#L54-L65 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/script/Script.java | Script.getPubKeys | public List<ECKey> getPubKeys() {
"""
Returns a list of the keys required by this script, assuming a multi-sig script.
@throws ScriptException if the script type is not understood or is pay to address or is P2SH (run this method on the "Redeem script" instead).
"""
if (!ScriptPattern.isSentToMultisi... | java | public List<ECKey> getPubKeys() {
if (!ScriptPattern.isSentToMultisig(this))
throw new ScriptException(ScriptError.SCRIPT_ERR_UNKNOWN_ERROR, "Only usable for multisig scripts.");
ArrayList<ECKey> result = Lists.newArrayList();
int numKeys = Script.decodeFromOpN(chunks.get(chunks.siz... | [
"public",
"List",
"<",
"ECKey",
">",
"getPubKeys",
"(",
")",
"{",
"if",
"(",
"!",
"ScriptPattern",
".",
"isSentToMultisig",
"(",
"this",
")",
")",
"throw",
"new",
"ScriptException",
"(",
"ScriptError",
".",
"SCRIPT_ERR_UNKNOWN_ERROR",
",",
"\"Only usable for mul... | Returns a list of the keys required by this script, assuming a multi-sig script.
@throws ScriptException if the script type is not understood or is pay to address or is P2SH (run this method on the "Redeem script" instead). | [
"Returns",
"a",
"list",
"of",
"the",
"keys",
"required",
"by",
"this",
"script",
"assuming",
"a",
"multi",
"-",
"sig",
"script",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/Script.java#L482-L491 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java | UseVarArgs.hasMethod | private static boolean hasMethod(JavaClass c, Method candidateMethod) {
"""
looks to see if a class has a method with a specific name and signature
@param c the class to check
@param candidateMethod the method to look for
@return whether this class has the exact method
"""
String name = ... | java | private static boolean hasMethod(JavaClass c, Method candidateMethod) {
String name = candidateMethod.getName();
String sig = candidateMethod.getSignature();
for (Method method : c.getMethods()) {
if (!method.isStatic() && method.getName().equals(name) && method.getSignature().equals(sig)) {
return true;
... | [
"private",
"static",
"boolean",
"hasMethod",
"(",
"JavaClass",
"c",
",",
"Method",
"candidateMethod",
")",
"{",
"String",
"name",
"=",
"candidateMethod",
".",
"getName",
"(",
")",
";",
"String",
"sig",
"=",
"candidateMethod",
".",
"getSignature",
"(",
")",
"... | looks to see if a class has a method with a specific name and signature
@param c the class to check
@param candidateMethod the method to look for
@return whether this class has the exact method | [
"looks",
"to",
"see",
"if",
"a",
"class",
"has",
"a",
"method",
"with",
"a",
"specific",
"name",
"and",
"signature"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/UseVarArgs.java#L206-L217 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/CUtil.java | CUtil.getPathFromEnvironment | public static File[] getPathFromEnvironment(final String envVariable, final String delim) {
"""
Returns an array of File for each existing directory in the specified
environment variable
@param envVariable
environment variable name such as "LIB" or "INCLUDE"
@param delim
delimitor used to separate parts of ... | java | public static File[] getPathFromEnvironment(final String envVariable, final String delim) {
// OS/4000 does not support the env command.
if (System.getProperty("os.name").equals("OS/400")) {
return new File[] {};
}
final Vector osEnv = Execute.getProcEnvironment();
final String match = envVari... | [
"public",
"static",
"File",
"[",
"]",
"getPathFromEnvironment",
"(",
"final",
"String",
"envVariable",
",",
"final",
"String",
"delim",
")",
"{",
"// OS/4000 does not support the env command.",
"if",
"(",
"System",
".",
"getProperty",
"(",
"\"os.name\"",
")",
".",
... | Returns an array of File for each existing directory in the specified
environment variable
@param envVariable
environment variable name such as "LIB" or "INCLUDE"
@param delim
delimitor used to separate parts of the path, typically ";"
or ":"
@return array of File's for each part that is an existing directory | [
"Returns",
"an",
"array",
"of",
"File",
"for",
"each",
"existing",
"directory",
"in",
"the",
"specified",
"environment",
"variable"
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L164-L183 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ModulesInner.java | ModulesInner.listByAutomationAccountAsync | public Observable<Page<ModuleInner>> listByAutomationAccountAsync(final String resourceGroupName, final String automationAccountName) {
"""
Retrieve a list of modules.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgu... | java | public Observable<Page<ModuleInner>> listByAutomationAccountAsync(final String resourceGroupName, final String automationAccountName) {
return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automationAccountName)
.map(new Func1<ServiceResponse<Page<ModuleInner>>, Page<ModuleInner... | [
"public",
"Observable",
"<",
"Page",
"<",
"ModuleInner",
">",
">",
"listByAutomationAccountAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"automationAccountName",
")",
"{",
"return",
"listByAutomationAccountWithServiceResponseAsync",
"(",
"re... | Retrieve a list of modules.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<ModuleInner> object | [
"Retrieve",
"a",
"list",
"of",
"modules",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ModulesInner.java#L522-L530 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.createImageFromSnapshot | public CreateImageResponse createImageFromSnapshot(String imageName, String snapshotId) {
"""
Creating a customized image from specified snapshot.
You can create the image only from system snapshot.
While creating an image from a system snapshot,the snapshot must be Available,
otherwise,it's will get <code>40... | java | public CreateImageResponse createImageFromSnapshot(String imageName, String snapshotId) {
return createImage(new CreateImageRequest()
.withImageName(imageName).withSnapshotId(snapshotId));
} | [
"public",
"CreateImageResponse",
"createImageFromSnapshot",
"(",
"String",
"imageName",
",",
"String",
"snapshotId",
")",
"{",
"return",
"createImage",
"(",
"new",
"CreateImageRequest",
"(",
")",
".",
"withImageName",
"(",
"imageName",
")",
".",
"withSnapshotId",
"(... | Creating a customized image from specified snapshot.
You can create the image only from system snapshot.
While creating an image from a system snapshot,the snapshot must be Available,
otherwise,it's will get <code>409</code> errorCode.
This is an asynchronous interface,
you can get the latest status by invoke {@link ... | [
"Creating",
"a",
"customized",
"image",
"from",
"specified",
"snapshot",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L1225-L1228 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/postprocess/impl/JSMinPostProcessor.java | JSMinPostProcessor.formatAndThrowJSLintError | private void formatAndThrowJSLintError(BundleProcessingStatus status, byte[] bundleBytes, JSMinException e) {
"""
Upon an exception thrown during minification, this method will throw an
error with detailed information.
@param status
the bundle processing status
@param bundleBytes
the byte array of the bundl... | java | private void formatAndThrowJSLintError(BundleProcessingStatus status, byte[] bundleBytes, JSMinException e) {
StringBuilder errorMsg = new StringBuilder(
"JSMin failed to minify the bundle with id: '" + status.getCurrentBundle().getId() + "'.\n");
errorMsg.append("The exception thrown is of type:").append(e.get... | [
"private",
"void",
"formatAndThrowJSLintError",
"(",
"BundleProcessingStatus",
"status",
",",
"byte",
"[",
"]",
"bundleBytes",
",",
"JSMinException",
"e",
")",
"{",
"StringBuilder",
"errorMsg",
"=",
"new",
"StringBuilder",
"(",
"\"JSMin failed to minify the bundle with id... | Upon an exception thrown during minification, this method will throw an
error with detailed information.
@param status
the bundle processing status
@param bundleBytes
the byte array of the bundle content
@param e
the JSMinException | [
"Upon",
"an",
"exception",
"thrown",
"during",
"minification",
"this",
"method",
"will",
"throw",
"an",
"error",
"with",
"detailed",
"information",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/postprocess/impl/JSMinPostProcessor.java#L143-L175 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.paymentMean_deferredPaymentAccount_id_PUT | public void paymentMean_deferredPaymentAccount_id_PUT(Long id, OvhDeferredPaymentAccount body) throws IOException {
"""
Alter this object properties
REST: PUT /me/paymentMean/deferredPaymentAccount/{id}
@param body [required] New object properties
@param id [required]
"""
String qPath = "/me/paymentMean... | java | public void paymentMean_deferredPaymentAccount_id_PUT(Long id, OvhDeferredPaymentAccount body) throws IOException {
String qPath = "/me/paymentMean/deferredPaymentAccount/{id}";
StringBuilder sb = path(qPath, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"paymentMean_deferredPaymentAccount_id_PUT",
"(",
"Long",
"id",
",",
"OvhDeferredPaymentAccount",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/paymentMean/deferredPaymentAccount/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",... | Alter this object properties
REST: PUT /me/paymentMean/deferredPaymentAccount/{id}
@param body [required] New object properties
@param id [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L593-L597 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java | BigtableInstanceAdminClient.resizeCluster | @SuppressWarnings("WeakerAccess")
public Cluster resizeCluster(String instanceId, String clusterId, int numServeNodes) {
"""
Resizes the cluster's node count. Please note that only clusters that belong to a PRODUCTION
instance can be resized.
<p>Sample code:
<pre>{@code
Cluster cluster = client.resizeClu... | java | @SuppressWarnings("WeakerAccess")
public Cluster resizeCluster(String instanceId, String clusterId, int numServeNodes) {
return ApiExceptions.callAndTranslateApiException(
resizeClusterAsync(instanceId, clusterId, numServeNodes));
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"Cluster",
"resizeCluster",
"(",
"String",
"instanceId",
",",
"String",
"clusterId",
",",
"int",
"numServeNodes",
")",
"{",
"return",
"ApiExceptions",
".",
"callAndTranslateApiException",
"(",
"resizeClu... | Resizes the cluster's node count. Please note that only clusters that belong to a PRODUCTION
instance can be resized.
<p>Sample code:
<pre>{@code
Cluster cluster = client.resizeCluster("my-instance", "my-cluster", 30);
}</pre> | [
"Resizes",
"the",
"cluster",
"s",
"node",
"count",
".",
"Please",
"note",
"that",
"only",
"clusters",
"that",
"belong",
"to",
"a",
"PRODUCTION",
"instance",
"can",
"be",
"resized",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java#L703-L707 |
groovy/groovy-core | subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | Sql.eachRow | public void eachRow(GString gstring, Closure closure) throws SQLException {
"""
Performs the given SQL query calling the given Closure with each row of the result set.
The row will be a <code>GroovyResultSet</code> which is a <code>ResultSet</code>
that supports accessing the fields using property style notation... | java | public void eachRow(GString gstring, Closure closure) throws SQLException {
eachRow(gstring, null, closure);
} | [
"public",
"void",
"eachRow",
"(",
"GString",
"gstring",
",",
"Closure",
"closure",
")",
"throws",
"SQLException",
"{",
"eachRow",
"(",
"gstring",
",",
"null",
",",
"closure",
")",
";",
"}"
] | Performs the given SQL query calling the given Closure with each row of the result set.
The row will be a <code>GroovyResultSet</code> which is a <code>ResultSet</code>
that supports accessing the fields using property style notation and ordinal index values.
The query may contain GString expressions.
<p>
Example usage... | [
"Performs",
"the",
"given",
"SQL",
"query",
"calling",
"the",
"given",
"Closure",
"with",
"each",
"row",
"of",
"the",
"result",
"set",
".",
"The",
"row",
"will",
"be",
"a",
"<code",
">",
"GroovyResultSet<",
"/",
"code",
">",
"which",
"is",
"a",
"<code",
... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L1600-L1602 |
antlrjavaparser/antlr-java-parser | src/main/java/com/github/antlrjavaparser/ASTHelper.java | ASTHelper.createParameter | public static Parameter createParameter(Type type, String name) {
"""
Creates a new {@link Parameter}.
@param type
type of the parameter
@param name
name of the parameter
@return instance of {@link Parameter}
"""
return new Parameter(type, new VariableDeclaratorId(name));
} | java | public static Parameter createParameter(Type type, String name) {
return new Parameter(type, new VariableDeclaratorId(name));
} | [
"public",
"static",
"Parameter",
"createParameter",
"(",
"Type",
"type",
",",
"String",
"name",
")",
"{",
"return",
"new",
"Parameter",
"(",
"type",
",",
"new",
"VariableDeclaratorId",
"(",
"name",
")",
")",
";",
"}"
] | Creates a new {@link Parameter}.
@param type
type of the parameter
@param name
name of the parameter
@return instance of {@link Parameter} | [
"Creates",
"a",
"new",
"{",
"@link",
"Parameter",
"}",
"."
] | train | https://github.com/antlrjavaparser/antlr-java-parser/blob/077160deb44d952c40c442800abd91af7e6fe006/src/main/java/com/github/antlrjavaparser/ASTHelper.java#L103-L105 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/borland/CBuilderXProjectWriter.java | CBuilderXProjectWriter.writeIlinkArgs | private void writeIlinkArgs(final PropertyWriter writer, final String linkID, final String[] args)
throws SAXException {
"""
Writes ilink32 linker options to project file.
@param writer
PropertyWriter property writer
@param linkID
String linker identifier
@param preArgs
String[] linker arguments
@th... | java | private void writeIlinkArgs(final PropertyWriter writer, final String linkID, final String[] args)
throws SAXException {
for (final String arg : args) {
if (arg.charAt(0) == '/' || arg.charAt(0) == '-') {
final int equalsPos = arg.indexOf('=');
if (equalsPos > 0) {
final String... | [
"private",
"void",
"writeIlinkArgs",
"(",
"final",
"PropertyWriter",
"writer",
",",
"final",
"String",
"linkID",
",",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"SAXException",
"{",
"for",
"(",
"final",
"String",
"arg",
":",
"args",
")",
"{",
"if"... | Writes ilink32 linker options to project file.
@param writer
PropertyWriter property writer
@param linkID
String linker identifier
@param preArgs
String[] linker arguments
@throws SAXException
thrown if unable to write option | [
"Writes",
"ilink32",
"linker",
"options",
"to",
"project",
"file",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/borland/CBuilderXProjectWriter.java#L259-L273 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpSubsystemChannel.java | SftpSubsystemChannel.setAttributes | public void setAttributes(String path, SftpFileAttributes attrs)
throws SftpStatusException, SshException {
"""
Sets the attributes of a file.
@param path
the path to the file.
@param attrs
the file attributes.
@throws SftpStatusException
, SshException
"""
try {
UnsignedInteger32 requestId = n... | java | public void setAttributes(String path, SftpFileAttributes attrs)
throws SftpStatusException, SshException {
try {
UnsignedInteger32 requestId = nextRequestId();
Packet msg = createPacket();
msg.write(SSH_FXP_SETSTAT);
msg.writeInt(requestId.longValue());
msg.writeString(path, CHARSET_ENCODING);
... | [
"public",
"void",
"setAttributes",
"(",
"String",
"path",
",",
"SftpFileAttributes",
"attrs",
")",
"throws",
"SftpStatusException",
",",
"SshException",
"{",
"try",
"{",
"UnsignedInteger32",
"requestId",
"=",
"nextRequestId",
"(",
")",
";",
"Packet",
"msg",
"=",
... | Sets the attributes of a file.
@param path
the path to the file.
@param attrs
the file attributes.
@throws SftpStatusException
, SshException | [
"Sets",
"the",
"attributes",
"of",
"a",
"file",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpSubsystemChannel.java#L466-L485 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwjsoncontenttype.java | appfwjsoncontenttype.get | public static appfwjsoncontenttype get(nitro_service service, String jsoncontenttypevalue) throws Exception {
"""
Use this API to fetch appfwjsoncontenttype resource of given name .
"""
appfwjsoncontenttype obj = new appfwjsoncontenttype();
obj.set_jsoncontenttypevalue(jsoncontenttypevalue);
appfwjsoncon... | java | public static appfwjsoncontenttype get(nitro_service service, String jsoncontenttypevalue) throws Exception{
appfwjsoncontenttype obj = new appfwjsoncontenttype();
obj.set_jsoncontenttypevalue(jsoncontenttypevalue);
appfwjsoncontenttype response = (appfwjsoncontenttype) obj.get_resource(service);
return respons... | [
"public",
"static",
"appfwjsoncontenttype",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"jsoncontenttypevalue",
")",
"throws",
"Exception",
"{",
"appfwjsoncontenttype",
"obj",
"=",
"new",
"appfwjsoncontenttype",
"(",
")",
";",
"obj",
".",
"set_jsoncontentty... | Use this API to fetch appfwjsoncontenttype resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"appfwjsoncontenttype",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwjsoncontenttype.java#L218-L223 |
jsurfer/JsonSurfer | jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java | JsonSurfer.collectAll | @Deprecated
public Collection<Object> collectAll(Reader reader, JsonPath... paths) {
"""
Collect all matched value into a collection
@param reader Json reader
@param paths JsonPath
@return All matched value
@deprecated use {@link #collectAll(InputStream, JsonPath...)} instead
"""
return coll... | java | @Deprecated
public Collection<Object> collectAll(Reader reader, JsonPath... paths) {
return collectAll(reader, Object.class, paths);
} | [
"@",
"Deprecated",
"public",
"Collection",
"<",
"Object",
">",
"collectAll",
"(",
"Reader",
"reader",
",",
"JsonPath",
"...",
"paths",
")",
"{",
"return",
"collectAll",
"(",
"reader",
",",
"Object",
".",
"class",
",",
"paths",
")",
";",
"}"
] | Collect all matched value into a collection
@param reader Json reader
@param paths JsonPath
@return All matched value
@deprecated use {@link #collectAll(InputStream, JsonPath...)} instead | [
"Collect",
"all",
"matched",
"value",
"into",
"a",
"collection"
] | train | https://github.com/jsurfer/JsonSurfer/blob/52bd75a453338b86e115092803da140bf99cee62/jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java#L314-L317 |
arquillian/arquillian-cube | openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/ResourceUtil.java | ResourceUtil.awaitRoute | public static void awaitRoute(URL routeUrl, int timeout, TimeUnit timeoutUnit, int repetitions, int... statusCodes) {
"""
Waits for the timeout duration until the url responds with correct status code
@param routeUrl URL to check (usually a route one)
@param timeout Max timeout value to await for route ... | java | public static void awaitRoute(URL routeUrl, int timeout, TimeUnit timeoutUnit, int repetitions, int... statusCodes) {
AtomicInteger successfulAwaitsInARow = new AtomicInteger(0);
await().atMost(timeout, timeoutUnit).until(() -> {
if (tryConnect(routeUrl, statusCodes)) {
succe... | [
"public",
"static",
"void",
"awaitRoute",
"(",
"URL",
"routeUrl",
",",
"int",
"timeout",
",",
"TimeUnit",
"timeoutUnit",
",",
"int",
"repetitions",
",",
"int",
"...",
"statusCodes",
")",
"{",
"AtomicInteger",
"successfulAwaitsInARow",
"=",
"new",
"AtomicInteger",
... | Waits for the timeout duration until the url responds with correct status code
@param routeUrl URL to check (usually a route one)
@param timeout Max timeout value to await for route readiness.
If not set, default timeout value is set to 5.
@param timeoutUnit TimeUnit used for timeout duration.
If not set, Minut... | [
"Waits",
"for",
"the",
"timeout",
"duration",
"until",
"the",
"url",
"responds",
"with",
"correct",
"status",
"code"
] | train | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/openshift/openshift/src/main/java/org/arquillian/cube/openshift/impl/client/ResourceUtil.java#L190-L200 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.getBoolean | @PublicEvolving
public boolean getBoolean(ConfigOption<Boolean> configOption, boolean overrideDefault) {
"""
Returns the value associated with the given config option as a boolean.
If no value is mapped under any key of the option, it returns the specified
default instead of the option's default value.
@para... | java | @PublicEvolving
public boolean getBoolean(ConfigOption<Boolean> configOption, boolean overrideDefault) {
Object o = getRawValueFromOption(configOption);
if (o == null) {
return overrideDefault;
}
return convertToBoolean(o);
} | [
"@",
"PublicEvolving",
"public",
"boolean",
"getBoolean",
"(",
"ConfigOption",
"<",
"Boolean",
">",
"configOption",
",",
"boolean",
"overrideDefault",
")",
"{",
"Object",
"o",
"=",
"getRawValueFromOption",
"(",
"configOption",
")",
";",
"if",
"(",
"o",
"==",
"... | Returns the value associated with the given config option as a boolean.
If no value is mapped under any key of the option, it returns the specified
default instead of the option's default value.
@param configOption The configuration option
@param overrideDefault The value to return if no value was mapper for any key o... | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"config",
"option",
"as",
"a",
"boolean",
".",
"If",
"no",
"value",
"is",
"mapped",
"under",
"any",
"key",
"of",
"the",
"option",
"it",
"returns",
"the",
"specified",
"default",
"instead",
"o... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L382-L389 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.evaluateAutoScaleAsync | public Observable<AutoScaleRun> evaluateAutoScaleAsync(String poolId, String autoScaleFormula) {
"""
Gets the result of evaluating an automatic scaling formula on the pool.
This API is primarily for validating an autoscale formula, as it simply returns the result without applying the formula to the pool. The pool... | java | public Observable<AutoScaleRun> evaluateAutoScaleAsync(String poolId, String autoScaleFormula) {
return evaluateAutoScaleWithServiceResponseAsync(poolId, autoScaleFormula).map(new Func1<ServiceResponseWithHeaders<AutoScaleRun, PoolEvaluateAutoScaleHeaders>, AutoScaleRun>() {
@Override
pu... | [
"public",
"Observable",
"<",
"AutoScaleRun",
">",
"evaluateAutoScaleAsync",
"(",
"String",
"poolId",
",",
"String",
"autoScaleFormula",
")",
"{",
"return",
"evaluateAutoScaleWithServiceResponseAsync",
"(",
"poolId",
",",
"autoScaleFormula",
")",
".",
"map",
"(",
"new"... | Gets the result of evaluating an automatic scaling formula on the pool.
This API is primarily for validating an autoscale formula, as it simply returns the result without applying the formula to the pool. The pool must have auto scaling enabled in order to evaluate a formula.
@param poolId The ID of the pool on which ... | [
"Gets",
"the",
"result",
"of",
"evaluating",
"an",
"automatic",
"scaling",
"formula",
"on",
"the",
"pool",
".",
"This",
"API",
"is",
"primarily",
"for",
"validating",
"an",
"autoscale",
"formula",
"as",
"it",
"simply",
"returns",
"the",
"result",
"without",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L2536-L2543 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsJmsMapMessageImpl.java | JsJmsMapMessageImpl.setByte | public void setByte(String name, byte value) throws UnsupportedEncodingException {
"""
/*
Set a byte value with the given name, into the Map.
Javadoc description supplied by JsJmsMessage interface.
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setByte", ... | java | public void setByte(String name, byte value) throws UnsupportedEncodingException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setByte", Byte.valueOf(value));
getBodyMap().put(name, Byte.valueOf(value));
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabl... | [
"public",
"void",
"setByte",
"(",
"String",
"name",
",",
"byte",
"value",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"... | /*
Set a byte value with the given name, into the Map.
Javadoc description supplied by JsJmsMessage interface. | [
"/",
"*",
"Set",
"a",
"byte",
"value",
"with",
"the",
"given",
"name",
"into",
"the",
"Map",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsJmsMapMessageImpl.java#L282-L286 |
neoremind/navi | navi-mgr-console/src/main/java/com/baidu/beidou/navimgr/common/handler/GlobalExceptionHandler.java | GlobalExceptionHandler.buildBizError | private ModelAndView buildBizError(ModelAndView mvc, Map<String, Object> paramErrors) {
"""
构造系统业务错误
@param mvc mvc
@param paramErrors 错误参数
@return mvc
"""
Map<String, Object> error = new HashMap<String, Object>();
error.put("field", paramErrors);
mvc.addObject("status", ... | java | private ModelAndView buildBizError(ModelAndView mvc, Map<String, Object> paramErrors) {
Map<String, Object> error = new HashMap<String, Object>();
error.put("field", paramErrors);
mvc.addObject("status", GlobalResponseStatusMsg.BIZ_ERROR.getCode());
mvc.addObject("statusInfo", error);
... | [
"private",
"ModelAndView",
"buildBizError",
"(",
"ModelAndView",
"mvc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paramErrors",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"error",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"... | 构造系统业务错误
@param mvc mvc
@param paramErrors 错误参数
@return mvc | [
"构造系统业务错误"
] | train | https://github.com/neoremind/navi/blob/d37e4b46ef07d124be2740ad3d85d87e939acc84/navi-mgr-console/src/main/java/com/baidu/beidou/navimgr/common/handler/GlobalExceptionHandler.java#L182-L188 |
beanshell/beanshell | src/main/java/bsh/Reflect.java | Reflect.invokeCompiledCommand | public static Object invokeCompiledCommand(
Class<?> commandClass, Object [] args, Interpreter interpreter,
CallStack callstack, SimpleNode callerInfo )
throws UtilEvalError {
"""
A command may be implemented as a compiled Java class containing one or
more static invoke() methods of the co... | java | public static Object invokeCompiledCommand(
Class<?> commandClass, Object [] args, Interpreter interpreter,
CallStack callstack, SimpleNode callerInfo )
throws UtilEvalError
{
// add interpereter and namespace to args list
Object[] invokeArgs = new Object[args.length + 2];
... | [
"public",
"static",
"Object",
"invokeCompiledCommand",
"(",
"Class",
"<",
"?",
">",
"commandClass",
",",
"Object",
"[",
"]",
"args",
",",
"Interpreter",
"interpreter",
",",
"CallStack",
"callstack",
",",
"SimpleNode",
"callerInfo",
")",
"throws",
"UtilEvalError",
... | A command may be implemented as a compiled Java class containing one or
more static invoke() methods of the correct signature. The invoke()
methods must accept two additional leading arguments of the interpreter
and callstack, respectively. e.g. invoke(interpreter, callstack, ... )
This method adds the arguments and i... | [
"A",
"command",
"may",
"be",
"implemented",
"as",
"a",
"compiled",
"Java",
"class",
"containing",
"one",
"or",
"more",
"static",
"invoke",
"()",
"methods",
"of",
"the",
"correct",
"signature",
".",
"The",
"invoke",
"()",
"methods",
"must",
"accept",
"two",
... | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Reflect.java#L653-L673 |
GCRC/nunaliit | nunaliit2-multimedia/src/main/java/ca/carleton/gcrc/olkit/multimedia/file/SystemFile.java | SystemFile.addKnownString | static public void addKnownString(String mimeType, String knownString) {
"""
Adds a relation between a known string for File and a mime type.
@param mimeType Mime type that should be returned if known string is encountered
@param knownString A string that is found when performing "file -bnk"
"""
Map<String... | java | static public void addKnownString(String mimeType, String knownString) {
Map<String,String> map = getKnownStrings();
if( null != mimeType && null != knownString ) {
map.put(knownString.trim(), mimeType.trim());
}
} | [
"static",
"public",
"void",
"addKnownString",
"(",
"String",
"mimeType",
",",
"String",
"knownString",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"getKnownStrings",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"mimeType",
"&&",
"null",
"!... | Adds a relation between a known string for File and a mime type.
@param mimeType Mime type that should be returned if known string is encountered
@param knownString A string that is found when performing "file -bnk" | [
"Adds",
"a",
"relation",
"between",
"a",
"known",
"string",
"for",
"File",
"and",
"a",
"mime",
"type",
"."
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-multimedia/src/main/java/ca/carleton/gcrc/olkit/multimedia/file/SystemFile.java#L69-L74 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getWriteValueToField | public static String getWriteValueToField(FieldType type, String express, boolean isList) {
"""
Gets the write value to field.
@param type the type
@param express the express
@param isList the is list
@return the write value to field
"""
if ((type == FieldType.STRING || type == FieldType.BYTES) &... | java | public static String getWriteValueToField(FieldType type, String express, boolean isList) {
if ((type == FieldType.STRING || type == FieldType.BYTES) && !isList) {
String method = "copyFromUtf8";
if (type == FieldType.BYTES) {
method = "copyFrom";
}
... | [
"public",
"static",
"String",
"getWriteValueToField",
"(",
"FieldType",
"type",
",",
"String",
"express",
",",
"boolean",
"isList",
")",
"{",
"if",
"(",
"(",
"type",
"==",
"FieldType",
".",
"STRING",
"||",
"type",
"==",
"FieldType",
".",
"BYTES",
")",
"&&"... | Gets the write value to field.
@param type the type
@param express the express
@param isList the is list
@return the write value to field | [
"Gets",
"the",
"write",
"value",
"to",
"field",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L155-L166 |
SonarSource/sonarqube | sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/CharsetValidation.java | CharsetValidation.isValidWindows1252 | public Result isValidWindows1252(byte[] buf) {
"""
Verify that the buffer doesn't contain bytes that are not supposed to be used by Windows-1252.
@return Result object with Validation.MAYBE and Windows-1252 if no unknown characters are used,
otherwise Result.INVALID
@param buf byte buffer to validate
"""
... | java | public Result isValidWindows1252(byte[] buf) {
for (byte b : buf) {
if (!VALID_WINDOWS_1252[b + 128]) {
return Result.INVALID;
}
}
try {
return new Result(Validation.MAYBE, Charset.forName("Windows-1252"));
} catch (UnsupportedCharsetException e) {
return Result.INVALID;... | [
"public",
"Result",
"isValidWindows1252",
"(",
"byte",
"[",
"]",
"buf",
")",
"{",
"for",
"(",
"byte",
"b",
":",
"buf",
")",
"{",
"if",
"(",
"!",
"VALID_WINDOWS_1252",
"[",
"b",
"+",
"128",
"]",
")",
"{",
"return",
"Result",
".",
"INVALID",
";",
"}"... | Verify that the buffer doesn't contain bytes that are not supposed to be used by Windows-1252.
@return Result object with Validation.MAYBE and Windows-1252 if no unknown characters are used,
otherwise Result.INVALID
@param buf byte buffer to validate | [
"Verify",
"that",
"the",
"buffer",
"doesn",
"t",
"contain",
"bytes",
"that",
"are",
"not",
"supposed",
"to",
"be",
"used",
"by",
"Windows",
"-",
"1252",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/CharsetValidation.java#L276-L288 |
jayantk/jklol | src/com/jayantkrish/jklol/models/dynamic/VariableNamePattern.java | VariableNamePattern.fromTemplateVariables | public static VariableNamePattern fromTemplateVariables(VariableNumMap templateVariables,
VariableNumMap fixedVariables) {
"""
Gets a {@code VariableNamePattern} which uses the names in {@code templateVars}
as the name templates for matching variables. The names are specified in a
rudimentary pattern langu... | java | public static VariableNamePattern fromTemplateVariables(VariableNumMap templateVariables,
VariableNumMap fixedVariables) {
List<VariableNameMatcher> matchers = Lists.newArrayList();
for (String variableName : templateVariables.getVariableNamesArray()) {
int varIndex = variableName.indexOf("?(");
... | [
"public",
"static",
"VariableNamePattern",
"fromTemplateVariables",
"(",
"VariableNumMap",
"templateVariables",
",",
"VariableNumMap",
"fixedVariables",
")",
"{",
"List",
"<",
"VariableNameMatcher",
">",
"matchers",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"f... | Gets a {@code VariableNamePattern} which uses the names in {@code templateVars}
as the name templates for matching variables. The names are specified in a
rudimentary pattern language: if a name contains a "?(x)", this portion is
allowed to match any integer value. x is a number which is an integer
offset for the match... | [
"Gets",
"a",
"{",
"@code",
"VariableNamePattern",
"}",
"which",
"uses",
"the",
"names",
"in",
"{",
"@code",
"templateVars",
"}",
"as",
"the",
"name",
"templates",
"for",
"matching",
"variables",
".",
"The",
"names",
"are",
"specified",
"in",
"a",
"rudimentar... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/dynamic/VariableNamePattern.java#L67-L81 |
facebookarchive/hadoop-20 | src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/ImageLibrary.java | ImageLibrary.newSharedImage | private boolean newSharedImage(String name, String sharedName) {
"""
Register an image from the workspace shared image pool. If the image
resource does not exist or fails to load, a default "error" resource is
supplied.
@param name name of the image
@param sharedName name of the shared image ({@link ISharedI... | java | private boolean newSharedImage(String name, String sharedName) {
boolean success = true;
ImageDescriptor id = getSharedByName(sharedName);
if (id == null) {
id = ImageDescriptor.getMissingImageDescriptor();
// id = getSharedByName(ISharedImages.IMG_OBJS_ERROR_TSK);
success = false;
}
... | [
"private",
"boolean",
"newSharedImage",
"(",
"String",
"name",
",",
"String",
"sharedName",
")",
"{",
"boolean",
"success",
"=",
"true",
";",
"ImageDescriptor",
"id",
"=",
"getSharedByName",
"(",
"sharedName",
")",
";",
"if",
"(",
"id",
"==",
"null",
")",
... | Register an image from the workspace shared image pool. If the image
resource does not exist or fails to load, a default "error" resource is
supplied.
@param name name of the image
@param sharedName name of the shared image ({@link ISharedImages})
@return whether the image has correctly been loaded | [
"Register",
"an",
"image",
"from",
"the",
"workspace",
"shared",
"image",
"pool",
".",
"If",
"the",
"image",
"resource",
"does",
"not",
"exist",
"or",
"fails",
"to",
"load",
"a",
"default",
"error",
"resource",
"is",
"supplied",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/ImageLibrary.java#L209-L223 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.browseFrom | public IndexBrowser browseFrom(Query params, String cursor, RequestOptions requestOptions) throws AlgoliaException {
"""
Browse all index content starting from a cursor
@param requestOptions Options to pass to this request
"""
return new IndexBrowser(client, encodedIndexName, params, cursor, requestOpti... | java | public IndexBrowser browseFrom(Query params, String cursor, RequestOptions requestOptions) throws AlgoliaException {
return new IndexBrowser(client, encodedIndexName, params, cursor, requestOptions);
} | [
"public",
"IndexBrowser",
"browseFrom",
"(",
"Query",
"params",
",",
"String",
"cursor",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"return",
"new",
"IndexBrowser",
"(",
"client",
",",
"encodedIndexName",
",",
"params",
",",
"... | Browse all index content starting from a cursor
@param requestOptions Options to pass to this request | [
"Browse",
"all",
"index",
"content",
"starting",
"from",
"a",
"cursor"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L802-L804 |
RKumsher/utils | src/main/java/com/github/rkumsher/date/RandomDateUtils.java | RandomDateUtils.randomLocalDate | public static LocalDate randomLocalDate(LocalDate startInclusive, LocalDate endExclusive) {
"""
Returns a random {@link LocalDate} within the specified range.
@param startInclusive the earliest {@link LocalDate} that can be returned
@param endExclusive the upper bound (not included)
@return the random {@link ... | java | public static LocalDate randomLocalDate(LocalDate startInclusive, LocalDate endExclusive) {
checkArgument(startInclusive != null, "Start must be non-null");
checkArgument(endExclusive != null, "End must be non-null");
Instant startInstant = startInclusive.atStartOfDay().toInstant(UTC_OFFSET);
Instant en... | [
"public",
"static",
"LocalDate",
"randomLocalDate",
"(",
"LocalDate",
"startInclusive",
",",
"LocalDate",
"endExclusive",
")",
"{",
"checkArgument",
"(",
"startInclusive",
"!=",
"null",
",",
"\"Start must be non-null\"",
")",
";",
"checkArgument",
"(",
"endExclusive",
... | Returns a random {@link LocalDate} within the specified range.
@param startInclusive the earliest {@link LocalDate} that can be returned
@param endExclusive the upper bound (not included)
@return the random {@link LocalDate}
@throws IllegalArgumentException if startInclusive or endExclusive are null or if endExclusive... | [
"Returns",
"a",
"random",
"{",
"@link",
"LocalDate",
"}",
"within",
"the",
"specified",
"range",
"."
] | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/date/RandomDateUtils.java#L306-L313 |
Red5/red5-server-common | src/main/java/org/red5/server/stream/StreamService.java | StreamService.sendNSFailed | private void sendNSFailed(IConnection conn, String errorCode, String description, String name, Number streamId) {
"""
Send NetStream.Play.Failed to the client.
@param conn
@param errorCode
@param description
@param name
@param streamId
"""
StreamService.sendNetStreamStatus(conn, errorCode, desc... | java | private void sendNSFailed(IConnection conn, String errorCode, String description, String name, Number streamId) {
StreamService.sendNetStreamStatus(conn, errorCode, description, name, Status.ERROR, streamId);
} | [
"private",
"void",
"sendNSFailed",
"(",
"IConnection",
"conn",
",",
"String",
"errorCode",
",",
"String",
"description",
",",
"String",
"name",
",",
"Number",
"streamId",
")",
"{",
"StreamService",
".",
"sendNetStreamStatus",
"(",
"conn",
",",
"errorCode",
",",
... | Send NetStream.Play.Failed to the client.
@param conn
@param errorCode
@param description
@param name
@param streamId | [
"Send",
"NetStream",
".",
"Play",
".",
"Failed",
"to",
"the",
"client",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/StreamService.java#L800-L802 |
probedock/probedock-rt-java | src/main/java/io/probedock/rt/client/Connector.java | Connector.notifyStart | public void notifyStart(String projectApiId, String projectVersion, String category) {
"""
Send a starting notification to the agent
@param projectApiId The project API ID
@param projectVersion The project version
@param category The category
"""
try {
if (isStarted()) {
JSONObject startNotificat... | java | public void notifyStart(String projectApiId, String projectVersion, String category) {
try {
if (isStarted()) {
JSONObject startNotification = new JSONObject().
put("project", new JSONObject().
put("apiId", projectApiId).
put("version", projectVersion)
).
put("category", category);
... | [
"public",
"void",
"notifyStart",
"(",
"String",
"projectApiId",
",",
"String",
"projectVersion",
",",
"String",
"category",
")",
"{",
"try",
"{",
"if",
"(",
"isStarted",
"(",
")",
")",
"{",
"JSONObject",
"startNotification",
"=",
"new",
"JSONObject",
"(",
")... | Send a starting notification to the agent
@param projectApiId The project API ID
@param projectVersion The project version
@param category The category | [
"Send",
"a",
"starting",
"notification",
"to",
"the",
"agent"
] | train | https://github.com/probedock/probedock-rt-java/blob/67b44b64303b15eb2d4808f9560a1c9554ccf3ba/src/main/java/io/probedock/rt/client/Connector.java#L62-L85 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.removeByC_ST | @Override
public void removeByC_ST(long CPDefinitionId, int status) {
"""
Removes all the cp instances where CPDefinitionId = ? and status = ? from the database.
@param CPDefinitionId the cp definition ID
@param status the status
"""
for (CPInstance cpInstance : findByC_ST(CPDefinitionId, status... | java | @Override
public void removeByC_ST(long CPDefinitionId, int status) {
for (CPInstance cpInstance : findByC_ST(CPDefinitionId, status,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpInstance);
}
} | [
"@",
"Override",
"public",
"void",
"removeByC_ST",
"(",
"long",
"CPDefinitionId",
",",
"int",
"status",
")",
"{",
"for",
"(",
"CPInstance",
"cpInstance",
":",
"findByC_ST",
"(",
"CPDefinitionId",
",",
"status",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil... | Removes all the cp instances where CPDefinitionId = ? and status = ? from the database.
@param CPDefinitionId the cp definition ID
@param status the status | [
"Removes",
"all",
"the",
"cp",
"instances",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"status",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L5040-L5046 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java | UCharacter.foldCase | public static final String foldCase(String str, int options) {
"""
<strong>[icu]</strong> The given string is mapped to its case folding equivalent according to
UnicodeData.txt and CaseFolding.txt; if any character has no case
folding equivalent, the character itself is returned.
"Full", multiple-code point cas... | java | public static final String foldCase(String str, int options) {
if (str.length() <= 100) {
if (str.isEmpty()) {
return str;
}
// Collect and apply only changes.
// Good if no or few changes. Bad (slow) if many changes.
Edits edits = new ... | [
"public",
"static",
"final",
"String",
"foldCase",
"(",
"String",
"str",
",",
"int",
"options",
")",
"{",
"if",
"(",
"str",
".",
"length",
"(",
")",
"<=",
"100",
")",
"{",
"if",
"(",
"str",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"str",
";"... | <strong>[icu]</strong> The given string is mapped to its case folding equivalent according to
UnicodeData.txt and CaseFolding.txt; if any character has no case
folding equivalent, the character itself is returned.
"Full", multiple-code point case folding mappings are returned here.
For "simple" single-code point mappin... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"The",
"given",
"string",
"is",
"mapped",
"to",
"its",
"case",
"folding",
"equivalent",
"according",
"to",
"UnicodeData",
".",
"txt",
"and",
"CaseFolding",
".",
"txt",
";",
"if",
"any",
"character... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L4741-L4755 |
GenesysPureEngage/authentication-client-java | src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java | AuthenticationApi.signOut1 | public ModelApiResponse signOut1(String authorization, Boolean global, String redirectUri) throws ApiException {
"""
Sign-out a logged in user
Sign-out the current user and invalidate either the current token or all tokens associated with the user.
@param authorization The OAuth 2 bearer access token you receive... | java | public ModelApiResponse signOut1(String authorization, Boolean global, String redirectUri) throws ApiException {
ApiResponse<ModelApiResponse> resp = signOut1WithHttpInfo(authorization, global, redirectUri);
return resp.getData();
} | [
"public",
"ModelApiResponse",
"signOut1",
"(",
"String",
"authorization",
",",
"Boolean",
"global",
",",
"String",
"redirectUri",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ModelApiResponse",
">",
"resp",
"=",
"signOut1WithHttpInfo",
"(",
"authorization"... | Sign-out a logged in user
Sign-out the current user and invalidate either the current token or all tokens associated with the user.
@param authorization The OAuth 2 bearer access token you received from [/auth/v3/oauth/token](/reference/authentication/Authentication/index.html#retrieveToken). For example: \"Author... | [
"Sign",
"-",
"out",
"a",
"logged",
"in",
"user",
"Sign",
"-",
"out",
"the",
"current",
"user",
"and",
"invalidate",
"either",
"the",
"current",
"token",
"or",
"all",
"tokens",
"associated",
"with",
"the",
"user",
"."
] | train | https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java#L1462-L1465 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_usage_history_GET | public ArrayList<OvhUsageHistory> project_serviceName_usage_history_GET(String serviceName, Date from, Date to) throws IOException {
"""
Usage information on your project
REST: GET /cloud/project/{serviceName}/usage/history
@param from [required] Filter results having date superior to from
@param serviceName ... | java | public ArrayList<OvhUsageHistory> project_serviceName_usage_history_GET(String serviceName, Date from, Date to) throws IOException {
String qPath = "/cloud/project/{serviceName}/usage/history";
StringBuilder sb = path(qPath, serviceName);
query(sb, "from", from);
query(sb, "to", to);
String resp = exec(qPath,... | [
"public",
"ArrayList",
"<",
"OvhUsageHistory",
">",
"project_serviceName_usage_history_GET",
"(",
"String",
"serviceName",
",",
"Date",
"from",
",",
"Date",
"to",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/usage/history\"",
... | Usage information on your project
REST: GET /cloud/project/{serviceName}/usage/history
@param from [required] Filter results having date superior to from
@param serviceName [required] Service name
@param to [required] Filter results having date inferior to | [
"Usage",
"information",
"on",
"your",
"project"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1709-L1716 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/FileUtil.java | FileUtil.isExtensionWellFormated | public static boolean isExtensionWellFormated(File file, String prefix) {
"""
Check if the file has the good extension
@param file
@param prefix
@return
"""
String path = file.getAbsolutePath();
String extension = "";
int i = path.lastIndexOf('.');
if (i >= 0) {
e... | java | public static boolean isExtensionWellFormated(File file, String prefix) {
String path = file.getAbsolutePath();
String extension = "";
int i = path.lastIndexOf('.');
if (i >= 0) {
extension = path.substring(i + 1);
}
return extension.equalsIgnoreCase(prefix);
... | [
"public",
"static",
"boolean",
"isExtensionWellFormated",
"(",
"File",
"file",
",",
"String",
"prefix",
")",
"{",
"String",
"path",
"=",
"file",
".",
"getAbsolutePath",
"(",
")",
";",
"String",
"extension",
"=",
"\"\"",
";",
"int",
"i",
"=",
"path",
".",
... | Check if the file has the good extension
@param file
@param prefix
@return | [
"Check",
"if",
"the",
"file",
"has",
"the",
"good",
"extension"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/FileUtil.java#L62-L70 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.checkCall | @ObjectiveCName("checkCall:withAttempt:")
public void checkCall(long callId, int attempt) {
"""
Checking incoming call from push notification
@param callId Call Id
@param attempt Call Attempt
"""
if (modules.getCallsModule() != null) {
modules.getCallsModule().checkCall(callId, att... | java | @ObjectiveCName("checkCall:withAttempt:")
public void checkCall(long callId, int attempt) {
if (modules.getCallsModule() != null) {
modules.getCallsModule().checkCall(callId, attempt);
}
} | [
"@",
"ObjectiveCName",
"(",
"\"checkCall:withAttempt:\"",
")",
"public",
"void",
"checkCall",
"(",
"long",
"callId",
",",
"int",
"attempt",
")",
"{",
"if",
"(",
"modules",
".",
"getCallsModule",
"(",
")",
"!=",
"null",
")",
"{",
"modules",
".",
"getCallsModu... | Checking incoming call from push notification
@param callId Call Id
@param attempt Call Attempt | [
"Checking",
"incoming",
"call",
"from",
"push",
"notification"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L1351-L1356 |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/portletadmin/PortletDefinitionForm.java | PortletDefinitionForm.setPrincipals | public void setPrincipals(Set<JsonEntityBean> newPrincipals, boolean initPermissionsForNew) {
"""
Replaces this form's collection of principals and <em>optionally</em> sets default
permissions (SUBSCRIBE+BROWSE) for new principals
@param newPrincipals
@param initPermissionsForNew Give new principals <code>BRO... | java | public void setPrincipals(Set<JsonEntityBean> newPrincipals, boolean initPermissionsForNew) {
final Set<JsonEntityBean> previousPrincipals = new HashSet<>(principals);
principals.clear();
principals.addAll(newPrincipals);
if (initPermissionsForNew) {
principals.stream()
... | [
"public",
"void",
"setPrincipals",
"(",
"Set",
"<",
"JsonEntityBean",
">",
"newPrincipals",
",",
"boolean",
"initPermissionsForNew",
")",
"{",
"final",
"Set",
"<",
"JsonEntityBean",
">",
"previousPrincipals",
"=",
"new",
"HashSet",
"<>",
"(",
"principals",
")",
... | Replaces this form's collection of principals and <em>optionally</em> sets default
permissions (SUBSCRIBE+BROWSE) for new principals
@param newPrincipals
@param initPermissionsForNew Give new principals <code>BROWSE</code> and <code>SUBSCRIBE
</code> permission when true | [
"Replaces",
"this",
"form",
"s",
"collection",
"of",
"principals",
"and",
"<em",
">",
"optionally<",
"/",
"em",
">",
"sets",
"default",
"permissions",
"(",
"SUBSCRIBE",
"+",
"BROWSE",
")",
"for",
"new",
"principals"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/portletadmin/PortletDefinitionForm.java#L478-L498 |
vorburger/MariaDB4j | mariaDB4j-core/src/main/java/ch/vorburger/mariadb4j/DB.java | DB.prepareDirectories | protected void prepareDirectories() throws ManagedProcessException {
"""
If the data directory specified in the configuration is a temporary directory, this deletes
any previous version. It also makes sure that the directory exists.
@throws ManagedProcessException if something fatal went wrong
"""
... | java | protected void prepareDirectories() throws ManagedProcessException {
baseDir = Util.getDirectory(configuration.getBaseDir());
libDir = Util.getDirectory(configuration.getLibDir());
try {
String dataDirPath = configuration.getDataDir();
if (Util.isTemporaryDirectory(dataDi... | [
"protected",
"void",
"prepareDirectories",
"(",
")",
"throws",
"ManagedProcessException",
"{",
"baseDir",
"=",
"Util",
".",
"getDirectory",
"(",
"configuration",
".",
"getBaseDir",
"(",
")",
")",
";",
"libDir",
"=",
"Util",
".",
"getDirectory",
"(",
"configurati... | If the data directory specified in the configuration is a temporary directory, this deletes
any previous version. It also makes sure that the directory exists.
@throws ManagedProcessException if something fatal went wrong | [
"If",
"the",
"data",
"directory",
"specified",
"in",
"the",
"configuration",
"is",
"a",
"temporary",
"directory",
"this",
"deletes",
"any",
"previous",
"version",
".",
"It",
"also",
"makes",
"sure",
"that",
"the",
"directory",
"exists",
"."
] | train | https://github.com/vorburger/MariaDB4j/blob/ddc7aa2a3294c9c56b1127de11949fb33a81ad7b/mariaDB4j-core/src/main/java/ch/vorburger/mariadb4j/DB.java#L376-L388 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.input_engine_engineId_GET | public OvhEngine input_engine_engineId_GET(String engineId) throws IOException {
"""
Returns details of specified input engine
REST: GET /dbaas/logs/input/engine/{engineId}
@param engineId [required] Engine ID
"""
String qPath = "/dbaas/logs/input/engine/{engineId}";
StringBuilder sb = path(qPath, engi... | java | public OvhEngine input_engine_engineId_GET(String engineId) throws IOException {
String qPath = "/dbaas/logs/input/engine/{engineId}";
StringBuilder sb = path(qPath, engineId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhEngine.class);
} | [
"public",
"OvhEngine",
"input_engine_engineId_GET",
"(",
"String",
"engineId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/logs/input/engine/{engineId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"engineId",
")",
";",
"St... | Returns details of specified input engine
REST: GET /dbaas/logs/input/engine/{engineId}
@param engineId [required] Engine ID | [
"Returns",
"details",
"of",
"specified",
"input",
"engine"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L90-L95 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.findIntersection | public static Point2D findIntersection(final int x, final int y, final MultiPath path) {
"""
Finds intersecting point from the center of a path
@param x
@param y
@param path
@return the path's intersection point, or null if there's no intersection point
"""
final Point2D pointerPosition = new Poin... | java | public static Point2D findIntersection(final int x, final int y, final MultiPath path)
{
final Point2D pointerPosition = new Point2D(x, y);
final BoundingBox box = path.getBoundingBox();
final Point2D center = findCenter(box);
// length just needs to ensure the c to xy is ... | [
"public",
"static",
"Point2D",
"findIntersection",
"(",
"final",
"int",
"x",
",",
"final",
"int",
"y",
",",
"final",
"MultiPath",
"path",
")",
"{",
"final",
"Point2D",
"pointerPosition",
"=",
"new",
"Point2D",
"(",
"x",
",",
"y",
")",
";",
"final",
"Boun... | Finds intersecting point from the center of a path
@param x
@param y
@param path
@return the path's intersection point, or null if there's no intersection point | [
"Finds",
"intersecting",
"point",
"from",
"the",
"center",
"of",
"a",
"path"
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L1624-L1667 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/windows/WindowsFaxClientSpiHelper.java | WindowsFaxClientSpiHelper.loadNativeLibrary | public static void loadNativeLibrary(Logger logger) {
"""
Loads the native library if not loaded before.
@param logger
The logger
"""
synchronized(WindowsFaxClientSpiHelper.NATIVE_LOCK)
{
if(!WindowsFaxClientSpiHelper.nativeLibraryLoaded)
{
try
... | java | public static void loadNativeLibrary(Logger logger)
{
synchronized(WindowsFaxClientSpiHelper.NATIVE_LOCK)
{
if(!WindowsFaxClientSpiHelper.nativeLibraryLoaded)
{
try
{
//get temporary directory
File direct... | [
"public",
"static",
"void",
"loadNativeLibrary",
"(",
"Logger",
"logger",
")",
"{",
"synchronized",
"(",
"WindowsFaxClientSpiHelper",
".",
"NATIVE_LOCK",
")",
"{",
"if",
"(",
"!",
"WindowsFaxClientSpiHelper",
".",
"nativeLibraryLoaded",
")",
"{",
"try",
"{",
"//ge... | Loads the native library if not loaded before.
@param logger
The logger | [
"Loads",
"the",
"native",
"library",
"if",
"not",
"loaded",
"before",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsFaxClientSpiHelper.java#L95-L142 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java | TieredBlockStore.abortBlockInternal | private void abortBlockInternal(long sessionId, long blockId) throws BlockDoesNotExistException,
BlockAlreadyExistsException, InvalidWorkerStateException, IOException {
"""
Aborts a temp block.
@param sessionId the id of session
@param blockId the id of block
@throws BlockDoesNotExistException if block ... | java | private void abortBlockInternal(long sessionId, long blockId) throws BlockDoesNotExistException,
BlockAlreadyExistsException, InvalidWorkerStateException, IOException {
String path;
TempBlockMeta tempBlockMeta;
try (LockResource r = new LockResource(mMetadataReadLock)) {
checkTempBlockOwnedBySe... | [
"private",
"void",
"abortBlockInternal",
"(",
"long",
"sessionId",
",",
"long",
"blockId",
")",
"throws",
"BlockDoesNotExistException",
",",
"BlockAlreadyExistsException",
",",
"InvalidWorkerStateException",
",",
"IOException",
"{",
"String",
"path",
";",
"TempBlockMeta",... | Aborts a temp block.
@param sessionId the id of session
@param blockId the id of block
@throws BlockDoesNotExistException if block id can not be found in temporary blocks
@throws BlockAlreadyExistsException if block id already exists in committed blocks
@throws InvalidWorkerStateException if block id is not owned by s... | [
"Aborts",
"a",
"temp",
"block",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java#L555-L575 |
wcm-io/wcm-io-wcm | commons/src/main/java/io/wcm/wcm/commons/util/RunMode.java | RunMode.disableIfNotPublish | @Deprecated
public static boolean disableIfNotPublish(Set<String> runModes, ComponentContext componentContext, Logger log) {
"""
Use this to disable a component if the runmode "publish" is not active. Component activation status is logged
with DEBUG level.
This method is a replacement for the
<code>com.day.cq... | java | @Deprecated
public static boolean disableIfNotPublish(Set<String> runModes, ComponentContext componentContext, Logger log) {
return disableIfNoRunModeActive(runModes, new String[] {
PUBLISH
}, componentContext, log);
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"disableIfNotPublish",
"(",
"Set",
"<",
"String",
">",
"runModes",
",",
"ComponentContext",
"componentContext",
",",
"Logger",
"log",
")",
"{",
"return",
"disableIfNoRunModeActive",
"(",
"runModes",
",",
"new",
"St... | Use this to disable a component if the runmode "publish" is not active. Component activation status is logged
with DEBUG level.
This method is a replacement for the
<code>com.day.cq.commons.RunModeUtil#disableIfNoRunModeActive(RunMode, String[], ComponentContext, Logger)</code>
method which is deprecated.
@param runMod... | [
"Use",
"this",
"to",
"disable",
"a",
"component",
"if",
"the",
"runmode",
"publish",
"is",
"not",
"active",
".",
"Component",
"activation",
"status",
"is",
"logged",
"with",
"DEBUG",
"level",
".",
"This",
"method",
"is",
"a",
"replacement",
"for",
"the",
"... | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/commons/src/main/java/io/wcm/wcm/commons/util/RunMode.java#L187-L192 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getDownloadThumbnailRequest | public BoxRequestsFile.DownloadThumbnail getDownloadThumbnailRequest(File target, String fileId) throws IOException {
"""
Gets a request that downloads a thumbnail to a target file
@param target target file to download to, target can only be a file
@param fileId id of file to download the thumbnail of
@... | java | public BoxRequestsFile.DownloadThumbnail getDownloadThumbnailRequest(File target, String fileId) throws IOException{
if (!target.exists()){
throw new FileNotFoundException();
}
if (target.isDirectory()){
throw new RuntimeException("This endpoint only supports files and do... | [
"public",
"BoxRequestsFile",
".",
"DownloadThumbnail",
"getDownloadThumbnailRequest",
"(",
"File",
"target",
",",
"String",
"fileId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"target",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"FileNotFoundExc... | Gets a request that downloads a thumbnail to a target file
@param target target file to download to, target can only be a file
@param fileId id of file to download the thumbnail of
@return request to download a thumbnail to a target file
@throws IOException throws FileNotFoundException if target file does not e... | [
"Gets",
"a",
"request",
"that",
"downloads",
"a",
"thumbnail",
"to",
"a",
"target",
"file"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L411-L420 |
h2oai/h2o-3 | h2o-core/src/main/java/water/api/Schema.java | Schema.parseInteger | static private <T> T parseInteger(String s, Class<T> return_type) {
"""
Parses a string into an integer data type specified by parameter return_type. Accepts any format that
is accepted by java's BigDecimal class.
- Throws a NumberFormatException if the evaluated string is not an integer or if the value is too l... | java | static private <T> T parseInteger(String s, Class<T> return_type) {
try {
java.math.BigDecimal num = new java.math.BigDecimal(s);
T result = (T) num.getClass().getDeclaredMethod(return_type.getSimpleName() + "ValueExact", new Class[0]).invoke(num);
return result;
} catch (InvocationTargetExcep... | [
"static",
"private",
"<",
"T",
">",
"T",
"parseInteger",
"(",
"String",
"s",
",",
"Class",
"<",
"T",
">",
"return_type",
")",
"{",
"try",
"{",
"java",
".",
"math",
".",
"BigDecimal",
"num",
"=",
"new",
"java",
".",
"math",
".",
"BigDecimal",
"(",
"... | Parses a string into an integer data type specified by parameter return_type. Accepts any format that
is accepted by java's BigDecimal class.
- Throws a NumberFormatException if the evaluated string is not an integer or if the value is too large to
be stored into return_type without overflow.
- Throws an IllegalAgument... | [
"Parses",
"a",
"string",
"into",
"an",
"integer",
"data",
"type",
"specified",
"by",
"parameter",
"return_type",
".",
"Accepts",
"any",
"format",
"that",
"is",
"accepted",
"by",
"java",
"s",
"BigDecimal",
"class",
".",
"-",
"Throws",
"a",
"NumberFormatExceptio... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/Schema.java#L571-L583 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java | CassandraDataHandlerBase.setFieldValueViaCQL | private void setFieldValueViaCQL(Object entity, Object thriftColumnValue, Attribute attribute) {
"""
Sets the field value via cql.
@param entity
the entity
@param thriftColumnValue
the thrift column value
@param attribute
the attribute
"""
if (attribute != null)
{
try
... | java | private void setFieldValueViaCQL(Object entity, Object thriftColumnValue, Attribute attribute)
{
if (attribute != null)
{
try
{
if (attribute.isCollection())
{
setCollectionValue(entity, thriftColumnValue, attribute);
... | [
"private",
"void",
"setFieldValueViaCQL",
"(",
"Object",
"entity",
",",
"Object",
"thriftColumnValue",
",",
"Attribute",
"attribute",
")",
"{",
"if",
"(",
"attribute",
"!=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"attribute",
".",
"isCollection",
"(",
")",... | Sets the field value via cql.
@param entity
the entity
@param thriftColumnValue
the thrift column value
@param attribute
the attribute | [
"Sets",
"the",
"field",
"value",
"via",
"cql",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java#L1560-L1586 |
joniles/mpxj | src/main/java/net/sf/mpxj/ResourceAssignment.java | ResourceAssignment.setBaselineBudgetWork | public void setBaselineBudgetWork(int baselineNumber, Duration value) {
"""
Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value
"""
set(selectField(AssignmentFieldLists.BASELINE_BUDGET_WORKS, baselineNumber), value);
} | java | public void setBaselineBudgetWork(int baselineNumber, Duration value)
{
set(selectField(AssignmentFieldLists.BASELINE_BUDGET_WORKS, baselineNumber), value);
} | [
"public",
"void",
"setBaselineBudgetWork",
"(",
"int",
"baselineNumber",
",",
"Duration",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"AssignmentFieldLists",
".",
"BASELINE_BUDGET_WORKS",
",",
"baselineNumber",
")",
",",
"value",
")",
";",
"}"
] | Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value | [
"Set",
"a",
"baseline",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1485-L1488 |
ACRA/acra | annotationprocessor/src/main/java/org/acra/processor/util/Strings.java | Strings.writeClass | public static void writeClass(@NonNull Filer filer, @NonNull TypeSpec typeSpec) throws IOException {
"""
Writes the given class to a respective file in the configuration package
@param filer filer to write to
@param typeSpec the class
@throws IOException if writing fails
"""
JavaFile.builder(PA... | java | public static void writeClass(@NonNull Filer filer, @NonNull TypeSpec typeSpec) throws IOException {
JavaFile.builder(PACKAGE, typeSpec)
.skipJavaLangImports(true)
.indent(" ")
.addFileComment("Copyright (c) " + Calendar.getInstance().get(Calendar.YEAR) + "\n\n... | [
"public",
"static",
"void",
"writeClass",
"(",
"@",
"NonNull",
"Filer",
"filer",
",",
"@",
"NonNull",
"TypeSpec",
"typeSpec",
")",
"throws",
"IOException",
"{",
"JavaFile",
".",
"builder",
"(",
"PACKAGE",
",",
"typeSpec",
")",
".",
"skipJavaLangImports",
"(",
... | Writes the given class to a respective file in the configuration package
@param filer filer to write to
@param typeSpec the class
@throws IOException if writing fails | [
"Writes",
"the",
"given",
"class",
"to",
"a",
"respective",
"file",
"in",
"the",
"configuration",
"package"
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/annotationprocessor/src/main/java/org/acra/processor/util/Strings.java#L61-L76 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java | BasicBondGenerator.getWidthForBond | public double getWidthForBond(IBond bond, RendererModel model) {
"""
Determine the width of a bond, returning either the width defined
in the model, or the override width. Note that this will be scaled
to the space of the model.
@param bond the bond to determine the width for
@param model the renderer model
... | java | public double getWidthForBond(IBond bond, RendererModel model) {
double scale = model.getParameter(Scale.class).getValue();
if (this.overrideBondWidth != -1) {
return this.overrideBondWidth / scale;
} else {
return model.getParameter(BondWidth.class).getValue() / scale;
... | [
"public",
"double",
"getWidthForBond",
"(",
"IBond",
"bond",
",",
"RendererModel",
"model",
")",
"{",
"double",
"scale",
"=",
"model",
".",
"getParameter",
"(",
"Scale",
".",
"class",
")",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"this",
".",
"override... | Determine the width of a bond, returning either the width defined
in the model, or the override width. Note that this will be scaled
to the space of the model.
@param bond the bond to determine the width for
@param model the renderer model
@return a double in chem-model space | [
"Determine",
"the",
"width",
"of",
"a",
"bond",
"returning",
"either",
"the",
"width",
"defined",
"in",
"the",
"model",
"or",
"the",
"override",
"width",
".",
"Note",
"that",
"this",
"will",
"be",
"scaled",
"to",
"the",
"space",
"of",
"the",
"model",
"."... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L245-L252 |
carewebframework/carewebframework-vista | org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigItem.java | ESigItem.addIssue | public ESigItemIssue addIssue(ESigItemIssueSeverity severity, String description) {
"""
Adds an issue to the signature item.
@param severity Severity of the issue.
@param description Description of the issue.
@return The added issue.
"""
ESigItemIssue issue = new ESigItemIssue(severity, descriptio... | java | public ESigItemIssue addIssue(ESigItemIssueSeverity severity, String description) {
ESigItemIssue issue = new ESigItemIssue(severity, description);
if (issues == null) {
issues = new ArrayList<ESigItemIssue>();
sortIssues = false;
} else {
int i = iss... | [
"public",
"ESigItemIssue",
"addIssue",
"(",
"ESigItemIssueSeverity",
"severity",
",",
"String",
"description",
")",
"{",
"ESigItemIssue",
"issue",
"=",
"new",
"ESigItemIssue",
"(",
"severity",
",",
"description",
")",
";",
"if",
"(",
"issues",
"==",
"null",
")",... | Adds an issue to the signature item.
@param severity Severity of the issue.
@param description Description of the issue.
@return The added issue. | [
"Adds",
"an",
"issue",
"to",
"the",
"signature",
"item",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigItem.java#L334-L352 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/Compare.java | Compare.compareDistance | private static boolean compareDistance(final String title1, final String title2, int distance) {
"""
Compare the Levenshtein Distance between the two strings
@param title1 title
@param title2 title
@param distance max distance
"""
return StringUtils.getLevenshteinDistance(title1, title2) <= distan... | java | private static boolean compareDistance(final String title1, final String title2, int distance) {
return StringUtils.getLevenshteinDistance(title1, title2) <= distance;
} | [
"private",
"static",
"boolean",
"compareDistance",
"(",
"final",
"String",
"title1",
",",
"final",
"String",
"title2",
",",
"int",
"distance",
")",
"{",
"return",
"StringUtils",
".",
"getLevenshteinDistance",
"(",
"title1",
",",
"title2",
")",
"<=",
"distance",
... | Compare the Levenshtein Distance between the two strings
@param title1 title
@param title2 title
@param distance max distance | [
"Compare",
"the",
"Levenshtein",
"Distance",
"between",
"the",
"two",
"strings"
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/Compare.java#L129-L131 |
alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JStormUtils.java | JStormUtils.zipContainsDir | public static boolean zipContainsDir(String zipfile, String resources) {
"""
Check whether the zipfile contain the resources
@param zipfile
@param resources
@return
"""
Enumeration<? extends ZipEntry> entries = null;
try {
entries = (new ZipFile(zipfile)).entries();
... | java | public static boolean zipContainsDir(String zipfile, String resources) {
Enumeration<? extends ZipEntry> entries = null;
try {
entries = (new ZipFile(zipfile)).entries();
while (entries != null && entries.hasMoreElements()) {
ZipEntry ze = entries.nextElement();
... | [
"public",
"static",
"boolean",
"zipContainsDir",
"(",
"String",
"zipfile",
",",
"String",
"resources",
")",
"{",
"Enumeration",
"<",
"?",
"extends",
"ZipEntry",
">",
"entries",
"=",
"null",
";",
"try",
"{",
"entries",
"=",
"(",
"new",
"ZipFile",
"(",
"zipf... | Check whether the zipfile contain the resources
@param zipfile
@param resources
@return | [
"Check",
"whether",
"the",
"zipfile",
"contain",
"the",
"resources"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JStormUtils.java#L797-L816 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.replaceResource | @Deprecated
public void replaceResource(String resourcename, int type, byte[] content, List<CmsProperty> properties)
throws CmsException {
"""
Replaces the content, type and properties of a resource.<p>
@param resourcename the name of the resource to replace (full current site relative path)
@param typ... | java | @Deprecated
public void replaceResource(String resourcename, int type, byte[] content, List<CmsProperty> properties)
throws CmsException {
replaceResource(resourcename, getResourceType(type), content, properties);
} | [
"@",
"Deprecated",
"public",
"void",
"replaceResource",
"(",
"String",
"resourcename",
",",
"int",
"type",
",",
"byte",
"[",
"]",
"content",
",",
"List",
"<",
"CmsProperty",
">",
"properties",
")",
"throws",
"CmsException",
"{",
"replaceResource",
"(",
"resour... | Replaces the content, type and properties of a resource.<p>
@param resourcename the name of the resource to replace (full current site relative path)
@param type the new type of the resource
@param content the new content of the resource
@param properties the new properties of the resource
@throws CmsException if som... | [
"Replaces",
"the",
"content",
"type",
"and",
"properties",
"of",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L3668-L3673 |
m-m-m/util | nls/src/main/java/net/sf/mmm/util/nls/impl/formatter/NlsFormatterChoice.java | NlsFormatterChoice.parseChoice | private Choice parseChoice(CharSequenceScanner scanner) {
"""
This method parses the {@link Choice}.
@param scanner is the {@link CharSequenceScanner}.
@return the parsed {@link Choice}.
"""
Filter<Object> condition = parseCondition(scanner);
List<Segment> segments = new ArrayList<>();
while (... | java | private Choice parseChoice(CharSequenceScanner scanner) {
Filter<Object> condition = parseCondition(scanner);
List<Segment> segments = new ArrayList<>();
while (scanner.hasNext()) {
int index = scanner.getCurrentIndex();
char c = scanner.peek();
String literal = null;
if ((c == '"')... | [
"private",
"Choice",
"parseChoice",
"(",
"CharSequenceScanner",
"scanner",
")",
"{",
"Filter",
"<",
"Object",
">",
"condition",
"=",
"parseCondition",
"(",
"scanner",
")",
";",
"List",
"<",
"Segment",
">",
"segments",
"=",
"new",
"ArrayList",
"<>",
"(",
")",... | This method parses the {@link Choice}.
@param scanner is the {@link CharSequenceScanner}.
@return the parsed {@link Choice}. | [
"This",
"method",
"parses",
"the",
"{",
"@link",
"Choice",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/nls/src/main/java/net/sf/mmm/util/nls/impl/formatter/NlsFormatterChoice.java#L123-L151 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java | JDBCUtilities.getFieldIndex | public static int getFieldIndex(ResultSetMetaData resultSetMetaData, String fieldName) throws SQLException {
"""
Fetch the metadata, and check field name
@param resultSetMetaData Active result set meta data.
@param fieldName Field name, ignore case
@return The field index [1-n]; -1 if the field is not found
@t... | java | public static int getFieldIndex(ResultSetMetaData resultSetMetaData, String fieldName) throws SQLException {
for(int columnId = 1; columnId <= resultSetMetaData.getColumnCount(); columnId++) {
if(fieldName.equalsIgnoreCase(resultSetMetaData.getColumnName(columnId))) {
return columnId... | [
"public",
"static",
"int",
"getFieldIndex",
"(",
"ResultSetMetaData",
"resultSetMetaData",
",",
"String",
"fieldName",
")",
"throws",
"SQLException",
"{",
"for",
"(",
"int",
"columnId",
"=",
"1",
";",
"columnId",
"<=",
"resultSetMetaData",
".",
"getColumnCount",
"... | Fetch the metadata, and check field name
@param resultSetMetaData Active result set meta data.
@param fieldName Field name, ignore case
@return The field index [1-n]; -1 if the field is not found
@throws SQLException | [
"Fetch",
"the",
"metadata",
"and",
"check",
"field",
"name"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/JDBCUtilities.java#L117-L124 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session/src/com/ibm/ws/session/SessionManager.java | SessionManager.createSession | @Override
public Object createSession(ServletRequest req, ServletResponse res, SessionAffinityContext sac, boolean reuseTheId) {
"""
/*
Method used to create the Session from a request
(non-Javadoc)
@see
com.ibm.wsspi.session.IGenericSessionManager#createSession(javax.servlet
.ServletRequest, javax.serv... | java | @Override
public Object createSession(ServletRequest req, ServletResponse res, SessionAffinityContext sac, boolean reuseTheId) {
String id = _sam.getInUseSessionID(req, sac);
int version = _sam.getInUseSessionVersion(req, sac); // sac.getRequestedSessionVersion();
ISession isess = createISes... | [
"@",
"Override",
"public",
"Object",
"createSession",
"(",
"ServletRequest",
"req",
",",
"ServletResponse",
"res",
",",
"SessionAffinityContext",
"sac",
",",
"boolean",
"reuseTheId",
")",
"{",
"String",
"id",
"=",
"_sam",
".",
"getInUseSessionID",
"(",
"req",
",... | /*
Method used to create the Session from a request
(non-Javadoc)
@see
com.ibm.wsspi.session.IGenericSessionManager#createSession(javax.servlet
.ServletRequest, javax.servlet.ServletResponse,
com.ibm.wsspi.session.SessionAffinityContext, boolean) | [
"/",
"*",
"Method",
"used",
"to",
"create",
"the",
"Session",
"from",
"a",
"request",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/session/SessionManager.java#L723-L729 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.