query
stringlengths
7
3.3k
positive
listlengths
1
1
negative
listlengths
9
9
Search for the first entry in the first database. Use this method for databases configured with no duplicates. @param txn enclosing transaction @param first first key. @return null if no entry found, otherwise the value.
[ "@Nullable\n public ByteIterable get(@NotNull final Transaction txn, @NotNull final ByteIterable first) {\n return this.first.get(txn, first);\n }" ]
[ "public Release rollback(String appName, String releaseUuid) {\n return connection.execute(new Rollback(appName, releaseUuid), apiKey);\n }", "public ByteBuffer payload() {\n ByteBuffer payload = buffer.duplicate();\n payload.position(headerSize(magic()));\n payload = payload.slice(...
Does a query for the object's Id and copies in each of the field values from the database to refresh the data parameter.
[ "public int refresh(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException {\n\t\tif (mappedRefresh == null) {\n\t\t\tmappedRefresh = MappedRefresh.build(dao, tableInfo);\n\t\t}\n\t\treturn mappedRefresh.executeRefresh(databaseConnection, data, objectCache);\n\t}" ]
[ "public PortComponentMetaData getPortComponentByWsdlPort(String name)\n {\n ArrayList<String> pcNames = new ArrayList<String>();\n for (PortComponentMetaData pc : portComponents)\n {\n String wsdlPortName = pc.getWsdlPort().getLocalPart();\n if (wsdlPortName.equals(name))\n ...
It will look for all the deployments under the deploymentsRootAddress with a runtimeName in the specified list of runtime names and then transform the operation so that every server having those deployments will redeploy the affected deployments. @see #transformOperation @param removeOperation @param context @param deploymentsRootAddress @param runtimeNames @throws OperationFailedException
[ "public static void redeployLinksAndTransformOperation(OperationContext context, ModelNode removeOperation, PathAddress deploymentsRootAddress, Set<String> runtimeNames) throws OperationFailedException {\n Set<String> deploymentNames = listDeployments(context.readResourceFromRoot(deploymentsRootAddress), run...
[ "public static double J0(double x) {\r\n double ax;\r\n\r\n if ((ax = Math.abs(x)) < 8.0) {\r\n double y = x * x;\r\n double ans1 = 57568490574.0 + y * (-13362590354.0 + y * (651619640.7\r\n + y * (-11214424.18 + y * (77392.33017 + y * (-184.9052456)))));\r\n ...
Returns true if the request should continue. @return
[ "private boolean initRequestHandler(SelectionKey selectionKey) {\n ByteBuffer inputBuffer = inputStream.getBuffer();\n int remaining = inputBuffer.remaining();\n\n // Don't have enough bytes to determine the protocol yet...\n if(remaining < 3)\n return true;\n\n byte[] ...
[ "synchronized void removeEvents(Table table) {\n final String tName = table.getName();\n\n try {\n final SQLiteDatabase db = dbHelper.getWritableDatabase();\n db.delete(tName, null, null);\n } catch (final SQLiteException e) {\n getConfigLogger().verbose(\"Error...
Set the featureModel. @param featureModel feature model @throws LayerException problem setting the feature model @since 1.8.0
[ "@Api\n\tpublic void setFeatureModel(FeatureModel featureModel) throws LayerException {\n\t\tthis.featureModel = featureModel;\n\t\tif (null != getLayerInfo()) {\n\t\t\tfeatureModel.setLayerInfo(getLayerInfo());\n\t\t}\n\t\tfilterService.registerFeatureModel(featureModel);\n\t}" ]
[ "@SuppressWarnings({\"unchecked\", \"unused\"})\n public static <T> T[] object2Array(final Class<T> clazz, final Object obj) {\n return (T[]) obj;\n }", "protected void checkJobType(final String jobName, final Class<?> jobType) {\n if (jobName == null) {\n throw new IllegalArgumentE...
Returns the project membership record. @param projectMembership Globally unique identifier for the project membership. @return Request object
[ "public ItemRequest<ProjectMembership> findById(String projectMembership) {\n \n String path = String.format(\"/project_memberships/%s\", projectMembership);\n return new ItemRequest<ProjectMembership>(this, ProjectMembership.class, path, \"GET\");\n }" ]
[ "boolean attachmentsAreStructurallyDifferent( List<AttachmentModel> firstAttachments, List<AttachmentModel> otherAttachments ) {\n if( firstAttachments.size() != otherAttachments.size() ) {\n return true;\n }\n\n for( int i = 0; i < firstAttachments.size(); i++ ) {\n if( a...
From three tagNames, if one is under sectorTag and one under rowTag, returns the remaining one, which is supposedly the a box label. Otherwise, returns null.
[ "private static TechReportPlacement processPlaceLabels(GraphContext graphContext, Set<String> tagNames)\n {\n TagGraphService tagService = new TagGraphService(graphContext);\n\n if (tagNames.size() < 3)\n throw new WindupException(\"There should always be exactly 3 placement labels - row...
[ "public static PropertyResourceBundle getBundle(String baseName, Locale locale) throws UnsupportedEncodingException, IOException{\n\t\tInputStream is = UTF8PropertyResourceBundle.class.getResourceAsStream(\"/\"+baseName + \"_\"+locale.toString()+PROPERTIES_EXT);\n\t\tif(is != null){\n\t\t\treturn new PropertyResour...
Purges the JSP repository.<p< @param afterPurgeAction the action to execute after purging
[ "protected void doPurge(Runnable afterPurgeAction) {\n\n if (LOG.isInfoEnabled()) {\n LOG.info(\n org.opencms.flex.Messages.get().getBundle().key(\n org.opencms.flex.Messages.LOG_FLEXCACHE_WILL_PURGE_JSP_REPOSITORY_0));\n }\n\n File d;\n d = n...
[ "public void setPickingEnabled(boolean enabled) {\n if (enabled != getPickingEnabled()) {\n if (enabled) {\n attachComponent(new GVRSphereCollider(getGVRContext()));\n } else {\n detachComponent(GVRCollider.getComponentType());\n }\n }\n ...
Finds to a given point p the point on the spline with minimum distance. @param p Point where the nearest distance is searched for @param nPointsPerSegment Number of interpolation points between two support points @return Point spline which has the minimum distance to p
[ "public Point2D.Double minDistancePointSpline(Point2D.Double p, int nPointsPerSegment){\n\t\t\tdouble minDistance = Double.MAX_VALUE;\n\t\t\tPoint2D.Double minDistancePoint = null;\n\t\t int numberOfSplines = spline.getN();\n\t\t double[] knots = spline.getKnots();\n\t\t for(int i = 0; i < numberOfSplines;...
[ "public void addClass(ClassNode node) {\n node = node.redirect();\n String name = node.getName();\n ClassNode stored = classes.get(name);\n if (stored != null && stored != node) {\n // we have a duplicate class!\n // One possibility for this is, that we declared a s...
The ID field contains the identifier number that Microsoft Project automatically assigns to each task as you add it to the project. The ID indicates the position of a task with respect to the other tasks. @param val ID
[ "@Override public void setID(Integer val)\n {\n ProjectFile parent = getParentFile();\n Integer previous = getID();\n\n if (previous != null)\n {\n parent.getTasks().unmapID(previous);\n }\n\n parent.getTasks().mapID(val, this);\n\n set(TaskField.ID, val);\n }" ]
[ "public Photoset getInfo(String photosetId) throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_GET_INFO);\r\n\r\n parameters.put(\"photoset_id\", photosetId);\r\n\r\n Response response = transportAPI.get(tran...
This can be called to adjust the size of the dialog glass. It is implemented using JSNI to bypass the "private" keyword on the glassResizer.
[ "public void adjustGlassSize() {\n if (isGlassEnabled()) {\n ResizeHandler handler = getGlassResizer();\n if (handler != null) handler.onResize(null);\n }\n }" ]
[ "private static void generateContextDiagrams(RootDoc root, Options opt, String outputFolder)\n\t throws IOException {\n Set<ClassDoc> classDocs = new TreeSet<ClassDoc>(new Comparator<ClassDoc>() {\n public int compare(ClassDoc cd1, ClassDoc cd2) {\n return cd1.name().compareTo(cd...
Draws the specified image with the first rectangle's bounds, clipping with the second one. @param img image @param rect rectangle @param clipRect clipping bounds @param opacity opacity of the image (1 = opaque, 0= transparent)
[ "public void drawImage(Image img, Rectangle rect, Rectangle clipRect, float opacity) {\n\t\ttry {\n\t\t\ttemplate.saveState();\n\t\t\t// opacity\n\t\t\tPdfGState state = new PdfGState();\n\t\t\tstate.setFillOpacity(opacity);\n\t\t\tstate.setBlendMode(PdfGState.BM_NORMAL);\n\t\t\ttemplate.setGState(state);\n\t\t\t//...
[ "public <V> V getObject(final String key, final Class<V> type) {\n final Object obj = this.values.get(key);\n return type.cast(obj);\n }", "protected void setBeanStore(BoundBeanStore beanStore) {\n if (beanStore == null) {\n this.beanStore.remove();\n } else {\n ...
Returns true if "file" is a subfile or subdirectory of "dir". For example with the directory /path/to/a, the following return values would occur: /path/to/a/foo.txt - true /path/to/a/bar/zoo/boo/team.txt - true /path/to/b/foo.txt - false
[ "public static boolean isInSubDirectory(File dir, File file)\n {\n if (file == null)\n return false;\n\n if (file.equals(dir))\n return true;\n\n return isInSubDirectory(dir, file.getParentFile());\n }" ]
[ "public synchronized void cleanWaitTaskQueue() {\n\n for (ParallelTask task : waitQ) {\n task.setState(ParallelTaskState.COMPLETED_WITH_ERROR);\n task.getTaskErrorMetas().add(\n new TaskErrorMeta(TaskErrorType.USER_CANCELED, \"NA\"));\n logger.info(\n ...
Converts a time in milliseconds to the appropriate x coordinate for drawing something at that time. @param milliseconds the time at which something should be drawn @return the component x coordinate at which it should be drawn
[ "public int millisecondsToX(long milliseconds) {\n if (autoScroll.get()) {\n int playHead = (getWidth() / 2) + 2;\n long offset = milliseconds - getFurthestPlaybackPosition();\n return playHead + (Util.timeToHalfFrame(offset) / scale.get());\n }\n return Util.ti...
[ "private void ensureIndexIsUnlocked(String dataDir) {\n\n Collection<File> lockFiles = new ArrayList<File>(2);\n lockFiles.add(\n new File(\n CmsFileUtil.addTrailingSeparator(CmsFileUtil.addTrailingSeparator(dataDir) + \"index\") + \"write.lock\"));\n lockFiles.add(\n ...
Checks that given directory if readable & writable and prints a warning if the check fails. Warning is only printed once and is not repeated until the condition is fixed and broken again. @param directory deployment directory @return does given directory exist and is readable and writable?
[ "private boolean checkDeploymentDir(File directory) {\n if (!directory.exists()) {\n if (deploymentDirAccessible) {\n deploymentDirAccessible = false;\n ROOT_LOGGER.directoryIsNonexistent(deploymentDir.getAbsolutePath());\n }\n }\n else if (!d...
[ "public UriComponentsBuilder pathSegment(String... pathSegments) throws IllegalArgumentException {\n\t\tAssert.notNull(pathSegments, \"'segments' must not be null\");\n\t\tthis.pathBuilder.addPathSegments(pathSegments);\n\t\tresetSchemeSpecificPart();\n\t\treturn this;\n\t}", "private List<Bucket> lookup(Record r...
Informs this sequence model that the value of the element at position pos has changed. This allows this sequence model to update its internal model if desired.
[ "public void updateSequenceElement(int[] sequence, int pos, int oldVal) {\r\n if(models != null){\r\n for(int i = 0; i < models.length; i++)\r\n models[i].updateSequenceElement(sequence, pos, oldVal);\r\n return; \r\n }\r\n model1.updateSequenceElement(sequence, pos, 0);\r\n model2.upda...
[ "public static boolean uniform(Color color, Pixel[] pixels) {\n return Arrays.stream(pixels).allMatch(p -> p.toInt() == color.toRGB().toInt());\n }", "public void addRequiredBundles(Set<String> requiredBundles) {\n\t\taddRequiredBundles(requiredBundles.toArray(new String[requiredBundles.size()]));\n\t}"...
Adds a command class to the list of supported command classes by this node. Does nothing if command class is already added. @param commandClass the command class instance to add.
[ "public void addCommandClass(ZWaveCommandClass commandClass)\n\t{\n\t\tZWaveCommandClass.CommandClass key = commandClass.getCommandClass();\n\t\t\n\t\tif (!supportedCommandClasses.containsKey(key)) {\n\t\t\tsupportedCommandClasses.put(key, commandClass);\n\t\t\t\n\t\t\tif (commandClass instanceof ZWaveEventListener...
[ "private void setPropertyFilters(String filters) {\n\t\tthis.filterProperties = new HashSet<>();\n\t\tif (!\"-\".equals(filters)) {\n\t\t\tfor (String pid : filters.split(\",\")) {\n\t\t\t\tthis.filterProperties.add(Datamodel\n\t\t\t\t\t\t.makeWikidataPropertyIdValue(pid));\n\t\t\t}\n\t\t}\n\t}", "public static S...
Use this API to fetch all the configstatus resources that are configured on netscaler.
[ "public static configstatus[] get(nitro_service service) throws Exception{\n\t\tconfigstatus obj = new configstatus();\n\t\tconfigstatus[] response = (configstatus[])obj.get_resources(service);\n\t\treturn response;\n\t}" ]
[ "private void insert(int position, int c) {\r\n for (int i = 143; i > position; i--) {\r\n set[i] = set[i - 1];\r\n character[i] = character[i - 1];\r\n }\r\n character[position] = c;\r\n }", "public static lbvserver_servicegroupmember_binding[] get(nitro_service serv...
Clear any current allowed job types and use the given set. @param jobTypes the job types to allow
[ "public void setJobTypes(final Map<String, ? extends Class<?>> jobTypes) {\n checkJobTypes(jobTypes);\n this.jobTypes.clear();\n this.jobTypes.putAll(jobTypes);\n }" ]
[ "public static void startNamedTimer(String timerName, int todoFlags,\n\t\t\tlong threadId) {\n\t\tgetNamedTimer(timerName, todoFlags, threadId).start();\n\t}", "public static final BigInteger printDay(Day day)\n {\n return (day == null ? null : BigInteger.valueOf(day.getValue() - 1));\n }", "public sta...
Use this API to fetch all the Interface resources that are configured on netscaler.
[ "public static Interface[] get(nitro_service service) throws Exception{\n\t\tInterface obj = new Interface();\n\t\tInterface[] response = (Interface[])obj.get_resources(service);\n\t\treturn response;\n\t}" ]
[ "public static void setTime(Calendar calendar, int hourOfDay, int minute, int second, int millisecond) {\n calendar.set(Calendar.HOUR_OF_DAY, hourOfDay);\n calendar.set(Calendar.MINUTE, minute);\n calendar.set(Calendar.SECOND, second);\n calendar.set(Calendar.MILLISECOND, millisecond);\n...
Returns the configured request parameter for the current query string, or the default parameter if the core is not specified. @return The configured request parameter for the current query string, or the default parameter if the core is not specified.
[ "private String getQueryParam() {\n\n final String param = parseOptionalStringValue(XML_ELEMENT_QUERYPARAM);\n if (param == null) {\n return DEFAULT_QUERY_PARAM;\n } else {\n return param;\n }\n }" ]
[ "public void sendFaderStartCommand(Set<Integer> deviceNumbersToStart, Set<Integer> deviceNumbersToStop) throws IOException {\n ensureRunning();\n byte[] payload = new byte[FADER_START_PAYLOAD.length];\n System.arraycopy(FADER_START_PAYLOAD, 0, payload, 0, FADER_START_PAYLOAD.length);\n p...
Executes the given supplier within the context of a read lock. @param <E> The result type. @param sup The supplier. @return The result of {@link Supplier#get()}.
[ "protected <E> E read(Supplier<E> sup) {\n try {\n this.lock.readLock().lock();\n return sup.get();\n } finally {\n this.lock.readLock().unlock();\n }\n }" ]
[ "public static Map<String, List<String>> getConsumersPerTopic(ZkClient zkClient, String group) {\n ZkGroupDirs dirs = new ZkGroupDirs(group);\n List<String> consumers = getChildrenParentMayNotExist(zkClient, dirs.consumerRegistryDir);\n //\n Map<String, List<String>> consumersPerTopicMap...
This method is called to format a percentage value. @param value numeric value @return percentage value
[ "private String formatPercentage(Number value)\n {\n return (value == null ? null : m_formats.getPercentageDecimalFormat().format(value) + \"%\");\n }" ]
[ "public static List<String> splitAsList(String text, String delimiter) {\n List<String> answer = new ArrayList<String>();\n if (text != null && text.length() > 0) {\n answer.addAll(Arrays.asList(text.split(delimiter)));\n }\n return answer;\n }", "public List<Cluster> clu...
Returns a PreparedStatementCreator that returns a page of the underlying result set. @param dialect Database dialect to use. @param limit Maximum number of rows to return. @param offset Index of the first row to return.
[ "public PreparedStatementCreator page(final Dialect dialect, final int limit, final int offset) {\n return new PreparedStatementCreator() {\n public PreparedStatement createPreparedStatement(Connection con) throws SQLException {\n return getPreparedStatementCreator()\n ...
[ "public com.cloudant.client.api.model.ReplicationResult trigger() {\r\n ReplicationResult couchDbReplicationResult = replication.trigger();\r\n com.cloudant.client.api.model.ReplicationResult replicationResult = new com.cloudant\r\n .client.api.model.ReplicationResult(couchDbReplication...
Creates an IndexableTaskItem from provided FunctionalTaskItem. @param taskItem functional TaskItem @return IndexableTaskItem
[ "public static IndexableTaskItem create(final FunctionalTaskItem taskItem) {\n return new IndexableTaskItem() {\n @Override\n protected Observable<Indexable> invokeTaskAsync(TaskGroup.InvocationContext context) {\n FunctionalTaskItem.Context fContext = new FunctionalTaskI...
[ "private void processUpdate(DeviceUpdate update) {\n updates.put(update.getAddress(), update);\n\n // Keep track of the largest sync number we see.\n if (update instanceof CdjStatus) {\n int syncNumber = ((CdjStatus)update).getSyncNumber();\n if (syncNumber > this.largestS...
Skips the stream over the specified number of bytes, adding the skipped amount to the count. @param length the number of bytes to skip @return the actual number of bytes skipped @throws java.io.IOException if an I/O error occurs @see java.io.InputStream#skip(long)
[ "@Override\r\n public synchronized long skip(final long length) throws IOException {\r\n final long skip = super.skip(length);\r\n this.count += skip;\r\n return skip;\r\n }" ]
[ "public void close() {\n this.waitUntilInitialized();\n\n this.ongoingOperationsGroup.blockAndWait();\n\n syncLock.lock();\n try {\n if (this.networkMonitor != null) {\n this.networkMonitor.removeNetworkStateListener(this);\n }\n this.dispatcher.close();\n stop();\n this....
Returns current selenium version from JAR set in classpath. @return Version of Selenium.
[ "public static String fromClassPath() {\n Set<String> versions = new HashSet<>();\n try {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n Enumeration<URL> manifests = classLoader.getResources(\"META-INF/MANIFEST.MF\");\n\n while (manifests...
[ "private void writeDateField(String fieldName, Object value) throws IOException\n {\n if (value instanceof String)\n {\n m_writer.writeNameValuePair(fieldName + \"_text\", (String) value);\n }\n else\n {\n Date val = (Date) value;\n m_writer.writeNameValuePair(fiel...
Transforms an input file into HTML. @param file The File to process. @param safeMode Set to <code>true</code> to escape unsafe HTML tags. @return The processed String. @throws IOException if an IO error occurs @see Configuration#DEFAULT
[ "public final static String process(final File file, final boolean safeMode) throws IOException\n {\n return process(file, Configuration.builder().setSafeMode(safeMode).build());\n }" ]
[ "public static <T> IteratorFromReaderFactory<T> getFactory(String delim, Function<String,T> op) {\r\n return new DelimitRegExIteratorFactory<T>(delim, op);\r\n }", "private static void defineField(Map<String, FieldType> container, String name, FieldType type, String alias)\n {\n container.put(name, typ...
Pushes a basic event. @param eventName The name of the event
[ "@SuppressWarnings({\"unused\", \"WeakerAccess\"})\n public void pushEvent(String eventName) {\n if (eventName == null || eventName.trim().equals(\"\"))\n return;\n\n pushEvent(eventName, null);\n }" ]
[ "public static void resize(GVRMesh mesh, float size) {\n float dim[] = getBoundingSize(mesh);\n float maxsize = 0.0f;\n\n if (dim[0] > maxsize) maxsize = dim[0];\n if (dim[1] > maxsize) maxsize = dim[1];\n if (dim[2] > maxsize) maxsize = dim[2];\n\n scale(mesh, size / maxsi...
This method lists any notes attached to tasks. @param file MPX file
[ "private static void listTaskNotes(ProjectFile file)\n {\n for (Task task : file.getTasks())\n {\n String notes = task.getNotes();\n\n if (notes.length() != 0)\n {\n System.out.println(\"Notes for \" + task.getName() + \": \" + notes);\n }\n }\n\n Sys...
[ "public static hanode_routemonitor_binding[] get(nitro_service service, Long id) throws Exception{\n\t\thanode_routemonitor_binding obj = new hanode_routemonitor_binding();\n\t\tobj.set_id(id);\n\t\thanode_routemonitor_binding response[] = (hanode_routemonitor_binding[]) obj.get_resources(service);\n\t\treturn resp...
Set the enum representing the type of this column. @param tableType type of table to which this column belongs
[ "private void setFieldType(FastTrackTableType tableType)\n {\n switch (tableType)\n {\n case ACTBARS:\n {\n m_type = ActBarField.getInstance(m_header.getColumnType());\n break;\n }\n case ACTIVITIES:\n {\n m_type = ActivityField.ge...
[ "private void writeExceptions(List<ProjectCalendar> records) throws IOException\n {\n for (ProjectCalendar record : records)\n {\n if (!record.getCalendarExceptions().isEmpty())\n {\n // Need to move HOLI up here and get 15 exceptions per line as per USACE spec.\n /...
Checks to see if a subsystem resource has already been registered for the deployment. @param subsystemName the name of the subsystem @return {@code true} if the subsystem exists on the deployment otherwise {@code false}
[ "public boolean hasDeploymentSubsystemModel(final String subsystemName) {\n final Resource root = deploymentUnit.getAttachment(DEPLOYMENT_RESOURCE);\n final PathElement subsystem = PathElement.pathElement(SUBSYSTEM, subsystemName);\n return root.hasChild(subsystem);\n }" ]
[ "public static vrid6 get(nitro_service service, Long id) throws Exception{\n\t\tvrid6 obj = new vrid6();\n\t\tobj.set_id(id);\n\t\tvrid6 response = (vrid6) obj.get_resource(service);\n\t\treturn response;\n\t}", "public static boolean bidiagOuterBlocks( final int blockLength ,\n ...
Specifies the angle of the effect. @param angle the angle of the effect. @angle
[ "public void setAngle(float angle) {\n this.angle = angle;\n float cos = (float) Math.cos(angle);\n float sin = (float) Math.sin(angle);\n m00 = cos;\n m01 = sin;\n m10 = -sin;\n m11 = cos;\n }" ]
[ "protected final void sendObjectToSocket(Object objectToSend, WriteCallback cb) {\n Session sess = this.getSession();\n if (sess != null) {\n String json;\n try {\n json = this.mapper.writeValueAsString(objectToSend);\n } catch (JsonProcessingException e...
Get the list of store names from a list of store definitions @param list @param ignoreViews @return list of store names
[ "public static List<String> getStoreNames(List<StoreDefinition> list, boolean ignoreViews) {\n List<String> storeNameSet = new ArrayList<String>();\n for(StoreDefinition def: list)\n if(!def.isView() || !ignoreViews)\n storeNameSet.add(def.getName());\n return storeNam...
[ "public float getSize(final Axis axis) {\n float size = 0;\n if (mViewPort != null && mViewPort.isClippingEnabled(axis)) {\n size = mViewPort.get(axis);\n } else if (mContainer != null) {\n size = getSizeImpl(axis);\n }\n return size;\n }", "public void ...
Returns the name of this alias if path has been added to the aliased portions of attributePath @param path the path to test for inclusion in the alias
[ "public String getAlias(String path)\r\n {\r\n if (m_allPathsAliased && m_attributePath.lastIndexOf(path) != -1)\r\n {\r\n return m_name;\r\n }\r\n Object retObj = m_mapping.get(path);\r\n if (retObj != null)\r\n {\r\n return (String) retObj;\r\n ...
[ "private OAuth1RequestToken constructToken(Response response) {\r\n Element authElement = response.getPayload();\r\n String oauthToken = XMLUtilities.getChildValue(authElement, \"oauth_token\");\r\n String oauthTokenSecret = XMLUtilities.getChildValue(authElement, \"oauth_token_secret\");\r\n\r...
Convert a Throwable into a list containing all of its causes. @param t The throwable for which the causes are to be returned. @return A (possibly empty) list of {@link Throwable}s.
[ "public List<Throwable> getCauses(Throwable t)\n {\n List<Throwable> causes = new LinkedList<Throwable>();\n Throwable next = t;\n while (next.getCause() != null)\n {\n next = next.getCause();\n causes.add(next);\n }\n return causes;\n }" ]
[ "public void bindDelete(PreparedStatement stmt, Identity oid, ClassDescriptor cld) throws SQLException\r\n {\r\n Object[] pkValues = oid.getPrimaryKeyValues();\r\n FieldDescriptor[] pkFields = cld.getPkFields();\r\n int i = 0;\r\n try\r\n {\r\n for (; i < pkValues.le...
package for testing purpose
[ "static Property getProperty(String propName, ModelNode attrs) {\n String[] arr = propName.split(\"\\\\.\");\n ModelNode attrDescr = attrs;\n for (String item : arr) {\n // Remove list part.\n if (item.endsWith(\"]\")) {\n int i = item.indexOf(\"[\");\n ...
[ "public void handleEvent(Event event) {\n LOG.fine(\"ContentLengthHandler called\");\n\n //if maximum length is shorter then <cut><![CDATA[ ]]></cut> it's not possible to cut the content\n if(CUT_START_TAG.length() + CUT_END_TAG.length() > length) {\n LOG.warning(\"Trying to cut cont...
Updates the date and time formats. @param properties project properties
[ "private void updateDateTimeFormats(ProjectProperties properties)\n {\n String[] timePatterns = getTimePatterns(properties);\n String[] datePatterns = getDatePatterns(properties);\n String[] dateTimePatterns = getDateTimePatterns(properties, timePatterns);\n\n m_dateTimeFormat.applyPatterns(da...
[ "private void startRelayWithPortTollerance(HttpServer server, SslListener relay, int tries) throws Exception {\n if (tries >= 5) {\n throw new BindException(\"Unable to bind to several ports, most recently \" + relay.getPort() + \". Giving up\");\n }\n try {\n if (server.i...
The entity instance is not in the session cache Copied from Loader#instanceNotYetLoaded
[ "private Object instanceNotYetLoaded(\n\t\tfinal Tuple resultset,\n\t\tfinal int i,\n\t\tfinal Loadable persister,\n\t\tfinal String rowIdAlias,\n\t\tfinal org.hibernate.engine.spi.EntityKey key,\n\t\tfinal LockMode lockMode,\n\t\tfinal org.hibernate.engine.spi.EntityKey optionalObjectKey,\n\t\tfinal Object optiona...
[ "public void override(HiveRunnerConfig hiveRunnerConfig) {\n config.putAll(hiveRunnerConfig.config);\n hiveConfSystemOverride.putAll(hiveRunnerConfig.hiveConfSystemOverride);\n }", "public List<String> findAssociationPath(String targetTypeName, List<String> pathWithoutAlias) {\n\t\tList<String> s...
This must be called with the write lock held. @param requirement the requirement
[ "private void registerRequirement(RuntimeRequirementRegistration requirement) {\n assert writeLock.isHeldByCurrentThread();\n CapabilityId dependentId = requirement.getDependentId();\n if (!capabilities.containsKey(dependentId)) {\n throw ControllerLogger.MGMT_OP_LOGGER.unknownCapabi...
[ "@Nullable\n public ByteIterable get2(@NotNull final Transaction txn, @NotNull final ByteIterable second) {\n return this.second.get(txn, second);\n }", "@NonNull public Context getContext() {\n if (searchView != null) {\n return searchView.getContext();\n } else if (supportV...
Read a task relationship. @param link ConceptDraw PROJECT task link
[ "private void readRelationship(Link link)\n {\n Task sourceTask = m_taskIdMap.get(link.getSourceTaskID());\n Task destinationTask = m_taskIdMap.get(link.getDestinationTaskID());\n if (sourceTask != null && destinationTask != null)\n {\n Duration lag = getDuration(link.getLagUnit(), lin...
[ "static ProcessedLayers process(final InstalledConfiguration conf, final List<File> moduleRoots, final List<File> bundleRoots) throws IOException {\n final ProcessedLayers layers = new ProcessedLayers(conf);\n // Process module roots\n final LayerPathSetter moduleSetter = new LayerPathSetter() ...
Add a custom query parameter to the _changes request. Useful for specifying extra parameters to a filter function for example. @param name the name of the query parameter @param value the value of the query parameter @return this Changes instance @since 2.5.0
[ "public Changes parameter(String name, String value) {\n this.databaseHelper.query(name, value);\n return this;\n }" ]
[ "public LogStreamResponse getLogs(Log.LogRequestBuilder logRequest) {\n return connection.execute(new Log(logRequest), apiKey);\n }", "public final void notifyFooterItemRangeChanged(int positionStart, int itemCount) {\n if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerI...
Make log segment file name from offset bytes. All this does is pad out the offset number with zeros so that ls sorts the files numerically @param offset offset value (padding with zero) @return filename with offset
[ "public static String nameFromOffset(long offset) {\n NumberFormat nf = NumberFormat.getInstance();\n nf.setMinimumIntegerDigits(20);\n nf.setMaximumFractionDigits(0);\n nf.setGroupingUsed(false);\n return nf.format(offset) + Log.FileSuffix;\n }" ]
[ "public static int lengthOfCodePoint(int codePoint)\n {\n if (codePoint < 0) {\n throw new InvalidCodePointException(codePoint);\n }\n if (codePoint < 0x80) {\n // normal ASCII\n // 0xxx_xxxx\n return 1;\n }\n if (codePoint < 0x800) {...
Returns true if all pixels in the array have the same color
[ "public static boolean uniform(Color color, Pixel[] pixels) {\n return Arrays.stream(pixels).allMatch(p -> p.toInt() == color.toRGB().toInt());\n }" ]
[ "private static void generateJson(CellScanner cellScanner, Function<Bytes, String> encoder,\n PrintStream out) throws JsonIOException {\n Gson gson = new GsonBuilder().serializeNulls().setDateFormat(DateFormat.LONG)\n .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).setVersion(1.0...
This handler will be triggered when there's no search result
[ "@Override\n public HandlerRegistration addSearchNoResultHandler(final SearchNoResultEvent.SearchNoResultHandler handler) {\n return addHandler(handler, SearchNoResultEvent.TYPE);\n }" ]
[ "@Override\n public void process(TestCaseResult context) {\n context.getParameters().add(new Parameter()\n .withName(getName())\n .withValue(getValue())\n .withKind(ParameterKind.valueOf(getKind()))\n );\n }", "String getQuer...
Use this API to fetch all the dbdbprofile resources that are configured on netscaler.
[ "public static dbdbprofile[] get(nitro_service service) throws Exception{\n\t\tdbdbprofile obj = new dbdbprofile();\n\t\tdbdbprofile[] response = (dbdbprofile[])obj.get_resources(service);\n\t\treturn response;\n\t}" ]
[ "public NamespacesList<Value> getValues(String namespace, String predicate, int perPage, int page) throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n NamespacesList<Value> valuesList = new NamespacesList<Value>();\r\n parameters.put(\"method\", METH...
Checks to see if all the provided matrices are the expected size for an SVD. If an error is encountered then an exception is thrown. This automatically handles compact and non-compact formats
[ "public static void checkSvdMatrixSize(DMatrixRMaj U, boolean tranU, DMatrixRMaj W, DMatrixRMaj V, boolean tranV ) {\n int numSingular = Math.min(W.numRows,W.numCols);\n boolean compact = W.numRows == W.numCols;\n\n if( compact ) {\n if( U != null ) {\n if( tranU && U....
[ "private static EndpointReferenceType createEPR(String address, SLProperties props) {\n EndpointReferenceType epr = WSAEndpointReferenceUtils.getEndpointReference(address);\n if (props != null) {\n addProperties(epr, props);\n }\n return epr;\n }", "@Override\n\tpublic sy...
Attempts to detect the provided pattern as an exact match. @param pattern the pattern to find in the reader stream @return the number of times the pattern is found, or an error code @throws MalformedPatternException if the pattern is invalid @throws Exception if a generic error is encountered
[ "public int expect(String pattern) throws MalformedPatternException, Exception {\n logger.trace(\"Searching for '\" + pattern + \"' in the reader stream\");\n return expect(pattern, null);\n }" ]
[ "public Number getCostVariance()\n {\n Number variance = (Number) getCachedValue(TaskField.COST_VARIANCE);\n if (variance == null)\n {\n Number cost = getCost();\n Number baselineCost = getBaselineCost();\n if (cost != null && baselineCost != null)\n {\n v...
Retrieves the GC timestamp, set by the Oracle, from zookeeper @param zookeepers Zookeeper connection string @return Oldest active timestamp or oldest possible ts (-1) if not found
[ "public static long getGcTimestamp(String zookeepers) {\n ZooKeeper zk = null;\n try {\n zk = new ZooKeeper(zookeepers, 30000, null);\n\n // wait until zookeeper is connected\n long start = System.currentTimeMillis();\n while (!zk.getState().isConnected() && System.currentTimeMillis() - st...
[ "@SuppressWarnings(\"unused\")\n private void setTextureNumber(int type, int number) {\n m_numTextures.put(AiTextureType.fromRawValue(type), number);\n }", "public History[] refreshHistory(int limit, int offset) throws Exception {\n BasicNameValuePair[] params = {\n new BasicNameVal...
Read a Synchro string from an input stream. @param is input stream @return String instance
[ "public static final String getString(InputStream is) throws IOException\n {\n int type = is.read();\n if (type != 1)\n {\n throw new IllegalArgumentException(\"Unexpected string format\");\n }\n\n Charset charset = CharsetHelper.UTF8;\n \n int length = is.read();\n ...
[ "public final void setValue(String value) {\n\n if ((null == value) || value.isEmpty()) {\n setDefaultValue();\n } else {\n try {\n tryToSetParsedValue(value);\n } catch (@SuppressWarnings(\"unused\") Exception e) {\n CmsDebugLog.consoleLo...
Removes all candidates from this collection which are not associated with an initialising method. @return a {@code Collection} containing the removed unassociated candidates. This list is empty if none were removed, i. e. the result is never {@code null}.
[ "public Collection<FieldNode> removeAndGetCandidatesWithoutInitialisingMethod() {\n final List<FieldNode> result = new ArrayList<FieldNode>();\n for (final Map.Entry<FieldNode, Initialisers> entry : candidatesAndInitialisers.entrySet()) {\n final Initialisers setters = entry.getValue();\n ...
[ "private synchronized void finishTransition(final InternalState current, final InternalState next) {\n internalSetState(getTransitionTask(next), current, next);\n transition();\n }", "final void compress(final File backupFile,\n final AppenderRollingProperties properties) {\n if (this.isC...
This method is used to associate a child task with the current task instance. It has been designed to allow the hierarchical outline structure of tasks in an MPX file to be updated once all of the task data has been read. @param child child task
[ "public void addChildTask(Task child)\n {\n child.m_parent = this;\n m_children.add(child);\n setSummary(true);\n\n if (getParentFile().getProjectConfig().getAutoOutlineLevel() == true)\n {\n child.setOutlineLevel(Integer.valueOf(NumberHelper.getInt(getOutlineLevel()) + 1));\n ...
[ "public CurrencyQueryBuilder setCurrencyCodes(String... codes) {\n return set(CurrencyQuery.KEY_QUERY_CURRENCY_CODES, Arrays.asList(codes));\n }", "public int update(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException {\n\t\ttry {\n\t\t\t// there is always and id ...
Creates a style definition used for pages. @return The page style definition.
[ "protected NodeData createPageStyle()\n {\n NodeData ret = createBlockStyle();\n TermFactory tf = CSSFactory.getTermFactory();\n ret.push(createDeclaration(\"position\", tf.createIdent(\"relative\")));\n\t\tret.push(createDeclaration(\"border-width\", tf.createLength(1f, Unit.px)));\n\t\tret...
[ "public final void notifyFooterItemChanged(int position) {\n if (position < 0 || position >= footerItemCount) {\n throw new IndexOutOfBoundsException(\"The given position \" + position\n + \" is not within the position bounds for footer items [0 - \"\n + (foot...
Get a sub-list of this list @param fromIndex index of the first element in the sub-list (inclusive) @param toIndex index of the last element in the sub-list (inclusive) @return the sub-list
[ "public List<String> subList(final long fromIndex, final long toIndex) {\n return doWithJedis(new JedisCallable<List<String>>() {\n @Override\n public List<String> call(Jedis jedis) {\n return jedis.lrange(getKey(), fromIndex, toIndex);\n }\n });\n }"...
[ "public void setBundleActivator(String bundleActivator) {\n\t\tString old = mainAttributes.get(BUNDLE_ACTIVATOR);\n\t\tif (!bundleActivator.equals(old)) {\n\t\t\tthis.mainAttributes.put(BUNDLE_ACTIVATOR, bundleActivator);\n\t\t\tthis.modified = true;\n\t\t\tthis.bundleActivator = bundleActivator;\n\t\t}\n\t}", "p...
Creates a window visually showing the matrix's state. Block means an element is zero. Red positive and blue negative. More intense the color larger the element's absolute value is. @param A A matrix. @param title Name of the window.
[ "public static void show(DMatrixD1 A , String title ) {\n JFrame frame = new JFrame(title);\n\n int width = 300;\n int height = 300;\n\n if( A.numRows > A.numCols) {\n width = width*A.numCols/A.numRows;\n } else {\n height = height*A.numRows/A.numCols;\n ...
[ "private static Set<String> imageOrientationsOf(ImageMetadata metadata) {\n\n String exifIFD0DirName = new ExifIFD0Directory().getName();\n\n Tag[] tags = Arrays.stream(metadata.getDirectories())\n .filter(dir -> dir.getName().equals(exifIFD0DirName))\n .findFirst()\n .map(Dir...
Use this API to delete dnsview of given name.
[ "public static base_response delete(nitro_service client, String viewname) throws Exception {\n\t\tdnsview deleteresource = new dnsview();\n\t\tdeleteresource.viewname = viewname;\n\t\treturn deleteresource.delete_resource(client);\n\t}" ]
[ "private void setTableAliasForPath(String aPath, List hintClasses, TableAlias anAlias)\r\n {\r\n m_pathToAlias.put(buildAliasKey(aPath, hintClasses), anAlias);\r\n }", "public synchronized void addListener(MaterializationListener listener)\r\n\t{\r\n\t\tif (_listeners == null)\r\n\t\t{\r\n\t\t\t_list...
Get a bean value from the context. @param name bean name @return bean value or null
[ "public Object getBean(String name) {\n\t\tBean bean = beans.get(name);\n\t\tif (null == bean) {\n\t\t\treturn null;\n\t\t}\n\t\treturn bean.object;\n\t}" ]
[ "public static String getOffsetCodeFromSchedule(Schedule schedule) {\r\n\r\n\t\tdouble doubleLength = 0;\r\n\t\tfor(int i = 0; i < schedule.getNumberOfPeriods(); i ++) {\r\n\t\t\tdoubleLength += schedule.getPeriodLength(i);\r\n\t\t}\r\n\t\tdoubleLength /= schedule.getNumberOfPeriods();\r\n\r\n\t\tdoubleLength *= 12...
Encodes the given URI scheme with the given encoding. @param scheme the scheme to be encoded @param encoding the character encoding to encode to @return the encoded scheme @throws UnsupportedEncodingException when the given encoding parameter is not supported
[ "public static String encodeScheme(String scheme, String encoding) throws UnsupportedEncodingException {\n\t\treturn HierarchicalUriComponents.encodeUriComponent(scheme, encoding, HierarchicalUriComponents.Type.SCHEME);\n\t}" ]
[ "private void readProjectProperties(Settings phoenixSettings, Storepoint storepoint)\n {\n ProjectProperties mpxjProperties = m_projectFile.getProjectProperties();\n mpxjProperties.setName(phoenixSettings.getTitle());\n mpxjProperties.setDefaultDurationUnits(phoenixSettings.getBaseunit());\n m...
Returns an entry with the given proposal and prefix, or null if the proposal is not valid. If it is valid, the initializer function is applied to it.
[ "public ContentAssistEntry createProposal(final String proposal, final String prefix, final ContentAssistContext context, final String kind, final Procedure1<? super ContentAssistEntry> init) {\n boolean _isValidProposal = this.isValidProposal(proposal, prefix, context);\n if (_isValidProposal) {\n final...
[ "private Duration getDuration(String value)\n {\n Duration result = null;\n\n if (value != null && value.length() != 0)\n {\n double seconds = getLong(value);\n double hours = seconds / (60 * 60);\n double days = hours / 8;\n\n if (days < 1)\n {\n ...
Counts a single page of the specified gender. If this is the first page of that gender on this site, a suitable key is added to the list of the site's genders. @param gender the gender to count @param siteRecord the site record to count it for
[ "private void countGender(EntityIdValue gender, SiteRecord siteRecord) {\n\t\tInteger curValue = siteRecord.genderCounts.get(gender);\n\t\tif (curValue == null) {\n\t\t\tsiteRecord.genderCounts.put(gender, 1);\n\t\t} else {\n\t\t\tsiteRecord.genderCounts.put(gender, curValue + 1);\n\t\t}\n\t}" ]
[ "@Override\n public boolean parseAndValidateRequest() {\n if(!super.parseAndValidateRequest()) {\n return false;\n }\n isGetVersionRequest = hasGetVersionRequestHeader();\n if(isGetVersionRequest && this.parsedKeys.size() > 1) {\n RestErrorHandler.writeErrorRespo...
Return the List of VariableExpression objects referenced by the specified DeclarationExpression. @param declarationExpression - the DeclarationExpression @return the List of VariableExpression objects
[ "public static List<Expression> getVariableExpressions(DeclarationExpression declarationExpression) {\r\n Expression leftExpression = declarationExpression.getLeftExpression();\r\n\r\n // !important: performance enhancement\r\n if (leftExpression instanceof ArrayExpression) {\r\n Lis...
[ "private String parseMandatoryStringValue(final String path) throws Exception {\n\n final String value = parseOptionalStringValue(path);\n if (value == null) {\n throw new Exception();\n }\n return value;\n }", "private void readAssignments(Resource mpxjResource, net.sf.m...
The type descriptor for a method node is a string containing the name of the method, its return type, and its parameter types in a canonical form. For simplicity, I'm using the format of a Java declaration without parameter names. @return the type descriptor
[ "public String getTypeDescriptor() {\n if (typeDescriptor == null) {\n StringBuilder buf = new StringBuilder(name.length() + parameters.length * 10);\n buf.append(returnType.getName());\n buf.append(' ');\n buf.append(name);\n buf.append('(');\n ...
[ "public boolean addMethodToResponseOverride(String pathName, String methodName) {\n // need to find out the ID for the method\n // TODO: change api for adding methods to take the name instead of ID\n try {\n Integer overrideId = getOverrideIdForMethodName(methodName);\n\n ...
Merges the hardcoded results of this Configuration with the given Configuration. The resultant hardcoded results will be the union of the two sets of hardcoded results. Where the AnalysisResult for a class is found in both Configurations, the result from otherConfiguration will replace the existing result in this Configuration. This replacement behaviour will occur for subsequent calls to {@link #mergeHardcodedResultsFrom(Configuration)}. @param otherConfiguration - Configuration to merge hardcoded results with.
[ "protected void mergeHardcodedResultsFrom(Configuration otherConfiguration) {\r\n Map<Dotted, AnalysisResult> resultsMap = hardcodedResults.build().stream()\r\n .collect(Collectors.toMap(r -> r.className, r -> r));\r\n resultsMap.putAll(otherConfiguration.hardcodedResults());\r\n ...
[ "public void notifyHeaderItemMoved(int fromPosition, int toPosition) {\n if (fromPosition < 0 || toPosition < 0 || fromPosition >= headerItemCount || toPosition >= headerItemCount) {\n throw new IndexOutOfBoundsException(\"The given fromPosition \" + fromPosition + \" or toPosition \" + toPosition...
EXecutes command to given container returning the inspection object as well. This method does 3 calls to dockerhost. Create, Start and Inspect. @param containerId to execute command.
[ "public ExecInspection execStartVerbose(String containerId, String... commands) {\n this.readWriteLock.readLock().lock();\n try {\n String id = execCreate(containerId, commands);\n CubeOutput output = execStartOutput(id);\n\n return new ExecInspection(output, inspectEx...
[ "private void readRelation(Relationship relation)\n {\n Task predecessor = m_activityMap.get(relation.getPredecessor());\n Task successor = m_activityMap.get(relation.getSuccessor());\n if (predecessor != null && successor != null)\n {\n Duration lag = relation.getLag();\n Rela...
Read the work weeks associated with this calendar. @param xmlCalendar XML calendar object @param mpxjCalendar MPXJ calendar object
[ "private void readWorkWeeks(Project.Calendars.Calendar xmlCalendar, ProjectCalendar mpxjCalendar)\n {\n WorkWeeks ww = xmlCalendar.getWorkWeeks();\n if (ww != null)\n {\n for (WorkWeek xmlWeek : ww.getWorkWeek())\n {\n ProjectCalendarWeek week = mpxjCalendar.addWorkWeek()...
[ "public ArrayList<String> getCarouselImages(){\n ArrayList<String> carouselImages = new ArrayList<>();\n for(CTInboxMessageContent ctInboxMessageContent: getInboxMessageContents()){\n carouselImages.add(ctInboxMessageContent.getMedia());\n }\n return carouselImages;\n }", ...
Retrieves the members of the given type. @param memberNames Will receive the names of the members (for sorting) @param members Will receive the members @param type The type to process @param tagName An optional tag for filtering the types @param paramName The feature to be added to the Members attribute @param paramValue The feature to be added to the Members attribute @throws XDocletException If an error occurs
[ "private void addMembers(Collection memberNames, HashMap members, XClass type, String tagName, String paramName, String paramValue) throws XDocletException\r\n {\r\n if (!type.isInterface() && (type.getFields() != null)) {\r\n XField field;\r\n\r\n for (Iterator it = type.getFields()...
[ "public static InterceptionContext forConstructorInterception(InterceptionModel interceptionModel, CreationalContext<?> ctx, BeanManagerImpl manager, SlimAnnotatedType<?> type) {\n return of(interceptionModel, ctx, manager, null, type);\n }", "private void requestPlayerDBServerPort(DeviceAnnouncement an...
ten less than Cube Q
[ "public void install(@Observes(precedence = 90) CubeDockerConfiguration configuration,\n ArquillianDescriptor arquillianDescriptor) {\n\n DockerCompositions cubes = configuration.getDockerContainersContent();\n\n final SeleniumContainers seleniumContainers =\n SeleniumContainers.crea...
[ "public static String getHeaders(HttpServletRequest request) {\n String headerString = \"\";\n Enumeration<String> headerNames = request.getHeaderNames();\n\n while (headerNames.hasMoreElements()) {\n String name = headerNames.nextElement();\n if (name.equals(Constants.ODO...
Use this API to fetch statistics of nspbr6_stats resource of given name .
[ "public static nspbr6_stats get(nitro_service service, String name) throws Exception{\n\t\tnspbr6_stats obj = new nspbr6_stats();\n\t\tobj.set_name(name);\n\t\tnspbr6_stats response = (nspbr6_stats) obj.stat_resource(service);\n\t\treturn response;\n\t}" ]
[ "private <T> T request(ClientRequest<T> delegate, String operationName) {\n long startTimeMs = -1;\n long startTimeNs = -1;\n\n if(logger.isDebugEnabled()) {\n startTimeMs = System.currentTimeMillis();\n }\n ClientRequestExecutor clientRequestExecutor = pool.checkout(de...
Returns the logger name that should be used in the log manager. @param name the name of the logger from the resource @return the name of the logger
[ "private static String getLogManagerLoggerName(final String name) {\n return (name.equals(RESOURCE_NAME) ? CommonAttributes.ROOT_LOGGER_NAME : name);\n }" ]
[ "protected void updateLabelActiveStyle() {\n if (this.valueBoxBase.getText() != null && !this.valueBoxBase.getText().isEmpty()) {\n label.addStyleName(CssName.ACTIVE);\n } else {\n label.removeStyleName(CssName.ACTIVE);\n }\n }", "public static Class<?> determineCommo...
Add a "post-run" dependent task item for this task item. @param dependent the "post-run" dependent task item. @return key to be used as parameter to taskResult(string) method to retrieve result of root task in the given dependent task group
[ "public String addPostRunDependent(FunctionalTaskItem dependent) {\n Objects.requireNonNull(dependent);\n return this.taskGroup().addPostRunDependent(dependent);\n }" ]
[ "private void performDownload(HttpResponse response, File destFile)\n throws IOException {\n HttpEntity entity = response.getEntity();\n if (entity == null) {\n return;\n }\n \n //get content length\n long contentLength = entity.getContentLength();\n ...
Use this API to export sslfipskey resources.
[ "public static base_responses export(nitro_service client, sslfipskey resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tsslfipskey exportresources[] = new sslfipskey[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\...
[ "public void takeNoteOfGradient(IntDoubleVector gradient) {\n gradient.iterate(new FnIntDoubleToVoid() { \n @Override\n public void call(int index, double value) {\n gradSumSquares[index] += value * value;\n assert !Double.isNaN(gradSumSquares[in...
Set the pickers selection type.
[ "public void setSelectionType(MaterialDatePickerType selectionType) {\n this.selectionType = selectionType;\n switch (selectionType) {\n case MONTH_DAY:\n options.selectMonths = true;\n break;\n case YEAR_MONTH_DAY:\n options.selectYea...
[ "public synchronized Set<RegistrationPoint> getRegistrationPoints() {\n Set<RegistrationPoint> result = new HashSet<>();\n for (List<RegistrationPoint> registrationPoints : registrationPoints.values()) {\n result.addAll(registrationPoints);\n }\n return Collections.unmodifiabl...
Enable clipping for the Widget. Widget content including its children will be clipped by a rectangular View Port. By default clipping is disabled.
[ "public void enableClipRegion() {\n if (mClippingEnabled) {\n Log.w(TAG, \"Clipping has been enabled already for %s!\", getName());\n return;\n }\n Log.d(Log.SUBSYSTEM.WIDGET, TAG, \"enableClipping for %s [%f, %f, %f]\",\n getName(), getViewPortWidth(), getV...
[ "protected Path normalizePath(final Path parent, final String path) {\n return parent.resolve(path).toAbsolutePath().normalize();\n }", "public static Object setProperty( String key, String value ) {\n return prp.setProperty( key, value );\n }", "private static void unpackFace(File outputDir...
Set the meta data for the photo. This method requires authentication with 'write' permission. @param photoId The photo ID @param title The new title @param description The new description @throws FlickrException
[ "public void setMeta(String photoId, String title, String description) throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_SET_META);\r\n\r\n parameters.put(\"photo_id\", photoId);\r\n parameters.put(\"title\"...
[ "protected boolean checkvalue(String colorvalue) {\n\n boolean valid = validateColorValue(colorvalue);\n if (valid) {\n if (colorvalue.length() == 4) {\n char[] chr = colorvalue.toCharArray();\n for (int i = 1; i < 4; i++) {\n String foo = St...
Convert a SSE to a Stitch SSE @param event SSE to convert @param decoder decoder for decoding data @param <T> type to decode data to @return a Stitch server-sent event
[ "static <T> StitchEvent<T> fromEvent(final Event event,\n final Decoder<T> decoder) {\n return new StitchEvent<>(event.getEventName(), event.getData(), decoder);\n }" ]
[ "public static base_response add(nitro_service client, cmppolicylabel resource) throws Exception {\n\t\tcmppolicylabel addresource = new cmppolicylabel();\n\t\taddresource.labelname = resource.labelname;\n\t\taddresource.type = resource.type;\n\t\treturn addresource.add_resource(client);\n\t}", "public void check...
Await a state. @param expected the expected state @return {@code true} if the state was reached, {@code false} otherwise
[ "boolean awaitState(final InternalState expected) {\n synchronized (this) {\n final InternalState initialRequired = this.requiredState;\n for(;;) {\n final InternalState required = this.requiredState;\n // Stop in case the server failed to reach the state\n...
[ "public static nslimitidentifier_binding get(nitro_service service, String limitidentifier) throws Exception{\n\t\tnslimitidentifier_binding obj = new nslimitidentifier_binding();\n\t\tobj.set_limitidentifier(limitidentifier);\n\t\tnslimitidentifier_binding response = (nslimitidentifier_binding) obj.get_resource(se...
Copy the contents of the given String to the given output Writer. Closes the writer when done. @param in the String to copy from @param out the Writer to copy to @throws IOException in case of I/O errors
[ "public static void copy(String in, Writer out) throws IOException {\n\t\tAssert.notNull(in, \"No input String specified\");\n\t\tAssert.notNull(out, \"No Writer specified\");\n\t\ttry {\n\t\t\tout.write(in);\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tout.close();\n\t\t\t}\n\t\t\tcatch (IOException ex) {\n\t\t\t}\...
[ "private void stereotype(Options opt, Doc c, Align align) {\n\tfor (Tag tag : c.tags(\"stereotype\")) {\n\t String t[] = tokenize(tag.text());\n\t if (t.length != 1) {\n\t\tSystem.err.println(\"@stereotype expects one field: \" + tag.text());\n\t\tcontinue;\n\t }\n\t tableLine(align, guilWrap(opt, t[0])...
This method is currently in use only by the SvnCoordinator
[ "public String getRemoteUrl(String defaultRemoteUrl) {\n if (StringUtils.isBlank(defaultRemoteUrl)) {\n RemoteConfig remoteConfig = getJenkinsScm().getRepositories().get(0);\n URIish uri = remoteConfig.getURIs().get(0);\n return uri.toPrivateString();\n }\n\n re...
[ "public void setAddContentInfo(final Boolean doAddInfo) {\n\n if ((null != doAddInfo) && doAddInfo.booleanValue() && (null != m_addContentInfoForEntries)) {\n m_addContentInfoForEntries = Integer.valueOf(DEFAULT_CONTENTINFO_ROWS);\n }\n }", "@Override\r\n public void onBrowserEvent(...
Create a KnowledgeBuilderConfiguration on which properties can be set. Use the given properties file and ClassLoader - either of which can be null. @return The KnowledgeBuilderConfiguration.
[ "public static KnowledgeBuilderConfiguration newKnowledgeBuilderConfiguration(Properties properties,\n ClassLoader... classLoaders) {\n return FactoryServiceHolder.factoryService.newKnowledgeBuilderConfiguration( properties, clas...
[ "public static List<DockerImage> getImagesByBuildId(int buildInfoId) {\n List<DockerImage> list = new ArrayList<DockerImage>();\n Iterator<DockerImage> it = images.iterator();\n while (it.hasNext()) {\n DockerImage image = it.next();\n if (image.getBuildInfoId() == buildIn...
Returns an iterable containing all the enterprise users that matches the filter and specifies which child fields to retrieve from the API. @param api the API connection to be used when retrieving the users. @param filterTerm used to filter the results to only users starting with this string in either the name or the login. Can be null to not filter the results. @param fields the fields to retrieve. Leave this out for the standard fields. @return an iterable containing all the enterprise users that matches the filter.
[ "public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm,\n final String... fields) {\n return getUsersInfoForType(api, filterTerm, null, null, fields);\n }" ]
[ "@Override\n\tpublic T next() {\n\t\tSQLException sqlException = null;\n\t\ttry {\n\t\t\tT result = nextThrow();\n\t\t\tif (result != null) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tsqlException = e;\n\t\t}\n\t\t// we have to throw if there is no next or on a SQLException\n\t\tlast =...
Checks if the given String is null or contains only whitespaces. The String is trimmed before the empty check. @param argument the String to check for null or emptiness @param argumentName the name of the argument to check. This is used in the exception message. @return the String that was given as argument @throws IllegalArgumentException in case argument is null or empty
[ "public static String notNullOrEmpty(String argument, String argumentName) {\n if (argument == null || argument.trim().isEmpty()) {\n throw new IllegalArgumentException(\"Argument \" + argumentName + \" must not be null or empty.\");\n }\n return argument;\n }" ]
[ "GVRShader makeTemplate(Class<? extends GVRShader> id, GVRContext ctx)\n {\n try\n {\n Constructor<? extends GVRShader> maker = id.getDeclaredConstructor(GVRContext.class);\n return maker.newInstance(ctx);\n }\n catch (NoSuchMethodException | IllegalAccessExcepti...
Allows testsuites to shorten the domain timeout adder
[ "private static int resolveDomainTimeoutAdder() {\n String propValue = WildFlySecurityManager.getPropertyPrivileged(DOMAIN_TEST_SYSTEM_PROPERTY, DEFAULT_DOMAIN_TIMEOUT_STRING);\n if (sysPropDomainValue == null || !sysPropDomainValue.equals(propValue)) {\n // First call or the system propert...
[ "private static List<Integer> stripNodeIds(List<Node> nodeList) {\n List<Integer> nodeidList = new ArrayList<Integer>();\n if(nodeList != null) {\n for(Node node: nodeList) {\n nodeidList.add(node.getId());\n }\n }\n return nodeidList;\n }", "@Ov...
Assigns the provided square matrix to be a random Hermitian matrix with elements from min to max value. @param A The matrix that is to be modified. Must be square. Modified. @param min Minimum value an element can have. @param max Maximum value an element can have. @param rand Random number generator.
[ "public static void fillHermitian(ZMatrixRMaj A, double min, double max, Random rand) {\n if( A.numRows != A.numCols )\n throw new IllegalArgumentException(\"A must be a square matrix\");\n\n double range = max-min;\n\n int length = A.numRows;\n\n for( int i = 0; i < length; i...
[ "private void processColumns()\n {\n int fieldID = MPPUtility.getInt(m_data, m_headerOffset);\n m_headerOffset += 4;\n\n m_dataOffset = MPPUtility.getInt(m_data, m_headerOffset);\n m_headerOffset += 4;\n\n FieldType type = FieldTypeHelper.getInstance(fieldID);\n if (type.getDataType(...
Checks String to see if the parameter is null. @param paramValue Object that will be checked if null. @return this.true if the parameter that is being checked is not null
[ "private boolean isNullOrEmpty(Object paramValue) {\n boolean isNullOrEmpty = false;\n if (paramValue == null) {\n isNullOrEmpty = true;\n }\n if (paramValue instanceof String) {\n if (((String) paramValue).trim().equalsIgnoreCase(\"\")) {\n isNullOrE...
[ "protected float getViewPortSize(final Axis axis) {\n float size = mViewPort == null ? 0 : mViewPort.get(axis);\n Log.d(Log.SUBSYSTEM.LAYOUT, TAG, \"getViewPortSize for %s %f mViewPort = %s\", axis, size, mViewPort);\n return size;\n }", "synchronized void asyncReconnect(final URI reconne...
Obtains a local date in Julian calendar system from the proleptic-year, month-of-year and day-of-month fields. @param prolepticYear the proleptic-year @param month the month-of-year @param dayOfMonth the day-of-month @return the Julian local date, not null @throws DateTimeException if unable to create the date
[ "@Override\n public JulianDate date(int prolepticYear, int month, int dayOfMonth) {\n return JulianDate.of(prolepticYear, month, dayOfMonth);\n }" ]
[ "protected void finishBox()\n {\n \tif (textLine.length() > 0)\n \t{\n String s;\n if (isReversed(Character.getDirectionality(textLine.charAt(0))))\n s = textLine.reverse().toString();\n else\n s = textLine.toString();\n\n curstyle.s...
Sets the global setting for this ID @param pathId ID of path @param global True if global, False otherwise
[ "public void setGlobal(int pathId, Boolean global) {\n PreparedStatement statement = null;\n\n try (Connection sqlConnection = sqlService.getConnection()) {\n statement = sqlConnection.prepareStatement(\n \"UPDATE \" + Constants.DB_TABLE_PATH +\n \" SET \" ...
[ "protected String getPayload(Message message) {\n try {\n String encoding = (String) message.get(Message.ENCODING);\n if (encoding == null) {\n encoding = \"UTF-8\";\n }\n CachedOutputStream cos = message.getContent(CachedOutputStream.class);\n ...
Calculate entropy value. @param values Values. @return Returns entropy value of the specified histogram array.
[ "public static double Entropy( int[] values ){\n int n = values.length;\n int total = 0;\n double entropy = 0;\n double p;\n\n // calculate total amount of hits\n for ( int i = 0; i < n; i++ )\n {\n total += values[i];\n }\n\n if ( ...
[ "public final void cancelOld(\n final long starttimeThreshold, final long checkTimeThreshold, final String message) {\n final CriteriaBuilder builder = getSession().getCriteriaBuilder();\n final CriteriaUpdate<PrintJobStatusExtImpl> update =\n builder.createCriteriaUpdate(Pri...
Queries the running container and attempts to lookup the information from the running container. @param client the client used to execute the management operation @return the container description @throws IOException if an error occurs while executing the management operation @throws OperationExecutionException if the operation used to query the container fails
[ "static DefaultContainerDescription lookup(final ModelControllerClient client) throws IOException, OperationExecutionException {\n final ModelNode op = Operations.createReadResourceOperation(new ModelNode().setEmptyList());\n op.get(ClientConstants.INCLUDE_RUNTIME).set(true);\n final ModelNode ...
[ "public final void notifyContentItemRangeChanged(int positionStart, int itemCount) {\n if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > contentItemCount) {\n throw new IndexOutOfBoundsException(\"The given range [\" + positionStart + \" - \"\n + (positionSta...
Use this API to fetch bridgegroup_nsip_binding resources of given name .
[ "public static bridgegroup_nsip_binding[] get(nitro_service service, Long id) throws Exception{\n\t\tbridgegroup_nsip_binding obj = new bridgegroup_nsip_binding();\n\t\tobj.set_id(id);\n\t\tbridgegroup_nsip_binding response[] = (bridgegroup_nsip_binding[]) obj.get_resources(service);\n\t\treturn response;\n\t}" ]
[ "public int rebalanceNode(final RebalanceTaskInfo stealInfo) {\n\n final RebalanceTaskInfo info = metadataStore.getRebalancerState()\n .find(stealInfo.getDonorId());\n\n // Do we have the plan in the state?\n if(info == null) {\n thr...
Invoked periodically.
[ "public void run() {\r\n\t\tConnectionHandle connection = null;\r\n\t\tlong tmp;\r\n\t\tlong nextCheckInMs = this.maxAgeInMs;\r\n\r\n\t\tint partitionSize= this.partition.getAvailableConnections();\r\n\t\tlong currentTime = System.currentTimeMillis();\r\n\t\tfor (int i=0; i < partitionSize; i++){\r\n\t\t\ttry {\r\n...
[ "public void resetQuotaAndRecoverEnforcement() {\n for(Integer nodeId: nodeIds) {\n boolean quotaEnforcement = mapNodeToQuotaEnforcingEnabled.get(nodeId);\n adminClient.metadataMgmtOps.updateRemoteMetadata(Arrays.asList(nodeId),\n ...
removes all data for an annotation class. This should be called after an annotation has been modified through the SPI
[ "public void clearAnnotationData(Class<? extends Annotation> annotationClass) {\n stereotypes.invalidate(annotationClass);\n scopes.invalidate(annotationClass);\n qualifiers.invalidate(annotationClass);\n interceptorBindings.invalidate(annotationClass);\n }" ]
[ "public static String getGetterName(String propertyName, Class type) {\n String prefix = type == boolean.class || type == Boolean.class ? \"is\" : \"get\";\n return prefix + MetaClassHelper.capitalize(propertyName);\n }", "private static void listHierarchy(ProjectFile file)\n {\n for (Task...
Convert an Object to a Timestamp.
[ "public static java.sql.Timestamp toTimestamp(Object value) throws ParseException {\n if (value == null) {\n return null;\n }\n if (value instanceof java.sql.Timestamp) {\n return (java.sql.Timestamp) value;\n }\n if (value instanceof String) {\n\n ...
[ "public double[][] getU() {\n double[][] X = new double[n][n];\n double[][] U = X;\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n if (i <= j) {\n U[i][j] = LU[i][j];\n } else {\n U[i][j] = 0.0;\n ...
Retrieve timephased baseline work. Note that index 0 represents "Baseline", index 1 represents "Baseline1" and so on. @param index baseline index @return timephased work, or null if no baseline is present
[ "public List<TimephasedWork> getTimephasedBaselineWork(int index)\n {\n return m_timephasedBaselineWork[index] == null ? null : m_timephasedBaselineWork[index].getData();\n }" ]
[ "private static String normalizeDirName(String name)\n {\n if(name == null)\n return null;\n return name.toLowerCase().replaceAll(\"[^a-zA-Z0-9]\", \"-\");\n }", "public static String fancyStringF(double value, DecimalFormat format, int length, int significant) {\n\n String f...
Shuffle an array. @param array Array. @param seed Random seed.
[ "public static void Shuffle(double[] array, long seed) {\n Random random = new Random();\n if (seed != 0) random.setSeed(seed);\n\n for (int i = array.length - 1; i > 0; i--) {\n int index = random.nextInt(i + 1);\n double temp = array[index];\n array[index] = a...
[ "public String getMethodSignature() {\n if (method != null) {\n String methodSignature = method.toString();\n return methodSignature.replaceFirst(\"public void \", \"\");\n }\n return null;\n }", "public static final BigInteger printDurationInIntegerTenthsOfMinutes(Du...
Start listening for device announcements and keeping track of the DJ Link devices visible on the network. If already listening, has no effect. @throws SocketException if the socket to listen on port 50000 cannot be created
[ "public synchronized void start() throws SocketException {\n\n if (!isRunning()) {\n socket.set(new DatagramSocket(ANNOUNCEMENT_PORT));\n startTime.set(System.currentTimeMillis());\n deliverLifecycleAnnouncement(logger, true);\n\n final byte[] buffer = new byte[512...
[ "protected List<String> getPluginsPath() throws IOException {\n List<String> result = new ArrayList<>();\n Path pluginsDirectory = PROPERTIES.getAllureHome().resolve(\"plugins\").toAbsolutePath();\n if (Files.notExists(pluginsDirectory)) {\n return Collections.emptyList();\n }...
Create a random video. @return random video.
[ "private Video generateRandomVideo() {\n Video video = new Video();\n configureFavoriteStatus(video);\n configureLikeStatus(video);\n configureLiveStatus(video);\n configureTitleAndThumbnail(video);\n return video;\n }" ]
[ "public boolean detectBlackBerryHigh() {\r\n\r\n //Disambiguate for BlackBerry OS 6 or 7 (WebKit) browser\r\n if (detectBlackBerryWebKit()) {\r\n return false;\r\n }\r\n if (detectBlackBerry()) {\r\n if (detectBlackBerryTouch()\r\n || (userAgent.index...
Use this API to fetch all the appfwlearningdata resources that are configured on netscaler. This uses appfwlearningdata_args which is a way to provide additional arguments while fetching the resources.
[ "public static appfwlearningdata[] get(nitro_service service, appfwlearningdata_args args) throws Exception{\n\t\tappfwlearningdata obj = new appfwlearningdata();\n\t\toptions option = new options();\n\t\toption.set_args(nitro_util.object_to_string_withoutquotes(args));\n\t\tappfwlearningdata[] response = (appfwlea...
[ "public static base_responses delete(nitro_service client, String network[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (network != null && network.length > 0) {\n\t\t\troute6 deleteresources[] = new route6[network.length];\n\t\t\tfor (int i=0;i<network.length;i++){\n\t\t\t\tdeleteresources[i] = ...
Inserts a new instance but references via the outIdentifier, which is returned as part of the ExecutionResults @param object @param outIdentifier @return
[ "public static Command newInsert(Object object,\n String outIdentifier) {\n return getCommandFactoryProvider().newInsert( object,\n outIdentifier );\n }" ]
[ "public CustomHeadersInterceptor addHeaderMultimap(Map<String, List<String>> headers) {\n this.headers.putAll(headers);\n return this;\n }", "public static ServiceFuture<Void> fromBody(final Completable completable, final ServiceCallback<Void> callback) {\n final ServiceFuture<Void> servic...
Joins the given parts to recover the original secret. <p><b>N.B.:</b> There is no way to determine whether or not the returned value is actually the original secret. If the parts are incorrect, or are under the threshold value used to split the secret, a random value will be returned. @param parts a map of part IDs to part values @return the original secret @throws IllegalArgumentException if {@code parts} is empty or contains values of varying lengths
[ "public byte[] join(Map<Integer, byte[]> parts) {\n checkArgument(parts.size() > 0, \"No parts provided\");\n final int[] lengths = parts.values().stream().mapToInt(v -> v.length).distinct().toArray();\n checkArgument(lengths.length == 1, \"Varying lengths of part values\");\n final byte[] secret = new ...
[ "protected String getKey(final String ref, final String filename, final String extension) {\n return prefix + ref + \"/\" + filename + \".\" + extension;\n }", "public void logAttributeWarning(PathAddress address, Set<String> attributes) {\n logAttributeWarning(address, null, null, attributes);\n...
Return overall per token accuracy
[ "public Triple<Double, Integer, Integer> getAccuracyInfo()\r\n {\r\n int totalCorrect = tokensCorrect;\r\n int totalWrong = tokensCount - tokensCorrect;\r\n return new Triple<Double, Integer, Integer>((((double) totalCorrect) / tokensCount),\r\n totalCorrect, totalWrong);\r\n }" ]
[ "public AddonChange addAddon(String appName, String addonName) {\n return connection.execute(new AddonInstall(appName, addonName), apiKey);\n }", "private void disableCertificateVerification()\n throws KeyManagementException, NoSuchAlgorithmException {\n // Create a trust manager that ...