query stringlengths 74 6.1k | positive listlengths 1 1 | negative listlengths 9 9 |
|---|---|---|
public void writeAuxiliaryTriples() throws RDFHandlerException {
for (PropertyRestriction pr : this.someValuesQueue) {
writeSomeValueRestriction(pr.propertyUri, pr.rangeUri, pr.subject);
}
this.someValuesQueue.clear();
this.valueRdfConverter.writeAuxiliaryTriples();
} | [
"Writes all auxiliary triples that have been buffered recently. This\nincludes OWL property restrictions but it also includes any auxiliary\ntriples required by complex values that were used in snaks.\n\n@throws RDFHandlerException\nif there was a problem writing the RDF triples"
] | [
"Use this API to apply nspbr6.",
"Get the multicast socket address.\n\n@return the multicast address",
"Initializes the bean name defaulted",
"Use this API to fetch authenticationvserver_authenticationnegotiatepolicy_binding resources of given name .",
"Method is called by spring and verifies that there is ... |
public Collection<Service> getServices() throws FlickrException {
List<Service> list = new ArrayList<Service>();
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_GET_SERVICES);
Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret);
if (response.isError()) {
throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
}
Element servicesElement = response.getPayload();
NodeList serviceNodes = servicesElement.getElementsByTagName("service");
for (int i = 0; i < serviceNodes.getLength(); i++) {
Element serviceElement = (Element) serviceNodes.item(i);
Service srv = new Service();
srv.setId(serviceElement.getAttribute("id"));
srv.setName(XMLUtilities.getValue(serviceElement));
list.add(srv);
}
return list;
} | [
"Return a list of Flickr supported blogging services.\n\nThis method does not require authentication.\n\n@return List of Services\n@throws FlickrException"
] | [
"Returns true if the activity is a start milestone.\n\n@param activity Phoenix activity\n@return true if the activity is a milestone",
"Process the response by reporting proper log and feeding failure\ndetectors\n\n@param response\n@param pipeline",
"Parameter validity check.",
"Detects if the current device ... |
static void apply(final String patchId, final Collection<ContentModification> modifications, final PatchEntry patchEntry, final ContentItemFilter filter) {
for (final ContentModification modification : modifications) {
final ContentItem item = modification.getItem();
// Check if we accept the item
if (!filter.accepts(item)) {
continue;
}
final Location location = new Location(item);
final ContentEntry contentEntry = new ContentEntry(patchId, modification);
ContentTaskDefinition definition = patchEntry.get(location);
if (definition == null) {
definition = new ContentTaskDefinition(location, contentEntry, false);
patchEntry.put(location, definition);
} else {
definition.setTarget(contentEntry);
}
}
} | [
"Apply modifications to a content task definition.\n\n@param patchId the patch id\n@param modifications the modifications\n@param definitions the task definitions\n@param filter the content item filter"
] | [
"write CustomInfo list into table.\n\n@param event the event",
"depth- first search for any module - just to check that the suggestion has any chance of delivering correct result",
"Updates the R matrix to take in account the removed row.",
"Add a content modification.\n\n@param modification the content modif... |
public void updateMetadataVersions() {
Properties versionProps = MetadataVersionStoreUtils.getProperties(this.systemStoreRepository.getMetadataVersionStore());
Long newVersion = fetchNewVersion(SystemStoreConstants.CLUSTER_VERSION_KEY,
null,
versionProps);
if(newVersion != null) {
this.currentClusterVersion = newVersion;
}
} | [
"Fetch the latest versions for cluster metadata"
] | [
"Add groups to the tree.\n\n@param parentNode parent tree node\n@param file group container",
"Converts to credentials for use in Grgit.\n@return {@code null} if both username and password are {@code null},\notherwise returns credentials in Grgit format.",
"Calculates the maximum text height which is possible b... |
public void update(Object feature) throws LayerException {
Session session = getSessionFactory().getCurrentSession();
session.update(feature);
} | [
"Update a feature object in the Hibernate session.\n\n@param feature feature object\n@throws LayerException oops"
] | [
"Returns the scene graph root.\n\nThis method is part of the wrapped API (see {@link AiWrapperProvider}\nfor details on wrappers).<p>\n\nThe built-in behavior is to return a {@link AiVector}.\n\n@param wrapperProvider the wrapper provider (used for type inference)\n@return the scene graph root",
"A slop is dead i... |
public void setDateOnly(boolean dateOnly) {
if (m_dateOnly != dateOnly) {
m_dateOnly = dateOnly;
if (m_dateOnly) {
m_time.removeFromParent();
m_am.removeFromParent();
m_pm.removeFromParent();
} else {
m_timeField.add(m_time);
m_timeField.add(m_am);
m_timeField.add(m_pm);
}
}
} | [
"Sets the value if the date only should be shown.\n@param dateOnly if the date only should be shown"
] | [
"use this method to construct the ChainingIterator\niterator by iterator.",
"Optionally specify the variable name to use for the output of this condition",
"Check from another ConcurrentGroupServerUpdatePolicy whose plans are meant to\nexecute once this policy's plans are successfully completed.\n\n@return <cod... |
public void delete(Object obj, boolean ignoreReferences) throws PersistenceBrokerException
{
if(isTxCheck() && !isInTransaction())
{
if(logger.isEnabledFor(Logger.ERROR))
{
String msg = "No running PB-tx found. Please, only delete objects in context of a PB-transaction" +
" to avoid side-effects - e.g. when rollback of complex objects.";
try
{
throw new Exception("** Delete object without active PersistenceBroker transaction **");
}
catch(Exception e)
{
logger.error(msg, e);
}
}
}
try
{
doDelete(obj, ignoreReferences);
}
finally
{
markedForDelete.clear();
}
} | [
"Deletes the concrete representation of the specified object in the underlying\npersistence system. This method is intended for use in top-level api or\nby internal calls.\n\n@param obj The object to delete.\n@param ignoreReferences With this flag the automatic deletion/unlinking\nof references can be suppressed (i... | [
"Sets the whole day flag.\n@param isWholeDay flag, indicating if the event lasts whole days.",
"Get the list of active tasks from the server.\n\n@return List of tasks\n@see <a href=\"https://console.bluemix.net/docs/services/Cloudant/api/active_tasks.html\">\nActive tasks</a>",
"The file we are working with has... |
public DynamicReportBuilder setProperty(String name, String value) {
this.report.setProperty(name, value);
return this;
} | [
"Adds a property to report design, this properties are mostly used by\nexporters to know if any specific configuration is needed\n\n@param name\n@param value\n@return A Dynamic Report Builder"
] | [
"Sets all padding for all cells in the row to the same value.\n@param padding new padding for top, bottom, left, and right, ignored if smaller than 0\n@return this to allow chaining",
"Use this API to update nspbr6.",
"Provisions a new app user in an enterprise using Box Developer Edition.\n@param api the AP... |
public void flush() throws IOException {
checkMutable();
long startTime = System.currentTimeMillis();
channel.force(true);
long elapsedTime = System.currentTimeMillis() - startTime;
LogFlushStats.recordFlushRequest(elapsedTime);
logger.debug("flush time " + elapsedTime);
setHighWaterMark.set(getSizeInBytes());
logger.debug("flush high water mark:" + highWaterMark());
} | [
"Commit all written data to the physical disk\n\n@throws IOException any io exception"
] | [
"Get a log file and last relevant date, and check if the log file is relevant\n@param currentLogFile The log file\n@param lastRelevantDate The last date which files should be keeping since\n@return false if the file should be deleted, true if it does not.",
"Use this API to rename a nsacl6 resource.",
"Compute ... |
public void addCell(TableLayoutCell cell) {
GridBagConstraints constraints = cell.getConstraints();
constraints.insets = new Insets(cellpadding, cellpadding, cellpadding, cellpadding);
add(cell.getComponent(), constraints);
} | [
"Adds a new cell to the current grid\n@param cell the td component"
] | [
"Returns the given collection persister for the inverse side in case the given persister represents the main side\nof a bi-directional many-to-many association.\n\n@param mainSidePersister the collection persister on the main side of a bi-directional many-to-many association\n@return the collection persister for th... |
public static String encode(String value) throws UnsupportedEncodingException {
if (isNullOrEmpty(value)) return value;
return URLEncoder.encode(value, URL_ENCODING);
} | [
"used for encoding queries or form data"
] | [
"Removes the value connected to the given key\nfrom all levels of the cache. Will not throw an\nexception on fail.\n\n@param cacheKey",
"Assigns this retention policy to a metadata template, optionally with certain field values.\n@param templateID the ID of the metadata template to apply to.\n@param fieldFilters ... |
public boolean addSsextension(String ssExt) {
if (this.ssextensions == null) {
this.ssextensions = new ArrayList<String>();
}
return this.ssextensions.add(ssExt);
} | [
"Add an additional SSExtension\n@param ssExt the ssextension to set"
] | [
"The sniffing Loggers are some special Loggers, whose level will be set to TRACE forcedly.\n@param logger",
"Sets the bounds of a UIObject, moving and sizing to match the\nbounds specified. Currently used for the itemhover and useful\nfor other absolutely positioned elements.",
"Returns the list of Solr fields ... |
public synchronized void persistProperties() throws IOException {
beginPersistence();
// Read the properties file into memory
// Shouldn't be so bad - it's a small file
List<String> content = readFile(propertiesFile);
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(propertiesFile), StandardCharsets.UTF_8));
try {
for (String line : content) {
String trimmed = line.trim();
if (trimmed.length() == 0) {
bw.newLine();
} else {
Matcher matcher = PROPERTY_PATTERN.matcher(trimmed);
if (matcher.matches()) {
final String key = cleanKey(matcher.group(1));
if (toSave.containsKey(key) || toSave.containsKey(key + DISABLE_SUFFIX_KEY)) {
writeProperty(bw, key, matcher.group(2));
toSave.remove(key);
toSave.remove(key + DISABLE_SUFFIX_KEY);
} else if (trimmed.startsWith(COMMENT_PREFIX)) {
// disabled user
write(bw, line, true);
}
} else {
write(bw, line, true);
}
}
}
endPersistence(bw);
} finally {
safeClose(bw);
}
} | [
"Saves changes in properties file. It reads the property file into memory, modifies it and saves it back to the file.\n\n@throws IOException"
] | [
"Exports json encoded content to CrashReport object\n\n@param json valid json body.\n@return new instance of CrashReport",
"Retrieves an integer value from the extended data.\n\n@param type Type identifier\n@return integer value",
"Obtains a local date in Ethiopic calendar system from the\nera, year-of-era, mon... |
@NonNull
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher reset() {
lastResponsePage = 0;
lastRequestPage = 0;
lastResponseId = 0;
endReached = false;
clearFacetRefinements();
cancelPendingRequests();
numericRefinements.clear();
return this;
} | [
"Resets the helper's state.\n\n@return this {@link Searcher} for chaining."
] | [
"Use this API to fetch vpntrafficpolicy_aaagroup_binding resources of given name .",
"A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field.\n\nReturns an empty data record.\n\n@param customField Globally unique identifier for the custom field.\n@return Requ... |
public static float smoothPulse(float a1, float a2, float b1, float b2, float x) {
if (x < a1 || x >= b2)
return 0;
if (x >= a2) {
if (x < b1)
return 1.0f;
x = (x - b1) / (b2 - b1);
return 1.0f - (x*x * (3.0f - 2.0f*x));
}
x = (x - a1) / (a2 - a1);
return x*x * (3.0f - 2.0f*x);
} | [
"A smoothed pulse function. A cubic function is used to smooth the step between two thresholds.\n@param a1 the lower threshold position for the start of the pulse\n@param a2 the upper threshold position for the start of the pulse\n@param b1 the lower threshold position for the end of the pulse\n@param b2 the upper ... | [
"Find the index of the first matching element in the list\n@param element the element value to find\n@return the index of the first matching element, or <code>-1</code> if none found",
"Sets the day of the month.\n@param day the day to set.",
"Calculates the legend positions and which legend title should be dis... |
public PathElement getLastElement() {
final List<PathElement> list = pathAddressList;
return list.size() == 0 ? null : list.get(list.size() - 1);
} | [
"Gets the last element in the address.\n\n@return the element, or {@code null} if {@link #size()} is zero."
] | [
"generate random velocities in the given range\n@return",
"Use this API to fetch authenticationlocalpolicy_authenticationvserver_binding resources of given name .",
"Updates all inverse associations managed by a given entity.",
"Use this API to fetch the statistics of all service_stats resources that are conf... |
@Override
public void stop()
{
synchronized (killHook)
{
jqmlogger.info("JQM engine " + this.node.getName() + " has received a stop order");
// Kill hook should be removed
try
{
if (!Runtime.getRuntime().removeShutdownHook(killHook))
{
jqmlogger.error("The engine could not unregister its shutdown hook");
}
}
catch (IllegalStateException e)
{
// This happens if the stop sequence is initiated by the shutdown hook itself.
jqmlogger.info("Stop order is due to an admin operation (KILL/INT)");
}
}
// Stop pollers
int pollerCount = pollers.size();
for (QueuePoller p : pollers.values())
{
p.stop();
}
// Scheduler
this.scheduler.stop();
// Jetty is closed automatically when all pollers are down
// Wait for the end of the world
if (pollerCount > 0)
{
try
{
this.ended.acquire();
}
catch (InterruptedException e)
{
jqmlogger.error("interrupted", e);
}
}
// Send a KILL signal to remaining job instances, and wait some more.
if (this.getCurrentlyRunningJobCount() > 0)
{
this.runningJobInstanceManager.killAll();
try
{
Thread.sleep(10000);
}
catch (InterruptedException e)
{
jqmlogger.error("interrupted", e);
}
}
jqmlogger.debug("Stop order was correctly handled. Engine for node " + this.node.getName() + " has stopped.");
} | [
"Gracefully stop the engine"
] | [
"Adds an HTTP header to this request.\n@param key the header key.\n@param value the header value.",
"Awaits at most 5 minutes until all pods meets the given predicate.\n\n@param filter used to wait to detect that a pod is up and running.",
"Use this API to update clusternodegroup resources.",
"Use this API ... |
public void set1Value(int index, String newValue) {
try {
value.set( index, newValue );
}
catch (IndexOutOfBoundsException e) {
Log.e(TAG, "X3D MFString set1Value(int index, ...) out of bounds." + e);
}
catch (Exception e) {
Log.e(TAG, "X3D MFString set1Value(int index, ...) exception " + e);
}
} | [
"Replace a single value at the appropriate location in the existing value array.\n@param index - location in the array list\n@param newValue - the new String"
] | [
"Process each regex group matched substring of the given CharSequence. If the closure\nparameter takes one argument, an array with all match groups is passed to it.\nIf the closure takes as many arguments as there are match groups, then each\nparameter will be one match group.\n\n@param self the source CharSeque... |
private static Map<String, ServerGroupDeploymentPlanResult> buildServerGroupResults(Map<UUID, DeploymentActionResult> deploymentActionResults) {
Map<String, ServerGroupDeploymentPlanResult> serverGroupResults = new HashMap<String, ServerGroupDeploymentPlanResult>();
for (Map.Entry<UUID, DeploymentActionResult> entry : deploymentActionResults.entrySet()) {
UUID actionId = entry.getKey();
DeploymentActionResult actionResult = entry.getValue();
Map<String, ServerGroupDeploymentActionResult> actionResultsByServerGroup = actionResult.getResultsByServerGroup();
for (ServerGroupDeploymentActionResult serverGroupActionResult : actionResultsByServerGroup.values()) {
String serverGroupName = serverGroupActionResult.getServerGroupName();
ServerGroupDeploymentPlanResultImpl sgdpr = (ServerGroupDeploymentPlanResultImpl) serverGroupResults.get(serverGroupName);
if (sgdpr == null) {
sgdpr = new ServerGroupDeploymentPlanResultImpl(serverGroupName);
serverGroupResults.put(serverGroupName, sgdpr);
}
for (Map.Entry<String, ServerUpdateResult> serverEntry : serverGroupActionResult.getResultByServer().entrySet()) {
String serverName = serverEntry.getKey();
ServerUpdateResult sud = serverEntry.getValue();
ServerDeploymentPlanResultImpl sdpr = (ServerDeploymentPlanResultImpl) sgdpr.getServerResult(serverName);
if (sdpr == null) {
sdpr = new ServerDeploymentPlanResultImpl(serverName);
sgdpr.storeServerResult(serverName, sdpr);
}
sdpr.storeServerUpdateResult(actionId, sud);
}
}
}
return serverGroupResults;
} | [
"Builds the data structures that show the effects of the plan by server group"
] | [
"Checks if a property's type is valid to be included in the report.\n@param _property the property.\n@return true if the property is is of a valid type.",
"Tells it to process the submatrix at the next split. Should be called after the\ncurrent submatrix has been processed.",
"Closes off this connection\n@para... |
public void insertBefore(Vertex vtx, Vertex next) {
vtx.prev = next.prev;
if (next.prev == null) {
head = vtx;
} else {
next.prev.next = vtx;
}
vtx.next = next;
next.prev = vtx;
} | [
"Inserts a vertex into this list before another specificed vertex."
] | [
"Determines if entry is accepted. For normal usage, this means confirming that the key is\nneeded. For orphan usage, this simply means confirming the key belongs to the node.\n\n@param key\n@return true iff entry is accepted.",
"Update the installed identity using the modified state from the modification.\n\n@par... |
public void resetQuotaAndRecoverEnforcement() {
for(Integer nodeId: nodeIds) {
boolean quotaEnforcement = mapNodeToQuotaEnforcingEnabled.get(nodeId);
adminClient.metadataMgmtOps.updateRemoteMetadata(Arrays.asList(nodeId),
MetadataStore.QUOTA_ENFORCEMENT_ENABLED_KEY,
Boolean.toString(quotaEnforcement));
}
for(String storeName: storeNames) {
adminClient.quotaMgmtOps.rebalanceQuota(storeName);
}
} | [
"After cluster management operations, i.e. reset quota and recover quota\nenforcement settings"
] | [
"Creates a single property declaration.\n@param property Property name.\n@param term Property value.\n@return The resulting declaration.",
"return a HashMap with all properties, name as key, value as value\n@return the properties",
"FOR internal use. This method was called after the external transaction was com... |
private void writeTasks(Project project)
{
Project.Tasks tasks = m_factory.createProjectTasks();
project.setTasks(tasks);
List<Project.Tasks.Task> list = tasks.getTask();
for (Task task : m_projectFile.getTasks())
{
list.add(writeTask(task));
}
} | [
"This method writes task data to an MSPDI file.\n\n@param project Root node of the MSPDI file"
] | [
"Saves a matrix to disk using Java binary serialization.\n\n@param A The matrix being saved.\n@param fileName Name of the file its being saved at.\n@throws java.io.IOException",
"Returns real unquoted value for a DisplayValue\n@param key\n@return",
"1-D Double array to integer array.\n\n@param array Double arra... |
protected static String jacksonObjectToString(Object object) {
try {
return mapper.writeValueAsString(object);
} catch (JsonProcessingException e) {
logger.error("Failed to serialize JSON data: " + e.toString());
return null;
}
} | [
"Serializes the given object in JSON and returns the resulting string. In\ncase of errors, null is returned. In particular, this happens if the\nobject is not based on a Jackson-annotated class. An error is logged in\nthis case.\n\n@param object\nobject to serialize\n@return JSON serialization or null"
] | [
"Returns Task field name of supplied code no.\n\n@param key - the code no of required Task field\n@return - field name",
"Moves everything up so that the specified shift or latch character can be inserted.\n\n@param position the position beyond which everything needs to be shifted\n@param c the latch or shift cha... |
public SelectStatement getPreparedSelectStatement(Query query, ClassDescriptor cld)
{
SelectStatement sql = new SqlSelectStatement(m_platform, cld, query, logger);
if (logger.isDebugEnabled())
{
logger.debug("SQL:" + sql.getStatement());
}
return sql;
} | [
"generate a select-Statement according to query\n\n@param query the Query\n@param cld the ClassDescriptor"
] | [
"Adds the headers.\n\n@param builder\nthe builder\n@param headerMap\nthe header map",
"Checks if there's exactly one option that exists among all opts.\n\n@param options OptionSet to checked\n@param opts List of options to be checked\n@throws VoldemortException",
"If needed, destroy the remaining conversation c... |
public static ConsistencyLevel determineConsistency(Map<Value, Set<ClusterNode>> versionNodeSetMap,
int replicationFactor) {
boolean fullyConsistent = true;
Value latestVersion = null;
for (Map.Entry<Value, Set<ClusterNode>> versionNodeSetEntry : versionNodeSetMap.entrySet()) {
Value value = versionNodeSetEntry.getKey();
if (latestVersion == null) {
latestVersion = value;
} else if (value.isTimeStampLaterThan(latestVersion)) {
latestVersion = value;
}
Set<ClusterNode> nodeSet = versionNodeSetEntry.getValue();
fullyConsistent = fullyConsistent && (nodeSet.size() == replicationFactor);
}
if (fullyConsistent) {
return ConsistencyLevel.FULL;
} else {
// latest write consistent, effectively consistent
if (latestVersion != null && versionNodeSetMap.get(latestVersion).size() == replicationFactor) {
return ConsistencyLevel.LATEST_CONSISTENT;
}
// all other states inconsistent
return ConsistencyLevel.INCONSISTENT;
}
} | [
"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 clusters\n@return ConsistencyLevel Enum"
] | [
"Join the Collection of Strings using the specified delimter and optionally quoting each\n\n@param s\nThe String collection\n@param delimiter\nthe delimiter String\n@param doQuote\nwhether or not to quote the Strings\n@return The joined String",
"Determines total number of partition-stores moved across zones.\n\n... |
private void handleHidden(FormInput input) {
String text = input.getInputValues().iterator().next().getValue();
if (null == text || text.length() == 0) {
return;
}
WebElement inputElement = browser.getWebElement(input.getIdentification());
JavascriptExecutor js = (JavascriptExecutor) browser.getWebDriver();
js.executeScript("arguments[0].setAttribute(arguments[1], arguments[2]);", inputElement,
"value", text);
} | [
"Enter information into the hidden input field.\n\n@param input The input to enter into the hidden field."
] | [
"Returns a UTMDetail object which consists of UTM parameters like source, medium & campaign\n@return The {@link UTMDetail} object",
"Checks whether the compilation has been canceled and reports the given work increment to the compiler progress.",
"Submit a command to the server.\n\n@param command The CLI comman... |
public static boolean containsOnlyNull(Object... values){
for(Object o : values){
if(o!= null){
return false;
}
}
return true;
} | [
"Check that an array only contains null elements.\n@param values, can't be null\n@return"
] | [
"Clean up the environment object for the given storage engine",
"Convert an object to another object with given type\n\n@param <T>\n@param source\nobject to convert\n@param typeReference\nreference to {@link java.lang.reflect.Type}\n@return the converted object if conversion failed\n@throws ConverterException",
... |
public static void log(final String templateName, final Template template, final Values values) {
new ValuesLogger().doLog(templateName, template, values);
} | [
"Log the values for the provided template.\n\n@param templateName the name of the template the values came from\n@param template the template object\n@param values the resultant values"
] | [
"Triggers expansion of the parent.",
"Unlink the specified reference from this object.\nMore info see OJB doc.\n\n@param obj Object with reference\n@param ord the ObjectReferenceDescriptor of the reference\n@param insert flag signals insert operation",
"Commits the working copy.\n\n@param commitMessage@return T... |
@Override
public ResourceStorageLoadable getOrCreateResourceStorageLoadable(final StorageAwareResource resource) {
try {
final ResourceStorageProviderAdapter stateProvider = IterableExtensions.<ResourceStorageProviderAdapter>head(Iterables.<ResourceStorageProviderAdapter>filter(resource.getResourceSet().eAdapters(), ResourceStorageProviderAdapter.class));
if ((stateProvider != null)) {
final ResourceStorageLoadable inputStream = stateProvider.getResourceStorageLoadable(resource);
if ((inputStream != null)) {
return inputStream;
}
}
InputStream _xifexpression = null;
boolean _exists = resource.getResourceSet().getURIConverter().exists(this.getBinaryStorageURI(resource.getURI()), CollectionLiterals.<Object, Object>emptyMap());
if (_exists) {
_xifexpression = resource.getResourceSet().getURIConverter().createInputStream(this.getBinaryStorageURI(resource.getURI()));
} else {
InputStream _xblockexpression = null;
{
final AbstractFileSystemAccess2 fsa = this.getFileSystemAccess(resource);
final String outputRelativePath = this.computeOutputPath(resource);
_xblockexpression = fsa.readBinaryFile(outputRelativePath);
}
_xifexpression = _xblockexpression;
}
final InputStream inputStream_1 = _xifexpression;
return this.createResourceStorageLoadable(inputStream_1);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
} | [
"Finds or creates a ResourceStorageLoadable for the given resource.\nClients should first call shouldLoadFromStorage to check whether there exists a storage version\nof the given resource.\n\n@return an IResourceStorageLoadable"
] | [
"Create a new instance for the specified host and encryption key.\n\n@see #create(String)",
"Returns the list of module dependencies regarding the provided filters\n\n@param moduleId String\n@param filters FiltersHolder\n@return List<Dependency>",
"Get a loader that lists the Files in the current path,\nand mon... |
public static void main(String[] args) {
TreebankLanguagePack tlp = new PennTreebankLanguagePack();
System.out.println("Start symbol: " + tlp.startSymbol());
String start = tlp.startSymbol();
System.out.println("Should be true: " + (tlp.isStartSymbol(start)));
String[] strs = {"-", "-LLB-", "NP-2", "NP=3", "NP-LGS", "NP-TMP=3"};
for (String str : strs) {
System.out.println("String: " + str + " basic: " + tlp.basicCategory(str) + " basicAndFunc: " + tlp.categoryAndFunction(str));
}
} | [
"Prints a few aspects of the TreebankLanguagePack, just for debugging."
] | [
"Gets a list of any tasks on this file with requested fields.\n\n@param fields optional fields to retrieve for this task.\n@return a list of tasks on this file.",
"Reduce the given value to the nearest smaller 1 significant digit number starting with 1, 2 or 5.\n\n@param value the value to find a nice number for.... |
private void addOp(String op, String path, String value) {
if (this.operations == null) {
this.operations = new JsonArray();
}
this.operations.add(new JsonObject()
.add("op", op)
.add("path", path)
.add("value", value));
} | [
"Adds a patch operation.\n@param op the operation type. Must be add, replace, remove, or test.\n@param path the path that designates the key. Must be prefixed with a \"/\".\n@param value the value to be set."
] | [
"Notifies that a footer item is changed.\n\n@param position the position.",
"Moves our current playback position to the specified beat; this will be reflected in any status and beat packets\nthat we are sending. An incoming value less than one will jump us to the first beat.\n\n@param beat the beat that we should... |
private Observable<Indexable> invokeReadyTasksAsync(final InvocationContext context) {
TaskGroupEntry<TaskItem> readyTaskEntry = super.getNext();
final List<Observable<Indexable>> observables = new ArrayList<>();
// Enumerate the ready tasks (those with dependencies resolved) and kickoff them concurrently
//
while (readyTaskEntry != null) {
final TaskGroupEntry<TaskItem> currentEntry = readyTaskEntry;
final TaskItem currentTaskItem = currentEntry.data();
if (currentTaskItem instanceof ProxyTaskItem) {
observables.add(invokeAfterPostRunAsync(currentEntry, context));
} else {
observables.add(invokeTaskAsync(currentEntry, context));
}
readyTaskEntry = super.getNext();
}
return Observable.mergeDelayError(observables);
} | [
"Invokes the ready tasks.\n\n@param context group level shared context that need be passed to\n{@link TaskGroupEntry#invokeTaskAsync(boolean, InvocationContext)}\nmethod of each entry in the group when it is selected for execution\n\n@return an observable that emits the result of tasks in the order they finishes."
... | [
"Used to get PB, when no tx is running.",
"Returns the configured body or the default value.",
"gets the first non annotation line number of a node, taking into account annotations.",
"Use this API to add cachecontentgroup.",
"Reads the cost rate tables from the file.\n\n@param resource parent resource\n@pa... |
public static nstrafficdomain_binding[] get(nitro_service service, Long td[]) throws Exception{
if (td !=null && td.length>0) {
nstrafficdomain_binding response[] = new nstrafficdomain_binding[td.length];
nstrafficdomain_binding obj[] = new nstrafficdomain_binding[td.length];
for (int i=0;i<td.length;i++) {
obj[i] = new nstrafficdomain_binding();
obj[i].set_td(td[i]);
response[i] = (nstrafficdomain_binding) obj[i].get_resource(service);
}
return response;
}
return null;
} | [
"Use this API to fetch nstrafficdomain_binding resources of given names ."
] | [
"Computes the d and H parameters.\n\nd = J'*(f(x)-y) <--- that's also the gradient\nH = J'*J",
"Find out which method to call on the service bean.",
"Checks if a parameter exists. If it exists, it is left untouched. If it doesn't, it is created. Only works for parameters which key\nis unique. Must be called ... |
public void add(ServiceReference<S> declarationBinderRef) throws InvalidFilterException {
BinderDescriptor binderDescriptor = new BinderDescriptor(declarationBinderRef);
declarationBinders.put(declarationBinderRef, binderDescriptor);
} | [
"Add the declarationBinderRef to the ImportersManager, create the corresponding.\nBinderDescriptor.\n\n@param declarationBinderRef the ServiceReference<DeclarationBinder> of the DeclarationBinder\n@throws InvalidFilterException"
] | [
"This method retrieves the UID for a calendar associated with a task.\n\n@param mpx MPX Task instance\n@return calendar UID",
"IN Criteria with SubQuery\n@param attribute The field name to be used\n@param subQuery The subQuery",
"Get a bean value from the context.\n\n@param name bean name\n@return bean value o... |
private Object mapToId(Object tmp) {
if (tmp instanceof Double) {
return new Integer(((Double)tmp).intValue());
} else {
return Context.toString(tmp);
}
} | [
"map a property id. Property id can only be an Integer or String"
] | [
"Converts to a link-local Ipv6 address. Any MAC prefix length is ignored. Other elements of this address section are incorporated into the conversion.\nThis will provide the latter 4 segments of an IPv6 address, to be paired with the link-local IPv6 prefix of 4 segments.\n\n@return",
"Whether this association c... |
public static int minutesDiff(Date earlierDate, Date laterDate) {
if (earlierDate == null || laterDate == null) {
return 0;
}
return (int) ((laterDate.getTime() / MINUTE_MILLIS) - (earlierDate.getTime() / MINUTE_MILLIS));
} | [
"Get the minutes difference"
] | [
"Add a IN clause so the column must be equal-to one of the objects from the list passed in.",
"Get the vector of regression coefficients.\n\n@param value The random variable to regress.\n@return The vector of regression coefficients.",
"Destroy the proxy & update the map containing the registration ref.\n\n@par... |
public static void configureLogging() {
// Create the appender that will write log messages to the console.
ConsoleAppender consoleAppender = new ConsoleAppender();
// Define the pattern of log messages.
// Insert the string "%c{1}:%L" to also show class name and line.
String pattern = "%d{yyyy-MM-dd HH:mm:ss} %-5p - %m%n";
consoleAppender.setLayout(new PatternLayout(pattern));
// Change to Level.ERROR for fewer messages:
consoleAppender.setThreshold(Level.INFO);
consoleAppender.activateOptions();
Logger.getRootLogger().addAppender(consoleAppender);
} | [
"Defines how messages should be logged. This method can be modified to\nrestrict the logging messages that are shown on the console or to change\ntheir formatting. See the documentation of Log4J for details on how to do\nthis."
] | [
"Retrieves the value of the given accessible field of the given receiver.\n\n@param receiver the container of the field, not <code>null</code>\n@param fieldName the field's name, not <code>null</code>\n@return the value of the field\n\n@throws NoSuchFieldException see {@link Class#getField(String)}\n@throws Securit... |
public void store(String gavc,
String action,
String commentText,
DbCredential credential,
String entityType) {
DbComment comment = new DbComment();
comment.setEntityId(gavc);
comment.setEntityType(entityType);
comment.setDbCommentedBy(credential.getUser());
comment.setAction(action);
if(!commentText.isEmpty()) {
comment.setDbCommentText(commentText);
}
comment.setDbCreatedDateTime(new Date());
repositoryHandler.store(comment);
} | [
"Store a comment based on comment text, gavc and user information\n\n@param gavc - entity id\n@param commentText - comment text\n@param credential - user credentials\n@param entityType - type of the entity"
] | [
"Returns true if this entity's primary key is not null, and for numeric\nfields, is non-zero.",
"This implementation does not support the 'offset' and 'maxResultSize' parameters.",
"Use this API to fetch vlan_interface_binding resources of given name .",
"This method extracts calendar data from an MSPDI file.... |
public static base_response update(nitro_service client, spilloverpolicy resource) throws Exception {
spilloverpolicy updateresource = new spilloverpolicy();
updateresource.name = resource.name;
updateresource.rule = resource.rule;
updateresource.action = resource.action;
updateresource.comment = resource.comment;
return updateresource.update_resource(client);
} | [
"Use this API to update spilloverpolicy."
] | [
"Add a row to the table. We have a limited understanding of the way\nBtrieve handles outdated rows, so we use what we think is a version number\nto try to ensure that we only have the latest rows.\n\n@param primaryKeyColumnName primary key column name\n@param map Map containing row data",
"Try to extract a numeri... |
public CrosstabBuilder useMainReportDatasource(boolean preSorted) {
DJDataSource datasource = new DJDataSource("ds",DJConstants.DATA_SOURCE_ORIGIN_REPORT_DATASOURCE,DJConstants.DATA_SOURCE_TYPE_JRDATASOURCE);
datasource.setPreSorted(preSorted);
crosstab.setDatasource(datasource);
return this;
} | [
"To use main report datasource. There should be nothing else in the detail band\n@param preSorted\n@return"
] | [
"This implementation returns whether the underlying asset exists.",
"Computes the householder vector used in QR decomposition.\n\nu = x / max(x)\nu(0) = u(0) + |u|\nu = u / u(0)\n\n@param x Input vector. Unmodified.\n@return The found householder reflector vector",
"Draw a rectangle's interior with this color.... |
private int determineForkedJvmCount(TestsCollection testCollection) {
int cores = Runtime.getRuntime().availableProcessors();
int jvmCount;
if (this.parallelism.equals(PARALLELISM_AUTO)) {
if (cores >= 8) {
// Maximum parallel jvms is 4, conserve some memory and memory bandwidth.
jvmCount = 4;
} else if (cores >= 4) {
// Make some space for the aggregator.
jvmCount = 3;
} else if (cores == 3) {
// Yes, three-core chips are a thing.
jvmCount = 2;
} else {
// even for dual cores it usually makes no sense to fork more than one
// JVM.
jvmCount = 1;
}
} else if (this.parallelism.equals(PARALLELISM_MAX)) {
jvmCount = Runtime.getRuntime().availableProcessors();
} else {
try {
jvmCount = Math.max(1, Integer.parseInt(parallelism));
} catch (NumberFormatException e) {
throw new BuildException("parallelism must be 'auto', 'max' or a valid integer: "
+ parallelism);
}
}
if (!testCollection.hasReplicatedSuites()) {
jvmCount = Math.min(testCollection.testClasses.size(), jvmCount);
}
return jvmCount;
} | [
"Determine how many forked JVMs to use."
] | [
"Create an instance from the given config.\n\n@param param Grid param from the request.",
"Returns the context the view is running in, through which it can\naccess the current theme, resources, etc.\n\n@return The view's Context.",
"Checks String to see if the parameter is null.\n@param paramValue Object tha... |
public void loadModel(GVRAndroidResource avatarResource)
{
EnumSet<GVRImportSettings> settings = GVRImportSettings.getRecommendedSettingsWith(EnumSet.of(GVRImportSettings.OPTIMIZE_GRAPH, GVRImportSettings.NO_ANIMATION));
GVRContext ctx = mAvatarRoot.getGVRContext();
GVRResourceVolume volume = new GVRResourceVolume(ctx, avatarResource);
GVRSceneObject modelRoot = new GVRSceneObject(ctx);
mAvatarRoot.addChildObject(modelRoot);
ctx.getAssetLoader().loadModel(volume, modelRoot, settings, false, mLoadModelHandler);
} | [
"Load the avatar base model\n@param avatarResource resource with avatar model"
] | [
"Verify the given job types are all valid.\n\n@param jobTypes the given job types\n@throws IllegalArgumentException if any of the job types are invalid\n@see #checkJobType(String, Class)",
"If there is a zero on the diagonal element, the off diagonal element needs pushed\noff so that all the algorithms assumption... |
private void writePropertyData() {
try (PrintStream out = new PrintStream(openResultFileOuputStream(
resultDirectory, "properties.json"))) {
out.println("{");
int count = 0;
for (Entry<Integer, PropertyRecord> propertyEntry : this.propertyRecords
.entrySet()) {
if (count > 0) {
out.println(",");
}
out.print("\"" + propertyEntry.getKey() + "\":");
mapper.writeValue(out, propertyEntry.getValue());
count++;
}
out.println("\n}");
System.out.println(" Serialized information for " + count
+ " properties.");
} catch (IOException e) {
e.printStackTrace();
}
} | [
"Writes all data that was collected about properties to a json file."
] | [
"Use this API to update ipv6.",
"get the ClassTypeSignature corresponding to given parameterized type\n\n@param parameterizedType\n@return",
"Use this API to delete sslfipskey of given name.",
"Parse a filter expression.\n\n@param filter the filter expression\n@return compiled nodes",
"Returns the directory... |
public String toMixedString() {
String result;
if(hasNoStringCache() || (result = stringCache.mixedString) == null) {
if(hasZone()) {
stringCache.mixedString = result = toNormalizedString(IPv6StringCache.mixedParams);
} else {
result = getSection().toMixedString();//the cache is shared so no need to update it here
}
}
return result;
} | [
"Produces a string in which the lower 4 bytes are expressed as an IPv4 address and the remaining upper bytes are expressed in IPv6 format.\n\nThis the mixed IPv6/IPv4 format described in RFC 1884 https://tools.ietf.org/html/rfc1884\n\n@return"
] | [
"Handle a change in the weeks of month.\n@param week the changed weeks checkbox's internal value.\n@param value the new value of the changed checkbox.",
"One of facade methods for operating the Shell.\n\nRun the obtained Shell with commandLoop().\n\n@see org.gearvrf.debug.cli.Shell#Shell(org.gearvrf.debug.cli.She... |
private void readResource(Document.Resources.Resource resource)
{
Resource mpxjResource = m_projectFile.addResource();
mpxjResource.setName(resource.getName());
mpxjResource.setResourceCalendar(m_calendarMap.get(resource.getCalendarID()));
mpxjResource.setStandardRate(new Rate(resource.getCost(), resource.getCostTimeUnit()));
mpxjResource.setEmailAddress(resource.getEMail());
mpxjResource.setGroup(resource.getGroup());
//resource.getHyperlinks()
mpxjResource.setUniqueID(resource.getID());
//resource.getMarkerID()
mpxjResource.setNotes(resource.getNote());
mpxjResource.setID(Integer.valueOf(resource.getOutlineNumber()));
//resource.getStyleProject()
mpxjResource.setType(resource.getSubType() == null ? resource.getType() : resource.getSubType());
} | [
"Reads a single resource from a ConceptDraw PROJECT file.\n\n@param resource ConceptDraw PROJECT resource"
] | [
"Remove the sequence for given sequence name.\n\n@param sequenceName Name of the sequence to remove.",
"Sets the bottom padding for all cells in the table.\n@param paddingBottom new padding, ignored if smaller than 0\n@return this to allow chaining",
"Execute a server task.\n\n@param listener the transactional ... |
public static boolean matches(Map<String, Object> nodeProperties, String[] keyColumnNames, Object[] keyColumnValues) {
for ( int i = 0; i < keyColumnNames.length; i++ ) {
String property = keyColumnNames[i];
Object expectedValue = keyColumnValues[i];
boolean containsProperty = nodeProperties.containsKey( property );
if ( containsProperty ) {
Object actualValue = nodeProperties.get( property );
if ( !sameValue( expectedValue, actualValue ) ) {
return false;
}
}
else if ( expectedValue != null ) {
return false;
}
}
return true;
} | [
"Check if the node matches the column values\n\n@param nodeProperties the properties on the node\n@param keyColumnNames the name of the columns to check\n@param keyColumnValues the value of the columns to check\n@return true if the properties of the node match the column names and values"
] | [
"Creates an temporary directory. The created directory will be deleted when\ncommand will ended.",
"Build a request URL.\n\n@param host\nThe host\n@param port\nThe port\n@param path\nThe path\n@param parameters\nThe parameters\n@return The URL\n@throws MalformedURLException\n@deprecated use {@link #buildSecureUrl... |
public IntervalFrequency getRefreshFrequency() {
switch (mRefreshInterval) {
case REALTIME_REFRESH_INTERVAL:
return IntervalFrequency.REALTIME;
case HIGH_REFRESH_INTERVAL:
return IntervalFrequency.HIGH;
case LOW_REFRESH_INTERVAL:
return IntervalFrequency.LOW;
case MEDIUM_REFRESH_INTERVAL:
return IntervalFrequency.MEDIUM;
default:
return IntervalFrequency.NONE;
}
} | [
"Get the refresh frequency of this scene object.\n\n@return The refresh frequency of this TextViewSceneObject."
] | [
"Internal used method which start the real store work.",
"Converts the given hash code into an index into the\nhash table.",
"Returns the ARGB components for all pixels in this image\n\n@return an array containing an array for each ARGB components in that order.",
"Parse a string representation of password sp... |
public static void permutationVector( DMatrixSparseCSC P , int[] vector) {
if( P.numCols != P.numRows ) {
throw new MatrixDimensionException("Expected a square matrix");
} else if( P.nz_length != P.numCols ) {
throw new IllegalArgumentException("Expected N non-zero elements in permutation matrix");
} else if( vector.length < P.numCols ) {
throw new IllegalArgumentException("vector is too short");
}
int M = P.numCols;
for (int i = 0; i < M; i++) {
if( P.col_idx[i+1] != i+1 )
throw new IllegalArgumentException("Unexpected number of elements in a column");
vector[P.nz_rows[i]] = i;
}
} | [
"Converts the permutation matrix into a vector\n@param P (Input) Permutation matrix\n@param vector (Output) Permutation vector"
] | [
"Resolve the disposal method for the given producer method. Any resolved\nbeans will be marked as such for the purpose of validating that all\ndisposal methods are used. For internal use.\n\n@param types the types\n@param qualifiers The binding types to match\n@param declaringBean declaring bean\n@return The set of... |
public LogSegment getLastView() {
List<LogSegment> views = getView();
return views.get(views.size() - 1);
} | [
"get the last segment at the moment\n\n@return the last segment"
] | [
"Use this API to fetch all the sslcertkey resources that are configured on netscaler.",
"Adds a slash to a path if it doesn't end with a slash.\n\n@param folderName The path to append a possible slash.\n@return The new, correct path.",
"Helper to read an optional Boolean value.\n@param path The XML path of the ... |
public Map<String, CmsJspCategoryAccessBean> getSubCategories() {
if (m_subCategories == null) {
m_subCategories = CmsCollectionsGenericWrapper.createLazyMap(new Transformer() {
@SuppressWarnings("synthetic-access")
public Object transform(Object pathPrefix) {
return new CmsJspCategoryAccessBean(m_cms, m_categories, (String)pathPrefix);
}
});
}
return m_subCategories;
} | [
"Returns a map from a category path to the wrapper of all the sub-categories of the category with the path given as key.\n\n@return a map from a category path to all sub-categories of the path's category."
] | [
"Preloads a sound file.\n\n@param soundFile path/name of the file to be played.",
"Accessor method used to retrieve a char representing the\ncontents of an individual field. If the field does not exist in the\nrecord, the default character is returned.\n\n@param field the index number of the field to be retrieved... |
public ItemRequest<Project> createInTeam(String team) {
String path = String.format("/teams/%s/projects", team);
return new ItemRequest<Project>(this, Project.class, path, "POST");
} | [
"Creates a project shared with the given team.\n\nReturns the full record of the newly created project.\n\n@param team The team to create the project in.\n@return Request object"
] | [
"This only gets half of the EnabledEndpoint from a JDBC ResultSet\nGetting the method for the override id requires an additional SQL query and needs to be called after\nthe SQL connection is released\n\n@param result result to scan for endpoint\n@return EnabledEndpoint\n@throws Exception exception",
"resolves a F... |
@Deprecated
public Location resolvePlaceURL(String flickrPlacesUrl) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_RESOLVE_PLACE_URL);
parameters.put("url", flickrPlacesUrl);
Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret);
if (response.isError()) {
throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
}
Element locationElement = response.getPayload();
return parseLocation(locationElement);
} | [
"Find Flickr Places information by Place URL.\n\n<p>\nThis method does not require authentication.\n</p>\n\n@deprecated This method has been deprecated. It won't be removed but you should use {@link PlacesInterface#getInfoByUrl(String)} instead.\n@param flickrPlacesUrl\n@return A Location\n@throws FlickrException"
... | [
"Set the given, single header value under the given name.\n@param headerName the header name\n@param headerValue the header value\n@throws UnsupportedOperationException if adding headers is not supported\n@see #put(String, List)\n@see #add(String, String)",
"I promise that this is always a collection of Hazeltask... |
public static DMatrixSparseCSC rectangle(int numRows , int numCols , int nz_total ,
double min , double max , Random rand ) {
nz_total = Math.min(numCols*numRows,nz_total);
int[] selected = UtilEjml.shuffled(numRows*numCols, nz_total, rand);
Arrays.sort(selected,0,nz_total);
DMatrixSparseCSC ret = new DMatrixSparseCSC(numRows,numCols,nz_total);
ret.indicesSorted = true;
// compute the number of elements in each column
int hist[] = new int[ numCols ];
for (int i = 0; i < nz_total; i++) {
hist[selected[i]/numRows]++;
}
// define col_idx
ret.histogramToStructure(hist);
for (int i = 0; i < nz_total; i++) {
int row = selected[i]%numRows;
ret.nz_rows[i] = row;
ret.nz_values[i] = rand.nextDouble()*(max-min)+min;
}
return ret;
} | [
"Randomly generates matrix with the specified number of non-zero elements filled with values from min to max.\n\n@param numRows Number of rows\n@param numCols Number of columns\n@param nz_total Total number of non-zero elements in the matrix\n@param min Minimum element value, inclusive\n@param max Maximum element v... | [
"DISPATCHING - COMMANDS",
"Returns all the Artifacts of the module\n\n@param module Module\n@return List<Artifact>",
"Read a four byte integer.\n\n@param data byte array\n@param offset offset into array\n@return integer value",
"Producers returned from this method are not validated. Internal use only.",
"Cr... |
private boolean initCheckTypeModifiers() {
Class<?> classInfoclass = Reflections.loadClass(CLASSINFO_CLASS_NAME, new ClassLoaderResourceLoader(classFileServices.getClass().getClassLoader()));
if (classInfoclass != null) {
try {
Method setFlags = AccessController.doPrivileged(GetDeclaredMethodAction.of(classInfoclass, "setFlags", short.class));
return setFlags != null;
} catch (Exception exceptionIgnored) {
BootstrapLogger.LOG.usingOldJandexVersion();
return false;
}
} else {
return true;
}
} | [
"checking availability of ClassInfo.setFlags method is just workaround for JANDEX-37"
] | [
"Get the max extent as a envelop object.",
"Read custom property definitions for tasks.\n\n@param gpTasks GanttProject tasks",
"Converts a vector from eigen space into sample space.\n\n@param eigenData Eigen space data.\n@return Sample space projection.",
"Fancy print without a space added to positive numbers... |
public static<T> SessionVar<T> vendSessionVar(T defValue) {
return (new VarsJBridge()).vendSessionVar(defValue, new Exception());
} | [
"Vend a SessionVar with the default value"
] | [
"Saves the project file displayed in this panel.\n\n@param file target file\n@param type file type",
"Get the collection of the server groups\n\n@return Collection of active server groups",
"Use this API to unset the properties of responderparam resource.\nProperties that need to be unset are specified in args ... |
public Pixel[] pixels() {
Pixel[] pixels = new Pixel[count()];
Point[] points = points();
for (int k = 0; k < points.length; k++) {
pixels[k] = pixel(points[k]);
}
return pixels;
} | [
"Returns all the pixels for the image\n\n@return an array of pixels for this image"
] | [
"Determine the generic value type of the given Map field.\n@param mapField the map field to introspect\n@param nestingLevel the nesting level of the target type\n(typically 1; e.g. in case of a List of Lists, 1 would indicate the\nnested List, whereas 2 would indicate the element of the nested List)\n@return the ge... |
public static int optionLength(String option) {
if(matchOption(option, "qualify", true) ||
matchOption(option, "qualifyGenerics", true) ||
matchOption(option, "hideGenerics", true) ||
matchOption(option, "horizontal", true) ||
matchOption(option, "all") ||
matchOption(option, "attributes", true) ||
matchOption(option, "enumconstants", true) ||
matchOption(option, "operations", true) ||
matchOption(option, "enumerations", true) ||
matchOption(option, "constructors", true) ||
matchOption(option, "visibility", true) ||
matchOption(option, "types", true) ||
matchOption(option, "autosize", true) ||
matchOption(option, "commentname", true) ||
matchOption(option, "nodefontabstractitalic", true) ||
matchOption(option, "postfixpackage", true) ||
matchOption(option, "noguillemot", true) ||
matchOption(option, "views", true) ||
matchOption(option, "inferrel", true) ||
matchOption(option, "useimports", true) ||
matchOption(option, "collapsible", true) ||
matchOption(option, "inferdep", true) ||
matchOption(option, "inferdepinpackage", true) ||
matchOption(option, "hideprivateinner", true) ||
matchOption(option, "compact", true))
return 1;
else if(matchOption(option, "nodefillcolor") ||
matchOption(option, "nodefontcolor") ||
matchOption(option, "nodefontsize") ||
matchOption(option, "nodefontname") ||
matchOption(option, "nodefontclasssize") ||
matchOption(option, "nodefontclassname") ||
matchOption(option, "nodefonttagsize") ||
matchOption(option, "nodefonttagname") ||
matchOption(option, "nodefontpackagesize") ||
matchOption(option, "nodefontpackagename") ||
matchOption(option, "edgefontcolor") ||
matchOption(option, "edgecolor") ||
matchOption(option, "edgefontsize") ||
matchOption(option, "edgefontname") ||
matchOption(option, "shape") ||
matchOption(option, "output") ||
matchOption(option, "outputencoding") ||
matchOption(option, "bgcolor") ||
matchOption(option, "hide") ||
matchOption(option, "include") ||
matchOption(option, "apidocroot") ||
matchOption(option, "apidocmap") ||
matchOption(option, "d") ||
matchOption(option, "view") ||
matchOption(option, "inferreltype") ||
matchOption(option, "inferdepvis") ||
matchOption(option, "collpackages") ||
matchOption(option, "nodesep") ||
matchOption(option, "ranksep") ||
matchOption(option, "dotexecutable") ||
matchOption(option, "link"))
return 2;
else if(matchOption(option, "contextPattern") ||
matchOption(option, "linkoffline"))
return 3;
else
return 0;
} | [
"Return the number of arguments associated with the specified option.\nThe return value includes the actual option.\nWill return 0 if the option is not supported."
] | [
"Merge another AbstractTransition's states into this object, such that the other AbstractTransition\ncan be discarded.\n\n@param another\n@return true if the merge is successful.",
"Sets the ojbQuery, needed only as long we\ndon't support the soda constraint stuff.\n@param ojbQuery The ojbQuery to set",
"Prepar... |
static PlexusConfiguration convert(ModelNode configuration, ModelNode jsonSchema, String extensionId, String id) {
ConversionContext ctx = new ConversionContext();
ctx.currentSchema = jsonSchema;
ctx.rootSchema = jsonSchema;
ctx.pushTag(extensionId);
ctx.id = id;
return convert(configuration, ctx);
} | [
"visibility increased for testing"
] | [
"Creates an operation to read a resource.\n\n@param address the address to create the read for\n@param recursive whether to search recursively or not\n\n@return the operation",
"Called when remote end send a message to this connection\n@param receivedMessage the message received\n@return this context",
"Remov... |
private void stopAllServersAndRemoveCamelContext(CamelContext camelContext) {
log.debug("Stopping all servers associated with {}", camelContext);
List<SingleBusLocatorRegistrar> registrars = locatorRegistrar.getAllRegistars(camelContext);
registrars.forEach(registrar -> registrar.stopAllServersAndRemoveCamelContext());
} | [
"Stops all servers linked with the current camel context\n\n@param camelContext"
] | [
"Creates a style definition used for the body element.\n@return The body style definition.",
"Update the BinderDescriptor of the declarationBinderRef.\n\n@param declarationBinderRef the ServiceReference<DeclarationBinder> of the DeclarationBinder",
"Use to generate a file based on generator node.",
"Create t... |
public static boolean isAscii(Slice utf8)
{
int length = utf8.length();
int offset = 0;
// Length rounded to 8 bytes
int length8 = length & 0x7FFF_FFF8;
for (; offset < length8; offset += 8) {
if ((utf8.getLongUnchecked(offset) & TOP_MASK64) != 0) {
return false;
}
}
// Enough bytes left for 32 bits?
if (offset + 4 < length) {
if ((utf8.getIntUnchecked(offset) & TOP_MASK32) != 0) {
return false;
}
offset += 4;
}
// Do the rest one by one
for (; offset < length; offset++) {
if ((utf8.getByteUnchecked(offset) & 0x80) != 0) {
return false;
}
}
return true;
} | [
"Does the slice contain only 7-bit ASCII characters."
] | [
"Use this API to update onlinkipv6prefix.",
"compute Sin using Taylor Series.\n\n@param x An angle, in radians.\n@param nTerms Number of terms.\n@return Result.",
"Sets up this object to represent an argument that will be set to a\nconstant value.\n\n@param constantValue the constant value.",
"Reads an a... |
public void setDirectory(final String directory) {
this.directory = new File(this.configuration.getDirectory(), directory);
if (!this.directory.exists()) {
throw new IllegalArgumentException(String.format(
"Directory does not exist: %s.\n" +
"Configuration contained value %s which is supposed to be relative to " +
"configuration directory.",
this.directory, directory));
}
if (!this.directory.getAbsolutePath()
.startsWith(this.configuration.getDirectory().getAbsolutePath())) {
throw new IllegalArgumentException(String.format(
"All files and directories must be contained in the configuration directory the " +
"directory provided in the configuration breaks that contract: %s in config " +
"file resolved to %s.",
directory, this.directory));
}
} | [
"Set the directory and test that the directory exists and is contained within the Configuration\ndirectory.\n\n@param directory the new directory"
] | [
"Returns the total number of times the app has been launched\n@return Total number of app launches in int",
"Specify the class represented by this `ClassNode` is annotated\nby an annotation class specified by the name\n@param name the name of the annotation class\n@return this `ClassNode` instance",
"Obtains a ... |
public static synchronized ExecutionStatistics get()
{
Thread currentThread = Thread.currentThread();
if (stats.get(currentThread) == null)
{
stats.put(currentThread, new ExecutionStatistics());
}
return stats.get(currentThread);
} | [
"Gets the instance associated with the current thread."
] | [
"Sets the current switch index based on object name.\nThis function finds the child of the scene object\nthis component is attached to and sets the switch\nindex to reference it so this is the object that\nwill be displayed.\n\nIf it is out of range, none of the children will be shown.\n@param childName name of chi... |
private void writeFields(String objectName, FieldContainer container, FieldType[] fields) throws IOException
{
m_writer.writeStartObject(objectName);
for (FieldType field : fields)
{
Object value = container.getCurrentValue(field);
if (value != null)
{
writeField(field, value);
}
}
m_writer.writeEndObject();
} | [
"Write a set of fields from a field container to a JSON file.\n@param objectName name of the object, or null if no name required\n@param container field container\n@param fields fields to write"
] | [
"Print the String features generated from a IN",
"Create a Task instance from a Phoenix activity.\n\n@param activity Phoenix activity data",
"Split string content into list\n@param content String content\n@return list",
"Generate a schedule for the given start and end date.\n\n@param referenceDate The referen... |
@Nonnull
private static Properties findDefaultProperties() {
final InputStream in = SourceCodeFormatter.class.getClassLoader().getResourceAsStream(DEFAULT_PROPERTIES_PATH);
final Properties p = new Properties();
try {
p.load(in);
} catch (final IOException e) {
throw new RuntimeException(String.format("Can not load resource %s", DEFAULT_PROPERTIES_PATH));
}
return p;
} | [
"Gets the default options to be passed when no custom properties are given.\n\n@return properties with formatter options"
] | [
"Add a raw statement as part of the where that can be anything that the database supports. Using more structured\nmethods is recommended but this gives more control over the query and allows you to utilize database specific\nfeatures.\n\n@param rawStatement\nThe statement that we should insert into the WHERE.\n\n@p... |
private void checkAndAddForbiddenStrings(final List<String> forbiddenSubStrings) {
for( String forbidden : forbiddenSubStrings ) {
if( forbidden == null ) {
throw new NullPointerException("forbidden substring should not be null");
}
this.forbiddenSubStrings.add(forbidden);
}
} | [
"Adds each forbidden substring, checking that it's not null.\n\n@param forbiddenSubStrings\nthe forbidden substrings\n@throws NullPointerException\nif a forbidden substring is null"
] | [
"Applies the matrices computed from the scene object's\nlinked to the skeleton bones to the current pose.\n@see #applyPose(GVRPose, int)\n@see #setPose(GVRPose)",
"Parse the string representation of a timestamp.\n\n@param value string representation\n@return Java representation",
"returns a sorted array of enum... |
protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException
{
boolean needsCommit = false;
long result = 0;
/*
arminw:
use the associated broker instance, check if broker was in tx or
we need to commit used connection.
*/
PersistenceBroker targetBroker = getBrokerForClass();
if(!targetBroker.isInTransaction())
{
targetBroker.beginTransaction();
needsCommit = true;
}
try
{
// lookup sequence name
String sequenceName = calculateSequenceName(field);
try
{
result = buildNextSequence(targetBroker, field.getClassDescriptor(), sequenceName);
/*
if 0 was returned we assume that the stored procedure
did not work properly.
*/
if (result == 0)
{
throw new SequenceManagerException("No incremented value retrieved");
}
}
catch (Exception e)
{
// maybe the sequence was not created
log.info("Could not grab next key, message was " + e.getMessage() +
" - try to write a new sequence entry to database");
try
{
// on create, make sure to get the max key for the table first
long maxKey = SequenceManagerHelper.getMaxForExtent(targetBroker, field);
createSequence(targetBroker, field, sequenceName, maxKey);
}
catch (Exception e1)
{
String eol = SystemUtils.LINE_SEPARATOR;
throw new SequenceManagerException(eol + "Could not grab next id, failed with " + eol +
e.getMessage() + eol + "Creation of new sequence failed with " +
eol + e1.getMessage() + eol, e1);
}
try
{
result = buildNextSequence(targetBroker, field.getClassDescriptor(), sequenceName);
}
catch (Exception e1)
{
throw new SequenceManagerException("Could not grab next id although a sequence seems to exist", e);
}
}
}
finally
{
if(targetBroker != null && needsCommit)
{
targetBroker.commitTransaction();
}
}
return result;
} | [
"Gets the actual key - will create a new row with the max key of table if it\ndoes not exist.\n@param field\n@return\n@throws SequenceManagerException"
] | [
"Create a TableAlias for path or userAlias\n@param aTable\n@param aPath\n@param aUserAlias\n@return TableAlias",
"Convert subQuery to SQL\n@param subQuery the subQuery value of SelectionCriteria",
"Use this API to add policydataset.",
"Sets the request type for this ID. Defaults to GET\n\n@param pathId ID of... |
private long getTime(Date start, Date end, long target, boolean after)
{
long total = 0;
if (start != null && end != null)
{
Date startTime = DateHelper.getCanonicalTime(start);
Date endTime = DateHelper.getCanonicalTime(end);
Date startDay = DateHelper.getDayStartDate(start);
Date finishDay = DateHelper.getDayStartDate(end);
//
// Handle the case where the end of the range is at midnight -
// this will show up as the start and end days not matching
//
if (startDay.getTime() != finishDay.getTime())
{
endTime = DateHelper.addDays(endTime, 1);
}
int diff = DateHelper.compare(startTime, endTime, target);
if (diff == 0)
{
if (after == true)
{
total = (endTime.getTime() - target);
}
else
{
total = (target - startTime.getTime());
}
}
else
{
if ((after == true && diff < 0) || (after == false && diff > 0))
{
total = (endTime.getTime() - startTime.getTime());
}
}
}
return (total);
} | [
"Calculates how much of a time range is before or after a\ntarget intersection point.\n\n@param start time range start\n@param end time range end\n@param target target intersection point\n@param after true if time after target required, false for time before\n@return length of time in milliseconds"
] | [
"Find all the node representing the entity.\n\n@param executionEngine the {@link GraphDatabaseService} used to run the query\n@return an iterator over the nodes representing an entity",
"Moves to the next step.",
"Removes double-quotes from around a string\n@param str\n@return",
"2-D Integer array to double a... |
public static String encodeUserInfo(String userInfo, String encoding) throws UnsupportedEncodingException {
return HierarchicalUriComponents.encodeUriComponent(userInfo, encoding, HierarchicalUriComponents.Type.USER_INFO);
} | [
"Encodes the given URI user info with the given encoding.\n@param userInfo the user info to be encoded\n@param encoding the character encoding to encode to\n@return the encoded user info\n@throws UnsupportedEncodingException when the given encoding parameter is not supported"
] | [
"Runs a method call with retries.\n@param pjp a {@link ProceedingJoinPoint} representing an annotated\nmethod call.\n@param retryableAnnotation the {@link org.fishwife.jrugged.aspects.Retryable}\nannotation that wrapped the method.\n@throws Throwable if the method invocation itself throws one during execution.\n@re... |
@Pure
public static <T> List<T> reverseView(List<T> list) {
return Lists.reverse(list);
} | [
"Provides a reverse view on the given list which is especially useful to traverse a list backwards in a for-each\nloop. The list itself is not modified by calling this method.\n\n@param list\nthe list whose elements should be traversed in reverse. May not be <code>null</code>.\n@return a list with the same elements... | [
"Stop interpolating playback position for all active players.",
"Process hours in a working day.\n\n@param calendar project calendar\n@param dayRecord working day data",
"this remove the linebreak.\n\n@param input\nthe input\n@param patternStr\nthe pattern str\n@return the string",
"Use this API to fetch all ... |
public Object getRealValue()
{
if(valueRealSubject != null)
{
return valueRealSubject;
}
else
{
TransactionExt tx = getTransaction();
if((tx != null) && tx.isOpen())
{
prepareValueRealSubject(tx.getBroker());
}
else
{
if(getPBKey() != null)
{
PBCapsule capsule = new PBCapsule(getPBKey(), null);
try
{
prepareValueRealSubject(capsule.getBroker());
}
finally
{
capsule.destroy();
}
}
else
{
getLog().warn("No tx, no PBKey - can't materialise value with Identity " + getKeyOid());
}
}
}
return valueRealSubject;
} | [
"Returns the real value object."
] | [
"Get the collection of untagged photos.\n\nThis method requires authentication with 'read' permission.\n\n@param perPage\n@param page\n@return A Collection of Photos\n@throws FlickrException",
"Returns the bundle jar classpath element.",
"Calculate start dates for a weekly recurrence.\n\n@param calendar current... |
@Pure
public static <P1, P2, RESULT> Function1<P2, RESULT> curry(final Function2<? super P1, ? super P2, ? extends RESULT> function,
final P1 argument) {
if (function == null)
throw new NullPointerException("function");
return new Function1<P2, RESULT>() {
@Override
public RESULT apply(P2 p) {
return function.apply(argument, p);
}
};
} | [
"Curries a function that takes two arguments.\n\n@param function\nthe original function. May not be <code>null</code>.\n@param argument\nthe fixed first argument of {@code function}.\n@return a function that takes one argument. Never <code>null</code>."
] | [
"Compare the controlDOM and testDOM and save and return the differences in a list.\n\n@return list with differences",
"Add a module to a module tree\n\n@param module\n@param tree",
"Creates the graphic element to be shown when the datasource is empty",
"Returns all methods for a specific group\n\n@param group... |
private void setExpressionForPrecalculatedTotalValue(
DJCrosstabColumn[] auxCols, DJCrosstabRow[] auxRows, JRDesignExpression measureExp, DJCrosstabMeasure djmeasure,
DJCrosstabColumn crosstabColumn, DJCrosstabRow crosstabRow, String meausrePrefix) {
String rowValuesExp = "new Object[]{";
String rowPropsExp = "new String[]{";
for (int i = 0; i < auxRows.length; i++) {
if (auxRows[i].getProperty()== null)
continue;
rowValuesExp += "$V{" + auxRows[i].getProperty().getProperty() +"}";
rowPropsExp += "\"" + auxRows[i].getProperty().getProperty() +"\"";
if (i+1<auxRows.length && auxRows[i+1].getProperty()!= null){
rowValuesExp += ", ";
rowPropsExp += ", ";
}
}
rowValuesExp += "}";
rowPropsExp += "}";
String colValuesExp = "new Object[]{";
String colPropsExp = "new String[]{";
for (int i = 0; i < auxCols.length; i++) {
if (auxCols[i].getProperty()== null)
continue;
colValuesExp += "$V{" + auxCols[i].getProperty().getProperty() +"}";
colPropsExp += "\"" + auxCols[i].getProperty().getProperty() +"\"";
if (i+1<auxCols.length && auxCols[i+1].getProperty()!= null){
colValuesExp += ", ";
colPropsExp += ", ";
}
}
colValuesExp += "}";
colPropsExp += "}";
String measureProperty = meausrePrefix + djmeasure.getProperty().getProperty();
String expText = "((("+DJCRosstabMeasurePrecalculatedTotalProvider.class.getName()+")$P{crosstab-measure__"+measureProperty+"_totalProvider}).getValueFor( "
+ colPropsExp +", "
+ colValuesExp +", "
+ rowPropsExp
+ ", "
+ rowValuesExp
+" ))";
if (djmeasure.getValueFormatter() != null){
String fieldsMap = ExpressionUtils.getTextForFieldsFromScriptlet();
String parametersMap = ExpressionUtils.getTextForParametersFromScriptlet();
String variablesMap = ExpressionUtils.getTextForVariablesFromScriptlet();
String stringExpression = "((("+DJValueFormatter.class.getName()+")$P{crosstab-measure__"+measureProperty+"_vf}).evaluate( "
+ "("+expText+"), " + fieldsMap +", " + variablesMap + ", " + parametersMap +" ))";
measureExp.setText(stringExpression);
measureExp.setValueClassName(djmeasure.getValueFormatter().getClassName());
} else {
// String expText = "((("+DJCRosstabMeasurePrecalculatedTotalProvider.class.getName()+")$P{crosstab-measure__"+djmeasure.getProperty().getProperty()+"_totalProvider}).getValueFor( "
// + colPropsExp +", "
// + colValuesExp +", "
// + rowPropsExp
// + ", "
// + rowValuesExp
// +" ))";
//
log.debug("text for crosstab total provider is: " + expText);
measureExp.setText(expText);
// measureExp.setValueClassName(djmeasure.getValueFormatter().getClassName());
String valueClassNameForOperation = ExpressionUtils.getValueClassNameForOperation(djmeasure.getOperation(),djmeasure.getProperty());
measureExp.setValueClassName(valueClassNameForOperation);
}
} | [
"set proper expression text invoking the DJCRosstabMeasurePrecalculatedTotalProvider for the cell\n@param auxRows\n@param auxCols\n@param measureExp\n@param djmeasure\n@param crosstabColumn\n@param crosstabRow\n@param meausrePrefix"
] | [
"Tests whether the ClassNode implements the specified method name\n\n@param classNode The ClassNode\n@param methodName The method name\n@param argTypes\n@return True if it implements the method",
"Use this API to fetch dnspolicy_dnsglobal_binding resources of given name .",
"Log original response\n\n@param http... |
public void processAnonymousField(Properties attributes) throws XDocletException
{
if (!attributes.containsKey(ATTRIBUTE_NAME))
{
throw new XDocletException(Translator.getString(XDocletModulesOjbMessages.class,
XDocletModulesOjbMessages.PARAMETER_IS_REQUIRED,
new String[]{ATTRIBUTE_NAME}));
}
String name = attributes.getProperty(ATTRIBUTE_NAME);
FieldDescriptorDef fieldDef = _curClassDef.getField(name);
String attrName;
if (fieldDef == null)
{
fieldDef = new FieldDescriptorDef(name);
_curClassDef.addField(fieldDef);
}
fieldDef.setAnonymous();
LogHelper.debug(false, OjbTagsHandler.class, "processAnonymousField", " Processing anonymous field "+fieldDef.getName());
attributes.remove(ATTRIBUTE_NAME);
for (Enumeration attrNames = attributes.propertyNames(); attrNames.hasMoreElements(); )
{
attrName = (String)attrNames.nextElement();
fieldDef.setProperty(attrName, attributes.getProperty(attrName));
}
fieldDef.setProperty(PropertyHelper.OJB_PROPERTY_ACCESS, "anonymous");
} | [
"Processes an anonymous field definition specified at the class level.\n\n@param attributes The attributes of the tag\n@exception XDocletException if an error occurs\n@doc.tag type=\"content\"\n@doc.param name=\"attributes\" optional=\"true\" description=\"Attribute... | [
"Removes the given service provider factory from the set of\nproviders for the service.\n\n@param serviceName\nThe fully qualified name of the service interface.\n@param factory\nA factory for creating a specific type of service\nprovider. May be <tt>null</tt> in which case this\nmethod does nothing.\n@throws Illeg... |
public static base_responses unset(nitro_service client, String sitename[], String args[]) throws Exception {
base_responses result = null;
if (sitename != null && sitename.length > 0) {
gslbsite unsetresources[] = new gslbsite[sitename.length];
for (int i=0;i<sitename.length;i++){
unsetresources[i] = new gslbsite();
unsetresources[i].sitename = sitename[i];
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | [
"Use this API to unset the properties of gslbsite resources.\nProperties that need to be unset are specified in args array."
] | [
"Use this API to fetch all the appfwwsdl resources that are configured on netscaler.",
"Locate a child block by byte pattern and validate by\nchecking the length of the string we are expecting\nto follow the pattern.\n\n@param bufferIndex start index\n@return true if a child block starts at this point",
"Set th... |
public static final Number parseExtendedAttributeCurrency(String value)
{
Number result;
if (value == null)
{
result = null;
}
else
{
result = NumberHelper.getDouble(Double.parseDouble(correctNumberFormat(value)) / 100);
}
return result;
} | [
"Parse an extended attribute currency value.\n\n@param value string representation\n@return currency value"
] | [
"Renames this file.\n\n@param newName the new name of the file.",
"returns an Array with an Identities PK VALUES\n@throws PersistenceBrokerException if there is an erros accessing o field values",
"Convert the continuous values into discrete values by chopping up\nthe distribution into several equally-sized int... |
public <Result, Param extends Resource> Result execWithTemporaryCaching(Param resource, IUnitOfWork<Result, Param> transaction) throws WrappedException {
CacheAdapter cacheAdapter = getOrCreate(resource);
IgnoreValuesMemento memento = cacheAdapter.ignoreNewValues();
try {
return transaction.exec(resource);
} catch (Exception e) {
throw new WrappedException(e);
} finally {
memento.done();
}
} | [
"The transaction will be executed with caching enabled. However, all newly cached values will be discarded as soon\nas the transaction is over.\n@since 2.1"
] | [
"Return cached object by key. The key will be concatenated with\ncurrent session id when fetching the cached object\n\n@param key\n@param <T>\nthe object type\n@return the cached object",
"Adds a listener to this collection.\n\n@param listener The listener to add",
"Add the steal information to the rebalancer s... |
public static snmpmanager[] get(nitro_service service) throws Exception{
snmpmanager obj = new snmpmanager();
snmpmanager[] response = (snmpmanager[])obj.get_resources(service);
return response;
} | [
"Use this API to fetch all the snmpmanager resources that are configured on netscaler."
] | [
"Parse the XML for a collection as returned by getInfo call.\n\n@param collectionElement\n@return",
"There is a race condition that is not handled properly by the DialogFragment class.\nIf we don't check that this onDismiss callback isn't for the old progress dialog from before\nthe device orientation change, the... |
private boolean isDepOfIdlArtifact(Artifact artifact, Map<String, Artifact> depsMap) {
List<String> depTrail = artifact.getDependencyTrail();
// depTrail can be null sometimes, which seems like a maven bug
if (depTrail != null) {
for (String name : depTrail) {
Artifact dep = depsMap.get(name);
if (dep != null && isIdlCalssifier(dep, classifier)) {
return true;
}
}
}
return false;
} | [
"Checks if the artifact is dependency of an dependent idl artifact\n@returns true if the artifact was a dependency of idl artifact"
] | [
"Checks if a property's type is valid to be included in the report.\n@param _property the property.\n@return true if the property is is of a valid type.",
"Log a warning for the resource at the provided address and a single attribute. The detail message is a default\n'Attributes are not understood in the target m... |
protected Class getClassCacheEntry(String name) {
if (name == null) return null;
synchronized (classCache) {
return classCache.get(name);
}
} | [
"gets a class from the class cache. This cache contains only classes loaded through\nthis class loader or an InnerLoader instance. If no class is stored for a\nspecific name, then the method should return null.\n\n@param name of the class\n@return the class stored for the given name\n@see #removeClassCacheEntry(Str... | [
"Count the statements and property uses of an item or property document.\n\n@param usageStatistics\nstatistics object to store counters in\n@param statementDocument\ndocument to count the statements of",
"Converts from partitionId to nodeId. The list of partition IDs,\npartitionIds, is expected to be a \"replicat... |
public int color(Context ctx) {
if (mColorInt == 0 && mColorRes != -1) {
mColorInt = ContextCompat.getColor(ctx, mColorRes);
}
return mColorInt;
} | [
"a small helper to get the color from the colorHolder\n\n@param ctx\n@return"
] | [
"The local event will decide the next state of the document in question.\n\n@param <T> the type of class represented by the document in the change event.\n@return the local full document which may be null.",
"Takes an object and converts it to a string.\n\n@param mapper the object mapper\n@param object the object... |
public static sslcipher[] get(nitro_service service) throws Exception{
sslcipher obj = new sslcipher();
sslcipher[] response = (sslcipher[])obj.get_resources(service);
return response;
} | [
"Use this API to fetch all the sslcipher resources that are configured on netscaler."
] | [
"Add a column to be set to a value for UPDATE statements. This will generate something like 'columnName =\nexpression' where the expression is built by the caller.\n\n<p>\nThe expression should have any strings escaped using the {@link #escapeValue(String)} or\n{@link #escapeValue(StringBuilder, String)} methods an... |
public Model interpolateModel(Model model, File projectDir, ModelBuildingRequest config,
ModelProblemCollector problems) {
interpolateObject(model, model, projectDir, config, problems);
return model;
} | [
"Empirical data from 3.x, actual =40"
] | [
"Use this API to unset the properties of nsspparams resource.\nProperties that need to be unset are specified in args array.",
"returns a unique String for given field.\nthe returned uid is unique accross all tables.",
"Detailed request to track additional data about PUT, GET and GET_ALL\n\n@param timeNS The ti... |
@SuppressWarnings("unchecked")
public static <T> T getJlsDefaultValue(Class<T> type) {
if(!type.isPrimitive()) {
return null;
}
return (T) JLS_PRIMITIVE_DEFAULT_VALUES.get(type);
} | [
"See also JLS8, 4.12.5 Initial Values of Variables.\n\n@param type\n@return the default value for the given type as defined by JLS"
] | [
"Sets the whole day flag.\n@param isWholeDay flag, indicating if the event lasts whole days.",
"Promote a module in the Grapes server\n\n@param name\n@param version\n@throws GrapesCommunicationException\n@throws javax.naming.AuthenticationException",
"Optionally specify the variable name to use for the output o... |
private void deliverDeviceUpdate(final DeviceUpdate update) {
for (DeviceUpdateListener listener : getUpdateListeners()) {
try {
listener.received(update);
} catch (Throwable t) {
logger.warn("Problem delivering device update to listener", t);
}
}
} | [
"Send a device update to all registered update listeners.\n\n@param update the device update that has just arrived"
] | [
"Send the message using the JavaMail session defined in the message\n\n@param mimeMessage Message to send",
"Calculates the Black-Scholes option value of a digital call option.\n\n@param initialStockValue The initial value of the underlying, i.e., the spot.\n@param riskFreeRate The risk free rate of the bank acco... |
public static void printDocumentation() {
System.out
.println("********************************************************************");
System.out.println("*** Wikidata Toolkit: GenderRatioProcessor");
System.out.println("*** ");
System.out
.println("*** This program will download and process dumps from Wikidata.");
System.out
.println("*** It will compute the numbers of articles about humans across");
System.out
.println("*** Wikimedia projects, and in particular it will count the articles");
System.out
.println("*** for each sex/gender. Results will be stored in a CSV file.");
System.out.println("*** See source code for further details.");
System.out
.println("********************************************************************");
} | [
"Prints some basic documentation about this program."
] | [
"Write resource assignment workgroup.\n\n@param record resource assignment workgroup instance\n@throws IOException",
"Determines if a mouse event is inside a box.",
"Convert an array of column definitions into a map keyed by column name.\n\n@param columns array of column definitions\n@return map of column defin... |
public Object copy(final Object obj, PersistenceBroker broker)
throws ObjectCopyException
{
ObjectOutputStream oos = null;
ObjectInputStream ois = null;
try
{
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
oos = new ObjectOutputStream(bos);
// serialize and pass the object
oos.writeObject(obj);
oos.flush();
final ByteArrayInputStream bin =
new ByteArrayInputStream(bos.toByteArray());
ois = new ObjectInputStream(bin);
// return the new object
return ois.readObject();
}
catch (Exception e)
{
throw new ObjectCopyException(e);
}
finally
{
try
{
if (oos != null)
{
oos.close();
}
if (ois != null)
{
ois.close();
}
}
catch (IOException ioe)
{
// ignore
}
}
} | [
"This implementation will probably be slower than the metadata\nobject copy, but this was easier to implement.\n@see org.apache.ojb.otm.copy.ObjectCopyStrategy#copy(Object)"
] | [
"Log a warning for the given operation at the provided address for the given attributes, using the provided detail\nmessage.\n\n@param address where warning occurred\n@param operation where which problem occurred\n@param message custom error message to append\n@param attributes attributes we that have proble... |
public List<Release> listReleases(String appName) {
return connection.execute(new ReleaseList(appName), apiKey);
} | [
"List of releases for an app.\n@param appName App name. See {@link #listApps} for a list of apps that can be used.\n@return a list of releases"
] | [
"Prints some basic documentation about this program.",
"True if deleted, false if not found.",
"This method reads an eight byte integer from the input array.\n\n@param data the input array\n@param offset offset of integer data in the array\n@return integer value",
"Retrieve the number of minutes per day for t... |
public GVRShader getTemplate(GVRContext ctx)
{
if (mShaderTemplate == null)
{
mShaderTemplate = makeTemplate(ID, ctx);
ctx.getShaderManager().addShaderID(this);
}
return mShaderTemplate;
} | [
"Gets the Java subclass of GVRShader which implements\nthis shader type.\n@param ctx GVRContext shader is associated with\n@return GVRShader class implementing the shader type"
] | [
"Get the configured hive.execution.engine. If not set it will default to the default value of HiveConf",
"Given a parameter, builds a new parameter for which the known generics placeholders are resolved.\n@param genericFromReceiver resolved generics from the receiver of the message\n@param placeholdersFromContext... |
public <T> Method getSetMethod(final Object object, final String fieldName, final Class<?> argumentType) {
if( object == null ) {
throw new NullPointerException("object should not be null");
} else if( fieldName == null ) {
throw new NullPointerException("fieldName should not be null");
} else if( argumentType == null ) {
throw new NullPointerException("argumentType should not be null");
}
Method method = setMethodsCache.get(object.getClass(), argumentType, fieldName);
if( method == null ) {
method = ReflectionUtils.findSetter(object, fieldName, argumentType);
setMethodsCache.set(object.getClass(), argumentType, fieldName, method);
}
return method;
} | [
"Returns the setter method for the field on an object.\n\n@param object\nthe object\n@param fieldName\nthe field name\n@param argumentType\nthe type to be passed to the setter\n@param <T>\nthe object type\n@return the setter method associated with the field on the object\n@throws NullPointerException\nif object, fi... | [
"Remove a key for all language versions. If a descriptor is present, the key is only removed in the descriptor.\n\n@param key the key to remove.\n@return <code>true</code> if removing was successful, <code>false</code> otherwise.",
"Sets the max.\n\n@param n the new max",
"Checks if a Zip is valid navigating th... |
public static Field read(DataInputStream is) throws IOException {
final byte tag = is.readByte();
final Field result;
switch (tag) {
case 0x0f:
case 0x10:
case 0x11:
result = new NumberField(tag, is);
break;
case 0x14:
result = new BinaryField(is);
break;
case 0x26:
result = new StringField(is);
break;
default:
throw new IOException("Unable to read a field with type tag " + tag);
}
logger.debug("..received> {}", result);
return result;
} | [
"Read a field from the supplied stream, starting with the tag that identifies the type, and reading enough\nto collect the corresponding value.\n\n@param is the stream on which a type tag is expected to be the next byte, followed by the field value.\n\n@return the field that was found on the stream.\n\n@throws IOEx... | [
"This method reads a single byte from the input stream.\n\n@param is the input stream\n@return byte value\n@throws IOException on file read error or EOF",
"Accesses a property from the DB configuration for the selected DB.\n\n@param name the name of the property\n@return the value of the property",
"See if a ra... |
private Expression correctClassClassChain(PropertyExpression pe) {
LinkedList<Expression> stack = new LinkedList<Expression>();
ClassExpression found = null;
for (Expression it = pe; it != null; it = ((PropertyExpression) it).getObjectExpression()) {
if (it instanceof ClassExpression) {
found = (ClassExpression) it;
break;
} else if (!(it.getClass() == PropertyExpression.class)) {
return pe;
}
stack.addFirst(it);
}
if (found == null) return pe;
if (stack.isEmpty()) return pe;
Object stackElement = stack.removeFirst();
if (!(stackElement.getClass() == PropertyExpression.class)) return pe;
PropertyExpression classPropertyExpression = (PropertyExpression) stackElement;
String propertyNamePart = classPropertyExpression.getPropertyAsString();
if (propertyNamePart == null || !propertyNamePart.equals("class")) return pe;
found.setSourcePosition(classPropertyExpression);
if (stack.isEmpty()) return found;
stackElement = stack.removeFirst();
if (!(stackElement.getClass() == PropertyExpression.class)) return pe;
PropertyExpression classPropertyExpressionContainer = (PropertyExpression) stackElement;
classPropertyExpressionContainer.setObjectExpression(found);
return pe;
} | [
"and class as property"
] | [
"Returns the JSON datatype for the property datatype as represented by\nthe given WDTK datatype IRI string.\n\n@param datatypeIri\nthe WDTK datatype IRI string; case-sensitive\n@throws IllegalArgumentException\nif the given datatype string is not known",
"Writes an activity to a PM XML file.\n\n@param mpxj MPXJ T... |
@Override
public <VALUEBASE, VALUE extends VALUEBASE, KEY extends Key<CoreMap, VALUEBASE>>
VALUE set(Class<KEY> key, VALUE value) {
if (immutableKeys.contains(key)) {
throw new HashableCoreMapException("Attempt to change value " +
"of immutable field "+key.getSimpleName());
}
return super.set(key, value);
} | [
"Sets the value associated with the given key; if the the key is one\nof the hashable keys, throws an exception.\n\n@throws HashableCoreMapException Attempting to set the value for an\nimmutable, hashable key."
] | [
"Retrieves state and metrics information for individual client connection.\n\n@param name connection name\n@return connection information",
"Notifies that an existing content item is moved to another position.\n\n@param fromPosition the original position.\n@param toPosition the new position.",
"Deletes the in... |
public static boolean removeDefaultCustomResponse(String pathValue, String requestType) {
try {
JSONObject profile = getDefaultProfile();
String profileName = profile.getString("name");
PathValueClient client = new PathValueClient(profileName, false);
return client.removeCustomResponse(pathValue, requestType);
} catch (Exception e) {
e.printStackTrace();
}
return false;
} | [
"Remove any overrides for an endpoint on the default profile, client\n\n@param pathValue path (endpoint) value\n@param requestType path request type. \"GET\", \"POST\", etc\n@return true if success, false otherwise"
] | [
"Converts a sequence of unicode code points to a sequence of Java characters.\n\n@return the number of chars written to the destination buffer",
"Invalidate the item in layout\n@param dataIndex data index",
"Sets the origin and direction of the pick ray.\n\n@param ox X coordinate of origin.\n@param oy Y c... |
public static base_response update(nitro_service client, nsconfig resource) throws Exception {
nsconfig updateresource = new nsconfig();
updateresource.ipaddress = resource.ipaddress;
updateresource.netmask = resource.netmask;
updateresource.nsvlan = resource.nsvlan;
updateresource.ifnum = resource.ifnum;
updateresource.tagged = resource.tagged;
updateresource.httpport = resource.httpport;
updateresource.maxconn = resource.maxconn;
updateresource.maxreq = resource.maxreq;
updateresource.cip = resource.cip;
updateresource.cipheader = resource.cipheader;
updateresource.cookieversion = resource.cookieversion;
updateresource.securecookie = resource.securecookie;
updateresource.pmtumin = resource.pmtumin;
updateresource.pmtutimeout = resource.pmtutimeout;
updateresource.ftpportrange = resource.ftpportrange;
updateresource.crportrange = resource.crportrange;
updateresource.timezone = resource.timezone;
updateresource.grantquotamaxclient = resource.grantquotamaxclient;
updateresource.exclusivequotamaxclient = resource.exclusivequotamaxclient;
updateresource.grantquotaspillover = resource.grantquotaspillover;
updateresource.exclusivequotaspillover = resource.exclusivequotaspillover;
updateresource.nwfwmode = resource.nwfwmode;
return updateresource.update_resource(client);
} | [
"Use this API to update nsconfig."
] | [
"used for encoding queries or form data",
"Returns whether this address contains the non-zero host addresses in other.\n@param other\n@return",
"Retrieves state and metrics information for individual client connection.\n\n@param name connection name\n@return connection information",
"Use this API to fetch aaa... |
public void delete() {
URL url = DEVICE_PIN_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE");
BoxAPIResponse response = request.send();
response.disconnect();
} | [
"Deletes the device pin."
] | [
"Sets the bean store\n\n@param beanStore The bean store",
"Assigns the element in the Matrix to the specified value. Performs a bounds check to make sure\nthe requested element is part of the matrix.\n\n@param row The row of the element.\n@param col The column of the element.\n@param value The element's new valu... |
private List<Row> createWorkPatternAssignmentRowList(String workPatterns) throws ParseException
{
List<Row> list = new ArrayList<Row>();
String[] patterns = workPatterns.split(",|:");
int index = 1;
while (index < patterns.length)
{
Integer workPattern = Integer.valueOf(patterns[index + 1]);
Date startDate = DatatypeConverter.parseBasicTimestamp(patterns[index + 3]);
Date endDate = DatatypeConverter.parseBasicTimestamp(patterns[index + 4]);
Map<String, Object> map = new HashMap<String, Object>();
map.put("WORK_PATTERN", workPattern);
map.put("START_DATE", startDate);
map.put("END_DATE", endDate);
list.add(new MapRow(map));
index += 5;
}
return list;
} | [
"Extract a list of work pattern assignments.\n\n@param workPatterns string representation of work pattern assignments\n@return list of work pattern assignment rows"
] | [
"Reads the entity hosting the association from the datastore and applies any property changes from the server\nside.",
"Set the model used by the left table.\n\n@param model table model",
"Converts a time in UTC to a gwt Date object which is in the timezone of\nthe current browser.\n\n@return The Date correspon... |
private List<StyleFilter> initStyleFilters(List<FeatureStyleInfo> styleDefinitions) throws GeomajasException {
List<StyleFilter> styleFilters = new ArrayList<StyleFilter>();
if (styleDefinitions == null || styleDefinitions.size() == 0) {
styleFilters.add(new StyleFilterImpl()); // use default.
} else {
for (FeatureStyleInfo styleDef : styleDefinitions) {
StyleFilterImpl styleFilterImpl = null;
String formula = styleDef.getFormula();
if (null != formula && formula.length() > 0) {
styleFilterImpl = new StyleFilterImpl(filterService.parseFilter(formula), styleDef);
} else {
styleFilterImpl = new StyleFilterImpl(Filter.INCLUDE, styleDef);
}
styleFilters.add(styleFilterImpl);
}
}
return styleFilters;
} | [
"Build list of style filters from style definitions.\n\n@param styleDefinitions\nlist of style definitions\n@return list of style filters\n@throws GeomajasException"
] | [
"Convert one project file format to another.\n\n@param inputFile input file\n@param outputFile output file\n@throws Exception",
"Given a read-only store name and a directory, swaps it in while returning\nthe directory path being swapped out\n\n@param storeName The name of the read-only store\n@param directory The... |
private ClassTypeSignature getClassTypeSignature(
ParameterizedType parameterizedType) {
Class<?> rawType = (Class<?>) parameterizedType.getRawType();
Type[] typeArguments = parameterizedType.getActualTypeArguments();
TypeArgSignature[] typeArgSignatures = new TypeArgSignature[typeArguments.length];
for (int i = 0; i < typeArguments.length; i++) {
typeArgSignatures[i] = getTypeArgSignature(typeArguments[i]);
}
String binaryName = rawType.isMemberClass() ? rawType.getSimpleName()
: rawType.getName();
ClassTypeSignature ownerTypeSignature = parameterizedType
.getOwnerType() == null ? null
: (ClassTypeSignature) getFullTypeSignature(parameterizedType
.getOwnerType());
ClassTypeSignature classTypeSignature = new ClassTypeSignature(
binaryName, typeArgSignatures, ownerTypeSignature);
return classTypeSignature;
} | [
"get the ClassTypeSignature corresponding to given parameterized type\n\n@param parameterizedType\n@return"
] | [
"Retrieves a specific range of items in this collection.\n@param offset the index of the first item to retrieve.\n@param limit the maximum number of items to retrieve after the offset.\n@param fields the fields to retrieve.\n@return a partial collection containing the specified range of items.",
... |
public void postArtifact(final Artifact artifact, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
final Client client = getClient(user, password);
final WebResource resource = client.resource(serverURL).path(RequestUtils.artifactResourcePath());
final ClientResponse response = resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class, artifact);
client.destroy();
if(ClientResponse.Status.CREATED.getStatusCode() != response.getStatus()){
final String message = "Failed to POST artifact";
if(LOG.isErrorEnabled()) {
LOG.error(String.format(HTTP_STATUS_TEMPLATE_MSG, message, response.getStatus()));
}
throw new GrapesCommunicationException(message, response.getStatus());
}
} | [
"Post an artifact to the Grapes server\n\n@param artifact The artifact to post\n@param user The user posting the information\n@param password The user password\n@throws GrapesCommunicationException\n@throws javax.naming.AuthenticationException"
] | [
"Reads color table as 256 RGB integer values.\n\n@param ncolors int number of colors to read.\n@return int array containing 256 colors (packed ARGB with full alpha).",
"Utility function that constructs AdminClient.\n\n@param url URL pointing to the bootstrap node\n@return Newly constructed AdminClient",
"Adds t... |
public static base_responses delete(nitro_service client, String acl6name[]) throws Exception {
base_responses result = null;
if (acl6name != null && acl6name.length > 0) {
nsacl6 deleteresources[] = new nsacl6[acl6name.length];
for (int i=0;i<acl6name.length;i++){
deleteresources[i] = new nsacl6();
deleteresources[i].acl6name = acl6name[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | [
"Use this API to delete nsacl6 resources of given names."
] | [
"Analyze all source code using the specified RuleSet and return the report results.\n\n@param ruleSet - the RuleSet to apply to each source component; must not be null.\n@return the results from applying the RuleSet to all of the source",
"Return as a string the stereotypes associated with c\nterminated by the es... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.