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 |
|---|---|---|---|---|---|---|---|---|---|---|
phax/ph-commons | ph-charset/src/main/java/com/helger/charset/utf7/UTF7StyleCharsetEncoder.java | UTF7StyleCharsetEncoder._encodeBase64 | private void _encodeBase64 (final char ch, final ByteBuffer out) {
"""
<p>
Writes the bytes necessary to encode a character in <i>base 64 mode</i>.
All bytes which are fully determined will be written. The fields
<code>bitsToOutput</code> and <code>sextet</code> are used to remember the
bytes not yet fully det... | java | private void _encodeBase64 (final char ch, final ByteBuffer out)
{
if (!m_bBase64mode)
out.put (m_nShift);
m_bBase64mode = true;
m_nBitsToOutput += 16;
while (m_nBitsToOutput >= 6)
{
m_nBitsToOutput -= 6;
m_nSextet += (ch >> m_nBitsToOutput);
m_nSextet &= 0x3F;
out.pu... | [
"private",
"void",
"_encodeBase64",
"(",
"final",
"char",
"ch",
",",
"final",
"ByteBuffer",
"out",
")",
"{",
"if",
"(",
"!",
"m_bBase64mode",
")",
"out",
".",
"put",
"(",
"m_nShift",
")",
";",
"m_bBase64mode",
"=",
"true",
";",
"m_nBitsToOutput",
"+=",
"... | <p>
Writes the bytes necessary to encode a character in <i>base 64 mode</i>.
All bytes which are fully determined will be written. The fields
<code>bitsToOutput</code> and <code>sextet</code> are used to remember the
bytes not yet fully determined.
</p>
@param out
@param ch | [
"<p",
">",
"Writes",
"the",
"bytes",
"necessary",
"to",
"encode",
"a",
"character",
"in",
"<i",
">",
"base",
"64",
"mode<",
"/",
"i",
">",
".",
"All",
"bytes",
"which",
"are",
"fully",
"determined",
"will",
"be",
"written",
".",
"The",
"fields",
"<code... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-charset/src/main/java/com/helger/charset/utf7/UTF7StyleCharsetEncoder.java#L196-L211 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/VoltTrace.java | VoltTrace.beginDuration | public static TraceEvent beginDuration(String name, Object... args) {
"""
Creates a begin duration trace event. This method does not queue the
event. Call {@link TraceEventBatch#add(Supplier)} to queue the event.
"""
return new TraceEvent(TraceEventType.DURATION_BEGIN, name, null, args);
} | java | public static TraceEvent beginDuration(String name, Object... args) {
return new TraceEvent(TraceEventType.DURATION_BEGIN, name, null, args);
} | [
"public",
"static",
"TraceEvent",
"beginDuration",
"(",
"String",
"name",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"TraceEvent",
"(",
"TraceEventType",
".",
"DURATION_BEGIN",
",",
"name",
",",
"null",
",",
"args",
")",
";",
"}"
] | Creates a begin duration trace event. This method does not queue the
event. Call {@link TraceEventBatch#add(Supplier)} to queue the event. | [
"Creates",
"a",
"begin",
"duration",
"trace",
"event",
".",
"This",
"method",
"does",
"not",
"queue",
"the",
"event",
".",
"Call",
"{"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/VoltTrace.java#L473-L475 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java | JsonStringToJsonIntermediateConverter.convertSchema | @Override
public JsonArray convertSchema(String inputSchema, WorkUnitState workUnit)
throws SchemaConversionException {
"""
Take in an input schema of type string, the schema must be in JSON format
@return a JsonArray representation of the schema
"""
this.unpackComplexSchemas =
workUnit.ge... | java | @Override
public JsonArray convertSchema(String inputSchema, WorkUnitState workUnit)
throws SchemaConversionException {
this.unpackComplexSchemas =
workUnit.getPropAsBoolean(UNPACK_COMPLEX_SCHEMAS_KEY, DEFAULT_UNPACK_COMPLEX_SCHEMAS_KEY);
JsonParser jsonParser = new JsonParser();
log.info("... | [
"@",
"Override",
"public",
"JsonArray",
"convertSchema",
"(",
"String",
"inputSchema",
",",
"WorkUnitState",
"workUnit",
")",
"throws",
"SchemaConversionException",
"{",
"this",
".",
"unpackComplexSchemas",
"=",
"workUnit",
".",
"getPropAsBoolean",
"(",
"UNPACK_COMPLEX_... | Take in an input schema of type string, the schema must be in JSON format
@return a JsonArray representation of the schema | [
"Take",
"in",
"an",
"input",
"schema",
"of",
"type",
"string",
"the",
"schema",
"must",
"be",
"in",
"JSON",
"format"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java#L62-L72 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.xmlAttributeExistent | public static void xmlAttributeExistent(String path, Attribute attribute, Class<?> aClass) {
"""
Thrown if attribute is present in the xml file.
@param path xml path
@param attribute attribute present
@param aClass attribute's class
"""
throw new XmlMappingAttributeExistException (MSG.INSTANCE.message(xm... | java | public static void xmlAttributeExistent(String path, Attribute attribute, Class<?> aClass){
throw new XmlMappingAttributeExistException (MSG.INSTANCE.message(xmlMappingAttributeExistException2,attribute.getName(),aClass.getSimpleName(),path));
} | [
"public",
"static",
"void",
"xmlAttributeExistent",
"(",
"String",
"path",
",",
"Attribute",
"attribute",
",",
"Class",
"<",
"?",
">",
"aClass",
")",
"{",
"throw",
"new",
"XmlMappingAttributeExistException",
"(",
"MSG",
".",
"INSTANCE",
".",
"message",
"(",
"x... | Thrown if attribute is present in the xml file.
@param path xml path
@param attribute attribute present
@param aClass attribute's class | [
"Thrown",
"if",
"attribute",
"is",
"present",
"in",
"the",
"xml",
"file",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L303-L305 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_easyHunting_serviceName_hunting_eventToken_POST | public String billingAccount_easyHunting_serviceName_hunting_eventToken_POST(String billingAccount, String serviceName, OvhTokenExpirationEnum expiration) throws IOException {
"""
Create a new token
REST: POST /telephony/{billingAccount}/easyHunting/{serviceName}/hunting/eventToken
@param expiration [required]... | java | public String billingAccount_easyHunting_serviceName_hunting_eventToken_POST(String billingAccount, String serviceName, OvhTokenExpirationEnum expiration) throws IOException {
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/hunting/eventToken";
StringBuilder sb = path(qPath, billingAccount, se... | [
"public",
"String",
"billingAccount_easyHunting_serviceName_hunting_eventToken_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhTokenExpirationEnum",
"expiration",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAcc... | Create a new token
REST: POST /telephony/{billingAccount}/easyHunting/{serviceName}/hunting/eventToken
@param expiration [required] Time to live in seconds for the token
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Create",
"a",
"new",
"token"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L2313-L2320 |
drewnoakes/metadata-extractor | Source/com/drew/metadata/exif/ExifReader.java | ExifReader.extract | public void extract(@NotNull final RandomAccessReader reader, @NotNull final Metadata metadata, int readerOffset, @Nullable Directory parentDirectory) {
"""
Reads TIFF formatted Exif data at a specified offset within a {@link RandomAccessReader}.
"""
ExifTiffHandler exifTiffHandler = new ExifTiffHandle... | java | public void extract(@NotNull final RandomAccessReader reader, @NotNull final Metadata metadata, int readerOffset, @Nullable Directory parentDirectory)
{
ExifTiffHandler exifTiffHandler = new ExifTiffHandler(metadata, parentDirectory);
try {
// Read the TIFF-formatted Exif data
... | [
"public",
"void",
"extract",
"(",
"@",
"NotNull",
"final",
"RandomAccessReader",
"reader",
",",
"@",
"NotNull",
"final",
"Metadata",
"metadata",
",",
"int",
"readerOffset",
",",
"@",
"Nullable",
"Directory",
"parentDirectory",
")",
"{",
"ExifTiffHandler",
"exifTif... | Reads TIFF formatted Exif data at a specified offset within a {@link RandomAccessReader}. | [
"Reads",
"TIFF",
"formatted",
"Exif",
"data",
"at",
"a",
"specified",
"offset",
"within",
"a",
"{"
] | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/metadata/exif/ExifReader.java#L81-L101 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/proxy/AbstractIndirectionHandler.java | AbstractIndirectionHandler.getBroker | protected TemporaryBrokerWrapper getBroker() throws PBFactoryException {
"""
Gets the persistence broker used by this indirection handler.
If no PBKey is available a runtime exception will be thrown.
@return a PersistenceBroker
"""
PersistenceBrokerInternal broker;
boolean needsClose = fa... | java | protected TemporaryBrokerWrapper getBroker() throws PBFactoryException
{
PersistenceBrokerInternal broker;
boolean needsClose = false;
if (getBrokerKey() == null)
{
/*
arminw:
if no PBKey is set we throw an exception, because we don't
... | [
"protected",
"TemporaryBrokerWrapper",
"getBroker",
"(",
")",
"throws",
"PBFactoryException",
"{",
"PersistenceBrokerInternal",
"broker",
";",
"boolean",
"needsClose",
"=",
"false",
";",
"if",
"(",
"getBrokerKey",
"(",
")",
"==",
"null",
")",
"{",
"/*\r\n ... | Gets the persistence broker used by this indirection handler.
If no PBKey is available a runtime exception will be thrown.
@return a PersistenceBroker | [
"Gets",
"the",
"persistence",
"broker",
"used",
"by",
"this",
"indirection",
"handler",
".",
"If",
"no",
"PBKey",
"is",
"available",
"a",
"runtime",
"exception",
"will",
"be",
"thrown",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/proxy/AbstractIndirectionHandler.java#L180-L205 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/CertificatesInner.java | CertificatesInner.createOrUpdateAsync | public Observable<CertificateInner> createOrUpdateAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope) {
"""
Create or update a certificate.
Create or update a certificate.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the ... | java | public Observable<CertificateInner> createOrUpdateAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope).map(new Func1<ServiceResponse<CertificateInner>, CertificateInner>() {
@O... | [
"public",
"Observable",
"<",
"CertificateInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"CertificateInner",
"certificateEnvelope",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",... | Create or update a certificate.
Create or update a certificate.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the certificate.
@param certificateEnvelope Details of certificate, if it exists already.
@throws IllegalArgumentException thrown if parameters fail the... | [
"Create",
"or",
"update",
"a",
"certificate",
".",
"Create",
"or",
"update",
"a",
"certificate",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/CertificatesInner.java#L466-L473 |
rpuch/xremoting | xremoting-core/src/main/java/com/googlecode/xremoting/core/commonshttpclient/HttpClientBuilder.java | HttpClientBuilder.keyStore | public HttpClientBuilder keyStore(URL url, String password) {
"""
Configures a key store for the current SSL host (see
{@link #ssl(String)}). If set, SSL server validation will be used (i.e.
the server certificate will be requested and validated).
@param url URL from which to obtain key store
@param passwor... | java | public HttpClientBuilder keyStore(URL url, String password) {
if (sslHostConfig == null) {
throw new IllegalStateException("ssl(String) must be called before this");
}
sslHostConfig.keyStoreUrl = url;
sslHostConfig.keyStorePassword = password;
return this;
} | [
"public",
"HttpClientBuilder",
"keyStore",
"(",
"URL",
"url",
",",
"String",
"password",
")",
"{",
"if",
"(",
"sslHostConfig",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"ssl(String) must be called before this\"",
")",
";",
"}",
"sslHo... | Configures a key store for the current SSL host (see
{@link #ssl(String)}). If set, SSL server validation will be used (i.e.
the server certificate will be requested and validated).
@param url URL from which to obtain key store
@param password key store password
@return this
@see #ssl(String)
@see #trustKeyStore(URL,... | [
"Configures",
"a",
"key",
"store",
"for",
"the",
"current",
"SSL",
"host",
"(",
"see",
"{",
"@link",
"#ssl",
"(",
"String",
")",
"}",
")",
".",
"If",
"set",
"SSL",
"server",
"validation",
"will",
"be",
"used",
"(",
"i",
".",
"e",
".",
"the",
"serve... | train | https://github.com/rpuch/xremoting/blob/519b640e5225652a8c23e10e5cab71827636a8b1/xremoting-core/src/main/java/com/googlecode/xremoting/core/commonshttpclient/HttpClientBuilder.java#L209-L216 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserWpt.java | AbstractGpxParserWpt.initialise | public void initialise(XMLReader reader, AbstractGpxParserDefault parent) {
"""
Create a new specific parser. It has in memory the default parser, the
contentBuffer, the elementNames and the currentPoint.
@param reader The XMLReader used in the default class
@param parent The parser used in the default class
... | java | public void initialise(XMLReader reader, AbstractGpxParserDefault parent) {
setReader(reader);
setParent(parent);
setContentBuffer(parent.getContentBuffer());
setWptPreparedStmt(parent.getWptPreparedStmt());
setElementNames(parent.getElementNames());
setCurrentPoint(paren... | [
"public",
"void",
"initialise",
"(",
"XMLReader",
"reader",
",",
"AbstractGpxParserDefault",
"parent",
")",
"{",
"setReader",
"(",
"reader",
")",
";",
"setParent",
"(",
"parent",
")",
";",
"setContentBuffer",
"(",
"parent",
".",
"getContentBuffer",
"(",
")",
"... | Create a new specific parser. It has in memory the default parser, the
contentBuffer, the elementNames and the currentPoint.
@param reader The XMLReader used in the default class
@param parent The parser used in the default class | [
"Create",
"a",
"new",
"specific",
"parser",
".",
"It",
"has",
"in",
"memory",
"the",
"default",
"parser",
"the",
"contentBuffer",
"the",
"elementNames",
"and",
"the",
"currentPoint",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/AbstractGpxParserWpt.java#L48-L55 |
lessthanoptimal/ddogleg | src/org/ddogleg/solver/FitQuadratic1D.java | FitQuadratic1D.process | public boolean process( int offset , int length , double ...data ) {
"""
Computes polynomial coefficients for the given data.
@param length Number of elements in data with relevant data.
@param data Set of observation data.
@return true if successful or false if it fails.
"""
if( data.length < 3 )
th... | java | public boolean process( int offset , int length , double ...data ) {
if( data.length < 3 )
throw new IllegalArgumentException("At least three points");
A.reshape(data.length,3);
y.reshape(data.length,1);
int indexDst = 0;
int indexSrc = offset;
for( int i = 0; i < length; i++ ) {
double d = data[ind... | [
"public",
"boolean",
"process",
"(",
"int",
"offset",
",",
"int",
"length",
",",
"double",
"...",
"data",
")",
"{",
"if",
"(",
"data",
".",
"length",
"<",
"3",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"At least three points\"",
")",
";",
"A"... | Computes polynomial coefficients for the given data.
@param length Number of elements in data with relevant data.
@param data Set of observation data.
@return true if successful or false if it fails. | [
"Computes",
"polynomial",
"coefficients",
"for",
"the",
"given",
"data",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/solver/FitQuadratic1D.java#L52-L77 |
protostuff/protostuff | protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeSchema.java | RuntimeSchema.getSchemaWrapper | static <T> HasSchema<T> getSchemaWrapper(Class<T> typeClass) {
"""
Returns the schema wrapper.
<p>
Method overload for backwards compatibility.
"""
return getSchemaWrapper(typeClass, ID_STRATEGY);
} | java | static <T> HasSchema<T> getSchemaWrapper(Class<T> typeClass)
{
return getSchemaWrapper(typeClass, ID_STRATEGY);
} | [
"static",
"<",
"T",
">",
"HasSchema",
"<",
"T",
">",
"getSchemaWrapper",
"(",
"Class",
"<",
"T",
">",
"typeClass",
")",
"{",
"return",
"getSchemaWrapper",
"(",
"typeClass",
",",
"ID_STRATEGY",
")",
";",
"}"
] | Returns the schema wrapper.
<p>
Method overload for backwards compatibility. | [
"Returns",
"the",
"schema",
"wrapper",
".",
"<p",
">",
"Method",
"overload",
"for",
"backwards",
"compatibility",
"."
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-runtime/src/main/java/io/protostuff/runtime/RuntimeSchema.java#L157-L160 |
Ellzord/JALSE | src/main/java/jalse/actions/Actions.java | Actions.copy | public static <T> void copy(final ActionContext<T> source, final SchedulableActionContext<T> target) {
"""
Copies context information to a target context (actor, bindings, initial delay and period).
@param source
Source context.
@param target
Target context.
"""
target.setActor(source.getActor());
targ... | java | public static <T> void copy(final ActionContext<T> source, final SchedulableActionContext<T> target) {
target.setActor(source.getActor());
target.putAll(source.toMap());
target.setInitialDelay(target.getInitialDelay(TimeUnit.NANOSECONDS), TimeUnit.NANOSECONDS);
target.setPeriod(source.getPeriod(TimeUnit.NANOSECONDS... | [
"public",
"static",
"<",
"T",
">",
"void",
"copy",
"(",
"final",
"ActionContext",
"<",
"T",
">",
"source",
",",
"final",
"SchedulableActionContext",
"<",
"T",
">",
"target",
")",
"{",
"target",
".",
"setActor",
"(",
"source",
".",
"getActor",
"(",
")",
... | Copies context information to a target context (actor, bindings, initial delay and period).
@param source
Source context.
@param target
Target context. | [
"Copies",
"context",
"information",
"to",
"a",
"target",
"context",
"(",
"actor",
"bindings",
"initial",
"delay",
"and",
"period",
")",
"."
] | train | https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/actions/Actions.java#L39-L44 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/ExportApi.java | ExportApi.getExportHistory | public ExportHistoryResponse getExportHistory(String trialId, Integer count, Integer offset) throws ApiException {
"""
Get Export History
Get the history of export requests.
@param trialId Filter by trialId. (optional)
@param count Pagination count. (optional)
@param offset Pagination offset. (optional)
@retu... | java | public ExportHistoryResponse getExportHistory(String trialId, Integer count, Integer offset) throws ApiException {
ApiResponse<ExportHistoryResponse> resp = getExportHistoryWithHttpInfo(trialId, count, offset);
return resp.getData();
} | [
"public",
"ExportHistoryResponse",
"getExportHistory",
"(",
"String",
"trialId",
",",
"Integer",
"count",
",",
"Integer",
"offset",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ExportHistoryResponse",
">",
"resp",
"=",
"getExportHistoryWithHttpInfo",
"(",
... | Get Export History
Get the history of export requests.
@param trialId Filter by trialId. (optional)
@param count Pagination count. (optional)
@param offset Pagination offset. (optional)
@return ExportHistoryResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Get",
"Export",
"History",
"Get",
"the",
"history",
"of",
"export",
"requests",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/ExportApi.java#L247-L250 |
code4everything/util | src/main/java/com/zhazhapan/util/dialog/Alerts.java | Alerts.showWarning | public static Optional<ButtonType> showWarning(String title, String header, String content) {
"""
弹出警告框
@param title 标题
@param header 信息头
@param content 内容
@return {@link ButtonType}
"""
return alert(title, header, content, AlertType.WARNING);
} | java | public static Optional<ButtonType> showWarning(String title, String header, String content) {
return alert(title, header, content, AlertType.WARNING);
} | [
"public",
"static",
"Optional",
"<",
"ButtonType",
">",
"showWarning",
"(",
"String",
"title",
",",
"String",
"header",
",",
"String",
"content",
")",
"{",
"return",
"alert",
"(",
"title",
",",
"header",
",",
"content",
",",
"AlertType",
".",
"WARNING",
")... | 弹出警告框
@param title 标题
@param header 信息头
@param content 内容
@return {@link ButtonType} | [
"弹出警告框"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/dialog/Alerts.java#L70-L72 |
loadcoder/chart-extensions | src/main/java/com/loadcoder/load/jfreechartfixes/XYLineAndShapeRendererExtention.java | XYLineAndShapeRendererExtention.getLegendItem | @Override
public LegendItem getLegendItem(int datasetIndex, int series) {
"""
/*
The purpose of this override is to change the behaviour for the visibility of the legend
and how the color of the legend is set.
"""
XYPlot plot = getPlot();
if (plot == null) {
return null;
}
XYDataset datas... | java | @Override
public LegendItem getLegendItem(int datasetIndex, int series) {
XYPlot plot = getPlot();
if (plot == null) {
return null;
}
XYDataset dataset = plot.getDataset(datasetIndex);
if (dataset == null) {
return null;
}
//jfreechart diff: set the line paint with the implementation ... | [
"@",
"Override",
"public",
"LegendItem",
"getLegendItem",
"(",
"int",
"datasetIndex",
",",
"int",
"series",
")",
"{",
"XYPlot",
"plot",
"=",
"getPlot",
"(",
")",
";",
"if",
"(",
"plot",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"XYDataset",
"... | /*
The purpose of this override is to change the behaviour for the visibility of the legend
and how the color of the legend is set. | [
"/",
"*",
"The",
"purpose",
"of",
"this",
"override",
"is",
"to",
"change",
"the",
"behaviour",
"for",
"the",
"visibility",
"of",
"the",
"legend",
"and",
"how",
"the",
"color",
"of",
"the",
"legend",
"is",
"set",
"."
] | train | https://github.com/loadcoder/chart-extensions/blob/ded73ad337d18072b3fd4b1b4e3b7a581567d76d/src/main/java/com/loadcoder/load/jfreechartfixes/XYLineAndShapeRendererExtention.java#L59-L112 |
Hygieia/Hygieia | collectors/build/jenkins/src/main/java/com/capitalone/dashboard/collector/DefaultHudsonClient.java | DefaultHudsonClient.joinURL | public static String joinURL(String base, String[] paths) {
"""
join a base url to another path or paths - this will handle trailing or non-trailing /'s
"""
StringBuilder result = new StringBuilder(base);
Arrays.stream(paths).map(path -> path.replaceFirst("^(\\/)+", "")).forEach(p -> {
... | java | public static String joinURL(String base, String[] paths) {
StringBuilder result = new StringBuilder(base);
Arrays.stream(paths).map(path -> path.replaceFirst("^(\\/)+", "")).forEach(p -> {
if (result.lastIndexOf("/") != result.length() - 1) {
result.append('/');
... | [
"public",
"static",
"String",
"joinURL",
"(",
"String",
"base",
",",
"String",
"[",
"]",
"paths",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
"base",
")",
";",
"Arrays",
".",
"stream",
"(",
"paths",
")",
".",
"map",
"(",
"pat... | join a base url to another path or paths - this will handle trailing or non-trailing /'s | [
"join",
"a",
"base",
"url",
"to",
"another",
"path",
"or",
"paths",
"-",
"this",
"will",
"handle",
"trailing",
"or",
"non",
"-",
"trailing",
"/",
"s"
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/build/jenkins/src/main/java/com/capitalone/dashboard/collector/DefaultHudsonClient.java#L691-L700 |
deephacks/confit | core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/AbstractConfigObject.java | AbstractConfigObject.peekPath | protected AbstractConfigValue peekPath(Path path, ResolveContext context) throws NotPossibleToResolve {
"""
Looks up the path with no transformation, type conversion, or exceptions
(just returns null if path not found). Does however resolve the path, if
resolver != null.
@throws NotPossibleToResolve
if conte... | java | protected AbstractConfigValue peekPath(Path path, ResolveContext context) throws NotPossibleToResolve {
return peekPath(this, path, context);
} | [
"protected",
"AbstractConfigValue",
"peekPath",
"(",
"Path",
"path",
",",
"ResolveContext",
"context",
")",
"throws",
"NotPossibleToResolve",
"{",
"return",
"peekPath",
"(",
"this",
",",
"path",
",",
"context",
")",
";",
"}"
] | Looks up the path with no transformation, type conversion, or exceptions
(just returns null if path not found). Does however resolve the path, if
resolver != null.
@throws NotPossibleToResolve
if context is not null and resolution fails | [
"Looks",
"up",
"the",
"path",
"with",
"no",
"transformation",
"type",
"conversion",
"or",
"exceptions",
"(",
"just",
"returns",
"null",
"if",
"path",
"not",
"found",
")",
".",
"Does",
"however",
"resolve",
"the",
"path",
"if",
"resolver",
"!",
"=",
"null",... | train | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/core/src/main/java/org/deephacks/confit/internal/core/property/typesafe/impl/AbstractConfigObject.java#L95-L97 |
JoeKerouac/utils | src/main/java/com/joe/utils/reflect/BeanUtils.java | BeanUtils.convert | public static Map<String, Object> convert(Object pojo,
Class<? extends Annotation> annotationType) {
"""
将pojo的所有字段映射为map,默认包含null值
@param pojo pojo
@param annotationType 别名注解类型,支持{@link JsonProperty JsonProperty}和{@link XmlNode XmlNode}
@return map,当poj... | java | public static Map<String, Object> convert(Object pojo,
Class<? extends Annotation> annotationType) {
return convert(pojo, annotationType, true);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"convert",
"(",
"Object",
"pojo",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
")",
"{",
"return",
"convert",
"(",
"pojo",
",",
"annotationType",
",",
"true",
")",
"... | 将pojo的所有字段映射为map,默认包含null值
@param pojo pojo
@param annotationType 别名注解类型,支持{@link JsonProperty JsonProperty}和{@link XmlNode XmlNode}
@return map,当pojo为null时返回空map | [
"将pojo的所有字段映射为map,默认包含null值"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/reflect/BeanUtils.java#L40-L43 |
looly/hutool | hutool-socket/src/main/java/cn/hutool/socket/aio/AioServer.java | AioServer.setOption | public <T> AioServer setOption(SocketOption<T> name, T value) throws IOException {
"""
设置 Socket 的 Option 选项<br>
选项见:{@link java.net.StandardSocketOptions}
@param <T> 选项泛型
@param name {@link SocketOption} 枚举
@param value SocketOption参数
@throws IOException IO异常
"""
this.channel.setOption(name, value);... | java | public <T> AioServer setOption(SocketOption<T> name, T value) throws IOException {
this.channel.setOption(name, value);
return this;
} | [
"public",
"<",
"T",
">",
"AioServer",
"setOption",
"(",
"SocketOption",
"<",
"T",
">",
"name",
",",
"T",
"value",
")",
"throws",
"IOException",
"{",
"this",
".",
"channel",
".",
"setOption",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
... | 设置 Socket 的 Option 选项<br>
选项见:{@link java.net.StandardSocketOptions}
@param <T> 选项泛型
@param name {@link SocketOption} 枚举
@param value SocketOption参数
@throws IOException IO异常 | [
"设置",
"Socket",
"的",
"Option",
"选项<br",
">",
"选项见:",
"{",
"@link",
"java",
".",
"net",
".",
"StandardSocketOptions",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-socket/src/main/java/cn/hutool/socket/aio/AioServer.java#L95-L98 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/tools/Model.java | Model.setMaxValue | public void setMaxValue(final double MAX_VALUE) {
"""
Sets the maximum value that will be used for the calculation
of the nice maximum vlaue for the scale.
@param MAX_VALUE
"""
// check min-max values
if (Double.compare(MAX_VALUE, minValue) == 0) {
throw new IllegalArgumentExcepti... | java | public void setMaxValue(final double MAX_VALUE) {
// check min-max values
if (Double.compare(MAX_VALUE, minValue) == 0) {
throw new IllegalArgumentException("Max value cannot be equal to min value");
}
if (Double.compare(MAX_VALUE, minValue) < 0) {
maxValue = min... | [
"public",
"void",
"setMaxValue",
"(",
"final",
"double",
"MAX_VALUE",
")",
"{",
"// check min-max values",
"if",
"(",
"Double",
".",
"compare",
"(",
"MAX_VALUE",
",",
"minValue",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Max... | Sets the maximum value that will be used for the calculation
of the nice maximum vlaue for the scale.
@param MAX_VALUE | [
"Sets",
"the",
"maximum",
"value",
"that",
"will",
"be",
"used",
"for",
"the",
"calculation",
"of",
"the",
"nice",
"maximum",
"vlaue",
"for",
"the",
"scale",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/tools/Model.java#L386-L402 |
Azure/azure-sdk-for-java | containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersInner.java | ContainersInner.listLogsAsync | public Observable<LogsInner> listLogsAsync(String resourceGroupName, String containerGroupName, String containerName) {
"""
Get the logs for a specified container instance.
Get the logs for a specified container instance in a specified resource group and container group.
@param resourceGroupName The name of th... | java | public Observable<LogsInner> listLogsAsync(String resourceGroupName, String containerGroupName, String containerName) {
return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1<ServiceResponse<LogsInner>, LogsInner>() {
@Override
public ... | [
"public",
"Observable",
"<",
"LogsInner",
">",
"listLogsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerGroupName",
",",
"String",
"containerName",
")",
"{",
"return",
"listLogsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"containerGroupN... | Get the logs for a specified container instance.
Get the logs for a specified container instance in a specified resource group and container group.
@param resourceGroupName The name of the resource group.
@param containerGroupName The name of the container group.
@param containerName The name of the container instance... | [
"Get",
"the",
"logs",
"for",
"a",
"specified",
"container",
"instance",
".",
"Get",
"the",
"logs",
"for",
"a",
"specified",
"container",
"instance",
"in",
"a",
"specified",
"resource",
"group",
"and",
"container",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersInner.java#L109-L116 |
allcolor/YaHP-Converter | YaHPConverter/src/org/allcolor/yahp/converter/CClassLoader.java | CClassLoader.addClass | public final void addClass(final String className, final URL urlToClass) {
"""
add a class to known class
@param className
class name
@param urlToClass
url to class file
"""
if ((className == null) || (urlToClass == null)) {
return;
}
if (!this.classesMap.containsKey(className)) {
this.class... | java | public final void addClass(final String className, final URL urlToClass) {
if ((className == null) || (urlToClass == null)) {
return;
}
if (!this.classesMap.containsKey(className)) {
this.classesMap.put(className, urlToClass);
}
} | [
"public",
"final",
"void",
"addClass",
"(",
"final",
"String",
"className",
",",
"final",
"URL",
"urlToClass",
")",
"{",
"if",
"(",
"(",
"className",
"==",
"null",
")",
"||",
"(",
"urlToClass",
"==",
"null",
")",
")",
"{",
"return",
";",
"}",
"if",
"... | add a class to known class
@param className
class name
@param urlToClass
url to class file | [
"add",
"a",
"class",
"to",
"known",
"class"
] | train | https://github.com/allcolor/YaHP-Converter/blob/d72745281766a784a6b319f3787aa1d8de7cd0fe/YaHPConverter/src/org/allcolor/yahp/converter/CClassLoader.java#L1292-L1300 |
Nordstrom/JUnit-Foundation | src/main/java/com/nordstrom/automation/junit/RetryHandler.java | RetryHandler.isRetriable | static boolean isRetriable(final FrameworkMethod method, final Throwable thrown) {
"""
Determine if the specified failed test should be retried.
@param method failed test method
@param thrown exception for this failed test
@return {@code true} if test should be retried; otherwise {@code false}
"""
... | java | static boolean isRetriable(final FrameworkMethod method, final Throwable thrown) {
synchronized(retryAnalyzerLoader) {
for (JUnitRetryAnalyzer analyzer : retryAnalyzerLoader) {
if (analyzer.retry(method, thrown)) {
return true;
}
... | [
"static",
"boolean",
"isRetriable",
"(",
"final",
"FrameworkMethod",
"method",
",",
"final",
"Throwable",
"thrown",
")",
"{",
"synchronized",
"(",
"retryAnalyzerLoader",
")",
"{",
"for",
"(",
"JUnitRetryAnalyzer",
"analyzer",
":",
"retryAnalyzerLoader",
")",
"{",
... | Determine if the specified failed test should be retried.
@param method failed test method
@param thrown exception for this failed test
@return {@code true} if test should be retried; otherwise {@code false} | [
"Determine",
"if",
"the",
"specified",
"failed",
"test",
"should",
"be",
"retried",
"."
] | train | https://github.com/Nordstrom/JUnit-Foundation/blob/f24d91f8677d262c27d18ef29ed633eaac717be5/src/main/java/com/nordstrom/automation/junit/RetryHandler.java#L129-L138 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/dfx/RectangularPrism3dfx.java | RectangularPrism3dfx.depthProperty | @Pure
public DoubleProperty depthProperty() {
"""
Replies the property that is the depth of the box.
@return the depth property.
"""
if (this.depth == null) {
this.depth = new ReadOnlyDoubleWrapper(this, MathFXAttributeNames.DEPTH);
this.depth.bind(Bindings.subtract(maxZProperty(), minZProperty()))... | java | @Pure
public DoubleProperty depthProperty() {
if (this.depth == null) {
this.depth = new ReadOnlyDoubleWrapper(this, MathFXAttributeNames.DEPTH);
this.depth.bind(Bindings.subtract(maxZProperty(), minZProperty()));
}
return this.depth;
} | [
"@",
"Pure",
"public",
"DoubleProperty",
"depthProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"depth",
"==",
"null",
")",
"{",
"this",
".",
"depth",
"=",
"new",
"ReadOnlyDoubleWrapper",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"DEPTH",
")",
";",
... | Replies the property that is the depth of the box.
@return the depth property. | [
"Replies",
"the",
"property",
"that",
"is",
"the",
"depth",
"of",
"the",
"box",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/dfx/RectangularPrism3dfx.java#L404-L411 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java | CompressorHttp2ConnectionEncoder.newCompressionChannel | private EmbeddedChannel newCompressionChannel(final ChannelHandlerContext ctx, ZlibWrapper wrapper) {
"""
Generate a new instance of an {@link EmbeddedChannel} capable of compressing data
@param ctx the context.
@param wrapper Defines what type of encoder should be used
"""
return new EmbeddedChannel... | java | private EmbeddedChannel newCompressionChannel(final ChannelHandlerContext ctx, ZlibWrapper wrapper) {
return new EmbeddedChannel(ctx.channel().id(), ctx.channel().metadata().hasDisconnect(),
ctx.channel().config(), ZlibCodecFactory.newZlibEncoder(wrapper, compressionLevel, windowBits,
... | [
"private",
"EmbeddedChannel",
"newCompressionChannel",
"(",
"final",
"ChannelHandlerContext",
"ctx",
",",
"ZlibWrapper",
"wrapper",
")",
"{",
"return",
"new",
"EmbeddedChannel",
"(",
"ctx",
".",
"channel",
"(",
")",
".",
"id",
"(",
")",
",",
"ctx",
".",
"chann... | Generate a new instance of an {@link EmbeddedChannel} capable of compressing data
@param ctx the context.
@param wrapper Defines what type of encoder should be used | [
"Generate",
"a",
"new",
"instance",
"of",
"an",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java#L222-L226 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClient.java | ManagementClient.subscriptionExists | public Boolean subscriptionExists(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException {
"""
Checks whether a given subscription exists or not.
@param topicPath - Path of the topic
@param subscriptionName - Name of the subscription.
@return - True if the entity exists. Fal... | java | public Boolean subscriptionExists(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException {
return Utils.completeFuture(this.asyncClient.subscriptionExistsAsync(topicPath, subscriptionName));
} | [
"public",
"Boolean",
"subscriptionExists",
"(",
"String",
"topicPath",
",",
"String",
"subscriptionName",
")",
"throws",
"ServiceBusException",
",",
"InterruptedException",
"{",
"return",
"Utils",
".",
"completeFuture",
"(",
"this",
".",
"asyncClient",
".",
"subscript... | Checks whether a given subscription exists or not.
@param topicPath - Path of the topic
@param subscriptionName - Name of the subscription.
@return - True if the entity exists. False otherwise.
@throws IllegalArgumentException - path is not null / empty / too long / invalid.
@throws TimeoutException - The operation tim... | [
"Checks",
"whether",
"a",
"given",
"subscription",
"exists",
"or",
"not",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClient.java#L535-L537 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java | AbstractExecutableMemberWriter.addTypeParameters | protected void addTypeParameters(ExecutableMemberDoc member, Content htmltree) {
"""
Add the type parameters for the executable member.
@param member the member to write type parameters for.
@param htmltree the content tree to which the parameters will be added.
"""
Content typeParameters = getType... | java | protected void addTypeParameters(ExecutableMemberDoc member, Content htmltree) {
Content typeParameters = getTypeParameters(member);
if (!typeParameters.isEmpty()) {
htmltree.addContent(typeParameters);
htmltree.addContent(writer.getSpace());
}
} | [
"protected",
"void",
"addTypeParameters",
"(",
"ExecutableMemberDoc",
"member",
",",
"Content",
"htmltree",
")",
"{",
"Content",
"typeParameters",
"=",
"getTypeParameters",
"(",
"member",
")",
";",
"if",
"(",
"!",
"typeParameters",
".",
"isEmpty",
"(",
")",
")",... | Add the type parameters for the executable member.
@param member the member to write type parameters for.
@param htmltree the content tree to which the parameters will be added. | [
"Add",
"the",
"type",
"parameters",
"for",
"the",
"executable",
"member",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java#L63-L69 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java | ActiveSyncManager.recoverFromStartSync | public void recoverFromStartSync(AlluxioURI uri, long mountId) {
"""
Recover from start sync operation.
@param uri uri to start sync
@param mountId mount id of the uri
"""
// if the init sync has been launched, we need to stop it
if (mSyncPathStatus.containsKey(uri)) {
Future<?> syncFuture = ... | java | public void recoverFromStartSync(AlluxioURI uri, long mountId) {
// if the init sync has been launched, we need to stop it
if (mSyncPathStatus.containsKey(uri)) {
Future<?> syncFuture = mSyncPathStatus.remove(uri);
if (syncFuture != null) {
syncFuture.cancel(true);
}
}
// if t... | [
"public",
"void",
"recoverFromStartSync",
"(",
"AlluxioURI",
"uri",
",",
"long",
"mountId",
")",
"{",
"// if the init sync has been launched, we need to stop it",
"if",
"(",
"mSyncPathStatus",
".",
"containsKey",
"(",
"uri",
")",
")",
"{",
"Future",
"<",
"?",
">",
... | Recover from start sync operation.
@param uri uri to start sync
@param mountId mount id of the uri | [
"Recover",
"from",
"start",
"sync",
"operation",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java#L655-L670 |
prolificinteractive/material-calendarview | library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java | MaterialCalendarView.selectRange | public void selectRange(final CalendarDay firstDay, final CalendarDay lastDay) {
"""
Select a fresh range of date including first day and last day.
@param firstDay first day of the range to select
@param lastDay last day of the range to select
"""
if (firstDay == null || lastDay == null) {
return... | java | public void selectRange(final CalendarDay firstDay, final CalendarDay lastDay) {
if (firstDay == null || lastDay == null) {
return;
} else if (firstDay.isAfter(lastDay)) {
adapter.selectRange(lastDay, firstDay);
dispatchOnRangeSelected(adapter.getSelectedDates());
} else {
adapter.se... | [
"public",
"void",
"selectRange",
"(",
"final",
"CalendarDay",
"firstDay",
",",
"final",
"CalendarDay",
"lastDay",
")",
"{",
"if",
"(",
"firstDay",
"==",
"null",
"||",
"lastDay",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"firstDay",
"... | Select a fresh range of date including first day and last day.
@param firstDay first day of the range to select
@param lastDay last day of the range to select | [
"Select",
"a",
"fresh",
"range",
"of",
"date",
"including",
"first",
"day",
"and",
"last",
"day",
"."
] | train | https://github.com/prolificinteractive/material-calendarview/blob/04fae8175fd034d0a7131f8cb253cae883a88aa2/library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java#L1451-L1461 |
zaproxy/zaproxy | src/org/parosproxy/paros/network/HttpMethodHelper.java | HttpMethodHelper.createRequestMethod | public HttpMethod createRequestMethod(HttpRequestHeader header, HttpBody body) throws URIException {
"""
may be replaced by the New method - however the New method is not yet fully tested so this is stil used.
"""
return createRequestMethod(header, body, null);
} | java | public HttpMethod createRequestMethod(HttpRequestHeader header, HttpBody body) throws URIException {
return createRequestMethod(header, body, null);
} | [
"public",
"HttpMethod",
"createRequestMethod",
"(",
"HttpRequestHeader",
"header",
",",
"HttpBody",
"body",
")",
"throws",
"URIException",
"{",
"return",
"createRequestMethod",
"(",
"header",
",",
"body",
",",
"null",
")",
";",
"}"
] | may be replaced by the New method - however the New method is not yet fully tested so this is stil used. | [
"may",
"be",
"replaced",
"by",
"the",
"New",
"method",
"-",
"however",
"the",
"New",
"method",
"is",
"not",
"yet",
"fully",
"tested",
"so",
"this",
"is",
"stil",
"used",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/HttpMethodHelper.java#L136-L138 |
michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/ListPreference.java | ListPreference.createListItemListener | private OnClickListener createListItemListener() {
"""
Creates and returns a listener, which allows to persist the value a list item, which is
clicked by the user.
@return The listener, which has been created, as an instance of the type {@link
OnClickListener}
"""
return new OnClickListener() {
... | java | private OnClickListener createListItemListener() {
return new OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
selectedIndex = which;
ListPreference.this.onClick(dialog, DialogInterface.BUTTON_POSITIVE);
... | [
"private",
"OnClickListener",
"createListItemListener",
"(",
")",
"{",
"return",
"new",
"OnClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onClick",
"(",
"final",
"DialogInterface",
"dialog",
",",
"final",
"int",
"which",
")",
"{",
"selectedIn... | Creates and returns a listener, which allows to persist the value a list item, which is
clicked by the user.
@return The listener, which has been created, as an instance of the type {@link
OnClickListener} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"persist",
"the",
"value",
"a",
"list",
"item",
"which",
"is",
"clicked",
"by",
"the",
"user",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ListPreference.java#L134-L144 |
akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/maven/CeylonInstall.java | CeylonInstall.installAdditional | void installAdditional(final File installedFile, final String fileExt, final String payload, final boolean chop)
throws MojoExecutionException {
"""
Installs additional files into the same repo directory as the artifact.
@param installedFile The artifact to which this additional file is related
@p... | java | void installAdditional(final File installedFile, final String fileExt, final String payload, final boolean chop)
throws MojoExecutionException {
File additionalFile = null;
if (chop) {
String path = installedFile.getAbsolutePath();
additionalFile = new File(path.... | [
"void",
"installAdditional",
"(",
"final",
"File",
"installedFile",
",",
"final",
"String",
"fileExt",
",",
"final",
"String",
"payload",
",",
"final",
"boolean",
"chop",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"additionalFile",
"=",
"null",
";",
"... | Installs additional files into the same repo directory as the artifact.
@param installedFile The artifact to which this additional file is related
@param fileExt The full file name or extension (begins with .) of the additional file
@param payload The String to write to the additional file
@param chop True of it repla... | [
"Installs",
"additional",
"files",
"into",
"the",
"same",
"repo",
"directory",
"as",
"the",
"artifact",
"."
] | train | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstall.java#L289-L309 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/sql/parse/GremlinParser.java | GremlinParser.parse | public SchemaTableTree parse(SchemaTable schemaTable, ReplacedStepTree replacedStepTree) {
"""
This is only called for vertex steps.
Constructs the label paths from the given schemaTable to the leaf vertex labels for the gremlin query.
For each path Sqlg will executeRegularQuery a sql query. The union of the que... | java | public SchemaTableTree parse(SchemaTable schemaTable, ReplacedStepTree replacedStepTree) {
ReplacedStep<?, ?> rootReplacedStep = replacedStepTree.root().getReplacedStep();
Preconditions.checkArgument(!rootReplacedStep.isGraphStep(), "Expected VertexStep, found GraphStep");
Set<SchemaTableTree> ... | [
"public",
"SchemaTableTree",
"parse",
"(",
"SchemaTable",
"schemaTable",
",",
"ReplacedStepTree",
"replacedStepTree",
")",
"{",
"ReplacedStep",
"<",
"?",
",",
"?",
">",
"rootReplacedStep",
"=",
"replacedStepTree",
".",
"root",
"(",
")",
".",
"getReplacedStep",
"("... | This is only called for vertex steps.
Constructs the label paths from the given schemaTable to the leaf vertex labels for the gremlin query.
For each path Sqlg will executeRegularQuery a sql query. The union of the queries is the result the gremlin query.
The vertex labels can be calculated from the steps.
@param sche... | [
"This",
"is",
"only",
"called",
"for",
"vertex",
"steps",
".",
"Constructs",
"the",
"label",
"paths",
"from",
"the",
"given",
"schemaTable",
"to",
"the",
"leaf",
"vertex",
"labels",
"for",
"the",
"gremlin",
"query",
".",
"For",
"each",
"path",
"Sqlg",
"wil... | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/sql/parse/GremlinParser.java#L53-L71 |
zaproxy/zaproxy | src/org/parosproxy/paros/network/SSLConnector.java | SSLConnector.createSocket | @Override
public Socket createSocket(final String host, final int port,
final InetAddress localAddress, final int localPort,
final HttpConnectionParams params) throws IOException,
UnknownHostException, ConnectTimeoutException {
"""
Attempts to get a new socket connection to the given host within the
... | java | @Override
public Socket createSocket(final String host, final int port,
final InetAddress localAddress, final int localPort,
final HttpConnectionParams params) throws IOException,
UnknownHostException, ConnectTimeoutException {
if (params == null) {
throw new IllegalArgumentException("Parameters ma... | [
"@",
"Override",
"public",
"Socket",
"createSocket",
"(",
"final",
"String",
"host",
",",
"final",
"int",
"port",
",",
"final",
"InetAddress",
"localAddress",
",",
"final",
"int",
"localPort",
",",
"final",
"HttpConnectionParams",
"params",
")",
"throws",
"IOExc... | Attempts to get a new socket connection to the given host within the
given time limit.
@param host
the host name/IP
@param port
the port on the host
@param localAddress
the local host name/IP to bind the socket to
@param localPort
the port on the local machine
@param params
{@link HttpConnectionParams Http connection ... | [
"Attempts",
"to",
"get",
"a",
"new",
"socket",
"connection",
"to",
"the",
"given",
"host",
"within",
"the",
"given",
"time",
"limit",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/SSLConnector.java#L409-L445 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AsCodeGen.java | AsCodeGen.writeImport | @Override
public void writeImport(Definition def, Writer out) throws IOException {
"""
Output class import
@param def definition
@param out Writer
@throws IOException ioException
"""
out.write("package " + def.getRaPackage() + ".inflow;\n\n");
importLogging(def, out);
if (def.isUseAn... | java | @Override
public void writeImport(Definition def, Writer out) throws IOException
{
out.write("package " + def.getRaPackage() + ".inflow;\n\n");
importLogging(def, out);
if (def.isUseAnnotation())
{
out.write("import javax.resource.spi.Activation;");
writeEol(out);
... | [
"@",
"Override",
"public",
"void",
"writeImport",
"(",
"Definition",
"def",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"\"package \"",
"+",
"def",
".",
"getRaPackage",
"(",
")",
"+",
"\".inflow;\\n\\n\"",
")",
";",
"... | Output class import
@param def definition
@param out Writer
@throws IOException ioException | [
"Output",
"class",
"import"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AsCodeGen.java#L146-L176 |
pmlopes/yoke | framework/src/main/java/com/jetdrone/vertx/yoke/middleware/YokeRequest.java | YokeRequest.destroySession | public void destroySession() {
"""
Destroys a session from the request context and also from the storage engine.
"""
JsonObject session = get("session");
if (session == null) {
return;
}
String sessionId = session.getString("id");
// remove from the context
... | java | public void destroySession() {
JsonObject session = get("session");
if (session == null) {
return;
}
String sessionId = session.getString("id");
// remove from the context
put("session", null);
if (sessionId == null) {
return;
}
... | [
"public",
"void",
"destroySession",
"(",
")",
"{",
"JsonObject",
"session",
"=",
"get",
"(",
"\"session\"",
")",
";",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"return",
";",
"}",
"String",
"sessionId",
"=",
"session",
".",
"getString",
"(",
"\"id\""... | Destroys a session from the request context and also from the storage engine. | [
"Destroys",
"a",
"session",
"from",
"the",
"request",
"context",
"and",
"also",
"from",
"the",
"storage",
"engine",
"."
] | train | https://github.com/pmlopes/yoke/blob/fe8a64036f09fb745f0644faddd46162d64faf3c/framework/src/main/java/com/jetdrone/vertx/yoke/middleware/YokeRequest.java#L317-L340 |
puniverse/galaxy | src/main/java/co/paralleluniverse/common/io/Streamables.java | Streamables.writeBuffer | public static void writeBuffer(DataOutput out, ByteBuffer buffer) throws IOException {
"""
Writes the given {@link ByteBuffer} into the given {@link DataOutput}.
@param out The {@link DataOutput} into which the buffer will be written.
@param buffer The buffer to write into the {@link DataOutput}.
@throws IOEx... | java | public static void writeBuffer(DataOutput out, ByteBuffer buffer) throws IOException {
if (buffer.hasArray()) {
out.write(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining());
buffer.position(buffer.limit());
} else {
final byte[] array =... | [
"public",
"static",
"void",
"writeBuffer",
"(",
"DataOutput",
"out",
",",
"ByteBuffer",
"buffer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"buffer",
".",
"hasArray",
"(",
")",
")",
"{",
"out",
".",
"write",
"(",
"buffer",
".",
"array",
"(",
")",
"... | Writes the given {@link ByteBuffer} into the given {@link DataOutput}.
@param out The {@link DataOutput} into which the buffer will be written.
@param buffer The buffer to write into the {@link DataOutput}.
@throws IOException | [
"Writes",
"the",
"given",
"{",
"@link",
"ByteBuffer",
"}",
"into",
"the",
"given",
"{",
"@link",
"DataOutput",
"}",
"."
] | train | https://github.com/puniverse/galaxy/blob/1d077532c4a5bcd6c52ff670770c31e98420ff63/src/main/java/co/paralleluniverse/common/io/Streamables.java#L106-L116 |
sriharshachilakapati/WebGL4J | webgl4j/src/main/java/com/shc/webgl4j/client/WebGL10.java | WebGL10.glBindRenderbuffer | public static void glBindRenderbuffer(int target, int renderBuffer) {
"""
<p>{@code glBindRenderbuffer} binds the renderbuffer object with name renderbuffer to the renderbuffer target
specified by target. target must be {@code GL_RENDERBUFFER}. {@code renderbuffer} is the name of a renderbuffer
object previously... | java | public static void glBindRenderbuffer(int target, int renderBuffer)
{
checkContextCompatibility();
nglBindRenderbuffer(target, WebGLObjectMap.get().toRenderBuffer(renderBuffer));
} | [
"public",
"static",
"void",
"glBindRenderbuffer",
"(",
"int",
"target",
",",
"int",
"renderBuffer",
")",
"{",
"checkContextCompatibility",
"(",
")",
";",
"nglBindRenderbuffer",
"(",
"target",
",",
"WebGLObjectMap",
".",
"get",
"(",
")",
".",
"toRenderBuffer",
"(... | <p>{@code glBindRenderbuffer} binds the renderbuffer object with name renderbuffer to the renderbuffer target
specified by target. target must be {@code GL_RENDERBUFFER}. {@code renderbuffer} is the name of a renderbuffer
object previously returned from a call to {@link #glCreateRenderbuffer()}, or zero to break the ex... | [
"<p",
">",
"{",
"@code",
"glBindRenderbuffer",
"}",
"binds",
"the",
"renderbuffer",
"object",
"with",
"name",
"renderbuffer",
"to",
"the",
"renderbuffer",
"target",
"specified",
"by",
"target",
".",
"target",
"must",
"be",
"{",
"@code",
"GL_RENDERBUFFER",
"}",
... | train | https://github.com/sriharshachilakapati/WebGL4J/blob/7daa425300b08b338b50cef2935289849c92d415/webgl4j/src/main/java/com/shc/webgl4j/client/WebGL10.java#L618-L622 |
apache/flink | flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java | HadoopInputs.readSequenceFile | public static <K, V> HadoopInputFormat<K, V> readSequenceFile(Class<K> key, Class<V> value, String inputPath) throws IOException {
"""
Creates a Flink {@link InputFormat} to read a Hadoop sequence file for the given key and value classes.
@return A Flink InputFormat that wraps a Hadoop SequenceFileInputFormat.
... | java | public static <K, V> HadoopInputFormat<K, V> readSequenceFile(Class<K> key, Class<V> value, String inputPath) throws IOException {
return readHadoopFile(new org.apache.hadoop.mapred.SequenceFileInputFormat<K, V>(), key, value, inputPath);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"HadoopInputFormat",
"<",
"K",
",",
"V",
">",
"readSequenceFile",
"(",
"Class",
"<",
"K",
">",
"key",
",",
"Class",
"<",
"V",
">",
"value",
",",
"String",
"inputPath",
")",
"throws",
"IOException",
"{",
"r... | Creates a Flink {@link InputFormat} to read a Hadoop sequence file for the given key and value classes.
@return A Flink InputFormat that wraps a Hadoop SequenceFileInputFormat. | [
"Creates",
"a",
"Flink",
"{",
"@link",
"InputFormat",
"}",
"to",
"read",
"a",
"Hadoop",
"sequence",
"file",
"for",
"the",
"given",
"key",
"and",
"value",
"classes",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java#L71-L73 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java | ArtifactorySearch.processResponse | protected List<MavenArtifact> processResponse(Dependency dependency, HttpURLConnection conn) throws IOException {
"""
Process the Artifactory response.
@param dependency the dependency
@param conn the HTTP URL Connection
@return a list of the Maven Artifact information
@throws IOException thrown if there is ... | java | protected List<MavenArtifact> processResponse(Dependency dependency, HttpURLConnection conn) throws IOException {
final JsonObject asJsonObject;
try (final InputStreamReader streamReader = new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)) {
asJsonObject = new JsonParser()... | [
"protected",
"List",
"<",
"MavenArtifact",
">",
"processResponse",
"(",
"Dependency",
"dependency",
",",
"HttpURLConnection",
"conn",
")",
"throws",
"IOException",
"{",
"final",
"JsonObject",
"asJsonObject",
";",
"try",
"(",
"final",
"InputStreamReader",
"streamReader... | Process the Artifactory response.
@param dependency the dependency
@param conn the HTTP URL Connection
@return a list of the Maven Artifact information
@throws IOException thrown if there is an I/O error | [
"Process",
"the",
"Artifactory",
"response",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java#L196-L234 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/BasePrepareStatement.java | BasePrepareStatement.setTimestamp | public void setTimestamp(final int parameterIndex, final Timestamp timestamp)
throws SQLException {
"""
Sets the designated parameter to the given <code>java.sql.Timestamp</code> value. The driver
converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the database.
@param parameterIndex... | java | public void setTimestamp(final int parameterIndex, final Timestamp timestamp)
throws SQLException {
if (timestamp == null) {
setNull(parameterIndex, ColumnType.DATETIME);
return;
}
setParameter(parameterIndex,
new TimestampParameter(timestamp, protocol.getTimeZone(), useFractionalS... | [
"public",
"void",
"setTimestamp",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"Timestamp",
"timestamp",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"timestamp",
"==",
"null",
")",
"{",
"setNull",
"(",
"parameterIndex",
",",
"ColumnType",
".",
"DATE... | Sets the designated parameter to the given <code>java.sql.Timestamp</code> value. The driver
converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the database.
@param parameterIndex the first parameter is 1, the second is 2, ...
@param timestamp the parameter value
@throws SQLException if para... | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"<code",
">",
"java",
".",
"sql",
".",
"Timestamp<",
"/",
"code",
">",
"value",
".",
"The",
"driver",
"converts",
"this",
"to",
"an",
"SQL",
"<code",
">",
"TIMESTAMP<",
"/",
"code",
">",
"... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/BasePrepareStatement.java#L615-L624 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.domain_zone_option_optionName_GET | public OvhPrice domain_zone_option_optionName_GET(net.minidev.ovh.api.price.domain.zone.OvhOptionEnum optionName) throws IOException {
"""
Get price of zone options
REST: GET /price/domain/zone/option/{optionName}
@param optionName [required] Option
"""
String qPath = "/price/domain/zone/option/{optionNa... | java | public OvhPrice domain_zone_option_optionName_GET(net.minidev.ovh.api.price.domain.zone.OvhOptionEnum optionName) throws IOException {
String qPath = "/price/domain/zone/option/{optionName}";
StringBuilder sb = path(qPath, optionName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp... | [
"public",
"OvhPrice",
"domain_zone_option_optionName_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"domain",
".",
"zone",
".",
"OvhOptionEnum",
"optionName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/price/doma... | Get price of zone options
REST: GET /price/domain/zone/option/{optionName}
@param optionName [required] Option | [
"Get",
"price",
"of",
"zone",
"options"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L284-L289 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataIntersectionOfImpl_CustomFieldSerializer.java | OWLDataIntersectionOfImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataIntersectionOfImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.goog... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataIntersectionOfImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDataIntersectionOfImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataIntersectionOfImpl_CustomFieldSerializer.java#L89-L92 |
datacleaner/DataCleaner | engine/core/src/main/java/org/datacleaner/output/csv/CsvOutputWriterFactory.java | CsvOutputWriterFactory.getWriter | public static OutputWriter getWriter(final String filename, final List<InputColumn<?>> columns) {
"""
Creates a CSV output writer with default configuration
@param filename
@param columns
@return
"""
final InputColumn<?>[] columnArray = columns.toArray(new InputColumn<?>[columns.size()]);
... | java | public static OutputWriter getWriter(final String filename, final List<InputColumn<?>> columns) {
final InputColumn<?>[] columnArray = columns.toArray(new InputColumn<?>[columns.size()]);
final String[] headers = new String[columnArray.length];
for (int i = 0; i < headers.length; i++) {
... | [
"public",
"static",
"OutputWriter",
"getWriter",
"(",
"final",
"String",
"filename",
",",
"final",
"List",
"<",
"InputColumn",
"<",
"?",
">",
">",
"columns",
")",
"{",
"final",
"InputColumn",
"<",
"?",
">",
"[",
"]",
"columnArray",
"=",
"columns",
".",
"... | Creates a CSV output writer with default configuration
@param filename
@param columns
@return | [
"Creates",
"a",
"CSV",
"output",
"writer",
"with",
"default",
"configuration"
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/core/src/main/java/org/datacleaner/output/csv/CsvOutputWriterFactory.java#L47-L54 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/Resources.java | Resources.getResourceAsStream | @Pure
public static InputStream getResourceAsStream(ClassLoader classLoader, Package packagename, String path) {
"""
Replies the input stream of a resource.
<p>You may use Unix-like syntax to write the resource path, ie.
you may use slashes to separate filenames.
<p>The name of {@code packagename} is trans... | java | @Pure
public static InputStream getResourceAsStream(ClassLoader classLoader, Package packagename, String path) {
if (packagename == null || path == null) {
return null;
}
final StringBuilder b = new StringBuilder();
b.append(packagename.getName().replaceAll(
Pattern.quote("."), //$NON-NLS-1$
Matcher... | [
"@",
"Pure",
"public",
"static",
"InputStream",
"getResourceAsStream",
"(",
"ClassLoader",
"classLoader",
",",
"Package",
"packagename",
",",
"String",
"path",
")",
"{",
"if",
"(",
"packagename",
"==",
"null",
"||",
"path",
"==",
"null",
")",
"{",
"return",
... | Replies the input stream of a resource.
<p>You may use Unix-like syntax to write the resource path, ie.
you may use slashes to separate filenames.
<p>The name of {@code packagename} is translated into a resource
path (by replacing the dots by slashes) and the given path
is append to. For example, the two following co... | [
"Replies",
"the",
"input",
"stream",
"of",
"a",
"resource",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/Resources.java#L244-L262 |
zeroturnaround/maven-jrebel-plugin | src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java | GenerateRebelMojo.getPluginSetting | private String getPluginSetting(MavenProject project, String pluginId, String optionName, String defaultValue) {
"""
Search for a configuration setting of an other plugin.
@param project the current maven project to get the configuration from.
@param pluginId the group id and artifact id of the plugin... | java | private String getPluginSetting(MavenProject project, String pluginId, String optionName, String defaultValue) {
Xpp3Dom dom = getPluginConfigurationDom(project, pluginId);
if (dom != null && dom.getChild(optionName) != null) {
return getValue(project, dom.getChild(optionName));
}
return defaultVa... | [
"private",
"String",
"getPluginSetting",
"(",
"MavenProject",
"project",
",",
"String",
"pluginId",
",",
"String",
"optionName",
",",
"String",
"defaultValue",
")",
"{",
"Xpp3Dom",
"dom",
"=",
"getPluginConfigurationDom",
"(",
"project",
",",
"pluginId",
")",
";",... | Search for a configuration setting of an other plugin.
@param project the current maven project to get the configuration from.
@param pluginId the group id and artifact id of the plugin to search for
@param optionName the option to get from the configuration
@param defaultValue the default value if the conf... | [
"Search",
"for",
"a",
"configuration",
"setting",
"of",
"an",
"other",
"plugin",
"."
] | train | https://github.com/zeroturnaround/maven-jrebel-plugin/blob/6a0d12529a13ae6b2b772658a714398147c091ca/src/main/java/org/zeroturnaround/javarebel/maven/GenerateRebelMojo.java#L760-L766 |
motown-io/motown | domain/core-api/src/main/java/io/motown/domain/api/chargingstation/TransactionIdFactory.java | TransactionIdFactory.createTransactionId | public static TransactionId createTransactionId(String transactionNumber, ChargingStationId chargingStationId, String protocol) {
"""
Creates {@code NumberedTransactionId} or {@code UUIDTransactionId} by inspecting the provided transactionId String.
@param transactionNumber the String to create into a Transac... | java | public static TransactionId createTransactionId(String transactionNumber, ChargingStationId chargingStationId, String protocol) {
return Ints.tryParse(checkNotNull(transactionNumber)) != null
? new NumberedTransactionId(chargingStationId, protocol, Ints.tryParse(transactionNumber))
... | [
"public",
"static",
"TransactionId",
"createTransactionId",
"(",
"String",
"transactionNumber",
",",
"ChargingStationId",
"chargingStationId",
",",
"String",
"protocol",
")",
"{",
"return",
"Ints",
".",
"tryParse",
"(",
"checkNotNull",
"(",
"transactionNumber",
")",
"... | Creates {@code NumberedTransactionId} or {@code UUIDTransactionId} by inspecting the provided transactionId String.
@param transactionNumber the String to create into a TransactionId
@param chargingStationId the chargingstation id
@param protocol the protocol identifier
@return a {@code Transaction... | [
"Creates",
"{"
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/domain/core-api/src/main/java/io/motown/domain/api/chargingstation/TransactionIdFactory.java#L41-L45 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebGroup.java | WebGroup.addWebApplication | @SuppressWarnings("unchecked")
public void addWebApplication(DeployedModule deployedModule, List extensionFactories)
throws Throwable {
"""
BEGIN: NEVER INVOKED BY WEBSPHERE APPLICATION SERVER (Common Component Specific)
"""
WebAppConfiguration wConfig = deployedModule.getWebAppConfig();
String... | java | @SuppressWarnings("unchecked")
public void addWebApplication(DeployedModule deployedModule, List extensionFactories)
throws Throwable
{
WebAppConfiguration wConfig = deployedModule.getWebAppConfig();
String displayName = wConfig.getDisplayName();
logger.logp(Level.INFO, CLASS_NAME,"addWebApplication"... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"addWebApplication",
"(",
"DeployedModule",
"deployedModule",
",",
"List",
"extensionFactories",
")",
"throws",
"Throwable",
"{",
"WebAppConfiguration",
"wConfig",
"=",
"deployedModule",
".",
"getWebA... | BEGIN: NEVER INVOKED BY WEBSPHERE APPLICATION SERVER (Common Component Specific) | [
"BEGIN",
":",
"NEVER",
"INVOKED",
"BY",
"WEBSPHERE",
"APPLICATION",
"SERVER",
"(",
"Common",
"Component",
"Specific",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebGroup.java#L108-L133 |
aalmiray/Json-lib | src/main/java/net/sf/json/JsonConfig.java | JsonConfig.findJsonValueProcessor | public JsonValueProcessor findJsonValueProcessor( Class propertyType, String key ) {
"""
Finds a JsonValueProcessor.<br>
It will search the registered JsonValueProcessors in the following order:
<ol>
<li>key</li>
<li>type</li>
</ol>
Returns null if none is registered.<br>
[Java -> JSON]
@param propert... | java | public JsonValueProcessor findJsonValueProcessor( Class propertyType, String key ) {
JsonValueProcessor jsonValueProcessor = null;
jsonValueProcessor = (JsonValueProcessor) keyMap.get( key );
if( jsonValueProcessor != null ) {
return jsonValueProcessor;
}
Object tkey = jsonValueP... | [
"public",
"JsonValueProcessor",
"findJsonValueProcessor",
"(",
"Class",
"propertyType",
",",
"String",
"key",
")",
"{",
"JsonValueProcessor",
"jsonValueProcessor",
"=",
"null",
";",
"jsonValueProcessor",
"=",
"(",
"JsonValueProcessor",
")",
"keyMap",
".",
"get",
"(",
... | Finds a JsonValueProcessor.<br>
It will search the registered JsonValueProcessors in the following order:
<ol>
<li>key</li>
<li>type</li>
</ol>
Returns null if none is registered.<br>
[Java -> JSON]
@param propertyType the type of the property
@param key the name of the property which may belong to the target class | [
"Finds",
"a",
"JsonValueProcessor",
".",
"<br",
">",
"It",
"will",
"search",
"the",
"registered",
"JsonValueProcessors",
"in",
"the",
"following",
"order",
":",
"<ol",
">",
"<li",
">",
"key<",
"/",
"li",
">",
"<li",
">",
"type<",
"/",
"li",
">",
"<",
"... | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JsonConfig.java#L398-L412 |
elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/VALPNormDistance.java | VALPNormDistance.initializeLookupTable | private void initializeLookupTable(double[][] splitPositions, NumberVector query, double p) {
"""
Initialize the lookup table.
@param splitPositions Split positions
@param query Query vector
@param p p
"""
final int dimensions = splitPositions.length;
final int bordercount = splitPositions[0].leng... | java | private void initializeLookupTable(double[][] splitPositions, NumberVector query, double p) {
final int dimensions = splitPositions.length;
final int bordercount = splitPositions[0].length;
lookup = new double[dimensions][bordercount];
for(int d = 0; d < dimensions; d++) {
final double val = query... | [
"private",
"void",
"initializeLookupTable",
"(",
"double",
"[",
"]",
"[",
"]",
"splitPositions",
",",
"NumberVector",
"query",
",",
"double",
"p",
")",
"{",
"final",
"int",
"dimensions",
"=",
"splitPositions",
".",
"length",
";",
"final",
"int",
"bordercount",... | Initialize the lookup table.
@param splitPositions Split positions
@param query Query vector
@param p p | [
"Initialize",
"the",
"lookup",
"table",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/vafile/VALPNormDistance.java#L157-L167 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/TransactionWitness.java | TransactionWitness.redeemP2WPKH | public static TransactionWitness redeemP2WPKH(@Nullable TransactionSignature signature, ECKey pubKey) {
"""
Creates the stack pushes necessary to redeem a P2WPKH output. If given signature is null, an empty push will be
used as a placeholder.
"""
checkArgument(pubKey.isCompressed(), "only compressed k... | java | public static TransactionWitness redeemP2WPKH(@Nullable TransactionSignature signature, ECKey pubKey) {
checkArgument(pubKey.isCompressed(), "only compressed keys allowed");
TransactionWitness witness = new TransactionWitness(2);
witness.setPush(0, signature != null ? signature.encodeToBitcoin()... | [
"public",
"static",
"TransactionWitness",
"redeemP2WPKH",
"(",
"@",
"Nullable",
"TransactionSignature",
"signature",
",",
"ECKey",
"pubKey",
")",
"{",
"checkArgument",
"(",
"pubKey",
".",
"isCompressed",
"(",
")",
",",
"\"only compressed keys allowed\"",
")",
";",
"... | Creates the stack pushes necessary to redeem a P2WPKH output. If given signature is null, an empty push will be
used as a placeholder. | [
"Creates",
"the",
"stack",
"pushes",
"necessary",
"to",
"redeem",
"a",
"P2WPKH",
"output",
".",
"If",
"given",
"signature",
"is",
"null",
"an",
"empty",
"push",
"will",
"be",
"used",
"as",
"a",
"placeholder",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/TransactionWitness.java#L36-L42 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.publishProject | public CmsUUID publishProject(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws CmsException {
"""
Publishes the resources of a specified publish list.<p>
@param cms the current request context
@param publishList a publish list
@param report an instance of <code>{@link I_CmsReport}</code> ... | java | public CmsUUID publishProject(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws CmsException {
CmsRequestContext context = cms.getRequestContext();
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
// check if the current user has the required pu... | [
"public",
"CmsUUID",
"publishProject",
"(",
"CmsObject",
"cms",
",",
"CmsPublishList",
"publishList",
",",
"I_CmsReport",
"report",
")",
"throws",
"CmsException",
"{",
"CmsRequestContext",
"context",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
";",
"CmsDbContext... | Publishes the resources of a specified publish list.<p>
@param cms the current request context
@param publishList a publish list
@param report an instance of <code>{@link I_CmsReport}</code> to print messages
@return the publish history id of the published project
@throws CmsException if something goes wrong
@see #... | [
"Publishes",
"the",
"resources",
"of",
"a",
"specified",
"publish",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L3854-L3866 |
Red5/red5-server-common | src/main/java/org/red5/server/util/HttpConnectionUtil.java | HttpConnectionUtil.getClient | public static final HttpClient getClient(int timeout) {
"""
Returns a client with all our selected properties / params.
@param timeout
- socket timeout to set
@return client
"""
HttpClientBuilder client = HttpClientBuilder.create();
// set the connection manager
client.setConnec... | java | public static final HttpClient getClient(int timeout) {
HttpClientBuilder client = HttpClientBuilder.create();
// set the connection manager
client.setConnectionManager(connectionManager);
// dont retry
client.setRetryHandler(new DefaultHttpRequestRetryHandler(0, false));
... | [
"public",
"static",
"final",
"HttpClient",
"getClient",
"(",
"int",
"timeout",
")",
"{",
"HttpClientBuilder",
"client",
"=",
"HttpClientBuilder",
".",
"create",
"(",
")",
";",
"// set the connection manager\r",
"client",
".",
"setConnectionManager",
"(",
"connectionMa... | Returns a client with all our selected properties / params.
@param timeout
- socket timeout to set
@return client | [
"Returns",
"a",
"client",
"with",
"all",
"our",
"selected",
"properties",
"/",
"params",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/HttpConnectionUtil.java#L77-L96 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.mixin | public static void mixin(Class self, List<Class> categoryClasses) {
"""
Extend class globally with category methods.
All methods for given class and all super classes will be added to the class.
@param self any Class
@param categoryClasses a category classes to use
@since 1.6.0
"""
mixin... | java | public static void mixin(Class self, List<Class> categoryClasses) {
mixin(getMetaClass(self), categoryClasses);
} | [
"public",
"static",
"void",
"mixin",
"(",
"Class",
"self",
",",
"List",
"<",
"Class",
">",
"categoryClasses",
")",
"{",
"mixin",
"(",
"getMetaClass",
"(",
"self",
")",
",",
"categoryClasses",
")",
";",
"}"
] | Extend class globally with category methods.
All methods for given class and all super classes will be added to the class.
@param self any Class
@param categoryClasses a category classes to use
@since 1.6.0 | [
"Extend",
"class",
"globally",
"with",
"category",
"methods",
".",
"All",
"methods",
"for",
"given",
"class",
"and",
"all",
"super",
"classes",
"will",
"be",
"added",
"to",
"the",
"class",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L578-L580 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/tai/TAISubjectUtils.java | TAISubjectUtils.createResult | @FFDCIgnore(SettingCustomPropertiesException.class)
public TAIResult createResult(HttpServletResponse res, SocialLoginConfig clientConfig) throws WebTrustAssociationFailedException, SocialLoginException {
"""
Populates a series of custom properties based on the user API response tokens/string and JWT used to i... | java | @FFDCIgnore(SettingCustomPropertiesException.class)
public TAIResult createResult(HttpServletResponse res, SocialLoginConfig clientConfig) throws WebTrustAssociationFailedException, SocialLoginException {
Hashtable<String, Object> customProperties = new Hashtable<String, Object>();
try {
... | [
"@",
"FFDCIgnore",
"(",
"SettingCustomPropertiesException",
".",
"class",
")",
"public",
"TAIResult",
"createResult",
"(",
"HttpServletResponse",
"res",
",",
"SocialLoginConfig",
"clientConfig",
")",
"throws",
"WebTrustAssociationFailedException",
",",
"SocialLoginException",... | Populates a series of custom properties based on the user API response tokens/string and JWT used to instantiate the
object, builds a subject using those custom properties as private credentials, and returns a TAIResult with the produced
username and subject. | [
"Populates",
"a",
"series",
"of",
"custom",
"properties",
"based",
"on",
"the",
"user",
"API",
"response",
"tokens",
"/",
"string",
"and",
"JWT",
"used",
"to",
"instantiate",
"the",
"object",
"builds",
"a",
"subject",
"using",
"those",
"custom",
"properties",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/tai/TAISubjectUtils.java#L87-L98 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/ObjectUtils.java | ObjectUtils.caseInsensitiveValueOf | public static <E extends Enum<?>> E caseInsensitiveValueOf(E[] enumValues, String constant) {
"""
Case insensitive alternative to {@link Enum#valueOf(Class, String)}.
@param <E> the concrete Enum type
@param enumValues the array of all Enum constants in question, usually per
Enum.values()
@param const... | java | public static <E extends Enum<?>> E caseInsensitiveValueOf(E[] enumValues, String constant) {
for (E candidate : enumValues) {
if (candidate.toString().equalsIgnoreCase(constant)) {
return candidate;
}
}
throw new IllegalArgumentException(String.format("co... | [
"public",
"static",
"<",
"E",
"extends",
"Enum",
"<",
"?",
">",
">",
"E",
"caseInsensitiveValueOf",
"(",
"E",
"[",
"]",
"enumValues",
",",
"String",
"constant",
")",
"{",
"for",
"(",
"E",
"candidate",
":",
"enumValues",
")",
"{",
"if",
"(",
"candidate"... | Case insensitive alternative to {@link Enum#valueOf(Class, String)}.
@param <E> the concrete Enum type
@param enumValues the array of all Enum constants in question, usually per
Enum.values()
@param constant the constant to get the enum value of
@throws IllegalArgumentException if the given constant is not fo... | [
"Case",
"insensitive",
"alternative",
"to",
"{",
"@link",
"Enum#valueOf",
"(",
"Class",
"String",
")",
"}",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/ObjectUtils.java#L187-L195 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.withReader | public static <T> T withReader(File file, @ClosureParams(value = SimpleType.class, options = "java.io.BufferedReader") Closure<T> closure) throws IOException {
"""
Create a new BufferedReader for this file and then
passes it into the closure, ensuring the reader is closed after the
closure returns.
@param fil... | java | public static <T> T withReader(File file, @ClosureParams(value = SimpleType.class, options = "java.io.BufferedReader") Closure<T> closure) throws IOException {
return IOGroovyMethods.withReader(newReader(file), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withReader",
"(",
"File",
"file",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.BufferedReader\"",
")",
"Closure",
"<",
"T",
">",
"closure",
")",
"throws",... | Create a new BufferedReader for this file and then
passes it into the closure, ensuring the reader is closed after the
closure returns.
@param file a file object
@param closure a closure
@return the value returned by the closure
@throws IOException if an IOException occurs.
@since 1.5.2 | [
"Create",
"a",
"new",
"BufferedReader",
"for",
"this",
"file",
"and",
"then",
"passes",
"it",
"into",
"the",
"closure",
"ensuring",
"the",
"reader",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1772-L1774 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedBackupShortTermRetentionPoliciesInner.java | ManagedBackupShortTermRetentionPoliciesInner.getAsync | public Observable<ManagedBackupShortTermRetentionPolicyInner> getAsync(String resourceGroupName, String managedInstanceName, String databaseName) {
"""
Gets a managed database's short term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this v... | java | public Observable<ManagedBackupShortTermRetentionPolicyInner> getAsync(String resourceGroupName, String managedInstanceName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName).map(new Func1<ServiceResponse<ManagedBackupShortTermRetentionPolicyInner>, ... | [
"public",
"Observable",
"<",
"ManagedBackupShortTermRetentionPolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"String",
"databaseName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Gets a managed database's short term retention policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param managedInstanceName The name of the managed instance.
@param databaseName The name of the databa... | [
"Gets",
"a",
"managed",
"database",
"s",
"short",
"term",
"retention",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ManagedBackupShortTermRetentionPoliciesInner.java#L131-L138 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.addGaussian | public static void addGaussian(InterleavedS16 input, Random rand , double sigma , int lowerBound , int upperBound ) {
"""
Adds Gaussian/normal i.i.d noise to each pixel in the image. If a value exceeds the specified
it will be set to the closest bound.
@param input Input image. Modified.
@param rand Random nu... | java | public static void addGaussian(InterleavedS16 input, Random rand , double sigma , int lowerBound , int upperBound ) {
int length = input.width*input.numBands;
for (int y = 0; y < input.height; y++) {
int index = input.getStartIndex() + y * input.getStride();
int indexEnd = index+length;
while( index < in... | [
"public",
"static",
"void",
"addGaussian",
"(",
"InterleavedS16",
"input",
",",
"Random",
"rand",
",",
"double",
"sigma",
",",
"int",
"lowerBound",
",",
"int",
"upperBound",
")",
"{",
"int",
"length",
"=",
"input",
".",
"width",
"*",
"input",
".",
"numBand... | Adds Gaussian/normal i.i.d noise to each pixel in the image. If a value exceeds the specified
it will be set to the closest bound.
@param input Input image. Modified.
@param rand Random number generator.
@param sigma Distributions standard deviation.
@param lowerBound Allowed lower bound
@param upperBound Allowed upp... | [
"Adds",
"Gaussian",
"/",
"normal",
"i",
".",
"i",
".",
"d",
"noise",
"to",
"each",
"pixel",
"in",
"the",
"image",
".",
"If",
"a",
"value",
"exceeds",
"the",
"specified",
"it",
"will",
"be",
"set",
"to",
"the",
"closest",
"bound",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L3608-L3622 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.saveCurrentBugCollection | public static void saveCurrentBugCollection(IProject project, IProgressMonitor monitor) throws CoreException {
"""
If necessary, save current bug collection for project to disk.
@param project
the project
@param monitor
a progress monitor
@throws CoreException
"""
if (isBugCollectionDirty(projec... | java | public static void saveCurrentBugCollection(IProject project, IProgressMonitor monitor) throws CoreException {
if (isBugCollectionDirty(project)) {
SortedBugCollection bugCollection = (SortedBugCollection) project.getSessionProperty(SESSION_PROPERTY_BUG_COLLECTION);
if (bugCollection !=... | [
"public",
"static",
"void",
"saveCurrentBugCollection",
"(",
"IProject",
"project",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"CoreException",
"{",
"if",
"(",
"isBugCollectionDirty",
"(",
"project",
")",
")",
"{",
"SortedBugCollection",
"bugCollection",
"=",
... | If necessary, save current bug collection for project to disk.
@param project
the project
@param monitor
a progress monitor
@throws CoreException | [
"If",
"necessary",
"save",
"current",
"bug",
"collection",
"for",
"project",
"to",
"disk",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L764-L772 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.internalToDate | public static java.sql.Date internalToDate(int v, TimeZone tz) {
"""
Converts the internal representation of a SQL DATE (int) to the Java
type used for UDF parameters ({@link java.sql.Date}) with the given TimeZone.
<p>The internal int represents the days since January 1, 1970. When we convert it
to {@link ja... | java | public static java.sql.Date internalToDate(int v, TimeZone tz) {
// note that, in this case, can't handle Daylight Saving Time
final long t = v * MILLIS_PER_DAY;
return new java.sql.Date(t - tz.getOffset(t));
} | [
"public",
"static",
"java",
".",
"sql",
".",
"Date",
"internalToDate",
"(",
"int",
"v",
",",
"TimeZone",
"tz",
")",
"{",
"// note that, in this case, can't handle Daylight Saving Time",
"final",
"long",
"t",
"=",
"v",
"*",
"MILLIS_PER_DAY",
";",
"return",
"new",
... | Converts the internal representation of a SQL DATE (int) to the Java
type used for UDF parameters ({@link java.sql.Date}) with the given TimeZone.
<p>The internal int represents the days since January 1, 1970. When we convert it
to {@link java.sql.Date} (time milliseconds since January 1, 1970, 00:00:00 GMT),
we need ... | [
"Converts",
"the",
"internal",
"representation",
"of",
"a",
"SQL",
"DATE",
"(",
"int",
")",
"to",
"the",
"Java",
"type",
"used",
"for",
"UDF",
"parameters",
"(",
"{",
"@link",
"java",
".",
"sql",
".",
"Date",
"}",
")",
"with",
"the",
"given",
"TimeZone... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L133-L137 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.addToClasspath | public static void addToClasspath(final String url, final ClassLoader classLoader) {
"""
Adds an URL to the classpath.
@param url
URL to add - Cannot be <code>null</code>.
@param classLoader
Class loader to use - Cannot be <code>null</code>.
"""
checkNotNull("url", url);
try {
... | java | public static void addToClasspath(final String url, final ClassLoader classLoader) {
checkNotNull("url", url);
try {
addToClasspath(new URL(url), classLoader);
} catch (final MalformedURLException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"void",
"addToClasspath",
"(",
"final",
"String",
"url",
",",
"final",
"ClassLoader",
"classLoader",
")",
"{",
"checkNotNull",
"(",
"\"url\"",
",",
"url",
")",
";",
"try",
"{",
"addToClasspath",
"(",
"new",
"URL",
"(",
"url",
")",
",",
... | Adds an URL to the classpath.
@param url
URL to add - Cannot be <code>null</code>.
@param classLoader
Class loader to use - Cannot be <code>null</code>. | [
"Adds",
"an",
"URL",
"to",
"the",
"classpath",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L254-L261 |
apache/incubator-druid | server/src/main/java/org/apache/druid/curator/discovery/DiscoveryModule.java | DiscoveryModule.registerKey | public static void registerKey(Binder binder, Key<DruidNode> key) {
"""
Requests that the keyed DruidNode instance be injected and published as part of the lifecycle.
That is, this module will announce the DruidNode instance returned by
injector.getInstance(Key.get(DruidNode.class, annotation)) automatically.
... | java | public static void registerKey(Binder binder, Key<DruidNode> key)
{
DruidBinders.discoveryAnnouncementBinder(binder).addBinding().toInstance(new KeyHolder<>(key));
LifecycleModule.register(binder, ServiceAnnouncer.class);
} | [
"public",
"static",
"void",
"registerKey",
"(",
"Binder",
"binder",
",",
"Key",
"<",
"DruidNode",
">",
"key",
")",
"{",
"DruidBinders",
".",
"discoveryAnnouncementBinder",
"(",
"binder",
")",
".",
"addBinding",
"(",
")",
".",
"toInstance",
"(",
"new",
"KeyHo... | Requests that the keyed DruidNode instance be injected and published as part of the lifecycle.
That is, this module will announce the DruidNode instance returned by
injector.getInstance(Key.get(DruidNode.class, annotation)) automatically.
Announcement will happen in the ANNOUNCEMENTS stage of the Lifecycle
@param bin... | [
"Requests",
"that",
"the",
"keyed",
"DruidNode",
"instance",
"be",
"injected",
"and",
"published",
"as",
"part",
"of",
"the",
"lifecycle",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/curator/discovery/DiscoveryModule.java#L142-L146 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddressSegment.java | IPAddressSegment.isChangedByMask | protected boolean isChangedByMask(int maskValue, Integer segmentPrefixLength) throws IncompatibleAddressException {
"""
returns a new segment masked by the given mask
This method applies the mask first to every address in the range, and it does not preserve any existing prefix.
The given prefix will be applied... | java | protected boolean isChangedByMask(int maskValue, Integer segmentPrefixLength) throws IncompatibleAddressException {
boolean hasBits = (segmentPrefixLength != null);
if(hasBits && (segmentPrefixLength < 0 || segmentPrefixLength > getBitCount())) {
throw new PrefixLenException(this, segmentPrefixLength);
}
... | [
"protected",
"boolean",
"isChangedByMask",
"(",
"int",
"maskValue",
",",
"Integer",
"segmentPrefixLength",
")",
"throws",
"IncompatibleAddressException",
"{",
"boolean",
"hasBits",
"=",
"(",
"segmentPrefixLength",
"!=",
"null",
")",
";",
"if",
"(",
"hasBits",
"&&",
... | returns a new segment masked by the given mask
This method applies the mask first to every address in the range, and it does not preserve any existing prefix.
The given prefix will be applied to the range of addresses after the mask.
If the combination of the two does not result in a contiguous range, then {@link Inco... | [
"returns",
"a",
"new",
"segment",
"masked",
"by",
"the",
"given",
"mask"
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddressSegment.java#L273-L286 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/files/StaticFileServerHandler.java | StaticFileServerHandler.sendNotModified | public static void sendNotModified(ChannelHandlerContext ctx) {
"""
Send the "304 Not Modified" response. This response can be used when the
file timestamp is the same as what the browser is sending up.
@param ctx The channel context to write the response to.
"""
FullHttpResponse response = new DefaultFu... | java | public static void sendNotModified(ChannelHandlerContext ctx) {
FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, NOT_MODIFIED);
setDateHeader(response);
// close the connection as soon as the error message is sent.
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
} | [
"public",
"static",
"void",
"sendNotModified",
"(",
"ChannelHandlerContext",
"ctx",
")",
"{",
"FullHttpResponse",
"response",
"=",
"new",
"DefaultFullHttpResponse",
"(",
"HTTP_1_1",
",",
"NOT_MODIFIED",
")",
";",
"setDateHeader",
"(",
"response",
")",
";",
"// close... | Send the "304 Not Modified" response. This response can be used when the
file timestamp is the same as what the browser is sending up.
@param ctx The channel context to write the response to. | [
"Send",
"the",
"304",
"Not",
"Modified",
"response",
".",
"This",
"response",
"can",
"be",
"used",
"when",
"the",
"file",
"timestamp",
"is",
"the",
"same",
"as",
"what",
"the",
"browser",
"is",
"sending",
"up",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/files/StaticFileServerHandler.java#L324-L330 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/LongExtensions.java | LongExtensions.operator_equals | @Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_equals(long a, double b) {
"""
The binary <code>equals</code> operator. This is the equivalent to the Java <code>==</code> operator.
@param a a long.
@param b a double.
@return <code>a==b</code>
@since 2.3
"""... | java | @Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_equals(long a, double b) {
return a == b;
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"($1 == $2)\"",
",",
"constantExpression",
"=",
"true",
")",
"public",
"static",
"boolean",
"operator_equals",
"(",
"long",
"a",
",",
"double",
"b",
")",
"{",
"return",
"a",
"==",
"b",
";",
"}"
] | The binary <code>equals</code> operator. This is the equivalent to the Java <code>==</code> operator.
@param a a long.
@param b a double.
@return <code>a==b</code>
@since 2.3 | [
"The",
"binary",
"<code",
">",
"equals<",
"/",
"code",
">",
"operator",
".",
"This",
"is",
"the",
"equivalent",
"to",
"the",
"Java",
"<code",
">",
"==",
"<",
"/",
"code",
">",
"operator",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/LongExtensions.java#L376-L380 |
btaz/data-util | src/main/java/com/btaz/util/xml/model/Element.java | Element.addAttribute | public void addAttribute(String attributeName, String attributeValue) throws XmlModelException {
"""
Add a new element attribute
@param attributeName attribute name
@param attributeValue attribute value
@throws XmlModelException XML model exception
"""
String name = attributeName.trim();
Str... | java | public void addAttribute(String attributeName, String attributeValue) throws XmlModelException {
String name = attributeName.trim();
String value = attributeValue.trim();
if(attributesMap.containsKey(name)) {
throw new XmlModelException("Duplicate attribute: " + name);
}
... | [
"public",
"void",
"addAttribute",
"(",
"String",
"attributeName",
",",
"String",
"attributeValue",
")",
"throws",
"XmlModelException",
"{",
"String",
"name",
"=",
"attributeName",
".",
"trim",
"(",
")",
";",
"String",
"value",
"=",
"attributeValue",
".",
"trim",... | Add a new element attribute
@param attributeName attribute name
@param attributeValue attribute value
@throws XmlModelException XML model exception | [
"Add",
"a",
"new",
"element",
"attribute"
] | train | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/xml/model/Element.java#L105-L113 |
ontop/ontop | mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/RAExpression.java | RAExpression.joinOn | public static RAExpression joinOn(RAExpression re1, RAExpression re2,
java.util.function.Function<ImmutableMap<QualifiedAttributeID, Term>, ImmutableList<Function>> getAtomOnExpression,
TermFactory termFactory) throws IllegalJoinException {
... | java | public static RAExpression joinOn(RAExpression re1, RAExpression re2,
java.util.function.Function<ImmutableMap<QualifiedAttributeID, Term>, ImmutableList<Function>> getAtomOnExpression,
TermFactory termFactory) throws IllegalJoinException {
... | [
"public",
"static",
"RAExpression",
"joinOn",
"(",
"RAExpression",
"re1",
",",
"RAExpression",
"re2",
",",
"java",
".",
"util",
".",
"function",
".",
"Function",
"<",
"ImmutableMap",
"<",
"QualifiedAttributeID",
",",
"Term",
">",
",",
"ImmutableList",
"<",
"Fu... | JOIN ON
@param re1 a {@link RAExpression}
@param re2 a {@link RAExpression}
@param getAtomOnExpression
@return a {@link RAExpression}
@throws IllegalJoinException if the same alias occurs in both arguments | [
"JOIN",
"ON"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/RAExpression.java#L83-L93 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/MP3FileID3Controller.java | MP3FileID3Controller.setTitle | public void setTitle(String title, int type) {
"""
Set the title of this mp3.
@param title the title of the mp3
"""
if (allow(type&ID3V1))
{
id3v1.setTitle(title);
}
if (allow(type&ID3V2))
{
id3v2.setTextFrame(ID3v2Frames.TITLE, title);
}
} | java | public void setTitle(String title, int type)
{
if (allow(type&ID3V1))
{
id3v1.setTitle(title);
}
if (allow(type&ID3V2))
{
id3v2.setTextFrame(ID3v2Frames.TITLE, title);
}
} | [
"public",
"void",
"setTitle",
"(",
"String",
"title",
",",
"int",
"type",
")",
"{",
"if",
"(",
"allow",
"(",
"type",
"&",
"ID3V1",
")",
")",
"{",
"id3v1",
".",
"setTitle",
"(",
"title",
")",
";",
"}",
"if",
"(",
"allow",
"(",
"type",
"&",
"ID3V2"... | Set the title of this mp3.
@param title the title of the mp3 | [
"Set",
"the",
"title",
"of",
"this",
"mp3",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/MP3FileID3Controller.java#L159-L169 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/ConcurrentServiceReferenceMap.java | ConcurrentServiceReferenceMap.putReference | public boolean putReference(K key, ServiceReference<V> reference) {
"""
Associates the reference with the key.
@param key Key associated with this reference
@param reference ServiceReference for the target service
@return true if this is replacing a previous (non-null) service reference
"""
if (ke... | java | public boolean putReference(K key, ServiceReference<V> reference) {
if (key == null || reference == null)
return false;
ConcurrentServiceReferenceElement<V> element = new ConcurrentServiceReferenceElement<V>(referenceName, reference);
return (elementMap.put(key, element) != null);
... | [
"public",
"boolean",
"putReference",
"(",
"K",
"key",
",",
"ServiceReference",
"<",
"V",
">",
"reference",
")",
"{",
"if",
"(",
"key",
"==",
"null",
"||",
"reference",
"==",
"null",
")",
"return",
"false",
";",
"ConcurrentServiceReferenceElement",
"<",
"V",
... | Associates the reference with the key.
@param key Key associated with this reference
@param reference ServiceReference for the target service
@return true if this is replacing a previous (non-null) service reference | [
"Associates",
"the",
"reference",
"with",
"the",
"key",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/ConcurrentServiceReferenceMap.java#L118-L124 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Collectors.java | Collectors.minAll | public static <T> Collector<T, ?, List<T>> minAll(Comparator<? super T> comparator) {
"""
It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
<br />
Returns a {@code Collector} which finds all the elements which are equal
to each other and smaller than a... | java | public static <T> Collector<T, ?, List<T>> minAll(Comparator<? super T> comparator) {
return minAll(comparator, Integer.MAX_VALUE);
} | [
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"List",
"<",
"T",
">",
">",
"minAll",
"(",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comparator",
")",
"{",
"return",
"minAll",
"(",
"comparator",
",",
"Integer",
".",
"MAX_... | It's copied from StreamEx: https://github.com/amaembo/streamex under Apache License v2 and may be modified.
<br />
Returns a {@code Collector} which finds all the elements which are equal
to each other and smaller than any other element according to the
specified {@link Comparator}. The found elements are collected to... | [
"It",
"s",
"copied",
"from",
"StreamEx",
":",
"https",
":",
"//",
"github",
".",
"com",
"/",
"amaembo",
"/",
"streamex",
"under",
"Apache",
"License",
"v2",
"and",
"may",
"be",
"modified",
".",
"<br",
"/",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Collectors.java#L2527-L2529 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobScheduleOperations.java | JobScheduleOperations.updateJobSchedule | public void updateJobSchedule(String jobScheduleId, Schedule schedule, JobSpecification jobSpecification, List<MetadataItem> metadata, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Updates the specified job schedule.
This method performs a full replace of all the... | java | public void updateJobSchedule(String jobScheduleId, Schedule schedule, JobSpecification jobSpecification, List<MetadataItem> metadata, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
JobScheduleUpdateOptions options = new JobScheduleUpdateOptions();
BehaviorM... | [
"public",
"void",
"updateJobSchedule",
"(",
"String",
"jobScheduleId",
",",
"Schedule",
"schedule",
",",
"JobSpecification",
"jobSpecification",
",",
"List",
"<",
"MetadataItem",
">",
"metadata",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
... | Updates the specified job schedule.
This method performs a full replace of all the updatable properties of the job schedule. For example, if the schedule parameter is null, then the Batch service removes the job schedule’s existing schedule and replaces it with the default schedule.
@param jobScheduleId The ID of the ... | [
"Updates",
"the",
"specified",
"job",
"schedule",
".",
"This",
"method",
"performs",
"a",
"full",
"replace",
"of",
"all",
"the",
"updatable",
"properties",
"of",
"the",
"job",
"schedule",
".",
"For",
"example",
"if",
"the",
"schedule",
"parameter",
"is",
"nu... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobScheduleOperations.java#L262-L272 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/SHPDriver.java | SHPDriver.initDriver | public void initDriver(File shpFile, ShapeType shapeType, DbaseFileHeader dbaseHeader) throws IOException {
"""
Init Driver for Write mode
@param shpFile
@param shapeType
@param dbaseHeader
@throws IOException
"""
String path = shpFile.getAbsolutePath();
String nameWithoutExt = path.substri... | java | public void initDriver(File shpFile, ShapeType shapeType, DbaseFileHeader dbaseHeader) throws IOException {
String path = shpFile.getAbsolutePath();
String nameWithoutExt = path.substring(0,path.lastIndexOf('.'));
this.shpFile = new File(nameWithoutExt+".shp");
this.shxFile = new File(na... | [
"public",
"void",
"initDriver",
"(",
"File",
"shpFile",
",",
"ShapeType",
"shapeType",
",",
"DbaseFileHeader",
"dbaseHeader",
")",
"throws",
"IOException",
"{",
"String",
"path",
"=",
"shpFile",
".",
"getAbsolutePath",
"(",
")",
";",
"String",
"nameWithoutExt",
... | Init Driver for Write mode
@param shpFile
@param shapeType
@param dbaseHeader
@throws IOException | [
"Init",
"Driver",
"for",
"Write",
"mode"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/internal/SHPDriver.java#L109-L121 |
Multifarious/MacroManager | src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java | BalancingPolicy.attemptToClaim | boolean attemptToClaim(String workUnit, boolean claimForHandoff)
throws InterruptedException {
"""
Attempts to claim a given work unit by creating an ephemeral node in ZooKeeper
with this node's ID. If the claim succeeds, start work. If not, move on.
@throws ZooKeeperConnectionException
@throws KeeperExc... | java | boolean attemptToClaim(String workUnit, boolean claimForHandoff)
throws InterruptedException
{
LOG.debug("Attempting to claim {}. For handoff? {}", workUnit, claimForHandoff);
String path = claimForHandoff
? String.format("/%s/handoff-result/%s", cluster.name, workUnit)
... | [
"boolean",
"attemptToClaim",
"(",
"String",
"workUnit",
",",
"boolean",
"claimForHandoff",
")",
"throws",
"InterruptedException",
"{",
"LOG",
".",
"debug",
"(",
"\"Attempting to claim {}. For handoff? {}\"",
",",
"workUnit",
",",
"claimForHandoff",
")",
";",
"String",
... | Attempts to claim a given work unit by creating an ephemeral node in ZooKeeper
with this node's ID. If the claim succeeds, start work. If not, move on.
@throws ZooKeeperConnectionException
@throws KeeperException | [
"Attempts",
"to",
"claim",
"a",
"given",
"work",
"unit",
"by",
"creating",
"an",
"ephemeral",
"node",
"in",
"ZooKeeper",
"with",
"this",
"node",
"s",
"ID",
".",
"If",
"the",
"claim",
"succeeds",
"start",
"work",
".",
"If",
"not",
"move",
"on",
"."
] | train | https://github.com/Multifarious/MacroManager/blob/559785839981f460aaeba3c3fddff7fb667d9581/src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java#L130-L153 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ClientInjectionBinding.java | ClientInjectionBinding.getInjectionTarget | public static InjectionTarget getInjectionTarget(ComponentNameSpaceConfiguration compNSConfig, ClientInjection injection)
throws InjectionException {
"""
Acquires an InjectionTarget for the specified ClientInjection.
@param compNSConfig the minimal namespace configuration
@param injection t... | java | public static InjectionTarget getInjectionTarget(ComponentNameSpaceConfiguration compNSConfig, ClientInjection injection)
throws InjectionException
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "ge... | [
"public",
"static",
"InjectionTarget",
"getInjectionTarget",
"(",
"ComponentNameSpaceConfiguration",
"compNSConfig",
",",
"ClientInjection",
"injection",
")",
"throws",
"InjectionException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnable... | Acquires an InjectionTarget for the specified ClientInjection.
@param compNSConfig the minimal namespace configuration
@param injection the injection target descriptor
@return the injection target
@throws InjectionException if the target cannot be acquired | [
"Acquires",
"an",
"InjectionTarget",
"for",
"the",
"specified",
"ClientInjection",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ClientInjectionBinding.java#L49-L70 |
qos-ch/slf4j | slf4j-ext/src/main/java/org/slf4j/profiler/SpacePadder.java | SpacePadder.spacePad | final static public void spacePad(StringBuilder sbuf, int length) {
"""
Fast space padding method.
@param sbuf the buffer to pad
@param length the target size of the buffer after padding
"""
while (length >= 32) {
sbuf.append(SPACES[5]);
length -= 32;
}
for ... | java | final static public void spacePad(StringBuilder sbuf, int length) {
while (length >= 32) {
sbuf.append(SPACES[5]);
length -= 32;
}
for (int i = 4; i >= 0; i--) {
if ((length & (1 << i)) != 0) {
sbuf.append(SPACES[i]);
}
}
... | [
"final",
"static",
"public",
"void",
"spacePad",
"(",
"StringBuilder",
"sbuf",
",",
"int",
"length",
")",
"{",
"while",
"(",
"length",
">=",
"32",
")",
"{",
"sbuf",
".",
"append",
"(",
"SPACES",
"[",
"5",
"]",
")",
";",
"length",
"-=",
"32",
";",
"... | Fast space padding method.
@param sbuf the buffer to pad
@param length the target size of the buffer after padding | [
"Fast",
"space",
"padding",
"method",
"."
] | train | https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/profiler/SpacePadder.java#L115-L126 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.rotateLocal | public Matrix4x3d rotateLocal(double ang, double x, double y, double z) {
"""
Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified <code>(x, y, z)</code> axis.
<p>
The axis described by the three components needs to be a unit vector.
<p>
When used with a right-han... | java | public Matrix4x3d rotateLocal(double ang, double x, double y, double z) {
return rotateLocal(ang, x, y, z, this);
} | [
"public",
"Matrix4x3d",
"rotateLocal",
"(",
"double",
"ang",
",",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"return",
"rotateLocal",
"(",
"ang",
",",
"x",
",",
"y",
",",
"z",
",",
"this",
")",
";",
"}"
] | Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified <code>(x, y, z)</code> axis.
<p>
The axis described by the three components needs to be a unit vector.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise arou... | [
"Pre",
"-",
"multiply",
"a",
"rotation",
"to",
"this",
"matrix",
"by",
"rotating",
"the",
"given",
"amount",
"of",
"radians",
"about",
"the",
"specified",
"<code",
">",
"(",
"x",
"y",
"z",
")",
"<",
"/",
"code",
">",
"axis",
".",
"<p",
">",
"The",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L3554-L3556 |
spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/DefaultAuthenticationHandler.java | DefaultAuthenticationHandler.createAuthentication | public Authentication createAuthentication(HttpServletRequest request, ConsumerAuthentication authentication, OAuthAccessProviderToken authToken) {
"""
Default implementation returns the user authentication associated with the auth token, if the token is provided. Otherwise, the consumer authentication
is returne... | java | public Authentication createAuthentication(HttpServletRequest request, ConsumerAuthentication authentication, OAuthAccessProviderToken authToken) {
if (authToken != null) {
Authentication userAuthentication = authToken.getUserAuthentication();
if (userAuthentication instanceof AbstractAuthenticationToke... | [
"public",
"Authentication",
"createAuthentication",
"(",
"HttpServletRequest",
"request",
",",
"ConsumerAuthentication",
"authentication",
",",
"OAuthAccessProviderToken",
"authToken",
")",
"{",
"if",
"(",
"authToken",
"!=",
"null",
")",
"{",
"Authentication",
"userAuthen... | Default implementation returns the user authentication associated with the auth token, if the token is provided. Otherwise, the consumer authentication
is returned.
@param request The request that was successfully authenticated.
@param authentication The consumer authentication (details about how the request was authe... | [
"Default",
"implementation",
"returns",
"the",
"user",
"authentication",
"associated",
"with",
"the",
"auth",
"token",
"if",
"the",
"token",
"is",
"provided",
".",
"Otherwise",
"the",
"consumer",
"authentication",
"is",
"returned",
"."
] | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/DefaultAuthenticationHandler.java#L26-L37 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nslimitidentifier.java | nslimitidentifier.get | public static nslimitidentifier get(nitro_service service, String limitidentifier) throws Exception {
"""
Use this API to fetch nslimitidentifier resource of given name .
"""
nslimitidentifier obj = new nslimitidentifier();
obj.set_limitidentifier(limitidentifier);
nslimitidentifier response = (nslimitid... | java | public static nslimitidentifier get(nitro_service service, String limitidentifier) throws Exception{
nslimitidentifier obj = new nslimitidentifier();
obj.set_limitidentifier(limitidentifier);
nslimitidentifier response = (nslimitidentifier) obj.get_resource(service);
return response;
} | [
"public",
"static",
"nslimitidentifier",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"limitidentifier",
")",
"throws",
"Exception",
"{",
"nslimitidentifier",
"obj",
"=",
"new",
"nslimitidentifier",
"(",
")",
";",
"obj",
".",
"set_limitidentifier",
"(",
... | Use this API to fetch nslimitidentifier resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"nslimitidentifier",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nslimitidentifier.java#L590-L595 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/SubReportBuilder.java | SubReportBuilder.setDataSource | public SubReportBuilder setDataSource(String expression) {
"""
like addDataSource(int origin, String expression) but the origin will be from a Parameter
@param expression
@return
"""
return setDataSource(DJConstants.DATA_SOURCE_ORIGIN_PARAMETER, DJConstants.DATA_SOURCE_TYPE_JRDATASOURCE, expression);
} | java | public SubReportBuilder setDataSource(String expression) {
return setDataSource(DJConstants.DATA_SOURCE_ORIGIN_PARAMETER, DJConstants.DATA_SOURCE_TYPE_JRDATASOURCE, expression);
} | [
"public",
"SubReportBuilder",
"setDataSource",
"(",
"String",
"expression",
")",
"{",
"return",
"setDataSource",
"(",
"DJConstants",
".",
"DATA_SOURCE_ORIGIN_PARAMETER",
",",
"DJConstants",
".",
"DATA_SOURCE_TYPE_JRDATASOURCE",
",",
"expression",
")",
";",
"}"
] | like addDataSource(int origin, String expression) but the origin will be from a Parameter
@param expression
@return | [
"like",
"addDataSource",
"(",
"int",
"origin",
"String",
"expression",
")",
"but",
"the",
"origin",
"will",
"be",
"from",
"a",
"Parameter"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/SubReportBuilder.java#L129-L131 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/FullDTDReader.java | FullDTDReader.readDTDQName | private PrefixedName readDTDQName(char firstChar)
throws XMLStreamException {
"""
Method that will read an element or attribute name from DTD; depending
on namespace mode, it can have prefix as well.
<p>
Note: returned {@link PrefixedName} instances are canonicalized so that
all instances read during p... | java | private PrefixedName readDTDQName(char firstChar)
throws XMLStreamException
{
String prefix, localName;
if (!mCfgNsEnabled) {
prefix = null;
localName = parseFullName(firstChar);
} else {
localName = parseLocalName(firstChar);
/* Hmmh.... | [
"private",
"PrefixedName",
"readDTDQName",
"(",
"char",
"firstChar",
")",
"throws",
"XMLStreamException",
"{",
"String",
"prefix",
",",
"localName",
";",
"if",
"(",
"!",
"mCfgNsEnabled",
")",
"{",
"prefix",
"=",
"null",
";",
"localName",
"=",
"parseFullName",
... | Method that will read an element or attribute name from DTD; depending
on namespace mode, it can have prefix as well.
<p>
Note: returned {@link PrefixedName} instances are canonicalized so that
all instances read during parsing of a single DTD subset so that
identity comparison can be used instead of calling <code>equa... | [
"Method",
"that",
"will",
"read",
"an",
"element",
"or",
"attribute",
"name",
"from",
"DTD",
";",
"depending",
"on",
"namespace",
"mode",
"it",
"can",
"have",
"prefix",
"as",
"well",
".",
"<p",
">",
"Note",
":",
"returned",
"{"
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java#L1340-L1371 |
mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.has | @Override
public boolean has(String name, Scriptable start) {
"""
Returns true if the named property is defined.
@param name the name of the property
@param start the object in which the lookup began
@return true if and only if the property was found in the object
"""
return null != slotMap.qu... | java | @Override
public boolean has(String name, Scriptable start)
{
return null != slotMap.query(name, 0);
} | [
"@",
"Override",
"public",
"boolean",
"has",
"(",
"String",
"name",
",",
"Scriptable",
"start",
")",
"{",
"return",
"null",
"!=",
"slotMap",
".",
"query",
"(",
"name",
",",
"0",
")",
";",
"}"
] | Returns true if the named property is defined.
@param name the name of the property
@param start the object in which the lookup began
@return true if and only if the property was found in the object | [
"Returns",
"true",
"if",
"the",
"named",
"property",
"is",
"defined",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L415-L419 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java | AtlasTypeDefGraphStoreV1.hasIncomingEdgesWithLabel | boolean hasIncomingEdgesWithLabel(AtlasVertex vertex, String label) throws AtlasBaseException {
"""
Look to see if there are any IN edges with the supplied label
@param vertex
@param label
@return
@throws AtlasBaseException
"""
boolean foundEdges = false;
Iterator<AtlasEdge> inEdges = verte... | java | boolean hasIncomingEdgesWithLabel(AtlasVertex vertex, String label) throws AtlasBaseException {
boolean foundEdges = false;
Iterator<AtlasEdge> inEdges = vertex.getEdges(AtlasEdgeDirection.IN).iterator();
while (inEdges.hasNext()) {
AtlasEdge edge = inEdges.next();
if (... | [
"boolean",
"hasIncomingEdgesWithLabel",
"(",
"AtlasVertex",
"vertex",
",",
"String",
"label",
")",
"throws",
"AtlasBaseException",
"{",
"boolean",
"foundEdges",
"=",
"false",
";",
"Iterator",
"<",
"AtlasEdge",
">",
"inEdges",
"=",
"vertex",
".",
"getEdges",
"(",
... | Look to see if there are any IN edges with the supplied label
@param vertex
@param label
@return
@throws AtlasBaseException | [
"Look",
"to",
"see",
"if",
"there",
"are",
"any",
"IN",
"edges",
"with",
"the",
"supplied",
"label"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java#L252-L265 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java | ExecutionEnvironment.registerTypeWithKryoSerializer | public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) {
"""
Registers the given Serializer via its class as a serializer for the given type at the KryoSerializer.
@param type The class of the types serialized with the given serializer.
@param serializerClass ... | java | public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) {
config.registerTypeWithKryoSerializer(type, serializerClass);
} | [
"public",
"void",
"registerTypeWithKryoSerializer",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Class",
"<",
"?",
"extends",
"Serializer",
"<",
"?",
">",
">",
"serializerClass",
")",
"{",
"config",
".",
"registerTypeWithKryoSerializer",
"(",
"type",
",",
"seria... | Registers the given Serializer via its class as a serializer for the given type at the KryoSerializer.
@param type The class of the types serialized with the given serializer.
@param serializerClass The class of the serializer to use. | [
"Registers",
"the",
"given",
"Serializer",
"via",
"its",
"class",
"as",
"a",
"serializer",
"for",
"the",
"given",
"type",
"at",
"the",
"KryoSerializer",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java#L354-L356 |
lightblueseas/vintage-time | src/main/java/de/alpharogroup/date/CalculateDateExtensions.java | CalculateDateExtensions.addMonths | public static Date addMonths(final Date date, final int addMonths) {
"""
Adds months to the given Date object and returns it. Note: you can add negative values too
for get date in past.
@param date
The Date object to add the years.
@param addMonths
The months to add.
@return The resulted Date object.
"... | java | public static Date addMonths(final Date date, final int addMonths)
{
final Calendar dateOnCalendar = Calendar.getInstance();
dateOnCalendar.setTime(date);
dateOnCalendar.add(Calendar.MONTH, addMonths);
return dateOnCalendar.getTime();
} | [
"public",
"static",
"Date",
"addMonths",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"addMonths",
")",
"{",
"final",
"Calendar",
"dateOnCalendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"dateOnCalendar",
".",
"setTime",
"(",
"date",
")",
... | Adds months to the given Date object and returns it. Note: you can add negative values too
for get date in past.
@param date
The Date object to add the years.
@param addMonths
The months to add.
@return The resulted Date object. | [
"Adds",
"months",
"to",
"the",
"given",
"Date",
"object",
"and",
"returns",
"it",
".",
"Note",
":",
"you",
"can",
"add",
"negative",
"values",
"too",
"for",
"get",
"date",
"in",
"past",
"."
] | train | https://github.com/lightblueseas/vintage-time/blob/fbf201e679d9f9b92e7b5771f3eea1413cc2e113/src/main/java/de/alpharogroup/date/CalculateDateExtensions.java#L128-L134 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryFileApi.java | RepositoryFileApi.getFileV3 | @Deprecated
protected RepositoryFile getFileV3(String filePath, Integer projectId, String ref) throws GitLabApiException {
"""
Get file from repository. Allows you to receive information about file in repository like name, size, content.
Note that file content is Base64 encoded.
<pre><code>GitLab Endpoint:... | java | @Deprecated
protected RepositoryFile getFileV3(String filePath, Integer projectId, String ref) throws GitLabApiException {
Form form = new Form();
addFormParam(form, "file_path", filePath, true);
addFormParam(form, "ref", ref, true);
Response response = get(Response.Status.OK, form.a... | [
"@",
"Deprecated",
"protected",
"RepositoryFile",
"getFileV3",
"(",
"String",
"filePath",
",",
"Integer",
"projectId",
",",
"String",
"ref",
")",
"throws",
"GitLabApiException",
"{",
"Form",
"form",
"=",
"new",
"Form",
"(",
")",
";",
"addFormParam",
"(",
"form... | Get file from repository. Allows you to receive information about file in repository like name, size, content.
Note that file content is Base64 encoded.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/files</code></pre>
@param filePath (required) - Full path to new file. Ex. lib/class.rb
@param projectId (re... | [
"Get",
"file",
"from",
"repository",
".",
"Allows",
"you",
"to",
"receive",
"information",
"about",
"file",
"in",
"repository",
"like",
"name",
"size",
"content",
".",
"Note",
"that",
"file",
"content",
"is",
"Base64",
"encoded",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryFileApi.java#L179-L186 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/category/CmsCategoryTree.java | CmsCategoryTree.buildTreeItem | private CmsTreeItem buildTreeItem(CmsCategoryTreeEntry category, Collection<String> selectedCategories) {
"""
Builds a tree item for the given category.<p>
@param category the category
@param selectedCategories the selected categories
@return the tree item widget
"""
// generate the widget th... | java | private CmsTreeItem buildTreeItem(CmsCategoryTreeEntry category, Collection<String> selectedCategories) {
// generate the widget that should be shown in the list
CmsDataValue dataValue = new CmsDataValue(
600,
3,
CmsCategoryBean.SMALL_ICON_CLASSES,
... | [
"private",
"CmsTreeItem",
"buildTreeItem",
"(",
"CmsCategoryTreeEntry",
"category",
",",
"Collection",
"<",
"String",
">",
"selectedCategories",
")",
"{",
"// generate the widget that should be shown in the list\r",
"CmsDataValue",
"dataValue",
"=",
"new",
"CmsDataValue",
"("... | Builds a tree item for the given category.<p>
@param category the category
@param selectedCategories the selected categories
@return the tree item widget | [
"Builds",
"a",
"tree",
"item",
"for",
"the",
"given",
"category",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/category/CmsCategoryTree.java#L921-L966 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/expressions/Expressions.java | Expressions.isNotEqual | public static IsNotEqual isNotEqual(ComparableExpression<Number> left, Object constant) {
"""
Creates an IsNotEqual expression from the given expression and constant.
@param left The left expression.
@param constant The constant to compare to (must be a Number).
@throws IllegalArgumentException If the consta... | java | public static IsNotEqual isNotEqual(ComparableExpression<Number> left, Object constant) {
if (!(constant instanceof Number))
throw new IllegalArgumentException("constant is not a Number");
return new IsNotEqual(left, constant((Number)constant));
} | [
"public",
"static",
"IsNotEqual",
"isNotEqual",
"(",
"ComparableExpression",
"<",
"Number",
">",
"left",
",",
"Object",
"constant",
")",
"{",
"if",
"(",
"!",
"(",
"constant",
"instanceof",
"Number",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\... | Creates an IsNotEqual expression from the given expression and constant.
@param left The left expression.
@param constant The constant to compare to (must be a Number).
@throws IllegalArgumentException If the constant is not a Number
@return A new is less than binary expression. | [
"Creates",
"an",
"IsNotEqual",
"expression",
"from",
"the",
"given",
"expression",
"and",
"constant",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/expressions/Expressions.java#L472-L478 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateLetter | public static <T extends CharSequence> T validateLetter(T value, String errorMsg) throws ValidateException {
"""
验证是否全部为字母组成,包括大写和小写字母和汉字
@param <T> 字符串类型
@param value 表单值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
@since 3.3.0
"""
if (false == isLetter(value)) {
throw ... | java | public static <T extends CharSequence> T validateLetter(T value, String errorMsg) throws ValidateException {
if (false == isLetter(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateLetter",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isLetter",
"(",
"value",
")",
")",
"{",
"throw",
"new",
... | 验证是否全部为字母组成,包括大写和小写字母和汉字
@param <T> 字符串类型
@param value 表单值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
@since 3.3.0 | [
"验证是否全部为字母组成,包括大写和小写字母和汉字"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L453-L458 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/concurrent/JRebirth.java | JRebirth.runIntoJTP | public static void runIntoJTP(final String runnableName, final PriorityLevel runnablePriority, final Runnable runnable) {
"""
Run into the JRebirth Thread Pool [JTP].
Be careful this method can be called through any thread.
@param runnableName the name of the runnable for logging purpose
@param runnablePrio... | java | public static void runIntoJTP(final String runnableName, final PriorityLevel runnablePriority, final Runnable runnable) {
runIntoJTP(new JrbReferenceRunnable(runnableName, runnablePriority, runnable));
} | [
"public",
"static",
"void",
"runIntoJTP",
"(",
"final",
"String",
"runnableName",
",",
"final",
"PriorityLevel",
"runnablePriority",
",",
"final",
"Runnable",
"runnable",
")",
"{",
"runIntoJTP",
"(",
"new",
"JrbReferenceRunnable",
"(",
"runnableName",
",",
"runnable... | Run into the JRebirth Thread Pool [JTP].
Be careful this method can be called through any thread.
@param runnableName the name of the runnable for logging purpose
@param runnablePriority the priority to try to apply to the runnable
@param runnable the task to run | [
"Run",
"into",
"the",
"JRebirth",
"Thread",
"Pool",
"[",
"JTP",
"]",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/concurrent/JRebirth.java#L341-L343 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java | AbstractCasView.getServiceFrom | protected Service getServiceFrom(final Map<String, Object> model) {
"""
Gets validated service from the model.
@param model the model
@return the validated service from
"""
return (Service) model.get(CasViewConstants.MODEL_ATTRIBUTE_NAME_SERVICE);
} | java | protected Service getServiceFrom(final Map<String, Object> model) {
return (Service) model.get(CasViewConstants.MODEL_ATTRIBUTE_NAME_SERVICE);
} | [
"protected",
"Service",
"getServiceFrom",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"model",
")",
"{",
"return",
"(",
"Service",
")",
"model",
".",
"get",
"(",
"CasViewConstants",
".",
"MODEL_ATTRIBUTE_NAME_SERVICE",
")",
";",
"}"
] | Gets validated service from the model.
@param model the model
@return the validated service from | [
"Gets",
"validated",
"service",
"from",
"the",
"model",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java#L164-L166 |
pdef/pdef-java | pdef/src/main/java/io/pdef/descriptors/Descriptors.java | Descriptors.findInterfaceDescriptor | @Nullable
public static <T> InterfaceDescriptor<T> findInterfaceDescriptor(final Class<T> cls) {
"""
Returns an interface descriptor or throws an IllegalArgumentException.
"""
if (!cls.isInterface()) {
throw new IllegalArgumentException("Interface required, got " + cls);
}
Field field;
try {
fi... | java | @Nullable
public static <T> InterfaceDescriptor<T> findInterfaceDescriptor(final Class<T> cls) {
if (!cls.isInterface()) {
throw new IllegalArgumentException("Interface required, got " + cls);
}
Field field;
try {
field = cls.getField("DESCRIPTOR");
} catch (NoSuchFieldException e) {
throw new Ille... | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
">",
"InterfaceDescriptor",
"<",
"T",
">",
"findInterfaceDescriptor",
"(",
"final",
"Class",
"<",
"T",
">",
"cls",
")",
"{",
"if",
"(",
"!",
"cls",
".",
"isInterface",
"(",
")",
")",
"{",
"throw",
"new",
... | Returns an interface descriptor or throws an IllegalArgumentException. | [
"Returns",
"an",
"interface",
"descriptor",
"or",
"throws",
"an",
"IllegalArgumentException",
"."
] | train | https://github.com/pdef/pdef-java/blob/7776c44d1aab0f3dbf7267b0c32b8f9282fe6167/pdef/src/main/java/io/pdef/descriptors/Descriptors.java#L58-L83 |
jenkinsci/jenkins | core/src/main/java/hudson/model/View.java | View.createViewFromXML | public static View createViewFromXML(String name, InputStream xml) throws IOException {
"""
Instantiate View subtype from XML stream.
@param name Alternative name to use or {@code null} to keep the one in xml.
"""
try (InputStream in = new BufferedInputStream(xml)) {
View v = (View) Jen... | java | public static View createViewFromXML(String name, InputStream xml) throws IOException {
try (InputStream in = new BufferedInputStream(xml)) {
View v = (View) Jenkins.XSTREAM.fromXML(in);
if (name != null) v.name = name;
Jenkins.checkGoodName(v.name);
return v;
... | [
"public",
"static",
"View",
"createViewFromXML",
"(",
"String",
"name",
",",
"InputStream",
"xml",
")",
"throws",
"IOException",
"{",
"try",
"(",
"InputStream",
"in",
"=",
"new",
"BufferedInputStream",
"(",
"xml",
")",
")",
"{",
"View",
"v",
"=",
"(",
"Vie... | Instantiate View subtype from XML stream.
@param name Alternative name to use or {@code null} to keep the one in xml. | [
"Instantiate",
"View",
"subtype",
"from",
"XML",
"stream",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/View.java#L1371-L1381 |
lucee/Lucee | core/src/main/java/lucee/runtime/converter/JSONConverter.java | JSONConverter._serializeArray | private void _serializeArray(PageContext pc, Set test, Array array, StringBuilder sb, boolean serializeQueryByColumns, Set<Object> done) throws ConverterException {
"""
serialize a Array
@param array Array to serialize
@param sb
@param serializeQueryByColumns
@param done
@throws ConverterException
"""
... | java | private void _serializeArray(PageContext pc, Set test, Array array, StringBuilder sb, boolean serializeQueryByColumns, Set<Object> done) throws ConverterException {
_serializeList(pc, test, array.toList(), sb, serializeQueryByColumns, done);
} | [
"private",
"void",
"_serializeArray",
"(",
"PageContext",
"pc",
",",
"Set",
"test",
",",
"Array",
"array",
",",
"StringBuilder",
"sb",
",",
"boolean",
"serializeQueryByColumns",
",",
"Set",
"<",
"Object",
">",
"done",
")",
"throws",
"ConverterException",
"{",
... | serialize a Array
@param array Array to serialize
@param sb
@param serializeQueryByColumns
@param done
@throws ConverterException | [
"serialize",
"a",
"Array"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/JSONConverter.java#L201-L203 |
alipay/sofa-rpc | extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/client/aft/ProviderInfoWeightManager.java | ProviderInfoWeightManager.recoverOriginWeight | public static void recoverOriginWeight(ProviderInfo providerInfo, int originWeight) {
"""
Recover weight of provider info, and set default status
@param providerInfo ProviderInfo
@param originWeight origin weight
"""
providerInfo.setStatus(ProviderStatus.AVAILABLE);
providerInfo.setWeight(o... | java | public static void recoverOriginWeight(ProviderInfo providerInfo, int originWeight) {
providerInfo.setStatus(ProviderStatus.AVAILABLE);
providerInfo.setWeight(originWeight);
} | [
"public",
"static",
"void",
"recoverOriginWeight",
"(",
"ProviderInfo",
"providerInfo",
",",
"int",
"originWeight",
")",
"{",
"providerInfo",
".",
"setStatus",
"(",
"ProviderStatus",
".",
"AVAILABLE",
")",
";",
"providerInfo",
".",
"setWeight",
"(",
"originWeight",
... | Recover weight of provider info, and set default status
@param providerInfo ProviderInfo
@param originWeight origin weight | [
"Recover",
"weight",
"of",
"provider",
"info",
"and",
"set",
"default",
"status"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/client/aft/ProviderInfoWeightManager.java#L61-L64 |
ldapchai/ldapchai | src/main/java/com/novell/ldapchai/provider/ChaiConfiguration.java | ChaiConfiguration.newConfiguration | public static ChaiConfiguration newConfiguration( final String ldapURL, final String bindDN, final String bindPassword ) {
"""
Construct a default {@code ChaiConfiguration}.
@param bindDN ldap bind DN, in ldap fully qualified syntax. Also used as the DN of the returned ChaiUser.
@param bindPassword pass... | java | public static ChaiConfiguration newConfiguration( final String ldapURL, final String bindDN, final String bindPassword )
{
return new ChaiConfigurationBuilder( ldapURL, bindDN, bindPassword ).build();
} | [
"public",
"static",
"ChaiConfiguration",
"newConfiguration",
"(",
"final",
"String",
"ldapURL",
",",
"final",
"String",
"bindDN",
",",
"final",
"String",
"bindPassword",
")",
"{",
"return",
"new",
"ChaiConfigurationBuilder",
"(",
"ldapURL",
",",
"bindDN",
",",
"bi... | Construct a default {@code ChaiConfiguration}.
@param bindDN ldap bind DN, in ldap fully qualified syntax. Also used as the DN of the returned ChaiUser.
@param bindPassword password for the bind DN.
@param ldapURL ldap server and port in url format, example: <i>ldap://127.0.0.1:389</i>
@return a new config... | [
"Construct",
"a",
"default",
"{",
"@code",
"ChaiConfiguration",
"}",
"."
] | train | https://github.com/ldapchai/ldapchai/blob/a6d4b5dbfa4e270db0ce70892512cbe39e64b874/src/main/java/com/novell/ldapchai/provider/ChaiConfiguration.java#L81-L84 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/AbstractQuery.java | AbstractQuery.addChangeListener | @NonNull
@Override
public ListenerToken addChangeListener(@NonNull QueryChangeListener listener) {
"""
Adds a query change listener. Changes will be posted on the main queue.
@param listener The listener to post changes.
@return An opaque listener token object for removing the listener.
"""
... | java | @NonNull
@Override
public ListenerToken addChangeListener(@NonNull QueryChangeListener listener) {
if (listener == null) { throw new IllegalArgumentException("listener cannot be null."); }
return addChangeListener(null, listener);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"ListenerToken",
"addChangeListener",
"(",
"@",
"NonNull",
"QueryChangeListener",
"listener",
")",
"{",
"if",
"(",
"listener",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"listener cannot be n... | Adds a query change listener. Changes will be posted on the main queue.
@param listener The listener to post changes.
@return An opaque listener token object for removing the listener. | [
"Adds",
"a",
"query",
"change",
"listener",
".",
"Changes",
"will",
"be",
"posted",
"on",
"the",
"main",
"queue",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractQuery.java#L169-L174 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.security/src/com/ibm/ws/ejbcontainer/security/internal/jacc/EJBJaccAuthorizationHelper.java | EJBJaccAuthorizationHelper.authorizeEJB | @Override
public void authorizeEJB(EJBRequestData request, Subject subject) throws EJBAccessDeniedException {
"""
Authorizes the subject to call the given EJB by using JACC, based on the given method info.
If the subject is not authorized, an exception is thrown. The following checks are made:
<li>is the bea... | java | @Override
public void authorizeEJB(EJBRequestData request, Subject subject) throws EJBAccessDeniedException {
auditManager = new AuditManager();
Object req = auditManager.getHttpServletRequest();
Object webRequest = auditManager.getWebRequest();
String realm = auditManager.getRealm()... | [
"@",
"Override",
"public",
"void",
"authorizeEJB",
"(",
"EJBRequestData",
"request",
",",
"Subject",
"subject",
")",
"throws",
"EJBAccessDeniedException",
"{",
"auditManager",
"=",
"new",
"AuditManager",
"(",
")",
";",
"Object",
"req",
"=",
"auditManager",
".",
... | Authorizes the subject to call the given EJB by using JACC, based on the given method info.
If the subject is not authorized, an exception is thrown. The following checks are made:
<li>is the bean method excluded (denyAll)</li>
<li>are the required roles null or empty</li>
<li>is EVERYONE granted to any of the required... | [
"Authorizes",
"the",
"subject",
"to",
"call",
"the",
"given",
"EJB",
"by",
"using",
"JACC",
"based",
"on",
"the",
"given",
"method",
"info",
".",
"If",
"the",
"subject",
"is",
"not",
"authorized",
"an",
"exception",
"is",
"thrown",
".",
"The",
"following",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.security/src/com/ibm/ws/ejbcontainer/security/internal/jacc/EJBJaccAuthorizationHelper.java#L91-L138 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.uninstallFeaturesPrereqChecking | public void uninstallFeaturesPrereqChecking(Collection<String> featureNames, boolean allowUninstallAll, boolean force) throws InstallException {
"""
Creates array of productIds and calls method below
@param featureNames Collection of features names to uninstall
@param allowUninstallAll If false, will fail if n... | java | public void uninstallFeaturesPrereqChecking(Collection<String> featureNames, boolean allowUninstallAll, boolean force) throws InstallException {
getUninstallDirector().uninstallFeaturesPrereqChecking(featureNames, allowUninstallAll, force);
} | [
"public",
"void",
"uninstallFeaturesPrereqChecking",
"(",
"Collection",
"<",
"String",
">",
"featureNames",
",",
"boolean",
"allowUninstallAll",
",",
"boolean",
"force",
")",
"throws",
"InstallException",
"{",
"getUninstallDirector",
"(",
")",
".",
"uninstallFeaturesPre... | Creates array of productIds and calls method below
@param featureNames Collection of features names to uninstall
@param allowUninstallAll If false, will fail if no user features are installed
@param force If uninstallation should be forced
@throws InstallException | [
"Creates",
"array",
"of",
"productIds",
"and",
"calls",
"method",
"below"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1896-L1898 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.