repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
google/j2objc | jre_emul/android/frameworks/base/core/java/android/text/SpanSet.java | SpanSet.hasSpansIntersecting | public boolean hasSpansIntersecting(int start, int end) {
"""
Returns true if there are spans intersecting the given interval.
@param end must be strictly greater than start
"""
for (int i = 0; i < numberOfSpans; i++) {
// equal test is valid since both intervals are not empty by construct... | java | public boolean hasSpansIntersecting(int start, int end) {
for (int i = 0; i < numberOfSpans; i++) {
// equal test is valid since both intervals are not empty by construction
if (spanStarts[i] >= end || spanEnds[i] <= start) continue;
return true;
}
return fals... | [
"public",
"boolean",
"hasSpansIntersecting",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numberOfSpans",
";",
"i",
"++",
")",
"{",
"// equal test is valid since both intervals are not empty by construction",
... | Returns true if there are spans intersecting the given interval.
@param end must be strictly greater than start | [
"Returns",
"true",
"if",
"there",
"are",
"spans",
"intersecting",
"the",
"given",
"interval",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/text/SpanSet.java#L80-L87 |
sdl/odata | odata_processor/src/main/java/com/sdl/odata/processor/write/ActionPostMethodHandler.java | ActionPostMethodHandler.handleWrite | @Override
public ProcessorResult handleWrite(Object action) throws ODataException {
"""
Handles action call and returns result in case when action returns it.
@param action The instance of action.
@return The result of calling action.
@throws ODataException in case of any error.
"""
Operation ... | java | @Override
public ProcessorResult handleWrite(Object action) throws ODataException {
Operation operation;
if (action instanceof Operation) {
operation = (Operation) action;
Object data = operation.doOperation(getODataRequestContext(), getDataSourceFactory());
if (d... | [
"@",
"Override",
"public",
"ProcessorResult",
"handleWrite",
"(",
"Object",
"action",
")",
"throws",
"ODataException",
"{",
"Operation",
"operation",
";",
"if",
"(",
"action",
"instanceof",
"Operation",
")",
"{",
"operation",
"=",
"(",
"Operation",
")",
"action"... | Handles action call and returns result in case when action returns it.
@param action The instance of action.
@return The result of calling action.
@throws ODataException in case of any error. | [
"Handles",
"action",
"call",
"and",
"returns",
"result",
"in",
"case",
"when",
"action",
"returns",
"it",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_processor/src/main/java/com/sdl/odata/processor/write/ActionPostMethodHandler.java#L49-L63 |
dkmfbk/knowledgestore | ks-core/src/main/java/eu/fbk/knowledgestore/data/Smaz.java | Smaz.outputVerb | private static void outputVerb(final ByteArrayOutputStream baos, final String str) {
"""
Outputs the verbatim string to the output stream
@param baos
@param str
"""
if (str.length() == 1) {
baos.write(254);
baos.write(str.toCharArray()[0]);
} else {
final... | java | private static void outputVerb(final ByteArrayOutputStream baos, final String str) {
if (str.length() == 1) {
baos.write(254);
baos.write(str.toCharArray()[0]);
} else {
final byte[] bytes = str.getBytes(Charsets.UTF_8);
baos.write(255);
baos.w... | [
"private",
"static",
"void",
"outputVerb",
"(",
"final",
"ByteArrayOutputStream",
"baos",
",",
"final",
"String",
"str",
")",
"{",
"if",
"(",
"str",
".",
"length",
"(",
")",
"==",
"1",
")",
"{",
"baos",
".",
"write",
"(",
"254",
")",
";",
"baos",
"."... | Outputs the verbatim string to the output stream
@param baos
@param str | [
"Outputs",
"the",
"verbatim",
"string",
"to",
"the",
"output",
"stream"
] | train | https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-core/src/main/java/eu/fbk/knowledgestore/data/Smaz.java#L262-L272 |
mediathekview/MLib | src/main/java/de/mediathekview/mlib/daten/ListeFilme.java | ListeFilme.getAgeAsDate | public Date getAgeAsDate() {
"""
Get the age of the film list.
@return Age as a {@link java.util.Date} object.
"""
String date;
if (!metaDaten[ListeFilme.FILMLISTE_DATUM_GMT_NR].isEmpty()) {
date = metaDaten[ListeFilme.FILMLISTE_DATUM_GMT_NR];
sdf.setTimeZone(new Simp... | java | public Date getAgeAsDate() {
String date;
if (!metaDaten[ListeFilme.FILMLISTE_DATUM_GMT_NR].isEmpty()) {
date = metaDaten[ListeFilme.FILMLISTE_DATUM_GMT_NR];
sdf.setTimeZone(new SimpleTimeZone(SimpleTimeZone.UTC_TIME, "UTC"));
} else {
date = metaDaten[ListeFi... | [
"public",
"Date",
"getAgeAsDate",
"(",
")",
"{",
"String",
"date",
";",
"if",
"(",
"!",
"metaDaten",
"[",
"ListeFilme",
".",
"FILMLISTE_DATUM_GMT_NR",
"]",
".",
"isEmpty",
"(",
")",
")",
"{",
"date",
"=",
"metaDaten",
"[",
"ListeFilme",
".",
"FILMLISTE_DAT... | Get the age of the film list.
@return Age as a {@link java.util.Date} object. | [
"Get",
"the",
"age",
"of",
"the",
"film",
"list",
"."
] | train | https://github.com/mediathekview/MLib/blob/01fd5791d87390fea7536275b8a2d4407fc00908/src/main/java/de/mediathekview/mlib/daten/ListeFilme.java#L369-L384 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/gridmap/GridMap.java | GridMap.checkUser | public boolean checkUser(String globusID, String userID) {
"""
Checks if a given globus ID is associated with given
local user account.
@param globusID globus ID
@param userID userID
@return true if globus ID is associated with given local
user account, false, otherwise.
"""
if (globusID == null... | java | public boolean checkUser(String globusID, String userID) {
if (globusID == null) {
throw new IllegalArgumentException(i18n.getMessage("glousIdNull"));
}
if (userID == null) {
throw new IllegalArgumentException(i18n.getMessage("userIdNull"));
}
if (this.ma... | [
"public",
"boolean",
"checkUser",
"(",
"String",
"globusID",
",",
"String",
"userID",
")",
"{",
"if",
"(",
"globusID",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"i18n",
".",
"getMessage",
"(",
"\"glousIdNull\"",
")",
")",
";",
... | Checks if a given globus ID is associated with given
local user account.
@param globusID globus ID
@param userID userID
@return true if globus ID is associated with given local
user account, false, otherwise. | [
"Checks",
"if",
"a",
"given",
"globus",
"ID",
"is",
"associated",
"with",
"given",
"local",
"user",
"account",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/gridmap/GridMap.java#L310-L324 |
JakeWharton/picasso2-okhttp3-downloader | src/main/java/com/jakewharton/picasso/OkHttp3Downloader.java | OkHttp3Downloader.createDefaultCache | public static Cache createDefaultCache(Context context) {
"""
Creates a {@link Cache} that would have otherwise been created by calling
{@link #OkHttp3Downloader(Context)}. This allows you to build your own {@link OkHttpClient}
while still getting the default disk cache.
"""
File dir = defaultCacheDir(co... | java | public static Cache createDefaultCache(Context context) {
File dir = defaultCacheDir(context);
return new Cache(dir, calculateDiskCacheSize(dir));
} | [
"public",
"static",
"Cache",
"createDefaultCache",
"(",
"Context",
"context",
")",
"{",
"File",
"dir",
"=",
"defaultCacheDir",
"(",
"context",
")",
";",
"return",
"new",
"Cache",
"(",
"dir",
",",
"calculateDiskCacheSize",
"(",
"dir",
")",
")",
";",
"}"
] | Creates a {@link Cache} that would have otherwise been created by calling
{@link #OkHttp3Downloader(Context)}. This allows you to build your own {@link OkHttpClient}
while still getting the default disk cache. | [
"Creates",
"a",
"{"
] | train | https://github.com/JakeWharton/picasso2-okhttp3-downloader/blob/e54cccd29b70eed68a3ec21401ec9910b294028d/src/main/java/com/jakewharton/picasso/OkHttp3Downloader.java#L51-L54 |
Red5/red5-server-common | src/main/java/org/red5/server/stream/SingleItemSubscriberStream.java | SingleItemSubscriberStream.createEngine | PlayEngine createEngine(ISchedulingService schedulingService, IConsumerService consumerService, IProviderService providerService) {
"""
Creates a play engine based on current services (scheduling service, consumer service, and provider service). This method is useful during unit testing.
"""
engine = ... | java | PlayEngine createEngine(ISchedulingService schedulingService, IConsumerService consumerService, IProviderService providerService) {
engine = new PlayEngine.Builder(this, schedulingService, consumerService, providerService).build();
return engine;
} | [
"PlayEngine",
"createEngine",
"(",
"ISchedulingService",
"schedulingService",
",",
"IConsumerService",
"consumerService",
",",
"IProviderService",
"providerService",
")",
"{",
"engine",
"=",
"new",
"PlayEngine",
".",
"Builder",
"(",
"this",
",",
"schedulingService",
","... | Creates a play engine based on current services (scheduling service, consumer service, and provider service). This method is useful during unit testing. | [
"Creates",
"a",
"play",
"engine",
"based",
"on",
"current",
"services",
"(",
"scheduling",
"service",
"consumer",
"service",
"and",
"provider",
"service",
")",
".",
"This",
"method",
"is",
"useful",
"during",
"unit",
"testing",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/SingleItemSubscriberStream.java#L163-L166 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/QueryByCriteria.java | QueryByCriteria.addGroupBy | public void addGroupBy(String fieldName) {
"""
Adds a groupby fieldName for ReportQueries.
@param fieldName The groupby to set
"""
if (fieldName != null)
{
m_groupby.add(new FieldHelper(fieldName, false));
}
} | java | public void addGroupBy(String fieldName)
{
if (fieldName != null)
{
m_groupby.add(new FieldHelper(fieldName, false));
}
} | [
"public",
"void",
"addGroupBy",
"(",
"String",
"fieldName",
")",
"{",
"if",
"(",
"fieldName",
"!=",
"null",
")",
"{",
"m_groupby",
".",
"add",
"(",
"new",
"FieldHelper",
"(",
"fieldName",
",",
"false",
")",
")",
";",
"}",
"}"
] | Adds a groupby fieldName for ReportQueries.
@param fieldName The groupby to set | [
"Adds",
"a",
"groupby",
"fieldName",
"for",
"ReportQueries",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/QueryByCriteria.java#L347-L353 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/ExceptionMatcher.java | ExceptionMatcher.isInElementSet | public boolean isInElementSet(Set<String> skipList, Class<?> excClass) throws ClassNotFoundException {
"""
Determines if the given exception is a subclass of an element
@param skipList - Set of elements
@param excClass - The thrown exception
@return True or False if skipList contains an element that is a superc... | java | public boolean isInElementSet(Set<String> skipList, Class<?> excClass) throws ClassNotFoundException {
//String mName = "isInElementSet(Set<String> skipList, Class<?> excClass)";
boolean retVal = false;
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
for(String value : skipList) {
Class<?>... | [
"public",
"boolean",
"isInElementSet",
"(",
"Set",
"<",
"String",
">",
"skipList",
",",
"Class",
"<",
"?",
">",
"excClass",
")",
"throws",
"ClassNotFoundException",
"{",
"//String mName = \"isInElementSet(Set<String> skipList, Class<?> excClass)\";",
"boolean",
"retVal",
... | Determines if the given exception is a subclass of an element
@param skipList - Set of elements
@param excClass - The thrown exception
@return True or False if skipList contains an element that is a superclass of the thrown exception
@throws ClassNotFoundException | [
"Determines",
"if",
"the",
"given",
"exception",
"is",
"a",
"subclass",
"of",
"an",
"element"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/ExceptionMatcher.java#L91-L103 |
windup/windup | reporting/api/src/main/java/org/jboss/windup/reporting/rules/CreateApplicationReportIndexRuleProvider.java | CreateApplicationReportIndexRuleProvider.addAllProjectModels | private void addAllProjectModels(ApplicationReportIndexModel navIdx, ProjectModel projectModel) {
"""
Attach all project models within the application to the index. This will make it easy to navigate from the
projectModel to the application index.
"""
navIdx.addProjectModel(projectModel);
for ... | java | private void addAllProjectModels(ApplicationReportIndexModel navIdx, ProjectModel projectModel)
{
navIdx.addProjectModel(projectModel);
for (ProjectModel childProject : projectModel.getChildProjects())
{
if (!Iterators.asSet(navIdx.getProjectModels()).contains(childProject))
... | [
"private",
"void",
"addAllProjectModels",
"(",
"ApplicationReportIndexModel",
"navIdx",
",",
"ProjectModel",
"projectModel",
")",
"{",
"navIdx",
".",
"addProjectModel",
"(",
"projectModel",
")",
";",
"for",
"(",
"ProjectModel",
"childProject",
":",
"projectModel",
"."... | Attach all project models within the application to the index. This will make it easy to navigate from the
projectModel to the application index. | [
"Attach",
"all",
"project",
"models",
"within",
"the",
"application",
"to",
"the",
"index",
".",
"This",
"will",
"make",
"it",
"easy",
"to",
"navigate",
"from",
"the",
"projectModel",
"to",
"the",
"application",
"index",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/rules/CreateApplicationReportIndexRuleProvider.java#L84-L92 |
voldemort/voldemort | src/java/voldemort/server/storage/prunejob/VersionedPutPruneJob.java | VersionedPutPruneJob.pruneNonReplicaEntries | public static List<Versioned<byte[]>> pruneNonReplicaEntries(List<Versioned<byte[]>> vals,
List<Integer> keyReplicas,
MutableBoolean didPrune) {
"""
Remove all non replica clock entries... | java | public static List<Versioned<byte[]>> pruneNonReplicaEntries(List<Versioned<byte[]>> vals,
List<Integer> keyReplicas,
MutableBoolean didPrune) {
List<Versioned<byte[]>> prunedVals = ... | [
"public",
"static",
"List",
"<",
"Versioned",
"<",
"byte",
"[",
"]",
">",
">",
"pruneNonReplicaEntries",
"(",
"List",
"<",
"Versioned",
"<",
"byte",
"[",
"]",
">",
">",
"vals",
",",
"List",
"<",
"Integer",
">",
"keyReplicas",
",",
"MutableBoolean",
"didP... | Remove all non replica clock entries from the list of versioned values
provided
@param vals list of versioned values to prune replicas from
@param keyReplicas list of current replicas for the given key
@param didPrune flag to mark if we did actually prune something
@return pruned list | [
"Remove",
"all",
"non",
"replica",
"clock",
"entries",
"from",
"the",
"list",
"of",
"versioned",
"values",
"provided"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/storage/prunejob/VersionedPutPruneJob.java#L181-L199 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Element.java | Element.wholeText | public String wholeText() {
"""
Get the (unencoded) text of all children of this element, including any newlines and spaces present in the
original.
@return unencoded, un-normalized text
@see #text()
"""
final StringBuilder accum = StringUtil.borrowBuilder();
NodeTraversor.traverse(new Nod... | java | public String wholeText() {
final StringBuilder accum = StringUtil.borrowBuilder();
NodeTraversor.traverse(new NodeVisitor() {
public void head(Node node, int depth) {
if (node instanceof TextNode) {
TextNode textNode = (TextNode) node;
... | [
"public",
"String",
"wholeText",
"(",
")",
"{",
"final",
"StringBuilder",
"accum",
"=",
"StringUtil",
".",
"borrowBuilder",
"(",
")",
";",
"NodeTraversor",
".",
"traverse",
"(",
"new",
"NodeVisitor",
"(",
")",
"{",
"public",
"void",
"head",
"(",
"Node",
"n... | Get the (unencoded) text of all children of this element, including any newlines and spaces present in the
original.
@return unencoded, un-normalized text
@see #text() | [
"Get",
"the",
"(",
"unencoded",
")",
"text",
"of",
"all",
"children",
"of",
"this",
"element",
"including",
"any",
"newlines",
"and",
"spaces",
"present",
"in",
"the",
"original",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Element.java#L1095-L1110 |
mockito/mockito | src/main/java/org/mockito/internal/stubbing/defaultanswers/RetrieveGenericsForDefaultAnswers.java | RetrieveGenericsForDefaultAnswers.findTypeFromGeneric | private static Class<?> findTypeFromGeneric(final InvocationOnMock invocation, final TypeVariable returnType) {
"""
Retrieve the expected type when it came from a primitive. If the type cannot be retrieve, return null.
@param invocation the current invocation
@param returnType the expected return type
@return... | java | private static Class<?> findTypeFromGeneric(final InvocationOnMock invocation, final TypeVariable returnType) {
// Class level
final MockCreationSettings mockSettings = MockUtil.getMockHandler(invocation.getMock()).getMockSettings();
final GenericMetadataSupport returnTypeSupport = GenericMetada... | [
"private",
"static",
"Class",
"<",
"?",
">",
"findTypeFromGeneric",
"(",
"final",
"InvocationOnMock",
"invocation",
",",
"final",
"TypeVariable",
"returnType",
")",
"{",
"// Class level",
"final",
"MockCreationSettings",
"mockSettings",
"=",
"MockUtil",
".",
"getMockH... | Retrieve the expected type when it came from a primitive. If the type cannot be retrieve, return null.
@param invocation the current invocation
@param returnType the expected return type
@return the type or null if not found | [
"Retrieve",
"the",
"expected",
"type",
"when",
"it",
"came",
"from",
"a",
"primitive",
".",
"If",
"the",
"type",
"cannot",
"be",
"retrieve",
"return",
"null",
"."
] | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/stubbing/defaultanswers/RetrieveGenericsForDefaultAnswers.java#L90-L103 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/OrdersInner.java | OrdersInner.beginCreateOrUpdateAsync | public Observable<OrderInner> beginCreateOrUpdateAsync(String deviceName, String resourceGroupName, OrderInner order) {
"""
Creates or updates an order.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param order The order to be created or updated.
@throws IllegalArgumen... | java | public Observable<OrderInner> beginCreateOrUpdateAsync(String deviceName, String resourceGroupName, OrderInner order) {
return beginCreateOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, order).map(new Func1<ServiceResponse<OrderInner>, OrderInner>() {
@Override
public Ord... | [
"public",
"Observable",
"<",
"OrderInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
",",
"OrderInner",
"order",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"deviceName",
",",
"resourceGro... | Creates or updates an order.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param order The order to be created or updated.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OrderInner object | [
"Creates",
"or",
"updates",
"an",
"order",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/OrdersInner.java#L419-L426 |
kennycason/kumo | kumo-core/src/main/java/com/kennycason/kumo/ParallelLayeredWordCloud.java | ParallelLayeredWordCloud.writeToFile | public void writeToFile(final String outputFileName, final boolean blockThread, final boolean shutdownExecutor) {
"""
Writes the wordcloud to an imagefile.
@param outputFileName
some file like "test.png"
@param blockThread
should the current thread be blocked
@param shutdownExecutor
should the executor be ... | java | public void writeToFile(final String outputFileName, final boolean blockThread, final boolean shutdownExecutor) {
if (blockThread) {
waitForFuturesToBlockCurrentThread();
}
super.writeToFile(outputFileName);
if (shutdownExecutor) {
this.shutdown();
}
... | [
"public",
"void",
"writeToFile",
"(",
"final",
"String",
"outputFileName",
",",
"final",
"boolean",
"blockThread",
",",
"final",
"boolean",
"shutdownExecutor",
")",
"{",
"if",
"(",
"blockThread",
")",
"{",
"waitForFuturesToBlockCurrentThread",
"(",
")",
";",
"}",
... | Writes the wordcloud to an imagefile.
@param outputFileName
some file like "test.png"
@param blockThread
should the current thread be blocked
@param shutdownExecutor
should the executor be shutdown afterwards. if
<code>false</code> this PLWC can still be used to build other
layers. if <code>true</code> this will becom... | [
"Writes",
"the",
"wordcloud",
"to",
"an",
"imagefile",
"."
] | train | https://github.com/kennycason/kumo/blob/bc577f468f162dbaf61c327a2d4f1989c61c57a0/kumo-core/src/main/java/com/kennycason/kumo/ParallelLayeredWordCloud.java#L89-L98 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java | AbstractViewRecycler.addUnusedView | protected final void addUnusedView(@NonNull final View view, final int viewType) {
"""
Adds an unused view to the cache.
@param view
The unused view, which should be added to the cache, as an instance of the class
{@link View}. The view may not be null
@param viewType
The view type, the unused view correspo... | java | protected final void addUnusedView(@NonNull final View view, final int viewType) {
if (useCache) {
if (unusedViews == null) {
unusedViews = new SparseArray<>(adapter.getViewTypeCount());
}
Queue<View> queue = unusedViews.get(viewType);
if (queue ... | [
"protected",
"final",
"void",
"addUnusedView",
"(",
"@",
"NonNull",
"final",
"View",
"view",
",",
"final",
"int",
"viewType",
")",
"{",
"if",
"(",
"useCache",
")",
"{",
"if",
"(",
"unusedViews",
"==",
"null",
")",
"{",
"unusedViews",
"=",
"new",
"SparseA... | Adds an unused view to the cache.
@param view
The unused view, which should be added to the cache, as an instance of the class
{@link View}. The view may not be null
@param viewType
The view type, the unused view corresponds to, as an {@link Integer} value | [
"Adds",
"an",
"unused",
"view",
"to",
"the",
"cache",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/AbstractViewRecycler.java#L212-L227 |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/DateParser.java | DateParser.parseW3CDateTime | public static Date parseW3CDateTime(String sDate, final Locale locale) {
"""
Parses a Date out of a String with a date in W3C date-time format.
<p/>
It parsers the following formats:
<ul>
<li>"yyyy-MM-dd'T'HH:mm:ssz"</li>
<li>"yyyy-MM-dd'T'HH:mmz"</li>
<li>"yyyy-MM-dd"</li>
<li>"yyyy-MM"</li>
<li>"yyyy"</l... | java | public static Date parseW3CDateTime(String sDate, final Locale locale) {
// if sDate has time on it, it injects 'GTM' before de TZ displacement to allow the
// SimpleDateFormat parser to parse it properly
final int tIndex = sDate.indexOf("T");
if (tIndex > -1) {
if (sDate.end... | [
"public",
"static",
"Date",
"parseW3CDateTime",
"(",
"String",
"sDate",
",",
"final",
"Locale",
"locale",
")",
"{",
"// if sDate has time on it, it injects 'GTM' before de TZ displacement to allow the",
"// SimpleDateFormat parser to parse it properly",
"final",
"int",
"tIndex",
... | Parses a Date out of a String with a date in W3C date-time format.
<p/>
It parsers the following formats:
<ul>
<li>"yyyy-MM-dd'T'HH:mm:ssz"</li>
<li>"yyyy-MM-dd'T'HH:mmz"</li>
<li>"yyyy-MM-dd"</li>
<li>"yyyy-MM"</li>
<li>"yyyy"</li>
</ul>
<p/>
Refer to the java.text.SimpleDateFormat javadocs for details on the format o... | [
"Parses",
"a",
"Date",
"out",
"of",
"a",
"String",
"with",
"a",
"date",
"in",
"W3C",
"date",
"-",
"time",
"format",
".",
"<p",
"/",
">",
"It",
"parsers",
"the",
"following",
"formats",
":",
"<ul",
">",
"<li",
">",
"yyyy",
"-",
"MM",
"-",
"dd",
"T... | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/DateParser.java#L193-L218 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkManager.java | BookmarkManager.addBookmarkedConference | public void addBookmarkedConference(String name, EntityBareJid jid, boolean isAutoJoin,
Resourcepart nickname, String password) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Adds or updates a conference in the bookmarks.
@param name the name of the... | java | public void addBookmarkedConference(String name, EntityBareJid jid, boolean isAutoJoin,
Resourcepart nickname, String password) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
retrieveBookmarks();
BookmarkedConference bookmark
= n... | [
"public",
"void",
"addBookmarkedConference",
"(",
"String",
"name",
",",
"EntityBareJid",
"jid",
",",
"boolean",
"isAutoJoin",
",",
"Resourcepart",
"nickname",
",",
"String",
"password",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnect... | Adds or updates a conference in the bookmarks.
@param name the name of the conference
@param jid the jid of the conference
@param isAutoJoin whether or not to join this conference automatically on login
@param nickname the nickname to use for the user when joining the conference
@param password the password to use for... | [
"Adds",
"or",
"updates",
"a",
"conference",
"in",
"the",
"bookmarks",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/bookmarks/BookmarkManager.java#L115-L135 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AssetsInner.java | AssetsInner.listContainerSas | public AssetContainerSasInner listContainerSas(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) {
"""
List the Asset URLs.
Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from ... | java | public AssetContainerSasInner listContainerSas(String resourceGroupName, String accountName, String assetName, ListContainerSasInput parameters) {
return listContainerSasWithServiceResponseAsync(resourceGroupName, accountName, assetName, parameters).toBlocking().single().body();
} | [
"public",
"AssetContainerSasInner",
"listContainerSas",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"assetName",
",",
"ListContainerSasInput",
"parameters",
")",
"{",
"return",
"listContainerSasWithServiceResponseAsync",
"(",
"resourceGrou... | List the Asset URLs.
Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services accou... | [
"List",
"the",
"Asset",
"URLs",
".",
"Lists",
"storage",
"container",
"URLs",
"with",
"shared",
"access",
"signatures",
"(",
"SAS",
")",
"for",
"uploading",
"and",
"downloading",
"Asset",
"content",
".",
"The",
"signatures",
"are",
"derived",
"from",
"the",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/AssetsInner.java#L787-L789 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/stereo/ExtendedCisTrans.java | ExtendedCisTrans.getOtherAtom | private static IAtom getOtherAtom(IAtomContainer mol, IAtom atom, IAtom other) {
"""
internal, find a neighbor connected to 'atom' that is not 'other'
"""
List<IBond> bonds = mol.getConnectedBondsList(atom);
if (bonds.size() != 2)
return null;
if (bonds.get(0).contains(other... | java | private static IAtom getOtherAtom(IAtomContainer mol, IAtom atom, IAtom other) {
List<IBond> bonds = mol.getConnectedBondsList(atom);
if (bonds.size() != 2)
return null;
if (bonds.get(0).contains(other))
return bonds.get(1).getOrder() == IBond.Order.DOUBLE
... | [
"private",
"static",
"IAtom",
"getOtherAtom",
"(",
"IAtomContainer",
"mol",
",",
"IAtom",
"atom",
",",
"IAtom",
"other",
")",
"{",
"List",
"<",
"IBond",
">",
"bonds",
"=",
"mol",
".",
"getConnectedBondsList",
"(",
"atom",
")",
";",
"if",
"(",
"bonds",
".... | internal, find a neighbor connected to 'atom' that is not 'other' | [
"internal",
"find",
"a",
"neighbor",
"connected",
"to",
"atom",
"that",
"is",
"not",
"other"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/stereo/ExtendedCisTrans.java#L56-L65 |
JoeKerouac/utils | src/main/java/com/joe/utils/reflect/ClassUtils.java | ClassUtils.getInstance | public static <T> T getInstance(Class<T> clazz, Class<?>[] paramTypes, Object[] params) {
"""
获取class的实例
@param clazz class
@param paramTypes 构造器参数类型
@param params 参数
@param <T> class类型
@return Class实例
"""
Assert.isTrue(CollectionUtil.safeSizeOf(paramTypes) == CollectionUtil.safeSizeOf(params));
... | java | public static <T> T getInstance(Class<T> clazz, Class<?>[] paramTypes, Object[] params) {
Assert.isTrue(CollectionUtil.safeSizeOf(paramTypes) == CollectionUtil.safeSizeOf(params));
try {
Constructor<T> constructor = clazz.getConstructor(paramTypes);
ReflectUtil.allowAccess(constr... | [
"public",
"static",
"<",
"T",
">",
"T",
"getInstance",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"Assert",
".",
"isTrue",
"(",
"CollectionUtil",
".",
"saf... | 获取class的实例
@param clazz class
@param paramTypes 构造器参数类型
@param params 参数
@param <T> class类型
@return Class实例 | [
"获取class的实例"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/reflect/ClassUtils.java#L153-L162 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1alpha/WebSecurityScannerClient.java | WebSecurityScannerClient.updateScanConfig | public final ScanConfig updateScanConfig(ScanConfig scanConfig, FieldMask updateMask) {
"""
Updates a ScanConfig. This method support partial update of a ScanConfig.
<p>Sample code:
<pre><code>
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfig scanConf... | java | public final ScanConfig updateScanConfig(ScanConfig scanConfig, FieldMask updateMask) {
UpdateScanConfigRequest request =
UpdateScanConfigRequest.newBuilder()
.setScanConfig(scanConfig)
.setUpdateMask(updateMask)
.build();
return updateScanConfig(request);
} | [
"public",
"final",
"ScanConfig",
"updateScanConfig",
"(",
"ScanConfig",
"scanConfig",
",",
"FieldMask",
"updateMask",
")",
"{",
"UpdateScanConfigRequest",
"request",
"=",
"UpdateScanConfigRequest",
".",
"newBuilder",
"(",
")",
".",
"setScanConfig",
"(",
"scanConfig",
... | Updates a ScanConfig. This method support partial update of a ScanConfig.
<p>Sample code:
<pre><code>
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ScanConfig scanConfig = ScanConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
ScanConfig... | [
"Updates",
"a",
"ScanConfig",
".",
"This",
"method",
"support",
"partial",
"update",
"of",
"a",
"ScanConfig",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1alpha/WebSecurityScannerClient.java#L605-L613 |
ManfredTremmel/gwt-bean-validators | gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java | StringUtils.uriDecode | public static String uriDecode(final String source, final Charset charset) {
"""
Decode the given encoded URI component value. Based on the following rules:
<ul>
<li>Alphanumeric characters {@code "a"} through {@code "z"}, {@code "A"} through {@code "Z"},
and {@code "0"} through {@code "9"} stay the same.</li>
... | java | public static String uriDecode(final String source, final Charset charset) {
final int length = source.length();
if (length == 0) {
return source;
}
Assert.notNull(charset, "Charset must not be null");
final ByteArrayOutputStream bos = new ByteArrayOutputStream(length);
boolean changed = ... | [
"public",
"static",
"String",
"uriDecode",
"(",
"final",
"String",
"source",
",",
"final",
"Charset",
"charset",
")",
"{",
"final",
"int",
"length",
"=",
"source",
".",
"length",
"(",
")",
";",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"sourc... | Decode the given encoded URI component value. Based on the following rules:
<ul>
<li>Alphanumeric characters {@code "a"} through {@code "z"}, {@code "A"} through {@code "Z"},
and {@code "0"} through {@code "9"} stay the same.</li>
<li>Special characters {@code "-"}, {@code "_"}, {@code "."}, and {@code "*"} stay the
sa... | [
"Decode",
"the",
"given",
"encoded",
"URI",
"component",
"value",
".",
"Based",
"on",
"the",
"following",
"rules",
":",
"<ul",
">",
"<li",
">",
"Alphanumeric",
"characters",
"{",
"@code",
"a",
"}",
"through",
"{",
"@code",
"z",
"}",
"{",
"@code",
"A",
... | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java#L758-L791 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskId.java | DiskId.of | public static DiskId of(String zone, String disk) {
"""
Returns a disk identity given the zone and disk names. The disk name must be 1-63 characters
long and comply with RFC1035. Specifically, the name must match the regular expression {@code
[a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a ... | java | public static DiskId of(String zone, String disk) {
return new DiskId(null, zone, disk);
} | [
"public",
"static",
"DiskId",
"of",
"(",
"String",
"zone",
",",
"String",
"disk",
")",
"{",
"return",
"new",
"DiskId",
"(",
"null",
",",
"zone",
",",
"disk",
")",
";",
"}"
] | Returns a disk identity given the zone and disk names. The disk name must be 1-63 characters
long and comply with RFC1035. Specifically, the name must match the regular expression {@code
[a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a lowercase letter, and all
following characters must be a dash, ... | [
"Returns",
"a",
"disk",
"identity",
"given",
"the",
"zone",
"and",
"disk",
"names",
".",
"The",
"disk",
"name",
"must",
"be",
"1",
"-",
"63",
"characters",
"long",
"and",
"comply",
"with",
"RFC1035",
".",
"Specifically",
"the",
"name",
"must",
"match",
"... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskId.java#L123-L125 |
JodaOrg/joda-time | src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java | DateTimeZoneBuilder.addCutover | public DateTimeZoneBuilder addCutover(int year,
char mode,
int monthOfYear,
int dayOfMonth,
int dayOfWeek,
boo... | java | public DateTimeZoneBuilder addCutover(int year,
char mode,
int monthOfYear,
int dayOfMonth,
int dayOfWeek,
boo... | [
"public",
"DateTimeZoneBuilder",
"addCutover",
"(",
"int",
"year",
",",
"char",
"mode",
",",
"int",
"monthOfYear",
",",
"int",
"dayOfMonth",
",",
"int",
"dayOfWeek",
",",
"boolean",
"advanceDayOfWeek",
",",
"int",
"millisOfDay",
")",
"{",
"if",
"(",
"iRuleSets... | Adds a cutover for added rules. The standard offset at the cutover
defaults to 0. Call setStandardOffset afterwards to change it.
@param year the year of cutover
@param mode 'u' - cutover is measured against UTC, 'w' - against wall
offset, 's' - against standard offset
@param monthOfYear the month from 1 (January) t... | [
"Adds",
"a",
"cutover",
"for",
"added",
"rules",
".",
"The",
"standard",
"offset",
"at",
"the",
"cutover",
"defaults",
"to",
"0",
".",
"Call",
"setStandardOffset",
"afterwards",
"to",
"change",
"it",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java#L245-L261 |
pushtorefresh/storio | storio-sqlite/src/main/java/com/pushtorefresh/storio3/sqlite/Changes.java | Changes.newInstance | @NonNull
public static Changes newInstance(@NonNull String affectedTable, @Nullable String... affectedTags) {
"""
Creates {@link Changes} container with info about changes.
@param affectedTable table that was affected.
@param affectedTags nullable set of affected tags.
@return new immutable instance of {... | java | @NonNull
public static Changes newInstance(@NonNull String affectedTable, @Nullable String... affectedTags) {
checkNotNull(affectedTable, "Please specify affected table");
return new Changes(singleton(affectedTable), nonNullSet(affectedTags));
} | [
"@",
"NonNull",
"public",
"static",
"Changes",
"newInstance",
"(",
"@",
"NonNull",
"String",
"affectedTable",
",",
"@",
"Nullable",
"String",
"...",
"affectedTags",
")",
"{",
"checkNotNull",
"(",
"affectedTable",
",",
"\"Please specify affected table\"",
")",
";",
... | Creates {@link Changes} container with info about changes.
@param affectedTable table that was affected.
@param affectedTags nullable set of affected tags.
@return new immutable instance of {@link Changes}. | [
"Creates",
"{",
"@link",
"Changes",
"}",
"container",
"with",
"info",
"about",
"changes",
"."
] | train | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-sqlite/src/main/java/com/pushtorefresh/storio3/sqlite/Changes.java#L100-L104 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.importData | public static int importData(final DataSet dataset, final int offset, final int count, final PreparedStatement stmt, final int batchSize,
final int batchInterval, final Try.BiConsumer<? super PreparedStatement, ? super Object[], SQLException> stmtSetter) throws UncheckedSQLException {
"""
Imports the ... | java | public static int importData(final DataSet dataset, final int offset, final int count, final PreparedStatement stmt, final int batchSize,
final int batchInterval, final Try.BiConsumer<? super PreparedStatement, ? super Object[], SQLException> stmtSetter) throws UncheckedSQLException {
return impor... | [
"public",
"static",
"int",
"importData",
"(",
"final",
"DataSet",
"dataset",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"count",
",",
"final",
"PreparedStatement",
"stmt",
",",
"final",
"int",
"batchSize",
",",
"final",
"int",
"batchInterval",
",",
... | Imports the data from <code>DataSet</code> to database.
@param dataset
@param columnTypeMap
@param offset
@param count
@param stmt the column order in the sql must be consistent with the column order in the DataSet.
@param filter
@param stmtSetter
@return
@throws UncheckedSQLException | [
"Imports",
"the",
"data",
"from",
"<code",
">",
"DataSet<",
"/",
"code",
">",
"to",
"database",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L2426-L2429 |
jhalterman/lyra | src/main/java/net/jodah/lyra/ConnectionOptions.java | ConnectionOptions.withSslProtocol | public ConnectionOptions withSslProtocol(String sslProtocol, TrustManager trustManager)
throws NoSuchAlgorithmException, KeyManagementException {
"""
Sets the {@code sslProtocol} and {@code trustManager} to use.
@throws NullPointerException if {@code sslProtocol} or {@code trustManager} are null
"""
... | java | public ConnectionOptions withSslProtocol(String sslProtocol, TrustManager trustManager)
throws NoSuchAlgorithmException, KeyManagementException {
factory.useSslProtocol(Assert.notNull(sslProtocol, "sslProtocol"),
Assert.notNull(trustManager, "trustManager"));
return this;
} | [
"public",
"ConnectionOptions",
"withSslProtocol",
"(",
"String",
"sslProtocol",
",",
"TrustManager",
"trustManager",
")",
"throws",
"NoSuchAlgorithmException",
",",
"KeyManagementException",
"{",
"factory",
".",
"useSslProtocol",
"(",
"Assert",
".",
"notNull",
"(",
"ssl... | Sets the {@code sslProtocol} and {@code trustManager} to use.
@throws NullPointerException if {@code sslProtocol} or {@code trustManager} are null | [
"Sets",
"the",
"{",
"@code",
"sslProtocol",
"}",
"and",
"{",
"@code",
"trustManager",
"}",
"to",
"use",
"."
] | train | https://github.com/jhalterman/lyra/blob/ce347a69357fef1b34e92d92a4f9e68792d81255/src/main/java/net/jodah/lyra/ConnectionOptions.java#L317-L322 |
wuman/android-oauth-client | library/src/main/java/com/wuman/android/auth/AuthorizationFlow.java | AuthorizationFlow.createAndStoreCredential | public Credential createAndStoreCredential(ImplicitResponseUrl implicitResponse, String userId)
throws IOException {
"""
Creates a new credential for the given user ID based on the given token
response and store in the credential store.
@param response implicit authorization token response
@param ... | java | public Credential createAndStoreCredential(ImplicitResponseUrl implicitResponse, String userId)
throws IOException {
Credential credential = newCredential(userId)
.setAccessToken(implicitResponse.getAccessToken())
.setExpiresInSeconds(implicitResponse.getExpiresInSeco... | [
"public",
"Credential",
"createAndStoreCredential",
"(",
"ImplicitResponseUrl",
"implicitResponse",
",",
"String",
"userId",
")",
"throws",
"IOException",
"{",
"Credential",
"credential",
"=",
"newCredential",
"(",
"userId",
")",
".",
"setAccessToken",
"(",
"implicitRes... | Creates a new credential for the given user ID based on the given token
response and store in the credential store.
@param response implicit authorization token response
@param userId user ID or {@code null} if not using a persisted credential
store
@return newly created credential
@throws IOException | [
"Creates",
"a",
"new",
"credential",
"for",
"the",
"given",
"user",
"ID",
"based",
"on",
"the",
"given",
"token",
"response",
"and",
"store",
"in",
"the",
"credential",
"store",
"."
] | train | https://github.com/wuman/android-oauth-client/blob/6e01b81b7319a6954a1156e8b93c0b5cbeb61446/library/src/main/java/com/wuman/android/auth/AuthorizationFlow.java#L324-L337 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/awt/font/NumericShaper.java | NumericShaper.getContextualShaper | public static NumericShaper getContextualShaper(Set<Range> ranges) {
"""
Returns a contextual shaper for the provided Unicode
range(s). The Latin-1 (EUROPEAN) digits are converted to the
decimal digits corresponding to the range of the preceding
text, if the range is one of the provided ranges.
<p>The shaper... | java | public static NumericShaper getContextualShaper(Set<Range> ranges) {
NumericShaper shaper = new NumericShaper(Range.EUROPEAN, ranges);
shaper.mask = CONTEXTUAL_MASK;
return shaper;
} | [
"public",
"static",
"NumericShaper",
"getContextualShaper",
"(",
"Set",
"<",
"Range",
">",
"ranges",
")",
"{",
"NumericShaper",
"shaper",
"=",
"new",
"NumericShaper",
"(",
"Range",
".",
"EUROPEAN",
",",
"ranges",
")",
";",
"shaper",
".",
"mask",
"=",
"CONTEX... | Returns a contextual shaper for the provided Unicode
range(s). The Latin-1 (EUROPEAN) digits are converted to the
decimal digits corresponding to the range of the preceding
text, if the range is one of the provided ranges.
<p>The shaper assumes EUROPEAN as the starting context, that
is, if EUROPEAN digits are encounte... | [
"Returns",
"a",
"contextual",
"shaper",
"for",
"the",
"provided",
"Unicode",
"range",
"(",
"s",
")",
".",
"The",
"Latin",
"-",
"1",
"(",
"EUROPEAN",
")",
"digits",
"are",
"converted",
"to",
"the",
"decimal",
"digits",
"corresponding",
"to",
"the",
"range",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/awt/font/NumericShaper.java#L998-L1002 |
buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/metadata/MetadataProviderImpl.java | MetadataProviderImpl.createTypeMetadata | private TypeMetadata createTypeMetadata(AnnotatedType annotatedType) {
"""
Create the {@link TypeMetadata} for the given {@link AnnotatedType}.
@param annotatedType
The {@link AnnotatedType}.
@return The corresponding metadata.
"""
Class<?> currentClass = annotatedType.getAnnotatedElement();
... | java | private TypeMetadata createTypeMetadata(AnnotatedType annotatedType) {
Class<?> currentClass = annotatedType.getAnnotatedElement();
Collection<AnnotatedMethod> annotatedMethods = this.annotatedMethods.get(currentClass);
if (annotatedMethods == null) {
throw new XOException("XO unit d... | [
"private",
"TypeMetadata",
"createTypeMetadata",
"(",
"AnnotatedType",
"annotatedType",
")",
"{",
"Class",
"<",
"?",
">",
"currentClass",
"=",
"annotatedType",
".",
"getAnnotatedElement",
"(",
")",
";",
"Collection",
"<",
"AnnotatedMethod",
">",
"annotatedMethods",
... | Create the {@link TypeMetadata} for the given {@link AnnotatedType}.
@param annotatedType
The {@link AnnotatedType}.
@return The corresponding metadata. | [
"Create",
"the",
"{",
"@link",
"TypeMetadata",
"}",
"for",
"the",
"given",
"{",
"@link",
"AnnotatedType",
"}",
"."
] | train | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/metadata/MetadataProviderImpl.java#L187-L207 |
googlegenomics/utils-java | src/main/java/com/google/cloud/genomics/utils/grpc/VariantUtils.java | VariantUtils.isSameVariantSite | public static final boolean isSameVariantSite(Variant.Builder variant1, Variant variant2) {
"""
Determine whether two variants occur at the same site in the genome, where "site"
is defined by reference name, start position, and reference bases.
The reference bases are taken into account particularly for indels... | java | public static final boolean isSameVariantSite(Variant.Builder variant1, Variant variant2) {
return variant1.getReferenceName().equals(variant2.getReferenceName())
&& variant1.getReferenceBases().equals(variant2.getReferenceBases())
&& variant1.getStart() == variant2.getStart();
} | [
"public",
"static",
"final",
"boolean",
"isSameVariantSite",
"(",
"Variant",
".",
"Builder",
"variant1",
",",
"Variant",
"variant2",
")",
"{",
"return",
"variant1",
".",
"getReferenceName",
"(",
")",
".",
"equals",
"(",
"variant2",
".",
"getReferenceName",
"(",
... | Determine whether two variants occur at the same site in the genome, where "site"
is defined by reference name, start position, and reference bases.
The reference bases are taken into account particularly for indels.
@param variant1
@param variant2
@return true, if they occur at the same site | [
"Determine",
"whether",
"two",
"variants",
"occur",
"at",
"the",
"same",
"site",
"in",
"the",
"genome",
"where",
"site",
"is",
"defined",
"by",
"reference",
"name",
"start",
"position",
"and",
"reference",
"bases",
"."
] | train | https://github.com/googlegenomics/utils-java/blob/7205d5b4e4f61fc6b93acb4bdd76b93df5b5f612/src/main/java/com/google/cloud/genomics/utils/grpc/VariantUtils.java#L261-L265 |
RestComm/jss7 | isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/parameter/CircuitAssigmentMapImpl.java | CircuitAssigmentMapImpl.enableCircuit | public void enableCircuit(int circuitNumber) throws IllegalArgumentException {
"""
Enables circuit
@param circuitNumber - index of circuit - must be number <1,31>
@throws IllegalArgumentException - when number is not in range
"""
if (circuitNumber < 1 || circuitNumber > 31) {
throw new ... | java | public void enableCircuit(int circuitNumber) throws IllegalArgumentException {
if (circuitNumber < 1 || circuitNumber > 31) {
throw new IllegalArgumentException("Cicruit number is out of range[" + circuitNumber + "] <1,31>");
}
this.mapFormat |= _CIRCUIT_ENABLED << (circuitNumber - ... | [
"public",
"void",
"enableCircuit",
"(",
"int",
"circuitNumber",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"circuitNumber",
"<",
"1",
"||",
"circuitNumber",
">",
"31",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cicruit number is ou... | Enables circuit
@param circuitNumber - index of circuit - must be number <1,31>
@throws IllegalArgumentException - when number is not in range | [
"Enables",
"circuit"
] | train | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/parameter/CircuitAssigmentMapImpl.java#L113-L119 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuGraphGetRootNodes | public static int cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode rootNodes[], long numRootNodes[]) {
"""
Returns a graph's root nodes.<br>
<br>
Returns a list of \p hGraph's root nodes. \p rootNodes may be NULL, in which case this
function will return the number of root nodes in \p numRootNodes. Otherwise,
\p... | java | public static int cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode rootNodes[], long numRootNodes[])
{
return checkResult(cuGraphGetRootNodesNative(hGraph, rootNodes, numRootNodes));
} | [
"public",
"static",
"int",
"cuGraphGetRootNodes",
"(",
"CUgraph",
"hGraph",
",",
"CUgraphNode",
"rootNodes",
"[",
"]",
",",
"long",
"numRootNodes",
"[",
"]",
")",
"{",
"return",
"checkResult",
"(",
"cuGraphGetRootNodesNative",
"(",
"hGraph",
",",
"rootNodes",
",... | Returns a graph's root nodes.<br>
<br>
Returns a list of \p hGraph's root nodes. \p rootNodes may be NULL, in which case this
function will return the number of root nodes in \p numRootNodes. Otherwise,
\p numRootNodes entries will be filled in. If \p numRootNodes is higher than the actual
number of root nodes, the rem... | [
"Returns",
"a",
"graph",
"s",
"root",
"nodes",
".",
"<br",
">",
"<br",
">",
"Returns",
"a",
"list",
"of",
"\\",
"p",
"hGraph",
"s",
"root",
"nodes",
".",
"\\",
"p",
"rootNodes",
"may",
"be",
"NULL",
"in",
"which",
"case",
"this",
"function",
"will",
... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L12710-L12713 |
molgenis/molgenis | molgenis-one-click-importer/src/main/java/org/molgenis/oneclickimporter/service/impl/AttributeTypeServiceImpl.java | AttributeTypeServiceImpl.isBroader | private boolean isBroader(AttributeType enrichedTypeGuess, AttributeType columnTypeGuess) {
"""
Check if the new enriched type is broader the the previously found type
@return
"""
if (columnTypeGuess == null && enrichedTypeGuess != null || columnTypeGuess == null) {
return true;
}
switch ... | java | private boolean isBroader(AttributeType enrichedTypeGuess, AttributeType columnTypeGuess) {
if (columnTypeGuess == null && enrichedTypeGuess != null || columnTypeGuess == null) {
return true;
}
switch (columnTypeGuess) {
case INT:
return enrichedTypeGuess.equals(INT)
|| enri... | [
"private",
"boolean",
"isBroader",
"(",
"AttributeType",
"enrichedTypeGuess",
",",
"AttributeType",
"columnTypeGuess",
")",
"{",
"if",
"(",
"columnTypeGuess",
"==",
"null",
"&&",
"enrichedTypeGuess",
"!=",
"null",
"||",
"columnTypeGuess",
"==",
"null",
")",
"{",
"... | Check if the new enriched type is broader the the previously found type
@return | [
"Check",
"if",
"the",
"new",
"enriched",
"type",
"is",
"broader",
"the",
"the",
"previously",
"found",
"type"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-one-click-importer/src/main/java/org/molgenis/oneclickimporter/service/impl/AttributeTypeServiceImpl.java#L62-L99 |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/ParallelStreamReader.java | ParallelStreamReader.performReads | private void performReads(ReadResult readResult) throws InterruptedException {
"""
Performs a batch of reads from the given streams and waits
for the reads to finish.
"""
long start = System.currentTimeMillis();
for (int i = 0; i < streams.length; ) {
boolean acquired = slots.tryAcquire(1, 10, T... | java | private void performReads(ReadResult readResult) throws InterruptedException {
long start = System.currentTimeMillis();
for (int i = 0; i < streams.length; ) {
boolean acquired = slots.tryAcquire(1, 10, TimeUnit.SECONDS);
reporter.progress();
if (acquired) {
readPool.execute(new ReadOp... | [
"private",
"void",
"performReads",
"(",
"ReadResult",
"readResult",
")",
"throws",
"InterruptedException",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"streams",
".",
"lengt... | Performs a batch of reads from the given streams and waits
for the reads to finish. | [
"Performs",
"a",
"batch",
"of",
"reads",
"from",
"the",
"given",
"streams",
"and",
"waits",
"for",
"the",
"reads",
"to",
"finish",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/ParallelStreamReader.java#L284-L307 |
bmelnychuk/AndroidTreeView | library/src/main/java/com/unnamed/b/atv/view/TwoDScrollView.java | TwoDScrollView.findFocusableViewInMyBounds | private View findFocusableViewInMyBounds(final boolean topFocus, final int top, final boolean leftFocus, final int left, View preferredFocusable) {
"""
Finds the next focusable component that fits in this View's bounds
(excluding fading edges) pretending that this View's top is located at
the parameter top.
@... | java | private View findFocusableViewInMyBounds(final boolean topFocus, final int top, final boolean leftFocus, final int left, View preferredFocusable) {
/*
* The fading edge's transparent side should be considered for focus
* since it's mostly visible, so we divide the actual fading edge length
* by 2.
*/
... | [
"private",
"View",
"findFocusableViewInMyBounds",
"(",
"final",
"boolean",
"topFocus",
",",
"final",
"int",
"top",
",",
"final",
"boolean",
"leftFocus",
",",
"final",
"int",
"left",
",",
"View",
"preferredFocusable",
")",
"{",
"/*\n * The fading edge's transparent s... | Finds the next focusable component that fits in this View's bounds
(excluding fading edges) pretending that this View's top is located at
the parameter top.
@param topFocus look for a candidate is the one at the top of the bounds
if topFocus is true, or at the bottom of the bounds if topFocus is
false
@param... | [
"Finds",
"the",
"next",
"focusable",
"component",
"that",
"fits",
"in",
"this",
"View",
"s",
"bounds",
"(",
"excluding",
"fading",
"edges",
")",
"pretending",
"that",
"this",
"View",
"s",
"top",
"is",
"located",
"at",
"the",
"parameter",
"top",
"."
] | train | https://github.com/bmelnychuk/AndroidTreeView/blob/d051ce75f5c9bd5206481808f6133b51f581c8f1/library/src/main/java/com/unnamed/b/atv/view/TwoDScrollView.java#L460-L481 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java | HtmlTree.META | public static HtmlTree META(String httpEquiv, String content, String charSet) {
"""
Generates a META tag with the http-equiv, content and charset attributes.
@param httpEquiv http equiv attribute for the META tag
@param content type of content
@param charSet character set used
@return an HtmlTree object for ... | java | public static HtmlTree META(String httpEquiv, String content, String charSet) {
HtmlTree htmltree = new HtmlTree(HtmlTag.META);
String contentCharset = content + "; charset=" + charSet;
htmltree.addAttr(HtmlAttr.HTTP_EQUIV, nullCheck(httpEquiv));
htmltree.addAttr(HtmlAttr.CONTENT, conten... | [
"public",
"static",
"HtmlTree",
"META",
"(",
"String",
"httpEquiv",
",",
"String",
"content",
",",
"String",
"charSet",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"META",
")",
";",
"String",
"contentCharset",
"=",
"content... | Generates a META tag with the http-equiv, content and charset attributes.
@param httpEquiv http equiv attribute for the META tag
@param content type of content
@param charSet character set used
@return an HtmlTree object for the META tag | [
"Generates",
"a",
"META",
"tag",
"with",
"the",
"http",
"-",
"equiv",
"content",
"and",
"charset",
"attributes",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L576-L582 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Mutator.java | Mutator.mutateResidue | public AminoAcid mutateResidue(AminoAcid oldAmino, String newType)
throws PDBParseException {
"""
create a new residue which is of the new type.
Only the atoms N, Ca, C, O, Cb will be considered.
@param oldAmino
@param newType
@return a new, mutated, residue
@throws PDBParseException
"""
AminoAcid new... | java | public AminoAcid mutateResidue(AminoAcid oldAmino, String newType)
throws PDBParseException {
AminoAcid newgroup = new AminoAcidImpl();
newgroup.setResidueNumber(oldAmino.getResidueNumber());
newgroup.setPDBName(newType);
AtomIterator aiter =new AtomIterator(oldAmino);
while (aiter.hasNext()){
Atom a ... | [
"public",
"AminoAcid",
"mutateResidue",
"(",
"AminoAcid",
"oldAmino",
",",
"String",
"newType",
")",
"throws",
"PDBParseException",
"{",
"AminoAcid",
"newgroup",
"=",
"new",
"AminoAcidImpl",
"(",
")",
";",
"newgroup",
".",
"setResidueNumber",
"(",
"oldAmino",
".",... | create a new residue which is of the new type.
Only the atoms N, Ca, C, O, Cb will be considered.
@param oldAmino
@param newType
@return a new, mutated, residue
@throws PDBParseException | [
"create",
"a",
"new",
"residue",
"which",
"is",
"of",
"the",
"new",
"type",
".",
"Only",
"the",
"atoms",
"N",
"Ca",
"C",
"O",
"Cb",
"will",
"be",
"considered",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Mutator.java#L143-L162 |
bitcoinj/bitcoinj | wallettemplate/src/main/java/wallettemplate/utils/QRCodeImages.java | QRCodeImages.imageFromMatrix | private static Image imageFromMatrix(BitMatrix matrix) {
"""
Create a JavaFX Image from a BitMatrix
@param matrix the matrix
@return the QRCode Image
"""
int height = matrix.getHeight();
int width = matrix.getWidth();
WritableImage image = new WritableImage(width, height);
for... | java | private static Image imageFromMatrix(BitMatrix matrix) {
int height = matrix.getHeight();
int width = matrix.getWidth();
WritableImage image = new WritableImage(width, height);
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
Color color = ... | [
"private",
"static",
"Image",
"imageFromMatrix",
"(",
"BitMatrix",
"matrix",
")",
"{",
"int",
"height",
"=",
"matrix",
".",
"getHeight",
"(",
")",
";",
"int",
"width",
"=",
"matrix",
".",
"getWidth",
"(",
")",
";",
"WritableImage",
"image",
"=",
"new",
"... | Create a JavaFX Image from a BitMatrix
@param matrix the matrix
@return the QRCode Image | [
"Create",
"a",
"JavaFX",
"Image",
"from",
"a",
"BitMatrix"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/wallettemplate/src/main/java/wallettemplate/utils/QRCodeImages.java#L64-L75 |
sarxos/webcam-capture | webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java | Webcam.getImageBytes | public ByteBuffer getImageBytes() {
"""
Get RAW image ByteBuffer. It will always return buffer with 3 x 1 bytes per each pixel, where
RGB components are on (0, 1, 2) and color space is sRGB.<br>
<br>
<b>IMPORTANT!</b><br>
Some drivers can return direct ByteBuffer, so there is no guarantee that underlying bytes... | java | public ByteBuffer getImageBytes() {
if (!isReady()) {
return null;
}
assert driver != null;
assert device != null;
long t1 = 0;
long t2 = 0;
// some devices can support direct image buffers, and for those call
// processor task, and for those which does not support direct image
//... | [
"public",
"ByteBuffer",
"getImageBytes",
"(",
")",
"{",
"if",
"(",
"!",
"isReady",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"assert",
"driver",
"!=",
"null",
";",
"assert",
"device",
"!=",
"null",
";",
"long",
"t1",
"=",
"0",
";",
"long",
"t... | Get RAW image ByteBuffer. It will always return buffer with 3 x 1 bytes per each pixel, where
RGB components are on (0, 1, 2) and color space is sRGB.<br>
<br>
<b>IMPORTANT!</b><br>
Some drivers can return direct ByteBuffer, so there is no guarantee that underlying bytes
will not be released in next read image operatio... | [
"Get",
"RAW",
"image",
"ByteBuffer",
".",
"It",
"will",
"always",
"return",
"buffer",
"with",
"3",
"x",
"1",
"bytes",
"per",
"each",
"pixel",
"where",
"RGB",
"components",
"are",
"on",
"(",
"0",
"1",
"2",
")",
"and",
"color",
"space",
"is",
"sRGB",
"... | train | https://github.com/sarxos/webcam-capture/blob/efbdae04f9ba48db9ec621e94a9bcd6f031882c8/webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java#L711-L742 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/internal/operators/flowable/FlowableReplay.java | FlowableReplay.createFrom | @SuppressWarnings("unchecked")
public static <T> ConnectableFlowable<T> createFrom(Flowable<? extends T> source) {
"""
Creates a replaying ConnectableObservable with an unbounded buffer.
@param <T> the value type
@param source the source Publisher to use
@return the new ConnectableObservable instance
""... | java | @SuppressWarnings("unchecked")
public static <T> ConnectableFlowable<T> createFrom(Flowable<? extends T> source) {
Flowable<T> sourceCast = (Flowable<T>) source;
return create(sourceCast, DEFAULT_UNBOUNDED_FACTORY);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"ConnectableFlowable",
"<",
"T",
">",
"createFrom",
"(",
"Flowable",
"<",
"?",
"extends",
"T",
">",
"source",
")",
"{",
"Flowable",
"<",
"T",
">",
"sourceCast",
"=",
"... | Creates a replaying ConnectableObservable with an unbounded buffer.
@param <T> the value type
@param source the source Publisher to use
@return the new ConnectableObservable instance | [
"Creates",
"a",
"replaying",
"ConnectableObservable",
"with",
"an",
"unbounded",
"buffer",
"."
] | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/internal/operators/flowable/FlowableReplay.java#L83-L87 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/UniverseApi.java | UniverseApi.getUniverseStargatesStargateId | public StargateResponse getUniverseStargatesStargateId(Integer stargateId, String datasource, String ifNoneMatch)
throws ApiException {
"""
Get stargate information Get information on a stargate --- This route
expires daily at 11:05
@param stargateId
stargate_id integer (required)
@param datasour... | java | public StargateResponse getUniverseStargatesStargateId(Integer stargateId, String datasource, String ifNoneMatch)
throws ApiException {
ApiResponse<StargateResponse> resp = getUniverseStargatesStargateIdWithHttpInfo(stargateId, datasource,
ifNoneMatch);
return resp.getData();... | [
"public",
"StargateResponse",
"getUniverseStargatesStargateId",
"(",
"Integer",
"stargateId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"StargateResponse",
">",
"resp",
"=",
"getUniverseStargatesStar... | Get stargate information Get information on a stargate --- This route
expires daily at 11:05
@param stargateId
stargate_id integer (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch
ETag from a previous request. A 304 will be returned if this
mat... | [
"Get",
"stargate",
"information",
"Get",
"information",
"on",
"a",
"stargate",
"---",
"This",
"route",
"expires",
"daily",
"at",
"11",
":",
"05"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/UniverseApi.java#L2787-L2792 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java | JaiDebug.dumpTexCoords | public static void dumpTexCoords(AiMesh mesh, int coords) {
"""
Dumps a texture coordinate set of a mesh to stdout.
@param mesh the mesh
@param coords the coordinates
"""
if (!mesh.hasTexCoords(coords)) {
System.out.println("mesh has no texture coordinate set " + coords);
re... | java | public static void dumpTexCoords(AiMesh mesh, int coords) {
if (!mesh.hasTexCoords(coords)) {
System.out.println("mesh has no texture coordinate set " + coords);
return;
}
for (int i = 0; i < mesh.getNumVertices(); i++) {
int numComponents = mesh.getN... | [
"public",
"static",
"void",
"dumpTexCoords",
"(",
"AiMesh",
"mesh",
",",
"int",
"coords",
")",
"{",
"if",
"(",
"!",
"mesh",
".",
"hasTexCoords",
"(",
"coords",
")",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"mesh has no texture coordinate set \"... | Dumps a texture coordinate set of a mesh to stdout.
@param mesh the mesh
@param coords the coordinates | [
"Dumps",
"a",
"texture",
"coordinate",
"set",
"of",
"a",
"mesh",
"to",
"stdout",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java#L139-L159 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/util/Organizer.java | Organizer.addAll | public static <T> void addAll(Collection<T> aFrom, Collection<T> aTo) {
"""
All object to a given collection
@param <T>
the type class
@param aFrom
the collection to add from
@param aTo
the collection to add to.
"""
if (aFrom == null || aTo == null)
return; // do nothing
T object = null;
... | java | public static <T> void addAll(Collection<T> aFrom, Collection<T> aTo)
{
if (aFrom == null || aTo == null)
return; // do nothing
T object = null;
for (Iterator<T> i = aFrom.iterator(); i.hasNext();)
{
object = i.next();
if (object != null)
{
aTo.add(object);
}
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"aFrom",
",",
"Collection",
"<",
"T",
">",
"aTo",
")",
"{",
"if",
"(",
"aFrom",
"==",
"null",
"||",
"aTo",
"==",
"null",
")",
"return",
";",
"// do nothing\r",
"... | All object to a given collection
@param <T>
the type class
@param aFrom
the collection to add from
@param aTo
the collection to add to. | [
"All",
"object",
"to",
"a",
"given",
"collection"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Organizer.java#L694-L708 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java | ByteUtilities.networkByteOrderToInt | public static int networkByteOrderToInt(byte[] buf, int start, int count) {
"""
Returns the integer represented by up to 4 bytes in network byte order.
@param buf the buffer to read the bytes from
@param start
@param count
@return
"""
if (count > 4) {
throw new IllegalArgumentExceptio... | java | public static int networkByteOrderToInt(byte[] buf, int start, int count) {
if (count > 4) {
throw new IllegalArgumentException(
"Cannot handle more than 4 bytes");
}
int result = 0;
for (int i = 0; i < count; i++) {
result <<= 8;
... | [
"public",
"static",
"int",
"networkByteOrderToInt",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"start",
",",
"int",
"count",
")",
"{",
"if",
"(",
"count",
">",
"4",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot handle more than 4 bytes\""... | Returns the integer represented by up to 4 bytes in network byte order.
@param buf the buffer to read the bytes from
@param start
@param count
@return | [
"Returns",
"the",
"integer",
"represented",
"by",
"up",
"to",
"4",
"bytes",
"in",
"network",
"byte",
"order",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java#L36-L50 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java | GeometryUtilities.getSectionsFromCoordinates | public static List<LineString> getSectionsFromCoordinates( List<Coordinate> coordinates, double width ) {
"""
Extracts traversal sections of a given with from the supplied {@link Coordinate}s.
@param coordinates the list of coordinates.
@param width the total with of the sections.
@return the list of {@link L... | java | public static List<LineString> getSectionsFromCoordinates( List<Coordinate> coordinates, double width ) {
if (coordinates.size() < 3) {
throw new IllegalArgumentException("This method works only on lines with at least 3 coordinates.");
}
double halfWidth = width / 2.0;
List<... | [
"public",
"static",
"List",
"<",
"LineString",
">",
"getSectionsFromCoordinates",
"(",
"List",
"<",
"Coordinate",
">",
"coordinates",
",",
"double",
"width",
")",
"{",
"if",
"(",
"coordinates",
".",
"size",
"(",
")",
"<",
"3",
")",
"{",
"throw",
"new",
"... | Extracts traversal sections of a given with from the supplied {@link Coordinate}s.
@param coordinates the list of coordinates.
@param width the total with of the sections.
@return the list of {@link LineString sections}. | [
"Extracts",
"traversal",
"sections",
"of",
"a",
"given",
"with",
"from",
"the",
"supplied",
"{",
"@link",
"Coordinate",
"}",
"s",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java#L490-L536 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/DoubleCheckedLocking.java | DoubleCheckedLocking.isImmutable | private static boolean isImmutable(Type type, VisitorState state) {
"""
Recognize a small set of known-immutable types that are safe for DCL even without a volatile
field.
"""
switch (type.getKind()) {
case BOOLEAN:
case BYTE:
case SHORT:
case INT:
case CHAR:
case FLOAT... | java | private static boolean isImmutable(Type type, VisitorState state) {
switch (type.getKind()) {
case BOOLEAN:
case BYTE:
case SHORT:
case INT:
case CHAR:
case FLOAT:
return true;
case LONG:
case DOUBLE:
// double-width primitives aren't written atomicall... | [
"private",
"static",
"boolean",
"isImmutable",
"(",
"Type",
"type",
",",
"VisitorState",
"state",
")",
"{",
"switch",
"(",
"type",
".",
"getKind",
"(",
")",
")",
"{",
"case",
"BOOLEAN",
":",
"case",
"BYTE",
":",
"case",
"SHORT",
":",
"case",
"INT",
":"... | Recognize a small set of known-immutable types that are safe for DCL even without a volatile
field. | [
"Recognize",
"a",
"small",
"set",
"of",
"known",
"-",
"immutable",
"types",
"that",
"are",
"safe",
"for",
"DCL",
"even",
"without",
"a",
"volatile",
"field",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/DoubleCheckedLocking.java#L116-L134 |
graphql-java/graphql-java | src/main/java/graphql/execution/ExecutionStrategy.java | ExecutionStrategy.completeValueForObject | protected CompletableFuture<ExecutionResult> completeValueForObject(ExecutionContext executionContext, ExecutionStrategyParameters parameters, GraphQLObjectType resolvedObjectType, Object result) {
"""
Called to turn an java object value into an graphql object value
@param executionContext contains the top le... | java | protected CompletableFuture<ExecutionResult> completeValueForObject(ExecutionContext executionContext, ExecutionStrategyParameters parameters, GraphQLObjectType resolvedObjectType, Object result) {
ExecutionStepInfo executionStepInfo = parameters.getExecutionStepInfo();
FieldCollectorParameters collect... | [
"protected",
"CompletableFuture",
"<",
"ExecutionResult",
">",
"completeValueForObject",
"(",
"ExecutionContext",
"executionContext",
",",
"ExecutionStrategyParameters",
"parameters",
",",
"GraphQLObjectType",
"resolvedObjectType",
",",
"Object",
"result",
")",
"{",
"Executio... | Called to turn an java object value into an graphql object value
@param executionContext contains the top level execution parameters
@param parameters contains the parameters holding the fields to be executed and source object
@param resolvedObjectType the resolved object type
@param result the r... | [
"Called",
"to",
"turn",
"an",
"java",
"object",
"value",
"into",
"an",
"graphql",
"object",
"value"
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/ExecutionStrategy.java#L614-L639 |
skyscreamer/JSONassert | src/main/java/org/skyscreamer/jsonassert/JSONAssert.java | JSONAssert.assertEquals | public static void assertEquals(String message, String expectedStr, String actualStr, JSONComparator comparator)
throws JSONException {
"""
Asserts that the json string provided matches the expected string. If it isn't it throws an
{@link AssertionError}.
@param message Error message to be displayed i... | java | public static void assertEquals(String message, String expectedStr, String actualStr, JSONComparator comparator)
throws JSONException {
JSONCompareResult result = JSONCompare.compareJSON(expectedStr, actualStr, comparator);
if (result.failed()) {
throw new AssertionError(getCombinedM... | [
"public",
"static",
"void",
"assertEquals",
"(",
"String",
"message",
",",
"String",
"expectedStr",
",",
"String",
"actualStr",
",",
"JSONComparator",
"comparator",
")",
"throws",
"JSONException",
"{",
"JSONCompareResult",
"result",
"=",
"JSONCompare",
".",
"compare... | Asserts that the json string provided matches the expected string. If it isn't it throws an
{@link AssertionError}.
@param message Error message to be displayed in case of assertion failure
@param expectedStr Expected JSON string
@param actualStr String to compare
@param comparator Comparator
@throws JSONException JS... | [
"Asserts",
"that",
"the",
"json",
"string",
"provided",
"matches",
"the",
"expected",
"string",
".",
"If",
"it",
"isn",
"t",
"it",
"throws",
"an",
"{",
"@link",
"AssertionError",
"}",
"."
] | train | https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONAssert.java#L478-L484 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/ProviderRest.java | ProviderRest.createProvider | @POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response createProvider(@Context HttpHeaders hh,@Context UriInfo uriInfo, String payload)
throws IOException, JAXBException {
"""
Creates a new provider
<pre>
POST /providers
Request:
POST /prov... | java | @POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response createProvider(@Context HttpHeaders hh,@Context UriInfo uriInfo, String payload)
throws IOException, JAXBException {
logger.debug("StartOf createProvider - REQUEST Insert /providers")... | [
"@",
"POST",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"public",
"Response",
"createProvider",
"(",
"@",
"Context",
"HttpHeaders",
"hh",
",",
"@",
"Context",
"UriInfo",
"uriI... | Creates a new provider
<pre>
POST /providers
Request:
POST /providers HTTP/1.1
Accept: application/xml
Response:
{@code
<provider>
<uuid>fc993580-03fe-41eb-8a21-a56709f9370f</uuid>
<name>provider-3</name>
</provider>
}
</pre>
Example: <li>curl -H "Content-type: application/xml" -X POST -d
@provider.xml localhos... | [
"Creates",
"a",
"new",
"provider"
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/ProviderRest.java#L201-L224 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/transport/remote/jgroups/JGroupsTransport.java | JGroupsTransport.addWorkManager | public void addWorkManager(org.ironjacamar.core.spi.workmanager.Address logicalAddress, org.jgroups.Address address) {
"""
Delegator
@param logicalAddress The logical address
@param address The address
"""
super.localWorkManagerAdd(logicalAddress, address);
} | java | public void addWorkManager(org.ironjacamar.core.spi.workmanager.Address logicalAddress, org.jgroups.Address address)
{
super.localWorkManagerAdd(logicalAddress, address);
} | [
"public",
"void",
"addWorkManager",
"(",
"org",
".",
"ironjacamar",
".",
"core",
".",
"spi",
".",
"workmanager",
".",
"Address",
"logicalAddress",
",",
"org",
".",
"jgroups",
".",
"Address",
"address",
")",
"{",
"super",
".",
"localWorkManagerAdd",
"(",
"log... | Delegator
@param logicalAddress The logical address
@param address The address | [
"Delegator"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/transport/remote/jgroups/JGroupsTransport.java#L298-L301 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/web/WebApplicationConfiguration.java | WebApplicationConfiguration.getMenuItem | public WebMenuItem getMenuItem(String menuName, String path) {
"""
Get the menu item by menu and path
@param menuName
@param path
@return the menu item within the specified menu tree with the matching path/name
"""
try{
return menuItemPaths.get(menuName).get(path);
}catch(Exception e){
log.err... | java | public WebMenuItem getMenuItem(String menuName, String path){
try{
return menuItemPaths.get(menuName).get(path);
}catch(Exception e){
log.error("Error when getting menu item for: menuName='" + menuName + "', path='" + path + "'", e);
return null;
}
} | [
"public",
"WebMenuItem",
"getMenuItem",
"(",
"String",
"menuName",
",",
"String",
"path",
")",
"{",
"try",
"{",
"return",
"menuItemPaths",
".",
"get",
"(",
"menuName",
")",
".",
"get",
"(",
"path",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{... | Get the menu item by menu and path
@param menuName
@param path
@return the menu item within the specified menu tree with the matching path/name | [
"Get",
"the",
"menu",
"item",
"by",
"menu",
"and",
"path"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/web/WebApplicationConfiguration.java#L211-L218 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/TileBoundingBoxMapUtils.java | TileBoundingBoxMapUtils.getLatitudeDistance | public static double getLatitudeDistance(double minLatitude,
double maxLatitude) {
"""
Get the latitude distance
@param minLatitude min latitude
@param maxLatitude max latitude
@return distance
"""
LatLng lowerMiddle = new LatLng(minLatitude, 0);
... | java | public static double getLatitudeDistance(double minLatitude,
double maxLatitude) {
LatLng lowerMiddle = new LatLng(minLatitude, 0);
LatLng upperMiddle = new LatLng(maxLatitude, 0);
double latDistance = SphericalUtil.computeDistanceBetween(lowerMiddle,... | [
"public",
"static",
"double",
"getLatitudeDistance",
"(",
"double",
"minLatitude",
",",
"double",
"maxLatitude",
")",
"{",
"LatLng",
"lowerMiddle",
"=",
"new",
"LatLng",
"(",
"minLatitude",
",",
"0",
")",
";",
"LatLng",
"upperMiddle",
"=",
"new",
"LatLng",
"("... | Get the latitude distance
@param minLatitude min latitude
@param maxLatitude max latitude
@return distance | [
"Get",
"the",
"latitude",
"distance"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/TileBoundingBoxMapUtils.java#L86-L93 |
xiancloud/xian | xian-oauth20/xian-apifestOauth20/src/main/java/com/apifest/oauth20/Authenticator.java | Authenticator.revokeToken | public Single<Boolean> revokeToken(FullHttpRequest req) throws OAuthException {
"""
revoke the given token. revoke = 撤销
@param req the requested token to be revoked
@return OAuthException if the given client id does not exist. true if the token exists and has been revoked, false if the token does not exist.
... | java | public Single<Boolean> revokeToken(FullHttpRequest req) throws OAuthException {
RevokeTokenRequest revokeRequest = new RevokeTokenRequest(req);
revokeRequest.checkMandatoryParams();
String clientId = revokeRequest.getClientId();
// check valid client_id, status does not matter as token o... | [
"public",
"Single",
"<",
"Boolean",
">",
"revokeToken",
"(",
"FullHttpRequest",
"req",
")",
"throws",
"OAuthException",
"{",
"RevokeTokenRequest",
"revokeRequest",
"=",
"new",
"RevokeTokenRequest",
"(",
"req",
")",
";",
"revokeRequest",
".",
"checkMandatoryParams",
... | revoke the given token. revoke = 撤销
@param req the requested token to be revoked
@return OAuthException if the given client id does not exist. true if the token exists and has been revoked, false if the token does not exist. | [
"revoke",
"the",
"given",
"token",
".",
"revoke",
"=",
"撤销"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-oauth20/xian-apifestOauth20/src/main/java/com/apifest/oauth20/Authenticator.java#L439-L473 |
apache/reef | lang/java/reef-utils/src/main/java/org/apache/reef/util/MultiAsyncToSync.java | MultiAsyncToSync.addSleeper | private void addSleeper(final long identifier, final ComplexCondition call) {
"""
Atomically add a coll to the sleeper map.
@param identifier The unique call identifier.
@param call The call object to be added to the sleeper map.
"""
if (sleeperMap.put(identifier, call) != null) {
throw new Runtime... | java | private void addSleeper(final long identifier, final ComplexCondition call) {
if (sleeperMap.put(identifier, call) != null) {
throw new RuntimeException(String.format("Duplicate identifier [%d] in sleeper map", identifier));
}
} | [
"private",
"void",
"addSleeper",
"(",
"final",
"long",
"identifier",
",",
"final",
"ComplexCondition",
"call",
")",
"{",
"if",
"(",
"sleeperMap",
".",
"put",
"(",
"identifier",
",",
"call",
")",
"!=",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"... | Atomically add a coll to the sleeper map.
@param identifier The unique call identifier.
@param call The call object to be added to the sleeper map. | [
"Atomically",
"add",
"a",
"coll",
"to",
"the",
"sleeper",
"map",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-utils/src/main/java/org/apache/reef/util/MultiAsyncToSync.java#L163-L167 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java | Configurer.getImplementation | public final <T> T getImplementation(ClassLoader loader,
Class<T> type,
Class<?>[] paramsType,
Collection<?> paramsValue,
String... path) {
"""
Get the... | java | public final <T> T getImplementation(ClassLoader loader,
Class<T> type,
Class<?>[] paramsType,
Collection<?> paramsValue,
String... path)
{
fina... | [
"public",
"final",
"<",
"T",
">",
"T",
"getImplementation",
"(",
"ClassLoader",
"loader",
",",
"Class",
"<",
"T",
">",
"type",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"paramsType",
",",
"Collection",
"<",
"?",
">",
"paramsValue",
",",
"String",
"...",
... | Get the class implementation from its name by using a custom constructor.
@param <T> The instance type.
@param loader The class loader to use.
@param type The class type.
@param paramsType The parameters type.
@param paramsValue The parameters value.
@param path The node path.
@return The typed class instance.
@throws... | [
"Get",
"the",
"class",
"implementation",
"from",
"its",
"name",
"by",
"using",
"a",
"custom",
"constructor",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java#L365-L373 |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/MBeansAccessor.java | MBeansAccessor.getAttribute | @SuppressWarnings("unchecked")
static <T> T getAttribute(ObjectName name, String attribute) throws JMException {
"""
donc on appelle les attributs des MBeans équivalents qui sont visibles dans tous les cas
"""
return (T) MBEAN_SERVER.getAttribute(name, attribute);
} | java | @SuppressWarnings("unchecked")
static <T> T getAttribute(ObjectName name, String attribute) throws JMException {
return (T) MBEAN_SERVER.getAttribute(name, attribute);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"<",
"T",
">",
"T",
"getAttribute",
"(",
"ObjectName",
"name",
",",
"String",
"attribute",
")",
"throws",
"JMException",
"{",
"return",
"(",
"T",
")",
"MBEAN_SERVER",
".",
"getAttribute",
"(",
"na... | donc on appelle les attributs des MBeans équivalents qui sont visibles dans tous les cas | [
"donc",
"on",
"appelle",
"les",
"attributs",
"des",
"MBeans",
"équivalents",
"qui",
"sont",
"visibles",
"dans",
"tous",
"les",
"cas"
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/MBeansAccessor.java#L89-L92 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/ModelUtils.java | ModelUtils.getPropertyValue | public static String getPropertyValue( AbstractBlockHolder holder, String propertyName ) {
"""
Gets the value of a property.
@param holder a property holder (not null)
@param propertyName a property name (not null)
@return the property value, which can be null, or null if the property was not found
"""
Bl... | java | public static String getPropertyValue( AbstractBlockHolder holder, String propertyName ) {
BlockProperty p = holder.findPropertyBlockByName( propertyName );
return p == null ? null : p.getValue();
} | [
"public",
"static",
"String",
"getPropertyValue",
"(",
"AbstractBlockHolder",
"holder",
",",
"String",
"propertyName",
")",
"{",
"BlockProperty",
"p",
"=",
"holder",
".",
"findPropertyBlockByName",
"(",
"propertyName",
")",
";",
"return",
"p",
"==",
"null",
"?",
... | Gets the value of a property.
@param holder a property holder (not null)
@param propertyName a property name (not null)
@return the property value, which can be null, or null if the property was not found | [
"Gets",
"the",
"value",
"of",
"a",
"property",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/ModelUtils.java#L63-L66 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsSqlManager.java | CmsSqlManager.replaceProjectPattern | protected static String replaceProjectPattern(CmsUUID projectId, String query) {
"""
Replaces the project search pattern in SQL queries by the pattern _ONLINE_ or _OFFLINE_ depending on the
specified project ID.<p>
@param projectId the ID of the current project
@param query the SQL query
@return String the S... | java | protected static String replaceProjectPattern(CmsUUID projectId, String query) {
// make the statement project dependent
String replacePattern = ((projectId == null) || projectId.equals(CmsProject.ONLINE_PROJECT_ID))
? "_ONLINE_"
: "_OFFLINE_";
return CmsStringUtil.substitute(qu... | [
"protected",
"static",
"String",
"replaceProjectPattern",
"(",
"CmsUUID",
"projectId",
",",
"String",
"query",
")",
"{",
"// make the statement project dependent",
"String",
"replacePattern",
"=",
"(",
"(",
"projectId",
"==",
"null",
")",
"||",
"projectId",
".",
"eq... | Replaces the project search pattern in SQL queries by the pattern _ONLINE_ or _OFFLINE_ depending on the
specified project ID.<p>
@param projectId the ID of the current project
@param query the SQL query
@return String the SQL query with the table key search pattern replaced | [
"Replaces",
"the",
"project",
"search",
"pattern",
"in",
"SQL",
"queries",
"by",
"the",
"pattern",
"_ONLINE_",
"or",
"_OFFLINE_",
"depending",
"on",
"the",
"specified",
"project",
"ID",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsSqlManager.java#L125-L132 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlGroupContainer.java | CmsXmlGroupContainer.saveGroupContainer | protected void saveGroupContainer(CmsObject cms, Element parent, CmsGroupContainerBean groupContainer)
throws CmsException {
"""
Adds the given container page to the given element.<p>
@param cms the current CMS object
@param parent the element to add it
@param groupContainer the container page to add
@... | java | protected void saveGroupContainer(CmsObject cms, Element parent, CmsGroupContainerBean groupContainer)
throws CmsException {
parent.clearContent();
Element groupContainerElem = parent.addElement(XmlNode.GroupContainers.name());
groupContainerElem.addElement(XmlNode.Title.name()).addCDATA(g... | [
"protected",
"void",
"saveGroupContainer",
"(",
"CmsObject",
"cms",
",",
"Element",
"parent",
",",
"CmsGroupContainerBean",
"groupContainer",
")",
"throws",
"CmsException",
"{",
"parent",
".",
"clearContent",
"(",
")",
";",
"Element",
"groupContainerElem",
"=",
"par... | Adds the given container page to the given element.<p>
@param cms the current CMS object
@param parent the element to add it
@param groupContainer the container page to add
@throws CmsException if something goes wrong | [
"Adds",
"the",
"given",
"container",
"page",
"to",
"the",
"given",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlGroupContainer.java#L410-L443 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.readResource | public I_CmsHistoryResource readResource(CmsUUID structureID, int version)
throws CmsException, CmsVfsResourceNotFoundException {
"""
Reads the historical resource with the given version for the resource given
the given structure id.<p>
A resource may be of type <code>{@link CmsFile}</code> or
<code>{@lin... | java | public I_CmsHistoryResource readResource(CmsUUID structureID, int version)
throws CmsException, CmsVfsResourceNotFoundException {
CmsResource resource = readResource(structureID, CmsResourceFilter.ALL);
return m_securityManager.readResource(m_context, resource, version);
} | [
"public",
"I_CmsHistoryResource",
"readResource",
"(",
"CmsUUID",
"structureID",
",",
"int",
"version",
")",
"throws",
"CmsException",
",",
"CmsVfsResourceNotFoundException",
"{",
"CmsResource",
"resource",
"=",
"readResource",
"(",
"structureID",
",",
"CmsResourceFilter"... | Reads the historical resource with the given version for the resource given
the given structure id.<p>
A resource may be of type <code>{@link CmsFile}</code> or
<code>{@link CmsFolder}</code>. In case of a file, the resource will not
contain the binary file content. Since reading the binary content is a
cost-expensive... | [
"Reads",
"the",
"historical",
"resource",
"with",
"the",
"given",
"version",
"for",
"the",
"resource",
"given",
"the",
"given",
"structure",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L3146-L3151 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java | DefaultRenditionHandler.getVirtualRendition | private RenditionMetadata getVirtualRendition(RenditionMetadata rendition, long widthValue, long heightValue, double ratioValue) {
"""
Get virtual rendition for given width/height/ratio.
@param rendition Rendition
@param widthValue Width
@param heightValue Height
@param ratioValue Ratio
@return Rendition or n... | java | private RenditionMetadata getVirtualRendition(RenditionMetadata rendition, long widthValue, long heightValue, double ratioValue) {
long width = widthValue;
long height = heightValue;
double ratio = ratioValue;
// if ratio is missing: calculate from given rendition
if (ratio < MediaFormatHandler.RA... | [
"private",
"RenditionMetadata",
"getVirtualRendition",
"(",
"RenditionMetadata",
"rendition",
",",
"long",
"widthValue",
",",
"long",
"heightValue",
",",
"double",
"ratioValue",
")",
"{",
"long",
"width",
"=",
"widthValue",
";",
"long",
"height",
"=",
"heightValue",... | Get virtual rendition for given width/height/ratio.
@param rendition Rendition
@param widthValue Width
@param heightValue Height
@param ratioValue Ratio
@return Rendition or null | [
"Get",
"virtual",
"rendition",
"for",
"given",
"width",
"/",
"height",
"/",
"ratio",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java#L419-L454 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java | ModuleSummaryBuilder.buildModuleTags | public void buildModuleTags(XMLNode node, Content moduleContentTree) {
"""
Build the tags of the summary.
@param node the XML element that specifies which components to document
@param moduleContentTree the tree to which the module tags will be added
"""
if (!configuration.nocomment) {
... | java | public void buildModuleTags(XMLNode node, Content moduleContentTree) {
if (!configuration.nocomment) {
moduleWriter.addModuleTags(moduleContentTree);
}
} | [
"public",
"void",
"buildModuleTags",
"(",
"XMLNode",
"node",
",",
"Content",
"moduleContentTree",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"nocomment",
")",
"{",
"moduleWriter",
".",
"addModuleTags",
"(",
"moduleContentTree",
")",
";",
"}",
"}"
] | Build the tags of the summary.
@param node the XML element that specifies which components to document
@param moduleContentTree the tree to which the module tags will be added | [
"Build",
"the",
"tags",
"of",
"the",
"summary",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ModuleSummaryBuilder.java#L219-L223 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java | PersistenceBrokerImpl.getIteratorFromQuery | protected OJBIterator getIteratorFromQuery(Query query, ClassDescriptor cld) throws PersistenceBrokerException {
"""
Get an extent aware Iterator based on the Query
@param query
@param cld the ClassDescriptor
@return OJBIterator
"""
RsIteratorFactory factory = RsIteratorFactoryImpl.getInstance();
... | java | protected OJBIterator getIteratorFromQuery(Query query, ClassDescriptor cld) throws PersistenceBrokerException
{
RsIteratorFactory factory = RsIteratorFactoryImpl.getInstance();
OJBIterator result = getRsIteratorFromQuery(query, cld, factory);
if (query.usePaging())
{
re... | [
"protected",
"OJBIterator",
"getIteratorFromQuery",
"(",
"Query",
"query",
",",
"ClassDescriptor",
"cld",
")",
"throws",
"PersistenceBrokerException",
"{",
"RsIteratorFactory",
"factory",
"=",
"RsIteratorFactoryImpl",
".",
"getInstance",
"(",
")",
";",
"OJBIterator",
"r... | Get an extent aware Iterator based on the Query
@param query
@param cld the ClassDescriptor
@return OJBIterator | [
"Get",
"an",
"extent",
"aware",
"Iterator",
"based",
"on",
"the",
"Query"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java#L1665-L1675 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/ByteArrayUtil.java | ByteArrayUtil.getIntBE | public static int getIntBE(final byte[] array, final int offset) {
"""
Get a <i>int</i> from the given byte array starting at the given offset
in big endian order.
There is no bounds checking.
@param array source byte array
@param offset source offset
@return the <i>int</i>
"""
return ( array[offset ... | java | public static int getIntBE(final byte[] array, final int offset) {
return ( array[offset + 3] & 0XFF )
| ((array[offset + 2] & 0XFF) << 8)
| ((array[offset + 1] & 0XFF) << 16)
| ((array[offset ] & 0XFF) << 24);
} | [
"public",
"static",
"int",
"getIntBE",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
")",
"{",
"return",
"(",
"array",
"[",
"offset",
"+",
"3",
"]",
"&",
"0XFF",
")",
"|",
"(",
"(",
"array",
"[",
"offset",
"+",
"2",
"]",... | Get a <i>int</i> from the given byte array starting at the given offset
in big endian order.
There is no bounds checking.
@param array source byte array
@param offset source offset
@return the <i>int</i> | [
"Get",
"a",
"<i",
">",
"int<",
"/",
"i",
">",
"from",
"the",
"given",
"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#L95-L100 |
hubrick/vertx-rest-client | src/main/java/com/hubrick/vertx/rest/MediaType.java | MediaType.parseMediaType | public static MediaType parseMediaType(String mediaType) {
"""
Parse the given String into a single {@code MediaType}.
@param mediaType the string to parse
@return the media type
@throws InvalidMediaTypeException if the string cannot be parsed
"""
MimeType type;
try {
type = Mi... | java | public static MediaType parseMediaType(String mediaType) {
MimeType type;
try {
type = MimeTypeUtils.parseMimeType(mediaType);
} catch (InvalidMimeTypeException ex) {
throw new InvalidMediaTypeException(ex);
}
try {
return new MediaType(type.ge... | [
"public",
"static",
"MediaType",
"parseMediaType",
"(",
"String",
"mediaType",
")",
"{",
"MimeType",
"type",
";",
"try",
"{",
"type",
"=",
"MimeTypeUtils",
".",
"parseMimeType",
"(",
"mediaType",
")",
";",
"}",
"catch",
"(",
"InvalidMimeTypeException",
"ex",
"... | Parse the given String into a single {@code MediaType}.
@param mediaType the string to parse
@return the media type
@throws InvalidMediaTypeException if the string cannot be parsed | [
"Parse",
"the",
"given",
"String",
"into",
"a",
"single",
"{",
"@code",
"MediaType",
"}",
"."
] | train | https://github.com/hubrick/vertx-rest-client/blob/4e6715bc2fb031555fc635adbf94a53b9cfba81e/src/main/java/com/hubrick/vertx/rest/MediaType.java#L357-L369 |
seedstack/i18n-addon | rest/src/it/java/org/seedstack/i18n/shared/AbstractI18nRestIT.java | AbstractI18nRestIT.httpPut | protected Response httpPut(String path, String body) throws JSONException {
"""
Puts the body to the given path and expect a 200 status code.
@param path the resource URI
@param body the resource representation
@return the http response
"""
return httpPut(path, body, 204);
} | java | protected Response httpPut(String path, String body) throws JSONException {
return httpPut(path, body, 204);
} | [
"protected",
"Response",
"httpPut",
"(",
"String",
"path",
",",
"String",
"body",
")",
"throws",
"JSONException",
"{",
"return",
"httpPut",
"(",
"path",
",",
"body",
",",
"204",
")",
";",
"}"
] | Puts the body to the given path and expect a 200 status code.
@param path the resource URI
@param body the resource representation
@return the http response | [
"Puts",
"the",
"body",
"to",
"the",
"given",
"path",
"and",
"expect",
"a",
"200",
"status",
"code",
"."
] | train | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/it/java/org/seedstack/i18n/shared/AbstractI18nRestIT.java#L98-L100 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java | EJSContainer.notifyPostInvoke | private static <T> void notifyPostInvoke(EJBRequestCollaborator<T> collaborator, EJBRequestData request, Object preInvokeData) throws CSIException {
"""
Call {@link EJBRequestCollaborator#postInvoke}. Handles generics casting
and CSIException handling.
"""
try {
@SuppressWarnings("unchecke... | java | private static <T> void notifyPostInvoke(EJBRequestCollaborator<T> collaborator, EJBRequestData request, Object preInvokeData) throws CSIException {
try {
@SuppressWarnings("unchecked")
T uncheckedCookie = (T) preInvokeData;
collaborator.postInvoke(request, uncheckedCookie);
... | [
"private",
"static",
"<",
"T",
">",
"void",
"notifyPostInvoke",
"(",
"EJBRequestCollaborator",
"<",
"T",
">",
"collaborator",
",",
"EJBRequestData",
"request",
",",
"Object",
"preInvokeData",
")",
"throws",
"CSIException",
"{",
"try",
"{",
"@",
"SuppressWarnings",... | Call {@link EJBRequestCollaborator#postInvoke}. Handles generics casting
and CSIException handling. | [
"Call",
"{"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java#L3939-L3951 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/RingByteBuffer.java | RingByteBuffer.writeTo | public int writeTo(ByteBuffer bb) throws IOException {
"""
Writes bytes from mark (included) to position (excluded) to bb as much as
bb has remaining. bb positions are updated.
@param bb
@return
@throws IOException
"""
return writeTo((srcs, offset, len)->ByteBuffers.move(srcs, offset, len, bb), wr... | java | public int writeTo(ByteBuffer bb) throws IOException
{
return writeTo((srcs, offset, len)->ByteBuffers.move(srcs, offset, len, bb), writeToSplitter);
} | [
"public",
"int",
"writeTo",
"(",
"ByteBuffer",
"bb",
")",
"throws",
"IOException",
"{",
"return",
"writeTo",
"(",
"(",
"srcs",
",",
"offset",
",",
"len",
")",
"->",
"ByteBuffers",
".",
"move",
"(",
"srcs",
",",
"offset",
",",
"len",
",",
"bb",
")",
"... | Writes bytes from mark (included) to position (excluded) to bb as much as
bb has remaining. bb positions are updated.
@param bb
@return
@throws IOException | [
"Writes",
"bytes",
"from",
"mark",
"(",
"included",
")",
"to",
"position",
"(",
"excluded",
")",
"to",
"bb",
"as",
"much",
"as",
"bb",
"has",
"remaining",
".",
"bb",
"positions",
"are",
"updated",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/RingByteBuffer.java#L147-L150 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/LookupManagerImpl.java | LookupManagerImpl.addNotificationHandler | @Override
public void addNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException {
"""
Add a NotificationHandler to the Service.
This method can check the duplicate NotificationHandler for the serviceName, if the NotificationHandler
already exists in the serviceName, do... | java | @Override
public void addNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException {
if(! isStarted){
ServiceDirectoryError error = new ServiceDirectoryError(ErrorCode.SERVICE_DIRECTORY_MANAGER_FACTORY_CLOSED);
throw new ServiceException(error);
... | [
"@",
"Override",
"public",
"void",
"addNotificationHandler",
"(",
"String",
"serviceName",
",",
"NotificationHandler",
"handler",
")",
"throws",
"ServiceException",
"{",
"if",
"(",
"!",
"isStarted",
")",
"{",
"ServiceDirectoryError",
"error",
"=",
"new",
"ServiceDir... | Add a NotificationHandler to the Service.
This method can check the duplicate NotificationHandler for the serviceName, if the NotificationHandler
already exists in the serviceName, do nothing.
Throw IllegalArgumentException if serviceName or handler is null.
@param serviceName
the service name.
@param handler
the No... | [
"Add",
"a",
"NotificationHandler",
"to",
"the",
"Service",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/LookupManagerImpl.java#L419-L437 |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/index/schema/mapping/Mapping.java | Mapping.validate | public void validate(CFMetaData metadata) {
"""
Checks if this is consistent with the specified column family metadata.
@param metadata A column family metadata.
"""
for (Map.Entry<String, ColumnMapper> entry : columnMappers.entrySet()) {
String name = entry.getKey();
Column... | java | public void validate(CFMetaData metadata) {
for (Map.Entry<String, ColumnMapper> entry : columnMappers.entrySet()) {
String name = entry.getKey();
ColumnMapper columnMapper = entry.getValue();
ByteBuffer columnName = UTF8Type.instance.decompose(name);
ColumnDefi... | [
"public",
"void",
"validate",
"(",
"CFMetaData",
"metadata",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"ColumnMapper",
">",
"entry",
":",
"columnMappers",
".",
"entrySet",
"(",
")",
")",
"{",
"String",
"name",
"=",
"entry",
".",
"g... | Checks if this is consistent with the specified column family metadata.
@param metadata A column family metadata. | [
"Checks",
"if",
"this",
"is",
"consistent",
"with",
"the",
"specified",
"column",
"family",
"metadata",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/schema/mapping/Mapping.java#L50-L71 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/StringUtils.java | StringUtils.columnStringToObject | public static <T> T columnStringToObject(Class objClass, String str, String delimiterRegex, String[] fieldNames)
throws InstantiationException, IllegalAccessException, NoSuchFieldException, NoSuchMethodException, InvocationTargetException {
"""
Converts a tab delimited string into an object with given f... | java | public static <T> T columnStringToObject(Class objClass, String str, String delimiterRegex, String[] fieldNames)
throws InstantiationException, IllegalAccessException, NoSuchFieldException, NoSuchMethodException, InvocationTargetException
{
Pattern delimiterPattern = Pattern.compile(delimiterRegex);
... | [
"public",
"static",
"<",
"T",
">",
"T",
"columnStringToObject",
"(",
"Class",
"objClass",
",",
"String",
"str",
",",
"String",
"delimiterRegex",
",",
"String",
"[",
"]",
"fieldNames",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
",",
"... | Converts a tab delimited string into an object with given fields
Requires the object has setXxx functions for the specified fields
@param objClass Class of object to be created
@param str string to convert
@param delimiterRegex delimiter regular expression
@param fieldNames fieldnames
@param <T> type to return
@return... | [
"Converts",
"a",
"tab",
"delimited",
"string",
"into",
"an",
"object",
"with",
"given",
"fields",
"Requires",
"the",
"object",
"has",
"setXxx",
"functions",
"for",
"the",
"specified",
"fields"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L1345-L1350 |
aws/aws-sdk-java | aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/model/DocumentVersionMetadata.java | DocumentVersionMetadata.withSource | public DocumentVersionMetadata withSource(java.util.Map<String, String> source) {
"""
<p>
The source of the document.
</p>
@param source
The source of the document.
@return Returns a reference to this object so that method calls can be chained together.
"""
setSource(source);
return this... | java | public DocumentVersionMetadata withSource(java.util.Map<String, String> source) {
setSource(source);
return this;
} | [
"public",
"DocumentVersionMetadata",
"withSource",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"source",
")",
"{",
"setSource",
"(",
"source",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The source of the document.
</p>
@param source
The source of the document.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"source",
"of",
"the",
"document",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/model/DocumentVersionMetadata.java#L679-L682 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.calculateMinimizationProcessingStartIndex | private int calculateMinimizationProcessingStartIndex(String prevStr, String currStr) {
"""
计算最小化的执行位置,其实是prevStr和currStr的第一个分叉点<br>
Determines the start index of the substring in the String most recently added to the MDAG
that corresponds to the _transition path that will be next up for minimization processing.... | java | private int calculateMinimizationProcessingStartIndex(String prevStr, String currStr)
{
int mpsIndex;
if (!currStr.startsWith(prevStr))
{
//Loop through the corresponding indices of both Strings in search of the first index containing differing characters.
//The _tra... | [
"private",
"int",
"calculateMinimizationProcessingStartIndex",
"(",
"String",
"prevStr",
",",
"String",
"currStr",
")",
"{",
"int",
"mpsIndex",
";",
"if",
"(",
"!",
"currStr",
".",
"startsWith",
"(",
"prevStr",
")",
")",
"{",
"//Loop through the corresponding indice... | 计算最小化的执行位置,其实是prevStr和currStr的第一个分叉点<br>
Determines the start index of the substring in the String most recently added to the MDAG
that corresponds to the _transition path that will be next up for minimization processing.
<p/>
The "minimization processing start index" is defined as the index in {@code prevStr} which st... | [
"计算最小化的执行位置,其实是prevStr和currStr的第一个分叉点<br",
">",
"Determines",
"the",
"start",
"index",
"of",
"the",
"substring",
"in",
"the",
"String",
"most",
"recently",
"added",
"to",
"the",
"MDAG",
"that",
"corresponds",
"to",
"the",
"_transition",
"path",
"that",
"will",
"be... | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L430-L451 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.beginDeleteInstances | public OperationStatusResponseInner beginDeleteInstances(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) {
"""
Deletes virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceIds ... | java | public OperationStatusResponseInner beginDeleteInstances(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) {
return beginDeleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().body();
} | [
"public",
"OperationStatusResponseInner",
"beginDeleteInstances",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"List",
"<",
"String",
">",
"instanceIds",
")",
"{",
"return",
"beginDeleteInstancesWithServiceResponseAsync",
"(",
"resourceGroupName",... | Deletes virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceIds The virtual machine scale set instance ids.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown... | [
"Deletes",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L1199-L1201 |
sagiegurari/fax4j | src/main/java/org/fax4j/common/SimpleLogger.java | SimpleLogger.logImpl | @Override
protected void logImpl(LogLevel level,Object[] message,Throwable throwable) {
"""
Logs the provided data.
@param level
The log level
@param message
The message parts (may be null)
@param throwable
The error (may be null)
"""
//format log message
String text=this.form... | java | @Override
protected void logImpl(LogLevel level,Object[] message,Throwable throwable)
{
//format log message
String text=this.formatLogMessage(level,message,throwable);
//print text to system out
System.out.println(text);
} | [
"@",
"Override",
"protected",
"void",
"logImpl",
"(",
"LogLevel",
"level",
",",
"Object",
"[",
"]",
"message",
",",
"Throwable",
"throwable",
")",
"{",
"//format log message",
"String",
"text",
"=",
"this",
".",
"formatLogMessage",
"(",
"level",
",",
"message"... | Logs the provided data.
@param level
The log level
@param message
The message parts (may be null)
@param throwable
The error (may be null) | [
"Logs",
"the",
"provided",
"data",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/common/SimpleLogger.java#L31-L39 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java | ConfigUtils.propertiesToConfig | public static Config propertiesToConfig(Properties properties, Optional<String> prefix) {
"""
Convert all the keys that start with a <code>prefix</code> in {@link Properties} to a {@link Config} instance.
<p>
This method will throw an exception if (1) the {@link Object#toString()} method of any two keys in the... | java | public static Config propertiesToConfig(Properties properties, Optional<String> prefix) {
Set<String> blacklistedKeys = new HashSet<>();
if (properties.containsKey(GOBBLIN_CONFIG_BLACKLIST_KEYS)) {
blacklistedKeys = new HashSet<>(Splitter.on(',').omitEmptyStrings().trimResults()
.splitToList(pro... | [
"public",
"static",
"Config",
"propertiesToConfig",
"(",
"Properties",
"properties",
",",
"Optional",
"<",
"String",
">",
"prefix",
")",
"{",
"Set",
"<",
"String",
">",
"blacklistedKeys",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"if",
"(",
"properties",
... | Convert all the keys that start with a <code>prefix</code> in {@link Properties} to a {@link Config} instance.
<p>
This method will throw an exception if (1) the {@link Object#toString()} method of any two keys in the
{@link Properties} objects returns the same {@link String}, or (2) if any two keys are prefixes of on... | [
"Convert",
"all",
"the",
"keys",
"that",
"start",
"with",
"a",
"<code",
">",
"prefix<",
"/",
"code",
">",
"in",
"{",
"@link",
"Properties",
"}",
"to",
"a",
"{",
"@link",
"Config",
"}",
"instance",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java#L211-L234 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BooleanField.java | BooleanField.getSQLFromField | public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException {
"""
Move the physical binary data to this SQL parameter row.
@param statement The SQL prepare statement.
@param iType the type of SQL statement.
@param iParamColumn The column in the prepared statement to... | java | public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException
{
if (this.isNull())
statement.setNull(iParamColumn, Types.BIT);
else
{
String strBitSupported = DBConstants.TRUE;
if (this.getRecord() != null)
... | [
"public",
"void",
"getSQLFromField",
"(",
"PreparedStatement",
"statement",
",",
"int",
"iType",
",",
"int",
"iParamColumn",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"this",
".",
"isNull",
"(",
")",
")",
"statement",
".",
"setNull",
"(",
"iParamColumn",
... | Move the physical binary data to this SQL parameter row.
@param statement The SQL prepare statement.
@param iType the type of SQL statement.
@param iParamColumn The column in the prepared statement to set the data.
@exception SQLException From SQL calls. | [
"Move",
"the",
"physical",
"binary",
"data",
"to",
"this",
"SQL",
"parameter",
"row",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BooleanField.java#L181-L197 |
wildfly/wildfly-core | logging/src/main/java/org/jboss/as/logging/LoggingExtension.java | LoggingExtension.getResourceDescriptionResolver | public static ResourceDescriptionResolver getResourceDescriptionResolver(final String... keyPrefix) {
"""
Returns a resource description resolver that uses common descriptions for some attributes.
@param keyPrefix the prefix to be appended to the {@link LoggingExtension#SUBSYSTEM_NAME}
@return the resolver
... | java | public static ResourceDescriptionResolver getResourceDescriptionResolver(final String... keyPrefix) {
StringBuilder prefix = new StringBuilder(SUBSYSTEM_NAME);
for (String kp : keyPrefix) {
prefix.append('.').append(kp);
}
return new StandardResourceDescriptionResolver(prefix... | [
"public",
"static",
"ResourceDescriptionResolver",
"getResourceDescriptionResolver",
"(",
"final",
"String",
"...",
"keyPrefix",
")",
"{",
"StringBuilder",
"prefix",
"=",
"new",
"StringBuilder",
"(",
"SUBSYSTEM_NAME",
")",
";",
"for",
"(",
"String",
"kp",
":",
"keyP... | Returns a resource description resolver that uses common descriptions for some attributes.
@param keyPrefix the prefix to be appended to the {@link LoggingExtension#SUBSYSTEM_NAME}
@return the resolver | [
"Returns",
"a",
"resource",
"description",
"resolver",
"that",
"uses",
"common",
"descriptions",
"for",
"some",
"attributes",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/logging/src/main/java/org/jboss/as/logging/LoggingExtension.java#L130-L161 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/convert/LongConverter.java | LongConverter.toLongWithDefault | public static long toLongWithDefault(Object value, long defaultValue) {
"""
Converts value into integer or returns default when conversion is not
possible.
@param value the value to convert.
@param defaultValue the default value.
@return long value or default when conversion is not supported
@see L... | java | public static long toLongWithDefault(Object value, long defaultValue) {
Long result = toNullableLong(value);
return result != null ? (long) result : defaultValue;
} | [
"public",
"static",
"long",
"toLongWithDefault",
"(",
"Object",
"value",
",",
"long",
"defaultValue",
")",
"{",
"Long",
"result",
"=",
"toNullableLong",
"(",
"value",
")",
";",
"return",
"result",
"!=",
"null",
"?",
"(",
"long",
")",
"result",
":",
"defaul... | Converts value into integer or returns default when conversion is not
possible.
@param value the value to convert.
@param defaultValue the default value.
@return long value or default when conversion is not supported
@see LongConverter#toNullableLong(Object) | [
"Converts",
"value",
"into",
"integer",
"or",
"returns",
"default",
"when",
"conversion",
"is",
"not",
"possible",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/convert/LongConverter.java#L90-L93 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.contains | public static <T extends Tree, V extends Tree> Matcher<T> contains(
Class<V> clazz, Matcher<V> treeMatcher) {
"""
Applies the given matcher recursively to all descendants of an AST node, and matches if any
matching descendant node is found.
@param clazz The type of node to be matched.
@param treeMatcher... | java | public static <T extends Tree, V extends Tree> Matcher<T> contains(
Class<V> clazz, Matcher<V> treeMatcher) {
final Matcher<Tree> contains = new Contains(toType(clazz, treeMatcher));
return contains::matches;
} | [
"public",
"static",
"<",
"T",
"extends",
"Tree",
",",
"V",
"extends",
"Tree",
">",
"Matcher",
"<",
"T",
">",
"contains",
"(",
"Class",
"<",
"V",
">",
"clazz",
",",
"Matcher",
"<",
"V",
">",
"treeMatcher",
")",
"{",
"final",
"Matcher",
"<",
"Tree",
... | Applies the given matcher recursively to all descendants of an AST node, and matches if any
matching descendant node is found.
@param clazz The type of node to be matched.
@param treeMatcher The matcher to apply recursively to the tree. | [
"Applies",
"the",
"given",
"matcher",
"recursively",
"to",
"all",
"descendants",
"of",
"an",
"AST",
"node",
"and",
"matches",
"if",
"any",
"matching",
"descendant",
"node",
"is",
"found",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L1411-L1415 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/errors/ErrorDetails.java | ErrorDetails.applicationTpl | public static ErrorDetails applicationTpl( String tplName, String tplVersion ) {
"""
Details for an application.
@param tplName the template's name
@param tplVersion the template's version
@return an object with error details
"""
return new ErrorDetails( tplName + " (" + tplVersion + ")", ErrorDetailsKind... | java | public static ErrorDetails applicationTpl( String tplName, String tplVersion ) {
return new ErrorDetails( tplName + " (" + tplVersion + ")", ErrorDetailsKind.APPLICATION_TEMPLATE );
} | [
"public",
"static",
"ErrorDetails",
"applicationTpl",
"(",
"String",
"tplName",
",",
"String",
"tplVersion",
")",
"{",
"return",
"new",
"ErrorDetails",
"(",
"tplName",
"+",
"\" (\"",
"+",
"tplVersion",
"+",
"\")\"",
",",
"ErrorDetailsKind",
".",
"APPLICATION_TEMPL... | Details for an application.
@param tplName the template's name
@param tplVersion the template's version
@return an object with error details | [
"Details",
"for",
"an",
"application",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/errors/ErrorDetails.java#L243-L245 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.setDateHeader | @Deprecated
public static void setDateHeader(HttpMessage message, String name, Date value) {
"""
@deprecated Use {@link #set(CharSequence, Object)} instead.
@see #setDateHeader(HttpMessage, CharSequence, Date)
"""
setDateHeader(message, (CharSequence) name, value);
} | java | @Deprecated
public static void setDateHeader(HttpMessage message, String name, Date value) {
setDateHeader(message, (CharSequence) name, value);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"setDateHeader",
"(",
"HttpMessage",
"message",
",",
"String",
"name",
",",
"Date",
"value",
")",
"{",
"setDateHeader",
"(",
"message",
",",
"(",
"CharSequence",
")",
"name",
",",
"value",
")",
";",
"}"
] | @deprecated Use {@link #set(CharSequence, Object)} instead.
@see #setDateHeader(HttpMessage, CharSequence, Date) | [
"@deprecated",
"Use",
"{",
"@link",
"#set",
"(",
"CharSequence",
"Object",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L887-L890 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/ClassHelper.java | ClassHelper.getField | public static Field getField(Class clazz, String fieldName) {
"""
Determines the field via reflection look-up.
@param clazz The java class to search in
@param fieldName The field's name
@return The field object or <code>null</code> if no matching field was found
"""
try
{
... | java | public static Field getField(Class clazz, String fieldName)
{
try
{
return clazz.getField(fieldName);
}
catch (Exception ignored)
{}
return null;
} | [
"public",
"static",
"Field",
"getField",
"(",
"Class",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"clazz",
".",
"getField",
"(",
"fieldName",
")",
";",
"}",
"catch",
"(",
"Exception",
"ignored",
")",
"{",
"}",
"return",
"null",
... | Determines the field via reflection look-up.
@param clazz The java class to search in
@param fieldName The field's name
@return The field object or <code>null</code> if no matching field was found | [
"Determines",
"the",
"field",
"via",
"reflection",
"look",
"-",
"up",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/ClassHelper.java#L251-L260 |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/Util.java | Util.checkMessageId | public static void checkMessageId(int messageId, AisMessageType... messageTypes) {
"""
Check message id corresponds to one of the given list of message types.
@param messageId
@param messageTypes
"""
boolean found = false;
for (AisMessageType messageType : messageTypes) {
if (messageType.getId() == ... | java | public static void checkMessageId(int messageId, AisMessageType... messageTypes) {
boolean found = false;
for (AisMessageType messageType : messageTypes) {
if (messageType.getId() == messageId)
found = true;
}
if (!found) {
StringBuffer s = new StringBuffer();
for (AisMessageType messageType : mess... | [
"public",
"static",
"void",
"checkMessageId",
"(",
"int",
"messageId",
",",
"AisMessageType",
"...",
"messageTypes",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"for",
"(",
"AisMessageType",
"messageType",
":",
"messageTypes",
")",
"{",
"if",
"(",
"messag... | Check message id corresponds to one of the given list of message types.
@param messageId
@param messageTypes | [
"Check",
"message",
"id",
"corresponds",
"to",
"one",
"of",
"the",
"given",
"list",
"of",
"message",
"types",
"."
] | train | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/Util.java#L261-L276 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Viewport.java | Viewport.setPixelSize | public final Viewport setPixelSize(final int wide, final int high) {
"""
Sets size of the {@link Viewport} in pixels
@param wide
@param high
@return Viewpor this viewport
"""
m_wide = wide;
m_high = high;
getElement().getStyle().setWidth(wide, Unit.PX);
getElement().getS... | java | public final Viewport setPixelSize(final int wide, final int high)
{
m_wide = wide;
m_high = high;
getElement().getStyle().setWidth(wide, Unit.PX);
getElement().getStyle().setHeight(high, Unit.PX);
final NFastArrayList<Scene> scenes = getChildNodes();
if (null !=... | [
"public",
"final",
"Viewport",
"setPixelSize",
"(",
"final",
"int",
"wide",
",",
"final",
"int",
"high",
")",
"{",
"m_wide",
"=",
"wide",
";",
"m_high",
"=",
"high",
";",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
".",
"setWidth",
"(",
"wide",
... | Sets size of the {@link Viewport} in pixels
@param wide
@param high
@return Viewpor this viewport | [
"Sets",
"size",
"of",
"the",
"{",
"@link",
"Viewport",
"}",
"in",
"pixels"
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Viewport.java#L228-L257 |
operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.keyUp | public void keyUp(String key, List<ModifierPressed> modifiers) {
"""
Release key.
@param key key to press
@param modifiers modifiers held
"""
systemInputManager.keyUp(key, modifiers);
} | java | public void keyUp(String key, List<ModifierPressed> modifiers) {
systemInputManager.keyUp(key, modifiers);
} | [
"public",
"void",
"keyUp",
"(",
"String",
"key",
",",
"List",
"<",
"ModifierPressed",
">",
"modifiers",
")",
"{",
"systemInputManager",
".",
"keyUp",
"(",
"key",
",",
"modifiers",
")",
";",
"}"
] | Release key.
@param key key to press
@param modifiers modifiers held | [
"Release",
"key",
"."
] | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L610-L612 |
aws/aws-sdk-java | aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/ResourceSpecificResult.java | ResourceSpecificResult.withEvalDecisionDetails | public ResourceSpecificResult withEvalDecisionDetails(java.util.Map<String, String> evalDecisionDetails) {
"""
<p>
Additional details about the results of the evaluation decision. When there are both IAM policies and resource
policies, this parameter explains how each set of policies contributes to the final eva... | java | public ResourceSpecificResult withEvalDecisionDetails(java.util.Map<String, String> evalDecisionDetails) {
setEvalDecisionDetails(evalDecisionDetails);
return this;
} | [
"public",
"ResourceSpecificResult",
"withEvalDecisionDetails",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"evalDecisionDetails",
")",
"{",
"setEvalDecisionDetails",
"(",
"evalDecisionDetails",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Additional details about the results of the evaluation decision. When there are both IAM policies and resource
policies, this parameter explains how each set of policies contributes to the final evaluation decision. When
simulating cross-account access to a resource, both the resource-based policy and the caller's ... | [
"<p",
">",
"Additional",
"details",
"about",
"the",
"results",
"of",
"the",
"evaluation",
"decision",
".",
"When",
"there",
"are",
"both",
"IAM",
"policies",
"and",
"resource",
"policies",
"this",
"parameter",
"explains",
"how",
"each",
"set",
"of",
"policies"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/ResourceSpecificResult.java#L468-L471 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/ocr/AipOcr.java | AipOcr.webImageUrl | public JSONObject webImageUrl(String url, HashMap<String, String> options) {
"""
网络图片文字识别接口
用户向服务请求识别一些网络上背景复杂,特殊字体的文字。
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - options列表:
dete... | java | public JSONObject webImageUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(OcrConsts.WEB_IMA... | [
"public",
"JSONObject",
"webImageUrl",
"(",
"String",
"url",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
".",... | 网络图片文字识别接口
用户向服务请求识别一些网络上背景复杂,特殊字体的文字。
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - options列表:
detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br... | [
"网络图片文字识别接口",
"用户向服务请求识别一些网络上背景复杂,特殊字体的文字。"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/ocr/AipOcr.java#L420-L431 |
Impetus/Kundera | src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java | OracleNoSQLClient.createRow | private Row createRow(EntityMetadata entityMetadata, Object entity, Object id, List<RelationHolder> rlHolders) {
"""
Creates the row.
@param entityMetadata
the entity metadata
@param entity
the entity
@param id
the id
@param rlHolders
the rl holders
@return the row
"""
String schema = entity... | java | private Row createRow(EntityMetadata entityMetadata, Object entity, Object id, List<RelationHolder> rlHolders)
{
String schema = entityMetadata.getSchema(); // Irrelevant for this
// datastore
String table = entityMetadata.getTableName();
MetamodelImpl metamodel = (MetamodelImpl) Ku... | [
"private",
"Row",
"createRow",
"(",
"EntityMetadata",
"entityMetadata",
",",
"Object",
"entity",
",",
"Object",
"id",
",",
"List",
"<",
"RelationHolder",
">",
"rlHolders",
")",
"{",
"String",
"schema",
"=",
"entityMetadata",
".",
"getSchema",
"(",
")",
";",
... | Creates the row.
@param entityMetadata
the entity metadata
@param entity
the entity
@param id
the id
@param rlHolders
the rl holders
@return the row | [
"Creates",
"the",
"row",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClient.java#L1513-L1558 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java | JCRStatisticsManager.getStatistics | private static Statistics getStatistics(String category, String name) {
"""
Retrieve statistics of the given category and name.
@return the related {@link Statistics}, <code>null</code> otherwise.
"""
StatisticsContext context = getContext(category);
if (context == null)
{
return nu... | java | private static Statistics getStatistics(String category, String name)
{
StatisticsContext context = getContext(category);
if (context == null)
{
return null;
}
// Format the name
name = formatName(name);
if (name == null)
{
return null;
}
... | [
"private",
"static",
"Statistics",
"getStatistics",
"(",
"String",
"category",
",",
"String",
"name",
")",
"{",
"StatisticsContext",
"context",
"=",
"getContext",
"(",
"category",
")",
";",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"return",
"null",
";",... | Retrieve statistics of the given category and name.
@return the related {@link Statistics}, <code>null</code> otherwise. | [
"Retrieve",
"statistics",
"of",
"the",
"given",
"category",
"and",
"name",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/statistics/JCRStatisticsManager.java#L353-L376 |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.intersects | public final boolean intersects(ZonedDateTime startTime, ZonedDateTime endTime) {
"""
Utility method to determine if this entry and the given time interval
intersect each other (time bounds overlap each other).
@param startTime time interval start
@param endTime time interval end
@return true if the entry ... | java | public final boolean intersects(ZonedDateTime startTime, ZonedDateTime endTime) {
return Util.intersect(startTime, endTime, getStartAsZonedDateTime(), getEndAsZonedDateTime());
} | [
"public",
"final",
"boolean",
"intersects",
"(",
"ZonedDateTime",
"startTime",
",",
"ZonedDateTime",
"endTime",
")",
"{",
"return",
"Util",
".",
"intersect",
"(",
"startTime",
",",
"endTime",
",",
"getStartAsZonedDateTime",
"(",
")",
",",
"getEndAsZonedDateTime",
... | Utility method to determine if this entry and the given time interval
intersect each other (time bounds overlap each other).
@param startTime time interval start
@param endTime time interval end
@return true if the entry and the given time interval overlap | [
"Utility",
"method",
"to",
"determine",
"if",
"this",
"entry",
"and",
"the",
"given",
"time",
"interval",
"intersect",
"each",
"other",
"(",
"time",
"bounds",
"overlap",
"each",
"other",
")",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L1461-L1463 |
jenkinsci/jenkins | core/src/main/java/hudson/tasks/UserAvatarResolver.java | UserAvatarResolver.resolveOrNull | public static @CheckForNull String resolveOrNull(User u, String avatarSize) {
"""
Like {@link #resolve} but returns null rather than a fallback URL in case there is no special avatar.
@since 1.518
"""
Matcher matcher = iconSizeRegex.matcher(avatarSize);
if (matcher.matches() && matcher.groupCo... | java | public static @CheckForNull String resolveOrNull(User u, String avatarSize) {
Matcher matcher = iconSizeRegex.matcher(avatarSize);
if (matcher.matches() && matcher.groupCount() == 2) {
int width = Integer.parseInt(matcher.group(1));
int height = Integer.parseInt(matcher.group(2))... | [
"public",
"static",
"@",
"CheckForNull",
"String",
"resolveOrNull",
"(",
"User",
"u",
",",
"String",
"avatarSize",
")",
"{",
"Matcher",
"matcher",
"=",
"iconSizeRegex",
".",
"matcher",
"(",
"avatarSize",
")",
";",
"if",
"(",
"matcher",
".",
"matches",
"(",
... | Like {@link #resolve} but returns null rather than a fallback URL in case there is no special avatar.
@since 1.518 | [
"Like",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tasks/UserAvatarResolver.java#L97-L111 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java | RedisInner.beginExportDataAsync | public Observable<Void> beginExportDataAsync(String resourceGroupName, String name, ExportRDBParameters parameters) {
"""
Export data from the redis cache to blobs in a container.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for... | java | public Observable<Void> beginExportDataAsync(String resourceGroupName, String name, ExportRDBParameters parameters) {
return beginExportDataWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceRespo... | [
"public",
"Observable",
"<",
"Void",
">",
"beginExportDataAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"ExportRDBParameters",
"parameters",
")",
"{",
"return",
"beginExportDataWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
"... | Export data from the redis cache to blobs in a container.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for Redis export operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceRespon... | [
"Export",
"data",
"from",
"the",
"redis",
"cache",
"to",
"blobs",
"in",
"a",
"container",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java#L1611-L1618 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationRequest.java | PutIntegrationRequest.withRequestParameters | public PutIntegrationRequest withRequestParameters(java.util.Map<String, String> requestParameters) {
"""
<p>
A key-value map specifying request parameters that are passed from the method request to the back end. The key is
an integration request parameter name and the associated value is a method request parame... | java | public PutIntegrationRequest withRequestParameters(java.util.Map<String, String> requestParameters) {
setRequestParameters(requestParameters);
return this;
} | [
"public",
"PutIntegrationRequest",
"withRequestParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestParameters",
")",
"{",
"setRequestParameters",
"(",
"requestParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A key-value map specifying request parameters that are passed from the method request to the back end. The key is
an integration request parameter name and the associated value is a method request parameter value or static
value that must be enclosed within single quotes and pre-encoded as required by the back end.... | [
"<p",
">",
"A",
"key",
"-",
"value",
"map",
"specifying",
"request",
"parameters",
"that",
"are",
"passed",
"from",
"the",
"method",
"request",
"to",
"the",
"back",
"end",
".",
"The",
"key",
"is",
"an",
"integration",
"request",
"parameter",
"name",
"and",... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationRequest.java#L905-L908 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java | DataService.findByIdAsync | public <T extends IEntity> void findByIdAsync(T entity, CallbackHandler callbackHandler) throws FMSException {
"""
Method to find the record for the given id for the corresponding entity in asynchronous fashion
@param entity
the entity
@param callbackHandler
the callback handler
@throws FMSException
"""... | java | public <T extends IEntity> void findByIdAsync(T entity, CallbackHandler callbackHandler) throws FMSException {
IntuitMessage intuitMessage = prepareFindById(entity);
//set callback handler
intuitMessage.getRequestElements().setCallbackHandler(callbackHandler);
//execute async intercep... | [
"public",
"<",
"T",
"extends",
"IEntity",
">",
"void",
"findByIdAsync",
"(",
"T",
"entity",
",",
"CallbackHandler",
"callbackHandler",
")",
"throws",
"FMSException",
"{",
"IntuitMessage",
"intuitMessage",
"=",
"prepareFindById",
"(",
"entity",
")",
";",
"//set cal... | Method to find the record for the given id for the corresponding entity in asynchronous fashion
@param entity
the entity
@param callbackHandler
the callback handler
@throws FMSException | [
"Method",
"to",
"find",
"the",
"record",
"for",
"the",
"given",
"id",
"for",
"the",
"corresponding",
"entity",
"in",
"asynchronous",
"fashion"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java#L819-L828 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/Signature.java | Signature.getInstance | public static Signature getInstance(String algorithm, String provider)
throws NoSuchAlgorithmException, NoSuchProviderException {
"""
Returns a Signature object that implements the specified signature
algorithm.
<p> A new Signature object encapsulating the
SignatureSpi implementation from the spec... | java | public static Signature getInstance(String algorithm, String provider)
throws NoSuchAlgorithmException, NoSuchProviderException {
if (algorithm.equalsIgnoreCase(RSA_SIGNATURE)) {
// exception compatibility with existing code
if ((provider == null) || (provider.length() == 0))... | [
"public",
"static",
"Signature",
"getInstance",
"(",
"String",
"algorithm",
",",
"String",
"provider",
")",
"throws",
"NoSuchAlgorithmException",
",",
"NoSuchProviderException",
"{",
"if",
"(",
"algorithm",
".",
"equalsIgnoreCase",
"(",
"RSA_SIGNATURE",
")",
")",
"{... | Returns a Signature object that implements the specified signature
algorithm.
<p> A new Signature object encapsulating the
SignatureSpi implementation from the specified provider
is returned. The specified provider must be registered
in the security provider list.
<p> Note that the list of registered providers may b... | [
"Returns",
"a",
"Signature",
"object",
"that",
"implements",
"the",
"specified",
"signature",
"algorithm",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/Signature.java#L486-L503 |
jhunters/jprotobuf | android/src/main/java/com/baidu/bjf/remoting/protobuf/utils/StringUtils.java | StringUtils.endsWith | private static boolean endsWith(String str, String suffix, boolean ignoreCase) {
"""
<p>
Check if a String ends with a specified suffix (optionally case
insensitive).
</p>
@see java.lang.String#endsWith(String)
@param str
the String to check, may be null
@param suffix
the suffix to find, may be null
@pa... | java | private static boolean endsWith(String str, String suffix, boolean ignoreCase) {
if (str == null || suffix == null) {
return (str == null && suffix == null);
}
if (suffix.length() > str.length()) {
return false;
}
int strOffset = str.length() - suffix.leng... | [
"private",
"static",
"boolean",
"endsWith",
"(",
"String",
"str",
",",
"String",
"suffix",
",",
"boolean",
"ignoreCase",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"suffix",
"==",
"null",
")",
"{",
"return",
"(",
"str",
"==",
"null",
"&&",
"suffix... | <p>
Check if a String ends with a specified suffix (optionally case
insensitive).
</p>
@see java.lang.String#endsWith(String)
@param str
the String to check, may be null
@param suffix
the suffix to find, may be null
@param ignoreCase
inidicates whether the compare should ignore case (case
insensitive) or not.
@return ... | [
"<p",
">",
"Check",
"if",
"a",
"String",
"ends",
"with",
"a",
"specified",
"suffix",
"(",
"optionally",
"case",
"insensitive",
")",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/android/src/main/java/com/baidu/bjf/remoting/protobuf/utils/StringUtils.java#L85-L94 |
MenoData/Time4J | base/src/main/java/net/time4j/range/Quarters.java | Quarters.between | public static <T extends TimePoint<? super CalendarUnit, T>> Quarters between(T t1, T t2) {
"""
/*[deutsch]
<p>Bestimmt die gregorianische Quartalsdifferenz zwischen den angegebenen Zeitpunkten. </p>
@param <T> generic type of time-points
@param t1 first time-point
@param t2 second time-point... | java | public static <T extends TimePoint<? super CalendarUnit, T>> Quarters between(T t1, T t2) {
long delta = CalendarUnit.QUARTERS.between(t1, t2);
return Quarters.of(MathUtils.safeCast(delta));
} | [
"public",
"static",
"<",
"T",
"extends",
"TimePoint",
"<",
"?",
"super",
"CalendarUnit",
",",
"T",
">",
">",
"Quarters",
"between",
"(",
"T",
"t1",
",",
"T",
"t2",
")",
"{",
"long",
"delta",
"=",
"CalendarUnit",
".",
"QUARTERS",
".",
"between",
"(",
... | /*[deutsch]
<p>Bestimmt die gregorianische Quartalsdifferenz zwischen den angegebenen Zeitpunkten. </p>
@param <T> generic type of time-points
@param t1 first time-point
@param t2 second time-point
@return result of difference in quarter years
@see net.time4j.PlainDate
@see net.time4j.PlainTim... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Bestimmt",
"die",
"gregorianische",
"Quartalsdifferenz",
"zwischen",
"den",
"angegebenen",
"Zeitpunkten",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/Quarters.java#L118-L123 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.