repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/util/OperationOutcomeUtil.java | OperationOutcomeUtil.addIssue | public static void addIssue(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome, String theSeverity, String theDetails, String theLocation, String theCode) {
IBase issue = createIssue(theCtx, theOperationOutcome);
populateDetails(theCtx, issue, theSeverity, theDetails, theLocation, theCode);
} | java | public static void addIssue(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome, String theSeverity, String theDetails, String theLocation, String theCode) {
IBase issue = createIssue(theCtx, theOperationOutcome);
populateDetails(theCtx, issue, theSeverity, theDetails, theLocation, theCode);
} | [
"public",
"static",
"void",
"addIssue",
"(",
"FhirContext",
"theCtx",
",",
"IBaseOperationOutcome",
"theOperationOutcome",
",",
"String",
"theSeverity",
",",
"String",
"theDetails",
",",
"String",
"theLocation",
",",
"String",
"theCode",
")",
"{",
"IBase",
"issue",
... | Add an issue to an OperationOutcome
@param theCtx
The fhir context
@param theOperationOutcome
The OO resource to add to
@param theSeverity
The severity (fatal | error | warning | information)
@param theDetails
The details string
@param theCode | [
"Add",
"an",
"issue",
"to",
"an",
"OperationOutcome"
] | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/OperationOutcomeUtil.java#L57-L60 | train | Add an issue to the operation | Of course, here is the Java code you requested:
```java
public static void addIssue(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome, String theSeverity, String theDetails, String theLocation, String theCode) {
IBase issue = createIssue(theCtx, theOperationOutcome);
populateDetails(theCtx, issue, theS... |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/TaskInputOutputContext.java | TaskInputOutputContext.write | public void write(KEYOUT key, VALUEOUT value
) throws IOException, InterruptedException {
output.write(key, value);
} | java | public void write(KEYOUT key, VALUEOUT value
) throws IOException, InterruptedException {
output.write(key, value);
} | [
"public",
"void",
"write",
"(",
"KEYOUT",
"key",
",",
"VALUEOUT",
"value",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"output",
".",
"write",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Generate an output key/value pair. | [
"Generate",
"an",
"output",
"key",
"/",
"value",
"pair",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/TaskInputOutputContext.java#L78-L81 | train | Write a key value pair to the output stream. | Of course, here is the Java code you requested:
```java
public void write(KEYOUT key, VALUEOUT value
) throws IOException, InterruptedException {
output.write(key, value);
}
```
Hope this helps! |
litsec/swedish-eid-shibboleth-base | shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/controller/AbstractExternalAuthenticationController.java | AbstractExternalAuthenticationController.getPrincipalSelection | protected PrincipalSelection getPrincipalSelection(ProfileRequestContext<?, ?> context) {
final AuthnRequest authnRequest = this.getAuthnRequest(context);
if (authnRequest != null && authnRequest.getExtensions() != null) {
return authnRequest.getExtensions()
.getUnknownXMLObjects()
.stream... | java | protected PrincipalSelection getPrincipalSelection(ProfileRequestContext<?, ?> context) {
final AuthnRequest authnRequest = this.getAuthnRequest(context);
if (authnRequest != null && authnRequest.getExtensions() != null) {
return authnRequest.getExtensions()
.getUnknownXMLObjects()
.stream... | [
"protected",
"PrincipalSelection",
"getPrincipalSelection",
"(",
"ProfileRequestContext",
"<",
"?",
",",
"?",
">",
"context",
")",
"{",
"final",
"AuthnRequest",
"authnRequest",
"=",
"this",
".",
"getAuthnRequest",
"(",
"context",
")",
";",
"if",
"(",
"authnRequest... | Utility method that may be used to obtain the {@link PrincipalSelection} extension that may be received in an
{@code AuthnRequest}.
@param context
the profile context
@return the {@code PrincipalSelection} extension, or {@code null} if none is found in the current
{@code AuthnRequest} | [
"Utility",
"method",
"that",
"may",
"be",
"used",
"to",
"obtain",
"the",
"{",
"@link",
"PrincipalSelection",
"}",
"extension",
"that",
"may",
"be",
"received",
"in",
"an",
"{",
"@code",
"AuthnRequest",
"}",
"."
] | aaaa467ff61f07d7dfa31627fb36851a37da6804 | https://github.com/litsec/swedish-eid-shibboleth-base/blob/aaaa467ff61f07d7dfa31627fb36851a37da6804/shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/controller/AbstractExternalAuthenticationController.java#L555-L567 | train | Gets the principal selection. | Of course, here is the Java code you requested:
```java
protected PrincipalSelection getPrincipalSelection(ProfileRequestContext<?, ?> context) {
final AuthnRequest authnRequest = this.getAuthnRequest(context);
if (authnRequest != null && authnRequest.getExtensions() != null) {
return authnRequest.getExt... |
shevek/qemu-java | qemu-qapi/src/main/java/org/anarres/qemu/qapi/api/KeyValue.java | KeyValue.number | @Nonnull
public static KeyValue number(@Nonnull java.lang.Long number) {
KeyValue self = new KeyValue();
self.type = Discriminator.number;
self.number = number;
return self;
} | java | @Nonnull
public static KeyValue number(@Nonnull java.lang.Long number) {
KeyValue self = new KeyValue();
self.type = Discriminator.number;
self.number = number;
return self;
} | [
"@",
"Nonnull",
"public",
"static",
"KeyValue",
"number",
"(",
"@",
"Nonnull",
"java",
".",
"lang",
".",
"Long",
"number",
")",
"{",
"KeyValue",
"self",
"=",
"new",
"KeyValue",
"(",
")",
";",
"self",
".",
"type",
"=",
"Discriminator",
".",
"number",
";... | } | [
"}"
] | ef4cc2c991df36d5f450b49ec8e341f6ed3362f2 | https://github.com/shevek/qemu-java/blob/ef4cc2c991df36d5f450b49ec8e341f6ed3362f2/qemu-qapi/src/main/java/org/anarres/qemu/qapi/api/KeyValue.java#L49-L55 | train | Create a KeyValue with a number value. | Of course, here is the Java code you requested:
```java
@Nonnull
public static KeyValue number(@Nonnull java.lang.Long number) {
KeyValue self = new KeyValue();
self.type = Discriminator.number;
self.number = number;
return self;
}
```
Hope this helps! |
unbescape/unbescape | src/main/java/org/unbescape/css/CssEscape.java | CssEscape.escapeCssIdentifier | public static String escapeCssIdentifier(final String text,
final CssIdentifierEscapeType type, final CssIdentifierEscapeLevel level) {
if (type == null) {
throw new IllegalArgumentException("The 'type' argument cannot be null");
}
if (level... | java | public static String escapeCssIdentifier(final String text,
final CssIdentifierEscapeType type, final CssIdentifierEscapeLevel level) {
if (type == null) {
throw new IllegalArgumentException("The 'type' argument cannot be null");
}
if (level... | [
"public",
"static",
"String",
"escapeCssIdentifier",
"(",
"final",
"String",
"text",
",",
"final",
"CssIdentifierEscapeType",
"type",
",",
"final",
"CssIdentifierEscapeLevel",
"level",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"Illegal... | <p>
Perform a (configurable) CSS Identifier <strong>escape</strong> operation on a <tt>String</tt> input.
</p>
<p>
This method will perform an escape operation according to the specified
{@link CssIdentifierEscapeType} and
{@link CssIdentifierEscapeLevel} argument values.
</p>
<p>
All other <tt>String</tt>-based <tt>es... | [
"<p",
">",
"Perform",
"a",
"(",
"configurable",
")",
"CSS",
"Identifier",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"method",
"... | ec5435fb3508c2eed25d8165dc27ded2602cae13 | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/css/CssEscape.java#L1000-L1013 | train | Escape a CSS identifier. | Of course, here is the Java code you requested:
```java
public static String escapeCssIdentifier(final String text,
final CssIdentifierEscapeType type, final CssIdentifierEscapeLevel level) {
if (type == null) {
throw new IllegalArgumentException("The 'type... |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/util/SystemEnvironment.java | SystemEnvironment.getOSFamily | public static OSFamily getOSFamily() {
String name = System.getProperty("os.name").toLowerCase(Locale.US);
if (name.contains("windows")) {
if (name.contains("95") ||
name.contains("98") ||
name.contains("me") ||
name.contains("ce"))
return OSFamily.win9x;
return OSFamily.windows;
}
if (nam... | java | public static OSFamily getOSFamily() {
String name = System.getProperty("os.name").toLowerCase(Locale.US);
if (name.contains("windows")) {
if (name.contains("95") ||
name.contains("98") ||
name.contains("me") ||
name.contains("ce"))
return OSFamily.win9x;
return OSFamily.windows;
}
if (nam... | [
"public",
"static",
"OSFamily",
"getOSFamily",
"(",
")",
"{",
"String",
"name",
"=",
"System",
".",
"getProperty",
"(",
"\"os.name\"",
")",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
";",
"if",
"(",
"name",
".",
"contains",
"(",
"\"windows\"",
")... | Returns the type of operating system. | [
"Returns",
"the",
"type",
"of",
"operating",
"system",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/util/SystemEnvironment.java#L35-L65 | train | Get the OS family for the current platform. | Of course, here is the Java code you requested:
```java
public static OSFamily getOSFamily() {
String name = System.getProperty("os.name").toLowerCase(Locale.US);
if (name.contains("windows")) {
if (name.contains("95") ||
name.contains("98") ||
name.contains("me") ||
name.contains("ce"))
return ... |
kiegroup/jbpm-designer | jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java | JSONBuilder.parseStencilSet | private static JSONObject parseStencilSet(StencilSet stencilSet) throws JSONException {
if (stencilSet != null) {
JSONObject stencilSetObject = new JSONObject();
stencilSetObject.put("url",
stencilSet.getUrl().toString());
stencilSetObject.pu... | java | private static JSONObject parseStencilSet(StencilSet stencilSet) throws JSONException {
if (stencilSet != null) {
JSONObject stencilSetObject = new JSONObject();
stencilSetObject.put("url",
stencilSet.getUrl().toString());
stencilSetObject.pu... | [
"private",
"static",
"JSONObject",
"parseStencilSet",
"(",
"StencilSet",
"stencilSet",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"stencilSet",
"!=",
"null",
")",
"{",
"JSONObject",
"stencilSetObject",
"=",
"new",
"JSONObject",
"(",
")",
";",
"stencilSetObjec... | Delivers the correct JSON Object for the Stencilset
@param stencilSet
@throws org.json.JSONException | [
"Delivers",
"the",
"correct",
"JSON",
"Object",
"for",
"the",
"Stencilset"
] | 97b048d06f083a1f831c971c2e9fdfd0952d2b0b | https://github.com/kiegroup/jbpm-designer/blob/97b048d06f083a1f831c971c2e9fdfd0952d2b0b/jbpm-designer-backend/src/main/java/org/jbpm/designer/server/diagram/JSONBuilder.java#L249-L262 | train | A method to parse a StencilSet object. | Of course, here is the Java code you requested:
```java
private static JSONObject parseStencilSet(StencilSet stencilSet) throws JSONException {
if (stencilSet != null) {
JSONObject stencilSetObject = new JSONObject();
stencilSetObject.put("url",
stencil... |
haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/CopyDither.java | CopyDither.getPoint2D | public final Point2D getPoint2D(Point2D pSrcPt, Point2D pDstPt) {
// Create new Point, if needed
if (pDstPt == null) {
pDstPt = new Point2D.Float();
}
// Copy location
pDstPt.setLocation(pSrcPt.getX(), pSrcPt.getY());
// Return dest
return ... | java | public final Point2D getPoint2D(Point2D pSrcPt, Point2D pDstPt) {
// Create new Point, if needed
if (pDstPt == null) {
pDstPt = new Point2D.Float();
}
// Copy location
pDstPt.setLocation(pSrcPt.getX(), pSrcPt.getY());
// Return dest
return ... | [
"public",
"final",
"Point2D",
"getPoint2D",
"(",
"Point2D",
"pSrcPt",
",",
"Point2D",
"pDstPt",
")",
"{",
"// Create new Point, if needed\r",
"if",
"(",
"pDstPt",
"==",
"null",
")",
"{",
"pDstPt",
"=",
"new",
"Point2D",
".",
"Float",
"(",
")",
";",
"}",
"/... | Returns the location of the destination point given a
point in the source. If {@code dstPt} is not
{@code null}, it will be used to hold the return value.
Since this is not a geometric operation, the {@code srcPt}
will equal the {@code dstPt}.
@param pSrcPt a {@code Point2D} that represents a point
in the source image... | [
"Returns",
"the",
"location",
"of",
"the",
"destination",
"point",
"given",
"a",
"point",
"in",
"the",
"source",
".",
"If",
"{"
] | 7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/CopyDither.java#L147-L158 | train | Gets the Point2D from the source Point and writes it to the destination Point2D. | Of course, here is the Java code you requested:
```java
public final Point2D getPoint2D(Point2D pSrcPt, Point2D pDstPt) {
// Create new Point, if needed
if (pDstPt == null) {
pDstPt = new Point2D.Float();
}
// Copy location
pDstPt.setLocation(pSrcPt.getX(), p... |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/dom3/DOM3TreeWalker.java | DOM3TreeWalker.serializeAttList | protected void serializeAttList(Element node) throws SAXException {
NamedNodeMap atts = node.getAttributes();
int nAttrs = atts.getLength();
for (int i = 0; i < nAttrs; i++) {
Node attr = atts.item(i);
String localName = attr.getLocalName();
String attrName ... | java | protected void serializeAttList(Element node) throws SAXException {
NamedNodeMap atts = node.getAttributes();
int nAttrs = atts.getLength();
for (int i = 0; i < nAttrs; i++) {
Node attr = atts.item(i);
String localName = attr.getLocalName();
String attrName ... | [
"protected",
"void",
"serializeAttList",
"(",
"Element",
"node",
")",
"throws",
"SAXException",
"{",
"NamedNodeMap",
"atts",
"=",
"node",
".",
"getAttributes",
"(",
")",
";",
"int",
"nAttrs",
"=",
"atts",
".",
"getLength",
"(",
")",
";",
"for",
"(",
"int",... | Serializes the Attr Nodes of an Element.
@param node The OwnerElement whose Attr Nodes are to be serialized. | [
"Serializes",
"the",
"Attr",
"Nodes",
"of",
"an",
"Element",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/dom3/DOM3TreeWalker.java#L663-L880 | train | Serialize an Attribute list. | Of course, here is the Java code you requested:
```java
protected void serializeAttList(Element node) throws SAXException {
NamedNodeMap atts = node.getAttributes();
int nAttrs = atts.getLength();
for (int i = 0; i < nAttrs; i++) {
Node attr = atts.item(i);
String loca... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsQueueBrowserImpl.java | JmsQueueBrowserImpl.close | @Override
public void close() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "close");
int originalState = 0;
Object[] enumCopy = null;
synchronized (enums) {
// Save the state of the closed flag before we update it ... | java | @Override
public void close() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "close");
int originalState = 0;
Object[] enumCopy = null;
synchronized (enums) {
// Save the state of the closed flag before we update it ... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"close\"",
")",
";",
... | /*
(non-Javadoc)
@see javax.jms.QueueBrowser#close() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsQueueBrowserImpl.java#L260-L295 | train | Close the enumeration list. | Of course, here is the Java code you requested:
```java
@Override
public void close() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "close");
int originalState = 0;
Object[] enumCopy = null;
synchronized (enums) {
... |
leancloud/java-sdk-all | realtime/src/main/java/cn/leancloud/im/v2/AVIMConversationsQuery.java | AVIMConversationsQuery.whereContainsIn | public AVIMConversationsQuery whereContainsIn(String key, Collection<?> value) {
conditions.whereContainedIn(key, value);
return this;
} | java | public AVIMConversationsQuery whereContainsIn(String key, Collection<?> value) {
conditions.whereContainedIn(key, value);
return this;
} | [
"public",
"AVIMConversationsQuery",
"whereContainsIn",
"(",
"String",
"key",
",",
"Collection",
"<",
"?",
">",
"value",
")",
"{",
"conditions",
".",
"whereContainedIn",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | 增加查询条件,当conversation的属性中对应的字段对应的值包含在指定值中时即可返回
@param key
@param value
@return | [
"增加查询条件,当conversation的属性中对应的字段对应的值包含在指定值中时即可返回"
] | 323f8e7ee38051b1350790e5192304768c5c9f5f | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversationsQuery.java#L164-L167 | train | Add a constraint to the query that requires a particular key s value to be contained in a collection of AVIMConversations. | Of course, here is the Java code you requested:
```java
public AVIMConversationsQuery whereContainsIn(String key, Collection<?> value) {
conditions.whereContainedIn(key, value);
return this;
}
```
Hope this helps! |
causecode/nucleus | src/main/java/com/causecode/util/Hashids.java | Hashids.encode | public String encode(long... numbers){
String retval = "";
if(numbers.length == 0) {
return retval;
}
return this._encode(numbers);
} | java | public String encode(long... numbers){
String retval = "";
if(numbers.length == 0) {
return retval;
}
return this._encode(numbers);
} | [
"public",
"String",
"encode",
"(",
"long",
"...",
"numbers",
")",
"{",
"String",
"retval",
"=",
"\"\"",
";",
"if",
"(",
"numbers",
".",
"length",
"==",
"0",
")",
"{",
"return",
"retval",
";",
"}",
"return",
"this",
".",
"_encode",
"(",
"numbers",
")"... | Encrypt numbers to string
@param numbers the numbers to encrypt
@return the encrypt string | [
"Encrypt",
"numbers",
"to",
"string"
] | 2acb0c2b6343433508c6476965e9ee8a18916a54 | https://github.com/causecode/nucleus/blob/2acb0c2b6343433508c6476965e9ee8a18916a54/src/main/java/com/causecode/util/Hashids.java#L149-L156 | train | Encode a sequence of numbers into a sequence of UTF - 8 characters. | Of course, here is the Java code you requested:
```java
public String encode(long... numbers){
String retval = "";
if(numbers.length == 0) {
return retval;
}
return this._encode(numbers);
}
```
Hope this helps! |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listCapacities | public PagedList<StampCapacityInner> listCapacities(final String resourceGroupName, final String name) {
ServiceResponse<Page<StampCapacityInner>> response = listCapacitiesSinglePageAsync(resourceGroupName, name).toBlocking().single();
return new PagedList<StampCapacityInner>(response.body()) {
... | java | public PagedList<StampCapacityInner> listCapacities(final String resourceGroupName, final String name) {
ServiceResponse<Page<StampCapacityInner>> response = listCapacitiesSinglePageAsync(resourceGroupName, name).toBlocking().single();
return new PagedList<StampCapacityInner>(response.body()) {
... | [
"public",
"PagedList",
"<",
"StampCapacityInner",
">",
"listCapacities",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"ServiceResponse",
"<",
"Page",
"<",
"StampCapacityInner",
">>",
"response",
"=",
"listCapacitiesSinglePageA... | Get the used, available, and total worker capacity an App Service Environment.
Get the used, available, and total worker capacity an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentExcept... | [
"Get",
"the",
"used",
"available",
"and",
"total",
"worker",
"capacity",
"an",
"App",
"Service",
"Environment",
".",
"Get",
"the",
"used",
"available",
"and",
"total",
"worker",
"capacity",
"an",
"App",
"Service",
"Environment",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L1298-L1306 | train | Gets a list of all the CA CA. | Of course, here is the Java code you requested:
```java
public PagedList<StampCapacityInner> listCapacities(final String resourceGroupName, final String name) {
ServiceResponse<Page<StampCapacityInner>> response = listCapacitiesSinglePageAsync(resourceGroupName, name).toBlocking().single();
return new ... |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/dialog/factories/JDialogFactory.java | JDialogFactory.newJDialog | public static JDialog newJDialog(@NonNull JOptionPane pane, String title)
{
return newJDialog(null, pane, title);
} | java | public static JDialog newJDialog(@NonNull JOptionPane pane, String title)
{
return newJDialog(null, pane, title);
} | [
"public",
"static",
"JDialog",
"newJDialog",
"(",
"@",
"NonNull",
"JOptionPane",
"pane",
",",
"String",
"title",
")",
"{",
"return",
"newJDialog",
"(",
"null",
",",
"pane",
",",
"title",
")",
";",
"}"
] | Factory method for create a {@link JDialog} object over the given {@link JOptionPane}
@param pane
the pane
@param title
the title
@return the new {@link JDialog} | [
"Factory",
"method",
"for",
"create",
"a",
"{",
"@link",
"JDialog",
"}",
"object",
"over",
"the",
"given",
"{",
"@link",
"JOptionPane",
"}"
] | 4045e85cabd8f0ce985cbfff134c3c9873930c79 | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/dialog/factories/JDialogFactory.java#L113-L116 | train | Creates a new JDialog with a JOptionPane and title. | Of course, here is the Java code you requested:
```java
public static JDialog newJDialog(@NonNull JOptionPane pane, String title)
{
return newJDialog(null, pane, title);
}
```
Hope this helps! |
unbescape/unbescape | src/main/java/org/unbescape/html/HtmlEscape.java | HtmlEscape.escapeHtml4Xml | public static String escapeHtml4Xml(final String text) {
return escapeHtml(text, HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_1_ONLY_MARKUP_SIGNIFICANT);
} | java | public static String escapeHtml4Xml(final String text) {
return escapeHtml(text, HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_1_ONLY_MARKUP_SIGNIFICANT);
} | [
"public",
"static",
"String",
"escapeHtml4Xml",
"(",
"final",
"String",
"text",
")",
"{",
"return",
"escapeHtml",
"(",
"text",
",",
"HtmlEscapeType",
".",
"HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL",
",",
"HtmlEscapeLevel",
".",
"LEVEL_1_ONLY_MARKUP_SIGNIFICANT",
")",
"... | <p>
Perform an HTML 4 level 1 (XML-style) <strong>escape</strong> operation on a <tt>String</tt> input.
</p>
<p>
<em>Level 1</em> means this method will only escape the five markup-significant characters:
<tt><</tt>, <tt>></tt>, <tt>&</tt>, <tt>"</tt> and <tt>'</tt>. It is called
<em>XML-style</em> i... | [
"<p",
">",
"Perform",
"an",
"HTML",
"4",
"level",
"1",
"(",
"XML",
"-",
"style",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<e... | ec5435fb3508c2eed25d8165dc27ded2602cae13 | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L315-L318 | train | Escape HTML4 XML. | Of course, here is the Java code you requested:
```java
public static String escapeHtml4Xml(final String text) {
return escapeHtml(text, HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_1_ONLY_MARKUP_SIGNIFICANT);
}
```
Hope this helps! |
whitesource/fs-agent | src/main/java/org/whitesource/agent/TempFolders.java | TempFolders.deleteTempFolders | public void deleteTempFolders() {
deleteTempFoldersHelper(PATH_TO_UNIQUE_HTML_TEMP_FOLDER);
deleteTempFoldersHelper(PATH_TO_UNIQUE_GRADLE_TEMP_FOLDER);
deleteTempFoldersHelper(PATH_TO_UNIQUE_DOTNET_TEMP_FOLDER);
deleteTempFoldersHelper(PATH_TO_UNIQUE_PYTHON_TEMP_FOLDER);
deleteTe... | java | public void deleteTempFolders() {
deleteTempFoldersHelper(PATH_TO_UNIQUE_HTML_TEMP_FOLDER);
deleteTempFoldersHelper(PATH_TO_UNIQUE_GRADLE_TEMP_FOLDER);
deleteTempFoldersHelper(PATH_TO_UNIQUE_DOTNET_TEMP_FOLDER);
deleteTempFoldersHelper(PATH_TO_UNIQUE_PYTHON_TEMP_FOLDER);
deleteTe... | [
"public",
"void",
"deleteTempFolders",
"(",
")",
"{",
"deleteTempFoldersHelper",
"(",
"PATH_TO_UNIQUE_HTML_TEMP_FOLDER",
")",
";",
"deleteTempFoldersHelper",
"(",
"PATH_TO_UNIQUE_GRADLE_TEMP_FOLDER",
")",
";",
"deleteTempFoldersHelper",
"(",
"PATH_TO_UNIQUE_DOTNET_TEMP_FOLDER",
... | /* --- Methods --- | [
"/",
"*",
"---",
"Methods",
"---"
] | d6ee4842c4f08f4aeda7eb2307b24c49b6bed0e1 | https://github.com/whitesource/fs-agent/blob/d6ee4842c4f08f4aeda7eb2307b24c49b6bed0e1/src/main/java/org/whitesource/agent/TempFolders.java#L52-L61 | train | Delete all temp folders in the current directory | Of course, here is the Java code you requested:
```java
public void deleteTempFolders() {
deleteTempFoldersHelper(PATH_TO_UNIQUE_HTML_TEMP_FOLDER);
deleteTempFoldersHelper(PATH_TO_UNIQUE_GRADLE_TEMP_FOLDER);
deleteTempFoldersHelper(PATH_TO_UNIQUE_DOTNET_TEMP_FOLDER);
deleteTempFoldersHe... |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrie.java | CharsTrie.readValue | private static int readValue(CharSequence chars, int pos, int leadUnit) {
int value;
if(leadUnit<kMinTwoUnitValueLead) {
value=leadUnit;
} else if(leadUnit<kThreeUnitValueLead) {
value=((leadUnit-kMinTwoUnitValueLead)<<16)|chars.charAt(pos);
} else {
v... | java | private static int readValue(CharSequence chars, int pos, int leadUnit) {
int value;
if(leadUnit<kMinTwoUnitValueLead) {
value=leadUnit;
} else if(leadUnit<kThreeUnitValueLead) {
value=((leadUnit-kMinTwoUnitValueLead)<<16)|chars.charAt(pos);
} else {
v... | [
"private",
"static",
"int",
"readValue",
"(",
"CharSequence",
"chars",
",",
"int",
"pos",
",",
"int",
"leadUnit",
")",
"{",
"int",
"value",
";",
"if",
"(",
"leadUnit",
"<",
"kMinTwoUnitValueLead",
")",
"{",
"value",
"=",
"leadUnit",
";",
"}",
"else",
"if... | pos is already after the leadUnit, and the lead unit has bit 15 reset. | [
"pos",
"is",
"already",
"after",
"the",
"leadUnit",
"and",
"the",
"lead",
"unit",
"has",
"bit",
"15",
"reset",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrie.java#L627-L637 | train | read value from char sequence. | Of course, here is the Java code you requested:
```java
private static int readValue(CharSequence chars, int pos, int leadUnit) {
int value;
if(leadUnit<kMinTwoUnitValueLead) {
value=leadUnit;
} else if(leadUnit<kThreeUnitValueLead) {
value=((leadUnit-kMinTwoUnitValueLea... |
httl/httl | httl/src/main/java/httl/Engine.java | Engine.getProperty | public int getProperty(String key, int defaultValue) {
String value = getProperty(key, String.class);
return StringUtils.isEmpty(value) ? defaultValue : Integer.parseInt(value);
} | java | public int getProperty(String key, int defaultValue) {
String value = getProperty(key, String.class);
return StringUtils.isEmpty(value) ? defaultValue : Integer.parseInt(value);
} | [
"public",
"int",
"getProperty",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getProperty",
"(",
"key",
",",
"String",
".",
"class",
")",
";",
"return",
"StringUtils",
".",
"isEmpty",
"(",
"value",
")",
"?",
"defaul... | Get config int value.
@param key - config key
@param defaultValue - default int value
@return config int value
@see #getEngine() | [
"Get",
"config",
"int",
"value",
"."
] | e13e00f4ab41252a8f53d6dafd4a6610be9dcaad | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/Engine.java#L220-L223 | train | Get the value of the property as an int. | Of course, here is the Java code you requested:
```java
public int getProperty(String key, int defaultValue) {
String value = getProperty(key, String.class);
return StringUtils.isEmpty(value) ? defaultValue : Integer.parseInt(value);
}
```
Hope this helps! |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelReader.java | ExcelReader.read | public List<Map<String, Object>> read(int headerRowIndex, int startRowIndex, int endRowIndex) {
checkNotClosed();
// 边界判断
final int firstRowNum = sheet.getFirstRowNum();
final int lastRowNum = sheet.getLastRowNum();
if (headerRowIndex < firstRowNum) {
throw new IndexOutOfBoundsException(StrUtil.forma... | java | public List<Map<String, Object>> read(int headerRowIndex, int startRowIndex, int endRowIndex) {
checkNotClosed();
// 边界判断
final int firstRowNum = sheet.getFirstRowNum();
final int lastRowNum = sheet.getLastRowNum();
if (headerRowIndex < firstRowNum) {
throw new IndexOutOfBoundsException(StrUtil.forma... | [
"public",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"read",
"(",
"int",
"headerRowIndex",
",",
"int",
"startRowIndex",
",",
"int",
"endRowIndex",
")",
"{",
"checkNotClosed",
"(",
")",
";",
"// 边界判断\r",
"final",
"int",
"firstRowNum",
"=",
... | 读取Excel为Map的列表<br>
Map表示一行,标题为key,单元格内容为value
@param headerRowIndex 标题所在行,如果标题行在读取的内容行中间,这行做为数据将忽略
@param startRowIndex 起始行(包含,从0开始计数)
@param endRowIndex 读取结束行(包含,从0开始计数)
@return Map的列表 | [
"读取Excel为Map的列表<br",
">",
"Map表示一行,标题为key,单元格内容为value"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelReader.java#L280-L311 | train | Reads a range of data from the specified range of rows from the specified sheet. | Of course, here is the Java code you requested:
```java
public List<Map<String, Object>> read(int headerRowIndex, int startRowIndex, int endRowIndex) {
checkNotClosed();
// 边界判断
final int firstRowNum = sheet.getFirstRowNum();
final int lastRowNum = sheet.getLastRowNum();
if (headerRowIndex < firstRowNum... |
aws/aws-sdk-java | aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/transform/HlsEncryptionSettingsMarshaller.java | HlsEncryptionSettingsMarshaller.marshall | public void marshall(HlsEncryptionSettings hlsEncryptionSettings, ProtocolMarshaller protocolMarshaller) {
if (hlsEncryptionSettings == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(hlsEncryptionSet... | java | public void marshall(HlsEncryptionSettings hlsEncryptionSettings, ProtocolMarshaller protocolMarshaller) {
if (hlsEncryptionSettings == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(hlsEncryptionSet... | [
"public",
"void",
"marshall",
"(",
"HlsEncryptionSettings",
"hlsEncryptionSettings",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"hlsEncryptionSettings",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passe... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/transform/HlsEncryptionSettingsMarshaller.java#L54-L71 | train | marshalls the given hlsEncryptionSettings to the JSON object. | Of course, here is the Java code you requested:
```java
public void marshall(HlsEncryptionSettings hlsEncryptionSettings, ProtocolMarshaller protocolMarshaller) {
if (hlsEncryptionSettings == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {... |
streamsets/datacollector | common/src/main/java/com/streamsets/pipeline/lib/parser/shaded/com/google/code/regexp/Pattern.java | Pattern.isSlashEscapedChar | static private boolean isSlashEscapedChar(String s, int pos) {
// Count the backslashes preceding this position. If it's
// even, there is no escape and the slashes are just literals.
// If it's odd, one of the slashes (the last one) is escaping
// the character at the given position.
... | java | static private boolean isSlashEscapedChar(String s, int pos) {
// Count the backslashes preceding this position. If it's
// even, there is no escape and the slashes are just literals.
// If it's odd, one of the slashes (the last one) is escaping
// the character at the given position.
... | [
"static",
"private",
"boolean",
"isSlashEscapedChar",
"(",
"String",
"s",
",",
"int",
"pos",
")",
"{",
"// Count the backslashes preceding this position. If it's",
"// even, there is no escape and the slashes are just literals.",
"// If it's odd, one of the slashes (the last one) is esca... | Determines if the character at the specified position
of a string is escaped with a backslash
@param s string to evaluate
@param pos the position of the character to evaluate
@return true if the character is escaped; otherwise false | [
"Determines",
"if",
"the",
"character",
"at",
"the",
"specified",
"position",
"of",
"a",
"string",
"is",
"escaped",
"with",
"a",
"backslash"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/common/src/main/java/com/streamsets/pipeline/lib/parser/shaded/com/google/code/regexp/Pattern.java#L304-L316 | test | isSlashEscapedChar This method checks if the given string contains a backslash character at the given position. | Of course, here is the Java code you requested:
```java
static private boolean isSlashEscapedChar(String s, int pos) {
// Count the backslashes preceding this position. If it's
// even, there is no escape and the slashes are just literals.
// If it's odd, one of the slashes (the last one) is e... |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/PageOverlayConditionalProcessingImpl.java | PageOverlayConditionalProcessingImpl.eIsSet | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.PAGE_OVERLAY_CONDITIONAL_PROCESSING__PG_OV_TYPE:
return PG_OV_TYPE_EDEFAULT == null ? pgOvType != null : !PG_OV_TYPE_EDEFAULT.equals(pgOvType);
case AfplibPackage.PAGE_OVERLAY_CONDITIONAL_PROCESSING__LEVEL:
return ... | java | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.PAGE_OVERLAY_CONDITIONAL_PROCESSING__PG_OV_TYPE:
return PG_OV_TYPE_EDEFAULT == null ? pgOvType != null : !PG_OV_TYPE_EDEFAULT.equals(pgOvType);
case AfplibPackage.PAGE_OVERLAY_CONDITIONAL_PROCESSING__LEVEL:
return ... | [
"@",
"Override",
"public",
"boolean",
"eIsSet",
"(",
"int",
"featureID",
")",
"{",
"switch",
"(",
"featureID",
")",
"{",
"case",
"AfplibPackage",
".",
"PAGE_OVERLAY_CONDITIONAL_PROCESSING__PG_OV_TYPE",
":",
"return",
"PG_OV_TYPE_EDEFAULT",
"==",
"null",
"?",
"pgOvTy... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/PageOverlayConditionalProcessingImpl.java#L189-L198 | train | Override the eIsSet method to check if the feature is set | Of course, here is the Java code you requested:
```java
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.PAGE_OVERLAY_CONDITIONAL_PROCESSING__PG_OV_TYPE:
return PG_OV_TYPE_EDEFAULT == null ? pgOvType != null : !PG_OV_TYPE_EDEFAULT.equals(pgOvType);
case AfplibPackag... |
trajano/caliper | examples/src/main/java/examples/StringBuilderBenchmark.java | StringBuilderBenchmark.reverseNoSurrogates | @Benchmark void reverseNoSurrogates(int reps) {
final int length = Math.min(this.length, MIN_SURROGATE);
StringBuilder sb = new StringBuilder();
for (int j = 0; j < length; j++) {
sb.appendCodePoint(j);
}
for (int i = 0; i < reps; i++) {
for (int j = 0; j < 4; j++) {
sb.reverse()... | java | @Benchmark void reverseNoSurrogates(int reps) {
final int length = Math.min(this.length, MIN_SURROGATE);
StringBuilder sb = new StringBuilder();
for (int j = 0; j < length; j++) {
sb.appendCodePoint(j);
}
for (int i = 0; i < reps; i++) {
for (int j = 0; j < 4; j++) {
sb.reverse()... | [
"@",
"Benchmark",
"void",
"reverseNoSurrogates",
"(",
"int",
"reps",
")",
"{",
"final",
"int",
"length",
"=",
"Math",
".",
"min",
"(",
"this",
".",
"length",
",",
"MIN_SURROGATE",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";... | Times .reverse() when no surrogates are present. | [
"Times",
".",
"reverse",
"()",
"when",
"no",
"surrogates",
"are",
"present",
"."
] | a8bcfd84fa9d7b893b3edfadc3b13240ae5cd658 | https://github.com/trajano/caliper/blob/a8bcfd84fa9d7b893b3edfadc3b13240ae5cd658/examples/src/main/java/examples/StringBuilderBenchmark.java#L143-L156 | train | Reverse the code points of the sequence. | Of course, here is the Java code you requested:
```java
@Benchmark void reverseNoSurrogates(int reps) {
final int length = Math.min(this.length, MIN_SURROGATE);
StringBuilder sb = new StringBuilder();
for (int j = 0; j < length; j++) {
sb.appendCodePoint(j);
}
for (int i = 0; i < reps; i++) {... |
ocelotds/ocelot | ocelot-core/src/main/java/org/ocelotds/messaging/JsTopicInterceptor.java | JsTopicInterceptor.getJsTopicNameAnnotation | JsTopicName getJsTopicNameAnnotation(Annotation[] parameterAnnotations) {
for (Annotation parameterAnnotation : parameterAnnotations) {
if (parameterAnnotation.annotationType().equals(JsTopicName.class)) {
return (JsTopicName) parameterAnnotation;
}
}
return null;
} | java | JsTopicName getJsTopicNameAnnotation(Annotation[] parameterAnnotations) {
for (Annotation parameterAnnotation : parameterAnnotations) {
if (parameterAnnotation.annotationType().equals(JsTopicName.class)) {
return (JsTopicName) parameterAnnotation;
}
}
return null;
} | [
"JsTopicName",
"getJsTopicNameAnnotation",
"(",
"Annotation",
"[",
"]",
"parameterAnnotations",
")",
"{",
"for",
"(",
"Annotation",
"parameterAnnotation",
":",
"parameterAnnotations",
")",
"{",
"if",
"(",
"parameterAnnotation",
".",
"annotationType",
"(",
")",
".",
... | Get JsTopicName annotation
@param parameterAnnotations
@param topic
@return | [
"Get",
"JsTopicName",
"annotation"
] | 5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7 | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-core/src/main/java/org/ocelotds/messaging/JsTopicInterceptor.java#L116-L123 | train | Gets the JsTopicName annotation from the given annotations. | Of course, here is the Java code you requested:
```java
JsTopicName getJsTopicNameAnnotation(Annotation[] parameterAnnotations) {
for (Annotation parameterAnnotation : parameterAnnotations) {
if (parameterAnnotation.annotationType().equals(JsTopicName.class)) {
return (JsTopicName) parameterAnnotation;
... |
aws/aws-sdk-java | aws-java-sdk-logs/src/main/java/com/amazonaws/services/logs/model/GetQueryResultsResult.java | GetQueryResultsResult.getResults | public java.util.List<java.util.List<ResultField>> getResults() {
if (results == null) {
results = new com.amazonaws.internal.SdkInternalList<java.util.List<ResultField>>();
}
return results;
} | java | public java.util.List<java.util.List<ResultField>> getResults() {
if (results == null) {
results = new com.amazonaws.internal.SdkInternalList<java.util.List<ResultField>>();
}
return results;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"java",
".",
"util",
".",
"List",
"<",
"ResultField",
">",
">",
"getResults",
"(",
")",
"{",
"if",
"(",
"results",
"==",
"null",
")",
"{",
"results",
"=",
"new",
"com",
".",
"amazonaws",
".",
"intern... | <p>
The log events that matched the query criteria during the most recent time it ran.
</p>
<p>
The <code>results</code> value is an array of arrays. Each log event is one object in the top-level array. Each
of these log event objects is an array of <code>field</code>/<code>value</code> pairs.
</p>
@return The log eve... | [
"<p",
">",
"The",
"log",
"events",
"that",
"matched",
"the",
"query",
"criteria",
"during",
"the",
"most",
"recent",
"time",
"it",
"ran",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"<code",
">",
"results<",
"/",
"code",
">",
"value",
"is",
"an",
"a... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-logs/src/main/java/com/amazonaws/services/logs/model/GetQueryResultsResult.java#L67-L72 | train | Gets the value of the results property. | Of course, here is the Java code you requested:
```java
public java.util.List<java.util.List<ResultField>> getResults() {
if (results == null) {
results = new com.amazonaws.internal.SdkInternalList<java.util.List<ResultField>>();
}
return results;
}
```
Hope this helps! |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java | MultiLineString.fromLineString | public static MultiLineString fromLineString(@NonNull LineString lineString,
@Nullable BoundingBox bbox) {
List<List<Point>> coordinates = Arrays.asList(lineString.coordinates());
return new MultiLineString(TYPE, bbox, coordinates);
} | java | public static MultiLineString fromLineString(@NonNull LineString lineString,
@Nullable BoundingBox bbox) {
List<List<Point>> coordinates = Arrays.asList(lineString.coordinates());
return new MultiLineString(TYPE, bbox, coordinates);
} | [
"public",
"static",
"MultiLineString",
"fromLineString",
"(",
"@",
"NonNull",
"LineString",
"lineString",
",",
"@",
"Nullable",
"BoundingBox",
"bbox",
")",
"{",
"List",
"<",
"List",
"<",
"Point",
">>",
"coordinates",
"=",
"Arrays",
".",
"asList",
"(",
"lineStr... | Create a new instance of this class by passing in a single {@link LineString} object. The
LineStrings should comply with the GeoJson specifications described in the documentation.
@param lineString a single LineString which make up this MultiLineString
@param bbox optionally include a bbox definition
@return a n... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"passing",
"in",
"a",
"single",
"{",
"@link",
"LineString",
"}",
"object",
".",
"The",
"LineStrings",
"should",
"comply",
"with",
"the",
"GeoJson",
"specifications",
"described",
"in",
"the",
"do... | c0be138f462f91441388584c668f3760ba0e18e2 | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java#L144-L148 | train | Creates a MultiLineString from a LineString. | Of course, here is the Java code you requested:
```java
public static MultiLineString fromLineString(@NonNull LineString lineString,
@Nullable BoundingBox bbox) {
List<List<Point>> coordinates = Arrays.asList(lineString.coordinates());
return new MultiLineString(T... |
jfree/jfreesvg | src/main/java/org/jfree/graphics2d/svg/SVGGraphics2D.java | SVGGraphics2D.clearRect | @Override
public void clearRect(int x, int y, int width, int height) {
if (getBackground() == null) {
return; // we can't do anything
}
Paint saved = getPaint();
setPaint(getBackground());
fillRect(x, y, width, height);
setPaint(saved);
} | java | @Override
public void clearRect(int x, int y, int width, int height) {
if (getBackground() == null) {
return; // we can't do anything
}
Paint saved = getPaint();
setPaint(getBackground());
fillRect(x, y, width, height);
setPaint(saved);
} | [
"@",
"Override",
"public",
"void",
"clearRect",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"if",
"(",
"getBackground",
"(",
")",
"==",
"null",
")",
"{",
"return",
";",
"// we can't do anything",
"}",
"Paint",... | Clears the specified rectangle by filling it with the current
background color. If the background color is {@code null}, this
method will do nothing.
@param x the x-coordinate.
@param y the y-coordinate.
@param width the width.
@param height the height.
@see #getBackground() | [
"Clears",
"the",
"specified",
"rectangle",
"by",
"filling",
"it",
"with",
"the",
"current",
"background",
"color",
".",
"If",
"the",
"background",
"color",
"is",
"{",
"@code",
"null",
"}",
"this",
"method",
"will",
"do",
"nothing",
"."
] | 2e6cd5f8dde71e37704e4d786e3b64235326adaf | https://github.com/jfree/jfreesvg/blob/2e6cd5f8dde71e37704e4d786e3b64235326adaf/src/main/java/org/jfree/graphics2d/svg/SVGGraphics2D.java#L2177-L2186 | valid | Clear the image of the image. | Of course, here is the Java code you requested:
```java
@Override
public void clearRect(int x, int y, int width, int height) {
if (getBackground() == null) {
return; // we can't do anything
}
Paint saved = getPaint();
setPaint(getBackground());
fillRect(x, y, wi... |
teatrove/teatrove | tea/src/main/java/org/teatrove/tea/compiler/Scope.java | Scope.getOutOfScopeVariableRefs | public VariableRef[] getOutOfScopeVariableRefs() {
Scope parent;
if ((parent = getParent()) == null) {
return new VariableRef[0];
}
Collection<VariableRef> allRefs = new ArrayList<VariableRef>();
fillVariableRefs(allRefs, this);
Collection<VariableRef> refs ... | java | public VariableRef[] getOutOfScopeVariableRefs() {
Scope parent;
if ((parent = getParent()) == null) {
return new VariableRef[0];
}
Collection<VariableRef> allRefs = new ArrayList<VariableRef>();
fillVariableRefs(allRefs, this);
Collection<VariableRef> refs ... | [
"public",
"VariableRef",
"[",
"]",
"getOutOfScopeVariableRefs",
"(",
")",
"{",
"Scope",
"parent",
";",
"if",
"(",
"(",
"parent",
"=",
"getParent",
"(",
")",
")",
"==",
"null",
")",
"{",
"return",
"new",
"VariableRef",
"[",
"0",
"]",
";",
"}",
"Collecti... | Returns all the references made from this scope and all child scopes to
variables declared outside of this scope. | [
"Returns",
"all",
"the",
"references",
"made",
"from",
"this",
"scope",
"and",
"all",
"child",
"scopes",
"to",
"variables",
"declared",
"outside",
"of",
"this",
"scope",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/compiler/Scope.java#L252-L276 | train | Get the out of scope VariableRefs. | Of course, here is the Java code you requested:
```java
public VariableRef[] getOutOfScopeVariableRefs() {
Scope parent;
if ((parent = getParent()) == null) {
return new VariableRef[0];
}
Collection<VariableRef> allRefs = new ArrayList<VariableRef>();
fillVariableRe... |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/Overlay.java | Overlay.draw | public void draw(final Canvas pCanvas, final MapView pMapView, final boolean pShadow) {
if (pShadow) {
return;
}
draw(pCanvas, pMapView.getProjection());
} | java | public void draw(final Canvas pCanvas, final MapView pMapView, final boolean pShadow) {
if (pShadow) {
return;
}
draw(pCanvas, pMapView.getProjection());
} | [
"public",
"void",
"draw",
"(",
"final",
"Canvas",
"pCanvas",
",",
"final",
"MapView",
"pMapView",
",",
"final",
"boolean",
"pShadow",
")",
"{",
"if",
"(",
"pShadow",
")",
"{",
"return",
";",
"}",
"draw",
"(",
"pCanvas",
",",
"pMapView",
".",
"getProjecti... | Draw the overlay over the map. This will be called on all active overlays with shadow=true,
to lay down the shadow layer, and then again on all overlays with shadow=false. Callers
should check isEnabled() before calling draw(). By default, draws nothing.
changed for 5.6 to be public see https://github.com/osmdroid/osm... | [
"Draw",
"the",
"overlay",
"over",
"the",
"map",
".",
"This",
"will",
"be",
"called",
"on",
"all",
"active",
"overlays",
"with",
"shadow",
"=",
"true",
"to",
"lay",
"down",
"the",
"shadow",
"layer",
"and",
"then",
"again",
"on",
"all",
"overlays",
"with",... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Overlay.java#L137-L142 | train | Draw the map view. | Of course, here is the Java code you requested:
```java
public void draw(final Canvas pCanvas, final MapView pMapView, final boolean pShadow) {
if (pShadow) {
return;
}
draw(pCanvas, pMapView.getProjection());
}
```
Hope this helps! |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/proxy/AbstractIndirectionHandler.java | AbstractIndirectionHandler.materializeSubject | protected synchronized Object materializeSubject() throws PersistenceBrokerException
{
TemporaryBrokerWrapper tmp = getBroker();
try
{
Object realSubject = tmp.broker.getObjectByIdentity(_id);
if (realSubject == null)
{
LoggerFactory.getLogger(IndirectionHandler.class).warn(
"Ca... | java | protected synchronized Object materializeSubject() throws PersistenceBrokerException
{
TemporaryBrokerWrapper tmp = getBroker();
try
{
Object realSubject = tmp.broker.getObjectByIdentity(_id);
if (realSubject == null)
{
LoggerFactory.getLogger(IndirectionHandler.class).warn(
"Ca... | [
"protected",
"synchronized",
"Object",
"materializeSubject",
"(",
")",
"throws",
"PersistenceBrokerException",
"{",
"TemporaryBrokerWrapper",
"tmp",
"=",
"getBroker",
"(",
")",
";",
"try",
"{",
"Object",
"realSubject",
"=",
"tmp",
".",
"broker",
".",
"getObjectByIde... | Retrieves the real subject from the underlying RDBMS. Override this
method if the object is to be materialized in a specific way.
@return The real subject of the proxy | [
"Retrieves",
"the",
"real",
"subject",
"from",
"the",
"underlying",
"RDBMS",
".",
"Override",
"this",
"method",
"if",
"the",
"object",
"is",
"to",
"be",
"materialized",
"in",
"a",
"specific",
"way",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/proxy/AbstractIndirectionHandler.java#L404-L423 | train | Returns the real subject object for the Identity. | Of course, here is the Java code you requested:
```java
protected synchronized Object materializeSubject() throws PersistenceBrokerException
{
TemporaryBrokerWrapper tmp = getBroker();
try
{
Object realSubject = tmp.broker.getObjectByIdentity(_id);
if (realSubject == null)
{
LoggerFac... |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/UNode.java | UNode.parse | public static UNode parse(Reader reader, ContentType contentType) throws IllegalArgumentException {
UNode result = null;
if (contentType.isJSON()) {
result = parseJSON(reader);
} else if (contentType.isXML()) {
result = parseXML(reader);
} else {
... | java | public static UNode parse(Reader reader, ContentType contentType) throws IllegalArgumentException {
UNode result = null;
if (contentType.isJSON()) {
result = parseJSON(reader);
} else if (contentType.isXML()) {
result = parseXML(reader);
} else {
... | [
"public",
"static",
"UNode",
"parse",
"(",
"Reader",
"reader",
",",
"ContentType",
"contentType",
")",
"throws",
"IllegalArgumentException",
"{",
"UNode",
"result",
"=",
"null",
";",
"if",
"(",
"contentType",
".",
"isJSON",
"(",
")",
")",
"{",
"result",
"=",... | Parse the text from the given character reader, formatted with the given content-type,
into a UNode tree and return the root node. The reader is closed when finished.
@param reader Reader providing source characters.
@param contentType {@link ContentType} of text. Only JSON and XML are supported.
@return ... | [
"Parse",
"the",
"text",
"from",
"the",
"given",
"character",
"reader",
"formatted",
"with",
"the",
"given",
"content",
"-",
"type",
"into",
"a",
"UNode",
"tree",
"and",
"return",
"the",
"root",
"node",
".",
"The",
"reader",
"is",
"closed",
"when",
"finishe... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/UNode.java#L274-L284 | train | Parses a
angelecite tag from a reader. | Of course, here is the Java code you requested:
```java
public static UNode parse(Reader reader, ContentType contentType) throws IllegalArgumentException {
UNode result = null;
if (contentType.isJSON()) {
result = parseJSON(reader);
} else if (contentType.isXML()) {
... |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseIdentifier | private String parseIdentifier()
{
Token token = scanToken();
if (token != Token.IDENTIFIER) {
throw error("expected identifier at {0}", token);
}
return _lexeme;
} | java | private String parseIdentifier()
{
Token token = scanToken();
if (token != Token.IDENTIFIER) {
throw error("expected identifier at {0}", token);
}
return _lexeme;
} | [
"private",
"String",
"parseIdentifier",
"(",
")",
"{",
"Token",
"token",
"=",
"scanToken",
"(",
")",
";",
"if",
"(",
"token",
"!=",
"Token",
".",
"IDENTIFIER",
")",
"{",
"throw",
"error",
"(",
"\"expected identifier at {0}\"",
",",
"token",
")",
";",
"}",
... | Parses an identifier. | [
"Parses",
"an",
"identifier",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L2437-L2446 | train | Parses an identifier. | Of course, here is the Java code you requested:
```java
private String parseIdentifier()
{
Token token = scanToken();
if (token != Token.IDENTIFIER) {
throw error("expected identifier at {0}", token);
}
return _lexeme;
}
```
Hope this helps! |
azaptree/azaptree-services | azaptree-command-service/src/main/java/com/azaptree/services/command/impl/CommandServiceImpl.java | CommandServiceImpl.getCommandCatalogNames | @ManagedAttribute
@Override
public String[] getCommandCatalogNames() {
final Set<String> catalogNames = new TreeSet<>(commandCatalogs.keySet());
return catalogNames.toArray(new String[catalogNames.size()]);
} | java | @ManagedAttribute
@Override
public String[] getCommandCatalogNames() {
final Set<String> catalogNames = new TreeSet<>(commandCatalogs.keySet());
return catalogNames.toArray(new String[catalogNames.size()]);
} | [
"@",
"ManagedAttribute",
"@",
"Override",
"public",
"String",
"[",
"]",
"getCommandCatalogNames",
"(",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"catalogNames",
"=",
"new",
"TreeSet",
"<>",
"(",
"commandCatalogs",
".",
"keySet",
"(",
")",
")",
";",
"re... | /*
(non-Javadoc)
@see com.azaptree.services.command.impl.CommandServiceJmxApi#getCommandCatalogNames() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | f38bc23acf536bf4d63c007406158fdc4b0cc160 | https://github.com/azaptree/azaptree-services/blob/f38bc23acf536bf4d63c007406158fdc4b0cc160/azaptree-command-service/src/main/java/com/azaptree/services/command/impl/CommandServiceImpl.java#L113-L118 | valid | Get the names of all the commands that are available in the system. | Of course, here is the Java code you requested:
```java
@ManagedAttribute
@Override
public String[] getCommandCatalogNames() {
final Set<String> catalogNames = new TreeSet<>(commandCatalogs.keySet());
return catalogNames.toArray(new String[catalogNames.size()]);
}
```
Hope this helps! |
grpc/grpc-java | api/src/main/java/io/grpc/ServiceProviders.java | ServiceProviders.isAndroid | static boolean isAndroid(ClassLoader cl) {
try {
// Specify a class loader instead of null because we may be running under Robolectric
Class.forName("android.app.Application", /*initialize=*/ false, cl);
return true;
} catch (Exception e) {
// If Application isn't loaded, it might as wel... | java | static boolean isAndroid(ClassLoader cl) {
try {
// Specify a class loader instead of null because we may be running under Robolectric
Class.forName("android.app.Application", /*initialize=*/ false, cl);
return true;
} catch (Exception e) {
// If Application isn't loaded, it might as wel... | [
"static",
"boolean",
"isAndroid",
"(",
"ClassLoader",
"cl",
")",
"{",
"try",
"{",
"// Specify a class loader instead of null because we may be running under Robolectric",
"Class",
".",
"forName",
"(",
"\"android.app.Application\"",
",",
"/*initialize=*/",
"false",
",",
"cl",
... | Returns true if the {@link ClassLoader} is for android. | [
"Returns",
"true",
"if",
"the",
"{"
] | 973885457f9609de232d2553b82c67f6c3ff57bf | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/api/src/main/java/io/grpc/ServiceProviders.java#L92-L101 | train | Checks if the application is Android. | Of course, here is the Java code you requested:
```java
static boolean isAndroid(ClassLoader cl) {
try {
// Specify a class loader instead of null because we may be running under Robolectric
Class.forName("android.app.Application", /*initialize=*/ false, cl);
return true;
} catch (Exception e... |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/Main.java | Main.findFiles | private boolean findFiles(String[] args, String option, Set<String> suffixes,
Map<String,Source> found_files, Map<String, Module> found_modules,
Module current_module, boolean inLinksrc)
throws ProblemException, ProblemException
{
// Track ... | java | private boolean findFiles(String[] args, String option, Set<String> suffixes,
Map<String,Source> found_files, Map<String, Module> found_modules,
Module current_module, boolean inLinksrc)
throws ProblemException, ProblemException
{
// Track ... | [
"private",
"boolean",
"findFiles",
"(",
"String",
"[",
"]",
"args",
",",
"String",
"option",
",",
"Set",
"<",
"String",
">",
"suffixes",
",",
"Map",
"<",
"String",
",",
"Source",
">",
"found_files",
",",
"Map",
"<",
"String",
",",
"Module",
">",
"found... | Scan the arguments for -i -x -xf -if followed by the option
-src, -sourcepath, -modulepath or -classpath and produce a map of all the
files to referenced for that particular option.
Store the found sources and the found modules in the supplied maps. | [
"Scan",
"the",
"arguments",
"for",
"-",
"i",
"-",
"x",
"-",
"xf",
"-",
"if",
"followed",
"by",
"the",
"option",
"-",
"src",
"-",
"sourcepath",
"-",
"modulepath",
"or",
"-",
"classpath",
"and",
"produce",
"a",
"map",
"of",
"all",
"the",
"files",
"to",... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/Main.java#L866-L966 | train | Find files. | Of course, here is the Java code you requested:
```java
private boolean findFiles(String[] args, String option, Set<String> suffixes,
Map<String,Source> found_files, Map<String, Module> found_modules,
Module current_module, boolean inLinksrc)
throws P... |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ParameterMapper.java | ParameterMapper.mapToObject | public static Object mapToObject(Map<String, String> map, Class<?> c) {
Method m = null;
Object obj = null;
try {
obj = c.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
log.info("instance create fail : " + c.getName());
... | java | public static Object mapToObject(Map<String, String> map, Class<?> c) {
Method m = null;
Object obj = null;
try {
obj = c.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
log.info("instance create fail : " + c.getName());
... | [
"public",
"static",
"Object",
"mapToObject",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
",",
"Class",
"<",
"?",
">",
"c",
")",
"{",
"Method",
"m",
"=",
"null",
";",
"Object",
"obj",
"=",
"null",
";",
"try",
"{",
"obj",
"=",
"c",
".",
... | Map to object object.
@param map the map
@param c the c
@return the object | [
"Map",
"to",
"object",
"object",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ParameterMapper.java#L167-L206 | train | Map to object. | Of course, here is the Java code you requested:
```java
public static Object mapToObject(Map<String, String> map, Class<?> c) {
Method m = null;
Object obj = null;
try {
obj = c.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
log.in... |
h2oai/h2o-3 | h2o-core/src/main/java/water/MRTask.java | MRTask.closeFrame | private Frame closeFrame(Key key, String[] names, String[][] domains, Futures fs) {
if( _output_types == null ) return null;
final int noutputs = _output_types.length;
Vec[] vecs = new Vec[noutputs];
if( _appendables==null || _appendables.length == 0) // Zero rows?
for( int i = 0; i < noutputs; i... | java | private Frame closeFrame(Key key, String[] names, String[][] domains, Futures fs) {
if( _output_types == null ) return null;
final int noutputs = _output_types.length;
Vec[] vecs = new Vec[noutputs];
if( _appendables==null || _appendables.length == 0) // Zero rows?
for( int i = 0; i < noutputs; i... | [
"private",
"Frame",
"closeFrame",
"(",
"Key",
"key",
",",
"String",
"[",
"]",
"names",
",",
"String",
"[",
"]",
"[",
"]",
"domains",
",",
"Futures",
"fs",
")",
"{",
"if",
"(",
"_output_types",
"==",
"null",
")",
"return",
"null",
";",
"final",
"int",... | the work-horse for the outputFrame calls | [
"the",
"work",
"-",
"horse",
"for",
"the",
"outputFrame",
"calls"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/MRTask.java#L227-L242 | train | Close a Frame. | Of course, here is the Java code you requested:
```java
private Frame closeFrame(Key key, String[] names, String[][] domains, Futures fs) {
if( _output_types == null ) return null;
final int noutputs = _output_types.length;
Vec[] vecs = new Vec[noutputs];
if( _appendables==null || _appendables.length =... |
line/armeria | core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java | HttpAuthServiceBuilder.addOAuth1a | public HttpAuthServiceBuilder addOAuth1a(Authorizer<? super OAuth1aToken> authorizer, AsciiString header) {
return addTokenAuthorizer(new OAuth1aTokenExtractor(requireNonNull(header, "header")),
requireNonNull(authorizer, "authorizer"));
} | java | public HttpAuthServiceBuilder addOAuth1a(Authorizer<? super OAuth1aToken> authorizer, AsciiString header) {
return addTokenAuthorizer(new OAuth1aTokenExtractor(requireNonNull(header, "header")),
requireNonNull(authorizer, "authorizer"));
} | [
"public",
"HttpAuthServiceBuilder",
"addOAuth1a",
"(",
"Authorizer",
"<",
"?",
"super",
"OAuth1aToken",
">",
"authorizer",
",",
"AsciiString",
"header",
")",
"{",
"return",
"addTokenAuthorizer",
"(",
"new",
"OAuth1aTokenExtractor",
"(",
"requireNonNull",
"(",
"header"... | Adds an OAuth1a {@link Authorizer} for the given {@code header}. | [
"Adds",
"an",
"OAuth1a",
"{"
] | 67d29e019fd35a35f89c45cc8f9119ff9b12b44d | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java#L101-L104 | train | Add an OAuth 1a token authorizer. | Of course, here is the Java code you requested:
```java
public HttpAuthServiceBuilder addOAuth1a(Authorizer<? super OAuth1aToken> authorizer, AsciiString header) {
return addTokenAuthorizer(new OAuth1aTokenExtractor(requireNonNull(header, "header")),
requireNonNull(authorizer,... |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/Relation.java | Relation.isCollection | public boolean isCollection()
{
return type.equals(Relation.ForeignKey.ONE_TO_MANY) || type.equals(Relation.ForeignKey.MANY_TO_MANY);
} | java | public boolean isCollection()
{
return type.equals(Relation.ForeignKey.ONE_TO_MANY) || type.equals(Relation.ForeignKey.MANY_TO_MANY);
} | [
"public",
"boolean",
"isCollection",
"(",
")",
"{",
"return",
"type",
".",
"equals",
"(",
"Relation",
".",
"ForeignKey",
".",
"ONE_TO_MANY",
")",
"||",
"type",
".",
"equals",
"(",
"Relation",
".",
"ForeignKey",
".",
"MANY_TO_MANY",
")",
";",
"}"
] | Checks if is collection.
@return true, if is collection | [
"Checks",
"if",
"is",
"collection",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/Relation.java#L357-L360 | train | Is a collection of relation records. | Of course, here is the Java code you requested:
```java
public boolean isCollection()
{
return type.equals(Relation.ForeignKey.ONE_TO_MANY) || type.equals(Relation.ForeignKey.MANY_TO_MANY);
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/AmazonRDSClient.java | AmazonRDSClient.restoreDBInstanceToPointInTime | @Override
public DBInstance restoreDBInstanceToPointInTime(RestoreDBInstanceToPointInTimeRequest request) {
request = beforeClientExecution(request);
return executeRestoreDBInstanceToPointInTime(request);
} | java | @Override
public DBInstance restoreDBInstanceToPointInTime(RestoreDBInstanceToPointInTimeRequest request) {
request = beforeClientExecution(request);
return executeRestoreDBInstanceToPointInTime(request);
} | [
"@",
"Override",
"public",
"DBInstance",
"restoreDBInstanceToPointInTime",
"(",
"RestoreDBInstanceToPointInTimeRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeRestoreDBInstanceToPointInTime",
"(",
"request",
... | <p>
Restores a DB instance to an arbitrary point in time. You can restore to any point in time before the time
identified by the LatestRestorableTime property. You can restore to a point up to the number of days specified by
the BackupRetentionPeriod property.
</p>
<p>
The target database is created with most of the or... | [
"<p",
">",
"Restores",
"a",
"DB",
"instance",
"to",
"an",
"arbitrary",
"point",
"in",
"time",
".",
"You",
"can",
"restore",
"to",
"any",
"point",
"in",
"time",
"before",
"the",
"time",
"identified",
"by",
"the",
"LatestRestorableTime",
"property",
".",
"Yo... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/AmazonRDSClient.java#L7575-L7579 | train | Restores a DB instance to a new time interval. | Of course, here is the Java code you requested:
```java
@Override
public DBInstance restoreDBInstanceToPointInTime(RestoreDBInstanceToPointInTimeRequest request) {
request = beforeClientExecution(request);
return executeRestoreDBInstanceToPointInTime(request);
}
```
Hope this helps! |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java | MultiUserChat.getOutcasts | public List<Affiliate> getOutcasts() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return getAffiliatesByAdmin(MUCAffiliation.outcast);
} | java | public List<Affiliate> getOutcasts() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return getAffiliatesByAdmin(MUCAffiliation.outcast);
} | [
"public",
"List",
"<",
"Affiliate",
">",
"getOutcasts",
"(",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"return",
"getAffiliatesByAdmin",
"(",
"MUCAffiliation",
".",
"outcast",
")",
... | Returns a list of <code>Affiliate</code> with the room outcasts.
@return a list of <code>Affiliate</code> with the room outcasts.
@throws XMPPErrorException if you don't have enough privileges to get this information.
@throws NoResponseException if there was no response from the server.
@throws NotConnectedException
@... | [
"Returns",
"a",
"list",
"of",
"<code",
">",
"Affiliate<",
"/",
"code",
">",
"with",
"the",
"room",
"outcasts",
"."
] | 870756997faec1e1bfabfac0cd6c2395b04da873 | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java#L1795-L1797 | train | Get the list of outcasts that are granted to the user. | Of course, here is the Java code you requested:
```java
public List<Affiliate> getOutcasts() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return getAffiliatesByAdmin(MUCAffiliation.outcast);
}
```
Hope this helps! |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/color/RGB01Color.java | RGB01Color.parse | @Override
public void parse(final String... parameters) {
// Manage red composite
if (parameters.length >= 1) {
redProperty().set(Double.parseDouble(parameters[0]));
}
// Manage green composite
if (parameters.length >= 2) {
greenProperty().set(... | java | @Override
public void parse(final String... parameters) {
// Manage red composite
if (parameters.length >= 1) {
redProperty().set(Double.parseDouble(parameters[0]));
}
// Manage green composite
if (parameters.length >= 2) {
greenProperty().set(... | [
"@",
"Override",
"public",
"void",
"parse",
"(",
"final",
"String",
"...",
"parameters",
")",
"{",
"// Manage red composite\r",
"if",
"(",
"parameters",
".",
"length",
">=",
"1",
")",
"{",
"redProperty",
"(",
")",
".",
"set",
"(",
"Double",
".",
"parseDoub... | {@inheritDoc} | [
"{"
] | 93f4fc087b83c73db540333b9686e97b4cec694d | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/color/RGB01Color.java#L128-L146 | train | Parse the
property from the array of string. | Of course, here is the Java code you requested:
```java
@Override
public void parse(final String... parameters) {
// Manage red composite
if (parameters.length >= 1) {
redProperty().set(Double.parseDouble(parameters[0]));
}
// Manage green composite
if (pa... |
alkacon/opencms-core | src/org/opencms/ui/components/CmsFileTable.java | CmsFileTable.applyWorkplaceAppSettings | public void applyWorkplaceAppSettings() {
// add site path property to container
m_container.addContainerProperty(
CmsResourceTableProperty.PROPERTY_SITE_PATH,
CmsResourceTableProperty.PROPERTY_SITE_PATH.getColumnType(),
CmsResourceTableProperty.PROPERTY_SITE_PATH.ge... | java | public void applyWorkplaceAppSettings() {
// add site path property to container
m_container.addContainerProperty(
CmsResourceTableProperty.PROPERTY_SITE_PATH,
CmsResourceTableProperty.PROPERTY_SITE_PATH.getColumnType(),
CmsResourceTableProperty.PROPERTY_SITE_PATH.ge... | [
"public",
"void",
"applyWorkplaceAppSettings",
"(",
")",
"{",
"// add site path property to container",
"m_container",
".",
"addContainerProperty",
"(",
"CmsResourceTableProperty",
".",
"PROPERTY_SITE_PATH",
",",
"CmsResourceTableProperty",
".",
"PROPERTY_SITE_PATH",
".",
"getC... | Applies settings generally used within workplace app file lists.<p> | [
"Applies",
"settings",
"generally",
"used",
"within",
"workplace",
"app",
"file",
"lists",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsFileTable.java#L503-L538 | train | Apply the workplace app settings to the container. | Of course, here is the Java code you requested:
```java
public void applyWorkplaceAppSettings() {
// add site path property to container
m_container.addContainerProperty(
CmsResourceTableProperty.PROPERTY_SITE_PATH,
CmsResourceTableProperty.PROPERTY_SITE_PATH.getColumnType(),
... |
classgraph/classgraph | src/main/java/io/github/classgraph/MethodInfo.java | MethodInfo.getTypeDescriptor | public MethodTypeSignature getTypeDescriptor() {
if (typeDescriptor == null) {
try {
typeDescriptor = MethodTypeSignature.parse(typeDescriptorStr, declaringClassName);
typeDescriptor.setScanResult(scanResult);
} catch (final ParseException e) {
... | java | public MethodTypeSignature getTypeDescriptor() {
if (typeDescriptor == null) {
try {
typeDescriptor = MethodTypeSignature.parse(typeDescriptorStr, declaringClassName);
typeDescriptor.setScanResult(scanResult);
} catch (final ParseException e) {
... | [
"public",
"MethodTypeSignature",
"getTypeDescriptor",
"(",
")",
"{",
"if",
"(",
"typeDescriptor",
"==",
"null",
")",
"{",
"try",
"{",
"typeDescriptor",
"=",
"MethodTypeSignature",
".",
"parse",
"(",
"typeDescriptorStr",
",",
"declaringClassName",
")",
";",
"typeDe... | Returns the parsed type descriptor for the method, which will not include type parameters. If you need
generic type parameters, call getTypeSignature() instead.
@return The parsed type descriptor for the method. | [
"Returns",
"the",
"parsed",
"type",
"descriptor",
"for",
"the",
"method",
"which",
"will",
"not",
"include",
"type",
"parameters",
".",
"If",
"you",
"need",
"generic",
"type",
"parameters",
"call",
"getTypeSignature",
"()",
"instead",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/MethodInfo.java#L198-L208 | train | Gets the type descriptor. | Of course, here is the Java code you requested:
```java
public MethodTypeSignature getTypeDescriptor() {
if (typeDescriptor == null) {
try {
typeDescriptor = MethodTypeSignature.parse(typeDescriptorStr, declaringClassName);
typeDescriptor.setScanResult(scanResult);
... |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java | EmbeddedNeo4jEntityQueries.multiPropertiesIdFindEntities | private ResourceIterator<Node> multiPropertiesIdFindEntities(GraphDatabaseService executionEngine, EntityKey[] keys) {
String query = getMultiGetQueryCacheQuery( keys );
Map<String, Object> params = multiGetParams( keys );
Result result = executionEngine.execute( query, params );
return result.columnAs( ENTITY_... | java | private ResourceIterator<Node> multiPropertiesIdFindEntities(GraphDatabaseService executionEngine, EntityKey[] keys) {
String query = getMultiGetQueryCacheQuery( keys );
Map<String, Object> params = multiGetParams( keys );
Result result = executionEngine.execute( query, params );
return result.columnAs( ENTITY_... | [
"private",
"ResourceIterator",
"<",
"Node",
">",
"multiPropertiesIdFindEntities",
"(",
"GraphDatabaseService",
"executionEngine",
",",
"EntityKey",
"[",
"]",
"keys",
")",
"{",
"String",
"query",
"=",
"getMultiGetQueryCacheQuery",
"(",
"keys",
")",
";",
"Map",
"<",
... | /*
When the id is mapped on several properties | [
"/",
"*",
"When",
"the",
"id",
"is",
"mapped",
"on",
"several",
"properties"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jEntityQueries.java#L104-L109 | train | Find entities in multi properties. | Of course, here is the Java code you requested:
```java
private ResourceIterator<Node> multiPropertiesIdFindEntities(GraphDatabaseService executionEngine, EntityKey[] keys) {
String query = getMultiGetQueryCacheQuery( keys );
Map<String, Object> params = multiGetParams( keys );
Result result = executionEngine.ex... |
drewwills/cernunnos | cernunnos-core/src/main/java/org/danann/cernunnos/runtime/web/ServletRequestHeaderPhrase.java | ServletRequestHeaderPhrase.evaluate | public Object evaluate(TaskRequest req, TaskResponse res) {
HttpServletRequest hreq = (HttpServletRequest) source.evaluate(req, res);
String headerName = (String) header_name.evaluate(req, res);
return hreq.getHeader(headerName);
} | java | public Object evaluate(TaskRequest req, TaskResponse res) {
HttpServletRequest hreq = (HttpServletRequest) source.evaluate(req, res);
String headerName = (String) header_name.evaluate(req, res);
return hreq.getHeader(headerName);
} | [
"public",
"Object",
"evaluate",
"(",
"TaskRequest",
"req",
",",
"TaskResponse",
"res",
")",
"{",
"HttpServletRequest",
"hreq",
"=",
"(",
"HttpServletRequest",
")",
"source",
".",
"evaluate",
"(",
"req",
",",
"res",
")",
";",
"String",
"headerName",
"=",
"(",... | {@inheritDoc} | [
"{"
] | dc6848e0253775e22b6c869fd06506d4ddb6d728 | https://github.com/drewwills/cernunnos/blob/dc6848e0253775e22b6c869fd06506d4ddb6d728/cernunnos-core/src/main/java/org/danann/cernunnos/runtime/web/ServletRequestHeaderPhrase.java#L74-L80 | train | Evaluate the request. | Of course, here is the Java code you requested:
```java
public Object evaluate(TaskRequest req, TaskResponse res) {
HttpServletRequest hreq = (HttpServletRequest) source.evaluate(req, res);
String headerName = (String) header_name.evaluate(req, res);
return hreq.getHeader(headerName);
}
```
Hope this hel... |
aws/aws-sdk-java | aws-java-sdk-mechanicalturkrequester/src/main/java/com/amazonaws/services/mturk/AmazonMTurkClient.java | AmazonMTurkClient.getAssignment | @Override
public GetAssignmentResult getAssignment(GetAssignmentRequest request) {
request = beforeClientExecution(request);
return executeGetAssignment(request);
} | java | @Override
public GetAssignmentResult getAssignment(GetAssignmentRequest request) {
request = beforeClientExecution(request);
return executeGetAssignment(request);
} | [
"@",
"Override",
"public",
"GetAssignmentResult",
"getAssignment",
"(",
"GetAssignmentRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeGetAssignment",
"(",
"request",
")",
";",
"}"
] | <p>
The <code>GetAssignment</code> operation retrieves the details of the specified Assignment.
</p>
@param getAssignmentRequest
@return Result of the GetAssignment operation returned by the service.
@throws ServiceException
Amazon Mechanical Turk is temporarily unable to process your request. Try your call again.
@th... | [
"<p",
">",
"The",
"<code",
">",
"GetAssignment<",
"/",
"code",
">",
"operation",
"retrieves",
"the",
"details",
"of",
"the",
"specified",
"Assignment",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mechanicalturkrequester/src/main/java/com/amazonaws/services/mturk/AmazonMTurkClient.java#L1113-L1117 | train | Retrieves information about an ANSWER. | Of course, here is the Java code you requested:
```java
@Override
public GetAssignmentResult getAssignment(GetAssignmentRequest request) {
request = beforeClientExecution(request);
return executeGetAssignment(request);
}
```
Hope this helps! |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/FileListUtils.java | FileListUtils.listFilesRecursively | public static List<FileStatus> listFilesRecursively(FileSystem fs, Path path, PathFilter fileFilter,
boolean applyFilterToDirectories)
throws IOException {
return listFilesRecursivelyHelper(fs, Lists.newArrayList(), fs.getFileStatus(path), fileFilter,
applyFilterToDirectories, false);
} | java | public static List<FileStatus> listFilesRecursively(FileSystem fs, Path path, PathFilter fileFilter,
boolean applyFilterToDirectories)
throws IOException {
return listFilesRecursivelyHelper(fs, Lists.newArrayList(), fs.getFileStatus(path), fileFilter,
applyFilterToDirectories, false);
} | [
"public",
"static",
"List",
"<",
"FileStatus",
">",
"listFilesRecursively",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
",",
"PathFilter",
"fileFilter",
",",
"boolean",
"applyFilterToDirectories",
")",
"throws",
"IOException",
"{",
"return",
"listFilesRecursivelyHel... | Helper method to list out all files under a specified path. If applyFilterToDirectories is false, the supplied
{@link PathFilter} will only be applied to files. | [
"Helper",
"method",
"to",
"list",
"out",
"all",
"files",
"under",
"a",
"specified",
"path",
".",
"If",
"applyFilterToDirectories",
"is",
"false",
"the",
"supplied",
"{"
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/FileListUtils.java#L125-L130 | train | List all files recursively. | Of course, here is the Java code you requested:
```java
public static List<FileStatus> listFilesRecursively(FileSystem fs, Path path, PathFilter fileFilter,
boolean applyFilterToDirectories)
throws IOException {
return listFilesRecursivelyHelper(fs, Lists.newArrayList(), fs.getFileStatus(path), fileFil... |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/connection/phase/FullFeaturePhase.java | FullFeaturePhase.read | @Override
public final boolean read (final ITask task, final Session session, final ByteBuffer dst, final int logicalBlockAddress, final long length) throws Exception {
if (dst.remaining() < length) { throw new IllegalArgumentException("Destination buffer is too small."); }
int startAddress = logi... | java | @Override
public final boolean read (final ITask task, final Session session, final ByteBuffer dst, final int logicalBlockAddress, final long length) throws Exception {
if (dst.remaining() < length) { throw new IllegalArgumentException("Destination buffer is too small."); }
int startAddress = logi... | [
"@",
"Override",
"public",
"final",
"boolean",
"read",
"(",
"final",
"ITask",
"task",
",",
"final",
"Session",
"session",
",",
"final",
"ByteBuffer",
"dst",
",",
"final",
"int",
"logicalBlockAddress",
",",
"final",
"long",
"length",
")",
"throws",
"Exception",... | {@inheritDoc} | [
"{"
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/connection/phase/FullFeaturePhase.java#L106-L160 | train | Read sequence from the specified logical block. | Of course, here is the Java code you requested:
```java
@Override
public final boolean read (final ITask task, final Session session, final ByteBuffer dst, final int logicalBlockAddress, final long length) throws Exception {
if (dst.remaining() < length) { throw new IllegalArgumentException("Destination b... |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/builder/ResourceBuilder.java | ResourceBuilder.builders | public static List<ResourceBuilder> builders(ClassLoader classLoader, KnowledgeComponentImplementationModel implementationModel) {
List<ResourceBuilder> builders = new ArrayList<ResourceBuilder>();
if (implementationModel != null) {
ManifestModel manifestModel = implementationModel.getManife... | java | public static List<ResourceBuilder> builders(ClassLoader classLoader, KnowledgeComponentImplementationModel implementationModel) {
List<ResourceBuilder> builders = new ArrayList<ResourceBuilder>();
if (implementationModel != null) {
ManifestModel manifestModel = implementationModel.getManife... | [
"public",
"static",
"List",
"<",
"ResourceBuilder",
">",
"builders",
"(",
"ClassLoader",
"classLoader",
",",
"KnowledgeComponentImplementationModel",
"implementationModel",
")",
"{",
"List",
"<",
"ResourceBuilder",
">",
"builders",
"=",
"new",
"ArrayList",
"<",
"Resou... | Creates ResourceBuilders.
@param classLoader classLoader
@param implementationModel implementationModel
@return ResourceBuilders | [
"Creates",
"ResourceBuilders",
"."
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/builder/ResourceBuilder.java#L146-L156 | train | Gets the builders. | Of course, here is the Java code you requested:
```java
public static List<ResourceBuilder> builders(ClassLoader classLoader, KnowledgeComponentImplementationModel implementationModel) {
List<ResourceBuilder> builders = new ArrayList<ResourceBuilder>();
if (implementationModel != null) {
Ma... |
OpenTSDB/opentsdb | src/query/expression/UnionIterator.java | UnionIterator.computeUnion | private void computeUnion() {
// key = flattened tags, array of queries.size()
final ByteMap<ExpressionDataPoint[]> ordered_union =
new ByteMap<ExpressionDataPoint[]>();
final Iterator<ITimeSyncedIterator> it = queries.values().iterator();
while (it.hasNext()) {
final ITimeSyncedIterato... | java | private void computeUnion() {
// key = flattened tags, array of queries.size()
final ByteMap<ExpressionDataPoint[]> ordered_union =
new ByteMap<ExpressionDataPoint[]>();
final Iterator<ITimeSyncedIterator> it = queries.values().iterator();
while (it.hasNext()) {
final ITimeSyncedIterato... | [
"private",
"void",
"computeUnion",
"(",
")",
"{",
"// key = flattened tags, array of queries.size()",
"final",
"ByteMap",
"<",
"ExpressionDataPoint",
"[",
"]",
">",
"ordered_union",
"=",
"new",
"ByteMap",
"<",
"ExpressionDataPoint",
"[",
"]",
">",
"(",
")",
";",
"... | Computes the union of all sets, matching on tags and optionally the
aggregated tags across each variable. | [
"Computes",
"the",
"union",
"of",
"all",
"sets",
"matching",
"on",
"tags",
"and",
"optionally",
"the",
"aggregated",
"tags",
"across",
"each",
"variable",
"."
] | 3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3 | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/expression/UnionIterator.java#L171-L201 | train | Compute the union of the data. | Of course, here is the Java code you requested:
```java
private void computeUnion() {
// key = flattened tags, array of queries.size()
final ByteMap<ExpressionDataPoint[]> ordered_union =
new ByteMap<ExpressionDataPoint[]>();
final Iterator<ITimeSyncedIterator> it = queries.values().iterator();
... |
eclipse/xtext-extras | org.eclipse.xtext.xbase/emf-gen/org/eclipse/xtext/xbase/impl/XAbstractWhileExpressionImpl.java | XAbstractWhileExpressionImpl.eIsSet | @Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case XbasePackage.XABSTRACT_WHILE_EXPRESSION__PREDICATE:
return predicate != null;
case XbasePackage.XABSTRACT_WHILE_EXPRESSION__BODY:
return body != null;
}
return super.eIsSet(featureID);
} | java | @Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case XbasePackage.XABSTRACT_WHILE_EXPRESSION__PREDICATE:
return predicate != null;
case XbasePackage.XABSTRACT_WHILE_EXPRESSION__BODY:
return body != null;
}
return super.eIsSet(featureID);
} | [
"@",
"Override",
"public",
"boolean",
"eIsSet",
"(",
"int",
"featureID",
")",
"{",
"switch",
"(",
"featureID",
")",
"{",
"case",
"XbasePackage",
".",
"XABSTRACT_WHILE_EXPRESSION__PREDICATE",
":",
"return",
"predicate",
"!=",
"null",
";",
"case",
"XbasePackage",
... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 451359541295323a29f5855e633f770cec02069a | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/emf-gen/org/eclipse/xtext/xbase/impl/XAbstractWhileExpressionImpl.java#L256-L267 | train | Replies if the feature is set to a value. | Of course, here is the Java code you requested:
```java
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case XbasePackage.XABSTRACT_WHILE_EXPRESSION__PREDICATE:
return predicate != null;
case XbasePackage.XABSTRACT_WHILE_EXPRESSION__BODY:
return body != null;
}
return supe... |
eobermuhlner/big-math | ch.obermuhlner.math.big.example/src/main/java/ch/obermuhlner/math/big/example/internal/BigDecimalMathExperimental.java | BigDecimalMathExperimental.printSqrtConvergence | private static void printSqrtConvergence() {
int precision = 10000;
for (BigDecimal x : Arrays.asList(BigDecimal.valueOf(2), BigDecimal.valueOf(16))) {
System.out.println("Newton sqrt(" + x +")");
sqrtUsingNewtonPrint(x, new MathContext(precision));
System.out.println();
System.out.prin... | java | private static void printSqrtConvergence() {
int precision = 10000;
for (BigDecimal x : Arrays.asList(BigDecimal.valueOf(2), BigDecimal.valueOf(16))) {
System.out.println("Newton sqrt(" + x +")");
sqrtUsingNewtonPrint(x, new MathContext(precision));
System.out.println();
System.out.prin... | [
"private",
"static",
"void",
"printSqrtConvergence",
"(",
")",
"{",
"int",
"precision",
"=",
"10000",
";",
"for",
"(",
"BigDecimal",
"x",
":",
"Arrays",
".",
"asList",
"(",
"BigDecimal",
".",
"valueOf",
"(",
"2",
")",
",",
"BigDecimal",
".",
"valueOf",
"... | variations on exp() | [
"variations",
"on",
"exp",
"()"
] | 52c4fc334d0d722b295de740c1018ee400e3e8f2 | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big.example/src/main/java/ch/obermuhlner/math/big/example/internal/BigDecimalMathExperimental.java#L47-L63 | train | Print the SQRT Convergence table. | Of course, here is the Java code you requested:
```java
private static void printSqrtConvergence() {
int precision = 10000;
for (BigDecimal x : Arrays.asList(BigDecimal.valueOf(2), BigDecimal.valueOf(16))) {
System.out.println("Newton sqrt(" + x +")");
sqrtUsingNewtonPrint(x, new MathContext(precisio... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.doAfterNext | @CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> doAfterNext(Consumer<? super T> onAfterNext) {
ObjectHelper.requireNonNull(onAfterNext, "onAfterNext is null");
return RxJavaPlugins.onAssembly(new Flowable... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> doAfterNext(Consumer<? super T> onAfterNext) {
ObjectHelper.requireNonNull(onAfterNext, "onAfterNext is null");
return RxJavaPlugins.onAssembly(new Flowable... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"PASS_THROUGH",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Flowable",
"<",
"T",
">",
"doAfterNext",
"(",
"Consumer",
"<",
"?",
"s... | Calls the specified consumer with the current item after this item has been emitted to the downstream.
<p>Note that the {@code onAfterNext} action is shared between subscriptions and as such
should be thread-safe.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The operator doesn't interfere with backpressure which is determine... | [
"Calls",
"the",
"specified",
"consumer",
"with",
"the",
"current",
"item",
"after",
"this",
"item",
"has",
"been",
"emitted",
"to",
"the",
"downstream",
".",
"<p",
">",
"Note",
"that",
"the",
"{"
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L9025-L9031 | test | Asynchronously executes a sequence of items after the next sequence of items has been received. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> doAfterNext(Consumer<? super T> onAfterNext) {
ObjectHelper.requireNonNull(onAfterNext, "onAfterNext is nul... |
aws/aws-sdk-java | aws-java-sdk-waf/src/main/java/com/amazonaws/services/waf/model/waf/transform/DeleteRuleGroupRequestMarshaller.java | DeleteRuleGroupRequestMarshaller.marshall | public void marshall(DeleteRuleGroupRequest deleteRuleGroupRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteRuleGroupRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteRuleGro... | java | public void marshall(DeleteRuleGroupRequest deleteRuleGroupRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteRuleGroupRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteRuleGro... | [
"public",
"void",
"marshall",
"(",
"DeleteRuleGroupRequest",
"deleteRuleGroupRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"deleteRuleGroupRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument pa... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-waf/src/main/java/com/amazonaws/services/waf/model/waf/transform/DeleteRuleGroupRequestMarshaller.java#L44-L56 | train | marshalls the given DeleteRuleGroupRequest to the JSON - compatible parameter object. | Of course, here is the Java code you requested:
```java
public void marshall(DeleteRuleGroupRequest deleteRuleGroupRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteRuleGroupRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
tr... |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/HarFileSystem.java | HarFileSystem.fileStatusesInIndex | private void fileStatusesInIndex(HarStatus parent, List<FileStatus> statuses,
List<String> children, FileStatus archiveIndexStat) throws IOException {
// read the index file
FSDataInputStream aIn = null;
try {
aIn = fs.open(archiveIndex);
LineReader aLin;
long read = 0;
aLin = ... | java | private void fileStatusesInIndex(HarStatus parent, List<FileStatus> statuses,
List<String> children, FileStatus archiveIndexStat) throws IOException {
// read the index file
FSDataInputStream aIn = null;
try {
aIn = fs.open(archiveIndex);
LineReader aLin;
long read = 0;
aLin = ... | [
"private",
"void",
"fileStatusesInIndex",
"(",
"HarStatus",
"parent",
",",
"List",
"<",
"FileStatus",
">",
"statuses",
",",
"List",
"<",
"String",
">",
"children",
",",
"FileStatus",
"archiveIndexStat",
")",
"throws",
"IOException",
"{",
"// read the index file",
... | Get filestatuses of all the children of a given directory. This just reads
through index file and reads line by line to get all statuses for children
of a directory. Its a brute force way of getting all such filestatuses
@param parent
the parent path directory
@param statuses
the list to add the children filestatuses ... | [
"Get",
"filestatuses",
"of",
"all",
"the",
"children",
"of",
"a",
"given",
"directory",
".",
"This",
"just",
"reads",
"through",
"index",
"file",
"and",
"reads",
"line",
"by",
"line",
"to",
"get",
"all",
"statuses",
"for",
"children",
"of",
"a",
"directory... | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L528-L572 | train | fileStatusesInIndex This method reads the index file and adds the statuses to the statuses list. | Of course, here is the Java code you requested:
```java
private void fileStatusesInIndex(HarStatus parent, List<FileStatus> statuses,
List<String> children, FileStatus archiveIndexStat) throws IOException {
// read the index file
FSDataInputStream aIn = null;
try {
aIn = fs.open(archiveIndex);
... |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/json/JSONDeserializer.java | JSONDeserializer.fromString | public final IJSONSerializable<?> fromString(String string, final ValidationContext ctx)
{
try
{
ctx.push("fromString");
if (null == (string = StringOps.toTrimOrNull(string)))
{
ctx.addError("NULL JSON String");
return n... | java | public final IJSONSerializable<?> fromString(String string, final ValidationContext ctx)
{
try
{
ctx.push("fromString");
if (null == (string = StringOps.toTrimOrNull(string)))
{
ctx.addError("NULL JSON String");
return n... | [
"public",
"final",
"IJSONSerializable",
"<",
"?",
">",
"fromString",
"(",
"String",
"string",
",",
"final",
"ValidationContext",
"ctx",
")",
"{",
"try",
"{",
"ctx",
".",
"push",
"(",
"\"fromString\"",
")",
";",
"if",
"(",
"null",
"==",
"(",
"string",
"="... | Parses the JSON string and returns the IJSONSerializable.
Use this method if you need to parse JSON that may contain one or more errors.
<pre>
ValidationContext ctx = new ValidationContext();
ctx.setValidate(true);
ctx.setStopOnError(false); // find all errors
IJSONSerializable<?> node = JSONDeserializer.getInstance().... | [
"Parses",
"the",
"JSON",
"string",
"and",
"returns",
"the",
"IJSONSerializable",
".",
"Use",
"this",
"method",
"if",
"you",
"need",
"to",
"parse",
"JSON",
"that",
"may",
"contain",
"one",
"or",
"more",
"errors",
".",
"<pre",
">",
"ValidationContext",
"ctx",
... | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/json/JSONDeserializer.java#L150-L184 | train | Creates a hierarchical object from a string. | Of course, here is the Java code you requested:
```java
public final IJSONSerializable<?> fromString(String string, final ValidationContext ctx)
{
try
{
ctx.push("fromString");
if (null == (string = StringOps.toTrimOrNull(string)))
{
ctx.... |
EdwardRaff/JSAT | JSAT/src/jsat/utils/IntPriorityQueue.java | IntPriorityQueue.heapifyUp | private void heapifyUp(int i)
{
int iP = parent(i);
while(i != 0 && cmp(i, iP) < 0)//Should not be greater then our parent
{
swapHeapValues(iP, i);
i = iP;
iP = parent(i);
}
} | java | private void heapifyUp(int i)
{
int iP = parent(i);
while(i != 0 && cmp(i, iP) < 0)//Should not be greater then our parent
{
swapHeapValues(iP, i);
i = iP;
iP = parent(i);
}
} | [
"private",
"void",
"heapifyUp",
"(",
"int",
"i",
")",
"{",
"int",
"iP",
"=",
"parent",
"(",
"i",
")",
";",
"while",
"(",
"i",
"!=",
"0",
"&&",
"cmp",
"(",
"i",
",",
"iP",
")",
"<",
"0",
")",
"//Should not be greater then our parent",
"{",
"swapHeapVa... | Heapify up from the given index in the heap and make sure everything is
correct. Stops when the child value is in correct order with its parent.
@param i the index in the heap to start checking from. | [
"Heapify",
"up",
"from",
"the",
"given",
"index",
"in",
"the",
"heap",
"and",
"make",
"sure",
"everything",
"is",
"correct",
".",
"Stops",
"when",
"the",
"child",
"value",
"is",
"in",
"correct",
"order",
"with",
"its",
"parent",
"."
] | 0ff53b7b39684b2379cc1da522f5b3a954b15cfb | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/IntPriorityQueue.java#L272-L281 | train | Heapify up the elements of the array i. | Of course, here is the Java code you requested:
```java
private void heapifyUp(int i)
{
int iP = parent(i);
while(i != 0 && cmp(i, iP) < 0)//Should not be greater then our parent
{
swapHeapValues(iP, i);
i = iP;
iP = parent(i);
}
}
```
Hope t... |
googlemaps/google-maps-services-java | src/main/java/com/google/maps/internal/UrlSigner.java | UrlSigner.getSignature | public String getSignature(String path) {
byte[] digest = getMac().doFinal(path.getBytes(UTF_8));
return ByteString.of(digest).base64().replace('+', '-').replace('/', '_');
} | java | public String getSignature(String path) {
byte[] digest = getMac().doFinal(path.getBytes(UTF_8));
return ByteString.of(digest).base64().replace('+', '-').replace('/', '_');
} | [
"public",
"String",
"getSignature",
"(",
"String",
"path",
")",
"{",
"byte",
"[",
"]",
"digest",
"=",
"getMac",
"(",
")",
".",
"doFinal",
"(",
"path",
".",
"getBytes",
"(",
"UTF_8",
")",
")",
";",
"return",
"ByteString",
".",
"of",
"(",
"digest",
")"... | Generate url safe HmacSHA1 of a path. | [
"Generate",
"url",
"safe",
"HmacSHA1",
"of",
"a",
"path",
"."
] | 23d20d1930f80e310d856d2da51d72ee0db4476b | https://github.com/googlemaps/google-maps-services-java/blob/23d20d1930f80e310d856d2da51d72ee0db4476b/src/main/java/com/google/maps/internal/UrlSigner.java#L52-L55 | train | Get the signature of a path. | Of course, here is the Java code you requested:
```java
public String getSignature(String path) {
byte[] digest = getMac().doFinal(path.getBytes(UTF_8));
return ByteString.of(digest).base64().replace('+', '-').replace('/', '_');
}
```
Hope this helps! |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/RepositoryTypeClass.java | RepositoryTypeClass.getEnvType | @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )
@JoinColumn(name="ENVIRONMENT_TYPE_ID", nullable = false)
public EnvironmentType getEnvType()
{
return envType;
} | java | @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )
@JoinColumn(name="ENVIRONMENT_TYPE_ID", nullable = false)
public EnvironmentType getEnvType()
{
return envType;
} | [
"@",
"ManyToOne",
"(",
"cascade",
"=",
"{",
"CascadeType",
".",
"PERSIST",
",",
"CascadeType",
".",
"MERGE",
"}",
")",
"@",
"JoinColumn",
"(",
"name",
"=",
"\"ENVIRONMENT_TYPE_ID\"",
",",
"nullable",
"=",
"false",
")",
"public",
"EnvironmentType",
"getEnvType"... | <p>Getter for the field <code>envType</code>.</p>
@return a {@link com.greenpepper.server.domain.EnvironmentType} object. | [
"<p",
">",
"Getter",
"for",
"the",
"field",
"<code",
">",
"envType<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | 2a61e6c179b74085babcc559d677490b0cad2d30 | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/RepositoryTypeClass.java#L64-L69 | train | Gets the value of the environment type property. | Of course, here is the Java code you requested:
```java
@ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )
@JoinColumn(name="ENVIRONMENT_TYPE_ID", nullable = false)
public EnvironmentType getEnvType()
{
return envType;
}
```
Hope this helps! |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FsStateBackend.java | FsStateBackend.createCheckpointStorage | @Override
public CheckpointStorage createCheckpointStorage(JobID jobId) throws IOException {
checkNotNull(jobId, "jobId");
return new FsCheckpointStorage(getCheckpointPath(), getSavepointPath(), jobId, getMinFileSizeThreshold());
} | java | @Override
public CheckpointStorage createCheckpointStorage(JobID jobId) throws IOException {
checkNotNull(jobId, "jobId");
return new FsCheckpointStorage(getCheckpointPath(), getSavepointPath(), jobId, getMinFileSizeThreshold());
} | [
"@",
"Override",
"public",
"CheckpointStorage",
"createCheckpointStorage",
"(",
"JobID",
"jobId",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"jobId",
",",
"\"jobId\"",
")",
";",
"return",
"new",
"FsCheckpointStorage",
"(",
"getCheckpointPath",
"(",
")",... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FsStateBackend.java#L447-L451 | train | Create a checkpoint storage. | Of course, here is the Java code you requested:
```java
@Override
public CheckpointStorage createCheckpointStorage(JobID jobId) throws IOException {
checkNotNull(jobId, "jobId");
return new FsCheckpointStorage(getCheckpointPath(), getSavepointPath(), jobId, getMinFileSizeThreshold());
}
```
Hope this helps! |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/AbstractNileChronology.java | AbstractNileChronology.range | @Override
public ValueRange range(ChronoField field) {
switch (field) {
case DAY_OF_MONTH:
return DOM_RANGE;
case ALIGNED_WEEK_OF_MONTH:
return ALIGNED_WOM_RANGE;
case MONTH_OF_YEAR:
return MOY_RANGE;
case PROLEP... | java | @Override
public ValueRange range(ChronoField field) {
switch (field) {
case DAY_OF_MONTH:
return DOM_RANGE;
case ALIGNED_WEEK_OF_MONTH:
return ALIGNED_WOM_RANGE;
case MONTH_OF_YEAR:
return MOY_RANGE;
case PROLEP... | [
"@",
"Override",
"public",
"ValueRange",
"range",
"(",
"ChronoField",
"field",
")",
"{",
"switch",
"(",
"field",
")",
"{",
"case",
"DAY_OF_MONTH",
":",
"return",
"DOM_RANGE",
";",
"case",
"ALIGNED_WEEK_OF_MONTH",
":",
"return",
"ALIGNED_WOM_RANGE",
";",
"case",
... | ----------------------------------------------------------------------- | [
"-----------------------------------------------------------------------"
] | e94ecd3592ef70e54d6eea21095239ea9ffbab78 | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/AbstractNileChronology.java#L103-L122 | train | Override the range method for a calendar field. | Of course, here is the Java code you requested:
```java
@Override
public ValueRange range(ChronoField field) {
switch (field) {
case DAY_OF_MONTH:
return DOM_RANGE;
case ALIGNED_WEEK_OF_MONTH:
return ALIGNED_WOM_RANGE;
case MONTH_OF_YEAR:
... |
BellaDati/belladati-sdk-java | src/main/java/com/belladati/sdk/dashboard/impl/DashletImpl.java | DashletImpl.getContentView | private View getContentView(BellaDatiServiceImpl service, JsonNode node) throws UnsupportedDashletContentException {
if (!node.hasNonNull("canAccessViewReport") || !node.get("canAccessViewReport").asBoolean()) {
throw new UnsupportedDashletContentException("View not accessible");
}
if (!node.hasNonNull("viewRe... | java | private View getContentView(BellaDatiServiceImpl service, JsonNode node) throws UnsupportedDashletContentException {
if (!node.hasNonNull("canAccessViewReport") || !node.get("canAccessViewReport").asBoolean()) {
throw new UnsupportedDashletContentException("View not accessible");
}
if (!node.hasNonNull("viewRe... | [
"private",
"View",
"getContentView",
"(",
"BellaDatiServiceImpl",
"service",
",",
"JsonNode",
"node",
")",
"throws",
"UnsupportedDashletContentException",
"{",
"if",
"(",
"!",
"node",
".",
"hasNonNull",
"(",
"\"canAccessViewReport\"",
")",
"||",
"!",
"node",
".",
... | Reads view content from a dashlet node. | [
"Reads",
"view",
"content",
"from",
"a",
"dashlet",
"node",
"."
] | 1a732a57ebc825ddf47ce405723cc958adb1a43f | https://github.com/BellaDati/belladati-sdk-java/blob/1a732a57ebc825ddf47ce405723cc958adb1a43f/src/main/java/com/belladati/sdk/dashboard/impl/DashletImpl.java#L57-L69 | train | Get the content view from the dashlet node. | Of course, here is the Java code you requested:
```java
private View getContentView(BellaDatiServiceImpl service, JsonNode node) throws UnsupportedDashletContentException {
if (!node.hasNonNull("canAccessViewReport") || !node.get("canAccessViewReport").asBoolean()) {
throw new UnsupportedDashletContentException("... |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfAction.java | PdfAction.javaScript | public static PdfAction javaScript(String code, PdfWriter writer, boolean unicode) {
PdfAction js = new PdfAction();
js.put(PdfName.S, PdfName.JAVASCRIPT);
if (unicode && code.length() < 50) {
js.put(PdfName.JS, new PdfString(code, PdfObject.TEXT_UNICODE));
}
else... | java | public static PdfAction javaScript(String code, PdfWriter writer, boolean unicode) {
PdfAction js = new PdfAction();
js.put(PdfName.S, PdfName.JAVASCRIPT);
if (unicode && code.length() < 50) {
js.put(PdfName.JS, new PdfString(code, PdfObject.TEXT_UNICODE));
}
else... | [
"public",
"static",
"PdfAction",
"javaScript",
"(",
"String",
"code",
",",
"PdfWriter",
"writer",
",",
"boolean",
"unicode",
")",
"{",
"PdfAction",
"js",
"=",
"new",
"PdfAction",
"(",
")",
";",
"js",
".",
"put",
"(",
"PdfName",
".",
"S",
",",
"PdfName",
... | Creates a JavaScript action. If the JavaScript is smaller than
50 characters it will be placed as a string, otherwise it will
be placed as a compressed stream.
@param code the JavaScript code
@param writer the writer for this action
@param unicode select JavaScript unicode. Note that the internal
Acrobat JavaScript eng... | [
"Creates",
"a",
"JavaScript",
"action",
".",
"If",
"the",
"JavaScript",
"is",
"smaller",
"than",
"50",
"characters",
"it",
"will",
"be",
"placed",
"as",
"a",
"string",
"otherwise",
"it",
"will",
"be",
"placed",
"as",
"a",
"compressed",
"stream",
"."
] | 438fc1899367fd13dfdfa8dfdca9a3c1a7783b84 | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfAction.java#L292-L313 | train | Creates a Java script action. | Of course, here is the Java code you requested:
```java
public static PdfAction javaScript(String code, PdfWriter writer, boolean unicode) {
PdfAction js = new PdfAction();
js.put(PdfName.S, PdfName.JAVASCRIPT);
if (unicode && code.length() < 50) {
js.put(PdfName.JS, new PdfStri... |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/v2/V2RemoteModel.java | V2RemoteModel.getTimeout | @Override
public Integer getTimeout() {
String timeout = getModelAttribute("timeout");
return timeout != null ? Integer.valueOf(timeout) : null;
} | java | @Override
public Integer getTimeout() {
String timeout = getModelAttribute("timeout");
return timeout != null ? Integer.valueOf(timeout) : null;
} | [
"@",
"Override",
"public",
"Integer",
"getTimeout",
"(",
")",
"{",
"String",
"timeout",
"=",
"getModelAttribute",
"(",
"\"timeout\"",
")",
";",
"return",
"timeout",
"!=",
"null",
"?",
"Integer",
".",
"valueOf",
"(",
"timeout",
")",
":",
"null",
";",
"}"
] | {@inheritDoc} | [
"{"
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/v2/V2RemoteModel.java#L87-L91 | train | Get the timeout value. | Of course, here is the Java code you requested:
```java
@Override
public Integer getTimeout() {
String timeout = getModelAttribute("timeout");
return timeout != null ? Integer.valueOf(timeout) : null;
}
```
Hope this helps! |
cerner/beadledom | health/service/src/main/java/com/cerner/beadledom/health/internal/HealthChecker.java | HealthChecker.doPrimaryHealthCheck | public HealthDto doPrimaryHealthCheck() {
List<HealthDependency> primaryHealthDependencies = healthDependencies.values().stream()
.filter(HealthDependency::isPrimary)
.collect(Collectors.toList());
return checkHealth(primaryHealthDependencies);
} | java | public HealthDto doPrimaryHealthCheck() {
List<HealthDependency> primaryHealthDependencies = healthDependencies.values().stream()
.filter(HealthDependency::isPrimary)
.collect(Collectors.toList());
return checkHealth(primaryHealthDependencies);
} | [
"public",
"HealthDto",
"doPrimaryHealthCheck",
"(",
")",
"{",
"List",
"<",
"HealthDependency",
">",
"primaryHealthDependencies",
"=",
"healthDependencies",
".",
"values",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"HealthDependency",
"::",
"isPrimary",... | Performs the Primary Health Check.
<p>The resulting DTO will contain information about the health of all the main dependencies
(currently, all dependencies) as well as an overall status of either 200 (if all dependencies
are healthy) or 503 (if one or more dependencies are unhealthy) and corresponding message.
Other m... | [
"Performs",
"the",
"Primary",
"Health",
"Check",
"."
] | 75435bced5187d5455b46518fadf85c93cf32014 | https://github.com/cerner/beadledom/blob/75435bced5187d5455b46518fadf85c93cf32014/health/service/src/main/java/com/cerner/beadledom/health/internal/HealthChecker.java#L59-L64 | train | Check if the primary health check is performed | Of course, here is the Java code you requested:
```java
public HealthDto doPrimaryHealthCheck() {
List<HealthDependency> primaryHealthDependencies = healthDependencies.values().stream()
.filter(HealthDependency::isPrimary)
.collect(Collectors.toList());
return checkHealth(primaryHealthDependenc... |
albfernandez/itext2 | src/main/java/com/lowagie/text/xml/xmp/XmpBasicSchema.java | XmpBasicSchema.addIdentifiers | public void addIdentifiers(String[] id) {
XmpArray array = new XmpArray(XmpArray.UNORDERED);
for (int i = 0; i < id.length; i++) {
array.add(id[i]);
}
setProperty(IDENTIFIER, array);
} | java | public void addIdentifiers(String[] id) {
XmpArray array = new XmpArray(XmpArray.UNORDERED);
for (int i = 0; i < id.length; i++) {
array.add(id[i]);
}
setProperty(IDENTIFIER, array);
} | [
"public",
"void",
"addIdentifiers",
"(",
"String",
"[",
"]",
"id",
")",
"{",
"XmpArray",
"array",
"=",
"new",
"XmpArray",
"(",
"XmpArray",
".",
"UNORDERED",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"id",
".",
"length",
";",
"i",
... | Adds the identifier.
@param id | [
"Adds",
"the",
"identifier",
"."
] | 438fc1899367fd13dfdfa8dfdca9a3c1a7783b84 | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/xml/xmp/XmpBasicSchema.java#L123-L129 | train | Add identifiers to the identifier list. | Of course, here is the Java code you requested:
```java
public void addIdentifiers(String[] id) {
XmpArray array = new XmpArray(XmpArray.UNORDERED);
for (int i = 0; i < id.length; i++) {
array.add(id[i]);
}
setProperty(IDENTIFIER, array);
}
```
Hope this helps! |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java | Subtypes2.computeFirstCommonSuperclassOfDifferentDimensionArrays | private ReferenceType computeFirstCommonSuperclassOfDifferentDimensionArrays(ArrayType aArrType, ArrayType bArrType) {
assert aArrType.getDimensions() != bArrType.getDimensions();
boolean aBaseTypeIsPrimitive = (aArrType.getBasicType() instanceof BasicType);
boolean bBaseTypeIsPrimitive = (bArr... | java | private ReferenceType computeFirstCommonSuperclassOfDifferentDimensionArrays(ArrayType aArrType, ArrayType bArrType) {
assert aArrType.getDimensions() != bArrType.getDimensions();
boolean aBaseTypeIsPrimitive = (aArrType.getBasicType() instanceof BasicType);
boolean bBaseTypeIsPrimitive = (bArr... | [
"private",
"ReferenceType",
"computeFirstCommonSuperclassOfDifferentDimensionArrays",
"(",
"ArrayType",
"aArrType",
",",
"ArrayType",
"bArrType",
")",
"{",
"assert",
"aArrType",
".",
"getDimensions",
"(",
")",
"!=",
"bArrType",
".",
"getDimensions",
"(",
")",
";",
"bo... | Get the first common superclass of arrays with different numbers of
dimensions.
@param aArrType
an ArrayType
@param bArrType
another ArrayType
@return ReferenceType representing first common superclass | [
"Get",
"the",
"first",
"common",
"superclass",
"of",
"arrays",
"with",
"different",
"numbers",
"of",
"dimensions",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java#L643-L680 | train | Compute the first common supertype of two arrays. | Of course, here is the Java code you requested:
```java
private ReferenceType computeFirstCommonSuperclassOfDifferentDimensionArrays(ArrayType aArrType, ArrayType bArrType) {
assert aArrType.getDimensions() != bArrType.getDimensions();
boolean aBaseTypeIsPrimitive = (aArrType.getBasicType() instanceof... |
box/box-java-sdk | src/main/java/com/box/sdk/BoxGroup.java | BoxGroup.getAllGroups | public static Iterable<BoxGroup.Info> getAllGroups(final BoxAPIConnection api, String ... fields) {
final QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
return new Iterable<BoxGroup.Info>() {
... | java | public static Iterable<BoxGroup.Info> getAllGroups(final BoxAPIConnection api, String ... fields) {
final QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
return new Iterable<BoxGroup.Info>() {
... | [
"public",
"static",
"Iterable",
"<",
"BoxGroup",
".",
"Info",
">",
"getAllGroups",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"String",
"...",
"fields",
")",
"{",
"final",
"QueryStringBuilder",
"builder",
"=",
"new",
"QueryStringBuilder",
"(",
")",
";",
"if... | Gets an iterable of all the groups in the enterprise.
@param api the API connection to be used when retrieving the groups.
@param fields the fields to retrieve.
@return an iterable containing info about all the groups. | [
"Gets",
"an",
"iterable",
"of",
"all",
"the",
"groups",
"in",
"the",
"enterprise",
"."
] | 35b4ba69417f9d6a002c19dfaab57527750ef349 | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxGroup.java#L130-L141 | train | Gets all groups. | Of course, here is the Java code you requested:
```java
public static Iterable<BoxGroup.Info> getAllGroups(final BoxAPIConnection api, String ... fields) {
final QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AIBrowseCursor.java | AIBrowseCursor.failureReasonToString | private String failureReasonToString(int failureReason)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "failureReasonToString", new Integer(failureReason));
String frString = "";
switch (failureReason)
{
case SIMPConstants.BROWSE_STORE_EXCEPTION:
... | java | private String failureReasonToString(int failureReason)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "failureReasonToString", new Integer(failureReason));
String frString = "";
switch (failureReason)
{
case SIMPConstants.BROWSE_STORE_EXCEPTION:
... | [
"private",
"String",
"failureReasonToString",
"(",
"int",
"failureReason",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"failureReasonToS... | //////////////////////////////////////////////////////////// | [
"////////////////////////////////////////////////////////////"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AIBrowseCursor.java#L328-L355 | train | Method failureReasonToString. | Of course, here is the Java code you requested:
```java
private String failureReasonToString(int failureReason)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "failureReasonToString", new Integer(failureReason));
String frString = "";
switch (failureReason)
... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfo.java | BuildInfo.generateBuildProperties | @TaskAction
public void generateBuildProperties() {
try {
new BuildPropertiesWriter(new File(getDestinationDir(),
"build-info.properties")).writeBuildProperties(new ProjectDetails(
this.properties.getGroup(),
(this.properties.getArtifact() != null)
? this.properties.getArtifact() : "un... | java | @TaskAction
public void generateBuildProperties() {
try {
new BuildPropertiesWriter(new File(getDestinationDir(),
"build-info.properties")).writeBuildProperties(new ProjectDetails(
this.properties.getGroup(),
(this.properties.getArtifact() != null)
? this.properties.getArtifact() : "un... | [
"@",
"TaskAction",
"public",
"void",
"generateBuildProperties",
"(",
")",
"{",
"try",
"{",
"new",
"BuildPropertiesWriter",
"(",
"new",
"File",
"(",
"getDestinationDir",
"(",
")",
",",
"\"build-info.properties\"",
")",
")",
".",
"writeBuildProperties",
"(",
"new",
... | Generates the {@code build-info.properties} file in the configured
{@link #setDestinationDir(File) destination}. | [
"Generates",
"the",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfo.java#L53-L68 | train | Generate build - info. properties file. | Of course, here is the Java code you requested:
```java
@TaskAction
public void generateBuildProperties() {
try {
new BuildPropertiesWriter(new File(getDestinationDir(),
"build-info.properties")).writeBuildProperties(new ProjectDetails(
this.properties.getGroup(),
(this.properties.getArtifact(... |
k3po/k3po | specification/socks5/src/main/java/org/kaazing/specification/socks5/internal/Functions.java | Functions.createServerGSSContext | @Function
public static GSSContext createServerGSSContext() {
System.out.println("createServerGSSContext()...");
try {
final GSSManager manager = GSSManager.getInstance();
//
// Create server credentials to accept kerberos tokens. This should
// make... | java | @Function
public static GSSContext createServerGSSContext() {
System.out.println("createServerGSSContext()...");
try {
final GSSManager manager = GSSManager.getInstance();
//
// Create server credentials to accept kerberos tokens. This should
// make... | [
"@",
"Function",
"public",
"static",
"GSSContext",
"createServerGSSContext",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"createServerGSSContext()...\"",
")",
";",
"try",
"{",
"final",
"GSSManager",
"manager",
"=",
"GSSManager",
".",
"getInstance",... | Create a GSS Context not tied to any server name. Peers acting as a server
create their context this way.
@return the newly created GSS Context | [
"Create",
"a",
"GSS",
"Context",
"not",
"tied",
"to",
"any",
"server",
"name",
".",
"Peers",
"acting",
"as",
"a",
"server",
"create",
"their",
"context",
"this",
"way",
"."
] | 3ca4fd31ab4a397893aa640c62ada0e485c8bbd4 | https://github.com/k3po/k3po/blob/3ca4fd31ab4a397893aa640c62ada0e485c8bbd4/specification/socks5/src/main/java/org/kaazing/specification/socks5/internal/Functions.java#L175-L210 | train | Create a server GSSContext. | Of course, here is the Java code you requested:
```java
@Function
public static GSSContext createServerGSSContext() {
System.out.println("createServerGSSContext()...");
try {
final GSSManager manager = GSSManager.getInstance();
//
// Create server credentials to... |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpmanager.java | snmpmanager.delete | public static base_response delete(nitro_service client, snmpmanager resource) throws Exception {
snmpmanager deleteresource = new snmpmanager();
deleteresource.ipaddress = resource.ipaddress;
deleteresource.netmask = resource.netmask;
return deleteresource.delete_resource(client);
} | java | public static base_response delete(nitro_service client, snmpmanager resource) throws Exception {
snmpmanager deleteresource = new snmpmanager();
deleteresource.ipaddress = resource.ipaddress;
deleteresource.netmask = resource.netmask;
return deleteresource.delete_resource(client);
} | [
"public",
"static",
"base_response",
"delete",
"(",
"nitro_service",
"client",
",",
"snmpmanager",
"resource",
")",
"throws",
"Exception",
"{",
"snmpmanager",
"deleteresource",
"=",
"new",
"snmpmanager",
"(",
")",
";",
"deleteresource",
".",
"ipaddress",
"=",
"res... | Use this API to delete snmpmanager. | [
"Use",
"this",
"API",
"to",
"delete",
"snmpmanager",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/snmp/snmpmanager.java#L203-L208 | train | Use this API to delete snmpmanager. | Of course, here is the Java code you requested:
```java
public static base_response delete(nitro_service client, snmpmanager resource) throws Exception {
snmpmanager deleteresource = new snmpmanager();
deleteresource.ipaddress = resource.ipaddress;
deleteresource.netmask = resource.netmask;
return deleteresour... |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentLine.java | DocumentLine.getEndings | public FloatArray getEndings() {
if (DocumentLine_Type.featOkTst && ((DocumentLine_Type)jcasType).casFeat_endings == null)
jcasType.jcas.throwFeatMissing("endings", "ch.epfl.bbp.uima.types.DocumentLine");
return (FloatArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((DocumentLin... | java | public FloatArray getEndings() {
if (DocumentLine_Type.featOkTst && ((DocumentLine_Type)jcasType).casFeat_endings == null)
jcasType.jcas.throwFeatMissing("endings", "ch.epfl.bbp.uima.types.DocumentLine");
return (FloatArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((DocumentLin... | [
"public",
"FloatArray",
"getEndings",
"(",
")",
"{",
"if",
"(",
"DocumentLine_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DocumentLine_Type",
")",
"jcasType",
")",
".",
"casFeat_endings",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
... | getter for endings - gets
@generated
@return value of the feature | [
"getter",
"for",
"endings",
"-",
"gets"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentLine.java#L174-L177 | train | getter for endings - gets | Of course, here is the Java code you requested:
```java
public FloatArray getEndings() {
if (DocumentLine_Type.featOkTst && ((DocumentLine_Type)jcasType).casFeat_endings == null)
jcasType.jcas.throwFeatMissing("endings", "ch.epfl.bbp.uima.types.DocumentLine");
return (FloatArray)(jcasType.ll_cas.ll_getFS... |
LevelFourAB/commons | commons-io/src/main/java/se/l4/commons/io/BytesBuilder.java | BytesBuilder.addChunk | public BytesBuilder addChunk(@NonNull byte[] buffer, int offset, int length)
{
Objects.requireNonNull(buffer);
out.write(buffer, offset, length);
return this;
} | java | public BytesBuilder addChunk(@NonNull byte[] buffer, int offset, int length)
{
Objects.requireNonNull(buffer);
out.write(buffer, offset, length);
return this;
} | [
"public",
"BytesBuilder",
"addChunk",
"(",
"@",
"NonNull",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"buffer",
")",
";",
"out",
".",
"write",
"(",
"buffer",
",",
"offset",
"... | Add a chunk of data to the {@link Bytes} instance.
@param buffer
byte data to add
@param offset
offset to start adding byte data from
@param length
the length of the data to add | [
"Add",
"a",
"chunk",
"of",
"data",
"to",
"the",
"{",
"@link",
"Bytes",
"}",
"instance",
"."
] | aa121b3a5504b43d0c10450a1b984694fcd2b8ee | https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-io/src/main/java/se/l4/commons/io/BytesBuilder.java#L46-L52 | train | Adds a chunk of bytes to the BytesBuilder. | Of course, here is the Java code you requested:
```java
public BytesBuilder addChunk(@NonNull byte[] buffer, int offset, int length)
{
Objects.requireNonNull(buffer);
out.write(buffer, offset, length);
return this;
}
```
Hope this helps! |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java | BaseApplet.popBrowserHistory | public void popBrowserHistory(int quanityToPop, boolean bCommandHandledByJava, String browserTitle)
{
if (this.getBrowserManager() != null)
this.getBrowserManager().popBrowserHistory(quanityToPop, bCommandHandledByJava, this.getStatusText(Constants.INFORMATION)); // Let browser know about... | java | public void popBrowserHistory(int quanityToPop, boolean bCommandHandledByJava, String browserTitle)
{
if (this.getBrowserManager() != null)
this.getBrowserManager().popBrowserHistory(quanityToPop, bCommandHandledByJava, this.getStatusText(Constants.INFORMATION)); // Let browser know about... | [
"public",
"void",
"popBrowserHistory",
"(",
"int",
"quanityToPop",
",",
"boolean",
"bCommandHandledByJava",
",",
"String",
"browserTitle",
")",
"{",
"if",
"(",
"this",
".",
"getBrowserManager",
"(",
")",
"!=",
"null",
")",
"this",
".",
"getBrowserManager",
"(",
... | Pop commands off the browser stack.
@param quanityToPop The number of commands to pop off the stack
@param bCommandHandledByJava If I say false, the browser will do a 'back', otherwise, it just pops to top command(s) | [
"Pop",
"commands",
"off",
"the",
"browser",
"stack",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java#L1279-L1283 | train | Pop the browser history. | Of course, here is the Java code you requested:
```java
public void popBrowserHistory(int quanityToPop, boolean bCommandHandledByJava, String browserTitle)
{
if (this.getBrowserManager() != null)
this.getBrowserManager().popBrowserHistory(quanityToPop, bCommandHandledByJava, this.getStatusText(... |
Wikidata/Wikidata-Toolkit | wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/ApiConnection.java | ApiConnection.checkErrors | public void checkErrors(JsonNode root) throws MediaWikiApiErrorException {
if (root.has("error")) {
JsonNode errorNode = root.path("error");
MediaWikiApiErrorHandler.throwMediaWikiApiErrorException(errorNode
.path("code").asText("UNKNOWN"), errorNode.path("info")
.asText("No details provided"));
}
... | java | public void checkErrors(JsonNode root) throws MediaWikiApiErrorException {
if (root.has("error")) {
JsonNode errorNode = root.path("error");
MediaWikiApiErrorHandler.throwMediaWikiApiErrorException(errorNode
.path("code").asText("UNKNOWN"), errorNode.path("info")
.asText("No details provided"));
}
... | [
"public",
"void",
"checkErrors",
"(",
"JsonNode",
"root",
")",
"throws",
"MediaWikiApiErrorException",
"{",
"if",
"(",
"root",
".",
"has",
"(",
"\"error\"",
")",
")",
"{",
"JsonNode",
"errorNode",
"=",
"root",
".",
"path",
"(",
"\"error\"",
")",
";",
"Medi... | @deprecated Use ApiConnection.sendJsonRequest that executes this method
Checks if an API response contains an error and throws a suitable
exception in this case.
@param root
root node of the JSON result
@throws MediaWikiApiErrorException | [
"@deprecated",
"Use",
"ApiConnection",
".",
"sendJsonRequest",
"that",
"executes",
"this",
"method"
] | 7732851dda47e1febff406fba27bfec023f4786e | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/ApiConnection.java#L463-L470 | train | Check errors in the given JSON node. | Of course, here is the Java code you requested:
```java
public void checkErrors(JsonNode root) throws MediaWikiApiErrorException {
if (root.has("error")) {
JsonNode errorNode = root.path("error");
MediaWikiApiErrorHandler.throwMediaWikiApiErrorException(errorNode
.path("code").asText("UNKNOWN"), errorNode... |
jbundle/jbundle | thin/base/screen/cal/grid/src/main/java/org/jbundle/thin/base/screen/cal/grid/JCalendarScreen.java | JCalendarScreen.free | public void free()
{
CalendarPanel panel = (CalendarPanel)JBasePanel.getSubScreen(this, CalendarPanel.class);
if (panel != null)
panel.free();
super.free();
} | java | public void free()
{
CalendarPanel panel = (CalendarPanel)JBasePanel.getSubScreen(this, CalendarPanel.class);
if (panel != null)
panel.free();
super.free();
} | [
"public",
"void",
"free",
"(",
")",
"{",
"CalendarPanel",
"panel",
"=",
"(",
"CalendarPanel",
")",
"JBasePanel",
".",
"getSubScreen",
"(",
"this",
",",
"CalendarPanel",
".",
"class",
")",
";",
"if",
"(",
"panel",
"!=",
"null",
")",
"panel",
".",
"free",
... | Free the sub=components. | [
"Free",
"the",
"sub",
"=",
"components",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/cal/grid/src/main/java/org/jbundle/thin/base/screen/cal/grid/JCalendarScreen.java#L76-L82 | train | Free the calendar. | Of course, here is the Java code you requested:
```java
public void free()
{
CalendarPanel panel = (CalendarPanel)JBasePanel.getSubScreen(this, CalendarPanel.class);
if (panel != null)
panel.free();
super.free();
}
```
Hope this helps! |
google/closure-compiler | src/com/google/javascript/jscomp/Compiler.java | Compiler.getModuleTypeByName | @Override
@Nullable
CompilerInput.ModuleType getModuleTypeByName(String moduleName) {
return moduleTypesByName.get(moduleName);
} | java | @Override
@Nullable
CompilerInput.ModuleType getModuleTypeByName(String moduleName) {
return moduleTypesByName.get(moduleName);
} | [
"@",
"Override",
"@",
"Nullable",
"CompilerInput",
".",
"ModuleType",
"getModuleTypeByName",
"(",
"String",
"moduleName",
")",
"{",
"return",
"moduleTypesByName",
".",
"get",
"(",
"moduleName",
")",
";",
"}"
] | Returns the module type for the provided namespace. | [
"Returns",
"the",
"module",
"type",
"for",
"the",
"provided",
"namespace",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Compiler.java#L3582-L3586 | train | Get the module type by name. | Of course, here is the Java code you requested:
```java
@Override
@Nullable
CompilerInput.ModuleType getModuleTypeByName(String moduleName) {
return moduleTypesByName.get(moduleName);
}
```
Hope this helps! |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/rbac/DefaultRoleManager.java | DefaultRoleManager.getRoles | @Override
public List<String> getRoles(String name, String... domain) {
if (domain.length == 1) {
name = domain[0] + "::" + name;
} else if (domain.length > 1) {
throw new Error("error: domain should be 1 parameter");
}
if (!hasRole(name)) {
throw... | java | @Override
public List<String> getRoles(String name, String... domain) {
if (domain.length == 1) {
name = domain[0] + "::" + name;
} else if (domain.length > 1) {
throw new Error("error: domain should be 1 parameter");
}
if (!hasRole(name)) {
throw... | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"getRoles",
"(",
"String",
"name",
",",
"String",
"...",
"domain",
")",
"{",
"if",
"(",
"domain",
".",
"length",
"==",
"1",
")",
"{",
"name",
"=",
"domain",
"[",
"0",
"]",
"+",
"\"::\"",
"+",
... | getRoles gets the roles that a subject inherits.
domain is a prefix to the roles. | [
"getRoles",
"gets",
"the",
"roles",
"that",
"a",
"subject",
"inherits",
".",
"domain",
"is",
"a",
"prefix",
"to",
"the",
"roles",
"."
] | b46d7a756b6c39cdb17e0600607e5fcdc66edd11 | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/rbac/DefaultRoleManager.java#L132-L151 | train | GetRoles Method. | Of course, here is the Java code you requested:
```java
@Override
public List<String> getRoles(String name, String... domain) {
if (domain.length == 1) {
name = domain[0] + "::" + name;
} else if (domain.length > 1) {
throw new Error("error: domain should be 1 parameter");
... |
alipay/sofa-rpc | core/common/src/main/java/com/alipay/sofa/rpc/common/struct/StopWatch.java | StopWatch.tick | public StopWatch tick() {
long old = ticker;
ticker = System.currentTimeMillis();
lastElapsed = (int) (ticker - old);
return this;
} | java | public StopWatch tick() {
long old = ticker;
ticker = System.currentTimeMillis();
lastElapsed = (int) (ticker - old);
return this;
} | [
"public",
"StopWatch",
"tick",
"(",
")",
"{",
"long",
"old",
"=",
"ticker",
";",
"ticker",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"lastElapsed",
"=",
"(",
"int",
")",
"(",
"ticker",
"-",
"old",
")",
";",
"return",
"this",
";",
"}"
] | 记录当前时间
@return StopWatch | [
"记录当前时间"
] | a31406410291e56696185a29c3ba4bd1f54488fd | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/common/src/main/java/com/alipay/sofa/rpc/common/struct/StopWatch.java#L44-L49 | train | Tick the stopwatch. | Of course, here is the Java code you requested:
```java
public StopWatch tick() {
long old = ticker;
ticker = System.currentTimeMillis();
lastElapsed = (int) (ticker - old);
return this;
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-directory/src/main/java/com/amazonaws/services/directory/AWSDirectoryServiceClient.java | AWSDirectoryServiceClient.createMicrosoftAD | @Override
public CreateMicrosoftADResult createMicrosoftAD(CreateMicrosoftADRequest request) {
request = beforeClientExecution(request);
return executeCreateMicrosoftAD(request);
} | java | @Override
public CreateMicrosoftADResult createMicrosoftAD(CreateMicrosoftADRequest request) {
request = beforeClientExecution(request);
return executeCreateMicrosoftAD(request);
} | [
"@",
"Override",
"public",
"CreateMicrosoftADResult",
"createMicrosoftAD",
"(",
"CreateMicrosoftADRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeCreateMicrosoftAD",
"(",
"request",
")",
";",
"}"
] | <p>
Creates an AWS Managed Microsoft AD directory.
</p>
<p>
Before you call <i>CreateMicrosoftAD</i>, ensure that all of the required permissions have been explicitly
granted through a policy. For details about what permissions are required to run the <i>CreateMicrosoftAD</i>
operation, see <a
href="http://docs.aws.ama... | [
"<p",
">",
"Creates",
"an",
"AWS",
"Managed",
"Microsoft",
"AD",
"directory",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Before",
"you",
"call",
"<i",
">",
"CreateMicrosoftAD<",
"/",
"i",
">",
"ensure",
"that",
"all",
"of",
"the",
"required",
"permissions",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-directory/src/main/java/com/amazonaws/services/directory/AWSDirectoryServiceClient.java#L1073-L1077 | train | Creates an Microsoft AD. | Of course, here is the Java code you requested:
```java
@Override
public CreateMicrosoftADResult createMicrosoftAD(CreateMicrosoftADRequest request) {
request = beforeClientExecution(request);
return executeCreateMicrosoftAD(request);
}
```
Hope this helps! |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java | SARLJvmModelInferrer.initialize | protected void initialize(SarlSkill source, JvmGenericType inferredJvmType) {
// Issue #356: do not generate if the skill has no name.
assert source != null;
assert inferredJvmType != null;
if (Strings.isNullOrEmpty(source.getName())) {
return;
}
// Create the generation context that is used by the other... | java | protected void initialize(SarlSkill source, JvmGenericType inferredJvmType) {
// Issue #356: do not generate if the skill has no name.
assert source != null;
assert inferredJvmType != null;
if (Strings.isNullOrEmpty(source.getName())) {
return;
}
// Create the generation context that is used by the other... | [
"protected",
"void",
"initialize",
"(",
"SarlSkill",
"source",
",",
"JvmGenericType",
"inferredJvmType",
")",
"{",
"// Issue #356: do not generate if the skill has no name.",
"assert",
"source",
"!=",
"null",
";",
"assert",
"inferredJvmType",
"!=",
"null",
";",
"if",
"(... | Initialize the SARL skill type.
@param source the source.
@param inferredJvmType the JVM type. | [
"Initialize",
"the",
"SARL",
"skill",
"type",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java#L1259-L1321 | train | Initialize the SARL skill. | Of course, here is the Java code you requested:
```java
protected void initialize(SarlSkill source, JvmGenericType inferredJvmType) {
// Issue #356: do not generate if the skill has no name.
assert source != null;
assert inferredJvmType != null;
if (Strings.isNullOrEmpty(source.getName())) {
return;
}
/... |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java | Ifc2x3tc1PackageImpl.getIfcProcedure | public EClass getIfcProcedure() {
if (ifcProcedureEClass == null) {
ifcProcedureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(384);
}
return ifcProcedureEClass;
} | java | public EClass getIfcProcedure() {
if (ifcProcedureEClass == null) {
ifcProcedureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(384);
}
return ifcProcedureEClass;
} | [
"public",
"EClass",
"getIfcProcedure",
"(",
")",
"{",
"if",
"(",
"ifcProcedureEClass",
"==",
"null",
")",
"{",
"ifcProcedureEClass",
"=",
"(",
"EClass",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage",
"(",
"Ifc2x3tc1Package",
".",
"eNS_U... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/Ifc2x3tc1PackageImpl.java#L21038-L21044 | train | Get the IfcProcedure feature from the ifcProcedure feature. | Of course, here is the Java code you requested:
```java
public EClass getIfcProcedure() {
if (ifcProcedureEClass == null) {
ifcProcedureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(384);
}
return ifcProcedureEClass;
}
```
Hope this help... |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/ContentNegotiator.java | ContentNegotiator.getNegotiatorState | @Override
public JingleNegotiatorState getNegotiatorState() {
JingleNegotiatorState result = JingleNegotiatorState.PENDING;
if ((mediaNeg != null) && (transNeg != null)) {
if ((mediaNeg.getNegotiatorState() == JingleNegotiatorState.SUCCEEDED)
|| (transNeg.getNegotia... | java | @Override
public JingleNegotiatorState getNegotiatorState() {
JingleNegotiatorState result = JingleNegotiatorState.PENDING;
if ((mediaNeg != null) && (transNeg != null)) {
if ((mediaNeg.getNegotiatorState() == JingleNegotiatorState.SUCCEEDED)
|| (transNeg.getNegotia... | [
"@",
"Override",
"public",
"JingleNegotiatorState",
"getNegotiatorState",
"(",
")",
"{",
"JingleNegotiatorState",
"result",
"=",
"JingleNegotiatorState",
".",
"PENDING",
";",
"if",
"(",
"(",
"mediaNeg",
"!=",
"null",
")",
"&&",
"(",
"transNeg",
"!=",
"null",
")"... | The negotiator state for the ContentNegotiators is a special case.
It is a roll-up of the sub-negotiator states. | [
"The",
"negotiator",
"state",
"for",
"the",
"ContentNegotiators",
"is",
"a",
"special",
"case",
".",
"It",
"is",
"a",
"roll",
"-",
"up",
"of",
"the",
"sub",
"-",
"negotiator",
"states",
"."
] | 870756997faec1e1bfabfac0cd6c2395b04da873 | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/ContentNegotiator.java#L331-L350 | train | Get the state of the Negotiator. | Of course, here is the Java code you requested:
```java
@Override
public JingleNegotiatorState getNegotiatorState() {
JingleNegotiatorState result = JingleNegotiatorState.PENDING;
if ((mediaNeg != null) && (transNeg != null)) {
if ((mediaNeg.getNegotiatorState() == JingleNegotiatorSta... |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java | SARLValidator.checkManualInlineDefinition | @Check
public void checkManualInlineDefinition(XtendAnnotationTarget annotationTarget) {
if (!isIgnored(MANUAL_INLINE_DEFINITION)) {
if (annotationTarget.getAnnotations().isEmpty() || !isRelevantAnnotationTarget(annotationTarget)) {
return;
}
final String inlineAnnotation = Inline.class.getName();
fo... | java | @Check
public void checkManualInlineDefinition(XtendAnnotationTarget annotationTarget) {
if (!isIgnored(MANUAL_INLINE_DEFINITION)) {
if (annotationTarget.getAnnotations().isEmpty() || !isRelevantAnnotationTarget(annotationTarget)) {
return;
}
final String inlineAnnotation = Inline.class.getName();
fo... | [
"@",
"Check",
"public",
"void",
"checkManualInlineDefinition",
"(",
"XtendAnnotationTarget",
"annotationTarget",
")",
"{",
"if",
"(",
"!",
"isIgnored",
"(",
"MANUAL_INLINE_DEFINITION",
")",
")",
"{",
"if",
"(",
"annotationTarget",
".",
"getAnnotations",
"(",
")",
... | Check for {@code @Inline} annotation usage.
@param annotationTarget thee target to test. | [
"Check",
"for",
"{",
"@code",
"@Inline",
"}",
"annotation",
"usage",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/validation/SARLValidator.java#L2236-L2255 | train | Check if the given annotation target is an inline annotation. | Of course, here is the Java code you requested:
```java
@Check
public void checkManualInlineDefinition(XtendAnnotationTarget annotationTarget) {
if (!isIgnored(MANUAL_INLINE_DEFINITION)) {
if (annotationTarget.getAnnotations().isEmpty() || !isRelevantAnnotationTarget(annotationTarget)) {
return;
}
fina... |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/beans/ELTools.java | ELTools.createValueExpression | public static ValueExpression createValueExpression(String p_expression) {
FacesContext context = FacesContext.getCurrentInstance();
ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
ELContext elContext = context.getELContext();
ValueExpression vex = expressionFactory.create... | java | public static ValueExpression createValueExpression(String p_expression) {
FacesContext context = FacesContext.getCurrentInstance();
ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
ELContext elContext = context.getELContext();
ValueExpression vex = expressionFactory.create... | [
"public",
"static",
"ValueExpression",
"createValueExpression",
"(",
"String",
"p_expression",
")",
"{",
"FacesContext",
"context",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
";",
"ExpressionFactory",
"expressionFactory",
"=",
"context",
".",
"getApplicat... | Utility method to create a JSF Value expression from the p_expression string
@param p_expression
@return | [
"Utility",
"method",
"to",
"create",
"a",
"JSF",
"Value",
"expression",
"from",
"the",
"p_expression",
"string"
] | d1a70952bc240979b5272fa4fe1c7f100873add0 | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/beans/ELTools.java#L52-L58 | train | Create a ValueExpression from a String | Of course, here is the Java code you requested:
```java
public static ValueExpression createValueExpression(String p_expression) {
FacesContext context = FacesContext.getCurrentInstance();
ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
ELContext elContext = context.getELCo... |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.pack | public static void pack(ZipEntrySource[] entries, File zip) {
if (log.isDebugEnabled()) {
log.debug("Creating '{}' from {}.", zip, Arrays.asList(entries));
}
OutputStream out = null;
try {
out = new BufferedOutputStream(new FileOutputStream(zip));
pack(entries, out, true);
}
c... | java | public static void pack(ZipEntrySource[] entries, File zip) {
if (log.isDebugEnabled()) {
log.debug("Creating '{}' from {}.", zip, Arrays.asList(entries));
}
OutputStream out = null;
try {
out = new BufferedOutputStream(new FileOutputStream(zip));
pack(entries, out, true);
}
c... | [
"public",
"static",
"void",
"pack",
"(",
"ZipEntrySource",
"[",
"]",
"entries",
",",
"File",
"zip",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Creating '{}' from {}.\"",
",",
"zip",
",",
"Arrays",
... | Compresses the given entries into a new ZIP file.
@param entries
ZIP entries added.
@param zip
new ZIP file created. | [
"Compresses",
"the",
"given",
"entries",
"into",
"a",
"new",
"ZIP",
"file",
"."
] | abb4dc43583e4d19339c0c021035019798970a13 | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L1996-L2012 | train | Packs the given array of entries into a single file. | Of course, here is the Java code you requested:
```java
public static void pack(ZipEntrySource[] entries, File zip) {
if (log.isDebugEnabled()) {
log.debug("Creating '{}' from {}.", zip, Arrays.asList(entries));
}
OutputStream out = null;
try {
out = new BufferedOutputStream(new FileOutput... |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEConfigCacheState.java | CmsADEConfigCacheState.emptyState | public static CmsADEConfigCacheState emptyState(CmsObject cms) {
return new CmsADEConfigCacheState(
cms,
Collections.<CmsUUID, CmsADEConfigDataInternal> emptyMap(),
Collections.<CmsADEConfigDataInternal> emptyList(),
Collections.<CmsUUID, CmsElementView> emptyMap... | java | public static CmsADEConfigCacheState emptyState(CmsObject cms) {
return new CmsADEConfigCacheState(
cms,
Collections.<CmsUUID, CmsADEConfigDataInternal> emptyMap(),
Collections.<CmsADEConfigDataInternal> emptyList(),
Collections.<CmsUUID, CmsElementView> emptyMap... | [
"public",
"static",
"CmsADEConfigCacheState",
"emptyState",
"(",
"CmsObject",
"cms",
")",
"{",
"return",
"new",
"CmsADEConfigCacheState",
"(",
"cms",
",",
"Collections",
".",
"<",
"CmsUUID",
",",
"CmsADEConfigDataInternal",
">",
"emptyMap",
"(",
")",
",",
"Collect... | Creates an empty ADE configuration cache state.<p>
@param cms the CMS context
@return the empty configuration cache state | [
"Creates",
"an",
"empty",
"ADE",
"configuration",
"cache",
"state",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEConfigCacheState.java#L127-L134 | train | Creates an empty cache state. | Of course, here is the Java code you requested:
```java
public static CmsADEConfigCacheState emptyState(CmsObject cms) {
return new CmsADEConfigCacheState(
cms,
Collections.<CmsUUID, CmsADEConfigDataInternal> emptyMap(),
Collections.<CmsADEConfigDataInternal> emptyList(),
... |
fengwenyi/JavaLib | bak/HttpUtil.java | HttpUtil.put | public static String put(String url,
Map<String, String> headers,
Map<String, String> params) throws IOException {
StringBuilder stringBuilder = new StringBuilder(url).append("?");
// 参数
if (params != null) {
stringBuilder.ap... | java | public static String put(String url,
Map<String, String> headers,
Map<String, String> params) throws IOException {
StringBuilder stringBuilder = new StringBuilder(url).append("?");
// 参数
if (params != null) {
stringBuilder.ap... | [
"public",
"static",
"String",
"put",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"stringBuilder",
"=",
"new",
... | 通过 put 方式请求数据
<p>
RESTful API风格是PUT修改数据,但在实际中,建议修改还是采用POST方式
</p>
@param url {URL}
@param headers 请求的属性,也叫请求头
@param params 在参数过多的时候,可能你更喜欢用 Map 来进行保存你的参数
@return {URL}返回的数据,类型是 String
@throws IOException IO异常:给定的 URL 不正确,或者其他原因,导致服务法法找到
或是在向服务器上传数据时,当然还有可能在读取服务返回的数据时 | [
"通过",
"put",
"方式请求数据"
] | 14838b13fb11c024e41be766aa3e13ead4be1703 | https://github.com/fengwenyi/JavaLib/blob/14838b13fb11c024e41be766aa3e13ead4be1703/bak/HttpUtil.java#L163-L186 | train | Put a URL with parameters | Of course, here is the Java code you requested:
```java
public static String put(String url,
Map<String, String> headers,
Map<String, String> params) throws IOException {
StringBuilder stringBuilder = new StringBuilder(url).append("?");
// 参数
... |
aws/aws-sdk-java | aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/UpdateUserPoolClientRequest.java | UpdateUserPoolClientRequest.setWriteAttributes | public void setWriteAttributes(java.util.Collection<String> writeAttributes) {
if (writeAttributes == null) {
this.writeAttributes = null;
return;
}
this.writeAttributes = new java.util.ArrayList<String>(writeAttributes);
} | java | public void setWriteAttributes(java.util.Collection<String> writeAttributes) {
if (writeAttributes == null) {
this.writeAttributes = null;
return;
}
this.writeAttributes = new java.util.ArrayList<String>(writeAttributes);
} | [
"public",
"void",
"setWriteAttributes",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"String",
">",
"writeAttributes",
")",
"{",
"if",
"(",
"writeAttributes",
"==",
"null",
")",
"{",
"this",
".",
"writeAttributes",
"=",
"null",
";",
"return",
";",
"}"... | <p>
The writeable attributes of the user pool.
</p>
@param writeAttributes
The writeable attributes of the user pool. | [
"<p",
">",
"The",
"writeable",
"attributes",
"of",
"the",
"user",
"pool",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/UpdateUserPoolClientRequest.java#L433-L440 | train | Sets the value of the writeAttributes property. | Of course, here is the Java code you requested:
```java
public void setWriteAttributes(java.util.Collection<String> writeAttributes) {
if (writeAttributes == null) {
this.writeAttributes = null;
return;
}
this.writeAttributes = new java.util.ArrayList<String>(writeAttri... |
RestComm/jss7 | tcap-ansi/tcap-ansi-impl/src/main/java/org/restcomm/protocols/ss7/tcapAnsi/TCAPProviderImpl.java | TCAPProviderImpl.getNewUnstructuredDialog | public Dialog getNewUnstructuredDialog(SccpAddress localAddress, SccpAddress remoteAddress) throws TCAPException {
DialogImpl res = _getDialog(localAddress, remoteAddress, false, getNextSeqControl(), null);
this.setSsnToDialog(res, localAddress.getSubsystemNumber());
return res;
} | java | public Dialog getNewUnstructuredDialog(SccpAddress localAddress, SccpAddress remoteAddress) throws TCAPException {
DialogImpl res = _getDialog(localAddress, remoteAddress, false, getNextSeqControl(), null);
this.setSsnToDialog(res, localAddress.getSubsystemNumber());
return res;
} | [
"public",
"Dialog",
"getNewUnstructuredDialog",
"(",
"SccpAddress",
"localAddress",
",",
"SccpAddress",
"remoteAddress",
")",
"throws",
"TCAPException",
"{",
"DialogImpl",
"res",
"=",
"_getDialog",
"(",
"localAddress",
",",
"remoteAddress",
",",
"false",
",",
"getNext... | /*
(non-Javadoc)
@see org.restcomm.protocols.ss7.tcap.api.TCAPProvider#getNewUnstructuredDialog
(org.restcomm.protocols.ss7.sccp.parameter.SccpAddress, org.restcomm.protocols.ss7.sccp.parameter.SccpAddress) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/tcap-ansi/tcap-ansi-impl/src/main/java/org/restcomm/protocols/ss7/tcapAnsi/TCAPProviderImpl.java#L327-L331 | train | Create a new Unstructured Dialog. | Of course, here is the Java code you requested:
```java
public Dialog getNewUnstructuredDialog(SccpAddress localAddress, SccpAddress remoteAddress) throws TCAPException {
DialogImpl res = _getDialog(localAddress, remoteAddress, false, getNextSeqControl(), null);
this.setSsnToDialog(res, localAddress.ge... |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java | StatisticsJDBCStorageConnection.add | public void add(NodeData data) throws RepositoryException, UnsupportedOperationException, InvalidItemStateException,
IllegalStateException
{
Statistics s = ALL_STATISTICS.get(ADD_NODE_DATA_DESCR);
try
{
s.begin();
wcs.add(data);
}
finally
{
s.end()... | java | public void add(NodeData data) throws RepositoryException, UnsupportedOperationException, InvalidItemStateException,
IllegalStateException
{
Statistics s = ALL_STATISTICS.get(ADD_NODE_DATA_DESCR);
try
{
s.begin();
wcs.add(data);
}
finally
{
s.end()... | [
"public",
"void",
"add",
"(",
"NodeData",
"data",
")",
"throws",
"RepositoryException",
",",
"UnsupportedOperationException",
",",
"InvalidItemStateException",
",",
"IllegalStateException",
"{",
"Statistics",
"s",
"=",
"ALL_STATISTICS",
".",
"get",
"(",
"ADD_NODE_DATA_D... | {@inheritDoc} | [
"{"
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java#L306-L319 | train | Add a node data to the node table. | Of course, here is the Java code you requested:
```java
public void add(NodeData data) throws RepositoryException, UnsupportedOperationException, InvalidItemStateException,
IllegalStateException
{
Statistics s = ALL_STATISTICS.get(ADD_NODE_DATA_DESCR);
try
{
s.begin();
wcs.... |
oblac/jodd | jodd-core/src/main/java/jodd/time/JulianDate.java | JulianDate.toMilliseconds | public long toMilliseconds() {
double then = (fraction - JD_1970.fraction) * MILLIS_IN_DAY;
then += (integer - JD_1970.integer) * MILLIS_IN_DAY;
then += then > 0 ? 1.0e-6 : -1.0e-6;
return (long) then;
} | java | public long toMilliseconds() {
double then = (fraction - JD_1970.fraction) * MILLIS_IN_DAY;
then += (integer - JD_1970.integer) * MILLIS_IN_DAY;
then += then > 0 ? 1.0e-6 : -1.0e-6;
return (long) then;
} | [
"public",
"long",
"toMilliseconds",
"(",
")",
"{",
"double",
"then",
"=",
"(",
"fraction",
"-",
"JD_1970",
".",
"fraction",
")",
"*",
"MILLIS_IN_DAY",
";",
"then",
"+=",
"(",
"integer",
"-",
"JD_1970",
".",
"integer",
")",
"*",
"MILLIS_IN_DAY",
";",
"the... | Converts to milliseconds. | [
"Converts",
"to",
"milliseconds",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/time/JulianDate.java#L273-L278 | test | Gets the milliseconds. | Of course, here is the Java code you requested:
```java
public long toMilliseconds() {
double then = (fraction - JD_1970.fraction) * MILLIS_IN_DAY;
then += (integer - JD_1970.integer) * MILLIS_IN_DAY;
then += then > 0 ? 1.0e-6 : -1.0e-6;
return (long) then;
}
```
Hope this helps! |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/mapper/OrphanResourceBundlesMapper.java | OrphanResourceBundlesMapper.addFileIfNotMapped | private void addFileIfNotMapped(String filePath) throws DuplicateBundlePathException {
for (JoinableResourceBundle bundle : currentBundles) {
List<BundlePath> items = bundle.getItemPathList();
List<BundlePath> itemsDebug = bundle.getItemDebugPathList();
Set<String> licenses = bundle.getLicensesPathList();
... | java | private void addFileIfNotMapped(String filePath) throws DuplicateBundlePathException {
for (JoinableResourceBundle bundle : currentBundles) {
List<BundlePath> items = bundle.getItemPathList();
List<BundlePath> itemsDebug = bundle.getItemDebugPathList();
Set<String> licenses = bundle.getLicensesPathList();
... | [
"private",
"void",
"addFileIfNotMapped",
"(",
"String",
"filePath",
")",
"throws",
"DuplicateBundlePathException",
"{",
"for",
"(",
"JoinableResourceBundle",
"bundle",
":",
"currentBundles",
")",
"{",
"List",
"<",
"BundlePath",
">",
"items",
"=",
"bundle",
".",
"g... | Determine whether a resource is already added to some bundle, add it to
the list if it is not.
@param filePath
@param currentMappedResources | [
"Determine",
"whether",
"a",
"resource",
"is",
"already",
"added",
"to",
"some",
"bundle",
"add",
"it",
"to",
"the",
"list",
"if",
"it",
"is",
"not",
"."
] | 5381f6acf461cd2502593c67a77bd6ef9eab848d | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/mapper/OrphanResourceBundlesMapper.java#L141-L177 | train | Add a file to the list of bundles if it is not already mapped | Of course, here is the Java code you requested:
```java
private void addFileIfNotMapped(String filePath) throws DuplicateBundlePathException {
for (JoinableResourceBundle bundle : currentBundles) {
List<BundlePath> items = bundle.getItemPathList();
List<BundlePath> itemsDebug = bundle.getItemDebugPathList();
... |
googleapis/google-cloud-java | google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/Value.java | Value.getTimeValue | public com.google.type.TimeOfDay getTimeValue() {
if (typeCase_ == 6) {
return (com.google.type.TimeOfDay) type_;
}
return com.google.type.TimeOfDay.getDefaultInstance();
} | java | public com.google.type.TimeOfDay getTimeValue() {
if (typeCase_ == 6) {
return (com.google.type.TimeOfDay) type_;
}
return com.google.type.TimeOfDay.getDefaultInstance();
} | [
"public",
"com",
".",
"google",
".",
"type",
".",
"TimeOfDay",
"getTimeValue",
"(",
")",
"{",
"if",
"(",
"typeCase_",
"==",
"6",
")",
"{",
"return",
"(",
"com",
".",
"google",
".",
"type",
".",
"TimeOfDay",
")",
"type_",
";",
"}",
"return",
"com",
... | <code>.google.type.TimeOfDay time_value = 6;</code> | [
"<code",
">",
".",
"google",
".",
"type",
".",
"TimeOfDay",
"time_value",
"=",
"6",
";",
"<",
"/",
"code",
">"
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/Value.java#L310-L315 | train | Gets the value for this TimeOfDay. | Of course, here is the Java code you requested:
```java
public com.google.type.TimeOfDay getTimeValue() {
if (typeCase_ == 6) {
return (com.google.type.TimeOfDay) type_;
}
return com.google.type.TimeOfDay.getDefaultInstance();
}
```
Hope this helps! |
arnohaase/a-foundation | a-foundation/src/main/java/com/ajjpj/afoundation/collection/immutable/ABTreeMap.java | ABTreeMap.empty | @SuppressWarnings ("unchecked")
public static <K, V> ABTreeMap<K, V> empty (ABTreeSpec spec) {
return new LeafNode (spec, new Object[0], new Object[0]);
} | java | @SuppressWarnings ("unchecked")
public static <K, V> ABTreeMap<K, V> empty (ABTreeSpec spec) {
return new LeafNode (spec, new Object[0], new Object[0]);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"K",
",",
"V",
">",
"ABTreeMap",
"<",
"K",
",",
"V",
">",
"empty",
"(",
"ABTreeSpec",
"spec",
")",
"{",
"return",
"new",
"LeafNode",
"(",
"spec",
",",
"new",
"Object",
"[",
... | intentionally not volatile: This class is immutable, so recalculating per thread works | [
"intentionally",
"not",
"volatile",
":",
"This",
"class",
"is",
"immutable",
"so",
"recalculating",
"per",
"thread",
"works"
] | f3eef2ca89d67775f202a4c28140230a6229291e | https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/collection/immutable/ABTreeMap.java#L18-L21 | test | Create an empty map. | Of course, here is the Java code you requested:
```java
@SuppressWarnings ("unchecked")
public static <K, V> ABTreeMap<K, V> empty (ABTreeSpec spec) {
return new LeafNode (spec, new Object[0], new Object[0]);
}
```
Hope this helps! |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.findByC_NotST_First | @Override
public CPInstance findByC_NotST_First(long CPDefinitionId, int status,
OrderByComparator<CPInstance> orderByComparator)
throws NoSuchCPInstanceException {
CPInstance cpInstance = fetchByC_NotST_First(CPDefinitionId, status,
orderByComparator);
if (cpInstance != null) {
return cpInstance;
}
... | java | @Override
public CPInstance findByC_NotST_First(long CPDefinitionId, int status,
OrderByComparator<CPInstance> orderByComparator)
throws NoSuchCPInstanceException {
CPInstance cpInstance = fetchByC_NotST_First(CPDefinitionId, status,
orderByComparator);
if (cpInstance != null) {
return cpInstance;
}
... | [
"@",
"Override",
"public",
"CPInstance",
"findByC_NotST_First",
"(",
"long",
"CPDefinitionId",
",",
"int",
"status",
",",
"OrderByComparator",
"<",
"CPInstance",
">",
"orderByComparator",
")",
"throws",
"NoSuchCPInstanceException",
"{",
"CPInstance",
"cpInstance",
"=",
... | Returns the first cp instance in the ordered set where CPDefinitionId = ? and status ≠ ?.
@param CPDefinitionId the cp definition ID
@param status the status
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the first matching cp instance
@throws NoSuchCPInst... | [
"Returns",
"the",
"first",
"cp",
"instance",
"in",
"the",
"ordered",
"set",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"status",
"&ne",
";",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L5301-L5325 | train | Returns the cp instance in the ordered set where status is not the default status. | Of course, here is the Java code you requested:
```java
@Override
public CPInstance findByC_NotST_First(long CPDefinitionId, int status,
OrderByComparator<CPInstance> orderByComparator)
throws NoSuchCPInstanceException {
CPInstance cpInstance = fetchByC_NotST_First(CPDefinitionId, status,
orderByComparator)... |
aol/cyclops | cyclops-anym/src/main/java/cyclops/monads/transformers/ListT.java | ListT.cycleWhile | @Override
public ListT<W,T> cycleWhile(final Predicate<? super T> predicate) {
return (ListT<W,T>) FoldableTransformerSeq.super.cycleWhile(predicate);
} | java | @Override
public ListT<W,T> cycleWhile(final Predicate<? super T> predicate) {
return (ListT<W,T>) FoldableTransformerSeq.super.cycleWhile(predicate);
} | [
"@",
"Override",
"public",
"ListT",
"<",
"W",
",",
"T",
">",
"cycleWhile",
"(",
"final",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"return",
"(",
"ListT",
"<",
"W",
",",
"T",
">",
")",
"FoldableTransformerSeq",
".",
"super",
".... | /* (non-Javadoc)
@see cyclops2.monads.transformers.values.ListT#cycleWhile(java.util.function.Predicate) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 59a9fde30190a4d1faeb9f6d9851d209d82b81dd | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-anym/src/main/java/cyclops/monads/transformers/ListT.java#L338-L342 | train | Cycle through the sequence of tokens where the first token of the sequence is not found in the sequence. | Of course, here is the Java code you requested:
```java
@Override
public ListT<W,T> cycleWhile(final Predicate<? super T> predicate) {
return (ListT<W,T>) FoldableTransformerSeq.super.cycleWhile(predicate);
}
```
Hope this helps! |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/protocol/protocoludp_stats.java | protocoludp_stats.get | public static protocoludp_stats get(nitro_service service) throws Exception{
protocoludp_stats obj = new protocoludp_stats();
protocoludp_stats[] response = (protocoludp_stats[])obj.stat_resources(service);
return response[0];
} | java | public static protocoludp_stats get(nitro_service service) throws Exception{
protocoludp_stats obj = new protocoludp_stats();
protocoludp_stats[] response = (protocoludp_stats[])obj.stat_resources(service);
return response[0];
} | [
"public",
"static",
"protocoludp_stats",
"get",
"(",
"nitro_service",
"service",
")",
"throws",
"Exception",
"{",
"protocoludp_stats",
"obj",
"=",
"new",
"protocoludp_stats",
"(",
")",
";",
"protocoludp_stats",
"[",
"]",
"response",
"=",
"(",
"protocoludp_stats",
... | Use this API to fetch the statistics of all protocoludp_stats resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"the",
"statistics",
"of",
"all",
"protocoludp_stats",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/protocol/protocoludp_stats.java#L218-L222 | train | Use this API to fetch the statistics of all protocoludp_stats resources that are configured on netscaler. | Of course, here is the Java code you requested:
```java
public static protocoludp_stats get(nitro_service service) throws Exception{
protocoludp_stats obj = new protocoludp_stats();
protocoludp_stats[] response = (protocoludp_stats[])obj.stat_resources(service);
return response[0];
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.