repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 192 | func_name stringlengths 5 108 | whole_func_string stringlengths 75 3.91k | language stringclasses 1
value | func_code_string stringlengths 75 3.91k | func_code_tokens listlengths 21 629 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 111 306 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/loader/CmsResourceManager.java | CmsResourceManager.loadResource | public void loadResource(CmsObject cms, CmsResource resource, HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException, CmsException {
res.setContentType(getMimeType(resource.getName(), cms.getRequestContext().getEncoding()));
I_CmsResourceLoader loader = getLoader(reso... | java | public void loadResource(CmsObject cms, CmsResource resource, HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException, CmsException {
res.setContentType(getMimeType(resource.getName(), cms.getRequestContext().getEncoding()));
I_CmsResourceLoader loader = getLoader(reso... | [
"public",
"void",
"loadResource",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
",",
"CmsException",
"{",
"res",
".",
"setContentTy... | Loads the requested resource and writes the contents to the response stream.<p>
@param req the current HTTP request
@param res the current HTTP response
@param cms the current OpenCms user context
@param resource the requested resource
@throws ServletException if something goes wrong
@throws IOException if something g... | [
"Loads",
"the",
"requested",
"resource",
"and",
"writes",
"the",
"contents",
"to",
"the",
"response",
"stream",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsResourceManager.java#L1189-L1195 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.getCacheKey | private String getCacheKey(String prefix, boolean flag, CmsUUID projectId, String resource) {
StringBuffer b = new StringBuffer(64);
if (prefix != null) {
b.append(prefix);
b.append(flag ? '+' : '-');
}
b.append(CmsProject.isOnlineProject(projectId) ? '+' : '-');... | java | private String getCacheKey(String prefix, boolean flag, CmsUUID projectId, String resource) {
StringBuffer b = new StringBuffer(64);
if (prefix != null) {
b.append(prefix);
b.append(flag ? '+' : '-');
}
b.append(CmsProject.isOnlineProject(projectId) ? '+' : '-');... | [
"private",
"String",
"getCacheKey",
"(",
"String",
"prefix",
",",
"boolean",
"flag",
",",
"CmsUUID",
"projectId",
",",
"String",
"resource",
")",
"{",
"StringBuffer",
"b",
"=",
"new",
"StringBuffer",
"(",
"64",
")",
";",
"if",
"(",
"prefix",
"!=",
"null",
... | Return a cache key build from the provided information.<p>
@param prefix a prefix for the key
@param flag a boolean flag for the key (only used if prefix is not null)
@param projectId the project for which to generate the key
@param resource the resource for which to generate the key
@return String a cache key build ... | [
"Return",
"a",
"cache",
"key",
"build",
"from",
"the",
"provided",
"information",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L11166-L11175 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbmonbindings_binding.java | lbmonbindings_binding.get | public static lbmonbindings_binding get(nitro_service service, String monitorname) throws Exception{
lbmonbindings_binding obj = new lbmonbindings_binding();
obj.set_monitorname(monitorname);
lbmonbindings_binding response = (lbmonbindings_binding) obj.get_resource(service);
return response;
} | java | public static lbmonbindings_binding get(nitro_service service, String monitorname) throws Exception{
lbmonbindings_binding obj = new lbmonbindings_binding();
obj.set_monitorname(monitorname);
lbmonbindings_binding response = (lbmonbindings_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"lbmonbindings_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"monitorname",
")",
"throws",
"Exception",
"{",
"lbmonbindings_binding",
"obj",
"=",
"new",
"lbmonbindings_binding",
"(",
")",
";",
"obj",
".",
"set_monitorname",
"("... | Use this API to fetch lbmonbindings_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"lbmonbindings_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbmonbindings_binding.java#L114-L119 |
att/AAF | cadi/core/src/main/java/com/att/cadi/Symm.java | Symm.exec | private synchronized void exec(AESExec exec) throws IOException {
if(aes == null) {
try {
byte[] bytes = new byte[AES.AES_KEY_SIZE/8];
int offset = (Math.abs(codeset[0])+47)%(codeset.length-bytes.length);
for(int i=0;i<bytes.length;++i) {
bytes[i] = (byte)codeset[i+offset];
}
aes = new AES... | java | private synchronized void exec(AESExec exec) throws IOException {
if(aes == null) {
try {
byte[] bytes = new byte[AES.AES_KEY_SIZE/8];
int offset = (Math.abs(codeset[0])+47)%(codeset.length-bytes.length);
for(int i=0;i<bytes.length;++i) {
bytes[i] = (byte)codeset[i+offset];
}
aes = new AES... | [
"private",
"synchronized",
"void",
"exec",
"(",
"AESExec",
"exec",
")",
"throws",
"IOException",
"{",
"if",
"(",
"aes",
"==",
"null",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"AES",
".",
"AES_KEY_SIZE",
"/",
"8",
"]",... | /*
Note: AES Encryption is NOT thread-safe. Must surround entire use with synchronized | [
"/",
"*",
"Note",
":",
"AES",
"Encryption",
"is",
"NOT",
"thread",
"-",
"safe",
".",
"Must",
"surround",
"entire",
"use",
"with",
"synchronized"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/Symm.java#L190-L204 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/operators/LatchedObserver.java | LatchedObserver.createIndexed | public static <T> LatchedObserver<T> createIndexed(Action2<? super T, ? super Integer> onNext, Action1<? super Throwable> onError) {
return createIndexed(onNext, onError, new CountDownLatch(1));
} | java | public static <T> LatchedObserver<T> createIndexed(Action2<? super T, ? super Integer> onNext, Action1<? super Throwable> onError) {
return createIndexed(onNext, onError, new CountDownLatch(1));
} | [
"public",
"static",
"<",
"T",
">",
"LatchedObserver",
"<",
"T",
">",
"createIndexed",
"(",
"Action2",
"<",
"?",
"super",
"T",
",",
"?",
"super",
"Integer",
">",
"onNext",
",",
"Action1",
"<",
"?",
"super",
"Throwable",
">",
"onError",
")",
"{",
"return... | Create a LatchedObserver with the given indexed callback function(s). | [
"Create",
"a",
"LatchedObserver",
"with",
"the",
"given",
"indexed",
"callback",
"function",
"(",
"s",
")",
"."
] | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/operators/LatchedObserver.java#L172-L174 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/MessageRequest.java | MessageRequest.withEndpoints | public MessageRequest withEndpoints(java.util.Map<String, EndpointSendConfiguration> endpoints) {
setEndpoints(endpoints);
return this;
} | java | public MessageRequest withEndpoints(java.util.Map<String, EndpointSendConfiguration> endpoints) {
setEndpoints(endpoints);
return this;
} | [
"public",
"MessageRequest",
"withEndpoints",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"EndpointSendConfiguration",
">",
"endpoints",
")",
"{",
"setEndpoints",
"(",
"endpoints",
")",
";",
"return",
"this",
";",
"}"
] | A map of key-value pairs, where each key is an endpoint ID and each value is an EndpointSendConfiguration object.
Within an EndpointSendConfiguration object, you can tailor the message for an endpoint by specifying message
overrides or substitutions.
@param endpoints
A map of key-value pairs, where each key is an endp... | [
"A",
"map",
"of",
"key",
"-",
"value",
"pairs",
"where",
"each",
"key",
"is",
"an",
"endpoint",
"ID",
"and",
"each",
"value",
"is",
"an",
"EndpointSendConfiguration",
"object",
".",
"Within",
"an",
"EndpointSendConfiguration",
"object",
"you",
"can",
"tailor",... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/MessageRequest.java#L213-L216 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DiSH.java | DiSH.sortClusters | private List<Cluster<SubspaceModel>> sortClusters(Relation<V> relation, Object2ObjectMap<long[], List<ArrayModifiableDBIDs>> clustersMap) {
final int db_dim = RelationUtil.dimensionality(relation);
// int num = 1;
List<Cluster<SubspaceModel>> clusters = new ArrayList<>();
for(long[] pv : clustersMap.key... | java | private List<Cluster<SubspaceModel>> sortClusters(Relation<V> relation, Object2ObjectMap<long[], List<ArrayModifiableDBIDs>> clustersMap) {
final int db_dim = RelationUtil.dimensionality(relation);
// int num = 1;
List<Cluster<SubspaceModel>> clusters = new ArrayList<>();
for(long[] pv : clustersMap.key... | [
"private",
"List",
"<",
"Cluster",
"<",
"SubspaceModel",
">",
">",
"sortClusters",
"(",
"Relation",
"<",
"V",
">",
"relation",
",",
"Object2ObjectMap",
"<",
"long",
"[",
"]",
",",
"List",
"<",
"ArrayModifiableDBIDs",
">",
">",
"clustersMap",
")",
"{",
"fin... | Returns a sorted list of the clusters w.r.t. the subspace dimensionality in
descending order.
@param relation the database storing the objects
@param clustersMap the mapping of bits sets to clusters
@return a sorted list of the clusters | [
"Returns",
"a",
"sorted",
"list",
"of",
"the",
"clusters",
"w",
".",
"r",
".",
"t",
".",
"the",
"subspace",
"dimensionality",
"in",
"descending",
"order",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DiSH.java#L334-L359 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java | UriUtils.encodeQueryParam | public static String encodeQueryParam(String queryParam, String encoding) throws UnsupportedEncodingException {
return HierarchicalUriComponents.encodeUriComponent(queryParam, encoding, HierarchicalUriComponents.Type.QUERY_PARAM);
} | java | public static String encodeQueryParam(String queryParam, String encoding) throws UnsupportedEncodingException {
return HierarchicalUriComponents.encodeUriComponent(queryParam, encoding, HierarchicalUriComponents.Type.QUERY_PARAM);
} | [
"public",
"static",
"String",
"encodeQueryParam",
"(",
"String",
"queryParam",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"HierarchicalUriComponents",
".",
"encodeUriComponent",
"(",
"queryParam",
",",
"encoding",
",",
"Hier... | Encodes the given URI query parameter with the given encoding.
@param queryParam the query parameter to be encoded
@param encoding the character encoding to encode to
@return the encoded query parameter
@throws UnsupportedEncodingException when the given encoding parameter is not supported | [
"Encodes",
"the",
"given",
"URI",
"query",
"parameter",
"with",
"the",
"given",
"encoding",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/web/util/UriUtils.java#L307-L309 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/Normalization.java | Normalization.minMaxColumns | public static List<Row> minMaxColumns(DataRowsFacade data, List<String> columns) {
String[] arr = new String[columns.size()];
for (int i = 0; i < arr.length; i++)
arr[i] = columns.get(i);
return minMaxColumns(data, arr);
} | java | public static List<Row> minMaxColumns(DataRowsFacade data, List<String> columns) {
String[] arr = new String[columns.size()];
for (int i = 0; i < arr.length; i++)
arr[i] = columns.get(i);
return minMaxColumns(data, arr);
} | [
"public",
"static",
"List",
"<",
"Row",
">",
"minMaxColumns",
"(",
"DataRowsFacade",
"data",
",",
"List",
"<",
"String",
">",
"columns",
")",
"{",
"String",
"[",
"]",
"arr",
"=",
"new",
"String",
"[",
"columns",
".",
"size",
"(",
")",
"]",
";",
"for"... | Returns the min and max of the given columns
@param data the data to get the max for
@param columns the columns to get the
@return | [
"Returns",
"the",
"min",
"and",
"max",
"of",
"the",
"given",
"columns"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/Normalization.java#L199-L204 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.listEntitiesWithServiceResponseAsync | public Observable<ServiceResponse<List<EntityExtractor>>> listEntitiesWithServiceResponseAsync(UUID appId, String versionId, ListEntitiesOptionalParameter listEntitiesOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is re... | java | public Observable<ServiceResponse<List<EntityExtractor>>> listEntitiesWithServiceResponseAsync(UUID appId, String versionId, ListEntitiesOptionalParameter listEntitiesOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is re... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"EntityExtractor",
">",
">",
">",
"listEntitiesWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"ListEntitiesOptionalParameter",
"listEntitiesOptionalParameter",
")",
"{",
... | Gets information about the entity models.
@param appId The application ID.
@param versionId The version ID.
@param listEntitiesOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observ... | [
"Gets",
"information",
"about",
"the",
"entity",
"models",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L1148-L1162 |
killbill/killbill | invoice/src/main/java/org/killbill/billing/invoice/generator/InvoiceDateUtils.java | InvoiceDateUtils.calculateProrationBetweenDates | private static BigDecimal calculateProrationBetweenDates(final LocalDate startDate, final LocalDate endDate, final LocalDate previousBillingCycleDate, final LocalDate nextBillingCycleDate) {
final int daysBetween = Days.daysBetween(previousBillingCycleDate, nextBillingCycleDate).getDays();
return calcul... | java | private static BigDecimal calculateProrationBetweenDates(final LocalDate startDate, final LocalDate endDate, final LocalDate previousBillingCycleDate, final LocalDate nextBillingCycleDate) {
final int daysBetween = Days.daysBetween(previousBillingCycleDate, nextBillingCycleDate).getDays();
return calcul... | [
"private",
"static",
"BigDecimal",
"calculateProrationBetweenDates",
"(",
"final",
"LocalDate",
"startDate",
",",
"final",
"LocalDate",
"endDate",
",",
"final",
"LocalDate",
"previousBillingCycleDate",
",",
"final",
"LocalDate",
"nextBillingCycleDate",
")",
"{",
"final",
... | Called internally to calculate proration or when we recalculate approximate repair amount
@param startDate start date of the prorated interval
@param endDate end date of the prorated interval
@param previousBillingCycleDate start date of the period
@param nextBillingCycleDate end da... | [
"Called",
"internally",
"to",
"calculate",
"proration",
"or",
"when",
"we",
"recalculate",
"approximate",
"repair",
"amount"
] | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/invoice/src/main/java/org/killbill/billing/invoice/generator/InvoiceDateUtils.java#L73-L76 |
lets-blade/blade | src/main/java/com/blade/Blade.java | Blade.enableCors | public Blade enableCors(boolean enableCors, CorsConfiger corsConfig) {
this.environment.set(ENV_KEY_CORS_ENABLE, enableCors);
if (enableCors) {
this.corsMiddleware = new CorsMiddleware(corsConfig);
}
return this;
} | java | public Blade enableCors(boolean enableCors, CorsConfiger corsConfig) {
this.environment.set(ENV_KEY_CORS_ENABLE, enableCors);
if (enableCors) {
this.corsMiddleware = new CorsMiddleware(corsConfig);
}
return this;
} | [
"public",
"Blade",
"enableCors",
"(",
"boolean",
"enableCors",
",",
"CorsConfiger",
"corsConfig",
")",
"{",
"this",
".",
"environment",
".",
"set",
"(",
"ENV_KEY_CORS_ENABLE",
",",
"enableCors",
")",
";",
"if",
"(",
"enableCors",
")",
"{",
"this",
".",
"cors... | Set whether to config cors
@param enableCors enable cors
@param corsConfig config cors
@return blade | [
"Set",
"whether",
"to",
"config",
"cors"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/Blade.java#L540-L546 |
jenkinsci/jenkins | core/src/main/java/jenkins/model/NodeListener.java | NodeListener.fireOnUpdated | public static void fireOnUpdated(@Nonnull Node oldOne, @Nonnull Node newOne) {
for (NodeListener nl: all()) {
try {
nl.onUpdated(oldOne, newOne);
} catch (Throwable ex) {
LOGGER.log(Level.WARNING, "Listener invocation failed", ex);
}
}
... | java | public static void fireOnUpdated(@Nonnull Node oldOne, @Nonnull Node newOne) {
for (NodeListener nl: all()) {
try {
nl.onUpdated(oldOne, newOne);
} catch (Throwable ex) {
LOGGER.log(Level.WARNING, "Listener invocation failed", ex);
}
}
... | [
"public",
"static",
"void",
"fireOnUpdated",
"(",
"@",
"Nonnull",
"Node",
"oldOne",
",",
"@",
"Nonnull",
"Node",
"newOne",
")",
"{",
"for",
"(",
"NodeListener",
"nl",
":",
"all",
"(",
")",
")",
"{",
"try",
"{",
"nl",
".",
"onUpdated",
"(",
"oldOne",
... | Inform listeners that node is being updated.
@param oldOne Old configuration.
@param newOne New Configuration. | [
"Inform",
"listeners",
"that",
"node",
"is",
"being",
"updated",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/model/NodeListener.java#L81-L89 |
yidongnan/grpc-spring-boot-starter | grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/inject/GrpcClientBeanPostProcessor.java | GrpcClientBeanPostProcessor.processInjectionPoint | protected <T> T processInjectionPoint(final Member injectionTarget, final Class<T> injectionType,
final GrpcClient annotation) {
final List<ClientInterceptor> interceptors = interceptorsFromAnnotation(annotation);
final String name = annotation.value();
final Channel channel;
... | java | protected <T> T processInjectionPoint(final Member injectionTarget, final Class<T> injectionType,
final GrpcClient annotation) {
final List<ClientInterceptor> interceptors = interceptorsFromAnnotation(annotation);
final String name = annotation.value();
final Channel channel;
... | [
"protected",
"<",
"T",
">",
"T",
"processInjectionPoint",
"(",
"final",
"Member",
"injectionTarget",
",",
"final",
"Class",
"<",
"T",
">",
"injectionType",
",",
"final",
"GrpcClient",
"annotation",
")",
"{",
"final",
"List",
"<",
"ClientInterceptor",
">",
"int... | Processes the given injection point and computes the appropriate value for the injection.
@param <T> The type of the value to be injected.
@param injectionTarget The target of the injection.
@param injectionType The class that will be used to compute injection.
@param annotation The annotation on the target with the m... | [
"Processes",
"the",
"given",
"injection",
"point",
"and",
"computes",
"the",
"appropriate",
"value",
"for",
"the",
"injection",
"."
] | train | https://github.com/yidongnan/grpc-spring-boot-starter/blob/07f8853cfafc9707584f2371aff012e590217b85/grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/inject/GrpcClientBeanPostProcessor.java#L107-L127 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.getField | public MethodHandle getField(MethodHandles.Lookup lookup, String name) throws NoSuchFieldException, IllegalAccessException {
return invoke(lookup.findGetter(type().parameterType(0), name, type().returnType()));
} | java | public MethodHandle getField(MethodHandles.Lookup lookup, String name) throws NoSuchFieldException, IllegalAccessException {
return invoke(lookup.findGetter(type().parameterType(0), name, type().returnType()));
} | [
"public",
"MethodHandle",
"getField",
"(",
"MethodHandles",
".",
"Lookup",
"lookup",
",",
"String",
"name",
")",
"throws",
"NoSuchFieldException",
",",
"IllegalAccessException",
"{",
"return",
"invoke",
"(",
"lookup",
".",
"findGetter",
"(",
"type",
"(",
")",
".... | Apply the chain of transforms and bind them to an object field retrieval specified
using the end signature plus the given class and name. The field must
match the end signature's return value and the end signature must take
the target class or a subclass as its only argument.
If the final handle's type does not exactl... | [
"Apply",
"the",
"chain",
"of",
"transforms",
"and",
"bind",
"them",
"to",
"an",
"object",
"field",
"retrieval",
"specified",
"using",
"the",
"end",
"signature",
"plus",
"the",
"given",
"class",
"and",
"name",
".",
"The",
"field",
"must",
"match",
"the",
"e... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1387-L1389 |
OpenVidu/openvidu | openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java | KurentoSessionManager.createSession | public void createSession(Session sessionNotActive, KurentoClientSessionInfo kcSessionInfo)
throws OpenViduException {
String sessionId = kcSessionInfo.getRoomName();
KurentoSession session = (KurentoSession) sessions.get(sessionId);
if (session != null) {
throw new OpenViduException(Code.ROOM_CANNOT_BE_CRE... | java | public void createSession(Session sessionNotActive, KurentoClientSessionInfo kcSessionInfo)
throws OpenViduException {
String sessionId = kcSessionInfo.getRoomName();
KurentoSession session = (KurentoSession) sessions.get(sessionId);
if (session != null) {
throw new OpenViduException(Code.ROOM_CANNOT_BE_CRE... | [
"public",
"void",
"createSession",
"(",
"Session",
"sessionNotActive",
",",
"KurentoClientSessionInfo",
"kcSessionInfo",
")",
"throws",
"OpenViduException",
"{",
"String",
"sessionId",
"=",
"kcSessionInfo",
".",
"getRoomName",
"(",
")",
";",
"KurentoSession",
"session",... | Creates a session if it doesn't already exist. The session's id will be
indicated by the session info bean.
@param kcSessionInfo bean that will be passed to the
{@link KurentoClientProvider} in order to obtain the
{@link KurentoClient} that will be used by the room
@throws OpenViduException in case of error while crea... | [
"Creates",
"a",
"session",
"if",
"it",
"doesn",
"t",
"already",
"exist",
".",
"The",
"session",
"s",
"id",
"will",
"be",
"indicated",
"by",
"the",
"session",
"info",
"bean",
"."
] | train | https://github.com/OpenVidu/openvidu/blob/89db47dd37949ceab29e5228371a8fcab04d8d55/openvidu-server/src/main/java/io/openvidu/server/kurento/core/KurentoSessionManager.java#L503-L527 |
SundeepK/CompactCalendarView | library/src/main/java/com/github/sundeepk/compactcalendarview/CompactCalendarView.java | CompactCalendarView.setLocale | public void setLocale(TimeZone timeZone, Locale locale){
compactCalendarController.setLocale(timeZone, locale);
invalidate();
} | java | public void setLocale(TimeZone timeZone, Locale locale){
compactCalendarController.setLocale(timeZone, locale);
invalidate();
} | [
"public",
"void",
"setLocale",
"(",
"TimeZone",
"timeZone",
",",
"Locale",
"locale",
")",
"{",
"compactCalendarController",
".",
"setLocale",
"(",
"timeZone",
",",
"locale",
")",
";",
"invalidate",
"(",
")",
";",
"}"
] | /*
Use a custom locale for compact calendar and reinitialise the view. | [
"/",
"*",
"Use",
"a",
"custom",
"locale",
"for",
"compact",
"calendar",
"and",
"reinitialise",
"the",
"view",
"."
] | train | https://github.com/SundeepK/CompactCalendarView/blob/e74e0eeb913744bdcaea6e9df53268441f9dbf8d/library/src/main/java/com/github/sundeepk/compactcalendarview/CompactCalendarView.java#L109-L112 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/quantiles/DoublesSketch.java | DoublesSketch.putMemory | public void putMemory(final WritableMemory dstMem, final boolean compact) {
if (isDirect() && (isCompact() == compact)) {
final Memory srcMem = getMemory();
srcMem.copyTo(0, dstMem, 0, getStorageBytes());
} else {
final byte[] byteArr = toByteArray(compact);
final int arrLen = byteArr.le... | java | public void putMemory(final WritableMemory dstMem, final boolean compact) {
if (isDirect() && (isCompact() == compact)) {
final Memory srcMem = getMemory();
srcMem.copyTo(0, dstMem, 0, getStorageBytes());
} else {
final byte[] byteArr = toByteArray(compact);
final int arrLen = byteArr.le... | [
"public",
"void",
"putMemory",
"(",
"final",
"WritableMemory",
"dstMem",
",",
"final",
"boolean",
"compact",
")",
"{",
"if",
"(",
"isDirect",
"(",
")",
"&&",
"(",
"isCompact",
"(",
")",
"==",
"compact",
")",
")",
"{",
"final",
"Memory",
"srcMem",
"=",
... | Puts the current sketch into the given Memory if there is sufficient space, otherwise,
throws an error.
@param dstMem the given memory.
@param compact if true, compacts and sorts the base buffer, which optimizes merge
performance at the cost of slightly increased serialization time. | [
"Puts",
"the",
"current",
"sketch",
"into",
"the",
"given",
"Memory",
"if",
"there",
"is",
"sufficient",
"space",
"otherwise",
"throws",
"an",
"error",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/DoublesSketch.java#L693-L707 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_http_frontend_frontendId_GET | public OvhFrontendHttp serviceName_http_frontend_frontendId_GET(String serviceName, Long frontendId) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/http/frontend/{frontendId}";
StringBuilder sb = path(qPath, serviceName, frontendId);
String resp = exec(qPath, "GET", sb.toString(), null);
re... | java | public OvhFrontendHttp serviceName_http_frontend_frontendId_GET(String serviceName, Long frontendId) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/http/frontend/{frontendId}";
StringBuilder sb = path(qPath, serviceName, frontendId);
String resp = exec(qPath, "GET", sb.toString(), null);
re... | [
"public",
"OvhFrontendHttp",
"serviceName_http_frontend_frontendId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"frontendId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/http/frontend/{frontendId}\"",
";",
"StringBuilder",
"s... | Get this object properties
REST: GET /ipLoadbalancing/{serviceName}/http/frontend/{frontendId}
@param serviceName [required] The internal name of your IP load balancing
@param frontendId [required] Id of your frontend | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L323-L328 |
cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java | XLogPDescriptor.checkRingLink | private boolean checkRingLink(IRingSet ringSet, IAtomContainer ac, IAtom atom) {
List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
if (ringSet.contains(atom)) {
return true;
}
for (IAtom neighbour : neighbours) {
if (ringSet.contains(neighbour)) {
... | java | private boolean checkRingLink(IRingSet ringSet, IAtomContainer ac, IAtom atom) {
List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
if (ringSet.contains(atom)) {
return true;
}
for (IAtom neighbour : neighbours) {
if (ringSet.contains(neighbour)) {
... | [
"private",
"boolean",
"checkRingLink",
"(",
"IRingSet",
"ringSet",
",",
"IAtomContainer",
"ac",
",",
"IAtom",
"atom",
")",
"{",
"List",
"<",
"IAtom",
">",
"neighbours",
"=",
"ac",
".",
"getConnectedAtomsList",
"(",
"atom",
")",
";",
"if",
"(",
"ringSet",
"... | Check if atom or neighbour atom is part of a ring
@param ac Description of the Parameter
@param atom Description of the Parameter
@return The hydrogenCount value | [
"Check",
"if",
"atom",
"or",
"neighbour",
"atom",
"is",
"part",
"of",
"a",
"ring"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java#L993-L1004 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/DriverManager.java | DriverManager.openFile | public static void openFile(Connection connection, String fileName, String tableName) throws SQLException {
String ext = fileName.substring(fileName.lastIndexOf('.') + 1,fileName.length());
final boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData());
for(DriverDef driverDef : DRIVE... | java | public static void openFile(Connection connection, String fileName, String tableName) throws SQLException {
String ext = fileName.substring(fileName.lastIndexOf('.') + 1,fileName.length());
final boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData());
for(DriverDef driverDef : DRIVE... | [
"public",
"static",
"void",
"openFile",
"(",
"Connection",
"connection",
",",
"String",
"fileName",
",",
"String",
"tableName",
")",
"throws",
"SQLException",
"{",
"String",
"ext",
"=",
"fileName",
".",
"substring",
"(",
"fileName",
".",
"lastIndexOf",
"(",
"'... | Create a new table
@param connection Active connection, do not close this connection.
@param fileName File path to write, if exists it may be replaced
@param tableName [[catalog.]schema.]table reference | [
"Create",
"a",
"new",
"table"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/DriverManager.java#L89-L103 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.indexOfIgnoreCase | public static int indexOfIgnoreCase(String pString, int pChar, int pPos) {
if ((pString == null)) {
return -1;
}
// Get first char
char lower = Character.toLowerCase((char) pChar);
char upper = Character.toUpperCase((char) pChar);
int indexLower;
... | java | public static int indexOfIgnoreCase(String pString, int pChar, int pPos) {
if ((pString == null)) {
return -1;
}
// Get first char
char lower = Character.toLowerCase((char) pChar);
char upper = Character.toUpperCase((char) pChar);
int indexLower;
... | [
"public",
"static",
"int",
"indexOfIgnoreCase",
"(",
"String",
"pString",
",",
"int",
"pChar",
",",
"int",
"pPos",
")",
"{",
"if",
"(",
"(",
"pString",
"==",
"null",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"// Get first char\r",
"char",
"lower",
"... | Returns the index within this string of the first occurrence of the
specified character, starting at the specified index.
@param pString The string to test
@param pChar The character to look for
@param pPos The first index to test
@return if the string argument occurs as a substring within this object,
then the i... | [
"Returns",
"the",
"index",
"within",
"this",
"string",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"character",
"starting",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L465-L496 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RestorableDroppedDatabasesInner.java | RestorableDroppedDatabasesInner.listByServerAsync | public Observable<List<RestorableDroppedDatabaseInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<RestorableDroppedDatabaseInner>>, List<RestorableDroppedDatabaseInner>>() {
... | java | public Observable<List<RestorableDroppedDatabaseInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<RestorableDroppedDatabaseInner>>, List<RestorableDroppedDatabaseInner>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"RestorableDroppedDatabaseInner",
">",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverNa... | Gets a list of deleted databases that can be restored.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail th... | [
"Gets",
"a",
"list",
"of",
"deleted",
"databases",
"that",
"can",
"be",
"restored",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RestorableDroppedDatabasesInner.java#L193-L200 |
openbase/jul | exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java | ExceptionPrinter.printHistory | public static <T extends Throwable> void printHistory(final T th, final Logger logger, final LogLevel level) {
printHistory(th, new LogPrinter(logger, level));
} | java | public static <T extends Throwable> void printHistory(final T th, final Logger logger, final LogLevel level) {
printHistory(th, new LogPrinter(logger, level));
} | [
"public",
"static",
"<",
"T",
"extends",
"Throwable",
">",
"void",
"printHistory",
"(",
"final",
"T",
"th",
",",
"final",
"Logger",
"logger",
",",
"final",
"LogLevel",
"level",
")",
"{",
"printHistory",
"(",
"th",
",",
"new",
"LogPrinter",
"(",
"logger",
... | Print Exception messages without stack trace in non debug mode. Method prints recursive all messages of the given exception stack to get a history overview of the causes. In verbose mode (app
-v) the stacktrace is printed in the end of history.
@param <T> Exception type
@param logger the logger used as message printer... | [
"Print",
"Exception",
"messages",
"without",
"stack",
"trace",
"in",
"non",
"debug",
"mode",
".",
"Method",
"prints",
"recursive",
"all",
"messages",
"of",
"the",
"given",
"exception",
"stack",
"to",
"get",
"a",
"history",
"overview",
"of",
"the",
"causes",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/exception/src/main/java/org/openbase/jul/exception/printer/ExceptionPrinter.java#L120-L122 |
menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java | NettyUtils.readObject | public static Object readObject(ChannelBuffer buffer, int length)
{
ChannelBuffer objBuffer = buffer.readSlice(length);
Object obj;
try
{
obj = OBJECT_DECODER.decode(objBuffer);
}
catch (Exception e)
{
throw new RuntimeException(e);
}
return obj;
} | java | public static Object readObject(ChannelBuffer buffer, int length)
{
ChannelBuffer objBuffer = buffer.readSlice(length);
Object obj;
try
{
obj = OBJECT_DECODER.decode(objBuffer);
}
catch (Exception e)
{
throw new RuntimeException(e);
}
return obj;
} | [
"public",
"static",
"Object",
"readObject",
"(",
"ChannelBuffer",
"buffer",
",",
"int",
"length",
")",
"{",
"ChannelBuffer",
"objBuffer",
"=",
"buffer",
".",
"readSlice",
"(",
"length",
")",
";",
"Object",
"obj",
";",
"try",
"{",
"obj",
"=",
"OBJECT_DECODER"... | Read an object from a channel buffer with the specified length. It sets
the reader index of the buffer to current reader index + 2(length bytes)
+ actual length.
@param buffer
The Netty buffer containing the Object.
@param length
The number of bytes in the Object.
@return Returns the read object. | [
"Read",
"an",
"object",
"from",
"a",
"channel",
"buffer",
"with",
"the",
"specified",
"length",
".",
"It",
"sets",
"the",
"reader",
"index",
"of",
"the",
"buffer",
"to",
"current",
"reader",
"index",
"+",
"2",
"(",
"length",
"bytes",
")",
"+",
"actual",
... | train | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java#L353-L366 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqlsecond | public static void sqlsecond(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
singleArgumentFunctionCall(buf, "extract(second from ", "second", parsedArgs);
} | java | public static void sqlsecond(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
singleArgumentFunctionCall(buf, "extract(second from ", "second", parsedArgs);
} | [
"public",
"static",
"void",
"sqlsecond",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"singleArgumentFunctionCall",
"(",
"buf",
",",
"\"extract(second from \"",
",",
"\"second\"... | second translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"second",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L464-L466 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java | RemotePDPProvider.getDomain | @Override
public Structure getDomain(String pdpDomainName, AtomCache cache) throws IOException, StructureException {
return cache.getStructure(getPDPDomain(pdpDomainName));
} | java | @Override
public Structure getDomain(String pdpDomainName, AtomCache cache) throws IOException, StructureException {
return cache.getStructure(getPDPDomain(pdpDomainName));
} | [
"@",
"Override",
"public",
"Structure",
"getDomain",
"(",
"String",
"pdpDomainName",
",",
"AtomCache",
"cache",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"return",
"cache",
".",
"getStructure",
"(",
"getPDPDomain",
"(",
"pdpDomainName",
")",
")... | Get the structure for a particular PDP domain
@param pdpDomainName PDP identifier, e.g. "PDP:4HHBAa"
@param cache AtomCache, responsible for fetching and storing the coordinates
@return Structure representing the PDP domain
@throws IOException if the server cannot be reached
@throws StructureException For errors parsin... | [
"Get",
"the",
"structure",
"for",
"a",
"particular",
"PDP",
"domain"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/RemotePDPProvider.java#L162-L165 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java | UCharacter.codePointBefore | public static final int codePointBefore(CharSequence seq, int index) {
char c2 = seq.charAt(--index);
if (isLowSurrogate(c2)) {
if (index > 0) {
char c1 = seq.charAt(--index);
if (isHighSurrogate(c1)) {
return toCodePoint(c1, c2);
... | java | public static final int codePointBefore(CharSequence seq, int index) {
char c2 = seq.charAt(--index);
if (isLowSurrogate(c2)) {
if (index > 0) {
char c1 = seq.charAt(--index);
if (isHighSurrogate(c1)) {
return toCodePoint(c1, c2);
... | [
"public",
"static",
"final",
"int",
"codePointBefore",
"(",
"CharSequence",
"seq",
",",
"int",
"index",
")",
"{",
"char",
"c2",
"=",
"seq",
".",
"charAt",
"(",
"--",
"index",
")",
";",
"if",
"(",
"isLowSurrogate",
"(",
"c2",
")",
")",
"{",
"if",
"(",... | Same as {@link Character#codePointBefore(CharSequence, int)}.
Return the code point before index.
This examines only the characters at index-1 and index-2.
@param seq the characters to check
@param index the index after the last or only char forming the code point
@return the code point before the index | [
"Same",
"as",
"{",
"@link",
"Character#codePointBefore",
"(",
"CharSequence",
"int",
")",
"}",
".",
"Return",
"the",
"code",
"point",
"before",
"index",
".",
"This",
"examines",
"only",
"the",
"characters",
"at",
"index",
"-",
"1",
"and",
"index",
"-",
"2"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L5392-L5403 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.groupByField | public static <T> List<List<T>> groupByField(Collection<T> collection, final String fieldName) {
return group(collection, new Hash<T>() {
private List<Object> fieldNameList = new ArrayList<>();
@Override
public int hash(T t) {
if (null == t || false == BeanUtil.isBean(t.getClass())) {
// 非Be... | java | public static <T> List<List<T>> groupByField(Collection<T> collection, final String fieldName) {
return group(collection, new Hash<T>() {
private List<Object> fieldNameList = new ArrayList<>();
@Override
public int hash(T t) {
if (null == t || false == BeanUtil.isBean(t.getClass())) {
// 非Be... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"List",
"<",
"T",
">",
">",
"groupByField",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"final",
"String",
"fieldName",
")",
"{",
"return",
"group",
"(",
"collection",
",",
"new",
"Hash",
"<",
... | 根据元素的指定字段名分组,非Bean都放在第一个分组中
@param <T> 元素类型
@param collection 集合
@param fieldName 元素Bean中的字段名,非Bean都放在第一个分组中
@return 分组列表 | [
"根据元素的指定字段名分组,非Bean都放在第一个分组中"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L2330-L2350 |
FitLayout/classify | src/main/java/org/fit/layout/classify/VisualClassifier.java | VisualClassifier.classifyTree | public void classifyTree(Area root, FeatureExtractor features)
{
if (classifier != null)
{
System.out.print("tree visual classification...");
testRoot = root;
this.features = features;
//create a new empty set with the same header as the training set
testset = new... | java | public void classifyTree(Area root, FeatureExtractor features)
{
if (classifier != null)
{
System.out.print("tree visual classification...");
testRoot = root;
this.features = features;
//create a new empty set with the same header as the training set
testset = new... | [
"public",
"void",
"classifyTree",
"(",
"Area",
"root",
",",
"FeatureExtractor",
"features",
")",
"{",
"if",
"(",
"classifier",
"!=",
"null",
")",
"{",
"System",
".",
"out",
".",
"print",
"(",
"\"tree visual classification...\"",
")",
";",
"testRoot",
"=",
"r... | Classifies the areas in an area tree.
@param root the root node of the area tree | [
"Classifies",
"the",
"areas",
"in",
"an",
"area",
"tree",
"."
] | train | https://github.com/FitLayout/classify/blob/0b43ceb2f0be4e6d26263491893884d811f0d605/src/main/java/org/fit/layout/classify/VisualClassifier.java#L56-L71 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newApplicationException | public static ApplicationException newApplicationException(Throwable cause, String message, Object... args) {
return new ApplicationException(format(message, args), cause);
} | java | public static ApplicationException newApplicationException(Throwable cause, String message, Object... args) {
return new ApplicationException(format(message, args), cause);
} | [
"public",
"static",
"ApplicationException",
"newApplicationException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"ApplicationException",
"(",
"format",
"(",
"message",
",",
"args",
")",
",",
"ca... | Constructs and initializes a new {@link ApplicationException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link ApplicationException} was thrown.
@param message {@link String} descri... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"ApplicationException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Obj... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L775-L777 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/ByteArrayUtil.java | ByteArrayUtil.putShortBE | public static void putShortBE(final byte[] array, final int offset, final short value) {
array[offset + 1] = (byte) (value );
array[offset ] = (byte) (value >>> 8);
} | java | public static void putShortBE(final byte[] array, final int offset, final short value) {
array[offset + 1] = (byte) (value );
array[offset ] = (byte) (value >>> 8);
} | [
"public",
"static",
"void",
"putShortBE",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"final",
"short",
"value",
")",
"{",
"array",
"[",
"offset",
"+",
"1",
"]",
"=",
"(",
"byte",
")",
"(",
"value",
")",
";",
"array... | Put the source <i>short</i> into the destination byte array starting at the given offset
in big endian order.
There is no bounds checking.
@param array destination byte array
@param offset destination offset
@param value source <i>short</i> | [
"Put",
"the",
"source",
"<i",
">",
"short<",
"/",
"i",
">",
"into",
"the",
"destination",
"byte",
"array",
"starting",
"at",
"the",
"given",
"offset",
"in",
"big",
"endian",
"order",
".",
"There",
"is",
"no",
"bounds",
"checking",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/ByteArrayUtil.java#L52-L55 |
elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java | KernelMatrix.getSimilarity | public double getSimilarity(DBIDRef id1, DBIDRef id2) {
return kernel[idmap.getOffset(id1)][idmap.getOffset(id2)];
} | java | public double getSimilarity(DBIDRef id1, DBIDRef id2) {
return kernel[idmap.getOffset(id1)][idmap.getOffset(id2)];
} | [
"public",
"double",
"getSimilarity",
"(",
"DBIDRef",
"id1",
",",
"DBIDRef",
"id2",
")",
"{",
"return",
"kernel",
"[",
"idmap",
".",
"getOffset",
"(",
"id1",
")",
"]",
"[",
"idmap",
".",
"getOffset",
"(",
"id2",
")",
"]",
";",
"}"
] | Get the kernel similarity for the given objects.
@param id1 First object
@param id2 Second object
@return Similarity. | [
"Get",
"the",
"kernel",
"similarity",
"for",
"the",
"given",
"objects",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/similarityfunction/kernel/KernelMatrix.java#L272-L274 |
jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java | StandardCache.createCache | public static <K, V> Cache<K, V> createCache(String cacheName, int ttl, long cleanupInterval/*, Application application, Layer layer*/) {
StandardCache cache = new StandardCache(ttl, cleanupInterval);
cache.setProperties(new Properties());
cache.start();
return cache;
} | java | public static <K, V> Cache<K, V> createCache(String cacheName, int ttl, long cleanupInterval/*, Application application, Layer layer*/) {
StandardCache cache = new StandardCache(ttl, cleanupInterval);
cache.setProperties(new Properties());
cache.start();
return cache;
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Cache",
"<",
"K",
",",
"V",
">",
"createCache",
"(",
"String",
"cacheName",
",",
"int",
"ttl",
",",
"long",
"cleanupInterval",
"/*, Application application, Layer layer*/",
")",
"{",
"StandardCache",
"cache",
"=",
... | Retrieves a cache from the current layer or creates it.
Only a root request will be able to embed the constructed cache in the
application.
@param cacheName cache service ID
@param ttl time to live in seconds
@param cleanupInterval cleanup interval in seconds
@return | [
"Retrieves",
"a",
"cache",
"from",
"the",
"current",
"layer",
"or",
"creates",
"it",
".",
"Only",
"a",
"root",
"request",
"will",
"be",
"able",
"to",
"embed",
"the",
"constructed",
"cache",
"in",
"the",
"application",
"."
] | train | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/caching/module/StandardCache.java#L418-L423 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/locking/CommonsOJBLockManager.java | CommonsOJBLockManager.createIsolationLevel | public OJBLock createIsolationLevel(Object resourceId, Object isolationId, LoggerFacade logger)
{
OJBLock result = null;
switch(((Integer) isolationId).intValue())
{
case LockManager.IL_READ_UNCOMMITTED:
result = new ReadUncommittedLock(resourceId, logger);
... | java | public OJBLock createIsolationLevel(Object resourceId, Object isolationId, LoggerFacade logger)
{
OJBLock result = null;
switch(((Integer) isolationId).intValue())
{
case LockManager.IL_READ_UNCOMMITTED:
result = new ReadUncommittedLock(resourceId, logger);
... | [
"public",
"OJBLock",
"createIsolationLevel",
"(",
"Object",
"resourceId",
",",
"Object",
"isolationId",
",",
"LoggerFacade",
"logger",
")",
"{",
"OJBLock",
"result",
"=",
"null",
";",
"switch",
"(",
"(",
"(",
"Integer",
")",
"isolationId",
")",
".",
"intValue"... | Creates {@link org.apache.commons.transaction.locking.GenericLock} based
{@link org.apache.commons.transaction.locking.MultiLevelLock2} instances
dependend on the specified isolation identity object. | [
"Creates",
"{"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/locking/CommonsOJBLockManager.java#L193-L216 |
mockito/mockito | src/main/java/org/mockito/ArgumentMatchers.java | ArgumentMatchers.refEq | public static <T> T refEq(T value, String... excludeFields) {
reportMatcher(new ReflectionEquals(value, excludeFields));
return null;
} | java | public static <T> T refEq(T value, String... excludeFields) {
reportMatcher(new ReflectionEquals(value, excludeFields));
return null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"refEq",
"(",
"T",
"value",
",",
"String",
"...",
"excludeFields",
")",
"{",
"reportMatcher",
"(",
"new",
"ReflectionEquals",
"(",
"value",
",",
"excludeFields",
")",
")",
";",
"return",
"null",
";",
"}"
] | Object argument that is reflection-equal to the given value with support for excluding
selected fields from a class.
<p>
This matcher can be used when equals() is not implemented on compared objects.
Matcher uses java reflection API to compare fields of wanted and actual object.
</p>
<p>
Works similarly to <code>Equa... | [
"Object",
"argument",
"that",
"is",
"reflection",
"-",
"equal",
"to",
"the",
"given",
"value",
"with",
"support",
"for",
"excluding",
"selected",
"fields",
"from",
"a",
"class",
"."
] | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/ArgumentMatchers.java#L937-L940 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/multi/spatioTemporal/paths/TrajectoryEnvelopeSolver.java | TrajectoryEnvelopeSolver.createEnvelopes | public HashMap<Integer,ArrayList<TrajectoryEnvelope>> createEnvelopes(int firstRobotID, Trajectory ... trajectories) {
//Default footprint, 2.7 (w) x 6.6 (l)
Coordinate frontLeft = new Coordinate(5.3, 1.35);
Coordinate frontRight = new Coordinate(5.3, -1.35);
Coordinate backRight = new Coordinate(-1.3, -1.35);
... | java | public HashMap<Integer,ArrayList<TrajectoryEnvelope>> createEnvelopes(int firstRobotID, Trajectory ... trajectories) {
//Default footprint, 2.7 (w) x 6.6 (l)
Coordinate frontLeft = new Coordinate(5.3, 1.35);
Coordinate frontRight = new Coordinate(5.3, -1.35);
Coordinate backRight = new Coordinate(-1.3, -1.35);
... | [
"public",
"HashMap",
"<",
"Integer",
",",
"ArrayList",
"<",
"TrajectoryEnvelope",
">",
">",
"createEnvelopes",
"(",
"int",
"firstRobotID",
",",
"Trajectory",
"...",
"trajectories",
")",
"{",
"//Default footprint, 2.7 (w) x 6.6 (l)",
"Coordinate",
"frontLeft",
"=",
"ne... | Create a trajectory envelope for each given {@link Trajectory}. Robot IDs are assigned starting from the given
integer. This method creates three envelopes for each {@link Trajectory}:
the main {@link TrajectoryEnvelope} covering the path; one {@link TrajectoryEnvelope} for the starting position
of the robot; and one o... | [
"Create",
"a",
"trajectory",
"envelope",
"for",
"each",
"given",
"{"
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/multi/spatioTemporal/paths/TrajectoryEnvelopeSolver.java#L362-L372 |
qiniu/java-sdk | src/main/java/com/qiniu/cdn/CdnManager.java | CdnManager.getCdnLogList | public CdnResult.LogListResult getCdnLogList(String[] domains, String logDate) throws QiniuException {
HashMap<String, String> req = new HashMap<>();
req.put("domains", StringUtils.join(domains, ";"));
req.put("day", logDate);
byte[] body = Json.encode(req).getBytes(Constants.UTF_8);
... | java | public CdnResult.LogListResult getCdnLogList(String[] domains, String logDate) throws QiniuException {
HashMap<String, String> req = new HashMap<>();
req.put("domains", StringUtils.join(domains, ";"));
req.put("day", logDate);
byte[] body = Json.encode(req).getBytes(Constants.UTF_8);
... | [
"public",
"CdnResult",
".",
"LogListResult",
"getCdnLogList",
"(",
"String",
"[",
"]",
"domains",
",",
"String",
"logDate",
")",
"throws",
"QiniuException",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"req",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";... | 获取CDN域名访问日志的下载链接,具体下载操作请自行根据链接下载
参考文档:<a href="http://developer.qiniu.com/fusion/api/download-the-log">日志下载</a>
@param domains 待获取日志下载信息的域名列表
@param logDate 待获取日志的具体日期,格式为:2017-02-18
@return 获取日志下载链接的回复 | [
"获取CDN域名访问日志的下载链接,具体下载操作请自行根据链接下载",
"参考文档:<a",
"href",
"=",
"http",
":",
"//",
"developer",
".",
"qiniu",
".",
"com",
"/",
"fusion",
"/",
"api",
"/",
"download",
"-",
"the",
"-",
"log",
">",
"日志下载<",
"/",
"a",
">"
] | train | https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/cdn/CdnManager.java#L195-L205 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java | BigtableClusterUtilities.getClusterSize | @Deprecated
public int getClusterSize(String clusterId, String zoneId) {
Cluster cluster = getCluster(clusterId, zoneId);
String message = String.format("Cluster %s/%s was not found.", clusterId, zoneId);
Preconditions.checkNotNull(cluster, message);
return cluster.getServeNodes();
} | java | @Deprecated
public int getClusterSize(String clusterId, String zoneId) {
Cluster cluster = getCluster(clusterId, zoneId);
String message = String.format("Cluster %s/%s was not found.", clusterId, zoneId);
Preconditions.checkNotNull(cluster, message);
return cluster.getServeNodes();
} | [
"@",
"Deprecated",
"public",
"int",
"getClusterSize",
"(",
"String",
"clusterId",
",",
"String",
"zoneId",
")",
"{",
"Cluster",
"cluster",
"=",
"getCluster",
"(",
"clusterId",
",",
"zoneId",
")",
";",
"String",
"message",
"=",
"String",
".",
"format",
"(",
... | Gets the serve node count of the cluster.
@param clusterId
@param zoneId
@return the {@link Cluster#getServeNodes()} of the clusterId.
@deprecated Use {@link #getCluster(String, String)} or {@link #getSingleCluster()} and then
call {@link Cluster#getServeNodes()}. | [
"Gets",
"the",
"serve",
"node",
"count",
"of",
"the",
"cluster",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java#L167-L173 |
jbundle/jbundle | base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/local/LocalMessageTransport.java | LocalMessageTransport.sendMessageRequest | public BaseMessage sendMessageRequest(BaseMessage messageOut)
{
TrxMessageHeader trxMessageHeader = (TrxMessageHeader)messageOut.getMessageHeader();
String strTrxID = (String)trxMessageHeader.get(TrxMessageHeader.LOG_TRX_ID);
try {
// Create a fake Incoming message with this mess... | java | public BaseMessage sendMessageRequest(BaseMessage messageOut)
{
TrxMessageHeader trxMessageHeader = (TrxMessageHeader)messageOut.getMessageHeader();
String strTrxID = (String)trxMessageHeader.get(TrxMessageHeader.LOG_TRX_ID);
try {
// Create a fake Incoming message with this mess... | [
"public",
"BaseMessage",
"sendMessageRequest",
"(",
"BaseMessage",
"messageOut",
")",
"{",
"TrxMessageHeader",
"trxMessageHeader",
"=",
"(",
"TrxMessageHeader",
")",
"messageOut",
".",
"getMessageHeader",
"(",
")",
";",
"String",
"strTrxID",
"=",
"(",
"String",
")",... | Send the message and (optionally) get the reply.
@param messageOut The message to send to be processed.
@return The reply message (or null if none). | [
"Send",
"the",
"message",
"and",
"(",
"optionally",
")",
"get",
"the",
"reply",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/local/LocalMessageTransport.java#L95-L129 |
networknt/light-4j | client/src/main/java/com/networknt/client/ssl/APINameChecker.java | APINameChecker.verifyAndThrow | public static void verifyAndThrow(final Set<String> nameSet, final X509Certificate cert) throws CertificateException{
if (!verify(nameSet, cert)) {
throw new CertificateException("No name matching " + nameSet + " found");
}
} | java | public static void verifyAndThrow(final Set<String> nameSet, final X509Certificate cert) throws CertificateException{
if (!verify(nameSet, cert)) {
throw new CertificateException("No name matching " + nameSet + " found");
}
} | [
"public",
"static",
"void",
"verifyAndThrow",
"(",
"final",
"Set",
"<",
"String",
">",
"nameSet",
",",
"final",
"X509Certificate",
"cert",
")",
"throws",
"CertificateException",
"{",
"if",
"(",
"!",
"verify",
"(",
"nameSet",
",",
"cert",
")",
")",
"{",
"th... | Perform server identify check using given names and throw CertificateException if the check fails.
@param nameSet - a set of names from the config file
@param cert - the server certificate
@throws CertificateException - throws CertificateException if none of the name in the nameSet matches the names in the cert | [
"Perform",
"server",
"identify",
"check",
"using",
"given",
"names",
"and",
"throw",
"CertificateException",
"if",
"the",
"check",
"fails",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/ssl/APINameChecker.java#L41-L45 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/MCWrapper.java | MCWrapper.enlistRRSXAResource | final XAResource enlistRRSXAResource(int recoveryId, int branchCoupling) throws Exception {
RRSXAResourceFactory xaFactory = (RRSXAResourceFactory) pm.connectorSvc.rrsXAResFactorySvcRef.getService();
// Make sure that the bundle is active.
if (xaFactory == null) {
throw new IllegalS... | java | final XAResource enlistRRSXAResource(int recoveryId, int branchCoupling) throws Exception {
RRSXAResourceFactory xaFactory = (RRSXAResourceFactory) pm.connectorSvc.rrsXAResFactorySvcRef.getService();
// Make sure that the bundle is active.
if (xaFactory == null) {
throw new IllegalS... | [
"final",
"XAResource",
"enlistRRSXAResource",
"(",
"int",
"recoveryId",
",",
"int",
"branchCoupling",
")",
"throws",
"Exception",
"{",
"RRSXAResourceFactory",
"xaFactory",
"=",
"(",
"RRSXAResourceFactory",
")",
"pm",
".",
"connectorSvc",
".",
"rrsXAResFactorySvcRef",
... | Enlists a RRS XA resource with the transaction manager.
@param recoveryId The recovery id representing the registration of the resource with
the transaction manager.
@param branchCoupling The resource's branch coupling support indicator.
@return The XA resource enlisted with the transaction manager.
@throws Exce... | [
"Enlists",
"a",
"RRS",
"XA",
"resource",
"with",
"the",
"transaction",
"manager",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/MCWrapper.java#L474-L508 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.createEntityRoleWithServiceResponseAsync | public Observable<ServiceResponse<UUID>> createEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreateEntityRoleOptionalParameter createEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoi... | java | public Observable<ServiceResponse<UUID>> createEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreateEntityRoleOptionalParameter createEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoi... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"UUID",
">",
">",
"createEntityRoleWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"CreateEntityRoleOptionalParameter",
"createEntityRoleOptionalParameter",
")",
... | Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity model ID.
@param createEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thro... | [
"Create",
"an",
"entity",
"role",
"for",
"an",
"entity",
"in",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L7800-L7816 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/Timing.java | Timing.report | public long report(String str, PrintWriter writer) {
long elapsed = this.report();
writer.println(str + " Time elapsed: " + (elapsed) + " ms");
return elapsed;
} | java | public long report(String str, PrintWriter writer) {
long elapsed = this.report();
writer.println(str + " Time elapsed: " + (elapsed) + " ms");
return elapsed;
} | [
"public",
"long",
"report",
"(",
"String",
"str",
",",
"PrintWriter",
"writer",
")",
"{",
"long",
"elapsed",
"=",
"this",
".",
"report",
"(",
")",
";",
"writer",
".",
"println",
"(",
"str",
"+",
"\" Time elapsed: \"",
"+",
"(",
"elapsed",
")",
"+",
"\"... | Print elapsed time (without stopping timer).
@param str Additional prefix string to be printed
@param writer PrintWriter on which to write output
@return Number of milliseconds elapsed | [
"Print",
"elapsed",
"time",
"(",
"without",
"stopping",
"timer",
")",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/Timing.java#L89-L93 |
alkacon/opencms-core | src/org/opencms/cache/CmsVfsMemoryObjectCache.java | CmsVfsMemoryObjectCache.loadVfsObject | public Object loadVfsObject(CmsObject cms, String rootPath, Transformer function) {
Object result = getCachedObject(cms, rootPath);
if (result == null) {
result = function.transform(rootPath);
putCachedObject(cms, rootPath, result);
}
return result;
} | java | public Object loadVfsObject(CmsObject cms, String rootPath, Transformer function) {
Object result = getCachedObject(cms, rootPath);
if (result == null) {
result = function.transform(rootPath);
putCachedObject(cms, rootPath, result);
}
return result;
} | [
"public",
"Object",
"loadVfsObject",
"(",
"CmsObject",
"cms",
",",
"String",
"rootPath",
",",
"Transformer",
"function",
")",
"{",
"Object",
"result",
"=",
"getCachedObject",
"(",
"cms",
",",
"rootPath",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{... | Uses a transformer for loading an object from a path if it has not already been cached, and then caches it.<p>
@param cms the CMS context
@param rootPath the root path from which the object should be loaded
@param function the function which should load the object from VFS if it isn't already cached
@return the loade... | [
"Uses",
"a",
"transformer",
"for",
"loading",
"an",
"object",
"from",
"a",
"path",
"if",
"it",
"has",
"not",
"already",
"been",
"cached",
"and",
"then",
"caches",
"it",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cache/CmsVfsMemoryObjectCache.java#L105-L113 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsShowResourceTable.java | CmsShowResourceTable.getPrincipal | private CmsPrincipal getPrincipal(CmsObject cms, DialogType type, CmsUUID id) throws CmsException {
if (type.equals(DialogType.Group)) {
return cms.readGroup(id);
}
if (type.equals(DialogType.User)) {
return cms.readUser(id);
}
return null;
} | java | private CmsPrincipal getPrincipal(CmsObject cms, DialogType type, CmsUUID id) throws CmsException {
if (type.equals(DialogType.Group)) {
return cms.readGroup(id);
}
if (type.equals(DialogType.User)) {
return cms.readUser(id);
}
return null;
} | [
"private",
"CmsPrincipal",
"getPrincipal",
"(",
"CmsObject",
"cms",
",",
"DialogType",
"type",
",",
"CmsUUID",
"id",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"type",
".",
"equals",
"(",
"DialogType",
".",
"Group",
")",
")",
"{",
"return",
"cms",
".",... | Get principal from id.<p>
@param cms CmsObject
@param type user or group
@param id id of principal
@return Principal
@throws CmsException exception | [
"Get",
"principal",
"from",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsShowResourceTable.java#L299-L308 |
ebourgeois/common-java | src/main/java/ca/jeb/common/infra/JReflectionUtils.java | JReflectionUtils.getMethodByName | public static Method getMethodByName(Class<?> clazz, String name)
{
final List<Method> methods = JReflectionUtils.getAllMethods(new ArrayList<Method>(), clazz);
for (Method method : methods)
{
if (method.getName().equals(name))
{
return method;
}
}
return null;
} | java | public static Method getMethodByName(Class<?> clazz, String name)
{
final List<Method> methods = JReflectionUtils.getAllMethods(new ArrayList<Method>(), clazz);
for (Method method : methods)
{
if (method.getName().equals(name))
{
return method;
}
}
return null;
} | [
"public",
"static",
"Method",
"getMethodByName",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"final",
"List",
"<",
"Method",
">",
"methods",
"=",
"JReflectionUtils",
".",
"getAllMethods",
"(",
"new",
"ArrayList",
"<",
"Method",
"... | Retrieve a Method object with the provided <i>name</i> on the class, <i>clazz</i>.
@param clazz
@param name
@return Method | [
"Retrieve",
"a",
"Method",
"object",
"with",
"the",
"provided",
"<i",
">",
"name<",
"/",
"i",
">",
"on",
"the",
"class",
"<i",
">",
"clazz<",
"/",
"i",
">",
"."
] | train | https://github.com/ebourgeois/common-java/blob/8ba7e05b1228aad1ec2949b5707ac4b5e8889f92/src/main/java/ca/jeb/common/infra/JReflectionUtils.java#L193-L205 |
otto-de/edison-microservice | edison-mongo/src/main/java/de/otto/edison/mongo/AbstractMongoRepository.java | AbstractMongoRepository.byId | protected Document byId(final K key) {
if (key != null) {
return new Document(ID, key.toString());
} else {
throw new NullPointerException("Key must not be null");
}
} | java | protected Document byId(final K key) {
if (key != null) {
return new Document(ID, key.toString());
} else {
throw new NullPointerException("Key must not be null");
}
} | [
"protected",
"Document",
"byId",
"(",
"final",
"K",
"key",
")",
"{",
"if",
"(",
"key",
"!=",
"null",
")",
"{",
"return",
"new",
"Document",
"(",
"ID",
",",
"key",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"NullPointerEx... | Returns a query that is selecting documents by ID.
@param key the document's key
@return query Document | [
"Returns",
"a",
"query",
"that",
"is",
"selecting",
"documents",
"by",
"ID",
"."
] | train | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-mongo/src/main/java/de/otto/edison/mongo/AbstractMongoRepository.java#L323-L329 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectPool.java | ObjectPool.getInstance | public synchronized Object getInstance()
{
// Check if the pool is empty.
if (freeStack.isEmpty())
{
// Create a new object if so.
try
{
return objectType.newInstance();
}
catch (InstantiationException ex){}
catch (IllegalAccessException ex){}
// Throw ... | java | public synchronized Object getInstance()
{
// Check if the pool is empty.
if (freeStack.isEmpty())
{
// Create a new object if so.
try
{
return objectType.newInstance();
}
catch (InstantiationException ex){}
catch (IllegalAccessException ex){}
// Throw ... | [
"public",
"synchronized",
"Object",
"getInstance",
"(",
")",
"{",
"// Check if the pool is empty.",
"if",
"(",
"freeStack",
".",
"isEmpty",
"(",
")",
")",
"{",
"// Create a new object if so.",
"try",
"{",
"return",
"objectType",
".",
"newInstance",
"(",
")",
";",
... | Get an instance of the given object in this pool
@return An instance of the given object | [
"Get",
"an",
"instance",
"of",
"the",
"given",
"object",
"in",
"this",
"pool"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/ObjectPool.java#L126-L152 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java | ConcatVectorNamespace.ensureSparseFeature | public int ensureSparseFeature(String featureName, String index) {
ensureFeature(featureName);
ObjectIntMap<String> sparseIndex = sparseFeatureIndex.get(featureName);
IntObjectMap<String> reverseSparseIndex = reverseSparseFeatureIndex.get(featureName);
if (sparseIndex == null || reverseS... | java | public int ensureSparseFeature(String featureName, String index) {
ensureFeature(featureName);
ObjectIntMap<String> sparseIndex = sparseFeatureIndex.get(featureName);
IntObjectMap<String> reverseSparseIndex = reverseSparseFeatureIndex.get(featureName);
if (sparseIndex == null || reverseS... | [
"public",
"int",
"ensureSparseFeature",
"(",
"String",
"featureName",
",",
"String",
"index",
")",
"{",
"ensureFeature",
"(",
"featureName",
")",
";",
"ObjectIntMap",
"<",
"String",
">",
"sparseIndex",
"=",
"sparseFeatureIndex",
".",
"get",
"(",
"featureName",
"... | An optimization, this lets clients inform the ConcatVectorNamespace of how many sparse feature components to
expect, again so that we can avoid resizing ConcatVectors.
@param featureName the feature to use in our index
@param index the sparse value to ensure is available | [
"An",
"optimization",
"this",
"lets",
"clients",
"inform",
"the",
"ConcatVectorNamespace",
"of",
"how",
"many",
"sparse",
"feature",
"components",
"to",
"expect",
"again",
"so",
"that",
"we",
"can",
"avoid",
"resizing",
"ConcatVectors",
"."
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java#L85-L114 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.getPropertiesFromComputeNode | public void getPropertiesFromComputeNode(String poolId, String nodeId, String filePath) {
getPropertiesFromComputeNodeWithServiceResponseAsync(poolId, nodeId, filePath).toBlocking().single().body();
} | java | public void getPropertiesFromComputeNode(String poolId, String nodeId, String filePath) {
getPropertiesFromComputeNodeWithServiceResponseAsync(poolId, nodeId, filePath).toBlocking().single().body();
} | [
"public",
"void",
"getPropertiesFromComputeNode",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"filePath",
")",
"{",
"getPropertiesFromComputeNodeWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
",",
"filePath",
")",
".",
"toBlocking",
"(",... | Gets the properties of the specified compute node file.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node that contains the file.
@param filePath The path to the compute node file that you want to get the properties of.
@throws IllegalArgumentException thrown if ... | [
"Gets",
"the",
"properties",
"of",
"the",
"specified",
"compute",
"node",
"file",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L1366-L1368 |
jbundle/jbundle | main/db/src/main/java/org/jbundle/main/user/db/SetupNewUserHandler.java | SetupNewUserHandler.doRecordChange | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
{
if (iChangeType == DBConstants.AFTER_ADD_TYPE)
{
UserInfo userTemplate = this.getUserTemplate();
if (userTemplate != null)
{
Record userInfo = this.getOwner();
... | java | public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
{
if (iChangeType == DBConstants.AFTER_ADD_TYPE)
{
UserInfo userTemplate = this.getUserTemplate();
if (userTemplate != null)
{
Record userInfo = this.getOwner();
... | [
"public",
"int",
"doRecordChange",
"(",
"FieldInfo",
"field",
",",
"int",
"iChangeType",
",",
"boolean",
"bDisplayOption",
")",
"{",
"if",
"(",
"iChangeType",
"==",
"DBConstants",
".",
"AFTER_ADD_TYPE",
")",
"{",
"UserInfo",
"userTemplate",
"=",
"this",
".",
"... | Called when a change is the record status is about to happen/has happened.
@param field If this file change is due to a field, this is the field.
@param iChangeType The type of change that occurred.
@param bDisplayOption If true, display any changes.
@return an error code.
ADD_TYPE - Before a write.
UPDATE_TYPE - Befor... | [
"Called",
"when",
"a",
"change",
"is",
"the",
"record",
"status",
"is",
"about",
"to",
"happen",
"/",
"has",
"happened",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/db/src/main/java/org/jbundle/main/user/db/SetupNewUserHandler.java#L98-L127 |
JCTools/JCTools | jctools-experimental/src/main/java/org/jctools/queues/MpscRelaxedArrayQueue.java | MpscRelaxedArrayQueue.validateSlowProducerOverClaim | private void validateSlowProducerOverClaim(final int activeCycleIndex, final long producerCycleClaim)
{
//the cycle claim is now ok?
final long producerPosition = producerPositionFromClaim(
producerCycleClaim,
positionWithinCycleMask,
cycleIdBitShift,
... | java | private void validateSlowProducerOverClaim(final int activeCycleIndex, final long producerCycleClaim)
{
//the cycle claim is now ok?
final long producerPosition = producerPositionFromClaim(
producerCycleClaim,
positionWithinCycleMask,
cycleIdBitShift,
... | [
"private",
"void",
"validateSlowProducerOverClaim",
"(",
"final",
"int",
"activeCycleIndex",
",",
"final",
"long",
"producerCycleClaim",
")",
"{",
"//the cycle claim is now ok?",
"final",
"long",
"producerPosition",
"=",
"producerPositionFromClaim",
"(",
"producerCycleClaim",... | Validates a slow producer over-claim throwing {@link IllegalStateException} if the offer on it can't continue. | [
"Validates",
"a",
"slow",
"producer",
"over",
"-",
"claim",
"throwing",
"{"
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-experimental/src/main/java/org/jctools/queues/MpscRelaxedArrayQueue.java#L438-L465 |
undertow-io/undertow | servlet/src/main/java/io/undertow/servlet/api/DeploymentInfo.java | DeploymentInfo.addFirstAuthenticationMechanism | public DeploymentInfo addFirstAuthenticationMechanism(final String name, final AuthenticationMechanism mechanism) {
authenticationMechanisms.put(name, new ImmediateAuthenticationMechanismFactory(mechanism));
if(loginConfig == null) {
loginConfig = new LoginConfig(null);
}
log... | java | public DeploymentInfo addFirstAuthenticationMechanism(final String name, final AuthenticationMechanism mechanism) {
authenticationMechanisms.put(name, new ImmediateAuthenticationMechanismFactory(mechanism));
if(loginConfig == null) {
loginConfig = new LoginConfig(null);
}
log... | [
"public",
"DeploymentInfo",
"addFirstAuthenticationMechanism",
"(",
"final",
"String",
"name",
",",
"final",
"AuthenticationMechanism",
"mechanism",
")",
"{",
"authenticationMechanisms",
".",
"put",
"(",
"name",
",",
"new",
"ImmediateAuthenticationMechanismFactory",
"(",
... | Adds an authentication mechanism directly to the deployment. This mechanism will be first in the list.
In general you should just use {@link #addAuthenticationMechanism(String, io.undertow.security.api.AuthenticationMechanismFactory)}
and allow the user to configure the methods they want by name.
This method is essen... | [
"Adds",
"an",
"authentication",
"mechanism",
"directly",
"to",
"the",
"deployment",
".",
"This",
"mechanism",
"will",
"be",
"first",
"in",
"the",
"list",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/servlet/src/main/java/io/undertow/servlet/api/DeploymentInfo.java#L1007-L1014 |
Alluxio/alluxio | core/base/src/main/java/alluxio/util/io/PathUtils.java | PathUtils.normalizePath | public static String normalizePath(String path, String separator) {
return path.endsWith(separator) ? path : path + separator;
} | java | public static String normalizePath(String path, String separator) {
return path.endsWith(separator) ? path : path + separator;
} | [
"public",
"static",
"String",
"normalizePath",
"(",
"String",
"path",
",",
"String",
"separator",
")",
"{",
"return",
"path",
".",
"endsWith",
"(",
"separator",
")",
"?",
"path",
":",
"path",
"+",
"separator",
";",
"}"
] | Adds a trailing separator if it does not exist in path.
@param path the file name
@param separator trailing separator to add
@return updated path with trailing separator | [
"Adds",
"a",
"trailing",
"separator",
"if",
"it",
"does",
"not",
"exist",
"in",
"path",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/io/PathUtils.java#L288-L290 |
line/armeria | saml/src/main/java/com/linecorp/armeria/server/saml/HttpRedirectBindingUtil.java | HttpRedirectBindingUtil.validateSignature | private static void validateSignature(Credential validationCredential,
SamlParameters parameters,
String messageParamName) {
requireNonNull(validationCredential, "validationCredential");
requireNonNull(parameters, "param... | java | private static void validateSignature(Credential validationCredential,
SamlParameters parameters,
String messageParamName) {
requireNonNull(validationCredential, "validationCredential");
requireNonNull(parameters, "param... | [
"private",
"static",
"void",
"validateSignature",
"(",
"Credential",
"validationCredential",
",",
"SamlParameters",
"parameters",
",",
"String",
"messageParamName",
")",
"{",
"requireNonNull",
"(",
"validationCredential",
",",
"\"validationCredential\"",
")",
";",
"requir... | Validates a signature in the specified {@link AggregatedHttpMessage}. | [
"Validates",
"a",
"signature",
"in",
"the",
"specified",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/saml/src/main/java/com/linecorp/armeria/server/saml/HttpRedirectBindingUtil.java#L132-L166 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createDeployKey | public GitlabSSHKey createDeployKey(Integer targetProjectId, String title, String key) throws IOException {
return createDeployKey(targetProjectId, title, key, false);
} | java | public GitlabSSHKey createDeployKey(Integer targetProjectId, String title, String key) throws IOException {
return createDeployKey(targetProjectId, title, key, false);
} | [
"public",
"GitlabSSHKey",
"createDeployKey",
"(",
"Integer",
"targetProjectId",
",",
"String",
"title",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"return",
"createDeployKey",
"(",
"targetProjectId",
",",
"title",
",",
"key",
",",
"false",
")",
";"... | Create a new deploy key for the project
@param targetProjectId The id of the Gitlab project
@param title The title of the ssh key
@param key The public key
@return The new GitlabSSHKey
@throws IOException on gitlab api call error | [
"Create",
"a",
"new",
"deploy",
"key",
"for",
"the",
"project"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3167-L3169 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/OutputsInner.java | OutputsInner.createOrReplace | public OutputInner createOrReplace(String resourceGroupName, String jobName, String outputName, OutputInner output, String ifMatch, String ifNoneMatch) {
return createOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, outputName, output, ifMatch, ifNoneMatch).toBlocking().single().body();
} | java | public OutputInner createOrReplace(String resourceGroupName, String jobName, String outputName, OutputInner output, String ifMatch, String ifNoneMatch) {
return createOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, outputName, output, ifMatch, ifNoneMatch).toBlocking().single().body();
} | [
"public",
"OutputInner",
"createOrReplace",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"outputName",
",",
"OutputInner",
"output",
",",
"String",
"ifMatch",
",",
"String",
"ifNoneMatch",
")",
"{",
"return",
"createOrReplaceWithService... | Creates an output or replaces an already existing output under an existing streaming job.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param jobName The name of the streaming job.
@param outputName The ... | [
"Creates",
"an",
"output",
"or",
"replaces",
"an",
"already",
"existing",
"output",
"under",
"an",
"existing",
"streaming",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/OutputsInner.java#L214-L216 |
overturetool/overture | ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java | CharOperation.trim | final static public char[] trim(char[] chars)
{
if (chars == null)
{
return null;
}
int start = 0, length = chars.length, end = length - 1;
while (start < length && chars[start] == ' ')
{
start++;
}
while (end > start && chars[end] == ' ')
{
end--;
}
if (start != 0 || end != length - 1... | java | final static public char[] trim(char[] chars)
{
if (chars == null)
{
return null;
}
int start = 0, length = chars.length, end = length - 1;
while (start < length && chars[start] == ' ')
{
start++;
}
while (end > start && chars[end] == ' ')
{
end--;
}
if (start != 0 || end != length - 1... | [
"final",
"static",
"public",
"char",
"[",
"]",
"trim",
"(",
"char",
"[",
"]",
"chars",
")",
"{",
"if",
"(",
"chars",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"start",
"=",
"0",
",",
"length",
"=",
"chars",
".",
"length",
",",
... | Answers a new array removing leading and trailing spaces (' '). Answers the given array if there is no space
characters to remove. <br>
<br>
For example:
<ol>
<li>
<pre>
chars = { ' ', 'a' , 'b', ' ', ' ' }
result => { 'a' , 'b' }
</pre>
</li>
<li>
<pre>
array = { 'A', 'b' }
result => { 'A' , 'b' }
</pre>
</... | [
"Answers",
"a",
"new",
"array",
"removing",
"leading",
"and",
"trailing",
"spaces",
"(",
")",
".",
"Answers",
"the",
"given",
"array",
"if",
"there",
"is",
"no",
"space",
"characters",
"to",
"remove",
".",
"<br",
">",
"<br",
">",
"For",
"example",
":",
... | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java#L3994-L4016 |
liferay/com-liferay-commerce | commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java | CPDefinitionVirtualSettingPersistenceImpl.findAll | @Override
public List<CPDefinitionVirtualSetting> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPDefinitionVirtualSetting> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionVirtualSetting",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp definition virtual settings.
@return the cp definition virtual settings | [
"Returns",
"all",
"the",
"cp",
"definition",
"virtual",
"settings",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java#L2386-L2389 |
alkacon/opencms-core | src/org/opencms/widgets/A_CmsHtmlWidget.java | A_CmsHtmlWidget.buildOpenCmsButtonRow | protected String buildOpenCmsButtonRow(int segment, I_CmsWidgetDialog widgetDialog) {
StringBuffer result = new StringBuffer(256);
if (segment == CmsWorkplace.HTML_START) {
// generate line and start row HTML
result.append(widgetDialog.buttonBarHorizontalLine());
re... | java | protected String buildOpenCmsButtonRow(int segment, I_CmsWidgetDialog widgetDialog) {
StringBuffer result = new StringBuffer(256);
if (segment == CmsWorkplace.HTML_START) {
// generate line and start row HTML
result.append(widgetDialog.buttonBarHorizontalLine());
re... | [
"protected",
"String",
"buildOpenCmsButtonRow",
"(",
"int",
"segment",
",",
"I_CmsWidgetDialog",
"widgetDialog",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"256",
")",
";",
"if",
"(",
"segment",
"==",
"CmsWorkplace",
".",
"HTML_START",
... | Returns the start or end HTML for the OpenCms specific button row.<p>
Use this method to generate the start and end html for the button row.<p>
Overwrite the method if the integrated editor needs a specific layout for the button row start or end html.<p>
@param segment the HTML segment (START / END)
@param widgetDia... | [
"Returns",
"the",
"start",
"or",
"end",
"HTML",
"for",
"the",
"OpenCms",
"specific",
"button",
"row",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/A_CmsHtmlWidget.java#L215-L231 |
motown-io/motown | chargingstation-configuration/view-model/src/main/java/io/motown/chargingstationconfiguration/viewmodel/domain/DomainService.java | DomainService.getEvseByIdentifier | private Evse getEvseByIdentifier(ChargingStationType chargingStationType, int identifier) {
for (Evse evse:chargingStationType.getEvses()) {
if(identifier == evse.getIdentifier()) {
return evse;
}
}
return null;
} | java | private Evse getEvseByIdentifier(ChargingStationType chargingStationType, int identifier) {
for (Evse evse:chargingStationType.getEvses()) {
if(identifier == evse.getIdentifier()) {
return evse;
}
}
return null;
} | [
"private",
"Evse",
"getEvseByIdentifier",
"(",
"ChargingStationType",
"chargingStationType",
",",
"int",
"identifier",
")",
"{",
"for",
"(",
"Evse",
"evse",
":",
"chargingStationType",
".",
"getEvses",
"(",
")",
")",
"{",
"if",
"(",
"identifier",
"==",
"evse",
... | Gets a Evse by identifier.
@param chargingStationType charging station type.
@param identifier evse identifier.
@return evse or null if not found. | [
"Gets",
"a",
"Evse",
"by",
"identifier",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/chargingstation-configuration/view-model/src/main/java/io/motown/chargingstationconfiguration/viewmodel/domain/DomainService.java#L445-L452 |
alkacon/opencms-core | src/org/opencms/widgets/CmsPrincipalWidget.java | CmsPrincipalWidget.getButtonJs | public String getButtonJs(String id, String form) {
StringBuffer buttonJs = new StringBuffer(8);
buttonJs.append("javascript:openPrincipalWin('");
buttonJs.append(OpenCms.getSystemInfo().getOpenCmsContext());
buttonJs.append("/system/workplace/commons/principal_selection.jsp");
... | java | public String getButtonJs(String id, String form) {
StringBuffer buttonJs = new StringBuffer(8);
buttonJs.append("javascript:openPrincipalWin('");
buttonJs.append(OpenCms.getSystemInfo().getOpenCmsContext());
buttonJs.append("/system/workplace/commons/principal_selection.jsp");
... | [
"public",
"String",
"getButtonJs",
"(",
"String",
"id",
",",
"String",
"form",
")",
"{",
"StringBuffer",
"buttonJs",
"=",
"new",
"StringBuffer",
"(",
"8",
")",
";",
"buttonJs",
".",
"append",
"(",
"\"javascript:openPrincipalWin('\"",
")",
";",
"buttonJs",
".",... | Returns the needed java script for the search button.<p>
@param id the id of the widget to generate the search button for
@param form the id of the form where to which the widget belongs
@return javascript code | [
"Returns",
"the",
"needed",
"java",
"script",
"for",
"the",
"search",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsPrincipalWidget.java#L94-L111 |
voldemort/voldemort | src/java/voldemort/server/scheduler/slop/SlopPusherJob.java | SlopPusherJob.isSlopDead | protected boolean isSlopDead(Cluster cluster, Set<String> storeNames, Slop slop) {
// destination node , no longer exists
if(!cluster.getNodeIds().contains(slop.getNodeId())) {
return true;
}
// destination store, no longer exists
if(!storeNames.contains(slop.getStor... | java | protected boolean isSlopDead(Cluster cluster, Set<String> storeNames, Slop slop) {
// destination node , no longer exists
if(!cluster.getNodeIds().contains(slop.getNodeId())) {
return true;
}
// destination store, no longer exists
if(!storeNames.contains(slop.getStor... | [
"protected",
"boolean",
"isSlopDead",
"(",
"Cluster",
"cluster",
",",
"Set",
"<",
"String",
">",
"storeNames",
",",
"Slop",
"slop",
")",
"{",
"// destination node , no longer exists",
"if",
"(",
"!",
"cluster",
".",
"getNodeIds",
"(",
")",
".",
"contains",
"("... | A slop is dead if the destination node or the store does not exist
anymore on the cluster.
@param slop
@return | [
"A",
"slop",
"is",
"dead",
"if",
"the",
"destination",
"node",
"or",
"the",
"store",
"does",
"not",
"exist",
"anymore",
"on",
"the",
"cluster",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/scheduler/slop/SlopPusherJob.java#L52-L65 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java | ClassFinder.complete | private void complete(Symbol sym) throws CompletionFailure {
if (sym.kind == TYP) {
try {
ClassSymbol c = (ClassSymbol) sym;
dependencies.push(c, CompletionCause.CLASS_READER);
annotate.blockAnnotations();
c.members_field = new Scope.Er... | java | private void complete(Symbol sym) throws CompletionFailure {
if (sym.kind == TYP) {
try {
ClassSymbol c = (ClassSymbol) sym;
dependencies.push(c, CompletionCause.CLASS_READER);
annotate.blockAnnotations();
c.members_field = new Scope.Er... | [
"private",
"void",
"complete",
"(",
"Symbol",
"sym",
")",
"throws",
"CompletionFailure",
"{",
"if",
"(",
"sym",
".",
"kind",
"==",
"TYP",
")",
"{",
"try",
"{",
"ClassSymbol",
"c",
"=",
"(",
"ClassSymbol",
")",
"sym",
";",
"dependencies",
".",
"push",
"... | Completion for classes to be loaded. Before a class is loaded
we make sure its enclosing class (if any) is loaded. | [
"Completion",
"for",
"classes",
"to",
"be",
"loaded",
".",
"Before",
"a",
"class",
"is",
"loaded",
"we",
"make",
"sure",
"its",
"enclosing",
"class",
"(",
"if",
"any",
")",
"is",
"loaded",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/ClassFinder.java#L276-L300 |
liferay/com-liferay-commerce | commerce-api/src/main/java/com/liferay/commerce/service/persistence/CommerceRegionUtil.java | CommerceRegionUtil.findByUUID_G | public static CommerceRegion findByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.exception.NoSuchRegionException {
return getPersistence().findByUUID_G(uuid, groupId);
} | java | public static CommerceRegion findByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.exception.NoSuchRegionException {
return getPersistence().findByUUID_G(uuid, groupId);
} | [
"public",
"static",
"CommerceRegion",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"exception",
".",
"NoSuchRegionException",
"{",
"return",
"getPersistence",
"(",
")",
".",
"findByUUI... | Returns the commerce region where uuid = ? and groupId = ? or throws a {@link NoSuchRegionException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce region
@throws NoSuchRegionException if a matching commerce region could not be found | [
"Returns",
"the",
"commerce",
"region",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchRegionException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/service/persistence/CommerceRegionUtil.java#L279-L282 |
antlrjavaparser/antlr-java-parser | src/main/java/com/github/antlrjavaparser/ASTHelper.java | ASTHelper.createFieldDeclaration | public static FieldDeclaration createFieldDeclaration(int modifiers, Type type, VariableDeclarator variable) {
List<VariableDeclarator> variables = new ArrayList<VariableDeclarator>();
variables.add(variable);
FieldDeclaration ret = new FieldDeclaration(modifiers, type, variables);
retur... | java | public static FieldDeclaration createFieldDeclaration(int modifiers, Type type, VariableDeclarator variable) {
List<VariableDeclarator> variables = new ArrayList<VariableDeclarator>();
variables.add(variable);
FieldDeclaration ret = new FieldDeclaration(modifiers, type, variables);
retur... | [
"public",
"static",
"FieldDeclaration",
"createFieldDeclaration",
"(",
"int",
"modifiers",
",",
"Type",
"type",
",",
"VariableDeclarator",
"variable",
")",
"{",
"List",
"<",
"VariableDeclarator",
">",
"variables",
"=",
"new",
"ArrayList",
"<",
"VariableDeclarator",
... | Creates a {@link FieldDeclaration}.
@param modifiers
modifiers
@param type
type
@param variable
variable declarator
@return instance of {@link FieldDeclaration} | [
"Creates",
"a",
"{",
"@link",
"FieldDeclaration",
"}",
"."
] | train | https://github.com/antlrjavaparser/antlr-java-parser/blob/077160deb44d952c40c442800abd91af7e6fe006/src/main/java/com/github/antlrjavaparser/ASTHelper.java#L118-L123 |
magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/LRUCache.java | LRUCache.putIfDifferent | public V putIfDifferent( final K key, final V value ) {
synchronized ( _map ) {
final ManagedItem<V> item = _map.get( key );
if ( item == null || item._value == null || !item._value.equals( value ) ) {
return put( key, value );
} else {
return ... | java | public V putIfDifferent( final K key, final V value ) {
synchronized ( _map ) {
final ManagedItem<V> item = _map.get( key );
if ( item == null || item._value == null || !item._value.equals( value ) ) {
return put( key, value );
} else {
return ... | [
"public",
"V",
"putIfDifferent",
"(",
"final",
"K",
"key",
",",
"final",
"V",
"value",
")",
"{",
"synchronized",
"(",
"_map",
")",
"{",
"final",
"ManagedItem",
"<",
"V",
">",
"item",
"=",
"_map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"item",... | If the specified key is not already associated with a value or if it's
associated with a different value, associate it with the given value.
This is equivalent to
<pre>
<code> if (map.get(key) == null || !map.get(key).equals(value))
return map.put(key, value);
else
return map.get(key);
</code>
</pre>
except that the ... | [
"If",
"the",
"specified",
"key",
"is",
"not",
"already",
"associated",
"with",
"a",
"value",
"or",
"if",
"it",
"s",
"associated",
"with",
"a",
"different",
"value",
"associate",
"it",
"with",
"the",
"given",
"value",
".",
"This",
"is",
"equivalent",
"to"
] | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/LRUCache.java#L123-L132 |
diirt/util | src/main/java/org/epics/util/stats/Ranges.java | Ranges.overlap | public static double overlap(Range range, Range otherRange) {
double minOverlap = Math.max(range.getMinimum().doubleValue(), otherRange.getMinimum().doubleValue());
double maxOverlap = Math.min(range.getMaximum().doubleValue(), otherRange.getMaximum().doubleValue());
double overlapWidth = maxOve... | java | public static double overlap(Range range, Range otherRange) {
double minOverlap = Math.max(range.getMinimum().doubleValue(), otherRange.getMinimum().doubleValue());
double maxOverlap = Math.min(range.getMaximum().doubleValue(), otherRange.getMaximum().doubleValue());
double overlapWidth = maxOve... | [
"public",
"static",
"double",
"overlap",
"(",
"Range",
"range",
",",
"Range",
"otherRange",
")",
"{",
"double",
"minOverlap",
"=",
"Math",
".",
"max",
"(",
"range",
".",
"getMinimum",
"(",
")",
".",
"doubleValue",
"(",
")",
",",
"otherRange",
".",
"getMi... | Percentage, from 0 to 1, of the first range that is contained by
the second range.
@param range the range to be contained by the second
@param otherRange the range that has to contain the first
@return from 0 (if there is no intersection) to 1 (if the ranges are the same) | [
"Percentage",
"from",
"0",
"to",
"1",
"of",
"the",
"first",
"range",
"that",
"is",
"contained",
"by",
"the",
"second",
"range",
"."
] | train | https://github.com/diirt/util/blob/24aca0a173a635aaf0b78d213a3fee8d4f91c077/src/main/java/org/epics/util/stats/Ranges.java#L166-L173 |
drewnoakes/metadata-extractor | Source/com/drew/tools/FileUtil.java | FileUtil.saveBytes | public static void saveBytes(@NotNull File file, @NotNull byte[] bytes) throws IOException
{
FileOutputStream stream = null;
try {
stream = new FileOutputStream(file);
stream.write(bytes);
} finally {
if (stream != null) {
stream.close();
... | java | public static void saveBytes(@NotNull File file, @NotNull byte[] bytes) throws IOException
{
FileOutputStream stream = null;
try {
stream = new FileOutputStream(file);
stream.write(bytes);
} finally {
if (stream != null) {
stream.close();
... | [
"public",
"static",
"void",
"saveBytes",
"(",
"@",
"NotNull",
"File",
"file",
",",
"@",
"NotNull",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
"{",
"FileOutputStream",
"stream",
"=",
"null",
";",
"try",
"{",
"stream",
"=",
"new",
"FileOutputSt... | Saves the contents of a <code>byte[]</code> to the specified {@link File}. | [
"Saves",
"the",
"contents",
"of",
"a",
"<code",
">",
"byte",
"[]",
"<",
"/",
"code",
">",
"to",
"the",
"specified",
"{"
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/tools/FileUtil.java#L41-L52 |
tvesalainen/lpg | src/main/java/org/vesalainen/regex/Regex.java | Regex.createNFA | public static NFA<Integer> createNFA(Scope<NFAState<Integer>> scope, String expression)
{
return createNFA(scope, expression, 1);
} | java | public static NFA<Integer> createNFA(Scope<NFAState<Integer>> scope, String expression)
{
return createNFA(scope, expression, 1);
} | [
"public",
"static",
"NFA",
"<",
"Integer",
">",
"createNFA",
"(",
"Scope",
"<",
"NFAState",
"<",
"Integer",
">",
">",
"scope",
",",
"String",
"expression",
")",
"{",
"return",
"createNFA",
"(",
"scope",
",",
"expression",
",",
"1",
")",
";",
"}"
] | Creates an NFA from regular expression
@param scope
@param expression
@return | [
"Creates",
"an",
"NFA",
"from",
"regular",
"expression"
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/regex/Regex.java#L1093-L1096 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java | DeployerResolverOverriderConverter.overrideDeploymentProperties | private void overrideDeploymentProperties(T overrider, Class overriderClass) {
if (!overriderClass.getSimpleName().equals(ArtifactoryMaven3NativeConfigurator.class.getSimpleName())) {
try {
Field deploymentPropertiesField = overriderClass.getDeclaredField("deploymentProperties");
... | java | private void overrideDeploymentProperties(T overrider, Class overriderClass) {
if (!overriderClass.getSimpleName().equals(ArtifactoryMaven3NativeConfigurator.class.getSimpleName())) {
try {
Field deploymentPropertiesField = overriderClass.getDeclaredField("deploymentProperties");
... | [
"private",
"void",
"overrideDeploymentProperties",
"(",
"T",
"overrider",
",",
"Class",
"overriderClass",
")",
"{",
"if",
"(",
"!",
"overriderClass",
".",
"getSimpleName",
"(",
")",
".",
"equals",
"(",
"ArtifactoryMaven3NativeConfigurator",
".",
"class",
".",
"get... | Convert the String matrixParams parameter to String deploymentProperties
This convertion comes after a name change (matrixParams -> deploymentProperties) | [
"Convert",
"the",
"String",
"matrixParams",
"parameter",
"to",
"String",
"deploymentProperties",
"This",
"convertion",
"comes",
"after",
"a",
"name",
"change",
"(",
"matrixParams",
"-",
">",
"deploymentProperties",
")"
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java#L206-L225 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ConsumerLogMessages.java | ConsumerLogMessages.logError | public static void logError(final Logger logger, final Error e)
{
logger.logError(Level.ERROR, "Unexpected Error", e);
} | java | public static void logError(final Logger logger, final Error e)
{
logger.logError(Level.ERROR, "Unexpected Error", e);
} | [
"public",
"static",
"void",
"logError",
"(",
"final",
"Logger",
"logger",
",",
"final",
"Error",
"e",
")",
"{",
"logger",
".",
"logError",
"(",
"Level",
".",
"ERROR",
",",
"\"Unexpected Error\"",
",",
"e",
")",
";",
"}"
] | Logs an error.
@param logger
reference to the logger
@param e
reference to the error | [
"Logs",
"an",
"error",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ConsumerLogMessages.java#L54-L57 |
johncarl81/transfuse | transfuse-support/src/main/java/org/androidtransfuse/adapter/classes/ASTClassFactory.java | ASTClassFactory.getConstructor | public ASTConstructor getConstructor(Constructor constructor, boolean isEnum, boolean isInnerClass) {
ASTAccessModifier modifier = ASTAccessModifier.getModifier(constructor.getModifiers());
Annotation[][] parameterAnnotations = constructor.getParameterAnnotations();
if(constructor.getDeclaring... | java | public ASTConstructor getConstructor(Constructor constructor, boolean isEnum, boolean isInnerClass) {
ASTAccessModifier modifier = ASTAccessModifier.getModifier(constructor.getModifiers());
Annotation[][] parameterAnnotations = constructor.getParameterAnnotations();
if(constructor.getDeclaring... | [
"public",
"ASTConstructor",
"getConstructor",
"(",
"Constructor",
"constructor",
",",
"boolean",
"isEnum",
",",
"boolean",
"isInnerClass",
")",
"{",
"ASTAccessModifier",
"modifier",
"=",
"ASTAccessModifier",
".",
"getModifier",
"(",
"constructor",
".",
"getModifiers",
... | Build an AST Constructor from the given constructor
@param constructor
@return AST Constructor | [
"Build",
"an",
"AST",
"Constructor",
"from",
"the",
"given",
"constructor"
] | train | https://github.com/johncarl81/transfuse/blob/a5f837504797a6c4f8628f7e1dde09b8e6368c8b/transfuse-support/src/main/java/org/androidtransfuse/adapter/classes/ASTClassFactory.java#L248-L273 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java | ReflectionUtils.assertNotPrimitiveType | public static void assertNotPrimitiveType(final Field field, Class<? extends Annotation> annotation)
{
if (field.getType().isPrimitive())
{
throw annotation == null ? MESSAGES.fieldCannotBeOfPrimitiveOrVoidType(field) : MESSAGES.fieldCannotBeOfPrimitiveOrVoidType2(field, annotation);
}
... | java | public static void assertNotPrimitiveType(final Field field, Class<? extends Annotation> annotation)
{
if (field.getType().isPrimitive())
{
throw annotation == null ? MESSAGES.fieldCannotBeOfPrimitiveOrVoidType(field) : MESSAGES.fieldCannotBeOfPrimitiveOrVoidType2(field, annotation);
}
... | [
"public",
"static",
"void",
"assertNotPrimitiveType",
"(",
"final",
"Field",
"field",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
")",
"{",
"if",
"(",
"field",
".",
"getType",
"(",
")",
".",
"isPrimitive",
"(",
")",
")",
"{",
"thr... | Asserts field is not of primitive type.
@param method to validate
@param annotation annotation to propagate in exception message | [
"Asserts",
"field",
"is",
"not",
"of",
"primitive",
"type",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java#L80-L86 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AGNES.java | AGNES.shrinkActiveSet | protected static int shrinkActiveSet(DBIDArrayIter ix, PointerHierarchyRepresentationBuilder builder, int end, int x) {
if(x == end - 1) { // Can truncate active set.
while(builder.isLinked(ix.seek(--end - 1))) {
// Everything happens in while condition already.
}
}
return end;
} | java | protected static int shrinkActiveSet(DBIDArrayIter ix, PointerHierarchyRepresentationBuilder builder, int end, int x) {
if(x == end - 1) { // Can truncate active set.
while(builder.isLinked(ix.seek(--end - 1))) {
// Everything happens in while condition already.
}
}
return end;
} | [
"protected",
"static",
"int",
"shrinkActiveSet",
"(",
"DBIDArrayIter",
"ix",
",",
"PointerHierarchyRepresentationBuilder",
"builder",
",",
"int",
"end",
",",
"int",
"x",
")",
"{",
"if",
"(",
"x",
"==",
"end",
"-",
"1",
")",
"{",
"// Can truncate active set.",
... | Shrink the active set: if the last x objects are all merged, we can reduce
the working size accordingly.
@param ix Object iterator
@param builder Builder to detect merged status
@param end Current active set size
@param x Last merged object
@return New active set size | [
"Shrink",
"the",
"active",
"set",
":",
"if",
"the",
"last",
"x",
"objects",
"are",
"all",
"merged",
"we",
"can",
"reduce",
"the",
"working",
"size",
"accordingly",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AGNES.java#L177-L184 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/host/controller/ManagedServerBootCmdFactory.java | ManagedServerBootCmdFactory.resolveDirectoryGrouping | private static DirectoryGrouping resolveDirectoryGrouping(final ModelNode model, final ExpressionResolver expressionResolver) {
try {
return DirectoryGrouping.forName(HostResourceDefinition.DIRECTORY_GROUPING.resolveModelAttribute(expressionResolver, model).asString());
} catch (OperationFai... | java | private static DirectoryGrouping resolveDirectoryGrouping(final ModelNode model, final ExpressionResolver expressionResolver) {
try {
return DirectoryGrouping.forName(HostResourceDefinition.DIRECTORY_GROUPING.resolveModelAttribute(expressionResolver, model).asString());
} catch (OperationFai... | [
"private",
"static",
"DirectoryGrouping",
"resolveDirectoryGrouping",
"(",
"final",
"ModelNode",
"model",
",",
"final",
"ExpressionResolver",
"expressionResolver",
")",
"{",
"try",
"{",
"return",
"DirectoryGrouping",
".",
"forName",
"(",
"HostResourceDefinition",
".",
"... | Returns the value of found in the model.
@param model the model that contains the key and value.
@param expressionResolver the expression resolver to use to resolve expressions
@return the directory grouping found in the model.
@throws IllegalArgumentException if the {@link org.jboss.as.controller.descriptions.Model... | [
"Returns",
"the",
"value",
"of",
"found",
"in",
"the",
"model",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServerBootCmdFactory.java#L238-L244 |
alibaba/java-dns-cache-manipulator | library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java | DnsCacheManipulator.setDnsNegativeCachePolicy | public static void setDnsNegativeCachePolicy(int negativeCacheSeconds) {
try {
InetAddressCacheUtil.setDnsNegativeCachePolicy(negativeCacheSeconds);
} catch (Exception e) {
throw new DnsCacheManipulatorException("Fail to setDnsNegativeCachePolicy, cause: " + e.toString(), e);
... | java | public static void setDnsNegativeCachePolicy(int negativeCacheSeconds) {
try {
InetAddressCacheUtil.setDnsNegativeCachePolicy(negativeCacheSeconds);
} catch (Exception e) {
throw new DnsCacheManipulatorException("Fail to setDnsNegativeCachePolicy, cause: " + e.toString(), e);
... | [
"public",
"static",
"void",
"setDnsNegativeCachePolicy",
"(",
"int",
"negativeCacheSeconds",
")",
"{",
"try",
"{",
"InetAddressCacheUtil",
".",
"setDnsNegativeCachePolicy",
"(",
"negativeCacheSeconds",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw"... | Set JVM DNS negative cache policy
@param negativeCacheSeconds set default dns cache time. Special input case:
<ul>
<li> {@code -1} means never expired.(In effect, all negative value)</li>
<li> {@code 0} never cached.</li>
</ul>
@throws DnsCacheManipulatorException Operation fail
@since 1.3.0 | [
"Set",
"JVM",
"DNS",
"negative",
"cache",
"policy"
] | train | https://github.com/alibaba/java-dns-cache-manipulator/blob/eab50ee5c27671f9159b55458301f9429b2fcc47/library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java#L286-L292 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.svgLine | public static Element svgLine(Document document, double x1, double y1, double x2, double y2) {
Element line = SVGUtil.svgElement(document, SVGConstants.SVG_LINE_TAG);
SVGUtil.setAtt(line, SVGConstants.SVG_X1_ATTRIBUTE, x1);
SVGUtil.setAtt(line, SVGConstants.SVG_Y1_ATTRIBUTE, y1);
SVGUtil.setAtt(line, SV... | java | public static Element svgLine(Document document, double x1, double y1, double x2, double y2) {
Element line = SVGUtil.svgElement(document, SVGConstants.SVG_LINE_TAG);
SVGUtil.setAtt(line, SVGConstants.SVG_X1_ATTRIBUTE, x1);
SVGUtil.setAtt(line, SVGConstants.SVG_Y1_ATTRIBUTE, y1);
SVGUtil.setAtt(line, SV... | [
"public",
"static",
"Element",
"svgLine",
"(",
"Document",
"document",
",",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x2",
",",
"double",
"y2",
")",
"{",
"Element",
"line",
"=",
"SVGUtil",
".",
"svgElement",
"(",
"document",
",",
"SVGConstants",... | Create a SVG line element. Do not confuse this with path elements.
@param document document to create in (factory)
@param x1 first point x
@param y1 first point y
@param x2 second point x
@param y2 second point y
@return new element | [
"Create",
"a",
"SVG",
"line",
"element",
".",
"Do",
"not",
"confuse",
"this",
"with",
"path",
"elements",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L464-L471 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractTriangle3F.java | AbstractTriangle3F.getGroundHeight | public double getGroundHeight(Point2D point, CoordinateSystem3D system) {
return getGroundHeight(point.getX(), point.getY(), system);
} | java | public double getGroundHeight(Point2D point, CoordinateSystem3D system) {
return getGroundHeight(point.getX(), point.getY(), system);
} | [
"public",
"double",
"getGroundHeight",
"(",
"Point2D",
"point",
",",
"CoordinateSystem3D",
"system",
")",
"{",
"return",
"getGroundHeight",
"(",
"point",
".",
"getX",
"(",
")",
",",
"point",
".",
"getY",
"(",
")",
",",
"system",
")",
";",
"}"
] | Replies the height of the projection on the triangle that is representing a ground.
<p>
Assuming that the triangle is representing a face of a terrain/ground,
this function compute the height of the ground just below the given position.
The input of this function is the coordinate of a point on the horizontal plane.
@... | [
"Replies",
"the",
"height",
"of",
"the",
"projection",
"on",
"the",
"triangle",
"that",
"is",
"representing",
"a",
"ground",
".",
"<p",
">",
"Assuming",
"that",
"the",
"triangle",
"is",
"representing",
"a",
"face",
"of",
"a",
"terrain",
"/",
"ground",
"thi... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractTriangle3F.java#L2187-L2189 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java | CheckClassAdapter.checkFormalTypeParameters | private static int checkFormalTypeParameters(final String signature, int pos) {
// FormalTypeParameters:
// < FormalTypeParameter+ >
pos = checkChar('<', signature, pos);
pos = checkFormalTypeParameter(signature, pos);
while (getChar(signature, pos) != '>') {
pos = c... | java | private static int checkFormalTypeParameters(final String signature, int pos) {
// FormalTypeParameters:
// < FormalTypeParameter+ >
pos = checkChar('<', signature, pos);
pos = checkFormalTypeParameter(signature, pos);
while (getChar(signature, pos) != '>') {
pos = c... | [
"private",
"static",
"int",
"checkFormalTypeParameters",
"(",
"final",
"String",
"signature",
",",
"int",
"pos",
")",
"{",
"// FormalTypeParameters:",
"// < FormalTypeParameter+ >",
"pos",
"=",
"checkChar",
"(",
"'",
"'",
",",
"signature",
",",
"pos",
")",
";",
... | Checks the formal type parameters of a class or method signature.
@param signature
a string containing the signature that must be checked.
@param pos
index of first character to be checked.
@return the index of the first character after the checked part. | [
"Checks",
"the",
"formal",
"type",
"parameters",
"of",
"a",
"class",
"or",
"method",
"signature",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java#L775-L785 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.order_orderId_payWithRegisteredPaymentMean_POST | public void order_orderId_payWithRegisteredPaymentMean_POST(Long orderId, OvhReusablePaymentMeanEnum paymentMean, Long paymentMeanId) throws IOException {
String qPath = "/me/order/{orderId}/payWithRegisteredPaymentMean";
StringBuilder sb = path(qPath, orderId);
HashMap<String, Object>o = new HashMap<String, Obje... | java | public void order_orderId_payWithRegisteredPaymentMean_POST(Long orderId, OvhReusablePaymentMeanEnum paymentMean, Long paymentMeanId) throws IOException {
String qPath = "/me/order/{orderId}/payWithRegisteredPaymentMean";
StringBuilder sb = path(qPath, orderId);
HashMap<String, Object>o = new HashMap<String, Obje... | [
"public",
"void",
"order_orderId_payWithRegisteredPaymentMean_POST",
"(",
"Long",
"orderId",
",",
"OvhReusablePaymentMeanEnum",
"paymentMean",
",",
"Long",
"paymentMeanId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/order/{orderId}/payWithRegisteredPaymen... | Pay with an already registered payment mean
REST: POST /me/order/{orderId}/payWithRegisteredPaymentMean
@param paymentMean [required] The registered payment mean you want to use
@param paymentMeanId [required] Id of registered payment mean, mandatory for bankAccount, creditCard and paypal
@param orderId [required] | [
"Pay",
"with",
"an",
"already",
"registered",
"payment",
"mean"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1912-L1919 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/auth/policy/internal/JsonPolicyWriter.java | JsonPolicyWriter.writeJsonArray | private void writeJsonArray(String arrayName, List<String> values)
throws JsonGenerationException, IOException {
writeJsonArrayStart(arrayName);
for (String value : values)
generator.writeString(value);
writeJsonArrayEnd();
} | java | private void writeJsonArray(String arrayName, List<String> values)
throws JsonGenerationException, IOException {
writeJsonArrayStart(arrayName);
for (String value : values)
generator.writeString(value);
writeJsonArrayEnd();
} | [
"private",
"void",
"writeJsonArray",
"(",
"String",
"arrayName",
",",
"List",
"<",
"String",
">",
"values",
")",
"throws",
"JsonGenerationException",
",",
"IOException",
"{",
"writeJsonArrayStart",
"(",
"arrayName",
")",
";",
"for",
"(",
"String",
"value",
":",
... | Writes an array along with its values to the JSONGenerator.
@param arrayName
name of the JSON array.
@param values
values of the JSON array. | [
"Writes",
"an",
"array",
"along",
"with",
"its",
"values",
"to",
"the",
"JSONGenerator",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/policy/internal/JsonPolicyWriter.java#L353-L359 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/ProtoUtils.java | ProtoUtils.createProto | static SoyExpression createProto(
ProtoInitNode node,
Function<ExprNode, SoyExpression> compilerFunction,
Supplier<? extends ExpressionDetacher> detacher,
TemplateVariableManager varManager) {
return new ProtoInitGenerator(node, compilerFunction, detacher, varManager).generate();
} | java | static SoyExpression createProto(
ProtoInitNode node,
Function<ExprNode, SoyExpression> compilerFunction,
Supplier<? extends ExpressionDetacher> detacher,
TemplateVariableManager varManager) {
return new ProtoInitGenerator(node, compilerFunction, detacher, varManager).generate();
} | [
"static",
"SoyExpression",
"createProto",
"(",
"ProtoInitNode",
"node",
",",
"Function",
"<",
"ExprNode",
",",
"SoyExpression",
">",
"compilerFunction",
",",
"Supplier",
"<",
"?",
"extends",
"ExpressionDetacher",
">",
"detacher",
",",
"TemplateVariableManager",
"varMa... | Returns a {@link SoyExpression} for initializing a new proto.
@param node The proto initialization node
@param args Args for the proto initialization call
@param varManager Local variables manager | [
"Returns",
"a",
"{",
"@link",
"SoyExpression",
"}",
"for",
"initializing",
"a",
"new",
"proto",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/ProtoUtils.java#L553-L559 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.putExpirationDate | public static void putExpirationDate(Bundle bundle, Date value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
putDate(bundle, EXPIRATION_DATE_KEY, value);
} | java | public static void putExpirationDate(Bundle bundle, Date value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
putDate(bundle, EXPIRATION_DATE_KEY, value);
} | [
"public",
"static",
"void",
"putExpirationDate",
"(",
"Bundle",
"bundle",
",",
"Date",
"value",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"Validate",
".",
"notNull",
"(",
"value",
",",
"\"value\"",
")",
";",
"putDate... | Puts the expiration date into a Bundle.
@param bundle
A Bundle in which the expiration date should be stored.
@param value
The Date representing the expiration date.
@throws NullPointerException if the passed in Bundle or date value are null | [
"Puts",
"the",
"expiration",
"date",
"into",
"a",
"Bundle",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L200-L204 |
cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java | PreparedStatement.setObject | public void setObject(final int parameterIndex,
final Object x) throws SQLException {
if (x == null) {
if ("true".equals(connection.getProperties().
get("acolyte.parameter.untypedNull"))) {
// Fallback to String-VARCHAR
... | java | public void setObject(final int parameterIndex,
final Object x) throws SQLException {
if (x == null) {
if ("true".equals(connection.getProperties().
get("acolyte.parameter.untypedNull"))) {
// Fallback to String-VARCHAR
... | [
"public",
"void",
"setObject",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"Object",
"x",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"x",
"==",
"null",
")",
"{",
"if",
"(",
"\"true\"",
".",
"equals",
"(",
"connection",
".",
"getProperties",
... | {@inheritDoc}
Cannot be used with null parameter |x|.
@see #setObject(int,Object,int) | [
"{"
] | train | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java#L501-L530 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WebUtilities.java | WebUtilities.isAncestor | public static boolean isAncestor(final WComponent component1, final WComponent component2) {
for (WComponent parent = component2.getParent(); parent != null; parent = parent.getParent()) {
if (parent == component1) {
return true;
}
}
return false;
} | java | public static boolean isAncestor(final WComponent component1, final WComponent component2) {
for (WComponent parent = component2.getParent(); parent != null; parent = parent.getParent()) {
if (parent == component1) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"isAncestor",
"(",
"final",
"WComponent",
"component1",
",",
"final",
"WComponent",
"component2",
")",
"{",
"for",
"(",
"WComponent",
"parent",
"=",
"component2",
".",
"getParent",
"(",
")",
";",
"parent",
"!=",
"null",
";",
"p... | Indicates whether a component is an ancestor of another.
@param component1 a possible ancestor.
@param component2 the component to check.
@return true if <code>component1</code> is an ancestor of <code>component2</code>, false otherwise. | [
"Indicates",
"whether",
"a",
"component",
"is",
"an",
"ancestor",
"of",
"another",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WebUtilities.java#L574-L582 |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageManager.java | ImageManager.getPreparedImage | public BufferedImage getPreparedImage (String rset, String path)
{
return getPreparedImage(rset, path, null);
} | java | public BufferedImage getPreparedImage (String rset, String path)
{
return getPreparedImage(rset, path, null);
} | [
"public",
"BufferedImage",
"getPreparedImage",
"(",
"String",
"rset",
",",
"String",
"path",
")",
"{",
"return",
"getPreparedImage",
"(",
"rset",
",",
"path",
",",
"null",
")",
";",
"}"
] | Loads (and caches) the specified image from the resource manager, obtaining the image from
the supplied resource set.
<p> Additionally the image is optimized for display in the current graphics
configuration. Consider using {@link #getMirage(ImageKey)} instead of prepared images as
they (some day) will automatically u... | [
"Loads",
"(",
"and",
"caches",
")",
"the",
"specified",
"image",
"from",
"the",
"resource",
"manager",
"obtaining",
"the",
"image",
"from",
"the",
"supplied",
"resource",
"set",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageManager.java#L230-L233 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/search/result/impl/DefaultAsyncSearchQueryResult.java | DefaultAsyncSearchQueryResult.fromHttp412 | @Deprecated
public static AsyncSearchQueryResult fromHttp412() {
//dummy default values
SearchStatus status = new DefaultSearchStatus(1L, 1L, 0L);
SearchMetrics metrics = new DefaultSearchMetrics(0L, 0L, 0d);
return new DefaultAsyncSearchQueryResult(
status,
... | java | @Deprecated
public static AsyncSearchQueryResult fromHttp412() {
//dummy default values
SearchStatus status = new DefaultSearchStatus(1L, 1L, 0L);
SearchMetrics metrics = new DefaultSearchMetrics(0L, 0L, 0d);
return new DefaultAsyncSearchQueryResult(
status,
... | [
"@",
"Deprecated",
"public",
"static",
"AsyncSearchQueryResult",
"fromHttp412",
"(",
")",
"{",
"//dummy default values",
"SearchStatus",
"status",
"=",
"new",
"DefaultSearchStatus",
"(",
"1L",
",",
"1L",
",",
"0L",
")",
";",
"SearchMetrics",
"metrics",
"=",
"new",... | A utility method to convert an HTTP 412 response from the search service into a proper
{@link AsyncSearchQueryResult}. HTTP 412 indicates the request couldn't be satisfied with given
consistency before the timeout expired. This is translated to a {@link FtsConsistencyTimeoutException}.
@return an {@link AsyncSearchQue... | [
"A",
"utility",
"method",
"to",
"convert",
"an",
"HTTP",
"412",
"response",
"from",
"the",
"search",
"service",
"into",
"a",
"proper",
"{",
"@link",
"AsyncSearchQueryResult",
"}",
".",
"HTTP",
"412",
"indicates",
"the",
"request",
"couldn",
"t",
"be",
"satis... | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/search/result/impl/DefaultAsyncSearchQueryResult.java#L287-L300 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java | DrizzlePreparedStatement.setBlob | public void setBlob(final int parameterIndex, final InputStream inputStream) throws SQLException {
if(inputStream == null) {
setNull(parameterIndex, Types.BLOB);
return;
}
try {
if(getProtocol().supportsPBMS()) {
setParameter(parameterIndex,
... | java | public void setBlob(final int parameterIndex, final InputStream inputStream) throws SQLException {
if(inputStream == null) {
setNull(parameterIndex, Types.BLOB);
return;
}
try {
if(getProtocol().supportsPBMS()) {
setParameter(parameterIndex,
... | [
"public",
"void",
"setBlob",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"InputStream",
"inputStream",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"inputStream",
"==",
"null",
")",
"{",
"setNull",
"(",
"parameterIndex",
",",
"Types",
".",
"BLOB",
... | Sets the designated parameter to a <code>InputStream</code> object. This method differs from the
<code>setBinaryStream (int, InputStream)</code> method because it informs the driver that the parameter value
should be sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used, the
d... | [
"Sets",
"the",
"designated",
"parameter",
"to",
"a",
"<code",
">",
"InputStream<",
"/",
"code",
">",
"object",
".",
"This",
"method",
"differs",
"from",
"the",
"<code",
">",
"setBinaryStream",
"(",
"int",
"InputStream",
")",
"<",
"/",
"code",
">",
"method"... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java#L1007-L1026 |
tango-controls/JTango | dao/src/main/java/fr/esrf/TangoDs/DeviceClass.java | DeviceClass.export_device | protected void export_device(final DeviceImpl dev, final String name) throws DevFailed {
Util.out4.println("DeviceClass::export_device() arrived");
Util.out4.println("name = " + name);
//
// For server started without db usage (Mostly the database server). In
// this case,
... | java | protected void export_device(final DeviceImpl dev, final String name) throws DevFailed {
Util.out4.println("DeviceClass::export_device() arrived");
Util.out4.println("name = " + name);
//
// For server started without db usage (Mostly the database server). In
// this case,
... | [
"protected",
"void",
"export_device",
"(",
"final",
"DeviceImpl",
"dev",
",",
"final",
"String",
"name",
")",
"throws",
"DevFailed",
"{",
"Util",
".",
"out4",
".",
"println",
"(",
"\"DeviceClass::export_device() arrived\"",
")",
";",
"Util",
".",
"out4",
".",
... | Export a device.
<p>
This method activate the CORBA object associated with the servant dev. It
is used for device where a CORBALOC string is used to connect with. This
method is mainly used for the Tango database server.
@param dev The device to be exported
@param name The device CORBALOC name
@throws DevFailed If th... | [
"Export",
"a",
"device",
".",
"<p",
">",
"This",
"method",
"activate",
"the",
"CORBA",
"object",
"associated",
"with",
"the",
"servant",
"dev",
".",
"It",
"is",
"used",
"for",
"device",
"where",
"a",
"CORBALOC",
"string",
"is",
"used",
"to",
"connect",
"... | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoDs/DeviceClass.java#L277-L319 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsHdrsImpl.java | JsHdrsImpl.getForwardRoutingPath | public final List<SIDestinationAddress> getForwardRoutingPath() {
List<String> fNames = (List<String>) getHdr2().getField(JsHdr2Access.FORWARDROUTINGPATH_DESTINATIONNAME);
List<byte[]> fMEs = (List<byte[]>) getHdr2().getField(JsHdr2Access.FORWARDROUTINGPATH_MEID);
byte[] fLos = (byte[]) getHdr2(... | java | public final List<SIDestinationAddress> getForwardRoutingPath() {
List<String> fNames = (List<String>) getHdr2().getField(JsHdr2Access.FORWARDROUTINGPATH_DESTINATIONNAME);
List<byte[]> fMEs = (List<byte[]>) getHdr2().getField(JsHdr2Access.FORWARDROUTINGPATH_MEID);
byte[] fLos = (byte[]) getHdr2(... | [
"public",
"final",
"List",
"<",
"SIDestinationAddress",
">",
"getForwardRoutingPath",
"(",
")",
"{",
"List",
"<",
"String",
">",
"fNames",
"=",
"(",
"List",
"<",
"String",
">",
")",
"getHdr2",
"(",
")",
".",
"getField",
"(",
"JsHdr2Access",
".",
"FORWARDRO... | /*
Get the contents of the ForwardRoutingPath field from the message header.
The List returned is a copy of the header field, so no updates to it
affect the Message header itself.
Javadoc description supplied by SIBusMessage interface. | [
"/",
"*",
"Get",
"the",
"contents",
"of",
"the",
"ForwardRoutingPath",
"field",
"from",
"the",
"message",
"header",
".",
"The",
"List",
"returned",
"is",
"a",
"copy",
"of",
"the",
"header",
"field",
"so",
"no",
"updates",
"to",
"it",
"affect",
"the",
"Me... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsHdrsImpl.java#L418-L424 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/windowing/Window.java | Window.removeListener | public void removeListener(WindowListener<K,R,P> listener) {
this.listeners.remove(new UnwrappedWeakReference<WindowListener<K,R,P>>(listener));
} | java | public void removeListener(WindowListener<K,R,P> listener) {
this.listeners.remove(new UnwrappedWeakReference<WindowListener<K,R,P>>(listener));
} | [
"public",
"void",
"removeListener",
"(",
"WindowListener",
"<",
"K",
",",
"R",
",",
"P",
">",
"listener",
")",
"{",
"this",
".",
"listeners",
".",
"remove",
"(",
"new",
"UnwrappedWeakReference",
"<",
"WindowListener",
"<",
"K",
",",
"R",
",",
"P",
">",
... | Removes a WindowListener if it is present.
@param listener The listener to remove | [
"Removes",
"a",
"WindowListener",
"if",
"it",
"is",
"present",
"."
] | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/windowing/Window.java#L214-L216 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.getServerFarmSkus | public Object getServerFarmSkus(String resourceGroupName, String name) {
return getServerFarmSkusWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body();
} | java | public Object getServerFarmSkus(String resourceGroupName, String name) {
return getServerFarmSkusWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body();
} | [
"public",
"Object",
"getServerFarmSkus",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"getServerFarmSkusWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
"... | Gets all selectable sku's for a given App Service Plan.
Gets all selectable sku's for a given App Service Plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of App Service Plan
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Cloud... | [
"Gets",
"all",
"selectable",
"sku",
"s",
"for",
"a",
"given",
"App",
"Service",
"Plan",
".",
"Gets",
"all",
"selectable",
"sku",
"s",
"for",
"a",
"given",
"App",
"Service",
"Plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L2639-L2641 |
stagemonitor/stagemonitor | stagemonitor-core/src/main/java/org/stagemonitor/core/StagemonitorCoreConfigurationSourceInitializer.java | StagemonitorCoreConfigurationSourceInitializer.addRemotePropertiesConfigurationSources | private void addRemotePropertiesConfigurationSources(ConfigurationRegistry configuration, CorePlugin corePlugin) {
final List<URL> configurationUrls = corePlugin.getRemotePropertiesConfigUrls();
if (corePlugin.isDeactivateStagemonitorIfRemotePropertyServerIsDown()) {
assertRemotePropertiesServerIsAvailable(confi... | java | private void addRemotePropertiesConfigurationSources(ConfigurationRegistry configuration, CorePlugin corePlugin) {
final List<URL> configurationUrls = corePlugin.getRemotePropertiesConfigUrls();
if (corePlugin.isDeactivateStagemonitorIfRemotePropertyServerIsDown()) {
assertRemotePropertiesServerIsAvailable(confi... | [
"private",
"void",
"addRemotePropertiesConfigurationSources",
"(",
"ConfigurationRegistry",
"configuration",
",",
"CorePlugin",
"corePlugin",
")",
"{",
"final",
"List",
"<",
"URL",
">",
"configurationUrls",
"=",
"corePlugin",
".",
"getRemotePropertiesConfigUrls",
"(",
")"... | Creates and registers a RemotePropertiesConfigurationSource for each configuration url | [
"Creates",
"and",
"registers",
"a",
"RemotePropertiesConfigurationSource",
"for",
"each",
"configuration",
"url"
] | train | https://github.com/stagemonitor/stagemonitor/blob/7a1bf6848906f816aa465983f602ea1f1e8f2b7b/stagemonitor-core/src/main/java/org/stagemonitor/core/StagemonitorCoreConfigurationSourceInitializer.java#L79-L95 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/JsonUtils.java | JsonUtils.fromJson | public static <T> T fromJson(String json, Class<T> clazz) {
Objects.requireNonNull(json, Required.JSON.toString());
Objects.requireNonNull(clazz, Required.CLASS.toString());
T object = null;
try {
object = mapper.readValue(json, clazz);
} catch (IOException e... | java | public static <T> T fromJson(String json, Class<T> clazz) {
Objects.requireNonNull(json, Required.JSON.toString());
Objects.requireNonNull(clazz, Required.CLASS.toString());
T object = null;
try {
object = mapper.readValue(json, clazz);
} catch (IOException e... | [
"public",
"static",
"<",
"T",
">",
"T",
"fromJson",
"(",
"String",
"json",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"json",
",",
"Required",
".",
"JSON",
".",
"toString",
"(",
")",
")",
";",
"Objects",
... | Converts a given Json string to given Class
@param json The json string to convert
@param clazz The Class to convert to
@param <T> JavaDoc wants this, just ignore it
@return The converted class or null if conversion fails | [
"Converts",
"a",
"given",
"Json",
"string",
"to",
"given",
"Class"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/JsonUtils.java#L98-L110 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newPostOpenGraphActionRequest | public static Request newPostOpenGraphActionRequest(Session session, OpenGraphAction openGraphAction,
Callback callback) {
if (openGraphAction == null) {
throw new FacebookException("openGraphAction cannot be null");
}
if (Utility.isNullOrEmpty(openGraphAction.getType()))... | java | public static Request newPostOpenGraphActionRequest(Session session, OpenGraphAction openGraphAction,
Callback callback) {
if (openGraphAction == null) {
throw new FacebookException("openGraphAction cannot be null");
}
if (Utility.isNullOrEmpty(openGraphAction.getType()))... | [
"public",
"static",
"Request",
"newPostOpenGraphActionRequest",
"(",
"Session",
"session",
",",
"OpenGraphAction",
"openGraphAction",
",",
"Callback",
"callback",
")",
"{",
"if",
"(",
"openGraphAction",
"==",
"null",
")",
"{",
"throw",
"new",
"FacebookException",
"(... | Creates a new Request configured to publish an Open Graph action.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param openGraphAction
the Open Graph object to create; must not be null, and must have a non-empty 'type'
@param callback
a callback that will be called whe... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"publish",
"an",
"Open",
"Graph",
"action",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L742-L753 |
apereo/cas | support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/MetadataUIUtils.java | MetadataUIUtils.locateMetadataUserInterfaceForEntityId | public static SamlMetadataUIInfo locateMetadataUserInterfaceForEntityId(final MetadataResolverAdapter metadataAdapter,
final String entityId, final RegisteredService registeredService, final HttpServletRequest requestContext) {
val enti... | java | public static SamlMetadataUIInfo locateMetadataUserInterfaceForEntityId(final MetadataResolverAdapter metadataAdapter,
final String entityId, final RegisteredService registeredService, final HttpServletRequest requestContext) {
val enti... | [
"public",
"static",
"SamlMetadataUIInfo",
"locateMetadataUserInterfaceForEntityId",
"(",
"final",
"MetadataResolverAdapter",
"metadataAdapter",
",",
"final",
"String",
"entityId",
",",
"final",
"RegisteredService",
"registeredService",
",",
"final",
"HttpServletRequest",
"reque... | Locate MDUI for entity id simple metadata ui info.
@param metadataAdapter the metadata adapter
@param entityId the entity id
@param registeredService the registered service
@param requestContext the request context
@return the simple metadata ui info | [
"Locate",
"MDUI",
"for",
"entity",
"id",
"simple",
"metadata",
"ui",
"info",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-mdui-core/src/main/java/org/apereo/cas/support/saml/mdui/MetadataUIUtils.java#L66-L70 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/quantiles/DirectCompactDoublesSketch.java | DirectCompactDoublesSketch.checkDirectMemCapacity | static void checkDirectMemCapacity(final int k, final long n, final long memCapBytes) {
final int reqBufBytes = getCompactStorageBytes(k, n);
if (memCapBytes < reqBufBytes) {
throw new SketchesArgumentException("Possible corruption: Memory capacity too small: "
+ memCapBytes + " < " + reqBufByt... | java | static void checkDirectMemCapacity(final int k, final long n, final long memCapBytes) {
final int reqBufBytes = getCompactStorageBytes(k, n);
if (memCapBytes < reqBufBytes) {
throw new SketchesArgumentException("Possible corruption: Memory capacity too small: "
+ memCapBytes + " < " + reqBufByt... | [
"static",
"void",
"checkDirectMemCapacity",
"(",
"final",
"int",
"k",
",",
"final",
"long",
"n",
",",
"final",
"long",
"memCapBytes",
")",
"{",
"final",
"int",
"reqBufBytes",
"=",
"getCompactStorageBytes",
"(",
"k",
",",
"n",
")",
";",
"if",
"(",
"memCapBy... | Checks the validity of the direct memory capacity assuming n, k.
@param k the given value of k
@param n the given value of n
@param memCapBytes the current memory capacity in bytes | [
"Checks",
"the",
"validity",
"of",
"the",
"direct",
"memory",
"capacity",
"assuming",
"n",
"k",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/DirectCompactDoublesSketch.java#L218-L225 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/publickey/SshKeyPairGenerator.java | SshKeyPairGenerator.generateKeyPair | public static SshKeyPair generateKeyPair(String algorithm, int bits)
throws IOException, SshException {
if (!SSH2_RSA.equalsIgnoreCase(algorithm)
&& !SSH2_DSA.equalsIgnoreCase(algorithm)) {
throw new IOException(algorithm
+ " is not a supported key algorithm!");
}
SshKeyPair pair = new SshKeyPair... | java | public static SshKeyPair generateKeyPair(String algorithm, int bits)
throws IOException, SshException {
if (!SSH2_RSA.equalsIgnoreCase(algorithm)
&& !SSH2_DSA.equalsIgnoreCase(algorithm)) {
throw new IOException(algorithm
+ " is not a supported key algorithm!");
}
SshKeyPair pair = new SshKeyPair... | [
"public",
"static",
"SshKeyPair",
"generateKeyPair",
"(",
"String",
"algorithm",
",",
"int",
"bits",
")",
"throws",
"IOException",
",",
"SshException",
"{",
"if",
"(",
"!",
"SSH2_RSA",
".",
"equalsIgnoreCase",
"(",
"algorithm",
")",
"&&",
"!",
"SSH2_DSA",
".",... | Generates a new key pair.
@param algorithm
@param bits
@return SshKeyPair
@throws IOException | [
"Generates",
"a",
"new",
"key",
"pair",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/publickey/SshKeyPairGenerator.java#L83-L101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.