repo stringlengths 7 59 | path stringlengths 3 222 | func_name stringlengths 3 127 | original_string stringlengths 0 466k | language stringclasses 1
value | code stringlengths 0 466k | code_tokens listlengths 0 68.3k | docstring stringlengths 0 21.3k | docstring_tokens listlengths 0 1.93k | sha stringlengths 0 40 | url stringlengths 0 339 | partition stringclasses 3
values | summary stringlengths 0 250 | instruction stringlengths 38 3.13k | input stringclasses 1
value | output stringlengths 146 466k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
reactor/reactor-core | reactor-core/src/main/java/reactor/core/publisher/ParallelFlux.java | ParallelFlux.subscribe | public final Disposable subscribe(@Nullable Consumer<? super T> onNext, Consumer<? super Throwable>
onError){
return subscribe(onNext, onError, null);
} | java | public final Disposable subscribe(@Nullable Consumer<? super T> onNext, Consumer<? super Throwable>
onError){
return subscribe(onNext, onError, null);
} | [
"public",
"final",
"Disposable",
"subscribe",
"(",
"@",
"Nullable",
"Consumer",
"<",
"?",
"super",
"T",
">",
"onNext",
",",
"Consumer",
"<",
"?",
"super",
"Throwable",
">",
"onError",
")",
"{",
"return",
"subscribe",
"(",
"onNext",
",",
"onError",
",",
"... | Subscribes to this {@link ParallelFlux} by providing an onNext and onError callback
and triggers the execution chain for all 'rails'.
@param onNext consumer of onNext signals
@param onError consumer of error signal | [
"Subscribes",
"to",
"this",
"{",
"@link",
"ParallelFlux",
"}",
"by",
"providing",
"an",
"onNext",
"and",
"onError",
"callback",
"and",
"triggers",
"the",
"execution",
"chain",
"for",
"all",
"rails",
"."
] | df2eba4ab7d2393e1a942ce972c3307fbbd47ff9 | https://github.com/reactor/reactor-core/blob/df2eba4ab7d2393e1a942ce972c3307fbbd47ff9/reactor-core/src/main/java/reactor/core/publisher/ParallelFlux.java#L986-L989 | valid | Convenience method for calling the wrapped Subscription. | Create a Java method that does the following: "Convenience method for calling the wrapped Subscription.". | Of course, here is the Java code you requested:
```java
public final Disposable subscribe(@Nullable Consumer<? super T> onNext, Consumer<? super Throwable>
onError){
return subscribe(onNext, onError, null);
}
```
Hope this helps! | |
demidenko05/beigesoft-webcrud-jar | src/main/java/org/beigesoft/web/factory/AFactoryAppBeans.java | AFactoryAppBeans.lazyGetHolderRapiFields | public final HolderRapiFields
lazyGetHolderRapiFields() throws Exception {
String beanName = getHolderRapiFieldsName();
HolderRapiFields holderRapiFields =
(HolderRapiFields) this.beansMap.get(beanName);
if (holderRapiFields == null) {
holderRapiFields = new HolderRapiFields();
holderR... | java | public final HolderRapiFields
lazyGetHolderRapiFields() throws Exception {
String beanName = getHolderRapiFieldsName();
HolderRapiFields holderRapiFields =
(HolderRapiFields) this.beansMap.get(beanName);
if (holderRapiFields == null) {
holderRapiFields = new HolderRapiFields();
holderR... | [
"public",
"final",
"HolderRapiFields",
"lazyGetHolderRapiFields",
"(",
")",
"throws",
"Exception",
"{",
"String",
"beanName",
"=",
"getHolderRapiFieldsName",
"(",
")",
";",
"HolderRapiFields",
"holderRapiFields",
"=",
"(",
"HolderRapiFields",
")",
"this",
".",
"beansM... | <p>Get HolderRapiFields in lazy mode.</p>
@return HolderRapiFields - HolderRapiFields
@throws Exception - an exception | [
"<p",
">",
"Get",
"HolderRapiFields",
"in",
"lazy",
"mode",
".",
"<",
"/",
"p",
">"
] | e973170f8fc1f164f0b67af9bb6a52b04579b64a | https://github.com/demidenko05/beigesoft-webcrud-jar/blob/e973170f8fc1f164f0b67af9bb6a52b04579b64a/src/main/java/org/beigesoft/web/factory/AFactoryAppBeans.java#L1142-L1155 | train | Get the HolderRapiFields object from the map. | Create a Java method that does the following: "Get the HolderRapiFields object from the map.". | Of course, here is the Java code you requested:
```java
public final HolderRapiFields
lazyGetHolderRapiFields() throws Exception {
String beanName = getHolderRapiFieldsName();
HolderRapiFields holderRapiFields =
(HolderRapiFields) this.beansMap.get(beanName);
if (holderRapiFields == null) {
... | |
OSSIndex/heuristic-version | src/main/java/net/ossindex/version/VersionFactory.java | VersionFactory.merge | public IVersionRange merge(IVersionRange... ranges) {
if (ranges.length < 2) {
return ranges[0];
}
// Check the type of the first range
if (!(ranges[0] instanceof VersionRange)) {
if (!(ranges[0] instanceof OrRange)) {
throw new UnsupportedOperationException("Incorrect type for rang... | java | public IVersionRange merge(IVersionRange... ranges) {
if (ranges.length < 2) {
return ranges[0];
}
// Check the type of the first range
if (!(ranges[0] instanceof VersionRange)) {
if (!(ranges[0] instanceof OrRange)) {
throw new UnsupportedOperationException("Incorrect type for rang... | [
"public",
"IVersionRange",
"merge",
"(",
"IVersionRange",
"...",
"ranges",
")",
"{",
"if",
"(",
"ranges",
".",
"length",
"<",
"2",
")",
"{",
"return",
"ranges",
"[",
"0",
"]",
";",
"}",
"// Check the type of the first range",
"if",
"(",
"!",
"(",
"ranges",... | Given two "or" ranges or "simple" ranges, merge them together. We are
assuming that the ranges are provided in order for now.
For example:
>1.0.0 merged with (<2.0.0 | >3.0.0) will become (>1.0.0 <2.0.0 | >3.0.0) | [
"Given",
"two",
"or",
"ranges",
"or",
"simple",
"ranges",
"merge",
"them",
"together",
".",
"We",
"are",
"assuming",
"that",
"the",
"ranges",
"are",
"provided",
"in",
"order",
"for",
"now",
"."
] | 9fe33a49d74acec54ddb91de9a3c3cd2f98fba40 | https://github.com/OSSIndex/heuristic-version/blob/9fe33a49d74acec54ddb91de9a3c3cd2f98fba40/src/main/java/net/ossindex/version/VersionFactory.java#L242-L324 | train | Merge the given ranges into this one. | Create a Java method that does the following: "Merge the given ranges into this one.". | Of course, here is the Java code you requested:
```java
public IVersionRange merge(IVersionRange... ranges) {
if (ranges.length < 2) {
return ranges[0];
}
// Check the type of the first range
if (!(ranges[0] instanceof VersionRange)) {
if (!(ranges[0] instanceof OrRange)) {
throw n... | |
WileyLabs/teasy | src/main/java/com/wiley/driver/WebDriverFactory.java | WebDriverFactory.isBrowserDead | private static boolean isBrowserDead() {
try {
if (((FramesTransparentWebDriver) getDriver()).getWrappedDriver() instanceof AppiumDriver) {
getDriver().getPageSource();
} else {
getDriver().getCurrentUrl();
}
return false;
}... | java | private static boolean isBrowserDead() {
try {
if (((FramesTransparentWebDriver) getDriver()).getWrappedDriver() instanceof AppiumDriver) {
getDriver().getPageSource();
} else {
getDriver().getCurrentUrl();
}
return false;
}... | [
"private",
"static",
"boolean",
"isBrowserDead",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"(",
"(",
"FramesTransparentWebDriver",
")",
"getDriver",
"(",
")",
")",
".",
"getWrappedDriver",
"(",
")",
"instanceof",
"AppiumDriver",
")",
"{",
"getDriver",
"(",
")",
... | Checks whether browser is dead. Used to catch
situations like "Error communicating with the remote browser. It may have died." exceptions
@return true if browser is dead | [
"Checks",
"whether",
"browser",
"is",
"dead",
".",
"Used",
"to",
"catch",
"situations",
"like",
"Error",
"communicating",
"with",
"the",
"remote",
"browser",
".",
"It",
"may",
"have",
"died",
".",
"exceptions"
] | 94489ac8e6a6680b52dfa6cdbc9d8535333bef42 | https://github.com/WileyLabs/teasy/blob/94489ac8e6a6680b52dfa6cdbc9d8535333bef42/src/main/java/com/wiley/driver/WebDriverFactory.java#L101-L113 | train | isBrowserDead returns true if browser is dead. | Create a Java method that does the following: "isBrowserDead returns true if browser is dead.". | Of course, here is the Java code you requested:
```java
private static boolean isBrowserDead() {
try {
if (((FramesTransparentWebDriver) getDriver()).getWrappedDriver() instanceof AppiumDriver) {
getDriver().getPageSource();
} else {
getDriver().getCurren... | |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/thread/ThreadFactoryBuilder.java | ThreadFactoryBuilder.setPriority | public ThreadFactoryBuilder setPriority(int priority) {
if (priority < Thread.MIN_PRIORITY) {
throw new IllegalArgumentException(StrUtil.format("Thread priority ({}) must be >= {}", priority, Thread.MIN_PRIORITY));
}
if (priority > Thread.MAX_PRIORITY) {
throw new IllegalArgumentException(StrUtil.forma... | java | public ThreadFactoryBuilder setPriority(int priority) {
if (priority < Thread.MIN_PRIORITY) {
throw new IllegalArgumentException(StrUtil.format("Thread priority ({}) must be >= {}", priority, Thread.MIN_PRIORITY));
}
if (priority > Thread.MAX_PRIORITY) {
throw new IllegalArgumentException(StrUtil.forma... | [
"public",
"ThreadFactoryBuilder",
"setPriority",
"(",
"int",
"priority",
")",
"{",
"if",
"(",
"priority",
"<",
"Thread",
".",
"MIN_PRIORITY",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"StrUtil",
".",
"format",
"(",
"\"Thread priority ({}) must be >=... | 设置线程优先级
@param priority 优先级
@return this
@see Thread#MIN_PRIORITY
@see Thread#NORM_PRIORITY
@see Thread#MAX_PRIORITY | [
"设置线程优先级"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/thread/ThreadFactoryBuilder.java#L82-L91 | train | Sets the priority of the thread. | Create a Java method that does the following: "Sets the priority of the thread.". | Of course, here is the Java code you requested:
```java
public ThreadFactoryBuilder setPriority(int priority) {
if (priority < Thread.MIN_PRIORITY) {
throw new IllegalArgumentException(StrUtil.format("Thread priority ({}) must be >= {}", priority, Thread.MIN_PRIORITY));
}
if (priority > Thread.MAX_PRIORIT... | |
intellimate/Izou | src/main/java/org/intellimate/izou/resource/ResourceManager.java | ResourceManager.unregisterEventsForResourceBuilder | private void unregisterEventsForResourceBuilder(ResourceBuilderModel resourceBuilder) {
resourceBuilder.announceEvents().stream()
.map(eventSubscribers::get)
.filter(Objects::nonNull)
.forEach(list -> list.remove(resourceBuilder));
} | java | private void unregisterEventsForResourceBuilder(ResourceBuilderModel resourceBuilder) {
resourceBuilder.announceEvents().stream()
.map(eventSubscribers::get)
.filter(Objects::nonNull)
.forEach(list -> list.remove(resourceBuilder));
} | [
"private",
"void",
"unregisterEventsForResourceBuilder",
"(",
"ResourceBuilderModel",
"resourceBuilder",
")",
"{",
"resourceBuilder",
".",
"announceEvents",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"(",
"eventSubscribers",
"::",
"get",
")",
".",
"filter",
"(... | unregisters the events for the ResourceBuilder
@param resourceBuilder an instance of ResourceBuilder | [
"unregisters",
"the",
"events",
"for",
"the",
"ResourceBuilder"
] | 40a808b97998e17655c4a78e30ce7326148aed27 | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/resource/ResourceManager.java#L217-L222 | train | Unregister events for a resource builder | Create a Java method that does the following: "Unregister events for a resource builder". | Of course, here is the Java code you requested:
```java
private void unregisterEventsForResourceBuilder(ResourceBuilderModel resourceBuilder) {
resourceBuilder.announceEvents().stream()
.map(eventSubscribers::get)
.filter(Objects::nonNull)
.forEach(list -> list.r... | |
code4craft/webmagic | webmagic-core/src/main/java/us/codecraft/webmagic/downloader/AbstractDownloader.java | AbstractDownloader.download | public Html download(String url, String charset) {
Page page = download(new Request(url), Site.me().setCharset(charset).toTask());
return (Html) page.getHtml();
} | java | public Html download(String url, String charset) {
Page page = download(new Request(url), Site.me().setCharset(charset).toTask());
return (Html) page.getHtml();
} | [
"public",
"Html",
"download",
"(",
"String",
"url",
",",
"String",
"charset",
")",
"{",
"Page",
"page",
"=",
"download",
"(",
"new",
"Request",
"(",
"url",
")",
",",
"Site",
".",
"me",
"(",
")",
".",
"setCharset",
"(",
"charset",
")",
".",
"toTask",
... | A simple method to download a url.
@param url url
@param charset charset
@return html | [
"A",
"simple",
"method",
"to",
"download",
"a",
"url",
"."
] | be892b80bf6682cd063d30ac25a79be0c079a901 | https://github.com/code4craft/webmagic/blob/be892b80bf6682cd063d30ac25a79be0c079a901/webmagic-core/src/main/java/us/codecraft/webmagic/downloader/AbstractDownloader.java#L33-L36 | train | Download a page from the URL. | Create a Java method that does the following: "Download a page from the URL.". | Of course, here is the Java code you requested:
```java
public Html download(String url, String charset) {
Page page = download(new Request(url), Site.me().setCharset(charset).toTask());
return (Html) page.getHtml();
}
```
Hope this helps! | |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/UselessSubclassMethod.java | UselessSubclassMethod.differentAttributes | @SuppressWarnings("PMD.SimplifyBooleanReturns")
private boolean differentAttributes(Method m1, Method m2) {
if (m1.getAnnotationEntries().length > 0 || m2.getAnnotationEntries().length > 0) {
return true;
}
int access1 = m1.getAccessFlags()
& (Const.ACC_PRIVATE | ... | java | @SuppressWarnings("PMD.SimplifyBooleanReturns")
private boolean differentAttributes(Method m1, Method m2) {
if (m1.getAnnotationEntries().length > 0 || m2.getAnnotationEntries().length > 0) {
return true;
}
int access1 = m1.getAccessFlags()
& (Const.ACC_PRIVATE | ... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.SimplifyBooleanReturns\"",
")",
"private",
"boolean",
"differentAttributes",
"(",
"Method",
"m1",
",",
"Method",
"m2",
")",
"{",
"if",
"(",
"m1",
".",
"getAnnotationEntries",
"(",
")",
".",
"length",
">",
"0",
"||",
"m2",
... | TODO awaiting https://github.com/spotbugs/spotbugs/issues/626 | [
"TODO",
"awaiting",
"https",
":",
"//",
"github",
".",
"com",
"/",
"spotbugs",
"/",
"spotbugs",
"/",
"issues",
"/",
"626"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/UselessSubclassMethod.java#L312-L331 | train | Checks if two methods have the same attributes. | Create a Java method that does the following: "Checks if two methods have the same attributes.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("PMD.SimplifyBooleanReturns")
private boolean differentAttributes(Method m1, Method m2) {
if (m1.getAnnotationEntries().length > 0 || m2.getAnnotationEntries().length > 0) {
return true;
}
int access1 = m1... | |
facebookarchive/hadoop-20 | src/contrib/index/src/java/org/apache/hadoop/contrib/index/example/HashingDistributionPolicy.java | HashingDistributionPolicy.chooseShardForDelete | public int chooseShardForDelete(DocumentID key) {
int hashCode = key.hashCode();
return hashCode >= 0 ? hashCode % numShards : (-hashCode) % numShards;
} | java | public int chooseShardForDelete(DocumentID key) {
int hashCode = key.hashCode();
return hashCode >= 0 ? hashCode % numShards : (-hashCode) % numShards;
} | [
"public",
"int",
"chooseShardForDelete",
"(",
"DocumentID",
"key",
")",
"{",
"int",
"hashCode",
"=",
"key",
".",
"hashCode",
"(",
")",
";",
"return",
"hashCode",
">=",
"0",
"?",
"hashCode",
"%",
"numShards",
":",
"(",
"-",
"hashCode",
")",
"%",
"numShard... | /* (non-Javadoc)
@see org.apache.hadoop.contrib.index.mapred.IDistributionPolicy#chooseShardForDelete(org.apache.hadoop.contrib.index.mapred.DocumentID) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/index/src/java/org/apache/hadoop/contrib/index/example/HashingDistributionPolicy.java#L51-L54 | train | Returns the shard to be deleted. | Create a Java method that does the following: "Returns the shard to be deleted.". | Of course, here is the Java code you requested:
```java
public int chooseShardForDelete(DocumentID key) {
int hashCode = key.hashCode();
return hashCode >= 0 ? hashCode % numShards : (-hashCode) % numShards;
}
```
Hope this helps! | |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java | Ifc2x3tc1PackageImpl.getIfcDateTimeSelect | public EClass getIfcDateTimeSelect() {
if (ifcDateTimeSelectEClass == null) {
ifcDateTimeSelectEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(949);
}
return ifcDateTimeSelectEClass;
} | java | public EClass getIfcDateTimeSelect() {
if (ifcDateTimeSelectEClass == null) {
ifcDateTimeSelectEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(949);
}
return ifcDateTimeSelectEClass;
} | [
"public",
"EClass",
"getIfcDateTimeSelect",
"(",
")",
"{",
"if",
"(",
"ifcDateTimeSelectEClass",
"==",
"null",
")",
"{",
"ifcDateTimeSelectEClass",
"=",
"(",
"EClass",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage",
"(",
"Ifc2x3tc1Package",
... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java#L35881-L35887 | train | Get the IfcDateTimeSelectEClass from the EPackage. Registry. INSTANCE. | Create a Java method that does the following: "Get the IfcDateTimeSelectEClass from the EPackage. Registry. INSTANCE.". | Of course, here is the Java code you requested:
```java
public EClass getIfcDateTimeSelect() {
if (ifcDateTimeSelectEClass == null) {
ifcDateTimeSelectEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(949);
}
return ifcDateTimeSelectEClass;
}... | |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/stream/ControlMessageInjector.java | ControlMessageInjector.processStream | @Override
public RecordStreamWithMetadata<DI, SI> processStream(RecordStreamWithMetadata<DI, SI> inputStream,
WorkUnitState workUnitState) throws StreamProcessingException {
init(workUnitState);
setInputGlobalMetadata(inputStream.getGlobalMetadata(), workUnitState);
Flowable<StreamEntity<DI>> outp... | java | @Override
public RecordStreamWithMetadata<DI, SI> processStream(RecordStreamWithMetadata<DI, SI> inputStream,
WorkUnitState workUnitState) throws StreamProcessingException {
init(workUnitState);
setInputGlobalMetadata(inputStream.getGlobalMetadata(), workUnitState);
Flowable<StreamEntity<DI>> outp... | [
"@",
"Override",
"public",
"RecordStreamWithMetadata",
"<",
"DI",
",",
"SI",
">",
"processStream",
"(",
"RecordStreamWithMetadata",
"<",
"DI",
",",
"SI",
">",
"inputStream",
",",
"WorkUnitState",
"workUnitState",
")",
"throws",
"StreamProcessingException",
"{",
"ini... | Apply injections to the input {@link RecordStreamWithMetadata}.
{@link ControlMessage}s may be injected before, after, or around the input record.
A {@link MetadataUpdateControlMessage} will update the current input {@link GlobalMetadata} and pass the
updated input {@link GlobalMetadata} to the next processor to propag... | [
"Apply",
"injections",
"to",
"the",
"input",
"{"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/stream/ControlMessageInjector.java#L87-L135 | train | Process a RecordStreamWithMetadata. | Create a Java method that does the following: "Process a RecordStreamWithMetadata.". | Of course, here is the Java code you requested:
```java
@Override
public RecordStreamWithMetadata<DI, SI> processStream(RecordStreamWithMetadata<DI, SI> inputStream,
WorkUnitState workUnitState) throws StreamProcessingException {
init(workUnitState);
setInputGlobalMetadata(inputStream.getGlobalMetadat... | |
rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__render | protected RawData __render(String template, Object... args) {
if (null == template) return new RawData("");
return S.raw(__engine.sandbox().render(template, args));
} | java | protected RawData __render(String template, Object... args) {
if (null == template) return new RawData("");
return S.raw(__engine.sandbox().render(template, args));
} | [
"protected",
"RawData",
"__render",
"(",
"String",
"template",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"null",
"==",
"template",
")",
"return",
"new",
"RawData",
"(",
"\"\"",
")",
";",
"return",
"S",
".",
"raw",
"(",
"__engine",
".",
"sandbo... | Render another template from this template. Could be used in template authoring.
For example:
<p/>
<pre><code>
{@literal @}args String customTemplate, Map<String, Object> customParams
{@literal @}{ Object renderResult = render(customTemplate, customParams);
}
<p class="customer_content">@renderResult</p>
</code></pre>
... | [
"Render",
"another",
"template",
"from",
"this",
"template",
".",
"Could",
"be",
"used",
"in",
"template",
"authoring",
".",
"For",
"example",
":",
"<p",
"/",
">",
"<pre",
">",
"<code",
">",
"{",
"@literal",
"@",
"}",
"args",
"String",
"customTemplate",
... | 064b565f08d9da07378bf77a9dd856ea5831cc92 | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L280-L283 | train | Render a template. | Create a Java method that does the following: "Render a template.". | Of course, here is the Java code you requested:
```java
protected RawData __render(String template, Object... args) {
if (null == template) return new RawData("");
return S.raw(__engine.sandbox().render(template, args));
}
```
Hope this helps! | |
carrotsearch/hppc | hppc/src/main/templates/com/carrotsearch/hppc/KTypeArrayList.java | KTypeArrayList.equalElements | protected boolean equalElements(KTypeArrayList<?> other) {
int max = size();
if (other.size() != max) {
return false;
}
for (int i = 0; i < max; i++) {
if (!Intrinsics.equals(this, get(i), other.get(i))) {
return false;
}
}
return true;
} | java | protected boolean equalElements(KTypeArrayList<?> other) {
int max = size();
if (other.size() != max) {
return false;
}
for (int i = 0; i < max; i++) {
if (!Intrinsics.equals(this, get(i), other.get(i))) {
return false;
}
}
return true;
} | [
"protected",
"boolean",
"equalElements",
"(",
"KTypeArrayList",
"<",
"?",
">",
"other",
")",
"{",
"int",
"max",
"=",
"size",
"(",
")",
";",
"if",
"(",
"other",
".",
"size",
"(",
")",
"!=",
"max",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
... | Compare index-aligned elements against another
{@link KTypeIndexedContainer}.
#if ($TemplateOptions.KTypeGeneric)
Equality comparison is performed with this object's {@link #equals(Object, Object)}
method.
#end | [
"Compare",
"index",
"-",
"aligned",
"elements",
"against",
"another",
"{"
] | e359e9da358e846fcbffc64a765611df954ba3f6 | https://github.com/carrotsearch/hppc/blob/e359e9da358e846fcbffc64a765611df954ba3f6/hppc/src/main/templates/com/carrotsearch/hppc/KTypeArrayList.java#L491-L504 | train | Compare two ArrayList objects. | Create a Java method that does the following: "Compare two ArrayList objects.". | Of course, here is the Java code you requested:
```java
protected boolean equalElements(KTypeArrayList<?> other) {
int max = size();
if (other.size() != max) {
return false;
}
for (int i = 0; i < max; i++) {
if (!Intrinsics.equals(this, get(i), other.get(i))) {
return false;
... | |
undertow-io/undertow | core/src/main/java/io/undertow/util/PortableConcurrentDirectDeque.java | PortableConcurrentDirectDeque.toArrayList | private ArrayList<E> toArrayList() {
ArrayList<E> list = new ArrayList<>();
for (Node<E> p = first(); p != null; p = succ(p)) {
E item = p.item;
if (item != null)
list.add(item);
}
return list;
} | java | private ArrayList<E> toArrayList() {
ArrayList<E> list = new ArrayList<>();
for (Node<E> p = first(); p != null; p = succ(p)) {
E item = p.item;
if (item != null)
list.add(item);
}
return list;
} | [
"private",
"ArrayList",
"<",
"E",
">",
"toArrayList",
"(",
")",
"{",
"ArrayList",
"<",
"E",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Node",
"<",
"E",
">",
"p",
"=",
"first",
"(",
")",
";",
"p",
"!=",
"null",
";",
... | Creates an array list and fills it with elements of this list.
Used by toArray.
@return the arrayList | [
"Creates",
"an",
"array",
"list",
"and",
"fills",
"it",
"with",
"elements",
"of",
"this",
"list",
".",
"Used",
"by",
"toArray",
"."
] | 87de0b856a7a4ba8faf5b659537b9af07b763263 | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/util/PortableConcurrentDirectDeque.java#L800-L808 | train | This method returns an ArrayList of all the elements in the tree. | Create a Java method that does the following: "This method returns an ArrayList of all the elements in the tree.". | Of course, here is the Java code you requested:
```java
private ArrayList<E> toArrayList() {
ArrayList<E> list = new ArrayList<>();
for (Node<E> p = first(); p != null; p = succ(p)) {
E item = p.item;
if (item != null)
list.add(item);
}
return lis... | |
iipc/webarchive-commons | src/main/java/org/archive/util/FileUtils.java | FileUtils.copyFile | public static boolean copyFile(final File src, final File dest)
throws FileNotFoundException, IOException {
return copyFile(src, dest, -1, true);
} | java | public static boolean copyFile(final File src, final File dest)
throws FileNotFoundException, IOException {
return copyFile(src, dest, -1, true);
} | [
"public",
"static",
"boolean",
"copyFile",
"(",
"final",
"File",
"src",
",",
"final",
"File",
"dest",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"return",
"copyFile",
"(",
"src",
",",
"dest",
",",
"-",
"1",
",",
"true",
")",
";",
"}... | Copy the src file to the destination. Deletes any preexisting
file at destination.
@param src
@param dest
@return True if the extent was greater than actual bytes copied.
@throws FileNotFoundException
@throws IOException | [
"Copy",
"the",
"src",
"file",
"to",
"the",
"destination",
".",
"Deletes",
"any",
"preexisting",
"file",
"at",
"destination",
"."
] | 988bec707c27a01333becfc3bd502af4441ea1e1 | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/FileUtils.java#L71-L74 | train | Copy a file from a CID SECTYPE to a file in a directory. | Create a Java method that does the following: "Copy a file from a CID SECTYPE to a file in a directory.". | Of course, here is the Java code you requested:
```java
public static boolean copyFile(final File src, final File dest)
throws FileNotFoundException, IOException {
return copyFile(src, dest, -1, true);
}
```
Hope this helps! | |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/ReedSolomonDecoder.java | ReedSolomonDecoder.writeFixedBlock | long writeFixedBlock(
FSDataInputStream[] inputs,
int[] erasedLocations,
int erasedLocationToFix,
long limit,
OutputStream out,
Progressable reporter,
ParallelStreamReader parallelReader, CRC32 crc) throws IOException {
LOG.info("Need to write "... | java | long writeFixedBlock(
FSDataInputStream[] inputs,
int[] erasedLocations,
int erasedLocationToFix,
long limit,
OutputStream out,
Progressable reporter,
ParallelStreamReader parallelReader, CRC32 crc) throws IOException {
LOG.info("Need to write "... | [
"long",
"writeFixedBlock",
"(",
"FSDataInputStream",
"[",
"]",
"inputs",
",",
"int",
"[",
"]",
"erasedLocations",
",",
"int",
"erasedLocationToFix",
",",
"long",
"limit",
",",
"OutputStream",
"out",
",",
"Progressable",
"reporter",
",",
"ParallelStreamReader",
"pa... | Decode the inputs provided and write to the output.
@param inputs array of inputs.
@param erasedLocations indexes in the inputs which are known to be erased.
@param erasedLocationToFix index in the inputs which needs to be fixed.
@param limit maximum number of bytes to be written.
@param out the output.
@return size of... | [
"Decode",
"the",
"inputs",
"provided",
"and",
"write",
"to",
"the",
"output",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/ReedSolomonDecoder.java#L220-L278 | train | Write a fixed block of bytes from the input stream to the output stream. | Create a Java method that does the following: "Write a fixed block of bytes from the input stream to the output stream.". | Of course, here is the Java code you requested:
```java
long writeFixedBlock(
FSDataInputStream[] inputs,
int[] erasedLocations,
int erasedLocationToFix,
long limit,
OutputStream out,
Progressable reporter,
ParallelStreamReader parallelReader, CRC32... | |
alipay/sofa-bolt | src/main/java/com/alipay/remoting/CustomSerializerManager.java | CustomSerializerManager.registerCustomSerializer | public static void registerCustomSerializer(String className, CustomSerializer serializer) {
CustomSerializer prevSerializer = classCustomSerializer.putIfAbsent(className, serializer);
if (prevSerializer != null) {
throw new RuntimeException("CustomSerializer has been registered for class: "... | java | public static void registerCustomSerializer(String className, CustomSerializer serializer) {
CustomSerializer prevSerializer = classCustomSerializer.putIfAbsent(className, serializer);
if (prevSerializer != null) {
throw new RuntimeException("CustomSerializer has been registered for class: "... | [
"public",
"static",
"void",
"registerCustomSerializer",
"(",
"String",
"className",
",",
"CustomSerializer",
"serializer",
")",
"{",
"CustomSerializer",
"prevSerializer",
"=",
"classCustomSerializer",
".",
"putIfAbsent",
"(",
"className",
",",
"serializer",
")",
";",
... | Register custom serializer for class name.
@param className
@param serializer
@return | [
"Register",
"custom",
"serializer",
"for",
"class",
"name",
"."
] | 0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046 | https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/CustomSerializerManager.java#L42-L49 | test | Register a custom serializer for a class. | Create a Java method that does the following: "Register a custom serializer for a class.". | Of course, here is the Java code you requested:
```java
public static void registerCustomSerializer(String className, CustomSerializer serializer) {
CustomSerializer prevSerializer = classCustomSerializer.putIfAbsent(className, serializer);
if (prevSerializer != null) {
throw new RuntimeExc... | |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/JSONValue.java | JSONValue.parse | public static <T> T parse(Reader in, T toUpdate) {
try {
JSONParser p = new JSONParser(DEFAULT_PERMISSIVE_MODE);
return p.parse(in, new UpdaterMapper<T>(defaultReader, toUpdate));
} catch (Exception e) {
return null;
}
} | java | public static <T> T parse(Reader in, T toUpdate) {
try {
JSONParser p = new JSONParser(DEFAULT_PERMISSIVE_MODE);
return p.parse(in, new UpdaterMapper<T>(defaultReader, toUpdate));
} catch (Exception e) {
return null;
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"parse",
"(",
"Reader",
"in",
",",
"T",
"toUpdate",
")",
"{",
"try",
"{",
"JSONParser",
"p",
"=",
"new",
"JSONParser",
"(",
"DEFAULT_PERMISSIVE_MODE",
")",
";",
"return",
"p",
".",
"parse",
"(",
"in",
",",
"new... | Parse input json as a mapTo class
mapTo can be a bean
@since 2.0 | [
"Parse",
"input",
"json",
"as",
"a",
"mapTo",
"class"
] | bfb3daef039e22a7bbff5f76bf14ea23330cd70e | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/JSONValue.java#L168-L175 | train | Parses the given reader and writes it to the given object. | Create a Java method that does the following: "Parses the given reader and writes it to the given object.". | Of course, here is the Java code you requested:
```java
public static <T> T parse(Reader in, T toUpdate) {
try {
JSONParser p = new JSONParser(DEFAULT_PERMISSIVE_MODE);
return p.parse(in, new UpdaterMapper<T>(defaultReader, toUpdate));
} catch (Exception e) {
return null;
}
}
```
Hope this helps! | |
beanshell/beanshell | src/main/java/bsh/Capabilities.java | Capabilities.classExists | public static boolean classExists( String name ) {
if ( !classes.containsKey(name) ) try {
/*
Note: do *not* change this to
BshClassManager plainClassForName() or equivalent.
This class must not touch any other bsh classes.
*/
c... | java | public static boolean classExists( String name ) {
if ( !classes.containsKey(name) ) try {
/*
Note: do *not* change this to
BshClassManager plainClassForName() or equivalent.
This class must not touch any other bsh classes.
*/
c... | [
"public",
"static",
"boolean",
"classExists",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"!",
"classes",
".",
"containsKey",
"(",
"name",
")",
")",
"try",
"{",
"/*\n Note: do *not* change this to\n BshClassManager plainClassForName() or equiva... | Use direct Class.forName() to test for the existence of a class.
We should not use BshClassManager here because:
a) the systems using these tests would probably not load the
classes through it anyway.
b) bshclassmanager is heavy and touches other class files.
this capabilities code must be light enough to be used by an... | [
"Use",
"direct",
"Class",
".",
"forName",
"()",
"to",
"test",
"for",
"the",
"existence",
"of",
"a",
"class",
".",
"We",
"should",
"not",
"use",
"BshClassManager",
"here",
"because",
":",
"a",
")",
"the",
"systems",
"using",
"these",
"tests",
"would",
"pr... | fdddee3de948c9e6babb2d1337028f6fd0a2ba5c | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Capabilities.java#L102-L114 | train | Checks if a class with the given name exists in the class cache. | Create a Java method that does the following: "Checks if a class with the given name exists in the class cache.". | Of course, here is the Java code you requested:
```java
public static boolean classExists( String name ) {
if ( !classes.containsKey(name) ) try {
/*
Note: do *not* change this to
BshClassManager plainClassForName() or equivalent.
This class must not ... | |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/protocol/protocoltcp_stats.java | protocoltcp_stats.get | public static protocoltcp_stats get(nitro_service service) throws Exception{
protocoltcp_stats obj = new protocoltcp_stats();
protocoltcp_stats[] response = (protocoltcp_stats[])obj.stat_resources(service);
return response[0];
} | java | public static protocoltcp_stats get(nitro_service service) throws Exception{
protocoltcp_stats obj = new protocoltcp_stats();
protocoltcp_stats[] response = (protocoltcp_stats[])obj.stat_resources(service);
return response[0];
} | [
"public",
"static",
"protocoltcp_stats",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"protocoltcp_stats",
"obj",
"=",
"new",
"protocoltcp_stats",
"(",
")",
";",
"protocoltcp_stats",
"[",
"]",
"response",
"=",
"(",
"protocoltcp_stats",
... | Use this API to fetch the statistics of all protocoltcp_stats resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"the",
"statistics",
"of",
"all",
"protocoltcp_stats",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/protocol/protocoltcp_stats.java#L1564-L1568 | train | Use this API to fetch the statistics of all protocoltcp_stats resources that are configured on netscaler. | Create a Java method that does the following: "Use this API to fetch the statistics of all protocoltcp_stats resources that are configured on netscaler.". | Of course, here is the Java code you requested:
```java
public static protocoltcp_stats get(nitro_service service) throws Exception{
protocoltcp_stats obj = new protocoltcp_stats();
protocoltcp_stats[] response = (protocoltcp_stats[])obj.stat_resources(service);
return response[0];
}
```
Hope this helps! | |
zxing/zxing | core/src/main/java/com/google/zxing/qrcode/decoder/DataBlock.java | DataBlock.getDataBlocks | static DataBlock[] getDataBlocks(byte[] rawCodewords,
Version version,
ErrorCorrectionLevel ecLevel) {
if (rawCodewords.length != version.getTotalCodewords()) {
throw new IllegalArgumentException();
}
// Figure out the number and ... | java | static DataBlock[] getDataBlocks(byte[] rawCodewords,
Version version,
ErrorCorrectionLevel ecLevel) {
if (rawCodewords.length != version.getTotalCodewords()) {
throw new IllegalArgumentException();
}
// Figure out the number and ... | [
"static",
"DataBlock",
"[",
"]",
"getDataBlocks",
"(",
"byte",
"[",
"]",
"rawCodewords",
",",
"Version",
"version",
",",
"ErrorCorrectionLevel",
"ecLevel",
")",
"{",
"if",
"(",
"rawCodewords",
".",
"length",
"!=",
"version",
".",
"getTotalCodewords",
"(",
")",... | <p>When QR Codes use multiple data blocks, they are actually interleaved.
That is, the first byte of data block 1 to n is written, then the second bytes, and so on. This
method will separate the data into original blocks.</p>
@param rawCodewords bytes as read directly from the QR Code
@param version version of the QR ... | [
"<p",
">",
"When",
"QR",
"Codes",
"use",
"multiple",
"data",
"blocks",
"they",
"are",
"actually",
"interleaved",
".",
"That",
"is",
"the",
"first",
"byte",
"of",
"data",
"block",
"1",
"to",
"n",
"is",
"written",
"then",
"the",
"second",
"bytes",
"and",
... | 653ac2a3beb11481eff82e7d5f2bab8a745f7fac | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/qrcode/decoder/DataBlock.java#L47-L112 | train | Get the DataBlocks of the given codewords and version and error correction level. | Create a Java method that does the following: "Get the DataBlocks of the given codewords and version and error correction level.". | Of course, here is the Java code you requested:
```java
static DataBlock[] getDataBlocks(byte[] rawCodewords,
Version version,
ErrorCorrectionLevel ecLevel) {
if (rawCodewords.length != version.getTotalCodewords()) {
throw new IllegalArgu... | |
wisdom-framework/wisdom | extensions/wisdom-instantiatedby/src/main/java/org/wisdom/framework/instances/InstantiatedByManager.java | InstantiatedByManager.configurationEvent | @Override
public void configurationEvent(ConfigurationEvent event) {
LOGGER.debug("event received : " + event.getPid() + " - " + event.getType());
try {
lock.lock();
final List<InstanceDeclaration> impacted
= getDeclarationsByConfiguration(event.getPid(), ... | java | @Override
public void configurationEvent(ConfigurationEvent event) {
LOGGER.debug("event received : " + event.getPid() + " - " + event.getType());
try {
lock.lock();
final List<InstanceDeclaration> impacted
= getDeclarationsByConfiguration(event.getPid(), ... | [
"@",
"Override",
"public",
"void",
"configurationEvent",
"(",
"ConfigurationEvent",
"event",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"event received : \"",
"+",
"event",
".",
"getPid",
"(",
")",
"+",
"\" - \"",
"+",
"event",
".",
"getType",
"(",
")",
")",
... | Receives a configuration event.
@param event the event. | [
"Receives",
"a",
"configuration",
"event",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-instantiatedby/src/main/java/org/wisdom/framework/instances/InstantiatedByManager.java#L186-L222 | train | Configuration event handler. | Create a Java method that does the following: "Configuration event handler.". | Of course, here is the Java code you requested:
```java
@Override
public void configurationEvent(ConfigurationEvent event) {
LOGGER.debug("event received : " + event.getPid() + " - " + event.getType());
try {
lock.lock();
final List<InstanceDeclaration> impacted
... | |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexUpdateMonitor.java | ISPNIndexUpdateMonitor.setUpdateInProgress | public void setUpdateInProgress(boolean updateInProgress, boolean persitentUpdate)
{
if (IndexerIoMode.READ_ONLY == modeHandler.getMode())
{
throw new IllegalStateException("Unable to set updateInProgress value in IndexerIoMode.READ_ONLY mode");
}
try
{
// anyway set l... | java | public void setUpdateInProgress(boolean updateInProgress, boolean persitentUpdate)
{
if (IndexerIoMode.READ_ONLY == modeHandler.getMode())
{
throw new IllegalStateException("Unable to set updateInProgress value in IndexerIoMode.READ_ONLY mode");
}
try
{
// anyway set l... | [
"public",
"void",
"setUpdateInProgress",
"(",
"boolean",
"updateInProgress",
",",
"boolean",
"persitentUpdate",
")",
"{",
"if",
"(",
"IndexerIoMode",
".",
"READ_ONLY",
"==",
"modeHandler",
".",
"getMode",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException"... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexUpdateMonitor.java#L169-L193 | train | Set the updateInProgress flag. | Create a Java method that does the following: "Set the updateInProgress flag.". | Of course, here is the Java code you requested:
```java
public void setUpdateInProgress(boolean updateInProgress, boolean persitentUpdate)
{
if (IndexerIoMode.READ_ONLY == modeHandler.getMode())
{
throw new IllegalStateException("Unable to set updateInProgress value in IndexerIoMode.READ_ONLY m... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/internal/BuilderImpl.java | BuilderImpl.jwtId | @Override
public Builder jwtId(boolean create) {
if (create) {
String jti = JwtUtils.getRandom(16);
claims.put(Claims.ID, jti);
} else {
claims.remove(Claims.ID);
}
return this;
} | java | @Override
public Builder jwtId(boolean create) {
if (create) {
String jti = JwtUtils.getRandom(16);
claims.put(Claims.ID, jti);
} else {
claims.remove(Claims.ID);
}
return this;
} | [
"@",
"Override",
"public",
"Builder",
"jwtId",
"(",
"boolean",
"create",
")",
"{",
"if",
"(",
"create",
")",
"{",
"String",
"jti",
"=",
"JwtUtils",
".",
"getRandom",
"(",
"16",
")",
";",
"claims",
".",
"put",
"(",
"Claims",
".",
"ID",
",",
"jti",
"... | /*
(non-Javadoc)
@see com.ibm.ws.security.jwt.internal.Builder#jwtId(boolean) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/internal/BuilderImpl.java#L368-L378 | train | Set the ID of the JWT. | Create a Java method that does the following: "Set the ID of the JWT.". | Of course, here is the Java code you requested:
```java
@Override
public Builder jwtId(boolean create) {
if (create) {
String jti = JwtUtils.getRandom(16);
claims.put(Claims.ID, jti);
} else {
claims.remove(Claims.ID);
}
return this;
}
```
H... | |
real-logic/aeron | aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java | ChannelUriStringBuilder.clear | public ChannelUriStringBuilder clear()
{
prefix = null;
media = null;
endpoint = null;
networkInterface = null;
controlEndpoint = null;
controlMode = null;
tags = null;
alias = null;
reliable = null;
ttl = null;
mtu = null;
... | java | public ChannelUriStringBuilder clear()
{
prefix = null;
media = null;
endpoint = null;
networkInterface = null;
controlEndpoint = null;
controlMode = null;
tags = null;
alias = null;
reliable = null;
ttl = null;
mtu = null;
... | [
"public",
"ChannelUriStringBuilder",
"clear",
"(",
")",
"{",
"prefix",
"=",
"null",
";",
"media",
"=",
"null",
";",
"endpoint",
"=",
"null",
";",
"networkInterface",
"=",
"null",
";",
"controlEndpoint",
"=",
"null",
";",
"controlMode",
"=",
"null",
";",
"t... | Clear out all the values thus setting back to the initial state.
@return this for a fluent API. | [
"Clear",
"out",
"all",
"the",
"values",
"thus",
"setting",
"back",
"to",
"the",
"initial",
"state",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java#L64-L89 | test | Clear the content of the
. | Create a Java method that does the following: "Clear the content of the
.". | Of course, here is the Java code you requested:
```java
public ChannelUriStringBuilder clear()
{
prefix = null;
media = null;
endpoint = null;
networkInterface = null;
controlEndpoint = null;
controlMode = null;
tags = null;
alias = null;
reli... | |
nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.createHmtx | private void createHmtx(FontFileReader in,
Map glyphs) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("hmtx");
int longHorMetricSize = glyphs.size() * 2;
int leftSideBearingSize = glyphs.size() * 2;
int hmtxSize = longHorMetricSize + ... | java | private void createHmtx(FontFileReader in,
Map glyphs) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("hmtx");
int longHorMetricSize = glyphs.size() * 2;
int leftSideBearingSize = glyphs.size() * 2;
int hmtxSize = longHorMetricSize + ... | [
"private",
"void",
"createHmtx",
"(",
"FontFileReader",
"in",
",",
"Map",
"glyphs",
")",
"throws",
"IOException",
"{",
"TTFDirTabEntry",
"entry",
"=",
"(",
"TTFDirTabEntry",
")",
"dirTabs",
".",
"get",
"(",
"\"hmtx\"",
")",
";",
"int",
"longHorMetricSize",
"="... | Create the hmtx table by copying metrics from original
font to subset font. The glyphs Map contains an
Integer key and Integer value that maps the original
metric (key) to the subset metric (value)
@param in The reader from which to grab the HMTX table
@param glyphs The glyphs table to populate
@throws IOException Ind... | [
"Create",
"the",
"hmtx",
"table",
"by",
"copying",
"metrics",
"from",
"original",
"font",
"to",
"subset",
"font",
".",
"The",
"glyphs",
"Map",
"contains",
"an",
"Integer",
"key",
"and",
"Integer",
"value",
"that",
"maps",
"the",
"original",
"metric",
"(",
... | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L477-L508 | train | Create the HMTX table. | Create a Java method that does the following: "Create the HMTX table.". | Of course, here is the Java code you requested:
```java
private void createHmtx(FontFileReader in,
Map glyphs) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("hmtx");
int longHorMetricSize = glyphs.size() * 2;
int leftSideBearingSize = glyph... | |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/chunkblock/ChunkBlockHandler.java | ChunkBlockHandler.handleChunkBlock | private CallbackResult<Void> handleChunkBlock(Chunk chunk, BlockPos pos, IBlockState oldState, IBlockState newState)
{
IChunkBlock cb = IComponent.getComponent(IChunkBlock.class, oldState.getBlock());
if (cb != null)
removeCoord(chunk.getWorld(), pos, cb.blockRange());
//TODO: use post ?
cb = IComponent.get... | java | private CallbackResult<Void> handleChunkBlock(Chunk chunk, BlockPos pos, IBlockState oldState, IBlockState newState)
{
IChunkBlock cb = IComponent.getComponent(IChunkBlock.class, oldState.getBlock());
if (cb != null)
removeCoord(chunk.getWorld(), pos, cb.blockRange());
//TODO: use post ?
cb = IComponent.get... | [
"private",
"CallbackResult",
"<",
"Void",
">",
"handleChunkBlock",
"(",
"Chunk",
"chunk",
",",
"BlockPos",
"pos",
",",
"IBlockState",
"oldState",
",",
"IBlockState",
"newState",
")",
"{",
"IChunkBlock",
"cb",
"=",
"IComponent",
".",
"getComponent",
"(",
"IChunkB... | Stores the coordinate in the chunk data if newState blocks has a {@link IChunkBlock} component.<br>
Removes the stored coordinate from the chunk data if oldState has {@link IChunkBlock} component.
@param chunk the chunk
@param pos the pos
@param oldState the old state
@param newState the new state
@return the callback... | [
"Stores",
"the",
"coordinate",
"in",
"the",
"chunk",
"data",
"if",
"newState",
"blocks",
"has",
"a",
"{",
"@link",
"IChunkBlock",
"}",
"component",
".",
"<br",
">",
"Removes",
"the",
"stored",
"coordinate",
"from",
"the",
"chunk",
"data",
"if",
"oldState",
... | 4f8e1fa462d5c372fc23414482ba9f429881cc54 | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/chunkblock/ChunkBlockHandler.java#L129-L139 | train | Handle a chunk block. | Create a Java method that does the following: "Handle a chunk block.". | Of course, here is the Java code you requested:
```java
private CallbackResult<Void> handleChunkBlock(Chunk chunk, BlockPos pos, IBlockState oldState, IBlockState newState)
{
IChunkBlock cb = IComponent.getComponent(IChunkBlock.class, oldState.getBlock());
if (cb != null)
removeCoord(chunk.getWorld(), pos, cb.... | |
Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/BusCompOwnerServiceImpl.java | BusCompOwnerServiceImpl.getBusinessServiceList | private List<String> getBusinessServiceList(String firstName, String lastName){
List<String> businessServiceList = new ArrayList<>();
List<Cmdb> cmdbs = cmdbService.getAllBusServices();
/**
Defining search parameters
*/
Predicate<Cmdb> supportOwnerLn = p -> p.getSuppor... | java | private List<String> getBusinessServiceList(String firstName, String lastName){
List<String> businessServiceList = new ArrayList<>();
List<Cmdb> cmdbs = cmdbService.getAllBusServices();
/**
Defining search parameters
*/
Predicate<Cmdb> supportOwnerLn = p -> p.getSuppor... | [
"private",
"List",
"<",
"String",
">",
"getBusinessServiceList",
"(",
"String",
"firstName",
",",
"String",
"lastName",
")",
"{",
"List",
"<",
"String",
">",
"businessServiceList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"Cmdb",
">",
"cm... | Takes First name and last name and returns any Business Services where one of the 4 owner fields match the input
@param firstName
@param lastName
@return returns business service ObjectId list | [
"Takes",
"First",
"name",
"and",
"last",
"name",
"and",
"returns",
"any",
"Business",
"Services",
"where",
"one",
"of",
"the",
"4",
"owner",
"fields",
"match",
"the",
"input"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/BusCompOwnerServiceImpl.java#L89-L125 | train | Gets the list of business service names. | Create a Java method that does the following: "Gets the list of business service names.". | Of course, here is the Java code you requested:
```java
private List<String> getBusinessServiceList(String firstName, String lastName){
List<String> businessServiceList = new ArrayList<>();
List<Cmdb> cmdbs = cmdbService.getAllBusServices();
/**
Defining search parameters
*/
... | |
RestComm/jain-slee | container/router/src/main/java/org/mobicents/slee/runtime/eventrouter/stats/EventRouterStatisticsImpl.java | EventRouterStatisticsImpl.getAverageEventRoutingTime | public long getAverageEventRoutingTime() {
long time = 0L;
long events = 0L;
for (EventTypeID eventTypeID : eventRouter.getSleeContainer().getComponentManagement().getComponentRepository().getEventComponentIDs()) {
for (int i = 0; i < getExecutors().length; i++) {
final EventRouterExecutorStatistics eventR... | java | public long getAverageEventRoutingTime() {
long time = 0L;
long events = 0L;
for (EventTypeID eventTypeID : eventRouter.getSleeContainer().getComponentManagement().getComponentRepository().getEventComponentIDs()) {
for (int i = 0; i < getExecutors().length; i++) {
final EventRouterExecutorStatistics eventR... | [
"public",
"long",
"getAverageEventRoutingTime",
"(",
")",
"{",
"long",
"time",
"=",
"0L",
";",
"long",
"events",
"=",
"0L",
";",
"for",
"(",
"EventTypeID",
"eventTypeID",
":",
"eventRouter",
".",
"getSleeContainer",
"(",
")",
".",
"getComponentManagement",
"("... | /*
(non-Javadoc)
@see org.mobicents.slee.container.eventrouter.stats.EventRouterExecutorStatistics#getAverageEventRoutingTime() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/router/src/main/java/org/mobicents/slee/runtime/eventrouter/stats/EventRouterStatisticsImpl.java#L78-L94 | test | Gets the average event routing time. | Create a Java method that does the following: "Gets the average event routing time.". | Of course, here is the Java code you requested:
```java
public long getAverageEventRoutingTime() {
long time = 0L;
long events = 0L;
for (EventTypeID eventTypeID : eventRouter.getSleeContainer().getComponentManagement().getComponentRepository().getEventComponentIDs()) {
for (int i = 0; i < getExecutors().leng... | |
jhalterman/lyra | src/main/java/net/jodah/lyra/config/RecoveryPolicy.java | RecoveryPolicy.withBackoff | @Override
public RecoveryPolicy withBackoff(Duration interval, Duration maxInterval, int intervalMultiplier) {
return super.withBackoff(interval, maxInterval, intervalMultiplier);
} | java | @Override
public RecoveryPolicy withBackoff(Duration interval, Duration maxInterval, int intervalMultiplier) {
return super.withBackoff(interval, maxInterval, intervalMultiplier);
} | [
"@",
"Override",
"public",
"RecoveryPolicy",
"withBackoff",
"(",
"Duration",
"interval",
",",
"Duration",
"maxInterval",
",",
"int",
"intervalMultiplier",
")",
"{",
"return",
"super",
".",
"withBackoff",
"(",
"interval",
",",
"maxInterval",
",",
"intervalMultiplier"... | Sets the {@code interval} to pause for between attempts, exponentially backing of to the
{@code maxInterval} multiplying successive intervals by the {@code intervalMultiplier}.
@throws NullPointerException if {@code interval} or {@code maxInterval} are null
@throws IllegalArgumentException if {@code interval} is <= 0,... | [
"Sets",
"the",
"{",
"@code",
"interval",
"}",
"to",
"pause",
"for",
"between",
"attempts",
"exponentially",
"backing",
"of",
"to",
"the",
"{",
"@code",
"maxInterval",
"}",
"multiplying",
"successive",
"intervals",
"by",
"the",
"{",
"@code",
"intervalMultiplier",... | ce347a69357fef1b34e92d92a4f9e68792d81255 | https://github.com/jhalterman/lyra/blob/ce347a69357fef1b34e92d92a4f9e68792d81255/src/main/java/net/jodah/lyra/config/RecoveryPolicy.java#L101-L104 | train | Override withBackoff to add retry delay. | Create a Java method that does the following: "Override withBackoff to add retry delay.". | Of course, here is the Java code you requested:
```java
@Override
public RecoveryPolicy withBackoff(Duration interval, Duration maxInterval, int intervalMultiplier) {
return super.withBackoff(interval, maxInterval, intervalMultiplier);
}
```
Hope this helps! | |
Wikidata/Wikidata-Toolkit | wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/StatementUpdate.java | StatementUpdate.getRevisionIdFromResponse | protected long getRevisionIdFromResponse(JsonNode response) throws JsonMappingException {
if(response == null) {
throw new JsonMappingException("API response is null");
}
JsonNode entity = null;
if(response.has("entity")) {
entity = response.path("entity");
} else if(response.has("pageinfo")) {
entit... | java | protected long getRevisionIdFromResponse(JsonNode response) throws JsonMappingException {
if(response == null) {
throw new JsonMappingException("API response is null");
}
JsonNode entity = null;
if(response.has("entity")) {
entity = response.path("entity");
} else if(response.has("pageinfo")) {
entit... | [
"protected",
"long",
"getRevisionIdFromResponse",
"(",
"JsonNode",
"response",
")",
"throws",
"JsonMappingException",
"{",
"if",
"(",
"response",
"==",
"null",
")",
"{",
"throw",
"new",
"JsonMappingException",
"(",
"\"API response is null\"",
")",
";",
"}",
"JsonNod... | Extracts the last revision id from the JSON response returned
by the API after an edit
@param response
the response as returned by Mediawiki
@return
the new revision id of the edited entity
@throws JsonMappingException | [
"Extracts",
"the",
"last",
"revision",
"id",
"from",
"the",
"JSON",
"response",
"returned",
"by",
"the",
"API",
"after",
"an",
"edit"
] | 7732851dda47e1febff406fba27bfec023f4786e | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/StatementUpdate.java#L594-L608 | train | Get the revision id from the response JSON node. | Create a Java method that does the following: "Get the revision id from the response JSON node.". | Of course, here is the Java code you requested:
```java
protected long getRevisionIdFromResponse(JsonNode response) throws JsonMappingException {
if(response == null) {
throw new JsonMappingException("API response is null");
}
JsonNode entity = null;
if(response.has("entity")) {
entity = response.path("e... | |
ow2-chameleon/fuchsia | core/src/main/java/org/ow2/chameleon/fuchsia/core/component/manager/DeclarationRegistrationManager.java | DeclarationRegistrationManager.unregisterDeclaration | public void unregisterDeclaration(T declaration) {
ServiceRegistration registration;
synchronized (declarationsRegistered) {
registration = declarationsRegistered.remove(declaration);
if (registration == null) {
throw new IllegalStateException("The given Declarati... | java | public void unregisterDeclaration(T declaration) {
ServiceRegistration registration;
synchronized (declarationsRegistered) {
registration = declarationsRegistered.remove(declaration);
if (registration == null) {
throw new IllegalStateException("The given Declarati... | [
"public",
"void",
"unregisterDeclaration",
"(",
"T",
"declaration",
")",
"{",
"ServiceRegistration",
"registration",
";",
"synchronized",
"(",
"declarationsRegistered",
")",
"{",
"registration",
"=",
"declarationsRegistered",
".",
"remove",
"(",
"declaration",
")",
";... | Utility method to unregister an Declaration of OSGi.
Use it only if you have used registerDeclaration(...) to register the Declaration
@param declaration the Declaration to unregister | [
"Utility",
"method",
"to",
"unregister",
"an",
"Declaration",
"of",
"OSGi",
".",
"Use",
"it",
"only",
"if",
"you",
"have",
"used",
"registerDeclaration",
"(",
"...",
")",
"to",
"register",
"the",
"Declaration"
] | 4e9318eadbdeb945e529789f573b45386e619bed | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/core/src/main/java/org/ow2/chameleon/fuchsia/core/component/manager/DeclarationRegistrationManager.java#L72-L82 | train | Unregister a Declaration. | Create a Java method that does the following: "Unregister a Declaration.". | Of course, here is the Java code you requested:
```java
public void unregisterDeclaration(T declaration) {
ServiceRegistration registration;
synchronized (declarationsRegistered) {
registration = declarationsRegistered.remove(declaration);
if (registration == null) {
... | |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java | Type.convertToTypeJDBC | public Object convertToTypeJDBC(SessionInterface session, Object a,
Type type) {
return convertToType(session, a, type);
} | java | public Object convertToTypeJDBC(SessionInterface session, Object a,
Type type) {
return convertToType(session, a, type);
} | [
"public",
"Object",
"convertToTypeJDBC",
"(",
"SessionInterface",
"session",
",",
"Object",
"a",
",",
"Type",
"type",
")",
"{",
"return",
"convertToType",
"(",
"session",
",",
"a",
",",
"type",
")",
";",
"}"
] | Convert type for JDBC. Same as convertToType, but supports non-standard
SQL conversions supported by JDBC | [
"Convert",
"type",
"for",
"JDBC",
".",
"Same",
"as",
"convertToType",
"but",
"supports",
"non",
"-",
"standard",
"SQL",
"conversions",
"supported",
"by",
"JDBC"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/types/Type.java#L269-L272 | train | Convert to type JDBC. | Create a Java method that does the following: "Convert to type JDBC.". | Of course, here is the Java code you requested:
```java
public Object convertToTypeJDBC(SessionInterface session, Object a,
Type type) {
return convertToType(session, a, type);
}
```
Hope this helps! | |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java | DateFormat.getDateTimeInstance | public final static DateFormat getDateTimeInstance(
int dateStyle, int timeStyle, Locale aLocale)
{
return get(dateStyle, timeStyle, ULocale.forLocale(aLocale), null);
} | java | public final static DateFormat getDateTimeInstance(
int dateStyle, int timeStyle, Locale aLocale)
{
return get(dateStyle, timeStyle, ULocale.forLocale(aLocale), null);
} | [
"public",
"final",
"static",
"DateFormat",
"getDateTimeInstance",
"(",
"int",
"dateStyle",
",",
"int",
"timeStyle",
",",
"Locale",
"aLocale",
")",
"{",
"return",
"get",
"(",
"dateStyle",
",",
"timeStyle",
",",
"ULocale",
".",
"forLocale",
"(",
"aLocale",
")",
... | Returns the date/time formatter with the given formatting styles
for the given locale.
@param dateStyle the given date formatting style. As currently implemented, relative date
formatting only affects a limited range of calendar days before or after the
current date, based on the CLDR <field type="day">/<relat... | [
"Returns",
"the",
"date",
"/",
"time",
"formatter",
"with",
"the",
"given",
"formatting",
"styles",
"for",
"the",
"given",
"locale",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java#L1385-L1389 | train | Get a DateFormat instance for the passed locale. | Create a Java method that does the following: "Get a DateFormat instance for the passed locale.". | Of course, here is the Java code you requested:
```java
public final static DateFormat getDateTimeInstance(
int dateStyle, int timeStyle, Locale aLocale)
{
return get(dateStyle, timeStyle, ULocale.forLocale(aLocale), null);
}
```
Hope this helps! | |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3d.java | Path3d.propertyArraysEquals | @Pure
public static boolean propertyArraysEquals (Property<?>[] array, Property<?> [] array2) {
if(array.length==array2.length) {
for(int i=0; i<array.length; i++) {
if(array[i]==null) {
if(array2[i]!=null)
return false;
} else if(array2[i]==null) {
return false;
} else if(!array[i].ge... | java | @Pure
public static boolean propertyArraysEquals (Property<?>[] array, Property<?> [] array2) {
if(array.length==array2.length) {
for(int i=0; i<array.length; i++) {
if(array[i]==null) {
if(array2[i]!=null)
return false;
} else if(array2[i]==null) {
return false;
} else if(!array[i].ge... | [
"@",
"Pure",
"public",
"static",
"boolean",
"propertyArraysEquals",
"(",
"Property",
"<",
"?",
">",
"[",
"]",
"array",
",",
"Property",
"<",
"?",
">",
"[",
"]",
"array2",
")",
"{",
"if",
"(",
"array",
".",
"length",
"==",
"array2",
".",
"length",
")"... | Indicates if the two property arrays are strictly equals
@param array
@param array2
@return <code>true</code> if every Property in the first array is equals to the Property
in same index in the second array, <code>false</code> otherwise | [
"Indicates",
"if",
"the",
"two",
"property",
"arrays",
"are",
"strictly",
"equals"
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3d.java#L70-L86 | train | Checks if two property arrays are equals. | Create a Java method that does the following: "Checks if two property arrays are equals.". | Of course, here is the Java code you requested:
```java
@Pure
public static boolean propertyArraysEquals (Property<?>[] array, Property<?> [] array2) {
if(array.length==array2.length) {
for(int i=0; i<array.length; i++) {
if(array[i]==null) {
if(array2[i]!=null)
return false;
} else if(array2[... | |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java | VpnConnectionsInner.listByVpnGatewayAsync | public Observable<Page<VpnConnectionInner>> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) {
return listByVpnGatewayWithServiceResponseAsync(resourceGroupName, gatewayName)
.map(new Func1<ServiceResponse<Page<VpnConnectionInner>>, Page<VpnConnectionInner>>() {
... | java | public Observable<Page<VpnConnectionInner>> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) {
return listByVpnGatewayWithServiceResponseAsync(resourceGroupName, gatewayName)
.map(new Func1<ServiceResponse<Page<VpnConnectionInner>>, Page<VpnConnectionInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"VpnConnectionInner",
">",
">",
"listByVpnGatewayAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"gatewayName",
")",
"{",
"return",
"listByVpnGatewayWithServiceResponseAsync",
"(",
"resourceGroupName",... | Retrieves all vpn connections for a particular virtual wan vpn gateway.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<VpnConnectionInner... | [
"Retrieves",
"all",
"vpn",
"connections",
"for",
"a",
"particular",
"virtual",
"wan",
"vpn",
"gateway",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java#L581-L589 | train | Gets a list of VPN connections. | Create a Java method that does the following: "Gets a list of VPN connections.". | Of course, here is the Java code you requested:
```java
public Observable<Page<VpnConnectionInner>> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) {
return listByVpnGatewayWithServiceResponseAsync(resourceGroupName, gatewayName)
.map(new Func1<ServiceResponse<Page<V... | |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/AbstractContainer.java | AbstractContainer.size | public int size() {
int size = 0;
try {
if (getParent() != null) {
size = getParent().locateChildElements(getLocator()).size();
} else {
size = HtmlElementUtils.locateElements(getLocator()).size();
}
} catch (NoSuchElementExcept... | java | public int size() {
int size = 0;
try {
if (getParent() != null) {
size = getParent().locateChildElements(getLocator()).size();
} else {
size = HtmlElementUtils.locateElements(getLocator()).size();
}
} catch (NoSuchElementExcept... | [
"public",
"int",
"size",
"(",
")",
"{",
"int",
"size",
"=",
"0",
";",
"try",
"{",
"if",
"(",
"getParent",
"(",
")",
"!=",
"null",
")",
"{",
"size",
"=",
"getParent",
"(",
")",
".",
"locateChildElements",
"(",
"getLocator",
"(",
")",
")",
".",
"si... | Returns the number of containers found on the page.
@return the number of containers found on the page | [
"Returns",
"the",
"number",
"of",
"containers",
"found",
"on",
"the",
"page",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/AbstractContainer.java#L278-L291 | train | Get size of the resource | Create a Java method that does the following: "Get size of the resource". | Of course, here is the Java code you requested:
```java
public int size() {
int size = 0;
try {
if (getParent() != null) {
size = getParent().locateChildElements(getLocator()).size();
} else {
size = HtmlElementUtils.locateElements(getLocator()).s... | |
eclipse/xtext-core | org.eclipse.xtext.xtext.ide/src-gen/org/eclipse/xtext/xtext/ide/contentassist/antlr/internal/InternalXtextParser.java | InternalXtextParser.ruleAssignableTerminal | public final void ruleAssignableTerminal() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalXtext.g:933:2: ( ( ( rule__AssignableTerminal__Alternatives ) ) )
// InternalXtext.g:934:2: ( ( rule__AssignableTerminal__Alternatives ) )
... | java | public final void ruleAssignableTerminal() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalXtext.g:933:2: ( ( ( rule__AssignableTerminal__Alternatives ) ) )
// InternalXtext.g:934:2: ( ( rule__AssignableTerminal__Alternatives ) )
... | [
"public",
"final",
"void",
"ruleAssignableTerminal",
"(",
")",
"throws",
"RecognitionException",
"{",
"int",
"stackSize",
"=",
"keepStackSize",
"(",
")",
";",
"try",
"{",
"// InternalXtext.g:933:2: ( ( ( rule__AssignableTerminal__Alternatives ) ) )",
"// InternalXtext.g:934:2: ... | InternalXtext.g:929:1: ruleAssignableTerminal : ( ( rule__AssignableTerminal__Alternatives ) ) ; | [
"InternalXtext",
".",
"g",
":",
"929",
":",
"1",
":",
"ruleAssignableTerminal",
":",
"(",
"(",
"rule__AssignableTerminal__Alternatives",
")",
")",
";"
] | bac941cb75cb24706519845ec174cfef874d7557 | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.xtext.ide/src-gen/org/eclipse/xtext/xtext/ide/contentassist/antlr/internal/InternalXtextParser.java#L2808-L2849 | train | Generates the sequence of target terminals in the sequence of target terminals. | Create a Java method that does the following: "Generates the sequence of target terminals in the sequence of target terminals.". | Of course, here is the Java code you requested:
```java
public final void ruleAssignableTerminal() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalXtext.g:933:2: ( ( ( rule__AssignableTerminal__Alternatives ) ) )
// InternalXtext.g:93... | |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/TreeGraphNode.java | TreeGraphNode.safeCast | private static TreeGraphNode safeCast(Object t) {
if (t == null || !(t instanceof TreeGraphNode)) {
return null;
}
return (TreeGraphNode) t;
} | java | private static TreeGraphNode safeCast(Object t) {
if (t == null || !(t instanceof TreeGraphNode)) {
return null;
}
return (TreeGraphNode) t;
} | [
"private",
"static",
"TreeGraphNode",
"safeCast",
"(",
"Object",
"t",
")",
"{",
"if",
"(",
"t",
"==",
"null",
"||",
"!",
"(",
"t",
"instanceof",
"TreeGraphNode",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"(",
"TreeGraphNode",
")",
"t",
";",
... | Safely casts an <code>Object</code> to a
<code>TreeGraphNode</code> if possible, else returns
<code>null</code>.
@param t any <code>Object</code>
@return <code>t</code> if it is a <code>TreeGraphNode</code>;
<code>null</code> otherwise | [
"Safely",
"casts",
"an",
"<code",
">",
"Object<",
"/",
"code",
">",
"to",
"a",
"<code",
">",
"TreeGraphNode<",
"/",
"code",
">",
"if",
"possible",
"else",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/TreeGraphNode.java#L634-L639 | train | Casts a object to a TreeGraphNode. | Create a Java method that does the following: "Casts a object to a TreeGraphNode.". | Of course, here is the Java code you requested:
```java
private static TreeGraphNode safeCast(Object t) {
if (t == null || !(t instanceof TreeGraphNode)) {
return null;
}
return (TreeGraphNode) t;
}
```
Hope this helps! | |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/text/TextGenerator.java | TextGenerator.generateMarkov | public String generateMarkov(int length, int context, String seed) {
String str = seed;
while (str.length() < length) {
String prefix = str.substring(Math.max(str.length() - context, 0), str.length());
TrieNode node = inner.matchPredictor(prefix);
long cursorCount = node.getCursorCount();
... | java | public String generateMarkov(int length, int context, String seed) {
String str = seed;
while (str.length() < length) {
String prefix = str.substring(Math.max(str.length() - context, 0), str.length());
TrieNode node = inner.matchPredictor(prefix);
long cursorCount = node.getCursorCount();
... | [
"public",
"String",
"generateMarkov",
"(",
"int",
"length",
",",
"int",
"context",
",",
"String",
"seed",
")",
"{",
"String",
"str",
"=",
"seed",
";",
"while",
"(",
"str",
".",
"length",
"(",
")",
"<",
"length",
")",
"{",
"String",
"prefix",
"=",
"st... | Generate markov string.
@param length the length
@param context the context
@param seed the seed
@return the string | [
"Generate",
"markov",
"string",
"."
] | b5a5e73449aae57de7dbfca2ed7a074432c5b17e | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/text/TextGenerator.java#L53-L80 | train | Generate Markov from a sequence of characters. | Create a Java method that does the following: "Generate Markov from a sequence of characters.". | Of course, here is the Java code you requested:
```java
public String generateMarkov(int length, int context, String seed) {
String str = seed;
while (str.length() < length) {
String prefix = str.substring(Math.max(str.length() - context, 0), str.length());
TrieNode node = inner.matchPredictor(pref... | |
aws/aws-sdk-java | aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/AmazonCloudDirectoryClient.java | AmazonCloudDirectoryClient.addFacetToObject | @Override
public AddFacetToObjectResult addFacetToObject(AddFacetToObjectRequest request) {
request = beforeClientExecution(request);
return executeAddFacetToObject(request);
} | java | @Override
public AddFacetToObjectResult addFacetToObject(AddFacetToObjectRequest request) {
request = beforeClientExecution(request);
return executeAddFacetToObject(request);
} | [
"@",
"Override",
"public",
"AddFacetToObjectResult",
"addFacetToObject",
"(",
"AddFacetToObjectRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeAddFacetToObject",
"(",
"request",
")",
";",
"}"
] | <p>
Adds a new <a>Facet</a> to an object. An object can have more than one facet applied on it.
</p>
@param addFacetToObjectRequest
@return Result of the AddFacetToObject operation returned by the service.
@throws InternalServiceException
Indicates a problem that must be resolved by Amazon Web Services. This might be ... | [
"<p",
">",
"Adds",
"a",
"new",
"<a",
">",
"Facet<",
"/",
"a",
">",
"to",
"an",
"object",
".",
"An",
"object",
"can",
"have",
"more",
"than",
"one",
"facet",
"applied",
"on",
"it",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/AmazonCloudDirectoryClient.java#L431-L435 | train | Adds a facet to an object. | Create a Java method that does the following: "Adds a facet to an object.". | Of course, here is the Java code you requested:
```java
@Override
public AddFacetToObjectResult addFacetToObject(AddFacetToObjectRequest request) {
request = beforeClientExecution(request);
return executeAddFacetToObject(request);
}
```
Hope this helps! | |
avarabyeu/jashing | jashing/src/main/java/com/github/avarabyeu/jashing/core/eventsource/ScheduledEventSource.java | ScheduledEventSource.runOneIteration | @Override
protected final void runOneIteration() throws Exception {
try {
sendEvent(produceEvent());
} catch (Exception e){
LOGGER.error(MessageFormatter.format("Cannot produce event with id {}", eventId).getMessage(), e);
}
} | java | @Override
protected final void runOneIteration() throws Exception {
try {
sendEvent(produceEvent());
} catch (Exception e){
LOGGER.error(MessageFormatter.format("Cannot produce event with id {}", eventId).getMessage(), e);
}
} | [
"@",
"Override",
"protected",
"final",
"void",
"runOneIteration",
"(",
")",
"throws",
"Exception",
"{",
"try",
"{",
"sendEvent",
"(",
"produceEvent",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"LOGGER",
".",
"error",
"(",
"Message... | Executes one iteration of {@link com.google.common.util.concurrent.AbstractScheduledService}
Sends event to event bus
@throws Exception | [
"Executes",
"one",
"iteration",
"of",
"{",
"@link",
"com",
".",
"google",
".",
"common",
".",
"util",
".",
"concurrent",
".",
"AbstractScheduledService",
"}",
"Sends",
"event",
"to",
"event",
"bus"
] | fcc6ec67e2663eb1dde8cbacff5e660ca717cbc8 | https://github.com/avarabyeu/jashing/blob/fcc6ec67e2663eb1dde8cbacff5e660ca717cbc8/jashing/src/main/java/com/github/avarabyeu/jashing/core/eventsource/ScheduledEventSource.java#L55-L63 | train | Run one iteration of the application. | Create a Java method that does the following: "Run one iteration of the application.". | Of course, here is the Java code you requested:
```java
@Override
protected final void runOneIteration() throws Exception {
try {
sendEvent(produceEvent());
} catch (Exception e){
LOGGER.error(MessageFormatter.format("Cannot produce event with id {}", eventId).getMessage(), ... | |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java | PathOverrideService.getPath | public EndpointOverride getPath(int pathId, String clientUUID, String[] filters) throws Exception {
EndpointOverride endpoint = null;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
String queryStrin... | java | public EndpointOverride getPath(int pathId, String clientUUID, String[] filters) throws Exception {
EndpointOverride endpoint = null;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
String queryStrin... | [
"public",
"EndpointOverride",
"getPath",
"(",
"int",
"pathId",
",",
"String",
"clientUUID",
",",
"String",
"[",
"]",
"filters",
")",
"throws",
"Exception",
"{",
"EndpointOverride",
"endpoint",
"=",
"null",
";",
"PreparedStatement",
"statement",
"=",
"null",
";",... | Returns information for a specific path id
@param pathId ID of path
@param clientUUID client UUID
@param filters filters to set on endpoint
@return EndpointOverride
@throws Exception exception | [
"Returns",
"information",
"for",
"a",
"specific",
"path",
"id"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/PathOverrideService.java#L1074-L1109 | train | Get a path from the pathId | Create a Java method that does the following: "Get a path from the pathId". | Of course, here is the Java code you requested:
```java
public EndpointOverride getPath(int pathId, String clientUUID, String[] filters) throws Exception {
EndpointOverride endpoint = null;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sq... | |
JodaOrg/joda-time | src/main/java/org/joda/time/IllegalFieldValueException.java | IllegalFieldValueException.createMessage | private static String createMessage(String fieldName, Number value,
Number lowerBound, Number upperBound, String explain) {
StringBuilder buf = new StringBuilder()
.append("Value ").append(value).append(" for ").append(fieldName).append(' ');
if (lowe... | java | private static String createMessage(String fieldName, Number value,
Number lowerBound, Number upperBound, String explain) {
StringBuilder buf = new StringBuilder()
.append("Value ").append(value).append(" for ").append(fieldName).append(' ');
if (lowe... | [
"private",
"static",
"String",
"createMessage",
"(",
"String",
"fieldName",
",",
"Number",
"value",
",",
"Number",
"lowerBound",
",",
"Number",
"upperBound",
",",
"String",
"explain",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
"."... | Creates a message for the exception.
@param fieldName the field name
@param value the value rejected
@param lowerBound the lower bound allowed
@param upperBound the upper bound allowed
@param explain an explanation
@return the message | [
"Creates",
"a",
"message",
"for",
"the",
"exception",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/IllegalFieldValueException.java#L39-L64 | train | Create a message for a CRA - A FATAL field. | Create a Java method that does the following: "Create a message for a CRA - A FATAL field.". | Of course, here is the Java code you requested:
```java
private static String createMessage(String fieldName, Number value,
Number lowerBound, Number upperBound, String explain) {
StringBuilder buf = new StringBuilder()
.append("Value ").append(value).append(... | |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java | ID3v2Tag.getBytes | public byte[] getBytes()
{
byte[] b = new byte[getSize() + padding];
int bytesCopied = 0;
int length = 0;
length = head.getHeaderSize();
System.arraycopy(head.getBytes(), 0, b, bytesCopied, length);
bytesCopied += length;
if (head.getExtendedHeader())
{
length = ext_head.getSize();
System.arrayc... | java | public byte[] getBytes()
{
byte[] b = new byte[getSize() + padding];
int bytesCopied = 0;
int length = 0;
length = head.getHeaderSize();
System.arraycopy(head.getBytes(), 0, b, bytesCopied, length);
bytesCopied += length;
if (head.getExtendedHeader())
{
length = ext_head.getSize();
System.arrayc... | [
"public",
"byte",
"[",
"]",
"getBytes",
"(",
")",
"{",
"byte",
"[",
"]",
"b",
"=",
"new",
"byte",
"[",
"getSize",
"(",
")",
"+",
"padding",
"]",
";",
"int",
"bytesCopied",
"=",
"0",
";",
"int",
"length",
"=",
"0",
";",
"length",
"=",
"head",
".... | Return a binary representation of this object to be written to a file.
This is in the format of the id3v2 specifications. This includes the
header, extended header (if it exists), the frames, padding (if it
exists), and a footer (if it exists).
@return a binary representation of this id3v2 tag | [
"Return",
"a",
"binary",
"representation",
"of",
"this",
"object",
"to",
"be",
"written",
"to",
"a",
"file",
".",
"This",
"is",
"in",
"the",
"format",
"of",
"the",
"id3v2",
"specifications",
".",
"This",
"includes",
"the",
"header",
"extended",
"header",
"... | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java#L233-L264 | train | Returns the bytes of this frame. | Create a Java method that does the following: "Returns the bytes of this frame.". | Of course, here is the Java code you requested:
```java
public byte[] getBytes()
{
byte[] b = new byte[getSize() + padding];
int bytesCopied = 0;
int length = 0;
length = head.getHeaderSize();
System.arraycopy(head.getBytes(), 0, b, bytesCopied, length);
bytesCopied += length;
if (head.getExtendedHeade... | |
real-logic/aeron | aeron-archive/src/main/java/io/aeron/archive/client/ArchiveProxy.java | ArchiveProxy.stopRecording | public boolean stopRecording(
final long subscriptionId,
final long correlationId,
final long controlSessionId)
{
stopRecordingSubscriptionRequestEncoder
.wrapAndApplyHeader(buffer, 0, messageHeaderEncoder)
.controlSessionId(controlSessionId)
.corr... | java | public boolean stopRecording(
final long subscriptionId,
final long correlationId,
final long controlSessionId)
{
stopRecordingSubscriptionRequestEncoder
.wrapAndApplyHeader(buffer, 0, messageHeaderEncoder)
.controlSessionId(controlSessionId)
.corr... | [
"public",
"boolean",
"stopRecording",
"(",
"final",
"long",
"subscriptionId",
",",
"final",
"long",
"correlationId",
",",
"final",
"long",
"controlSessionId",
")",
"{",
"stopRecordingSubscriptionRequestEncoder",
".",
"wrapAndApplyHeader",
"(",
"buffer",
",",
"0",
",",... | Stop an active recording by the {@link Subscription#registrationId()} it was registered with.
@param subscriptionId that identifies the subscription in the archive doing the recording.
@param correlationId for this request.
@param controlSessionId for this request.
@return true if successfully offered otherwise f... | [
"Stop",
"an",
"active",
"recording",
"by",
"the",
"{",
"@link",
"Subscription#registrationId",
"()",
"}",
"it",
"was",
"registered",
"with",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-archive/src/main/java/io/aeron/archive/client/ArchiveProxy.java#L264-L276 | test | Stop recording. | Create a Java method that does the following: "Stop recording.". | Of course, here is the Java code you requested:
```java
public boolean stopRecording(
final long subscriptionId,
final long correlationId,
final long controlSessionId)
{
stopRecordingSubscriptionRequestEncoder
.wrapAndApplyHeader(buffer, 0, messageHeaderEncoder)
... | |
ocpsoft/rewrite | config-servlet/src/main/java/org/ocpsoft/rewrite/servlet/config/Header.java | Header.exists | public static Header exists(final String name)
{
return new Header(name, "{" + Header.class.getName() + "_value}") {
@Override
public String toString()
{
return "Header.exists(\"" + name + "\")";
}
};
} | java | public static Header exists(final String name)
{
return new Header(name, "{" + Header.class.getName() + "_value}") {
@Override
public String toString()
{
return "Header.exists(\"" + name + "\")";
}
};
} | [
"public",
"static",
"Header",
"exists",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"Header",
"(",
"name",
",",
"\"{\"",
"+",
"Header",
".",
"class",
".",
"getName",
"(",
")",
"+",
"\"_value}\"",
")",
"{",
"@",
"Override",
"public",
"Str... | Create a {@link Header} condition that matches only against the existence of a header with a name matching the
given pattern. The header value is ignored.
<p>
The given name pattern may be parameterized:
<p>
<code>
Header.exists("Accept-Encoding")<br>
Header.exists("Accept-{acceptType}")<br>
Header.exists("{anything}")... | [
"Create",
"a",
"{",
"@link",
"Header",
"}",
"condition",
"that",
"matches",
"only",
"against",
"the",
"existence",
"of",
"a",
"header",
"with",
"a",
"name",
"matching",
"the",
"given",
"pattern",
".",
"The",
"header",
"value",
"is",
"ignored",
".",
"<p",
... | eded0bad0101d119a3a1e67ed3f97a3bc9a8222e | https://github.com/ocpsoft/rewrite/blob/eded0bad0101d119a3a1e67ed3f97a3bc9a8222e/config-servlet/src/main/java/org/ocpsoft/rewrite/servlet/config/Header.java#L101-L110 | valid | Create a Header object with the specified name. | Create a Java method that does the following: "Create a Header object with the specified name.". | Of course, here is the Java code you requested:
```java
public static Header exists(final String name)
{
return new Header(name, "{" + Header.class.getName() + "_value}") {
@Override
public String toString()
{
return "Header.exists(\"" + name + "\")";
}
};... | |
diirt/util | src/main/java/org/epics/util/array/CollectionNumbers.java | CollectionNumbers.shortArrayWrappedOrCopy | public static short[] shortArrayWrappedOrCopy(CollectionNumber coll) {
short[] array = wrappedShortArray(coll);
if (array != null) {
return array;
}
return shortArrayCopyOf(coll);
} | java | public static short[] shortArrayWrappedOrCopy(CollectionNumber coll) {
short[] array = wrappedShortArray(coll);
if (array != null) {
return array;
}
return shortArrayCopyOf(coll);
} | [
"public",
"static",
"short",
"[",
"]",
"shortArrayWrappedOrCopy",
"(",
"CollectionNumber",
"coll",
")",
"{",
"short",
"[",
"]",
"array",
"=",
"wrappedShortArray",
"(",
"coll",
")",
";",
"if",
"(",
"array",
"!=",
"null",
")",
"{",
"return",
"array",
";",
... | Returns either the wrapped array (if exists and matches the type)
or a copy - USE WITH CAUTION AS IT MAY EXPOSE THE INTERNAL STATE
OF THE COLLECTION.
@param coll the collection
@return the array | [
"Returns",
"either",
"the",
"wrapped",
"array",
"(",
"if",
"exists",
"and",
"matches",
"the",
"type",
")",
"or",
"a",
"copy",
"-",
"USE",
"WITH",
"CAUTION",
"AS",
"IT",
"MAY",
"EXPOSE",
"THE",
"INTERNAL",
"STATE",
"OF",
"THE",
"COLLECTION",
"."
] | 24aca0a173a635aaf0b78d213a3fee8d4f91c077 | https://github.com/diirt/util/blob/24aca0a173a635aaf0b78d213a3fee8d4f91c077/src/main/java/org/epics/util/array/CollectionNumbers.java#L322-L328 | train | Returns a short array wrapped or copy of the given CollectionNumber object. | Create a Java method that does the following: "Returns a short array wrapped or copy of the given CollectionNumber object.". | Of course, here is the Java code you requested:
```java
public static short[] shortArrayWrappedOrCopy(CollectionNumber coll) {
short[] array = wrappedShortArray(coll);
if (array != null) {
return array;
}
return shortArrayCopyOf(coll);
}
```
Hope this helps! | |
jenkinsci/jenkins | core/src/main/java/hudson/model/ComputerSet.java | ComputerSet.get_slaveNames | public List<String> get_slaveNames() {
return new AbstractList<String>() {
final List<Node> nodes = Jenkins.getInstance().getNodes();
public String get(int index) {
return nodes.get(index).getNodeName();
}
public int size() {
retu... | java | public List<String> get_slaveNames() {
return new AbstractList<String>() {
final List<Node> nodes = Jenkins.getInstance().getNodes();
public String get(int index) {
return nodes.get(index).getNodeName();
}
public int size() {
retu... | [
"public",
"List",
"<",
"String",
">",
"get_slaveNames",
"(",
")",
"{",
"return",
"new",
"AbstractList",
"<",
"String",
">",
"(",
")",
"{",
"final",
"List",
"<",
"Node",
">",
"nodes",
"=",
"Jenkins",
".",
"getInstance",
"(",
")",
".",
"getNodes",
"(",
... | Gets all the agent names. | [
"Gets",
"all",
"the",
"agent",
"names",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ComputerSet.java#L143-L155 | train | Get the slave names. | Create a Java method that does the following: "Get the slave names.". | Of course, here is the Java code you requested:
```java
public List<String> get_slaveNames() {
return new AbstractList<String>() {
final List<Node> nodes = Jenkins.getInstance().getNodes();
public String get(int index) {
return nodes.get(index).getNodeName();
... | |
kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/core/service/AbstractIoService.java | AbstractIoService.dispose | @Override
public final void dispose() {
if (disposed) {
return;
}
IoFuture disposalFuture;
synchronized (disposalLock) {
disposalFuture = this.disposalFuture;
if (!disposing) {
disposing = true;
try {
... | java | @Override
public final void dispose() {
if (disposed) {
return;
}
IoFuture disposalFuture;
synchronized (disposalLock) {
disposalFuture = this.disposalFuture;
if (!disposing) {
disposing = true;
try {
... | [
"@",
"Override",
"public",
"final",
"void",
"dispose",
"(",
")",
"{",
"if",
"(",
"disposed",
")",
"{",
"return",
";",
"}",
"IoFuture",
"disposalFuture",
";",
"synchronized",
"(",
"disposalLock",
")",
"{",
"disposalFuture",
"=",
"this",
".",
"disposalFuture",... | {@inheritDoc} | [
"{"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/core/service/AbstractIoService.java#L295-L336 | train | Dispose of the application. | Create a Java method that does the following: "Dispose of the application.". | Of course, here is the Java code you requested:
```java
@Override
public final void dispose() {
if (disposed) {
return;
}
IoFuture disposalFuture;
synchronized (disposalLock) {
disposalFuture = this.disposalFuture;
if (!disposing) {
... | |
jenkinsci/jenkins | core/src/main/java/hudson/model/User.java | User.getAll | public static @Nonnull
Collection<User> getAll() {
final IdStrategy strategy = idStrategy();
ArrayList<User> users = new ArrayList<>(AllUsers.values());
users.sort((o1, o2) -> strategy.compare(o1.getId(), o2.getId()));
return users;
} | java | public static @Nonnull
Collection<User> getAll() {
final IdStrategy strategy = idStrategy();
ArrayList<User> users = new ArrayList<>(AllUsers.values());
users.sort((o1, o2) -> strategy.compare(o1.getId(), o2.getId()));
return users;
} | [
"public",
"static",
"@",
"Nonnull",
"Collection",
"<",
"User",
">",
"getAll",
"(",
")",
"{",
"final",
"IdStrategy",
"strategy",
"=",
"idStrategy",
"(",
")",
";",
"ArrayList",
"<",
"User",
">",
"users",
"=",
"new",
"ArrayList",
"<>",
"(",
"AllUsers",
".",... | Gets all the users. | [
"Gets",
"all",
"the",
"users",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/User.java#L621-L627 | train | Get all users. | Create a Java method that does the following: "Get all users.". | Of course, here is the Java code you requested:
```java
public static @Nonnull
Collection<User> getAll() {
final IdStrategy strategy = idStrategy();
ArrayList<User> users = new ArrayList<>(AllUsers.values());
users.sort((o1, o2) -> strategy.compare(o1.getId(), o2.getId()));
return u... | |
aws/aws-sdk-java | aws-java-sdk-devicefarm/src/main/java/com/amazonaws/services/devicefarm/AWSDeviceFarmClient.java | AWSDeviceFarmClient.updateUpload | @Override
public UpdateUploadResult updateUpload(UpdateUploadRequest request) {
request = beforeClientExecution(request);
return executeUpdateUpload(request);
} | java | @Override
public UpdateUploadResult updateUpload(UpdateUploadRequest request) {
request = beforeClientExecution(request);
return executeUpdateUpload(request);
} | [
"@",
"Override",
"public",
"UpdateUploadResult",
"updateUpload",
"(",
"UpdateUploadRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeUpdateUpload",
"(",
"request",
")",
";",
"}"
] | <p>
Update an uploaded test specification (test spec).
</p>
@param updateUploadRequest
@return Result of the UpdateUpload operation returned by the service.
@throws ArgumentException
An invalid argument was specified.
@throws NotFoundException
The specified entity was not found.
@throws LimitExceededException
A limit ... | [
"<p",
">",
"Update",
"an",
"uploaded",
"test",
"specification",
"(",
"test",
"spec",
")",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-devicefarm/src/main/java/com/amazonaws/services/devicefarm/AWSDeviceFarmClient.java#L4153-L4157 | train | Updates an upload. | Create a Java method that does the following: "Updates an upload.". | Of course, here is the Java code you requested:
```java
@Override
public UpdateUploadResult updateUpload(UpdateUploadRequest request) {
request = beforeClientExecution(request);
return executeUpdateUpload(request);
}
```
Hope this helps! | |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/parser/TypeLord.java | TypeLord.findActualDeclaringType | private static IType findActualDeclaringType( IType ownersType, IType declaringType )
{
if( ownersType == null )
{
return null;
}
if( declaringType.isParameterizedType() && !declaringType.isGenericType() )
{
return declaringType;
}
if( ownersType == declaringType )
{
... | java | private static IType findActualDeclaringType( IType ownersType, IType declaringType )
{
if( ownersType == null )
{
return null;
}
if( declaringType.isParameterizedType() && !declaringType.isGenericType() )
{
return declaringType;
}
if( ownersType == declaringType )
{
... | [
"private",
"static",
"IType",
"findActualDeclaringType",
"(",
"IType",
"ownersType",
",",
"IType",
"declaringType",
")",
"{",
"if",
"(",
"ownersType",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"declaringType",
".",
"isParameterizedType",
"... | parameterized type for Base<T>. | [
"parameterized",
"type",
"for",
"Base<T",
">",
"."
] | d6e9261b137ce66fef3726cabe7826d4a1f946b7 | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/parser/TypeLord.java#L801-L839 | train | Find the actual declaring type of the given type. | Create a Java method that does the following: "Find the actual declaring type of the given type.". | Of course, here is the Java code you requested:
```java
private static IType findActualDeclaringType( IType ownersType, IType declaringType )
{
if( ownersType == null )
{
return null;
}
if( declaringType.isParameterizedType() && !declaringType.isGenericType() )
{
return declaringType... | |
aws/aws-sdk-java | aws-java-sdk-workspaces/src/main/java/com/amazonaws/services/workspaces/model/DescribeWorkspaceBundlesResult.java | DescribeWorkspaceBundlesResult.setBundles | public void setBundles(java.util.Collection<WorkspaceBundle> bundles) {
if (bundles == null) {
this.bundles = null;
return;
}
this.bundles = new com.amazonaws.internal.SdkInternalList<WorkspaceBundle>(bundles);
} | java | public void setBundles(java.util.Collection<WorkspaceBundle> bundles) {
if (bundles == null) {
this.bundles = null;
return;
}
this.bundles = new com.amazonaws.internal.SdkInternalList<WorkspaceBundle>(bundles);
} | [
"public",
"void",
"setBundles",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"WorkspaceBundle",
">",
"bundles",
")",
"{",
"if",
"(",
"bundles",
"==",
"null",
")",
"{",
"this",
".",
"bundles",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
"b... | <p>
Information about the bundles.
</p>
@param bundles
Information about the bundles. | [
"<p",
">",
"Information",
"about",
"the",
"bundles",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workspaces/src/main/java/com/amazonaws/services/workspaces/model/DescribeWorkspaceBundlesResult.java#L64-L71 | train | Sets the value bundles property. | Create a Java method that does the following: "Sets the value bundles property.". | Of course, here is the Java code you requested:
```java
public void setBundles(java.util.Collection<WorkspaceBundle> bundles) {
if (bundles == null) {
this.bundles = null;
return;
}
this.bundles = new com.amazonaws.internal.SdkInternalList<WorkspaceBundle>(bundles);
... | |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/server/core/MethodParameters.java | MethodParameters.getParameter | public Optional<MethodParameter> getParameter(String name) {
Assert.hasText(name, "Parameter name must not be null!");
return getParameters().stream() //
.filter(it -> name.equals(it.getParameterName())) //
.findFirst();
} | java | public Optional<MethodParameter> getParameter(String name) {
Assert.hasText(name, "Parameter name must not be null!");
return getParameters().stream() //
.filter(it -> name.equals(it.getParameterName())) //
.findFirst();
} | [
"public",
"Optional",
"<",
"MethodParameter",
">",
"getParameter",
"(",
"String",
"name",
")",
"{",
"Assert",
".",
"hasText",
"(",
"name",
",",
"\"Parameter name must not be null!\"",
")",
";",
"return",
"getParameters",
"(",
")",
".",
"stream",
"(",
")",
"//"... | Returns the {@link MethodParameter} with the given name or {@literal null} if none found.
@param name must not be {@literal null} or empty.
@return | [
"Returns",
"the",
"{",
"@link",
"MethodParameter",
"}",
"with",
"the",
"given",
"name",
"or",
"{",
"@literal",
"null",
"}",
"if",
"none",
"found",
"."
] | 70ebff9309f086cd8d6a97daf67e0dc215c87d9c | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/server/core/MethodParameters.java#L101-L108 | train | Gets the parameter with the given name. | Create a Java method that does the following: "Gets the parameter with the given name.". | Of course, here is the Java code you requested:
```java
public Optional<MethodParameter> getParameter(String name) {
Assert.hasText(name, "Parameter name must not be null!");
return getParameters().stream() //
.filter(it -> name.equals(it.getParameterName())) //
.findFirst();
}
```
Hope this helps! | |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toByteValue | public static byte toByteValue(Object o) throws PageException {
if (o instanceof Byte) return ((Byte) o).byteValue();
if (o instanceof Character) return (byte) (((Character) o).charValue());
else if (o instanceof Boolean) return (byte) ((((Boolean) o).booleanValue()) ? 1 : 0);
else if (o instanceof Number) return (... | java | public static byte toByteValue(Object o) throws PageException {
if (o instanceof Byte) return ((Byte) o).byteValue();
if (o instanceof Character) return (byte) (((Character) o).charValue());
else if (o instanceof Boolean) return (byte) ((((Boolean) o).booleanValue()) ? 1 : 0);
else if (o instanceof Number) return (... | [
"public",
"static",
"byte",
"toByteValue",
"(",
"Object",
"o",
")",
"throws",
"PageException",
"{",
"if",
"(",
"o",
"instanceof",
"Byte",
")",
"return",
"(",
"(",
"Byte",
")",
"o",
")",
".",
"byteValue",
"(",
")",
";",
"if",
"(",
"o",
"instanceof",
"... | cast a Object to a byte value (primitive value type)
@param o Object to cast
@return casted byte value
@throws PageException
@throws CasterException | [
"cast",
"a",
"Object",
"to",
"a",
"byte",
"value",
"(",
"primitive",
"value",
"type",
")"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L1233-L1243 | train | casts a Object to a byte | Create a Java method that does the following: "casts a Object to a byte". | Of course, here is the Java code you requested:
```java
public static byte toByteValue(Object o) throws PageException {
if (o instanceof Byte) return ((Byte) o).byteValue();
if (o instanceof Character) return (byte) (((Character) o).charValue());
else if (o instanceof Boolean) return (byte) ((((Boolean) o).booleanV... | |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.decompressGZIP | public static byte[] decompressGZIP(byte[] buffer) throws IOException {
// Wrap the buffer in a ByteArrayInputStream and extract the decompressed pieces
// into a ByteArrayOutputStream.
ByteArrayInputStream bytesIn = new ByteArrayInputStream(buffer);
GZIPInputStream gzipIn = new GZIP... | java | public static byte[] decompressGZIP(byte[] buffer) throws IOException {
// Wrap the buffer in a ByteArrayInputStream and extract the decompressed pieces
// into a ByteArrayOutputStream.
ByteArrayInputStream bytesIn = new ByteArrayInputStream(buffer);
GZIPInputStream gzipIn = new GZIP... | [
"public",
"static",
"byte",
"[",
"]",
"decompressGZIP",
"(",
"byte",
"[",
"]",
"buffer",
")",
"throws",
"IOException",
"{",
"// Wrap the buffer in a ByteArrayInputStream and extract the decompressed pieces\r",
"// into a ByteArrayOutputStream.\r",
"ByteArrayInputStream",
"bytesIn... | Decompress the given buffer using GZIP, returning the result as a byte[].
@param buffer Buffer contain data to decompress.
@return Decompressed data as a byte[].
@throws IOException If an error occurs reading from the stream, etc. | [
"Decompress",
"the",
"given",
"buffer",
"using",
"GZIP",
"returning",
"the",
"result",
"as",
"a",
"byte",
"[]",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L551-L566 | train | Decompresses the given byte array using GZIP. | Create a Java method that does the following: "Decompresses the given byte array using GZIP.". | Of course, here is the Java code you requested:
```java
public static byte[] decompressGZIP(byte[] buffer) throws IOException {
// Wrap the buffer in a ByteArrayInputStream and extract the decompressed pieces
// into a ByteArrayOutputStream.
ByteArrayInputStream bytesIn = new ByteArrayInputS... | |
micrometer-metrics/micrometer | micrometer-core/src/main/java/io/micrometer/core/instrument/MeterRegistry.java | MeterRegistry.counter | public Counter counter(String name, Iterable<Tag> tags) {
return Counter.builder(name).tags(tags).register(this);
} | java | public Counter counter(String name, Iterable<Tag> tags) {
return Counter.builder(name).tags(tags).register(this);
} | [
"public",
"Counter",
"counter",
"(",
"String",
"name",
",",
"Iterable",
"<",
"Tag",
">",
"tags",
")",
"{",
"return",
"Counter",
".",
"builder",
"(",
"name",
")",
".",
"tags",
"(",
"tags",
")",
".",
"register",
"(",
"this",
")",
";",
"}"
] | Tracks a monotonically increasing value.
@param name The base metric name
@param tags Sequence of dimensions for breaking down the name.
@return A new or existing counter. | [
"Tracks",
"a",
"monotonically",
"increasing",
"value",
"."
] | 127fa3265325cc894f368312ed8890b76a055d88 | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/MeterRegistry.java#L351-L353 | train | Create a new counter with the specified name and tags. | Create a Java method that does the following: "Create a new counter with the specified name and tags.". | Of course, here is the Java code you requested:
```java
public Counter counter(String name, Iterable<Tag> tags) {
return Counter.builder(name).tags(tags).register(this);
}
```
Hope this helps! | |
classgraph/classgraph | src/main/java/io/github/classgraph/TypeVariableSignature.java | TypeVariableSignature.resolve | public TypeParameter resolve() {
// Try resolving the type variable against the containing method
if (containingMethodSignature != null && containingMethodSignature.typeParameters != null
&& !containingMethodSignature.typeParameters.isEmpty()) {
for (final TypeParameter typeP... | java | public TypeParameter resolve() {
// Try resolving the type variable against the containing method
if (containingMethodSignature != null && containingMethodSignature.typeParameters != null
&& !containingMethodSignature.typeParameters.isEmpty()) {
for (final TypeParameter typeP... | [
"public",
"TypeParameter",
"resolve",
"(",
")",
"{",
"// Try resolving the type variable against the containing method",
"if",
"(",
"containingMethodSignature",
"!=",
"null",
"&&",
"containingMethodSignature",
".",
"typeParameters",
"!=",
"null",
"&&",
"!",
"containingMethodS... | Look up a type variable (e.g. "T") in the defining method and/or enclosing class' type parameters, and return
the type parameter with the same name (e.g. "T extends com.xyz.Cls").
@return the type parameter (e.g. "T extends com.xyz.Cls", or simply "T" if the type parameter does not have
any bounds).
@throws IllegalArg... | [
"Look",
"up",
"a",
"type",
"variable",
"(",
"e",
".",
"g",
".",
"T",
")",
"in",
"the",
"defining",
"method",
"and",
"/",
"or",
"enclosing",
"class",
"type",
"parameters",
"and",
"return",
"the",
"type",
"parameter",
"with",
"the",
"same",
"name",
"(",
... | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/TypeVariableSignature.java#L87-L113 | train | Resolves the type variable against the parameters of the defining method or enclosing class. | Create a Java method that does the following: "Resolves the type variable against the parameters of the defining method or enclosing class.". | Of course, here is the Java code you requested:
```java
public TypeParameter resolve() {
// Try resolving the type variable against the containing method
if (containingMethodSignature != null && containingMethodSignature.typeParameters != null
&& !containingMethodSignature.typeParameter... | |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java | JSONHelpers.merge | public static JSONObject merge(JSONObject src, JSONObject dest, String name,
final boolean overwrite) {
Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: src: %s, dest: %s", name, src, dest);
final Iterator<String> keys = src.keys();
while (keys.hasNext()) {
... | java | public static JSONObject merge(JSONObject src, JSONObject dest, String name,
final boolean overwrite) {
Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: src: %s, dest: %s", name, src, dest);
final Iterator<String> keys = src.keys();
while (keys.hasNext()) {
... | [
"public",
"static",
"JSONObject",
"merge",
"(",
"JSONObject",
"src",
",",
"JSONObject",
"dest",
",",
"String",
"name",
",",
"final",
"boolean",
"overwrite",
")",
"{",
"Log",
".",
"d",
"(",
"Log",
".",
"SUBSYSTEM",
".",
"JSON",
",",
"TAG",
",",
"\"merge(%... | Recursively merges values from {@code src} into {@code dest}, optionally
overwriting values of matching keys.
<p>
If {@code overwrite} is {@code true}, any matching keys in {@code dest}
will have their values overwritten by values from {@code src}. If the
values of the matching keys are both {@link JSONObject JSONObjec... | [
"Recursively",
"merges",
"values",
"from",
"{",
"@code",
"src",
"}",
"into",
"{",
"@code",
"dest",
"}",
"optionally",
"overwriting",
"values",
"of",
"matching",
"keys",
".",
"<p",
">",
"If",
"{",
"@code",
"overwrite",
"}",
"is",
"{",
"@code",
"true",
"}"... | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java#L1518-L1540 | train | Merge a JSONObject with another JSONObject. | Create a Java method that does the following: "Merge a JSONObject with another JSONObject.". | Of course, here is the Java code you requested:
```java
public static JSONObject merge(JSONObject src, JSONObject dest, String name,
final boolean overwrite) {
Log.d(Log.SUBSYSTEM.JSON, TAG, "merge(%s), object: src: %s, dest: %s", name, src, dest);
final Iterator<Stri... | |
ujmp/universal-java-matrix-package | ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java | Ginv.swapRows | public static void swapRows(DenseDoubleMatrix2D matrix, long row1, long row2) {
double temp = 0;
long cols = matrix.getColumnCount();
for (long col = 0; col < cols; col++) {
temp = matrix.getDouble(row1, col);
matrix.setDouble(matrix.getDouble(row2, col), row1, col);
matrix.setDouble(temp, row2, col);
... | java | public static void swapRows(DenseDoubleMatrix2D matrix, long row1, long row2) {
double temp = 0;
long cols = matrix.getColumnCount();
for (long col = 0; col < cols; col++) {
temp = matrix.getDouble(row1, col);
matrix.setDouble(matrix.getDouble(row2, col), row1, col);
matrix.setDouble(temp, row2, col);
... | [
"public",
"static",
"void",
"swapRows",
"(",
"DenseDoubleMatrix2D",
"matrix",
",",
"long",
"row1",
",",
"long",
"row2",
")",
"{",
"double",
"temp",
"=",
"0",
";",
"long",
"cols",
"=",
"matrix",
".",
"getColumnCount",
"(",
")",
";",
"for",
"(",
"long",
... | Swap components in the two rows.
@param matrix
the matrix to modify
@param row1
the first row
@param row2
the second row | [
"Swap",
"components",
"in",
"the",
"two",
"rows",
"."
] | b7e1d293adeadaf35d208ffe8884028d6c06b63b | https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java#L226-L234 | train | Swaps the rows of the matrix. | Create a Java method that does the following: "Swaps the rows of the matrix.". | Of course, here is the Java code you requested:
```java
public static void swapRows(DenseDoubleMatrix2D matrix, long row1, long row2) {
double temp = 0;
long cols = matrix.getColumnCount();
for (long col = 0; col < cols; col++) {
temp = matrix.getDouble(row1, col);
matrix.setDouble(matrix.getDouble(row2, c... | |
fabiomaffioletti/jsondoc | jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/builder/SpringQueryParamBuilder.java | SpringQueryParamBuilder.buildQueryParams | public static Set<ApiParamDoc> buildQueryParams(Method method) {
Set<ApiParamDoc> apiParamDocs = new LinkedHashSet<ApiParamDoc>();
Class<?> controller = method.getDeclaringClass();
if (isAnnotated(controller, RequestMapping.class)) {
RequestMapping requestMapping = getAnnotation(controller, RequestMapping.cla... | java | public static Set<ApiParamDoc> buildQueryParams(Method method) {
Set<ApiParamDoc> apiParamDocs = new LinkedHashSet<ApiParamDoc>();
Class<?> controller = method.getDeclaringClass();
if (isAnnotated(controller, RequestMapping.class)) {
RequestMapping requestMapping = getAnnotation(controller, RequestMapping.cla... | [
"public",
"static",
"Set",
"<",
"ApiParamDoc",
">",
"buildQueryParams",
"(",
"Method",
"method",
")",
"{",
"Set",
"<",
"ApiParamDoc",
">",
"apiParamDocs",
"=",
"new",
"LinkedHashSet",
"<",
"ApiParamDoc",
">",
"(",
")",
";",
"Class",
"<",
"?",
">",
"control... | From Spring's documentation: Supported at the type level as well as at
the method level! When used at the type level, all method-level mappings
inherit this parameter restriction
@param method
@return | [
"From",
"Spring",
"s",
"documentation",
":",
"Supported",
"at",
"the",
"type",
"level",
"as",
"well",
"as",
"at",
"the",
"method",
"level!",
"When",
"used",
"at",
"the",
"type",
"level",
"all",
"method",
"-",
"level",
"mappings",
"inherit",
"this",
"parame... | 26bf413c236e7c3b66f534c2451b157783c1f45e | https://github.com/fabiomaffioletti/jsondoc/blob/26bf413c236e7c3b66f534c2451b157783c1f45e/jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/builder/SpringQueryParamBuilder.java#L30-L79 | train | Build the query parameters for the given method. | Create a Java method that does the following: "Build the query parameters for the given method.". | Of course, here is the Java code you requested:
```java
public static Set<ApiParamDoc> buildQueryParams(Method method) {
Set<ApiParamDoc> apiParamDocs = new LinkedHashSet<ApiParamDoc>();
Class<?> controller = method.getDeclaringClass();
if (isAnnotated(controller, RequestMapping.class)) {
RequestMapping requ... | |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryService.java | GeometryService.validate | public static GeometryValidationState validate(Geometry geometry, GeometryIndex index) {
validationContext.clear();
try {
if (Geometry.LINEAR_RING.equals(geometry.getGeometryType())) {
IndexedLinearRing ring = helper.createLinearRing(geometry);
switch(indexService.getType(index)) {
case TYPE_EDGE:
... | java | public static GeometryValidationState validate(Geometry geometry, GeometryIndex index) {
validationContext.clear();
try {
if (Geometry.LINEAR_RING.equals(geometry.getGeometryType())) {
IndexedLinearRing ring = helper.createLinearRing(geometry);
switch(indexService.getType(index)) {
case TYPE_EDGE:
... | [
"public",
"static",
"GeometryValidationState",
"validate",
"(",
"Geometry",
"geometry",
",",
"GeometryIndex",
"index",
")",
"{",
"validationContext",
".",
"clear",
"(",
")",
";",
"try",
"{",
"if",
"(",
"Geometry",
".",
"LINEAR_RING",
".",
"equals",
"(",
"geome... | Validates a geometry, focusing on changes at a specific sub-level of the geometry. The sublevel is indicated by
passing an index. The only checks are on intersection (for coordinates) and containment (for subgeometries), we
don't check on too few coordinates as we want to support incremental creation of polygons.
@par... | [
"Validates",
"a",
"geometry",
"focusing",
"on",
"changes",
"at",
"a",
"specific",
"sub",
"-",
"level",
"of",
"the",
"geometry",
".",
"The",
"sublevel",
"is",
"indicated",
"by",
"passing",
"an",
"index",
".",
"The",
"only",
"checks",
"are",
"on",
"intersect... | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryService.java#L308-L379 | train | Validate the geometry with the given index. | Create a Java method that does the following: "Validate the geometry with the given index.". | Of course, here is the Java code you requested:
```java
public static GeometryValidationState validate(Geometry geometry, GeometryIndex index) {
validationContext.clear();
try {
if (Geometry.LINEAR_RING.equals(geometry.getGeometryType())) {
IndexedLinearRing ring = helper.createLinearRing(geometry);
swi... | |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/javax/net/ssl/SNIServerName.java | SNIServerName.toHexString | private static String toHexString(byte[] bytes) {
if (bytes.length == 0) {
return "(empty)";
}
StringBuilder sb = new StringBuilder(bytes.length * 3 - 1);
boolean isInitial = true;
for (byte b : bytes) {
if (isInitial) {
isInitial = false;... | java | private static String toHexString(byte[] bytes) {
if (bytes.length == 0) {
return "(empty)";
}
StringBuilder sb = new StringBuilder(bytes.length * 3 - 1);
boolean isInitial = true;
for (byte b : bytes) {
if (isInitial) {
isInitial = false;... | [
"private",
"static",
"String",
"toHexString",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"if",
"(",
"bytes",
".",
"length",
"==",
"0",
")",
"{",
"return",
"\"(empty)\"",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"bytes",
".",
"l... | convert byte array to hex string | [
"convert",
"byte",
"array",
"to",
"hex",
"string"
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/javax/net/ssl/SNIServerName.java#L191-L211 | train | Convert byte array to hex string. | Create a Java method that does the following: "Convert byte array to hex string.". | Of course, here is the Java code you requested:
```java
private static String toHexString(byte[] bytes) {
if (bytes.length == 0) {
return "(empty)";
}
StringBuilder sb = new StringBuilder(bytes.length * 3 - 1);
boolean isInitial = true;
for (byte b : bytes) {
... | |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/data/Status.java | Status.setValue | public void setValue(Object aValue)
{
if(aValue == null)
return;
primaryKey =Integer.parseInt(aValue.toString());
} | java | public void setValue(Object aValue)
{
if(aValue == null)
return;
primaryKey =Integer.parseInt(aValue.toString());
} | [
"public",
"void",
"setValue",
"(",
"Object",
"aValue",
")",
"{",
"if",
"(",
"aValue",
"==",
"null",
")",
"return",
";",
"primaryKey",
"=",
"Integer",
".",
"parseInt",
"(",
"aValue",
".",
"toString",
"(",
")",
")",
";",
"}"
] | -------------------------------------------- | [
"--------------------------------------------"
] | 38d5b843c76eae9762bbca20453ed0f0ad8412a9 | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/data/Status.java#L121-L133 | train | Sets the value of the
property. | Create a Java method that does the following: "Sets the value of the
property.". | Of course, here is the Java code you requested:
```java
public void setValue(Object aValue)
{
if(aValue == null)
return;
primaryKey =Integer.parseInt(aValue.toString());
}
```
Hope this helps! | |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/scripts/SybaseCleaningScipts.java | SybaseCleaningScipts.getOldTablesRenamingScripts | protected Collection<String> getOldTablesRenamingScripts() throws DBCleanException
{
Collection<String> scripts = new ArrayList<String>();
scripts.add("sp_rename " + valueTableName + "_OLD, " + valueTableName);
scripts.add("sp_rename " + itemTableName + "_OLD, " + itemTableName);
scripts.ad... | java | protected Collection<String> getOldTablesRenamingScripts() throws DBCleanException
{
Collection<String> scripts = new ArrayList<String>();
scripts.add("sp_rename " + valueTableName + "_OLD, " + valueTableName);
scripts.add("sp_rename " + itemTableName + "_OLD, " + itemTableName);
scripts.ad... | [
"protected",
"Collection",
"<",
"String",
">",
"getOldTablesRenamingScripts",
"(",
")",
"throws",
"DBCleanException",
"{",
"Collection",
"<",
"String",
">",
"scripts",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"scripts",
".",
"add",
"(",
"\... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/scripts/SybaseCleaningScipts.java#L179-L191 | train | Get the old table renaming scripts. | Create a Java method that does the following: "Get the old table renaming scripts.". | Of course, here is the Java code you requested:
```java
protected Collection<String> getOldTablesRenamingScripts() throws DBCleanException
{
Collection<String> scripts = new ArrayList<String>();
scripts.add("sp_rename " + valueTableName + "_OLD, " + valueTableName);
scripts.add("sp_rename " + it... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.junit.extensions/src/org/apache/tools/ant/taskdefs/PumpStreamHandler.java | PumpStreamHandler.createPump | protected Thread createPump(InputStream is, OutputStream os,
boolean closeWhenExhausted) {
return createPump(is, os, closeWhenExhausted, true);
} | java | protected Thread createPump(InputStream is, OutputStream os,
boolean closeWhenExhausted) {
return createPump(is, os, closeWhenExhausted, true);
} | [
"protected",
"Thread",
"createPump",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
",",
"boolean",
"closeWhenExhausted",
")",
"{",
"return",
"createPump",
"(",
"is",
",",
"os",
",",
"closeWhenExhausted",
",",
"true",
")",
";",
"}"
] | Creates a stream pumper to copy the given input stream to the
given output stream.
@param is the input stream to copy from.
@param os the output stream to copy to.
@param closeWhenExhausted if true close the inputstream.
@return a thread object that does the pumping, subclasses
should return an instance of {@link Thre... | [
"Creates",
"a",
"stream",
"pumper",
"to",
"copy",
"the",
"given",
"input",
"stream",
"to",
"the",
"given",
"output",
"stream",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.junit.extensions/src/org/apache/tools/ant/taskdefs/PumpStreamHandler.java#L268-L271 | train | Create a thread that will be used to write the data to the output stream. | Create a Java method that does the following: "Create a thread that will be used to write the data to the output stream.". | Of course, here is the Java code you requested:
```java
protected Thread createPump(InputStream is, OutputStream os,
boolean closeWhenExhausted) {
return createPump(is, os, closeWhenExhausted, true);
}
```
Hope this helps! | |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/JSONHTTPResponseHandler.java | JSONHTTPResponseHandler.findValueImpl | @Override
protected String findValueImpl(JSONObject object,String path)
{
//split path to parts
String[] pathParts=path.split(AbstractMappingHTTPResponseHandler.VALUES_SEPERATOR);
int pathPartsAmount=pathParts.length;
String pathPart=null;
JSONObject currentJSONObject=obj... | java | @Override
protected String findValueImpl(JSONObject object,String path)
{
//split path to parts
String[] pathParts=path.split(AbstractMappingHTTPResponseHandler.VALUES_SEPERATOR);
int pathPartsAmount=pathParts.length;
String pathPart=null;
JSONObject currentJSONObject=obj... | [
"@",
"Override",
"protected",
"String",
"findValueImpl",
"(",
"JSONObject",
"object",
",",
"String",
"path",
")",
"{",
"//split path to parts",
"String",
"[",
"]",
"pathParts",
"=",
"path",
".",
"split",
"(",
"AbstractMappingHTTPResponseHandler",
".",
"VALUES_SEPERA... | This function returns the requested value from the object data.<br>
The path is a set of key names seperated by ';'.
@param object
The object holding all the data
@param path
The path to the value (elements seperated by ;)
@return The value (null if not found) | [
"This",
"function",
"returns",
"the",
"requested",
"value",
"from",
"the",
"object",
"data",
".",
"<br",
">",
"The",
"path",
"is",
"a",
"set",
"of",
"key",
"names",
"seperated",
"by",
";",
"."
] | 42fa51acabe7bf279e27ab3dd1cf76146b27955f | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/JSONHTTPResponseHandler.java#L262-L308 | train | This function returns the value of the n - ary entry in the provided object. | Create a Java method that does the following: "This function returns the value of the n - ary entry in the provided object.". | Of course, here is the Java code you requested:
```java
@Override
protected String findValueImpl(JSONObject object,String path)
{
//split path to parts
String[] pathParts=path.split(AbstractMappingHTTPResponseHandler.VALUES_SEPERATOR);
int pathPartsAmount=pathParts.length;
Strin... | |
OrienteerBAP/orientdb-oda-birt | org.orienteer.birt.orientdb/src/org/orienteer/birt/orientdb/impl/Query.java | Query.setProperty | public void setProperty( String name, String value ) throws OdaException
{
// do nothing; assumes no data set query property
properties.put(name, value);
} | java | public void setProperty( String name, String value ) throws OdaException
{
// do nothing; assumes no data set query property
properties.put(name, value);
} | [
"public",
"void",
"setProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"OdaException",
"{",
"// do nothing; assumes no data set query property",
"properties",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}"
] | /*
@see org.eclipse.datatools.connectivity.oda.IQuery#setProperty(java.lang.String, java.lang.String) | [
"/",
"*"
] | 62820c256fa1d221265e68b8ebb60f291a9a1405 | https://github.com/OrienteerBAP/orientdb-oda-birt/blob/62820c256fa1d221265e68b8ebb60f291a9a1405/org.orienteer.birt.orientdb/src/org/orienteer/birt/orientdb/impl/Query.java#L170-L174 | train | Sets a property on the object. | Create a Java method that does the following: "Sets a property on the object.". | Of course, here is the Java code you requested:
```java
public void setProperty( String name, String value ) throws OdaException
{
// do nothing; assumes no data set query property
properties.put(name, value);
}
```
Hope this helps! | |
citygml4j/citygml4j | src-gen/main/java/net/opengis/gml/ObjectFactory.java | ObjectFactory.createVerticalDatumRef | @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "verticalDatumRef")
public JAXBElement<VerticalDatumRefType> createVerticalDatumRef(VerticalDatumRefType value) {
return new JAXBElement<VerticalDatumRefType>(_VerticalDatumRef_QNAME, VerticalDatumRefType.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "verticalDatumRef")
public JAXBElement<VerticalDatumRefType> createVerticalDatumRef(VerticalDatumRefType value) {
return new JAXBElement<VerticalDatumRefType>(_VerticalDatumRef_QNAME, VerticalDatumRefType.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.opengis.net/gml\"",
",",
"name",
"=",
"\"verticalDatumRef\"",
")",
"public",
"JAXBElement",
"<",
"VerticalDatumRefType",
">",
"createVerticalDatumRef",
"(",
"VerticalDatumRefType",
"value",
")",
"{",
"return",
... | Create an instance of {@link JAXBElement }{@code <}{@link VerticalDatumRefType }{@code >}
@param value
Java instance representing xml element's value.
@return
the new instance of {@link JAXBElement }{@code <}{@link VerticalDatumRefType }{@code >} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"VerticalDatumRefType",
"}",
"{",
"@code",
">",
"}"
] | 9155997d5ecf7e8f19411a02ba047f13375b97b9 | https://github.com/citygml4j/citygml4j/blob/9155997d5ecf7e8f19411a02ba047f13375b97b9/src-gen/main/java/net/opengis/gml/ObjectFactory.java#L7331-L7334 | train | Create an instance of the VerticalDatumRef JAXBElement. | Create a Java method that does the following: "Create an instance of the VerticalDatumRef JAXBElement.". | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "verticalDatumRef")
public JAXBElement<VerticalDatumRefType> createVerticalDatumRef(VerticalDatumRefType value) {
return new JAXBElement<VerticalDatumRefType>(_VerticalDatumRef_QNAME, Ve... | |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/HashPartition.java | HashPartition.spillPartition | public int spillPartition(List<MemorySegment> target, IOManager ioAccess, FileIOChannel.ID targetChannel,
LinkedBlockingQueue<MemorySegment> bufferReturnQueue)
throws IOException
{
// sanity checks
if (!isInMemory()) {
throw new RuntimeException("Bug in Hybrid Hash Join: " +
"Request to spill a partiti... | java | public int spillPartition(List<MemorySegment> target, IOManager ioAccess, FileIOChannel.ID targetChannel,
LinkedBlockingQueue<MemorySegment> bufferReturnQueue)
throws IOException
{
// sanity checks
if (!isInMemory()) {
throw new RuntimeException("Bug in Hybrid Hash Join: " +
"Request to spill a partiti... | [
"public",
"int",
"spillPartition",
"(",
"List",
"<",
"MemorySegment",
">",
"target",
",",
"IOManager",
"ioAccess",
",",
"FileIOChannel",
".",
"ID",
"targetChannel",
",",
"LinkedBlockingQueue",
"<",
"MemorySegment",
">",
"bufferReturnQueue",
")",
"throws",
"IOExcepti... | Spills this partition to disk and sets it up such that it continues spilling records that are added to
it. The spilling process must free at least one buffer, either in the partition's record buffers, or in
the memory segments for overflow buckets.
The partition immediately takes back one buffer to use it for further s... | [
"Spills",
"this",
"partition",
"to",
"disk",
"and",
"sets",
"it",
"up",
"such",
"that",
"it",
"continues",
"spilling",
"records",
"that",
"are",
"added",
"to",
"it",
".",
"The",
"spilling",
"process",
"must",
"free",
"at",
"least",
"one",
"buffer",
"either... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/HashPartition.java#L292-L319 | train | Spill the partition. | Create a Java method that does the following: "Spill the partition.". | Of course, here is the Java code you requested:
```java
public int spillPartition(List<MemorySegment> target, IOManager ioAccess, FileIOChannel.ID targetChannel,
LinkedBlockingQueue<MemorySegment> bufferReturnQueue)
throws IOException
{
// sanity checks
if (!isInMemory()) {
throw new RuntimeException("Bug ... | |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirItemsSketch.java | ReservoirItemsSketch.toByteArray | @SuppressWarnings("null") // bytes will be null only if empty == true
public byte[] toByteArray(final ArrayOfItemsSerDe<? super T> serDe, final Class<?> clazz) {
final int preLongs, outBytes;
final boolean empty = itemsSeen_ == 0;
byte[] bytes = null; // for serialized items from serDe
if (empty) {
... | java | @SuppressWarnings("null") // bytes will be null only if empty == true
public byte[] toByteArray(final ArrayOfItemsSerDe<? super T> serDe, final Class<?> clazz) {
final int preLongs, outBytes;
final boolean empty = itemsSeen_ == 0;
byte[] bytes = null; // for serialized items from serDe
if (empty) {
... | [
"@",
"SuppressWarnings",
"(",
"\"null\"",
")",
"// bytes will be null only if empty == true",
"public",
"byte",
"[",
"]",
"toByteArray",
"(",
"final",
"ArrayOfItemsSerDe",
"<",
"?",
"super",
"T",
">",
"serDe",
",",
"final",
"Class",
"<",
"?",
">",
"clazz",
")",
... | Returns a byte array representation of this sketch. Copies contents into an array of the
specified class for serialization to allow for polymorphic types.
@param serDe An instance of ArrayOfItemsSerDe
@param clazz The class represented by <T>
@return a byte array representation of this sketch | [
"Returns",
"a",
"byte",
"array",
"representation",
"of",
"this",
"sketch",
".",
"Copies",
"contents",
"into",
"an",
"array",
"of",
"the",
"specified",
"class",
"for",
"serialization",
"to",
"allow",
"for",
"polymorphic",
"types",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirItemsSketch.java#L449-L488 | train | Serialize the data into a byte array. | Create a Java method that does the following: "Serialize the data into a byte array.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("null") // bytes will be null only if empty == true
public byte[] toByteArray(final ArrayOfItemsSerDe<? super T> serDe, final Class<?> clazz) {
final int preLongs, outBytes;
final boolean empty = itemsSeen_ == 0;
byte[] bytes = nul... | |
spring-cloud/spring-cloud-config | spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/support/GitCredentialsProviderFactory.java | GitCredentialsProviderFactory.createFor | public CredentialsProvider createFor(String uri, String username, String password,
String passphrase, boolean skipSslValidation) {
CredentialsProvider provider = null;
if (awsAvailable() && AwsCodeCommitCredentialProvider.canHandle(uri)) {
this.logger
.debug("Constructing AwsCodeCommitCredentialProvider ... | java | public CredentialsProvider createFor(String uri, String username, String password,
String passphrase, boolean skipSslValidation) {
CredentialsProvider provider = null;
if (awsAvailable() && AwsCodeCommitCredentialProvider.canHandle(uri)) {
this.logger
.debug("Constructing AwsCodeCommitCredentialProvider ... | [
"public",
"CredentialsProvider",
"createFor",
"(",
"String",
"uri",
",",
"String",
"username",
",",
"String",
"password",
",",
"String",
"passphrase",
",",
"boolean",
"skipSslValidation",
")",
"{",
"CredentialsProvider",
"provider",
"=",
"null",
";",
"if",
"(",
... | Search for a credential provider that will handle the specified URI. If not found,
and the username or passphrase has text, then create a default using the provided
username and password or passphrase.
If skipSslValidation is true and the URI has an https scheme, the default
credential provider's behaviour is modified... | [
"Search",
"for",
"a",
"credential",
"provider",
"that",
"will",
"handle",
"the",
"specified",
"URI",
".",
"If",
"not",
"found",
"and",
"the",
"username",
"or",
"passphrase",
"has",
"text",
"then",
"create",
"a",
"default",
"using",
"the",
"provided",
"userna... | 6b99631f78bac4e1b521d2cc126c8b2da45d1f1f | https://github.com/spring-cloud/spring-cloud-config/blob/6b99631f78bac4e1b521d2cc126c8b2da45d1f1f/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/support/GitCredentialsProviderFactory.java#L82-L117 | train | Creates a new credentials provider for the given URI. | Create a Java method that does the following: "Creates a new credentials provider for the given URI.". | Of course, here is the Java code you requested:
```java
public CredentialsProvider createFor(String uri, String username, String password,
String passphrase, boolean skipSslValidation) {
CredentialsProvider provider = null;
if (awsAvailable() && AwsCodeCommitCredentialProvider.canHandle(uri)) {
this.logger
... | |
albfernandez/itext2 | src/main/java/com/lowagie/text/xml/XmlPeer.java | XmlPeer.getName | public String getName(String name) {
String value;
if ((value = attributeAliases.getProperty(name)) != null) {
return value;
}
return name;
} | java | public String getName(String name) {
String value;
if ((value = attributeAliases.getProperty(name)) != null) {
return value;
}
return name;
} | [
"public",
"String",
"getName",
"(",
"String",
"name",
")",
"{",
"String",
"value",
";",
"if",
"(",
"(",
"value",
"=",
"attributeAliases",
".",
"getProperty",
"(",
"name",
")",
")",
"!=",
"null",
")",
"{",
"return",
"value",
";",
"}",
"return",
"name",
... | Returns the iText attribute name.
@param name the custom attribute name
@return iText translated attribute name | [
"Returns",
"the",
"iText",
"attribute",
"name",
"."
] | 438fc1899367fd13dfdfa8dfdca9a3c1a7783b84 | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/xml/XmlPeer.java#L166-L172 | train | Gets the name of the attribute. | Create a Java method that does the following: "Gets the name of the attribute.". | Of course, here is the Java code you requested:
```java
public String getName(String name) {
String value;
if ((value = attributeAliases.getProperty(name)) != null) {
return value;
}
return name;
}
```
Hope this helps! | |
h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/algos/gbm/GbmMojoModel.java | GbmMojoModel.score0 | @Override
public final double[] score0(double[] row, double offset, double[] preds) {
super.scoreAllTrees(row, preds);
return unifyPreds(row, offset, preds);
} | java | @Override
public final double[] score0(double[] row, double offset, double[] preds) {
super.scoreAllTrees(row, preds);
return unifyPreds(row, offset, preds);
} | [
"@",
"Override",
"public",
"final",
"double",
"[",
"]",
"score0",
"(",
"double",
"[",
"]",
"row",
",",
"double",
"offset",
",",
"double",
"[",
"]",
"preds",
")",
"{",
"super",
".",
"scoreAllTrees",
"(",
"row",
",",
"preds",
")",
";",
"return",
"unify... | Corresponds to `hex.tree.gbm.GbmMojoModel.score0()` | [
"Corresponds",
"to",
"hex",
".",
"tree",
".",
"gbm",
".",
"GbmMojoModel",
".",
"score0",
"()"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/algos/gbm/GbmMojoModel.java#L29-L33 | train | Score all trees in the source tree. | Create a Java method that does the following: "Score all trees in the source tree.". | Of course, here is the Java code you requested:
```java
@Override
public final double[] score0(double[] row, double offset, double[] preds) {
super.scoreAllTrees(row, preds);
return unifyPreds(row, offset, preds);
}
```
Hope this helps! | |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/annotations/parser/antlr/internal/InternalXbaseWithAnnotationsParser.java | InternalXbaseWithAnnotationsParser.ruleXConstructorCall | public final EObject ruleXConstructorCall() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_3=null;
Token otherlv_5=null;
Token otherlv_7=null;
Token lv_explicitConstructorCall_8_0=null;
Token otherlv_11=null;
Tok... | java | public final EObject ruleXConstructorCall() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_3=null;
Token otherlv_5=null;
Token otherlv_7=null;
Token lv_explicitConstructorCall_8_0=null;
Token otherlv_11=null;
Tok... | [
"public",
"final",
"EObject",
"ruleXConstructorCall",
"(",
")",
"throws",
"RecognitionException",
"{",
"EObject",
"current",
"=",
"null",
";",
"Token",
"otherlv_1",
"=",
"null",
";",
"Token",
"otherlv_3",
"=",
"null",
";",
"Token",
"otherlv_5",
"=",
"null",
";... | InternalXbaseWithAnnotations.g:4919:1: ruleXConstructorCall returns [EObject current=null] : ( () otherlv_1= 'new' ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_3= '<' ) ( (lv_typeArguments_4_0= ruleJvmArgumentTypeReference ) ) (otherlv_5= ',' ( (lv_typeArguments_6_0= ruleJvmArgumentTypeReference ) ) )* otherlv_7= '>'... | [
"InternalXbaseWithAnnotations",
".",
"g",
":",
"4919",
":",
"1",
":",
"ruleXConstructorCall",
"returns",
"[",
"EObject",
"current",
"=",
"null",
"]",
":",
"(",
"()",
"otherlv_1",
"=",
"new",
"(",
"(",
"ruleQualifiedName",
")",
")",
"(",
"(",
"(",
"<",
")... | 451359541295323a29f5855e633f770cec02069a | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/annotations/parser/antlr/internal/InternalXbaseWithAnnotationsParser.java#L13468-L13952 | train | Capture the call to a new method. | Create a Java method that does the following: "Capture the call to a new method.". | Of course, here is the Java code you requested:
```java
public final EObject ruleXConstructorCall() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_3=null;
Token otherlv_5=null;
Token otherlv_7=null;
Token lv_explicitConstructor... | |
spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/control/PagedResultsDirContextProcessor.java | PagedResultsDirContextProcessor.createRequestControl | public Control createRequestControl() {
byte[] actualCookie = null;
if (cookie != null) {
actualCookie = cookie.getCookie();
}
return super.createRequestControl(new Class<?>[] { int.class, byte[].class, boolean.class },
new Object[] {pageSize, actualCookie, critical});
} | java | public Control createRequestControl() {
byte[] actualCookie = null;
if (cookie != null) {
actualCookie = cookie.getCookie();
}
return super.createRequestControl(new Class<?>[] { int.class, byte[].class, boolean.class },
new Object[] {pageSize, actualCookie, critical});
} | [
"public",
"Control",
"createRequestControl",
"(",
")",
"{",
"byte",
"[",
"]",
"actualCookie",
"=",
"null",
";",
"if",
"(",
"cookie",
"!=",
"null",
")",
"{",
"actualCookie",
"=",
"cookie",
".",
"getCookie",
"(",
")",
";",
"}",
"return",
"super",
".",
"c... | /*
@see
org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
#createRequestControl() | [
"/",
"*"
] | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/control/PagedResultsDirContextProcessor.java#L121-L128 | train | Override this method to add additional headers to the request. | Create a Java method that does the following: "Override this method to add additional headers to the request.". | Of course, here is the Java code you requested:
```java
public Control createRequestControl() {
byte[] actualCookie = null;
if (cookie != null) {
actualCookie = cookie.getCookie();
}
return super.createRequestControl(new Class<?>[] { int.class, byte[].class, boolean.class },
new Object[] {pageSize... | |
jenkinsci/jenkins | core/src/main/java/hudson/model/ComputerSet.java | ComputerSet.doConfigSubmit | @RequirePOST
public synchronized HttpResponse doConfigSubmit( StaplerRequest req) throws IOException, ServletException, FormException {
BulkChange bc = new BulkChange(MONITORS_OWNER);
try {
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
monitors.rebuild(req,req.ge... | java | @RequirePOST
public synchronized HttpResponse doConfigSubmit( StaplerRequest req) throws IOException, ServletException, FormException {
BulkChange bc = new BulkChange(MONITORS_OWNER);
try {
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
monitors.rebuild(req,req.ge... | [
"@",
"RequirePOST",
"public",
"synchronized",
"HttpResponse",
"doConfigSubmit",
"(",
"StaplerRequest",
"req",
")",
"throws",
"IOException",
",",
"ServletException",
",",
"FormException",
"{",
"BulkChange",
"bc",
"=",
"new",
"BulkChange",
"(",
"MONITORS_OWNER",
")",
... | Accepts submission from the configuration page. | [
"Accepts",
"submission",
"from",
"the",
"configuration",
"page",
"."
] | 44c4d3989232082c254d27ae360aa810669f44b7 | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ComputerSet.java#L345-L369 | train | Rebuild the config file. | Create a Java method that does the following: "Rebuild the config file.". | Of course, here is the Java code you requested:
```java
@RequirePOST
public synchronized HttpResponse doConfigSubmit( StaplerRequest req) throws IOException, ServletException, FormException {
BulkChange bc = new BulkChange(MONITORS_OWNER);
try {
Jenkins.getInstance().checkPermission(Jen... | |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/NarPreparePackageMojo.java | NarPreparePackageMojo.narExecute | @Override
public final void narExecute() throws MojoExecutionException, MojoFailureException {
// let the layout decide which (additional) nars to attach
getLayout().prepareNarInfo(getTargetDirectory(), getMavenProject(), getNarInfo(), this);
getNarInfo().writeToDirectory(this.classesDirectory);
fina... | java | @Override
public final void narExecute() throws MojoExecutionException, MojoFailureException {
// let the layout decide which (additional) nars to attach
getLayout().prepareNarInfo(getTargetDirectory(), getMavenProject(), getNarInfo(), this);
getNarInfo().writeToDirectory(this.classesDirectory);
fina... | [
"@",
"Override",
"public",
"final",
"void",
"narExecute",
"(",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"// let the layout decide which (additional) nars to attach",
"getLayout",
"(",
")",
".",
"prepareNarInfo",
"(",
"getTargetDirectory",
"... | be built, POM ~/= artifacts! | [
"be",
"built",
"POM",
"~",
"/",
"=",
"artifacts!"
] | 3c622e2024296b4203431bbae3bde290a01dac00 | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/NarPreparePackageMojo.java#L40-L58 | train | Execute the nar command. | Create a Java method that does the following: "Execute the nar command.". | Of course, here is the Java code you requested:
```java
@Override
public final void narExecute() throws MojoExecutionException, MojoFailureException {
// let the layout decide which (additional) nars to attach
getLayout().prepareNarInfo(getTargetDirectory(), getMavenProject(), getNarInfo(), this);
getNar... | |
aws/aws-sdk-java | aws-java-sdk-iotanalytics/src/main/java/com/amazonaws/services/iotanalytics/AWSIoTAnalyticsClient.java | AWSIoTAnalyticsClient.cancelPipelineReprocessing | @Override
public CancelPipelineReprocessingResult cancelPipelineReprocessing(CancelPipelineReprocessingRequest request) {
request = beforeClientExecution(request);
return executeCancelPipelineReprocessing(request);
} | java | @Override
public CancelPipelineReprocessingResult cancelPipelineReprocessing(CancelPipelineReprocessingRequest request) {
request = beforeClientExecution(request);
return executeCancelPipelineReprocessing(request);
} | [
"@",
"Override",
"public",
"CancelPipelineReprocessingResult",
"cancelPipelineReprocessing",
"(",
"CancelPipelineReprocessingRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeCancelPipelineReprocessing",
"(",
"... | <p>
Cancels the reprocessing of data through the pipeline.
</p>
@param cancelPipelineReprocessingRequest
@return Result of the CancelPipelineReprocessing operation returned by the service.
@throws ResourceNotFoundException
A resource with the specified name could not be found.
@throws InvalidRequestException
The reque... | [
"<p",
">",
"Cancels",
"the",
"reprocessing",
"of",
"data",
"through",
"the",
"pipeline",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iotanalytics/src/main/java/com/amazonaws/services/iotanalytics/AWSIoTAnalyticsClient.java#L249-L253 | train | Cancels a pipeline reprocessing process. | Create a Java method that does the following: "Cancels a pipeline reprocessing process.". | Of course, here is the Java code you requested:
```java
@Override
public CancelPipelineReprocessingResult cancelPipelineReprocessing(CancelPipelineReprocessingRequest request) {
request = beforeClientExecution(request);
return executeCancelPipelineReprocessing(request);
}
```
Hope this helps! | |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/BaseKdDao.java | BaseKdDao.keyExists | @Override
public boolean keyExists(String spaceId, String key) throws IOException {
/*
* Call get(spaceId, key)!=null or delegate to kdStorage.keyExists(spaceId, key)?
* Since DELETE and PUT operations can be async, delegating to kdStorage.keyExists(spaceId,
* key) would be prefer... | java | @Override
public boolean keyExists(String spaceId, String key) throws IOException {
/*
* Call get(spaceId, key)!=null or delegate to kdStorage.keyExists(spaceId, key)?
* Since DELETE and PUT operations can be async, delegating to kdStorage.keyExists(spaceId,
* key) would be prefer... | [
"@",
"Override",
"public",
"boolean",
"keyExists",
"(",
"String",
"spaceId",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"/*\n * Call get(spaceId, key)!=null or delegate to kdStorage.keyExists(spaceId, key)?\n * Since DELETE and PUT operations can be async,... | {@inheritDoc} | [
"{"
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/nosql/BaseKdDao.java#L84-L92 | train | Override the method to check if a key exists in the underlying store. | Create a Java method that does the following: "Override the method to check if a key exists in the underlying store.". | Of course, here is the Java code you requested:
```java
@Override
public boolean keyExists(String spaceId, String key) throws IOException {
/*
* Call get(spaceId, key)!=null or delegate to kdStorage.keyExists(spaceId, key)?
* Since DELETE and PUT operations can be async, delegating to kdS... | |
eostermueller/headlessInTraceClient | src/main/java/org/headlessintrace/client/connection/DefaultConnectionList.java | DefaultConnectionList.locateConnection | @Override
public IConnection locateConnection(HostPort hostPort) {
if (hostPort==null) {
throw new RuntimeException("Not allowed to search for a null hostPort");
}
if (LOG.isDebugEnabled()) LOG.debug("locateConnection: Looking for [" + hostPort.key() + "]");
if (LOG.isDebugEnabled()) LOG.debug(" in t... | java | @Override
public IConnection locateConnection(HostPort hostPort) {
if (hostPort==null) {
throw new RuntimeException("Not allowed to search for a null hostPort");
}
if (LOG.isDebugEnabled()) LOG.debug("locateConnection: Looking for [" + hostPort.key() + "]");
if (LOG.isDebugEnabled()) LOG.debug(" in t... | [
"@",
"Override",
"public",
"IConnection",
"locateConnection",
"(",
"HostPort",
"hostPort",
")",
"{",
"if",
"(",
"hostPort",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Not allowed to search for a null hostPort\"",
")",
";",
"}",
"if",
"(",
... | TODO: Add code to see if we're already connected to this host.
@param host
@param port
@return | [
"TODO",
":",
"Add",
"code",
"to",
"see",
"if",
"we",
"re",
"already",
"connected",
"to",
"this",
"host",
"."
] | 50b1dccc5ff9e342c7c1d06b5a382e8c0afc7604 | https://github.com/eostermueller/headlessInTraceClient/blob/50b1dccc5ff9e342c7c1d06b5a382e8c0afc7604/src/main/java/org/headlessintrace/client/connection/DefaultConnectionList.java#L45-L63 | train | Locate a connection from the connection map. | Create a Java method that does the following: "Locate a connection from the connection map.". | Of course, here is the Java code you requested:
```java
@Override
public IConnection locateConnection(HostPort hostPort) {
if (hostPort==null) {
throw new RuntimeException("Not allowed to search for a null hostPort");
}
if (LOG.isDebugEnabled()) LOG.debug("locateConnection: Looking for [" + hostPort.ke... | |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java | PackageSummaryBuilder.buildContent | public void buildContent(XMLNode node, Content contentTree) {
Content packageContentTree = packageWriter.getContentHeader();
buildChildren(node, packageContentTree);
contentTree.addContent(packageContentTree);
} | java | public void buildContent(XMLNode node, Content contentTree) {
Content packageContentTree = packageWriter.getContentHeader();
buildChildren(node, packageContentTree);
contentTree.addContent(packageContentTree);
} | [
"public",
"void",
"buildContent",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"{",
"Content",
"packageContentTree",
"=",
"packageWriter",
".",
"getContentHeader",
"(",
")",
";",
"buildChildren",
"(",
"node",
",",
"packageContentTree",
")",
";",
"... | Build the content for the package doc.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the package contents
will be added | [
"Build",
"the",
"content",
"for",
"the",
"package",
"doc",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java#L138-L142 | train | Build the content for the class entry. | Create a Java method that does the following: "Build the content for the class entry.". | Of course, here is the Java code you requested:
```java
public void buildContent(XMLNode node, Content contentTree) {
Content packageContentTree = packageWriter.getContentHeader();
buildChildren(node, packageContentTree);
contentTree.addContent(packageContentTree);
}
```
Hope this helps! | |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java | AbstractCodeGen.writeMethodSignature | protected void writeMethodSignature(Writer out, int indent, MethodForConnection method) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * " + method.getMethodName());
writeEol(out);
for (MethodParam param : method.getParams())
{
writeI... | java | protected void writeMethodSignature(Writer out, int indent, MethodForConnection method) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * " + method.getMethodName());
writeEol(out);
for (MethodParam param : method.getParams())
{
writeI... | [
"protected",
"void",
"writeMethodSignature",
"(",
"Writer",
"out",
",",
"int",
"indent",
",",
"MethodForConnection",
"method",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"... | Write method signature for given @MethodForConnection
@param out the writer
@param indent indent
@param method method metadata
@throws IOException exception | [
"Write",
"method",
"signature",
"for",
"given"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AbstractCodeGen.java#L113-L162 | train | Write method signature | Create a Java method that does the following: "Write method signature". | Of course, here is the Java code you requested:
```java
protected void writeMethodSignature(Writer out, int indent, MethodForConnection method) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * " + method.getMethodName());
writeEol(out);
for (Method... | |
GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/DynamicFileListRecordReader.java | DynamicFileListRecordReader.close | @Override
public void close()
throws IOException {
if (delegateReader != null) {
logger.atWarning().log(
"Got non-null delegateReader during close(); possible premature close() call.");
delegateReader.close();
delegateReader = null;
}
} | java | @Override
public void close()
throws IOException {
if (delegateReader != null) {
logger.atWarning().log(
"Got non-null delegateReader during close(); possible premature close() call.");
delegateReader.close();
delegateReader = null;
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"delegateReader",
"!=",
"null",
")",
"{",
"logger",
".",
"atWarning",
"(",
")",
".",
"log",
"(",
"\"Got non-null delegateReader during close(); possible premature close() ... | Closes the record reader.
@throws IOException on IO Error. | [
"Closes",
"the",
"record",
"reader",
"."
] | 918d91c80a63e36046edb28972a5c65d3326a858 | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/DynamicFileListRecordReader.java#L245-L254 | train | Close the underlying reader. | Create a Java method that does the following: "Close the underlying reader.". | Of course, here is the Java code you requested:
```java
@Override
public void close()
throws IOException {
if (delegateReader != null) {
logger.atWarning().log(
"Got non-null delegateReader during close(); possible premature close() call.");
delegateReader.close();
delegateReade... | |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/UserDetailsFormatter.java | UserDetailsFormatter.loadAndFormatUsername | public static String loadAndFormatUsername(final String username, final int expectedNameLength) {
final UserDetails userDetails = loadUserByUsername(username);
return formatUserName(expectedNameLength, userDetails);
} | java | public static String loadAndFormatUsername(final String username, final int expectedNameLength) {
final UserDetails userDetails = loadUserByUsername(username);
return formatUserName(expectedNameLength, userDetails);
} | [
"public",
"static",
"String",
"loadAndFormatUsername",
"(",
"final",
"String",
"username",
",",
"final",
"int",
"expectedNameLength",
")",
"{",
"final",
"UserDetails",
"userDetails",
"=",
"loadUserByUsername",
"(",
"username",
")",
";",
"return",
"formatUserName",
"... | Load user details by the user name and format the user name. If the
loaded {@link UserDetails} is not an instance of a {@link UserPrincipal},
then just the {@link UserDetails#getUsername()} will return.
If first and last name available, they will combined. Otherwise the
{@link UserPrincipal#getLoginname()} will format... | [
"Load",
"user",
"details",
"by",
"the",
"user",
"name",
"and",
"format",
"the",
"user",
"name",
".",
"If",
"the",
"loaded",
"{",
"@link",
"UserDetails",
"}",
"is",
"not",
"an",
"instance",
"of",
"a",
"{",
"@link",
"UserPrincipal",
"}",
"then",
"just",
... | 9884452ad42f3b4827461606d8a9215c8625a7fe | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/UserDetailsFormatter.java#L113-L116 | train | Load and format username. | Create a Java method that does the following: "Load and format username.". | Of course, here is the Java code you requested:
```java
public static String loadAndFormatUsername(final String username, final int expectedNameLength) {
final UserDetails userDetails = loadUserByUsername(username);
return formatUserName(expectedNameLength, userDetails);
}
```
Hope this helps! | |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java | AbstractCreator.methodCallParametersCode | private CodeBlock methodCallParametersCode( CodeBlock.Builder builder, List<CodeBlock> parameters ) {
if ( parameters.isEmpty() ) {
return builder.add( "()" ).build();
}
builder.add( "(" );
Iterator<CodeBlock> iterator = parameters.iterator();
builder.add( iterator.... | java | private CodeBlock methodCallParametersCode( CodeBlock.Builder builder, List<CodeBlock> parameters ) {
if ( parameters.isEmpty() ) {
return builder.add( "()" ).build();
}
builder.add( "(" );
Iterator<CodeBlock> iterator = parameters.iterator();
builder.add( iterator.... | [
"private",
"CodeBlock",
"methodCallParametersCode",
"(",
"CodeBlock",
".",
"Builder",
"builder",
",",
"List",
"<",
"CodeBlock",
">",
"parameters",
")",
"{",
"if",
"(",
"parameters",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"builder",
".",
"add",
"(",
... | Build the code for the parameters of a method call.
@param builder the code builder
@param parameters the parameters
@return the code | [
"Build",
"the",
"code",
"for",
"the",
"parameters",
"of",
"a",
"method",
"call",
"."
] | 3fdc4350a27a9b64fc437d5fe516bf9191b74824 | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java#L969-L986 | train | Method call parameters code. | Create a Java method that does the following: "Method call parameters code.". | Of course, here is the Java code you requested:
```java
private CodeBlock methodCallParametersCode( CodeBlock.Builder builder, List<CodeBlock> parameters ) {
if ( parameters.isEmpty() ) {
return builder.add( "()" ).build();
}
builder.add( "(" );
Iterator<CodeBlock> iterato... | |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPTaxCategoryUtil.java | CPTaxCategoryUtil.fetchByGroupId_First | public static CPTaxCategory fetchByGroupId_First(long groupId,
OrderByComparator<CPTaxCategory> orderByComparator) {
return getPersistence().fetchByGroupId_First(groupId, orderByComparator);
} | java | public static CPTaxCategory fetchByGroupId_First(long groupId,
OrderByComparator<CPTaxCategory> orderByComparator) {
return getPersistence().fetchByGroupId_First(groupId, orderByComparator);
} | [
"public",
"static",
"CPTaxCategory",
"fetchByGroupId_First",
"(",
"long",
"groupId",
",",
"OrderByComparator",
"<",
"CPTaxCategory",
">",
"orderByComparator",
")",
"{",
"return",
"getPersistence",
"(",
")",
".",
"fetchByGroupId_First",
"(",
"groupId",
",",
"orderByCom... | Returns the first cp tax category in the ordered set where groupId = ?.
@param groupId the group ID
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the first matching cp tax category, or <code>null</code> if a matching cp tax category could not be found | [
"Returns",
"the",
"first",
"cp",
"tax",
"category",
"in",
"the",
"ordered",
"set",
"where",
"groupId",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPTaxCategoryUtil.java#L204-L207 | train | Returns the first CPTaxCategory in the ordered set where groupId = ? ; and orderByComparator = null. | Create a Java method that does the following: "Returns the first CPTaxCategory in the ordered set where groupId = ? ; and orderByComparator = null.". | Of course, here is the Java code you requested:
```java
public static CPTaxCategory fetchByGroupId_First(long groupId,
OrderByComparator<CPTaxCategory> orderByComparator) {
return getPersistence().fetchByGroupId_First(groupId, orderByComparator);
}
```
Hope this helps! | |
opsmatters/newrelic-api | src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java | HttpContext.GET | public <T> Optional<T> GET(String partialUrl, Map<String, Object> headers,
List<String> queryParams, GenericType<T> returnType)
{
URI uri = buildUri(partialUrl);
return executeGetRequest(uri, headers, queryParams, returnType);
} | java | public <T> Optional<T> GET(String partialUrl, Map<String, Object> headers,
List<String> queryParams, GenericType<T> returnType)
{
URI uri = buildUri(partialUrl);
return executeGetRequest(uri, headers, queryParams, returnType);
} | [
"public",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"GET",
"(",
"String",
"partialUrl",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"List",
"<",
"String",
">",
"queryParams",
",",
"GenericType",
"<",
"T",
">",
"returnType",
")",
"{... | Execute a GET call against the partial URL and deserialize the results.
@param <T> The type parameter used for the return object
@param partialUrl The partial URL to build
@param returnType The expected return type
@param headers A set of headers to add to the request
@param queryParams A set of query parameters to add... | [
"Execute",
"a",
"GET",
"call",
"against",
"the",
"partial",
"URL",
"and",
"deserialize",
"the",
"results",
"."
] | 5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e | https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java#L124-L129 | train | Perform an HTTP GET request on the URL returning an Optional of the result. | Create a Java method that does the following: "Perform an HTTP GET request on the URL returning an Optional of the result.". | Of course, here is the Java code you requested:
```java
public <T> Optional<T> GET(String partialUrl, Map<String, Object> headers,
List<String> queryParams, GenericType<T> returnType)
{
URI uri = buildUri(partialUrl);
return executeGetRequest(uri, headers, queryParams, returnType);
}
`... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java | HtmlTableRendererBase.startTable | protected void startTable(FacesContext facesContext, UIComponent uiComponent) throws IOException
{
ResponseWriter writer = facesContext.getResponseWriter();
writer.startElement(HTML.TABLE_ELEM, uiComponent);
Map<String, List<ClientBehavior>> behaviors = null;
if (uiComponent... | java | protected void startTable(FacesContext facesContext, UIComponent uiComponent) throws IOException
{
ResponseWriter writer = facesContext.getResponseWriter();
writer.startElement(HTML.TABLE_ELEM, uiComponent);
Map<String, List<ClientBehavior>> behaviors = null;
if (uiComponent... | [
"protected",
"void",
"startTable",
"(",
"FacesContext",
"facesContext",
",",
"UIComponent",
"uiComponent",
")",
"throws",
"IOException",
"{",
"ResponseWriter",
"writer",
"=",
"facesContext",
".",
"getResponseWriter",
"(",
")",
";",
"writer",
".",
"startElement",
"("... | actually render the start of the table | [
"actually",
"render",
"the",
"start",
"of",
"the",
"table"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java#L133-L195 | train | Start the table. | Create a Java method that does the following: "Start the table.". | Of course, here is the Java code you requested:
```java
protected void startTable(FacesContext facesContext, UIComponent uiComponent) throws IOException
{
ResponseWriter writer = facesContext.getResponseWriter();
writer.startElement(HTML.TABLE_ELEM, uiComponent);
Map<String, List<C... | |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/search/aggregate/Aggregate.java | Aggregate.updateMetric | private void updateMetric(String value, GroupSetEntry groupSetEntry, Set<String>[] groupKeys){
updateMetric(value, groupSetEntry.m_totalGroup, groupKeys, 0);
if (groupSetEntry.m_isComposite){
updateMetric(value, groupSetEntry.m_compositeGroup, groupKeys, groupKeys.length - 1);
}
} | java | private void updateMetric(String value, GroupSetEntry groupSetEntry, Set<String>[] groupKeys){
updateMetric(value, groupSetEntry.m_totalGroup, groupKeys, 0);
if (groupSetEntry.m_isComposite){
updateMetric(value, groupSetEntry.m_compositeGroup, groupKeys, groupKeys.length - 1);
}
} | [
"private",
"void",
"updateMetric",
"(",
"String",
"value",
",",
"GroupSetEntry",
"groupSetEntry",
",",
"Set",
"<",
"String",
">",
"[",
"]",
"groupKeys",
")",
"{",
"updateMetric",
"(",
"value",
",",
"groupSetEntry",
".",
"m_totalGroup",
",",
"groupKeys",
",",
... | add value to the aggregation groups | [
"add",
"value",
"to",
"the",
"aggregation",
"groups"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/search/aggregate/Aggregate.java#L393-L398 | train | Updates the metric with the given value. | Create a Java method that does the following: "Updates the metric with the given value.". | Of course, here is the Java code you requested:
```java
private void updateMetric(String value, GroupSetEntry groupSetEntry, Set<String>[] groupKeys){
updateMetric(value, groupSetEntry.m_totalGroup, groupKeys, 0);
if (groupSetEntry.m_isComposite){
updateMetric(value, groupSetEntry.m_compositeGroup, groupKeys... | |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/stat/NumberGenerator.java | NumberGenerator.randomIntegers | static public int[] randomIntegers(int start, int end, int size){
Preconditions.checkArgument(start < end, "Start must be less than end.");
Random random = new Random();
random.setSeed(System.currentTimeMillis());
int[] result = new int[size];
for (int i = 0; i < size; i ++){
int l = random.nextInt();
... | java | static public int[] randomIntegers(int start, int end, int size){
Preconditions.checkArgument(start < end, "Start must be less than end.");
Random random = new Random();
random.setSeed(System.currentTimeMillis());
int[] result = new int[size];
for (int i = 0; i < size; i ++){
int l = random.nextInt();
... | [
"static",
"public",
"int",
"[",
"]",
"randomIntegers",
"(",
"int",
"start",
",",
"int",
"end",
",",
"int",
"size",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"start",
"<",
"end",
",",
"\"Start must be less than end.\"",
")",
";",
"Random",
"random... | Generate random int values
@param start the minimum value of the generated numbers, inclusive
@param end the maximum value of the generated numbers, inclusive
@param size number of random numbers to return. a.k.a. the size of the returned array.
@return the random values in an array. The values are guaranteed to be ... | [
"Generate",
"random",
"int",
"values"
] | bceed441595c5e5195a7418795f03b69fa7b61e4 | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/stat/NumberGenerator.java#L55-L74 | train | Returns an array of integers from the specified range of integers. | Create a Java method that does the following: "Returns an array of integers from the specified range of integers.". | Of course, here is the Java code you requested:
```java
static public int[] randomIntegers(int start, int end, int size){
Preconditions.checkArgument(start < end, "Start must be less than end.");
Random random = new Random();
random.setSeed(System.currentTimeMillis());
int[] result = new int[size];
for (i... | |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java | Item.withNumber | public Item withNumber(String attrName, Number val) {
checkInvalidAttribute(attrName, val);
attributes.put(attrName, toBigDecimal(val));
return this;
} | java | public Item withNumber(String attrName, Number val) {
checkInvalidAttribute(attrName, val);
attributes.put(attrName, toBigDecimal(val));
return this;
} | [
"public",
"Item",
"withNumber",
"(",
"String",
"attrName",
",",
"Number",
"val",
")",
"{",
"checkInvalidAttribute",
"(",
"attrName",
",",
"val",
")",
";",
"attributes",
".",
"put",
"(",
"attrName",
",",
"toBigDecimal",
"(",
"val",
")",
")",
";",
"return",
... | Sets the value of the specified attribute in the current item to the
given value. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"attribute",
"in",
"the",
"current",
"item",
"to",
"the",
"given",
"value",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java#L277-L281 | train | Add a Number attribute to the item. | Create a Java method that does the following: "Add a Number attribute to the item.". | Of course, here is the Java code you requested:
```java
public Item withNumber(String attrName, Number val) {
checkInvalidAttribute(attrName, val);
attributes.put(attrName, toBigDecimal(val));
return this;
}
```
Hope this helps! | |
hazelcast/hazelcast | hazelcast-client/src/main/java/com/hazelcast/client/proxy/ClientPNCounterProxy.java | ClientPNCounterProxy.toVectorClock | private VectorClock toVectorClock(List<Entry<String, Long>> replicaLogicalTimestamps) {
final VectorClock timestamps = new VectorClock();
for (Entry<String, Long> replicaTimestamp : replicaLogicalTimestamps) {
timestamps.setReplicaTimestamp(replicaTimestamp.getKey(), replicaTimestamp.getValu... | java | private VectorClock toVectorClock(List<Entry<String, Long>> replicaLogicalTimestamps) {
final VectorClock timestamps = new VectorClock();
for (Entry<String, Long> replicaTimestamp : replicaLogicalTimestamps) {
timestamps.setReplicaTimestamp(replicaTimestamp.getKey(), replicaTimestamp.getValu... | [
"private",
"VectorClock",
"toVectorClock",
"(",
"List",
"<",
"Entry",
"<",
"String",
",",
"Long",
">",
">",
"replicaLogicalTimestamps",
")",
"{",
"final",
"VectorClock",
"timestamps",
"=",
"new",
"VectorClock",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"Strin... | Transforms the list of replica logical timestamps to a vector clock instance.
@param replicaLogicalTimestamps the logical timestamps
@return a vector clock instance | [
"Transforms",
"the",
"list",
"of",
"replica",
"logical",
"timestamps",
"to",
"a",
"vector",
"clock",
"instance",
"."
] | 8c4bc10515dbbfb41a33e0302c0caedf3cda1baf | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/proxy/ClientPNCounterProxy.java#L213-L219 | train | Converts a list of replica logical timestamps to a vector clock. | Create a Java method that does the following: "Converts a list of replica logical timestamps to a vector clock.". | Of course, here is the Java code you requested:
```java
private VectorClock toVectorClock(List<Entry<String, Long>> replicaLogicalTimestamps) {
final VectorClock timestamps = new VectorClock();
for (Entry<String, Long> replicaTimestamp : replicaLogicalTimestamps) {
timestamps.setReplicaTime... | |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.getVariables | public List<Variable> getVariables(Object projectIdOrPath, int page, int perPage) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(page, perPage), "projects", getProjectIdOrPath(projectIdOrPath), "variables");
return (response.readEntity(new GenericType<List<Var... | java | public List<Variable> getVariables(Object projectIdOrPath, int page, int perPage) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(page, perPage), "projects", getProjectIdOrPath(projectIdOrPath), "variables");
return (response.readEntity(new GenericType<List<Var... | [
"public",
"List",
"<",
"Variable",
">",
"getVariables",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"page",
",",
"int",
"perPage",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",... | Get a list of variables for the specified project in the specified page range.
<pre><code>GitLab Endpoint: GET /projects/:id/variables</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param page the page to get
@param perPage t... | [
"Get",
"a",
"list",
"of",
"variables",
"for",
"the",
"specified",
"project",
"in",
"the",
"specified",
"page",
"range",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L2424-L2427 | train | Get a list of variables for the specified project. | Create a Java method that does the following: "Get a list of variables for the specified project.". | Of course, here is the Java code you requested:
```java
public List<Variable> getVariables(Object projectIdOrPath, int page, int perPage) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(page, perPage), "projects", getProjectIdOrPath(projectIdOrPath), "variables");
... | |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java | SearchManager.setOnline | public void setOnline(boolean isOnline, boolean allowQuery, boolean dropStaleIndexes) throws IOException
{
handler.setOnline(isOnline, allowQuery, dropStaleIndexes);
} | java | public void setOnline(boolean isOnline, boolean allowQuery, boolean dropStaleIndexes) throws IOException
{
handler.setOnline(isOnline, allowQuery, dropStaleIndexes);
} | [
"public",
"void",
"setOnline",
"(",
"boolean",
"isOnline",
",",
"boolean",
"allowQuery",
",",
"boolean",
"dropStaleIndexes",
")",
"throws",
"IOException",
"{",
"handler",
".",
"setOnline",
"(",
"isOnline",
",",
"allowQuery",
",",
"dropStaleIndexes",
")",
";",
"}... | Switches index into corresponding ONLINE or OFFLINE mode. Offline mode means that new indexing data is
collected but index is guaranteed to be unmodified during offline state. Passing the allowQuery flag, can
allow or deny performing queries on index during offline mode. AllowQuery is not used when setting index
back o... | [
"Switches",
"index",
"into",
"corresponding",
"ONLINE",
"or",
"OFFLINE",
"mode",
".",
"Offline",
"mode",
"means",
"that",
"new",
"indexing",
"data",
"is",
"collected",
"but",
"index",
"is",
"guaranteed",
"to",
"be",
"unmodified",
"during",
"offline",
"state",
... | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java#L1201-L1204 | train | Sets the online flag. | Create a Java method that does the following: "Sets the online flag.". | Of course, here is the Java code you requested:
```java
public void setOnline(boolean isOnline, boolean allowQuery, boolean dropStaleIndexes) throws IOException
{
handler.setOnline(isOnline, allowQuery, dropStaleIndexes);
}
```
Hope this helps! | |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/AbstractReady.java | AbstractReady.getCommand | @Override
public final <C extends Command> C getCommand(final UniqueKey<C> commandKey) {
localFacade().globalFacade().trackEvent(JRebirthEventType.ACCESS_COMMAND, this.getClass(), commandKey.classField());
return localFacade().globalFacade().commandFacade().retrieve(commandKey);
} | java | @Override
public final <C extends Command> C getCommand(final UniqueKey<C> commandKey) {
localFacade().globalFacade().trackEvent(JRebirthEventType.ACCESS_COMMAND, this.getClass(), commandKey.classField());
return localFacade().globalFacade().commandFacade().retrieve(commandKey);
} | [
"@",
"Override",
"public",
"final",
"<",
"C",
"extends",
"Command",
">",
"C",
"getCommand",
"(",
"final",
"UniqueKey",
"<",
"C",
">",
"commandKey",
")",
"{",
"localFacade",
"(",
")",
".",
"globalFacade",
"(",
")",
".",
"trackEvent",
"(",
"JRebirthEventType... | {@inheritDoc} | [
"{"
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/link/AbstractReady.java#L209-L213 | train | Gets the command. | Create a Java method that does the following: "Gets the command.". | Of course, here is the Java code you requested:
```java
@Override
public final <C extends Command> C getCommand(final UniqueKey<C> commandKey) {
localFacade().globalFacade().trackEvent(JRebirthEventType.ACCESS_COMMAND, this.getClass(), commandKey.classField());
return localFacade().globalFacade().c... | |
eclipse/xtext-extras | org.eclipse.xtext.purexbase/src-gen/org/eclipse/xtext/purexbase/parser/antlr/internal/InternalPureXbaseParser.java | InternalPureXbaseParser.ruleXExpression | public final EObject ruleXExpression() throws RecognitionException {
EObject current = null;
EObject this_XAssignment_0 = null;
enterRule();
try {
// InternalPureXbase.g:894:2: (this_XAssignment_0= ruleXAssignment )
// InternalPureXbase.g:895:2: this_XAssign... | java | public final EObject ruleXExpression() throws RecognitionException {
EObject current = null;
EObject this_XAssignment_0 = null;
enterRule();
try {
// InternalPureXbase.g:894:2: (this_XAssignment_0= ruleXAssignment )
// InternalPureXbase.g:895:2: this_XAssign... | [
"public",
"final",
"EObject",
"ruleXExpression",
"(",
")",
"throws",
"RecognitionException",
"{",
"EObject",
"current",
"=",
"null",
";",
"EObject",
"this_XAssignment_0",
"=",
"null",
";",
"enterRule",
"(",
")",
";",
"try",
"{",
"// InternalPureXbase.g:894:2: (this_... | InternalPureXbase.g:888:1: ruleXExpression returns [EObject current=null] : this_XAssignment_0= ruleXAssignment ; | [
"InternalPureXbase",
".",
"g",
":",
"888",
":",
"1",
":",
"ruleXExpression",
"returns",
"[",
"EObject",
"current",
"=",
"null",
"]",
":",
"this_XAssignment_0",
"=",
"ruleXAssignment",
";"
] | 451359541295323a29f5855e633f770cec02069a | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.purexbase/src-gen/org/eclipse/xtext/purexbase/parser/antlr/internal/InternalPureXbaseParser.java#L2520-L2566 | train | Use this method to perform the processing of a ruleXExpression. | Create a Java method that does the following: "Use this method to perform the processing of a ruleXExpression.". | Of course, here is the Java code you requested:
```java
public final EObject ruleXExpression() throws RecognitionException {
EObject current = null;
EObject this_XAssignment_0 = null;
enterRule();
try {
// InternalPureXbase.g:894:2: (this_XAssignment_0= ruleXAssignment... | |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java | ScriptContainer.addScriptFunction | public void addScriptFunction(ScriptPlacement placement, String script)
{
assert (script != null) : "The paramter 'script' must not be null";
IScriptReporter sr = getParentScriptReporter();
if (sr != null) {
sr.addScriptFunction(placement, script);
return;
}
... | java | public void addScriptFunction(ScriptPlacement placement, String script)
{
assert (script != null) : "The paramter 'script' must not be null";
IScriptReporter sr = getParentScriptReporter();
if (sr != null) {
sr.addScriptFunction(placement, script);
return;
}
... | [
"public",
"void",
"addScriptFunction",
"(",
"ScriptPlacement",
"placement",
",",
"String",
"script",
")",
"{",
"assert",
"(",
"script",
"!=",
"null",
")",
":",
"\"The paramter 'script' must not be null\"",
";",
"IScriptReporter",
"sr",
"=",
"getParentScriptReporter",
... | This method will add Script as a function.
@param placement
@param script the text of the function. This value must not be null. | [
"This",
"method",
"will",
"add",
"Script",
"as",
"a",
"function",
"."
] | 4246a0cc40ce3c05f1a02c2da2653ac622703d77 | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/javascript/ScriptContainer.java#L105-L135 | train | Add a script to the list of script blocks. | Create a Java method that does the following: "Add a script to the list of script blocks.". | Of course, here is the Java code you requested:
```java
public void addScriptFunction(ScriptPlacement placement, String script)
{
assert (script != null) : "The paramter 'script' must not be null";
IScriptReporter sr = getParentScriptReporter();
if (sr != null) {
sr.addScriptFun... | |
seedstack/i18n-addon | core/src/main/java/org/seedstack/i18n/internal/domain/model/key/Key.java | Key.addTranslation | public Translation addTranslation(String locale, String value, boolean isApproximate) {
LocaleCodeSpecification.assertCode(locale);
if (isBlank(value)) {
throw new IllegalArgumentException("The translation can't be blank");
}
Translation translation = createOrUpdateTranslatio... | java | public Translation addTranslation(String locale, String value, boolean isApproximate) {
LocaleCodeSpecification.assertCode(locale);
if (isBlank(value)) {
throw new IllegalArgumentException("The translation can't be blank");
}
Translation translation = createOrUpdateTranslatio... | [
"public",
"Translation",
"addTranslation",
"(",
"String",
"locale",
",",
"String",
"value",
",",
"boolean",
"isApproximate",
")",
"{",
"LocaleCodeSpecification",
".",
"assertCode",
"(",
"locale",
")",
";",
"if",
"(",
"isBlank",
"(",
"value",
")",
")",
"{",
"... | Saves or updates the translation for the specified locale.
If the key was outdated, checks if the key is still outdated.
@param locale specified the translation locale
@param value translation value
@param isApproximate true if the translation is not exact.
@return the new translation
@throws java.lang.... | [
"Saves",
"or",
"updates",
"the",
"translation",
"for",
"the",
"specified",
"locale",
".",
"If",
"the",
"key",
"was",
"outdated",
"checks",
"if",
"the",
"key",
"is",
"still",
"outdated",
"."
] | 1e65101d8554623f09bda2497b0151fd10a16615 | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/core/src/main/java/org/seedstack/i18n/internal/domain/model/key/Key.java#L85-L93 | train | Add a translation to the current locale. | Create a Java method that does the following: "Add a translation to the current locale.". | Of course, here is the Java code you requested:
```java
public Translation addTranslation(String locale, String value, boolean isApproximate) {
LocaleCodeSpecification.assertCode(locale);
if (isBlank(value)) {
throw new IllegalArgumentException("The translation can't be blank");
}
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.