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 |
|---|---|---|---|---|---|---|---|---|---|---|
kiegroup/drools | kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/DecisionTableFunction.java | DecisionTableFunction.toDecisionRule | private static DTDecisionRule toDecisionRule(EvaluationContext mainCtx, FEEL embeddedFEEL, int index, List<?> rule, int inputSize) {
"""
Convert row to DTDecisionRule
@param mainCtx the main context is used to identify the hosted FEELEventManager
@param embeddedFEEL a possibly cached embedded FEEL to compile the... | java | private static DTDecisionRule toDecisionRule(EvaluationContext mainCtx, FEEL embeddedFEEL, int index, List<?> rule, int inputSize) {
// TODO should be check indeed block of inputSize n inputs, followed by block of outputs.
DTDecisionRule dr = new DTDecisionRule( index );
for ( int i = 0; i < rul... | [
"private",
"static",
"DTDecisionRule",
"toDecisionRule",
"(",
"EvaluationContext",
"mainCtx",
",",
"FEEL",
"embeddedFEEL",
",",
"int",
"index",
",",
"List",
"<",
"?",
">",
"rule",
",",
"int",
"inputSize",
")",
"{",
"// TODO should be check indeed block of inputSize n ... | Convert row to DTDecisionRule
@param mainCtx the main context is used to identify the hosted FEELEventManager
@param embeddedFEEL a possibly cached embedded FEEL to compile the output expression, error will be reported up to the mainCtx
@param index
@param rule
@param inputSize
@return | [
"Convert",
"row",
"to",
"DTDecisionRule"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/DecisionTableFunction.java#L149-L167 |
99soft/guartz | src/main/java/org/nnsoft/guice/guartz/QuartzModule.java | QuartzModule.doBind | protected final <T> void doBind( Multibinder<T> binder, Class<? extends T> type ) {
"""
Utility method to respect the DRY principle.
@param <T>
@param binder
@param type
"""
checkNotNull( type );
binder.addBinding().to( type );
} | java | protected final <T> void doBind( Multibinder<T> binder, Class<? extends T> type )
{
checkNotNull( type );
binder.addBinding().to( type );
} | [
"protected",
"final",
"<",
"T",
">",
"void",
"doBind",
"(",
"Multibinder",
"<",
"T",
">",
"binder",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"type",
")",
"{",
"checkNotNull",
"(",
"type",
")",
";",
"binder",
".",
"addBinding",
"(",
")",
".",
"t... | Utility method to respect the DRY principle.
@param <T>
@param binder
@param type | [
"Utility",
"method",
"to",
"respect",
"the",
"DRY",
"principle",
"."
] | train | https://github.com/99soft/guartz/blob/3f59096d8dff52475d1677bd5fdff61d12e5fa14/src/main/java/org/nnsoft/guice/guartz/QuartzModule.java#L206-L210 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.getProjectId | public CmsUUID getProjectId(CmsRequestContext context, int id) throws CmsException {
"""
Returns the uuid id for the given id,
remove this method as soon as possible.<p>
@param context the current cms context
@param id the old project id
@return the new uuid for the given id
@throws CmsException if some... | java | public CmsUUID getProjectId(CmsRequestContext context, int id) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsUUID result = null;
try {
result = m_driverManager.getProjectId(dbc, id);
} catch (CmsException e) {
dbc.report(nu... | [
"public",
"CmsUUID",
"getProjectId",
"(",
"CmsRequestContext",
"context",
",",
"int",
"id",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"CmsUUID",
"result",
"=",
"null",
";"... | Returns the uuid id for the given id,
remove this method as soon as possible.<p>
@param context the current cms context
@param id the old project id
@return the new uuid for the given id
@throws CmsException if something goes wrong | [
"Returns",
"the",
"uuid",
"id",
"for",
"the",
"given",
"id",
"remove",
"this",
"method",
"as",
"soon",
"as",
"possible",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L2548-L2560 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/LogAnalyticsInner.java | LogAnalyticsInner.beginExportThrottledRequests | public LogAnalyticsOperationResultInner beginExportThrottledRequests(String location, ThrottledRequestsInput parameters) {
"""
Export logs that show total throttled Api requests for this subscription in the given time window.
@param location The location upon which virtual-machine-sizes is queried.
@param para... | java | public LogAnalyticsOperationResultInner beginExportThrottledRequests(String location, ThrottledRequestsInput parameters) {
return beginExportThrottledRequestsWithServiceResponseAsync(location, parameters).toBlocking().single().body();
} | [
"public",
"LogAnalyticsOperationResultInner",
"beginExportThrottledRequests",
"(",
"String",
"location",
",",
"ThrottledRequestsInput",
"parameters",
")",
"{",
"return",
"beginExportThrottledRequestsWithServiceResponseAsync",
"(",
"location",
",",
"parameters",
")",
".",
"toBlo... | Export logs that show total throttled Api requests for this subscription in the given time window.
@param location The location upon which virtual-machine-sizes is queried.
@param parameters Parameters supplied to the LogAnalytics getThrottledRequests Api.
@throws IllegalArgumentException thrown if parameters fail the... | [
"Export",
"logs",
"that",
"show",
"total",
"throttled",
"Api",
"requests",
"for",
"this",
"subscription",
"in",
"the",
"given",
"time",
"window",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/LogAnalyticsInner.java#L314-L316 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Graphics.java | Graphics.getPixel | public Color getPixel(int x, int y) {
"""
Get the colour of a single pixel in this graphics context
@param x
The x coordinate of the pixel to read
@param y
The y coordinate of the pixel to read
@return The colour of the pixel at the specified location
"""
predraw();
GL.glReadPixels(x, screenHeight... | java | public Color getPixel(int x, int y) {
predraw();
GL.glReadPixels(x, screenHeight - y, 1, 1, SGL.GL_RGBA,
SGL.GL_UNSIGNED_BYTE, readBuffer);
postdraw();
return new Color(translate(readBuffer.get(0)), translate(readBuffer
.get(1)), translate(readBuffer.get(2)), translate(readBuffer
.get(3)));... | [
"public",
"Color",
"getPixel",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"predraw",
"(",
")",
";",
"GL",
".",
"glReadPixels",
"(",
"x",
",",
"screenHeight",
"-",
"y",
",",
"1",
",",
"1",
",",
"SGL",
".",
"GL_RGBA",
",",
"SGL",
".",
"GL_UNSIGNED... | Get the colour of a single pixel in this graphics context
@param x
The x coordinate of the pixel to read
@param y
The y coordinate of the pixel to read
@return The colour of the pixel at the specified location | [
"Get",
"the",
"colour",
"of",
"a",
"single",
"pixel",
"in",
"this",
"graphics",
"context"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Graphics.java#L1544-L1553 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java | SARLOperationHelper.hasSideEffects | protected Boolean hasSideEffects(InferredPrototype calledOperation, XExpression expr, ISideEffectContext context) {
"""
Determine if the given expression has a side effect.
@param calledOperation the called operation, not yet in the call stack.
@param expr the expression.
@param context the context.
@return ... | java | protected Boolean hasSideEffects(InferredPrototype calledOperation, XExpression expr, ISideEffectContext context) {
final SideEffectContext ctx = new SideEffectContext(calledOperation, context);
return internalHasSideEffects(expr, ctx);
} | [
"protected",
"Boolean",
"hasSideEffects",
"(",
"InferredPrototype",
"calledOperation",
",",
"XExpression",
"expr",
",",
"ISideEffectContext",
"context",
")",
"{",
"final",
"SideEffectContext",
"ctx",
"=",
"new",
"SideEffectContext",
"(",
"calledOperation",
",",
"context... | Determine if the given expression has a side effect.
@param calledOperation the called operation, not yet in the call stack.
@param expr the expression.
@param context the context.
@return {@code true} if the expression has a side effect. | [
"Determine",
"if",
"the",
"given",
"expression",
"has",
"a",
"side",
"effect",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java#L240-L243 |
Jacksgong/JKeyboardPanelSwitch | library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java | KeyboardUtil.detach | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public static void detach(Activity activity, ViewTreeObserver.OnGlobalLayoutListener l) {
"""
Remove the OnGlobalLayoutListener from the activity root view
@param activity same activity used in {@link #attach} method
@param l ViewTreeObserver.OnGlobalLayout... | java | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public static void detach(Activity activity, ViewTreeObserver.OnGlobalLayoutListener l) {
ViewGroup contentView = activity.findViewById(android.R.id.content);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
contentView.getViewTree... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"JELLY_BEAN",
")",
"public",
"static",
"void",
"detach",
"(",
"Activity",
"activity",
",",
"ViewTreeObserver",
".",
"OnGlobalLayoutListener",
"l",
")",
"{",
"ViewGroup",
"contentView",
"=",
"activity",
"... | Remove the OnGlobalLayoutListener from the activity root view
@param activity same activity used in {@link #attach} method
@param l ViewTreeObserver.OnGlobalLayoutListener returned by {@link #attach} method | [
"Remove",
"the",
"OnGlobalLayoutListener",
"from",
"the",
"activity",
"root",
"view"
] | train | https://github.com/Jacksgong/JKeyboardPanelSwitch/blob/092128023e824c85da63540780c79088b37a0c74/library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java#L210-L219 |
infinispan/infinispan | core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java | ParseUtils.invalidAttributeValue | public static XMLStreamException invalidAttributeValue(final XMLStreamReader reader, final int index) {
"""
Get an exception reporting an invalid XML attribute value.
@param reader the stream reader
@param index the attribute index
@return the exception
"""
return new XMLStreamException("Invalid val... | java | public static XMLStreamException invalidAttributeValue(final XMLStreamReader reader, final int index) {
return new XMLStreamException("Invalid value '" + reader.getAttributeValue(index) + "' for attribute '"
+ reader.getAttributeName(index) + "'", reader.getLocation());
} | [
"public",
"static",
"XMLStreamException",
"invalidAttributeValue",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"int",
"index",
")",
"{",
"return",
"new",
"XMLStreamException",
"(",
"\"Invalid value '\"",
"+",
"reader",
".",
"getAttributeValue",
"(",
"inde... | Get an exception reporting an invalid XML attribute value.
@param reader the stream reader
@param index the attribute index
@return the exception | [
"Get",
"an",
"exception",
"reporting",
"an",
"invalid",
"XML",
"attribute",
"value",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java#L77-L80 |
beangle/beangle3 | struts/s2/src/main/java/org/beangle/struts2/convention/BeangleObjectFactory.java | BeangleObjectFactory.buildBean | @Override
public Object buildBean(String beanName, Map<String, Object> extraContext, boolean injectInternal)
throws Exception {
"""
Looks up beans using application context before falling back to the method defined
in the {@link ObjectFactory}.
@param beanName The name of the bean to look up in the app... | java | @Override
public Object buildBean(String beanName, Map<String, Object> extraContext, boolean injectInternal)
throws Exception {
Object bean = null;
if (context.contains(beanName)) bean = context.getBean(beanName).get();
else bean = buildBean(getClassInstance(beanName), extraContext);
return bean... | [
"@",
"Override",
"public",
"Object",
"buildBean",
"(",
"String",
"beanName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"extraContext",
",",
"boolean",
"injectInternal",
")",
"throws",
"Exception",
"{",
"Object",
"bean",
"=",
"null",
";",
"if",
"(",
"c... | Looks up beans using application context before falling back to the method defined
in the {@link ObjectFactory}.
@param beanName The name of the bean to look up in the application context
@param extraContext
@return A bean from context or the result of calling the overridden
method.
@throws Exception | [
"Looks",
"up",
"beans",
"using",
"application",
"context",
"before",
"falling",
"back",
"to",
"the",
"method",
"defined",
"in",
"the",
"{",
"@link",
"ObjectFactory",
"}",
"."
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/struts/s2/src/main/java/org/beangle/struts2/convention/BeangleObjectFactory.java#L74-L81 |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java | Utils.simpleNameEquals | public static boolean simpleNameEquals(String s1, String s2) {
"""
Replies if the given unqualified/simple names are equal.
@param s1 the first string.
@param s2 the first string.
@return {@code true} if the strings are equal.
"""
if (isNullOrEmpty(s1)) {
return isNullOrEmpty(s2);
}
return s1.equ... | java | public static boolean simpleNameEquals(String s1, String s2) {
if (isNullOrEmpty(s1)) {
return isNullOrEmpty(s2);
}
return s1.equals(s2);
} | [
"public",
"static",
"boolean",
"simpleNameEquals",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"if",
"(",
"isNullOrEmpty",
"(",
"s1",
")",
")",
"{",
"return",
"isNullOrEmpty",
"(",
"s2",
")",
";",
"}",
"return",
"s1",
".",
"equals",
"(",
"s2",
... | Replies if the given unqualified/simple names are equal.
@param s1 the first string.
@param s2 the first string.
@return {@code true} if the strings are equal. | [
"Replies",
"if",
"the",
"given",
"unqualified",
"/",
"simple",
"names",
"are",
"equal",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Utils.java#L362-L367 |
gallandarakhneorg/afc | advanced/gis/gisroadinputoutput/src/main/java/org/arakhne/afc/gis/road/io/XMLRoadUtil.java | XMLRoadUtil.writeRoadSegment | public static Element writeRoadSegment(RoadSegment primitive, XMLBuilder builder, XMLResources resources) throws IOException {
"""
Write the XML description for the given road.
@param primitive is the road to output.
@param builder is the tool to create XML nodes.
@param resources is the tool that permits to ... | java | public static Element writeRoadSegment(RoadSegment primitive, XMLBuilder builder, XMLResources resources) throws IOException {
if (primitive instanceof RoadPolyline) {
return writeRoadPolyline((RoadPolyline) primitive, builder, resources);
}
throw new IOException("unsupported type of primitive: " + primitive);... | [
"public",
"static",
"Element",
"writeRoadSegment",
"(",
"RoadSegment",
"primitive",
",",
"XMLBuilder",
"builder",
",",
"XMLResources",
"resources",
")",
"throws",
"IOException",
"{",
"if",
"(",
"primitive",
"instanceof",
"RoadPolyline",
")",
"{",
"return",
"writeRoa... | Write the XML description for the given road.
@param primitive is the road to output.
@param builder is the tool to create XML nodes.
@param resources is the tool that permits to gather the resources.
@return the XML node of the map element.
@throws IOException in case of error. | [
"Write",
"the",
"XML",
"description",
"for",
"the",
"given",
"road",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroadinputoutput/src/main/java/org/arakhne/afc/gis/road/io/XMLRoadUtil.java#L114-L119 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/concurrent/ConcurrentWeakHashMap.java | ConcurrentWeakHashMap.putIfAbsent | public V putIfAbsent( K key, V value ) {
"""
{@inheritDoc}
@return the previous value associated with the specified key,
or <tt>null</tt> if there was no mapping for the key
@throws NullPointerException if the specified key or value is null
"""
if( value == null )
{
throw new NullPointerEx... | java | public V putIfAbsent( K key, V value )
{
if( value == null )
{
throw new NullPointerException();
}
int hash = hash( key.hashCode() );
return segmentFor( hash ).put( key, hash, value, true );
} | [
"public",
"V",
"putIfAbsent",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"int",
"hash",
"=",
"hash",
"(",
"key",
".",
"hashCode",
"(",
")",
... | {@inheritDoc}
@return the previous value associated with the specified key,
or <tt>null</tt> if there was no mapping for the key
@throws NullPointerException if the specified key or value is null | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/concurrent/ConcurrentWeakHashMap.java#L1153-L1161 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/Equation.java | Equation.alias | public void alias(DMatrixRMaj variable , String name ) {
"""
Adds a new Matrix variable. If one already has the same name it is written over.
While more verbose for multiple variables, this function doesn't require new memory be declared
each time it's called.
@param variable Matrix which is to be assigned... | java | public void alias(DMatrixRMaj variable , String name ) {
if( isReserved(name))
throw new RuntimeException("Reserved word or contains a reserved character");
VariableMatrix old = (VariableMatrix)variables.get(name);
if( old == null ) {
variables.put(name, new VariableMatri... | [
"public",
"void",
"alias",
"(",
"DMatrixRMaj",
"variable",
",",
"String",
"name",
")",
"{",
"if",
"(",
"isReserved",
"(",
"name",
")",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"Reserved word or contains a reserved character\"",
")",
";",
"VariableMatrix",
"... | Adds a new Matrix variable. If one already has the same name it is written over.
While more verbose for multiple variables, this function doesn't require new memory be declared
each time it's called.
@param variable Matrix which is to be assigned to name
@param name The name of the variable | [
"Adds",
"a",
"new",
"Matrix",
"variable",
".",
"If",
"one",
"already",
"has",
"the",
"same",
"name",
"it",
"is",
"written",
"over",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/Equation.java#L288-L297 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/XMLResourceBundle.java | XMLResourceBundle.get | public String get(final String aMessage, final String... aArray) {
"""
Return a message value with the supplied values integrated into it.
@param aMessage A message in which to include the supplied string values
@param aArray The string values to insert into the supplied message
@return A message with the sup... | java | public String get(final String aMessage, final String... aArray) {
return StringUtils.format(super.getString(aMessage), aArray);
} | [
"public",
"String",
"get",
"(",
"final",
"String",
"aMessage",
",",
"final",
"String",
"...",
"aArray",
")",
"{",
"return",
"StringUtils",
".",
"format",
"(",
"super",
".",
"getString",
"(",
"aMessage",
")",
",",
"aArray",
")",
";",
"}"
] | Return a message value with the supplied values integrated into it.
@param aMessage A message in which to include the supplied string values
@param aArray The string values to insert into the supplied message
@return A message with the supplied values integrated into it | [
"Return",
"a",
"message",
"value",
"with",
"the",
"supplied",
"values",
"integrated",
"into",
"it",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/XMLResourceBundle.java#L91-L93 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cdn_dedicated_serviceName_quota_duration_POST | public OvhOrder cdn_dedicated_serviceName_quota_duration_POST(String serviceName, String duration, OvhOrderQuotaEnum quota) throws IOException {
"""
Create order
REST: POST /order/cdn/dedicated/{serviceName}/quota/{duration}
@param quota [required] quota number in TB that will be added to the CDN service
@par... | java | public OvhOrder cdn_dedicated_serviceName_quota_duration_POST(String serviceName, String duration, OvhOrderQuotaEnum quota) throws IOException {
String qPath = "/order/cdn/dedicated/{serviceName}/quota/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
HashMap<String, Object>o = new HashMap<Strin... | [
"public",
"OvhOrder",
"cdn_dedicated_serviceName_quota_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhOrderQuotaEnum",
"quota",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cdn/dedicated/{serviceName}/quota/{duration}\"... | Create order
REST: POST /order/cdn/dedicated/{serviceName}/quota/{duration}
@param quota [required] quota number in TB that will be added to the CDN service
@param serviceName [required] The internal name of your CDN offer
@param duration [required] Duration | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5369-L5376 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/ssl_cert.java | ssl_cert.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ssl_cert_responses result = (ssl_cert_responses) service.get_payload_fo... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ssl_cert_responses result = (ssl_cert_responses) service.get_payload_formatter().string_to_resource(ssl_cert_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ssl_cert_responses",
"result",
"=",
"(",
"ssl_cert_responses",
")",
"service",
".",
"get_payload_formatter",
... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/ssl_cert.java#L265-L282 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/core/Las.java | Las.getWriter | public static ALasWriter getWriter( File lasFile, CoordinateReferenceSystem crs ) throws Exception {
"""
Get a las writer.
<p>If available, a native writer is created.
@param lasFile the file to write.
@param crs the {@link CoordinateReferenceSystem} to be written in the prj.
@return the las writer.
@thro... | java | public static ALasWriter getWriter( File lasFile, CoordinateReferenceSystem crs ) throws Exception {
if (supportsNative()) {
return new LiblasWriter(lasFile, crs);
} else {
return new LasWriterBuffered(lasFile, crs);
}
} | [
"public",
"static",
"ALasWriter",
"getWriter",
"(",
"File",
"lasFile",
",",
"CoordinateReferenceSystem",
"crs",
")",
"throws",
"Exception",
"{",
"if",
"(",
"supportsNative",
"(",
")",
")",
"{",
"return",
"new",
"LiblasWriter",
"(",
"lasFile",
",",
"crs",
")",
... | Get a las writer.
<p>If available, a native writer is created.
@param lasFile the file to write.
@param crs the {@link CoordinateReferenceSystem} to be written in the prj.
@return the las writer.
@throws Exception if something goes wrong. | [
"Get",
"a",
"las",
"writer",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/core/Las.java#L102-L108 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java | LdapUtils.getString | public static String getString(final LdapEntry entry, final String attribute) {
"""
Reads a String value from the LdapEntry.
@param entry the ldap entry
@param attribute the attribute name
@return the string
"""
return getString(entry, attribute, null);
} | java | public static String getString(final LdapEntry entry, final String attribute) {
return getString(entry, attribute, null);
} | [
"public",
"static",
"String",
"getString",
"(",
"final",
"LdapEntry",
"entry",
",",
"final",
"String",
"attribute",
")",
"{",
"return",
"getString",
"(",
"entry",
",",
"attribute",
",",
"null",
")",
";",
"}"
] | Reads a String value from the LdapEntry.
@param entry the ldap entry
@param attribute the attribute name
@return the string | [
"Reads",
"a",
"String",
"value",
"from",
"the",
"LdapEntry",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L190-L192 |
phoenixnap/springmvc-raml-plugin | src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/interpreters/PojoBuilder.java | PojoBuilder.withName | public PojoBuilder withName(String pojoPackage, String className) {
"""
Sets this Pojo's name
@param pojoPackage
The Package used to create POJO
@param className
Class to be created
@return This instance
"""
if (!NamingHelper.isValidJavaClassName(className)) {
className = NamingHelper.cleanNameForJ... | java | public PojoBuilder withName(String pojoPackage, String className) {
if (!NamingHelper.isValidJavaClassName(className)) {
className = NamingHelper.cleanNameForJava(className);
}
final String fullyQualifiedClassName = pojoPackage + "." + className;
// Initiate package if necessary
if (this.pojoPackage == nu... | [
"public",
"PojoBuilder",
"withName",
"(",
"String",
"pojoPackage",
",",
"String",
"className",
")",
"{",
"if",
"(",
"!",
"NamingHelper",
".",
"isValidJavaClassName",
"(",
"className",
")",
")",
"{",
"className",
"=",
"NamingHelper",
".",
"cleanNameForJava",
"(",... | Sets this Pojo's name
@param pojoPackage
The Package used to create POJO
@param className
Class to be created
@return This instance | [
"Sets",
"this",
"Pojo",
"s",
"name"
] | train | https://github.com/phoenixnap/springmvc-raml-plugin/blob/6387072317cd771eb7d6f30943f556ac20dd3c84/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/interpreters/PojoBuilder.java#L111-L148 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/datastructures/Linear.java | Linear.computeNearestNeighborsInternal | protected BoundedPriorityQueue<Result> computeNearestNeighborsInternal(int k, int iid) throws Exception {
"""
Computes the k-nearest neighbors of the vector with the given internal id. The search is exhaustive but
includes some optimizations that make it faster, especially for high dimensional vectors.
@param ... | java | protected BoundedPriorityQueue<Result> computeNearestNeighborsInternal(int k, int iid) throws Exception {
double[] queryVector = getVector(iid); // get the vector with this internal id
return computeNearestNeighborsInternal(k, queryVector);
} | [
"protected",
"BoundedPriorityQueue",
"<",
"Result",
">",
"computeNearestNeighborsInternal",
"(",
"int",
"k",
",",
"int",
"iid",
")",
"throws",
"Exception",
"{",
"double",
"[",
"]",
"queryVector",
"=",
"getVector",
"(",
"iid",
")",
";",
"// get the vector with this... | Computes the k-nearest neighbors of the vector with the given internal id. The search is exhaustive but
includes some optimizations that make it faster, especially for high dimensional vectors.
@param k
The number of nearest neighbors to be returned
@param queryVector
The internal id of the query vector
@return A bou... | [
"Computes",
"the",
"k",
"-",
"nearest",
"neighbors",
"of",
"the",
"vector",
"with",
"the",
"given",
"internal",
"id",
".",
"The",
"search",
"is",
"exhaustive",
"but",
"includes",
"some",
"optimizations",
"that",
"make",
"it",
"faster",
"especially",
"for",
"... | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/Linear.java#L181-L184 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/ReportResourcesImpl.java | ReportResourcesImpl.updatePublishStatus | public ReportPublish updatePublishStatus(long id, ReportPublish reportPublish) throws SmartsheetException {
"""
Sets the publish status of a report and returns the new status, including the URLs of any
enabled publishing.
It mirrors to the following Smartsheet REST API method: PUT /reports/{id}/publish
Exce... | java | public ReportPublish updatePublishStatus(long id, ReportPublish reportPublish) throws SmartsheetException{
return this.updateResource("reports/" + id + "/publish", ReportPublish.class, reportPublish);
} | [
"public",
"ReportPublish",
"updatePublishStatus",
"(",
"long",
"id",
",",
"ReportPublish",
"reportPublish",
")",
"throws",
"SmartsheetException",
"{",
"return",
"this",
".",
"updateResource",
"(",
"\"reports/\"",
"+",
"id",
"+",
"\"/publish\"",
",",
"ReportPublish",
... | Sets the publish status of a report and returns the new status, including the URLs of any
enabled publishing.
It mirrors to the following Smartsheet REST API method: PUT /reports/{id}/publish
Exceptions:
- InvalidRequestException : if there is any problem with the REST API request
- AuthorizationException : if there ... | [
"Sets",
"the",
"publish",
"status",
"of",
"a",
"report",
"and",
"returns",
"the",
"new",
"status",
"including",
"the",
"URLs",
"of",
"any",
"enabled",
"publishing",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/ReportResourcesImpl.java#L300-L302 |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/FilesystemPath.java | FilesystemPath.schemeWalk | @Override
public PathImpl schemeWalk(String userPath,
Map<String,Object> attributes,
String filePath,
int offset) {
"""
schemeWalk is called by Path for a scheme lookup like file:/tmp/foo
@param userPath the user's lookup() path
@para... | java | @Override
public PathImpl schemeWalk(String userPath,
Map<String,Object> attributes,
String filePath,
int offset)
{
String canonicalPath;
if (offset < filePath.length()
&& (filePath.charAt(offset) == '/'
|| fileP... | [
"@",
"Override",
"public",
"PathImpl",
"schemeWalk",
"(",
"String",
"userPath",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
",",
"String",
"filePath",
",",
"int",
"offset",
")",
"{",
"String",
"canonicalPath",
";",
"if",
"(",
"offset",
"<"... | schemeWalk is called by Path for a scheme lookup like file:/tmp/foo
@param userPath the user's lookup() path
@param attributes the user's attributes
@param filePath the actual lookup() path
@param offset offset into filePath | [
"schemeWalk",
"is",
"called",
"by",
"Path",
"for",
"a",
"scheme",
"lookup",
"like",
"file",
":",
"/",
"tmp",
"/",
"foo"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/FilesystemPath.java#L111-L128 |
sdl/environment-api | src/main/java/com/fredhopper/lifecycle/AbstractLifeCycle.java | AbstractLifeCycle.changeState | protected void changeState(State from, State to) throws Exception {
"""
First changes the state from a current value to a target
value. Second, publishes the change of state to all the
listeners through {@link #getStateListeners()}.
@param from the current state
@param to the new state
@throws Exception if ... | java | protected void changeState(State from, State to) throws Exception {
if (!this.state.compareAndSet(from, to)) {
throw new Exception("Cannot change state from " + from + " to " + to + " for " + this);
}
publishState(from, to);
} | [
"protected",
"void",
"changeState",
"(",
"State",
"from",
",",
"State",
"to",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"this",
".",
"state",
".",
"compareAndSet",
"(",
"from",
",",
"to",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Canno... | First changes the state from a current value to a target
value. Second, publishes the change of state to all the
listeners through {@link #getStateListeners()}.
@param from the current state
@param to the new state
@throws Exception if the state cannot be changed or some
{@link StateListener}failed to apply the same
c... | [
"First",
"changes",
"the",
"state",
"from",
"a",
"current",
"value",
"to",
"a",
"target",
"value",
".",
"Second",
"publishes",
"the",
"change",
"of",
"state",
"to",
"all",
"the",
"listeners",
"through",
"{",
"@link",
"#getStateListeners",
"()",
"}",
"."
] | train | https://github.com/sdl/environment-api/blob/7ec346022675a21fec301f88ab2856acd1201f7d/src/main/java/com/fredhopper/lifecycle/AbstractLifeCycle.java#L92-L97 |
steveash/jopenfst | src/main/java/com/github/steveash/jopenfst/operations/Compose.java | Compose.precomputeInner | public static PrecomputedComposeFst precomputeInner(Fst fst2, Semiring semiring) {
"""
Pre-processes a FST that is going to be used on the right hand side of a compose operator many times
@param fst2 the fst that will appear on the right hand side
@param semiring the semiring that will be used for the compose op... | java | public static PrecomputedComposeFst precomputeInner(Fst fst2, Semiring semiring) {
fst2.throwIfInvalid();
MutableFst mutableFst = MutableFst.copyFrom(fst2);
WriteableSymbolTable table = mutableFst.getInputSymbols();
int e1index = getOrAddEps(table, true);
int e2index = getOrAddEps(table, false);
... | [
"public",
"static",
"PrecomputedComposeFst",
"precomputeInner",
"(",
"Fst",
"fst2",
",",
"Semiring",
"semiring",
")",
"{",
"fst2",
".",
"throwIfInvalid",
"(",
")",
";",
"MutableFst",
"mutableFst",
"=",
"MutableFst",
".",
"copyFrom",
"(",
"fst2",
")",
";",
"Wri... | Pre-processes a FST that is going to be used on the right hand side of a compose operator many times
@param fst2 the fst that will appear on the right hand side
@param semiring the semiring that will be used for the compose operation
@return a pre-processed form of the inner fst that can be passed to `composeWithPrecom... | [
"Pre",
"-",
"processes",
"a",
"FST",
"that",
"is",
"going",
"to",
"be",
"used",
"on",
"the",
"right",
"hand",
"side",
"of",
"a",
"compose",
"operator",
"many",
"times"
] | train | https://github.com/steveash/jopenfst/blob/4c675203015c1cfad2072556cb532b6edc73261d/src/main/java/com/github/steveash/jopenfst/operations/Compose.java#L62-L77 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/PageTree.java | PageTree.copy | public PageTree copy(TableKelp table, int newPid) {
"""
/*
@InService(TableServiceImpl.class)
static PageTree read(TableKelp table,
TableServiceImpl pageActor,
ReadStream is,
int length,
int pid,
int nextPid,
long sequence)
throws IOException
{
byte []minKey = new byte[table.getKeyLength()];
byte []max... | java | public PageTree copy(TableKelp table, int newPid)
{
PageTree newTree = new PageTree(newPid, getNextId(), getSequence(),
getMinKey(), getMaxKey());
for (BlockTree block : _blocks) {
block.copyTo(table, newTree);
}
return newTree;
} | [
"public",
"PageTree",
"copy",
"(",
"TableKelp",
"table",
",",
"int",
"newPid",
")",
"{",
"PageTree",
"newTree",
"=",
"new",
"PageTree",
"(",
"newPid",
",",
"getNextId",
"(",
")",
",",
"getSequence",
"(",
")",
",",
"getMinKey",
"(",
")",
",",
"getMaxKey",... | /*
@InService(TableServiceImpl.class)
static PageTree read(TableKelp table,
TableServiceImpl pageActor,
ReadStream is,
int length,
int pid,
int nextPid,
long sequence)
throws IOException
{
byte []minKey = new byte[table.getKeyLength()];
byte []maxKey = new byte[table.getKeyLength()];
is.readAll(minKey, 0, minKey.lengt... | [
"/",
"*",
"@InService",
"(",
"TableServiceImpl",
".",
"class",
")",
"static",
"PageTree",
"read",
"(",
"TableKelp",
"table",
"TableServiceImpl",
"pageActor",
"ReadStream",
"is",
"int",
"length",
"int",
"pid",
"int",
"nextPid",
"long",
"sequence",
")",
"throws",
... | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/PageTree.java#L522-L532 |
paypal/SeLion | dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/XmlDataProviderImpl.java | XmlDataProviderImpl.loadDataFromXmlFile | private List<?> loadDataFromXmlFile() {
"""
Generates a list of the declared type after parsing the XML file.
@return A {@link List} of object of declared type {@link XmlFileSystemResource#getCls()}.
"""
logger.entering();
Preconditions.checkArgument(resource.getCls() != null, "Please provid... | java | private List<?> loadDataFromXmlFile() {
logger.entering();
Preconditions.checkArgument(resource.getCls() != null, "Please provide a valid type.");
List<?> returned;
try {
JAXBContext context = JAXBContext.newInstance(Wrapper.class, resource.getCls());
Unmarshalle... | [
"private",
"List",
"<",
"?",
">",
"loadDataFromXmlFile",
"(",
")",
"{",
"logger",
".",
"entering",
"(",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"resource",
".",
"getCls",
"(",
")",
"!=",
"null",
",",
"\"Please provide a valid type.\"",
")",
";"... | Generates a list of the declared type after parsing the XML file.
@return A {@link List} of object of declared type {@link XmlFileSystemResource#getCls()}. | [
"Generates",
"a",
"list",
"of",
"the",
"declared",
"type",
"after",
"parsing",
"the",
"XML",
"file",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/XmlDataProviderImpl.java#L343-L361 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/HexUtil.java | HexUtil.appendHex | public static void appendHex(StringBuilder builder, byte b, boolean toLowerCase) {
"""
将byte值转为16进制并添加到{@link StringBuilder}中
@param builder {@link StringBuilder}
@param b byte
@param toLowerCase 是否使用小写
@since 4.4.1
"""
final char[] toDigits = toLowerCase ? DIGITS_LOWER : DIGITS_UPPER;
int high =... | java | public static void appendHex(StringBuilder builder, byte b, boolean toLowerCase) {
final char[] toDigits = toLowerCase ? DIGITS_LOWER : DIGITS_UPPER;
int high = (b & 0xf0) >>> 4;//高位
int low = b & 0x0f;//低位
builder.append(toDigits[high]);
builder.append(toDigits[low]);
} | [
"public",
"static",
"void",
"appendHex",
"(",
"StringBuilder",
"builder",
",",
"byte",
"b",
",",
"boolean",
"toLowerCase",
")",
"{",
"final",
"char",
"[",
"]",
"toDigits",
"=",
"toLowerCase",
"?",
"DIGITS_LOWER",
":",
"DIGITS_UPPER",
";",
"int",
"high",
"=",... | 将byte值转为16进制并添加到{@link StringBuilder}中
@param builder {@link StringBuilder}
@param b byte
@param toLowerCase 是否使用小写
@since 4.4.1 | [
"将byte值转为16进制并添加到",
"{"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/HexUtil.java#L330-L337 |
unbescape/unbescape | src/main/java/org/unbescape/html/HtmlEscape.java | HtmlEscape.escapeHtml5 | public static void escapeHtml5(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
"""
<p>
Perform an HTML5 level 2 (result is ASCII) <strong>escape</strong> operation on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 2</em> means this m... | java | public static void escapeHtml5(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapeHtml(text, offset, len, writer, HtmlEscapeType.HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_2_ALL_NON_ASCII_PL... | [
"public",
"static",
"void",
"escapeHtml5",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeHtml",
"(",
"text",
",",
"offset",
"... | <p>
Perform an HTML5 level 2 (result is ASCII) <strong>escape</strong> operation on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The five markup-significant characters: <tt><</tt>, <tt>></tt>, <tt>&</tt>,
<tt>"</tt> and <tt>'</tt></li>
<li>All non AS... | [
"<p",
">",
"Perform",
"an",
"HTML5",
"level",
"2",
"(",
"result",
"is",
"ASCII",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L868-L872 |
radkovo/Pdf2Dom | src/main/java/org/fit/cssbox/pdf/CSSBoxTree.java | CSSBoxTree.createBlock | protected BlockBox createBlock(BlockBox parent, Element n, boolean replaced) {
"""
Creates a new block box from the given element with the given parent. No style is assigned to the resulting box.
@param parent The parent box in the tree of boxes.
@param n The element that this box belongs to.
@param replaced Wh... | java | protected BlockBox createBlock(BlockBox parent, Element n, boolean replaced)
{
BlockBox root;
if (replaced)
{
BlockReplacedBox rbox = new BlockReplacedBox((Element) n, (Graphics2D) parent.getGraphics().create(), parent.getVisualContext().create());
rbox.setViewport(vi... | [
"protected",
"BlockBox",
"createBlock",
"(",
"BlockBox",
"parent",
",",
"Element",
"n",
",",
"boolean",
"replaced",
")",
"{",
"BlockBox",
"root",
";",
"if",
"(",
"replaced",
")",
"{",
"BlockReplacedBox",
"rbox",
"=",
"new",
"BlockReplacedBox",
"(",
"(",
"Ele... | Creates a new block box from the given element with the given parent. No style is assigned to the resulting box.
@param parent The parent box in the tree of boxes.
@param n The element that this box belongs to.
@param replaced When set to <code>true</code>, a replaced block box will be created. Otherwise, a normal non-... | [
"Creates",
"a",
"new",
"block",
"box",
"from",
"the",
"given",
"element",
"with",
"the",
"given",
"parent",
".",
"No",
"style",
"is",
"assigned",
"to",
"the",
"resulting",
"box",
"."
] | train | https://github.com/radkovo/Pdf2Dom/blob/12e52b80eca7f57fc41e6ed895bf1db72c38da53/src/main/java/org/fit/cssbox/pdf/CSSBoxTree.java#L286-L307 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/actions/ReceiveMessageAction.java | ReceiveMessageAction.createControlMessage | protected Message createControlMessage(TestContext context, String messageType) {
"""
Create control message that is expected.
@param context
@param messageType
@return
"""
if (dataDictionary != null) {
messageBuilder.setDataDictionary(dataDictionary);
}
return messageBu... | java | protected Message createControlMessage(TestContext context, String messageType) {
if (dataDictionary != null) {
messageBuilder.setDataDictionary(dataDictionary);
}
return messageBuilder.buildMessageContent(context, messageType, MessageDirection.INBOUND);
} | [
"protected",
"Message",
"createControlMessage",
"(",
"TestContext",
"context",
",",
"String",
"messageType",
")",
"{",
"if",
"(",
"dataDictionary",
"!=",
"null",
")",
"{",
"messageBuilder",
".",
"setDataDictionary",
"(",
"dataDictionary",
")",
";",
"}",
"return",
... | Create control message that is expected.
@param context
@param messageType
@return | [
"Create",
"control",
"message",
"that",
"is",
"expected",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/actions/ReceiveMessageAction.java#L243-L249 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_databaseCreationCapabilities_GET | public ArrayList<OvhCreationDatabaseCapabilities> serviceName_databaseCreationCapabilities_GET(String serviceName) throws IOException {
"""
List available database you can install
REST: GET /hosting/web/{serviceName}/databaseCreationCapabilities
@param serviceName [required] The internal name of your hosting
... | java | public ArrayList<OvhCreationDatabaseCapabilities> serviceName_databaseCreationCapabilities_GET(String serviceName) throws IOException {
String qPath = "/hosting/web/{serviceName}/databaseCreationCapabilities";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
re... | [
"public",
"ArrayList",
"<",
"OvhCreationDatabaseCapabilities",
">",
"serviceName_databaseCreationCapabilities_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/databaseCreationCapabilities\"",
";",
"String... | List available database you can install
REST: GET /hosting/web/{serviceName}/databaseCreationCapabilities
@param serviceName [required] The internal name of your hosting | [
"List",
"available",
"database",
"you",
"can",
"install"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L2048-L2053 |
Comcast/jrugged | jrugged-core/src/main/java/org/fishwife/jrugged/CircuitBreakerFactory.java | CircuitBreakerFactory.getIntegerPropertyOverrideValue | private Integer getIntegerPropertyOverrideValue(String name, String key) {
"""
Get an integer property override value.
@param name the {@link CircuitBreaker} name.
@param key the property override key.
@return the property override value, or null if it is not found.
"""
if (properties != null) {
... | java | private Integer getIntegerPropertyOverrideValue(String name, String key) {
if (properties != null) {
String propertyName = getPropertyName(name, key);
String propertyOverrideValue = properties.getProperty(propertyName);
if (propertyOverrideValue != null) {
t... | [
"private",
"Integer",
"getIntegerPropertyOverrideValue",
"(",
"String",
"name",
",",
"String",
"key",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"String",
"propertyName",
"=",
"getPropertyName",
"(",
"name",
",",
"key",
")",
";",
"String",
"p... | Get an integer property override value.
@param name the {@link CircuitBreaker} name.
@param key the property override key.
@return the property override value, or null if it is not found. | [
"Get",
"an",
"integer",
"property",
"override",
"value",
"."
] | train | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/CircuitBreakerFactory.java#L174-L191 |
grails/grails-core | grails-spring/src/main/groovy/org/grails/spring/GrailsApplicationContext.java | GrailsApplicationContext.registerSingleton | public void registerSingleton(String name, Class<?> clazz, MutablePropertyValues pvs) throws BeansException {
"""
Register a singleton bean with the underlying bean factory.
<p>For more advanced needs, register with the underlying BeanFactory directly.
@see #getDefaultListableBeanFactory
"""
GenericB... | java | public void registerSingleton(String name, Class<?> clazz, MutablePropertyValues pvs) throws BeansException {
GenericBeanDefinition bd = new GenericBeanDefinition();
bd.setBeanClass(clazz);
bd.setPropertyValues(pvs);
getDefaultListableBeanFactory().registerBeanDefinition(name, bd);
} | [
"public",
"void",
"registerSingleton",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"MutablePropertyValues",
"pvs",
")",
"throws",
"BeansException",
"{",
"GenericBeanDefinition",
"bd",
"=",
"new",
"GenericBeanDefinition",
"(",
")",
";",
"bd"... | Register a singleton bean with the underlying bean factory.
<p>For more advanced needs, register with the underlying BeanFactory directly.
@see #getDefaultListableBeanFactory | [
"Register",
"a",
"singleton",
"bean",
"with",
"the",
"underlying",
"bean",
"factory",
".",
"<p",
">",
"For",
"more",
"advanced",
"needs",
"register",
"with",
"the",
"underlying",
"BeanFactory",
"directly",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-spring/src/main/groovy/org/grails/spring/GrailsApplicationContext.java#L143-L148 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQuery.java | KunderaQuery.filterJPAParameterInfo | private void filterJPAParameterInfo(Type type, String name, String fieldName) {
"""
Filter jpa parameter info.
@param type
the type
@param name
the name
@param fieldName
the field name
"""
String attributeName = getAttributeName(fieldName);
Attribute entityAttribute =
((Meta... | java | private void filterJPAParameterInfo(Type type, String name, String fieldName) {
String attributeName = getAttributeName(fieldName);
Attribute entityAttribute =
((MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(persistenceUnit))
.getEntityAttribute(entityC... | [
"private",
"void",
"filterJPAParameterInfo",
"(",
"Type",
"type",
",",
"String",
"name",
",",
"String",
"fieldName",
")",
"{",
"String",
"attributeName",
"=",
"getAttributeName",
"(",
"fieldName",
")",
";",
"Attribute",
"entityAttribute",
"=",
"(",
"(",
"Metamod... | Filter jpa parameter info.
@param type
the type
@param name
the name
@param fieldName
the field name | [
"Filter",
"jpa",
"parameter",
"info",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/query/KunderaQuery.java#L783-L795 |
cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/BioPolymer.java | BioPolymer.addAtom | @Override
public void addAtom(IAtom oAtom, IStrand oStrand) {
"""
Adds the atom oAtom to a specified Strand, whereas the Monomer is unspecified. Hence
the atom will be added to a Monomer of type UNKNOWN in the specified Strand.
@param oAtom The atom to add
@param oStrand The strand the atom belongs to
... | java | @Override
public void addAtom(IAtom oAtom, IStrand oStrand) {
int atomCount = super.getAtomCount();
// Add atom to AtomContainer
super.addAtom(oAtom);
if (atomCount != super.getAtomCount() && oStrand != null) { // Maybe better to throw null pointer exception here, so user realises... | [
"@",
"Override",
"public",
"void",
"addAtom",
"(",
"IAtom",
"oAtom",
",",
"IStrand",
"oStrand",
")",
"{",
"int",
"atomCount",
"=",
"super",
".",
"getAtomCount",
"(",
")",
";",
"// Add atom to AtomContainer",
"super",
".",
"addAtom",
"(",
"oAtom",
")",
";",
... | Adds the atom oAtom to a specified Strand, whereas the Monomer is unspecified. Hence
the atom will be added to a Monomer of type UNKNOWN in the specified Strand.
@param oAtom The atom to add
@param oStrand The strand the atom belongs to | [
"Adds",
"the",
"atom",
"oAtom",
"to",
"a",
"specified",
"Strand",
"whereas",
"the",
"Monomer",
"is",
"unspecified",
".",
"Hence",
"the",
"atom",
"will",
"be",
"added",
"to",
"a",
"Monomer",
"of",
"type",
"UNKNOWN",
"in",
"the",
"specified",
"Strand",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/BioPolymer.java#L78-L96 |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.isRelated | private boolean isRelated(Task task, List<Relation> list) {
"""
Internal method used to test for the existence of a relationship
with a task.
@param task target task
@param list list of relationships
@return boolean flag
"""
boolean result = false;
for (Relation relation : list)
{
... | java | private boolean isRelated(Task task, List<Relation> list)
{
boolean result = false;
for (Relation relation : list)
{
if (relation.getTargetTask().getUniqueID().intValue() == task.getUniqueID().intValue())
{
result = true;
break;
}
}
ret... | [
"private",
"boolean",
"isRelated",
"(",
"Task",
"task",
",",
"List",
"<",
"Relation",
">",
"list",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"for",
"(",
"Relation",
"relation",
":",
"list",
")",
"{",
"if",
"(",
"relation",
".",
"getTargetTask",
... | Internal method used to test for the existence of a relationship
with a task.
@param task target task
@param list list of relationships
@return boolean flag | [
"Internal",
"method",
"used",
"to",
"test",
"for",
"the",
"existence",
"of",
"a",
"relationship",
"with",
"a",
"task",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L5020-L5032 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/search/sort/SearchSort.java | SearchSort.sortGeoDistance | public static SearchSortGeoDistance sortGeoDistance(double locationLon, double locationLat, String field) {
"""
Sort by geo location.
@param locationLon longitude of the location.
@param locationLat latitude of the location.
@param field the field name.
"""
return new SearchSortGeoDistance(locatio... | java | public static SearchSortGeoDistance sortGeoDistance(double locationLon, double locationLat, String field) {
return new SearchSortGeoDistance(locationLon, locationLat, field);
} | [
"public",
"static",
"SearchSortGeoDistance",
"sortGeoDistance",
"(",
"double",
"locationLon",
",",
"double",
"locationLat",
",",
"String",
"field",
")",
"{",
"return",
"new",
"SearchSortGeoDistance",
"(",
"locationLon",
",",
"locationLat",
",",
"field",
")",
";",
... | Sort by geo location.
@param locationLon longitude of the location.
@param locationLat latitude of the location.
@param field the field name. | [
"Sort",
"by",
"geo",
"location",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/search/sort/SearchSort.java#L81-L83 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/JCRAssert.java | JCRAssert.assertNodeExistByPath | public static void assertNodeExistByPath(final Session session, final String absPath) throws RepositoryException {
"""
Asserts that a specific node with the given absolute path exists in the session
@param session
the session to search for the node
@param absPath
the absolute path to look for a node
@throws... | java | public static void assertNodeExistByPath(final Session session, final String absPath) throws RepositoryException {
try {
session.getNode(absPath);
} catch (final PathNotFoundException e) {
LOG.debug("Node path {} does not exist", absPath, e);
fail(e.getMessage());
... | [
"public",
"static",
"void",
"assertNodeExistByPath",
"(",
"final",
"Session",
"session",
",",
"final",
"String",
"absPath",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"session",
".",
"getNode",
"(",
"absPath",
")",
";",
"}",
"catch",
"(",
"final",
... | Asserts that a specific node with the given absolute path exists in the session
@param session
the session to search for the node
@param absPath
the absolute path to look for a node
@throws RepositoryException
if the repository access failed | [
"Asserts",
"that",
"a",
"specific",
"node",
"with",
"the",
"given",
"absolute",
"path",
"exists",
"in",
"the",
"session"
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/JCRAssert.java#L80-L87 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/GalleriesApi.java | GalleriesApi.getListForPhoto | public GalleryList getListForPhoto(String photoId, int perPage, int page) throws JinxException {
"""
Return the list of galleries to which a photo has been added. Galleries are returned sorted by date which the photo was added to the gallery.
<br>
This method does not require authentication.
@param photoId Re... | java | public GalleryList getListForPhoto(String photoId, int perPage, int page) throws JinxException {
JinxUtils.validateParams(photoId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.galleries.getListForPhoto");
params.put("photo_id", photoId);
if (perPage > 0) {
params... | [
"public",
"GalleryList",
"getListForPhoto",
"(",
"String",
"photoId",
",",
"int",
"perPage",
",",
"int",
"page",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photoId",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"par... | Return the list of galleries to which a photo has been added. Galleries are returned sorted by date which the photo was added to the gallery.
<br>
This method does not require authentication.
@param photoId Required. The ID of the photo to fetch a list of galleries for.
@param perPage Optional. Number of galleries to ... | [
"Return",
"the",
"list",
"of",
"galleries",
"to",
"which",
"a",
"photo",
"has",
"been",
"added",
".",
"Galleries",
"are",
"returned",
"sorted",
"by",
"date",
"which",
"the",
"photo",
"was",
"added",
"to",
"the",
"gallery",
".",
"<br",
">",
"This",
"metho... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/GalleriesApi.java#L226-L238 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/bayesian/ConditionalProbabilityTable.java | ConditionalProbabilityTable.query | public double query(int targetClass, DataPointPair<Integer> dataPoint) {
"""
Queries the CPT for the probability that the class value of <tt>targetClas</tt> would occur with the given DataPointPair.
@param targetClass the index in the original data set of the class that we want the probability of
@param dataPoin... | java | public double query(int targetClass, DataPointPair<Integer> dataPoint)
{
int[] cord = new int[dimSize.length];
int skipVal = dataPointToCord(dataPoint, targetClass, cord);
return query(targetClass, skipVal, cord);
} | [
"public",
"double",
"query",
"(",
"int",
"targetClass",
",",
"DataPointPair",
"<",
"Integer",
">",
"dataPoint",
")",
"{",
"int",
"[",
"]",
"cord",
"=",
"new",
"int",
"[",
"dimSize",
".",
"length",
"]",
";",
"int",
"skipVal",
"=",
"dataPointToCord",
"(",
... | Queries the CPT for the probability that the class value of <tt>targetClas</tt> would occur with the given DataPointPair.
@param targetClass the index in the original data set of the class that we want the probability of
@param dataPoint the data point of values paired with the value of the predicting attribute in the ... | [
"Queries",
"the",
"CPT",
"for",
"the",
"probability",
"that",
"the",
"class",
"value",
"of",
"<tt",
">",
"targetClas<",
"/",
"tt",
">",
"would",
"occur",
"with",
"the",
"given",
"DataPointPair",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/bayesian/ConditionalProbabilityTable.java#L207-L214 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.mayBeString | static boolean mayBeString(Node n, boolean useType) {
"""
Return if the node is possibly a string.
@param n The node.
@param useType If true and the node has a primitive type, return true if that type is string
and false otherwise.
@return Whether the results is possibly a string.
"""
if (useType) {
... | java | static boolean mayBeString(Node n, boolean useType) {
if (useType) {
JSType type = n.getJSType();
if (type != null) {
if (type.isStringValueType()) {
return true;
} else if (type.isNumberValueType() || type.isBooleanValueType() || type.isNullType()
|| type.isVoidTyp... | [
"static",
"boolean",
"mayBeString",
"(",
"Node",
"n",
",",
"boolean",
"useType",
")",
"{",
"if",
"(",
"useType",
")",
"{",
"JSType",
"type",
"=",
"n",
".",
"getJSType",
"(",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"if",
"(",
"type",
... | Return if the node is possibly a string.
@param n The node.
@param useType If true and the node has a primitive type, return true if that type is string
and false otherwise.
@return Whether the results is possibly a string. | [
"Return",
"if",
"the",
"node",
"is",
"possibly",
"a",
"string",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L2019-L2032 |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/filler/common/dml/PredicateUtils.java | PredicateUtils.createInCondition | public static Optional<Condition> createInCondition(final PredicateInRightValue inRightValue, final Column column) {
"""
Create condition of IN operator.
@param inRightValue right value of IN operator
@param column column
@return condition
"""
List<SQLExpression> sqlExpressions = new LinkedList<>(... | java | public static Optional<Condition> createInCondition(final PredicateInRightValue inRightValue, final Column column) {
List<SQLExpression> sqlExpressions = new LinkedList<>();
for (ExpressionSegment each : inRightValue.getSqlExpressions()) {
if (!(each instanceof SimpleExpressionSegment)) {
... | [
"public",
"static",
"Optional",
"<",
"Condition",
">",
"createInCondition",
"(",
"final",
"PredicateInRightValue",
"inRightValue",
",",
"final",
"Column",
"column",
")",
"{",
"List",
"<",
"SQLExpression",
">",
"sqlExpressions",
"=",
"new",
"LinkedList",
"<>",
"(",... | Create condition of IN operator.
@param inRightValue right value of IN operator
@param column column
@return condition | [
"Create",
"condition",
"of",
"IN",
"operator",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/filler/common/dml/PredicateUtils.java#L112-L123 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/EnforcementJobRest.java | EnforcementJobRest.createEnforcementJob | @POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response createEnforcementJob(@Context HttpHeaders hh, String payload) {
"""
Creates a new enforcement
<pre>
POST /enforcements
Request:
POST /agreements HTTP/1.1
Accept: application/xml
Response:
... | java | @POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response createEnforcementJob(@Context HttpHeaders hh, String payload){
logger.debug("StartOf createEnforcementJob - REQUEST Insert /enforcement");
EnforcementJobHelper enforcementJobService = get... | [
"@",
"POST",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"public",
"Response",
"createEnforcementJob",
"(",
"@",
"Context",
"HttpHeaders",
"hh",
",",
"String",
"payload",
")",
... | Creates a new enforcement
<pre>
POST /enforcements
Request:
POST /agreements HTTP/1.1
Accept: application/xml
Response:
{@code
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<message code="201" message= "The enforcementJob has been stored successfully in the SLA Repository Database"/>
}
</pre>
Example:... | [
"Creates",
"a",
"new",
"enforcement"
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/EnforcementJobRest.java#L300-L322 |
jMetal/jMetal | jmetal-exec/src/main/java/org/uma/jmetal/qualityIndicator/CommandLineIndicatorRunner.java | CommandLineIndicatorRunner.calculateAndPrintIndicators | private static void calculateAndPrintIndicators(String[] args, boolean normalize)
throws FileNotFoundException {
"""
Compute the quality indicator(s) and prints it (them)
@param args
@param normalize
@throws FileNotFoundException
"""
Front referenceFront = new ArrayFront(args[1]);
Front front ... | java | private static void calculateAndPrintIndicators(String[] args, boolean normalize)
throws FileNotFoundException {
Front referenceFront = new ArrayFront(args[1]);
Front front = new ArrayFront(args[2]);
if (normalize) {
FrontNormalizer frontNormalizer = new FrontNormalizer(referenceFront);
r... | [
"private",
"static",
"void",
"calculateAndPrintIndicators",
"(",
"String",
"[",
"]",
"args",
",",
"boolean",
"normalize",
")",
"throws",
"FileNotFoundException",
"{",
"Front",
"referenceFront",
"=",
"new",
"ArrayFront",
"(",
"args",
"[",
"1",
"]",
")",
";",
"F... | Compute the quality indicator(s) and prints it (them)
@param args
@param normalize
@throws FileNotFoundException | [
"Compute",
"the",
"quality",
"indicator",
"(",
"s",
")",
"and",
"prints",
"it",
"(",
"them",
")"
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-exec/src/main/java/org/uma/jmetal/qualityIndicator/CommandLineIndicatorRunner.java#L92-L126 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsToolBar.java | CmsToolBar.createButton | public static Button createButton(Resource icon, String title) {
"""
Creates a properly styled toolbar button.<p>
@param icon the button icon
@param title the button title, will be used for the tooltip
@return the button
"""
return createButton(icon, title, false);
} | java | public static Button createButton(Resource icon, String title) {
return createButton(icon, title, false);
} | [
"public",
"static",
"Button",
"createButton",
"(",
"Resource",
"icon",
",",
"String",
"title",
")",
"{",
"return",
"createButton",
"(",
"icon",
",",
"title",
",",
"false",
")",
";",
"}"
] | Creates a properly styled toolbar button.<p>
@param icon the button icon
@param title the button title, will be used for the tooltip
@return the button | [
"Creates",
"a",
"properly",
"styled",
"toolbar",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsToolBar.java#L217-L220 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/TextureLoader.java | TextureLoader.getTexture | public static Texture getTexture(String format, InputStream in, boolean flipped, int filter) throws IOException {
"""
Load a texture with a given format from the supplied input stream
@param format The format of the texture to be loaded (something like "PNG" or "TGA")
@param in The input stream from which the ... | java | public static Texture getTexture(String format, InputStream in, boolean flipped, int filter) throws IOException {
return InternalTextureLoader.get().getTexture(in, in.toString()+"."+format, flipped, filter);
} | [
"public",
"static",
"Texture",
"getTexture",
"(",
"String",
"format",
",",
"InputStream",
"in",
",",
"boolean",
"flipped",
",",
"int",
"filter",
")",
"throws",
"IOException",
"{",
"return",
"InternalTextureLoader",
".",
"get",
"(",
")",
".",
"getTexture",
"(",... | Load a texture with a given format from the supplied input stream
@param format The format of the texture to be loaded (something like "PNG" or "TGA")
@param in The input stream from which the image data will be read
@param flipped True if the image should be flipped vertically on loading
@param filter The GL texture ... | [
"Load",
"a",
"texture",
"with",
"a",
"given",
"format",
"from",
"the",
"supplied",
"input",
"stream"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/TextureLoader.java#L63-L65 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsMacroResolverDialog.java | CmsMacroResolverDialog.getAvailableLocalVariant | private String getAvailableLocalVariant(CmsObject cms, String path, String baseName) {
"""
Returns the correct variant of a resource name according to locale.<p>
@param cms CmsObject
@param path where the considered resource is.
@param baseName of the resource
@return localized name of resource
"""
... | java | private String getAvailableLocalVariant(CmsObject cms, String path, String baseName) {
A_CmsUI.get();
List<String> localVariations = CmsLocaleManager.getLocaleVariants(
baseName,
UI.getCurrent().getLocale(),
false,
true);
for (String name : local... | [
"private",
"String",
"getAvailableLocalVariant",
"(",
"CmsObject",
"cms",
",",
"String",
"path",
",",
"String",
"baseName",
")",
"{",
"A_CmsUI",
".",
"get",
"(",
")",
";",
"List",
"<",
"String",
">",
"localVariations",
"=",
"CmsLocaleManager",
".",
"getLocaleV... | Returns the correct variant of a resource name according to locale.<p>
@param cms CmsObject
@param path where the considered resource is.
@param baseName of the resource
@return localized name of resource | [
"Returns",
"the",
"correct",
"variant",
"of",
"a",
"resource",
"name",
"according",
"to",
"locale",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsMacroResolverDialog.java#L180-L195 |
morimekta/utils | console-util/src/main/java/net/morimekta/console/terminal/ProgressManager.java | ProgressManager.addTask | public <T> Future<T> addTask(String title,
long total,
ProgressHandler<T> handler) {
"""
Add a task to be done while showing progress. If there are too many tasks
ongoing, the task will be queued and done when the local thread pool has
available t... | java | public <T> Future<T> addTask(String title,
long total,
ProgressHandler<T> handler) {
ProgressAsyncHandler<T> async = (result, progress) -> {
try {
result.complete(handler.handle(progress));
} catch (Excepti... | [
"public",
"<",
"T",
">",
"Future",
"<",
"T",
">",
"addTask",
"(",
"String",
"title",
",",
"long",
"total",
",",
"ProgressHandler",
"<",
"T",
">",
"handler",
")",
"{",
"ProgressAsyncHandler",
"<",
"T",
">",
"async",
"=",
"(",
"result",
",",
"progress",
... | Add a task to be done while showing progress. If there are too many tasks
ongoing, the task will be queued and done when the local thread pool has
available threads.
@param title The progress title of the task.
@param total The total progress to complete.
@param handler The handler to do the task behind the progress b... | [
"Add",
"a",
"task",
"to",
"be",
"done",
"while",
"showing",
"progress",
".",
"If",
"there",
"are",
"too",
"many",
"tasks",
"ongoing",
"the",
"task",
"will",
"be",
"queued",
"and",
"done",
"when",
"the",
"local",
"thread",
"pool",
"has",
"available",
"thr... | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/console-util/src/main/java/net/morimekta/console/terminal/ProgressManager.java#L222-L235 |
javalite/activejdbc | activejdbc-instrumentation/src/main/java/org/javalite/instrumentation/InstrumentationModelFinder.java | InstrumentationModelFinder.findFiles | private void findFiles(File directory) throws IOException, ClassNotFoundException {
"""
This will scan directory for class files, non-recursive.
@param directory directory to scan.
@throws IOException, NotFoundException
"""
File[] files = directory.listFiles(new FilenameFilter() {
publ... | java | private void findFiles(File directory) throws IOException, ClassNotFoundException {
File[] files = directory.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.endsWith(".class");
}
});
if (files != null) {
... | [
"private",
"void",
"findFiles",
"(",
"File",
"directory",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"File",
"[",
"]",
"files",
"=",
"directory",
".",
"listFiles",
"(",
"new",
"FilenameFilter",
"(",
")",
"{",
"public",
"boolean",
"accept... | This will scan directory for class files, non-recursive.
@param directory directory to scan.
@throws IOException, NotFoundException | [
"This",
"will",
"scan",
"directory",
"for",
"class",
"files",
"non",
"-",
"recursive",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc-instrumentation/src/main/java/org/javalite/instrumentation/InstrumentationModelFinder.java#L124-L140 |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/BitmapUtils.java | BitmapUtils.scale | public static Bitmap scale(ContentResolver contentResolver, Uri uri, int maxWidth, int maxHeight) {
"""
按原比例缩放图片
@param contentResolver
@param uri 图片的URI地址
@param maxWidth 缩放后的宽度
@param maxHeight 缩放后的高度
@return
"""
String tag = "SCALE";
LogUtils.v(tag, "uri=" + u... | java | public static Bitmap scale(ContentResolver contentResolver, Uri uri, int maxWidth, int maxHeight) {
String tag = "SCALE";
LogUtils.v(tag, "uri=" + uri.toString());
try {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
... | [
"public",
"static",
"Bitmap",
"scale",
"(",
"ContentResolver",
"contentResolver",
",",
"Uri",
"uri",
",",
"int",
"maxWidth",
",",
"int",
"maxHeight",
")",
"{",
"String",
"tag",
"=",
"\"SCALE\"",
";",
"LogUtils",
".",
"v",
"(",
"tag",
",",
"\"uri=\"",
"+",
... | 按原比例缩放图片
@param contentResolver
@param uri 图片的URI地址
@param maxWidth 缩放后的宽度
@param maxHeight 缩放后的高度
@return | [
"按原比例缩放图片"
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/BitmapUtils.java#L67-L124 |
zamrokk/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Chain.java | Chain.getMember | public Member getMember(String name) {
"""
Get the member with a given name
@param name name of the member
@return member
"""
if (null == keyValStore) throw new RuntimeException("No key value store was found. You must first call Chain.setKeyValStore");
if (null == memberServices) throw new R... | java | public Member getMember(String name) {
if (null == keyValStore) throw new RuntimeException("No key value store was found. You must first call Chain.setKeyValStore");
if (null == memberServices) throw new RuntimeException("No member services was found. You must first call Chain.setMemberServices or Cha... | [
"public",
"Member",
"getMember",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"null",
"==",
"keyValStore",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"No key value store was found. You must first call Chain.setKeyValStore\"",
")",
";",
"if",
"(",
"null",
"==",
... | Get the member with a given name
@param name name of the member
@return member | [
"Get",
"the",
"member",
"with",
"a",
"given",
"name"
] | train | https://github.com/zamrokk/fabric-sdk-java/blob/d4993ca602f72d412cd682e1b92e805e48b27afa/src/main/java/org/hyperledger/fabric/sdk/Chain.java#L292-L305 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Collections.java | Collections.binarySearch | @SuppressWarnings("unchecked")
public static <T> int binarySearch(List<? extends T> list, T key, Comparator<? super T> c) {
"""
Searches the specified list for the specified object using the binary
search algorithm. The list must be sorted into ascending order
according to the specified comparator (as by th... | java | @SuppressWarnings("unchecked")
public static <T> int binarySearch(List<? extends T> list, T key, Comparator<? super T> c) {
if (c==null)
return binarySearch((List<? extends Comparable<? super T>>) list, key);
if (list instanceof RandomAccess || list.size()<BINARYSEARCH_THRESHOLD)
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"int",
"binarySearch",
"(",
"List",
"<",
"?",
"extends",
"T",
">",
"list",
",",
"T",
"key",
",",
"Comparator",
"<",
"?",
"super",
"T",
">",
"c",
")",
"{",
"if",
... | Searches the specified list for the specified object using the binary
search algorithm. The list must be sorted into ascending order
according to the specified comparator (as by the
{@link #sort(List, Comparator) sort(List, Comparator)}
method), prior to making this call. If it is
not sorted, the results are undefine... | [
"Searches",
"the",
"specified",
"list",
"for",
"the",
"specified",
"object",
"using",
"the",
"binary",
"search",
"algorithm",
".",
"The",
"list",
"must",
"be",
"sorted",
"into",
"ascending",
"order",
"according",
"to",
"the",
"specified",
"comparator",
"(",
"a... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Collections.java#L346-L355 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/util/ClassPathUtil.java | ClassPathUtil.findCodeBaseInClassPath | public static String findCodeBaseInClassPath(@Nonnull String codeBaseName, String classPath) {
"""
Try to find a codebase with the given name in the given class path
string.
@param codeBaseName
name of a codebase (e.g., "findbugs.jar")
@param classPath
a classpath
@return full path of named codebase, or nu... | java | public static String findCodeBaseInClassPath(@Nonnull String codeBaseName, String classPath) {
if (classPath == null) {
return null;
}
StringTokenizer tok = new StringTokenizer(classPath, File.pathSeparator);
while (tok.hasMoreTokens()) {
String t = tok.nextToken... | [
"public",
"static",
"String",
"findCodeBaseInClassPath",
"(",
"@",
"Nonnull",
"String",
"codeBaseName",
",",
"String",
"classPath",
")",
"{",
"if",
"(",
"classPath",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"StringTokenizer",
"tok",
"=",
"new",
"S... | Try to find a codebase with the given name in the given class path
string.
@param codeBaseName
name of a codebase (e.g., "findbugs.jar")
@param classPath
a classpath
@return full path of named codebase, or null if the codebase couldn't be
found | [
"Try",
"to",
"find",
"a",
"codebase",
"with",
"the",
"given",
"name",
"in",
"the",
"given",
"class",
"path",
"string",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/util/ClassPathUtil.java#L46-L61 |
JDBDT/jdbdt | src/main/java/org/jdbdt/JDBDT.java | JDBDT.assertDelta | public static void assertDelta(String message, DataSet oldData, DataSet newData) throws DBAssertionError {
"""
Assert database delta expressed by 'old' and 'new' data sets (error message variant).
@param message The error message for the assertion error.
@param oldData Expected 'old' data.
@param newData Expe... | java | public static void assertDelta(String message, DataSet oldData, DataSet newData) throws DBAssertionError {
DBAssert.deltaAssertion(CallInfo.create(message), oldData, newData);
} | [
"public",
"static",
"void",
"assertDelta",
"(",
"String",
"message",
",",
"DataSet",
"oldData",
",",
"DataSet",
"newData",
")",
"throws",
"DBAssertionError",
"{",
"DBAssert",
".",
"deltaAssertion",
"(",
"CallInfo",
".",
"create",
"(",
"message",
")",
",",
"old... | Assert database delta expressed by 'old' and 'new' data sets (error message variant).
@param message The error message for the assertion error.
@param oldData Expected 'old' data.
@param newData Expected 'new' data.
@throws DBAssertionError if the assertion fails.
@see #assertUnchanged(String,DataSource)
@see #assert... | [
"Assert",
"database",
"delta",
"expressed",
"by",
"old",
"and",
"new",
"data",
"sets",
"(",
"error",
"message",
"variant",
")",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/JDBDT.java#L585-L587 |
Samsung/GearVRf | GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFString.java | MFString.setValue | public void setValue(int numStrings, String[] newValues) {
"""
Assign a new value to this field.
@param numStrings - number of strings
@param newValues - the new strings
"""
value.clear();
if (numStrings == newValues.length) {
for (int i = 0; i < newValues.length; i++) {
... | java | public void setValue(int numStrings, String[] newValues) {
value.clear();
if (numStrings == newValues.length) {
for (int i = 0; i < newValues.length; i++) {
value.add(newValues[i]);
}
}
else {
Log.e(TAG, "X3D MFString setValue() numStri... | [
"public",
"void",
"setValue",
"(",
"int",
"numStrings",
",",
"String",
"[",
"]",
"newValues",
")",
"{",
"value",
".",
"clear",
"(",
")",
";",
"if",
"(",
"numStrings",
"==",
"newValues",
".",
"length",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Assign a new value to this field.
@param numStrings - number of strings
@param newValues - the new strings | [
"Assign",
"a",
"new",
"value",
"to",
"this",
"field",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFString.java#L145-L155 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java | MemberSummaryBuilder.buildFieldsSummary | public void buildFieldsSummary(XMLNode node, Content memberSummaryTree) {
"""
Build the summary for the fields.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added
"""
MemberSummaryWriter writer =... | java | public void buildFieldsSummary(XMLNode node, Content memberSummaryTree) {
MemberSummaryWriter writer =
memberSummaryWriters[VisibleMemberMap.FIELDS];
VisibleMemberMap visibleMemberMap =
visibleMemberMaps[VisibleMemberMap.FIELDS];
addSummary(writer, visibleMemberMa... | [
"public",
"void",
"buildFieldsSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"memberSummaryTree",
")",
"{",
"MemberSummaryWriter",
"writer",
"=",
"memberSummaryWriters",
"[",
"VisibleMemberMap",
".",
"FIELDS",
"]",
";",
"VisibleMemberMap",
"visibleMemberMap",
"=",
... | Build the summary for the fields.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added | [
"Build",
"the",
"summary",
"for",
"the",
"fields",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java#L264-L270 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.beginCreateOrUpdate | public AppServicePlanInner beginCreateOrUpdate(String resourceGroupName, String name, AppServicePlanInner appServicePlan) {
"""
Creates or updates an App Service Plan.
Creates or updates an App Service Plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of... | java | public AppServicePlanInner beginCreateOrUpdate(String resourceGroupName, String name, AppServicePlanInner appServicePlan) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, appServicePlan).toBlocking().single().body();
} | [
"public",
"AppServicePlanInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"AppServicePlanInner",
"appServicePlan",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"a... | Creates or updates an App Service Plan.
Creates or updates an App Service Plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param appServicePlan Details of the App Service plan.
@throws IllegalArgumentException thrown if parameters fail ... | [
"Creates",
"or",
"updates",
"an",
"App",
"Service",
"Plan",
".",
"Creates",
"or",
"updates",
"an",
"App",
"Service",
"Plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L756-L758 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationFileUtil.java | ValidationFileUtil.sendFileToHttpServiceResponse | public static void sendFileToHttpServiceResponse(File file, HttpServletResponse res, String contentType) {
"""
Send file to http service response.
@param file the file
@param res the res
@param contentType the content type
"""
if (file == null || res == null) {
return;
... | java | public static void sendFileToHttpServiceResponse(File file, HttpServletResponse res, String contentType) {
if (file == null || res == null) {
return;
}
String filename = getEncodingFileName(file.getName());
initFileSendHeader(res, filename, contentType);
res.setCont... | [
"public",
"static",
"void",
"sendFileToHttpServiceResponse",
"(",
"File",
"file",
",",
"HttpServletResponse",
"res",
",",
"String",
"contentType",
")",
"{",
"if",
"(",
"file",
"==",
"null",
"||",
"res",
"==",
"null",
")",
"{",
"return",
";",
"}",
"String",
... | Send file to http service response.
@param file the file
@param res the res
@param contentType the content type | [
"Send",
"file",
"to",
"http",
"service",
"response",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationFileUtil.java#L110-L124 |
AgNO3/jcifs-ng | src/main/java/jcifs/netbios/Lmhosts.java | Lmhosts.getByName | public synchronized NbtAddress getByName ( String host, CIFSContext tc ) {
"""
This is really just for {@link jcifs.netbios.UniAddress}. It does
not throw an {@link java.net.UnknownHostException} because this
is queried frequently and exceptions would be rather costly to
throw on a regular basis here.
@param... | java | public synchronized NbtAddress getByName ( String host, CIFSContext tc ) {
return getByName(new Name(tc.getConfig(), host, 0x20, null), tc);
} | [
"public",
"synchronized",
"NbtAddress",
"getByName",
"(",
"String",
"host",
",",
"CIFSContext",
"tc",
")",
"{",
"return",
"getByName",
"(",
"new",
"Name",
"(",
"tc",
".",
"getConfig",
"(",
")",
",",
"host",
",",
"0x20",
",",
"null",
")",
",",
"tc",
")"... | This is really just for {@link jcifs.netbios.UniAddress}. It does
not throw an {@link java.net.UnknownHostException} because this
is queried frequently and exceptions would be rather costly to
throw on a regular basis here.
@param host
@param tc
@return resolved name, null if not found | [
"This",
"is",
"really",
"just",
"for",
"{",
"@link",
"jcifs",
".",
"netbios",
".",
"UniAddress",
"}",
".",
"It",
"does",
"not",
"throw",
"an",
"{",
"@link",
"java",
".",
"net",
".",
"UnknownHostException",
"}",
"because",
"this",
"is",
"queried",
"freque... | train | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/netbios/Lmhosts.java#L61-L63 |
threerings/narya | core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java | PresentsDObjectMgr.handleFatalError | protected void handleFatalError (Object causer, Error error) {
"""
Attempts to recover from fatal errors but rethrows if things are freaking out too
frequently.
"""
if (_fatalThrottle.throttleOp()) {
throw error;
}
log.warning("Fatal error caused by '" + causer + "': " + er... | java | protected void handleFatalError (Object causer, Error error)
{
if (_fatalThrottle.throttleOp()) {
throw error;
}
log.warning("Fatal error caused by '" + causer + "': " + error, error);
} | [
"protected",
"void",
"handleFatalError",
"(",
"Object",
"causer",
",",
"Error",
"error",
")",
"{",
"if",
"(",
"_fatalThrottle",
".",
"throttleOp",
"(",
")",
")",
"{",
"throw",
"error",
";",
"}",
"log",
".",
"warning",
"(",
"\"Fatal error caused by '\"",
"+",... | Attempts to recover from fatal errors but rethrows if things are freaking out too
frequently. | [
"Attempts",
"to",
"recover",
"from",
"fatal",
"errors",
"but",
"rethrows",
"if",
"things",
"are",
"freaking",
"out",
"too",
"frequently",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L829-L835 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.onSetBloomFilter | private void onSetBloomFilter(CfDef cfDef, Properties cfProperties, StringBuilder builder) {
"""
On set bloom filter.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder
"""
String bloomFilterFpChance = cfProperties.getProperty(CassandraConstants.BLOOM_FILTE... | java | private void onSetBloomFilter(CfDef cfDef, Properties cfProperties, StringBuilder builder)
{
String bloomFilterFpChance = cfProperties.getProperty(CassandraConstants.BLOOM_FILTER_FP_CHANCE);
if (bloomFilterFpChance != null)
{
try
{
if (builder != null)... | [
"private",
"void",
"onSetBloomFilter",
"(",
"CfDef",
"cfDef",
",",
"Properties",
"cfProperties",
",",
"StringBuilder",
"builder",
")",
"{",
"String",
"bloomFilterFpChance",
"=",
"cfProperties",
".",
"getProperty",
"(",
"CassandraConstants",
".",
"BLOOM_FILTER_FP_CHANCE"... | On set bloom filter.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder | [
"On",
"set",
"bloom",
"filter",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L2436-L2458 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/watch/WatchMonitor.java | WatchMonitor.createAll | public static WatchMonitor createAll(URL url, Watcher watcher) {
"""
创建并初始化监听,监听所有事件
@param url URL
@param watcher {@link Watcher}
@return {@link WatchMonitor}
"""
try {
return createAll(Paths.get(url.toURI()), watcher);
} catch (URISyntaxException e) {
throw new WatchException(e);
}
} | java | public static WatchMonitor createAll(URL url, Watcher watcher){
try {
return createAll(Paths.get(url.toURI()), watcher);
} catch (URISyntaxException e) {
throw new WatchException(e);
}
} | [
"public",
"static",
"WatchMonitor",
"createAll",
"(",
"URL",
"url",
",",
"Watcher",
"watcher",
")",
"{",
"try",
"{",
"return",
"createAll",
"(",
"Paths",
".",
"get",
"(",
"url",
".",
"toURI",
"(",
")",
")",
",",
"watcher",
")",
";",
"}",
"catch",
"("... | 创建并初始化监听,监听所有事件
@param url URL
@param watcher {@link Watcher}
@return {@link WatchMonitor} | [
"创建并初始化监听,监听所有事件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/watch/WatchMonitor.java#L204-L210 |
ag-gipp/MathMLTools | mathml-gold/src/main/java/com/formulasearchengine/mathmltools/gold/pojo/JsonGouldiBean.java | JsonGouldiBean.deserializeDefinitionsField | @SuppressWarnings("unchecked") // bla bla, we know what we are doing here...
@JsonProperty("definitions")
private void deserializeDefinitionsField(Map<String, Object> defs) {
"""
Provide a custom deserialization for definitions
@param defs the generic object for definitions field in gouldi
"""
... | java | @SuppressWarnings("unchecked") // bla bla, we know what we are doing here...
@JsonProperty("definitions")
private void deserializeDefinitionsField(Map<String, Object> defs) {
definitionsBean = new JsonGouldiDefinitionsBean();
LinkedList<JsonGouldiIdentifierDefinienBean> list = new LinkedList<>()... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// bla bla, we know what we are doing here...",
"@",
"JsonProperty",
"(",
"\"definitions\"",
")",
"private",
"void",
"deserializeDefinitionsField",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"defs",
")",
"{",
"d... | Provide a custom deserialization for definitions
@param defs the generic object for definitions field in gouldi | [
"Provide",
"a",
"custom",
"deserialization",
"for",
"definitions"
] | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-gold/src/main/java/com/formulasearchengine/mathmltools/gold/pojo/JsonGouldiBean.java#L79-L113 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.readKeyStore | public static KeyStore readKeyStore(String type, InputStream in, char[] password) {
"""
读取KeyStore文件<br>
KeyStore文件用于数字证书的密钥对保存<br>
see: http://snowolf.iteye.com/blog/391931
@param type 类型
@param in {@link InputStream} 如果想从文件读取.keystore文件,使用 {@link FileUtil#getInputStream(java.io.File)} 读取
@param password 密... | java | public static KeyStore readKeyStore(String type, InputStream in, char[] password) {
return KeyUtil.readKeyStore(type, in, password);
} | [
"public",
"static",
"KeyStore",
"readKeyStore",
"(",
"String",
"type",
",",
"InputStream",
"in",
",",
"char",
"[",
"]",
"password",
")",
"{",
"return",
"KeyUtil",
".",
"readKeyStore",
"(",
"type",
",",
"in",
",",
"password",
")",
";",
"}"
] | 读取KeyStore文件<br>
KeyStore文件用于数字证书的密钥对保存<br>
see: http://snowolf.iteye.com/blog/391931
@param type 类型
@param in {@link InputStream} 如果想从文件读取.keystore文件,使用 {@link FileUtil#getInputStream(java.io.File)} 读取
@param password 密码
@return {@link KeyStore} | [
"读取KeyStore文件<br",
">",
"KeyStore文件用于数字证书的密钥对保存<br",
">",
"see",
":",
"http",
":",
"//",
"snowolf",
".",
"iteye",
".",
"com",
"/",
"blog",
"/",
"391931"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L320-L322 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.parseInetSocketAddress | @Nullable
public static InetSocketAddress parseInetSocketAddress(String address) throws IOException {
"""
Parses {@link InetSocketAddress} from a String.
@param address socket address to parse
@return InetSocketAddress of the String
"""
if (address == null) {
return null;
}
String[] str... | java | @Nullable
public static InetSocketAddress parseInetSocketAddress(String address) throws IOException {
if (address == null) {
return null;
}
String[] strArr = address.split(":");
if (strArr.length != 2) {
throw new IOException("Invalid InetSocketAddress " + address);
}
return new In... | [
"@",
"Nullable",
"public",
"static",
"InetSocketAddress",
"parseInetSocketAddress",
"(",
"String",
"address",
")",
"throws",
"IOException",
"{",
"if",
"(",
"address",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"[",
"]",
"strArr",
"=",
"add... | Parses {@link InetSocketAddress} from a String.
@param address socket address to parse
@return InetSocketAddress of the String | [
"Parses",
"{",
"@link",
"InetSocketAddress",
"}",
"from",
"a",
"String",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L593-L603 |
JOML-CI/JOML | src/org/joml/Vector4f.java | Vector4f.rotateAbout | public Vector4f rotateAbout(float angle, float x, float y, float z) {
"""
Rotate this vector the specified radians around the given rotation axis.
@param angle
the angle in radians
@param x
the x component of the rotation axis
@param y
the y component of the rotation axis
@param z
the z component of the ... | java | public Vector4f rotateAbout(float angle, float x, float y, float z) {
return rotateAxis(angle, x, y, z, thisOrNew());
} | [
"public",
"Vector4f",
"rotateAbout",
"(",
"float",
"angle",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"return",
"rotateAxis",
"(",
"angle",
",",
"x",
",",
"y",
",",
"z",
",",
"thisOrNew",
"(",
")",
")",
";",
"}"
] | Rotate this vector the specified radians around the given rotation axis.
@param angle
the angle in radians
@param x
the x component of the rotation axis
@param y
the y component of the rotation axis
@param z
the z component of the rotation axis
@return a vector holding the result | [
"Rotate",
"this",
"vector",
"the",
"specified",
"radians",
"around",
"the",
"given",
"rotation",
"axis",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4f.java#L1018-L1020 |
korpling/ANNIS | annis-interfaces/src/main/java/annis/CommonHelper.java | CommonHelper.getTextualDSForNode | public static STextualDS getTextualDSForNode(SNode node, SDocumentGraph graph) {
"""
Finds the {@link STextualDS} for a given node. The node must dominate a
token of this text.
@param node
@return
"""
if (node != null)
{
List<DataSourceSequence> dataSources = graph.getOverlappedDataSourceSeq... | java | public static STextualDS getTextualDSForNode(SNode node, SDocumentGraph graph)
{
if (node != null)
{
List<DataSourceSequence> dataSources = graph.getOverlappedDataSourceSequence(
node,
SALT_TYPE.STEXT_OVERLAPPING_RELATION);
if (dataSources != null)
{
for (DataSourceSe... | [
"public",
"static",
"STextualDS",
"getTextualDSForNode",
"(",
"SNode",
"node",
",",
"SDocumentGraph",
"graph",
")",
"{",
"if",
"(",
"node",
"!=",
"null",
")",
"{",
"List",
"<",
"DataSourceSequence",
">",
"dataSources",
"=",
"graph",
".",
"getOverlappedDataSource... | Finds the {@link STextualDS} for a given node. The node must dominate a
token of this text.
@param node
@return | [
"Finds",
"the",
"{",
"@link",
"STextualDS",
"}",
"for",
"a",
"given",
"node",
".",
"The",
"node",
"must",
"dominate",
"a",
"token",
"of",
"this",
"text",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/CommonHelper.java#L360-L379 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java | JDBC4CallableStatement.getDate | @Override
public Date getDate(String parameterName, Calendar cal) throws SQLException {
"""
Retrieves the value of a JDBC DATE parameter as a java.sql.Date object, using the given Calendar object to construct the date.
"""
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public Date getDate(String parameterName, Calendar cal) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"Date",
"getDate",
"(",
"String",
"parameterName",
",",
"Calendar",
"cal",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Retrieves the value of a JDBC DATE parameter as a java.sql.Date object, using the given Calendar object to construct the date. | [
"Retrieves",
"the",
"value",
"of",
"a",
"JDBC",
"DATE",
"parameter",
"as",
"a",
"java",
".",
"sql",
".",
"Date",
"object",
"using",
"the",
"given",
"Calendar",
"object",
"to",
"construct",
"the",
"date",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java#L207-L212 |
recommenders/rival | rival-core/src/main/java/net/recommenders/rival/core/DataModelUtils.java | DataModelUtils.saveDataModel | public static <U, I> void saveDataModel(final DataModelIF<U, I> dm, final String outfile, final boolean overwrite, final String delimiter)
throws FileNotFoundException, UnsupportedEncodingException {
"""
Method that saves a data model to a file.
@param dm the data model
@param outfile file where th... | java | public static <U, I> void saveDataModel(final DataModelIF<U, I> dm, final String outfile, final boolean overwrite, final String delimiter)
throws FileNotFoundException, UnsupportedEncodingException {
if (new File(outfile).exists() && !overwrite) {
System.out.println("Ignoring " + outfile... | [
"public",
"static",
"<",
"U",
",",
"I",
">",
"void",
"saveDataModel",
"(",
"final",
"DataModelIF",
"<",
"U",
",",
"I",
">",
"dm",
",",
"final",
"String",
"outfile",
",",
"final",
"boolean",
"overwrite",
",",
"final",
"String",
"delimiter",
")",
"throws",... | Method that saves a data model to a file.
@param dm the data model
@param outfile file where the model will be saved
@param overwrite flag that indicates if the file should be overwritten
@param delimiter field delimiter
@param <U> type of users
@param <I> type of items
@throws FileNotFoundException when outfile canno... | [
"Method",
"that",
"saves",
"a",
"data",
"model",
"to",
"a",
"file",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-core/src/main/java/net/recommenders/rival/core/DataModelUtils.java#L49-L63 |
alipay/sofa-rpc | extension-impl/metrics-lookout/src/main/java/com/alipay/sofa/rpc/metrics/lookout/RpcLookout.java | RpcLookout.recordCounterAndTimer | private void recordCounterAndTimer(MixinMetric mixinMetric, RpcAbstractLookoutModel model) {
"""
Record the number of calls and time consuming.
@param mixinMetric MixinMetric
@param model information model
"""
Counter totalCounter = mixinMetric.counter("total_count");
Timer totalTimer... | java | private void recordCounterAndTimer(MixinMetric mixinMetric, RpcAbstractLookoutModel model) {
Counter totalCounter = mixinMetric.counter("total_count");
Timer totalTimer = mixinMetric.timer("total_time");
Long elapsedTime = model.getElapsedTime();
totalCounter.inc();
if (elapsed... | [
"private",
"void",
"recordCounterAndTimer",
"(",
"MixinMetric",
"mixinMetric",
",",
"RpcAbstractLookoutModel",
"model",
")",
"{",
"Counter",
"totalCounter",
"=",
"mixinMetric",
".",
"counter",
"(",
"\"total_count\"",
")",
";",
"Timer",
"totalTimer",
"=",
"mixinMetric"... | Record the number of calls and time consuming.
@param mixinMetric MixinMetric
@param model information model | [
"Record",
"the",
"number",
"of",
"calls",
"and",
"time",
"consuming",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/metrics-lookout/src/main/java/com/alipay/sofa/rpc/metrics/lookout/RpcLookout.java#L162-L182 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendFixedDecimal | public DateTimeFormatterBuilder appendFixedDecimal(
DateTimeFieldType fieldType, int numDigits) {
"""
Instructs the printer to emit a field value as a fixed-width decimal
number (smaller numbers will be left-padded with zeros), and the parser
to expect an unsigned decimal number with the same fixed w... | java | public DateTimeFormatterBuilder appendFixedDecimal(
DateTimeFieldType fieldType, int numDigits) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
if (numDigits <= 0) {
throw new IllegalArgumentException("Illegal nu... | [
"public",
"DateTimeFormatterBuilder",
"appendFixedDecimal",
"(",
"DateTimeFieldType",
"fieldType",
",",
"int",
"numDigits",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field type must not be null\"",
")",... | Instructs the printer to emit a field value as a fixed-width decimal
number (smaller numbers will be left-padded with zeros), and the parser
to expect an unsigned decimal number with the same fixed width.
@param fieldType type of field to append
@param numDigits the exact number of digits to parse or print, except i... | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"field",
"value",
"as",
"a",
"fixed",
"-",
"width",
"decimal",
"number",
"(",
"smaller",
"numbers",
"will",
"be",
"left",
"-",
"padded",
"with",
"zeros",
")",
"and",
"the",
"parser",
"to",
"expect",
"an",... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L463-L472 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.doHttpPost | public void doHttpPost(String url, String templateName, Object model, HttpResponse result, Map<String, Object> headers, String contentType) {
"""
Performs POST to supplied url of result of applying template with model.
@param url url to post to.
@param templateName name of template to use.
@param model model fo... | java | public void doHttpPost(String url, String templateName, Object model, HttpResponse result, Map<String, Object> headers, String contentType) {
String request = processTemplate(templateName, model);
result.setRequest(request);
doHttpPost(url, result, headers, contentType);
} | [
"public",
"void",
"doHttpPost",
"(",
"String",
"url",
",",
"String",
"templateName",
",",
"Object",
"model",
",",
"HttpResponse",
"result",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"headers",
",",
"String",
"contentType",
")",
"{",
"String",
"request",... | Performs POST to supplied url of result of applying template with model.
@param url url to post to.
@param templateName name of template to use.
@param model model for template.
@param result result to populate with response.
@param headers headers to add.
@param contentType contentType for request. | [
"Performs",
"POST",
"to",
"supplied",
"url",
"of",
"result",
"of",
"applying",
"template",
"with",
"model",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L272-L276 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/util/RestRequest.java | RestRequest.requestGet | public Object requestGet(final String id, Class type) throws SDKException {
"""
Executes a http get with to a given id
@param id the id path used for the api request
@param type the class of the requested entity
@return a string containing he response content
@throws SDKException if the request fails
"""... | java | public Object requestGet(final String id, Class type) throws SDKException {
String url = this.pathUrl;
if (id != null) {
url += "/" + id;
return requestGetWithStatus(url, null, type);
} else {
return requestGetAll(url, type, null);
}
} | [
"public",
"Object",
"requestGet",
"(",
"final",
"String",
"id",
",",
"Class",
"type",
")",
"throws",
"SDKException",
"{",
"String",
"url",
"=",
"this",
".",
"pathUrl",
";",
"if",
"(",
"id",
"!=",
"null",
")",
"{",
"url",
"+=",
"\"/\"",
"+",
"id",
";"... | Executes a http get with to a given id
@param id the id path used for the api request
@param type the class of the requested entity
@return a string containing he response content
@throws SDKException if the request fails | [
"Executes",
"a",
"http",
"get",
"with",
"to",
"a",
"given",
"id"
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/util/RestRequest.java#L715-L723 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/alignment/BamUtils.java | BamUtils.getCoverageFromBigWig | public static RegionCoverage getCoverageFromBigWig(Region region, int windowSize, Path bigwigPath) throws IOException {
"""
Return the coverage average given a window size from the BigWig file passed.
@param region Region from which return the coverage
@param windowSize Window size to average
@param bigwigPath ... | java | public static RegionCoverage getCoverageFromBigWig(Region region, int windowSize, Path bigwigPath) throws IOException {
FileUtils.checkFile(bigwigPath);
BigWigManager bigWigManager = new BigWigManager(bigwigPath);
float[] avgCoverage = bigWigManager.groupBy(region, windowSize);
return n... | [
"public",
"static",
"RegionCoverage",
"getCoverageFromBigWig",
"(",
"Region",
"region",
",",
"int",
"windowSize",
",",
"Path",
"bigwigPath",
")",
"throws",
"IOException",
"{",
"FileUtils",
".",
"checkFile",
"(",
"bigwigPath",
")",
";",
"BigWigManager",
"bigWigManage... | Return the coverage average given a window size from the BigWig file passed.
@param region Region from which return the coverage
@param windowSize Window size to average
@param bigwigPath BigWig path with coverage
@return One average score per window size spanning the region
@throws IOException If any error happens rea... | [
"Return",
"the",
"coverage",
"average",
"given",
"a",
"window",
"size",
"from",
"the",
"BigWig",
"file",
"passed",
"."
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/alignment/BamUtils.java#L168-L174 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveConverterUtils.java | HiveConverterUtils.generateStagingCTASStatementFromSelectStar | public static String generateStagingCTASStatementFromSelectStar(HiveDatasetFinder.DbAndTable outputDbAndTable,
HiveDatasetFinder.DbAndTable sourceEntity, Map<String, String> partitionDMLInfo,
StorageFormat storageFormat, String outputTableLocation) {
"""
Generates a CTAS statement to dump the contents ... | java | public static String generateStagingCTASStatementFromSelectStar(HiveDatasetFinder.DbAndTable outputDbAndTable,
HiveDatasetFinder.DbAndTable sourceEntity, Map<String, String> partitionDMLInfo,
StorageFormat storageFormat, String outputTableLocation) {
StringBuilder sourceQueryBuilder = new StringBuilder(... | [
"public",
"static",
"String",
"generateStagingCTASStatementFromSelectStar",
"(",
"HiveDatasetFinder",
".",
"DbAndTable",
"outputDbAndTable",
",",
"HiveDatasetFinder",
".",
"DbAndTable",
"sourceEntity",
",",
"Map",
"<",
"String",
",",
"String",
">",
"partitionDMLInfo",
","... | Generates a CTAS statement to dump the contents of a table / partition into a new table.
@param outputDbAndTable output db and table where contents should be written.
@param sourceEntity source table / partition.
@param partitionDMLInfo map of partition values.
@param storageFormat format of output table.
@param output... | [
"Generates",
"a",
"CTAS",
"statement",
"to",
"dump",
"the",
"contents",
"of",
"a",
"table",
"/",
"partition",
"into",
"a",
"new",
"table",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveConverterUtils.java#L162-L174 |
Alexey1Gavrilov/ExpectIt | expectit-core/src/main/java/net/sf/expectit/matcher/MultiMatcher.java | MultiMatcher.findResultWithMaxEnd | private static Result findResultWithMaxEnd(List<Result> successResults) {
"""
Find the result with the maximum end position and use it as delegate.
"""
return Collections.max(
successResults, new Comparator<Result>() {
@Override
public int compare... | java | private static Result findResultWithMaxEnd(List<Result> successResults) {
return Collections.max(
successResults, new Comparator<Result>() {
@Override
public int compare(Result o1, Result o2) {
return Integer.valueOf(o1.end()).compa... | [
"private",
"static",
"Result",
"findResultWithMaxEnd",
"(",
"List",
"<",
"Result",
">",
"successResults",
")",
"{",
"return",
"Collections",
".",
"max",
"(",
"successResults",
",",
"new",
"Comparator",
"<",
"Result",
">",
"(",
")",
"{",
"@",
"Override",
"pub... | Find the result with the maximum end position and use it as delegate. | [
"Find",
"the",
"result",
"with",
"the",
"maximum",
"end",
"position",
"and",
"use",
"it",
"as",
"delegate",
"."
] | train | https://github.com/Alexey1Gavrilov/ExpectIt/blob/5acbe1f8f895fe1dbd63e29bf3ab8e5bbf0873c3/expectit-core/src/main/java/net/sf/expectit/matcher/MultiMatcher.java#L86-L94 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSetSpanner.java | UnicodeSetSpanner.deleteFrom | public String deleteFrom(CharSequence sequence) {
"""
Delete all the matching spans in sequence, using SpanCondition.SIMPLE
The code alternates spans; see the class doc for {@link UnicodeSetSpanner} for a note about boundary conditions.
@param sequence
charsequence to replace matching spans in.
@return modifie... | java | public String deleteFrom(CharSequence sequence) {
return replaceFrom(sequence, "", CountMethod.WHOLE_SPAN, SpanCondition.SIMPLE);
} | [
"public",
"String",
"deleteFrom",
"(",
"CharSequence",
"sequence",
")",
"{",
"return",
"replaceFrom",
"(",
"sequence",
",",
"\"\"",
",",
"CountMethod",
".",
"WHOLE_SPAN",
",",
"SpanCondition",
".",
"SIMPLE",
")",
";",
"}"
] | Delete all the matching spans in sequence, using SpanCondition.SIMPLE
The code alternates spans; see the class doc for {@link UnicodeSetSpanner} for a note about boundary conditions.
@param sequence
charsequence to replace matching spans in.
@return modified string. | [
"Delete",
"all",
"the",
"matching",
"spans",
"in",
"sequence",
"using",
"SpanCondition",
".",
"SIMPLE",
"The",
"code",
"alternates",
"spans",
";",
"see",
"the",
"class",
"doc",
"for",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSetSpanner.java#L181-L183 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/watched/WatchedDoubleStepQREigen_DDRM.java | WatchedDoubleStepQREigen_DDRM.implicitDoubleStep | public void implicitDoubleStep( int x1 , int x2 ) {
"""
Performs an implicit double step using the values contained in the lower right hand side
of the submatrix for the estimated eigenvector values.
@param x1
@param x2
"""
if( printHumps )
System.out.println("Performing implicit double ... | java | public void implicitDoubleStep( int x1 , int x2 ) {
if( printHumps )
System.out.println("Performing implicit double step");
// compute the wilkinson shift
double z11 = A.get(x2 - 1, x2 - 1);
double z12 = A.get(x2 - 1, x2);
double z21 = A.get(x2, x2 - 1);
dou... | [
"public",
"void",
"implicitDoubleStep",
"(",
"int",
"x1",
",",
"int",
"x2",
")",
"{",
"if",
"(",
"printHumps",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"Performing implicit double step\"",
")",
";",
"// compute the wilkinson shift",
"double",
"z11",
"="... | Performs an implicit double step using the values contained in the lower right hand side
of the submatrix for the estimated eigenvector values.
@param x1
@param x2 | [
"Performs",
"an",
"implicit",
"double",
"step",
"using",
"the",
"values",
"contained",
"in",
"the",
"lower",
"right",
"hand",
"side",
"of",
"the",
"submatrix",
"for",
"the",
"estimated",
"eigenvector",
"values",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/watched/WatchedDoubleStepQREigen_DDRM.java#L195-L240 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java | RoaringBitmap.andNot | public static RoaringBitmap andNot(final RoaringBitmap x1, final RoaringBitmap x2,
long rangeStart, long rangeEnd) {
"""
Bitwise ANDNOT (difference) operation for the given range, rangeStart (inclusive) and rangeEnd
(exclusive). The provided bitmaps are *not* modified. This operation is thread-safe as long ... | java | public static RoaringBitmap andNot(final RoaringBitmap x1, final RoaringBitmap x2,
long rangeStart, long rangeEnd) {
rangeSanityCheck(rangeStart, rangeEnd);
RoaringBitmap rb1 = selectRangeWithoutCopy(x1, rangeStart, rangeEnd);
RoaringBitmap rb2 = selectRangeWithoutCopy(x2, rangeStart, rangeEnd);
... | [
"public",
"static",
"RoaringBitmap",
"andNot",
"(",
"final",
"RoaringBitmap",
"x1",
",",
"final",
"RoaringBitmap",
"x2",
",",
"long",
"rangeStart",
",",
"long",
"rangeEnd",
")",
"{",
"rangeSanityCheck",
"(",
"rangeStart",
",",
"rangeEnd",
")",
";",
"RoaringBitma... | Bitwise ANDNOT (difference) operation for the given range, rangeStart (inclusive) and rangeEnd
(exclusive). The provided bitmaps are *not* modified. This operation is thread-safe as long as
the provided bitmaps remain unchanged.
@param x1 first bitmap
@param x2 other bitmap
@param rangeStart starting point of the rang... | [
"Bitwise",
"ANDNOT",
"(",
"difference",
")",
"operation",
"for",
"the",
"given",
"range",
"rangeStart",
"(",
"inclusive",
")",
"and",
"rangeEnd",
"(",
"exclusive",
")",
".",
"The",
"provided",
"bitmaps",
"are",
"*",
"not",
"*",
"modified",
".",
"This",
"op... | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L1271-L1278 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java | Monitors.newObjectMonitor | public static CompositeMonitor<?> newObjectMonitor(String id, Object obj) {
"""
Helper function to easily create a composite for all monitor fields and
annotated attributes of a given object.
@param id a unique id associated with this particular instance of the
object. If multiple objects of the same class a... | java | public static CompositeMonitor<?> newObjectMonitor(String id, Object obj) {
final TagList tags = getMonitorTags(obj);
List<Monitor<?>> monitors = new ArrayList<>();
addMonitors(monitors, id, tags, obj);
final Class<?> c = obj.getClass();
final String objectId = (id == null) ? DEFAULT_ID : id;
... | [
"public",
"static",
"CompositeMonitor",
"<",
"?",
">",
"newObjectMonitor",
"(",
"String",
"id",
",",
"Object",
"obj",
")",
"{",
"final",
"TagList",
"tags",
"=",
"getMonitorTags",
"(",
"obj",
")",
";",
"List",
"<",
"Monitor",
"<",
"?",
">",
">",
"monitors... | Helper function to easily create a composite for all monitor fields and
annotated attributes of a given object.
@param id a unique id associated with this particular instance of the
object. If multiple objects of the same class are registered
they will have the same config and conflict unless the id
values are distin... | [
"Helper",
"function",
"to",
"easily",
"create",
"a",
"composite",
"for",
"all",
"monitor",
"fields",
"and",
"annotated",
"attributes",
"of",
"a",
"given",
"object",
"."
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java#L149-L158 |
fuinorg/utils4swing | src/main/java/org/fuin/utils4swing/dialogs/DirectorySelectionPanel.java | DirectorySelectionPanel.getButtonOK | protected final JButton getButtonOK() {
"""
Returns the 'OK' button for usage as default button.
@return Button.
"""
if (buttonOK == null) {
buttonOK = new JButton();
buttonOK.setText("OK");
buttonOK.setPreferredSize(new Dimension(80, 26));
button... | java | protected final JButton getButtonOK() {
if (buttonOK == null) {
buttonOK = new JButton();
buttonOK.setText("OK");
buttonOK.setPreferredSize(new Dimension(80, 26));
buttonOK.addActionListener(new ActionListener() {
public void actionPerformed(... | [
"protected",
"final",
"JButton",
"getButtonOK",
"(",
")",
"{",
"if",
"(",
"buttonOK",
"==",
"null",
")",
"{",
"buttonOK",
"=",
"new",
"JButton",
"(",
")",
";",
"buttonOK",
".",
"setText",
"(",
"\"OK\"",
")",
";",
"buttonOK",
".",
"setPreferredSize",
"(",... | Returns the 'OK' button for usage as default button.
@return Button. | [
"Returns",
"the",
"OK",
"button",
"for",
"usage",
"as",
"default",
"button",
"."
] | train | https://github.com/fuinorg/utils4swing/blob/560fb69eac182e3473de9679c3c15433e524ef6b/src/main/java/org/fuin/utils4swing/dialogs/DirectorySelectionPanel.java#L153-L167 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/MatrixFeatures_DDRM.java | MatrixFeatures_DDRM.isOrthogonal | public static boolean isOrthogonal(DMatrixRMaj Q , double tol ) {
"""
<p>
Checks to see if a matrix is orthogonal or isometric.
</p>
@param Q The matrix being tested. Not modified.
@param tol Tolerance.
@return True if it passes the test.
"""
if( Q.numRows < Q.numCols ) {
throw new Il... | java | public static boolean isOrthogonal(DMatrixRMaj Q , double tol )
{
if( Q.numRows < Q.numCols ) {
throw new IllegalArgumentException("The number of rows must be more than or equal to the number of columns");
}
DMatrixRMaj u[] = CommonOps_DDRM.columnsToVector(Q, null);
for(... | [
"public",
"static",
"boolean",
"isOrthogonal",
"(",
"DMatrixRMaj",
"Q",
",",
"double",
"tol",
")",
"{",
"if",
"(",
"Q",
".",
"numRows",
"<",
"Q",
".",
"numCols",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The number of rows must be more than o... | <p>
Checks to see if a matrix is orthogonal or isometric.
</p>
@param Q The matrix being tested. Not modified.
@param tol Tolerance.
@return True if it passes the test. | [
"<p",
">",
"Checks",
"to",
"see",
"if",
"a",
"matrix",
"is",
"orthogonal",
"or",
"isometric",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/MatrixFeatures_DDRM.java#L476-L496 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/service/nitro_service.java | nitro_service.forcehasync | public base_response forcehasync(Boolean force, String save) throws Exception {
"""
<pre>
Use this API to force the sync in secondary Netscaler.
@param force set this to true for forcesync
@param save set this to YES,if want to save the configuration after sync.
@return status of the operation performed.
</pr... | java | public base_response forcehasync(Boolean force, String save) throws Exception
{
hasync resource = new hasync();
resource.set_force(force) ;
resource.set_save(save);
options option = new options();
option.set_action("force");
base_response result = resource.perform_operation(this,option);
return result;
... | [
"public",
"base_response",
"forcehasync",
"(",
"Boolean",
"force",
",",
"String",
"save",
")",
"throws",
"Exception",
"{",
"hasync",
"resource",
"=",
"new",
"hasync",
"(",
")",
";",
"resource",
".",
"set_force",
"(",
"force",
")",
";",
"resource",
".",
"se... | <pre>
Use this API to force the sync in secondary Netscaler.
@param force set this to true for forcesync
@param save set this to YES,if want to save the configuration after sync.
@return status of the operation performed.
</pre> | [
"<pre",
">",
"Use",
"this",
"API",
"to",
"force",
"the",
"sync",
"in",
"secondary",
"Netscaler",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/service/nitro_service.java#L311-L320 |
dkpro/dkpro-argumentation | dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java | JCasUtil2.findTokenByBeginPosition | public static Token findTokenByBeginPosition(JCas jCas, int begin) {
"""
Returns token at the given position
@param jCas jCas
@param begin token begin position
@return Token or null
"""
for (Token token : JCasUtil.select(getInitialView(jCas), Token.class)) {
if (token.getBegin() == be... | java | public static Token findTokenByBeginPosition(JCas jCas, int begin)
{
for (Token token : JCasUtil.select(getInitialView(jCas), Token.class)) {
if (token.getBegin() == begin) {
return token;
}
}
return null;
} | [
"public",
"static",
"Token",
"findTokenByBeginPosition",
"(",
"JCas",
"jCas",
",",
"int",
"begin",
")",
"{",
"for",
"(",
"Token",
"token",
":",
"JCasUtil",
".",
"select",
"(",
"getInitialView",
"(",
"jCas",
")",
",",
"Token",
".",
"class",
")",
")",
"{",... | Returns token at the given position
@param jCas jCas
@param begin token begin position
@return Token or null | [
"Returns",
"token",
"at",
"the",
"given",
"position"
] | train | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L332-L341 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/fog/FogOfWar.java | FogOfWar.isVisited | public boolean isVisited(int tx, int ty) {
"""
In case of active fog of war, check if tile has been discovered.
@param tx The horizontal tile.
@param ty The vertical tile.
@return <code>true</code> if already discovered, <code>false</code> else.
"""
return mapHidden.getTile(tx, ty).getNumber() == ... | java | public boolean isVisited(int tx, int ty)
{
return mapHidden.getTile(tx, ty).getNumber() == MapTileFog.NO_FOG;
} | [
"public",
"boolean",
"isVisited",
"(",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"return",
"mapHidden",
".",
"getTile",
"(",
"tx",
",",
"ty",
")",
".",
"getNumber",
"(",
")",
"==",
"MapTileFog",
".",
"NO_FOG",
";",
"}"
] | In case of active fog of war, check if tile has been discovered.
@param tx The horizontal tile.
@param ty The vertical tile.
@return <code>true</code> if already discovered, <code>false</code> else. | [
"In",
"case",
"of",
"active",
"fog",
"of",
"war",
"check",
"if",
"tile",
"has",
"been",
"discovered",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/fog/FogOfWar.java#L156-L159 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java | TransformerHandlerImpl.notationDecl | public void notationDecl(String name, String publicId, String systemId)
throws SAXException {
"""
Filter a notation declaration event.
@param name The notation name.
@param publicId The notation's public identifier, or null.
@param systemId The notation's system identifier, or null.
@throws SAXExce... | java | public void notationDecl(String name, String publicId, String systemId)
throws SAXException
{
if (m_dtdHandler != null)
{
m_dtdHandler.notationDecl(name, publicId, systemId);
}
} | [
"public",
"void",
"notationDecl",
"(",
"String",
"name",
",",
"String",
"publicId",
",",
"String",
"systemId",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"m_dtdHandler",
"!=",
"null",
")",
"{",
"m_dtdHandler",
".",
"notationDecl",
"(",
"name",
",",
"publ... | Filter a notation declaration event.
@param name The notation name.
@param publicId The notation's public identifier, or null.
@param systemId The notation's system identifier, or null.
@throws SAXException The client may throw
an exception during processing.
@see org.xml.sax.DTDHandler#notationDecl | [
"Filter",
"a",
"notation",
"declaration",
"event",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java#L276-L284 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/runtime/impl/QueuedMessage.java | QueuedMessage.copyMessageToExceptionDestination | public void copyMessageToExceptionDestination(LocalTransaction tran)
throws SINotPossibleInCurrentConfigurationException, SIResourceException {
"""
Copy the message to the exception destination
@param tran can be null
@throws SIResourceException
@throws SINotPossibleInCurrentConfigurationException
"""
... | java | public void copyMessageToExceptionDestination(LocalTransaction tran)
throws SINotPossibleInCurrentConfigurationException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "copyMessageToExceptionDestination", tran);
SIMPMessage msg = getSIM... | [
"public",
"void",
"copyMessageToExceptionDestination",
"(",
"LocalTransaction",
"tran",
")",
"throws",
"SINotPossibleInCurrentConfigurationException",
",",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isE... | Copy the message to the exception destination
@param tran can be null
@throws SIResourceException
@throws SINotPossibleInCurrentConfigurationException | [
"Copy",
"the",
"message",
"to",
"the",
"exception",
"destination"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/runtime/impl/QueuedMessage.java#L385-L412 |
wanglinsong/thx-webservice | src/main/java/com/tascape/qa/th/ws/driver/EndpointHandler.java | EndpointHandler.handleGet | public void handleGet(HttpRequest request, HttpResponse response) throws HttpException, IOException {
"""
Handles GET requests by calling response updater based on uri pattern.
@param request HTTP request
@param response HTTP response
@throws HttpException in case of HTTP related issue
@throws IOException... | java | public void handleGet(HttpRequest request, HttpResponse response) throws HttpException, IOException {
String uri = request.getRequestLine().getUri();
LOG.debug("uri {}", uri);
try {
ResponseUpdater ru = this.findResponseUpdater(request);
LOG.debug("request updater {}", ru... | [
"public",
"void",
"handleGet",
"(",
"HttpRequest",
"request",
",",
"HttpResponse",
"response",
")",
"throws",
"HttpException",
",",
"IOException",
"{",
"String",
"uri",
"=",
"request",
".",
"getRequestLine",
"(",
")",
".",
"getUri",
"(",
")",
";",
"LOG",
"."... | Handles GET requests by calling response updater based on uri pattern.
@param request HTTP request
@param response HTTP response
@throws HttpException in case of HTTP related issue
@throws IOException in case of IO related issue | [
"Handles",
"GET",
"requests",
"by",
"calling",
"response",
"updater",
"based",
"on",
"uri",
"pattern",
"."
] | train | https://github.com/wanglinsong/thx-webservice/blob/29bc084b09ad35b012eb7c6b5c9ee55337ddee28/src/main/java/com/tascape/qa/th/ws/driver/EndpointHandler.java#L110-L121 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/SerIteratorFactory.java | SerIteratorFactory.navigableSet | public static final SerIterable navigableSet(final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
"""
Gets an iterable wrapper for {@code NavigableSet}.
@param valueType the value type, not null
@param valueTypeTypes the generic parameters of the value type
@return the iterable, not null
"""... | java | public static final SerIterable navigableSet(final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
final NavigableSet<Object> coll = new TreeSet<>();
return set(valueType, valueTypeTypes, coll);
} | [
"public",
"static",
"final",
"SerIterable",
"navigableSet",
"(",
"final",
"Class",
"<",
"?",
">",
"valueType",
",",
"final",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"valueTypeTypes",
")",
"{",
"final",
"NavigableSet",
"<",
"Object",
">",
"coll",
"=",
"... | Gets an iterable wrapper for {@code NavigableSet}.
@param valueType the value type, not null
@param valueTypeTypes the generic parameters of the value type
@return the iterable, not null | [
"Gets",
"an",
"iterable",
"wrapper",
"for",
"{",
"@code",
"NavigableSet",
"}",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerIteratorFactory.java#L428-L431 |
rackerlabs/clouddocs-maven-plugin | src/main/java/com/rackspace/cloud/api/docs/builders/PDFBuilder.java | PDFBuilder.createPIHandler | private PreprocessingFilter createPIHandler(EntityResolver resolver, XMLReader reader) {
"""
Creates an XML Processing handler for the built-in docbkx <code><?eval?></code> PI. This PI resolves maven
properties and basic math formula.
@param resolver The initial resolver to use.
@param reader The sour... | java | private PreprocessingFilter createPIHandler(EntityResolver resolver, XMLReader reader) {
PreprocessingFilter filter = new PreprocessingFilter(reader);
ProcessingInstructionHandler resolvingHandler = new ExpressionHandler(new VariableResolver() {
public Object resolveVariable(String name) throws ELException {
... | [
"private",
"PreprocessingFilter",
"createPIHandler",
"(",
"EntityResolver",
"resolver",
",",
"XMLReader",
"reader",
")",
"{",
"PreprocessingFilter",
"filter",
"=",
"new",
"PreprocessingFilter",
"(",
"reader",
")",
";",
"ProcessingInstructionHandler",
"resolvingHandler",
"... | Creates an XML Processing handler for the built-in docbkx <code><?eval?></code> PI. This PI resolves maven
properties and basic math formula.
@param resolver The initial resolver to use.
@param reader The source XML reader.
@return The XML PI filter. | [
"Creates",
"an",
"XML",
"Processing",
"handler",
"for",
"the",
"built",
"-",
"in",
"docbkx",
"<code",
">",
"<",
";",
"?eval?>",
";",
"<",
"/",
"code",
">",
"PI",
".",
"This",
"PI",
"resolves",
"maven",
"properties",
"and",
"basic",
"math",
"formula",... | train | https://github.com/rackerlabs/clouddocs-maven-plugin/blob/ba8554dc340db674307efdaac647c6fd2b58a34b/src/main/java/com/rackspace/cloud/api/docs/builders/PDFBuilder.java#L1106-L1124 |
EsotericSoftware/yamlbeans | src/com/esotericsoftware/yamlbeans/YamlConfig.java | YamlConfig.setPropertyDefaultType | public void setPropertyDefaultType (Class type, String propertyName, Class defaultType) {
"""
Sets the default type of a property. No tag will be output for values of this type. This type will be used if no tag is
found.
"""
if (type == null) throw new IllegalArgumentException("type cannot be null.");
i... | java | public void setPropertyDefaultType (Class type, String propertyName, Class defaultType) {
if (type == null) throw new IllegalArgumentException("type cannot be null.");
if (propertyName == null) throw new IllegalArgumentException("propertyName cannot be null.");
if (defaultType == null) throw new IllegalArgumen... | [
"public",
"void",
"setPropertyDefaultType",
"(",
"Class",
"type",
",",
"String",
"propertyName",
",",
"Class",
"defaultType",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"type cannot be null.\"",
")",
";",
"... | Sets the default type of a property. No tag will be output for values of this type. This type will be used if no tag is
found. | [
"Sets",
"the",
"default",
"type",
"of",
"a",
"property",
".",
"No",
"tag",
"will",
"be",
"output",
"for",
"values",
"of",
"this",
"type",
".",
"This",
"type",
"will",
"be",
"used",
"if",
"no",
"tag",
"is",
"found",
"."
] | train | https://github.com/EsotericSoftware/yamlbeans/blob/f5610997edbc5534fc7e9f0a91654d14742345ca/src/com/esotericsoftware/yamlbeans/YamlConfig.java#L101-L109 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/TaskGroup.java | TaskGroup.invokeAsync | public Observable<Indexable> invokeAsync(final InvocationContext context) {
"""
Invokes tasks in the group.
@param context group level shared context that need be passed to invokeAsync(cxt)
method of each task item in the group when it is selected for invocation.
@return an observable that emits the result ... | java | public Observable<Indexable> invokeAsync(final InvocationContext context) {
return Observable.defer(new Func0<Observable<Indexable>>() {
@Override
public Observable<Indexable> call() {
if (proxyTaskGroupWrapper.isActive()) {
return proxyTaskGroupWrappe... | [
"public",
"Observable",
"<",
"Indexable",
">",
"invokeAsync",
"(",
"final",
"InvocationContext",
"context",
")",
"{",
"return",
"Observable",
".",
"defer",
"(",
"new",
"Func0",
"<",
"Observable",
"<",
"Indexable",
">",
">",
"(",
")",
"{",
"@",
"Override",
... | Invokes tasks in the group.
@param context group level shared context that need be passed to invokeAsync(cxt)
method of each task item in the group when it is selected for invocation.
@return an observable that emits the result of tasks in the order they finishes. | [
"Invokes",
"tasks",
"in",
"the",
"group",
"."
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/TaskGroup.java#L239-L260 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.postEntry | @Override
public Entry postEntry(final AtomRequest areq, final Entry entry) throws AtomException {
"""
Create a new entry specified by pathInfo and posted entry. We save the submitted Atom entry
verbatim, but we do set the id and reset the update time.
@param entry Entry to be added to collection.
@param ... | java | @Override
public Entry postEntry(final AtomRequest areq, final Entry entry) throws AtomException {
LOG.debug("postEntry");
final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
final String handle = pathInfo[0];
final String collection = pathInfo[1];
final Fi... | [
"@",
"Override",
"public",
"Entry",
"postEntry",
"(",
"final",
"AtomRequest",
"areq",
",",
"final",
"Entry",
"entry",
")",
"throws",
"AtomException",
"{",
"LOG",
".",
"debug",
"(",
"\"postEntry\"",
")",
";",
"final",
"String",
"[",
"]",
"pathInfo",
"=",
"S... | Create a new entry specified by pathInfo and posted entry. We save the submitted Atom entry
verbatim, but we do set the id and reset the update time.
@param entry Entry to be added to collection.
@param areq Details of HTTP request
@throws com.rometools.rome.propono.atom.server.AtomException On invalid collection or o... | [
"Create",
"a",
"new",
"entry",
"specified",
"by",
"pathInfo",
"and",
"posted",
"entry",
".",
"We",
"save",
"the",
"submitted",
"Atom",
"entry",
"verbatim",
"but",
"we",
"do",
"set",
"the",
"id",
"and",
"reset",
"the",
"update",
"time",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L176-L191 |
google/error-prone-javac | src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/Scan.java | Scan.checkClasses | void checkClasses(ClassFile cf, CPEntries entries) throws ConstantPoolException {
"""
Checks Class_info entries in the constant pool.
@param cf the ClassFile of this class
@param entries constant pool entries collected from this class
@throws ConstantPoolException if a constant pool entry cannot be found
... | java | void checkClasses(ClassFile cf, CPEntries entries) throws ConstantPoolException {
for (ConstantPool.CONSTANT_Class_info ci : entries.classes) {
String name = nameFromRefType(ci.getName());
if (name != null) {
DeprData dd = db.getTypeDeprecated(name);
if (d... | [
"void",
"checkClasses",
"(",
"ClassFile",
"cf",
",",
"CPEntries",
"entries",
")",
"throws",
"ConstantPoolException",
"{",
"for",
"(",
"ConstantPool",
".",
"CONSTANT_Class_info",
"ci",
":",
"entries",
".",
"classes",
")",
"{",
"String",
"name",
"=",
"nameFromRefT... | Checks Class_info entries in the constant pool.
@param cf the ClassFile of this class
@param entries constant pool entries collected from this class
@throws ConstantPoolException if a constant pool entry cannot be found | [
"Checks",
"Class_info",
"entries",
"in",
"the",
"constant",
"pool",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/Scan.java#L437-L447 |
GerdHolz/TOVAL | src/de/invation/code/toval/misc/SetUtils.java | SetUtils.getRandomSubset | public static <T> Set<T> getRandomSubset(Set<T> set) {
"""
Generates a subset of <code>set</code>, that contains a random number of
elements.
@param <T>
Type of set elements
@param set
Basic set for operation
@return A subset with a random number of elements
"""
return getRandomSubsetMax(set, set.si... | java | public static <T> Set<T> getRandomSubset(Set<T> set) {
return getRandomSubsetMax(set, set.size());
} | [
"public",
"static",
"<",
"T",
">",
"Set",
"<",
"T",
">",
"getRandomSubset",
"(",
"Set",
"<",
"T",
">",
"set",
")",
"{",
"return",
"getRandomSubsetMax",
"(",
"set",
",",
"set",
".",
"size",
"(",
")",
")",
";",
"}"
] | Generates a subset of <code>set</code>, that contains a random number of
elements.
@param <T>
Type of set elements
@param set
Basic set for operation
@return A subset with a random number of elements | [
"Generates",
"a",
"subset",
"of",
"<code",
">",
"set<",
"/",
"code",
">",
"that",
"contains",
"a",
"random",
"number",
"of",
"elements",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/SetUtils.java#L30-L32 |
js-lib-com/commons | src/main/java/js/converter/CharactersConverter.java | CharactersConverter.asObject | @Override
public <T> T asObject(String string, Class<T> valueType) throws BugError {
"""
Return the first character from given string.
@throws ConverterException if given string has more than one single character.
"""
// at this point value type is guaranteed to be char or Character
if (string.lengt... | java | @Override
public <T> T asObject(String string, Class<T> valueType) throws BugError {
// at this point value type is guaranteed to be char or Character
if (string.length() > 1) {
throw new ConverterException("Trying to convert a larger string into a single character.");
}
return (T) (Character) string.... | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"asObject",
"(",
"String",
"string",
",",
"Class",
"<",
"T",
">",
"valueType",
")",
"throws",
"BugError",
"{",
"// at this point value type is guaranteed to be char or Character\r",
"if",
"(",
"string",
".",
"length",... | Return the first character from given string.
@throws ConverterException if given string has more than one single character. | [
"Return",
"the",
"first",
"character",
"from",
"given",
"string",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/converter/CharactersConverter.java#L22-L29 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/impl/calendar/AnnualCalendar.java | AnnualCalendar.setDayExcluded | public void setDayExcluded (final Calendar day, final boolean exclude) {
"""
<p>
Redefine a certain day to be excluded (true) or included (false).
</p>
"""
if (exclude)
{
if (isDayExcluded (day))
{
return;
}
m_aExcludeDays.add (day);
m_bDataSorted = false;
}... | java | public void setDayExcluded (final Calendar day, final boolean exclude)
{
if (exclude)
{
if (isDayExcluded (day))
{
return;
}
m_aExcludeDays.add (day);
m_bDataSorted = false;
}
else
{
if (!isDayExcluded (day))
{
return;
}
remov... | [
"public",
"void",
"setDayExcluded",
"(",
"final",
"Calendar",
"day",
",",
"final",
"boolean",
"exclude",
")",
"{",
"if",
"(",
"exclude",
")",
"{",
"if",
"(",
"isDayExcluded",
"(",
"day",
")",
")",
"{",
"return",
";",
"}",
"m_aExcludeDays",
".",
"add",
... | <p>
Redefine a certain day to be excluded (true) or included (false).
</p> | [
"<p",
">",
"Redefine",
"a",
"certain",
"day",
"to",
"be",
"excluded",
"(",
"true",
")",
"or",
"included",
"(",
"false",
")",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/calendar/AnnualCalendar.java#L165-L186 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/run/Parameters.java | Parameters.getAsParametersWithDefault | public Parameters getAsParametersWithDefault(String key, Parameters defaultValue) {
"""
Converts map element into an Parameters or returns default value if
conversion is not possible.
@param key a key of element to get.
@param defaultValue the default value
@return Parameters value of the element or... | java | public Parameters getAsParametersWithDefault(String key, Parameters defaultValue) {
Parameters result = getAsNullableParameters(key);
return result != null ? result : defaultValue;
} | [
"public",
"Parameters",
"getAsParametersWithDefault",
"(",
"String",
"key",
",",
"Parameters",
"defaultValue",
")",
"{",
"Parameters",
"result",
"=",
"getAsNullableParameters",
"(",
"key",
")",
";",
"return",
"result",
"!=",
"null",
"?",
"result",
":",
"defaultVal... | Converts map element into an Parameters or returns default value if
conversion is not possible.
@param key a key of element to get.
@param defaultValue the default value
@return Parameters value of the element or default value if conversion is not
supported. | [
"Converts",
"map",
"element",
"into",
"an",
"Parameters",
"or",
"returns",
"default",
"value",
"if",
"conversion",
"is",
"not",
"possible",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/run/Parameters.java#L118-L121 |
joniles/mpxj | src/main/java/net/sf/mpxj/CustomFieldContainer.java | CustomFieldContainer.getFieldByAlias | public FieldType getFieldByAlias(FieldTypeClass typeClass, String alias) {
"""
Retrieve a field from a particular entity using its alias.
@param typeClass the type of entity we are interested in
@param alias the alias
@return the field type referred to be the alias, or null if not found
"""
return m... | java | public FieldType getFieldByAlias(FieldTypeClass typeClass, String alias)
{
return m_aliasMap.get(new Pair<FieldTypeClass, String>(typeClass, alias));
} | [
"public",
"FieldType",
"getFieldByAlias",
"(",
"FieldTypeClass",
"typeClass",
",",
"String",
"alias",
")",
"{",
"return",
"m_aliasMap",
".",
"get",
"(",
"new",
"Pair",
"<",
"FieldTypeClass",
",",
"String",
">",
"(",
"typeClass",
",",
"alias",
")",
")",
";",
... | Retrieve a field from a particular entity using its alias.
@param typeClass the type of entity we are interested in
@param alias the alias
@return the field type referred to be the alias, or null if not found | [
"Retrieve",
"a",
"field",
"from",
"a",
"particular",
"entity",
"using",
"its",
"alias",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/CustomFieldContainer.java#L119-L122 |
js-lib-com/commons | src/main/java/js/lang/Config.java | Config.getAttribute | public <T> T getAttribute(String name, Class<T> type) {
"""
Get attribute value converted to requested type or null if there is no attribute with requested name.
@param name attribute name,
@param type type to converter attribute value to.
@param <T> type to convert attribute value.
@return newly created val... | java | public <T> T getAttribute(String name, Class<T> type)
{
Params.notNullOrEmpty(name, "Attribute name");
Params.notNull(type, "Attribute type");
return getAttribute(name, type, null);
} | [
"public",
"<",
"T",
">",
"T",
"getAttribute",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"Params",
".",
"notNullOrEmpty",
"(",
"name",
",",
"\"Attribute name\"",
")",
";",
"Params",
".",
"notNull",
"(",
"type",
",",
"\"Attrib... | Get attribute value converted to requested type or null if there is no attribute with requested name.
@param name attribute name,
@param type type to converter attribute value to.
@param <T> type to convert attribute value.
@return newly created value object or null if named attribute not found.
@throws IllegalArgumen... | [
"Get",
"attribute",
"value",
"converted",
"to",
"requested",
"type",
"or",
"null",
"if",
"there",
"is",
"no",
"attribute",
"with",
"requested",
"name",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/lang/Config.java#L299-L304 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.