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 |
|---|---|---|---|---|---|---|---|---|---|---|
javalite/activejdbc | javalite-common/src/main/java/org/javalite/http/Request.java | Request.text | public String text() {
"""
Fetches response content from server as String.
@return response content from server as String.
"""
try {
connect();
return responseCode() >= 400 ? read(connection.getErrorStream()) : read(connection.getInputStream());
} catch (IOException e... | java | public String text() {
try {
connect();
return responseCode() >= 400 ? read(connection.getErrorStream()) : read(connection.getInputStream());
} catch (IOException e) {
throw new HttpException("Failed URL: " + url, e);
}finally {
dispose();
... | [
"public",
"String",
"text",
"(",
")",
"{",
"try",
"{",
"connect",
"(",
")",
";",
"return",
"responseCode",
"(",
")",
">=",
"400",
"?",
"read",
"(",
"connection",
".",
"getErrorStream",
"(",
")",
")",
":",
"read",
"(",
"connection",
".",
"getInputStream... | Fetches response content from server as String.
@return response content from server as String. | [
"Fetches",
"response",
"content",
"from",
"server",
"as",
"String",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/javalite-common/src/main/java/org/javalite/http/Request.java#L163-L172 |
pushtorefresh/storio | storio-content-resolver/src/main/java/com/pushtorefresh/storio3/contentresolver/operations/put/PutResult.java | PutResult.newUpdateResult | @NonNull
public static PutResult newUpdateResult(int numberOfRowsUpdated, @NonNull Uri affectedUri) {
"""
Creates {@link PutResult} for update.
@param numberOfRowsUpdated number of rows that were updated, must be {@code >= 0}.
@param affectedUri Uri that was affected by update.
@return new {@link ... | java | @NonNull
public static PutResult newUpdateResult(int numberOfRowsUpdated, @NonNull Uri affectedUri) {
return new PutResult(null, numberOfRowsUpdated, affectedUri);
} | [
"@",
"NonNull",
"public",
"static",
"PutResult",
"newUpdateResult",
"(",
"int",
"numberOfRowsUpdated",
",",
"@",
"NonNull",
"Uri",
"affectedUri",
")",
"{",
"return",
"new",
"PutResult",
"(",
"null",
",",
"numberOfRowsUpdated",
",",
"affectedUri",
")",
";",
"}"
] | Creates {@link PutResult} for update.
@param numberOfRowsUpdated number of rows that were updated, must be {@code >= 0}.
@param affectedUri Uri that was affected by update.
@return new {@link PutResult} instance. | [
"Creates",
"{",
"@link",
"PutResult",
"}",
"for",
"update",
"."
] | train | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-content-resolver/src/main/java/com/pushtorefresh/storio3/contentresolver/operations/put/PutResult.java#L55-L58 |
elki-project/elki | elki-core-dbids-int/src/main/java/de/lmu/ifi/dbs/elki/database/ids/integer/DoubleIntegerDBIDArrayList.java | DoubleIntegerDBIDArrayList.addInternal | protected void addInternal(double dist, int id) {
"""
Add an entry, consisting of distance and internal index.
@param dist Distance
@param id Internal index
"""
if(size == dists.length) {
grow();
}
dists[size] = dist;
ids[size] = id;
++size;
} | java | protected void addInternal(double dist, int id) {
if(size == dists.length) {
grow();
}
dists[size] = dist;
ids[size] = id;
++size;
} | [
"protected",
"void",
"addInternal",
"(",
"double",
"dist",
",",
"int",
"id",
")",
"{",
"if",
"(",
"size",
"==",
"dists",
".",
"length",
")",
"{",
"grow",
"(",
")",
";",
"}",
"dists",
"[",
"size",
"]",
"=",
"dist",
";",
"ids",
"[",
"size",
"]",
... | Add an entry, consisting of distance and internal index.
@param dist Distance
@param id Internal index | [
"Add",
"an",
"entry",
"consisting",
"of",
"distance",
"and",
"internal",
"index",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids-int/src/main/java/de/lmu/ifi/dbs/elki/database/ids/integer/DoubleIntegerDBIDArrayList.java#L132-L139 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/UniverseApi.java | UniverseApi.getUniverseMoonsMoonId | public MoonResponse getUniverseMoonsMoonId(Integer moonId, String datasource, String ifNoneMatch)
throws ApiException {
"""
Get moon information Get information on a moon --- This route expires
daily at 11:05
@param moonId
moon_id integer (required)
@param datasource
The server name you would li... | java | public MoonResponse getUniverseMoonsMoonId(Integer moonId, String datasource, String ifNoneMatch)
throws ApiException {
ApiResponse<MoonResponse> resp = getUniverseMoonsMoonIdWithHttpInfo(moonId, datasource, ifNoneMatch);
return resp.getData();
} | [
"public",
"MoonResponse",
"getUniverseMoonsMoonId",
"(",
"Integer",
"moonId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"MoonResponse",
">",
"resp",
"=",
"getUniverseMoonsMoonIdWithHttpInfo",
"(",
... | Get moon information Get information on a moon --- This route expires
daily at 11:05
@param moonId
moon_id integer (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch
ETag from a previous request. A 304 will be returned if this
matches the current... | [
"Get",
"moon",
"information",
"Get",
"information",
"on",
"a",
"moon",
"---",
"This",
"route",
"expires",
"daily",
"at",
"11",
":",
"05"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/UniverseApi.java#L2020-L2024 |
azkaban/azkaban | az-core/src/main/java/azkaban/utils/Utils.java | Utils.callConstructor | public static Object callConstructor(final Class<?> cls, final Object... args) {
"""
Construct a class object with the given arguments
@param cls The class
@param args The arguments
@return Constructed Object
"""
return callConstructor(cls, getTypes(args), args);
} | java | public static Object callConstructor(final Class<?> cls, final Object... args) {
return callConstructor(cls, getTypes(args), args);
} | [
"public",
"static",
"Object",
"callConstructor",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"return",
"callConstructor",
"(",
"cls",
",",
"getTypes",
"(",
"args",
")",
",",
"args",
")",
";",
"}"
] | Construct a class object with the given arguments
@param cls The class
@param args The arguments
@return Constructed Object | [
"Construct",
"a",
"class",
"object",
"with",
"the",
"given",
"arguments"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/Utils.java#L277-L279 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java | H2InboundLink.createNewInboundLink | public H2StreamProcessor createNewInboundLink(Integer streamID) {
"""
Create a new stream and add it to this link. If the stream ID is even, check to make sure this link has not exceeded
the maximum number of concurrent streams (as set by the client); if too many streams are open, don't open a new one.
@param ... | java | public H2StreamProcessor createNewInboundLink(Integer streamID) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "createNewInboundLink entry: stream-id: " + streamID);
}
if ((streamID % 2 == 0) && (streamID != 0)) {
synchronized (streamOpe... | [
"public",
"H2StreamProcessor",
"createNewInboundLink",
"(",
"Integer",
"streamID",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"crea... | Create a new stream and add it to this link. If the stream ID is even, check to make sure this link has not exceeded
the maximum number of concurrent streams (as set by the client); if too many streams are open, don't open a new one.
@param streamID
@return null if creating this stream would exceed the maximum number ... | [
"Create",
"a",
"new",
"stream",
"and",
"add",
"it",
"to",
"this",
"link",
".",
"If",
"the",
"stream",
"ID",
"is",
"even",
"check",
"to",
"make",
"sure",
"this",
"link",
"has",
"not",
"exceeded",
"the",
"maximum",
"number",
"of",
"concurrent",
"streams",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java#L219-L250 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/receivers/db/DBReceiverJob.java | DBReceiverJob.getProperties | void getProperties(Connection connection, long id, LoggingEvent event)
throws SQLException {
"""
Retrieve the event properties from the logging_event_property table.
@param connection
@param id
@param event
@throws SQLException
"""
PreparedStatement statement = connection.prepareStatement(sqlP... | java | void getProperties(Connection connection, long id, LoggingEvent event)
throws SQLException {
PreparedStatement statement = connection.prepareStatement(sqlProperties);
try {
statement.setLong(1, id);
ResultSet rs = statement.executeQuery();
while (rs.next()) {
String key = rs.ge... | [
"void",
"getProperties",
"(",
"Connection",
"connection",
",",
"long",
"id",
",",
"LoggingEvent",
"event",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"statement",
"=",
"connection",
".",
"prepareStatement",
"(",
"sqlProperties",
")",
";",
"try",
"{",... | Retrieve the event properties from the logging_event_property table.
@param connection
@param id
@param event
@throws SQLException | [
"Retrieve",
"the",
"event",
"properties",
"from",
"the",
"logging_event_property",
"table",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/db/DBReceiverJob.java#L172-L188 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_orderable_feature_GET | public Boolean serviceName_orderable_feature_GET(String serviceName, OvhOrderableSysFeatureEnum feature) throws IOException {
"""
Is this feature orderable with your server
REST: GET /dedicated/server/{serviceName}/orderable/feature
@param feature [required] the feature
@param serviceName [required] The inter... | java | public Boolean serviceName_orderable_feature_GET(String serviceName, OvhOrderableSysFeatureEnum feature) throws IOException {
String qPath = "/dedicated/server/{serviceName}/orderable/feature";
StringBuilder sb = path(qPath, serviceName);
query(sb, "feature", feature);
String resp = exec(qPath, "GET", sb.toStri... | [
"public",
"Boolean",
"serviceName_orderable_feature_GET",
"(",
"String",
"serviceName",
",",
"OvhOrderableSysFeatureEnum",
"feature",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/orderable/feature\"",
";",
"StringBuilder",
"sb",
... | Is this feature orderable with your server
REST: GET /dedicated/server/{serviceName}/orderable/feature
@param feature [required] the feature
@param serviceName [required] The internal name of your dedicated server | [
"Is",
"this",
"feature",
"orderable",
"with",
"your",
"server"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L283-L289 |
HsiangLeekwok/hlklib | hlklib/src/main/java/com/hlk/hlklib/lib/emoji/EmojiUtility.java | EmojiUtility.dealExpression | private static void dealExpression(Context context, SpannableString spannableString, Pattern patten, int start, boolean adjustEmoji)
throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
"""
对spanableString进行正则判断,如果符合要求,则以表情图片代替
@param context con... | java | private static void dealExpression(Context context, SpannableString spannableString, Pattern patten, int start, boolean adjustEmoji)
throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
Matcher matcher = patten.matcher(spannableString);
while (ma... | [
"private",
"static",
"void",
"dealExpression",
"(",
"Context",
"context",
",",
"SpannableString",
"spannableString",
",",
"Pattern",
"patten",
",",
"int",
"start",
",",
"boolean",
"adjustEmoji",
")",
"throws",
"SecurityException",
",",
"NoSuchFieldException",
",",
"... | 对spanableString进行正则判断,如果符合要求,则以表情图片代替
@param context context
@param spannableString htmlstring
@param patten patten
@param start start index
@param adjustEmoji 是否缩放表情图
@throws SecurityException
@throws NoSuchFieldException
@throws NumberFormatException
@throws IllegalArgumentException
@t... | [
"对spanableString进行正则判断,如果符合要求,则以表情图片代替"
] | train | https://github.com/HsiangLeekwok/hlklib/blob/b122f6dcab7cec60c8e5455e0c31613d08bec6ad/hlklib/src/main/java/com/hlk/hlklib/lib/emoji/EmojiUtility.java#L116-L148 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QRDecompositionHouseholderColumn_ZDRM.java | QRDecompositionHouseholderColumn_ZDRM.getQ | @Override
public ZMatrixRMaj getQ(ZMatrixRMaj Q , boolean compact ) {
"""
Computes the Q matrix from the imformation stored in the QR matrix. This
operation requires about 4(m<sup>2</sup>n-mn<sup>2</sup>+n<sup>3</sup>/3) flops.
@param Q The orthogonal Q matrix.
"""
if( compact )
Q ... | java | @Override
public ZMatrixRMaj getQ(ZMatrixRMaj Q , boolean compact ) {
if( compact )
Q = UtilDecompositons_ZDRM.checkIdentity(Q,numRows,minLength);
else
Q = UtilDecompositons_ZDRM.checkIdentity(Q,numRows,numRows);
for( int j = minLength-1; j >= 0; j-- ) {
... | [
"@",
"Override",
"public",
"ZMatrixRMaj",
"getQ",
"(",
"ZMatrixRMaj",
"Q",
",",
"boolean",
"compact",
")",
"{",
"if",
"(",
"compact",
")",
"Q",
"=",
"UtilDecompositons_ZDRM",
".",
"checkIdentity",
"(",
"Q",
",",
"numRows",
",",
"minLength",
")",
";",
"else... | Computes the Q matrix from the imformation stored in the QR matrix. This
operation requires about 4(m<sup>2</sup>n-mn<sup>2</sup>+n<sup>3</sup>/3) flops.
@param Q The orthogonal Q matrix. | [
"Computes",
"the",
"Q",
"matrix",
"from",
"the",
"imformation",
"stored",
"in",
"the",
"QR",
"matrix",
".",
"This",
"operation",
"requires",
"about",
"4",
"(",
"m<sup",
">",
"2<",
"/",
"sup",
">",
"n",
"-",
"mn<sup",
">",
"2<",
"/",
"sup",
">",
"+",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QRDecompositionHouseholderColumn_ZDRM.java#L99-L123 |
cogroo/cogroo4 | lang/pt_br/cogroo-addon/src/org/cogroo/addon/dialogs/reporterror/ErrorReportDialog.java | ErrorReportDialog.setIsStepEnabled | private void setIsStepEnabled(int step, boolean isEnabled) {
"""
Configure the steps that are enabled.
@param step step to configure
@param isEnabled if it is enabled
"""
try {
Object oRoadmapItem = m_xRMIndexCont.getByIndex(step - 1);
XPropertySet xRMItemPSet = (XPropertySet)... | java | private void setIsStepEnabled(int step, boolean isEnabled) {
try {
Object oRoadmapItem = m_xRMIndexCont.getByIndex(step - 1);
XPropertySet xRMItemPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRoadmapItem);
xRMItemPSet.setPropertyValue("Enabled", new Boo... | [
"private",
"void",
"setIsStepEnabled",
"(",
"int",
"step",
",",
"boolean",
"isEnabled",
")",
"{",
"try",
"{",
"Object",
"oRoadmapItem",
"=",
"m_xRMIndexCont",
".",
"getByIndex",
"(",
"step",
"-",
"1",
")",
";",
"XPropertySet",
"xRMItemPSet",
"=",
"(",
"XProp... | Configure the steps that are enabled.
@param step step to configure
@param isEnabled if it is enabled | [
"Configure",
"the",
"steps",
"that",
"are",
"enabled",
"."
] | train | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/lang/pt_br/cogroo-addon/src/org/cogroo/addon/dialogs/reporterror/ErrorReportDialog.java#L524-L533 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/spi/impl/eventservice/impl/EventServiceSegment.java | EventServiceSegment.addRegistration | public boolean addRegistration(String topic, Registration registration) {
"""
Adds a registration for the {@code topic} and notifies the listener and service of the listener
registration. Returns if the registration was added. The registration might not be added
if an equal instance is already registered.
@pa... | java | public boolean addRegistration(String topic, Registration registration) {
Collection<Registration> registrations = getRegistrations(topic, true);
if (registrations.add(registration)) {
registrationIdMap.put(registration.getId(), registration);
pingNotifiableEventListener(topic, r... | [
"public",
"boolean",
"addRegistration",
"(",
"String",
"topic",
",",
"Registration",
"registration",
")",
"{",
"Collection",
"<",
"Registration",
">",
"registrations",
"=",
"getRegistrations",
"(",
"topic",
",",
"true",
")",
";",
"if",
"(",
"registrations",
".",... | Adds a registration for the {@code topic} and notifies the listener and service of the listener
registration. Returns if the registration was added. The registration might not be added
if an equal instance is already registered.
@param topic the event topic
@param registration the listener registration
@return ... | [
"Adds",
"a",
"registration",
"for",
"the",
"{",
"@code",
"topic",
"}",
"and",
"notifies",
"the",
"listener",
"and",
"service",
"of",
"the",
"listener",
"registration",
".",
"Returns",
"if",
"the",
"registration",
"was",
"added",
".",
"The",
"registration",
"... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/eventservice/impl/EventServiceSegment.java#L153-L161 |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java | MailService.findMessages | public List<MailMessage> findMessages(final String accountReservationKey, final Predicate<MailMessage> condition,
final long timeoutSeconds) {
"""
Tries to find messages for the mail account reserved under the specified
{@code accountReservationKey} applying the specified {@code condition} until it times out
... | java | public List<MailMessage> findMessages(final String accountReservationKey, final Predicate<MailMessage> condition,
final long timeoutSeconds) {
return findMessages(accountReservationKey, condition, timeoutSeconds, defaultSleepMillis);
} | [
"public",
"List",
"<",
"MailMessage",
">",
"findMessages",
"(",
"final",
"String",
"accountReservationKey",
",",
"final",
"Predicate",
"<",
"MailMessage",
">",
"condition",
",",
"final",
"long",
"timeoutSeconds",
")",
"{",
"return",
"findMessages",
"(",
"accountRe... | Tries to find messages for the mail account reserved under the specified
{@code accountReservationKey} applying the specified {@code condition} until it times out
using the specified {@code timeout} and {@link EmailConstants#MAIL_SLEEP_MILLIS}.
@param accountReservationKey
the key under which the account has been rese... | [
"Tries",
"to",
"find",
"messages",
"for",
"the",
"mail",
"account",
"reserved",
"under",
"the",
"specified",
"{",
"@code",
"accountReservationKey",
"}",
"applying",
"the",
"specified",
"{",
"@code",
"condition",
"}",
"until",
"it",
"times",
"out",
"using",
"th... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java#L302-L305 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getNestingPageFlow | public static PageFlowController getNestingPageFlow( HttpServletRequest request, ServletContext servletContext ) {
"""
Get the {@link PageFlowController} that is nesting the current one.
@param request the current HttpServletRequest.
@param servletContext the current ServletContext.
@return the nesting {@link... | java | public static PageFlowController getNestingPageFlow( HttpServletRequest request, ServletContext servletContext )
{
PageFlowStack jpfStack = PageFlowStack.get( request, servletContext, false );
if ( jpfStack != null && ! jpfStack.isEmpty() )
{
PageFlowController top = jpf... | [
"public",
"static",
"PageFlowController",
"getNestingPageFlow",
"(",
"HttpServletRequest",
"request",
",",
"ServletContext",
"servletContext",
")",
"{",
"PageFlowStack",
"jpfStack",
"=",
"PageFlowStack",
".",
"get",
"(",
"request",
",",
"servletContext",
",",
"false",
... | Get the {@link PageFlowController} that is nesting the current one.
@param request the current HttpServletRequest.
@param servletContext the current ServletContext.
@return the nesting {@link PageFlowController}, or <code>null</code> if the current one
is not being nested. | [
"Get",
"the",
"{",
"@link",
"PageFlowController",
"}",
"that",
"is",
"nesting",
"the",
"current",
"one",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L231-L242 |
google/error-prone-javac | src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Main.java | Main.run | public static int run(String[] args, PrintWriter out) {
"""
Entry point that does <i>not</i> call System.exit.
@param args command line arguments
@param out output stream
@return an exit code. 0 means success, non-zero means an error occurred.
"""
JdepsTask t = new JdepsTask();
t.setLog(ou... | java | public static int run(String[] args, PrintWriter out) {
JdepsTask t = new JdepsTask();
t.setLog(out);
return t.run(args);
} | [
"public",
"static",
"int",
"run",
"(",
"String",
"[",
"]",
"args",
",",
"PrintWriter",
"out",
")",
"{",
"JdepsTask",
"t",
"=",
"new",
"JdepsTask",
"(",
")",
";",
"t",
".",
"setLog",
"(",
"out",
")",
";",
"return",
"t",
".",
"run",
"(",
"args",
")... | Entry point that does <i>not</i> call System.exit.
@param args command line arguments
@param out output stream
@return an exit code. 0 means success, non-zero means an error occurred. | [
"Entry",
"point",
"that",
"does",
"<i",
">",
"not<",
"/",
"i",
">",
"call",
"System",
".",
"exit",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Main.java#L61-L65 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/CopticDate.java | CopticDate.ofYearDay | static CopticDate ofYearDay(int prolepticYear, int dayOfYear) {
"""
Obtains a {@code CopticDate} representing a date in the Coptic calendar
system from the proleptic-year and day-of-year fields.
<p>
This returns a {@code CopticDate} with the specified fields.
The day must be valid for the year, otherwise an ex... | java | static CopticDate ofYearDay(int prolepticYear, int dayOfYear) {
CopticChronology.YEAR_RANGE.checkValidValue(prolepticYear, YEAR);
DAY_OF_YEAR.range().checkValidValue(dayOfYear, DAY_OF_YEAR);
if (dayOfYear == 366 && CopticChronology.INSTANCE.isLeapYear(prolepticYear) == false) {
throw... | [
"static",
"CopticDate",
"ofYearDay",
"(",
"int",
"prolepticYear",
",",
"int",
"dayOfYear",
")",
"{",
"CopticChronology",
".",
"YEAR_RANGE",
".",
"checkValidValue",
"(",
"prolepticYear",
",",
"YEAR",
")",
";",
"DAY_OF_YEAR",
".",
"range",
"(",
")",
".",
"checkV... | Obtains a {@code CopticDate} representing a date in the Coptic calendar
system from the proleptic-year and day-of-year fields.
<p>
This returns a {@code CopticDate} with the specified fields.
The day must be valid for the year, otherwise an exception will be thrown.
@param prolepticYear the Coptic proleptic-year
@par... | [
"Obtains",
"a",
"{",
"@code",
"CopticDate",
"}",
"representing",
"a",
"date",
"in",
"the",
"Coptic",
"calendar",
"system",
"from",
"the",
"proleptic",
"-",
"year",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
".",
"<p",
">",
"This",
"returns",
"a",
... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/CopticDate.java#L201-L208 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/filecache/DistributedCache.java | DistributedCache.createAllSymlink | public static void createAllSymlink(Configuration conf, File jobCacheDir, File
workDir)
throws IOException {
"""
This method create symlinks for all files in a given dir in another
directory
@param conf the configuration
@param jobCacheDir the target directory for creating symlinks
@param workDir the... | java | public static void createAllSymlink(Configuration conf, File jobCacheDir, File
workDir)
throws IOException{
if ((jobCacheDir == null || !jobCacheDir.isDirectory()) ||
workDir == null || (!workDir.isDirectory())) {
return;
}
boolean createSymlink = getSymlink(conf);
if (createS... | [
"public",
"static",
"void",
"createAllSymlink",
"(",
"Configuration",
"conf",
",",
"File",
"jobCacheDir",
",",
"File",
"workDir",
")",
"throws",
"IOException",
"{",
"if",
"(",
"(",
"jobCacheDir",
"==",
"null",
"||",
"!",
"jobCacheDir",
".",
"isDirectory",
"(",... | This method create symlinks for all files in a given dir in another
directory
@param conf the configuration
@param jobCacheDir the target directory for creating symlinks
@param workDir the directory in which the symlinks are created
@throws IOException | [
"This",
"method",
"create",
"symlinks",
"for",
"all",
"files",
"in",
"a",
"given",
"dir",
"in",
"another",
"directory"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/filecache/DistributedCache.java#L674-L689 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/Tesseract1.java | Tesseract1.createDocuments | @Override
public void createDocuments(String filename, String outputbase, List<RenderedFormat> formats) throws TesseractException {
"""
Creates documents for given renderer.
@param filename input image
@param outputbase output filename without extension
@param formats types of renderer
@throws TesseractE... | java | @Override
public void createDocuments(String filename, String outputbase, List<RenderedFormat> formats) throws TesseractException {
createDocuments(new String[]{filename}, new String[]{outputbase}, formats);
} | [
"@",
"Override",
"public",
"void",
"createDocuments",
"(",
"String",
"filename",
",",
"String",
"outputbase",
",",
"List",
"<",
"RenderedFormat",
">",
"formats",
")",
"throws",
"TesseractException",
"{",
"createDocuments",
"(",
"new",
"String",
"[",
"]",
"{",
... | Creates documents for given renderer.
@param filename input image
@param outputbase output filename without extension
@param formats types of renderer
@throws TesseractException | [
"Creates",
"documents",
"for",
"given",
"renderer",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L579-L582 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/AbstractLine.java | AbstractLine.crossPoint | public static Point crossPoint(Line l1, Line l2, AbstractPoint p) {
"""
Returns the crosspoint of lines l1 and l2. If lines don't cross returns null.
<p>Note returns null if lines are parallel and also when lines ate equal.!
<p>If p != null returns populated p.
<p>If returns null p is not updated.
@param... | java | public static Point crossPoint(Line l1, Line l2, AbstractPoint p)
{
if (Double.isInfinite(l1.getSlope()))
{
if (Double.isInfinite(l2.getSlope()))
{
return null;
}
else
{
return cyclePoint(p, l1.getA... | [
"public",
"static",
"Point",
"crossPoint",
"(",
"Line",
"l1",
",",
"Line",
"l2",
",",
"AbstractPoint",
"p",
")",
"{",
"if",
"(",
"Double",
".",
"isInfinite",
"(",
"l1",
".",
"getSlope",
"(",
")",
")",
")",
"{",
"if",
"(",
"Double",
".",
"isInfinite",... | Returns the crosspoint of lines l1 and l2. If lines don't cross returns null.
<p>Note returns null if lines are parallel and also when lines ate equal.!
<p>If p != null returns populated p.
<p>If returns null p is not updated.
@param l1
@param l2
@param p
@return | [
"Returns",
"the",
"crosspoint",
"of",
"lines",
"l1",
"and",
"l2",
".",
"If",
"lines",
"don",
"t",
"cross",
"returns",
"null",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/AbstractLine.java#L174-L214 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/TextCharacter.java | TextCharacter.withForegroundColor | public TextCharacter withForegroundColor(TextColor foregroundColor) {
"""
Returns a copy of this TextCharacter with a specified foreground color
@param foregroundColor Foreground color the copy should have
@return Copy of the TextCharacter with a different foreground color
"""
if(this.foregroundColor... | java | public TextCharacter withForegroundColor(TextColor foregroundColor) {
if(this.foregroundColor == foregroundColor || this.foregroundColor.equals(foregroundColor)) {
return this;
}
return new TextCharacter(character, foregroundColor, backgroundColor, modifiers);
} | [
"public",
"TextCharacter",
"withForegroundColor",
"(",
"TextColor",
"foregroundColor",
")",
"{",
"if",
"(",
"this",
".",
"foregroundColor",
"==",
"foregroundColor",
"||",
"this",
".",
"foregroundColor",
".",
"equals",
"(",
"foregroundColor",
")",
")",
"{",
"return... | Returns a copy of this TextCharacter with a specified foreground color
@param foregroundColor Foreground color the copy should have
@return Copy of the TextCharacter with a different foreground color | [
"Returns",
"a",
"copy",
"of",
"this",
"TextCharacter",
"with",
"a",
"specified",
"foreground",
"color"
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/TextCharacter.java#L225-L230 |
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java | ElementFilter.methodsIn | public static List<ExecutableElement>
methodsIn(Iterable<? extends Element> elements) {
"""
Returns a list of methods in {@code elements}.
@return a list of methods in {@code elements}
@param elements the elements to filter
"""
return listFilter(elements, METHOD_KIND, ExecutableElement.cl... | java | public static List<ExecutableElement>
methodsIn(Iterable<? extends Element> elements) {
return listFilter(elements, METHOD_KIND, ExecutableElement.class);
} | [
"public",
"static",
"List",
"<",
"ExecutableElement",
">",
"methodsIn",
"(",
"Iterable",
"<",
"?",
"extends",
"Element",
">",
"elements",
")",
"{",
"return",
"listFilter",
"(",
"elements",
",",
"METHOD_KIND",
",",
"ExecutableElement",
".",
"class",
")",
";",
... | Returns a list of methods in {@code elements}.
@return a list of methods in {@code elements}
@param elements the elements to filter | [
"Returns",
"a",
"list",
"of",
"methods",
"in",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java#L132-L135 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Stream.java | Stream.parallelConcat | public static <T> Stream<T> parallelConcat(final Collection<? extends Stream<? extends T>> c, final int readThreadNum) {
"""
Put the stream in try-catch to stop the back-end reading thread if error happens
<br />
<code>
try (Stream<Integer> stream = Stream.parallelConcat(a,b, ...)) {
stream.forEach(N::println)... | java | public static <T> Stream<T> parallelConcat(final Collection<? extends Stream<? extends T>> c, final int readThreadNum) {
return parallelConcat(c, readThreadNum, calculateQueueSize(c.size()));
} | [
"public",
"static",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"parallelConcat",
"(",
"final",
"Collection",
"<",
"?",
"extends",
"Stream",
"<",
"?",
"extends",
"T",
">",
">",
"c",
",",
"final",
"int",
"readThreadNum",
")",
"{",
"return",
"parallelConcat",
... | Put the stream in try-catch to stop the back-end reading thread if error happens
<br />
<code>
try (Stream<Integer> stream = Stream.parallelConcat(a,b, ...)) {
stream.forEach(N::println);
}
</code>
@param c
@param readThreadNum
@return | [
"Put",
"the",
"stream",
"in",
"try",
"-",
"catch",
"to",
"stop",
"the",
"back",
"-",
"end",
"reading",
"thread",
"if",
"error",
"happens",
"<br",
"/",
">",
"<code",
">",
"try",
"(",
"Stream<Integer",
">",
"stream",
"=",
"Stream",
".",
"parallelConcat",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Stream.java#L4255-L4257 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/text/codepoint/CodepointHelper.java | CodepointHelper.wrapBidi | @Nullable
public static String wrapBidi (@Nullable final String sStr, final char cChar) {
"""
Wrap the string with the specified bidi control
@param sStr
source string
@param cChar
source char
@return The wrapped string
"""
switch (cChar)
{
case RLE:
return _wrap (sStr, RLE, PDF)... | java | @Nullable
public static String wrapBidi (@Nullable final String sStr, final char cChar)
{
switch (cChar)
{
case RLE:
return _wrap (sStr, RLE, PDF);
case RLO:
return _wrap (sStr, RLO, PDF);
case LRE:
return _wrap (sStr, LRE, PDF);
case LRO:
return _wrap... | [
"@",
"Nullable",
"public",
"static",
"String",
"wrapBidi",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"final",
"char",
"cChar",
")",
"{",
"switch",
"(",
"cChar",
")",
"{",
"case",
"RLE",
":",
"return",
"_wrap",
"(",
"sStr",
",",
"RLE",
",",
... | Wrap the string with the specified bidi control
@param sStr
source string
@param cChar
source char
@return The wrapped string | [
"Wrap",
"the",
"string",
"with",
"the",
"specified",
"bidi",
"control"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/text/codepoint/CodepointHelper.java#L390-L410 |
roboconf/roboconf-platform | core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2IaasHandler.java | Ec2IaasHandler.prepareEC2RequestNode | private RunInstancesRequest prepareEC2RequestNode( Map<String,String> targetProperties, String userData )
throws UnsupportedEncodingException {
"""
Prepares the request.
@param targetProperties the target properties
@param userData the user data to pass
@return a request
@throws UnsupportedEncodingException
... | java | private RunInstancesRequest prepareEC2RequestNode( Map<String,String> targetProperties, String userData )
throws UnsupportedEncodingException {
RunInstancesRequest runInstancesRequest = new RunInstancesRequest();
String flavor = targetProperties.get(Ec2Constants.VM_INSTANCE_TYPE);
if( Utils.isEmptyOrWhitespaces... | [
"private",
"RunInstancesRequest",
"prepareEC2RequestNode",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"targetProperties",
",",
"String",
"userData",
")",
"throws",
"UnsupportedEncodingException",
"{",
"RunInstancesRequest",
"runInstancesRequest",
"=",
"new",
"RunInsta... | Prepares the request.
@param targetProperties the target properties
@param userData the user data to pass
@return a request
@throws UnsupportedEncodingException | [
"Prepares",
"the",
"request",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-ec2/src/main/java/net/roboconf/target/ec2/internal/Ec2IaasHandler.java#L291-L322 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/tsdb/model/Datapoint.java | Datapoint.addTag | public Datapoint addTag(String tagKey, String tagValue) {
"""
Add tag for the datapoint.
@param tagKey
@param tagValue
@return Datapoint
"""
initialTags();
tags.put(tagKey, tagValue);
return this;
} | java | public Datapoint addTag(String tagKey, String tagValue) {
initialTags();
tags.put(tagKey, tagValue);
return this;
} | [
"public",
"Datapoint",
"addTag",
"(",
"String",
"tagKey",
",",
"String",
"tagValue",
")",
"{",
"initialTags",
"(",
")",
";",
"tags",
".",
"put",
"(",
"tagKey",
",",
"tagValue",
")",
";",
"return",
"this",
";",
"}"
] | Add tag for the datapoint.
@param tagKey
@param tagValue
@return Datapoint | [
"Add",
"tag",
"for",
"the",
"datapoint",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/tsdb/model/Datapoint.java#L166-L170 |
bazaarvoice/jolt | jolt-core/src/main/java/com/bazaarvoice/jolt/modifier/spec/ModifierSpec.java | ModifierSpec.setData | @SuppressWarnings( "unchecked" )
protected static void setData(Object parent, MatchedElement matchedElement, Object value, OpMode opMode) {
"""
Static utility method for facilitating writes on input object
@param parent the source object
@param matchedElement the current spec (leaf) element that was matche... | java | @SuppressWarnings( "unchecked" )
protected static void setData(Object parent, MatchedElement matchedElement, Object value, OpMode opMode) {
if(parent instanceof Map) {
Map source = (Map) parent;
String key = matchedElement.getRawKey();
if(opMode.isApplicable( source, key ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"static",
"void",
"setData",
"(",
"Object",
"parent",
",",
"MatchedElement",
"matchedElement",
",",
"Object",
"value",
",",
"OpMode",
"opMode",
")",
"{",
"if",
"(",
"parent",
"instanceof",
"Map",
... | Static utility method for facilitating writes on input object
@param parent the source object
@param matchedElement the current spec (leaf) element that was matched with input
@param value to write
@param opMode to determine if write is applicable | [
"Static",
"utility",
"method",
"for",
"facilitating",
"writes",
"on",
"input",
"object"
] | train | https://github.com/bazaarvoice/jolt/blob/4cf866a9f4222142da41b50dbcccce022a956bff/jolt-core/src/main/java/com/bazaarvoice/jolt/modifier/spec/ModifierSpec.java#L127-L147 |
Bernardo-MG/maven-site-fixer | src/main/java/com/bernardomg/velocity/tool/SiteTool.java | SiteTool.transformImagesToFigures | public final void transformImagesToFigures(final Element root) {
"""
Transforms simple {@code <img>} elements to {@code <figure>} elements.
<p>
This will wrap {@code <img>} elements with a {@code <figure>} element,
and add a {@code <figcaption>} with the contents of the image's
{@code alt} attribute, if said a... | java | public final void transformImagesToFigures(final Element root) {
final Collection<Element> images; // Image elements from the <body>
Element figure; // <figure> element
Element caption; // <figcaption> element
checkNotNull(root, "Received a null pointer as root element");
... | [
"public",
"final",
"void",
"transformImagesToFigures",
"(",
"final",
"Element",
"root",
")",
"{",
"final",
"Collection",
"<",
"Element",
">",
"images",
";",
"// Image elements from the <body>",
"Element",
"figure",
";",
"// <figure> element",
"Element",
"caption",
";"... | Transforms simple {@code <img>} elements to {@code <figure>} elements.
<p>
This will wrap {@code <img>} elements with a {@code <figure>} element,
and add a {@code <figcaption>} with the contents of the image's
{@code alt} attribute, if said attribute exists.
<p>
Only {@code <img>} elements inside a {@code <section>} wi... | [
"Transforms",
"simple",
"{",
"@code",
"<img",
">",
"}",
"elements",
"to",
"{",
"@code",
"<figure",
">",
"}",
"elements",
".",
"<p",
">",
"This",
"will",
"wrap",
"{",
"@code",
"<img",
">",
"}",
"elements",
"with",
"a",
"{",
"@code",
"<figure",
">",
"}... | train | https://github.com/Bernardo-MG/maven-site-fixer/blob/e064472faa7edb0fca11647a22d90ad72089baa3/src/main/java/com/bernardomg/velocity/tool/SiteTool.java#L294-L316 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/sequences/PlainTextDocumentReaderAndWriter.java | PlainTextDocumentReaderAndWriter.printAnswers | public void printAnswers(List<IN> list, PrintWriter out) {
"""
Print the classifications for the document to the given Writer. This method
now checks the <code>outputFormat</code> property, and can print in
slashTags, inlineXML, or xml (stand-Off XML). For both the XML output
formats, it preserves spacing, whil... | java | public void printAnswers(List<IN> list, PrintWriter out) {
String style = null;
if (flags != null) {
style = flags.outputFormat;
}
if (style == null || "".equals(style)) {
style = "slashTags";
}
OutputStyle outputStyle = OutputStyle.fromShortName(style);
printAnswers(lis... | [
"public",
"void",
"printAnswers",
"(",
"List",
"<",
"IN",
">",
"list",
",",
"PrintWriter",
"out",
")",
"{",
"String",
"style",
"=",
"null",
";",
"if",
"(",
"flags",
"!=",
"null",
")",
"{",
"style",
"=",
"flags",
".",
"outputFormat",
";",
"}",
"if",
... | Print the classifications for the document to the given Writer. This method
now checks the <code>outputFormat</code> property, and can print in
slashTags, inlineXML, or xml (stand-Off XML). For both the XML output
formats, it preserves spacing, while for the slashTags format, it prints
tokenized (since preserveSpacing ... | [
"Print",
"the",
"classifications",
"for",
"the",
"document",
"to",
"the",
"given",
"Writer",
".",
"This",
"method",
"now",
"checks",
"the",
"<code",
">",
"outputFormat<",
"/",
"code",
">",
"property",
"and",
"can",
"print",
"in",
"slashTags",
"inlineXML",
"o... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/sequences/PlainTextDocumentReaderAndWriter.java#L194-L204 |
resilience4j/resilience4j | resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/CircuitBreakerExports.java | CircuitBreakerExports.ofIterable | public static CircuitBreakerExports ofIterable(String prefix, Iterable<CircuitBreaker> circuitBreakers) {
"""
Creates a new instance of {@link CircuitBreakerExports} with specified metrics names prefix and
{@link Iterable} of circuit breakers.
@param prefix the prefix of metrics names
@param circuitBreakers t... | java | public static CircuitBreakerExports ofIterable(String prefix, Iterable<CircuitBreaker> circuitBreakers) {
requireNonNull(prefix);
requireNonNull(circuitBreakers);
return new CircuitBreakerExports(prefix, circuitBreakers);
} | [
"public",
"static",
"CircuitBreakerExports",
"ofIterable",
"(",
"String",
"prefix",
",",
"Iterable",
"<",
"CircuitBreaker",
">",
"circuitBreakers",
")",
"{",
"requireNonNull",
"(",
"prefix",
")",
";",
"requireNonNull",
"(",
"circuitBreakers",
")",
";",
"return",
"... | Creates a new instance of {@link CircuitBreakerExports} with specified metrics names prefix and
{@link Iterable} of circuit breakers.
@param prefix the prefix of metrics names
@param circuitBreakers the circuit breakers | [
"Creates",
"a",
"new",
"instance",
"of",
"{",
"@link",
"CircuitBreakerExports",
"}",
"with",
"specified",
"metrics",
"names",
"prefix",
"and",
"{",
"@link",
"Iterable",
"}",
"of",
"circuit",
"breakers",
"."
] | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/CircuitBreakerExports.java#L127-L131 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java | SquareGraph.checkConnect | public void checkConnect( SquareNode a , int indexA , SquareNode b , int indexB , double distance ) {
"""
Checks to see if the two nodes can be connected. If one of the nodes is already connected to
another it then checks to see if the proposed connection is more desirable. If it is the old
connection is remov... | java | public void checkConnect( SquareNode a , int indexA , SquareNode b , int indexB , double distance ) {
if( a.edges[indexA] != null && a.edges[indexA].distance > distance ) {
detachEdge(a.edges[indexA]);
}
if( b.edges[indexB] != null && b.edges[indexB].distance > distance ) {
detachEdge(b.edges[indexB]);
}... | [
"public",
"void",
"checkConnect",
"(",
"SquareNode",
"a",
",",
"int",
"indexA",
",",
"SquareNode",
"b",
",",
"int",
"indexB",
",",
"double",
"distance",
")",
"{",
"if",
"(",
"a",
".",
"edges",
"[",
"indexA",
"]",
"!=",
"null",
"&&",
"a",
".",
"edges"... | Checks to see if the two nodes can be connected. If one of the nodes is already connected to
another it then checks to see if the proposed connection is more desirable. If it is the old
connection is removed and a new one created. Otherwise nothing happens. | [
"Checks",
"to",
"see",
"if",
"the",
"two",
"nodes",
"can",
"be",
"connected",
".",
"If",
"one",
"of",
"the",
"nodes",
"is",
"already",
"connected",
"to",
"another",
"it",
"then",
"checks",
"to",
"see",
"if",
"the",
"proposed",
"connection",
"is",
"more",... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGraph.java#L98-L110 |
webmetrics/browsermob-proxy | src/main/java/org/xbill/DNS/TSIG.java | TSIG.fromString | static public TSIG
fromString(String str) {
"""
Creates a new TSIG object with the hmac-md5 algorithm, which can be used to
sign or verify a message.
@param str The TSIG key, in the form name:secret, name/secret,
alg:name:secret, or alg/name/secret. If an algorithm is specified, it must
be "hmac-md5", "hmac-s... | java | static public TSIG
fromString(String str) {
String [] parts = str.split("[:/]");
if (parts.length < 2 || parts.length > 3)
throw new IllegalArgumentException("Invalid TSIG key " +
"specification");
if (parts.length == 3)
return new TSIG(parts[0], parts[1], parts[2]);
else
return new TSIG(HMAC_MD5, pa... | [
"static",
"public",
"TSIG",
"fromString",
"(",
"String",
"str",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"str",
".",
"split",
"(",
"\"[:/]\"",
")",
";",
"if",
"(",
"parts",
".",
"length",
"<",
"2",
"||",
"parts",
".",
"length",
">",
"3",
")",
... | Creates a new TSIG object with the hmac-md5 algorithm, which can be used to
sign or verify a message.
@param str The TSIG key, in the form name:secret, name/secret,
alg:name:secret, or alg/name/secret. If an algorithm is specified, it must
be "hmac-md5", "hmac-sha1", or "hmac-sha256".
@throws IllegalArgumentException ... | [
"Creates",
"a",
"new",
"TSIG",
"object",
"with",
"the",
"hmac",
"-",
"md5",
"algorithm",
"which",
"can",
"be",
"used",
"to",
"sign",
"or",
"verify",
"a",
"message",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/TSIG.java#L151-L161 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/validate/Schema.java | Schema.performTypeValidation | protected void performTypeValidation(String path, Object type, Object value, List<ValidationResult> results) {
"""
Validates a given value to match specified type. The type can be defined as a
Schema, type, a type name or TypeCode When type is a Schema, it executes
validation recursively against that Schema.
... | java | protected void performTypeValidation(String path, Object type, Object value, List<ValidationResult> results) {
// If type it not defined then skip
if (type == null)
return;
// Perform validation against schema
if (type instanceof Schema) {
Schema schema = (Schema) type;
schema.performValidation(path, ... | [
"protected",
"void",
"performTypeValidation",
"(",
"String",
"path",
",",
"Object",
"type",
",",
"Object",
"value",
",",
"List",
"<",
"ValidationResult",
">",
"results",
")",
"{",
"// If type it not defined then skip",
"if",
"(",
"type",
"==",
"null",
")",
"retu... | Validates a given value to match specified type. The type can be defined as a
Schema, type, a type name or TypeCode When type is a Schema, it executes
validation recursively against that Schema.
@param path a dot notation path to the value.
@param type a type to match the value type
@param value a value to be ... | [
"Validates",
"a",
"given",
"value",
"to",
"match",
"specified",
"type",
".",
"The",
"type",
"can",
"be",
"defined",
"as",
"a",
"Schema",
"type",
"a",
"type",
"name",
"or",
"TypeCode",
"When",
"type",
"is",
"a",
"Schema",
"it",
"executes",
"validation",
"... | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/validate/Schema.java#L162-L189 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.deleteSnippet | public void deleteSnippet(Object projectIdOrPath, Integer snippetId) throws GitLabApiException {
"""
/*
Deletes an existing project snippet. This is an idempotent function and deleting a
non-existent snippet does not cause an error.
<pre><code>DELETE /projects/:id/snippets/:snippet_id</code></pre>
@param p... | java | public void deleteSnippet(Object projectIdOrPath, Integer snippetId) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null, "projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId);
} | [
"public",
"void",
"deleteSnippet",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"snippetId",
")",
"throws",
"GitLabApiException",
"{",
"delete",
"(",
"Response",
".",
"Status",
".",
"NO_CONTENT",
",",
"null",
",",
"\"projects\"",
",",
"getProjectIdOrPath",
"(... | /*
Deletes an existing project snippet. This is an idempotent function and deleting a
non-existent snippet does not cause an error.
<pre><code>DELETE /projects/:id/snippets/:snippet_id</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, req... | [
"/",
"*",
"Deletes",
"an",
"existing",
"project",
"snippet",
".",
"This",
"is",
"an",
"idempotent",
"function",
"and",
"deleting",
"a",
"non",
"-",
"existent",
"snippet",
"does",
"not",
"cause",
"an",
"error",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L2035-L2037 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.setOrthoSymmetricLH | public Matrix4d setOrthoSymmetricLH(double width, double height, double zNear, double zFar) {
"""
Set this matrix to be a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code>.
<p>
This method is equivalent to calling {@link #set... | java | public Matrix4d setOrthoSymmetricLH(double width, double height, double zNear, double zFar) {
return setOrthoSymmetricLH(width, height, zNear, zFar, false);
} | [
"public",
"Matrix4d",
"setOrthoSymmetricLH",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
")",
"{",
"return",
"setOrthoSymmetricLH",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar",
",",
"false",
")",... | Set this matrix to be a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code>.
<p>
This method is equivalent to calling {@link #setOrthoLH(double, double, double, double, double, double) setOrthoLH()} with
<code>left=-width/2</code>, <co... | [
"Set",
"this",
"matrix",
"to",
"be",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..",
"+",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L10525-L10527 |
looly/hutool | hutool-captcha/src/main/java/cn/hutool/captcha/CaptchaUtil.java | CaptchaUtil.createCircleCaptcha | public static CircleCaptcha createCircleCaptcha(int width, int height, int codeCount, int circleCount) {
"""
创建圆圈干扰的验证码
@param width 图片宽
@param height 图片高
@param codeCount 字符个数
@param circleCount 干扰圆圈条数
@return {@link CircleCaptcha}
@since 3.2.3
"""
return new CircleCaptcha(width, height, codeCount,... | java | public static CircleCaptcha createCircleCaptcha(int width, int height, int codeCount, int circleCount) {
return new CircleCaptcha(width, height, codeCount, circleCount);
} | [
"public",
"static",
"CircleCaptcha",
"createCircleCaptcha",
"(",
"int",
"width",
",",
"int",
"height",
",",
"int",
"codeCount",
",",
"int",
"circleCount",
")",
"{",
"return",
"new",
"CircleCaptcha",
"(",
"width",
",",
"height",
",",
"codeCount",
",",
"circleCo... | 创建圆圈干扰的验证码
@param width 图片宽
@param height 图片高
@param codeCount 字符个数
@param circleCount 干扰圆圈条数
@return {@link CircleCaptcha}
@since 3.2.3 | [
"创建圆圈干扰的验证码"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-captcha/src/main/java/cn/hutool/captcha/CaptchaUtil.java#L57-L59 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/WideningCategories.java | WideningCategories.implementsInterfaceOrSubclassOf | public static boolean implementsInterfaceOrSubclassOf(final ClassNode source, final ClassNode targetType) {
"""
Determines if the source class implements an interface or subclasses the target type.
This method takes the {@link org.codehaus.groovy.ast.tools.WideningCategories.LowestUpperBoundClassNode lowest
uppe... | java | public static boolean implementsInterfaceOrSubclassOf(final ClassNode source, final ClassNode targetType) {
if (source.isDerivedFrom(targetType) || source.implementsInterface(targetType)) return true;
if (targetType instanceof WideningCategories.LowestUpperBoundClassNode) {
WideningCategorie... | [
"public",
"static",
"boolean",
"implementsInterfaceOrSubclassOf",
"(",
"final",
"ClassNode",
"source",
",",
"final",
"ClassNode",
"targetType",
")",
"{",
"if",
"(",
"source",
".",
"isDerivedFrom",
"(",
"targetType",
")",
"||",
"source",
".",
"implementsInterface",
... | Determines if the source class implements an interface or subclasses the target type.
This method takes the {@link org.codehaus.groovy.ast.tools.WideningCategories.LowestUpperBoundClassNode lowest
upper bound class node} type into account, allowing to remove unnecessary casts.
@param source the type of interest
@param ... | [
"Determines",
"if",
"the",
"source",
"class",
"implements",
"an",
"interface",
"or",
"subclasses",
"the",
"target",
"type",
".",
"This",
"method",
"takes",
"the",
"{"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/WideningCategories.java#L736-L746 |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java | Jsr250Utils.containsMethod | private static boolean containsMethod(Method method, List<Method> methods) {
"""
Checks if the passed in method already exists in the list of methods. Checks for equality by the name of the method.
@param method
@param methods
@return
"""
if(methods != null) {
for(Method aMethod : methods){
... | java | private static boolean containsMethod(Method method, List<Method> methods) {
if(methods != null) {
for(Method aMethod : methods){
if(method.getName().equals(aMethod.getName())) {
return true;
}
}
}
return false;
} | [
"private",
"static",
"boolean",
"containsMethod",
"(",
"Method",
"method",
",",
"List",
"<",
"Method",
">",
"methods",
")",
"{",
"if",
"(",
"methods",
"!=",
"null",
")",
"{",
"for",
"(",
"Method",
"aMethod",
":",
"methods",
")",
"{",
"if",
"(",
"method... | Checks if the passed in method already exists in the list of methods. Checks for equality by the name of the method.
@param method
@param methods
@return | [
"Checks",
"if",
"the",
"passed",
"in",
"method",
"already",
"exists",
"in",
"the",
"list",
"of",
"methods",
".",
"Checks",
"for",
"equality",
"by",
"the",
"name",
"of",
"the",
"method",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java#L168-L177 |
bwkimmel/jdcp | jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatus.java | JobStatus.asCancelled | public JobStatus asCancelled() {
"""
Creates a copy of this <code>JobStatus</code> with the state set to
{@link JobState#CANCELLED}.
@return A copy of this <code>JobStatus</code> with the state set to
{@link JobState#CANCELLED}.
"""
return new JobStatus(jobId, description, JobState.CANCELLED, progress, ... | java | public JobStatus asCancelled() {
return new JobStatus(jobId, description, JobState.CANCELLED, progress, status, eventId);
} | [
"public",
"JobStatus",
"asCancelled",
"(",
")",
"{",
"return",
"new",
"JobStatus",
"(",
"jobId",
",",
"description",
",",
"JobState",
".",
"CANCELLED",
",",
"progress",
",",
"status",
",",
"eventId",
")",
";",
"}"
] | Creates a copy of this <code>JobStatus</code> with the state set to
{@link JobState#CANCELLED}.
@return A copy of this <code>JobStatus</code> with the state set to
{@link JobState#CANCELLED}. | [
"Creates",
"a",
"copy",
"of",
"this",
"<code",
">",
"JobStatus<",
"/",
"code",
">",
"with",
"the",
"state",
"set",
"to",
"{"
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-core/src/main/java/ca/eandb/jdcp/remote/JobStatus.java#L153-L155 |
jMotif/SAX | src/main/java/net/seninp/jmotif/sax/SAXProcessor.java | SAXProcessor.timeToString | public static String timeToString(long start, long finish) {
"""
Generic method to convert the milliseconds into the elapsed time string.
@param start Start timestamp.
@param finish End timestamp.
@return String representation of the elapsed time.
"""
Duration duration = new Duration(finish - start... | java | public static String timeToString(long start, long finish) {
Duration duration = new Duration(finish - start); // in milliseconds
PeriodFormatter formatter = new PeriodFormatterBuilder().appendDays().appendSuffix("d")
.appendHours().appendSuffix("h").appendMinutes().appendSuffix("m").appendSeconds(... | [
"public",
"static",
"String",
"timeToString",
"(",
"long",
"start",
",",
"long",
"finish",
")",
"{",
"Duration",
"duration",
"=",
"new",
"Duration",
"(",
"finish",
"-",
"start",
")",
";",
"// in milliseconds\r",
"PeriodFormatter",
"formatter",
"=",
"new",
"Per... | Generic method to convert the milliseconds into the elapsed time string.
@param start Start timestamp.
@param finish End timestamp.
@return String representation of the elapsed time. | [
"Generic",
"method",
"to",
"convert",
"the",
"milliseconds",
"into",
"the",
"elapsed",
"time",
"string",
"."
] | train | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L589-L598 |
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java | GroovyScript2RestLoader.validateScript | public void validateScript(String name, InputStream script, SourceFolder[] src, SourceFile[] files)
throws MalformedScriptException {
"""
Check is specified source <code>script</code> contains valid Groovy source
code.
@param name script name. This name will be used by GroovyClassLoader to
identify scri... | java | public void validateScript(String name, InputStream script, SourceFolder[] src, SourceFile[] files)
throws MalformedScriptException
{
if (name != null && name.length() > 0 && name.startsWith("/"))
{
name = name.substring(1);
}
groovyPublisher.validateResource(script, name, src,... | [
"public",
"void",
"validateScript",
"(",
"String",
"name",
",",
"InputStream",
"script",
",",
"SourceFolder",
"[",
"]",
"src",
",",
"SourceFile",
"[",
"]",
"files",
")",
"throws",
"MalformedScriptException",
"{",
"if",
"(",
"name",
"!=",
"null",
"&&",
"name"... | Check is specified source <code>script</code> contains valid Groovy source
code.
@param name script name. This name will be used by GroovyClassLoader to
identify script, e.g. specified name will be used in error
message in compilation of Groovy fails. If this parameter is
<code>null</code> then GroovyClassLoader will ... | [
"Check",
"is",
"specified",
"source",
"<code",
">",
"script<",
"/",
"code",
">",
"contains",
"valid",
"Groovy",
"source",
"code",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java#L961-L969 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/WebJBossASClient.java | WebJBossASClient.getConnector | public ModelNode getConnector(String name) throws Exception {
"""
Returns the connector node with all its attributes. Will be null if it doesn't exist.
@param name the name of the connector whose node is to be returned
@return the node if there is a connector with the given name already in existence, null othe... | java | public ModelNode getConnector(String name) throws Exception {
final Address address = Address.root().add(SUBSYSTEM, SUBSYSTEM_WEB, CONNECTOR, name);
return readResource(address, true);
} | [
"public",
"ModelNode",
"getConnector",
"(",
"String",
"name",
")",
"throws",
"Exception",
"{",
"final",
"Address",
"address",
"=",
"Address",
".",
"root",
"(",
")",
".",
"add",
"(",
"SUBSYSTEM",
",",
"SUBSYSTEM_WEB",
",",
"CONNECTOR",
",",
"name",
")",
";"... | Returns the connector node with all its attributes. Will be null if it doesn't exist.
@param name the name of the connector whose node is to be returned
@return the node if there is a connector with the given name already in existence, null otherwise
@throws Exception any error | [
"Returns",
"the",
"connector",
"node",
"with",
"all",
"its",
"attributes",
".",
"Will",
"be",
"null",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/WebJBossASClient.java#L90-L93 |
orbisgis/h2gis | h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java | GraphCreator.setEdgeWeight | private void setEdgeWeight(E edge, final double weight) throws SQLException {
"""
Set this edge's weight to the weight contained in the current row.
@param edge Edge
@throws SQLException If the weight cannot be retrieved
"""
if (edge != null && weightColumnIndex != -1) {
edge.setWeight(... | java | private void setEdgeWeight(E edge, final double weight) throws SQLException {
if (edge != null && weightColumnIndex != -1) {
edge.setWeight(weight);
}
} | [
"private",
"void",
"setEdgeWeight",
"(",
"E",
"edge",
",",
"final",
"double",
"weight",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"edge",
"!=",
"null",
"&&",
"weightColumnIndex",
"!=",
"-",
"1",
")",
"{",
"edge",
".",
"setWeight",
"(",
"weight",
")"... | Set this edge's weight to the weight contained in the current row.
@param edge Edge
@throws SQLException If the weight cannot be retrieved | [
"Set",
"this",
"edge",
"s",
"weight",
"to",
"the",
"weight",
"contained",
"in",
"the",
"current",
"row",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-network/src/main/java/org/h2gis/network/functions/GraphCreator.java#L278-L282 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/Variable.java | Variable.execute | public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException {
"""
Dereference the variable, and return the reference value. Note that lazy
evaluation will occur. If a variable within scope is not found, a warning
will be sent to the error listener, and an e... | java | public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException
{
org.apache.xml.utils.PrefixResolver xprefixResolver = xctxt.getNamespaceContext();
XObject result;
// Is the variable fetched always the same?
// XObject result = xctxt.getVariable(m_qn... | [
"public",
"XObject",
"execute",
"(",
"XPathContext",
"xctxt",
",",
"boolean",
"destructiveOK",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"org",
".",
"apache",
".",
"xml",
".",
"utils",
".",
"PrefixResolver",
"xpref... | Dereference the variable, and return the reference value. Note that lazy
evaluation will occur. If a variable within scope is not found, a warning
will be sent to the error listener, and an empty nodeset will be returned.
@param xctxt The runtime execution context.
@return The evaluated variable, or an empty nodes... | [
"Dereference",
"the",
"variable",
"and",
"return",
"the",
"reference",
"value",
".",
"Note",
"that",
"lazy",
"evaluation",
"will",
"occur",
".",
"If",
"a",
"variable",
"within",
"scope",
"is",
"not",
"found",
"a",
"warning",
"will",
"be",
"sent",
"to",
"th... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/Variable.java#L204-L253 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.deleteStaticExportPublishedResource | public void deleteStaticExportPublishedResource(String resourceName, int linkType, String linkParameter)
throws CmsException {
"""
Deletes a published resource entry.<p>
@param resourceName The name of the resource to be deleted in the static export
@param linkType the type of resource deleted (0= non-para... | java | public void deleteStaticExportPublishedResource(String resourceName, int linkType, String linkParameter)
throws CmsException {
m_securityManager.deleteStaticExportPublishedResource(m_context, resourceName, linkType, linkParameter);
} | [
"public",
"void",
"deleteStaticExportPublishedResource",
"(",
"String",
"resourceName",
",",
"int",
"linkType",
",",
"String",
"linkParameter",
")",
"throws",
"CmsException",
"{",
"m_securityManager",
".",
"deleteStaticExportPublishedResource",
"(",
"m_context",
",",
"res... | Deletes a published resource entry.<p>
@param resourceName The name of the resource to be deleted in the static export
@param linkType the type of resource deleted (0= non-parameter, 1=parameter)
@param linkParameter the parameters of the resource
@throws CmsException if something goes wrong | [
"Deletes",
"a",
"published",
"resource",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1084-L1088 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java | CmsGalleryController.saveTreeState | public void saveTreeState(final String treeName, final String siteRoot, final Set<CmsUUID> openItemIds) {
"""
Saves the tree state for a given tree on the server.<p>
@param treeName the tree name
@param siteRoot the site root
@param openItemIds the structure ids of opened items
"""
CmsRpcAction<V... | java | public void saveTreeState(final String treeName, final String siteRoot, final Set<CmsUUID> openItemIds) {
CmsRpcAction<Void> treeStateAction = new CmsRpcAction<Void>() {
@Override
public void execute() {
start(600, false);
getGalleryService().saveTreeOp... | [
"public",
"void",
"saveTreeState",
"(",
"final",
"String",
"treeName",
",",
"final",
"String",
"siteRoot",
",",
"final",
"Set",
"<",
"CmsUUID",
">",
"openItemIds",
")",
"{",
"CmsRpcAction",
"<",
"Void",
">",
"treeStateAction",
"=",
"new",
"CmsRpcAction",
"<",
... | Saves the tree state for a given tree on the server.<p>
@param treeName the tree name
@param siteRoot the site root
@param openItemIds the structure ids of opened items | [
"Saves",
"the",
"tree",
"state",
"for",
"a",
"given",
"tree",
"on",
"the",
"server",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java#L1181-L1200 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsConfigHelper.java | StatsConfigHelper.getTranslatedStatsName | public static String getTranslatedStatsName(String statsName, String statsType, Locale locale) {
"""
Method to translate the Stats instance/group name in the tree. Used by Admin Console
"""
String[] _stats = parseStatsType(statsType);
for (int i = 0; i < _stats.length; i++) {
PmiMod... | java | public static String getTranslatedStatsName(String statsName, String statsType, Locale locale) {
String[] _stats = parseStatsType(statsType);
for (int i = 0; i < _stats.length; i++) {
PmiModuleConfig cfg = getTranslatedStatsConfig(_stats[i], locale);
if (cfg != null) {
... | [
"public",
"static",
"String",
"getTranslatedStatsName",
"(",
"String",
"statsName",
",",
"String",
"statsType",
",",
"Locale",
"locale",
")",
"{",
"String",
"[",
"]",
"_stats",
"=",
"parseStatsType",
"(",
"statsType",
")",
";",
"for",
"(",
"int",
"i",
"=",
... | Method to translate the Stats instance/group name in the tree. Used by Admin Console | [
"Method",
"to",
"translate",
"the",
"Stats",
"instance",
"/",
"group",
"name",
"in",
"the",
"tree",
".",
"Used",
"by",
"Admin",
"Console"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsConfigHelper.java#L162-L182 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/impl/flexi/FlexiBean.java | FlexiBean.getInt | public int getInt(String propertyName, int defaultValue) {
"""
Gets the value of the property as a {@code int} using a default value.
@param propertyName the property name, not empty
@param defaultValue the default value for null or invalid property
@return the value of the property
@throws ClassCastExcept... | java | public int getInt(String propertyName, int defaultValue) {
Object obj = get(propertyName);
return obj != null ? ((Number) get(propertyName)).intValue() : defaultValue;
} | [
"public",
"int",
"getInt",
"(",
"String",
"propertyName",
",",
"int",
"defaultValue",
")",
"{",
"Object",
"obj",
"=",
"get",
"(",
"propertyName",
")",
";",
"return",
"obj",
"!=",
"null",
"?",
"(",
"(",
"Number",
")",
"get",
"(",
"propertyName",
")",
")... | Gets the value of the property as a {@code int} using a default value.
@param propertyName the property name, not empty
@param defaultValue the default value for null or invalid property
@return the value of the property
@throws ClassCastException if the value is not compatible | [
"Gets",
"the",
"value",
"of",
"the",
"property",
"as",
"a",
"{",
"@code",
"int",
"}",
"using",
"a",
"default",
"value",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/impl/flexi/FlexiBean.java#L197-L200 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_hunting_queue_queueId_GET | public OvhOvhPabxHuntingQueue billingAccount_ovhPabx_serviceName_hunting_queue_queueId_GET(String billingAccount, String serviceName, Long queueId) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/ovhPabx/{serviceName}/hunting/queue/{queueId}
@param billingAccount [requ... | java | public OvhOvhPabxHuntingQueue billingAccount_ovhPabx_serviceName_hunting_queue_queueId_GET(String billingAccount, String serviceName, Long queueId) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/hunting/queue/{queueId}";
StringBuilder sb = path(qPath, billingAccount, serviceN... | [
"public",
"OvhOvhPabxHuntingQueue",
"billingAccount_ovhPabx_serviceName_hunting_queue_queueId_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"queueId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/o... | Get this object properties
REST: GET /telephony/{billingAccount}/ovhPabx/{serviceName}/hunting/queue/{queueId}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param queueId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L6701-L6706 |
keenlabs/KeenClient-Java | query/src/main/java/io/keen/client/java/KeenQueryClient.java | KeenQueryClient.standardDeviation | public double standardDeviation(String eventCollection, String targetProperty, Timeframe timeframe) throws IOException {
"""
Standard Deviation query with only the required arguments.
Query API info here: https://keen.io/docs/api/#standard-deviation
@param eventCollection The name of the event collection you a... | java | public double standardDeviation(String eventCollection, String targetProperty, Timeframe timeframe) throws IOException {
Query queryParams = new Query.Builder(QueryType.STANDARD_DEVIATION)
.withEventCollection(eventCollection)
.withTargetProperty(targetProperty)
.... | [
"public",
"double",
"standardDeviation",
"(",
"String",
"eventCollection",
",",
"String",
"targetProperty",
",",
"Timeframe",
"timeframe",
")",
"throws",
"IOException",
"{",
"Query",
"queryParams",
"=",
"new",
"Query",
".",
"Builder",
"(",
"QueryType",
".",
"STAND... | Standard Deviation query with only the required arguments.
Query API info here: https://keen.io/docs/api/#standard-deviation
@param eventCollection The name of the event collection you are analyzing.
@param targetProperty The name of the property you are analyzing.
@param timeframe The {@link RelativeTimeframe}... | [
"Standard",
"Deviation",
"query",
"with",
"only",
"the",
"required",
"arguments",
".",
"Query",
"API",
"info",
"here",
":",
"https",
":",
"//",
"keen",
".",
"io",
"/",
"docs",
"/",
"api",
"/",
"#standard",
"-",
"deviation"
] | train | https://github.com/keenlabs/KeenClient-Java/blob/2ea021547b5338257c951a2596bd49749038d018/query/src/main/java/io/keen/client/java/KeenQueryClient.java#L264-L271 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/operations/OperationAnalyzer.java | OperationAnalyzer.isUndefined | public boolean isUndefined(final Field destination,final Field source) {
"""
This method analyzes the fields, calculates the info and returns true if operation is undefined.
@param destination destination field
@param source source field
@return returns true if an operation between fields exists
@see InfoOpera... | java | public boolean isUndefined(final Field destination,final Field source) {
info = null;
for (IOperationAnalyzer analyzer : analyzers)
if(analyzer.verifyConditions(destination,source))
info = analyzer.getInfoOperation(destination, source);
// if the operation has not been identified
if(is... | [
"public",
"boolean",
"isUndefined",
"(",
"final",
"Field",
"destination",
",",
"final",
"Field",
"source",
")",
"{",
"info",
"=",
"null",
";",
"for",
"(",
"IOperationAnalyzer",
"analyzer",
":",
"analyzers",
")",
"if",
"(",
"analyzer",
".",
"verifyConditions",
... | This method analyzes the fields, calculates the info and returns true if operation is undefined.
@param destination destination field
@param source source field
@return returns true if an operation between fields exists
@see InfoOperation | [
"This",
"method",
"analyzes",
"the",
"fields",
"calculates",
"the",
"info",
"and",
"returns",
"true",
"if",
"operation",
"is",
"undefined",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/operations/OperationAnalyzer.java#L75-L97 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/InjectionClassLoader.java | InjectionClassLoader.defineClass | public Class<?> defineClass(String name, byte[] binaryRepresentation) throws ClassNotFoundException {
"""
Defines a new type to be loaded by this class loader.
@param name The name of the type.
@param binaryRepresentation The type's binary representation.
@return The defined class or a previou... | java | public Class<?> defineClass(String name, byte[] binaryRepresentation) throws ClassNotFoundException {
return defineClasses(Collections.singletonMap(name, binaryRepresentation)).get(name);
} | [
"public",
"Class",
"<",
"?",
">",
"defineClass",
"(",
"String",
"name",
",",
"byte",
"[",
"]",
"binaryRepresentation",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"defineClasses",
"(",
"Collections",
".",
"singletonMap",
"(",
"name",
",",
"binaryRepr... | Defines a new type to be loaded by this class loader.
@param name The name of the type.
@param binaryRepresentation The type's binary representation.
@return The defined class or a previously defined class.
@throws ClassNotFoundException If the class could not be loaded. | [
"Defines",
"a",
"new",
"type",
"to",
"be",
"loaded",
"by",
"this",
"class",
"loader",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/InjectionClassLoader.java#L68-L70 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/transform/recurrence/AbstractDateExpansionRule.java | AbstractDateExpansionRule.getCalendarInstance | protected Calendar getCalendarInstance(final Date date, final boolean lenient) {
"""
Construct a Calendar object and sets the time.
@param date
@param lenient
@return
"""
Calendar cal = Dates.getCalendarInstance(date);
// A week should have at least 4 days to be considered as such per RFC5... | java | protected Calendar getCalendarInstance(final Date date, final boolean lenient) {
Calendar cal = Dates.getCalendarInstance(date);
// A week should have at least 4 days to be considered as such per RFC5545
cal.setMinimalDaysInFirstWeek(4);
cal.setFirstDayOfWeek(calendarWeekStartDay);
... | [
"protected",
"Calendar",
"getCalendarInstance",
"(",
"final",
"Date",
"date",
",",
"final",
"boolean",
"lenient",
")",
"{",
"Calendar",
"cal",
"=",
"Dates",
".",
"getCalendarInstance",
"(",
"date",
")",
";",
"// A week should have at least 4 days to be considered as suc... | Construct a Calendar object and sets the time.
@param date
@param lenient
@return | [
"Construct",
"a",
"Calendar",
"object",
"and",
"sets",
"the",
"time",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/transform/recurrence/AbstractDateExpansionRule.java#L110-L119 |
cdk/cdk | storage/inchi/src/main/java/org/openscience/cdk/inchi/InChIGeneratorFactory.java | InChIGeneratorFactory.getInChIGenerator | public InChIGenerator getInChIGenerator(IAtomContainer container, List<INCHI_OPTION> options) throws CDKException {
"""
Gets InChI generator for CDK IAtomContainer.
@param container AtomContainer to generate InChI for.
@param options List of options (net.sf.jniinchi.INCHI_OPTION) for InChI generation... | java | public InChIGenerator getInChIGenerator(IAtomContainer container, List<INCHI_OPTION> options) throws CDKException {
if (options == null) throw new IllegalArgumentException("Null options");
return (new InChIGenerator(container, options, ignoreAromaticBonds));
} | [
"public",
"InChIGenerator",
"getInChIGenerator",
"(",
"IAtomContainer",
"container",
",",
"List",
"<",
"INCHI_OPTION",
">",
"options",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"options",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"... | Gets InChI generator for CDK IAtomContainer.
@param container AtomContainer to generate InChI for.
@param options List of options (net.sf.jniinchi.INCHI_OPTION) for InChI generation.
@return the InChI generator object
@throws CDKException if the generator cannot be instantiated | [
"Gets",
"InChI",
"generator",
"for",
"CDK",
"IAtomContainer",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/inchi/src/main/java/org/openscience/cdk/inchi/InChIGeneratorFactory.java#L170-L173 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.getOrFilterBuilder | private OrQueryBuilder getOrFilterBuilder(Expression logicalExp, EntityMetadata m) {
"""
Gets the or filter builder.
@param logicalExp
the logical exp
@param m
the m
@param entity
the entity
@return the or filter builder
"""
OrExpression orExp = (OrExpression) logicalExp;
Expression le... | java | private OrQueryBuilder getOrFilterBuilder(Expression logicalExp, EntityMetadata m)
{
OrExpression orExp = (OrExpression) logicalExp;
Expression leftExpression = orExp.getLeftExpression();
Expression rightExpression = orExp.getRightExpression();
return new OrQueryBuilder(populateFilt... | [
"private",
"OrQueryBuilder",
"getOrFilterBuilder",
"(",
"Expression",
"logicalExp",
",",
"EntityMetadata",
"m",
")",
"{",
"OrExpression",
"orExp",
"=",
"(",
"OrExpression",
")",
"logicalExp",
";",
"Expression",
"leftExpression",
"=",
"orExp",
".",
"getLeftExpression",... | Gets the or filter builder.
@param logicalExp
the logical exp
@param m
the m
@param entity
the entity
@return the or filter builder | [
"Gets",
"the",
"or",
"filter",
"builder",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L378-L385 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/MetadataStore.java | MetadataStore.failAssignment | private void failAssignment(String streamSegmentName, Throwable reason) {
"""
Fails the assignment for the given StreamSegment Id with the given reason.
"""
finishPendingRequests(streamSegmentName, PendingRequest::completeExceptionally, reason);
} | java | private void failAssignment(String streamSegmentName, Throwable reason) {
finishPendingRequests(streamSegmentName, PendingRequest::completeExceptionally, reason);
} | [
"private",
"void",
"failAssignment",
"(",
"String",
"streamSegmentName",
",",
"Throwable",
"reason",
")",
"{",
"finishPendingRequests",
"(",
"streamSegmentName",
",",
"PendingRequest",
"::",
"completeExceptionally",
",",
"reason",
")",
";",
"}"
] | Fails the assignment for the given StreamSegment Id with the given reason. | [
"Fails",
"the",
"assignment",
"for",
"the",
"given",
"StreamSegment",
"Id",
"with",
"the",
"given",
"reason",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/MetadataStore.java#L447-L449 |
aws/aws-sdk-java | aws-java-sdk-iot1clickprojects/src/main/java/com/amazonaws/services/iot1clickprojects/model/ProjectSummary.java | ProjectSummary.withTags | public ProjectSummary withTags(java.util.Map<String, String> tags) {
"""
<p>
The tags (metadata key/value pairs) associated with the project.
</p>
@param tags
The tags (metadata key/value pairs) associated with the project.
@return Returns a reference to this object so that method calls can be chained toget... | java | public ProjectSummary withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"ProjectSummary",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags (metadata key/value pairs) associated with the project.
</p>
@param tags
The tags (metadata key/value pairs) associated with the project.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"tags",
"(",
"metadata",
"key",
"/",
"value",
"pairs",
")",
"associated",
"with",
"the",
"project",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot1clickprojects/src/main/java/com/amazonaws/services/iot1clickprojects/model/ProjectSummary.java#L264-L267 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java | MongoDBClient.findGridFSDBFile | private GridFSDBFile findGridFSDBFile(EntityMetadata entityMetadata, Object key) {
"""
Find GRIDFSDBFile.
@param entityMetadata
the entity metadata
@param key
the key
@return the grid fsdb file
"""
String id = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();
DBOb... | java | private GridFSDBFile findGridFSDBFile(EntityMetadata entityMetadata, Object key)
{
String id = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();
DBObject query = new BasicDBObject("metadata." + id, key);
KunderaGridFS gfs = new KunderaGridFS(mongoDb, entityMetadata.ge... | [
"private",
"GridFSDBFile",
"findGridFSDBFile",
"(",
"EntityMetadata",
"entityMetadata",
",",
"Object",
"key",
")",
"{",
"String",
"id",
"=",
"(",
"(",
"AbstractAttribute",
")",
"entityMetadata",
".",
"getIdAttribute",
"(",
")",
")",
".",
"getJPAColumnName",
"(",
... | Find GRIDFSDBFile.
@param entityMetadata
the entity metadata
@param key
the key
@return the grid fsdb file | [
"Find",
"GRIDFSDBFile",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java#L426-L432 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java | SingularOps_DDRM.nullspaceQRP | public static DMatrixRMaj nullspaceQRP( DMatrixRMaj A , int totalSingular ) {
"""
Computes the null space using QRP decomposition. This is faster than using SVD but slower than QR.
Much more stable than QR though.
@param A (Input) Matrix
@param totalSingular Number of singular values
@return Null space
"""... | java | public static DMatrixRMaj nullspaceQRP( DMatrixRMaj A , int totalSingular ) {
SolveNullSpaceQRP_DDRM solver = new SolveNullSpaceQRP_DDRM();
DMatrixRMaj nullspace = new DMatrixRMaj(1,1);
if( !solver.process(A,totalSingular,nullspace))
throw new RuntimeException("Solver failed. try S... | [
"public",
"static",
"DMatrixRMaj",
"nullspaceQRP",
"(",
"DMatrixRMaj",
"A",
",",
"int",
"totalSingular",
")",
"{",
"SolveNullSpaceQRP_DDRM",
"solver",
"=",
"new",
"SolveNullSpaceQRP_DDRM",
"(",
")",
";",
"DMatrixRMaj",
"nullspace",
"=",
"new",
"DMatrixRMaj",
"(",
... | Computes the null space using QRP decomposition. This is faster than using SVD but slower than QR.
Much more stable than QR though.
@param A (Input) Matrix
@param totalSingular Number of singular values
@return Null space | [
"Computes",
"the",
"null",
"space",
"using",
"QRP",
"decomposition",
".",
"This",
"is",
"faster",
"than",
"using",
"SVD",
"but",
"slower",
"than",
"QR",
".",
"Much",
"more",
"stable",
"than",
"QR",
"though",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java#L452-L461 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java | BinaryImageOps.labelToBinary | public static GrayU8 labelToBinary(GrayS32 labelImage , GrayU8 binaryImage ,
int numLabels, int ...selected ) {
"""
Only converts the specified blobs over into the binary image. Easier to use version of
{@link #labelToBinary(GrayS32, GrayU8, boolean[])}.
@param labelImage Input image. Not modified... | java | public static GrayU8 labelToBinary(GrayS32 labelImage , GrayU8 binaryImage ,
int numLabels, int ...selected )
{
boolean selectedBlobs[] = new boolean[numLabels];
for (int i = 0; i < selected.length; i++) {
selectedBlobs[selected[i]] = true;
}
return labelToBinary(labelImage,binaryImage,selected... | [
"public",
"static",
"GrayU8",
"labelToBinary",
"(",
"GrayS32",
"labelImage",
",",
"GrayU8",
"binaryImage",
",",
"int",
"numLabels",
",",
"int",
"...",
"selected",
")",
"{",
"boolean",
"selectedBlobs",
"[",
"]",
"=",
"new",
"boolean",
"[",
"numLabels",
"]",
"... | Only converts the specified blobs over into the binary image. Easier to use version of
{@link #labelToBinary(GrayS32, GrayU8, boolean[])}.
@param labelImage Input image. Not modified.
@param binaryImage Output image. If null a new one will be declared. Modified.
@param numLabels Number of labels in the image. This i... | [
"Only",
"converts",
"the",
"specified",
"blobs",
"over",
"into",
"the",
"binary",
"image",
".",
"Easier",
"to",
"use",
"version",
"of",
"{",
"@link",
"#labelToBinary",
"(",
"GrayS32",
"GrayU8",
"boolean",
"[]",
")",
"}",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/filter/binary/BinaryImageOps.java#L569-L578 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java | ComponentsInner.createOrUpdateAsync | public Observable<ApplicationInsightsComponentInner> createOrUpdateAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentInner insightProperties) {
"""
Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in t... | java | public Observable<ApplicationInsightsComponentInner> createOrUpdateAsync(String resourceGroupName, String resourceName, ApplicationInsightsComponentInner insightProperties) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, insightProperties).map(new Func1<ServiceResponse<Applicati... | [
"public",
"Observable",
"<",
"ApplicationInsightsComponentInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ApplicationInsightsComponentInner",
"insightProperties",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAs... | Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param insightProperties Proper... | [
"Creates",
"(",
"or",
"updates",
")",
"an",
"Application",
"Insights",
"component",
".",
"Note",
":",
"You",
"cannot",
"specify",
"a",
"different",
"value",
"for",
"InstrumentationKey",
"nor",
"AppId",
"in",
"the",
"Put",
"operation",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java#L546-L553 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentPersistenceImpl.java | CommerceShipmentPersistenceImpl.removeByG_S | @Override
public void removeByG_S(long groupId, int status) {
"""
Removes all the commerce shipments where groupId = ? and status = ? from the database.
@param groupId the group ID
@param status the status
"""
for (CommerceShipment commerceShipment : findByG_S(groupId, status,
QueryUtil.ALL_... | java | @Override
public void removeByG_S(long groupId, int status) {
for (CommerceShipment commerceShipment : findByG_S(groupId, status,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceShipment);
}
} | [
"@",
"Override",
"public",
"void",
"removeByG_S",
"(",
"long",
"groupId",
",",
"int",
"status",
")",
"{",
"for",
"(",
"CommerceShipment",
"commerceShipment",
":",
"findByG_S",
"(",
"groupId",
",",
"status",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
... | Removes all the commerce shipments where groupId = ? and status = ? from the database.
@param groupId the group ID
@param status the status | [
"Removes",
"all",
"the",
"commerce",
"shipments",
"where",
"groupId",
"=",
"?",
";",
"and",
"status",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShipmentPersistenceImpl.java#L1080-L1086 |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/traverson/Traverson.java | Traverson.followLink | public Traverson followLink(final String rel,
final Predicate<Link> predicate) {
"""
Follow the first {@link Link} of the current resource that is matching the link-relation type and
the {@link LinkPredicates predicate}.
<p>
Other than {@link #follow(String, Predicate)}, this met... | java | public Traverson followLink(final String rel,
final Predicate<Link> predicate) {
return followLink(rel, predicate, emptyMap());
} | [
"public",
"Traverson",
"followLink",
"(",
"final",
"String",
"rel",
",",
"final",
"Predicate",
"<",
"Link",
">",
"predicate",
")",
"{",
"return",
"followLink",
"(",
"rel",
",",
"predicate",
",",
"emptyMap",
"(",
")",
")",
";",
"}"
] | Follow the first {@link Link} of the current resource that is matching the link-relation type and
the {@link LinkPredicates predicate}.
<p>
Other than {@link #follow(String, Predicate)}, this method will ignore possibly embedded resources
with the same link-relation type. Only if the link is missing, the embedded resou... | [
"Follow",
"the",
"first",
"{",
"@link",
"Link",
"}",
"of",
"the",
"current",
"resource",
"that",
"is",
"matching",
"the",
"link",
"-",
"relation",
"type",
"and",
"the",
"{",
"@link",
"LinkPredicates",
"predicate",
"}",
".",
"<p",
">",
"Other",
"than",
"{... | train | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/traverson/Traverson.java#L408-L411 |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/internal/rendering/writer/svg/geometry/GeometryCollectionWriter.java | GeometryCollectionWriter.writeObject | public void writeObject(Object o, GraphicsDocument document, boolean asChild) throws RenderException {
"""
Writes a <code>GeometryCollection</code> object.
@param o The <code>LineString</code> to be encoded.
"""
GeometryCollection coll = (GeometryCollection) o;
document.writeElement("path", asChild);
... | java | public void writeObject(Object o, GraphicsDocument document, boolean asChild) throws RenderException {
GeometryCollection coll = (GeometryCollection) o;
document.writeElement("path", asChild);
document.writeAttribute("fill-rule", "evenodd");
document.writeAttributeStart("d");
for (int i = 0; i < coll.getNumGe... | [
"public",
"void",
"writeObject",
"(",
"Object",
"o",
",",
"GraphicsDocument",
"document",
",",
"boolean",
"asChild",
")",
"throws",
"RenderException",
"{",
"GeometryCollection",
"coll",
"=",
"(",
"GeometryCollection",
")",
"o",
";",
"document",
".",
"writeElement"... | Writes a <code>GeometryCollection</code> object.
@param o The <code>LineString</code> to be encoded. | [
"Writes",
"a",
"<code",
">",
"GeometryCollection<",
"/",
"code",
">",
"object",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/rendering/writer/svg/geometry/GeometryCollectionWriter.java#L34-L43 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.pixelYToTileYWithScaleFactor | public static int pixelYToTileYWithScaleFactor(double pixelY, double scaleFactor, int tileSize) {
"""
Converts a pixel Y coordinate to the tile Y number.
@param pixelY the pixel Y coordinate that should be converted.
@param scaleFactor the scale factor at which the coordinate should be converted.
@return... | java | public static int pixelYToTileYWithScaleFactor(double pixelY, double scaleFactor, int tileSize) {
return (int) Math.min(Math.max(pixelY / tileSize, 0), scaleFactor - 1);
} | [
"public",
"static",
"int",
"pixelYToTileYWithScaleFactor",
"(",
"double",
"pixelY",
",",
"double",
"scaleFactor",
",",
"int",
"tileSize",
")",
"{",
"return",
"(",
"int",
")",
"Math",
".",
"min",
"(",
"Math",
".",
"max",
"(",
"pixelY",
"/",
"tileSize",
",",... | Converts a pixel Y coordinate to the tile Y number.
@param pixelY the pixel Y coordinate that should be converted.
@param scaleFactor the scale factor at which the coordinate should be converted.
@return the tile Y number. | [
"Converts",
"a",
"pixel",
"Y",
"coordinate",
"to",
"the",
"tile",
"Y",
"number",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L422-L424 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java | CollectionExtensions.removeAll | @Inline(value="$3.$4removeAll($1, $2)", imported=Iterables.class)
public static <T> boolean removeAll(Collection<T> collection, Collection<? extends T> elements) {
"""
Removes all of the specified elements from the specified collection.
@param collection
the collection from which the {@code elements} are to b... | java | @Inline(value="$3.$4removeAll($1, $2)", imported=Iterables.class)
public static <T> boolean removeAll(Collection<T> collection, Collection<? extends T> elements) {
return Iterables.removeAll(collection, elements);
} | [
"@",
"Inline",
"(",
"value",
"=",
"\"$3.$4removeAll($1, $2)\"",
",",
"imported",
"=",
"Iterables",
".",
"class",
")",
"public",
"static",
"<",
"T",
">",
"boolean",
"removeAll",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"Collection",
"<",
"?",
"e... | Removes all of the specified elements from the specified collection.
@param collection
the collection from which the {@code elements} are to be removed. May not be <code>null</code>.
@param elements
the elements to remove from the {@code collection}. May not be <code>null</code> but may contain
<code>null</code> entri... | [
"Removes",
"all",
"of",
"the",
"specified",
"elements",
"from",
"the",
"specified",
"collection",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java#L300-L303 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java | QueueContainer.addAll | public Map<Long, Data> addAll(Collection<Data> dataList) {
"""
Adds all items from the {@code dataList} to the queue. The data will be stored in the queue store if configured and
enabled. If the store is enabled, only {@link QueueStoreWrapper#getMemoryLimit()} item data will be stored in memory.
Cancels the evic... | java | public Map<Long, Data> addAll(Collection<Data> dataList) {
Map<Long, Data> map = createHashMap(dataList.size());
List<QueueItem> list = new ArrayList<QueueItem>(dataList.size());
for (Data data : dataList) {
QueueItem item = new QueueItem(this, nextId(), null);
if (!store... | [
"public",
"Map",
"<",
"Long",
",",
"Data",
">",
"addAll",
"(",
"Collection",
"<",
"Data",
">",
"dataList",
")",
"{",
"Map",
"<",
"Long",
",",
"Data",
">",
"map",
"=",
"createHashMap",
"(",
"dataList",
".",
"size",
"(",
")",
")",
";",
"List",
"<",
... | Adds all items from the {@code dataList} to the queue. The data will be stored in the queue store if configured and
enabled. If the store is enabled, only {@link QueueStoreWrapper#getMemoryLimit()} item data will be stored in memory.
Cancels the eviction if one is scheduled.
@param dataList the items to be added to th... | [
"Adds",
"all",
"items",
"from",
"the",
"{",
"@code",
"dataList",
"}",
"to",
"the",
"queue",
".",
"The",
"data",
"will",
"be",
"stored",
"in",
"the",
"queue",
"store",
"if",
"configured",
"and",
"enabled",
".",
"If",
"the",
"store",
"is",
"enabled",
"on... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/queue/QueueContainer.java#L479-L502 |
datasift/datasift-java | src/main/java/com/datasift/client/ParamBuilder.java | ParamBuilder.put | public ParamBuilder put(String name, Object value) {
"""
/*
Adds or replaces a parameter
@param name the name of the parameter
@param value the value to the parameter
@return this builder for further re-use
"""
params.put(name, value);
return this;
} | java | public ParamBuilder put(String name, Object value) {
params.put(name, value);
return this;
} | [
"public",
"ParamBuilder",
"put",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"params",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | /*
Adds or replaces a parameter
@param name the name of the parameter
@param value the value to the parameter
@return this builder for further re-use | [
"/",
"*",
"Adds",
"or",
"replaces",
"a",
"parameter"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/ParamBuilder.java#L23-L26 |
Samsung/GearVRf | GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFString.java | MFString.set1Value | public void set1Value(int index, String newValue) {
"""
Replace a single value at the appropriate location in the existing value array.
@param index - location in the array list
@param newValue - the new String
"""
try {
value.set( index, newValue );
}
catch (IndexOutOfBou... | java | public void set1Value(int index, String newValue) {
try {
value.set( index, newValue );
}
catch (IndexOutOfBoundsException e) {
Log.e(TAG, "X3D MFString set1Value(int index, ...) out of bounds." + e);
}
catch (Exception e) {
Log.e(TAG, "X3D MFS... | [
"public",
"void",
"set1Value",
"(",
"int",
"index",
",",
"String",
"newValue",
")",
"{",
"try",
"{",
"value",
".",
"set",
"(",
"index",
",",
"newValue",
")",
";",
"}",
"catch",
"(",
"IndexOutOfBoundsException",
"e",
")",
"{",
"Log",
".",
"e",
"(",
"T... | Replace a single value at the appropriate location in the existing value array.
@param index - location in the array list
@param newValue - the new String | [
"Replace",
"a",
"single",
"value",
"at",
"the",
"appropriate",
"location",
"in",
"the",
"existing",
"value",
"array",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFString.java#L128-L138 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/IntentsClient.java | IntentsClient.getIntent | public final Intent getIntent(String name, String languageCode) {
"""
Retrieves the specified intent.
<p>Sample code:
<pre><code>
try (IntentsClient intentsClient = IntentsClient.create()) {
IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
String languageCode = "";
Intent response = intentsClien... | java | public final Intent getIntent(String name, String languageCode) {
GetIntentRequest request =
GetIntentRequest.newBuilder().setName(name).setLanguageCode(languageCode).build();
return getIntent(request);
} | [
"public",
"final",
"Intent",
"getIntent",
"(",
"String",
"name",
",",
"String",
"languageCode",
")",
"{",
"GetIntentRequest",
"request",
"=",
"GetIntentRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
")",
".",
"setLanguageCode",
"(",
"langu... | Retrieves the specified intent.
<p>Sample code:
<pre><code>
try (IntentsClient intentsClient = IntentsClient.create()) {
IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
String languageCode = "";
Intent response = intentsClient.getIntent(name.toString(), languageCode);
}
</code></pre>
@param name Required. ... | [
"Retrieves",
"the",
"specified",
"intent",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/IntentsClient.java#L496-L501 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Input.java | Input.isButtonPressed | public boolean isButtonPressed(int index, int controller) {
"""
Check if controller button is pressed
@param controller The index of the controller to check
@param index The index of the button to check
@return True if the button is pressed
"""
if (controller >= getControllerCount()) {
return false... | java | public boolean isButtonPressed(int index, int controller) {
if (controller >= getControllerCount()) {
return false;
}
if (controller == ANY_CONTROLLER) {
for (int i=0;i<controllers.size();i++) {
if (isButtonPressed(index, i)) {
return true;
}
}
return false;
}
r... | [
"public",
"boolean",
"isButtonPressed",
"(",
"int",
"index",
",",
"int",
"controller",
")",
"{",
"if",
"(",
"controller",
">=",
"getControllerCount",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"controller",
"==",
"ANY_CONTROLLER",
")",
"{"... | Check if controller button is pressed
@param controller The index of the controller to check
@param index The index of the button to check
@return True if the button is pressed | [
"Check",
"if",
"controller",
"button",
"is",
"pressed"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Input.java#L974-L990 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java | PersistenceBrokerImpl.refreshInstance | private void refreshInstance(Object cachedInstance, Identity oid, ClassDescriptor cld) {
"""
refresh all primitive typed attributes of a cached instance
with the current values from the database.
refreshing of reference and collection attributes is not done
here.
@param cachedInstance the cached instance to be... | java | private void refreshInstance(Object cachedInstance, Identity oid, ClassDescriptor cld)
{
// read in fresh copy from the db, but do not cache it
Object freshInstance = getPlainDBObject(cld, oid);
// update all primitive typed attributes
FieldDescriptor[] fields = cld.getFieldDescript... | [
"private",
"void",
"refreshInstance",
"(",
"Object",
"cachedInstance",
",",
"Identity",
"oid",
",",
"ClassDescriptor",
"cld",
")",
"{",
"// read in fresh copy from the db, but do not cache it",
"Object",
"freshInstance",
"=",
"getPlainDBObject",
"(",
"cld",
",",
"oid",
... | refresh all primitive typed attributes of a cached instance
with the current values from the database.
refreshing of reference and collection attributes is not done
here.
@param cachedInstance the cached instance to be refreshed
@param oid the Identity of the cached instance
@param cld the ClassDescriptor of cachedInst... | [
"refresh",
"all",
"primitive",
"typed",
"attributes",
"of",
"a",
"cached",
"instance",
"with",
"the",
"current",
"values",
"from",
"the",
"database",
".",
"refreshing",
"of",
"reference",
"and",
"collection",
"attributes",
"is",
"not",
"done",
"here",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java#L1743-L1758 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.variableDeclarator | JCVariableDecl variableDeclarator(JCModifiers mods, JCExpression type, boolean reqInit, Comment dc) {
"""
VariableDeclarator = Ident VariableDeclaratorRest
ConstantDeclarator = Ident ConstantDeclaratorRest
"""
return variableDeclaratorRest(token.pos, mods, type, ident(), reqInit, dc);
} | java | JCVariableDecl variableDeclarator(JCModifiers mods, JCExpression type, boolean reqInit, Comment dc) {
return variableDeclaratorRest(token.pos, mods, type, ident(), reqInit, dc);
} | [
"JCVariableDecl",
"variableDeclarator",
"(",
"JCModifiers",
"mods",
",",
"JCExpression",
"type",
",",
"boolean",
"reqInit",
",",
"Comment",
"dc",
")",
"{",
"return",
"variableDeclaratorRest",
"(",
"token",
".",
"pos",
",",
"mods",
",",
"type",
",",
"ident",
"(... | VariableDeclarator = Ident VariableDeclaratorRest
ConstantDeclarator = Ident ConstantDeclaratorRest | [
"VariableDeclarator",
"=",
"Ident",
"VariableDeclaratorRest",
"ConstantDeclarator",
"=",
"Ident",
"ConstantDeclaratorRest"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L3007-L3009 |
grpc/grpc-java | core/src/main/java/io/grpc/internal/ConnectivityStateManager.java | ConnectivityStateManager.notifyWhenStateChanged | void notifyWhenStateChanged(Runnable callback, Executor executor, ConnectivityState source) {
"""
Adds a listener for state change event.
<p>The {@code executor} must be one that can run RPC call listeners.
"""
checkNotNull(callback, "callback");
checkNotNull(executor, "executor");
checkNotNull(... | java | void notifyWhenStateChanged(Runnable callback, Executor executor, ConnectivityState source) {
checkNotNull(callback, "callback");
checkNotNull(executor, "executor");
checkNotNull(source, "source");
Listener stateChangeListener = new Listener(callback, executor);
if (state != source) {
stateCh... | [
"void",
"notifyWhenStateChanged",
"(",
"Runnable",
"callback",
",",
"Executor",
"executor",
",",
"ConnectivityState",
"source",
")",
"{",
"checkNotNull",
"(",
"callback",
",",
"\"callback\"",
")",
";",
"checkNotNull",
"(",
"executor",
",",
"\"executor\"",
")",
";"... | Adds a listener for state change event.
<p>The {@code executor} must be one that can run RPC call listeners. | [
"Adds",
"a",
"listener",
"for",
"state",
"change",
"event",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/ConnectivityStateManager.java#L45-L56 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/query/MongoDBQuery.java | MongoDBQuery.createMongoQuery | public BasicDBObject createMongoQuery(EntityMetadata m, Queue filterClauseQueue) {
"""
Creates the mongo query.
@param m
the m
@param filterClauseQueue
the filter clause queue
@return the basic db object
"""
QueryComponent sq = getQueryComponent(filterClauseQueue);
populateQueryComponent... | java | public BasicDBObject createMongoQuery(EntityMetadata m, Queue filterClauseQueue)
{
QueryComponent sq = getQueryComponent(filterClauseQueue);
populateQueryComponents(m, sq);
return sq.actualQuery == null ? new BasicDBObject() : sq.actualQuery;
} | [
"public",
"BasicDBObject",
"createMongoQuery",
"(",
"EntityMetadata",
"m",
",",
"Queue",
"filterClauseQueue",
")",
"{",
"QueryComponent",
"sq",
"=",
"getQueryComponent",
"(",
"filterClauseQueue",
")",
";",
"populateQueryComponents",
"(",
"m",
",",
"sq",
")",
";",
... | Creates the mongo query.
@param m
the m
@param filterClauseQueue
the filter clause queue
@return the basic db object | [
"Creates",
"the",
"mongo",
"query",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/query/MongoDBQuery.java#L442-L447 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/chunkblock/ChunkBlockHandler.java | ChunkBlockHandler.removeCoord | private void removeCoord(Chunk chunk, BlockPos pos) {
"""
Removes a coordinate from the specified {@link Chunk}.
@param chunk the chunk
@param pos the pos
"""
chunks(chunk).remove(chunk, pos);
} | java | private void removeCoord(Chunk chunk, BlockPos pos)
{
chunks(chunk).remove(chunk, pos);
} | [
"private",
"void",
"removeCoord",
"(",
"Chunk",
"chunk",
",",
"BlockPos",
"pos",
")",
"{",
"chunks",
"(",
"chunk",
")",
".",
"remove",
"(",
"chunk",
",",
"pos",
")",
";",
"}"
] | Removes a coordinate from the specified {@link Chunk}.
@param chunk the chunk
@param pos the pos | [
"Removes",
"a",
"coordinate",
"from",
"the",
"specified",
"{",
"@link",
"Chunk",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/chunkblock/ChunkBlockHandler.java#L182-L185 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.cmdline/src/com/ibm/ws/kernel/feature/internal/cmdline/ClasspathAction.java | ClasspathAction.createClasspathJar | private void createClasspathJar(File outputFile, String classpath) throws IOException {
"""
Writes a JAR with a MANIFEST.MF containing the Class-Path string.
@param outputFile the output file to create
@param classpath the Class-Path string
@throws IOException if an error occurs creating the file
"""
... | java | private void createClasspathJar(File outputFile, String classpath) throws IOException {
FileOutputStream out = new FileOutputStream(outputFile);
try {
Manifest manifest = new Manifest();
Attributes attrs = manifest.getMainAttributes();
attrs.put(Attributes.Name.MANIFE... | [
"private",
"void",
"createClasspathJar",
"(",
"File",
"outputFile",
",",
"String",
"classpath",
")",
"throws",
"IOException",
"{",
"FileOutputStream",
"out",
"=",
"new",
"FileOutputStream",
"(",
"outputFile",
")",
";",
"try",
"{",
"Manifest",
"manifest",
"=",
"n... | Writes a JAR with a MANIFEST.MF containing the Class-Path string.
@param outputFile the output file to create
@param classpath the Class-Path string
@throws IOException if an error occurs creating the file | [
"Writes",
"a",
"JAR",
"with",
"a",
"MANIFEST",
".",
"MF",
"containing",
"the",
"Class",
"-",
"Path",
"string",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.cmdline/src/com/ibm/ws/kernel/feature/internal/cmdline/ClasspathAction.java#L322-L333 |
jmxtrans/embedded-jmxtrans | src/main/java/org/jmxtrans/embedded/output/AbstractOutputWriter.java | AbstractOutputWriter.getStringSetting | protected String getStringSetting(String name, String defaultValue) {
"""
Return the value of the given property.
If the property is not found, the <code>defaultValue</code> is returned.
@param name name of the property
@param defaultValue default value if the property is not defined.
@return value... | java | protected String getStringSetting(String name, String defaultValue) {
if (settings.containsKey(name)) {
return settings.get(name).toString();
} else {
return defaultValue;
}
} | [
"protected",
"String",
"getStringSetting",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"settings",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"settings",
".",
"get",
"(",
"name",
")",
".",
"toString",
"(",
")... | Return the value of the given property.
If the property is not found, the <code>defaultValue</code> is returned.
@param name name of the property
@param defaultValue default value if the property is not defined.
@return value of the property or <code>defaultValue</code> if the property is not defined. | [
"Return",
"the",
"value",
"of",
"the",
"given",
"property",
"."
] | train | https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/AbstractOutputWriter.java#L190-L196 |
structr/structr | structr-ui/src/main/java/org/structr/web/common/FileHelper.java | FileHelper.setFileData | public static void setFileData(final File file, final InputStream fileStream, final String contentType) throws FrameworkException, IOException {
"""
Write image data from the given InputStream to the given file node and set checksum and size.
@param file
@param fileStream
@param contentType if null, try to au... | java | public static void setFileData(final File file, final InputStream fileStream, final String contentType) throws FrameworkException, IOException {
FileHelper.writeToFile(file, fileStream);
setFileProperties(file, contentType);
} | [
"public",
"static",
"void",
"setFileData",
"(",
"final",
"File",
"file",
",",
"final",
"InputStream",
"fileStream",
",",
"final",
"String",
"contentType",
")",
"throws",
"FrameworkException",
",",
"IOException",
"{",
"FileHelper",
".",
"writeToFile",
"(",
"file",
... | Write image data from the given InputStream to the given file node and set checksum and size.
@param file
@param fileStream
@param contentType if null, try to auto-detect content type
@throws FrameworkException
@throws IOException | [
"Write",
"image",
"data",
"from",
"the",
"given",
"InputStream",
"to",
"the",
"given",
"file",
"node",
"and",
"set",
"checksum",
"and",
"size",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L293-L297 |
hector-client/hector | core/src/main/java/me/prettyprint/cassandra/service/template/SuperCfTemplate.java | SuperCfTemplate.countColumns | public int countColumns(K key, SN start, SN end, int max) {
"""
Counts columns in the specified range of a super column family
@param key
@param start
@param end
@param max
@return
"""
SuperCountQuery<K, SN> query = HFactory.createSuperCountQuery(keyspace,
keySerializer, topSerializer);
... | java | public int countColumns(K key, SN start, SN end, int max) {
SuperCountQuery<K, SN> query = HFactory.createSuperCountQuery(keyspace,
keySerializer, topSerializer);
query.setKey(key);
query.setColumnFamily(columnFamily);
query.setRange(start, end, max);
return query.execute().get();
} | [
"public",
"int",
"countColumns",
"(",
"K",
"key",
",",
"SN",
"start",
",",
"SN",
"end",
",",
"int",
"max",
")",
"{",
"SuperCountQuery",
"<",
"K",
",",
"SN",
">",
"query",
"=",
"HFactory",
".",
"createSuperCountQuery",
"(",
"keyspace",
",",
"keySerializer... | Counts columns in the specified range of a super column family
@param key
@param start
@param end
@param max
@return | [
"Counts",
"columns",
"in",
"the",
"specified",
"range",
"of",
"a",
"super",
"column",
"family"
] | train | https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/cassandra/service/template/SuperCfTemplate.java#L86-L93 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java | TheMovieDbApi.getSeasonInfo | public TVSeasonInfo getSeasonInfo(int tvID, int seasonNumber, String language, String... appendToResponse) throws MovieDbException {
"""
Get the primary information about a TV season by its season number.
@param tvID tvID
@param seasonNumber seasonNumber
@param language language
@param appendToResponse appen... | java | public TVSeasonInfo getSeasonInfo(int tvID, int seasonNumber, String language, String... appendToResponse) throws MovieDbException {
return tmdbSeasons.getSeasonInfo(tvID, seasonNumber, language, appendToResponse);
} | [
"public",
"TVSeasonInfo",
"getSeasonInfo",
"(",
"int",
"tvID",
",",
"int",
"seasonNumber",
",",
"String",
"language",
",",
"String",
"...",
"appendToResponse",
")",
"throws",
"MovieDbException",
"{",
"return",
"tmdbSeasons",
".",
"getSeasonInfo",
"(",
"tvID",
",",... | Get the primary information about a TV season by its season number.
@param tvID tvID
@param seasonNumber seasonNumber
@param language language
@param appendToResponse appendToResponse
@return
@throws MovieDbException exception | [
"Get",
"the",
"primary",
"information",
"about",
"a",
"TV",
"season",
"by",
"its",
"season",
"number",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L1672-L1674 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.createMessageReceiverFromEntityPathAsync | public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath) {
"""
Asynchronously creates a new message receiver to the entity on the messagingFactory.
@param messagingFactory messaging factory (which represents a connection) on w... | java | public static CompletableFuture<IMessageReceiver> createMessageReceiverFromEntityPathAsync(MessagingFactory messagingFactory, String entityPath) {
return createMessageReceiverFromEntityPathAsync(messagingFactory, entityPath, DEFAULTRECEIVEMODE);
} | [
"public",
"static",
"CompletableFuture",
"<",
"IMessageReceiver",
">",
"createMessageReceiverFromEntityPathAsync",
"(",
"MessagingFactory",
"messagingFactory",
",",
"String",
"entityPath",
")",
"{",
"return",
"createMessageReceiverFromEntityPathAsync",
"(",
"messagingFactory",
... | Asynchronously creates a new message receiver to the entity on the messagingFactory.
@param messagingFactory messaging factory (which represents a connection) on which receiver needs to be created.
@param entityPath path of entity
@return a CompletableFuture representing the pending creation of message receiver | [
"Asynchronously",
"creates",
"a",
"new",
"message",
"receiver",
"to",
"the",
"entity",
"on",
"the",
"messagingFactory",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L455-L457 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/localization/MessageInterpolator.java | MessageInterpolator.interpolate | public String interpolate(final String message, final Map<String, ?> vars, boolean recursive,
final MessageResolver messageResolver) {
"""
メッセージを引数varsで指定した変数で補完する。
<p>{@link MessageResolver}を指定した場合、メッセージ中の変数をメッセージコードとして解決します。
@param message 対象のメッセージ。
@param vars メッセージ中の変数に対する値のマップ。
@param recur... | java | public String interpolate(final String message, final Map<String, ?> vars, boolean recursive,
final MessageResolver messageResolver) {
return parse(message, vars, recursive, messageResolver);
} | [
"public",
"String",
"interpolate",
"(",
"final",
"String",
"message",
",",
"final",
"Map",
"<",
"String",
",",
"?",
">",
"vars",
",",
"boolean",
"recursive",
",",
"final",
"MessageResolver",
"messageResolver",
")",
"{",
"return",
"parse",
"(",
"message",
","... | メッセージを引数varsで指定した変数で補完する。
<p>{@link MessageResolver}を指定した場合、メッセージ中の変数をメッセージコードとして解決します。
@param message 対象のメッセージ。
@param vars メッセージ中の変数に対する値のマップ。
@param recursive 変換したメッセージに対しても再帰的に処理するかどうか
@param messageResolver メッセージを解決するクラス。nullの場合、指定しないと同じ意味になります。
@return 補完したメッセージ。 | [
"メッセージを引数varsで指定した変数で補完する。",
"<p",
">",
"{",
"@link",
"MessageResolver",
"}",
"を指定した場合、メッセージ中の変数をメッセージコードとして解決します。"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/localization/MessageInterpolator.java#L100-L103 |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.viewRangeUpdate | void viewRangeUpdate(int positionStart, int itemCount) {
"""
Rebind existing views for the given range, or create as needed.
@param positionStart Adapter position to start at
@param itemCount Number of views that must explicitly be rebound
"""
final int childCount = getChildCount();
final i... | java | void viewRangeUpdate(int positionStart, int itemCount) {
final int childCount = getChildCount();
final int positionEnd = positionStart + itemCount;
for (int i = 0; i < childCount; i++) {
final ViewHolder holder = getChildViewHolderInt(getChildAt(i));
if (holder == null) ... | [
"void",
"viewRangeUpdate",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"final",
"int",
"childCount",
"=",
"getChildCount",
"(",
")",
";",
"final",
"int",
"positionEnd",
"=",
"positionStart",
"+",
"itemCount",
";",
"for",
"(",
"int",
"i",
... | Rebind existing views for the given range, or create as needed.
@param positionStart Adapter position to start at
@param itemCount Number of views that must explicitly be rebound | [
"Rebind",
"existing",
"views",
"for",
"the",
"given",
"range",
"or",
"create",
"as",
"needed",
"."
] | train | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L1880-L1898 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Character.java | Character.toChars | public static int toChars(int codePoint, char[] dst, int dstIndex) {
"""
Converts the specified character (Unicode code point) to its
UTF-16 representation. If the specified code point is a BMP
(Basic Multilingual Plane or Plane 0) value, the same value is
stored in {@code dst[dstIndex]}, and 1 is returned. If ... | java | public static int toChars(int codePoint, char[] dst, int dstIndex) {
if (isBmpCodePoint(codePoint)) {
dst[dstIndex] = (char) codePoint;
return 1;
} else if (isValidCodePoint(codePoint)) {
toSurrogates(codePoint, dst, dstIndex);
return 2;
} else {
... | [
"public",
"static",
"int",
"toChars",
"(",
"int",
"codePoint",
",",
"char",
"[",
"]",
"dst",
",",
"int",
"dstIndex",
")",
"{",
"if",
"(",
"isBmpCodePoint",
"(",
"codePoint",
")",
")",
"{",
"dst",
"[",
"dstIndex",
"]",
"=",
"(",
"char",
")",
"codePoin... | Converts the specified character (Unicode code point) to its
UTF-16 representation. If the specified code point is a BMP
(Basic Multilingual Plane or Plane 0) value, the same value is
stored in {@code dst[dstIndex]}, and 1 is returned. If the
specified code point is a supplementary character, its
surrogate values are s... | [
"Converts",
"the",
"specified",
"character",
"(",
"Unicode",
"code",
"point",
")",
"to",
"its",
"UTF",
"-",
"16",
"representation",
".",
"If",
"the",
"specified",
"code",
"point",
"is",
"a",
"BMP",
"(",
"Basic",
"Multilingual",
"Plane",
"or",
"Plane",
"0",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Character.java#L5197-L5207 |
wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java | RamlControllerVisitor.addResponsesToAction | private void addResponsesToAction(ControllerRouteModel<Raml> elem, Action action) {
"""
Add the response specification to the given action.
@param elem The ControllerRouteModel that contains the response specification.
@param action The Action on which to add the response specification.
"""
// g... | java | private void addResponsesToAction(ControllerRouteModel<Raml> elem, Action action) {
// get all mimeTypes defined in @Route.produces
LOGGER.debug("responsesMimes.size:"+elem.getResponseMimes().size());
List<String> mimes = new ArrayList<>();
mimes.addAll(elem.getResponseMimes());
... | [
"private",
"void",
"addResponsesToAction",
"(",
"ControllerRouteModel",
"<",
"Raml",
">",
"elem",
",",
"Action",
"action",
")",
"{",
"// get all mimeTypes defined in @Route.produces",
"LOGGER",
".",
"debug",
"(",
"\"responsesMimes.size:\"",
"+",
"elem",
".",
"getRespons... | Add the response specification to the given action.
@param elem The ControllerRouteModel that contains the response specification.
@param action The Action on which to add the response specification. | [
"Add",
"the",
"response",
"specification",
"to",
"the",
"given",
"action",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java#L294-L337 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSubObjectPropertyOfAxiomImpl_CustomFieldSerializer.java | OWLSubObjectPropertyOfAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLSubObjectPropertyOfAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link co... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLSubObjectPropertyOfAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLSubObjectPropertyOfAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"... | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSubObjectPropertyOfAxiomImpl_CustomFieldSerializer.java#L97-L100 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/cache/image/ImageLoader.java | ImageLoader.initialize | public static synchronized void initialize(Context context) {
"""
This method must be called before any other method is invoked on this class. Please note that
when using ImageLoader as part of {@link WebImageView} or {@link WebGalleryAdapter}, then
there is no need to call this method, since those classes will ... | java | public static synchronized void initialize(Context context) {
if (executor == null) {
executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(DEFAULT_POOL_SIZE);
}
if (imageCache == null) {
imageCache = new ImageCache(25, expirationInMinutes, DEFAULT_POOL_SIZE);
... | [
"public",
"static",
"synchronized",
"void",
"initialize",
"(",
"Context",
"context",
")",
"{",
"if",
"(",
"executor",
"==",
"null",
")",
"{",
"executor",
"=",
"(",
"ThreadPoolExecutor",
")",
"Executors",
".",
"newFixedThreadPool",
"(",
"DEFAULT_POOL_SIZE",
")",
... | This method must be called before any other method is invoked on this class. Please note that
when using ImageLoader as part of {@link WebImageView} or {@link WebGalleryAdapter}, then
there is no need to call this method, since those classes will already do that for you. This
method is idempotent. You may call it multi... | [
"This",
"method",
"must",
"be",
"called",
"before",
"any",
"other",
"method",
"is",
"invoked",
"on",
"this",
"class",
".",
"Please",
"note",
"that",
"when",
"using",
"ImageLoader",
"as",
"part",
"of",
"{",
"@link",
"WebImageView",
"}",
"or",
"{",
"@link",
... | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/cache/image/ImageLoader.java#L74-L82 |
Waxolunist/bittwiddling | src/main/java/com/vcollaborate/bitwise/BinaryStringUtils.java | BinaryStringUtils.zeroPadString | public static final String zeroPadString(final String binaryString) {
"""
Same as {@link #zeroPadString(String, int)}, but determines {@code minLength} automatically.
"""
int minLength = (int) Math.ceil(binaryString.length() / 4.) * 4;
return zeroPadString(binaryString, minLength);
} | java | public static final String zeroPadString(final String binaryString) {
int minLength = (int) Math.ceil(binaryString.length() / 4.) * 4;
return zeroPadString(binaryString, minLength);
} | [
"public",
"static",
"final",
"String",
"zeroPadString",
"(",
"final",
"String",
"binaryString",
")",
"{",
"int",
"minLength",
"=",
"(",
"int",
")",
"Math",
".",
"ceil",
"(",
"binaryString",
".",
"length",
"(",
")",
"/",
"4.",
")",
"*",
"4",
";",
"retur... | Same as {@link #zeroPadString(String, int)}, but determines {@code minLength} automatically. | [
"Same",
"as",
"{"
] | train | https://github.com/Waxolunist/bittwiddling/blob/2c36342add73aab1223292d12fcff453aa3c07cd/src/main/java/com/vcollaborate/bitwise/BinaryStringUtils.java#L76-L79 |
sockeqwe/mosby | presentermanager/src/main/java/com/hannesdorfmann/mosby3/PresenterManager.java | PresenterManager.getPresenter | @Nullable public static <P> P getPresenter(@NonNull Activity activity, @NonNull String viewId) {
"""
Get the presenter for the View with the given (Mosby - internal) view Id or <code>null</code>
if no presenter for the given view (via view id) exists.
@param activity The Activity (used for scoping)
@param vie... | java | @Nullable public static <P> P getPresenter(@NonNull Activity activity, @NonNull String viewId) {
if (activity == null) {
throw new NullPointerException("Activity is null");
}
if (viewId == null) {
throw new NullPointerException("View id is null");
}
ActivityScopedCache scopedCache = ge... | [
"@",
"Nullable",
"public",
"static",
"<",
"P",
">",
"P",
"getPresenter",
"(",
"@",
"NonNull",
"Activity",
"activity",
",",
"@",
"NonNull",
"String",
"viewId",
")",
"{",
"if",
"(",
"activity",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
... | Get the presenter for the View with the given (Mosby - internal) view Id or <code>null</code>
if no presenter for the given view (via view id) exists.
@param activity The Activity (used for scoping)
@param viewId The mosby internal View Id (unique among all {@link MvpView}
@param <P> The Presenter type
@return The Pre... | [
"Get",
"the",
"presenter",
"for",
"the",
"View",
"with",
"the",
"given",
"(",
"Mosby",
"-",
"internal",
")",
"view",
"Id",
"or",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"no",
"presenter",
"for",
"the",
"given",
"view",
"(",
"via",
"view",
"id"... | train | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/presentermanager/src/main/java/com/hannesdorfmann/mosby3/PresenterManager.java#L172-L183 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwpolicy_binding.java | appfwpolicy_binding.get | public static appfwpolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch appfwpolicy_binding resource of given name .
"""
appfwpolicy_binding obj = new appfwpolicy_binding();
obj.set_name(name);
appfwpolicy_binding response = (appfwpolicy_binding) obj.get_res... | java | public static appfwpolicy_binding get(nitro_service service, String name) throws Exception{
appfwpolicy_binding obj = new appfwpolicy_binding();
obj.set_name(name);
appfwpolicy_binding response = (appfwpolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"appfwpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"appfwpolicy_binding",
"obj",
"=",
"new",
"appfwpolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
... | Use this API to fetch appfwpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"appfwpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwpolicy_binding.java#L136-L141 |
bladecoder/blade-ink | src/main/java/com/bladecoder/ink/runtime/Story.java | Story.evaluateFunction | public Object evaluateFunction(String functionName, Object[] arguments) throws Exception {
"""
Evaluates a function defined in ink.
@param functionName
The name of the function as declared in ink.
@param arguments
The arguments that the ink function takes, if any. Note that we
don't (can't) do any validatio... | java | public Object evaluateFunction(String functionName, Object[] arguments) throws Exception {
return evaluateFunction(functionName, null, arguments);
} | [
"public",
"Object",
"evaluateFunction",
"(",
"String",
"functionName",
",",
"Object",
"[",
"]",
"arguments",
")",
"throws",
"Exception",
"{",
"return",
"evaluateFunction",
"(",
"functionName",
",",
"null",
",",
"arguments",
")",
";",
"}"
] | Evaluates a function defined in ink.
@param functionName
The name of the function as declared in ink.
@param arguments
The arguments that the ink function takes, if any. Note that we
don't (can't) do any validation on the number of arguments right
now, so make sure you get it right!
@return The return value as returne... | [
"Evaluates",
"a",
"function",
"defined",
"in",
"ink",
"."
] | train | https://github.com/bladecoder/blade-ink/blob/930922099f7073f50f956479adaa3cbd47c70225/src/main/java/com/bladecoder/ink/runtime/Story.java#L2378-L2380 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.pack | public static void pack(File sourceDir, OutputStream os) {
"""
Compresses the given directory and all of its sub-directories into the passed in
stream. It is the responsibility of the caller to close the passed in
stream properly.
@param sourceDir
root directory.
@param os
output stream (will be buffered i... | java | public static void pack(File sourceDir, OutputStream os) {
pack(sourceDir, os, IdentityNameMapper.INSTANCE, DEFAULT_COMPRESSION_LEVEL);
} | [
"public",
"static",
"void",
"pack",
"(",
"File",
"sourceDir",
",",
"OutputStream",
"os",
")",
"{",
"pack",
"(",
"sourceDir",
",",
"os",
",",
"IdentityNameMapper",
".",
"INSTANCE",
",",
"DEFAULT_COMPRESSION_LEVEL",
")",
";",
"}"
] | Compresses the given directory and all of its sub-directories into the passed in
stream. It is the responsibility of the caller to close the passed in
stream properly.
@param sourceDir
root directory.
@param os
output stream (will be buffered in this method).
@since 1.10 | [
"Compresses",
"the",
"given",
"directory",
"and",
"all",
"of",
"its",
"sub",
"-",
"directories",
"into",
"the",
"passed",
"in",
"stream",
".",
"It",
"is",
"the",
"responsibility",
"of",
"the",
"caller",
"to",
"close",
"the",
"passed",
"in",
"stream",
"prop... | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L1634-L1636 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java | RandomUtil.randomEle | public static <T> T randomEle(List<T> list, int limit) {
"""
随机获得列表中的元素
@param <T> 元素类型
@param list 列表
@param limit 限制列表的前N项
@return 随机元素
"""
return list.get(randomInt(limit));
} | java | public static <T> T randomEle(List<T> list, int limit) {
return list.get(randomInt(limit));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"randomEle",
"(",
"List",
"<",
"T",
">",
"list",
",",
"int",
"limit",
")",
"{",
"return",
"list",
".",
"get",
"(",
"randomInt",
"(",
"limit",
")",
")",
";",
"}"
] | 随机获得列表中的元素
@param <T> 元素类型
@param list 列表
@param limit 限制列表的前N项
@return 随机元素 | [
"随机获得列表中的元素"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java#L274-L276 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/dom3/LSSerializerImpl.java | LSSerializerImpl.canSetParameter | public boolean canSetParameter(String name, Object value) {
"""
Checks if setting a parameter to a specific value is supported.
@see org.w3c.dom.DOMConfiguration#canSetParameter(java.lang.String, java.lang.Object)
@since DOM Level 3
@param name A String containing the DOMConfiguration parameter name.
@param ... | java | public boolean canSetParameter(String name, Object value) {
if (value instanceof Boolean){
if ( name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)
|| name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)
|| name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)
... | [
"public",
"boolean",
"canSetParameter",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Boolean",
")",
"{",
"if",
"(",
"name",
".",
"equalsIgnoreCase",
"(",
"DOMConstants",
".",
"DOM_CDATA_SECTIONS",
")",
"||",
"na... | Checks if setting a parameter to a specific value is supported.
@see org.w3c.dom.DOMConfiguration#canSetParameter(java.lang.String, java.lang.Object)
@since DOM Level 3
@param name A String containing the DOMConfiguration parameter name.
@param value An Object specifying the value of the corresponding parameter. | [
"Checks",
"if",
"setting",
"a",
"parameter",
"to",
"a",
"specific",
"value",
"is",
"supported",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/dom3/LSSerializerImpl.java#L390-L427 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/event/MapEventPublishingService.java | MapEventPublishingService.dispatchLocalEventData | private void dispatchLocalEventData(EventData eventData, ListenerAdapter listener) {
"""
Dispatches an event-data to {@link com.hazelcast.map.QueryCache QueryCache} listeners on this local
node.
@param eventData {@link EventData} to be dispatched
@param listener the listener which the event will be dispatche... | java | private void dispatchLocalEventData(EventData eventData, ListenerAdapter listener) {
IMapEvent event = createIMapEvent(eventData, null, nodeEngine.getLocalMember(), serializationService);
listener.onEvent(event);
} | [
"private",
"void",
"dispatchLocalEventData",
"(",
"EventData",
"eventData",
",",
"ListenerAdapter",
"listener",
")",
"{",
"IMapEvent",
"event",
"=",
"createIMapEvent",
"(",
"eventData",
",",
"null",
",",
"nodeEngine",
".",
"getLocalMember",
"(",
")",
",",
"seriali... | Dispatches an event-data to {@link com.hazelcast.map.QueryCache QueryCache} listeners on this local
node.
@param eventData {@link EventData} to be dispatched
@param listener the listener which the event will be dispatched from | [
"Dispatches",
"an",
"event",
"-",
"data",
"to",
"{",
"@link",
"com",
".",
"hazelcast",
".",
"map",
".",
"QueryCache",
"QueryCache",
"}",
"listeners",
"on",
"this",
"local",
"node",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/event/MapEventPublishingService.java#L156-L159 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Connection.java | JDBC4Connection.prepareCall | @Override
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
"""
Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
"""
if (resultSetType == ResultSet.TYPE_SCROLL_INSENSITIVE &... | java | @Override
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
{
if (resultSetType == ResultSet.TYPE_SCROLL_INSENSITIVE && resultSetConcurrency == ResultSet.CONCUR_READ_ONLY)
return prepareCall(sql);
checkClosed();
... | [
"@",
"Override",
"public",
"CallableStatement",
"prepareCall",
"(",
"String",
"sql",
",",
"int",
"resultSetType",
",",
"int",
"resultSetConcurrency",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"resultSetType",
"==",
"ResultSet",
".",
"TYPE_SCROLL_INSENSITIVE",
"... | Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. | [
"Creates",
"a",
"CallableStatement",
"object",
"that",
"will",
"generate",
"ResultSet",
"objects",
"with",
"the",
"given",
"type",
"and",
"concurrency",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Connection.java#L344-L351 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java | VirtualMachineScaleSetVMsInner.getAsync | public Observable<VirtualMachineScaleSetVMInner> getAsync(String resourceGroupName, String vmScaleSetName, String instanceId) {
"""
Gets a virtual machine from a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceId The ins... | java | public Observable<VirtualMachineScaleSetVMInner> getAsync(String resourceGroupName, String vmScaleSetName, String instanceId) {
return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1<ServiceResponse<VirtualMachineScaleSetVMInner>, VirtualMachineScaleSetVMInner>() {
... | [
"public",
"Observable",
"<",
"VirtualMachineScaleSetVMInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"String",
"instanceId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetNa... | Gets a virtual machine from a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceId The instance ID of the virtual machine.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Virt... | [
"Gets",
"a",
"virtual",
"machine",
"from",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java#L1068-L1075 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CreateSyntheticOverheadViewPL.java | CreateSyntheticOverheadViewPL.process | public void process(Planar<T> input, Planar<T> output) {
"""
Computes overhead view of input image. All pixels in input image are assumed to be on the ground plane.
@param input (Input) Camera image.
@param output (Output) Image containing overhead view.
"""
int N = input.getNumBands();
for( int i = ... | java | public void process(Planar<T> input, Planar<T> output) {
int N = input.getNumBands();
for( int i = 0; i < N; i++ ) {
this.output[i] = FactoryGImageGray.wrap(output.getBand(i),this.output[i]);
interp[i].setImage(input.getBand(i));
}
int indexMap = 0;
for( int i = 0; i < output.height; i++ ) {
int in... | [
"public",
"void",
"process",
"(",
"Planar",
"<",
"T",
">",
"input",
",",
"Planar",
"<",
"T",
">",
"output",
")",
"{",
"int",
"N",
"=",
"input",
".",
"getNumBands",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"N",
";",
"i",... | Computes overhead view of input image. All pixels in input image are assumed to be on the ground plane.
@param input (Input) Camera image.
@param output (Output) Image containing overhead view. | [
"Computes",
"overhead",
"view",
"of",
"input",
"image",
".",
"All",
"pixels",
"in",
"input",
"image",
"are",
"assumed",
"to",
"be",
"on",
"the",
"ground",
"plane",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CreateSyntheticOverheadViewPL.java#L77-L97 |
javalite/activejdbc | javalite-common/src/main/java/org/javalite/common/Convert.java | Convert.toBigDecimal | public static BigDecimal toBigDecimal(Object value) {
"""
Converts value to BigDecimal if it can. If value is a BigDecimal, it is returned, if it is a BigDecimal, it is
promoted to BigDecimal and then returned, in all other cases, it converts the value to String,
then tries to parse BigDecimal from it.
@param... | java | public static BigDecimal toBigDecimal(Object value) {
if (value == null) {
return null;
} else if (value instanceof BigDecimal) {
return (BigDecimal) value;
} else {
try {
return new BigDecimal(value.toString().trim());
} catch (Num... | [
"public",
"static",
"BigDecimal",
"toBigDecimal",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"value",
"instanceof",
"BigDecimal",
")",
"{",
"return",
"(",
"BigDecimal",
")"... | Converts value to BigDecimal if it can. If value is a BigDecimal, it is returned, if it is a BigDecimal, it is
promoted to BigDecimal and then returned, in all other cases, it converts the value to String,
then tries to parse BigDecimal from it.
@param value value to be converted to Integer.
@return value converted to... | [
"Converts",
"value",
"to",
"BigDecimal",
"if",
"it",
"can",
".",
"If",
"value",
"is",
"a",
"BigDecimal",
"it",
"is",
"returned",
"if",
"it",
"is",
"a",
"BigDecimal",
"it",
"is",
"promoted",
"to",
"BigDecimal",
"and",
"then",
"returned",
"in",
"all",
"oth... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/javalite-common/src/main/java/org/javalite/common/Convert.java#L397-L409 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/util/BeanDefinitionParserUtils.java | BeanDefinitionParserUtils.setConstructorArgValue | public static void setConstructorArgValue(BeanDefinitionBuilder builder, String propertyValue) {
"""
Sets the property value on bean definition as constructor argument in case value
is not null.
@param builder the bean definition to be configured
@param propertyValue the property value
"""
if (Str... | java | public static void setConstructorArgValue(BeanDefinitionBuilder builder, String propertyValue) {
if (StringUtils.hasText(propertyValue)) {
builder.addConstructorArgValue(propertyValue);
}
} | [
"public",
"static",
"void",
"setConstructorArgValue",
"(",
"BeanDefinitionBuilder",
"builder",
",",
"String",
"propertyValue",
")",
"{",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"propertyValue",
")",
")",
"{",
"builder",
".",
"addConstructorArgValue",
"(",
"... | Sets the property value on bean definition as constructor argument in case value
is not null.
@param builder the bean definition to be configured
@param propertyValue the property value | [
"Sets",
"the",
"property",
"value",
"on",
"bean",
"definition",
"as",
"constructor",
"argument",
"in",
"case",
"value",
"is",
"not",
"null",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/util/BeanDefinitionParserUtils.java#L61-L65 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.