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 |
|---|---|---|---|---|---|---|---|---|---|---|
mozilla/rhino | examples/File.java | File.write0 | private static void write0(Scriptable thisObj, Object[] args, boolean eol)
throws IOException {
"""
Perform the guts of write and writeLine.
Since the two functions differ only in whether they write a
newline character, move the code into a common subroutine.
"""
File thisFile = checkInstan... | java | private static void write0(Scriptable thisObj, Object[] args, boolean eol)
throws IOException
{
File thisFile = checkInstance(thisObj);
if (thisFile.reader != null) {
throw Context.reportRuntimeError("already writing file \""
+ thisFil... | [
"private",
"static",
"void",
"write0",
"(",
"Scriptable",
"thisObj",
",",
"Object",
"[",
"]",
"args",
",",
"boolean",
"eol",
")",
"throws",
"IOException",
"{",
"File",
"thisFile",
"=",
"checkInstance",
"(",
"thisObj",
")",
";",
"if",
"(",
"thisFile",
".",
... | Perform the guts of write and writeLine.
Since the two functions differ only in whether they write a
newline character, move the code into a common subroutine. | [
"Perform",
"the",
"guts",
"of",
"write",
"and",
"writeLine",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/examples/File.java#L293-L312 |
apache/spark | common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java | Murmur3_x86_32.fmix | private static int fmix(int h1, int length) {
"""
Finalization mix - force all bits of a hash block to avalanche
"""
h1 ^= length;
h1 ^= h1 >>> 16;
h1 *= 0x85ebca6b;
h1 ^= h1 >>> 13;
h1 *= 0xc2b2ae35;
h1 ^= h1 >>> 16;
return h1;
} | java | private static int fmix(int h1, int length) {
h1 ^= length;
h1 ^= h1 >>> 16;
h1 *= 0x85ebca6b;
h1 ^= h1 >>> 13;
h1 *= 0xc2b2ae35;
h1 ^= h1 >>> 16;
return h1;
} | [
"private",
"static",
"int",
"fmix",
"(",
"int",
"h1",
",",
"int",
"length",
")",
"{",
"h1",
"^=",
"length",
";",
"h1",
"^=",
"h1",
">>>",
"16",
";",
"h1",
"*=",
"0x85ebca6b",
";",
"h1",
"^=",
"h1",
">>>",
"13",
";",
"h1",
"*=",
"0xc2b2ae35",
";",... | Finalization mix - force all bits of a hash block to avalanche | [
"Finalization",
"mix",
"-",
"force",
"all",
"bits",
"of",
"a",
"hash",
"block",
"to",
"avalanche"
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java#L133-L141 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/event/EventNotificationUrl.java | EventNotificationUrl.getEventUrl | public static MozuUrl getEventUrl(String eventId, String responseFields) {
"""
Get Resource Url for GetEvent
@param eventId The unique identifier of the event being retrieved. An event is a notification about a create, read, update, or delete on an order, product, discount or category.
@param responseFields Filt... | java | public static MozuUrl getEventUrl(String eventId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/event/pull/{eventId}?responseFields={responseFields}");
formatter.formatUrl("eventId", eventId);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.ge... | [
"public",
"static",
"MozuUrl",
"getEventUrl",
"(",
"String",
"eventId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/event/pull/{eventId}?responseFields={responseFields}\"",
")",
";",
"formatter",
".",
... | Get Resource Url for GetEvent
@param eventId The unique identifier of the event being retrieved. An event is a notification about a create, read, update, or delete on an order, product, discount or category.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data return... | [
"Get",
"Resource",
"Url",
"for",
"GetEvent"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/event/EventNotificationUrl.java#L42-L48 |
EdwardRaff/JSAT | JSAT/src/jsat/io/CSV.java | CSV.readC | public static ClassificationDataSet readC(int classification_target, Path path, int lines_to_skip, Set<Integer> cat_cols) throws IOException {
"""
Reads in a CSV dataset as a classification dataset. Comments assumed to
start with the "#" symbol.
@param classification_target the column index (starting from zero... | java | public static ClassificationDataSet readC(int classification_target, Path path, int lines_to_skip, Set<Integer> cat_cols) throws IOException
{
return readC(classification_target, path, DEFAULT_DELIMITER, lines_to_skip, DEFAULT_COMMENT, cat_cols);
} | [
"public",
"static",
"ClassificationDataSet",
"readC",
"(",
"int",
"classification_target",
",",
"Path",
"path",
",",
"int",
"lines_to_skip",
",",
"Set",
"<",
"Integer",
">",
"cat_cols",
")",
"throws",
"IOException",
"{",
"return",
"readC",
"(",
"classification_tar... | Reads in a CSV dataset as a classification dataset. Comments assumed to
start with the "#" symbol.
@param classification_target the column index (starting from zero) of the
feature that will be the categorical target value
@param path the CSV file to read
@param lines_to_skip the number of lines to skip when reading i... | [
"Reads",
"in",
"a",
"CSV",
"dataset",
"as",
"a",
"classification",
"dataset",
".",
"Comments",
"assumed",
"to",
"start",
"with",
"the",
"#",
"symbol",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/CSV.java#L154-L157 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java | JavaUtils.deleteRecursively | public static void deleteRecursively(File file, FilenameFilter filter) throws IOException {
"""
Delete a file or directory and its contents recursively.
Don't follow directories if they are symlinks.
@param file Input file / dir to be deleted
@param filter A filename filter that make sure only files / dirs wi... | java | public static void deleteRecursively(File file, FilenameFilter filter) throws IOException {
if (file == null) { return; }
// On Unix systems, use operating system command to run faster
// If that does not work out, fallback to the Java IO way
if (SystemUtils.IS_OS_UNIX && filter == null) {
try {
... | [
"public",
"static",
"void",
"deleteRecursively",
"(",
"File",
"file",
",",
"FilenameFilter",
"filter",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// On Unix systems, use operating system command to run faster",
... | Delete a file or directory and its contents recursively.
Don't follow directories if they are symlinks.
@param file Input file / dir to be deleted
@param filter A filename filter that make sure only files / dirs with the satisfied filenames
are deleted.
@throws IOException if deletion is unsuccessful | [
"Delete",
"a",
"file",
"or",
"directory",
"and",
"its",
"contents",
"recursively",
".",
"Don",
"t",
"follow",
"directories",
"if",
"they",
"are",
"symlinks",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java#L103-L119 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/validation/fieldvalidation/FieldFormatterRegistry.java | FieldFormatterRegistry.addStrippedPropertyPaths | public void addStrippedPropertyPaths(List<String> strippedPaths, String nestedPath, String propertyPath) {
"""
パスからリストのインデックス([1])やマップのキー([key])を除去したものを構成する。
<p>SpringFrameworkの「PropertyEditorRegistrySupport#addStrippedPropertyPaths(...)」の処理</p>
@param strippedPaths 除去したパス
@param nestedPath 現在のネストしたパス
@param p... | java | public void addStrippedPropertyPaths(List<String> strippedPaths, String nestedPath, String propertyPath) {
final int startIndex = propertyPath.indexOf('[');
if (startIndex != -1) {
final int endIndex = propertyPath.indexOf(']');
if (endIndex != -1) {
... | [
"public",
"void",
"addStrippedPropertyPaths",
"(",
"List",
"<",
"String",
">",
"strippedPaths",
",",
"String",
"nestedPath",
",",
"String",
"propertyPath",
")",
"{",
"final",
"int",
"startIndex",
"=",
"propertyPath",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
... | パスからリストのインデックス([1])やマップのキー([key])を除去したものを構成する。
<p>SpringFrameworkの「PropertyEditorRegistrySupport#addStrippedPropertyPaths(...)」の処理</p>
@param strippedPaths 除去したパス
@param nestedPath 現在のネストしたパス
@param propertyPath 処理対象のパス | [
"パスからリストのインデックス",
"(",
"[",
"1",
"]",
")",
"やマップのキー",
"(",
"[",
"key",
"]",
")",
"を除去したものを構成する。",
"<p",
">",
"SpringFrameworkの「PropertyEditorRegistrySupport#addStrippedPropertyPaths",
"(",
"...",
")",
"」の処理<",
"/",
"p",
">"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/validation/fieldvalidation/FieldFormatterRegistry.java#L137-L157 |
OpenCompare/OpenCompare | org.opencompare/pcmdata-importers/src/main/java/misc/PCMUtil.java | PCMUtil.loadCSV | public static List<PCMContainer> loadCSV(File file) throws IOException {
"""
A helper method to get a PCMContainer from a CSV file (limited in a sense we only retrieve the 1st element of containers)
@param file
@return
@throws IOException
"""
return loadCSV(file, PCMDirection.PRODUCTS_AS_LINES);
... | java | public static List<PCMContainer> loadCSV(File file) throws IOException {
return loadCSV(file, PCMDirection.PRODUCTS_AS_LINES);
} | [
"public",
"static",
"List",
"<",
"PCMContainer",
">",
"loadCSV",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"return",
"loadCSV",
"(",
"file",
",",
"PCMDirection",
".",
"PRODUCTS_AS_LINES",
")",
";",
"}"
] | A helper method to get a PCMContainer from a CSV file (limited in a sense we only retrieve the 1st element of containers)
@param file
@return
@throws IOException | [
"A",
"helper",
"method",
"to",
"get",
"a",
"PCMContainer",
"from",
"a",
"CSV",
"file",
"(",
"limited",
"in",
"a",
"sense",
"we",
"only",
"retrieve",
"the",
"1st",
"element",
"of",
"containers",
")"
] | train | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/pcmdata-importers/src/main/java/misc/PCMUtil.java#L147-L150 |
citrusframework/citrus | modules/citrus-selenium/src/main/java/com/consol/citrus/selenium/actions/FindElementAction.java | FindElementAction.execute | protected void execute(WebElement element, SeleniumBrowser browser, TestContext context) {
"""
Subclasses may override this method in order to add element actions.
@param element
@param browser
@param context
"""
if (StringUtils.hasText(element.getTagName())) {
context.setVariable(elemen... | java | protected void execute(WebElement element, SeleniumBrowser browser, TestContext context) {
if (StringUtils.hasText(element.getTagName())) {
context.setVariable(element.getTagName(), element);
}
} | [
"protected",
"void",
"execute",
"(",
"WebElement",
"element",
",",
"SeleniumBrowser",
"browser",
",",
"TestContext",
"context",
")",
"{",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"element",
".",
"getTagName",
"(",
")",
")",
")",
"{",
"context",
".",
... | Subclasses may override this method in order to add element actions.
@param element
@param browser
@param context | [
"Subclasses",
"may",
"override",
"this",
"method",
"in",
"order",
"to",
"add",
"element",
"actions",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-selenium/src/main/java/com/consol/citrus/selenium/actions/FindElementAction.java#L132-L136 |
gosu-lang/gosu-lang | gosu-lab/src/main/java/editor/util/EditorUtilities.java | EditorUtilities.findAtOrAbove | public static <T> T findAtOrAbove( Component start, Class<T> aClass ) {
"""
Finds the first widget at or above the passed in widget of the given class
"""
Component comp = start;
while( comp != null )
{
if( aClass.isInstance( comp ) )
{
return (T)comp;
}
else
{... | java | public static <T> T findAtOrAbove( Component start, Class<T> aClass )
{
Component comp = start;
while( comp != null )
{
if( aClass.isInstance( comp ) )
{
return (T)comp;
}
else
{
comp = comp.getParent();
}
}
return null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"findAtOrAbove",
"(",
"Component",
"start",
",",
"Class",
"<",
"T",
">",
"aClass",
")",
"{",
"Component",
"comp",
"=",
"start",
";",
"while",
"(",
"comp",
"!=",
"null",
")",
"{",
"if",
"(",
"aClass",
".",
"is... | Finds the first widget at or above the passed in widget of the given class | [
"Finds",
"the",
"first",
"widget",
"at",
"or",
"above",
"the",
"passed",
"in",
"widget",
"of",
"the",
"given",
"class"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-lab/src/main/java/editor/util/EditorUtilities.java#L769-L784 |
buschmais/jqa-rdbms-plugin | src/main/java/com/buschmais/jqassistant/plugin/rdbms/impl/scanner/AbstractSchemaScannerPlugin.java | AbstractSchemaScannerPlugin.createSchemas | private List<SchemaDescriptor> createSchemas(Catalog catalog, Store store) throws IOException {
"""
Stores the data.
@param catalog The catalog.
@param store The store.
@return The list of created schema descriptors.
@throws java.io.IOException If an error occurs.
"""
List<SchemaDescriptor> sch... | java | private List<SchemaDescriptor> createSchemas(Catalog catalog, Store store) throws IOException {
List<SchemaDescriptor> schemaDescriptors = new ArrayList<>();
Map<String, ColumnTypeDescriptor> columnTypes = new HashMap<>();
Map<Column, ColumnDescriptor> allColumns = new HashMap<>();
Set<F... | [
"private",
"List",
"<",
"SchemaDescriptor",
">",
"createSchemas",
"(",
"Catalog",
"catalog",
",",
"Store",
"store",
")",
"throws",
"IOException",
"{",
"List",
"<",
"SchemaDescriptor",
">",
"schemaDescriptors",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Map... | Stores the data.
@param catalog The catalog.
@param store The store.
@return The list of created schema descriptors.
@throws java.io.IOException If an error occurs. | [
"Stores",
"the",
"data",
"."
] | train | https://github.com/buschmais/jqa-rdbms-plugin/blob/96c3919907deee00175cf5ab005867d76e01ba62/src/main/java/com/buschmais/jqassistant/plugin/rdbms/impl/scanner/AbstractSchemaScannerPlugin.java#L127-L146 |
enioka/jqm | jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/Helpers.java | Helpers.createUserIfMissing | static void createUserIfMissing(DbConn cnx, String login, String password, String description, String... roles) {
"""
Creates a new user if does not exist. If it exists, it is unlocked and roles are reset (password is untouched).
@param cnx
@param login
@param password
the raw password. it will be hashed.
@... | java | static void createUserIfMissing(DbConn cnx, String login, String password, String description, String... roles)
{
try
{
int userId = cnx.runSelectSingle("user_select_id_by_key", Integer.class, login);
cnx.runUpdate("user_update_enable_by_id", userId);
RUser.set_ro... | [
"static",
"void",
"createUserIfMissing",
"(",
"DbConn",
"cnx",
",",
"String",
"login",
",",
"String",
"password",
",",
"String",
"description",
",",
"String",
"...",
"roles",
")",
"{",
"try",
"{",
"int",
"userId",
"=",
"cnx",
".",
"runSelectSingle",
"(",
"... | Creates a new user if does not exist. If it exists, it is unlocked and roles are reset (password is untouched).
@param cnx
@param login
@param password
the raw password. it will be hashed.
@param description
@param roles | [
"Creates",
"a",
"new",
"user",
"if",
"does",
"not",
"exist",
".",
"If",
"it",
"exists",
"it",
"is",
"unlocked",
"and",
"roles",
"are",
"reset",
"(",
"password",
"is",
"untouched",
")",
"."
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/Helpers.java#L441-L462 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/AbstractGeneratedSQLTransform.java | AbstractGeneratedSQLTransform.generateReadValueFromCursor | @Override
public void generateReadValueFromCursor(Builder methodBuilder, SQLiteDaoDefinition daoDefinition, TypeName paramTypeName, String cursorName, String indexName) {
"""
/* (non-Javadoc)
@see com.abubusoft.kripton.processor.sqlite.transform.AbstractSQLTransform#generateReadValueFromCursor(com.squareup.javap... | java | @Override
public void generateReadValueFromCursor(Builder methodBuilder, SQLiteDaoDefinition daoDefinition, TypeName paramTypeName, String cursorName, String indexName) {
String methodName = daoDefinition.generateJava2ContentParser(paramTypeName);
methodBuilder.addCode("$L($L.getBlob($L))", methodName, cursorName... | [
"@",
"Override",
"public",
"void",
"generateReadValueFromCursor",
"(",
"Builder",
"methodBuilder",
",",
"SQLiteDaoDefinition",
"daoDefinition",
",",
"TypeName",
"paramTypeName",
",",
"String",
"cursorName",
",",
"String",
"indexName",
")",
"{",
"String",
"methodName",
... | /* (non-Javadoc)
@see com.abubusoft.kripton.processor.sqlite.transform.AbstractSQLTransform#generateReadValueFromCursor(com.squareup.javapoet.MethodSpec.Builder, com.abubusoft.kripton.processor.sqlite.model.SQLiteDaoDefinition, com.squareup.javapoet.TypeName, java.lang.String, java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/transform/AbstractGeneratedSQLTransform.java#L69-L74 |
phax/ph-oton | ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/handler/AbstractWebPageActionHandlerMultiDelete.java | AbstractWebPageActionHandlerMultiDelete.createDeleteToolbar | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createDeleteToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nonnull final ICommonsList <DATATYPE> aSelectedObjects) {
"""
Create toolbar for del... | java | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createDeleteToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nonnull final ICommonsList <DATATYPE> aSelectedObjects)
{
final Locale aDisplayLoca... | [
"@",
"Nonnull",
"@",
"OverrideOnDemand",
"protected",
"TOOLBAR_TYPE",
"createDeleteToolbar",
"(",
"@",
"Nonnull",
"final",
"WPECTYPE",
"aWPEC",
",",
"@",
"Nonnull",
"final",
"FORM_TYPE",
"aForm",
",",
"@",
"Nonnull",
"final",
"ICommonsList",
"<",
"DATATYPE",
">",
... | Create toolbar for deleting an existing object
@param aWPEC
The web page execution context
@param aForm
The handled form. Never <code>null</code>.
@param aSelectedObjects
Selected objects. Never <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"toolbar",
"for",
"deleting",
"an",
"existing",
"object"
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/handler/AbstractWebPageActionHandlerMultiDelete.java#L132-L153 |
mockito/mockito | src/main/java/org/mockito/internal/stubbing/defaultanswers/ReturnsDeepStubs.java | ReturnsDeepStubs.newDeepStubMock | private Object newDeepStubMock(GenericMetadataSupport returnTypeGenericMetadata, Object parentMock) {
"""
Creates a mock using the Generics Metadata.
<li>Finally as we want to mock the actual type, but we want to pass along the contextual generics meta-data
that was resolved for the current return type, for th... | java | private Object newDeepStubMock(GenericMetadataSupport returnTypeGenericMetadata, Object parentMock) {
MockCreationSettings parentMockSettings = MockUtil.getMockSettings(parentMock);
return mockitoCore().mock(
returnTypeGenericMetadata.rawType(),
withSettingsUsing(returnTypeGeneri... | [
"private",
"Object",
"newDeepStubMock",
"(",
"GenericMetadataSupport",
"returnTypeGenericMetadata",
",",
"Object",
"parentMock",
")",
"{",
"MockCreationSettings",
"parentMockSettings",
"=",
"MockUtil",
".",
"getMockSettings",
"(",
"parentMock",
")",
";",
"return",
"mockit... | Creates a mock using the Generics Metadata.
<li>Finally as we want to mock the actual type, but we want to pass along the contextual generics meta-data
that was resolved for the current return type, for this to happen we associate to the mock an new instance of
{@link ReturnsDeepStubs} answer in which we will store th... | [
"Creates",
"a",
"mock",
"using",
"the",
"Generics",
"Metadata",
"."
] | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/stubbing/defaultanswers/ReturnsDeepStubs.java#L105-L111 |
micronaut-projects/micronaut-core | inject-java/src/main/java/io/micronaut/annotation/processing/AnnotationUtils.java | AnnotationUtils.hasStereotype | protected boolean hasStereotype(Element element, List<String> stereotypes) {
"""
Return whether the given element is annotated with any of the given annotation stereotypes.
@param element The element
@param stereotypes The stereotypes
@return True if it is
"""
if (element == null) {
... | java | protected boolean hasStereotype(Element element, List<String> stereotypes) {
if (element == null) {
return false;
}
if (stereotypes.contains(element.toString())) {
return true;
}
AnnotationMetadata annotationMetadata = getAnnotationMetadata(element);
... | [
"protected",
"boolean",
"hasStereotype",
"(",
"Element",
"element",
",",
"List",
"<",
"String",
">",
"stereotypes",
")",
"{",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"stereotypes",
".",
"contains",
"(",
"elem... | Return whether the given element is annotated with any of the given annotation stereotypes.
@param element The element
@param stereotypes The stereotypes
@return True if it is | [
"Return",
"whether",
"the",
"given",
"element",
"is",
"annotated",
"with",
"any",
"of",
"the",
"given",
"annotation",
"stereotypes",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject-java/src/main/java/io/micronaut/annotation/processing/AnnotationUtils.java#L162-L176 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java | BpmnParse.parseActivities | public void parseActivities(List<Element> activityElements, Element parentElement, ScopeImpl scopeElement) {
"""
Parses the activities of a certain level in the process (process,
subprocess or another scope).
@param activityElements
The list of activities to be parsed. This list may be filtered before.
@para... | java | public void parseActivities(List<Element> activityElements, Element parentElement, ScopeImpl scopeElement) {
for (Element activityElement : activityElements) {
parseActivity(activityElement, parentElement, scopeElement);
}
} | [
"public",
"void",
"parseActivities",
"(",
"List",
"<",
"Element",
">",
"activityElements",
",",
"Element",
"parentElement",
",",
"ScopeImpl",
"scopeElement",
")",
"{",
"for",
"(",
"Element",
"activityElement",
":",
"activityElements",
")",
"{",
"parseActivity",
"(... | Parses the activities of a certain level in the process (process,
subprocess or another scope).
@param activityElements
The list of activities to be parsed. This list may be filtered before.
@param parentElement
The 'parent' element that contains the activities (process, subprocess).
@param scopeElement
The {@link Sco... | [
"Parses",
"the",
"activities",
"of",
"a",
"certain",
"level",
"in",
"the",
"process",
"(",
"process",
"subprocess",
"or",
"another",
"scope",
")",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L1254-L1258 |
hal/elemento | core/src/main/java/org/jboss/gwt/elemento/core/BodyObserver.java | BodyObserver.addDetachObserver | static void addDetachObserver(HTMLElement element, ObserverCallback callback) {
"""
Check if the observer is already started, if not it will start it, then register and callback for when the
element is removed from the dom.
"""
if (!ready) {
startObserving();
}
detachObserv... | java | static void addDetachObserver(HTMLElement element, ObserverCallback callback) {
if (!ready) {
startObserving();
}
detachObservers.add(createObserver(element, callback, DETACH_UID_KEY));
} | [
"static",
"void",
"addDetachObserver",
"(",
"HTMLElement",
"element",
",",
"ObserverCallback",
"callback",
")",
"{",
"if",
"(",
"!",
"ready",
")",
"{",
"startObserving",
"(",
")",
";",
"}",
"detachObservers",
".",
"add",
"(",
"createObserver",
"(",
"element",
... | Check if the observer is already started, if not it will start it, then register and callback for when the
element is removed from the dom. | [
"Check",
"if",
"the",
"observer",
"is",
"already",
"started",
"if",
"not",
"it",
"will",
"start",
"it",
"then",
"register",
"and",
"callback",
"for",
"when",
"the",
"element",
"is",
"removed",
"from",
"the",
"dom",
"."
] | train | https://github.com/hal/elemento/blob/26da2d5a1fe2ec55b779737dbaeda25a942eee61/core/src/main/java/org/jboss/gwt/elemento/core/BodyObserver.java#L111-L116 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/DuplicatingCheckpointOutputStream.java | DuplicatingCheckpointOutputStream.closeAndGetSecondaryHandle | public StreamStateHandle closeAndGetSecondaryHandle() throws IOException {
"""
Returns the state handle from the {@link #secondaryOutputStream}. Also reports suppressed exceptions from earlier
interactions with that stream.
"""
if (secondaryStreamException == null) {
flushInternalBuffer();
return seco... | java | public StreamStateHandle closeAndGetSecondaryHandle() throws IOException {
if (secondaryStreamException == null) {
flushInternalBuffer();
return secondaryOutputStream.closeAndGetHandle();
} else {
throw new IOException("Secondary stream previously failed exceptionally", secondaryStreamException);
}
} | [
"public",
"StreamStateHandle",
"closeAndGetSecondaryHandle",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"secondaryStreamException",
"==",
"null",
")",
"{",
"flushInternalBuffer",
"(",
")",
";",
"return",
"secondaryOutputStream",
".",
"closeAndGetHandle",
"(",
... | Returns the state handle from the {@link #secondaryOutputStream}. Also reports suppressed exceptions from earlier
interactions with that stream. | [
"Returns",
"the",
"state",
"handle",
"from",
"the",
"{"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/DuplicatingCheckpointOutputStream.java#L261-L268 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/Actions.java | Actions.clickAndHold | public Actions clickAndHold(WebElement target) {
"""
Clicks (without releasing) in the middle of the given element. This is equivalent to:
<i>Actions.moveToElement(onElement).clickAndHold()</i>
@param target Element to move to and click.
@return A self reference.
"""
if (isBuildingActions()) {
a... | java | public Actions clickAndHold(WebElement target) {
if (isBuildingActions()) {
action.addAction(new ClickAndHoldAction(jsonMouse, (Locatable) target));
}
return moveInTicks(target, 0, 0)
.tick(defaultMouse.createPointerDown(LEFT.asArg()));
} | [
"public",
"Actions",
"clickAndHold",
"(",
"WebElement",
"target",
")",
"{",
"if",
"(",
"isBuildingActions",
"(",
")",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"ClickAndHoldAction",
"(",
"jsonMouse",
",",
"(",
"Locatable",
")",
"target",
")",
")",
... | Clicks (without releasing) in the middle of the given element. This is equivalent to:
<i>Actions.moveToElement(onElement).clickAndHold()</i>
@param target Element to move to and click.
@return A self reference. | [
"Clicks",
"(",
"without",
"releasing",
")",
"in",
"the",
"middle",
"of",
"the",
"given",
"element",
".",
"This",
"is",
"equivalent",
"to",
":",
"<i",
">",
"Actions",
".",
"moveToElement",
"(",
"onElement",
")",
".",
"clickAndHold",
"()",
"<",
"/",
"i",
... | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L232-L238 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java | AbstractMemberWriter.addDeprecatedInfo | protected void addDeprecatedInfo(ProgramElementDoc member, Content contentTree) {
"""
Add the deprecated information for the given member.
@param member the member being documented.
@param contentTree the content tree to which the deprecated information will be added.
"""
Content output = (new Depr... | java | protected void addDeprecatedInfo(ProgramElementDoc member, Content contentTree) {
Content output = (new DeprecatedTaglet()).getTagletOutput(member,
writer.getTagletWriterInstance(false));
if (!output.isEmpty()) {
Content deprecatedContent = output;
Content div = HtmlT... | [
"protected",
"void",
"addDeprecatedInfo",
"(",
"ProgramElementDoc",
"member",
",",
"Content",
"contentTree",
")",
"{",
"Content",
"output",
"=",
"(",
"new",
"DeprecatedTaglet",
"(",
")",
")",
".",
"getTagletOutput",
"(",
"member",
",",
"writer",
".",
"getTagletW... | Add the deprecated information for the given member.
@param member the member being documented.
@param contentTree the content tree to which the deprecated information will be added. | [
"Add",
"the",
"deprecated",
"information",
"for",
"the",
"given",
"member",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java#L353-L361 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PositionFromPairLinear2.java | PositionFromPairLinear2.process | public boolean process( DMatrixRMaj R , List<Point3D_F64> worldPts , List<Point2D_F64> observed ) {
"""
Computes the translation given two or more feature observations and the known rotation
@param R Rotation matrix. World to view.
@param worldPts Location of features in world coordinates.
@param observed Obs... | java | public boolean process( DMatrixRMaj R , List<Point3D_F64> worldPts , List<Point2D_F64> observed )
{
if( worldPts.size() != observed.size() )
throw new IllegalArgumentException("Number of worldPts and observed must be the same");
if( worldPts.size() < 2 )
throw new IllegalArgumentException("A minimum of two p... | [
"public",
"boolean",
"process",
"(",
"DMatrixRMaj",
"R",
",",
"List",
"<",
"Point3D_F64",
">",
"worldPts",
",",
"List",
"<",
"Point2D_F64",
">",
"observed",
")",
"{",
"if",
"(",
"worldPts",
".",
"size",
"(",
")",
"!=",
"observed",
".",
"size",
"(",
")"... | Computes the translation given two or more feature observations and the known rotation
@param R Rotation matrix. World to view.
@param worldPts Location of features in world coordinates.
@param observed Observations of point in current view. Normalized coordinates.
@return true if it succeeded. | [
"Computes",
"the",
"translation",
"given",
"two",
"or",
"more",
"feature",
"observations",
"and",
"the",
"known",
"rotation"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/PositionFromPairLinear2.java#L78-L121 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.postponeSubscription | public Subscription postponeSubscription(final Subscription subscription, final DateTime renewaldate) {
"""
Postpone a subscription
<p>
postpone a subscription, setting a new renewal date.
@param subscription Subscription object
@return Subscription
"""
return doPUT(Subscription.SUBSCRIPTION_RESO... | java | public Subscription postponeSubscription(final Subscription subscription, final DateTime renewaldate) {
return doPUT(Subscription.SUBSCRIPTION_RESOURCE + "/" + subscription.getUuid() + "/postpone?next_renewal_date=" + renewaldate,
subscription, Subscription.class);
} | [
"public",
"Subscription",
"postponeSubscription",
"(",
"final",
"Subscription",
"subscription",
",",
"final",
"DateTime",
"renewaldate",
")",
"{",
"return",
"doPUT",
"(",
"Subscription",
".",
"SUBSCRIPTION_RESOURCE",
"+",
"\"/\"",
"+",
"subscription",
".",
"getUuid",
... | Postpone a subscription
<p>
postpone a subscription, setting a new renewal date.
@param subscription Subscription object
@return Subscription | [
"Postpone",
"a",
"subscription",
"<p",
">",
"postpone",
"a",
"subscription",
"setting",
"a",
"new",
"renewal",
"date",
"."
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L551-L554 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/support/i18n/message/AbstractMessageSource.java | AbstractMessageSource.resolveCodeWithoutArguments | protected String resolveCodeWithoutArguments(String code, Locale locale) {
"""
Subclasses can override this method to resolve a message without arguments
in an optimized fashion, i.e. to resolve without involving a MessageFormat.
<p>The default implementation <i>does</i> use MessageFormat, through
delegating to... | java | protected String resolveCodeWithoutArguments(String code, Locale locale) {
MessageFormat messageFormat = resolveCode(code, locale);
if (messageFormat != null) {
synchronized (messageFormat) {
return messageFormat.format(new Object[0]);
}
} else {
... | [
"protected",
"String",
"resolveCodeWithoutArguments",
"(",
"String",
"code",
",",
"Locale",
"locale",
")",
"{",
"MessageFormat",
"messageFormat",
"=",
"resolveCode",
"(",
"code",
",",
"locale",
")",
";",
"if",
"(",
"messageFormat",
"!=",
"null",
")",
"{",
"syn... | Subclasses can override this method to resolve a message without arguments
in an optimized fashion, i.e. to resolve without involving a MessageFormat.
<p>The default implementation <i>does</i> use MessageFormat, through
delegating to the {@link #resolveCode} method. Subclasses are encouraged
to replace this with optimi... | [
"Subclasses",
"can",
"override",
"this",
"method",
"to",
"resolve",
"a",
"message",
"without",
"arguments",
"in",
"an",
"optimized",
"fashion",
"i",
".",
"e",
".",
"to",
"resolve",
"without",
"involving",
"a",
"MessageFormat",
".",
"<p",
">",
"The",
"default... | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/support/i18n/message/AbstractMessageSource.java#L259-L268 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/ShakeAroundAPI.java | ShakeAroundAPI.pageAdd | public static PageAddResult pageAdd(String accessToken, PageAdd pageAdd) {
"""
页面管理-新增页面
@param accessToken accessToken
@param pageAdd pageAdd
@return result
"""
return pageAdd(accessToken, JsonUtil.toJSONString(pageAdd));
} | java | public static PageAddResult pageAdd(String accessToken, PageAdd pageAdd) {
return pageAdd(accessToken, JsonUtil.toJSONString(pageAdd));
} | [
"public",
"static",
"PageAddResult",
"pageAdd",
"(",
"String",
"accessToken",
",",
"PageAdd",
"pageAdd",
")",
"{",
"return",
"pageAdd",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"pageAdd",
")",
")",
";",
"}"
] | 页面管理-新增页面
@param accessToken accessToken
@param pageAdd pageAdd
@return result | [
"页面管理-新增页面"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/ShakeAroundAPI.java#L726-L728 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/concurrent/JRebirth.java | JRebirth.runIntoJIT | public static void runIntoJIT(final String runnableName, final PriorityLevel runnablePriority, final Runnable runnable) {
"""
Run into the JRebirth Internal Thread [JIT].
Actually only few methods are allowed to execute themselves into JRebirthThread.
<ul>
<li>Uncaught Exception Handler initialization</li>
<... | java | public static void runIntoJIT(final String runnableName, final PriorityLevel runnablePriority, final Runnable runnable) {
runIntoJIT(new JrbReferenceRunnable(runnableName, runnablePriority, runnable));
} | [
"public",
"static",
"void",
"runIntoJIT",
"(",
"final",
"String",
"runnableName",
",",
"final",
"PriorityLevel",
"runnablePriority",
",",
"final",
"Runnable",
"runnable",
")",
"{",
"runIntoJIT",
"(",
"new",
"JrbReferenceRunnable",
"(",
"runnableName",
",",
"runnable... | Run into the JRebirth Internal Thread [JIT].
Actually only few methods are allowed to execute themselves into JRebirthThread.
<ul>
<li>Uncaught Exception Handler initialization</li>
<li>Wave queuing</li>
<li>Run a default Command (neither UI nor Pooled)</li>
<li>Listen a Wave Type</li>
<li>UnListen a Wave Type</li>
</... | [
"Run",
"into",
"the",
"JRebirth",
"Internal",
"Thread",
"[",
"JIT",
"]",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/concurrent/JRebirth.java#L251-L253 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.deleteGroupMember | public void deleteGroupMember(Integer groupId, Integer userId) throws IOException {
"""
Delete a group member.
@param groupId the group id
@param userId the user id
@throws IOException on gitlab api call error
"""
String tailUrl = GitlabGroup.URL + "/" + groupId + "/" + GitlabGroupMember.URL + "/... | java | public void deleteGroupMember(Integer groupId, Integer userId) throws IOException {
String tailUrl = GitlabGroup.URL + "/" + groupId + "/" + GitlabGroupMember.URL + "/" + userId;
retrieve().method(DELETE).to(tailUrl, Void.class);
} | [
"public",
"void",
"deleteGroupMember",
"(",
"Integer",
"groupId",
",",
"Integer",
"userId",
")",
"throws",
"IOException",
"{",
"String",
"tailUrl",
"=",
"GitlabGroup",
".",
"URL",
"+",
"\"/\"",
"+",
"groupId",
"+",
"\"/\"",
"+",
"GitlabGroupMember",
".",
"URL"... | Delete a group member.
@param groupId the group id
@param userId the user id
@throws IOException on gitlab api call error | [
"Delete",
"a",
"group",
"member",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L759-L762 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java | CommercePriceEntryPersistenceImpl.findByUUID_G | @Override
public CommercePriceEntry findByUUID_G(String uuid, long groupId)
throws NoSuchPriceEntryException {
"""
Returns the commerce price entry where uuid = ? and groupId = ? or throws a {@link NoSuchPriceEntryException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
... | java | @Override
public CommercePriceEntry findByUUID_G(String uuid, long groupId)
throws NoSuchPriceEntryException {
CommercePriceEntry commercePriceEntry = fetchByUUID_G(uuid, groupId);
if (commercePriceEntry == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.ap... | [
"@",
"Override",
"public",
"CommercePriceEntry",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchPriceEntryException",
"{",
"CommercePriceEntry",
"commercePriceEntry",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
... | Returns the commerce price entry where uuid = ? and groupId = ? or throws a {@link NoSuchPriceEntryException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce price entry
@throws NoSuchPriceEntryException if a matching commerce price entry could not be fo... | [
"Returns",
"the",
"commerce",
"price",
"entry",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchPriceEntryException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java#L669-L695 |
sundrio/sundrio | codegen/src/main/java/io/sundr/codegen/processor/JavaGeneratingProcessor.java | JavaGeneratingProcessor.generateFromResources | public void generateFromResources(TypeDef model, JavaFileObject fileObject, String resourceName) throws IOException {
"""
Generates a source file from the specified {@link io.sundr.codegen.model.TypeDef}.
@param model The model of the class to generate.
@param fileObject Where to save the generated cl... | java | public void generateFromResources(TypeDef model, JavaFileObject fileObject, String resourceName) throws IOException {
if (classExists(model)) {
System.err.println("Skipping: " + model.getFullyQualifiedName()+ ". Class already exists.");
return;
}
System.err.println("Gener... | [
"public",
"void",
"generateFromResources",
"(",
"TypeDef",
"model",
",",
"JavaFileObject",
"fileObject",
",",
"String",
"resourceName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"classExists",
"(",
"model",
")",
")",
"{",
"System",
".",
"err",
".",
"printl... | Generates a source file from the specified {@link io.sundr.codegen.model.TypeDef}.
@param model The model of the class to generate.
@param fileObject Where to save the generated class.
@param resourceName The template to use.
@throws IOException If it fails to create the source file. | [
"Generates",
"a",
"source",
"file",
"from",
"the",
"specified",
"{",
"@link",
"io",
".",
"sundr",
".",
"codegen",
".",
"model",
".",
"TypeDef",
"}",
"."
] | train | https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/codegen/src/main/java/io/sundr/codegen/processor/JavaGeneratingProcessor.java#L64-L77 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/query/aggregation/AggregatorFactory.java | AggregatorFactory.getMergingFactory | public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException {
"""
Returns an AggregatorFactory that can be used to combine the output of aggregators from this factory and
another factory. It is used when we have some values produced by this aggregator factory,... | java | public AggregatorFactory getMergingFactory(AggregatorFactory other) throws AggregatorFactoryNotMergeableException
{
final AggregatorFactory combiningFactory = this.getCombiningFactory();
if (other.getName().equals(this.getName()) && combiningFactory.equals(other.getCombiningFactory())) {
return combinin... | [
"public",
"AggregatorFactory",
"getMergingFactory",
"(",
"AggregatorFactory",
"other",
")",
"throws",
"AggregatorFactoryNotMergeableException",
"{",
"final",
"AggregatorFactory",
"combiningFactory",
"=",
"this",
".",
"getCombiningFactory",
"(",
")",
";",
"if",
"(",
"other... | Returns an AggregatorFactory that can be used to combine the output of aggregators from this factory and
another factory. It is used when we have some values produced by this aggregator factory, and some values produced
by the "other" aggregator factory, and we want to do some additional combining of them. This happens... | [
"Returns",
"an",
"AggregatorFactory",
"that",
"can",
"be",
"used",
"to",
"combine",
"the",
"output",
"of",
"aggregators",
"from",
"this",
"factory",
"and",
"another",
"factory",
".",
"It",
"is",
"used",
"when",
"we",
"have",
"some",
"values",
"produced",
"by... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/query/aggregation/AggregatorFactory.java#L137-L145 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java | Validator.expectRegex | public void expectRegex(String name, Pattern pattern, String message) {
"""
Validates a field by a given regular expression pattern
It is required to pass a pre-compiled pattern, e.g.
Pattern pattern = Pattern.compile("[a-Z,0-9]")
@param pattern The pre-compiled pattern
@param name The field to check
@par... | java | public void expectRegex(String name, Pattern pattern, String message) {
String value = Optional.ofNullable(get(name)).orElse("");
if (!pattern.matcher(value).matches()) {
addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.REGEX_KEY.name(), name)));
}
} | [
"public",
"void",
"expectRegex",
"(",
"String",
"name",
",",
"Pattern",
"pattern",
",",
"String",
"message",
")",
"{",
"String",
"value",
"=",
"Optional",
".",
"ofNullable",
"(",
"get",
"(",
"name",
")",
")",
".",
"orElse",
"(",
"\"\"",
")",
";",
"if",... | Validates a field by a given regular expression pattern
It is required to pass a pre-compiled pattern, e.g.
Pattern pattern = Pattern.compile("[a-Z,0-9]")
@param pattern The pre-compiled pattern
@param name The field to check
@param message A custom error message instead of the default one | [
"Validates",
"a",
"field",
"by",
"a",
"given",
"regular",
"expression",
"pattern"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java#L391-L397 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/bean/PropertyStorageUtil.java | PropertyStorageUtil.updateCollections | public static void updateCollections(PropertyStorage storage, Transport transport) {
"""
go over all properties in the storage and set `transport` on FluentStyle instances inside collections, if any.
only process one level, without recursion - to avoid potential cycles and such.
"""
storage.getPropert... | java | public static void updateCollections(PropertyStorage storage, Transport transport) {
storage.getProperties().forEach(e -> {
if (Collection.class.isAssignableFrom(e.getKey().getType())) {
// found a collection in properties
((Collection) e.getValue()).forEach(i -> {
... | [
"public",
"static",
"void",
"updateCollections",
"(",
"PropertyStorage",
"storage",
",",
"Transport",
"transport",
")",
"{",
"storage",
".",
"getProperties",
"(",
")",
".",
"forEach",
"(",
"e",
"->",
"{",
"if",
"(",
"Collection",
".",
"class",
".",
"isAssign... | go over all properties in the storage and set `transport` on FluentStyle instances inside collections, if any.
only process one level, without recursion - to avoid potential cycles and such. | [
"go",
"over",
"all",
"properties",
"in",
"the",
"storage",
"and",
"set",
"transport",
"on",
"FluentStyle",
"instances",
"inside",
"collections",
"if",
"any",
".",
"only",
"process",
"one",
"level",
"without",
"recursion",
"-",
"to",
"avoid",
"potential",
"cycl... | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/bean/PropertyStorageUtil.java#L12-L25 |
srikalyc/Sql4D | IndexerAgent/src/main/java/com/yahoo/sql4d/indexeragent/actors/MainActor.java | MainActor.bootFromDsqls | private void bootFromDsqls(String path) {
"""
Read off a bunch of sql files expecting insert statements within them.
"""
File[] files = new File(path).listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.endsWith("... | java | private void bootFromDsqls(String path) {
File[] files = new File(path).listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.endsWith(".sql");
}
});
for (File file:files) {//In this cont... | [
"private",
"void",
"bootFromDsqls",
"(",
"String",
"path",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"new",
"File",
"(",
"path",
")",
".",
"listFiles",
"(",
"new",
"FilenameFilter",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"F... | Read off a bunch of sql files expecting insert statements within them. | [
"Read",
"off",
"a",
"bunch",
"of",
"sql",
"files",
"expecting",
"insert",
"statements",
"within",
"them",
"."
] | train | https://github.com/srikalyc/Sql4D/blob/2c052fe60ead5a16277c798a3440de7d4f6f24f6/IndexerAgent/src/main/java/com/yahoo/sql4d/indexeragent/actors/MainActor.java#L142-L153 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/ChangeObjects.java | ChangeObjects.deleteMonomerNotation | public final static void deleteMonomerNotation(int position, PolymerNotation polymer) throws NotationException {
"""
method to delete a MonomerNotation at a specific position of the
PolymerNotation
@param position
position of the to be deleted MonomerNotation
@param polymer
PolymerNotation
@throws Notation... | java | public final static void deleteMonomerNotation(int position, PolymerNotation polymer) throws NotationException {
MonomerNotation monomerNotation = polymer.getPolymerElements().getListOfElements().get(position);
if (polymer.getPolymerElements().getListOfElements().size() == 1) {
throw new NotationException(mon... | [
"public",
"final",
"static",
"void",
"deleteMonomerNotation",
"(",
"int",
"position",
",",
"PolymerNotation",
"polymer",
")",
"throws",
"NotationException",
"{",
"MonomerNotation",
"monomerNotation",
"=",
"polymer",
".",
"getPolymerElements",
"(",
")",
".",
"getListOf... | method to delete a MonomerNotation at a specific position of the
PolymerNotation
@param position
position of the to be deleted MonomerNotation
@param polymer
PolymerNotation
@throws NotationException
if the generated PolymerNotation has no elements after
deleting the MonomerNotation | [
"method",
"to",
"delete",
"a",
"MonomerNotation",
"at",
"a",
"specific",
"position",
"of",
"the",
"PolymerNotation"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/ChangeObjects.java#L307-L314 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/math/Arrangement.java | Arrangement.select | private void select(String[] resultList, int resultIndex, List<String[]> result) {
"""
排列选择
@param dataList 待选列表
@param resultList 前面(resultIndex-1)个的排列结果
@param resultIndex 选择索引,从0开始
@param result 最终结果
"""
int resultLen = resultList.length;
if (resultIndex >= resultLen) { // 全部选择完时,输出排列结果
resu... | java | private void select(String[] resultList, int resultIndex, List<String[]> result) {
int resultLen = resultList.length;
if (resultIndex >= resultLen) { // 全部选择完时,输出排列结果
result.add(Arrays.copyOf(resultList, resultList.length));
return;
}
// 递归选择下一个
for (int i = 0; i < datas.length; i++) {
// 判... | [
"private",
"void",
"select",
"(",
"String",
"[",
"]",
"resultList",
",",
"int",
"resultIndex",
",",
"List",
"<",
"String",
"[",
"]",
">",
"result",
")",
"{",
"int",
"resultLen",
"=",
"resultList",
".",
"length",
";",
"if",
"(",
"resultIndex",
">=",
"re... | 排列选择
@param dataList 待选列表
@param resultList 前面(resultIndex-1)个的排列结果
@param resultIndex 选择索引,从0开始
@param result 最终结果 | [
"排列选择"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/math/Arrangement.java#L108-L130 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getNotEmpty | @Nullable
public static CharSequence getNotEmpty (@Nullable final CharSequence s, @Nullable final CharSequence sDefaultIfEmpty) {
"""
Get the passed string but never return an empty char sequence. If the passed
parameter is <code>null</code> or empty the second parameter is returned.
@param s
The parameter ... | java | @Nullable
public static CharSequence getNotEmpty (@Nullable final CharSequence s, @Nullable final CharSequence sDefaultIfEmpty)
{
return hasNoText (s) ? sDefaultIfEmpty : s;
} | [
"@",
"Nullable",
"public",
"static",
"CharSequence",
"getNotEmpty",
"(",
"@",
"Nullable",
"final",
"CharSequence",
"s",
",",
"@",
"Nullable",
"final",
"CharSequence",
"sDefaultIfEmpty",
")",
"{",
"return",
"hasNoText",
"(",
"s",
")",
"?",
"sDefaultIfEmpty",
":",... | Get the passed string but never return an empty char sequence. If the passed
parameter is <code>null</code> or empty the second parameter is returned.
@param s
The parameter to be not <code>null</code> nor empty.
@param sDefaultIfEmpty
The value to be used of the first parameter is <code>null</code> or
empty. May be <... | [
"Get",
"the",
"passed",
"string",
"but",
"never",
"return",
"an",
"empty",
"char",
"sequence",
".",
"If",
"the",
"passed",
"parameter",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"or",
"empty",
"the",
"second",
"parameter",
"is",
"returned",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4600-L4604 |
Whiley/WhileyCompiler | src/main/java/wyil/interpreter/Interpreter.java | Interpreter.executeContinue | private Status executeContinue(Stmt.Continue stmt, CallStack frame, EnclosingScope scope) {
"""
Execute a continue statement. This transfers to control back to the start
the nearest enclosing loop.
@param stmt
--- Break statement.
@param frame
--- The current stack frame
@return
"""
return Status.CON... | java | private Status executeContinue(Stmt.Continue stmt, CallStack frame, EnclosingScope scope) {
return Status.CONTINUE;
} | [
"private",
"Status",
"executeContinue",
"(",
"Stmt",
".",
"Continue",
"stmt",
",",
"CallStack",
"frame",
",",
"EnclosingScope",
"scope",
")",
"{",
"return",
"Status",
".",
"CONTINUE",
";",
"}"
] | Execute a continue statement. This transfers to control back to the start
the nearest enclosing loop.
@param stmt
--- Break statement.
@param frame
--- The current stack frame
@return | [
"Execute",
"a",
"continue",
"statement",
".",
"This",
"transfers",
"to",
"control",
"back",
"to",
"the",
"start",
"the",
"nearest",
"enclosing",
"loop",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L298-L300 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java | TypeRegistry.associateReloadableType | @UsedByGeneratedCode
public static void associateReloadableType(ReloadableType child, Class<?> parent) {
"""
Called from the static initializer of a reloadabletype, allowing it to connect itself to the parent type, such
that when reloading occurs we can mark all relevant types in the hierarchy as being impacted ... | java | @UsedByGeneratedCode
public static void associateReloadableType(ReloadableType child, Class<?> parent) {
// TODO performance - can we make this cheaper?
ClassLoader parentClassLoader = parent.getClassLoader();
if (parentClassLoader == null) {
return;
}
TypeRegistry parentTypeRegistry = TypeRegistry.getTyp... | [
"@",
"UsedByGeneratedCode",
"public",
"static",
"void",
"associateReloadableType",
"(",
"ReloadableType",
"child",
",",
"Class",
"<",
"?",
">",
"parent",
")",
"{",
"// TODO performance - can we make this cheaper?",
"ClassLoader",
"parentClassLoader",
"=",
"parent",
".",
... | Called from the static initializer of a reloadabletype, allowing it to connect itself to the parent type, such
that when reloading occurs we can mark all relevant types in the hierarchy as being impacted by the reload.
@param child the ReloadableType actively being initialized
@param parent the superclass of the reloa... | [
"Called",
"from",
"the",
"static",
"initializer",
"of",
"a",
"reloadabletype",
"allowing",
"it",
"to",
"connect",
"itself",
"to",
"the",
"parent",
"type",
"such",
"that",
"when",
"reloading",
"occurs",
"we",
"can",
"mark",
"all",
"relevant",
"types",
"in",
"... | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java#L2302-L2314 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/FileUtil.java | FileUtil.isFileImportable | public static boolean isFileImportable(File file, String prefix) throws SQLException, FileNotFoundException {
"""
Check if the file is well formatted regarding an extension prefix.
Check also if the file doesn't exist.
@param file
@param prefix
@return
@throws SQLException
@throws java.io.FileNotFoundExcep... | java | public static boolean isFileImportable(File file, String prefix) throws SQLException, FileNotFoundException{
if (isExtensionWellFormated(file, prefix)) {
if (file.exists()) {
return true;
} else {
throw new FileNotFoundException("The following file does no... | [
"public",
"static",
"boolean",
"isFileImportable",
"(",
"File",
"file",
",",
"String",
"prefix",
")",
"throws",
"SQLException",
",",
"FileNotFoundException",
"{",
"if",
"(",
"isExtensionWellFormated",
"(",
"file",
",",
"prefix",
")",
")",
"{",
"if",
"(",
"file... | Check if the file is well formatted regarding an extension prefix.
Check also if the file doesn't exist.
@param file
@param prefix
@return
@throws SQLException
@throws java.io.FileNotFoundException | [
"Check",
"if",
"the",
"file",
"is",
"well",
"formatted",
"regarding",
"an",
"extension",
"prefix",
".",
"Check",
"also",
"if",
"the",
"file",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/FileUtil.java#L44-L54 |
apiman/apiman | common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java | AuthTokenUtil.createAuthToken | public static final AuthToken createAuthToken(String principal, Set<String> roles, int expiresInMillis) {
"""
Creates an auth token.
@param principal the auth principal
@param roles the auth roles
@param expiresInMillis the number of millis to expiry
@return the auth token
"""
AuthToken token = new... | java | public static final AuthToken createAuthToken(String principal, Set<String> roles, int expiresInMillis) {
AuthToken token = new AuthToken();
token.setIssuedOn(new Date());
token.setExpiresOn(new Date(System.currentTimeMillis() + expiresInMillis));
token.setPrincipal(principal);
t... | [
"public",
"static",
"final",
"AuthToken",
"createAuthToken",
"(",
"String",
"principal",
",",
"Set",
"<",
"String",
">",
"roles",
",",
"int",
"expiresInMillis",
")",
"{",
"AuthToken",
"token",
"=",
"new",
"AuthToken",
"(",
")",
";",
"token",
".",
"setIssuedO... | Creates an auth token.
@param principal the auth principal
@param roles the auth roles
@param expiresInMillis the number of millis to expiry
@return the auth token | [
"Creates",
"an",
"auth",
"token",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/auth/src/main/java/io/apiman/common/auth/AuthTokenUtil.java#L120-L128 |
threerings/narya | core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java | PresentsConnectionManager.postMessage | protected void postMessage (PresentsConnection conn, Message msg) {
"""
Called by a connection when it has a downstream message that needs to be delivered.
<em>Note:</em> this method is called as a result of a call to
{@link PresentsConnection#postMessage} which happens when forwarding an event to a client
and ... | java | protected void postMessage (PresentsConnection conn, Message msg)
{
if (!isRunning()) {
log.warning("Posting message to inactive connection manager",
"msg", msg, new Exception());
}
// sanity check
if (conn == null || msg == null) {
lo... | [
"protected",
"void",
"postMessage",
"(",
"PresentsConnection",
"conn",
",",
"Message",
"msg",
")",
"{",
"if",
"(",
"!",
"isRunning",
"(",
")",
")",
"{",
"log",
".",
"warning",
"(",
"\"Posting message to inactive connection manager\"",
",",
"\"msg\"",
",",
"msg",... | Called by a connection when it has a downstream message that needs to be delivered.
<em>Note:</em> this method is called as a result of a call to
{@link PresentsConnection#postMessage} which happens when forwarding an event to a client
and at the completion of authentication, both of which <em>must</em> happen only on ... | [
"Called",
"by",
"a",
"connection",
"when",
"it",
"has",
"a",
"downstream",
"message",
"that",
"needs",
"to",
"be",
"delivered",
".",
"<em",
">",
"Note",
":",
"<",
"/",
"em",
">",
"this",
"method",
"is",
"called",
"as",
"a",
"result",
"of",
"a",
"call... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java#L260-L311 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPBitOutputStream.java | JBBPBitOutputStream.writeShort | public void writeShort(final int value, final JBBPByteOrder byteOrder) throws IOException {
"""
Write a signed short value into the output stream.
@param value a value to be written. Only two bytes will be written.
@param byteOrder the byte order of the value bytes to be used for writing.
@throws IOExcept... | java | public void writeShort(final int value, final JBBPByteOrder byteOrder) throws IOException {
if (byteOrder == JBBPByteOrder.BIG_ENDIAN) {
this.write(value >>> 8);
this.write(value);
} else {
this.write(value);
this.write(value >>> 8);
}
} | [
"public",
"void",
"writeShort",
"(",
"final",
"int",
"value",
",",
"final",
"JBBPByteOrder",
"byteOrder",
")",
"throws",
"IOException",
"{",
"if",
"(",
"byteOrder",
"==",
"JBBPByteOrder",
".",
"BIG_ENDIAN",
")",
"{",
"this",
".",
"write",
"(",
"value",
">>>"... | Write a signed short value into the output stream.
@param value a value to be written. Only two bytes will be written.
@param byteOrder the byte order of the value bytes to be used for writing.
@throws IOException it will be thrown for transport errors
@see JBBPByteOrder#BIG_ENDIAN
@see JBBPByteOrder#LITTLE_ENDIAN | [
"Write",
"a",
"signed",
"short",
"value",
"into",
"the",
"output",
"stream",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPBitOutputStream.java#L92-L100 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/MediaApi.java | MediaApi.pullInteractionFromWorkbin | public ApiSuccessResponse pullInteractionFromWorkbin(String mediatype, String id, PullInteractionFromWorkbinData pullInteractionFromWorkbinData) throws ApiException {
"""
Pull an Interaction from a Workbin
@param mediatype The media channel. (required)
@param id The ID of the interaction. (required)
@param pu... | java | public ApiSuccessResponse pullInteractionFromWorkbin(String mediatype, String id, PullInteractionFromWorkbinData pullInteractionFromWorkbinData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = pullInteractionFromWorkbinWithHttpInfo(mediatype, id, pullInteractionFromWorkbinData);
return resp... | [
"public",
"ApiSuccessResponse",
"pullInteractionFromWorkbin",
"(",
"String",
"mediatype",
",",
"String",
"id",
",",
"PullInteractionFromWorkbinData",
"pullInteractionFromWorkbinData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
... | Pull an Interaction from a Workbin
@param mediatype The media channel. (required)
@param id The ID of the interaction. (required)
@param pullInteractionFromWorkbinData (optional)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Pull",
"an",
"Interaction",
"from",
"a",
"Workbin"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L3255-L3258 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_resiliationTerms_GET | public OvhResiliationTerms serviceName_resiliationTerms_GET(String serviceName, Date resiliationDate) throws IOException {
"""
Get resiliation terms
REST: GET /xdsl/{serviceName}/resiliationTerms
@param resiliationDate [required] The desired resiliation date
@param serviceName [required] The internal name of ... | java | public OvhResiliationTerms serviceName_resiliationTerms_GET(String serviceName, Date resiliationDate) throws IOException {
String qPath = "/xdsl/{serviceName}/resiliationTerms";
StringBuilder sb = path(qPath, serviceName);
query(sb, "resiliationDate", resiliationDate);
String resp = exec(qPath, "GET", sb.toStri... | [
"public",
"OvhResiliationTerms",
"serviceName_resiliationTerms_GET",
"(",
"String",
"serviceName",
",",
"Date",
"resiliationDate",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/resiliationTerms\"",
";",
"StringBuilder",
"sb",
"=",
"path",... | Get resiliation terms
REST: GET /xdsl/{serviceName}/resiliationTerms
@param resiliationDate [required] The desired resiliation date
@param serviceName [required] The internal name of your XDSL offer | [
"Get",
"resiliation",
"terms"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1858-L1864 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceListenerHelper.java | DfuServiceListenerHelper.registerLogListener | public static void registerLogListener(@NonNull final Context context, @NonNull final DfuLogListener listener) {
"""
Registers the {@link DfuLogListener}. Registered listener will receive the log events from the DFU service.
@param context the application context.
@param listener the listener to register.
... | java | public static void registerLogListener(@NonNull final Context context, @NonNull final DfuLogListener listener) {
if (mLogBroadcastReceiver == null) {
mLogBroadcastReceiver = new LogBroadcastReceiver();
final IntentFilter filter = new IntentFilter();
filter.addAction(DfuBaseService.BROADCAST_LOG);
LocalBr... | [
"public",
"static",
"void",
"registerLogListener",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"NonNull",
"final",
"DfuLogListener",
"listener",
")",
"{",
"if",
"(",
"mLogBroadcastReceiver",
"==",
"null",
")",
"{",
"mLogBroadcastReceiver",
"=",
... | Registers the {@link DfuLogListener}. Registered listener will receive the log events from the DFU service.
@param context the application context.
@param listener the listener to register. | [
"Registers",
"the",
"{",
"@link",
"DfuLogListener",
"}",
".",
"Registered",
"listener",
"will",
"receive",
"the",
"log",
"events",
"from",
"the",
"DFU",
"service",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceListenerHelper.java#L341-L350 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java | DefaultAnnotationMetadata.addRepeatableStereotype | protected void addRepeatableStereotype(List<String> parents, String stereotype, io.micronaut.core.annotation.AnnotationValue annotationValue) {
"""
Adds a repeatable stereotype value. If a value already exists will be added
@param parents The parent annotations
@param stereotype The annotation name
@param ann... | java | protected void addRepeatableStereotype(List<String> parents, String stereotype, io.micronaut.core.annotation.AnnotationValue annotationValue) {
Map<String, Map<CharSequence, Object>> allStereotypes = getAllStereotypes();
List<String> annotationList = getAnnotationsByStereotypeInternal(stereotype);
... | [
"protected",
"void",
"addRepeatableStereotype",
"(",
"List",
"<",
"String",
">",
"parents",
",",
"String",
"stereotype",
",",
"io",
".",
"micronaut",
".",
"core",
".",
"annotation",
".",
"AnnotationValue",
"annotationValue",
")",
"{",
"Map",
"<",
"String",
","... | Adds a repeatable stereotype value. If a value already exists will be added
@param parents The parent annotations
@param stereotype The annotation name
@param annotationValue The annotation value | [
"Adds",
"a",
"repeatable",
"stereotype",
"value",
".",
"If",
"a",
"value",
"already",
"exists",
"will",
"be",
"added"
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java#L565-L575 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newUpdateOpenGraphObjectRequest | public static Request newUpdateOpenGraphObjectRequest(Session session, OpenGraphObject openGraphObject,
Callback callback) {
"""
Creates a new Request configured to update a user owned Open Graph object.
@param session
the Session to use, or null; if non-null, the session must be in an opened state... | java | public static Request newUpdateOpenGraphObjectRequest(Session session, OpenGraphObject openGraphObject,
Callback callback) {
if (openGraphObject == null) {
throw new FacebookException("openGraphObject cannot be null");
}
String path = openGraphObject.getId();
if ... | [
"public",
"static",
"Request",
"newUpdateOpenGraphObjectRequest",
"(",
"Session",
"session",
",",
"OpenGraphObject",
"openGraphObject",
",",
"Callback",
"callback",
")",
"{",
"if",
"(",
"openGraphObject",
"==",
"null",
")",
"{",
"throw",
"new",
"FacebookException",
... | Creates a new Request configured to update a user owned Open Graph object.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param openGraphObject
the Open Graph object to update, which must have a valid 'id' property
@param callback
a callback that will be called when th... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"update",
"a",
"user",
"owned",
"Open",
"Graph",
"object",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L781-L795 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.enableAsync | public Observable<Void> enableAsync(String resourceGroupName, String workflowName) {
"""
Enables a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} o... | java | public Observable<Void> enableAsync(String resourceGroupName, String workflowName) {
return enableWithServiceResponseAsync(resourceGroupName, workflowName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return r... | [
"public",
"Observable",
"<",
"Void",
">",
"enableAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
")",
"{",
"return",
"enableWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workflowName",
")",
".",
"map",
"(",
"new",
"Func1",
"... | Enables a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Enables",
"a",
"workflow",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L1077-L1084 |
spacecowboy/NoNonsense-FilePicker | sample/src/main/java/com/nononsenseapps/filepicker/sample/multimedia/MultimediaPickerFragment.java | MultimediaPickerFragment.onBindViewHolder | @Override
public void onBindViewHolder(@NonNull DirViewHolder vh, int position, @NonNull File file) {
"""
Overriding this method allows us to inject a preview image
in the layout
@param vh to bind data from either a file or directory
@param position 0 - n, where the header has been subtracted
@para... | java | @Override
public void onBindViewHolder(@NonNull DirViewHolder vh, int position, @NonNull File file) {
// Let the super method do its thing with checkboxes and text
super.onBindViewHolder(vh, position, file);
// Here we load the preview image if it is an image file
final int viewType... | [
"@",
"Override",
"public",
"void",
"onBindViewHolder",
"(",
"@",
"NonNull",
"DirViewHolder",
"vh",
",",
"int",
"position",
",",
"@",
"NonNull",
"File",
"file",
")",
"{",
"// Let the super method do its thing with checkboxes and text",
"super",
".",
"onBindViewHolder",
... | Overriding this method allows us to inject a preview image
in the layout
@param vh to bind data from either a file or directory
@param position 0 - n, where the header has been subtracted
@param file to show info about | [
"Overriding",
"this",
"method",
"allows",
"us",
"to",
"inject",
"a",
"preview",
"image",
"in",
"the",
"layout"
] | train | https://github.com/spacecowboy/NoNonsense-FilePicker/blob/396ef7fa5e87791170791f9d94c78f6e42a7679a/sample/src/main/java/com/nononsenseapps/filepicker/sample/multimedia/MultimediaPickerFragment.java#L122-L135 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java | BuildStepsInner.beginUpdate | public BuildStepInner beginUpdate(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepUpdateParameters buildStepUpdateParameters) {
"""
Updates a build step in a build task.
@param resourceGroupName The name of the resource group to which the container registry belongs... | java | public BuildStepInner beginUpdate(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepUpdateParameters buildStepUpdateParameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, buildStepUpdateParameters).toBlockin... | [
"public",
"BuildStepInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"buildTaskName",
",",
"String",
"stepName",
",",
"BuildStepUpdateParameters",
"buildStepUpdateParameters",
")",
"{",
"return",
"beginUpdateWithServic... | Updates a build step in a build task.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildTaskName The name of the container registry build task.
@param stepName The name of a build step for a container reg... | [
"Updates",
"a",
"build",
"step",
"in",
"a",
"build",
"task",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java#L992-L994 |
recommenders/rival | rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/MultipleStrategyRunnerInfile.java | MultipleStrategyRunnerInfile.generateOutput | public static void generateOutput(final DataModelIF<Long, Long> testModel, final File userRecommendationFile,
final EvaluationStrategy<Long, Long> strategy, final EvaluationStrategy.OUTPUT_FORMAT format,
final File rankingFolder, final File groundtruthFolder, final String inputFileName,
... | java | public static void generateOutput(final DataModelIF<Long, Long> testModel, final File userRecommendationFile,
final EvaluationStrategy<Long, Long> strategy, final EvaluationStrategy.OUTPUT_FORMAT format,
final File rankingFolder, final File groundtruthFolder, final String inputFileName,
... | [
"public",
"static",
"void",
"generateOutput",
"(",
"final",
"DataModelIF",
"<",
"Long",
",",
"Long",
">",
"testModel",
",",
"final",
"File",
"userRecommendationFile",
",",
"final",
"EvaluationStrategy",
"<",
"Long",
",",
"Long",
">",
"strategy",
",",
"final",
... | Runs multiple strategies on some data and outputs the result into a file.
@param testModel The test datamodel.
@param userRecommendationFile The file that contains the recommendations
for users.
@param strategy The strategy to use.
@param format The format of the printer
@param rankingFolder Where to write output.
@pa... | [
"Runs",
"multiple",
"strategies",
"on",
"some",
"data",
"and",
"outputs",
"the",
"result",
"into",
"a",
"file",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/MultipleStrategyRunnerInfile.java#L219-L227 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java | RandomMatrices_DSCC.rectangle | public static DMatrixSparseCSC rectangle(int numRows , int numCols , int nz_total ,
double min , double max , Random rand ) {
"""
Randomly generates matrix with the specified number of non-zero elements filled with values from min to max.
@param numRows Number of row... | java | public static DMatrixSparseCSC rectangle(int numRows , int numCols , int nz_total ,
double min , double max , Random rand ) {
nz_total = Math.min(numCols*numRows,nz_total);
int[] selected = UtilEjml.shuffled(numRows*numCols, nz_total, rand);
Arrays.s... | [
"public",
"static",
"DMatrixSparseCSC",
"rectangle",
"(",
"int",
"numRows",
",",
"int",
"numCols",
",",
"int",
"nz_total",
",",
"double",
"min",
",",
"double",
"max",
",",
"Random",
"rand",
")",
"{",
"nz_total",
"=",
"Math",
".",
"min",
"(",
"numCols",
"... | Randomly generates matrix with the specified number of non-zero elements filled with values from min to max.
@param numRows Number of rows
@param numCols Number of columns
@param nz_total Total number of non-zero elements in the matrix
@param min Minimum element value, inclusive
@param max Maximum element value, inclu... | [
"Randomly",
"generates",
"matrix",
"with",
"the",
"specified",
"number",
"of",
"non",
"-",
"zero",
"elements",
"filled",
"with",
"values",
"from",
"min",
"to",
"max",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java#L46-L73 |
Netflix/spectator | spectator-ext-sandbox/src/main/java/com/netflix/spectator/sandbox/BucketCounter.java | BucketCounter.get | public static BucketCounter get(Id id, BucketFunction f) {
"""
Creates a distribution summary object that manages a set of counters based on the bucket
function supplied. Calling record will increment the appropriate counter.
@param id
Identifier for the metric being registered.
@param f
Function to map val... | java | public static BucketCounter get(Id id, BucketFunction f) {
return get(Spectator.globalRegistry(), id, f);
} | [
"public",
"static",
"BucketCounter",
"get",
"(",
"Id",
"id",
",",
"BucketFunction",
"f",
")",
"{",
"return",
"get",
"(",
"Spectator",
".",
"globalRegistry",
"(",
")",
",",
"id",
",",
"f",
")",
";",
"}"
] | Creates a distribution summary object that manages a set of counters based on the bucket
function supplied. Calling record will increment the appropriate counter.
@param id
Identifier for the metric being registered.
@param f
Function to map values to buckets.
@return
Distribution summary that manages sub-counters bas... | [
"Creates",
"a",
"distribution",
"summary",
"object",
"that",
"manages",
"a",
"set",
"of",
"counters",
"based",
"on",
"the",
"bucket",
"function",
"supplied",
".",
"Calling",
"record",
"will",
"increment",
"the",
"appropriate",
"counter",
"."
] | train | https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-ext-sandbox/src/main/java/com/netflix/spectator/sandbox/BucketCounter.java#L44-L46 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemDataset.java | FileSystemDataset.getDirectory | private static Path getDirectory(FileSystem fs, Path path) {
"""
Returns the closest directory for the given {@code path}.
@param fs a {@link FileSystem} to search
@param path a {@link Path} to resolve
@return the closest directory to {@link Path}
"""
try {
if (!fs.exists(path) || fs.isDirectory... | java | private static Path getDirectory(FileSystem fs, Path path) {
try {
if (!fs.exists(path) || fs.isDirectory(path)) {
return path;
} else {
return path.getParent();
}
} catch (IOException e) {
throw new DatasetIOException("Cannot access path: " + path, e);
}
} | [
"private",
"static",
"Path",
"getDirectory",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"fs",
".",
"exists",
"(",
"path",
")",
"||",
"fs",
".",
"isDirectory",
"(",
"path",
")",
")",
"{",
"return",
"path",
";... | Returns the closest directory for the given {@code path}.
@param fs a {@link FileSystem} to search
@param path a {@link Path} to resolve
@return the closest directory to {@link Path} | [
"Returns",
"the",
"closest",
"directory",
"for",
"the",
"given",
"{",
"@code",
"path",
"}",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemDataset.java#L714-L725 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.importKeyAsync | public Observable<KeyBundle> importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map<String, String> tags) {
"""
Imports an externally created key, stores it, and returns key parameters and attributes to the client.
The import key operation may be used to ... | java | public Observable<KeyBundle> importKeyAsync(String vaultBaseUrl, String keyName, JsonWebKey key, Boolean hsm, KeyAttributes keyAttributes, Map<String, String> tags) {
return importKeyWithServiceResponseAsync(vaultBaseUrl, keyName, key, hsm, keyAttributes, tags).map(new Func1<ServiceResponse<KeyBundle>, KeyBundl... | [
"public",
"Observable",
"<",
"KeyBundle",
">",
"importKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"JsonWebKey",
"key",
",",
"Boolean",
"hsm",
",",
"KeyAttributes",
"keyAttributes",
",",
"Map",
"<",
"String",
",",
"String",
">",
"ta... | Imports an externally created key, stores it, and returns key parameters and attributes to the client.
The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permissio... | [
"Imports",
"an",
"externally",
"created",
"key",
"stores",
"it",
"and",
"returns",
"key",
"parameters",
"and",
"attributes",
"to",
"the",
"client",
".",
"The",
"import",
"key",
"operation",
"may",
"be",
"used",
"to",
"import",
"any",
"key",
"type",
"into",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L1011-L1018 |
czyzby/gdx-lml | kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/scene2d/Actors.java | Actors.updateActorPosition | public static void updateActorPosition(final Actor actor, final Vector2 newScreenSizeInStageCoords) {
"""
When called BEFORE resizing the stage, moves the actor to match the same aspect ratio as before. Useful for
windows and dialogs in screen viewports.
@param actor will be repositioned. Can be null, method i... | java | public static void updateActorPosition(final Actor actor, final Vector2 newScreenSizeInStageCoords) {
if (actor != null) {
updateActorPosition(actor, actor.getStage(), newScreenSizeInStageCoords);
}
} | [
"public",
"static",
"void",
"updateActorPosition",
"(",
"final",
"Actor",
"actor",
",",
"final",
"Vector2",
"newScreenSizeInStageCoords",
")",
"{",
"if",
"(",
"actor",
"!=",
"null",
")",
"{",
"updateActorPosition",
"(",
"actor",
",",
"actor",
".",
"getStage",
... | When called BEFORE resizing the stage, moves the actor to match the same aspect ratio as before. Useful for
windows and dialogs in screen viewports.
@param actor will be repositioned. Can be null, method invocation will be ignored.
@param newScreenSizeInStageCoords screen coords processed by stage. | [
"When",
"called",
"BEFORE",
"resizing",
"the",
"stage",
"moves",
"the",
"actor",
"to",
"match",
"the",
"same",
"aspect",
"ratio",
"as",
"before",
".",
"Useful",
"for",
"windows",
"and",
"dialogs",
"in",
"screen",
"viewports",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/scene2d/Actors.java#L72-L76 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java | ResourceBundlesHandlerImpl.storeJawrBundleMapping | private void storeJawrBundleMapping(boolean mappingFileExists, boolean force) {
"""
Stores the Jawr bundle mapping
@param mappingFileExists
the flag indicating if the mapping file exists
@param force
force the storage of Jawr bundle mapping
"""
if (config.getUseBundleMapping() && (!mappingFileExists ||... | java | private void storeJawrBundleMapping(boolean mappingFileExists, boolean force) {
if (config.getUseBundleMapping() && (!mappingFileExists || force)) {
bundleMapping.setProperty(JawrConstant.JAWR_CONFIG_HASHCODE, getJawrConfigHashcode());
resourceBundleHandler.storeJawrBundleMapping(bundleMapping);
if (resourc... | [
"private",
"void",
"storeJawrBundleMapping",
"(",
"boolean",
"mappingFileExists",
",",
"boolean",
"force",
")",
"{",
"if",
"(",
"config",
".",
"getUseBundleMapping",
"(",
")",
"&&",
"(",
"!",
"mappingFileExists",
"||",
"force",
")",
")",
"{",
"bundleMapping",
... | Stores the Jawr bundle mapping
@param mappingFileExists
the flag indicating if the mapping file exists
@param force
force the storage of Jawr bundle mapping | [
"Stores",
"the",
"Jawr",
"bundle",
"mapping"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ResourceBundlesHandlerImpl.java#L947-L981 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPP12Reader.java | MPP12Reader.processAssignmentData | private void processAssignmentData() throws IOException {
"""
This method extracts and collates resource assignment data.
@throws IOException
"""
FieldMap fieldMap = new FieldMap12(m_file.getProjectProperties(), m_file.getCustomFields());
fieldMap.createAssignmentFieldMap(m_projectProps);
... | java | private void processAssignmentData() throws IOException
{
FieldMap fieldMap = new FieldMap12(m_file.getProjectProperties(), m_file.getCustomFields());
fieldMap.createAssignmentFieldMap(m_projectProps);
FieldMap enterpriseCustomFieldMap = new FieldMap12(m_file.getProjectProperties(), m_file.getCust... | [
"private",
"void",
"processAssignmentData",
"(",
")",
"throws",
"IOException",
"{",
"FieldMap",
"fieldMap",
"=",
"new",
"FieldMap12",
"(",
"m_file",
".",
"getProjectProperties",
"(",
")",
",",
"m_file",
".",
"getCustomFields",
"(",
")",
")",
";",
"fieldMap",
"... | This method extracts and collates resource assignment data.
@throws IOException | [
"This",
"method",
"extracts",
"and",
"collates",
"resource",
"assignment",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP12Reader.java#L1862-L1880 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/document/json/JsonObject.java | JsonObject.getAndDecrypt | public Object getAndDecrypt(final String name, String providerName) throws Exception {
"""
Retrieve and decrypt content and not casting its type
Note: Use of the Field Level Encryption functionality provided in the
com.couchbase.client.encryption namespace provided by Couchbase is
subject to the Couchbase Inc... | java | public Object getAndDecrypt(final String name, String providerName) throws Exception {
return decrypt((JsonObject) content.get(ENCRYPTION_PREFIX + name), providerName);
} | [
"public",
"Object",
"getAndDecrypt",
"(",
"final",
"String",
"name",
",",
"String",
"providerName",
")",
"throws",
"Exception",
"{",
"return",
"decrypt",
"(",
"(",
"JsonObject",
")",
"content",
".",
"get",
"(",
"ENCRYPTION_PREFIX",
"+",
"name",
")",
",",
"pr... | Retrieve and decrypt content and not casting its type
Note: Use of the Field Level Encryption functionality provided in the
com.couchbase.client.encryption namespace provided by Couchbase is
subject to the Couchbase Inc. Enterprise Subscription License Agreement
at https://www.couchbase.com/ESLA-11132015.
@param name... | [
"Retrieve",
"and",
"decrypt",
"content",
"and",
"not",
"casting",
"its",
"type"
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/document/json/JsonObject.java#L323-L325 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.expectPrivate | public static synchronized <T> IExpectationSetters<T> expectPrivate(Object instance, Method method,
Object... arguments) throws Exception {
"""
Used to specify expectations on private methods. If possible use variant
with only method name.
... | java | public static synchronized <T> IExpectationSetters<T> expectPrivate(Object instance, Method method,
Object... arguments) throws Exception {
return doExpectPrivate(instance, method, arguments);
} | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"IExpectationSetters",
"<",
"T",
">",
"expectPrivate",
"(",
"Object",
"instance",
",",
"Method",
"method",
",",
"Object",
"...",
"arguments",
")",
"throws",
"Exception",
"{",
"return",
"doExpectPrivate",
"(",
... | Used to specify expectations on private methods. If possible use variant
with only method name. | [
"Used",
"to",
"specify",
"expectations",
"on",
"private",
"methods",
".",
"If",
"possible",
"use",
"variant",
"with",
"only",
"method",
"name",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1149-L1152 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.partialUpdateObjectNoCreate | public JSONObject partialUpdateObjectNoCreate(JSONObject partialObject, String objectID) throws AlgoliaException {
"""
Update partially an object (only update attributes passed in argument), do nothing if object does not exist
@param partialObject the object to override
"""
return partialUpdateObject(pa... | java | public JSONObject partialUpdateObjectNoCreate(JSONObject partialObject, String objectID) throws AlgoliaException {
return partialUpdateObject(partialObject, objectID, false, RequestOptions.empty);
} | [
"public",
"JSONObject",
"partialUpdateObjectNoCreate",
"(",
"JSONObject",
"partialObject",
",",
"String",
"objectID",
")",
"throws",
"AlgoliaException",
"{",
"return",
"partialUpdateObject",
"(",
"partialObject",
",",
"objectID",
",",
"false",
",",
"RequestOptions",
"."... | Update partially an object (only update attributes passed in argument), do nothing if object does not exist
@param partialObject the object to override | [
"Update",
"partially",
"an",
"object",
"(",
"only",
"update",
"attributes",
"passed",
"in",
"argument",
")",
"do",
"nothing",
"if",
"object",
"does",
"not",
"exist"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L375-L377 |
aws/aws-sdk-java | aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/UpdateProvisioningArtifactResult.java | UpdateProvisioningArtifactResult.withInfo | public UpdateProvisioningArtifactResult withInfo(java.util.Map<String, String> info) {
"""
<p>
The URL of the CloudFormation template in Amazon S3.
</p>
@param info
The URL of the CloudFormation template in Amazon S3.
@return Returns a reference to this object so that method calls can be chained together.
... | java | public UpdateProvisioningArtifactResult withInfo(java.util.Map<String, String> info) {
setInfo(info);
return this;
} | [
"public",
"UpdateProvisioningArtifactResult",
"withInfo",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"info",
")",
"{",
"setInfo",
"(",
"info",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The URL of the CloudFormation template in Amazon S3.
</p>
@param info
The URL of the CloudFormation template in Amazon S3.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"URL",
"of",
"the",
"CloudFormation",
"template",
"in",
"Amazon",
"S3",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/UpdateProvisioningArtifactResult.java#L120-L123 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java | PackedSetsPoint2D_I32.writeOverSet | public void writeOverSet(int which, List<Point2D_I32> points) {
"""
Overwrites the points in the set with the list of points.
@param points Points which are to be written into the set. Must be the same size as the set.
"""
BlockIndexLength set = sets.get(which);
if( set.length != points.size() )
thro... | java | public void writeOverSet(int which, List<Point2D_I32> points) {
BlockIndexLength set = sets.get(which);
if( set.length != points.size() )
throw new IllegalArgumentException("points and set don't have the same length");
for (int i = 0; i < set.length; i++) {
int index = set.start + i*2;
int blockIndex = ... | [
"public",
"void",
"writeOverSet",
"(",
"int",
"which",
",",
"List",
"<",
"Point2D_I32",
">",
"points",
")",
"{",
"BlockIndexLength",
"set",
"=",
"sets",
".",
"get",
"(",
"which",
")",
";",
"if",
"(",
"set",
".",
"length",
"!=",
"points",
".",
"size",
... | Overwrites the points in the set with the list of points.
@param points Points which are to be written into the set. Must be the same size as the set. | [
"Overwrites",
"the",
"points",
"in",
"the",
"set",
"with",
"the",
"list",
"of",
"points",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java#L199-L214 |
jingwei/krati | krati-main/src/main/java/krati/core/array/entry/EntryValueInt.java | EntryValueInt.updateArrayFile | @Override
public void updateArrayFile(DataWriter writer, long position) throws IOException {
"""
Writes this EntryValue at a given position of a data writer.
@param writer
@param position
@throws IOException
"""
writer.writeInt(position, val);
} | java | @Override
public void updateArrayFile(DataWriter writer, long position) throws IOException {
writer.writeInt(position, val);
} | [
"@",
"Override",
"public",
"void",
"updateArrayFile",
"(",
"DataWriter",
"writer",
",",
"long",
"position",
")",
"throws",
"IOException",
"{",
"writer",
".",
"writeInt",
"(",
"position",
",",
"val",
")",
";",
"}"
] | Writes this EntryValue at a given position of a data writer.
@param writer
@param position
@throws IOException | [
"Writes",
"this",
"EntryValue",
"at",
"a",
"given",
"position",
"of",
"a",
"data",
"writer",
"."
] | train | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/array/entry/EntryValueInt.java#L94-L97 |
jamesagnew/hapi-fhir | hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BaseDateTimeType.java | BaseDateTimeType.setValue | public void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws DataFormatException {
"""
Sets the value for this type using the given Java Date object as the time, and using the specified precision, as
well as the local timezone as determined by the local operating system. Both of
these propertie... | java | public void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws DataFormatException {
if (getTimeZone() == null) {
setTimeZone(TimeZone.getDefault());
}
myPrecision = thePrecision;
myFractionalSeconds = "";
if (theValue != null) {
long millis = theValue.getTime() % 1000;
if (millis < 0... | [
"public",
"void",
"setValue",
"(",
"Date",
"theValue",
",",
"TemporalPrecisionEnum",
"thePrecision",
")",
"throws",
"DataFormatException",
"{",
"if",
"(",
"getTimeZone",
"(",
")",
"==",
"null",
")",
"{",
"setTimeZone",
"(",
"TimeZone",
".",
"getDefault",
"(",
... | Sets the value for this type using the given Java Date object as the time, and using the specified precision, as
well as the local timezone as determined by the local operating system. Both of
these properties may be modified in subsequent calls if neccesary.
@param theValue
The date value
@param thePrecision
The prec... | [
"Sets",
"the",
"value",
"for",
"this",
"type",
"using",
"the",
"given",
"Java",
"Date",
"object",
"as",
"the",
"time",
"and",
"using",
"the",
"specified",
"precision",
"as",
"well",
"as",
"the",
"local",
"timezone",
"as",
"determined",
"by",
"the",
"local"... | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/BaseDateTimeType.java#L660-L676 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.copyAccessControlEntries | public void copyAccessControlEntries(
CmsDbContext dbc,
CmsResource source,
CmsResource destination,
boolean updateLastModifiedInfo)
throws CmsException {
"""
Copies the access control entries of a given resource to a destination resource.<p>
Already existing access control e... | java | public void copyAccessControlEntries(
CmsDbContext dbc,
CmsResource source,
CmsResource destination,
boolean updateLastModifiedInfo)
throws CmsException {
// get the entries to copy
ListIterator<CmsAccessControlEntry> aceList = getUserDriver(
dbc).readAcc... | [
"public",
"void",
"copyAccessControlEntries",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"source",
",",
"CmsResource",
"destination",
",",
"boolean",
"updateLastModifiedInfo",
")",
"throws",
"CmsException",
"{",
"// get the entries to copy",
"ListIterator",
"<",
"Cms... | Copies the access control entries of a given resource to a destination resource.<p>
Already existing access control entries of the destination resource are removed.<p>
@param dbc the current database context
@param source the resource to copy the access control entries from
@param destination the resource to which th... | [
"Copies",
"the",
"access",
"control",
"entries",
"of",
"a",
"given",
"resource",
"to",
"a",
"destination",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L1027-L1077 |
google/closure-templates | java/src/com/google/template/soy/jssrc/restricted/JsExprUtils.java | JsExprUtils.wrapWithFunction | @VisibleForTesting
static JsExpr wrapWithFunction(String functionExprText, JsExpr jsExpr) {
"""
Wraps an expression in a function call.
@param functionExprText expression for the function to invoke, such as a function name or
constructor phrase (such as "new SomeClass").
@param jsExpr the expression to comp... | java | @VisibleForTesting
static JsExpr wrapWithFunction(String functionExprText, JsExpr jsExpr) {
Preconditions.checkNotNull(functionExprText);
return new JsExpr(functionExprText + "(" + jsExpr.getText() + ")", Integer.MAX_VALUE);
} | [
"@",
"VisibleForTesting",
"static",
"JsExpr",
"wrapWithFunction",
"(",
"String",
"functionExprText",
",",
"JsExpr",
"jsExpr",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"functionExprText",
")",
";",
"return",
"new",
"JsExpr",
"(",
"functionExprText",
"+",
... | Wraps an expression in a function call.
@param functionExprText expression for the function to invoke, such as a function name or
constructor phrase (such as "new SomeClass").
@param jsExpr the expression to compute the argument to the function
@return a JS expression consisting of a call to the specified function, ap... | [
"Wraps",
"an",
"expression",
"in",
"a",
"function",
"call",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/restricted/JsExprUtils.java#L135-L139 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java | SeleniumHelper.getElementToCheckVisibility | public T getElementToCheckVisibility(String place) {
"""
Finds element to determine whether it is on screen, by searching in multiple locations.
@param place identifier for element.
@return first interactable element found,
first element found if no interactable element could be found,
null if none could be fo... | java | public T getElementToCheckVisibility(String place) {
return findByTechnicalSelectorOr(place, () -> {
T result = findElement(TextBy.partial(place));
if (!IsDisplayedFilter.mayPass(result)) {
result = findElement(ToClickBy.heuristic(place));
}
return... | [
"public",
"T",
"getElementToCheckVisibility",
"(",
"String",
"place",
")",
"{",
"return",
"findByTechnicalSelectorOr",
"(",
"place",
",",
"(",
")",
"->",
"{",
"T",
"result",
"=",
"findElement",
"(",
"TextBy",
".",
"partial",
"(",
"place",
")",
")",
";",
"i... | Finds element to determine whether it is on screen, by searching in multiple locations.
@param place identifier for element.
@return first interactable element found,
first element found if no interactable element could be found,
null if none could be found. | [
"Finds",
"element",
"to",
"determine",
"whether",
"it",
"is",
"on",
"screen",
"by",
"searching",
"in",
"multiple",
"locations",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java#L175-L183 |
alkacon/opencms-core | src/org/opencms/ade/galleries/CmsGalleryService.java | CmsGalleryService.internalCreateSitemapEntryBean | CmsSitemapEntryBean internalCreateSitemapEntryBean(CmsObject cms, CmsResource resource) throws CmsException {
"""
Creates the sitemap entry bean for a resource.<p>
@param cms the current CMS context
@param resource the resource for which the sitemap entry bean should be created
@return the created sitemap e... | java | CmsSitemapEntryBean internalCreateSitemapEntryBean(CmsObject cms, CmsResource resource) throws CmsException {
cms = OpenCms.initCmsObject(cms);
cms.getRequestContext().setSiteRoot("");
CmsJspNavBuilder navBuilder = new CmsJspNavBuilder(cms);
CmsJspNavElement entry = navBuilder.getNaviga... | [
"CmsSitemapEntryBean",
"internalCreateSitemapEntryBean",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"cms",
"=",
"OpenCms",
".",
"initCmsObject",
"(",
"cms",
")",
";",
"cms",
".",
"getRequestContext",
"(",
")",
".",... | Creates the sitemap entry bean for a resource.<p>
@param cms the current CMS context
@param resource the resource for which the sitemap entry bean should be created
@return the created sitemap entry bean
@throws CmsException if something goes wrong | [
"Creates",
"the",
"sitemap",
"entry",
"bean",
"for",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/galleries/CmsGalleryService.java#L1508-L1519 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosGeoApi.java | PhotosGeoApi.correctLocation | public Response correctLocation(String photoId, String placeId, String woeId, String foursquareId) throws JinxException {
"""
This method requires authentication with 'write' permission.
@param photoId (Required) The ID of the photo whose WOE location is being corrected.
@param placeId A Flickr Place... | java | public Response correctLocation(String photoId, String placeId, String woeId, String foursquareId) throws JinxException {
JinxUtils.validateParams(photoId);
if (JinxUtils.isNullOrEmpty(placeId)) {
JinxUtils.validateParams(woeId);
}
Map<String, String> params = new TreeMap<>();
params.put("meth... | [
"public",
"Response",
"correctLocation",
"(",
"String",
"photoId",
",",
"String",
"placeId",
",",
"String",
"woeId",
",",
"String",
"foursquareId",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photoId",
")",
";",
"if",
"(",
"J... | This method requires authentication with 'write' permission.
@param photoId (Required) The ID of the photo whose WOE location is being corrected.
@param placeId A Flickr Places ID. (While optional, you must pass either a valid Places ID or a WOE ID.)
@param woeId A Where On Earth (WOE) ID. (While opti... | [
"This",
"method",
"requires",
"authentication",
"with",
"write",
"permission",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosGeoApi.java#L94-L112 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/TaskContext.java | TaskContext.getDataWriterBuilder | public DataWriterBuilder getDataWriterBuilder(int branches, int index) {
"""
Get a {@link DataWriterBuilder} for building a {@link org.apache.gobblin.writer.DataWriter}.
@param branches number of forked branches
@param index branch index
@return a {@link DataWriterBuilder}
"""
String writerBuilderProp... | java | public DataWriterBuilder getDataWriterBuilder(int branches, int index) {
String writerBuilderPropertyName = ForkOperatorUtils
.getPropertyNameForBranch(ConfigurationKeys.WRITER_BUILDER_CLASS, branches, index);
log.debug("Using property {} to get a writer builder for branches:{}, index:{}", writerBuilder... | [
"public",
"DataWriterBuilder",
"getDataWriterBuilder",
"(",
"int",
"branches",
",",
"int",
"index",
")",
"{",
"String",
"writerBuilderPropertyName",
"=",
"ForkOperatorUtils",
".",
"getPropertyNameForBranch",
"(",
"ConfigurationKeys",
".",
"WRITER_BUILDER_CLASS",
",",
"bra... | Get a {@link DataWriterBuilder} for building a {@link org.apache.gobblin.writer.DataWriter}.
@param branches number of forked branches
@param index branch index
@return a {@link DataWriterBuilder} | [
"Get",
"a",
"{",
"@link",
"DataWriterBuilder",
"}",
"for",
"building",
"a",
"{",
"@link",
"org",
".",
"apache",
".",
"gobblin",
".",
"writer",
".",
"DataWriter",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/TaskContext.java#L364-L386 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/AccountsImpl.java | AccountsImpl.listNodeAgentSkusAsync | public ServiceFuture<List<NodeAgentSku>> listNodeAgentSkusAsync(final AccountListNodeAgentSkusOptions accountListNodeAgentSkusOptions, final ListOperationCallback<NodeAgentSku> serviceCallback) {
"""
Lists all node agent SKUs supported by the Azure Batch service.
@param accountListNodeAgentSkusOptions Additiona... | java | public ServiceFuture<List<NodeAgentSku>> listNodeAgentSkusAsync(final AccountListNodeAgentSkusOptions accountListNodeAgentSkusOptions, final ListOperationCallback<NodeAgentSku> serviceCallback) {
return AzureServiceFuture.fromHeaderPageResponse(
listNodeAgentSkusSinglePageAsync(accountListNodeAgentS... | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"NodeAgentSku",
">",
">",
"listNodeAgentSkusAsync",
"(",
"final",
"AccountListNodeAgentSkusOptions",
"accountListNodeAgentSkusOptions",
",",
"final",
"ListOperationCallback",
"<",
"NodeAgentSku",
">",
"serviceCallback",
")",
"{",... | Lists all node agent SKUs supported by the Azure Batch service.
@param accountListNodeAgentSkusOptions Additional parameters for the operation
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalArgumentException thrown if parameters fail the validation
@return th... | [
"Lists",
"all",
"node",
"agent",
"SKUs",
"supported",
"by",
"the",
"Azure",
"Batch",
"service",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/AccountsImpl.java#L233-L250 |
jbundle/jbundle | thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/TableProxy.java | TableProxy.setRemoteProperty | public void setRemoteProperty(String strProperty, String strValue) throws RemoteException {
"""
Set a table property.
@param strProperty The key to set.
@param strValue The value to set it to.
"""
BaseTransport transport = this.createProxyTransport(SET_REMOTE_PROPERTY);
transport.addParam(KEY... | java | public void setRemoteProperty(String strProperty, String strValue) throws RemoteException
{
BaseTransport transport = this.createProxyTransport(SET_REMOTE_PROPERTY);
transport.addParam(KEY, strProperty);
transport.addParam(VALUE, strValue);
Object strReturn = transport.sendMessageAnd... | [
"public",
"void",
"setRemoteProperty",
"(",
"String",
"strProperty",
",",
"String",
"strValue",
")",
"throws",
"RemoteException",
"{",
"BaseTransport",
"transport",
"=",
"this",
".",
"createProxyTransport",
"(",
"SET_REMOTE_PROPERTY",
")",
";",
"transport",
".",
"ad... | Set a table property.
@param strProperty The key to set.
@param strValue The value to set it to. | [
"Set",
"a",
"table",
"property",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/TableProxy.java#L240-L248 |
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/config/ExtractorConfig.java | ExtractorConfig.getValue | public <W> W getValue(Class<W> clazz, String key) {
"""
Returns the cell value casted to the specified class.
@param clazz the expected class
@param key the key
@return the cell value casted to the specified class
"""
if (values.get(key) == null) {
return null;
} else {
... | java | public <W> W getValue(Class<W> clazz, String key) {
if (values.get(key) == null) {
return null;
} else {
try {
return (W) values.get(key);
} catch (ClassCastException e) {
if (Number.class.isAssignableFrom(clazz)) {
... | [
"public",
"<",
"W",
">",
"W",
"getValue",
"(",
"Class",
"<",
"W",
">",
"clazz",
",",
"String",
"key",
")",
"{",
"if",
"(",
"values",
".",
"get",
"(",
"key",
")",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"try",
"{",
"re... | Returns the cell value casted to the specified class.
@param clazz the expected class
@param key the key
@return the cell value casted to the specified class | [
"Returns",
"the",
"cell",
"value",
"casted",
"to",
"the",
"specified",
"class",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/config/ExtractorConfig.java#L243-L263 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/ContentRepository.java | ContentRepository.clearACL | public void clearACL(String path, String... principalNames) throws RepositoryException {
"""
Removes all ACLs on the node specified by the path.
@param path
the absolute path to the node
@param principalNames
the user(s) whose ACL entries should be removed. If none is provided, all ACLs will be removed. A wo... | java | public void clearACL(String path, String... principalNames) throws RepositoryException {
final Session session = this.getAdminSession();
final AccessControlManager acm = session.getAccessControlManager();
final AccessControlList acl = this.getAccessControlList(session, path);
final Str... | [
"public",
"void",
"clearACL",
"(",
"String",
"path",
",",
"String",
"...",
"principalNames",
")",
"throws",
"RepositoryException",
"{",
"final",
"Session",
"session",
"=",
"this",
".",
"getAdminSession",
"(",
")",
";",
"final",
"AccessControlManager",
"acm",
"="... | Removes all ACLs on the node specified by the path.
@param path
the absolute path to the node
@param principalNames
the user(s) whose ACL entries should be removed. If none is provided, all ACLs will be removed. A word
of warning, if you invoke this on the root node '/' all ACls including those for administrators
and ... | [
"Removes",
"all",
"ACLs",
"on",
"the",
"node",
"specified",
"by",
"the",
"path",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/ContentRepository.java#L437-L459 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/internal/common/packet/buffer/ReadUtil.java | ReadUtil.safeRead | public static int safeRead(final InputStream inputStream, final byte[] buffer) throws IOException {
"""
Read a number of bytes from the stream and store it in the buffer, and fix the problem with "incomplete" reads by
doing another read if we don't have all of the data yet.
@param inputStream the input stream ... | java | public static int safeRead(final InputStream inputStream, final byte[] buffer) throws IOException {
int readBytes = inputStream.read(buffer);
if(readBytes == -1) {
return -1;
}
if(readBytes < buffer.length) {
int offset = readBytes;
int left = buffer.l... | [
"public",
"static",
"int",
"safeRead",
"(",
"final",
"InputStream",
"inputStream",
",",
"final",
"byte",
"[",
"]",
"buffer",
")",
"throws",
"IOException",
"{",
"int",
"readBytes",
"=",
"inputStream",
".",
"read",
"(",
"buffer",
")",
";",
"if",
"(",
"readBy... | Read a number of bytes from the stream and store it in the buffer, and fix the problem with "incomplete" reads by
doing another read if we don't have all of the data yet.
@param inputStream the input stream to read from
@param buffer where to store the data
@return the number of bytes read (should be == length if... | [
"Read",
"a",
"number",
"of",
"bytes",
"from",
"the",
"stream",
"and",
"store",
"it",
"in",
"the",
"buffer",
"and",
"fix",
"the",
"problem",
"with",
"incomplete",
"reads",
"by",
"doing",
"another",
"read",
"if",
"we",
"don",
"t",
"have",
"all",
"of",
"t... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/internal/common/packet/buffer/ReadUtil.java#L51-L74 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/MetatypeUtils.java | MetatypeUtils.parseDuration | @FFDCIgnore(Exception.class)
public static long parseDuration(Object configAlias, String propertyKey, Object obj, long defaultValue, TimeUnit units) {
"""
Parse a duration from the provided config value: checks for whether or not
the object read from the Service/Component configuration is a String
or a Metat... | java | @FFDCIgnore(Exception.class)
public static long parseDuration(Object configAlias, String propertyKey, Object obj, long defaultValue, TimeUnit units) {
if (obj != null) {
try {
if (obj instanceof String)
return evaluateDuration((String) obj, units);
... | [
"@",
"FFDCIgnore",
"(",
"Exception",
".",
"class",
")",
"public",
"static",
"long",
"parseDuration",
"(",
"Object",
"configAlias",
",",
"String",
"propertyKey",
",",
"Object",
"obj",
",",
"long",
"defaultValue",
",",
"TimeUnit",
"units",
")",
"{",
"if",
"(",... | Parse a duration from the provided config value: checks for whether or not
the object read from the Service/Component configuration is a String
or a Metatype converted long duration value
<p>
If an exception occurs converting the object parameter:
A translated warning message will be issued using the provided propertyK... | [
"Parse",
"a",
"duration",
"from",
"the",
"provided",
"config",
"value",
":",
"checks",
"for",
"whether",
"or",
"not",
"the",
"object",
"read",
"from",
"the",
"Service",
"/",
"Component",
"configuration",
"is",
"a",
"String",
"or",
"a",
"Metatype",
"converted... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/MetatypeUtils.java#L465-L484 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java | GeneralStorable.setValue | public void setValue(int index, int value) throws IOException {
"""
Sets the value belonging to the given field.
@param index
the index of the requested field
@param value
@throws IOException
"""
if (index >= structure.valueSizes.size()) {
throw new IOException("Index " + index + " is... | java | public void setValue(int index, int value) throws IOException {
if (index >= structure.valueSizes.size()) {
throw new IOException("Index " + index + " is out of range.");
}
Bytes.putInt(this.value, structure.valueByteOffsets.get(index), value);
} | [
"public",
"void",
"setValue",
"(",
"int",
"index",
",",
"int",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"index",
">=",
"structure",
".",
"valueSizes",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Index \"",
"+",
... | Sets the value belonging to the given field.
@param index
the index of the requested field
@param value
@throws IOException | [
"Sets",
"the",
"value",
"belonging",
"to",
"the",
"given",
"field",
"."
] | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java#L170-L175 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.queryOne | public Entity queryOne(String sql, Object... params) throws SQLException {
"""
查询单条记录
@param sql 查询语句
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常
"""
return query(sql, new EntityHandler(), params);
} | java | public Entity queryOne(String sql, Object... params) throws SQLException {
return query(sql, new EntityHandler(), params);
} | [
"public",
"Entity",
"queryOne",
"(",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"return",
"query",
"(",
"sql",
",",
"new",
"EntityHandler",
"(",
")",
",",
"params",
")",
";",
"}"
] | 查询单条记录
@param sql 查询语句
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常 | [
"查询单条记录"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L106-L108 |
svanoort/rest-compress | demo-app/src/main/java/com/restcompress/demoapp/RestDemoApp.java | RestDemoApp.getComplexObjectSizedMultiserializedJson | @Override
public FancyRestObject getComplexObjectSizedMultiserializedJson(@PathParam("size") int number) {
"""
Mimicks EJB-REST services
EJB generates object, it is serialized and deserialized over RMI to output
then converted to JSON/XML for REST by RESTEasy
"""
FancyRestObject fancy = getRandom... | java | @Override
public FancyRestObject getComplexObjectSizedMultiserializedJson(@PathParam("size") int number) {
FancyRestObject fancy = getRandomObject(number);
ByteArrayOutputStream baos = new ByteArrayOutputStream(0);
try {
ObjectOutputStream oos = new ObjectOutputStream(baos);
... | [
"@",
"Override",
"public",
"FancyRestObject",
"getComplexObjectSizedMultiserializedJson",
"(",
"@",
"PathParam",
"(",
"\"size\"",
")",
"int",
"number",
")",
"{",
"FancyRestObject",
"fancy",
"=",
"getRandomObject",
"(",
"number",
")",
";",
"ByteArrayOutputStream",
"bao... | Mimicks EJB-REST services
EJB generates object, it is serialized and deserialized over RMI to output
then converted to JSON/XML for REST by RESTEasy | [
"Mimicks",
"EJB",
"-",
"REST",
"services",
"EJB",
"generates",
"object",
"it",
"is",
"serialized",
"and",
"deserialized",
"over",
"RMI",
"to",
"output",
"then",
"converted",
"to",
"JSON",
"/",
"XML",
"for",
"REST",
"by",
"RESTEasy"
] | train | https://github.com/svanoort/rest-compress/blob/4e34fcbe0d1b510962a93509a78b6a8ade234606/demo-app/src/main/java/com/restcompress/demoapp/RestDemoApp.java#L142-L165 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/search/algo/tabu/FullTabuMemory.java | FullTabuMemory.isTabu | @Override
public boolean isTabu(Move<? super SolutionType> move, SolutionType currentSolution) {
"""
Verifies whether the given move is tabu by applying it to the current solution and checking if the obtained
neighbour is currently contained in the tabu memory. If not, the move is allowed. Before returning, t... | java | @Override
public boolean isTabu(Move<? super SolutionType> move, SolutionType currentSolution) {
// apply move
move.apply(currentSolution);
// check: contained in tabu memory?
boolean tabu = memory.contains(currentSolution);
// undo move
move.undo(currentSolution);
... | [
"@",
"Override",
"public",
"boolean",
"isTabu",
"(",
"Move",
"<",
"?",
"super",
"SolutionType",
">",
"move",
",",
"SolutionType",
"currentSolution",
")",
"{",
"// apply move",
"move",
".",
"apply",
"(",
"currentSolution",
")",
";",
"// check: contained in tabu mem... | Verifies whether the given move is tabu by applying it to the current solution and checking if the obtained
neighbour is currently contained in the tabu memory. If not, the move is allowed. Before returning, the move
is undone to restore the original state of the current solution.
@param move move to be applied to the... | [
"Verifies",
"whether",
"the",
"given",
"move",
"is",
"tabu",
"by",
"applying",
"it",
"to",
"the",
"current",
"solution",
"and",
"checking",
"if",
"the",
"obtained",
"neighbour",
"is",
"currently",
"contained",
"in",
"the",
"tabu",
"memory",
".",
"If",
"not",... | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/search/algo/tabu/FullTabuMemory.java#L67-L77 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/cookies/CookieCacheData.java | CookieCacheData.getAllCookies | public int getAllCookies(String name, List<HttpCookie> list) {
"""
Find all instances of cookies in the cache with the given name and add
clones of those objects to the input list.
@param name
@param list
@return int - number of cookies added to the list
"""
int added = 0;
if (0 < this.pa... | java | public int getAllCookies(String name, List<HttpCookie> list) {
int added = 0;
if (0 < this.parsedList.size() && null != name) {
for (HttpCookie cookie : this.parsedList) {
if (cookie.getName().equals(name)) {
list.add(cookie.clone());
a... | [
"public",
"int",
"getAllCookies",
"(",
"String",
"name",
",",
"List",
"<",
"HttpCookie",
">",
"list",
")",
"{",
"int",
"added",
"=",
"0",
";",
"if",
"(",
"0",
"<",
"this",
".",
"parsedList",
".",
"size",
"(",
")",
"&&",
"null",
"!=",
"name",
")",
... | Find all instances of cookies in the cache with the given name and add
clones of those objects to the input list.
@param name
@param list
@return int - number of cookies added to the list | [
"Find",
"all",
"instances",
"of",
"cookies",
"in",
"the",
"cache",
"with",
"the",
"given",
"name",
"and",
"add",
"clones",
"of",
"those",
"objects",
"to",
"the",
"input",
"list",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/cookies/CookieCacheData.java#L126-L137 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/gen/StorableGenerator.java | StorableGenerator.loadThisProperty | private void loadThisProperty(CodeBuilder b, StorableProperty property, TypeDesc type) {
"""
Loads the property value of the current storable onto the stack. If the
property is derived the read method is used, otherwise it just loads the
value from the appropriate field.
entry stack: [
exit stack: [value
... | java | private void loadThisProperty(CodeBuilder b, StorableProperty property, TypeDesc type) {
b.loadThis();
if (property.isDerived()) {
b.invoke(property.getReadMethod());
} else {
b.loadField(property.getName(), type);
}
} | [
"private",
"void",
"loadThisProperty",
"(",
"CodeBuilder",
"b",
",",
"StorableProperty",
"property",
",",
"TypeDesc",
"type",
")",
"{",
"b",
".",
"loadThis",
"(",
")",
";",
"if",
"(",
"property",
".",
"isDerived",
"(",
")",
")",
"{",
"b",
".",
"invoke",
... | Loads the property value of the current storable onto the stack. If the
property is derived the read method is used, otherwise it just loads the
value from the appropriate field.
entry stack: [
exit stack: [value
@param b - {@link CodeBuilder} to which to add the load code
@param property - property to load
@param ty... | [
"Loads",
"the",
"property",
"value",
"of",
"the",
"current",
"storable",
"onto",
"the",
"stack",
".",
"If",
"the",
"property",
"is",
"derived",
"the",
"read",
"method",
"is",
"used",
"otherwise",
"it",
"just",
"loads",
"the",
"value",
"from",
"the",
"appro... | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java#L2077-L2084 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/adapters/BindableAdapter.java | BindableAdapter.newDropDownView | public View newDropDownView(LayoutInflater inflater, int position, ViewGroup container) {
"""
Create a new instance of a drop-down view for the specified position.
"""
return newView(inflater, position, container);
} | java | public View newDropDownView(LayoutInflater inflater, int position, ViewGroup container) {
return newView(inflater, position, container);
} | [
"public",
"View",
"newDropDownView",
"(",
"LayoutInflater",
"inflater",
",",
"int",
"position",
",",
"ViewGroup",
"container",
")",
"{",
"return",
"newView",
"(",
"inflater",
",",
"position",
",",
"container",
")",
";",
"}"
] | Create a new instance of a drop-down view for the specified position. | [
"Create",
"a",
"new",
"instance",
"of",
"a",
"drop",
"-",
"down",
"view",
"for",
"the",
"specified",
"position",
"."
] | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/adapters/BindableAdapter.java#L59-L61 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/provisioning/ObjectsApi.java | ObjectsApi.searchAgentGroups | public Results<AgentGroup> searchAgentGroups(String groupType, Integer limit, Integer offset, String searchTerm, String searchKey, String matchMethod, String sortKey, Boolean sortAscending, String sortMethod) throws ProvisioningApiException {
"""
Get agent groups.
Get agent groups from Configuration Server with t... | java | public Results<AgentGroup> searchAgentGroups(String groupType, Integer limit, Integer offset, String searchTerm, String searchKey, String matchMethod, String sortKey, Boolean sortAscending, String sortMethod) throws ProvisioningApiException {
try {
GetObjectsSuccessResponse resp = objectsApi.getObject(
"age... | [
"public",
"Results",
"<",
"AgentGroup",
">",
"searchAgentGroups",
"(",
"String",
"groupType",
",",
"Integer",
"limit",
",",
"Integer",
"offset",
",",
"String",
"searchTerm",
",",
"String",
"searchKey",
",",
"String",
"matchMethod",
",",
"String",
"sortKey",
",",... | Get agent groups.
Get agent groups from Configuration Server with the specified filters.
@param groupType the agent group type. (optional)
@param limit The number of objects the Provisioning API should return. (optional)
@param offset The number of matches the Provisioning API should skip in the returned objects. (opti... | [
"Get",
"agent",
"groups",
".",
"Get",
"agent",
"groups",
"from",
"Configuration",
"Server",
"with",
"the",
"specified",
"filters",
"."
] | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/ObjectsApi.java#L175-L206 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/parser/TokenMgrError.java | TokenMgrError.LexicalError | protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
"""
Returns a detailed message for the Error when it is thrown by the
token manager to indicate a lexical error.
Parameters :
EOFSeen : indicates if EOF caused the lexicl er... | java | protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
return ("Lexical error at line " +
errorLine + ", column " +
errorColumn + ". Encountered: " +
(EOFSeen ? "<EOF> " : ("\"" + addEscapes(Stri... | [
"protected",
"static",
"String",
"LexicalError",
"(",
"boolean",
"EOFSeen",
",",
"int",
"lexState",
",",
"int",
"errorLine",
",",
"int",
"errorColumn",
",",
"String",
"errorAfter",
",",
"char",
"curChar",
")",
"{",
"return",
"(",
"\"Lexical error at line \"",
"+... | Returns a detailed message for the Error when it is thrown by the
token manager to indicate a lexical error.
Parameters :
EOFSeen : indicates if EOF caused the lexicl error
curLexState : lexical state in which this error occured
errorLine : line number when the error occured
errorColumn : column number when the e... | [
"Returns",
"a",
"detailed",
"message",
"for",
"the",
"Error",
"when",
"it",
"is",
"thrown",
"by",
"the",
"token",
"manager",
"to",
"indicate",
"a",
"lexical",
"error",
".",
"Parameters",
":",
"EOFSeen",
":",
"indicates",
"if",
"EOF",
"caused",
"the",
"lexi... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/el/parser/TokenMgrError.java#L116-L122 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/attribute/map/GenericMapAttribute.java | GenericMapAttribute.parseProjection | public static CoordinateReferenceSystem parseProjection(
final String projection, final Boolean longitudeFirst) {
"""
Parse the given projection.
@param projection The projection string.
@param longitudeFirst longitudeFirst
"""
try {
if (longitudeFirst == null) {
... | java | public static CoordinateReferenceSystem parseProjection(
final String projection, final Boolean longitudeFirst) {
try {
if (longitudeFirst == null) {
return CRS.decode(projection);
} else {
return CRS.decode(projection, longitudeFirst);
... | [
"public",
"static",
"CoordinateReferenceSystem",
"parseProjection",
"(",
"final",
"String",
"projection",
",",
"final",
"Boolean",
"longitudeFirst",
")",
"{",
"try",
"{",
"if",
"(",
"longitudeFirst",
"==",
"null",
")",
"{",
"return",
"CRS",
".",
"decode",
"(",
... | Parse the given projection.
@param projection The projection string.
@param longitudeFirst longitudeFirst | [
"Parse",
"the",
"given",
"projection",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/attribute/map/GenericMapAttribute.java#L84-L97 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ShippingUrl.java | ShippingUrl.getRatesUrl | public static MozuUrl getRatesUrl(Boolean includeRawResponse, String responseFields) {
"""
Get Resource Url for GetRates
@param includeRawResponse Set this parameter to to retrieve the full raw JSON response from a shipping carrier (instead of just the shipping rate).
@param responseFields Filtering syntax appe... | java | public static MozuUrl getRatesUrl(Boolean includeRawResponse, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/shipping/request-rates?responseFields={responseFields}");
formatter.formatUrl("includeRawResponse", includeRawResponse);
formatter.formatUrl("resp... | [
"public",
"static",
"MozuUrl",
"getRatesUrl",
"(",
"Boolean",
"includeRawResponse",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/storefront/shipping/request-rates?responseFields={responseFields}\... | Get Resource Url for GetRates
@param includeRawResponse Set this parameter to to retrieve the full raw JSON response from a shipping carrier (instead of just the shipping rate).
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This... | [
"Get",
"Resource",
"Url",
"for",
"GetRates"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ShippingUrl.java#L34-L40 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java | DBConn.commitDeletes | private void commitDeletes(DBTransaction dbTran, long timestamp) {
"""
Commit all row-deletions in the given MutationMap, if any, using the given timestamp.
"""
Map<String, Set<ByteBuffer>> rowDeleteMap = CassandraTransaction.getRowDeletionMap(dbTran);
if (rowDeleteMap.size() == 0) {
... | java | private void commitDeletes(DBTransaction dbTran, long timestamp) {
Map<String, Set<ByteBuffer>> rowDeleteMap = CassandraTransaction.getRowDeletionMap(dbTran);
if (rowDeleteMap.size() == 0) {
return;
}
// Iterate through all ColumnFamilies
for (String c... | [
"private",
"void",
"commitDeletes",
"(",
"DBTransaction",
"dbTran",
",",
"long",
"timestamp",
")",
"{",
"Map",
"<",
"String",
",",
"Set",
"<",
"ByteBuffer",
">",
">",
"rowDeleteMap",
"=",
"CassandraTransaction",
".",
"getRowDeletionMap",
"(",
"dbTran",
")",
";... | Commit all row-deletions in the given MutationMap, if any, using the given timestamp. | [
"Commit",
"all",
"row",
"-",
"deletions",
"in",
"the",
"given",
"MutationMap",
"if",
"any",
"using",
"the",
"given",
"timestamp",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java#L434-L448 |
cbeust/jcommander | src/main/java/com/beust/jcommander/Parameterized.java | Parameterized.describeClassTree | private static void describeClassTree(Class<?> inputClass, Set<Class<?>> setOfClasses) {
"""
Recursive handler for describing the set of classes while
using the setOfClasses parameter as a collector
@param inputClass the class to analyze
@param setOfClasses the set collector to collect the results
"""
... | java | private static void describeClassTree(Class<?> inputClass, Set<Class<?>> setOfClasses) {
// can't map null class
if(inputClass == null) {
return;
}
// don't further analyze a class that has been analyzed already
if(Object.class.equals(inputClass) || setOfClasses.contains(inputClass)) {
... | [
"private",
"static",
"void",
"describeClassTree",
"(",
"Class",
"<",
"?",
">",
"inputClass",
",",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"setOfClasses",
")",
"{",
"// can't map null class",
"if",
"(",
"inputClass",
"==",
"null",
")",
"{",
"return",
";",
... | Recursive handler for describing the set of classes while
using the setOfClasses parameter as a collector
@param inputClass the class to analyze
@param setOfClasses the set collector to collect the results | [
"Recursive",
"handler",
"for",
"describing",
"the",
"set",
"of",
"classes",
"while",
"using",
"the",
"setOfClasses",
"parameter",
"as",
"a",
"collector"
] | train | https://github.com/cbeust/jcommander/blob/85cb6f7217e15f62225185ffd97491f34b7b49bb/src/main/java/com/beust/jcommander/Parameterized.java#L48-L69 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/ch/WitnessPathSearcher.java | WitnessPathSearcher.initSearch | public int initSearch(int centerNode, int sourceNode, int sourceEdge) {
"""
Deletes the shortest path tree that has been found so far and initializes a new witness path search for a given
node to be contracted and search edge.
@param centerNode the node to be contracted (x)
@param sourceNode the neighbor node... | java | public int initSearch(int centerNode, int sourceNode, int sourceEdge) {
reset();
this.sourceEdge = sourceEdge;
this.sourceNode = sourceNode;
this.centerNode = centerNode;
setInitialEntries(sourceNode, sourceEdge, centerNode);
// if there is no entry that reaches the cente... | [
"public",
"int",
"initSearch",
"(",
"int",
"centerNode",
",",
"int",
"sourceNode",
",",
"int",
"sourceEdge",
")",
"{",
"reset",
"(",
")",
";",
"this",
".",
"sourceEdge",
"=",
"sourceEdge",
";",
"this",
".",
"sourceNode",
"=",
"sourceNode",
";",
"this",
"... | Deletes the shortest path tree that has been found so far and initializes a new witness path search for a given
node to be contracted and search edge.
@param centerNode the node to be contracted (x)
@param sourceNode the neighbor node from which the search starts (s)
@param sourceEdge the original edge incoming to s f... | [
"Deletes",
"the",
"shortest",
"path",
"tree",
"that",
"has",
"been",
"found",
"so",
"far",
"and",
"initializes",
"a",
"new",
"witness",
"path",
"search",
"for",
"a",
"given",
"node",
"to",
"be",
"contracted",
"and",
"search",
"edge",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/ch/WitnessPathSearcher.java#L143-L159 |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SubStringOperation.java | SubStringOperation.getSubStringParameter | private Integer getSubStringParameter(Map<String, String> parameters, String parameterName, Integer defaultValue)
throws TransformationOperationException {
"""
Returns the substring parameter with the given parameter or the given default value if the parameter name is not
set.
"""
String param... | java | private Integer getSubStringParameter(Map<String, String> parameters, String parameterName, Integer defaultValue)
throws TransformationOperationException {
String parameter = parameters.get(parameterName);
if (parameter == null) {
getLogger().debug("The {} parameter is not set, so th... | [
"private",
"Integer",
"getSubStringParameter",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"String",
"parameterName",
",",
"Integer",
"defaultValue",
")",
"throws",
"TransformationOperationException",
"{",
"String",
"parameter",
"=",
"parameters"... | Returns the substring parameter with the given parameter or the given default value if the parameter name is not
set. | [
"Returns",
"the",
"substring",
"parameter",
"with",
"the",
"given",
"parameter",
"or",
"the",
"given",
"default",
"value",
"if",
"the",
"parameter",
"name",
"is",
"not",
"set",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/SubStringOperation.java#L113-L126 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/RequestHandler.java | RequestHandler.checkFeaturesForRequest | protected void checkFeaturesForRequest(final CouchbaseRequest request, final BucketConfig config) {
"""
Checks, for a sub-set of {@link CouchbaseRequest}, if the current environment has
the necessary feature activated. If not, throws an {@link ServiceNotAvailableException}.
@param request the request to check.... | java | protected void checkFeaturesForRequest(final CouchbaseRequest request, final BucketConfig config) {
if (request instanceof BinaryRequest && !config.serviceEnabled(ServiceType.BINARY)) {
throw new ServiceNotAvailableException("The KeyValue service is not enabled or no node in the cluster "
... | [
"protected",
"void",
"checkFeaturesForRequest",
"(",
"final",
"CouchbaseRequest",
"request",
",",
"final",
"BucketConfig",
"config",
")",
"{",
"if",
"(",
"request",
"instanceof",
"BinaryRequest",
"&&",
"!",
"config",
".",
"serviceEnabled",
"(",
"ServiceType",
".",
... | Checks, for a sub-set of {@link CouchbaseRequest}, if the current environment has
the necessary feature activated. If not, throws an {@link ServiceNotAvailableException}.
@param request the request to check.
@throws ServiceNotAvailableException if the request type needs a particular feature which isn't activated. | [
"Checks",
"for",
"a",
"sub",
"-",
"set",
"of",
"{",
"@link",
"CouchbaseRequest",
"}",
"if",
"the",
"current",
"environment",
"has",
"the",
"necessary",
"feature",
"activated",
".",
"If",
"not",
"throws",
"an",
"{",
"@link",
"ServiceNotAvailableException",
"}",... | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/RequestHandler.java#L269-L286 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/factory/provider/PrototypeObjectFactory.java | PrototypeObjectFactory.postConstruct | @Override
protected <T> T postConstruct(T object, final Object... args) {
"""
Overridden postConstruct method to perform post constructor (instantiation) configuration and initialization
actions on the newly constructed object.
@param <T> the Class type of created object.
@param object the object created by... | java | @Override
protected <T> T postConstruct(T object, final Object... args) {
object = super.postConstruct(object, args);
object = configure(object);
object = initialize(object, args);
return object;
} | [
"@",
"Override",
"protected",
"<",
"T",
">",
"T",
"postConstruct",
"(",
"T",
"object",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"object",
"=",
"super",
".",
"postConstruct",
"(",
"object",
",",
"args",
")",
";",
"object",
"=",
"configure",
"(",... | Overridden postConstruct method to perform post constructor (instantiation) configuration and initialization
actions on the newly constructed object.
@param <T> the Class type of created object.
@param object the object created by this factory.
@param args an array of Objects arguments used for post construction initi... | [
"Overridden",
"postConstruct",
"method",
"to",
"perform",
"post",
"constructor",
"(",
"instantiation",
")",
"configuration",
"and",
"initialization",
"actions",
"on",
"the",
"newly",
"constructed",
"object",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/factory/provider/PrototypeObjectFactory.java#L60-L67 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java | StaticTraceInstrumentation.transform | final protected byte[] transform(final InputStream classfileStream) throws IOException {
"""
Instrument the class at the current position in the specified input stream.
@return instrumented class file or null if the class has already
been instrumented.
@throws IOException if an error is encountered while re... | java | final protected byte[] transform(final InputStream classfileStream) throws IOException {
ClassConfigData classConfigData = processClassConfiguration(classfileStream);
ClassInfo classInfo = classConfigData.getClassInfo();
// Only instrument the classes that we're supposed to.
if (!getIns... | [
"final",
"protected",
"byte",
"[",
"]",
"transform",
"(",
"final",
"InputStream",
"classfileStream",
")",
"throws",
"IOException",
"{",
"ClassConfigData",
"classConfigData",
"=",
"processClassConfiguration",
"(",
"classfileStream",
")",
";",
"ClassInfo",
"classInfo",
... | Instrument the class at the current position in the specified input stream.
@return instrumented class file or null if the class has already
been instrumented.
@throws IOException if an error is encountered while reading from
the <code>InputStream</code> | [
"Instrument",
"the",
"class",
"at",
"the",
"current",
"position",
"in",
"the",
"specified",
"input",
"stream",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java#L122-L175 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ModuleWebhooks.java | ModuleWebhooks.fetchAll | public CMAArray<CMAWebhook> fetchAll(Map<String, String> query) {
"""
Retrieve specific webhooks matching a query for this space.
@param query Specifying the criteria on which webhooks to return.
@return An {@link CMAArray} containing all found webhooks for this space.
@throws IllegalArgumentException ... | java | public CMAArray<CMAWebhook> fetchAll(Map<String, String> query) {
throwIfEnvironmentIdIsSet();
return fetchAll(spaceId, query);
} | [
"public",
"CMAArray",
"<",
"CMAWebhook",
">",
"fetchAll",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"query",
")",
"{",
"throwIfEnvironmentIdIsSet",
"(",
")",
";",
"return",
"fetchAll",
"(",
"spaceId",
",",
"query",
")",
";",
"}"
] | Retrieve specific webhooks matching a query for this space.
@param query Specifying the criteria on which webhooks to return.
@return An {@link CMAArray} containing all found webhooks for this space.
@throws IllegalArgumentException if configured spaceId is null.
@throws CMANotWithEnvironmentsException if envir... | [
"Retrieve",
"specific",
"webhooks",
"matching",
"a",
"query",
"for",
"this",
"space",
"."
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleWebhooks.java#L171-L175 |
Jasig/uPortal | uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/profile/ServerProfileMapperImpl.java | ServerProfileMapperImpl.getProfileFname | @Override
public String getProfileFname(IPerson person, HttpServletRequest request) {
"""
Returns the profile name specified by {@link #setDefaultProfile(String defaultProfile)
setDefaultProfile} or "default" if {@link #setDefaultProfile(String defaultProfile)
setDefaultProfile} is not called if the user is ... | java | @Override
public String getProfileFname(IPerson person, HttpServletRequest request) {
Validate.notNull(person, "Cannot get profile fname for a null person.");
Validate.notNull(request, "Cannot get profile fname for a null request.");
String userName = person.getUserName();
final St... | [
"@",
"Override",
"public",
"String",
"getProfileFname",
"(",
"IPerson",
"person",
",",
"HttpServletRequest",
"request",
")",
"{",
"Validate",
".",
"notNull",
"(",
"person",
",",
"\"Cannot get profile fname for a null person.\"",
")",
";",
"Validate",
".",
"notNull",
... | Returns the profile name specified by {@link #setDefaultProfile(String defaultProfile)
setDefaultProfile} or "default" if {@link #setDefaultProfile(String defaultProfile)
setDefaultProfile} is not called if the user is using a server in the server regular
expression specified by {@link #setServerRegex(String serverRege... | [
"Returns",
"the",
"profile",
"name",
"specified",
"by",
"{",
"@link",
"#setDefaultProfile",
"(",
"String",
"defaultProfile",
")",
"setDefaultProfile",
"}",
"or",
"default",
"if",
"{",
"@link",
"#setDefaultProfile",
"(",
"String",
"defaultProfile",
")",
"setDefaultPr... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/profile/ServerProfileMapperImpl.java#L75-L103 |
Waikato/moa | moa/src/main/java/moa/core/Utils.java | Utils.removeSubstring | public static String removeSubstring(String inString, String substring) {
"""
Removes all occurrences of a string from another string.
@param inString the string to remove substrings from.
@param substring the substring to remove.
@return the input string with occurrences of substring removed.
"""
St... | java | public static String removeSubstring(String inString, String substring) {
StringBuffer result = new StringBuffer();
int oldLoc = 0, loc = 0;
while ((loc = inString.indexOf(substring, oldLoc))!= -1) {
result.append(inString.substring(oldLoc, loc));
oldLoc = loc + substring.length();
}
re... | [
"public",
"static",
"String",
"removeSubstring",
"(",
"String",
"inString",
",",
"String",
"substring",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"int",
"oldLoc",
"=",
"0",
",",
"loc",
"=",
"0",
";",
"while",
"(",
"("... | Removes all occurrences of a string from another string.
@param inString the string to remove substrings from.
@param substring the substring to remove.
@return the input string with occurrences of substring removed. | [
"Removes",
"all",
"occurrences",
"of",
"a",
"string",
"from",
"another",
"string",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/core/Utils.java#L132-L142 |
likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getJSONObject | protected JSONObject getJSONObject(final JSONArray jsonArray, final int index) {
"""
Return a json object from the provided array. Return an empty object if
there is any problems fetching the named entity data.
@param jsonArray array of data
@param index of the object to fetch
@return json object from the... | java | protected JSONObject getJSONObject(final JSONArray jsonArray, final int index) {
JSONObject object = new JSONObject();
try {
object = (JSONObject) jsonArray.get(index);
}
catch(JSONException e) {
e.printStackTrace();
}
return object;
} | [
"protected",
"JSONObject",
"getJSONObject",
"(",
"final",
"JSONArray",
"jsonArray",
",",
"final",
"int",
"index",
")",
"{",
"JSONObject",
"object",
"=",
"new",
"JSONObject",
"(",
")",
";",
"try",
"{",
"object",
"=",
"(",
"JSONObject",
")",
"jsonArray",
".",
... | Return a json object from the provided array. Return an empty object if
there is any problems fetching the named entity data.
@param jsonArray array of data
@param index of the object to fetch
@return json object from the provided array | [
"Return",
"a",
"json",
"object",
"from",
"the",
"provided",
"array",
".",
"Return",
"an",
"empty",
"object",
"if",
"there",
"is",
"any",
"problems",
"fetching",
"the",
"named",
"entity",
"data",
"."
] | train | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L300-L309 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.encodeCharToBytes | @Nonnull
@ReturnsMutableCopy
public static byte [] encodeCharToBytes (@Nonnull final char [] aCharArray, @Nonnull final Charset aCharset) {
"""
Encode a char array to a byte array using the provided charset. This does the
same as <code>new String (aCharArray).getBytes (aCharset)</code> just without
the inter... | java | @Nonnull
@ReturnsMutableCopy
public static byte [] encodeCharToBytes (@Nonnull final char [] aCharArray, @Nonnull final Charset aCharset)
{
return encodeCharToBytes (aCharArray, 0, aCharArray.length, aCharset);
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"byte",
"[",
"]",
"encodeCharToBytes",
"(",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aCharArray",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"return",
"encodeCharToBytes",
"(... | Encode a char array to a byte array using the provided charset. This does the
same as <code>new String (aCharArray).getBytes (aCharset)</code> just without
the intermediate objects.
@param aCharset
Charset to be used. May not be <code>null</code>.
@param aCharArray
The char array to be encoded. May not be <code>null</... | [
"Encode",
"a",
"char",
"array",
"to",
"a",
"byte",
"array",
"using",
"the",
"provided",
"charset",
".",
"This",
"does",
"the",
"same",
"as",
"<code",
">",
"new",
"String",
"(",
"aCharArray",
")",
".",
"getBytes",
"(",
"aCharset",
")",
"<",
"/",
"code",... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L5277-L5282 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java | TableWorks.addIndex | Index addIndex(int[] col, HsqlName name, boolean unique, boolean migrating, Expression predicate) {
"""
A VoltDB extended variant of addIndex that supports partial index predicate.
@param col int[]
@param name HsqlName
@param unique boolean
@param migrating is MIGRATING INDEX being created
@param predicate ... | java | Index addIndex(int[] col, HsqlName name, boolean unique, boolean migrating, Expression predicate) {
return addIndex(col, name, unique, migrating).withPredicate(predicate);
} | [
"Index",
"addIndex",
"(",
"int",
"[",
"]",
"col",
",",
"HsqlName",
"name",
",",
"boolean",
"unique",
",",
"boolean",
"migrating",
",",
"Expression",
"predicate",
")",
"{",
"return",
"addIndex",
"(",
"col",
",",
"name",
",",
"unique",
",",
"migrating",
")... | A VoltDB extended variant of addIndex that supports partial index predicate.
@param col int[]
@param name HsqlName
@param unique boolean
@param migrating is MIGRATING INDEX being created
@param predicate Expression
@return new index | [
"A",
"VoltDB",
"extended",
"variant",
"of",
"addIndex",
"that",
"supports",
"partial",
"index",
"predicate",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/TableWorks.java#L1215-L1217 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.