query
stringlengths
74
6.1k
positive
listlengths
1
1
negative
listlengths
9
9
public TileMap getCapabilities(TmsLayer layer) throws TmsLayerException { try { // Create a JaxB unmarshaller: JAXBContext context = JAXBContext.newInstance(TileMap.class); Unmarshaller um = context.createUnmarshaller(); // Find out where to retrieve the capabilities and unmarshall: if (layer.getBaseTmsUrl().startsWith(CLASSPATH)) { String location = layer.getBaseTmsUrl().substring(CLASSPATH.length()); if (location.length() > 0 && location.charAt(0) == '/') { // classpath resources should not start with a slash, but they often do location = location.substring(1); } ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (null == cl) { cl = getClass().getClassLoader(); // NOSONAR fallback from proper behaviour for some environments } InputStream is = cl.getResourceAsStream(location); if (null != is) { try { return (TileMap) um.unmarshal(is); } finally { try { is.close(); } catch (IOException ioe) { // ignore, just closing the stream } } } throw new TmsLayerException(TmsLayerException.COULD_NOT_FIND_FILE, layer.getBaseTmsUrl()); } // Normal case, find the URL and unmarshal: return (TileMap) um.unmarshal(httpService.getStream(layer.getBaseTmsUrl(), layer)); } catch (JAXBException e) { throw new TmsLayerException(e, TmsLayerException.COULD_NOT_READ_FILE, layer.getBaseTmsUrl()); } catch (IOException e) { throw new TmsLayerException(e, TmsLayerException.COULD_NOT_READ_FILE, layer.getBaseTmsUrl()); } }
[ "Get the configuration for a TMS layer by retrieving and parsing it's XML description file. The parsing is done\nusing JaxB.\n@param layer the tms layer to get capabilities for.\n@return Returns the description as a Java configuration object.\n@throws TmsLayerException\nIn case something went wrong trying to find o...
[ "add a join between two aliases\n\nTODO BRJ : This needs refactoring, it looks kind of weird\n\nno extents\nA1 -> A2\n\nextents on the right\nA1 -> A2\nA1 -> A2E0\n\nextents on the left : copy alias on right, extents point to copies\nA1 -> A2\nA1E0 -> A2C0\n\nextents on the left and right\nA1 -> A2\nA1 ...
public static responderhtmlpage get(nitro_service service) throws Exception{ responderhtmlpage obj = new responderhtmlpage(); responderhtmlpage[] response = (responderhtmlpage[])obj.get_resources(service); return response[0]; }
[ "Use this API to fetch all the responderhtmlpage resources that are configured on netscaler." ]
[ "Destroys an instance of the bean\n\n@param instance The instance", "Set possible tile URLs.\n\n@param tileUrls tile URLs", "Extracts the last revision id from the JSON response returned\nby the API after an edit\n\n@param response\nthe response as returned by Mediawiki\n@return\nthe new revision id of the edit...
private void writeResources() throws IOException { writeAttributeTypes("resource_types", ResourceField.values()); m_writer.writeStartList("resources"); for (Resource resource : m_projectFile.getResources()) { writeFields(null, resource, ResourceField.values()); } m_writer.writeEndList(); }
[ "This method writes resource data to a JSON file." ]
[ "Promote a module in the Grapes server\n\n@param name\n@param version\n@throws GrapesCommunicationException\n@throws javax.naming.AuthenticationException", "Use this API to fetch clusterinstance_binding resource of given name .", "Returns iterable with all enterprise assignments of this retention policy.\n@para...
public static String getURLParentDirectory(String urlString) throws IllegalArgumentException { URL url = null; try { url = new URL(urlString); } catch (MalformedURLException e) { throw Exceptions.IllegalArgument("Malformed URL: %s", url); } String path = url.getPath(); int lastSlashIndex = path.lastIndexOf("/"); String directory = lastSlashIndex == -1 ? "" : path.substring(0, lastSlashIndex); return String.format("%s://%s%s%s%s", url.getProtocol(), url.getUserInfo() == null ? "" : url.getUserInfo() + "@", url.getHost(), url.getPort() == -1 ? "" : ":" + Integer.toString(url.getPort()), directory); }
[ "Returns the directory of the URL.\n\n@param urlString URL of the file.\n@return The directory string.\n@throws IllegalArgumentException if URL is malformed" ]
[ "Create and add model controller handler to an existing management channel handler.\n\n@param handler the channel handler\n@return the created client", "Validates a space separated list of emails.\n\n@param emails Space separated list of emails\n@return {@link hudson.util.FormValidation.ok()} if valid or empty, e...
public static <T, R extends Resource<T>> T getEntity(R resource) { return resource.getEntity(); }
[ "Return the entity of a resource\n\n@param resource the resource\n@param <T> the type of the resource's entity\n@param <R> the resource type\n@return the resource's entity" ]
[ "Append the given item to the end of the list\n@param segment segment to append", "Whether the address has the well-known prefix for IPv4 translatable addresses as in rfc 6052 and 6144\n@return", "Add an exception to a calendar.\n\n@param parentNode parent node\n@param exception calendar exceptions", "Retriev...
public List<String> getPropertyPaths() { List<String> result = new ArrayList<String>(); for (String property : this.values.names()) { if (!property.startsWith("$")) { result.add(this.propertyToPath(property)); } } return result; }
[ "Returns a list of metadata property paths.\n@return the list of metdata property paths." ]
[ "Read task relationships.", "Get the cached entry or null if no valid cached entry is found.", "Sets the ssh password.\n\n@param password\nthe password\n@return the parallel task builder", "Convert from a DTO to an internal Spring bean definition.\n\n@param beanDefinitionDto The DTO object.\n@return Returns a...
public AT_Row setPaddingRightChar(Character paddingRightChar) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setPaddingRightChar(paddingRightChar); } } return this; }
[ "Sets the right padding character for all cells in the row.\n@param paddingRightChar new padding character, ignored if null\n@return this to allow chaining" ]
[ "Process a module or bundle root.\n\n@param root the root\n@param layers the processed layers\n@param setter the bundle or module path setter\n@throws IOException", "Generate an opaque pagination token from the supplied PageMetadata.\n\n@param pageMetadata page metadata of the page for which the token should be...
public static sslglobal_sslpolicy_binding[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{ sslglobal_sslpolicy_binding obj = new sslglobal_sslpolicy_binding(); options option = new options(); option.set_filter(filter); sslglobal_sslpolicy_binding[] response = (sslglobal_sslpolicy_binding[]) obj.getfiltered(service, option); return response; }
[ "Use this API to fetch filtered set of sslglobal_sslpolicy_binding resources.\nset the filter parameter values in filtervalue object." ]
[ "Log a fatal message.", "Returns the output path specified on the javadoc options", "Checks if the given group of statements contains the given value as the\nvalue of a main snak of some statement.\n\n@param statementGroup\nthe statement group to scan\n@param value\nthe value to scan for\n@return true if value ...
public static Map<String, List<String>> getConsumersPerTopic(ZkClient zkClient, String group) { ZkGroupDirs dirs = new ZkGroupDirs(group); List<String> consumers = getChildrenParentMayNotExist(zkClient, dirs.consumerRegistryDir); // Map<String, List<String>> consumersPerTopicMap = new HashMap<String, List<String>>(); for (String consumer : consumers) { TopicCount topicCount = getTopicCount(zkClient, group, consumer); for (Map.Entry<String, Set<String>> e : topicCount.getConsumerThreadIdsPerTopic().entrySet()) { final String topic = e.getKey(); for (String consumerThreadId : e.getValue()) { List<String> list = consumersPerTopicMap.get(topic); if (list == null) { list = new ArrayList<String>(); consumersPerTopicMap.put(topic, list); } // list.add(consumerThreadId); } } } // for (Map.Entry<String, List<String>> e : consumersPerTopicMap.entrySet()) { Collections.sort(e.getValue()); } return consumersPerTopicMap; }
[ "get all consumers for the group\n\n@param zkClient the zookeeper client\n@param group the group name\n@return topic-&gt;(consumerIdStringA-0,consumerIdStringA-1...consumerIdStringB-0,consumerIdStringB-1)" ]
[ "Add a cause to the backtrace.\n\n@param cause\nthe cause\n@param bTrace\nthe backtrace list", "Notifies that a footer item is inserted.\n\n@param position the position of the content item.", "Commit all written data to the physical disk\n\n@throws IOException any io exception", "Use this API to fetch sslocsp...
public RandomVariable getValues(double evaluationTime, LIBORMarketModel model) { if(evaluationTime > 0) { throw new RuntimeException("Forward start evaluation currently not supported."); } // Fetch the covariance model of the model LIBORCovarianceModel covarianceModel = model.getCovarianceModel(); // We sum over all forward rates int numberOfComponents = covarianceModel.getLiborPeriodDiscretization().getNumberOfTimeSteps(); // Accumulator RandomVariable integratedLIBORCurvature = new RandomVariableFromDoubleArray(0.0); for(int componentIndex = 0; componentIndex < numberOfComponents; componentIndex++) { // Integrate from 0 up to the fixing of the rate double timeEnd = covarianceModel.getLiborPeriodDiscretization().getTime(componentIndex); int timeEndIndex = covarianceModel.getTimeDiscretization().getTimeIndex(timeEnd); // If timeEnd is not in the time discretization we get timeEndIndex = -insertionPoint-1. In that case, we use the index prior to the insertionPoint if(timeEndIndex < 0) { timeEndIndex = -timeEndIndex - 2; } // Sum squared second derivative of the variance for all components at this time step RandomVariable integratedLIBORCurvatureCurrentRate = new RandomVariableFromDoubleArray(0.0); for(int timeIndex = 0; timeIndex < timeEndIndex-2; timeIndex++) { double timeStep1 = covarianceModel.getTimeDiscretization().getTimeStep(timeIndex); double timeStep2 = covarianceModel.getTimeDiscretization().getTimeStep(timeIndex+1); RandomVariable covarianceLeft = covarianceModel.getCovariance(timeIndex+0, componentIndex, componentIndex, null); RandomVariable covarianceCenter = covarianceModel.getCovariance(timeIndex+1, componentIndex, componentIndex, null); RandomVariable covarianceRight = covarianceModel.getCovariance(timeIndex+2, componentIndex, componentIndex, null); // Calculate second derivative RandomVariable curvatureSquared = covarianceRight.sub(covarianceCenter.mult(2.0)).add(covarianceLeft); curvatureSquared = curvatureSquared.div(timeStep1 * timeStep2); // Take square curvatureSquared = curvatureSquared.squared(); // Integrate over time integratedLIBORCurvatureCurrentRate = integratedLIBORCurvatureCurrentRate.add(curvatureSquared.mult(timeStep1)); } // Empty intervall - skip if(timeEnd == 0) { continue; } // Average over time integratedLIBORCurvatureCurrentRate = integratedLIBORCurvatureCurrentRate.div(timeEnd); // Take square root integratedLIBORCurvatureCurrentRate = integratedLIBORCurvatureCurrentRate.sqrt(); // Take max over all forward rates integratedLIBORCurvature = integratedLIBORCurvature.add(integratedLIBORCurvatureCurrentRate); } integratedLIBORCurvature = integratedLIBORCurvature.div(numberOfComponents); return integratedLIBORCurvature.sub(tolerance).floor(0.0); }
[ "Calculates the squared curvature of the LIBOR instantaneous variance.\n\n@param evaluationTime Time at which the product is evaluated.\n@param model A model implementing the LIBORModelMonteCarloSimulationModel\n@return The squared curvature of the LIBOR instantaneous variance (reduced a possible tolerance). The re...
[ "Creates the udpClient with proper handler.\n\n@return the bound request builder\n@throws HttpRequestCreateException\nthe http request create exception", "Get the photos for the specified group pool, optionally filtering by taf.\n\nThis method does not require authentication.\n\n@see com.flickr4java.flickr.photos...
private boolean pathMatches(Path path, SquigglyContext context) { List<SquigglyNode> nodes = context.getNodes(); Set<String> viewStack = null; SquigglyNode viewNode = null; int pathSize = path.getElements().size(); int lastIdx = pathSize - 1; for (int i = 0; i < pathSize; i++) { PathElement element = path.getElements().get(i); if (viewNode != null && !viewNode.isSquiggly()) { Class beanClass = element.getBeanClass(); if (beanClass != null && !Map.class.isAssignableFrom(beanClass)) { Set<String> propertyNames = getPropertyNamesFromViewStack(element, viewStack); if (!propertyNames.contains(element.getName())) { return false; } } } else if (nodes.isEmpty()) { return false; } else { SquigglyNode match = findBestSimpleNode(element, nodes); if (match == null) { match = findBestViewNode(element, nodes); if (match != null) { viewNode = match; viewStack = addToViewStack(viewStack, viewNode); } } else if (match.isAnyShallow()) { viewNode = match; } else if (match.isAnyDeep()) { return true; } if (match == null) { if (isJsonUnwrapped(element)) { continue; } return false; } if (match.isNegated()) { return false; } nodes = match.getChildren(); if (i < lastIdx && nodes.isEmpty() && !match.isEmptyNested() && SquigglyConfig.isFilterImplicitlyIncludeBaseFields()) { nodes = BASE_VIEW_NODES; } } } return true; }
[ "perform the actual matching" ]
[ "This method is called from Javascript, passing in the previously created\ncallback key. It uses that to find the correct handler and then passes on\nthe call. State events in the Google Maps API don't pass any parameters.\n\n@param callbackKey Key generated by the call to registerHandler.", "Builds a batch-fetch...
public void setConnectionTimeout(long connectionTimeout, TimeUnit timeUnit) { this.connectionTimeoutInMs = TimeUnit.MILLISECONDS.convert(connectionTimeout, timeUnit); }
[ "Sets the maximum time to wait before a call to getConnection is timed out.\n\nSetting this to zero is similar to setting it to Long.MAX_VALUE\n\n@param connectionTimeout\n@param timeUnit the unit of the connectionTimeout argument" ]
[ "Read an optional int value form a JSON value.\n@param val the JSON value that should represent the int.\n@return the int from the JSON or 0 reading the int fails.", "Validates a String to be a valid name to be used in MongoDB for a field name.\n\n@param fieldName", "Writes assignment data to a PM XML file.", ...
private void reportException(Exception e) { logger.error("Failed to write JSON export: " + e.toString()); throw new RuntimeException(e.toString(), e); }
[ "Reports a given exception as a RuntimeException, since the interface does\nnot allow us to throw checked exceptions directly.\n\n@param e\nthe exception to report\n@throws RuntimeException\nin all cases" ]
[ "Sets the value for the API's \"sitefilter\" parameter based on the current\nsettings.\n\n@param properties\ncurrent setting of parameters", "Converts a collection of dates to a JSON array with the long representation of the dates as strings.\n@param dates the list to convert.\n@return JSON array with long values...
public float getSphereBound(float[] sphere) { if ((sphere == null) || (sphere.length != 4) || ((NativeVertexBuffer.getBoundingVolume(getNative(), sphere)) < 0)) { throw new IllegalArgumentException("Cannot copy sphere bound into array provided"); } return sphere[0]; }
[ "Returns the bounding sphere of the vertices.\n@param sphere destination array to get bounding sphere.\nThe first entry is the radius, the next\nthree are the center.\n@return radius of bounding sphere or 0.0 if no vertices" ]
[ "Use this API to delete sslcipher resources of given names.", "Recursively add indirect subclasses to a class record.\n\n@param directSuperClass\nthe superclass to add (together with its own superclasses)\n@param subClassRecord\nthe subclass to add to", "Register this broker in ZK for the first time.", "Extra...
public static crvserver_binding get(nitro_service service, String name) throws Exception{ crvserver_binding obj = new crvserver_binding(); obj.set_name(name); crvserver_binding response = (crvserver_binding) obj.get_resource(service); return response; }
[ "Use this API to fetch crvserver_binding resource of given name ." ]
[ "Use this API to fetch dnspolicy_dnspolicylabel_binding resources of given name .", "Tries to load the custom error page at the given rootPath.\n@param cms {@link CmsObject} used for reading the resource (site root and uri get adjusted!)\n@param req the current request\n@param res the current response\n@param roo...
@SuppressWarnings("checkstyle:illegalcatch") private boolean sendMessage(final byte[] messageToSend) { try { connectionPool.execute(new PooledObjectConsumer<TcpConnection>() { @Override public void accept(final TcpConnection tcpConnection) throws IOException { tcpConnection.write(messageToSend); } }); } catch (final Exception e) { addError(String.format("Error sending message via tcp://%s:%s", getGraylogHost(), getGraylogPort()), e); return false; } return true; }
[ "Send message to socket's output stream.\n\n@param messageToSend message to send.\n\n@return {@code true} if message was sent successfully, {@code false} otherwise." ]
[ "Read all configuration files.\n@return the list with all available configurations", "Performs the update to the persistent configuration model. This default implementation simply removes\nthe targeted resource.\n\n@param context the operation context\n@param operation the operation\n@throws OperationFailedExcep...
public void deleteModule(final String name, final String version, final String user, final String password) throws GrapesCommunicationException, AuthenticationException{ final Client client = getClient(user, password); final WebResource resource = client.resource(serverURL).path(RequestUtils.getModulePath(name, version)); final ClientResponse response = resource.delete(ClientResponse.class); client.destroy(); if(ClientResponse.Status.OK.getStatusCode() != response.getStatus()){ final String message = String.format(FAILED_TO_GET_MODULE, "to delete module", name, version); if(LOG.isErrorEnabled()) { LOG.error(String.format(HTTP_STATUS_TEMPLATE_MSG, message, response.getStatus())); } throw new GrapesCommunicationException(message, response.getStatus()); } }
[ "Delete a module from Grapes server\n\n@param name\n@param version\n@throws GrapesCommunicationException\n@throws javax.naming.AuthenticationException" ]
[ "Whether this section is consistent with an EUI64 section,\nwhich means it came from an extended 8 byte address,\nand the corresponding segments in the middle match 0xff and 0xfe\n\n@param partial whether missing segments are considered a match\n@return", "Send Identify Node message to the controller.\n@param nod...
private void addListeners(ProjectReader reader) { if (m_projectListeners != null) { for (ProjectListener listener : m_projectListeners) { reader.addProjectListener(listener); } } }
[ "Adds any listeners attached to this reader to the reader created internally.\n\n@param reader internal project reader" ]
[ "Prepare the document before rendering.\n\n@param outputStream output stream to render to, null if only for layout\n@param format format\n@throws DocumentException oops\n@throws IOException oops\n@throws PrintingException oops", "Convenience routine to move to the next iterator if needed.\n@return true if the ite...
public static scpolicy_stats[] get(nitro_service service) throws Exception{ scpolicy_stats obj = new scpolicy_stats(); scpolicy_stats[] response = (scpolicy_stats[])obj.stat_resources(service); return response; }
[ "Use this API to fetch the statistics of all scpolicy_stats resources that are configured on netscaler." ]
[ "Use this API to fetch all the csparameter resources that are configured on netscaler.", "Set an enterprise number value.\n\n@param index number index (1-40)\n@param value number value", "Create a single node representing an embedded element.\n\n@param executionEngine the {@link GraphDatabaseService} used to ru...
public static Configuration loadFromString(String config) throws IOException, SAXException { ConfigurationImpl cfg = new ConfigurationImpl(); XMLReader parser = XMLReaderFactory.createXMLReader(); parser.setContentHandler(new ConfigHandler(cfg, null)); Reader reader = new StringReader(config); parser.parse(new InputSource(reader)); return cfg; }
[ "Loads the configuration XML from the given string.\n@since 1.3" ]
[ "Checks the existence of the directory. If it does not exist, the method creates it.\n\n@param dir the directory to check.\n@throws IOException if fails.", "Bessel function of order n.\n\n@param n Order.\n@param x Value.\n@return J value.", "create a consumer\n\n@param zookeeperConfig connect config of zookeepe...
public Set<URI> collectOutgoingReferences(IResourceDescription description) { URI resourceURI = description.getURI(); Set<URI> result = null; for(IReferenceDescription reference: description.getReferenceDescriptions()) { URI targetResource = reference.getTargetEObjectUri().trimFragment(); if (!resourceURI.equals(targetResource)) { if (result == null) result = Sets.newHashSet(targetResource); else result.add(targetResource); } } if (result != null) return result; return Collections.emptySet(); }
[ "Collect the URIs of resources, that are referenced by the given description.\n@return the list of referenced URIs. Never <code>null</code>." ]
[ "Sort MapRows based on a named attribute.\n\n@param rows map rows to sort\n@param attribute attribute to sort on\n@return list argument (allows method chaining)", "Checks if the DPI value is already set for GeoServer.", "This is private because the execute is the only method that should be called here.", "Non...
protected void processProjectListItem(Map<Integer, String> result, Row row) { Integer id = row.getInteger("PROJ_ID"); String name = row.getString("PROJ_NAME"); result.put(id, name); }
[ "Retrieve the details of a single project from the database.\n\n@param result Map instance containing the results\n@param row result set row read from the database" ]
[ "Convert the message to a FinishRequest", "Decides what are the preferred credentials to use for resolving the repo keys of the server\n\n@return Preferred credentials for repo resolving. Never null.", "Use this API to fetch all the lbroute resources that are configured on netscaler.", "This method is called ...
@Pure public static <P1, P2, P3> Procedure2<P2, P3> curry(final Procedure3<? super P1, ? super P2, ? super P3> procedure, final P1 argument) { if (procedure == null) throw new NullPointerException("procedure"); return new Procedure2<P2, P3>() { @Override public void apply(P2 p2, P3 p3) { procedure.apply(argument, p2, p3); } }; }
[ "Curries a procedure that takes three arguments.\n\n@param procedure\nthe original procedure. May not be <code>null</code>.\n@param argument\nthe fixed first argument of {@code procedure}.\n@return a procedure that takes two arguments. Never <code>null</code>." ]
[ "Append the text supplied by the Writer at the end of the File, using a specified encoding.\n\n@param file a File\n@param writer the Writer supplying the text to append at the end of the File\n@param charset the charset used\n@throws IOException if an IOException occurs.\n@since 2.3", "Calls the httpHandler metho...
protected long getRevisionIdFromResponse(JsonNode response) throws JsonMappingException { if(response == null) { throw new JsonMappingException("API response is null"); } JsonNode entity = null; if(response.has("entity")) { entity = response.path("entity"); } else if(response.has("pageinfo")) { entity = response.path("pageinfo"); } if(entity != null && entity.has("lastrevid")) { return entity.path("lastrevid").asLong(); } throw new JsonMappingException("The last revision id could not be found in API response"); }
[ "Extracts the last revision id from the JSON response returned\nby the API after an edit\n\n@param response\nthe response as returned by Mediawiki\n@return\nthe new revision id of the edited entity\n@throws JsonMappingException" ]
[ "a helper method to enable the keyboardUtil for a specific activity\nor disable it. note this will cause some frame drops because of the\nlistener.\n\n@param activity\n@param enable", "Decode a content Type header line into types and parameters pairs", "Add a LIKE clause so the column must mach the value using ...
public ConverterServerBuilder workerPool(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit) { assertNumericArgument(corePoolSize, true); assertNumericArgument(maximumPoolSize, true); assertNumericArgument(corePoolSize + maximumPoolSize, false); assertNumericArgument(keepAliveTime, true); this.corePoolSize = corePoolSize; this.maximumPoolSize = maximumPoolSize; this.keepAliveTime = unit.toMillis(keepAliveTime); return this; }
[ "Configures a worker pool for the converter.\n\n@param corePoolSize The core pool size of the worker pool.\n@param maximumPoolSize The maximum pool size of the worker pool.\n@param keepAliveTime The keep alive time of the worker pool.\n@param unit The time unit of the specified keep alive time.\n@re...
[ "Return the number of ignored or assumption-ignored tests.", "Update the central directory signature of a .jar.\n\n@param file the file to process\n@param searchPattern the search patter to use\n@param badSkipBytes the bad bytes skip table\n@param newSig the new signature\n@param endSig th...
private void checkExactlyTheWeeksCheckBoxes(Collection<WeekOfMonth> weeksToCheck) { for (CmsCheckBox cb : m_checkboxes) { cb.setChecked(weeksToCheck.contains(WeekOfMonth.valueOf(cb.getInternalValue()))); } }
[ "Check exactly the week check-boxes representing the given weeks.\n@param weeksToCheck the weeks selected." ]
[ "Compares two annotated types and returns true if they are the same", "Creates a random symmetric matrix whose values are selected from an uniform distribution\nfrom min to max, inclusive.\n\n@param length Width and height of the matrix.\n@param min Minimum value an element can have.\n@param max Maximum value an ...
private void animateIndicatorInvalidate() { if (mIndicatorScroller.computeScrollOffset()) { mIndicatorOffset = mIndicatorScroller.getCurr(); invalidate(); if (!mIndicatorScroller.isFinished()) { postOnAnimation(mIndicatorRunnable); return; } } completeAnimatingIndicator(); }
[ "Callback when each frame in the indicator animation should be drawn." ]
[ "Painter the tile, by building a URL where the image can be found.\n\n@param tile\nMust be an instance of {@link InternalTile}, and must have a non-null {@link RasterUrlBuilder}.\n@return Returns a {@link InternalTile}.", "To store an object in a quick & dirty way.", "Executes a query using the given parameters...
private File decompileType(final DecompilerSettings settings, final WindupMetadataSystem metadataSystem, final String typeName) throws IOException { log.fine("Decompiling " + typeName); final TypeReference type; // Hack to get around classes whose descriptors clash with primitive types. if (typeName.length() == 1) { final MetadataParser parser = new MetadataParser(IMetadataResolver.EMPTY); final TypeReference reference = parser.parseTypeDescriptor(typeName); type = metadataSystem.resolve(reference); } else type = metadataSystem.lookupType(typeName); if (type == null) { log.severe("Failed to load class: " + typeName); return null; } final TypeDefinition resolvedType = type.resolve(); if (resolvedType == null) { log.severe("Failed to resolve type: " + typeName); return null; } boolean nested = resolvedType.isNested() || resolvedType.isAnonymous() || resolvedType.isSynthetic(); if (!this.procyonConf.isIncludeNested() && nested) return null; settings.setJavaFormattingOptions(new JavaFormattingOptions()); final FileOutputWriter writer = createFileWriter(resolvedType, settings); final PlainTextOutput output; output = new PlainTextOutput(writer); output.setUnicodeOutputEnabled(settings.isUnicodeOutputEnabled()); if (settings.getLanguage() instanceof BytecodeLanguage) output.setIndentToken(" "); DecompilationOptions options = new DecompilationOptions(); options.setSettings(settings); // I'm missing why these two classes are split. // --------- DECOMPILE --------- final TypeDecompilationResults results = settings.getLanguage().decompileType(resolvedType, output, options); writer.flush(); writer.close(); // If we're writing to a file and we were asked to include line numbers in any way, // then reformat the file to include that line number information. final List<LineNumberPosition> lineNumberPositions = results.getLineNumberPositions(); if (!this.procyonConf.getLineNumberOptions().isEmpty()) { final LineNumberFormatter lineFormatter = new LineNumberFormatter(writer.getFile(), lineNumberPositions, this.procyonConf.getLineNumberOptions()); lineFormatter.reformatFile(); } return writer.getFile(); }
[ "Decompiles a single type.\n\n@param metadataSystem\n@param typeName\n@return\n@throws IOException" ]
[ "Utility function that copies a string array and add another string to\nfirst\n\n@param arr Original array of strings\n@param add\n@return Copied array of strings", "Use this API to fetch authenticationldappolicy_vpnglobal_binding resources of given name .", "Create a new Time, with no date component.", "Use ...
public static ComplexNumber Subtract(ComplexNumber z1, double scalar) { return new ComplexNumber(z1.real - scalar, z1.imaginary); }
[ "Subtract a complex number.\n\n@param z1 Complex Number.\n@param scalar Scalar value.\n@return Returns new ComplexNumber instance containing the subtract of specified complex number with a scalar value." ]
[ "Returns the corresponding ModuleSpec service name for the given module.\n\n@param identifier The module identifier\n@return The service name of the ModuleSpec service", "Here the lambda in the implicit step is determined dynamically. At first\nit selects zeros to quickly reveal singular values that are zero or ...
String urlDecode(String name, String encoding) throws UnsupportedEncodingException { return URLDecoder.decode(name, encoding); }
[ "Convert a URL Encoded name back to the original form.\n@param name the name to URL urlDecode.\n@param encoding the string encoding to be used (i.e. UTF-8)\n@return the name in original form.\n@throws UnsupportedEncodingException if the encoding is not supported." ]
[ "The transaction will be executed. While it is running, any semantic state change\nin the given resource will be ignored and the cache will not be cleared.", "Parses btch api response to create a list of BoxAPIResponse objects.\n@param batchResponse response of a batch api request\n@return list of BoxAPIResponses...
public static org.jfrog.hudson.ArtifactoryServer prepareArtifactoryServer(String artifactoryServerID, ArtifactoryServer pipelineServer) { if (artifactoryServerID == null && pipelineServer == null) { return null; } if (artifactoryServerID != null && pipelineServer != null) { return null; } if (pipelineServer != null) { CredentialsConfig credentials = pipelineServer.createCredentialsConfig(); return new org.jfrog.hudson.ArtifactoryServer(null, pipelineServer.getUrl(), credentials, credentials, pipelineServer.getConnection().getTimeout(), pipelineServer.isBypassProxy(), pipelineServer.getConnection().getRetry(), pipelineServer.getDeploymentThreads()); } org.jfrog.hudson.ArtifactoryServer server = RepositoriesUtils.getArtifactoryServer(artifactoryServerID, RepositoriesUtils.getArtifactoryServers()); if (server == null) { return null; } return server; }
[ "Prepares Artifactory server either from serverID or from ArtifactoryServer.\n\n@param artifactoryServerID\n@param pipelineServer\n@return" ]
[ "Only match if the TypeReference is at the specified location within the file.", "Add a marker so we can recognize this as a metadata archive. I would use the ZipFile comment, but\nthat is not available until Java 7, and Beat Link is supposed to be backwards compatible with Java 6.\nSince we are doing this anyway...
public synchronized static SQLiteDatabase getConnection(Context context) { if (database == null) { // Construct the single helper and open the unique(!) db connection for the app database = new CupboardDbHelper(context.getApplicationContext()).getWritableDatabase(); } return database; }
[ "Returns a raw handle to the SQLite database connection. Do not close!\n@param context A context, which is used to (when needed) set up a connection to the database\n@return The single, unique connection to the database, as is (also) used by our Cupboard instance" ]
[ "Logs to Info if the debug level is greater than or equal to 1.", "Quits server by closing server socket and closing client socket handlers.", "Returns an array with the width of the longest word per column calculated from the given table.\nDefault padding will be added per column.\nPadding for individual colum...
@Override protected Deque<Step> childValue(Deque<Step> parentValue) { Deque<Step> queue = new LinkedList<>(); queue.add(parentValue.getFirst()); return queue; }
[ "In case parent thread spawn thread we need create a new queue\nfor child thread but use the only one root step. In the end all steps will be\nchildren of root step, all we need is sync adding steps\n@param parentValue value from parent thread\n@return local copy of queue in this thread with parent root as first el...
[ "Read in the configuration properties.", "Set an attribute.\n\n@param name attribute name.\n@param value attribute value.", "Add the string representation of the given object to this sequence at the given index. The given indentation will\nbe prepended to each line except the first one if the object has a mult...
public void removeOverride(int overrideId, int pathId, Integer ordinal, String clientUUID) { // TODO: reorder priorities after removal PreparedStatement statement = null; try (Connection sqlConnection = sqlService.getConnection()) { int enabledId = getEnabledEndpoint(pathId, overrideId, ordinal, clientUUID).getId(); statement = sqlConnection.prepareStatement( "DELETE FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE + " WHERE " + Constants.GENERIC_ID + " = ?" ); statement.setInt(1, enabledId); statement.executeUpdate(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (statement != null) { statement.close(); } } catch (Exception e) { } } }
[ "Remove specified override id from enabled overrides for path\n\n@param overrideId ID of override to remove\n@param pathId ID of path containing override\n@param ordinal index to the instance of the enabled override\n@param clientUUID UUID of client" ]
[ "Process class properties.\n\n@param writer output stream\n@param methodSet set of methods processed\n@param aClass class being processed\n@throws IntrospectionException\n@throws XMLStreamException", "Compares current cluster with final cluster. Uses pertinent store defs\nfor each cluster to determine if a node t...
OTMConnection getConnection() { if (m_connection == null) { OTMConnectionRuntimeException ex = new OTMConnectionRuntimeException("Connection is null."); sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null); } return m_connection; }
[ "get the underlying wrapped connection\n@return OTMConnection raw connection to the OTM." ]
[ "Reads a string from input stream saved as a sequence of UTF chunks.\n\n@param stream stream to read from.\n@return output string\n@throws IOException if something went wrong", "Send ourselves \"updates\" about any tracks that were loaded before we started, since we missed them.", "Waits for a job V3 to complet...
private AlbumArt requestArtworkInternal(final DataReference artReference, final CdjStatus.TrackType trackType, final boolean failIfPassive) { // First check if we are using cached data for this slot. MetadataCache cache = MetadataFinder.getInstance().getMetadataCache(SlotReference.getSlotReference(artReference)); if (cache != null) { final AlbumArt result = cache.getAlbumArt(null, artReference); if (result != null) { artCache.put(artReference, result); } return result; } // Then see if any registered metadata providers can offer it for us. final MediaDetails sourceDetails = MetadataFinder.getInstance().getMediaDetailsFor(artReference.getSlotReference()); if (sourceDetails != null) { final AlbumArt provided = MetadataFinder.getInstance().allMetadataProviders.getAlbumArt(sourceDetails, artReference); if (provided != null) { return provided; } } // At this point, unless we are allowed to actively request the data, we are done. We can always actively // request tracks from rekordbox. if (MetadataFinder.getInstance().isPassive() && failIfPassive && artReference.slot != CdjStatus.TrackSourceSlot.COLLECTION) { return null; } // We have to actually request the art using the dbserver protocol. ConnectionManager.ClientTask<AlbumArt> task = new ConnectionManager.ClientTask<AlbumArt>() { @Override public AlbumArt useClient(Client client) throws Exception { return getArtwork(artReference.rekordboxId, SlotReference.getSlotReference(artReference), trackType, client); } }; try { AlbumArt artwork = ConnectionManager.getInstance().invokeWithClientSession(artReference.player, task, "requesting artwork"); if (artwork != null) { // Our cache file load or network request succeeded, so add to the level 2 cache. artCache.put(artReference, artwork); } return artwork; } catch (Exception e) { logger.error("Problem requesting album art, returning null", e); } return null; }
[ "Ask the specified player for the album art in the specified slot with the specified rekordbox ID,\nusing cached media instead if it is available, and possibly giving up if we are in passive mode.\n\n@param artReference uniquely identifies the desired album art\n@param trackType the kind of track that owns the art\...
[ "Set the month.\n@param monthStr the month to set.", "Convert raw value as read from the MPP file into a Java type.\n\n@param type MPP value type\n@param value raw value data\n@return Java object", "Parses the equation and compiles it into a sequence which can be executed later on\n@param equation String in sim...
public void drawImage(Image img, Rectangle rect, Rectangle clipRect) { drawImage(img, rect, clipRect, 1); }
[ "Draws the specified image with the first rectangle's bounds, clipping with the second one and adding\ntransparency.\n\n@param img image\n@param rect rectangle\n@param clipRect clipping bounds" ]
[ "Convert the server side feature to a DTO feature that can be sent to the client.\n\n@param feature\nThe server-side feature representation.\n@param featureIncludes\nIndicate which aspects of the should be included see {@link VectorLayerService}\n@return Returns the DTO feature.", "Specifies the maximum capacity ...
public static base_response add(nitro_service client, vpath resource) throws Exception { vpath addresource = new vpath(); addresource.name = resource.name; addresource.destip = resource.destip; addresource.encapmode = resource.encapmode; return addresource.add_resource(client); }
[ "Use this API to add vpath." ]
[ "Creates a method signature.\n\n@param method Method instance\n@return method signature", "Apply the necessary rotation to the transform so that it is in front of\nthe camera.\n\n@param transform The transform to modify.", "Adds a \"Post Run\" task to the collection.\n\n@param taskItem the \"Post Run\" task", ...
public void addChildTask(Task child, int childOutlineLevel) { int outlineLevel = NumberHelper.getInt(getOutlineLevel()); if ((outlineLevel + 1) == childOutlineLevel) { m_children.add(child); setSummary(true); } else { if (m_children.isEmpty() == false) { (m_children.get(m_children.size() - 1)).addChildTask(child, childOutlineLevel); } } }
[ "This method is used to associate a child task with the current\ntask instance. It has package access, and has been designed to\nallow the hierarchical outline structure of tasks in an MPX\nfile to be constructed as the file is read in.\n\n@param child Child task.\n@param childOutlineLevel Outline level of the chil...
[ "Read the given source byte array, then overwrite this buffer's contents\n\n@param src source byte array\n@param srcOffset offset in source byte array to read from\n@param destOffset offset in this buffer to read to\n@param length max number of bytes to read\n@return the number of bytes read", "Use this API to Im...
public static boolean isAssignableFrom(TypeReference<?> from, TypeReference<?> to) { if (from == null) { return false; } if (to.equals(from)) { return true; } if (to.getType() instanceof Class) { return to.getRawType().isAssignableFrom(from.getRawType()); } else if (to.getType() instanceof ParameterizedType) { return isAssignableFrom(from.getType(), (ParameterizedType) to .getType(), new HashMap<String, Type>()); } else if (to.getType() instanceof GenericArrayType) { return to.getRawType().isAssignableFrom(from.getRawType()) && isAssignableFrom(from.getType(), (GenericArrayType) to .getType()); } else { throw new AssertionError("Unexpected Type : " + to); } }
[ "Check if this type is assignable from the given Type." ]
[ "Computes the inverse permutation vector\n\n@param original Original permutation vector\n@param inverse It's inverse", "Use this API to delete onlinkipv6prefix of given name.", "is ready to service requests", "Copy the settings from another calendar to this calendar.\n\n@param cal calendar data source", "Wr...
private static URI createRaster( final Dimension targetSize, final RasterReference rasterReference, final Double rotation, final Color backgroundColor, final File workingDir) throws IOException { final File path = File.createTempFile("north-arrow-", ".png", workingDir); final BufferedImage newImage = new BufferedImage(targetSize.width, targetSize.height, BufferedImage.TYPE_4BYTE_ABGR); final Graphics2D graphics2d = newImage.createGraphics(); try { final BufferedImage originalImage = ImageIO.read(rasterReference.inputStream); if (originalImage == null) { LOGGER.warn("Unable to load NorthArrow graphic: {}, it is not an image format that can be " + "decoded", rasterReference.uri); throw new IllegalArgumentException(); } // set background color graphics2d.setColor(backgroundColor); graphics2d.fillRect(0, 0, targetSize.width, targetSize.height); // scale the original image to fit the new size int newWidth; int newHeight; if (originalImage.getWidth() > originalImage.getHeight()) { newWidth = targetSize.width; newHeight = Math.min( targetSize.height, (int) Math.ceil(newWidth / (originalImage.getWidth() / (double) originalImage.getHeight()))); } else { newHeight = targetSize.height; newWidth = Math.min( targetSize.width, (int) Math.ceil(newHeight / (originalImage.getHeight() / (double) originalImage.getWidth()))); } // position the original image in the center of the new int deltaX = (int) Math.floor((targetSize.width - newWidth) / 2.0); int deltaY = (int) Math.floor((targetSize.height - newHeight) / 2.0); if (!FloatingPointUtil.equals(rotation, 0.0)) { final AffineTransform rotate = AffineTransform.getRotateInstance( rotation, targetSize.width / 2.0, targetSize.height / 2.0); graphics2d.setTransform(rotate); } graphics2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); graphics2d.drawImage(originalImage, deltaX, deltaY, newWidth, newHeight, null); ImageUtils.writeImage(newImage, "png", path); } finally { graphics2d.dispose(); } return path.toURI(); }
[ "Renders a given graphic into a new image, scaled to fit the new size and rotated." ]
[ "return the squared area of the triangle defined by the half edge hedge0\nand the point at the head of hedge1.\n\n@param hedge0\n@param hedge1\n@return", "Get the art available for all tracks currently loaded in any player, either on the play deck, or in a hot cue.\n\n@return the album art associated with all cur...
public ServerSocket createServerSocket() throws IOException { final ServerSocket socket = getServerSocketFactory().createServerSocket(name); socket.bind(getSocketAddress()); return socket; }
[ "Create and bind a server socket\n\n@return the server socket\n@throws IOException" ]
[ "Returns the local collection representing the given namespace for raw document operations.\n\n@param namespace the namespace referring to the local collection.\n@return the local collection representing the given namespace for raw document operations.", "Deletes a specific client id for a profile\n\n@param model...
public static base_response add(nitro_service client, systemuser resource) throws Exception { systemuser addresource = new systemuser(); addresource.username = resource.username; addresource.password = resource.password; addresource.externalauth = resource.externalauth; addresource.promptstring = resource.promptstring; addresource.timeout = resource.timeout; return addresource.add_resource(client); }
[ "Use this API to add systemuser." ]
[ "Rollback an app to a specific release.\n@param appName App name. See {@link #listApps} for a list of apps that can be used.\n@param releaseUuid Release UUID. See {@link #listReleases} for a list of the app's releases.\n@return the release object", "Logic for timestamp\n@param time Epoch date of creation\n@return...
public static void startNamedTimer(String timerName, int todoFlags, long threadId) { getNamedTimer(timerName, todoFlags, threadId).start(); }
[ "Start a timer of the given string name for the current thread. If no such\ntimer exists yet, then it will be newly created.\n\n@param timerName\nthe name of the timer\n@param todoFlags\n@param threadId\nof the thread to track, or 0 if only system clock should be\ntracked" ]
[ "Unmarshal test suite from given file.", "try to find the first none null table name for the given class-descriptor.\nIf cld has extent classes, all of these cld's searched for the first none null\ntable name.", "Returns a JRDesignExpression that points to the main report connection\n\n@return", "Iterates thr...
public static Project dependsOnArtifact(Artifact artifact) { Project project = new Project(); project.artifact = artifact; return project; }
[ "Specify the Artifact for which the condition should search for.\n\n@param artifact\n@return" ]
[ "Main entry point to read criteria data.\n\n@param properties project properties\n@param data criteria data block\n@param dataOffset offset of the data start within the larger data block\n@param entryOffset offset of start node for walking the tree\n@param prompts optional list to hold prompts\n@param fields option...
public static Bic valueOf(final String bic) throws BicFormatException, UnsupportedCountryException { BicUtil.validate(bic); return new Bic(bic); }
[ "Returns a Bic object holding the value of the specified String.\n\n@param bic the String to be parsed.\n@return a Bic object holding the value represented by the string argument.\n@throws BicFormatException if the String doesn't contain parsable Bic.\nUnsupportedCountryException if bic's country is not supported."...
[ "Remove any protocol-level headers from the remote server's response that\ndo not apply to the new response we are sending.\n\n@param response", "Log a fatal message.", "Update the currency format.\n\n@param properties project properties\n@param decimalSeparator decimal separator\n@param thousandsSeparator thou...
private static void listTasks(ProjectFile file) { SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm z"); for (Task task : file.getTasks()) { Date date = task.getStart(); String text = task.getStartText(); String startDate = text != null ? text : (date != null ? df.format(date) : "(no start date supplied)"); date = task.getFinish(); text = task.getFinishText(); String finishDate = text != null ? text : (date != null ? df.format(date) : "(no finish date supplied)"); Duration dur = task.getDuration(); text = task.getDurationText(); String duration = text != null ? text : (dur != null ? dur.toString() : "(no duration supplied)"); dur = task.getActualDuration(); String actualDuration = dur != null ? dur.toString() : "(no actual duration supplied)"; String baselineDuration = task.getBaselineDurationText(); if (baselineDuration == null) { dur = task.getBaselineDuration(); if (dur != null) { baselineDuration = dur.toString(); } else { baselineDuration = "(no duration supplied)"; } } System.out.println("Task: " + task.getName() + " ID=" + task.getID() + " Unique ID=" + task.getUniqueID() + " (Start Date=" + startDate + " Finish Date=" + finishDate + " Duration=" + duration + " Actual Duration" + actualDuration + " Baseline Duration=" + baselineDuration + " Outline Level=" + task.getOutlineLevel() + " Outline Number=" + task.getOutlineNumber() + " Recurring=" + task.getRecurring() + ")"); } System.out.println(); }
[ "This method lists all tasks defined in the file.\n\n@param file MPX file" ]
[ "Method to service public recording APIs\n\n@param op Operation being tracked\n@param timeNS Duration of operation\n@param numEmptyResponses Number of empty responses being sent back,\ni.e.: requested keys for which there were no values (GET and GET_ALL only)\n@param valueSize Size in bytes of the value\n@param key...
public PathElement getElement(int index) { final List<PathElement> list = pathAddressList; return list.get(index); }
[ "Gets the element at the given index.\n\n@param index the index\n@return the element\n\n@throws IndexOutOfBoundsException if the index is out of range (<tt>index &lt; 0 || index &gt;= size()</tt>)" ]
[ "Remove the group and all references to it\n\n@param groupId ID of group", "Specifies the container object class to be instantiated\n\n@param containerObjectClass\ncontainer object class to be instantiated\n\n@return the current builder instance", "Associate an input stream with the operation. Closing the input...
@Override public void onRotationSensor(long timeStamp, float rotationW, float rotationX, float rotationY, float rotationZ, float gyroX, float gyroY, float gyroZ) { GVRCameraRig cameraRig = null; if (mMainScene != null) { cameraRig = mMainScene.getMainCameraRig(); } if (cameraRig != null) { cameraRig.setRotationSensorData(timeStamp, rotationW, rotationX, rotationY, rotationZ, gyroX, gyroY, gyroZ); updateSensoredScene(); } }
[ "Called to reset current sensor data.\n\n@param timeStamp\ncurrent time stamp\n@param rotationW\nQuaternion rotation W\n@param rotationX\nQuaternion rotation X\n@param rotationY\nQuaternion rotation Y\n@param rotationZ\nQuaternion rotation Z\n@param gyroX\nGyro rotation X\n@param gyroY\nGyro rotation Y\n@param gyro...
[ "The test that checks if clipping is needed.\n\n@param f\nfeature to test\n@param scale\nscale\n@return true if clipping is needed", "Recursively scan the provided path and return a list of all Java packages contained therein.", "Main method of RendererAdapter. This method has the responsibility of update the\n...
private ProjectFile readProjectFile(ProjectReader reader, InputStream stream) throws MPXJException { addListeners(reader); return reader.read(stream); }
[ "Adds listeners and reads from a stream.\n\n@param reader reader for file type\n@param stream schedule data\n@return ProjectFile instance" ]
[ "Creates a db handling object.\n\n@return The db handling object\n@throws BuildException If the handling is invalid", "Checks if the specified longitude is correct.\n\n@param name the name of the longitude field\n@param longitude the value of the longitude field\n@return the longitude", "Executes a API query ac...
public static DoubleMatrix absi(DoubleMatrix x) { /*# mapfct('Math.abs') #*/ //RJPP-BEGIN------------------------------------------------------------ for (int i = 0; i < x.length; i++) x.put(i, (double) Math.abs(x.get(i))); return x; //RJPP-END-------------------------------------------------------------- }
[ "Sets all elements in this matrix to their absolute values. Note\nthat this operation is in-place.\n@see MatrixFunctions#abs(DoubleMatrix)\n@return this matrix" ]
[ "Gets an entry point for the given deployment. If one does not exist it will be created. If the request controller is disabled\nthis will return null.\n\nEntry points are reference counted. If this method is called n times then {@link #removeControlPoint(ControlPoint)}\nmust also be called n times to clean up the e...
public static String format(String pattern, Object... arguments) { String msg = pattern; if (arguments != null) { for (int index = 0; index < arguments.length; index++) { msg = msg.replaceAll("\\{" + (index + 1) + "\\}", String.valueOf(arguments[index])); } } return msg; }
[ "Format the message using the pattern and the arguments.\n\n@param pattern the pattern in the format of \"{1} this is a {2}\"\n@param arguments the arguments.\n@return the formatted result." ]
[ "performs an UPDATE operation against RDBMS.\n@param obj The Object to be updated in the underlying table.\n@param cld ClassDescriptor providing mapping information.", "Converts Observable of list to Observable of Inner.\n@param innerList list to be converted.\n@param <InnerT> type of inner.\n@return Observable f...
static JndiContext createJndiContext() throws NamingException { try { if (!NamingManager.hasInitialContextFactoryBuilder()) { JndiContext ctx = new JndiContext(); NamingManager.setInitialContextFactoryBuilder(ctx); return ctx; } else { return (JndiContext) NamingManager.getInitialContext(null); } } catch (Exception e) { jqmlogger.error("Could not create JNDI context: " + e.getMessage()); NamingException ex = new NamingException("Could not initialize JNDI Context"); ex.setRootCause(e); throw ex; } }
[ "Will create a JNDI Context and register it as the initial context factory builder\n\n@return the context\n@throws NamingException\non any issue during initial context factory builder registration" ]
[ "This method extracts data for a single day from an MSPDI file.\n\n@param calendar Calendar data\n@param day Day data\n@param readExceptionsFromDays read exceptions form day definitions", "Performs a delete operation with the specified composite request object\n\n@param deleteRequestObject Composite request objec...
protected List<Integer> cancelAllActiveOperations() { final List<Integer> operations = new ArrayList<Integer>(); for(final ActiveOperationImpl<?, ?> activeOperation : activeRequests.values()) { activeOperation.asyncCancel(false); operations.add(activeOperation.getOperationId()); } return operations; }
[ "Cancel all currently active operations.\n\n@return a list of cancelled operations" ]
[ "Specifies the base URI of this conversion server.\n\n@param baseUri The URI under which this remote conversion server is reachable.\n@return This builder instance.", "123.2.3.4 is 4.3.2.123.in-addr.arpa.", "Retrieve all addresses of a host by it's address. NetBIOS hosts can\nhave many names for a given IP addr...
public static double huntKennedyCMSAdjustedRate( double forwardSwaprate, double volatility, double swapAnnuity, double optionMaturity, double swapMaturity, double payoffUnit) { double a = 1.0/swapMaturity; double b = (payoffUnit / swapAnnuity - a) / forwardSwaprate; double convexityAdjustment = Math.exp(volatility*volatility*optionMaturity); double rateUnadjusted = forwardSwaprate; double rateAdjusted = forwardSwaprate * convexityAdjustment; return (a * rateUnadjusted + b * forwardSwaprate * rateAdjusted) * swapAnnuity / payoffUnit; }
[ "Calculate the adjusted forward swaprate corresponding to a change of payoff unit from the given swapAnnuity to the given payoffUnit\nusing the Black-Scholes model for the swap rate together with the Hunt-Kennedy convexity adjustment.\n\n@param forwardSwaprate The forward swap rate\n@param volatility Volatility of ...
[ "Note that the index can only be built once.\n\n@param beans The set of beans the index should be built from, only instances of {@link CommonBean} and implementations of {@link PassivationCapable} are\nincluded\n@throws IllegalStateException If the index is built already", "Sets the origin and direction of the pi...
private void removeListener(CmsUUID listenerId) { getRequest().getSession().removeAttribute(SESSION_ATTRIBUTE_LISTENER_ID); m_listeners.remove(listenerId); }
[ "Remove the listener active in this session.\n\n@param listenerId the id of the listener to remove" ]
[ "Draws the specified image with the first rectangle's bounds, clipping with the second one and adding\ntransparency.\n\n@param img image\n@param rect rectangle\n@param clipRect clipping bounds", "Might not fill all of dst.", "Set HTTP client\n\n@param httpClient\nAn instance of OkHttpClient\n@return Api Client"...
public void createContainer(String container) { ContainerController controller = this.platformContainers.get(container); if (controller == null) { // TODO make this configurable Profile p = new ProfileImpl(); p.setParameter(Profile.PLATFORM_ID, PLATFORM_ID); p.setParameter(Profile.MAIN_HOST, MAIN_HOST); p.setParameter(Profile.MAIN_PORT, MAIN_PORT); p.setParameter(Profile.LOCAL_HOST, MAIN_HOST); int port = Integer.parseInt(MAIN_PORT); port = port + 1 + this.platformContainers.size(); p.setParameter(Profile.LOCAL_PORT, Integer.toString(port)); p.setParameter(Profile.CONTAINER_NAME, container); logger.fine("Creating container " + container + "..."); ContainerController agentContainer = this.runtime .createAgentContainer(p); this.platformContainers.put(container, agentContainer); logger.fine("Container " + container + " created successfully."); } else { logger.fine("Container " + container + " is already created."); } }
[ "Create a container in the platform\n\n@param container\nThe name of the container" ]
[ "Label accessor provided for JSON serialization only.", "Sets the character translator for all cells in the row.\nIt will also remove any other translator set.\nNothing will happen if the argument is null.\n@param charTranslator translator\n@return this to allow chaining", "Interfaces, enums, annotations, and a...
protected void mergeSameCost(LinkedList<TimephasedCost> list) { LinkedList<TimephasedCost> result = new LinkedList<TimephasedCost>(); TimephasedCost previousAssignment = null; for (TimephasedCost assignment : list) { if (previousAssignment == null) { assignment.setAmountPerDay(assignment.getTotalAmount()); result.add(assignment); } else { Number previousAssignmentCost = previousAssignment.getAmountPerDay(); Number assignmentCost = assignment.getTotalAmount(); if (NumberHelper.equals(previousAssignmentCost.doubleValue(), assignmentCost.doubleValue(), 0.01)) { Date assignmentStart = previousAssignment.getStart(); Date assignmentFinish = assignment.getFinish(); double total = previousAssignment.getTotalAmount().doubleValue(); total += assignmentCost.doubleValue(); TimephasedCost merged = new TimephasedCost(); merged.setStart(assignmentStart); merged.setFinish(assignmentFinish); merged.setAmountPerDay(assignmentCost); merged.setTotalAmount(Double.valueOf(total)); result.removeLast(); assignment = merged; } else { assignment.setAmountPerDay(assignment.getTotalAmount()); } result.add(assignment); } previousAssignment = assignment; } list.clear(); list.addAll(result); }
[ "This method merges together assignment data for the same cost.\n\n@param list assignment data" ]
[ "Set the attributes for the associated object.\n\n@param attributes attributes for associated objects\n@deprecated replaced by {@link #setAllAttributes(Map)} after introduction of nested associations", "Returns the first 24 photos for a given tag cluster.\n\n<p>\nThis method does not require authentication.\n</p>...
public static final String getSelectedValue(ListBox list) { int index = list.getSelectedIndex(); return (index >= 0) ? list.getValue(index) : null; }
[ "Utility function to get the current value." ]
[ "Disable all overrides for a specified path\n\n@param pathID ID of path containing overrides\n@param clientUUID UUID of client", "Create a new photoset.\n\n@param title\nThe photoset title\n@param description\nThe photoset description\n@param primaryPhotoId\nThe primary photo id\n@return The new Photset\n@throws ...
public float DistanceTo(IntPoint anotherPoint) { float dx = this.x - anotherPoint.x; float dy = this.y - anotherPoint.y; return (float) Math.sqrt(dx * dx + dy * dy); }
[ "Calculate Euclidean distance between two points.\n\n@param anotherPoint Point to calculate distance to.\n@return Euclidean distance between this point and anotherPoint points." ]
[ "Links the form with an HTML element which can be clicked.\n\n@param form the collection of the input fields\n@return a FormAction\n@see Form", "Resamples a trajectory\n@param t Trajectory to resample\n@param n Resample rate\n@return Returns a resampled trajectory which contains every n'th position of t", "Sum ...
private static MessageInfo mapMessageInfo(MessageInfoType messageInfoType) { MessageInfo messageInfo = new MessageInfo(); if (messageInfoType != null) { messageInfo.setFlowId(messageInfoType.getFlowId()); messageInfo.setMessageId(messageInfoType.getMessageId()); messageInfo.setOperationName(messageInfoType.getOperationName()); messageInfo.setPortType(messageInfoType.getPorttype() == null ? "" : messageInfoType.getPorttype().toString()); messageInfo.setTransportType(messageInfoType.getTransport()); } return messageInfo; }
[ "Map message info.\n\n@param messageInfoType the message info type\n@return the message info" ]
[ "Process a text-based PP file.\n\n@param inputStream file input stream\n@return ProjectFile instance", "Finds the null space of A\n@param A (Input) Matrix. Modified\n@param numSingularValues Number of singular values\n@param nullspace Storage for null-space\n@return true if successful or false if it failed", "C...
public AT_Context setFrameTopBottomMargin(int frameTop, int frameBottom){ if(frameTop>-1 && frameBottom>-1){ this.frameTopMargin = frameTop; this.frameBottomMargin = frameBottom; } return this; }
[ "Sets the top and bottom frame margin.\n@param frameTop margin\n@param frameBottom margin\n@return this to allow chaining" ]
[ "Create a Count-Query for QueryBySQL\n\n@param aQuery\n@return The count query", "Use this API to expire cachecontentgroup.", "Initializes the bean name defaulted", "Reads all text of the XML tag and returns it as a String.\nAssumes that a '<' character has already been read.\n\n@param r The reader to read fr...
public String getElementId() { for (Entry<String, String> attribute : attributes.entrySet()) { if (attribute.getKey().equalsIgnoreCase("id")) { return attribute.getValue(); } } return null; }
[ "Search for the attribute \"id\" and return the value.\n\n@return the id of this element or null when not found" ]
[ "Checks all data sets in a given record for constraint violations.\n\n@param record\nIIM record (1,2,3, ...) to check\n\n@return list of constraint violations, empty set if IIM file is valid", "Sets the debug JPDA remote socket debugging argument.\n\n@param suspend {@code true} to suspend otherwise {@code false}\...
static List<NamedArgument> getNamedArgs( ExtensionContext context ) { List<NamedArgument> namedArgs = new ArrayList<>(); if( context.getTestMethod().get().getParameterCount() > 0 ) { try { if( context.getClass().getCanonicalName().equals( METHOD_EXTENSION_CONTEXT ) ) { Field field = context.getClass().getSuperclass().getDeclaredField( "testDescriptor" ); Object testDescriptor = ReflectionUtil.getFieldValueOrNull( field, context, ERROR ); if( testDescriptor != null && testDescriptor.getClass().getCanonicalName().equals( TEST_TEMPLATE_INVOCATION_TEST_DESCRIPTOR ) ) { Object invocationContext = ReflectionUtil.getFieldValueOrNull( "invocationContext", testDescriptor, ERROR ); if( invocationContext != null && invocationContext.getClass().getCanonicalName().equals( PARAMETERIZED_TEST_INVOCATION_CONTEXT ) ) { Object arguments = ReflectionUtil.getFieldValueOrNull( "arguments", invocationContext, ERROR ); List<Object> args = Arrays.asList( (Object[]) arguments ); namedArgs = ParameterNameUtil.mapArgumentsWithParameterNames( context.getTestMethod().get(), args ); } } } } catch( Exception e ) { log.warn( ERROR, e ); } } return namedArgs; }
[ "This is a very ugly workaround to get the method arguments from the JUnit 5 context via reflection." ]
[ "Add assignments to the tree.\n\n@param parentNode parent tree node\n@param file assignments container", "Get a list of referring domains for a collection.\n\n@param date\n(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will\nau...
public void updatePathOrder(int profileId, int[] pathOrder) { for (int i = 0; i < pathOrder.length; i++) { EditService.updatePathTable(Constants.PATH_PROFILE_PATH_ORDER, (i + 1), pathOrder[i]); } }
[ "Updates the path_order column in the table, loops though the pathOrder array, and changes the value to the loop\nindex+1 for the specified pathId\n\n@param profileId ID of profile\n@param pathOrder array containing new order of paths" ]
[ "Check if the given class represents an array of primitive wrappers,\ni.e. Boolean, Byte, Character, Short, Integer, Long, Float, or Double.\n@param clazz the class to check\n@return whether the given class is a primitive wrapper array class", "Appends to the statement table and all tables joined to it.\n@param a...
public void installApp(Functions.Func callback) { if (isPwaSupported()) { appInstaller = new AppInstaller(callback); appInstaller.prompt(); } }
[ "Will prompt a user the \"Add to Homescreen\" feature\n\n@param callback A callback function after the method has been executed." ]
[ "Calculates the legend bounds for a custom list of legends.", "Use this API to fetch wisite_farmname_binding resources of given name .", "Destroys dependent instance\n\n@param instance\n@return true if the instance was destroyed, false otherwise", "Unmarshal the XML content with auto-correction.\n@param file ...
protected static <R extends AddressSection, S extends AddressSegment> R fastIncrement( R section, long increment, AddressCreator<?, R, ?, S> addrCreator, Supplier<R> lowerProducer, Supplier<R> upperProducer, Integer prefixLength) { if(increment >= 0) { BigInteger count = section.getCount(); if(count.compareTo(LONG_MAX) <= 0) { long longCount = count.longValue(); if(longCount > increment) { if(longCount == increment + 1) { return upperProducer.get(); } return incrementRange(section, increment, addrCreator, lowerProducer, prefixLength); } BigInteger value = section.getValue(); BigInteger upperValue; if(value.compareTo(LONG_MAX) <= 0 && (upperValue = section.getUpperValue()).compareTo(LONG_MAX) <= 0) { return increment( section, increment, addrCreator, count.longValue(), value.longValue(), upperValue.longValue(), lowerProducer, upperProducer, prefixLength); } } } else { BigInteger value = section.getValue(); if(value.compareTo(LONG_MAX) <= 0) { return add(lowerProducer.get(), value.longValue(), increment, addrCreator, prefixLength); } } return null; }
[ "Handles the cases in which we can use longs rather than BigInteger\n\n@param section\n@param increment\n@param addrCreator\n@param lowerProducer\n@param upperProducer\n@param prefixLength\n@return" ]
[ "This could be a self-extracting archive. If we understand the format, expand\nit and check the content for files we can read.\n\n@param stream schedule data\n@return ProjectFile instance", "Creates an operations that targets the valiadating handler.\n\n@param operationToValidate the operation that this handler w...
private String[] getHeaders() { final List<String> headers = new ArrayList<>(); if(decorator.getShowSources()){ headers.add(SOURCE_FIELD); } if(decorator.getShowSourcesVersion()){ headers.add(SOURCE_VERSION_FIELD); } if(decorator.getShowTargets()){ headers.add(TARGET_FIELD); } if(decorator.getShowTargetsDownloadUrl()){ headers.add(DOWNLOAD_URL_FIELD); } if(decorator.getShowTargetsSize()){ headers.add(SIZE_FIELD); } if(decorator.getShowScopes()){ headers.add(SCOPE_FIELD); } if(decorator.getShowLicenses()){ headers.add(LICENSE_FIELD); } if(decorator.getShowLicensesLongName()){ headers.add(LICENSE_LONG_NAME_FIELD); } if(decorator.getShowLicensesUrl()){ headers.add(LICENSE_URL_FIELD); } if(decorator.getShowLicensesComment()){ headers.add(LICENSE_COMMENT_FIELD); } return headers.toArray(new String[headers.size()]); }
[ "Init the headers of the table regarding the filters\n\n@return String[]" ]
[ "Convert an ObjectBank to arrays of data features and labels.\n\n@return A Pair, where the first element is an int[][][][] representing the\ndata and the second element is an int[][] representing the labels.", "Populates the project header.\n\n@param record MPX record\n@param properties project properties\n@throw...
public List<String> getArtifactVersions(final String gavc) { final DbArtifact artifact = getArtifact(gavc); return repositoryHandler.getArtifactVersions(artifact); }
[ "Returns a the list of available version of an artifact\n\n@param gavc String\n@return List<String>" ]
[ "Get points after extract boundary.\n\n@param fastBitmap Image to be processed.\n@return List of points.", "Performs case-sensitive depth-first search for a child object and then\nremoves it if found.\n\n@param name name of scene object to be removed.\n\n@return true if child was found (and removed), else false",...
public static double elementMax( DMatrixSparseCSC A ) { if( A.nz_length == 0) return 0; // if every element is assigned a value then the first element can be a max. // Otherwise zero needs to be considered double max = A.isFull() ? A.nz_values[0] : 0; for(int i = 0; i < A.nz_length; i++ ) { double val = A.nz_values[i]; if( val > max ) { max = val; } } return max; }
[ "Returns the value of the element with the largest value\n@param A (Input) Matrix. Not modified.\n@return scalar" ]
[ "Calculate start dates for a monthly recurrence.\n\n@param calendar current date\n@param frequency frequency\n@param dates array of start dates", "Reads the availability table from the file.\n\n@param resource MPXJ resource instance\n@param periods MSPDI availability periods", "Solve the using the lower triangu...
protected void registerUnregisterJMX(boolean doRegister) { if (this.mbs == null ){ // this way makes it easier for mocking. this.mbs = ManagementFactory.getPlatformMBeanServer(); } try { String suffix = ""; if (this.config.getPoolName()!=null){ suffix="-"+this.config.getPoolName(); } ObjectName name = new ObjectName(MBEAN_BONECP +suffix); ObjectName configname = new ObjectName(MBEAN_CONFIG + suffix); if (doRegister){ if (!this.mbs.isRegistered(name)){ this.mbs.registerMBean(this.statistics, name); } if (!this.mbs.isRegistered(configname)){ this.mbs.registerMBean(this.config, configname); } } else { if (this.mbs.isRegistered(name)){ this.mbs.unregisterMBean(name); } if (this.mbs.isRegistered(configname)){ this.mbs.unregisterMBean(configname); } } } catch (Exception e) { logger.error("Unable to start/stop JMX", e); } }
[ "Initialises JMX stuff.\n@param doRegister if true, perform registration, if false unregister" ]
[ "cleanup tx and prepare for reuse", "Returns a persistence strategy based on the passed configuration.\n\n@param cacheMapping the selected {@link org.hibernate.ogm.datastore.keyvalue.options.CacheMappingType}\n@param externalCacheManager the infinispan cache manager\n@param configurationUrl the location of the co...
public int numOccurrences(int year, int month, int day) { DateTimeFormatter parser = ISODateTimeFormat.date(); DateTime date = parser.parseDateTime(year + "-" + month + "-" + "01"); Calendar cal = Calendar.getInstance(); cal.setTime(date.toDate()); GregorianChronology calendar = GregorianChronology.getInstance(); DateTimeField field = calendar.dayOfMonth(); int days = 0; int count = 0; int num = field.getMaximumValue(new LocalDate(year, month, day, calendar)); while (days < num) { if (cal.get(Calendar.DAY_OF_WEEK) == day) { count++; } date = date.plusDays(1); cal.setTime(date.toDate()); days++; } return count; }
[ "Given a year, month, and day, find the number of occurrences of that day in the month\n\n@param year the year\n@param month the month\n@param day the day\n@return the number of occurrences of the day in the month" ]
[ "Update which options are shown.\n@param showModeSwitch flag, indicating if the mode switch should be shown.\n@param showAddKeyOption flag, indicating if the \"Add key\" row should be shown.", "Computes the likelihood of the random draw\n\n@return The likelihood.", "The default field facets.\n\n@param categoryC...
public ThumborUrlBuilder trim(TrimPixelColor value, int colorTolerance) { if (colorTolerance < 0 || colorTolerance > 442) { throw new IllegalArgumentException("Color tolerance must be between 0 and 442."); } if (colorTolerance > 0 && value == null) { throw new IllegalArgumentException("Trim pixel color value must not be null."); } isTrim = true; trimPixelColor = value; trimColorTolerance = colorTolerance; return this; }
[ "Removing surrounding space in image. Get trim color from specified pixel.\n@param value orientation from where to get the pixel color.\n@param colorTolerance 0 - 442. This is the euclidian distance\nbetween the colors of the reference pixel and the surrounding pixels is used.\nIf the distance is within the toleran...
[ "Check that a list allowing null and empty item contains at least one element that is\nnot blank.\n@param list can't be null\n@return", "Returns the list of user defined attribute names.\n\n@return the list of user defined attribute names, if there are none it returns an empty set.", "Whether the given value ge...
int read(InputStream is, int contentLength) { if (is != null) { try { int capacity = (contentLength > 0) ? (contentLength + 4096) : 16384; ByteArrayOutputStream buffer = new ByteArrayOutputStream(capacity); int nRead; byte[] data = new byte[16384]; while ((nRead = is.read(data, 0, data.length)) != -1) { buffer.write(data, 0, nRead); } buffer.flush(); read(buffer.toByteArray()); } catch (IOException e) { Logger.d(TAG, "Error reading data from stream", e); } } else { status = STATUS_OPEN_ERROR; } try { if (is != null) { is.close(); } } catch (IOException e) { Logger.d(TAG, "Error closing stream", e); } return status; }
[ "Reads GIF image from stream.\n\n@param is containing GIF file.\n@return read status code (0 = no errors)." ]
[ "Stops the service. If a timeout is given and the service has still not\ngracefully been stopped after timeout ms the service is stopped by force.\n\n@param millis value in ms", "Creates a list of placeholders for use in a PreparedStatement\n\n@param length number of placeholders\n@return String of placeholders, ...
public static String decodeUrlIso(String stringToDecode) { try { return URLDecoder.decode(stringToDecode, "ISO-8859-1"); } catch (UnsupportedEncodingException e1) { throw new RuntimeException(e1); } }
[ "URL-Decodes a given string using ISO-8859-1. No UnsupportedEncodingException to handle as it is dealt with in\nthis method." ]
[ "Closes a Closeable and swallows any exceptions that might occur in the\nprocess.\n\n@param closeable", "Registers add operation\n\n@param registration resource on which to register\n@param handler operation handler to register\n@param flags with flags\n@deprecated use {@link #registerAddOperation(org...
private void readAssignmentBaselines(Project.Assignments.Assignment assignment, ResourceAssignment mpx) { for (Project.Assignments.Assignment.Baseline baseline : assignment.getBaseline()) { int number = NumberHelper.getInt(baseline.getNumber()); //baseline.getBCWP() //baseline.getBCWS() Number cost = DatatypeConverter.parseExtendedAttributeCurrency(baseline.getCost()); Date finish = DatatypeConverter.parseExtendedAttributeDate(baseline.getFinish()); //baseline.getNumber() Date start = DatatypeConverter.parseExtendedAttributeDate(baseline.getStart()); Duration work = DatatypeConverter.parseDuration(m_projectFile, TimeUnit.HOURS, baseline.getWork()); if (number == 0) { mpx.setBaselineCost(cost); mpx.setBaselineFinish(finish); mpx.setBaselineStart(start); mpx.setBaselineWork(work); } else { mpx.setBaselineCost(number, cost); mpx.setBaselineWork(number, work); mpx.setBaselineStart(number, start); mpx.setBaselineFinish(number, finish); } } }
[ "Extracts assignment baseline data.\n\n@param assignment xml assignment\n@param mpx mpxj assignment" ]
[ "Returns the resource bundle for current Locale, i.e. locale set in the PageComponent.\nAlways create a new instance, this avoids getting the incorrect locale information.\n\n@return resourcebundle for internationalized messages", "Close all HTTP clients created by this factory\n@throws IOException if an I/O erro...
public void forAllValuePairs(String template, Properties attributes) throws XDocletException { String name = attributes.getProperty(ATTRIBUTE_NAME, "attributes"); String defaultValue = attributes.getProperty(ATTRIBUTE_DEFAULT_RIGHT, ""); String attributePairs = getPropertyValue(attributes.getProperty(ATTRIBUTE_LEVEL), name); if ((attributePairs == null) || (attributePairs.length() == 0)) { return; } String token; int pos; for (CommaListIterator it = new CommaListIterator(attributePairs); it.hasNext();) { token = it.getNext(); pos = token.indexOf('='); if (pos >= 0) { _curPairLeft = token.substring(0, pos); _curPairRight = (pos < token.length() - 1 ? token.substring(pos + 1) : defaultValue); } else { _curPairLeft = token; _curPairRight = defaultValue; } if (_curPairLeft.length() > 0) { generate(template); } } _curPairLeft = null; _curPairRight = null; }
[ "Processes the template for the comma-separated value pairs in an attribute of the current object on the specified level.\n\n@param template The template\n@param attributes The attributes of the tag\n@exception XDocletException if an error occurs\n@doc.tag type=\"block\"...
[ "Get ComponentsMultiThread of current instance\n@return componentsMultiThread", "Use this API to unset the properties of snmpalarm resources.\nProperties that need to be unset are specified in args array.", "Skips the given count of bytes, but at most the currently available count.\n\n@return number of bytes ac...
public static void setEntity(HttpConnection connnection, String body, String contentType) { connnection.requestProperties.put("Content-type", contentType); connnection.setRequestBody(body); }
[ "Sets a JSON String as a request entity.\n\n@param connnection The request of {@link HttpConnection}\n@param body The JSON String to set." ]
[ "Get a list of referrers from a given domain to a user's photostream.\n\n@param date\n(Required) Stats will be returned for this date. A day according to Flickr Stats starts at midnight GMT for all users, and timestamps will\nautomatically be rounded down to the start of the day.\n@param domain\n(Required) The doma...
private void checkAndAddNodeStore() { for(Node node: metadata.getCluster().getNodes()) { if(!routedStore.getInnerStores().containsKey(node.getId())) { if(!storeRepository.hasNodeStore(getName(), node.getId())) { storeRepository.addNodeStore(node.getId(), createNodeStore(node)); } routedStore.getInnerStores().put(node.getId(), storeRepository.getNodeStore(getName(), node.getId())); } } }
[ "Check that all nodes in the new cluster have a corresponding entry in\nstoreRepository and innerStores. add a NodeStore if not present, is\nneeded as with rebalancing we can add new nodes on the fly." ]
[ "Mark unfinished test cases as interrupted for each unfinished test suite, then write\ntest suite result\n@see #createFakeTestcaseWithWarning(ru.yandex.qatools.allure.model.TestSuiteResult)\n@see #markTestcaseAsInterruptedIfNotFinishedYet(ru.yandex.qatools.allure.model.TestCaseResult)", "Validate arguments.", "...
public List<List<IN>> classify(String str) { ObjectBank<List<IN>> documents = makeObjectBankFromString(str, plainTextReaderAndWriter); List<List<IN>> result = new ArrayList<List<IN>>(); for (List<IN> document : documents) { classify(document); List<IN> sentence = new ArrayList<IN>(); for (IN wi : document) { // TaggedWord word = new TaggedWord(wi.word(), wi.answer()); // sentence.add(word); sentence.add(wi); } result.add(sentence); } return result; }
[ "Classify the tokens in a String. Each sentence becomes a separate document.\n\n@param str\nA String with tokens in one or more sentences of text to be\nclassified.\n@return {@link List} of classified sentences (each a List of something that\nextends {@link CoreMap})." ]
[ "Start the operation by instantiating the first job instance in a separate Thread.\n\n@param arguments {@inheritDoc}", "Set the value for a floating point vector of length 4.\n@param key name of uniform to set.\n@param x new X value\n@param y new Y value\n@param z new Z value\n@param w new W value\n@see #getVec4\...
public static void parse(Reader src, StatementHandler handler) throws IOException { new NTriplesParser(src, handler).parse(); }
[ "Reads the NTriples file from the reader, pushing statements into\nthe handler." ]
[ "Check real offset.\n\n@return the boolean", "Whether this association contains no rows.\n\n@return {@code true} if this association contains no rows, {@code false} otherwise", "Create a JsonParser for a given json node.\n@param jsonNode the json node\n@return the json parser\n@throws IOException", "Use this ...
public Path getTransformedXSLTPath(FileModel payload) { ReportService reportService = new ReportService(getGraphContext()); Path outputPath = reportService.getReportDirectory(); outputPath = outputPath.resolve(this.getRelativeTransformedXSLTPath(payload)); if (!Files.isDirectory(outputPath)) { try { Files.createDirectories(outputPath); } catch (IOException e) { throw new WindupException("Failed to create output directory at: " + outputPath + " due to: " + e.getMessage(), e); } } return outputPath; }
[ "Gets the path used for the results of XSLT Transforms." ]
[ "Put a spatial object in the cache and index it.\n\n@param key key for object\n@param object object itself\n@param envelope envelope for object", "Notifies that multiple header items are inserted.\n\n@param positionStart the position.\n@param itemCount the item count.", "Use this API to fetch authentication...
public static base_response update(nitro_service client, sslcertkey resource) throws Exception { sslcertkey updateresource = new sslcertkey(); updateresource.certkey = resource.certkey; updateresource.expirymonitor = resource.expirymonitor; updateresource.notificationperiod = resource.notificationperiod; return updateresource.update_resource(client); }
[ "Use this API to update sslcertkey." ]
[ "Set ViewPort visibility of the object.\n\n@see ViewPortVisibility\n@param viewportVisibility\nThe ViewPort visibility of the object.\n@return {@code true} if the ViewPort visibility was changed, {@code false} if it\nwasn't.", "Convenience method to escape any character that is special to the regex system.\n\n@pa...
@SuppressWarnings("unchecked") private static synchronized Map<String, Boolean> getCache(GraphRewrite event) { Map<String, Boolean> result = (Map<String, Boolean>)event.getRewriteContext().get(ClassificationServiceCache.class); if (result == null) { result = Collections.synchronizedMap(new LRUMap(30000)); event.getRewriteContext().put(ClassificationServiceCache.class, result); } return result; }
[ "Keep a cache of items files associated with classification in order to improve performance." ]
[ "Removes the given key with its associated element from the receiver, if present.\n\n@param key the key to be removed from the receiver.\n@return <tt>true</tt> if the receiver contained the specified key, <tt>false</tt> otherwise.", "Create a JavadocComment, by formatting the text of the Javadoc using the given i...
public static Bounds getSymmetricBounds(int dim, double l, double u) { double [] L = new double[dim]; double [] U = new double[dim]; for(int i=0; i<dim; i++) { L[i] = l; U[i] = u; } return new Bounds(L, U); }
[ "Gets bounds which are identical for all dimensions.\n\n@param dim The number of dimensions.\n@param l The value of all lower bounds.\n@param u The value of all upper bounds.\n@return The new bounds." ]
[ "Sets the position of a UIObject", "Adjusts beforeIndex to account for the possibility that the given widget is\nalready a child of this panel.\n\n@param child the widget that might be an existing child\n@param beforeIndex the index at which it will be added to this panel\n@return the modified index", "Use this...
@NotNull static MetaTreeImpl.Proto saveMetaTree(@NotNull final ITreeMutable metaTree, @NotNull final EnvironmentImpl env, @NotNull final ExpiredLoggableCollection expired) { final long newMetaTreeAddress = metaTree.save(); final Log log = env.getLog(); final int lastStructureId = env.getLastStructureId(); final long dbRootAddress = log.write(DatabaseRoot.DATABASE_ROOT_TYPE, Loggable.NO_STRUCTURE_ID, DatabaseRoot.asByteIterable(newMetaTreeAddress, lastStructureId)); expired.add(dbRootAddress, (int) (log.getWrittenHighAddress() - dbRootAddress)); return new MetaTreeImpl.Proto(newMetaTreeAddress, dbRootAddress); }
[ "Saves meta tree, writes database root and flushes the log.\n\n@param metaTree mutable meta tree\n@param env enclosing environment\n@param expired expired loggables (database root to be added)\n@return database root loggable which is read again from the log." ]
[ "Add a greeting to the specified guestbook.", "Boyer Moore scan that proceeds backwards from the end of the file looking for ENDSIG\n@throws NonScannableZipException", "Read ClassDescriptors from the given repository file.\n@see #mergeDescriptorRepository", "Constructs a full capability name from a static bas...
private static void writeToLog(Logger logger, Level level, String pattern, Exception exception) { if (level == Level.ERROR) { logger.error(pattern, exception); } else if (level == Level.INFO) { logger.info(pattern); } else if (level == Level.DEBUG) { logger.debug(pattern); } }
[ "Write the given pattern to given log in given logging level\n@param logger\n@param level\n@param pattern\n@param exception" ]
[ "Finish configuration.", "Post-configure retreival of server engine.", "Attaches meta info about the current state of the device to an event.\nTypically, this meta is added only to the ping event.", "Adds the class descriptor to this model.\n\n@param classDef The class descriptor\n@return The class descriptor...
@Override public boolean setA(DMatrixRBlock A) { // Extract a lower triangular solution if( !decomposer.decompose(A) ) return false; blockLength = A.blockLength; return true; }
[ "Decomposes and overwrites the input matrix.\n\n@param A Semi-Positive Definite (SPD) system matrix. Modified. Reference saved.\n@return If the matrix can be decomposed. Will always return false of not SPD." ]
[ "Executes the query and returns the factory found, if there is only one factory.\nIf multiple factories match the query, one is selected.\n\n@param query the factory query, not null.\n@return the factory found, or null.", "Calls the provided metric getter on all the tracked environments and\nobtains their values\...
private void initialize(Handler callbackHandler, int threadPoolSize) { mDownloadDispatchers = new DownloadDispatcher[threadPoolSize]; mDelivery = new CallBackDelivery(callbackHandler); }
[ "Perform construction with custom thread pool size." ]
[ "Suite prologue.", "Permanently deletes a trashed file.\n@param fileID the ID of the trashed folder to permanently delete.", "Create a Count-Query for QueryByCriteria", "Appends formatted text to the source.\n\n<p>Formatting supports {@code %s} and {@code %n$s}. Most args are converted according to their\n{@l...
public List<PathAddressTransformer> getPathTransformations(final PathAddress address, PlaceholderResolver placeholderResolver) { final List<PathAddressTransformer> list = new ArrayList<PathAddressTransformer>(); final Iterator<PathElement> iterator = address.iterator(); resolvePathTransformers(iterator, list, placeholderResolver); if(iterator.hasNext()) { while(iterator.hasNext()) { iterator.next(); list.add(PathAddressTransformer.DEFAULT); } } return list; }
[ "Get a list of path transformers for a given address.\n\n@param address the path address\n@param placeholderResolver a placeholder resolver used to resolve children of a placeholder registration\n@return a list of path transformations" ]
[ "A specific, existing project can be updated by making a PUT request on the\nURL for that project. Only the fields provided in the `data` block will be\nupdated; any unspecified fields will remain unchanged.\n\nWhen using this method, it is best to specify only those fields you wish\nto change, or else you may over...
private void configureCaching(HttpServletResponse response, int seconds) { // HTTP 1.0 header response.setDateHeader(HTTP_EXPIRES_HEADER, System.currentTimeMillis() + seconds * 1000L); if (seconds > 0) { // HTTP 1.1 header response.setHeader(HTTP_CACHE_CONTROL_HEADER, "max-age=" + seconds); } else { // HTTP 1.1 header response.setHeader(HTTP_CACHE_CONTROL_HEADER, "no-cache"); } }
[ "Set HTTP headers to allow caching for the given number of seconds.\n\n@param response where to set the caching settings\n@param seconds number of seconds into the future that the response should be cacheable for" ]
[ "Use this API to diff nsconfig.", "Returns the aliased certificate. Certificates are aliased by their hostname.\n@see ThumbprintUtil\n@param alias\n@return\n@throws KeyStoreException\n@throws UnrecoverableKeyException\n@throws NoSuchProviderException\n@throws NoSuchAlgorithmException\n@throws CertificateExceptio...
protected void validate(final boolean isDomain) throws MojoDeploymentException { final boolean hasServerGroups = hasServerGroups(); if (isDomain) { if (!hasServerGroups) { throw new MojoDeploymentException( "Server is running in domain mode, but no server groups have been defined."); } } else if (hasServerGroups) { throw new MojoDeploymentException("Server is running in standalone mode, but server groups have been defined."); } }
[ "Validates the deployment.\n\n@param isDomain {@code true} if this is a domain server, otherwise {@code false}\n\n@throws MojoDeploymentException if the deployment is invalid" ]
[ "Specify a specific index to run the query against\n\n@param designDocument set the design document to use\n@param indexName set the index name to use\n@return this to set additional options", "Returns the type discriminator value for given Frames model class, extracted from the @TypeValue annotation.", "Sets t...
public void setText(String text) { span.setText(text); if (!span.isAttached()) { add(span); } }
[ "Set the buttons span text." ]
[ "Get list of Jobs from a queue.\n\n@param jedis\n@param queueName\n@param jobOffset\n@param jobCount\n@return", "Returns the value of the identified field as a Long.\n@param fieldName the name of the field\n@return the value of the field as a Long\n@throws FqlException if the field cannot be expressed as an Long"...
public void setPixelPerUnit(double pixelPerUnit) { if (pixelPerUnit < MINIMUM_PIXEL_PER_UNIT) { pixelPerUnit = MINIMUM_PIXEL_PER_UNIT; } if (pixelPerUnit > MAXIMUM_PIXEL_PER_UNIT) { pixelPerUnit = MAXIMUM_PIXEL_PER_UNIT; } this.pixelPerUnit = pixelPerUnit; setPixelPerUnitBased(true); postConstruct(); }
[ "Sets the scale value in pixel per map unit.\n\n@param pixelPerUnit\nthe scale value (pix/map unit)" ]
[ "Updates the date and time formats.\n\n@param properties project properties", "Shutdown the server\n\n@throws Exception exception", "Returns the proxies real subject. The subject will be materialized if\nnecessary.\n\n@return The subject", "Records the list of backedup files into a text file\n\n@param filesIn...
public void removeGroup(int groupId) { PreparedStatement statement = null; try (Connection sqlConnection = sqlService.getConnection()) { statement = sqlConnection.prepareStatement( "DELETE FROM " + Constants.DB_TABLE_GROUPS + " WHERE " + Constants.GENERIC_ID + " = ?" ); statement.setInt(1, groupId); statement.executeUpdate(); statement.close(); statement = sqlConnection.prepareStatement( "DELETE FROM " + Constants.DB_TABLE_OVERRIDE + " WHERE " + Constants.OVERRIDE_GROUP_ID + " = ?" ); statement.setInt(1, groupId); statement.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } finally { try { if (statement != null) { statement.close(); } } catch (Exception e) { } } removeGroupIdFromTablePaths(groupId); }
[ "Remove the group and all references to it\n\n@param groupId ID of group" ]
[ "Adds a new Site matcher object to the map of server names.\n\n@param matcher the SiteMatcher of the server\n@param site the site to add", "Load the related repositories, plugins and a promotion config associated to the buildId.\nCalled from the UI.\n\n@param buildId - The unique build id.\n@return LoadBuildsResp...
@ArgumentsChecked @Throws(IllegalNullArgumentException.class) public static double checkDouble(@Nonnull final Number number) { Check.notNull(number, "number"); if (!isInDoubleRange(number)) { throw new IllegalNumberRangeException(number.toString(), DOUBLE_MIN, DOUBLE_MAX); } return number.doubleValue(); }
[ "Checks if a given number is in the range of a double.\n\n@param number\na number which should be in the range of a double (positive or negative)\n\n@see java.lang.Double#MIN_VALUE\n@see java.lang.Double#MAX_VALUE\n\n@return number as a double" ]
[ "Read a four byte integer.\n\n@param data byte array\n@param offset offset into array\n@return integer value", "Given a status update from a CDJ, find the metadata for the track that it has loaded, if any. If there is\nan appropriate metadata cache, will use that, otherwise makes a query to the players dbserver.\...
public static boolean isMessageContentToBeLogged(final Message message, final boolean logMessageContent, boolean logMessageContentOverride) { /* * If controlling of logging behavior is not allowed externally * then log according to global property value */ if (!logMessageContentOverride) { return logMessageContent; } Object logMessageContentExtObj = message.getContextualProperty(EXTERNAL_PROPERTY_NAME); if (null == logMessageContentExtObj) { return logMessageContent; } else if (logMessageContentExtObj instanceof Boolean) { return ((Boolean) logMessageContentExtObj).booleanValue(); } else if (logMessageContentExtObj instanceof String) { String logMessageContentExtVal = (String) logMessageContentExtObj; if (logMessageContentExtVal.equalsIgnoreCase("true")) { return true; } else if (logMessageContentExtVal.equalsIgnoreCase("false")) { return false; } else { return logMessageContent; } } else { return logMessageContent; } }
[ "If the \"org.talend.esb.sam.agent.log.messageContent\" property value is \"true\" then log the message content\nIf it is \"false\" then skip the message content logging\nElse fall back to global property \"log.messageContent\"\n\n@param message\n@param logMessageContent\n@param logMessageContentOverride\n@return" ...
[ "Gets currently visible user.\n\n@return List of user", "This method is called when double quotes are found as part of\na value. The quotes are escaped by adding a second quote character\nand the entire value is quoted.\n\n@param value text containing quote characters\n@return escaped and quoted text", "Factory...
public static <T> Set<T> getSet(Collection<T> collection) { Set<T> set = new LinkedHashSet<T>(); set.addAll(collection); return set; }
[ "Convert Collection to Set\n@param collection Collection\n@return Set" ]
[ "Build all combinations of graph structures for generic event stubs of a maximum length\n@param length Maximum number of nodes in each to generate\n@return All graph combinations of specified length or less", "Close off the connection.\n\n@throws SQLException", "Retrieves the work variance.\n\n@return work vari...
public String getEditedFilePath() { switch (getBundleType()) { case DESCRIPTOR: return m_cms.getSitePath(m_desc); case PROPERTY: return null != m_lockedBundleFiles.get(getLocale()) ? m_cms.getSitePath(m_lockedBundleFiles.get(getLocale()).getFile()) : m_cms.getSitePath(m_resource); case XML: return m_cms.getSitePath(m_resource); default: throw new IllegalArgumentException(); } }
[ "Returns the site path for the edited bundle file.\n\n@return the site path for the edited bundle file." ]
[ "Get the scale at the given index.\n\n@param index the index of the zoom level to access.\n@param unit the unit.", "Loads the properties file using the classloader provided. Creating a string from the properties\n\"user.agent.name\" and \"user.agent.version\".\n@param loader The class loader to use to load the re...
public static base_response enable(nitro_service client, Long clid) throws Exception { clusterinstance enableresource = new clusterinstance(); enableresource.clid = clid; return enableresource.perform_operation(client,"enable"); }
[ "Use this API to enable clusterinstance of given name." ]
[ "This method is used to change the credentials of CleverTap account Id, token and region programmatically\n@param accountID CleverTap Account Id\n@param token CleverTap Account Token\n@param region Clever Tap Account Region", "Generate a unique ID across the cluster\n@return generated ID", "Adds a foreignkey to...