repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 218 | func_name stringlengths 5 140 | whole_func_string stringlengths 79 3.99k | language stringclasses 1
value | func_code_string stringlengths 79 3.99k | func_code_tokens listlengths 20 624 | func_documentation_string stringlengths 61 1.96k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 107 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.acceptSessionFromConnectionString | public static IMessageSession acceptSessionFromConnectionString(String amqpConnectionString, String sessionId, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException {
return Utils.completeFuture(acceptSessionFromConnectionStringAsync(amqpConnectionString, sessionId, receiveMode));
} | java | public static IMessageSession acceptSessionFromConnectionString(String amqpConnectionString, String sessionId, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException {
return Utils.completeFuture(acceptSessionFromConnectionStringAsync(amqpConnectionString, sessionId, receiveMode));
} | [
"public",
"static",
"IMessageSession",
"acceptSessionFromConnectionString",
"(",
"String",
"amqpConnectionString",
",",
"String",
"sessionId",
",",
"ReceiveMode",
"receiveMode",
")",
"throws",
"InterruptedException",
",",
"ServiceBusException",
"{",
"return",
"Utils",
".",
... | Accept a {@link IMessageSession} from service bus connection string with specified session id. Session Id can be null, if null, service will return the first available session.
@param amqpConnectionString connection string
@param sessionId session id, if null, service will return the first available session... | [
"Accept",
"a",
"{",
"@link",
"IMessageSession",
"}",
"from",
"service",
"bus",
"connection",
"string",
"with",
"specified",
"session",
"id",
".",
"Session",
"Id",
"can",
"be",
"null",
"if",
"null",
"service",
"will",
"return",
"the",
"first",
"available",
"s... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L499-L501 |
JRebirth/JRebirth | org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java | StackModel.doShowPageEnum | public void doShowPageEnum(final PageEnum pageEnum, final Wave wave) {
LOGGER.info("Show Page Enum: " + pageEnum.toString());
if (getPageEnumClass() != null && getPageEnumClass().equals(pageEnum.getClass())) {
showPage(pageEnum.getModelKey(), wave);
}
} | java | public void doShowPageEnum(final PageEnum pageEnum, final Wave wave) {
LOGGER.info("Show Page Enum: " + pageEnum.toString());
if (getPageEnumClass() != null && getPageEnumClass().equals(pageEnum.getClass())) {
showPage(pageEnum.getModelKey(), wave);
}
} | [
"public",
"void",
"doShowPageEnum",
"(",
"final",
"PageEnum",
"pageEnum",
",",
"final",
"Wave",
"wave",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"Show Page Enum: \"",
"+",
"pageEnum",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"getPageEnumClass",
"(",
... | Show page.
Called when model received a SHOW_PAGE wave type.
@param pageEnum the page enum for the model to show
@param wave the wave | [
"Show",
"page",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/component/src/main/java/org/jrebirth/af/component/ui/stack/StackModel.java#L89-L95 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java | Uris.newUri | public static URI newUri(final String url, final boolean strict) throws URISyntaxException {
/*
* Java's parsing thinks that the host is the scheme if there isn't a scheme. Add the default if there is
* no scheme yet
*/
checkNotNull(Strings.emptyToNull(url), "Cannot create U... | java | public static URI newUri(final String url, final boolean strict) throws URISyntaxException {
/*
* Java's parsing thinks that the host is the scheme if there isn't a scheme. Add the default if there is
* no scheme yet
*/
checkNotNull(Strings.emptyToNull(url), "Cannot create U... | [
"public",
"static",
"URI",
"newUri",
"(",
"final",
"String",
"url",
",",
"final",
"boolean",
"strict",
")",
"throws",
"URISyntaxException",
"{",
"/* \n * Java's parsing thinks that the host is the scheme if there isn't a scheme. Add the default if there is\n * no sch... | Returns a normalized java.net.URI based off the given string url. You should use this function instead
of "new URI(String)" - because this one handles escaping and normalization correctly.
@param url the string to parse
@param strict whether or not to perform strict escaping. (defaults to false)
@return the parsed, n... | [
"Returns",
"a",
"normalized",
"java",
".",
"net",
".",
"URI",
"based",
"off",
"the",
"given",
"string",
"url",
".",
"You",
"should",
"use",
"this",
"function",
"instead",
"of",
"new",
"URI",
"(",
"String",
")",
"-",
"because",
"this",
"one",
"handles",
... | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java#L490-L502 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Chunk.java | Chunk.setTextRenderMode | public Chunk setTextRenderMode(int mode, float strokeWidth,
Color strokeColor) {
return setAttribute(TEXTRENDERMODE, new Object[] { Integer.valueOf(mode),
new Float(strokeWidth), strokeColor });
} | java | public Chunk setTextRenderMode(int mode, float strokeWidth,
Color strokeColor) {
return setAttribute(TEXTRENDERMODE, new Object[] { Integer.valueOf(mode),
new Float(strokeWidth), strokeColor });
} | [
"public",
"Chunk",
"setTextRenderMode",
"(",
"int",
"mode",
",",
"float",
"strokeWidth",
",",
"Color",
"strokeColor",
")",
"{",
"return",
"setAttribute",
"(",
"TEXTRENDERMODE",
",",
"new",
"Object",
"[",
"]",
"{",
"Integer",
".",
"valueOf",
"(",
"mode",
")",... | Sets the text rendering mode. It can outline text, simulate bold and make
text invisible.
@param mode
the text rendering mode. It can be <CODE>
PdfContentByte.TEXT_RENDER_MODE_FILL</CODE>,<CODE>
PdfContentByte.TEXT_RENDER_MODE_STROKE</CODE>,<CODE>
PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE</CODE> and <CODE>
PdfConten... | [
"Sets",
"the",
"text",
"rendering",
"mode",
".",
"It",
"can",
"outline",
"text",
"simulate",
"bold",
"and",
"make",
"text",
"invisible",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Chunk.java#L644-L648 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/annotation/WrongAnnotation.java | WrongAnnotation.giveDetails | public void giveDetails( Expectation expected, Object actual )
{
this.expected = expected;
this.actual = actual;
this.detailed = true;
} | java | public void giveDetails( Expectation expected, Object actual )
{
this.expected = expected;
this.actual = actual;
this.detailed = true;
} | [
"public",
"void",
"giveDetails",
"(",
"Expectation",
"expected",
",",
"Object",
"actual",
")",
"{",
"this",
".",
"expected",
"=",
"expected",
";",
"this",
".",
"actual",
"=",
"actual",
";",
"this",
".",
"detailed",
"=",
"true",
";",
"}"
] | <p>giveDetails.</p>
@param expected a {@link com.greenpepper.expectation.Expectation} object.
@param actual a {@link java.lang.Object} object. | [
"<p",
">",
"giveDetails",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/annotation/WrongAnnotation.java#L43-L48 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/ExceptionUtil.java | ExceptionUtil.fixAsyncStackTrace | public static void fixAsyncStackTrace(Throwable asyncCause, StackTraceElement[] localSideStackTrace) {
Throwable throwable = asyncCause;
if (asyncCause instanceof ExecutionException && throwable.getCause() != null) {
throwable = throwable.getCause();
}
StackTraceElement[] re... | java | public static void fixAsyncStackTrace(Throwable asyncCause, StackTraceElement[] localSideStackTrace) {
Throwable throwable = asyncCause;
if (asyncCause instanceof ExecutionException && throwable.getCause() != null) {
throwable = throwable.getCause();
}
StackTraceElement[] re... | [
"public",
"static",
"void",
"fixAsyncStackTrace",
"(",
"Throwable",
"asyncCause",
",",
"StackTraceElement",
"[",
"]",
"localSideStackTrace",
")",
"{",
"Throwable",
"throwable",
"=",
"asyncCause",
";",
"if",
"(",
"asyncCause",
"instanceof",
"ExecutionException",
"&&",
... | This method changes the given async cause, and it adds the also given local stacktrace.<br/>
If the remoteCause is an {@link java.util.concurrent.ExecutionException} and it has a non-null inner
cause, this inner cause is unwrapped and the local stacktrace and exception message are added to the
that instead of the given... | [
"This",
"method",
"changes",
"the",
"given",
"async",
"cause",
"and",
"it",
"adds",
"the",
"also",
"given",
"local",
"stacktrace",
".",
"<br",
"/",
">",
"If",
"the",
"remoteCause",
"is",
"an",
"{",
"@link",
"java",
".",
"util",
".",
"concurrent",
".",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ExceptionUtil.java#L188-L200 |
MTDdk/jawn | jawn-core-new/src/main/java/net/javapla/jawn/core/internal/FrameworkBootstrap.java | FrameworkBootstrap.readRegisteredPlugins | private ModuleBootstrap[] readRegisteredPlugins(ApplicationConfig config, String pluginsPackage) {
try {
ClassLocator locator = new ClassLocator(pluginsPackage);
return locateAll(locator, ModuleBootstrap.class, impl -> impl.bootstrap(config));
} catch (IllegalArgumentException e... | java | private ModuleBootstrap[] readRegisteredPlugins(ApplicationConfig config, String pluginsPackage) {
try {
ClassLocator locator = new ClassLocator(pluginsPackage);
return locateAll(locator, ModuleBootstrap.class, impl -> impl.bootstrap(config));
} catch (IllegalArgumentException e... | [
"private",
"ModuleBootstrap",
"[",
"]",
"readRegisteredPlugins",
"(",
"ApplicationConfig",
"config",
",",
"String",
"pluginsPackage",
")",
"{",
"try",
"{",
"ClassLocator",
"locator",
"=",
"new",
"ClassLocator",
"(",
"pluginsPackage",
")",
";",
"return",
"locateAll",... | /*private void initRouter(Router router, Injector localInjector) {
router.compileRoutes(localInjector.getInstance(ActionInvoker.class));
RouterImpl router = (RouterImpl)localInjector.getInstance(Router.class);
ActionInvoker invoker = localInjector.getInstance(ActionInvoker.class);
((RouterImpl)router).compileRoutes(inv... | [
"/",
"*",
"private",
"void",
"initRouter",
"(",
"Router",
"router",
"Injector",
"localInjector",
")",
"{",
"router",
".",
"compileRoutes",
"(",
"localInjector",
".",
"getInstance",
"(",
"ActionInvoker",
".",
"class",
"))",
";",
"RouterImpl",
"router",
"=",
"("... | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core-new/src/main/java/net/javapla/jawn/core/internal/FrameworkBootstrap.java#L211-L219 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/ConsumerMonitorRegistrar.java | ConsumerMonitorRegistrar.removeConsumerFromRegisteredMonitors | public void removeConsumerFromRegisteredMonitors(
MonitoredConsumer mc,
ArrayList exactMonitorList,
ArrayList wildcardMonitorList)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"removeConsumerFromRegisteredMonitors",
new Objec... | java | public void removeConsumerFromRegisteredMonitors(
MonitoredConsumer mc,
ArrayList exactMonitorList,
ArrayList wildcardMonitorList)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"removeConsumerFromRegisteredMonitors",
new Objec... | [
"public",
"void",
"removeConsumerFromRegisteredMonitors",
"(",
"MonitoredConsumer",
"mc",
",",
"ArrayList",
"exactMonitorList",
",",
"ArrayList",
"wildcardMonitorList",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEn... | Method removeConsumerFromRegisteredMonitors
Removes a specified MonitoredConsumer from the appropriate places in the maps.
@param mc
@param exactMonitorList
@param wildcardMonitorList | [
"Method",
"removeConsumerFromRegisteredMonitors"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/ConsumerMonitorRegistrar.java#L975-L996 |
find-sec-bugs/find-sec-bugs | findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/injection/BasicInjectionDetector.java | BasicInjectionDetector.loadCustomSinks | protected void loadCustomSinks(String fileName, String bugType) {
InputStream stream = null;
try {
File file = new File(fileName);
if (file.exists()) {
stream = new FileInputStream(file);
loadConfiguredSinks(stream, bugType);
} else {
... | java | protected void loadCustomSinks(String fileName, String bugType) {
InputStream stream = null;
try {
File file = new File(fileName);
if (file.exists()) {
stream = new FileInputStream(file);
loadConfiguredSinks(stream, bugType);
} else {
... | [
"protected",
"void",
"loadCustomSinks",
"(",
"String",
"fileName",
",",
"String",
"bugType",
")",
"{",
"InputStream",
"stream",
"=",
"null",
";",
"try",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"fileName",
")",
";",
"if",
"(",
"file",
".",
"exists",... | Loads taint sinks configuration file from file system. If the file doesn't exist on file system, loads the file from classpath.
@param fileName name of the configuration file
@param bugType type of an injection bug | [
"Loads",
"taint",
"sinks",
"configuration",
"file",
"from",
"file",
"system",
".",
"If",
"the",
"file",
"doesn",
"t",
"exist",
"on",
"file",
"system",
"loads",
"the",
"file",
"from",
"classpath",
"."
] | train | https://github.com/find-sec-bugs/find-sec-bugs/blob/362da013cef4925e6a1506dd3511fe5bdcc5fba3/findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/injection/BasicInjectionDetector.java#L152-L168 |
jbundle/jbundle | main/msg/src/main/java/org/jbundle/main/msg/screen/MessageScreen.java | MessageScreen.createReplyMessage | public BaseMessage createReplyMessage(BaseMessage messageIn)
{
//ProductRequest productRequest = (ProductRequest)messageIn.getMessageDataDesc(null);
BaseMessage replyMessage = (BaseMessage)this.getMessageProcessInfo().createReplyMessage(messageIn);
//BaseProductResponse responseMess... | java | public BaseMessage createReplyMessage(BaseMessage messageIn)
{
//ProductRequest productRequest = (ProductRequest)messageIn.getMessageDataDesc(null);
BaseMessage replyMessage = (BaseMessage)this.getMessageProcessInfo().createReplyMessage(messageIn);
//BaseProductResponse responseMess... | [
"public",
"BaseMessage",
"createReplyMessage",
"(",
"BaseMessage",
"messageIn",
")",
"{",
"//ProductRequest productRequest = (ProductRequest)messageIn.getMessageDataDesc(null);",
"BaseMessage",
"replyMessage",
"=",
"(",
"BaseMessage",
")",
"this",
".",
"getMessageProcessInfo",
"(... | Given this message in, create the reply message.
@param messageIn The incomming message
@return the (empty) reply message. | [
"Given",
"this",
"message",
"in",
"create",
"the",
"reply",
"message",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/msg/src/main/java/org/jbundle/main/msg/screen/MessageScreen.java#L157-L169 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/carouselItem/CarouselItemRenderer.java | CarouselItemRenderer.decode | @Override
public void decode(FacesContext context, UIComponent component) {
// CarouselItem carouselItem = (CarouselItem) component;
new AJAXRenderer().decode(context, component);
} | java | @Override
public void decode(FacesContext context, UIComponent component) {
// CarouselItem carouselItem = (CarouselItem) component;
new AJAXRenderer().decode(context, component);
} | [
"@",
"Override",
"public",
"void",
"decode",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"{",
"// CarouselItem carouselItem = (CarouselItem) component;",
"new",
"AJAXRenderer",
"(",
")",
".",
"decode",
"(",
"context",
",",
"component",
")",
... | This methods receives and processes input made by the user. More specifically, it ckecks whether the
user has interacted with the current b:carouselItem. The default implementation simply stores
the input value in the list of submitted values. If the validation checks are passed,
the values in the <code>submittedValues... | [
"This",
"methods",
"receives",
"and",
"processes",
"input",
"made",
"by",
"the",
"user",
".",
"More",
"specifically",
"it",
"ckecks",
"whether",
"the",
"user",
"has",
"interacted",
"with",
"the",
"current",
"b",
":",
"carouselItem",
".",
"The",
"default",
"i... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/carouselItem/CarouselItemRenderer.java#L45-L50 |
ksoichiro/Android-ObservableScrollView | samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/FlexibleSpaceWithImageWithViewPagerTabActivity.java | FlexibleSpaceWithImageWithViewPagerTabActivity.onScrollChanged | public void onScrollChanged(int scrollY, Scrollable s) {
FlexibleSpaceWithImageBaseFragment fragment =
(FlexibleSpaceWithImageBaseFragment) mPagerAdapter.getItemAt(mPager.getCurrentItem());
if (fragment == null) {
return;
}
View view = fragment.getView();
... | java | public void onScrollChanged(int scrollY, Scrollable s) {
FlexibleSpaceWithImageBaseFragment fragment =
(FlexibleSpaceWithImageBaseFragment) mPagerAdapter.getItemAt(mPager.getCurrentItem());
if (fragment == null) {
return;
}
View view = fragment.getView();
... | [
"public",
"void",
"onScrollChanged",
"(",
"int",
"scrollY",
",",
"Scrollable",
"s",
")",
"{",
"FlexibleSpaceWithImageBaseFragment",
"fragment",
"=",
"(",
"FlexibleSpaceWithImageBaseFragment",
")",
"mPagerAdapter",
".",
"getItemAt",
"(",
"mPager",
".",
"getCurrentItem",
... | Called by children Fragments when their scrollY are changed.
They all call this method even when they are inactive
but this Activity should listen only the active child,
so each Fragments will pass themselves for Activity to check if they are active.
@param scrollY scroll position of Scrollable
@param s caller S... | [
"Called",
"by",
"children",
"Fragments",
"when",
"their",
"scrollY",
"are",
"changed",
".",
"They",
"all",
"call",
"this",
"method",
"even",
"when",
"they",
"are",
"inactive",
"but",
"this",
"Activity",
"should",
"listen",
"only",
"the",
"active",
"child",
"... | train | https://github.com/ksoichiro/Android-ObservableScrollView/blob/47a5fb2db5e93d923a8c6772cde48bbb7d932345/samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/FlexibleSpaceWithImageWithViewPagerTabActivity.java#L104-L126 |
groupon/monsoon | expr/src/main/java/com/groupon/lex/metrics/PathMatcher.java | PathMatcher.valueOf | public static PathMatcher valueOf(String str) throws ParseException {
try {
return valueOf(new StringReader(str));
} catch (IOException ex) {
throw new IllegalStateException("StringReader IO error?", ex);
}
} | java | public static PathMatcher valueOf(String str) throws ParseException {
try {
return valueOf(new StringReader(str));
} catch (IOException ex) {
throw new IllegalStateException("StringReader IO error?", ex);
}
} | [
"public",
"static",
"PathMatcher",
"valueOf",
"(",
"String",
"str",
")",
"throws",
"ParseException",
"{",
"try",
"{",
"return",
"valueOf",
"(",
"new",
"StringReader",
"(",
"str",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"throw",
"... | Read path matcher from string.
@param str A string containing a path expression.
@return A PathMatcher corresponding to the parsed input
from the string.
@throws
com.groupon.lex.metrics.PathMatcher.ParseException
on invalid path expression. | [
"Read",
"path",
"matcher",
"from",
"string",
"."
] | train | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/expr/src/main/java/com/groupon/lex/metrics/PathMatcher.java#L386-L392 |
eclipse/xtext-core | org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/refactoring/ResourceRelocationContext.java | ResourceRelocationContext.addModification | public void addModification(final ResourceRelocationChange change, final IChangeSerializer.IModification<Resource> modification) {
this.changeSerializer.<Resource>addModification(this.loadAndWatchResource(change), modification);
} | java | public void addModification(final ResourceRelocationChange change, final IChangeSerializer.IModification<Resource> modification) {
this.changeSerializer.<Resource>addModification(this.loadAndWatchResource(change), modification);
} | [
"public",
"void",
"addModification",
"(",
"final",
"ResourceRelocationChange",
"change",
",",
"final",
"IChangeSerializer",
".",
"IModification",
"<",
"Resource",
">",
"modification",
")",
"{",
"this",
".",
"changeSerializer",
".",
"<",
"Resource",
">",
"addModifica... | Loads and watches the respective resource, applies the relocation change and
calls the given <code>modification</code> with the renamed/moved/copied resource.
@param change the change to execute
@param modification the side-effect the rename/move/copy operation should have. | [
"Loads",
"and",
"watches",
"the",
"respective",
"resource",
"applies",
"the",
"relocation",
"change",
"and",
"calls",
"the",
"given",
"<code",
">",
"modification<",
"/",
"code",
">",
"with",
"the",
"renamed",
"/",
"moved",
"/",
"copied",
"resource",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/refactoring/ResourceRelocationContext.java#L55-L57 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.putUpload | protected Response putUpload(Response.Status expectedStatus, String name, File fileToUpload, Object... pathArgs) throws GitLabApiException {
try {
return validate(getApiClient().putUpload(name, fileToUpload, pathArgs), expectedStatus);
} catch (Exception e) {
throw handle(e);
... | java | protected Response putUpload(Response.Status expectedStatus, String name, File fileToUpload, Object... pathArgs) throws GitLabApiException {
try {
return validate(getApiClient().putUpload(name, fileToUpload, pathArgs), expectedStatus);
} catch (Exception e) {
throw handle(e);
... | [
"protected",
"Response",
"putUpload",
"(",
"Response",
".",
"Status",
"expectedStatus",
",",
"String",
"name",
",",
"File",
"fileToUpload",
",",
"Object",
"...",
"pathArgs",
")",
"throws",
"GitLabApiException",
"{",
"try",
"{",
"return",
"validate",
"(",
"getApi... | Perform a file upload using the HTTP PUT method with the specified File instance and path objects,
returning a ClientResponse instance with the data returned from the endpoint.
@param expectedStatus the HTTP status that should be returned from the server
@param name the name for the form field that contains the file n... | [
"Perform",
"a",
"file",
"upload",
"using",
"the",
"HTTP",
"PUT",
"method",
"with",
"the",
"specified",
"File",
"instance",
"and",
"path",
"objects",
"returning",
"a",
"ClientResponse",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"... | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L471-L477 |
j256/ormlite-core | src/main/java/com/j256/ormlite/dao/BaseForeignCollection.java | BaseForeignCollection.addAll | @Override
public boolean addAll(Collection<? extends T> collection) {
boolean changed = false;
for (T data : collection) {
try {
if (addElement(data)) {
changed = true;
}
} catch (SQLException e) {
throw new IllegalStateException("Could not create data elements in dao", e);
}
}
return... | java | @Override
public boolean addAll(Collection<? extends T> collection) {
boolean changed = false;
for (T data : collection) {
try {
if (addElement(data)) {
changed = true;
}
} catch (SQLException e) {
throw new IllegalStateException("Could not create data elements in dao", e);
}
}
return... | [
"@",
"Override",
"public",
"boolean",
"addAll",
"(",
"Collection",
"<",
"?",
"extends",
"T",
">",
"collection",
")",
"{",
"boolean",
"changed",
"=",
"false",
";",
"for",
"(",
"T",
"data",
":",
"collection",
")",
"{",
"try",
"{",
"if",
"(",
"addElement"... | Add the collection of elements to this collection. This will also them to the associated database table.
@return Returns true if any of the items did not already exist in the collection otherwise false. | [
"Add",
"the",
"collection",
"of",
"elements",
"to",
"this",
"collection",
".",
"This",
"will",
"also",
"them",
"to",
"the",
"associated",
"database",
"table",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/dao/BaseForeignCollection.java#L62-L75 |
Harium/keel | src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java | HistogramStatistics.Skewness | public static double Skewness(int[] values){
double mean = Mean(values);
double std = StdDev(values, mean);
return Skewness(values, mean, std);
} | java | public static double Skewness(int[] values){
double mean = Mean(values);
double std = StdDev(values, mean);
return Skewness(values, mean, std);
} | [
"public",
"static",
"double",
"Skewness",
"(",
"int",
"[",
"]",
"values",
")",
"{",
"double",
"mean",
"=",
"Mean",
"(",
"values",
")",
";",
"double",
"std",
"=",
"StdDev",
"(",
"values",
",",
"mean",
")",
";",
"return",
"Skewness",
"(",
"values",
","... | Calculate Skewness value.
@param values Values.
@return Returns skewness value of the specified histogram array. | [
"Calculate",
"Skewness",
"value",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java#L220-L224 |
BBN-E/bue-common-open | nlp-core-open/src/main/java/com/bbn/nlp/edl/EDLWriter.java | EDLWriter.writeEDLMentions | public void writeEDLMentions(Iterable<EDLMention> edlMentions, CharSink sink) throws IOException {
final List<String> lines = Lists.newArrayList();
for (final EDLMention edlMention : edlMentions) {
lines.add(toLine(edlMention));
}
sink.writeLines(lines, "\n");
} | java | public void writeEDLMentions(Iterable<EDLMention> edlMentions, CharSink sink) throws IOException {
final List<String> lines = Lists.newArrayList();
for (final EDLMention edlMention : edlMentions) {
lines.add(toLine(edlMention));
}
sink.writeLines(lines, "\n");
} | [
"public",
"void",
"writeEDLMentions",
"(",
"Iterable",
"<",
"EDLMention",
">",
"edlMentions",
",",
"CharSink",
"sink",
")",
"throws",
"IOException",
"{",
"final",
"List",
"<",
"String",
">",
"lines",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
... | Writes out the specified {@link EDLMention}s. If a {@link #defaultKbId} was not specified,
an exception will be thrown if any EDL mentions have an absent KB ID. | [
"Writes",
"out",
"the",
"specified",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/nlp-core-open/src/main/java/com/bbn/nlp/edl/EDLWriter.java#L41-L49 |
gwtbootstrap3/gwtbootstrap3 | gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/base/helper/StyleHelper.java | StyleHelper.setVisibleOn | public static void setVisibleOn(final UIObject uiObject,
final DeviceSize deviceSize) {
// Split the enum up by _ to get the different devices
// Separates the SM_MD into [SM, MD] so we can add the right styles
final String[] deviceString = deviceSize.name().s... | java | public static void setVisibleOn(final UIObject uiObject,
final DeviceSize deviceSize) {
// Split the enum up by _ to get the different devices
// Separates the SM_MD into [SM, MD] so we can add the right styles
final String[] deviceString = deviceSize.name().s... | [
"public",
"static",
"void",
"setVisibleOn",
"(",
"final",
"UIObject",
"uiObject",
",",
"final",
"DeviceSize",
"deviceSize",
")",
"{",
"// Split the enum up by _ to get the different devices",
"// Separates the SM_MD into [SM, MD] so we can add the right styles",
"final",
"String",
... | Sets the ui object to be visible on the device size
@param uiObject object to be visible on the device size
@param deviceSize device size | [
"Sets",
"the",
"ui",
"object",
"to",
"be",
"visible",
"on",
"the",
"device",
"size"
] | train | https://github.com/gwtbootstrap3/gwtbootstrap3/blob/54bdbd0b12ba7a436b278c007df960d1adf2e641/gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/base/helper/StyleHelper.java#L182-L211 |
grpc/grpc-java | core/src/main/java/io/grpc/internal/Http2ClientStreamTransportState.java | Http2ClientStreamTransportState.transportDataReceived | protected void transportDataReceived(ReadableBuffer frame, boolean endOfStream) {
if (transportError != null) {
// We've already detected a transport error and now we're just accumulating more detail
// for it.
transportError = transportError.augmentDescription("DATA-----------------------------\n... | java | protected void transportDataReceived(ReadableBuffer frame, boolean endOfStream) {
if (transportError != null) {
// We've already detected a transport error and now we're just accumulating more detail
// for it.
transportError = transportError.augmentDescription("DATA-----------------------------\n... | [
"protected",
"void",
"transportDataReceived",
"(",
"ReadableBuffer",
"frame",
",",
"boolean",
"endOfStream",
")",
"{",
"if",
"(",
"transportError",
"!=",
"null",
")",
"{",
"// We've already detected a transport error and now we're just accumulating more detail",
"// for it.",
... | Called by subclasses whenever a data frame is received from the transport.
@param frame the received data frame
@param endOfStream {@code true} if there will be no more data received for this stream | [
"Called",
"by",
"subclasses",
"whenever",
"a",
"data",
"frame",
"is",
"received",
"from",
"the",
"transport",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/Http2ClientStreamTransportState.java#L129-L156 |
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.findTermInList | public <P extends ParaObject> List<P> findTermInList(String type, String field, List<String> terms, Pager... pager) {
MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
params.putSingle("field", field);
params.put("terms", terms);
params.putSingle(Config._TYPE, type);
params.putAll(pagerToPar... | java | public <P extends ParaObject> List<P> findTermInList(String type, String field, List<String> terms, Pager... pager) {
MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
params.putSingle("field", field);
params.put("terms", terms);
params.putSingle(Config._TYPE, type);
params.putAll(pagerToPar... | [
"public",
"<",
"P",
"extends",
"ParaObject",
">",
"List",
"<",
"P",
">",
"findTermInList",
"(",
"String",
"type",
",",
"String",
"field",
",",
"List",
"<",
"String",
">",
"terms",
",",
"Pager",
"...",
"pager",
")",
"{",
"MultivaluedMap",
"<",
"String",
... | Searches for objects having a property value that is in list of possible values.
@param <P> type of the object
@param type the type of object to search for. See {@link com.erudika.para.core.ParaObject#getType()}
@param field the property name of an object
@param terms a list of terms (property values)
@param pager a {@... | [
"Searches",
"for",
"objects",
"having",
"a",
"property",
"value",
"that",
"is",
"in",
"list",
"of",
"possible",
"values",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L810-L817 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java | SessionBuilder.withNodeFilter | @NonNull
public SelfT withNodeFilter(@NonNull Predicate<Node> nodeFilter) {
return withNodeFilter(DriverExecutionProfile.DEFAULT_NAME, nodeFilter);
} | java | @NonNull
public SelfT withNodeFilter(@NonNull Predicate<Node> nodeFilter) {
return withNodeFilter(DriverExecutionProfile.DEFAULT_NAME, nodeFilter);
} | [
"@",
"NonNull",
"public",
"SelfT",
"withNodeFilter",
"(",
"@",
"NonNull",
"Predicate",
"<",
"Node",
">",
"nodeFilter",
")",
"{",
"return",
"withNodeFilter",
"(",
"DriverExecutionProfile",
".",
"DEFAULT_NAME",
",",
"nodeFilter",
")",
";",
"}"
] | Alias to {@link #withNodeFilter(String, Predicate)} for the default profile. | [
"Alias",
"to",
"{"
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java#L271-L274 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationResult.java | PutIntegrationResult.withRequestTemplates | public PutIntegrationResult withRequestTemplates(java.util.Map<String, String> requestTemplates) {
setRequestTemplates(requestTemplates);
return this;
} | java | public PutIntegrationResult withRequestTemplates(java.util.Map<String, String> requestTemplates) {
setRequestTemplates(requestTemplates);
return this;
} | [
"public",
"PutIntegrationResult",
"withRequestTemplates",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestTemplates",
")",
"{",
"setRequestTemplates",
"(",
"requestTemplates",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Represents a map of Velocity templates that are applied on the request payload based on the value of the
Content-Type header sent by the client. The content type value is the key in this map, and the template (as a
String) is the value.
</p>
@param requestTemplates
Represents a map of Velocity templates that are a... | [
"<p",
">",
"Represents",
"a",
"map",
"of",
"Velocity",
"templates",
"that",
"are",
"applied",
"on",
"the",
"request",
"payload",
"based",
"on",
"the",
"value",
"of",
"the",
"Content",
"-",
"Type",
"header",
"sent",
"by",
"the",
"client",
".",
"The",
"con... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationResult.java#L1107-L1110 |
uscexp/grappa.extension | src/main/java/com/github/uscexp/grappa/extension/interpreter/ProcessStore.java | ProcessStore.setNewVariable | public boolean setNewVariable(Object key, Object value) {
boolean success = false;
success = setLocalVariable(key, value);
if (!success) {
setGlobalVariable(key, value);
success = true;
}
return success;
} | java | public boolean setNewVariable(Object key, Object value) {
boolean success = false;
success = setLocalVariable(key, value);
if (!success) {
setGlobalVariable(key, value);
success = true;
}
return success;
} | [
"public",
"boolean",
"setNewVariable",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"success",
"=",
"setLocalVariable",
"(",
"key",
",",
"value",
")",
";",
"if",
"(",
"!",
"success",
")",
"{",
"setGloba... | set a new variable, on the highest block hierarchy or global if no
hierarchy exists.
@param key
name of the variable
@param value
value of the variable
@return true if at least one local block hierarchy exists else false | [
"set",
"a",
"new",
"variable",
"on",
"the",
"highest",
"block",
"hierarchy",
"or",
"global",
"if",
"no",
"hierarchy",
"exists",
"."
] | train | https://github.com/uscexp/grappa.extension/blob/a6001eb6eee434a09e2870e7513f883c7fdaea94/src/main/java/com/github/uscexp/grappa/extension/interpreter/ProcessStore.java#L300-L311 |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/ProjectJson.java | ProjectJson.asGeneratorSet | private static IGeneratorSet asGeneratorSet( JsonValue json)
{
try
{
IGeneratorSet generators = null;
if( json != null && json.getValueType() == OBJECT)
{
generators = GeneratorSetJson.asGeneratorSet( (JsonObject) json);
}
return generators;
}
catch( Ex... | java | private static IGeneratorSet asGeneratorSet( JsonValue json)
{
try
{
IGeneratorSet generators = null;
if( json != null && json.getValueType() == OBJECT)
{
generators = GeneratorSetJson.asGeneratorSet( (JsonObject) json);
}
return generators;
}
catch( Ex... | [
"private",
"static",
"IGeneratorSet",
"asGeneratorSet",
"(",
"JsonValue",
"json",
")",
"{",
"try",
"{",
"IGeneratorSet",
"generators",
"=",
"null",
";",
"if",
"(",
"json",
"!=",
"null",
"&&",
"json",
".",
"getValueType",
"(",
")",
"==",
"OBJECT",
")",
"{",... | Returns the generator set represented by the given JSON value. | [
"Returns",
"the",
"generator",
"set",
"represented",
"by",
"the",
"given",
"JSON",
"value",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/ProjectJson.java#L117-L133 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/FgModel.java | FgModel.setRandomStandardNormal | public void setRandomStandardNormal() {
FnIntDoubleToDouble lambda = new FnIntDoubleToDouble() {
@Override
public double call(int idx, double val) {
return Gaussian.nextDouble(0.0, 1.0);
}
};
apply(lambda);
} | java | public void setRandomStandardNormal() {
FnIntDoubleToDouble lambda = new FnIntDoubleToDouble() {
@Override
public double call(int idx, double val) {
return Gaussian.nextDouble(0.0, 1.0);
}
};
apply(lambda);
} | [
"public",
"void",
"setRandomStandardNormal",
"(",
")",
"{",
"FnIntDoubleToDouble",
"lambda",
"=",
"new",
"FnIntDoubleToDouble",
"(",
")",
"{",
"@",
"Override",
"public",
"double",
"call",
"(",
"int",
"idx",
",",
"double",
"val",
")",
"{",
"return",
"Gaussian",... | Fill the model parameters with values randomly drawn from ~ Normal(0, 1). | [
"Fill",
"the",
"model",
"parameters",
"with",
"values",
"randomly",
"drawn",
"from",
"~",
"Normal",
"(",
"0",
"1",
")",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/FgModel.java#L178-L186 |
structr/structr | structr-core/src/main/java/org/structr/core/graph/ModificationQueue.java | ModificationQueue.isPropertyModified | public boolean isPropertyModified(final GraphObject graphObject, final PropertyKey key) {
for (GraphObjectModificationState state : getSortedModifications()) {
for (PropertyKey k : state.getModifiedProperties().keySet()) {
if (k.equals(key) && graphObject.getUuid().equals(state.getGraphObject().getUuid()) )... | java | public boolean isPropertyModified(final GraphObject graphObject, final PropertyKey key) {
for (GraphObjectModificationState state : getSortedModifications()) {
for (PropertyKey k : state.getModifiedProperties().keySet()) {
if (k.equals(key) && graphObject.getUuid().equals(state.getGraphObject().getUuid()) )... | [
"public",
"boolean",
"isPropertyModified",
"(",
"final",
"GraphObject",
"graphObject",
",",
"final",
"PropertyKey",
"key",
")",
"{",
"for",
"(",
"GraphObjectModificationState",
"state",
":",
"getSortedModifications",
"(",
")",
")",
"{",
"for",
"(",
"PropertyKey",
... | Checks if the given key is present for the given graph object in the modifiedProperties of this queue.<br><br>
This method is convenient if only one key has to be checked. If different
actions should be taken for different keys one should rather use {@link #getModifiedProperties}.
Note: This method only works for reg... | [
"Checks",
"if",
"the",
"given",
"key",
"is",
"present",
"for",
"the",
"given",
"graph",
"object",
"in",
"the",
"modifiedProperties",
"of",
"this",
"queue",
".",
"<br",
">",
"<br",
">"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/graph/ModificationQueue.java#L406-L423 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getStorageAccount | public StorageBundle getStorageAccount(String vaultBaseUrl, String storageAccountName) {
return getStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body();
} | java | public StorageBundle getStorageAccount(String vaultBaseUrl, String storageAccountName) {
return getStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body();
} | [
"public",
"StorageBundle",
"getStorageAccount",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
")",
"{",
"return",
"getStorageAccountWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"storageAccountName",
")",
".",
"toBlocking",
"(",
")",
".",
"s... | Gets information about a specified storage account. This operation requires the storage/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@throws IllegalArgumentException thrown if parameters fail the validation
@... | [
"Gets",
"information",
"about",
"a",
"specified",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"get",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L9781-L9783 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClient.java | ManagementClient.getSubscription | public SubscriptionDescription getSubscription(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException {
return Utils.completeFuture(this.asyncClient.getSubscriptionAsync(topicPath, subscriptionName));
} | java | public SubscriptionDescription getSubscription(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException {
return Utils.completeFuture(this.asyncClient.getSubscriptionAsync(topicPath, subscriptionName));
} | [
"public",
"SubscriptionDescription",
"getSubscription",
"(",
"String",
"topicPath",
",",
"String",
"subscriptionName",
")",
"throws",
"ServiceBusException",
",",
"InterruptedException",
"{",
"return",
"Utils",
".",
"completeFuture",
"(",
"this",
".",
"asyncClient",
".",... | Retrieves a subscription for a given topic from the service namespace
@param topicPath - The path of the topic relative to service bus namespace.
@param subscriptionName - The name of the subscription
@return - SubscriptionDescription containing information about the subscription.
@throws IllegalArgumentException - Thr... | [
"Retrieves",
"a",
"subscription",
"for",
"a",
"given",
"topic",
"from",
"the",
"service",
"namespace"
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClient.java#L115-L117 |
crnk-project/crnk-framework | crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/JpaResourceInformationProvider.java | JpaResourceInformationProvider.handleIdOverride | private void handleIdOverride(Class<?> resourceClass, List<ResourceField> fields) {
List<ResourceField> idFields = fields.stream()
.filter(field -> field.getResourceFieldType() == ResourceFieldType.ID)
.collect(Collectors.toList());
if (idFields.size() == 2) {
... | java | private void handleIdOverride(Class<?> resourceClass, List<ResourceField> fields) {
List<ResourceField> idFields = fields.stream()
.filter(field -> field.getResourceFieldType() == ResourceFieldType.ID)
.collect(Collectors.toList());
if (idFields.size() == 2) {
... | [
"private",
"void",
"handleIdOverride",
"(",
"Class",
"<",
"?",
">",
"resourceClass",
",",
"List",
"<",
"ResourceField",
">",
"fields",
")",
"{",
"List",
"<",
"ResourceField",
">",
"idFields",
"=",
"fields",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"f... | make sure that @JsonApiId wins over @Id and @EmbeddedId of JPA. | [
"make",
"sure",
"that"
] | train | https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/JpaResourceInformationProvider.java#L137-L160 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/RevocationVerificationManager.java | RevocationVerificationManager.verifyRevocationStatus | public boolean verifyRevocationStatus(javax.security.cert.X509Certificate[] peerCertificates)
throws CertificateVerificationException {
X509Certificate[] convertedCertificates = convert(peerCertificates);
long start = System.currentTimeMillis();
// If not set by the user, def... | java | public boolean verifyRevocationStatus(javax.security.cert.X509Certificate[] peerCertificates)
throws CertificateVerificationException {
X509Certificate[] convertedCertificates = convert(peerCertificates);
long start = System.currentTimeMillis();
// If not set by the user, def... | [
"public",
"boolean",
"verifyRevocationStatus",
"(",
"javax",
".",
"security",
".",
"cert",
".",
"X509Certificate",
"[",
"]",
"peerCertificates",
")",
"throws",
"CertificateVerificationException",
"{",
"X509Certificate",
"[",
"]",
"convertedCertificates",
"=",
"convert",... | This method first tries to verify the given certificate chain using OCSP since OCSP verification is
faster. If that fails it tries to do the verification using CRL.
@param peerCertificates javax.security.cert.X509Certificate[] array of peer certificate chain from peer/client.
@throws CertificateVerificationException O... | [
"This",
"method",
"first",
"tries",
"to",
"verify",
"the",
"given",
"certificate",
"chain",
"using",
"OCSP",
"since",
"OCSP",
"verification",
"is",
"faster",
".",
"If",
"that",
"fails",
"it",
"tries",
"to",
"do",
"the",
"verification",
"using",
"CRL",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/RevocationVerificationManager.java#L65-L95 |
FudanNLP/fnlp | fnlp-core/src/main/java/org/fnlp/nlp/parser/dep/JointParser.java | JointParser.estimateActions | private Predict<String> estimateActions(JointParsingState state) {
// 当前状态的特征
ArrayList<String> features = state.getFeatures();
Instance inst = new Instance(addFeature(fa, features, ysize));
Predict<Integer> ret = models.classify(inst,ysize);
ret.normalize();
Predict<String> result =new Predict<Stri... | java | private Predict<String> estimateActions(JointParsingState state) {
// 当前状态的特征
ArrayList<String> features = state.getFeatures();
Instance inst = new Instance(addFeature(fa, features, ysize));
Predict<Integer> ret = models.classify(inst,ysize);
ret.normalize();
Predict<String> result =new Predict<Stri... | [
"private",
"Predict",
"<",
"String",
">",
"estimateActions",
"(",
"JointParsingState",
"state",
")",
"{",
"// 当前状态的特征\r",
"ArrayList",
"<",
"String",
">",
"features",
"=",
"state",
".",
"getFeatures",
"(",
")",
";",
"Instance",
"inst",
"=",
"new",
"Instance",
... | 动作预测
根据当前状态得到的特征,和训练好的模型,预测当前状态应采取的策略,用在测试中
@param featureAlphabet
特征名到特征ID的对应表,特征抽取时使用特征名,模型中使用特征ID,
@param model
分类模型
@param features
当前状态的特征
@return 动作及其概率 [[动作1,概率1],[动作2,概率2],[动作3,概率3]] 动作: 1->LEFT; 2->RIGHT;
0->SHIFT | [
"动作预测"
] | train | https://github.com/FudanNLP/fnlp/blob/ce258f3e4a5add2ba0b5e4cbac7cab2190af6659/fnlp-core/src/main/java/org/fnlp/nlp/parser/dep/JointParser.java#L158-L177 |
joinfaces/joinfaces | joinfaces-autoconfigure/src/main/java/org/joinfaces/autoconfigure/javaxfaces/FacesServletAutoConfiguration.java | FacesServletAutoConfiguration.facesServletRegistrationBean | @Bean
public ServletRegistrationBean<FacesServlet> facesServletRegistrationBean(
FacesServletProperties facesServletProperties
) {
ServletRegistrationBean<FacesServlet> facesServletServletRegistrationBean = new ServletRegistrationBean<FacesServlet>(new FacesServlet()) {
@Override
protected ServletRegistrat... | java | @Bean
public ServletRegistrationBean<FacesServlet> facesServletRegistrationBean(
FacesServletProperties facesServletProperties
) {
ServletRegistrationBean<FacesServlet> facesServletServletRegistrationBean = new ServletRegistrationBean<FacesServlet>(new FacesServlet()) {
@Override
protected ServletRegistrat... | [
"@",
"Bean",
"public",
"ServletRegistrationBean",
"<",
"FacesServlet",
">",
"facesServletRegistrationBean",
"(",
"FacesServletProperties",
"facesServletProperties",
")",
"{",
"ServletRegistrationBean",
"<",
"FacesServlet",
">",
"facesServletServletRegistrationBean",
"=",
"new",... | This bean registers the {@link FacesServlet}.
<p>
This {@link ServletRegistrationBean} also sets two
{@link ServletContext#setAttribute(String, Object) servlet-context attributes} to inform Mojarra and MyFaces about
the dynamically added Servlet.
@param facesServletProperties The properties for the {@link FacesServlet... | [
"This",
"bean",
"registers",
"the",
"{",
"@link",
"FacesServlet",
"}",
".",
"<p",
">",
"This",
"{",
"@link",
"ServletRegistrationBean",
"}",
"also",
"sets",
"two",
"{",
"@link",
"ServletContext#setAttribute",
"(",
"String",
"Object",
")",
"servlet",
"-",
"cont... | train | https://github.com/joinfaces/joinfaces/blob/c9fc811a9eaf695820951f2c04715297dd1e6d66/joinfaces-autoconfigure/src/main/java/org/joinfaces/autoconfigure/javaxfaces/FacesServletAutoConfiguration.java#L49-L73 |
alkacon/opencms-core | src/org/opencms/ui/apps/git/CmsGitCheckin.java | CmsGitCheckin.readConfigFiles | private List<CmsGitConfiguration> readConfigFiles() {
List<CmsGitConfiguration> configurations = new LinkedList<CmsGitConfiguration>();
// Default configuration file for backwards compatibility
addConfigurationIfValid(configurations, new File(DEFAULT_CONFIG_FILE));
// All files in the... | java | private List<CmsGitConfiguration> readConfigFiles() {
List<CmsGitConfiguration> configurations = new LinkedList<CmsGitConfiguration>();
// Default configuration file for backwards compatibility
addConfigurationIfValid(configurations, new File(DEFAULT_CONFIG_FILE));
// All files in the... | [
"private",
"List",
"<",
"CmsGitConfiguration",
">",
"readConfigFiles",
"(",
")",
"{",
"List",
"<",
"CmsGitConfiguration",
">",
"configurations",
"=",
"new",
"LinkedList",
"<",
"CmsGitConfiguration",
">",
"(",
")",
";",
"// Default configuration file for backwards compat... | Read all configuration files.
@return the list with all available configurations | [
"Read",
"all",
"configuration",
"files",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitCheckin.java#L861-L876 |
tbrooks8/Precipice | precipice-core/src/main/java/net/uncontended/precipice/GuardRail.java | GuardRail.releasePermits | public void releasePermits(long number, Result result, long startNanos) {
releasePermits(number, result, startNanos, clock.nanoTime());
} | java | public void releasePermits(long number, Result result, long startNanos) {
releasePermits(number, result, startNanos, clock.nanoTime());
} | [
"public",
"void",
"releasePermits",
"(",
"long",
"number",
",",
"Result",
"result",
",",
"long",
"startNanos",
")",
"{",
"releasePermits",
"(",
"number",
",",
"result",
",",
"startNanos",
",",
"clock",
".",
"nanoTime",
"(",
")",
")",
";",
"}"
] | Release acquired permits with known result. Since there is a known result the result
count object and latency will be updated.
@param number of permits to release
@param result of the execution
@param startNanos of the execution | [
"Release",
"acquired",
"permits",
"with",
"known",
"result",
".",
"Since",
"there",
"is",
"a",
"known",
"result",
"the",
"result",
"count",
"object",
"and",
"latency",
"will",
"be",
"updated",
"."
] | train | https://github.com/tbrooks8/Precipice/blob/97fae467fd676b16a96b8d88b02569d8fc1f2681/precipice-core/src/main/java/net/uncontended/precipice/GuardRail.java#L139-L141 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.getLastElement | public static String getLastElement(final String pSource, final String pDelimiter) {
if (pDelimiter == null) {
throw new IllegalArgumentException("delimiter == null");
}
if (StringUtil.isEmpty(pSource)) {
return pSource;
}
int idx = pSource.lastIn... | java | public static String getLastElement(final String pSource, final String pDelimiter) {
if (pDelimiter == null) {
throw new IllegalArgumentException("delimiter == null");
}
if (StringUtil.isEmpty(pSource)) {
return pSource;
}
int idx = pSource.lastIn... | [
"public",
"static",
"String",
"getLastElement",
"(",
"final",
"String",
"pSource",
",",
"final",
"String",
"pDelimiter",
")",
"{",
"if",
"(",
"pDelimiter",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"delimiter == null\"",
")",
";"... | Gets the last element of a {@code String} containing string elements
delimited by a given delimiter.
<i>NB - Straightforward implementation!</i>
<p/>
@param pSource The source string.
@param pDelimiter The delimiter used in the source string.
@return The last string element. | [
"Gets",
"the",
"last",
"element",
"of",
"a",
"{",
"@code",
"String",
"}",
"containing",
"string",
"elements",
"delimited",
"by",
"a",
"given",
"delimiter",
".",
"<i",
">",
"NB",
"-",
"Straightforward",
"implementation!<",
"/",
"i",
">",
"<p",
"/",
">"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L1556-L1569 |
danhawkes/thresher | src/main/java/co/arcs/groove/thresher/Client.java | Client.login | public User login(final String username,
final String password) throws IOException, GroovesharkException {
JsonNode node = sendRequest(new RequestBuilder("authenticateUser", true) {
@Override
void populateParameters(Session session, ObjectNode parameters) {
p... | java | public User login(final String username,
final String password) throws IOException, GroovesharkException {
JsonNode node = sendRequest(new RequestBuilder("authenticateUser", true) {
@Override
void populateParameters(Session session, ObjectNode parameters) {
p... | [
"public",
"User",
"login",
"(",
"final",
"String",
"username",
",",
"final",
"String",
"password",
")",
"throws",
"IOException",
",",
"GroovesharkException",
"{",
"JsonNode",
"node",
"=",
"sendRequest",
"(",
"new",
"RequestBuilder",
"(",
"\"authenticateUser\"",
",... | Logs in as the given user, allowing access to various
authentication-requiring methods in the {@link User} class.
@param username
@param password
@return The logged in user. Also available via {@link #getUser()};
@throws IOException
@throws GroovesharkException | [
"Logs",
"in",
"as",
"the",
"given",
"user",
"allowing",
"access",
"to",
"various",
"authentication",
"-",
"requiring",
"methods",
"in",
"the",
"{",
"@link",
"User",
"}",
"class",
"."
] | train | https://github.com/danhawkes/thresher/blob/30e5ca62ceca3be20e47a043eedc152f8914d6b4/src/main/java/co/arcs/groove/thresher/Client.java#L337-L352 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.faulttolerance.cdi/src/com/ibm/ws/microprofile/faulttolerance/cdi/config/MethodFinder.java | MethodFinder.typesEquivalent | private static boolean typesEquivalent(ParameterizedType typeToMatch, ParameterizedType type, ResolutionContext ctx) {
if (!typeToMatch.getRawType().equals(type.getRawType())) {
return false;
}
Type[] typesA = typeToMatch.getActualTypeArguments();
Type[] typesB = type.getAct... | java | private static boolean typesEquivalent(ParameterizedType typeToMatch, ParameterizedType type, ResolutionContext ctx) {
if (!typeToMatch.getRawType().equals(type.getRawType())) {
return false;
}
Type[] typesA = typeToMatch.getActualTypeArguments();
Type[] typesB = type.getAct... | [
"private",
"static",
"boolean",
"typesEquivalent",
"(",
"ParameterizedType",
"typeToMatch",
",",
"ParameterizedType",
"type",
",",
"ResolutionContext",
"ctx",
")",
"{",
"if",
"(",
"!",
"typeToMatch",
".",
"getRawType",
"(",
")",
".",
"equals",
"(",
"type",
".",
... | Computes whether two ParameterizedTypes are equivalent.
<p>
This method will check the raw types and then recursively compare each of the type arguments using {@link #typesEquivalent(Type, Type, ResolutionContext)}
@param typeToMatch the type to match against
@param type the type to check, type variable resolution wil... | [
"Computes",
"whether",
"two",
"ParameterizedTypes",
"are",
"equivalent",
".",
"<p",
">",
"This",
"method",
"will",
"check",
"the",
"raw",
"types",
"and",
"then",
"recursively",
"compare",
"each",
"of",
"the",
"type",
"arguments",
"using",
"{",
"@link",
"#types... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.faulttolerance.cdi/src/com/ibm/ws/microprofile/faulttolerance/cdi/config/MethodFinder.java#L203-L222 |
OpenLiberty/open-liberty | dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java | RequestMessage.mergeQueryParams | private void mergeQueryParams(Map<String, String[]> urlParams) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "mergeQueryParams: " + urlParams);
}
for (Entry<String, String[]> entry : urlParams.entrySet()) {
String key = entry.getKey();
... | java | private void mergeQueryParams(Map<String, String[]> urlParams) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "mergeQueryParams: " + urlParams);
}
for (Entry<String, String[]> entry : urlParams.entrySet()) {
String key = entry.getKey();
... | [
"private",
"void",
"mergeQueryParams",
"(",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"urlParams",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
... | In certain cases, the URL will contain query string information and the
POST body will as well. This method merges the two maps together.
@param urlParams | [
"In",
"certain",
"cases",
"the",
"URL",
"will",
"contain",
"query",
"string",
"information",
"and",
"the",
"POST",
"body",
"will",
"as",
"well",
".",
"This",
"method",
"merges",
"the",
"two",
"maps",
"together",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java#L819-L843 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java | ProxyHandler.customizeConnection | protected void customizeConnection(String pathInContext, String pathParams, HttpRequest request, Socket socket) throws IOException
{
} | java | protected void customizeConnection(String pathInContext, String pathParams, HttpRequest request, Socket socket) throws IOException
{
} | [
"protected",
"void",
"customizeConnection",
"(",
"String",
"pathInContext",
",",
"String",
"pathParams",
",",
"HttpRequest",
"request",
",",
"Socket",
"socket",
")",
"throws",
"IOException",
"{",
"}"
] | Customize proxy Socket connection for CONNECT. Method to allow derived handlers to customize
the tunnel sockets. | [
"Customize",
"proxy",
"Socket",
"connection",
"for",
"CONNECT",
".",
"Method",
"to",
"allow",
"derived",
"handlers",
"to",
"customize",
"the",
"tunnel",
"sockets",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L531-L533 |
HiddenStage/divide | Shared/src/main/java/io/divide/shared/transitory/TransientObject.java | TransientObject.put | public void put(String key, Object object) {
// canWrite() TODO disabled for now;
updateModifiedDate();
user_data.put(key,object);
// if(isCollection(object)){
// Object[] array = ((Collection) object).toArray(new Object[0]);
// user_data.put(key, array);
// ... | java | public void put(String key, Object object) {
// canWrite() TODO disabled for now;
updateModifiedDate();
user_data.put(key,object);
// if(isCollection(object)){
// Object[] array = ((Collection) object).toArray(new Object[0]);
// user_data.put(key, array);
// ... | [
"public",
"void",
"put",
"(",
"String",
"key",
",",
"Object",
"object",
")",
"{",
"// canWrite() TODO disabled for now;",
"updateModifiedDate",
"(",
")",
";",
"user_data",
".",
"put",
"(",
"key",
",",
"object",
")",
";",
"// if(isCollection(object)){",... | Add a specific key value pair to this object.
@param key key to identify this element by.
@param object object to be added. | [
"Add",
"a",
"specific",
"key",
"value",
"pair",
"to",
"this",
"object",
"."
] | train | https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Shared/src/main/java/io/divide/shared/transitory/TransientObject.java#L179-L195 |
cdapio/tigon | tigon-flow/src/main/java/co/cask/tigon/internal/app/runtime/flow/FlowletProgramRunner.java | FlowletProgramRunner.getConsumerConfig | private ConsumerConfig getConsumerConfig(BasicFlowletContext flowletContext, Method method) {
// Determine input queue partition type
HashPartition hashPartition = method.getAnnotation(HashPartition.class);
RoundRobin roundRobin = method.getAnnotation(RoundRobin.class);
DequeueStrategy strategy = Dequeu... | java | private ConsumerConfig getConsumerConfig(BasicFlowletContext flowletContext, Method method) {
// Determine input queue partition type
HashPartition hashPartition = method.getAnnotation(HashPartition.class);
RoundRobin roundRobin = method.getAnnotation(RoundRobin.class);
DequeueStrategy strategy = Dequeu... | [
"private",
"ConsumerConfig",
"getConsumerConfig",
"(",
"BasicFlowletContext",
"flowletContext",
",",
"Method",
"method",
")",
"{",
"// Determine input queue partition type",
"HashPartition",
"hashPartition",
"=",
"method",
".",
"getAnnotation",
"(",
"HashPartition",
".",
"c... | Creates a {@link ConsumerConfig} based on the method annotation and the flowlet context.
@param flowletContext Runtime context of the flowlet.
@param method The process method to inspect.
@return A new instance of {@link ConsumerConfig}. | [
"Creates",
"a",
"{"
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-flow/src/main/java/co/cask/tigon/internal/app/runtime/flow/FlowletProgramRunner.java#L351-L371 |
JadiraOrg/jadira | cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java | UnsafeOperations.deepCopyArrayAtOffset | public final void deepCopyArrayAtOffset(Object source, Object copy, Class<?> fieldClass, long offset, IdentityHashMap<Object, Object> referencesToReuse) {
Object origFieldValue = THE_UNSAFE.getObject(source, offset);
if (origFieldValue == null) {
putNullObject(copy, offset);
} else {
final Object copyFi... | java | public final void deepCopyArrayAtOffset(Object source, Object copy, Class<?> fieldClass, long offset, IdentityHashMap<Object, Object> referencesToReuse) {
Object origFieldValue = THE_UNSAFE.getObject(source, offset);
if (origFieldValue == null) {
putNullObject(copy, offset);
} else {
final Object copyFi... | [
"public",
"final",
"void",
"deepCopyArrayAtOffset",
"(",
"Object",
"source",
",",
"Object",
"copy",
",",
"Class",
"<",
"?",
">",
"fieldClass",
",",
"long",
"offset",
",",
"IdentityHashMap",
"<",
"Object",
",",
"Object",
">",
"referencesToReuse",
")",
"{",
"O... | Copies the array of the specified type from the given field offset in the source object
to the same location in the copy, visiting the array during the copy so that its contents are also copied
@param source The object to copy from
@param copy The target object
@param fieldClass The declared type of array at the given ... | [
"Copies",
"the",
"array",
"of",
"the",
"specified",
"type",
"from",
"the",
"given",
"field",
"offset",
"in",
"the",
"source",
"object",
"to",
"the",
"same",
"location",
"in",
"the",
"copy",
"visiting",
"the",
"array",
"during",
"the",
"copy",
"so",
"that",... | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java#L468-L480 |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/http/HttpUrl.java | HttpUrl.encodedPathSegments | public List<String> encodedPathSegments() {
int pathStart = url.indexOf('/', scheme.length() + 3);
int pathEnd = delimiterOffset(url, pathStart, url.length(), "?#");
List<String> result = new ArrayList<>();
for (int i = pathStart; i < pathEnd; ) {
i++; // Skip the '/'.
... | java | public List<String> encodedPathSegments() {
int pathStart = url.indexOf('/', scheme.length() + 3);
int pathEnd = delimiterOffset(url, pathStart, url.length(), "?#");
List<String> result = new ArrayList<>();
for (int i = pathStart; i < pathEnd; ) {
i++; // Skip the '/'.
... | [
"public",
"List",
"<",
"String",
">",
"encodedPathSegments",
"(",
")",
"{",
"int",
"pathStart",
"=",
"url",
".",
"indexOf",
"(",
"'",
"'",
",",
"scheme",
".",
"length",
"(",
")",
"+",
"3",
")",
";",
"int",
"pathEnd",
"=",
"delimiterOffset",
"(",
"url... | Returns a list of encoded path segments like {@code ["a", "b", "c"]} for the URL {@code
http://host/a/b/c}. This list is never empty though it may contain a single empty string.
<p><table summary="">
<tr><th>URL</th><th>{@code encodedPathSegments()}</th></tr>
<tr><td>{@code http://host/}</td><td>{@code [""]}</td></tr>... | [
"Returns",
"a",
"list",
"of",
"encoded",
"path",
"segments",
"like",
"{",
"@code",
"[",
"a",
"b",
"c",
"]",
"}",
"for",
"the",
"URL",
"{",
"@code",
"http",
":",
"//",
"host",
"/",
"a",
"/",
"b",
"/",
"c",
"}",
".",
"This",
"list",
"is",
"never"... | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/http/HttpUrl.java#L566-L577 |
netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java | Bzip2HuffmanAllocator.findNodesToRelocate | private static int findNodesToRelocate(final int[] array, final int maximumLength) {
int currentNode = array.length - 2;
for (int currentDepth = 1; currentDepth < maximumLength - 1 && currentNode > 1; currentDepth++) {
currentNode = first(array, currentNode - 1, 0);
}
return... | java | private static int findNodesToRelocate(final int[] array, final int maximumLength) {
int currentNode = array.length - 2;
for (int currentDepth = 1; currentDepth < maximumLength - 1 && currentNode > 1; currentDepth++) {
currentNode = first(array, currentNode - 1, 0);
}
return... | [
"private",
"static",
"int",
"findNodesToRelocate",
"(",
"final",
"int",
"[",
"]",
"array",
",",
"final",
"int",
"maximumLength",
")",
"{",
"int",
"currentNode",
"=",
"array",
".",
"length",
"-",
"2",
";",
"for",
"(",
"int",
"currentDepth",
"=",
"1",
";",... | Finds the number of nodes to relocate in order to achieve a given code length limit.
@param array The code length array
@param maximumLength The maximum bit length for the generated codes
@return The number of nodes to relocate | [
"Finds",
"the",
"number",
"of",
"nodes",
"to",
"relocate",
"in",
"order",
"to",
"achieve",
"a",
"given",
"code",
"length",
"limit",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java#L88-L94 |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java | DTOCollection.addNestedDTO | public void addNestedDTO(JavaClass<?> entity, JavaClassSource nestedDTO)
{
DTOPair dtoPair = dtos.containsKey(entity) ? dtos.get(entity) : new DTOPair();
dtoPair.nestedDTO = nestedDTO;
dtos.put(entity, dtoPair);
} | java | public void addNestedDTO(JavaClass<?> entity, JavaClassSource nestedDTO)
{
DTOPair dtoPair = dtos.containsKey(entity) ? dtos.get(entity) : new DTOPair();
dtoPair.nestedDTO = nestedDTO;
dtos.put(entity, dtoPair);
} | [
"public",
"void",
"addNestedDTO",
"(",
"JavaClass",
"<",
"?",
">",
"entity",
",",
"JavaClassSource",
"nestedDTO",
")",
"{",
"DTOPair",
"dtoPair",
"=",
"dtos",
".",
"containsKey",
"(",
"entity",
")",
"?",
"dtos",
".",
"get",
"(",
"entity",
")",
":",
"new"... | Registers the nested DTO created for a JPA entity
@param entity The JPA entity
@param nestedDTO The nested DTO created for the JPA entity | [
"Registers",
"the",
"nested",
"DTO",
"created",
"for",
"a",
"JPA",
"entity"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/dto/DTOCollection.java#L69-L74 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/BundlePathMappingBuilder.java | BundlePathMappingBuilder.asPath | private String asPath(String path, boolean generatedResource) {
String result = path;
if (!generatedResource) {
result = PathNormalizer.asPath(path);
}
return result;
} | java | private String asPath(String path, boolean generatedResource) {
String result = path;
if (!generatedResource) {
result = PathNormalizer.asPath(path);
}
return result;
} | [
"private",
"String",
"asPath",
"(",
"String",
"path",
",",
"boolean",
"generatedResource",
")",
"{",
"String",
"result",
"=",
"path",
";",
"if",
"(",
"!",
"generatedResource",
")",
"{",
"result",
"=",
"PathNormalizer",
".",
"asPath",
"(",
"path",
")",
";",... | Normalizes a path and adds a separator at its start, if it's not a
generated resource.
@param path
the path
@param generatedResource
the flag indicating if the resource has been generated
@return the normalized path | [
"Normalizes",
"a",
"path",
"and",
"adds",
"a",
"separator",
"at",
"its",
"start",
"if",
"it",
"s",
"not",
"a",
"generated",
"resource",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/BundlePathMappingBuilder.java#L313-L320 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/config/refresher/CarrierRefresher.java | CarrierRefresher.isValidCarrierNode | private static boolean isValidCarrierNode(final boolean sslEnabled, final NodeInfo nodeInfo) {
if (sslEnabled && nodeInfo.sslServices().containsKey(ServiceType.BINARY)) {
return true;
} else if (nodeInfo.services().containsKey(ServiceType.BINARY)) {
return true;
}
... | java | private static boolean isValidCarrierNode(final boolean sslEnabled, final NodeInfo nodeInfo) {
if (sslEnabled && nodeInfo.sslServices().containsKey(ServiceType.BINARY)) {
return true;
} else if (nodeInfo.services().containsKey(ServiceType.BINARY)) {
return true;
}
... | [
"private",
"static",
"boolean",
"isValidCarrierNode",
"(",
"final",
"boolean",
"sslEnabled",
",",
"final",
"NodeInfo",
"nodeInfo",
")",
"{",
"if",
"(",
"sslEnabled",
"&&",
"nodeInfo",
".",
"sslServices",
"(",
")",
".",
"containsKey",
"(",
"ServiceType",
".",
"... | Helper method to detect if the given node can actually perform carrier refresh.
@param sslEnabled true if ssl enabled, false otherwise.
@param nodeInfo the node info for the given node.
@return true if it is a valid carrier node, false otherwise. | [
"Helper",
"method",
"to",
"detect",
"if",
"the",
"given",
"node",
"can",
"actually",
"perform",
"carrier",
"refresh",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/config/refresher/CarrierRefresher.java#L309-L316 |
alipay/sofa-hessian | src/main/java/com/caucho/hessian/io/HessianOutput.java | HessianOutput.writeListBegin | public boolean writeListBegin(int length, String type)
throws IOException
{
os.write('V');
if (type != null) {
os.write('t');
printLenString(type);
}
if (length >= 0) {
os.write('l');
os.write(length >> 24);
os.wri... | java | public boolean writeListBegin(int length, String type)
throws IOException
{
os.write('V');
if (type != null) {
os.write('t');
printLenString(type);
}
if (length >= 0) {
os.write('l');
os.write(length >> 24);
os.wri... | [
"public",
"boolean",
"writeListBegin",
"(",
"int",
"length",
",",
"String",
"type",
")",
"throws",
"IOException",
"{",
"os",
".",
"write",
"(",
"'",
"'",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"os",
".",
"write",
"(",
"'",
"'",
")",
... | Writes the list header to the stream. List writers will call
<code>writeListBegin</code> followed by the list contents and then
call <code>writeListEnd</code>.
<code><pre>
V
t b16 b8 type
l b32 b24 b16 b8
</pre></code> | [
"Writes",
"the",
"list",
"header",
"to",
"the",
"stream",
".",
"List",
"writers",
"will",
"call",
"<code",
">",
"writeListBegin<",
"/",
"code",
">",
"followed",
"by",
"the",
"list",
"contents",
"and",
"then",
"call",
"<code",
">",
"writeListEnd<",
"/",
"co... | train | https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/io/HessianOutput.java#L338-L357 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.removeElectronContainer | public static void removeElectronContainer(IChemModel chemModel, IElectronContainer electrons) {
ICrystal crystal = chemModel.getCrystal();
if (crystal != null) {
if (crystal.contains(electrons)) {
crystal.removeElectronContainer(electrons);
}
return;
... | java | public static void removeElectronContainer(IChemModel chemModel, IElectronContainer electrons) {
ICrystal crystal = chemModel.getCrystal();
if (crystal != null) {
if (crystal.contains(electrons)) {
crystal.removeElectronContainer(electrons);
}
return;
... | [
"public",
"static",
"void",
"removeElectronContainer",
"(",
"IChemModel",
"chemModel",
",",
"IElectronContainer",
"electrons",
")",
"{",
"ICrystal",
"crystal",
"=",
"chemModel",
".",
"getCrystal",
"(",
")",
";",
"if",
"(",
"crystal",
"!=",
"null",
")",
"{",
"i... | Remove an ElectronContainer from all AtomContainers
inside an IChemModel.
@param chemModel The IChemModel object.
@param electrons The ElectronContainer to remove. | [
"Remove",
"an",
"ElectronContainer",
"from",
"all",
"AtomContainers",
"inside",
"an",
"IChemModel",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L135-L151 |
aws/aws-sdk-java | aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/RegisterJobDefinitionRequest.java | RegisterJobDefinitionRequest.withParameters | public RegisterJobDefinitionRequest withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} | java | public RegisterJobDefinitionRequest withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} | [
"public",
"RegisterJobDefinitionRequest",
"withParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"setParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value
pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from
the job definition.
</p>
@param parameters
Default parameter substitution placeholders to... | [
"<p",
">",
"Default",
"parameter",
"substitution",
"placeholders",
"to",
"set",
"in",
"the",
"job",
"definition",
".",
"Parameters",
"are",
"specified",
"as",
"a",
"key",
"-",
"value",
"pair",
"mapping",
".",
"Parameters",
"in",
"a",
"<code",
">",
"SubmitJob... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/RegisterJobDefinitionRequest.java#L254-L257 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/rpc/runner/XmlRpcRemoteRunner.java | XmlRpcRemoteRunner.runReference | public Reference runReference(String projectName, String sutName, String requirementRepositoryId,
String requirementName, String locale)
throws GreenPepperServerException
{
return runReference(projectName, sutName, requirementRepositoryId, requirementName, null, null, locale);
} | java | public Reference runReference(String projectName, String sutName, String requirementRepositoryId,
String requirementName, String locale)
throws GreenPepperServerException
{
return runReference(projectName, sutName, requirementRepositoryId, requirementName, null, null, locale);
} | [
"public",
"Reference",
"runReference",
"(",
"String",
"projectName",
",",
"String",
"sutName",
",",
"String",
"requirementRepositoryId",
",",
"String",
"requirementName",
",",
"String",
"locale",
")",
"throws",
"GreenPepperServerException",
"{",
"return",
"runReference"... | <p>runReference.</p>
@param projectName a {@link java.lang.String} object.
@param sutName a {@link java.lang.String} object.
@param requirementRepositoryId a {@link java.lang.String} object.
@param requirementName a {@link java.lang.String} object.
@param locale a {@link java.lang.String} object.
@return a {@link com.... | [
"<p",
">",
"runReference",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/rpc/runner/XmlRpcRemoteRunner.java#L150-L155 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java | JobSchedulesImpl.existsAsync | public Observable<Boolean> existsAsync(String jobScheduleId) {
return existsWithServiceResponseAsync(jobScheduleId).map(new Func1<ServiceResponseWithHeaders<Boolean, JobScheduleExistsHeaders>, Boolean>() {
@Override
public Boolean call(ServiceResponseWithHeaders<Boolean, JobScheduleExist... | java | public Observable<Boolean> existsAsync(String jobScheduleId) {
return existsWithServiceResponseAsync(jobScheduleId).map(new Func1<ServiceResponseWithHeaders<Boolean, JobScheduleExistsHeaders>, Boolean>() {
@Override
public Boolean call(ServiceResponseWithHeaders<Boolean, JobScheduleExist... | [
"public",
"Observable",
"<",
"Boolean",
">",
"existsAsync",
"(",
"String",
"jobScheduleId",
")",
"{",
"return",
"existsWithServiceResponseAsync",
"(",
"jobScheduleId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponseWithHeaders",
"<",
"Boolean",
",",
"J... | Checks the specified job schedule exists.
@param jobScheduleId The ID of the job schedule which you want to check.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Boolean object | [
"Checks",
"the",
"specified",
"job",
"schedule",
"exists",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java#L172-L179 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java | Uris.resolveParams | public static URI resolveParams(final URI uri,
final Map<String, String> params,
final boolean strict,
final boolean strictNorm) throws NormalizationException {
return resolve(uri, "&" + PARAM_JOINER.join... | java | public static URI resolveParams(final URI uri,
final Map<String, String> params,
final boolean strict,
final boolean strictNorm) throws NormalizationException {
return resolve(uri, "&" + PARAM_JOINER.join... | [
"public",
"static",
"URI",
"resolveParams",
"(",
"final",
"URI",
"uri",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"final",
"boolean",
"strict",
",",
"final",
"boolean",
"strictNorm",
")",
"throws",
"NormalizationException",
"{",
... | Returns a new URI that is the given URI resolved with the given query parameters resolved (appended). Both
the keys and values of each entry in the map will be normalized as queryParameter
@param uri the base URI to resolve against
@param params the query parameters to resolve
@param strict whether or not to perform ... | [
"Returns",
"a",
"new",
"URI",
"that",
"is",
"the",
"given",
"URI",
"resolved",
"with",
"the",
"given",
"query",
"parameters",
"resolved",
"(",
"appended",
")",
".",
"Both",
"the",
"keys",
"and",
"values",
"of",
"each",
"entry",
"in",
"the",
"map",
"will"... | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Uris.java#L377-L382 |
playn/playn | core/src/playn/core/json/JsonArray.java | JsonArray.getObject | public Json.Object getObject(int key, Json.Object default_) {
Object o = get(key);
return o instanceof Json.Object ? (Json.Object)get(key) : default_;
} | java | public Json.Object getObject(int key, Json.Object default_) {
Object o = get(key);
return o instanceof Json.Object ? (Json.Object)get(key) : default_;
} | [
"public",
"Json",
".",
"Object",
"getObject",
"(",
"int",
"key",
",",
"Json",
".",
"Object",
"default_",
")",
"{",
"Object",
"o",
"=",
"get",
"(",
"key",
")",
";",
"return",
"o",
"instanceof",
"Json",
".",
"Object",
"?",
"(",
"Json",
".",
"Object",
... | Returns the {@link JsonObject} at the given index, or the default if it does not exist or is the wrong type. | [
"Returns",
"the",
"{"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/json/JsonArray.java#L179-L182 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java | CommerceTierPriceEntryPersistenceImpl.findByUUID_G | @Override
public CommerceTierPriceEntry findByUUID_G(String uuid, long groupId)
throws NoSuchTierPriceEntryException {
CommerceTierPriceEntry commerceTierPriceEntry = fetchByUUID_G(uuid,
groupId);
if (commerceTierPriceEntry == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTI... | java | @Override
public CommerceTierPriceEntry findByUUID_G(String uuid, long groupId)
throws NoSuchTierPriceEntryException {
CommerceTierPriceEntry commerceTierPriceEntry = fetchByUUID_G(uuid,
groupId);
if (commerceTierPriceEntry == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTI... | [
"@",
"Override",
"public",
"CommerceTierPriceEntry",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchTierPriceEntryException",
"{",
"CommerceTierPriceEntry",
"commerceTierPriceEntry",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
... | Returns the commerce tier price entry where uuid = ? and groupId = ? or throws a {@link NoSuchTierPriceEntryException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce tier price entry
@throws NoSuchTierPriceEntryException if a matching commerce tier pric... | [
"Returns",
"the",
"commerce",
"tier",
"price",
"entry",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchTierPriceEntryException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommerceTierPriceEntryPersistenceImpl.java#L671-L698 |
pushtorefresh/storio | storio-sample-app/src/main/java/com/pushtorefresh/storio3/sample/db/DbModule.java | DbModule.provideStorIOSQLite | @Provides
@NonNull
@Singleton
public StorIOSQLite provideStorIOSQLite(@NonNull SQLiteOpenHelper sqLiteOpenHelper) {
final CarStorIOSQLitePutResolver carStorIOSQLitePutResolver = new CarStorIOSQLitePutResolver();
final CarStorIOSQLiteGetResolver carStorIOSQLiteGetResolver = new CarStorIOSQLit... | java | @Provides
@NonNull
@Singleton
public StorIOSQLite provideStorIOSQLite(@NonNull SQLiteOpenHelper sqLiteOpenHelper) {
final CarStorIOSQLitePutResolver carStorIOSQLitePutResolver = new CarStorIOSQLitePutResolver();
final CarStorIOSQLiteGetResolver carStorIOSQLiteGetResolver = new CarStorIOSQLit... | [
"@",
"Provides",
"@",
"NonNull",
"@",
"Singleton",
"public",
"StorIOSQLite",
"provideStorIOSQLite",
"(",
"@",
"NonNull",
"SQLiteOpenHelper",
"sqLiteOpenHelper",
")",
"{",
"final",
"CarStorIOSQLitePutResolver",
"carStorIOSQLitePutResolver",
"=",
"new",
"CarStorIOSQLitePutRes... | But keep in mind that different instances of StorIOSQLite won't share notifications! | [
"But",
"keep",
"in",
"mind",
"that",
"different",
"instances",
"of",
"StorIOSQLite",
"won",
"t",
"share",
"notifications!"
] | train | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-sample-app/src/main/java/com/pushtorefresh/storio3/sample/db/DbModule.java#L45-L80 |
jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageRecordDesc.java | BaseMessageRecordDesc.createMessageRecordDesc | public static BaseMessageRecordDesc createMessageRecordDesc(String strMessageDataClassName, MessageDataParent messageDataParent, String strKey)
{
BaseMessageRecordDesc messageData = (BaseMessageRecordDesc)ClassServiceUtility.getClassService().makeObjectFromClassName(strMessageDataClassName);
if (mes... | java | public static BaseMessageRecordDesc createMessageRecordDesc(String strMessageDataClassName, MessageDataParent messageDataParent, String strKey)
{
BaseMessageRecordDesc messageData = (BaseMessageRecordDesc)ClassServiceUtility.getClassService().makeObjectFromClassName(strMessageDataClassName);
if (mes... | [
"public",
"static",
"BaseMessageRecordDesc",
"createMessageRecordDesc",
"(",
"String",
"strMessageDataClassName",
",",
"MessageDataParent",
"messageDataParent",
",",
"String",
"strKey",
")",
"{",
"BaseMessageRecordDesc",
"messageData",
"=",
"(",
"BaseMessageRecordDesc",
")",
... | Setup this message given this internal data structure.
@param data The data in an intermediate format. | [
"Setup",
"this",
"message",
"given",
"this",
"internal",
"data",
"structure",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageRecordDesc.java#L395-L401 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitHidden | @Override
public R visitHidden(HiddenTree node, P p) {
return defaultAction(node, p);
} | java | @Override
public R visitHidden(HiddenTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitHidden",
"(",
"HiddenTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L213-L216 |
prestodb/presto | presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java | AccumuloClient.getScanAuthorizations | private Authorizations getScanAuthorizations(ConnectorSession session, String schema,
String table)
throws AccumuloException, AccumuloSecurityException
{
String sessionScanUser = AccumuloSessionProperties.getScanUsername(session);
if (sessionScanUser != null) {
Au... | java | private Authorizations getScanAuthorizations(ConnectorSession session, String schema,
String table)
throws AccumuloException, AccumuloSecurityException
{
String sessionScanUser = AccumuloSessionProperties.getScanUsername(session);
if (sessionScanUser != null) {
Au... | [
"private",
"Authorizations",
"getScanAuthorizations",
"(",
"ConnectorSession",
"session",
",",
"String",
"schema",
",",
"String",
"table",
")",
"throws",
"AccumuloException",
",",
"AccumuloSecurityException",
"{",
"String",
"sessionScanUser",
"=",
"AccumuloSessionProperties... | Gets the scan authorizations to use for scanning tables.
<p>
In order of priority: session username authorizations, then table property, then the default connector auths.
@param session Current session
@param schema Schema name
@param table Table Name
@return Scan authorizations
@throws AccumuloException If a generic ... | [
"Gets",
"the",
"scan",
"authorizations",
"to",
"use",
"for",
"scanning",
"tables",
".",
"<p",
">",
"In",
"order",
"of",
"priority",
":",
"session",
"username",
"authorizations",
"then",
"table",
"property",
"then",
"the",
"default",
"connector",
"auths",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloClient.java#L729-L754 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/ProbeManagerImpl.java | ProbeManagerImpl.addListenersForMonitor | boolean addListenersForMonitor(Object monitor, Set<ProbeListener> listeners) {
listenersLock.writeLock().lock();
try {
if (listenersForMonitor.containsKey(monitor)) {
return false;
}
listenersForMonitor.put(monitor, listeners);
allRegistere... | java | boolean addListenersForMonitor(Object monitor, Set<ProbeListener> listeners) {
listenersLock.writeLock().lock();
try {
if (listenersForMonitor.containsKey(monitor)) {
return false;
}
listenersForMonitor.put(monitor, listeners);
allRegistere... | [
"boolean",
"addListenersForMonitor",
"(",
"Object",
"monitor",
",",
"Set",
"<",
"ProbeListener",
">",
"listeners",
")",
"{",
"listenersLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"listenersForMonitor",
".",
"contains... | Register a {@link Set} of listeners with its associated monitor. The
configuration of each of the registered listeners is evaluated each time
a class is initialized in the JVM.
@param monitor the monitor instance that owns the listeners
@param listeners the listeners associated with the monitor
@return true iff the l... | [
"Register",
"a",
"{",
"@link",
"Set",
"}",
"of",
"listeners",
"with",
"its",
"associated",
"monitor",
".",
"The",
"configuration",
"of",
"each",
"of",
"the",
"registered",
"listeners",
"is",
"evaluated",
"each",
"time",
"a",
"class",
"is",
"initialized",
"in... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/ProbeManagerImpl.java#L427-L440 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParseUtil.java | BpmnParseUtil.parseCamundaScript | public static ExecutableScript parseCamundaScript(Element scriptElement) {
String scriptLanguage = scriptElement.attribute("scriptFormat");
if (scriptLanguage == null || scriptLanguage.isEmpty()) {
throw new BpmnParseException("Missing attribute 'scriptFormatAttribute' for 'script' element", scriptElement... | java | public static ExecutableScript parseCamundaScript(Element scriptElement) {
String scriptLanguage = scriptElement.attribute("scriptFormat");
if (scriptLanguage == null || scriptLanguage.isEmpty()) {
throw new BpmnParseException("Missing attribute 'scriptFormatAttribute' for 'script' element", scriptElement... | [
"public",
"static",
"ExecutableScript",
"parseCamundaScript",
"(",
"Element",
"scriptElement",
")",
"{",
"String",
"scriptLanguage",
"=",
"scriptElement",
".",
"attribute",
"(",
"\"scriptFormat\"",
")",
";",
"if",
"(",
"scriptLanguage",
"==",
"null",
"||",
"scriptLa... | Parses a camunda script element.
@param scriptElement the script element ot parse
@return the generated executable script
@throws BpmnParseException if the a attribute is missing or the script cannot be processed | [
"Parses",
"a",
"camunda",
"script",
"element",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParseUtil.java#L223-L238 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/curves/PrecisionRecallCurve.java | PrecisionRecallCurve.getPointAtRecall | public Point getPointAtRecall(double recall) {
Point foundPoint = null;
//Find the HIGHEST threshold that gives the specified recall
for (int i = this.recall.length - 1; i >= 0; i--) {
if (this.recall[i] >= recall) {
if (foundPoint == null ||(this.recall[i... | java | public Point getPointAtRecall(double recall) {
Point foundPoint = null;
//Find the HIGHEST threshold that gives the specified recall
for (int i = this.recall.length - 1; i >= 0; i--) {
if (this.recall[i] >= recall) {
if (foundPoint == null ||(this.recall[i... | [
"public",
"Point",
"getPointAtRecall",
"(",
"double",
"recall",
")",
"{",
"Point",
"foundPoint",
"=",
"null",
";",
"//Find the HIGHEST threshold that gives the specified recall",
"for",
"(",
"int",
"i",
"=",
"this",
".",
"recall",
".",
"length",
"-",
"1",
";",
"... | Get the point (index, threshold, precision, recall) at the given recall.<br>
Specifically, return the points at the highest threshold that has recall equal to or greater than the
requested recall.
@param recall Recall to get the point for
@return point (index, threshold, precision, recall) at (or closest exceeding) th... | [
"Get",
"the",
"point",
"(",
"index",
"threshold",
"precision",
"recall",
")",
"at",
"the",
"given",
"recall",
".",
"<br",
">",
"Specifically",
"return",
"the",
"points",
"at",
"the",
"highest",
"threshold",
"that",
"has",
"recall",
"equal",
"to",
"or",
"gr... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/curves/PrecisionRecallCurve.java#L184-L199 |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/ObjectMapperCreator.java | ObjectMapperCreator.extractMappedType | private JClassType extractMappedType( JClassType interfaceClass ) throws UnableToCompleteException {
JClassType intf = interfaceClass.isInterface();
if ( intf == null ) {
logger.log( TreeLogger.Type.ERROR, "Expected " + interfaceClass + " to be an interface." );
throw new UnableT... | java | private JClassType extractMappedType( JClassType interfaceClass ) throws UnableToCompleteException {
JClassType intf = interfaceClass.isInterface();
if ( intf == null ) {
logger.log( TreeLogger.Type.ERROR, "Expected " + interfaceClass + " to be an interface." );
throw new UnableT... | [
"private",
"JClassType",
"extractMappedType",
"(",
"JClassType",
"interfaceClass",
")",
"throws",
"UnableToCompleteException",
"{",
"JClassType",
"intf",
"=",
"interfaceClass",
".",
"isInterface",
"(",
")",
";",
"if",
"(",
"intf",
"==",
"null",
")",
"{",
"logger",... | Extract the type to map from the interface.
@param interfaceClass the interface
@return the extracted type to map
@throws UnableToCompleteException if we don't find the type | [
"Extract",
"the",
"type",
"to",
"map",
"from",
"the",
"interface",
"."
] | train | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/ObjectMapperCreator.java#L157-L177 |
syphr42/prom | src/main/java/org/syphr/prom/PropertiesManager.java | PropertiesManager.saveProperty | public void saveProperty(T property, String value) throws IOException
{
setProperty(property, value);
saveProperty(property);
} | java | public void saveProperty(T property, String value) throws IOException
{
setProperty(property, value);
saveProperty(property);
} | [
"public",
"void",
"saveProperty",
"(",
"T",
"property",
",",
"String",
"value",
")",
"throws",
"IOException",
"{",
"setProperty",
"(",
"property",
",",
"value",
")",
";",
"saveProperty",
"(",
"property",
")",
";",
"}"
] | Modify the value of the given property and save <b>only that change</b>
to permanent storage. This method will not save other properties whose
values may have been modified since the file was last loaded or saved.
Any modifications that have been made to other properties will still be
set, but the file will not reflect... | [
"Modify",
"the",
"value",
"of",
"the",
"given",
"property",
"and",
"save",
"<b",
">",
"only",
"that",
"change<",
"/",
"b",
">",
"to",
"permanent",
"storage",
".",
"This",
"method",
"will",
"not",
"save",
"other",
"properties",
"whose",
"values",
"may",
"... | train | https://github.com/syphr42/prom/blob/074d67c4ebb3afb0b163fcb0bc4826ee577ac803/src/main/java/org/syphr/prom/PropertiesManager.java#L1013-L1017 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/LocalFileResource.java | LocalFileResource.newResource | public static LocalFileResource newResource(String normalizedPath, String repositoryPath, SymbolicRootResource root) {
return new LocalFileResource(normalizedPath, repositoryPath, root);
} | java | public static LocalFileResource newResource(String normalizedPath, String repositoryPath, SymbolicRootResource root) {
return new LocalFileResource(normalizedPath, repositoryPath, root);
} | [
"public",
"static",
"LocalFileResource",
"newResource",
"(",
"String",
"normalizedPath",
",",
"String",
"repositoryPath",
",",
"SymbolicRootResource",
"root",
")",
"{",
"return",
"new",
"LocalFileResource",
"(",
"normalizedPath",
",",
"repositoryPath",
",",
"root",
")... | Create a new local resource
@param normalizedPath
Normalized file path for this resource; can not be null.
@param repositoryPath
An abstraction of the file location; may be null.
@param root
Symbolic root for resource | [
"Create",
"a",
"new",
"local",
"resource"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/LocalFileResource.java#L96-L98 |
ag-gipp/MathMLTools | mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/node/MathNodeGenerator.java | MathNodeGenerator.printMathNode | public static String printMathNode(MathNode node, String indent) {
StringBuilder sb = new StringBuilder(indent + node.toString() + "\n");
node.getChildren().forEach(n -> sb.append(printMathNode(n, indent + " ")));
return sb.toString();
} | java | public static String printMathNode(MathNode node, String indent) {
StringBuilder sb = new StringBuilder(indent + node.toString() + "\n");
node.getChildren().forEach(n -> sb.append(printMathNode(n, indent + " ")));
return sb.toString();
} | [
"public",
"static",
"String",
"printMathNode",
"(",
"MathNode",
"node",
",",
"String",
"indent",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"indent",
"+",
"node",
".",
"toString",
"(",
")",
"+",
"\"\\n\"",
")",
";",
"node",
".",
"... | Converts a MathNode into a an simplistic indented tree
representation of itself.
@param node Node to begin with and onwards for all children of it.
@param indent starting line used as an indent (e.g. start with "")
@return return a tree representation of itself | [
"Converts",
"a",
"MathNode",
"into",
"a",
"an",
"simplistic",
"indented",
"tree",
"representation",
"of",
"itself",
"."
] | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/node/MathNodeGenerator.java#L124-L128 |
strator-dev/greenpepper-open | extensions-external/php/src/main/java/com/greenpepper/phpsud/PHPContainerFactory.java | PHPContainerFactory.createContainer | public static PHPContainer createContainer(String phpExec, String workingDirectory, String phpInitFile) throws PHPException {
PHPContainer container = new PHPContainer(phpExec, workingDirectory, phpInitFile);
container.setObjectParser(new ObjectParser());
container.setClassCreatorFactory(new PHPJavaClassCreatorF... | java | public static PHPContainer createContainer(String phpExec, String workingDirectory, String phpInitFile) throws PHPException {
PHPContainer container = new PHPContainer(phpExec, workingDirectory, phpInitFile);
container.setObjectParser(new ObjectParser());
container.setClassCreatorFactory(new PHPJavaClassCreatorF... | [
"public",
"static",
"PHPContainer",
"createContainer",
"(",
"String",
"phpExec",
",",
"String",
"workingDirectory",
",",
"String",
"phpInitFile",
")",
"throws",
"PHPException",
"{",
"PHPContainer",
"container",
"=",
"new",
"PHPContainer",
"(",
"phpExec",
",",
"worki... | <p>createContainer.</p>
@param phpExec a {@link java.lang.String} object.
@param workingDirectory a {@link java.lang.String} object.
@param phpInitFile a {@link java.lang.String} object.
@return a {@link com.greenpepper.phpsud.container.PHPContainer} object.
@throws com.greenpepper.phpsud.exceptions.PHPException if an... | [
"<p",
">",
"createContainer",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper-open/blob/71fd244b4989e9cd2d07ae62dd954a1f2a269a92/extensions-external/php/src/main/java/com/greenpepper/phpsud/PHPContainerFactory.java#L46-L51 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java | EnumConstantBuilder.buildEnumConstant | public void buildEnumConstant(XMLNode node, Content memberDetailsTree) throws DocletException {
if (writer == null) {
return;
}
if (hasMembersToDocument()) {
Content enumConstantsDetailsTree = writer.getEnumConstantsDetailsTreeHeader(typeElement,
membe... | java | public void buildEnumConstant(XMLNode node, Content memberDetailsTree) throws DocletException {
if (writer == null) {
return;
}
if (hasMembersToDocument()) {
Content enumConstantsDetailsTree = writer.getEnumConstantsDetailsTreeHeader(typeElement,
membe... | [
"public",
"void",
"buildEnumConstant",
"(",
"XMLNode",
"node",
",",
"Content",
"memberDetailsTree",
")",
"throws",
"DocletException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"hasMembersToDocument",
"(",
")",
")",
"{",... | Build the enum constant documentation.
@param node the XML element that specifies which components to document
@param memberDetailsTree the content tree to which the documentation will be added
@throws DocletException is there is a problem while building the documentation | [
"Build",
"the",
"enum",
"constant",
"documentation",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java#L135-L154 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfActions.java | MmtfActions.writeToFile | public static void writeToFile(Structure structure, Path path) throws IOException {
// Set up this writer
AdapterToStructureData writerToEncoder = new AdapterToStructureData();
// Get the writer - this is what people implement
new MmtfStructureWriter(structure, writerToEncoder);
// Now write this data to file... | java | public static void writeToFile(Structure structure, Path path) throws IOException {
// Set up this writer
AdapterToStructureData writerToEncoder = new AdapterToStructureData();
// Get the writer - this is what people implement
new MmtfStructureWriter(structure, writerToEncoder);
// Now write this data to file... | [
"public",
"static",
"void",
"writeToFile",
"(",
"Structure",
"structure",
",",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"// Set up this writer",
"AdapterToStructureData",
"writerToEncoder",
"=",
"new",
"AdapterToStructureData",
"(",
")",
";",
"// Get the write... | Write a Structure object to a file.
@param structure the Structure to write
@param path the file to write
@throws IOException | [
"Write",
"a",
"Structure",
"object",
"to",
"a",
"file",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfActions.java#L63-L70 |
opencredo/opencredo-esper | esper-template/src/main/java/org/opencredo/esper/config/xml/EsperStatementParser.java | EsperStatementParser.parseStatements | @SuppressWarnings("unchecked")
public ManagedSet parseStatements(Element element, ParserContext parserContext) {
ManagedSet statements = new ManagedSet();
NodeList childNodes = element.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node child = childNodes.it... | java | @SuppressWarnings("unchecked")
public ManagedSet parseStatements(Element element, ParserContext parserContext) {
ManagedSet statements = new ManagedSet();
NodeList childNodes = element.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node child = childNodes.it... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"ManagedSet",
"parseStatements",
"(",
"Element",
"element",
",",
"ParserContext",
"parserContext",
")",
"{",
"ManagedSet",
"statements",
"=",
"new",
"ManagedSet",
"(",
")",
";",
"NodeList",
"childNodes",
... | Parses out the individual statement elements for further processing.
@param element
the esper-template context
@param parserContext
the parser's context
@return a set of initialized esper statements | [
"Parses",
"out",
"the",
"individual",
"statement",
"elements",
"for",
"further",
"processing",
"."
] | train | https://github.com/opencredo/opencredo-esper/blob/a88c9fd0301a4d6962da70d85577c27d50d08825/esper-template/src/main/java/org/opencredo/esper/config/xml/EsperStatementParser.java#L100-L125 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AgentRegistrationInformationsInner.java | AgentRegistrationInformationsInner.regenerateKey | public AgentRegistrationInner regenerateKey(String resourceGroupName, String automationAccountName, AgentRegistrationRegenerateKeyParameter parameters) {
return regenerateKeyWithServiceResponseAsync(resourceGroupName, automationAccountName, parameters).toBlocking().single().body();
} | java | public AgentRegistrationInner regenerateKey(String resourceGroupName, String automationAccountName, AgentRegistrationRegenerateKeyParameter parameters) {
return regenerateKeyWithServiceResponseAsync(resourceGroupName, automationAccountName, parameters).toBlocking().single().body();
} | [
"public",
"AgentRegistrationInner",
"regenerateKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"AgentRegistrationRegenerateKeyParameter",
"parameters",
")",
"{",
"return",
"regenerateKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",... | Regenerate a primary or secondary agent registration key.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param parameters The name of the agent registration key to be regenerated
@throws IllegalArgumentException thrown if parameters fail the ... | [
"Regenerate",
"a",
"primary",
"or",
"secondary",
"agent",
"registration",
"key",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AgentRegistrationInformationsInner.java#L163-L165 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/StringUtils.java | StringUtils.trimTo | public static String trimTo(final String aString, final String aDefault) {
if (aString == null) {
return aDefault;
}
final String trimmed = aString.trim();
return trimmed.length() == 0 ? aDefault : trimmed;
} | java | public static String trimTo(final String aString, final String aDefault) {
if (aString == null) {
return aDefault;
}
final String trimmed = aString.trim();
return trimmed.length() == 0 ? aDefault : trimmed;
} | [
"public",
"static",
"String",
"trimTo",
"(",
"final",
"String",
"aString",
",",
"final",
"String",
"aDefault",
")",
"{",
"if",
"(",
"aString",
"==",
"null",
")",
"{",
"return",
"aDefault",
";",
"}",
"final",
"String",
"trimmed",
"=",
"aString",
".",
"tri... | Trims a string; if there is nothing left after the trimming, returns whatever the default value passed in is.
@param aString The string to be trimmed
@param aDefault A default string to return if a null string is passed in
@return The trimmed string or the default value if string is empty | [
"Trims",
"a",
"string",
";",
"if",
"there",
"is",
"nothing",
"left",
"after",
"the",
"trimming",
"returns",
"whatever",
"the",
"default",
"value",
"passed",
"in",
"is",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/StringUtils.java#L68-L75 |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlotIsPhoneticallyEqual | public boolean hasSlotIsPhoneticallyEqual(final String slotName, final String value) {
return getLocale().equals("de-DE") ? hasSlotIsCologneEqual(slotName, value) :
hasSlotIsDoubleMetaphoneEqual(slotName, value);
} | java | public boolean hasSlotIsPhoneticallyEqual(final String slotName, final String value) {
return getLocale().equals("de-DE") ? hasSlotIsCologneEqual(slotName, value) :
hasSlotIsDoubleMetaphoneEqual(slotName, value);
} | [
"public",
"boolean",
"hasSlotIsPhoneticallyEqual",
"(",
"final",
"String",
"slotName",
",",
"final",
"String",
"value",
")",
"{",
"return",
"getLocale",
"(",
")",
".",
"equals",
"(",
"\"de-DE\"",
")",
"?",
"hasSlotIsCologneEqual",
"(",
"slotName",
",",
"value",
... | Checks if a slot is contained in the intent request and has a value which is a
phonetic sibling of the string given to this method. This method picks the correct
algorithm depending on the locale coming in with the speechlet request. For example the
German locale compares the slot value and the given value with the Col... | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
"and",
"has",
"a",
"value",
"which",
"is",
"a",
"phonetic",
"sibling",
"of",
"the",
"string",
"given",
"to",
"this",
"method",
".",
"This",
"method",
"picks",
"the",
"corre... | train | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L169-L172 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/dispatching/composing/PipelinedBinaryConsumer.java | PipelinedBinaryConsumer.accept | @Override
public void accept(E1 former, E2 latter) {
for (BiConsumer<E1, E2> consumer : consumers) {
consumer.accept(former, latter);
}
} | java | @Override
public void accept(E1 former, E2 latter) {
for (BiConsumer<E1, E2> consumer : consumers) {
consumer.accept(former, latter);
}
} | [
"@",
"Override",
"public",
"void",
"accept",
"(",
"E1",
"former",
",",
"E2",
"latter",
")",
"{",
"for",
"(",
"BiConsumer",
"<",
"E1",
",",
"E2",
">",
"consumer",
":",
"consumers",
")",
"{",
"consumer",
".",
"accept",
"(",
"former",
",",
"latter",
")"... | Performs every composed consumer.
@param former the former value
@param latter the latter value | [
"Performs",
"every",
"composed",
"consumer",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/dispatching/composing/PipelinedBinaryConsumer.java#L29-L34 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Waiter.java | Waiter.waitForCondition | public boolean waitForCondition(Condition condition, int timeout){
final long endTime = SystemClock.uptimeMillis() + timeout;
while (true) {
final boolean timedOut = SystemClock.uptimeMillis() > endTime;
if (timedOut){
return false;
}
sleeper.sleep();
if (condition.isSatisfied()){
return t... | java | public boolean waitForCondition(Condition condition, int timeout){
final long endTime = SystemClock.uptimeMillis() + timeout;
while (true) {
final boolean timedOut = SystemClock.uptimeMillis() > endTime;
if (timedOut){
return false;
}
sleeper.sleep();
if (condition.isSatisfied()){
return t... | [
"public",
"boolean",
"waitForCondition",
"(",
"Condition",
"condition",
",",
"int",
"timeout",
")",
"{",
"final",
"long",
"endTime",
"=",
"SystemClock",
".",
"uptimeMillis",
"(",
")",
"+",
"timeout",
";",
"while",
"(",
"true",
")",
"{",
"final",
"boolean",
... | Waits for a condition to be satisfied.
@param condition the condition to wait for
@param timeout the amount of time in milliseconds to wait
@return {@code true} if condition is satisfied and {@code false} if it is not satisfied before the timeout | [
"Waits",
"for",
"a",
"condition",
"to",
"be",
"satisfied",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Waiter.java#L515-L530 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.println | public static void println(Closure self, Object value) {
Object owner = getClosureOwner(self);
InvokerHelper.invokeMethod(owner, "println", new Object[]{value});
} | java | public static void println(Closure self, Object value) {
Object owner = getClosureOwner(self);
InvokerHelper.invokeMethod(owner, "println", new Object[]{value});
} | [
"public",
"static",
"void",
"println",
"(",
"Closure",
"self",
",",
"Object",
"value",
")",
"{",
"Object",
"owner",
"=",
"getClosureOwner",
"(",
"self",
")",
";",
"InvokerHelper",
".",
"invokeMethod",
"(",
"owner",
",",
"\"println\"",
",",
"new",
"Object",
... | Print a value (followed by a newline) to the standard output stream.
This method delegates to the owner to execute the method.
@param self a closure
@param value the value to print
@since 1.0 | [
"Print",
"a",
"value",
"(",
"followed",
"by",
"a",
"newline",
")",
"to",
"the",
"standard",
"output",
"stream",
".",
"This",
"method",
"delegates",
"to",
"the",
"owner",
"to",
"execute",
"the",
"method",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L837-L840 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/view/ViewQueryResponseMapper.java | ViewQueryResponseMapper.mapToSpatialViewResult | public static Observable<AsyncSpatialViewResult> mapToSpatialViewResult(final AsyncBucket bucket,
final SpatialViewQuery query, final ViewQueryResponse response) {
return response
.info()
.singleOrDefault(null)
.map(new ByteBufToJsonObject())
.map(new Bui... | java | public static Observable<AsyncSpatialViewResult> mapToSpatialViewResult(final AsyncBucket bucket,
final SpatialViewQuery query, final ViewQueryResponse response) {
return response
.info()
.singleOrDefault(null)
.map(new ByteBufToJsonObject())
.map(new Bui... | [
"public",
"static",
"Observable",
"<",
"AsyncSpatialViewResult",
">",
"mapToSpatialViewResult",
"(",
"final",
"AsyncBucket",
"bucket",
",",
"final",
"SpatialViewQuery",
"query",
",",
"final",
"ViewQueryResponse",
"response",
")",
"{",
"return",
"response",
".",
"info"... | Maps a raw {@link ViewQueryResponse} into a {@link AsyncSpatialViewResult}.
@param bucket reference to the bucket.
@param query the original query object.
@param response the response from the server.
@return a converted {@link AsyncSpatialViewResult}. | [
"Maps",
"a",
"raw",
"{",
"@link",
"ViewQueryResponse",
"}",
"into",
"a",
"{",
"@link",
"AsyncSpatialViewResult",
"}",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/view/ViewQueryResponseMapper.java#L78-L86 |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/ServerHelper.java | ServerHelper.waitForStandalone | public static void waitForStandalone(final Process process, final ModelControllerClient client, final long startupTimeout)
throws InterruptedException, RuntimeException, TimeoutException {
Assert.checkNotNullParam("client", client);
long timeout = startupTimeout * 1000;
final long sl... | java | public static void waitForStandalone(final Process process, final ModelControllerClient client, final long startupTimeout)
throws InterruptedException, RuntimeException, TimeoutException {
Assert.checkNotNullParam("client", client);
long timeout = startupTimeout * 1000;
final long sl... | [
"public",
"static",
"void",
"waitForStandalone",
"(",
"final",
"Process",
"process",
",",
"final",
"ModelControllerClient",
"client",
",",
"final",
"long",
"startupTimeout",
")",
"throws",
"InterruptedException",
",",
"RuntimeException",
",",
"TimeoutException",
"{",
... | Waits the given amount of time in seconds for a standalone server to start.
<p>
If the {@code process} is not {@code null} and a timeout occurs the process will be
{@linkplain Process#destroy() destroyed}.
</p>
@param process the Java process can be {@code null} if no process is available
@param client ... | [
"Waits",
"the",
"given",
"amount",
"of",
"time",
"in",
"seconds",
"for",
"a",
"standalone",
"server",
"to",
"start",
".",
"<p",
">",
"If",
"the",
"{",
"@code",
"process",
"}",
"is",
"not",
"{",
"@code",
"null",
"}",
"and",
"a",
"timeout",
"occurs",
"... | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/ServerHelper.java#L307-L329 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.unshareProject | public void unshareProject(Object projectIdOrPath, Integer groupId) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects", getProjectIdOrPath(projectIdOrPath), "share", groupId... | java | public void unshareProject(Object projectIdOrPath, Integer groupId) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects", getProjectIdOrPath(projectIdOrPath), "share", groupId... | [
"public",
"void",
"unshareProject",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"groupId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
".",
"Status",
"expectedStatus",
"=",
"(",
"isApiVersion",
"(",
"ApiVersion",
".",
"V3",
")",
"?",
"Response",
... | Unshare the project from the group.
<pre><code>DELETE /projects/:id/share/:group_id</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param groupId the ID of the group to unshare, required
@throws GitLabApiException if any excep... | [
"Unshare",
"the",
"project",
"from",
"the",
"group",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L2100-L2103 |
google/cloud-reporting | src/main/java/com/google/cloud/metrics/MetricsUtils.java | MetricsUtils.buildPostBody | static UrlEncodedFormEntity buildPostBody(Event event, String analyticsId, Random random) {
checkNotNull(event);
checkNotNull(analyticsId);
checkNotNull(random);
String virtualPageName = buildVirtualPageName(event.type(),
event.objectType(), event.name());
String virtualPageTitle = buildVir... | java | static UrlEncodedFormEntity buildPostBody(Event event, String analyticsId, Random random) {
checkNotNull(event);
checkNotNull(analyticsId);
checkNotNull(random);
String virtualPageName = buildVirtualPageName(event.type(),
event.objectType(), event.name());
String virtualPageTitle = buildVir... | [
"static",
"UrlEncodedFormEntity",
"buildPostBody",
"(",
"Event",
"event",
",",
"String",
"analyticsId",
",",
"Random",
"random",
")",
"{",
"checkNotNull",
"(",
"event",
")",
";",
"checkNotNull",
"(",
"analyticsId",
")",
";",
"checkNotNull",
"(",
"random",
")",
... | Creates the body of a POST request encoding the metric report for a single {@link Event}.
@param event The event to report.
@param analyticsId the Google Analytics ID to receive the report.
@param random Random number generator to use for cache busting.
@return A URL-encoded POST request body, in the format expected b... | [
"Creates",
"the",
"body",
"of",
"a",
"POST",
"request",
"encoding",
"the",
"metric",
"report",
"for",
"a",
"single",
"{",
"@link",
"Event",
"}",
"."
] | train | https://github.com/google/cloud-reporting/blob/af2a8ff6077a9763f7f2d405dd55c82efaead0ac/src/main/java/com/google/cloud/metrics/MetricsUtils.java#L95-L119 |
anotheria/configureme | src/main/java/org/configureme/sources/FileLoader.java | FileLoader.getFile | private File getFile(final ConfigurationSourceKey key) {
final String fileName = getFileName(key);
if (externalConfigPath != null) {
final File f = new File(externalConfigPath, fileName);
if (f.exists())
return f; // return overwritten configuration location
}
// configuration-file was not overwrit... | java | private File getFile(final ConfigurationSourceKey key) {
final String fileName = getFileName(key);
if (externalConfigPath != null) {
final File f = new File(externalConfigPath, fileName);
if (f.exists())
return f; // return overwritten configuration location
}
// configuration-file was not overwrit... | [
"private",
"File",
"getFile",
"(",
"final",
"ConfigurationSourceKey",
"key",
")",
"{",
"final",
"String",
"fileName",
"=",
"getFileName",
"(",
"key",
")",
";",
"if",
"(",
"externalConfigPath",
"!=",
"null",
")",
"{",
"final",
"File",
"f",
"=",
"new",
"File... | Determine a {@link File} handle related to given {@link ConfigurationSourceKey}. This method returns
NULL if file does not exists - neither on file-system nor within a classpath-JAR-file.
Keep in mind, if file is located within JAR, {@link File#exists()} will return FALSE.
@param key
{@link ConfigurationSourceKey}
@re... | [
"Determine",
"a",
"{",
"@link",
"File",
"}",
"handle",
"related",
"to",
"given",
"{",
"@link",
"ConfigurationSourceKey",
"}",
".",
"This",
"method",
"returns",
"NULL",
"if",
"file",
"does",
"not",
"exists",
"-",
"neither",
"on",
"file",
"-",
"system",
"nor... | train | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/sources/FileLoader.java#L106-L119 |
alkacon/opencms-core | src/org/opencms/util/CmsMacroResolver.java | CmsMacroResolver.isMacro | public static boolean isMacro(String input, String macroName) {
if (isMacro(input)) {
return input.substring(2, input.length() - 1).equals(macroName);
}
return false;
} | java | public static boolean isMacro(String input, String macroName) {
if (isMacro(input)) {
return input.substring(2, input.length() - 1).equals(macroName);
}
return false;
} | [
"public",
"static",
"boolean",
"isMacro",
"(",
"String",
"input",
",",
"String",
"macroName",
")",
"{",
"if",
"(",
"isMacro",
"(",
"input",
")",
")",
"{",
"return",
"input",
".",
"substring",
"(",
"2",
",",
"input",
".",
"length",
"(",
")",
"-",
"1",... | Returns <code>true</code> if the given input String is a macro equal to the given macro name.<p>
@param input the input to check for a macro
@param macroName the macro name to check for
@return <code>true</code> if the given input String is a macro equal to the given macro name | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"given",
"input",
"String",
"is",
"a",
"macro",
"equal",
"to",
"the",
"given",
"macro",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsMacroResolver.java#L446-L452 |
m-m-m/util | event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java | AbstractEventBus.dispatchEvent | protected <E> void dispatchEvent(E event, Collection<Throwable> errors) {
@SuppressWarnings({ "unchecked", "rawtypes" })
Class<E> eventType = (Class) event.getClass();
EventDispatcher<? super E> eventDispatcher = getEventDispatcherOptional(eventType);
boolean dispatched = false;
if (eventDispatcher... | java | protected <E> void dispatchEvent(E event, Collection<Throwable> errors) {
@SuppressWarnings({ "unchecked", "rawtypes" })
Class<E> eventType = (Class) event.getClass();
EventDispatcher<? super E> eventDispatcher = getEventDispatcherOptional(eventType);
boolean dispatched = false;
if (eventDispatcher... | [
"protected",
"<",
"E",
">",
"void",
"dispatchEvent",
"(",
"E",
"event",
",",
"Collection",
"<",
"Throwable",
">",
"errors",
")",
"{",
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"Class",
"<",
"E",
">",
"eventType",
... | Dispatches the given {@link net.sf.mmm.util.event.api.Event}.
@param <E> is the generic type of {@code event}.
@param event is the {@link net.sf.mmm.util.event.api.Event} to dispatch.
@param errors is a {@link Collection} where errors are collected. | [
"Dispatches",
"the",
"given",
"{",
"@link",
"net",
".",
"sf",
".",
"mmm",
".",
"util",
".",
"event",
".",
"api",
".",
"Event",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java#L130-L142 |
Hygieia/Hygieia | collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/DefaultJiraClient.java | DefaultJiraClient.processAssigneeData | @SuppressWarnings("PMD.NPathComplexity")
protected static void processAssigneeData(Feature feature, JSONObject assignee) {
if (assignee == null) {
return;
}
String key = getString(assignee, "key");
String name = getString(assignee, "name");
String displayName = ge... | java | @SuppressWarnings("PMD.NPathComplexity")
protected static void processAssigneeData(Feature feature, JSONObject assignee) {
if (assignee == null) {
return;
}
String key = getString(assignee, "key");
String name = getString(assignee, "name");
String displayName = ge... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.NPathComplexity\"",
")",
"protected",
"static",
"void",
"processAssigneeData",
"(",
"Feature",
"feature",
",",
"JSONObject",
"assignee",
")",
"{",
"if",
"(",
"assignee",
"==",
"null",
")",
"{",
"return",
";",
"}",
"String",
... | Process Assignee data for a feature, updating the passed in feature
@param feature
@param assignee | [
"Process",
"Assignee",
"data",
"for",
"a",
"feature",
"updating",
"the",
"passed",
"in",
"feature"
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/DefaultJiraClient.java#L602-L614 |
kaichunlin/android-transition | core/src/main/java/com/kaichunlin/transition/internal/TransitionControllerManager.java | TransitionControllerManager.addAnimatorAsTransition | public TransitionController addAnimatorAsTransition(@Nullable View target, @NonNull Animator animator) {
AnimatorSet as = new AnimatorSet();
as.play(animator);
return addAnimatorSetAsTransition(target, as);
} | java | public TransitionController addAnimatorAsTransition(@Nullable View target, @NonNull Animator animator) {
AnimatorSet as = new AnimatorSet();
as.play(animator);
return addAnimatorSetAsTransition(target, as);
} | [
"public",
"TransitionController",
"addAnimatorAsTransition",
"(",
"@",
"Nullable",
"View",
"target",
",",
"@",
"NonNull",
"Animator",
"animator",
")",
"{",
"AnimatorSet",
"as",
"=",
"new",
"AnimatorSet",
"(",
")",
";",
"as",
".",
"play",
"(",
"animator",
")",
... | Adds an Animator as {@link TransitionController}
@param target
@param animator
@return | [
"Adds",
"an",
"Animator",
"as",
"{",
"@link",
"TransitionController",
"}"
] | train | https://github.com/kaichunlin/android-transition/blob/7b53074206622f5cf5d82091d891a7ed8b9f06cd/core/src/main/java/com/kaichunlin/transition/internal/TransitionControllerManager.java#L53-L57 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.beginGetNetworkConfigurationDiagnostic | public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) {
return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, param... | java | public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) {
return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, param... | [
"public",
"NetworkConfigurationDiagnosticResponseInner",
"beginGetNetworkConfigurationDiagnostic",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"NetworkConfigurationDiagnosticParameters",
"parameters",
")",
"{",
"return",
"beginGetNetworkConfigurationDi... | Get network configuration diagnostic.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param parameters Parameters to get network configuration diagnostic.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponse... | [
"Get",
"network",
"configuration",
"diagnostic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersInner.java#L2732-L2734 |
cdk/cdk | tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java | InChITautomerGenerator.mapInputMoleculeToInchiMolgraph | private void mapInputMoleculeToInchiMolgraph(IAtomContainer inchiMolGraph, IAtomContainer mol) throws CDKException {
Iterator<Map<IAtom, IAtom>> iter = org.openscience.cdk.isomorphism.VentoFoggia.findIdentical(inchiMolGraph,
... | java | private void mapInputMoleculeToInchiMolgraph(IAtomContainer inchiMolGraph, IAtomContainer mol) throws CDKException {
Iterator<Map<IAtom, IAtom>> iter = org.openscience.cdk.isomorphism.VentoFoggia.findIdentical(inchiMolGraph,
... | [
"private",
"void",
"mapInputMoleculeToInchiMolgraph",
"(",
"IAtomContainer",
"inchiMolGraph",
",",
"IAtomContainer",
"mol",
")",
"throws",
"CDKException",
"{",
"Iterator",
"<",
"Map",
"<",
"IAtom",
",",
"IAtom",
">",
">",
"iter",
"=",
"org",
".",
"openscience",
... | Atom-atom mapping of the input molecule to the bare container constructed from the InChI connection table.
This makes it possible to map the positions of the mobile hydrogens in the InChI back to the input molecule.
@param inchiMolGraph molecule (bare) as defined in InChI
@param mol user input molecule
@throws CDKExcep... | [
"Atom",
"-",
"atom",
"mapping",
"of",
"the",
"input",
"molecule",
"to",
"the",
"bare",
"container",
"constructed",
"from",
"the",
"InChI",
"connection",
"table",
".",
"This",
"makes",
"it",
"possible",
"to",
"map",
"the",
"positions",
"of",
"the",
"mobile",
... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java#L322-L342 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginResetVpnClientSharedKey | public void beginResetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) {
beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body();
} | java | public void beginResetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) {
beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body();
} | [
"public",
"void",
"beginResetVpnClientSharedKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"beginResetVpnClientSharedKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayName",
")",
".",
"toBlocking",
... | Resets the VPN client shared key of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExce... | [
"Resets",
"the",
"VPN",
"client",
"shared",
"key",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java#L1537-L1539 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/FloatField.java | FloatField.getSQLType | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties)
{
String strType = (String)properties.get(DBSQLTypes.FLOAT);
if (strType == null)
strType = DBSQLTypes.FLOAT; // The default SQL Type (Byte)
return strType; // The default SQL Type
} | java | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties)
{
String strType = (String)properties.get(DBSQLTypes.FLOAT);
if (strType == null)
strType = DBSQLTypes.FLOAT; // The default SQL Type (Byte)
return strType; // The default SQL Type
} | [
"public",
"String",
"getSQLType",
"(",
"boolean",
"bIncludeLength",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"strType",
"=",
"(",
"String",
")",
"properties",
".",
"get",
"(",
"DBSQLTypes",
".",
"FLOAT",
")",
";",
... | Get the SQL type of this field.
Typically FLOAT.
@param bIncludeLength Include the field length in this description.
@param properties Database properties to determine the SQL type. | [
"Get",
"the",
"SQL",
"type",
"of",
"this",
"field",
".",
"Typically",
"FLOAT",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/FloatField.java#L315-L321 |
dadoonet/fscrawler | framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/FsCrawlerUtil.java | FsCrawlerUtil.isIndexable | public static boolean isIndexable(String content, List<String> filters) {
if (isNullOrEmpty(content)) {
logger.trace("Null or empty content always matches.");
return true;
}
if (filters == null || filters.isEmpty()) {
logger.trace("No pattern always matches."... | java | public static boolean isIndexable(String content, List<String> filters) {
if (isNullOrEmpty(content)) {
logger.trace("Null or empty content always matches.");
return true;
}
if (filters == null || filters.isEmpty()) {
logger.trace("No pattern always matches."... | [
"public",
"static",
"boolean",
"isIndexable",
"(",
"String",
"content",
",",
"List",
"<",
"String",
">",
"filters",
")",
"{",
"if",
"(",
"isNullOrEmpty",
"(",
"content",
")",
")",
"{",
"logger",
".",
"trace",
"(",
"\"Null or empty content always matches.\"",
"... | We check if we can index the content or skip it
@param content Content to parse
@param filters regular expressions that all needs to match if we want to index. If empty
we consider it always matches. | [
"We",
"check",
"if",
"we",
"can",
"index",
"the",
"content",
"or",
"skip",
"it"
] | train | https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/FsCrawlerUtil.java#L258-L282 |
cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/BeamToCDK.java | BeamToCDK.findDirectionalEdge | private Edge findDirectionalEdge(Graph g, int u) {
List<Edge> edges = g.edges(u);
if (edges.size() == 1)
return null;
Edge first = null;
for (Edge e : edges) {
Bond b = e.bond();
if (b == Bond.UP || b == Bond.DOWN) {
if (first == null)
... | java | private Edge findDirectionalEdge(Graph g, int u) {
List<Edge> edges = g.edges(u);
if (edges.size() == 1)
return null;
Edge first = null;
for (Edge e : edges) {
Bond b = e.bond();
if (b == Bond.UP || b == Bond.DOWN) {
if (first == null)
... | [
"private",
"Edge",
"findDirectionalEdge",
"(",
"Graph",
"g",
",",
"int",
"u",
")",
"{",
"List",
"<",
"Edge",
">",
"edges",
"=",
"g",
".",
"edges",
"(",
"u",
")",
";",
"if",
"(",
"edges",
".",
"size",
"(",
")",
"==",
"1",
")",
"return",
"null",
... | Utility for find the first directional edge incident to a vertex. If
there are no directional labels then null is returned.
@param g graph from Beam
@param u the vertex for which to find
@return first directional edge (or null if none) | [
"Utility",
"for",
"find",
"the",
"first",
"directional",
"edge",
"incident",
"to",
"a",
"vertex",
".",
"If",
"there",
"are",
"no",
"directional",
"labels",
"then",
"null",
"is",
"returned",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/BeamToCDK.java#L419-L434 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java | ServicesInner.beginUpdateAsync | public Observable<DataMigrationServiceInner> beginUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) {
return beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1<ServiceResponse<DataMigrationServiceInner>, DataMigrationServiceInner>() {
... | java | public Observable<DataMigrationServiceInner> beginUpdateAsync(String groupName, String serviceName, DataMigrationServiceInner parameters) {
return beginUpdateWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1<ServiceResponse<DataMigrationServiceInner>, DataMigrationServiceInner>() {
... | [
"public",
"Observable",
"<",
"DataMigrationServiceInner",
">",
"beginUpdateAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"DataMigrationServiceInner",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"groupName",
",",
"... | Create or update DMS Service Instance.
The services resource is the top-level resource that represents the Data Migration Service. The PATCH method updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are currently running (i.e. the service is busy), this will fail... | [
"Create",
"or",
"update",
"DMS",
"Service",
"Instance",
".",
"The",
"services",
"resource",
"is",
"the",
"top",
"-",
"level",
"resource",
"that",
"represents",
"the",
"Data",
"Migration",
"Service",
".",
"The",
"PATCH",
"method",
"updates",
"an",
"existing",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L871-L878 |
vlingo/vlingo-wire | src/main/java/io/vlingo/wire/message/Converters.java | Converters.toRawMessage | public static RawMessage toRawMessage(final short sendingNodeId, final ByteBuffer buffer) {
buffer.flip();
final RawMessage message = new RawMessage(buffer.limit());
message.put(buffer, false);
buffer.clear();
final RawMessageHeader header = new RawMessageHeader(sendingNodeId, (short) 0, (short)... | java | public static RawMessage toRawMessage(final short sendingNodeId, final ByteBuffer buffer) {
buffer.flip();
final RawMessage message = new RawMessage(buffer.limit());
message.put(buffer, false);
buffer.clear();
final RawMessageHeader header = new RawMessageHeader(sendingNodeId, (short) 0, (short)... | [
"public",
"static",
"RawMessage",
"toRawMessage",
"(",
"final",
"short",
"sendingNodeId",
",",
"final",
"ByteBuffer",
"buffer",
")",
"{",
"buffer",
".",
"flip",
"(",
")",
";",
"final",
"RawMessage",
"message",
"=",
"new",
"RawMessage",
"(",
"buffer",
".",
"l... | Uses buffer.flip() and then buffer.clear()
@param sendingNodeId short
@param buffer ByteBuffer
@return RawMessage | [
"Uses",
"buffer",
".",
"flip",
"()",
"and",
"then",
"buffer",
".",
"clear",
"()"
] | train | https://github.com/vlingo/vlingo-wire/blob/3980e3b257ddfb80a6ccae7f60cb67d7f53560c4/src/main/java/io/vlingo/wire/message/Converters.java#L34-L48 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/DeleteQuery.java | DeleteQuery.exec | @Override
public void exec(Result<Object> result, Object ...args)
{
TableKelp tableKelp = _table.getTableKelp();
RowCursor minCursor = tableKelp.cursor();
RowCursor maxCursor = tableKelp.cursor();
minCursor.clear();
maxCursor.setKeyMax();
_keyExpr.fillMinCursor(minCursor, args... | java | @Override
public void exec(Result<Object> result, Object ...args)
{
TableKelp tableKelp = _table.getTableKelp();
RowCursor minCursor = tableKelp.cursor();
RowCursor maxCursor = tableKelp.cursor();
minCursor.clear();
maxCursor.setKeyMax();
_keyExpr.fillMinCursor(minCursor, args... | [
"@",
"Override",
"public",
"void",
"exec",
"(",
"Result",
"<",
"Object",
">",
"result",
",",
"Object",
"...",
"args",
")",
"{",
"TableKelp",
"tableKelp",
"=",
"_table",
".",
"getTableKelp",
"(",
")",
";",
"RowCursor",
"minCursor",
"=",
"tableKelp",
".",
... | /*
@Override
public int partitionHash(Object[] args)
{
if (_keyExpr == null) {
return -1;
}
return _keyExpr.partitionHash(args);
} | [
"/",
"*",
"@Override",
"public",
"int",
"partitionHash",
"(",
"Object",
"[]",
"args",
")",
"{",
"if",
"(",
"_keyExpr",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/DeleteQuery.java#L97-L129 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetectorPixel.java | BinaryEllipseDetectorPixel.undistortContour | void undistortContour(List<Point2D_I32> external, FastQueue<Point2D_F64> pointsF ) {
for (int j = 0; j < external.size(); j++) {
Point2D_I32 p = external.get(j);
if( distToUndist != null ) {
distToUndist.compute(p.x,p.y,distortedPoint);
pointsF.grow().set( distortedPoint.x , distortedPoint.y );
} el... | java | void undistortContour(List<Point2D_I32> external, FastQueue<Point2D_F64> pointsF ) {
for (int j = 0; j < external.size(); j++) {
Point2D_I32 p = external.get(j);
if( distToUndist != null ) {
distToUndist.compute(p.x,p.y,distortedPoint);
pointsF.grow().set( distortedPoint.x , distortedPoint.y );
} el... | [
"void",
"undistortContour",
"(",
"List",
"<",
"Point2D_I32",
">",
"external",
",",
"FastQueue",
"<",
"Point2D_F64",
">",
"pointsF",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"external",
".",
"size",
"(",
")",
";",
"j",
"++",
")",
"... | Undistort the contour points and convert into a floating point format for the fitting operation
@param external The external contour
@param pointsF Output of converted points | [
"Undistort",
"the",
"contour",
"points",
"and",
"convert",
"into",
"a",
"floating",
"point",
"format",
"for",
"the",
"fitting",
"operation"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/BinaryEllipseDetectorPixel.java#L239-L250 |
apache/reef | lang/java/reef-examples/src/main/java/org/apache/reef/examples/scheduler/driver/http/SchedulerHttpHandler.java | SchedulerHttpHandler.onHttpRequest | @Override
public void onHttpRequest(final ParsedHttpRequest request, final HttpServletResponse response)
throws IOException, ServletException {
final String target = request.getTargetEntity().toLowerCase();
final Map<String, List<String>> queryMap = request.getQueryMap();
final SchedulerResponse re... | java | @Override
public void onHttpRequest(final ParsedHttpRequest request, final HttpServletResponse response)
throws IOException, ServletException {
final String target = request.getTargetEntity().toLowerCase();
final Map<String, List<String>> queryMap = request.getQueryMap();
final SchedulerResponse re... | [
"@",
"Override",
"public",
"void",
"onHttpRequest",
"(",
"final",
"ParsedHttpRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"final",
"String",
"target",
"=",
"request",
".",
"getTarge... | HttpRequest handler. You must specify UriSpecification and API version.
The request url is http://{address}:{port}/scheduler/v1
APIs
/list to get the status list for all tasks
/status?id={id} to query the status of such a task, given id
/submit?cmd={cmd} to submit a Task, which returns its id
/c... | [
"HttpRequest",
"handler",
".",
"You",
"must",
"specify",
"UriSpecification",
"and",
"API",
"version",
".",
"The",
"request",
"url",
"is",
"http",
":",
"//",
"{",
"address",
"}",
":",
"{",
"port",
"}",
"/",
"scheduler",
"/",
"v1"
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples/src/main/java/org/apache/reef/examples/scheduler/driver/http/SchedulerHttpHandler.java#L70-L109 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByFirstName | public Iterable<DUser> queryByFirstName(java.lang.String firstName) {
return queryByField(null, DUserMapper.Field.FIRSTNAME.getFieldName(), firstName);
} | java | public Iterable<DUser> queryByFirstName(java.lang.String firstName) {
return queryByField(null, DUserMapper.Field.FIRSTNAME.getFieldName(), firstName);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByFirstName",
"(",
"java",
".",
"lang",
".",
"String",
"firstName",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"FIRSTNAME",
".",
"getFieldName",
"(",
")",
",",
"fir... | query-by method for field firstName
@param firstName the specified attribute
@return an Iterable of DUsers for the specified firstName | [
"query",
"-",
"by",
"method",
"for",
"field",
"firstName"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L151-L153 |
btrplace/scheduler | json/src/main/java/org/btrplace/json/JSONs.java | JSONs.requiredNodes | public static List<Node> requiredNodes(Model mo, JSONObject o, String id) throws JSONConverterException {
checkKeys(o, id);
Object x = o.get(id);
if (!(x instanceof JSONArray)) {
throw new JSONConverterException("integers expected at key '" + id + "'");
}
return nodes... | java | public static List<Node> requiredNodes(Model mo, JSONObject o, String id) throws JSONConverterException {
checkKeys(o, id);
Object x = o.get(id);
if (!(x instanceof JSONArray)) {
throw new JSONConverterException("integers expected at key '" + id + "'");
}
return nodes... | [
"public",
"static",
"List",
"<",
"Node",
">",
"requiredNodes",
"(",
"Model",
"mo",
",",
"JSONObject",
"o",
",",
"String",
"id",
")",
"throws",
"JSONConverterException",
"{",
"checkKeys",
"(",
"o",
",",
"id",
")",
";",
"Object",
"x",
"=",
"o",
".",
"get... | Read an expected list of nodes.
@param mo the associated model to browse
@param o the object to parse
@param id the key in the map that points to the list
@return the parsed list
@throws JSONConverterException if the key does not point to a list of nodes identifiers | [
"Read",
"an",
"expected",
"list",
"of",
"nodes",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/JSONs.java#L281-L288 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.varargs | public Binder varargs(int index, Class<?> type) {
return new Binder(this, new Varargs(type(), index, type));
} | java | public Binder varargs(int index, Class<?> type) {
return new Binder(this, new Varargs(type(), index, type));
} | [
"public",
"Binder",
"varargs",
"(",
"int",
"index",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"new",
"Binder",
"(",
"this",
",",
"new",
"Varargs",
"(",
"type",
"(",
")",
",",
"index",
",",
"type",
")",
")",
";",
"}"
] | Box all incoming arguments from the given position onward into the given array type.
This version accepts a variable number of incoming arguments.
@param index the index from which to start boxing args
@param type the array type into which the args will be boxed
@return a new Binder | [
"Box",
"all",
"incoming",
"arguments",
"from",
"the",
"given",
"position",
"onward",
"into",
"the",
"given",
"array",
"type",
".",
"This",
"version",
"accepts",
"a",
"variable",
"number",
"of",
"incoming",
"arguments",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L903-L905 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.