repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
pippo-java/pippo | pippo-controller-parent/pippo-controller/src/main/java/ro/pippo/controller/ControllerRegistry.java | ControllerRegistry.registerControllerMethods | private void registerControllerMethods(Map<Method, Class<? extends Annotation>> controllerMethods, Controller controller) {
"""
Register the controller methods as routes.
@param controllerMethods
@param controller
"""
List<Route> controllerRoutes = createControllerRoutes(controllerMethods);
... | java | private void registerControllerMethods(Map<Method, Class<? extends Annotation>> controllerMethods, Controller controller) {
List<Route> controllerRoutes = createControllerRoutes(controllerMethods);
for (Route controllerRoute : controllerRoutes) {
if (controller != null) {
((C... | [
"private",
"void",
"registerControllerMethods",
"(",
"Map",
"<",
"Method",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
">",
"controllerMethods",
",",
"Controller",
"controller",
")",
"{",
"List",
"<",
"Route",
">",
"controllerRoutes",
"=",
"createContr... | Register the controller methods as routes.
@param controllerMethods
@param controller | [
"Register",
"the",
"controller",
"methods",
"as",
"routes",
"."
] | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-controller-parent/pippo-controller/src/main/java/ro/pippo/controller/ControllerRegistry.java#L162-L172 |
pagehelper/Mybatis-PageHelper | src/main/java/com/github/pagehelper/util/ExecutorUtil.java | ExecutorUtil.pageQuery | public static <E> List<E> pageQuery(Dialect dialect, Executor executor, MappedStatement ms, Object parameter,
RowBounds rowBounds, ResultHandler resultHandler,
BoundSql boundSql, CacheKey cacheKey) throws SQLException {
"""
分页查询
@param dialect
... | java | public static <E> List<E> pageQuery(Dialect dialect, Executor executor, MappedStatement ms, Object parameter,
RowBounds rowBounds, ResultHandler resultHandler,
BoundSql boundSql, CacheKey cacheKey) throws SQLException {
//判断是否需要进行分页查询
if... | [
"public",
"static",
"<",
"E",
">",
"List",
"<",
"E",
">",
"pageQuery",
"(",
"Dialect",
"dialect",
",",
"Executor",
"executor",
",",
"MappedStatement",
"ms",
",",
"Object",
"parameter",
",",
"RowBounds",
"rowBounds",
",",
"ResultHandler",
"resultHandler",
",",
... | 分页查询
@param dialect
@param executor
@param ms
@param parameter
@param rowBounds
@param resultHandler
@param boundSql
@param cacheKey
@param <E>
@return
@throws SQLException | [
"分页查询"
] | train | https://github.com/pagehelper/Mybatis-PageHelper/blob/319750fd47cf75328ff321f38125fa15e954e60f/src/main/java/com/github/pagehelper/util/ExecutorUtil.java#L158-L182 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java | BaseNeo4jAssociationQueries.initCreateRelationshipQuery | private static String initCreateRelationshipQuery(EntityKeyMetadata ownerEntityKeyMetadata, AssociationKeyMetadata associationKeyMetadata) {
"""
/*
MATCH (o:ENTITY:table1 {id: {0}}), (t:ENTITY:table2 {id: {1}})
MERGE (o) -[r:role {props}]-> (t)
RETURN r
"""
EntityKeyMetadata targetEntityKeyMetadata = asso... | java | private static String initCreateRelationshipQuery(EntityKeyMetadata ownerEntityKeyMetadata, AssociationKeyMetadata associationKeyMetadata) {
EntityKeyMetadata targetEntityKeyMetadata = associationKeyMetadata.getAssociatedEntityKeyMetadata().getEntityKeyMetadata();
int offset = 0;
StringBuilder queryBuilder = new ... | [
"private",
"static",
"String",
"initCreateRelationshipQuery",
"(",
"EntityKeyMetadata",
"ownerEntityKeyMetadata",
",",
"AssociationKeyMetadata",
"associationKeyMetadata",
")",
"{",
"EntityKeyMetadata",
"targetEntityKeyMetadata",
"=",
"associationKeyMetadata",
".",
"getAssociatedEnt... | /*
MATCH (o:ENTITY:table1 {id: {0}}), (t:ENTITY:table2 {id: {1}})
MERGE (o) -[r:role {props}]-> (t)
RETURN r | [
"/",
"*",
"MATCH",
"(",
"o",
":",
"ENTITY",
":",
"table1",
"{",
"id",
":",
"{",
"0",
"}}",
")",
"(",
"t",
":",
"ENTITY",
":",
"table2",
"{",
"id",
":",
"{",
"1",
"}}",
")",
"MERGE",
"(",
"o",
")",
"-",
"[",
"r",
":",
"role",
"{",
"props",... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java#L110-L130 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java | MetricUtils.metricName | public static String metricName(String type, String topologyId, String componentId, int taskId, String streamId, String group, String name) {
"""
a metric name composites of: type@topologyId@componentId@taskId@streamId@group@name for non-worker metrics
OR type@topologyId@host@port@group@name for worker metrics
... | java | public static String metricName(String type, String topologyId, String componentId, int taskId, String streamId, String group, String name) {
return concat(type, topologyId, componentId, taskId, streamId, group, name);
} | [
"public",
"static",
"String",
"metricName",
"(",
"String",
"type",
",",
"String",
"topologyId",
",",
"String",
"componentId",
",",
"int",
"taskId",
",",
"String",
"streamId",
",",
"String",
"group",
",",
"String",
"name",
")",
"{",
"return",
"concat",
"(",
... | a metric name composites of: type@topologyId@componentId@taskId@streamId@group@name for non-worker metrics
OR type@topologyId@host@port@group@name for worker metrics | [
"a",
"metric",
"name",
"composites",
"of",
":",
"type"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/metric/MetricUtils.java#L93-L95 |
belaban/JGroups | src/org/jgroups/blocks/MessageDispatcher.java | MessageDispatcher.sendMessage | public <T> T sendMessage(Address dest, Buffer data, RequestOptions opts) throws Exception {
"""
Sends a unicast message and - depending on the options - returns a result
@param dest the target to which to send the unicast message. Must not be null.
@param data the payload to send
@param opts the options to be u... | java | public <T> T sendMessage(Address dest, Buffer data, RequestOptions opts) throws Exception {
if(dest == null)
throw new IllegalArgumentException("message destination is null, cannot send message");
if(opts == null) {
log.warn("request options were null, using default of sync");
... | [
"public",
"<",
"T",
">",
"T",
"sendMessage",
"(",
"Address",
"dest",
",",
"Buffer",
"data",
",",
"RequestOptions",
"opts",
")",
"throws",
"Exception",
"{",
"if",
"(",
"dest",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"message dest... | Sends a unicast message and - depending on the options - returns a result
@param dest the target to which to send the unicast message. Must not be null.
@param data the payload to send
@param opts the options to be used
@return T the result. Null if the call is asynchronous (non-blocking) or if the response is null
@th... | [
"Sends",
"a",
"unicast",
"message",
"and",
"-",
"depending",
"on",
"the",
"options",
"-",
"returns",
"a",
"result"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/blocks/MessageDispatcher.java#L358-L384 |
etourdot/xincproc | xinclude/src/main/java/org/etourdot/xincproc/xinclude/sax/XIncludeContext.java | XIncludeContext.addInInclusionChain | public void addInInclusionChain(final URI path, final String pointer)
throws XIncludeFatalException {
"""
Add in inclusion chain.
@param path the path
@param pointer the pointer
@throws XIncludeFatalException the x include fatal exception
"""
final String xincludePath = path.toASCIIStr... | java | public void addInInclusionChain(final URI path, final String pointer)
throws XIncludeFatalException
{
final String xincludePath = path.toASCIIString() + ((null != pointer) ? ('#' + pointer) : "");
if (this.xincludeDeque.contains(xincludePath))
{
throw new XIncludeFata... | [
"public",
"void",
"addInInclusionChain",
"(",
"final",
"URI",
"path",
",",
"final",
"String",
"pointer",
")",
"throws",
"XIncludeFatalException",
"{",
"final",
"String",
"xincludePath",
"=",
"path",
".",
"toASCIIString",
"(",
")",
"+",
"(",
"(",
"null",
"!=",
... | Add in inclusion chain.
@param path the path
@param pointer the pointer
@throws XIncludeFatalException the x include fatal exception | [
"Add",
"in",
"inclusion",
"chain",
"."
] | train | https://github.com/etourdot/xincproc/blob/6e9e9352e1975957ae6821a04c248ea49c7323ec/xinclude/src/main/java/org/etourdot/xincproc/xinclude/sax/XIncludeContext.java#L174-L183 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/conductor/Conductor.java | Conductor.maybeMovePartition | @SuppressWarnings("unchecked")
void maybeMovePartition(final short partition) {
"""
Called by the {@link DcpChannel} to signal a stream end done by the server and it
most likely needs to be moved over to a new node during rebalance/failover.
@param partition the partition to move if needed
"""
Observ... | java | @SuppressWarnings("unchecked")
void maybeMovePartition(final short partition) {
Observable
.timer(50, TimeUnit.MILLISECONDS)
.filter(ignored -> {
PartitionState ps = sessionState.get(partition);
boolean desiredSeqnoReached = ps.isAtEnd();
if (desiredSeqnoReached) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"void",
"maybeMovePartition",
"(",
"final",
"short",
"partition",
")",
"{",
"Observable",
".",
"timer",
"(",
"50",
",",
"TimeUnit",
".",
"MILLISECONDS",
")",
".",
"filter",
"(",
"ignored",
"->",
"{",
"Parti... | Called by the {@link DcpChannel} to signal a stream end done by the server and it
most likely needs to be moved over to a new node during rebalance/failover.
@param partition the partition to move if needed | [
"Called",
"by",
"the",
"{",
"@link",
"DcpChannel",
"}",
"to",
"signal",
"a",
"stream",
"end",
"done",
"by",
"the",
"server",
"and",
"it",
"most",
"likely",
"needs",
"to",
"be",
"moved",
"over",
"to",
"a",
"new",
"node",
"during",
"rebalance",
"/",
"fai... | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/conductor/Conductor.java#L324-L375 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/CompareUtil.java | CompareUtil.elementIsContainedInList | public static <T> boolean elementIsContainedInList(T element, Collection<T> values) {
"""
Checks if the element is contained within the list of values.
@param element to check
@param values to check in
@param <T> the type of the element
@return {@code true} if the element and values are not {@code null} and ... | java | public static <T> boolean elementIsContainedInList(T element, Collection<T> values) {
if (element != null && values != null) {
return values.contains(element);
}
else {
return false;
}
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"elementIsContainedInList",
"(",
"T",
"element",
",",
"Collection",
"<",
"T",
">",
"values",
")",
"{",
"if",
"(",
"element",
"!=",
"null",
"&&",
"values",
"!=",
"null",
")",
"{",
"return",
"values",
".",
"c... | Checks if the element is contained within the list of values.
@param element to check
@param values to check in
@param <T> the type of the element
@return {@code true} if the element and values are not {@code null} and the values contain the element,
{@code false} otherwise | [
"Checks",
"if",
"the",
"element",
"is",
"contained",
"within",
"the",
"list",
"of",
"values",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/CompareUtil.java#L121-L128 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.getConnectAddress | public static InetSocketAddress getConnectAddress(ServiceType service,
AlluxioConfiguration conf) {
"""
Helper method to get the {@link InetSocketAddress} address for client to communicate with the
service.
@param service the service name used to connect
@param conf the configuration to use for looking ... | java | public static InetSocketAddress getConnectAddress(ServiceType service,
AlluxioConfiguration conf) {
return new InetSocketAddress(getConnectHost(service, conf), getPort(service, conf));
} | [
"public",
"static",
"InetSocketAddress",
"getConnectAddress",
"(",
"ServiceType",
"service",
",",
"AlluxioConfiguration",
"conf",
")",
"{",
"return",
"new",
"InetSocketAddress",
"(",
"getConnectHost",
"(",
"service",
",",
"conf",
")",
",",
"getPort",
"(",
"service",... | Helper method to get the {@link InetSocketAddress} address for client to communicate with the
service.
@param service the service name used to connect
@param conf the configuration to use for looking up the connect address
@return the service address that a client (typically outside the service machine) uses to
commun... | [
"Helper",
"method",
"to",
"get",
"the",
"{",
"@link",
"InetSocketAddress",
"}",
"address",
"for",
"client",
"to",
"communicate",
"with",
"the",
"service",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L236-L239 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/PeerGroup.java | PeerGroup.addDiscoveredEventListener | public void addDiscoveredEventListener(Executor executor, PeerDiscoveredEventListener listener) {
"""
<p>Adds a listener that will be notified on the given executor when new
peers are discovered.</p>
"""
peerDiscoveredEventListeners.add(new ListenerRegistration<>(checkNotNull(listener), executor));
... | java | public void addDiscoveredEventListener(Executor executor, PeerDiscoveredEventListener listener) {
peerDiscoveredEventListeners.add(new ListenerRegistration<>(checkNotNull(listener), executor));
} | [
"public",
"void",
"addDiscoveredEventListener",
"(",
"Executor",
"executor",
",",
"PeerDiscoveredEventListener",
"listener",
")",
"{",
"peerDiscoveredEventListeners",
".",
"add",
"(",
"new",
"ListenerRegistration",
"<>",
"(",
"checkNotNull",
"(",
"listener",
")",
",",
... | <p>Adds a listener that will be notified on the given executor when new
peers are discovered.</p> | [
"<p",
">",
"Adds",
"a",
"listener",
"that",
"will",
"be",
"notified",
"on",
"the",
"given",
"executor",
"when",
"new",
"peers",
"are",
"discovered",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/PeerGroup.java#L707-L709 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.deleteAsync | public Observable<Void> deleteAsync(String jobId, JobDeleteOptions jobDeleteOptions) {
"""
Deletes a job.
Deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides the retention period for task data; that is, if the job contains tasks which are still retained on ... | java | public Observable<Void> deleteAsync(String jobId, JobDeleteOptions jobDeleteOptions) {
return deleteWithServiceResponseAsync(jobId, jobDeleteOptions).map(new Func1<ServiceResponseWithHeaders<Void, JobDeleteHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHeaders<Void, Jo... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteAsync",
"(",
"String",
"jobId",
",",
"JobDeleteOptions",
"jobDeleteOptions",
")",
"{",
"return",
"deleteWithServiceResponseAsync",
"(",
"jobId",
",",
"jobDeleteOptions",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
... | Deletes a job.
Deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes, the Batch services deletes those tasks' working directories and all their contents... | [
"Deletes",
"a",
"job",
".",
"Deleting",
"a",
"job",
"also",
"deletes",
"all",
"tasks",
"that",
"are",
"part",
"of",
"that",
"job",
"and",
"all",
"job",
"statistics",
".",
"This",
"also",
"overrides",
"the",
"retention",
"period",
"for",
"task",
"data",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L488-L495 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/TimePicker.java | TimePicker.openPopup | public void openPopup() {
"""
openPopup, This creates and shows the menu popup.
This function creates a new menu panel and a new custom popup instance each time that it is
called. The associated object instances are automatically disposed and set to null when a
popup is closed.
"""
// If the compo... | java | public void openPopup() {
// If the component is disabled, do nothing.
if (!isEnabled()) {
return;
}
// If the show popup menu button is not shown, do nothing.
if (settings.getDisplayToggleTimeMenuButton() == false) {
return;
}
// If this f... | [
"public",
"void",
"openPopup",
"(",
")",
"{",
"// If the component is disabled, do nothing.",
"if",
"(",
"!",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"// If the show popup menu button is not shown, do nothing.",
"if",
"(",
"settings",
".",
"getDisplayToggle... | openPopup, This creates and shows the menu popup.
This function creates a new menu panel and a new custom popup instance each time that it is
called. The associated object instances are automatically disposed and set to null when a
popup is closed. | [
"openPopup",
"This",
"creates",
"and",
"shows",
"the",
"menu",
"popup",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/TimePicker.java#L528-L558 |
tvesalainen/util | rpm/src/main/java/org/vesalainen/pm/deb/DEBBuilder.java | DEBBuilder.addFile | @Override
public ComponentBuilder addFile(ByteBuffer content, String target) throws IOException {
"""
Add regular file to package.
@param content
@param target
@return
@throws IOException
"""
checkTarget(target);
FileBuilder fb = new FileBuilder(target, content);
fileBuilder... | java | @Override
public ComponentBuilder addFile(ByteBuffer content, String target) throws IOException
{
checkTarget(target);
FileBuilder fb = new FileBuilder(target, content);
fileBuilders.add(fb);
return fb;
} | [
"@",
"Override",
"public",
"ComponentBuilder",
"addFile",
"(",
"ByteBuffer",
"content",
",",
"String",
"target",
")",
"throws",
"IOException",
"{",
"checkTarget",
"(",
"target",
")",
";",
"FileBuilder",
"fb",
"=",
"new",
"FileBuilder",
"(",
"target",
",",
"con... | Add regular file to package.
@param content
@param target
@return
@throws IOException | [
"Add",
"regular",
"file",
"to",
"package",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/rpm/src/main/java/org/vesalainen/pm/deb/DEBBuilder.java#L377-L384 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java | ModeledUser.putRestrictedAttributes | private void putRestrictedAttributes(Map<String, String> attributes) {
"""
Stores all restricted (privileged) attributes within the given Map,
pulling the values of those attributes from the underlying user model.
If no value is yet defined for an attribute, that attribute will be set
to null.
@param attribu... | java | private void putRestrictedAttributes(Map<String, String> attributes) {
// Set disabled attribute
attributes.put(DISABLED_ATTRIBUTE_NAME, getModel().isDisabled() ? "true" : null);
// Set password expired attribute
attributes.put(EXPIRED_ATTRIBUTE_NAME, getModel().isExpired() ? "true" : ... | [
"private",
"void",
"putRestrictedAttributes",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"// Set disabled attribute",
"attributes",
".",
"put",
"(",
"DISABLED_ATTRIBUTE_NAME",
",",
"getModel",
"(",
")",
".",
"isDisabled",
"(",
")",
"?... | Stores all restricted (privileged) attributes within the given Map,
pulling the values of those attributes from the underlying user model.
If no value is yet defined for an attribute, that attribute will be set
to null.
@param attributes
The Map to store all restricted attributes within. | [
"Stores",
"all",
"restricted",
"(",
"privileged",
")",
"attributes",
"within",
"the",
"given",
"Map",
"pulling",
"the",
"values",
"of",
"those",
"attributes",
"from",
"the",
"underlying",
"user",
"model",
".",
"If",
"no",
"value",
"is",
"yet",
"defined",
"fo... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java#L304-L327 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java | BaseLexicon.addTagging | protected void addTagging(boolean seen, IntTaggedWord itw, double count) {
"""
Adds the tagging with count to the data structures in this Lexicon.
"""
if (seen) {
seenCounter.incrementCount(itw, count);
if (itw.tag() == nullTag) {
words.add(itw);
} else if (itw.word() == null... | java | protected void addTagging(boolean seen, IntTaggedWord itw, double count) {
if (seen) {
seenCounter.incrementCount(itw, count);
if (itw.tag() == nullTag) {
words.add(itw);
} else if (itw.word() == nullWord) {
tags.add(itw);
} else {
// rules.add(itw);
}
... | [
"protected",
"void",
"addTagging",
"(",
"boolean",
"seen",
",",
"IntTaggedWord",
"itw",
",",
"double",
"count",
")",
"{",
"if",
"(",
"seen",
")",
"{",
"seenCounter",
".",
"incrementCount",
"(",
"itw",
",",
"count",
")",
";",
"if",
"(",
"itw",
".",
"tag... | Adds the tagging with count to the data structures in this Lexicon. | [
"Adds",
"the",
"tagging",
"with",
"count",
"to",
"the",
"data",
"structures",
"in",
"this",
"Lexicon",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/BaseLexicon.java#L437-L453 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/Converter.java | Converter.setupDefaultView | public final ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, int iDisplayFieldDesc) // Add this view to the list {
"""
Set up the default control for this field.
Calls setupDefaultView with this as the converter (Convenience method).
@param itsLocation Location of this... | java | public final ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, int iDisplayFieldDesc) // Add this view to the list
{
return this.setupDefaultView(itsLocation, targetScreen, this, iDisplayFieldDesc, null);
} | [
"public",
"final",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"int",
"iDisplayFieldDesc",
")",
"// Add this view to the list",
"{",
"return",
"this",
".",
"setupDefaultView",
"(",
"itsLocation",
","... | Set up the default control for this field.
Calls setupDefaultView with this as the converter (Convenience method).
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param iDisplayFieldDesc... | [
"Set",
"up",
"the",
"default",
"control",
"for",
"this",
"field",
".",
"Calls",
"setupDefaultView",
"with",
"this",
"as",
"the",
"converter",
"(",
"Convenience",
"method",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/Converter.java#L354-L357 |
jglobus/JGlobus | io/src/main/java/org/globus/io/urlcopy/UrlCopy.java | UrlCopy.createFTPConnection | private FTPClient createFTPConnection(GlobusURL ftpURL, boolean srcSide)
throws Exception {
"""
Creates ftp connection based on the ftp url (secure vs. unsecure)
"""
String protocol = ftpURL.getProtocol();
if (protocol.equalsIgnoreCase("ftp")) {
FTPClient ftp = new FTPCli... | java | private FTPClient createFTPConnection(GlobusURL ftpURL, boolean srcSide)
throws Exception {
String protocol = ftpURL.getProtocol();
if (protocol.equalsIgnoreCase("ftp")) {
FTPClient ftp = new FTPClient(ftpURL.getHost(),
ftpURL.getPort());
... | [
"private",
"FTPClient",
"createFTPConnection",
"(",
"GlobusURL",
"ftpURL",
",",
"boolean",
"srcSide",
")",
"throws",
"Exception",
"{",
"String",
"protocol",
"=",
"ftpURL",
".",
"getProtocol",
"(",
")",
";",
"if",
"(",
"protocol",
".",
"equalsIgnoreCase",
"(",
... | Creates ftp connection based on the ftp url (secure vs. unsecure) | [
"Creates",
"ftp",
"connection",
"based",
"on",
"the",
"ftp",
"url",
"(",
"secure",
"vs",
".",
"unsecure",
")"
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/io/src/main/java/org/globus/io/urlcopy/UrlCopy.java#L834-L875 |
gilberto-torrezan/gwt-views | src/main/java/com/github/gilbertotorrezan/gwtviews/client/NavigationManager.java | NavigationManager.setInjectorInstance | public static <T> void setInjectorInstance(Class<T> injectorClass, T injectorInstance) {
"""
Sets the injector instance to be used internally by the framework to inject views. If an injector instance is not declared here,
a new instance is created every time a view is invoked.
@param injectorClass The class li... | java | public static <T> void setInjectorInstance(Class<T> injectorClass, T injectorInstance) {
if (injectorInstance == null){
injectorsMap.remove(injectorClass);
}
injectorsMap.put(injectorClass, injectorInstance);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"setInjectorInstance",
"(",
"Class",
"<",
"T",
">",
"injectorClass",
",",
"T",
"injectorInstance",
")",
"{",
"if",
"(",
"injectorInstance",
"==",
"null",
")",
"{",
"injectorsMap",
".",
"remove",
"(",
"injectorClass"... | Sets the injector instance to be used internally by the framework to inject views. If an injector instance is not declared here,
a new instance is created every time a view is invoked.
@param injectorClass The class literal of the injector.
@param injectorInstance The injector instance to be used.
@see View#injector(... | [
"Sets",
"the",
"injector",
"instance",
"to",
"be",
"used",
"internally",
"by",
"the",
"framework",
"to",
"inject",
"views",
".",
"If",
"an",
"injector",
"instance",
"is",
"not",
"declared",
"here",
"a",
"new",
"instance",
"is",
"created",
"every",
"time",
... | train | https://github.com/gilberto-torrezan/gwt-views/blob/c6511435d14b5aa93a722b0e861230d0ae2159e5/src/main/java/com/github/gilbertotorrezan/gwtviews/client/NavigationManager.java#L94-L99 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/util/ThreeDHashMap.java | ThreeDHashMap.containsKey | public boolean containsKey(final K1 firstKey, final K2 secondKey) {
"""
Existence check of a value (or <tt>null</tt>) mapped to the keys.
@param firstKey
first key
@param secondKey
second key
@return true when an element (or <tt>null</tt>) has been stored with the keys
"""
// existence check on inner ... | java | public boolean containsKey(final K1 firstKey, final K2 secondKey) {
// existence check on inner map
final HashMap<K2, HashMap<K3, V>> innerMap1 = map.get(firstKey);
if( innerMap1 == null ) {
return false;
}
return innerMap1.containsKey(secondKey);
} | [
"public",
"boolean",
"containsKey",
"(",
"final",
"K1",
"firstKey",
",",
"final",
"K2",
"secondKey",
")",
"{",
"// existence check on inner map",
"final",
"HashMap",
"<",
"K2",
",",
"HashMap",
"<",
"K3",
",",
"V",
">",
">",
"innerMap1",
"=",
"map",
".",
"g... | Existence check of a value (or <tt>null</tt>) mapped to the keys.
@param firstKey
first key
@param secondKey
second key
@return true when an element (or <tt>null</tt>) has been stored with the keys | [
"Existence",
"check",
"of",
"a",
"value",
"(",
"or",
"<tt",
">",
"null<",
"/",
"tt",
">",
")",
"mapped",
"to",
"the",
"keys",
"."
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/util/ThreeDHashMap.java#L49-L57 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java | BuildsInner.getAsync | public Observable<BuildInner> getAsync(String resourceGroupName, String registryName, String buildId) {
"""
Gets the detailed information for a given build.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
... | java | public Observable<BuildInner> getAsync(String resourceGroupName, String registryName, String buildId) {
return getWithServiceResponseAsync(resourceGroupName, registryName, buildId).map(new Func1<ServiceResponse<BuildInner>, BuildInner>() {
@Override
public BuildInner call(ServiceResponse... | [
"public",
"Observable",
"<",
"BuildInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"buildId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"buildId",
... | Gets the detailed information for a given build.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildId The build ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the ob... | [
"Gets",
"the",
"detailed",
"information",
"for",
"a",
"given",
"build",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java#L389-L396 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunctionFactory.java | DifferentialFunctionFactory.matchConditionCount | public SDVariable matchConditionCount(SDVariable in, Condition condition, boolean keepDims, int... dimensions) {
"""
Returns a count of the number of elements that satisfy the condition
@param in Input
@param condition Condition
@return Number of elements that the condition is satisfied for
"""
... | java | public SDVariable matchConditionCount(SDVariable in, Condition condition, boolean keepDims, int... dimensions) {
return new MatchCondition(sameDiff(), in, condition, keepDims, dimensions).outputVariable();
} | [
"public",
"SDVariable",
"matchConditionCount",
"(",
"SDVariable",
"in",
",",
"Condition",
"condition",
",",
"boolean",
"keepDims",
",",
"int",
"...",
"dimensions",
")",
"{",
"return",
"new",
"MatchCondition",
"(",
"sameDiff",
"(",
")",
",",
"in",
",",
"conditi... | Returns a count of the number of elements that satisfy the condition
@param in Input
@param condition Condition
@return Number of elements that the condition is satisfied for | [
"Returns",
"a",
"count",
"of",
"the",
"number",
"of",
"elements",
"that",
"satisfy",
"the",
"condition"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunctionFactory.java#L712-L714 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Widgets.java | Widgets.newScrollPanel | public static ScrollPanel newScrollPanel (Widget contents, int xpad, int ypad) {
"""
Wraps the supplied contents in a scroll panel that will set the max-width to
Window.getClientWidth()-xpad and the max-height to Window.getClientHeight()-ypad. If either
xpad or ypad are less than zero, the max-size attribute on ... | java | public static ScrollPanel newScrollPanel (Widget contents, int xpad, int ypad)
{
ScrollPanel panel = new ScrollPanel(contents);
if (xpad >= 0) {
String maxWidth = (Window.getClientWidth() - xpad) + "px";
DOM.setStyleAttribute(panel.getElement(), "maxWidth", maxWidth);
... | [
"public",
"static",
"ScrollPanel",
"newScrollPanel",
"(",
"Widget",
"contents",
",",
"int",
"xpad",
",",
"int",
"ypad",
")",
"{",
"ScrollPanel",
"panel",
"=",
"new",
"ScrollPanel",
"(",
"contents",
")",
";",
"if",
"(",
"xpad",
">=",
"0",
")",
"{",
"Strin... | Wraps the supplied contents in a scroll panel that will set the max-width to
Window.getClientWidth()-xpad and the max-height to Window.getClientHeight()-ypad. If either
xpad or ypad are less than zero, the max-size attribute on that axis will not be set. | [
"Wraps",
"the",
"supplied",
"contents",
"in",
"a",
"scroll",
"panel",
"that",
"will",
"set",
"the",
"max",
"-",
"width",
"to",
"Window",
".",
"getClientWidth",
"()",
"-",
"xpad",
"and",
"the",
"max",
"-",
"height",
"to",
"Window",
".",
"getClientHeight",
... | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L102-L114 |
baratine/baratine | web/src/main/java/com/caucho/v5/io/i18n/Encoding.java | Encoding.getReadEncoding | public static Reader getReadEncoding(InputStream is, String encoding)
throws UnsupportedEncodingException {
"""
Returns a Reader to translate bytes to characters. If a specialized
reader exists in com.caucho.v5.vfs.i18n, use it.
@param is the input stream.
@param encoding the encoding name.
@return a ... | java | public static Reader getReadEncoding(InputStream is, String encoding)
throws UnsupportedEncodingException
{
return getReadFactory(encoding).create(is);
} | [
"public",
"static",
"Reader",
"getReadEncoding",
"(",
"InputStream",
"is",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"getReadFactory",
"(",
"encoding",
")",
".",
"create",
"(",
"is",
")",
";",
"}"
] | Returns a Reader to translate bytes to characters. If a specialized
reader exists in com.caucho.v5.vfs.i18n, use it.
@param is the input stream.
@param encoding the encoding name.
@return a reader for the translation | [
"Returns",
"a",
"Reader",
"to",
"translate",
"bytes",
"to",
"characters",
".",
"If",
"a",
"specialized",
"reader",
"exists",
"in",
"com",
".",
"caucho",
".",
"v5",
".",
"vfs",
".",
"i18n",
"use",
"it",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/i18n/Encoding.java#L121-L125 |
requery/requery | requery/src/main/java/io/requery/sql/SchemaModifier.java | SchemaModifier.createTables | public void createTables(Connection connection, TableCreationMode mode, boolean createIndexes) {
"""
Create the tables over the connection.
@param connection to use
@param mode creation mode.
@param createIndexes true to also create indexes, false otherwise
"""
ArrayList<Type<?>> sorted = sortType... | java | public void createTables(Connection connection, TableCreationMode mode, boolean createIndexes) {
ArrayList<Type<?>> sorted = sortTypes();
try (Statement statement = connection.createStatement()) {
if (mode == TableCreationMode.DROP_CREATE) {
ArrayList<Type<?>> reversed = sort... | [
"public",
"void",
"createTables",
"(",
"Connection",
"connection",
",",
"TableCreationMode",
"mode",
",",
"boolean",
"createIndexes",
")",
"{",
"ArrayList",
"<",
"Type",
"<",
"?",
">",
">",
"sorted",
"=",
"sortTypes",
"(",
")",
";",
"try",
"(",
"Statement",
... | Create the tables over the connection.
@param connection to use
@param mode creation mode.
@param createIndexes true to also create indexes, false otherwise | [
"Create",
"the",
"tables",
"over",
"the",
"connection",
"."
] | train | https://github.com/requery/requery/blob/3070590c2ef76bb7062570bf9df03cd482db024a/requery/src/main/java/io/requery/sql/SchemaModifier.java#L142-L164 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/util/Memory.java | Memory.setBytes | public void setBytes(long memoryOffset, byte[] buffer, int bufferOffset, int count) {
"""
Transfers count bytes from buffer to Memory
@param memoryOffset start offset in the memory
@param buffer the data buffer
@param bufferOffset start offset of the buffer
@param count number of bytes to transfer
"""
... | java | public void setBytes(long memoryOffset, byte[] buffer, int bufferOffset, int count)
{
if (buffer == null)
throw new NullPointerException();
else if (bufferOffset < 0
|| count < 0
|| bufferOffset + count > buffer.length)
throw new IndexOutOfBo... | [
"public",
"void",
"setBytes",
"(",
"long",
"memoryOffset",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"bufferOffset",
",",
"int",
"count",
")",
"{",
"if",
"(",
"buffer",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"else",
... | Transfers count bytes from buffer to Memory
@param memoryOffset start offset in the memory
@param buffer the data buffer
@param bufferOffset start offset of the buffer
@param count number of bytes to transfer | [
"Transfers",
"count",
"bytes",
"from",
"buffer",
"to",
"Memory"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/util/Memory.java#L224-L239 |
agmip/agmip-common-functions | src/main/java/org/agmip/functions/PTSaxton2006.java | PTSaxton2006.calcNormalDensity | public static String calcNormalDensity(String slsnd, String slcly, String omPct) {
"""
Equation 6 for calculating Normal density, g/cm-3
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentage by layer ([0,10... | java | public static String calcNormalDensity(String slsnd, String slcly, String omPct) {
String satMt = calcSaturatedMoisture(slsnd, slcly, omPct);
String ret = product(substract("100", satMt), "0.0265");
LOG.debug("Calculate result for Normal density, g/cm-3 is {}", ret);
return ret;
} | [
"public",
"static",
"String",
"calcNormalDensity",
"(",
"String",
"slsnd",
",",
"String",
"slcly",
",",
"String",
"omPct",
")",
"{",
"String",
"satMt",
"=",
"calcSaturatedMoisture",
"(",
"slsnd",
",",
"slcly",
",",
"omPct",
")",
";",
"String",
"ret",
"=",
... | Equation 6 for calculating Normal density, g/cm-3
@param slsnd Sand weight percentage by layer ([0,100]%)
@param slcly Clay weight percentage by layer ([0,100]%)
@param omPct Organic matter weight percentage by layer ([0,100]%), (=
SLOC * 1.72) | [
"Equation",
"6",
"for",
"calculating",
"Normal",
"density",
"g",
"/",
"cm",
"-",
"3"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/functions/PTSaxton2006.java#L225-L232 |
aol/cyclops | cyclops/src/main/java/cyclops/companion/Streams.java | Streams.takeWhile | public static <U> Stream<U> takeWhile(final Stream<U> stream, final Predicate<? super U> predicate) {
"""
Take elements from a stream while the predicates hold
<pre>
{@code Streams.takeWhile(Stream.of(4,3,6,7).sorted(),i->i<6).collect(CyclopsCollectors.toList());
//[4,3]
}
</pre>
@param stream
@param predic... | java | public static <U> Stream<U> takeWhile(final Stream<U> stream, final Predicate<? super U> predicate) {
return StreamSupport.stream(new LimitWhileSpliterator<>(stream.spliterator(), predicate),stream.isParallel());
} | [
"public",
"static",
"<",
"U",
">",
"Stream",
"<",
"U",
">",
"takeWhile",
"(",
"final",
"Stream",
"<",
"U",
">",
"stream",
",",
"final",
"Predicate",
"<",
"?",
"super",
"U",
">",
"predicate",
")",
"{",
"return",
"StreamSupport",
".",
"stream",
"(",
"n... | Take elements from a stream while the predicates hold
<pre>
{@code Streams.takeWhile(Stream.of(4,3,6,7).sorted(),i->i<6).collect(CyclopsCollectors.toList());
//[4,3]
}
</pre>
@param stream
@param predicate
@return | [
"Take",
"elements",
"from",
"a",
"stream",
"while",
"the",
"predicates",
"hold",
"<pre",
">",
"{"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/companion/Streams.java#L1292-L1294 |
deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/NDArrayMessage.java | NDArrayMessage.fromBuffer | public static NDArrayMessage fromBuffer(DirectBuffer buffer, int offset) {
"""
Convert a direct buffer to an ndarray
message.
The format of the byte buffer is:
ndarray
time
index
dimension length
dimensions
We use {@link AeronNDArraySerde#toArrayAndByteBuffer(DirectBuffer, int)}
to read in the ndarray a... | java | public static NDArrayMessage fromBuffer(DirectBuffer buffer, int offset) {
//skip the message opType
Pair<INDArray, ByteBuffer> pair = AeronNDArraySerde.toArrayAndByteBuffer(buffer, offset + 4);
INDArray arr = pair.getKey();
Nd4j.getCompressor().decompressi(arr);
//use the rest o... | [
"public",
"static",
"NDArrayMessage",
"fromBuffer",
"(",
"DirectBuffer",
"buffer",
",",
"int",
"offset",
")",
"{",
"//skip the message opType",
"Pair",
"<",
"INDArray",
",",
"ByteBuffer",
">",
"pair",
"=",
"AeronNDArraySerde",
".",
"toArrayAndByteBuffer",
"(",
"buff... | Convert a direct buffer to an ndarray
message.
The format of the byte buffer is:
ndarray
time
index
dimension length
dimensions
We use {@link AeronNDArraySerde#toArrayAndByteBuffer(DirectBuffer, int)}
to read in the ndarray and just use normal {@link ByteBuffer#getInt()} and
{@link ByteBuffer#getLong()} to get the thi... | [
"Convert",
"a",
"direct",
"buffer",
"to",
"an",
"ndarray",
"message",
".",
"The",
"format",
"of",
"the",
"byte",
"buffer",
"is",
":",
"ndarray",
"time",
"index",
"dimension",
"length",
"dimensions"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/NDArrayMessage.java#L342-L359 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsMessages.java | CmsMessages.formatMessage | public static String formatMessage(String result, Object... args) {
"""
Helper method for formatting message parameters.<p>
@param result the raw message containing placeholders like {0}
@param args the parameters to insert into the placeholders
@return the formatted message
"""
// key was foun... | java | public static String formatMessage(String result, Object... args) {
// key was found in the bundle - create and apply the formatter
for (int i = 0; i < args.length; i++) {
if (args[i] instanceof Date) {
Date date = (Date)args[i];
result = result.replace(getRe... | [
"public",
"static",
"String",
"formatMessage",
"(",
"String",
"result",
",",
"Object",
"...",
"args",
")",
"{",
"// key was found in the bundle - create and apply the formatter",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"args",
".",
"length",
";",
"i",
... | Helper method for formatting message parameters.<p>
@param result the raw message containing placeholders like {0}
@param args the parameters to insert into the placeholders
@return the formatted message | [
"Helper",
"method",
"for",
"formatting",
"message",
"parameters",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsMessages.java#L90-L132 |
pravega/pravega | common/src/main/java/io/pravega/common/concurrent/Futures.java | Futures.onTimeout | public static <T> void onTimeout(CompletableFuture<T> future, Consumer<TimeoutException> callback) {
"""
Attaches the given callback as an exception listener to the given CompletableFuture, which will be invoked when
the future times out (fails with a TimeoutException).
@param future The future to attach to.... | java | public static <T> void onTimeout(CompletableFuture<T> future, Consumer<TimeoutException> callback) {
exceptionListener(future, TimeoutException.class, callback);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"onTimeout",
"(",
"CompletableFuture",
"<",
"T",
">",
"future",
",",
"Consumer",
"<",
"TimeoutException",
">",
"callback",
")",
"{",
"exceptionListener",
"(",
"future",
",",
"TimeoutException",
".",
"class",
",",
"c... | Attaches the given callback as an exception listener to the given CompletableFuture, which will be invoked when
the future times out (fails with a TimeoutException).
@param future The future to attach to.
@param callback The callback to invoke.
@param <T> The Type of the future's result. | [
"Attaches",
"the",
"given",
"callback",
"as",
"an",
"exception",
"listener",
"to",
"the",
"given",
"CompletableFuture",
"which",
"will",
"be",
"invoked",
"when",
"the",
"future",
"times",
"out",
"(",
"fails",
"with",
"a",
"TimeoutException",
")",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/Futures.java#L498-L500 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java | StaticTypeCheckingVisitor.checkForTargetType | private ClassNode checkForTargetType(final Expression expr, final ClassNode type) {
"""
/ it seems attractive to want to do this for more cases but perhaps not all cases
"""
BinaryExpression enclosingBinaryExpression = typeCheckingContext.getEnclosingBinaryExpression();
if (enclosingBinaryExpre... | java | private ClassNode checkForTargetType(final Expression expr, final ClassNode type) {
BinaryExpression enclosingBinaryExpression = typeCheckingContext.getEnclosingBinaryExpression();
if (enclosingBinaryExpression instanceof DeclarationExpression
&& isEmptyCollection(expr) && isAssignment(e... | [
"private",
"ClassNode",
"checkForTargetType",
"(",
"final",
"Expression",
"expr",
",",
"final",
"ClassNode",
"type",
")",
"{",
"BinaryExpression",
"enclosingBinaryExpression",
"=",
"typeCheckingContext",
".",
"getEnclosingBinaryExpression",
"(",
")",
";",
"if",
"(",
"... | / it seems attractive to want to do this for more cases but perhaps not all cases | [
"/",
"it",
"seems",
"attractive",
"to",
"want",
"to",
"do",
"this",
"for",
"more",
"cases",
"but",
"perhaps",
"not",
"all",
"cases"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L4227-L4245 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java | MicroWriter.writeToFile | @Nonnull
public static ESuccess writeToFile (@Nonnull final IMicroNode aNode,
@Nonnull final Path aPath,
@Nonnull final IXMLWriterSettings aSettings) {
"""
Write a Micro Node to a file.
@param aNode
The node to be serialized. May be ... | java | @Nonnull
public static ESuccess writeToFile (@Nonnull final IMicroNode aNode,
@Nonnull final Path aPath,
@Nonnull final IXMLWriterSettings aSettings)
{
ValueEnforcer.notNull (aPath, "Path");
return writeToFile (aNode, aPath.toFile (... | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"writeToFile",
"(",
"@",
"Nonnull",
"final",
"IMicroNode",
"aNode",
",",
"@",
"Nonnull",
"final",
"Path",
"aPath",
",",
"@",
"Nonnull",
"final",
"IXMLWriterSettings",
"aSettings",
")",
"{",
"ValueEnforcer",
".",
... | Write a Micro Node to a file.
@param aNode
The node to be serialized. May be any kind of node (incl.
documents). May not be <code>null</code>.
@param aPath
The file to write to. May not be <code>null</code>.
@param aSettings
The settings to be used for the creation. May not be
<code>null</code>.
@return {@link ESucces... | [
"Write",
"a",
"Micro",
"Node",
"to",
"a",
"file",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java#L134-L141 |
rpau/javalang-compiler | src/main/java/org/walkmod/javalang/compiler/reflection/ClassInspector.java | ClassInspector.getTheNearestSuperClass | @Deprecated
public static Class<?> getTheNearestSuperClass(Class<?> clazz1, Class<?> clazz2) {
"""
Looks for intersection of raw types of classes and all super classes and interfaces
@param clazz1 one of the classes to intersect.
@param clazz2 one of the classes to intersect.
@deprecated use {@link #interse... | java | @Deprecated
public static Class<?> getTheNearestSuperClass(Class<?> clazz1, Class<?> clazz2) {
return intersectRawTypes(clazz1, clazz2).get(0);
} | [
"@",
"Deprecated",
"public",
"static",
"Class",
"<",
"?",
">",
"getTheNearestSuperClass",
"(",
"Class",
"<",
"?",
">",
"clazz1",
",",
"Class",
"<",
"?",
">",
"clazz2",
")",
"{",
"return",
"intersectRawTypes",
"(",
"clazz1",
",",
"clazz2",
")",
".",
"get"... | Looks for intersection of raw types of classes and all super classes and interfaces
@param clazz1 one of the classes to intersect.
@param clazz2 one of the classes to intersect.
@deprecated use {@link #intersectRawTypes}
@return #interectRawTypes(clazz1, clazz2).get(0) | [
"Looks",
"for",
"intersection",
"of",
"raw",
"types",
"of",
"classes",
"and",
"all",
"super",
"classes",
"and",
"interfaces"
] | train | https://github.com/rpau/javalang-compiler/blob/d7da81359161feef2bc7ff186c4e1b73c6a5a8ef/src/main/java/org/walkmod/javalang/compiler/reflection/ClassInspector.java#L211-L214 |
carewebframework/carewebframework-vista | org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/BrokerSession.java | BrokerSession.authenticate | public AuthResult authenticate(String username, String password, String division) {
"""
Request authentication from the server.
@param username User name.
@param password Password.
@param division Login division (may be null).
@return Result of authentication.
"""
ensureConnection();
... | java | public AuthResult authenticate(String username, String password, String division) {
ensureConnection();
if (isAuthenticated()) {
return new AuthResult("0");
}
String av = username + ";" + password;
List<String> results = callRPCList("RGNETBRP AUTH:" ... | [
"public",
"AuthResult",
"authenticate",
"(",
"String",
"username",
",",
"String",
"password",
",",
"String",
"division",
")",
"{",
"ensureConnection",
"(",
")",
";",
"if",
"(",
"isAuthenticated",
"(",
")",
")",
"{",
"return",
"new",
"AuthResult",
"(",
"\"0\"... | Request authentication from the server.
@param username User name.
@param password Password.
@param division Login division (may be null).
@return Result of authentication. | [
"Request",
"authentication",
"from",
"the",
"server",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/BrokerSession.java#L434-L453 |
HadoopGenomics/Hadoop-BAM | src/main/java/org/seqdoop/hadoop_bam/util/MurmurHash3.java | MurmurHash3.murmurhash3 | public static long murmurhash3(CharSequence chars, int seed) {
"""
This version hashes the characters directly. It is not equivalent to
hashing chars.toString().getBytes(), as it hashes UTF-16 code units, but
it is much faster.
"""
final int len = chars.length();
final int nblocks = len / 8;
long h1... | java | public static long murmurhash3(CharSequence chars, int seed) {
final int len = chars.length();
final int nblocks = len / 8;
long h1 = seed;
long h2 = seed;
final long c1 = 0x87c37b91114253d5L;
final long c2 = 0x4cf5ad432745937fL;
for (int i = 0; i < nblocks; ++i) {
int i0 = (i*2 + 0) * 4;
int i... | [
"public",
"static",
"long",
"murmurhash3",
"(",
"CharSequence",
"chars",
",",
"int",
"seed",
")",
"{",
"final",
"int",
"len",
"=",
"chars",
".",
"length",
"(",
")",
";",
"final",
"int",
"nblocks",
"=",
"len",
"/",
"8",
";",
"long",
"h1",
"=",
"seed",... | This version hashes the characters directly. It is not equivalent to
hashing chars.toString().getBytes(), as it hashes UTF-16 code units, but
it is much faster. | [
"This",
"version",
"hashes",
"the",
"characters",
"directly",
".",
"It",
"is",
"not",
"equivalent",
"to",
"hashing",
"chars",
".",
"toString",
"()",
".",
"getBytes",
"()",
"as",
"it",
"hashes",
"UTF",
"-",
"16",
"code",
"units",
"but",
"it",
"is",
"much"... | train | https://github.com/HadoopGenomics/Hadoop-BAM/blob/9f974cf635a8d72f69604021cc3d5f3469d38d2f/src/main/java/org/seqdoop/hadoop_bam/util/MurmurHash3.java#L108-L171 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/extraction/caduceus/CaduceusRelationPoint.java | CaduceusRelationPoint.getAnnotations | List<Annotation> getAnnotations(Multimap<String, Annotation> groups, TokenMatcher matcher) {
"""
Gets annotations.
@param groups the groups
@return the annotations
"""
if (relationType == null) {
return getAnnotationStream(groups, matcher).filter(constraint).collect(Collectors.toList());
... | java | List<Annotation> getAnnotations(Multimap<String, Annotation> groups, TokenMatcher matcher) {
if (relationType == null) {
return getAnnotationStream(groups, matcher).filter(constraint).collect(Collectors.toList());
}
return getAnnotationStream(groups, matcher)
.flatMap(a -> {
... | [
"List",
"<",
"Annotation",
">",
"getAnnotations",
"(",
"Multimap",
"<",
"String",
",",
"Annotation",
">",
"groups",
",",
"TokenMatcher",
"matcher",
")",
"{",
"if",
"(",
"relationType",
"==",
"null",
")",
"{",
"return",
"getAnnotationStream",
"(",
"groups",
"... | Gets annotations.
@param groups the groups
@return the annotations | [
"Gets",
"annotations",
"."
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/extraction/caduceus/CaduceusRelationPoint.java#L126-L146 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/Fragments.java | Fragments.detachedAnnotation | public static Annotation detachedAnnotation(@NonNull AnnotationType type, int start, int end) {
"""
Creates a detached annotation, i.e. no document associated with it.
@param type the type of annotation
@param start the start of the span
@param end the end of the span
@return the annotation
"""
... | java | public static Annotation detachedAnnotation(@NonNull AnnotationType type, int start, int end) {
return new Annotation(type, start, end);
} | [
"public",
"static",
"Annotation",
"detachedAnnotation",
"(",
"@",
"NonNull",
"AnnotationType",
"type",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"new",
"Annotation",
"(",
"type",
",",
"start",
",",
"end",
")",
";",
"}"
] | Creates a detached annotation, i.e. no document associated with it.
@param type the type of annotation
@param start the start of the span
@param end the end of the span
@return the annotation | [
"Creates",
"a",
"detached",
"annotation",
"i",
".",
"e",
".",
"no",
"document",
"associated",
"with",
"it",
"."
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/Fragments.java#L56-L58 |
baratine/baratine | framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java | JavaCompilerUtil.compileIfModified | public void compileIfModified(String fileName, LineMap lineMap)
throws IOException, ClassNotFoundException {
"""
Compiles the class. className is a fully qualified Java class, e.g.
work.jsp.Test
@param fileName Java source name -- in VFS format
@param lineMap mapping from generated class back to the sour... | java | public void compileIfModified(String fileName, LineMap lineMap)
throws IOException, ClassNotFoundException
{
compile(fileName, lineMap, true);
} | [
"public",
"void",
"compileIfModified",
"(",
"String",
"fileName",
",",
"LineMap",
"lineMap",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"compile",
"(",
"fileName",
",",
"lineMap",
",",
"true",
")",
";",
"}"
] | Compiles the class. className is a fully qualified Java class, e.g.
work.jsp.Test
@param fileName Java source name -- in VFS format
@param lineMap mapping from generated class back to the source class
@return compiled class | [
"Compiles",
"the",
"class",
".",
"className",
"is",
"a",
"fully",
"qualified",
"Java",
"class",
"e",
".",
"g",
".",
"work",
".",
"jsp",
".",
"Test"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java#L567-L571 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/SchemasInner.java | SchemasInner.listByIntegrationAccountsAsync | public Observable<Page<IntegrationAccountSchemaInner>> listByIntegrationAccountsAsync(final String resourceGroupName, final String integrationAccountName) {
"""
Gets a list of integration account schemas.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account na... | java | public Observable<Page<IntegrationAccountSchemaInner>> listByIntegrationAccountsAsync(final String resourceGroupName, final String integrationAccountName) {
return listByIntegrationAccountsWithServiceResponseAsync(resourceGroupName, integrationAccountName)
.map(new Func1<ServiceResponse<Page<Integra... | [
"public",
"Observable",
"<",
"Page",
"<",
"IntegrationAccountSchemaInner",
">",
">",
"listByIntegrationAccountsAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"integrationAccountName",
")",
"{",
"return",
"listByIntegrationAccountsWithServiceRespo... | Gets a list of integration account schemas.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<IntegrationAccountSchemaInner> object | [
"Gets",
"a",
"list",
"of",
"integration",
"account",
"schemas",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/SchemasInner.java#L141-L149 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritJsonEventFactory.java | GerritJsonEventFactory.getString | public static String getString(JSONObject json, String key, String defaultValue) {
"""
Returns the value of a JSON property as a String if it exists otherwise returns the defaultValue.
@param json the JSONObject to check.
@param key the key.
@param defaultValue the value to return if the key is missing.
@retur... | java | public static String getString(JSONObject json, String key, String defaultValue) {
if (json.containsKey(key)) {
return json.getString(key);
} else {
return defaultValue;
}
} | [
"public",
"static",
"String",
"getString",
"(",
"JSONObject",
"json",
",",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"json",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
"json",
".",
"getString",
"(",
"key",
")",
... | Returns the value of a JSON property as a String if it exists otherwise returns the defaultValue.
@param json the JSONObject to check.
@param key the key.
@param defaultValue the value to return if the key is missing.
@return the value for the key as a string. | [
"Returns",
"the",
"value",
"of",
"a",
"JSON",
"property",
"as",
"a",
"String",
"if",
"it",
"exists",
"otherwise",
"returns",
"the",
"defaultValue",
"."
] | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritJsonEventFactory.java#L205-L211 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java | ZoneOperationId.of | public static ZoneOperationId of(String project, String zone, String operation) {
"""
Returns a zone operation identity given project, zone and operation names.
"""
return new ZoneOperationId(project, zone, operation);
} | java | public static ZoneOperationId of(String project, String zone, String operation) {
return new ZoneOperationId(project, zone, operation);
} | [
"public",
"static",
"ZoneOperationId",
"of",
"(",
"String",
"project",
",",
"String",
"zone",
",",
"String",
"operation",
")",
"{",
"return",
"new",
"ZoneOperationId",
"(",
"project",
",",
"zone",
",",
"operation",
")",
";",
"}"
] | Returns a zone operation identity given project, zone and operation names. | [
"Returns",
"a",
"zone",
"operation",
"identity",
"given",
"project",
"zone",
"and",
"operation",
"names",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/ZoneOperationId.java#L101-L103 |
google/auto | value/src/main/java/com/google/auto/value/processor/TypeSimplifier.java | TypeSimplifier.findImports | private static Map<String, Spelling> findImports(
Elements elementUtils,
Types typeUtils,
String codePackageName,
Set<TypeMirror> referenced,
Set<TypeMirror> defined) {
"""
Given a set of referenced types, works out which of them should be imported and what the
resulting spelling of ... | java | private static Map<String, Spelling> findImports(
Elements elementUtils,
Types typeUtils,
String codePackageName,
Set<TypeMirror> referenced,
Set<TypeMirror> defined) {
Map<String, Spelling> imports = new HashMap<>();
Set<TypeMirror> typesInScope = new TypeMirrorSet();
typesInS... | [
"private",
"static",
"Map",
"<",
"String",
",",
"Spelling",
">",
"findImports",
"(",
"Elements",
"elementUtils",
",",
"Types",
"typeUtils",
",",
"String",
"codePackageName",
",",
"Set",
"<",
"TypeMirror",
">",
"referenced",
",",
"Set",
"<",
"TypeMirror",
">",
... | Given a set of referenced types, works out which of them should be imported and what the
resulting spelling of each one is.
<p>This method operates on a {@code Set<TypeMirror>} rather than just a {@code Set<String>}
because it is not strictly possible to determine what part of a fully-qualified type name is
the packag... | [
"Given",
"a",
"set",
"of",
"referenced",
"types",
"works",
"out",
"which",
"of",
"them",
"should",
"be",
"imported",
"and",
"what",
"the",
"resulting",
"spelling",
"of",
"each",
"one",
"is",
"."
] | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/value/src/main/java/com/google/auto/value/processor/TypeSimplifier.java#L200-L234 |
jwtk/jjwt | api/src/main/java/io/jsonwebtoken/lang/Strings.java | Strings.splitArrayElementsIntoProperties | public static Properties splitArrayElementsIntoProperties(String[] array, String delimiter) {
"""
Take an array Strings and split each element based on the given delimiter.
A <code>Properties</code> instance is then generated, with the left of the
delimiter providing the key, and the right of the delimiter provi... | java | public static Properties splitArrayElementsIntoProperties(String[] array, String delimiter) {
return splitArrayElementsIntoProperties(array, delimiter, null);
} | [
"public",
"static",
"Properties",
"splitArrayElementsIntoProperties",
"(",
"String",
"[",
"]",
"array",
",",
"String",
"delimiter",
")",
"{",
"return",
"splitArrayElementsIntoProperties",
"(",
"array",
",",
"delimiter",
",",
"null",
")",
";",
"}"
] | Take an array Strings and split each element based on the given delimiter.
A <code>Properties</code> instance is then generated, with the left of the
delimiter providing the key, and the right of the delimiter providing the value.
<p>Will trim both the key and value before adding them to the
<code>Properties</code> ins... | [
"Take",
"an",
"array",
"Strings",
"and",
"split",
"each",
"element",
"based",
"on",
"the",
"given",
"delimiter",
".",
"A",
"<code",
">",
"Properties<",
"/",
"code",
">",
"instance",
"is",
"then",
"generated",
"with",
"the",
"left",
"of",
"the",
"delimiter"... | train | https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/lang/Strings.java#L891-L893 |
brettwooldridge/HikariCP | src/main/java/com/zaxxer/hikari/pool/PoolBase.java | PoolBase.handleMBeans | void handleMBeans(final HikariPool hikariPool, final boolean register) {
"""
Register MBeans for HikariConfig and HikariPool.
@param hikariPool a HikariPool instance
"""
if (!config.isRegisterMbeans()) {
return;
}
try {
final MBeanServer mBeanServer = ManagementFactory.g... | java | void handleMBeans(final HikariPool hikariPool, final boolean register)
{
if (!config.isRegisterMbeans()) {
return;
}
try {
final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
final ObjectName beanConfigName = new ObjectName("com.zaxxer.hikari:typ... | [
"void",
"handleMBeans",
"(",
"final",
"HikariPool",
"hikariPool",
",",
"final",
"boolean",
"register",
")",
"{",
"if",
"(",
"!",
"config",
".",
"isRegisterMbeans",
"(",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"final",
"MBeanServer",
"mBeanServer",
"... | Register MBeans for HikariConfig and HikariPool.
@param hikariPool a HikariPool instance | [
"Register",
"MBeans",
"for",
"HikariConfig",
"and",
"HikariPool",
"."
] | train | https://github.com/brettwooldridge/HikariCP/blob/c509ec1a3f1e19769ee69323972f339cf098ff4b/src/main/java/com/zaxxer/hikari/pool/PoolBase.java#L268-L295 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteQueryBuilder.java | SQLiteQueryBuilder.appendColumns | public static void appendColumns(StringBuilder s, String[] columns) {
"""
Add the names that are non-null in columns to s, separating
them with commas.
"""
int n = columns.length;
for (int i = 0; i < n; i++) {
String column = columns[i];
if (column != null) {
... | java | public static void appendColumns(StringBuilder s, String[] columns) {
int n = columns.length;
for (int i = 0; i < n; i++) {
String column = columns[i];
if (column != null) {
if (i > 0) {
s.append(", ");
}
s.app... | [
"public",
"static",
"void",
"appendColumns",
"(",
"StringBuilder",
"s",
",",
"String",
"[",
"]",
"columns",
")",
"{",
"int",
"n",
"=",
"columns",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"{",
... | Add the names that are non-null in columns to s, separating
them with commas. | [
"Add",
"the",
"names",
"that",
"are",
"non",
"-",
"null",
"in",
"columns",
"to",
"s",
"separating",
"them",
"with",
"commas",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteQueryBuilder.java#L249-L263 |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/PlanNodeTree.java | PlanNodeTree.loadPlanNodesFromJSONArrays | private void loadPlanNodesFromJSONArrays(int stmtId, JSONArray jArray, Database db) {
"""
Load plan nodes from the "PLAN_NODE" array. All the nodes are from
a substatement with the id = stmtId
@param stmtId
@param jArray - PLAN_NODES
@param db
@throws JSONException
"""
List<AbstractPlanNode> planN... | java | private void loadPlanNodesFromJSONArrays(int stmtId, JSONArray jArray, Database db) {
List<AbstractPlanNode> planNodes = new ArrayList<>();
int size = jArray.length();
try {
for (int i = 0; i < size; i++) {
JSONObject jobj = jArray.getJSONObject(i);
S... | [
"private",
"void",
"loadPlanNodesFromJSONArrays",
"(",
"int",
"stmtId",
",",
"JSONArray",
"jArray",
",",
"Database",
"db",
")",
"{",
"List",
"<",
"AbstractPlanNode",
">",
"planNodes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"size",
"=",
"jArray"... | Load plan nodes from the "PLAN_NODE" array. All the nodes are from
a substatement with the id = stmtId
@param stmtId
@param jArray - PLAN_NODES
@param db
@throws JSONException | [
"Load",
"plan",
"nodes",
"from",
"the",
"PLAN_NODE",
"array",
".",
"All",
"the",
"nodes",
"are",
"from",
"a",
"substatement",
"with",
"the",
"id",
"=",
"stmtId"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/PlanNodeTree.java#L255-L287 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneMenuButtonPainter.java | TitlePaneMenuButtonPainter.paintHover | private void paintHover(Graphics2D g, JComponent c, int width, int height) {
"""
Paint the background mouse-over state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component.
"""
paintMe... | java | private void paintHover(Graphics2D g, JComponent c, int width, int height) {
paintMenu(g, c, width, height, hover);
} | [
"private",
"void",
"paintHover",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"paintMenu",
"(",
"g",
",",
"c",
",",
"width",
",",
"height",
",",
"hover",
")",
";",
"}"
] | Paint the background mouse-over state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component. | [
"Paint",
"the",
"background",
"mouse",
"-",
"over",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneMenuButtonPainter.java#L122-L124 |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.indexExists | public boolean indexExists(String name) throws IOException {
"""
Tests for the index existence with specified name.
@param name the name of the index to test.
@return true if index with given name exists and false otherwise.
@throws IOException communication exception.
"""
CloseableHttpClient clie... | java | public boolean indexExists(String name) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpHead head = new HttpHead(String.format("http://%s:%d/%s", host, port, name));
try {
CloseableHttpResponse response = client.execute(head);
return res... | [
"public",
"boolean",
"indexExists",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"client",
"=",
"HttpClients",
".",
"createDefault",
"(",
")",
";",
"HttpHead",
"head",
"=",
"new",
"HttpHead",
"(",
"String",
".",
"format",
"(... | Tests for the index existence with specified name.
@param name the name of the index to test.
@return true if index with given name exists and false otherwise.
@throws IOException communication exception. | [
"Tests",
"for",
"the",
"index",
"existence",
"with",
"specified",
"name",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L60-L69 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/FileIoUtil.java | FileIoUtil.writeProperties | public static boolean writeProperties(File _file, Properties _props) {
"""
Writes a properties Object to file.
Returns true on success, false otherwise.
@param _file
@param _props
@return true on success, false otherwise
"""
LOGGER.debug("Trying to write Properties to file: " + _file);
try ... | java | public static boolean writeProperties(File _file, Properties _props) {
LOGGER.debug("Trying to write Properties to file: " + _file);
try (FileOutputStream out = new FileOutputStream(_file)) {
_props.store(out, _file.getName());
LOGGER.debug("Successfully wrote properties to file:... | [
"public",
"static",
"boolean",
"writeProperties",
"(",
"File",
"_file",
",",
"Properties",
"_props",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Trying to write Properties to file: \"",
"+",
"_file",
")",
";",
"try",
"(",
"FileOutputStream",
"out",
"=",
"new",
"Fi... | Writes a properties Object to file.
Returns true on success, false otherwise.
@param _file
@param _props
@return true on success, false otherwise | [
"Writes",
"a",
"properties",
"Object",
"to",
"file",
".",
"Returns",
"true",
"on",
"success",
"false",
"otherwise",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L98-L108 |
Harium/keel | src/main/java/com/harium/keel/catalano/core/DoublePoint.java | DoublePoint.Add | public DoublePoint Add(DoublePoint point1, DoublePoint point2) {
"""
Adds values of two points.
@param point1 DoublePoint.
@param point2 DoublePoint.
@return A new DoublePoint with the add operation.
"""
DoublePoint result = new DoublePoint(point1);
result.Add(point2);
return re... | java | public DoublePoint Add(DoublePoint point1, DoublePoint point2) {
DoublePoint result = new DoublePoint(point1);
result.Add(point2);
return result;
} | [
"public",
"DoublePoint",
"Add",
"(",
"DoublePoint",
"point1",
",",
"DoublePoint",
"point2",
")",
"{",
"DoublePoint",
"result",
"=",
"new",
"DoublePoint",
"(",
"point1",
")",
";",
"result",
".",
"Add",
"(",
"point2",
")",
";",
"return",
"result",
";",
"}"
] | Adds values of two points.
@param point1 DoublePoint.
@param point2 DoublePoint.
@return A new DoublePoint with the add operation. | [
"Adds",
"values",
"of",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/core/DoublePoint.java#L139-L143 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/hessenberg/TridiagonalDecompositionHouseholder_DDRM.java | TridiagonalDecompositionHouseholder_DDRM.similarTransform | private void similarTransform( int k) {
"""
Computes and performs the similar a transform for submatrix k.
"""
double t[] = QT.data;
// find the largest value in this column
// this is used to normalize the column and mitigate overflow/underflow
double max = 0;
int row... | java | private void similarTransform( int k) {
double t[] = QT.data;
// find the largest value in this column
// this is used to normalize the column and mitigate overflow/underflow
double max = 0;
int rowU = (k-1)*N;
for( int i = k; i < N; i++ ) {
double val = Ma... | [
"private",
"void",
"similarTransform",
"(",
"int",
"k",
")",
"{",
"double",
"t",
"[",
"]",
"=",
"QT",
".",
"data",
";",
"// find the largest value in this column",
"// this is used to normalize the column and mitigate overflow/underflow",
"double",
"max",
"=",
"0",
";",... | Computes and performs the similar a transform for submatrix k. | [
"Computes",
"and",
"performs",
"the",
"similar",
"a",
"transform",
"for",
"submatrix",
"k",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/hessenberg/TridiagonalDecompositionHouseholder_DDRM.java#L171-L208 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/GuestWindowsRegistryManager.java | GuestWindowsRegistryManager.setRegistryValueInGuest | public void setRegistryValueInGuest(VirtualMachine vm, GuestAuthentication auth, GuestRegValueSpec value) throws GuestComponentsOutOfDate, GuestOperationsFault, GuestOperationsUnavailable, GuestPermissionDenied, GuestRegistryKeyInvalid, InvalidGuestLogin,
InvalidPowerState, InvalidState, OperationDisabledByGues... | java | public void setRegistryValueInGuest(VirtualMachine vm, GuestAuthentication auth, GuestRegValueSpec value) throws GuestComponentsOutOfDate, GuestOperationsFault, GuestOperationsUnavailable, GuestPermissionDenied, GuestRegistryKeyInvalid, InvalidGuestLogin,
InvalidPowerState, InvalidState, OperationDisabledByGues... | [
"public",
"void",
"setRegistryValueInGuest",
"(",
"VirtualMachine",
"vm",
",",
"GuestAuthentication",
"auth",
",",
"GuestRegValueSpec",
"value",
")",
"throws",
"GuestComponentsOutOfDate",
",",
"GuestOperationsFault",
",",
"GuestOperationsUnavailable",
",",
"GuestPermissionDen... | Set/Create a registry value.
@param vm Virtual machine to perform the operation on.
@param auth The guest authentication data.
@param value The information for the registry value to be set/created. The Value "name" (specified in {@link com.vmware.vim25.GuestRegValueNameSpec GuestRegValueNameSpec}) and the Value "d... | [
"Set",
"/",
"Create",
"a",
"registry",
"value",
"."
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/GuestWindowsRegistryManager.java#L213-L216 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/write/WriteFileExtensions.java | WriteFileExtensions.writeStringToFile | public static boolean writeStringToFile(final File file, final String string2write,
final String encoding) throws FileNotFoundException, IOException {
"""
The Method writeStringToFile(File, String, String) writes the String to the File.
@param file
The File to write the String.
@param string2write
The Stri... | java | public static boolean writeStringToFile(final File file, final String string2write,
final String encoding) throws FileNotFoundException, IOException
{
boolean iswritten = true;
try (FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream bos = new BufferedOutputStream(fos);
OutputStreamWrit... | [
"public",
"static",
"boolean",
"writeStringToFile",
"(",
"final",
"File",
"file",
",",
"final",
"String",
"string2write",
",",
"final",
"String",
"encoding",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"boolean",
"iswritten",
"=",
"true",
";",... | The Method writeStringToFile(File, String, String) writes the String to the File.
@param file
The File to write the String.
@param string2write
The String to write into the File.
@param encoding
The encoding from the file.
@return The Method return true if the String was write successfull to the file otherwise
false.
... | [
"The",
"Method",
"writeStringToFile",
"(",
"File",
"String",
"String",
")",
"writes",
"the",
"String",
"to",
"the",
"File",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/write/WriteFileExtensions.java#L343-L357 |
rapidpro/expressions | java/src/main/java/io/rapidpro/expressions/functions/CustomFunctions.java | CustomFunctions.format_location | public static String format_location(EvaluationContext ctx, Object text) {
"""
Takes a single parameter (administrative boundary as a string) and returns the name of the leaf boundary
"""
String _text = Conversions.toString(text, ctx);
String[] splits = _text.split(">");
return splits[s... | java | public static String format_location(EvaluationContext ctx, Object text) {
String _text = Conversions.toString(text, ctx);
String[] splits = _text.split(">");
return splits[splits.length - 1].trim();
} | [
"public",
"static",
"String",
"format_location",
"(",
"EvaluationContext",
"ctx",
",",
"Object",
"text",
")",
"{",
"String",
"_text",
"=",
"Conversions",
".",
"toString",
"(",
"text",
",",
"ctx",
")",
";",
"String",
"[",
"]",
"splits",
"=",
"_text",
".",
... | Takes a single parameter (administrative boundary as a string) and returns the name of the leaf boundary | [
"Takes",
"a",
"single",
"parameter",
"(",
"administrative",
"boundary",
"as",
"a",
"string",
")",
"and",
"returns",
"the",
"name",
"of",
"the",
"leaf",
"boundary"
] | train | https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/java/src/main/java/io/rapidpro/expressions/functions/CustomFunctions.java#L171-L175 |
syphr42/prom | src/main/java/org/syphr/prom/PropertiesManagers.java | PropertiesManagers.newManager | public static <T extends Enum<T> & Defaultable> PropertiesManager<T> newManager(File file,
Class<T> keyType,
final Retriever... retrievers) {
"""
B... | java | public static <T extends Enum<T> & Defaultable> PropertiesManager<T> newManager(File file,
Class<T> keyType,
final Retriever... retrievers)
{
... | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
"&",
"Defaultable",
">",
"PropertiesManager",
"<",
"T",
">",
"newManager",
"(",
"File",
"file",
",",
"Class",
"<",
"T",
">",
"keyType",
",",
"final",
"Retriever",
"...",
"retrievers",
")",
... | Build a new manager for the given properties file.
@param <T>
the type of key used for the new manager
@param file
the file system location of the properties represented here
@param keyType
the enumeration of keys in the properties file
@param retrievers
a set of retrievers that will be used to resolve extra
property... | [
"Build",
"a",
"new",
"manager",
"for",
"the",
"given",
"properties",
"file",
"."
] | train | https://github.com/syphr42/prom/blob/074d67c4ebb3afb0b163fcb0bc4826ee577ac803/src/main/java/org/syphr/prom/PropertiesManagers.java#L229-L234 |
johncarl81/parceler | parceler-api/src/main/java/org/parceler/InjectionUtil.java | InjectionUtil.callConstructor | public static <T> T callConstructor(Class<T> targetClass, Class[] argClasses, Object[] args) {
"""
Instantiates a class by calling the constructor.
@param targetClass instance type to construct
@param argClasses argument types accepted by the constructor
@param args constructor argument values
@param <T> rel... | java | public static <T> T callConstructor(Class<T> targetClass, Class[] argClasses, Object[] args) {
T output;
try {
Constructor classConstructor = targetClass.getDeclaredConstructor(argClasses);
output = AccessController.doPrivileged(
new SetConstructorPrivileged... | [
"public",
"static",
"<",
"T",
">",
"T",
"callConstructor",
"(",
"Class",
"<",
"T",
">",
"targetClass",
",",
"Class",
"[",
"]",
"argClasses",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"T",
"output",
";",
"try",
"{",
"Constructor",
"classConstructor",
"... | Instantiates a class by calling the constructor.
@param targetClass instance type to construct
@param argClasses argument types accepted by the constructor
@param args constructor argument values
@param <T> relating type parameter
@return instance created by constructor | [
"Instantiates",
"a",
"class",
"by",
"calling",
"the",
"constructor",
"."
] | train | https://github.com/johncarl81/parceler/blob/39624b2b71e2f06e1c556e9d9d198afb9a705912/parceler-api/src/main/java/org/parceler/InjectionUtil.java#L190-L207 |
jayantk/jklol | src/com/jayantkrish/jklol/cfg/CfgParseChart.java | CfgParseChart.getMarginalEntries | public Factor getMarginalEntries(int spanStart, int spanEnd) {
"""
Get the marginal unnormalized probabilities over productions at a
particular node in the tree.
"""
return getOutsideEntries(spanStart, spanEnd).product(getInsideEntries(spanStart, spanEnd));
} | java | public Factor getMarginalEntries(int spanStart, int spanEnd) {
return getOutsideEntries(spanStart, spanEnd).product(getInsideEntries(spanStart, spanEnd));
} | [
"public",
"Factor",
"getMarginalEntries",
"(",
"int",
"spanStart",
",",
"int",
"spanEnd",
")",
"{",
"return",
"getOutsideEntries",
"(",
"spanStart",
",",
"spanEnd",
")",
".",
"product",
"(",
"getInsideEntries",
"(",
"spanStart",
",",
"spanEnd",
")",
")",
";",
... | Get the marginal unnormalized probabilities over productions at a
particular node in the tree. | [
"Get",
"the",
"marginal",
"unnormalized",
"probabilities",
"over",
"productions",
"at",
"a",
"particular",
"node",
"in",
"the",
"tree",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cfg/CfgParseChart.java#L277-L279 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/GenericInfoUtils.java | GenericInfoUtils.create | public static GenericsInfo create(
final GenericsContext context, final Type type, final Class<?>... ignoreClasses) {
"""
Type analysis in context of analyzed type. For example, resolution of field type class in context of
analyzed class (so we can correctly resolve it's generics).In essence, the only... | java | public static GenericsInfo create(
final GenericsContext context, final Type type, final Class<?>... ignoreClasses) {
// root generics are required only to properly solve type
final Map<String, Type> rootGenerics = context.visibleGenericsMap();
// first step: solve type to replace tr... | [
"public",
"static",
"GenericsInfo",
"create",
"(",
"final",
"GenericsContext",
"context",
",",
"final",
"Type",
"type",
",",
"final",
"Class",
"<",
"?",
">",
"...",
"ignoreClasses",
")",
"{",
"// root generics are required only to properly solve type",
"final",
"Map",... | Type analysis in context of analyzed type. For example, resolution of field type class in context of
analyzed class (so we can correctly resolve it's generics).In essence, the only difference with usual type
resolution is known root generics.
<p>
The result is not intended to be cached as it's context-sensitive.
@para... | [
"Type",
"analysis",
"in",
"context",
"of",
"analyzed",
"type",
".",
"For",
"example",
"resolution",
"of",
"field",
"type",
"class",
"in",
"context",
"of",
"analyzed",
"class",
"(",
"so",
"we",
"can",
"correctly",
"resolve",
"it",
"s",
"generics",
")",
".",... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/GenericInfoUtils.java#L59-L73 |
groundupworks/wings | wings/src/main/java/com/groundupworks/wings/core/WingsService.java | WingsService.scheduleWingsService | static void scheduleWingsService(Context context, long delay) {
"""
Schedules an alarm to start the {@link WingsService}.
@param context the {@link Context}.
@param delay how far in the future to schedule the alarm.
"""
Context appContext = context.getApplicationContext();
// Create pend... | java | static void scheduleWingsService(Context context, long delay) {
Context appContext = context.getApplicationContext();
// Create pending intent.
Intent intent = new Intent(appContext, AlarmReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(appContext, 0, intent,
... | [
"static",
"void",
"scheduleWingsService",
"(",
"Context",
"context",
",",
"long",
"delay",
")",
"{",
"Context",
"appContext",
"=",
"context",
".",
"getApplicationContext",
"(",
")",
";",
"// Create pending intent.",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
... | Schedules an alarm to start the {@link WingsService}.
@param context the {@link Context}.
@param delay how far in the future to schedule the alarm. | [
"Schedules",
"an",
"alarm",
"to",
"start",
"the",
"{",
"@link",
"WingsService",
"}",
"."
] | train | https://github.com/groundupworks/wings/blob/03d2827c30ef55f2db4e23f7500e016c7771fa39/wings/src/main/java/com/groundupworks/wings/core/WingsService.java#L236-L247 |
wisdom-framework/wisdom | extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java | CSRFServiceImpl.addTokenToResult | @Override
public Result addTokenToResult(Context context, String newToken, Result result) {
"""
Methods adding the CORS token to the given result. The effect depends on the configuration.
@param context the context
@param newToken the new token
@param result the result that is enhanced
@return the upd... | java | @Override
public Result addTokenToResult(Context context, String newToken, Result result) {
if (isCached(context)) {
LOGGER.debug("Not adding token to a cached result");
return result;
}
LOGGER.debug("Adding token to result");
if (getCookieName() != null) {
... | [
"@",
"Override",
"public",
"Result",
"addTokenToResult",
"(",
"Context",
"context",
",",
"String",
"newToken",
",",
"Result",
"result",
")",
"{",
"if",
"(",
"isCached",
"(",
"context",
")",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Not adding token to a cached... | Methods adding the CORS token to the given result. The effect depends on the configuration.
@param context the context
@param newToken the new token
@param result the result that is enhanced
@return the updated result | [
"Methods",
"adding",
"the",
"CORS",
"token",
"to",
"the",
"given",
"result",
".",
"The",
"effect",
"depends",
"on",
"the",
"configuration",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java#L164-L190 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java | AbstractEJBRuntime.bindInterface | private <T> void bindInterface(NameSpaceBinder<T> binder,
HomeRecord hr,
HomeWrapperSet homeSet,
int numInterfaces,
boolean singleGlobalInterface,
... | java | private <T> void bindInterface(NameSpaceBinder<T> binder,
HomeRecord hr,
HomeWrapperSet homeSet,
int numInterfaces,
boolean singleGlobalInterface,
... | [
"private",
"<",
"T",
">",
"void",
"bindInterface",
"(",
"NameSpaceBinder",
"<",
"T",
">",
"binder",
",",
"HomeRecord",
"hr",
",",
"HomeWrapperSet",
"homeSet",
",",
"int",
"numInterfaces",
",",
"boolean",
"singleGlobalInterface",
",",
"String",
"interfaceName",
"... | Bind a single interface to all binding locations.
@param binder the namespace binder
@param hr the bean home record
@param homeSet the remote and local home wrappers, or <tt>null</tt> if
deferred initialization bindings should be used
@pram numInterfaces the number of remote or local interfaces
@param singleGlobalInte... | [
"Bind",
"a",
"single",
"interface",
"to",
"all",
"binding",
"locations",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L975-L1011 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java | PersistenceBrokerImpl.getCollectionByQuery | public ManageableCollection getCollectionByQuery(Class collectionClass, Query query)
throws PersistenceBrokerException {
"""
retrieve a collection of type collectionClass matching the Query query
@see org.apache.ojb.broker.PersistenceBroker#getCollectionByQuery(Class, Query)
"""
return r... | java | public ManageableCollection getCollectionByQuery(Class collectionClass, Query query)
throws PersistenceBrokerException
{
return referencesBroker.getCollectionByQuery(collectionClass, query, false);
} | [
"public",
"ManageableCollection",
"getCollectionByQuery",
"(",
"Class",
"collectionClass",
",",
"Query",
"query",
")",
"throws",
"PersistenceBrokerException",
"{",
"return",
"referencesBroker",
".",
"getCollectionByQuery",
"(",
"collectionClass",
",",
"query",
",",
"false... | retrieve a collection of type collectionClass matching the Query query
@see org.apache.ojb.broker.PersistenceBroker#getCollectionByQuery(Class, Query) | [
"retrieve",
"a",
"collection",
"of",
"type",
"collectionClass",
"matching",
"the",
"Query",
"query"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java#L1513-L1517 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookSignatureUtil.java | FacebookSignatureUtil.verifySignature | public static boolean verifySignature(EnumMap<FacebookParam, CharSequence> params, String secret,
String expected) {
"""
Verifies that a signature received matches the expected value.
@param params a map of parameters and their values, such as one
obtained from extractFace... | java | public static boolean verifySignature(EnumMap<FacebookParam, CharSequence> params, String secret,
String expected) {
assert !(null == secret || "".equals(secret));
if (null == params || params.isEmpty() )
return false;
if (null == expected || "".equals(expected)... | [
"public",
"static",
"boolean",
"verifySignature",
"(",
"EnumMap",
"<",
"FacebookParam",
",",
"CharSequence",
">",
"params",
",",
"String",
"secret",
",",
"String",
"expected",
")",
"{",
"assert",
"!",
"(",
"null",
"==",
"secret",
"||",
"\"\"",
".",
"equals",... | Verifies that a signature received matches the expected value.
@param params a map of parameters and their values, such as one
obtained from extractFacebookParams
@return a boolean indicating whether the calculated signature matched the
expected signature | [
"Verifies",
"that",
"a",
"signature",
"received",
"matches",
"the",
"expected",
"value",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookSignatureUtil.java#L160-L171 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/metadata/FieldDescriptor.java | FieldDescriptor.getComparator | public static Comparator getComparator() {
"""
returns a comparator that allows to sort a Vector of FieldMappingDecriptors
according to their m_Order entries.
"""
return new Comparator()
{
public int compare(Object o1, Object o2)
{
FieldDescriptor f... | java | public static Comparator getComparator()
{
return new Comparator()
{
public int compare(Object o1, Object o2)
{
FieldDescriptor fmd1 = (FieldDescriptor) o1;
FieldDescriptor fmd2 = (FieldDescriptor) o2;
if (fmd1.getColNo(... | [
"public",
"static",
"Comparator",
"getComparator",
"(",
")",
"{",
"return",
"new",
"Comparator",
"(",
")",
"{",
"public",
"int",
"compare",
"(",
"Object",
"o1",
",",
"Object",
"o2",
")",
"{",
"FieldDescriptor",
"fmd1",
"=",
"(",
"FieldDescriptor",
")",
"o1... | returns a comparator that allows to sort a Vector of FieldMappingDecriptors
according to their m_Order entries. | [
"returns",
"a",
"comparator",
"that",
"allows",
"to",
"sort",
"a",
"Vector",
"of",
"FieldMappingDecriptors",
"according",
"to",
"their",
"m_Order",
"entries",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/FieldDescriptor.java#L79-L101 |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java | AbstractCreator.getPrintWriter | protected final PrintWriter getPrintWriter( String packageName, String className ) {
"""
Creates the {@link PrintWriter} to write the class.
@param packageName the package
@param className the name of the class
@return the {@link PrintWriter} or null if the class already exists.
"""
return context... | java | protected final PrintWriter getPrintWriter( String packageName, String className ) {
return context.tryCreate( logger, packageName, className );
} | [
"protected",
"final",
"PrintWriter",
"getPrintWriter",
"(",
"String",
"packageName",
",",
"String",
"className",
")",
"{",
"return",
"context",
".",
"tryCreate",
"(",
"logger",
",",
"packageName",
",",
"className",
")",
";",
"}"
] | Creates the {@link PrintWriter} to write the class.
@param packageName the package
@param className the name of the class
@return the {@link PrintWriter} or null if the class already exists. | [
"Creates",
"the",
"{",
"@link",
"PrintWriter",
"}",
"to",
"write",
"the",
"class",
"."
] | train | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java#L119-L121 |
ag-gipp/MathMLTools | mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/node/MathNodeGenerator.java | MathNodeGenerator.createMathNode | private static MathNode createMathNode(Node node, int depth) {
"""
Recursive method to create a math expression tree (MEXT). Every child
and all attributes are considered in the conversion.
@param node current xml node in cmml, typically the root element
@param depth current depth of the math tree
@return c... | java | private static MathNode createMathNode(Node node, int depth) {
MathNode mathNode = new MathNode();
mathNode.setName(node.getNodeName());
if (mathNode.getName().equalsIgnoreCase("annotation-xml")) {
// this can be an additional tag from the strict cmml conversion
// - node... | [
"private",
"static",
"MathNode",
"createMathNode",
"(",
"Node",
"node",
",",
"int",
"depth",
")",
"{",
"MathNode",
"mathNode",
"=",
"new",
"MathNode",
"(",
")",
";",
"mathNode",
".",
"setName",
"(",
"node",
".",
"getNodeName",
"(",
")",
")",
";",
"if",
... | Recursive method to create a math expression tree (MEXT). Every child
and all attributes are considered in the conversion.
@param node current xml node in cmml, typically the root element
@param depth current depth of the math tree
@return converted MathNode we use in this application | [
"Recursive",
"method",
"to",
"create",
"a",
"math",
"expression",
"tree",
"(",
"MEXT",
")",
".",
"Every",
"child",
"and",
"all",
"attributes",
"are",
"considered",
"in",
"the",
"conversion",
"."
] | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-similarity/src/main/java/com/formulasearchengine/mathmltools/similarity/node/MathNodeGenerator.java#L73-L88 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readPropertyDefinition | public CmsPropertyDefinition readPropertyDefinition(CmsRequestContext context, String name) throws CmsException {
"""
Reads a property definition.<p>
If no property definition with the given name is found,
<code>null</code> is returned.<p>
@param context the current request context
@param name the name of ... | java | public CmsPropertyDefinition readPropertyDefinition(CmsRequestContext context, String name) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsPropertyDefinition result = null;
try {
result = m_driverManager.readPropertyDefinition(dbc, name);
... | [
"public",
"CmsPropertyDefinition",
"readPropertyDefinition",
"(",
"CmsRequestContext",
"context",
",",
"String",
"name",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"CmsPropertyDefi... | Reads a property definition.<p>
If no property definition with the given name is found,
<code>null</code> is returned.<p>
@param context the current request context
@param name the name of the property definition to read
@return the property definition that was read
@throws CmsException a CmsDbEntryNotFoundExceptio... | [
"Reads",
"a",
"property",
"definition",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L4806-L4818 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/EnumUtils.java | EnumUtils.isValidEnum | public static <E extends Enum<E>> boolean isValidEnum(final Class<E> enumClass, final String enumName) {
"""
<p>Checks if the specified name is a valid enum for the class.</p>
<p>This method differs from {@link Enum#valueOf} in that checks if the name is
a valid enum without needing to catch the exception.</p>... | java | public static <E extends Enum<E>> boolean isValidEnum(final Class<E> enumClass, final String enumName) {
if (enumName == null) {
return false;
}
try {
Enum.valueOf(enumClass, enumName);
return true;
} catch (final IllegalArgumentException ex) {
... | [
"public",
"static",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"boolean",
"isValidEnum",
"(",
"final",
"Class",
"<",
"E",
">",
"enumClass",
",",
"final",
"String",
"enumName",
")",
"{",
"if",
"(",
"enumName",
"==",
"null",
")",
"{",
"return",
"... | <p>Checks if the specified name is a valid enum for the class.</p>
<p>This method differs from {@link Enum#valueOf} in that checks if the name is
a valid enum without needing to catch the exception.</p>
@param <E> the type of the enumeration
@param enumClass the class of the enum to query, not null
@param enumName ... | [
"<p",
">",
"Checks",
"if",
"the",
"specified",
"name",
"is",
"a",
"valid",
"enum",
"for",
"the",
"class",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/EnumUtils.java#L91-L101 |
bartprokop/rxtx | src/main/java/gnu/io/RXTXPort.java | RXTXPort.staticSetRTS | public static boolean staticSetRTS(String port, boolean flag)
throws UnsupportedCommOperationException {
"""
Extension to CommAPI This is an extension to CommAPI. It may not be
supported on all operating systems.
Open the port and set RTS. remove lockfile and do not close This is so
some software ... | java | public static boolean staticSetRTS(String port, boolean flag)
throws UnsupportedCommOperationException {
logger.fine("RXTXPort:staticSetRTS( " + port
+ " " + flag);
return (nativeStaticSetRTS(port, flag));
} | [
"public",
"static",
"boolean",
"staticSetRTS",
"(",
"String",
"port",
",",
"boolean",
"flag",
")",
"throws",
"UnsupportedCommOperationException",
"{",
"logger",
".",
"fine",
"(",
"\"RXTXPort:staticSetRTS( \"",
"+",
"port",
"+",
"\" \"",
"+",
"flag",
")",
";",
"r... | Extension to CommAPI This is an extension to CommAPI. It may not be
supported on all operating systems.
Open the port and set RTS. remove lockfile and do not close This is so
some software can appear to set the RTS before 'opening' the port a
second time later on.
@param port port name
@param flag falg value
@return ... | [
"Extension",
"to",
"CommAPI",
"This",
"is",
"an",
"extension",
"to",
"CommAPI",
".",
"It",
"may",
"not",
"be",
"supported",
"on",
"all",
"operating",
"systems",
"."
] | train | https://github.com/bartprokop/rxtx/blob/7b2c7857c262743e9dd15e9779c880b93c650890/src/main/java/gnu/io/RXTXPort.java#L1784-L1790 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/AbstractExtensionPropertySerializer.java | AbstractExtensionPropertySerializer.createRootElement | protected Element createRootElement(Document document, String elementName, String elementTextContent) {
"""
Creates a new {@link Element} with the given name and text content.
@param document the document used to create the new {@link Element}.
@param elementName the name of the element to create
@param eleme... | java | protected Element createRootElement(Document document, String elementName, String elementTextContent)
{
Element element = createRootElement(document, elementName);
element.setTextContent(elementTextContent);
return element;
} | [
"protected",
"Element",
"createRootElement",
"(",
"Document",
"document",
",",
"String",
"elementName",
",",
"String",
"elementTextContent",
")",
"{",
"Element",
"element",
"=",
"createRootElement",
"(",
"document",
",",
"elementName",
")",
";",
"element",
".",
"s... | Creates a new {@link Element} with the given name and text content.
@param document the document used to create the new {@link Element}.
@param elementName the name of the element to create
@param elementTextContent the text content of the element
@return the new element
@since 7.0M2 | [
"Creates",
"a",
"new",
"{",
"@link",
"Element",
"}",
"with",
"the",
"given",
"name",
"and",
"text",
"content",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/AbstractExtensionPropertySerializer.java#L79-L84 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.scaleAdd | public static Atom scaleAdd(double s, Atom x, Atom b) {
"""
Perform linear transformation s*X+B, and store the result in b
@param s
Amount to scale x
@param x
Input coordinate
@param b
Vector to translate (will be modified)
@return b, after modification
"""
double xc = s*x.getX() + b.getX();
doub... | java | public static Atom scaleAdd(double s, Atom x, Atom b){
double xc = s*x.getX() + b.getX();
double yc = s*x.getY() + b.getY();
double zc = s*x.getZ() + b.getZ();
//Atom a = new AtomImpl();
b.setX(xc);
b.setY(yc);
b.setZ(zc);
return b;
} | [
"public",
"static",
"Atom",
"scaleAdd",
"(",
"double",
"s",
",",
"Atom",
"x",
",",
"Atom",
"b",
")",
"{",
"double",
"xc",
"=",
"s",
"*",
"x",
".",
"getX",
"(",
")",
"+",
"b",
".",
"getX",
"(",
")",
";",
"double",
"yc",
"=",
"s",
"*",
"x",
"... | Perform linear transformation s*X+B, and store the result in b
@param s
Amount to scale x
@param x
Input coordinate
@param b
Vector to translate (will be modified)
@return b, after modification | [
"Perform",
"linear",
"transformation",
"s",
"*",
"X",
"+",
"B",
"and",
"store",
"the",
"result",
"in",
"b"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L878-L890 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java | BeanUtil.setFieldValue | @SuppressWarnings( {
"""
设置字段值,,通过反射设置字段值,并不调用setXXX方法<br>
对象同样支持Map类型,fieldNameOrIndex即为key
@param bean Bean
@param fieldNameOrIndex 字段名或序号,序号支持负数
@param value 值
""" "unchecked", "rawtypes" })
public static void setFieldValue(Object bean, String fieldNameOrIndex, Object value) {
if (bean instanceof... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public static void setFieldValue(Object bean, String fieldNameOrIndex, Object value) {
if (bean instanceof Map) {
((Map) bean).put(fieldNameOrIndex, value);
} else if (bean instanceof List) {
CollUtil.setOrAppend((List) bean, Convert.toInt(fieldNameOrIndex)... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"static",
"void",
"setFieldValue",
"(",
"Object",
"bean",
",",
"String",
"fieldNameOrIndex",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"bean",
"instanceof",
"Map",
... | 设置字段值,,通过反射设置字段值,并不调用setXXX方法<br>
对象同样支持Map类型,fieldNameOrIndex即为key
@param bean Bean
@param fieldNameOrIndex 字段名或序号,序号支持负数
@param value 值 | [
"设置字段值,,通过反射设置字段值,并不调用setXXX方法<br",
">",
"对象同样支持Map类型,fieldNameOrIndex即为key"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L278-L290 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/NetUtils.java | NetUtils.getDefaultSocketFactory | public static SocketFactory getDefaultSocketFactory(Configuration conf) {
"""
Get the default socket factory as specified by the configuration
parameter <tt>hadoop.rpc.socket.factory.default</tt>
@param conf the configuration
@return the default socket factory as specified in the configuration or
the JVM def... | java | public static SocketFactory getDefaultSocketFactory(Configuration conf) {
String propValue = conf.get("hadoop.rpc.socket.factory.class.default");
if ((propValue == null) || (propValue.length() == 0))
return SocketFactory.getDefault();
return getSocketFactoryFromProperty(conf, propValue);
} | [
"public",
"static",
"SocketFactory",
"getDefaultSocketFactory",
"(",
"Configuration",
"conf",
")",
"{",
"String",
"propValue",
"=",
"conf",
".",
"get",
"(",
"\"hadoop.rpc.socket.factory.class.default\"",
")",
";",
"if",
"(",
"(",
"propValue",
"==",
"null",
")",
"|... | Get the default socket factory as specified by the configuration
parameter <tt>hadoop.rpc.socket.factory.default</tt>
@param conf the configuration
@return the default socket factory as specified in the configuration or
the JVM default socket factory if the configuration does not
contain a default socket factory prope... | [
"Get",
"the",
"default",
"socket",
"factory",
"as",
"specified",
"by",
"the",
"configuration",
"parameter",
"<tt",
">",
"hadoop",
".",
"rpc",
".",
"socket",
".",
"factory",
".",
"default<",
"/",
"tt",
">"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/NetUtils.java#L111-L118 |
JRebirth/JRebirth | org.jrebirth.af/showcase/analyzer/src/main/java/org/jrebirth/af/showcase/analyzer/ui/editor/ball/BallModel.java | BallModel.doEventSelected | public void doEventSelected(final JRebirthEvent eventSelected, final Wave wave) {
"""
Call when event previous button is pressed.
@param eventSelected the selected event
@param wave the wave received
"""
// Same object (reference)
if (getEventModel() == eventSelected) {
view().g... | java | public void doEventSelected(final JRebirthEvent eventSelected, final Wave wave) {
// Same object (reference)
if (getEventModel() == eventSelected) {
view().getScaleTransition().play();
} else {
view().getScaleTransition().stop();
view().resetScale();
}... | [
"public",
"void",
"doEventSelected",
"(",
"final",
"JRebirthEvent",
"eventSelected",
",",
"final",
"Wave",
"wave",
")",
"{",
"// Same object (reference)",
"if",
"(",
"getEventModel",
"(",
")",
"==",
"eventSelected",
")",
"{",
"view",
"(",
")",
".",
"getScaleTran... | Call when event previous button is pressed.
@param eventSelected the selected event
@param wave the wave received | [
"Call",
"when",
"event",
"previous",
"button",
"is",
"pressed",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/showcase/analyzer/src/main/java/org/jrebirth/af/showcase/analyzer/ui/editor/ball/BallModel.java#L49-L57 |
code4everything/util | src/main/java/com/zhazhapan/util/DateUtils.java | DateUtils.addMinute | public static Date addMinute(String date, int amount) throws ParseException {
"""
添加分钟
@param date 日期
@param amount 数量
@return 添加后的日期
@throws ParseException 异常
"""
return add(date, Calendar.MINUTE, amount);
} | java | public static Date addMinute(String date, int amount) throws ParseException {
return add(date, Calendar.MINUTE, amount);
} | [
"public",
"static",
"Date",
"addMinute",
"(",
"String",
"date",
",",
"int",
"amount",
")",
"throws",
"ParseException",
"{",
"return",
"add",
"(",
"date",
",",
"Calendar",
".",
"MINUTE",
",",
"amount",
")",
";",
"}"
] | 添加分钟
@param date 日期
@param amount 数量
@return 添加后的日期
@throws ParseException 异常 | [
"添加分钟"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/DateUtils.java#L369-L371 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/StyleSet.java | StyleSet.setFont | public StyleSet setFont(short color, short fontSize, String fontName, boolean ignoreHead) {
"""
设置全局字体
@param color 字体颜色
@param fontSize 字体大小,-1表示默认大小
@param fontName 字体名,null表示默认字体
@param ignoreHead 是否跳过头部样式
@return this
"""
final Font font = StyleUtil.createFont(this.workbook, color, fontSize, font... | java | public StyleSet setFont(short color, short fontSize, String fontName, boolean ignoreHead) {
final Font font = StyleUtil.createFont(this.workbook, color, fontSize, fontName);
return setFont(font, ignoreHead);
} | [
"public",
"StyleSet",
"setFont",
"(",
"short",
"color",
",",
"short",
"fontSize",
",",
"String",
"fontName",
",",
"boolean",
"ignoreHead",
")",
"{",
"final",
"Font",
"font",
"=",
"StyleUtil",
".",
"createFont",
"(",
"this",
".",
"workbook",
",",
"color",
"... | 设置全局字体
@param color 字体颜色
@param fontSize 字体大小,-1表示默认大小
@param fontName 字体名,null表示默认字体
@param ignoreHead 是否跳过头部样式
@return this | [
"设置全局字体"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/StyleSet.java#L149-L152 |
TimotheeJeannin/ProviGen | ProviGenLib/src/com/tjeannin/provigen/helper/TableBuilder.java | TableBuilder.addConstraint | public TableBuilder addConstraint(String columnName, String constraintType, String constraintConflictClause) {
"""
Adds the specified constraint to the created table.
@param columnName The name of the column on which the constraint is applied.
@param constraintType The type of constrain... | java | public TableBuilder addConstraint(String columnName, String constraintType, String constraintConflictClause) {
constraints.add(new Constraint(columnName, constraintType, constraintConflictClause));
return this;
} | [
"public",
"TableBuilder",
"addConstraint",
"(",
"String",
"columnName",
",",
"String",
"constraintType",
",",
"String",
"constraintConflictClause",
")",
"{",
"constraints",
".",
"add",
"(",
"new",
"Constraint",
"(",
"columnName",
",",
"constraintType",
",",
"constra... | Adds the specified constraint to the created table.
@param columnName The name of the column on which the constraint is applied.
@param constraintType The type of constraint to apply.
One of
<ul>
<li>{@link com.tjeannin.provigen.model.Constraint#UNIQUE}</li>
<li>{@link com.tjeannin.provigen.mod... | [
"Adds",
"the",
"specified",
"constraint",
"to",
"the",
"created",
"table",
"."
] | train | https://github.com/TimotheeJeannin/ProviGen/blob/80c8a2021434a44e8d38c69407e3e6abf70cf21e/ProviGenLib/src/com/tjeannin/provigen/helper/TableBuilder.java#L48-L51 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.setPreviousElement | public void setPreviousElement(String element, String value) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException {
"""
Saves the value in the attribute in class extending C... | java | public void setPreviousElement(String element, String value) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException {
Reflections reflections = new Reflections("com.stratio... | [
"public",
"void",
"setPreviousElement",
"(",
"String",
"element",
",",
"String",
"value",
")",
"throws",
"NoSuchFieldException",
",",
"SecurityException",
",",
"IllegalArgumentException",
",",
"IllegalAccessException",
",",
"InstantiationException",
",",
"ClassNotFoundExcep... | Saves the value in the attribute in class extending CommonG.
@param element attribute in class where to store the value
@param value value to be stored
@throws NoSuchFieldException exception
@throws SecurityException exception
@throws IllegalArgumentException exception
@throws IllegalAccessException ... | [
"Saves",
"the",
"value",
"in",
"the",
"attribute",
"in",
"class",
"extending",
"CommonG",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L1361-L1372 |
skyscreamer/JSONassert | src/main/java/org/skyscreamer/jsonassert/JSONCompare.java | JSONCompare.compareJSON | public static JSONCompareResult compareJSON(JSONObject expected, JSONObject actual, JSONComparator comparator)
throws JSONException {
"""
Compares JSON object provided to the expected JSON object using provided comparator, and returns the results of
the comparison.
@param expected expected json objec... | java | public static JSONCompareResult compareJSON(JSONObject expected, JSONObject actual, JSONComparator comparator)
throws JSONException {
return comparator.compareJSON(expected, actual);
} | [
"public",
"static",
"JSONCompareResult",
"compareJSON",
"(",
"JSONObject",
"expected",
",",
"JSONObject",
"actual",
",",
"JSONComparator",
"comparator",
")",
"throws",
"JSONException",
"{",
"return",
"comparator",
".",
"compareJSON",
"(",
"expected",
",",
"actual",
... | Compares JSON object provided to the expected JSON object using provided comparator, and returns the results of
the comparison.
@param expected expected json object
@param actual actual json object
@param comparator comparator to use
@return result of the comparison
@throws JSONException JSON parsing error | [
"Compares",
"JSON",
"object",
"provided",
"to",
"the",
"expected",
"JSON",
"object",
"using",
"provided",
"comparator",
"and",
"returns",
"the",
"results",
"of",
"the",
"comparison",
"."
] | train | https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONCompare.java#L77-L80 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/mysql/AbstractMySQLQuery.java | AbstractMySQLQuery.bigResult | @WithBridgeMethods(value = MySQLQuery.class, castRequired = true)
public C bigResult() {
"""
For SQL_BIG_RESULT, MySQL directly uses disk-based temporary tables if needed, and prefers
sorting to using a temporary table with a key on the GROUP BY elements.
@return the current object
"""
return a... | java | @WithBridgeMethods(value = MySQLQuery.class, castRequired = true)
public C bigResult() {
return addFlag(Position.AFTER_SELECT, SQL_BIG_RESULT);
} | [
"@",
"WithBridgeMethods",
"(",
"value",
"=",
"MySQLQuery",
".",
"class",
",",
"castRequired",
"=",
"true",
")",
"public",
"C",
"bigResult",
"(",
")",
"{",
"return",
"addFlag",
"(",
"Position",
".",
"AFTER_SELECT",
",",
"SQL_BIG_RESULT",
")",
";",
"}"
] | For SQL_BIG_RESULT, MySQL directly uses disk-based temporary tables if needed, and prefers
sorting to using a temporary table with a key on the GROUP BY elements.
@return the current object | [
"For",
"SQL_BIG_RESULT",
"MySQL",
"directly",
"uses",
"disk",
"-",
"based",
"temporary",
"tables",
"if",
"needed",
"and",
"prefers",
"sorting",
"to",
"using",
"a",
"temporary",
"table",
"with",
"a",
"key",
"on",
"the",
"GROUP",
"BY",
"elements",
"."
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/mysql/AbstractMySQLQuery.java#L76-L79 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java | CommercePriceEntryPersistenceImpl.findByCPInstanceUuid | @Override
public List<CommercePriceEntry> findByCPInstanceUuid(
String CPInstanceUuid, int start, int end) {
"""
Returns a range of all the commerce price entries where CPInstanceUuid = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and... | java | @Override
public List<CommercePriceEntry> findByCPInstanceUuid(
String CPInstanceUuid, int start, int end) {
return findByCPInstanceUuid(CPInstanceUuid, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceEntry",
">",
"findByCPInstanceUuid",
"(",
"String",
"CPInstanceUuid",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCPInstanceUuid",
"(",
"CPInstanceUuid",
",",
"start",
",",
"end",
",",
... | Returns a range of all the commerce price entries where CPInstanceUuid = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"price",
"entries",
"where",
"CPInstanceUuid",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java#L3085-L3089 |
auth0/Lock.Android | lib/src/main/java/com/auth0/android/lock/PasswordlessLock.java | PasswordlessLock.newIntent | @SuppressWarnings("unused")
public Intent newIntent(Context context) {
"""
Builds a new intent to launch LockActivity with the previously configured options
@param context a valid Context
@return the intent to which the user has to call startActivity or startActivityForResult
"""
Intent lockInt... | java | @SuppressWarnings("unused")
public Intent newIntent(Context context) {
Intent lockIntent = new Intent(context, PasswordlessLockActivity.class);
lockIntent.putExtra(Constants.OPTIONS_EXTRA, options);
lockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return lockIntent;
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"Intent",
"newIntent",
"(",
"Context",
"context",
")",
"{",
"Intent",
"lockIntent",
"=",
"new",
"Intent",
"(",
"context",
",",
"PasswordlessLockActivity",
".",
"class",
")",
";",
"lockIntent",
".",
"pu... | Builds a new intent to launch LockActivity with the previously configured options
@param context a valid Context
@return the intent to which the user has to call startActivity or startActivityForResult | [
"Builds",
"a",
"new",
"intent",
"to",
"launch",
"LockActivity",
"with",
"the",
"previously",
"configured",
"options"
] | train | https://github.com/auth0/Lock.Android/blob/8eb2a979048d2eb6cf0ec631e82e6c3fe6e7d220/lib/src/main/java/com/auth0/android/lock/PasswordlessLock.java#L119-L125 |
dottydingo/hyperion | client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java | QueryBuilder.ne | public QueryExpression ne(String propertyName,String value) {
"""
Create a not equals expression
@param propertyName The propery name
@param value The value
@return The query expression
"""
return new SimpleQueryExpression(propertyName, ComparisonOperator.NOT_EQUAL,wrap(value));
} | java | public QueryExpression ne(String propertyName,String value)
{
return new SimpleQueryExpression(propertyName, ComparisonOperator.NOT_EQUAL,wrap(value));
} | [
"public",
"QueryExpression",
"ne",
"(",
"String",
"propertyName",
",",
"String",
"value",
")",
"{",
"return",
"new",
"SimpleQueryExpression",
"(",
"propertyName",
",",
"ComparisonOperator",
".",
"NOT_EQUAL",
",",
"wrap",
"(",
"value",
")",
")",
";",
"}"
] | Create a not equals expression
@param propertyName The propery name
@param value The value
@return The query expression | [
"Create",
"a",
"not",
"equals",
"expression"
] | train | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java#L92-L95 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/batch/BatchClient.java | BatchClient.listJobs | public ListJobsResponse listJobs(String marker, int maxKeys) {
"""
List Batch-Compute jobs owned by the authenticated user.
@param marker The start record of jobs.
@param maxKeys The maximum number of jobs returned.
@return The response containing a list of the Batch-Compute jobs owned by the authenticated se... | java | public ListJobsResponse listJobs(String marker, int maxKeys) {
return listJobs(new ListJobsRequest().withMaxKeys(maxKeys).withMarker(marker));
} | [
"public",
"ListJobsResponse",
"listJobs",
"(",
"String",
"marker",
",",
"int",
"maxKeys",
")",
"{",
"return",
"listJobs",
"(",
"new",
"ListJobsRequest",
"(",
")",
".",
"withMaxKeys",
"(",
"maxKeys",
")",
".",
"withMarker",
"(",
"marker",
")",
")",
";",
"}"... | List Batch-Compute jobs owned by the authenticated user.
@param marker The start record of jobs.
@param maxKeys The maximum number of jobs returned.
@return The response containing a list of the Batch-Compute jobs owned by the authenticated sender of the
request.
The jobs' records start from the marker and the size of... | [
"List",
"Batch",
"-",
"Compute",
"jobs",
"owned",
"by",
"the",
"authenticated",
"user",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/batch/BatchClient.java#L141-L143 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getFilteredGuildLogInfo | public void getFilteredGuildLogInfo(String id, String api, int since, Callback<List<GuildLog>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on guild log API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id/log">here</a><br/>
Give user the access to {@link Callback#onR... | java | public void getFilteredGuildLogInfo(String id, String api, int since, Callback<List<GuildLog>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api));
gw2API.getFilteredGuildLogInfo(id, api, Integer.toString(since)).enqu... | [
"public",
"void",
"getFilteredGuildLogInfo",
"(",
"String",
"id",
",",
"String",
"api",
",",
"int",
"since",
",",
"Callback",
"<",
"List",
"<",
"GuildLog",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamVali... | For more info on guild log API go <a href="https://wiki.guildwars2.com/wiki/API:2/guild/:id/log">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions<br/>
@param id guild id
@param api Guild leader's... | [
"For",
"more",
"info",
"on",
"guild",
"log",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"guild",
"/",
":",
"id",
"/",
"log",
">",
"here<",
"/",
"a",
">",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1484-L1487 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java | JavacTaskImpl.parseType | public Type parseType(String expr, TypeElement scope) {
"""
For internal use only. This method will be
removed without warning.
@param expr the type expression to be analyzed
@param scope the scope in which to analyze the type expression
@return the type
@throws IllegalArgumentException if the type expressio... | java | public Type parseType(String expr, TypeElement scope) {
if (expr == null || expr.equals(""))
throw new IllegalArgumentException();
compiler = JavaCompiler.instance(context);
JavaFileObject prev = compiler.log.useSource(null);
ParserFactory parserFactory = ParserFactory.instan... | [
"public",
"Type",
"parseType",
"(",
"String",
"expr",
",",
"TypeElement",
"scope",
")",
"{",
"if",
"(",
"expr",
"==",
"null",
"||",
"expr",
".",
"equals",
"(",
"\"\"",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"compiler",
"=",
... | For internal use only. This method will be
removed without warning.
@param expr the type expression to be analyzed
@param scope the scope in which to analyze the type expression
@return the type
@throws IllegalArgumentException if the type expression of null or empty | [
"For",
"internal",
"use",
"only",
".",
"This",
"method",
"will",
"be",
"removed",
"without",
"warning",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java#L518-L533 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java | SftpClient.get | public SftpFileAttributes get(String remote, String local,
FileTransferProgress progress) throws FileNotFoundException,
SftpStatusException, SshException, TransferCancelledException {
"""
<p>
Download the remote file to the local computer. If the paths provided are
not absolute the current working director... | java | public SftpFileAttributes get(String remote, String local,
FileTransferProgress progress) throws FileNotFoundException,
SftpStatusException, SshException, TransferCancelledException {
return get(remote, local, progress, false);
} | [
"public",
"SftpFileAttributes",
"get",
"(",
"String",
"remote",
",",
"String",
"local",
",",
"FileTransferProgress",
"progress",
")",
"throws",
"FileNotFoundException",
",",
"SftpStatusException",
",",
"SshException",
",",
"TransferCancelledException",
"{",
"return",
"g... | <p>
Download the remote file to the local computer. If the paths provided are
not absolute the current working directory is used.
</p>
@param remote
the path/name of the remote file
@param local
the path/name to place the file on the local computer
@param progress
@return the downloaded file's attributes
@throws Sft... | [
"<p",
">",
"Download",
"the",
"remote",
"file",
"to",
"the",
"local",
"computer",
".",
"If",
"the",
"paths",
"provided",
"are",
"not",
"absolute",
"the",
"current",
"working",
"directory",
"is",
"used",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java#L937-L941 |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/ui/PixelUtils.java | PixelUtils.getPixelFromDp | public static int getPixelFromDp(Context context, int dp) {
"""
Converts DP to Pixel<br>
@param dp DP
@return Pixel
@see <a href="http://developer.android.com/guide/practices/screens_support.html#dips-pels">http://developer.android.com/guide/practices/screens_support.html#dips-pels</a>
"""
// Get the s... | java | public static int getPixelFromDp(Context context, int dp) {
// Get the screen's density scale
float scale = context.getResources().getDisplayMetrics().density;
// Convert the dps to pixels, based on density scale
// because dp*scale is cast as an integer value, this will cause the result to be truncated.
/... | [
"public",
"static",
"int",
"getPixelFromDp",
"(",
"Context",
"context",
",",
"int",
"dp",
")",
"{",
"// Get the screen's density scale\t\t",
"float",
"scale",
"=",
"context",
".",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
".",
"density",
";",... | Converts DP to Pixel<br>
@param dp DP
@return Pixel
@see <a href="http://developer.android.com/guide/practices/screens_support.html#dips-pels">http://developer.android.com/guide/practices/screens_support.html#dips-pels</a> | [
"Converts",
"DP",
"to",
"Pixel<br",
">"
] | train | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/ui/PixelUtils.java#L37-L45 |
vladmihalcea/flexy-pool | flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/LazyJndiResolver.java | LazyJndiResolver.invoke | @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
"""
Resolves the JNDI object upon invoking any method on the associated Proxy
@param proxy proxy
@param method method
@param args arguments
@return return value
@throws Throwable in case of failures
"""
... | java | @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (target == null) {
target = JndiUtils.lookup(name);
}
return method.invoke(target, args);
} | [
"@",
"Override",
"public",
"Object",
"invoke",
"(",
"Object",
"proxy",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"if",
"(",
"target",
"==",
"null",
")",
"{",
"target",
"=",
"JndiUtils",
".",
"lookup",
"(... | Resolves the JNDI object upon invoking any method on the associated Proxy
@param proxy proxy
@param method method
@param args arguments
@return return value
@throws Throwable in case of failures | [
"Resolves",
"the",
"JNDI",
"object",
"upon",
"invoking",
"any",
"method",
"on",
"the",
"associated",
"Proxy"
] | train | https://github.com/vladmihalcea/flexy-pool/blob/d763d359e68299c2b4e28e4b67770581ae083431/flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/LazyJndiResolver.java#L44-L50 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.uploadBatchServiceLogs | public UploadBatchServiceLogsResult uploadBatchServiceLogs(String poolId, String nodeId, String containerUrl, DateTime startTime, DateTime endTime, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Upload Azure Batch service log files from the specified compute node t... | java | public UploadBatchServiceLogsResult uploadBatchServiceLogs(String poolId, String nodeId, String containerUrl, DateTime startTime, DateTime endTime, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
UploadBatchServiceLogsConfiguration configuration = new UploadBatchServ... | [
"public",
"UploadBatchServiceLogsResult",
"uploadBatchServiceLogs",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"containerUrl",
",",
"DateTime",
"startTime",
",",
"DateTime",
"endTime",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBe... | Upload Azure Batch service log files from the specified compute node to Azure Blob Storage.
This is for gathering Azure Batch service log files in an automated fashion from nodes if you are experiencing an error and wish to escalate to Azure support. The Azure Batch service log files should be shared with Azure support... | [
"Upload",
"Azure",
"Batch",
"service",
"log",
"files",
"from",
"the",
"specified",
"compute",
"node",
"to",
"Azure",
"Blob",
"Storage",
".",
"This",
"is",
"for",
"gathering",
"Azure",
"Batch",
"service",
"log",
"files",
"in",
"an",
"automated",
"fashion",
"f... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L573-L584 |
52inc/android-52Kit | library/src/main/java/com/ftinc/kit/util/IntentUtils.java | IntentUtils.isIntentAvailable | public static boolean isIntentAvailable(Context context, Intent intent) {
"""
Check that in the system exists application which can handle this intent
@param context Application context
@param intent Checked intent
@return true if intent consumer exists, false otherwise
"""
PackageManager package... | java | public static boolean isIntentAvailable(Context context, Intent intent) {
PackageManager packageManager = context.getPackageManager();
List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
return list.size() > 0;
} | [
"public",
"static",
"boolean",
"isIntentAvailable",
"(",
"Context",
"context",
",",
"Intent",
"intent",
")",
"{",
"PackageManager",
"packageManager",
"=",
"context",
".",
"getPackageManager",
"(",
")",
";",
"List",
"<",
"ResolveInfo",
">",
"list",
"=",
"packageM... | Check that in the system exists application which can handle this intent
@param context Application context
@param intent Checked intent
@return true if intent consumer exists, false otherwise | [
"Check",
"that",
"in",
"the",
"system",
"exists",
"application",
"which",
"can",
"handle",
"this",
"intent"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/IntentUtils.java#L493-L497 |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/shiro/AuthenticationManagerCommandAction.java | AuthenticationManagerCommandAction.persistRealmChanges | private void persistRealmChanges() {
"""
Persists the user accounts to a properties file that is only available to this site only.
"""
configManager.persistProperties(realm.getProperties(), new File(applicationContentDir, PersistablePropertiesRealm.REALM_FILE_NAME), null);
} | java | private void persistRealmChanges() {
configManager.persistProperties(realm.getProperties(), new File(applicationContentDir, PersistablePropertiesRealm.REALM_FILE_NAME), null);
} | [
"private",
"void",
"persistRealmChanges",
"(",
")",
"{",
"configManager",
".",
"persistProperties",
"(",
"realm",
".",
"getProperties",
"(",
")",
",",
"new",
"File",
"(",
"applicationContentDir",
",",
"PersistablePropertiesRealm",
".",
"REALM_FILE_NAME",
")",
",",
... | Persists the user accounts to a properties file that is only available to this site only. | [
"Persists",
"the",
"user",
"accounts",
"to",
"a",
"properties",
"file",
"that",
"is",
"only",
"available",
"to",
"this",
"site",
"only",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/shiro/AuthenticationManagerCommandAction.java#L80-L82 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/MergeRequestApi.java | MergeRequestApi.approveMergeRequest | public MergeRequest approveMergeRequest(Object projectIdOrPath, Integer mergeRequestIid, String sha) throws GitLabApiException {
"""
Approve a merge request.
Note: This API endpoint is only available on 8.9 EE and above.
<pre><code>GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/approve... | java | public MergeRequest approveMergeRequest(Object projectIdOrPath, Integer mergeRequestIid, String sha) throws GitLabApiException {
if (mergeRequestIid == null) {
throw new RuntimeException("mergeRequestIid cannot be null");
}
Form formData = new GitLabApiForm().withParam("sha", sha);... | [
"public",
"MergeRequest",
"approveMergeRequest",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"mergeRequestIid",
",",
"String",
"sha",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"mergeRequestIid",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeExcept... | Approve a merge request.
Note: This API endpoint is only available on 8.9 EE and above.
<pre><code>GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/approve</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param mergeRequestIid the ... | [
"Approve",
"a",
"merge",
"request",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/MergeRequestApi.java#L719-L728 |
venkatramanm/swf-all | swf/src/main/java/com/venky/swf/path/Path.java | Path.getUser | public User getUser(String fieldName, String fieldValue) {
"""
Can be cast to any user model class as the proxy implements all the user classes.
"""
Select q = new Select().from(User.class);
String nameColumn = ModelReflector.instance(User.class).getColumnDescriptor(fieldName).getName();
... | java | public User getUser(String fieldName, String fieldValue){
Select q = new Select().from(User.class);
String nameColumn = ModelReflector.instance(User.class).getColumnDescriptor(fieldName).getName();
q.where(new Expression(q.getPool(),nameColumn,Operator.EQ,new BindVariable(q.getPool(),fieldValue)... | [
"public",
"User",
"getUser",
"(",
"String",
"fieldName",
",",
"String",
"fieldValue",
")",
"{",
"Select",
"q",
"=",
"new",
"Select",
"(",
")",
".",
"from",
"(",
"User",
".",
"class",
")",
";",
"String",
"nameColumn",
"=",
"ModelReflector",
".",
"instance... | Can be cast to any user model class as the proxy implements all the user classes. | [
"Can",
"be",
"cast",
"to",
"any",
"user",
"model",
"class",
"as",
"the",
"proxy",
"implements",
"all",
"the",
"user",
"classes",
"."
] | train | https://github.com/venkatramanm/swf-all/blob/e6ca342df0645bf1122d81e302575014ad565b69/swf/src/main/java/com/venky/swf/path/Path.java#L677-L687 |
federkasten/appbundle-maven-plugin | src/main/java/sh/tak/appbundler/CreateApplicationBundleMojo.java | CreateApplicationBundleMojo.copyAdditionalBundledClasspathResources | private List<String> copyAdditionalBundledClasspathResources(File javaDirectory, String targetDirectoryName, List<FileSet> additionalBundledClasspathResources) throws MojoExecutionException {
"""
Copy additional dependencies into the $JAVAROOT directory.
@param javaDirectory
@param targetDirectoryName The dire... | java | private List<String> copyAdditionalBundledClasspathResources(File javaDirectory, String targetDirectoryName, List<FileSet> additionalBundledClasspathResources) throws MojoExecutionException {
// Create the destination directory
File destinationDirectory = new File(javaDirectory, targetDirectoryName);
... | [
"private",
"List",
"<",
"String",
">",
"copyAdditionalBundledClasspathResources",
"(",
"File",
"javaDirectory",
",",
"String",
"targetDirectoryName",
",",
"List",
"<",
"FileSet",
">",
"additionalBundledClasspathResources",
")",
"throws",
"MojoExecutionException",
"{",
"//... | Copy additional dependencies into the $JAVAROOT directory.
@param javaDirectory
@param targetDirectoryName The directory within $JAVAROOT that these
resources will be copied to
@param additionalBundledClasspathResources
@return A list of file names added
@throws MojoExecutionException | [
"Copy",
"additional",
"dependencies",
"into",
"the",
"$JAVAROOT",
"directory",
"."
] | train | https://github.com/federkasten/appbundle-maven-plugin/blob/4cdaf7e0da95c83bc8a045ba40cb3eef45d25a5f/src/main/java/sh/tak/appbundler/CreateApplicationBundleMojo.java#L559-L567 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/util/LevelDBProvider.java | LevelDBProvider.checkVersion | public static void checkVersion(DB db, StoreVersion newversion, ObjectMapper mapper) throws
IOException {
"""
Simple major.minor versioning scheme. Any incompatible changes should be across major
versions. Minor version differences are allowed -- meaning we should be able to read
dbs that are either earl... | java | public static void checkVersion(DB db, StoreVersion newversion, ObjectMapper mapper) throws
IOException {
byte[] bytes = db.get(StoreVersion.KEY);
if (bytes == null) {
storeVersion(db, newversion, mapper);
} else {
StoreVersion version = mapper.readValue(bytes, StoreVersion.class);
i... | [
"public",
"static",
"void",
"checkVersion",
"(",
"DB",
"db",
",",
"StoreVersion",
"newversion",
",",
"ObjectMapper",
"mapper",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"db",
".",
"get",
"(",
"StoreVersion",
".",
"KEY",
")",
";",
... | Simple major.minor versioning scheme. Any incompatible changes should be across major
versions. Minor version differences are allowed -- meaning we should be able to read
dbs that are either earlier *or* later on the minor version. | [
"Simple",
"major",
".",
"minor",
"versioning",
"scheme",
".",
"Any",
"incompatible",
"changes",
"should",
"be",
"across",
"major",
"versions",
".",
"Minor",
"version",
"differences",
"are",
"allowed",
"--",
"meaning",
"we",
"should",
"be",
"able",
"to",
"read"... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/util/LevelDBProvider.java#L102-L115 |
Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java | RangeUtils.bisectTokeRange | private static void bisectTokeRange(
DeepTokenRange range, final IPartitioner partitioner, final int bisectFactor,
final List<DeepTokenRange> accumulator) {
"""
Recursive function that splits a given token range to a given number of token ranges.
@param range the token range to be... | java | private static void bisectTokeRange(
DeepTokenRange range, final IPartitioner partitioner, final int bisectFactor,
final List<DeepTokenRange> accumulator) {
final AbstractType tkValidator = partitioner.getTokenValidator();
Token leftToken = partitioner.getTokenFactory().fromByt... | [
"private",
"static",
"void",
"bisectTokeRange",
"(",
"DeepTokenRange",
"range",
",",
"final",
"IPartitioner",
"partitioner",
",",
"final",
"int",
"bisectFactor",
",",
"final",
"List",
"<",
"DeepTokenRange",
">",
"accumulator",
")",
"{",
"final",
"AbstractType",
"t... | Recursive function that splits a given token range to a given number of token ranges.
@param range the token range to be splitted.
@param partitioner the cassandra partitioner.
@param bisectFactor the actual number of pieces the original token range will be splitted to.
@param accumulator a token range accumu... | [
"Recursive",
"function",
"that",
"splits",
"a",
"given",
"token",
"range",
"to",
"a",
"given",
"number",
"of",
"token",
"ranges",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java#L209-L231 |
Azure/azure-sdk-for-java | common/azure-common/src/main/java/com/azure/common/implementation/SwaggerMethodParser.java | SwaggerMethodParser.isExpectedResponseStatusCode | public boolean isExpectedResponseStatusCode(int responseStatusCode, int[] additionalAllowedStatusCodes) {
"""
Get whether or not the provided response status code is one of the expected status codes for
this Swagger method.
@param responseStatusCode the status code that was returned in the HTTP response
@para... | java | public boolean isExpectedResponseStatusCode(int responseStatusCode, int[] additionalAllowedStatusCodes) {
boolean result;
if (expectedStatusCodes == null) {
result = (responseStatusCode < 400);
} else {
result = contains(expectedStatusCodes, responseStatusCode)
... | [
"public",
"boolean",
"isExpectedResponseStatusCode",
"(",
"int",
"responseStatusCode",
",",
"int",
"[",
"]",
"additionalAllowedStatusCodes",
")",
"{",
"boolean",
"result",
";",
"if",
"(",
"expectedStatusCodes",
"==",
"null",
")",
"{",
"result",
"=",
"(",
"response... | Get whether or not the provided response status code is one of the expected status codes for
this Swagger method.
@param responseStatusCode the status code that was returned in the HTTP response
@param additionalAllowedStatusCodes an additional set of allowed status codes that will be
merged with the existing set of a... | [
"Get",
"whether",
"or",
"not",
"the",
"provided",
"response",
"status",
"code",
"is",
"one",
"of",
"the",
"expected",
"status",
"codes",
"for",
"this",
"Swagger",
"method",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/common/azure-common/src/main/java/com/azure/common/implementation/SwaggerMethodParser.java#L370-L381 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.deleteSynonym | public JSONObject deleteSynonym(String objectID, RequestOptions requestOptions) throws AlgoliaException {
"""
Delete one synonym
@param objectID The objectId of the synonym to delete
@param requestOptions Options to pass to this request
"""
return deleteSynonym(objectID, false, requestOptions);
... | java | public JSONObject deleteSynonym(String objectID, RequestOptions requestOptions) throws AlgoliaException {
return deleteSynonym(objectID, false, requestOptions);
} | [
"public",
"JSONObject",
"deleteSynonym",
"(",
"String",
"objectID",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"return",
"deleteSynonym",
"(",
"objectID",
",",
"false",
",",
"requestOptions",
")",
";",
"}"
] | Delete one synonym
@param objectID The objectId of the synonym to delete
@param requestOptions Options to pass to this request | [
"Delete",
"one",
"synonym"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1525-L1527 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.attach | void attach(JCTree tree, Comment dc) {
"""
Make an entry into docComments hashtable,
provided flag keepDocComments is set and given doc comment is non-null.
@param tree The tree to be used as index in the hashtable
@param dc The doc comment to associate with the tree, or null.
"""
if (keepDocC... | java | void attach(JCTree tree, Comment dc) {
if (keepDocComments && dc != null) {
// System.out.println("doc comment = ");System.out.println(dc);//DEBUG
docComments.putComment(tree, dc);
}
} | [
"void",
"attach",
"(",
"JCTree",
"tree",
",",
"Comment",
"dc",
")",
"{",
"if",
"(",
"keepDocComments",
"&&",
"dc",
"!=",
"null",
")",
"{",
"// System.out.println(\"doc comment = \");System.out.println(dc);//DEBUG",
"docComments",
".",
"putComment",
"(",
"tree... | Make an entry into docComments hashtable,
provided flag keepDocComments is set and given doc comment is non-null.
@param tree The tree to be used as index in the hashtable
@param dc The doc comment to associate with the tree, or null. | [
"Make",
"an",
"entry",
"into",
"docComments",
"hashtable",
"provided",
"flag",
"keepDocComments",
"is",
"set",
"and",
"given",
"doc",
"comment",
"is",
"non",
"-",
"null",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/parser/JavacParser.java#L550-L555 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.