repo stringclasses 199
values | path stringlengths 28 169 | func_name stringlengths 6 98 | original_string stringlengths 91 27.2k | language stringclasses 1
value | code stringlengths 91 27.2k | code_tokens listlengths 21 5.01k | docstring stringlengths 1 6.47k | docstring_tokens listlengths 1 587 | sha stringclasses 199
values | url stringlengths 117 257 | partition stringclasses 1
value | summary stringlengths 3 207 | output stringlengths 170 27.3k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
streamsets/datacollector | net-commonlib/src/main/java/com/streamsets/pipeline/lib/parser/net/syslog/SyslogDecoder.java | SyslogDecoder.parseRfc3164Time | public static long parseRfc3164Time(String ts) throws OnRecordErrorException {
LocalDateTime now = LocalDateTime.now();
int year = now.getYear();
ts = TWO_SPACES.matcher(ts).replaceFirst(" ");
LocalDateTime date;
try {
MonthDay monthDay = MonthDay.parse(ts, rfc3164Format);
LocalTime time... | java | public static long parseRfc3164Time(String ts) throws OnRecordErrorException {
LocalDateTime now = LocalDateTime.now();
int year = now.getYear();
ts = TWO_SPACES.matcher(ts).replaceFirst(" ");
LocalDateTime date;
try {
MonthDay monthDay = MonthDay.parse(ts, rfc3164Format);
LocalTime time... | [
"public",
"static",
"long",
"parseRfc3164Time",
"(",
"String",
"ts",
")",
"throws",
"OnRecordErrorException",
"{",
"LocalDateTime",
"now",
"=",
"LocalDateTime",
".",
"now",
"(",
")",
";",
"int",
"year",
"=",
"now",
".",
"getYear",
"(",
")",
";",
"ts",
"=",... | Parse the RFC3164 date format. This is trickier than it sounds because this
format does not specify a year so we get weird edge cases at year
boundaries. This implementation tries to "do what I mean".
@param ts RFC3164-compatible timestamp to be parsed
@return Typical (for Java) milliseconds since the UNIX epoch | [
"Parse",
"the",
"RFC3164",
"date",
"format",
".",
"This",
"is",
"trickier",
"than",
"it",
"sounds",
"because",
"this",
"format",
"does",
"not",
"specify",
"a",
"year",
"so",
"we",
"get",
"weird",
"edge",
"cases",
"at",
"year",
"boundaries",
".",
"This",
... | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/net-commonlib/src/main/java/com/streamsets/pipeline/lib/parser/net/syslog/SyslogDecoder.java#L376-L409 | test | Parse the RFC 3164 time string. | Of course, here is the Java code you requested:
```java
public static long parseRfc3164Time(String ts) throws OnRecordErrorException {
LocalDateTime now = LocalDateTime.now();
int year = now.getYear();
ts = TWO_SPACES.matcher(ts).replaceFirst(" ");
LocalDateTime date;
try {
MonthDay monthDay ... |
jkuhnert/ognl | src/main/java/ognl/enhance/ExpressionCompiler.java | ExpressionCompiler.generateOgnlSetter | protected String generateOgnlSetter(CtClass clazz, CtMethod valueSetter, CtField node)
throws Exception
{
String body = node.getName() + ".setValue($1, $2, $3);";
valueSetter.setBody(body);
clazz.addMethod(valueSetter);
return body;
} | java | protected String generateOgnlSetter(CtClass clazz, CtMethod valueSetter, CtField node)
throws Exception
{
String body = node.getName() + ".setValue($1, $2, $3);";
valueSetter.setBody(body);
clazz.addMethod(valueSetter);
return body;
} | [
"protected",
"String",
"generateOgnlSetter",
"(",
"CtClass",
"clazz",
",",
"CtMethod",
"valueSetter",
",",
"CtField",
"node",
")",
"throws",
"Exception",
"{",
"String",
"body",
"=",
"node",
".",
"getName",
"(",
")",
"+",
"\".setValue($1, $2, $3);\"",
";",
"value... | Fail safe setter creation when normal compilation fails.
@param clazz
The javassist class the new method should be attached to.
@param valueSetter
The method definition the generated code will be contained within.
@param node
The root expression node.
@return The generated source string for this method, the method wil... | [
"Fail",
"safe",
"setter",
"creation",
"when",
"normal",
"compilation",
"fails",
"."
] | 53d51a30c8c299b750dede779d05cb84beee73c3 | https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/enhance/ExpressionCompiler.java#L691-L700 | test | Generate OGNL setter. | Of course, here is the Java code you requested:
```java
protected String generateOgnlSetter(CtClass clazz, CtMethod valueSetter, CtField node)
throws Exception
{
String body = node.getName() + ".setValue($1, $2, $3);";
valueSetter.setBody(body);
clazz.addMethod(valueSetter);
... |
oblac/jodd | jodd-http/src/main/java/jodd/http/HttpMultiMap.java | HttpMultiMap._set | private HttpMultiMap<V> _set(final Iterable<Map.Entry<String, V>> map) {
clear();
for (Map.Entry<String, V> entry : map) {
add(entry.getKey(), entry.getValue());
}
return this;
} | java | private HttpMultiMap<V> _set(final Iterable<Map.Entry<String, V>> map) {
clear();
for (Map.Entry<String, V> entry : map) {
add(entry.getKey(), entry.getValue());
}
return this;
} | [
"private",
"HttpMultiMap",
"<",
"V",
">",
"_set",
"(",
"final",
"Iterable",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"V",
">",
">",
"map",
")",
"{",
"clear",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"V",
">",
"en... | ---------------------------------------------------------------- set/add | [
"----------------------------------------------------------------",
"set",
"/",
"add"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HttpMultiMap.java#L177-L183 | test | Sets the entries in the given map. | Of course, here is the Java code you requested:
```java
private HttpMultiMap<V> _set(final Iterable<Map.Entry<String, V>> map) {
clear();
for (Map.Entry<String, V> entry : map) {
add(entry.getKey(), entry.getValue());
}
return this;
}
```
Hope this helps! |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/chart/ChartData.java | ChartData.getColorListFromDPTWithValueList | private List<XColor> getColorListFromDPTWithValueList(
final List<CTDPt> dptList, final List<ParsedCell> cells,
final ThemesTable themeTable, final ChartObject ctObj) {
List<XColor> colors = new ArrayList<>();
if ((dptList != null) && (cells != null)) {
for (int index = 0; index < cells.size(); inde... | java | private List<XColor> getColorListFromDPTWithValueList(
final List<CTDPt> dptList, final List<ParsedCell> cells,
final ThemesTable themeTable, final ChartObject ctObj) {
List<XColor> colors = new ArrayList<>();
if ((dptList != null) && (cells != null)) {
for (int index = 0; index < cells.size(); inde... | [
"private",
"List",
"<",
"XColor",
">",
"getColorListFromDPTWithValueList",
"(",
"final",
"List",
"<",
"CTDPt",
">",
"dptList",
",",
"final",
"List",
"<",
"ParsedCell",
">",
"cells",
",",
"final",
"ThemesTable",
"themeTable",
",",
"final",
"ChartObject",
"ctObj",... | get color list from dpt.
@param dptList
dpt.
@param cells
cells.
@param themeTable
themetable.
@param ctObj
ctobj.
@return list of xcolor. | [
"get",
"color",
"list",
"from",
"dpt",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/chart/ChartData.java#L233-L251 | test | Gets the color list from a list of CTDPt and cells. | Of course, here is the Java code you requested:
```java
private List<XColor> getColorListFromDPTWithValueList(
final List<CTDPt> dptList, final List<ParsedCell> cells,
final ThemesTable themeTable, final ChartObject ctObj) {
List<XColor> colors = new ArrayList<>();
if ((dptList != null) && (cells != null... |
streamsets/datacollector | container/src/main/java/com/streamsets/datacollector/bundles/SupportBundleManager.java | SupportBundleManager.uploadNewBundle | public void uploadNewBundle(List<String> generators, BundleType bundleType) throws IOException {
List<BundleContentGeneratorDefinition> defs = getRequestedDefinitions(generators);
uploadNewBundleFromInstances(
defs.stream()
.map(BundleContentGeneratorDefinition::createInstance)
.collect(Co... | java | public void uploadNewBundle(List<String> generators, BundleType bundleType) throws IOException {
List<BundleContentGeneratorDefinition> defs = getRequestedDefinitions(generators);
uploadNewBundleFromInstances(
defs.stream()
.map(BundleContentGeneratorDefinition::createInstance)
.collect(Co... | [
"public",
"void",
"uploadNewBundle",
"(",
"List",
"<",
"String",
">",
"generators",
",",
"BundleType",
"bundleType",
")",
"throws",
"IOException",
"{",
"List",
"<",
"BundleContentGeneratorDefinition",
">",
"defs",
"=",
"getRequestedDefinitions",
"(",
"generators",
"... | Instead of providing support bundle directly to user, upload it to StreamSets backend services. | [
"Instead",
"of",
"providing",
"support",
"bundle",
"directly",
"to",
"user",
"upload",
"it",
"to",
"StreamSets",
"backend",
"services",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/bundles/SupportBundleManager.java#L243-L252 | test | Upload a new bundle from the list of generators. | Of course, here is the Java code you requested:
```java
public void uploadNewBundle(List<String> generators, BundleType bundleType) throws IOException {
List<BundleContentGeneratorDefinition> defs = getRequestedDefinitions(generators);
uploadNewBundleFromInstances(
defs.stream()
.map(BundleConten... |
Unidata/thredds | legacy/src/main/java/thredds/catalog/InvDatasetImpl.java | InvDatasetImpl.canonicalize | protected void canonicalize() {
List<InvMetadata> whatsLeft = new ArrayList<>();
List<InvMetadata> original = new ArrayList<>(tm.metadata); // get copy of metadata
tm.metadata = new ArrayList<>();
// transfer all non-inherited thredds metadata to tm
// transfer all inherited thredds metadata to tmi... | java | protected void canonicalize() {
List<InvMetadata> whatsLeft = new ArrayList<>();
List<InvMetadata> original = new ArrayList<>(tm.metadata); // get copy of metadata
tm.metadata = new ArrayList<>();
// transfer all non-inherited thredds metadata to tm
// transfer all inherited thredds metadata to tmi... | [
"protected",
"void",
"canonicalize",
"(",
")",
"{",
"List",
"<",
"InvMetadata",
">",
"whatsLeft",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"InvMetadata",
">",
"original",
"=",
"new",
"ArrayList",
"<>",
"(",
"tm",
".",
"metadata",
")",
... | Put metadata into canonical form.
All non-inherited thredds metadata put into single metadata element, pointed to by getLocalMetadata().
All inherited thredds metadata put into single metadata element, pointed to by getLocalMetadataInherited().
This is needed to do reliable editing. | [
"Put",
"metadata",
"into",
"canonical",
"form",
".",
"All",
"non",
"-",
"inherited",
"thredds",
"metadata",
"put",
"into",
"single",
"metadata",
"element",
"pointed",
"to",
"by",
"getLocalMetadata",
"()",
".",
"All",
"inherited",
"thredds",
"metadata",
"put",
... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/InvDatasetImpl.java#L330-L353 | test | Canonicalizes the metadata. | Of course, here is the Java code you requested:
```java
protected void canonicalize() {
List<InvMetadata> whatsLeft = new ArrayList<>();
List<InvMetadata> original = new ArrayList<>(tm.metadata); // get copy of metadata
tm.metadata = new ArrayList<>();
// transfer all non-inherited thredds metadata to... |
DigitalPebble/storm-crawler | external/aws/src/main/java/com/digitalpebble/stormcrawler/aws/bolt/CloudSearchUtils.java | CloudSearchUtils.getID | public static String getID(String url) {
// the document needs an ID
// see
// http://docs.aws.amazon.com/cloudsearch/latest/developerguide/preparing-data.html#creating-document-batches
// A unique ID for the document. A document ID can contain any
// letter or number and the fo... | java | public static String getID(String url) {
// the document needs an ID
// see
// http://docs.aws.amazon.com/cloudsearch/latest/developerguide/preparing-data.html#creating-document-batches
// A unique ID for the document. A document ID can contain any
// letter or number and the fo... | [
"public",
"static",
"String",
"getID",
"(",
"String",
"url",
")",
"{",
"// the document needs an ID",
"// see",
"// http://docs.aws.amazon.com/cloudsearch/latest/developerguide/preparing-data.html#creating-document-batches",
"// A unique ID for the document. A document ID can contain any",
... | Returns a normalised doc ID based on the URL of a document * | [
"Returns",
"a",
"normalised",
"doc",
"ID",
"based",
"on",
"the",
"URL",
"of",
"a",
"document",
"*"
] | 5d0465192ab8fbd89a90db32cb20960a282411ea | https://github.com/DigitalPebble/storm-crawler/blob/5d0465192ab8fbd89a90db32cb20960a282411ea/external/aws/src/main/java/com/digitalpebble/stormcrawler/aws/bolt/CloudSearchUtils.java#L46-L62 | test | Returns the unique ID for the document. | Of course, here is the Java code you requested:
```java
public static String getID(String url) {
// the document needs an ID
// see
// http://docs.aws.amazon.com/cloudsearch/latest/developerguide/preparing-data.html#creating-document-batches
// A unique ID for the document. A document ... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/dataset/EnhancementsImpl.java | EnhancementsImpl.getDescription | public String getDescription() {
if ((desc == null) && (forVar != null)) {
Attribute att = forVar.findAttributeIgnoreCase( CDM.LONG_NAME);
if ((att != null) && att.isString())
desc = att.getStringValue();
if (desc == null) {
att = forVar.findAttributeIgnoreCase( "descriptio... | java | public String getDescription() {
if ((desc == null) && (forVar != null)) {
Attribute att = forVar.findAttributeIgnoreCase( CDM.LONG_NAME);
if ((att != null) && att.isString())
desc = att.getStringValue();
if (desc == null) {
att = forVar.findAttributeIgnoreCase( "descriptio... | [
"public",
"String",
"getDescription",
"(",
")",
"{",
"if",
"(",
"(",
"desc",
"==",
"null",
")",
"&&",
"(",
"forVar",
"!=",
"null",
")",
")",
"{",
"Attribute",
"att",
"=",
"forVar",
".",
"findAttributeIgnoreCase",
"(",
"CDM",
".",
"LONG_NAME",
")",
";",... | Get the description of the Variable.
Default is to look for attributes in this order: CDM.LONG_NAME, "description", "title", "standard_name". | [
"Get",
"the",
"description",
"of",
"the",
"Variable",
".",
"Default",
"is",
"to",
"look",
"for",
"attributes",
"in",
"this",
"order",
":",
"CDM",
".",
"LONG_NAME",
"description",
"title",
"standard_name",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/EnhancementsImpl.java#L77-L102 | test | Returns the description of the SECTYPE. | Of course, here is the Java code you requested:
```java
public String getDescription() {
if ((desc == null) && (forVar != null)) {
Attribute att = forVar.findAttributeIgnoreCase( CDM.LONG_NAME);
if ((att != null) && att.isString())
desc = att.getStringValue();
if (desc == null) {
... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/resource/locator/SaasUriLocator.java | SaasUriLocator.accept | public boolean accept(final String url) {
if (url == null) return false;
final String extension = FilenameUtils.getExtension(url);
// scss file have either no extension or scss
// maybe check for the "_"?
if ("".equals(extension) || "scss".equals(extension)) {
boolean... | java | public boolean accept(final String url) {
if (url == null) return false;
final String extension = FilenameUtils.getExtension(url);
// scss file have either no extension or scss
// maybe check for the "_"?
if ("".equals(extension) || "scss".equals(extension)) {
boolean... | [
"public",
"boolean",
"accept",
"(",
"final",
"String",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"return",
"false",
";",
"final",
"String",
"extension",
"=",
"FilenameUtils",
".",
"getExtension",
"(",
"url",
")",
";",
"// scss file have either no... | {@inheritDoc} | [
"{"
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/locator/SaasUriLocator.java#L42-L56 | test | Check if the URL is a valid CRASS URL. | Of course, here is the Java code you requested:
```java
public boolean accept(final String url) {
if (url == null) return false;
final String extension = FilenameUtils.getExtension(url);
// scss file have either no extension or scss
// maybe check for the "_"?
if ("".equals(exte... |
cologneintelligence/FitGoodies | fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/file/FileSystemDirectoryHelper.java | FileSystemDirectoryHelper.dirDepth | public int dirDepth(final File path) {
final String stringPath = path.getPath();
return stringPath.length() - stringPath.replaceAll("[/\\\\]", "").length();
} | java | public int dirDepth(final File path) {
final String stringPath = path.getPath();
return stringPath.length() - stringPath.replaceAll("[/\\\\]", "").length();
} | [
"public",
"int",
"dirDepth",
"(",
"final",
"File",
"path",
")",
"{",
"final",
"String",
"stringPath",
"=",
"path",
".",
"getPath",
"(",
")",
";",
"return",
"stringPath",
".",
"length",
"(",
")",
"-",
"stringPath",
".",
"replaceAll",
"(",
"\"[/\\\\\\\\]\"",... | Counts the number of directories in a given path.
@param path the path to analyze
@return number of directories | [
"Counts",
"the",
"number",
"of",
"directories",
"in",
"a",
"given",
"path",
"."
] | 834e42d1f41b4b9226060b1e83a80cc69ea88c7b | https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/file/FileSystemDirectoryHelper.java#L250-L253 | test | Get the directory depth. | Of course, here is the Java code you requested:
```java
public int dirDepth(final File path) {
final String stringPath = path.getPath();
return stringPath.length() - stringPath.replaceAll("[/\\\\]", "").length();
}
```
Hope this helps! |
orientechnologies/orientdb | server/src/main/java/com/orientechnologies/orient/server/security/authenticator/OSystemUserAuthenticator.java | OSystemUserAuthenticator.isAuthorized | public boolean isAuthorized(final String username, final String resource) {
if (username == null || resource == null)
return false;
try {
if (getServer() != null) {
OUser user = getServer().getSecurity().getSystemUser(username, null);
if (user != null && user.getAccountStatus() == ... | java | public boolean isAuthorized(final String username, final String resource) {
if (username == null || resource == null)
return false;
try {
if (getServer() != null) {
OUser user = getServer().getSecurity().getSystemUser(username, null);
if (user != null && user.getAccountStatus() == ... | [
"public",
"boolean",
"isAuthorized",
"(",
"final",
"String",
"username",
",",
"final",
"String",
"resource",
")",
"{",
"if",
"(",
"username",
"==",
"null",
"||",
"resource",
"==",
"null",
")",
"return",
"false",
";",
"try",
"{",
"if",
"(",
"getServer",
"... | Checks to see if a | [
"Checks",
"to",
"see",
"if",
"a"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/security/authenticator/OSystemUserAuthenticator.java#L87-L118 | test | Check if the user is authorized to access the specified resource. | Of course, here is the Java code you requested:
```java
public boolean isAuthorized(final String username, final String resource) {
if (username == null || resource == null)
return false;
try {
if (getServer() != null) {
OUser user = getServer().getSecurity().getSystemUser(username, null);... |
js-lib-com/tiny-container | src/main/java/js/http/form/FormIteratorImpl.java | FormIteratorImpl.hasNext | @Override
public boolean hasNext() {
try {
if (currentPart != null) {
currentPart.close();
}
if (!fileItemIterator.hasNext()) {
return false;
}
FileItemStream fileItemStream = fileItemIterator.next();
if (fileItemStream.isFormField()) {
currentPart = new FormFieldImpl(fileIte... | java | @Override
public boolean hasNext() {
try {
if (currentPart != null) {
currentPart.close();
}
if (!fileItemIterator.hasNext()) {
return false;
}
FileItemStream fileItemStream = fileItemIterator.next();
if (fileItemStream.isFormField()) {
currentPart = new FormFieldImpl(fileIte... | [
"@",
"Override",
"public",
"boolean",
"hasNext",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"currentPart",
"!=",
"null",
")",
"{",
"currentPart",
".",
"close",
"(",
")",
";",
"}",
"if",
"(",
"!",
"fileItemIterator",
".",
"hasNext",
"(",
")",
")",
"{",
"... | Test if there are more parts on this form iterator. This implementation has side effects: it takes care to close form
parts while traversing form iterator.
@return true if there is at least one available form part. | [
"Test",
"if",
"there",
"are",
"more",
"parts",
"on",
"this",
"form",
"iterator",
".",
"This",
"implementation",
"has",
"side",
"effects",
":",
"it",
"takes",
"care",
"to",
"close",
"form",
"parts",
"while",
"traversing",
"form",
"iterator",
"."
] | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/http/form/FormIteratorImpl.java#L122-L142 | test | Retrieves the next file item from the fileItemIterator. | Of course, here is the Java code you requested:
```java
@Override
public boolean hasNext() {
try {
if (currentPart != null) {
currentPart.close();
}
if (!fileItemIterator.hasNext()) {
return false;
}
FileItemStream fileItemStream = fileItemIterator.next();
if (fileItemStream.isFo... |
Unidata/thredds | grib/src/main/java/ucar/nc2/grib/collection/Grib2PartitionBuilderFromIndex.java | Grib2PartitionBuilderFromIndex.readExtensions | @Override
protected boolean readExtensions(GribCollectionProto.GribCollection proto) {
pc.isPartitionOfPartitions = proto.getIsPartitionOfPartitions();
List<Integer> list = proto.getRun2PartList();
pc.run2part = new int[list.size()];
int count = 0;
for (int partno : list)
pc.run2part[count+... | java | @Override
protected boolean readExtensions(GribCollectionProto.GribCollection proto) {
pc.isPartitionOfPartitions = proto.getIsPartitionOfPartitions();
List<Integer> list = proto.getRun2PartList();
pc.run2part = new int[list.size()];
int count = 0;
for (int partno : list)
pc.run2part[count+... | [
"@",
"Override",
"protected",
"boolean",
"readExtensions",
"(",
"GribCollectionProto",
".",
"GribCollection",
"proto",
")",
"{",
"pc",
".",
"isPartitionOfPartitions",
"=",
"proto",
".",
"getIsPartitionOfPartitions",
"(",
")",
";",
"List",
"<",
"Integer",
">",
"lis... | /*
extend GribCollection {
repeated Partition partitions = 100;
required bool isPartitionOfPartitions = 101;
repeated uint32 run2part = 102; // masterRuntime index to partition index
} | [
"/",
"*",
"extend",
"GribCollection",
"{",
"repeated",
"Partition",
"partitions",
"=",
"100",
";",
"required",
"bool",
"isPartitionOfPartitions",
"=",
"101",
";",
"repeated",
"uint32",
"run2part",
"=",
"102",
";",
"//",
"masterRuntime",
"index",
"to",
"partition... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/collection/Grib2PartitionBuilderFromIndex.java#L73-L88 | test | read extensions from GribCollection | Of course, here is the Java code you requested:
```java
@Override
protected boolean readExtensions(GribCollectionProto.GribCollection proto) {
pc.isPartitionOfPartitions = proto.getIsPartitionOfPartitions();
List<Integer> list = proto.getRun2PartList();
pc.run2part = new int[list.size()];
int count ... |
Unidata/thredds | opendap/src/main/java/opendap/dap/parsers/DDSXMLParser.java | DDSXMLParser.parse | public void parse(Document ddx, DDS targetDDS, BaseTypeFactory fac, boolean validation) throws DAP2Exception {
dds = targetDDS;
factory = fac;
// Build up the OPeNDAP data objects rpresented by the XML document.
// Additional validation will take place during this process.
... | java | public void parse(Document ddx, DDS targetDDS, BaseTypeFactory fac, boolean validation) throws DAP2Exception {
dds = targetDDS;
factory = fac;
// Build up the OPeNDAP data objects rpresented by the XML document.
// Additional validation will take place during this process.
... | [
"public",
"void",
"parse",
"(",
"Document",
"ddx",
",",
"DDS",
"targetDDS",
",",
"BaseTypeFactory",
"fac",
",",
"boolean",
"validation",
")",
"throws",
"DAP2Exception",
"{",
"dds",
"=",
"targetDDS",
";",
"factory",
"=",
"fac",
";",
"// Build up the OPeNDAP data ... | Parse the DDX waiting in the <code>InputStream</code> and instantiate all of
the member <code>BaseType</code> variables and their associated <code>Attributes
</code> into a <code>DDS</code> using the passed <code>BaseTypeFactory</code>
@param ddx A JDOM <code>Document</code> containing the DDX to parse.
@param ... | [
"Parse",
"the",
"DDX",
"waiting",
"in",
"the",
"<code",
">",
"InputStream<",
"/",
"code",
">",
"and",
"instantiate",
"all",
"of",
"the",
"member",
"<code",
">",
"BaseType<",
"/",
"code",
">",
"variables",
"and",
"their",
"associated",
"<code",
">",
"Attrib... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/parsers/DDSXMLParser.java#L150-L200 | test | Parses the DDS object from the given document and sets the appropriate attributes and aliases in the target DDS object. | Of course, here is the Java code you requested:
```java
public void parse(Document ddx, DDS targetDDS, BaseTypeFactory fac, boolean validation) throws DAP2Exception {
dds = targetDDS;
factory = fac;
// Build up the OPeNDAP data objects rpresented by the XML document.
// Addition... |
rupertlssmith/lojix | lojix/search/src/main/com/thesett/aima/search/examples/eightpuzzle/EightPuzzleState.java | EightPuzzleState.swapTiles | protected boolean swapTiles(int x1, int y1, int x2, int y2)
{
// Used to indicate that one of the swapped tiles was the empty tile
boolean swappedEmpty = false;
// Get the tile at the first position
char tile1 = board[y1][x1];
// Store the tile from the second position at t... | java | protected boolean swapTiles(int x1, int y1, int x2, int y2)
{
// Used to indicate that one of the swapped tiles was the empty tile
boolean swappedEmpty = false;
// Get the tile at the first position
char tile1 = board[y1][x1];
// Store the tile from the second position at t... | [
"protected",
"boolean",
"swapTiles",
"(",
"int",
"x1",
",",
"int",
"y1",
",",
"int",
"x2",
",",
"int",
"y2",
")",
"{",
"// Used to indicate that one of the swapped tiles was the empty tile",
"boolean",
"swappedEmpty",
"=",
"false",
";",
"// Get the tile at the first pos... | Swaps the two tiles at the specified coordinates. One of the tiles may be the empty tile and the empty tile
position will be correctly updated. If neither of the tiles is empty then this is an illegal swap in which case
the method returns true.
@param x1 the X position of tile 1
@param y1 the Y position of tile 1
@p... | [
"Swaps",
"the",
"two",
"tiles",
"at",
"the",
"specified",
"coordinates",
".",
"One",
"of",
"the",
"tiles",
"may",
"be",
"the",
"empty",
"tile",
"and",
"the",
"empty",
"tile",
"position",
"will",
"be",
"correctly",
"updated",
".",
"If",
"neither",
"of",
"... | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/search/src/main/com/thesett/aima/search/examples/eightpuzzle/EightPuzzleState.java#L581-L614 | test | Swaps the empty tiles in the image. | Of course, here is the Java code you requested:
```java
protected boolean swapTiles(int x1, int y1, int x2, int y2)
{
// Used to indicate that one of the swapped tiles was the empty tile
boolean swappedEmpty = false;
// Get the tile at the first position
char tile1 = board[y1][x1];... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java | CoverageDataPng.drawTile | public CoverageDataPngImage drawTile(short[][] pixelValues) {
int tileWidth = pixelValues[0].length;
int tileHeight = pixelValues.length;
CoverageDataPngImage image = createImage(tileWidth, tileHeight);
PngWriter writer = image.getWriter();
for (int y = 0; y < tileHeight; y++) ... | java | public CoverageDataPngImage drawTile(short[][] pixelValues) {
int tileWidth = pixelValues[0].length;
int tileHeight = pixelValues.length;
CoverageDataPngImage image = createImage(tileWidth, tileHeight);
PngWriter writer = image.getWriter();
for (int y = 0; y < tileHeight; y++) ... | [
"public",
"CoverageDataPngImage",
"drawTile",
"(",
"short",
"[",
"]",
"[",
"]",
"pixelValues",
")",
"{",
"int",
"tileWidth",
"=",
"pixelValues",
"[",
"0",
"]",
".",
"length",
";",
"int",
"tileHeight",
"=",
"pixelValues",
".",
"length",
";",
"CoverageDataPngI... | Draw a coverage data tile from the double array of "unsigned short" pixel
values formatted as short[row][width]
@param pixelValues "unsigned short" pixel values as [row][width]
@return coverage data image tile | [
"Draw",
"a",
"coverage",
"data",
"tile",
"from",
"the",
"double",
"array",
"of",
"unsigned",
"short",
"pixel",
"values",
"formatted",
"as",
"short",
"[",
"row",
"]",
"[",
"width",
"]"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L233-L253 | test | Draw a tile of pixels. | Of course, here is the Java code you requested:
```java
public CoverageDataPngImage drawTile(short[][] pixelValues) {
int tileWidth = pixelValues[0].length;
int tileHeight = pixelValues.length;
CoverageDataPngImage image = createImage(tileWidth, tileHeight);
PngWriter writer = image.g... |
jboss/jboss-common-core | src/main/java/org/jboss/util/Classes.java | Classes.stripPackageName | public static String stripPackageName(final String classname)
{
int idx = classname.lastIndexOf(PACKAGE_SEPARATOR);
if (idx != -1)
return classname.substring(idx + 1, classname.length());
return classname;
} | java | public static String stripPackageName(final String classname)
{
int idx = classname.lastIndexOf(PACKAGE_SEPARATOR);
if (idx != -1)
return classname.substring(idx + 1, classname.length());
return classname;
} | [
"public",
"static",
"String",
"stripPackageName",
"(",
"final",
"String",
"classname",
")",
"{",
"int",
"idx",
"=",
"classname",
".",
"lastIndexOf",
"(",
"PACKAGE_SEPARATOR",
")",
";",
"if",
"(",
"idx",
"!=",
"-",
"1",
")",
"return",
"classname",
".",
"sub... | Get the short name of the specified class by striping off the package
name.
@param classname Class name.
@return Short class name. | [
"Get",
"the",
"short",
"name",
"of",
"the",
"specified",
"class",
"by",
"striping",
"off",
"the",
"package",
"name",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/Classes.java#L215-L222 | test | Removes the package name from the classname. | Of course, here is the Java code you requested:
```java
public static String stripPackageName(final String classname)
{
int idx = classname.lastIndexOf(PACKAGE_SEPARATOR);
if (idx != -1)
return classname.substring(idx + 1, classname.length());
return classname;
}
```
Hope this helps! |
real-logic/aeron | aeron-client/src/main/java/io/aeron/logbuffer/HeaderWriter.java | HeaderWriter.write | public void write(final UnsafeBuffer termBuffer, final int offset, final int length, final int termId)
{
termBuffer.putLongOrdered(offset + FRAME_LENGTH_FIELD_OFFSET, versionFlagsType | ((-length) & 0xFFFF_FFFFL));
UnsafeAccess.UNSAFE.storeFence();
termBuffer.putLong(offset + TERM_OFFSET_FI... | java | public void write(final UnsafeBuffer termBuffer, final int offset, final int length, final int termId)
{
termBuffer.putLongOrdered(offset + FRAME_LENGTH_FIELD_OFFSET, versionFlagsType | ((-length) & 0xFFFF_FFFFL));
UnsafeAccess.UNSAFE.storeFence();
termBuffer.putLong(offset + TERM_OFFSET_FI... | [
"public",
"void",
"write",
"(",
"final",
"UnsafeBuffer",
"termBuffer",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
",",
"final",
"int",
"termId",
")",
"{",
"termBuffer",
".",
"putLongOrdered",
"(",
"offset",
"+",
"FRAME_LENGTH_FIELD_OFFSET",
... | Write a header to the term buffer in {@link ByteOrder#LITTLE_ENDIAN} format using the minimum instructions.
@param termBuffer to be written to.
@param offset at which the header should be written.
@param length of the fragment including the header.
@param termId of the current term buffer. | [
"Write",
"a",
"header",
"to",
"the",
"term",
"buffer",
"in",
"{",
"@link",
"ByteOrder#LITTLE_ENDIAN",
"}",
"format",
"using",
"the",
"minimum",
"instructions",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/logbuffer/HeaderWriter.java#L76-L83 | test | Write the content of this entry to the given buffer. | Of course, here is the Java code you requested:
```java
public void write(final UnsafeBuffer termBuffer, final int offset, final int length, final int termId)
{
termBuffer.putLongOrdered(offset + FRAME_LENGTH_FIELD_OFFSET, versionFlagsType | ((-length) & 0xFFFF_FFFFL));
UnsafeAccess.UNSAFE.storeFen... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormDefinitionClient.java | FormDefinitionClient.getFormDefinitionById | public Form getFormDefinitionById(Long formDefinitionIdParam)
{
Form form = new Form(formDefinitionIdParam);
if(this.serviceTicket != null)
{
form.setServiceTicket(this.serviceTicket);
}
return new Form(this.postJson(
form, WS.Path.FormDefinition... | java | public Form getFormDefinitionById(Long formDefinitionIdParam)
{
Form form = new Form(formDefinitionIdParam);
if(this.serviceTicket != null)
{
form.setServiceTicket(this.serviceTicket);
}
return new Form(this.postJson(
form, WS.Path.FormDefinition... | [
"public",
"Form",
"getFormDefinitionById",
"(",
"Long",
"formDefinitionIdParam",
")",
"{",
"Form",
"form",
"=",
"new",
"Form",
"(",
"formDefinitionIdParam",
")",
";",
"if",
"(",
"this",
".",
"serviceTicket",
"!=",
"null",
")",
"{",
"form",
".",
"setServiceTick... | Retrieves the Form Definition by Primary key.
@param formDefinitionIdParam The Form Definition primary key.
@return Form by Primary key. | [
"Retrieves",
"the",
"Form",
"Definition",
"by",
"Primary",
"key",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormDefinitionClient.java#L101-L112 | test | Gets a Form definition by ID. | Of course, here is the Java code you requested:
```java
public Form getFormDefinitionById(Long formDefinitionIdParam)
{
Form form = new Form(formDefinitionIdParam);
if(this.serviceTicket != null)
{
form.setServiceTicket(this.serviceTicket);
}
return new Form(th... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/sql/OFilterAnalyzer.java | OFilterAnalyzer.analyzeCondition | public List<OIndexSearchResult> analyzeCondition(OSQLFilterCondition condition, final OClass schemaClass,
OCommandContext context) {
final List<OIndexSearchResult> indexSearchResults = new ArrayList<OIndexSearchResult>();
OIndexSearchResult lastCondition = analyzeFilterBranch(schemaClass, condition, inde... | java | public List<OIndexSearchResult> analyzeCondition(OSQLFilterCondition condition, final OClass schemaClass,
OCommandContext context) {
final List<OIndexSearchResult> indexSearchResults = new ArrayList<OIndexSearchResult>();
OIndexSearchResult lastCondition = analyzeFilterBranch(schemaClass, condition, inde... | [
"public",
"List",
"<",
"OIndexSearchResult",
">",
"analyzeCondition",
"(",
"OSQLFilterCondition",
"condition",
",",
"final",
"OClass",
"schemaClass",
",",
"OCommandContext",
"context",
")",
"{",
"final",
"List",
"<",
"OIndexSearchResult",
">",
"indexSearchResults",
"=... | Analyzes a query filter for a possible indexation options. The results are sorted by amount of fields. So the most specific
items go first.
@param condition to analyze
@param schemaClass the class that is scanned by query
@param context of the query
@return list of OIndexSearchResult items | [
"Analyzes",
"a",
"query",
"filter",
"for",
"a",
"possible",
"indexation",
"options",
".",
"The",
"results",
"are",
"sorted",
"by",
"amount",
"of",
"fields",
".",
"So",
"the",
"most",
"specific",
"items",
"go",
"first",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/OFilterAnalyzer.java#L97-L113 | test | Analyze condition. | Of course, here is the Java code you requested:
```java
public List<OIndexSearchResult> analyzeCondition(OSQLFilterCondition condition, final OClass schemaClass,
OCommandContext context) {
final List<OIndexSearchResult> indexSearchResults = new ArrayList<OIndexSearchResult>();
OIndexSearchResult lastCon... |
vibur/vibur-dbcp | src/main/java/org/vibur/dbcp/stcache/ClhmStatementCache.java | ClhmStatementCache.getListener | private static EvictionListener<StatementMethod, StatementHolder> getListener() {
return new EvictionListener<StatementMethod, StatementHolder>() {
@Override
public void onEviction(StatementMethod statementMethod, StatementHolder statementHolder) {
if (statementHolder.sta... | java | private static EvictionListener<StatementMethod, StatementHolder> getListener() {
return new EvictionListener<StatementMethod, StatementHolder>() {
@Override
public void onEviction(StatementMethod statementMethod, StatementHolder statementHolder) {
if (statementHolder.sta... | [
"private",
"static",
"EvictionListener",
"<",
"StatementMethod",
",",
"StatementHolder",
">",
"getListener",
"(",
")",
"{",
"return",
"new",
"EvictionListener",
"<",
"StatementMethod",
",",
"StatementHolder",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
... | Creates and returns a new EvictionListener for the CLHM. It is worth noting that this
EvictionListener is called in the context of the thread that has executed an insert (putIfAbsent)
operation which has increased the CLHM size above its maxSize - in which case the CLHM
evicts its LRU entry.
@return a new EvictionList... | [
"Creates",
"and",
"returns",
"a",
"new",
"EvictionListener",
"for",
"the",
"CLHM",
".",
"It",
"is",
"worth",
"noting",
"that",
"this",
"EvictionListener",
"is",
"called",
"in",
"the",
"context",
"of",
"the",
"thread",
"that",
"has",
"executed",
"an",
"insert... | 9f3f0a2b41f1a76a4e408446e9e444db7ad8f1c2 | https://github.com/vibur/vibur-dbcp/blob/9f3f0a2b41f1a76a4e408446e9e444db7ad8f1c2/src/main/java/org/vibur/dbcp/stcache/ClhmStatementCache.java#L72-L84 | test | Get listener. | Of course, here is the Java code you requested:
```java
private static EvictionListener<StatementMethod, StatementHolder> getListener() {
return new EvictionListener<StatementMethod, StatementHolder>() {
@Override
public void onEviction(StatementMethod statementMethod, StatementHolder s... |
oblac/jodd | jodd-bean/src/main/java/jodd/bean/BeanUtilBean.java | BeanUtilBean.setSimpleProperty | @SuppressWarnings({"unchecked"})
protected void setSimpleProperty(final BeanProperty bp, final Object value) {
Setter setter = bp.getSetter(isDeclared);
// try: setter
if (setter != null) {
invokeSetter(setter, bp, value);
return;
}
// try: put("property", value)
if (bp.isMap()) {
((Map) bp.bean... | java | @SuppressWarnings({"unchecked"})
protected void setSimpleProperty(final BeanProperty bp, final Object value) {
Setter setter = bp.getSetter(isDeclared);
// try: setter
if (setter != null) {
invokeSetter(setter, bp, value);
return;
}
// try: put("property", value)
if (bp.isMap()) {
((Map) bp.bean... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"protected",
"void",
"setSimpleProperty",
"(",
"final",
"BeanProperty",
"bp",
",",
"final",
"Object",
"value",
")",
"{",
"Setter",
"setter",
"=",
"bp",
".",
"getSetter",
"(",
"isDeclared",
")",
";... | Sets a value of simple property. | [
"Sets",
"a",
"value",
"of",
"simple",
"property",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/bean/BeanUtilBean.java#L204-L223 | test | Sets a simple property. | Of course, here is the Java code you requested:
```java
@SuppressWarnings({"unchecked"})
protected void setSimpleProperty(final BeanProperty bp, final Object value) {
Setter setter = bp.getSetter(isDeclared);
// try: setter
if (setter != null) {
invokeSetter(setter, bp, value);
return;
}
// try: put... |
objectify/objectify | src/main/java/com/googlecode/objectify/impl/Registrar.java | Registrar.getMetadataSafe | public <T> EntityMetadata<T> getMetadataSafe(String kind) throws IllegalArgumentException {
EntityMetadata<T> metadata = this.getMetadata(kind);
if (metadata == null)
throw new IllegalArgumentException("No entity class has been registered which matches kind '" + kind + "'");
else
return metadata;
} | java | public <T> EntityMetadata<T> getMetadataSafe(String kind) throws IllegalArgumentException {
EntityMetadata<T> metadata = this.getMetadata(kind);
if (metadata == null)
throw new IllegalArgumentException("No entity class has been registered which matches kind '" + kind + "'");
else
return metadata;
} | [
"public",
"<",
"T",
">",
"EntityMetadata",
"<",
"T",
">",
"getMetadataSafe",
"(",
"String",
"kind",
")",
"throws",
"IllegalArgumentException",
"{",
"EntityMetadata",
"<",
"T",
">",
"metadata",
"=",
"this",
".",
"getMetadata",
"(",
"kind",
")",
";",
"if",
"... | Gets metadata for the specified kind
@throws IllegalArgumentException if the kind has not been registered | [
"Gets",
"metadata",
"for",
"the",
"specified",
"kind"
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/Registrar.java#L100-L106 | test | Gets the entity metadata safe. | Of course, here is the Java code you requested:
```java
public <T> EntityMetadata<T> getMetadataSafe(String kind) throws IllegalArgumentException {
EntityMetadata<T> metadata = this.getMetadata(kind);
if (metadata == null)
throw new IllegalArgumentException("No entity class has been registered which matches ... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/extension/related/UserMappingDao.java | UserMappingDao.buildWhereIds | private String buildWhereIds(long baseId, long relatedId) {
StringBuilder where = new StringBuilder();
where.append(buildWhere(UserMappingTable.COLUMN_BASE_ID, baseId));
where.append(" AND ");
where.append(buildWhere(UserMappingTable.COLUMN_RELATED_ID, relatedId));
return where... | java | private String buildWhereIds(long baseId, long relatedId) {
StringBuilder where = new StringBuilder();
where.append(buildWhere(UserMappingTable.COLUMN_BASE_ID, baseId));
where.append(" AND ");
where.append(buildWhere(UserMappingTable.COLUMN_RELATED_ID, relatedId));
return where... | [
"private",
"String",
"buildWhereIds",
"(",
"long",
"baseId",
",",
"long",
"relatedId",
")",
"{",
"StringBuilder",
"where",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"where",
".",
"append",
"(",
"buildWhere",
"(",
"UserMappingTable",
".",
"COLUMN_BASE_ID",
",... | Build the where ids clause
@param baseId base id
@param relatedId related id
@return where clause | [
"Build",
"the",
"where",
"ids",
"clause"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/related/UserMappingDao.java#L309-L317 | test | Build where ids. | Of course, here is the Java code you requested:
```java
private String buildWhereIds(long baseId, long relatedId) {
StringBuilder where = new StringBuilder();
where.append(buildWhere(UserMappingTable.COLUMN_BASE_ID, baseId));
where.append(" AND ");
where.append(buildWhere(UserMappingTa... |
lessthanoptimal/GeoRegression | main/src/georegression/geometry/UtilPolygons2D_F64.java | UtilPolygons2D_F64.convert | public static void convert( RectangleLength2D_I32 input , Quadrilateral_F64 output ) {
output.a.x = input.x0;
output.a.y = input.y0;
output.b.x = input.x0+input.width-1;
output.b.y = input.y0;
output.c.x = input.x0+input.width-1;
output.c.y = input.y0+input.height-1;
output.d.x = input.x0;
output.d.y... | java | public static void convert( RectangleLength2D_I32 input , Quadrilateral_F64 output ) {
output.a.x = input.x0;
output.a.y = input.y0;
output.b.x = input.x0+input.width-1;
output.b.y = input.y0;
output.c.x = input.x0+input.width-1;
output.c.y = input.y0+input.height-1;
output.d.x = input.x0;
output.d.y... | [
"public",
"static",
"void",
"convert",
"(",
"RectangleLength2D_I32",
"input",
",",
"Quadrilateral_F64",
"output",
")",
"{",
"output",
".",
"a",
".",
"x",
"=",
"input",
".",
"x0",
";",
"output",
".",
"a",
".",
"y",
"=",
"input",
".",
"y0",
";",
"output"... | Converts a rectangle into a quadrilateral
@param input Rectangle.
@param output Quadrilateral. Modified. | [
"Converts",
"a",
"rectangle",
"into",
"a",
"quadrilateral"
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilPolygons2D_F64.java#L148-L160 | test | Converts a rectangle length 2D image into a Quadrilateral image. | Of course, here is the Java code you requested:
```java
public static void convert( RectangleLength2D_I32 input , Quadrilateral_F64 output ) {
output.a.x = input.x0;
output.a.y = input.y0;
output.b.x = input.x0+input.width-1;
output.b.y = input.y0;
output.c.x = input.x0+input.width-1;
output.c.y = input.... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/util/maps/HashArray.java | HashArray.put | public V put(K key, V value)
{
// Remove any existing matching key from the data
V removedObject = remove(key);
// Insert the data into the array
data.add(value);
// Insert a key into the map that points to the end of the array
keyToIndex.put(key, data.size() - 1);
... | java | public V put(K key, V value)
{
// Remove any existing matching key from the data
V removedObject = remove(key);
// Insert the data into the array
data.add(value);
// Insert a key into the map that points to the end of the array
keyToIndex.put(key, data.size() - 1);
... | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"// Remove any existing matching key from the data",
"V",
"removedObject",
"=",
"remove",
"(",
"key",
")",
";",
"// Insert the data into the array",
"data",
".",
"add",
"(",
"value",
")",
";",
... | Associates the specified value with the specified key in this map.
@param key The key to store against in this map.
@param value The value to store against the key.
@return The value that was previously stored against the key, or null if there was none. | [
"Associates",
"the",
"specified",
"value",
"with",
"the",
"specified",
"key",
"in",
"this",
"map",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/maps/HashArray.java#L357-L374 | test | Put a value into the array
. | Of course, here is the Java code you requested:
```java
public V put(K key, V value)
{
// Remove any existing matching key from the data
V removedObject = remove(key);
// Insert the data into the array
data.add(value);
// Insert a key into the map that points to the end of... |
deeplearning4j/nd4j | nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.getPointer | @Override
public Pointer getPointer(DataBuffer buffer, CudaContext context) {
return memoryHandler.getDevicePointer(buffer, context);
} | java | @Override
public Pointer getPointer(DataBuffer buffer, CudaContext context) {
return memoryHandler.getDevicePointer(buffer, context);
} | [
"@",
"Override",
"public",
"Pointer",
"getPointer",
"(",
"DataBuffer",
"buffer",
",",
"CudaContext",
"context",
")",
"{",
"return",
"memoryHandler",
".",
"getDevicePointer",
"(",
"buffer",
",",
"context",
")",
";",
"}"
] | This method returns actual device pointer valid for current object
@param buffer | [
"This",
"method",
"returns",
"actual",
"device",
"pointer",
"valid",
"for",
"current",
"object"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L266-L269 | test | Get the Pointer of the device | Of course, here is the Java code you requested:
```java
@Override
public Pointer getPointer(DataBuffer buffer, CudaContext context) {
return memoryHandler.getDevicePointer(buffer, context);
}
```
Hope this helps! |
ReactiveX/RxJava | src/main/java/io/reactivex/Single.java | Single.delaySubscription | @CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> delaySubscription(CompletableSource other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new SingleDelayWithCompletable<T>(this, other));
} | java | @CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> delaySubscription(CompletableSource other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new SingleDelayWithCompletable<T>(this, other));
} | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Single",
"<",
"T",
">",
"delaySubscription",
"(",
"CompletableSource",
"other",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
... | Delays the actual subscription to the current Single until the given other CompletableSource
completes.
<p>If the delaying source signals an error, that error is re-emitted and no subscription
to the current Single happens.
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code delaySubscription} does not operate by default on a p... | [
"Delays",
"the",
"actual",
"subscription",
"to",
"the",
"current",
"Single",
"until",
"the",
"given",
"other",
"CompletableSource",
"completes",
".",
"<p",
">",
"If",
"the",
"delaying",
"source",
"signals",
"an",
"error",
"that",
"error",
"is",
"re",
"-",
"e... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Single.java#L2239-L2245 | test | Delays the subscription of this Single with the given CompletableSource. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> delaySubscription(CompletableSource other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new SingleDela... |
wildfly/wildfly | ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java | TimerServiceImpl.getAllTimers | @Override
public Collection<Timer> getAllTimers() throws IllegalStateException, EJBException {
// query the registry
if (this.timerServiceRegistry != null) {
return this.timerServiceRegistry.getAllActiveTimers();
}
// if we don't have the registry (shouldn't really happen... | java | @Override
public Collection<Timer> getAllTimers() throws IllegalStateException, EJBException {
// query the registry
if (this.timerServiceRegistry != null) {
return this.timerServiceRegistry.getAllActiveTimers();
}
// if we don't have the registry (shouldn't really happen... | [
"@",
"Override",
"public",
"Collection",
"<",
"Timer",
">",
"getAllTimers",
"(",
")",
"throws",
"IllegalStateException",
",",
"EJBException",
"{",
"// query the registry",
"if",
"(",
"this",
".",
"timerServiceRegistry",
"!=",
"null",
")",
"{",
"return",
"this",
... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java#L425-L434 | test | Returns all the active timers for this EJB module. | Of course, here is the Java code you requested:
```java
@Override
public Collection<Timer> getAllTimers() throws IllegalStateException, EJBException {
// query the registry
if (this.timerServiceRegistry != null) {
return this.timerServiceRegistry.getAllActiveTimers();
}
... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/sql/executor/OSelectExecutionPlanner.java | OSelectExecutionPlanner.moveFlattededEqualitiesLeft | private static List<OAndBlock> moveFlattededEqualitiesLeft(List<OAndBlock> flattenedWhereClause) {
if (flattenedWhereClause == null) {
return null;
}
List<OAndBlock> result = new ArrayList<>();
for (OAndBlock block : flattenedWhereClause) {
List<OBooleanExpression> equalityExpressions = new... | java | private static List<OAndBlock> moveFlattededEqualitiesLeft(List<OAndBlock> flattenedWhereClause) {
if (flattenedWhereClause == null) {
return null;
}
List<OAndBlock> result = new ArrayList<>();
for (OAndBlock block : flattenedWhereClause) {
List<OBooleanExpression> equalityExpressions = new... | [
"private",
"static",
"List",
"<",
"OAndBlock",
">",
"moveFlattededEqualitiesLeft",
"(",
"List",
"<",
"OAndBlock",
">",
"flattenedWhereClause",
")",
"{",
"if",
"(",
"flattenedWhereClause",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"OAndBl... | re-writes a list of flat AND conditions, moving left all the equality operations
@param flattenedWhereClause
@return | [
"re",
"-",
"writes",
"a",
"list",
"of",
"flat",
"AND",
"conditions",
"moving",
"left",
"all",
"the",
"equality",
"operations"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OSelectExecutionPlanner.java#L738-L766 | test | Move the flattened equalities left. | Of course, here is the Java code you requested:
```java
private static List<OAndBlock> moveFlattededEqualitiesLeft(List<OAndBlock> flattenedWhereClause) {
if (flattenedWhereClause == null) {
return null;
}
List<OAndBlock> result = new ArrayList<>();
for (OAndBlock block : flattenedWhereClause) {... |
oblac/jodd | jodd-core/src/main/java/jodd/util/cl/ExtendedURLClassLoader.java | ExtendedURLClassLoader.getResource | @Override
public URL getResource(final String resourceName) {
URL url = null;
Loading loading = resolveResourceLoading(parentFirst, resourceName);
if (parentFirst) {
// PARENT FIRST
if (loading.withParent) {
url = parentClassLoader.getResource(resourceName);
}
if (url == null) {
if (loadi... | java | @Override
public URL getResource(final String resourceName) {
URL url = null;
Loading loading = resolveResourceLoading(parentFirst, resourceName);
if (parentFirst) {
// PARENT FIRST
if (loading.withParent) {
url = parentClassLoader.getResource(resourceName);
}
if (url == null) {
if (loadi... | [
"@",
"Override",
"public",
"URL",
"getResource",
"(",
"final",
"String",
"resourceName",
")",
"{",
"URL",
"url",
"=",
"null",
";",
"Loading",
"loading",
"=",
"resolveResourceLoading",
"(",
"parentFirst",
",",
"resourceName",
")",
";",
"if",
"(",
"parentFirst",... | Returns a resource using parent-first or parent-last strategy. | [
"Returns",
"a",
"resource",
"using",
"parent",
"-",
"first",
"or",
"parent",
"-",
"last",
"strategy",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/cl/ExtendedURLClassLoader.java#L274-L306 | test | Resolves the resource with the specified name. | Of course, here is the Java code you requested:
```java
@Override
public URL getResource(final String resourceName) {
URL url = null;
Loading loading = resolveResourceLoading(parentFirst, resourceName);
if (parentFirst) {
// PARENT FIRST
if (loading.withParent) {
url = parentClassLoader.getResource... |
Unidata/thredds | cdm/src/main/java/ucar/util/prefs/PreferencesExt.java | PreferencesExt.getBean | public Object getBean(String key, Object def) {
if (key==null)
throw new NullPointerException("Null key");
if (isRemoved())
throw new IllegalStateException("Node has been removed.");
synchronized(lock) {
Object result = null;
try {
result = _getObject( key);
... | java | public Object getBean(String key, Object def) {
if (key==null)
throw new NullPointerException("Null key");
if (isRemoved())
throw new IllegalStateException("Node has been removed.");
synchronized(lock) {
Object result = null;
try {
result = _getObject( key);
... | [
"public",
"Object",
"getBean",
"(",
"String",
"key",
",",
"Object",
"def",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"Null key\"",
")",
";",
"if",
"(",
"isRemoved",
"(",
")",
")",
"throw",
"new",
"Ill... | Get the object that has the specified key.
This returns the object itself, not a copy, so
if you change the bean and call store.save(), any changes to the object will be saved,
even without calling putBean(). If you want to change the object without saving the
changes, you must make a copy of the object yourself.
@par... | [
"Get",
"the",
"object",
"that",
"has",
"the",
"specified",
"key",
".",
"This",
"returns",
"the",
"object",
"itself",
"not",
"a",
"copy",
"so",
"if",
"you",
"change",
"the",
"bean",
"and",
"call",
"store",
".",
"save",
"()",
"any",
"changes",
"to",
"the... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/util/prefs/PreferencesExt.java#L85-L106 | test | Get a Bean from the node. | Of course, here is the Java code you requested:
```java
public Object getBean(String key, Object def) {
if (key==null)
throw new NullPointerException("Null key");
if (isRemoved())
throw new IllegalStateException("Node has been removed.");
synchronized(lock) {
Object result = ... |
braintree/braintree_android | Braintree/src/main/java/com/braintreepayments/api/models/PayPalPaymentResource.java | PayPalPaymentResource.fromJson | public static PayPalPaymentResource fromJson(String jsonString) throws JSONException {
JSONObject json = new JSONObject(jsonString);
PayPalPaymentResource payPalPaymentResource = new PayPalPaymentResource();
JSONObject redirectJson = json.optJSONObject(PAYMENT_RESOURCE_KEY);
if(redirect... | java | public static PayPalPaymentResource fromJson(String jsonString) throws JSONException {
JSONObject json = new JSONObject(jsonString);
PayPalPaymentResource payPalPaymentResource = new PayPalPaymentResource();
JSONObject redirectJson = json.optJSONObject(PAYMENT_RESOURCE_KEY);
if(redirect... | [
"public",
"static",
"PayPalPaymentResource",
"fromJson",
"(",
"String",
"jsonString",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"json",
"=",
"new",
"JSONObject",
"(",
"jsonString",
")",
";",
"PayPalPaymentResource",
"payPalPaymentResource",
"=",
"new",
"PayPa... | Create a PayPalPaymentResource from a jsonString. Checks for keys associated with
Single Payment and Billing Agreement flows.
@param jsonString a valid JSON string representing the payment resource
@return a PayPal payment resource
@throws JSONException | [
"Create",
"a",
"PayPalPaymentResource",
"from",
"a",
"jsonString",
".",
"Checks",
"for",
"keys",
"associated",
"with",
"Single",
"Payment",
"and",
"Billing",
"Agreement",
"flows",
"."
] | 07b32e6fad73f9fb8432971b0e79fc8c94b11873 | https://github.com/braintree/braintree_android/blob/07b32e6fad73f9fb8432971b0e79fc8c94b11873/Braintree/src/main/java/com/braintreepayments/api/models/PayPalPaymentResource.java#L42-L54 | test | This method is used to create a PayPalPaymentResource object from a JSON string. | Of course, here is the Java code you requested:
```java
public static PayPalPaymentResource fromJson(String jsonString) throws JSONException {
JSONObject json = new JSONObject(jsonString);
PayPalPaymentResource payPalPaymentResource = new PayPalPaymentResource();
JSONObject redirectJson = json... |
Unidata/thredds | opendap/src/main/java/opendap/dap/parsers/DDSXMLParser.java | DDSXMLParser.parseBase | private void parseBase(Element e, String indent)
throws DASException, NoSuchTypeException, BadSemanticsException {
parseLevel++;
String type = e.getName();
if (type.equals("Attribute")) {
// Do nothing here, the Attributes get parsed when the BaseType's
... | java | private void parseBase(Element e, String indent)
throws DASException, NoSuchTypeException, BadSemanticsException {
parseLevel++;
String type = e.getName();
if (type.equals("Attribute")) {
// Do nothing here, the Attributes get parsed when the BaseType's
... | [
"private",
"void",
"parseBase",
"(",
"Element",
"e",
",",
"String",
"indent",
")",
"throws",
"DASException",
",",
"NoSuchTypeException",
",",
"BadSemanticsException",
"{",
"parseLevel",
"++",
";",
"String",
"type",
"=",
"e",
".",
"getName",
"(",
")",
";",
"i... | This method recursively travels through the DOM tree, locating
BaseType derived nodes and placing them in the DDS. The structure
of the BaseType derived elements in the XML instance document
is captured in the DOM object that is being parsed. This structure
again reflected in the resulting DDS. | [
"This",
"method",
"recursively",
"travels",
"through",
"the",
"DOM",
"tree",
"locating",
"BaseType",
"derived",
"nodes",
"and",
"placing",
"them",
"in",
"the",
"DDS",
".",
"The",
"structure",
"of",
"the",
"BaseType",
"derived",
"elements",
"in",
"the",
"XML",
... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/parsers/DDSXMLParser.java#L256-L341 | test | Parses a base element. | Of course, here is the Java code you requested:
```java
private void parseBase(Element e, String indent)
throws DASException, NoSuchTypeException, BadSemanticsException {
parseLevel++;
String type = e.getName();
if (type.equals("Attribute")) {
// Do nothing ... |
OpenEstate/OpenEstate-IO | Core/src/main/java/org/openestate/io/core/XmlUtils.java | XmlUtils.newDocument | public static Document newDocument(File xmlFile, boolean namespaceAware) throws SAXException, IOException, ParserConfigurationException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(namespaceAware);
DocumentBuilder builder = factory.newDocumen... | java | public static Document newDocument(File xmlFile, boolean namespaceAware) throws SAXException, IOException, ParserConfigurationException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(namespaceAware);
DocumentBuilder builder = factory.newDocumen... | [
"public",
"static",
"Document",
"newDocument",
"(",
"File",
"xmlFile",
",",
"boolean",
"namespaceAware",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
"{",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
... | Create a {@link Document} from a {@link File}.
@param xmlFile the XML file, the document is created from
@param namespaceAware if namespaces are used in the created document
@return created document
@throws SAXException if XML contains an error
@throws IOException if XML is not ... | [
"Create",
"a",
"{",
"@link",
"Document",
"}",
"from",
"a",
"{",
"@link",
"File",
"}",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Core/src/main/java/org/openestate/io/core/XmlUtils.java#L269-L274 | test | Create a new XML document from the specified XML file. | Of course, here is the Java code you requested:
```java
public static Document newDocument(File xmlFile, boolean namespaceAware) throws SAXException, IOException, ParserConfigurationException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(namespaceAwa... |
jboss/jboss-common-core | src/main/java/org/jboss/util/property/PropertyGroup.java | PropertyGroup.addPropertyListener | protected void addPropertyListener(final BoundPropertyListener listener)
{
// get the bound property name
String name = makePropertyName(listener.getPropertyName());
// get the bound listener list for the property
List list = (List) boundListeners.get(name);
// if list is null, then a... | java | protected void addPropertyListener(final BoundPropertyListener listener)
{
// get the bound property name
String name = makePropertyName(listener.getPropertyName());
// get the bound listener list for the property
List list = (List) boundListeners.get(name);
// if list is null, then a... | [
"protected",
"void",
"addPropertyListener",
"(",
"final",
"BoundPropertyListener",
"listener",
")",
"{",
"// get the bound property name",
"String",
"name",
"=",
"makePropertyName",
"(",
"listener",
".",
"getPropertyName",
"(",
")",
")",
";",
"// get the bound listener li... | Add a bound property listener.
<p>Generates a fully qualified property name and adds the listener
under that name.
@param listener Bound property listener to add. | [
"Add",
"a",
"bound",
"property",
"listener",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/property/PropertyGroup.java#L251-L273 | test | Add a property listener to the list of bound listeners. | Of course, here is the Java code you requested:
```java
protected void addPropertyListener(final BoundPropertyListener listener)
{
// get the bound property name
String name = makePropertyName(listener.getPropertyName());
// get the bound listener list for the property
List list = (List) bo... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.concatWith | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> concatWith(@NonNull MaybeSource<? extends T> other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new FlowableConcatWithMay... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> concatWith(@NonNull MaybeSource<? extends T> other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new FlowableConcatWithMay... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Flowable",
"<",
"T",
">",
"concatWith",
"(",
"@",
"NonNull",
"MaybeSource",
"<... | Returns a {@code Flowable} that emits the items from this {@code Flowable} followed by the success item or terminal events
of the other {@link MaybeSource}.
<p>
<img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt="">
<dl>
<dt><b>Backpressure:</b></dt>
<dd>... | [
"Returns",
"a",
"{"
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L8098-L8104 | test | Concatenates two MaybeSource Flowable. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> concatWith(@NonNull MaybeSource<? extends T> other) {
ObjectHelper.requireNonNull(other, "other is null");
... |
kiegroup/droolsjbpm-tools | drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/client/AbstractResourceHandle.java | AbstractResourceHandle.copy | public void copy(ILocator destination) throws DAVException {
copy(destination, IContext.DEPTH_INFINITY, false, null);
} | java | public void copy(ILocator destination) throws DAVException {
copy(destination, IContext.DEPTH_INFINITY, false, null);
} | [
"public",
"void",
"copy",
"(",
"ILocator",
"destination",
")",
"throws",
"DAVException",
"{",
"copy",
"(",
"destination",
",",
"IContext",
".",
"DEPTH_INFINITY",
",",
"false",
",",
"null",
")",
";",
"}"
] | Make a copy of this resource and place it at the location defined
by the given locator.
<p>
Uses default values of depth: infinity and overwrite: false for
the copy.</p>
@param destination the <code>Locator</code> to the destination of the copy.
@exception DAVException if there was a problem copying this resource.
@se... | [
"Make",
"a",
"copy",
"of",
"this",
"resource",
"and",
"place",
"it",
"at",
"the",
"location",
"defined",
"by",
"the",
"given",
"locator",
".",
"<p",
">",
"Uses",
"default",
"values",
"of",
"depth",
":",
"infinity",
"and",
"overwrite",
":",
"false",
"for"... | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/client/AbstractResourceHandle.java#L196-L198 | test | Copy the source locator to the destination locator. | Of course, here is the Java code you requested:
```java
public void copy(ILocator destination) throws DAVException {
copy(destination, IContext.DEPTH_INFINITY, false, null);
}
```
Hope this helps! |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/storage/fs/OFileClassic.java | OFileClassic.checkRegions | private long checkRegions(final long iOffset, final long iLength) {
acquireReadLock();
try {
if (iOffset < 0 || iOffset + iLength > size) {
throw new OIOException(
"You cannot access outside the file size (" + size + " bytes). You have requested portion " + iOffset + "-" + (iOffset
... | java | private long checkRegions(final long iOffset, final long iLength) {
acquireReadLock();
try {
if (iOffset < 0 || iOffset + iLength > size) {
throw new OIOException(
"You cannot access outside the file size (" + size + " bytes). You have requested portion " + iOffset + "-" + (iOffset
... | [
"private",
"long",
"checkRegions",
"(",
"final",
"long",
"iOffset",
",",
"final",
"long",
"iLength",
")",
"{",
"acquireReadLock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"iOffset",
"<",
"0",
"||",
"iOffset",
"+",
"iLength",
">",
"size",
")",
"{",
"throw"... | ALWAYS ADD THE HEADER SIZE BECAUSE ON THIS TYPE IS ALWAYS NEEDED | [
"ALWAYS",
"ADD",
"THE",
"HEADER",
"SIZE",
"BECAUSE",
"ON",
"THIS",
"TYPE",
"IS",
"ALWAYS",
"NEEDED"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/fs/OFileClassic.java#L567-L581 | test | Check the regions. | Of course, here is the Java code you requested:
```java
private long checkRegions(final long iOffset, final long iLength) {
acquireReadLock();
try {
if (iOffset < 0 || iOffset + iLength > size) {
throw new OIOException(
"You cannot access outside the file size (" + size + " bytes). Yo... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm7/MethodWriter.java | MethodWriter.collectAttributePrototypes | final void collectAttributePrototypes(final Attribute.Set attributePrototypes) {
attributePrototypes.addAttributes(firstAttribute);
attributePrototypes.addAttributes(firstCodeAttribute);
} | java | final void collectAttributePrototypes(final Attribute.Set attributePrototypes) {
attributePrototypes.addAttributes(firstAttribute);
attributePrototypes.addAttributes(firstCodeAttribute);
} | [
"final",
"void",
"collectAttributePrototypes",
"(",
"final",
"Attribute",
".",
"Set",
"attributePrototypes",
")",
"{",
"attributePrototypes",
".",
"addAttributes",
"(",
"firstAttribute",
")",
";",
"attributePrototypes",
".",
"addAttributes",
"(",
"firstCodeAttribute",
"... | Collects the attributes of this method into the given set of attribute prototypes.
@param attributePrototypes a set of attribute prototypes. | [
"Collects",
"the",
"attributes",
"of",
"this",
"method",
"into",
"the",
"given",
"set",
"of",
"attribute",
"prototypes",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/MethodWriter.java#L2437-L2440 | test | Collect attribute prototypes. | Of course, here is the Java code you requested:
```java
final void collectAttributePrototypes(final Attribute.Set attributePrototypes) {
attributePrototypes.addAttributes(firstAttribute);
attributePrototypes.addAttributes(firstCodeAttribute);
}
```
Hope this helps! |
rupertlssmith/lojix | lojix/search/src/main/com/thesett/aima/search/impl/bidirectional/BaseBiDirectionalQueueSearch.java | BaseBiDirectionalQueueSearch.joinBothPaths | private SearchNode<O, T> joinBothPaths(SearchNode<O, T> forwardPath, SearchNode<O, T> reversePath)
throws SearchNotExhaustiveException
{
// Check if an alternative path join algorithm has been set and delegate to it if so
if (pathJoiner != null)
{
return pathJoiner.joinBo... | java | private SearchNode<O, T> joinBothPaths(SearchNode<O, T> forwardPath, SearchNode<O, T> reversePath)
throws SearchNotExhaustiveException
{
// Check if an alternative path join algorithm has been set and delegate to it if so
if (pathJoiner != null)
{
return pathJoiner.joinBo... | [
"private",
"SearchNode",
"<",
"O",
",",
"T",
">",
"joinBothPaths",
"(",
"SearchNode",
"<",
"O",
",",
"T",
">",
"forwardPath",
",",
"SearchNode",
"<",
"O",
",",
"T",
">",
"reversePath",
")",
"throws",
"SearchNotExhaustiveException",
"{",
"// Check if an alterna... | Once a match has been found between the forward and reverse fringes of the search a path is known to exist from
the start to the goal. The path is not complete at this stage because it remains to reverse all of the steps in
the backward half of the path and add them to the forward half of the path to produce the comple... | [
"Once",
"a",
"match",
"has",
"been",
"found",
"between",
"the",
"forward",
"and",
"reverse",
"fringes",
"of",
"the",
"search",
"a",
"path",
"is",
"known",
"to",
"exist",
"from",
"the",
"start",
"to",
"the",
"goal",
".",
"The",
"path",
"is",
"not",
"com... | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/search/src/main/com/thesett/aima/search/impl/bidirectional/BaseBiDirectionalQueueSearch.java#L352-L390 | test | Join both paths of the forward and reverse search nodes. | Of course, here is the Java code you requested:
```java
private SearchNode<O, T> joinBothPaths(SearchNode<O, T> forwardPath, SearchNode<O, T> reversePath)
throws SearchNotExhaustiveException
{
// Check if an alternative path join algorithm has been set and delegate to it if so
if (pathJoine... |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/stats/ResourceInst.java | ResourceInst.getStatValue | public StatValue getStatValue(String name) {
StatValue result = null;
StatDescriptor desc = getType().getStat(name);
if (desc != null) {
result = values[desc.getOffset()];
}
return result;
} | java | public StatValue getStatValue(String name) {
StatValue result = null;
StatDescriptor desc = getType().getStat(name);
if (desc != null) {
result = values[desc.getOffset()];
}
return result;
} | [
"public",
"StatValue",
"getStatValue",
"(",
"String",
"name",
")",
"{",
"StatValue",
"result",
"=",
"null",
";",
"StatDescriptor",
"desc",
"=",
"getType",
"(",
")",
".",
"getStat",
"(",
"name",
")",
";",
"if",
"(",
"desc",
"!=",
"null",
")",
"{",
"resu... | /*
Gets the value of the stat in the current instance given the stat name.
@param name the name of the stat to find in the current instance
@return the value that matches the name or null if the instance does not
have a stat of the given name | [
"/",
"*",
"Gets",
"the",
"value",
"of",
"the",
"stat",
"in",
"the",
"current",
"instance",
"given",
"the",
"stat",
"name",
"."
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/stats/ResourceInst.java#L199-L206 | test | Get the value of a stat. | Of course, here is the Java code you requested:
```java
public StatValue getStatValue(String name) {
StatValue result = null;
StatDescriptor desc = getType().getStat(name);
if (desc != null) {
result = values[desc.getOffset()];
}
return result;
}
```
Hope this helps! |
jboss/jboss-common-core | src/main/java/org/jboss/util/xml/catalog/readers/XCatalogReader.java | XCatalogReader.startElement | public void startElement (String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException {
int entryType = -1;
Vector entryArgs = new Vector();
if (localName.equals("Base")) {
entryType = catalog.BASE;
entryArgs.add(atts.getValue("HRef"));
... | java | public void startElement (String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException {
int entryType = -1;
Vector entryArgs = new Vector();
if (localName.equals("Base")) {
entryType = catalog.BASE;
entryArgs.add(atts.getValue("HRef"));
... | [
"public",
"void",
"startElement",
"(",
"String",
"namespaceURI",
",",
"String",
"localName",
",",
"String",
"qName",
",",
"Attributes",
"atts",
")",
"throws",
"SAXException",
"{",
"int",
"entryType",
"=",
"-",
"1",
";",
"Vector",
"entryArgs",
"=",
"new",
"Ve... | The SAX <code>startElement</code> method recognizes elements
from the plain catalog format and instantiates CatalogEntry
objects for them.
@param namespaceURI The namespace name of the element.
@param localName The local name of the element.
@param qName The QName of the element.
@param atts The list of attributes on ... | [
"The",
"SAX",
"<code",
">",
"startElement<",
"/",
"code",
">",
"method",
"recognizes",
"elements",
"from",
"the",
"plain",
"catalog",
"format",
"and",
"instantiates",
"CatalogEntry",
"objects",
"for",
"them",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/readers/XCatalogReader.java#L99-L161 | test | Method called to process an XML START_TAG element. | Of course, here is the Java code you requested:
```java
public void startElement (String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException {
int entryType = -1;
Vector entryArgs = new Vector();
if (localName.equals("Base")) {
entryType = cat... |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/ldap/LdapAuthenticationProviderConfigurer.java | LdapAuthenticationProviderConfigurer.createPasswordCompareAuthenticator | private PasswordComparisonAuthenticator createPasswordCompareAuthenticator(
BaseLdapPathContextSource contextSource) {
PasswordComparisonAuthenticator ldapAuthenticator = new PasswordComparisonAuthenticator(
contextSource);
if (passwordAttribute != null) {
ldapAuthenticator.setPasswordAttributeName(passwo... | java | private PasswordComparisonAuthenticator createPasswordCompareAuthenticator(
BaseLdapPathContextSource contextSource) {
PasswordComparisonAuthenticator ldapAuthenticator = new PasswordComparisonAuthenticator(
contextSource);
if (passwordAttribute != null) {
ldapAuthenticator.setPasswordAttributeName(passwo... | [
"private",
"PasswordComparisonAuthenticator",
"createPasswordCompareAuthenticator",
"(",
"BaseLdapPathContextSource",
"contextSource",
")",
"{",
"PasswordComparisonAuthenticator",
"ldapAuthenticator",
"=",
"new",
"PasswordComparisonAuthenticator",
"(",
"contextSource",
")",
";",
"i... | Creates {@link PasswordComparisonAuthenticator}
@param contextSource the {@link BaseLdapPathContextSource} to use
@return | [
"Creates",
"{",
"@link",
"PasswordComparisonAuthenticator",
"}"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/ldap/LdapAuthenticationProviderConfigurer.java#L198-L207 | test | Creates a PasswordComparisonAuthenticator object. | Of course, here is the Java code you requested:
```java
private PasswordComparisonAuthenticator createPasswordCompareAuthenticator(
BaseLdapPathContextSource contextSource) {
PasswordComparisonAuthenticator ldapAuthenticator = new PasswordComparisonAuthenticator(
contextSource);
if (passwordAttribute != nul... |
abmargb/jamppa | src/main/java/org/jivesoftware/smack/util/Cache.java | Cache.cullCache | protected synchronized void cullCache() {
// Check if a max cache size is defined.
if (maxCacheSize < 0) {
return;
}
// See if the cache is too big. If so, clean out cache until it's 10%
// free.
if (map.size() > maxCacheSize) {
// First, delete a... | java | protected synchronized void cullCache() {
// Check if a max cache size is defined.
if (maxCacheSize < 0) {
return;
}
// See if the cache is too big. If so, clean out cache until it's 10%
// free.
if (map.size() > maxCacheSize) {
// First, delete a... | [
"protected",
"synchronized",
"void",
"cullCache",
"(",
")",
"{",
"// Check if a max cache size is defined.",
"if",
"(",
"maxCacheSize",
"<",
"0",
")",
"{",
"return",
";",
"}",
"// See if the cache is too big. If so, clean out cache until it's 10%",
"// free.",
"if",
"(",
... | Removes the least recently used elements if the cache size is greater
than or equal to the maximum allowed size until the cache is at least 10%
empty. | [
"Removes",
"the",
"least",
"recently",
"used",
"elements",
"if",
"the",
"cache",
"size",
"is",
"greater",
"than",
"or",
"equal",
"to",
"the",
"maximum",
"allowed",
"size",
"until",
"the",
"cache",
"is",
"at",
"least",
"10%",
"empty",
"."
] | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/Cache.java#L424-L449 | test | Culls the cache. | Of course, here is the Java code you requested:
```java
protected synchronized void cullCache() {
// Check if a max cache size is defined.
if (maxCacheSize < 0) {
return;
}
// See if the cache is too big. If so, clean out cache until it's 10%
// free.
if (ma... |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/printer/WAMCompiledTermsPrintingVisitor.java | WAMCompiledTermsPrintingVisitor.printTable | protected void printTable()
{
for (int i = 0; i < printTable.getRowCount(); i++)
{
for (int j = 0; j < printTable.getColumnCount(); j++)
{
String valueToPrint = printTable.get(j, i);
valueToPrint = (valueToPrint == null) ? "" : valueToPrint;
... | java | protected void printTable()
{
for (int i = 0; i < printTable.getRowCount(); i++)
{
for (int j = 0; j < printTable.getColumnCount(); j++)
{
String valueToPrint = printTable.get(j, i);
valueToPrint = (valueToPrint == null) ? "" : valueToPrint;
... | [
"protected",
"void",
"printTable",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"printTable",
".",
"getRowCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"printTable",
".",
"getCol... | Assembles the accumulated output in all rows and columns into a table. The table is appended onto {@link #result} | [
"Assembles",
"the",
"accumulated",
"output",
"in",
"all",
"rows",
"and",
"columns",
"into",
"a",
"table",
".",
"The",
"table",
"is",
"appended",
"onto",
"{"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/printer/WAMCompiledTermsPrintingVisitor.java#L155-L179 | test | Print the table. | Of course, here is the Java code you requested:
```java
protected void printTable()
{
for (int i = 0; i < printTable.getRowCount(); i++)
{
for (int j = 0; j < printTable.getColumnCount(); j++)
{
String valueToPrint = printTable.get(j, i);
valu... |
kocakosm/pitaya | src/org/kocakosm/pitaya/util/Booleans.java | Booleans.valueOf | public static Boolean valueOf(String bool)
{
String s = bool.replaceAll("\\s", "");
boolean b = "true".equalsIgnoreCase(s)
|| "yes".equalsIgnoreCase(s)
|| "on".equalsIgnoreCase(s)
|| "1".equalsIgnoreCase(s);
return b ? TRUE : FALSE;
} | java | public static Boolean valueOf(String bool)
{
String s = bool.replaceAll("\\s", "");
boolean b = "true".equalsIgnoreCase(s)
|| "yes".equalsIgnoreCase(s)
|| "on".equalsIgnoreCase(s)
|| "1".equalsIgnoreCase(s);
return b ? TRUE : FALSE;
} | [
"public",
"static",
"Boolean",
"valueOf",
"(",
"String",
"bool",
")",
"{",
"String",
"s",
"=",
"bool",
".",
"replaceAll",
"(",
"\"\\\\s\"",
",",
"\"\"",
")",
";",
"boolean",
"b",
"=",
"\"true\"",
".",
"equalsIgnoreCase",
"(",
"s",
")",
"||",
"\"yes\"",
... | Parses the given {@code String} into a {@code Boolean}. This method
returns {@code true} if the given {@code String} contains "true",
"yes", "1" or "on".
@param bool the {@code String} to parse.
@return the parsed {@code Boolean}.
@throws NullPointerException if {@code bool} is {@code null}. | [
"Parses",
"the",
"given",
"{",
"@code",
"String",
"}",
"into",
"a",
"{",
"@code",
"Boolean",
"}",
".",
"This",
"method",
"returns",
"{",
"@code",
"true",
"}",
"if",
"the",
"given",
"{",
"@code",
"String",
"}",
"contains",
"true",
"yes",
"1",
"or",
"o... | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/Booleans.java#L194-L202 | test | Get the value of the boolean. | Of course, here is the Java code you requested:
```java
public static Boolean valueOf(String bool)
{
String s = bool.replaceAll("\\s", "");
boolean b = "true".equalsIgnoreCase(s)
|| "yes".equalsIgnoreCase(s)
|| "on".equalsIgnoreCase(s)
|| "1".equalsIgnoreCase(s);
return b ? TRUE : FALSE;
}
```
Hope t... |
fabric8io/fabric8-maven-plugin | core/src/main/java/io/fabric8/maven/core/handler/DeploymentConfigHandler.java | DeploymentConfigHandler.createDeploymentConfigMetaData | private ObjectMeta createDeploymentConfigMetaData(ResourceConfig config) {
return new ObjectMetaBuilder()
.withName(KubernetesHelper.validateKubernetesId(config.getControllerName(), "controller name"))
.build();
} | java | private ObjectMeta createDeploymentConfigMetaData(ResourceConfig config) {
return new ObjectMetaBuilder()
.withName(KubernetesHelper.validateKubernetesId(config.getControllerName(), "controller name"))
.build();
} | [
"private",
"ObjectMeta",
"createDeploymentConfigMetaData",
"(",
"ResourceConfig",
"config",
")",
"{",
"return",
"new",
"ObjectMetaBuilder",
"(",
")",
".",
"withName",
"(",
"KubernetesHelper",
".",
"validateKubernetesId",
"(",
"config",
".",
"getControllerName",
"(",
"... | =========================================================== | [
"==========================================================="
] | b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3 | https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/core/src/main/java/io/fabric8/maven/core/handler/DeploymentConfigHandler.java#L56-L60 | test | Create the meta data for the deployment config | Of course, here is the Java code you requested:
```java
private ObjectMeta createDeploymentConfigMetaData(ResourceConfig config) {
return new ObjectMetaBuilder()
.withName(KubernetesHelper.validateKubernetesId(config.getControllerName(), "controller name"))
.build();
}
```
... |
blademainer/common_utils | common_helper/src/main/java/com/xiongyingqi/util/EntityHelper.java | EntityHelper.arrayEquals | public static boolean arrayEquals(Object one, Object anotherOne) {
if (one == null || anotherOne == null) {
return false;
} else if (!one.getClass().equals(anotherOne.getClass()) || !one.getClass().isArray()) {
return false;
} else if (Array.getLength(one) != Array.getLen... | java | public static boolean arrayEquals(Object one, Object anotherOne) {
if (one == null || anotherOne == null) {
return false;
} else if (!one.getClass().equals(anotherOne.getClass()) || !one.getClass().isArray()) {
return false;
} else if (Array.getLength(one) != Array.getLen... | [
"public",
"static",
"boolean",
"arrayEquals",
"(",
"Object",
"one",
",",
"Object",
"anotherOne",
")",
"{",
"if",
"(",
"one",
"==",
"null",
"||",
"anotherOne",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"if",
"(",
"!",
"one",
".",
"g... | 比较两个数组
@param one
@param anotherOne
@return | [
"比较两个数组"
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/EntityHelper.java#L873-L882 | test | Array equals. | Of course, here is the Java code you requested:
```java
public static boolean arrayEquals(Object one, Object anotherOne) {
if (one == null || anotherOne == null) {
return false;
} else if (!one.getClass().equals(anotherOne.getClass()) || !one.getClass().isArray()) {
return false... |
wildfly/wildfly | ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java | TimerServiceImpl.persistTimer | public void persistTimer(final TimerImpl timer, boolean newTimer) {
if (timer == null) {
return;
}
if (timer.isTimerPersistent()) {
try {
if (timerPersistence.getOptionalValue() == null) {
EJB3_TIMER_LOGGER.timerPersistenceNotEnable();
... | java | public void persistTimer(final TimerImpl timer, boolean newTimer) {
if (timer == null) {
return;
}
if (timer.isTimerPersistent()) {
try {
if (timerPersistence.getOptionalValue() == null) {
EJB3_TIMER_LOGGER.timerPersistenceNotEnable();
... | [
"public",
"void",
"persistTimer",
"(",
"final",
"TimerImpl",
"timer",
",",
"boolean",
"newTimer",
")",
"{",
"if",
"(",
"timer",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"timer",
".",
"isTimerPersistent",
"(",
")",
")",
"{",
"try",
"{",
... | Persists the passed <code>timer</code>.
<p/>
<p>
If the passed timer is null or is non-persistent (i.e. {@link javax.ejb.Timer#isPersistent()} returns false),
then this method acts as a no-op
</p>
@param timer | [
"Persists",
"the",
"passed",
"<code",
">",
"timer<",
"/",
"code",
">",
".",
"<p",
"/",
">",
"<p",
">",
"If",
"the",
"passed",
"timer",
"is",
"null",
"or",
"is",
"non",
"-",
"persistent",
"(",
"i",
".",
"e",
".",
"{",
"@link",
"javax",
".",
"ejb",... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java#L590-L629 | test | Persist a timer. | Of course, here is the Java code you requested:
```java
public void persistTimer(final TimerImpl timer, boolean newTimer) {
if (timer == null) {
return;
}
if (timer.isTimerPersistent()) {
try {
if (timerPersistence.getOptionalValue() == null) {
... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.sconv2d | public SDVariable sconv2d(SDVariable[] inputs, Conv2DConfig conv2DConfig) {
return sconv2d(null, inputs, conv2DConfig);
} | java | public SDVariable sconv2d(SDVariable[] inputs, Conv2DConfig conv2DConfig) {
return sconv2d(null, inputs, conv2DConfig);
} | [
"public",
"SDVariable",
"sconv2d",
"(",
"SDVariable",
"[",
"]",
"inputs",
",",
"Conv2DConfig",
"conv2DConfig",
")",
"{",
"return",
"sconv2d",
"(",
"null",
",",
"inputs",
",",
"conv2DConfig",
")",
";",
"}"
] | Separable Conv2d operation.
@param inputs the inputs to conv2d
@param conv2DConfig the configuration
@return | [
"Separable",
"Conv2d",
"operation",
"."
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L1876-L1878 | test | Sconv2d operation. | Of course, here is the Java code you requested:
```java
public SDVariable sconv2d(SDVariable[] inputs, Conv2DConfig conv2DConfig) {
return sconv2d(null, inputs, conv2DConfig);
}
```
Hope this helps! |
spring-projects/spring-security | core/src/main/java/org/springframework/security/access/hierarchicalroles/RoleHierarchyImpl.java | RoleHierarchyImpl.buildRolesReachableInOneStepMap | private void buildRolesReachableInOneStepMap() {
this.rolesReachableInOneStepMap = new HashMap<GrantedAuthority, Set<GrantedAuthority>>();
try (BufferedReader bufferedReader = new BufferedReader(
new StringReader(this.roleHierarchyStringRepresentation))) {
for (String readLine; (readLine = bufferedReader.rea... | java | private void buildRolesReachableInOneStepMap() {
this.rolesReachableInOneStepMap = new HashMap<GrantedAuthority, Set<GrantedAuthority>>();
try (BufferedReader bufferedReader = new BufferedReader(
new StringReader(this.roleHierarchyStringRepresentation))) {
for (String readLine; (readLine = bufferedReader.rea... | [
"private",
"void",
"buildRolesReachableInOneStepMap",
"(",
")",
"{",
"this",
".",
"rolesReachableInOneStepMap",
"=",
"new",
"HashMap",
"<",
"GrantedAuthority",
",",
"Set",
"<",
"GrantedAuthority",
">",
">",
"(",
")",
";",
"try",
"(",
"BufferedReader",
"bufferedRea... | Parse input and build the map for the roles reachable in one step: the higher role
will become a key that references a set of the reachable lower roles. | [
"Parse",
"input",
"and",
"build",
"the",
"map",
"for",
"the",
"roles",
"reachable",
"in",
"one",
"step",
":",
"the",
"higher",
"role",
"will",
"become",
"a",
"key",
"that",
"references",
"a",
"set",
"of",
"the",
"reachable",
"lower",
"roles",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/access/hierarchicalroles/RoleHierarchyImpl.java#L178-L205 | test | Build the rolesReachableInOneStepMap | Of course, here is the Java code you requested:
```java
private void buildRolesReachableInOneStepMap() {
this.rolesReachableInOneStepMap = new HashMap<GrantedAuthority, Set<GrantedAuthority>>();
try (BufferedReader bufferedReader = new BufferedReader(
new StringReader(this.roleHierarchyStringRepresentation))) ... |
awslabs/aws-hal-client-java | src/main/java/com/amazonaws/hal/client/ConversionUtil.java | ConversionUtil.convertFromNull | private static Object convertFromNull(Type type) {
if (!(type instanceof Class)) {
return null;
}
Class<?> clazz = (Class) type;
if (!clazz.isPrimitive()) {
return null;
}
if (int.class.isAssignableFrom(clazz)) {
return 0;
} ... | java | private static Object convertFromNull(Type type) {
if (!(type instanceof Class)) {
return null;
}
Class<?> clazz = (Class) type;
if (!clazz.isPrimitive()) {
return null;
}
if (int.class.isAssignableFrom(clazz)) {
return 0;
} ... | [
"private",
"static",
"Object",
"convertFromNull",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"!",
"(",
"type",
"instanceof",
"Class",
")",
")",
"{",
"return",
"null",
";",
"}",
"Class",
"<",
"?",
">",
"clazz",
"=",
"(",
"Class",
")",
"type",
";",
"i... | ------------------------------------------------------------- | [
"-------------------------------------------------------------"
] | bbbb67326f6f1ff6e583d6fa95a7768a0c60b62b | https://github.com/awslabs/aws-hal-client-java/blob/bbbb67326f6f1ff6e583d6fa95a7768a0c60b62b/src/main/java/com/amazonaws/hal/client/ConversionUtil.java#L98-L128 | test | Convert from null to a single instance of the class. | Of course, here is the Java code you requested:
```java
private static Object convertFromNull(Type type) {
if (!(type instanceof Class)) {
return null;
}
Class<?> clazz = (Class) type;
if (!clazz.isPrimitive()) {
return null;
}
if (int.class.is... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/TileGenerator.java | TileGenerator.adjustBounds | private void adjustBounds(BoundingBox boundingBox,
int zoom) {
// Google Tile Format
if (googleTiles) {
adjustGoogleBounds();
} else if (projection.isUnit(Units.DEGREES)) {
adjustGeoPackageBoundsWGS84(boundingBox, zoom);
} else {
... | java | private void adjustBounds(BoundingBox boundingBox,
int zoom) {
// Google Tile Format
if (googleTiles) {
adjustGoogleBounds();
} else if (projection.isUnit(Units.DEGREES)) {
adjustGeoPackageBoundsWGS84(boundingBox, zoom);
} else {
... | [
"private",
"void",
"adjustBounds",
"(",
"BoundingBox",
"boundingBox",
",",
"int",
"zoom",
")",
"{",
"// Google Tile Format",
"if",
"(",
"googleTiles",
")",
"{",
"adjustGoogleBounds",
"(",
")",
";",
"}",
"else",
"if",
"(",
"projection",
".",
"isUnit",
"(",
"U... | Adjust the tile matrix set and bounds
@param boundingBox bounding box
@param zoom zoom | [
"Adjust",
"the",
"tile",
"matrix",
"set",
"and",
"bounds"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/TileGenerator.java#L506-L516 | test | Adjusts the bounding box to match the zoom level. | Of course, here is the Java code you requested:
```java
private void adjustBounds(BoundingBox boundingBox,
int zoom) {
// Google Tile Format
if (googleTiles) {
adjustGoogleBounds();
} else if (projection.isUnit(Units.DEGREES)) {
adjustGeoPac... |
kiegroup/droolsjbpm-tools | drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DefaultCompletionProcessor.java | DefaultCompletionProcessor.getCurrentJavaProject | private IJavaProject getCurrentJavaProject() {
IEditorInput input = getEditor().getEditorInput();
if ( !(input instanceof IFileEditorInput) ) {
return null;
}
IProject project = ((IFileEditorInput) input).getFile().getProject();
IJavaProject javaProject = JavaCore.cre... | java | private IJavaProject getCurrentJavaProject() {
IEditorInput input = getEditor().getEditorInput();
if ( !(input instanceof IFileEditorInput) ) {
return null;
}
IProject project = ((IFileEditorInput) input).getFile().getProject();
IJavaProject javaProject = JavaCore.cre... | [
"private",
"IJavaProject",
"getCurrentJavaProject",
"(",
")",
"{",
"IEditorInput",
"input",
"=",
"getEditor",
"(",
")",
".",
"getEditorInput",
"(",
")",
";",
"if",
"(",
"!",
"(",
"input",
"instanceof",
"IFileEditorInput",
")",
")",
"{",
"return",
"null",
";"... | /*
create and returns a java project based on the current editor input or returns null | [
"/",
"*",
"create",
"and",
"returns",
"a",
"java",
"project",
"based",
"on",
"the",
"current",
"editor",
"input",
"or",
"returns",
"null"
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DefaultCompletionProcessor.java#L157-L165 | test | Get the current Java project. | Of course, here is the Java code you requested:
```java
private IJavaProject getCurrentJavaProject() {
IEditorInput input = getEditor().getEditorInput();
if ( !(input instanceof IFileEditorInput) ) {
return null;
}
IProject project = ((IFileEditorInput) input).getFile().getP... |
playframework/playframework | core/play/src/main/java/play/mvc/Results.java | Results.networkAuthenticationRequired | public static Result networkAuthenticationRequired(Path content, String filename) {
return networkAuthenticationRequired(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | java | public static Result networkAuthenticationRequired(Path content, String filename) {
return networkAuthenticationRequired(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | [
"public",
"static",
"Result",
"networkAuthenticationRequired",
"(",
"Path",
"content",
",",
"String",
"filename",
")",
"{",
"return",
"networkAuthenticationRequired",
"(",
"content",
",",
"filename",
",",
"StaticFileMimeTypes",
".",
"fileMimeTypes",
"(",
")",
")",
"... | Generates a 511 Network Authentication Required result.
@param content The path to send.
@param filename The name to send the file as.
@return the result | [
"Generates",
"a",
"511",
"Network",
"Authentication",
"Required",
"result",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L4428-L4430 | test | Check if network authentication is required | Of course, here is the Java code you requested:
```java
public static Result networkAuthenticationRequired(Path content, String filename) {
return networkAuthenticationRequired(content, filename, StaticFileMimeTypes.fileMimeTypes());
}
```
Hope this helps! |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java | HttpSecurity.oauth2Client | public OAuth2ClientConfigurer<HttpSecurity> oauth2Client() throws Exception {
OAuth2ClientConfigurer<HttpSecurity> configurer = getOrApply(new OAuth2ClientConfigurer<>());
this.postProcess(configurer);
return configurer;
} | java | public OAuth2ClientConfigurer<HttpSecurity> oauth2Client() throws Exception {
OAuth2ClientConfigurer<HttpSecurity> configurer = getOrApply(new OAuth2ClientConfigurer<>());
this.postProcess(configurer);
return configurer;
} | [
"public",
"OAuth2ClientConfigurer",
"<",
"HttpSecurity",
">",
"oauth2Client",
"(",
")",
"throws",
"Exception",
"{",
"OAuth2ClientConfigurer",
"<",
"HttpSecurity",
">",
"configurer",
"=",
"getOrApply",
"(",
"new",
"OAuth2ClientConfigurer",
"<>",
"(",
")",
")",
";",
... | Configures OAuth 2.0 Client support.
@since 5.1
@see <a target="_blank" href="https://tools.ietf.org/html/rfc6749#section-1.1">OAuth 2.0 Authorization Framework</a>
@return the {@link OAuth2ClientConfigurer} for further customizations
@throws Exception | [
"Configures",
"OAuth",
"2",
".",
"0",
"Client",
"support",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java#L1003-L1007 | test | Get an OAuth2 client configuration. | Of course, here is the Java code you requested:
```java
public OAuth2ClientConfigurer<HttpSecurity> oauth2Client() throws Exception {
OAuth2ClientConfigurer<HttpSecurity> configurer = getOrApply(new OAuth2ClientConfigurer<>());
this.postProcess(configurer);
return configurer;
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/ma2/StructureDataDeep.java | StructureDataDeep.copyToArrayBB | static public int copyToArrayBB(StructureData sdata, ArrayStructureBB abb) {
//StructureMembers sm = sdata.getStructureMembers();
ByteBuffer bb = abb.getByteBuffer();
int start = bb.limit();
for (StructureMembers.Member wantMember : abb.getMembers()) {
StructureMembers.Member m = sdata.findMember... | java | static public int copyToArrayBB(StructureData sdata, ArrayStructureBB abb) {
//StructureMembers sm = sdata.getStructureMembers();
ByteBuffer bb = abb.getByteBuffer();
int start = bb.limit();
for (StructureMembers.Member wantMember : abb.getMembers()) {
StructureMembers.Member m = sdata.findMember... | [
"static",
"public",
"int",
"copyToArrayBB",
"(",
"StructureData",
"sdata",
",",
"ArrayStructureBB",
"abb",
")",
"{",
"//StructureMembers sm = sdata.getStructureMembers();",
"ByteBuffer",
"bb",
"=",
"abb",
".",
"getByteBuffer",
"(",
")",
";",
"int",
"start",
"=",
"bb... | Make deep copy from a StructureData into the given ArrayStructureBB
@param sdata original data from here
@param abb copy data into this ArrayStructureBB, starting from wherever the ByteBuffer current position is
@return number of bytes copied | [
"Make",
"deep",
"copy",
"from",
"a",
"StructureData",
"into",
"the",
"given",
"ArrayStructureBB"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/StructureDataDeep.java#L122-L240 | test | Copy to bb. | Of course, here is the Java code you requested:
```java
static public int copyToArrayBB(StructureData sdata, ArrayStructureBB abb) {
//StructureMembers sm = sdata.getStructureMembers();
ByteBuffer bb = abb.getByteBuffer();
int start = bb.limit();
for (StructureMembers.Member wantMember : abb.getMember... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/util/TableParser.java | TableParser.readTable | static public List<Record> readTable(String urlString, String format, int maxLines) throws IOException, NumberFormatException {
InputStream ios;
if (urlString.startsWith("http:")) {
URL url = new URL(urlString);
ios = url.openStream();
} else {
ios = new FileInputStream(urlString);... | java | static public List<Record> readTable(String urlString, String format, int maxLines) throws IOException, NumberFormatException {
InputStream ios;
if (urlString.startsWith("http:")) {
URL url = new URL(urlString);
ios = url.openStream();
} else {
ios = new FileInputStream(urlString);... | [
"static",
"public",
"List",
"<",
"Record",
">",
"readTable",
"(",
"String",
"urlString",
",",
"String",
"format",
",",
"int",
"maxLines",
")",
"throws",
"IOException",
",",
"NumberFormatException",
"{",
"InputStream",
"ios",
";",
"if",
"(",
"urlString",
".",
... | Reads a URL or file in as a table.
@param urlString starts with http, read URL contenets, else read file.
@param format describe format of each line.
@param maxLines maximum number of lines to parse, set to < 0 to read all
@return List of TableParser.Record
@throws IOException on read error
@throws Numbe... | [
"Reads",
"a",
"URL",
"or",
"file",
"in",
"as",
"a",
"table",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/util/TableParser.java#L89-L100 | test | Reads a single hierarchical table from a URL string. | Of course, here is the Java code you requested:
```java
static public List<Record> readTable(String urlString, String format, int maxLines) throws IOException, NumberFormatException {
InputStream ios;
if (urlString.startsWith("http:")) {
URL url = new URL(urlString);
ios = url.openStream();
... |
jboss/jboss-common-core | src/main/java/org/jboss/util/state/State.java | State.getTransition | public Transition getTransition(String name)
{
Transition t = (Transition) allowedTransitions.get(name);
return t;
} | java | public Transition getTransition(String name)
{
Transition t = (Transition) allowedTransitions.get(name);
return t;
} | [
"public",
"Transition",
"getTransition",
"(",
"String",
"name",
")",
"{",
"Transition",
"t",
"=",
"(",
"Transition",
")",
"allowedTransitions",
".",
"get",
"(",
"name",
")",
";",
"return",
"t",
";",
"}"
] | Lookup an allowed transition given its name.
@param name - the name of a valid transition from this state.
@return the valid transition if it exists, null otherwise. | [
"Lookup",
"an",
"allowed",
"transition",
"given",
"its",
"name",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/state/State.java#L93-L97 | test | Get a transition by name. | Of course, here is the Java code you requested:
```java
public Transition getTransition(String name)
{
Transition t = (Transition) allowedTransitions.get(name);
return t;
}
```
Hope this helps! |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasCtpmv | public static void cublasCtpmv(char uplo, char trans, char diag, int n, Pointer AP, Pointer x, int incx)
{
cublasCtpmvNative(uplo, trans, diag, n, AP, x, incx);
checkResultBLAS();
} | java | public static void cublasCtpmv(char uplo, char trans, char diag, int n, Pointer AP, Pointer x, int incx)
{
cublasCtpmvNative(uplo, trans, diag, n, AP, x, incx);
checkResultBLAS();
} | [
"public",
"static",
"void",
"cublasCtpmv",
"(",
"char",
"uplo",
",",
"char",
"trans",
",",
"char",
"diag",
",",
"int",
"n",
",",
"Pointer",
"AP",
",",
"Pointer",
"x",
",",
"int",
"incx",
")",
"{",
"cublasCtpmvNative",
"(",
"uplo",
",",
"trans",
",",
... | <pre>
void
cublasCtpmv (char uplo, char trans, char diag, int n, const cuComplex *AP,
cuComplex *x, int incx);
performs one of the matrix-vector operations x = op(A) * x, where op(A) = A,
op(A) = transpose(A) or op(A) = conjugate(transpose(A)) . x is an n element
single precision complex vector, and A is an n x n, uni... | [
"<pre",
">",
"void",
"cublasCtpmv",
"(",
"char",
"uplo",
"char",
"trans",
"char",
"diag",
"int",
"n",
"const",
"cuComplex",
"*",
"AP",
"cuComplex",
"*",
"x",
"int",
"incx",
")",
";"
] | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L5085-L5089 | test | Cublas homography vectors. | Of course, here is the Java code you requested:
```java
public static void cublasCtpmv(char uplo, char trans, char diag, int n, Pointer AP, Pointer x, int incx)
{
cublasCtpmvNative(uplo, trans, diag, n, AP, x, incx);
checkResultBLAS();
}
```
Hope this helps! |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/storage/ridbag/sbtree/OSBTreeCollectionManagerShared.java | OSBTreeCollectionManagerShared.listenForChanges | @Override
public UUID listenForChanges(ORidBag collection) {
UUID ownerUUID = collection.getTemporaryId();
if (ownerUUID != null) {
final OBonsaiCollectionPointer pointer = collection.getPointer();
Map<UUID, OBonsaiCollectionPointer> changedPointers = collectionPointerChanges.get();
if (poi... | java | @Override
public UUID listenForChanges(ORidBag collection) {
UUID ownerUUID = collection.getTemporaryId();
if (ownerUUID != null) {
final OBonsaiCollectionPointer pointer = collection.getPointer();
Map<UUID, OBonsaiCollectionPointer> changedPointers = collectionPointerChanges.get();
if (poi... | [
"@",
"Override",
"public",
"UUID",
"listenForChanges",
"(",
"ORidBag",
"collection",
")",
"{",
"UUID",
"ownerUUID",
"=",
"collection",
".",
"getTemporaryId",
"(",
")",
";",
"if",
"(",
"ownerUUID",
"!=",
"null",
")",
"{",
"final",
"OBonsaiCollectionPointer",
"p... | Change UUID to null to prevent its serialization to disk. | [
"Change",
"UUID",
"to",
"null",
"to",
"prevent",
"its",
"serialization",
"to",
"disk",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/ridbag/sbtree/OSBTreeCollectionManagerShared.java#L170-L183 | test | This method is called by the OCD to listen for changes in a collection. | Of course, here is the Java code you requested:
```java
@Override
public UUID listenForChanges(ORidBag collection) {
UUID ownerUUID = collection.getTemporaryId();
if (ownerUUID != null) {
final OBonsaiCollectionPointer pointer = collection.getPointer();
Map<UUID, OBonsaiCollectionPointer> change... |
rest-assured/rest-assured | json-path/src/main/java/io/restassured/path/json/JsonPath.java | JsonPath.getInt | public int getInt(String path) {
//The type returned from Groovy depends on the input, so we need to handle different numerical types.
Object value = get(path);
if (value instanceof Integer) {
return (Integer) value;
} else if (value instanceof Short) {
return ((S... | java | public int getInt(String path) {
//The type returned from Groovy depends on the input, so we need to handle different numerical types.
Object value = get(path);
if (value instanceof Integer) {
return (Integer) value;
} else if (value instanceof Short) {
return ((S... | [
"public",
"int",
"getInt",
"(",
"String",
"path",
")",
"{",
"//The type returned from Groovy depends on the input, so we need to handle different numerical types.",
"Object",
"value",
"=",
"get",
"(",
"path",
")",
";",
"if",
"(",
"value",
"instanceof",
"Integer",
")",
"... | Get the result of an Object path expression as an int.
@param path The Object path.
@return The int matching the Object path. A {@link java.lang.ClassCastException} will be thrown if the object
cannot be casted to the expected type. | [
"Get",
"the",
"result",
"of",
"an",
"Object",
"path",
"expression",
"as",
"an",
"int",
"."
] | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/json-path/src/main/java/io/restassured/path/json/JsonPath.java#L235-L247 | test | Gets the int value for the given path. | Of course, here is the Java code you requested:
```java
public int getInt(String path) {
//The type returned from Groovy depends on the input, so we need to handle different numerical types.
Object value = get(path);
if (value instanceof Integer) {
return (Integer) value;
} ... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.unsubscribeOn | @CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Flowable<T> unsubscribeOn(Scheduler scheduler) {
ObjectHelper.requireNonNull(scheduler, "scheduler is null");
return RxJavaPlugins.onAssembly(new Flowabl... | java | @CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Flowable<T> unsubscribeOn(Scheduler scheduler) {
ObjectHelper.requireNonNull(scheduler, "scheduler is null");
return RxJavaPlugins.onAssembly(new Flowabl... | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"PASS_THROUGH",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"CUSTOM",
")",
"public",
"final",
"Flowable",
"<",
"T",
">",
"unsubscribeOn",
"(",
"Sched... | Modifies the source Publisher so that subscribers will cancel it on a specified
{@link Scheduler}.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The operator doesn't interfere with backpressure which is determined by the source {@code Publisher}'s backpressure
behavior.</dd>
<dt><b>Scheduler:</b></dt>
<dd>You specify which {@... | [
"Modifies",
"the",
"source",
"Publisher",
"so",
"that",
"subscribers",
"will",
"cancel",
"it",
"on",
"a",
"specified",
"{",
"@link",
"Scheduler",
"}",
".",
"<dl",
">",
"<dt",
">",
"<b",
">",
"Backpressure",
":",
"<",
"/",
"b",
">",
"<",
"/",
"dt",
">... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L17362-L17369 | test | Unsubscribe the source of the sequence with the specified scheduler. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Flowable<T> unsubscribeOn(Scheduler scheduler) {
ObjectHelper.requireNonNull(scheduler, "scheduler is nu... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/ProjectionPointImpl.java | ProjectionPointImpl.isInfinite | static public boolean isInfinite(ProjectionPoint pt) {
return (pt.getX() == java.lang.Double.POSITIVE_INFINITY)
|| (pt.getX() == java.lang.Double.NEGATIVE_INFINITY)
|| (pt.getY() == java.lang.Double.POSITIVE_INFINITY)
|| (pt.getY() == java.lang.Double.NEGATIVE_INFINITY);
} | java | static public boolean isInfinite(ProjectionPoint pt) {
return (pt.getX() == java.lang.Double.POSITIVE_INFINITY)
|| (pt.getX() == java.lang.Double.NEGATIVE_INFINITY)
|| (pt.getY() == java.lang.Double.POSITIVE_INFINITY)
|| (pt.getY() == java.lang.Double.NEGATIVE_INFINITY);
} | [
"static",
"public",
"boolean",
"isInfinite",
"(",
"ProjectionPoint",
"pt",
")",
"{",
"return",
"(",
"pt",
".",
"getX",
"(",
")",
"==",
"java",
".",
"lang",
".",
"Double",
".",
"POSITIVE_INFINITY",
")",
"||",
"(",
"pt",
".",
"getX",
"(",
")",
"==",
"j... | See if either coordinate in <code>pt</code> is +/- infinite.
This happens sometimes in projective geometry.
@param pt point to check
@return true if either coordinate is +/- infinite. | [
"See",
"if",
"either",
"coordinate",
"in",
"<code",
">",
"pt<",
"/",
"code",
">",
"is",
"+",
"/",
"-",
"infinite",
".",
"This",
"happens",
"sometimes",
"in",
"projective",
"geometry",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/ProjectionPointImpl.java#L146-L151 | test | Returns true if the projection point is infinite. | Of course, here is the Java code you requested:
```java
static public boolean isInfinite(ProjectionPoint pt) {
return (pt.getX() == java.lang.Double.POSITIVE_INFINITY)
|| (pt.getX() == java.lang.Double.NEGATIVE_INFINITY)
|| (pt.getY() == java.lang.Double.POSITIVE_INFINITY)
|| (pt.getY()... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/reflect/BeanMemento.java | BeanMemento.put | public void put(Class cls, String property, TypeConverter.MultiTypeData value)
{
/*log.fine("public void put(String property, TypeConverter.MultiTypeData value): called");*/
/*log.fine("property = " + property);*/
/*log.fine("value = " + value);*/
// Store the multi typed data unde... | java | public void put(Class cls, String property, TypeConverter.MultiTypeData value)
{
/*log.fine("public void put(String property, TypeConverter.MultiTypeData value): called");*/
/*log.fine("property = " + property);*/
/*log.fine("value = " + value);*/
// Store the multi typed data unde... | [
"public",
"void",
"put",
"(",
"Class",
"cls",
",",
"String",
"property",
",",
"TypeConverter",
".",
"MultiTypeData",
"value",
")",
"{",
"/*log.fine(\"public void put(String property, TypeConverter.MultiTypeData value): called\");*/",
"/*log.fine(\"property = \" + property);*/",
... | Sets the value of the named property as a multi type object.
@param cls The class in which the property is declared. This is ignored as only properties of the top-level
bean class are used by this memento. Properties higher up the inheritance chain can be overriden.
@param property The name of the property to set... | [
"Sets",
"the",
"value",
"of",
"the",
"named",
"property",
"as",
"a",
"multi",
"type",
"object",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/reflect/BeanMemento.java#L245-L253 | test | Stores the specified multi typed data in the cache. | Of course, here is the Java code you requested:
```java
public void put(Class cls, String property, TypeConverter.MultiTypeData value)
{
/*log.fine("public void put(String property, TypeConverter.MultiTypeData value): called");*/
/*log.fine("property = " + property);*/
/*log.fine("value = ... |
eclipse/packagedrone | bundles/org.eclipse.packagedrone.repo.xml/src/org/eclipse/packagedrone/repo/xml/XmlHelper.java | XmlHelper.addElement | public static Element addElement ( final Element parent, final String name )
{
final Element ele = parent.getOwnerDocument ().createElement ( name );
parent.appendChild ( ele );
return ele;
} | java | public static Element addElement ( final Element parent, final String name )
{
final Element ele = parent.getOwnerDocument ().createElement ( name );
parent.appendChild ( ele );
return ele;
} | [
"public",
"static",
"Element",
"addElement",
"(",
"final",
"Element",
"parent",
",",
"final",
"String",
"name",
")",
"{",
"final",
"Element",
"ele",
"=",
"parent",
".",
"getOwnerDocument",
"(",
")",
".",
"createElement",
"(",
"name",
")",
";",
"parent",
".... | Create a new element and add it as the last child
@param parent
the parent of the new element
@param name
the name of the element
@return the new element | [
"Create",
"a",
"new",
"element",
"and",
"add",
"it",
"as",
"the",
"last",
"child"
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.eclipse.packagedrone.repo.xml/src/org/eclipse/packagedrone/repo/xml/XmlHelper.java#L348-L353 | test | Add a new element to a parent element. | Of course, here is the Java code you requested:
```java
public static Element addElement ( final Element parent, final String name )
{
final Element ele = parent.getOwnerDocument ().createElement ( name );
parent.appendChild ( ele );
return ele;
}
```
Hope this helps! |
wildfly/wildfly | naming/src/main/java/org/jboss/as/naming/InMemoryNamingStore.java | InMemoryNamingStore.unbind | public void unbind(final Name name) throws NamingException {
if (isLastComponentEmpty(name)) {
throw emptyNameException();
}
writeLock.lock();
try {
root.accept(new UnbindVisitor(name));
} finally {
writeLock.unlock();
}
} | java | public void unbind(final Name name) throws NamingException {
if (isLastComponentEmpty(name)) {
throw emptyNameException();
}
writeLock.lock();
try {
root.accept(new UnbindVisitor(name));
} finally {
writeLock.unlock();
}
} | [
"public",
"void",
"unbind",
"(",
"final",
"Name",
"name",
")",
"throws",
"NamingException",
"{",
"if",
"(",
"isLastComponentEmpty",
"(",
"name",
")",
")",
"{",
"throw",
"emptyNameException",
"(",
")",
";",
"}",
"writeLock",
".",
"lock",
"(",
")",
";",
"t... | Unbind the entry in the provided location. This will remove the node in the tree and no longer manage it.
@param name The entry name
@throws NamingException | [
"Unbind",
"the",
"entry",
"in",
"the",
"provided",
"location",
".",
"This",
"will",
"remove",
"the",
"node",
"in",
"the",
"tree",
"and",
"no",
"longer",
"manage",
"it",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/naming/src/main/java/org/jboss/as/naming/InMemoryNamingStore.java#L164-L175 | test | Unbind a component from the ldap context. | Of course, here is the Java code you requested:
```java
public void unbind(final Name name) throws NamingException {
if (isLastComponentEmpty(name)) {
throw emptyNameException();
}
writeLock.lock();
try {
root.accept(new UnbindVisitor(name));
} finally {... |
blademainer/common_utils | common_code/src/main/java/com/xiongyingqi/utils/code/CodeProcessor.java | CodeProcessor.checkInterfaces | private String checkInterfaces(String classSegment) {
if (builder.getInterfaces() == null || builder.getInterfaces().size() == 0) {
return classSegment;
}
Matcher matcher = PATTERN_FIND_INTERCES.matcher(classSegment);
if (matcher.find()) {
final String interface... | java | private String checkInterfaces(String classSegment) {
if (builder.getInterfaces() == null || builder.getInterfaces().size() == 0) {
return classSegment;
}
Matcher matcher = PATTERN_FIND_INTERCES.matcher(classSegment);
if (matcher.find()) {
final String interface... | [
"private",
"String",
"checkInterfaces",
"(",
"String",
"classSegment",
")",
"{",
"if",
"(",
"builder",
".",
"getInterfaces",
"(",
")",
"==",
"null",
"||",
"builder",
".",
"getInterfaces",
"(",
")",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
... | 检查implements关键字
@param classSegment
@return | [
"检查implements关键字"
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_code/src/main/java/com/xiongyingqi/utils/code/CodeProcessor.java#L226-L266 | test | checkInterfaces method. | Of course, here is the Java code you requested:
```java
private String checkInterfaces(String classSegment) {
if (builder.getInterfaces() == null || builder.getInterfaces().size() == 0) {
return classSegment;
}
Matcher matcher = PATTERN_FIND_INTERCES.matcher(classSegment);
... |
Unidata/thredds | grib/src/main/java/ucar/nc2/grib/grib2/tools/EcmwfParamTableCompare.java | EcmwfParamTableCompare.compareTables | public static void compareTables(Grib2ParamTableInterface t1, Grib2ParamTableInterface t2, Formatter f) {
int extra = 0;
int udunits = 0;
int conflict = 0;
f.format("%s%n", t2.getName());
for (GribTables.Parameter p1 : t1.getParameters()) {
if (t1.getParameter(p1.getNumber()) == null) {
... | java | public static void compareTables(Grib2ParamTableInterface t1, Grib2ParamTableInterface t2, Formatter f) {
int extra = 0;
int udunits = 0;
int conflict = 0;
f.format("%s%n", t2.getName());
for (GribTables.Parameter p1 : t1.getParameters()) {
if (t1.getParameter(p1.getNumber()) == null) {
... | [
"public",
"static",
"void",
"compareTables",
"(",
"Grib2ParamTableInterface",
"t1",
",",
"Grib2ParamTableInterface",
"t2",
",",
"Formatter",
"f",
")",
"{",
"int",
"extra",
"=",
"0",
";",
"int",
"udunits",
"=",
"0",
";",
"int",
"conflict",
"=",
"0",
";",
"f... | Compare 2 tables, print report. | [
"Compare",
"2",
"tables",
"print",
"report",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib2/tools/EcmwfParamTableCompare.java#L23-L90 | test | Compare two tables. | Of course, here is the Java code you requested:
```java
public static void compareTables(Grib2ParamTableInterface t1, Grib2ParamTableInterface t2, Formatter f) {
int extra = 0;
int udunits = 0;
int conflict = 0;
f.format("%s%n", t2.getName());
for (GribTables.Parameter p1 : t1.getParameters()) {
... |
abmargb/jamppa | src/main/java/org/jamppa/XMPPBase.java | XMPPBase.process | public void process(boolean block) {
Runnable componentRunnable = new Runnable() {
@Override
public void run() {
try {
mutex.acquire();
} catch (InterruptedException e) {
LOGGER.fatal("Main loop.", e);
... | java | public void process(boolean block) {
Runnable componentRunnable = new Runnable() {
@Override
public void run() {
try {
mutex.acquire();
} catch (InterruptedException e) {
LOGGER.fatal("Main loop.", e);
... | [
"public",
"void",
"process",
"(",
"boolean",
"block",
")",
"{",
"Runnable",
"componentRunnable",
"=",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"mutex",
".",
"acquire",
"(",
")",
";",
"}",
... | @throws ComponentException | [
"@throws",
"ComponentException"
] | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jamppa/XMPPBase.java#L21-L39 | test | Process the result of a single request. | Of course, here is the Java code you requested:
```java
public void process(boolean block) {
Runnable componentRunnable = new Runnable() {
@Override
public void run() {
try {
mutex.acquire();
} catch (InterruptedException e) {
... |
jcodec/jcodec | src/main/java/net/sourceforge/jaad/aac/AACDecoderConfig.java | AACDecoderConfig.parseMP4DecoderSpecificInfo | public static AACDecoderConfig parseMP4DecoderSpecificInfo(byte[] data) throws AACException {
final IBitStream _in = BitStream.createBitStream(data);
final AACDecoderConfig config = new AACDecoderConfig();
try {
config.profile = readProfile(_in);
int sf = _in.readBits(4);
if(sf==0xF) config.sampleFrequ... | java | public static AACDecoderConfig parseMP4DecoderSpecificInfo(byte[] data) throws AACException {
final IBitStream _in = BitStream.createBitStream(data);
final AACDecoderConfig config = new AACDecoderConfig();
try {
config.profile = readProfile(_in);
int sf = _in.readBits(4);
if(sf==0xF) config.sampleFrequ... | [
"public",
"static",
"AACDecoderConfig",
"parseMP4DecoderSpecificInfo",
"(",
"byte",
"[",
"]",
"data",
")",
"throws",
"AACException",
"{",
"final",
"IBitStream",
"_in",
"=",
"BitStream",
".",
"createBitStream",
"(",
"data",
")",
";",
"final",
"AACDecoderConfig",
"c... | Parses the input arrays as a DecoderSpecificInfo, as used in MP4
containers.
@return a AACDecoderConfig | [
"Parses",
"the",
"input",
"arrays",
"as",
"a",
"DecoderSpecificInfo",
"as",
"used",
"in",
"MP4",
"containers",
"."
] | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/net/sourceforge/jaad/aac/AACDecoderConfig.java#L147-L208 | test | Parse MP4 decoder specific info. | Of course, here is the Java code you requested:
```java
public static AACDecoderConfig parseMP4DecoderSpecificInfo(byte[] data) throws AACException {
final IBitStream _in = BitStream.createBitStream(data);
final AACDecoderConfig config = new AACDecoderConfig();
try {
config.profile = readProfile(_in);
in... |
rupertlssmith/lojix | lojix/text_model/src/main/com/thesett/text/impl/model/TextTableImpl.java | TextTableImpl.updateMaxColumnWidth | private void updateMaxColumnWidth(int column, int width)
{
Integer previousValue = maxColumnSizes.get(column);
if (previousValue == null)
{
maxColumnSizes.put(column, width);
}
else if (previousValue < width)
{
maxColumnSizes.put(column, width... | java | private void updateMaxColumnWidth(int column, int width)
{
Integer previousValue = maxColumnSizes.get(column);
if (previousValue == null)
{
maxColumnSizes.put(column, width);
}
else if (previousValue < width)
{
maxColumnSizes.put(column, width... | [
"private",
"void",
"updateMaxColumnWidth",
"(",
"int",
"column",
",",
"int",
"width",
")",
"{",
"Integer",
"previousValue",
"=",
"maxColumnSizes",
".",
"get",
"(",
"column",
")",
";",
"if",
"(",
"previousValue",
"==",
"null",
")",
"{",
"maxColumnSizes",
".",... | Updates the maximum column width for a column of the data table.
@param column The column to update.
@param width The max width reached. | [
"Updates",
"the",
"maximum",
"column",
"width",
"for",
"a",
"column",
"of",
"the",
"data",
"table",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/text_model/src/main/com/thesett/text/impl/model/TextTableImpl.java#L253-L265 | test | Update the max column width. | Of course, here is the Java code you requested:
```java
private void updateMaxColumnWidth(int column, int width)
{
Integer previousValue = maxColumnSizes.get(column);
if (previousValue == null)
{
maxColumnSizes.put(column, width);
}
else if (previousValue < widt... |
sialcasa/mvvmFX | mvvmfx-guice/src/main/java/de/saxsys/mvvmfx/guice/MvvmfxGuiceApplication.java | MvvmfxGuiceApplication.init | public final void init() throws Exception {
List<Module> modules = new ArrayList<>();
modules.add(new MvvmfxModule());
modules.add(new AbstractModule() {
@Override
protected void configure() {
bind(HostServices.class).toProvider(MvvmfxGuiceApplication.this::getHostServices);
bind(Stage.clas... | java | public final void init() throws Exception {
List<Module> modules = new ArrayList<>();
modules.add(new MvvmfxModule());
modules.add(new AbstractModule() {
@Override
protected void configure() {
bind(HostServices.class).toProvider(MvvmfxGuiceApplication.this::getHostServices);
bind(Stage.clas... | [
"public",
"final",
"void",
"init",
"(",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Module",
">",
"modules",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"modules",
".",
"add",
"(",
"new",
"MvvmfxModule",
"(",
")",
")",
";",
"modules",
".",
"add"... | This method is called by the javafx runtime when the application is initialized.
See {@link Application#init()} for more details.
<p>
In this method the initialization of the guice container is done.
For this reason, this method is marked as final and cannot be overwritten by users.
<p>
Please use {@link #initMvvmfx()}... | [
"This",
"method",
"is",
"called",
"by",
"the",
"javafx",
"runtime",
"when",
"the",
"application",
"is",
"initialized",
".",
"See",
"{",
"@link",
"Application#init",
"()",
"}",
"for",
"more",
"details",
".",
"<p",
">",
"In",
"this",
"method",
"the",
"initia... | 240566a358a8e01c94c0bbb99228140a69690d02 | https://github.com/sialcasa/mvvmFX/blob/240566a358a8e01c94c0bbb99228140a69690d02/mvvmfx-guice/src/main/java/de/saxsys/mvvmfx/guice/MvvmfxGuiceApplication.java#L53-L78 | test | Initialize the application. | Of course, here is the Java code you requested:
```java
public final void init() throws Exception {
List<Module> modules = new ArrayList<>();
modules.add(new MvvmfxModule());
modules.add(new AbstractModule() {
@Override
protected void configure() {
bind(HostServices.class).toProvider(MvvmfxGuiceApp... |
glytching/junit-extensions | src/main/java/io/github/glytching/junit/extension/folder/TemporaryFolderExtension.java | TemporaryFolderExtension.resolveParameter | @Override
public Object resolveParameter(
ParameterContext parameterContext, ExtensionContext extensionContext)
throws ParameterResolutionException {
return extensionContext
.getStore(NAMESPACE)
.getOrComputeIfAbsent(
parameterContext, key -> new TemporaryFolder(), Temporar... | java | @Override
public Object resolveParameter(
ParameterContext parameterContext, ExtensionContext extensionContext)
throws ParameterResolutionException {
return extensionContext
.getStore(NAMESPACE)
.getOrComputeIfAbsent(
parameterContext, key -> new TemporaryFolder(), Temporar... | [
"@",
"Override",
"public",
"Object",
"resolveParameter",
"(",
"ParameterContext",
"parameterContext",
",",
"ExtensionContext",
"extensionContext",
")",
"throws",
"ParameterResolutionException",
"{",
"return",
"extensionContext",
".",
"getStore",
"(",
"NAMESPACE",
")",
"."... | Provides a value for any parameter context which has passed the {@link
#supportsParameter(ParameterContext, ExtensionContext)} gate.
@param parameterContext the context for the parameter for which an argument should be resolved
@param extensionContext the <em>context</em> in which the current test or container is bein... | [
"Provides",
"a",
"value",
"for",
"any",
"parameter",
"context",
"which",
"has",
"passed",
"the",
"{",
"@link",
"#supportsParameter",
"(",
"ParameterContext",
"ExtensionContext",
")",
"}",
"gate",
"."
] | ad687cb3a5db38db3ae1a0a7129fe94a7494b0e1 | https://github.com/glytching/junit-extensions/blob/ad687cb3a5db38db3ae1a0a7129fe94a7494b0e1/src/main/java/io/github/glytching/junit/extension/folder/TemporaryFolderExtension.java#L163-L171 | test | Override this method to resolve a single segment. | Of course, here is the Java code you requested:
```java
@Override
public Object resolveParameter(
ParameterContext parameterContext, ExtensionContext extensionContext)
throws ParameterResolutionException {
return extensionContext
.getStore(NAMESPACE)
.getOrComputeIfAbsent(
... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/WroModel.java | WroModel.identifyDuplicateGroupNames | private void identifyDuplicateGroupNames(final Collection<Group> groups) {
LOG.debug("identifyDuplicateGroupNames");
final List<String> groupNames = new ArrayList<String>();
for (final Group group : groups) {
if (groupNames.contains(group.getName())) {
throw new WroRuntimeException("Duplicate ... | java | private void identifyDuplicateGroupNames(final Collection<Group> groups) {
LOG.debug("identifyDuplicateGroupNames");
final List<String> groupNames = new ArrayList<String>();
for (final Group group : groups) {
if (groupNames.contains(group.getName())) {
throw new WroRuntimeException("Duplicate ... | [
"private",
"void",
"identifyDuplicateGroupNames",
"(",
"final",
"Collection",
"<",
"Group",
">",
"groups",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"identifyDuplicateGroupNames\"",
")",
";",
"final",
"List",
"<",
"String",
">",
"groupNames",
"=",
"new",
"ArrayList"... | Identify duplicate group names.
@param groups a collection of group to validate. | [
"Identify",
"duplicate",
"group",
"names",
"."
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/WroModel.java#L63-L72 | test | Identify duplicate group names. | Of course, here is the Java code you requested:
```java
private void identifyDuplicateGroupNames(final Collection<Group> groups) {
LOG.debug("identifyDuplicateGroupNames");
final List<String> groupNames = new ArrayList<String>();
for (final Group group : groups) {
if (groupNames.contains(group.getNam... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/utility/PicturesUtility.java | PicturesUtility.getXSSFPictruesMap | private static void getXSSFPictruesMap(final XSSFWorkbook wb,
final Map<String, Picture> picMap) {
picMap.clear();
List<XSSFPictureData> pictures = wb.getAllPictures();
if (pictures.isEmpty()) {
return;
}
for (int i = 0; i < wb.getNumberOfSheets(); i++) {
XSSFSheet sheet = wb.getSheetAt(i);... | java | private static void getXSSFPictruesMap(final XSSFWorkbook wb,
final Map<String, Picture> picMap) {
picMap.clear();
List<XSSFPictureData> pictures = wb.getAllPictures();
if (pictures.isEmpty()) {
return;
}
for (int i = 0; i < wb.getNumberOfSheets(); i++) {
XSSFSheet sheet = wb.getSheetAt(i);... | [
"private",
"static",
"void",
"getXSSFPictruesMap",
"(",
"final",
"XSSFWorkbook",
"wb",
",",
"final",
"Map",
"<",
"String",
",",
"Picture",
">",
"picMap",
")",
"{",
"picMap",
".",
"clear",
"(",
")",
";",
"List",
"<",
"XSSFPictureData",
">",
"pictures",
"=",... | Gets the XSSF pictrues map.
@param wb
the wb
@param picMap
the pic map | [
"Gets",
"the",
"XSSF",
"pictrues",
"map",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/PicturesUtility.java#L72-L94 | test | Gets the xssfpictrues map. | Of course, here is the Java code you requested:
```java
private static void getXSSFPictruesMap(final XSSFWorkbook wb,
final Map<String, Picture> picMap) {
picMap.clear();
List<XSSFPictureData> pictures = wb.getAllPictures();
if (pictures.isEmpty()) {
return;
}
for (int i = 0; i < wb.getNumberO... |
PeterisP/morphology | src/main/java/lv/semti/morphology/analyzer/MarkupConverter.java | MarkupConverter.toKamolsMarkup | private static StringBuilder toKamolsMarkup(
AttributeValues avs, boolean defaults) {
StringBuilder tag = new StringBuilder();
String pos = avs.getValue(AttributeNames.i_PartOfSpeech);
if (pos == null) return tag;
if (pos.equalsIgnoreCase(AttributeNames.v_Noun)) {
tag.setLength(0);
if (defaults)
... | java | private static StringBuilder toKamolsMarkup(
AttributeValues avs, boolean defaults) {
StringBuilder tag = new StringBuilder();
String pos = avs.getValue(AttributeNames.i_PartOfSpeech);
if (pos == null) return tag;
if (pos.equalsIgnoreCase(AttributeNames.v_Noun)) {
tag.setLength(0);
if (defaults)
... | [
"private",
"static",
"StringBuilder",
"toKamolsMarkup",
"(",
"AttributeValues",
"avs",
",",
"boolean",
"defaults",
")",
"{",
"StringBuilder",
"tag",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"pos",
"=",
"avs",
".",
"getValue",
"(",
"AttributeNames",
... | Convert internal attribute-value structure to SemTi-Kamols tag.
Usage of default tags given as parameter. No additional defaults used. | [
"Convert",
"internal",
"attribute",
"-",
"value",
"structure",
"to",
"SemTi",
"-",
"Kamols",
"tag",
".",
"Usage",
"of",
"default",
"tags",
"given",
"as",
"parameter",
".",
"No",
"additional",
"defaults",
"used",
"."
] | a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783 | https://github.com/PeterisP/morphology/blob/a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783/src/main/java/lv/semti/morphology/analyzer/MarkupConverter.java#L69-L449 | test | toKamolsMarkup - obtenir tagset | Of course, here is the Java code you requested:
```java
private static StringBuilder toKamolsMarkup(
AttributeValues avs, boolean defaults) {
StringBuilder tag = new StringBuilder();
String pos = avs.getValue(AttributeNames.i_PartOfSpeech);
if (pos == null) return tag;
if (pos.equalsIgnoreCase(Attribute... |
xmlet/XsdParser | src/main/java/org/xmlet/xsdparser/xsdelements/visitors/AttributesVisitor.java | AttributesVisitor.replaceUnsolvedAttributes | public void replaceUnsolvedAttributes(NamedConcreteElement element){
if (element.getElement() instanceof XsdAttributeGroup){
attributeGroups.stream()
.filter(attributeGroup -> attributeGroup instanceof UnsolvedReference && ((UnsolvedReference) attributeGroup).getRef().equals(elem... | java | public void replaceUnsolvedAttributes(NamedConcreteElement element){
if (element.getElement() instanceof XsdAttributeGroup){
attributeGroups.stream()
.filter(attributeGroup -> attributeGroup instanceof UnsolvedReference && ((UnsolvedReference) attributeGroup).getRef().equals(elem... | [
"public",
"void",
"replaceUnsolvedAttributes",
"(",
"NamedConcreteElement",
"element",
")",
"{",
"if",
"(",
"element",
".",
"getElement",
"(",
")",
"instanceof",
"XsdAttributeGroup",
")",
"{",
"attributeGroups",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"attr... | Tries to match the received {@link NamedConcreteElement} object, with any of the elements present either in
{@link AttributesVisitor#attributeGroups} or {@link AttributesVisitor#attributes}. If a match occurs this method
performs all the required actions to fully exchange the {@link UnsolvedReference} object with the e... | [
"Tries",
"to",
"match",
"the",
"received",
"{"
] | 0044681d77400e1568d1e7b1024a38ec76caa2cb | https://github.com/xmlet/XsdParser/blob/0044681d77400e1568d1e7b1024a38ec76caa2cb/src/main/java/org/xmlet/xsdparser/xsdelements/visitors/AttributesVisitor.java#L103-L125 | test | Replace the unsolved attributes of an element. | Of course, here is the Java code you requested:
```java
public void replaceUnsolvedAttributes(NamedConcreteElement element){
if (element.getElement() instanceof XsdAttributeGroup){
attributeGroups.stream()
.filter(attributeGroup -> attributeGroup instanceof UnsolvedReference && ... |
truward/brikar | brikar-client/src/main/java/com/truward/brikar/client/rest/support/StandardRestServiceBinder.java | StandardRestServiceBinder.getMethodInvocationHandler | @Nonnull
private MethodInvocationHandler getMethodInvocationHandler(@Nonnull Method method,
@Nonnull final Class<?> clazz,
@Nonnull String serviceBaseUrl) {
// toString+hashCode+equals
if ... | java | @Nonnull
private MethodInvocationHandler getMethodInvocationHandler(@Nonnull Method method,
@Nonnull final Class<?> clazz,
@Nonnull String serviceBaseUrl) {
// toString+hashCode+equals
if ... | [
"@",
"Nonnull",
"private",
"MethodInvocationHandler",
"getMethodInvocationHandler",
"(",
"@",
"Nonnull",
"Method",
"method",
",",
"@",
"Nonnull",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"@",
"Nonnull",
"String",
"serviceBaseUrl",
")",
"{",
"// toString+hash... | /*
Creates an instance of an interface which is supposed to handle method calls in the proxy. | [
"/",
"*",
"Creates",
"an",
"instance",
"of",
"an",
"interface",
"which",
"is",
"supposed",
"to",
"handle",
"method",
"calls",
"in",
"the",
"proxy",
"."
] | 9a2f6d0149b281fff0f704f169021187f5f9115f | https://github.com/truward/brikar/blob/9a2f6d0149b281fff0f704f169021187f5f9115f/brikar-client/src/main/java/com/truward/brikar/client/rest/support/StandardRestServiceBinder.java#L64-L84 | test | MethodInvocationHandler. | Of course, here is the Java code you requested:
```java
@Nonnull
private MethodInvocationHandler getMethodInvocationHandler(@Nonnull Method method,
@Nonnull final Class<?> clazz,
@Nonnull String ... |
spring-projects/spring-security | core/src/main/java/org/springframework/security/access/hierarchicalroles/RoleHierarchyImpl.java | RoleHierarchyImpl.buildRolesReachableInOneOrMoreStepsMap | private void buildRolesReachableInOneOrMoreStepsMap() {
this.rolesReachableInOneOrMoreStepsMap = new HashMap<>();
// iterate over all higher roles from rolesReachableInOneStepMap
for (GrantedAuthority role : this.rolesReachableInOneStepMap.keySet()) {
Set<GrantedAuthority> rolesToVisitSet = new HashSet<>();
... | java | private void buildRolesReachableInOneOrMoreStepsMap() {
this.rolesReachableInOneOrMoreStepsMap = new HashMap<>();
// iterate over all higher roles from rolesReachableInOneStepMap
for (GrantedAuthority role : this.rolesReachableInOneStepMap.keySet()) {
Set<GrantedAuthority> rolesToVisitSet = new HashSet<>();
... | [
"private",
"void",
"buildRolesReachableInOneOrMoreStepsMap",
"(",
")",
"{",
"this",
".",
"rolesReachableInOneOrMoreStepsMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"// iterate over all higher roles from rolesReachableInOneStepMap",
"for",
"(",
"GrantedAuthority",
"role"... | For every higher role from rolesReachableInOneStepMap store all roles that are
reachable from it in the map of roles reachable in one or more steps. (Or throw a
CycleInRoleHierarchyException if a cycle in the role hierarchy definition is
detected) | [
"For",
"every",
"higher",
"role",
"from",
"rolesReachableInOneStepMap",
"store",
"all",
"roles",
"that",
"are",
"reachable",
"from",
"it",
"in",
"the",
"map",
"of",
"roles",
"reachable",
"in",
"one",
"or",
"more",
"steps",
".",
"(",
"Or",
"throw",
"a",
"Cy... | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/access/hierarchicalroles/RoleHierarchyImpl.java#L213-L252 | test | Build the rolesReachableInOneOrMoreStepsMap | Of course, here is the Java code you requested:
```java
private void buildRolesReachableInOneOrMoreStepsMap() {
this.rolesReachableInOneOrMoreStepsMap = new HashMap<>();
// iterate over all higher roles from rolesReachableInOneStepMap
for (GrantedAuthority role : this.rolesReachableInOneStepMap.keySet()) {
S... |
Unidata/thredds | dap4/d4core/src/main/java/dap4/core/ce/CEConstraint.java | CEConstraint.computegroups | protected void computegroups()
{
// 1. variables
for(int i = 0; i < variables.size(); i++) {
DapVariable var = variables.get(i);
List<DapGroup> path = var.getGroupPath();
for(DapGroup group : path) {
if(!this.groups.contains(group))
... | java | protected void computegroups()
{
// 1. variables
for(int i = 0; i < variables.size(); i++) {
DapVariable var = variables.get(i);
List<DapGroup> path = var.getGroupPath();
for(DapGroup group : path) {
if(!this.groups.contains(group))
... | [
"protected",
"void",
"computegroups",
"(",
")",
"{",
"// 1. variables",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"variables",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"DapVariable",
"var",
"=",
"variables",
".",
"get",
"(",
"i",
")"... | Walk all the included declarations
and accumulate the set of referenced groups | [
"Walk",
"all",
"the",
"included",
"declarations",
"and",
"accumulate",
"the",
"set",
"of",
"referenced",
"groups"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/ce/CEConstraint.java#L1051-L1080 | test | This method computegroups is called to compute the groups of the tc_lang file. | Of course, here is the Java code you requested:
```java
protected void computegroups()
{
// 1. variables
for(int i = 0; i < variables.size(); i++) {
DapVariable var = variables.get(i);
List<DapGroup> path = var.getGroupPath();
for(DapGroup group : path) {
... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/vo/ws/auth/AppRequestToken.java | AppRequestToken.toJsonObject | @Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Encrypted Data Base 64...
if (this.getEncryptedDataBase64() != null) {
returnVal.put(JSONMapping.ENCRYPTED_DATA_BASE_64, this.getEncryptedDataBase64());
}
... | java | @Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Encrypted Data Base 64...
if (this.getEncryptedDataBase64() != null) {
returnVal.put(JSONMapping.ENCRYPTED_DATA_BASE_64, this.getEncryptedDataBase64());
}
... | [
"@",
"Override",
"public",
"JSONObject",
"toJsonObject",
"(",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"returnVal",
"=",
"super",
".",
"toJsonObject",
"(",
")",
";",
"//Encrypted Data Base 64...",
"if",
"(",
"this",
".",
"getEncryptedDataBase64",
"(",
")... | Conversion to {@code JSONObject} from Java Object.
@return {@code JSONObject} representation of {@code AppRequestToken}
@throws JSONException If there is a problem with the JSON Body.
@see ABaseFluidJSONObject#toJsonObject() | [
"Conversion",
"to",
"{",
"@code",
"JSONObject",
"}",
"from",
"Java",
"Object",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/ws/auth/AppRequestToken.java#L279-L330 | test | This method is overridden to return a JSONObject representation of this object. | Of course, here is the Java code you requested:
```java
@Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//Encrypted Data Base 64...
if (this.getEncryptedDataBase64() != null) {
returnVal.put(JSONMapping.ENCRYPTED_D... |
workplacesystems/utilsj | src/main/java/com/workplacesystems/utilsj/collections/helpers/CollectionUtilities.java | CollectionUtilities.like | public static<T> Collection<T> like(Collection<T> source)
{
// known concrete types
if (source instanceof FilterableArrayList)
return new FilterableArrayList();
if (source instanceof ArrayList)
return new ArrayList();
if (source instanceof LinkedList)
... | java | public static<T> Collection<T> like(Collection<T> source)
{
// known concrete types
if (source instanceof FilterableArrayList)
return new FilterableArrayList();
if (source instanceof ArrayList)
return new ArrayList();
if (source instanceof LinkedList)
... | [
"public",
"static",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"like",
"(",
"Collection",
"<",
"T",
">",
"source",
")",
"{",
"// known concrete types\r",
"if",
"(",
"source",
"instanceof",
"FilterableArrayList",
")",
"return",
"new",
"FilterableArrayList",
"(... | New empty collection with similar type to source. The known concrete types replicated exactly are
{@link ArrayList}, {@link LinkedList}, {@link TreeSet}, {@link HashSet}, {@link Stack}, {@link Stack},
{@link PriorityQueue}, {@link LinkedHashSet}, {@link Vector}.
<p>
Otherwise, the method only guarantees common conform... | [
"New",
"empty",
"collection",
"with",
"similar",
"type",
"to",
"source",
".",
"The",
"known",
"concrete",
"types",
"replicated",
"exactly",
"are",
"{"
] | 1b638be51997eafac4d368c14f62a16624a08d3e | https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/helpers/CollectionUtilities.java#L65-L98 | test | A convenience method for creating a Collection of objects that are not objects that are instances of the CRA - specific class. | Of course, here is the Java code you requested:
```java
public static<T> Collection<T> like(Collection<T> source)
{
// known concrete types
if (source instanceof FilterableArrayList)
return new FilterableArrayList();
if (source instanceof ArrayList)
return new ... |
js-lib-com/tiny-container | src/main/java/js/servlet/AppServlet.java | AppServlet.init | @Override
public void init(ServletConfig config) throws UnavailableException {
container = (ContainerSPI) config.getServletContext().getAttribute(TinyContainer.ATTR_INSTANCE);
if (container == null) {
log.fatal("Tiny container instance not properly created, probably misconfigured. Servlet |%s| permanently u... | java | @Override
public void init(ServletConfig config) throws UnavailableException {
container = (ContainerSPI) config.getServletContext().getAttribute(TinyContainer.ATTR_INSTANCE);
if (container == null) {
log.fatal("Tiny container instance not properly created, probably misconfigured. Servlet |%s| permanently u... | [
"@",
"Override",
"public",
"void",
"init",
"(",
"ServletConfig",
"config",
")",
"throws",
"UnavailableException",
"{",
"container",
"=",
"(",
"ContainerSPI",
")",
"config",
".",
"getServletContext",
"(",
")",
".",
"getAttribute",
"(",
"TinyContainer",
".",
"ATTR... | Servlet life cycle callback executed at this servlet instance initialization. Mainly takes care to initialize parent
container reference. If there is no servlet context attribute with the name {@link TinyContainer#ATTR_INSTANCE} this
initialization fails with servlet permanently unavailable.
<p>
Parent container instan... | [
"Servlet",
"life",
"cycle",
"callback",
"executed",
"at",
"this",
"servlet",
"instance",
"initialization",
".",
"Mainly",
"takes",
"care",
"to",
"initialize",
"parent",
"container",
"reference",
".",
"If",
"there",
"is",
"no",
"servlet",
"context",
"attribute",
... | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/servlet/AppServlet.java#L108-L118 | test | Initializes the TinyContainer object. | Of course, here is the Java code you requested:
```java
@Override
public void init(ServletConfig config) throws UnavailableException {
container = (ContainerSPI) config.getServletContext().getAttribute(TinyContainer.ATTR_INSTANCE);
if (container == null) {
log.fatal("Tiny container instance not properly cr... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.buffer | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final <U extends Collection<? super T>> Observable<U> buffer(long timespan, long timeskip, TimeUnit unit, Scheduler scheduler, Callable<U> bufferSupplier) {
ObjectHelper.requireNonNull(unit, "unit is null");
ObjectHelper.require... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final <U extends Collection<? super T>> Observable<U> buffer(long timespan, long timeskip, TimeUnit unit, Scheduler scheduler, Callable<U> bufferSupplier) {
ObjectHelper.requireNonNull(unit, "unit is null");
ObjectHelper.require... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"CUSTOM",
")",
"public",
"final",
"<",
"U",
"extends",
"Collection",
"<",
"?",
"super",
"T",
">",
">",
"Observable",
"<",
"U",
">",
"buffer",
"(",
"long",
"timespan",
",",
"lon... | Returns an Observable that emits buffers of items it collects from the source ObservableSource. The resulting
ObservableSource starts a new buffer periodically, as determined by the {@code timeskip} argument, and on the
specified {@code scheduler}. It emits each buffer after a fixed timespan, specified by the
{@code ti... | [
"Returns",
"an",
"Observable",
"that",
"emits",
"buffers",
"of",
"items",
"it",
"collects",
"from",
"the",
"source",
"ObservableSource",
".",
"The",
"resulting",
"ObservableSource",
"starts",
"a",
"new",
"buffer",
"periodically",
"as",
"determined",
"by",
"the",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L5768-L5775 | test | Buffer the elements of this observable sequence using the specified time period and time period and a custom buffer supplier. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final <U extends Collection<? super T>> Observable<U> buffer(long timespan, long timeskip, TimeUnit unit, Scheduler scheduler, Callable<U> bufferSupplier) {
ObjectHelper.requireNo... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/units/DateFormatter.java | DateFormatter.getISODate | @Deprecated
public Date getISODate(String text) {
Date result;
// try "yyyy-MM-dd HH:mm:ss"
try {
result = stdDateTimeFormat(text);
return result;
} catch (java.text.ParseException e) {
}
// now try "yyyy-MM-dd'T'HH:mm:ss"
try {
result = isoDateTimeFormat(... | java | @Deprecated
public Date getISODate(String text) {
Date result;
// try "yyyy-MM-dd HH:mm:ss"
try {
result = stdDateTimeFormat(text);
return result;
} catch (java.text.ParseException e) {
}
// now try "yyyy-MM-dd'T'HH:mm:ss"
try {
result = isoDateTimeFormat(... | [
"@",
"Deprecated",
"public",
"Date",
"getISODate",
"(",
"String",
"text",
")",
"{",
"Date",
"result",
";",
"// try \"yyyy-MM-dd HH:mm:ss\"\r",
"try",
"{",
"result",
"=",
"stdDateTimeFormat",
"(",
"text",
")",
";",
"return",
"result",
";",
"}",
"catch",
"(",
... | Parse the text in W3C profile of ISO 8601 format.
@param text parse this text
@return equivalent Date or null if failure
@see <a href="http://www.w3.org/TR/NOTE-datetime">W3C profile of ISO 8601</a>
@deprecated As of netCDF-JAVA 4.3.10. Use {@link ucar.nc2.time.CalendarDateFormatter#isoStringToDate(String) } instead | [
"Parse",
"the",
"text",
"in",
"W3C",
"profile",
"of",
"ISO",
"8601",
"format",
".",
"@param",
"text",
"parse",
"this",
"text",
"@return",
"equivalent",
"Date",
"or",
"null",
"if",
"failure",
"@see",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"w3... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/units/DateFormatter.java#L63-L103 | test | Returns the date in the ISO 8601 format from the specified text. | Of course, here is the Java code you requested:
```java
@Deprecated
public Date getISODate(String text) {
Date result;
// try "yyyy-MM-dd HH:mm:ss"
try {
result = stdDateTimeFormat(text);
return result;
} catch (java.text.ParseException e) {
}
// now try "yyyy-MM-dd'... |
ReactiveX/RxJava | src/main/java/io/reactivex/internal/operators/observable/ObservableBlockingSubscribe.java | ObservableBlockingSubscribe.subscribe | public static <T> void subscribe(ObservableSource<? extends T> o) {
BlockingIgnoringReceiver callback = new BlockingIgnoringReceiver();
LambdaObserver<T> ls = new LambdaObserver<T>(Functions.emptyConsumer(),
callback, callback, Functions.emptyConsumer());
o.subscribe(ls);
Block... | java | public static <T> void subscribe(ObservableSource<? extends T> o) {
BlockingIgnoringReceiver callback = new BlockingIgnoringReceiver();
LambdaObserver<T> ls = new LambdaObserver<T>(Functions.emptyConsumer(),
callback, callback, Functions.emptyConsumer());
o.subscribe(ls);
Block... | [
"public",
"static",
"<",
"T",
">",
"void",
"subscribe",
"(",
"ObservableSource",
"<",
"?",
"extends",
"T",
">",
"o",
")",
"{",
"BlockingIgnoringReceiver",
"callback",
"=",
"new",
"BlockingIgnoringReceiver",
"(",
")",
";",
"LambdaObserver",
"<",
"T",
">",
"ls... | Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
@param o the source ObservableSource
@param <T> the value type | [
"Runs",
"the",
"source",
"observable",
"to",
"a",
"terminal",
"event",
"ignoring",
"any",
"values",
"and",
"rethrowing",
"any",
"exception",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/internal/operators/observable/ObservableBlockingSubscribe.java#L76-L88 | test | Subscribes to the source of events. | Of course, here is the Java code you requested:
```java
public static <T> void subscribe(ObservableSource<? extends T> o) {
BlockingIgnoringReceiver callback = new BlockingIgnoringReceiver();
LambdaObserver<T> ls = new LambdaObserver<T>(Functions.emptyConsumer(),
callback, callback, Functions.e... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java | BaseComplexNDArray.mul | @Override
public IComplexNDArray mul(INDArray other, INDArray result) {
return dup().muli(other, result);
} | java | @Override
public IComplexNDArray mul(INDArray other, INDArray result) {
return dup().muli(other, result);
} | [
"@",
"Override",
"public",
"IComplexNDArray",
"mul",
"(",
"INDArray",
"other",
",",
"INDArray",
"result",
")",
"{",
"return",
"dup",
"(",
")",
".",
"muli",
"(",
"other",
",",
"result",
")",
";",
"}"
] | copy (element wise) multiplication of two matrices
@param other the second ndarray to multiply
@param result the result ndarray
@return the result of the multiplication | [
"copy",
"(",
"element",
"wise",
")",
"multiplication",
"of",
"two",
"matrices"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java#L2481-L2484 | test | Multiplies the two complex numbers. | Of course, here is the Java code you requested:
```java
@Override
public IComplexNDArray mul(INDArray other, INDArray result) {
return dup().muli(other, result);
}
```
Hope this helps! |
wildfly/wildfly | ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerImpl.java | TimerImpl.isActive | public boolean isActive() {
return timerService.isStarted() && !isCanceled() && !isExpired() && (timerService.isScheduled(getId()) || timerState == TimerState.CREATED);
} | java | public boolean isActive() {
return timerService.isStarted() && !isCanceled() && !isExpired() && (timerService.isScheduled(getId()) || timerState == TimerState.CREATED);
} | [
"public",
"boolean",
"isActive",
"(",
")",
"{",
"return",
"timerService",
".",
"isStarted",
"(",
")",
"&&",
"!",
"isCanceled",
"(",
")",
"&&",
"!",
"isExpired",
"(",
")",
"&&",
"(",
"timerService",
".",
"isScheduled",
"(",
"getId",
"(",
")",
")",
"||",... | Returns true if this timer is active. Else returns false.
<p>
A timer is considered to be "active", if its {@link TimerState}
is neither of the following:
<ul>
<li>{@link TimerState#CANCELED}</li>
<li>{@link TimerState#EXPIRED}</li>
<li>has not been suspended</li>
</ul>
<p/>
And if the corresponding timer service is st... | [
"Returns",
"true",
"if",
"this",
"timer",
"is",
"active",
".",
"Else",
"returns",
"false",
".",
"<p",
">",
"A",
"timer",
"is",
"considered",
"to",
"be",
"active",
"if",
"its",
"{",
"@link",
"TimerState",
"}",
"is",
"neither",
"of",
"the",
"following",
... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerImpl.java#L398-L400 | test | Returns true if the timer is active. | Of course, here is the Java code you requested:
```java
public boolean isActive() {
return timerService.isStarted() && !isCanceled() && !isExpired() && (timerService.isScheduled(getId()) || timerState == TimerState.CREATED);
}
```
Hope this helps! |
oblac/jodd | jodd-json/src/main/java/jodd/json/meta/JSONAnnotationValues.java | JSONAnnotationValues.of | public static JSONAnnotationValues of(final AnnotationParser annotationParser, final AnnotatedElement annotatedElement) {
if (!annotationParser.hasAnnotationOn(annotatedElement)) {
return null;
}
return new JSONAnnotationValues(annotationParser.of(annotatedElement));
} | java | public static JSONAnnotationValues of(final AnnotationParser annotationParser, final AnnotatedElement annotatedElement) {
if (!annotationParser.hasAnnotationOn(annotatedElement)) {
return null;
}
return new JSONAnnotationValues(annotationParser.of(annotatedElement));
} | [
"public",
"static",
"JSONAnnotationValues",
"of",
"(",
"final",
"AnnotationParser",
"annotationParser",
",",
"final",
"AnnotatedElement",
"annotatedElement",
")",
"{",
"if",
"(",
"!",
"annotationParser",
".",
"hasAnnotationOn",
"(",
"annotatedElement",
")",
")",
"{",
... | Shortcut for checking the annotation on annotated element and returning either the values or {@code null}. | [
"Shortcut",
"for",
"checking",
"the",
"annotation",
"on",
"annotated",
"element",
"and",
"returning",
"either",
"the",
"values",
"or",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-json/src/main/java/jodd/json/meta/JSONAnnotationValues.java#L45-L50 | test | Create a new instance of the class with the given annotation parser and annotated element. | Of course, here is the Java code you requested:
```java
public static JSONAnnotationValues of(final AnnotationParser annotationParser, final AnnotatedElement annotatedElement) {
if (!annotationParser.hasAnnotationOn(annotatedElement)) {
return null;
}
return new JSONAnnotationValues(annotationParser.of(annota... |
deeplearning4j/nd4j | nd4j-common/src/main/java/org/nd4j/tools/InfoLine.java | InfoLine.getTitleLine | public String getTitleLine( int mtLv, int title_I ) {
//
String info = "";
//
if ( title_I < 0 ) return "?";
if ( title_I > 5 ) return "?";
//
info = "";
info += BTools.getMtLvESS( mtLv );
info += BTools.getMtLvISS();
info += "|";
//
InfoValues i_IV;
//
String i_ValuesS = "";
//
int i_VS... | java | public String getTitleLine( int mtLv, int title_I ) {
//
String info = "";
//
if ( title_I < 0 ) return "?";
if ( title_I > 5 ) return "?";
//
info = "";
info += BTools.getMtLvESS( mtLv );
info += BTools.getMtLvISS();
info += "|";
//
InfoValues i_IV;
//
String i_ValuesS = "";
//
int i_VS... | [
"public",
"String",
"getTitleLine",
"(",
"int",
"mtLv",
",",
"int",
"title_I",
")",
"{",
"//",
"String",
"info",
"=",
"\"\"",
";",
"//",
"if",
"(",
"title_I",
"<",
"0",
")",
"return",
"\"?\"",
";",
"if",
"(",
"title_I",
">",
"5",
")",
"return",
"\"... | Returns titles line as string appointed by title index (0..5).<br>
Columns are separated with char '|'.<br>
If title index is < 0 returns "?".<br>
If title index is > 5 returns "?".<br>
@param mtLv - method level
@param title_I - title index
@return titles line as string | [
"Returns",
"titles",
"line",
"as",
"string",
"appointed",
"by",
"title",
"index",
"(",
"0",
"..",
"5",
")",
".",
"<br",
">",
"Columns",
"are",
"separated",
"with",
"char",
"|",
".",
"<br",
">",
"If",
"title",
"index",
"is",
"<",
"0",
"returns",
"?",
... | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/tools/InfoLine.java#L33-L71 | test | Get the title line. | Of course, here is the Java code you requested:
```java
public String getTitleLine( int mtLv, int title_I ) {
//
String info = "";
//
if ( title_I < 0 ) return "?";
if ( title_I > 5 ) return "?";
//
info = "";
info += BTools.getMtLvESS( mtLv );
info += BTools.getMtLvISS();
info += "|";
//
InfoV... |
tiefaces/TieFaces | src/org/tiefaces/common/FacesUtility.java | FacesUtility.getResourceAsStream | public static InputStream getResourceAsStream(
final FacesContext context, final String path) {
return context.getExternalContext().getResourceAsStream(path);
} | java | public static InputStream getResourceAsStream(
final FacesContext context, final String path) {
return context.getExternalContext().getResourceAsStream(path);
} | [
"public",
"static",
"InputStream",
"getResourceAsStream",
"(",
"final",
"FacesContext",
"context",
",",
"final",
"String",
"path",
")",
"{",
"return",
"context",
".",
"getExternalContext",
"(",
")",
".",
"getResourceAsStream",
"(",
"path",
")",
";",
"}"
] | get resource file as stream.
@param context
faces context.
@param path
resource file path.
@return stream. | [
"get",
"resource",
"file",
"as",
"stream",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/common/FacesUtility.java#L77-L80 | test | Gets the resource stream. | Of course, here is the Java code you requested:
```java
public static InputStream getResourceAsStream(
final FacesContext context, final String path) {
return context.getExternalContext().getResourceAsStream(path);
}
```
Hope this helps! |
orientechnologies/orientdb | server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java | ODistributedConfiguration.getDataCenters | public Set<String> getDataCenters() {
final ODocument dcs = configuration.field(DCS);
if (dcs == null)
return Collections.EMPTY_SET;
final Set<String> result = new HashSet<String>();
for (String dc : dcs.fieldNames()) {
result.add(dc);
}
return result;
} | java | public Set<String> getDataCenters() {
final ODocument dcs = configuration.field(DCS);
if (dcs == null)
return Collections.EMPTY_SET;
final Set<String> result = new HashSet<String>();
for (String dc : dcs.fieldNames()) {
result.add(dc);
}
return result;
} | [
"public",
"Set",
"<",
"String",
">",
"getDataCenters",
"(",
")",
"{",
"final",
"ODocument",
"dcs",
"=",
"configuration",
".",
"field",
"(",
"DCS",
")",
";",
"if",
"(",
"dcs",
"==",
"null",
")",
"return",
"Collections",
".",
"EMPTY_SET",
";",
"final",
"... | Returns all the configured data centers' names, if any. | [
"Returns",
"all",
"the",
"configured",
"data",
"centers",
"names",
"if",
"any",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java#L574-L585 | test | Get the data center names. | Of course, here is the Java code you requested:
```java
public Set<String> getDataCenters() {
final ODocument dcs = configuration.field(DCS);
if (dcs == null)
return Collections.EMPTY_SET;
final Set<String> result = new HashSet<String>();
for (String dc : dcs.fieldNames()) {
result.add(dc... |
amedia/meteo | meteo-core/src/main/java/no/api/meteo/util/MeteoNetUtils.java | MeteoNetUtils.createUri | public static URI createUri(String uri) throws MeteoException {
if (uri == null) {
throw new MeteoException("URI is null");
}
try {
return new URI(uri);
} catch (URISyntaxException e) {
throw new MeteoException(e);
}
} | java | public static URI createUri(String uri) throws MeteoException {
if (uri == null) {
throw new MeteoException("URI is null");
}
try {
return new URI(uri);
} catch (URISyntaxException e) {
throw new MeteoException(e);
}
} | [
"public",
"static",
"URI",
"createUri",
"(",
"String",
"uri",
")",
"throws",
"MeteoException",
"{",
"if",
"(",
"uri",
"==",
"null",
")",
"{",
"throw",
"new",
"MeteoException",
"(",
"\"URI is null\"",
")",
";",
"}",
"try",
"{",
"return",
"new",
"URI",
"("... | Wrap the construction of URL's to avoid throwing of checked MalformedURLException. Instead MeteoException
is thrown.
@param uri The url string to be used as the spec for the create URL object.
@return URL object created from the given url spec.
@throws no.api.meteo.MeteoException If a URL couldn't be created from the ... | [
"Wrap",
"the",
"construction",
"of",
"URL",
"s",
"to",
"avoid",
"throwing",
"of",
"checked",
"MalformedURLException",
".",
"Instead",
"MeteoException",
"is",
"thrown",
"."
] | cbb59e1c2f889d15c24f3625d1769b543d4af595 | https://github.com/amedia/meteo/blob/cbb59e1c2f889d15c24f3625d1769b543d4af595/meteo-core/src/main/java/no/api/meteo/util/MeteoNetUtils.java#L41-L50 | test | Create a URI from a String. | Of course, here is the Java code you requested:
```java
public static URI createUri(String uri) throws MeteoException {
if (uri == null) {
throw new MeteoException("URI is null");
}
try {
return new URI(uri);
} catch (URISyntaxException e) {
throw new... |
rest-assured/rest-assured | rest-assured/src/main/java/io/restassured/config/SSLConfig.java | SSLConfig.keyStore | public SSLConfig keyStore(String password) {
Validate.notEmpty(password, "Password cannot be empty");
return keyStore(System.getProperty("user.home") + File.separatorChar + ".keystore", password);
} | java | public SSLConfig keyStore(String password) {
Validate.notEmpty(password, "Password cannot be empty");
return keyStore(System.getProperty("user.home") + File.separatorChar + ".keystore", password);
} | [
"public",
"SSLConfig",
"keyStore",
"(",
"String",
"password",
")",
"{",
"Validate",
".",
"notEmpty",
"(",
"password",
",",
"\"Password cannot be empty\"",
")",
";",
"return",
"keyStore",
"(",
"System",
".",
"getProperty",
"(",
"\"user.home\"",
")",
"+",
"File",
... | Uses the user default keystore stored in <user.home>/.keystore
@param password - Use null for no password
@return The keystore specification | [
"Uses",
"the",
"user",
"default",
"keystore",
"stored",
"in",
"<",
";",
"user",
".",
"home>",
";",
"/",
".",
"keystore"
] | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/config/SSLConfig.java#L140-L143 | test | Create a keystore from the user s home directory. | Of course, here is the Java code you requested:
```java
public SSLConfig keyStore(String password) {
Validate.notEmpty(password, "Password cannot be empty");
return keyStore(System.getProperty("user.home") + File.separatorChar + ".keystore", password);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java | RandomAccessFile.writeShort | public final void writeShort(short[] pa, int start, int n) throws IOException {
for (int i = 0; i < n; i++) {
writeShort(pa[start + i]);
}
} | java | public final void writeShort(short[] pa, int start, int n) throws IOException {
for (int i = 0; i < n; i++) {
writeShort(pa[start + i]);
}
} | [
"public",
"final",
"void",
"writeShort",
"(",
"short",
"[",
"]",
"pa",
",",
"int",
"start",
",",
"int",
"n",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"{",
"writeShort",
"(",
"... | Write an array of shorts
@param pa write from this array
@param start starting with this element in the array
@param n this number of elements
@throws IOException on read error | [
"Write",
"an",
"array",
"of",
"shorts"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java#L1575-L1579 | test | Write a sequence of shorts from a short array. | Of course, here is the Java code you requested:
```java
public final void writeShort(short[] pa, int start, int n) throws IOException {
for (int i = 0; i < n; i++) {
writeShort(pa[start + i]);
}
}
```
Hope this helps! |
wildfly/wildfly | jdr/jboss-as-jdr/src/main/java/org/jboss/as/jdr/CommandLineMain.java | CommandLineMain.main | public static void main(String[] args) {
int port = 9990;
String host = "localhost";
String protocol = "remote+http";
String config = null;
try {
CommandLine line = parser.parse(options, args, false);
if (line.hasOption("help")) {
formatte... | java | public static void main(String[] args) {
int port = 9990;
String host = "localhost";
String protocol = "remote+http";
String config = null;
try {
CommandLine line = parser.parse(options, args, false);
if (line.hasOption("help")) {
formatte... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"int",
"port",
"=",
"9990",
";",
"String",
"host",
"=",
"\"localhost\"",
";",
"String",
"protocol",
"=",
"\"remote+http\"",
";",
"String",
"config",
"=",
"null",
";",
"try",
... | Creates a JBoss Diagnostic Reporter (JDR) Report. A JDR report response
is printed to <code>System.out</code>.
@param args ignored | [
"Creates",
"a",
"JBoss",
"Diagnostic",
"Reporter",
"(",
"JDR",
")",
"Report",
".",
"A",
"JDR",
"report",
"response",
"is",
"printed",
"to",
"<code",
">",
"System",
".",
"out<",
"/",
"code",
">",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jdr/jboss-as-jdr/src/main/java/org/jboss/as/jdr/CommandLineMain.java#L67-L146 | test | Main method for the application. | Of course, here is the Java code you requested:
```java
public static void main(String[] args) {
int port = 9990;
String host = "localhost";
String protocol = "remote+http";
String config = null;
try {
CommandLine line = parser.parse(options, args, false);
... |
spring-projects/spring-security | oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/web/server/DefaultServerOAuth2AuthorizationRequestResolver.java | DefaultServerOAuth2AuthorizationRequestResolver.addPkceParameters | private void addPkceParameters(Map<String, Object> attributes, Map<String, Object> additionalParameters) {
String codeVerifier = this.codeVerifierGenerator.generateKey();
attributes.put(PkceParameterNames.CODE_VERIFIER, codeVerifier);
try {
String codeChallenge = createCodeChallenge(codeVerifier);
additiona... | java | private void addPkceParameters(Map<String, Object> attributes, Map<String, Object> additionalParameters) {
String codeVerifier = this.codeVerifierGenerator.generateKey();
attributes.put(PkceParameterNames.CODE_VERIFIER, codeVerifier);
try {
String codeChallenge = createCodeChallenge(codeVerifier);
additiona... | [
"private",
"void",
"addPkceParameters",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"additionalParameters",
")",
"{",
"String",
"codeVerifier",
"=",
"this",
".",
"codeVerifierGenerator",
".",
"gen... | Creates and adds additional PKCE parameters for use in the OAuth 2.0 Authorization and Access Token Requests
@param attributes where {@link PkceParameterNames#CODE_VERIFIER} is stored for the token request
@param additionalParameters where {@link PkceParameterNames#CODE_CHALLENGE} and, usually,
{@link PkceParameterNam... | [
"Creates",
"and",
"adds",
"additional",
"PKCE",
"parameters",
"for",
"use",
"in",
"the",
"OAuth",
"2",
".",
"0",
"Authorization",
"and",
"Access",
"Token",
"Requests"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/web/server/DefaultServerOAuth2AuthorizationRequestResolver.java#L192-L202 | test | Add the PKCE parameters to the attributes and additional parameters map. | Of course, here is the Java code you requested:
```java
private void addPkceParameters(Map<String, Object> attributes, Map<String, Object> additionalParameters) {
String codeVerifier = this.codeVerifierGenerator.generateKey();
attributes.put(PkceParameterNames.CODE_VERIFIER, codeVerifier);
try {
String codeCh... |
real-logic/aeron | aeron-cluster/src/main/java/io/aeron/cluster/RecordingLog.java | RecordingLog.findLastTermRecordingId | public long findLastTermRecordingId()
{
for (int i = entries.size() - 1; i >= 0; i--)
{
final Entry entry = entries.get(i);
if (ENTRY_TYPE_TERM == entry.type)
{
return entry.recordingId;
}
}
return RecordingPos.NULL_REC... | java | public long findLastTermRecordingId()
{
for (int i = entries.size() - 1; i >= 0; i--)
{
final Entry entry = entries.get(i);
if (ENTRY_TYPE_TERM == entry.type)
{
return entry.recordingId;
}
}
return RecordingPos.NULL_REC... | [
"public",
"long",
"findLastTermRecordingId",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"entries",
".",
"size",
"(",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"final",
"Entry",
"entry",
"=",
"entries",
".",
"get",
"(",
"i",
... | Find the last recording id used for a leader ship term. If not found then {@link RecordingPos#NULL_RECORDING_ID}.
@return the last leadership term recording id or {@link RecordingPos#NULL_RECORDING_ID} if not found. | [
"Find",
"the",
"last",
"recording",
"id",
"used",
"for",
"a",
"leader",
"ship",
"term",
".",
"If",
"not",
"found",
"then",
"{",
"@link",
"RecordingPos#NULL_RECORDING_ID",
"}",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-cluster/src/main/java/io/aeron/cluster/RecordingLog.java#L489-L501 | test | Find the last term recording id. | Of course, here is the Java code you requested:
```java
public long findLastTermRecordingId()
{
for (int i = entries.size() - 1; i >= 0; i--)
{
final Entry entry = entries.get(i);
if (ENTRY_TYPE_TERM == entry.type)
{
return entry.recordingId;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.