query stringlengths 7 3.3k | positive listlengths 1 1 | negative listlengths 9 9 |
|---|---|---|
Returns the name of the bone.
@return the name | [
"public String getName()\n {\n GVRSceneObject owner = getOwnerObject();\n String name = \"\";\n\n if (owner != null)\n {\n name = owner.getName();\n if (name == null)\n return \"\";\n }\n return name;\n }"
] | [
"public Document removeDocument(String key) throws PrintingException {\n\t\tif (documentMap.containsKey(key)) {\n\t\t\treturn documentMap.remove(key);\n\t\t} else {\n\t\t\tthrow new PrintingException(PrintingException.DOCUMENT_NOT_FOUND, key);\n\t\t}\n\t}",
"public VALUE put(KEY key, VALUE object) {\n Cach... |
Constructs the path from FQCN, validates writability, and creates a writer. | [
"private static synchronized FileOutputWriter createFileWriter(final TypeDefinition type, final DecompilerSettings settings)\n throws IOException\n {\n final String outputDirectory = settings.getOutputDirectory();\n\n final String fileName = type.getName() + settings.getLanguage().ge... | [
"private void readTableData(List<SynchroTable> tables, InputStream is) throws IOException\n {\n for (SynchroTable table : tables)\n {\n if (REQUIRED_TABLES.contains(table.getName()))\n {\n readTable(is, table);\n }\n }\n }",
"private void debugLogStart(String ... |
Process a single project.
@param reader Primavera reader
@param projectID required project ID
@param outputFile output file name | [
"private void processProject(PrimaveraDatabaseReader reader, int projectID, String outputFile) throws Exception\n {\n long start = System.currentTimeMillis();\n reader.setProjectID(projectID);\n ProjectFile projectFile = reader.read();\n long elapsed = System.currentTimeMillis() - start;\n ... | [
"public void addInterface(Class<?> newInterface) {\n if (!newInterface.isInterface()) {\n throw new IllegalArgumentException(newInterface + \" is not an interface\");\n }\n additionalInterfaces.add(newInterface);\n }",
"public static String cutEnd(String data, int maxLength) {\n... |
Utility function that copies a string array except for the first element
@param arr Original array of strings
@return Copied array of strings | [
"public static String[] copyArrayCutFirst(String[] arr) {\n if(arr.length > 1) {\n String[] arrCopy = new String[arr.length - 1];\n System.arraycopy(arr, 1, arrCopy, 0, arrCopy.length);\n return arrCopy;\n } else {\n return new String[0];\n }\n }"
... | [
"public static Set<Annotation> flattenInterceptorBindings(EnhancedAnnotatedType<?> clazz, BeanManagerImpl beanManager, Collection<Annotation> annotations, boolean addTopLevelInterceptorBindings,\n boolean addInheritedInterceptorBindings) {\n Set<Annotation> flattenInterceptorBindings = new Interce... |
Generate a PageMetadata object for the page represented by the specified pagination token.
@param paginationToken opaque pagination token
@param initialParameters the initial view query parameters (i.e. for the page 1 request).
@param <K> the view key type
@param <V> the view value type
@... | [
"static <K, V> PageMetadata<K, V> mergeTokenAndQueryParameters(String paginationToken, final\n ViewQueryParameters<K, V> initialParameters) {\n\n // Decode the base64 token into JSON\n String json = new String(Base64.decodeBase64(paginationToken), Charset.forName(\"UTF-8\"));\n\n // Get a su... | [
"private void writeDurationField(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 Duration val = (Duration) value;\n if (val.getDuration(... |
Set the pattern scheme.
@param isWeekDayBased flag, indicating if the week day based scheme should be set. | [
"public void setPatternScheme(final boolean isWeekDayBased) {\n\n if (isWeekDayBased ^ (null != m_model.getWeekDay())) {\n removeExceptionsOnChange(new Command() {\n\n public void execute() {\n\n if (isWeekDayBased) {\n m_model.setWeekDay(ge... | [
"okhttp3.Response get(String url, Map<String, Object> params)\n throws RequestException, LocalOperationException {\n\n String fullUrl = getFullUrl(url);\n okhttp3.Request request = new okhttp3.Request.Builder()\n .url(addUrlParams(fullUrl, toPayload(params)))\n ... |
Gets the '.disabled' file for a given version of this store. That file may or may not
exist.
@param version of the store for which to get the '.disabled' file.
@return an instance of {@link File} pointing to the '.disabled' file.
@throws PersistenceFailureException if the requested version cannot be found. | [
"private File getDisabledMarkerFile(long version) throws PersistenceFailureException {\n File[] versionDirArray = ReadOnlyUtils.getVersionDirs(rootDir, version, version);\n if (versionDirArray.length == 0) {\n throw new PersistenceFailureException(\"getDisabledMarkerFile did not find the re... | [
"protected PersistenceBrokerInternal createNewBrokerInstance(PBKey key) throws PBFactoryException\r\n {\r\n if (key == null) throw new PBFactoryException(\"Could not create new broker with PBkey argument 'null'\");\r\n // check if the given key really exists\r\n if (MetadataManager.getInstan... |
Creates a resource key with id defined as enumeration value name and bundle specified by given class.
@param clazz the class owning the bundle
@param value enumeration value used to define key id
@return the resource key | [
"public static ResourceKey key(Class<?> clazz, Enum<?> value) {\n return new ResourceKey(clazz.getName(), value.name());\n }"
] | [
"protected void appendGroupByClause(List groupByFields, StringBuffer buf)\r\n {\r\n if (groupByFields == null || groupByFields.size() == 0)\r\n {\r\n return;\r\n }\r\n\r\n buf.append(\" GROUP BY \");\r\n for (int i = 0; i < groupByFields.size(); i++)\r\n {\r\n... |
Find a column by its name
@param columnName the name of the column
@return the given Column, or <code>null</code> if not found | [
"public Column getColumn(String columnName) {\n if (columnName == null) {\n return null;\n }\n for (Column column : columns) {\n if (columnName.equals(column.getData())) {\n return column;\n }\n }\n return null;\n }"
] | [
"public static final Boolean parseBoolean(String value)\n {\n return (value == null || value.charAt(0) != '1' ? Boolean.FALSE : Boolean.TRUE);\n }",
"private void registerSynchronization(TransactionImpl odmgTrans, Transaction transaction)\r\n {\r\n // todo only need for development\r\n i... |
Retrieve a work field.
@param type field type
@return Duration instance | [
"public Duration getWork(FastTrackField type)\n {\n Double value = (Double) getObject(type);\n return value == null ? null : Duration.getInstance(value.doubleValue(), m_table.getWorkTimeUnit());\n }"
] | [
"private void populateResource(Resource resource, Record record) throws MPXJException\n {\n String falseText = LocaleData.getString(m_locale, LocaleData.NO);\n\n int length = record.getLength();\n int[] model = m_resourceModel.getModel();\n\n for (int i = 0; i < length; i++)\n {\n ... |
Binding view holder with payloads is used to handle partial changes in item. | [
"@Override\n public void onBindViewHolder(GalleryAdapter.ViewHolder holder, int position, List<Object> payloads) {\n if (payloads.isEmpty()) { // If doesn't have any payload then bind the fully item\n super.onBindViewHolder(holder, position, payloads);\n } else {\n for (Object... | [
"public BoxFolder.Info getFolderInfo(String folderID, String... fields) {\n String queryString = new QueryStringBuilder().appendParam(\"fields\", fields).toString();\n URL url = FOLDER_INFO_URL_TEMPLATE.buildWithQuery(this.api.getBaseURL(), queryString, folderID);\n BoxAPIRequest request = new ... |
Select item by it's position
@param position int value of item position to select
@param invokeListeners boolean value for invoking listeners | [
"@SuppressWarnings(\"unused\")\n public void selectItem(int position, boolean invokeListeners) {\n IOperationItem item = mOuterAdapter.getItem(position);\n IOperationItem oldHidedItem = mOuterAdapter.getItem(mRealHidedPosition);\n\n int realPosition = mOuterAdapter.normalizePosition(position... | [
"public static ComponentsMultiThread getComponentsMultiThread() {\n TransactionLogger instance = getInstance();\n if (instance == null) {\n return null;\n }\n\n return instance.componentsMultiThread;\n }",
"public static String[] copyArrayCutFirst(String[] arr) {\n if(arr.length > 1) {\n ... |
Removes a parameter from this configuration.
@param key the parameter to remove | [
"@Override\r\n public String remove(Object key) {\r\n\r\n String result = m_configurationStrings.remove(key);\r\n m_configurationObjects.remove(key);\r\n return result;\r\n }"
] | [
"public static String join(final Collection<?> collection, final String separator) {\n StringBuffer buffer = new StringBuffer();\n boolean first = true;\n Iterator<?> iter = collection.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n if (first) ... |
Returns the number of days from the given weekday to the next weekday the event should occur.
@param weekDay the current weekday.
@return the number of days to the next weekday an event could occur. | [
"private int getDaysToNextMatch(WeekDay weekDay) {\n\n for (WeekDay wd : m_weekDays) {\n if (wd.compareTo(weekDay) > 0) {\n return wd.toInt() - weekDay.toInt();\n }\n }\n return (m_weekDays.iterator().next().toInt() + (m_interval * I_CmsSerialDateValue.NUM_O... | [
"protected void printCenterWithLead(String lead, String format, Object ... args) {\n String text = S.fmt(format, args);\n int len = 80 - lead.length();\n info(S.concat(lead, S.center(text, len)));\n }",
"public int getReplaceContextLength() {\n\t\tif (replaceContextLength == null) {\n\t\t\... |
Given a filesystem and path to a node, gets all the files which belong to
a partition and replica type
Works only for {@link ReadOnlyStorageFormat.READONLY_V2}
@param fs Underlying filesystem
@param path The node directory path
@param partitionId The partition id for which we get the files
@param replicaType The repl... | [
"public static FileStatus[] getDataChunkFiles(FileSystem fs,\n Path path,\n final int partitionId,\n final int replicaType) throws IOException {\n return fs.listStat... | [
"public static String encodeHost(String host, String encoding) throws UnsupportedEncodingException {\n\t\treturn HierarchicalUriComponents.encodeUriComponent(host, encoding, HierarchicalUriComponents.Type.HOST_IPV4);\n\t}",
"public Rule CriteriaOnlyFindQuery() {\n\t\treturn Sequence( !peek().isCliQuery(), JsonPar... |
Accessor method used to retrieve a Number instance representing the
contents of an individual field. If the field does not exist in the
record, null is returned.
@param field the index number of the field to be retrieved
@return the value of the required field
@throws MPXJException normally thrown when parsing fails | [
"public Number getUnits(int field) throws MPXJException\n {\n Number result;\n\n if ((field < m_fields.length) && (m_fields[field].length() != 0))\n {\n try\n {\n result = Double.valueOf(m_formats.getUnitsDecimalFormat().parse(m_fields[field]).doubleValue() * 100);\n ... | [
"public DockerContainerObjectBuilder<T> withContainerObjectClass(Class<T> containerObjectClass) {\n if (containerObjectClass == null) {\n throw new IllegalArgumentException(\"container object class cannot be null\");\n }\n this.containerObjectClass = containerObjectClass;\n\n ... |
Get the authorization uri, where the user logs in.
@param redirectUri
Uri the user is redirected to, after successful authorization.
This must be the same as specified at the Eve Online developer
page.
@param scopes
Scopes of the Eve Online SSO.
@param state
This should be some secret to prevent XRSF, please read:
htt... | [
"public String getAuthorizationUri(final String redirectUri, final Set<String> scopes, final String state) {\n if (account == null)\n throw new IllegalArgumentException(\"Auth is not set\");\n if (account.getClientId() == null)\n throw new IllegalArgumentException(\"client_id is ... | [
"@Override\n public synchronized void resume() {\n this.paused = false;\n ServerActivityCallback listener = listenerUpdater.get(this);\n if (listener != null) {\n listenerUpdater.compareAndSet(this, listener, null);\n }\n while (!taskQueue.isEmpty() && (activeRequest... |
Calculate the value of a CMS option using the Black-Scholes model for the swap rate together with
the Hunt-Kennedy convexity adjustment.
@param forwardSwaprate The forward swap rate
@param volatility Volatility of the log of the swap rate
@param swapAnnuity The swap annuity
@param optionMaturity The option maturity
@p... | [
"public static double huntKennedyCMSOptionValue(\n\t\t\tdouble forwardSwaprate,\n\t\t\tdouble volatility,\n\t\t\tdouble swapAnnuity,\n\t\t\tdouble optionMaturity,\n\t\t\tdouble swapMaturity,\n\t\t\tdouble payoffUnit,\n\t\t\tdouble optionStrike)\n\t{\n\t\tdouble a = 1.0/swapMaturity;\n\t\tdouble b = (payoffUnit / sw... | [
"public static gslbldnsentries[] get(nitro_service service) throws Exception{\n\t\tgslbldnsentries obj = new gslbldnsentries();\n\t\tgslbldnsentries[] response = (gslbldnsentries[])obj.get_resources(service);\n\t\treturn response;\n\t}",
"public void setAlias(String alias)\r\n\t{\r\n\t\tif (alias == null || alias... |
This method writes assignment data to an MSPDI file.
@param project Root node of the MSPDI file | [
"private void writeAssignments(Project project)\n {\n Project.Assignments assignments = m_factory.createProjectAssignments();\n project.setAssignments(assignments);\n List<Project.Assignments.Assignment> list = assignments.getAssignment();\n\n for (ResourceAssignment assignment : m_projectFile... | [
"public CurrencyQueryBuilder setCountries(Locale... countries) {\n return set(CurrencyQuery.KEY_QUERY_COUNTRIES, Arrays.asList(countries));\n }",
"void throwCloudExceptionIfInFailedState() {\n if (this.isStatusFailed()) {\n if (this.errorBody() != null) {\n throw new Clo... |
Retrieve the integer value used to represent a task field in an
MPX file.
@param value MPXJ task field value
@return MPX field value | [
"public static int getMpxField(int value)\n {\n int result = 0;\n\n if (value >= 0 && value < MPXJ_MPX_ARRAY.length)\n {\n result = MPXJ_MPX_ARRAY[value];\n }\n return (result);\n }"
] | [
"public boolean start(SensorManager sensorManager) {\n // Already started?\n if (accelerometer != null) {\n return true;\n }\n\n accelerometer = sensorManager.getDefaultSensor(\n Sensor.TYPE_ACCELEROMETER);\n\n // If this phone has an accelerometer, listen to it.\n if (accelerometer !=... |
Perform the module promotion
@param moduleId String | [
"public void promoteModule(final String moduleId) {\n final DbModule module = getModule(moduleId);\n\n for (final String gavc : DataUtils.getAllArtifacts(module)) {\n final DbArtifact artifact = repositoryHandler.getArtifact(gavc);\n artifact.setPromoted(true);\n repos... | [
"public static DMatrixRMaj symmetric(int length, double min, double max, Random rand) {\n DMatrixRMaj A = new DMatrixRMaj(length,length);\n\n symmetric(A,min,max,rand);\n\n return A;\n }",
"public static Identifiers convertProfileAndPathIdentifier(String profileIdentifier, String pathIdent... |
Performs spellchecking using Solr and returns the spellchecking results using JSON.
@param res The HttpServletResponse object.
@param servletRequest The ServletRequest object.
@param cms The CmsObject object.
@throws CmsPermissionViolationException in case of the anonymous guest user
@throws IOException if writing th... | [
"public void getSpellcheckingResult(\n final HttpServletResponse res,\n final ServletRequest servletRequest,\n final CmsObject cms)\n throws CmsPermissionViolationException, IOException {\n\n // Perform a permission check\n performPermissionCheck(cms);\n\n // Set the app... | [
"protected boolean isFirstVisit(Object expression) {\r\n if (visited.contains(expression)) {\r\n return false;\r\n }\r\n visited.add(expression);\r\n return true;\r\n }",
"public static boolean isTodoItem(final Document todoItemDoc) {\n return todoItemDoc.containsKey(I... |
Determines if a mouse event is inside a box. | [
"public static final boolean isMouseInside(NativeEvent event, Element element) {\n return isInside(event.getClientX() + Window.getScrollLeft(), event.getClientY() + Window.getScrollTop(), getBounds(element));\n }"
] | [
"public static float noise1(float x) {\n int bx0, bx1;\n float rx0, rx1, sx, t, u, v;\n\n if (start) {\n start = false;\n init();\n }\n\n t = x + N;\n bx0 = ((int)t) & BM;\n bx1 = (bx0+1) & BM;\n rx0 = t - (int)t;\n rx1 = rx0 - 1.0... |
Translate the given byte array into a string of 1s and 0s
@param bytes The bytes to translate
@return The string | [
"public static String toBinaryString(byte[] bytes) {\n StringBuilder buffer = new StringBuilder();\n for(byte b: bytes) {\n String bin = Integer.toBinaryString(0xFF & b);\n bin = bin.substring(0, Math.min(bin.length(), 8));\n\n for(int j = 0; j < 8 - bin.length(); j++)... | [
"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()... |
Creates and returns a temporary directory for a printing task. | [
"public final File getTaskDirectory() {\n createIfMissing(this.working, \"Working\");\n try {\n return Files.createTempDirectory(this.working.toPath(), TASK_DIR_PREFIX).toFile();\n } catch (IOException e) {\n throw new AssertionError(\"Unable to create temporary directory ... | [
"private void lockLocalization(Locale l) throws CmsException {\n\n if (null == m_lockedBundleFiles.get(l)) {\n LockedFile lf = LockedFile.lockResource(m_cms, m_bundleFiles.get(l));\n m_lockedBundleFiles.put(l, lf);\n }\n\n }",
"public void setCapture(boolean capture, float f... |
Inserts a CharSequence array value into the mapping of the underlying Bundle, replacing any
existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence array object, or null
@return this bundler instance to chain method calls | [
"public Bundler put(String key, CharSequence[] value) {\n delegate.putCharSequenceArray(key, value);\n return this;\n }"
] | [
"public static boolean isAvailable() throws Exception {\n try {\n Registry myRegistry = LocateRegistry.getRegistry(\"127.0.0.1\", port);\n com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME);\n ... |
Remove the set of partitions from the node provided
@param node The node from which we're removing the partitions
@param donatedPartitions The list of partitions to remove
@return The new node without the partitions | [
"public static Node removePartitionsFromNode(final Node node,\n final Set<Integer> donatedPartitions) {\n List<Integer> deepCopy = new ArrayList<Integer>(node.getPartitionIds());\n deepCopy.removeAll(donatedPartitions);\n return updateNode(node, de... | [
"void applyFreshParticleOffScreen(\n @NonNull final Scene scene,\n final int position) {\n final int w = scene.getWidth();\n final int h = scene.getHeight();\n if (w == 0 || h == 0) {\n throw new IllegalStateException(\n \"Cannot generate part... |
Given a file name and read-only storage format, tells whether the file
name format is correct
@param fileName The name of the file
@param format The RO format
@return true if file format is correct, else false | [
"public static boolean isFormatCorrect(String fileName, ReadOnlyStorageFormat format) {\n switch(format) {\n case READONLY_V0:\n case READONLY_V1:\n if(fileName.matches(\"^[\\\\d]+_[\\\\d]+\\\\.(data|index)\")) {\n return true;\n } else {... | [
"private Widget setStyle(Widget widget) {\n\n widget.setWidth(m_width);\n widget.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);\n return widget;\n }",
"public void init(LblTree t1, LblTree t2) {\n\t\tLabelDictionary ld = new LabelDictionary();\n\t\tit1 = new InfoTree(t1, ld);\n\... |
Read ClassDescriptors from the given InputStream.
@see #mergeDescriptorRepository | [
"public DescriptorRepository readDescriptorRepository(InputStream inst)\r\n {\r\n try\r\n {\r\n RepositoryPersistor persistor = new RepositoryPersistor();\r\n return persistor.readDescriptorRepository(inst);\r\n }\r\n catch (Exception e)\r\n {\r\n ... | [
"public static <GIVEN, WHEN, THEN> Scenario<GIVEN, WHEN, THEN> create( Class<GIVEN> givenClass, Class<WHEN> whenClass,\n Class<THEN> thenClass ) {\n return new Scenario<GIVEN, WHEN, THEN>( givenClass, whenClass, thenClass );\n }",
"public void fireAssignmentReadEvent(ResourceAssignment resour... |
Generates the body of a toString method that uses a StringBuilder.
<p>Conventionally, we join properties with comma separators. If all of the properties are
optional, we have no choice but to track the separators at runtime, but if any of them will
always be present, we can actually do the hard work at compile time. S... | [
"private static void bodyWithBuilder(\n SourceBuilder code,\n Datatype datatype,\n Map<Property, PropertyCodeGenerator> generatorsByProperty,\n String typename,\n Predicate<PropertyCodeGenerator> isOptional) {\n Variable result = new Variable(\"result\");\n\n code.add(\" %1$s %2$s = ... | [
"public List<File> getInactiveOverlays() throws PatchingException {\n if (referencedOverlayDirectories == null) {\n walk();\n }\n List<File> inactiveDirs = null;\n for (Layer layer : installedIdentity.getLayers()) {\n final File overlaysDir = new File(layer.getDirec... |
Backup the current version of the configuration to the versioned configuration history | [
"void backup() throws ConfigurationPersistenceException {\n if (!doneBootup.get()) {\n return;\n }\n try {\n if (!interactionPolicy.isReadOnly()) {\n //Move the main file to the versioned history\n moveFile(mainFile, getVersionedFile(mainFile)... | [
"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 ... |
Computes the ratio of the smallest value to the largest. Does not assume
the array is sorted first
@param sv array
@return smallest / largest | [
"public static double ratioSmallestOverLargest( double []sv ) {\n if( sv.length == 0 )\n return Double.NaN;\n\n double min = sv[0];\n double max = min;\n\n for (int i = 1; i < sv.length; i++) {\n double v = sv[i];\n if( v > max )\n max = v;... | [
"public WebSocketContext sendToTagged(String message, String tag) {\n return sendToTagged(message, tag, false);\n }",
"public void createProposals(final Collection<ContentAssistContext> contexts, final IIdeContentProposalAcceptor acceptor) {\n Iterable<ContentAssistContext> _filteredContexts = this.g... |
Use this API to fetch all the snmpmanager resources that are configured on netscaler. | [
"public static snmpmanager[] get(nitro_service service) throws Exception{\n\t\tsnmpmanager obj = new snmpmanager();\n\t\tsnmpmanager[] response = (snmpmanager[])obj.get_resources(service);\n\t\treturn response;\n\t}"
] | [
"private static void addCacheFormatEntry(List<Message> trackListEntries, int playlistId, ZipOutputStream zos) throws IOException {\n // Add a marker so we can recognize this as a metadata archive. I would use the ZipFile comment, but\n // that is not available until Java 7, and Beat Link is supposed t... |
Caches the given object using the given Identity as key
@param oid The Identity key
@param obj The object o cache | [
"public void cache(Identity oid, Object obj)\r\n {\r\n if (oid != null && obj != null)\r\n {\r\n ObjectCache cache = getCache(oid, obj, METHOD_CACHE);\r\n if (cache != null)\r\n {\r\n cache.cache(oid, obj);\r\n }\r\n }\r\n }"
] | [
"private GenericCriteriaPrompt getPromptValue(FieldType field, byte[] block)\n {\n int textOffset = getPromptOffset(block);\n String value = MPPUtility.getUnicodeString(m_criteriaData, m_criteriaTextStart + textOffset);\n GenericCriteriaPrompt prompt = new GenericCriteriaPrompt(field.getDataType(),... |
Use this API to fetch all the gslbldnsentries resources that are configured on netscaler. | [
"public static gslbldnsentries[] get(nitro_service service) throws Exception{\n\t\tgslbldnsentries obj = new gslbldnsentries();\n\t\tgslbldnsentries[] response = (gslbldnsentries[])obj.get_resources(service);\n\t\treturn response;\n\t}"
] | [
"public void addRequiredValues(@Nonnull final Values sourceValues) {\n Object taskDirectory = sourceValues.getObject(TASK_DIRECTORY_KEY, Object.class);\n MfClientHttpRequestFactoryProvider requestFactoryProvider =\n sourceValues.getObject(CLIENT_HTTP_REQUEST_FACTORY_KEY,\n ... |
splits a string into a list of strings. Trims the results and ignores empty strings | [
"public static List<String> splitAndTrimAsList(String text, String sep) {\n ArrayList<String> answer = new ArrayList<>();\n if (text != null && text.length() > 0) {\n for (String v : text.split(sep)) {\n String trim = v.trim();\n if (trim.length() > 0) {\n ... | [
"@Override public void onBindViewHolder(RendererViewHolder viewHolder, int position) {\n T content = getItem(position);\n Renderer<T> renderer = viewHolder.getRenderer();\n if (renderer == null) {\n throw new NullRendererBuiltException(\"RendererBuilder have to return a not null renderer\");\n }\n ... |
Sets a file whose contents will be prepended to the JAR file's data.
@param file the prefix file, or {@code null} for none.
@return {@code this} | [
"public Jar setJarPrefix(Path file) {\n verifyNotSealed();\n if (jos != null)\n throw new IllegalStateException(\"Really executable cannot be set after entries are added.\");\n if (file != null && jarPrefixStr != null)\n throw new IllegalStateException(\"A prefix has alrea... | [
"private void attachLocaleGroups(CmsResource copiedPage) throws CmsException {\n\n CmsLocaleGroupService localeGroupService = getRootCms().getLocaleGroupService();\n if (Status.linkable == localeGroupService.checkLinkable(m_originalPage, copiedPage)) {\n try {\n localeGroupSe... |
Writes assignment baseline data.
@param xml MSPDI assignment
@param mpxj MPXJ assignment | [
"private void writeAssignmentBaselines(Project.Assignments.Assignment xml, ResourceAssignment mpxj)\n {\n Project.Assignments.Assignment.Baseline baseline = m_factory.createProjectAssignmentsAssignmentBaseline();\n boolean populated = false;\n\n Number cost = mpxj.getBaselineCost();\n if (cost... | [
"@NotNull\n static MetaTreeImpl.Proto saveMetaTree(@NotNull final ITreeMutable metaTree,\n @NotNull final EnvironmentImpl env,\n @NotNull final ExpiredLoggableCollection expired) {\n final long newMetaTreeAddress = metaTre... |
Get the Query Paramaters to be used for search request.
@return this.QueryStringBuilder. | [
"public QueryStringBuilder getQueryParameters() {\n QueryStringBuilder builder = new QueryStringBuilder();\n\n if (this.isNullOrEmpty(this.query) && this.metadataFilter == null) {\n throw new BoxAPIException(\n \"BoxSearchParameters requires either a search query or Metadata ... | [
"public static int Mod(int x, int m) {\r\n if (m < 0) m = -m;\r\n int r = x % m;\r\n return r < 0 ? r + m : r;\r\n }",
"private String parseEnvelope() {\r\n List<String> response = new ArrayList<>();\r\n //1. Date ---------------\r\n response.add(LB + Q + sentDateEnvel... |
Try to reconnect to a started server. | [
"synchronized void reconnectServerProcess(final ManagedServerBootCmdFactory factory) {\n if(this.requiredState != InternalState.SERVER_STARTED) {\n this.bootConfiguration = factory;\n this.requiredState = InternalState.SERVER_STARTED;\n ROOT_LOGGER.reconnectingServer(serverNa... | [
"@Override\n protected void onLoad() {\n\tsuper.onLoad();\n\n\t// these styles need to be the same for the box and shadow so\n\t// that we can measure properly\n\tmatchStyles(\"display\");\n\tmatchStyles(\"fontSize\");\n\tmatchStyles(\"fontFamily\");\n\tmatchStyles(\"fontWeight\");\n\tmatchStyles(\"lineHeight\")... |
Use this API to fetch service_dospolicy_binding resources of given name . | [
"public static service_dospolicy_binding[] get(nitro_service service, String name) throws Exception{\n\t\tservice_dospolicy_binding obj = new service_dospolicy_binding();\n\t\tobj.set_name(name);\n\t\tservice_dospolicy_binding response[] = (service_dospolicy_binding[]) obj.get_resources(service);\n\t\treturn respon... | [
"public CollectionRequest<Project> findByWorkspace(String workspace) {\n \n String path = String.format(\"/workspaces/%s/projects\", workspace);\n return new CollectionRequest<Project>(this, Project.class, path, \"GET\");\n }",
"public Collection<DataSource> getDataSources(int groupno) {\n ... |
Adds BETWEEN criteria,
customer_id between 1 and 10
@param attribute The field name to be used
@param value1 The lower boundary
@param value2 The upper boundary | [
"public void addBetween(Object attribute, Object value1, Object value2)\r\n {\r\n\t\t// PAW\r\n\t\t// addSelectionCriteria(ValueCriteria.buildBeweenCriteria(attribute, value1, value2, getAlias()));\r\n\t\taddSelectionCriteria(ValueCriteria.buildBeweenCriteria(attribute, value1, value2, getUserAlias(attribute)));... | [
"protected void processCalendarData(ProjectCalendar calendar, Row row)\n {\n int dayIndex = row.getInt(\"CD_DAY_OR_EXCEPTION\");\n if (dayIndex == 0)\n {\n processCalendarException(calendar, row);\n }\n else\n {\n processCalendarHours(calendar, row, dayIndex);\n ... |
Configure the mapping between a database column and a field.
@param container column to field map
@param name column name
@param type field type | [
"private static void defineField(Map<String, FieldType> container, String name, FieldType type)\n {\n defineField(container, name, type, null);\n }"
] | [
"public Iterable<V> sorted(Iterator<V> input) {\n ExecutorService executor = new ThreadPoolExecutor(this.numThreads,\n this.numThreads,\n 1000L,\n ... |
Returns the HTTP status text for the HTTP or WebDav status code
specified by looking it up in the static mapping. This is a
static function.
@param nHttpStatusCode [IN] HTTP or WebDAV status code
@return A string with a short descriptive phrase for the
HTTP status code (e.g., "OK"). | [
"public static String getStatusText(int nHttpStatusCode) {\n\n Integer intKey = new Integer(nHttpStatusCode);\n\n if (!mapStatusCodes.containsKey(intKey)) {\n return \"\";\n } else {\n return mapStatusCodes.get(intKey);\n }\n }"
] | [
"protected static <R extends AddressSection, S extends AddressSegment> R fastIncrement(\n\t\t\tR section,\n\t\t\tlong increment,\n\t\t\tAddressCreator<?, R, ?, S> addrCreator, \n\t\t\tSupplier<R> lowerProducer,\n\t\t\tSupplier<R> upperProducer,\n\t\t\tInteger prefixLength) {\n\t\tif(increment >= 0) {\n\t\t\tBigInte... |
Retrieve a duration field.
@param type field type
@return Duration instance | [
"public Duration getDuration(FastTrackField type)\n {\n Double value = (Double) getObject(type);\n return value == null ? null : Duration.getInstance(value.doubleValue(), m_table.getDurationTimeUnit());\n }"
] | [
"private void initExceptionsPanel() {\n\n m_exceptionsPanel.setLegend(Messages.get().key(Messages.GUI_SERIALDATE_PANEL_EXCEPTIONS_0));\n m_exceptionsPanel.addCloseHandler(this);\n m_exceptionsPanel.setVisible(false);\n }",
"public static void serialize(final File folder, final String conte... |
Searches for descriptions of integer sequences and array ranges that have a colon character in them
Examples of integer sequences:
1:6
2:4:20
:
Examples of array range
2:
2:4: | [
"protected void parseSequencesWithColons(TokenList tokens , Sequence sequence ) {\n\n TokenList.Token t = tokens.getFirst();\n if( t == null )\n return;\n\n int state = 0;\n\n TokenList.Token start = null;\n TokenList.Token middle = null;\n TokenList.Token prev =... | [
"public static nsacl6_stats get(nitro_service service, String acl6name) throws Exception{\n\t\tnsacl6_stats obj = new nsacl6_stats();\n\t\tobj.set_acl6name(acl6name);\n\t\tnsacl6_stats response = (nsacl6_stats) obj.stat_resource(service);\n\t\treturn response;\n\t}",
"protected EObject forceCreateModelElementAndS... |
We have received an update that invalidates the waveform preview for a player, so clear it and alert
any listeners if this represents a change. This does not affect the hot cues; they will stick around until the
player loads a new track that overwrites one or more of them.
@param update the update which means we have ... | [
"private void clearDeckPreview(TrackMetadataUpdate update) {\n if (previewHotCache.remove(DeckReference.getDeckReference(update.player, 0)) != null) {\n deliverWaveformPreviewUpdate(update.player, null);\n }\n }"
] | [
"public static void unregisterContextualInstance(EjbDescriptor<?> descriptor) {\n Set<Class<?>> classes = CONTEXTUAL_SESSION_BEANS.get();\n classes.remove(descriptor.getBeanClass());\n if (classes.isEmpty()) {\n CONTEXTUAL_SESSION_BEANS.remove();\n }\n }",
"List<CmsFavori... |
Make an individual Datum out of the data list info, focused at position
loc.
@param info A List of WordInfo objects
@param loc The position in the info list to focus feature creation on
@param featureFactory The factory that constructs features out of the item
@return A Datum (BasicDatum) representing this data instan... | [
"public <T extends CoreLabel> Datum<String, String> makeDatum(List<IN> info, int loc, FeatureFactory featureFactory) {\r\n PaddedList<IN> pInfo = new PaddedList<IN>(info, pad);\r\n\r\n Collection<String> features = new ArrayList<String>();\r\n List<Clique> cliques = featureFactory.getCliques();\r\n for ... | [
"@Deprecated public Duration getDuration(Date startDate, Date endDate) throws MPXJException\n {\n return (getDuration(\"Standard\", startDate, endDate));\n }",
"public static policydataset[] get(nitro_service service) throws Exception{\n\t\tpolicydataset obj = new policydataset();\n\t\tpolicydataset[] re... |
Return the available format ids. | [
"public final Set<String> getOutputFormatsNames() {\n SortedSet<String> formats = new TreeSet<>();\n for (String formatBeanName: this.outputFormat.keySet()) {\n int endingIndex = formatBeanName.indexOf(MAP_OUTPUT_FORMAT_BEAN_NAME_ENDING);\n if (endingIndex < 0) {\n ... | [
"protected void progressInfoMessage(final String tag) {\n if(logger.isInfoEnabled()) {\n long totalTimeS = (System.currentTimeMillis() - startTimeMs) / Time.MS_PER_SECOND;\n\n logger.info(tag + \" : scanned \" + scanned + \" and fetched \" + fetched + \" for store '\"\n ... |
Creates a general purpose solver. Use this if you are not sure what you need.
@param numRows The number of rows that the decomposition is optimized for.
@param numCols The number of columns that the decomposition is optimized for. | [
"public static LinearSolverDense<DMatrixRMaj> general(int numRows , int numCols ) {\n if( numRows == numCols )\n return linear(numRows);\n else\n return leastSquares(numRows,numCols);\n }"
] | [
"private int bestSurroundingSet(int index, int length, int... valid) {\r\n int option1 = set[index - 1];\r\n if (index + 1 < length) {\r\n // we have two options to check\r\n int option2 = set[index + 1];\r\n if (contains(valid, option1) && contains(valid, option2)) {\... |
Use this API to delete dnssuffix of given name. | [
"public static base_response delete(nitro_service client, String Dnssuffix) throws Exception {\n\t\tdnssuffix deleteresource = new dnssuffix();\n\t\tdeleteresource.Dnssuffix = Dnssuffix;\n\t\treturn deleteresource.delete_resource(client);\n\t}"
] | [
"public static base_responses save(nitro_service client, cacheobject resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tcacheobject saveresources[] = new cacheobject[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\t... |
Create a request for elevations for samples along a path.
@param req
@param callback | [
"public void getElevationAlongPath(PathElevationRequest req, ElevationServiceCallback callback) {\n \n this.callback = callback;\n \n JSObject doc = (JSObject) getJSObject().eval(\"document\");\n doc.setMember(getVariableName(), this);\n \n StringBuilder r = new Stri... | [
"public void map(Story story, MetaFilter metaFilter) {\n if (metaFilter.allow(story.getMeta())) {\n boolean allowed = false;\n for (Scenario scenario : story.getScenarios()) {\n // scenario also inherits meta from story\n Meta inherited = scenario.getMeta()... |
Send message to all connections connected to the same URL of this context
@param message the message to be sent
@param excludeSelf whether the connection of this context should be sent to
@return this context | [
"public WebSocketContext sendToPeers(String message, boolean excludeSelf) {\n return sendToConnections(message, url, manager.urlRegistry(), excludeSelf);\n }"
] | [
"public List<WbSearchEntitiesResult> wbSearchEntities(String search, String language,\n Boolean strictLanguage, String type, Long limit, Long offset)\n throws MediaWikiApiErrorException {\n\n Map<String, String> parameters = new HashMap<Strin... |
Gen error response.
@param t
the t
@return the response on single request | [
"public ResponseOnSingeRequest genErrorResponse(Exception t) {\n ResponseOnSingeRequest sshResponse = new ResponseOnSingeRequest();\n String displayError = PcErrorMsgUtils.replaceErrorMsg(t.toString());\n\n sshResponse.setStackTrace(PcStringUtils.printStackTrace(t));\n sshResponse.setErr... | [
"public GroovyClassDoc[] innerClasses() {\n Collections.sort(nested);\n return nested.toArray(new GroovyClassDoc[nested.size()]);\n }",
"public boolean isValid() {\n\t\tif(addressProvider.isUninitialized()) {\n\t\t\ttry {\n\t\t\t\tvalidate();\n\t\t\t\treturn true;\n\t\t\t} catch(AddressStringExce... |
Converts a TimeUnit instance to an integer value suitable for
writing to an MPX file.
@param recurrence RecurringTask instance
@return integer value | [
"public static Integer getDurationUnits(RecurringTask recurrence)\n {\n Duration duration = recurrence.getDuration();\n Integer result = null;\n\n if (duration != null)\n {\n result = UNITS_MAP.get(duration.getUnits());\n }\n\n return (result);\n }"
] | [
"@SuppressWarnings(\"WeakerAccess\")\n public boolean isPlaying() {\n if (packetBytes.length >= 212) {\n return (packetBytes[STATUS_FLAGS] & PLAYING_FLAG) > 0;\n } else {\n final PlayState1 state = getPlayState1();\n return state == PlayState1.PLAYING || state == P... |
To store an object in a quick & dirty way. | [
"public static void writeObject(File file, Object object) throws IOException {\n FileOutputStream fileOut = new FileOutputStream(file);\n ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(fileOut));\n try {\n out.writeObject(object);\n out.flush();\n... | [
"private static TimeUnit getDurationUnits(Integer value)\n {\n TimeUnit result = null;\n\n if (value != null)\n {\n int index = value.intValue();\n if (index >= 0 && index < DURATION_UNITS.length)\n {\n result = DURATION_UNITS[index];\n }\n }\n\n ... |
Use this API to Force hafailover. | [
"public static base_response Force(nitro_service client, hafailover resource) throws Exception {\n\t\thafailover Forceresource = new hafailover();\n\t\tForceresource.force = resource.force;\n\t\treturn Forceresource.perform_operation(client,\"Force\");\n\t}"
] | [
"public String addPostRunDependent(FunctionalTaskItem dependent) {\n Objects.requireNonNull(dependent);\n return this.taskGroup().addPostRunDependent(dependent);\n }",
"public static base_response update(nitro_service client, csparameter resource) throws Exception {\n\t\tcsparameter updateresourc... |
Specify the Artifact for which the condition should search for.
@param artifact
@return | [
"public static Project dependsOnArtifact(Artifact artifact)\n {\n Project project = new Project();\n project.artifact = artifact;\n return project;\n }"
] | [
"public String getEditorParameter(CmsObject cms, String editor, String param) {\n\n String path = OpenCms.getSystemInfo().getConfigFilePath(cms, \"editors/\" + editor + \".properties\");\n CmsVfsMemoryObjectCache cache = CmsVfsMemoryObjectCache.getVfsMemoryObjectCache();\n CmsParameterConfigura... |
Dump timephased work for an assignment.
@param assignment resource assignment | [
"private static void listTimephasedWork(ResourceAssignment assignment)\n {\n Task task = assignment.getTask();\n int days = (int) ((task.getFinish().getTime() - task.getStart().getTime()) / (1000 * 60 * 60 * 24)) + 1;\n if (days > 1)\n {\n SimpleDateFormat df = new SimpleDateFormat(\"d... | [
"public void setOffset(float offset, final Axis axis) {\n if (!equal(mOffset.get(axis), offset)) {\n mOffset.set(offset, axis);\n if (mContainer != null) {\n mContainer.onLayoutChanged(this);\n }\n }\n }",
"public static Field getDeclaredFieldWithPa... |
Use this API to fetch all the callhome resources that are configured on netscaler. | [
"public static callhome get(nitro_service service) throws Exception{\n\t\tcallhome obj = new callhome();\n\t\tcallhome[] response = (callhome[])obj.get_resources(service);\n\t\treturn response[0];\n\t}"
] | [
"@SuppressWarnings(\"unchecked\")\n public <T> T getOptionValue(String name)\n {\n return (T) configurationOptions.get(name);\n }",
"@Override\n public final Boolean optBool(final String key, final Boolean defaultValue) {\n Boolean result = optBool(key);\n return result == null ? ... |
Return the regression basis functions.
@param exerciseDate The date w.r.t. which the basis functions should be measurable.
@param model The model.
@return Array of random variables.
@throws net.finmath.exception.CalculationException Thrown if the valuation fails, specific cause may be available via the <code>cause()</... | [
"public RandomVariableInterface[] getBasisFunctions(double exerciseDate, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {\n\n\t\tArrayList<RandomVariableInterface> basisFunctions = new ArrayList<RandomVariableInterface>();\n\n\t\tRandomVariableInterface basisFunction;\n\n\t\t// Constant\... | [
"synchronized void started() {\n try {\n if(isConnected()) {\n channelHandler.executeRequest(new ServerStartedRequest(), null).getResult().await();\n }\n } catch (Exception e) {\n ServerLogger.AS_ROOT_LOGGER.debugf(e, \"failed to send started notificatio... |
Creates a ProjectCalendar instance from the Asta data.
@param calendarRow basic calendar data
@param workPatternMap work pattern map
@param workPatternAssignmentMap work pattern assignment map
@param exceptionAssignmentMap exception assignment map
@param timeEntryMap time entry map
@param exceptionTypeMap exception ty... | [
"public void processCalendar(Row calendarRow, Map<Integer, Row> workPatternMap, Map<Integer, List<Row>> workPatternAssignmentMap, Map<Integer, List<Row>> exceptionAssignmentMap, Map<Integer, List<Row>> timeEntryMap, Map<Integer, DayType> exceptionTypeMap)\n {\n //\n // Create the calendar and add the de... | [
"public static void mark(DeploymentUnit unit) {\n unit = DeploymentUtils.getTopDeploymentUnit(unit);\n unit.putAttachment(MARKER, Boolean.TRUE);\n }",
"private boolean findAndSetManifestFromArtifactory(ArtifactoryServer server, ArtifactoryDependenciesClient dependenciesClient, TaskListener listen... |
Appends a line separator node that will only be effective if the current line contains non-whitespace text.
@return the given parent node | [
"public CompositeGeneratorNode appendNewLineIfNotEmpty(final CompositeGeneratorNode parent) {\n List<IGeneratorNode> _children = parent.getChildren();\n String _lineDelimiter = this.wsConfig.getLineDelimiter();\n NewLineNode _newLineNode = new NewLineNode(_lineDelimiter, true);\n _children.add(_newLineN... | [
"protected void appendFacetOption(StringBuffer query, final String name, final String value) {\n\n query.append(\" facet.\").append(name).append(\"=\").append(value);\n }",
"public Topic getTopicInfo(String topicId) throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String,... |
Add a property. | [
"public static Object setProperty( String key, String value ) {\n return prp.setProperty( key, value );\n }"
] | [
"public NodeT getNext() {\n String nextItemKey = queue.poll();\n if (nextItemKey == null) {\n return null;\n }\n return nodeTable.get(nextItemKey);\n }",
"private void readTaskBaselines(Project.Tasks.Task xmlTask, Task mpxjTask, TimeUnit durationFormat)\n {\n for (... |
Stops download dispatchers. | [
"private void stop() {\n\t\tfor (int i = 0; i < mDownloadDispatchers.length; i++) {\n\t\t\tif (mDownloadDispatchers[i] != null) {\n\t\t\t\tmDownloadDispatchers[i].quit();\n\t\t\t}\n\t\t}\n\t}"
] | [
"public static String getCorrelationId(Message message) {\n String correlationId = (String) message.get(CORRELATION_ID_KEY);\n if(null == correlationId) {\n correlationId = readCorrelationId(message);\n }\n if(null == correlationId) {\n correlationId = readCorrelati... |
Initialise an extension module's extensions in the extension registry
@param extensionRegistry the extension registry
@param module the name of the module containing the extensions
@param rootRegistration The parent registration of the extensions. For a server or domain.xml extension, this will be the root resource re... | [
"static void initializeExtension(ExtensionRegistry extensionRegistry, String module,\n ManagementResourceRegistration rootRegistration,\n ExtensionRegistryType extensionRegistryType) {\n try {\n boolean unknownModule = false;\n ... | [
"private <T> void requestAsync(ClientRequest<T> delegate,\n NonblockingStoreCallback callback,\n long timeoutMs,\n String operationName) {\n pool.submitAsync(this.destination, delegate, callback, timeoutMs, ope... |
Adds an item to the list box, specifying its direction and an initial
value for the item.
@param value the item's value, to be submitted if it is part of a
{@link FormPanel}; cannot be <code>null</code>
@param dir the item's direction
@param text the text of the item to be added | [
"public void addItem(T value, Direction dir, String text) {\n addItem(value, dir, text, true);\n }"
] | [
"private void cleanupLogs() throws IOException {\n logger.trace(\"Beginning log cleanup...\");\n int total = 0;\n Iterator<Log> iter = getLogIterator();\n long startMs = System.currentTimeMillis();\n while (iter.hasNext()) {\n Log log = iter.next();\n total +... |
as we know nothing has changed. | [
"private boolean somethingMayHaveChanged(PhaseInterceptorChain pic) {\n Iterator<Interceptor<? extends Message>> it = pic.iterator();\n Interceptor<? extends Message> last = null;\n while (it.hasNext()) {\n Interceptor<? extends Message> cur = it.next();\n if (cur == this)... | [
"protected boolean check(String id, List<String> includes) {\n\t\tif (null != includes) {\n\t\t\tfor (String check : includes) {\n\t\t\t\tif (check(id, check)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public void createTaskFieldMap(Props props)\n {\n byte[] fieldMapDa... |
Reads a row of a CSV file and populates the bean, using the supplied name mapping to map column values to the
appropriate fields. If processors are supplied then they are used, otherwise the raw String values will be used.
@param bean
the bean to populate
@param nameMapping
the name mapping array
@param processors
the... | [
"private <T> T readIntoBean(final T bean, final String[] nameMapping, final CellProcessor[] processors)\n\t\tthrows IOException {\n\t\t\n\t\tif( readRow() ) {\n\t\t\tif( nameMapping.length != length() ) {\n\t\t\t\tthrow new IllegalArgumentException(String.format(\n\t\t\t\t\t\"the nameMapping array and the number of... | [
"@NonNull\n @Override\n public File getParent(@NonNull final File from) {\n if (from.getPath().equals(getRoot().getPath())) {\n // Already at root, we can't go higher\n return from;\n } else if (from.getParentFile() != null) {\n return from.getParentFile();\n ... |
parse json text to specified class
@param jsonRtn
@param jsonRtnClazz
@return | [
"public static <T extends JsonRtn> T parseJsonRtn(String jsonRtn, Class<T> jsonRtnClazz) {\n T rtn = JSONObject.parseObject(jsonRtn, jsonRtnClazz);\n appendErrorHumanMsg(rtn);\n return rtn;\n }"
] | [
"public static List<Integer> getStolenPrimaryPartitions(final Cluster currentCluster,\n final Cluster finalCluster,\n final int stealNodeId) {\n List<Integer> finalList = new ArrayList<Integer>... |
Use this API to count nstrafficdomain_bridgegroup_binding resources configued on NetScaler. | [
"public static long count(nitro_service service, Long td) throws Exception{\n\t\tnstrafficdomain_bridgegroup_binding obj = new nstrafficdomain_bridgegroup_binding();\n\t\tobj.set_td(td);\n\t\toptions option = new options();\n\t\toption.set_count(true);\n\t\tnstrafficdomain_bridgegroup_binding response[] = (nstraffi... | [
"public static void numberToBytes(int number, byte[] buffer, int start, int length) {\n for (int index = start + length - 1; index >= start; index--) {\n buffer[index] = (byte)(number & 0xff);\n number = number >> 8;\n }\n }",
"@Override\n public HandlerRegistration addSe... |
Read an individual GanttProject resource assignment.
@param gpAllocation GanttProject resource assignment. | [
"private void readResourceAssignment(Allocation gpAllocation)\n {\n Integer taskID = Integer.valueOf(NumberHelper.getInt(gpAllocation.getTaskId()) + 1);\n Integer resourceID = Integer.valueOf(NumberHelper.getInt(gpAllocation.getResourceId()) + 1);\n Task task = m_projectFile.getTaskByUniqueID(taskI... | [
"private static void writeNumber(Class<?> numberClass, Number value, CharBuf buffer) {\n if (numberClass == Integer.class) {\n buffer.addInt((Integer) value);\n } else if (numberClass == Long.class) {\n buffer.addLong((Long) value);\n } else if (numberClass == BigInteger.c... |
Post a license to the server
@param license
@param user
@param password
@throws GrapesCommunicationException
@throws javax.naming.AuthenticationException | [
"public void postLicense(final License license, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {\n final Client client = getClient(user, password);\n final WebResource resource = client.resource(serverURL).path(RequestUtils.licenseResourcePath())... | [
"public static Collection<Info> getPendingCollaborations(BoxAPIConnection api) {\n URL url = PENDING_COLLABORATIONS_URL.build(api.getBaseURL());\n\n BoxAPIRequest request = new BoxAPIRequest(api, url, \"GET\");\n BoxJSONResponse response = (BoxJSONResponse) request.send();\n JsonObject r... |
Use this API to fetch csvserver_appflowpolicy_binding resources of given name . | [
"public static csvserver_appflowpolicy_binding[] get(nitro_service service, String name) throws Exception{\n\t\tcsvserver_appflowpolicy_binding obj = new csvserver_appflowpolicy_binding();\n\t\tobj.set_name(name);\n\t\tcsvserver_appflowpolicy_binding response[] = (csvserver_appflowpolicy_binding[]) obj.get_resource... | [
"public int execute(DatabaseConnection databaseConnection, T data, ID newId, ObjectCache objectCache)\n\t\t\tthrows SQLException {\n\t\ttry {\n\t\t\t// the arguments are the new-id and old-id\n\t\t\tObject[] args = new Object[] { convertIdToFieldObject(newId), extractIdToFieldObject(data) };\n\t\t\tint rowC = datab... |
The way calendars are stored in an MPP8 file means that there
can be forward references between the base calendar unique ID for a
derived calendar, and the base calendar itself. To get around this,
we initially populate the base calendar name attribute with the
base calendar unique ID, and now in this method we can con... | [
"private void updateBaseCalendarNames(List<Pair<ProjectCalendar, Integer>> baseCalendars)\n {\n for (Pair<ProjectCalendar, Integer> pair : baseCalendars)\n {\n ProjectCalendar cal = pair.getFirst();\n Integer baseCalendarID = pair.getSecond();\n ProjectCalendar baseCal = m_calend... | [
"public static <V> V doWorkInPoolNicely(final Pool<Jedis> pool, final PoolWork<Jedis, V> work) {\n final V result;\n try {\n result = doWorkInPool(pool, work);\n } catch (RuntimeException re) {\n throw re;\n } catch (Exception e) {\n throw new RuntimeExce... |
Returns the difference of sets s1 and s2. | [
"public static <E> Set<E> diff(Set<E> s1, Set<E> s2) {\r\n Set<E> s = new HashSet<E>();\r\n for (E o : s1) {\r\n if (!s2.contains(o)) {\r\n s.add(o);\r\n }\r\n }\r\n return s;\r\n }"
] | [
"public static Collection<Field> getAllAttributes(final Class<?> classToInspect) {\n Set<Field> allFields = new HashSet<>();\n getAllAttributes(classToInspect, allFields, Function.identity(), field -> true);\n return allFields;\n }",
"public static CurrencySymbolPosition getSymbolPosition(... |
Helper method to check if log4j is already configured | [
"private static synchronized boolean isLog4JConfigured()\r\n {\r\n if(!log4jConfigured)\r\n {\r\n Enumeration en = org.apache.log4j.Logger.getRootLogger().getAllAppenders();\r\n\r\n if (!(en instanceof org.apache.log4j.helpers.NullEnumeration))\r\n {\r\n ... | [
"public static java.sql.Time newTime() {\n return new java.sql.Time(System.currentTimeMillis() % DAY_MILLIS);\n }",
"public <Ex extends Throwable> Try<R,Ex> execute(T input,Class<Ex> classes){\n\t\t\n\t\treturn Try.withCatch( ()->transactionTemplate.execute(status-> transaction.apply(input)),classes);\n... |
gets the bytes, sharing the cached array and does not clone it | [
"protected byte[] getBytesInternal() {\n\t\tbyte cached[];\n\t\tif(hasNoValueCache() || (cached = valueCache.lowerBytes) == null) {\n\t\t\tvalueCache.lowerBytes = cached = getBytesImpl(true);\n\t\t}\n\t\treturn cached;\n\t}"
] | [
"protected void layoutGroupSubreports(DJGroup columnsGroup, JRDesignGroup jgroup) {\n\t\tlog.debug(\"Starting subreport layout...\");\n\t\tJRDesignBand footerBand = (JRDesignBand) ((JRDesignSection)jgroup.getGroupFooterSection()).getBandsList().get(0);\n\t\tJRDesignBand headerBand = (JRDesignBand) ((JRDesignSection... |
Returns first resolver that accepts the given resolverId.
In case none is found null is returned.
@param resolverId identifier of the resolver
@return found resolver or null otherwise | [
"public static ObjectModelResolver get(String resolverId) {\n List<ObjectModelResolver> resolvers = getResolvers();\n\n for (ObjectModelResolver resolver : resolvers) {\n if (resolver.accept(resolverId)) {\n return resolver;\n }\n }\n\n return null;\n... | [
"@Override\n public Future<GcsFileMetadata> readObjectAsync(final ByteBuffer dst, final GcsFilename filename,\n long startOffsetBytes, long timeoutMillis) {\n Preconditions.checkArgument(startOffsetBytes >= 0, \"%s: offset must be non-negative: %s\", this,\n startOffsetBytes);\n final int n = dst... |
Use this API to fetch nstrafficdomain_bridgegroup_binding resources of given name . | [
"public static nstrafficdomain_bridgegroup_binding[] get(nitro_service service, Long td) throws Exception{\n\t\tnstrafficdomain_bridgegroup_binding obj = new nstrafficdomain_bridgegroup_binding();\n\t\tobj.set_td(td);\n\t\tnstrafficdomain_bridgegroup_binding response[] = (nstrafficdomain_bridgegroup_binding[]) obj.... | [
"protected static void statistics(int from, int to) {\r\n\t// check that primes contain no accidental errors\r\n\tfor (int i=0; i<primeCapacities.length-1; i++) {\r\n\t\tif (primeCapacities[i] >= primeCapacities[i+1]) throw new RuntimeException(\"primes are unsorted or contain duplicates; detected at \"+i+\"@\"+pri... |
Adds each required substring, checking that it's not null.
@param requiredSubStrings
the required substrings
@throws NullPointerException
if a required substring is null | [
"private void checkAndAddRequiredSubStrings(final List<String> requiredSubStrings) {\n\t\tfor( String required : requiredSubStrings ) {\n\t\t\tif( required == null ) {\n\t\t\t\tthrow new NullPointerException(\"required substring should not be null\");\n\t\t\t}\n\t\t\tthis.requiredSubStrings.add(required);\n\t\t}\n\... | [
"public static authenticationvserver_binding get(nitro_service service, String name) throws Exception{\n\t\tauthenticationvserver_binding obj = new authenticationvserver_binding();\n\t\tobj.set_name(name);\n\t\tauthenticationvserver_binding response = (authenticationvserver_binding) obj.get_resource(service);\n\t\t... |
Delete a profile
@param model
@param id
@return
@throws Exception | [
"@RequestMapping(value = \"/api/profile\", method = RequestMethod.DELETE)\n public\n @ResponseBody\n HashMap<String, Object> deleteProfile(Model model, int id) throws Exception {\n profileService.remove(id);\n return Utils.getJQGridJSON(profileService.findAllProfiles(), \"profiles\");\n }"... | [
"public int count(String key) {\n ConcurrentMap<WebSocketConnection, WebSocketConnection> bag = registry.get(key);\n return null == bag ? 0 : bag.size();\n }",
"public ProjectCalendar getDefaultCalendar()\n {\n String calendarName = m_properties.getDefaultCalendarName();\n ProjectCale... |
Gets the thread dump.
@return the thread dump | [
"public ThreadInfo[] getThreadDump() {\n ThreadMXBean threadMxBean = ManagementFactory.getThreadMXBean();\n return threadMxBean.dumpAllThreads(true, true);\n }"
] | [
"public static boolean isClassClassNodeWrappingConcreteType(ClassNode classNode) {\n GenericsType[] genericsTypes = classNode.getGenericsTypes();\n return ClassHelper.CLASS_Type.equals(classNode)\n && classNode.isUsingGenerics()\n && genericsTypes!=null\n &... |
Write notes.
@param recordNumber record number
@param text note text
@throws IOException | [
"private void writeNotes(int recordNumber, String text) throws IOException\n {\n m_buffer.setLength(0);\n\n m_buffer.append(recordNumber);\n m_buffer.append(m_delimiter);\n\n if (text != null)\n {\n String note = stripLineBreaks(text, MPXConstants.EOL_PLACEHOLDER_STRING);\n ... | [
"public void linkMtoN(Object obj, CollectionDescriptor cod, boolean insert)\n {\n Object referencedObjects = cod.getPersistentField().get(obj);\n storeAndLinkMtoN(true, obj, cod, referencedObjects, insert);\n }",
"public static void endRequest() {\n final List<RequestScopedItem> result ... |
This method is called to alert project listeners to the fact that
a calendar has been written to a project file.
@param calendar calendar instance | [
"public void fireCalendarWrittenEvent(ProjectCalendar calendar)\n {\n if (m_projectListeners != null)\n {\n for (ProjectListener listener : m_projectListeners)\n {\n listener.calendarWritten(calendar);\n }\n }\n }"
] | [
"public void addSubmodule(final Module submodule) {\n if (!submodules.contains(submodule)) {\n submodule.setSubmodule(true);\n\n if (promoted) {\n submodule.setPromoted(promoted);\n }\n\n submodules.add(submodule);\n }\n }",
"private int ... |
Retrieves the overallocated flag.
@return overallocated flag | [
"public boolean getOverAllocated()\n {\n Boolean overallocated = (Boolean) getCachedValue(ResourceField.OVERALLOCATED);\n if (overallocated == null)\n {\n Number peakUnits = getPeakUnits();\n Number maxUnits = getMaxUnits();\n overallocated = Boolean.valueOf(NumberHelper.get... | [
"private void updatePreview(TrackMetadataUpdate update, WaveformPreview preview) {\n previewHotCache.put(DeckReference.getDeckReference(update.player, 0), preview); // Main deck\n if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well\n for... |
Get an integer property override value.
@param name the {@link CircuitBreaker} name.
@param key the property override key.
@return the property override value, or null if it is not found. | [
"private Integer getIntegerPropertyOverrideValue(String name, String key) {\n if (properties != null) {\n String propertyName = getPropertyName(name, key);\n\n String propertyOverrideValue = properties.getProperty(propertyName);\n\n if (propertyOverrideValue != null) {\n ... | [
"public String processIndexDescriptor(Properties attributes) throws XDocletException\r\n {\r\n String name = attributes.getProperty(ATTRIBUTE_NAME);\r\n IndexDescriptorDef indexDef = _curClassDef.getIndexDescriptor(name);\r\n String attrName;\r\n \r\n ... |
Given a binary expression corresponding to an assignment, will check that the type of the RHS matches one
of the possible setters and if not, throw a type checking error.
@param expression the assignment expression
@param leftExpression left expression of the assignment
@param rightExpression right expression of the as... | [
"private boolean ensureValidSetter(final Expression expression, final Expression leftExpression, final Expression rightExpression, final SetterInfo setterInfo) {\n // for expressions like foo = { ... }\n // we know that the RHS type is a closure\n // but we must check if the binary expression i... | [
"public Set<Class<?>> getPrevented() {\n if (this.prevent == null) {\n return Collections.emptySet();\n }\n return Collections.unmodifiableSet(this.prevent);\n }",
"private static String getPath(Service service, Annotation... qualifiers) {\n for (Annotation q : qualifiers... |
Samples with replacement from a collection
@param c
The collection to be sampled from
@param n
The number of samples to take
@return a new collection with the sample | [
"public static <E> Collection<E> sampleWithReplacement(Collection<E> c, int n) {\r\n return sampleWithReplacement(c, n, new Random());\r\n }"
] | [
"private String getPropertyLabel(PropertyIdValue propertyIdValue) {\n\t\tPropertyRecord propertyRecord = this.propertyRecords\n\t\t\t\t.get(propertyIdValue);\n\t\tif (propertyRecord == null || propertyRecord.propertyDocument == null) {\n\t\t\treturn propertyIdValue.getId();\n\t\t} else {\n\t\t\treturn getLabel(prop... |
Creates an SslHandler
@param bufferAllocator the buffer allocator
@return instance of {@code SslHandler} | [
"public SslHandler create(ByteBufAllocator bufferAllocator) {\n SSLEngine engine = sslContext.newEngine(bufferAllocator);\n engine.setNeedClientAuth(needClientAuth);\n engine.setUseClientMode(false);\n return new SslHandler(engine);\n }"
] | [
"public void generateMapFile(File jarFile, String mapFileName, boolean mapClassMethods) throws XMLStreamException, IOException, ClassNotFoundException, IntrospectionException\n {\n m_responseList = new LinkedList<String>();\n writeMapFile(mapFileName, jarFile, mapClassMethods);\n }",
"public static ... |
Configs created by this ConfigBuilder will use the given Redis master name.
@param masterName the Redis set of sentinels
@return this ConfigBuilder | [
"public ConfigBuilder withMasterName(final String masterName) {\n if (masterName == null || \"\".equals(masterName)) {\n throw new IllegalArgumentException(\"masterName is null or empty: \" + masterName);\n }\n this.masterName = masterName;\n return this;\n }"
] | [
"public boolean isDeleted(Identity id)\r\n {\r\n ObjectEnvelope envelope = buffer.getByIdentity(id);\r\n\r\n return (envelope != null && envelope.needsDelete());\r\n }",
"private Integer getNextOrdinalForMethodId(int methodId, String pathName) throws Exception {\n String pathInfo = doGe... |
Encodes the given URI authority with the given encoding.
@param authority the authority to be encoded
@param encoding the character encoding to encode to
@return the encoded authority
@throws UnsupportedEncodingException when the given encoding parameter is not supported | [
"public static String encodeAuthority(String authority, String encoding) throws UnsupportedEncodingException {\n\t\treturn HierarchicalUriComponents.encodeUriComponent(authority, encoding, HierarchicalUriComponents.Type.AUTHORITY);\n\t}"
] | [
"public Collection<Contact> getListRecentlyUploaded(Date lastUpload, String filter) throws FlickrException {\r\n List<Contact> contacts = new ArrayList<Contact>();\r\n\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_GET_LIST_RECENTLY_UPL... |
Initialize the connection with the specified properties in OJB
configuration files and platform depended properties.
Invoke this method after a NEW connection is created, not if re-using from pool.
@see org.apache.ojb.broker.platforms.PlatformFactory
@see org.apache.ojb.broker.platforms.Platform | [
"protected void initializeJdbcConnection(Connection con, JdbcConnectionDescriptor jcd)\r\n throws LookupException\r\n {\r\n try\r\n {\r\n PlatformFactory.getPlatformFor(jcd).initializeJdbcConnection(jcd, con);\r\n }\r\n catch (PlatformException e)\r\n {\r\... | [
"public static dnsview[] get(nitro_service service, String viewname[]) throws Exception{\n\t\tif (viewname !=null && viewname.length>0) {\n\t\t\tdnsview response[] = new dnsview[viewname.length];\n\t\t\tdnsview obj[] = new dnsview[viewname.length];\n\t\t\tfor (int i=0;i<viewname.length;i++) {\n\t\t\t\tobj[i] = new ... |
Sets an attribute in the main section of the manifest to a list.
The list elements will be joined with a single whitespace character.
@param name the attribute's name
@param values the attribute's value
@return {@code this}
@throws IllegalStateException if entries have been added or the JAR has been written prior to... | [
"public Jar setListAttribute(String name, Collection<?> values) {\n return setAttribute(name, join(values));\n }"
] | [
"ArgumentsBuilder param(String param, String value) {\n if (value != null) {\n args.add(param);\n args.add(value);\n }\n return this;\n }",
"public static NodeList evaluateXpathExpression(String domStr, String xpathExpr)\n\t\t\tthrows XPathExpressionException, IOExcep... |
Returns the x-coordinate of a vertex normal.
@param vertex the vertex index
@return the x coordinate | [
"public float getNormalX(int vertex) {\n if (!hasNormals()) {\n throw new IllegalStateException(\"mesh has no normals\");\n }\n \n checkVertexIndexBounds(vertex);\n \n return m_normals.getFloat(vertex * 3 * SIZEOF_FLOAT);\n }"
] | [
"protected static String jacksonObjectToString(Object object) {\n\t\ttry {\n\t\t\treturn mapper.writeValueAsString(object);\n\t\t} catch (JsonProcessingException e) {\n\t\t\tlogger.error(\"Failed to serialize JSON data: \" + e.toString());\n\t\t\treturn null;\n\t\t}\n\t}",
"@Override\n public void invert( ZMat... |
Helper to read an optional Boolean value.
@param path The XML path of the element to read.
@return The Boolean value stored in the XML, or <code>null</code> if the value could not be read. | [
"protected Boolean parseOptionalBooleanValue(final String path) {\n\n final I_CmsXmlContentValue value = m_xml.getValue(path, m_locale);\n if (value == null) {\n return null;\n } else {\n final String stringValue = value.getStringValue(null);\n try {\n ... | [
"@SuppressWarnings(\"unchecked\")\n\t/* @Nullable */\n\tpublic <T> T get(Object receiver, String fieldName) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {\n\t\tPreconditions.checkNotNull(receiver,\"receiver\");\n\t\tPreconditions.checkNotNull(fieldName,\"fieldName... |
This will blur the view behind it and set it in
a imageview over the content with a alpha value
that corresponds to slideOffset. | [
"private void renderBlurLayer(float slideOffset) {\n if (enableBlur) {\n if (slideOffset == 0 || forceRedraw) {\n clearBlurView();\n }\n\n if (slideOffset > 0f && blurView == null) {\n if (drawerLayout.getChildCount() == 2) {\n ... | [
"public static int cudnnActivationBackward(\n cudnnHandle handle, \n cudnnActivationDescriptor activationDesc, \n Pointer alpha, \n cudnnTensorDescriptor yDesc, \n Pointer y, \n cudnnTensorDescriptor dyDesc, \n Pointer dy, \n cudnnTensorDescriptor xDesc, \n ... |
Print the parameters of the parameterized type t | [
"private String typeParameters(Options opt, ParameterizedType t) {\n\tif (t == null)\n\t return \"\";\n\tStringBuffer tp = new StringBuffer(1000).append(\"<\");\n\tType args[] = t.typeArguments();\n\tfor (int i = 0; i < args.length; i++) {\n\t tp.append(type(opt, args[i], true));\n\t if (i != args.lengt... | [
"private List<Row> getRows(String tableName, String columnName, Integer id)\n {\n List<Row> result;\n List<Row> table = m_tables.get(tableName);\n if (table == null)\n {\n result = Collections.<Row> emptyList();\n }\n else\n {\n if (columnName == null)\n ... |
Deploys application reading resources from specified InputStream
@param inputStream where resources are read
@throws IOException | [
"public void deploy(InputStream inputStream) throws IOException {\n final List<? extends HasMetadata> entities = deploy(\"application\", inputStream);\n\n if (this.applicationName == null) {\n\n Optional<String> deployment = entities.stream()\n .filter(hm -> hm instanceof Dep... | [
"void stop() {\n try {\n dm.stop(getBundleContext());\n } catch (DirectoryMonitoringException e) {\n LOG.error(\"Failed to stop \" + DirectoryMonitor.class.getName() + \" for the directory \" + monitoredDirectory, e);\n }\n declarationsFiles.clear();\n declar... |
Send a beat grid update announcement to all registered listeners.
@param player the player whose beat grid information has changed
@param beatGrid the new beat grid associated with that player, if any | [
"private void deliverBeatGridUpdate(int player, BeatGrid beatGrid) {\n if (!getBeatGridListeners().isEmpty()) {\n final BeatGridUpdate update = new BeatGridUpdate(player, beatGrid);\n for (final BeatGridListener listener : getBeatGridListeners()) {\n try {\n ... | [
"private static <T> void writeConfig(BufferedWriter writer, DatabaseTableConfig<T> config) throws IOException,\n\t\t\tSQLException {\n\t\twriter.append(CONFIG_FILE_START_MARKER);\n\t\twriter.newLine();\n\t\tif (config.getDataClass() != null) {\n\t\t\twriter.append(FIELD_NAME_DATA_CLASS).append('=').append(config.ge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.