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 |
|---|---|---|---|---|---|---|---|---|---|---|
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendText | public static <T> void sendText(final String message, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context, long timeoutmillis) {
"""
Sends a complete text message, invoking the callback when complete
@param message The text to send
@param wsChannel The web socket channel
@param ca... | java | public static <T> void sendText(final String message, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context, long timeoutmillis) {
final ByteBuffer data = ByteBuffer.wrap(message.getBytes(StandardCharsets.UTF_8));
sendInternal(data, WebSocketFrameType.TEXT, wsChannel, callback... | [
"public",
"static",
"<",
"T",
">",
"void",
"sendText",
"(",
"final",
"String",
"message",
",",
"final",
"WebSocketChannel",
"wsChannel",
",",
"final",
"WebSocketCallback",
"<",
"T",
">",
"callback",
",",
"T",
"context",
",",
"long",
"timeoutmillis",
")",
"{"... | Sends a complete text message, invoking the callback when complete
@param message The text to send
@param wsChannel The web socket channel
@param callback The callback to invoke on completion
@param context The context object that will be passed to the callback on completion
@param timeoutmillis the timeout in millise... | [
"Sends",
"a",
"complete",
"text",
"message",
"invoking",
"the",
"callback",
"when",
"complete"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L87-L90 |
apereo/cas | core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/actions/RedirectToServiceAction.java | RedirectToServiceAction.finalizeResponseEvent | protected Event finalizeResponseEvent(final RequestContext requestContext, final WebApplicationService service, final Response response) {
"""
Finalize response event event.
@param requestContext the request context
@param service the service
@param response the response
@return the event
""... | java | protected Event finalizeResponseEvent(final RequestContext requestContext, final WebApplicationService service, final Response response) {
WebUtils.putServiceResponseIntoRequestScope(requestContext, response);
WebUtils.putServiceOriginalUrlIntoRequestScope(requestContext, service);
val eventId =... | [
"protected",
"Event",
"finalizeResponseEvent",
"(",
"final",
"RequestContext",
"requestContext",
",",
"final",
"WebApplicationService",
"service",
",",
"final",
"Response",
"response",
")",
"{",
"WebUtils",
".",
"putServiceResponseIntoRequestScope",
"(",
"requestContext",
... | Finalize response event event.
@param requestContext the request context
@param service the service
@param response the response
@return the event | [
"Finalize",
"response",
"event",
"event",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/actions/RedirectToServiceAction.java#L55-L60 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java | ServerRedirectService.setHostHeader | public void setHostHeader(String newHost, int id) {
"""
Set (optional) host header for a server
@param newHost host header
@param id server ID
"""
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepare... | java | public void setHostHeader(String newHost, int id) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_SERVERS +
" SET " + Constants.... | [
"public",
"void",
"setHostHeader",
"(",
"String",
"newHost",
",",
"int",
"id",
")",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"getConnection",
"(",
")",
")",
"{",
"statement",
... | Set (optional) host header for a server
@param newHost host header
@param id server ID | [
"Set",
"(",
"optional",
")",
"host",
"header",
"for",
"a",
"server"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ServerRedirectService.java#L538-L561 |
ops4j/org.ops4j.base | ops4j-base-lang/src/main/java/org/ops4j/lang/PostConditionException.java | PostConditionException.validateEqualTo | public static void validateEqualTo( long value, long condition, String identifier )
throws PostConditionException {
"""
Validates that the value under test is a particular value.
This method ensures that <code>value == condition</code>.
@param identifier The name of the object.
@param condition The... | java | public static void validateEqualTo( long value, long condition, String identifier )
throws PostConditionException
{
if( value == condition )
{
return;
}
throw new PostConditionException( identifier + " was not equal to " + condition + ". Was: " + value );
} | [
"public",
"static",
"void",
"validateEqualTo",
"(",
"long",
"value",
",",
"long",
"condition",
",",
"String",
"identifier",
")",
"throws",
"PostConditionException",
"{",
"if",
"(",
"value",
"==",
"condition",
")",
"{",
"return",
";",
"}",
"throw",
"new",
"Po... | Validates that the value under test is a particular value.
This method ensures that <code>value == condition</code>.
@param identifier The name of the object.
@param condition The condition value.
@param value The value to be tested.
@throws PostConditionException if the condition is not met. | [
"Validates",
"that",
"the",
"value",
"under",
"test",
"is",
"a",
"particular",
"value",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/PostConditionException.java#L212-L220 |
census-instrumentation/opencensus-java | contrib/agent/src/main/java/io/opencensus/contrib/agent/AgentMain.java | AgentMain.premain | public static void premain(String agentArgs, Instrumentation instrumentation) throws Exception {
"""
Initializes the OpenCensus Agent for Java.
@param agentArgs agent options, passed as a single string by the JVM
@param instrumentation the {@link Instrumentation} object provided by the JVM for instrumenting
J... | java | public static void premain(String agentArgs, Instrumentation instrumentation) throws Exception {
checkNotNull(instrumentation, "instrumentation");
logger.fine("Initializing.");
// The classes in bootstrap.jar, such as ContextManger and ContextStrategy, will be referenced
// from classes loaded by the ... | [
"public",
"static",
"void",
"premain",
"(",
"String",
"agentArgs",
",",
"Instrumentation",
"instrumentation",
")",
"throws",
"Exception",
"{",
"checkNotNull",
"(",
"instrumentation",
",",
"\"instrumentation\"",
")",
";",
"logger",
".",
"fine",
"(",
"\"Initializing.\... | Initializes the OpenCensus Agent for Java.
@param agentArgs agent options, passed as a single string by the JVM
@param instrumentation the {@link Instrumentation} object provided by the JVM for instrumenting
Java programming language code
@throws Exception if initialization of the agent fails
@see java.lang.instrument... | [
"Initializes",
"the",
"OpenCensus",
"Agent",
"for",
"Java",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/contrib/agent/src/main/java/io/opencensus/contrib/agent/AgentMain.java#L64-L91 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.setBounds | public void setBounds(TypeVar t, List<Type> bounds) {
"""
Same as {@link Types#setBounds(TypeVar, List, boolean)}, except that third parameter is computed directly,
as follows: if all all bounds are interface types, the computed supertype is Object,otherwise
the supertype is simply left null (in this case, the s... | java | public void setBounds(TypeVar t, List<Type> bounds) {
setBounds(t, bounds, bounds.head.tsym.isInterface());
} | [
"public",
"void",
"setBounds",
"(",
"TypeVar",
"t",
",",
"List",
"<",
"Type",
">",
"bounds",
")",
"{",
"setBounds",
"(",
"t",
",",
"bounds",
",",
"bounds",
".",
"head",
".",
"tsym",
".",
"isInterface",
"(",
")",
")",
";",
"}"
] | Same as {@link Types#setBounds(TypeVar, List, boolean)}, except that third parameter is computed directly,
as follows: if all all bounds are interface types, the computed supertype is Object,otherwise
the supertype is simply left null (in this case, the supertype is assumed to be the head of
the bound list passed as se... | [
"Same",
"as",
"{",
"@link",
"Types#setBounds",
"(",
"TypeVar",
"List",
"boolean",
")",
"}",
"except",
"that",
"third",
"parameter",
"is",
"computed",
"directly",
"as",
"follows",
":",
"if",
"all",
"all",
"bounds",
"are",
"interface",
"types",
"the",
"compute... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L2405-L2407 |
cubedtear/aritzh | aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java | Configuration.hasProperty | public boolean hasProperty(String category, String key) {
"""
Checks whether the specified key is present in the specified category
@param category The category to look into for the key
@param key The key to look for
@return {@code true} if the key was found in the category, {@code false} otherwise
"... | java | public boolean hasProperty(String category, String key) {
return this.categories.containsKey(category) && this.categories.get(category).containsKey(key);
} | [
"public",
"boolean",
"hasProperty",
"(",
"String",
"category",
",",
"String",
"key",
")",
"{",
"return",
"this",
".",
"categories",
".",
"containsKey",
"(",
"category",
")",
"&&",
"this",
".",
"categories",
".",
"get",
"(",
"category",
")",
".",
"containsK... | Checks whether the specified key is present in the specified category
@param category The category to look into for the key
@param key The key to look for
@return {@code true} if the key was found in the category, {@code false} otherwise | [
"Checks",
"whether",
"the",
"specified",
"key",
"is",
"present",
"in",
"the",
"specified",
"category"
] | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java#L262-L264 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/conversions/explicit/ConversionAnalyzer.java | ConversionAnalyzer.isPresentIn | private boolean isPresentIn(String[] values, String field) {
"""
Returns true if the field name is contained in the values array, false otherwise.
@param values array of values
@param field field name to check
@return true if the field name is contained in the values array, false otherwise
"""
for (Strin... | java | private boolean isPresentIn(String[] values, String field){
for (String value : values)
if(value.equalsIgnoreCase(JMapConversion.ALL) || value.equals(field))
return true;
return false;
} | [
"private",
"boolean",
"isPresentIn",
"(",
"String",
"[",
"]",
"values",
",",
"String",
"field",
")",
"{",
"for",
"(",
"String",
"value",
":",
"values",
")",
"if",
"(",
"value",
".",
"equalsIgnoreCase",
"(",
"JMapConversion",
".",
"ALL",
")",
"||",
"value... | Returns true if the field name is contained in the values array, false otherwise.
@param values array of values
@param field field name to check
@return true if the field name is contained in the values array, false otherwise | [
"Returns",
"true",
"if",
"the",
"field",
"name",
"is",
"contained",
"in",
"the",
"values",
"array",
"false",
"otherwise",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/conversions/explicit/ConversionAnalyzer.java#L157-L163 |
jamesagnew/hapi-fhir | hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProvider.java | AbstractJaxRsResourceProvider.getResourceRequest | private Builder getResourceRequest(final RequestTypeEnum requestType, final RestOperationTypeEnum restOperation) {
"""
Return the request builder based on the resource name for the server
@param requestType the type of the request
@param restOperation the rest operation type
@return the requestbuilder
"""
... | java | private Builder getResourceRequest(final RequestTypeEnum requestType, final RestOperationTypeEnum restOperation) {
return getRequest(requestType, restOperation, getResourceType().getSimpleName());
} | [
"private",
"Builder",
"getResourceRequest",
"(",
"final",
"RequestTypeEnum",
"requestType",
",",
"final",
"RestOperationTypeEnum",
"restOperation",
")",
"{",
"return",
"getRequest",
"(",
"requestType",
",",
"restOperation",
",",
"getResourceType",
"(",
")",
".",
"getS... | Return the request builder based on the resource name for the server
@param requestType the type of the request
@param restOperation the rest operation type
@return the requestbuilder | [
"Return",
"the",
"request",
"builder",
"based",
"on",
"the",
"resource",
"name",
"for",
"the",
"server"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProvider.java#L371-L373 |
apache/incubator-druid | indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java | TaskQueue.syncFromStorage | private void syncFromStorage() {
"""
Resync the contents of this task queue with our storage facility. Useful to make sure our in-memory state
corresponds to the storage facility even if the latter is manually modified.
"""
giant.lock();
try {
if (active) {
final Map<String, Task> newTa... | java | private void syncFromStorage()
{
giant.lock();
try {
if (active) {
final Map<String, Task> newTasks = toTaskIDMap(taskStorage.getActiveTasks());
final int tasksSynced = newTasks.size();
final Map<String, Task> oldTasks = toTaskIDMap(tasks);
// Calculate differences on I... | [
"private",
"void",
"syncFromStorage",
"(",
")",
"{",
"giant",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"active",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Task",
">",
"newTasks",
"=",
"toTaskIDMap",
"(",
"taskStorage",
".",
"getActiveTas... | Resync the contents of this task queue with our storage facility. Useful to make sure our in-memory state
corresponds to the storage facility even if the latter is manually modified. | [
"Resync",
"the",
"contents",
"of",
"this",
"task",
"queue",
"with",
"our",
"storage",
"facility",
".",
"Useful",
"to",
"make",
"sure",
"our",
"in",
"-",
"memory",
"state",
"corresponds",
"to",
"the",
"storage",
"facility",
"even",
"if",
"the",
"latter",
"i... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java#L557-L604 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_phonebook_bookKey_GET | public OvhPhonebookMaster billingAccount_phonebook_bookKey_GET(String billingAccount, String bookKey) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/phonebook/{bookKey}
@param billingAccount [required] The name of your billingAccount
@param bookKey [required] Identif... | java | public OvhPhonebookMaster billingAccount_phonebook_bookKey_GET(String billingAccount, String bookKey) throws IOException {
String qPath = "/telephony/{billingAccount}/phonebook/{bookKey}";
StringBuilder sb = path(qPath, billingAccount, bookKey);
String resp = exec(qPath, "GET", sb.toString(), null);
return conv... | [
"public",
"OvhPhonebookMaster",
"billingAccount_phonebook_bookKey_GET",
"(",
"String",
"billingAccount",
",",
"String",
"bookKey",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/phonebook/{bookKey}\"",
";",
"StringBuilder",
"sb",
"="... | Get this object properties
REST: GET /telephony/{billingAccount}/phonebook/{bookKey}
@param billingAccount [required] The name of your billingAccount
@param bookKey [required] Identifier of the phonebook | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5568-L5573 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ras/SibTr.java | SibTr.bytes | public static void bytes (TraceComponent tc, byte[] data) {
"""
If debug level tracing is enabled then trace a byte array using formatted
output with offsets. Duplicate output lines are suppressed to save space.
<p>
@param tc the non-null <code>TraceComponent</code> the event is associated
with.
@param data t... | java | public static void bytes (TraceComponent tc, byte[] data) {
int length = 0;
if (data != null) length = data.length;
bytes(null, tc, data, 0, length, "");
} | [
"public",
"static",
"void",
"bytes",
"(",
"TraceComponent",
"tc",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"int",
"length",
"=",
"0",
";",
"if",
"(",
"data",
"!=",
"null",
")",
"length",
"=",
"data",
".",
"length",
";",
"bytes",
"(",
"null",
",",
... | If debug level tracing is enabled then trace a byte array using formatted
output with offsets. Duplicate output lines are suppressed to save space.
<p>
@param tc the non-null <code>TraceComponent</code> the event is associated
with.
@param data the byte array to be traced | [
"If",
"debug",
"level",
"tracing",
"is",
"enabled",
"then",
"trace",
"a",
"byte",
"array",
"using",
"formatted",
"output",
"with",
"offsets",
".",
"Duplicate",
"output",
"lines",
"are",
"suppressed",
"to",
"save",
"space",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/ras/SibTr.java#L1157-L1161 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionsInner.java | ExpressRouteCircuitConnectionsInner.beginCreateOrUpdateAsync | public Observable<ExpressRouteCircuitConnectionInner> beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) {
"""
Creates or updates a Express Route Circuit Connection in the spec... | java | public Observable<ExpressRouteCircuitConnectionInner> beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, String connectionName, ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupNa... | [
"public",
"Observable",
"<",
"ExpressRouteCircuitConnectionInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"String",
"peeringName",
",",
"String",
"connectionName",
",",
"ExpressRouteCircuitConnectionInner",
"exp... | Creates or updates a Express Route Circuit Connection in the specified express route circuits.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param peeringName The name of the peering.
@param connectionName The name of the express route circuit conne... | [
"Creates",
"or",
"updates",
"a",
"Express",
"Route",
"Circuit",
"Connection",
"in",
"the",
"specified",
"express",
"route",
"circuits",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitConnectionsInner.java#L490-L497 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/cky/intdata/IntNaryTree.java | IntNaryTree.leftBinarize | public IntBinaryTree leftBinarize(IntObjectBimap<String> ntAlphabet) {
"""
Get a left-binarized form of this tree.
This returns a binarized form that relabels the nodes just as in the
Berkeley parser.
@param ntAlphabet The alphabet to use for the non-lexical nodes.
"""
IntObjectBimap<String> alp... | java | public IntBinaryTree leftBinarize(IntObjectBimap<String> ntAlphabet) {
IntObjectBimap<String> alphabet = isLexical ? this.alphabet : ntAlphabet;
// Reset the symbol id according to the new alphabet.
int symbol = alphabet.lookupIndex(getSymbolLabel());
IntBinaryTree leftChild;
In... | [
"public",
"IntBinaryTree",
"leftBinarize",
"(",
"IntObjectBimap",
"<",
"String",
">",
"ntAlphabet",
")",
"{",
"IntObjectBimap",
"<",
"String",
">",
"alphabet",
"=",
"isLexical",
"?",
"this",
".",
"alphabet",
":",
"ntAlphabet",
";",
"// Reset the symbol id according ... | Get a left-binarized form of this tree.
This returns a binarized form that relabels the nodes just as in the
Berkeley parser.
@param ntAlphabet The alphabet to use for the non-lexical nodes. | [
"Get",
"a",
"left",
"-",
"binarized",
"form",
"of",
"this",
"tree",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/cky/intdata/IntNaryTree.java#L353-L393 |
JadiraOrg/jadira | jms/src/main/java/org/jadira/jms/template/BatchedJmsTemplate.java | BatchedJmsTemplate.receiveSelectedAndConvertBatch | public List<Object> receiveSelectedAndConvertBatch(Destination destination, String messageSelector)
throws JmsException {
"""
Receive a batch of up to default batch size for given Destination and message selector and convert each message in the batch. Other than batching this method is the same as
{@l... | java | public List<Object> receiveSelectedAndConvertBatch(Destination destination, String messageSelector)
throws JmsException {
return receiveSelectedAndConvertBatch(destination, messageSelector, getBatchSize());
} | [
"public",
"List",
"<",
"Object",
">",
"receiveSelectedAndConvertBatch",
"(",
"Destination",
"destination",
",",
"String",
"messageSelector",
")",
"throws",
"JmsException",
"{",
"return",
"receiveSelectedAndConvertBatch",
"(",
"destination",
",",
"messageSelector",
",",
... | Receive a batch of up to default batch size for given Destination and message selector and convert each message in the batch. Other than batching this method is the same as
{@link JmsTemplate#receiveSelectedAndConvert(Destination, String)}
@return A list of {@link Message}
@param destination The Destination
@param mess... | [
"Receive",
"a",
"batch",
"of",
"up",
"to",
"default",
"batch",
"size",
"for",
"given",
"Destination",
"and",
"message",
"selector",
"and",
"convert",
"each",
"message",
"in",
"the",
"batch",
".",
"Other",
"than",
"batching",
"this",
"method",
"is",
"the",
... | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/jms/src/main/java/org/jadira/jms/template/BatchedJmsTemplate.java#L381-L384 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/servicefactory/ServiceFactory.java | ServiceFactory.getInstance | public synchronized static ServiceFactory getInstance(Class<?> aClass, String configurationPath) {
"""
Singleton factory method
@param aClass the class implements
@param configurationPath the path to the configuration details
@return a single instance of the ServiceFactory object
for the JVM
"""
... | java | public synchronized static ServiceFactory getInstance(Class<?> aClass, String configurationPath)
{
if(configurationPath == null)
{
configurationPath = "";
}
if (instances.get(configurationPath) == null)
{
instances.put(con... | [
"public",
"synchronized",
"static",
"ServiceFactory",
"getInstance",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"String",
"configurationPath",
")",
"{",
"if",
"(",
"configurationPath",
"==",
"null",
")",
"{",
"configurationPath",
"=",
"\"\"",
";",
"}",
"if",
... | Singleton factory method
@param aClass the class implements
@param configurationPath the path to the configuration details
@return a single instance of the ServiceFactory object
for the JVM | [
"Singleton",
"factory",
"method"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/servicefactory/ServiceFactory.java#L107-L120 |
devnull-tools/trugger | src/main/java/tools/devnull/trugger/reflection/impl/TruggerGenericTypeResolver.java | TruggerGenericTypeResolver.resolveParameterName | static Class<?> resolveParameterName(String parameterName, Class<?> target) {
"""
Resolves the generic parameter name of a class.
@param parameterName the parameter name
@param target the target class
@return the parameter class.
"""
Map<Type, Type> typeVariableMap = getTypeVariableMap(target... | java | static Class<?> resolveParameterName(String parameterName, Class<?> target) {
Map<Type, Type> typeVariableMap = getTypeVariableMap(target);
Set<Entry<Type, Type>> set = typeVariableMap.entrySet();
Type type = Object.class;
for (Entry<Type, Type> entry : set) {
if (entry.getKey().toString().equals... | [
"static",
"Class",
"<",
"?",
">",
"resolveParameterName",
"(",
"String",
"parameterName",
",",
"Class",
"<",
"?",
">",
"target",
")",
"{",
"Map",
"<",
"Type",
",",
"Type",
">",
"typeVariableMap",
"=",
"getTypeVariableMap",
"(",
"target",
")",
";",
"Set",
... | Resolves the generic parameter name of a class.
@param parameterName the parameter name
@param target the target class
@return the parameter class. | [
"Resolves",
"the",
"generic",
"parameter",
"name",
"of",
"a",
"class",
"."
] | train | https://github.com/devnull-tools/trugger/blob/614d5f0b30daf82fc251a46fb436d0fc5e787627/src/main/java/tools/devnull/trugger/reflection/impl/TruggerGenericTypeResolver.java#L72-L84 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/contextmenu/CmsContextMenuButton.java | CmsContextMenuButton.showMenu | public void showMenu(List<I_CmsContextMenuEntry> menuEntries) {
"""
Creates the menu and adds it to the panel.<p>
@param menuEntries the menu entries
"""
if (!CmsClientCollectionUtil.isEmptyOrNull(menuEntries)) {
// if there were entries found for the menu, create the menu
... | java | public void showMenu(List<I_CmsContextMenuEntry> menuEntries) {
if (!CmsClientCollectionUtil.isEmptyOrNull(menuEntries)) {
// if there were entries found for the menu, create the menu
m_menu = new CmsContextMenu(menuEntries, true, getPopup());
// add the resize handler ... | [
"public",
"void",
"showMenu",
"(",
"List",
"<",
"I_CmsContextMenuEntry",
">",
"menuEntries",
")",
"{",
"if",
"(",
"!",
"CmsClientCollectionUtil",
".",
"isEmptyOrNull",
"(",
"menuEntries",
")",
")",
"{",
"// if there were entries found for the menu, create the menu\r",
"... | Creates the menu and adds it to the panel.<p>
@param menuEntries the menu entries | [
"Creates",
"the",
"menu",
"and",
"adds",
"it",
"to",
"the",
"panel",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/contextmenu/CmsContextMenuButton.java#L155-L184 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.identity_group_group_PUT | public void identity_group_group_PUT(String group, String description, OvhRoleEnum role) throws IOException {
"""
Alter a group
REST: PUT /me/identity/group/{group}
@param group [required] Group's name
@param description [required] Group's description
@param role [required] Group's role
"""
String qPat... | java | public void identity_group_group_PUT(String group, String description, OvhRoleEnum role) throws IOException {
String qPath = "/me/identity/group/{group}";
StringBuilder sb = path(qPath, group);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "description", description);
addBody(o, "role",... | [
"public",
"void",
"identity_group_group_PUT",
"(",
"String",
"group",
",",
"String",
"description",
",",
"OvhRoleEnum",
"role",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/identity/group/{group}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",... | Alter a group
REST: PUT /me/identity/group/{group}
@param group [required] Group's name
@param description [required] Group's description
@param role [required] Group's role | [
"Alter",
"a",
"group"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L299-L306 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/chrono/ChronoPeriodImpl.java | ChronoPeriodImpl.validateAmount | private ChronoPeriodImpl validateAmount(TemporalAmount amount) {
"""
Obtains an instance of {@code ChronoPeriodImpl} from a temporal amount.
@param amount the temporal amount to convert, not null
@return the period, not null
"""
Objects.requireNonNull(amount, "amount");
if (amount instance... | java | private ChronoPeriodImpl validateAmount(TemporalAmount amount) {
Objects.requireNonNull(amount, "amount");
if (amount instanceof ChronoPeriodImpl == false) {
throw new DateTimeException("Unable to obtain ChronoPeriod from TemporalAmount: " + amount.getClass());
}
ChronoPeriod... | [
"private",
"ChronoPeriodImpl",
"validateAmount",
"(",
"TemporalAmount",
"amount",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"amount",
",",
"\"amount\"",
")",
";",
"if",
"(",
"amount",
"instanceof",
"ChronoPeriodImpl",
"==",
"false",
")",
"{",
"throw",
"ne... | Obtains an instance of {@code ChronoPeriodImpl} from a temporal amount.
@param amount the temporal amount to convert, not null
@return the period, not null | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"ChronoPeriodImpl",
"}",
"from",
"a",
"temporal",
"amount",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/chrono/ChronoPeriodImpl.java#L201-L211 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLErrorResponseWriter.java | XMLErrorResponseWriter.writeError | public void writeError(ODataException exception) throws ODataRenderException {
"""
<p>
Write an error for a given exception.
</p>
<p>
<b>Note:</b> Make sure {@link XMLErrorResponseWriter#startDocument()}
has been previously invoked to start the XML
stream document, and {@link XMLErrorResponseWriter#endDocume... | java | public void writeError(ODataException exception) throws ODataRenderException {
checkNotNull(exception);
try {
xmlWriter.writeStartElement(ODATA_METADATA_NS, ERROR);
xmlWriter.writeNamespace(METADATA, ODATA_METADATA_NS);
xmlWriter.writeStartElement(METADATA, ErrorRen... | [
"public",
"void",
"writeError",
"(",
"ODataException",
"exception",
")",
"throws",
"ODataRenderException",
"{",
"checkNotNull",
"(",
"exception",
")",
";",
"try",
"{",
"xmlWriter",
".",
"writeStartElement",
"(",
"ODATA_METADATA_NS",
",",
"ERROR",
")",
";",
"xmlWri... | <p>
Write an error for a given exception.
</p>
<p>
<b>Note:</b> Make sure {@link XMLErrorResponseWriter#startDocument()}
has been previously invoked to start the XML
stream document, and {@link XMLErrorResponseWriter#endDocument()} is invoked after to end it.
</p>
@param exception The exception to write an error for. ... | [
"<p",
">",
"Write",
"an",
"error",
"for",
"a",
"given",
"exception",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"Note",
":",
"<",
"/",
"b",
">",
"Make",
"sure",
"{",
"@link",
"XMLErrorResponseWriter#startDocument",
"()",
"}",
"has",
"been",
"prev... | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLErrorResponseWriter.java#L102-L125 |
mapbox/mapbox-plugins-android | plugin-offline/src/main/java/com/mapbox/mapboxsdk/plugins/offline/offline/OfflinePlugin.java | OfflinePlugin.removeDownload | void removeDownload(OfflineDownloadOptions offlineDownload, boolean canceled) {
"""
Called when the OfflineDownloadService has finished downloading.
@param offlineDownload the offline download to stop tracking
@since 0.1.0
"""
if (canceled) {
stateChangeDispatcher.onCancel(offlineDownload);
}... | java | void removeDownload(OfflineDownloadOptions offlineDownload, boolean canceled) {
if (canceled) {
stateChangeDispatcher.onCancel(offlineDownload);
} else {
stateChangeDispatcher.onSuccess(offlineDownload);
}
offlineDownloads.remove(offlineDownload);
} | [
"void",
"removeDownload",
"(",
"OfflineDownloadOptions",
"offlineDownload",
",",
"boolean",
"canceled",
")",
"{",
"if",
"(",
"canceled",
")",
"{",
"stateChangeDispatcher",
".",
"onCancel",
"(",
"offlineDownload",
")",
";",
"}",
"else",
"{",
"stateChangeDispatcher",
... | Called when the OfflineDownloadService has finished downloading.
@param offlineDownload the offline download to stop tracking
@since 0.1.0 | [
"Called",
"when",
"the",
"OfflineDownloadService",
"has",
"finished",
"downloading",
"."
] | train | https://github.com/mapbox/mapbox-plugins-android/blob/c683cad4d8306945d71838d96fae73b8cbe2e6c9/plugin-offline/src/main/java/com/mapbox/mapboxsdk/plugins/offline/offline/OfflinePlugin.java#L169-L176 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlignResult.java | QsAlignResult.setSubunitMap | public void setSubunitMap(Map<Integer, Integer> subunitMap) {
"""
Map of Subunit equivalencies from the first to the second group.
@param subunitMap
"""
// Check consistency of the map
if (Collections.max(subunitMap.keySet()) > subunits1.size()
| Collections.max(subunitMap.values()) > subunits2.siz... | java | public void setSubunitMap(Map<Integer, Integer> subunitMap) {
// Check consistency of the map
if (Collections.max(subunitMap.keySet()) > subunits1.size()
| Collections.max(subunitMap.values()) > subunits2.size())
throw new IndexOutOfBoundsException(
"Subunit Map index higher than Subunit List size.");
... | [
"public",
"void",
"setSubunitMap",
"(",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"subunitMap",
")",
"{",
"// Check consistency of the map",
"if",
"(",
"Collections",
".",
"max",
"(",
"subunitMap",
".",
"keySet",
"(",
")",
")",
">",
"subunits1",
".",
"size... | Map of Subunit equivalencies from the first to the second group.
@param subunitMap | [
"Map",
"of",
"Subunit",
"equivalencies",
"from",
"the",
"first",
"to",
"the",
"second",
"group",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlignResult.java#L111-L137 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/neuralnetwork/regularizers/Max2NormRegularizer.java | Max2NormRegularizer.setMaxNorm | public void setMaxNorm(double maxNorm) {
"""
Sets the maximum allowed 2 norm for a single neuron's weights
@param maxNorm the maximum norm per neuron's weights
"""
if(Double.isNaN(maxNorm) || Double.isInfinite(maxNorm) || maxNorm <= 0)
throw new IllegalArgumentException("The maximum norm... | java | public void setMaxNorm(double maxNorm)
{
if(Double.isNaN(maxNorm) || Double.isInfinite(maxNorm) || maxNorm <= 0)
throw new IllegalArgumentException("The maximum norm must be a positive constant, not " + maxNorm);
this.maxNorm = maxNorm;
} | [
"public",
"void",
"setMaxNorm",
"(",
"double",
"maxNorm",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"maxNorm",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"maxNorm",
")",
"||",
"maxNorm",
"<=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",... | Sets the maximum allowed 2 norm for a single neuron's weights
@param maxNorm the maximum norm per neuron's weights | [
"Sets",
"the",
"maximum",
"allowed",
"2",
"norm",
"for",
"a",
"single",
"neuron",
"s",
"weights"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/neuralnetwork/regularizers/Max2NormRegularizer.java#L34-L39 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_timeCondition_serviceName_options_PUT | public void billingAccount_timeCondition_serviceName_options_PUT(String billingAccount, String serviceName, OvhTimeConditionOptions body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/timeCondition/{serviceName}/options
@param body [required] New object properties
... | java | public void billingAccount_timeCondition_serviceName_options_PUT(String billingAccount, String serviceName, OvhTimeConditionOptions body) throws IOException {
String qPath = "/telephony/{billingAccount}/timeCondition/{serviceName}/options";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, ... | [
"public",
"void",
"billingAccount_timeCondition_serviceName_options_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhTimeConditionOptions",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/timeConditi... | Alter this object properties
REST: PUT /telephony/{billingAccount}/timeCondition/{serviceName}/options
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5883-L5887 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java | SHPDriverFunction.exportTable | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
"""
Save a table or a query to a shpfile
@param connection Active connection, do not close this connection.
@param tableReference [[cata... | java | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
final boolean isH2 = JDBCUtilities.isH2DataBase(connection.getMetaData());
String regex = ".*(?i)\\b(select|from)\\b.*";
... | [
"@",
"Override",
"public",
"void",
"exportTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"fin... | Save a table or a query to a shpfile
@param connection Active connection, do not close this connection.
@param tableReference [[catalog.]schema.]table reference
@param fileName File path to write, if exists it may be replaced
@param progress to display the IO progress
@param encoding File encoding, null will use defaul... | [
"Save",
"a",
"table",
"or",
"a",
"query",
"to",
"a",
"shpfile"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/shp/SHPDriverFunction.java#L75-L122 |
redisson/redisson | redisson/src/main/java/org/redisson/executor/TasksRunnerService.java | TasksRunnerService.asyncScheduledServiceAtFixed | private RemoteExecutorServiceAsync asyncScheduledServiceAtFixed(String executorId, String requestId) {
"""
Creates RemoteExecutorServiceAsync with special executor which overrides requestId generation
and uses current requestId. Because recurring tasks should use the same requestId.
@return
"""
Sch... | java | private RemoteExecutorServiceAsync asyncScheduledServiceAtFixed(String executorId, String requestId) {
ScheduledTasksService scheduledRemoteService = new ScheduledTasksService(codec, name, commandExecutor, executorId, responses);
scheduledRemoteService.setTerminationTopicName(terminationTopicName);
... | [
"private",
"RemoteExecutorServiceAsync",
"asyncScheduledServiceAtFixed",
"(",
"String",
"executorId",
",",
"String",
"requestId",
")",
"{",
"ScheduledTasksService",
"scheduledRemoteService",
"=",
"new",
"ScheduledTasksService",
"(",
"codec",
",",
"name",
",",
"commandExecut... | Creates RemoteExecutorServiceAsync with special executor which overrides requestId generation
and uses current requestId. Because recurring tasks should use the same requestId.
@return | [
"Creates",
"RemoteExecutorServiceAsync",
"with",
"special",
"executor",
"which",
"overrides",
"requestId",
"generation",
"and",
"uses",
"current",
"requestId",
".",
"Because",
"recurring",
"tasks",
"should",
"use",
"the",
"same",
"requestId",
"."
] | train | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/executor/TasksRunnerService.java#L163-L175 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/BaseCustomDfuImpl.java | BaseCustomDfuImpl.writeInitData | void writeInitData(final BluetoothGattCharacteristic characteristic, final CRC32 crc32)
throws DfuException, DeviceDisconnectedException, UploadAbortedException {
"""
Wends the whole init packet stream to the given characteristic.
@param characteristic the target characteristic
@param crc32 the CRC... | java | void writeInitData(final BluetoothGattCharacteristic characteristic, final CRC32 crc32)
throws DfuException, DeviceDisconnectedException, UploadAbortedException {
try {
byte[] data = mBuffer;
int size;
while ((size = mInitPacketStream.read(data, 0, data.length)) != -1) {
writeInitPacket(characteristic... | [
"void",
"writeInitData",
"(",
"final",
"BluetoothGattCharacteristic",
"characteristic",
",",
"final",
"CRC32",
"crc32",
")",
"throws",
"DfuException",
",",
"DeviceDisconnectedException",
",",
"UploadAbortedException",
"{",
"try",
"{",
"byte",
"[",
"]",
"data",
"=",
... | Wends the whole init packet stream to the given characteristic.
@param characteristic the target characteristic
@param crc32 the CRC object to be updated based on the data sent
@throws DeviceDisconnectedException Thrown when the device will disconnect in the middle of
the transmission.
@throws DfuException ... | [
"Wends",
"the",
"whole",
"init",
"packet",
"stream",
"to",
"the",
"given",
"characteristic",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/BaseCustomDfuImpl.java#L293-L307 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/predicate/FullText.java | FullText.fullTextMatch | public static P<String> fullTextMatch(String configuration, boolean plain, final String value) {
"""
Build full text matching predicate (use in has(column,...))
@param configuration the full text configuration to use
@param plain should we use plain mode?
@param value the value to search for
@return the predic... | java | public static P<String> fullTextMatch(String configuration, boolean plain, final String value){
return new P<>(new FullText(configuration,null,plain),value);
} | [
"public",
"static",
"P",
"<",
"String",
">",
"fullTextMatch",
"(",
"String",
"configuration",
",",
"boolean",
"plain",
",",
"final",
"String",
"value",
")",
"{",
"return",
"new",
"P",
"<>",
"(",
"new",
"FullText",
"(",
"configuration",
",",
"null",
",",
... | Build full text matching predicate (use in has(column,...))
@param configuration the full text configuration to use
@param plain should we use plain mode?
@param value the value to search for
@return the predicate | [
"Build",
"full",
"text",
"matching",
"predicate",
"(",
"use",
"in",
"has",
"(",
"column",
"...",
"))"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/predicate/FullText.java#L53-L55 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/csskit/MatchConditionOnElements.java | MatchConditionOnElements.removeMatch | public void removeMatch(Element e, PseudoClassType pseudoClass) {
"""
Removes the pseudo class from the given element.
@param e the DOM element
@param pseudoClass the pseudo class to be removed
"""
if (elements != null)
{
Set<PseudoClassType> classes = elements.get(e);
... | java | public void removeMatch(Element e, PseudoClassType pseudoClass)
{
if (elements != null)
{
Set<PseudoClassType> classes = elements.get(e);
if (classes != null)
classes.remove(pseudoClass);
}
} | [
"public",
"void",
"removeMatch",
"(",
"Element",
"e",
",",
"PseudoClassType",
"pseudoClass",
")",
"{",
"if",
"(",
"elements",
"!=",
"null",
")",
"{",
"Set",
"<",
"PseudoClassType",
">",
"classes",
"=",
"elements",
".",
"get",
"(",
"e",
")",
";",
"if",
... | Removes the pseudo class from the given element.
@param e the DOM element
@param pseudoClass the pseudo class to be removed | [
"Removes",
"the",
"pseudo",
"class",
"from",
"the",
"given",
"element",
"."
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/csskit/MatchConditionOnElements.java#L86-L94 |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java | VerifierFactory.compileSchema | public Schema compileSchema( InputStream stream )
throws VerifierConfigurationException, SAXException, IOException {
"""
processes a schema into a Schema object, which is a compiled representation
of a schema.
The obtained schema object can then be used concurrently across multiple
threads.
@param strea... | java | public Schema compileSchema( InputStream stream )
throws VerifierConfigurationException, SAXException, IOException {
return compileSchema(stream,null);
} | [
"public",
"Schema",
"compileSchema",
"(",
"InputStream",
"stream",
")",
"throws",
"VerifierConfigurationException",
",",
"SAXException",
",",
"IOException",
"{",
"return",
"compileSchema",
"(",
"stream",
",",
"null",
")",
";",
"}"
] | processes a schema into a Schema object, which is a compiled representation
of a schema.
The obtained schema object can then be used concurrently across multiple
threads.
@param stream
A stream object that holds a schema. | [
"processes",
"a",
"schema",
"into",
"a",
"Schema",
"object",
"which",
"is",
"a",
"compiled",
"representation",
"of",
"a",
"schema",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java#L136-L140 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/ContaineredTaskManagerParameters.java | ContaineredTaskManagerParameters.calculateCutoffMB | public static long calculateCutoffMB(Configuration config, long containerMemoryMB) {
"""
Calcuate cutoff memory size used by container, it will throw an {@link IllegalArgumentException}
if the config is invalid or return the cutoff value if valid.
@param config The Flink configuration.
@param containerMemoryM... | java | public static long calculateCutoffMB(Configuration config, long containerMemoryMB) {
Preconditions.checkArgument(containerMemoryMB > 0);
// (1) check cutoff ratio
final float memoryCutoffRatio = config.getFloat(
ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO);
if (memoryCutoffRatio >= 1 || memoryCu... | [
"public",
"static",
"long",
"calculateCutoffMB",
"(",
"Configuration",
"config",
",",
"long",
"containerMemoryMB",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"containerMemoryMB",
">",
"0",
")",
";",
"// (1) check cutoff ratio",
"final",
"float",
"memoryCuto... | Calcuate cutoff memory size used by container, it will throw an {@link IllegalArgumentException}
if the config is invalid or return the cutoff value if valid.
@param config The Flink configuration.
@param containerMemoryMB The size of the complete container, in megabytes.
@return cutoff memory size used by container. | [
"Calcuate",
"cutoff",
"memory",
"size",
"used",
"by",
"container",
"it",
"will",
"throw",
"an",
"{",
"@link",
"IllegalArgumentException",
"}",
"if",
"the",
"config",
"is",
"invalid",
"or",
"return",
"the",
"cutoff",
"value",
"if",
"valid",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/ContaineredTaskManagerParameters.java#L114-L143 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/FieldAccess.java | FieldAccess.isLongOrDouble | protected static boolean isLongOrDouble(FieldInstruction fieldIns, ConstantPoolGen cpg) {
"""
Return whether the given FieldInstruction accesses a long or double
field.
@param fieldIns
the FieldInstruction
@param cpg
the ConstantPoolGen for the method
"""
Type type = fieldIns.getFieldType(cpg);
... | java | protected static boolean isLongOrDouble(FieldInstruction fieldIns, ConstantPoolGen cpg) {
Type type = fieldIns.getFieldType(cpg);
int code = type.getType();
return code == Const.T_LONG || code == Const.T_DOUBLE;
} | [
"protected",
"static",
"boolean",
"isLongOrDouble",
"(",
"FieldInstruction",
"fieldIns",
",",
"ConstantPoolGen",
"cpg",
")",
"{",
"Type",
"type",
"=",
"fieldIns",
".",
"getFieldType",
"(",
"cpg",
")",
";",
"int",
"code",
"=",
"type",
".",
"getType",
"(",
")"... | Return whether the given FieldInstruction accesses a long or double
field.
@param fieldIns
the FieldInstruction
@param cpg
the ConstantPoolGen for the method | [
"Return",
"whether",
"the",
"given",
"FieldInstruction",
"accesses",
"a",
"long",
"or",
"double",
"field",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/FieldAccess.java#L94-L98 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.createSecurityGroup | public CreateSecurityGroupResponse createSecurityGroup(CreateSecurityGroupRequest request) {
"""
Creating a newly SecurityGroup with specified rules.
@param request The request containing all options for creating a new SecurityGroup.
@return The response with the id of SecurityGroup that was created newly.
... | java | public CreateSecurityGroupResponse createSecurityGroup(CreateSecurityGroupRequest request) {
checkNotNull(request, "request should not be null.");
if (Strings.isNullOrEmpty(request.getClientToken())) {
request.setClientToken(this.generateClientToken());
}
checkStringNotEmpty(... | [
"public",
"CreateSecurityGroupResponse",
"createSecurityGroup",
"(",
"CreateSecurityGroupRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"request",
".",
"ge... | Creating a newly SecurityGroup with specified rules.
@param request The request containing all options for creating a new SecurityGroup.
@return The response with the id of SecurityGroup that was created newly. | [
"Creating",
"a",
"newly",
"SecurityGroup",
"with",
"specified",
"rules",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L1524-L1537 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/sequences/SequenceGibbsSampler.java | SequenceGibbsSampler.sampleSequenceRepeatedly | public void sampleSequenceRepeatedly(SequenceModel model, int numSamples) {
"""
Samples the sequence repeatedly, making numSamples passes over the entire sequence.
Destructively modifies the sequence in place.
"""
int[] sequence = getRandomSequence(model);
sampleSequenceRepeatedly(model, sequence, n... | java | public void sampleSequenceRepeatedly(SequenceModel model, int numSamples) {
int[] sequence = getRandomSequence(model);
sampleSequenceRepeatedly(model, sequence, numSamples);
} | [
"public",
"void",
"sampleSequenceRepeatedly",
"(",
"SequenceModel",
"model",
",",
"int",
"numSamples",
")",
"{",
"int",
"[",
"]",
"sequence",
"=",
"getRandomSequence",
"(",
"model",
")",
";",
"sampleSequenceRepeatedly",
"(",
"model",
",",
"sequence",
",",
"numSa... | Samples the sequence repeatedly, making numSamples passes over the entire sequence.
Destructively modifies the sequence in place. | [
"Samples",
"the",
"sequence",
"repeatedly",
"making",
"numSamples",
"passes",
"over",
"the",
"entire",
"sequence",
".",
"Destructively",
"modifies",
"the",
"sequence",
"in",
"place",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/sequences/SequenceGibbsSampler.java#L179-L182 |
JOML-CI/JOML | src/org/joml/Matrix3x2f.java | Matrix3x2f.rotateTo | public Matrix3x2f rotateTo(Vector2fc fromDir, Vector2fc toDir, Matrix3x2f dest) {
"""
Apply a rotation transformation to this matrix that rotates the given normalized <code>fromDir</code> direction vector
to point along the normalized <code>toDir</code>, and store the result in <code>dest</code>.
<p>
If <code>M... | java | public Matrix3x2f rotateTo(Vector2fc fromDir, Vector2fc toDir, Matrix3x2f dest) {
float dot = fromDir.x() * toDir.x() + fromDir.y() * toDir.y();
float det = fromDir.x() * toDir.y() - fromDir.y() * toDir.x();
float rm00 = dot;
float rm01 = det;
float rm10 = -det;
float rm1... | [
"public",
"Matrix3x2f",
"rotateTo",
"(",
"Vector2fc",
"fromDir",
",",
"Vector2fc",
"toDir",
",",
"Matrix3x2f",
"dest",
")",
"{",
"float",
"dot",
"=",
"fromDir",
".",
"x",
"(",
")",
"*",
"toDir",
".",
"x",
"(",
")",
"+",
"fromDir",
".",
"y",
"(",
")",... | Apply a rotation transformation to this matrix that rotates the given normalized <code>fromDir</code> direction vector
to point along the normalized <code>toDir</code>, and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>R</code> the rotation matrix,
then the new matri... | [
"Apply",
"a",
"rotation",
"transformation",
"to",
"this",
"matrix",
"that",
"rotates",
"the",
"given",
"normalized",
"<code",
">",
"fromDir<",
"/",
"code",
">",
"direction",
"vector",
"to",
"point",
"along",
"the",
"normalized",
"<code",
">",
"toDir<",
"/",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2f.java#L2014-L2030 |
lessthanoptimal/ddogleg | src/org/ddogleg/solver/PolynomialOps.java | PolynomialOps.multiply | public static Polynomial multiply( Polynomial a , Polynomial b , Polynomial result ) {
"""
Multiplies the two polynomials together.
@param a Polynomial
@param b Polynomial
@param result Optional storage parameter for the results. Must be have enough coefficients to store the results.
If null a new instance is... | java | public static Polynomial multiply( Polynomial a , Polynomial b , Polynomial result ) {
int N = Math.max(0,a.size() + b.size() - 1);
if( result == null ) {
result = new Polynomial(N);
} else {
if( result.size < N )
throw new IllegalArgumentException("Unexpected length of 'result'");
result.zero();
... | [
"public",
"static",
"Polynomial",
"multiply",
"(",
"Polynomial",
"a",
",",
"Polynomial",
"b",
",",
"Polynomial",
"result",
")",
"{",
"int",
"N",
"=",
"Math",
".",
"max",
"(",
"0",
",",
"a",
".",
"size",
"(",
")",
"+",
"b",
".",
"size",
"(",
")",
... | Multiplies the two polynomials together.
@param a Polynomial
@param b Polynomial
@param result Optional storage parameter for the results. Must be have enough coefficients to store the results.
If null a new instance is declared.
@return Results of the multiplication | [
"Multiplies",
"the",
"two",
"polynomials",
"together",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/solver/PolynomialOps.java#L150-L172 |
medallia/Word2VecJava | src/main/java/com/medallia/word2vec/util/ProfilingTimer.java | ProfilingTimer.create | public static ProfilingTimer create(final Log log, final String processName, final Object... args) {
"""
Starts a new profiling timer with the given process name (optional arguments can be used as in {@link String#format(String, Object...)}).
When this {@link AC} is closed the profiling information will be dumped... | java | public static ProfilingTimer create(final Log log, final String processName, final Object... args) {
return create(log, topLevelInfoOnly, null, processName, args);
} | [
"public",
"static",
"ProfilingTimer",
"create",
"(",
"final",
"Log",
"log",
",",
"final",
"String",
"processName",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"return",
"create",
"(",
"log",
",",
"topLevelInfoOnly",
",",
"null",
",",
"processName",
",",... | Starts a new profiling timer with the given process name (optional arguments can be used as in {@link String#format(String, Object...)}).
When this {@link AC} is closed the profiling information will be dumped on the given log.
Note that this method obeys the static {@link #topLevelInfoOnly}
<p>
It is highly recommen... | [
"Starts",
"a",
"new",
"profiling",
"timer",
"with",
"the",
"given",
"process",
"name",
"(",
"optional",
"arguments",
"can",
"be",
"used",
"as",
"in",
"{",
"@link",
"String#format",
"(",
"String",
"Object",
"...",
")",
"}",
")",
".",
"When",
"this",
"{",
... | train | https://github.com/medallia/Word2VecJava/blob/eb31fbb99ac6bbab82d7f807b3e2240edca50eb7/src/main/java/com/medallia/word2vec/util/ProfilingTimer.java#L172-L174 |
mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.getTypedProperty | public static <T> T getTypedProperty(Scriptable s, String name, Class<T> type) {
"""
Gets a named property from an object or any object in its prototype chain
and coerces it to the requested Java type.
<p>
Searches the prototype chain for a property named <code>name</code>.
<p>
@param s a JavaScript object
@... | java | public static <T> T getTypedProperty(Scriptable s, String name, Class<T> type) {
Object val = getProperty(s, name);
if(val == Scriptable.NOT_FOUND) {
val = null;
}
return type.cast(Context.jsToJava(val, type));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getTypedProperty",
"(",
"Scriptable",
"s",
",",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"Object",
"val",
"=",
"getProperty",
"(",
"s",
",",
"name",
")",
";",
"if",
"(",
"val",
"==",
... | Gets a named property from an object or any object in its prototype chain
and coerces it to the requested Java type.
<p>
Searches the prototype chain for a property named <code>name</code>.
<p>
@param s a JavaScript object
@param name a property name
@param type the required Java type of the result
@return the value of... | [
"Gets",
"a",
"named",
"property",
"from",
"an",
"object",
"or",
"any",
"object",
"in",
"its",
"prototype",
"chain",
"and",
"coerces",
"it",
"to",
"the",
"requested",
"Java",
"type",
".",
"<p",
">",
"Searches",
"the",
"prototype",
"chain",
"for",
"a",
"pr... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2415-L2421 |
linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Code.java | Code.compareLongs | public void compareLongs(Local<Integer> target, Local<Long> a, Local<Long> b) {
"""
Compare longs. This stores -1 in {@code target} if {@code
a < b}, 0 in {@code target} if {@code a == b} and 1 in target if {@code
a > b}.
"""
addInstruction(new PlainInsn(Rops.CMPL_LONG, sourcePosition, target.spec(),... | java | public void compareLongs(Local<Integer> target, Local<Long> a, Local<Long> b) {
addInstruction(new PlainInsn(Rops.CMPL_LONG, sourcePosition, target.spec(),
RegisterSpecList.make(a.spec(), b.spec())));
} | [
"public",
"void",
"compareLongs",
"(",
"Local",
"<",
"Integer",
">",
"target",
",",
"Local",
"<",
"Long",
">",
"a",
",",
"Local",
"<",
"Long",
">",
"b",
")",
"{",
"addInstruction",
"(",
"new",
"PlainInsn",
"(",
"Rops",
".",
"CMPL_LONG",
",",
"sourcePos... | Compare longs. This stores -1 in {@code target} if {@code
a < b}, 0 in {@code target} if {@code a == b} and 1 in target if {@code
a > b}. | [
"Compare",
"longs",
".",
"This",
"stores",
"-",
"1",
"in",
"{"
] | train | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L579-L582 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/util/InetAddressPredicates.java | InetAddressPredicates.ofExact | public static Predicate<InetAddress> ofExact(InetAddress address) {
"""
Returns a {@link Predicate} which returns {@code true} if the given {@link InetAddress} equals to
the specified {@code address}.
@param address the expected {@link InetAddress}
"""
requireNonNull(address, "address");
if... | java | public static Predicate<InetAddress> ofExact(InetAddress address) {
requireNonNull(address, "address");
if (address instanceof Inet4Address) {
return ofCidr(address, 32);
}
if (address instanceof Inet6Address) {
return ofCidr(address, 128);
}
throw... | [
"public",
"static",
"Predicate",
"<",
"InetAddress",
">",
"ofExact",
"(",
"InetAddress",
"address",
")",
"{",
"requireNonNull",
"(",
"address",
",",
"\"address\"",
")",
";",
"if",
"(",
"address",
"instanceof",
"Inet4Address",
")",
"{",
"return",
"ofCidr",
"(",... | Returns a {@link Predicate} which returns {@code true} if the given {@link InetAddress} equals to
the specified {@code address}.
@param address the expected {@link InetAddress} | [
"Returns",
"a",
"{",
"@link",
"Predicate",
"}",
"which",
"returns",
"{",
"@code",
"true",
"}",
"if",
"the",
"given",
"{",
"@link",
"InetAddress",
"}",
"equals",
"to",
"the",
"specified",
"{",
"@code",
"address",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/util/InetAddressPredicates.java#L67-L76 |
stevespringett/Alpine | alpine/src/main/java/alpine/auth/LdapConnectionWrapper.java | LdapConnectionWrapper.searchForSingleUsername | public SearchResult searchForSingleUsername(final DirContext ctx, final String username) throws NamingException {
"""
Performs a search for the specified username. Internally, this method queries on
the attribute defined by {@link Config.AlpineKey#LDAP_ATTRIBUTE_NAME}.
@param ctx the DirContext to use
@param us... | java | public SearchResult searchForSingleUsername(final DirContext ctx, final String username) throws NamingException {
final List<SearchResult> results = searchForUsername(ctx, username);
if (results == null || results.size() == 0) {
LOGGER.debug("Search for (" + username + ") did not produce any... | [
"public",
"SearchResult",
"searchForSingleUsername",
"(",
"final",
"DirContext",
"ctx",
",",
"final",
"String",
"username",
")",
"throws",
"NamingException",
"{",
"final",
"List",
"<",
"SearchResult",
">",
"results",
"=",
"searchForUsername",
"(",
"ctx",
",",
"use... | Performs a search for the specified username. Internally, this method queries on
the attribute defined by {@link Config.AlpineKey#LDAP_ATTRIBUTE_NAME}.
@param ctx the DirContext to use
@param username the username to query on
@return a list of SearchResult objects. If the username is found, the list should typically on... | [
"Performs",
"a",
"search",
"for",
"the",
"specified",
"username",
".",
"Internally",
"this",
"method",
"queries",
"on",
"the",
"attribute",
"defined",
"by",
"{"
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/auth/LdapConnectionWrapper.java#L203-L214 |
Terracotta-OSS/statistics | src/main/java/org/terracotta/statistics/registry/StatisticRegistry.java | StatisticRegistry.queryStatistic | public <T extends Serializable> Optional<Statistic<T>> queryStatistic(String fullStatisticName) {
"""
Query a statistic based on the full statistic name. Returns null if not found.
"""
return queryStatistic(fullStatisticName, 0);
} | java | public <T extends Serializable> Optional<Statistic<T>> queryStatistic(String fullStatisticName) {
return queryStatistic(fullStatisticName, 0);
} | [
"public",
"<",
"T",
"extends",
"Serializable",
">",
"Optional",
"<",
"Statistic",
"<",
"T",
">",
">",
"queryStatistic",
"(",
"String",
"fullStatisticName",
")",
"{",
"return",
"queryStatistic",
"(",
"fullStatisticName",
",",
"0",
")",
";",
"}"
] | Query a statistic based on the full statistic name. Returns null if not found. | [
"Query",
"a",
"statistic",
"based",
"on",
"the",
"full",
"statistic",
"name",
".",
"Returns",
"null",
"if",
"not",
"found",
"."
] | train | https://github.com/Terracotta-OSS/statistics/blob/d24e4989b8c8dbe4f5210e49c7945d51b6585881/src/main/java/org/terracotta/statistics/registry/StatisticRegistry.java#L82-L84 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/config/Schema.java | Schema.getId | public UUID getId(String ksName, String cfName) {
"""
Lookup keyspace/ColumnFamily identifier
@param ksName The keyspace name
@param cfName The ColumnFamily name
@return The id for the given (ksname,cfname) pair, or null if it has been dropped.
"""
return cfIdMap.get(Pair.create(ksName, cfName))... | java | public UUID getId(String ksName, String cfName)
{
return cfIdMap.get(Pair.create(ksName, cfName));
} | [
"public",
"UUID",
"getId",
"(",
"String",
"ksName",
",",
"String",
"cfName",
")",
"{",
"return",
"cfIdMap",
".",
"get",
"(",
"Pair",
".",
"create",
"(",
"ksName",
",",
"cfName",
")",
")",
";",
"}"
] | Lookup keyspace/ColumnFamily identifier
@param ksName The keyspace name
@param cfName The ColumnFamily name
@return The id for the given (ksname,cfname) pair, or null if it has been dropped. | [
"Lookup",
"keyspace",
"/",
"ColumnFamily",
"identifier"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/Schema.java#L321-L324 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/SubscriptionsApi.java | SubscriptionsApi.getMessages | public NotifMessagesResponse getMessages(String notifId, Integer offset, Integer count, String order) throws ApiException {
"""
Get Messages
Get Messages
@param notifId Notification ID. (required)
@param offset Offset for pagination. (optional)
@param count Desired count of items in the result set. (optional)
... | java | public NotifMessagesResponse getMessages(String notifId, Integer offset, Integer count, String order) throws ApiException {
ApiResponse<NotifMessagesResponse> resp = getMessagesWithHttpInfo(notifId, offset, count, order);
return resp.getData();
} | [
"public",
"NotifMessagesResponse",
"getMessages",
"(",
"String",
"notifId",
",",
"Integer",
"offset",
",",
"Integer",
"count",
",",
"String",
"order",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"NotifMessagesResponse",
">",
"resp",
"=",
"getMessagesWith... | Get Messages
Get Messages
@param notifId Notification ID. (required)
@param offset Offset for pagination. (optional)
@param count Desired count of items in the result set. (optional)
@param order Sort order of results by ts. Either 'asc' or 'desc'. (optional)
@return NotifMessagesResponse
@throws ApiExc... | [
"Get",
"Messages",
"Get",
"Messages"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/SubscriptionsApi.java#L499-L502 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsEditor.java | CmsEditor.showErrorPage | protected void showErrorPage(Object editor, Exception exception) throws JspException {
"""
Shows the selected error page in case of an exception.<p>
@param editor initialized instance of the editor class
@param exception the current exception
@throws JspException if inclusion of the error page fails
"""
... | java | protected void showErrorPage(Object editor, Exception exception) throws JspException {
// save initialized instance of the editor class in request attribute for included sub-elements
getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, editor);
// reading of file contents failed, show e... | [
"protected",
"void",
"showErrorPage",
"(",
"Object",
"editor",
",",
"Exception",
"exception",
")",
"throws",
"JspException",
"{",
"// save initialized instance of the editor class in request attribute for included sub-elements",
"getJsp",
"(",
")",
".",
"getRequest",
"(",
")"... | Shows the selected error page in case of an exception.<p>
@param editor initialized instance of the editor class
@param exception the current exception
@throws JspException if inclusion of the error page fails | [
"Shows",
"the",
"selected",
"error",
"page",
"in",
"case",
"of",
"an",
"exception",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsEditor.java#L1078-L1094 |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/command/option/DefaultOptionParser.java | DefaultOptionParser.handleLongOptionWithEqual | private void handleLongOptionWithEqual(String token) throws OptionParserException {
"""
Handles the following tokens:
<pre>
--L=V
-L=V
--l=V
-l=V
</pre>
@param token the command line token to handle
@throws OptionParserException if option parsing fails
"""
int pos = token.indexOf('=');
... | java | private void handleLongOptionWithEqual(String token) throws OptionParserException {
int pos = token.indexOf('=');
String name = token.substring(0, pos);
String value = token.substring(pos + 1);
List<String> matchingOpts = getMatchingLongOptions(name);
if (matchingOpts.isEmpty()) ... | [
"private",
"void",
"handleLongOptionWithEqual",
"(",
"String",
"token",
")",
"throws",
"OptionParserException",
"{",
"int",
"pos",
"=",
"token",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"String",
"name",
"=",
"token",
".",
"substring",
"(",
"0",
",",
"pos"... | Handles the following tokens:
<pre>
--L=V
-L=V
--l=V
-l=V
</pre>
@param token the command line token to handle
@throws OptionParserException if option parsing fails | [
"Handles",
"the",
"following",
"tokens",
":",
"<pre",
">",
"--",
"L",
"=",
"V",
"-",
"L",
"=",
"V",
"--",
"l",
"=",
"V",
"-",
"l",
"=",
"V",
"<",
"/",
"pre",
">"
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/option/DefaultOptionParser.java#L290-L310 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Mapper.java | Mapper.beanMap | public static Collection beanMap(String property, Collection c) {
"""
Map dynamically using a bean property name.
@param property the name of a bean property
@param c a collection of objects
@return collection
@throws ClassCastException if there is an error invoking the method on any object.
"""
... | java | public static Collection beanMap(String property, Collection c) {
return beanMap(property, c.iterator(), false);
} | [
"public",
"static",
"Collection",
"beanMap",
"(",
"String",
"property",
",",
"Collection",
"c",
")",
"{",
"return",
"beanMap",
"(",
"property",
",",
"c",
".",
"iterator",
"(",
")",
",",
"false",
")",
";",
"}"
] | Map dynamically using a bean property name.
@param property the name of a bean property
@param c a collection of objects
@return collection
@throws ClassCastException if there is an error invoking the method on any object. | [
"Map",
"dynamically",
"using",
"a",
"bean",
"property",
"name",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L701-L703 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfAction.java | PdfAction.createHide | static PdfAction createHide(PdfObject obj, boolean hide) {
"""
A Hide action hides or shows an object.
@param obj object to hide or show
@param hide true is hide, false is show
@return a Hide Action
"""
PdfAction action = new PdfAction();
action.put(PdfName.S, PdfName.HIDE);
action.p... | java | static PdfAction createHide(PdfObject obj, boolean hide) {
PdfAction action = new PdfAction();
action.put(PdfName.S, PdfName.HIDE);
action.put(PdfName.T, obj);
if (!hide)
action.put(PdfName.H, PdfBoolean.PDFFALSE);
return action;
} | [
"static",
"PdfAction",
"createHide",
"(",
"PdfObject",
"obj",
",",
"boolean",
"hide",
")",
"{",
"PdfAction",
"action",
"=",
"new",
"PdfAction",
"(",
")",
";",
"action",
".",
"put",
"(",
"PdfName",
".",
"S",
",",
"PdfName",
".",
"HIDE",
")",
";",
"actio... | A Hide action hides or shows an object.
@param obj object to hide or show
@param hide true is hide, false is show
@return a Hide Action | [
"A",
"Hide",
"action",
"hides",
"or",
"shows",
"an",
"object",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfAction.java#L332-L339 |
virgo47/javasimon | console-embed/src/main/java/org/javasimon/console/ActionContext.java | ActionContext.stringToEnum | private static <T extends Enum<T>> T stringToEnum(String value, Class<T> type) {
"""
Transform a string into an enum (using its name which is supposed to be
uppercase, handles null values.
"""
final String s = blankToNull(value);
return value == null ? null : Enum.valueOf(type, s.toUpperCase());
} | java | private static <T extends Enum<T>> T stringToEnum(String value, Class<T> type) {
final String s = blankToNull(value);
return value == null ? null : Enum.valueOf(type, s.toUpperCase());
} | [
"private",
"static",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"stringToEnum",
"(",
"String",
"value",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"final",
"String",
"s",
"=",
"blankToNull",
"(",
"value",
")",
";",
"return",
"value",
... | Transform a string into an enum (using its name which is supposed to be
uppercase, handles null values. | [
"Transform",
"a",
"string",
"into",
"an",
"enum",
"(",
"using",
"its",
"name",
"which",
"is",
"supposed",
"to",
"be",
"uppercase",
"handles",
"null",
"values",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/console-embed/src/main/java/org/javasimon/console/ActionContext.java#L153-L156 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddShapes.java | AddShapes.findRequestUri | private String findRequestUri(Shape parentShape, Map<String, Shape> allC2jShapes) {
"""
Given an input shape, finds the Request URI for the operation that input is referenced from.
@param parentShape Input shape to find operation's request URI for.
@param allC2jShapes All shapes in the service model.
@return... | java | private String findRequestUri(Shape parentShape, Map<String, Shape> allC2jShapes) {
return builder.getService().getOperations().values().stream()
.filter(o -> o.getInput() != null)
.filter(o -> allC2jShapes.get(o.getInput().getShape()).equals(parentShape))
.map(o ... | [
"private",
"String",
"findRequestUri",
"(",
"Shape",
"parentShape",
",",
"Map",
"<",
"String",
",",
"Shape",
">",
"allC2jShapes",
")",
"{",
"return",
"builder",
".",
"getService",
"(",
")",
".",
"getOperations",
"(",
")",
".",
"values",
"(",
")",
".",
"s... | Given an input shape, finds the Request URI for the operation that input is referenced from.
@param parentShape Input shape to find operation's request URI for.
@param allC2jShapes All shapes in the service model.
@return Request URI for operation.
@throws RuntimeException If operation can't be found. | [
"Given",
"an",
"input",
"shape",
"finds",
"the",
"Request",
"URI",
"for",
"the",
"operation",
"that",
"input",
"is",
"referenced",
"from",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddShapes.java#L352-L358 |
qiujuer/Genius-Android | caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java | Reflector.replaceTypeActualArgument | private static Type replaceTypeActualArgument(Type inType, final Map<Type, Type> resolvedTypes) {
"""
Replace {@link ParameterizedType#getActualTypeArguments()} method return value.
In this we use {@link ParameterizeTypeActualArgsDelegate} delegate {@link ParameterizedType};
Let {@link ParameterizedType#getActua... | java | private static Type replaceTypeActualArgument(Type inType, final Map<Type, Type> resolvedTypes) {
Type outType = inType;
if (inType instanceof ParameterizedType) {
final ParameterizedType finalType = ((ParameterizedType) inType);
final Type[] actualArgs = ((ParameterizedType) in... | [
"private",
"static",
"Type",
"replaceTypeActualArgument",
"(",
"Type",
"inType",
",",
"final",
"Map",
"<",
"Type",
",",
"Type",
">",
"resolvedTypes",
")",
"{",
"Type",
"outType",
"=",
"inType",
";",
"if",
"(",
"inType",
"instanceof",
"ParameterizedType",
")",
... | Replace {@link ParameterizedType#getActualTypeArguments()} method return value.
In this we use {@link ParameterizeTypeActualArgsDelegate} delegate {@link ParameterizedType};
Let {@link ParameterizedType#getActualTypeArguments()} return really class type.
@param inType Type
@param resolvedTypes a Map<Type, Type>... | [
"Replace",
"{",
"@link",
"ParameterizedType#getActualTypeArguments",
"()",
"}",
"method",
"return",
"value",
".",
"In",
"this",
"we",
"use",
"{",
"@link",
"ParameterizeTypeActualArgsDelegate",
"}",
"delegate",
"{",
"@link",
"ParameterizedType",
"}",
";",
"Let",
"{",... | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/kit-reflect/src/main/java/net/qiujuer/genius/kit/reflect/Reflector.java#L773-L795 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/MyStringUtils.java | MyStringUtils.saveContentMap | public static void saveContentMap(Map<String, String> map, File file) throws IOException {
"""
Save map to file
@param map Map to save
@param file File to save
@throws IOException I/O error
"""
FileWriter out = new FileWriter(file);
for (String key : map.keySet()) {
if (map.get(key) != null) ... | java | public static void saveContentMap(Map<String, String> map, File file) throws IOException {
FileWriter out = new FileWriter(file);
for (String key : map.keySet()) {
if (map.get(key) != null) {
out.write(key.replace(":", "#escapedtwodots#") + ":"
+ map.get(key).replace(":", "#escapedtwo... | [
"public",
"static",
"void",
"saveContentMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"FileWriter",
"out",
"=",
"new",
"FileWriter",
"(",
"file",
")",
";",
"for",
"(",
"String",
"key",... | Save map to file
@param map Map to save
@param file File to save
@throws IOException I/O error | [
"Save",
"map",
"to",
"file"
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/MyStringUtils.java#L820-L830 |
livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/da/StandardDirectoryAgentServer.java | StandardDirectoryAgentServer.handleUDPSrvDeReg | protected void handleUDPSrvDeReg(SrvDeReg srvDeReg, InetSocketAddress localAddress, InetSocketAddress remoteAddress) {
"""
Handles unicast UDP SrvDeReg message arrived to this directory agent.
<br />
This directory agent will reply with an acknowledge containing the result of the deregistration.
@param srvDeR... | java | protected void handleUDPSrvDeReg(SrvDeReg srvDeReg, InetSocketAddress localAddress, InetSocketAddress remoteAddress)
{
try
{
boolean update = srvDeReg.isUpdating();
ServiceInfo service = ServiceInfo.from(srvDeReg);
uncacheService(service, update);
udpS... | [
"protected",
"void",
"handleUDPSrvDeReg",
"(",
"SrvDeReg",
"srvDeReg",
",",
"InetSocketAddress",
"localAddress",
",",
"InetSocketAddress",
"remoteAddress",
")",
"{",
"try",
"{",
"boolean",
"update",
"=",
"srvDeReg",
".",
"isUpdating",
"(",
")",
";",
"ServiceInfo",
... | Handles unicast UDP SrvDeReg message arrived to this directory agent.
<br />
This directory agent will reply with an acknowledge containing the result of the deregistration.
@param srvDeReg the SrvDeReg message to handle
@param localAddress the socket address the message arrived to
@param remoteAddress the socke... | [
"Handles",
"unicast",
"UDP",
"SrvDeReg",
"message",
"arrived",
"to",
"this",
"directory",
"agent",
".",
"<br",
"/",
">",
"This",
"directory",
"agent",
"will",
"reply",
"with",
"an",
"acknowledge",
"containing",
"the",
"result",
"of",
"the",
"deregistration",
"... | train | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/da/StandardDirectoryAgentServer.java#L571-L584 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/roles/AbstractAppender.java | AbstractAppender.buildAppendRequest | protected AppendRequest buildAppendRequest(RaftMemberContext member, long lastIndex) {
"""
Builds an append request.
@param member The member to which to send the request.
@return The append request.
"""
final RaftLogReader reader = member.getLogReader();
// If the log is empty then send an empty ... | java | protected AppendRequest buildAppendRequest(RaftMemberContext member, long lastIndex) {
final RaftLogReader reader = member.getLogReader();
// If the log is empty then send an empty commit.
// If the next index hasn't yet been set then we send an empty commit first.
// If the next index is greater than ... | [
"protected",
"AppendRequest",
"buildAppendRequest",
"(",
"RaftMemberContext",
"member",
",",
"long",
"lastIndex",
")",
"{",
"final",
"RaftLogReader",
"reader",
"=",
"member",
".",
"getLogReader",
"(",
")",
";",
"// If the log is empty then send an empty commit.",
"// If t... | Builds an append request.
@param member The member to which to send the request.
@return The append request. | [
"Builds",
"an",
"append",
"request",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/AbstractAppender.java#L74-L89 |
motown-io/motown | ocpp/websocket-json/src/main/java/io/motown/ocpp/websocketjson/response/handler/ChangeAvailabilityResponseHandler.java | ChangeAvailabilityResponseHandler.handleAcceptedOrScheduledChangeAvailabilityResponse | private void handleAcceptedOrScheduledChangeAvailabilityResponse(ChargingStationId chargingStationId, DomainService domainService, AddOnIdentity addOnIdentity) {
"""
Handles the response when the change of availability has been accepted or scheduled, e.g. not rejected.
@param chargingStationId The charging stat... | java | private void handleAcceptedOrScheduledChangeAvailabilityResponse(ChargingStationId chargingStationId, DomainService domainService, AddOnIdentity addOnIdentity) {
if (Changeavailability.Type.INOPERATIVE.equals(availabilityType)) {
if (evseId.getNumberedId() == 0) {
domainService.chang... | [
"private",
"void",
"handleAcceptedOrScheduledChangeAvailabilityResponse",
"(",
"ChargingStationId",
"chargingStationId",
",",
"DomainService",
"domainService",
",",
"AddOnIdentity",
"addOnIdentity",
")",
"{",
"if",
"(",
"Changeavailability",
".",
"Type",
".",
"INOPERATIVE",
... | Handles the response when the change of availability has been accepted or scheduled, e.g. not rejected.
@param chargingStationId The charging station identifier.
@param domainService The domain service.
@param addOnIdentity The AddOn identity. | [
"Handles",
"the",
"response",
"when",
"the",
"change",
"of",
"availability",
"has",
"been",
"accepted",
"or",
"scheduled",
"e",
".",
"g",
".",
"not",
"rejected",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/ocpp/websocket-json/src/main/java/io/motown/ocpp/websocketjson/response/handler/ChangeAvailabilityResponseHandler.java#L70-L84 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java | JmsSessionImpl.instantiateConsumer | JmsMsgConsumer instantiateConsumer(ConsumerProperties consumerProperties) throws JMSException {
"""
This method is overriden by subclasses in order to instantiate an instance
of the MsgConsumer class. This means that the QueueSession.createReceiver
method can delegate straight to Session.createConsumer, and stil... | java | JmsMsgConsumer instantiateConsumer(ConsumerProperties consumerProperties) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "instantiateConsumer", consumerProperties);
JmsMsgConsumer messageConsumer = new JmsMsgConsumerImpl(coreConne... | [
"JmsMsgConsumer",
"instantiateConsumer",
"(",
"ConsumerProperties",
"consumerProperties",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
... | This method is overriden by subclasses in order to instantiate an instance
of the MsgConsumer class. This means that the QueueSession.createReceiver
method can delegate straight to Session.createConsumer, and still get back
an instance of a QueueReceiver, rather than a vanilla MessageConsumer.
Note, since this method ... | [
"This",
"method",
"is",
"overriden",
"by",
"subclasses",
"in",
"order",
"to",
"instantiate",
"an",
"instance",
"of",
"the",
"MsgConsumer",
"class",
".",
"This",
"means",
"that",
"the",
"QueueSession",
".",
"createReceiver",
"method",
"can",
"delegate",
"straight... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java#L1671-L1678 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java | RingBuffer.publishEvents | public <A, B> void publishEvents(EventTranslatorTwoArg<E, A, B> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1) {
"""
Allows two user supplied arguments per event.
@param translator The user specified translation for the event
@param batchStartsAt The first element of the array which is withi... | java | public <A, B> void publishEvents(EventTranslatorTwoArg<E, A, B> translator, int batchStartsAt, int batchSize, A[] arg0, B[] arg1) {
checkBounds(arg0, arg1, batchStartsAt, batchSize);
final long finalSequence = sequencer.next(batchSize);
translateAndPublishBatch(translator, arg0, arg1, batchStart... | [
"public",
"<",
"A",
",",
"B",
">",
"void",
"publishEvents",
"(",
"EventTranslatorTwoArg",
"<",
"E",
",",
"A",
",",
"B",
">",
"translator",
",",
"int",
"batchStartsAt",
",",
"int",
"batchSize",
",",
"A",
"[",
"]",
"arg0",
",",
"B",
"[",
"]",
"arg1",
... | Allows two user supplied arguments per event.
@param translator The user specified translation for the event
@param batchStartsAt The first element of the array which is within the batch.
@param batchSize The actual size of the batch.
@param arg0 An array of user supplied arguments, one element per event.
@param arg1 ... | [
"Allows",
"two",
"user",
"supplied",
"arguments",
"per",
"event",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java#L645-L649 |
gosu-lang/gosu-lang | gosu-lab/src/main/java/editor/search/RegExStringUtil.java | RegExStringUtil.searchIgnoreCase | public static List<SearchLocation> searchIgnoreCase( String strSource, String strPattern ) {
"""
Return a list of <code>SearchLocation</code>s representing the occurrences of the
specified pattern in the specified source string.
@param strSource A string to search.
@param strPattern A pattern to search for.
... | java | public static List<SearchLocation> searchIgnoreCase( String strSource, String strPattern )
{
return search( strSource, strPattern, true );
} | [
"public",
"static",
"List",
"<",
"SearchLocation",
">",
"searchIgnoreCase",
"(",
"String",
"strSource",
",",
"String",
"strPattern",
")",
"{",
"return",
"search",
"(",
"strSource",
",",
"strPattern",
",",
"true",
")",
";",
"}"
] | Return a list of <code>SearchLocation</code>s representing the occurrences of the
specified pattern in the specified source string.
@param strSource A string to search.
@param strPattern A pattern to search for.
@return A list of SearchLocations for each occurrence of the specified pattern.
Returns an empty list for... | [
"Return",
"a",
"list",
"of",
"<code",
">",
"SearchLocation<",
"/",
"code",
">",
"s",
"representing",
"the",
"occurrences",
"of",
"the",
"specified",
"pattern",
"in",
"the",
"specified",
"source",
"string",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-lab/src/main/java/editor/search/RegExStringUtil.java#L23-L26 |
apache/flink | flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java | CliFrontend.buildProgram | PackagedProgram buildProgram(ProgramOptions options) throws FileNotFoundException, ProgramInvocationException {
"""
Creates a Packaged program from the given command line options.
@return A PackagedProgram (upon success)
"""
String[] programArgs = options.getProgramArgs();
String jarFilePath = options.g... | java | PackagedProgram buildProgram(ProgramOptions options) throws FileNotFoundException, ProgramInvocationException {
String[] programArgs = options.getProgramArgs();
String jarFilePath = options.getJarFilePath();
List<URL> classpaths = options.getClasspaths();
if (jarFilePath == null) {
throw new IllegalArgument... | [
"PackagedProgram",
"buildProgram",
"(",
"ProgramOptions",
"options",
")",
"throws",
"FileNotFoundException",
",",
"ProgramInvocationException",
"{",
"String",
"[",
"]",
"programArgs",
"=",
"options",
".",
"getProgramArgs",
"(",
")",
";",
"String",
"jarFilePath",
"=",
... | Creates a Packaged program from the given command line options.
@return A PackagedProgram (upon success) | [
"Creates",
"a",
"Packaged",
"program",
"from",
"the",
"given",
"command",
"line",
"options",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java#L769-L798 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextServicesSupport.java | ControlBeanContextServicesSupport.releaseService | public void releaseService(BeanContextChild child, Object requestor, Object service) {
"""
Releases a <code>BeanContextChild</code>'s
(or any arbitrary object associated with a BeanContextChild)
reference to the specified service by calling releaseService()
on the underlying <code>BeanContextServiceProvider</co... | java | public void releaseService(BeanContextChild child, Object requestor, Object service) {
if (!contains(child)) {
throw new IllegalArgumentException(child + "is not a child of this context!");
}
// todo: for multithreaded usage this block needs to be synchronized
Class service... | [
"public",
"void",
"releaseService",
"(",
"BeanContextChild",
"child",
",",
"Object",
"requestor",
",",
"Object",
"service",
")",
"{",
"if",
"(",
"!",
"contains",
"(",
"child",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"child",
"+",
"\"i... | Releases a <code>BeanContextChild</code>'s
(or any arbitrary object associated with a BeanContextChild)
reference to the specified service by calling releaseService()
on the underlying <code>BeanContextServiceProvider</code>.
@param child the <code>BeanContextChild</code>
@param requestor the requestor
@param serv... | [
"Releases",
"a",
"<code",
">",
"BeanContextChild<",
"/",
"code",
">",
"s",
"(",
"or",
"any",
"arbitrary",
"object",
"associated",
"with",
"a",
"BeanContextChild",
")",
"reference",
"to",
"the",
"specified",
"service",
"by",
"calling",
"releaseService",
"()",
"... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextServicesSupport.java#L250-L275 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ParsedScheduleExpression.java | ParsedScheduleExpression.getNextDayOfWeekInMonth | private int getNextDayOfWeekInMonth(int day, int lastDay, int dayOfWeek) {
"""
Returns the next day of the month after <tt>day</tt> that satisfies
the lastDayOfWeek constraint.
@param day the current 0-based day of the month
@param lastDay the current 0-based last day of the month
@param dayOfWeek the curren... | java | private int getNextDayOfWeekInMonth(int day, int lastDay, int dayOfWeek)
{
int weekInMonth = day / 7;
for (;;)
{
if (contains(daysOfWeekInMonth, weekInMonth * 7 + dayOfWeek))
{
return day;
}
day++;
if (day > lastDa... | [
"private",
"int",
"getNextDayOfWeekInMonth",
"(",
"int",
"day",
",",
"int",
"lastDay",
",",
"int",
"dayOfWeek",
")",
"{",
"int",
"weekInMonth",
"=",
"day",
"/",
"7",
";",
"for",
"(",
";",
";",
")",
"{",
"if",
"(",
"contains",
"(",
"daysOfWeekInMonth",
... | Returns the next day of the month after <tt>day</tt> that satisfies
the lastDayOfWeek constraint.
@param day the current 0-based day of the month
@param lastDay the current 0-based last day of the month
@param dayOfWeek the current 0-based day of the week
@return a value greater than or equal to <tt>day</tt> | [
"Returns",
"the",
"next",
"day",
"of",
"the",
"month",
"after",
"<tt",
">",
"day<",
"/",
"tt",
">",
"that",
"satisfies",
"the",
"lastDayOfWeek",
"constraint",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ParsedScheduleExpression.java#L994-L1018 |
osglworks/java-tool-ext | src/main/java/org/osgl/util/Token.java | Token.generateToken | @Deprecated
public static String generateToken(String secret, String oid, String... payload) {
"""
This method is deprecated. Please use {@link #generateToken(byte[], String, String...)} instead
Generate a token string with secret key, ID and optionally payloads
@param secret the secret to encrypt to token... | java | @Deprecated
public static String generateToken(String secret, String oid, String... payload) {
return generateToken(secret, Life.SHORT, oid, payload);
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"generateToken",
"(",
"String",
"secret",
",",
"String",
"oid",
",",
"String",
"...",
"payload",
")",
"{",
"return",
"generateToken",
"(",
"secret",
",",
"Life",
".",
"SHORT",
",",
"oid",
",",
"payload",
")"... | This method is deprecated. Please use {@link #generateToken(byte[], String, String...)} instead
Generate a token string with secret key, ID and optionally payloads
@param secret the secret to encrypt to token string
@param oid the ID of the token (could be customer ID etc)
@param payload the payload optionally indicat... | [
"This",
"method",
"is",
"deprecated",
".",
"Please",
"use",
"{",
"@link",
"#generateToken",
"(",
"byte",
"[]",
"String",
"String",
"...",
")",
"}",
"instead"
] | train | https://github.com/osglworks/java-tool-ext/blob/43f034bd0a42e571e437f44aa20487d45248a30b/src/main/java/org/osgl/util/Token.java#L270-L273 |
lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableMenuOverlay.java | ExpandableMenuOverlay.onLayout | @Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
"""
Adjusts size of this view to match the underlying button menu. This allows
a smooth transition between this view and the close button behind it.
"""
super.onLayout(changed, l, t, r, b);
if (mAdjustViewSiz... | java | @Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
if (mAdjustViewSize) {
if (!(getParent() instanceof RelativeLayout)) {
throw new IllegalStateException("Only RelativeLayout is supported as parent of thi... | [
"@",
"Override",
"protected",
"void",
"onLayout",
"(",
"boolean",
"changed",
",",
"int",
"l",
",",
"int",
"t",
",",
"int",
"r",
",",
"int",
"b",
")",
"{",
"super",
".",
"onLayout",
"(",
"changed",
",",
"l",
",",
"t",
",",
"r",
",",
"b",
")",
";... | Adjusts size of this view to match the underlying button menu. This allows
a smooth transition between this view and the close button behind it. | [
"Adjusts",
"size",
"of",
"this",
"view",
"to",
"match",
"the",
"underlying",
"button",
"menu",
".",
"This",
"allows",
"a",
"smooth",
"transition",
"between",
"this",
"view",
"and",
"the",
"close",
"button",
"behind",
"it",
"."
] | train | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableMenuOverlay.java#L163-L181 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/Equation.java | Equation.addSubMatrixVariables | private void addSubMatrixVariables(List<TokenList.Token> inputs, List<Variable> variables) {
"""
Goes through the token lists and adds all the variables which can be used to define a sub-matrix. If anything
else is found an excpetion is thrown
"""
for (int i = 0; i < inputs.size(); i++) {
... | java | private void addSubMatrixVariables(List<TokenList.Token> inputs, List<Variable> variables) {
for (int i = 0; i < inputs.size(); i++) {
TokenList.Token t = inputs.get(i);
if( t.getType() != Type.VARIABLE )
throw new ParseError("Expected variables only in sub-matrix input, ... | [
"private",
"void",
"addSubMatrixVariables",
"(",
"List",
"<",
"TokenList",
".",
"Token",
">",
"inputs",
",",
"List",
"<",
"Variable",
">",
"variables",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"inputs",
".",
"size",
"(",
")",
";",
... | Goes through the token lists and adds all the variables which can be used to define a sub-matrix. If anything
else is found an excpetion is thrown | [
"Goes",
"through",
"the",
"token",
"lists",
"and",
"adds",
"all",
"the",
"variables",
"which",
"can",
"be",
"used",
"to",
"define",
"a",
"sub",
"-",
"matrix",
".",
"If",
"anything",
"else",
"is",
"found",
"an",
"excpetion",
"is",
"thrown"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/Equation.java#L832-L844 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java | DatabaseClientFactory.newClient | @Deprecated
static public DatabaseClient newClient(String host, int port, String user, String password, Authentication type) {
"""
Creates a client to access the database by means of a REST server.
@param host the host with the REST server
@param port the port for the REST server
@param user the user with r... | java | @Deprecated
static public DatabaseClient newClient(String host, int port, String user, String password, Authentication type) {
return newClient(host, port, null, makeSecurityContext(user, password, type, null, null), null);
} | [
"@",
"Deprecated",
"static",
"public",
"DatabaseClient",
"newClient",
"(",
"String",
"host",
",",
"int",
"port",
",",
"String",
"user",
",",
"String",
"password",
",",
"Authentication",
"type",
")",
"{",
"return",
"newClient",
"(",
"host",
",",
"port",
",",
... | Creates a client to access the database by means of a REST server.
@param host the host with the REST server
@param port the port for the REST server
@param user the user with read, write, or administrative privileges
@param password the password for the user
@param type the type of authentication applied to the reque... | [
"Creates",
"a",
"client",
"to",
"access",
"the",
"database",
"by",
"means",
"of",
"a",
"REST",
"server",
"."
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java#L1268-L1271 |
alkacon/opencms-core | src/org/opencms/scheduler/jobs/CmsCreateImageSizeJob.java | CmsCreateImageSizeJob.lockResource | private void lockResource(CmsObject cms, CmsLock lock, CmsResource res) throws CmsException {
"""
Locks the given resource (if required).<p>
@param cms the OpenCms user context
@param lock the previous lock status of the resource
@param res the resource to lock
@throws CmsException in case something goes w... | java | private void lockResource(CmsObject cms, CmsLock lock, CmsResource res) throws CmsException {
if (lock.isNullLock()) {
cms.lockResource(res.getRootPath());
}
} | [
"private",
"void",
"lockResource",
"(",
"CmsObject",
"cms",
",",
"CmsLock",
"lock",
",",
"CmsResource",
"res",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"lock",
".",
"isNullLock",
"(",
")",
")",
"{",
"cms",
".",
"lockResource",
"(",
"res",
".",
"get... | Locks the given resource (if required).<p>
@param cms the OpenCms user context
@param lock the previous lock status of the resource
@param res the resource to lock
@throws CmsException in case something goes wrong | [
"Locks",
"the",
"given",
"resource",
"(",
"if",
"required",
")",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/scheduler/jobs/CmsCreateImageSizeJob.java#L228-L233 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Domain.java | Domain.update | public static Domain update(final String id, final String description) throws AppPlatformException, ParseException, IOException, Exception {
"""
Convenience method to get information about a specific Domain.
@param id the domain id.
@param description the description
@return information about a specific Domain
... | java | public static Domain update(final String id, final String description) throws AppPlatformException, ParseException, IOException, Exception {
final BandwidthClient client = BandwidthClient.getInstance();
final Map<String, Object> params = new HashMap<String, Object>();
if(description != null) {
... | [
"public",
"static",
"Domain",
"update",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"description",
")",
"throws",
"AppPlatformException",
",",
"ParseException",
",",
"IOException",
",",
"Exception",
"{",
"final",
"BandwidthClient",
"client",
"=",
"Bandwi... | Convenience method to get information about a specific Domain.
@param id the domain id.
@param description the description
@return information about a specific Domain
@throws AppPlatformException API Exception
@throws ParseException Error parsing data
@throws IOException unexpected error
@throws Exception error | [
"Convenience",
"method",
"to",
"get",
"information",
"about",
"a",
"specific",
"Domain",
"."
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Domain.java#L181-L188 |
windup/windup | graph/api/src/main/java/org/jboss/windup/graph/service/GraphService.java | GraphService.addTypeToModel | public static <T extends WindupVertexFrame> T addTypeToModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type) {
"""
Adds the specified type to this frame, and returns a new object that implements this type.
"""
Vertex vertex = frame.getElement();
graphContext.getGraphTypeManag... | java | public static <T extends WindupVertexFrame> T addTypeToModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type)
{
Vertex vertex = frame.getElement();
graphContext.getGraphTypeManager().addTypeToElement(type, vertex);
return graphContext.getFramed().frameElement(vertex, type);... | [
"public",
"static",
"<",
"T",
"extends",
"WindupVertexFrame",
">",
"T",
"addTypeToModel",
"(",
"GraphContext",
"graphContext",
",",
"WindupVertexFrame",
"frame",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"Vertex",
"vertex",
"=",
"frame",
".",
"getElement"... | Adds the specified type to this frame, and returns a new object that implements this type. | [
"Adds",
"the",
"specified",
"type",
"to",
"this",
"frame",
"and",
"returns",
"a",
"new",
"object",
"that",
"implements",
"this",
"type",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/graph/api/src/main/java/org/jboss/windup/graph/service/GraphService.java#L297-L302 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/InheritedChannel.java | InheritedChannel.createChannel | private static Channel createChannel() throws IOException {
"""
/*
If standard inherited channel is connected to a socket then return a Channel
of the appropriate type based standard input.
"""
// dup the file descriptor - we do this so that for two reasons :-
// 1. Avoids any timing issues ... | java | private static Channel createChannel() throws IOException {
// dup the file descriptor - we do this so that for two reasons :-
// 1. Avoids any timing issues with FileDescriptor.in being closed
// or redirected while we create the channel.
// 2. Allows streams based on file descripto... | [
"private",
"static",
"Channel",
"createChannel",
"(",
")",
"throws",
"IOException",
"{",
"// dup the file descriptor - we do this so that for two reasons :-",
"// 1. Avoids any timing issues with FileDescriptor.in being closed",
"// or redirected while we create the channel.",
"// 2. Allo... | /*
If standard inherited channel is connected to a socket then return a Channel
of the appropriate type based standard input. | [
"/",
"*",
"If",
"standard",
"inherited",
"channel",
"is",
"connected",
"to",
"a",
"socket",
"then",
"return",
"a",
"Channel",
"of",
"the",
"appropriate",
"type",
"based",
"standard",
"input",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/InheritedChannel.java#L143-L198 |
srikalyc/Sql4D | Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/DDataSource.java | DDataSource.adjustPoolSettings | public static void adjustPoolSettings(int maxConnsInPool, int maxBrokerConns, int maxCoordConns, int maxOverlordConns) {
"""
Call if a custom pool size, and fine grained control on connections per route.
NOTE: This must be called prior to instantiating DDataSource for the settings
to be effective.
@param maxCon... | java | public static void adjustPoolSettings(int maxConnsInPool, int maxBrokerConns, int maxCoordConns, int maxOverlordConns) {
MAX_CONNS_IN_POOL = maxConnsInPool;
MAX_BROKER_CONNS = maxBrokerConns;
MAX_COORD_CONNS = maxCoordConns;
MAX_OVERLORD_CONNS = maxOverlordConns;
DruidNodeAccesso... | [
"public",
"static",
"void",
"adjustPoolSettings",
"(",
"int",
"maxConnsInPool",
",",
"int",
"maxBrokerConns",
",",
"int",
"maxCoordConns",
",",
"int",
"maxOverlordConns",
")",
"{",
"MAX_CONNS_IN_POOL",
"=",
"maxConnsInPool",
";",
"MAX_BROKER_CONNS",
"=",
"maxBrokerCon... | Call if a custom pool size, and fine grained control on connections per route.
NOTE: This must be called prior to instantiating DDataSource for the settings
to be effective.
@param maxConnsInPool
@param maxBrokerConns
@param maxCoordConns
@param maxOverlordConns | [
"Call",
"if",
"a",
"custom",
"pool",
"size",
"and",
"fine",
"grained",
"control",
"on",
"connections",
"per",
"route",
".",
"NOTE",
":",
"This",
"must",
"be",
"called",
"prior",
"to",
"instantiating",
"DDataSource",
"for",
"the",
"settings",
"to",
"be",
"e... | train | https://github.com/srikalyc/Sql4D/blob/2c052fe60ead5a16277c798a3440de7d4f6f24f6/Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/DDataSource.java#L108-L114 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/EventHandler.java | EventHandler.triggerStateTransition | void triggerStateTransition(BasicEvent.QueryState newState,
String identifier) {
"""
Triggers a state transition event to @newState with an identifier
(eg, requestId, jobUUID, etc)
@param newState new state
@param identifier event id
"""
String msg = "{newState: " + new... | java | void triggerStateTransition(BasicEvent.QueryState newState,
String identifier)
{
String msg = "{newState: " + newState.getDescription() + ", " +
"info: " + identifier + ", " +
"timestamp: " + getCurrentTimestamp() +
"}";
Event t... | [
"void",
"triggerStateTransition",
"(",
"BasicEvent",
".",
"QueryState",
"newState",
",",
"String",
"identifier",
")",
"{",
"String",
"msg",
"=",
"\"{newState: \"",
"+",
"newState",
".",
"getDescription",
"(",
")",
"+",
"\", \"",
"+",
"\"info: \"",
"+",
"identifi... | Triggers a state transition event to @newState with an identifier
(eg, requestId, jobUUID, etc)
@param newState new state
@param identifier event id | [
"Triggers",
"a",
"state",
"transition",
"event",
"to",
"@newState",
"with",
"an",
"identifier",
"(",
"eg",
"requestId",
"jobUUID",
"etc",
")"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/EventHandler.java#L281-L293 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/SessionTokenInterceptor.java | SessionTokenInterceptor.serviceRequest | @Override
public void serviceRequest(final Request request) {
"""
Override to check whether the session token variable in the incoming request matches what we expect.
@param request the request being serviced.
"""
// Get the expected session token
UIContext uic = UIContextHolder.getCurrent();
String ... | java | @Override
public void serviceRequest(final Request request) {
// Get the expected session token
UIContext uic = UIContextHolder.getCurrent();
String expected = uic.getEnvironment().getSessionToken();
// Get the session token from the request
String got = request.getParameter(Environment.SESSION_TOKEN_VARIAB... | [
"@",
"Override",
"public",
"void",
"serviceRequest",
"(",
"final",
"Request",
"request",
")",
"{",
"// Get the expected session token",
"UIContext",
"uic",
"=",
"UIContextHolder",
".",
"getCurrent",
"(",
")",
";",
"String",
"expected",
"=",
"uic",
".",
"getEnviron... | Override to check whether the session token variable in the incoming request matches what we expect.
@param request the request being serviced. | [
"Override",
"to",
"check",
"whether",
"the",
"session",
"token",
"variable",
"in",
"the",
"incoming",
"request",
"matches",
"what",
"we",
"expect",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/container/SessionTokenInterceptor.java#L37-L65 |
rundeck/rundeck | rundeckapp/src/main/groovy/com/dtolabs/rundeck/core/utils/Utility.java | Utility.seekBack | public static long seekBack(File f, int count, String marker) throws IOException {
"""
seekBack searches backwards for certain markers in a file, and returns position of the final marker found.
count specifies how many markers to search for. if the search reaches the beginning of the file without finding
all of... | java | public static long seekBack(File f, int count, String marker) throws IOException {
return seekBack(f, count, marker, null);
} | [
"public",
"static",
"long",
"seekBack",
"(",
"File",
"f",
",",
"int",
"count",
",",
"String",
"marker",
")",
"throws",
"IOException",
"{",
"return",
"seekBack",
"(",
"f",
",",
"count",
",",
"marker",
",",
"null",
")",
";",
"}"
] | seekBack searches backwards for certain markers in a file, and returns position of the final marker found.
count specifies how many markers to search for. if the search reaches the beginning of the file without finding
all of the markers, then 0 is returned.
@param f the file to search
@param count number of markers t... | [
"seekBack",
"searches",
"backwards",
"for",
"certain",
"markers",
"in",
"a",
"file",
"and",
"returns",
"position",
"of",
"the",
"final",
"marker",
"found",
".",
"count",
"specifies",
"how",
"many",
"markers",
"to",
"search",
"for",
".",
"if",
"the",
"search"... | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/rundeckapp/src/main/groovy/com/dtolabs/rundeck/core/utils/Utility.java#L49-L51 |
census-instrumentation/opencensus-java | impl_core/src/main/java/io/opencensus/implcore/stats/MeasureToViewMap.java | MeasureToViewMap.getView | @javax.annotation.Nullable
synchronized ViewData getView(View.Name viewName, Clock clock, State state) {
"""
Returns a {@link ViewData} corresponding to the given {@link View.Name}.
"""
MutableViewData view = getMutableViewData(viewName);
return view == null ? null : view.toViewData(clock.now(), stat... | java | @javax.annotation.Nullable
synchronized ViewData getView(View.Name viewName, Clock clock, State state) {
MutableViewData view = getMutableViewData(viewName);
return view == null ? null : view.toViewData(clock.now(), state);
} | [
"@",
"javax",
".",
"annotation",
".",
"Nullable",
"synchronized",
"ViewData",
"getView",
"(",
"View",
".",
"Name",
"viewName",
",",
"Clock",
"clock",
",",
"State",
"state",
")",
"{",
"MutableViewData",
"view",
"=",
"getMutableViewData",
"(",
"viewName",
")",
... | Returns a {@link ViewData} corresponding to the given {@link View.Name}. | [
"Returns",
"a",
"{"
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/impl_core/src/main/java/io/opencensus/implcore/stats/MeasureToViewMap.java#L72-L76 |
facebookarchive/hadoop-20 | src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java | DFSFolder.mkdir | public void mkdir(String folderName) {
"""
Create a new sub directory into this directory
@param folderName
"""
try {
getDFS().mkdirs(new Path(this.path, folderName));
} catch (IOException ioe) {
ioe.printStackTrace();
}
doRefresh();
} | java | public void mkdir(String folderName) {
try {
getDFS().mkdirs(new Path(this.path, folderName));
} catch (IOException ioe) {
ioe.printStackTrace();
}
doRefresh();
} | [
"public",
"void",
"mkdir",
"(",
"String",
"folderName",
")",
"{",
"try",
"{",
"getDFS",
"(",
")",
".",
"mkdirs",
"(",
"new",
"Path",
"(",
"this",
".",
"path",
",",
"folderName",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"ioe",
")",
"{",
"ioe... | Create a new sub directory into this directory
@param folderName | [
"Create",
"a",
"new",
"sub",
"directory",
"into",
"this",
"directory"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSFolder.java#L150-L157 |
stackify/stackify-metrics | src/main/java/com/stackify/metric/impl/MetricAggregate.java | MetricAggregate.fromMetricIdentity | public static MetricAggregate fromMetricIdentity(final MetricIdentity identity, final long currentMinute) {
"""
Creates a MetricAggregate
@param identity The metric identity
@param currentMinute Current minute
@return The MetricAggregate
"""
Preconditions.checkNotNull(identity);
return new MetricAggrega... | java | public static MetricAggregate fromMetricIdentity(final MetricIdentity identity, final long currentMinute) {
Preconditions.checkNotNull(identity);
return new MetricAggregate(identity, currentMinute);
} | [
"public",
"static",
"MetricAggregate",
"fromMetricIdentity",
"(",
"final",
"MetricIdentity",
"identity",
",",
"final",
"long",
"currentMinute",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"identity",
")",
";",
"return",
"new",
"MetricAggregate",
"(",
"ident... | Creates a MetricAggregate
@param identity The metric identity
@param currentMinute Current minute
@return The MetricAggregate | [
"Creates",
"a",
"MetricAggregate"
] | train | https://github.com/stackify/stackify-metrics/blob/6827d516085e4b29a3e54da963eebb2955822a5c/src/main/java/com/stackify/metric/impl/MetricAggregate.java#L52-L55 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/Operators.java | Operators.addCap | static long addCap(long a, long b) {
"""
Cap an addition to Long.MAX_VALUE
@param a left operand
@param b right operand
@return Addition result or Long.MAX_VALUE if overflow
"""
long res = a + b;
if (res < 0L) {
return Long.MAX_VALUE;
}
return res;
} | java | static long addCap(long a, long b) {
long res = a + b;
if (res < 0L) {
return Long.MAX_VALUE;
}
return res;
} | [
"static",
"long",
"addCap",
"(",
"long",
"a",
",",
"long",
"b",
")",
"{",
"long",
"res",
"=",
"a",
"+",
"b",
";",
"if",
"(",
"res",
"<",
"0L",
")",
"{",
"return",
"Long",
".",
"MAX_VALUE",
";",
"}",
"return",
"res",
";",
"}"
] | Cap an addition to Long.MAX_VALUE
@param a left operand
@param b right operand
@return Addition result or Long.MAX_VALUE if overflow | [
"Cap",
"an",
"addition",
"to",
"Long",
".",
"MAX_VALUE"
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/Operators.java#L101-L108 |
finmath/finmath-lib | src/main/java6/net/finmath/marketdata/model/curves/DiscountCurve.java | DiscountCurve.createDiscountCurveFromZeroRates | public static DiscountCurve createDiscountCurveFromZeroRates(
String name, Date referenceDate,
double[] times, double[] givenZeroRates, boolean[] isParameter,
InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity) {
"""
Create a discount ... | java | public static DiscountCurve createDiscountCurveFromZeroRates(
String name, Date referenceDate,
double[] times, double[] givenZeroRates, boolean[] isParameter,
InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity) {
LocalDate referenceDataA... | [
"public",
"static",
"DiscountCurve",
"createDiscountCurveFromZeroRates",
"(",
"String",
"name",
",",
"Date",
"referenceDate",
",",
"double",
"[",
"]",
"times",
",",
"double",
"[",
"]",
"givenZeroRates",
",",
"boolean",
"[",
"]",
"isParameter",
",",
"InterpolationM... | Create a discount curve from given times and given zero rates using given interpolation and extrapolation methods.
The discount factor is determined by
<code>
givenDiscountFactors[timeIndex] = Math.exp(- givenZeroRates[timeIndex] * times[timeIndex]);
</code>
@param name The name of this discount curve.
@param referenc... | [
"Create",
"a",
"discount",
"curve",
"from",
"given",
"times",
"and",
"given",
"zero",
"rates",
"using",
"given",
"interpolation",
"and",
"extrapolation",
"methods",
".",
"The",
"discount",
"factor",
"is",
"determined",
"by",
"<code",
">",
"givenDiscountFactors",
... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/marketdata/model/curves/DiscountCurve.java#L216-L223 |
fabric8io/ipaas-quickstarts | archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java | ArchetypeBuilder.replaceOrAddElementText | protected Element replaceOrAddElementText(Document doc, Element parent, String name, String content, List<String> beforeNames) {
"""
Creates new element as child of <code>parent</code> and sets its text content
"""
Element element = replaceOrAddElement(doc, parent, name, beforeNames);
element.s... | java | protected Element replaceOrAddElementText(Document doc, Element parent, String name, String content, List<String> beforeNames) {
Element element = replaceOrAddElement(doc, parent, name, beforeNames);
element.setTextContent(content);
return element;
} | [
"protected",
"Element",
"replaceOrAddElementText",
"(",
"Document",
"doc",
",",
"Element",
"parent",
",",
"String",
"name",
",",
"String",
"content",
",",
"List",
"<",
"String",
">",
"beforeNames",
")",
"{",
"Element",
"element",
"=",
"replaceOrAddElement",
"(",... | Creates new element as child of <code>parent</code> and sets its text content | [
"Creates",
"new",
"element",
"as",
"child",
"of",
"<code",
">",
"parent<",
"/",
"code",
">",
"and",
"sets",
"its",
"text",
"content"
] | train | https://github.com/fabric8io/ipaas-quickstarts/blob/cf9a9aa09204a82ac996304ab8c96791f7e5db22/archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java#L635-L639 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java | LeafNode.getItems | public <T extends Item> List<T> getItems(List<ExtensionElement> additionalExtensions,
List<ExtensionElement> returnedExtensions) throws NoResponseException,
XMPPErrorException, NotConnectedException, InterruptedException {
"""
Get items persisted on the node.
<p>
{@code ad... | java | public <T extends Item> List<T> getItems(List<ExtensionElement> additionalExtensions,
List<ExtensionElement> returnedExtensions) throws NoResponseException,
XMPPErrorException, NotConnectedException, InterruptedException {
PubSub request = createPubsubPacket(Type.get, new... | [
"public",
"<",
"T",
"extends",
"Item",
">",
"List",
"<",
"T",
">",
"getItems",
"(",
"List",
"<",
"ExtensionElement",
">",
"additionalExtensions",
",",
"List",
"<",
"ExtensionElement",
">",
"returnedExtensions",
")",
"throws",
"NoResponseException",
",",
"XMPPErr... | Get items persisted on the node.
<p>
{@code additionalExtensions} can be used e.g. to add a "Result Set Management" extension.
{@code returnedExtensions} will be filled with the stanza extensions found in the answer.
</p>
@param additionalExtensions additional {@code PacketExtensions} to be added to the request.
This ... | [
"Get",
"items",
"persisted",
"on",
"the",
"node",
".",
"<p",
">",
"{",
"@code",
"additionalExtensions",
"}",
"can",
"be",
"used",
"e",
".",
"g",
".",
"to",
"add",
"a",
"Result",
"Set",
"Management",
"extension",
".",
"{",
"@code",
"returnedExtensions",
"... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java#L179-L185 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/core/contents/ContentsDao.java | ContentsDao.getBoundingBox | public BoundingBox getBoundingBox(Projection projection, String table) {
"""
Get the bounding box for the table in the provided projection
@param projection
desired bounding box projection
@param table
table name
@return bounding box
@since 3.1.0
"""
BoundingBox boundingBox = null;
try {
Con... | java | public BoundingBox getBoundingBox(Projection projection, String table) {
BoundingBox boundingBox = null;
try {
Contents contents = queryForId(table);
boundingBox = contents.getBoundingBox(projection);
} catch (SQLException e) {
throw new GeoPackageException(
"Failed to query for contents of table:... | [
"public",
"BoundingBox",
"getBoundingBox",
"(",
"Projection",
"projection",
",",
"String",
"table",
")",
"{",
"BoundingBox",
"boundingBox",
"=",
"null",
";",
"try",
"{",
"Contents",
"contents",
"=",
"queryForId",
"(",
"table",
")",
";",
"boundingBox",
"=",
"co... | Get the bounding box for the table in the provided projection
@param projection
desired bounding box projection
@param table
table name
@return bounding box
@since 3.1.0 | [
"Get",
"the",
"bounding",
"box",
"for",
"the",
"table",
"in",
"the",
"provided",
"projection"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/core/contents/ContentsDao.java#L253-L266 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRowRendererRenderer.java | WTableRowRendererRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WTableRowRenderer.
@param component the WTableRowRenderer to paint.
@param renderContext the RenderContext to paint to.
"""
WTableRowRenderer renderer = (WTableRowRenderer) componen... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WTableRowRenderer renderer = (WTableRowRenderer) component;
XmlStringBuilder xml = renderContext.getWriter();
WTable table = renderer.getTable();
TableModel dataModel = table.getTableModel();
int[] columnOr... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WTableRowRenderer",
"renderer",
"=",
"(",
"WTableRowRenderer",
")",
"component",
";",
"XmlStringBuilder",
"xml",
... | Paints the given WTableRowRenderer.
@param component the WTableRowRenderer to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WTableRowRenderer",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRowRendererRenderer.java#L34-L97 |
zeromq/jeromq | src/main/java/org/zeromq/ZProxy.java | ZProxy.newProxy | public static ZProxy newProxy(ZContext ctx, String name, Proxy sockets, String motdelafin, Object... args) {
"""
Creates a new low-level proxy for better performances.
@param ctx the context used for the proxy.
Possibly null, in this case a new context will be created and automatically destroyed afterwa... | java | public static ZProxy newProxy(ZContext ctx, String name, Proxy sockets, String motdelafin, Object... args)
{
return new ZProxy(ctx, name, sockets, new ZmqPump(), motdelafin, args);
} | [
"public",
"static",
"ZProxy",
"newProxy",
"(",
"ZContext",
"ctx",
",",
"String",
"name",
",",
"Proxy",
"sockets",
",",
"String",
"motdelafin",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"ZProxy",
"(",
"ctx",
",",
"name",
",",
"sockets",
","... | Creates a new low-level proxy for better performances.
@param ctx the context used for the proxy.
Possibly null, in this case a new context will be created and automatically destroyed afterwards.
@param name the name of the proxy. Possibly null.
@param sockets the sockets creator of the proxy. Not null... | [
"Creates",
"a",
"new",
"low",
"-",
"level",
"proxy",
"for",
"better",
"performances",
"."
] | train | https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZProxy.java#L299-L302 |
opentelecoms-org/jsmpp | jsmpp/src/main/java/org/jsmpp/util/RelativeTimeFormatter.java | RelativeTimeFormatter.format | public String format(Calendar calendar) {
"""
Return the relative time against current (SMSC) datetime.
@param calendar the datetime.
@return The relative time between the calendar date and the SMSC calendar date.
"""
// As the relative period is calculated on epoch (timeInMillis), no TimeZone informat... | java | public String format(Calendar calendar) {
// As the relative period is calculated on epoch (timeInMillis), no TimeZone information is needed
Calendar smscCalendar = Calendar.getInstance();
return format(calendar, smscCalendar);
} | [
"public",
"String",
"format",
"(",
"Calendar",
"calendar",
")",
"{",
"// As the relative period is calculated on epoch (timeInMillis), no TimeZone information is needed",
"Calendar",
"smscCalendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"return",
"format",
"(",
... | Return the relative time against current (SMSC) datetime.
@param calendar the datetime.
@return The relative time between the calendar date and the SMSC calendar date. | [
"Return",
"the",
"relative",
"time",
"against",
"current",
"(",
"SMSC",
")",
"datetime",
"."
] | train | https://github.com/opentelecoms-org/jsmpp/blob/acc15e73e7431deabc803731971b15323315baaf/jsmpp/src/main/java/org/jsmpp/util/RelativeTimeFormatter.java#L51-L55 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/dom/DOMUtil.java | DOMUtil.getChildText | public static String getChildText(Element parent, String childName) {
"""
Return the inner text of the first child with the given name.
"""
Element child = getChild(parent, childName);
if (child == null) return null;
return getInnerText(child);
} | java | public static String getChildText(Element parent, String childName) {
Element child = getChild(parent, childName);
if (child == null) return null;
return getInnerText(child);
} | [
"public",
"static",
"String",
"getChildText",
"(",
"Element",
"parent",
",",
"String",
"childName",
")",
"{",
"Element",
"child",
"=",
"getChild",
"(",
"parent",
",",
"childName",
")",
";",
"if",
"(",
"child",
"==",
"null",
")",
"return",
"null",
";",
"r... | Return the inner text of the first child with the given name. | [
"Return",
"the",
"inner",
"text",
"of",
"the",
"first",
"child",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/dom/DOMUtil.java#L52-L56 |
mfornos/humanize | humanize-slim/src/main/java/humanize/Humanize.java | Humanize.nanoTime | @Expose
public static String nanoTime(final Number value, final Locale locale) {
"""
<p>
Same as {@link #nanoTime(Number)} for the specified locale.
</p>
@param value
Number of nanoseconds
@param locale
Target locale
@return The number preceded by the corresponding SI symbol
"""
return wit... | java | @Expose
public static String nanoTime(final Number value, final Locale locale)
{
return withinLocale(new Callable<String>()
{
public String call()
{
return prefix(value, 1000, nanoTimePrefixes);
}
}, locale);
} | [
"@",
"Expose",
"public",
"static",
"String",
"nanoTime",
"(",
"final",
"Number",
"value",
",",
"final",
"Locale",
"locale",
")",
"{",
"return",
"withinLocale",
"(",
"new",
"Callable",
"<",
"String",
">",
"(",
")",
"{",
"public",
"String",
"call",
"(",
")... | <p>
Same as {@link #nanoTime(Number)} for the specified locale.
</p>
@param value
Number of nanoseconds
@param locale
Target locale
@return The number preceded by the corresponding SI symbol | [
"<p",
">",
"Same",
"as",
"{",
"@link",
"#nanoTime",
"(",
"Number",
")",
"}",
"for",
"the",
"specified",
"locale",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-slim/src/main/java/humanize/Humanize.java#L1436-L1446 |
cdk/cdk | descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GSR.java | RDFProtonDescriptor_GSR.calculateAngleBetweenTwoLines | private double calculateAngleBetweenTwoLines(Vector3d a, Vector3d b, Vector3d c, Vector3d d) {
"""
this method calculates the angle between two bonds given coordinates of their atoms
"""
Vector3d firstLine = new Vector3d();
firstLine.sub(a, b);
Vector3d secondLine = new Vector3d();
... | java | private double calculateAngleBetweenTwoLines(Vector3d a, Vector3d b, Vector3d c, Vector3d d) {
Vector3d firstLine = new Vector3d();
firstLine.sub(a, b);
Vector3d secondLine = new Vector3d();
secondLine.sub(c, d);
Vector3d firstVec = new Vector3d(firstLine);
Vector3d secon... | [
"private",
"double",
"calculateAngleBetweenTwoLines",
"(",
"Vector3d",
"a",
",",
"Vector3d",
"b",
",",
"Vector3d",
"c",
",",
"Vector3d",
"d",
")",
"{",
"Vector3d",
"firstLine",
"=",
"new",
"Vector3d",
"(",
")",
";",
"firstLine",
".",
"sub",
"(",
"a",
",",
... | this method calculates the angle between two bonds given coordinates of their atoms | [
"this",
"method",
"calculates",
"the",
"angle",
"between",
"two",
"bonds",
"given",
"coordinates",
"of",
"their",
"atoms"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GSR.java#L500-L508 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java | AmazonWebServiceRequest.putCustomQueryParameter | public void putCustomQueryParameter(String name, String value) {
"""
Add a custom query parameter for the request. Since multiple values are allowed for the same
query parameter, this method does NOT overwrite any existing parameter values in the request.
<p>
Any custom query parameters that are defined are use... | java | public void putCustomQueryParameter(String name, String value) {
if (customQueryParameters == null) {
customQueryParameters = new HashMap<String, List<String>>();
}
List<String> paramList = customQueryParameters.get(name);
if (paramList == null) {
paramList = new ... | [
"public",
"void",
"putCustomQueryParameter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"customQueryParameters",
"==",
"null",
")",
"{",
"customQueryParameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"List",
"<",
"String",
">",
... | Add a custom query parameter for the request. Since multiple values are allowed for the same
query parameter, this method does NOT overwrite any existing parameter values in the request.
<p>
Any custom query parameters that are defined are used in the HTTP request to the AWS service.
@param name
The name of the query ... | [
"Add",
"a",
"custom",
"query",
"parameter",
"for",
"the",
"request",
".",
"Since",
"multiple",
"values",
"are",
"allowed",
"for",
"the",
"same",
"query",
"parameter",
"this",
"method",
"does",
"NOT",
"overwrite",
"any",
"existing",
"parameter",
"values",
"in",... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java#L283-L293 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/JCublasNDArrayFactory.java | JCublasNDArrayFactory.convertDataEx | @Override
public INDArray convertDataEx(DataTypeEx typeSrc, INDArray source, DataTypeEx typeDst) {
"""
This method converts Single/Double precision databuffer to Half-precision databuffer
@param typeSrc
@param source
@param typeDst @return
"""
if (source.isView())
throw new Unsuppo... | java | @Override
public INDArray convertDataEx(DataTypeEx typeSrc, INDArray source, DataTypeEx typeDst) {
if (source.isView())
throw new UnsupportedOperationException("Impossible to compress View. Consider using dup() before. ");
DataBuffer buffer = convertDataEx(typeSrc, source.data(), typeDs... | [
"@",
"Override",
"public",
"INDArray",
"convertDataEx",
"(",
"DataTypeEx",
"typeSrc",
",",
"INDArray",
"source",
",",
"DataTypeEx",
"typeDst",
")",
"{",
"if",
"(",
"source",
".",
"isView",
"(",
")",
")",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\... | This method converts Single/Double precision databuffer to Half-precision databuffer
@param typeSrc
@param source
@param typeDst @return | [
"This",
"method",
"converts",
"Single",
"/",
"Double",
"precision",
"databuffer",
"to",
"Half",
"-",
"precision",
"databuffer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/JCublasNDArrayFactory.java#L1231-L1245 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectRayLine | public static float intersectRayLine(float originX, float originY, float dirX, float dirY, float pointX, float pointY, float normalX, float normalY, float epsilon) {
"""
Test whether the ray with given origin <code>(originX, originY)</code> and direction <code>(dirX, dirY)</code> intersects the line
containing th... | java | public static float intersectRayLine(float originX, float originY, float dirX, float dirY, float pointX, float pointY, float normalX, float normalY, float epsilon) {
float denom = normalX * dirX + normalY * dirY;
if (denom < epsilon) {
float t = ((pointX - originX) * normalX + (pointY - orig... | [
"public",
"static",
"float",
"intersectRayLine",
"(",
"float",
"originX",
",",
"float",
"originY",
",",
"float",
"dirX",
",",
"float",
"dirY",
",",
"float",
"pointX",
",",
"float",
"pointY",
",",
"float",
"normalX",
",",
"float",
"normalY",
",",
"float",
"... | Test whether the ray with given origin <code>(originX, originY)</code> and direction <code>(dirX, dirY)</code> intersects the line
containing the given point <code>(pointX, pointY)</code> and having the normal <code>(normalX, normalY)</code>, and return the
value of the parameter <i>t</i> in the ray equation <i>p(t) = ... | [
"Test",
"whether",
"the",
"ray",
"with",
"given",
"origin",
"<code",
">",
"(",
"originX",
"originY",
")",
"<",
"/",
"code",
">",
"and",
"direction",
"<code",
">",
"(",
"dirX",
"dirY",
")",
"<",
"/",
"code",
">",
"intersects",
"the",
"line",
"containing... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L3919-L3927 |
ltearno/hexa.tools | hexa.persistence/src/main/java/fr/lteconsulting/hexa/persistence/client/hqlParser.java | hqlParser.innerSubQuery | public final hqlParser.innerSubQuery_return innerSubQuery() throws RecognitionException {
"""
hql.g:685:1: innerSubQuery : queryRule -> ^( QUERY[\"query\"] queryRule ) ;
"""
hqlParser.innerSubQuery_return retval = new hqlParser.innerSubQuery_return();
retval.start = input.LT(1);
CommonTree root_0 = null... | java | public final hqlParser.innerSubQuery_return innerSubQuery() throws RecognitionException {
hqlParser.innerSubQuery_return retval = new hqlParser.innerSubQuery_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
ParserRuleReturnScope queryRule300 =null;
RewriteRuleSubtreeStream stream_queryRule=n... | [
"public",
"final",
"hqlParser",
".",
"innerSubQuery_return",
"innerSubQuery",
"(",
")",
"throws",
"RecognitionException",
"{",
"hqlParser",
".",
"innerSubQuery_return",
"retval",
"=",
"new",
"hqlParser",
".",
"innerSubQuery_return",
"(",
")",
";",
"retval",
".",
"st... | hql.g:685:1: innerSubQuery : queryRule -> ^( QUERY[\"query\"] queryRule ) ; | [
"hql",
".",
"g",
":",
"685",
":",
"1",
":",
"innerSubQuery",
":",
"queryRule",
"-",
">",
"^",
"(",
"QUERY",
"[",
"\\",
"query",
"\\",
"]",
"queryRule",
")",
";"
] | train | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.persistence/src/main/java/fr/lteconsulting/hexa/persistence/client/hqlParser.java#L9683-L9745 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/io/LruTraceCache.java | LruTraceCache.put | public TraceObject put(TraceObject value) {
"""
Add value to map.
@param value value to add
@return added value
"""
String key =
increment.incrementAndGet() + "- " + DateTimeFormatter.ISO_INSTANT.format(Instant.now());
return put(key, value);
} | java | public TraceObject put(TraceObject value) {
String key =
increment.incrementAndGet() + "- " + DateTimeFormatter.ISO_INSTANT.format(Instant.now());
return put(key, value);
} | [
"public",
"TraceObject",
"put",
"(",
"TraceObject",
"value",
")",
"{",
"String",
"key",
"=",
"increment",
".",
"incrementAndGet",
"(",
")",
"+",
"\"- \"",
"+",
"DateTimeFormatter",
".",
"ISO_INSTANT",
".",
"format",
"(",
"Instant",
".",
"now",
"(",
")",
")... | Add value to map.
@param value value to add
@return added value | [
"Add",
"value",
"to",
"map",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/LruTraceCache.java#L78-L82 |
structlogging/structlogger | structlogger/src/main/java/com/github/structlogging/processor/LogInvocationScanner.java | LogInvocationScanner.visitExpressionStatement | @Override
public Object visitExpressionStatement(final ExpressionStatementTree node, final ScannerParams scannerParams) {
"""
Checks expressions, if expression is method call on {@link StructLogger} field, it is considered structured log statement and is
expression is transformed in such way, that method chai... | java | @Override
public Object visitExpressionStatement(final ExpressionStatementTree node, final ScannerParams scannerParams) {
final JCTree.JCExpressionStatement statement = (JCTree.JCExpressionStatement) getCurrentPath().getLeaf();
final StatementInfo statementInfo = new StatementInfo(
... | [
"@",
"Override",
"public",
"Object",
"visitExpressionStatement",
"(",
"final",
"ExpressionStatementTree",
"node",
",",
"final",
"ScannerParams",
"scannerParams",
")",
"{",
"final",
"JCTree",
".",
"JCExpressionStatement",
"statement",
"=",
"(",
"JCTree",
".",
"JCExpres... | Checks expressions, if expression is method call on {@link StructLogger} field, it is considered structured log statement and is
expression is transformed in such way, that method chain is replaced with one call to corresponding infoEvent, errorEvent,... method
with instance of generated class of Event based on method ... | [
"Checks",
"expressions",
"if",
"expression",
"is",
"method",
"call",
"on",
"{"
] | train | https://github.com/structlogging/structlogger/blob/1fcca4e962ef53cbdb94bd72cb556de7f5f9469f/structlogger/src/main/java/com/github/structlogging/processor/LogInvocationScanner.java#L101-L141 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatterBuilder.java | PeriodFormatterBuilder.appendPrefix | public PeriodFormatterBuilder appendPrefix(String[] regularExpressions, String[] prefixes) {
"""
Append a field prefix which applies only to the next appended field.
If the field is not printed, neither is the prefix.
<p>
The value is converted to String. During parsing, the prefix is selected based
on the mat... | java | public PeriodFormatterBuilder appendPrefix(String[] regularExpressions, String[] prefixes) {
if (regularExpressions == null || prefixes == null ||
regularExpressions.length < 1 || regularExpressions.length != prefixes.length) {
throw new IllegalArgumentException();
}
... | [
"public",
"PeriodFormatterBuilder",
"appendPrefix",
"(",
"String",
"[",
"]",
"regularExpressions",
",",
"String",
"[",
"]",
"prefixes",
")",
"{",
"if",
"(",
"regularExpressions",
"==",
"null",
"||",
"prefixes",
"==",
"null",
"||",
"regularExpressions",
".",
"len... | Append a field prefix which applies only to the next appended field.
If the field is not printed, neither is the prefix.
<p>
The value is converted to String. During parsing, the prefix is selected based
on the match with the regular expression. The index of the first regular
expression that matches value converted to ... | [
"Append",
"a",
"field",
"prefix",
"which",
"applies",
"only",
"to",
"the",
"next",
"appended",
"field",
".",
"If",
"the",
"field",
"is",
"not",
"printed",
"neither",
"is",
"the",
"prefix",
".",
"<p",
">",
"The",
"value",
"is",
"converted",
"to",
"String"... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatterBuilder.java#L416-L422 |
baratine/baratine | framework/src/main/java/com/caucho/v5/ramp/jamp/InJamp.java | InJamp.readMessages | public int readMessages(Reader is, OutboxAmp outbox)
throws IOException {
"""
Reads the next HMTP packet from the stream, returning false on
end of file.
"""
Objects.requireNonNull(outbox);
JsonReaderImpl jIn = new JsonReaderImpl(is, _jsonFactory);
return readMessages(jIn, outbox);... | java | public int readMessages(Reader is, OutboxAmp outbox)
throws IOException
{
Objects.requireNonNull(outbox);
JsonReaderImpl jIn = new JsonReaderImpl(is, _jsonFactory);
return readMessages(jIn, outbox);
} | [
"public",
"int",
"readMessages",
"(",
"Reader",
"is",
",",
"OutboxAmp",
"outbox",
")",
"throws",
"IOException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"outbox",
")",
";",
"JsonReaderImpl",
"jIn",
"=",
"new",
"JsonReaderImpl",
"(",
"is",
",",
"_jsonFactory... | Reads the next HMTP packet from the stream, returning false on
end of file. | [
"Reads",
"the",
"next",
"HMTP",
"packet",
"from",
"the",
"stream",
"returning",
"false",
"on",
"end",
"of",
"file",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/ramp/jamp/InJamp.java#L216-L224 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java | CommonOps_DDF4.addEquals | public static void addEquals( DMatrix4x4 a , DMatrix4x4 b ) {
"""
<p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>ij</sub> = a<sub>ij</sub> + b<sub>ij</sub> <br>
</p>
@param a A Matrix. Modified.
@param b A Matrix. Not modified.
"""
a.a11 += b.a11;
a.a12 += b.a12;
... | java | public static void addEquals( DMatrix4x4 a , DMatrix4x4 b ) {
a.a11 += b.a11;
a.a12 += b.a12;
a.a13 += b.a13;
a.a14 += b.a14;
a.a21 += b.a21;
a.a22 += b.a22;
a.a23 += b.a23;
a.a24 += b.a24;
a.a31 += b.a31;
a.a32 += b.a32;
a.a33 += b... | [
"public",
"static",
"void",
"addEquals",
"(",
"DMatrix4x4",
"a",
",",
"DMatrix4x4",
"b",
")",
"{",
"a",
".",
"a11",
"+=",
"b",
".",
"a11",
";",
"a",
".",
"a12",
"+=",
"b",
".",
"a12",
";",
"a",
".",
"a13",
"+=",
"b",
".",
"a13",
";",
"a",
"."... | <p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>ij</sub> = a<sub>ij</sub> + b<sub>ij</sub> <br>
</p>
@param a A Matrix. Modified.
@param b A Matrix. Not modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"a",
"=",
"a",
"+",
"b",
"<br",
">",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"+",
"b<sub",
">",
"ij<",
"/",
"sub",
"... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java#L98-L115 |
google/closure-compiler | src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java | TypeTransformationParser.validInstanceOfExpression | private boolean validInstanceOfExpression(Node expr) {
"""
A typeOfVar expression must be of the form instanceOf('name')
"""
// The expression must have two children:
// - The instanceOf keyword
// - A string
if (!checkParameterCount(expr, Keywords.INSTANCEOF)) {
return false;
}
i... | java | private boolean validInstanceOfExpression(Node expr) {
// The expression must have two children:
// - The instanceOf keyword
// - A string
if (!checkParameterCount(expr, Keywords.INSTANCEOF)) {
return false;
}
if (!validTypeTransformationExpression(getCallArgument(expr, 0))) {
warnIn... | [
"private",
"boolean",
"validInstanceOfExpression",
"(",
"Node",
"expr",
")",
"{",
"// The expression must have two children:",
"// - The instanceOf keyword",
"// - A string",
"if",
"(",
"!",
"checkParameterCount",
"(",
"expr",
",",
"Keywords",
".",
"INSTANCEOF",
")",
")",... | A typeOfVar expression must be of the form instanceOf('name') | [
"A",
"typeOfVar",
"expression",
"must",
"be",
"of",
"the",
"form",
"instanceOf",
"(",
"name",
")"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java#L741-L753 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.invokeConstructor | public static <T> T invokeConstructor(Class<T> classThatContainsTheConstructorToTest, Object... arguments)
throws Exception {
"""
Invoke a constructor. Useful for testing classes with a private
constructor.
@param <T> the generic type
@param classThatContainsTheCo... | java | public static <T> T invokeConstructor(Class<T> classThatContainsTheConstructorToTest, Object... arguments)
throws Exception {
if (classThatContainsTheConstructorToTest == null) {
throw new IllegalArgumentException("The class should contain the constructor cannot be null.");
}
... | [
"public",
"static",
"<",
"T",
">",
"T",
"invokeConstructor",
"(",
"Class",
"<",
"T",
">",
"classThatContainsTheConstructorToTest",
",",
"Object",
"...",
"arguments",
")",
"throws",
"Exception",
"{",
"if",
"(",
"classThatContainsTheConstructorToTest",
"==",
"null",
... | Invoke a constructor. Useful for testing classes with a private
constructor.
@param <T> the generic type
@param classThatContainsTheConstructorToTest the class that contains the constructor to test
@param arguments the arguments
@return The object created a... | [
"Invoke",
"a",
"constructor",
".",
"Useful",
"for",
"testing",
"classes",
"with",
"a",
"private",
"constructor",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L1275-L1297 |
groovy/groovy-core | src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java | StaticTypeCheckingVisitor.addArrayMethods | private void addArrayMethods(List<MethodNode> methods, ClassNode receiver, String name, ClassNode[] args) {
"""
add various getAt and setAt methods for primitive arrays
@param receiver the receiver class
@param name the name of the method
@param args the argument classes
"""
if (args.length!=1) ret... | java | private void addArrayMethods(List<MethodNode> methods, ClassNode receiver, String name, ClassNode[] args) {
if (args.length!=1) return;
if (!receiver.isArray()) return;
if (!isIntCategory(getUnwrapper(args[0]))) return;
if ("getAt".equals(name)) {
MethodNode node = new Method... | [
"private",
"void",
"addArrayMethods",
"(",
"List",
"<",
"MethodNode",
">",
"methods",
",",
"ClassNode",
"receiver",
",",
"String",
"name",
",",
"ClassNode",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
".",
"length",
"!=",
"1",
")",
"return",
";",
"i... | add various getAt and setAt methods for primitive arrays
@param receiver the receiver class
@param name the name of the method
@param args the argument classes | [
"add",
"various",
"getAt",
"and",
"setAt",
"methods",
"for",
"primitive",
"arrays"
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L3011-L3024 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.