repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 218 | func_name stringlengths 5 140 | whole_func_string stringlengths 79 3.99k | language stringclasses 1
value | func_code_string stringlengths 79 3.99k | func_code_tokens listlengths 20 624 | func_documentation_string stringlengths 61 1.96k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 107 339 |
|---|---|---|---|---|---|---|---|---|---|---|
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java | BackendServiceClient.deleteSignedUrlKeyBackendService | @BetaApi
public final Operation deleteSignedUrlKeyBackendService(String backendService, String keyName) {
DeleteSignedUrlKeyBackendServiceHttpRequest request =
DeleteSignedUrlKeyBackendServiceHttpRequest.newBuilder()
.setBackendService(backendService)
.setKeyName(keyName)
... | java | @BetaApi
public final Operation deleteSignedUrlKeyBackendService(String backendService, String keyName) {
DeleteSignedUrlKeyBackendServiceHttpRequest request =
DeleteSignedUrlKeyBackendServiceHttpRequest.newBuilder()
.setBackendService(backendService)
.setKeyName(keyName)
... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"deleteSignedUrlKeyBackendService",
"(",
"String",
"backendService",
",",
"String",
"keyName",
")",
"{",
"DeleteSignedUrlKeyBackendServiceHttpRequest",
"request",
"=",
"DeleteSignedUrlKeyBackendServiceHttpRequest",
".",
"newBuilde... | Deletes a key for validating requests with signed URLs for this backend service.
<p>Sample code:
<pre><code>
try (BackendServiceClient backendServiceClient = BackendServiceClient.create()) {
ProjectGlobalBackendServiceName backendService = ProjectGlobalBackendServiceName.of("[PROJECT]", "[BACKEND_SERVICE]");
String k... | [
"Deletes",
"a",
"key",
"for",
"validating",
"requests",
"with",
"signed",
"URLs",
"for",
"this",
"backend",
"service",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendServiceClient.java#L568-L577 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBObjectMapper.java | CouchDBObjectMapper.getJsonPrimitive | private static JsonElement getJsonPrimitive(Object value, Class clazz)
{
if (value != null)
{
if (clazz.isAssignableFrom(Number.class) || value instanceof Number)
{
return new JsonPrimitive((Number) value);
}
else if (clazz.isAssignable... | java | private static JsonElement getJsonPrimitive(Object value, Class clazz)
{
if (value != null)
{
if (clazz.isAssignableFrom(Number.class) || value instanceof Number)
{
return new JsonPrimitive((Number) value);
}
else if (clazz.isAssignable... | [
"private",
"static",
"JsonElement",
"getJsonPrimitive",
"(",
"Object",
"value",
",",
"Class",
"clazz",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"clazz",
".",
"isAssignableFrom",
"(",
"Number",
".",
"class",
")",
"||",
"value",
"in... | Gets the json primitive.
@param value
the value
@param clazz
the clazz
@return the json primitive | [
"Gets",
"the",
"json",
"primitive",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBObjectMapper.java#L440-L464 |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java | AbsSetting.getBool | public Boolean getBool(String key, String group, Boolean defaultValue) {
return Convert.toBool(getByGroup(key, group), defaultValue);
} | java | public Boolean getBool(String key, String group, Boolean defaultValue) {
return Convert.toBool(getByGroup(key, group), defaultValue);
} | [
"public",
"Boolean",
"getBool",
"(",
"String",
"key",
",",
"String",
"group",
",",
"Boolean",
"defaultValue",
")",
"{",
"return",
"Convert",
".",
"toBool",
"(",
"getByGroup",
"(",
"key",
",",
"group",
")",
",",
"defaultValue",
")",
";",
"}"
] | 获取波尔型型属性值
@param key 属性名
@param group 分组名
@param defaultValue 默认值
@return 属性值 | [
"获取波尔型型属性值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java#L188-L190 |
alibaba/jstorm | jstorm-core/src/main/java/storm/trident/Stream.java | Stream.slidingWindow | public Stream slidingWindow(BaseWindowedBolt.Duration windowDuration, BaseWindowedBolt.Duration slidingInterval,
WindowsStoreFactory windowStoreFactory, Fields inputFields, Aggregator aggregator, Fields functionFields) {
return window(SlidingDurationWindow.of(windowDuration, ... | java | public Stream slidingWindow(BaseWindowedBolt.Duration windowDuration, BaseWindowedBolt.Duration slidingInterval,
WindowsStoreFactory windowStoreFactory, Fields inputFields, Aggregator aggregator, Fields functionFields) {
return window(SlidingDurationWindow.of(windowDuration, ... | [
"public",
"Stream",
"slidingWindow",
"(",
"BaseWindowedBolt",
".",
"Duration",
"windowDuration",
",",
"BaseWindowedBolt",
".",
"Duration",
"slidingInterval",
",",
"WindowsStoreFactory",
"windowStoreFactory",
",",
"Fields",
"inputFields",
",",
"Aggregator",
"aggregator",
"... | Returns a stream of tuples which are aggregated results of a window which slides at duration of {@code slidingInterval}
and completes a window at {@code windowDuration}
@param windowDuration represents window duration configuration
@param inputFields projected fields for aggregator
@param aggregator aggregator to run ... | [
"Returns",
"a",
"stream",
"of",
"tuples",
"which",
"are",
"aggregated",
"results",
"of",
"a",
"window",
"which",
"slides",
"at",
"duration",
"of",
"{",
"@code",
"slidingInterval",
"}",
"and",
"completes",
"a",
"window",
"at",
"{",
"@code",
"windowDuration",
... | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/Stream.java#L653-L656 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/internal/adapter/PropertyAdapter.java | PropertyAdapter.convertExample | public static Object convertExample(String value, String type) {
if (value == null) {
return null;
}
try {
switch (type) {
case "integer":
return Integer.valueOf(value);
case "number":
return Float.v... | java | public static Object convertExample(String value, String type) {
if (value == null) {
return null;
}
try {
switch (type) {
case "integer":
return Integer.valueOf(value);
case "number":
return Float.v... | [
"public",
"static",
"Object",
"convertExample",
"(",
"String",
"value",
",",
"String",
"type",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"\"integer\"",
":",
... | Convert a string {@code value} to specified {@code type}.
@param value value to convert
@param type target conversion type
@return converted value as object | [
"Convert",
"a",
"string",
"{",
"@code",
"value",
"}",
"to",
"specified",
"{",
"@code",
"type",
"}",
"."
] | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/adapter/PropertyAdapter.java#L129-L150 |
buschmais/jqa-rdbms-plugin | src/main/java/com/buschmais/jqassistant/plugin/rdbms/impl/scanner/AbstractSchemaScannerPlugin.java | AbstractSchemaScannerPlugin.createForeignKeys | private void createForeignKeys(Set<ForeignKey> allForeignKeys, Map<Column, ColumnDescriptor> allColumns, Store store) {
// Foreign keys
for (ForeignKey foreignKey : allForeignKeys) {
ForeignKeyDescriptor foreignKeyDescriptor = store.create(ForeignKeyDescriptor.class);
foreignKeyD... | java | private void createForeignKeys(Set<ForeignKey> allForeignKeys, Map<Column, ColumnDescriptor> allColumns, Store store) {
// Foreign keys
for (ForeignKey foreignKey : allForeignKeys) {
ForeignKeyDescriptor foreignKeyDescriptor = store.create(ForeignKeyDescriptor.class);
foreignKeyD... | [
"private",
"void",
"createForeignKeys",
"(",
"Set",
"<",
"ForeignKey",
">",
"allForeignKeys",
",",
"Map",
"<",
"Column",
",",
"ColumnDescriptor",
">",
"allColumns",
",",
"Store",
"store",
")",
"{",
"// Foreign keys",
"for",
"(",
"ForeignKey",
"foreignKey",
":",
... | Create the foreign key descriptors.
@param allForeignKeys All collected foreign keys.
@param allColumns All collected columns.
@param store The store. | [
"Create",
"the",
"foreign",
"key",
"descriptors",
"."
] | train | https://github.com/buschmais/jqa-rdbms-plugin/blob/96c3919907deee00175cf5ab005867d76e01ba62/src/main/java/com/buschmais/jqassistant/plugin/rdbms/impl/scanner/AbstractSchemaScannerPlugin.java#L233-L254 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java | SSLUtils.createRestClientSSLContext | @Nullable
public static SSLContext createRestClientSSLContext(Configuration config) throws Exception {
final RestSSLContextConfigMode configMode;
if (isRestSSLAuthenticationEnabled(config)) {
configMode = RestSSLContextConfigMode.MUTUAL;
} else {
configMode = RestSSLContextConfigMode.CLIENT;
}
return ... | java | @Nullable
public static SSLContext createRestClientSSLContext(Configuration config) throws Exception {
final RestSSLContextConfigMode configMode;
if (isRestSSLAuthenticationEnabled(config)) {
configMode = RestSSLContextConfigMode.MUTUAL;
} else {
configMode = RestSSLContextConfigMode.CLIENT;
}
return ... | [
"@",
"Nullable",
"public",
"static",
"SSLContext",
"createRestClientSSLContext",
"(",
"Configuration",
"config",
")",
"throws",
"Exception",
"{",
"final",
"RestSSLContextConfigMode",
"configMode",
";",
"if",
"(",
"isRestSSLAuthenticationEnabled",
"(",
"config",
")",
")"... | Creates an SSL context for clients against the external REST endpoint. | [
"Creates",
"an",
"SSL",
"context",
"for",
"clients",
"against",
"the",
"external",
"REST",
"endpoint",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java#L343-L353 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.read | public static String read(FileChannel fileChannel, Charset charset) throws IORuntimeException {
MappedByteBuffer buffer;
try {
buffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, fileChannel.size()).load();
} catch (IOException e) {
throw new IORuntimeException(e);
}
return StrUtil.str(buf... | java | public static String read(FileChannel fileChannel, Charset charset) throws IORuntimeException {
MappedByteBuffer buffer;
try {
buffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, fileChannel.size()).load();
} catch (IOException e) {
throw new IORuntimeException(e);
}
return StrUtil.str(buf... | [
"public",
"static",
"String",
"read",
"(",
"FileChannel",
"fileChannel",
",",
"Charset",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"MappedByteBuffer",
"buffer",
";",
"try",
"{",
"buffer",
"=",
"fileChannel",
".",
"map",
"(",
"FileChannel",
".",
"MapMo... | 从FileChannel中读取内容
@param fileChannel 文件管道
@param charset 字符集
@return 内容
@throws IORuntimeException IO异常 | [
"从FileChannel中读取内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L505-L513 |
apache/groovy | subprojects/groovy-xml/src/main/java/groovy/xml/NamespaceBuilderSupport.java | NamespaceBuilderSupport.invokeMethod | @Override
public Object invokeMethod(String methodName, Object args) {
// detect namespace declared on the added node like xmlns:foo="http:/foo"
Map attributes = findAttributes(args);
for (Iterator<Map.Entry> iter = attributes.entrySet().iterator(); iter.hasNext();) {
Map.Entry entry = iter.... | java | @Override
public Object invokeMethod(String methodName, Object args) {
// detect namespace declared on the added node like xmlns:foo="http:/foo"
Map attributes = findAttributes(args);
for (Iterator<Map.Entry> iter = attributes.entrySet().iterator(); iter.hasNext();) {
Map.Entry entry = iter.... | [
"@",
"Override",
"public",
"Object",
"invokeMethod",
"(",
"String",
"methodName",
",",
"Object",
"args",
")",
"{",
"// detect namespace declared on the added node like xmlns:foo=\"http:/foo\"",
"Map",
"attributes",
"=",
"findAttributes",
"(",
"args",
")",
";",
"for",
"(... | Allow automatic detection of namespace declared in the attributes | [
"Allow",
"automatic",
"detection",
"of",
"namespace",
"declared",
"in",
"the",
"attributes"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/xml/NamespaceBuilderSupport.java#L119-L135 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.resetAsync | public Observable<VirtualNetworkGatewayInner> resetAsync(String resourceGroupName, String virtualNetworkGatewayName) {
return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1<ServiceResponse<VirtualNetworkGatewayInner>, VirtualNetworkGatewayInner>() {
@Overri... | java | public Observable<VirtualNetworkGatewayInner> resetAsync(String resourceGroupName, String virtualNetworkGatewayName) {
return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1<ServiceResponse<VirtualNetworkGatewayInner>, VirtualNetworkGatewayInner>() {
@Overri... | [
"public",
"Observable",
"<",
"VirtualNetworkGatewayInner",
">",
"resetAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"return",
"resetWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayName",
")",
... | Resets the primary of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the ... | [
"Resets",
"the",
"primary",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1184-L1191 |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java | AbstractOptionsForSelect.withRowAsyncListeners | public T withRowAsyncListeners(List<Function<Row, Row>> rowAsyncListeners) {
getOptions().setRowAsyncListeners(Optional.of(rowAsyncListeners));
return getThis();
} | java | public T withRowAsyncListeners(List<Function<Row, Row>> rowAsyncListeners) {
getOptions().setRowAsyncListeners(Optional.of(rowAsyncListeners));
return getThis();
} | [
"public",
"T",
"withRowAsyncListeners",
"(",
"List",
"<",
"Function",
"<",
"Row",
",",
"Row",
">",
">",
"rowAsyncListeners",
")",
"{",
"getOptions",
"(",
")",
".",
"setRowAsyncListeners",
"(",
"Optional",
".",
"of",
"(",
"rowAsyncListeners",
")",
")",
";",
... | Add the given list of async listeners on the {@link com.datastax.driver.core.Row} object.
Example of usage:
<pre class="code"><code class="java">
.withRowAsyncListeners(Arrays.asList(row -> {
//Do something with the row object here
}))
</code></pre>
Remark: <strong>You can inspect and read values from the row object... | [
"Add",
"the",
"given",
"list",
"of",
"async",
"listeners",
"on",
"the",
"{",
"@link",
"com",
".",
"datastax",
".",
"driver",
".",
"core",
".",
"Row",
"}",
"object",
".",
"Example",
"of",
"usage",
":",
"<pre",
"class",
"=",
"code",
">",
"<code",
"clas... | train | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L218-L221 |
nakamura5akihito/six-util | src/main/java/jp/go/aist/six/util/search/RelationalBinding.java | RelationalBinding.greaterThanBinding | public static RelationalBinding greaterThanBinding(
final String property,
final Object value
)
{
return (new RelationalBinding( property, Relation.GREATER_THAN, value ));
} | java | public static RelationalBinding greaterThanBinding(
final String property,
final Object value
)
{
return (new RelationalBinding( property, Relation.GREATER_THAN, value ));
} | [
"public",
"static",
"RelationalBinding",
"greaterThanBinding",
"(",
"final",
"String",
"property",
",",
"final",
"Object",
"value",
")",
"{",
"return",
"(",
"new",
"RelationalBinding",
"(",
"property",
",",
"Relation",
".",
"GREATER_THAN",
",",
"value",
")",
")"... | Creates a 'GREATER_THAN' binding.
@param property
the property.
@param value
the value to which the property should be related.
@return
a 'GREATER_THAN' binding. | [
"Creates",
"a",
"GREATER_THAN",
"binding",
"."
] | train | https://github.com/nakamura5akihito/six-util/blob/a6db388a345e220cea2b1fa6324d15c80c6278b6/src/main/java/jp/go/aist/six/util/search/RelationalBinding.java#L130-L136 |
Ashok-Varma/BottomNavigation | bottom-navigation-bar/src/main/java/com/ashokvarma/bottomnavigation/BottomNavigationBar.java | BottomNavigationBar.parseAttrs | private void parseAttrs(Context context, AttributeSet attrs) {
if (attrs != null) {
TypedArray typedArray = context.getTheme().obtainStyledAttributes(attrs, R.styleable.BottomNavigationBar, 0, 0);
mActiveColor = typedArray.getColor(R.styleable.BottomNavigationBar_bnbActiveColor, Utils.f... | java | private void parseAttrs(Context context, AttributeSet attrs) {
if (attrs != null) {
TypedArray typedArray = context.getTheme().obtainStyledAttributes(attrs, R.styleable.BottomNavigationBar, 0, 0);
mActiveColor = typedArray.getColor(R.styleable.BottomNavigationBar_bnbActiveColor, Utils.f... | [
"private",
"void",
"parseAttrs",
"(",
"Context",
"context",
",",
"AttributeSet",
"attrs",
")",
"{",
"if",
"(",
"attrs",
"!=",
"null",
")",
"{",
"TypedArray",
"typedArray",
"=",
"context",
".",
"getTheme",
"(",
")",
".",
"obtainStyledAttributes",
"(",
"attrs"... | This method initiates the bottomNavigationBar properties,
Tries to get them form XML if not preset sets them to their default values.
@param context context of the bottomNavigationBar
@param attrs attributes mentioned in the layout XML by user | [
"This",
"method",
"initiates",
"the",
"bottomNavigationBar",
"properties",
"Tries",
"to",
"get",
"them",
"form",
"XML",
"if",
"not",
"preset",
"sets",
"them",
"to",
"their",
"default",
"values",
"."
] | train | https://github.com/Ashok-Varma/BottomNavigation/blob/a5c486a6dfa1ebe7049e2e025e0d967111ecfd0b/bottom-navigation-bar/src/main/java/com/ashokvarma/bottomnavigation/BottomNavigationBar.java#L146-L203 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java | Dialogs.showDetailsDialog | public static DetailsDialog showDetailsDialog (Stage stage, String text, String title, String details) {
return showDetailsDialog(stage, text, title, details, false);
} | java | public static DetailsDialog showDetailsDialog (Stage stage, String text, String title, String details) {
return showDetailsDialog(stage, text, title, details, false);
} | [
"public",
"static",
"DetailsDialog",
"showDetailsDialog",
"(",
"Stage",
"stage",
",",
"String",
"text",
",",
"String",
"title",
",",
"String",
"details",
")",
"{",
"return",
"showDetailsDialog",
"(",
"stage",
",",
"text",
",",
"title",
",",
"details",
",",
"... | Dialog with given title, provided text, and more details available after pressing 'Details' button. | [
"Dialog",
"with",
"given",
"title",
"provided",
"text",
"and",
"more",
"details",
"available",
"after",
"pressing",
"Details",
"button",
"."
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/dialog/Dialogs.java#L176-L178 |
apache/groovy | subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java | SwingGroovyMethods.leftShift | public static JPopupMenu leftShift(JPopupMenu self, Component component) {
self.add(component);
return self;
} | java | public static JPopupMenu leftShift(JPopupMenu self, Component component) {
self.add(component);
return self;
} | [
"public",
"static",
"JPopupMenu",
"leftShift",
"(",
"JPopupMenu",
"self",
",",
"Component",
"component",
")",
"{",
"self",
".",
"add",
"(",
"component",
")",
";",
"return",
"self",
";",
"}"
] | Overloads the left shift operator to provide an easy way to add
components to a popupMenu.<p>
@param self a JPopupMenu
@param component a component to be added to the popupMenu.
@return same popupMenu, after the value was added to it.
@since 1.6.4 | [
"Overloads",
"the",
"left",
"shift",
"operator",
"to",
"provide",
"an",
"easy",
"way",
"to",
"add",
"components",
"to",
"a",
"popupMenu",
".",
"<p",
">"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java#L910-L913 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/DataTracker.java | DataTracker.replaceWithNewInstances | public void replaceWithNewInstances(Collection<SSTableReader> toReplace, Collection<SSTableReader> replaceWith)
{
replaceReaders(toReplace, replaceWith, true);
} | java | public void replaceWithNewInstances(Collection<SSTableReader> toReplace, Collection<SSTableReader> replaceWith)
{
replaceReaders(toReplace, replaceWith, true);
} | [
"public",
"void",
"replaceWithNewInstances",
"(",
"Collection",
"<",
"SSTableReader",
">",
"toReplace",
",",
"Collection",
"<",
"SSTableReader",
">",
"replaceWith",
")",
"{",
"replaceReaders",
"(",
"toReplace",
",",
"replaceWith",
",",
"true",
")",
";",
"}"
] | Replaces existing sstables with new instances, makes sure compaction strategies have the correct instance
@param toReplace
@param replaceWith | [
"Replaces",
"existing",
"sstables",
"with",
"new",
"instances",
"makes",
"sure",
"compaction",
"strategies",
"have",
"the",
"correct",
"instance"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/DataTracker.java#L305-L308 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.unexplode | public static void unexplode(File dir, int compressionLevel) {
try {
// Find a new unique name is the same directory
File zip = FileUtils.getTempFileFor(dir);
// Pack it
pack(dir, zip, compressionLevel);
// Delete the directory
FileUtils.deleteDirectory(dir);
// Rename t... | java | public static void unexplode(File dir, int compressionLevel) {
try {
// Find a new unique name is the same directory
File zip = FileUtils.getTempFileFor(dir);
// Pack it
pack(dir, zip, compressionLevel);
// Delete the directory
FileUtils.deleteDirectory(dir);
// Rename t... | [
"public",
"static",
"void",
"unexplode",
"(",
"File",
"dir",
",",
"int",
"compressionLevel",
")",
"{",
"try",
"{",
"// Find a new unique name is the same directory",
"File",
"zip",
"=",
"FileUtils",
".",
"getTempFileFor",
"(",
"dir",
")",
";",
"// Pack it",
"pack"... | Compresses a given directory in its own location.
<p>
A ZIP file will be first created with a temporary name. After the
compressing the directory will be deleted and the ZIP file will be renamed
as the original directory.
@param dir
input directory as well as the target ZIP file.
@param compressionLevel
compression le... | [
"Compresses",
"a",
"given",
"directory",
"in",
"its",
"own",
"location",
".",
"<p",
">",
"A",
"ZIP",
"file",
"will",
"be",
"first",
"created",
"with",
"a",
"temporary",
"name",
".",
"After",
"the",
"compressing",
"the",
"directory",
"will",
"be",
"deleted"... | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L1935-L1952 |
greatman/craftconomy3 | src/main/java/com/greatmancode/craftconomy3/Common.java | Common.alertOldDbVersion | private void alertOldDbVersion(int currentVersion, int newVersion) {
Common.getInstance().sendConsoleMessage(Level.INFO, "Your database is out of date! (Version " + currentVersion + "). Updating it to Revision " + newVersion + ".");
} | java | private void alertOldDbVersion(int currentVersion, int newVersion) {
Common.getInstance().sendConsoleMessage(Level.INFO, "Your database is out of date! (Version " + currentVersion + "). Updating it to Revision " + newVersion + ".");
} | [
"private",
"void",
"alertOldDbVersion",
"(",
"int",
"currentVersion",
",",
"int",
"newVersion",
")",
"{",
"Common",
".",
"getInstance",
"(",
")",
".",
"sendConsoleMessage",
"(",
"Level",
".",
"INFO",
",",
"\"Your database is out of date! (Version \"",
"+",
"currentV... | Alert in the console of a database update.
@param currentVersion The current version
@param newVersion The database update version | [
"Alert",
"in",
"the",
"console",
"of",
"a",
"database",
"update",
"."
] | train | https://github.com/greatman/craftconomy3/blob/51b1b3de7d039e20c7418d1e70b8c4b02b8cf840/src/main/java/com/greatmancode/craftconomy3/Common.java#L1013-L1015 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CreditUrl.java | CreditUrl.resendCreditCreatedEmailUrl | public static MozuUrl resendCreditCreatedEmailUrl(String code, String userId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/credits/{code}/Resend-Email?userId={userId}");
formatter.formatUrl("code", code);
formatter.formatUrl("userId", userId);
return new MozuUrl(formatter.getResourc... | java | public static MozuUrl resendCreditCreatedEmailUrl(String code, String userId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/credits/{code}/Resend-Email?userId={userId}");
formatter.formatUrl("code", code);
formatter.formatUrl("userId", userId);
return new MozuUrl(formatter.getResourc... | [
"public",
"static",
"MozuUrl",
"resendCreditCreatedEmailUrl",
"(",
"String",
"code",
",",
"String",
"userId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/customer/credits/{code}/Resend-Email?userId={userId}\"",
")",
";",
"formatt... | Get Resource Url for ResendCreditCreatedEmail
@param code User-defined code that uniqely identifies the channel group.
@param userId Unique identifier of the user whose tenant scopes you want to retrieve.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"ResendCreditCreatedEmail"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CreditUrl.java#L84-L90 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.isSubtypes | public boolean isSubtypes(List<Type> ts, List<Type> ss) {
while (ts.tail != null && ss.tail != null
/*inlined: ts.nonEmpty() && ss.nonEmpty()*/ &&
isSubtype(ts.head, ss.head)) {
ts = ts.tail;
ss = ss.tail;
}
return ts.tail == null && ss.tail ... | java | public boolean isSubtypes(List<Type> ts, List<Type> ss) {
while (ts.tail != null && ss.tail != null
/*inlined: ts.nonEmpty() && ss.nonEmpty()*/ &&
isSubtype(ts.head, ss.head)) {
ts = ts.tail;
ss = ss.tail;
}
return ts.tail == null && ss.tail ... | [
"public",
"boolean",
"isSubtypes",
"(",
"List",
"<",
"Type",
">",
"ts",
",",
"List",
"<",
"Type",
">",
"ss",
")",
"{",
"while",
"(",
"ts",
".",
"tail",
"!=",
"null",
"&&",
"ss",
".",
"tail",
"!=",
"null",
"/*inlined: ts.nonEmpty() && ss.nonEmpty()*/",
"&... | Are corresponding elements of ts subtypes of ss? If lists are
of different length, return false. | [
"Are",
"corresponding",
"elements",
"of",
"ts",
"subtypes",
"of",
"ss?",
"If",
"lists",
"are",
"of",
"different",
"length",
"return",
"false",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L926-L935 |
mikepenz/Materialize | library/src/main/java/com/mikepenz/materialize/util/UIUtils.java | UIUtils.setTranslucentNavigationFlag | public static void setTranslucentNavigationFlag(Activity activity, boolean on) {
if (Build.VERSION.SDK_INT >= 19) {
setFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, on);
}
} | java | public static void setTranslucentNavigationFlag(Activity activity, boolean on) {
if (Build.VERSION.SDK_INT >= 19) {
setFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, on);
}
} | [
"public",
"static",
"void",
"setTranslucentNavigationFlag",
"(",
"Activity",
"activity",
",",
"boolean",
"on",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"19",
")",
"{",
"setFlag",
"(",
"activity",
",",
"WindowManager",
".",
"LayoutP... | helper method to set the TranslucentNavigationFlag
@param on | [
"helper",
"method",
"to",
"set",
"the",
"TranslucentNavigationFlag"
] | train | https://github.com/mikepenz/Materialize/blob/2612c10c7570191a78d57f23620e945d61370e3d/library/src/main/java/com/mikepenz/materialize/util/UIUtils.java#L211-L215 |
onepf/OpenIAB | library/src/main/java/org/onepf/oms/appstore/googleUtils/Base64.java | Base64.decodeWebSafe | @NotNull
public static byte[] decodeWebSafe(byte[] source, int off, int len)
throws Base64DecoderException {
return decode(source, off, len, WEBSAFE_DECODABET);
} | java | @NotNull
public static byte[] decodeWebSafe(byte[] source, int off, int len)
throws Base64DecoderException {
return decode(source, off, len, WEBSAFE_DECODABET);
} | [
"@",
"NotNull",
"public",
"static",
"byte",
"[",
"]",
"decodeWebSafe",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"Base64DecoderException",
"{",
"return",
"decode",
"(",
"source",
",",
"off",
",",
"len",
",",
... | Decodes web safe Base64 content in byte array format and returns
the decoded byte array.
Web safe encoding uses '-' instead of '+', '_' instead of '/'
@param source the Base64 encoded data
@param off the offset of where to begin decoding
@param len the length of characters to decode
@return decoded data | [
"Decodes",
"web",
"safe",
"Base64",
"content",
"in",
"byte",
"array",
"format",
"and",
"returns",
"the",
"decoded",
"byte",
"array",
".",
"Web",
"safe",
"encoding",
"uses",
"-",
"instead",
"of",
"+",
"_",
"instead",
"of",
"/"
] | train | https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/googleUtils/Base64.java#L514-L518 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java | BusItinerary.insertBusHaltBefore | public BusItineraryHalt insertBusHaltBefore(BusItineraryHalt beforeHalt, UUID id, BusItineraryHaltType type) {
return this.insertBusHaltBefore(beforeHalt, id, null, type);
} | java | public BusItineraryHalt insertBusHaltBefore(BusItineraryHalt beforeHalt, UUID id, BusItineraryHaltType type) {
return this.insertBusHaltBefore(beforeHalt, id, null, type);
} | [
"public",
"BusItineraryHalt",
"insertBusHaltBefore",
"(",
"BusItineraryHalt",
"beforeHalt",
",",
"UUID",
"id",
",",
"BusItineraryHaltType",
"type",
")",
"{",
"return",
"this",
".",
"insertBusHaltBefore",
"(",
"beforeHalt",
",",
"id",
",",
"null",
",",
"type",
")",... | Insert newHalt before beforeHalt in the ordered list of {@link BusItineraryHalt}.
@param beforeHalt the halt where insert the new halt
@param id id of the new halt
@param type the type of bus halt
@return the added bus halt, otherwise <code>null</code> | [
"Insert",
"newHalt",
"before",
"beforeHalt",
"in",
"the",
"ordered",
"list",
"of",
"{",
"@link",
"BusItineraryHalt",
"}",
".",
"@param",
"beforeHalt",
"the",
"halt",
"where",
"insert",
"the",
"new",
"halt",
"@param",
"id",
"id",
"of",
"the",
"new",
"halt",
... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L1248-L1250 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/CatalogUtil.java | CatalogUtil.getAutoGenDDLFromJar | public static String getAutoGenDDLFromJar(InMemoryJarfile jarfile)
throws IOException
{
// Read the raw auto generated ddl bytes.
byte[] ddlBytes = jarfile.get(VoltCompiler.AUTOGEN_DDL_FILE_NAME);
if (ddlBytes == null) {
throw new IOException("Auto generated schema DD... | java | public static String getAutoGenDDLFromJar(InMemoryJarfile jarfile)
throws IOException
{
// Read the raw auto generated ddl bytes.
byte[] ddlBytes = jarfile.get(VoltCompiler.AUTOGEN_DDL_FILE_NAME);
if (ddlBytes == null) {
throw new IOException("Auto generated schema DD... | [
"public",
"static",
"String",
"getAutoGenDDLFromJar",
"(",
"InMemoryJarfile",
"jarfile",
")",
"throws",
"IOException",
"{",
"// Read the raw auto generated ddl bytes.",
"byte",
"[",
"]",
"ddlBytes",
"=",
"jarfile",
".",
"get",
"(",
"VoltCompiler",
".",
"AUTOGEN_DDL_FILE... | Get the auto generated DDL from the catalog jar.
@param jarfile in-memory catalog jar file
@return Auto generated DDL stored in catalog.jar
@throws IOException If the catalog or the auto generated ddl cannot be loaded. | [
"Get",
"the",
"auto",
"generated",
"DDL",
"from",
"the",
"catalog",
"jar",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/CatalogUtil.java#L337-L347 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java | RTFEmbeddedObject.readDataBlock | private static int readDataBlock(String text, int offset, int length, List<byte[]> blocks)
{
int bytes = length / 2;
byte[] data = new byte[bytes];
for (int index = 0; index < bytes; index++)
{
data[index] = (byte) Integer.parseInt(text.substring(offset, offset + 2), 16);
o... | java | private static int readDataBlock(String text, int offset, int length, List<byte[]> blocks)
{
int bytes = length / 2;
byte[] data = new byte[bytes];
for (int index = 0; index < bytes; index++)
{
data[index] = (byte) Integer.parseInt(text.substring(offset, offset + 2), 16);
o... | [
"private",
"static",
"int",
"readDataBlock",
"(",
"String",
"text",
",",
"int",
"offset",
",",
"int",
"length",
",",
"List",
"<",
"byte",
"[",
"]",
">",
"blocks",
")",
"{",
"int",
"bytes",
"=",
"length",
"/",
"2",
";",
"byte",
"[",
"]",
"data",
"="... | Reads a data block and adds it to the list of blocks.
@param text RTF data
@param offset current offset
@param length next block length
@param blocks list of blocks
@return next offset | [
"Reads",
"a",
"data",
"block",
"and",
"adds",
"it",
"to",
"the",
"list",
"of",
"blocks",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java#L369-L382 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/up/SignupFormPanel.java | SignupFormPanel.newForm | @SuppressWarnings({ "unchecked", "rawtypes" })
protected Form<?> newForm(final String id,
final IModel<? extends BaseUsernameSignUpModel> model)
{
return new Form(id, model);
} | java | @SuppressWarnings({ "unchecked", "rawtypes" })
protected Form<?> newForm(final String id,
final IModel<? extends BaseUsernameSignUpModel> model)
{
return new Form(id, model);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"protected",
"Form",
"<",
"?",
">",
"newForm",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"?",
"extends",
"BaseUsernameSignUpModel",
">",
"model",
")",
"{",
... | Factory method for creating the Form. This method is invoked in the constructor from the
derived classes and can be overridden so users can provide their own version of a Form.
@param id
the id
@param model
the model
@return the form | [
"Factory",
"method",
"for",
"creating",
"the",
"Form",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"their",
"own",
"version",
"of"... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/up/SignupFormPanel.java#L155-L160 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java | ClusterControllerClient.getCluster | public final Cluster getCluster(String projectId, String region, String clusterName) {
GetClusterRequest request =
GetClusterRequest.newBuilder()
.setProjectId(projectId)
.setRegion(region)
.setClusterName(clusterName)
.build();
return getCluster(request)... | java | public final Cluster getCluster(String projectId, String region, String clusterName) {
GetClusterRequest request =
GetClusterRequest.newBuilder()
.setProjectId(projectId)
.setRegion(region)
.setClusterName(clusterName)
.build();
return getCluster(request)... | [
"public",
"final",
"Cluster",
"getCluster",
"(",
"String",
"projectId",
",",
"String",
"region",
",",
"String",
"clusterName",
")",
"{",
"GetClusterRequest",
"request",
"=",
"GetClusterRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
... | Gets the resource representation for a cluster in a project.
<p>Sample code:
<pre><code>
try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
String projectId = "";
String region = "";
String clusterName = "";
Cluster response = clusterControllerClient.getCluster(projectId, regio... | [
"Gets",
"the",
"resource",
"representation",
"for",
"a",
"cluster",
"in",
"a",
"project",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java#L593-L602 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataPropertyDomainAxiomImpl_CustomFieldSerializer.java | OWLDataPropertyDomainAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataPropertyDomainAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDataPropertyDomainAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLDataPropertyDomainAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataPropertyDomainAxiomImpl_CustomFieldSerializer.java#L76-L79 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/DojoHttpTransport.java | DojoHttpTransport.endResponse | protected String endResponse(HttpServletRequest request, Object arg) {
String result = ""; //$NON-NLS-1$
@SuppressWarnings("unchecked")
Set<String> requiredModules = (Set<String>)request.getAttribute(ADD_REQUIRE_DEPS_REQATTRNAME);
if (requiredModules != null && !requiredModules.isEmpty()) {
// issue a r... | java | protected String endResponse(HttpServletRequest request, Object arg) {
String result = ""; //$NON-NLS-1$
@SuppressWarnings("unchecked")
Set<String> requiredModules = (Set<String>)request.getAttribute(ADD_REQUIRE_DEPS_REQATTRNAME);
if (requiredModules != null && !requiredModules.isEmpty()) {
// issue a r... | [
"protected",
"String",
"endResponse",
"(",
"HttpServletRequest",
"request",
",",
"Object",
"arg",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"//$NON-NLS-1$\r",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Set",
"<",
"String",
">",
"requiredModules",
... | Handles the
{@link com.ibm.jaggr.core.transport.IHttpTransport.LayerContributionType#END_RESPONSE} layer
listener event
@param request
the http request object
@param arg
null
@return the layer contribution | [
"Handles",
"the",
"{",
"@link",
"com",
".",
"ibm",
".",
"jaggr",
".",
"core",
".",
"transport",
".",
"IHttpTransport",
".",
"LayerContributionType#END_RESPONSE",
"}",
"layer",
"listener",
"event"
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/transport/DojoHttpTransport.java#L410-L426 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/DFSAdmin.java | DFSAdmin.refreshNamenodes | public int refreshNamenodes(String[] argv, int i) throws IOException {
ClientDatanodeProtocol datanode = null;
String dnAddr = (argv.length == 2) ? argv[i] : null;
try {
datanode = getClientDatanodeProtocol(dnAddr);
if (datanode != null) {
datanode.refreshNamenodes();
retu... | java | public int refreshNamenodes(String[] argv, int i) throws IOException {
ClientDatanodeProtocol datanode = null;
String dnAddr = (argv.length == 2) ? argv[i] : null;
try {
datanode = getClientDatanodeProtocol(dnAddr);
if (datanode != null) {
datanode.refreshNamenodes();
retu... | [
"public",
"int",
"refreshNamenodes",
"(",
"String",
"[",
"]",
"argv",
",",
"int",
"i",
")",
"throws",
"IOException",
"{",
"ClientDatanodeProtocol",
"datanode",
"=",
"null",
";",
"String",
"dnAddr",
"=",
"(",
"argv",
".",
"length",
"==",
"2",
")",
"?",
"a... | Refresh the namenodes served by the {@link DataNode}.
Usage: java DFSAdmin -refreshNamenodes datanodehost:port
@param argv List of of command line parameters.
@param idx The index of the command that is being processed.
@exception IOException if an error accoured wile accessing
the file or path.
@return exitcode 0 on s... | [
"Refresh",
"the",
"namenodes",
"served",
"by",
"the",
"{"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/DFSAdmin.java#L832-L848 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfStream.java | PdfStream.writeLength | public void writeLength() throws IOException {
if (inputStream == null)
throw new UnsupportedOperationException("writeLength() can only be called in a contructed PdfStream(InputStream,PdfWriter).");
if (inputStreamLength == -1)
throw new IOException("writeLength() can only be cal... | java | public void writeLength() throws IOException {
if (inputStream == null)
throw new UnsupportedOperationException("writeLength() can only be called in a contructed PdfStream(InputStream,PdfWriter).");
if (inputStreamLength == -1)
throw new IOException("writeLength() can only be cal... | [
"public",
"void",
"writeLength",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"inputStream",
"==",
"null",
")",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"writeLength() can only be called in a contructed PdfStream(InputStream,PdfWriter).\"",
")",
";",
"i... | Writes the stream length to the <CODE>PdfWriter</CODE>.
<p>
This method must be called and can only be called if the constructor {@link #PdfStream(InputStream,PdfWriter)}
is used to create the stream.
@throws IOException on error
@see #PdfStream(InputStream,PdfWriter) | [
"Writes",
"the",
"stream",
"length",
"to",
"the",
"<CODE",
">",
"PdfWriter<",
"/",
"CODE",
">",
".",
"<p",
">",
"This",
"method",
"must",
"be",
"called",
"and",
"can",
"only",
"be",
"called",
"if",
"the",
"constructor",
"{"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfStream.java#L186-L192 |
strator-dev/greenpepper | samples-application/src/main/java/com/greenpepper/samples/application/phonebook/Country.java | Country.addState | public void addState(String name, String code)
{
states.add(new State(this, name, code));
} | java | public void addState(String name, String code)
{
states.add(new State(this, name, code));
} | [
"public",
"void",
"addState",
"(",
"String",
"name",
",",
"String",
"code",
")",
"{",
"states",
".",
"add",
"(",
"new",
"State",
"(",
"this",
",",
"name",
",",
"code",
")",
")",
";",
"}"
] | <p>addState.</p>
@param name a {@link java.lang.String} object.
@param code a {@link java.lang.String} object. | [
"<p",
">",
"addState",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/samples-application/src/main/java/com/greenpepper/samples/application/phonebook/Country.java#L107-L110 |
lamydev/Android-Notification | core/src/zemin/notification/NotificationBoard.java | NotificationBoard.setBoardPadding | public void setBoardPadding(int l, int t, int r, int b) {
mContentView.setPadding(l, t, r, b);
} | java | public void setBoardPadding(int l, int t, int r, int b) {
mContentView.setPadding(l, t, r, b);
} | [
"public",
"void",
"setBoardPadding",
"(",
"int",
"l",
",",
"int",
"t",
",",
"int",
"r",
",",
"int",
"b",
")",
"{",
"mContentView",
".",
"setPadding",
"(",
"l",
",",
"t",
",",
"r",
",",
"b",
")",
";",
"}"
] | Set the margin of the entire board.
@param l
@param t
@param r
@param b | [
"Set",
"the",
"margin",
"of",
"the",
"entire",
"board",
"."
] | train | https://github.com/lamydev/Android-Notification/blob/6d6571d2862cb6edbacf9a78125418f7d621c3f8/core/src/zemin/notification/NotificationBoard.java#L1087-L1089 |
anotheria/moskito | moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java | AbstractInterceptor.getProducer | protected final OnDemandStatsProducer getProducer(Class producerClass, String producerId, String category, String subsystem, boolean tracingSupported){
OnDemandStatsProducer<T> producer = (OnDemandStatsProducer<T>) ProducerRegistryFactory.getProducerRegistryInstance().getProducer(producerId);
if (produ... | java | protected final OnDemandStatsProducer getProducer(Class producerClass, String producerId, String category, String subsystem, boolean tracingSupported){
OnDemandStatsProducer<T> producer = (OnDemandStatsProducer<T>) ProducerRegistryFactory.getProducerRegistryInstance().getProducer(producerId);
if (produ... | [
"protected",
"final",
"OnDemandStatsProducer",
"getProducer",
"(",
"Class",
"producerClass",
",",
"String",
"producerId",
",",
"String",
"category",
",",
"String",
"subsystem",
",",
"boolean",
"tracingSupported",
")",
"{",
"OnDemandStatsProducer",
"<",
"T",
">",
"pr... | Returns {@link OnDemandStatsProducer}.
@param producerClass producer class
@param producerId producer id
@param category category
@param subsystem subsystem
@param tracingSupported is tracing supported
@return {@link OnDemandStatsProducer} | [
"Returns",
"{",
"@link",
"OnDemandStatsProducer",
"}",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java#L58-L80 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_tcp_farm_farmId_PUT | public void serviceName_tcp_farm_farmId_PUT(String serviceName, Long farmId, OvhBackendTcp body) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/tcp/farm/{farmId}";
StringBuilder sb = path(qPath, serviceName, farmId);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void serviceName_tcp_farm_farmId_PUT(String serviceName, Long farmId, OvhBackendTcp body) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/tcp/farm/{farmId}";
StringBuilder sb = path(qPath, serviceName, farmId);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_tcp_farm_farmId_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"farmId",
",",
"OvhBackendTcp",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/tcp/farm/{farmId}\"",
";",
"StringBuilder",
... | Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}
@param body [required] New object properties
@param serviceName [required] The internal name of your IP load balancing
@param farmId [required] Id of your farm | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1584-L1588 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagInclude.java | CmsJspTagInclude.includeTagAction | public static void includeTagAction(
PageContext context,
String target,
String element,
boolean editable,
Map<String, String[]> paramMap,
Map<String, Object> attrMap,
ServletRequest req,
ServletResponse res)
throws JspException {
// no locale... | java | public static void includeTagAction(
PageContext context,
String target,
String element,
boolean editable,
Map<String, String[]> paramMap,
Map<String, Object> attrMap,
ServletRequest req,
ServletResponse res)
throws JspException {
// no locale... | [
"public",
"static",
"void",
"includeTagAction",
"(",
"PageContext",
"context",
",",
"String",
"target",
",",
"String",
"element",
",",
"boolean",
"editable",
",",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"paramMap",
",",
"Map",
"<",
"String",
",... | Includes the selected target.<p>
@param context the current JSP page context
@param target the target for the include, might be <code>null</code>
@param element the element to select form the target might be <code>null</code>
@param editable flag to indicate if the target is editable
@param paramMap a map of parameter... | [
"Includes",
"the",
"selected",
"target",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagInclude.java#L156-L169 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/util/Util.java | Util.loadKeyStore | public static KeyStore loadKeyStore(File file, String password) throws KSIException {
notNull(file, "Trust store file");
FileInputStream input = null;
KeyStore keyStore = null;
try {
keyStore = KeyStore.getInstance("JKS");
char[] passwordCharArray = password == nu... | java | public static KeyStore loadKeyStore(File file, String password) throws KSIException {
notNull(file, "Trust store file");
FileInputStream input = null;
KeyStore keyStore = null;
try {
keyStore = KeyStore.getInstance("JKS");
char[] passwordCharArray = password == nu... | [
"public",
"static",
"KeyStore",
"loadKeyStore",
"(",
"File",
"file",
",",
"String",
"password",
")",
"throws",
"KSIException",
"{",
"notNull",
"(",
"file",
",",
"\"Trust store file\"",
")",
";",
"FileInputStream",
"input",
"=",
"null",
";",
"KeyStore",
"keyStore... | Loads and returns the {@link java.security.KeyStore} from the file system.
@param file file to load from file system.
@param password password to access the keystore.
@return {@link java.security.KeyStore}
@throws KSIException | [
"Loads",
"and",
"returns",
"the",
"{",
"@link",
"java",
".",
"security",
".",
"KeyStore",
"}",
"from",
"the",
"file",
"system",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/util/Util.java#L782-L797 |
elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkcop/MkCoPTreeNode.java | MkCoPTreeNode.conservativeKnnDistanceApproximation | protected ApproximationLine conservativeKnnDistanceApproximation(int k_max) {
// determine k_0, y_1, y_kmax
int k_0 = k_max;
double y_1 = Double.NEGATIVE_INFINITY;
double y_kmax = Double.NEGATIVE_INFINITY;
for(int i = 0; i < getNumEntries(); i++) {
MkCoPEntry entry = getEntry(i);
Approx... | java | protected ApproximationLine conservativeKnnDistanceApproximation(int k_max) {
// determine k_0, y_1, y_kmax
int k_0 = k_max;
double y_1 = Double.NEGATIVE_INFINITY;
double y_kmax = Double.NEGATIVE_INFINITY;
for(int i = 0; i < getNumEntries(); i++) {
MkCoPEntry entry = getEntry(i);
Approx... | [
"protected",
"ApproximationLine",
"conservativeKnnDistanceApproximation",
"(",
"int",
"k_max",
")",
"{",
"// determine k_0, y_1, y_kmax",
"int",
"k_0",
"=",
"k_max",
";",
"double",
"y_1",
"=",
"Double",
".",
"NEGATIVE_INFINITY",
";",
"double",
"y_kmax",
"=",
"Double",... | Determines and returns the conservative approximation for the knn distances
of this node as the maximum of the conservative approximations of all
entries.
@param k_max the maximum k parameter
@return the conservative approximation for the knn distances | [
"Determines",
"and",
"returns",
"the",
"conservative",
"approximation",
"for",
"the",
"knn",
"distances",
"of",
"this",
"node",
"as",
"the",
"maximum",
"of",
"the",
"conservative",
"approximations",
"of",
"all",
"entries",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkcop/MkCoPTreeNode.java#L70-L101 |
glookast/commons-timecode | src/main/java/com/glookast/commons/timecode/AbstractTimecode.java | AbstractTimecode.calculateInPoint | public static Timecode calculateInPoint(Timecode outPoint, TimecodeDuration duration)
{
if (!outPoint.isCompatible(duration)) {
MutableTimecodeDuration mutableTimecodeDuration = new MutableTimecodeDuration(duration);
mutableTimecodeDuration.setTimecodeBase(outPoint.getTimecodeBase())... | java | public static Timecode calculateInPoint(Timecode outPoint, TimecodeDuration duration)
{
if (!outPoint.isCompatible(duration)) {
MutableTimecodeDuration mutableTimecodeDuration = new MutableTimecodeDuration(duration);
mutableTimecodeDuration.setTimecodeBase(outPoint.getTimecodeBase())... | [
"public",
"static",
"Timecode",
"calculateInPoint",
"(",
"Timecode",
"outPoint",
",",
"TimecodeDuration",
"duration",
")",
"{",
"if",
"(",
"!",
"outPoint",
".",
"isCompatible",
"(",
"duration",
")",
")",
"{",
"MutableTimecodeDuration",
"mutableTimecodeDuration",
"="... | Calculates inPoint of a given outPoint and duration.
In case duration does not have the same Timecode base and/or dropFrame flag
it will convert it to the same Timecode base and dropFrame flag of the outPoint
@param outPoint
@param duration
@return inPoint | [
"Calculates",
"inPoint",
"of",
"a",
"given",
"outPoint",
"and",
"duration",
".",
"In",
"case",
"duration",
"does",
"not",
"have",
"the",
"same",
"Timecode",
"base",
"and",
"/",
"or",
"dropFrame",
"flag",
"it",
"will",
"convert",
"it",
"to",
"the",
"same",
... | train | https://github.com/glookast/commons-timecode/blob/ec2f682a51d1cc435d0b42d80de48ff15adb4ee8/src/main/java/com/glookast/commons/timecode/AbstractTimecode.java#L612-L624 |
sculptor/sculptor | sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java | JpaHelper.createResultCountQuery | public static String createResultCountQuery(String query) {
String resultCountQueryString = null;
int select = query.toLowerCase().indexOf("select");
int from = query.toLowerCase().indexOf("from");
if (select == -1 || from == -1) {
return null;
}
re... | java | public static String createResultCountQuery(String query) {
String resultCountQueryString = null;
int select = query.toLowerCase().indexOf("select");
int from = query.toLowerCase().indexOf("from");
if (select == -1 || from == -1) {
return null;
}
re... | [
"public",
"static",
"String",
"createResultCountQuery",
"(",
"String",
"query",
")",
"{",
"String",
"resultCountQueryString",
"=",
"null",
";",
"int",
"select",
"=",
"query",
".",
"toLowerCase",
"(",
")",
".",
"indexOf",
"(",
"\"select\"",
")",
";",
"int",
"... | Build a query based on the original query to count results
@param query
@return | [
"Build",
"a",
"query",
"based",
"on",
"the",
"original",
"query",
"to",
"count",
"results"
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-framework/sculptor-framework-main/src/main/java/org/sculptor/framework/accessimpl/jpa/JpaHelper.java#L257-L276 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/clientlibs/servlet/ClientlibCategoryServlet.java | ClientlibCategoryServlet.makePath | public static String makePath(String category, Clientlib.Type type, boolean minified, String hash) {
StringBuilder buf = new StringBuilder(PATH);
if (minified) buf.append(".min");
buf.append(".").append(type.name());
if (null != hash) {
buf.append("/").append(hash);
}... | java | public static String makePath(String category, Clientlib.Type type, boolean minified, String hash) {
StringBuilder buf = new StringBuilder(PATH);
if (minified) buf.append(".min");
buf.append(".").append(type.name());
if (null != hash) {
buf.append("/").append(hash);
}... | [
"public",
"static",
"String",
"makePath",
"(",
"String",
"category",
",",
"Clientlib",
".",
"Type",
"type",
",",
"boolean",
"minified",
",",
"String",
"hash",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"PATH",
")",
";",
"if",
"(",
... | Creates an path that is rendered by this servlet containing the given parameters. | [
"Creates",
"an",
"path",
"that",
"is",
"rendered",
"by",
"this",
"servlet",
"containing",
"the",
"given",
"parameters",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/clientlibs/servlet/ClientlibCategoryServlet.java#L40-L50 |
liferay/com-liferay-commerce | commerce-tax-api/src/main/java/com/liferay/commerce/tax/model/CommerceTaxMethodWrapper.java | CommerceTaxMethodWrapper.setNameMap | @Override
public void setNameMap(Map<java.util.Locale, String> nameMap) {
_commerceTaxMethod.setNameMap(nameMap);
} | java | @Override
public void setNameMap(Map<java.util.Locale, String> nameMap) {
_commerceTaxMethod.setNameMap(nameMap);
} | [
"@",
"Override",
"public",
"void",
"setNameMap",
"(",
"Map",
"<",
"java",
".",
"util",
".",
"Locale",
",",
"String",
">",
"nameMap",
")",
"{",
"_commerceTaxMethod",
".",
"setNameMap",
"(",
"nameMap",
")",
";",
"}"
] | Sets the localized names of this commerce tax method from the map of locales and localized names.
@param nameMap the locales and localized names of this commerce tax method | [
"Sets",
"the",
"localized",
"names",
"of",
"this",
"commerce",
"tax",
"method",
"from",
"the",
"map",
"of",
"locales",
"and",
"localized",
"names",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-api/src/main/java/com/liferay/commerce/tax/model/CommerceTaxMethodWrapper.java#L709-L712 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.createSingle | public static IDLProxyObject createSingle(InputStream is, boolean debug, boolean isUniName) throws IOException {
return createSingle(is, debug, null, isUniName);
} | java | public static IDLProxyObject createSingle(InputStream is, boolean debug, boolean isUniName) throws IOException {
return createSingle(is, debug, null, isUniName);
} | [
"public",
"static",
"IDLProxyObject",
"createSingle",
"(",
"InputStream",
"is",
",",
"boolean",
"debug",
",",
"boolean",
"isUniName",
")",
"throws",
"IOException",
"{",
"return",
"createSingle",
"(",
"is",
",",
"debug",
",",
"null",
",",
"isUniName",
")",
";",... | Creates the single.
@param is the is
@param debug the debug
@param isUniName the is uni name
@return the IDL proxy object
@throws IOException Signals that an I/O exception has occurred. | [
"Creates",
"the",
"single",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L989-L991 |
azkaban/azkaban | az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaEventMonitor.java | KafkaEventMonitor.triggerDependencies | private void triggerDependencies(final Set<String> matchedList, final ConsumerRecord<String, String> record) {
final List<KafkaDependencyInstanceContext> deleteList = new LinkedList<>();
for (final String it : matchedList) {
final List<KafkaDependencyInstanceContext> possibleAvailableDeps =
this... | java | private void triggerDependencies(final Set<String> matchedList, final ConsumerRecord<String, String> record) {
final List<KafkaDependencyInstanceContext> deleteList = new LinkedList<>();
for (final String it : matchedList) {
final List<KafkaDependencyInstanceContext> possibleAvailableDeps =
this... | [
"private",
"void",
"triggerDependencies",
"(",
"final",
"Set",
"<",
"String",
">",
"matchedList",
",",
"final",
"ConsumerRecord",
"<",
"String",
",",
"String",
">",
"record",
")",
"{",
"final",
"List",
"<",
"KafkaDependencyInstanceContext",
">",
"deleteList",
"=... | If the matcher returns true, remove the dependency from collection. | [
"If",
"the",
"matcher",
"returns",
"true",
"remove",
"the",
"dependency",
"from",
"collection",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-flow-trigger-dependency-type/kafka-event-trigger/src/main/java/trigger/kafka/KafkaEventMonitor.java#L149-L163 |
cojen/Cojen | src/main/java/org/cojen/classfile/ConstantPool.java | ConstantPool.addConstantNameAndType | public ConstantNameAndTypeInfo addConstantNameAndType(String name,
Descriptor type) {
return (ConstantNameAndTypeInfo)addConstant(new ConstantNameAndTypeInfo(this, name, type));
} | java | public ConstantNameAndTypeInfo addConstantNameAndType(String name,
Descriptor type) {
return (ConstantNameAndTypeInfo)addConstant(new ConstantNameAndTypeInfo(this, name, type));
} | [
"public",
"ConstantNameAndTypeInfo",
"addConstantNameAndType",
"(",
"String",
"name",
",",
"Descriptor",
"type",
")",
"{",
"return",
"(",
"ConstantNameAndTypeInfo",
")",
"addConstant",
"(",
"new",
"ConstantNameAndTypeInfo",
"(",
"this",
",",
"name",
",",
"type",
")"... | Get or create a constant name and type structure from the constant pool. | [
"Get",
"or",
"create",
"a",
"constant",
"name",
"and",
"type",
"structure",
"from",
"the",
"constant",
"pool",
"."
] | train | https://github.com/cojen/Cojen/blob/ddee9a0fde83870b97e0ed04c58270aa665f3a62/src/main/java/org/cojen/classfile/ConstantPool.java#L235-L238 |
alipay/sofa-rpc | extension-impl/registry-local/src/main/java/com/alipay/sofa/rpc/registry/local/LocalRegistryHelper.java | LocalRegistryHelper.checkModified | public static boolean checkModified(String address, String lastDigest) {
// 检查文件是否被修改了
String newDigest = calMD5Checksum(address);
return !StringUtils.equals(newDigest, lastDigest);
} | java | public static boolean checkModified(String address, String lastDigest) {
// 检查文件是否被修改了
String newDigest = calMD5Checksum(address);
return !StringUtils.equals(newDigest, lastDigest);
} | [
"public",
"static",
"boolean",
"checkModified",
"(",
"String",
"address",
",",
"String",
"lastDigest",
")",
"{",
"// 检查文件是否被修改了",
"String",
"newDigest",
"=",
"calMD5Checksum",
"(",
"address",
")",
";",
"return",
"!",
"StringUtils",
".",
"equals",
"(",
"newDigest... | Check file's digest.
@param address the address
@param lastDigest the update digest
@return true被修改,false未被修改 | [
"Check",
"file",
"s",
"digest",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-local/src/main/java/com/alipay/sofa/rpc/registry/local/LocalRegistryHelper.java#L72-L76 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizationTree.java | VisualizationTree.setVisible | public static void setVisible(VisualizerContext context, VisualizationTask task, boolean visibility) {
// Hide other tools
if(visibility && task.isTool()) {
Hierarchy<Object> vistree = context.getVisHierarchy();
for(It<VisualizationTask> iter2 = vistree.iterAll().filter(VisualizationTask.class); ite... | java | public static void setVisible(VisualizerContext context, VisualizationTask task, boolean visibility) {
// Hide other tools
if(visibility && task.isTool()) {
Hierarchy<Object> vistree = context.getVisHierarchy();
for(It<VisualizationTask> iter2 = vistree.iterAll().filter(VisualizationTask.class); ite... | [
"public",
"static",
"void",
"setVisible",
"(",
"VisualizerContext",
"context",
",",
"VisualizationTask",
"task",
",",
"boolean",
"visibility",
")",
"{",
"// Hide other tools",
"if",
"(",
"visibility",
"&&",
"task",
".",
"isTool",
"(",
")",
")",
"{",
"Hierarchy",... | Utility function to change Visualizer visibility.
@param context Visualization context
@param task Visualization task
@param visibility Visibility value | [
"Utility",
"function",
"to",
"change",
"Visualizer",
"visibility",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizationTree.java#L221-L233 |
apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/DefaultESClientFactory.java | DefaultESClientFactory.updateHttpConfig | protected void updateHttpConfig(Builder httpClientConfig, Map<String, String> config) {
String username = config.get("client.username"); //$NON-NLS-1$
String password = config.get("client.password"); //$NON-NLS-1$
String timeout = config.get("client.timeout"); //$NON-NLS-1$
if (StringUti... | java | protected void updateHttpConfig(Builder httpClientConfig, Map<String, String> config) {
String username = config.get("client.username"); //$NON-NLS-1$
String password = config.get("client.password"); //$NON-NLS-1$
String timeout = config.get("client.timeout"); //$NON-NLS-1$
if (StringUti... | [
"protected",
"void",
"updateHttpConfig",
"(",
"Builder",
"httpClientConfig",
",",
"Map",
"<",
"String",
",",
"String",
">",
"config",
")",
"{",
"String",
"username",
"=",
"config",
".",
"get",
"(",
"\"client.username\"",
")",
";",
"//$NON-NLS-1$",
"String",
"p... | Update the http client config.
@param httpClientConfig
@param config | [
"Update",
"the",
"http",
"client",
"config",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/DefaultESClientFactory.java#L133-L154 |
dkpro/dkpro-argumentation | dkpro-argumentation-preprocessing/src/main/java/org/dkpro/argumentation/preprocessing/annotation/ArgumentTokenBIOAnnotator.java | ArgumentTokenBIOAnnotator.getLabel | protected String getLabel(ArgumentComponent argumentComponent, Token token)
{
StringBuilder sb = new StringBuilder(argumentComponent.getClass().getSimpleName());
if ("BIO".equals(this.codingGranularity)) {
// Does the component begin here?
if (argumentComponent.getBegin() ==... | java | protected String getLabel(ArgumentComponent argumentComponent, Token token)
{
StringBuilder sb = new StringBuilder(argumentComponent.getClass().getSimpleName());
if ("BIO".equals(this.codingGranularity)) {
// Does the component begin here?
if (argumentComponent.getBegin() ==... | [
"protected",
"String",
"getLabel",
"(",
"ArgumentComponent",
"argumentComponent",
",",
"Token",
"token",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"argumentComponent",
".",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
")",
";",
... | Returns a label for the annotated token
@param argumentComponent covering argument component
@param token token
@return BIO label | [
"Returns",
"a",
"label",
"for",
"the",
"annotated",
"token"
] | train | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-preprocessing/src/main/java/org/dkpro/argumentation/preprocessing/annotation/ArgumentTokenBIOAnnotator.java#L69-L87 |
joniles/mpxj | src/main/java/net/sf/mpxj/fasttrack/FastTrackData.java | FastTrackData.readColumn | private void readColumn(int startIndex, int length) throws Exception
{
if (m_currentTable != null)
{
int value = FastTrackUtility.getByte(m_buffer, startIndex);
Class<?> klass = COLUMN_MAP[value];
if (klass == null)
{
klass = UnknownColumn.class;
}... | java | private void readColumn(int startIndex, int length) throws Exception
{
if (m_currentTable != null)
{
int value = FastTrackUtility.getByte(m_buffer, startIndex);
Class<?> klass = COLUMN_MAP[value];
if (klass == null)
{
klass = UnknownColumn.class;
}... | [
"private",
"void",
"readColumn",
"(",
"int",
"startIndex",
",",
"int",
"length",
")",
"throws",
"Exception",
"{",
"if",
"(",
"m_currentTable",
"!=",
"null",
")",
"{",
"int",
"value",
"=",
"FastTrackUtility",
".",
"getByte",
"(",
"m_buffer",
",",
"startIndex"... | Read data for a single column.
@param startIndex block start
@param length block length | [
"Read",
"data",
"for",
"a",
"single",
"column",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/fasttrack/FastTrackData.java#L232-L266 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java | PacketCapturesInner.beginCreateAsync | public Observable<PacketCaptureResultInner> beginCreateAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).map(new Func1<ServiceRespo... | java | public Observable<PacketCaptureResultInner> beginCreateAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).map(new Func1<ServiceRespo... | [
"public",
"Observable",
"<",
"PacketCaptureResultInner",
">",
"beginCreateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"packetCaptureName",
",",
"PacketCaptureInner",
"parameters",
")",
"{",
"return",
"beginCreateWithServic... | Create and start a packet capture on the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param packetCaptureName The name of the packet capture session.
@param parameters Parameters that define the create packet capture operation.
@thro... | [
"Create",
"and",
"start",
"a",
"packet",
"capture",
"on",
"the",
"specified",
"VM",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java#L229-L236 |
aws/aws-sdk-java | aws-java-sdk-iot1clickprojects/src/main/java/com/amazonaws/services/iot1clickprojects/model/GetDevicesInPlacementResult.java | GetDevicesInPlacementResult.withDevices | public GetDevicesInPlacementResult withDevices(java.util.Map<String, String> devices) {
setDevices(devices);
return this;
} | java | public GetDevicesInPlacementResult withDevices(java.util.Map<String, String> devices) {
setDevices(devices);
return this;
} | [
"public",
"GetDevicesInPlacementResult",
"withDevices",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"devices",
")",
"{",
"setDevices",
"(",
"devices",
")",
";",
"return",
"this",
";",
"}"
] | <p>
An object containing the devices (zero or more) within the placement.
</p>
@param devices
An object containing the devices (zero or more) within the placement.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"An",
"object",
"containing",
"the",
"devices",
"(",
"zero",
"or",
"more",
")",
"within",
"the",
"placement",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot1clickprojects/src/main/java/com/amazonaws/services/iot1clickprojects/model/GetDevicesInPlacementResult.java#L68-L71 |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/views/filters/TwoValuesToggle.java | TwoValuesToggle.setValueOn | public void setValueOn(String newValue, @Nullable String newName) {
if (isChecked()) { // refining on valueOn: facetRefinement needs an update
searcher.updateFacetRefinement(attribute, valueOn, false)
.updateFacetRefinement(newName != null ? newName : attribute, newValue, true)
... | java | public void setValueOn(String newValue, @Nullable String newName) {
if (isChecked()) { // refining on valueOn: facetRefinement needs an update
searcher.updateFacetRefinement(attribute, valueOn, false)
.updateFacetRefinement(newName != null ? newName : attribute, newValue, true)
... | [
"public",
"void",
"setValueOn",
"(",
"String",
"newValue",
",",
"@",
"Nullable",
"String",
"newName",
")",
"{",
"if",
"(",
"isChecked",
"(",
")",
")",
"{",
"// refining on valueOn: facetRefinement needs an update",
"searcher",
".",
"updateFacetRefinement",
"(",
"att... | Changes the Toggle's valueOn, updating facet refinements accordingly.
@param newValue valueOn's new value.
@param newName an eventual new attribute name. | [
"Changes",
"the",
"Toggle",
"s",
"valueOn",
"updating",
"facet",
"refinements",
"accordingly",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/views/filters/TwoValuesToggle.java#L60-L68 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/TLSSyslogSenderImpl.java | TLSSyslogSenderImpl.getTLSSocket | private Socket getTLSSocket(InetAddress destination, int port) throws Exception
{
String key = destination.getHostAddress() + ":" + port;
synchronized (socketMap){
Socket socket = socketMap.get(key);
if (socket == null){
// create a new one
NodeAuthModuleContext nodeAuthContext = NodeAuthModuleContex... | java | private Socket getTLSSocket(InetAddress destination, int port) throws Exception
{
String key = destination.getHostAddress() + ":" + port;
synchronized (socketMap){
Socket socket = socketMap.get(key);
if (socket == null){
// create a new one
NodeAuthModuleContext nodeAuthContext = NodeAuthModuleContex... | [
"private",
"Socket",
"getTLSSocket",
"(",
"InetAddress",
"destination",
",",
"int",
"port",
")",
"throws",
"Exception",
"{",
"String",
"key",
"=",
"destination",
".",
"getHostAddress",
"(",
")",
"+",
"\":\"",
"+",
"port",
";",
"synchronized",
"(",
"socketMap",... | Gets the socket tied to the address and port for this transport
@param port Port to check
@return Port to use | [
"Gets",
"the",
"socket",
"tied",
"to",
"the",
"address",
"and",
"port",
"for",
"this",
"transport"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/sender/TLSSyslogSenderImpl.java#L171-L189 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ContainerServicesInner.java | ContainerServicesInner.createOrUpdateAsync | public Observable<ContainerServiceInner> createOrUpdateAsync(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerServiceName, parameters).map(new Func1<ServiceResponse<ContainerServiceInner>, Contain... | java | public Observable<ContainerServiceInner> createOrUpdateAsync(String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerServiceName, parameters).map(new Func1<ServiceResponse<ContainerServiceInner>, Contain... | [
"public",
"Observable",
"<",
"ContainerServiceInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerServiceName",
",",
"ContainerServiceInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourc... | Creates or updates a container service.
Creates or updates a container service with the specified configuration of orchestrator, masters, and agents.
@param resourceGroupName The name of the resource group.
@param containerServiceName The name of the container service in the specified subscription and resource group.
... | [
"Creates",
"or",
"updates",
"a",
"container",
"service",
".",
"Creates",
"or",
"updates",
"a",
"container",
"service",
"with",
"the",
"specified",
"configuration",
"of",
"orchestrator",
"masters",
"and",
"agents",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ContainerServicesInner.java#L260-L267 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | FSDirectory.getFileInfoExtended | FileStatusExtended getFileInfoExtended(String src, INode targetNode,
String leaseHolder)
throws IOException {
readLock();
try {
if (targetNode == null) {
return null;
}
FileStatus stat = createFileStatus(src, targetNode);
long hardlinkId = (targetNode instanceof INode... | java | FileStatusExtended getFileInfoExtended(String src, INode targetNode,
String leaseHolder)
throws IOException {
readLock();
try {
if (targetNode == null) {
return null;
}
FileStatus stat = createFileStatus(src, targetNode);
long hardlinkId = (targetNode instanceof INode... | [
"FileStatusExtended",
"getFileInfoExtended",
"(",
"String",
"src",
",",
"INode",
"targetNode",
",",
"String",
"leaseHolder",
")",
"throws",
"IOException",
"{",
"readLock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"targetNode",
"==",
"null",
")",
"{",
"return",
... | Get the extended file info for a specific file.
@param src
The string representation of the path to the file
@param targetNode
the INode for the corresponding file
@param leaseHolder
the lease holder for the file
@return object containing information regarding the file or null if file
not found
@throws IOException
if ... | [
"Get",
"the",
"extended",
"file",
"info",
"for",
"a",
"specific",
"file",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1829-L1845 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/util/AstUtil.java | AstUtil.isFinalVariable | public static boolean isFinalVariable(DeclarationExpression declarationExpression, SourceCode sourceCode) {
if (isFromGeneratedSourceCode(declarationExpression)) {
return false;
}
List<Expression> variableExpressions = getVariableExpressions(declarationExpression);
if (!... | java | public static boolean isFinalVariable(DeclarationExpression declarationExpression, SourceCode sourceCode) {
if (isFromGeneratedSourceCode(declarationExpression)) {
return false;
}
List<Expression> variableExpressions = getVariableExpressions(declarationExpression);
if (!... | [
"public",
"static",
"boolean",
"isFinalVariable",
"(",
"DeclarationExpression",
"declarationExpression",
",",
"SourceCode",
"sourceCode",
")",
"{",
"if",
"(",
"isFromGeneratedSourceCode",
"(",
"declarationExpression",
")",
")",
"{",
"return",
"false",
";",
"}",
"List"... | Return true if the DeclarationExpression represents a 'final' variable declaration.
NOTE: THIS IS A WORKAROUND.
There does not seem to be an easy way to determine whether the 'final' modifier has been
specified for a variable declaration. Return true if the 'final' is present before the variable name. | [
"Return",
"true",
"if",
"the",
"DeclarationExpression",
"represents",
"a",
"final",
"variable",
"declaration",
"."
] | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/util/AstUtil.java#L541-L558 |
lucee/Lucee | core/src/main/java/lucee/runtime/crypt/BinConverter.java | BinConverter.longToByteArray | public static void longToByteArray(long lValue, byte[] buffer, int nStartIndex) {
buffer[nStartIndex] = (byte) (lValue >>> 56);
buffer[nStartIndex + 1] = (byte) ((lValue >>> 48) & 0x0ff);
buffer[nStartIndex + 2] = (byte) ((lValue >>> 40) & 0x0ff);
buffer[nStartIndex + 3] = (byte) ((lValue >>> 32) & 0x0ff);
buffer[... | java | public static void longToByteArray(long lValue, byte[] buffer, int nStartIndex) {
buffer[nStartIndex] = (byte) (lValue >>> 56);
buffer[nStartIndex + 1] = (byte) ((lValue >>> 48) & 0x0ff);
buffer[nStartIndex + 2] = (byte) ((lValue >>> 40) & 0x0ff);
buffer[nStartIndex + 3] = (byte) ((lValue >>> 32) & 0x0ff);
buffer[... | [
"public",
"static",
"void",
"longToByteArray",
"(",
"long",
"lValue",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"nStartIndex",
")",
"{",
"buffer",
"[",
"nStartIndex",
"]",
"=",
"(",
"byte",
")",
"(",
"lValue",
">>>",
"56",
")",
";",
"buffer",
"[",
... | converts a long o bytes which are put into a given array
@param lValue the 64bit integer to convert
@param buffer the target buffer
@param nStartIndex where to place the bytes in the buffer | [
"converts",
"a",
"long",
"o",
"bytes",
"which",
"are",
"put",
"into",
"a",
"given",
"array"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/crypt/BinConverter.java#L45-L54 |
amzn/ion-java | src/com/amazon/ion/util/IonStreamUtils.java | IonStreamUtils.writeFloatList | public static void writeFloatList(IonWriter writer, float[] values)
throws IOException
{
if (writer instanceof _Private_ListWriter) {
((_Private_ListWriter)writer).writeFloatList(values);
return;
}
writer.stepIn(IonType.LIST);
for (int ii=0; ii<values... | java | public static void writeFloatList(IonWriter writer, float[] values)
throws IOException
{
if (writer instanceof _Private_ListWriter) {
((_Private_ListWriter)writer).writeFloatList(values);
return;
}
writer.stepIn(IonType.LIST);
for (int ii=0; ii<values... | [
"public",
"static",
"void",
"writeFloatList",
"(",
"IonWriter",
"writer",
",",
"float",
"[",
"]",
"values",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"instanceof",
"_Private_ListWriter",
")",
"{",
"(",
"(",
"_Private_ListWriter",
")",
"writer",
"... | writes an IonList with a series of IonFloat values. This
starts a List, writes the values (without any annoations)
and closes the list. For text and tree writers this is
just a convienience, but for the binary writer it can be
optimized internally. Note that since, currently, IonFloat
is a 64 bit float this is a helpe... | [
"writes",
"an",
"IonList",
"with",
"a",
"series",
"of",
"IonFloat",
"values",
".",
"This",
"starts",
"a",
"List",
"writes",
"the",
"values",
"(",
"without",
"any",
"annoations",
")",
"and",
"closes",
"the",
"list",
".",
"For",
"text",
"and",
"tree",
"wri... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/IonStreamUtils.java#L163-L176 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/reflect/ClassReflectionIndexUtil.java | ClassReflectionIndexUtil.findRequiredMethod | public static Method findRequiredMethod(final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> clazz, final MethodIdentifier methodIdentifier) throws DeploymentUnitProcessingException {
Method method = findMethod(deploymentReflectionIndex, clazz, methodIdentifier);
if (method == null)... | java | public static Method findRequiredMethod(final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> clazz, final MethodIdentifier methodIdentifier) throws DeploymentUnitProcessingException {
Method method = findMethod(deploymentReflectionIndex, clazz, methodIdentifier);
if (method == null)... | [
"public",
"static",
"Method",
"findRequiredMethod",
"(",
"final",
"DeploymentReflectionIndex",
"deploymentReflectionIndex",
",",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"MethodIdentifier",
"methodIdentifier",
")",
"throws",
"DeploymentUnitProcessingException... | Finds and returns a method corresponding to the passed <code>methodIdentifier</code>.
The passed <code>classReflectionIndex</code> will be used to traverse the class hierarchy while finding the method.
<p/>
Throws {@link org.jboss.as.server.deployment.DeploymentUnitProcessingException} if no such method is found.
@par... | [
"Finds",
"and",
"returns",
"a",
"method",
"corresponding",
"to",
"the",
"passed",
"<code",
">",
"methodIdentifier<",
"/",
"code",
">",
".",
"The",
"passed",
"<code",
">",
"classReflectionIndex<",
"/",
"code",
">",
"will",
"be",
"used",
"to",
"traverse",
"the... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/reflect/ClassReflectionIndexUtil.java#L97-L103 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java | ODataLocal.addRecord | public long addRecord(final ORecordId iRid, final byte[] iContent) throws IOException {
if (iContent.length == 0)
// AVOID UNUSEFUL CREATION OF EMPTY RECORD: IT WILL BE CREATED AT FIRST UPDATE
return -1;
final int recordSize = iContent.length + RECORD_FIX_SIZE;
acquireExclusiveLock();... | java | public long addRecord(final ORecordId iRid, final byte[] iContent) throws IOException {
if (iContent.length == 0)
// AVOID UNUSEFUL CREATION OF EMPTY RECORD: IT WILL BE CREATED AT FIRST UPDATE
return -1;
final int recordSize = iContent.length + RECORD_FIX_SIZE;
acquireExclusiveLock();... | [
"public",
"long",
"addRecord",
"(",
"final",
"ORecordId",
"iRid",
",",
"final",
"byte",
"[",
"]",
"iContent",
")",
"throws",
"IOException",
"{",
"if",
"(",
"iContent",
".",
"length",
"==",
"0",
")",
"// AVOID UNUSEFUL CREATION OF EMPTY RECORD: IT WILL BE CREATED AT ... | Add the record content in file.
@param iContent
The content to write
@return The record offset.
@throws IOException | [
"Add",
"the",
"record",
"content",
"in",
"file",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/ODataLocal.java#L187-L205 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java | ConfigUtils.hasNonEmptyPath | public static boolean hasNonEmptyPath(Config config, String key) {
return config.hasPath(key) && StringUtils.isNotBlank(config.getString(key));
} | java | public static boolean hasNonEmptyPath(Config config, String key) {
return config.hasPath(key) && StringUtils.isNotBlank(config.getString(key));
} | [
"public",
"static",
"boolean",
"hasNonEmptyPath",
"(",
"Config",
"config",
",",
"String",
"key",
")",
"{",
"return",
"config",
".",
"hasPath",
"(",
"key",
")",
"&&",
"StringUtils",
".",
"isNotBlank",
"(",
"config",
".",
"getString",
"(",
"key",
")",
")",
... | Check if the given <code>key</code> exists in <code>config</code> and it is not null or empty
Uses {@link StringUtils#isNotBlank(CharSequence)}
@param config which may have the key
@param key to look for in the config
@return True if key exits and not null or empty. False otherwise | [
"Check",
"if",
"the",
"given",
"<code",
">",
"key<",
"/",
"code",
">",
"exists",
"in",
"<code",
">",
"config<",
"/",
"code",
">",
"and",
"it",
"is",
"not",
"null",
"or",
"empty",
"Uses",
"{",
"@link",
"StringUtils#isNotBlank",
"(",
"CharSequence",
")",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java#L474-L476 |
rsocket/rsocket-java | rsocket-core/src/main/java/io/rsocket/util/DefaultPayload.java | DefaultPayload.create | public static Payload create(CharSequence data, @Nullable CharSequence metadata) {
return create(
StandardCharsets.UTF_8.encode(CharBuffer.wrap(data)),
metadata == null ? null : StandardCharsets.UTF_8.encode(CharBuffer.wrap(metadata)));
} | java | public static Payload create(CharSequence data, @Nullable CharSequence metadata) {
return create(
StandardCharsets.UTF_8.encode(CharBuffer.wrap(data)),
metadata == null ? null : StandardCharsets.UTF_8.encode(CharBuffer.wrap(metadata)));
} | [
"public",
"static",
"Payload",
"create",
"(",
"CharSequence",
"data",
",",
"@",
"Nullable",
"CharSequence",
"metadata",
")",
"{",
"return",
"create",
"(",
"StandardCharsets",
".",
"UTF_8",
".",
"encode",
"(",
"CharBuffer",
".",
"wrap",
"(",
"data",
")",
")",... | Static factory method for a text payload. Mainly looks better than "new DefaultPayload(data,
metadata)"
@param data the data of the payload.
@param metadata the metadata for the payload.
@return a payload. | [
"Static",
"factory",
"method",
"for",
"a",
"text",
"payload",
".",
"Mainly",
"looks",
"better",
"than",
"new",
"DefaultPayload",
"(",
"data",
"metadata",
")"
] | train | https://github.com/rsocket/rsocket-java/blob/5101748fbd224ec86570351cebd24d079b63fbfc/rsocket-core/src/main/java/io/rsocket/util/DefaultPayload.java#L61-L65 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java | ExtraLanguagePreferenceAccess.getXtextKey | private static String getXtextKey(String preferenceContainerID, String preferenceName) {
return GENERATOR_PREFERENCE_TAG + PreferenceConstants.SEPARATOR + preferenceContainerID
+ PreferenceConstants.SEPARATOR + preferenceName;
} | java | private static String getXtextKey(String preferenceContainerID, String preferenceName) {
return GENERATOR_PREFERENCE_TAG + PreferenceConstants.SEPARATOR + preferenceContainerID
+ PreferenceConstants.SEPARATOR + preferenceName;
} | [
"private",
"static",
"String",
"getXtextKey",
"(",
"String",
"preferenceContainerID",
",",
"String",
"preferenceName",
")",
"{",
"return",
"GENERATOR_PREFERENCE_TAG",
"+",
"PreferenceConstants",
".",
"SEPARATOR",
"+",
"preferenceContainerID",
"+",
"PreferenceConstants",
"... | Create a preference key according to the Xtext option block standards.
@param preferenceContainerID the identifier of the generator's preference container.
@param preferenceName the name of the preference.
@return the key. | [
"Create",
"a",
"preference",
"key",
"according",
"to",
"the",
"Xtext",
"option",
"block",
"standards",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java#L100-L103 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/ContentSpecUtilities.java | ContentSpecUtilities.fixFailedContentSpec | public static String fixFailedContentSpec(final ContentSpecWrapper contentSpec, final String validText, final boolean includeChecksum) {
return fixFailedContentSpec(contentSpec.getId(), contentSpec.getFailed(), validText, includeChecksum);
} | java | public static String fixFailedContentSpec(final ContentSpecWrapper contentSpec, final String validText, final boolean includeChecksum) {
return fixFailedContentSpec(contentSpec.getId(), contentSpec.getFailed(), validText, includeChecksum);
} | [
"public",
"static",
"String",
"fixFailedContentSpec",
"(",
"final",
"ContentSpecWrapper",
"contentSpec",
",",
"final",
"String",
"validText",
",",
"final",
"boolean",
"includeChecksum",
")",
"{",
"return",
"fixFailedContentSpec",
"(",
"contentSpec",
".",
"getId",
"(",... | Fixes a failed Content Spec so that the ID and CHECKSUM are included. This is primarily an issue when creating new content specs
and they are initially invalid.
@param contentSpec The content spec to fix.
@param validText The content specs latest valid text.
@param includeChecksum If the checksum should be i... | [
"Fixes",
"a",
"failed",
"Content",
"Spec",
"so",
"that",
"the",
"ID",
"and",
"CHECKSUM",
"are",
"included",
".",
"This",
"is",
"primarily",
"an",
"issue",
"when",
"creating",
"new",
"content",
"specs",
"and",
"they",
"are",
"initially",
"invalid",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/ContentSpecUtilities.java#L169-L171 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointUser.java | EndpointUser.withUserAttributes | public EndpointUser withUserAttributes(java.util.Map<String, java.util.List<String>> userAttributes) {
setUserAttributes(userAttributes);
return this;
} | java | public EndpointUser withUserAttributes(java.util.Map<String, java.util.List<String>> userAttributes) {
setUserAttributes(userAttributes);
return this;
} | [
"public",
"EndpointUser",
"withUserAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"userAttributes",
")",
"{",
"setUserAttributes",
"(",
"userAttributes",
")",
";",
"return",
... | Custom attributes that describe the user by associating a name with an array of values. For example, an attribute
named "interests" might have the following values: ["science", "politics", "travel"]. You can use these
attributes as selection criteria when you create segments.
The Amazon Pinpoint console can't display ... | [
"Custom",
"attributes",
"that",
"describe",
"the",
"user",
"by",
"associating",
"a",
"name",
"with",
"an",
"array",
"of",
"values",
".",
"For",
"example",
"an",
"attribute",
"named",
"interests",
"might",
"have",
"the",
"following",
"values",
":",
"[",
"scie... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointUser.java#L107-L110 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/host/controller/mgmt/DomainHostExcludeRegistry.java | DomainHostExcludeRegistry.getVersionIgnoreData | VersionExcludeData getVersionIgnoreData(int major, int minor, int micro) {
VersionExcludeData result = registry.get(new VersionKey(major, minor, micro));
if (result == null) {
result = registry.get(new VersionKey(major, minor, null));
}
return result;
} | java | VersionExcludeData getVersionIgnoreData(int major, int minor, int micro) {
VersionExcludeData result = registry.get(new VersionKey(major, minor, micro));
if (result == null) {
result = registry.get(new VersionKey(major, minor, null));
}
return result;
} | [
"VersionExcludeData",
"getVersionIgnoreData",
"(",
"int",
"major",
",",
"int",
"minor",
",",
"int",
"micro",
")",
"{",
"VersionExcludeData",
"result",
"=",
"registry",
".",
"get",
"(",
"new",
"VersionKey",
"(",
"major",
",",
"minor",
",",
"micro",
")",
")",
... | Gets the host-ignore data for a slave host running the given version.
@param major the kernel management API major version
@param minor the kernel management API minor version
@param micro the kernel management API micro version
@return the host-ignore data, or {@code null} if there is no matching registration | [
"Gets",
"the",
"host",
"-",
"ignore",
"data",
"for",
"a",
"slave",
"host",
"running",
"the",
"given",
"version",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/mgmt/DomainHostExcludeRegistry.java#L144-L150 |
sniffy/sniffy | sniffy-core/src/main/java/io/sniffy/socket/SnifferSocketImplFactory.java | SnifferSocketImplFactory.uninstall | public static void uninstall() throws IOException {
try {
Field factoryField = Socket.class.getDeclaredField("factory");
factoryField.setAccessible(true);
factoryField.set(null, previousSocketImplFactory);
} catch (IllegalAccessException e) {
throw new IOE... | java | public static void uninstall() throws IOException {
try {
Field factoryField = Socket.class.getDeclaredField("factory");
factoryField.setAccessible(true);
factoryField.set(null, previousSocketImplFactory);
} catch (IllegalAccessException e) {
throw new IOE... | [
"public",
"static",
"void",
"uninstall",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Field",
"factoryField",
"=",
"Socket",
".",
"class",
".",
"getDeclaredField",
"(",
"\"factory\"",
")",
";",
"factoryField",
".",
"setAccessible",
"(",
"true",
")",
... | Restores previously saved {@link SocketImplFactory} and sets it as a default
@see #install()
@throws IOException if failed to install {@link SnifferSocketImplFactory}
@since 3.1 | [
"Restores",
"previously",
"saved",
"{"
] | train | https://github.com/sniffy/sniffy/blob/7bdddb9593e6b6e9fe5c7c87519f864acbc3a5c0/sniffy-core/src/main/java/io/sniffy/socket/SnifferSocketImplFactory.java#L53-L63 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java | ClusterManagerClient.getOperation | public final Operation getOperation(String projectId, String zone, String operationId) {
GetOperationRequest request =
GetOperationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setOperationId(operationId)
.build();
return getOperation(requ... | java | public final Operation getOperation(String projectId, String zone, String operationId) {
GetOperationRequest request =
GetOperationRequest.newBuilder()
.setProjectId(projectId)
.setZone(zone)
.setOperationId(operationId)
.build();
return getOperation(requ... | [
"public",
"final",
"Operation",
"getOperation",
"(",
"String",
"projectId",
",",
"String",
"zone",
",",
"String",
"operationId",
")",
"{",
"GetOperationRequest",
"request",
"=",
"GetOperationRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"project... | Gets the specified operation.
<p>Sample code:
<pre><code>
try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
String projectId = "";
String zone = "";
String operationId = "";
Operation response = clusterManagerClient.getOperation(projectId, zone, operationId);
}
</code></pre>
@param pr... | [
"Gets",
"the",
"specified",
"operation",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java#L1478-L1487 |
datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.setContent | public Request setContent(InputStream stream, ContentType contentType) {
entity = new InputStreamEntity(stream, contentType);
return this;
} | java | public Request setContent(InputStream stream, ContentType contentType) {
entity = new InputStreamEntity(stream, contentType);
return this;
} | [
"public",
"Request",
"setContent",
"(",
"InputStream",
"stream",
",",
"ContentType",
"contentType",
")",
"{",
"entity",
"=",
"new",
"InputStreamEntity",
"(",
"stream",
",",
"contentType",
")",
";",
"return",
"this",
";",
"}"
] | set request content from input stream with given content type
@param stream : teh input stream to be used as http content
@param contentType : type of content set in header
@return modified Request object with http content entity set | [
"set",
"request",
"content",
"from",
"input",
"stream",
"with",
"given",
"content",
"type"
] | train | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L411-L414 |
spring-cloud/spring-cloud-stream-app-starters | processor/spring-cloud-starter-stream-processor-tasklaunchrequest-transform/src/main/java/org/springframework/cloud/stream/app/tasklaunchrequest/transform/processor/TasklaunchrequestTransformProcessorConfiguration.java | TasklaunchrequestTransformProcessorConfiguration.addKeyValuePairAsProperty | private void addKeyValuePairAsProperty(String pair, Map<String, String> properties) {
int firstEquals = pair.indexOf('=');
if (firstEquals != -1) {
properties.put(pair.substring(0, firstEquals).trim(), pair.substring(firstEquals + 1).trim());
}
} | java | private void addKeyValuePairAsProperty(String pair, Map<String, String> properties) {
int firstEquals = pair.indexOf('=');
if (firstEquals != -1) {
properties.put(pair.substring(0, firstEquals).trim(), pair.substring(firstEquals + 1).trim());
}
} | [
"private",
"void",
"addKeyValuePairAsProperty",
"(",
"String",
"pair",
",",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"int",
"firstEquals",
"=",
"pair",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"firstEquals",
"!=",
"-",... | Adds a String of format key=value to the provided Map as a key/value pair.
@param pair the String representation
@param properties the Map to which the key/value pair should be added | [
"Adds",
"a",
"String",
"of",
"format",
"key",
"=",
"value",
"to",
"the",
"provided",
"Map",
"as",
"a",
"key",
"/",
"value",
"pair",
"."
] | train | https://github.com/spring-cloud/spring-cloud-stream-app-starters/blob/c82827a9b5a6eab78fe6a2d56a946b5f9fb0ead9/processor/spring-cloud-starter-stream-processor-tasklaunchrequest-transform/src/main/java/org/springframework/cloud/stream/app/tasklaunchrequest/transform/processor/TasklaunchrequestTransformProcessorConfigura... |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java | ActiveSyncManager.getSyncPathList | public List<SyncPointInfo> getSyncPathList() {
List<SyncPointInfo> returnList = new ArrayList<>();
for (AlluxioURI uri: mSyncPathList) {
SyncPointInfo.SyncStatus status;
Future<?> syncStatus = mSyncPathStatus.get(uri);
if (syncStatus == null) {
status = SyncPointInfo.SyncStatus.NOT_INI... | java | public List<SyncPointInfo> getSyncPathList() {
List<SyncPointInfo> returnList = new ArrayList<>();
for (AlluxioURI uri: mSyncPathList) {
SyncPointInfo.SyncStatus status;
Future<?> syncStatus = mSyncPathStatus.get(uri);
if (syncStatus == null) {
status = SyncPointInfo.SyncStatus.NOT_INI... | [
"public",
"List",
"<",
"SyncPointInfo",
">",
"getSyncPathList",
"(",
")",
"{",
"List",
"<",
"SyncPointInfo",
">",
"returnList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"AlluxioURI",
"uri",
":",
"mSyncPathList",
")",
"{",
"SyncPointInfo",
... | Get the sync point list.
@return a list of URIs (sync points) | [
"Get",
"the",
"sync",
"point",
"list",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java#L338-L353 |
bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleDeleteEntity | protected <C extends CrudResponse, T extends DeleteEntity> C handleDeleteEntity(Class<T> type, Integer id) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForEntityDelete(
BullhornEntityInfo.getTypesRestEntityName(type), id);
String url = restUrlFactory.assemb... | java | protected <C extends CrudResponse, T extends DeleteEntity> C handleDeleteEntity(Class<T> type, Integer id) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForEntityDelete(
BullhornEntityInfo.getTypesRestEntityName(type), id);
String url = restUrlFactory.assemb... | [
"protected",
"<",
"C",
"extends",
"CrudResponse",
",",
"T",
"extends",
"DeleteEntity",
">",
"C",
"handleDeleteEntity",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Integer",
"id",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"re... | Makes the delete api call. The type of delete (soft or hard) depends on the DeleteEntity type of the Class<T> type passed in.
@param type
@param id
@return | [
"Makes",
"the",
"delete",
"api",
"call",
".",
"The",
"type",
"of",
"delete",
"(",
"soft",
"or",
"hard",
")",
"depends",
"on",
"the",
"DeleteEntity",
"type",
"of",
"the",
"Class<T",
">",
"type",
"passed",
"in",
"."
] | train | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1192-L1215 |
liferay/com-liferay-commerce | commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java | CommerceVirtualOrderItemPersistenceImpl.findAll | @Override
public List<CommerceVirtualOrderItem> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceVirtualOrderItem> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceVirtualOrderItem",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce virtual order items.
@return the commerce virtual order items | [
"Returns",
"all",
"the",
"commerce",
"virtual",
"order",
"items",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java#L2353-L2356 |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/TDHttpClient.java | TDHttpClient.withHeaders | public TDHttpClient withHeaders(Multimap<String, String> headers)
{
Multimap<String, String> mergedHeaders = ImmutableMultimap.<String, String>builder()
.putAll(this.headers)
.putAll(headers)
.build();
return new TDHttpClient(config, httpClient, object... | java | public TDHttpClient withHeaders(Multimap<String, String> headers)
{
Multimap<String, String> mergedHeaders = ImmutableMultimap.<String, String>builder()
.putAll(this.headers)
.putAll(headers)
.build();
return new TDHttpClient(config, httpClient, object... | [
"public",
"TDHttpClient",
"withHeaders",
"(",
"Multimap",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"Multimap",
"<",
"String",
",",
"String",
">",
"mergedHeaders",
"=",
"ImmutableMultimap",
".",
"<",
"String",
",",
"String",
">",
"builder",
"("... | Get a {@link TDHttpClient} that uses the specified headers for each request. Reuses the same
underlying http client so closing the returned instance will return this instance as well.
@param headers
@return | [
"Get",
"a",
"{",
"@link",
"TDHttpClient",
"}",
"that",
"uses",
"the",
"specified",
"headers",
"for",
"each",
"request",
".",
"Reuses",
"the",
"same",
"underlying",
"http",
"client",
"so",
"closing",
"the",
"returned",
"instance",
"will",
"return",
"this",
"i... | train | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDHttpClient.java#L152-L159 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildPackageSerializedForm | public void buildPackageSerializedForm(XMLNode node, Content serializedSummariesTree) {
Content packageSerializedTree = writer.getPackageSerializedHeader();
String foo = currentPackage.name();
ClassDoc[] classes = currentPackage.allClasses(false);
if (classes == null || classes.length ==... | java | public void buildPackageSerializedForm(XMLNode node, Content serializedSummariesTree) {
Content packageSerializedTree = writer.getPackageSerializedHeader();
String foo = currentPackage.name();
ClassDoc[] classes = currentPackage.allClasses(false);
if (classes == null || classes.length ==... | [
"public",
"void",
"buildPackageSerializedForm",
"(",
"XMLNode",
"node",
",",
"Content",
"serializedSummariesTree",
")",
"{",
"Content",
"packageSerializedTree",
"=",
"writer",
".",
"getPackageSerializedHeader",
"(",
")",
";",
"String",
"foo",
"=",
"currentPackage",
".... | Build the package serialized form for the current package being processed.
@param node the XML element that specifies which components to document
@param serializedSummariesTree content tree to which the documentation will be added | [
"Build",
"the",
"package",
"serialized",
"form",
"for",
"the",
"current",
"package",
"being",
"processed",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java#L180-L195 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/NetworkTopology.java | NetworkTopology.isOnSameRack | public boolean isOnSameRack( Node node1, Node node2) {
if (node1 == null || node2 == null) {
return false;
}
netlock.readLock().lock();
try {
return node1.getParent()==node2.getParent();
} finally {
netlock.readLock().unlock();
}
} | java | public boolean isOnSameRack( Node node1, Node node2) {
if (node1 == null || node2 == null) {
return false;
}
netlock.readLock().lock();
try {
return node1.getParent()==node2.getParent();
} finally {
netlock.readLock().unlock();
}
} | [
"public",
"boolean",
"isOnSameRack",
"(",
"Node",
"node1",
",",
"Node",
"node2",
")",
"{",
"if",
"(",
"node1",
"==",
"null",
"||",
"node2",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"netlock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
... | Check if two nodes are on the same rack
@param node1 one node
@param node2 another node
@return true if node1 and node2 are pm the same rack; false otherwise
@exception IllegalArgumentException when either node1 or node2 is null, or
node1 or node2 do not belong to the cluster | [
"Check",
"if",
"two",
"nodes",
"are",
"on",
"the",
"same",
"rack"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/NetworkTopology.java#L551-L562 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java | MapComposedElement.setPointAt | public final boolean setPointAt(int groupIndex, int indexInGroup, Point2D<?, ?> point, boolean canonize) {
return setPointAt(groupIndex, indexInGroup, point.getX(), point.getY(), canonize);
} | java | public final boolean setPointAt(int groupIndex, int indexInGroup, Point2D<?, ?> point, boolean canonize) {
return setPointAt(groupIndex, indexInGroup, point.getX(), point.getY(), canonize);
} | [
"public",
"final",
"boolean",
"setPointAt",
"(",
"int",
"groupIndex",
",",
"int",
"indexInGroup",
",",
"Point2D",
"<",
"?",
",",
"?",
">",
"point",
",",
"boolean",
"canonize",
")",
"{",
"return",
"setPointAt",
"(",
"groupIndex",
",",
"indexInGroup",
",",
"... | Set the specified point at the given index in the specified group.
@param groupIndex is the index of the group
@param indexInGroup is the index of the ponit in the group (0 for the
first point of the group...).
@param point is the new value.
@param canonize indicates if the function {@link #canonize(int)} must be call... | [
"Set",
"the",
"specified",
"point",
"at",
"the",
"given",
"index",
"in",
"the",
"specified",
"group",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java#L1081-L1083 |
vatbub/common | updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java | UpdateChecker.downloadAndInstallUpdate | public static boolean downloadAndInstallUpdate(UpdateInfo updateToInstall, UpdateProgressDialog gui, String... params)
throws IllegalStateException, IOException {
return downloadAndInstallUpdate(updateToInstall, gui, true, params);
} | java | public static boolean downloadAndInstallUpdate(UpdateInfo updateToInstall, UpdateProgressDialog gui, String... params)
throws IllegalStateException, IOException {
return downloadAndInstallUpdate(updateToInstall, gui, true, params);
} | [
"public",
"static",
"boolean",
"downloadAndInstallUpdate",
"(",
"UpdateInfo",
"updateToInstall",
",",
"UpdateProgressDialog",
"gui",
",",
"String",
"...",
"params",
")",
"throws",
"IllegalStateException",
",",
"IOException",
"{",
"return",
"downloadAndInstallUpdate",
"(",... | Downloads the specified update as a jar-file and launches it. The jar
file will be saved at the same location as the currently executed file
but will not replace it (unless it has the same filename but this will
never happen). The old app file will be deleted once the updated one is
launched. <b>Please note</b> that th... | [
"Downloads",
"the",
"specified",
"update",
"as",
"a",
"jar",
"-",
"file",
"and",
"launches",
"it",
".",
"The",
"jar",
"file",
"will",
"be",
"saved",
"at",
"the",
"same",
"location",
"as",
"the",
"currently",
"executed",
"file",
"but",
"will",
"not",
"rep... | train | https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java#L423-L426 |
oasp/oasp4j | modules/rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java | RestServiceExceptionFacade.createResponse | protected Response createResponse(Status status, NlsRuntimeException error, String message,
Map<String, List<String>> errorsMap) {
return createResponse(status, error, message, error.getCode(), errorsMap);
} | java | protected Response createResponse(Status status, NlsRuntimeException error, String message,
Map<String, List<String>> errorsMap) {
return createResponse(status, error, message, error.getCode(), errorsMap);
} | [
"protected",
"Response",
"createResponse",
"(",
"Status",
"status",
",",
"NlsRuntimeException",
"error",
",",
"String",
"message",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"errorsMap",
")",
"{",
"return",
"createResponse",
"(",
"status"... | Create a response message as a JSON-String from the given parts.
@param status is the HTTP {@link Status}.
@param error is the catched or wrapped {@link NlsRuntimeException}.
@param message is the JSON message attribute.
@param errorsMap is a map with all validation errors
@return the corresponding {@link Response}. | [
"Create",
"a",
"response",
"message",
"as",
"a",
"JSON",
"-",
"String",
"from",
"the",
"given",
"parts",
"."
] | train | https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java#L426-L430 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java | GeometryUtilities.getTriangleWindingRule | public static int getTriangleWindingRule( Coordinate A, Coordinate B, Coordinate C ) {
double[] rBA = {B.x - A.x, B.y - A.y, B.z - A.z};
double[] rCA = {C.x - A.x, C.y - A.y, C.z - A.z};
double[] crossProduct = {//
/* */rBA[1] * rCA[2] - rBA[2] * rCA[1], //
-1... | java | public static int getTriangleWindingRule( Coordinate A, Coordinate B, Coordinate C ) {
double[] rBA = {B.x - A.x, B.y - A.y, B.z - A.z};
double[] rCA = {C.x - A.x, C.y - A.y, C.z - A.z};
double[] crossProduct = {//
/* */rBA[1] * rCA[2] - rBA[2] * rCA[1], //
-1... | [
"public",
"static",
"int",
"getTriangleWindingRule",
"(",
"Coordinate",
"A",
",",
"Coordinate",
"B",
",",
"Coordinate",
"C",
")",
"{",
"double",
"[",
"]",
"rBA",
"=",
"{",
"B",
".",
"x",
"-",
"A",
".",
"x",
",",
"B",
".",
"y",
"-",
"A",
".",
"y",... | Get the winding rule of a triangle by their coordinates (given in digitized order).
@param A coordinate 1.
@param B coordinate 2.
@param C coordinate 3.
@return -1 if the digitalization is clock wise, else 1. | [
"Get",
"the",
"winding",
"rule",
"of",
"a",
"triangle",
"by",
"their",
"coordinates",
"(",
"given",
"in",
"digitized",
"order",
")",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java#L870-L881 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.getClosestBond | public static IBond getClosestBond(double xPosition, double yPosition, IAtomContainer atomCon) {
Point2d bondCenter;
IBond closestBond = null;
double smallestMouseDistance = -1;
double mouseDistance;
Iterator<IBond> bonds = atomCon.bonds().iterator();
while (bonds.hasNex... | java | public static IBond getClosestBond(double xPosition, double yPosition, IAtomContainer atomCon) {
Point2d bondCenter;
IBond closestBond = null;
double smallestMouseDistance = -1;
double mouseDistance;
Iterator<IBond> bonds = atomCon.bonds().iterator();
while (bonds.hasNex... | [
"public",
"static",
"IBond",
"getClosestBond",
"(",
"double",
"xPosition",
",",
"double",
"yPosition",
",",
"IAtomContainer",
"atomCon",
")",
"{",
"Point2d",
"bondCenter",
";",
"IBond",
"closestBond",
"=",
"null",
";",
"double",
"smallestMouseDistance",
"=",
"-",
... | Returns the bond of the given molecule that is closest to the given
coordinates.
See comment for center(IAtomContainer atomCon, Dimension areaDim, HashMap renderingCoordinates) for details on coordinate sets
@param xPosition The x coordinate
@param yPosition The y coordinate
@param atomCon The molecule that is... | [
"Returns",
"the",
"bond",
"of",
"the",
"given",
"molecule",
"that",
"is",
"closest",
"to",
"the",
"given",
"coordinates",
".",
"See",
"comment",
"for",
"center",
"(",
"IAtomContainer",
"atomCon",
"Dimension",
"areaDim",
"HashMap",
"renderingCoordinates",
")",
"f... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L828-L845 |
grpc/grpc-java | core/src/main/java/io/grpc/util/RoundRobinLoadBalancer.java | RoundRobinLoadBalancer.updateBalancingState | @SuppressWarnings("ReferenceEquality")
private void updateBalancingState() {
List<Subchannel> activeList = filterNonFailingSubchannels(getSubchannels());
if (activeList.isEmpty()) {
// No READY subchannels, determine aggregate state and error status
boolean isConnecting = false;
Status aggSt... | java | @SuppressWarnings("ReferenceEquality")
private void updateBalancingState() {
List<Subchannel> activeList = filterNonFailingSubchannels(getSubchannels());
if (activeList.isEmpty()) {
// No READY subchannels, determine aggregate state and error status
boolean isConnecting = false;
Status aggSt... | [
"@",
"SuppressWarnings",
"(",
"\"ReferenceEquality\"",
")",
"private",
"void",
"updateBalancingState",
"(",
")",
"{",
"List",
"<",
"Subchannel",
">",
"activeList",
"=",
"filterNonFailingSubchannels",
"(",
"getSubchannels",
"(",
")",
")",
";",
"if",
"(",
"activeLis... | Updates picker with the list of active subchannels (state == READY). | [
"Updates",
"picker",
"with",
"the",
"list",
"of",
"active",
"subchannels",
"(",
"state",
"==",
"READY",
")",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/util/RoundRobinLoadBalancer.java#L201-L230 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/random/MathRandom.java | MathRandom.getDouble | public double getDouble(final double min, final double max) {
return min(min, max) + getDouble(abs(max - min));
} | java | public double getDouble(final double min, final double max) {
return min(min, max) + getDouble(abs(max - min));
} | [
"public",
"double",
"getDouble",
"(",
"final",
"double",
"min",
",",
"final",
"double",
"max",
")",
"{",
"return",
"min",
"(",
"min",
",",
"max",
")",
"+",
"getDouble",
"(",
"abs",
"(",
"max",
"-",
"min",
")",
")",
";",
"}"
] | Returns a random decimal number in the range of [min, max].
@param min
minimum value for generated number
@param max
maximum value for generated number | [
"Returns",
"a",
"random",
"decimal",
"number",
"in",
"the",
"range",
"of",
"[",
"min",
"max",
"]",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/random/MathRandom.java#L115-L117 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ClassApi.java | ClassApi.findMethod | public static Method findMethod(Class clazz, String methodName) {
final List<Method> methods = getDeclaredMethodsRecursively(clazz).get(methodName);
if (methods.isEmpty()) {
throw new IllegalArgumentException(clazz.getName() + "::" + methodName + " not found");
}
final List<M... | java | public static Method findMethod(Class clazz, String methodName) {
final List<Method> methods = getDeclaredMethodsRecursively(clazz).get(methodName);
if (methods.isEmpty()) {
throw new IllegalArgumentException(clazz.getName() + "::" + methodName + " not found");
}
final List<M... | [
"public",
"static",
"Method",
"findMethod",
"(",
"Class",
"clazz",
",",
"String",
"methodName",
")",
"{",
"final",
"List",
"<",
"Method",
">",
"methods",
"=",
"getDeclaredMethodsRecursively",
"(",
"clazz",
")",
".",
"get",
"(",
"methodName",
")",
";",
"if",
... | Finds method with name, throws exception if no method found or there are many of them. | [
"Finds",
"method",
"with",
"name",
"throws",
"exception",
"if",
"no",
"method",
"found",
"or",
"there",
"are",
"many",
"of",
"them",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ClassApi.java#L135-L155 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldAdjustRegion.java | TldAdjustRegion.process | public boolean process( FastQueue<AssociatedPair> pairs , Rectangle2D_F64 targetRectangle ) {
// estimate how the rectangle has changed and update it
if( !estimateMotion.process(pairs.toList()) )
return false;
ScaleTranslate2D motion = estimateMotion.getModelParameters();
adjustRectangle(targetRectangle,mo... | java | public boolean process( FastQueue<AssociatedPair> pairs , Rectangle2D_F64 targetRectangle ) {
// estimate how the rectangle has changed and update it
if( !estimateMotion.process(pairs.toList()) )
return false;
ScaleTranslate2D motion = estimateMotion.getModelParameters();
adjustRectangle(targetRectangle,mo... | [
"public",
"boolean",
"process",
"(",
"FastQueue",
"<",
"AssociatedPair",
">",
"pairs",
",",
"Rectangle2D_F64",
"targetRectangle",
")",
"{",
"// estimate how the rectangle has changed and update it",
"if",
"(",
"!",
"estimateMotion",
".",
"process",
"(",
"pairs",
".",
... | Adjusts target rectangle using track information
@param pairs List of feature location in previous and current frame.
@param targetRectangle (Input) current location of rectangle. (output) adjusted location
@return true if successful | [
"Adjusts",
"target",
"rectangle",
"using",
"track",
"information"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldAdjustRegion.java#L72-L88 |
square/protoparser | src/main/java/com/squareup/protoparser/OptionElement.java | OptionElement.findByName | public static OptionElement findByName(List<OptionElement> options, String name) {
checkNotNull(options, "options");
checkNotNull(name, "name");
OptionElement found = null;
for (OptionElement option : options) {
if (option.name().equals(name)) {
if (found != null) {
throw new Il... | java | public static OptionElement findByName(List<OptionElement> options, String name) {
checkNotNull(options, "options");
checkNotNull(name, "name");
OptionElement found = null;
for (OptionElement option : options) {
if (option.name().equals(name)) {
if (found != null) {
throw new Il... | [
"public",
"static",
"OptionElement",
"findByName",
"(",
"List",
"<",
"OptionElement",
">",
"options",
",",
"String",
"name",
")",
"{",
"checkNotNull",
"(",
"options",
",",
"\"options\"",
")",
";",
"checkNotNull",
"(",
"name",
",",
"\"name\"",
")",
";",
"Opti... | Return the option with the specified name from the supplied list or null. | [
"Return",
"the",
"option",
"with",
"the",
"specified",
"name",
"from",
"the",
"supplied",
"list",
"or",
"null",
"."
] | train | https://github.com/square/protoparser/blob/8be66bb8fe6658b04741df0358daabca501f2524/src/main/java/com/squareup/protoparser/OptionElement.java#L64-L78 |
tvesalainen/util | ham/src/main/java/org/vesalainen/ham/Station.java | Station.inMap | public boolean inMap(String name, Location location)
{
MapArea map = maps.get(name);
if (map == null)
{
throw new IllegalArgumentException(name);
}
return map.isInside(location);
} | java | public boolean inMap(String name, Location location)
{
MapArea map = maps.get(name);
if (map == null)
{
throw new IllegalArgumentException(name);
}
return map.isInside(location);
} | [
"public",
"boolean",
"inMap",
"(",
"String",
"name",
",",
"Location",
"location",
")",
"{",
"MapArea",
"map",
"=",
"maps",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"na... | Returns true if location is inside named map.
@param name
@param location
@return | [
"Returns",
"true",
"if",
"location",
"is",
"inside",
"named",
"map",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/ham/src/main/java/org/vesalainen/ham/Station.java#L57-L65 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/retry/ClockSkewAdjuster.java | ClockSkewAdjuster.getAdjustment | public ClockSkewAdjustment getAdjustment(AdjustmentRequest adjustmentRequest) {
ValidationUtils.assertNotNull(adjustmentRequest, "adjustmentRequest");
ValidationUtils.assertNotNull(adjustmentRequest.exception, "adjustmentRequest.exception");
ValidationUtils.assertNotNull(adjustmentRequest.client... | java | public ClockSkewAdjustment getAdjustment(AdjustmentRequest adjustmentRequest) {
ValidationUtils.assertNotNull(adjustmentRequest, "adjustmentRequest");
ValidationUtils.assertNotNull(adjustmentRequest.exception, "adjustmentRequest.exception");
ValidationUtils.assertNotNull(adjustmentRequest.client... | [
"public",
"ClockSkewAdjustment",
"getAdjustment",
"(",
"AdjustmentRequest",
"adjustmentRequest",
")",
"{",
"ValidationUtils",
".",
"assertNotNull",
"(",
"adjustmentRequest",
",",
"\"adjustmentRequest\"",
")",
";",
"ValidationUtils",
".",
"assertNotNull",
"(",
"adjustmentReq... | Recommend a {@link ClockSkewAdjustment}, based on the provided {@link AdjustmentRequest}. | [
"Recommend",
"a",
"{"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/retry/ClockSkewAdjuster.java#L68-L91 |
alkacon/opencms-core | src-modules/org/opencms/workplace/administration/CmsAdminMenuGroup.java | CmsAdminMenuGroup.addMenuItem | public void addMenuItem(CmsAdminMenuItem item, float position) {
m_container.addIdentifiableObject(item.getId(), item, position);
} | java | public void addMenuItem(CmsAdminMenuItem item, float position) {
m_container.addIdentifiableObject(item.getId(), item, position);
} | [
"public",
"void",
"addMenuItem",
"(",
"CmsAdminMenuItem",
"item",
",",
"float",
"position",
")",
"{",
"m_container",
".",
"addIdentifiableObject",
"(",
"item",
".",
"getId",
"(",
")",
",",
"item",
",",
"position",
")",
";",
"}"
] | Adds a menu item at the given position.<p>
@param item the item
@param position the position
@see org.opencms.workplace.tools.CmsIdentifiableObjectContainer#addIdentifiableObject(String, Object, float) | [
"Adds",
"a",
"menu",
"item",
"at",
"the",
"given",
"position",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/administration/CmsAdminMenuGroup.java#L87-L90 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseShybsv_analysis | public static int cusparseShybsv_analysis(
cusparseHandle handle,
int transA,
cusparseMatDescr descrA,
cusparseHybMat hybA,
cusparseSolveAnalysisInfo info)
{
return checkResult(cusparseShybsv_analysisNative(handle, transA, descrA, hybA, info));
} | java | public static int cusparseShybsv_analysis(
cusparseHandle handle,
int transA,
cusparseMatDescr descrA,
cusparseHybMat hybA,
cusparseSolveAnalysisInfo info)
{
return checkResult(cusparseShybsv_analysisNative(handle, transA, descrA, hybA, info));
} | [
"public",
"static",
"int",
"cusparseShybsv_analysis",
"(",
"cusparseHandle",
"handle",
",",
"int",
"transA",
",",
"cusparseMatDescr",
"descrA",
",",
"cusparseHybMat",
"hybA",
",",
"cusparseSolveAnalysisInfo",
"info",
")",
"{",
"return",
"checkResult",
"(",
"cusparseSh... | Description: Solution of triangular linear system op(A) * x = alpha * f,
where A is a sparse matrix in HYB storage format, rhs f and solution x
are dense vectors. | [
"Description",
":",
"Solution",
"of",
"triangular",
"linear",
"system",
"op",
"(",
"A",
")",
"*",
"x",
"=",
"alpha",
"*",
"f",
"where",
"A",
"is",
"a",
"sparse",
"matrix",
"in",
"HYB",
"storage",
"format",
"rhs",
"f",
"and",
"solution",
"x",
"are",
"... | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L3480-L3488 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsInner.java | NetworkSecurityGroupsInner.beginUpdateTagsAsync | public Observable<NetworkSecurityGroupInner> beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map<String, String> tags) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).map(new Func1<ServiceResponse<NetworkSecurityGroupInner>, Net... | java | public Observable<NetworkSecurityGroupInner> beginUpdateTagsAsync(String resourceGroupName, String networkSecurityGroupName, Map<String, String> tags) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).map(new Func1<ServiceResponse<NetworkSecurityGroupInner>, Net... | [
"public",
"Observable",
"<",
"NetworkSecurityGroupInner",
">",
"beginUpdateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkSecurityGroupName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"beginUpdateTagsWithServiceRe... | Updates a network security group tags.
@param resourceGroupName The name of the resource group.
@param networkSecurityGroupName The name of the network security group.
@param tags Resource tags.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the NetworkSecurityGroup... | [
"Updates",
"a",
"network",
"security",
"group",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/NetworkSecurityGroupsInner.java#L862-L869 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/UNode.java | UNode.addValueNode | public UNode addValueNode(String name, String value, boolean bAttribute) {
return addChildNode(UNode.createValueNode(name, value, bAttribute));
} | java | public UNode addValueNode(String name, String value, boolean bAttribute) {
return addChildNode(UNode.createValueNode(name, value, bAttribute));
} | [
"public",
"UNode",
"addValueNode",
"(",
"String",
"name",
",",
"String",
"value",
",",
"boolean",
"bAttribute",
")",
"{",
"return",
"addChildNode",
"(",
"UNode",
".",
"createValueNode",
"(",
"name",
",",
"value",
",",
"bAttribute",
")",
")",
";",
"}"
] | Create a new VALUE node with the given name, value, and attribute flag and add it
as a child of this node. This node must be a MAP or ARRAY. This is convenience
method that calls {@link UNode#createValueNode(String, String, boolean)} and then
{@link #addChildNode(UNode)}.
@param name Name of new VALUE node.
@... | [
"Create",
"a",
"new",
"VALUE",
"node",
"with",
"the",
"given",
"name",
"value",
"and",
"attribute",
"flag",
"and",
"add",
"it",
"as",
"a",
"child",
"of",
"this",
"node",
".",
"This",
"node",
"must",
"be",
"a",
"MAP",
"or",
"ARRAY",
".",
"This",
"is",... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/UNode.java#L874-L876 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/replace/CmsReplaceContentWidget.java | CmsReplaceContentWidget.displayDialogInfo | public void displayDialogInfo(String msg, boolean warning) {
StringBuffer buffer = new StringBuffer(64);
if (!warning) {
buffer.append("<p class=\"");
buffer.append(I_CmsLayoutBundle.INSTANCE.uploadButton().dialogMessage());
buffer.append("\">");
b... | java | public void displayDialogInfo(String msg, boolean warning) {
StringBuffer buffer = new StringBuffer(64);
if (!warning) {
buffer.append("<p class=\"");
buffer.append(I_CmsLayoutBundle.INSTANCE.uploadButton().dialogMessage());
buffer.append("\">");
b... | [
"public",
"void",
"displayDialogInfo",
"(",
"String",
"msg",
",",
"boolean",
"warning",
")",
"{",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
"64",
")",
";",
"if",
"(",
"!",
"warning",
")",
"{",
"buffer",
".",
"append",
"(",
"\"<p class=\\\"... | Sets the dialog info message.<p>
@param msg the message to display
@param warning signals whether the message should be a warning or nor | [
"Sets",
"the",
"dialog",
"info",
"message",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/replace/CmsReplaceContentWidget.java#L88-L106 |
kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/variant/AcceptHeaders.java | AcceptHeaders.evaluateAcceptParameters | private static QualityValue evaluateAcceptParameters(Map<String, String> parameters)
{
Iterator<String> i = parameters.keySet().iterator();
while (i.hasNext())
{
String name = i.next();
if ("q".equals(name))
{
if (i.hasNext())
{
logg... | java | private static QualityValue evaluateAcceptParameters(Map<String, String> parameters)
{
Iterator<String> i = parameters.keySet().iterator();
while (i.hasNext())
{
String name = i.next();
if ("q".equals(name))
{
if (i.hasNext())
{
logg... | [
"private",
"static",
"QualityValue",
"evaluateAcceptParameters",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"Iterator",
"<",
"String",
">",
"i",
"=",
"parameters",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while"... | Evaluates and removes the accept parameters.
<pre>
accept-params = ";" "q" "=" qvalue *( accept-extension )
accept-extension = ";" token [ "=" ( token | quoted-string ) ]
</pre>
@param parameters all parameters in order of appearance.
@return the qvalue.
@see "accept-params | [
"Evaluates",
"and",
"removes",
"the",
"accept",
"parameters",
".",
"<pre",
">",
"accept",
"-",
"params",
"=",
";",
"q",
"=",
"qvalue",
"*",
"(",
"accept",
"-",
"extension",
")",
"accept",
"-",
"extension",
"=",
";",
"token",
"[",
"=",
"(",
"token",
"... | train | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/variant/AcceptHeaders.java#L293-L321 |
amzn/ion-java | src/com/amazon/ion/impl/IonUTF8.java | IonUTF8.packBytesAfter1 | public final static int packBytesAfter1(int unicodeScalar, int utf8Len)
{
int packed_chars;
switch (utf8Len) {
default:
throw new IllegalArgumentException("pack requires len > 1");
case 2:
packed_chars = getByte2Of2(unicodeScalar);
break;
... | java | public final static int packBytesAfter1(int unicodeScalar, int utf8Len)
{
int packed_chars;
switch (utf8Len) {
default:
throw new IllegalArgumentException("pack requires len > 1");
case 2:
packed_chars = getByte2Of2(unicodeScalar);
break;
... | [
"public",
"final",
"static",
"int",
"packBytesAfter1",
"(",
"int",
"unicodeScalar",
",",
"int",
"utf8Len",
")",
"{",
"int",
"packed_chars",
";",
"switch",
"(",
"utf8Len",
")",
"{",
"default",
":",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"pack requires... | converts a unicode code point to a 0-3 bytes of UTF8
encoded data and a length - note this doesn't pack
a 1 byte character and it returns the start character.
this is the unpacking routine
while (_utf8_pretch_byte_count > 0 && offset < limit) {
_utf8_pretch_byte_count--;
buffer[offset++] = (byte)((_utf8_pretch_bytes >>... | [
"converts",
"a",
"unicode",
"code",
"point",
"to",
"a",
"0",
"-",
"3",
"bytes",
"of",
"UTF8",
"encoded",
"data",
"and",
"a",
"length",
"-",
"note",
"this",
"doesn",
"t",
"pack",
"a",
"1",
"byte",
"character",
"and",
"it",
"returns",
"the",
"start",
"... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonUTF8.java#L250-L272 |
Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java | RangeUtils.getSplits | public static List<DeepTokenRange> getSplits(CassandraDeepJobConfig config) {
Map<String, Iterable<Comparable>> tokens = new HashMap<>();
IPartitioner p = getPartitioner(config);
Pair<Session, String> sessionWithHost =
CassandraClientProvider.getSession(
... | java | public static List<DeepTokenRange> getSplits(CassandraDeepJobConfig config) {
Map<String, Iterable<Comparable>> tokens = new HashMap<>();
IPartitioner p = getPartitioner(config);
Pair<Session, String> sessionWithHost =
CassandraClientProvider.getSession(
... | [
"public",
"static",
"List",
"<",
"DeepTokenRange",
">",
"getSplits",
"(",
"CassandraDeepJobConfig",
"config",
")",
"{",
"Map",
"<",
"String",
",",
"Iterable",
"<",
"Comparable",
">",
">",
"tokens",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"IPartitioner",
... | Returns the token ranges that will be mapped to Spark partitions.
@param config the Deep configuration object.
@return the list of computed token ranges. | [
"Returns",
"the",
"token",
"ranges",
"that",
"will",
"be",
"mapped",
"to",
"Spark",
"partitions",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java#L159-L175 |
wcm-io/wcm-io-handler | link/src/main/java/io/wcm/handler/link/type/InternalCrossContextLinkType.java | InternalCrossContextLinkType.getSyntheticLinkResource | public static @NotNull Resource getSyntheticLinkResource(@NotNull ResourceResolver resourceResolver, @NotNull String pageRef) {
Map<String, Object> map = new HashMap<>();
map.put(LinkNameConstants.PN_LINK_TYPE, ID);
map.put(LinkNameConstants.PN_LINK_CROSSCONTEXT_CONTENT_REF, pageRef);
return new Synthet... | java | public static @NotNull Resource getSyntheticLinkResource(@NotNull ResourceResolver resourceResolver, @NotNull String pageRef) {
Map<String, Object> map = new HashMap<>();
map.put(LinkNameConstants.PN_LINK_TYPE, ID);
map.put(LinkNameConstants.PN_LINK_CROSSCONTEXT_CONTENT_REF, pageRef);
return new Synthet... | [
"public",
"static",
"@",
"NotNull",
"Resource",
"getSyntheticLinkResource",
"(",
"@",
"NotNull",
"ResourceResolver",
"resourceResolver",
",",
"@",
"NotNull",
"String",
"pageRef",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
... | Get synthetic link resource for this link type.
@param resourceResolver Resource resolver
@param pageRef Path to target page
@return Synthetic link resource | [
"Get",
"synthetic",
"link",
"resource",
"for",
"this",
"link",
"type",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/link/src/main/java/io/wcm/handler/link/type/InternalCrossContextLinkType.java#L116-L121 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Execution.java | Execution.newInstance | public static Execution newInstance(Specification specification, SystemUnderTest systemUnderTest, XmlReport xmlReport)
{
if(xmlReport.getGlobalException() != null)
{
return error(specification, systemUnderTest, null, xmlReport.getGlobalException());
}
Execution e... | java | public static Execution newInstance(Specification specification, SystemUnderTest systemUnderTest, XmlReport xmlReport)
{
if(xmlReport.getGlobalException() != null)
{
return error(specification, systemUnderTest, null, xmlReport.getGlobalException());
}
Execution e... | [
"public",
"static",
"Execution",
"newInstance",
"(",
"Specification",
"specification",
",",
"SystemUnderTest",
"systemUnderTest",
",",
"XmlReport",
"xmlReport",
")",
"{",
"if",
"(",
"xmlReport",
".",
"getGlobalException",
"(",
")",
"!=",
"null",
")",
"{",
"return"... | <p>newInstance.</p>
@param specification a {@link com.greenpepper.server.domain.Specification} object.
@param systemUnderTest a {@link com.greenpepper.server.domain.SystemUnderTest} object.
@param xmlReport a {@link com.greenpepper.report.XmlReport} object.
@return a {@link com.greenpepper.server.domain.Execution} obj... | [
"<p",
">",
"newInstance",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Execution.java#L89-L127 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java | SARLFormatter._format | protected void _format(SarlAgent agent, IFormattableDocument document) {
formatAnnotations(agent, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations);
formatModifiers(agent, document);
final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(agent);
document.append(regionFo... | java | protected void _format(SarlAgent agent, IFormattableDocument document) {
formatAnnotations(agent, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations);
formatModifiers(agent, document);
final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(agent);
document.append(regionFo... | [
"protected",
"void",
"_format",
"(",
"SarlAgent",
"agent",
",",
"IFormattableDocument",
"document",
")",
"{",
"formatAnnotations",
"(",
"agent",
",",
"document",
",",
"XbaseFormatterPreferenceKeys",
".",
"newLineAfterClassAnnotations",
")",
";",
"formatModifiers",
"(",
... | Format the given SARL agent.
@param agent the SARL component.
@param document the document. | [
"Format",
"the",
"given",
"SARL",
"agent",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L232-L243 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.