repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 194 | func_name stringlengths 6 111 | whole_func_string stringlengths 80 3.8k | language stringclasses 1
value | func_code_string stringlengths 80 3.8k | func_code_tokens listlengths 20 697 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 434 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ReplyFactory.java | ReplyFactory.addAirlineFlightUpdateTemplate | public static AirlineFlightUpdateTemplateBuilder addAirlineFlightUpdateTemplate(
String introMessage, String locale, String pnrNumber,
UpdateType updateType) {
return new AirlineFlightUpdateTemplateBuilder(introMessage, locale,
pnrNumber, updateType);
} | java | public static AirlineFlightUpdateTemplateBuilder addAirlineFlightUpdateTemplate(
String introMessage, String locale, String pnrNumber,
UpdateType updateType) {
return new AirlineFlightUpdateTemplateBuilder(introMessage, locale,
pnrNumber, updateType);
} | [
"public",
"static",
"AirlineFlightUpdateTemplateBuilder",
"addAirlineFlightUpdateTemplate",
"(",
"String",
"introMessage",
",",
"String",
"locale",
",",
"String",
"pnrNumber",
",",
"UpdateType",
"updateType",
")",
"{",
"return",
"new",
"AirlineFlightUpdateTemplateBuilder",
... | Adds an Airline Flight Update Template to the response.
@param introMessage
the message to send before the template. It can't be empty.
@param locale
the current locale. It can't be empty and must be in format
[a-z]{2}_[A-Z]{2}. Locale must be in format [a-z]{2}_[A-Z]{2}.
For more information see<a href=
"https://deve... | [
"Adds",
"an",
"Airline",
"Flight",
"Update",
"Template",
"to",
"the",
"response",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ReplyFactory.java#L375-L380 |
tvesalainen/util | util/src/main/java/org/vesalainen/lang/Primitives.java | Primitives.parseShort | public static final short parseShort(CharSequence cs)
{
if (CharSequences.startsWith(cs, "0b"))
{
return parseShort(cs, 2, 2, cs.length());
}
if (CharSequences.startsWith(cs, "0x"))
{
return parseShort(cs, 16, 2, cs.length());
}
... | java | public static final short parseShort(CharSequence cs)
{
if (CharSequences.startsWith(cs, "0b"))
{
return parseShort(cs, 2, 2, cs.length());
}
if (CharSequences.startsWith(cs, "0x"))
{
return parseShort(cs, 16, 2, cs.length());
}
... | [
"public",
"static",
"final",
"short",
"parseShort",
"(",
"CharSequence",
"cs",
")",
"{",
"if",
"(",
"CharSequences",
".",
"startsWith",
"(",
"cs",
",",
"\"0b\"",
")",
")",
"{",
"return",
"parseShort",
"(",
"cs",
",",
"2",
",",
"2",
",",
"cs",
".",
"l... | Equal to calling parseShort(cs, 10).
@param cs
@return
@throws java.lang.NumberFormatException if input cannot be parsed to proper
short.
@see java.lang.Short#parseShort(java.lang.String, int)
@see java.lang.Character#digit(int, int) | [
"Equal",
"to",
"calling",
"parseShort",
"(",
"cs",
"10",
")",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/lang/Primitives.java#L1169-L1180 |
OpenLiberty/open-liberty | dev/com.ibm.ws.concurrent.mp.1.0/src/com/ibm/ws/concurrent/mp/ManagedCompletableFuture.java | ManagedCompletableFuture.failedStage | @Trivial
public static <U> CompletionStage<U> failedStage(Throwable x) {
throw new UnsupportedOperationException(Tr.formatMessage(tc, "CWWKC1156.not.supported", "ManagedExecutor.failedStage"));
} | java | @Trivial
public static <U> CompletionStage<U> failedStage(Throwable x) {
throw new UnsupportedOperationException(Tr.formatMessage(tc, "CWWKC1156.not.supported", "ManagedExecutor.failedStage"));
} | [
"@",
"Trivial",
"public",
"static",
"<",
"U",
">",
"CompletionStage",
"<",
"U",
">",
"failedStage",
"(",
"Throwable",
"x",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"Tr",
".",
"formatMessage",
"(",
"tc",
",",
"\"CWWKC1156.not.supported\"",
... | Because CompletableFuture.failedStage is static, this is not a true override.
It will be difficult for the user to invoke this method because they would need to get the class
of the CompletableFuture implementation and locate the static failedStage method on that.
@throws UnsupportedOperationException directing the us... | [
"Because",
"CompletableFuture",
".",
"failedStage",
"is",
"static",
"this",
"is",
"not",
"a",
"true",
"override",
".",
"It",
"will",
"be",
"difficult",
"for",
"the",
"user",
"to",
"invoke",
"this",
"method",
"because",
"they",
"would",
"need",
"to",
"get",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent.mp.1.0/src/com/ibm/ws/concurrent/mp/ManagedCompletableFuture.java#L387-L390 |
litsec/eidas-opensaml | opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java | RequestedAttributeTemplates.GENDER | public static RequestedAttribute GENDER(Boolean isRequired, boolean includeFriendlyName) {
return create(AttributeConstants.EIDAS_GENDER_ATTRIBUTE_NAME,
includeFriendlyName ? AttributeConstants.EIDAS_GENDER_ATTRIBUTE_FRIENDLY_NAME : null,
Attribute.URI_REFERENCE, isRequired);
} | java | public static RequestedAttribute GENDER(Boolean isRequired, boolean includeFriendlyName) {
return create(AttributeConstants.EIDAS_GENDER_ATTRIBUTE_NAME,
includeFriendlyName ? AttributeConstants.EIDAS_GENDER_ATTRIBUTE_FRIENDLY_NAME : null,
Attribute.URI_REFERENCE, isRequired);
} | [
"public",
"static",
"RequestedAttribute",
"GENDER",
"(",
"Boolean",
"isRequired",
",",
"boolean",
"includeFriendlyName",
")",
"{",
"return",
"create",
"(",
"AttributeConstants",
".",
"EIDAS_GENDER_ATTRIBUTE_NAME",
",",
"includeFriendlyName",
"?",
"AttributeConstants",
"."... | Creates a {@code RequestedAttribute} object for the Gender attribute.
@param isRequired
flag to tell whether the attribute is required
@param includeFriendlyName
flag that tells whether the friendly name should be included
@return a {@code RequestedAttribute} object representing the Gender attribute | [
"Creates",
"a",
"{",
"@code",
"RequestedAttribute",
"}",
"object",
"for",
"the",
"Gender",
"attribute",
"."
] | train | https://github.com/litsec/eidas-opensaml/blob/522ba6dba433a9524cb8a02464cc3b087b47a2b7/opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java#L101-L105 |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/NamespaceContextImpl.java | NamespaceContextImpl.addNamespace | public void addNamespace(String prefix, String namespaceURI) {
this.prefixToNsUriMap.put(prefix, namespaceURI);
if (this.nsUriToPrefixesMap.get(namespaceURI) == null) {
this.nsUriToPrefixesMap.put(namespaceURI, new HashSet<String>());
}
this.nsUriToPrefixesMap.get(namespaceUR... | java | public void addNamespace(String prefix, String namespaceURI) {
this.prefixToNsUriMap.put(prefix, namespaceURI);
if (this.nsUriToPrefixesMap.get(namespaceURI) == null) {
this.nsUriToPrefixesMap.put(namespaceURI, new HashSet<String>());
}
this.nsUriToPrefixesMap.get(namespaceUR... | [
"public",
"void",
"addNamespace",
"(",
"String",
"prefix",
",",
"String",
"namespaceURI",
")",
"{",
"this",
".",
"prefixToNsUriMap",
".",
"put",
"(",
"prefix",
",",
"namespaceURI",
")",
";",
"if",
"(",
"this",
".",
"nsUriToPrefixesMap",
".",
"get",
"(",
"n... | Add a custom mapping from prefix to a namespace. This mapping will
override any mappings present in this class's XML Element (if provided).
@param prefix
the namespace's prefix. Use an empty string for the
default prefix.
@param namespaceURI
the namespace URI to map. | [
"Add",
"a",
"custom",
"mapping",
"from",
"prefix",
"to",
"a",
"namespace",
".",
"This",
"mapping",
"will",
"override",
"any",
"mappings",
"present",
"in",
"this",
"class",
"s",
"XML",
"Element",
"(",
"if",
"provided",
")",
"."
] | train | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/NamespaceContextImpl.java#L52-L58 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPoseMapper.java | GVRPoseMapper.animate | public void animate(GVRHybridObject target, float time)
{
if ((mSourceSkeleton == null) || !mSourceSkeleton.isEnabled())
{
return;
}
mapLocalToTarget();
mDestSkeleton.poseToBones();
mDestSkeleton.updateBonePose();
mDestSkeleton.updateSkinPose();
... | java | public void animate(GVRHybridObject target, float time)
{
if ((mSourceSkeleton == null) || !mSourceSkeleton.isEnabled())
{
return;
}
mapLocalToTarget();
mDestSkeleton.poseToBones();
mDestSkeleton.updateBonePose();
mDestSkeleton.updateSkinPose();
... | [
"public",
"void",
"animate",
"(",
"GVRHybridObject",
"target",
",",
"float",
"time",
")",
"{",
"if",
"(",
"(",
"mSourceSkeleton",
"==",
"null",
")",
"||",
"!",
"mSourceSkeleton",
".",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"mapLocalToTarget",... | /*
Updates the color and depth map textures from the Kinect cameras.
If a Skeleton is our target or a child, we update the joint angles
for the user associated with it. | [
"/",
"*",
"Updates",
"the",
"color",
"and",
"depth",
"map",
"textures",
"from",
"the",
"Kinect",
"cameras",
".",
"If",
"a",
"Skeleton",
"is",
"our",
"target",
"or",
"a",
"child",
"we",
"update",
"the",
"joint",
"angles",
"for",
"the",
"user",
"associated... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPoseMapper.java#L219-L229 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Rectangle.java | Rectangle.updateBorderBasedOnWidth | private void updateBorderBasedOnWidth(float width, int side) {
useVariableBorders = true;
if (width > 0)
enableBorderSide(side);
else
disableBorderSide(side);
} | java | private void updateBorderBasedOnWidth(float width, int side) {
useVariableBorders = true;
if (width > 0)
enableBorderSide(side);
else
disableBorderSide(side);
} | [
"private",
"void",
"updateBorderBasedOnWidth",
"(",
"float",
"width",
",",
"int",
"side",
")",
"{",
"useVariableBorders",
"=",
"true",
";",
"if",
"(",
"width",
">",
"0",
")",
"enableBorderSide",
"(",
"side",
")",
";",
"else",
"disableBorderSide",
"(",
"side"... | Helper function updating the border flag for a side
based on the specified width.
A width of 0 will disable the border on that side.
Any other width enables it.
@param width width of border
@param side border side constant | [
"Helper",
"function",
"updating",
"the",
"border",
"flag",
"for",
"a",
"side",
"based",
"on",
"the",
"specified",
"width",
".",
"A",
"width",
"of",
"0",
"will",
"disable",
"the",
"border",
"on",
"that",
"side",
".",
"Any",
"other",
"width",
"enables",
"i... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Rectangle.java#L595-L601 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/TypedCollections.java | TypedCollections.dynamicallyCastSet | @SuppressWarnings("unchecked")
static <E> Set<E> dynamicallyCastSet(Set<?> set,
Class<E> type) {
return dynamicallyCastCollection(set, type, Set.class);
} | java | @SuppressWarnings("unchecked")
static <E> Set<E> dynamicallyCastSet(Set<?> set,
Class<E> type) {
return dynamicallyCastCollection(set, type, Set.class);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"<",
"E",
">",
"Set",
"<",
"E",
">",
"dynamicallyCastSet",
"(",
"Set",
"<",
"?",
">",
"set",
",",
"Class",
"<",
"E",
">",
"type",
")",
"{",
"return",
"dynamicallyCastCollection",
"(",
"set",
... | Dynamically check that the members of the set are all instances of
the given type (or null).
@param <E>
the set's element type
@param set
the set to cast
@param type
the class of the set's element type.
@return the dynamically-type checked set.
@throws java.lang.ClassCastException | [
"Dynamically",
"check",
"that",
"the",
"members",
"of",
"the",
"set",
"are",
"all",
"instances",
"of",
"the",
"given",
"type",
"(",
"or",
"null",
")",
"."
] | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/TypedCollections.java#L122-L126 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/proxy/StatementProxyLogic.java | StatementProxyLogic.invoke | public Object invoke(Method method, Object[] args) throws Throwable {
return MethodExecutionListenerUtils.invoke(new MethodExecutionListenerUtils.MethodExecutionCallback() {
@Override
public Object execute(Object proxyTarget, Method method, Object[] args) throws Throwable {
... | java | public Object invoke(Method method, Object[] args) throws Throwable {
return MethodExecutionListenerUtils.invoke(new MethodExecutionListenerUtils.MethodExecutionCallback() {
@Override
public Object execute(Object proxyTarget, Method method, Object[] args) throws Throwable {
... | [
"public",
"Object",
"invoke",
"(",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"return",
"MethodExecutionListenerUtils",
".",
"invoke",
"(",
"new",
"MethodExecutionListenerUtils",
".",
"MethodExecutionCallback",
"(",
")",
... | set true if auto-generate keys is enabled at "Connection#prepareStatement()" | [
"set",
"true",
"if",
"auto",
"-",
"generate",
"keys",
"is",
"enabled",
"at",
"Connection#prepareStatement",
"()"
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/proxy/StatementProxyLogic.java#L118-L127 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/LookupManagerImpl.java | LookupManagerImpl.removeNotificationHandler | @Override
public void removeNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException {
if(! isStarted){
ServiceDirectoryError error = new ServiceDirectoryError(ErrorCode.SERVICE_DIRECTORY_MANAGER_FACTORY_CLOSED);
throw new ServiceException(error);... | java | @Override
public void removeNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException {
if(! isStarted){
ServiceDirectoryError error = new ServiceDirectoryError(ErrorCode.SERVICE_DIRECTORY_MANAGER_FACTORY_CLOSED);
throw new ServiceException(error);... | [
"@",
"Override",
"public",
"void",
"removeNotificationHandler",
"(",
"String",
"serviceName",
",",
"NotificationHandler",
"handler",
")",
"throws",
"ServiceException",
"{",
"if",
"(",
"!",
"isStarted",
")",
"{",
"ServiceDirectoryError",
"error",
"=",
"new",
"Service... | Remove the NotificationHandler from the Service.
@param serviceName
the service name.
@param handler
the NotificationHandler for the service. | [
"Remove",
"the",
"NotificationHandler",
"from",
"the",
"Service",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/LookupManagerImpl.java#L447-L460 |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/TcasesJson.java | TcasesJson.writeInputModel | public static void writeInputModel( SystemInputDef inputDef, OutputStream outputStream)
{
try( SystemInputJsonWriter writer = new SystemInputJsonWriter( outputStream))
{
writer.write( inputDef);
}
catch( Exception e)
{
throw new RuntimeException( "Can't write input definition",... | java | public static void writeInputModel( SystemInputDef inputDef, OutputStream outputStream)
{
try( SystemInputJsonWriter writer = new SystemInputJsonWriter( outputStream))
{
writer.write( inputDef);
}
catch( Exception e)
{
throw new RuntimeException( "Can't write input definition",... | [
"public",
"static",
"void",
"writeInputModel",
"(",
"SystemInputDef",
"inputDef",
",",
"OutputStream",
"outputStream",
")",
"{",
"try",
"(",
"SystemInputJsonWriter",
"writer",
"=",
"new",
"SystemInputJsonWriter",
"(",
"outputStream",
")",
")",
"{",
"writer",
".",
... | Writes a {@link SystemInputJsonWriter JSON document} describing the given system input definition to the given output stream. | [
"Writes",
"a",
"{"
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/TcasesJson.java#L48-L58 |
restfb/restfb | src/main/java/com/restfb/util/ReflectionUtils.java | ReflectionUtils.findFieldsWithAnnotation | public static <T extends Annotation> List<FieldWithAnnotation<T>> findFieldsWithAnnotation(Class<?> type,
Class<T> annotationType) {
ClassAnnotationCacheKey cacheKey = new ClassAnnotationCacheKey(type, annotationType);
@SuppressWarnings("unchecked")
List<FieldWithAnnotation<T>> cachedResults =
... | java | public static <T extends Annotation> List<FieldWithAnnotation<T>> findFieldsWithAnnotation(Class<?> type,
Class<T> annotationType) {
ClassAnnotationCacheKey cacheKey = new ClassAnnotationCacheKey(type, annotationType);
@SuppressWarnings("unchecked")
List<FieldWithAnnotation<T>> cachedResults =
... | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"List",
"<",
"FieldWithAnnotation",
"<",
"T",
">",
">",
"findFieldsWithAnnotation",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Class",
"<",
"T",
">",
"annotationType",
")",
"{",
"ClassAnnotationCach... | Finds fields on the given {@code type} and all of its superclasses annotated with annotations of type
{@code annotationType}.
@param <T>
The annotation type.
@param type
The target type token.
@param annotationType
The annotation type token.
@return A list of field/annotation pairs. | [
"Finds",
"fields",
"on",
"the",
"given",
"{",
"@code",
"type",
"}",
"and",
"all",
"of",
"its",
"superclasses",
"annotated",
"with",
"annotations",
"of",
"type",
"{",
"@code",
"annotationType",
"}",
"."
] | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/util/ReflectionUtils.java#L96-L126 |
aws/aws-sdk-java | aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java | SignerUtils.makeBytesUrlSafe | public static String makeBytesUrlSafe(byte[] bytes) {
byte[] encoded = Base64.encode(bytes);
for (int i=0; i < encoded.length; i++) {
switch(encoded[i]) {
case '+':
encoded[i] = '-'; continue;
case '=':
encoded[i] = '_'... | java | public static String makeBytesUrlSafe(byte[] bytes) {
byte[] encoded = Base64.encode(bytes);
for (int i=0; i < encoded.length; i++) {
switch(encoded[i]) {
case '+':
encoded[i] = '-'; continue;
case '=':
encoded[i] = '_'... | [
"public",
"static",
"String",
"makeBytesUrlSafe",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"byte",
"[",
"]",
"encoded",
"=",
"Base64",
".",
"encode",
"(",
"bytes",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"encoded",
".",
"length"... | Converts the given data to be safe for use in signed URLs for a private
distribution by using specialized Base64 encoding. | [
"Converts",
"the",
"given",
"data",
"to",
"be",
"safe",
"for",
"use",
"in",
"signed",
"URLs",
"for",
"a",
"private",
"distribution",
"by",
"using",
"specialized",
"Base64",
"encoding",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudfront/src/main/java/com/amazonaws/services/cloudfront/util/SignerUtils.java#L97-L113 |
hawkular/hawkular-apm | api/src/main/java/org/hawkular/apm/api/services/AbstractAnalyticsService.java | AbstractAnalyticsService.createRegex | protected static String createRegex(String endpoint, boolean meta) {
StringBuilder regex = new StringBuilder();
regex.append('^');
for (int i=0; i < endpoint.length(); i++) {
char ch=endpoint.charAt(i);
if ("*".indexOf(ch) != -1) {
regex.append('.');
... | java | protected static String createRegex(String endpoint, boolean meta) {
StringBuilder regex = new StringBuilder();
regex.append('^');
for (int i=0; i < endpoint.length(); i++) {
char ch=endpoint.charAt(i);
if ("*".indexOf(ch) != -1) {
regex.append('.');
... | [
"protected",
"static",
"String",
"createRegex",
"(",
"String",
"endpoint",
",",
"boolean",
"meta",
")",
"{",
"StringBuilder",
"regex",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"regex",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"(",
"int",
"i",
... | This method derives the regular expression from the supplied
URI.
@param endpoint The endpoint
@param meta Whether this is a meta endpoint
@return The regular expression | [
"This",
"method",
"derives",
"the",
"regular",
"expression",
"from",
"the",
"supplied",
"URI",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/api/src/main/java/org/hawkular/apm/api/services/AbstractAnalyticsService.java#L506-L524 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.getRawSnippetContent | public String getRawSnippetContent(Object projectIdOrPath, Integer snippetId) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId, "raw");
return (response.readEntity(String.class));
} | java | public String getRawSnippetContent(Object projectIdOrPath, Integer snippetId) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId, "raw");
return (response.readEntity(String.class));
} | [
"public",
"String",
"getRawSnippetContent",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"snippetId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"projects\"",
... | Get the raw project snippet as plain text.
<pre><code>GET /projects/:id/snippets/:snippet_id/raw</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param snippetId the ID of the project's snippet
@return the raw project snippet p... | [
"Get",
"the",
"raw",
"project",
"snippet",
"as",
"plain",
"text",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L2049-L2052 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/query/callables/CreateIndexCallable.java | CreateIndexCallable.createVirtualTableStatementForIndex | private String createVirtualTableStatementForIndex(String indexName,
List<String> columns,
List<String> indexSettings) {
String tableName = String.format(Locale.ENGLISH, "\"%s\"", QueryImpl
... | java | private String createVirtualTableStatementForIndex(String indexName,
List<String> columns,
List<String> indexSettings) {
String tableName = String.format(Locale.ENGLISH, "\"%s\"", QueryImpl
... | [
"private",
"String",
"createVirtualTableStatementForIndex",
"(",
"String",
"indexName",
",",
"List",
"<",
"String",
">",
"columns",
",",
"List",
"<",
"String",
">",
"indexSettings",
")",
"{",
"String",
"tableName",
"=",
"String",
".",
"format",
"(",
"Locale",
... | This method generates the virtual table create SQL for the specified index.
Note: Any column that contains an '=' will cause the statement to fail
because it triggers SQLite to expect that a parameter/value is being passed in.
@param indexName the index name to be used when creating the SQLite virtual table
@para... | [
"This",
"method",
"generates",
"the",
"virtual",
"table",
"create",
"SQL",
"for",
"the",
"specified",
"index",
".",
"Note",
":",
"Any",
"column",
"that",
"contains",
"an",
"=",
"will",
"cause",
"the",
"statement",
"to",
"fail",
"because",
"it",
"triggers",
... | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/query/callables/CreateIndexCallable.java#L113-L124 |
jcuda/jcusolver | JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverSp.java | JCusolverSp.cusolverSpXcsrsymrcmHost | public static int cusolverSpXcsrsymrcmHost(
cusolverSpHandle handle,
int n,
int nnzA,
cusparseMatDescr descrA,
Pointer csrRowPtrA,
Pointer csrColIndA,
Pointer p)
{
return checkResult(cusolverSpXcsrsymrcmHostNative(handle, n, nnzA, descrA... | java | public static int cusolverSpXcsrsymrcmHost(
cusolverSpHandle handle,
int n,
int nnzA,
cusparseMatDescr descrA,
Pointer csrRowPtrA,
Pointer csrColIndA,
Pointer p)
{
return checkResult(cusolverSpXcsrsymrcmHostNative(handle, n, nnzA, descrA... | [
"public",
"static",
"int",
"cusolverSpXcsrsymrcmHost",
"(",
"cusolverSpHandle",
"handle",
",",
"int",
"n",
",",
"int",
"nnzA",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"csrRowPtrA",
",",
"Pointer",
"csrColIndA",
",",
"Pointer",
"p",
")",
"{",
"return",... | <pre>
--------- CPU symrcm
Symmetric reverse Cuthill McKee permutation
</pre> | [
"<pre",
">",
"---------",
"CPU",
"symrcm",
"Symmetric",
"reverse",
"Cuthill",
"McKee",
"permutation"
] | train | https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverSp.java#L1354-L1364 |
diffplug/JMatIO | src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java | MatFileReader.zeroEndByteArrayToString | private String zeroEndByteArrayToString(byte[] bytes) throws IOException
{
int i = 0;
for ( i = 0; i < bytes.length && bytes[i] != 0; i++ );
return new String( bytes, 0, i );
} | java | private String zeroEndByteArrayToString(byte[] bytes) throws IOException
{
int i = 0;
for ( i = 0; i < bytes.length && bytes[i] != 0; i++ );
return new String( bytes, 0, i );
} | [
"private",
"String",
"zeroEndByteArrayToString",
"(",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"bytes",
".",
"length",
"&&",
"bytes",
"[",
"i",
"]",
"!=",
"0"... | Converts byte array to <code>String</code>.
It assumes that String ends with \0 value.
@param bytes byte array containing the string.
@return String retrieved from byte array.
@throws IOException if reading error occurred. | [
"Converts",
"byte",
"array",
"to",
"<code",
">",
"String<",
"/",
"code",
">",
"."
] | train | https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/io/MatFileReader.java#L1301-L1309 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.Bits | public JBBPDslBuilder Bits(final String name, final JBBPBitNumber bits) {
final Item item = new Item(BinType.BIT, name, this.byteOrder);
item.bitNumber = bits;
this.addItem(item);
return this;
} | java | public JBBPDslBuilder Bits(final String name, final JBBPBitNumber bits) {
final Item item = new Item(BinType.BIT, name, this.byteOrder);
item.bitNumber = bits;
this.addItem(item);
return this;
} | [
"public",
"JBBPDslBuilder",
"Bits",
"(",
"final",
"String",
"name",
",",
"final",
"JBBPBitNumber",
"bits",
")",
"{",
"final",
"Item",
"item",
"=",
"new",
"Item",
"(",
"BinType",
".",
"BIT",
",",
"name",
",",
"this",
".",
"byteOrder",
")",
";",
"item",
... | Add named fixed length bit field.
@param name name of the field, if null then anonymous one
@param bits number of bits as length of the field, must not be null
@return the builder instance, must not be null | [
"Add",
"named",
"fixed",
"length",
"bit",
"field",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L636-L641 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201808/audiencesegmentservice/GetFirstPartyAudienceSegments.java | GetFirstPartyAudienceSegments.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
AudienceSegmentServiceInterface audienceSegmentService =
adManagerServices.get(session, AudienceSegmentServiceInterface.class);
// Create a statement to select audience segments.
... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
AudienceSegmentServiceInterface audienceSegmentService =
adManagerServices.get(session, AudienceSegmentServiceInterface.class);
// Create a statement to select audience segments.
... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"AudienceSegmentServiceInterface",
"audienceSegmentService",
"=",
"adManagerServices",
".",
"get",
"(",
"sessi... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201808/audiencesegmentservice/GetFirstPartyAudienceSegments.java#L52-L90 |
denisneuling/apitrary.jar | apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java | ClassUtil.getClassAnnotationValue | @SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> T getClassAnnotationValue(Class source, Class annotation, String attributeName, Class<T> expected) {
Annotation instance = source.getAnnotation(annotation);
T value = null;
if (instance != null) {
try {
value = (T) instance.annotationType().... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> T getClassAnnotationValue(Class source, Class annotation, String attributeName, Class<T> expected) {
Annotation instance = source.getAnnotation(annotation);
T value = null;
if (instance != null) {
try {
value = (T) instance.annotationType().... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getClassAnnotationValue",
"(",
"Class",
"source",
",",
"Class",
"annotation",
",",
"String",
"attributeName",
",",
"Class",
"<",
"T",
... | <p>
getClassAnnotationValue.
</p>
@param source
a {@link java.lang.Class} object.
@param annotation
a {@link java.lang.Class} object.
@param attributeName
a {@link java.lang.String} object.
@param expected
a {@link java.lang.Class} object.
@param <T>
a T object.
@return a T object. | [
"<p",
">",
"getClassAnnotationValue",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java#L55-L67 |
op4j/op4j | src/main/java/org/op4j/functions/FnNumber.java | FnNumber.roundFloat | public static final Function<Float,Float> roundFloat(final int scale, final RoundingMode roundingMode) {
return new RoundFloat(scale, roundingMode);
} | java | public static final Function<Float,Float> roundFloat(final int scale, final RoundingMode roundingMode) {
return new RoundFloat(scale, roundingMode);
} | [
"public",
"static",
"final",
"Function",
"<",
"Float",
",",
"Float",
">",
"roundFloat",
"(",
"final",
"int",
"scale",
",",
"final",
"RoundingMode",
"roundingMode",
")",
"{",
"return",
"new",
"RoundFloat",
"(",
"scale",
",",
"roundingMode",
")",
";",
"}"
] | <p>
It rounds the target with the specified scale and rounding mode
</p>
@param scale the scale to be used
@param roundingMode the {@link RoundingMode} to round the input with
@return the {@link Float} | [
"<p",
">",
"It",
"rounds",
"the",
"target",
"with",
"the",
"specified",
"scale",
"and",
"rounding",
"mode",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnNumber.java#L292-L294 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/AbstractSailthruClient.java | AbstractSailthruClient.apiPost | public JsonResponse apiPost(ApiParams data, ApiFileParams fileParams) throws IOException {
return httpRequestJson(HttpRequestMethod.POST, data, fileParams);
} | java | public JsonResponse apiPost(ApiParams data, ApiFileParams fileParams) throws IOException {
return httpRequestJson(HttpRequestMethod.POST, data, fileParams);
} | [
"public",
"JsonResponse",
"apiPost",
"(",
"ApiParams",
"data",
",",
"ApiFileParams",
"fileParams",
")",
"throws",
"IOException",
"{",
"return",
"httpRequestJson",
"(",
"HttpRequestMethod",
".",
"POST",
",",
"data",
",",
"fileParams",
")",
";",
"}"
] | HTTP POST Request with Interface implementation of ApiParams and ApiFileParams
@param data
@param fileParams
@throws IOException | [
"HTTP",
"POST",
"Request",
"with",
"Interface",
"implementation",
"of",
"ApiParams",
"and",
"ApiFileParams"
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/AbstractSailthruClient.java#L291-L293 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteCertificateIssuer | public IssuerBundle deleteCertificateIssuer(String vaultBaseUrl, String issuerName) {
return deleteCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).toBlocking().single().body();
} | java | public IssuerBundle deleteCertificateIssuer(String vaultBaseUrl, String issuerName) {
return deleteCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).toBlocking().single().body();
} | [
"public",
"IssuerBundle",
"deleteCertificateIssuer",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"issuerName",
")",
"{",
"return",
"deleteCertificateIssuerWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"issuerName",
")",
".",
"toBlocking",
"(",
")",
".",
"single... | Deletes the specified certificate issuer.
The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param i... | [
"Deletes",
"the",
"specified",
"certificate",
"issuer",
".",
"The",
"DeleteCertificateIssuer",
"operation",
"permanently",
"removes",
"the",
"specified",
"certificate",
"issuer",
"from",
"the",
"vault",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L6400-L6402 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/TypeInfo.java | TypeInfo.innerClass | public final TypeInfo innerClass(String simpleName) {
checkArgument(
simpleName.indexOf('$') == -1, "Simple names shouldn't contain '$': %s", simpleName);
String className = className() + '$' + simpleName;
String internalName = internalName() + '$' + simpleName;
Type type = Type.getObjectType(in... | java | public final TypeInfo innerClass(String simpleName) {
checkArgument(
simpleName.indexOf('$') == -1, "Simple names shouldn't contain '$': %s", simpleName);
String className = className() + '$' + simpleName;
String internalName = internalName() + '$' + simpleName;
Type type = Type.getObjectType(in... | [
"public",
"final",
"TypeInfo",
"innerClass",
"(",
"String",
"simpleName",
")",
"{",
"checkArgument",
"(",
"simpleName",
".",
"indexOf",
"(",
"'",
"'",
")",
"==",
"-",
"1",
",",
"\"Simple names shouldn't contain '$': %s\"",
",",
"simpleName",
")",
";",
"String",
... | Returns a new {@link TypeInfo} for an inner class of this class. | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/TypeInfo.java#L57-L64 |
Azure/azure-sdk-for-java | policy/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/policy/v2018_03_01/implementation/PolicySetDefinitionsInner.java | PolicySetDefinitionsInner.createOrUpdate | public PolicySetDefinitionInner createOrUpdate(String policySetDefinitionName, PolicySetDefinitionInner parameters) {
return createOrUpdateWithServiceResponseAsync(policySetDefinitionName, parameters).toBlocking().single().body();
} | java | public PolicySetDefinitionInner createOrUpdate(String policySetDefinitionName, PolicySetDefinitionInner parameters) {
return createOrUpdateWithServiceResponseAsync(policySetDefinitionName, parameters).toBlocking().single().body();
} | [
"public",
"PolicySetDefinitionInner",
"createOrUpdate",
"(",
"String",
"policySetDefinitionName",
",",
"PolicySetDefinitionInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"policySetDefinitionName",
",",
"parameters",
")",
".",
"toBlockin... | Creates or updates a policy set definition.
This operation creates or updates a policy set definition in the given subscription with the given name.
@param policySetDefinitionName The name of the policy set definition to create.
@param parameters The policy set definition properties.
@throws IllegalArgumentException t... | [
"Creates",
"or",
"updates",
"a",
"policy",
"set",
"definition",
".",
"This",
"operation",
"creates",
"or",
"updates",
"a",
"policy",
"set",
"definition",
"in",
"the",
"given",
"subscription",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/policy/v2018_03_01/implementation/PolicySetDefinitionsInner.java#L129-L131 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/registry/NotificationHandlerNodeSubregistry.java | NotificationHandlerNodeSubregistry.findHandlers | void findHandlers(ListIterator<PathElement> iterator, String value, Notification notification, Collection<NotificationHandler> handlers) {
NotificationHandlerNodeRegistry registry = childRegistries.get(value);
if (registry != null) {
registry.findEntries(iterator, handlers, notification);
... | java | void findHandlers(ListIterator<PathElement> iterator, String value, Notification notification, Collection<NotificationHandler> handlers) {
NotificationHandlerNodeRegistry registry = childRegistries.get(value);
if (registry != null) {
registry.findEntries(iterator, handlers, notification);
... | [
"void",
"findHandlers",
"(",
"ListIterator",
"<",
"PathElement",
">",
"iterator",
",",
"String",
"value",
",",
"Notification",
"notification",
",",
"Collection",
"<",
"NotificationHandler",
">",
"handlers",
")",
"{",
"NotificationHandlerNodeRegistry",
"registry",
"=",... | Get the registry child for the given {@code elementValue} and traverse it to collect the handlers that match the notifications.
If the subregistry has a children for the {@link org.jboss.as.controller.PathElement#WILDCARD_VALUE}, it is also traversed. | [
"Get",
"the",
"registry",
"child",
"for",
"the",
"given",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/NotificationHandlerNodeSubregistry.java#L94-L104 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java | SourceLineAnnotation.forEntireMethod | public static SourceLineAnnotation forEntireMethod(@DottedClassName String className, String sourceFile, LineNumberTable lineNumberTable,
int codeSize) {
LineNumber[] table = lineNumberTable.getLineNumberTable();
if (table != null && table.length > 0) {
LineNumber first = table[0... | java | public static SourceLineAnnotation forEntireMethod(@DottedClassName String className, String sourceFile, LineNumberTable lineNumberTable,
int codeSize) {
LineNumber[] table = lineNumberTable.getLineNumberTable();
if (table != null && table.length > 0) {
LineNumber first = table[0... | [
"public",
"static",
"SourceLineAnnotation",
"forEntireMethod",
"(",
"@",
"DottedClassName",
"String",
"className",
",",
"String",
"sourceFile",
",",
"LineNumberTable",
"lineNumberTable",
",",
"int",
"codeSize",
")",
"{",
"LineNumber",
"[",
"]",
"table",
"=",
"lineNu... | Create a SourceLineAnnotation covering an entire method.
@param className
name of the class the method is in
@param sourceFile
source file containing the method
@param lineNumberTable
the method's LineNumberTable
@param codeSize
size in bytes of the method's code
@return a SourceLineAnnotation covering the entire meth... | [
"Create",
"a",
"SourceLineAnnotation",
"covering",
"an",
"entire",
"method",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L260-L270 |
Backendless/Android-SDK | src/com/backendless/Media.java | Media.startStream | private void startStream( RtspClient rtspClient, String streamName, String params ) throws BackendlessException
{
if( rtspClient.isStreaming() )
{
throw new BackendlessException( "Rtsp client is working on other stream" );
}
rtspClient.setServerAddress( WOWZA_SERVER_IP, WOWZA_SERVER_PORT );
... | java | private void startStream( RtspClient rtspClient, String streamName, String params ) throws BackendlessException
{
if( rtspClient.isStreaming() )
{
throw new BackendlessException( "Rtsp client is working on other stream" );
}
rtspClient.setServerAddress( WOWZA_SERVER_IP, WOWZA_SERVER_PORT );
... | [
"private",
"void",
"startStream",
"(",
"RtspClient",
"rtspClient",
",",
"String",
"streamName",
",",
"String",
"params",
")",
"throws",
"BackendlessException",
"{",
"if",
"(",
"rtspClient",
".",
"isStreaming",
"(",
")",
")",
"{",
"throw",
"new",
"BackendlessExce... | Connects/disconnects to the RTSP server and starts/stops the stream | [
"Connects",
"/",
"disconnects",
"to",
"the",
"RTSP",
"server",
"and",
"starts",
"/",
"stops",
"the",
"stream"
] | train | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/Media.java#L395-L404 |
Labs64/swid-generator | src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java | DefaultSwidProcessor.setTagCreator | public DefaultSwidProcessor setTagCreator(final String tagCreatorName, final String tagCreatorRegId) {
swidTag.setTagCreator(
new EntityComplexType(
new Token(tagCreatorName, idGenerator.nextId()),
new RegistrationId(tagCreatorRegId, idGenerator.ne... | java | public DefaultSwidProcessor setTagCreator(final String tagCreatorName, final String tagCreatorRegId) {
swidTag.setTagCreator(
new EntityComplexType(
new Token(tagCreatorName, idGenerator.nextId()),
new RegistrationId(tagCreatorRegId, idGenerator.ne... | [
"public",
"DefaultSwidProcessor",
"setTagCreator",
"(",
"final",
"String",
"tagCreatorName",
",",
"final",
"String",
"tagCreatorRegId",
")",
"{",
"swidTag",
".",
"setTagCreator",
"(",
"new",
"EntityComplexType",
"(",
"new",
"Token",
"(",
"tagCreatorName",
",",
"idGe... | <p>
Identifies the tag creator (tag: tag_creator).
</p>
<p>
Example data format: <i>“regid.2010-04.com.labs64,NLIC”</i> where:
<ul>
<li>regid = registered id</li>
<li>2010-04 = the year and first month the domain was registered (yyyy-mm)</li>
<li>com = the upper level domain</li>
<li>labs64 = the domain name</li>
<li>N... | [
"<p",
">",
"Identifies",
"the",
"tag",
"creator",
"(",
"tag",
":",
"tag_creator",
")",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Example",
"data",
"format",
":",
"<i",
">",
"“regid",
".",
"2010",
"-",
"04",
".",
"com",
".",
"labs64",
"NLIC”<",
"/",
"i... | train | https://github.com/Labs64/swid-generator/blob/cf78d2469469a09701bce7c5f966ac6de2b7c613/src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java#L206-L213 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.sendSticker | @ObjectiveCName("sendStickerWithPeer:withSticker:")
public void sendSticker(Peer peer, Sticker sticker) {
modules.getMessagesModule().sendSticker(peer, sticker);
} | java | @ObjectiveCName("sendStickerWithPeer:withSticker:")
public void sendSticker(Peer peer, Sticker sticker) {
modules.getMessagesModule().sendSticker(peer, sticker);
} | [
"@",
"ObjectiveCName",
"(",
"\"sendStickerWithPeer:withSticker:\"",
")",
"public",
"void",
"sendSticker",
"(",
"Peer",
"peer",
",",
"Sticker",
"sticker",
")",
"{",
"modules",
".",
"getMessagesModule",
"(",
")",
".",
"sendSticker",
"(",
"peer",
",",
"sticker",
")... | Send document without preview
@param peer destination peer
@param sticker sticker to send | [
"Send",
"document",
"without",
"preview"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L1004-L1007 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDNotationAttr.java | DTDNotationAttr.validateDefault | @Override
public void validateDefault(InputProblemReporter rep, boolean normalize)
throws XMLStreamException
{
// First, basic checks that it's a valid non-empty name:
String def = validateDefaultName(rep, normalize);
// And then that it's one of listed values:
String sh... | java | @Override
public void validateDefault(InputProblemReporter rep, boolean normalize)
throws XMLStreamException
{
// First, basic checks that it's a valid non-empty name:
String def = validateDefaultName(rep, normalize);
// And then that it's one of listed values:
String sh... | [
"@",
"Override",
"public",
"void",
"validateDefault",
"(",
"InputProblemReporter",
"rep",
",",
"boolean",
"normalize",
")",
"throws",
"XMLStreamException",
"{",
"// First, basic checks that it's a valid non-empty name:",
"String",
"def",
"=",
"validateDefaultName",
"(",
"re... | Method called by the validator
to ask attribute to verify that the default it has (if any) is
valid for such type. | [
"Method",
"called",
"by",
"the",
"validator",
"to",
"ask",
"attribute",
"to",
"verify",
"that",
"the",
"default",
"it",
"has",
"(",
"if",
"any",
")",
"is",
"valid",
"for",
"such",
"type",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDNotationAttr.java#L86-L104 |
andrewoma/dexx | collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java | VectorPointer.gotoFreshPosWritable1 | public void gotoFreshPosWritable1(int oldIndex, int newIndex, int xor) {
stabilize(oldIndex);
gotoFreshPosWritable0(oldIndex, newIndex, xor);
} | java | public void gotoFreshPosWritable1(int oldIndex, int newIndex, int xor) {
stabilize(oldIndex);
gotoFreshPosWritable0(oldIndex, newIndex, xor);
} | [
"public",
"void",
"gotoFreshPosWritable1",
"(",
"int",
"oldIndex",
",",
"int",
"newIndex",
",",
"int",
"xor",
")",
"{",
"stabilize",
"(",
"oldIndex",
")",
";",
"gotoFreshPosWritable0",
"(",
"oldIndex",
",",
"newIndex",
",",
"xor",
")",
";",
"}"
] | ensures structure is dirty and at pos newIndex and writable at level 0 | [
"ensures",
"structure",
"is",
"dirty",
"and",
"at",
"pos",
"newIndex",
"and",
"writable",
"at",
"level",
"0"
] | train | https://github.com/andrewoma/dexx/blob/96755b325e90c84ffa006365dde9ddf89c83c6ca/collection/src/main/java/com/github/andrewoma/dexx/collection/Vector.java#L1071-L1074 |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/Scheduler.java | Scheduler.schedule | public Scheduler schedule(Setting cronSetting) {
if (CollectionUtil.isNotEmpty(cronSetting)) {
String group;
for (Entry<String, LinkedHashMap<String, String>> groupedEntry : cronSetting.getGroupedMap().entrySet()) {
group = groupedEntry.getKey();
for (Entry<String, String> entry : groupedEntry.getV... | java | public Scheduler schedule(Setting cronSetting) {
if (CollectionUtil.isNotEmpty(cronSetting)) {
String group;
for (Entry<String, LinkedHashMap<String, String>> groupedEntry : cronSetting.getGroupedMap().entrySet()) {
group = groupedEntry.getKey();
for (Entry<String, String> entry : groupedEntry.getV... | [
"public",
"Scheduler",
"schedule",
"(",
"Setting",
"cronSetting",
")",
"{",
"if",
"(",
"CollectionUtil",
".",
"isNotEmpty",
"(",
"cronSetting",
")",
")",
"{",
"String",
"group",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"LinkedHashMap",
"<",
"String",
... | 批量加入配置文件中的定时任务<br>
配置文件格式为: xxx.xxx.xxx.Class.method = * * * * *
@param cronSetting 定时任务设置文件
@return this | [
"批量加入配置文件中的定时任务<br",
">",
"配置文件格式为:",
"xxx",
".",
"xxx",
".",
"xxx",
".",
"Class",
".",
"method",
"=",
"*",
"*",
"*",
"*",
"*"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/Scheduler.java#L176-L197 |
upwork/java-upwork | src/com/Upwork/api/Routers/Activities/Team.java | Team.updateBatch | public JSONObject updateBatch(String company, HashMap<String, String> params) throws JSONException {
return oClient.put("/otask/v1/tasks/companies/" + company + "/tasks/batch", params);
} | java | public JSONObject updateBatch(String company, HashMap<String, String> params) throws JSONException {
return oClient.put("/otask/v1/tasks/companies/" + company + "/tasks/batch", params);
} | [
"public",
"JSONObject",
"updateBatch",
"(",
"String",
"company",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"put",
"(",
"\"/otask/v1/tasks/companies/\"",
"+",
"company",
"+",
"\"/ta... | Update a group of oTask/Activity records
@param company Company ID
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Update",
"a",
"group",
"of",
"oTask",
"/",
"Activity",
"records"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Activities/Team.java#L149-L151 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_migration_GET | public ArrayList<OvhMigration> project_serviceName_migration_GET(String serviceName) throws IOException {
String qPath = "/cloud/project/{serviceName}/migration";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t10);
} | java | public ArrayList<OvhMigration> project_serviceName_migration_GET(String serviceName) throws IOException {
String qPath = "/cloud/project/{serviceName}/migration";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t10);
} | [
"public",
"ArrayList",
"<",
"OvhMigration",
">",
"project_serviceName_migration_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/migration\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qP... | Get planned migrations
REST: GET /cloud/project/{serviceName}/migration
@param serviceName [required] Service name
API beta | [
"Get",
"planned",
"migrations"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1074-L1079 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readParentFolder | public CmsResource readParentFolder(CmsRequestContext context, CmsUUID structureId) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsResource result = null;
try {
result = m_driverManager.readParentFolder(dbc, structureId);
} catch (Excep... | java | public CmsResource readParentFolder(CmsRequestContext context, CmsUUID structureId) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsResource result = null;
try {
result = m_driverManager.readParentFolder(dbc, structureId);
} catch (Excep... | [
"public",
"CmsResource",
"readParentFolder",
"(",
"CmsRequestContext",
"context",
",",
"CmsUUID",
"structureId",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"CmsResource",
"result... | Returns the parent folder to the given structure id.<p>
@param context the current request context
@param structureId the child structure id
@return the parent folder <code>{@link CmsResource}</code>
@throws CmsException if something goes wrong | [
"Returns",
"the",
"parent",
"folder",
"to",
"the",
"given",
"structure",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L4629-L4647 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/BeanELResolver.java | BeanELResolver.getValue | @Override
public Object getValue(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
}
Object result = null;
if (isResolvable(base)) {
Method method = toBeanProperty(base, property).getReadMethod();
if (method == null) {
throw new PropertyNot... | java | @Override
public Object getValue(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
}
Object result = null;
if (isResolvable(base)) {
Method method = toBeanProperty(base, property).getReadMethod();
if (method == null) {
throw new PropertyNot... | [
"@",
"Override",
"public",
"Object",
"getValue",
"(",
"ELContext",
"context",
",",
"Object",
"base",
",",
"Object",
"property",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"Object",
... | If the base object is not null, returns the current value of the given property on this bean.
If the base is not null, the propertyResolved property of the ELContext object must be set to
true by this resolver, before returning. If this property is not true after this method is
called, the caller should ignore the retu... | [
"If",
"the",
"base",
"object",
"is",
"not",
"null",
"returns",
"the",
"current",
"value",
"of",
"the",
"given",
"property",
"on",
"this",
"bean",
".",
"If",
"the",
"base",
"is",
"not",
"null",
"the",
"propertyResolved",
"property",
"of",
"the",
"ELContext"... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/BeanELResolver.java#L291-L312 |
indeedeng/proctor | proctor-store-svn/src/main/java/com/indeed/proctor/store/SvnPersisterCoreImpl.java | SvnPersisterCoreImpl.getMostRecentLogEntry | private SVNLogEntry getMostRecentLogEntry(final SVNClientManager clientManager, final String path, final SVNRevision startRevision) throws SVNException {
final String[] targetPaths = {path};
final SVNLogClient logClient = clientManager.getLogClient();
final FilterableSVNLogEntryHandler handler ... | java | private SVNLogEntry getMostRecentLogEntry(final SVNClientManager clientManager, final String path, final SVNRevision startRevision) throws SVNException {
final String[] targetPaths = {path};
final SVNLogClient logClient = clientManager.getLogClient();
final FilterableSVNLogEntryHandler handler ... | [
"private",
"SVNLogEntry",
"getMostRecentLogEntry",
"(",
"final",
"SVNClientManager",
"clientManager",
",",
"final",
"String",
"path",
",",
"final",
"SVNRevision",
"startRevision",
")",
"throws",
"SVNException",
"{",
"final",
"String",
"[",
"]",
"targetPaths",
"=",
"... | Returns the most recent log entry startRevision.
startRevision should not be HEAD because the path @HEAD could be deleted.
@param path
@param startRevision
@return
@throws SVNException | [
"Returns",
"the",
"most",
"recent",
"log",
"entry",
"startRevision",
".",
"startRevision",
"should",
"not",
"be",
"HEAD",
"because",
"the",
"path",
"@HEAD",
"could",
"be",
"deleted",
"."
] | train | https://github.com/indeedeng/proctor/blob/b7795acfc26a30d013655d0e0fa1d3f8d0576571/proctor-store-svn/src/main/java/com/indeed/proctor/store/SvnPersisterCoreImpl.java#L215-L238 |
dickschoeller/gedbrowser | geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/GeoServiceBounds.java | GeoServiceBounds.createBounds | public static Feature createBounds(final String id,
final LngLatAlt southwest,
final LngLatAlt northeast) {
final Feature feature = new Feature();
feature.setId(id);
if (northeast == null || southwest == null) {
throw new IllegalArgumentException(
... | java | public static Feature createBounds(final String id,
final LngLatAlt southwest,
final LngLatAlt northeast) {
final Feature feature = new Feature();
feature.setId(id);
if (northeast == null || southwest == null) {
throw new IllegalArgumentException(
... | [
"public",
"static",
"Feature",
"createBounds",
"(",
"final",
"String",
"id",
",",
"final",
"LngLatAlt",
"southwest",
",",
"final",
"LngLatAlt",
"northeast",
")",
"{",
"final",
"Feature",
"feature",
"=",
"new",
"Feature",
"(",
")",
";",
"feature",
".",
"setId... | Build a bounding box feature.
@param id the ID string
@param southwest the southwest corner of the bounding box
@param northeast the northeast corner of the bounding box
@return the Feature for the new bounds | [
"Build",
"a",
"bounding",
"box",
"feature",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/GeoServiceBounds.java#L54-L81 |
vanniktech/Emoji | emoji/src/main/java/com/vanniktech/emoji/EmojiUtils.java | EmojiUtils.emojiInformation | @NonNull public static EmojiInformation emojiInformation(@Nullable final String text) {
final List<EmojiRange> emojis = EmojiManager.getInstance().findAllEmojis(text);
final boolean isOnlyEmojis = isOnlyEmojis(text);
return new EmojiInformation(isOnlyEmojis, emojis);
} | java | @NonNull public static EmojiInformation emojiInformation(@Nullable final String text) {
final List<EmojiRange> emojis = EmojiManager.getInstance().findAllEmojis(text);
final boolean isOnlyEmojis = isOnlyEmojis(text);
return new EmojiInformation(isOnlyEmojis, emojis);
} | [
"@",
"NonNull",
"public",
"static",
"EmojiInformation",
"emojiInformation",
"(",
"@",
"Nullable",
"final",
"String",
"text",
")",
"{",
"final",
"List",
"<",
"EmojiRange",
">",
"emojis",
"=",
"EmojiManager",
".",
"getInstance",
"(",
")",
".",
"findAllEmojis",
"... | returns a class that contains all of the emoji information that was found in the given text | [
"returns",
"a",
"class",
"that",
"contains",
"all",
"of",
"the",
"emoji",
"information",
"that",
"was",
"found",
"in",
"the",
"given",
"text"
] | train | https://github.com/vanniktech/Emoji/blob/6d53773c1e018a4d19065b9dc1092de4308dd6f3/emoji/src/main/java/com/vanniktech/emoji/EmojiUtils.java#L39-L43 |
aragozin/jvm-tools | mxdump/src/main/java/org/gridkit/jvmtool/jackson/WriterBasedGenerator.java | WriterBasedGenerator._writePPFieldName | protected final void _writePPFieldName(String name, boolean commaBefore)
throws IOException, JsonGenerationException
{
if (commaBefore) {
_cfgPrettyPrinter.writeObjectEntrySeparator(this);
} else {
_cfgPrettyPrinter.beforeObjectEntries(this);
}
if (is... | java | protected final void _writePPFieldName(String name, boolean commaBefore)
throws IOException, JsonGenerationException
{
if (commaBefore) {
_cfgPrettyPrinter.writeObjectEntrySeparator(this);
} else {
_cfgPrettyPrinter.beforeObjectEntries(this);
}
if (is... | [
"protected",
"final",
"void",
"_writePPFieldName",
"(",
"String",
"name",
",",
"boolean",
"commaBefore",
")",
"throws",
"IOException",
",",
"JsonGenerationException",
"{",
"if",
"(",
"commaBefore",
")",
"{",
"_cfgPrettyPrinter",
".",
"writeObjectEntrySeparator",
"(",
... | Specialized version of <code>_writeFieldName</code>, off-lined
to keep the "fast path" as simple (and hopefully fast) as possible. | [
"Specialized",
"version",
"of",
"<code",
">",
"_writeFieldName<",
"/",
"code",
">",
"off",
"-",
"lined",
"to",
"keep",
"the",
"fast",
"path",
"as",
"simple",
"(",
"and",
"hopefully",
"fast",
")",
"as",
"possible",
"."
] | train | https://github.com/aragozin/jvm-tools/blob/d3a4d0c6a47fb9317f274988569655f30dcd2f76/mxdump/src/main/java/org/gridkit/jvmtool/jackson/WriterBasedGenerator.java#L300-L322 |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java | DssatXFileOutput.setSecDataArr | private int setSecDataArr(ArrayList inArr, ArrayList outArr) {
if (!inArr.isEmpty()) {
for (int j = 0; j < outArr.size(); j++) {
if (outArr.get(j).equals(inArr)) {
return j + 1;
}
}
outArr.add(inArr);
return out... | java | private int setSecDataArr(ArrayList inArr, ArrayList outArr) {
if (!inArr.isEmpty()) {
for (int j = 0; j < outArr.size(); j++) {
if (outArr.get(j).equals(inArr)) {
return j + 1;
}
}
outArr.add(inArr);
return out... | [
"private",
"int",
"setSecDataArr",
"(",
"ArrayList",
"inArr",
",",
"ArrayList",
"outArr",
")",
"{",
"if",
"(",
"!",
"inArr",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"outArr",
".",
"size",
"(",
")",
";"... | Get index value of the record and set new id value in the array
@param inArr sub array of data
@param outArr array of sub data
@return current index value of the sub data | [
"Get",
"index",
"value",
"of",
"the",
"record",
"and",
"set",
"new",
"id",
"value",
"in",
"the",
"array"
] | train | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatXFileOutput.java#L1496-L1509 |
ehcache/ehcache3 | 107/src/main/java/org/ehcache/jsr107/EhcacheCachingProvider.java | EhcacheCachingProvider.getCacheManager | public CacheManager getCacheManager(URI uri, Configuration config) {
return getCacheManager(new ConfigSupplier(uri, config), new Properties());
} | java | public CacheManager getCacheManager(URI uri, Configuration config) {
return getCacheManager(new ConfigSupplier(uri, config), new Properties());
} | [
"public",
"CacheManager",
"getCacheManager",
"(",
"URI",
"uri",
",",
"Configuration",
"config",
")",
"{",
"return",
"getCacheManager",
"(",
"new",
"ConfigSupplier",
"(",
"uri",
",",
"config",
")",
",",
"new",
"Properties",
"(",
")",
")",
";",
"}"
] | Enables to create a JSR-107 {@link CacheManager} based on the provided Ehcache {@link Configuration}.
@param uri the URI identifying this cache manager
@param config the Ehcache configuration to use
@return a cache manager | [
"Enables",
"to",
"create",
"a",
"JSR",
"-",
"107",
"{",
"@link",
"CacheManager",
"}",
"based",
"on",
"the",
"provided",
"Ehcache",
"{",
"@link",
"Configuration",
"}",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/107/src/main/java/org/ehcache/jsr107/EhcacheCachingProvider.java#L96-L98 |
lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigFactory.java | XMLConfigFactory.createConfigFile | static void createConfigFile(String xmlName, Resource configFile) throws IOException {
configFile.createFile(true);
createFileFromResource("/resource/config/" + xmlName + ".xml", configFile.getAbsoluteResource());
} | java | static void createConfigFile(String xmlName, Resource configFile) throws IOException {
configFile.createFile(true);
createFileFromResource("/resource/config/" + xmlName + ".xml", configFile.getAbsoluteResource());
} | [
"static",
"void",
"createConfigFile",
"(",
"String",
"xmlName",
",",
"Resource",
"configFile",
")",
"throws",
"IOException",
"{",
"configFile",
".",
"createFile",
"(",
"true",
")",
";",
"createFileFromResource",
"(",
"\"/resource/config/\"",
"+",
"xmlName",
"+",
"... | creates the Config File, if File not exist
@param xmlName
@param configFile
@throws IOException | [
"creates",
"the",
"Config",
"File",
"if",
"File",
"not",
"exist"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigFactory.java#L185-L188 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.divideAndRound | private static BigDecimal divideAndRound(BigInteger bdividend,
long ldivisor, int scale, int roundingMode, int preferredScale) {
boolean isRemainderZero; // record remainder is zero or not
int qsign; // quotient sign
long r = 0; // store quotient & re... | java | private static BigDecimal divideAndRound(BigInteger bdividend,
long ldivisor, int scale, int roundingMode, int preferredScale) {
boolean isRemainderZero; // record remainder is zero or not
int qsign; // quotient sign
long r = 0; // store quotient & re... | [
"private",
"static",
"BigDecimal",
"divideAndRound",
"(",
"BigInteger",
"bdividend",
",",
"long",
"ldivisor",
",",
"int",
"scale",
",",
"int",
"roundingMode",
",",
"int",
"preferredScale",
")",
"{",
"boolean",
"isRemainderZero",
";",
"// record remainder is zero or no... | Internally used for division operation for division {@code BigInteger}
by {@code long}.
The returned {@code BigDecimal} object is the quotient whose scale is set
to the passed in scale. If the remainder is not zero, it will be rounded
based on the passed in roundingMode. Also, if the remainder is zero and
the last para... | [
"Internally",
"used",
"for",
"division",
"operation",
"for",
"division",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L4241-L4270 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsUserQueryBuilder.java | CmsUserQueryBuilder.createFlagCondition | protected I_CmsQueryFragment createFlagCondition(TableAlias users, int flags) {
return new CmsSimpleQueryFragment(
users.column(colFlags()) + " & ? = ? ",
new Integer(flags),
new Integer(flags));
} | java | protected I_CmsQueryFragment createFlagCondition(TableAlias users, int flags) {
return new CmsSimpleQueryFragment(
users.column(colFlags()) + " & ? = ? ",
new Integer(flags),
new Integer(flags));
} | [
"protected",
"I_CmsQueryFragment",
"createFlagCondition",
"(",
"TableAlias",
"users",
",",
"int",
"flags",
")",
"{",
"return",
"new",
"CmsSimpleQueryFragment",
"(",
"users",
".",
"column",
"(",
"colFlags",
"(",
")",
")",
"+",
"\" & ? = ? \"",
",",
"new",
"Intege... | Creates an SQL flag check condition.<p>
@param users the user table alias
@param flags the flags to check
@return the resulting SQL expression | [
"Creates",
"an",
"SQL",
"flag",
"check",
"condition",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsUserQueryBuilder.java#L517-L523 |
WiQuery/wiquery | wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java | Options.putInteger | public Options putInteger(String key, IModel<Integer> value)
{
putOption(key, new IntegerOption(value));
return this;
} | java | public Options putInteger(String key, IModel<Integer> value)
{
putOption(key, new IntegerOption(value));
return this;
} | [
"public",
"Options",
"putInteger",
"(",
"String",
"key",
",",
"IModel",
"<",
"Integer",
">",
"value",
")",
"{",
"putOption",
"(",
"key",
",",
"new",
"IntegerOption",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Puts an int value for the given option name.
</p>
@param key
the option name.
@param value
the int value. | [
"<p",
">",
"Puts",
"an",
"int",
"value",
"for",
"the",
"given",
"option",
"name",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java#L484-L488 |
lucee/Lucee | core/src/main/java/lucee/runtime/schedule/StorageUtil.java | StorageUtil.toTime | public Time toTime(Element el, String attributeName, Time defaultValue) {
return new TimeImpl(toDateTime(el, attributeName, defaultValue));
} | java | public Time toTime(Element el, String attributeName, Time defaultValue) {
return new TimeImpl(toDateTime(el, attributeName, defaultValue));
} | [
"public",
"Time",
"toTime",
"(",
"Element",
"el",
",",
"String",
"attributeName",
",",
"Time",
"defaultValue",
")",
"{",
"return",
"new",
"TimeImpl",
"(",
"toDateTime",
"(",
"el",
",",
"attributeName",
",",
"defaultValue",
")",
")",
";",
"}"
] | reads a XML Element Attribute ans cast it to a Date
@param el XML Element to read Attribute from it
@param attributeName Name of the Attribute to read
@param defaultValue if attribute doesn't exist return default value
@return Attribute Value | [
"reads",
"a",
"XML",
"Element",
"Attribute",
"ans",
"cast",
"it",
"to",
"a",
"Date"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/StorageUtil.java#L313-L315 |
greatman/GreatmancodeTools | src/main/java/com/greatmancode/tools/utils/Vector.java | Vector.getMidpoint | public Vector getMidpoint(Vector other) {
double x = (this.x + other.x) / 2;
double y = (this.y + other.y) / 2;
double z = (this.z + other.z) / 2;
return new Vector(x, y, z);
} | java | public Vector getMidpoint(Vector other) {
double x = (this.x + other.x) / 2;
double y = (this.y + other.y) / 2;
double z = (this.z + other.z) / 2;
return new Vector(x, y, z);
} | [
"public",
"Vector",
"getMidpoint",
"(",
"Vector",
"other",
")",
"{",
"double",
"x",
"=",
"(",
"this",
".",
"x",
"+",
"other",
".",
"x",
")",
"/",
"2",
";",
"double",
"y",
"=",
"(",
"this",
".",
"y",
"+",
"other",
".",
"y",
")",
"/",
"2",
";",... | Gets a new midpoint vector between this vector and another.
@param other The other vector
@return a new midpoint vector | [
"Gets",
"a",
"new",
"midpoint",
"vector",
"between",
"this",
"vector",
"and",
"another",
"."
] | train | https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L237-L242 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configurealert.java | br_configurealert.configurealert | public static br_configurealert configurealert(nitro_service client, br_configurealert resource) throws Exception
{
return ((br_configurealert[]) resource.perform_operation(client, "configurealert"))[0];
} | java | public static br_configurealert configurealert(nitro_service client, br_configurealert resource) throws Exception
{
return ((br_configurealert[]) resource.perform_operation(client, "configurealert"))[0];
} | [
"public",
"static",
"br_configurealert",
"configurealert",
"(",
"nitro_service",
"client",
",",
"br_configurealert",
"resource",
")",
"throws",
"Exception",
"{",
"return",
"(",
"(",
"br_configurealert",
"[",
"]",
")",
"resource",
".",
"perform_operation",
"(",
"clie... | <pre>
Use this operation to configure alerts on Repeater Instances.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"configure",
"alerts",
"on",
"Repeater",
"Instances",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configurealert.java#L126-L129 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/IOManagerAsync.java | IOManagerAsync.createBulkBlockChannelReader | @Override
public BulkBlockChannelReader createBulkBlockChannelReader(FileIOChannel.ID channelID,
List<MemorySegment> targetSegments, int numBlocks) throws IOException
{
checkState(!isShutdown.get(), "I/O-Manager is shut down.");
return new AsynchronousBulkBlockReader(channelID, this.readers[channelID.getThread... | java | @Override
public BulkBlockChannelReader createBulkBlockChannelReader(FileIOChannel.ID channelID,
List<MemorySegment> targetSegments, int numBlocks) throws IOException
{
checkState(!isShutdown.get(), "I/O-Manager is shut down.");
return new AsynchronousBulkBlockReader(channelID, this.readers[channelID.getThread... | [
"@",
"Override",
"public",
"BulkBlockChannelReader",
"createBulkBlockChannelReader",
"(",
"FileIOChannel",
".",
"ID",
"channelID",
",",
"List",
"<",
"MemorySegment",
">",
"targetSegments",
",",
"int",
"numBlocks",
")",
"throws",
"IOException",
"{",
"checkState",
"(",
... | Creates a block channel reader that reads all blocks from the given channel directly in one bulk.
The reader draws segments to read the blocks into from a supplied list, which must contain as many
segments as the channel has blocks. After the reader is done, the list with the full segments can be
obtained from the read... | [
"Creates",
"a",
"block",
"channel",
"reader",
"that",
"reads",
"all",
"blocks",
"from",
"the",
"given",
"channel",
"directly",
"in",
"one",
"bulk",
".",
"The",
"reader",
"draws",
"segments",
"to",
"read",
"the",
"blocks",
"into",
"from",
"a",
"supplied",
"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/IOManagerAsync.java#L264-L270 |
samskivert/samskivert | src/main/java/com/samskivert/util/Config.java | Config.getValue | public int getValue (String name, int defval)
{
String val = _props.getProperty(name);
if (val != null) {
try {
return Integer.decode(val).intValue(); // handles base 10, hex values, etc.
} catch (NumberFormatException nfe) {
log.warning("Malfo... | java | public int getValue (String name, int defval)
{
String val = _props.getProperty(name);
if (val != null) {
try {
return Integer.decode(val).intValue(); // handles base 10, hex values, etc.
} catch (NumberFormatException nfe) {
log.warning("Malfo... | [
"public",
"int",
"getValue",
"(",
"String",
"name",
",",
"int",
"defval",
")",
"{",
"String",
"val",
"=",
"_props",
".",
"getProperty",
"(",
"name",
")",
";",
"if",
"(",
"val",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"decode",
... | Fetches and returns the value for the specified configuration property. If the value is not
specified in the associated properties file, the supplied default value is returned instead.
If the property specified in the file is poorly formatted (not and integer, not in proper
array specification), a warning message will ... | [
"Fetches",
"and",
"returns",
"the",
"value",
"for",
"the",
"specified",
"configuration",
"property",
".",
"If",
"the",
"value",
"is",
"not",
"specified",
"in",
"the",
"associated",
"properties",
"file",
"the",
"supplied",
"default",
"value",
"is",
"returned",
... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Config.java#L110-L121 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/QueryResult.java | QueryResult.withLastEvaluatedKey | public QueryResult withLastEvaluatedKey(java.util.Map<String, AttributeValue> lastEvaluatedKey) {
setLastEvaluatedKey(lastEvaluatedKey);
return this;
} | java | public QueryResult withLastEvaluatedKey(java.util.Map<String, AttributeValue> lastEvaluatedKey) {
setLastEvaluatedKey(lastEvaluatedKey);
return this;
} | [
"public",
"QueryResult",
"withLastEvaluatedKey",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
"lastEvaluatedKey",
")",
"{",
"setLastEvaluatedKey",
"(",
"lastEvaluatedKey",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to
start a new operation, excluding this value in the new request.
</p>
<p>
If <code>LastEvaluatedKey</code> is empty, then the "last page" of results has been processed and there is no
more data to be retr... | [
"<p",
">",
"The",
"primary",
"key",
"of",
"the",
"item",
"where",
"the",
"operation",
"stopped",
"inclusive",
"of",
"the",
"previous",
"result",
"set",
".",
"Use",
"this",
"value",
"to",
"start",
"a",
"new",
"operation",
"excluding",
"this",
"value",
"in",... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/QueryResult.java#L431-L434 |
aws/aws-sdk-java | aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/model/S3Location.java | S3Location.withTagging | public S3Location withTagging(java.util.Map<String, String> tagging) {
setTagging(tagging);
return this;
} | java | public S3Location withTagging(java.util.Map<String, String> tagging) {
setTagging(tagging);
return this;
} | [
"public",
"S3Location",
"withTagging",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tagging",
")",
"{",
"setTagging",
"(",
"tagging",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tag-set that is applied to the job results.
</p>
@param tagging
The tag-set that is applied to the job results.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"tag",
"-",
"set",
"that",
"is",
"applied",
"to",
"the",
"job",
"results",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/model/S3Location.java#L361-L364 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JawrApplicationConfigManager.java | JawrApplicationConfigManager.getStringValue | public String getStringValue(String property) {
final List<JawrConfigManagerMBean> mBeans = getInitializedConfigurationManagers();
try {
if (mBeans.size() == 3) {
if (areEquals(getProperty(jsMBean, property), getProperty(cssMBean, property),
getProperty(binaryMBean, property))) {
return getPro... | java | public String getStringValue(String property) {
final List<JawrConfigManagerMBean> mBeans = getInitializedConfigurationManagers();
try {
if (mBeans.size() == 3) {
if (areEquals(getProperty(jsMBean, property), getProperty(cssMBean, property),
getProperty(binaryMBean, property))) {
return getPro... | [
"public",
"String",
"getStringValue",
"(",
"String",
"property",
")",
"{",
"final",
"List",
"<",
"JawrConfigManagerMBean",
">",
"mBeans",
"=",
"getInitializedConfigurationManagers",
"(",
")",
";",
"try",
"{",
"if",
"(",
"mBeans",
".",
"size",
"(",
")",
"==",
... | Returns the string value of the configuration managers
@param property
the property to retrieve
@return the string value of the configuration managers | [
"Returns",
"the",
"string",
"value",
"of",
"the",
"configuration",
"managers"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JawrApplicationConfigManager.java#L512-L547 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java | DOM2DTM.getNodeData | protected static void getNodeData(Node node, FastStringBuffer buf)
{
switch (node.getNodeType())
{
case Node.DOCUMENT_FRAGMENT_NODE :
case Node.DOCUMENT_NODE :
case Node.ELEMENT_NODE :
{
for (Node child = node.getFirstChild(); null != child;
child = child.getNextSibling())... | java | protected static void getNodeData(Node node, FastStringBuffer buf)
{
switch (node.getNodeType())
{
case Node.DOCUMENT_FRAGMENT_NODE :
case Node.DOCUMENT_NODE :
case Node.ELEMENT_NODE :
{
for (Node child = node.getFirstChild(); null != child;
child = child.getNextSibling())... | [
"protected",
"static",
"void",
"getNodeData",
"(",
"Node",
"node",
",",
"FastStringBuffer",
"buf",
")",
"{",
"switch",
"(",
"node",
".",
"getNodeType",
"(",
")",
")",
"{",
"case",
"Node",
".",
"DOCUMENT_FRAGMENT_NODE",
":",
"case",
"Node",
".",
"DOCUMENT_NOD... | Retrieve the text content of a DOM subtree, appending it into a
user-supplied FastStringBuffer object. Note that attributes are
not considered part of the content of an element.
<p>
There are open questions regarding whitespace stripping.
Currently we make no special effort in that regard, since the standard
DOM doesn'... | [
"Retrieve",
"the",
"text",
"content",
"of",
"a",
"DOM",
"subtree",
"appending",
"it",
"into",
"a",
"user",
"-",
"supplied",
"FastStringBuffer",
"object",
".",
"Note",
"that",
"attributes",
"are",
"not",
"considered",
"part",
"of",
"the",
"content",
"of",
"an... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java#L916-L944 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/Resource.java | Resource.newResource | public static Resource newResource(URL url)
throws IOException
{
if (url==null)
return null;
String urls=url.toExternalForm();
if( urls.startsWith( "file:"))
{
try
{
FileResource fileResource= new FileResource(url);
... | java | public static Resource newResource(URL url)
throws IOException
{
if (url==null)
return null;
String urls=url.toExternalForm();
if( urls.startsWith( "file:"))
{
try
{
FileResource fileResource= new FileResource(url);
... | [
"public",
"static",
"Resource",
"newResource",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"return",
"null",
";",
"String",
"urls",
"=",
"url",
".",
"toExternalForm",
"(",
")",
";",
"if",
"(",
"urls",
".",... | Construct a resource from a url.
@param url A URL.
@return A Resource object. | [
"Construct",
"a",
"resource",
"from",
"a",
"url",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Resource.java#L47-L77 |
weld/core | impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java | ProxyFactory.createInterceptorBody | protected void createInterceptorBody(ClassMethod classMethod, MethodInformation method, ClassMethod staticConstructor) {
invokeMethodHandler(classMethod, method, true, DEFAULT_METHOD_RESOLVER, staticConstructor);
} | java | protected void createInterceptorBody(ClassMethod classMethod, MethodInformation method, ClassMethod staticConstructor) {
invokeMethodHandler(classMethod, method, true, DEFAULT_METHOD_RESOLVER, staticConstructor);
} | [
"protected",
"void",
"createInterceptorBody",
"(",
"ClassMethod",
"classMethod",
",",
"MethodInformation",
"method",
",",
"ClassMethod",
"staticConstructor",
")",
"{",
"invokeMethodHandler",
"(",
"classMethod",
",",
"method",
",",
"true",
",",
"DEFAULT_METHOD_RESOLVER",
... | Creates the given method on the proxy class where the implementation
forwards the call directly to the method handler.
<p/>
the generated bytecode is equivalent to:
<p/>
return (RetType) methodHandler.invoke(this,param1,param2);
@param classMethod the class method
@param method any JLR method
@return the method b... | [
"Creates",
"the",
"given",
"method",
"on",
"the",
"proxy",
"class",
"where",
"the",
"implementation",
"forwards",
"the",
"call",
"directly",
"to",
"the",
"method",
"handler",
".",
"<p",
"/",
">",
"the",
"generated",
"bytecode",
"is",
"equivalent",
"to",
":",... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java#L732-L734 |
js-lib-com/commons | src/main/java/js/converter/LocaleConverter.java | LocaleConverter.asObject | @Override
public <T> T asObject(String string, Class<T> valueType) throws IllegalArgumentException {
// at this point value type is guaranteed to be a Locale
int dashIndex = string.indexOf('-');
if (dashIndex == -1) {
throw new IllegalArgumentException(String.format("Cannot convert |%s| to locale instanc... | java | @Override
public <T> T asObject(String string, Class<T> valueType) throws IllegalArgumentException {
// at this point value type is guaranteed to be a Locale
int dashIndex = string.indexOf('-');
if (dashIndex == -1) {
throw new IllegalArgumentException(String.format("Cannot convert |%s| to locale instanc... | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"asObject",
"(",
"String",
"string",
",",
"Class",
"<",
"T",
">",
"valueType",
")",
"throws",
"IllegalArgumentException",
"{",
"// at this point value type is guaranteed to be a Locale\r",
"int",
"dashIndex",
"=",
"stri... | Create locale instance from ISO-639 language and ISO-3166 country code, for example en-US.
@throws IllegalArgumentException if given string argument is not well formatted. | [
"Create",
"locale",
"instance",
"from",
"ISO",
"-",
"639",
"language",
"and",
"ISO",
"-",
"3166",
"country",
"code",
"for",
"example",
"en",
"-",
"US",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/converter/LocaleConverter.java#L24-L32 |
motown-io/motown | operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/ChargingStationEventListener.java | ChargingStationEventListener.updateChargingStationAvailability | private void updateChargingStationAvailability(ChargingStationId chargingStationId, Availability availability) {
ChargingStation chargingStation = repository.findOne(chargingStationId.getId());
if (chargingStation != null) {
chargingStation.setAvailability(availability);
reposit... | java | private void updateChargingStationAvailability(ChargingStationId chargingStationId, Availability availability) {
ChargingStation chargingStation = repository.findOne(chargingStationId.getId());
if (chargingStation != null) {
chargingStation.setAvailability(availability);
reposit... | [
"private",
"void",
"updateChargingStationAvailability",
"(",
"ChargingStationId",
"chargingStationId",
",",
"Availability",
"availability",
")",
"{",
"ChargingStation",
"chargingStation",
"=",
"repository",
".",
"findOne",
"(",
"chargingStationId",
".",
"getId",
"(",
")",... | Updates the charging station's availability.
@param chargingStationId the charging station's id.
@param availability the charging station's new availability. | [
"Updates",
"the",
"charging",
"station",
"s",
"availability",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/ChargingStationEventListener.java#L366-L373 |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportVersion7.java | CmsImportVersion7.addContentFile | public void addContentFile(String source, String resourceId) {
if ((source != null) && (resourceId != null)) {
try {
m_helper.getFileBytes(source);
m_contentFiles.add(new CmsUUID(resourceId));
} catch (CmsImportExportException e) {
LOG.inf... | java | public void addContentFile(String source, String resourceId) {
if ((source != null) && (resourceId != null)) {
try {
m_helper.getFileBytes(source);
m_contentFiles.add(new CmsUUID(resourceId));
} catch (CmsImportExportException e) {
LOG.inf... | [
"public",
"void",
"addContentFile",
"(",
"String",
"source",
",",
"String",
"resourceId",
")",
"{",
"if",
"(",
"(",
"source",
"!=",
"null",
")",
"&&",
"(",
"resourceId",
"!=",
"null",
")",
")",
"{",
"try",
"{",
"m_helper",
".",
"getFileBytes",
"(",
"so... | Registers a file whose contents are contained in the zip file.<p>
@param source the path in the zip file
@param resourceId | [
"Registers",
"a",
"file",
"whose",
"contents",
"are",
"contained",
"in",
"the",
"zip",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportVersion7.java#L533-L543 |
square/otto | otto/src/main/java/com/squareup/otto/Bus.java | Bus.enqueueEvent | protected void enqueueEvent(Object event, EventHandler handler) {
eventsToDispatch.get().offer(new EventWithHandler(event, handler));
} | java | protected void enqueueEvent(Object event, EventHandler handler) {
eventsToDispatch.get().offer(new EventWithHandler(event, handler));
} | [
"protected",
"void",
"enqueueEvent",
"(",
"Object",
"event",
",",
"EventHandler",
"handler",
")",
"{",
"eventsToDispatch",
".",
"get",
"(",
")",
".",
"offer",
"(",
"new",
"EventWithHandler",
"(",
"event",
",",
"handler",
")",
")",
";",
"}"
] | Queue the {@code event} for dispatch during {@link #dispatchQueuedEvents()}. Events are queued in-order of
occurrence so they can be dispatched in the same order. | [
"Queue",
"the",
"{"
] | train | https://github.com/square/otto/blob/2a67589abd91879cf23a8c96542b59349485ec3d/otto/src/main/java/com/squareup/otto/Bus.java#L344-L346 |
wanglinsong/th-lipermi | src/main/java/net/sf/lipermi/handler/CallProxy.java | CallProxy.buildProxy | public static Object buildProxy(RemoteInstance remoteInstance, ConnectionHandler connectionHandler)
throws ClassNotFoundException {
Class<?> clazz = Class.forName(remoteInstance.getClassName());
return Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz}, new CallProxy(connec... | java | public static Object buildProxy(RemoteInstance remoteInstance, ConnectionHandler connectionHandler)
throws ClassNotFoundException {
Class<?> clazz = Class.forName(remoteInstance.getClassName());
return Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz}, new CallProxy(connec... | [
"public",
"static",
"Object",
"buildProxy",
"(",
"RemoteInstance",
"remoteInstance",
",",
"ConnectionHandler",
"connectionHandler",
")",
"throws",
"ClassNotFoundException",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"remoteInstance",
".... | Build a proxy to a {
@see net.sf.lipermi.call.RemoteInstance RemoteInstance}
specifing how it could be reached (i.e., through a ConnectionHandler)
@param remoteInstance remote instance
@param connectionHandler handler
@return dymamic proxy for RemoteInstance
@throws ClassNotFoundException class not found | [
"Build",
"a",
"proxy",
"to",
"a",
"{"
] | train | https://github.com/wanglinsong/th-lipermi/blob/5fa9ab1d7085b5133dc37ce3ba201d44a7bf25f0/src/main/java/net/sf/lipermi/handler/CallProxy.java#L76-L80 |
linkedin/dexmaker | dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/InvocationHandlerAdapter.java | InvocationHandlerAdapter.invoke | @Override
public Object invoke(final Object proxy, final Method method, final Object[] rawArgs) throws
Throwable {
// args can be null if the method invoked has no arguments, but Mockito expects a non-null
Object[] args = rawArgs;
if (rawArgs == null) {
args = new Obj... | java | @Override
public Object invoke(final Object proxy, final Method method, final Object[] rawArgs) throws
Throwable {
// args can be null if the method invoked has no arguments, but Mockito expects a non-null
Object[] args = rawArgs;
if (rawArgs == null) {
args = new Obj... | [
"@",
"Override",
"public",
"Object",
"invoke",
"(",
"final",
"Object",
"proxy",
",",
"final",
"Method",
"method",
",",
"final",
"Object",
"[",
"]",
"rawArgs",
")",
"throws",
"Throwable",
"{",
"// args can be null if the method invoked has no arguments, but Mockito expec... | Intercept a method call. Called <u>before</u> a method is called by the proxied method.
<p>This does the same as {@link #interceptEntryHook(Object, Method, Object[], SuperMethod)}
but this handles proxied methods. We only proxy abstract methods.
@param proxy proxies object
@param method method that was called
@param ... | [
"Intercept",
"a",
"method",
"call",
".",
"Called",
"<u",
">",
"before<",
"/",
"u",
">",
"a",
"method",
"is",
"called",
"by",
"the",
"proxied",
"method",
"."
] | train | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/InvocationHandlerAdapter.java#L97-L120 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRuleUserSegmentRelPersistenceImpl.java | CPRuleUserSegmentRelPersistenceImpl.findAll | @Override
public List<CPRuleUserSegmentRel> findAll(int start, int end) {
return findAll(start, end, null);
} | java | @Override
public List<CPRuleUserSegmentRel> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPRuleUserSegmentRel",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp rule user segment rels.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"rule",
"user",
"segment",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRuleUserSegmentRelPersistenceImpl.java#L1681-L1684 |
czyzby/gdx-lml | mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/InterfaceService.java | InterfaceService.addPreferencesToParser | public void addPreferencesToParser(final String preferencesKey, final String preferencesPath) {
parser.getData().addPreferences(preferencesKey, ApplicationPreferences.getPreferences(preferencesPath));
} | java | public void addPreferencesToParser(final String preferencesKey, final String preferencesPath) {
parser.getData().addPreferences(preferencesKey, ApplicationPreferences.getPreferences(preferencesPath));
} | [
"public",
"void",
"addPreferencesToParser",
"(",
"final",
"String",
"preferencesKey",
",",
"final",
"String",
"preferencesPath",
")",
"{",
"parser",
".",
"getData",
"(",
")",
".",
"addPreferences",
"(",
"preferencesKey",
",",
"ApplicationPreferences",
".",
"getPrefe... | Registers {@link com.badlogic.gdx.Preferences} object to the LML parser.
@param preferencesKey key of the preferences as it appears in LML views.
@param preferencesPath path to the preferences. | [
"Registers",
"{",
"@link",
"com",
".",
"badlogic",
".",
"gdx",
".",
"Preferences",
"}",
"object",
"to",
"the",
"LML",
"parser",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/InterfaceService.java#L126-L128 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java | DomainsInner.listSharedAccessKeysAsync | public Observable<DomainSharedAccessKeysInner> listSharedAccessKeysAsync(String resourceGroupName, String domainName) {
return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1<ServiceResponse<DomainSharedAccessKeysInner>, DomainSharedAccessKeysInner>() {
@Ove... | java | public Observable<DomainSharedAccessKeysInner> listSharedAccessKeysAsync(String resourceGroupName, String domainName) {
return listSharedAccessKeysWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1<ServiceResponse<DomainSharedAccessKeysInner>, DomainSharedAccessKeysInner>() {
@Ove... | [
"public",
"Observable",
"<",
"DomainSharedAccessKeysInner",
">",
"listSharedAccessKeysAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
")",
"{",
"return",
"listSharedAccessKeysWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"domainName",
")",... | List keys for a domain.
List the two keys used to publish to a domain.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the domain
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the DomainSharedAccessK... | [
"List",
"keys",
"for",
"a",
"domain",
".",
"List",
"the",
"two",
"keys",
"used",
"to",
"publish",
"to",
"a",
"domain",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java#L1099-L1106 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.java | GenericConversionService.getDefaultConverter | protected GenericConverter getDefaultConverter(TypeDescriptor sourceType, TypeDescriptor targetType) {
return (sourceType.isAssignableTo(targetType) ? NO_OP_CONVERTER : null);
} | java | protected GenericConverter getDefaultConverter(TypeDescriptor sourceType, TypeDescriptor targetType) {
return (sourceType.isAssignableTo(targetType) ? NO_OP_CONVERTER : null);
} | [
"protected",
"GenericConverter",
"getDefaultConverter",
"(",
"TypeDescriptor",
"sourceType",
",",
"TypeDescriptor",
"targetType",
")",
"{",
"return",
"(",
"sourceType",
".",
"isAssignableTo",
"(",
"targetType",
")",
"?",
"NO_OP_CONVERTER",
":",
"null",
")",
";",
"}"... | Return the default converter if no converter is found for the given sourceType/targetType pair.
Returns a NO_OP Converter if the sourceType is assignable to the targetType.
Returns {@code null} otherwise, indicating no suitable converter could be found.
Subclasses may override.
@param sourceType the source type to conv... | [
"Return",
"the",
"default",
"converter",
"if",
"no",
"converter",
"is",
"found",
"for",
"the",
"given",
"sourceType",
"/",
"targetType",
"pair",
".",
"Returns",
"a",
"NO_OP",
"Converter",
"if",
"the",
"sourceType",
"is",
"assignable",
"to",
"the",
"targetType"... | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.java#L252-L254 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java | TypeEnter.handleDeprecatedAnnotations | private void handleDeprecatedAnnotations(List<JCAnnotation> annotations, Symbol sym) {
for (List<JCAnnotation> al = annotations; !al.isEmpty(); al = al.tail) {
JCAnnotation a = al.head;
if (a.annotationType.type == syms.deprecatedType) {
sym.flags_field |= (Flags.DEPRECAT... | java | private void handleDeprecatedAnnotations(List<JCAnnotation> annotations, Symbol sym) {
for (List<JCAnnotation> al = annotations; !al.isEmpty(); al = al.tail) {
JCAnnotation a = al.head;
if (a.annotationType.type == syms.deprecatedType) {
sym.flags_field |= (Flags.DEPRECAT... | [
"private",
"void",
"handleDeprecatedAnnotations",
"(",
"List",
"<",
"JCAnnotation",
">",
"annotations",
",",
"Symbol",
"sym",
")",
"{",
"for",
"(",
"List",
"<",
"JCAnnotation",
">",
"al",
"=",
"annotations",
";",
"!",
"al",
".",
"isEmpty",
"(",
")",
";",
... | If a list of annotations contains a reference to java.lang.Deprecated,
set the DEPRECATED flag.
If the annotation is marked forRemoval=true, also set DEPRECATED_REMOVAL. | [
"If",
"a",
"list",
"of",
"annotations",
"contains",
"a",
"reference",
"to",
"java",
".",
"lang",
".",
"Deprecated",
"set",
"the",
"DEPRECATED",
"flag",
".",
"If",
"the",
"annotation",
"is",
"marked",
"forRemoval",
"=",
"true",
"also",
"set",
"DEPRECATED_REMO... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java#L1134-L1153 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java | ResourceManager.closeJobManagerConnection | protected void closeJobManagerConnection(JobID jobId, Exception cause) {
JobManagerRegistration jobManagerRegistration = jobManagerRegistrations.remove(jobId);
if (jobManagerRegistration != null) {
final ResourceID jobManagerResourceId = jobManagerRegistration.getJobManagerResourceID();
final JobMasterGatewa... | java | protected void closeJobManagerConnection(JobID jobId, Exception cause) {
JobManagerRegistration jobManagerRegistration = jobManagerRegistrations.remove(jobId);
if (jobManagerRegistration != null) {
final ResourceID jobManagerResourceId = jobManagerRegistration.getJobManagerResourceID();
final JobMasterGatewa... | [
"protected",
"void",
"closeJobManagerConnection",
"(",
"JobID",
"jobId",
",",
"Exception",
"cause",
")",
"{",
"JobManagerRegistration",
"jobManagerRegistration",
"=",
"jobManagerRegistrations",
".",
"remove",
"(",
"jobId",
")",
";",
"if",
"(",
"jobManagerRegistration",
... | This method should be called by the framework once it detects that a currently registered
job manager has failed.
@param jobId identifying the job whose leader shall be disconnected.
@param cause The exception which cause the JobManager failed. | [
"This",
"method",
"should",
"be",
"called",
"by",
"the",
"framework",
"once",
"it",
"detects",
"that",
"a",
"currently",
"registered",
"job",
"manager",
"has",
"failed",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java#L763-L785 |
ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/UnifierUtilities.java | UnifierUtilities.getMGU | public Substitution getMGU(Function first, Function second) {
SubstitutionImpl mgu = new SubstitutionImpl(termFactory);
if (mgu.composeFunctions(first, second))
return mgu;
return null;
} | java | public Substitution getMGU(Function first, Function second) {
SubstitutionImpl mgu = new SubstitutionImpl(termFactory);
if (mgu.composeFunctions(first, second))
return mgu;
return null;
} | [
"public",
"Substitution",
"getMGU",
"(",
"Function",
"first",
",",
"Function",
"second",
")",
"{",
"SubstitutionImpl",
"mgu",
"=",
"new",
"SubstitutionImpl",
"(",
"termFactory",
")",
";",
"if",
"(",
"mgu",
".",
"composeFunctions",
"(",
"first",
",",
"second",
... | Computes the Most General Unifier (MGU) for two n-ary atoms.
<p/>
IMPORTANT: Function terms are supported as long as they are not nested.
<p/>
IMPORTANT: handling of AnonymousVariables is questionable --
much is left to UnifierUtilities.apply (and only one version handles them)
@param first
@param second
@return the s... | [
"Computes",
"the",
"Most",
"General",
"Unifier",
"(",
"MGU",
")",
"for",
"two",
"n",
"-",
"ary",
"atoms",
".",
"<p",
"/",
">",
"IMPORTANT",
":",
"Function",
"terms",
"are",
"supported",
"as",
"long",
"as",
"they",
"are",
"not",
"nested",
".",
"<p",
"... | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/UnifierUtilities.java#L72-L77 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/oracle/AbstractOracleQuery.java | AbstractOracleQuery.connectByNocyclePrior | @WithBridgeMethods(value = OracleQuery.class, castRequired = true)
public C connectByNocyclePrior(Predicate cond) {
return addFlag(Position.BEFORE_ORDER, CONNECT_BY_NOCYCLE_PRIOR, cond);
} | java | @WithBridgeMethods(value = OracleQuery.class, castRequired = true)
public C connectByNocyclePrior(Predicate cond) {
return addFlag(Position.BEFORE_ORDER, CONNECT_BY_NOCYCLE_PRIOR, cond);
} | [
"@",
"WithBridgeMethods",
"(",
"value",
"=",
"OracleQuery",
".",
"class",
",",
"castRequired",
"=",
"true",
")",
"public",
"C",
"connectByNocyclePrior",
"(",
"Predicate",
"cond",
")",
"{",
"return",
"addFlag",
"(",
"Position",
".",
"BEFORE_ORDER",
",",
"CONNEC... | CONNECT BY specifies the relationship between parent rows and child rows of the hierarchy.
@param cond condition
@return the current object | [
"CONNECT",
"BY",
"specifies",
"the",
"relationship",
"between",
"parent",
"rows",
"and",
"child",
"rows",
"of",
"the",
"hierarchy",
"."
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/oracle/AbstractOracleQuery.java#L83-L86 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.getPackageResource | public static String getPackageResource(Class<?> type, String resourceName)
{
StringBuilder builder = new StringBuilder();
builder.append(type.getPackage().getName().replace('.', '/'));
if(resourceName.charAt(0) != '/') {
builder.append('/');
}
builder.append(resourceName);
retur... | java | public static String getPackageResource(Class<?> type, String resourceName)
{
StringBuilder builder = new StringBuilder();
builder.append(type.getPackage().getName().replace('.', '/'));
if(resourceName.charAt(0) != '/') {
builder.append('/');
}
builder.append(resourceName);
retur... | [
"public",
"static",
"String",
"getPackageResource",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"resourceName",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"type",
".",
"getPackage"... | Get resource name qualified with the package of a given class. Given a resource with simple name
<code>pdf-view-fop.xconf</code> and class <code>js.fop.PdfView</code> this method returns
<code>js/fop/pdf-view-fop.xconf</code>.
@param type class to infer package on which resource reside,
@param resourceName simple reso... | [
"Get",
"resource",
"name",
"qualified",
"with",
"the",
"package",
"of",
"a",
"given",
"class",
".",
"Given",
"a",
"resource",
"with",
"simple",
"name",
"<code",
">",
"pdf",
"-",
"view",
"-",
"fop",
".",
"xconf<",
"/",
"code",
">",
"and",
"class",
"<cod... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L949-L958 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/distancemetrics/TrainableDistanceMetric.java | TrainableDistanceMetric.trainIfNeeded | public static void trainIfNeeded(DistanceMetric dm, DataSet dataset, ExecutorService threadpool)
{
//TODO I WILL DELETE, JUST STUBBING FOR NOW TO MAKE LIFE EASY AS I DO ONE CODE SECTION AT A TIME
trainIfNeeded(dm, dataset);
} | java | public static void trainIfNeeded(DistanceMetric dm, DataSet dataset, ExecutorService threadpool)
{
//TODO I WILL DELETE, JUST STUBBING FOR NOW TO MAKE LIFE EASY AS I DO ONE CODE SECTION AT A TIME
trainIfNeeded(dm, dataset);
} | [
"public",
"static",
"void",
"trainIfNeeded",
"(",
"DistanceMetric",
"dm",
",",
"DataSet",
"dataset",
",",
"ExecutorService",
"threadpool",
")",
"{",
"//TODO I WILL DELETE, JUST STUBBING FOR NOW TO MAKE LIFE EASY AS I DO ONE CODE SECTION AT A TIME",
"trainIfNeeded",
"(",
"dm",
"... | Static helper method for training a distance metric only if it is needed.
This method can be safely called for any Distance Metric.
@param dm the distance metric to train
@param dataset the data set to train from
@param threadpool the source of threads for parallel training. May be
<tt>null</tt>, in which case {@link ... | [
"Static",
"helper",
"method",
"for",
"training",
"a",
"distance",
"metric",
"only",
"if",
"it",
"is",
"needed",
".",
"This",
"method",
"can",
"be",
"safely",
"called",
"for",
"any",
"Distance",
"Metric",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/distancemetrics/TrainableDistanceMetric.java#L186-L190 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/OldConvolution.java | OldConvolution.col2im | public static INDArray col2im(INDArray col, int sy, int sx, int ph, int pw, int h, int w) {
//number of images
long n = col.size(0);
//number of columns
long c = col.size(1);
//kernel height
long kh = col.size(2);
//kernel width
long kw = col.size(3);
... | java | public static INDArray col2im(INDArray col, int sy, int sx, int ph, int pw, int h, int w) {
//number of images
long n = col.size(0);
//number of columns
long c = col.size(1);
//kernel height
long kh = col.size(2);
//kernel width
long kw = col.size(3);
... | [
"public",
"static",
"INDArray",
"col2im",
"(",
"INDArray",
"col",
",",
"int",
"sy",
",",
"int",
"sx",
",",
"int",
"ph",
",",
"int",
"pw",
",",
"int",
"h",
",",
"int",
"w",
")",
"{",
"//number of images",
"long",
"n",
"=",
"col",
".",
"size",
"(",
... | Rearrange matrix
columns into blocks
@param col the column
transposed image to convert
@param sy stride y
@param sx stride x
@param ph padding height
@param pw padding width
@param h height
@param w width
@return | [
"Rearrange",
"matrix",
"columns",
"into",
"blocks"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/OldConvolution.java#L55-L92 |
agentgt/jirm | jirm-core/src/main/java/co/jirm/core/util/ResourceUtils.java | ResourceUtils.resolveName | private static String resolveName(Class<?> c, String name) {
if (name == null) {
return name;
}
if (!name.startsWith("/")) {
while (c.isArray()) {
c = c.getComponentType();
}
String baseName = c.getName();
int index = baseName.la... | java | private static String resolveName(Class<?> c, String name) {
if (name == null) {
return name;
}
if (!name.startsWith("/")) {
while (c.isArray()) {
c = c.getComponentType();
}
String baseName = c.getName();
int index = baseName.la... | [
"private",
"static",
"String",
"resolveName",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"name",
";",
"}",
"if",
"(",
"!",
"name",
".",
"startsWith",
"(",
"\"/\"",
")",
... | /*
Add a package name prefix if the name is not absolute Remove leading "/"
if name is absolute | [
"/",
"*",
"Add",
"a",
"package",
"name",
"prefix",
"if",
"the",
"name",
"is",
"not",
"absolute",
"Remove",
"leading",
"/",
"if",
"name",
"is",
"absolute"
] | train | https://github.com/agentgt/jirm/blob/95a2fcdef4121c439053524407af3d4ce8035722/jirm-core/src/main/java/co/jirm/core/util/ResourceUtils.java#L102-L120 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java | VirtualMachineImagesInner.listOffersAsync | public Observable<List<VirtualMachineImageResourceInner>> listOffersAsync(String location, String publisherName) {
return listOffersWithServiceResponseAsync(location, publisherName).map(new Func1<ServiceResponse<List<VirtualMachineImageResourceInner>>, List<VirtualMachineImageResourceInner>>() {
@Ov... | java | public Observable<List<VirtualMachineImageResourceInner>> listOffersAsync(String location, String publisherName) {
return listOffersWithServiceResponseAsync(location, publisherName).map(new Func1<ServiceResponse<List<VirtualMachineImageResourceInner>>, List<VirtualMachineImageResourceInner>>() {
@Ov... | [
"public",
"Observable",
"<",
"List",
"<",
"VirtualMachineImageResourceInner",
">",
">",
"listOffersAsync",
"(",
"String",
"location",
",",
"String",
"publisherName",
")",
"{",
"return",
"listOffersWithServiceResponseAsync",
"(",
"location",
",",
"publisherName",
")",
... | Gets a list of virtual machine image offers for the specified location and publisher.
@param location The name of a supported Azure region.
@param publisherName A valid image publisher.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<VirtualMachineImageRe... | [
"Gets",
"a",
"list",
"of",
"virtual",
"machine",
"image",
"offers",
"for",
"the",
"specified",
"location",
"and",
"publisher",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java#L427-L434 |
exoplatform/jcr | applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java | BackupConsole.getRepoWS | private static String getRepoWS(String[] args, int curArg)
{
if (curArg == args.length)
{
System.out.println(INCORRECT_PARAM + "There is no path to workspace parameter."); //NOSONAR
return null;
}
// make correct path
String repWS = args[curArg];
repWS =... | java | private static String getRepoWS(String[] args, int curArg)
{
if (curArg == args.length)
{
System.out.println(INCORRECT_PARAM + "There is no path to workspace parameter."); //NOSONAR
return null;
}
// make correct path
String repWS = args[curArg];
repWS =... | [
"private",
"static",
"String",
"getRepoWS",
"(",
"String",
"[",
"]",
"args",
",",
"int",
"curArg",
")",
"{",
"if",
"(",
"curArg",
"==",
"args",
".",
"length",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"INCORRECT_PARAM",
"+",
"\"There is no pat... | Get parameter from argument list, check it and return as valid path to repository and
workspace.
@param args
list of arguments.
@param curArg
argument index.
@return String valid path. | [
"Get",
"parameter",
"from",
"argument",
"list",
"check",
"it",
"and",
"return",
"as",
"valid",
"path",
"to",
"repository",
"and",
"workspace",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java#L688-L708 |
windup/windup | config/api/src/main/java/org/jboss/windup/config/metadata/MetadataBuilder.java | MetadataBuilder.forProvider | public static MetadataBuilder forProvider(Class<? extends RuleProvider> implementationType)
{
String id = implementationType.getSimpleName();
RuleMetadata metadata = Annotations.getAnnotation(implementationType, RuleMetadata.class);
if (metadata != null && !metadata.id().isEmpty())
... | java | public static MetadataBuilder forProvider(Class<? extends RuleProvider> implementationType)
{
String id = implementationType.getSimpleName();
RuleMetadata metadata = Annotations.getAnnotation(implementationType, RuleMetadata.class);
if (metadata != null && !metadata.id().isEmpty())
... | [
"public",
"static",
"MetadataBuilder",
"forProvider",
"(",
"Class",
"<",
"?",
"extends",
"RuleProvider",
">",
"implementationType",
")",
"{",
"String",
"id",
"=",
"implementationType",
".",
"getSimpleName",
"(",
")",
";",
"RuleMetadata",
"metadata",
"=",
"Annotati... | Create a new {@link RuleProviderMetadata} builder instance for the given {@link RuleProvider} type, using the provided parameters and
{@link RulesetMetadata} to seed sensible defaults. | [
"Create",
"a",
"new",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/metadata/MetadataBuilder.java#L70-L79 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/sortable/SortableBehavior.java | SortableBehavior.setGrid | public SortableBehavior setGrid(int x, int y)
{
ArrayItemOptions<IntegerItemOptions> grids = new ArrayItemOptions<IntegerItemOptions>();
grids.add(new IntegerItemOptions(x));
grids.add(new IntegerItemOptions(y));
this.options.put("grid", grids);
return this;
} | java | public SortableBehavior setGrid(int x, int y)
{
ArrayItemOptions<IntegerItemOptions> grids = new ArrayItemOptions<IntegerItemOptions>();
grids.add(new IntegerItemOptions(x));
grids.add(new IntegerItemOptions(y));
this.options.put("grid", grids);
return this;
} | [
"public",
"SortableBehavior",
"setGrid",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"ArrayItemOptions",
"<",
"IntegerItemOptions",
">",
"grids",
"=",
"new",
"ArrayItemOptions",
"<",
"IntegerItemOptions",
">",
"(",
")",
";",
"grids",
".",
"add",
"(",
"new",
... | Snaps the sorting element or helper to a grid, every x and y pixels. Array values:
[x, y]
@param x
@param y
@return instance of the current behavior | [
"Snaps",
"the",
"sorting",
"element",
"or",
"helper",
"to",
"a",
"grid",
"every",
"x",
"and",
"y",
"pixels",
".",
"Array",
"values",
":",
"[",
"x",
"y",
"]"
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/sortable/SortableBehavior.java#L825-L832 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse3DLine.java | ST_Reverse3DLine.reverse3D | public static MultiLineString reverse3D(MultiLineString multiLineString, String order) {
int num = multiLineString.getNumGeometries();
LineString[] lineStrings = new LineString[num];
for (int i = 0; i < multiLineString.getNumGeometries(); i++) {
lineStrings[i] = reverse3D((LineString... | java | public static MultiLineString reverse3D(MultiLineString multiLineString, String order) {
int num = multiLineString.getNumGeometries();
LineString[] lineStrings = new LineString[num];
for (int i = 0; i < multiLineString.getNumGeometries(); i++) {
lineStrings[i] = reverse3D((LineString... | [
"public",
"static",
"MultiLineString",
"reverse3D",
"(",
"MultiLineString",
"multiLineString",
",",
"String",
"order",
")",
"{",
"int",
"num",
"=",
"multiLineString",
".",
"getNumGeometries",
"(",
")",
";",
"LineString",
"[",
"]",
"lineStrings",
"=",
"new",
"Lin... | Reverses a multilinestring according to z value. If asc : the z first
point must be lower than the z end point if desc : the z first point must
be greater than the z end point
@param multiLineString
@return | [
"Reverses",
"a",
"multilinestring",
"according",
"to",
"z",
"value",
".",
"If",
"asc",
":",
"the",
"z",
"first",
"point",
"must",
"be",
"lower",
"than",
"the",
"z",
"end",
"point",
"if",
"desc",
":",
"the",
"z",
"first",
"point",
"must",
"be",
"greater... | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_Reverse3DLine.java#L116-L124 |
jenkinsci/jenkins | core/src/main/java/hudson/model/queue/Timeline.java | Timeline.insert | int insert(long start, long end, int n) {
splitAt(start);
splitAt(end);
int peak = 0;
for (Map.Entry<Long, int[]> e : data.tailMap(start).headMap(end).entrySet()) {
peak = max(peak, e.getValue()[0] += n);
}
return peak;
} | java | int insert(long start, long end, int n) {
splitAt(start);
splitAt(end);
int peak = 0;
for (Map.Entry<Long, int[]> e : data.tailMap(start).headMap(end).entrySet()) {
peak = max(peak, e.getValue()[0] += n);
}
return peak;
} | [
"int",
"insert",
"(",
"long",
"start",
",",
"long",
"end",
",",
"int",
"n",
")",
"{",
"splitAt",
"(",
"start",
")",
";",
"splitAt",
"(",
"end",
")",
";",
"int",
"peak",
"=",
"0",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Long",
",",
"int",
... | increases q(t) by n for t in [start,end).
@return peak value of q(t) in this range as a result of addition. | [
"increases",
"q",
"(",
"t",
")",
"by",
"n",
"for",
"t",
"in",
"[",
"start",
"end",
")",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/queue/Timeline.java#L79-L88 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java | DatatypeConverter.printExtendedAttribute | public static final String printExtendedAttribute(MSPDIWriter writer, Object value, DataType type)
{
String result;
if (type == DataType.DATE)
{
result = printExtendedAttributeDate((Date) value);
}
else
{
if (value instanceof Boolean)
{
resu... | java | public static final String printExtendedAttribute(MSPDIWriter writer, Object value, DataType type)
{
String result;
if (type == DataType.DATE)
{
result = printExtendedAttributeDate((Date) value);
}
else
{
if (value instanceof Boolean)
{
resu... | [
"public",
"static",
"final",
"String",
"printExtendedAttribute",
"(",
"MSPDIWriter",
"writer",
",",
"Object",
"value",
",",
"DataType",
"type",
")",
"{",
"String",
"result",
";",
"if",
"(",
"type",
"==",
"DataType",
".",
"DATE",
")",
"{",
"result",
"=",
"p... | Print an extended attribute value.
@param writer parent MSPDIWriter instance
@param value attribute value
@param type type of the value being passed
@return string representation | [
"Print",
"an",
"extended",
"attribute",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L186-L228 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.getWriter | public static BufferedWriter getWriter(File file, String charsetName, boolean isAppend) throws IORuntimeException {
return getWriter(file, Charset.forName(charsetName), isAppend);
} | java | public static BufferedWriter getWriter(File file, String charsetName, boolean isAppend) throws IORuntimeException {
return getWriter(file, Charset.forName(charsetName), isAppend);
} | [
"public",
"static",
"BufferedWriter",
"getWriter",
"(",
"File",
"file",
",",
"String",
"charsetName",
",",
"boolean",
"isAppend",
")",
"throws",
"IORuntimeException",
"{",
"return",
"getWriter",
"(",
"file",
",",
"Charset",
".",
"forName",
"(",
"charsetName",
")... | 获得一个带缓存的写入对象
@param file 输出文件
@param charsetName 字符集
@param isAppend 是否追加
@return BufferedReader对象
@throws IORuntimeException IO异常 | [
"获得一个带缓存的写入对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2611-L2613 |
drewnoakes/metadata-extractor | Source/com/drew/metadata/Directory.java | Directory.setObject | @java.lang.SuppressWarnings( { "ConstantConditions", "UnnecessaryBoxing" })
public void setObject(int tagType, @NotNull Object value)
{
if (value == null)
throw new NullPointerException("cannot set a null object");
if (!_tagMap.containsKey(Integer.valueOf(tagType))) {
_d... | java | @java.lang.SuppressWarnings( { "ConstantConditions", "UnnecessaryBoxing" })
public void setObject(int tagType, @NotNull Object value)
{
if (value == null)
throw new NullPointerException("cannot set a null object");
if (!_tagMap.containsKey(Integer.valueOf(tagType))) {
_d... | [
"@",
"java",
".",
"lang",
".",
"SuppressWarnings",
"(",
"{",
"\"ConstantConditions\"",
",",
"\"UnnecessaryBoxing\"",
"}",
")",
"public",
"void",
"setObject",
"(",
"int",
"tagType",
",",
"@",
"NotNull",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
... | Sets a <code>Object</code> for the specified tag.
@param tagType the tag's value as an int
@param value the value for the specified tag
@throws NullPointerException if value is <code>null</code> | [
"Sets",
"a",
"<code",
">",
"Object<",
"/",
"code",
">",
"for",
"the",
"specified",
"tag",
"."
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/metadata/Directory.java#L386-L401 |
jbossws/jbossws-cxf | modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java | SoapAddressRewriteHelper.rewriteSoapAddress | private static String rewriteSoapAddress(SOAPAddressRewriteMetadata sarm, String origAddress, String newAddress, String uriScheme)
{
try
{
URL url = new URL(newAddress);
String path = url.getPath();
String host = sarm.getWebServiceHost();
String port = getDotPortNumber... | java | private static String rewriteSoapAddress(SOAPAddressRewriteMetadata sarm, String origAddress, String newAddress, String uriScheme)
{
try
{
URL url = new URL(newAddress);
String path = url.getPath();
String host = sarm.getWebServiceHost();
String port = getDotPortNumber... | [
"private",
"static",
"String",
"rewriteSoapAddress",
"(",
"SOAPAddressRewriteMetadata",
"sarm",
",",
"String",
"origAddress",
",",
"String",
"newAddress",
",",
"String",
"uriScheme",
")",
"{",
"try",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"newAddress",
")",
... | Rewrite the provided address according to the current server
configuration and always using the specified uriScheme.
@param sarm The deployment SOAPAddressRewriteMetadata
@param origAddress The source address
@param newAddress The new (candidate) address
@param uriScheme The uriScheme to use for ... | [
"Rewrite",
"the",
"provided",
"address",
"according",
"to",
"the",
"current",
"server",
"configuration",
"and",
"always",
"using",
"the",
"specified",
"uriScheme",
"."
] | train | https://github.com/jbossws/jbossws-cxf/blob/e1d5df3664cbc2482ebc83cafd355a4d60d12150/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java#L173-L204 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchIndex.java | CmsSearchIndex.hasReadPermission | protected boolean hasReadPermission(CmsObject cms, I_CmsSearchDocument doc) {
// If no permission check is needed: the document can be read
// Else try to read the resource if this is not possible the user does not have enough permissions
return !needsPermissionCheck(doc) ? true : (null != getR... | java | protected boolean hasReadPermission(CmsObject cms, I_CmsSearchDocument doc) {
// If no permission check is needed: the document can be read
// Else try to read the resource if this is not possible the user does not have enough permissions
return !needsPermissionCheck(doc) ? true : (null != getR... | [
"protected",
"boolean",
"hasReadPermission",
"(",
"CmsObject",
"cms",
",",
"I_CmsSearchDocument",
"doc",
")",
"{",
"// If no permission check is needed: the document can be read",
"// Else try to read the resource if this is not possible the user does not have enough permissions",
"return"... | Checks if the OpenCms resource referenced by the result document can be read
be the user of the given OpenCms context.<p>
@param cms the OpenCms user context to use for permission testing
@param doc the search result document to check
@return <code>true</code> if the user has read permissions to the resource | [
"Checks",
"if",
"the",
"OpenCms",
"resource",
"referenced",
"by",
"the",
"result",
"document",
"can",
"be",
"read",
"be",
"the",
"user",
"of",
"the",
"given",
"OpenCms",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchIndex.java#L1758-L1763 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java | ImageModerationsImpl.evaluateUrlInput | public Evaluate evaluateUrlInput(String contentType, BodyModelModel imageUrl, EvaluateUrlInputOptionalParameter evaluateUrlInputOptionalParameter) {
return evaluateUrlInputWithServiceResponseAsync(contentType, imageUrl, evaluateUrlInputOptionalParameter).toBlocking().single().body();
} | java | public Evaluate evaluateUrlInput(String contentType, BodyModelModel imageUrl, EvaluateUrlInputOptionalParameter evaluateUrlInputOptionalParameter) {
return evaluateUrlInputWithServiceResponseAsync(contentType, imageUrl, evaluateUrlInputOptionalParameter).toBlocking().single().body();
} | [
"public",
"Evaluate",
"evaluateUrlInput",
"(",
"String",
"contentType",
",",
"BodyModelModel",
"imageUrl",
",",
"EvaluateUrlInputOptionalParameter",
"evaluateUrlInputOptionalParameter",
")",
"{",
"return",
"evaluateUrlInputWithServiceResponseAsync",
"(",
"contentType",
",",
"im... | Returns probabilities of the image containing racy or adult content.
@param contentType The content type.
@param imageUrl The image url.
@param evaluateUrlInputOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail ... | [
"Returns",
"probabilities",
"of",
"the",
"image",
"containing",
"racy",
"or",
"adult",
"content",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L1579-L1581 |
3pillarlabs/spring-data-simpledb | spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/reflection/ReflectionUtils.java | ReflectionUtils.hasDeclaredGetterAndSetter | public static <T> boolean hasDeclaredGetterAndSetter(final Field field, Class<T> entityClazz) {
boolean hasDeclaredAccessorsMutators = true;
Method getter = retrieveGetterFrom(entityClazz, field.getName());
Method setter = retrieveSetterFrom(entityClazz, field.getName());
if(getter == null || setter == null) ... | java | public static <T> boolean hasDeclaredGetterAndSetter(final Field field, Class<T> entityClazz) {
boolean hasDeclaredAccessorsMutators = true;
Method getter = retrieveGetterFrom(entityClazz, field.getName());
Method setter = retrieveSetterFrom(entityClazz, field.getName());
if(getter == null || setter == null) ... | [
"public",
"static",
"<",
"T",
">",
"boolean",
"hasDeclaredGetterAndSetter",
"(",
"final",
"Field",
"field",
",",
"Class",
"<",
"T",
">",
"entityClazz",
")",
"{",
"boolean",
"hasDeclaredAccessorsMutators",
"=",
"true",
";",
"Method",
"getter",
"=",
"retrieveGette... | This method checks if the declared Field is accessible through getters and setters methods Fields which have only
setters OR getters and NOT both are discarded from serialization process | [
"This",
"method",
"checks",
"if",
"the",
"declared",
"Field",
"is",
"accessible",
"through",
"getters",
"and",
"setters",
"methods",
"Fields",
"which",
"have",
"only",
"setters",
"OR",
"getters",
"and",
"NOT",
"both",
"are",
"discarded",
"from",
"serialization",... | train | https://github.com/3pillarlabs/spring-data-simpledb/blob/f1e0eb4e48ec4674d3966e8f5bc04c95031f93ae/spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/reflection/ReflectionUtils.java#L107-L118 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/model/Recur.java | Recur.getDates | public final DateList getDates(final Date seed, final Period period,
final Value value) {
return getDates(seed, period.getStart(), period.getEnd(), value, -1);
} | java | public final DateList getDates(final Date seed, final Period period,
final Value value) {
return getDates(seed, period.getStart(), period.getEnd(), value, -1);
} | [
"public",
"final",
"DateList",
"getDates",
"(",
"final",
"Date",
"seed",
",",
"final",
"Period",
"period",
",",
"final",
"Value",
"value",
")",
"{",
"return",
"getDates",
"(",
"seed",
",",
"period",
".",
"getStart",
"(",
")",
",",
"period",
".",
"getEnd"... | Convenience method for retrieving recurrences in a specified period.
@param seed a seed date for generating recurrence instances
@param period the period of returned recurrence dates
@param value type of dates to generate
@return a list of dates | [
"Convenience",
"method",
"for",
"retrieving",
"recurrences",
"in",
"a",
"specified",
"period",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/model/Recur.java#L640-L643 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java | JDBC4PreparedStatement.setObject | @Override
public void setObject(int parameterIndex, Object x) throws SQLException
{
checkParameterBounds(parameterIndex);
this.parameters[parameterIndex-1] = x;
} | java | @Override
public void setObject(int parameterIndex, Object x) throws SQLException
{
checkParameterBounds(parameterIndex);
this.parameters[parameterIndex-1] = x;
} | [
"@",
"Override",
"public",
"void",
"setObject",
"(",
"int",
"parameterIndex",
",",
"Object",
"x",
")",
"throws",
"SQLException",
"{",
"checkParameterBounds",
"(",
"parameterIndex",
")",
";",
"this",
".",
"parameters",
"[",
"parameterIndex",
"-",
"1",
"]",
"=",... | Sets the value of the designated parameter using the given object. | [
"Sets",
"the",
"value",
"of",
"the",
"designated",
"parameter",
"using",
"the",
"given",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L461-L466 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.existsResource | public boolean existsResource(CmsUUID structureId, CmsResourceFilter filter) {
return m_securityManager.existsResource(m_context, structureId, filter);
} | java | public boolean existsResource(CmsUUID structureId, CmsResourceFilter filter) {
return m_securityManager.existsResource(m_context, structureId, filter);
} | [
"public",
"boolean",
"existsResource",
"(",
"CmsUUID",
"structureId",
",",
"CmsResourceFilter",
"filter",
")",
"{",
"return",
"m_securityManager",
".",
"existsResource",
"(",
"m_context",
",",
"structureId",
",",
"filter",
")",
";",
"}"
] | Checks the availability of a resource in the VFS,
using the <code>{@link CmsResourceFilter#DEFAULT}</code> filter.<p>
A resource may be of type <code>{@link CmsFile}</code> or
<code>{@link CmsFolder}</code>.<p>
The specified filter controls what kind of resources should be "found"
during the read operation. This will... | [
"Checks",
"the",
"availability",
"of",
"a",
"resource",
"in",
"the",
"VFS",
"using",
"the",
"<code",
">",
"{",
"@link",
"CmsResourceFilter#DEFAULT",
"}",
"<",
"/",
"code",
">",
"filter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1176-L1179 |
avarabyeu/restendpoint | src/main/java/com/github/avarabyeu/restendpoint/http/DefaultErrorHandler.java | DefaultErrorHandler.handleError | protected void handleError(URI requestUri, HttpMethod requestMethod, int statusCode, String statusMessage,
ByteSource errorBody) throws RestEndpointIOException {
throw new RestEndpointException(requestUri, requestMethod, statusCode, statusMessage, errorBody);
} | java | protected void handleError(URI requestUri, HttpMethod requestMethod, int statusCode, String statusMessage,
ByteSource errorBody) throws RestEndpointIOException {
throw new RestEndpointException(requestUri, requestMethod, statusCode, statusMessage, errorBody);
} | [
"protected",
"void",
"handleError",
"(",
"URI",
"requestUri",
",",
"HttpMethod",
"requestMethod",
",",
"int",
"statusCode",
",",
"String",
"statusMessage",
",",
"ByteSource",
"errorBody",
")",
"throws",
"RestEndpointIOException",
"{",
"throw",
"new",
"RestEndpointExce... | Handler methods for HTTP client errors
@param requestUri - Request URI
@param requestMethod - Request HTTP Method
@param statusCode - HTTP status code
@param statusMessage - HTTP status message
@param errorBody - HTTP response body | [
"Handler",
"methods",
"for",
"HTTP",
"client",
"errors"
] | train | https://github.com/avarabyeu/restendpoint/blob/e11fc0813ea4cefbe4d8bca292cd48b40abf185d/src/main/java/com/github/avarabyeu/restendpoint/http/DefaultErrorHandler.java#L69-L72 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/NonplanarBonds.java | NonplanarBonds.findBond | private IBond findBond(IAtom beg1, IAtom beg2, IAtom end) {
IBond bond = container.getBond(beg1, end);
if (bond != null)
return bond;
return container.getBond(beg2, end);
} | java | private IBond findBond(IAtom beg1, IAtom beg2, IAtom end) {
IBond bond = container.getBond(beg1, end);
if (bond != null)
return bond;
return container.getBond(beg2, end);
} | [
"private",
"IBond",
"findBond",
"(",
"IAtom",
"beg1",
",",
"IAtom",
"beg2",
",",
"IAtom",
"end",
")",
"{",
"IBond",
"bond",
"=",
"container",
".",
"getBond",
"(",
"beg1",
",",
"end",
")",
";",
"if",
"(",
"bond",
"!=",
"null",
")",
"return",
"bond",
... | Find a bond between two possible atoms. For example beg1 - end or
beg2 - end.
@param beg1 begin 1
@param beg2 begin 2
@param end end
@return the bond (or null if none) | [
"Find",
"a",
"bond",
"between",
"two",
"possible",
"atoms",
".",
"For",
"example",
"beg1",
"-",
"end",
"or",
"beg2",
"-",
"end",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/NonplanarBonds.java#L401-L406 |
epam/parso | src/main/java/com/epam/parso/impl/SasFileParser.java | SasFileParser.processPageMetadata | private void processPageMetadata(int bitOffset, List<SubheaderPointer> subheaderPointers)
throws IOException {
subheaderPointers.clear();
for (int subheaderPointerIndex = 0; subheaderPointerIndex < currentPageSubheadersCount;
subheaderPointerIndex++) {
SubheaderPoint... | java | private void processPageMetadata(int bitOffset, List<SubheaderPointer> subheaderPointers)
throws IOException {
subheaderPointers.clear();
for (int subheaderPointerIndex = 0; subheaderPointerIndex < currentPageSubheadersCount;
subheaderPointerIndex++) {
SubheaderPoint... | [
"private",
"void",
"processPageMetadata",
"(",
"int",
"bitOffset",
",",
"List",
"<",
"SubheaderPointer",
">",
"subheaderPointers",
")",
"throws",
"IOException",
"{",
"subheaderPointers",
".",
"clear",
"(",
")",
";",
"for",
"(",
"int",
"subheaderPointerIndex",
"=",... | The method to parse and read metadata of a page, used for pages of the {@link SasFileConstants#PAGE_META_TYPE_1}
{@link SasFileConstants#PAGE_META_TYPE_1}, and {@link SasFileConstants#PAGE_MIX_TYPE} types. The method goes
through subheaders, one by one, and calls the processing functions depending on their signatures.
... | [
"The",
"method",
"to",
"parse",
"and",
"read",
"metadata",
"of",
"a",
"page",
"used",
"for",
"pages",
"of",
"the",
"{",
"@link",
"SasFileConstants#PAGE_META_TYPE_1",
"}",
"{",
"@link",
"SasFileConstants#PAGE_META_TYPE_1",
"}",
"and",
"{",
"@link",
"SasFileConstant... | train | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L383-L409 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java | TransformerIdentityImpl.elementDecl | public void elementDecl (String name, String model)
throws SAXException
{
if (null != m_resultDeclHandler)
m_resultDeclHandler.elementDecl(name, model);
} | java | public void elementDecl (String name, String model)
throws SAXException
{
if (null != m_resultDeclHandler)
m_resultDeclHandler.elementDecl(name, model);
} | [
"public",
"void",
"elementDecl",
"(",
"String",
"name",
",",
"String",
"model",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"null",
"!=",
"m_resultDeclHandler",
")",
"m_resultDeclHandler",
".",
"elementDecl",
"(",
"name",
",",
"model",
")",
";",
"}"
] | Report an element type declaration.
<p>The content model will consist of the string "EMPTY", the
string "ANY", or a parenthesised group, optionally followed
by an occurrence indicator. The model will be normalized so
that all whitespace is removed,and will include the enclosing
parentheses.</p>
@param name The eleme... | [
"Report",
"an",
"element",
"type",
"declaration",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java#L1342-L1347 |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/clienthandler/ClientEventHandler.java | ClientEventHandler.checkUserAgent | private Object checkUserAgent(RequestResponseClass clazz, ApiUser userAgent) {
if(clazz.getUserClass().isAssignableFrom(userAgent.getClass()))
return userAgent;
return UserAgentUtil.getGameUser(userAgent, clazz.getUserClass());
} | java | private Object checkUserAgent(RequestResponseClass clazz, ApiUser userAgent) {
if(clazz.getUserClass().isAssignableFrom(userAgent.getClass()))
return userAgent;
return UserAgentUtil.getGameUser(userAgent, clazz.getUserClass());
} | [
"private",
"Object",
"checkUserAgent",
"(",
"RequestResponseClass",
"clazz",
",",
"ApiUser",
"userAgent",
")",
"{",
"if",
"(",
"clazz",
".",
"getUserClass",
"(",
")",
".",
"isAssignableFrom",
"(",
"userAgent",
".",
"getClass",
"(",
")",
")",
")",
"return",
"... | For each listener, we may use a class of user agent, so we need check it
@param clazz structure of listener class
@param userAgent user agent object
@return instance of user agent | [
"For",
"each",
"listener",
"we",
"may",
"use",
"a",
"class",
"of",
"user",
"agent",
"so",
"we",
"need",
"check",
"it"
] | train | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/clienthandler/ClientEventHandler.java#L133-L137 |
webjars/webjars-locator | src/main/java/org/webjars/RequireJS.java | RequireJS.requireJsConfigErrorMessage | private static String requireJsConfigErrorMessage(Map.Entry<String, String> webJar) {
return "Could not read WebJar RequireJS config for: " + webJar.getKey() + " " + webJar.getValue() + "\n" +
"Please file a bug at: http://github.com/webjars/" + webJar.getKey() + "/issues/new";
} | java | private static String requireJsConfigErrorMessage(Map.Entry<String, String> webJar) {
return "Could not read WebJar RequireJS config for: " + webJar.getKey() + " " + webJar.getValue() + "\n" +
"Please file a bug at: http://github.com/webjars/" + webJar.getKey() + "/issues/new";
} | [
"private",
"static",
"String",
"requireJsConfigErrorMessage",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"webJar",
")",
"{",
"return",
"\"Could not read WebJar RequireJS config for: \"",
"+",
"webJar",
".",
"getKey",
"(",
")",
"+",
"\" \"",
"+",
... | A generic error message for when the RequireJS config could not be parsed out of the WebJar's pom.xml meta-data.
@param webJar A tuple (artifactId -> version) representing the WebJar.
@return The error message. | [
"A",
"generic",
"error",
"message",
"for",
"when",
"the",
"RequireJS",
"config",
"could",
"not",
"be",
"parsed",
"out",
"of",
"the",
"WebJar",
"s",
"pom",
".",
"xml",
"meta",
"-",
"data",
"."
] | train | https://github.com/webjars/webjars-locator/blob/8796fb3ff1b9ad5c0d433ecf63a60520c715e3a0/src/main/java/org/webjars/RequireJS.java#L551-L554 |
craftercms/core | src/main/java/org/craftercms/core/xml/mergers/impl/resolvers/MetaDataMergeStrategyResolver.java | MetaDataMergeStrategyResolver.getStrategy | public DescriptorMergeStrategy getStrategy(String descriptorUrl, Document descriptorDom) throws XmlException {
if (descriptorDom != null) {
Node element = descriptorDom.selectSingleNode(mergeStrategyElementXPathQuery);
if (element != null) {
DescriptorMergeStrategy strate... | java | public DescriptorMergeStrategy getStrategy(String descriptorUrl, Document descriptorDom) throws XmlException {
if (descriptorDom != null) {
Node element = descriptorDom.selectSingleNode(mergeStrategyElementXPathQuery);
if (element != null) {
DescriptorMergeStrategy strate... | [
"public",
"DescriptorMergeStrategy",
"getStrategy",
"(",
"String",
"descriptorUrl",
",",
"Document",
"descriptorDom",
")",
"throws",
"XmlException",
"{",
"if",
"(",
"descriptorDom",
"!=",
"null",
")",
"{",
"Node",
"element",
"=",
"descriptorDom",
".",
"selectSingleN... | Returns a {@link DescriptorMergeStrategy} for a given descriptor. The strategy chosen is the one defined
in the descriptor document.
@param descriptorUrl the URL that identifies the descriptor
@param descriptorDom the XML DOM of the descriptor
@return the {@link DescriptorMergeStrategy} for the descriptor, or null if ... | [
"Returns",
"a",
"{",
"@link",
"DescriptorMergeStrategy",
"}",
"for",
"a",
"given",
"descriptor",
".",
"The",
"strategy",
"chosen",
"is",
"the",
"one",
"defined",
"in",
"the",
"descriptor",
"document",
"."
] | train | https://github.com/craftercms/core/blob/d3ec74d669d3f8cfcf995177615d5f126edfa237/src/main/java/org/craftercms/core/xml/mergers/impl/resolvers/MetaDataMergeStrategyResolver.java#L60-L77 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.