repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
188
func_name
stringlengths
7
127
whole_func_string
stringlengths
77
3.91k
language
stringclasses
1 value
func_code_string
stringlengths
77
3.91k
func_code_tokens
listlengths
20
745
func_documentation_string
stringlengths
61
1.98k
func_documentation_tokens
listlengths
1
477
split_name
stringclasses
1 value
func_code_url
stringlengths
111
288
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java
Calendar.prepareGetActual
protected void prepareGetActual(int field, boolean isMinimum) { set(MILLISECONDS_IN_DAY, 0); switch (field) { case YEAR: case EXTENDED_YEAR: set(DAY_OF_YEAR, getGreatestMinimum(DAY_OF_YEAR)); break; case YEAR_WOY: set(WEEK_OF_YEAR, getGreates...
java
protected void prepareGetActual(int field, boolean isMinimum) { set(MILLISECONDS_IN_DAY, 0); switch (field) { case YEAR: case EXTENDED_YEAR: set(DAY_OF_YEAR, getGreatestMinimum(DAY_OF_YEAR)); break; case YEAR_WOY: set(WEEK_OF_YEAR, getGreates...
[ "protected", "void", "prepareGetActual", "(", "int", "field", ",", "boolean", "isMinimum", ")", "{", "set", "(", "MILLISECONDS_IN_DAY", ",", "0", ")", ";", "switch", "(", "field", ")", "{", "case", "YEAR", ":", "case", "EXTENDED_YEAR", ":", "set", "(", "...
Prepare this calendar for computing the actual minimum or maximum. This method modifies this calendar's fields; it is called on a temporary calendar. <p>Rationale: The semantics of getActualXxx() is to return the maximum or minimum value that the given field can take, taking into account other relevant fields. In gen...
[ "Prepare", "this", "calendar", "for", "computing", "the", "actual", "minimum", "or", "maximum", ".", "This", "method", "modifies", "this", "calendar", "s", "fields", ";", "it", "is", "called", "on", "a", "temporary", "calendar", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L2510-L2555
goldmansachs/reladomo
reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/DependentLoadingTaskSpawner.java
DependentLoadingTaskSpawner.createDependentKeyIndex
public DependentKeyIndex createDependentKeyIndex(CacheLoaderEngine cacheLoaderEngine, Extractor[] keyExtractors, Operation ownerObjectFilter) { DependentKeyIndex dependentKeyIndex = null; for (DependentKeyIndex each : this.dependentKeyIndexes) { if (Arrays.equals(each.getK...
java
public DependentKeyIndex createDependentKeyIndex(CacheLoaderEngine cacheLoaderEngine, Extractor[] keyExtractors, Operation ownerObjectFilter) { DependentKeyIndex dependentKeyIndex = null; for (DependentKeyIndex each : this.dependentKeyIndexes) { if (Arrays.equals(each.getK...
[ "public", "DependentKeyIndex", "createDependentKeyIndex", "(", "CacheLoaderEngine", "cacheLoaderEngine", ",", "Extractor", "[", "]", "keyExtractors", ",", "Operation", "ownerObjectFilter", ")", "{", "DependentKeyIndex", "dependentKeyIndex", "=", "null", ";", "for", "(", ...
executed from a single thread during the cacheloader startup.
[ "executed", "from", "a", "single", "thread", "during", "the", "cacheloader", "startup", "." ]
train
https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/DependentLoadingTaskSpawner.java#L163-L194
imsweb/naaccr-xml
src/main/java/com/imsweb/naaccrxml/runtime/NaaccrStreamConfiguration.java
NaaccrStreamConfiguration.registerNamespace
public void registerNamespace(String namespacePrefix, String namespaceUri) { if (_namespaces.containsKey(namespacePrefix)) throw new RuntimeException("Namespace prefix '" + namespacePrefix + "' has already been registered"); _namespaces.put(namespacePrefix, namespaceUri); }
java
public void registerNamespace(String namespacePrefix, String namespaceUri) { if (_namespaces.containsKey(namespacePrefix)) throw new RuntimeException("Namespace prefix '" + namespacePrefix + "' has already been registered"); _namespaces.put(namespacePrefix, namespaceUri); }
[ "public", "void", "registerNamespace", "(", "String", "namespacePrefix", ",", "String", "namespaceUri", ")", "{", "if", "(", "_namespaces", ".", "containsKey", "(", "namespacePrefix", ")", ")", "throw", "new", "RuntimeException", "(", "\"Namespace prefix '\"", "+", ...
Registers a namespace for a given namespace prefix. This method must be called before registering any tags or attributes for that namespace. Note that extensions require namespaces to work properly. @param namespacePrefix the namespace prefix, cannot be null @param namespaceUri the namespace URI, cannot be null
[ "Registers", "a", "namespace", "for", "a", "given", "namespace", "prefix", ".", "This", "method", "must", "be", "called", "before", "registering", "any", "tags", "or", "attributes", "for", "that", "namespace", ".", "Note", "that", "extensions", "require", "nam...
train
https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/runtime/NaaccrStreamConfiguration.java#L236-L240
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/AbstractAddStepHandler.java
AbstractAddStepHandler.createResource
protected Resource createResource(final OperationContext context, final ModelNode operation) { ImmutableManagementResourceRegistration registration = context.getResourceRegistration(); if (registration != null) { Set<String> orderedChildTypes = registration.getOrderedChildTypes(); ...
java
protected Resource createResource(final OperationContext context, final ModelNode operation) { ImmutableManagementResourceRegistration registration = context.getResourceRegistration(); if (registration != null) { Set<String> orderedChildTypes = registration.getOrderedChildTypes(); ...
[ "protected", "Resource", "createResource", "(", "final", "OperationContext", "context", ",", "final", "ModelNode", "operation", ")", "{", "ImmutableManagementResourceRegistration", "registration", "=", "context", ".", "getResourceRegistration", "(", ")", ";", "if", "(",...
Create the {@link Resource} that the {@link AbstractAddStepHandler#execute(OperationContext, ModelNode)} method operates on. This method is invoked during {@link org.jboss.as.controller.OperationContext.Stage#MODEL}. <p> This default implementation uses the {@link org.jboss.as.controller.OperationContext#createResource...
[ "Create", "the", "{", "@link", "Resource", "}", "that", "the", "{", "@link", "AbstractAddStepHandler#execute", "(", "OperationContext", "ModelNode", ")", "}", "method", "operates", "on", ".", "This", "method", "is", "invoked", "during", "{", "@link", "org", "....
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractAddStepHandler.java#L183-L193
aws/aws-sdk-java
aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/ListTriggersRequest.java
ListTriggersRequest.withTags
public ListTriggersRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
java
public ListTriggersRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "ListTriggersRequest", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
<p> Specifies to return only these tagged resources. </p> @param tags Specifies to return only these tagged resources. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "Specifies", "to", "return", "only", "these", "tagged", "resources", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/ListTriggersRequest.java#L215-L218
infinispan/infinispan
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transaction/TransactionContext.java
TransactionContext.prepareContext
int prepareContext(Xid xid, boolean onePhaseCommit, long timeout) { PrepareTransactionOperation operation; Collection<Modification> modifications; try { modifications = toModification(); if (trace) { log.tracef("Preparing transaction xid=%s, remote-cache=%s, modification-...
java
int prepareContext(Xid xid, boolean onePhaseCommit, long timeout) { PrepareTransactionOperation operation; Collection<Modification> modifications; try { modifications = toModification(); if (trace) { log.tracef("Preparing transaction xid=%s, remote-cache=%s, modification-...
[ "int", "prepareContext", "(", "Xid", "xid", ",", "boolean", "onePhaseCommit", ",", "long", "timeout", ")", "{", "PrepareTransactionOperation", "operation", ";", "Collection", "<", "Modification", ">", "modifications", ";", "try", "{", "modifications", "=", "toModi...
Prepares the {@link Transaction} in the server and returns the {@link XAResource} code. <p> A special value {@link Integer#MIN_VALUE} is used to signal an error before contacting the server (for example, it wasn't able to marshall the key/value)
[ "Prepares", "the", "{" ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transaction/TransactionContext.java#L176-L203
googleads/googleads-java-lib
examples/adwords_axis/src/main/java/adwords/axis/v201809/advancedoperations/AddDynamicSearchAdsCampaign.java
AddDynamicSearchAdsCampaign.runExample
public static void runExample(AdWordsServicesInterface adWordsServices, AdWordsSession session) throws RemoteException { Budget budget = createBudget(adWordsServices, session); Campaign campaign = createCampaign(adWordsServices, session, budget); AdGroup adGroup = createAdGroup(adWordsServices, sessi...
java
public static void runExample(AdWordsServicesInterface adWordsServices, AdWordsSession session) throws RemoteException { Budget budget = createBudget(adWordsServices, session); Campaign campaign = createCampaign(adWordsServices, session, budget); AdGroup adGroup = createAdGroup(adWordsServices, sessi...
[ "public", "static", "void", "runExample", "(", "AdWordsServicesInterface", "adWordsServices", ",", "AdWordsSession", "session", ")", "throws", "RemoteException", "{", "Budget", "budget", "=", "createBudget", "(", "adWordsServices", ",", "session", ")", ";", "Campaign"...
Runs the example. @param adWordsServices the services factory. @param session the session. @throws ApiException if the API request failed with one or more service errors. @throws RemoteException if the API request failed due to other errors.
[ "Runs", "the", "example", "." ]
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/adwords_axis/src/main/java/adwords/axis/v201809/advancedoperations/AddDynamicSearchAdsCampaign.java#L142-L150
Azure/azure-sdk-for-java
policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java
PolicyEventsInner.listQueryResultsForSubscription
public PolicyEventsQueryResultsInner listQueryResultsForSubscription(String subscriptionId, QueryOptions queryOptions) { return listQueryResultsForSubscriptionWithServiceResponseAsync(subscriptionId, queryOptions).toBlocking().single().body(); }
java
public PolicyEventsQueryResultsInner listQueryResultsForSubscription(String subscriptionId, QueryOptions queryOptions) { return listQueryResultsForSubscriptionWithServiceResponseAsync(subscriptionId, queryOptions).toBlocking().single().body(); }
[ "public", "PolicyEventsQueryResultsInner", "listQueryResultsForSubscription", "(", "String", "subscriptionId", ",", "QueryOptions", "queryOptions", ")", "{", "return", "listQueryResultsForSubscriptionWithServiceResponseAsync", "(", "subscriptionId", ",", "queryOptions", ")", ".",...
Queries policy events for the resources under the subscription. @param subscriptionId Microsoft Azure subscription ID. @param queryOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @throws QueryFailureException thrown if the request is rejected by...
[ "Queries", "policy", "events", "for", "the", "resources", "under", "the", "subscription", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java#L374-L376
OpenLiberty/open-liberty
dev/com.ibm.ws.transaction.cdi/src/com/ibm/tx/jta/cdi/interceptors/RequiresNew.java
RequiresNew.requiresNew
@AroundInvoke public Object requiresNew(final InvocationContext context) throws Exception { return runUnderUOWManagingEnablement(UOWSynchronizationRegistry.UOW_TYPE_GLOBAL_TRANSACTION, false, context, "REQUIRES_NEW"); }
java
@AroundInvoke public Object requiresNew(final InvocationContext context) throws Exception { return runUnderUOWManagingEnablement(UOWSynchronizationRegistry.UOW_TYPE_GLOBAL_TRANSACTION, false, context, "REQUIRES_NEW"); }
[ "@", "AroundInvoke", "public", "Object", "requiresNew", "(", "final", "InvocationContext", "context", ")", "throws", "Exception", "{", "return", "runUnderUOWManagingEnablement", "(", "UOWSynchronizationRegistry", ".", "UOW_TYPE_GLOBAL_TRANSACTION", ",", "false", ",", "con...
<p>If called outside a transaction context, the interceptor must begin a new JTA transaction, the managed bean method execution must then continue inside this transaction context, and the transaction must be completed by the interceptor.</p> <p>If called inside a transaction context, the current transaction context mus...
[ "<p", ">", "If", "called", "outside", "a", "transaction", "context", "the", "interceptor", "must", "begin", "a", "new", "JTA", "transaction", "the", "managed", "bean", "method", "execution", "must", "then", "continue", "inside", "this", "transaction", "context",...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transaction.cdi/src/com/ibm/tx/jta/cdi/interceptors/RequiresNew.java#L39-L44
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/ModelControllerImpl.java
ModelControllerImpl.executeReadOnlyOperation
@SuppressWarnings("deprecation") protected ModelNode executeReadOnlyOperation(final ModelNode operation, final OperationMessageHandler handler, final OperationTransactionControl control, final OperationStepHandler prepareStep, final int operationId) { final AbstractOperationContext delegateContext = getDele...
java
@SuppressWarnings("deprecation") protected ModelNode executeReadOnlyOperation(final ModelNode operation, final OperationMessageHandler handler, final OperationTransactionControl control, final OperationStepHandler prepareStep, final int operationId) { final AbstractOperationContext delegateContext = getDele...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "protected", "ModelNode", "executeReadOnlyOperation", "(", "final", "ModelNode", "operation", ",", "final", "OperationMessageHandler", "handler", ",", "final", "OperationTransactionControl", "control", ",", "final", "O...
Executes an operation on the controller latching onto an existing transaction @param operation the operation @param handler the handler @param control the transaction control @param prepareStep the prepare step to be executed before any other steps @param operationId the id of the current transaction @return the resul...
[ "Executes", "an", "operation", "on", "the", "controller", "latching", "onto", "an", "existing", "transaction" ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ModelControllerImpl.java#L271-L280
OpenBEL/openbel-framework
org.openbel.framework.tools/src/main/java/org/openbel/framework/tools/PhaseThreeApplication.java
PhaseThreeApplication.stage5Statement
private void stage5Statement(final ProtoNetwork network, int pct) { if (pct > 0) { stageOutput("Equivalencing statements"); int sct = p2.stage3EquivalenceStatements(network); stageOutput("(" + sct + " equivalences)"); } else { stageOutput("Skipping stateme...
java
private void stage5Statement(final ProtoNetwork network, int pct) { if (pct > 0) { stageOutput("Equivalencing statements"); int sct = p2.stage3EquivalenceStatements(network); stageOutput("(" + sct + " equivalences)"); } else { stageOutput("Skipping stateme...
[ "private", "void", "stage5Statement", "(", "final", "ProtoNetwork", "network", ",", "int", "pct", ")", "{", "if", "(", "pct", ">", "0", ")", "{", "stageOutput", "(", "\"Equivalencing statements\"", ")", ";", "int", "sct", "=", "p2", ".", "stage3EquivalenceSt...
Stage five statement equivalencing. @param network the {@link ProtoNetwork network} to equivalence @param pct the parameter equivalencing count to control output
[ "Stage", "five", "statement", "equivalencing", "." ]
train
https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.tools/src/main/java/org/openbel/framework/tools/PhaseThreeApplication.java#L1263-L1271
j-easy/easy-random
easy-random-core/src/main/java/org/jeasy/random/randomizers/range/IntegerRangeRandomizer.java
IntegerRangeRandomizer.aNewIntegerRangeRandomizer
public static IntegerRangeRandomizer aNewIntegerRangeRandomizer(final Integer min, final Integer max, final long seed) { return new IntegerRangeRandomizer(min, max, seed); }
java
public static IntegerRangeRandomizer aNewIntegerRangeRandomizer(final Integer min, final Integer max, final long seed) { return new IntegerRangeRandomizer(min, max, seed); }
[ "public", "static", "IntegerRangeRandomizer", "aNewIntegerRangeRandomizer", "(", "final", "Integer", "min", ",", "final", "Integer", "max", ",", "final", "long", "seed", ")", "{", "return", "new", "IntegerRangeRandomizer", "(", "min", ",", "max", ",", "seed", ")...
Create a new {@link IntegerRangeRandomizer}. @param min min value @param max max value @param seed initial seed @return a new {@link IntegerRangeRandomizer}.
[ "Create", "a", "new", "{", "@link", "IntegerRangeRandomizer", "}", "." ]
train
https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/IntegerRangeRandomizer.java#L73-L75
adorsys/hbci4java-adorsys
src/main/java/org/kapott/hbci/GV/SepaUtil.java
SepaUtil.maxIndex
public static Integer maxIndex(HashMap<String, String> properties) { Integer max = null; for (String key : properties.keySet()) { Matcher m = INDEX_PATTERN.matcher(key); if (m.matches()) { int index = Integer.parseInt(m.group(1)); if (max == null |...
java
public static Integer maxIndex(HashMap<String, String> properties) { Integer max = null; for (String key : properties.keySet()) { Matcher m = INDEX_PATTERN.matcher(key); if (m.matches()) { int index = Integer.parseInt(m.group(1)); if (max == null |...
[ "public", "static", "Integer", "maxIndex", "(", "HashMap", "<", "String", ",", "String", ">", "properties", ")", "{", "Integer", "max", "=", "null", ";", "for", "(", "String", "key", ":", "properties", ".", "keySet", "(", ")", ")", "{", "Matcher", "m",...
Ermittelt den maximalen Index aller indizierten Properties. Nicht indizierte Properties werden ignoriert. @param properties die Properties, mit denen gearbeitet werden soll @return Maximaler Index, oder {@code null}, wenn keine indizierten Properties gefunden wurden
[ "Ermittelt", "den", "maximalen", "Index", "aller", "indizierten", "Properties", ".", "Nicht", "indizierte", "Properties", "werden", "ignoriert", "." ]
train
https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/SepaUtil.java#L99-L111
OpenLiberty/open-liberty
dev/com.ibm.ws.security.authorization.jacc/src/com/ibm/ws/security/authorization/jacc/internal/JaccServiceImpl.java
JaccServiceImpl.checkDataConstraints
protected boolean checkDataConstraints(String applicationName, String moduleName, String uriName, String methodName, Object req, String transportType) { boolean result = false; WebSecurityValidator wsv = getWsv(servletServiceRef.getService()); if (wsv != null) { result = checkDataCon...
java
protected boolean checkDataConstraints(String applicationName, String moduleName, String uriName, String methodName, Object req, String transportType) { boolean result = false; WebSecurityValidator wsv = getWsv(servletServiceRef.getService()); if (wsv != null) { result = checkDataCon...
[ "protected", "boolean", "checkDataConstraints", "(", "String", "applicationName", ",", "String", "moduleName", ",", "String", "uriName", ",", "String", "methodName", ",", "Object", "req", ",", "String", "transportType", ")", "{", "boolean", "result", "=", "false",...
/* check DataConstraints true if permission is is implied. false otherwise.
[ "/", "*", "check", "DataConstraints", "true", "if", "permission", "is", "is", "implied", ".", "false", "otherwise", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authorization.jacc/src/com/ibm/ws/security/authorization/jacc/internal/JaccServiceImpl.java#L303-L312
guardtime/ksi-java-sdk
ksi-api/src/main/java/com/guardtime/ksi/KSIBuilder.java
KSIBuilder.setPublicationsFilePkiTrustStore
public KSIBuilder setPublicationsFilePkiTrustStore(File file, String password) throws KSIException { if (file == null) { throw new KSIException("Invalid input parameter. Trust store file is null"); } FileInputStream input = null; try { this.trustStore = KeyStore.g...
java
public KSIBuilder setPublicationsFilePkiTrustStore(File file, String password) throws KSIException { if (file == null) { throw new KSIException("Invalid input parameter. Trust store file is null"); } FileInputStream input = null; try { this.trustStore = KeyStore.g...
[ "public", "KSIBuilder", "setPublicationsFilePkiTrustStore", "(", "File", "file", ",", "String", "password", ")", "throws", "KSIException", "{", "if", "(", "file", "==", "null", ")", "{", "throw", "new", "KSIException", "(", "\"Invalid input parameter. Trust store file...
Loads the {@link KeyStore} from the file system and sets the {@link KeyStore} to be used as a truststore to verify the certificate that was used to sign the publications file. @param file keystore file on disk, not null. @param password password of the keystore, null if keystore isn't protected by password. @return In...
[ "Loads", "the", "{", "@link", "KeyStore", "}", "from", "the", "file", "system", "and", "sets", "the", "{", "@link", "KeyStore", "}", "to", "be", "used", "as", "a", "truststore", "to", "verify", "the", "certificate", "that", "was", "used", "to", "sign", ...
train
https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-api/src/main/java/com/guardtime/ksi/KSIBuilder.java#L191-L207
apache/groovy
src/main/java/org/apache/groovy/util/SystemUtil.java
SystemUtil.getIntegerSafe
public static Integer getIntegerSafe(String name, Integer def) { try { return Integer.getInteger(name, def); } catch (SecurityException ignore) { // suppress exception } return def; }
java
public static Integer getIntegerSafe(String name, Integer def) { try { return Integer.getInteger(name, def); } catch (SecurityException ignore) { // suppress exception } return def; }
[ "public", "static", "Integer", "getIntegerSafe", "(", "String", "name", ",", "Integer", "def", ")", "{", "try", "{", "return", "Integer", ".", "getInteger", "(", "name", ",", "def", ")", ";", "}", "catch", "(", "SecurityException", "ignore", ")", "{", "/...
Retrieves an Integer System property @param name the name of the system property. @param def the default value @return value of the Integer system property or false
[ "Retrieves", "an", "Integer", "System", "property" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/apache/groovy/util/SystemUtil.java#L130-L138
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java
base_resource.unset_resource
protected base_response unset_resource(nitro_service service, String args[]) throws Exception { if (!service.isLogin() && !get_object_type().equals("login")) service.login(); options option = new options(); option.set_action("unset"); base_response response = unset_request(service, option, args); return...
java
protected base_response unset_resource(nitro_service service, String args[]) throws Exception { if (!service.isLogin() && !get_object_type().equals("login")) service.login(); options option = new options(); option.set_action("unset"); base_response response = unset_request(service, option, args); return...
[ "protected", "base_response", "unset_resource", "(", "nitro_service", "service", ",", "String", "args", "[", "]", ")", "throws", "Exception", "{", "if", "(", "!", "service", ".", "isLogin", "(", ")", "&&", "!", "get_object_type", "(", ")", ".", "equals", "...
Use this method to perform an Unset operation on netscaler resource. @param service nitro_service object. @param args Array of args that are to be unset. @return status of the operation performed. @throws Exception Nitro exception is thrown.
[ "Use", "this", "method", "to", "perform", "an", "Unset", "operation", "on", "netscaler", "resource", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/base/base_resource.java#L477-L486
revelc/formatter-maven-plugin
src/main/java/net/revelc/code/formatter/FormatterMojo.java
FormatterMojo.getOptionsFromPropertiesFile
private Map<String, String> getOptionsFromPropertiesFile(String newPropertiesFile) throws MojoExecutionException { this.getLog().debug("Using search path at: " + this.basedir.getAbsolutePath()); this.resourceManager.addSearchPath(FileResourceLoader.ID, this.basedir.getAbsolutePath()); Properti...
java
private Map<String, String> getOptionsFromPropertiesFile(String newPropertiesFile) throws MojoExecutionException { this.getLog().debug("Using search path at: " + this.basedir.getAbsolutePath()); this.resourceManager.addSearchPath(FileResourceLoader.ID, this.basedir.getAbsolutePath()); Properti...
[ "private", "Map", "<", "String", ",", "String", ">", "getOptionsFromPropertiesFile", "(", "String", "newPropertiesFile", ")", "throws", "MojoExecutionException", "{", "this", ".", "getLog", "(", ")", ".", "debug", "(", "\"Using search path at: \"", "+", "this", "....
Read properties file and return the properties as {@link Map}. @return the options from properties file or null if not properties file found @throws MojoExecutionException the mojo execution exception
[ "Read", "properties", "file", "and", "return", "the", "properties", "as", "{", "@link", "Map", "}", "." ]
train
https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/FormatterMojo.java#L723-L743
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.getAsync
public <T> CompletableFuture<T> getAsync(final Class<T> type, final Consumer<HttpConfig> configuration) { return CompletableFuture.supplyAsync(() -> get(type, configuration), getExecutor()); }
java
public <T> CompletableFuture<T> getAsync(final Class<T> type, final Consumer<HttpConfig> configuration) { return CompletableFuture.supplyAsync(() -> get(type, configuration), getExecutor()); }
[ "public", "<", "T", ">", "CompletableFuture", "<", "T", ">", "getAsync", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Consumer", "<", "HttpConfig", ">", "configuration", ")", "{", "return", "CompletableFuture", ".", "supplyAsync", "(", "(",...
Executes asynchronous GET request on the configured URI (alias for the `get(Class, Consumer)` method), with additional configuration provided by the configuration function. The result will be cast to the specified `type`. This method is generally meant for use with standard Java. [source,groovy] ---- HttpBuilder http...
[ "Executes", "asynchronous", "GET", "request", "on", "the", "configured", "URI", "(", "alias", "for", "the", "get", "(", "Class", "Consumer", ")", "method", ")", "with", "additional", "configuration", "provided", "by", "the", "configuration", "function", ".", "...
train
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L489-L491
windup/windup
rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/service/JmsDestinationService.java
JmsDestinationService.getTypeFromClass
public static JmsDestinationType getTypeFromClass(String aClass) { if (StringUtils.equals(aClass, "javax.jms.Queue") || StringUtils.equals(aClass, "javax.jms.QueueConnectionFactory")) { return JmsDestinationType.QUEUE; } else if (StringUtils.equals(aClass, "javax.jms.Topi...
java
public static JmsDestinationType getTypeFromClass(String aClass) { if (StringUtils.equals(aClass, "javax.jms.Queue") || StringUtils.equals(aClass, "javax.jms.QueueConnectionFactory")) { return JmsDestinationType.QUEUE; } else if (StringUtils.equals(aClass, "javax.jms.Topi...
[ "public", "static", "JmsDestinationType", "getTypeFromClass", "(", "String", "aClass", ")", "{", "if", "(", "StringUtils", ".", "equals", "(", "aClass", ",", "\"javax.jms.Queue\"", ")", "||", "StringUtils", ".", "equals", "(", "aClass", ",", "\"javax.jms.QueueConn...
Gets JmsDestinationType from java class name Returns null for unrecognized class
[ "Gets", "JmsDestinationType", "from", "java", "class", "name" ]
train
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/service/JmsDestinationService.java#L75-L89
transloadit/java-sdk
src/main/java/com/transloadit/sdk/Transloadit.java
Transloadit.deleteTemplate
public Response deleteTemplate(String id) throws RequestException, LocalOperationException { Request request = new Request(this); return new Response(request.delete("/templates/" + id, new HashMap<String, Object>())); }
java
public Response deleteTemplate(String id) throws RequestException, LocalOperationException { Request request = new Request(this); return new Response(request.delete("/templates/" + id, new HashMap<String, Object>())); }
[ "public", "Response", "deleteTemplate", "(", "String", "id", ")", "throws", "RequestException", ",", "LocalOperationException", "{", "Request", "request", "=", "new", "Request", "(", "this", ")", ";", "return", "new", "Response", "(", "request", ".", "delete", ...
Deletes a template. @param id id of the template to delete. @return {@link Response} @throws RequestException if request to transloadit server fails. @throws LocalOperationException if something goes wrong while running non-http operations.
[ "Deletes", "a", "template", "." ]
train
https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Transloadit.java#L225-L229
reactor/reactor-netty
src/main/java/reactor/netty/tcp/ProxyProvider.java
ProxyProvider.newProxyHandler
public final ProxyHandler newProxyHandler() { InetSocketAddress proxyAddr = this.address.get(); String username = this.username; String password = Objects.nonNull(username) && Objects.nonNull(this.password) ? this.password.apply(username) : null; switch (this.type) { case HTTP: return Objects.nonNul...
java
public final ProxyHandler newProxyHandler() { InetSocketAddress proxyAddr = this.address.get(); String username = this.username; String password = Objects.nonNull(username) && Objects.nonNull(this.password) ? this.password.apply(username) : null; switch (this.type) { case HTTP: return Objects.nonNul...
[ "public", "final", "ProxyHandler", "newProxyHandler", "(", ")", "{", "InetSocketAddress", "proxyAddr", "=", "this", ".", "address", ".", "get", "(", ")", ";", "String", "username", "=", "this", ".", "username", ";", "String", "password", "=", "Objects", ".",...
Return a new eventual {@link ProxyHandler} @return a new eventual {@link ProxyHandler}
[ "Return", "a", "new", "eventual", "{", "@link", "ProxyHandler", "}" ]
train
https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/tcp/ProxyProvider.java#L145-L165
UrielCh/ovh-java-sdk
ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java
ApiOvhSms.serviceName_senders_sender_PUT
public void serviceName_senders_sender_PUT(String serviceName, String sender, OvhSender body) throws IOException { String qPath = "/sms/{serviceName}/senders/{sender}"; StringBuilder sb = path(qPath, serviceName, sender); exec(qPath, "PUT", sb.toString(), body); }
java
public void serviceName_senders_sender_PUT(String serviceName, String sender, OvhSender body) throws IOException { String qPath = "/sms/{serviceName}/senders/{sender}"; StringBuilder sb = path(qPath, serviceName, sender); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "serviceName_senders_sender_PUT", "(", "String", "serviceName", ",", "String", "sender", ",", "OvhSender", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/sms/{serviceName}/senders/{sender}\"", ";", "StringBuilder", "sb", "=", ...
Alter this object properties REST: PUT /sms/{serviceName}/senders/{sender} @param body [required] New object properties @param serviceName [required] The internal name of your SMS offer @param sender [required] The sms sender
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L197-L201
GerdHolz/TOVAL
src/de/invation/code/toval/misc/FormatUtils.java
FormatUtils.getIndexedFormat
public static String getIndexedFormat(int index, String format) { if (index < 1) throw new IllegalArgumentException(); if (format == null) throw new NullPointerException(); if (format.length() == 0) throw new IllegalArgumentException(); return String.format(INDEXED_FORMAT, index, format); }
java
public static String getIndexedFormat(int index, String format) { if (index < 1) throw new IllegalArgumentException(); if (format == null) throw new NullPointerException(); if (format.length() == 0) throw new IllegalArgumentException(); return String.format(INDEXED_FORMAT, index, format); }
[ "public", "static", "String", "getIndexedFormat", "(", "int", "index", ",", "String", "format", ")", "{", "if", "(", "index", "<", "1", ")", "throw", "new", "IllegalArgumentException", "(", ")", ";", "if", "(", "format", "==", "null", ")", "throw", "new"...
Returns an indexed format by placing the specified index before the given format. @param index Desired index for the given format @param format Format to be indexed @return The format <code>format</code> indexed with <code>index</code>
[ "Returns", "an", "indexed", "format", "by", "placing", "the", "specified", "index", "before", "the", "given", "format", "." ]
train
https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/FormatUtils.java#L184-L192
phax/ph-schedule
ph-schedule/src/main/java/com/helger/schedule/quartz/trigger/JDK8TriggerBuilder.java
JDK8TriggerBuilder.withIdentity
@Nonnull public JDK8TriggerBuilder <T> withIdentity (final String name, final String group) { m_aTriggerKey = new TriggerKey (name, group); return this; }
java
@Nonnull public JDK8TriggerBuilder <T> withIdentity (final String name, final String group) { m_aTriggerKey = new TriggerKey (name, group); return this; }
[ "@", "Nonnull", "public", "JDK8TriggerBuilder", "<", "T", ">", "withIdentity", "(", "final", "String", "name", ",", "final", "String", "group", ")", "{", "m_aTriggerKey", "=", "new", "TriggerKey", "(", "name", ",", "group", ")", ";", "return", "this", ";",...
Use a TriggerKey with the given name and group to identify the Trigger. <p> If none of the 'withIdentity' methods are set on the JDK8TriggerBuilder, then a random, unique TriggerKey will be generated. </p> @param name the name element for the Trigger's TriggerKey @param group the group element for the Trigger's Trigge...
[ "Use", "a", "TriggerKey", "with", "the", "given", "name", "and", "group", "to", "identify", "the", "Trigger", ".", "<p", ">", "If", "none", "of", "the", "withIdentity", "methods", "are", "set", "on", "the", "JDK8TriggerBuilder", "then", "a", "random", "uni...
train
https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-schedule/src/main/java/com/helger/schedule/quartz/trigger/JDK8TriggerBuilder.java#L165-L170
apache/groovy
subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java
NioGroovyMethods.renameTo
public static boolean renameTo(final Path self, URI newPathName) { try { Files.move(self, Paths.get(newPathName)); return true; } catch (IOException e) { return false; } }
java
public static boolean renameTo(final Path self, URI newPathName) { try { Files.move(self, Paths.get(newPathName)); return true; } catch (IOException e) { return false; } }
[ "public", "static", "boolean", "renameTo", "(", "final", "Path", "self", ",", "URI", "newPathName", ")", "{", "try", "{", "Files", ".", "move", "(", "self", ",", "Paths", ".", "get", "(", "newPathName", ")", ")", ";", "return", "true", ";", "}", "cat...
Renames a file. @param self a Path @param newPathName The new target path specified as a URI object @return <code>true</code> if and only if the renaming succeeded; <code>false</code> otherwise @since 2.3.0
[ "Renames", "a", "file", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L1341-L1348
JOML-CI/JOML
src/org/joml/Matrix3f.java
Matrix3f.rotateTowards
public Matrix3f rotateTowards(Vector3fc direction, Vector3fc up, Matrix3f dest) { return rotateTowards(direction.x(), direction.y(), direction.z(), up.x(), up.y(), up.z(), dest); }
java
public Matrix3f rotateTowards(Vector3fc direction, Vector3fc up, Matrix3f dest) { return rotateTowards(direction.x(), direction.y(), direction.z(), up.x(), up.y(), up.z(), dest); }
[ "public", "Matrix3f", "rotateTowards", "(", "Vector3fc", "direction", ",", "Vector3fc", "up", ",", "Matrix3f", "dest", ")", "{", "return", "rotateTowards", "(", "direction", ".", "x", "(", ")", ",", "direction", ".", "y", "(", ")", ",", "direction", ".", ...
Apply a model transformation to this matrix for a right-handed coordinate system, that aligns the local <code>+Z</code> axis with <code>direction</code> and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookat matrix, then the new matrix will be <code>M ...
[ "Apply", "a", "model", "transformation", "to", "this", "matrix", "for", "a", "right", "-", "handed", "coordinate", "system", "that", "aligns", "the", "local", "<code", ">", "+", "Z<", "/", "code", ">", "axis", "with", "<code", ">", "direction<", "/", "co...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3f.java#L3860-L3862
gini/dropwizard-gelf
src/main/java/net/gini/dropwizard/gelf/filters/GelfLoggingFilter.java
GelfLoggingFilter.doFilter
@Override public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { // It's quite safe to assume that we only receive HTTP requests final HttpServletRequest httpRequest = (HttpServletRequest) request...
java
@Override public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { // It's quite safe to assume that we only receive HTTP requests final HttpServletRequest httpRequest = (HttpServletRequest) request...
[ "@", "Override", "public", "void", "doFilter", "(", "final", "ServletRequest", "request", ",", "final", "ServletResponse", "response", ",", "final", "FilterChain", "chain", ")", "throws", "IOException", ",", "ServletException", "{", "// It's quite safe to assume that we...
The <code>doFilter</code> method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain. The FilterChain passed in to this method allows the Filter to pass on the request and response to the next entity in the...
[ "The", "<code", ">", "doFilter<", "/", "code", ">", "method", "of", "the", "Filter", "is", "called", "by", "the", "container", "each", "time", "a", "request", "/", "response", "pair", "is", "passed", "through", "the", "chain", "due", "to", "a", "client",...
train
https://github.com/gini/dropwizard-gelf/blob/0182f61b3ebdf417f174f6860d6a813c10853d31/src/main/java/net/gini/dropwizard/gelf/filters/GelfLoggingFilter.java#L83-L129
wnameless/rubycollect4j
src/main/java/net/sf/rubycollect4j/RubyObject.java
RubyObject.send
public static <E> E send(Object o, String methodName, Double arg) { return send(o, methodName, (Object) arg); }
java
public static <E> E send(Object o, String methodName, Double arg) { return send(o, methodName, (Object) arg); }
[ "public", "static", "<", "E", ">", "E", "send", "(", "Object", "o", ",", "String", "methodName", ",", "Double", "arg", ")", "{", "return", "send", "(", "o", ",", "methodName", ",", "(", "Object", ")", "arg", ")", ";", "}" ]
Executes a method of any Object by Java reflection. @param o an Object @param methodName name of the method @param arg a Double @return the result of the method called
[ "Executes", "a", "method", "of", "any", "Object", "by", "Java", "reflection", "." ]
train
https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/RubyObject.java#L291-L293
landawn/AbacusUtil
src/com/landawn/abacus/util/N.java
N.split
public static List<String> split(final CharSequence str, final int size) { if (size < 1) { throw new IllegalArgumentException("The parameter 'size' can not be zero or less than zero"); } if (N.isNullOrEmpty(str)) { return new ArrayList<>(); } re...
java
public static List<String> split(final CharSequence str, final int size) { if (size < 1) { throw new IllegalArgumentException("The parameter 'size' can not be zero or less than zero"); } if (N.isNullOrEmpty(str)) { return new ArrayList<>(); } re...
[ "public", "static", "List", "<", "String", ">", "split", "(", "final", "CharSequence", "str", ",", "final", "int", "size", ")", "{", "if", "(", "size", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The parameter 'size' can not be zero...
Returns consecutive substring of the specified string, each of the same length (the final list may be smaller), or an empty array if the specified string is null or empty. @param str @param size @return
[ "Returns", "consecutive", "substring", "of", "the", "specified", "string", "each", "of", "the", "same", "length", "(", "the", "final", "list", "may", "be", "smaller", ")", "or", "an", "empty", "array", "if", "the", "specified", "string", "is", "null", "or"...
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L18738-L18748
apereo/cas
support/cas-server-support-throttle-core/src/main/java/org/apereo/cas/web/support/AbstractThrottledSubmissionHandlerInterceptorAdapter.java
AbstractThrottledSubmissionHandlerInterceptorAdapter.throttleRequest
protected boolean throttleRequest(final HttpServletRequest request, final HttpServletResponse response) { return configurationContext.getThrottledRequestExecutor() != null && configurationContext.getThrottledRequestExecutor().throttle(request, response); }
java
protected boolean throttleRequest(final HttpServletRequest request, final HttpServletResponse response) { return configurationContext.getThrottledRequestExecutor() != null && configurationContext.getThrottledRequestExecutor().throttle(request, response); }
[ "protected", "boolean", "throttleRequest", "(", "final", "HttpServletRequest", "request", ",", "final", "HttpServletResponse", "response", ")", "{", "return", "configurationContext", ".", "getThrottledRequestExecutor", "(", ")", "!=", "null", "&&", "configurationContext",...
Is request throttled. @param request the request @param response the response @return true if the request is throttled. False otherwise, letting it proceed.
[ "Is", "request", "throttled", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-throttle-core/src/main/java/org/apereo/cas/web/support/AbstractThrottledSubmissionHandlerInterceptorAdapter.java#L86-L89
dlew/joda-time-android
library/src/main/java/net/danlew/android/joda/DateUtils.java
DateUtils.getRelativeTimeSpanString
public static CharSequence getRelativeTimeSpanString(Context ctx, ReadablePartial time, boolean withPreposition) { return getRelativeTimeSpanString(ctx, time.toDateTime(DateTime.now()), withPreposition); }
java
public static CharSequence getRelativeTimeSpanString(Context ctx, ReadablePartial time, boolean withPreposition) { return getRelativeTimeSpanString(ctx, time.toDateTime(DateTime.now()), withPreposition); }
[ "public", "static", "CharSequence", "getRelativeTimeSpanString", "(", "Context", "ctx", ",", "ReadablePartial", "time", ",", "boolean", "withPreposition", ")", "{", "return", "getRelativeTimeSpanString", "(", "ctx", ",", "time", ".", "toDateTime", "(", "DateTime", "...
Returns a relative time string to display the time expressed by millis. Missing fields from 'time' are filled in with values from the current time. See {@link android.text.format.DateUtils#getRelativeTimeSpanString} for full docs. @param withPreposition If true, the string returned will include the correct prepositi...
[ "Returns", "a", "relative", "time", "string", "to", "display", "the", "time", "expressed", "by", "millis", "." ]
train
https://github.com/dlew/joda-time-android/blob/5bf96f6ef4ea63ee91e73e1e528896fa00108dec/library/src/main/java/net/danlew/android/joda/DateUtils.java#L351-L353
rythmengine/rythmengine
src/main/java/org/rythmengine/template/TemplateBase.java
TemplateBase.__render
protected RawData __render(String template, Object... args) { if (null == template) return new RawData(""); return S.raw(__engine.sandbox().render(template, args)); }
java
protected RawData __render(String template, Object... args) { if (null == template) return new RawData(""); return S.raw(__engine.sandbox().render(template, args)); }
[ "protected", "RawData", "__render", "(", "String", "template", ",", "Object", "...", "args", ")", "{", "if", "(", "null", "==", "template", ")", "return", "new", "RawData", "(", "\"\"", ")", ";", "return", "S", ".", "raw", "(", "__engine", ".", "sandbo...
Render another template from this template. Could be used in template authoring. For example: <p/> <pre><code> {@literal @}args String customTemplate, Map<String, Object> customParams {@literal @}{ Object renderResult = render(customTemplate, customParams); } <p class="customer_content">@renderResult</p> </code></pre> ...
[ "Render", "another", "template", "from", "this", "template", ".", "Could", "be", "used", "in", "template", "authoring", ".", "For", "example", ":", "<p", "/", ">", "<pre", ">", "<code", ">", "{", "@literal", "@", "}", "args", "String", "customTemplate", ...
train
https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L280-L283
geomajas/geomajas-project-geometry
core/src/main/java/org/geomajas/geometry/service/BboxService.java
BboxService.getCenterPoint
public static Coordinate getCenterPoint(Bbox bbox) { double centerX = (bbox.getWidth() == 0 ? bbox.getX() : bbox.getX() + bbox.getWidth() / 2); double centerY = (bbox.getHeight() == 0 ? bbox.getY() : bbox.getY() + bbox.getHeight() / 2); return new Coordinate(centerX, centerY); }
java
public static Coordinate getCenterPoint(Bbox bbox) { double centerX = (bbox.getWidth() == 0 ? bbox.getX() : bbox.getX() + bbox.getWidth() / 2); double centerY = (bbox.getHeight() == 0 ? bbox.getY() : bbox.getY() + bbox.getHeight() / 2); return new Coordinate(centerX, centerY); }
[ "public", "static", "Coordinate", "getCenterPoint", "(", "Bbox", "bbox", ")", "{", "double", "centerX", "=", "(", "bbox", ".", "getWidth", "(", ")", "==", "0", "?", "bbox", ".", "getX", "(", ")", ":", "bbox", ".", "getX", "(", ")", "+", "bbox", "."...
Get the center of the bounding box as a Coordinate. @param bbox The bounding box to get the center point for. @return The center of the given bounding box as a new coordinate.
[ "Get", "the", "center", "of", "the", "bounding", "box", "as", "a", "Coordinate", "." ]
train
https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/BboxService.java#L65-L69
jfinal/jfinal
src/main/java/com/jfinal/plugin/redis/Cache.java
Cache.lindex
@SuppressWarnings("unchecked") /** * 返回列表 key 中,下标为 index 的元素。 * 下标(index)参数 start 和 stop 都以 0 为底,也就是说,以 0 表示列表的第一个元素, * 以 1 表示列表的第二个元素,以此类推。 * 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。 * 如果 key 不是列表类型,返回一个错误。 */ public <T> T lindex(Object key, long index) { Jedis jedis = getJedis()...
java
@SuppressWarnings("unchecked") /** * 返回列表 key 中,下标为 index 的元素。 * 下标(index)参数 start 和 stop 都以 0 为底,也就是说,以 0 表示列表的第一个元素, * 以 1 表示列表的第二个元素,以此类推。 * 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。 * 如果 key 不是列表类型,返回一个错误。 */ public <T> T lindex(Object key, long index) { Jedis jedis = getJedis()...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "/**\r\n\t * 返回列表 key 中,下标为 index 的元素。\r\n\t * 下标(index)参数 start 和 stop 都以 0 为底,也就是说,以 0 表示列表的第一个元素,\r\n\t * 以 1 表示列表的第二个元素,以此类推。\r\n\t * 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。\r\n\t * 如果 key 不是列表类型,返回一个错误。\r\n\t */", "public", "<", "T"...
返回列表 key 中,下标为 index 的元素。 下标(index)参数 start 和 stop 都以 0 为底,也就是说,以 0 表示列表的第一个元素,以 1 表示列表的第二个元素,以此类推。 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。 如果 key 不是列表类型,返回一个错误。
[ "返回列表", "key", "中,下标为", "index", "的元素。", "下标", "(", "index", ")", "参数", "start", "和", "stop", "都以", "0", "为底,也就是说,以", "0", "表示列表的第一个元素,以", "1", "表示列表的第二个元素,以此类推。", "你也可以使用负数下标,以", "-", "1", "表示列表的最后一个元素,", "-", "2", "表示列表的倒数第二个元素,以此类推。", "如果", "key", "不是列表类型...
train
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L611-L626
mboudreau/Alternator
src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java
AmazonDynamoDBClient.setEndpoint
public void setEndpoint(String endpoint, String serviceName, String regionId) throws IllegalArgumentException { setEndpoint(endpoint); signer.setServiceName(serviceName); signer.setRegionName(regionId); }
java
public void setEndpoint(String endpoint, String serviceName, String regionId) throws IllegalArgumentException { setEndpoint(endpoint); signer.setServiceName(serviceName); signer.setRegionName(regionId); }
[ "public", "void", "setEndpoint", "(", "String", "endpoint", ",", "String", "serviceName", ",", "String", "regionId", ")", "throws", "IllegalArgumentException", "{", "setEndpoint", "(", "endpoint", ")", ";", "signer", ".", "setServiceName", "(", "serviceName", ")",...
Overrides the default endpoint for this client ("http://dynamodb.us-east-1.amazonaws.com/") and explicitly provides an AWS region ID and AWS service name to use when the client calculates a signature for requests. In almost all cases, this region ID and service name are automatically determined from the endpoint, and ...
[ "Overrides", "the", "default", "endpoint", "for", "this", "client", "(", "http", ":", "//", "dynamodb", ".", "us", "-", "east", "-", "1", ".", "amazonaws", ".", "com", "/", ")", "and", "explicitly", "provides", "an", "AWS", "region", "ID", "and", "AWS"...
train
https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/AmazonDynamoDBClient.java#L981-L985
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/Color.java
Color.addToCopy
public Color addToCopy(Color c) { Color copy = new Color(r,g,b,a); copy.r += c.r; copy.g += c.g; copy.b += c.b; copy.a += c.a; return copy; }
java
public Color addToCopy(Color c) { Color copy = new Color(r,g,b,a); copy.r += c.r; copy.g += c.g; copy.b += c.b; copy.a += c.a; return copy; }
[ "public", "Color", "addToCopy", "(", "Color", "c", ")", "{", "Color", "copy", "=", "new", "Color", "(", "r", ",", "g", ",", "b", ",", "a", ")", ";", "copy", ".", "r", "+=", "c", ".", "r", ";", "copy", ".", "g", "+=", "c", ".", "g", ";", "...
Add another colour to this one @param c The colour to add @return The copy which has had the color added to it
[ "Add", "another", "colour", "to", "this", "one" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Color.java#L367-L375
apereo/cas
support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java
AbstractServiceValidateController.validateServiceTicket
protected Assertion validateServiceTicket(final WebApplicationService service, final String serviceTicketId) { return serviceValidateConfigurationContext.getCentralAuthenticationService().validateServiceTicket(serviceTicketId, service); }
java
protected Assertion validateServiceTicket(final WebApplicationService service, final String serviceTicketId) { return serviceValidateConfigurationContext.getCentralAuthenticationService().validateServiceTicket(serviceTicketId, service); }
[ "protected", "Assertion", "validateServiceTicket", "(", "final", "WebApplicationService", "service", ",", "final", "String", "serviceTicketId", ")", "{", "return", "serviceValidateConfigurationContext", ".", "getCentralAuthenticationService", "(", ")", ".", "validateServiceTi...
Validate service ticket assertion. @param service the service @param serviceTicketId the service ticket id @return the assertion
[ "Validate", "service", "ticket", "assertion", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java#L225-L227
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/Assert.java
Assert.notEmpty
public static void notEmpty(Map<?, ?> map, String message, Object... arguments) { notEmpty(map, new IllegalArgumentException(format(message, arguments))); }
java
public static void notEmpty(Map<?, ?> map, String message, Object... arguments) { notEmpty(map, new IllegalArgumentException(format(message, arguments))); }
[ "public", "static", "void", "notEmpty", "(", "Map", "<", "?", ",", "?", ">", "map", ",", "String", "message", ",", "Object", "...", "arguments", ")", "{", "notEmpty", "(", "map", ",", "new", "IllegalArgumentException", "(", "format", "(", "message", ",",...
Asserts that the {@link Map} is not empty. The assertion holds if and only if the {@link Map} is not {@literal null} and contains at least 1 key/value mapping. @param map {@link Map} to evaluate. @param message {@link String} containing the message using in the {@link IllegalArgumentException} thrown if the assertion...
[ "Asserts", "that", "the", "{", "@link", "Map", "}", "is", "not", "empty", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L1113-L1115
EasyinnovaSL/Tiff-Library-4J
src/main/java/com/easyinnova/tiff/profiles/TiffITProfile.java
TiffITProfile.validateIfdSD
private void validateIfdSD(IFD ifd, int p) { IfdTags metadata = ifd.getMetadata(); if (p == 2) { checkRequiredTag(metadata, "NewSubfileType", 1, new long[]{0}); } checkRequiredTag(metadata, "ImageLength", 1); checkRequiredTag(metadata, "ImageWidth", 1); checkRequiredTag(metadata, "BitsPer...
java
private void validateIfdSD(IFD ifd, int p) { IfdTags metadata = ifd.getMetadata(); if (p == 2) { checkRequiredTag(metadata, "NewSubfileType", 1, new long[]{0}); } checkRequiredTag(metadata, "ImageLength", 1); checkRequiredTag(metadata, "ImageWidth", 1); checkRequiredTag(metadata, "BitsPer...
[ "private", "void", "validateIfdSD", "(", "IFD", "ifd", ",", "int", "p", ")", "{", "IfdTags", "metadata", "=", "ifd", ".", "getMetadata", "(", ")", ";", "if", "(", "p", "==", "2", ")", "{", "checkRequiredTag", "(", "metadata", ",", "\"NewSubfileType\"", ...
Validate Screened Data image. @param ifd the ifd @param p the profile (default = 0, P2 = 2)
[ "Validate", "Screened", "Data", "image", "." ]
train
https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/TiffITProfile.java#L551-L581
line/armeria
core/src/main/java/com/linecorp/armeria/server/AbstractHttpService.java
AbstractHttpService.doDelete
protected HttpResponse doDelete(ServiceRequestContext ctx, HttpRequest req) throws Exception { final HttpResponseWriter res = HttpResponse.streaming(); doDelete(ctx, req, res); return res; }
java
protected HttpResponse doDelete(ServiceRequestContext ctx, HttpRequest req) throws Exception { final HttpResponseWriter res = HttpResponse.streaming(); doDelete(ctx, req, res); return res; }
[ "protected", "HttpResponse", "doDelete", "(", "ServiceRequestContext", "ctx", ",", "HttpRequest", "req", ")", "throws", "Exception", "{", "final", "HttpResponseWriter", "res", "=", "HttpResponse", ".", "streaming", "(", ")", ";", "doDelete", "(", "ctx", ",", "re...
Handles a {@link HttpMethod#DELETE DELETE} request. This method sends a {@link HttpStatus#METHOD_NOT_ALLOWED 405 Method Not Allowed} response by default.
[ "Handles", "a", "{" ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/AbstractHttpService.java#L238-L242
b3log/latke
latke-core/src/main/java/org/b3log/latke/util/Templates.java
Templates.hasExpression
public static boolean hasExpression(final Template template, final String expression) { final TemplateElement rootTreeNode = template.getRootTreeNode(); return hasExpression(template, expression, rootTreeNode); }
java
public static boolean hasExpression(final Template template, final String expression) { final TemplateElement rootTreeNode = template.getRootTreeNode(); return hasExpression(template, expression, rootTreeNode); }
[ "public", "static", "boolean", "hasExpression", "(", "final", "Template", "template", ",", "final", "String", "expression", ")", "{", "final", "TemplateElement", "rootTreeNode", "=", "template", ".", "getRootTreeNode", "(", ")", ";", "return", "hasExpression", "("...
Determines whether exists a variable specified by the given expression in the specified template. @param template the specified template @param expression the given expression, for example, "${aVariable}", "&lt;#list recentComments as comment&gt;" @return {@code true} if it exists, returns {@code false} otherwise
[ "Determines", "whether", "exists", "a", "variable", "specified", "by", "the", "given", "expression", "in", "the", "specified", "template", "." ]
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/util/Templates.java#L53-L57
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGraph.java
ManagementGraph.getGroupVerticesInTopologicalOrder
public List<ManagementGroupVertex> getGroupVerticesInTopologicalOrder() { final List<ManagementGroupVertex> topologicalSort = new ArrayList<ManagementGroupVertex>(); final Deque<ManagementGroupVertex> noIncomingEdges = new ArrayDeque<ManagementGroupVertex>(); final Map<ManagementGroupVertex, Integer> indegrees =...
java
public List<ManagementGroupVertex> getGroupVerticesInTopologicalOrder() { final List<ManagementGroupVertex> topologicalSort = new ArrayList<ManagementGroupVertex>(); final Deque<ManagementGroupVertex> noIncomingEdges = new ArrayDeque<ManagementGroupVertex>(); final Map<ManagementGroupVertex, Integer> indegrees =...
[ "public", "List", "<", "ManagementGroupVertex", ">", "getGroupVerticesInTopologicalOrder", "(", ")", "{", "final", "List", "<", "ManagementGroupVertex", ">", "topologicalSort", "=", "new", "ArrayList", "<", "ManagementGroupVertex", ">", "(", ")", ";", "final", "Dequ...
Returns a list of group vertices sorted in topological order. @return a list of group vertices sorted in topological order
[ "Returns", "a", "list", "of", "group", "vertices", "sorted", "in", "topological", "order", "." ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/managementgraph/ManagementGraph.java#L332-L365
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/OverlayItem.java
OverlayItem.getMarker
public Drawable getMarker(final int stateBitset) { // marker not specified if (mMarker == null) { return null; } // set marker state appropriately setState(mMarker, stateBitset); return mMarker; }
java
public Drawable getMarker(final int stateBitset) { // marker not specified if (mMarker == null) { return null; } // set marker state appropriately setState(mMarker, stateBitset); return mMarker; }
[ "public", "Drawable", "getMarker", "(", "final", "int", "stateBitset", ")", "{", "// marker not specified", "if", "(", "mMarker", "==", "null", ")", "{", "return", "null", ";", "}", "// set marker state appropriately", "setState", "(", "mMarker", ",", "stateBitset...
/* (copied from Google API docs) Returns the marker that should be used when drawing this item on the map. A null value means that the default marker should be drawn. Different markers can be returned for different states. The different markers can have different bounds. The default behavior is to call {@link setState(...
[ "/", "*", "(", "copied", "from", "Google", "API", "docs", ")", "Returns", "the", "marker", "that", "should", "be", "used", "when", "drawing", "this", "item", "on", "the", "map", ".", "A", "null", "value", "means", "that", "the", "default", "marker", "s...
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/OverlayItem.java#L104-L113
reactor/reactor-netty
src/main/java/reactor/netty/FutureMono.java
FutureMono.disposableWriteAndFlush
public static Mono<Void> disposableWriteAndFlush(Channel channel, Publisher<?> dataStream) { return new DeferredWriteMono(channel, dataStream); }
java
public static Mono<Void> disposableWriteAndFlush(Channel channel, Publisher<?> dataStream) { return new DeferredWriteMono(channel, dataStream); }
[ "public", "static", "Mono", "<", "Void", ">", "disposableWriteAndFlush", "(", "Channel", "channel", ",", "Publisher", "<", "?", ">", "dataStream", ")", "{", "return", "new", "DeferredWriteMono", "(", "channel", ",", "dataStream", ")", ";", "}" ]
Write the passed {@link Publisher} and return a disposable {@link Mono}. <p> In addition, current method allows interaction with downstream context, so it may be transferred to implicitly connected upstream <p> Example: <p> <pre><code> Flux&lt;String&gt; dataStream = Flux.just("a", "b", "c"); FutureMono.deferFutureWith...
[ "Write", "the", "passed", "{", "@link", "Publisher", "}", "and", "return", "a", "disposable", "{", "@link", "Mono", "}", ".", "<p", ">", "In", "addition", "current", "method", "allows", "interaction", "with", "downstream", "context", "so", "it", "may", "be...
train
https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/FutureMono.java#L100-L103
motown-io/motown
operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/TransactionEventListener.java
TransactionEventListener.addMeterValueToTransaction
private void addMeterValueToTransaction(final Transaction transaction, final MeterValue meterValue) { if (meterValue.getUnit() == UnitOfMeasure.WATT_HOUR || meterValue.getUnit() == UnitOfMeasure.KILOWATT_HOUR) { try { transaction.getMeterValues().add(toOperatorApiMeterValue(meterValu...
java
private void addMeterValueToTransaction(final Transaction transaction, final MeterValue meterValue) { if (meterValue.getUnit() == UnitOfMeasure.WATT_HOUR || meterValue.getUnit() == UnitOfMeasure.KILOWATT_HOUR) { try { transaction.getMeterValues().add(toOperatorApiMeterValue(meterValu...
[ "private", "void", "addMeterValueToTransaction", "(", "final", "Transaction", "transaction", ",", "final", "MeterValue", "meterValue", ")", "{", "if", "(", "meterValue", ".", "getUnit", "(", ")", "==", "UnitOfMeasure", ".", "WATT_HOUR", "||", "meterValue", ".", ...
Adds a single {@code MeterValue} to the {@code Transaction}. <p/> If a {@code MeterValue} cannot be added this method will skip adding it, won't throw an exception, and log that this occurred and why. @param transaction the {@code Transaction} to which to add the {@code MeterValue}. @param meterValue the {@code Meter...
[ "Adds", "a", "single", "{", "@code", "MeterValue", "}", "to", "the", "{", "@code", "Transaction", "}", ".", "<p", "/", ">", "If", "a", "{", "@code", "MeterValue", "}", "cannot", "be", "added", "this", "method", "will", "skip", "adding", "it", "won", ...
train
https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/TransactionEventListener.java#L102-L114
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/MeasureUnit.java
MeasureUnit.resolveUnitPerUnit
@Deprecated public static MeasureUnit resolveUnitPerUnit(MeasureUnit unit, MeasureUnit perUnit) { return unitPerUnitToSingleUnit.get(Pair.of(unit, perUnit)); }
java
@Deprecated public static MeasureUnit resolveUnitPerUnit(MeasureUnit unit, MeasureUnit perUnit) { return unitPerUnitToSingleUnit.get(Pair.of(unit, perUnit)); }
[ "@", "Deprecated", "public", "static", "MeasureUnit", "resolveUnitPerUnit", "(", "MeasureUnit", "unit", ",", "MeasureUnit", "perUnit", ")", "{", "return", "unitPerUnitToSingleUnit", ".", "get", "(", "Pair", ".", "of", "(", "unit", ",", "perUnit", ")", ")", ";"...
For ICU use only. @deprecated This API is ICU internal only. @hide original deprecated declaration @hide draft / provisional / internal are hidden on Android
[ "For", "ICU", "use", "only", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/MeasureUnit.java#L199-L202
Impetus/Kundera
src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java
ESFilterBuilder.populateLikeQuery
private QueryBuilder populateLikeQuery(LikeExpression likeExpression, EntityMetadata metadata) { Expression patternValue = likeExpression.getPatternValue(); String field = likeExpression.getStringExpression().toString(); String likePattern = (patternValue instanceof InputParameter) ? kunder...
java
private QueryBuilder populateLikeQuery(LikeExpression likeExpression, EntityMetadata metadata) { Expression patternValue = likeExpression.getPatternValue(); String field = likeExpression.getStringExpression().toString(); String likePattern = (patternValue instanceof InputParameter) ? kunder...
[ "private", "QueryBuilder", "populateLikeQuery", "(", "LikeExpression", "likeExpression", ",", "EntityMetadata", "metadata", ")", "{", "Expression", "patternValue", "=", "likeExpression", ".", "getPatternValue", "(", ")", ";", "String", "field", "=", "likeExpression", ...
Populate like query. @param likeExpression the like expression @param metadata the metadata @return the filter builder
[ "Populate", "like", "query", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L150-L164
meltmedia/cadmium
core/src/main/java/com/meltmedia/cadmium/core/meta/AlternateContentConfigProcessor.java
AlternateContentConfigProcessor.getAlternateContentDirectory
public File getAlternateContentDirectory(String userAgent) { Configuration config = liveConfig; for(AlternateContent configuration: config.configs) { try { if(configuration.compiledPattern.matcher(userAgent).matches()) { return new File(config.metaDir, configuration.getContentDirectory()...
java
public File getAlternateContentDirectory(String userAgent) { Configuration config = liveConfig; for(AlternateContent configuration: config.configs) { try { if(configuration.compiledPattern.matcher(userAgent).matches()) { return new File(config.metaDir, configuration.getContentDirectory()...
[ "public", "File", "getAlternateContentDirectory", "(", "String", "userAgent", ")", "{", "Configuration", "config", "=", "liveConfig", ";", "for", "(", "AlternateContent", "configuration", ":", "config", ".", "configs", ")", "{", "try", "{", "if", "(", "configura...
Iterates through AlternateContent objects trying to match against their pre compiled pattern. @param userAgent The userAgent request header. @return the ContentDirectory of the matched AlternateContent instance or null if none are found.
[ "Iterates", "through", "AlternateContent", "objects", "trying", "to", "match", "against", "their", "pre", "compiled", "pattern", "." ]
train
https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/meta/AlternateContentConfigProcessor.java#L75-L87
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/library/metric/directed/EdgeMetrics.java
EdgeMetrics.run
@Override public EdgeMetrics<K, VV, EV> run(Graph<K, VV, EV> input) throws Exception { super.run(input); // s, t, (d(s), d(t)) DataSet<Edge<K, Tuple3<EV, Degrees, Degrees>>> edgeDegreesPair = input .run(new EdgeDegreesPair<K, VV, EV>() .setParallelism(parallelism)); // s, d(s), count of (u, v) wher...
java
@Override public EdgeMetrics<K, VV, EV> run(Graph<K, VV, EV> input) throws Exception { super.run(input); // s, t, (d(s), d(t)) DataSet<Edge<K, Tuple3<EV, Degrees, Degrees>>> edgeDegreesPair = input .run(new EdgeDegreesPair<K, VV, EV>() .setParallelism(parallelism)); // s, d(s), count of (u, v) wher...
[ "@", "Override", "public", "EdgeMetrics", "<", "K", ",", "VV", ",", "EV", ">", "run", "(", "Graph", "<", "K", ",", "VV", ",", "EV", ">", "input", ")", "throws", "Exception", "{", "super", ".", "run", "(", "input", ")", ";", "// s, t, (d(s), d(t))", ...
/* Implementation notes: <p>Use aggregator to replace SumEdgeStats when aggregators are rewritten to use a hash-combineable hashable-reduce. <p>Use distinct to replace ReduceEdgeStats when the combiner can be disabled with a sorted-reduce forced.
[ "/", "*", "Implementation", "notes", ":" ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/library/metric/directed/EdgeMetrics.java#L83-L116
Javacord/Javacord
javacord-api/src/main/java/org/javacord/api/entity/webhook/WebhookUpdater.java
WebhookUpdater.setAvatar
public WebhookUpdater setAvatar(BufferedImage avatar, String fileType) { delegate.setAvatar(avatar, fileType); return this; }
java
public WebhookUpdater setAvatar(BufferedImage avatar, String fileType) { delegate.setAvatar(avatar, fileType); return this; }
[ "public", "WebhookUpdater", "setAvatar", "(", "BufferedImage", "avatar", ",", "String", "fileType", ")", "{", "delegate", ".", "setAvatar", "(", "avatar", ",", "fileType", ")", ";", "return", "this", ";", "}" ]
Queues the avatar to be updated. @param avatar The avatar to set. @param fileType The type of the avatar, e.g. "png" or "jpg". @return The current instance in order to chain call methods.
[ "Queues", "the", "avatar", "to", "be", "updated", "." ]
train
https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/webhook/WebhookUpdater.java#L85-L88
notnoop/java-apns
src/main/java/com/notnoop/apns/ApnsServiceBuilder.java
ApnsServiceBuilder.withAuthProxy
public ApnsServiceBuilder withAuthProxy(Proxy proxy, String proxyUsername, String proxyPassword) { this.proxy = proxy; this.proxyUsername = proxyUsername; this.proxyPassword = proxyPassword; return this; }
java
public ApnsServiceBuilder withAuthProxy(Proxy proxy, String proxyUsername, String proxyPassword) { this.proxy = proxy; this.proxyUsername = proxyUsername; this.proxyPassword = proxyPassword; return this; }
[ "public", "ApnsServiceBuilder", "withAuthProxy", "(", "Proxy", "proxy", ",", "String", "proxyUsername", ",", "String", "proxyPassword", ")", "{", "this", ".", "proxy", "=", "proxy", ";", "this", ".", "proxyUsername", "=", "proxyUsername", ";", "this", ".", "pr...
Specify the proxy and the authentication parameters to be used to establish the connections to Apple Servers. <p>Read the <a href="http://java.sun.com/javase/6/docs/technotes/guides/net/proxies.html"> Java Networking and Proxies</a> guide to understand the proxies complexity. @param proxy the proxy object to be used ...
[ "Specify", "the", "proxy", "and", "the", "authentication", "parameters", "to", "be", "used", "to", "establish", "the", "connections", "to", "Apple", "Servers", "." ]
train
https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/ApnsServiceBuilder.java#L488-L493
santhosh-tekuri/jlibs
core/src/main/java/jlibs/core/lang/Ansi.java
Ansi.outFormat
public void outFormat(String format, Object... args){ format(System.out, format, args); }
java
public void outFormat(String format, Object... args){ format(System.out, format, args); }
[ "public", "void", "outFormat", "(", "String", "format", ",", "Object", "...", "args", ")", "{", "format", "(", "System", ".", "out", ",", "format", ",", "args", ")", ";", "}" ]
Prints formatted and colorized {@code format} to {@link System#out} @param format A format string whose output to be colorized @param args Arguments referenced by the format specifiers in the format
[ "Prints", "formatted", "and", "colorized", "{", "@code", "format", "}", "to", "{", "@link", "System#out", "}" ]
train
https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/Ansi.java#L306-L308
AgNO3/jcifs-ng
src/main/java/jcifs/internal/smb1/AndXServerMessageBlock.java
AndXServerMessageBlock.encode
@Override public int encode ( byte[] dst, int dstIndex ) { int start = this.headerStart = dstIndex; dstIndex += writeHeaderWireFormat(dst, dstIndex); dstIndex += writeAndXWireFormat(dst, dstIndex); this.length = dstIndex - start; if ( this.digest != null ) { thi...
java
@Override public int encode ( byte[] dst, int dstIndex ) { int start = this.headerStart = dstIndex; dstIndex += writeHeaderWireFormat(dst, dstIndex); dstIndex += writeAndXWireFormat(dst, dstIndex); this.length = dstIndex - start; if ( this.digest != null ) { thi...
[ "@", "Override", "public", "int", "encode", "(", "byte", "[", "]", "dst", ",", "int", "dstIndex", ")", "{", "int", "start", "=", "this", ".", "headerStart", "=", "dstIndex", ";", "dstIndex", "+=", "writeHeaderWireFormat", "(", "dst", ",", "dstIndex", ")"...
/* We overload this method from ServerMessageBlock because we want writeAndXWireFormat to write the parameterWords and bytes. This is so we can write batched smbs because all but the first smb of the chaain do not have a header and therefore we do not want to writeHeaderWireFormat. We just recursivly call writeAndXWire...
[ "/", "*", "We", "overload", "this", "method", "from", "ServerMessageBlock", "because", "we", "want", "writeAndXWireFormat", "to", "write", "the", "parameterWords", "and", "bytes", ".", "This", "is", "so", "we", "can", "write", "batched", "smbs", "because", "al...
train
https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/internal/smb1/AndXServerMessageBlock.java#L135-L148
jwtk/jjwt
api/src/main/java/io/jsonwebtoken/lang/Assert.java
Assert.notEmpty
public static void notEmpty(Map map, String message) { if (Collections.isEmpty(map)) { throw new IllegalArgumentException(message); } }
java
public static void notEmpty(Map map, String message) { if (Collections.isEmpty(map)) { throw new IllegalArgumentException(message); } }
[ "public", "static", "void", "notEmpty", "(", "Map", "map", ",", "String", "message", ")", "{", "if", "(", "Collections", ".", "isEmpty", "(", "map", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "message", ")", ";", "}", "}" ]
Assert that a Map has entries; that is, it must not be <code>null</code> and must have at least one entry. <pre class="code">Assert.notEmpty(map, "Map must have entries");</pre> @param map the map to check @param message the exception message to use if the assertion fails @throws IllegalArgumentException if the map is ...
[ "Assert", "that", "a", "Map", "has", "entries", ";", "that", "is", "it", "must", "not", "be", "<code", ">", "null<", "/", "code", ">", "and", "must", "have", "at", "least", "one", "entry", ".", "<pre", "class", "=", "code", ">", "Assert", ".", "not...
train
https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/lang/Assert.java#L268-L272
cubedtear/aritzh
aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/ARGBColorUtil.java
ARGBColorUtil.composite
public static int composite(final int foreground, final int background) { double fA = getAlpha(foreground) / 255.0; double bA = getAlpha(background) / 255.0; if (bA <= 0.0001) return foreground; else if (fA <= 0.0001) return background; final double alphaA = bA * (1 - fA); return getColor( (int) (255...
java
public static int composite(final int foreground, final int background) { double fA = getAlpha(foreground) / 255.0; double bA = getAlpha(background) / 255.0; if (bA <= 0.0001) return foreground; else if (fA <= 0.0001) return background; final double alphaA = bA * (1 - fA); return getColor( (int) (255...
[ "public", "static", "int", "composite", "(", "final", "int", "foreground", ",", "final", "int", "background", ")", "{", "double", "fA", "=", "getAlpha", "(", "foreground", ")", "/", "255.0", ";", "double", "bA", "=", "getAlpha", "(", "background", ")", "...
Composes two colors with the ARGB format: <br> The format of the color integer is as follows: 0xAARRGGBB Where: <ol> <li>AA is the alpha component (0-255)</li> <li>RR is the red component (0-255)</li> <li>GG is the green component (0-255)</li> <li>BB is the blue component (0-255)</li> </ol> NOTE: The source of this met...
[ "Composes", "two", "colors", "with", "the", "ARGB", "format", ":", "<br", ">", "The", "format", "of", "the", "color", "integer", "is", "as", "follows", ":", "0xAARRGGBB", "Where", ":", "<ol", ">", "<li", ">", "AA", "is", "the", "alpha", "component", "(...
train
https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/ARGBColorUtil.java#L89-L103
icode/ameba
src/main/java/ameba/mvc/template/internal/AbstractTemplateProcessor.java
AbstractTemplateProcessor.setContentType
protected Charset setContentType(MediaType mediaType, MultivaluedMap<String, Object> httpHeaders) { String charset = mediaType.getParameters().get("charset"); Charset encoding; MediaType finalMediaType; if (charset == null) { encoding = this.getEncoding(); HashMap...
java
protected Charset setContentType(MediaType mediaType, MultivaluedMap<String, Object> httpHeaders) { String charset = mediaType.getParameters().get("charset"); Charset encoding; MediaType finalMediaType; if (charset == null) { encoding = this.getEncoding(); HashMap...
[ "protected", "Charset", "setContentType", "(", "MediaType", "mediaType", ",", "MultivaluedMap", "<", "String", ",", "Object", ">", "httpHeaders", ")", "{", "String", "charset", "=", "mediaType", ".", "getParameters", "(", ")", ".", "get", "(", "\"charset\"", "...
<p>setContentType.</p> @param mediaType a {@link javax.ws.rs.core.MediaType} object. @param httpHeaders a {@link javax.ws.rs.core.MultivaluedMap} object. @return a {@link java.nio.charset.Charset} object. @since 0.1.6e
[ "<p", ">", "setContentType", ".", "<", "/", "p", ">" ]
train
https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/mvc/template/internal/AbstractTemplateProcessor.java#L166-L188
alkacon/opencms-core
src/org/opencms/search/CmsSearch.java
CmsSearch.addFieldQueryMustNot
public void addFieldQueryMustNot(String fieldName, String searchQuery) { addFieldQuery(fieldName, searchQuery, BooleanClause.Occur.MUST_NOT); }
java
public void addFieldQueryMustNot(String fieldName, String searchQuery) { addFieldQuery(fieldName, searchQuery, BooleanClause.Occur.MUST_NOT); }
[ "public", "void", "addFieldQueryMustNot", "(", "String", "fieldName", ",", "String", "searchQuery", ")", "{", "addFieldQuery", "(", "fieldName", ",", "searchQuery", ",", "BooleanClause", ".", "Occur", ".", "MUST_NOT", ")", ";", "}" ]
Adds an individual query for a search field that MUST NOT occur.<p> If this is used, any setting made with {@link #setQuery(String)} and {@link #setField(String[])} will be ignored and only the individual field search settings will be used.<p> When combining occurrences of SHOULD, MUST and MUST_NOT, keep the followin...
[ "Adds", "an", "individual", "query", "for", "a", "search", "field", "that", "MUST", "NOT", "occur", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearch.java#L209-L212
codeprimate-software/cp-elements
src/main/java/org/cp/elements/util/Environment.java
Environment.getAs
public <T> T getAs(String environmentVariableName, Class<T> type, T defaultValue) { return environmentVariables().getAsType(environmentVariableName, type, defaultValue); }
java
public <T> T getAs(String environmentVariableName, Class<T> type, T defaultValue) { return environmentVariables().getAsType(environmentVariableName, type, defaultValue); }
[ "public", "<", "T", ">", "T", "getAs", "(", "String", "environmentVariableName", ",", "Class", "<", "T", ">", "type", ",", "T", "defaultValue", ")", "{", "return", "environmentVariables", "(", ")", ".", "getAsType", "(", "environmentVariableName", ",", "type...
Returns the value set for the environment variable identified by the given name as the given {@link Class} type. Returns the {@code defaultValue} if the named environment variable is not set. @param <T> {@link Class} type to convert the environment variable value to. @param environmentVariableName {@link String} name ...
[ "Returns", "the", "value", "set", "for", "the", "environment", "variable", "identified", "by", "the", "given", "name", "as", "the", "given", "{", "@link", "Class", "}", "type", ".", "Returns", "the", "{", "@code", "defaultValue", "}", "if", "the", "named",...
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/Environment.java#L263-L265
nmorel/gwt-jackson
gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/JsonSerializationContext.java
JsonSerializationContext.addObjectId
public void addObjectId( Object object, ObjectIdSerializer<?> id ) { if ( null == mapObjectId ) { if ( useEqualityForObjectId ) { mapObjectId = new HashMap<Object, ObjectIdSerializer<?>>(); } else { mapObjectId = new IdentityHashMap<Object, ObjectIdSeriali...
java
public void addObjectId( Object object, ObjectIdSerializer<?> id ) { if ( null == mapObjectId ) { if ( useEqualityForObjectId ) { mapObjectId = new HashMap<Object, ObjectIdSerializer<?>>(); } else { mapObjectId = new IdentityHashMap<Object, ObjectIdSeriali...
[ "public", "void", "addObjectId", "(", "Object", "object", ",", "ObjectIdSerializer", "<", "?", ">", "id", ")", "{", "if", "(", "null", "==", "mapObjectId", ")", "{", "if", "(", "useEqualityForObjectId", ")", "{", "mapObjectId", "=", "new", "HashMap", "<", ...
<p>addObjectId</p> @param object a {@link java.lang.Object} object. @param id a {@link com.github.nmorel.gwtjackson.client.ser.bean.ObjectIdSerializer} object.
[ "<p", ">", "addObjectId<", "/", "p", ">" ]
train
https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/JsonSerializationContext.java#L574-L583
alkacon/opencms-core
src-modules/org/opencms/workplace/help/CmsHelpTemplateBean.java
CmsHelpTemplateBean.buildHtmlHelpStart
public String buildHtmlHelpStart(String cssFile, boolean transitional) { StringBuffer result = new StringBuffer(8); if (transitional) { result.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"); } else { result.append("<!DOCTYPE HTML PUBLIC \"-...
java
public String buildHtmlHelpStart(String cssFile, boolean transitional) { StringBuffer result = new StringBuffer(8); if (transitional) { result.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"); } else { result.append("<!DOCTYPE HTML PUBLIC \"-...
[ "public", "String", "buildHtmlHelpStart", "(", "String", "cssFile", ",", "boolean", "transitional", ")", "{", "StringBuffer", "result", "=", "new", "StringBuffer", "(", "8", ")", ";", "if", "(", "transitional", ")", "{", "result", ".", "append", "(", "\"<!DO...
Returns the HTML for the start of the page.<p> @param cssFile the CSS file name to use @param transitional if true, transitional doctype is used @return the HTML for the start of the page
[ "Returns", "the", "HTML", "for", "the", "start", "of", "the", "page", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/help/CmsHelpTemplateBean.java#L216-L242
CloudSlang/cs-actions
cs-powershell/src/main/java/io/cloudslang/content/services/WSManRemoteShellService.java
WSManRemoteShellService.executionIsTimedOut
private boolean executionIsTimedOut(long aStartTime, int aTimeout) { if (aTimeout != 0) { long now = System.currentTimeMillis() / 1000; if ((now - aStartTime) >= aTimeout) { return true; } } return false; }
java
private boolean executionIsTimedOut(long aStartTime, int aTimeout) { if (aTimeout != 0) { long now = System.currentTimeMillis() / 1000; if ((now - aStartTime) >= aTimeout) { return true; } } return false; }
[ "private", "boolean", "executionIsTimedOut", "(", "long", "aStartTime", ",", "int", "aTimeout", ")", "{", "if", "(", "aTimeout", "!=", "0", ")", "{", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", "/", "1000", ";", "if", "(", "(", "n...
Check whether or not the command execution reach the timeout value. @param aStartTime A start time in seconds. @param aTimeout A timeout value in seconds. @return true if it reaches timeout.
[ "Check", "whether", "or", "not", "the", "command", "execution", "reach", "the", "timeout", "value", "." ]
train
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-powershell/src/main/java/io/cloudslang/content/services/WSManRemoteShellService.java#L381-L389
jblas-project/jblas
src/main/java/org/jblas/ComplexFloat.java
ComplexFloat.addi
public ComplexFloat addi(float a, ComplexFloat result) { if (this == result) { r += a; } else { result.r = r + a; result.i = i; } return result; }
java
public ComplexFloat addi(float a, ComplexFloat result) { if (this == result) { r += a; } else { result.r = r + a; result.i = i; } return result; }
[ "public", "ComplexFloat", "addi", "(", "float", "a", ",", "ComplexFloat", "result", ")", "{", "if", "(", "this", "==", "result", ")", "{", "r", "+=", "a", ";", "}", "else", "{", "result", ".", "r", "=", "r", "+", "a", ";", "result", ".", "i", "...
Add a real number to a complex number in-place. @param a real number to add @param result complex number to hold result @return same as result
[ "Add", "a", "real", "number", "to", "a", "complex", "number", "in", "-", "place", "." ]
train
https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/ComplexFloat.java#L139-L147
minio/minio-java
api/src/main/java/io/minio/MinioClient.java
MinioClient.executePut
private HttpResponse executePut(String bucketName, String objectName, Map<String,String> headerMap, Map<String,String> queryParamMap, Object data, int length) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyE...
java
private HttpResponse executePut(String bucketName, String objectName, Map<String,String> headerMap, Map<String,String> queryParamMap, Object data, int length) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyE...
[ "private", "HttpResponse", "executePut", "(", "String", "bucketName", ",", "String", "objectName", ",", "Map", "<", "String", ",", "String", ">", "headerMap", ",", "Map", "<", "String", ",", "String", ">", "queryParamMap", ",", "Object", "data", ",", "int", ...
Executes PUT method for given request parameters. @param bucketName Bucket name. @param objectName Object name in the bucket. @param headerMap Map of HTTP headers for the request. @param queryParamMap Map of HTTP query parameters of the request. @param data HTTP request body data. @param length...
[ "Executes", "PUT", "method", "for", "given", "request", "parameters", "." ]
train
https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L1422-L1428
micrometer-metrics/micrometer
micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jvm/ExecutorServiceMetrics.java
ExecutorServiceMetrics.monitor
public static Executor monitor(MeterRegistry registry, Executor executor, String executorName, Iterable<Tag> tags) { if (executor instanceof ExecutorService) { return monitor(registry, (ExecutorService) executor, executorName, tags); } return new TimedExecutor(registry, executor, exe...
java
public static Executor monitor(MeterRegistry registry, Executor executor, String executorName, Iterable<Tag> tags) { if (executor instanceof ExecutorService) { return monitor(registry, (ExecutorService) executor, executorName, tags); } return new TimedExecutor(registry, executor, exe...
[ "public", "static", "Executor", "monitor", "(", "MeterRegistry", "registry", ",", "Executor", "executor", ",", "String", "executorName", ",", "Iterable", "<", "Tag", ">", "tags", ")", "{", "if", "(", "executor", "instanceof", "ExecutorService", ")", "{", "retu...
Record metrics on the use of an {@link Executor}. @param registry The registry to bind metrics to. @param executor The executor to instrument. @param executorName Will be used to tag metrics with "name". @param tags Tags to apply to all recorded metrics. @return The instrumented executor, proxied.
[ "Record", "metrics", "on", "the", "use", "of", "an", "{", "@link", "Executor", "}", "." ]
train
https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jvm/ExecutorServiceMetrics.java#L62-L67
JodaOrg/joda-time
src/main/java/org/joda/time/format/DateTimeFormatter.java
DateTimeFormatter.parseDateTime
public DateTime parseDateTime(String text) { InternalParser parser = requireParser(); Chronology chrono = selectChronology(null); DateTimeParserBucket bucket = new DateTimeParserBucket(0, chrono, iLocale, iPivotYear, iDefaultYear); int newPos = parser.parseInto(bucket, text, 0);...
java
public DateTime parseDateTime(String text) { InternalParser parser = requireParser(); Chronology chrono = selectChronology(null); DateTimeParserBucket bucket = new DateTimeParserBucket(0, chrono, iLocale, iPivotYear, iDefaultYear); int newPos = parser.parseInto(bucket, text, 0);...
[ "public", "DateTime", "parseDateTime", "(", "String", "text", ")", "{", "InternalParser", "parser", "=", "requireParser", "(", ")", ";", "Chronology", "chrono", "=", "selectChronology", "(", "null", ")", ";", "DateTimeParserBucket", "bucket", "=", "new", "DateTi...
Parses a date-time from the given text, returning a new DateTime. <p> The parse will use the zone and chronology specified on this formatter. <p> If the text contains a time zone string then that will be taken into account in adjusting the time of day as follows. If the {@link #withOffsetParsed()} has been called, then...
[ "Parses", "a", "date", "-", "time", "from", "the", "given", "text", "returning", "a", "new", "DateTime", ".", "<p", ">", "The", "parse", "will", "use", "the", "zone", "and", "chronology", "specified", "on", "this", "formatter", ".", "<p", ">", "If", "t...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatter.java#L920-L946
opsmatters/opsmatters-core
src/main/java/com/opsmatters/core/util/StringUtilities.java
StringUtilities.removeControlCharacters
public static String removeControlCharacters(String s, boolean removeCR) { String ret = s; if(ret != null) { ret = ret.replaceAll("_x000D_",""); if(removeCR) ret = ret.replaceAll("\r",""); } return ret; }
java
public static String removeControlCharacters(String s, boolean removeCR) { String ret = s; if(ret != null) { ret = ret.replaceAll("_x000D_",""); if(removeCR) ret = ret.replaceAll("\r",""); } return ret; }
[ "public", "static", "String", "removeControlCharacters", "(", "String", "s", ",", "boolean", "removeCR", ")", "{", "String", "ret", "=", "s", ";", "if", "(", "ret", "!=", "null", ")", "{", "ret", "=", "ret", ".", "replaceAll", "(", "\"_x000D_\"", ",", ...
Remove any extraneous control characters from text fields. @param s The string to have control characters removed @param removeCR <CODE>true</CODE> if carriage returns should be removed @return The given string with all control characters removed
[ "Remove", "any", "extraneous", "control", "characters", "from", "text", "fields", "." ]
train
https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/StringUtilities.java#L538-L548
atomix/catalyst
serializer/src/main/java/io/atomix/catalyst/serializer/Serializer.java
Serializer.registerDefault
public Serializer registerDefault(Class<?> baseType, Class<? extends TypeSerializer> serializer) { registry.registerDefault(baseType, serializer); return this; }
java
public Serializer registerDefault(Class<?> baseType, Class<? extends TypeSerializer> serializer) { registry.registerDefault(baseType, serializer); return this; }
[ "public", "Serializer", "registerDefault", "(", "Class", "<", "?", ">", "baseType", ",", "Class", "<", "?", "extends", "TypeSerializer", ">", "serializer", ")", "{", "registry", ".", "registerDefault", "(", "baseType", ",", "serializer", ")", ";", "return", ...
Registers a default type serializer for the given base type. <p> Default serializers are used to serialize types for which no specific {@link TypeSerializer} is provided. When a serializable type is {@link #register(Class) registered} without a {@link TypeSerializer}, the first default serializer found for the given ty...
[ "Registers", "a", "default", "type", "serializer", "for", "the", "given", "base", "type", ".", "<p", ">", "Default", "serializers", "are", "used", "to", "serialize", "types", "for", "which", "no", "specific", "{", "@link", "TypeSerializer", "}", "is", "provi...
train
https://github.com/atomix/catalyst/blob/140e762cb975cd8ee1fd85119043c5b8bf917c5c/serializer/src/main/java/io/atomix/catalyst/serializer/Serializer.java#L611-L614
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/ClientSidePreparedStatement.java
ClientSidePreparedStatement.setParameter
public void setParameter(final int parameterIndex, final ParameterHolder holder) throws SQLException { if (parameterIndex >= 1 && parameterIndex < prepareResult.getParamCount() + 1) { parameters[parameterIndex - 1] = holder; } else { String error = "Could not set parameter at position " + para...
java
public void setParameter(final int parameterIndex, final ParameterHolder holder) throws SQLException { if (parameterIndex >= 1 && parameterIndex < prepareResult.getParamCount() + 1) { parameters[parameterIndex - 1] = holder; } else { String error = "Could not set parameter at position " + para...
[ "public", "void", "setParameter", "(", "final", "int", "parameterIndex", ",", "final", "ParameterHolder", "holder", ")", "throws", "SQLException", "{", "if", "(", "parameterIndex", ">=", "1", "&&", "parameterIndex", "<", "prepareResult", ".", "getParamCount", "(",...
Set parameter. @param parameterIndex index @param holder parameter holder @throws SQLException if index position doesn't correspond to query parameters
[ "Set", "parameter", "." ]
train
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/ClientSidePreparedStatement.java#L442-L467
orbisgis/h2gis
h2gis-functions/src/main/java/org/h2gis/functions/spatial/type/GeometryTypeFromConstraint.java
GeometryTypeFromConstraint.geometryTypeFromConstraint
public static int geometryTypeFromConstraint(String constraint, int numericPrecision) { if(constraint.isEmpty() && numericPrecision > GeometryTypeCodes.GEOMETRYZM) { return GeometryTypeCodes.GEOMETRY; } // Use Domain given parameters if(numericPrecision <= GeometryTypeCodes.G...
java
public static int geometryTypeFromConstraint(String constraint, int numericPrecision) { if(constraint.isEmpty() && numericPrecision > GeometryTypeCodes.GEOMETRYZM) { return GeometryTypeCodes.GEOMETRY; } // Use Domain given parameters if(numericPrecision <= GeometryTypeCodes.G...
[ "public", "static", "int", "geometryTypeFromConstraint", "(", "String", "constraint", ",", "int", "numericPrecision", ")", "{", "if", "(", "constraint", ".", "isEmpty", "(", ")", "&&", "numericPrecision", ">", "GeometryTypeCodes", ".", "GEOMETRYZM", ")", "{", "r...
Convert H2 constraint string into a OGC geometry type index. @param constraint SQL Constraint ex: ST_GeometryTypeCode(the_geom) = 5 @param numericPrecision This parameter is available if the user give domain @return Geometry type code {@link org.h2gis.utilities.GeometryTypeCodes}
[ "Convert", "H2", "constraint", "string", "into", "a", "OGC", "geometry", "type", "index", "." ]
train
https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/type/GeometryTypeFromConstraint.java#L57-L72
cdk/cdk
storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java
CxSmilesParser.processPositionalVariation
private static boolean processPositionalVariation(CharIter iter, CxSmilesState state) { if (state.positionVar == null) state.positionVar = new TreeMap<>(); while (iter.hasNext()) { if (isDigit(iter.curr())) { final int beg = processUnsignedInt(iter); ...
java
private static boolean processPositionalVariation(CharIter iter, CxSmilesState state) { if (state.positionVar == null) state.positionVar = new TreeMap<>(); while (iter.hasNext()) { if (isDigit(iter.curr())) { final int beg = processUnsignedInt(iter); ...
[ "private", "static", "boolean", "processPositionalVariation", "(", "CharIter", "iter", ",", "CxSmilesState", "state", ")", "{", "if", "(", "state", ".", "positionVar", "==", "null", ")", "state", ".", "positionVar", "=", "new", "TreeMap", "<>", "(", ")", ";"...
Positional variation/multi centre bonding. Describe as a begin atom and one or more end points. @param iter input characters, iterator is progressed by this method @param state output CXSMILES state @return parse was a success (or not)
[ "Positional", "variation", "/", "multi", "centre", "bonding", ".", "Describe", "as", "a", "begin", "atom", "and", "one", "or", "more", "end", "points", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java#L337-L355
OpenLiberty/open-liberty
dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigEvaluator.java
ConfigEvaluator.processReference
private ConfigElement.Reference processReference(ConfigElement.Reference reference, EvaluationContext context, boolean ignoreWarnings) throws ConfigEvaluatorException { // Note, ref attributes don't correspond to an attribute definition, so we will always resolve variables (ie, there is no way to specify ...
java
private ConfigElement.Reference processReference(ConfigElement.Reference reference, EvaluationContext context, boolean ignoreWarnings) throws ConfigEvaluatorException { // Note, ref attributes don't correspond to an attribute definition, so we will always resolve variables (ie, there is no way to specify ...
[ "private", "ConfigElement", ".", "Reference", "processReference", "(", "ConfigElement", ".", "Reference", "reference", ",", "EvaluationContext", "context", ",", "boolean", "ignoreWarnings", ")", "throws", "ConfigEvaluatorException", "{", "// Note, ref attributes don't corresp...
Note, the "reference" here is something of the form: <parent> <child ref="someOtherElement"/> </parent> <otherElement id="someOtherElement"/> This is not called for ibm:type="pid" references. This method will resolve any variables in the ref attribute and return a new ConfigElement.Reference if anything changed. @p...
[ "Note", "the", "reference", "here", "is", "something", "of", "the", "form", ":", "<parent", ">", "<child", "ref", "=", "someOtherElement", "/", ">", "<", "/", "parent", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigEvaluator.java#L1363-L1372
rapidpro/expressions
java/src/main/java/io/rapidpro/expressions/utils/ExpressionUtils.java
ExpressionUtils.getDateFormatter
public static DateTimeFormatter getDateFormatter(DateStyle dateStyle, boolean incTime) { String format = dateStyle.equals(DateStyle.DAY_FIRST) ? "dd-MM-yyyy" : "MM-dd-yyyy"; return DateTimeFormatter.ofPattern(incTime ? format + " HH:mm" : format); }
java
public static DateTimeFormatter getDateFormatter(DateStyle dateStyle, boolean incTime) { String format = dateStyle.equals(DateStyle.DAY_FIRST) ? "dd-MM-yyyy" : "MM-dd-yyyy"; return DateTimeFormatter.ofPattern(incTime ? format + " HH:mm" : format); }
[ "public", "static", "DateTimeFormatter", "getDateFormatter", "(", "DateStyle", "dateStyle", ",", "boolean", "incTime", ")", "{", "String", "format", "=", "dateStyle", ".", "equals", "(", "DateStyle", ".", "DAY_FIRST", ")", "?", "\"dd-MM-yyyy\"", ":", "\"MM-dd-yyyy...
Gets a formatter for dates or datetimes @param dateStyle whether parsing should be day-first or month-first @param incTime whether to include time @return the formatter
[ "Gets", "a", "formatter", "for", "dates", "or", "datetimes" ]
train
https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/java/src/main/java/io/rapidpro/expressions/utils/ExpressionUtils.java#L105-L108
alkacon/opencms-core
src/org/opencms/ade/publish/CmsDirectPublishProject.java
CmsDirectPublishProject.addSubResources
protected void addSubResources(CmsObject cms, Set<CmsResource> resources) throws CmsException { List<CmsResource> subResources = new ArrayList<CmsResource>(); CmsObject rootCms = OpenCms.initCmsObject(cms); rootCms.getRequestContext().setSiteRoot(""); for (CmsResource res : resources) {...
java
protected void addSubResources(CmsObject cms, Set<CmsResource> resources) throws CmsException { List<CmsResource> subResources = new ArrayList<CmsResource>(); CmsObject rootCms = OpenCms.initCmsObject(cms); rootCms.getRequestContext().setSiteRoot(""); for (CmsResource res : resources) {...
[ "protected", "void", "addSubResources", "(", "CmsObject", "cms", ",", "Set", "<", "CmsResource", ">", "resources", ")", "throws", "CmsException", "{", "List", "<", "CmsResource", ">", "subResources", "=", "new", "ArrayList", "<", "CmsResource", ">", "(", ")", ...
Adds contents of folders to a list of resources.<p> @param cms the CMS context to use @param resources the resource list to which to add the folder contents @throws CmsException if something goes wrong
[ "Adds", "contents", "of", "folders", "to", "a", "list", "of", "resources", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/publish/CmsDirectPublishProject.java#L146-L165
Impetus/Kundera
src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java
CassandraSchemaManager.updateTable
private void updateTable(KsDef ksDef, TableInfo tableInfo) throws Exception { for (CfDef cfDef : ksDef.getCf_defs()) { if (cfDef.getName().equals(tableInfo.getTableName()) && cfDef.getColumn_type().equals(ColumnFamilyType.getInstanceOf(tableInfo.getType()).name())) ...
java
private void updateTable(KsDef ksDef, TableInfo tableInfo) throws Exception { for (CfDef cfDef : ksDef.getCf_defs()) { if (cfDef.getName().equals(tableInfo.getTableName()) && cfDef.getColumn_type().equals(ColumnFamilyType.getInstanceOf(tableInfo.getType()).name())) ...
[ "private", "void", "updateTable", "(", "KsDef", "ksDef", ",", "TableInfo", "tableInfo", ")", "throws", "Exception", "{", "for", "(", "CfDef", "cfDef", ":", "ksDef", ".", "getCf_defs", "(", ")", ")", "{", "if", "(", "cfDef", ".", "getName", "(", ")", "....
Update table. @param ksDef the ks def @param tableInfo the table info @throws Exception the exception
[ "Update", "table", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L1969-L1993
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java
DocFile.readResource
private static int readResource(DocPath resource, InputStream in, byte[] buf) throws ResourceIOException { try { return in.read(buf); } catch (IOException e) { throw new ResourceIOException(resource, e); } }
java
private static int readResource(DocPath resource, InputStream in, byte[] buf) throws ResourceIOException { try { return in.read(buf); } catch (IOException e) { throw new ResourceIOException(resource, e); } }
[ "private", "static", "int", "readResource", "(", "DocPath", "resource", ",", "InputStream", "in", ",", "byte", "[", "]", "buf", ")", "throws", "ResourceIOException", "{", "try", "{", "return", "in", ".", "read", "(", "buf", ")", ";", "}", "catch", "(", ...
Reads from an input stream opened from a given resource into a given buffer. If an IOException occurs, it is wrapped in a ResourceIOException. @param resource the resource for the stream @param in the stream @param buf the buffer @return the number of bytes read, or -1 if at end of file @throws ResourceIOException if ...
[ "Reads", "from", "an", "input", "stream", "opened", "from", "a", "given", "resource", "into", "a", "given", "buffer", ".", "If", "an", "IOException", "occurs", "it", "is", "wrapped", "in", "a", "ResourceIOException", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/DocFile.java#L335-L341
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcResultSet.java
WSJdbcResultSet.updateObject
public void updateObject(int arg0, Object arg1, int arg2) throws SQLException { try { rsetImpl.updateObject(arg0, arg1, arg2); } catch (SQLException ex) { FFDCFilter.processException(ex, "com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.updateObject", "3737", this); throw WS...
java
public void updateObject(int arg0, Object arg1, int arg2) throws SQLException { try { rsetImpl.updateObject(arg0, arg1, arg2); } catch (SQLException ex) { FFDCFilter.processException(ex, "com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.updateObject", "3737", this); throw WS...
[ "public", "void", "updateObject", "(", "int", "arg0", ",", "Object", "arg1", ",", "int", "arg2", ")", "throws", "SQLException", "{", "try", "{", "rsetImpl", ".", "updateObject", "(", "arg0", ",", "arg1", ",", "arg2", ")", ";", "}", "catch", "(", "SQLEx...
Updates a column with an Object value. The updateXXX methods are used to update column values in the current row, or the insert row. The updateXXX methods do not update the underlying database; instead the updateRow or insertRow methods are called to update the database. @param columnIndex - the first column is 1, the...
[ "Updates", "a", "column", "with", "an", "Object", "value", ".", "The", "updateXXX", "methods", "are", "used", "to", "update", "column", "values", "in", "the", "current", "row", "or", "the", "insert", "row", ".", "The", "updateXXX", "methods", "do", "not", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcResultSet.java#L4113-L4123
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/AmazonEC2Client.java
AmazonEC2Client.dryRun
public <X extends AmazonWebServiceRequest> DryRunResult<X> dryRun(DryRunSupportedRequest<X> request) throws AmazonServiceException, AmazonClientException { Request<X> dryRunRequest = request.getDryRunRequest(); ExecutionContext executionContext = createExecutionContext(dryRunRequest); try { ...
java
public <X extends AmazonWebServiceRequest> DryRunResult<X> dryRun(DryRunSupportedRequest<X> request) throws AmazonServiceException, AmazonClientException { Request<X> dryRunRequest = request.getDryRunRequest(); ExecutionContext executionContext = createExecutionContext(dryRunRequest); try { ...
[ "public", "<", "X", "extends", "AmazonWebServiceRequest", ">", "DryRunResult", "<", "X", ">", "dryRun", "(", "DryRunSupportedRequest", "<", "X", ">", "request", ")", "throws", "AmazonServiceException", ",", "AmazonClientException", "{", "Request", "<", "X", ">", ...
Checks whether you have the required permissions for the provided Amazon EC2 operation, without actually running it. The returned DryRunResult object contains the information of whether the dry-run was successful. This method will throw exception when the service response does not clearly indicate whether you have the ...
[ "Checks", "whether", "you", "have", "the", "required", "permissions", "for", "the", "provided", "Amazon", "EC2", "operation", "without", "actually", "running", "it", ".", "The", "returned", "DryRunResult", "object", "contains", "the", "information", "of", "whether...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/AmazonEC2Client.java#L20301-L20317
foundation-runtime/service-directory
2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java
DirectoryServiceClient.updateServiceInstanceUri
public void updateServiceInstanceUri(String serviceName, String instanceId, String uri, final RegistrationCallback cb, Object context){ ProtocolHeader header = new ProtocolHeader(); header.setType(ProtocolType.UpdateServiceInstanceUri); UpdateServiceInstanceUriProtocol p = new UpdateServiceInst...
java
public void updateServiceInstanceUri(String serviceName, String instanceId, String uri, final RegistrationCallback cb, Object context){ ProtocolHeader header = new ProtocolHeader(); header.setType(ProtocolType.UpdateServiceInstanceUri); UpdateServiceInstanceUriProtocol p = new UpdateServiceInst...
[ "public", "void", "updateServiceInstanceUri", "(", "String", "serviceName", ",", "String", "instanceId", ",", "String", "uri", ",", "final", "RegistrationCallback", "cb", ",", "Object", "context", ")", "{", "ProtocolHeader", "header", "=", "new", "ProtocolHeader", ...
Update ServiceInstance URI in Callback. @param serviceName the service name. @param instanceId the instanceId. @param uri the new URI. @param cb the Callback. @param context the object context.
[ "Update", "ServiceInstance", "URI", "in", "Callback", "." ]
train
https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java#L614-L629
JakeWharton/ActionBarSherlock
actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/BaseMenuPresenter.java
BaseMenuPresenter.getItemView
public View getItemView(MenuItemImpl item, View convertView, ViewGroup parent) { MenuView.ItemView itemView; if (convertView instanceof MenuView.ItemView) { itemView = (MenuView.ItemView) convertView; } else { itemView = createItemView(parent); } bindItemV...
java
public View getItemView(MenuItemImpl item, View convertView, ViewGroup parent) { MenuView.ItemView itemView; if (convertView instanceof MenuView.ItemView) { itemView = (MenuView.ItemView) convertView; } else { itemView = createItemView(parent); } bindItemV...
[ "public", "View", "getItemView", "(", "MenuItemImpl", "item", ",", "View", "convertView", ",", "ViewGroup", "parent", ")", "{", "MenuView", ".", "ItemView", "itemView", ";", "if", "(", "convertView", "instanceof", "MenuView", ".", "ItemView", ")", "{", "itemVi...
Prepare an item view for use. See AdapterView for the basic idea at work here. This may require creating a new item view, but well-behaved implementations will re-use the view passed as convertView if present. The returned view will be populated with data from the item parameter. @param item Item to present @param con...
[ "Prepare", "an", "item", "view", "for", "use", ".", "See", "AdapterView", "for", "the", "basic", "idea", "at", "work", "here", ".", "This", "may", "require", "creating", "a", "new", "item", "view", "but", "well", "-", "behaved", "implementations", "will", ...
train
https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/BaseMenuPresenter.java#L169-L178
GumTreeDiff/gumtree
core/src/main/java/com/github/gumtreediff/utils/SequenceAlgorithms.java
SequenceAlgorithms.longestCommonSubsequenceWithIsomorphism
public static List<int[]> longestCommonSubsequenceWithIsomorphism(List<ITree> s0, List<ITree> s1) { int[][] lengths = new int[s0.size() + 1][s1.size() + 1]; for (int i = 0; i < s0.size(); i++) for (int j = 0; j < s1.size(); j++) if (s0.get(i).isIsomorphicTo(s1.get(j))) ...
java
public static List<int[]> longestCommonSubsequenceWithIsomorphism(List<ITree> s0, List<ITree> s1) { int[][] lengths = new int[s0.size() + 1][s1.size() + 1]; for (int i = 0; i < s0.size(); i++) for (int j = 0; j < s1.size(); j++) if (s0.get(i).isIsomorphicTo(s1.get(j))) ...
[ "public", "static", "List", "<", "int", "[", "]", ">", "longestCommonSubsequenceWithIsomorphism", "(", "List", "<", "ITree", ">", "s0", ",", "List", "<", "ITree", ">", "s1", ")", "{", "int", "[", "]", "[", "]", "lengths", "=", "new", "int", "[", "s0"...
Returns the longest common subsequence between the two list of nodes. This version use isomorphism to ensure equality. @see ITree#isIsomorphicTo(ITree) @return a list of size 2 int arrays that corresponds to match of index in sequence 1 to index in sequence 2.
[ "Returns", "the", "longest", "common", "subsequence", "between", "the", "two", "list", "of", "nodes", ".", "This", "version", "use", "isomorphism", "to", "ensure", "equality", "." ]
train
https://github.com/GumTreeDiff/gumtree/blob/a772d4d652af44bff22c38a234ddffbfbd365a37/core/src/main/java/com/github/gumtreediff/utils/SequenceAlgorithms.java#L131-L141
tumblr/jumblr
src/main/java/com/tumblr/jumblr/JumblrClient.java
JumblrClient.newPost
public <T extends Post> T newPost(String blogName, Class<T> klass) throws IllegalAccessException, InstantiationException { T post = klass.newInstance(); post.setClient(this); post.setBlogName(blogName); return post; }
java
public <T extends Post> T newPost(String blogName, Class<T> klass) throws IllegalAccessException, InstantiationException { T post = klass.newInstance(); post.setClient(this); post.setBlogName(blogName); return post; }
[ "public", "<", "T", "extends", "Post", ">", "T", "newPost", "(", "String", "blogName", ",", "Class", "<", "T", ">", "klass", ")", "throws", "IllegalAccessException", ",", "InstantiationException", "{", "T", "post", "=", "klass", ".", "newInstance", "(", ")...
Set up a new post of a given type @param blogName the name of the blog for this post (or null) @param klass the type of Post to instantiate @param <T> the type of Post to instantiate @return the new post with the client set @throws IllegalAccessException if class instantiation fails @throws InstantiationException if cl...
[ "Set", "up", "a", "new", "post", "of", "a", "given", "type" ]
train
https://github.com/tumblr/jumblr/blob/373629fd545defb016e227ea758f092507fbd624/src/main/java/com/tumblr/jumblr/JumblrClient.java#L397-L402
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/ProductSortDefinitionUrl.java
ProductSortDefinitionUrl.addProductSortDefinitionUrl
public static MozuUrl addProductSortDefinitionUrl(String responseFields, Boolean useProvidedId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/productsortdefinitions/?useProvidedId={useProvidedId}&responseFields={responseFields}"); formatter.formatUrl("responseFields", responseFields); ...
java
public static MozuUrl addProductSortDefinitionUrl(String responseFields, Boolean useProvidedId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/productsortdefinitions/?useProvidedId={useProvidedId}&responseFields={responseFields}"); formatter.formatUrl("responseFields", responseFields); ...
[ "public", "static", "MozuUrl", "addProductSortDefinitionUrl", "(", "String", "responseFields", ",", "Boolean", "useProvidedId", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/catalog/admin/productsortdefinitions/?useProvidedId={useProvide...
Get Resource Url for AddProductSortDefinition @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. @param useProvid...
[ "Get", "Resource", "Url", "for", "AddProductSortDefinition" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/ProductSortDefinitionUrl.java#L56-L62
l0rdn1kk0n/wicket-jquery-selectors
src/main/java/de/agilecoders/wicket/jquery/util/Json.java
Json.fromJson
public static <T> T fromJson(final String json, final JavaType type) { try { return createObjectMapper().readValue(json, type); } catch (Exception e) { throw new ParseException(e); } }
java
public static <T> T fromJson(final String json, final JavaType type) { try { return createObjectMapper().readValue(json, type); } catch (Exception e) { throw new ParseException(e); } }
[ "public", "static", "<", "T", ">", "T", "fromJson", "(", "final", "String", "json", ",", "final", "JavaType", "type", ")", "{", "try", "{", "return", "createObjectMapper", "(", ")", ".", "readValue", "(", "json", ",", "type", ")", ";", "}", "catch", ...
Convert a string to a Java value @param json Json value to convert. @param type Expected Java value type. @param <T> type of return object @return casted value of given json object @throws ParseException to runtime if json node can't be casted to clazz.
[ "Convert", "a", "string", "to", "a", "Java", "value" ]
train
https://github.com/l0rdn1kk0n/wicket-jquery-selectors/blob/a606263f7821d0b5f337c9e65f8caa466ad398ad/src/main/java/de/agilecoders/wicket/jquery/util/Json.java#L44-L50
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/UpdatableHeap.java
UpdatableHeap.offerAt
protected void offerAt(final int pos, O e) { if(pos == NO_VALUE) { // resize when needed if(size + 1 > queue.length) { resize(size + 1); } index.put(e, size); size++; heapifyUp(size - 1, e); heapModified(); return; } assert (pos >= 0) : "Unexpected neg...
java
protected void offerAt(final int pos, O e) { if(pos == NO_VALUE) { // resize when needed if(size + 1 > queue.length) { resize(size + 1); } index.put(e, size); size++; heapifyUp(size - 1, e); heapModified(); return; } assert (pos >= 0) : "Unexpected neg...
[ "protected", "void", "offerAt", "(", "final", "int", "pos", ",", "O", "e", ")", "{", "if", "(", "pos", "==", "NO_VALUE", ")", "{", "// resize when needed", "if", "(", "size", "+", "1", ">", "queue", ".", "length", ")", "{", "resize", "(", "size", "...
Offer element at the given position. @param pos Position @param e Element
[ "Offer", "element", "at", "the", "given", "position", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/UpdatableHeap.java#L111-L132
igniterealtime/Smack
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/BridgedTransportManager.java
BridgedTransportManager.sessionEstablished
@Override public void sessionEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc, JingleSession jingleSession) throws NotConnectedException, InterruptedException { RTPBridge rtpBridge = RTPBridge.relaySession(lc.getConnection(), lc.getSessionId(), lc.getPassword(), rc, lc); }
java
@Override public void sessionEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc, JingleSession jingleSession) throws NotConnectedException, InterruptedException { RTPBridge rtpBridge = RTPBridge.relaySession(lc.getConnection(), lc.getSessionId(), lc.getPassword(), rc, lc); }
[ "@", "Override", "public", "void", "sessionEstablished", "(", "PayloadType", "pt", ",", "TransportCandidate", "rc", ",", "TransportCandidate", "lc", ",", "JingleSession", "jingleSession", ")", "throws", "NotConnectedException", ",", "InterruptedException", "{", "RTPBrid...
Implement a Session Listener to relay candidates after establishment
[ "Implement", "a", "Session", "Listener", "to", "relay", "candidates", "after", "establishment" ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/BridgedTransportManager.java#L58-L61
alkacon/opencms-core
src/org/opencms/file/wrapper/A_CmsResourceExtensionWrapper.java
A_CmsResourceExtensionWrapper.getResource
private CmsResource getResource(CmsObject cms, String resourcename, CmsResourceFilter filter) { CmsResource res = null; try { res = cms.readResource( CmsResourceWrapperUtils.removeFileExtension(cms, resourcename, getExtension()), filter); } catch (Cm...
java
private CmsResource getResource(CmsObject cms, String resourcename, CmsResourceFilter filter) { CmsResource res = null; try { res = cms.readResource( CmsResourceWrapperUtils.removeFileExtension(cms, resourcename, getExtension()), filter); } catch (Cm...
[ "private", "CmsResource", "getResource", "(", "CmsObject", "cms", ",", "String", "resourcename", ",", "CmsResourceFilter", "filter", ")", "{", "CmsResource", "res", "=", "null", ";", "try", "{", "res", "=", "cms", ".", "readResource", "(", "CmsResourceWrapperUti...
Trys to read the resourcename after removing the file extension and return the resource if the type id is correct.<p> @param cms the initialized CmsObject @param resourcename the name of the resource to read @param filter the resource filter to use while reading @return the resource or null if not found
[ "Trys", "to", "read", "the", "resourcename", "after", "removing", "the", "file", "extension", "and", "return", "the", "resource", "if", "the", "type", "id", "is", "correct", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/A_CmsResourceExtensionWrapper.java#L335-L352
Azure/azure-sdk-for-java
network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java
ApplicationGatewaysInner.beginCreateOrUpdate
public ApplicationGatewayInner beginCreateOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().single().body(); }
java
public ApplicationGatewayInner beginCreateOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().single().body(); }
[ "public", "ApplicationGatewayInner", "beginCreateOrUpdate", "(", "String", "resourceGroupName", ",", "String", "applicationGatewayName", ",", "ApplicationGatewayInner", "parameters", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",",...
Creates or updates the specified application gateway. @param resourceGroupName The name of the resource group. @param applicationGatewayName The name of the application gateway. @param parameters Parameters supplied to the create or update application gateway operation. @throws IllegalArgumentException thrown if param...
[ "Creates", "or", "updates", "the", "specified", "application", "gateway", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java#L481-L483
GenesysPureEngage/provisioning-client-java
src/main/java/com/genesys/internal/provisioning/api/UsersApi.java
UsersApi.getUsersWithHttpInfo
public ApiResponse<GetUsersSuccessResponse> getUsersWithHttpInfo(Integer limit, Integer offset, String order, String sortBy, String filterName, String filterParameters, String roles, String skills, Boolean userEnabled, String userValid) throws ApiException { com.squareup.okhttp.Call call = getUsersValidateBefor...
java
public ApiResponse<GetUsersSuccessResponse> getUsersWithHttpInfo(Integer limit, Integer offset, String order, String sortBy, String filterName, String filterParameters, String roles, String skills, Boolean userEnabled, String userValid) throws ApiException { com.squareup.okhttp.Call call = getUsersValidateBefor...
[ "public", "ApiResponse", "<", "GetUsersSuccessResponse", ">", "getUsersWithHttpInfo", "(", "Integer", "limit", ",", "Integer", "offset", ",", "String", "order", ",", "String", "sortBy", ",", "String", "filterName", ",", "String", "filterParameters", ",", "String", ...
Get users. Get [CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson) objects based on the specified filters. @param limit Limit the number of users the Provisioning API should return. (optional) @param offset The number of matches the Provisioning API should skip in the returned users...
[ "Get", "users", ".", "Get", "[", "CfgPerson", "]", "(", "https", ":", "//", "docs", ".", "genesys", ".", "com", "/", "Documentation", "/", "PSDK", "/", "latest", "/", "ConfigLayerRef", "/", "CfgPerson", ")", "objects", "based", "on", "the", "specified", ...
train
https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/UsersApi.java#L673-L677
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/WishlistUrl.java
WishlistUrl.getWishlistByNameUrl
public static MozuUrl getWishlistByNameUrl(Integer customerAccountId, String responseFields, String wishlistName) { UrlFormatter formatter = new UrlFormatter("/api/commerce/wishlists/customers/{customerAccountId}/{wishlistName}?responseFields={responseFields}"); formatter.formatUrl("customerAccountId", customer...
java
public static MozuUrl getWishlistByNameUrl(Integer customerAccountId, String responseFields, String wishlistName) { UrlFormatter formatter = new UrlFormatter("/api/commerce/wishlists/customers/{customerAccountId}/{wishlistName}?responseFields={responseFields}"); formatter.formatUrl("customerAccountId", customer...
[ "public", "static", "MozuUrl", "getWishlistByNameUrl", "(", "Integer", "customerAccountId", ",", "String", "responseFields", ",", "String", "wishlistName", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/wishlists/customers/{customer...
Get Resource Url for GetWishlistByName @param customerAccountId The unique identifier of the customer account for which to retrieve wish lists. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to r...
[ "Get", "Resource", "Url", "for", "GetWishlistByName" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/WishlistUrl.java#L61-L68
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/serializer/NormalizerSerializer.java
NormalizerSerializer.write
public void write(@NonNull Normalizer normalizer, @NonNull String path) throws IOException { try (OutputStream out = new BufferedOutputStream(new FileOutputStream(path))) { write(normalizer, out); } }
java
public void write(@NonNull Normalizer normalizer, @NonNull String path) throws IOException { try (OutputStream out = new BufferedOutputStream(new FileOutputStream(path))) { write(normalizer, out); } }
[ "public", "void", "write", "(", "@", "NonNull", "Normalizer", "normalizer", ",", "@", "NonNull", "String", "path", ")", "throws", "IOException", "{", "try", "(", "OutputStream", "out", "=", "new", "BufferedOutputStream", "(", "new", "FileOutputStream", "(", "p...
Serialize a normalizer to the given file path @param normalizer the normalizer @param path the destination file path @throws IOException
[ "Serialize", "a", "normalizer", "to", "the", "given", "file", "path" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/serializer/NormalizerSerializer.java#L59-L63
haraldk/TwelveMonkeys
common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java
StringUtil.replaceIgnoreCase
public static String replaceIgnoreCase(String pSource, String pPattern, String pReplace) { if (pPattern.length() == 0) { return pSource;// Special case: No pattern to replace } int match; int offset = 0; StringBuilder result = new StringBuilder(); whi...
java
public static String replaceIgnoreCase(String pSource, String pPattern, String pReplace) { if (pPattern.length() == 0) { return pSource;// Special case: No pattern to replace } int match; int offset = 0; StringBuilder result = new StringBuilder(); whi...
[ "public", "static", "String", "replaceIgnoreCase", "(", "String", "pSource", ",", "String", "pPattern", ",", "String", "pReplace", ")", "{", "if", "(", "pPattern", ".", "length", "(", ")", "==", "0", ")", "{", "return", "pSource", ";", "// Special case: No p...
Replaces a substring of a string with another string, ignoring case. All matches are replaced. @param pSource The source String @param pPattern The pattern to replace @param pReplace The new String to be inserted instead of the replace String @return The new String with the pattern replaced @see #replace(String,Strin...
[ "Replaces", "a", "substring", "of", "a", "string", "with", "another", "string", "ignoring", "case", ".", "All", "matches", "are", "replaced", "." ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L659-L674
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getKeyValues
public ValueContainer[] getKeyValues(ClassDescriptor cld, Identity oid, boolean convertToSql) throws PersistenceBrokerException { FieldDescriptor[] pkFields = cld.getPkFields(); ValueContainer[] result = new ValueContainer[pkFields.length]; Object[] pkValues = oid.getPrimaryKeyValues(); ...
java
public ValueContainer[] getKeyValues(ClassDescriptor cld, Identity oid, boolean convertToSql) throws PersistenceBrokerException { FieldDescriptor[] pkFields = cld.getPkFields(); ValueContainer[] result = new ValueContainer[pkFields.length]; Object[] pkValues = oid.getPrimaryKeyValues(); ...
[ "public", "ValueContainer", "[", "]", "getKeyValues", "(", "ClassDescriptor", "cld", ",", "Identity", "oid", ",", "boolean", "convertToSql", ")", "throws", "PersistenceBrokerException", "{", "FieldDescriptor", "[", "]", "pkFields", "=", "cld", ".", "getPkFields", ...
Return key Values of an Identity @param cld @param oid @param convertToSql @return Object[] @throws PersistenceBrokerException
[ "Return", "key", "Values", "of", "an", "Identity" ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L203-L228
google/closure-templates
java/src/com/google/template/soy/jbcsrc/ProtoUtils.java
ProtoUtils.getBuildMethod
private static MethodRef getBuildMethod(Descriptor descriptor) { TypeInfo message = messageRuntimeType(descriptor); TypeInfo builder = builderRuntimeType(descriptor); return MethodRef.createInstanceMethod( builder, new Method("build", message.type(), NO_METHOD_ARGS)) .asNonNullable(); ...
java
private static MethodRef getBuildMethod(Descriptor descriptor) { TypeInfo message = messageRuntimeType(descriptor); TypeInfo builder = builderRuntimeType(descriptor); return MethodRef.createInstanceMethod( builder, new Method("build", message.type(), NO_METHOD_ARGS)) .asNonNullable(); ...
[ "private", "static", "MethodRef", "getBuildMethod", "(", "Descriptor", "descriptor", ")", "{", "TypeInfo", "message", "=", "messageRuntimeType", "(", "descriptor", ")", ";", "TypeInfo", "builder", "=", "builderRuntimeType", "(", "descriptor", ")", ";", "return", "...
Returns the {@link MethodRef} for the generated build method.
[ "Returns", "the", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/ProtoUtils.java#L1289-L1295
grails/grails-core
grails-encoder/src/main/groovy/org/grails/charsequences/CharSequences.java
CharSequences.getChars
public static void getChars(CharSequence csq, int srcBegin, int srcEnd, char dst[], int dstBegin) { final Class<?> csqClass = csq.getClass(); if (csqClass == String.class) { ((String)csq).getChars(srcBegin, srcEnd, dst, dstBegin); } else if (csqClass == StringBuffer.class) { ...
java
public static void getChars(CharSequence csq, int srcBegin, int srcEnd, char dst[], int dstBegin) { final Class<?> csqClass = csq.getClass(); if (csqClass == String.class) { ((String)csq).getChars(srcBegin, srcEnd, dst, dstBegin); } else if (csqClass == StringBuffer.class) { ...
[ "public", "static", "void", "getChars", "(", "CharSequence", "csq", ",", "int", "srcBegin", ",", "int", "srcEnd", ",", "char", "dst", "[", "]", ",", "int", "dstBegin", ")", "{", "final", "Class", "<", "?", ">", "csqClass", "=", "csq", ".", "getClass", ...
Provides an optimized way to copy CharSequence content to target array. Uses getChars method available on String, StringBuilder and StringBuffer classes. Characters are copied from the source sequence <code>csq</code> into the destination character array <code>dst</code>. The first character to be copied is at index <...
[ "Provides", "an", "optimized", "way", "to", "copy", "CharSequence", "content", "to", "target", "array", ".", "Uses", "getChars", "method", "available", "on", "String", "StringBuilder", "and", "StringBuffer", "classes", "." ]
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-encoder/src/main/groovy/org/grails/charsequences/CharSequences.java#L150-L168
apache/incubator-druid
processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java
DimensionHandlerUtils.createColumnSelectorPlus
public static <ColumnSelectorStrategyClass extends ColumnSelectorStrategy> ColumnSelectorPlus<ColumnSelectorStrategyClass> createColumnSelectorPlus( ColumnSelectorStrategyFactory<ColumnSelectorStrategyClass> strategyFactory, DimensionSpec dimensionSpec, ColumnSelectorFactory cursor ) { return ...
java
public static <ColumnSelectorStrategyClass extends ColumnSelectorStrategy> ColumnSelectorPlus<ColumnSelectorStrategyClass> createColumnSelectorPlus( ColumnSelectorStrategyFactory<ColumnSelectorStrategyClass> strategyFactory, DimensionSpec dimensionSpec, ColumnSelectorFactory cursor ) { return ...
[ "public", "static", "<", "ColumnSelectorStrategyClass", "extends", "ColumnSelectorStrategy", ">", "ColumnSelectorPlus", "<", "ColumnSelectorStrategyClass", ">", "createColumnSelectorPlus", "(", "ColumnSelectorStrategyFactory", "<", "ColumnSelectorStrategyClass", ">", "strategyFacto...
Convenience function equivalent to calling {@link #createColumnSelectorPluses(ColumnSelectorStrategyFactory, List, ColumnSelectorFactory)} with a singleton list of dimensionSpecs and then retrieving the only element in the returned array. @param <ColumnSelectorStrategyClass> The strategy type created by the provided s...
[ "Convenience", "function", "equivalent", "to", "calling", "{", "@link", "#createColumnSelectorPluses", "(", "ColumnSelectorStrategyFactory", "List", "ColumnSelectorFactory", ")", "}", "with", "a", "singleton", "list", "of", "dimensionSpecs", "and", "then", "retrieving", ...
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java#L117-L124
igniterealtime/Smack
smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java
Stanza.hasExtension
public boolean hasExtension(String elementName, String namespace) { if (elementName == null) { return hasExtension(namespace); } String key = XmppStringUtils.generateKey(elementName, namespace); synchronized (packetExtensions) { return packetExtensions.containsKey...
java
public boolean hasExtension(String elementName, String namespace) { if (elementName == null) { return hasExtension(namespace); } String key = XmppStringUtils.generateKey(elementName, namespace); synchronized (packetExtensions) { return packetExtensions.containsKey...
[ "public", "boolean", "hasExtension", "(", "String", "elementName", ",", "String", "namespace", ")", "{", "if", "(", "elementName", "==", "null", ")", "{", "return", "hasExtension", "(", "namespace", ")", ";", "}", "String", "key", "=", "XmppStringUtils", "."...
Check if a stanza extension with the given element and namespace exists. <p> The argument <code>elementName</code> may be null. </p> @param elementName @param namespace @return true if a stanza extension exists, false otherwise.
[ "Check", "if", "a", "stanza", "extension", "with", "the", "given", "element", "and", "namespace", "exists", ".", "<p", ">", "The", "argument", "<code", ">", "elementName<", "/", "code", ">", "may", "be", "null", ".", "<", "/", "p", ">" ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java#L428-L436
alkacon/opencms-core
src/org/opencms/ui/apps/git/CmsGitToolOptionsPanel.java
CmsGitToolOptionsPanel.setUserInfo
private void setUserInfo(CmsUser user, String key, String value) { if (!CmsStringUtil.isEmptyOrWhitespaceOnly(value)) { user.getAdditionalInfo().put(key, value); } }
java
private void setUserInfo(CmsUser user, String key, String value) { if (!CmsStringUtil.isEmptyOrWhitespaceOnly(value)) { user.getAdditionalInfo().put(key, value); } }
[ "private", "void", "setUserInfo", "(", "CmsUser", "user", ",", "String", "key", ",", "String", "value", ")", "{", "if", "(", "!", "CmsStringUtil", ".", "isEmptyOrWhitespaceOnly", "(", "value", ")", ")", "{", "user", ".", "getAdditionalInfo", "(", ")", ".",...
Sets an additional info value if it's not empty.<p> @param user the user on which to set the additional info @param key the additional info key @param value the additional info value
[ "Sets", "an", "additional", "info", "value", "if", "it", "s", "not", "empty", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/git/CmsGitToolOptionsPanel.java#L773-L778
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/installation/LayersFactory.java
LayersFactory.createPatchableTarget
static AbstractLazyPatchableTarget createPatchableTarget(final String name, final LayerPathConfig layer, final File metadata, final InstalledImage image) throws IOException { // patchable target return new AbstractLazyPatchableTarget() { @Override public InstalledImage getInstal...
java
static AbstractLazyPatchableTarget createPatchableTarget(final String name, final LayerPathConfig layer, final File metadata, final InstalledImage image) throws IOException { // patchable target return new AbstractLazyPatchableTarget() { @Override public InstalledImage getInstal...
[ "static", "AbstractLazyPatchableTarget", "createPatchableTarget", "(", "final", "String", "name", ",", "final", "LayerPathConfig", "layer", ",", "final", "File", "metadata", ",", "final", "InstalledImage", "image", ")", "throws", "IOException", "{", "// patchable target...
Create the actual patchable target. @param name the layer name @param layer the layer path config @param metadata the metadata location for this target @param image the installed image @return the patchable target @throws IOException
[ "Create", "the", "actual", "patchable", "target", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/installation/LayersFactory.java#L205-L233
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/SnapToEllipseEdge.java
SnapToEllipseEdge.computePointsAndWeights
void computePointsAndWeights(EllipseRotated_F64 ellipse) { // use the semi-major axis to scale the input points for numerical stability double localScale = ellipse.a; samplePts.reset(); weights.reset(); int numSamples = radialSamples * 2 + 2; int numPts = numSamples - 1; Point2D_F64 sample = new Point2...
java
void computePointsAndWeights(EllipseRotated_F64 ellipse) { // use the semi-major axis to scale the input points for numerical stability double localScale = ellipse.a; samplePts.reset(); weights.reset(); int numSamples = radialSamples * 2 + 2; int numPts = numSamples - 1; Point2D_F64 sample = new Point2...
[ "void", "computePointsAndWeights", "(", "EllipseRotated_F64", "ellipse", ")", "{", "// use the semi-major axis to scale the input points for numerical stability", "double", "localScale", "=", "ellipse", ".", "a", ";", "samplePts", ".", "reset", "(", ")", ";", "weights", "...
Computes the location of points along the line and their weights
[ "Computes", "the", "location", "of", "points", "along", "the", "line", "and", "their", "weights" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/SnapToEllipseEdge.java#L134-L192