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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/OutputsInner.java | OutputsInner.createOrReplaceAsync | public Observable<OutputInner> createOrReplaceAsync(String resourceGroupName, String jobName, String outputName, OutputInner output, String ifMatch, String ifNoneMatch) {
"""
Creates an output or replaces an already existing output under an existing streaming job.
@param resourceGroupName The name of the resour... | java | public Observable<OutputInner> createOrReplaceAsync(String resourceGroupName, String jobName, String outputName, OutputInner output, String ifMatch, String ifNoneMatch) {
return createOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, outputName, output, ifMatch, ifNoneMatch).map(new Func1<ServiceRes... | [
"public",
"Observable",
"<",
"OutputInner",
">",
"createOrReplaceAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"outputName",
",",
"OutputInner",
"output",
",",
"String",
"ifMatch",
",",
"String",
"ifNoneMatch",
")",
"{",
"ret... | Creates an output or replaces an already existing output under an existing streaming job.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param jobName The name of the streaming job.
@param outputName The ... | [
"Creates",
"an",
"output",
"or",
"replaces",
"an",
"already",
"existing",
"output",
"under",
"an",
"existing",
"streaming",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/OutputsInner.java#L247-L254 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsAccountsApp.java | CmsAccountsApp.createGroupTable | protected I_CmsFilterableTable createGroupTable(
String path,
CmsAccountsApp cmsAccountsApp,
I_CmsOuTreeType type,
boolean toggle) {
"""
Creates a table for displaying groups.<p>
@param path the path
@param cmsAccountsApp the app instance
@param type the tree type
@param toggl... | java | protected I_CmsFilterableTable createGroupTable(
String path,
CmsAccountsApp cmsAccountsApp,
I_CmsOuTreeType type,
boolean toggle) {
return new CmsGroupTable(path, cmsAccountsApp, type, toggle);
} | [
"protected",
"I_CmsFilterableTable",
"createGroupTable",
"(",
"String",
"path",
",",
"CmsAccountsApp",
"cmsAccountsApp",
",",
"I_CmsOuTreeType",
"type",
",",
"boolean",
"toggle",
")",
"{",
"return",
"new",
"CmsGroupTable",
"(",
"path",
",",
"cmsAccountsApp",
",",
"t... | Creates a table for displaying groups.<p>
@param path the path
@param cmsAccountsApp the app instance
@param type the tree type
@param toggle the value of the 'sub-OU' toggle
@return the table | [
"Creates",
"a",
"table",
"for",
"displaying",
"groups",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsAccountsApp.java#L765-L772 |
Steveice10/OpenNBT | src/main/java/com/github/steveice10/opennbt/NBTIO.java | NBTIO.writeFile | public static void writeFile(CompoundTag tag, File file, boolean compressed, boolean littleEndian) throws IOException {
"""
Writes the given root CompoundTag to the given file.
@param tag Tag to write.
@param file File to write to.
@param compressed Whether the NBT file should be compressed... | java | public static void writeFile(CompoundTag tag, File file, boolean compressed, boolean littleEndian) throws IOException {
if(!file.exists()) {
if(file.getParentFile() != null && !file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
file.createNewFi... | [
"public",
"static",
"void",
"writeFile",
"(",
"CompoundTag",
"tag",
",",
"File",
"file",
",",
"boolean",
"compressed",
",",
"boolean",
"littleEndian",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"file",
".",
"exists",
"(",
")",
")",
"{",
"if",
"("... | Writes the given root CompoundTag to the given file.
@param tag Tag to write.
@param file File to write to.
@param compressed Whether the NBT file should be compressed.
@param littleEndian Whether to write little endian NBT.
@throws java.io.IOException If an I/O error occurs. | [
"Writes",
"the",
"given",
"root",
"CompoundTag",
"to",
"the",
"given",
"file",
"."
] | train | https://github.com/Steveice10/OpenNBT/blob/9bf4adb2afd206a21bc4309c85d642494d1fb536/src/main/java/com/github/steveice10/opennbt/NBTIO.java#L130-L146 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java | InstanceFailoverGroupsInner.createOrUpdate | public InstanceFailoverGroupInner createOrUpdate(String resourceGroupName, String locationName, String failoverGroupName, InstanceFailoverGroupInner parameters) {
"""
Creates or updates a failover group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this valu... | java | public InstanceFailoverGroupInner createOrUpdate(String resourceGroupName, String locationName, String failoverGroupName, InstanceFailoverGroupInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName, parameters).toBlocking().last().body();
} | [
"public",
"InstanceFailoverGroupInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"locationName",
",",
"String",
"failoverGroupName",
",",
"InstanceFailoverGroupInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
... | Creates or updates a failover group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param locationName The name of the region where the resource is located.
@param failoverGroupName The name of the failov... | [
"Creates",
"or",
"updates",
"a",
"failover",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java#L216-L218 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.installationTemplate_templateName_partitionScheme_schemeName_DELETE | public void installationTemplate_templateName_partitionScheme_schemeName_DELETE(String templateName, String schemeName) throws IOException {
"""
remove this scheme of partition
REST: DELETE /me/installationTemplate/{templateName}/partitionScheme/{schemeName}
@param templateName [required] This template name
@... | java | public void installationTemplate_templateName_partitionScheme_schemeName_DELETE(String templateName, String schemeName) throws IOException {
String qPath = "/me/installationTemplate/{templateName}/partitionScheme/{schemeName}";
StringBuilder sb = path(qPath, templateName, schemeName);
exec(qPath, "DELETE", sb.toS... | [
"public",
"void",
"installationTemplate_templateName_partitionScheme_schemeName_DELETE",
"(",
"String",
"templateName",
",",
"String",
"schemeName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/installationTemplate/{templateName}/partitionScheme/{schemeName}\"",
... | remove this scheme of partition
REST: DELETE /me/installationTemplate/{templateName}/partitionScheme/{schemeName}
@param templateName [required] This template name
@param schemeName [required] name of this partitioning scheme | [
"remove",
"this",
"scheme",
"of",
"partition"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3615-L3619 |
UrielCh/ovh-java-sdk | ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java | ApiOvhHorizonView.serviceName_customerNetwork_customerNetworkId_GET | public OvhCustomerNetwork serviceName_customerNetwork_customerNetworkId_GET(String serviceName, Long customerNetworkId) throws IOException {
"""
Get this object properties
REST: GET /horizonView/{serviceName}/customerNetwork/{customerNetworkId}
@param serviceName [required] Domain of the service
@param custom... | java | public OvhCustomerNetwork serviceName_customerNetwork_customerNetworkId_GET(String serviceName, Long customerNetworkId) throws IOException {
String qPath = "/horizonView/{serviceName}/customerNetwork/{customerNetworkId}";
StringBuilder sb = path(qPath, serviceName, customerNetworkId);
String resp = exec(qPath, "G... | [
"public",
"OvhCustomerNetwork",
"serviceName_customerNetwork_customerNetworkId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"customerNetworkId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/horizonView/{serviceName}/customerNetwork/{customerNetworkId}\"",
";",... | Get this object properties
REST: GET /horizonView/{serviceName}/customerNetwork/{customerNetworkId}
@param serviceName [required] Domain of the service
@param customerNetworkId [required] Customer Network id | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java#L431-L436 |
mapsforge/mapsforge | mapsforge-map-android/src/main/java/org/mapsforge/map/android/input/MapZoomControls.java | MapZoomControls.setZoomInFirst | public void setZoomInFirst(boolean zoomInFirst) {
"""
For horizontal orientation, "zoom in first" means the zoom in button will appear on top of the zoom out button.<br/>
For vertical orientation, "zoom in first" means the zoom in button will appear to the left of the zoom out
button.
@param zoomInFirst zoom ... | java | public void setZoomInFirst(boolean zoomInFirst) {
this.removeAllViews();
LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
if (zoomInFirst) {
this.addView(buttonZoomIn, layoutParams);
this.addView(buttonZoomOut, layoutPara... | [
"public",
"void",
"setZoomInFirst",
"(",
"boolean",
"zoomInFirst",
")",
"{",
"this",
".",
"removeAllViews",
"(",
")",
";",
"LayoutParams",
"layoutParams",
"=",
"new",
"LayoutParams",
"(",
"LayoutParams",
".",
"WRAP_CONTENT",
",",
"LayoutParams",
".",
"WRAP_CONTENT... | For horizontal orientation, "zoom in first" means the zoom in button will appear on top of the zoom out button.<br/>
For vertical orientation, "zoom in first" means the zoom in button will appear to the left of the zoom out
button.
@param zoomInFirst zoom in button will be first in layout. | [
"For",
"horizontal",
"orientation",
"zoom",
"in",
"first",
"means",
"the",
"zoom",
"in",
"button",
"will",
"appear",
"on",
"top",
"of",
"the",
"zoom",
"out",
"button",
".",
"<br",
"/",
">",
"For",
"vertical",
"orientation",
"zoom",
"in",
"first",
"means",
... | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/input/MapZoomControls.java#L317-L327 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsLinkTable.java | CmsLinkTable.addLink | public CmsLink addLink(CmsRelationType type, String targetUri, boolean internal) {
"""
Adds a new link to the link table.<p>
@param type type of the link
@param targetUri link destination
@param internal flag to indicate if the link is a local link
@return the new link entry
"""
CmsLink link =... | java | public CmsLink addLink(CmsRelationType type, String targetUri, boolean internal) {
CmsLink link = new CmsLink(LINK_PREFIX + m_linkTable.size(), type, targetUri, internal);
m_linkTable.put(link.getName(), link);
return link;
} | [
"public",
"CmsLink",
"addLink",
"(",
"CmsRelationType",
"type",
",",
"String",
"targetUri",
",",
"boolean",
"internal",
")",
"{",
"CmsLink",
"link",
"=",
"new",
"CmsLink",
"(",
"LINK_PREFIX",
"+",
"m_linkTable",
".",
"size",
"(",
")",
",",
"type",
",",
"ta... | Adds a new link to the link table.<p>
@param type type of the link
@param targetUri link destination
@param internal flag to indicate if the link is a local link
@return the new link entry | [
"Adds",
"a",
"new",
"link",
"to",
"the",
"link",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkTable.java#L118-L123 |
Waikato/moa | moa/src/main/java/com/yahoo/labs/samoa/instances/Instances.java | Instances.readInstance | public boolean readInstance(Reader fileReader) {
"""
Read instance.
@param fileReader the file reader
@return true, if successful
"""
//ArffReader arff = new ArffReader(reader, this, m_Lines, 1);
Instance inst = arff.readInstance();
if (inst != null) {
inst.setDataset(t... | java | public boolean readInstance(Reader fileReader) {
//ArffReader arff = new ArffReader(reader, this, m_Lines, 1);
Instance inst = arff.readInstance();
if (inst != null) {
inst.setDataset(this);
add(inst);
return true;
} else {
return false;
... | [
"public",
"boolean",
"readInstance",
"(",
"Reader",
"fileReader",
")",
"{",
"//ArffReader arff = new ArffReader(reader, this, m_Lines, 1);",
"Instance",
"inst",
"=",
"arff",
".",
"readInstance",
"(",
")",
";",
"if",
"(",
"inst",
"!=",
"null",
")",
"{",
"inst",
"."... | Read instance.
@param fileReader the file reader
@return true, if successful | [
"Read",
"instance",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/com/yahoo/labs/samoa/instances/Instances.java#L474-L485 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSetDTM.java | NodeSetDTM.addNodeInDocOrder | public int addNodeInDocOrder(int node, XPathContext support) {
"""
Add the node into a vector of nodes where it should occur in
document order.
@param node The node to be added.
@param support The XPath runtime context.
@return The index where it was inserted.
@throws RuntimeException thrown if this NodeSet... | java | public int addNodeInDocOrder(int node, XPathContext support)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
return addNodeInDocOrder(node, true, support);
} | [
"public",
"int",
"addNodeInDocOrder",
"(",
"int",
"node",
",",
"XPathContext",
"support",
")",
"{",
"if",
"(",
"!",
"m_mutable",
")",
"throw",
"new",
"RuntimeException",
"(",
"XSLMessages",
".",
"createXPATHMessage",
"(",
"XPATHErrorResources",
".",
"ER_NODESETDTM... | Add the node into a vector of nodes where it should occur in
document order.
@param node The node to be added.
@param support The XPath runtime context.
@return The index where it was inserted.
@throws RuntimeException thrown if this NodeSetDTM is not of
a mutable type. | [
"Add",
"the",
"node",
"into",
"a",
"vector",
"of",
"nodes",
"where",
"it",
"should",
"occur",
"in",
"document",
"order",
".",
"@param",
"node",
"The",
"node",
"to",
"be",
"added",
".",
"@param",
"support",
"The",
"XPath",
"runtime",
"context",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSetDTM.java#L867-L874 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/GridLayoutRenderer.java | GridLayoutRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WPanel's children.
@param component the container to paint.
@param renderContext the RenderContext to paint to.
"""
WPanel panel = (WPanel) component;
XmlStringBuilder xml = rende... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WPanel panel = (WPanel) component;
XmlStringBuilder xml = renderContext.getWriter();
GridLayout layout = (GridLayout) panel.getLayout();
Size hgap = layout.getHorizontalGap();
String hgapString = hgap == nul... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WPanel",
"panel",
"=",
"(",
"WPanel",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderContext",
... | Paints the given WPanel's children.
@param component the container to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WPanel",
"s",
"children",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/GridLayoutRenderer.java#L26-L57 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/svm/PlattSMO.java | PlattSMO.setEpsilon | public void setEpsilon(double epsilon) {
"""
Sets the epsilon for the epsilon insensitive loss when performing
regression. This variable has no impact during classification problems.
For regression problems, any predicated value that is within the epsilon
of the target will be treated as "correct". Increasing e... | java | public void setEpsilon(double epsilon)
{
if(Double.isNaN(epsilon) || Double.isInfinite(epsilon) || epsilon <= 0)
throw new IllegalArgumentException("epsilon must be in (0, infty), not " + epsilon);
this.epsilon = epsilon;
} | [
"public",
"void",
"setEpsilon",
"(",
"double",
"epsilon",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"epsilon",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"epsilon",
")",
"||",
"epsilon",
"<=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",... | Sets the epsilon for the epsilon insensitive loss when performing
regression. This variable has no impact during classification problems.
For regression problems, any predicated value that is within the epsilon
of the target will be treated as "correct". Increasing epsilon usually
decreases the number of support vector... | [
"Sets",
"the",
"epsilon",
"for",
"the",
"epsilon",
"insensitive",
"loss",
"when",
"performing",
"regression",
".",
"This",
"variable",
"has",
"no",
"impact",
"during",
"classification",
"problems",
".",
"For",
"regression",
"problems",
"any",
"predicated",
"value"... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/svm/PlattSMO.java#L1213-L1218 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/component/bean/proxy/JavassistDynamicBeanProxy.java | JavassistDynamicBeanProxy.newInstance | public static Object newInstance(ActivityContext context, BeanRule beanRule, Object[] args, Class<?>[] argTypes) {
"""
Creates a proxy class of bean and returns an instance of that class.
@param context the activity context
@param beanRule the bean rule
@param args the arguments passed to a constructor
@para... | java | public static Object newInstance(ActivityContext context, BeanRule beanRule, Object[] args, Class<?>[] argTypes) {
try {
ProxyFactory proxyFactory = new ProxyFactory();
proxyFactory.setSuperclass(beanRule.getBeanClass());
MethodHandler methodHandler = new JavassistDynamicBean... | [
"public",
"static",
"Object",
"newInstance",
"(",
"ActivityContext",
"context",
",",
"BeanRule",
"beanRule",
",",
"Object",
"[",
"]",
"args",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"argTypes",
")",
"{",
"try",
"{",
"ProxyFactory",
"proxyFactory",
"=",
"new... | Creates a proxy class of bean and returns an instance of that class.
@param context the activity context
@param beanRule the bean rule
@param args the arguments passed to a constructor
@param argTypes the parameter types for a constructor
@return a new proxy bean object | [
"Creates",
"a",
"proxy",
"class",
"of",
"bean",
"and",
"returns",
"an",
"instance",
"of",
"that",
"class",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/component/bean/proxy/JavassistDynamicBeanProxy.java#L126-L135 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsInner.java | LiveOutputsInner.listAsync | public Observable<Page<LiveOutputInner>> listAsync(final String resourceGroupName, final String accountName, final String liveEventName) {
"""
List Live Outputs.
Lists the Live Outputs in the Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName ... | java | public Observable<Page<LiveOutputInner>> listAsync(final String resourceGroupName, final String accountName, final String liveEventName) {
return listWithServiceResponseAsync(resourceGroupName, accountName, liveEventName)
.map(new Func1<ServiceResponse<Page<LiveOutputInner>>, Page<LiveOutputInner>>(... | [
"public",
"Observable",
"<",
"Page",
"<",
"LiveOutputInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
",",
"final",
"String",
"liveEventName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
... | List Live Outputs.
Lists the Live Outputs in the Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The name of the Live Event.
@throws IllegalArgumentException thrown if parameters fail the validat... | [
"List",
"Live",
"Outputs",
".",
"Lists",
"the",
"Live",
"Outputs",
"in",
"the",
"Live",
"Event",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsInner.java#L149-L157 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java | ClassUtility.callMethod | public static Object callMethod(final Method method, final Object instance, final Object... parameters) throws CoreException {
"""
Call the given method for the instance object even if its visibility is private or protected.
@param method the method to call
@param instance the object instance to use
@param pa... | java | public static Object callMethod(final Method method, final Object instance, final Object... parameters) throws CoreException {
Object res = null;
try {
// store current visibility
final boolean accessible = method.isAccessible();
// let it accessible anyway
... | [
"public",
"static",
"Object",
"callMethod",
"(",
"final",
"Method",
"method",
",",
"final",
"Object",
"instance",
",",
"final",
"Object",
"...",
"parameters",
")",
"throws",
"CoreException",
"{",
"Object",
"res",
"=",
"null",
";",
"try",
"{",
"// store current... | Call the given method for the instance object even if its visibility is private or protected.
@param method the method to call
@param instance the object instance to use
@param parameters the list of method parameters to use
@return the method return
@throws CoreException if the method call has failed | [
"Call",
"the",
"given",
"method",
"for",
"the",
"instance",
"object",
"even",
"if",
"its",
"visibility",
"is",
"private",
"or",
"protected",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ClassUtility.java#L519-L541 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/internal/core/type/UserDefinedTypeBuilder.java | UserDefinedTypeBuilder.withField | public UserDefinedTypeBuilder withField(CqlIdentifier name, DataType type) {
"""
Adds a new field. The fields in the resulting type will be in the order of the calls to this
method.
"""
fieldNames.add(name);
fieldTypes.add(type);
return this;
} | java | public UserDefinedTypeBuilder withField(CqlIdentifier name, DataType type) {
fieldNames.add(name);
fieldTypes.add(type);
return this;
} | [
"public",
"UserDefinedTypeBuilder",
"withField",
"(",
"CqlIdentifier",
"name",
",",
"DataType",
"type",
")",
"{",
"fieldNames",
".",
"add",
"(",
"name",
")",
";",
"fieldTypes",
".",
"add",
"(",
"type",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new field. The fields in the resulting type will be in the order of the calls to this
method. | [
"Adds",
"a",
"new",
"field",
".",
"The",
"fields",
"in",
"the",
"resulting",
"type",
"will",
"be",
"in",
"the",
"order",
"of",
"the",
"calls",
"to",
"this",
"method",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/type/UserDefinedTypeBuilder.java#L56-L60 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/implementation/InvocationHandlerAdapter.java | InvocationHandlerAdapter.toField | public static InvocationHandlerAdapter toField(String name, FieldLocator.Factory fieldLocatorFactory) {
"""
Creates an implementation for any {@link java.lang.reflect.InvocationHandler} that delegates
all method interceptions to a field with the given name. This field has to be of a subtype of invocation
handler... | java | public static InvocationHandlerAdapter toField(String name, FieldLocator.Factory fieldLocatorFactory) {
return new ForField(name, CACHED, UNPRIVILEGED, Assigner.DEFAULT, fieldLocatorFactory);
} | [
"public",
"static",
"InvocationHandlerAdapter",
"toField",
"(",
"String",
"name",
",",
"FieldLocator",
".",
"Factory",
"fieldLocatorFactory",
")",
"{",
"return",
"new",
"ForField",
"(",
"name",
",",
"CACHED",
",",
"UNPRIVILEGED",
",",
"Assigner",
".",
"DEFAULT",
... | Creates an implementation for any {@link java.lang.reflect.InvocationHandler} that delegates
all method interceptions to a field with the given name. This field has to be of a subtype of invocation
handler and needs to be set before any invocations are intercepted. Otherwise, a {@link java.lang.NullPointerException}
wi... | [
"Creates",
"an",
"implementation",
"for",
"any",
"{",
"@link",
"java",
".",
"lang",
".",
"reflect",
".",
"InvocationHandler",
"}",
"that",
"delegates",
"all",
"method",
"interceptions",
"to",
"a",
"field",
"with",
"the",
"given",
"name",
".",
"This",
"field"... | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/InvocationHandlerAdapter.java#L161-L163 |
jaxio/javaee-lab | javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/JpaUniqueUtil.java | JpaUniqueUtil.validateSimpleUnique | public String validateSimpleUnique(Identifiable<?> entity, String property, Object value) {
"""
/*
Return the error code if the given property is already present in the database, returns null otherwise.
"""
Map<String, Object> values = newHashMap();
values.put(property, value);
return ... | java | public String validateSimpleUnique(Identifiable<?> entity, String property, Object value) {
Map<String, Object> values = newHashMap();
values.put(property, value);
return existsInDatabaseOnAllObjects(entity, values) ? simpleUniqueConstraintError(entity, property) : null;
} | [
"public",
"String",
"validateSimpleUnique",
"(",
"Identifiable",
"<",
"?",
">",
"entity",
",",
"String",
"property",
",",
"Object",
"value",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
"=",
"newHashMap",
"(",
")",
";",
"values",
".",
"p... | /*
Return the error code if the given property is already present in the database, returns null otherwise. | [
"/",
"*",
"Return",
"the",
"error",
"code",
"if",
"the",
"given",
"property",
"is",
"already",
"present",
"in",
"the",
"database",
"returns",
"null",
"otherwise",
"."
] | train | https://github.com/jaxio/javaee-lab/blob/61238b967952446d81cc68424a4e809093a77fcf/javaee7-jpa-query-by-example/src/main/java/com/jaxio/jpa/querybyexample/JpaUniqueUtil.java#L47-L51 |
pwittchen/prefser | library/src/main/java/com/github/pwittchen/prefser/library/rx2/Prefser.java | Prefser.getAndObserve | public <T> Observable<T> getAndObserve(String key, Class<T> classOfT, T defaultValue) {
"""
Gets value from SharedPreferences with a given key and type
as a RxJava Observable, which can be subscribed.
If value is not found, we can return defaultValue.
Emit preference as first element of the stream even if prefe... | java | public <T> Observable<T> getAndObserve(String key, Class<T> classOfT, T defaultValue) {
return getAndObserve(key, TypeToken.fromClass(classOfT), defaultValue);
} | [
"public",
"<",
"T",
">",
"Observable",
"<",
"T",
">",
"getAndObserve",
"(",
"String",
"key",
",",
"Class",
"<",
"T",
">",
"classOfT",
",",
"T",
"defaultValue",
")",
"{",
"return",
"getAndObserve",
"(",
"key",
",",
"TypeToken",
".",
"fromClass",
"(",
"c... | Gets value from SharedPreferences with a given key and type
as a RxJava Observable, which can be subscribed.
If value is not found, we can return defaultValue.
Emit preference as first element of the stream even if preferences wasn't changed.
@param key key of the preference
@param classOfT class of T (e.g. String.cla... | [
"Gets",
"value",
"from",
"SharedPreferences",
"with",
"a",
"given",
"key",
"and",
"type",
"as",
"a",
"RxJava",
"Observable",
"which",
"can",
"be",
"subscribed",
".",
"If",
"value",
"is",
"not",
"found",
"we",
"can",
"return",
"defaultValue",
".",
"Emit",
"... | train | https://github.com/pwittchen/prefser/blob/7dc7f980eeb71fd5617f8c749050c2400e4fbb2f/library/src/main/java/com/github/pwittchen/prefser/library/rx2/Prefser.java#L147-L149 |
JCTools/JCTools | jctools-channels/src/main/java/org/jctools/channels/OffHeapFixedMessageSizeRingBuffer.java | OffHeapFixedMessageSizeRingBuffer.writeReference | protected void writeReference(long offset, Object reference) {
"""
Write a reference to the given position
@param offset index into the reference array
@param reference
"""
assert referenceMessageSize != 0 : "References are not in use";
// Is there a way to compute the element offset once and... | java | protected void writeReference(long offset, Object reference) {
assert referenceMessageSize != 0 : "References are not in use";
// Is there a way to compute the element offset once and just
// arithmetic?
UnsafeRefArrayAccess.spElement(references, UnsafeRefArrayAccess.calcElementOffset(of... | [
"protected",
"void",
"writeReference",
"(",
"long",
"offset",
",",
"Object",
"reference",
")",
"{",
"assert",
"referenceMessageSize",
"!=",
"0",
":",
"\"References are not in use\"",
";",
"// Is there a way to compute the element offset once and just",
"// arithmetic?",
"Unsa... | Write a reference to the given position
@param offset index into the reference array
@param reference | [
"Write",
"a",
"reference",
"to",
"the",
"given",
"position"
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-channels/src/main/java/org/jctools/channels/OffHeapFixedMessageSizeRingBuffer.java#L248-L253 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/ISODateTimeFormat.java | ISODateTimeFormat.dateByOrdinal | private static boolean dateByOrdinal(
DateTimeFormatterBuilder bld,
Collection<DateTimeFieldType> fields,
boolean extended,
boolean strictISO) {
"""
Creates a date using the ordinal date format.
Specification reference: 5.2.2.
@param bld the builder
@param fields the fields
... | java | private static boolean dateByOrdinal(
DateTimeFormatterBuilder bld,
Collection<DateTimeFieldType> fields,
boolean extended,
boolean strictISO) {
boolean reducedPrec = false;
if (fields.remove(DateTimeFieldType.year())) {
bld.append(Constants.ye);
... | [
"private",
"static",
"boolean",
"dateByOrdinal",
"(",
"DateTimeFormatterBuilder",
"bld",
",",
"Collection",
"<",
"DateTimeFieldType",
">",
"fields",
",",
"boolean",
"extended",
",",
"boolean",
"strictISO",
")",
"{",
"boolean",
"reducedPrec",
"=",
"false",
";",
"if... | Creates a date using the ordinal date format.
Specification reference: 5.2.2.
@param bld the builder
@param fields the fields
@param extended true to use extended format
@param strictISO true to only allow ISO formats
@since 1.1 | [
"Creates",
"a",
"date",
"using",
"the",
"ordinal",
"date",
"format",
".",
"Specification",
"reference",
":",
"5",
".",
"2",
".",
"2",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/ISODateTimeFormat.java#L281-L305 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/RestorePointsInner.java | RestorePointsInner.beginCreate | public RestorePointInner beginCreate(String resourceGroupName, String serverName, String databaseName, String restorePointLabel) {
"""
Creates a restore point for a data warehouse.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resour... | java | public RestorePointInner beginCreate(String resourceGroupName, String serverName, String databaseName, String restorePointLabel) {
return beginCreateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, restorePointLabel).toBlocking().single().body();
} | [
"public",
"RestorePointInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"restorePointLabel",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"ser... | Creates a restore point for a data warehouse.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param restorePointLabel... | [
"Creates",
"a",
"restore",
"point",
"for",
"a",
"data",
"warehouse",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/RestorePointsInner.java#L276-L278 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java | JavacElements.nameToSymbol | private <S extends Symbol> S nameToSymbol(ModuleSymbol module, String nameStr, Class<S> clazz) {
"""
Returns a symbol given the type's or package's canonical name,
or null if the name isn't found.
"""
Name name = names.fromString(nameStr);
// First check cache.
Symbol sym = (clazz == C... | java | private <S extends Symbol> S nameToSymbol(ModuleSymbol module, String nameStr, Class<S> clazz) {
Name name = names.fromString(nameStr);
// First check cache.
Symbol sym = (clazz == ClassSymbol.class)
? syms.getClass(module, name)
: syms.lookupPackage(modul... | [
"private",
"<",
"S",
"extends",
"Symbol",
">",
"S",
"nameToSymbol",
"(",
"ModuleSymbol",
"module",
",",
"String",
"nameStr",
",",
"Class",
"<",
"S",
">",
"clazz",
")",
"{",
"Name",
"name",
"=",
"names",
".",
"fromString",
"(",
"nameStr",
")",
";",
"// ... | Returns a symbol given the type's or package's canonical name,
or null if the name isn't found. | [
"Returns",
"a",
"symbol",
"given",
"the",
"type",
"s",
"or",
"package",
"s",
"canonical",
"name",
"or",
"null",
"if",
"the",
"name",
"isn",
"t",
"found",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java#L229-L251 |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/IceAgent.java | IceAgent.addMediaStream | public IceMediaStream addMediaStream(String streamName, boolean rtcp, boolean rtcpMux) {
"""
Creates and registers a new media stream with an RTP component.<br>
An secondary component may be created if the stream supports RTCP.
@param streamName
the name of the media stream
@param rtcp
Indicates whether the... | java | public IceMediaStream addMediaStream(String streamName, boolean rtcp, boolean rtcpMux) {
if (!this.mediaStreams.containsKey(streamName)) {
// Updates number of maximum allowed candidate pairs
this.maxSelectedPairs += (rtcp && !rtcpMux) ? 2 : 1;
// Register media stream
return this.mediaStreams.put(streamN... | [
"public",
"IceMediaStream",
"addMediaStream",
"(",
"String",
"streamName",
",",
"boolean",
"rtcp",
",",
"boolean",
"rtcpMux",
")",
"{",
"if",
"(",
"!",
"this",
".",
"mediaStreams",
".",
"containsKey",
"(",
"streamName",
")",
")",
"{",
"// Updates number of maxim... | Creates and registers a new media stream with an RTP component.<br>
An secondary component may be created if the stream supports RTCP.
@param streamName
the name of the media stream
@param rtcp
Indicates whether the media server supports RTCP.
@param rtcpMux
Indicates whether the media stream supports <a
href=""http:/... | [
"Creates",
"and",
"registers",
"a",
"new",
"media",
"stream",
"with",
"an",
"RTP",
"component",
".",
"<br",
">",
"An",
"secondary",
"component",
"may",
"be",
"created",
"if",
"the",
"stream",
"supports",
"RTCP",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/IceAgent.java#L185-L193 |
bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/EntityHelper.java | EntityHelper.getEntity | @SuppressWarnings("unchecked")
public static <T> T getEntity(InputStream in, TypeReference<T> reference) {
"""
Reads the entity input stream and deserializes the JSON content to the given type reference. If the
type reference is for an iterator then a {@link JsonStreamingArrayParser} will be returned to stre... | java | @SuppressWarnings("unchecked")
public static <T> T getEntity(InputStream in, TypeReference<T> reference) {
// If the entity type is an iterator then return a streaming iterator to prevent Jackson instantiating
// the entire response in memory.
Type type = reference.getType();
if (typ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getEntity",
"(",
"InputStream",
"in",
",",
"TypeReference",
"<",
"T",
">",
"reference",
")",
"{",
"// If the entity type is an iterator then return a streaming iterator to preve... | Reads the entity input stream and deserializes the JSON content to the given type reference. If the
type reference is for an iterator then a {@link JsonStreamingArrayParser} will be returned to stream
the deserialized contents to the caller. | [
"Reads",
"the",
"entity",
"input",
"stream",
"and",
"deserializes",
"the",
"JSON",
"content",
"to",
"the",
"given",
"type",
"reference",
".",
"If",
"the",
"type",
"reference",
"is",
"for",
"an",
"iterator",
"then",
"a",
"{"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/EntityHelper.java#L41-L58 |
upwork/java-upwork | src/com/Upwork/api/Routers/Workdays.java | Workdays.getByContract | public JSONObject getByContract(String contract, String fromDate, String tillDate, HashMap<String, String> params) throws JSONException {
"""
Get Workdays by Contract
@param contract Contract ID
@param fromDate Start date
@param tillDate End date
@param params (Optional) Parameters
@throws JSONExcep... | java | public JSONObject getByContract(String contract, String fromDate, String tillDate, HashMap<String, String> params) throws JSONException {
return oClient.get("/team/v3/workdays/contracts/" + contract + "/" + fromDate + "," + tillDate, params);
} | [
"public",
"JSONObject",
"getByContract",
"(",
"String",
"contract",
",",
"String",
"fromDate",
",",
"String",
"tillDate",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"get",
"(",
... | Get Workdays by Contract
@param contract Contract ID
@param fromDate Start date
@param tillDate End date
@param params (Optional) Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Get",
"Workdays",
"by",
"Contract"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Workdays.java#L70-L72 |
RuedigerMoeller/kontraktor | src/main/java/org/nustaq/kontraktor/remoting/base/RemoteRefPolling.java | RemoteRefPolling.scheduleSendLoop | public IPromise scheduleSendLoop(ConnectionRegistry reg) {
"""
return a future which is completed upon connection close
@param reg
@return future completed upon termination of scheduling (disconnect)
"""
Promise promise = new Promise();
sendJobs.add(new ScheduleEntry(reg, promise));
... | java | public IPromise scheduleSendLoop(ConnectionRegistry reg) {
Promise promise = new Promise();
sendJobs.add(new ScheduleEntry(reg, promise));
synchronized (this) {
if ( ! loopStarted ) {
loopStarted = true;
Actor.current().execute(this);
}
... | [
"public",
"IPromise",
"scheduleSendLoop",
"(",
"ConnectionRegistry",
"reg",
")",
"{",
"Promise",
"promise",
"=",
"new",
"Promise",
"(",
")",
";",
"sendJobs",
".",
"add",
"(",
"new",
"ScheduleEntry",
"(",
"reg",
",",
"promise",
")",
")",
";",
"synchronized",
... | return a future which is completed upon connection close
@param reg
@return future completed upon termination of scheduling (disconnect) | [
"return",
"a",
"future",
"which",
"is",
"completed",
"upon",
"connection",
"close"
] | train | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/src/main/java/org/nustaq/kontraktor/remoting/base/RemoteRefPolling.java#L66-L76 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteIntentWithServiceResponseAsync | public Observable<ServiceResponse<OperationStatus>> deleteIntentWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, DeleteIntentOptionalParameter deleteIntentOptionalParameter) {
"""
Deletes an intent classifier from the application.
@param appId The application ID.
@param versionId The versi... | java | public Observable<ServiceResponse<OperationStatus>> deleteIntentWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, DeleteIntentOptionalParameter deleteIntentOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoin... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"OperationStatus",
">",
">",
"deleteIntentWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"intentId",
",",
"DeleteIntentOptionalParameter",
"deleteIntentOptionalParameter",
")",
... | Deletes an intent classifier from the application.
@param appId The application ID.
@param versionId The version ID.
@param intentId The intent classifier ID.
@param deleteIntentOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown i... | [
"Deletes",
"an",
"intent",
"classifier",
"from",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L3148-L3164 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/manager/HBCIUtils.java | HBCIUtils.checkAccountCRCByAlg | public static boolean checkAccountCRCByAlg(String alg, String blz, String number) {
"""
Überprüfen einer Kontonummer mit einem gegebenen CRC-Algorithmus.
Diese Methode wird intern von {@link HBCIUtils#checkAccountCRC(String, String)}
aufgerufen und kann für Debugging-Zwecke auch direkt benutzt werden.
@param ... | java | public static boolean checkAccountCRCByAlg(String alg, String blz, String number) {
boolean ret = true;
if (blz == null || number == null) {
throw new NullPointerException("blz and number must not be null");
}
if (number.length() <= 10) {
Method method = getAcco... | [
"public",
"static",
"boolean",
"checkAccountCRCByAlg",
"(",
"String",
"alg",
",",
"String",
"blz",
",",
"String",
"number",
")",
"{",
"boolean",
"ret",
"=",
"true",
";",
"if",
"(",
"blz",
"==",
"null",
"||",
"number",
"==",
"null",
")",
"{",
"throw",
"... | Überprüfen einer Kontonummer mit einem gegebenen CRC-Algorithmus.
Diese Methode wird intern von {@link HBCIUtils#checkAccountCRC(String, String)}
aufgerufen und kann für Debugging-Zwecke auch direkt benutzt werden.
@param alg Nummer des zu verwendenden Prüfziffer-Algorithmus (siehe
Datei <code>blz.properties</code>... | [
"Überprüfen",
"einer",
"Kontonummer",
"mit",
"einem",
"gegebenen",
"CRC",
"-",
"Algorithmus",
".",
"Diese",
"Methode",
"wird",
"intern",
"von",
"{",
"@link",
"HBCIUtils#checkAccountCRC",
"(",
"String",
"String",
")",
"}",
"aufgerufen",
"und",
"kann",
"für",
"Deb... | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/manager/HBCIUtils.java#L594-L623 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/buff/str/StrBuffer.java | StrBuffer.getNextField | public int getNextField(FieldInfo field, boolean bDisplayOption, int iMoveMode) // Must be to call right Get calls {
"""
Get the next field and fill it with data from this buffer.
You must override this method.
@param field The field to set.
@param bDisplayOption The display option for setting the field.
@pa... | java | public int getNextField(FieldInfo field, boolean bDisplayOption, int iMoveMode) // Must be to call right Get calls
{
String string = this.getNextString();
if (string == null)
return Constants.ERROR_RETURN;
if (string == DATA_SKIP)
return Constants.NORMAL_RETURN; //... | [
"public",
"int",
"getNextField",
"(",
"FieldInfo",
"field",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"// Must be to call right Get calls",
"{",
"String",
"string",
"=",
"this",
".",
"getNextString",
"(",
")",
";",
"if",
"(",
"string",
"=="... | Get the next field and fill it with data from this buffer.
You must override this method.
@param field The field to set.
@param bDisplayOption The display option for setting the field.
@param iMoveMove The move mode for setting the field.
@return The error code. | [
"Get",
"the",
"next",
"field",
"and",
"fill",
"it",
"with",
"data",
"from",
"this",
"buffer",
".",
"You",
"must",
"override",
"this",
"method",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/buff/str/StrBuffer.java#L145-L153 |
Wikidata/Wikidata-Toolkit | wdtk-examples/src/main/java/org/wikidata/wdtk/examples/EditOnlineDataExample.java | EditOnlineDataExample.findSomeStringProperties | public static void findSomeStringProperties(ApiConnection connection)
throws MediaWikiApiErrorException, IOException {
"""
Finds properties of datatype string on test.wikidata.org. Since the test
site changes all the time, we cannot hardcode a specific property here.
Instead, we just look through all properti... | java | public static void findSomeStringProperties(ApiConnection connection)
throws MediaWikiApiErrorException, IOException {
WikibaseDataFetcher wbdf = new WikibaseDataFetcher(connection, siteIri);
wbdf.getFilter().excludeAllProperties();
wbdf.getFilter().setLanguageFilter(Collections.singleton("en"));
ArrayList<... | [
"public",
"static",
"void",
"findSomeStringProperties",
"(",
"ApiConnection",
"connection",
")",
"throws",
"MediaWikiApiErrorException",
",",
"IOException",
"{",
"WikibaseDataFetcher",
"wbdf",
"=",
"new",
"WikibaseDataFetcher",
"(",
"connection",
",",
"siteIri",
")",
";... | Finds properties of datatype string on test.wikidata.org. Since the test
site changes all the time, we cannot hardcode a specific property here.
Instead, we just look through all properties starting from P1 to find the
first few properties of type string that have an English label. These
properties are used for testing... | [
"Finds",
"properties",
"of",
"datatype",
"string",
"on",
"test",
".",
"wikidata",
".",
"org",
".",
"Since",
"the",
"test",
"site",
"changes",
"all",
"the",
"time",
"we",
"cannot",
"hardcode",
"a",
"specific",
"property",
"here",
".",
"Instead",
"we",
"just... | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/EditOnlineDataExample.java#L231-L269 |
phax/ph-commons | ph-wsclient/src/main/java/com/helger/wsclient/WSClientConfig.java | WSClientConfig.setSSLSocketFactoryTrustAll | @Nonnull
public final WSClientConfig setSSLSocketFactoryTrustAll (final boolean bDebugMode) throws KeyManagementException {
"""
Set the {@link SSLSocketFactory} to be used by this client to one that
trusts all servers.
@param bDebugMode
<code>true</code> for extended debug logging, <code>false</code> for
p... | java | @Nonnull
public final WSClientConfig setSSLSocketFactoryTrustAll (final boolean bDebugMode) throws KeyManagementException
{
try
{
final SSLContext aSSLContext = SSLContext.getInstance ("TLSv1.2");
aSSLContext.init (null,
new TrustManager [] { new TrustManagerTrustAll (bDe... | [
"@",
"Nonnull",
"public",
"final",
"WSClientConfig",
"setSSLSocketFactoryTrustAll",
"(",
"final",
"boolean",
"bDebugMode",
")",
"throws",
"KeyManagementException",
"{",
"try",
"{",
"final",
"SSLContext",
"aSSLContext",
"=",
"SSLContext",
".",
"getInstance",
"(",
"\"TL... | Set the {@link SSLSocketFactory} to be used by this client to one that
trusts all servers.
@param bDebugMode
<code>true</code> for extended debug logging, <code>false</code> for
production.
@throws KeyManagementException
if initializing the SSL context failed
@return this for chaining
@since 9.1.5 | [
"Set",
"the",
"{",
"@link",
"SSLSocketFactory",
"}",
"to",
"be",
"used",
"by",
"this",
"client",
"to",
"one",
"that",
"trusts",
"all",
"servers",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-wsclient/src/main/java/com/helger/wsclient/WSClientConfig.java#L146-L162 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertYuv420_888.java | ConvertYuv420_888.yuvToGray | public static <T extends ImageGray<T>>
T yuvToGray(ByteBuffer bufferY , int width , int height, int strideRow , T output , BWorkArrays workArrays, Class<T> outputType ) {
"""
Converts an YUV 420 888 into gray
@param output Output: Optional storage for output image. Can be null.
@param outputType Output: Typ... | java | public static <T extends ImageGray<T>>
T yuvToGray(ByteBuffer bufferY , int width , int height, int strideRow , T output , BWorkArrays workArrays, Class<T> outputType )
{
if( outputType == GrayU8.class ) {
return (T) yuvToGray(bufferY,width,height,strideRow,(GrayU8)output);
} else if( outputType == GrayF32.cla... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"T",
"yuvToGray",
"(",
"ByteBuffer",
"bufferY",
",",
"int",
"width",
",",
"int",
"height",
",",
"int",
"strideRow",
",",
"T",
"output",
",",
"BWorkArrays",
"workArrays",
",",
"Clas... | Converts an YUV 420 888 into gray
@param output Output: Optional storage for output image. Can be null.
@param outputType Output: Type of output image
@param <T> Output image type
@return Gray scale image | [
"Converts",
"an",
"YUV",
"420",
"888",
"into",
"gray"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertYuv420_888.java#L111-L121 |
eclipse/xtext-extras | org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/impl/IndexedJvmTypeAccess.java | IndexedJvmTypeAccess.getIndexedJvmType | public EObject getIndexedJvmType(URI javaObjectURI, ResourceSet resourceSet) throws UnknownNestedTypeException {
"""
Locate and resolve a {@link JvmType} in the context of the given resource set. It'll try to
decode the qualified name from the URI and find an instance with that name in the {@link IResourceDescrip... | java | public EObject getIndexedJvmType(URI javaObjectURI, ResourceSet resourceSet) throws UnknownNestedTypeException {
return getIndexedJvmType(javaObjectURI, resourceSet, false);
} | [
"public",
"EObject",
"getIndexedJvmType",
"(",
"URI",
"javaObjectURI",
",",
"ResourceSet",
"resourceSet",
")",
"throws",
"UnknownNestedTypeException",
"{",
"return",
"getIndexedJvmType",
"(",
"javaObjectURI",
",",
"resourceSet",
",",
"false",
")",
";",
"}"
] | Locate and resolve a {@link JvmType} in the context of the given resource set. It'll try to
decode the qualified name from the URI and find an instance with that name in the {@link IResourceDescriptions
index}. Short-circuits to a resource that is already available in the resource set.
@param javaObjectURI
the uri of ... | [
"Locate",
"and",
"resolve",
"a",
"{",
"@link",
"JvmType",
"}",
"in",
"the",
"context",
"of",
"the",
"given",
"resource",
"set",
".",
"It",
"ll",
"try",
"to",
"decode",
"the",
"qualified",
"name",
"from",
"the",
"URI",
"and",
"find",
"an",
"instance",
"... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/impl/IndexedJvmTypeAccess.java#L68-L70 |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.getNextEvent | public CloudTrailEvent getNextEvent() throws IOException {
"""
Get the next event from the CloudTrail log and parse it.
@return a {@link CloudTrailEvent} that represents the
parsed event.
@throws IOException if the event could not be parsed.
"""
CloudTrailEventData eventData = new CloudTrailEventD... | java | public CloudTrailEvent getNextEvent() throws IOException {
CloudTrailEventData eventData = new CloudTrailEventData();
String key;
/* Get next CloudTrailEvent event from log file. When failed to parse a event,
* IOException will be thrown. In this case, the charEnd index the place we
... | [
"public",
"CloudTrailEvent",
"getNextEvent",
"(",
")",
"throws",
"IOException",
"{",
"CloudTrailEventData",
"eventData",
"=",
"new",
"CloudTrailEventData",
"(",
")",
";",
"String",
"key",
";",
"/* Get next CloudTrailEvent event from log file. When failed to parse a event,\n ... | Get the next event from the CloudTrail log and parse it.
@return a {@link CloudTrailEvent} that represents the
parsed event.
@throws IOException if the event could not be parsed. | [
"Get",
"the",
"next",
"event",
"from",
"the",
"CloudTrail",
"log",
"and",
"parse",
"it",
"."
] | train | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L119-L173 |
playn/playn | core/src/playn/core/json/JsonObject.java | JsonObject.getObject | public Json.Object getObject(String key, Json.Object default_) {
"""
Returns the {@link JsonObject} at the given key, or the default if it does not exist or is the
wrong type.
"""
Object o = get(key);
return (o instanceof JsonObject) ? (JsonObject)o : default_;
} | java | public Json.Object getObject(String key, Json.Object default_) {
Object o = get(key);
return (o instanceof JsonObject) ? (JsonObject)o : default_;
} | [
"public",
"Json",
".",
"Object",
"getObject",
"(",
"String",
"key",
",",
"Json",
".",
"Object",
"default_",
")",
"{",
"Object",
"o",
"=",
"get",
"(",
"key",
")",
";",
"return",
"(",
"o",
"instanceof",
"JsonObject",
")",
"?",
"(",
"JsonObject",
")",
"... | Returns the {@link JsonObject} at the given key, or the default if it does not exist or is the
wrong type. | [
"Returns",
"the",
"{"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/json/JsonObject.java#L156-L159 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/acknowledge/RangedAcknowledger.java | RangedAcknowledger.action | @Override
public void action(String queueUrl, List<String> receiptHandles) throws JMSException {
"""
Acknowledges up to 10 messages via calling
<code>deleteMessageBatch</code>.
"""
if (receiptHandles == null || receiptHandles.isEmpty()) {
return;
}
List<DeleteMessageBa... | java | @Override
public void action(String queueUrl, List<String> receiptHandles) throws JMSException {
if (receiptHandles == null || receiptHandles.isEmpty()) {
return;
}
List<DeleteMessageBatchRequestEntry> deleteMessageBatchRequestEntries = new ArrayList<DeleteMessageBatchRequestEnt... | [
"@",
"Override",
"public",
"void",
"action",
"(",
"String",
"queueUrl",
",",
"List",
"<",
"String",
">",
"receiptHandles",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"receiptHandles",
"==",
"null",
"||",
"receiptHandles",
".",
"isEmpty",
"(",
")",
")",
... | Acknowledges up to 10 messages via calling
<code>deleteMessageBatch</code>. | [
"Acknowledges",
"up",
"to",
"10",
"messages",
"via",
"calling",
"<code",
">",
"deleteMessageBatch<",
"/",
"code",
">",
"."
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/acknowledge/RangedAcknowledger.java#L131-L157 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemNumber.java | ElemNumber.getTargetNode | public int getTargetNode(XPathContext xctxt, int sourceNode)
throws TransformerException {
"""
Get the target node that will be counted..
@param xctxt The XPath runtime state for this.
@param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node<... | java | public int getTargetNode(XPathContext xctxt, int sourceNode)
throws TransformerException
{
int target = DTM.NULL;
XPath countMatchPattern = getCountMatchPattern(xctxt, sourceNode);
if (Constants.NUMBERLEVEL_ANY == m_level)
{
target = findPrecedingOrAncestorOrSelf(xctxt, m_fromMatchPa... | [
"public",
"int",
"getTargetNode",
"(",
"XPathContext",
"xctxt",
",",
"int",
"sourceNode",
")",
"throws",
"TransformerException",
"{",
"int",
"target",
"=",
"DTM",
".",
"NULL",
";",
"XPath",
"countMatchPattern",
"=",
"getCountMatchPattern",
"(",
"xctxt",
",",
"so... | Get the target node that will be counted..
@param xctxt The XPath runtime state for this.
@param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>.
@return the target node that will be counted
@throws TransformerException | [
"Get",
"the",
"target",
"node",
"that",
"will",
"be",
"counted",
".."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemNumber.java#L942-L962 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/pool/JDBCConnectionPoolDataSource.java | JDBCConnectionPoolDataSource.setConnectionProperty | public Object setConnectionProperty(String name, String value) {
"""
Sets JDBC Connection Properties to be used when physical
connections are obtained for the pool.
"""
return connProperties.setProperty(name, value);
} | java | public Object setConnectionProperty(String name, String value) {
return connProperties.setProperty(name, value);
} | [
"public",
"Object",
"setConnectionProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"return",
"connProperties",
".",
"setProperty",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Sets JDBC Connection Properties to be used when physical
connections are obtained for the pool. | [
"Sets",
"JDBC",
"Connection",
"Properties",
"to",
"be",
"used",
"when",
"physical",
"connections",
"are",
"obtained",
"for",
"the",
"pool",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/pool/JDBCConnectionPoolDataSource.java#L230-L232 |
comapi/comapi-chat-sdk-android | COMAPI/chat/src/main/java/com/comapi/chat/database/Database.java | Database.getInstance | public static synchronized Database getInstance(@NonNull Application app, boolean resetDBHelperInstance, @NonNull Logger log) {
"""
Creates database controller and new database instance if wasn't created yet or parameter reset was set to true.
@param app Application instance.
@param resetDBHe... | java | public static synchronized Database getInstance(@NonNull Application app, boolean resetDBHelperInstance, @NonNull Logger log) {
if (dbHelper == null) {
dbHelper = DatabaseHelper.getInstance(app.getApplicationContext());
} else if (resetDBHelperInstance) {
//For testing purposes ... | [
"public",
"static",
"synchronized",
"Database",
"getInstance",
"(",
"@",
"NonNull",
"Application",
"app",
",",
"boolean",
"resetDBHelperInstance",
",",
"@",
"NonNull",
"Logger",
"log",
")",
"{",
"if",
"(",
"dbHelper",
"==",
"null",
")",
"{",
"dbHelper",
"=",
... | Creates database controller and new database instance if wasn't created yet or parameter reset was set to true.
@param app Application instance.
@param resetDBHelperInstance True if underlying db helper should be recreated. This should be set to true only for tests.
@param log Logge... | [
"Creates",
"database",
"controller",
"and",
"new",
"database",
"instance",
"if",
"wasn",
"t",
"created",
"yet",
"or",
"parameter",
"reset",
"was",
"set",
"to",
"true",
"."
] | train | https://github.com/comapi/comapi-chat-sdk-android/blob/388f37bfacb7793ce30c92ab70e5f32848bbe460/COMAPI/chat/src/main/java/com/comapi/chat/database/Database.java#L69-L79 |
vkostyukov/la4j | src/main/java/org/la4j/Matrices.java | Matrices.asMinusFunction | public static MatrixFunction asMinusFunction(final double arg) {
"""
Creates a minus function that subtracts given {@code value} from it's argument.
@param arg a value to be subtracted from function's argument
@return a closure that does {@code _ - _}
"""
return new MatrixFunction() {
... | java | public static MatrixFunction asMinusFunction(final double arg) {
return new MatrixFunction() {
@Override
public double evaluate(int i, int j, double value) {
return value - arg;
}
};
} | [
"public",
"static",
"MatrixFunction",
"asMinusFunction",
"(",
"final",
"double",
"arg",
")",
"{",
"return",
"new",
"MatrixFunction",
"(",
")",
"{",
"@",
"Override",
"public",
"double",
"evaluate",
"(",
"int",
"i",
",",
"int",
"j",
",",
"double",
"value",
"... | Creates a minus function that subtracts given {@code value} from it's argument.
@param arg a value to be subtracted from function's argument
@return a closure that does {@code _ - _} | [
"Creates",
"a",
"minus",
"function",
"that",
"subtracts",
"given",
"{",
"@code",
"value",
"}",
"from",
"it",
"s",
"argument",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrices.java#L455-L462 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java | SARLJvmModelInferrer.initializeLocalTypes | protected void initializeLocalTypes(GenerationContext context, JvmFeature feature, XExpression expression) {
"""
Initialize the local class to the given expression.
@param context the generation context.
@param feature the feature which contains the expression.
@param expression the expression which contains ... | java | protected void initializeLocalTypes(GenerationContext context, JvmFeature feature, XExpression expression) {
if (expression != null) {
int localTypeIndex = context.getLocalTypeIndex();
final TreeIterator<EObject> iterator = EcoreUtil2.getAllNonDerivedContents(expression, true);
final String nameStub = "__" +... | [
"protected",
"void",
"initializeLocalTypes",
"(",
"GenerationContext",
"context",
",",
"JvmFeature",
"feature",
",",
"XExpression",
"expression",
")",
"{",
"if",
"(",
"expression",
"!=",
"null",
")",
"{",
"int",
"localTypeIndex",
"=",
"context",
".",
"getLocalType... | Initialize the local class to the given expression.
@param context the generation context.
@param feature the feature which contains the expression.
@param expression the expression which contains the local class. | [
"Initialize",
"the",
"local",
"class",
"to",
"the",
"given",
"expression",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java#L456-L471 |
javers/javers | javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java | QueryBuilder.byInstanceId | public static QueryBuilder byInstanceId(Object localId, String typeName) {
"""
Query for selecting changes (or snapshots) made on a concrete type identified by name.
<br/><br/>
For example, last changes on "bob" Person:
<pre>
javers.findChanges( QueryBuilder.byInstanceId("bob", "Person").build() );
</pre>
... | java | public static QueryBuilder byInstanceId(Object localId, String typeName){
Validate.argumentsAreNotNull(localId, typeName);
return new QueryBuilder(new IdAndTypeNameFilterDefinition(localId, typeName));
} | [
"public",
"static",
"QueryBuilder",
"byInstanceId",
"(",
"Object",
"localId",
",",
"String",
"typeName",
")",
"{",
"Validate",
".",
"argumentsAreNotNull",
"(",
"localId",
",",
"typeName",
")",
";",
"return",
"new",
"QueryBuilder",
"(",
"new",
"IdAndTypeNameFilterD... | Query for selecting changes (or snapshots) made on a concrete type identified by name.
<br/><br/>
For example, last changes on "bob" Person:
<pre>
javers.findChanges( QueryBuilder.byInstanceId("bob", "Person").build() );
</pre> | [
"Query",
"for",
"selecting",
"changes",
"(",
"or",
"snapshots",
")",
"made",
"on",
"a",
"concrete",
"type",
"identified",
"by",
"name",
".",
"<br",
"/",
">",
"<br",
"/",
">"
] | train | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java#L104-L107 |
ZenHarbinger/l2fprod-properties-editor | src/main/java/com/l2fprod/common/util/ResourceManager.java | ResourceManager.getString | public String getString(String key, Object[] args) {
"""
Gets the String associated with <code>key</code> after having resolved
any nested keys ({@link #resolve(String)}) and applied a formatter using
the given <code>args</code>.
@param key the key to lookup
@param args the arguments to pass to the formatter... | java | public String getString(String key, Object[] args) {
String value = getString(key);
return MessageFormat.format(value, args);
} | [
"public",
"String",
"getString",
"(",
"String",
"key",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"String",
"value",
"=",
"getString",
"(",
"key",
")",
";",
"return",
"MessageFormat",
".",
"format",
"(",
"value",
",",
"args",
")",
";",
"}"
] | Gets the String associated with <code>key</code> after having resolved
any nested keys ({@link #resolve(String)}) and applied a formatter using
the given <code>args</code>.
@param key the key to lookup
@param args the arguments to pass to the formatter
@return the String associated with <code>key</code> | [
"Gets",
"the",
"String",
"associated",
"with",
"<code",
">",
"key<",
"/",
"code",
">",
"after",
"having",
"resolved",
"any",
"nested",
"keys",
"(",
"{",
"@link",
"#resolve",
"(",
"String",
")",
"}",
")",
"and",
"applied",
"a",
"formatter",
"using",
"the"... | train | https://github.com/ZenHarbinger/l2fprod-properties-editor/blob/d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32/src/main/java/com/l2fprod/common/util/ResourceManager.java#L144-L147 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/RowColumnResourcesImpl.java | RowColumnResourcesImpl.addImageToCell | public void addImageToCell(long sheetId, long rowId, long columnId, String file, String fileType, boolean overrideValidation, String altText) throws FileNotFoundException, SmartsheetException {
"""
Add an image to a cell.
It mirrors the following Smartsheet REST API method: POST /sheets/{sheetId}/rows/{rowId}/c... | java | public void addImageToCell(long sheetId, long rowId, long columnId, String file, String fileType, boolean overrideValidation, String altText) throws FileNotFoundException, SmartsheetException {
addImage("sheets/" + sheetId + "/rows/" + rowId + "/columns/" + columnId + "/cellimages", file, fileType, overrideVali... | [
"public",
"void",
"addImageToCell",
"(",
"long",
"sheetId",
",",
"long",
"rowId",
",",
"long",
"columnId",
",",
"String",
"file",
",",
"String",
"fileType",
",",
"boolean",
"overrideValidation",
",",
"String",
"altText",
")",
"throws",
"FileNotFoundException",
"... | Add an image to a cell.
It mirrors the following Smartsheet REST API method: POST /sheets/{sheetId}/rows/{rowId}/columns/{columnId}/cellimages
Exceptions:
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access... | [
"Add",
"an",
"image",
"to",
"a",
"cell",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/RowColumnResourcesImpl.java#L176-L178 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForView | public boolean waitForView(int id) {
"""
Waits for a View matching the specified resource id. Default timeout is 20 seconds.
@param id the R.id of the {@link View} to wait for
@return {@code true} if the {@link View} is displayed and {@code false} if it is not displayed before the timeout
"""
if(config.c... | java | public boolean waitForView(int id){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForView("+id+")");
}
return waitForView(id, 0, Timeout.getLargeTimeout(), true);
} | [
"public",
"boolean",
"waitForView",
"(",
"int",
"id",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"waitForView(\"",
"+",
"id",
"+",
"\")\"",
")",
";",
"}",
"return",
"... | Waits for a View matching the specified resource id. Default timeout is 20 seconds.
@param id the R.id of the {@link View} to wait for
@return {@code true} if the {@link View} is displayed and {@code false} if it is not displayed before the timeout | [
"Waits",
"for",
"a",
"View",
"matching",
"the",
"specified",
"resource",
"id",
".",
"Default",
"timeout",
"is",
"20",
"seconds",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L451-L457 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/ThreadFactoryUtils.java | ThreadFactoryUtils.build | public static ThreadFactory build(final String nameFormat, boolean isDaemon) {
"""
Creates a {@link java.util.concurrent.ThreadFactory} that spawns off threads.
@param nameFormat name pattern for each thread. should contain '%d' to distinguish between
threads.
@param isDaemon if true, the {@link java.util.con... | java | public static ThreadFactory build(final String nameFormat, boolean isDaemon) {
return new ThreadFactoryBuilder().setDaemon(isDaemon).setNameFormat(nameFormat).build();
} | [
"public",
"static",
"ThreadFactory",
"build",
"(",
"final",
"String",
"nameFormat",
",",
"boolean",
"isDaemon",
")",
"{",
"return",
"new",
"ThreadFactoryBuilder",
"(",
")",
".",
"setDaemon",
"(",
"isDaemon",
")",
".",
"setNameFormat",
"(",
"nameFormat",
")",
"... | Creates a {@link java.util.concurrent.ThreadFactory} that spawns off threads.
@param nameFormat name pattern for each thread. should contain '%d' to distinguish between
threads.
@param isDaemon if true, the {@link java.util.concurrent.ThreadFactory} will create
daemon threads.
@return the created factory | [
"Creates",
"a",
"{",
"@link",
"java",
".",
"util",
".",
"concurrent",
".",
"ThreadFactory",
"}",
"that",
"spawns",
"off",
"threads",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ThreadFactoryUtils.java#L36-L38 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpd/MPDUtility.java | MPDUtility.hexdump | public static final String hexdump(byte[] buffer, boolean ascii) {
"""
This method generates a formatted version of the data contained
in a byte array. The data is written both in hex, and as ASCII
characters.
@param buffer data to be displayed
@param ascii flag indicating whether ASCII equivalent chars shou... | java | public static final String hexdump(byte[] buffer, boolean ascii)
{
int length = 0;
if (buffer != null)
{
length = buffer.length;
}
return (hexdump(buffer, 0, length, ascii));
} | [
"public",
"static",
"final",
"String",
"hexdump",
"(",
"byte",
"[",
"]",
"buffer",
",",
"boolean",
"ascii",
")",
"{",
"int",
"length",
"=",
"0",
";",
"if",
"(",
"buffer",
"!=",
"null",
")",
"{",
"length",
"=",
"buffer",
".",
"length",
";",
"}",
"re... | This method generates a formatted version of the data contained
in a byte array. The data is written both in hex, and as ASCII
characters.
@param buffer data to be displayed
@param ascii flag indicating whether ASCII equivalent chars should also be displayed
@return formatted string | [
"This",
"method",
"generates",
"a",
"formatted",
"version",
"of",
"the",
"data",
"contained",
"in",
"a",
"byte",
"array",
".",
"The",
"data",
"is",
"written",
"both",
"in",
"hex",
"and",
"as",
"ASCII",
"characters",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPDUtility.java#L408-L418 |
nutzam/nutzboot | nutzboot-demo/nutzboot-demo-simple/nutzboot-demo-simple-elasticsearch/src/main/java/io/nutz/demo/simple/utils/ElasticsearchUtil.java | ElasticsearchUtil.deleteData | public boolean deleteData(String indexName, String type, String id) {
"""
创建或更新文档
@param indexName 索引名
@param type 数据类型
@param id 主键
@return
"""
DeleteResponse response = getClient().prepareDelete().setIndex(indexName).setType(type).setId(id).execute().actionGet();
return resp... | java | public boolean deleteData(String indexName, String type, String id) {
DeleteResponse response = getClient().prepareDelete().setIndex(indexName).setType(type).setId(id).execute().actionGet();
return response.getResult() == DocWriteResponse.Result.DELETED;
} | [
"public",
"boolean",
"deleteData",
"(",
"String",
"indexName",
",",
"String",
"type",
",",
"String",
"id",
")",
"{",
"DeleteResponse",
"response",
"=",
"getClient",
"(",
")",
".",
"prepareDelete",
"(",
")",
".",
"setIndex",
"(",
"indexName",
")",
".",
"set... | 创建或更新文档
@param indexName 索引名
@param type 数据类型
@param id 主键
@return | [
"创建或更新文档"
] | train | https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-demo/nutzboot-demo-simple/nutzboot-demo-simple-elasticsearch/src/main/java/io/nutz/demo/simple/utils/ElasticsearchUtil.java#L122-L125 |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java | SpeakUtil.sendFeedback | public static void sendFeedback (DObject speakObj, String bundle, String message) {
"""
Sends a system FEEDBACK message notification to the specified object with the supplied
message content. A system message is one that will be rendered where the speak messages are
rendered, but in a way that makes it clear tha... | java | public static void sendFeedback (DObject speakObj, String bundle, String message)
{
sendSystem(speakObj, bundle, message, SystemMessage.FEEDBACK);
} | [
"public",
"static",
"void",
"sendFeedback",
"(",
"DObject",
"speakObj",
",",
"String",
"bundle",
",",
"String",
"message",
")",
"{",
"sendSystem",
"(",
"speakObj",
",",
"bundle",
",",
"message",
",",
"SystemMessage",
".",
"FEEDBACK",
")",
";",
"}"
] | Sends a system FEEDBACK message notification to the specified object with the supplied
message content. A system message is one that will be rendered where the speak messages are
rendered, but in a way that makes it clear that it is a message from the server.
Feedback messages are sent in direct response to a user act... | [
"Sends",
"a",
"system",
"FEEDBACK",
"message",
"notification",
"to",
"the",
"specified",
"object",
"with",
"the",
"supplied",
"message",
"content",
".",
"A",
"system",
"message",
"is",
"one",
"that",
"will",
"be",
"rendered",
"where",
"the",
"speak",
"messages... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java#L143-L146 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.listIncompleteUploads | public Iterable<Result<Upload>> listIncompleteUploads(String bucketName, String prefix)
throws XmlPullParserException {
"""
Lists incomplete uploads of objects in given bucket and prefix.
@param bucketName Bucket name.
@param prefix filters the list of uploads to include only those that start with pr... | java | public Iterable<Result<Upload>> listIncompleteUploads(String bucketName, String prefix)
throws XmlPullParserException {
return listIncompleteUploads(bucketName, prefix, true, true);
} | [
"public",
"Iterable",
"<",
"Result",
"<",
"Upload",
">",
">",
"listIncompleteUploads",
"(",
"String",
"bucketName",
",",
"String",
"prefix",
")",
"throws",
"XmlPullParserException",
"{",
"return",
"listIncompleteUploads",
"(",
"bucketName",
",",
"prefix",
",",
"tr... | Lists incomplete uploads of objects in given bucket and prefix.
@param bucketName Bucket name.
@param prefix filters the list of uploads to include only those that start with prefix.
@return an iterator of Upload.
@throws XmlPullParserException upon parsing response xml
@see #listIncompleteUploads(String, Strin... | [
"Lists",
"incomplete",
"uploads",
"of",
"objects",
"in",
"given",
"bucket",
"and",
"prefix",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L4503-L4506 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/ds/common/BaseDataSource.java | BaseDataSource.getConnection | public Connection getConnection(String user, String password) throws SQLException {
"""
Gets a connection to the PostgreSQL database. The database is identified by the DataSource
properties serverName, databaseName, and portNumber. The user to connect as is identified by
the arguments user and password, which ov... | java | public Connection getConnection(String user, String password) throws SQLException {
try {
Connection con = DriverManager.getConnection(getUrl(), user, password);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Created a {0} for {1} at {2}",
new Object[] {getDescription()... | [
"public",
"Connection",
"getConnection",
"(",
"String",
"user",
",",
"String",
"password",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"Connection",
"con",
"=",
"DriverManager",
".",
"getConnection",
"(",
"getUrl",
"(",
")",
",",
"user",
",",
"password",
... | Gets a connection to the PostgreSQL database. The database is identified by the DataSource
properties serverName, databaseName, and portNumber. The user to connect as is identified by
the arguments user and password, which override the DataSource properties by the same name.
@param user user
@param password passwo... | [
"Gets",
"a",
"connection",
"to",
"the",
"PostgreSQL",
"database",
".",
"The",
"database",
"is",
"identified",
"by",
"the",
"DataSource",
"properties",
"serverName",
"databaseName",
"and",
"portNumber",
".",
"The",
"user",
"to",
"connect",
"as",
"is",
"identified... | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/ds/common/BaseDataSource.java#L95-L108 |
citrusframework/citrus | modules/citrus-zookeeper/src/main/java/com/consol/citrus/zookeeper/command/AbstractZooCommand.java | AbstractZooCommand.withParam | public AbstractZooCommand withParam(String name, String value) {
"""
Adds command parameter to current command.
@param name
@param value
@return
"""
parameters.put(name, value);
return this;
} | java | public AbstractZooCommand withParam(String name, String value) {
parameters.put(name, value);
return this;
} | [
"public",
"AbstractZooCommand",
"withParam",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"parameters",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds command parameter to current command.
@param name
@param value
@return | [
"Adds",
"command",
"parameter",
"to",
"current",
"command",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-zookeeper/src/main/java/com/consol/citrus/zookeeper/command/AbstractZooCommand.java#L131-L134 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/federation/PageKey.java | PageKey.withParentId | public PageKey withParentId(String parentId) {
"""
Creates a new {@link org.modeshape.jcr.spi.federation.PageKey} instance which has the given parent ID and the same
offset & block size as this page.
@param parentId a {@link String} representing the ID of the new parent; may not be null.
@return a new {@link or... | java | public PageKey withParentId(String parentId) {
if (StringUtil.isBlank(parentId)) {
throw new IllegalArgumentException("Parent ID cannot be empty");
}
return new PageKey(parentId, this.offset, this.blockSize);
} | [
"public",
"PageKey",
"withParentId",
"(",
"String",
"parentId",
")",
"{",
"if",
"(",
"StringUtil",
".",
"isBlank",
"(",
"parentId",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parent ID cannot be empty\"",
")",
";",
"}",
"return",
"new",
... | Creates a new {@link org.modeshape.jcr.spi.federation.PageKey} instance which has the given parent ID and the same
offset & block size as this page.
@param parentId a {@link String} representing the ID of the new parent; may not be null.
@return a new {@link org.modeshape.jcr.spi.federation.PageKey} instance; never nul... | [
"Creates",
"a",
"new",
"{"
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/federation/PageKey.java#L76-L81 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.createStream | public CreateStreamResponse createStream(String playDomain, String app, String pushStream) {
"""
Create a domain stream in the live stream service.
@param playDomain The domain which this stream belongs to
@param app The app which this stream belongs to, may not exist when create stream
@param pushStream, nam... | java | public CreateStreamResponse createStream(String playDomain, String app, String pushStream) {
CreateStreamRequest request = new CreateStreamRequest();
request.withPlayDomain(playDomain)
.withApp(app)
.withPublish(new CreateStreamRequest.PublishInfo().withPushStream(pushStr... | [
"public",
"CreateStreamResponse",
"createStream",
"(",
"String",
"playDomain",
",",
"String",
"app",
",",
"String",
"pushStream",
")",
"{",
"CreateStreamRequest",
"request",
"=",
"new",
"CreateStreamRequest",
"(",
")",
";",
"request",
".",
"withPlayDomain",
"(",
"... | Create a domain stream in the live stream service.
@param playDomain The domain which this stream belongs to
@param app The app which this stream belongs to, may not exist when create stream
@param pushStream, name of this stream
@return the response | [
"Create",
"a",
"domain",
"stream",
"in",
"the",
"live",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1379-L1385 |
googleads/googleads-java-lib | modules/ads_lib/src/main/java/com/google/api/ads/admanager/lib/utils/DateTimesHelper.java | DateTimesHelper.dateToString | public String dateToString(D date) {
"""
Returns string representation of this date.
@param date the date to stringify
@return a string representation of the {@code Date} in {@code yyyy-MM-dd}
"""
try {
return String.format(DATE_PATTERN,
(Integer) PropertyUtils.getProperty(date, "year")... | java | public String dateToString(D date) {
try {
return String.format(DATE_PATTERN,
(Integer) PropertyUtils.getProperty(date, "year"),
(Integer) PropertyUtils.getProperty(date, "month"),
(Integer) PropertyUtils.getProperty(date, "day"));
} catch (IllegalAccessException e) {
t... | [
"public",
"String",
"dateToString",
"(",
"D",
"date",
")",
"{",
"try",
"{",
"return",
"String",
".",
"format",
"(",
"DATE_PATTERN",
",",
"(",
"Integer",
")",
"PropertyUtils",
".",
"getProperty",
"(",
"date",
",",
"\"year\"",
")",
",",
"(",
"Integer",
")"... | Returns string representation of this date.
@param date the date to stringify
@return a string representation of the {@code Date} in {@code yyyy-MM-dd} | [
"Returns",
"string",
"representation",
"of",
"this",
"date",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/admanager/lib/utils/DateTimesHelper.java#L129-L142 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/products/ProductExtraUrl.java | ProductExtraUrl.getExtraUrl | public static MozuUrl getExtraUrl(String attributeFQN, String productCode, String responseFields) {
"""
Get Resource Url for GetExtra
@param attributeFQN Fully qualified name for an attribute.
@param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a ... | java | public static MozuUrl getExtraUrl(String attributeFQN, String productCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/Extras/{attributeFQN}?responseFields={responseFields}");
formatter.formatUrl("attributeFQN", attributeFQN);
formatt... | [
"public",
"static",
"MozuUrl",
"getExtraUrl",
"(",
"String",
"attributeFQN",
",",
"String",
"productCode",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/products/{productCode}/Extras/{... | Get Resource Url for GetExtra
@param attributeFQN Fully qualified name for an attribute.
@param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of d... | [
"Get",
"Resource",
"Url",
"for",
"GetExtra"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/products/ProductExtraUrl.java#L71-L78 |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADSTM.java | MOEADSTM.calculateDistance2 | public double calculateDistance2(DoubleSolution individual, double[] lambda) {
"""
Calculate the perpendicular distance between the solution and reference line
"""
double distance;
double distanceSum = 0.0;
double[] vecInd = new double[problem.getNumberOfObjectives()];
double[] normalizedObj ... | java | public double calculateDistance2(DoubleSolution individual, double[] lambda) {
double distance;
double distanceSum = 0.0;
double[] vecInd = new double[problem.getNumberOfObjectives()];
double[] normalizedObj = new double[problem.getNumberOfObjectives()];
for (int i = 0; i < problem.getNumberOfObj... | [
"public",
"double",
"calculateDistance2",
"(",
"DoubleSolution",
"individual",
",",
"double",
"[",
"]",
"lambda",
")",
"{",
"double",
"distance",
";",
"double",
"distanceSum",
"=",
"0.0",
";",
"double",
"[",
"]",
"vecInd",
"=",
"new",
"double",
"[",
"problem... | Calculate the perpendicular distance between the solution and reference line | [
"Calculate",
"the",
"perpendicular",
"distance",
"between",
"the",
"solution",
"and",
"reference",
"line"
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADSTM.java#L345-L366 |
jillesvangurp/jsonj | src/main/java/com/github/jsonj/tools/JsonSerializer.java | JsonSerializer.serialize | public static void serialize(@Nonnull Writer out, @Nonnull JsonElement json, boolean pretty) throws IOException {
"""
Writes the object out as json.
@param out
output writer
@param json
a {@link JsonElement}
@param pretty
if true, a properly indented version of the json is written
@throws IOException
i... | java | public static void serialize(@Nonnull Writer out, @Nonnull JsonElement json, boolean pretty) throws IOException {
BufferedWriter bw = new BufferedWriter(out);
serialize(bw, json, pretty, 0);
if(pretty) {
bw.write('\n');
}
bw.flush();
} | [
"public",
"static",
"void",
"serialize",
"(",
"@",
"Nonnull",
"Writer",
"out",
",",
"@",
"Nonnull",
"JsonElement",
"json",
",",
"boolean",
"pretty",
")",
"throws",
"IOException",
"{",
"BufferedWriter",
"bw",
"=",
"new",
"BufferedWriter",
"(",
"out",
")",
";"... | Writes the object out as json.
@param out
output writer
@param json
a {@link JsonElement}
@param pretty
if true, a properly indented version of the json is written
@throws IOException
if there is a problem writing to the writer | [
"Writes",
"the",
"object",
"out",
"as",
"json",
"."
] | train | https://github.com/jillesvangurp/jsonj/blob/1da0c44c5bdb60c0cd806c48d2da5a8a75bf84af/src/main/java/com/github/jsonj/tools/JsonSerializer.java#L140-L147 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.getCustomID | public static String getCustomID(String id) {
"""
Parse a custom time zone identifier and return the normalized
custom time zone identifier for the given custom id string.
@param id a string of the form GMT[+-]hh:mm, GMT[+-]hhmm, or
GMT[+-]hh.
@return The normalized custom id string.
"""
int[] fiel... | java | public static String getCustomID(String id) {
int[] fields = new int[4];
if (parseCustomID(id, fields)) {
return formatCustomID(fields[1], fields[2], fields[3], fields[0] < 0);
}
return null;
} | [
"public",
"static",
"String",
"getCustomID",
"(",
"String",
"id",
")",
"{",
"int",
"[",
"]",
"fields",
"=",
"new",
"int",
"[",
"4",
"]",
";",
"if",
"(",
"parseCustomID",
"(",
"id",
",",
"fields",
")",
")",
"{",
"return",
"formatCustomID",
"(",
"field... | Parse a custom time zone identifier and return the normalized
custom time zone identifier for the given custom id string.
@param id a string of the form GMT[+-]hh:mm, GMT[+-]hhmm, or
GMT[+-]hh.
@return The normalized custom id string. | [
"Parse",
"a",
"custom",
"time",
"zone",
"identifier",
"and",
"return",
"the",
"normalized",
"custom",
"time",
"zone",
"identifier",
"for",
"the",
"given",
"custom",
"id",
"string",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L639-L645 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/ExtendedFormulaFactory.java | ExtendedFormulaFactory.shrinkSet | private static <T> void shrinkSet(final Set<T> set, int newSize) {
"""
Shrinks a given set to a given size
@param set the set to be shrunk
@param newSize the new size, the set shall be shrunk to
"""
if (!(set instanceof LinkedHashSet))
throw new IllegalStateException("Cannot shrink a set which ... | java | private static <T> void shrinkSet(final Set<T> set, int newSize) {
if (!(set instanceof LinkedHashSet))
throw new IllegalStateException("Cannot shrink a set which is not of type LinkedHashSet");
if (newSize > set.size())
throw new IllegalStateException("Cannot shrink a set of size " + set.size() + "... | [
"private",
"static",
"<",
"T",
">",
"void",
"shrinkSet",
"(",
"final",
"Set",
"<",
"T",
">",
"set",
",",
"int",
"newSize",
")",
"{",
"if",
"(",
"!",
"(",
"set",
"instanceof",
"LinkedHashSet",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"C... | Shrinks a given set to a given size
@param set the set to be shrunk
@param newSize the new size, the set shall be shrunk to | [
"Shrinks",
"a",
"given",
"set",
"to",
"a",
"given",
"size"
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/ExtendedFormulaFactory.java#L82-L97 |
sundrio/sundrio | annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java | ToPojo.readPrimitiveArrayValue | private static String readPrimitiveArrayValue(String ref, TypeDef source, Property property) {
"""
Returns the string representation of the code that reads a primitive array property.
@param ref The reference.
@param source The type of the reference.
@param property The property to read.
... | java | private static String readPrimitiveArrayValue(String ref, TypeDef source, Property property) {
StringBuilder sb = new StringBuilder();
Method getter = getterOf(source, property);
sb.append(indent(ref))
.append("Arrays.stream(")
.append("("+property.getTypeRef().t... | [
"private",
"static",
"String",
"readPrimitiveArrayValue",
"(",
"String",
"ref",
",",
"TypeDef",
"source",
",",
"Property",
"property",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Method",
"getter",
"=",
"getterOf",
"(",
"sourc... | Returns the string representation of the code that reads a primitive array property.
@param ref The reference.
@param source The type of the reference.
@param property The property to read.
@return The code. | [
"Returns",
"the",
"string",
"representation",
"of",
"the",
"code",
"that",
"reads",
"a",
"primitive",
"array",
"property",
"."
] | train | https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java#L819-L827 |
alkacon/opencms-core | src/org/opencms/widgets/CmsLocalizationWidget.java | CmsLocalizationWidget.initConfiguration | protected void initConfiguration(CmsObject cms, I_CmsWidgetParameter param) {
"""
Initializes the localized bundle to get the value from, the optional key name and the optional locale.<p>
@param cms an initialized instance of a CmsObject
@param param the widget parameter to generate the widget for
"""
... | java | protected void initConfiguration(CmsObject cms, I_CmsWidgetParameter param) {
// set the default bundle key
m_bundleKey = param.getName();
// set the default locale for XML contents
m_locale = cms.getRequestContext().getLocale();
try {
I_CmsXmlContentValue value = (I... | [
"protected",
"void",
"initConfiguration",
"(",
"CmsObject",
"cms",
",",
"I_CmsWidgetParameter",
"param",
")",
"{",
"// set the default bundle key",
"m_bundleKey",
"=",
"param",
".",
"getName",
"(",
")",
";",
"// set the default locale for XML contents",
"m_locale",
"=",
... | Initializes the localized bundle to get the value from, the optional key name and the optional locale.<p>
@param cms an initialized instance of a CmsObject
@param param the widget parameter to generate the widget for | [
"Initializes",
"the",
"localized",
"bundle",
"to",
"get",
"the",
"value",
"from",
"the",
"optional",
"key",
"name",
"and",
"the",
"optional",
"locale",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsLocalizationWidget.java#L300-L335 |
telly/groundy | library/src/main/java/com/telly/groundy/Groundy.java | Groundy.arg | public Groundy arg(String key, ArrayList<CharSequence> value) {
"""
Inserts an ArrayList<CharSequence> value into the mapping of this Bundle, replacing any
existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value an ArrayList<CharSequence> object, or null
... | java | public Groundy arg(String key, ArrayList<CharSequence> value) {
mArgs.putCharSequenceArrayList(key, value);
return this;
} | [
"public",
"Groundy",
"arg",
"(",
"String",
"key",
",",
"ArrayList",
"<",
"CharSequence",
">",
"value",
")",
"{",
"mArgs",
".",
"putCharSequenceArrayList",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts an ArrayList<CharSequence> value into the mapping of this Bundle, replacing any
existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value an ArrayList<CharSequence> object, or null | [
"Inserts",
"an",
"ArrayList<CharSequence",
">",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/Groundy.java#L584-L587 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.getMessageStatistic | public MessageStatListResult getMessageStatistic(String timeUnit, String start, int duration)
throws APIConnectionException, APIRequestException {
"""
Get message statistic. Detail instructions please refer to https://docs.jiguang.cn/jmessage/server/rest_api_im_report_v2/#_6
@param timeUnit MUST be on... | java | public MessageStatListResult getMessageStatistic(String timeUnit, String start, int duration)
throws APIConnectionException, APIRequestException {
return _reportClient.getMessageStatistic(timeUnit, start, duration);
} | [
"public",
"MessageStatListResult",
"getMessageStatistic",
"(",
"String",
"timeUnit",
",",
"String",
"start",
",",
"int",
"duration",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_reportClient",
".",
"getMessageStatistic",
"(",
"ti... | Get message statistic. Detail instructions please refer to https://docs.jiguang.cn/jmessage/server/rest_api_im_report_v2/#_6
@param timeUnit MUST be one of HOUR, DAY, MONTH
@param start start time, when timeUnit is HOUR, format: yyyy-MM-dd HH,
@param duration depends on timeUnit, the duration has limit
@return {@link M... | [
"Get",
"message",
"statistic",
".",
"Detail",
"instructions",
"please",
"refer",
"to",
"https",
":",
"//",
"docs",
".",
"jiguang",
".",
"cn",
"/",
"jmessage",
"/",
"server",
"/",
"rest_api_im_report_v2",
"/",
"#_6"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L1010-L1013 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java | DatabaseUtils.blobFileDescriptorForQuery | public static ParcelFileDescriptor blobFileDescriptorForQuery(SQLiteDatabase db,
String query, String[] selectionArgs) {
"""
Utility method to run the query on the db and return the blob value in the
first column of the first row.
@return A read-only file descriptor for a copy of the blob value.
... | java | public static ParcelFileDescriptor blobFileDescriptorForQuery(SQLiteDatabase db,
String query, String[] selectionArgs) {
SQLiteStatement prog = db.compileStatement(query);
try {
return blobFileDescriptorForQuery(prog, selectionArgs);
} finally {
prog.close();
... | [
"public",
"static",
"ParcelFileDescriptor",
"blobFileDescriptorForQuery",
"(",
"SQLiteDatabase",
"db",
",",
"String",
"query",
",",
"String",
"[",
"]",
"selectionArgs",
")",
"{",
"SQLiteStatement",
"prog",
"=",
"db",
".",
"compileStatement",
"(",
"query",
")",
";"... | Utility method to run the query on the db and return the blob value in the
first column of the first row.
@return A read-only file descriptor for a copy of the blob value. | [
"Utility",
"method",
"to",
"run",
"the",
"query",
"on",
"the",
"db",
"and",
"return",
"the",
"blob",
"value",
"in",
"the",
"first",
"column",
"of",
"the",
"first",
"row",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L878-L886 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_publicFolder_path_GET | public OvhPublicFolder organizationName_service_exchangeService_publicFolder_path_GET(String organizationName, String exchangeService, String path) throws IOException {
"""
Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}
@param organizationN... | java | public OvhPublicFolder organizationName_service_exchangeService_publicFolder_path_GET(String organizationName, String exchangeService, String path) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}";
StringBuilder sb = path(qPath, organizationName,... | [
"public",
"OvhPublicFolder",
"organizationName_service_exchangeService_publicFolder_path_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/exchange/{organization... | Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}/publicFolder/{path}
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service
@param path [required] Path for public fo... | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L166-L171 |
hawkular/hawkular-apm | api/src/main/java/org/hawkular/apm/api/model/trace/Node.java | Node.addCausedByCorrelationId | public Node addCausedByCorrelationId(String id) {
"""
This method adds a 'caused by' scoped correlation id.
@param id The id
@return The node
"""
this.correlationIds.add(new CorrelationIdentifier(Scope.CausedBy, id));
return this;
} | java | public Node addCausedByCorrelationId(String id) {
this.correlationIds.add(new CorrelationIdentifier(Scope.CausedBy, id));
return this;
} | [
"public",
"Node",
"addCausedByCorrelationId",
"(",
"String",
"id",
")",
"{",
"this",
".",
"correlationIds",
".",
"add",
"(",
"new",
"CorrelationIdentifier",
"(",
"Scope",
".",
"CausedBy",
",",
"id",
")",
")",
";",
"return",
"this",
";",
"}"
] | This method adds a 'caused by' scoped correlation id.
@param id The id
@return The node | [
"This",
"method",
"adds",
"a",
"caused",
"by",
"scoped",
"correlation",
"id",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/api/src/main/java/org/hawkular/apm/api/model/trace/Node.java#L277-L280 |
banq/jdonframework | JdonAccessory/jdon-struts1x/src/main/java/com/jdon/model/ModelHandlerManagerImp.java | ModelHandlerManagerImp.makeModelObject | private Object makeModelObject(String formName) {
"""
create model instance from the model class that read from the xml
configure.
@param formName
@return
@throws Exception
"""
Object object = null;
Class modelClass = null;
try {
modelClass = (Class) modelFactory.getModelClasses(formName);
... | java | private Object makeModelObject(String formName) {
Object object = null;
Class modelClass = null;
try {
modelClass = (Class) modelFactory.getModelClasses(formName);
if (modelClass == null) {
throw new Exception(" not found the model in config xml, formName=" + formName);
}
object = modelCla... | [
"private",
"Object",
"makeModelObject",
"(",
"String",
"formName",
")",
"{",
"Object",
"object",
"=",
"null",
";",
"Class",
"modelClass",
"=",
"null",
";",
"try",
"{",
"modelClass",
"=",
"(",
"Class",
")",
"modelFactory",
".",
"getModelClasses",
"(",
"formNa... | create model instance from the model class that read from the xml
configure.
@param formName
@return
@throws Exception | [
"create",
"model",
"instance",
"from",
"the",
"model",
"class",
"that",
"read",
"from",
"the",
"xml",
"configure",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-struts1x/src/main/java/com/jdon/model/ModelHandlerManagerImp.java#L99-L114 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/utils/ESResponseWrapper.java | ESResponseWrapper.wrapFindResult | public Object wrapFindResult(Map<String, Object> searchResults, EntityType entityType, Object result,
EntityMetadata metadata, boolean b) {
"""
Wrap find result.
@param searchResults
the search results
@param entityType
the entity type
@param result
the result
@param metadata
the metadata
@p... | java | public Object wrapFindResult(Map<String, Object> searchResults, EntityType entityType, Object result,
EntityMetadata metadata, boolean b)
{
return wrap(searchResults, entityType, result, metadata, b);
} | [
"public",
"Object",
"wrapFindResult",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"searchResults",
",",
"EntityType",
"entityType",
",",
"Object",
"result",
",",
"EntityMetadata",
"metadata",
",",
"boolean",
"b",
")",
"{",
"return",
"wrap",
"(",
"searchResu... | Wrap find result.
@param searchResults
the search results
@param entityType
the entity type
@param result
the result
@param metadata
the metadata
@param b
the b
@return the object | [
"Wrap",
"find",
"result",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/utils/ESResponseWrapper.java#L593-L597 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/BatchKernelImpl.java | BatchKernelImpl.createPartitionWorkUnit | @Override
public BatchPartitionWorkUnit createPartitionWorkUnit(PartitionPlanConfig config,
Step step,
PartitionReplyQueue partitionReplyQueue,
... | java | @Override
public BatchPartitionWorkUnit createPartitionWorkUnit(PartitionPlanConfig config,
Step step,
PartitionReplyQueue partitionReplyQueue,
... | [
"@",
"Override",
"public",
"BatchPartitionWorkUnit",
"createPartitionWorkUnit",
"(",
"PartitionPlanConfig",
"config",
",",
"Step",
"step",
",",
"PartitionReplyQueue",
"partitionReplyQueue",
",",
"boolean",
"isRemoteDispatch",
")",
"{",
"JSLJob",
"partitionJobModel",
"=",
... | Build a list of batch work units and set them up in STARTING state but
don't start them yet. | [
"Build",
"a",
"list",
"of",
"batch",
"work",
"units",
"and",
"set",
"them",
"up",
"in",
"STARTING",
"state",
"but",
"don",
"t",
"start",
"them",
"yet",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/BatchKernelImpl.java#L401-L419 |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/ir/transform/GosuClassTransformer.java | GosuClassTransformer.maybeWrapProgramEvaluateForManangedProgram | private IRStatement maybeWrapProgramEvaluateForManangedProgram( DynamicFunctionSymbol dfs, IRStatement methodBody ) {
"""
If this is:
<ul>
<li> a Gosu program and
<li> it has a superclass that implements IManagedProgramInstance and
<li> this method is <code>evaluate( IExternalSymbolMap )</code>
</ul>
Generat... | java | private IRStatement maybeWrapProgramEvaluateForManangedProgram( DynamicFunctionSymbol dfs, IRStatement methodBody )
{
if( dfs.getDisplayName().equals( "evaluate" ) )
{
IType[] argTypes = dfs.getArgTypes();
if( argTypes.length == 1 && argTypes[0] == JavaTypes.IEXTERNAL_SYMBOL_MAP() )
{
... | [
"private",
"IRStatement",
"maybeWrapProgramEvaluateForManangedProgram",
"(",
"DynamicFunctionSymbol",
"dfs",
",",
"IRStatement",
"methodBody",
")",
"{",
"if",
"(",
"dfs",
".",
"getDisplayName",
"(",
")",
".",
"equals",
"(",
"\"evaluate\"",
")",
")",
"{",
"IType",
... | If this is:
<ul>
<li> a Gosu program and
<li> it has a superclass that implements IManagedProgramInstance and
<li> this method is <code>evaluate( IExternalSymbolMap )</code>
</ul>
Generate the evaluate() method like so:
<pre>
function evaluate( map: IExternalSymbolMap ) : Object {
var $failure : Throwable
if( this.befo... | [
"If",
"this",
"is",
":",
"<ul",
">",
"<li",
">",
"a",
"Gosu",
"program",
"and",
"<li",
">",
"it",
"has",
"a",
"superclass",
"that",
"implements",
"IManagedProgramInstance",
"and",
"<li",
">",
"this",
"method",
"is",
"<code",
">",
"evaluate",
"(",
"IExter... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/ir/transform/GosuClassTransformer.java#L1616-L1643 |
jklingsporn/vertx-jooq | vertx-jooq-generate/src/main/java/io/github/jklingsporn/vertx/jooq/generate/VertxGenerator.java | VertxGenerator.handleCustomTypeFromJson | protected boolean handleCustomTypeFromJson(TypedElementDefinition<?> column, String setter, String columnType, String javaMemberName, JavaWriter out) {
"""
Overwrite this method to handle your custom type. This is needed especially when you have custom converters.
@param column the column definition
@param sette... | java | protected boolean handleCustomTypeFromJson(TypedElementDefinition<?> column, String setter, String columnType, String javaMemberName, JavaWriter out){
return false;
} | [
"protected",
"boolean",
"handleCustomTypeFromJson",
"(",
"TypedElementDefinition",
"<",
"?",
">",
"column",
",",
"String",
"setter",
",",
"String",
"columnType",
",",
"String",
"javaMemberName",
",",
"JavaWriter",
"out",
")",
"{",
"return",
"false",
";",
"}"
] | Overwrite this method to handle your custom type. This is needed especially when you have custom converters.
@param column the column definition
@param setter the setter name
@param columnType the type of the column
@param javaMemberName the java member name
@param out the JavaWriter
@return <code>true</code> if the co... | [
"Overwrite",
"this",
"method",
"to",
"handle",
"your",
"custom",
"type",
".",
"This",
"is",
"needed",
"especially",
"when",
"you",
"have",
"custom",
"converters",
"."
] | train | https://github.com/jklingsporn/vertx-jooq/blob/0db00b5e040639c309691dfbc125034fa3346d88/vertx-jooq-generate/src/main/java/io/github/jklingsporn/vertx/jooq/generate/VertxGenerator.java#L58-L60 |
knowm/XChange | xchange-core/src/main/java/org/knowm/xchange/utils/CertHelper.java | CertHelper.trustAllCerts | @Deprecated
public static void trustAllCerts() throws Exception {
"""
Manually override the JVM's TrustManager to accept all HTTPS connections. Use this ONLY for
testing, and even at that use it cautiously. Someone could steal your API keys with a MITM
attack!
@deprecated create an exclusion specific to you... | java | @Deprecated
public static void trustAllCerts() throws Exception {
TrustManager[] trustAllCerts =
new TrustManager[] {
new X509TrustManager() {
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
... | [
"@",
"Deprecated",
"public",
"static",
"void",
"trustAllCerts",
"(",
")",
"throws",
"Exception",
"{",
"TrustManager",
"[",
"]",
"trustAllCerts",
"=",
"new",
"TrustManager",
"[",
"]",
"{",
"new",
"X509TrustManager",
"(",
")",
"{",
"@",
"Override",
"public",
"... | Manually override the JVM's TrustManager to accept all HTTPS connections. Use this ONLY for
testing, and even at that use it cautiously. Someone could steal your API keys with a MITM
attack!
@deprecated create an exclusion specific to your need rather than changing all behavior | [
"Manually",
"override",
"the",
"JVM",
"s",
"TrustManager",
"to",
"accept",
"all",
"HTTPS",
"connections",
".",
"Use",
"this",
"ONLY",
"for",
"testing",
"and",
"even",
"at",
"that",
"use",
"it",
"cautiously",
".",
"Someone",
"could",
"steal",
"your",
"API",
... | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-core/src/main/java/org/knowm/xchange/utils/CertHelper.java#L250-L289 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java | FileUtils.loadSymbolMultimap | @Deprecated
public static ImmutableMultimap<Symbol, Symbol> loadSymbolMultimap(File multimapFile)
throws IOException {
"""
Deprecated in favor of the CharSource version to force the user to define their encoding. If
you call this, it will use UTF_8 encoding.
@deprecated
"""
return loadSymbolMul... | java | @Deprecated
public static ImmutableMultimap<Symbol, Symbol> loadSymbolMultimap(File multimapFile)
throws IOException {
return loadSymbolMultimap(Files.asCharSource(multimapFile, Charsets.UTF_8));
} | [
"@",
"Deprecated",
"public",
"static",
"ImmutableMultimap",
"<",
"Symbol",
",",
"Symbol",
">",
"loadSymbolMultimap",
"(",
"File",
"multimapFile",
")",
"throws",
"IOException",
"{",
"return",
"loadSymbolMultimap",
"(",
"Files",
".",
"asCharSource",
"(",
"multimapFile... | Deprecated in favor of the CharSource version to force the user to define their encoding. If
you call this, it will use UTF_8 encoding.
@deprecated | [
"Deprecated",
"in",
"favor",
"of",
"the",
"CharSource",
"version",
"to",
"force",
"the",
"user",
"to",
"define",
"their",
"encoding",
".",
"If",
"you",
"call",
"this",
"it",
"will",
"use",
"UTF_8",
"encoding",
"."
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java#L1169-L1173 |
SeaCloudsEU/SeaCloudsPlatform | discoverer/src/main/java/eu/seaclouds/platform/discoverer/core/Offering.java | Offering.addProperty | public boolean addProperty(String propertyName, String property) {
"""
Used to add a new property to the offering
@param propertyName the name of the property
@param property the value of the property
@return true if the property was already present (and it has been replaced), false otherwise
"""
... | java | public boolean addProperty(String propertyName, String property) {
boolean ret = this.properties.containsKey(propertyName);
this.properties.put(propertyName, property);
return ret;
} | [
"public",
"boolean",
"addProperty",
"(",
"String",
"propertyName",
",",
"String",
"property",
")",
"{",
"boolean",
"ret",
"=",
"this",
".",
"properties",
".",
"containsKey",
"(",
"propertyName",
")",
";",
"this",
".",
"properties",
".",
"put",
"(",
"property... | Used to add a new property to the offering
@param propertyName the name of the property
@param property the value of the property
@return true if the property was already present (and it has been replaced), false otherwise | [
"Used",
"to",
"add",
"a",
"new",
"property",
"to",
"the",
"offering"
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/discoverer/src/main/java/eu/seaclouds/platform/discoverer/core/Offering.java#L56-L60 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java | FormatUtil.format | public static String format(double[][] m, int w, int d, String pre, String pos, String csep) {
"""
Returns a string representation of this matrix.
@param w column width
@param d number of digits after the decimal
@param pre Row prefix (e.g. " [")
@param pos Row postfix (e.g. "]\n")
@param csep Column separa... | java | public static String format(double[][] m, int w, int d, String pre, String pos, String csep) {
DecimalFormat format = new DecimalFormat();
format.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US));
format.setMinimumIntegerDigits(1);
format.setMaximumFractionDigits(d);
format.setMinimumFrac... | [
"public",
"static",
"String",
"format",
"(",
"double",
"[",
"]",
"[",
"]",
"m",
",",
"int",
"w",
",",
"int",
"d",
",",
"String",
"pre",
",",
"String",
"pos",
",",
"String",
"csep",
")",
"{",
"DecimalFormat",
"format",
"=",
"new",
"DecimalFormat",
"("... | Returns a string representation of this matrix.
@param w column width
@param d number of digits after the decimal
@param pre Row prefix (e.g. " [")
@param pos Row postfix (e.g. "]\n")
@param csep Column separator (e.g. ", ")
@return a string representation of this matrix | [
"Returns",
"a",
"string",
"representation",
"of",
"this",
"matrix",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FormatUtil.java#L646-L668 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/base64/Base64.java | Base64.encodeBytes | @Nonnull
public static String encodeBytes (@Nonnull final byte [] source,
@Nonnegative final int off,
@Nonnegative final int len,
final int nOptions) throws IOException {
"""
Encodes a byte array into Base... | java | @Nonnull
public static String encodeBytes (@Nonnull final byte [] source,
@Nonnegative final int off,
@Nonnegative final int len,
final int nOptions) throws IOException
{
final byte [] encoded = encodeByt... | [
"@",
"Nonnull",
"public",
"static",
"String",
"encodeBytes",
"(",
"@",
"Nonnull",
"final",
"byte",
"[",
"]",
"source",
",",
"@",
"Nonnegative",
"final",
"int",
"off",
",",
"@",
"Nonnegative",
"final",
"int",
"len",
",",
"final",
"int",
"nOptions",
")",
"... | Encodes a byte array into Base64 notation.
<p>
Example options:
<pre>
GZIP: gzip-compresses object before encoding it.
DO_BREAK_LINES: break lines at 76 characters
Note: Technically, this makes your encoding non-compliant.
</pre>
<p>
Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
<p>
Example:
<code>encode... | [
"Encodes",
"a",
"byte",
"array",
"into",
"Base64",
"notation",
".",
"<p",
">",
"Example",
"options",
":"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L1786-L1796 |
skuzzle/semantic-version | src/it/java/de/skuzzle/semantic/VersionRegEx.java | VersionRegEx.compareWithBuildMetaData | public static int compareWithBuildMetaData(VersionRegEx v1, VersionRegEx v2) {
"""
Compares two Versions with additionally considering the build meta data field if
all other parts are equal. Note: This is <em>not</em> part of the semantic version
specification.
<p>
Comparison of the build meta data parts hap... | java | public static int compareWithBuildMetaData(VersionRegEx v1, VersionRegEx v2) {
// throw NPE to comply with Comparable specification
if (v1 == null) {
throw new NullPointerException("v1 is null");
} else if (v2 == null) {
throw new NullPointerException("v2 is null");
... | [
"public",
"static",
"int",
"compareWithBuildMetaData",
"(",
"VersionRegEx",
"v1",
",",
"VersionRegEx",
"v2",
")",
"{",
"// throw NPE to comply with Comparable specification",
"if",
"(",
"v1",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"v1 i... | Compares two Versions with additionally considering the build meta data field if
all other parts are equal. Note: This is <em>not</em> part of the semantic version
specification.
<p>
Comparison of the build meta data parts happens exactly as for pre release
identifiers. Considering of build meta data first kicks in if... | [
"Compares",
"two",
"Versions",
"with",
"additionally",
"considering",
"the",
"build",
"meta",
"data",
"field",
"if",
"all",
"other",
"parts",
"are",
"equal",
".",
"Note",
":",
"This",
"is",
"<em",
">",
"not<",
"/",
"em",
">",
"part",
"of",
"the",
"semant... | train | https://github.com/skuzzle/semantic-version/blob/2ddb66fb80244cd7f67c77ed5f8072d1132ad933/src/it/java/de/skuzzle/semantic/VersionRegEx.java#L324-L332 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.presignedPostPolicy | public Map<String, String> presignedPostPolicy(PostPolicy policy)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
InternalException, InvalidArgumentExc... | java | public Map<String, String> presignedPostPolicy(PostPolicy policy)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException,
InternalException, InvalidArgumentExc... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"presignedPostPolicy",
"(",
"PostPolicy",
"policy",
")",
"throws",
"InvalidBucketNameException",
",",
"NoSuchAlgorithmException",
",",
"InsufficientDataException",
",",
"IOException",
",",
"InvalidKeyException",
",",
"... | Returns string map for given {@link PostPolicy} to upload object with various post policy conditions.
</p><b>Example:</b><br>
<pre>{@code // Create new PostPolicy object for 'my-bucketname', 'my-objectname' and 7 days expire time from now.
PostPolicy policy = new PostPolicy("my-bucketname", "my-objectname", DateTime.n... | [
"Returns",
"string",
"map",
"for",
"given",
"{",
"@link",
"PostPolicy",
"}",
"to",
"upload",
"object",
"with",
"various",
"post",
"policy",
"conditions",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L2584-L2589 |
kuujo/vertigo | core/src/main/java/net/kuujo/vertigo/cluster/impl/ClusterLocator.java | ClusterLocator.locateGroup | public void locateGroup(String groupAddress, Handler<AsyncResult<String>> doneHandler) {
"""
Locates the local address of the nearest group node if one exists.
@param groupAddress The full address of the group to search.
@param doneHandler A handler to be called once the address has been located.
"""
S... | java | public void locateGroup(String groupAddress, Handler<AsyncResult<String>> doneHandler) {
Set<String> registry = vertx.sharedData().getSet(groupAddress);
synchronized (registry) {
if (!registry.isEmpty()) {
locateNode(groupAddress, new HashSet<>(registry), doneHandler);
}
}
} | [
"public",
"void",
"locateGroup",
"(",
"String",
"groupAddress",
",",
"Handler",
"<",
"AsyncResult",
"<",
"String",
">",
">",
"doneHandler",
")",
"{",
"Set",
"<",
"String",
">",
"registry",
"=",
"vertx",
".",
"sharedData",
"(",
")",
".",
"getSet",
"(",
"g... | Locates the local address of the nearest group node if one exists.
@param groupAddress The full address of the group to search.
@param doneHandler A handler to be called once the address has been located. | [
"Locates",
"the",
"local",
"address",
"of",
"the",
"nearest",
"group",
"node",
"if",
"one",
"exists",
"."
] | train | https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/cluster/impl/ClusterLocator.java#L73-L80 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listOperationsAsync | public Observable<List<OperationInner>> listOperationsAsync(String resourceGroupName, String name) {
"""
List all currently running operations on the App Service Environment.
List all currently running operations on the App Service Environment.
@param resourceGroupName Name of the resource group to which the r... | java | public Observable<List<OperationInner>> listOperationsAsync(String resourceGroupName, String name) {
return listOperationsWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<List<OperationInner>>, List<OperationInner>>() {
@Override
public List<OperationInner>... | [
"public",
"Observable",
"<",
"List",
"<",
"OperationInner",
">",
">",
"listOperationsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"listOperationsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"ma... | List all currently running operations on the App Service Environment.
List all currently running operations on the App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException thrown if para... | [
"List",
"all",
"currently",
"running",
"operations",
"on",
"the",
"App",
"Service",
"Environment",
".",
"List",
"all",
"currently",
"running",
"operations",
"on",
"the",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L3654-L3661 |
konvergeio/cofoja | src/main/java/com/google/java/contract/core/agent/ContractClassFileTransformer.java | ContractClassFileTransformer.instrumentWithContracts | @Requires( {
"""
Instruments the passed class file so that it contains contract
methods and calls to these methods. The contract information is
retrieved from the {@link ContractCodePool}.
@param bytecode the bytecode of the class
@param contracts the extracted contracts for the class
@return the instrument... | java | @Requires({
"bytecode != null",
"contracts != null"
})
@Ensures("result != null")
protected byte[] instrumentWithContracts(byte[] bytecode,
ContractAnalyzer contracts) {
ClassReader reader = new ClassReader(bytecode);
ClassWriter writer =
new NonL... | [
"@",
"Requires",
"(",
"{",
"\"bytecode != null\"",
",",
"\"contracts != null\"",
"}",
")",
"@",
"Ensures",
"(",
"\"result != null\"",
")",
"protected",
"byte",
"[",
"]",
"instrumentWithContracts",
"(",
"byte",
"[",
"]",
"bytecode",
",",
"ContractAnalyzer",
"contra... | Instruments the passed class file so that it contains contract
methods and calls to these methods. The contract information is
retrieved from the {@link ContractCodePool}.
@param bytecode the bytecode of the class
@param contracts the extracted contracts for the class
@return the instrumented bytecode of the class | [
"Instruments",
"the",
"passed",
"class",
"file",
"so",
"that",
"it",
"contains",
"contract",
"methods",
"and",
"calls",
"to",
"these",
"methods",
".",
"The",
"contract",
"information",
"is",
"retrieved",
"from",
"the",
"{",
"@link",
"ContractCodePool",
"}",
".... | train | https://github.com/konvergeio/cofoja/blob/6ded58fa05eb5bf85f16353c8dd4c70bee59121a/src/main/java/com/google/java/contract/core/agent/ContractClassFileTransformer.java#L375-L393 |
apache/incubator-gobblin | gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/TokenBucket.java | TokenBucket.tryReserveTokens | synchronized long tryReserveTokens(long tokens, long maxWaitMillis) {
"""
Note: this method should only be called while holding the class lock. For performance, the lock is not explicitly
acquired.
@return the wait until the tokens are available or negative if they can't be acquired in the give timeout.
""... | java | synchronized long tryReserveTokens(long tokens, long maxWaitMillis) {
long now = System.currentTimeMillis();
long waitUntilNextTokenAvailable = Math.max(0, this.nextTokenAvailableMillis - now);
updateTokensStored(now);
if (tokens <= this.tokensStored) {
this.tokensStored -= tokens;
return w... | [
"synchronized",
"long",
"tryReserveTokens",
"(",
"long",
"tokens",
",",
"long",
"maxWaitMillis",
")",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"waitUntilNextTokenAvailable",
"=",
"Math",
".",
"max",
"(",
"0",
",",
"... | Note: this method should only be called while holding the class lock. For performance, the lock is not explicitly
acquired.
@return the wait until the tokens are available or negative if they can't be acquired in the give timeout. | [
"Note",
":",
"this",
"method",
"should",
"only",
"be",
"called",
"while",
"holding",
"the",
"class",
"lock",
".",
"For",
"performance",
"the",
"lock",
"is",
"not",
"explicitly",
"acquired",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-server/src/main/java/org/apache/gobblin/restli/throttling/TokenBucket.java#L101-L121 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java | SVGAndroidRenderer.render | private void render(SVG.Svg obj, Box viewPort) {
"""
When referenced by a <use> element, it's width and height take precedence over the ones in the <svg> object.
"""
render(obj, viewPort, obj.viewBox, obj.preserveAspectRatio);
} | java | private void render(SVG.Svg obj, Box viewPort)
{
render(obj, viewPort, obj.viewBox, obj.preserveAspectRatio);
} | [
"private",
"void",
"render",
"(",
"SVG",
".",
"Svg",
"obj",
",",
"Box",
"viewPort",
")",
"{",
"render",
"(",
"obj",
",",
"viewPort",
",",
"obj",
".",
"viewBox",
",",
"obj",
".",
"preserveAspectRatio",
")",
";",
"}"
] | When referenced by a <use> element, it's width and height take precedence over the ones in the <svg> object. | [
"When",
"referenced",
"by",
"a",
"<use",
">",
"element",
"it",
"s",
"width",
"and",
"height",
"take",
"precedence",
"over",
"the",
"ones",
"in",
"the",
"<svg",
">",
"object",
"."
] | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java#L575-L578 |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/UrlUtil.java | UrlUtil.build | public static URL build(@Nonnull final String url) {
"""
Creates an {@code URL} instance from the given {@code String} representation.<br>
<br>
This method tunnels a {@link MalformedURLException} by an {@link IllegalStateOfArgumentException}.
@param url
{@code String} representation of an {@code URL}
@retur... | java | public static URL build(@Nonnull final String url) {
Check.notNull(url, "url");
URL ret = null;
try {
ret = new URL(url);
} catch (final MalformedURLException e) {
throw new IllegalStateOfArgumentException("The given string is not a valid URL: " + url, e);
}
return ret;
} | [
"public",
"static",
"URL",
"build",
"(",
"@",
"Nonnull",
"final",
"String",
"url",
")",
"{",
"Check",
".",
"notNull",
"(",
"url",
",",
"\"url\"",
")",
";",
"URL",
"ret",
"=",
"null",
";",
"try",
"{",
"ret",
"=",
"new",
"URL",
"(",
"url",
")",
";"... | Creates an {@code URL} instance from the given {@code String} representation.<br>
<br>
This method tunnels a {@link MalformedURLException} by an {@link IllegalStateOfArgumentException}.
@param url
{@code String} representation of an {@code URL}
@return new {@code URL} instance
@throws net.sf.qualitycheck.exception.Ill... | [
"Creates",
"an",
"{",
"@code",
"URL",
"}",
"instance",
"from",
"the",
"given",
"{",
"@code",
"String",
"}",
"representation",
".",
"<br",
">",
"<br",
">",
"This",
"method",
"tunnels",
"a",
"{",
"@link",
"MalformedURLException",
"}",
"by",
"an",
"{",
"@li... | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/UrlUtil.java#L56-L66 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/metadata/MetadataManager.java | MetadataManager.readDescriptorRepository | public DescriptorRepository readDescriptorRepository(InputStream inst) {
"""
Read ClassDescriptors from the given InputStream.
@see #mergeDescriptorRepository
"""
try
{
RepositoryPersistor persistor = new RepositoryPersistor();
return persistor.readDescriptorReposit... | java | public DescriptorRepository readDescriptorRepository(InputStream inst)
{
try
{
RepositoryPersistor persistor = new RepositoryPersistor();
return persistor.readDescriptorRepository(inst);
}
catch (Exception e)
{
throw new MetadataEx... | [
"public",
"DescriptorRepository",
"readDescriptorRepository",
"(",
"InputStream",
"inst",
")",
"{",
"try",
"{",
"RepositoryPersistor",
"persistor",
"=",
"new",
"RepositoryPersistor",
"(",
")",
";",
"return",
"persistor",
".",
"readDescriptorRepository",
"(",
"inst",
"... | Read ClassDescriptors from the given InputStream.
@see #mergeDescriptorRepository | [
"Read",
"ClassDescriptors",
"from",
"the",
"given",
"InputStream",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/MetadataManager.java#L351-L362 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountsInner.java | DataLakeStoreAccountsInner.listByAccountAsync | public Observable<Page<DataLakeStoreAccountInformationInner>> listByAccountAsync(final String resourceGroupName, final String accountName) {
"""
Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any.
@param reso... | java | public Observable<Page<DataLakeStoreAccountInformationInner>> listByAccountAsync(final String resourceGroupName, final String accountName) {
return listByAccountWithServiceResponseAsync(resourceGroupName, accountName)
.map(new Func1<ServiceResponse<Page<DataLakeStoreAccountInformationInner>>, Page<D... | [
"public",
"Observable",
"<",
"Page",
"<",
"DataLakeStoreAccountInformationInner",
">",
">",
"listByAccountAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
")",
"{",
"return",
"listByAccountWithServiceResponseAsync",
"(",
"resourc... | Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Analytics account.
@throws IllegalArgumentException thr... | [
"Gets",
"the",
"first",
"page",
"of",
"Data",
"Lake",
"Store",
"accounts",
"linked",
"to",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/DataLakeStoreAccountsInner.java#L136-L144 |
zk1931/jzab | src/main/java/com/github/zk1931/jzab/Leader.java | Leader.getNextProposedZxid | private Zxid getNextProposedZxid() {
"""
Gets next proposed zxid for leader in broadcasting phase.
@return the zxid of next proposed transaction.
"""
if (lastProposedZxid.getEpoch() != establishedEpoch) {
lastProposedZxid = new Zxid(establishedEpoch, -1);
}
lastProposedZxid = new Zxid(esta... | java | private Zxid getNextProposedZxid() {
if (lastProposedZxid.getEpoch() != establishedEpoch) {
lastProposedZxid = new Zxid(establishedEpoch, -1);
}
lastProposedZxid = new Zxid(establishedEpoch,
lastProposedZxid.getXid() + 1);
return lastProposedZxid;
} | [
"private",
"Zxid",
"getNextProposedZxid",
"(",
")",
"{",
"if",
"(",
"lastProposedZxid",
".",
"getEpoch",
"(",
")",
"!=",
"establishedEpoch",
")",
"{",
"lastProposedZxid",
"=",
"new",
"Zxid",
"(",
"establishedEpoch",
",",
"-",
"1",
")",
";",
"}",
"lastPropose... | Gets next proposed zxid for leader in broadcasting phase.
@return the zxid of next proposed transaction. | [
"Gets",
"next",
"proposed",
"zxid",
"for",
"leader",
"in",
"broadcasting",
"phase",
"."
] | train | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/Leader.java#L1006-L1013 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java | CacheProviderWrapper.shouldPull | @Override
public boolean shouldPull(int share, Object id) {
"""
Return to indicate the entry can be pulled from other remote caches which caching this value.
@param share sharing policy
@id cache ID
"""
final String methodName = "shouldPull()";
boolean shouldPull = false;
if (th... | java | @Override
public boolean shouldPull(int share, Object id) {
final String methodName = "shouldPull()";
boolean shouldPull = false;
if (this.featureSupport.isReplicationSupported()) {
// TODO write code to support shouldPull function
//if (tc.isDebugEnabled()) {
... | [
"@",
"Override",
"public",
"boolean",
"shouldPull",
"(",
"int",
"share",
",",
"Object",
"id",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"shouldPull()\"",
";",
"boolean",
"shouldPull",
"=",
"false",
";",
"if",
"(",
"this",
".",
"featureSupport",
".",
... | Return to indicate the entry can be pulled from other remote caches which caching this value.
@param share sharing policy
@id cache ID | [
"Return",
"to",
"indicate",
"the",
"entry",
"can",
"be",
"pulled",
"from",
"other",
"remote",
"caches",
"which",
"caching",
"this",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java#L794-L807 |
protostuff/protostuff | protostuff-api/src/main/java/io/protostuff/IntSerializer.java | IntSerializer.writeInt64LE | public static void writeInt64LE(final long value, final byte[] buffer, int offset) {
"""
Writes the 64-bit int into the buffer starting with the least significant byte.
"""
buffer[offset++] = (byte) (value >>> 0);
buffer[offset++] = (byte) (value >>> 8);
buffer[offset++] = (byte) (va... | java | public static void writeInt64LE(final long value, final byte[] buffer, int offset)
{
buffer[offset++] = (byte) (value >>> 0);
buffer[offset++] = (byte) (value >>> 8);
buffer[offset++] = (byte) (value >>> 16);
buffer[offset++] = (byte) (value >>> 24);
buffer[offset++] = ... | [
"public",
"static",
"void",
"writeInt64LE",
"(",
"final",
"long",
"value",
",",
"final",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
")",
"{",
"buffer",
"[",
"offset",
"++",
"]",
"=",
"(",
"byte",
")",
"(",
"value",
">>>",
"0",
")",
";",
"buf... | Writes the 64-bit int into the buffer starting with the least significant byte. | [
"Writes",
"the",
"64",
"-",
"bit",
"int",
"into",
"the",
"buffer",
"starting",
"with",
"the",
"least",
"significant",
"byte",
"."
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-api/src/main/java/io/protostuff/IntSerializer.java#L104-L114 |
rundeck/rundeck | core/src/main/java/com/dtolabs/shared/resources/ResourceXMLGenerator.java | ResourceXMLGenerator.genAttributes | private void genAttributes(final Element ent, final ResourceXMLParser.Entity entity) {
"""
Generate resources section and resource references
@param ent element
@param entity entity
"""
if (null == entity.getProperties() ) {
return;
}
for (final String key:entity.getProp... | java | private void genAttributes(final Element ent, final ResourceXMLParser.Entity entity) {
if (null == entity.getProperties() ) {
return;
}
for (final String key:entity.getProperties().stringPropertyNames()){
if (!ResourceXMLConstants.allPropSet.contains(key)) {
... | [
"private",
"void",
"genAttributes",
"(",
"final",
"Element",
"ent",
",",
"final",
"ResourceXMLParser",
".",
"Entity",
"entity",
")",
"{",
"if",
"(",
"null",
"==",
"entity",
".",
"getProperties",
"(",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"final"... | Generate resources section and resource references
@param ent element
@param entity entity | [
"Generate",
"resources",
"section",
"and",
"resource",
"references"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/shared/resources/ResourceXMLGenerator.java#L200-L218 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java | PoolOperations.existsPool | public boolean existsPool(String poolId, Iterable<BatchClientBehavior> additionalBehaviors)
throws BatchErrorException, IOException {
"""
Checks whether the specified pool exists.
@param poolId
The ID of the pool.
@param additionalBehaviors
A collection of {@link BatchClientBehavior} instances th... | java | public boolean existsPool(String poolId, Iterable<BatchClientBehavior> additionalBehaviors)
throws BatchErrorException, IOException {
PoolExistsOptions options = new PoolExistsOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
bhMgr.... | [
"public",
"boolean",
"existsPool",
"(",
"String",
"poolId",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"PoolExistsOptions",
"options",
"=",
"new",
"PoolExistsOptions",
"(",
")... | Checks whether the specified pool exists.
@param poolId
The ID of the pool.
@param additionalBehaviors
A collection of {@link BatchClientBehavior} instances that are
applied to the Batch service request.
@return True if the pool exists; otherwise, false.
@throws BatchErrorException
Exception thrown when an error respo... | [
"Checks",
"whether",
"the",
"specified",
"pool",
"exists",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java#L1060-L1068 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/MethodCompiler.java | MethodCompiler.getStaticField | public void getStaticField(Class<?> cls, String name) throws IOException {
"""
Get field from class
<p>Stack: ..., => ..., value
@param cls
@param name
@throws IOException
"""
getStaticField(El.getField(cls, name));
} | java | public void getStaticField(Class<?> cls, String name) throws IOException
{
getStaticField(El.getField(cls, name));
} | [
"public",
"void",
"getStaticField",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"getStaticField",
"(",
"El",
".",
"getField",
"(",
"cls",
",",
"name",
")",
")",
";",
"}"
] | Get field from class
<p>Stack: ..., => ..., value
@param cls
@param name
@throws IOException | [
"Get",
"field",
"from",
"class",
"<p",
">",
"Stack",
":",
"...",
"=",
">",
";",
"...",
"value"
] | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/MethodCompiler.java#L943-L946 |
Erudika/para | para-server/src/main/java/com/erudika/para/rest/RestUtils.java | RestUtils.getBatchDeleteResponse | public static Response getBatchDeleteResponse(App app, List<String> ids) {
"""
Batch delete response as JSON.
@param app the current App object
@param ids list of ids to delete
@return a status code 200 or 400
"""
try (final Metrics.Context context = Metrics.time(app == null ? null : app.getAppid(),
R... | java | public static Response getBatchDeleteResponse(App app, List<String> ids) {
try (final Metrics.Context context = Metrics.time(app == null ? null : app.getAppid(),
RestUtils.class, "batch", "delete")) {
LinkedList<ParaObject> objects = new LinkedList<>();
if (app != null && ids != null && !ids.isEmpty()) {
... | [
"public",
"static",
"Response",
"getBatchDeleteResponse",
"(",
"App",
"app",
",",
"List",
"<",
"String",
">",
"ids",
")",
"{",
"try",
"(",
"final",
"Metrics",
".",
"Context",
"context",
"=",
"Metrics",
".",
"time",
"(",
"app",
"==",
"null",
"?",
"null",
... | Batch delete response as JSON.
@param app the current App object
@param ids list of ids to delete
@return a status code 200 or 400 | [
"Batch",
"delete",
"response",
"as",
"JSON",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/rest/RestUtils.java#L591-L615 |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | Sql.eachRow | public void eachRow(GString gstring, @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
"""
Performs the given SQL query calling the given Closure with each row of the result set.
The row will be a <code>GroovyResultSet</code> which is a <code>Resul... | java | public void eachRow(GString gstring, @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
eachRow(gstring, null, closure);
} | [
"public",
"void",
"eachRow",
"(",
"GString",
"gstring",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"groovy.sql.GroovyResultSet\"",
")",
"Closure",
"closure",
")",
"throws",
"SQLException",
"{",
"eachRow",
"("... | Performs the given SQL query calling the given Closure with each row of the result set.
The row will be a <code>GroovyResultSet</code> which is a <code>ResultSet</code>
that supports accessing the fields using property style notation and ordinal index values.
The query may contain GString expressions.
<p>
Example usage... | [
"Performs",
"the",
"given",
"SQL",
"query",
"calling",
"the",
"given",
"Closure",
"with",
"each",
"row",
"of",
"the",
"result",
"set",
".",
"The",
"row",
"will",
"be",
"a",
"<code",
">",
"GroovyResultSet<",
"/",
"code",
">",
"which",
"is",
"a",
"<code",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L1651-L1653 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/zeromq/ZeroMQNetworkService.java | ZeroMQNetworkService.firePeerConnected | protected void firePeerConnected(URI peerURI, SpaceID space) {
"""
Notifies that a peer space was connected.
@param peerURI
- the URI of the peer that was connected to.
@param space
- the identifier of the connected space.
"""
final NetworkServiceListener[] ilisteners;
synchronized (this.... | java | protected void firePeerConnected(URI peerURI, SpaceID space) {
final NetworkServiceListener[] ilisteners;
synchronized (this.listeners) {
ilisteners = new NetworkServiceListener[this.listeners.size()];
this.listeners.toArray(ilisteners);
}
for (final NetworkServic... | [
"protected",
"void",
"firePeerConnected",
"(",
"URI",
"peerURI",
",",
"SpaceID",
"space",
")",
"{",
"final",
"NetworkServiceListener",
"[",
"]",
"ilisteners",
";",
"synchronized",
"(",
"this",
".",
"listeners",
")",
"{",
"ilisteners",
"=",
"new",
"NetworkService... | Notifies that a peer space was connected.
@param peerURI
- the URI of the peer that was connected to.
@param space
- the identifier of the connected space. | [
"Notifies",
"that",
"a",
"peer",
"space",
"was",
"connected",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/services/zeromq/ZeroMQNetworkService.java#L185-L194 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java | ExpressRouteCircuitAuthorizationsInner.getAsync | public Observable<ExpressRouteCircuitAuthorizationInner> getAsync(String resourceGroupName, String circuitName, String authorizationName) {
"""
Gets the specified authorization from the specified express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the ... | java | public Observable<ExpressRouteCircuitAuthorizationInner> getAsync(String resourceGroupName, String circuitName, String authorizationName) {
return getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1<ServiceResponse<ExpressRouteCircuitAuthorizationInner>, ExpressRouteCirc... | [
"public",
"Observable",
"<",
"ExpressRouteCircuitAuthorizationInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"String",
"authorizationName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"... | Gets the specified authorization from the specified express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param authorizationName The name of the authorization.
@throws IllegalArgumentException thrown if parameters fail the validation... | [
"Gets",
"the",
"specified",
"authorization",
"from",
"the",
"specified",
"express",
"route",
"circuit",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java#L297-L304 |
square/okhttp | mockwebserver/src/main/java/okhttp3/mockwebserver/MockResponse.java | MockResponse.setHeader | public MockResponse setHeader(String name, Object value) {
"""
Removes all headers named {@code name}, then adds a new header with the name and value.
"""
removeHeader(name);
return addHeader(name, value);
} | java | public MockResponse setHeader(String name, Object value) {
removeHeader(name);
return addHeader(name, value);
} | [
"public",
"MockResponse",
"setHeader",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"removeHeader",
"(",
"name",
")",
";",
"return",
"addHeader",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Removes all headers named {@code name}, then adds a new header with the name and value. | [
"Removes",
"all",
"headers",
"named",
"{"
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/mockwebserver/src/main/java/okhttp3/mockwebserver/MockResponse.java#L148-L151 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java | ActiveSyncManager.stopSyncForMount | public void stopSyncForMount(long mountId) throws InvalidPathException, IOException {
"""
stop active sync on a mount id.
@param mountId mountId to stop active sync
"""
LOG.debug("Stop sync for mount id {}", mountId);
if (mFilterMap.containsKey(mountId)) {
List<Pair<AlluxioURI, MountTable.Reso... | java | public void stopSyncForMount(long mountId) throws InvalidPathException, IOException {
LOG.debug("Stop sync for mount id {}", mountId);
if (mFilterMap.containsKey(mountId)) {
List<Pair<AlluxioURI, MountTable.Resolution>> toBeDeleted = new ArrayList<>();
for (AlluxioURI uri : mFilterMap.get(mountId)) ... | [
"public",
"void",
"stopSyncForMount",
"(",
"long",
"mountId",
")",
"throws",
"InvalidPathException",
",",
"IOException",
"{",
"LOG",
".",
"debug",
"(",
"\"Stop sync for mount id {}\"",
",",
"mountId",
")",
";",
"if",
"(",
"mFilterMap",
".",
"containsKey",
"(",
"... | stop active sync on a mount id.
@param mountId mountId to stop active sync | [
"stop",
"active",
"sync",
"on",
"a",
"mount",
"id",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java#L262-L278 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.