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 |
|---|---|---|---|---|---|---|---|---|---|---|
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/file/Page.java | Page.getVal | public synchronized Constant getVal(int offset, Type type) {
"""
Returns the value at a specified offset of this page. If a constant was
not stored at that offset, the behavior of the method is unpredictable.
@param offset
the byte offset within the page
@param type
the type of the value
@return the co... | java | public synchronized Constant getVal(int offset, Type type) {
int size;
byte[] byteVal = null;
// Check the length of bytes
if (type.isFixedSize()) {
size = type.maxSize();
} else {
byteVal = new byte[ByteHelper.INT_SIZE];
contents.get(offset, byteVal);
size = ByteHelper.toInteger(byteVa... | [
"public",
"synchronized",
"Constant",
"getVal",
"(",
"int",
"offset",
",",
"Type",
"type",
")",
"{",
"int",
"size",
";",
"byte",
"[",
"]",
"byteVal",
"=",
"null",
";",
"// Check the length of bytes\r",
"if",
"(",
"type",
".",
"isFixedSize",
"(",
")",
")",
... | Returns the value at a specified offset of this page. If a constant was
not stored at that offset, the behavior of the method is unpredictable.
@param offset
the byte offset within the page
@param type
the type of the value
@return the constant value at that offset | [
"Returns",
"the",
"value",
"at",
"a",
"specified",
"offset",
"of",
"this",
"page",
".",
"If",
"a",
"constant",
"was",
"not",
"stored",
"at",
"that",
"offset",
"the",
"behavior",
"of",
"the",
"method",
"is",
"unpredictable",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/file/Page.java#L150-L168 |
samskivert/samskivert | src/main/java/com/samskivert/velocity/FormTool.java | FormTool.submitExtra | public String submitExtra (String name, String text, String extra) {
"""
Constructs a submit element with the specified parameter name and
the specified button text with the specified extra text.
"""
return fixedInput("submit", name, text, extra);
} | java | public String submitExtra (String name, String text, String extra)
{
return fixedInput("submit", name, text, extra);
} | [
"public",
"String",
"submitExtra",
"(",
"String",
"name",
",",
"String",
"text",
",",
"String",
"extra",
")",
"{",
"return",
"fixedInput",
"(",
"\"submit\"",
",",
"name",
",",
"text",
",",
"extra",
")",
";",
"}"
] | Constructs a submit element with the specified parameter name and
the specified button text with the specified extra text. | [
"Constructs",
"a",
"submit",
"element",
"with",
"the",
"specified",
"parameter",
"name",
"and",
"the",
"specified",
"button",
"text",
"with",
"the",
"specified",
"extra",
"text",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/FormTool.java#L176-L179 |
alkacon/opencms-core | src/org/opencms/publish/CmsPublishManager.java | CmsPublishManager.getPublishList | public CmsPublishList getPublishList(
CmsObject cms,
CmsResource directPublishResource,
boolean directPublishSiblings) throws CmsException {
"""
Returns a publish list with all new/changed/deleted resources of the current (offline)
project that actually get published for a direct publish o... | java | public CmsPublishList getPublishList(
CmsObject cms,
CmsResource directPublishResource,
boolean directPublishSiblings) throws CmsException {
return m_securityManager.fillPublishList(
cms.getRequestContext(),
new CmsPublishList(directPublishResource, directPublish... | [
"public",
"CmsPublishList",
"getPublishList",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"directPublishResource",
",",
"boolean",
"directPublishSiblings",
")",
"throws",
"CmsException",
"{",
"return",
"m_securityManager",
".",
"fillPublishList",
"(",
"cms",
".",
"getR... | Returns a publish list with all new/changed/deleted resources of the current (offline)
project that actually get published for a direct publish of a single resource.<p>
@param cms the cms request context
@param directPublishResource the resource which will be directly published
@param directPublishSiblings <code>true<... | [
"Returns",
"a",
"publish",
"list",
"with",
"all",
"new",
"/",
"changed",
"/",
"deleted",
"resources",
"of",
"the",
"current",
"(",
"offline",
")",
"project",
"that",
"actually",
"get",
"published",
"for",
"a",
"direct",
"publish",
"of",
"a",
"single",
"res... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/publish/CmsPublishManager.java#L305-L313 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/datastructure/JMMap.java | JMMap.putGetNew | public static <V, K> V putGetNew(Map<K, V> map, K key, V newValue) {
"""
Put get new v.
@param <V> the type parameter
@param <K> the type parameter
@param map the map
@param key the key
@param newValue the new value
@return the v
"""
synchronized (map) {
map.put(... | java | public static <V, K> V putGetNew(Map<K, V> map, K key, V newValue) {
synchronized (map) {
map.put(key, newValue);
return newValue;
}
} | [
"public",
"static",
"<",
"V",
",",
"K",
">",
"V",
"putGetNew",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"K",
"key",
",",
"V",
"newValue",
")",
"{",
"synchronized",
"(",
"map",
")",
"{",
"map",
".",
"put",
"(",
"key",
",",
"newValue",
... | Put get new v.
@param <V> the type parameter
@param <K> the type parameter
@param map the map
@param key the key
@param newValue the new value
@return the v | [
"Put",
"get",
"new",
"v",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/datastructure/JMMap.java#L122-L127 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/util/TransparentReplicaGetHelper.java | TransparentReplicaGetHelper.getFirstPrimaryOrReplica | @InterfaceStability.Experimental
@InterfaceAudience.Public
public Single<JsonDocument> getFirstPrimaryOrReplica(final String id, final Bucket bucket) {
"""
Asynchronously fetch the document from the primary and if that operations fails try
all the replicas and return the first document that comes back fro... | java | @InterfaceStability.Experimental
@InterfaceAudience.Public
public Single<JsonDocument> getFirstPrimaryOrReplica(final String id, final Bucket bucket) {
return getFirstPrimaryOrReplica(id, bucket, bucket.environment().kvTimeout());
} | [
"@",
"InterfaceStability",
".",
"Experimental",
"@",
"InterfaceAudience",
".",
"Public",
"public",
"Single",
"<",
"JsonDocument",
">",
"getFirstPrimaryOrReplica",
"(",
"final",
"String",
"id",
",",
"final",
"Bucket",
"bucket",
")",
"{",
"return",
"getFirstPrimaryOrR... | Asynchronously fetch the document from the primary and if that operations fails try
all the replicas and return the first document that comes back from them (using the
environments KV timeout for both primary and replica).
@param id the document ID to fetch.
@param bucket the bucket to use when fetching the doc.
@ret... | [
"Asynchronously",
"fetch",
"the",
"document",
"from",
"the",
"primary",
"and",
"if",
"that",
"operations",
"fails",
"try",
"all",
"the",
"replicas",
"and",
"return",
"the",
"first",
"document",
"that",
"comes",
"back",
"from",
"them",
"(",
"using",
"the",
"e... | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/util/TransparentReplicaGetHelper.java#L88-L92 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/SmartTable.java | SmartTable.setStyleNames | public void setStyleNames (int row, int column, String... styles) {
"""
Configures the specified style names on the specified row and column. The first style is set
as the primary style and additional styles are added onto that.
"""
int idx = 0;
for (String style : styles) {
if (id... | java | public void setStyleNames (int row, int column, String... styles)
{
int idx = 0;
for (String style : styles) {
if (idx++ == 0) {
getFlexCellFormatter().setStyleName(row, column, style);
} else {
getFlexCellFormatter().addStyleName(row, column, ... | [
"public",
"void",
"setStyleNames",
"(",
"int",
"row",
",",
"int",
"column",
",",
"String",
"...",
"styles",
")",
"{",
"int",
"idx",
"=",
"0",
";",
"for",
"(",
"String",
"style",
":",
"styles",
")",
"{",
"if",
"(",
"idx",
"++",
"==",
"0",
")",
"{"... | Configures the specified style names on the specified row and column. The first style is set
as the primary style and additional styles are added onto that. | [
"Configures",
"the",
"specified",
"style",
"names",
"on",
"the",
"specified",
"row",
"and",
"column",
".",
"The",
"first",
"style",
"is",
"set",
"as",
"the",
"primary",
"style",
"and",
"additional",
"styles",
"are",
"added",
"onto",
"that",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/SmartTable.java#L335-L345 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java | ComponentSupport.getLocale | public static Locale getLocale(FaceletContext ctx, TagAttribute attr) throws TagAttributeException {
"""
According to JSF 1.2 tag specs, this helper method will use the TagAttribute passed in determining the Locale
intended.
@param ctx
FaceletContext to evaluate from
@param attr
TagAttribute representing a ... | java | public static Locale getLocale(FaceletContext ctx, TagAttribute attr) throws TagAttributeException
{
Object obj = attr.getObject(ctx);
if (obj instanceof Locale)
{
return (Locale) obj;
}
if (obj instanceof String)
{
String s = (String) obj;
... | [
"public",
"static",
"Locale",
"getLocale",
"(",
"FaceletContext",
"ctx",
",",
"TagAttribute",
"attr",
")",
"throws",
"TagAttributeException",
"{",
"Object",
"obj",
"=",
"attr",
".",
"getObject",
"(",
"ctx",
")",
";",
"if",
"(",
"obj",
"instanceof",
"Locale",
... | According to JSF 1.2 tag specs, this helper method will use the TagAttribute passed in determining the Locale
intended.
@param ctx
FaceletContext to evaluate from
@param attr
TagAttribute representing a Locale
@return Locale found
@throws TagAttributeException
if the Locale cannot be determined | [
"According",
"to",
"JSF",
"1",
".",
"2",
"tag",
"specs",
"this",
"helper",
"method",
"will",
"use",
"the",
"TagAttribute",
"passed",
"in",
"determining",
"the",
"Locale",
"intended",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java#L405-L436 |
guardtime/ksi-java-sdk | ksi-api/src/main/java/com/guardtime/ksi/trust/JKSTrustStore.java | JKSTrustStore.isTrusted | public boolean isTrusted(X509Certificate certificate, Store certStore) throws CryptoException {
"""
This method is used to check if certificate is trusted or not.
@param certificate
instance of PKI X.509 certificate. not null.
@param certStore
additional certificates to be used to check if certificate chain ... | java | public boolean isTrusted(X509Certificate certificate, Store certStore) throws CryptoException {
try {
if (certificate == null) {
throw new CryptoException("Invalid input parameter. Certificate can not be null");
}
LOGGER.info("Checking if certificate with subj... | [
"public",
"boolean",
"isTrusted",
"(",
"X509Certificate",
"certificate",
",",
"Store",
"certStore",
")",
"throws",
"CryptoException",
"{",
"try",
"{",
"if",
"(",
"certificate",
"==",
"null",
")",
"{",
"throw",
"new",
"CryptoException",
"(",
"\"Invalid input parame... | This method is used to check if certificate is trusted or not.
@param certificate
instance of PKI X.509 certificate. not null.
@param certStore
additional certificates to be used to check if certificate chain is trusted or not.
@return true if certificate is trusted, false otherwise
@throws CryptoException
will be thr... | [
"This",
"method",
"is",
"used",
"to",
"check",
"if",
"certificate",
"is",
"trusted",
"or",
"not",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-api/src/main/java/com/guardtime/ksi/trust/JKSTrustStore.java#L138-L182 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.lset | @Override
public String lset(final byte[] key, final long index, final byte[] value) {
"""
Set a new value as the element at index position of the List at key.
<p>
Out of range indexes will generate an error.
<p>
Similarly to other list commands accepting indexes, the index can be negative to access
element... | java | @Override
public String lset(final byte[] key, final long index, final byte[] value) {
checkIsInMultiOrPipeline();
client.lset(key, index, value);
return client.getStatusCodeReply();
} | [
"@",
"Override",
"public",
"String",
"lset",
"(",
"final",
"byte",
"[",
"]",
"key",
",",
"final",
"long",
"index",
",",
"final",
"byte",
"[",
"]",
"value",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"lset",
"(",
"key",
",",
"... | Set a new value as the element at index position of the List at key.
<p>
Out of range indexes will generate an error.
<p>
Similarly to other list commands accepting indexes, the index can be negative to access
elements starting from the end of the list. So -1 is the last element, -2 is the penultimate,
and so forth.
<p... | [
"Set",
"a",
"new",
"value",
"as",
"the",
"element",
"at",
"index",
"position",
"of",
"the",
"List",
"at",
"key",
".",
"<p",
">",
"Out",
"of",
"range",
"indexes",
"will",
"generate",
"an",
"error",
".",
"<p",
">",
"Similarly",
"to",
"other",
"list",
"... | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L1287-L1292 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/TimeLimitDaemon.java | TimeLimitDaemon.valueWasAccessed | public void valueWasAccessed(DCache cache, Object id, long expirationTime, int inactivity) {
"""
CPF-Inactivity - cache check inactivity > 0 before calling this method.
"""
valueHasChanged(cache, id, expirationTime, inactivity);
} | java | public void valueWasAccessed(DCache cache, Object id, long expirationTime, int inactivity) {
valueHasChanged(cache, id, expirationTime, inactivity);
} | [
"public",
"void",
"valueWasAccessed",
"(",
"DCache",
"cache",
",",
"Object",
"id",
",",
"long",
"expirationTime",
",",
"int",
"inactivity",
")",
"{",
"valueHasChanged",
"(",
"cache",
",",
"id",
",",
"expirationTime",
",",
"inactivity",
")",
";",
"}"
] | CPF-Inactivity - cache check inactivity > 0 before calling this method. | [
"CPF",
"-",
"Inactivity",
"-",
"cache",
"check",
"inactivity",
">",
"0",
"before",
"calling",
"this",
"method",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/TimeLimitDaemon.java#L298-L300 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/client/gui/component/UIComponent.java | UIComponent.isInsideBounds | public boolean isInsideBounds(int x, int y) {
"""
Checks if supplied coordinates are inside this {@link UIComponent} bounds.
@param x the x
@param y the y
@return true, if coordinates are inside bounds
"""
if (!isVisible())
return false;
int sx = screenPosition().x();
int sy = screenPosition().y(... | java | public boolean isInsideBounds(int x, int y)
{
if (!isVisible())
return false;
int sx = screenPosition().x();
int sy = screenPosition().y();
return x >= sx && x <= sx + size().width() && y >= sy && y <= sy + size().height();
} | [
"public",
"boolean",
"isInsideBounds",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"!",
"isVisible",
"(",
")",
")",
"return",
"false",
";",
"int",
"sx",
"=",
"screenPosition",
"(",
")",
".",
"x",
"(",
")",
";",
"int",
"sy",
"=",
"scree... | Checks if supplied coordinates are inside this {@link UIComponent} bounds.
@param x the x
@param y the y
@return true, if coordinates are inside bounds | [
"Checks",
"if",
"supplied",
"coordinates",
"are",
"inside",
"this",
"{",
"@link",
"UIComponent",
"}",
"bounds",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/component/UIComponent.java#L685-L692 |
brutusin/commons | src/main/java/org/brutusin/commons/utils/Miscellaneous.java | Miscellaneous.pipeAsynchronously | public static Thread pipeAsynchronously(final InputStream is, final ErrorHandler errorHandler, final boolean closeResources, final OutputStream... os) {
"""
Asynchronous writing from is to os
@param is
@param errorHandler
@param closeResources
@param os
@return
"""
Thread t = new Thread() {
... | java | public static Thread pipeAsynchronously(final InputStream is, final ErrorHandler errorHandler, final boolean closeResources, final OutputStream... os) {
Thread t = new Thread() {
@Override
public void run() {
try {
pipeSynchronously(is, closeResou... | [
"public",
"static",
"Thread",
"pipeAsynchronously",
"(",
"final",
"InputStream",
"is",
",",
"final",
"ErrorHandler",
"errorHandler",
",",
"final",
"boolean",
"closeResources",
",",
"final",
"OutputStream",
"...",
"os",
")",
"{",
"Thread",
"t",
"=",
"new",
"Threa... | Asynchronous writing from is to os
@param is
@param errorHandler
@param closeResources
@param os
@return | [
"Asynchronous",
"writing",
"from",
"is",
"to",
"os"
] | train | https://github.com/brutusin/commons/blob/70685df2b2456d0bf1e6a4754d72c87bba4949df/src/main/java/org/brutusin/commons/utils/Miscellaneous.java#L451-L467 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/annotation/AuditAnnotationAttributes.java | AuditAnnotationAttributes.getAction | public String getAction(final Class<?> clazz, final Method method) {
"""
Gets the action.
@param clazz
the clazz
@param method
the method
@return the action
"""
final Annotation[] annotations = clazz.getAnnotations();
return this.getAction(annotations, method);
} | java | public String getAction(final Class<?> clazz, final Method method) {
final Annotation[] annotations = clazz.getAnnotations();
return this.getAction(annotations, method);
} | [
"public",
"String",
"getAction",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"Method",
"method",
")",
"{",
"final",
"Annotation",
"[",
"]",
"annotations",
"=",
"clazz",
".",
"getAnnotations",
"(",
")",
";",
"return",
"this",
".",
"getAct... | Gets the action.
@param clazz
the clazz
@param method
the method
@return the action | [
"Gets",
"the",
"action",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/annotation/AuditAnnotationAttributes.java#L119-L122 |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withEndDate | public Interval withEndDate(LocalDate date) {
"""
Returns a new interval based on this interval but with a different end
date.
@param date the new end date
@return a new interval
"""
requireNonNull(date);
return new Interval(startDate, startTime, date, endTime, zoneId);
} | java | public Interval withEndDate(LocalDate date) {
requireNonNull(date);
return new Interval(startDate, startTime, date, endTime, zoneId);
} | [
"public",
"Interval",
"withEndDate",
"(",
"LocalDate",
"date",
")",
"{",
"requireNonNull",
"(",
"date",
")",
";",
"return",
"new",
"Interval",
"(",
"startDate",
",",
"startTime",
",",
"date",
",",
"endTime",
",",
"zoneId",
")",
";",
"}"
] | Returns a new interval based on this interval but with a different end
date.
@param date the new end date
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"end",
"date",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L331-L334 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java | Node.addItemDeleteListener | public void addItemDeleteListener(ItemDeleteListener listener) {
"""
Register an listener for item delete events. This listener
gets called whenever an item is deleted from the node.
@param listener The handler for the event
"""
StanzaListener delListener = new ItemDeleteTranslator(listener);
... | java | public void addItemDeleteListener(ItemDeleteListener listener) {
StanzaListener delListener = new ItemDeleteTranslator(listener);
itemDeleteToListenerMap.put(listener, delListener);
EventContentFilter deleteItem = new EventContentFilter(EventElementType.items.toString(), "retract");
Even... | [
"public",
"void",
"addItemDeleteListener",
"(",
"ItemDeleteListener",
"listener",
")",
"{",
"StanzaListener",
"delListener",
"=",
"new",
"ItemDeleteTranslator",
"(",
"listener",
")",
";",
"itemDeleteToListenerMap",
".",
"put",
"(",
"listener",
",",
"delListener",
")",... | Register an listener for item delete events. This listener
gets called whenever an item is deleted from the node.
@param listener The handler for the event | [
"Register",
"an",
"listener",
"for",
"item",
"delete",
"events",
".",
"This",
"listener",
"gets",
"called",
"whenever",
"an",
"item",
"is",
"deleted",
"from",
"the",
"node",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java#L546-L554 |
TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/HandshakeReader.java | HandshakeReader.validateConnection | private void validateConnection(StatusLine statusLine, Map<String, List<String>> headers) throws WebSocketException {
"""
Validate the value of {@code Connection} header.
<blockquote>
<p>From RFC 6455, p19.</p>
<p><i>
If the response lacks a {@code Connection} header field or the {@code Connection}
header f... | java | private void validateConnection(StatusLine statusLine, Map<String, List<String>> headers) throws WebSocketException
{
// Get the values of Upgrade.
List<String> values = headers.get("Connection");
if (values == null || values.size() == 0)
{
// The opening handshake respo... | [
"private",
"void",
"validateConnection",
"(",
"StatusLine",
"statusLine",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
")",
"throws",
"WebSocketException",
"{",
"// Get the values of Upgrade.",
"List",
"<",
"String",
">",
"values",
... | Validate the value of {@code Connection} header.
<blockquote>
<p>From RFC 6455, p19.</p>
<p><i>
If the response lacks a {@code Connection} header field or the {@code Connection}
header field doesn't contain a token that is an ASCII case-insensitive match
for the value "Upgrade", the client MUST Fail the WebSocket Conn... | [
"Validate",
"the",
"value",
"of",
"{",
"@code",
"Connection",
"}",
"header",
"."
] | train | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/HandshakeReader.java#L349-L383 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.psSetString | public void psSetString(PreparedStatement pstmtImpl, int i, String x) throws SQLException {
"""
Allow for special handling of Oracle prepared statement setString
This method just does the normal setString call, Oracle helper overrides it
"""
pstmtImpl.setString(i, x);
} | java | public void psSetString(PreparedStatement pstmtImpl, int i, String x) throws SQLException {
pstmtImpl.setString(i, x);
} | [
"public",
"void",
"psSetString",
"(",
"PreparedStatement",
"pstmtImpl",
",",
"int",
"i",
",",
"String",
"x",
")",
"throws",
"SQLException",
"{",
"pstmtImpl",
".",
"setString",
"(",
"i",
",",
"x",
")",
";",
"}"
] | Allow for special handling of Oracle prepared statement setString
This method just does the normal setString call, Oracle helper overrides it | [
"Allow",
"for",
"special",
"handling",
"of",
"Oracle",
"prepared",
"statement",
"setString",
"This",
"method",
"just",
"does",
"the",
"normal",
"setString",
"call",
"Oracle",
"helper",
"overrides",
"it"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L623-L625 |
sebastiangraf/treetank | interfacemodules/jax-rx/src/main/java/org/jaxrx/core/SchemaChecker.java | SchemaChecker.check | public Document check(final InputStream input) {
"""
This method parses an XML input with a W3C DOM implementation and
validates it then with the available XML schema.
@param input
The input stream containing the XML query.
@return The parsed XML source as {@link Document}.
"""
Document document;... | java | public Document check(final InputStream input) {
Document document;
try {
final DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
document = docBuilder.parse(input);
final InputStream is = getClass().getResourceAsStream(xslSchema... | [
"public",
"Document",
"check",
"(",
"final",
"InputStream",
"input",
")",
"{",
"Document",
"document",
";",
"try",
"{",
"final",
"DocumentBuilder",
"docBuilder",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
".",
"newDocumentBuilder",
"(",
")",
";... | This method parses an XML input with a W3C DOM implementation and
validates it then with the available XML schema.
@param input
The input stream containing the XML query.
@return The parsed XML source as {@link Document}. | [
"This",
"method",
"parses",
"an",
"XML",
"input",
"with",
"a",
"W3C",
"DOM",
"implementation",
"and",
"validates",
"it",
"then",
"with",
"the",
"available",
"XML",
"schema",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/jaxrx/core/SchemaChecker.java#L77-L94 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java | JdbcCpoAdapter.deleteObject | @Override
public <T> long deleteObject(String name, T obj, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
"""
Removes the Object from the datasource. The assumption is that the object exists in the datasource. This method
store... | java | @Override
public <T> long deleteObject(String name, T obj, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
return processUpdateGroup(obj, JdbcCpoAdapter.DELETE_GROUP, name, wheres, orderBy, nativeExpressions);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"long",
"deleteObject",
"(",
"String",
"name",
",",
"T",
"obj",
",",
"Collection",
"<",
"CpoWhere",
">",
"wheres",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy",
",",
"Collection",
"<",
"CpoNativeFunction",
... | Removes the Object from the datasource. The assumption is that the object exists in the datasource. This method
stores the object in the datasource
<p/>
<pre>Example:
<code>
<p/>
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
<p/>
try {
cpo = new JdbcCpoAdapter(new JdbcDataSourceInfo(driver, url, ... | [
"Removes",
"the",
"Object",
"from",
"the",
"datasource",
".",
"The",
"assumption",
"is",
"that",
"the",
"object",
"exists",
"in",
"the",
"datasource",
".",
"This",
"method",
"stores",
"the",
"object",
"in",
"the",
"datasource",
"<p",
"/",
">",
"<pre",
">",... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java#L583-L586 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java | CQLTransaction.addRowDelete | private BoundStatement addRowDelete(String tableName, String key) {
"""
Create and return a BoundStatement that deletes the given row.
"""
PreparedStatement prepState = m_dbservice.getPreparedUpdate(Update.DELETE_ROW, tableName);
BoundStatement boundState = prepState.bind();
boundState.... | java | private BoundStatement addRowDelete(String tableName, String key) {
PreparedStatement prepState = m_dbservice.getPreparedUpdate(Update.DELETE_ROW, tableName);
BoundStatement boundState = prepState.bind();
boundState.setString(0, key);
return boundState;
} | [
"private",
"BoundStatement",
"addRowDelete",
"(",
"String",
"tableName",
",",
"String",
"key",
")",
"{",
"PreparedStatement",
"prepState",
"=",
"m_dbservice",
".",
"getPreparedUpdate",
"(",
"Update",
".",
"DELETE_ROW",
",",
"tableName",
")",
";",
"BoundStatement",
... | Create and return a BoundStatement that deletes the given row. | [
"Create",
"and",
"return",
"a",
"BoundStatement",
"that",
"deletes",
"the",
"given",
"row",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java#L139-L144 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/bolt/dialect/impl/BoltNeo4jSequenceGenerator.java | BoltNeo4jSequenceGenerator.addUniqueConstraintForTableBasedSequence | private void addUniqueConstraintForTableBasedSequence(List<Statement> statements, IdSourceKeyMetadata generatorKeyMetadata) {
"""
Adds a unique constraint to make sure that each node of the same "sequence table" is unique.
"""
Statement statement = createUniqueConstraintStatement( generatorKeyMetadata.getKey... | java | private void addUniqueConstraintForTableBasedSequence(List<Statement> statements, IdSourceKeyMetadata generatorKeyMetadata) {
Statement statement = createUniqueConstraintStatement( generatorKeyMetadata.getKeyColumnName(), generatorKeyMetadata.getName() );
statements.add( statement );
} | [
"private",
"void",
"addUniqueConstraintForTableBasedSequence",
"(",
"List",
"<",
"Statement",
">",
"statements",
",",
"IdSourceKeyMetadata",
"generatorKeyMetadata",
")",
"{",
"Statement",
"statement",
"=",
"createUniqueConstraintStatement",
"(",
"generatorKeyMetadata",
".",
... | Adds a unique constraint to make sure that each node of the same "sequence table" is unique. | [
"Adds",
"a",
"unique",
"constraint",
"to",
"make",
"sure",
"that",
"each",
"node",
"of",
"the",
"same",
"sequence",
"table",
"is",
"unique",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/remote/bolt/dialect/impl/BoltNeo4jSequenceGenerator.java#L92-L95 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Searcher.java | Searcher.searchFor | public <T extends View> boolean searchFor(Set<T> uniqueViews, Class<T> viewClass, final int index) {
"""
Searches for a view class.
@param uniqueViews the set of unique views
@param viewClass the view class to search for
@param index the index of the view class
@return true if view class if found a given num... | java | public <T extends View> boolean searchFor(Set<T> uniqueViews, Class<T> viewClass, final int index) {
ArrayList<T> allViews = RobotiumUtils.removeInvisibleViews(viewFetcher.getCurrentViews(viewClass, true));
int uniqueViewsFound = (getNumberOfUniqueViews(uniqueViews, allViews));
if(uniqueViewsFound > 0 && index ... | [
"public",
"<",
"T",
"extends",
"View",
">",
"boolean",
"searchFor",
"(",
"Set",
"<",
"T",
">",
"uniqueViews",
",",
"Class",
"<",
"T",
">",
"viewClass",
",",
"final",
"int",
"index",
")",
"{",
"ArrayList",
"<",
"T",
">",
"allViews",
"=",
"RobotiumUtils"... | Searches for a view class.
@param uniqueViews the set of unique views
@param viewClass the view class to search for
@param index the index of the view class
@return true if view class if found a given number of times | [
"Searches",
"for",
"a",
"view",
"class",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Searcher.java#L141-L154 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.invokeOptionalSetter | public static void invokeOptionalSetter(Object object, String name, String value) throws Exception {
"""
Variant for {@link #invokeSetter(Object, String, String)} but no exception if setter not found.
@param object object instance,
@param name setter name,
@param value value to set.
@throws Exception if invo... | java | public static void invokeOptionalSetter(Object object, String name, String value) throws Exception
{
String setterName = Strings.getMethodAccessor("set", name);
Class<?> clazz = object.getClass();
Method method = null;
try {
method = findMethod(clazz, setterName);
}
catch(NoSuc... | [
"public",
"static",
"void",
"invokeOptionalSetter",
"(",
"Object",
"object",
",",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"Exception",
"{",
"String",
"setterName",
"=",
"Strings",
".",
"getMethodAccessor",
"(",
"\"set\"",
",",
"name",
")",
";"... | Variant for {@link #invokeSetter(Object, String, String)} but no exception if setter not found.
@param object object instance,
@param name setter name,
@param value value to set.
@throws Exception if invocation fail for whatever reason including method logic. | [
"Variant",
"for",
"{",
"@link",
"#invokeSetter",
"(",
"Object",
"String",
"String",
")",
"}",
"but",
"no",
"exception",
"if",
"setter",
"not",
"found",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L447-L467 |
liferay/com-liferay-commerce | commerce-payment-service/src/main/java/com/liferay/commerce/payment/service/persistence/impl/CommercePaymentMethodGroupRelPersistenceImpl.java | CommercePaymentMethodGroupRelPersistenceImpl.findByGroupId | @Override
public List<CommercePaymentMethodGroupRel> findByGroupId(long groupId) {
"""
Returns all the commerce payment method group rels where groupId = ?.
@param groupId the group ID
@return the matching commerce payment method group rels
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryU... | java | @Override
public List<CommercePaymentMethodGroupRel> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePaymentMethodGroupRel",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";... | Returns all the commerce payment method group rels where groupId = ?.
@param groupId the group ID
@return the matching commerce payment method group rels | [
"Returns",
"all",
"the",
"commerce",
"payment",
"method",
"group",
"rels",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-payment-service/src/main/java/com/liferay/commerce/payment/service/persistence/impl/CommercePaymentMethodGroupRelPersistenceImpl.java#L127-L130 |
foundation-runtime/service-directory | 1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryRegistrationService.java | DirectoryRegistrationService.unregisterService | public void unregisterService(String serviceName, String providerId) {
"""
Unregister a ProvidedServiceInstance
The ProvidedServiceInstance is uniquely identified by serviceName and providerId
@param serviceName
the serviceName of ProvidedServiceInstance.
@param providerId
the provierId of ProvidedServiceIn... | java | public void unregisterService(String serviceName, String providerId) {
getServiceDirectoryClient().unregisterInstance(serviceName, providerId, disableOwnerError);
} | [
"public",
"void",
"unregisterService",
"(",
"String",
"serviceName",
",",
"String",
"providerId",
")",
"{",
"getServiceDirectoryClient",
"(",
")",
".",
"unregisterInstance",
"(",
"serviceName",
",",
"providerId",
",",
"disableOwnerError",
")",
";",
"}"
] | Unregister a ProvidedServiceInstance
The ProvidedServiceInstance is uniquely identified by serviceName and providerId
@param serviceName
the serviceName of ProvidedServiceInstance.
@param providerId
the provierId of ProvidedServiceInstance. | [
"Unregister",
"a",
"ProvidedServiceInstance",
"The",
"ProvidedServiceInstance",
"is",
"uniquely",
"identified",
"by",
"serviceName",
"and",
"providerId"
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryRegistrationService.java#L165-L167 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasMethodAdapter.java | AbstractRasMethodAdapter.visitLineNumber | @Override
public void visitLineNumber(int line, Label start) {
"""
Vist a line number block and its associated label. We will use this
to keep track of (roughly) what line we're on.
"""
// If we haven't given a line number to the method entry, do so now.
if (!methodEntryHasLineNumber) {
... | java | @Override
public void visitLineNumber(int line, Label start) {
// If we haven't given a line number to the method entry, do so now.
if (!methodEntryHasLineNumber) {
methodEntryHasLineNumber = true;
start = methodEntryLabel;
}
lineNumber = line;
super.... | [
"@",
"Override",
"public",
"void",
"visitLineNumber",
"(",
"int",
"line",
",",
"Label",
"start",
")",
"{",
"// If we haven't given a line number to the method entry, do so now.",
"if",
"(",
"!",
"methodEntryHasLineNumber",
")",
"{",
"methodEntryHasLineNumber",
"=",
"true"... | Vist a line number block and its associated label. We will use this
to keep track of (roughly) what line we're on. | [
"Vist",
"a",
"line",
"number",
"block",
"and",
"its",
"associated",
"label",
".",
"We",
"will",
"use",
"this",
"to",
"keep",
"track",
"of",
"(",
"roughly",
")",
"what",
"line",
"we",
"re",
"on",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasMethodAdapter.java#L1074-L1084 |
canoo/open-dolphin | subprojects/shared/src/main/groovy/org/opendolphin/core/ModelStoreConfig.java | ModelStoreConfig.ensurePowerOfTwo | private void ensurePowerOfTwo(String parameter, int number) {
"""
all the capacities will be used to initialize HashMaps so they should be powers of two
"""
if (Integer.bitCount(number) > 1) {
if (log.isLoggable(Level.WARNING)) {
log.warning("Parameter '" + parameter + "' sh... | java | private void ensurePowerOfTwo(String parameter, int number) {
if (Integer.bitCount(number) > 1) {
if (log.isLoggable(Level.WARNING)) {
log.warning("Parameter '" + parameter + "' should be power of two but was " + number);
}
}
} | [
"private",
"void",
"ensurePowerOfTwo",
"(",
"String",
"parameter",
",",
"int",
"number",
")",
"{",
"if",
"(",
"Integer",
".",
"bitCount",
"(",
"number",
")",
">",
"1",
")",
"{",
"if",
"(",
"log",
".",
"isLoggable",
"(",
"Level",
".",
"WARNING",
")",
... | all the capacities will be used to initialize HashMaps so they should be powers of two | [
"all",
"the",
"capacities",
"will",
"be",
"used",
"to",
"initialize",
"HashMaps",
"so",
"they",
"should",
"be",
"powers",
"of",
"two"
] | train | https://github.com/canoo/open-dolphin/blob/50166defc3ef2de473d7a7246c32dc04304d80ef/subprojects/shared/src/main/groovy/org/opendolphin/core/ModelStoreConfig.java#L82-L88 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSHome.java | EJSHome.postCreate | public EJBObject postCreate(BeanO beanO)
throws CreateException,
RemoteException {
"""
Complete the bean creation process. <p>
@param beanO the <code>BeanO</code> being created <p>
@exception CreateException thrown if create-specific
error occurs <p>
@exception Rem... | java | public EJBObject postCreate(BeanO beanO)
throws CreateException,
RemoteException
{
homeEnabled();
return postCreate(beanO, beanO.getId(), false); // d142250
} | [
"public",
"EJBObject",
"postCreate",
"(",
"BeanO",
"beanO",
")",
"throws",
"CreateException",
",",
"RemoteException",
"{",
"homeEnabled",
"(",
")",
";",
"return",
"postCreate",
"(",
"beanO",
",",
"beanO",
".",
"getId",
"(",
")",
",",
"false",
")",
";",
"//... | Complete the bean creation process. <p>
@param beanO the <code>BeanO</code> being created <p>
@exception CreateException thrown if create-specific
error occurs <p>
@exception RemoteException thrown if a container
error occurs <p> | [
"Complete",
"the",
"bean",
"creation",
"process",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSHome.java#L2506-L2512 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ha/hanode_binding.java | hanode_binding.get | public static hanode_binding get(nitro_service service, Long id) throws Exception {
"""
Use this API to fetch hanode_binding resource of given name .
"""
hanode_binding obj = new hanode_binding();
obj.set_id(id);
hanode_binding response = (hanode_binding) obj.get_resource(service);
return response;
} | java | public static hanode_binding get(nitro_service service, Long id) throws Exception{
hanode_binding obj = new hanode_binding();
obj.set_id(id);
hanode_binding response = (hanode_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"hanode_binding",
"get",
"(",
"nitro_service",
"service",
",",
"Long",
"id",
")",
"throws",
"Exception",
"{",
"hanode_binding",
"obj",
"=",
"new",
"hanode_binding",
"(",
")",
";",
"obj",
".",
"set_id",
"(",
"id",
")",
";",
"hanode_binding... | Use this API to fetch hanode_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"hanode_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ha/hanode_binding.java#L159-L164 |
stripe/stripe-android | stripe/src/main/java/com/stripe/android/StripeNetworkUtils.java | StripeNetworkUtils.removeNullAndEmptyParams | @SuppressWarnings("unchecked")
public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) {
"""
Remove null values from a map. This helps with JSON conversion and validation.
@param mapToEdit a {@link Map} from which to remove the keys that have {@code null} values
"""
/... | java | @SuppressWarnings("unchecked")
public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) {
// Remove all null values; they cause validation errors
for (String key : new HashSet<>(mapToEdit.keySet())) {
if (mapToEdit.get(key) == null) {
mapToEdit.... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"removeNullAndEmptyParams",
"(",
"@",
"NonNull",
"Map",
"<",
"String",
",",
"Object",
">",
"mapToEdit",
")",
"{",
"// Remove all null values; they cause validation errors",
"for",
"(",
"St... | Remove null values from a map. This helps with JSON conversion and validation.
@param mapToEdit a {@link Map} from which to remove the keys that have {@code null} values | [
"Remove",
"null",
"values",
"from",
"a",
"map",
".",
"This",
"helps",
"with",
"JSON",
"conversion",
"and",
"validation",
"."
] | train | https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/StripeNetworkUtils.java#L129-L149 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java | GZIPArchiveWriter.getEntry | public GZIPArchive.WriteEntry getEntry(final String name, final String comment, final Date creationDate) {
"""
Returns an object that can be used to write an entry in the GZIP archive.
In order to write the actual entry, one must write the entry content on the {@link GZIPArchive.WriteEntry#deflater} and,
at th... | java | public GZIPArchive.WriteEntry getEntry(final String name, final String comment, final Date creationDate) {
crc.reset();
deflater.reset();
deflaterStream.reset();
final GZIPArchive.WriteEntry entry = new GZIPArchive.WriteEntry();
entry.setName(name);
entry.setComment(comment);
entry.deflater = new Filter... | [
"public",
"GZIPArchive",
".",
"WriteEntry",
"getEntry",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"comment",
",",
"final",
"Date",
"creationDate",
")",
"{",
"crc",
".",
"reset",
"(",
")",
";",
"deflater",
".",
"reset",
"(",
")",
";",
"defla... | Returns an object that can be used to write an entry in the GZIP archive.
In order to write the actual entry, one must write the entry content on the {@link GZIPArchive.WriteEntry#deflater} and,
at the end, call its <code>close()</code> method (to actually write the compressed content).
@param name the name of the en... | [
"Returns",
"an",
"object",
"that",
"can",
"be",
"used",
"to",
"write",
"an",
"entry",
"in",
"the",
"GZIP",
"archive",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/io/gzarc/GZIPArchiveWriter.java#L127-L171 |
spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/expression/OAuth2SecurityExpressionMethods.java | OAuth2SecurityExpressionMethods.throwOnError | public boolean throwOnError(boolean decision) {
"""
Check if any scope decisions have been denied in the current context and throw an exception if so. This method
automatically wraps any expressions when using {@link OAuth2MethodSecurityExpressionHandler} or
{@link OAuth2WebSecurityExpressionHandler}.
OAuth2E... | java | public boolean throwOnError(boolean decision) {
if (!decision && !missingScopes.isEmpty()) {
Throwable failure = new InsufficientScopeException("Insufficient scope for this resource", missingScopes);
throw new AccessDeniedException(failure.getMessage(), failure);
}
return decision;
} | [
"public",
"boolean",
"throwOnError",
"(",
"boolean",
"decision",
")",
"{",
"if",
"(",
"!",
"decision",
"&&",
"!",
"missingScopes",
".",
"isEmpty",
"(",
")",
")",
"{",
"Throwable",
"failure",
"=",
"new",
"InsufficientScopeException",
"(",
"\"Insufficient scope fo... | Check if any scope decisions have been denied in the current context and throw an exception if so. This method
automatically wraps any expressions when using {@link OAuth2MethodSecurityExpressionHandler} or
{@link OAuth2WebSecurityExpressionHandler}.
OAuth2Example usage:
<pre>
access = "#oauth2.hasScope('read') ... | [
"Check",
"if",
"any",
"scope",
"decisions",
"have",
"been",
"denied",
"in",
"the",
"current",
"context",
"and",
"throw",
"an",
"exception",
"if",
"so",
".",
"This",
"method",
"automatically",
"wraps",
"any",
"expressions",
"when",
"using",
"{",
"@link",
"OAu... | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/expression/OAuth2SecurityExpressionMethods.java#L69-L75 |
getsentry/sentry-java | sentry/src/main/java/io/sentry/event/BreadcrumbBuilder.java | BreadcrumbBuilder.withData | public BreadcrumbBuilder withData(String name, String value) {
"""
Adds to the related data for the {@link breadcrumb}.
@param name Name of the data
@param value Value of the data
@return current BreadcrumbBuilder
"""
if (this.data == null) {
this.data = new HashMap<>();
}
... | java | public BreadcrumbBuilder withData(String name, String value) {
if (this.data == null) {
this.data = new HashMap<>();
}
this.data.put(name, value);
return this;
} | [
"public",
"BreadcrumbBuilder",
"withData",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"this",
".",
"data",
"==",
"null",
")",
"{",
"this",
".",
"data",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"}",
"this",
".",
"data",
"... | Adds to the related data for the {@link breadcrumb}.
@param name Name of the data
@param value Value of the data
@return current BreadcrumbBuilder | [
"Adds",
"to",
"the",
"related",
"data",
"for",
"the",
"{",
"@link",
"breadcrumb",
"}",
"."
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/event/BreadcrumbBuilder.java#L94-L101 |
AKSW/RDFUnit | rdfunit-core/src/main/java/org/aksw/rdfunit/prefix/TrustingUrlConnection.java | TrustingUrlConnection.executeHeadRequest | static HttpResponse executeHeadRequest(URI uri, SerializationFormat format) throws IOException {
"""
Will execute a HEAD only request, following redirects, trying to locate an rdf document.
@param uri - the initial uri
@param format - the expected mime type
@return - the final http response
@throws IOException... | java | static HttpResponse executeHeadRequest(URI uri, SerializationFormat format) throws IOException {
HttpHead headMethod = new HttpHead(uri);
MyRedirectHandler redirectHandler = new MyRedirectHandler(uri);
String acceptHeader = format.getMimeType() != null && ! format.getMimeType().trim().isEmpty(... | [
"static",
"HttpResponse",
"executeHeadRequest",
"(",
"URI",
"uri",
",",
"SerializationFormat",
"format",
")",
"throws",
"IOException",
"{",
"HttpHead",
"headMethod",
"=",
"new",
"HttpHead",
"(",
"uri",
")",
";",
"MyRedirectHandler",
"redirectHandler",
"=",
"new",
... | Will execute a HEAD only request, following redirects, trying to locate an rdf document.
@param uri - the initial uri
@param format - the expected mime type
@return - the final http response
@throws IOException | [
"Will",
"execute",
"a",
"HEAD",
"only",
"request",
"following",
"redirects",
"trying",
"to",
"locate",
"an",
"rdf",
"document",
"."
] | train | https://github.com/AKSW/RDFUnit/blob/083f18ebda4ad790b1fbb4cfe1c9dd1762d51384/rdfunit-core/src/main/java/org/aksw/rdfunit/prefix/TrustingUrlConnection.java#L101-L123 |
lviggiano/owner | owner/src/main/java/org/aeonbits/owner/ConfigCache.java | ConfigCache.getOrCreate | public static <T extends Config> T getOrCreate(Class<? extends T> clazz, Map<?, ?>... imports) {
"""
Gets from the cache or create, an instance of the given class using the given imports.
The factory used to create new instances is the static {@link ConfigFactory#INSTANCE}.
@param clazz the interface exten... | java | public static <T extends Config> T getOrCreate(Class<? extends T> clazz, Map<?, ?>... imports) {
return getOrCreate(ConfigFactory.INSTANCE, clazz, clazz, imports);
} | [
"public",
"static",
"<",
"T",
"extends",
"Config",
">",
"T",
"getOrCreate",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"clazz",
",",
"Map",
"<",
"?",
",",
"?",
">",
"...",
"imports",
")",
"{",
"return",
"getOrCreate",
"(",
"ConfigFactory",
".",
"IN... | Gets from the cache or create, an instance of the given class using the given imports.
The factory used to create new instances is the static {@link ConfigFactory#INSTANCE}.
@param clazz the interface extending from {@link Config} that you want to instantiate.
@param imports additional variables to be used to re... | [
"Gets",
"from",
"the",
"cache",
"or",
"create",
"an",
"instance",
"of",
"the",
"given",
"class",
"using",
"the",
"given",
"imports",
".",
"The",
"factory",
"used",
"to",
"create",
"new",
"instances",
"is",
"the",
"static",
"{",
"@link",
"ConfigFactory#INSTAN... | train | https://github.com/lviggiano/owner/blob/1223ecfbe3c275b3b7c5ec13e9238c9bb888754f/owner/src/main/java/org/aeonbits/owner/ConfigCache.java#L41-L43 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionPoliciesInner.java | BackupLongTermRetentionPoliciesInner.getAsync | public Observable<BackupLongTermRetentionPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Returns a database backup long term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azur... | java | public Observable<BackupLongTermRetentionPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<BackupLongTermRetentionPolicyInner>, BackupLongTermRetentionPolicyInner... | [
"public",
"Observable",
"<",
"BackupLongTermRetentionPolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverNam... | Returns a database backup long term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@throws IllegalA... | [
"Returns",
"a",
"database",
"backup",
"long",
"term",
"retention",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionPoliciesInner.java#L114-L121 |
LMAX-Exchange/disruptor | src/main/java/com/lmax/disruptor/dsl/Disruptor.java | Disruptor.publishEvent | public <A, B> void publishEvent(final EventTranslatorTwoArg<T, A, B> eventTranslator, final A arg0, final B arg1) {
"""
Publish an event to the ring buffer.
@param <A> Class of the user supplied argument.
@param <B> Class of the user supplied argument.
@param eventTranslator the translator that will load data... | java | public <A, B> void publishEvent(final EventTranslatorTwoArg<T, A, B> eventTranslator, final A arg0, final B arg1)
{
ringBuffer.publishEvent(eventTranslator, arg0, arg1);
} | [
"public",
"<",
"A",
",",
"B",
">",
"void",
"publishEvent",
"(",
"final",
"EventTranslatorTwoArg",
"<",
"T",
",",
"A",
",",
"B",
">",
"eventTranslator",
",",
"final",
"A",
"arg0",
",",
"final",
"B",
"arg1",
")",
"{",
"ringBuffer",
".",
"publishEvent",
"... | Publish an event to the ring buffer.
@param <A> Class of the user supplied argument.
@param <B> Class of the user supplied argument.
@param eventTranslator the translator that will load data into the event.
@param arg0 The first argument to load into the event
@param arg1 The second argument to l... | [
"Publish",
"an",
"event",
"to",
"the",
"ring",
"buffer",
"."
] | train | https://github.com/LMAX-Exchange/disruptor/blob/4266d00c5250190313446fdd7c8aa7a4edb5c818/src/main/java/com/lmax/disruptor/dsl/Disruptor.java#L367-L370 |
mozilla/rhino | src/org/mozilla/javascript/optimizer/Block.java | Block.lookForVariableAccess | private void lookForVariableAccess(OptFunctionNode fn, Node n) {
"""
/*
We're tracking uses and defs - in order to
build the def set and to identify the last use
nodes.
The itsNotDefSet is built reversed then flipped later.
"""
switch (n.getType()) {
case Token.TYPEOFNAME:
... | java | private void lookForVariableAccess(OptFunctionNode fn, Node n)
{
switch (n.getType()) {
case Token.TYPEOFNAME:
{
// TYPEOFNAME may be used with undefined names, which is why
// this is handled separately from GETVAR above.
int varIndex ... | [
"private",
"void",
"lookForVariableAccess",
"(",
"OptFunctionNode",
"fn",
",",
"Node",
"n",
")",
"{",
"switch",
"(",
"n",
".",
"getType",
"(",
")",
")",
"{",
"case",
"Token",
".",
"TYPEOFNAME",
":",
"{",
"// TYPEOFNAME may be used with undefined names, which is wh... | /*
We're tracking uses and defs - in order to
build the def set and to identify the last use
nodes.
The itsNotDefSet is built reversed then flipped later. | [
"/",
"*",
"We",
"re",
"tracking",
"uses",
"and",
"defs",
"-",
"in",
"order",
"to",
"build",
"the",
"def",
"set",
"and",
"to",
"identify",
"the",
"last",
"use",
"nodes",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/optimizer/Block.java#L357-L407 |
comapi/comapi-chat-sdk-android | COMAPI/chat/src/main/java/com/comapi/chat/internal/MissingEventsTracker.java | MissingEventsTracker.checkEventId | public boolean checkEventId(String conversationId, long conversationEventId, MissingEventsListener missingEventsListener) {
"""
Check conversation event id for duplicates or missing events.
@param conversationId Unique identifier of an conversation.
@param conversationEventId Unique per conversation, mono... | java | public boolean checkEventId(String conversationId, long conversationEventId, MissingEventsListener missingEventsListener) {
if (!idsPerConversation.containsKey(conversationId)) {
TreeSet<Long> ids = new TreeSet<>();
boolean added = ids.add(conversationEventId);
idsPerConvers... | [
"public",
"boolean",
"checkEventId",
"(",
"String",
"conversationId",
",",
"long",
"conversationEventId",
",",
"MissingEventsListener",
"missingEventsListener",
")",
"{",
"if",
"(",
"!",
"idsPerConversation",
".",
"containsKey",
"(",
"conversationId",
")",
")",
"{",
... | Check conversation event id for duplicates or missing events.
@param conversationId Unique identifier of an conversation.
@param conversationEventId Unique per conversation, monotonically increasing conversation event id.
@return True if event with a given id already processed. | [
"Check",
"conversation",
"event",
"id",
"for",
"duplicates",
"or",
"missing",
"events",
"."
] | train | https://github.com/comapi/comapi-chat-sdk-android/blob/388f37bfacb7793ce30c92ab70e5f32848bbe460/COMAPI/chat/src/main/java/com/comapi/chat/internal/MissingEventsTracker.java#L52-L76 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/FileServersInner.java | FileServersInner.listByWorkspaceAsync | public Observable<Page<FileServerInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName) {
"""
Gets a list of File Servers associated with the specified workspace.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name o... | java | public Observable<Page<FileServerInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName) {
return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName)
.map(new Func1<ServiceResponse<Page<FileServerInner>>, Page<FileServerInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"FileServerInner",
">",
">",
"listByWorkspaceAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"workspaceName",
")",
"{",
"return",
"listByWorkspaceWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Gets a list of File Servers associated with the specified workspace.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The n... | [
"Gets",
"a",
"list",
"of",
"File",
"Servers",
"associated",
"with",
"the",
"specified",
"workspace",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/FileServersInner.java#L1066-L1074 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/PagedWidget.java | PagedWidget.setModel | public void setModel (DataModel<T> model, int page) {
"""
Configures this panel with a {@link DataModel} and kicks the data
retrieval off by requesting the specified page to be displayed.
"""
_model = model;
displayPage(page, true);
} | java | public void setModel (DataModel<T> model, int page)
{
_model = model;
displayPage(page, true);
} | [
"public",
"void",
"setModel",
"(",
"DataModel",
"<",
"T",
">",
"model",
",",
"int",
"page",
")",
"{",
"_model",
"=",
"model",
";",
"displayPage",
"(",
"page",
",",
"true",
")",
";",
"}"
] | Configures this panel with a {@link DataModel} and kicks the data
retrieval off by requesting the specified page to be displayed. | [
"Configures",
"this",
"panel",
"with",
"a",
"{"
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/PagedWidget.java#L129-L133 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java | DataServiceVisitorJsBuilder.writeArguments | void writeArguments(Iterator<String> names, Writer writer) throws IOException {
"""
Write argument whit comma if necessary
@param names
@param writer
@throws IOException
"""
while(names.hasNext()) {
String name = names.next();
writer.append(name); // argname
if(names.hasNext()) {
writer.... | java | void writeArguments(Iterator<String> names, Writer writer) throws IOException {
while(names.hasNext()) {
String name = names.next();
writer.append(name); // argname
if(names.hasNext()) {
writer.append(COMMA).append(SPACEOPTIONAL); //,
}
}
} | [
"void",
"writeArguments",
"(",
"Iterator",
"<",
"String",
">",
"names",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"while",
"(",
"names",
".",
"hasNext",
"(",
")",
")",
"{",
"String",
"name",
"=",
"names",
".",
"next",
"(",
")",
";",
... | Write argument whit comma if necessary
@param names
@param writer
@throws IOException | [
"Write",
"argument",
"whit",
"comma",
"if",
"necessary"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java#L92-L100 |
google/closure-compiler | src/com/google/javascript/jscomp/CrossChunkMethodMotion.java | CrossChunkMethodMotion.createUnstubCall | private Node createUnstubCall(Node functionNode, int stubId) {
"""
Returns a new Node to be used as the stub definition for a method.
@param functionNode actual function definition to be attached. Must be detached now.
@param stubId ID to use for stubbing and unstubbing
@return a Node that looks like <code>JS... | java | private Node createUnstubCall(Node functionNode, int stubId) {
return astFactory
.createCall(
// We can't look up the type of the stub creating method, because we add its
// definition after type checking.
astFactory.createNameWithUnknownType(UNSTUB_METHOD_NAME),
... | [
"private",
"Node",
"createUnstubCall",
"(",
"Node",
"functionNode",
",",
"int",
"stubId",
")",
"{",
"return",
"astFactory",
".",
"createCall",
"(",
"// We can't look up the type of the stub creating method, because we add its",
"// definition after type checking.",
"astFactory",
... | Returns a new Node to be used as the stub definition for a method.
@param functionNode actual function definition to be attached. Must be detached now.
@param stubId ID to use for stubbing and unstubbing
@return a Node that looks like <code>JSCompiler_unstubMethod(0, function() {})</code> | [
"Returns",
"a",
"new",
"Node",
"to",
"be",
"used",
"as",
"the",
"stub",
"definition",
"for",
"a",
"method",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CrossChunkMethodMotion.java#L399-L408 |
graknlabs/grakn | server/src/server/kb/concept/SchemaConceptImpl.java | SchemaConceptImpl.changingSuperAllowed | boolean changingSuperAllowed(T oldSuperType, T newSuperType) {
"""
Checks if changing the super is allowed. This passed if:
The <code>newSuperType</code> is different from the old.
@param oldSuperType the old super
@param newSuperType the new super
@return true if we can set the new super
"""
che... | java | boolean changingSuperAllowed(T oldSuperType, T newSuperType) {
checkSchemaMutationAllowed();
return oldSuperType == null || !oldSuperType.equals(newSuperType);
} | [
"boolean",
"changingSuperAllowed",
"(",
"T",
"oldSuperType",
",",
"T",
"newSuperType",
")",
"{",
"checkSchemaMutationAllowed",
"(",
")",
";",
"return",
"oldSuperType",
"==",
"null",
"||",
"!",
"oldSuperType",
".",
"equals",
"(",
"newSuperType",
")",
";",
"}"
] | Checks if changing the super is allowed. This passed if:
The <code>newSuperType</code> is different from the old.
@param oldSuperType the old super
@param newSuperType the new super
@return true if we can set the new super | [
"Checks",
"if",
"changing",
"the",
"super",
"is",
"allowed",
".",
"This",
"passed",
"if",
":",
"The",
"<code",
">",
"newSuperType<",
"/",
"code",
">",
"is",
"different",
"from",
"the",
"old",
"."
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/kb/concept/SchemaConceptImpl.java#L244-L247 |
cdk/cdk | descriptor/fingerprint/src/main/java/org/openscience/cdk/similarity/Tanimoto.java | Tanimoto.calculate | public static double calculate(IBitFingerprint fingerprint1, IBitFingerprint fingerprint2) {
"""
Evaluates Tanimoto coefficient for two <code>IBitFingerprint</code>.
<p>
@param fingerprint1 fingerprint for the first molecule
@param fingerprint2 fingerprint for the second molecule
@return The Tanimoto coefficie... | java | public static double calculate(IBitFingerprint fingerprint1, IBitFingerprint fingerprint2) {
if (fingerprint1.size() != fingerprint2.size()) {
throw new IllegalArgumentException("Fingerprints must have the same size");
}
int cardinality1 = fingerprint1.cardinality();
int card... | [
"public",
"static",
"double",
"calculate",
"(",
"IBitFingerprint",
"fingerprint1",
",",
"IBitFingerprint",
"fingerprint2",
")",
"{",
"if",
"(",
"fingerprint1",
".",
"size",
"(",
")",
"!=",
"fingerprint2",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"Ill... | Evaluates Tanimoto coefficient for two <code>IBitFingerprint</code>.
<p>
@param fingerprint1 fingerprint for the first molecule
@param fingerprint2 fingerprint for the second molecule
@return The Tanimoto coefficient
@throws IllegalArgumentException if bitsets are not of the same length | [
"Evaluates",
"Tanimoto",
"coefficient",
"for",
"two",
"<code",
">",
"IBitFingerprint<",
"/",
"code",
">",
".",
"<p",
">"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/fingerprint/src/main/java/org/openscience/cdk/similarity/Tanimoto.java#L98-L112 |
JOML-CI/JOML | src/org/joml/Quaterniond.java | Quaterniond.rotationTo | public Quaterniond rotationTo(Vector3dc fromDir, Vector3dc toDir) {
"""
Set <code>this</code> quaternion to a rotation that rotates the <code>fromDir</code> vector to point along <code>toDir</code>.
<p>
Because there can be multiple possible rotations, this method chooses the one with the shortest arc.
@see #... | java | public Quaterniond rotationTo(Vector3dc fromDir, Vector3dc toDir) {
return rotationTo(fromDir.x(), fromDir.y(), fromDir.z(), toDir.x(), toDir.y(), toDir.z());
} | [
"public",
"Quaterniond",
"rotationTo",
"(",
"Vector3dc",
"fromDir",
",",
"Vector3dc",
"toDir",
")",
"{",
"return",
"rotationTo",
"(",
"fromDir",
".",
"x",
"(",
")",
",",
"fromDir",
".",
"y",
"(",
")",
",",
"fromDir",
".",
"z",
"(",
")",
",",
"toDir",
... | Set <code>this</code> quaternion to a rotation that rotates the <code>fromDir</code> vector to point along <code>toDir</code>.
<p>
Because there can be multiple possible rotations, this method chooses the one with the shortest arc.
@see #rotationTo(double, double, double, double, double, double)
@param fromDir
the st... | [
"Set",
"<code",
">",
"this<",
"/",
"code",
">",
"quaternion",
"to",
"a",
"rotation",
"that",
"rotates",
"the",
"<code",
">",
"fromDir<",
"/",
"code",
">",
"vector",
"to",
"point",
"along",
"<code",
">",
"toDir<",
"/",
"code",
">",
".",
"<p",
">",
"Be... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaterniond.java#L1943-L1945 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/Utils.java | Utils.insertPopsForAllParameters | public static int insertPopsForAllParameters(MethodVisitor mv, String desc) {
"""
Looks at the supplied descriptor and inserts enough pops to remove all parameters. Should be used when about to
avoid a method call.
@param mv the method visitor to append instructions to
@param desc the method descriptor for th... | java | public static int insertPopsForAllParameters(MethodVisitor mv, String desc) {
String descSequence = Utils.getParamSequence(desc);
if (descSequence == null) {
return 0; // nothing to do, there are no parameters
}
int count = descSequence.length();
for (int dpos = count - 1; dpos >= 0; dpos--) {
char ch =... | [
"public",
"static",
"int",
"insertPopsForAllParameters",
"(",
"MethodVisitor",
"mv",
",",
"String",
"desc",
")",
"{",
"String",
"descSequence",
"=",
"Utils",
".",
"getParamSequence",
"(",
"desc",
")",
";",
"if",
"(",
"descSequence",
"==",
"null",
")",
"{",
"... | Looks at the supplied descriptor and inserts enough pops to remove all parameters. Should be used when about to
avoid a method call.
@param mv the method visitor to append instructions to
@param desc the method descriptor for the parameter sequence (e.g. (Ljava/lang/String;IZZ)V)
@return number of parameters popped | [
"Looks",
"at",
"the",
"supplied",
"descriptor",
"and",
"inserts",
"enough",
"pops",
"to",
"remove",
"all",
"parameters",
".",
"Should",
"be",
"used",
"when",
"about",
"to",
"avoid",
"a",
"method",
"call",
"."
] | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/Utils.java#L1760-L1787 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/api/UserResource.java | UserResource.changePassword | @POST
@Path("me/password")
@RolesAllowed( {
"""
Change my password. Both the old and new password must be provided.
@param passwordRequest old and new password
@return 204 (no content) if successful
""""ROLE_ADMIN", "ROLE_USER"})
public Response changePassword(@Context HttpServletRequest request, Pas... | java | @POST
@Path("me/password")
@RolesAllowed({"ROLE_ADMIN", "ROLE_USER"})
public Response changePassword(@Context HttpServletRequest request, PasswordRequest passwordRequest) {
checkPasswordFormat(passwordRequest.getNewPassword());
checkNotNull(passwordRequest.getOldPassword());
// Only allow changing yo... | [
"@",
"POST",
"@",
"Path",
"(",
"\"me/password\"",
")",
"@",
"RolesAllowed",
"(",
"{",
"\"ROLE_ADMIN\"",
",",
"\"ROLE_USER\"",
"}",
")",
"public",
"Response",
"changePassword",
"(",
"@",
"Context",
"HttpServletRequest",
"request",
",",
"PasswordRequest",
"passwordR... | Change my password. Both the old and new password must be provided.
@param passwordRequest old and new password
@return 204 (no content) if successful | [
"Change",
"my",
"password",
".",
"Both",
"the",
"old",
"and",
"new",
"password",
"must",
"be",
"provided",
"."
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/api/UserResource.java#L358-L370 |
Azure/azure-sdk-for-java | policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyAssignmentsInner.java | PolicyAssignmentsInner.deleteAsync | public Observable<PolicyAssignmentInner> deleteAsync(String scope, String policyAssignmentName) {
"""
Deletes a policy assignment.
@param scope The scope of the policy assignment.
@param policyAssignmentName The name of the policy assignment to delete.
@throws IllegalArgumentException thrown if parameters fai... | java | public Observable<PolicyAssignmentInner> deleteAsync(String scope, String policyAssignmentName) {
return deleteWithServiceResponseAsync(scope, policyAssignmentName).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() {
@Override
public PolicyAssignmentInner cal... | [
"public",
"Observable",
"<",
"PolicyAssignmentInner",
">",
"deleteAsync",
"(",
"String",
"scope",
",",
"String",
"policyAssignmentName",
")",
"{",
"return",
"deleteWithServiceResponseAsync",
"(",
"scope",
",",
"policyAssignmentName",
")",
".",
"map",
"(",
"new",
"Fu... | Deletes a policy assignment.
@param scope The scope of the policy assignment.
@param policyAssignmentName The name of the policy assignment to delete.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PolicyAssignmentInner object | [
"Deletes",
"a",
"policy",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyAssignmentsInner.java#L151-L158 |
Gagravarr/VorbisJava | core/src/main/java/org/gagravarr/ogg/IOUtils.java | IOUtils.byteRangeMatches | public static boolean byteRangeMatches(byte[] wanted, byte[] within, int withinOffset) {
"""
Checks to see if the wanted byte pattern is found in the
within bytes from the given offset
@param wanted Byte sequence to look for
@param within Bytes to find in
@param withinOffset Offset to check from
"""
... | java | public static boolean byteRangeMatches(byte[] wanted, byte[] within, int withinOffset) {
for (int i=0; i<wanted.length; i++) {
if (wanted[i] != within[i+withinOffset]) return false;
}
return true;
} | [
"public",
"static",
"boolean",
"byteRangeMatches",
"(",
"byte",
"[",
"]",
"wanted",
",",
"byte",
"[",
"]",
"within",
",",
"int",
"withinOffset",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"wanted",
".",
"length",
";",
"i",
"++",
")"... | Checks to see if the wanted byte pattern is found in the
within bytes from the given offset
@param wanted Byte sequence to look for
@param within Bytes to find in
@param withinOffset Offset to check from | [
"Checks",
"to",
"see",
"if",
"the",
"wanted",
"byte",
"pattern",
"is",
"found",
"in",
"the",
"within",
"bytes",
"from",
"the",
"given",
"offset"
] | train | https://github.com/Gagravarr/VorbisJava/blob/22b4d645b00386d59d17a336a2bc9d54db08df16/core/src/main/java/org/gagravarr/ogg/IOUtils.java#L383-L388 |
alkacon/opencms-core | src/org/opencms/main/CmsSessionManager.java | CmsSessionManager.sendBroadcast | public void sendBroadcast(CmsUser fromUser, String message, CmsUser toUser) {
"""
Sends a broadcast to all sessions of a given user.<p>
The user sending the message may be a real user like
<code>cms.getRequestContext().currentUser()</code> or
<code>null</code> for a system message.<p>
@param fromUser the u... | java | public void sendBroadcast(CmsUser fromUser, String message, CmsUser toUser) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(message)) {
// don't broadcast empty messages
return;
}
// create the broadcast
CmsBroadcast broadcast = new CmsBroadcast(fromUser, message);
... | [
"public",
"void",
"sendBroadcast",
"(",
"CmsUser",
"fromUser",
",",
"String",
"message",
",",
"CmsUser",
"toUser",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"message",
")",
")",
"{",
"// don't broadcast empty messages",
"return",
"... | Sends a broadcast to all sessions of a given user.<p>
The user sending the message may be a real user like
<code>cms.getRequestContext().currentUser()</code> or
<code>null</code> for a system message.<p>
@param fromUser the user sending the broadcast
@param message the message to broadcast
@param toUser the target (r... | [
"Sends",
"a",
"broadcast",
"to",
"all",
"sessions",
"of",
"a",
"given",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsSessionManager.java#L419-L437 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java | QrCodeUtil.generate | public static BufferedImage generate(String content, BarcodeFormat format, QrConfig config) {
"""
生成二维码或条形码图片<br>
只有二维码时QrConfig中的图片才有效
@param content 文本内容
@param format 格式,可选二维码、条形码等
@param config 二维码配置,包括长、宽、边距、颜色等
@return 二维码图片(黑白)
@since 4.1.14
"""
final BitMatrix bitMatrix = encode(content, for... | java | public static BufferedImage generate(String content, BarcodeFormat format, QrConfig config) {
final BitMatrix bitMatrix = encode(content, format, config);
final BufferedImage image = toImage(bitMatrix, config.foreColor, config.backColor);
final Image logoImg = config.img;
if (null != logoImg && BarcodeForma... | [
"public",
"static",
"BufferedImage",
"generate",
"(",
"String",
"content",
",",
"BarcodeFormat",
"format",
",",
"QrConfig",
"config",
")",
"{",
"final",
"BitMatrix",
"bitMatrix",
"=",
"encode",
"(",
"content",
",",
"format",
",",
"config",
")",
";",
"final",
... | 生成二维码或条形码图片<br>
只有二维码时QrConfig中的图片才有效
@param content 文本内容
@param format 格式,可选二维码、条形码等
@param config 二维码配置,包括长、宽、边距、颜色等
@return 二维码图片(黑白)
@since 4.1.14 | [
"生成二维码或条形码图片<br",
">",
"只有二维码时QrConfig中的图片才有效"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L172-L198 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_fax_serviceName_settings_sendFax_POST | public OvhTask billingAccount_fax_serviceName_settings_sendFax_POST(String billingAccount, String serviceName, Date dateSchedule, String pdfUrl, String[] recipients) throws IOException {
"""
Send a fax
REST: POST /telephony/{billingAccount}/fax/{serviceName}/settings/sendFax
@param recipients [required] List o... | java | public OvhTask billingAccount_fax_serviceName_settings_sendFax_POST(String billingAccount, String serviceName, Date dateSchedule, String pdfUrl, String[] recipients) throws IOException {
String qPath = "/telephony/{billingAccount}/fax/{serviceName}/settings/sendFax";
StringBuilder sb = path(qPath, billingAccount, s... | [
"public",
"OvhTask",
"billingAccount_fax_serviceName_settings_sendFax_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Date",
"dateSchedule",
",",
"String",
"pdfUrl",
",",
"String",
"[",
"]",
"recipients",
")",
"throws",
"IOException",
"{",
... | Send a fax
REST: POST /telephony/{billingAccount}/fax/{serviceName}/settings/sendFax
@param recipients [required] List of recipients of your fax
@param pdfUrl [required] Url of the pdf document you want to send
@param dateSchedule [required] If you want to schedule your fax later, you can specify a date
@param billing... | [
"Send",
"a",
"fax"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4366-L4375 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/image/ConvertImage.java | ConvertImage.convertU8F32 | public static InterleavedF32 convertU8F32( Planar<GrayU8> input , InterleavedF32 output ) {
"""
Converts a {@link Planar} into the equivalent {@link InterleavedF32}
@param input (Input) Planar image that is being converted. Not modified.
@param output (Optional) The output image. If null a new image is create... | java | public static InterleavedF32 convertU8F32( Planar<GrayU8> input , InterleavedF32 output ) {
if (output == null) {
output = new InterleavedF32(input.width, input.height,input.getNumBands());
} else {
output.reshape(input.width,input.height,input.getNumBands());
}
if( BoofConcurrency.USE_CONCURRENT ) {
... | [
"public",
"static",
"InterleavedF32",
"convertU8F32",
"(",
"Planar",
"<",
"GrayU8",
">",
"input",
",",
"InterleavedF32",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"InterleavedF32",
"(",
"input",
".",
"width",
",... | Converts a {@link Planar} into the equivalent {@link InterleavedF32}
@param input (Input) Planar image that is being converted. Not modified.
@param output (Optional) The output image. If null a new image is created. Modified.
@return Converted image. | [
"Converts",
"a",
"{",
"@link",
"Planar",
"}",
"into",
"the",
"equivalent",
"{",
"@link",
"InterleavedF32",
"}"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/image/ConvertImage.java#L3581-L3595 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/contentcensor/AipContentCensor.java | AipContentCensor.imageCensorComb | public JSONObject imageCensorComb(byte[] imgData, List<String> scenes, HashMap<String, String> options) {
"""
组合审核接口
@param imgData 图片二进制数据
@param scenes 需要审核的服务类型
@param options 可选参数
@return JSONObject
"""
AipRequest request = new AipRequest();
String base64Content = Base64Util.encode(img... | java | public JSONObject imageCensorComb(byte[] imgData, List<String> scenes, HashMap<String, String> options) {
AipRequest request = new AipRequest();
String base64Content = Base64Util.encode(imgData);
request.addBody("image", base64Content);
return imageCensorCombHelper(request, scenes, opt... | [
"public",
"JSONObject",
"imageCensorComb",
"(",
"byte",
"[",
"]",
"imgData",
",",
"List",
"<",
"String",
">",
"scenes",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
"... | 组合审核接口
@param imgData 图片二进制数据
@param scenes 需要审核的服务类型
@param options 可选参数
@return JSONObject | [
"组合审核接口"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/contentcensor/AipContentCensor.java#L183-L190 |
netty/netty | common/src/main/java/io/netty/util/NetUtil.java | NetUtil.toSocketAddressString | public static String toSocketAddressString(String host, int port) {
"""
Returns the {@link String} representation of a host port combo.
"""
String portStr = String.valueOf(port);
return newSocketAddressStringBuilder(
host, portStr, !isValidIpV6Address(host)).append(':').append(p... | java | public static String toSocketAddressString(String host, int port) {
String portStr = String.valueOf(port);
return newSocketAddressStringBuilder(
host, portStr, !isValidIpV6Address(host)).append(':').append(portStr).toString();
} | [
"public",
"static",
"String",
"toSocketAddressString",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"String",
"portStr",
"=",
"String",
".",
"valueOf",
"(",
"port",
")",
";",
"return",
"newSocketAddressStringBuilder",
"(",
"host",
",",
"portStr",
",",
... | Returns the {@link String} representation of a host port combo. | [
"Returns",
"the",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/NetUtil.java#L957-L961 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.nestedBeanNull | public static void nestedBeanNull(String currentField, String destinationClass, String destinationField, String sourceClass, String sourceField, boolean safeNavigationOperator) {
"""
Thrown when the source field is null in a mapping of nested type.
@param currentField current field
@param destinationClass destin... | java | public static void nestedBeanNull(String currentField, String destinationClass, String destinationField, String sourceClass, String sourceField, boolean safeNavigationOperator){
throw new NestedBeanNullException(MSG.INSTANCE.message(nestedBeanNullException,currentField,destinationClass,destinationField,sourceClass,s... | [
"public",
"static",
"void",
"nestedBeanNull",
"(",
"String",
"currentField",
",",
"String",
"destinationClass",
",",
"String",
"destinationField",
",",
"String",
"sourceClass",
",",
"String",
"sourceField",
",",
"boolean",
"safeNavigationOperator",
")",
"{",
"throw",
... | Thrown when the source field is null in a mapping of nested type.
@param currentField current field
@param destinationClass destination class
@param destinationField destination field
@param sourceClass source class
@param sourceField source field | [
"Thrown",
"when",
"the",
"source",
"field",
"is",
"null",
"in",
"a",
"mapping",
"of",
"nested",
"type",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L126-L128 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/QName.java | QName.getQNameFromString | public static QName getQNameFromString(String name) {
"""
Given a string, create and return a QName object
@param name String to use to create QName
@return a QName object
"""
StringTokenizer tokenizer = new StringTokenizer(name, "{}", false);
QName qname;
String s1 = tokenizer.nextToken()... | java | public static QName getQNameFromString(String name)
{
StringTokenizer tokenizer = new StringTokenizer(name, "{}", false);
QName qname;
String s1 = tokenizer.nextToken();
String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null;
if (null == s2)
qname = new QName(null, s1);
e... | [
"public",
"static",
"QName",
"getQNameFromString",
"(",
"String",
"name",
")",
"{",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"name",
",",
"\"{}\"",
",",
"false",
")",
";",
"QName",
"qname",
";",
"String",
"s1",
"=",
"tokenizer",
".... | Given a string, create and return a QName object
@param name String to use to create QName
@return a QName object | [
"Given",
"a",
"string",
"create",
"and",
"return",
"a",
"QName",
"object"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/QName.java#L632-L646 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/provisioning/UsersApi.java | UsersApi.deleteUser | public void deleteUser(String userDBID, Boolean keepPlaces) throws ProvisioningApiException {
"""
Deletes a user with the given DBID.
@param userDBID The DBID of the user to be deleted. (required)
@param keepPlaces If null or false the user's places and DNs are not deleted. (optional)
@throws ProvisioningApiExc... | java | public void deleteUser(String userDBID, Boolean keepPlaces) throws ProvisioningApiException {
try {
ApiSuccessResponse resp = usersApi.deleteUser(userDBID, keepPlaces);
if (!resp.getStatus().getCode().equals(0)) {
throw new ProvisioningApiException("Error deleting user. Code: " + resp.getStatus().getC... | [
"public",
"void",
"deleteUser",
"(",
"String",
"userDBID",
",",
"Boolean",
"keepPlaces",
")",
"throws",
"ProvisioningApiException",
"{",
"try",
"{",
"ApiSuccessResponse",
"resp",
"=",
"usersApi",
".",
"deleteUser",
"(",
"userDBID",
",",
"keepPlaces",
")",
";",
"... | Deletes a user with the given DBID.
@param userDBID The DBID of the user to be deleted. (required)
@param keepPlaces If null or false the user's places and DNs are not deleted. (optional)
@throws ProvisioningApiException if the call is unsuccessful. | [
"Deletes",
"a",
"user",
"with",
"the",
"given",
"DBID",
"."
] | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/UsersApi.java#L52-L62 |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.elementBeforeImpl | protected Element elementBeforeImpl(String name, String namespaceURI) {
"""
Add a named and namespaced XML element to the document as a sibling element
that precedes the position of this builder node.
@param name
the name of the XML element.
@param namespaceURI
a namespace URI
@throws IllegalStateExcepti... | java | protected Element elementBeforeImpl(String name, String namespaceURI) {
Node parentNode = this.xmlNode.getParentNode();
assertElementContainsNoOrWhitespaceOnlyTextNodes(parentNode);
Element newElement = (namespaceURI == null
? getDocument().createElement(name)
: getDocum... | [
"protected",
"Element",
"elementBeforeImpl",
"(",
"String",
"name",
",",
"String",
"namespaceURI",
")",
"{",
"Node",
"parentNode",
"=",
"this",
".",
"xmlNode",
".",
"getParentNode",
"(",
")",
";",
"assertElementContainsNoOrWhitespaceOnlyTextNodes",
"(",
"parentNode",
... | Add a named and namespaced XML element to the document as a sibling element
that precedes the position of this builder node.
@param name
the name of the XML element.
@param namespaceURI
a namespace URI
@throws IllegalStateException
if you attempt to add a sibling element to a node where there are already
one or more ... | [
"Add",
"a",
"named",
"and",
"namespaced",
"XML",
"element",
"to",
"the",
"document",
"as",
"a",
"sibling",
"element",
"that",
"precedes",
"the",
"position",
"of",
"this",
"builder",
"node",
"."
] | train | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L784-L796 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/Drawer.java | Drawer.setSelection | public void setSelection(long identifier, boolean fireOnClick) {
"""
set the current selection in the drawer
NOTE: This will trigger onDrawerItemSelected without a view if you pass fireOnClick = true;
@param identifier the identifier to search for
@param fireOnClick true if the click listener should be calle... | java | public void setSelection(long identifier, boolean fireOnClick) {
SelectExtension<IDrawerItem> select = getAdapter().getExtension(SelectExtension.class);
if (select != null) {
select.deselect();
select.selectByIdentifier(identifier, false, true);
//we also have to cal... | [
"public",
"void",
"setSelection",
"(",
"long",
"identifier",
",",
"boolean",
"fireOnClick",
")",
"{",
"SelectExtension",
"<",
"IDrawerItem",
">",
"select",
"=",
"getAdapter",
"(",
")",
".",
"getExtension",
"(",
"SelectExtension",
".",
"class",
")",
";",
"if",
... | set the current selection in the drawer
NOTE: This will trigger onDrawerItemSelected without a view if you pass fireOnClick = true;
@param identifier the identifier to search for
@param fireOnClick true if the click listener should be called | [
"set",
"the",
"current",
"selection",
"in",
"the",
"drawer",
"NOTE",
":",
"This",
"will",
"trigger",
"onDrawerItemSelected",
"without",
"a",
"view",
"if",
"you",
"pass",
"fireOnClick",
"=",
"true",
";"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L532-L545 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java | LocalTime.plusNanos | public LocalTime plusNanos(long nanosToAdd) {
"""
Returns a copy of this {@code LocalTime} with the specified number of nanoseconds added.
<p>
This adds the specified number of nanoseconds to this time, returning a new time.
The calculation wraps around midnight.
<p>
This instance is immutable and unaffected ... | java | public LocalTime plusNanos(long nanosToAdd) {
if (nanosToAdd == 0) {
return this;
}
long nofd = toNanoOfDay();
long newNofd = ((nanosToAdd % NANOS_PER_DAY) + nofd + NANOS_PER_DAY) % NANOS_PER_DAY;
if (nofd == newNofd) {
return this;
}
int n... | [
"public",
"LocalTime",
"plusNanos",
"(",
"long",
"nanosToAdd",
")",
"{",
"if",
"(",
"nanosToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"long",
"nofd",
"=",
"toNanoOfDay",
"(",
")",
";",
"long",
"newNofd",
"=",
"(",
"(",
"nanosToAdd",
"%",
... | Returns a copy of this {@code LocalTime} with the specified number of nanoseconds added.
<p>
This adds the specified number of nanoseconds to this time, returning a new time.
The calculation wraps around midnight.
<p>
This instance is immutable and unaffected by this method call.
@param nanosToAdd the nanos to add, m... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalTime",
"}",
"with",
"the",
"specified",
"number",
"of",
"nanoseconds",
"added",
".",
"<p",
">",
"This",
"adds",
"the",
"specified",
"number",
"of",
"nanoseconds",
"to",
"this",
"time",
"returning",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java#L1137-L1151 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/code/ClassCode.java | ClassCode.addField | public void addField(String scope, String type, String name, String defaultValue) {
"""
Adds the field.
@param scope the scope
@param type the type
@param name the name
@param defaultValue the default value
"""
fields.put(name, new FieldCode(scope, name, type, defaultValue));
} | java | public void addField(String scope, String type, String name, String defaultValue) {
fields.put(name, new FieldCode(scope, name, type, defaultValue));
} | [
"public",
"void",
"addField",
"(",
"String",
"scope",
",",
"String",
"type",
",",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"fields",
".",
"put",
"(",
"name",
",",
"new",
"FieldCode",
"(",
"scope",
",",
"name",
",",
"type",
",",
"defau... | Adds the field.
@param scope the scope
@param type the type
@param name the name
@param defaultValue the default value | [
"Adds",
"the",
"field",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/code/ClassCode.java#L104-L106 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java | SpiderService.aggregateQuery | public AggregateResult aggregateQuery(TableDefinition tableDef, Aggregate aggParams) {
"""
Perform an aggregate query on the given table using the given query parameters.
@param tableDef {@link TableDefinition} of table to query.
@param aggParams {@link Aggregate} containing query parameters.
@return ... | java | public AggregateResult aggregateQuery(TableDefinition tableDef, Aggregate aggParams) {
checkServiceState();
aggParams.execute();
return aggParams.getResult();
} | [
"public",
"AggregateResult",
"aggregateQuery",
"(",
"TableDefinition",
"tableDef",
",",
"Aggregate",
"aggParams",
")",
"{",
"checkServiceState",
"(",
")",
";",
"aggParams",
".",
"execute",
"(",
")",
";",
"return",
"aggParams",
".",
"getResult",
"(",
")",
";",
... | Perform an aggregate query on the given table using the given query parameters.
@param tableDef {@link TableDefinition} of table to query.
@param aggParams {@link Aggregate} containing query parameters.
@return {@link AggregateResult} containing search results. | [
"Perform",
"an",
"aggregate",
"query",
"on",
"the",
"given",
"table",
"using",
"the",
"given",
"query",
"parameters",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderService.java#L209-L213 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/GraphicalModel.java | GraphicalModel.addStaticBinaryFactor | public Factor addStaticBinaryFactor(int a, int b, BiFunction<Integer, Integer, Double> value) {
"""
Add a binary factor, where we just want to hard-code the value of the factor.
@param a The index of the first variable.
@param b The index of the second variable.
@param value A mapping from assignments of the ... | java | public Factor addStaticBinaryFactor(int a, int b, BiFunction<Integer, Integer, Double> value) {
int[] variableDims = getVariableSizes();
assert a < variableDims.length;
assert b < variableDims.length;
return addStaticFactor(new int[]{a, b}, new int[]{variableDims[a], variableDims[b]}, assignment ->
... | [
"public",
"Factor",
"addStaticBinaryFactor",
"(",
"int",
"a",
",",
"int",
"b",
",",
"BiFunction",
"<",
"Integer",
",",
"Integer",
",",
"Double",
">",
"value",
")",
"{",
"int",
"[",
"]",
"variableDims",
"=",
"getVariableSizes",
"(",
")",
";",
"assert",
"a... | Add a binary factor, where we just want to hard-code the value of the factor.
@param a The index of the first variable.
@param b The index of the second variable.
@param value A mapping from assignments of the two variables, to a factor value.
@return a reference to the created factor. This can be safely ignored, as ... | [
"Add",
"a",
"binary",
"factor",
"where",
"we",
"just",
"want",
"to",
"hard",
"-",
"code",
"the",
"value",
"of",
"the",
"factor",
"."
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/GraphicalModel.java#L469-L475 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/api/Database.java | Database.getShards | public List<Shard> getShards() {
"""
Get info about the shards in the database.
@return List of shards
@see <a
href="https://console.bluemix.net/docs/services/Cloudant/api/advanced.html#-get-database-_shards-"
target="_blank">_shards</a>
"""
InputStream response = null;
try {
... | java | public List<Shard> getShards() {
InputStream response = null;
try {
response = client.couchDbClient.get(new DatabaseURIHelper(db.getDBUri()).path("_shards")
.build());
return getResponseList(response, client.getGson(), DeserializationTypes.SHARDS);
} f... | [
"public",
"List",
"<",
"Shard",
">",
"getShards",
"(",
")",
"{",
"InputStream",
"response",
"=",
"null",
";",
"try",
"{",
"response",
"=",
"client",
".",
"couchDbClient",
".",
"get",
"(",
"new",
"DatabaseURIHelper",
"(",
"db",
".",
"getDBUri",
"(",
")",
... | Get info about the shards in the database.
@return List of shards
@see <a
href="https://console.bluemix.net/docs/services/Cloudant/api/advanced.html#-get-database-_shards-"
target="_blank">_shards</a> | [
"Get",
"info",
"about",
"the",
"shards",
"in",
"the",
"database",
"."
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/api/Database.java#L244-L253 |
cloudendpoints/endpoints-management-java | endpoints-service-config/src/main/java/com/google/api/config/ServiceConfigSupplier.java | ServiceConfigSupplier.get | @Override
public Service get() {
"""
Fetches the service configuration using the service name and the service
version read from the environment variables.
@return a {@link Service} object generated by the JSON response from Google
Service Management.
"""
String serviceName = this.environment.getVari... | java | @Override
public Service get() {
String serviceName = this.environment.getVariable(SERVICE_NAME_KEY);
if (Strings.isNullOrEmpty(serviceName)) {
String errorMessage =
String.format("Environment variable '%s' is not set", SERVICE_NAME_KEY);
throw new IllegalArgumentException(errorMessage);... | [
"@",
"Override",
"public",
"Service",
"get",
"(",
")",
"{",
"String",
"serviceName",
"=",
"this",
".",
"environment",
".",
"getVariable",
"(",
"SERVICE_NAME_KEY",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"serviceName",
")",
")",
"{",
"Str... | Fetches the service configuration using the service name and the service
version read from the environment variables.
@return a {@link Service} object generated by the JSON response from Google
Service Management. | [
"Fetches",
"the",
"service",
"configuration",
"using",
"the",
"service",
"name",
"and",
"the",
"service",
"version",
"read",
"from",
"the",
"environment",
"variables",
"."
] | train | https://github.com/cloudendpoints/endpoints-management-java/blob/5bbf20ddadbbd51b890049e3c338c28abe2c9f94/endpoints-service-config/src/main/java/com/google/api/config/ServiceConfigSupplier.java#L121-L132 |
aspectran/aspectran | web/src/main/java/com/aspectran/web/service/AspectranWebService.java | AspectranWebService.create | public static AspectranWebService create(WebActivityServlet servlet, AspectranWebService rootService) {
"""
Returns a new instance of {@code AspectranWebService}.
@param servlet the servlet
@param rootService the root service
@return the instance of {@code AspectranWebService}
"""
ServletContext s... | java | public static AspectranWebService create(WebActivityServlet servlet, AspectranWebService rootService) {
ServletContext servletContext = servlet.getServletContext();
ServletConfig servletConfig = servlet.getServletConfig();
String aspectranConfigParam = servletConfig.getInitParameter(ASPECTRAN_CO... | [
"public",
"static",
"AspectranWebService",
"create",
"(",
"WebActivityServlet",
"servlet",
",",
"AspectranWebService",
"rootService",
")",
"{",
"ServletContext",
"servletContext",
"=",
"servlet",
".",
"getServletContext",
"(",
")",
";",
"ServletConfig",
"servletConfig",
... | Returns a new instance of {@code AspectranWebService}.
@param servlet the servlet
@param rootService the root service
@return the instance of {@code AspectranWebService} | [
"Returns",
"a",
"new",
"instance",
"of",
"{",
"@code",
"AspectranWebService",
"}",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/web/src/main/java/com/aspectran/web/service/AspectranWebService.java#L259-L271 |
liyiorg/weixin-popular | src/main/java/weixin/popular/util/PayUtil.java | PayUtil.decryptRefundNotifyReqInfo | public static RefundNotifyReqInfo decryptRefundNotifyReqInfo(String req_info, String key) {
"""
解密退款结果通知数据 <br>
<i>
解密失败解决方案:在官方网站下载JCE无限制权限策略文件(请到官网下载对应的版本) ,下载后解压。<br>
可以看到local_policy.jar和US_export_policy.jar以及readme.txt,<br>
将两个jar文件放到%JDK_HOME%\jre\lib\security目录下覆盖原来文件<br>
JCE7 http://www.oracle.com... | java | public static RefundNotifyReqInfo decryptRefundNotifyReqInfo(String req_info, String key) {
try {
Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding");
Key sKeySpec = new SecretKeySpec(DigestUtils.md5Hex(key).getBytes(), "AES");
cipher.init(Cipher.DECRYPT_MODE, sKeySpec);
byte[] resultByte = ciphe... | [
"public",
"static",
"RefundNotifyReqInfo",
"decryptRefundNotifyReqInfo",
"(",
"String",
"req_info",
",",
"String",
"key",
")",
"{",
"try",
"{",
"Cipher",
"cipher",
"=",
"Cipher",
".",
"getInstance",
"(",
"\"AES/ECB/NoPadding\"",
")",
";",
"Key",
"sKeySpec",
"=",
... | 解密退款结果通知数据 <br>
<i>
解密失败解决方案:在官方网站下载JCE无限制权限策略文件(请到官网下载对应的版本) ,下载后解压。<br>
可以看到local_policy.jar和US_export_policy.jar以及readme.txt,<br>
将两个jar文件放到%JDK_HOME%\jre\lib\security目录下覆盖原来文件<br>
JCE7 http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html<br>
JCE8 http://www.oracle.com/technetwork/jav... | [
"解密退款结果通知数据",
"<br",
">"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/util/PayUtil.java#L202-L214 |
ag-gipp/MathMLTools | mathml-core/src/main/java/com/formulasearchengine/mathmltools/helper/XMLHelper.java | XMLHelper.getElementsB | public static NodeList getElementsB(Node node, String xString) throws XPathExpressionException {
"""
Helper program: Extracts the specified XPATH expression
from an XML-String.
@param node the node
@param xString the x path
@return NodeList
@throws XPathExpressionException the x path expression exception... | java | public static NodeList getElementsB(Node node, String xString) throws XPathExpressionException {
XPathExpression xPath = compileX(xString);
return (NodeList) xPath.evaluate(node, XPathConstants.NODESET);
} | [
"public",
"static",
"NodeList",
"getElementsB",
"(",
"Node",
"node",
",",
"String",
"xString",
")",
"throws",
"XPathExpressionException",
"{",
"XPathExpression",
"xPath",
"=",
"compileX",
"(",
"xString",
")",
";",
"return",
"(",
"NodeList",
")",
"xPath",
".",
... | Helper program: Extracts the specified XPATH expression
from an XML-String.
@param node the node
@param xString the x path
@return NodeList
@throws XPathExpressionException the x path expression exception | [
"Helper",
"program",
":",
"Extracts",
"the",
"specified",
"XPATH",
"expression",
"from",
"an",
"XML",
"-",
"String",
"."
] | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-core/src/main/java/com/formulasearchengine/mathmltools/helper/XMLHelper.java#L181-L184 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_device_identity_GET | public OvhExchangeServiceDevice organizationName_service_exchangeService_device_identity_GET(String organizationName, String exchangeService, String identity) throws IOException {
"""
Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/device/{identity}
@param orga... | java | public OvhExchangeServiceDevice organizationName_service_exchangeService_device_identity_GET(String organizationName, String exchangeService, String identity) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/device/{identity}";
StringBuilder sb = path(qPath, organiza... | [
"public",
"OvhExchangeServiceDevice",
"organizationName_service_exchangeService_device_identity_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"identity",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/exchange/{o... | Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/device/{identity}
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service
@param identity [required] Exchange identit... | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L2218-L2223 |
Cleveroad/AdaptiveTableLayout | library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableLayout.java | AdaptiveTableLayout.setDraggingToColumn | @SuppressWarnings("unused")
private void setDraggingToColumn(int column, boolean isDragging) {
"""
Method set dragging flag to all view holders in the specific column
@param column specific column
@param isDragging flag to set
"""
Collection<ViewHolder> holders = mViewHolders.getColumnItems... | java | @SuppressWarnings("unused")
private void setDraggingToColumn(int column, boolean isDragging) {
Collection<ViewHolder> holders = mViewHolders.getColumnItems(column);
for (ViewHolder holder : holders) {
holder.setIsDragging(isDragging);
}
ViewHolder holder = mHeaderColumnV... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"void",
"setDraggingToColumn",
"(",
"int",
"column",
",",
"boolean",
"isDragging",
")",
"{",
"Collection",
"<",
"ViewHolder",
">",
"holders",
"=",
"mViewHolders",
".",
"getColumnItems",
"(",
"column",
"... | Method set dragging flag to all view holders in the specific column
@param column specific column
@param isDragging flag to set | [
"Method",
"set",
"dragging",
"flag",
"to",
"all",
"view",
"holders",
"in",
"the",
"specific",
"column"
] | train | https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableLayout.java#L1470-L1481 |
phax/ph-oton | ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java | AbstractWebPageForm.createCreateToolbar | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createCreateToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nullable final DATATYPE aSelectedObject) {
"""
Create toolbar for creating a new obj... | java | @Nonnull
@OverrideOnDemand
protected TOOLBAR_TYPE createCreateToolbar (@Nonnull final WPECTYPE aWPEC,
@Nonnull final FORM_TYPE aForm,
@Nullable final DATATYPE aSelectedObject)
{
final Locale aDisplayLocale = aWPEC.getD... | [
"@",
"Nonnull",
"@",
"OverrideOnDemand",
"protected",
"TOOLBAR_TYPE",
"createCreateToolbar",
"(",
"@",
"Nonnull",
"final",
"WPECTYPE",
"aWPEC",
",",
"@",
"Nonnull",
"final",
"FORM_TYPE",
"aForm",
",",
"@",
"Nullable",
"final",
"DATATYPE",
"aSelectedObject",
")",
"... | Create toolbar for creating a new object
@param aWPEC
The web page execution context
@param aForm
The handled form. Never <code>null</code>.
@param aSelectedObject
Optional selected object. May be <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"toolbar",
"for",
"creating",
"a",
"new",
"object"
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uicore/src/main/java/com/helger/photon/uicore/page/AbstractWebPageForm.java#L833-L854 |
elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/minkowski/LPIntegerNormDistanceFunction.java | LPIntegerNormDistanceFunction.preNormMBR | private double preNormMBR(SpatialComparable mbr, final int start, final int end) {
"""
Compute unscaled norm in a range of dimensions.
@param mbr Data object
@param start First dimension
@param end Exclusive last dimension
@return Aggregated values.
"""
double agg = 0.;
for(int d = start; d < end... | java | private double preNormMBR(SpatialComparable mbr, final int start, final int end) {
double agg = 0.;
for(int d = start; d < end; d++) {
double delta = mbr.getMin(d);
delta = delta >= 0 ? delta : -mbr.getMax(d);
if(delta > 0.) {
agg += MathUtil.powi(delta, intp);
}
}
return... | [
"private",
"double",
"preNormMBR",
"(",
"SpatialComparable",
"mbr",
",",
"final",
"int",
"start",
",",
"final",
"int",
"end",
")",
"{",
"double",
"agg",
"=",
"0.",
";",
"for",
"(",
"int",
"d",
"=",
"start",
";",
"d",
"<",
"end",
";",
"d",
"++",
")"... | Compute unscaled norm in a range of dimensions.
@param mbr Data object
@param start First dimension
@param end Exclusive last dimension
@return Aggregated values. | [
"Compute",
"unscaled",
"norm",
"in",
"a",
"range",
"of",
"dimensions",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/minkowski/LPIntegerNormDistanceFunction.java#L153-L163 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java | ProfilePackageIndexFrameWriter.getPackage | protected Content getPackage(PackageDoc pd, String profileName) {
"""
Gets each package name as a separate link.
@param pd PackageDoc
@param profileName the name of the profile being documented
@return content for the package link
"""
Content packageLinkContent;
Content pkgLabel;
i... | java | protected Content getPackage(PackageDoc pd, String profileName) {
Content packageLinkContent;
Content pkgLabel;
if (pd.name().length() > 0) {
pkgLabel = getPackageLabel(pd.name());
packageLinkContent = getHyperLink(pathString(pd,
DocPaths.profilePacka... | [
"protected",
"Content",
"getPackage",
"(",
"PackageDoc",
"pd",
",",
"String",
"profileName",
")",
"{",
"Content",
"packageLinkContent",
";",
"Content",
"pkgLabel",
";",
"if",
"(",
"pd",
".",
"name",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
... | Gets each package name as a separate link.
@param pd PackageDoc
@param profileName the name of the profile being documented
@return content for the package link | [
"Gets",
"each",
"package",
"name",
"as",
"a",
"separate",
"link",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java#L112-L127 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java | SARLJvmModelInferrer.openContext | protected final synchronized GenerationContext openContext(EObject sarlObject, JvmDeclaredType type,
final Iterable<Class<? extends XtendMember>> supportedMemberTypes) {
"""
Open the context for the generation of a SARL-specific element.
@param sarlObject the SARL object that is the cause of the generation.
... | java | protected final synchronized GenerationContext openContext(EObject sarlObject, JvmDeclaredType type,
final Iterable<Class<? extends XtendMember>> supportedMemberTypes) {
assert type != null;
assert supportedMemberTypes != null;
this.sarlSignatureProvider.clear(type);
final GenerationContext context = new Gen... | [
"protected",
"final",
"synchronized",
"GenerationContext",
"openContext",
"(",
"EObject",
"sarlObject",
",",
"JvmDeclaredType",
"type",
",",
"final",
"Iterable",
"<",
"Class",
"<",
"?",
"extends",
"XtendMember",
">",
">",
"supportedMemberTypes",
")",
"{",
"assert",
... | Open the context for the generation of a SARL-specific element.
@param sarlObject the SARL object that is the cause of the generation.
@param type the generated type.
@param supportedMemberTypes the types of the supported members.
@return the created context. | [
"Open",
"the",
"context",
"for",
"the",
"generation",
"of",
"a",
"SARL",
"-",
"specific",
"element",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java#L521-L540 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.readString | public static String readString(File file, Charset charset) throws IORuntimeException {
"""
读取文件内容
@param file 文件
@param charset 字符集
@return 内容
@throws IORuntimeException IO异常
"""
return FileReader.create(file, charset).readString();
} | java | public static String readString(File file, Charset charset) throws IORuntimeException {
return FileReader.create(file, charset).readString();
} | [
"public",
"static",
"String",
"readString",
"(",
"File",
"file",
",",
"Charset",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"FileReader",
".",
"create",
"(",
"file",
",",
"charset",
")",
".",
"readString",
"(",
")",
";",
"}"
] | 读取文件内容
@param file 文件
@param charset 字符集
@return 内容
@throws IORuntimeException IO异常 | [
"读取文件内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2102-L2104 |
killbill/killbill | invoice/src/main/java/org/killbill/billing/invoice/dao/CBADao.java | CBADao.getAccountCBAFromTransaction | public BigDecimal getAccountCBAFromTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory, final InternalTenantContext context) {
"""
PERF: Compute the CBA directly in the database (faster than re-constructing all invoices)
"""
final InvoiceItemSqlDao invoiceItemSqlDao = entitySqlDaoWr... | java | public BigDecimal getAccountCBAFromTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory, final InternalTenantContext context) {
final InvoiceItemSqlDao invoiceItemSqlDao = entitySqlDaoWrapperFactory.become(InvoiceItemSqlDao.class);
return invoiceItemSqlDao.getAccountCBA(context);
... | [
"public",
"BigDecimal",
"getAccountCBAFromTransaction",
"(",
"final",
"EntitySqlDaoWrapperFactory",
"entitySqlDaoWrapperFactory",
",",
"final",
"InternalTenantContext",
"context",
")",
"{",
"final",
"InvoiceItemSqlDao",
"invoiceItemSqlDao",
"=",
"entitySqlDaoWrapperFactory",
".",... | PERF: Compute the CBA directly in the database (faster than re-constructing all invoices) | [
"PERF",
":",
"Compute",
"the",
"CBA",
"directly",
"in",
"the",
"database",
"(",
"faster",
"than",
"re",
"-",
"constructing",
"all",
"invoices",
")"
] | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/invoice/src/main/java/org/killbill/billing/invoice/dao/CBADao.java#L52-L55 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/UnImplNode.java | UnImplNode.createAttributeNS | public Attr createAttributeNS(String namespaceURI, String qualifiedName)
throws DOMException {
"""
Unimplemented. See org.w3c.dom.Document
@param namespaceURI Namespace URI of the attribute
@param qualifiedName Qualified name of the attribute
@return null
@throws DOMException
"""
error... | java | public Attr createAttributeNS(String namespaceURI, String qualifiedName)
throws DOMException
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
} | [
"public",
"Attr",
"createAttributeNS",
"(",
"String",
"namespaceURI",
",",
"String",
"qualifiedName",
")",
"throws",
"DOMException",
"{",
"error",
"(",
"XMLErrorResources",
".",
"ER_FUNCTION_NOT_SUPPORTED",
")",
";",
"return",
"null",
";",
"}"
] | Unimplemented. See org.w3c.dom.Document
@param namespaceURI Namespace URI of the attribute
@param qualifiedName Qualified name of the attribute
@return null
@throws DOMException | [
"Unimplemented",
".",
"See",
"org",
".",
"w3c",
".",
"dom",
".",
"Document"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/UnImplNode.java#L989-L996 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java | CommonOps_DDF3.fill | public static void fill( DMatrix3x3 a , double v ) {
"""
<p>
Sets every element in the matrix to the specified value.<br>
<br>
a<sub>ij</sub> = value
<p>
@param a A matrix whose elements are about to be set. Modified.
@param v The value each element will have.
"""
a.a11 = v; a.a12 = v; a.a13 =... | java | public static void fill( DMatrix3x3 a , double v ) {
a.a11 = v; a.a12 = v; a.a13 = v;
a.a21 = v; a.a22 = v; a.a23 = v;
a.a31 = v; a.a32 = v; a.a33 = v;
} | [
"public",
"static",
"void",
"fill",
"(",
"DMatrix3x3",
"a",
",",
"double",
"v",
")",
"{",
"a",
".",
"a11",
"=",
"v",
";",
"a",
".",
"a12",
"=",
"v",
";",
"a",
".",
"a13",
"=",
"v",
";",
"a",
".",
"a21",
"=",
"v",
";",
"a",
".",
"a22",
"="... | <p>
Sets every element in the matrix to the specified value.<br>
<br>
a<sub>ij</sub> = value
<p>
@param a A matrix whose elements are about to be set. Modified.
@param v The value each element will have. | [
"<p",
">",
"Sets",
"every",
"element",
"in",
"the",
"matrix",
"to",
"the",
"specified",
"value",
".",
"<br",
">",
"<br",
">",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"value",
"<p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java#L1321-L1325 |
udoprog/ffwd-client-java | src/main/java/com/google/protobuf250/AbstractMessage.java | AbstractMessage.hashFields | @SuppressWarnings("unchecked")
protected int hashFields(int hash, Map<FieldDescriptor, Object> map) {
"""
Get a hash code for given fields and values, using the given seed.
"""
for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
FieldDescriptor field = entry.getKey();
Object val... | java | @SuppressWarnings("unchecked")
protected int hashFields(int hash, Map<FieldDescriptor, Object> map) {
for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
FieldDescriptor field = entry.getKey();
Object value = entry.getValue();
hash = (37 * hash) + field.getNumber();
if (field... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"int",
"hashFields",
"(",
"int",
"hash",
",",
"Map",
"<",
"FieldDescriptor",
",",
"Object",
">",
"map",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"FieldDescriptor",
",",
"Object",
">",
... | Get a hash code for given fields and values, using the given seed. | [
"Get",
"a",
"hash",
"code",
"for",
"given",
"fields",
"and",
"values",
"using",
"the",
"given",
"seed",
"."
] | train | https://github.com/udoprog/ffwd-client-java/blob/b4161d2b138e3edb8fa9420cc3cc653d5764cf5b/src/main/java/com/google/protobuf250/AbstractMessage.java#L197-L213 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/text/StringRandomizer.java | StringRandomizer.aNewStringRandomizer | public static StringRandomizer aNewStringRandomizer(final Charset charset, final int maxLength, final long seed) {
"""
Create a new {@link StringRandomizer}.
@param charset to use
@param maxLength of the String to generate
@param seed initial seed
@return a new {@link StringRandomizer}.
"""
... | java | public static StringRandomizer aNewStringRandomizer(final Charset charset, final int maxLength, final long seed) {
return new StringRandomizer(charset, maxLength, seed);
} | [
"public",
"static",
"StringRandomizer",
"aNewStringRandomizer",
"(",
"final",
"Charset",
"charset",
",",
"final",
"int",
"maxLength",
",",
"final",
"long",
"seed",
")",
"{",
"return",
"new",
"StringRandomizer",
"(",
"charset",
",",
"maxLength",
",",
"seed",
")",... | Create a new {@link StringRandomizer}.
@param charset to use
@param maxLength of the String to generate
@param seed initial seed
@return a new {@link StringRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"StringRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/text/StringRandomizer.java#L233-L235 |
jurmous/etcd4j | src/main/java/mousio/etcd4j/EtcdClient.java | EtcdClient.getLeaderStats | public EtcdLeaderStatsResponse getLeaderStats() {
"""
Get the Leader Statistics of Etcd
@return EtcdLeaderStatsResponse
"""
try {
return new EtcdLeaderStatsRequest(this.client, retryHandler).send().get();
} catch (IOException | EtcdException | EtcdAuthenticationException | TimeoutException e) ... | java | public EtcdLeaderStatsResponse getLeaderStats() {
try {
return new EtcdLeaderStatsRequest(this.client, retryHandler).send().get();
} catch (IOException | EtcdException | EtcdAuthenticationException | TimeoutException e) {
return null;
}
} | [
"public",
"EtcdLeaderStatsResponse",
"getLeaderStats",
"(",
")",
"{",
"try",
"{",
"return",
"new",
"EtcdLeaderStatsRequest",
"(",
"this",
".",
"client",
",",
"retryHandler",
")",
".",
"send",
"(",
")",
".",
"get",
"(",
")",
";",
"}",
"catch",
"(",
"IOExcep... | Get the Leader Statistics of Etcd
@return EtcdLeaderStatsResponse | [
"Get",
"the",
"Leader",
"Statistics",
"of",
"Etcd"
] | train | https://github.com/jurmous/etcd4j/blob/ffb1d574cf85bbab025dd566ce250f1860bbcbc7/src/main/java/mousio/etcd4j/EtcdClient.java#L158-L164 |
spotbugs/spotbugs | spotbugs/src/gui/main/edu/umd/cs/findbugs/gui/AnnotatedString.java | AnnotatedString.localiseButton | public static void localiseButton(AbstractButton button, String key, String defaultString, boolean setMnemonic) {
"""
Localise the given AbstractButton, setting the text and optionally
mnemonic Note that AbstractButton includes menus and menu items.
@param button
The button to localise
@param key
The key to... | java | public static void localiseButton(AbstractButton button, String key, String defaultString, boolean setMnemonic) {
AnnotatedString as = new AnnotatedString(L10N.getLocalString(key, defaultString));
button.setText(as.toString());
int mnemonic;
if (setMnemonic && (mnemonic = as.getMnemonic(... | [
"public",
"static",
"void",
"localiseButton",
"(",
"AbstractButton",
"button",
",",
"String",
"key",
",",
"String",
"defaultString",
",",
"boolean",
"setMnemonic",
")",
"{",
"AnnotatedString",
"as",
"=",
"new",
"AnnotatedString",
"(",
"L10N",
".",
"getLocalString"... | Localise the given AbstractButton, setting the text and optionally
mnemonic Note that AbstractButton includes menus and menu items.
@param button
The button to localise
@param key
The key to look up in resource bundle
@param defaultString
default String to use if key not found
@param setMnemonic
whether or not to set ... | [
"Localise",
"the",
"given",
"AbstractButton",
"setting",
"the",
"text",
"and",
"optionally",
"mnemonic",
"Note",
"that",
"AbstractButton",
"includes",
"menus",
"and",
"menu",
"items",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui/AnnotatedString.java#L168-L176 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/X509CertSelector.java | X509CertSelector.setSubject | public void setSubject(byte[] subjectDN) throws IOException {
"""
Sets the subject criterion. The specified distinguished name
must match the subject distinguished name in the
{@code X509Certificate}. If {@code null}, any subject
distinguished name will do.
<p>
If {@code subjectDN} is not {@code null}, it sho... | java | public void setSubject(byte[] subjectDN) throws IOException {
try {
subject = (subjectDN == null ? null : new X500Principal(subjectDN));
} catch (IllegalArgumentException e) {
throw new IOException("Invalid name", e);
}
} | [
"public",
"void",
"setSubject",
"(",
"byte",
"[",
"]",
"subjectDN",
")",
"throws",
"IOException",
"{",
"try",
"{",
"subject",
"=",
"(",
"subjectDN",
"==",
"null",
"?",
"null",
":",
"new",
"X500Principal",
"(",
"subjectDN",
")",
")",
";",
"}",
"catch",
... | Sets the subject criterion. The specified distinguished name
must match the subject distinguished name in the
{@code X509Certificate}. If {@code null}, any subject
distinguished name will do.
<p>
If {@code subjectDN} is not {@code null}, it should contain a
single DER encoded distinguished name, as defined in X.501. Fo... | [
"Sets",
"the",
"subject",
"criterion",
".",
"The",
"specified",
"distinguished",
"name",
"must",
"match",
"the",
"subject",
"distinguished",
"name",
"in",
"the",
"{",
"@code",
"X509Certificate",
"}",
".",
"If",
"{",
"@code",
"null",
"}",
"any",
"subject",
"d... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/X509CertSelector.java#L341-L347 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java | VirtualHubsInner.createOrUpdate | public VirtualHubInner createOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) {
"""
Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName Th... | java | public VirtualHubInner createOrUpdate(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).toBlocking().last().body();
} | [
"public",
"VirtualHubInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualHubName",
",",
"VirtualHubInner",
"virtualHubParameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualHubName",
"... | Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@param virtualHubParameters Parameters supplied to create or update VirtualHub.
@throws IllegalArgumentException ... | [
"Creates",
"a",
"VirtualHub",
"resource",
"if",
"it",
"doesn",
"t",
"exist",
"else",
"updates",
"the",
"existing",
"VirtualHub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java#L211-L213 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/data/CcgExampleFormat.java | CcgExampleFormat.parseFrom | @Override
public CcgExample parseFrom(String exampleString) {
"""
Expected format is (space-separated words)###(,-separated
dependency structures)###(@@@-separated lexicon entries
(optional)).
@param exampleString
@return
"""
String[] parts = exampleString.split("###");
List<String> words = Arr... | java | @Override
public CcgExample parseFrom(String exampleString) {
String[] parts = exampleString.split("###");
List<String> words = Arrays.asList(parts[0].split("\\s+"));
Set<DependencyStructure> dependencies = Sets.newHashSet();
String[] dependencyParts = new CsvParser(CsvParser.DEFAULT_SEPARATOR,
... | [
"@",
"Override",
"public",
"CcgExample",
"parseFrom",
"(",
"String",
"exampleString",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"exampleString",
".",
"split",
"(",
"\"###\"",
")",
";",
"List",
"<",
"String",
">",
"words",
"=",
"Arrays",
".",
"asList",
... | Expected format is (space-separated words)###(,-separated
dependency structures)###(@@@-separated lexicon entries
(optional)).
@param exampleString
@return | [
"Expected",
"format",
"is",
"(",
"space",
"-",
"separated",
"words",
")",
"###",
"(",
"-",
"separated",
"dependency",
"structures",
")",
"###",
"(",
"@@@",
"-",
"separated",
"lexicon",
"entries",
"(",
"optional",
"))",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/data/CcgExampleFormat.java#L40-L83 |
meertensinstituut/mtas | src/main/java/mtas/solr/handler/component/util/MtasSolrCollectionResult.java | MtasSolrCollectionResult.setList | public void setList(long now, List<SimpleOrderedMap<Object>> list)
throws IOException {
"""
Sets the list.
@param now the now
@param list the list
@throws IOException Signals that an I/O exception has occurred.
"""
if (action.equals(ComponentCollection.ACTION_LIST)) {
this.now = now;
... | java | public void setList(long now, List<SimpleOrderedMap<Object>> list)
throws IOException {
if (action.equals(ComponentCollection.ACTION_LIST)) {
this.now = now;
this.list = list;
} else {
throw new IOException("not allowed with action '" + action + "'");
}
} | [
"public",
"void",
"setList",
"(",
"long",
"now",
",",
"List",
"<",
"SimpleOrderedMap",
"<",
"Object",
">",
">",
"list",
")",
"throws",
"IOException",
"{",
"if",
"(",
"action",
".",
"equals",
"(",
"ComponentCollection",
".",
"ACTION_LIST",
")",
")",
"{",
... | Sets the list.
@param now the now
@param list the list
@throws IOException Signals that an I/O exception has occurred. | [
"Sets",
"the",
"list",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/util/MtasSolrCollectionResult.java#L94-L102 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/window/WindowedBoltExecutor.java | WindowedBoltExecutor.mergeSessionWindows | private TimeWindow mergeSessionWindows(TimeWindow oldWindow, TimeWindow newWindow) {
"""
merges two windows, if there's an overlap between two windows, return merged window;
otherwise return the new window itself.
"""
if (oldWindow.intersects(newWindow)) {
return oldWindow.cover(newWindow)... | java | private TimeWindow mergeSessionWindows(TimeWindow oldWindow, TimeWindow newWindow) {
if (oldWindow.intersects(newWindow)) {
return oldWindow.cover(newWindow);
}
return newWindow;
} | [
"private",
"TimeWindow",
"mergeSessionWindows",
"(",
"TimeWindow",
"oldWindow",
",",
"TimeWindow",
"newWindow",
")",
"{",
"if",
"(",
"oldWindow",
".",
"intersects",
"(",
"newWindow",
")",
")",
"{",
"return",
"oldWindow",
".",
"cover",
"(",
"newWindow",
")",
";... | merges two windows, if there's an overlap between two windows, return merged window;
otherwise return the new window itself. | [
"merges",
"two",
"windows",
"if",
"there",
"s",
"an",
"overlap",
"between",
"two",
"windows",
"return",
"merged",
"window",
";",
"otherwise",
"return",
"the",
"new",
"window",
"itself",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/window/WindowedBoltExecutor.java#L433-L438 |
alkacon/opencms-core | src/org/opencms/i18n/CmsResourceBundleLoader.java | CmsResourceBundleLoader.addBundleToCache | public static void addBundleToCache(String baseName, Locale locale, I_CmsResourceBundle bundle) {
"""
Adds the specified resource bundle to the permanent cache.<p>
@param baseName the raw bundle name, without locale qualifiers
@param locale the locale
@param bundle the bundle to cache
"""
String ... | java | public static void addBundleToCache(String baseName, Locale locale, I_CmsResourceBundle bundle) {
String key = baseName;
if (locale != null) {
key += "_" + locale;
}
m_permanentCache.put(key, bundle);
} | [
"public",
"static",
"void",
"addBundleToCache",
"(",
"String",
"baseName",
",",
"Locale",
"locale",
",",
"I_CmsResourceBundle",
"bundle",
")",
"{",
"String",
"key",
"=",
"baseName",
";",
"if",
"(",
"locale",
"!=",
"null",
")",
"{",
"key",
"+=",
"\"_\"",
"+... | Adds the specified resource bundle to the permanent cache.<p>
@param baseName the raw bundle name, without locale qualifiers
@param locale the locale
@param bundle the bundle to cache | [
"Adds",
"the",
"specified",
"resource",
"bundle",
"to",
"the",
"permanent",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsResourceBundleLoader.java#L188-L195 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.deleteInstances | public OperationStatusResponseInner deleteInstances(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) {
"""
Deletes virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceIds The v... | java | public OperationStatusResponseInner deleteInstances(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) {
return deleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body();
} | [
"public",
"OperationStatusResponseInner",
"deleteInstances",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"List",
"<",
"String",
">",
"instanceIds",
")",
"{",
"return",
"deleteInstancesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Deletes virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceIds The virtual machine scale set instance ids.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown... | [
"Deletes",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L1120-L1122 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/ResourceUtil.java | ResourceUtil.getOrCreateChild | public static Resource getOrCreateChild(Resource resource, String relPath, String primaryTypes)
throws RepositoryException {
"""
Retrieves the resources child resource, creates this child if not existing.
@param resource the resource to extend
@param relPath the path to the requested child... | java | public static Resource getOrCreateChild(Resource resource, String relPath, String primaryTypes)
throws RepositoryException {
Resource child = null;
if (resource != null) {
ResourceResolver resolver = resource.getResourceResolver();
String path = resource.getPath();
... | [
"public",
"static",
"Resource",
"getOrCreateChild",
"(",
"Resource",
"resource",
",",
"String",
"relPath",
",",
"String",
"primaryTypes",
")",
"throws",
"RepositoryException",
"{",
"Resource",
"child",
"=",
"null",
";",
"if",
"(",
"resource",
"!=",
"null",
")",
... | Retrieves the resources child resource, creates this child if not existing.
@param resource the resource to extend
@param relPath the path to the requested child resource
@param primaryTypes the 'path' of primary types for the new nodes (optional, can be 'null')
@return the requested child | [
"Retrieves",
"the",
"resources",
"child",
"resource",
"creates",
"this",
"child",
"if",
"not",
"existing",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/ResourceUtil.java#L374-L389 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java | SparkComputationGraph.doEvaluationMDS | @SuppressWarnings("unchecked")
public <T extends IEvaluation> T[] doEvaluationMDS(JavaRDD<MultiDataSet> data, int evalBatchSize, T... emptyEvaluations) {
"""
Perform distributed evaluation on a <i>single output</i> ComputationGraph form MultiDataSet objects using Spark.
Can be used to perform multiple evaluat... | java | @SuppressWarnings("unchecked")
public <T extends IEvaluation> T[] doEvaluationMDS(JavaRDD<MultiDataSet> data, int evalBatchSize, T... emptyEvaluations) {
return doEvaluationMDS(data, getDefaultEvaluationWorkers(), evalBatchSize, emptyEvaluations);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"IEvaluation",
">",
"T",
"[",
"]",
"doEvaluationMDS",
"(",
"JavaRDD",
"<",
"MultiDataSet",
">",
"data",
",",
"int",
"evalBatchSize",
",",
"T",
"...",
"emptyEvaluations",
")",
... | Perform distributed evaluation on a <i>single output</i> ComputationGraph form MultiDataSet objects using Spark.
Can be used to perform multiple evaluations on this single output (for example, {@link Evaluation} and
{@link ROC}) at the same time.
@param data Data to evaluatie
@param evalBatchSize Miniba... | [
"Perform",
"distributed",
"evaluation",
"on",
"a",
"<i",
">",
"single",
"output<",
"/",
"i",
">",
"ComputationGraph",
"form",
"MultiDataSet",
"objects",
"using",
"Spark",
".",
"Can",
"be",
"used",
"to",
"perform",
"multiple",
"evaluations",
"on",
"this",
"sing... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java#L844-L847 |
oehf/ipf-oht-atna | nodeauth/src/main/java/org/openhealthtools/ihe/atna/nodeauth/handlers/AbstractSecureSocketHandler.java | AbstractSecureSocketHandler.createSocketFromFactory | protected Socket createSocketFromFactory(SocketFactory factory, String host, int port) throws IOException {
"""
Creates a new connected socket to a given host and port from a provided Socket Factory.
@param factory Java Socket Factory to use in the connection
@param host Hostname to connect to
@param port Port ... | java | protected Socket createSocketFromFactory(SocketFactory factory, String host, int port) throws IOException
{
if (logger.isDebugEnabled()) {
logger.debug("Connecting to " + host +" on port " + port +
" (timeout: " + CONTEXT.getConfig().getConnectTimeout() + " ms) using factory "+ factory.getClass(... | [
"protected",
"Socket",
"createSocketFromFactory",
"(",
"SocketFactory",
"factory",
",",
"String",
"host",
",",
"int",
"port",
")",
"throws",
"IOException",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"C... | Creates a new connected socket to a given host and port from a provided Socket Factory.
@param factory Java Socket Factory to use in the connection
@param host Hostname to connect to
@param port Port to connect to
@return Connected socket instance from the given factory
@throws IOException | [
"Creates",
"a",
"new",
"connected",
"socket",
"to",
"a",
"given",
"host",
"and",
"port",
"from",
"a",
"provided",
"Socket",
"Factory",
"."
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/nodeauth/src/main/java/org/openhealthtools/ihe/atna/nodeauth/handlers/AbstractSecureSocketHandler.java#L224-L238 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/CreditBasedPartitionRequestClientHandler.java | CreditBasedPartitionRequestClientHandler.userEventTriggered | @Override
public void userEventTriggered(ChannelHandlerContext ctx, Object msg) throws Exception {
"""
Triggered by notifying credit available in the client handler pipeline.
<p>Enqueues the input channel and will trigger write&flush unannounced credits
for this input channel if it is the first one in the que... | java | @Override
public void userEventTriggered(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof RemoteInputChannel) {
boolean triggerWrite = inputChannelsWithCredit.isEmpty();
inputChannelsWithCredit.add((RemoteInputChannel) msg);
if (triggerWrite) {
writeAndFlushNextMessageIfPos... | [
"@",
"Override",
"public",
"void",
"userEventTriggered",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Object",
"msg",
")",
"throws",
"Exception",
"{",
"if",
"(",
"msg",
"instanceof",
"RemoteInputChannel",
")",
"{",
"boolean",
"triggerWrite",
"=",
"inputChannelsWithCre... | Triggered by notifying credit available in the client handler pipeline.
<p>Enqueues the input channel and will trigger write&flush unannounced credits
for this input channel if it is the first one in the queue. | [
"Triggered",
"by",
"notifying",
"credit",
"available",
"in",
"the",
"client",
"handler",
"pipeline",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/CreditBasedPartitionRequestClientHandler.java#L187-L200 |
apache/incubator-druid | core/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java | Lifecycle.addMaybeStartStartCloseInstance | public <T> T addMaybeStartStartCloseInstance(T o, Stage stage) throws Exception {
"""
Adds an instance with a start() and/or close() method to the Lifecycle and starts it if the lifecycle has
already been started.
@param o The object to add to the lifecycle
@param stage The stage to add the lifecycle at
... | java | public <T> T addMaybeStartStartCloseInstance(T o, Stage stage) throws Exception
{
addMaybeStartHandler(new StartCloseHandler(o), stage);
return o;
} | [
"public",
"<",
"T",
">",
"T",
"addMaybeStartStartCloseInstance",
"(",
"T",
"o",
",",
"Stage",
"stage",
")",
"throws",
"Exception",
"{",
"addMaybeStartHandler",
"(",
"new",
"StartCloseHandler",
"(",
"o",
")",
",",
"stage",
")",
";",
"return",
"o",
";",
"}"
... | Adds an instance with a start() and/or close() method to the Lifecycle and starts it if the lifecycle has
already been started.
@param o The object to add to the lifecycle
@param stage The stage to add the lifecycle at
@throws Exception {@link Lifecycle#addMaybeStartHandler(Handler, Stage)} | [
"Adds",
"an",
"instance",
"with",
"a",
"start",
"()",
"and",
"/",
"or",
"close",
"()",
"method",
"to",
"the",
"Lifecycle",
"and",
"starts",
"it",
"if",
"the",
"lifecycle",
"has",
"already",
"been",
"started",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java#L263-L267 |
sarxos/v4l4j | src/main/java/au/edu/jcu/v4l4j/ImageFormatList.java | ImageFormatList.sortLists | private void sortLists() {
"""
This method sorts the {@link #JPEGformats}, {@link #RGBformats},
{@link #BGRformats}, {@link #YUV420formats} & {@link #YVU420formats}
lists, so that formats more suited to conversion are first.
"""
//sort RGBformats
//if native RGB24 is supported, put it first
moveToFirst... | java | private void sortLists(){
//sort RGBformats
//if native RGB24 is supported, put it first
moveToFirstIfNative(RGBformats, V4L4JConstants.IMF_RGB24);
//sort BGRformats
//if native BGR24 is supported, put it first
moveToFirstIfNative(BGRformats, V4L4JConstants.IMF_BGR24);
//sort YUV420formats
//if na... | [
"private",
"void",
"sortLists",
"(",
")",
"{",
"//sort RGBformats",
"//if native RGB24 is supported, put it first",
"moveToFirstIfNative",
"(",
"RGBformats",
",",
"V4L4JConstants",
".",
"IMF_RGB24",
")",
";",
"//sort BGRformats",
"//if native BGR24 is supported, put it first",
... | This method sorts the {@link #JPEGformats}, {@link #RGBformats},
{@link #BGRformats}, {@link #YUV420formats} & {@link #YVU420formats}
lists, so that formats more suited to conversion are first. | [
"This",
"method",
"sorts",
"the",
"{"
] | train | https://github.com/sarxos/v4l4j/blob/4fc0eec2c3a1a4260593f6ac03b7a8013e3804c9/src/main/java/au/edu/jcu/v4l4j/ImageFormatList.java#L120-L154 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineExtensionImagesInner.java | VirtualMachineExtensionImagesInner.listVersions | public List<VirtualMachineExtensionImageInner> listVersions(String location, String publisherName, String type, String filter, Integer top, String orderby) {
"""
Gets a list of virtual machine extension image versions.
@param location The name of a supported Azure region.
@param publisherName the String value
... | java | public List<VirtualMachineExtensionImageInner> listVersions(String location, String publisherName, String type, String filter, Integer top, String orderby) {
return listVersionsWithServiceResponseAsync(location, publisherName, type, filter, top, orderby).toBlocking().single().body();
} | [
"public",
"List",
"<",
"VirtualMachineExtensionImageInner",
">",
"listVersions",
"(",
"String",
"location",
",",
"String",
"publisherName",
",",
"String",
"type",
",",
"String",
"filter",
",",
"Integer",
"top",
",",
"String",
"orderby",
")",
"{",
"return",
"list... | Gets a list of virtual machine extension image versions.
@param location The name of a supported Azure region.
@param publisherName the String value
@param type the String value
@param filter The filter to apply on the operation.
@param top the Integer value
@param orderby the String value
@throws IllegalArgumentExcep... | [
"Gets",
"a",
"list",
"of",
"virtual",
"machine",
"extension",
"image",
"versions",
"."
] | 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/VirtualMachineExtensionImagesInner.java#L358-L360 |
apache/groovy | subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java | GPathResult.putAt | public void putAt(final int index, final Object newValue) {
"""
A helper method to allow GPathResults to work with subscript operators
@param index an index
@param newValue the value to put at the given index
"""
final GPathResult result = (GPathResult)getAt(index);
if (newValue instanceof Cl... | java | public void putAt(final int index, final Object newValue) {
final GPathResult result = (GPathResult)getAt(index);
if (newValue instanceof Closure) {
result.replaceNode((Closure)newValue);
} else {
result.replaceBody(newValue);
}
} | [
"public",
"void",
"putAt",
"(",
"final",
"int",
"index",
",",
"final",
"Object",
"newValue",
")",
"{",
"final",
"GPathResult",
"result",
"=",
"(",
"GPathResult",
")",
"getAt",
"(",
"index",
")",
";",
"if",
"(",
"newValue",
"instanceof",
"Closure",
")",
"... | A helper method to allow GPathResults to work with subscript operators
@param index an index
@param newValue the value to put at the given index | [
"A",
"helper",
"method",
"to",
"allow",
"GPathResults",
"to",
"work",
"with",
"subscript",
"operators"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java#L477-L484 |
alkacon/opencms-core | src/org/opencms/util/CmsMacroResolver.java | CmsMacroResolver.updateFile | private static void updateFile(CmsObject cms, CmsFile file, CmsMacroResolver macroResolver) throws CmsException {
"""
Updates a single file with the given macro resolver.<p>
@param cms the cms context
@param file the file to update
@param macroResolver the macro resolver to update with
@throws CmsException... | java | private static void updateFile(CmsObject cms, CmsFile file, CmsMacroResolver macroResolver) throws CmsException {
String encoding = cms.readPropertyObject(file, CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, true).getValue(
OpenCms.getSystemInfo().getDefaultEncoding());
String content;
... | [
"private",
"static",
"void",
"updateFile",
"(",
"CmsObject",
"cms",
",",
"CmsFile",
"file",
",",
"CmsMacroResolver",
"macroResolver",
")",
"throws",
"CmsException",
"{",
"String",
"encoding",
"=",
"cms",
".",
"readPropertyObject",
"(",
"file",
",",
"CmsPropertyDef... | Updates a single file with the given macro resolver.<p>
@param cms the cms context
@param file the file to update
@param macroResolver the macro resolver to update with
@throws CmsException if something goes wrong | [
"Updates",
"a",
"single",
"file",
"with",
"the",
"given",
"macro",
"resolver",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsMacroResolver.java#L712-L739 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.