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 |
|---|---|---|---|---|---|---|---|---|---|---|
netty/netty | codec-dns/src/main/java/io/netty/handler/codec/dns/DatagramDnsResponseEncoder.java | DatagramDnsResponseEncoder.encodeHeader | private static void encodeHeader(DnsResponse response, ByteBuf buf) {
buf.writeShort(response.id());
int flags = 32768;
flags |= (response.opCode().byteValue() & 0xFF) << 11;
if (response.isAuthoritativeAnswer()) {
flags |= 1 << 10;
}
if (response.isTruncated(... | java | private static void encodeHeader(DnsResponse response, ByteBuf buf) {
buf.writeShort(response.id());
int flags = 32768;
flags |= (response.opCode().byteValue() & 0xFF) << 11;
if (response.isAuthoritativeAnswer()) {
flags |= 1 << 10;
}
if (response.isTruncated(... | [
"private",
"static",
"void",
"encodeHeader",
"(",
"DnsResponse",
"response",
",",
"ByteBuf",
"buf",
")",
"{",
"buf",
".",
"writeShort",
"(",
"response",
".",
"id",
"(",
")",
")",
";",
"int",
"flags",
"=",
"32768",
";",
"flags",
"|=",
"(",
"response",
"... | Encodes the header that is always 12 bytes long.
@param response the response header being encoded
@param buf the buffer the encoded data should be written to | [
"Encodes",
"the",
"header",
"that",
"is",
"always",
"12",
"bytes",
"long",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-dns/src/main/java/io/netty/handler/codec/dns/DatagramDnsResponseEncoder.java#L97-L120 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java | ApiOvhDedicatednas.serviceName_partition_partitionName_quota_uid_GET | public OvhQuota serviceName_partition_partitionName_quota_uid_GET(String serviceName, String partitionName, Long uid) throws IOException {
String qPath = "/dedicated/nas/{serviceName}/partition/{partitionName}/quota/{uid}";
StringBuilder sb = path(qPath, serviceName, partitionName, uid);
String resp = exec(qPath,... | java | public OvhQuota serviceName_partition_partitionName_quota_uid_GET(String serviceName, String partitionName, Long uid) throws IOException {
String qPath = "/dedicated/nas/{serviceName}/partition/{partitionName}/quota/{uid}";
StringBuilder sb = path(qPath, serviceName, partitionName, uid);
String resp = exec(qPath,... | [
"public",
"OvhQuota",
"serviceName_partition_partitionName_quota_uid_GET",
"(",
"String",
"serviceName",
",",
"String",
"partitionName",
",",
"Long",
"uid",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/nas/{serviceName}/partition/{partitionName}/quot... | Get this object properties
REST: GET /dedicated/nas/{serviceName}/partition/{partitionName}/quota/{uid}
@param serviceName [required] The internal name of your storage
@param partitionName [required] the given name of partition
@param uid [required] the uid to set quota on | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java#L237-L242 |
openengsb/openengsb | ports/jms/src/main/java/org/openengsb/ports/jms/DestinationUrl.java | DestinationUrl.createDestinationUrl | public static DestinationUrl createDestinationUrl(String destination) {
String[] split = splitDestination(destination);
String host = split[0].trim();
String jmsDestination = split[1].trim();
return new DestinationUrl(host, jmsDestination);
} | java | public static DestinationUrl createDestinationUrl(String destination) {
String[] split = splitDestination(destination);
String host = split[0].trim();
String jmsDestination = split[1].trim();
return new DestinationUrl(host, jmsDestination);
} | [
"public",
"static",
"DestinationUrl",
"createDestinationUrl",
"(",
"String",
"destination",
")",
"{",
"String",
"[",
"]",
"split",
"=",
"splitDestination",
"(",
"destination",
")",
";",
"String",
"host",
"=",
"split",
"[",
"0",
"]",
".",
"trim",
"(",
")",
... | Creates an instance of an connection URL based on an destination string. In case that the destination string does
not match the form HOST?QUEUE||TOPIC an IllegalArgumentException is thrown. | [
"Creates",
"an",
"instance",
"of",
"an",
"connection",
"URL",
"based",
"on",
"an",
"destination",
"string",
".",
"In",
"case",
"that",
"the",
"destination",
"string",
"does",
"not",
"match",
"the",
"form",
"HOST?QUEUE||TOPIC",
"an",
"IllegalArgumentException",
"... | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/ports/jms/src/main/java/org/openengsb/ports/jms/DestinationUrl.java#L34-L39 |
bcecchinato/spring-postinitialize | src/main/java/fr/zebasto/spring/post/initialize/PostInitializeProcessor.java | PostInitializeProcessor.initializeAnnotations | private void initializeAnnotations() {
this.applicationContext.getBeansOfType(null, false, false).values()
.stream()
.filter(Objects::nonNull)
.forEach(bean -> ReflectionUtils.doWithMethods(bean.getClass(), method -> {
int order = AnnotationUti... | java | private void initializeAnnotations() {
this.applicationContext.getBeansOfType(null, false, false).values()
.stream()
.filter(Objects::nonNull)
.forEach(bean -> ReflectionUtils.doWithMethods(bean.getClass(), method -> {
int order = AnnotationUti... | [
"private",
"void",
"initializeAnnotations",
"(",
")",
"{",
"this",
".",
"applicationContext",
".",
"getBeansOfType",
"(",
"null",
",",
"false",
",",
"false",
")",
".",
"values",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"Objects",
"::",
"non... | Bean processor for methods annotated with {@link PostInitialize}
@since 1.0.0 | [
"Bean",
"processor",
"for",
"methods",
"annotated",
"with",
"{",
"@link",
"PostInitialize",
"}"
] | train | https://github.com/bcecchinato/spring-postinitialize/blob/5acd221a6aac8f03cbad63205e3157b0aeaf4bba/src/main/java/fr/zebasto/spring/post/initialize/PostInitializeProcessor.java#L71-L79 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java | TypeQualifierApplications.getInheritedTypeQualifierAnnotation | public static @CheckForNull
TypeQualifierAnnotation getInheritedTypeQualifierAnnotation(XMethod xmethod, int parameter,
TypeQualifierValue<?> typeQualifierValue) {
assert !xmethod.isStatic();
ParameterAnnotationAccumulator accumulator = new ParameterAnnotationAccumulator(typeQualifierVa... | java | public static @CheckForNull
TypeQualifierAnnotation getInheritedTypeQualifierAnnotation(XMethod xmethod, int parameter,
TypeQualifierValue<?> typeQualifierValue) {
assert !xmethod.isStatic();
ParameterAnnotationAccumulator accumulator = new ParameterAnnotationAccumulator(typeQualifierVa... | [
"public",
"static",
"@",
"CheckForNull",
"TypeQualifierAnnotation",
"getInheritedTypeQualifierAnnotation",
"(",
"XMethod",
"xmethod",
",",
"int",
"parameter",
",",
"TypeQualifierValue",
"<",
"?",
">",
"typeQualifierValue",
")",
"{",
"assert",
"!",
"xmethod",
".",
"isS... | Get the effective inherited TypeQualifierAnnotation on the given instance
method parameter.
@param xmethod
an instance method
@param parameter
a parameter (0 == first parameter)
@param typeQualifierValue
the kind of TypeQualifierValue we are looking for
@return effective inherited TypeQualifierAnnotation on the parame... | [
"Get",
"the",
"effective",
"inherited",
"TypeQualifierAnnotation",
"on",
"the",
"given",
"instance",
"method",
"parameter",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java#L952-L969 |
citrusframework/citrus | modules/citrus-http/src/main/java/com/consol/citrus/http/message/HttpMessageUtils.java | HttpMessageUtils.copy | public static void copy(Message from, HttpMessage to) {
HttpMessage source;
if (from instanceof HttpMessage) {
source = (HttpMessage) from;
} else {
source = new HttpMessage(from);
}
copy(source, to);
} | java | public static void copy(Message from, HttpMessage to) {
HttpMessage source;
if (from instanceof HttpMessage) {
source = (HttpMessage) from;
} else {
source = new HttpMessage(from);
}
copy(source, to);
} | [
"public",
"static",
"void",
"copy",
"(",
"Message",
"from",
",",
"HttpMessage",
"to",
")",
"{",
"HttpMessage",
"source",
";",
"if",
"(",
"from",
"instanceof",
"HttpMessage",
")",
"{",
"source",
"=",
"(",
"HttpMessage",
")",
"from",
";",
"}",
"else",
"{",... | Apply message settings to target http message.
@param from
@param to | [
"Apply",
"message",
"settings",
"to",
"target",
"http",
"message",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-http/src/main/java/com/consol/citrus/http/message/HttpMessageUtils.java#L40-L49 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/LogManager.java | LogManager.addLogger | public boolean addLogger(Logger logger) {
final String name = logger.getName();
if (name == null) {
throw new NullPointerException();
}
drainLoggerRefQueueBounded();
LoggerContext cx = getUserContext();
if (cx.addLocalLogger(logger, this)) {
// Do ... | java | public boolean addLogger(Logger logger) {
final String name = logger.getName();
if (name == null) {
throw new NullPointerException();
}
drainLoggerRefQueueBounded();
LoggerContext cx = getUserContext();
if (cx.addLocalLogger(logger, this)) {
// Do ... | [
"public",
"boolean",
"addLogger",
"(",
"Logger",
"logger",
")",
"{",
"final",
"String",
"name",
"=",
"logger",
".",
"getName",
"(",
")",
";",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"drainL... | Add a named logger. This does nothing and returns false if a logger
with the same name is already registered.
<p>
The Logger factory methods call this method to register each
newly created Logger.
<p>
The application should retain its own reference to the Logger
object to avoid it being garbage collected. The LogMana... | [
"Add",
"a",
"named",
"logger",
".",
"This",
"does",
"nothing",
"and",
"returns",
"false",
"if",
"a",
"logger",
"with",
"the",
"same",
"name",
"is",
"already",
"registered",
".",
"<p",
">",
"The",
"Logger",
"factory",
"methods",
"call",
"this",
"method",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/LogManager.java#L983-L998 |
Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/resources/InstanceResource.java | InstanceResource.updateMetadata | @PUT
@Path("metadata")
public Response updateMetadata(@Context UriInfo uriInfo) {
try {
InstanceInfo instanceInfo = registry.getInstanceByAppAndId(app.getName(), id);
// ReplicationInstance information is not found, generate an error
if (instanceInfo == null) {
... | java | @PUT
@Path("metadata")
public Response updateMetadata(@Context UriInfo uriInfo) {
try {
InstanceInfo instanceInfo = registry.getInstanceByAppAndId(app.getName(), id);
// ReplicationInstance information is not found, generate an error
if (instanceInfo == null) {
... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"metadata\"",
")",
"public",
"Response",
"updateMetadata",
"(",
"@",
"Context",
"UriInfo",
"uriInfo",
")",
"{",
"try",
"{",
"InstanceInfo",
"instanceInfo",
"=",
"registry",
".",
"getInstanceByAppAndId",
"(",
"app",
".",
"getName... | Updates user-specific metadata information. If the key is already available, its value will be overwritten.
If not, it will be added.
@param uriInfo - URI information generated by jersey.
@return response indicating whether the operation was a success or
failure. | [
"Updates",
"user",
"-",
"specific",
"metadata",
"information",
".",
"If",
"the",
"key",
"is",
"already",
"available",
"its",
"value",
"will",
"be",
"overwritten",
".",
"If",
"not",
"it",
"will",
"be",
"added",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/resources/InstanceResource.java#L235-L266 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgArc.java | DwgArc.readDwgArcV15 | public void readDwgArcV15(int[] data, int offset) throws Exception {
//System.out.println("readDwgArc() executed ...");
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getBitDouble(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
double x = ((Double)v.get(1)).doubl... | java | public void readDwgArcV15(int[] data, int offset) throws Exception {
//System.out.println("readDwgArc() executed ...");
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getBitDouble(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
double x = ((Double)v.get(1)).doubl... | [
"public",
"void",
"readDwgArcV15",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"throws",
"Exception",
"{",
"//System.out.println(\"readDwgArc() executed ...\");",
"int",
"bitPos",
"=",
"offset",
";",
"bitPos",
"=",
"readObjectHeaderV15",
"(",
"data",
... | Read an Arc in the DWG format Version 15
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@throws Exception If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines. | [
"Read",
"an",
"Arc",
"in",
"the",
"DWG",
"format",
"Version",
"15"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgArc.java#L47-L105 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateRouteResponseResult.java | CreateRouteResponseResult.withResponseModels | public CreateRouteResponseResult withResponseModels(java.util.Map<String, String> responseModels) {
setResponseModels(responseModels);
return this;
} | java | public CreateRouteResponseResult withResponseModels(java.util.Map<String, String> responseModels) {
setResponseModels(responseModels);
return this;
} | [
"public",
"CreateRouteResponseResult",
"withResponseModels",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"responseModels",
")",
"{",
"setResponseModels",
"(",
"responseModels",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Represents the response models of a route response.
</p>
@param responseModels
Represents the response models of a route response.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Represents",
"the",
"response",
"models",
"of",
"a",
"route",
"response",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateRouteResponseResult.java#L127-L130 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassTabbedPaneUI.java | SeaGlassTabbedPaneUI.getContext | public SeaGlassContext getContext(JComponent c, Region subregion) {
return getContext(c, subregion, getComponentState(c));
} | java | public SeaGlassContext getContext(JComponent c, Region subregion) {
return getContext(c, subregion, getComponentState(c));
} | [
"public",
"SeaGlassContext",
"getContext",
"(",
"JComponent",
"c",
",",
"Region",
"subregion",
")",
"{",
"return",
"getContext",
"(",
"c",
",",
"subregion",
",",
"getComponentState",
"(",
"c",
")",
")",
";",
"}"
] | Create a SynthContext for the component and subregion. Use the current
state.
@param c the component.
@param subregion the subregion.
@return the newly created SynthContext. | [
"Create",
"a",
"SynthContext",
"for",
"the",
"component",
"and",
"subregion",
".",
"Use",
"the",
"current",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTabbedPaneUI.java#L428-L430 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByPhoneNumber2 | public Iterable<DUser> queryByPhoneNumber2(java.lang.String phoneNumber2) {
return queryByField(null, DUserMapper.Field.PHONENUMBER2.getFieldName(), phoneNumber2);
} | java | public Iterable<DUser> queryByPhoneNumber2(java.lang.String phoneNumber2) {
return queryByField(null, DUserMapper.Field.PHONENUMBER2.getFieldName(), phoneNumber2);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByPhoneNumber2",
"(",
"java",
".",
"lang",
".",
"String",
"phoneNumber2",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"PHONENUMBER2",
".",
"getFieldName",
"(",
")",
",... | query-by method for field phoneNumber2
@param phoneNumber2 the specified attribute
@return an Iterable of DUsers for the specified phoneNumber2 | [
"query",
"-",
"by",
"method",
"for",
"field",
"phoneNumber2"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L196-L198 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java | ClassesManager.functionsAreAllowed | private static boolean functionsAreAllowed(boolean isAddAllFunction, boolean isPutAllFunction,Class<?> classD,Class<?> classS) {
if(isAddAllFunction)
return collectionIsAssignableFrom(classD) && collectionIsAssignableFrom(classS);
if(isPutAllFunction)
return mapIsAssignableFrom(classD) && mapIsAss... | java | private static boolean functionsAreAllowed(boolean isAddAllFunction, boolean isPutAllFunction,Class<?> classD,Class<?> classS) {
if(isAddAllFunction)
return collectionIsAssignableFrom(classD) && collectionIsAssignableFrom(classS);
if(isPutAllFunction)
return mapIsAssignableFrom(classD) && mapIsAss... | [
"private",
"static",
"boolean",
"functionsAreAllowed",
"(",
"boolean",
"isAddAllFunction",
",",
"boolean",
"isPutAllFunction",
",",
"Class",
"<",
"?",
">",
"classD",
",",
"Class",
"<",
"?",
">",
"classS",
")",
"{",
"if",
"(",
"isAddAllFunction",
")",
"return",... | Returns true if the function to check is allowed.
@param isAddAllFunction true if addAll method is to check
@param isPutAllFunction true if putAll method is to check
@param classD destination class
@param classS source class
@return true if the function to check is allowed | [
"Returns",
"true",
"if",
"the",
"function",
"to",
"check",
"is",
"allowed",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java#L232-L242 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionConnection.java | RaftSessionConnection.retryRequest | @SuppressWarnings("unchecked")
protected <T extends RaftRequest> void retryRequest(Throwable cause, T request, BiFunction sender, int count, int selectionId, CompletableFuture future) {
// If the connection has not changed, reset it and connect to the next server.
if (this.selectionId == selectionId) {
... | java | @SuppressWarnings("unchecked")
protected <T extends RaftRequest> void retryRequest(Throwable cause, T request, BiFunction sender, int count, int selectionId, CompletableFuture future) {
// If the connection has not changed, reset it and connect to the next server.
if (this.selectionId == selectionId) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"<",
"T",
"extends",
"RaftRequest",
">",
"void",
"retryRequest",
"(",
"Throwable",
"cause",
",",
"T",
"request",
",",
"BiFunction",
"sender",
",",
"int",
"count",
",",
"int",
"selectionId",
",",
... | Resends a request due to a request failure, resetting the connection if necessary. | [
"Resends",
"a",
"request",
"due",
"to",
"a",
"request",
"failure",
"resetting",
"the",
"connection",
"if",
"necessary",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionConnection.java#L241-L251 |
CloudSlang/cs-actions | cs-powershell/src/main/java/io/cloudslang/content/services/WSManRemoteShellService.java | WSManRemoteShellService.createShell | private String createShell(HttpClientService csHttpClient, HttpClientInputs httpClientInputs, WSManRequestInputs wsManRequestInputs)
throws RuntimeException, IOException, URISyntaxException,
XPathExpressionException, SAXException, ParserConfigurationException {
String document = Resource... | java | private String createShell(HttpClientService csHttpClient, HttpClientInputs httpClientInputs, WSManRequestInputs wsManRequestInputs)
throws RuntimeException, IOException, URISyntaxException,
XPathExpressionException, SAXException, ParserConfigurationException {
String document = Resource... | [
"private",
"String",
"createShell",
"(",
"HttpClientService",
"csHttpClient",
",",
"HttpClientInputs",
"httpClientInputs",
",",
"WSManRequestInputs",
"wsManRequestInputs",
")",
"throws",
"RuntimeException",
",",
"IOException",
",",
"URISyntaxException",
",",
"XPathExpressionE... | Creates a shell on the remote server and returns the shell id.
@param csHttpClient
@param httpClientInputs
@param wsManRequestInputs
@return the id of the created shell.
@throws RuntimeException
@throws IOException
@throws URISyntaxException
@throws TransformerException
@throws XPathExpressionException
@throws SAXExce... | [
"Creates",
"a",
"shell",
"on",
"the",
"remote",
"server",
"and",
"returns",
"the",
"shell",
"id",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-powershell/src/main/java/io/cloudslang/content/services/WSManRemoteShellService.java#L191-L200 |
strator-dev/greenpepper | greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java | ConfluenceGreenPepper.verifyCredentials | public void verifyCredentials(String username, String password) throws GreenPepperServerException {
if (username != null && !isCredentialsValid(username, password)) {
throw new GreenPepperServerException("greenpepper.confluence.badcredentials", "The username and password are incorrect.");
}
... | java | public void verifyCredentials(String username, String password) throws GreenPepperServerException {
if (username != null && !isCredentialsValid(username, password)) {
throw new GreenPepperServerException("greenpepper.confluence.badcredentials", "The username and password are incorrect.");
}
... | [
"public",
"void",
"verifyCredentials",
"(",
"String",
"username",
",",
"String",
"password",
")",
"throws",
"GreenPepperServerException",
"{",
"if",
"(",
"username",
"!=",
"null",
"&&",
"!",
"isCredentialsValid",
"(",
"username",
",",
"password",
")",
")",
"{",
... | <p>verifyCredentials.</p>
@param username a {@link java.lang.String} object.
@param password a {@link java.lang.String} object.
@throws com.greenpepper.server.GreenPepperServerException if any. | [
"<p",
">",
"verifyCredentials",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java#L902-L906 |
notnoop/java-apns | src/main/java/com/notnoop/apns/ApnsServiceBuilder.java | ApnsServiceBuilder.asBatched | public ApnsServiceBuilder asBatched(int waitTimeInSec, int maxWaitTimeInSec, ScheduledExecutorService batchThreadPoolExecutor) {
this.isBatched = true;
this.batchWaitTimeInSec = waitTimeInSec;
this.batchMaxWaitTimeInSec = maxWaitTimeInSec;
this.batchThreadPoolExecutor = batchThreadPoolEx... | java | public ApnsServiceBuilder asBatched(int waitTimeInSec, int maxWaitTimeInSec, ScheduledExecutorService batchThreadPoolExecutor) {
this.isBatched = true;
this.batchWaitTimeInSec = waitTimeInSec;
this.batchMaxWaitTimeInSec = maxWaitTimeInSec;
this.batchThreadPoolExecutor = batchThreadPoolEx... | [
"public",
"ApnsServiceBuilder",
"asBatched",
"(",
"int",
"waitTimeInSec",
",",
"int",
"maxWaitTimeInSec",
",",
"ScheduledExecutorService",
"batchThreadPoolExecutor",
")",
"{",
"this",
".",
"isBatched",
"=",
"true",
";",
"this",
".",
"batchWaitTimeInSec",
"=",
"waitTim... | Construct service which will process notification requests in batch.
After each request batch will wait <code>waitTimeInSec</code> for more request to come
before executing but not more than <code>maxWaitTimeInSec</code>
Each batch creates new connection and close it after finished.
In case reconnect policy is specifi... | [
"Construct",
"service",
"which",
"will",
"process",
"notification",
"requests",
"in",
"batch",
".",
"After",
"each",
"request",
"batch",
"will",
"wait",
"<code",
">",
"waitTimeInSec<",
"/",
"code",
">",
"for",
"more",
"request",
"to",
"come",
"before",
"execut... | train | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/ApnsServiceBuilder.java#L664-L670 |
janus-project/guava.janusproject.io | guava/src/com/google/common/eventbus/EventSubscriber.java | EventSubscriber.handleEvent | public void handleEvent(Object event) throws InvocationTargetException {
checkNotNull(event);
try {
method.invoke(target, new Object[] { event });
} catch (IllegalArgumentException e) {
throw new Error("Method rejected target/argument: " + event, e);
} catch (IllegalAccessException e) {
... | java | public void handleEvent(Object event) throws InvocationTargetException {
checkNotNull(event);
try {
method.invoke(target, new Object[] { event });
} catch (IllegalArgumentException e) {
throw new Error("Method rejected target/argument: " + event, e);
} catch (IllegalAccessException e) {
... | [
"public",
"void",
"handleEvent",
"(",
"Object",
"event",
")",
"throws",
"InvocationTargetException",
"{",
"checkNotNull",
"(",
"event",
")",
";",
"try",
"{",
"method",
".",
"invoke",
"(",
"target",
",",
"new",
"Object",
"[",
"]",
"{",
"event",
"}",
")",
... | Invokes the wrapped subscriber method to handle {@code event}.
@param event event to handle
@throws InvocationTargetException if the wrapped method throws any
{@link Throwable} that is not an {@link Error} ({@code Error} instances are
propagated as-is). | [
"Invokes",
"the",
"wrapped",
"subscriber",
"method",
"to",
"handle",
"{",
"@code",
"event",
"}",
"."
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/eventbus/EventSubscriber.java#L71-L85 |
cloudfoundry/uaa | server/src/main/java/org/cloudfoundry/identity/uaa/scim/bootstrap/ScimUserBootstrap.java | ScimUserBootstrap.addUser | protected void addUser(UaaUser user) {
ScimUser scimUser = getScimUser(user);
if (scimUser==null) {
if (isEmpty(user.getPassword()) && user.getOrigin().equals(OriginKeys.UAA)) {
logger.debug("User's password cannot be empty");
throw new InvalidPasswordExceptio... | java | protected void addUser(UaaUser user) {
ScimUser scimUser = getScimUser(user);
if (scimUser==null) {
if (isEmpty(user.getPassword()) && user.getOrigin().equals(OriginKeys.UAA)) {
logger.debug("User's password cannot be empty");
throw new InvalidPasswordExceptio... | [
"protected",
"void",
"addUser",
"(",
"UaaUser",
"user",
")",
"{",
"ScimUser",
"scimUser",
"=",
"getScimUser",
"(",
"user",
")",
";",
"if",
"(",
"scimUser",
"==",
"null",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"user",
".",
"getPassword",
"(",
")",
")",
... | Add a user account from the properties provided.
@param user a UaaUser | [
"Add",
"a",
"user",
"account",
"from",
"the",
"properties",
"provided",
"."
] | train | https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/server/src/main/java/org/cloudfoundry/identity/uaa/scim/bootstrap/ScimUserBootstrap.java#L172-L188 |
zaproxy/zaproxy | src/org/zaproxy/zap/view/StandardFieldsDialog.java | StandardFieldsDialog.addPasswordField | public void addPasswordField(int tabIndex, String fieldLabel, String value) {
addTextComponent(tabIndex, new JPasswordField(), fieldLabel, value);
} | java | public void addPasswordField(int tabIndex, String fieldLabel, String value) {
addTextComponent(tabIndex, new JPasswordField(), fieldLabel, value);
} | [
"public",
"void",
"addPasswordField",
"(",
"int",
"tabIndex",
",",
"String",
"fieldLabel",
",",
"String",
"value",
")",
"{",
"addTextComponent",
"(",
"tabIndex",
",",
"new",
"JPasswordField",
"(",
")",
",",
"fieldLabel",
",",
"value",
")",
";",
"}"
] | Adds a {@link JPasswordField} field to the tab with the given index, with the given label and, optionally, the given
value.
@param tabIndex the index of the tab
@param fieldLabel the label of the field
@param value the value of the field, might be {@code null}
@throws IllegalArgumentException if the dialogue is not a ... | [
"Adds",
"a",
"{",
"@link",
"JPasswordField",
"}",
"field",
"to",
"the",
"tab",
"with",
"the",
"given",
"index",
"with",
"the",
"given",
"label",
"and",
"optionally",
"the",
"given",
"value",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/StandardFieldsDialog.java#L676-L678 |
meertensinstituut/mtas | src/main/java/mtas/analysis/token/MtasToken.java | MtasToken.setRealOffset | final public void setRealOffset(Integer start, Integer end) {
if ((start == null) || (end == null)) {
// do nothing
} else if (start > end) {
throw new IllegalArgumentException(
"Start real offset after end real offset");
} else {
tokenRealOffset = new MtasOffset(start, end);
... | java | final public void setRealOffset(Integer start, Integer end) {
if ((start == null) || (end == null)) {
// do nothing
} else if (start > end) {
throw new IllegalArgumentException(
"Start real offset after end real offset");
} else {
tokenRealOffset = new MtasOffset(start, end);
... | [
"final",
"public",
"void",
"setRealOffset",
"(",
"Integer",
"start",
",",
"Integer",
"end",
")",
"{",
"if",
"(",
"(",
"start",
"==",
"null",
")",
"||",
"(",
"end",
"==",
"null",
")",
")",
"{",
"// do nothing",
"}",
"else",
"if",
"(",
"start",
">",
... | Sets the real offset.
@param start the start
@param end the end | [
"Sets",
"the",
"real",
"offset",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/token/MtasToken.java#L461-L470 |
bluelinelabs/Conductor | conductor/src/main/java/com/bluelinelabs/conductor/Router.java | Router.onRequestPermissionsResult | public void onRequestPermissionsResult(@NonNull String instanceId, int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
Controller controller = getControllerWithInstanceId(instanceId);
if (controller != null) {
controller.requestPermissionsResult(requestCode, permis... | java | public void onRequestPermissionsResult(@NonNull String instanceId, int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
Controller controller = getControllerWithInstanceId(instanceId);
if (controller != null) {
controller.requestPermissionsResult(requestCode, permis... | [
"public",
"void",
"onRequestPermissionsResult",
"(",
"@",
"NonNull",
"String",
"instanceId",
",",
"int",
"requestCode",
",",
"@",
"NonNull",
"String",
"[",
"]",
"permissions",
",",
"@",
"NonNull",
"int",
"[",
"]",
"grantResults",
")",
"{",
"Controller",
"contr... | This should be called by the host Activity when its onRequestPermissionsResult method is called. The call will be forwarded
to the {@link Controller} with the instanceId passed in.
@param instanceId The instanceId of the Controller to which this result should be forwarded
@param requestCode The Activity's onRequest... | [
"This",
"should",
"be",
"called",
"by",
"the",
"host",
"Activity",
"when",
"its",
"onRequestPermissionsResult",
"method",
"is",
"called",
".",
"The",
"call",
"will",
"be",
"forwarded",
"to",
"the",
"{",
"@link",
"Controller",
"}",
"with",
"the",
"instanceId",
... | train | https://github.com/bluelinelabs/Conductor/blob/94c9121bb16f93b481954513a8e3905846829fb2/conductor/src/main/java/com/bluelinelabs/conductor/Router.java#L77-L82 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/TrueTypeFont.java | TrueTypeFont.getFontDescriptor | public float getFontDescriptor(int key, float fontSize) {
switch (key) {
case ASCENT:
return os_2.sTypoAscender * fontSize / head.unitsPerEm;
case CAPHEIGHT:
return os_2.sCapHeight * fontSize / head.unitsPerEm;
case DESCENT:
ret... | java | public float getFontDescriptor(int key, float fontSize) {
switch (key) {
case ASCENT:
return os_2.sTypoAscender * fontSize / head.unitsPerEm;
case CAPHEIGHT:
return os_2.sCapHeight * fontSize / head.unitsPerEm;
case DESCENT:
ret... | [
"public",
"float",
"getFontDescriptor",
"(",
"int",
"key",
",",
"float",
"fontSize",
")",
"{",
"switch",
"(",
"key",
")",
"{",
"case",
"ASCENT",
":",
"return",
"os_2",
".",
"sTypoAscender",
"*",
"fontSize",
"/",
"head",
".",
"unitsPerEm",
";",
"case",
"C... | Gets the font parameter identified by <CODE>key</CODE>. Valid values
for <CODE>key</CODE> are <CODE>ASCENT</CODE>, <CODE>CAPHEIGHT</CODE>, <CODE>DESCENT</CODE>
and <CODE>ITALICANGLE</CODE>.
@param key the parameter to be extracted
@param fontSize the font size in points
@return the parameter in points | [
"Gets",
"the",
"font",
"parameter",
"identified",
"by",
"<CODE",
">",
"key<",
"/",
"CODE",
">",
".",
"Valid",
"values",
"for",
"<CODE",
">",
"key<",
"/",
"CODE",
">",
"are",
"<CODE",
">",
"ASCENT<",
"/",
"CODE",
">",
"<CODE",
">",
"CAPHEIGHT<",
"/",
... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/TrueTypeFont.java#L1357-L1401 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/input/named/AbstractNamedInputHandler.java | AbstractNamedInputHandler.updateBean | protected T updateBean(T object, Map<String, Object> source) {
T clone = copyProperties(object);
updateProperties(clone, source);
return clone;
} | java | protected T updateBean(T object, Map<String, Object> source) {
T clone = copyProperties(object);
updateProperties(clone, source);
return clone;
} | [
"protected",
"T",
"updateBean",
"(",
"T",
"object",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"T",
"clone",
"=",
"copyProperties",
"(",
"object",
")",
";",
"updateProperties",
"(",
"clone",
",",
"source",
")",
";",
"return",
"c... | Updates bean with values from source.
@param object Bean object to update
@param source Map which would be read
@return cloned bean with updated values | [
"Updates",
"bean",
"with",
"values",
"from",
"source",
"."
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/input/named/AbstractNamedInputHandler.java#L88-L94 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java | LocaleDisplayNames.getInstance | public static LocaleDisplayNames getInstance(ULocale locale, DisplayContext... contexts) {
LocaleDisplayNames result = null;
if (FACTORY_DISPLAYCONTEXT != null) {
try {
result = (LocaleDisplayNames) FACTORY_DISPLAYCONTEXT.invoke(null,
locale, contexts)... | java | public static LocaleDisplayNames getInstance(ULocale locale, DisplayContext... contexts) {
LocaleDisplayNames result = null;
if (FACTORY_DISPLAYCONTEXT != null) {
try {
result = (LocaleDisplayNames) FACTORY_DISPLAYCONTEXT.invoke(null,
locale, contexts)... | [
"public",
"static",
"LocaleDisplayNames",
"getInstance",
"(",
"ULocale",
"locale",
",",
"DisplayContext",
"...",
"contexts",
")",
"{",
"LocaleDisplayNames",
"result",
"=",
"null",
";",
"if",
"(",
"FACTORY_DISPLAYCONTEXT",
"!=",
"null",
")",
"{",
"try",
"{",
"res... | Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale,
using the provided DisplayContext settings
@param locale the display locale
@param contexts one or more context settings (e.g. for dialect
handling, capitalization, etc.
@return a LocaleDisplayNames instance | [
"Returns",
"an",
"instance",
"of",
"LocaleDisplayNames",
"that",
"returns",
"names",
"formatted",
"for",
"the",
"provided",
"locale",
"using",
"the",
"provided",
"DisplayContext",
"settings"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java#L102-L118 |
apache/flink | flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopRecoverableFsDataOutputStream.java | HadoopRecoverableFsDataOutputStream.waitUntilLeaseIsRevoked | private static boolean waitUntilLeaseIsRevoked(final FileSystem fs, final Path path) throws IOException {
Preconditions.checkState(fs instanceof DistributedFileSystem);
final DistributedFileSystem dfs = (DistributedFileSystem) fs;
dfs.recoverLease(path);
final Deadline deadline = Deadline.now().plus(Duration.... | java | private static boolean waitUntilLeaseIsRevoked(final FileSystem fs, final Path path) throws IOException {
Preconditions.checkState(fs instanceof DistributedFileSystem);
final DistributedFileSystem dfs = (DistributedFileSystem) fs;
dfs.recoverLease(path);
final Deadline deadline = Deadline.now().plus(Duration.... | [
"private",
"static",
"boolean",
"waitUntilLeaseIsRevoked",
"(",
"final",
"FileSystem",
"fs",
",",
"final",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkState",
"(",
"fs",
"instanceof",
"DistributedFileSystem",
")",
";",
"final",
"... | Called when resuming execution after a failure and waits until the lease
of the file we are resuming is free.
<p>The lease of the file we are resuming writing/committing to may still
belong to the process that failed previously and whose state we are
recovering.
@param path The path to the file we want to resume writ... | [
"Called",
"when",
"resuming",
"execution",
"after",
"a",
"failure",
"and",
"waits",
"until",
"the",
"lease",
"of",
"the",
"file",
"we",
"are",
"resuming",
"is",
"free",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopRecoverableFsDataOutputStream.java#L321-L342 |
BlueBrain/bluima | modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/tools/util/CountedNumberedSet.java | CountedNumberedSet.setCount | public void setCount(Object o,int c) {
int[] nums = (int[]) cset.get(o);
if (nums != null) {
nums[0] = c;
}
else {
cset.put(o,new int[]{c,1});
}
} | java | public void setCount(Object o,int c) {
int[] nums = (int[]) cset.get(o);
if (nums != null) {
nums[0] = c;
}
else {
cset.put(o,new int[]{c,1});
}
} | [
"public",
"void",
"setCount",
"(",
"Object",
"o",
",",
"int",
"c",
")",
"{",
"int",
"[",
"]",
"nums",
"=",
"(",
"int",
"[",
"]",
")",
"cset",
".",
"get",
"(",
"o",
")",
";",
"if",
"(",
"nums",
"!=",
"null",
")",
"{",
"nums",
"[",
"0",
"]",
... | Assigns the specified object the specified count in the set.
@param o The object to be added or updated in the set.
@param c The count of the specified object. | [
"Assigns",
"the",
"specified",
"object",
"the",
"specified",
"count",
"in",
"the",
"set",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/tools/util/CountedNumberedSet.java#L70-L78 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersInner.java | LoadBalancersInner.updateTags | public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).toBlocking().last().body();
} | java | public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, loadBalancerName, tags).toBlocking().last().body();
} | [
"public",
"LoadBalancerInner",
"updateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"loadBalancerName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"loadBal... | Updates a load balancer tags.
@param resourceGroupName The name of the resource group.
@param loadBalancerName The name of the load balancer.
@param tags Resource tags.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws R... | [
"Updates",
"a",
"load",
"balancer",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LoadBalancersInner.java#L681-L683 |
lucee/Lucee | core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java | FunctionLibFactory.setAttributes | private static void setAttributes(FunctionLib extFL, FunctionLib newFL) {
newFL.setDescription(extFL.getDescription());
newFL.setDisplayName(extFL.getDisplayName());
newFL.setShortName(extFL.getShortName());
newFL.setUri(extFL.getUri());
newFL.setVersion(extFL.getVersion());
} | java | private static void setAttributes(FunctionLib extFL, FunctionLib newFL) {
newFL.setDescription(extFL.getDescription());
newFL.setDisplayName(extFL.getDisplayName());
newFL.setShortName(extFL.getShortName());
newFL.setUri(extFL.getUri());
newFL.setVersion(extFL.getVersion());
} | [
"private",
"static",
"void",
"setAttributes",
"(",
"FunctionLib",
"extFL",
",",
"FunctionLib",
"newFL",
")",
"{",
"newFL",
".",
"setDescription",
"(",
"extFL",
".",
"getDescription",
"(",
")",
")",
";",
"newFL",
".",
"setDisplayName",
"(",
"extFL",
".",
"get... | copy attributes from old fld to the new
@param extFL
@param newFL | [
"copy",
"attributes",
"from",
"old",
"fld",
"to",
"the",
"new"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java#L478-L484 |
fozziethebeat/S-Space | opt/src/main/java/edu/ucla/sspace/lra/LatentRelationalAnalysis.java | LatentRelationalAnalysis.getIndexOfPair | private static int getIndexOfPair(String value, Map<Integer, String> row_data) {
for(Integer i : row_data.keySet()) {
if(row_data.get(i).equals(value)) {
return i.intValue();
}
}
return -1;
} | java | private static int getIndexOfPair(String value, Map<Integer, String> row_data) {
for(Integer i : row_data.keySet()) {
if(row_data.get(i).equals(value)) {
return i.intValue();
}
}
return -1;
} | [
"private",
"static",
"int",
"getIndexOfPair",
"(",
"String",
"value",
",",
"Map",
"<",
"Integer",
",",
"String",
">",
"row_data",
")",
"{",
"for",
"(",
"Integer",
"i",
":",
"row_data",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"row_data",
".",
"g... | returns the index of the String in the HashMap, or -1 if value was not found. | [
"returns",
"the",
"index",
"of",
"the",
"String",
"in",
"the",
"HashMap",
"or",
"-",
"1",
"if",
"value",
"was",
"not",
"found",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/opt/src/main/java/edu/ucla/sspace/lra/LatentRelationalAnalysis.java#L826-L833 |
groupon/monsoon | intf/src/main/java/com/groupon/lex/metrics/resolver/NamedResolverMap.java | NamedResolverMap.getBooleanOrDefault | public boolean getBooleanOrDefault(int key, boolean dfl) {
Any3<Boolean, Integer, String> value = data.getOrDefault(Any2.<Integer, String>left(key), Any3.<Boolean, Integer, String>create1(dfl));
return value.get1().orElseThrow(() -> new IllegalArgumentException("expected boolean argument for param " + k... | java | public boolean getBooleanOrDefault(int key, boolean dfl) {
Any3<Boolean, Integer, String> value = data.getOrDefault(Any2.<Integer, String>left(key), Any3.<Boolean, Integer, String>create1(dfl));
return value.get1().orElseThrow(() -> new IllegalArgumentException("expected boolean argument for param " + k... | [
"public",
"boolean",
"getBooleanOrDefault",
"(",
"int",
"key",
",",
"boolean",
"dfl",
")",
"{",
"Any3",
"<",
"Boolean",
",",
"Integer",
",",
"String",
">",
"value",
"=",
"data",
".",
"getOrDefault",
"(",
"Any2",
".",
"<",
"Integer",
",",
"String",
">",
... | Return the boolean value indicated by the given numeric key.
@param key The key of the value to return.
@param dfl The default value to return, if the key is absent.
@return The boolean value stored under the given key, or dfl.
@throws IllegalArgumentException if the value is present, but not a
boolean. | [
"Return",
"the",
"boolean",
"value",
"indicated",
"by",
"the",
"given",
"numeric",
"key",
"."
] | train | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/resolver/NamedResolverMap.java#L45-L48 |
pierre/serialization | hadoop/src/main/java/com/ning/metrics/serialization/hadoop/pig/SmileStorage.java | SmileStorage.prepareToRead | @Override
public void prepareToRead(final RecordReader reader, final PigSplit split) throws IOException
{
this.reader = reader;
this.split = split;
} | java | @Override
public void prepareToRead(final RecordReader reader, final PigSplit split) throws IOException
{
this.reader = reader;
this.split = split;
} | [
"@",
"Override",
"public",
"void",
"prepareToRead",
"(",
"final",
"RecordReader",
"reader",
",",
"final",
"PigSplit",
"split",
")",
"throws",
"IOException",
"{",
"this",
".",
"reader",
"=",
"reader",
";",
"this",
".",
"split",
"=",
"split",
";",
"}"
] | Initializes LoadFunc for reading data. This will be called during execution
before any calls to getNext. The RecordReader needs to be passed here because
it has been instantiated for a particular InputSplit.
@param reader {@link org.apache.hadoop.mapreduce.RecordReader} to be used by this instance of the LoadFunc
@p... | [
"Initializes",
"LoadFunc",
"for",
"reading",
"data",
".",
"This",
"will",
"be",
"called",
"during",
"execution",
"before",
"any",
"calls",
"to",
"getNext",
".",
"The",
"RecordReader",
"needs",
"to",
"be",
"passed",
"here",
"because",
"it",
"has",
"been",
"in... | train | https://github.com/pierre/serialization/blob/b15b7c749ba78bfe94dce8fc22f31b30b2e6830b/hadoop/src/main/java/com/ning/metrics/serialization/hadoop/pig/SmileStorage.java#L138-L143 |
mnlipp/jgrapes | org.jgrapes.http/src/org/jgrapes/http/ResponseCreationSupport.java | ResponseCreationSupport.resourceInfo | @SuppressWarnings("PMD.EmptyCatchBlock")
public static ResourceInfo resourceInfo(URL resource) {
try {
Path path = Paths.get(resource.toURI());
return new ResourceInfo(Files.isDirectory(path),
Files.getLastModifiedTime(path).toInstant()
.with(Chron... | java | @SuppressWarnings("PMD.EmptyCatchBlock")
public static ResourceInfo resourceInfo(URL resource) {
try {
Path path = Paths.get(resource.toURI());
return new ResourceInfo(Files.isDirectory(path),
Files.getLastModifiedTime(path).toInstant()
.with(Chron... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.EmptyCatchBlock\"",
")",
"public",
"static",
"ResourceInfo",
"resourceInfo",
"(",
"URL",
"resource",
")",
"{",
"try",
"{",
"Path",
"path",
"=",
"Paths",
".",
"get",
"(",
"resource",
".",
"toURI",
"(",
")",
")",
";",
"re... | Attempts to lookup the additional resource information for the
given URL.
If a {@link URL} references a file, it is easy to find out if
the resource referenced is a directory and to get its last
modification time. Getting the same information
for a {@link URL} that references resources in a jar is a bit
more difficult... | [
"Attempts",
"to",
"lookup",
"the",
"additional",
"resource",
"information",
"for",
"the",
"given",
"URL",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.http/src/org/jgrapes/http/ResponseCreationSupport.java#L265-L299 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getSecret | public SecretBundle getSecret(String vaultBaseUrl, String secretName, String secretVersion) {
return getSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).toBlocking().single().body();
} | java | public SecretBundle getSecret(String vaultBaseUrl, String secretName, String secretVersion) {
return getSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).toBlocking().single().body();
} | [
"public",
"SecretBundle",
"getSecret",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
",",
"String",
"secretVersion",
")",
"{",
"return",
"getSecretWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"secretName",
",",
"secretVersion",
")",
".",
"toBlock... | Get a specified secret from a given key vault.
The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param secretName The name of the secret.
@param secretVersion The... | [
"Get",
"a",
"specified",
"secret",
"from",
"a",
"given",
"key",
"vault",
".",
"The",
"GET",
"operation",
"is",
"applicable",
"to",
"any",
"secret",
"stored",
"in",
"Azure",
"Key",
"Vault",
".",
"This",
"operation",
"requires",
"the",
"secrets",
"/",
"get",... | 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#L3828-L3830 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/BrokerHelper.java | BrokerHelper.assertValidPkForDelete | public boolean assertValidPkForDelete(ClassDescriptor cld, Object obj)
{
if(!ProxyHelper.isProxy(obj))
{
FieldDescriptor fieldDescriptors[] = cld.getPkFields();
int fieldDescriptorSize = fieldDescriptors.length;
for(int i = 0; i < fieldDescriptorSize; i++)
... | java | public boolean assertValidPkForDelete(ClassDescriptor cld, Object obj)
{
if(!ProxyHelper.isProxy(obj))
{
FieldDescriptor fieldDescriptors[] = cld.getPkFields();
int fieldDescriptorSize = fieldDescriptors.length;
for(int i = 0; i < fieldDescriptorSize; i++)
... | [
"public",
"boolean",
"assertValidPkForDelete",
"(",
"ClassDescriptor",
"cld",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"!",
"ProxyHelper",
".",
"isProxy",
"(",
"obj",
")",
")",
"{",
"FieldDescriptor",
"fieldDescriptors",
"[",
"]",
"=",
"cld",
".",
"getPkFi... | returns true if the primary key fields are valid for delete, else false.
PK fields are valid if each of them contains a valid non-null value
@param cld the ClassDescriptor
@param obj the object
@return boolean | [
"returns",
"true",
"if",
"the",
"primary",
"key",
"fields",
"are",
"valid",
"for",
"delete",
"else",
"false",
".",
"PK",
"fields",
"are",
"valid",
"if",
"each",
"of",
"them",
"contains",
"a",
"valid",
"non",
"-",
"null",
"value"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L475-L492 |
tbrooks8/Precipice | precipice-core/src/main/java/net/uncontended/precipice/GuardRail.java | GuardRail.releasePermits | public void releasePermits(long number, Result result, long startNanos, long nanoTime) {
resultCounts.write(result, number, nanoTime);
resultLatency.write(result, number, nanoTime - startNanos, nanoTime);
for (BackPressure<Rejected> backPressure : backPressureList) {
backPressure.re... | java | public void releasePermits(long number, Result result, long startNanos, long nanoTime) {
resultCounts.write(result, number, nanoTime);
resultLatency.write(result, number, nanoTime - startNanos, nanoTime);
for (BackPressure<Rejected> backPressure : backPressureList) {
backPressure.re... | [
"public",
"void",
"releasePermits",
"(",
"long",
"number",
",",
"Result",
"result",
",",
"long",
"startNanos",
",",
"long",
"nanoTime",
")",
"{",
"resultCounts",
".",
"write",
"(",
"result",
",",
"number",
",",
"nanoTime",
")",
";",
"resultLatency",
".",
"... | Release acquired permits with known result. Since there is a known result the result
count object and latency will be updated.
@param number of permits to release
@param result of the execution
@param startNanos of the execution
@param nanoTime currentInterval nano time | [
"Release",
"acquired",
"permits",
"with",
"known",
"result",
".",
"Since",
"there",
"is",
"a",
"known",
"result",
"the",
"result",
"count",
"object",
"and",
"latency",
"will",
"be",
"updated",
"."
] | train | https://github.com/tbrooks8/Precipice/blob/97fae467fd676b16a96b8d88b02569d8fc1f2681/precipice-core/src/main/java/net/uncontended/precipice/GuardRail.java#L152-L159 |
inmite/android-validation-komensky | library/src/main/java/eu/inmite/android/lib/validations/form/FormValidator.java | FormValidator.registerViewAdapter | @SuppressWarnings("TryWithIdenticalCatches")
public static void registerViewAdapter(Class<? extends View> viewType, Class<? extends IFieldAdapter<? extends View,?>> adapterClass) {
if (viewType == null || adapterClass == null) {
throw new IllegalArgumentException("arguments must not be null");
}
try {
Fie... | java | @SuppressWarnings("TryWithIdenticalCatches")
public static void registerViewAdapter(Class<? extends View> viewType, Class<? extends IFieldAdapter<? extends View,?>> adapterClass) {
if (viewType == null || adapterClass == null) {
throw new IllegalArgumentException("arguments must not be null");
}
try {
Fie... | [
"@",
"SuppressWarnings",
"(",
"\"TryWithIdenticalCatches\"",
")",
"public",
"static",
"void",
"registerViewAdapter",
"(",
"Class",
"<",
"?",
"extends",
"View",
">",
"viewType",
",",
"Class",
"<",
"?",
"extends",
"IFieldAdapter",
"<",
"?",
"extends",
"View",
",",... | Register adapter that can be used to get value from view.
@param viewType type of view adapter is determined to get values from
@param adapterClass class of adapter to register
@throws IllegalArgumentException if adapterClass is null or viewType is null
@throws FormsValidationException when there is a problem when acc... | [
"Register",
"adapter",
"that",
"can",
"be",
"used",
"to",
"get",
"value",
"from",
"view",
".",
"@param",
"viewType",
"type",
"of",
"view",
"adapter",
"is",
"determined",
"to",
"get",
"values",
"from",
"@param",
"adapterClass",
"class",
"of",
"adapter",
"to",... | train | https://github.com/inmite/android-validation-komensky/blob/7c544f2d9f104a9800fcf4757eecb3caa8e76451/library/src/main/java/eu/inmite/android/lib/validations/form/FormValidator.java#L85-L98 |
ivanceras/orm | src/main/java/com/ivanceras/db/server/util/ModelCurator.java | ModelCurator.crossOutLinkerTables | private void crossOutLinkerTables(){
String[] primaryKeys = model.getPrimaryAttributes();
if(primaryKeys != null && primaryKeys.length == 2){//there are only 2 primary keys
//if both primary keys look up to different table which is also a primary key
String[] hasOne = model.getHasOne();
String[] hasOneLoca... | java | private void crossOutLinkerTables(){
String[] primaryKeys = model.getPrimaryAttributes();
if(primaryKeys != null && primaryKeys.length == 2){//there are only 2 primary keys
//if both primary keys look up to different table which is also a primary key
String[] hasOne = model.getHasOne();
String[] hasOneLoca... | [
"private",
"void",
"crossOutLinkerTables",
"(",
")",
"{",
"String",
"[",
"]",
"primaryKeys",
"=",
"model",
".",
"getPrimaryAttributes",
"(",
")",
";",
"if",
"(",
"primaryKeys",
"!=",
"null",
"&&",
"primaryKeys",
".",
"length",
"==",
"2",
")",
"{",
"//there... | Remove a linker table present in the hasMany, then short circuit right away to the linked table
Linker tables contains composite primary keys of two tables
If each local column of the primary key is the primary of the table it is referring to
the this is a lookup table
ie. product, product_category, category
Product ... | [
"Remove",
"a",
"linker",
"table",
"present",
"in",
"the",
"hasMany",
"then",
"short",
"circuit",
"right",
"away",
"to",
"the",
"linked",
"table"
] | train | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/util/ModelCurator.java#L282-L321 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Configuration.java | Configuration.overrideFromEnvironmentVariables | private void overrideFromEnvironmentVariables() {
String url = System.getenv("ACTIVEJDBC.URL");
String user = System.getenv("ACTIVEJDBC.USER");
String password = System.getenv("ACTIVEJDBC.PASSWORD");
String driver = System.getenv("ACTIVEJDBC.DRIVER");
if(!blank(url) && !blank... | java | private void overrideFromEnvironmentVariables() {
String url = System.getenv("ACTIVEJDBC.URL");
String user = System.getenv("ACTIVEJDBC.USER");
String password = System.getenv("ACTIVEJDBC.PASSWORD");
String driver = System.getenv("ACTIVEJDBC.DRIVER");
if(!blank(url) && !blank... | [
"private",
"void",
"overrideFromEnvironmentVariables",
"(",
")",
"{",
"String",
"url",
"=",
"System",
".",
"getenv",
"(",
"\"ACTIVEJDBC.URL\"",
")",
";",
"String",
"user",
"=",
"System",
".",
"getenv",
"(",
"\"ACTIVEJDBC.USER\"",
")",
";",
"String",
"password",
... | Overrides current environment's connection spec from system properties. | [
"Overrides",
"current",
"environment",
"s",
"connection",
"spec",
"from",
"system",
"properties",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Configuration.java#L137-L150 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/AppFramework.java | AppFramework.postProcessAfterInitialization | @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
registerObject(bean);
return bean;
} | java | @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
registerObject(bean);
return bean;
} | [
"@",
"Override",
"public",
"Object",
"postProcessAfterInitialization",
"(",
"Object",
"bean",
",",
"String",
"beanName",
")",
"throws",
"BeansException",
"{",
"registerObject",
"(",
"bean",
")",
";",
"return",
"bean",
";",
"}"
] | Automatically registers any container-managed bean with the framework.
@param bean Object to register.
@param beanName Name of the managed bean. | [
"Automatically",
"registers",
"any",
"container",
"-",
"managed",
"bean",
"with",
"the",
"framework",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/AppFramework.java#L197-L201 |
zxing/zxing | core/src/main/java/com/google/zxing/datamatrix/DataMatrixWriter.java | DataMatrixWriter.convertByteMatrixToBitMatrix | private static BitMatrix convertByteMatrixToBitMatrix(ByteMatrix matrix, int reqWidth, int reqHeight) {
int matrixWidth = matrix.getWidth();
int matrixHeight = matrix.getHeight();
int outputWidth = Math.max(reqWidth, matrixWidth);
int outputHeight = Math.max(reqHeight, matrixHeight);
int multiple =... | java | private static BitMatrix convertByteMatrixToBitMatrix(ByteMatrix matrix, int reqWidth, int reqHeight) {
int matrixWidth = matrix.getWidth();
int matrixHeight = matrix.getHeight();
int outputWidth = Math.max(reqWidth, matrixWidth);
int outputHeight = Math.max(reqHeight, matrixHeight);
int multiple =... | [
"private",
"static",
"BitMatrix",
"convertByteMatrixToBitMatrix",
"(",
"ByteMatrix",
"matrix",
",",
"int",
"reqWidth",
",",
"int",
"reqHeight",
")",
"{",
"int",
"matrixWidth",
"=",
"matrix",
".",
"getWidth",
"(",
")",
";",
"int",
"matrixHeight",
"=",
"matrix",
... | Convert the ByteMatrix to BitMatrix.
@param reqHeight The requested height of the image (in pixels) with the Datamatrix code
@param reqWidth The requested width of the image (in pixels) with the Datamatrix code
@param matrix The input matrix.
@return The output matrix. | [
"Convert",
"the",
"ByteMatrix",
"to",
"BitMatrix",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/datamatrix/DataMatrixWriter.java#L163-L196 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/BritishCutoverChronology.java | BritishCutoverChronology.dateYearDay | @Override
public BritishCutoverDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);
} | java | @Override
public BritishCutoverDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);
} | [
"@",
"Override",
"public",
"BritishCutoverDate",
"dateYearDay",
"(",
"Era",
"era",
",",
"int",
"yearOfEra",
",",
"int",
"dayOfYear",
")",
"{",
"return",
"dateYearDay",
"(",
"prolepticYear",
"(",
"era",
",",
"yearOfEra",
")",
",",
"dayOfYear",
")",
";",
"}"
] | Obtains a local date in British Cutover calendar system from the
era, year-of-era and day-of-year fields.
<p>
The day-of-year takes into account the cutover, thus there are only 355 days in 1752.
@param era the British Cutover era, not null
@param yearOfEra the year-of-era
@param dayOfYear the day-of-year
@return t... | [
"Obtains",
"a",
"local",
"date",
"in",
"British",
"Cutover",
"calendar",
"system",
"from",
"the",
"era",
"year",
"-",
"of",
"-",
"era",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
".",
"<p",
">",
"The",
"day",
"-",
"of",
"-",
"year",
"takes",
"... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/BritishCutoverChronology.java#L265-L268 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/UserResources.java | UserResources.updateUserPrivilege | @PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Path("/{userId}/privileged")
@Description("Grants or revokes privileged permissions")
public PrincipalUserDto updateUserPrivilege(@Context HttpServletRequest req,
@PathParam("userId") final BigIntege... | java | @PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Path("/{userId}/privileged")
@Description("Grants or revokes privileged permissions")
public PrincipalUserDto updateUserPrivilege(@Context HttpServletRequest req,
@PathParam("userId") final BigIntege... | [
"@",
"PUT",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_FORM_URLENCODED",
")",
"@",
"Path",
"(",
"\"/{userId}/privileged\"",
")",
"@",
"Description",
"(",
"\"Grants or revokes privileged permiss... | Grants or revokes privileged permissions.
@param req The HTTP request.
@param userId The ID of the user to update.
@param privileged True if the user has privileged access.
@return The updated user DTO.
@throws WebApplicationException If an error occurs.
@throws SystemException If th... | [
"Grants",
"or",
"revokes",
"privileged",
"permissions",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/UserResources.java#L247-L275 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/AttrOperator.java | AttrOperator.doExec | @Override
protected Object doExec(Element element, Object scope, String expression, Object... arguments) throws TemplateException
{
if(expression.isEmpty()) {
throw new TemplateException("Invalid ATTR operand. Attribute property path expression is empty.");
}
Set<Attr> syntheticAttributes = ... | java | @Override
protected Object doExec(Element element, Object scope, String expression, Object... arguments) throws TemplateException
{
if(expression.isEmpty()) {
throw new TemplateException("Invalid ATTR operand. Attribute property path expression is empty.");
}
Set<Attr> syntheticAttributes = ... | [
"@",
"Override",
"protected",
"Object",
"doExec",
"(",
"Element",
"element",
",",
"Object",
"scope",
",",
"String",
"expression",
",",
"Object",
"...",
"arguments",
")",
"throws",
"TemplateException",
"{",
"if",
"(",
"expression",
".",
"isEmpty",
"(",
")",
"... | Execute ATTR operator. Expression argument is set of attribute name / property path pairs. Property path is used to
retrieve content value that is converted to string and used as attribute value.
@param element context element, unused,
@param scope scope object,
@param expression set of attribute name / property path ... | [
"Execute",
"ATTR",
"operator",
".",
"Expression",
"argument",
"is",
"set",
"of",
"attribute",
"name",
"/",
"property",
"path",
"pairs",
".",
"Property",
"path",
"is",
"used",
"to",
"retrieve",
"content",
"value",
"that",
"is",
"converted",
"to",
"string",
"a... | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/AttrOperator.java#L58-L76 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.isDebuggingEnabled | public static boolean isDebuggingEnabled() {
boolean debuggingEnabled = false;
if (ManagementFactory.getRuntimeMXBean().getInputArguments().toString().indexOf("-agentlib:jdwp") > 0) {
debuggingEnabled = true;
} else if (ManagementFactory.getRuntimeMXBean().getInputArguments().contain... | java | public static boolean isDebuggingEnabled() {
boolean debuggingEnabled = false;
if (ManagementFactory.getRuntimeMXBean().getInputArguments().toString().indexOf("-agentlib:jdwp") > 0) {
debuggingEnabled = true;
} else if (ManagementFactory.getRuntimeMXBean().getInputArguments().contain... | [
"public",
"static",
"boolean",
"isDebuggingEnabled",
"(",
")",
"{",
"boolean",
"debuggingEnabled",
"=",
"false",
";",
"if",
"(",
"ManagementFactory",
".",
"getRuntimeMXBean",
"(",
")",
".",
"getInputArguments",
"(",
")",
".",
"toString",
"(",
")",
".",
"indexO... | Examines some system properties to determine whether the process is likely being debugged
in an IDE or remotely.
@return true if being debugged, false otherwise | [
"Examines",
"some",
"system",
"properties",
"to",
"determine",
"whether",
"the",
"process",
"is",
"likely",
"being",
"debugged",
"in",
"an",
"IDE",
"or",
"remotely",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L254-L264 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java | DTMDocumentImpl.appendNode | private final int appendNode(int w0, int w1, int w2, int w3)
{
// A decent compiler may inline this.
int slotnumber = nodes.appendSlot(w0, w1, w2, w3);
if (DEBUG) System.out.println(slotnumber+": "+w0+" "+w1+" "+w2+" "+w3);
if (previousSiblingWas... | java | private final int appendNode(int w0, int w1, int w2, int w3)
{
// A decent compiler may inline this.
int slotnumber = nodes.appendSlot(w0, w1, w2, w3);
if (DEBUG) System.out.println(slotnumber+": "+w0+" "+w1+" "+w2+" "+w3);
if (previousSiblingWas... | [
"private",
"final",
"int",
"appendNode",
"(",
"int",
"w0",
",",
"int",
"w1",
",",
"int",
"w2",
",",
"int",
"w3",
")",
"{",
"// A decent compiler may inline this.",
"int",
"slotnumber",
"=",
"nodes",
".",
"appendSlot",
"(",
"w0",
",",
"w1",
",",
"w2",
","... | Wrapper for ChunkedIntArray.append, to automatically update the
previous sibling's "next" reference (if necessary) and periodically
wake a reader who may have encountered incomplete data and entered
a wait state.
@param w0 int As in ChunkedIntArray.append
@param w1 int As in ChunkedIntArray.append
@param w2 int As in C... | [
"Wrapper",
"for",
"ChunkedIntArray",
".",
"append",
"to",
"automatically",
"update",
"the",
"previous",
"sibling",
"s",
"next",
"reference",
"(",
"if",
"necessary",
")",
"and",
"periodically",
"wake",
"a",
"reader",
"who",
"may",
"have",
"encountered",
"incomple... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java#L206-L219 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SheetUpdateRequestResourcesImpl.java | SheetUpdateRequestResourcesImpl.updateUpdateRequest | public UpdateRequest updateUpdateRequest(long sheetId, UpdateRequest updateRequest) throws SmartsheetException {
return this.updateResource("sheets/" + sheetId + "/updaterequests/" + updateRequest.getId(),
UpdateRequest.class, updateRequest);
} | java | public UpdateRequest updateUpdateRequest(long sheetId, UpdateRequest updateRequest) throws SmartsheetException {
return this.updateResource("sheets/" + sheetId + "/updaterequests/" + updateRequest.getId(),
UpdateRequest.class, updateRequest);
} | [
"public",
"UpdateRequest",
"updateUpdateRequest",
"(",
"long",
"sheetId",
",",
"UpdateRequest",
"updateRequest",
")",
"throws",
"SmartsheetException",
"{",
"return",
"this",
".",
"updateResource",
"(",
"\"sheets/\"",
"+",
"sheetId",
"+",
"\"/updaterequests/\"",
"+",
"... | Changes the specified Update Request for the Sheet.
It mirrors to the following Smartsheet REST API method: PUT /sheets/{sheetId}/updaterequests/{updateRequestId}
@param sheetId the Id of the sheet
@param updateRequest the update request object
@return the update request resource.
@throws IllegalArgumentException if ... | [
"Changes",
"the",
"specified",
"Update",
"Request",
"for",
"the",
"Sheet",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SheetUpdateRequestResourcesImpl.java#L149-L152 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.getResource | private static URL getResource(String name, ClassLoader[] classLoaders)
{
// Java standard class loader require resource name to be an absolute path without leading path separator
// at this point <name> argument is guaranteed to not start with leading path separator
for(ClassLoader classLoader : cl... | java | private static URL getResource(String name, ClassLoader[] classLoaders)
{
// Java standard class loader require resource name to be an absolute path without leading path separator
// at this point <name> argument is guaranteed to not start with leading path separator
for(ClassLoader classLoader : cl... | [
"private",
"static",
"URL",
"getResource",
"(",
"String",
"name",
",",
"ClassLoader",
"[",
"]",
"classLoaders",
")",
"{",
"// Java standard class loader require resource name to be an absolute path without leading path separator\r",
"// at this point <name> argument is guaranteed to no... | Get named resource URL from a list of class loaders. Traverses class loaders in given order searching for requested
resource. Return first resource found or null if none found.
@param name resource name with syntax as requested by Java ClassLoader,
@param classLoaders target class loaders.
@return found resource URL o... | [
"Get",
"named",
"resource",
"URL",
"from",
"a",
"list",
"of",
"class",
"loaders",
".",
"Traverses",
"class",
"loaders",
"in",
"given",
"order",
"searching",
"for",
"requested",
"resource",
".",
"Return",
"first",
"resource",
"found",
"or",
"null",
"if",
"non... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L997-L1014 |
togglz/togglz | core/src/main/java/org/togglz/core/util/MoreObjects.java | MoreObjects.firstNonNull | public static <T> T firstNonNull(T first, T second) {
return first != null ? first : checkNotNull(second);
} | java | public static <T> T firstNonNull(T first, T second) {
return first != null ? first : checkNotNull(second);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"firstNonNull",
"(",
"T",
"first",
",",
"T",
"second",
")",
"{",
"return",
"first",
"!=",
"null",
"?",
"first",
":",
"checkNotNull",
"(",
"second",
")",
";",
"}"
] | Returns the first of two given parameters that is not {@code null}, if
either is, or otherwise throws a {@link NullPointerException}.
@return {@code first} if {@code first} is not {@code null}, or
{@code second} if {@code first} is {@code null} and {@code second} is
not {@code null}
@throws NullPointerException if bot... | [
"Returns",
"the",
"first",
"of",
"two",
"given",
"parameters",
"that",
"is",
"not",
"{",
"@code",
"null",
"}",
"if",
"either",
"is",
"or",
"otherwise",
"throws",
"a",
"{",
"@link",
"NullPointerException",
"}",
"."
] | train | https://github.com/togglz/togglz/blob/76d3ffbc8e3fac5a6cb566cc4afbd8dd5f06c4e5/core/src/main/java/org/togglz/core/util/MoreObjects.java#L114-L116 |
sundrio/sundrio | codegen/src/main/java/io/sundr/codegen/utils/TypeUtils.java | TypeUtils.typeImplements | public static TypeDef typeImplements(TypeDef base, ClassRef... superClass) {
return new TypeDefBuilder(base)
.withImplementsList(superClass)
.build();
} | java | public static TypeDef typeImplements(TypeDef base, ClassRef... superClass) {
return new TypeDefBuilder(base)
.withImplementsList(superClass)
.build();
} | [
"public",
"static",
"TypeDef",
"typeImplements",
"(",
"TypeDef",
"base",
",",
"ClassRef",
"...",
"superClass",
")",
"{",
"return",
"new",
"TypeDefBuilder",
"(",
"base",
")",
".",
"withImplementsList",
"(",
"superClass",
")",
".",
"build",
"(",
")",
";",
"}"
... | Sets one {@link io.sundr.codegen.model.TypeDef} as an interface of an other.
@param base The base type.
@param superClass The super type.
@return The updated type definition. | [
"Sets",
"one",
"{",
"@link",
"io",
".",
"sundr",
".",
"codegen",
".",
"model",
".",
"TypeDef",
"}",
"as",
"an",
"interface",
"of",
"an",
"other",
"."
] | train | https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/codegen/src/main/java/io/sundr/codegen/utils/TypeUtils.java#L173-L177 |
alkacon/opencms-core | src/org/opencms/jsp/search/controller/CmsSearchControllerFacetRange.java | CmsSearchControllerFacetRange.addFacetOptions | protected void addFacetOptions(StringBuffer query) {
// start
appendFacetOption(query, "range.start", m_config.getStart());
// end
appendFacetOption(query, "range.end", m_config.getEnd());
// gap
appendFacetOption(query, "range.gap", m_config.getGap());
// other
... | java | protected void addFacetOptions(StringBuffer query) {
// start
appendFacetOption(query, "range.start", m_config.getStart());
// end
appendFacetOption(query, "range.end", m_config.getEnd());
// gap
appendFacetOption(query, "range.gap", m_config.getGap());
// other
... | [
"protected",
"void",
"addFacetOptions",
"(",
"StringBuffer",
"query",
")",
"{",
"// start",
"appendFacetOption",
"(",
"query",
",",
"\"range.start\"",
",",
"m_config",
".",
"getStart",
"(",
")",
")",
";",
"// end",
"appendFacetOption",
"(",
"query",
",",
"\"rang... | Adds the query parts for the facet options, except the filter parts.
@param query The query part that is extended with the facet options. | [
"Adds",
"the",
"query",
"parts",
"for",
"the",
"facet",
"options",
"except",
"the",
"filter",
"parts",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/search/controller/CmsSearchControllerFacetRange.java#L139-L157 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/Languages.java | Languages.getLanguageForLocale | public static Language getLanguageForLocale(Locale locale) {
Language language = getLanguageForLanguageNameAndCountry(locale);
if (language != null) {
return language;
} else {
Language firstFallbackLanguage = getLanguageForLanguageNameOnly(locale);
if (firstFallbackLanguage != null) {
... | java | public static Language getLanguageForLocale(Locale locale) {
Language language = getLanguageForLanguageNameAndCountry(locale);
if (language != null) {
return language;
} else {
Language firstFallbackLanguage = getLanguageForLanguageNameOnly(locale);
if (firstFallbackLanguage != null) {
... | [
"public",
"static",
"Language",
"getLanguageForLocale",
"(",
"Locale",
"locale",
")",
"{",
"Language",
"language",
"=",
"getLanguageForLanguageNameAndCountry",
"(",
"locale",
")",
";",
"if",
"(",
"language",
"!=",
"null",
")",
"{",
"return",
"language",
";",
"}"... | Get the best match for a locale, using American English as the final fallback if nothing
else fits. The returned language will be a country variant language (e.g. British English, not just English)
if available.
Note: this does not consider languages added dynamically
@throws RuntimeException if no language was found a... | [
"Get",
"the",
"best",
"match",
"for",
"a",
"locale",
"using",
"American",
"English",
"as",
"the",
"final",
"fallback",
"if",
"nothing",
"else",
"fits",
".",
"The",
"returned",
"language",
"will",
"be",
"a",
"country",
"variant",
"language",
"(",
"e",
".",
... | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/Languages.java#L262-L278 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/math/Combination.java | Combination.count | public static long count(int n, int m) {
if(0 == m) {
return 1;
}
if(n == m) {
return NumberUtil.factorial(n) / NumberUtil.factorial(m);
}
return (n > m) ? NumberUtil.factorial(n, n - m) / NumberUtil.factorial(m) : 0;
} | java | public static long count(int n, int m) {
if(0 == m) {
return 1;
}
if(n == m) {
return NumberUtil.factorial(n) / NumberUtil.factorial(m);
}
return (n > m) ? NumberUtil.factorial(n, n - m) / NumberUtil.factorial(m) : 0;
} | [
"public",
"static",
"long",
"count",
"(",
"int",
"n",
",",
"int",
"m",
")",
"{",
"if",
"(",
"0",
"==",
"m",
")",
"{",
"return",
"1",
";",
"}",
"if",
"(",
"n",
"==",
"m",
")",
"{",
"return",
"NumberUtil",
".",
"factorial",
"(",
"n",
")",
"/",
... | 计算组合数,即C(n, m) = n!/((n-m)! * m!)
@param n 总数
@param m 选择的个数
@return 组合数 | [
"计算组合数,即C",
"(",
"n",
"m",
")",
"=",
"n!",
"/",
"((",
"n",
"-",
"m",
")",
"!",
"*",
"m!",
")"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/math/Combination.java#L37-L45 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.vpnDeviceConfigurationScript | public String vpnDeviceConfigurationScript(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) {
return vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body();
... | java | public String vpnDeviceConfigurationScript(String resourceGroupName, String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) {
return vpnDeviceConfigurationScriptWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().body();
... | [
"public",
"String",
"vpnDeviceConfigurationScript",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayConnectionName",
",",
"VpnDeviceScriptParameters",
"parameters",
")",
"{",
"return",
"vpnDeviceConfigurationScriptWithServiceResponseAsync",
"(",
"resourceGr... | Gets a xml format representation for vpn device configuration script.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection for which the configuration script is generated.
@param parameters Parameters supplied to the gene... | [
"Gets",
"a",
"xml",
"format",
"representation",
"for",
"vpn",
"device",
"configuration",
"script",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L2978-L2980 |
neoremind/fluent-validator | fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/QuickValidator.java | QuickValidator.doAndGetComplexResult2 | public static ComplexResult2 doAndGetComplexResult2(Decorator decorator) {
return validate(decorator, FluentValidator.checkAll(), null, ResultCollectors.toComplex2());
} | java | public static ComplexResult2 doAndGetComplexResult2(Decorator decorator) {
return validate(decorator, FluentValidator.checkAll(), null, ResultCollectors.toComplex2());
} | [
"public",
"static",
"ComplexResult2",
"doAndGetComplexResult2",
"(",
"Decorator",
"decorator",
")",
"{",
"return",
"validate",
"(",
"decorator",
",",
"FluentValidator",
".",
"checkAll",
"(",
")",
",",
"null",
",",
"ResultCollectors",
".",
"toComplex2",
"(",
")",
... | Execute validation by using a new FluentValidator instance and without a shared context.
The result type is {@link ComplexResult2}
@param decorator Same as decorator design pattern, provided to add more functions to the fluentValidator
@return ComplexResult2 | [
"Execute",
"validation",
"by",
"using",
"a",
"new",
"FluentValidator",
"instance",
"and",
"without",
"a",
"shared",
"context",
".",
"The",
"result",
"type",
"is",
"{",
"@link",
"ComplexResult2",
"}"
] | train | https://github.com/neoremind/fluent-validator/blob/b516970591aa9468b44ba63938b98ec341fd6ead/fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/QuickValidator.java#L62-L64 |
infinispan/infinispan | hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/InvalidationCacheAccessDelegate.java | InvalidationCacheAccessDelegate.putFromLoad | @Override
@SuppressWarnings("UnusedParameters")
public boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride)
throws CacheException {
if ( !region.checkValid() ) {
if (trace) {
log.tracef( "Region %s not valid", region.getName() );
}
... | java | @Override
@SuppressWarnings("UnusedParameters")
public boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride)
throws CacheException {
if ( !region.checkValid() ) {
if (trace) {
log.tracef( "Region %s not valid", region.getName() );
}
... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"UnusedParameters\"",
")",
"public",
"boolean",
"putFromLoad",
"(",
"Object",
"session",
",",
"Object",
"key",
",",
"Object",
"value",
",",
"long",
"txTimestamp",
",",
"Object",
"version",
",",
"boolean",
"minimal... | Attempt to cache an object, after loading from the database, explicitly
specifying the minimalPut behavior.
@param session Current session
@param key The item key
@param value The item
@param txTimestamp a timestamp prior to the transaction start time
@param version the item version number
@param minimalPutOverride Ex... | [
"Attempt",
"to",
"cache",
"an",
"object",
"after",
"loading",
"from",
"the",
"database",
"explicitly",
"specifying",
"the",
"minimalPut",
"behavior",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/InvalidationCacheAccessDelegate.java#L85-L121 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/HttpCarbonMessage.java | HttpCarbonMessage.pushResponse | public HttpResponseFuture pushResponse(HttpCarbonMessage httpCarbonMessage, Http2PushPromise pushPromise)
throws ServerConnectorException {
httpOutboundRespFuture.notifyHttpListener(httpCarbonMessage, pushPromise);
return httpOutboundRespStatusFuture;
} | java | public HttpResponseFuture pushResponse(HttpCarbonMessage httpCarbonMessage, Http2PushPromise pushPromise)
throws ServerConnectorException {
httpOutboundRespFuture.notifyHttpListener(httpCarbonMessage, pushPromise);
return httpOutboundRespStatusFuture;
} | [
"public",
"HttpResponseFuture",
"pushResponse",
"(",
"HttpCarbonMessage",
"httpCarbonMessage",
",",
"Http2PushPromise",
"pushPromise",
")",
"throws",
"ServerConnectorException",
"{",
"httpOutboundRespFuture",
".",
"notifyHttpListener",
"(",
"httpCarbonMessage",
",",
"pushPromis... | Sends a push response message back to the client.
@param httpCarbonMessage the push response message
@param pushPromise the push promise associated with the push response message
@return HttpResponseFuture which gives the status of the operation
@throws ServerConnectorException if there is an error occurs while ... | [
"Sends",
"a",
"push",
"response",
"message",
"back",
"to",
"the",
"client",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/HttpCarbonMessage.java#L311-L315 |
3pillarlabs/spring-data-simpledb | spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/repository/support/entityinformation/SimpleDbEntityInformationSupport.java | SimpleDbEntityInformationSupport.getMetadata | @SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> SimpleDbEntityInformation<T, ?> getMetadata(Class<T> domainClass, String simpleDbDomain) {
Assert.notNull(domainClass);
Assert.notNull(simpleDbDomain);
return new SimpleDbMetamodelEntityInformation(domainClass, simpleDbDomain);
} | java | @SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> SimpleDbEntityInformation<T, ?> getMetadata(Class<T> domainClass, String simpleDbDomain) {
Assert.notNull(domainClass);
Assert.notNull(simpleDbDomain);
return new SimpleDbMetamodelEntityInformation(domainClass, simpleDbDomain);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"T",
">",
"SimpleDbEntityInformation",
"<",
"T",
",",
"?",
">",
"getMetadata",
"(",
"Class",
"<",
"T",
">",
"domainClass",
",",
"String",
"simpleDbDom... | Creates a {@link SimpleDbEntityInformation} for the given domain class.
@param domainClass
must not be {@literal null}.
@return | [
"Creates",
"a",
"{",
"@link",
"SimpleDbEntityInformation",
"}",
"for",
"the",
"given",
"domain",
"class",
"."
] | train | https://github.com/3pillarlabs/spring-data-simpledb/blob/f1e0eb4e48ec4674d3966e8f5bc04c95031f93ae/spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/repository/support/entityinformation/SimpleDbEntityInformationSupport.java#L48-L54 |
datastax/java-driver | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java | SchemaBuilder.createMaterializedView | @NonNull
public static CreateMaterializedViewStart createMaterializedView(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier viewName) {
return new DefaultCreateMaterializedView(keyspace, viewName);
} | java | @NonNull
public static CreateMaterializedViewStart createMaterializedView(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier viewName) {
return new DefaultCreateMaterializedView(keyspace, viewName);
} | [
"@",
"NonNull",
"public",
"static",
"CreateMaterializedViewStart",
"createMaterializedView",
"(",
"@",
"Nullable",
"CqlIdentifier",
"keyspace",
",",
"@",
"NonNull",
"CqlIdentifier",
"viewName",
")",
"{",
"return",
"new",
"DefaultCreateMaterializedView",
"(",
"keyspace",
... | Starts a CREATE MATERIALIZED VIEW query with the given view name for the given keyspace name. | [
"Starts",
"a",
"CREATE",
"MATERIALIZED",
"VIEW",
"query",
"with",
"the",
"given",
"view",
"name",
"for",
"the",
"given",
"keyspace",
"name",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L221-L225 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMath.java | NumberMath.rightShiftUnsigned | public static Number rightShiftUnsigned(Number left, Number right) {
if (isFloatingPoint(right) || isBigDecimal(right)) {
throw new UnsupportedOperationException("Shift distance must be an integral type, but " + right + " (" + right.getClass().getName() + ") was supplied");
}
return ... | java | public static Number rightShiftUnsigned(Number left, Number right) {
if (isFloatingPoint(right) || isBigDecimal(right)) {
throw new UnsupportedOperationException("Shift distance must be an integral type, but " + right + " (" + right.getClass().getName() + ") was supplied");
}
return ... | [
"public",
"static",
"Number",
"rightShiftUnsigned",
"(",
"Number",
"left",
",",
"Number",
"right",
")",
"{",
"if",
"(",
"isFloatingPoint",
"(",
"right",
")",
"||",
"isBigDecimal",
"(",
"right",
")",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(... | For this operation, consider the operands independently. Throw an exception if the right operand
(shift distance) is not an integral type. For the left operand (shift value) also require an integral
type, but do NOT promote from Integer to Long. This is consistent with Java, and makes sense for the
shift operators. | [
"For",
"this",
"operation",
"consider",
"the",
"operands",
"independently",
".",
"Throw",
"an",
"exception",
"if",
"the",
"right",
"operand",
"(",
"shift",
"distance",
")",
"is",
"not",
"an",
"integral",
"type",
".",
"For",
"the",
"left",
"operand",
"(",
"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/typehandling/NumberMath.java#L123-L128 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Table.java | Table.insertRow | void insertRow(Session session, PersistentStore store, Object[] data) {
setIdentityColumn(session, data);
if (triggerLists[Trigger.INSERT_BEFORE].length != 0) {
fireBeforeTriggers(session, Trigger.INSERT_BEFORE, null, data,
null);
}
if (isVie... | java | void insertRow(Session session, PersistentStore store, Object[] data) {
setIdentityColumn(session, data);
if (triggerLists[Trigger.INSERT_BEFORE].length != 0) {
fireBeforeTriggers(session, Trigger.INSERT_BEFORE, null, data,
null);
}
if (isVie... | [
"void",
"insertRow",
"(",
"Session",
"session",
",",
"PersistentStore",
"store",
",",
"Object",
"[",
"]",
"data",
")",
"{",
"setIdentityColumn",
"(",
"session",
",",
"data",
")",
";",
"if",
"(",
"triggerLists",
"[",
"Trigger",
".",
"INSERT_BEFORE",
"]",
".... | Mid level method for inserting rows. Performs constraint checks and
fires row level triggers. | [
"Mid",
"level",
"method",
"for",
"inserting",
"rows",
".",
"Performs",
"constraint",
"checks",
"and",
"fires",
"row",
"level",
"triggers",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Table.java#L2241-L2256 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java | TransformerImpl.executeChildTemplates | public void executeChildTemplates(
ElemTemplateElement elem, ContentHandler handler)
throws TransformerException
{
SerializationHandler xoh = this.getSerializationHandler();
// These may well not be the same! In this case when calling
// the Redirect extension, i... | java | public void executeChildTemplates(
ElemTemplateElement elem, ContentHandler handler)
throws TransformerException
{
SerializationHandler xoh = this.getSerializationHandler();
// These may well not be the same! In this case when calling
// the Redirect extension, i... | [
"public",
"void",
"executeChildTemplates",
"(",
"ElemTemplateElement",
"elem",
",",
"ContentHandler",
"handler",
")",
"throws",
"TransformerException",
"{",
"SerializationHandler",
"xoh",
"=",
"this",
".",
"getSerializationHandler",
"(",
")",
";",
"// These may well not b... | Execute each of the children of a template element.
@param elem The ElemTemplateElement that contains the children
that should execute.
@param handler The ContentHandler to where the result events
should be fed.
@throws TransformerException
@xsl.usage advanced | [
"Execute",
"each",
"of",
"the",
"children",
"of",
"a",
"template",
"element",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L2255-L2291 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.relativeQuadTo | public SVGPath relativeQuadTo(double[] c1xy, double[] xy) {
return append(PATH_QUAD_TO_RELATIVE).append(c1xy[0]).append(c1xy[1]).append(xy[0]).append(xy[1]);
} | java | public SVGPath relativeQuadTo(double[] c1xy, double[] xy) {
return append(PATH_QUAD_TO_RELATIVE).append(c1xy[0]).append(c1xy[1]).append(xy[0]).append(xy[1]);
} | [
"public",
"SVGPath",
"relativeQuadTo",
"(",
"double",
"[",
"]",
"c1xy",
",",
"double",
"[",
"]",
"xy",
")",
"{",
"return",
"append",
"(",
"PATH_QUAD_TO_RELATIVE",
")",
".",
"append",
"(",
"c1xy",
"[",
"0",
"]",
")",
".",
"append",
"(",
"c1xy",
"[",
"... | Quadratic Bezier line to the given relative coordinates.
@param c1xy first control point
@param xy new coordinates
@return path object, for compact syntax. | [
"Quadratic",
"Bezier",
"line",
"to",
"the",
"given",
"relative",
"coordinates",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L492-L494 |
JoeKerouac/utils | src/main/java/com/joe/utils/reflect/ClassUtils.java | ClassUtils.getInstance | public static <T> T getInstance(String className, ClassLoader loader) {
return getInstance(loadClass(className, loader));
} | java | public static <T> T getInstance(String className, ClassLoader loader) {
return getInstance(loadClass(className, loader));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getInstance",
"(",
"String",
"className",
",",
"ClassLoader",
"loader",
")",
"{",
"return",
"getInstance",
"(",
"loadClass",
"(",
"className",
",",
"loader",
")",
")",
";",
"}"
] | 获取class实例
@param className class名字
@param loader 加载class的classloader
@param <T> class类型
@return class的实例 | [
"获取class实例"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/reflect/ClassUtils.java#L125-L127 |
httl/httl | httl/src/main/java/httl/Engine.java | Engine.getTemplate | public Template getTemplate(String name, Object args) throws IOException, ParseException {
if (args instanceof String)
return getTemplate(name, (String) args);
if (args instanceof Locale)
return getTemplate(name, (Locale) args);
return getTemplate(name, null, null, args);... | java | public Template getTemplate(String name, Object args) throws IOException, ParseException {
if (args instanceof String)
return getTemplate(name, (String) args);
if (args instanceof Locale)
return getTemplate(name, (Locale) args);
return getTemplate(name, null, null, args);... | [
"public",
"Template",
"getTemplate",
"(",
"String",
"name",
",",
"Object",
"args",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"if",
"(",
"args",
"instanceof",
"String",
")",
"return",
"getTemplate",
"(",
"name",
",",
"(",
"String",
")",
"args"... | Get template.
@param name - template name
@return template instance
@throws IOException - If an I/O error occurs
@throws ParseException - If the template cannot be parsed
@see #getEngine() | [
"Get",
"template",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/Engine.java#L369-L375 |
m-m-m/util | pojopath/src/main/java/net/sf/mmm/util/pojo/path/base/AbstractPojoPathNavigator.java | AbstractPojoPathNavigator.createState | protected PojoPathState createState(Object initialPojo, String pojoPath, PojoPathMode mode, PojoPathContext context) {
if (mode == null) {
throw new NlsNullPointerException("mode");
}
Map<Object, Object> rawCache = context.getCache();
if (rawCache == null) {
CachingPojoPath rootPath = new C... | java | protected PojoPathState createState(Object initialPojo, String pojoPath, PojoPathMode mode, PojoPathContext context) {
if (mode == null) {
throw new NlsNullPointerException("mode");
}
Map<Object, Object> rawCache = context.getCache();
if (rawCache == null) {
CachingPojoPath rootPath = new C... | [
"protected",
"PojoPathState",
"createState",
"(",
"Object",
"initialPojo",
",",
"String",
"pojoPath",
",",
"PojoPathMode",
"mode",
",",
"PojoPathContext",
"context",
")",
"{",
"if",
"(",
"mode",
"==",
"null",
")",
"{",
"throw",
"new",
"NlsNullPointerException",
... | This method gets the {@link PojoPathState} for the given {@code context}.
@param initialPojo is the initial {@link net.sf.mmm.util.pojo.api.Pojo} this {@link PojoPathNavigator} was invoked
with.
@param pojoPath is the {@link net.sf.mmm.util.pojo.path.api.PojoPath} to navigate.
@param mode is the {@link PojoPathMode mo... | [
"This",
"method",
"gets",
"the",
"{",
"@link",
"PojoPathState",
"}",
"for",
"the",
"given",
"{",
"@code",
"context",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/pojopath/src/main/java/net/sf/mmm/util/pojo/path/base/AbstractPojoPathNavigator.java#L219-L236 |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateProperties.java | HibernateProperties.determineHibernateProperties | public Map<String, Object> determineHibernateProperties(
Map<String, String> jpaProperties, HibernateSettings settings) {
Assert.notNull(jpaProperties, "JpaProperties must not be null");
Assert.notNull(settings, "Settings must not be null");
return getAdditionalProperties(jpaProperties, settings);
} | java | public Map<String, Object> determineHibernateProperties(
Map<String, String> jpaProperties, HibernateSettings settings) {
Assert.notNull(jpaProperties, "JpaProperties must not be null");
Assert.notNull(settings, "Settings must not be null");
return getAdditionalProperties(jpaProperties, settings);
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"determineHibernateProperties",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"jpaProperties",
",",
"HibernateSettings",
"settings",
")",
"{",
"Assert",
".",
"notNull",
"(",
"jpaProperties",
",",
"\"JpaPropert... | Determine the configuration properties for the initialization of the main Hibernate
EntityManagerFactory based on standard JPA properties and
{@link HibernateSettings}.
@param jpaProperties standard JPA properties
@param settings the settings to apply when determining the configuration properties
@return the Hibernate ... | [
"Determine",
"the",
"configuration",
"properties",
"for",
"the",
"initialization",
"of",
"the",
"main",
"Hibernate",
"EntityManagerFactory",
"based",
"on",
"standard",
"JPA",
"properties",
"and",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateProperties.java#L90-L95 |
code4everything/util | src/main/java/com/zhazhapan/util/FileExecutor.java | FileExecutor.readFile | public static String readFile(File file, long start, int length) throws IOException {
byte[] bs = new byte[length];
try (FileInputStream fis = new FileInputStream(file)) {
fis.skip(start);
fis.read(bs);
}
return new String(bs);
} | java | public static String readFile(File file, long start, int length) throws IOException {
byte[] bs = new byte[length];
try (FileInputStream fis = new FileInputStream(file)) {
fis.skip(start);
fis.read(bs);
}
return new String(bs);
} | [
"public",
"static",
"String",
"readFile",
"(",
"File",
"file",
",",
"long",
"start",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bs",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"try",
"(",
"FileInputStream",
"fis",
"="... | 从指定位置读取指定长度
@param file 文件
@param start 开始位置
@param length 读取长度
@return 文件内容
@throws IOException 异常 | [
"从指定位置读取指定长度"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/FileExecutor.java#L946-L953 |
GwtMaterialDesign/gwt-material-addins | src/main/java/gwt/material/design/addins/client/autocomplete/MaterialAutoComplete.java | MaterialAutoComplete.setup | protected void setup(SuggestOracle suggestions) {
if (itemBoxKeyDownHandler != null) {
itemBoxKeyDownHandler.removeHandler();
}
list.setStyleName(AddinsCssName.MULTIVALUESUGGESTBOX_LIST);
this.suggestions = suggestions;
final ListItem item = new ListItem();
... | java | protected void setup(SuggestOracle suggestions) {
if (itemBoxKeyDownHandler != null) {
itemBoxKeyDownHandler.removeHandler();
}
list.setStyleName(AddinsCssName.MULTIVALUESUGGESTBOX_LIST);
this.suggestions = suggestions;
final ListItem item = new ListItem();
... | [
"protected",
"void",
"setup",
"(",
"SuggestOracle",
"suggestions",
")",
"{",
"if",
"(",
"itemBoxKeyDownHandler",
"!=",
"null",
")",
"{",
"itemBoxKeyDownHandler",
".",
"removeHandler",
"(",
")",
";",
"}",
"list",
".",
"setStyleName",
"(",
"AddinsCssName",
".",
... | Generate and build the List Items to be set on Auto Complete box. | [
"Generate",
"and",
"build",
"the",
"List",
"Items",
"to",
"be",
"set",
"on",
"Auto",
"Complete",
"box",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/autocomplete/MaterialAutoComplete.java#L312-L349 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.fat.common/src/com/ibm/ws/security/fat/common/utils/CommonExpectations.java | CommonExpectations.successfullyReachedUrl | public static Expectations successfullyReachedUrl(String testAction, String url) {
Expectations expectations = new Expectations();
expectations.addSuccessStatusCodesForActions(new String[] { testAction });
expectations.addExpectation(new ResponseUrlExpectation(testAction, Constants.STRING_EQUALS... | java | public static Expectations successfullyReachedUrl(String testAction, String url) {
Expectations expectations = new Expectations();
expectations.addSuccessStatusCodesForActions(new String[] { testAction });
expectations.addExpectation(new ResponseUrlExpectation(testAction, Constants.STRING_EQUALS... | [
"public",
"static",
"Expectations",
"successfullyReachedUrl",
"(",
"String",
"testAction",
",",
"String",
"url",
")",
"{",
"Expectations",
"expectations",
"=",
"new",
"Expectations",
"(",
")",
";",
"expectations",
".",
"addSuccessStatusCodesForActions",
"(",
"new",
... | Sets expectations that will check:
<ol>
<li>200 status code in the response for the specified test action
<li>Response URL is equivalent to provided URL
</ol> | [
"Sets",
"expectations",
"that",
"will",
"check",
":",
"<ol",
">",
"<li",
">",
"200",
"status",
"code",
"in",
"the",
"response",
"for",
"the",
"specified",
"test",
"action",
"<li",
">",
"Response",
"URL",
"is",
"equivalent",
"to",
"provided",
"URL",
"<",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.fat.common/src/com/ibm/ws/security/fat/common/utils/CommonExpectations.java#L30-L35 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/Languages.java | Languages.getLanguageForShortCode | public static Language getLanguageForShortCode(String langCode, List<String> noopLanguageCodes) {
Language language = getLanguageForShortCodeOrNull(langCode);
if (language == null) {
if (noopLanguageCodes.contains(langCode)) {
return NOOP_LANGUAGE;
} else {
List<String> codes = new A... | java | public static Language getLanguageForShortCode(String langCode, List<String> noopLanguageCodes) {
Language language = getLanguageForShortCodeOrNull(langCode);
if (language == null) {
if (noopLanguageCodes.contains(langCode)) {
return NOOP_LANGUAGE;
} else {
List<String> codes = new A... | [
"public",
"static",
"Language",
"getLanguageForShortCode",
"(",
"String",
"langCode",
",",
"List",
"<",
"String",
">",
"noopLanguageCodes",
")",
"{",
"Language",
"language",
"=",
"getLanguageForShortCodeOrNull",
"(",
"langCode",
")",
";",
"if",
"(",
"language",
"=... | Get the Language object for the given language code.
@param langCode e.g. <code>en</code> or <code>en-US</code>
@param noopLanguageCodes list of languages that can be detected but that will not actually find any errors
(can be used so non-supported languages are not detected as some other language)
@throws IllegalArgum... | [
"Get",
"the",
"Language",
"object",
"for",
"the",
"given",
"language",
"code",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/Languages.java#L225-L242 |
kmi/iserve | iserve-discovery-api/src/main/java/uk/ac/open/kmi/iserve/discovery/api/impl/AbstractMatcher.java | AbstractMatcher.listMatchesAtMostOfType | @Override
public Map<URI, MatchResult> listMatchesAtMostOfType(URI origin, MatchType maxType) {
return listMatchesWithinRange(origin, this.matchTypesSupported.getLowest(), maxType);
} | java | @Override
public Map<URI, MatchResult> listMatchesAtMostOfType(URI origin, MatchType maxType) {
return listMatchesWithinRange(origin, this.matchTypesSupported.getLowest(), maxType);
} | [
"@",
"Override",
"public",
"Map",
"<",
"URI",
",",
"MatchResult",
">",
"listMatchesAtMostOfType",
"(",
"URI",
"origin",
",",
"MatchType",
"maxType",
")",
"{",
"return",
"listMatchesWithinRange",
"(",
"origin",
",",
"this",
".",
"matchTypesSupported",
".",
"getLo... | Obtain all the matching resources that have a MatchTyoe with the URI of {@code origin} of the type provided (inclusive) or less.
@param origin URI to match
@param maxType the maximum MatchType we want to obtain
@return a Map containing indexed by the URI of the matching resource and containing the particular {@code M... | [
"Obtain",
"all",
"the",
"matching",
"resources",
"that",
"have",
"a",
"MatchTyoe",
"with",
"the",
"URI",
"of",
"{",
"@code",
"origin",
"}",
"of",
"the",
"type",
"provided",
"(",
"inclusive",
")",
"or",
"less",
"."
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-discovery-api/src/main/java/uk/ac/open/kmi/iserve/discovery/api/impl/AbstractMatcher.java#L111-L114 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java | InheritanceHelper.isProxyOrSubTypeOf | public boolean isProxyOrSubTypeOf(LightweightTypeReference candidate, Class<?> jvmSuperType,
Class<? extends XtendTypeDeclaration> sarlSuperType) {
if (!candidate.isResolved()) {
return true;
}
return isSubTypeOf(candidate, jvmSuperType, sarlSuperType);
} | java | public boolean isProxyOrSubTypeOf(LightweightTypeReference candidate, Class<?> jvmSuperType,
Class<? extends XtendTypeDeclaration> sarlSuperType) {
if (!candidate.isResolved()) {
return true;
}
return isSubTypeOf(candidate, jvmSuperType, sarlSuperType);
} | [
"public",
"boolean",
"isProxyOrSubTypeOf",
"(",
"LightweightTypeReference",
"candidate",
",",
"Class",
"<",
"?",
">",
"jvmSuperType",
",",
"Class",
"<",
"?",
"extends",
"XtendTypeDeclaration",
">",
"sarlSuperType",
")",
"{",
"if",
"(",
"!",
"candidate",
".",
"is... | Replies if the type candidate is a proxy (unresolved type) or a subtype of the given super type.
@param candidate the type to test.
@param jvmSuperType the expected JVM super-type.
@param sarlSuperType the expected SARL super-type.
@return <code>true</code> if the candidate is a sub-type of the super-type. | [
"Replies",
"if",
"the",
"type",
"candidate",
"is",
"a",
"proxy",
"(",
"unresolved",
"type",
")",
"or",
"a",
"subtype",
"of",
"the",
"given",
"super",
"type",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java#L198-L204 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java | HeadedSyntacticCategory.getSubcategories | public Set<HeadedSyntacticCategory> getSubcategories(Set<String> featureValues) {
Set<HeadedSyntacticCategory> subcategories = Sets.newHashSet();
for (SyntacticCategory newSyntax : syntacticCategory.getSubcategories(featureValues)) {
subcategories.add(new HeadedSyntacticCategory(newSyntax, semanticVariabl... | java | public Set<HeadedSyntacticCategory> getSubcategories(Set<String> featureValues) {
Set<HeadedSyntacticCategory> subcategories = Sets.newHashSet();
for (SyntacticCategory newSyntax : syntacticCategory.getSubcategories(featureValues)) {
subcategories.add(new HeadedSyntacticCategory(newSyntax, semanticVariabl... | [
"public",
"Set",
"<",
"HeadedSyntacticCategory",
">",
"getSubcategories",
"(",
"Set",
"<",
"String",
">",
"featureValues",
")",
"{",
"Set",
"<",
"HeadedSyntacticCategory",
">",
"subcategories",
"=",
"Sets",
".",
"newHashSet",
"(",
")",
";",
"for",
"(",
"Syntac... | Gets all syntactic categories which can be formed by assigning values to the
feature variables of this category. Returned categories may not be in canonical
form.
@param featureValues
@return | [
"Gets",
"all",
"syntactic",
"categories",
"which",
"can",
"be",
"formed",
"by",
"assigning",
"values",
"to",
"the",
"feature",
"variables",
"of",
"this",
"category",
".",
"Returned",
"categories",
"may",
"not",
"be",
"in",
"canonical",
"form",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/HeadedSyntacticCategory.java#L451-L457 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java | PlanNode.findAtOrBelow | public PlanNode findAtOrBelow( Type firstTypeToFind,
Type... additionalTypesToFind ) {
return findAtOrBelow(EnumSet.of(firstTypeToFind, additionalTypesToFind));
} | java | public PlanNode findAtOrBelow( Type firstTypeToFind,
Type... additionalTypesToFind ) {
return findAtOrBelow(EnumSet.of(firstTypeToFind, additionalTypesToFind));
} | [
"public",
"PlanNode",
"findAtOrBelow",
"(",
"Type",
"firstTypeToFind",
",",
"Type",
"...",
"additionalTypesToFind",
")",
"{",
"return",
"findAtOrBelow",
"(",
"EnumSet",
".",
"of",
"(",
"firstTypeToFind",
",",
"additionalTypesToFind",
")",
")",
";",
"}"
] | Find the first node with one of the specified types that are at or below this node.
@param firstTypeToFind the first type of node to find; may not be null
@param additionalTypesToFind the additional types of node to find; may not be null
@return the first node that is at or below this node that has one of the supplied... | [
"Find",
"the",
"first",
"node",
"with",
"one",
"of",
"the",
"specified",
"types",
"that",
"are",
"at",
"or",
"below",
"this",
"node",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1462-L1465 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/SessionUtil.java | SessionUtil.isPrefixEqual | static boolean isPrefixEqual(String aUrlStr, String bUrlStr)
throws MalformedURLException
{
URL aUrl = new URL(aUrlStr);
URL bUrl = new URL(bUrlStr);
int aPort = aUrl.getPort();
int bPort = bUrl.getPort();
if (aPort == -1 && "https".equals(aUrl.getProtocol()))
{
// default port number ... | java | static boolean isPrefixEqual(String aUrlStr, String bUrlStr)
throws MalformedURLException
{
URL aUrl = new URL(aUrlStr);
URL bUrl = new URL(bUrlStr);
int aPort = aUrl.getPort();
int bPort = bUrl.getPort();
if (aPort == -1 && "https".equals(aUrl.getProtocol()))
{
// default port number ... | [
"static",
"boolean",
"isPrefixEqual",
"(",
"String",
"aUrlStr",
",",
"String",
"bUrlStr",
")",
"throws",
"MalformedURLException",
"{",
"URL",
"aUrl",
"=",
"new",
"URL",
"(",
"aUrlStr",
")",
";",
"URL",
"bUrl",
"=",
"new",
"URL",
"(",
"bUrlStr",
")",
";",
... | Verify if two input urls have the same protocol, host, and port.
@param aUrlStr a source URL string
@param bUrlStr a target URL string
@return true if matched otherwise false
@throws MalformedURLException raises if a URL string is not valid. | [
"Verify",
"if",
"two",
"input",
"urls",
"have",
"the",
"same",
"protocol",
"host",
"and",
"port",
"."
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/SessionUtil.java#L1401-L1422 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java | ClusterControllerClient.listClusters | public final ListClustersPagedResponse listClusters(String projectId, String region) {
ListClustersRequest request =
ListClustersRequest.newBuilder().setProjectId(projectId).setRegion(region).build();
return listClusters(request);
} | java | public final ListClustersPagedResponse listClusters(String projectId, String region) {
ListClustersRequest request =
ListClustersRequest.newBuilder().setProjectId(projectId).setRegion(region).build();
return listClusters(request);
} | [
"public",
"final",
"ListClustersPagedResponse",
"listClusters",
"(",
"String",
"projectId",
",",
"String",
"region",
")",
"{",
"ListClustersRequest",
"request",
"=",
"ListClustersRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
")",
".",... | Lists all regions/{region}/clusters in a project.
<p>Sample code:
<pre><code>
try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
String projectId = "";
String region = "";
for (Cluster element : clusterControllerClient.listClusters(projectId, region).iterateAll()) {
// doThings... | [
"Lists",
"all",
"regions",
"/",
"{",
"region",
"}",
"/",
"clusters",
"in",
"a",
"project",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java#L678-L682 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/KunderaMetadataManager.java | KunderaMetadataManager.getMetamodel | public static MetamodelImpl getMetamodel(final KunderaMetadata kunderaMetadata, String... persistenceUnits)
{
MetamodelImpl metamodel = null;
for (String pu : persistenceUnits)
{
metamodel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(pu);
... | java | public static MetamodelImpl getMetamodel(final KunderaMetadata kunderaMetadata, String... persistenceUnits)
{
MetamodelImpl metamodel = null;
for (String pu : persistenceUnits)
{
metamodel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(pu);
... | [
"public",
"static",
"MetamodelImpl",
"getMetamodel",
"(",
"final",
"KunderaMetadata",
"kunderaMetadata",
",",
"String",
"...",
"persistenceUnits",
")",
"{",
"MetamodelImpl",
"metamodel",
"=",
"null",
";",
"for",
"(",
"String",
"pu",
":",
"persistenceUnits",
")",
"... | Gets the metamodel.
@param persistenceUnits
the persistence units
@return the metamodel | [
"Gets",
"the",
"metamodel",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/KunderaMetadataManager.java#L79-L100 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java | CassandraDataHandlerBase.prepareCounterColumn | private CounterColumn prepareCounterColumn(String value, byte[] name)
{
CounterColumn counterColumn = new CounterColumn();
counterColumn.setName(name);
LongAccessor accessor = new LongAccessor();
counterColumn.setValue(accessor.fromString(LongAccessor.class, value));
return c... | java | private CounterColumn prepareCounterColumn(String value, byte[] name)
{
CounterColumn counterColumn = new CounterColumn();
counterColumn.setName(name);
LongAccessor accessor = new LongAccessor();
counterColumn.setValue(accessor.fromString(LongAccessor.class, value));
return c... | [
"private",
"CounterColumn",
"prepareCounterColumn",
"(",
"String",
"value",
",",
"byte",
"[",
"]",
"name",
")",
"{",
"CounterColumn",
"counterColumn",
"=",
"new",
"CounterColumn",
"(",
")",
";",
"counterColumn",
".",
"setName",
"(",
"name",
")",
";",
"LongAcce... | Prepare counter column.
@param value
the value
@param name
the name
@return the counter column | [
"Prepare",
"counter",
"column",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java#L2167-L2174 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/BatchUpdateDaemon.java | BatchUpdateDaemon.pushAliasEntry | public synchronized void pushAliasEntry(AliasEntry aliasEntry, DCache cache) {
BatchUpdateList bul = getUpdateList(cache);
bul.aliasEntryEvents.add(aliasEntry);
} | java | public synchronized void pushAliasEntry(AliasEntry aliasEntry, DCache cache) {
BatchUpdateList bul = getUpdateList(cache);
bul.aliasEntryEvents.add(aliasEntry);
} | [
"public",
"synchronized",
"void",
"pushAliasEntry",
"(",
"AliasEntry",
"aliasEntry",
",",
"DCache",
"cache",
")",
"{",
"BatchUpdateList",
"bul",
"=",
"getUpdateList",
"(",
"cache",
")",
";",
"bul",
".",
"aliasEntryEvents",
".",
"add",
"(",
"aliasEntry",
")",
"... | This allows a cache entry to be added to the BatchUpdateDaemon.
The cache entry will be added to all caches.
@param cacheEntry The cache entry to be added. | [
"This",
"allows",
"a",
"cache",
"entry",
"to",
"be",
"added",
"to",
"the",
"BatchUpdateDaemon",
".",
"The",
"cache",
"entry",
"will",
"be",
"added",
"to",
"all",
"caches",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/BatchUpdateDaemon.java#L213-L216 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.listQueryResultsForResourceGroupLevelPolicyAssignmentAsync | public Observable<PolicyStatesQueryResultsInner> listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName, String policyAssignmentName) {
return listQueryResultsForResourceGroupLevelPolicyAssignmentWithServiceResponseAs... | java | public Observable<PolicyStatesQueryResultsInner> listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName, String policyAssignmentName) {
return listQueryResultsForResourceGroupLevelPolicyAssignmentWithServiceResponseAs... | [
"public",
"Observable",
"<",
"PolicyStatesQueryResultsInner",
">",
"listQueryResultsForResourceGroupLevelPolicyAssignmentAsync",
"(",
"PolicyStatesResource",
"policyStatesResource",
",",
"String",
"subscriptionId",
",",
"String",
"resourceGroupName",
",",
"String",
"policyAssignmen... | Queries policy states for the resource group level policy assignment.
@param policyStatesResource The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). Possible values include: 'default', 'latest'
... | [
"Queries",
"policy",
"states",
"for",
"the",
"resource",
"group",
"level",
"policy",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L2909-L2916 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/ngmf/util/cosu/luca/Sorter.java | Sorter.compare | @Override
public int compare(Integer o1, Integer o2) {
double diff = dataArray[o2] - dataArray[o1];
if (diff == 0) {
return 0;
}
if (sortType == ASCENDING) {
return (diff > 0) ? -1 : 1;
} else {
return (diff > 0) ? 1 : -1;
}
} | java | @Override
public int compare(Integer o1, Integer o2) {
double diff = dataArray[o2] - dataArray[o1];
if (diff == 0) {
return 0;
}
if (sortType == ASCENDING) {
return (diff > 0) ? -1 : 1;
} else {
return (diff > 0) ? 1 : -1;
}
} | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"Integer",
"o1",
",",
"Integer",
"o2",
")",
"{",
"double",
"diff",
"=",
"dataArray",
"[",
"o2",
"]",
"-",
"dataArray",
"[",
"o1",
"]",
";",
"if",
"(",
"diff",
"==",
"0",
")",
"{",
"return",
"0",
"... | For ascending,
return 1 if dataArray[o1] is greater than dataArray[o2]
return 0 if dataArray[o1] is equal to dataArray[o2]
return -1 if dataArray[o1] is less than dataArray[o2]
For decending, do it in the opposize way. | [
"For",
"ascending",
"return",
"1",
"if",
"dataArray",
"[",
"o1",
"]",
"is",
"greater",
"than",
"dataArray",
"[",
"o2",
"]",
"return",
"0",
"if",
"dataArray",
"[",
"o1",
"]",
"is",
"equal",
"to",
"dataArray",
"[",
"o2",
"]",
"return",
"-",
"1",
"if",
... | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/util/cosu/luca/Sorter.java#L32-L43 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/cuComplex.java | cuComplex.cuCmul | public static cuComplex cuCmul (cuComplex x, cuComplex y)
{
cuComplex prod;
prod = cuCmplx ((cuCreal(x) * cuCreal(y)) - (cuCimag(x) * cuCimag(y)),
(cuCreal(x) * cuCimag(y)) + (cuCimag(x) * cuCreal(y)));
return prod;
} | java | public static cuComplex cuCmul (cuComplex x, cuComplex y)
{
cuComplex prod;
prod = cuCmplx ((cuCreal(x) * cuCreal(y)) - (cuCimag(x) * cuCimag(y)),
(cuCreal(x) * cuCimag(y)) + (cuCimag(x) * cuCreal(y)));
return prod;
} | [
"public",
"static",
"cuComplex",
"cuCmul",
"(",
"cuComplex",
"x",
",",
"cuComplex",
"y",
")",
"{",
"cuComplex",
"prod",
";",
"prod",
"=",
"cuCmplx",
"(",
"(",
"cuCreal",
"(",
"x",
")",
"*",
"cuCreal",
"(",
"y",
")",
")",
"-",
"(",
"cuCimag",
"(",
"... | Returns the product of the given complex numbers.<br />
<br />
Original comment:<br />
<br />
This implementation could suffer from intermediate overflow even though
the final result would be in range. However, various implementations do
not guard against this (presumably to avoid losing performance), so we
don't do it... | [
"Returns",
"the",
"product",
"of",
"the",
"given",
"complex",
"numbers",
".",
"<br",
"/",
">",
"<br",
"/",
">",
"Original",
"comment",
":",
"<br",
"/",
">",
"<br",
"/",
">",
"This",
"implementation",
"could",
"suffer",
"from",
"intermediate",
"overflow",
... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/cuComplex.java#L122-L128 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java | StaticTypeCheckingVisitor.storeInferredReturnType | protected ClassNode storeInferredReturnType(final ASTNode node, final ClassNode type) {
if (!(node instanceof ClosureExpression)) {
throw new IllegalArgumentException("Storing inferred return type is only allowed on closures but found " + node.getClass());
}
return (ClassNode) node.p... | java | protected ClassNode storeInferredReturnType(final ASTNode node, final ClassNode type) {
if (!(node instanceof ClosureExpression)) {
throw new IllegalArgumentException("Storing inferred return type is only allowed on closures but found " + node.getClass());
}
return (ClassNode) node.p... | [
"protected",
"ClassNode",
"storeInferredReturnType",
"(",
"final",
"ASTNode",
"node",
",",
"final",
"ClassNode",
"type",
")",
"{",
"if",
"(",
"!",
"(",
"node",
"instanceof",
"ClosureExpression",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"... | Stores the inferred return type of a closure or a method. We are using a separate key to store
inferred return type because the inferred type of a closure is {@link Closure}, which is different
from the inferred type of the code of the closure.
@param node a {@link ClosureExpression} or a {@link MethodNode}
@param typ... | [
"Stores",
"the",
"inferred",
"return",
"type",
"of",
"a",
"closure",
"or",
"a",
"method",
".",
"We",
"are",
"using",
"a",
"separate",
"key",
"to",
"store",
"inferred",
"return",
"type",
"because",
"the",
"inferred",
"type",
"of",
"a",
"closure",
"is",
"{... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L5111-L5116 |
vdmeer/asciitable | src/main/java/de/vandermeer/asciitable/AsciiTable.java | AsciiTable.setPaddingLeftRight | public AsciiTable setPaddingLeftRight(int paddingLeft, int paddingRight){
for(AT_Row row : this.rows){
if(row.getType()==TableRowType.CONTENT){
row.setPaddingLeftRight(paddingLeft, paddingRight);
}
}
return this;
} | java | public AsciiTable setPaddingLeftRight(int paddingLeft, int paddingRight){
for(AT_Row row : this.rows){
if(row.getType()==TableRowType.CONTENT){
row.setPaddingLeftRight(paddingLeft, paddingRight);
}
}
return this;
} | [
"public",
"AsciiTable",
"setPaddingLeftRight",
"(",
"int",
"paddingLeft",
",",
"int",
"paddingRight",
")",
"{",
"for",
"(",
"AT_Row",
"row",
":",
"this",
".",
"rows",
")",
"{",
"if",
"(",
"row",
".",
"getType",
"(",
")",
"==",
"TableRowType",
".",
"CONTE... | Sets left and right padding for all cells in the table (only if both values are not smaller than 0).
@param paddingLeft new left padding, ignored if smaller than 0
@param paddingRight new right padding, ignored if smaller than 0
@return this to allow chaining | [
"Sets",
"left",
"and",
"right",
"padding",
"for",
"all",
"cells",
"in",
"the",
"table",
"(",
"only",
"if",
"both",
"values",
"are",
"not",
"smaller",
"than",
"0",
")",
"."
] | train | https://github.com/vdmeer/asciitable/blob/b6a73710271c89f9c749603be856ba84a969ed5f/src/main/java/de/vandermeer/asciitable/AsciiTable.java#L329-L336 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/ALOCI.java | ALOCI.calculate_MDEF_norm | private static double calculate_MDEF_norm(Node sn, Node cg) {
// get the square sum of the counting neighborhoods box counts
long sq = sn.getSquareSum(cg.getLevel() - sn.getLevel());
/*
* if the square sum is equal to box count of the sampling Neighborhood then
* n_hat is equal one, and as cg need... | java | private static double calculate_MDEF_norm(Node sn, Node cg) {
// get the square sum of the counting neighborhoods box counts
long sq = sn.getSquareSum(cg.getLevel() - sn.getLevel());
/*
* if the square sum is equal to box count of the sampling Neighborhood then
* n_hat is equal one, and as cg need... | [
"private",
"static",
"double",
"calculate_MDEF_norm",
"(",
"Node",
"sn",
",",
"Node",
"cg",
")",
"{",
"// get the square sum of the counting neighborhoods box counts",
"long",
"sq",
"=",
"sn",
".",
"getSquareSum",
"(",
"cg",
".",
"getLevel",
"(",
")",
"-",
"sn",
... | Method for the MDEF calculation
@param sn Sampling Neighborhood
@param cg Counting Neighborhood
@return MDEF norm | [
"Method",
"for",
"the",
"MDEF",
"calculation"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/ALOCI.java#L259-L287 |
hawkular/hawkular-apm | client/opentracing/src/main/java/io/opentracing/impl/APMSpan.java | APMSpan.initChildOf | protected void initChildOf(APMSpanBuilder builder, Reference ref) {
APMSpan parent = (APMSpan) ref.getReferredTo();
if (parent.getNodeBuilder() != null) {
nodeBuilder = new NodeBuilder(parent.getNodeBuilder());
traceContext = parent.traceContext;
// As it is not pos... | java | protected void initChildOf(APMSpanBuilder builder, Reference ref) {
APMSpan parent = (APMSpan) ref.getReferredTo();
if (parent.getNodeBuilder() != null) {
nodeBuilder = new NodeBuilder(parent.getNodeBuilder());
traceContext = parent.traceContext;
// As it is not pos... | [
"protected",
"void",
"initChildOf",
"(",
"APMSpanBuilder",
"builder",
",",
"Reference",
"ref",
")",
"{",
"APMSpan",
"parent",
"=",
"(",
"APMSpan",
")",
"ref",
".",
"getReferredTo",
"(",
")",
";",
"if",
"(",
"parent",
".",
"getNodeBuilder",
"(",
")",
"!=",
... | This method initialises the span based on a 'child-of' relationship.
@param builder The span builder
@param ref The 'child-of' relationship | [
"This",
"method",
"initialises",
"the",
"span",
"based",
"on",
"a",
"child",
"-",
"of",
"relationship",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/client/opentracing/src/main/java/io/opentracing/impl/APMSpan.java#L204-L225 |
wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-raml-monitor-console/src/main/java/monitor/raml/console/RamlMonitorController.java | RamlMonitorController.index | @Route(method = HttpMethod.GET, uri = "")
public Result index(@PathParameter("name") String name) {
if(names.contains(name)){
return ok(render(template,"source",RAML_ASSET_DIR+name+RAML_EXT));
}
return notFound();
} | java | @Route(method = HttpMethod.GET, uri = "")
public Result index(@PathParameter("name") String name) {
if(names.contains(name)){
return ok(render(template,"source",RAML_ASSET_DIR+name+RAML_EXT));
}
return notFound();
} | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"GET",
",",
"uri",
"=",
"\"\"",
")",
"public",
"Result",
"index",
"(",
"@",
"PathParameter",
"(",
"\"name\"",
")",
"String",
"name",
")",
"{",
"if",
"(",
"names",
".",
"contains",
"(",
"name",
")",... | Return the raml console api corresponding to the raml of given name.
@response.mime text/html
@param name Name of the raml api to display.
@return the raml console api or 404 if the file of given name doesn't exist in wisdom | [
"Return",
"the",
"raml",
"console",
"api",
"corresponding",
"to",
"the",
"raml",
"of",
"given",
"name",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-monitor-console/src/main/java/monitor/raml/console/RamlMonitorController.java#L92-L98 |
wonderpush/wonderpush-android-sdk | sdk/src/main/java/com/wonderpush/sdk/WonderPushFirebaseMessagingService.java | WonderPushFirebaseMessagingService.onMessageReceived | public static boolean onMessageReceived(Context context, RemoteMessage message) {
try {
WonderPush.ensureInitialized(context);
WonderPush.logDebug("Received a push notification!");
NotificationModel notif;
try {
notif = NotificationModel.fromRemot... | java | public static boolean onMessageReceived(Context context, RemoteMessage message) {
try {
WonderPush.ensureInitialized(context);
WonderPush.logDebug("Received a push notification!");
NotificationModel notif;
try {
notif = NotificationModel.fromRemot... | [
"public",
"static",
"boolean",
"onMessageReceived",
"(",
"Context",
"context",
",",
"RemoteMessage",
"message",
")",
"{",
"try",
"{",
"WonderPush",
".",
"ensureInitialized",
"(",
"context",
")",
";",
"WonderPush",
".",
"logDebug",
"(",
"\"Received a push notificatio... | Method to be called in your own {@link FirebaseMessagingService} to handle
WonderPush push notifications.
<b>Note:</b> This is only required if you use your own {@link FirebaseMessagingService}.
Implement your {@link FirebaseMessagingService#onMessageReceived(RemoteMessage)} method as follows:
<pre><code>@Override
p... | [
"Method",
"to",
"be",
"called",
"in",
"your",
"own",
"{",
"@link",
"FirebaseMessagingService",
"}",
"to",
"handle",
"WonderPush",
"push",
"notifications",
"."
] | train | https://github.com/wonderpush/wonderpush-android-sdk/blob/ba0a1568f705cdd6206639bfab1e5cf529084b59/sdk/src/main/java/com/wonderpush/sdk/WonderPushFirebaseMessagingService.java#L142-L164 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/util/Properties.java | Properties.getProperty | @SuppressWarnings("unchecked")
public <T> T getProperty(String propName, T defaultValue) {
String propValue = props.getProperty(propName);
if (propValue == null)
return defaultValue;
return ReflectionUtil.<T>getObjectInstance(propValue);
} | java | @SuppressWarnings("unchecked")
public <T> T getProperty(String propName, T defaultValue) {
String propValue = props.getProperty(propName);
if (propValue == null)
return defaultValue;
return ReflectionUtil.<T>getObjectInstance(propValue);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getProperty",
"(",
"String",
"propName",
",",
"T",
"defaultValue",
")",
"{",
"String",
"propValue",
"=",
"props",
".",
"getProperty",
"(",
"propName",
")",
";",
"if",
"(",
... | Returns a class instance of the property associated with {@code propName},
or {@code defaultValue} if there is no property. This method assumes that
the class has a no argument constructor. | [
"Returns",
"a",
"class",
"instance",
"of",
"the",
"property",
"associated",
"with",
"{"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/Properties.java#L92-L98 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java | HylaFaxClientSpi.resumeFaxJob | protected void resumeFaxJob(HylaFaxJob faxJob,HylaFAXClient client) throws Exception
{
//get job
Job job=faxJob.getHylaFaxJob();
//get job ID
long faxJobID=job.getId();
//resume job
client.retry(faxJobID);
} | java | protected void resumeFaxJob(HylaFaxJob faxJob,HylaFAXClient client) throws Exception
{
//get job
Job job=faxJob.getHylaFaxJob();
//get job ID
long faxJobID=job.getId();
//resume job
client.retry(faxJobID);
} | [
"protected",
"void",
"resumeFaxJob",
"(",
"HylaFaxJob",
"faxJob",
",",
"HylaFAXClient",
"client",
")",
"throws",
"Exception",
"{",
"//get job",
"Job",
"job",
"=",
"faxJob",
".",
"getHylaFaxJob",
"(",
")",
";",
"//get job ID",
"long",
"faxJobID",
"=",
"job",
".... | This function will resume an existing fax job.
@param client
The client instance
@param faxJob
The fax job object containing the needed information
@throws Exception
Any exception | [
"This",
"function",
"will",
"resume",
"an",
"existing",
"fax",
"job",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java#L469-L479 |
greenmail-mail-test/greenmail | greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java | GreenMailUtil.copyStream | public static void copyStream(final InputStream src, OutputStream dest) throws IOException {
byte[] buffer = new byte[1024];
int read;
while ((read = src.read(buffer)) > -1) {
dest.write(buffer, 0, read);
}
dest.flush();
} | java | public static void copyStream(final InputStream src, OutputStream dest) throws IOException {
byte[] buffer = new byte[1024];
int read;
while ((read = src.read(buffer)) > -1) {
dest.write(buffer, 0, read);
}
dest.flush();
} | [
"public",
"static",
"void",
"copyStream",
"(",
"final",
"InputStream",
"src",
",",
"OutputStream",
"dest",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"1024",
"]",
";",
"int",
"read",
";",
"while",
"(",
"(",
... | Writes the content of an input stream to an output stream
@throws IOException | [
"Writes",
"the",
"content",
"of",
"an",
"input",
"stream",
"to",
"an",
"output",
"stream"
] | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/util/GreenMailUtil.java#L56-L63 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveTargetPathHelper.java | HiveTargetPathHelper.resolvePath | protected static Path resolvePath(String pattern, String database, String table) {
pattern = pattern.replace(HiveDataset.DATABASE_TOKEN, database);
if (pattern.contains(HiveDataset.TABLE_TOKEN)) {
pattern = pattern.replace(HiveDataset.TABLE_TOKEN, table);
return new Path(pattern);
} else {
... | java | protected static Path resolvePath(String pattern, String database, String table) {
pattern = pattern.replace(HiveDataset.DATABASE_TOKEN, database);
if (pattern.contains(HiveDataset.TABLE_TOKEN)) {
pattern = pattern.replace(HiveDataset.TABLE_TOKEN, table);
return new Path(pattern);
} else {
... | [
"protected",
"static",
"Path",
"resolvePath",
"(",
"String",
"pattern",
",",
"String",
"database",
",",
"String",
"table",
")",
"{",
"pattern",
"=",
"pattern",
".",
"replace",
"(",
"HiveDataset",
".",
"DATABASE_TOKEN",
",",
"database",
")",
";",
"if",
"(",
... | Takes a path with tokens {@link #databaseToken} or {@link #tableToken} and replaces these tokens with the actual
database names and table name. For example, if db is myDatabase, table is myTable, then /data/$DB/$TABLE will be
resolved to /data/myDatabase/myTable. | [
"Takes",
"a",
"path",
"with",
"tokens",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveTargetPathHelper.java#L106-L114 |
pf4j/pf4j | pf4j/src/main/java/org/pf4j/util/ClassUtils.java | ClassUtils.getAnnotationValue | public static AnnotationValue getAnnotationValue(TypeElement typeElement, Class<?> annotationClass, String annotationParameter) {
AnnotationMirror annotationMirror = getAnnotationMirror(typeElement, annotationClass);
return (annotationMirror != null) ?
getAnnotationValue(annotationMirror, an... | java | public static AnnotationValue getAnnotationValue(TypeElement typeElement, Class<?> annotationClass, String annotationParameter) {
AnnotationMirror annotationMirror = getAnnotationMirror(typeElement, annotationClass);
return (annotationMirror != null) ?
getAnnotationValue(annotationMirror, an... | [
"public",
"static",
"AnnotationValue",
"getAnnotationValue",
"(",
"TypeElement",
"typeElement",
",",
"Class",
"<",
"?",
">",
"annotationClass",
",",
"String",
"annotationParameter",
")",
"{",
"AnnotationMirror",
"annotationMirror",
"=",
"getAnnotationMirror",
"(",
"type... | Get a certain annotation parameter of a {@link TypeElement}.
See <a href="https://stackoverflow.com/a/10167558">stackoverflow.com</a> for more information.
@param typeElement the type element, that contains the requested annotation
@param annotationClass the class of the requested annotation
@param annotationParameter... | [
"Get",
"a",
"certain",
"annotation",
"parameter",
"of",
"a",
"{",
"@link",
"TypeElement",
"}",
".",
"See",
"<a",
"href",
"=",
"https",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"a",
"/",
"10167558",
">",
"stackoverflow",
".",
"com<",
"/",
"a",
">",
... | train | https://github.com/pf4j/pf4j/blob/6dd7a6069f0e2fbd842c81e2c8c388918b88ea81/pf4j/src/main/java/org/pf4j/util/ClassUtils.java#L127-L132 |
molgenis/molgenis | molgenis-semantic-search/src/main/java/org/molgenis/semanticsearch/repository/TagRepository.java | TagRepository.getTagEntity | public Tag getTagEntity(String objectIRI, String label, Relation relation, String codeSystemIRI) {
Tag tag =
dataService
.query(TAG, Tag.class)
.eq(OBJECT_IRI, objectIRI)
.and()
.eq(RELATION_IRI, relation.getIRI())
.and()
.eq(CODE_SYSTE... | java | public Tag getTagEntity(String objectIRI, String label, Relation relation, String codeSystemIRI) {
Tag tag =
dataService
.query(TAG, Tag.class)
.eq(OBJECT_IRI, objectIRI)
.and()
.eq(RELATION_IRI, relation.getIRI())
.and()
.eq(CODE_SYSTE... | [
"public",
"Tag",
"getTagEntity",
"(",
"String",
"objectIRI",
",",
"String",
"label",
",",
"Relation",
"relation",
",",
"String",
"codeSystemIRI",
")",
"{",
"Tag",
"tag",
"=",
"dataService",
".",
"query",
"(",
"TAG",
",",
"Tag",
".",
"class",
")",
".",
"e... | Fetches a tag from the repository. Creates a new one if it does not yet exist.
@param objectIRI IRI of the object
@param label label of the object
@param relation {@link Relation} of the tag
@param codeSystemIRI the IRI of the code system of the tag
@return {@link Tag} of type {@link TagMetadata} | [
"Fetches",
"a",
"tag",
"from",
"the",
"repository",
".",
"Creates",
"a",
"new",
"one",
"if",
"it",
"does",
"not",
"yet",
"exist",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-semantic-search/src/main/java/org/molgenis/semanticsearch/repository/TagRepository.java#L41-L62 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteCertificateIssuerAsync | public Observable<IssuerBundle> deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName) {
return deleteCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1<ServiceResponse<IssuerBundle>, IssuerBundle>() {
@Override
public IssuerBundle call(Servic... | java | public Observable<IssuerBundle> deleteCertificateIssuerAsync(String vaultBaseUrl, String issuerName) {
return deleteCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1<ServiceResponse<IssuerBundle>, IssuerBundle>() {
@Override
public IssuerBundle call(Servic... | [
"public",
"Observable",
"<",
"IssuerBundle",
">",
"deleteCertificateIssuerAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"issuerName",
")",
"{",
"return",
"deleteCertificateIssuerWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"issuerName",
")",
".",
"map",
... | 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#L6427-L6434 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/GregorianCalendar.java | GregorianCalendar.getFixedDateMonth1 | private long getFixedDateMonth1(BaseCalendar.Date date, long fixedDate) {
assert date.getNormalizedYear() == gregorianCutoverYear ||
date.getNormalizedYear() == gregorianCutoverYearJulian;
BaseCalendar.Date gCutover = getGregorianCutoverDate();
if (gCutover.getMonth() == BaseCalendar... | java | private long getFixedDateMonth1(BaseCalendar.Date date, long fixedDate) {
assert date.getNormalizedYear() == gregorianCutoverYear ||
date.getNormalizedYear() == gregorianCutoverYearJulian;
BaseCalendar.Date gCutover = getGregorianCutoverDate();
if (gCutover.getMonth() == BaseCalendar... | [
"private",
"long",
"getFixedDateMonth1",
"(",
"BaseCalendar",
".",
"Date",
"date",
",",
"long",
"fixedDate",
")",
"{",
"assert",
"date",
".",
"getNormalizedYear",
"(",
")",
"==",
"gregorianCutoverYear",
"||",
"date",
".",
"getNormalizedYear",
"(",
")",
"==",
"... | Returns the fixed date of the first date of the month (usually
the 1st of the month) before the specified date.
@param date the date for which the first day of the month is
calculated. The date has to be in the cut-over year (Gregorian
or Julian).
@param fixedDate the fixed date representation of the date | [
"Returns",
"the",
"fixed",
"date",
"of",
"the",
"first",
"date",
"of",
"the",
"month",
"(",
"usually",
"the",
"1st",
"of",
"the",
"month",
")",
"before",
"the",
"specified",
"date",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/GregorianCalendar.java#L3192-L3224 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.newInstance | public static <T> T newInstance(Class<T> clazz, Object... params) throws UtilException {
if (ArrayUtil.isEmpty(params)) {
final Constructor<T> constructor = getConstructor(clazz);
try {
return constructor.newInstance();
} catch (Exception e) {
throw new UtilException(e, "Instance class [{}] err... | java | public static <T> T newInstance(Class<T> clazz, Object... params) throws UtilException {
if (ArrayUtil.isEmpty(params)) {
final Constructor<T> constructor = getConstructor(clazz);
try {
return constructor.newInstance();
} catch (Exception e) {
throw new UtilException(e, "Instance class [{}] err... | [
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Object",
"...",
"params",
")",
"throws",
"UtilException",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"params",
")",
")",
"{",
"final",
"Constructo... | 实例化对象
@param <T> 对象类型
@param clazz 类
@param params 构造函数参数
@return 对象
@throws UtilException 包装各类异常 | [
"实例化对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L669-L689 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.beginCaptureAsync | public Observable<VirtualMachineCaptureResultInner> beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) {
return beginCaptureWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1<ServiceResponse<VirtualMachineCaptureResultInner>, Virtual... | java | public Observable<VirtualMachineCaptureResultInner> beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) {
return beginCaptureWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1<ServiceResponse<VirtualMachineCaptureResultInner>, Virtual... | [
"public",
"Observable",
"<",
"VirtualMachineCaptureResultInner",
">",
"beginCaptureAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"VirtualMachineCaptureParameters",
"parameters",
")",
"{",
"return",
"beginCaptureWithServiceResponseAsync",
"(",
"reso... | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Capture Virtual Machine operation.
@throws IllegalA... | [
"Captures",
"the",
"VM",
"by",
"copying",
"virtual",
"hard",
"disks",
"of",
"the",
"VM",
"and",
"outputs",
"a",
"template",
"that",
"can",
"be",
"used",
"to",
"create",
"similar",
"VMs",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L482-L489 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/injection/InjectionHelper.java | InjectionHelper.injectWebServiceContext | public static void injectWebServiceContext(final Object instance, final WebServiceContext ctx)
{
final Class<?> instanceClass = instance.getClass();
// inject @Resource annotated methods accepting WebServiceContext parameter
Collection<Method> resourceAnnotatedMethods = WEB_SERVICE_CONTEXT_METHOD_... | java | public static void injectWebServiceContext(final Object instance, final WebServiceContext ctx)
{
final Class<?> instanceClass = instance.getClass();
// inject @Resource annotated methods accepting WebServiceContext parameter
Collection<Method> resourceAnnotatedMethods = WEB_SERVICE_CONTEXT_METHOD_... | [
"public",
"static",
"void",
"injectWebServiceContext",
"(",
"final",
"Object",
"instance",
",",
"final",
"WebServiceContext",
"ctx",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"instanceClass",
"=",
"instance",
".",
"getClass",
"(",
")",
";",
"// inject @Resource... | Injects @Resource annotated accessible objects referencing WebServiceContext.
@param instance to operate on
@param ctx current web service context | [
"Injects",
"@Resource",
"annotated",
"accessible",
"objects",
"referencing",
"WebServiceContext",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/InjectionHelper.java#L62-L95 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.