query stringlengths 74 6.1k | positive listlengths 1 1 | negative listlengths 9 9 |
|---|---|---|
public boolean matches(Property property) {
return property.getName().equals(key) && (value == WILDCARD_VALUE || property.getValue().asString().equals(value));
} | [
"Determine whether the given property matches this element.\nA property matches this element when property name and this key are equal,\nvalues are equal or this element value is a wildcard.\n@param property the property to check\n@return {@code true} if the property matches"
] | [
"Submits the configured assembly to Transloadit for processing.\n\n@param isResumable boolean value that tells the assembly whether or not to use tus.\n@return {@link AssemblyResponse} the response received from the Transloadit server.\n@throws RequestException if request to Transloadit server fails.\n@throw... |
public void setStringValue(String value) {
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) {
try {
m_editValue = CmsLocationValue.parse(value);
m_currentValue = m_editValue.cloneValue();
displayValue();
if ((m_popup != null) && m_popup.isVisible()) {
m_popupContent.displayValues(m_editValue);
updateMarkerPosition();
}
} catch (Exception e) {
CmsLog.log(e.getLocalizedMessage() + "\n" + CmsClientStringUtil.getStackTrace(e, "\n"));
}
} else {
m_currentValue = null;
displayValue();
}
} | [
"Sets the location value as string.\n\n@param value the string representation of the location value (JSON)"
] | [
"The timeout which we block for when a resource is not available\n\n@param timeout The timeout\n@param unit The units of the timeout",
"Kicks off an animation that will result in the pointer being centered in the\npie slice of the currently selected item.",
"Remove a connection from all keys.\n\n@param connecti... |
private ClassDescriptor discoverDescriptor(Class clazz)
{
ClassDescriptor result = (ClassDescriptor) descriptorTable.get(clazz.getName());
if (result == null)
{
Class superClass = clazz.getSuperclass();
// only recurse if the superClass is not java.lang.Object
if (superClass != null)
{
result = discoverDescriptor(superClass);
}
if (result == null)
{
// we're also checking the interfaces as there could be normal
// mappings for them in the repository (using factory-class,
// factory-method, and the property field accessor)
Class[] interfaces = clazz.getInterfaces();
if ((interfaces != null) && (interfaces.length > 0))
{
for (int idx = 0; (idx < interfaces.length) && (result == null); idx++)
{
result = discoverDescriptor(interfaces[idx]);
}
}
}
if (result != null)
{
/**
* Kuali Foundation modification -- 6/19/2009
*/
synchronized (descriptorTable) {
/**
* End of Kuali Foundation modification
*/
descriptorTable.put(clazz.getName(), result);
/**
* Kuali Foundation modification -- 6/19/2009
*/
}
/**
* End of Kuali Foundation modification
*/
}
}
return result;
} | [
"Internal method for recursivly searching for a class descriptor that avoids\nclass loading when we already have a class object.\n\n@param clazz The class whose descriptor we need to find\n@return ClassDescriptor for <code>clazz</code> or <code>null</code>\nif no ClassDescriptor could be located."
] | [
"Shuts down the server. Active connections are not affected.",
"Get a File path list from configuration.\n\n@param name the name of the property\n@param props the set of configuration properties\n\n@return the CanonicalFile form for the given name.",
"Checks whether every property except 'preferred' is satisfie... |
@Override
public boolean containsKey(Object key) {
// key could be not in original or in deltaMap
// key could be not in original but in deltaMap
// key could be in original but removed from deltaMap
// key could be in original but mapped to something else in deltaMap
Object value = deltaMap.get(key);
if (value == null) {
return originalMap.containsKey(key);
}
if (value == removedValue) {
return false;
}
return true;
} | [
"This is more expensive.\n\n@param key key whose presence in this map is to be tested.\n@return <tt>true</tt> if this map contains a mapping for the specified\nkey."
] | [
"Gets the effects of this action.\n\n@return the effects. Will not be {@code null}",
"Registers the parameter for the value formatter for the given variable and puts\nit's implementation in the parameters map.\n@param djVariable\n@param variableName",
"Returns a flag represented as a String, indicating if\nthe ... |
static Object getLCState(StateManagerInternal sm)
{
// unfortunately the LifeCycleState classes are package private.
// so we have to do some dirty reflection hack to access them
try
{
Field myLC = sm.getClass().getDeclaredField("myLC");
myLC.setAccessible(true);
return myLC.get(sm);
}
catch (NoSuchFieldException e)
{
return e;
}
catch (IllegalAccessException e)
{
return e;
}
} | [
"obtains the internal JDO lifecycle state of the input StatemanagerInternal.\nThis Method is helpful to display persistent objects internal state.\n@param sm the StateManager to be inspected\n@return the LifeCycleState of a StateManager instance"
] | [
"Log a fatal message.",
"Write the standard set of day types.\n\n@param calendars parent collection of calendars",
"Creates the server setup, depending on the protocol flags.\n\n@return the configured server setups.",
"Add precedence -10 because we need that ContainerRegistry is available in the Arquillian sc... |
void lockInterruptibly(final Integer permit) throws InterruptedException {
if (permit == null) {
throw new IllegalArgumentException();
}
sync.acquireInterruptibly(permit);
} | [
"Acquire the exclusive lock allowing the acquisition to be interrupted.\n@param permit - the permit Integer for this operation. May not be {@code null}.\n@throws InterruptedException - if the acquiring thread is interrupted.\n@throws IllegalArgumentException if {@code permit} is null."
] | [
"Returns the complete property list of a class\n@param c the class\n@return the property list of the class",
"Main method of this class related to RecyclerView widget. This method is the responsible of\ncreate a new Renderer instance with all the needed information to implement the rendering.\nThis method will va... |
public Value get(Object key) {
/* If the length is under and we are asking for the key, then just look for the key. Don't build the map. */
if (map == null && items.length < 20) {
for (Object item : items) {
MapItemValue miv = (MapItemValue) item;
if (key.equals(miv.name.toValue())) {
return miv.value;
}
}
return null;
} else {
if (map == null) buildIfNeededMap();
return map.get(key);
}
} | [
"Get the items for the key.\n\n@param key\n@return the items for the given key"
] | [
"Execute a request\n\n@param httpMethodProxyRequest\n@param httpServletRequest\n@param httpServletResponse\n@param history\n@throws Exception",
"Call the Yahoo! PlaceFinder service for a result.\n\n@param q\nsearch string\n@param maxRows\nmax number of rows in result, or 0 for all\n@param locale\nlocale for strin... |
public Metadata createMetadata(String templateName, String scope, Metadata metadata) {
URL url = METADATA_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), scope, templateName);
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "POST");
request.addHeader("Content-Type", "application/json");
request.setBody(metadata.toString());
BoxJSONResponse response = (BoxJSONResponse) request.send();
return new Metadata(JsonObject.readFrom(response.getJSON()));
} | [
"Creates metadata on this folder using a specified scope and template.\n\n@param templateName the name of the metadata template.\n@param scope the scope of the template (usually \"global\" or \"enterprise\").\n@param metadata the new metadata values.\n@return the metadata returned from the server."
] | [
"Loads configuration from File. Later loads have lower priority.\n\n@param file File to load from\n@since 1.2.0",
"Look at the comments on cluster variable to see why this is problematic",
"Reset the pool of resources for a specific destination. Idle resources\nwill be destroyed. Checked out resources that are ... |
public synchronized Object removeRoleMapping(final String roleName) {
/*
* Would not expect this to happen during boot so don't offer the 'immediate' optimisation.
*/
HashMap<String, RoleMappingImpl> newRoles = new HashMap<String, RoleMappingImpl>(roleMappings);
if (newRoles.containsKey(roleName)) {
RoleMappingImpl removed = newRoles.remove(roleName);
Object removalKey = new Object();
removedRoles.put(removalKey, removed);
roleMappings = Collections.unmodifiableMap(newRoles);
return removalKey;
}
return null;
} | [
"Remove a role from the list of defined roles.\n\n@param roleName - The name of the role to be removed.\n@return A key that can be used to undo the removal."
] | [
"Request a scoped transactional token.\n@param accessToken application access token.\n@param scope scope of transactional token.\n@return a BoxAPIConnection which can be used to perform transactional requests.",
"Obtains a local date in Discordian calendar system from the\nera, year-of-era and day-of-year fields.... |
private static long getVersionId(String versionDir) {
try {
return Long.parseLong(versionDir.replace("version-", ""));
} catch(NumberFormatException e) {
logger.trace("Cannot parse version directory to obtain id " + versionDir);
return -1;
}
} | [
"Extracts the version id from a string\n\n@param versionDir The string\n@return Returns the version id of the directory, else -1"
] | [
"Replace error msg.\n\n@param origMsg\nthe orig msg\n@return the string",
"Get the column name from the indirection table.\n@param mnAlias\n@param path",
"Retrieves state and metrics information for individual channel.\n\n@param name channel name\n@return channel information",
"Convenience method for retrievi... |
public static Thread addShutdownHook(final Process process) {
final Thread thread = new Thread(new Runnable() {
@Override
public void run() {
if (process != null) {
process.destroy();
try {
process.waitFor();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
});
thread.setDaemon(true);
Runtime.getRuntime().addShutdownHook(thread);
return thread;
} | [
"Adds a shutdown hook for the process.\n\n@param process the process to add a shutdown hook for\n\n@return the thread set as the shutdown hook\n\n@throws java.lang.SecurityException If a security manager is present and it denies {@link\njava.lang.RuntimePermission <code>RuntimePermission(\"shutdownHooks\")</code>}"... | [
"This method is used to automatically generate a value\nfor the WBS field of this task.\n\n@param parent Parent Task",
"change server state between OFFLINE_SERVER and NORMAL_SERVER\n\n@param setToOffline True if set to OFFLINE_SERVER",
"If requested, adjust the bounds to the nearest scale and the map size.\n\n@... |
public ResponseOnSingeRequest onComplete(Response response) {
cancelCancellable();
try {
Map<String, List<String>> responseHeaders = null;
if (responseHeaderMeta != null) {
responseHeaders = new LinkedHashMap<String, List<String>>();
if (responseHeaderMeta.isGetAll()) {
for (Map.Entry<String, List<String>> header : response
.getHeaders()) {
responseHeaders.put(header.getKey().toLowerCase(Locale.ROOT), header.getValue());
}
} else {
for (String key : responseHeaderMeta.getKeys()) {
if (response.getHeaders().containsKey(key)) {
responseHeaders.put(key.toLowerCase(Locale.ROOT),
response.getHeaders().get(key));
}
}
}
}
int statusCodeInt = response.getStatusCode();
String statusCode = statusCodeInt + " " + response.getStatusText();
String charset = ParallecGlobalConfig.httpResponseBodyCharsetUsesResponseContentType &&
response.getContentType()!=null ?
AsyncHttpProviderUtils.parseCharset(response.getContentType())
: ParallecGlobalConfig.httpResponseBodyDefaultCharset;
if(charset == null){
getLogger().error("charset is not provided from response content type. Use default");
charset = ParallecGlobalConfig.httpResponseBodyDefaultCharset;
}
reply(response.getResponseBody(charset), false, null, null, statusCode,
statusCodeInt, responseHeaders);
} catch (IOException e) {
getLogger().error("fail response.getResponseBody " + e);
}
return null;
} | [
"On complete.\nSave response headers when needed.\n\n@param response\nthe response\n@return the response on single request"
] | [
"Convert gallery name to not found error key.\n@param gallery gallery name for example \"downloadgallery\"\n@return key as string \"ERR_REASON_NO_DOWNLOADGALLERY_0\"",
"The max possible width can be calculated doing the sum of of the inner cells and its totals\n@param crosstabColumn\n@return",
"Adds the conten... |
protected void associateBatched(Collection owners, Collection children)
{
ObjectReferenceDescriptor ord = getObjectReferenceDescriptor();
ClassDescriptor cld = getOwnerClassDescriptor();
Object owner;
Object relatedObject;
Object fkValues[];
Identity id;
PersistenceBroker pb = getBroker();
PersistentField field = ord.getPersistentField();
Class topLevelClass = pb.getTopLevelClass(ord.getItemClass());
HashMap childrenMap = new HashMap(children.size());
for (Iterator it = children.iterator(); it.hasNext(); )
{
relatedObject = it.next();
childrenMap.put(pb.serviceIdentity().buildIdentity(relatedObject), relatedObject);
}
for (Iterator it = owners.iterator(); it.hasNext(); )
{
owner = it.next();
fkValues = ord.getForeignKeyValues(owner,cld);
if (isNull(fkValues))
{
field.set(owner, null);
continue;
}
id = pb.serviceIdentity().buildIdentity(null, topLevelClass, fkValues);
relatedObject = childrenMap.get(id);
field.set(owner, relatedObject);
}
} | [
"Associate the batched Children with their owner object.\nLoop over owners"
] | [
"convenience factory method for the most usual case.",
"Starts given docker machine.\n\n@param cliPathExec\nlocation of docker-machine or null if it is on PATH.\n@param machineName\nto be started.",
"Append the path to the StringBuilder.\n\n@param result the string builder to add the path to.",
"Creates an ob... |
@NonNull public CharSequence getQuery() {
if (searchView != null) {
return searchView.getQuery();
} else if (supportView != null) {
return supportView.getQuery();
}
throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
} | [
"Returns the query string currently in the text field.\n\n@return the query string"
] | [
"Await a state.\n\n@param expected the expected state\n@return {@code true} if the state was reached, {@code false} otherwise",
"Called when a ParentViewHolder has triggered an expansion for it's parent\n\n@param flatParentPosition the position of the parent that is calling to be expanded",
"Use this API to del... |
public static authenticationvserver_stats get(nitro_service service, String name) throws Exception{
authenticationvserver_stats obj = new authenticationvserver_stats();
obj.set_name(name);
authenticationvserver_stats response = (authenticationvserver_stats) obj.stat_resource(service);
return response;
} | [
"Use this API to fetch statistics of authenticationvserver_stats resource of given name ."
] | [
"Emit an enum event with parameters supplied.\n\nThis will invoke all {@link SimpleEventListener} bound to the specific\nenum value and all {@link SimpleEventListener} bound to the enum class\ngiven the listeners has the matching argument list.\n\nFor example, given the following enum definition:\n\n```java\npublic... |
public T find(AbstractProject<?, ?> project, Class<T> type) {
// First check that the Flexible Publish plugin is installed:
if (Jenkins.getInstance().getPlugin(FLEXIBLE_PUBLISH_PLUGIN) != null) {
// Iterate all the project's publishers and find the flexible publisher:
for (Publisher publisher : project.getPublishersList()) {
// Found the flexible publisher:
if (publisher instanceof FlexiblePublisher) {
// See if it wraps a publisher of the specified type and if it does, return it:
T pub = getWrappedPublisher(publisher, type);
if (pub != null) {
return pub;
}
}
}
}
return null;
} | [
"Gets the publisher of the specified type, if it is wrapped by the \"Flexible Publish\" publisher in a project.\nNull is returned if no such publisher is found.\n@param project The project\n@param type The type of the publisher"
] | [
"Gets an enhanced protection domain for a proxy based on the given protection domain.\n@param domain the given protection domain\n@return protection domain enhanced with \"accessDeclaredMembers\" runtime permission",
"Performs the BFS and gives the results to a distributor to distribute\n\n@param distributor the ... |
public ValueContainer[] getKeyValues(ClassDescriptor cld, Identity oid) throws PersistenceBrokerException
{
return getKeyValues(cld, oid, true);
} | [
"Return primary key values of given Identity object.\n\n@param cld\n@param oid\n@return Object[]\n@throws PersistenceBrokerException"
] | [
"Converts a DTO attribute into a generic attribute object.\n\n@param attribute\nThe DTO attribute.\n@return The server side attribute representation. As we don't know at this point what kind of object the\nattribute is (that's a problem for the <code>FeatureModel</code>), we return an <code>Object</code>.",
"If t... |
private void updateBundleDescriptorContent() throws CmsXmlException {
if (m_descContent.hasLocale(Descriptor.LOCALE)) {
m_descContent.removeLocale(Descriptor.LOCALE);
}
m_descContent.addLocale(m_cms, Descriptor.LOCALE);
int i = 0;
Property<Object> descProp;
String desc;
Property<Object> defaultValueProp;
String defaultValue;
Map<String, Item> keyItemMap = getKeyItemMap();
List<String> keys = new ArrayList<String>(keyItemMap.keySet());
Collections.sort(keys, CmsCaseInsensitiveStringComparator.getInstance());
for (Object key : keys) {
if ((null != key) && !key.toString().isEmpty()) {
m_descContent.addValue(m_cms, Descriptor.N_MESSAGE, Descriptor.LOCALE, i);
i++;
String messagePrefix = Descriptor.N_MESSAGE + "[" + i + "]/";
m_descContent.getValue(messagePrefix + Descriptor.N_KEY, Descriptor.LOCALE).setStringValue(
m_cms,
(String)key);
descProp = keyItemMap.get(key).getItemProperty(TableProperty.DESCRIPTION);
if ((null != descProp) && (null != descProp.getValue())) {
desc = descProp.getValue().toString();
m_descContent.getValue(messagePrefix + Descriptor.N_DESCRIPTION, Descriptor.LOCALE).setStringValue(
m_cms,
desc);
}
defaultValueProp = keyItemMap.get(key).getItemProperty(TableProperty.DEFAULT);
if ((null != defaultValueProp) && (null != defaultValueProp.getValue())) {
defaultValue = defaultValueProp.getValue().toString();
m_descContent.getValue(messagePrefix + Descriptor.N_DEFAULT, Descriptor.LOCALE).setStringValue(
m_cms,
defaultValue);
}
}
}
} | [
"Update the descriptor content with values from the editor.\n@throws CmsXmlException thrown if update fails due to a wrong XML structure (should never happen)"
] | [
"region Override Methods",
"Increment the version info associated with the given node\n\n@param node The node",
"Empirical data from 3.x, actual =40",
"Use this API to fetch all the route6 resources that are configured on netscaler.",
"Convert the value to requested quoting convention.\nConversion involving... |
protected static boolean isTargetOp( TokenList.Token token , Symbol[] ops ) {
Symbol c = token.symbol;
for (int i = 0; i < ops.length; i++) {
if( c == ops[i])
return true;
}
return false;
} | [
"Checks to see if the token is in the list of allowed character operations. Used to apply order of operations\n@param token Token being checked\n@param ops List of allowed character operations\n@return true for it being in the list and false for it not being in the list"
] | [
"Construct a new uri by replacing query parameters in initialUri with the query parameters provided.\n\n@param initialUri the initial/template URI\n@param queryParams the new query parameters.",
"Gets the Json Array representation of the given list of strings.\n@param keys List of strings\n@return the JsonArray r... |
public static File copyResourceToLocalFile(String sourceResource, String destFileName) throws Exception {
try {
Resource keystoreFile = new ClassPathResource(sourceResource);
InputStream in = keystoreFile.getInputStream();
File outKeyStoreFile = new File(destFileName);
FileOutputStream fop = new FileOutputStream(outKeyStoreFile);
byte[] buf = new byte[512];
int num;
while ((num = in.read(buf)) != -1) {
fop.write(buf, 0, num);
}
fop.flush();
fop.close();
in.close();
return outKeyStoreFile;
} catch (IOException ioe) {
throw new Exception("Could not copy keystore file: " + ioe.getMessage());
}
} | [
"Copies file from a resource to a local temp file\n\n@param sourceResource\n@return Absolute filename of the temp file\n@throws Exception"
] | [
"Add the declarationSRef to the DeclarationsManager.\nCalculate the matching of the Declaration with the DeclarationFilter of the\nLinker.\n\n@param declarationSRef the ServiceReference<D> of the Declaration",
"Remove a PropertyChangeListener for a specific property from this node.\nThis functionality has. Please... |
public float getPositionY(int vertex) {
if (!hasPositions()) {
throw new IllegalStateException("mesh has no positions");
}
checkVertexIndexBounds(vertex);
return m_vertices.getFloat((vertex * 3 + 1) * SIZEOF_FLOAT);
} | [
"Returns the y-coordinate of a vertex position.\n\n@param vertex the vertex index\n@return the y coordinate"
] | [
"Define the set of extensions.\n\n@param extensions\n@return self",
"Compute costs.",
"Look-up the results data for a particular test class.",
"Obtains a Pax zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Pax zoned date-time, not null\... |
private String getSite(CmsObject cms, CmsFavoriteEntry entry) {
CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(entry.getSiteRoot());
Item item = m_sitesContainer.getItem(entry.getSiteRoot());
if (item != null) {
return (String)(item.getItemProperty("caption").getValue());
}
String result = entry.getSiteRoot();
if (site != null) {
if (!CmsStringUtil.isEmpty(site.getTitle())) {
result = site.getTitle();
}
}
return result;
} | [
"Gets the site label for the entry.\n\n@param cms the current CMS context\n@param entry the entry\n@return the site label for the entry"
] | [
"Get User application properties\nGet application properties of a user\n@param userId User Id (required)\n@param aid Application ID (optional)\n@return PropertiesEnvelope\n@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body",
"Access an attribute.\n\n@param type... |
private void registerPerformanceMonitor(String beanName,
BeanDefinitionRegistry registry) {
String perfMonitorName = beanName + "PerformanceMonitor";
if (!registry.containsBeanDefinition(perfMonitorName)) {
BeanDefinitionBuilder initializer =
BeanDefinitionBuilder.rootBeanDefinition(PerformanceMonitorBean.class);
registry.registerBeanDefinition(perfMonitorName, initializer.getBeanDefinition());
}
} | [
"Register a new PerformanceMonitor with Spring if it does not already exist.\n\n@param beanName The name of the bean that this performance monitor is wrapped around\n@param registry The registry where all the spring beans are registered"
] | [
"Adds a new child widget to the panel, attaching its Element to the\nspecified container Element.\n\n@param child the child widget to be added\n@param container the element within which the child will be contained",
"Get the Exif data for the photo.\n\nThe calling user must have permission to view the photo.\n\nT... |
private <T> T populateBean(final T resultBean, final String[] nameMapping) {
// map each column to its associated field on the bean
for( int i = 0; i < nameMapping.length; i++ ) {
final Object fieldValue = processedColumns.get(i);
// don't call a set-method in the bean if there is no name mapping for the column or no result to store
if( nameMapping[i] == null || fieldValue == null ) {
continue;
}
// invoke the setter on the bean
Method setMethod = cache.getSetMethod(resultBean, nameMapping[i], fieldValue.getClass());
invokeSetter(resultBean, setMethod, fieldValue);
}
return resultBean;
} | [
"Populates the bean by mapping the processed columns to the fields of the bean.\n\n@param resultBean\nthe bean to populate\n@param nameMapping\nthe name mappings\n@return the populated bean\n@throws SuperCsvReflectionException\nif there was a reflection exception while populating the bean"
] | [
"Execute for result.\n\n@param executionContext the execution context\n@return the result\n@throws IOException for any error",
"Adds the given some-value restriction to the list of restrictions that\nshould still be serialized. The given resource will be used as a subject.\n\n@param subject\n@param propertyUri\n@... |
public synchronized void stop() {
if (m_thread != null) {
long timeBeforeShutdownWasCalled = System.currentTimeMillis();
JLANServer.shutdownServer(new String[] {});
while (m_thread.isAlive()
&& ((System.currentTimeMillis() - timeBeforeShutdownWasCalled) < MAX_SHUTDOWN_WAIT_MILLIS)) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
// ignore
}
}
}
} | [
"Tries to stop the JLAN server and return after it is stopped, but will also return if the thread hasn't stopped after MAX_SHUTDOWN_WAIT_MILLIS."
] | [
"Combines adjacent blocks of the same type.",
"Add a console pipeline to the Redwood handler tree,\nprinting to stderr.\nCalling this multiple times will result in messages being printed\nmultiple times.\n@return this",
"Configures a text field to look like a filter box for a table.\n\n@param searchBox the text... |
private void onRead0() {
assert inWire.startUse();
ensureCapacity();
try {
while (!inWire.bytes().isEmpty()) {
try (DocumentContext dc = inWire.readingDocument()) {
if (!dc.isPresent())
return;
try {
if (YamlLogging.showServerReads())
logYaml(dc);
onRead(dc, outWire);
onWrite(outWire);
} catch (Exception e) {
Jvm.warn().on(getClass(), "inWire=" + inWire.getClass() + ",yaml=" + Wires.fromSizePrefixedBlobs(dc), e);
}
}
}
} finally {
assert inWire.endUse();
}
} | [
"process all messages in this batch, provided there is plenty of output space."
] | [
"Mark root of this task task group depends on the given task group's root.\nThis ensure this task group's root get picked for execution only after the completion\nof all tasks in the given group.\n\n@param dependencyTaskGroup the task group that this task group depends on",
"Obtain parameters from query\n\n@param... |
static void merge(Map<ConfigurationKey, Object> original, Map<ConfigurationKey, Object> toMerge, String mergedSourceDescription) {
for (Entry<ConfigurationKey, Object> entry : toMerge.entrySet()) {
Object existing = original.get(entry.getKey());
if (existing != null) {
ConfigurationLogger.LOG.configurationKeyAlreadySet(entry.getKey().get(), existing, entry.getValue(), mergedSourceDescription);
} else {
original.put(entry.getKey(), entry.getValue());
}
}
} | [
"Merge two maps of configuration properties. If the original contains a mapping for the same key, the new mapping is ignored.\n\n@param original\n@param toMerge"
] | [
"Write the domain controller's data to an output stream.\n\n@param outstream the output stream\n@throws Exception",
"Registers the resource to the parent deployment resource. The model returned is that of the resource parameter.\n\n@param subsystemName the subsystem name\n@param resource the resource to be u... |
public static final FieldType getInstance(int fieldID)
{
FieldType result;
int prefix = fieldID & 0xFFFF0000;
int index = fieldID & 0x0000FFFF;
switch (prefix)
{
case MPPTaskField.TASK_FIELD_BASE:
{
result = MPPTaskField.getInstance(index);
if (result == null)
{
result = getPlaceholder(TaskField.class, index);
}
break;
}
case MPPResourceField.RESOURCE_FIELD_BASE:
{
result = MPPResourceField.getInstance(index);
if (result == null)
{
result = getPlaceholder(ResourceField.class, index);
}
break;
}
case MPPAssignmentField.ASSIGNMENT_FIELD_BASE:
{
result = MPPAssignmentField.getInstance(index);
if (result == null)
{
result = getPlaceholder(AssignmentField.class, index);
}
break;
}
case MPPConstraintField.CONSTRAINT_FIELD_BASE:
{
result = MPPConstraintField.getInstance(index);
if (result == null)
{
result = getPlaceholder(ConstraintField.class, index);
}
break;
}
default:
{
result = getPlaceholder(null, index);
break;
}
}
return result;
} | [
"Retrieve a FieldType instance based on an ID value from\nan MPP9 or MPP12 file.\n\n@param fieldID field ID\n@return FieldType instance"
] | [
"Sets a header per-request\n\n@param key Header key\n@param value Header value\n@return The request itself",
"This is a temporary measure until we have a type-safe solution for\nretrieving serializers from a SerializerFactory. It avoids warnings all\nover the codebase while making it easy to verify who calls it... |
public static final Date getTimestampFromTenths(byte[] data, int offset)
{
long ms = ((long) getInt(data, offset)) * 6000;
return (DateHelper.getTimestampFromLong(EPOCH + ms));
} | [
"Reads a combined date and time value expressed in tenths of a minute.\n\n@param data byte array of data\n@param offset location of data as offset into the array\n@return time value"
] | [
"Merges the two classes into a single class. The smaller class is\nremoved, while the largest class is kept.",
"Use this API to fetch dnssuffix resource of given name .",
"Maps a field index to a ResourceField instance.\n\n@param fields array of fields used as the basis for the mapping.\n@param index required f... |
public float[] getFloatArray(String attributeName)
{
float[] array = NativeVertexBuffer.getFloatArray(getNative(), attributeName);
if (array == null)
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return array;
} | [
"Retrieves a vertex attribute as a float array.\nThe attribute name must be one of the\nattributes named in the descriptor passed to the constructor.\n@param attributeName name of the attribute to update\n@throws IllegalArgumentException if attribute name not in descriptor vertex attribute is not <i>float</i>\n@see... | [
"Add new control at the control bar with specified touch listener, resource and position.\nSize of control bar is updated based on new number of controls.\n@param name name of the control to remove\n@param resId the control face\n@param listener touch listener\n@param position control position in the bar",
"Merge... |
public int getVersion() {
ResultSet resultSet = session.execute(format(VERSION_QUERY, getTableName()));
Row result = resultSet.one();
if (result == null) {
return 0;
}
return result.getInt(0);
} | [
"Gets the current version of the database schema. This version is taken\nfrom the migration table and represent the latest successful entry.\n\n@return the current schema version"
] | [
"Sets the request body to the contents of a String.\n\n<p>If the contents of the body are large, then it may be more efficient to use an {@link InputStream} instead of\na String. Using a String requires that the entire body be in memory before sending the request.</p>\n\n@param body a String containing the contents... |
public static int getXPathLocation(String dom, String xpath) {
String dom_lower = dom.toLowerCase();
String xpath_lower = xpath.toLowerCase();
String[] elements = xpath_lower.split("/");
int pos = 0;
int temp;
int number;
for (String element : elements) {
if (!element.isEmpty() && !element.startsWith("@") && !element.contains("()")) {
if (element.contains("[")) {
try {
number =
Integer.parseInt(element.substring(element.indexOf("[") + 1,
element.indexOf("]")));
} catch (NumberFormatException e) {
return -1;
}
} else {
number = 1;
}
for (int i = 0; i < number; i++) {
// find new open element
temp = dom_lower.indexOf("<" + stripEndSquareBrackets(element), pos);
if (temp > -1) {
pos = temp + 1;
// if depth>1 then goto end of current element
if (number > 1 && i < number - 1) {
pos =
getCloseElementLocation(dom_lower, pos,
stripEndSquareBrackets(element));
}
}
}
}
}
return pos - 1;
} | [
"returns position of xpath element which match the expression xpath in the String dom.\n\n@param dom the Document to search in\n@param xpath the xpath query\n@return position of xpath element, if fails returns -1"
] | [
"Verifies that the connection is still alive. Returns true if it\nis, false if it is not. If the connection is broken we try\nclosing everything, too, so that the caller need only open a new\nconnection.",
"Gets the progress from response.\n\n@param myResponse\nthe my response\n@return the progress from response"... |
public CrosstabBuilder setColumnStyles(Style headerStyle, Style totalStyle, Style totalHeaderStyle) {
crosstab.setColumnHeaderStyle(headerStyle);
crosstab.setColumnTotalheaderStyle(totalHeaderStyle);
crosstab.setColumnTotalStyle(totalStyle);
return this;
} | [
"Should be called after all columns have been created\n@param headerStyle\n@param totalStyle\n@param totalHeaderStyle\n@return"
] | [
"Return all valid tenors for a given moneyness and maturity.\n\n@param moneynessBP The moneyness in bp for which to get the tenors.\n@param maturityInMonths The maturities in months for which to get the tenors.\n@return The tenors in months.",
"any possible bean invocations from other ADV observers",
"Check tha... |
private static boolean isBinary(InputStream in) {
try {
int size = in.available();
if (size > 1024) size = 1024;
byte[] data = new byte[size];
in.read(data);
in.close();
int ascii = 0;
int other = 0;
for (int i = 0; i < data.length; i++) {
byte b = data[i];
if (b < 0x09) return true;
if (b == 0x09 || b == 0x0A || b == 0x0C || b == 0x0D) ascii++;
else if (b >= 0x20 && b <= 0x7E) ascii++;
else other++;
}
return other != 0 && 100 * other / (ascii + other) > 95;
} catch (IOException e) {
throw E.ioException(e);
}
} | [
"Guess whether given file is binary. Just checks for anything under 0x09."
] | [
"Get the element value in the list by index\n@param index the position in the list from which to get the element\n@return the element value",
"Writes task baseline data.\n\n@param xmlTask MSPDI task\n@param mpxjTask MPXJ task",
"Returns the z-coordinate of a vertex normal.\n\n@param vertex the vertex index\n@re... |
public static nsip6[] get(nitro_service service) throws Exception{
nsip6 obj = new nsip6();
nsip6[] response = (nsip6[])obj.get_resources(service);
return response;
} | [
"Use this API to fetch all the nsip6 resources that are configured on netscaler."
] | [
"Get a value from a date metadata field.\n@param path the key path in the metadata object. Must be prefixed with a \"/\".\n@return the metadata value as a Date.\n@throws ParseException when the value cannot be parsed as a valid date",
"Finds the Widget in hierarchy\n@param name Name of the child to find\n@return... |
private void postTraversalProcessing() {
int nc1 = treeSize;
info[KR] = new int[leafCount];
info[RKR] = new int[leafCount];
int lc = leafCount;
int i = 0;
// compute left-most leaf descendants
// go along the left-most path, remember each node and assign to it the path's
// leaf
// compute right-most leaf descendants (in reversed postorder)
for (i = 0; i < treeSize; i++) {
if (paths[LEFT][i] == -1) {
info[POST2_LLD][i] = i;
} else {
info[POST2_LLD][i] = info[POST2_LLD][paths[LEFT][i]];
}
if (paths[RIGHT][i] == -1) {
info[RPOST2_RLD][treeSize - 1 - info[POST2_PRE][i]] =
(treeSize - 1 - info[POST2_PRE][i]);
} else {
info[RPOST2_RLD][treeSize - 1 - info[POST2_PRE][i]] =
info[RPOST2_RLD][treeSize - 1
- info[POST2_PRE][paths[RIGHT][i]]];
}
}
// compute key root nodes
// compute reversed key root nodes (in revrsed postorder)
boolean[] visited = new boolean[nc1];
boolean[] visitedR = new boolean[nc1];
Arrays.fill(visited, false);
int k = lc - 1;
int kR = lc - 1;
for (i = nc1 - 1; i >= 0; i--) {
if (!visited[info[POST2_LLD][i]]) {
info[KR][k] = i;
visited[info[POST2_LLD][i]] = true;
k--;
}
if (!visitedR[info[RPOST2_RLD][i]]) {
info[RKR][kR] = i;
visitedR[info[RPOST2_RLD][i]] = true;
kR--;
}
}
// compute minimal key roots for every subtree
// compute minimal reversed key roots for every subtree (in reversed postorder)
int parent = -1;
int parentR = -1;
for (i = 0; i < leafCount; i++) {
parent = info[KR][i];
while (parent > -1 && info[POST2_MIN_KR][parent] == -1) {
info[POST2_MIN_KR][parent] = i;
parent = info[POST2_PARENT][parent];
}
parentR = info[RKR][i];
while (parentR > -1 && info[RPOST2_MIN_RKR][parentR] == -1) {
info[RPOST2_MIN_RKR][parentR] = i;
parentR =
info[POST2_PARENT][info[RPOST2_POST][parentR]]; // get parent's postorder
if (parentR > -1) {
parentR = treeSize - 1 - info[POST2_PRE][parentR]; // if parent exists get its
// rev. postorder
}
}
}
} | [
"Gathers information, that couldn't be collected while tree traversal."
] | [
"Read the set of property files. Keys and Values are automatically validated and converted.\n\n@param resourceLoader\n@return all the properties from the weld.properties file",
"With this impl, it only returns the same credentials once. Otherwise it's possible that a loop will occur.\nWhen server returns status c... |
public void invalidate() {
synchronized (mMeasuredChildren) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "invalidate all [%d]", mMeasuredChildren.size());
mMeasuredChildren.clear();
}
} | [
"Invalidate layout setup."
] | [
"this class loader interface can be used by other plugins to lookup\nresources from the bundles. A temporary class loader interface is set\nduring other configuration loading as well\n\n@return ClassLoaderInterface (BundleClassLoaderInterface)",
"Injects EJBs and other EE resources.\n\n@param resourceInjectionsHi... |
@PostConstruct
protected void postConstruct() {
if (null == authenticationServices) {
authenticationServices = new ArrayList<AuthenticationService>();
}
if (!excludeDefault) {
authenticationServices.add(staticAuthenticationService);
}
} | [
"Finish initialization of the configuration."
] | [
"Calculates the bar width and bar margin based on the _DataSize and settings and starts the boundary\ncalculation in child classes.\n@param _DataSize Amount of data sets",
"the applications main loop.",
"Dumps the partition IDs per node in terms of zone n-ary type.\n\n@param cluster\n@param storeRoutingPlan\n@r... |
private boolean exceedsScreenDimensions(InternalFeature f, double scale) {
Envelope env = f.getBounds();
return (env.getWidth() * scale > MAXIMUM_TILE_COORDINATE) ||
(env.getHeight() * scale > MAXIMUM_TILE_COORDINATE);
} | [
"The test that checks if clipping is needed.\n\n@param f\nfeature to test\n@param scale\nscale\n@return true if clipping is needed"
] | [
"Connects to the comm port and starts send and receive threads.\n@param serialPortName the port name to open\n@throws SerialInterfaceException when a connection error occurs.",
"The context returned by this method may be later reused for other interception types.\n\n@param interceptionModel\n@param ctx\n@param ma... |
public ReferrerList getPhotosetReferrers(Date date, String domain, String photosetId, int perPage, int page) throws FlickrException {
return getReferrers(METHOD_GET_PHOTOSET_REFERRERS, domain, "photoset_id", photosetId, date, perPage, page);
} | [
"Get a list of referrers from a given domain to a photoset.\n\n@param date\n(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will\nautomatically be rounded down to the start of the day.\n@param domain\n(Required) The domain to retu... | [
"Open a database and build a set of table names.\n\n@param url database URL\n@return set containing table names",
"Adjusts all links in the target folder that point to the source folder\nso that they are kept \"relative\" in the target folder where possible.\n\nIf a link is found from the target folder to the sou... |
private void initDeactivationPanel() {
m_deactivationPanel.setVisible(false);
m_deactivationText.setText(Messages.get().key(Messages.GUI_SERIALDATE_DEACTIVE_TEXT_0));
} | [
"Initialize elements of the panel displayed for the deactivated widget."
] | [
"Rollback the last applied patch.\n\n@param contentPolicy the content policy\n@param resetConfiguration whether to reset the configuration\n@param modification the installation modification\n@return the patching result\n@throws PatchingException",
"Encodes the given source into an encoded String using ... |
public static final PatchOperationTarget createLocal(final File jbossHome, List<File> moduleRoots, List<File> bundlesRoots) throws IOException {
final PatchTool tool = PatchTool.Factory.createLocalTool(jbossHome, moduleRoots, bundlesRoots);
return new LocalPatchOperationTarget(tool);
} | [
"Create a local target.\n\n@param jbossHome the jboss home\n@param moduleRoots the module roots\n@param bundlesRoots the bundle roots\n@return the local target\n@throws IOException"
] | [
"Detects if the current device is a mobile device.\nThis method catches most of the popular modern devices.\nExcludes Apple iPads and other modern tablets.\n@return detection of any mobile device using the quicker method",
"Create a unique signature for this shader.\nThe signature for simple shaders is just the c... |
public URL buildWithQuery(String base, String queryString, Object... values) {
String urlString = String.format(base + this.template, values) + queryString;
URL url = null;
try {
url = new URL(urlString);
} catch (MalformedURLException e) {
assert false : "An invalid URL template indicates a bug in the SDK.";
}
return url;
} | [
"Build a URL with Query String and URL Parameters.\n@param base base URL\n@param queryString query string\n@param values URL Parameters\n@return URL"
] | [
"Returns the remote collection representing the given namespace.\n\n@param namespace the namespace referring to the remote collection.\n@param resultClass the {@link Class} that represents documents in the collection.\n@param <T> the type documents in the collection.\n@return the remote collection represe... |
public static gslbdomain_stats[] get(nitro_service service) throws Exception{
gslbdomain_stats obj = new gslbdomain_stats();
gslbdomain_stats[] response = (gslbdomain_stats[])obj.stat_resources(service);
return response;
} | [
"Use this API to fetch the statistics of all gslbdomain_stats resources that are configured on netscaler."
] | [
"Parse rate.\n\n@param value rate value\n@return Rate instance",
"Adds error correction data to the specified binary string, which already contains the primary data",
"used by Error template",
"Executes the given supplier within the context of a read lock.\n\n@param <E> The result type.\n@param sup The suppli... |
public boolean clearSelection(boolean requestLayout) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "clearSelection [%d]", mSelectedItemsList.size());
boolean updateLayout = false;
List<ListItemHostWidget> views = getAllHosts();
for (ListItemHostWidget host: views) {
if (host.isSelected()) {
host.setSelected(false);
updateLayout = true;
if (requestLayout) {
host.requestLayout();
}
}
}
clearSelectedItemsList();
return updateLayout;
} | [
"Clear the selection of all items.\n@param requestLayout request layout after clear selection if the flag is true, no layout\nrequested otherwise\n@return {@code true} if at least one item was deselected,\n{@code false} otherwise."
] | [
"Checks if the child is currently in ViewPort\n@param dataIndex child index\n@return true if the child is in viewport, false - otherwise",
"Converts an image in BINARY mode to RGB mode\n\n@param img image\n@return new MarvinImage instance in RGB mode",
"Log a warning for the resource at the provided address and... |
public void stopDrag() {
mPhysicsDragger.stopDrag();
mPhysicsContext.runOnPhysicsThread(new Runnable() {
@Override
public void run() {
if (mRigidBodyDragMe != null) {
NativePhysics3DWorld.stopDrag(getNative());
mRigidBodyDragMe = null;
}
}
});
} | [
"Stop the drag action."
] | [
"Populates data in this Options from the character stream.\n@param in The Reader\n@throws IOException If there is a problem reading data",
"This method returns the duplicated certificate mapped to the passed in cert, or\ncreates and returns one if no mapping has yet been performed. If a naked public\nkey has alr... |
public ProjectCalendarWeek getWorkWeek(Date date)
{
ProjectCalendarWeek week = null;
if (!m_workWeeks.isEmpty())
{
sortWorkWeeks();
int low = 0;
int high = m_workWeeks.size() - 1;
long targetDate = date.getTime();
while (low <= high)
{
int mid = (low + high) >>> 1;
ProjectCalendarWeek midVal = m_workWeeks.get(mid);
int cmp = 0 - DateHelper.compare(midVal.getDateRange().getStart(), midVal.getDateRange().getEnd(), targetDate);
if (cmp < 0)
{
low = mid + 1;
}
else
{
if (cmp > 0)
{
high = mid - 1;
}
else
{
week = midVal;
break;
}
}
}
}
if (week == null && getParent() != null)
{
// Check base calendar as well for a work week.
week = getParent().getWorkWeek(date);
}
return (week);
} | [
"Retrieve a work week which applies to this date.\n\n@param date target date\n@return work week, or null if none match this date"
] | [
"returns a proxy or a fully materialized Object from the current row of the\nunderlying resultset.",
"Shuts down a managed domain container. The servers are first stopped, then the host controller is shutdown.\n\n@param client the client used to communicate with the server\n@param timeout the graceful shutdown t... |
private int[] changeColor() {
int[] changedPixels = new int[pixels.length];
double frequenz = 2 * Math.PI / 1020;
for (int i = 0; i < pixels.length; i++) {
int argb = pixels[i];
int a = (argb >> 24) & 0xff;
int r = (argb >> 16) & 0xff;
int g = (argb >> 8) & 0xff;
int b = argb & 0xff;
r = (int) (255 * Math.sin(frequenz * r));
b = (int) (-255 * Math.cos(frequenz * b) + 255);
changedPixels[i] = (a << 24) | (r << 16) | (g << 8) | b;
}
return changedPixels;
} | [
"changes the color of the image - more red and less blue\n\n@return new pixel array"
] | [
"running in App Engine",
"Adds a free connection.\n\n@param connectionHandle\n@throws SQLException on error",
"Divide two complex numbers.\n\n@param z1 Complex Number.\n@param z2 Complex Number.\n@return Returns new ComplexNumber instance containing the divide of specified complex numbers.",
"Use this API to ... |
public boolean detectNintendo() {
if ((userAgent.indexOf(deviceNintendo) != -1)
|| (userAgent.indexOf(deviceWii) != -1)
|| (userAgent.indexOf(deviceNintendoDs) != -1)) {
return true;
}
return false;
} | [
"Detects if the current device is a Nintendo game device.\n@return detection of Nintendo"
] | [
"Log block data.\n\n@param blockIndex current block index\n@param startIndex start index\n@param blockLength length",
"Cancel on target hosts.\n\n@param targetHosts\nthe target hosts\n@return true, if successful",
"Get the object responsible for printing to the correct output format.\n\n@param specJson the requ... |
@Override
@SuppressWarnings("unchecked")
public ChronoLocalDateTime<PaxDate> localDateTime(TemporalAccessor temporal) {
return (ChronoLocalDateTime<PaxDate>) super.localDateTime(temporal);
} | [
"Obtains a Pax local date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Pax local date-time, not null\n@throws DateTimeException if unable to create the date-time"
] | [
"Return list of all files in the directory.\n\n@param directory target directory on file system\n@return list of files in the directory or empty list if directory is empty.",
"Execute a CLI command. This can be any command that you might execute on\nthe CLI command line, including both server-side operations and ... |
public Object getObjectByQuery(Query query) throws PersistenceBrokerException
{
Object result = null;
if (query instanceof QueryByIdentity)
{
// example obj may be an entity or an Identity
Object obj = query.getExampleObject();
if (obj instanceof Identity)
{
Identity oid = (Identity) obj;
result = getObjectByIdentity(oid);
}
else
{
// TODO: This workaround doesn't allow 'null' for PK fields
if (!serviceBrokerHelper().hasNullPKField(getClassDescriptor(obj.getClass()), obj))
{
Identity oid = serviceIdentity().buildIdentity(obj);
result = getObjectByIdentity(oid);
}
}
}
else
{
Class itemClass = query.getSearchClass();
ClassDescriptor cld = getClassDescriptor(itemClass);
/*
use OJB intern Iterator, thus we are able to close used
resources instantly
*/
OJBIterator it = getIteratorFromQuery(query, cld);
/*
arminw:
patch by Andre Clute, instead of taking the first found result
try to get the first found none null result.
He wrote:
I have a situation where an item with a certain criteria is in my
database twice -- once deleted, and then a non-deleted version of it.
When I do a PB.getObjectByQuery(), the RsIterator get's both results
from the database, but the first row is the deleted row, so my RowReader
filters it out, and do not get the right result.
*/
try
{
while (result==null && it.hasNext())
{
result = it.next();
}
} // make sure that we close the used resources
finally
{
if(it != null) it.releaseDbResources();
}
}
return result;
} | [
"retrieve an Object by query\nI.e perform a SELECT ... FROM ... WHERE ... in an RDBMS"
] | [
"Helper method fro providers to fire hotkey event in a separate thread\n\n@param hotKey hotkey to fire",
"Boyer Moore scan that proceeds backwards from the end of the file looking for ENDSIG\n@throws NonScannableZipException",
"Gets information about a trashed folder that's limited to a list of specified fields... |
public void addHiDpiImage(String factor, CmsJspImageBean image) {
if (m_hiDpiImages == null) {
m_hiDpiImages = CmsCollectionsGenericWrapper.createLazyMap(new CmsScaleHiDpiTransformer());
}
m_hiDpiImages.put(factor, image);
} | [
"adds a CmsJspImageBean as hi-DPI variant to this image\n@param factor the variant multiplier, e.g. \"2x\" (the common retina multiplier)\n@param image the image to be used for this variant"
] | [
"Use this API to fetch sslcertkey_sslvserver_binding resources of given name .",
"Loads a CRF classifier from an InputStream, and returns it. This method\ndoes not buffer the InputStream, so you should have buffered it before\ncalling this method.\n\n@param in\nInputStream to load classifier from\n@return The CRF... |
public static LayersConfig getLayersConfig(final File repoRoot) throws IOException {
final File layersList = new File(repoRoot, LAYERS_CONF);
if (!layersList.exists()) {
return new LayersConfig();
}
final Properties properties = PatchUtils.loadProperties(layersList);
return new LayersConfig(properties);
} | [
"Process the layers.conf file.\n\n@param repoRoot the root\n@return the layers conf\n@throws java.io.IOException"
] | [
"Use this API to fetch ipset_nsip6_binding resources of given name .",
"Implements getAll by delegating to get.",
"Finish the initialization.\n\n@param container\n@param isShutdownHookEnabled",
"Curries a function that takes four arguments.\n\n@param function\nthe original function. May not be <code>null</cod... |
public static lbvserver_stats[] get(nitro_service service) throws Exception{
lbvserver_stats obj = new lbvserver_stats();
lbvserver_stats[] response = (lbvserver_stats[])obj.stat_resources(service);
return response;
} | [
"Use this API to fetch the statistics of all lbvserver_stats resources that are configured on netscaler."
] | [
"Get a list of comments made for a particular entity\n\n@param entityId - id of the commented entity\n@param entityType - type of the entity\n@return list of comments",
"Get the type created by selecting only a subset of properties from this\ntype. The type must be a map for this to work\n\n@param properties The ... |
private List<TokenStream> collectTokenStreams(TokenStream stream) {
// walk through the token stream and build a collection
// of sub token streams that represent possible date locations
List<Token> currentGroup = null;
List<List<Token>> groups = new ArrayList<List<Token>>();
Token currentToken;
int currentTokenType;
StringBuilder tokenString = new StringBuilder();
while((currentToken = stream.getTokenSource().nextToken()).getType() != DateLexer.EOF) {
currentTokenType = currentToken.getType();
tokenString.append(DateParser.tokenNames[currentTokenType]).append(" ");
// we're currently NOT collecting for a possible date group
if(currentGroup == null) {
// skip over white space and known tokens that cannot be the start of a date
if(currentTokenType != DateLexer.WHITE_SPACE &&
DateParser.FOLLOW_empty_in_parse186.member(currentTokenType)) {
currentGroup = new ArrayList<Token>();
currentGroup.add(currentToken);
}
}
// we're currently collecting
else {
// preserve white space
if(currentTokenType == DateLexer.WHITE_SPACE) {
currentGroup.add(currentToken);
}
else {
// if this is an unknown token, we'll close out the current group
if(currentTokenType == DateLexer.UNKNOWN) {
addGroup(currentGroup, groups);
currentGroup = null;
}
// otherwise, the token is known and we're currently collecting for
// a group, so we'll add it to the current group
else {
currentGroup.add(currentToken);
}
}
}
}
if(currentGroup != null) {
addGroup(currentGroup, groups);
}
_logger.info("STREAM: " + tokenString.toString());
List<TokenStream> streams = new ArrayList<TokenStream>();
for(List<Token> group:groups) {
if(!group.isEmpty()) {
StringBuilder builder = new StringBuilder();
builder.append("GROUP: ");
for (Token token : group) {
builder.append(DateParser.tokenNames[token.getType()]).append(" ");
}
_logger.info(builder.toString());
streams.add(new CommonTokenStream(new NattyTokenSource(group)));
}
}
return streams;
} | [
"Scans the given token global token stream for a list of sub-token\nstreams representing those portions of the global stream that\nmay contain date time information\n\n@param stream\n@return"
] | [
"this method mimics EMC behavior",
"Utility function to get the current value.",
"This method writes assignment data to a Planner file.",
"Shuffle an array.\n\n@param array Array.\n@param seed Random seed.",
"Checks if the duration option is valid.\n\nNOTE: This does NOT check, if too many events are speci... |
@Deprecated
public void validateOperation(final ModelNode operation) throws OperationFailedException {
if (operation.hasDefined(ModelDescriptionConstants.OPERATION_NAME) && deprecationData != null && deprecationData.isNotificationUseful()) {
ControllerLogger.DEPRECATED_LOGGER.operationDeprecated(getName(),
PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)).toCLIStyleString());
}
for (AttributeDefinition ad : this.parameters) {
ad.validateOperation(operation);
}
} | [
"Validates operation model against the definition and its parameters\n\n@param operation model node of type {@link ModelType#OBJECT}, representing an operation request\n@throws OperationFailedException if the value is not valid\n\n@deprecated Not used by the WildFly management kernel; will be removed in a future re... | [
"Gets the value of the project property.\n\n<p>\nThis accessor method returns a reference to the live list,\nnot a snapshot. Therefore any modification you make to the\nreturned list will be present inside the JAXB object.\nThis is why there is not a <CODE>set</CODE> method for the project property.\n\n<p>\nFor exa... |
@PreDestroy
public final void dispose() {
getConnectionPool().ifPresent(PoolResources::dispose);
getThreadPool().dispose();
try {
ObjectName name = getByteBufAllocatorObjectName();
if (ManagementFactory.getPlatformMBeanServer().isRegistered(name)) {
ManagementFactory.getPlatformMBeanServer().unregisterMBean(name);
}
} catch (JMException e) {
this.logger.error("Unable to register ByteBufAllocator MBean", e);
}
} | [
"Disposes resources created to service this connection context"
] | [
"Use this API to fetch appfwprofile_xmlvalidationurl_binding resources of given name .",
"Return a set of all the Declaration matching the DeclarationFilter of the.\nLinker.\n\n@return a set of all the Declaration matching the DeclarationFilter of the\nLinker.",
"Template-and-Hook method for generating the url ... |
protected boolean clearSpecial(DatabaseConnection connection, Logger logger) {
NestedConnection currentSaved = specialConnection.get();
boolean cleared = false;
if (connection == null) {
// ignored
} else if (currentSaved == null) {
logger.error("no connection has been saved when clear() called");
} else if (currentSaved.connection == connection) {
if (currentSaved.decrementAndGet() == 0) {
// we only clear the connection if nested counter is 0
specialConnection.set(null);
}
cleared = true;
} else {
logger.error("connection saved {} is not the one being cleared {}", currentSaved.connection, connection);
}
// release should then be called after clear
return cleared;
} | [
"Clear the connection that was previously saved.\n\n@return True if the connection argument had been saved."
] | [
"Constraint that ensures that the field has precision and scale settings if the jdbc type requires it.\n\n@param fieldDef The field descriptor\n@param checkLevel The current check level (this constraint is checked in all levels)",
"Readable yyyyMMdd int representation of a day, which is also sortable.",
"Buil... |
@SuppressWarnings("unused")
public Handedness getHandedness()
{
if ((currentControllerEvent == null) || currentControllerEvent.isRecycled())
{
return null;
}
return currentControllerEvent.handedness == 0.0f ?
Handedness.LEFT : Handedness.RIGHT;
} | [
"Return the current handedness of the Gear Controller.\n\n@return returns whether the user is using the controller left or right handed. This function\nreturns <code>null</code> if the controller is unavailable or the data is stale."
] | [
"Use this API to fetch auditsyslogpolicy_aaauser_binding resources of given name .",
"Returns the negative of the input variable",
"Add this service to the given service target.\n@param serviceTarget the service target\n@param configuration the bootstrap configuration",
"interceptors, decorators and observers... |
@Modified(id = "importerServices")
void modifiedImporterService(ServiceReference<ImporterService> serviceReference) {
try {
importersManager.modified(serviceReference);
} catch (InvalidFilterException invalidFilterException) {
LOG.error("The ServiceProperty \"" + TARGET_FILTER_PROPERTY + "\" of the ImporterService "
+ bundleContext.getService(serviceReference) + " doesn't provides a valid Filter."
+ " To be used, it must provides a correct \"" + TARGET_FILTER_PROPERTY + "\" ServiceProperty.",
invalidFilterException
);
importersManager.removeLinks(serviceReference);
return;
}
if (importersManager.matched(serviceReference)) {
importersManager.updateLinks(serviceReference);
} else {
importersManager.removeLinks(serviceReference);
}
} | [
"Update the Target Filter of the ImporterService.\nApply the induce modifications on the links of the ImporterService\n\n@param serviceReference"
] | [
"Adds the position.\n\n@param position the position",
"Converts a byte array to a hexadecimal string representation\n@param bb the byte array to convert\n@return string the string representation",
"Handle a change in the weeks of month.\n@param week the changed weeks checkbox's internal value.\n@param value the... |
private List<Object> convertType(DataType type, byte[] data)
{
List<Object> result = new ArrayList<Object>();
int index = 0;
while (index < data.length)
{
switch (type)
{
case STRING:
{
String value = MPPUtility.getUnicodeString(data, index);
result.add(value);
index += ((value.length() + 1) * 2);
break;
}
case CURRENCY:
{
Double value = Double.valueOf(MPPUtility.getDouble(data, index) / 100);
result.add(value);
index += 8;
break;
}
case NUMERIC:
{
Double value = Double.valueOf(MPPUtility.getDouble(data, index));
result.add(value);
index += 8;
break;
}
case DATE:
{
Date value = MPPUtility.getTimestamp(data, index);
result.add(value);
index += 4;
break;
}
case DURATION:
{
TimeUnit units = MPPUtility.getDurationTimeUnits(MPPUtility.getShort(data, index + 4), m_properties.getDefaultDurationUnits());
Duration value = MPPUtility.getAdjustedDuration(m_properties, MPPUtility.getInt(data, index), units);
result.add(value);
index += 6;
break;
}
case BOOLEAN:
{
Boolean value = Boolean.valueOf(MPPUtility.getShort(data, index) == 1);
result.add(value);
index += 2;
break;
}
default:
{
index = data.length;
break;
}
}
}
return result;
} | [
"Convert raw data into Java types.\n\n@param type data type\n@param data raw data\n@return list of Java object"
] | [
"Use this API to fetch linkset_interface_binding resources of given name .",
"Returns a time interval as Solr compatible query string.\n@param searchField the field to search for.\n@param startTime the lower limit of the interval.\n@param endTime the upper limit of the interval.\n@return Solr compatible query str... |
public ByteArray readBytes(int size) throws IOException
{
byte[] data = new byte[size];
m_stream.read(data);
return new ByteArray(data);
} | [
"Read an array of bytes of a specified size.\n\n@param size number of bytes to read\n@return ByteArray instance"
] | [
"Update the underlying buffer using the integer\n\n@param number number to be stored in checksum buffer",
"Accessor method used to retrieve a String object representing the\ncontents of an individual field. If the field does not exist in the\nrecord, null is returned.\n\n@param field the index number of the field... |
public static String get(String url, Map<String, String> customHeaders, Map<String, String> params) throws URISyntaxException, IOException, HTTPException {
LOGGER.log(Level.INFO, "Sending GET request to the url {0}", url);
URIBuilder uriBuilder = new URIBuilder(url);
if (params != null && params.size() > 0) {
for (Map.Entry<String, String> param : params.entrySet()) {
uriBuilder.setParameter(param.getKey(), param.getValue());
}
}
HttpGet httpGet = new HttpGet(uriBuilder.build());
populateHeaders(httpGet, customHeaders);
HttpClient httpClient = HttpClientBuilder.create().build();
HttpResponse httpResponse = httpClient.execute(httpGet);
int statusCode = httpResponse.getStatusLine().getStatusCode();
if (isErrorStatus(statusCode)) {
String jsonErrorResponse = EntityUtils.toString(httpResponse.getEntity(), StandardCharsets.UTF_8);
throw new HTTPException(statusCode, httpResponse.getStatusLine().getReasonPhrase(), jsonErrorResponse);
}
return EntityUtils.toString(httpResponse.getEntity(), StandardCharsets.UTF_8);
} | [
"Send get request.\n\n@param url the url\n@param customHeaders the customHeaders\n@param params the params\n@return the string\n@throws URISyntaxException the uri syntax exception\n@throws IOException the io exception"
] | [
"Add network interceptor to httpClient to track download progress for\nasync requests.",
"Use this API to fetch all the nsfeature resources that are configured on netscaler.",
"Removes obsolete elements from names and shared elements.\n\n@param names Shared element names.\n@param sharedElements Sha... |
@UiHandler("m_endTime")
void onEndTimeChange(CmsDateBoxEvent event) {
if (handleChange() && !event.isUserTyping()) {
m_controller.setEndTime(event.getDate());
}
} | [
"Handle an end time change.\n@param event the change event."
] | [
"Creates the request.\n\n@return the bound request builder\n@throws HttpRequestCreateException\nthe http request create exception",
"Clears the handler hierarchy.",
"Get the server redirects for a given clientId from the database\n\n@param clientId client ID\n@return collection of ServerRedirects",
"High-accu... |
private void readResources(Project project, HashMap<BigInteger, ProjectCalendar> calendarMap)
{
Project.Resources resources = project.getResources();
if (resources != null)
{
for (Project.Resources.Resource resource : resources.getResource())
{
readResource(resource, calendarMap);
}
}
} | [
"This method extracts resource data from an MSPDI file.\n\n@param project Root node of the MSPDI file\n@param calendarMap Map of calendar UIDs to names"
] | [
"Create and serialize a WorkerStatus for a pause event.\n\n@return the JSON representation of a new WorkerStatus\n@throws IOException if there was an error serializing the WorkerStatus",
"Returns the getter method associated with the object's field.\n\n@param object\nthe object\n@param fieldName\nthe name of the ... |
@SuppressWarnings("rawtypes")
private void synchronousInvokeCallback(Callable call) {
Future future = streamingSlopResults.submit(call);
try {
future.get();
} catch(InterruptedException e1) {
logger.error("Callback failed", e1);
throw new VoldemortException("Callback failed");
} catch(ExecutionException e1) {
logger.error("Callback failed during execution", e1);
throw new VoldemortException("Callback failed during execution");
}
} | [
"Helper method to synchronously invoke a callback\n\n@param call"
] | [
"Reads numBytes bytes, and returns the corresponding string",
"Decorates a node with the affected operator, if any.\n\n@param context\n@param tree\n@param operations\n@return",
"Create a set containing all the processor at the current node and the entire subgraph.",
"Reads a time value. The time is represente... |
public IPAddressSeqRange intersect(IPAddressSeqRange other) {
IPAddress otherLower = other.getLower();
IPAddress otherUpper = other.getUpper();
IPAddress lower = this.getLower();
IPAddress upper = this.getUpper();
if(compareLowValues(lower, otherLower) <= 0) {
if(compareLowValues(upper, otherUpper) >= 0) {
return other;
} else if(compareLowValues(upper, otherLower) < 0) {
return null;
}
return create(otherLower, upper);
} else if(compareLowValues(otherUpper, upper) >= 0) {
return this;
} else if(compareLowValues(otherUpper, lower) < 0) {
return null;
}
return create(lower, otherUpper);
} | [
"Returns the intersection of this range with the given range, a range which includes those addresses in both this and the given rqnge.\n@param other\n@return"
] | [
"Get the unique set of declared methods on the leaf class and all superclasses. Leaf\nclass methods are included first and while traversing the superclass hierarchy any methods found\nwith signatures matching a method already included are filtered out.",
"This method returns the actual raw class associated with t... |
@SuppressWarnings("unchecked")
public static Properties readSingleClientConfigAvro(String configAvro) {
Properties props = new Properties();
try {
JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIG_AVRO_SCHEMA, configAvro);
GenericDatumReader<Object> datumReader = new GenericDatumReader<Object>(CLIENT_CONFIG_AVRO_SCHEMA);
Map<Utf8, Utf8> flowMap = (Map<Utf8, Utf8>) datumReader.read(null, decoder);
for(Utf8 key: flowMap.keySet()) {
props.put(key.toString(), flowMap.get(key).toString());
}
} catch(Exception e) {
e.printStackTrace();
}
return props;
} | [
"Parses a string that contains single fat client config string in avro\nformat\n\n@param configAvro Input string of avro format, that contains config for\nmultiple stores\n@return Properties of single fat client config"
] | [
"Obtain the profile identifier.\n\n@param profileIdentifier Can be profile ID, or friendly name\n@return\n@throws Exception",
"Sets the target translator for all cells in the row.\nIt will also remove any other translator set.\nNothing will happen if the argument is null.\n@param targetTranslator translator\n@ret... |
public int[] getPositions() {
int[] list;
if (assumeSinglePosition) {
list = new int[1];
list[0] = super.startPosition();
return list;
} else {
try {
processEncodedPayload();
list = mtasPosition.getPositions();
if (list != null) {
return mtasPosition.getPositions();
}
} catch (IOException e) {
log.debug(e);
// do nothing
}
int start = super.startPosition();
int end = super.endPosition();
list = new int[end - start];
for (int i = start; i < end; i++)
list[i - start] = i;
return list;
}
} | [
"Gets the positions.\n\n@return the positions"
] | [
"Validates the type",
"Undo a prior removal using the supplied undo key.\n\n@param removalKey - The key returned from the call to removeRoleMapping.\n@return true if the undo was successful, false otherwise.",
"Returns true if all pixels in the array have the same color",
"Replace a single value at the approp... |
public static ComplexNumber Tan(ComplexNumber z1) {
ComplexNumber result = new ComplexNumber();
if (z1.imaginary == 0.0) {
result.real = Math.tan(z1.real);
result.imaginary = 0.0;
} else {
double real2 = 2 * z1.real;
double imag2 = 2 * z1.imaginary;
double denom = Math.cos(real2) + Math.cosh(real2);
result.real = Math.sin(real2) / denom;
result.imaginary = Math.sinh(imag2) / denom;
}
return result;
} | [
"Calculates Tangent value of the complex number.\n\n@param z1 A ComplexNumber instance.\n@return Returns new ComplexNumber instance containing the Tangent value of the specified complex number."
] | [
"Set the values using the specified Properties object\n\n@param properties Properties object containing specific property values\nfor the Coordinator config",
"Sets the max.\n\n@param n the new max",
"used by Error template",
"Whether the specified JavaBeans property exists on the given type or not.\n\n@param... |
protected void postProcessing()
{
//
// Update the internal structure. We'll take this opportunity to
// generate outline numbers for the tasks as they don't appear to
// be present in the MPP file.
//
ProjectConfig config = m_project.getProjectConfig();
config.setAutoWBS(m_autoWBS);
config.setAutoOutlineNumber(true);
m_project.updateStructure();
config.setAutoOutlineNumber(false);
//
// Perform post-processing to set the summary flag
//
for (Task task : m_project.getTasks())
{
task.setSummary(task.hasChildTasks());
}
//
// Ensure that the unique ID counters are correct
//
config.updateUniqueCounters();
} | [
"Carry out any post-processing required to tidy up\nthe data read from the database."
] | [
"Check whether the given is is matched by one of the include expressions.\n\n@param id id to check\n@param includes list of include regular expressions\n@return true when id is included",
"Establish connection to the ChromeCast device",
"Stops the compressor.",
"todo move to commonops",
"Parses a duration a... |
public static systemeventhistory[] get(nitro_service service, systemeventhistory_args args) throws Exception{
systemeventhistory obj = new systemeventhistory();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
systemeventhistory[] response = (systemeventhistory[])obj.get_resources(service, option);
return response;
} | [
"Use this API to fetch all the systemeventhistory resources that are configured on netscaler.\nThis uses systemeventhistory_args which is a way to provide additional arguments while fetching the resources."
] | [
"Samples with replacement from a collection\n\n@param c\nThe collection to be sampled from\n@param n\nThe number of samples to take\n@return a new collection with the sample",
"Deletes any empty directories under the output directory. These\ndirectories are created by TestNG for its own reports regardless\nof wh... |
public CustomHeadersInterceptor addHeader(String name, String value) {
if (!this.headers.containsKey(name)) {
this.headers.put(name, new ArrayList<String>());
}
this.headers.get(name).add(value);
return this;
} | [
"Add a single header key-value pair. If one with the name already exists,\nboth stay in the header map.\n\n@param name the name of the header.\n@param value the value of the header.\n@return the interceptor instance itself."
] | [
"Checks if the specified latitude is correct.\n\n@param name the name of the latitude field\n@param latitude the value of the latitude field\n@return the latitude",
"Given a resource field number, this method returns the resource field name.\n\n@param key resource field number\n@return resource field name",
"Re... |
public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo info)
{
Util.log("In OTMJCAManagedConnectionFactory.createManagedConnection");
try
{
Kit kit = getKit();
PBKey key = ((OTMConnectionRequestInfo) info).getPbKey();
OTMConnection connection = kit.acquireConnection(key);
return new OTMJCAManagedConnection(this, connection, key);
}
catch (ResourceException e)
{
throw new OTMConnectionRuntimeException(e.getMessage());
}
} | [
"return a new managed connection. This connection is wrapped around the real connection and delegates to it\nto get work done.\n@param subject\n@param info\n@return"
] | [
"Updates the text style according to a new text position\n@param bstyle the style to be updated\n@param text the text position",
"Determine the consistency level of a key\n\n@param versionNodeSetMap A map that maps version to set of PrefixNodes\n@param replicationFactor Total replication factor for the set of clu... |
public static void main(String[] args) {
if (args.length < 2) { // NOSONAR
LOGGER.error("There must be at least two arguments");
return;
}
int lastIndex = args.length - 1;
AllureReportGenerator reportGenerator = new AllureReportGenerator(
getFiles(Arrays.copyOf(args, lastIndex))
);
reportGenerator.generate(new File(args[lastIndex]));
} | [
"Generate Allure report data from directories with allure report results.\n\n@param args a list of directory paths. First (args.length - 1) arguments -\nresults directories, last argument - the folder to generated data"
] | [
"Sets the value for the API's \"props\" parameter based on the current\nsettings.\n\n@param properties\ncurrent setting of parameters",
"Initialize current thread's JobContext using specified copy\n@param origin the original job context",
"Given a list of keys and a number of splits find the keys to split on.\n... |
private static Bitmap crop(Bitmap srcBmp, View canvasView, int downsampling) {
float scale = 1f / downsampling;
return Bitmap.createBitmap(
srcBmp,
(int) Math.floor((ViewCompat.getX(canvasView)) * scale),
(int) Math.floor((ViewCompat.getY(canvasView)) * scale),
(int) Math.floor((canvasView.getWidth()) * scale),
(int) Math.floor((canvasView.getHeight()) * scale)
);
} | [
"crops the srcBmp with the canvasView bounds and returns the cropped bitmap"
] | [
"Create an info object from an authscope object.\n\n@param authscope the authscope",
"Creates a spin wrapper for a data input. The data format of the\ninput is assumed to be JSON.\n\n@param input the input to wrap\n@return the spin wrapper for the input\n\n@throws IllegalArgumentException in case an argument of i... |
private void writeIntegerField(String fieldName, Object value) throws IOException
{
int val = ((Number) value).intValue();
if (val != 0)
{
m_writer.writeNameValuePair(fieldName, val);
}
} | [
"Write an integer field to the JSON file.\n\n@param fieldName field name\n@param value field value"
] | [
"Closes the connection to the dbserver. This instance can no longer be used after this action.",
"from IsoFields in ThreeTen-Backport",
"URL-Decodes a given string using UTF-8. No UnsupportedEncodingException to handle as it is dealt with in this\nmethod.",
"Append the Parameter\nAdd the place holder ? or the... |
public static Identity fromByteArray(final byte[] anArray) throws PersistenceBrokerException
{
// reverse of the serialize() algorithm:
// read from byte[] with a ByteArrayInputStream, decompress with
// a GZIPInputStream and then deserialize by reading from the ObjectInputStream
try
{
final ByteArrayInputStream bais = new ByteArrayInputStream(anArray);
final GZIPInputStream gis = new GZIPInputStream(bais);
final ObjectInputStream ois = new ObjectInputStream(gis);
final Identity result = (Identity) ois.readObject();
ois.close();
gis.close();
bais.close();
return result;
}
catch (Exception ex)
{
throw new PersistenceBrokerException(ex);
}
} | [
"Factory method that returns an Identity object created from a serializated representation.\n\n@param anArray The serialized representation\n@return The identity\n@see {@link #serialize}.\n@deprecated"
] | [
"Checks if a parameter exists. If it exists, it is updated. If it doesn't, it is created. Only works for parameters which key is\nunique. Will create a transaction on the given entity manager.",
"A specific, existing task can be deleted by making a DELETE request on the\nURL for that task. Deleted tasks go into t... |
public static boolean isPrimitiveWrapperArray(Class<?> clazz) {
Assert.notNull(clazz, "Class must not be null");
return (clazz.isArray() && isPrimitiveWrapper(clazz.getComponentType()));
} | [
"Check if the given class represents an array of primitive wrappers,\ni.e. Boolean, Byte, Character, Short, Integer, Long, Float, or Double.\n@param clazz the class to check\n@return whether the given class is a primitive wrapper array class"
] | [
"Use this API to add sslcertkey.",
"Internal function that uses recursion to create the list",
"Check the variable name and if not set, set it with the singleton variable name being on the top of the stack.",
"Gets type from super class's type parameter.",
"Decompiles a single type.\n\n@param metadataSystem... |
public int getBoneIndex(GVRSceneObject bone)
{
for (int i = 0; i < getNumBones(); ++i)
if (mBones[i] == bone)
return i;
return -1;
} | [
"Get the bone index for the given scene object.\n\n@param bone GVRSceneObject bone to search for\n@return bone index or -1 for root bone.\n@see #getParentBoneIndex"
] | [
"Reads non outline code custom field values and populates container.",
"should not be public",
"Cancel all task with this tag and returns the canceled task count\n\n@param tagToCancel\n@return",
"Get the currently selected opacity.\n\n@return The int value of the currently selected opacity.",
"Loads the Con... |
private boolean loadCustomErrorPage(
CmsObject cms,
HttpServletRequest req,
HttpServletResponse res,
String rootPath) {
try {
// get the site of the error page resource
CmsSite errorSite = OpenCms.getSiteManager().getSiteForRootPath(rootPath);
cms.getRequestContext().setSiteRoot(errorSite.getSiteRoot());
String relPath = cms.getRequestContext().removeSiteRoot(rootPath);
if (cms.existsResource(relPath)) {
cms.getRequestContext().setUri(relPath);
OpenCms.getResourceManager().loadResource(cms, cms.readResource(relPath), req, res);
return true;
} else {
return false;
}
} catch (Throwable e) {
// something went wrong log the exception and return false
LOG.error(e.getMessage(), e);
return false;
}
} | [
"Tries to load the custom error page at the given rootPath.\n@param cms {@link CmsObject} used for reading the resource (site root and uri get adjusted!)\n@param req the current request\n@param res the current response\n@param rootPath the VFS root path to the error page resource\n@return a flag, indicating if the ... | [
"This method writes data for a single calendar to an MSPDI file.\n\n@param bc Base calendar data\n@return New MSPDI calendar instance",
"Copied from AbstractEntityPersister",
"Gives the \"roots\" of a list of folders, i.e. the list of folders which are not descendants of any other folders in the original list\n... |
public static GVRMesh createQuad(GVRContext gvrContext, float width, float height) {
GVRMesh mesh = new GVRMesh(gvrContext);
float[] vertices = { width * -0.5f, height * 0.5f, 0.0f, width * -0.5f,
height * -0.5f, 0.0f, width * 0.5f, height * 0.5f, 0.0f,
width * 0.5f, height * -0.5f, 0.0f };
mesh.setVertices(vertices);
final float[] normals = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f, 1.0f };
mesh.setNormals(normals);
final float[] texCoords = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f,
1.0f };
mesh.setTexCoords(texCoords);
char[] triangles = { 0, 1, 2, 1, 3, 2 };
mesh.setIndices(triangles);
return mesh;
} | [
"Creates a quad consisting of two triangles, with the specified width and\nheight.\n\n@param gvrContext current {@link GVRContext}\n\n@param width\nthe quad's width\n@param height\nthe quad's height\n@return A 2D, rectangular mesh with four vertices and two triangles"
] | [
"Utility function to set the current value in a ListBox.\n\n@return returns true if the option corresponding to the value\nwas successfully selected in the ListBox",
"Parse one resource to a shape object and add it to the shapes array\n@param shapes\n@param flatJSON\n@param resourceId\n@throws org.json.JSONExcept... |
private void readSubProjects(byte[] data, int uniqueIDOffset, int filePathOffset, int fileNameOffset, int subprojectIndex)
{
while (uniqueIDOffset < filePathOffset)
{
readSubProject(data, uniqueIDOffset, filePathOffset, fileNameOffset, subprojectIndex++);
uniqueIDOffset += 4;
}
} | [
"Read a list of sub projects.\n\n@param data byte array\n@param uniqueIDOffset offset of unique ID\n@param filePathOffset offset of file path\n@param fileNameOffset offset of file name\n@param subprojectIndex index of the subproject, used to calculate unique id offset"
] | [
"Return the list of module dependencies\n\n@param moduleName\n@param moduleVersion\n@param fullRecursive\n@param corporate\n@param thirdParty\n@return List<Dependency>\n@throws GrapesCommunicationException",
"Determines the prefix of an accessor method based on an accessor method name.\n\n@param methodName\nan ac... |
public GVRAnimationChannel findChannel(String boneName)
{
int boneId = mSkeleton.getBoneIndex(boneName);
if (boneId >= 0)
{
return mBoneChannels[boneId];
}
return null;
} | [
"Find the channel in the animation that animates the named bone.\n@param boneName name of bone to animate."
] | [
"Command-line version of the classifier. See the class\ncomments for examples of use, and SeqClassifierFlags\nfor more information on supported flags.",
"Validates the input parameters.",
"Retrieve an activity status.\n\n@param mpxj MPXJ Task instance\n@return activity status",
"Use this API to fetch all the... |
@PostConstruct
public void loadTagDefinitions()
{
Map<Addon, List<URL>> addonToResourcesMap = scanner.scanForAddonMap(new FileExtensionFilter("tags.xml"));
for (Map.Entry<Addon, List<URL>> entry : addonToResourcesMap.entrySet())
{
for (URL resource : entry.getValue())
{
log.info("Reading tags definitions from: " + resource.toString() + " from addon " + entry.getKey().getId());
try(InputStream is = resource.openStream())
{
tagService.readTags(is);
}
catch( Exception ex )
{
throw new WindupException("Failed reading tags definition: " + resource.toString() + " from addon " + entry.getKey().getId() + ":\n" + ex.getMessage(), ex);
}
}
}
} | [
"Loads the tag definitions from the files with a \".tags.xml\" suffix from the addons."
] | [
"Ensure the current throughput levels for the tracked operation does not\nexceed set quota limits. Throws an exception if exceeded quota.\n\n@param quotaKey\n@param trackedOp",
"Verifies if the new value is different from the field's old value. It's\nuseful, for example, in NoSQL databases that replicates data be... |
private void getYearlyAbsoluteDates(Calendar calendar, List<Date> dates)
{
long startDate = calendar.getTimeInMillis();
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.set(Calendar.MONTH, NumberHelper.getInt(m_monthNumber) - 1);
int requiredDayNumber = NumberHelper.getInt(m_dayNumber);
while (moreDates(calendar, dates))
{
int useDayNumber = requiredDayNumber;
int maxDayNumber = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
if (useDayNumber > maxDayNumber)
{
useDayNumber = maxDayNumber;
}
calendar.set(Calendar.DAY_OF_MONTH, useDayNumber);
if (calendar.getTimeInMillis() < startDate)
{
calendar.add(Calendar.YEAR, 1);
}
dates.add(calendar.getTime());
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.add(Calendar.YEAR, 1);
}
} | [
"Calculate start dates for a yearly absolute recurrence.\n\n@param calendar current date\n@param dates array of start dates"
] | [
"Pads the given String to the left with the given character to ensure that\nit's at least totalChars long.",
"public for testing purpose",
"Get a signature for a list of parameters using the given shared secret.\n\n@param sharedSecret\nThe shared secret\n@param params\nThe parameters\n@return The signature Stri... |
public static <V> V doWorkInPoolNicely(final Pool<Jedis> pool, final PoolWork<Jedis, V> work) {
final V result;
try {
result = doWorkInPool(pool, work);
} catch (RuntimeException re) {
throw re;
} catch (Exception e) {
throw new RuntimeException(e);
}
return result;
} | [
"Perform the given work with a Jedis connection from the given pool.\nWraps any thrown checked exceptions in a RuntimeException.\n\n@param pool the resource pool\n@param work the work to perform\n@param <V> the result type\n@return the result of the given work"
] | [
"Throws an IllegalStateException when the given value is not false.",
"Checks if provided class package is on the exclude list\n\n@param classPackageName\nname of class package\n@return false if class package is on the {@link #excludePackages} list",
"Retrieves the project start date. If an explicit start date ... |
public static int[] convertBytesToInts(byte[] bytes)
{
if (bytes.length % 4 != 0)
{
throw new IllegalArgumentException("Number of input bytes must be a multiple of 4.");
}
int[] ints = new int[bytes.length / 4];
for (int i = 0; i < ints.length; i++)
{
ints[i] = convertBytesToInt(bytes, i * 4);
}
return ints;
} | [
"Convert an array of bytes into an array of ints. 4 bytes from the\ninput data map to a single int in the output data.\n@param bytes The data to read from.\n@return An array of 32-bit integers constructed from the data.\n@since 1.1"
] | [
"Inserts a String array value into the mapping of the underlying Bundle, replacing any existing\nvalue for the given key. Either key or value may be null.\n\n@param key a String, or null\n@param value a String array object, or null\n@return this bundler instance to chain method calls",
"Use this API to add sslocs... |
public static BoxUser.Info createEnterpriseUser(BoxAPIConnection api, String login, String name) {
return createEnterpriseUser(api, login, name, null);
} | [
"Provisions a new user in an enterprise.\n@param api the API connection to be used by the created user.\n@param login the email address the user will use to login.\n@param name the name of the user.\n@return the created user's info."
] | [
"Creates the button for converting an XML bundle in a property bundle.\n@return the created button.",
"Use this API to fetch cachepolicy_cacheglobal_binding resources of given name .",
"Gets as many of the requested bytes as available from this buffer.\n\n@return number of bytes actually got from this buffer (0... |
public void join(String groupId, Boolean acceptRules) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_JOIN);
parameters.put("group_id", groupId);
if (acceptRules != null) {
parameters.put("accept_rules", acceptRules);
}
Response response = transportAPI.post(transportAPI.getPath(), parameters, apiKey, sharedSecret);
if (response.isError()) {
throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
}
} | [
"Join a group as a public member.\n\nNote: if a group has rules - the client must display the rules to the user and the user must accept them prior to joining the group. The acceptRules\nparameter indicates that the user has accepted those rules.\n\n@param groupId\n- the id of the group to join\n@param acceptRules\... | [
"Send the started notification",
"Search for the second entry in the second database. Use this method for databases configured with no duplicates.\n\n@param second second key (value for first).\n@return null if no entry found, otherwise the value.",
"Process TestCaseFinishedEvent. Add steps and attachments from... |
@JmxOperation
public String stopAsyncOperation(int requestId) {
try {
stopOperation(requestId);
} catch(VoldemortException e) {
return e.getMessage();
}
return "Stopping operation " + requestId;
} | [
"Wrapper to avoid throwing an exception over JMX"
] | [
"Adds a command class to the list of supported command classes by this node.\nDoes nothing if command class is already added.\n@param commandClass the command class instance to add.",
"Use this API to fetch sslvserver_sslcipher_binding resources of given name .",
"Retrieves the members of the type and of its su... |
public void postDoNotUseArtifact(final String gavc, final Boolean doNotUse, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
final Client client = getClient(user, password);
final WebResource resource = client.resource(serverURL).path(RequestUtils.getDoNotUseArtifact(gavc));
final ClientResponse response = resource.queryParam(ServerAPI.DO_NOT_USE, doNotUse.toString())
.accept(MediaType.APPLICATION_JSON).post(ClientResponse.class);
client.destroy();
if(ClientResponse.Status.OK.getStatusCode() != response.getStatus()){
final String message = "Failed to post do not use artifact";
if(LOG.isErrorEnabled()) {
LOG.error(String.format(HTTP_STATUS_TEMPLATE_MSG, message, response.getStatus()));
}
throw new GrapesCommunicationException(message, response.getStatus());
}
} | [
"Post boolean flag \"DO_NOT_USE\" to an artifact\n\n@param gavc\n@param doNotUse\n@param user\n@param password\n@throws GrapesCommunicationException"
] | [
"Deletes the inbox message for given messageId\n@param messageId String messageId\n@return boolean value based on success of operation",
"Read hints from a file.",
"Adds another scene object to pick against.\nEach frame all the colliders in the scene will be compared\nagainst the bounding volumes of all the col... |
public static vpath_stats get(nitro_service service) throws Exception{
vpath_stats obj = new vpath_stats();
vpath_stats[] response = (vpath_stats[])obj.stat_resources(service);
return response[0];
} | [
"Use this API to fetch the statistics of all vpath_stats resources that are configured on netscaler."
] | [
"Creates a code location URL from a file path\n\n@param filePath the file path\n@return A URL created from File\n@throws InvalidCodeLocation if URL creation fails",
"Check the given JWT\n\n@param jwtString the JSON Web Token\n@return the parsed and verified token or null if token is invalid\n@throws ParseExceptio... |
private Component createMainComponent() throws IOException, CmsException {
VerticalLayout mainComponent = new VerticalLayout();
mainComponent.setSizeFull();
mainComponent.addStyleName("o-message-bundle-editor");
m_table = createTable();
Panel navigator = new Panel();
navigator.setSizeFull();
navigator.setContent(m_table);
navigator.addActionHandler(new CmsMessageBundleEditorTypes.TableKeyboardHandler(m_table));
navigator.addStyleName("v-panel-borderless");
mainComponent.addComponent(m_options.getOptionsComponent());
mainComponent.addComponent(navigator);
mainComponent.setExpandRatio(navigator, 1f);
m_options.updateShownOptions(m_model.hasMasterMode(), m_model.canAddKeys());
return mainComponent;
} | [
"Creates the main component of the editor with all sub-components.\n@return the completely filled main component of the editor.\n@throws IOException thrown if setting the table's content data source fails.\n@throws CmsException thrown if setting the table's content data source fails."
] | [
"Migrate to Jenkins \"Credentials\" plugin from the old credential implementation",
"Create the image elements for the banners tha goes into the\ntitle and header bands depending on the case",
"Check that a list allowing null and empty item contains at least one element that is\nnot blank.\n@param list can't be... |
private void readDay(ProjectCalendar calendar, Project.Calendars.Calendar.WeekDays.WeekDay day, boolean readExceptionsFromDays)
{
BigInteger dayType = day.getDayType();
if (dayType != null)
{
if (dayType.intValue() == 0)
{
if (readExceptionsFromDays)
{
readExceptionDay(calendar, day);
}
}
else
{
readNormalDay(calendar, day);
}
}
} | [
"This method extracts data for a single day from an MSPDI file.\n\n@param calendar Calendar data\n@param day Day data\n@param readExceptionsFromDays read exceptions form day definitions"
] | [
"Stop offering shared dbserver sessions.",
"Check type.\n\n@param type the type\n@return the boolean",
"Helper method that stores in a hash map how often a certain key occurs.\nIf the key has not been encountered yet, a new entry is created for it in\nthe map. Otherwise the existing value for the key is increme... |
public static base_response add(nitro_service client, lbroute resource) throws Exception {
lbroute addresource = new lbroute();
addresource.network = resource.network;
addresource.netmask = resource.netmask;
addresource.gatewayname = resource.gatewayname;
return addresource.add_resource(client);
} | [
"Use this API to add lbroute."
] | [
"Use this API to add nslimitselector.",
"Sets an element in at the specified index.",
"Returns the URL to the property file that contains CRS definitions.\n\n@return The URL to the epsg file containing custom EPSG codes",
"returns a unique long value for class clazz and field fieldName.\nthe returned number i... |
public User getLimits() throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_GET_LIMITS);
Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret);
if (response.isError()) {
throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
}
Element userElement = response.getPayload();
User user = new User();
user.setId(userElement.getAttribute("nsid"));
NodeList photoNodes = userElement.getElementsByTagName("photos");
for (int i = 0; i < photoNodes.getLength(); i++) {
Element plElement = (Element) photoNodes.item(i);
PhotoLimits pl = new PhotoLimits();
user.setPhotoLimits(pl);
pl.setMaxDisplay(plElement.getAttribute("maxdisplaypx"));
pl.setMaxUpload(plElement.getAttribute("maxupload"));
}
NodeList videoNodes = userElement.getElementsByTagName("videos");
for (int i = 0; i < videoNodes.getLength(); i++) {
Element vlElement = (Element) videoNodes.item(i);
VideoLimits vl = new VideoLimits();
user.setPhotoLimits(vl);
vl.setMaxDuration(vlElement.getAttribute("maxduration"));
vl.setMaxUpload(vlElement.getAttribute("maxupload"));
}
return user;
} | [
"Get's the user's current upload limits, User object only contains user_id\n\n@return Media Limits"
] | [
"determine the what state a transaction is in by inspecting the primary column",
"Creates Accumulo connector given FluoConfiguration",
"Shuts down a managed domain container. The servers are first stopped, then the host controller is shutdown.\n\n@param client the client used to communicate with the server\n@p... |
private boolean runQueuedTask(boolean hasPermit) {
if (!hasPermit && beginRequest(paused) == RunResult.REJECTED) {
return false;
}
QueuedTask task = null;
if (!paused) {
task = taskQueue.poll();
} else {
//the container is suspended, but we still need to run any force queued tasks
task = findForcedTask();
}
if (task != null) {
if(!task.runRequest()) {
decrementRequestCount();
}
return true;
} else {
decrementRequestCount();
return false;
}
} | [
"Runs a queued task, if the queue is not already empty.\n\nNote that this will decrement the request count if there are no queued tasks to be run\n\n@param hasPermit If the caller has already called {@link #beginRequest(boolean force)}"
] | [
"binds the objects primary key and locking values to the statement, BRJ",
"Performs a request against a Stitch app server determined by the deployment model\nof the underlying app. Throws a Stitch specific exception if the request fails.\n\n@param stitchReq the request to perform.\n@return a {@link Response} to t... |
private void setPropertyFilters(String filters) {
this.filterProperties = new HashSet<>();
if (!"-".equals(filters)) {
for (String pid : filters.split(",")) {
this.filterProperties.add(Datamodel
.makeWikidataPropertyIdValue(pid));
}
}
} | [
"Sets the set of property filters based on the given string.\n\n@param filters\ncomma-separates list of property ids, or \"-\" to filter all\nstatements"
] | [
"Use this API to delete dnstxtrec.",
"The main method. See the class documentation.",
"Starts closing the keyboard when the hits are scrolled.",
"Returns the Organization that produce this artifact or null if there is none\n\n@param dbArtifact DbArtifact\n@return DbOrganization",
"Creates an appropriate HSG... |
@Nullable
public static LocationEngineResult extractResult(Intent intent) {
LocationEngineResult result = null;
if (isOnClasspath(GOOGLE_PLAY_LOCATION_RESULT)) {
result = extractGooglePlayResult(intent);
}
return result == null ? extractAndroidResult(intent) : result;
} | [
"Extracts location result from intent object\n\n@param intent valid intent object\n@return location result.\n@since 1.1.0"
] | [
"Creates and returns a temporary directory for a printing task.",
"Get the minutes difference",
"Adds a metadata classification to the specified file.\n\n@param classificationType the metadata classification type.\n@return the metadata classification type added to the file.",
"performs an UPDATE operation aga... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.