query stringlengths 7 3.3k | positive listlengths 1 1 | negative listlengths 9 9 |
|---|---|---|
Set the DPI value for GeoServer if there are already FORMAT_OPTIONS. | [
"private static void setDpiValue(final Multimap<String, String> extraParams, final int dpi) {\n String searchKey = \"FORMAT_OPTIONS\";\n for (String key: extraParams.keys()) {\n if (key.equalsIgnoreCase(searchKey)) {\n Collection<String> values = extraParams.removeAll(key);\n... | [
"public void setDividerPadding(float padding, final Axis axis) {\n if (axis == getOrientationAxis()) {\n super.setDividerPadding(padding, axis);\n } else {\n Log.w(TAG, \"Cannot apply divider padding for wrong axis [%s], orientation = %s\",\n axis, getOrientation... |
Record operation for async ops time
@param dest Destination of the socket to connect to. Will actually record
if null. Otherwise will call this on self and corresponding child
with this param null.
@param opTimeUs The number of us for the op to finish | [
"public void recordAsyncOpTimeNs(SocketDestination dest, long opTimeNs) {\n if(dest != null) {\n getOrCreateNodeStats(dest).recordAsyncOpTimeNs(null, opTimeNs);\n recordAsyncOpTimeNs(null, opTimeNs);\n } else {\n this.asynOpTimeRequestCounter.addRequest(opTimeNs);\n ... | [
"@JsonProperty\n public String timestamp() {\n if (timestampAsText == null) {\n timestampAsText = DateTimeFormatter.ISO_INSTANT.format(timestamp);\n }\n return timestampAsText;\n }",
"public void add(String photoId, String userId, Rectangle bounds) throws FlickrException {\r\... |
Convert a floating point date to a LocalDateTime.
Note: This method currently performs a rounding to the next second.
If referenceDate is null, the method returns null.
@param referenceDate The reference date associated with \( t=0 \).
@param floatingPointDate The value to the time offset \( t \).
@return The date r... | [
"public static LocalDateTime getDateFromFloatingPointDate(LocalDateTime referenceDate, double floatingPointDate) {\n\t\tif(referenceDate == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tDuration duration = Duration.ofSeconds(Math.round(floatingPointDate * SECONDS_PER_DAY));\n\t\treturn referenceDate.plus(duration);\n\t... | [
"public static Iterable<BoxRetentionPolicy.Info> getAll(final BoxAPIConnection api, String ... fields) {\r\n return getAll(null, null, null, DEFAULT_LIMIT, api, fields);\r\n }",
"public void setPickingEnabled(boolean enabled) {\n if (enabled != getPickingEnabled()) {\n if (enabled) {\n... |
Creates the automata.
@param prefix the prefix
@param regexp the regexp
@param automatonMap the automaton map
@return the list
@throws IOException Signals that an I/O exception has occurred. | [
"public static List<CompiledAutomaton> createAutomata(String prefix,\n String regexp, Map<String, Automaton> automatonMap) throws IOException {\n List<CompiledAutomaton> list = new ArrayList<>();\n Automaton automatonRegexp = null;\n if (regexp != null) {\n RegExp re = new RegExp(prefix + MtasTok... | [
"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 void reset() {\n\t\tCrawlSession session = conte... |
Get a timer of the given string name and todos for the current thread. If
no such timer exists yet, then it will be newly created.
@param timerName
the name of the timer
@param todoFlags
@return timer | [
"public static Timer getNamedTimer(String timerName, int todoFlags) {\n\t\treturn getNamedTimer(timerName, todoFlags, Thread.currentThread()\n\t\t\t\t.getId());\n\t}"
] | [
"public Weld addExtension(Extension extension) {\n extensions.add(new MetadataImpl<Extension>(extension, SYNTHETIC_LOCATION_PREFIX + extension.getClass().getName()));\n return this;\n }",
"private void addResources(MpxjTreeNode parentNode, ProjectFile file)\n {\n for (Resource resource : f... |
Attachments are only structurally different if one step has an inline attachment
and the other step either has no inline attachment or the inline attachment is
different. | [
"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... | [
"private boolean checkConfig(BundleContext context) throws Exception {\n ServiceReference serviceRef = context.getServiceReference(ConfigurationAdmin.class.getName());\n ConfigurationAdmin cfgAdmin = (ConfigurationAdmin)context.getService(serviceRef); \n Configuration config = cfgAdmin.getConfi... |
Propagate onNoPick events to listeners
@param picker GVRPicker which generated the event | [
"protected void propagateOnNoPick(GVRPicker picker)\n {\n if (mEventOptions.contains(EventOptions.SEND_PICK_EVENTS))\n {\n if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS))\n {\n getGVRContext().getEventManager().sendEvent(this, IPickEvents.class, \"on... | [
"public void setDividerPadding(float padding, final Axis axis) {\n if (axis == getOrientationAxis()) {\n super.setDividerPadding(padding, axis);\n } else {\n Log.w(TAG, \"Cannot apply divider padding for wrong axis [%s], orientation = %s\",\n axis, getOrientation... |
Retrieves the column title for the given locale.
@param locale required locale for the default column title
@return column title | [
"public String getTitle(Locale locale)\n {\n String result = null;\n\n if (m_title != null)\n {\n result = m_title;\n }\n else\n {\n if (m_fieldType != null)\n {\n result = m_project.getCustomFields().getCustomField(m_fieldType).getAlias();\n ... | [
"public static double volatilityConversionLognormalATMtoNormalATM(double forward, double displacement, double maturity, double lognormalVolatiltiy) {\n\t\tdouble x = lognormalVolatiltiy * Math.sqrt(maturity / 8);\n\t\tdouble y = org.apache.commons.math3.special.Erf.erf(x);\n\t\tdouble normalVol = Math.sqrt(2*Math.P... |
Shows the Loader component | [
"public void show() {\n if (!(container instanceof RootPanel)) {\n if (!(container instanceof MaterialDialog)) {\n container.getElement().getStyle().setPosition(Style.Position.RELATIVE);\n }\n div.getElement().getStyle().setPosition(Style.Position.ABSOLUTE);\n ... | [
"public static int cudnnBatchNormalizationBackward(\n cudnnHandle handle, \n int mode, \n Pointer alphaDataDiff, \n Pointer betaDataDiff, \n Pointer alphaParamDiff, \n Pointer betaParamDiff, \n cudnnTensorDescriptor xDesc, /** same desc for x, dx, dy */\n Poin... |
Swaps two specified partitions.
Pair-wase partition swapping may be more prone to local minima than
larger perturbations. Could consider "swapping" a list of
<nodeId/partitionId>. This would allow a few nodes to be identified
(random # btw 2-5?) and then "swapped" (shuffled? rotated?).
@return modified cluster metada... | [
"public static Cluster swapPartitions(final Cluster nextCandidateCluster,\n final int nodeIdA,\n final int partitionIdA,\n final int nodeIdB,\n final int pa... | [
"@RequestMapping(value = \"/api/profile/{profileIdentifier}/clients/{clientUUID}\", method = RequestMethod.DELETE)\n public\n @ResponseBody\n HashMap<String, Object> deleteClient(Model model,\n @PathVariable(\"profileIdentifier\") String profileIdentifier,\n ... |
Append the WHERE part of the statement to the StringBuilder. | [
"protected boolean appendWhereStatement(StringBuilder sb, List<ArgumentHolder> argList, WhereOperation operation)\n\t\t\tthrows SQLException {\n\t\tif (where == null) {\n\t\t\treturn operation == WhereOperation.FIRST;\n\t\t}\n\t\toperation.appendBefore(sb);\n\t\twhere.appendSql((addTableName ? getTableName() : null... | [
"public void delete(Object element, boolean testForEquality) {\r\n\tint index = indexOfFromTo(element, 0, size-1, testForEquality);\r\n\tif (index>=0) removeFromTo(index,index);\r\n}",
"private long getEndTime(ISuite suite, IInvokedMethod method)\n {\n // Find the latest end time for all tests in the su... |
Two stage promotion, dry run and actual promotion to verify correctness.
@param promotion
@param client
@param listener
@param buildName
@param buildNumber
@throws IOException | [
"public static boolean promoteAndCheckResponse(Promotion promotion, ArtifactoryBuildInfoClient client, TaskListener listener,\n String buildName, String buildNumber) throws IOException {\n // If failFast is true, perform dry run first\n if (promotion.is... | [
"private static BindingType map2BindingType(String bindingId) {\n BindingType type;\n if (SOAP11_BINDING_ID.equals(bindingId)) {\n type = BindingType.SOAP11;\n } else if (SOAP12_BINDING_ID.equals(bindingId)) {\n type = BindingType.SOAP12;\n } else if (JAXRS_BINDING_... |
Function to go through all the store definitions contained in the STORES
directory and
1. Update metadata cache.
2. Update STORES_KEY by stitching together all these keys.
3. Update 'storeNames' list.
This method is not thread safe. It is expected that the caller of this
method will correctly handle concurrency iss... | [
"private void initStoreDefinitions(Version storesXmlVersion) {\n if(this.storeDefinitionsStorageEngine == null) {\n throw new VoldemortException(\"The store definitions directory is empty\");\n }\n\n String allStoreDefinitions = \"<stores>\";\n Version finalStoresXmlVersion = ... | [
"protected static PreparedStatement memorize(final PreparedStatement target, final ConnectionHandle connectionHandle) {\n\t\treturn (PreparedStatement) Proxy.newProxyInstance(\n\t\t\t\tPreparedStatementProxy.class.getClassLoader(),\n\t\t\t\tnew Class[] {PreparedStatementProxy.class},\n\t\t\t\tnew MemorizeTransactio... |
Return all levels of moneyness for which data exists.
Moneyness is returned as actual difference strike - par swap rate.
@return The levels of moneyness as difference of strike to par swap rate. | [
"public double[] getMoneynessAsOffsets() {\r\n\t\tDoubleStream moneyness = getGridNodesPerMoneyness().keySet().stream().mapToDouble(Integer::doubleValue);\r\n\t\tif(quotingConvention == QuotingConvention.PAYERVOLATILITYLOGNORMAL) {\r\n\t\t\tmoneyness = moneyness.map(new DoubleUnaryOperator() {\r\n\t\t\t\t@Override\... | [
"private boolean addonDependsOnReporting(Addon addon)\n {\n for (AddonDependency dep : addon.getDependencies())\n {\n if (dep.getDependency().equals(this.addon))\n {\n return true;\n }\n boolean subDep = addonDependsOnReporting(dep.getDepen... |
Commit all written data to the physical disk
@throws IOException any io exception | [
"public void flush() throws IOException {\n checkMutable();\n long startTime = System.currentTimeMillis();\n channel.force(true);\n long elapsedTime = System.currentTimeMillis() - startTime;\n LogFlushStats.recordFlushRequest(elapsedTime);\n logger.debug(\"flush time \" + e... | [
"private static void writeUtf16Bom(OutputStream stream, boolean bigEndian) throws IOException {\n if (bigEndian) {\n stream.write(-2);\n stream.write(-1);\n } else {\n stream.write(-1);\n stream.write(-2);\n }\n }",
"private DBHandling createDBHa... |
Record the details of the media being cached, to make it easier to recognize, now that we have access to that
information.
@param slot the slot from which a metadata cache is being created
@param zos the stream to which the ZipFile is being written
@param channel the low-level channel to which the cache is being writt... | [
"private static void addCacheDetailsEntry(SlotReference slot, ZipOutputStream zos, WritableByteChannel channel) throws IOException {\n // Record the details of the media being cached, to make it easier to recognize now that we can.\n MediaDetails details = MetadataFinder.getInstance().getMediaDetailsF... | [
"private Double zeroIsNull(Double value)\n {\n if (value != null && value.doubleValue() == 0)\n {\n value = null;\n }\n return value;\n }",
"public void process(CustomFieldContainer indicators, ProjectProperties properties, Props props)\n {\n m_container = indicators;\n ... |
Print a task UID.
@param value task UID
@return task UID string | [
"public static final String printTaskUID(Integer value)\n {\n ProjectFile file = PARENT_FILE.get();\n if (file != null)\n {\n file.getEventManager().fireTaskWrittenEvent(file.getTaskByUniqueID(value));\n }\n return (value.toString());\n }"
] | [
"public void updateExceptions(SortedSet<Date> exceptions) {\r\n\r\n SortedSet<Date> e = null == exceptions ? new TreeSet<Date>() : exceptions;\r\n if (!m_model.getExceptions().equals(e)) {\r\n m_model.setExceptions(e);\r\n m_view.updateExceptions();\r\n valueChanged();... |
Utility function to set the current value in a ListBox.
@return returns true if the option corresponding to the value
was successfully selected in the ListBox | [
"public static final boolean setSelectedValue(ListBox list, String value, boolean addMissingValues) {\n\tif (value == null) {\n\t list.setSelectedIndex(0);\n\t return false;\n\t}\n\telse {\n\t int index = findValueInListBox(list, value);\n\t if (index >= 0) {\n\t\tlist.setSelectedIndex(index);\n\t\tretu... | [
"public void detect(final String... packageNames) throws IOException {\n final String[] pkgNameFilter = new String[packageNames.length];\n for (int i = 0; i < pkgNameFilter.length; ++i) {\n pkgNameFilter[i] = packageNames[i].replace('.', '/');\n if (!pkgNameFilter[i].endsWith(\"/... |
Permanently deletes a trashed file.
@param fileID the ID of the trashed folder to permanently delete. | [
"public void deleteFile(String fileID) {\n URL url = FILE_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), fileID);\n BoxAPIRequest request = new BoxAPIRequest(this.api, url, \"DELETE\");\n BoxAPIResponse response = request.send();\n response.disconnect();\n }"
] | [
"@Override\n public AuthInterface getAuthInterface() {\n if (authInterface == null) {\n authInterface = new AuthInterface(apiKey, sharedSecret, transport);\n }\n return authInterface;\n }",
"private String toSQLPattern(String attribute) {\n String pattern = attribute.r... |
Takes a String and converts it to a Date
@param dateString the date
@return Date denoted by dateString | [
"public Date toDate(String dateString) {\n Date date = null;\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n try {\n date = df.parse(dateString);\n } catch (ParseException ex) {\n System.out.println(ex.fillInStackTrace());\n }\n return date;\... | [
"public static sslcipher_individualcipher_binding[] get(nitro_service service, String ciphergroupname) throws Exception{\n\t\tsslcipher_individualcipher_binding obj = new sslcipher_individualcipher_binding();\n\t\tobj.set_ciphergroupname(ciphergroupname);\n\t\tsslcipher_individualcipher_binding response[] = (sslcip... |
Create the Grid Point style. | [
"static Style get(final GridParam params) {\n final StyleBuilder builder = new StyleBuilder();\n\n final Symbolizer pointSymbolizer = crossSymbolizer(\"shape://plus\", builder, CROSS_SIZE,\n params.gridColor);\n final Style style = build... | [
"private static String getColumnTitle(final PropertyDescriptor _property) {\n final StringBuilder buffer = new StringBuilder();\n final String name = _property.getName();\n buffer.append(Character.toUpperCase(name.charAt(0)));\n for (int i = 1; i < name.length(); i++) {\n fina... |
Use this API to unset the properties of inatparam resource.
Properties that need to be unset are specified in args array. | [
"public static base_response unset(nitro_service client, inatparam resource, String[] args) throws Exception{\n\t\tinatparam unsetresource = new inatparam();\n\t\treturn unsetresource.unset_resource(client,args);\n\t}"
] | [
"public static base_response unset(nitro_service client, responderpolicy resource, String[] args) throws Exception{\n\t\tresponderpolicy unsetresource = new responderpolicy();\n\t\tunsetresource.name = resource.name;\n\t\treturn unsetresource.unset_resource(client,args);\n\t}",
"public ProductFactoryCascade<T> ad... |
Extent aware Delete by Query
@param query
@param cld
@throws PersistenceBrokerException | [
"private void deleteByQuery(Query query, ClassDescriptor cld) throws PersistenceBrokerException\n {\n if (logger.isDebugEnabled())\n {\n logger.debug(\"deleteByQuery \" + cld.getClassNameOfObject() + \", \" + query);\n }\n\n if (query instanceof QueryBySQL)\n {\n ... | [
"public int[] getDefalutValuesArray() {\n int[] defaultValues = new int[5];\n\n defaultValues[0] = GLES20.GL_LINEAR_MIPMAP_NEAREST; // MIN FILTER\n defaultValues[1] = GLES20.GL_LINEAR; // MAG FILTER\n defaultValues[2] = 1; // ANISO FILTER\n defaultValues[3] = GLES20.GL_CLAMP_TO_ED... |
Convert to IPv6 EUI-64 section
http://standards.ieee.org/develop/regauth/tut/eui64.pdf
@param asMAC if true, this address is considered MAC and the EUI-64 is extended using ff-ff, otherwise this address is considered EUI-48 and extended using ff-fe
Note that IPv6 treats MAC as EUI-48 and extends MAC to IPv6 addresses... | [
"public MACAddress toEUI64(boolean asMAC) {\r\n\t\tif(!isExtended()) {//getSegmentCount() == EXTENDED_UNIQUE_IDENTIFIER_48_SEGMENT_COUNT\r\n\t\t\tMACAddressCreator creator = getAddressCreator();\r\n\t\t\tMACAddressSegment segs[] = creator.createSegmentArray(EXTENDED_UNIQUE_IDENTIFIER_64_SEGMENT_COUNT);\r\n\t\t\tMAC... | [
"private static void addTimePerComponent(HashMap<String, Long> mapComponentTimes,\tComponent component) {\n Long currentTimeOfComponent = 0L;\n String key = component.getComponentType();\n if (mapComponentTimes.containsKey(key)) {\n currentTimeOfComponent = mapComponentTimes.get(key);\n }\n //wh... |
This method is called when the locale of the parent file is updated.
It resets the locale specific currency attributes to the default values
for the new locale.
@param properties project properties
@param locale new locale | [
"public static void setLocale(ProjectProperties properties, Locale locale)\n {\n properties.setMpxDelimiter(LocaleData.getChar(locale, LocaleData.FILE_DELIMITER));\n properties.setMpxProgramName(LocaleData.getString(locale, LocaleData.PROGRAM_NAME));\n properties.setMpxCodePage((CodePage) LocaleDat... | [
"private String escapeQuotes(String value)\n {\n StringBuilder sb = new StringBuilder();\n int length = value.length();\n char c;\n\n sb.append('\"');\n for (int index = 0; index < length; index++)\n {\n c = value.charAt(index);\n sb.append(c);\n\n if (c == '\... |
Performs a variety of tests to see if the provided matrix is a valid
covariance matrix.
@return 0 = is valid 1 = failed positive diagonal, 2 = failed on symmetry, 2 = failed on positive definite | [
"public static int isValid( DMatrixRMaj cov ) {\n if( !MatrixFeatures_DDRM.isDiagonalPositive(cov) )\n return 1;\n\n if( !MatrixFeatures_DDRM.isSymmetric(cov,TOL) )\n return 2;\n\n if( !MatrixFeatures_DDRM.isPositiveSemidefinite(cov) )\n return 3;\n\n ret... | [
"public Story storyOfPath(Configuration configuration, String storyPath) {\n String storyAsText = configuration.storyLoader().loadStoryAsText(storyPath);\n return configuration.storyParser().parseStory(storyAsText, storyPath);\n }",
"private String quoteFormatCharacters(String literal)\n {\n ... |
Returns the organization of a given module
@return Organization | [
"public Organization getModuleOrganization(final String moduleName, final String moduleVersion) throws GrapesCommunicationException {\n final Client client = getClient();\n final WebResource resource = client.resource(serverURL).path(RequestUtils.getModuleOrganizationPath(moduleName, moduleVersion));\... | [
"public static Chart getMSDLineChart(Trajectory t, int lagMin, int lagMax,\n\t\t\tAbstractMeanSquaredDisplacmentEvaluator msdeval) {\n\n\t\tdouble[] xData = new double[lagMax - lagMin + 1];\n\t\tdouble[] yData = new double[lagMax - lagMin + 1];\n\t\tmsdeval.setTrajectory(t);\n\t\tmsdeval.setTimelag(lagMin);\n\t\tfo... |
We try to convert an Object to an Array and this is not easy in Java so we need a little bit of nasty magic.
@param <T> Type of elements
@param clazz Clazz of the Objct elements
@param obj Object
@return Array | [
"@SuppressWarnings({\"unchecked\", \"unused\"})\n public static <T> T[] object2Array(final Class<T> clazz, final Object obj) {\n return (T[]) obj;\n }"
] | [
"private Object readMetadataFromXML(InputSource source, Class target)\r\n throws MalformedURLException, ParserConfigurationException, SAXException, IOException\r\n {\r\n // TODO: make this configurable\r\n boolean validate = false;\r\n \r\n // get a xml reader instance:\r\n... |
ends the request and clears the cache. This can be called before the request is over,
in which case the cache will be unavailable for the rest of the request. | [
"public static void endRequest() {\n final List<RequestScopedItem> result = CACHE.get();\n if (result != null) {\n CACHE.remove();\n for (final RequestScopedItem item : result) {\n item.invalidate();\n }\n }\n }"
] | [
"static Style get(final GridParam params) {\n final StyleBuilder builder = new StyleBuilder();\n\n final Symbolizer pointSymbolizer = crossSymbolizer(\"shape://plus\", builder, CROSS_SIZE,\n params.gridColor);\n final Style style = build... |
Stops all transitions. | [
"@Override\n public void stopTransition() {\n //call listeners so they can perform their actions first, like modifying this adapter's transitions\n for (int i = 0, size = mListenerList.size(); i < size; i++) {\n mListenerList.get(i).onTransitionEnd(this);\n }\n\n for (int i... | [
"private void processChildTasks(Task parentTask) throws SQLException\n {\n List<Row> rows = getRows(\"select * from zscheduleitem where zparentactivity_=? and z_ent=? order by zorderinparentactivity\", parentTask.getUniqueID(), m_entityMap.get(\"Activity\"));\n for (Row row : rows)\n {\n Ta... |
Format the message using the pattern and the arguments.
@param pattern the pattern in the format of "{1} this is a {2}"
@param arguments the arguments.
@return the formatted result. | [
"public static String format(String pattern, Object... arguments) {\n String msg = pattern;\n if (arguments != null) {\n for (int index = 0; index < arguments.length; index++) {\n msg = msg.replaceAll(\"\\\\{\" + (index + 1) + \"\\\\}\", String.valueOf(arguments[index]));\n ... | [
"public final void reset()\n {\n for (int i = 0; i < permutationIndices.length; i++)\n {\n permutationIndices[i] = i;\n }\n remainingPermutations = totalPermutations;\n }",
"public static Broker createBroker(int id, String brokerInfoString) {\n String[] brokerIn... |
Returns the default safety level preference for the user.
@see com.flickr4java.flickr.Flickr#SAFETYLEVEL_MODERATE
@see com.flickr4java.flickr.Flickr#SAFETYLEVEL_RESTRICTED
@see com.flickr4java.flickr.Flickr#SAFETYLEVEL_SAFE
@return The current users safety-level
@throws FlickrException | [
"public String getSafetyLevel() throws FlickrException {\r\n Map<String, Object> parameters = new HashMap<String, Object>();\r\n parameters.put(\"method\", METHOD_GET_SAFETY_LEVEL);\r\n\r\n Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret);\r\n ... | [
"public static void openLogFile() throws IOException\n {\n if (LOG_FILE != null)\n {\n System.out.println(\"SynchroLogger Configured\");\n LOG = new PrintWriter(new FileWriter(LOG_FILE));\n }\n }",
"private void merge(ExecutionStatistics otherStatistics) {\n for (String s... |
Get prototype name.
@return prototype name | [
"public String getPrototypeName() {\n\t\tString name = getClass().getName();\n\t\tif (name.startsWith(ORG_GEOMAJAS)) {\n\t\t\tname = name.substring(ORG_GEOMAJAS.length());\n\t\t}\n\t\tname = name.replace(\".dto.\", \".impl.\");\n\t\treturn name.substring(0, name.length() - 4) + \"Impl\";\n\t}"
] | [
"public static void resetNamedTimer(String timerName, int todoFlags,\n\t\t\tlong threadId) {\n\t\tgetNamedTimer(timerName, todoFlags, threadId).reset();\n\t}",
"private Map<String, String> getLocaleProperties() {\n\n if (m_localeProperties == null) {\n m_localeProperties = CmsCollectionsGenericW... |
Emits a sentence fragment combining all the merge actions. | [
"public static void addActionsTo(\n SourceBuilder code,\n Set<MergeAction> mergeActions,\n boolean forBuilder) {\n SetMultimap<String, String> nounsByVerb = TreeMultimap.create();\n mergeActions.forEach(mergeAction -> {\n if (forBuilder || !mergeAction.builderOnly) {\n nounsByVerb.p... | [
"@Override\n\tprotected void doProcessQueuedOps(PersistentCollection collection, Serializable key, int nextIndex, SharedSessionContractImplementor session)\n\t\t\tthrows HibernateException {\n\t\t// nothing to do\n\t}",
"public static base_response update(nitro_service client, inat resource) throws Exception {\n\... |
Generic method used to create a field map from a block of data.
@param data field map data | [
"private void createFieldMap(byte[] data)\n {\n int index = 0;\n int lastDataBlockOffset = 0;\n int dataBlockIndex = 0;\n\n while (index < data.length)\n {\n long mask = MPPUtility.getInt(data, index + 0);\n //mask = mask << 4;\n\n int dataBlockOffset = MPPUtility.... | [
"@RequestMapping(value = \"/api/plugins\", method = RequestMethod.GET)\n public\n @ResponseBody\n HashMap<String, Object> getPluginInformation() {\n return pluginInformation();\n }",
"public static streamidentifier_stats get(nitro_service service, String name) throws Exception{\n\t\tstreamident... |
Retrieve an instance of the TaskField class based on the data read from an
MPX file.
@param value value from an MS Project file
@return TaskField instance | [
"public static TaskField getMpxjField(int value)\n {\n TaskField result = null;\n\n if (value >= 0 && value < MPX_MPXJ_ARRAY.length)\n {\n result = MPX_MPXJ_ARRAY[value];\n }\n\n return (result);\n }"
] | [
"public LayerType toDto(Class<? extends com.vividsolutions.jts.geom.Geometry> geometryClass) {\n\t\tif (geometryClass == LineString.class) {\n\t\t\treturn LayerType.LINESTRING;\n\t\t} else if (geometryClass == MultiLineString.class) {\n\t\t\treturn LayerType.MULTILINESTRING;\n\t\t} else if (geometryClass == Point.c... |
Handles Multi Instance Encapsulation message. Decapsulates
an Application Command message and handles it using the right
instance.
@param serialMessage the serial message to process.
@param offset the offset at which to start procesing. | [
"private void handleMultiInstanceEncapResponse(\r\n\t\t\tSerialMessage serialMessage, int offset) {\r\n\t\tlogger.trace(\"Process Multi-instance Encapsulation\");\r\n\t\tint instance = serialMessage.getMessagePayloadByte(offset);\r\n\t\tint commandClassCode = serialMessage.getMessagePayloadByte(offset + 1);\r\n\t\t... | [
"public static final BigDecimal printRate(Rate rate)\n {\n BigDecimal result = null;\n if (rate != null && rate.getAmount() != 0)\n {\n result = new BigDecimal(rate.getAmount());\n }\n return result;\n }",
"private static String loadUA(ClassLoader loader, String filename){\n ... |
Retrieves the value component of a criteria expression.
@param field field type
@param block block data
@return field value | [
"private Object getValue(FieldType field, byte[] block)\n {\n Object result = null;\n\n switch (block[0])\n {\n case 0x07: // Field\n {\n result = getFieldType(block);\n break;\n }\n\n case 0x01: // Constant value\n {\n result... | [
"public float getBoundsHeight(){\n if (mSceneObject != null) {\n GVRSceneObject.BoundingVolume v = mSceneObject.getBoundingVolume();\n return v.maxCorner.y - v.minCorner.y;\n }\n return 0f;\n }",
"private void writeTermStatisticsToFile(UsageStatistics usageStatistics,... |
Base64 encodes a byte array.
@param bytes Bytes to encode.
@return Encoded string.
@throws IllegalArgumentException if {@code bytes} is null or exceeds 3/4ths of {@code
Integer.MAX_VALUE}. | [
"public static String base64Encode(byte[] bytes) {\n if (bytes == null) {\n throw new IllegalArgumentException(\"Input bytes must not be null.\");\n }\n if (bytes.length >= BASE64_UPPER_BOUND) {\n throw new IllegalArgumentException(\n \"Input bytes length must not exceed \" + BASE64_UPPE... | [
"public static BoxDeveloperEditionAPIConnection getAppEnterpriseConnection(String enterpriseId, String clientId,\n String clientSecret, JWTEncryptionPreferences encryptionPref, IAccessTokenCache accessTokenCache) {\n\n BoxDeveloperEditionAPIConnection connection = new BoxDeveloperEditionAPIConnect... |
Load a list of entities using the information in the context
@param session The session
@param lockOptions The locking details
@param ogmContext The context with the information to load the entities
@return the list of entities corresponding to the given context | [
"@Override\n\tpublic List<Object> loadEntitiesFromTuples(SharedSessionContractImplementor session, LockOptions lockOptions, OgmLoadingContext ogmContext) {\n\t\treturn loadEntity( null, null, session, lockOptions, ogmContext );\n\t}"
] | [
"public static final Date parseDate(String value)\n {\n Date result = null;\n\n try\n {\n if (value != null && !value.isEmpty())\n {\n result = DATE_FORMAT.get().parse(value);\n }\n }\n catch (ParseException ex)\n {\n // Ignore\n }\n\n ... |
helper method to set the TranslucentStatusFlag
@param on | [
"public static void setTranslucentStatusFlag(Activity activity, boolean on) {\n if (Build.VERSION.SDK_INT >= 19) {\n setFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, on);\n }\n }"
] | [
"public void setWeekDay(String dayString) {\n\n final WeekDay day = WeekDay.valueOf(dayString);\n if (m_model.getWeekDay() != day) {\n removeExceptionsOnChange(new Command() {\n\n public void execute() {\n\n m_model.setWeekDay(day);\n onV... |
Validates the binding types | [
"private void checkBindings(EnhancedAnnotation<T> annotatedAnnotation) {\n Set<Annotation> bindings = annotatedAnnotation.getMetaAnnotations(Qualifier.class);\n if (bindings.size() > 0) {\n for (Annotation annotation : bindings) {\n if (!annotation.annotationType().equals(Nam... | [
"public ILog getLog(String topic, int partition) {\n TopicNameValidator.validate(topic);\n Pool<Integer, Log> p = getLogPool(topic, partition);\n return p == null ? null : p.get(partition);\n }",
"private static int getColumnWidth(final PropertyDescriptor _property) {\n final Class ... |
This returns all profiles associated with a server name
@param serverName server Name
@return profile UUID
@throws Exception exception | [
"public Profile[] getProfilesForServerName(String serverName) throws Exception {\n int profileId = -1;\n ArrayList<Profile> returnProfiles = new ArrayList<Profile>();\n\n PreparedStatement queryStatement = null;\n ResultSet results = null;\n try (Connection sqlConnection = sqlServ... | [
"public CollectionRequest<Task> stories(String task) {\n \n String path = String.format(\"/tasks/%s/stories\", task);\n return new CollectionRequest<Task>(this, Task.class, path, \"GET\");\n }",
"public void checkConstraints(String checkLevel) throws ConstraintException\r\n {\r\n // ... |
Creates a Bytes object by copying the value of the given String | [
"public static final Bytes of(String s) {\n Objects.requireNonNull(s);\n if (s.isEmpty()) {\n return EMPTY;\n }\n byte[] data = s.getBytes(StandardCharsets.UTF_8);\n return new Bytes(data, s);\n }"
] | [
"private void enableTalkBack() {\n GVRSceneObject[] sceneObjects = mGvrContext.getMainScene().getWholeSceneObjects();\n for (GVRSceneObject sceneObject : sceneObjects) {\n if (sceneObject instanceof GVRAccessiblityObject)\n if (((GVRAccessiblityObject) sceneObject).getTalkBac... |
Returns the name of the directory where the dumpfile of the given type
and date should be stored.
@param dumpContentType
the type of the dump
@param dateStamp
the date of the dump in format YYYYMMDD
@return the local directory name for the dumpfile | [
"public static String getDumpFileDirectoryName(\n\t\t\tDumpContentType dumpContentType, String dateStamp) {\n\t\treturn dumpContentType.toString().toLowerCase() + \"-\" + dateStamp;\n\t}"
] | [
"public Date[] getDates()\n {\n int frequency = NumberHelper.getInt(m_frequency);\n if (frequency < 1)\n {\n frequency = 1;\n }\n\n Calendar calendar = DateHelper.popCalendar(m_startDate);\n List<Date> dates = new ArrayList<Date>();\n\n switch (m_recurrenceType)\n {... |
Gets the current version of the database schema. This version is taken
from the migration table and represent the latest successful entry.
@return the current schema version | [
"public int getVersion() {\n ResultSet resultSet = session.execute(format(VERSION_QUERY, getTableName()));\n Row result = resultSet.one();\n if (result == null) {\n return 0;\n }\n return result.getInt(0);\n }"
] | [
"private static Point getScreenSize(Context context, Point p) {\n if (p == null) {\n p = new Point();\n }\n WindowManager windowManager = (WindowManager) context\n .getSystemService(Context.WINDOW_SERVICE);\n Display display = windowManager.getDefaultDisplay();\... |
Remember execution time for all executed suites. | [
"@Subscribe\n public void onSuiteResult(AggregatedSuiteResultEvent e) {\n long millis = e.getExecutionTime();\n String suiteName = e.getDescription().getDisplayName();\n \n List<Long> values = hints.get(suiteName);\n if (values == null) {\n hints.put(suiteName, values = new ArrayList<>());\n ... | [
"public static base_responses update(nitro_service client, gslbsite resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tgslbsite updateresources[] = new gslbsite[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t\t\tupdat... |
Get global hotkey provider for current platform
@param useSwingEventQueue whether the provider should be using Swing Event queue or a regular thread
@return new instance of Provider, or null if platform is not supported
@see X11Provider
@see WindowsProvider
@see CarbonProvider | [
"public static Provider getCurrentProvider(boolean useSwingEventQueue) {\n Provider provider;\n if (Platform.isX11()) {\n provider = new X11Provider();\n } else if (Platform.isWindows()) {\n provider = new WindowsProvider();\n } else if (Platform.isMac()) {\n ... | [
"private void logTimeTakenByRuleProvider(GraphContext graphContext, Context context, int ruleIndex, int timeTaken)\n {\n AbstractRuleProvider ruleProvider = (AbstractRuleProvider) context.get(RuleMetadataType.RULE_PROVIDER);\n if (ruleProvider == null)\n return;\n\n if (!timeTaken... |
Use this API to fetch appfwjsoncontenttype resources of given names . | [
"public static appfwjsoncontenttype[] get(nitro_service service, String jsoncontenttypevalue[]) throws Exception{\n\t\tif (jsoncontenttypevalue !=null && jsoncontenttypevalue.length>0) {\n\t\t\tappfwjsoncontenttype response[] = new appfwjsoncontenttype[jsoncontenttypevalue.length];\n\t\t\tappfwjsoncontenttype obj[]... | [
"public void setAttribute(final String name, final Attribute attribute) {\n if (name.equals(MAP_KEY)) {\n this.mapAttribute = (MapAttribute) attribute;\n }\n }",
"public ChannelInfo getChannel(String name) {\n final URI uri = uriWithPath(\"./channels/\" + encodePathSegment(name));\n... |
Turns a series of strings into their corresponding license entities
by using regular expressions
@param licStrings The list of license strings
@return A set of license entities | [
"public Set<DbLicense> resolveLicenses(List<String> licStrings) {\n Set<DbLicense> result = new HashSet<>();\n\n licStrings\n .stream()\n .map(this::getMatchingLicenses)\n .forEach(result::addAll);\n\n return result;\n }"
] | [
"public static CharSequence getAt(CharSequence text, IntRange range) {\n return getAt(text, (Range) range);\n }",
"private void computeUnnamedParams() {\n unnamedParams.addAll(rawArgs.stream().filter(arg -> !isNamedParam(arg)).collect(Collectors.toList()));\n }",
"public ConditionalExpectati... |
Seeks to the given holiday within the given year
@param holidayString
@param yearString | [
"public void seekToHolidayYear(String holidayString, String yearString) {\n Holiday holiday = Holiday.valueOf(holidayString);\n assert(holiday != null);\n \n seekToIcsEventYear(HOLIDAY_ICS_FILE, yearString, holiday.getSummary());\n }"
] | [
"public void addPropertyChangeListener (String propertyName, java.beans.PropertyChangeListener listener)\r\n {\r\n this.propertyChangeDelegate.addPropertyChangeListener(propertyName, listener);\r\n }",
"public static final MVCArray buildArcPoints(LatLong center, double startBearing, double endBearing... |
Creates the tables according to the schema files.
@throws PlatformException If some error occurred | [
"public void initDB() throws PlatformException\r\n {\r\n if (_initScripts.isEmpty())\r\n {\r\n createInitScripts();\r\n }\r\n\r\n Project project = new Project();\r\n TorqueSQLTask sqlTask = new TorqueSQLTask(); \r\n File outputDir = null;\r... | [
"synchronized void removeServerProcess() {\n this.requiredState = InternalState.STOPPED;\n internalSetState(new ProcessRemoveTask(), InternalState.STOPPED, InternalState.PROCESS_REMOVING);\n }",
"private static String getBindingId(Server server) {\n Endpoint ep = server.getEndpoint();\n ... |
Lookup a native pointer to a collider and return its Java object.
@param nativePointer native pointer to C++ Collider
@return Java GVRCollider object | [
"static GVRCollider lookup(long nativePointer)\n {\n synchronized (sColliders)\n {\n WeakReference<GVRCollider> weakReference = sColliders.get(nativePointer);\n return weakReference == null ? null : weakReference.get();\n }\n }"
] | [
"public static BoxLegalHoldPolicy.Info createOngoing(BoxAPIConnection api, String name, String description) {\n URL url = ALL_LEGAL_HOLD_URL_TEMPLATE.build(api.getBaseURL());\n BoxJSONRequest request = new BoxJSONRequest(api, url, \"POST\");\n JsonObject requestJSON = new JsonObject()\n ... |
Create a new builder for multiple unpaginated requests on the view.
@param keyType {@link com.cloudant.client.api.views.Key.Type} of the key emitted by the
view
@param valueType class of the type of value emitted by the view
@param <K> type of key emitted by the view
@param <V> type of value emitted by t... | [
"public <K, V> MultipleRequestBuilder<K, V> newMultipleRequest(Key.Type<K> keyType,\n Class<V> valueType) {\n return new MultipleRequestBuilderImpl<K, V>(newViewRequestParameters(keyType.getType(),\n valueType));\n }"
] | [
"public Object getBeliefValue(String agent_name, final String belief_name,\n Connector connector) {\n\n ((IExternalAccess) connector.getAgentsExternalAccess(agent_name))\n .scheduleStep(new IComponentStep<Integer>() {\n\n public IFuture<Integer> execute(IInternalA... |
<<<<<< measureUntilFull helper methods | [
"@Override\n protected boolean changeDirection(int currentIndex, int centerIndex, boolean inBounds) {\n boolean changed = false;\n if (getGravityInternal() == Gravity.CENTER &&\n currentIndex <= centerIndex &&\n currentIndex == 0 || !inBounds) {\n\n changed ... | [
"public static String encodeHost(String host, String encoding) throws UnsupportedEncodingException {\n\t\treturn HierarchicalUriComponents.encodeUriComponent(host, encoding, HierarchicalUriComponents.Type.HOST_IPV4);\n\t}",
"public void deleteArtifact(final String gavc, final String user, final String password) t... |
Sets the ProjectCalendar instance from which this calendar is derived.
@param calendar base calendar instance | [
"public void setParent(ProjectCalendar calendar)\n {\n // I've seen a malformed MSPDI file which sets the parent calendar to itself.\n // Silently ignore this here.\n if (calendar != this)\n {\n if (getParent() != null)\n {\n getParent().removeDerivedCalendar(this);\... | [
"public static base_response delete(nitro_service client) throws Exception {\n\t\tlocationfile deleteresource = new locationfile();\n\t\treturn deleteresource.delete_resource(client);\n\t}",
"public static String simpleTypeName(Object obj) {\n if (obj == null) {\n return \"null\";\n }\n\n... |
Populate the authenticated user profiles in the Shiro subject.
@param profiles the linked hashmap of profiles | [
"public static void populateSubject(final LinkedHashMap<String, CommonProfile> profiles) {\n if (profiles != null && profiles.size() > 0) {\n final List<CommonProfile> listProfiles = ProfileHelper.flatIntoAProfileList(profiles);\n try {\n if (IS_FULLY_AUTHENTICATED_AUTHOR... | [
"protected Map<String, TermImpl> getMonolingualUpdatedValues(Map<String, NameWithUpdate> updates) {\n \tMap<String, TermImpl> updatedValues = new HashMap<>();\n \tfor(NameWithUpdate update : updates.values()) {\n if (!update.write) {\n continue;\n }\n updatedVal... |
Init the headers of the table regarding the filters
@return String[] | [
"private String[] getHeaders() {\n final List<String> headers = new ArrayList<>();\n\n if(decorator.getShowSources()){\n headers.add(SOURCE_FIELD);\n }\n\n if(decorator.getShowSourcesVersion()){\n headers.add(SOURCE_VERSION_FIELD);\n }\n\n if(decorator... | [
"public void setWholeDay(Boolean isWholeDay) {\r\n\r\n if (m_model.isWholeDay() ^ ((null != isWholeDay) && isWholeDay.booleanValue())) {\r\n m_model.setWholeDay(isWholeDay);\r\n valueChanged();\r\n }\r\n }",
"public VerticalLayout getEmptyLayout() {\n\n m_emptyLayout ... |
Restores a saved connection state into this BoxAPIConnection.
@see #save
@param state the saved state that was created with {@link #save}. | [
"public void restore(String state) {\n JsonObject json = JsonObject.readFrom(state);\n String accessToken = json.get(\"accessToken\").asString();\n String refreshToken = json.get(\"refreshToken\").asString();\n long lastRefresh = json.get(\"lastRefresh\").asLong();\n long expires ... | [
"public String asString() throws IOException {\n long len = getContentLength();\n ByteArrayOutputStream buf;\n if (0 < len) {\n buf = new ByteArrayOutputStream((int) len);\n } else {\n buf = new ByteArrayOutputStream();\n }\n writeTo(buf);\n return decode(buf.toByteArray(), getCharact... |
Delivers the correct JSON Object for the dockers
@param dockers
@throws org.json.JSONException | [
"private static JSONArray parseDockers(ArrayList<Point> dockers) throws JSONException {\n if (dockers != null) {\n JSONArray dockersArray = new JSONArray();\n\n for (Point docker : dockers) {\n JSONObject dockerObject = new JSONObject();\n\n dockerObject.pu... | [
"public static base_response delete(nitro_service client, String ipv6prefix) throws Exception {\n\t\tonlinkipv6prefix deleteresource = new onlinkipv6prefix();\n\t\tdeleteresource.ipv6prefix = ipv6prefix;\n\t\treturn deleteresource.delete_resource(client);\n\t}",
"public T build() throws IllegalAccessException, IO... |
Returns the foreignkey to the specified table.
@param name The name of the foreignkey
@param tableName The name of the referenced table
@return The foreignkey def or <code>null</code> if it does not exist | [
"public ForeignkeyDef getForeignkey(String name, String tableName)\r\n {\r\n String realName = (name == null ? \"\" : name);\r\n ForeignkeyDef def = null;\r\n\r\n for (Iterator it = getForeignkeys(); it.hasNext();)\r\n {\r\n def = (ForeignkeyDef)it.next();\r\n ... | [
"public void checkAllRequirementsSatisfied(final String currentPath) {\n StringBuilder errors = new StringBuilder();\n\n for (Field field: this.dependantsInJson) {\n final Collection<String> requirements = this.dependantToRequirementsMap.get(field);\n if (!requirements.isEmpty())... |
compares two AST nodes | [
"public Diff compare(CtElement left, CtElement right) {\n\t\tfinal SpoonGumTreeBuilder scanner = new SpoonGumTreeBuilder();\n\t\treturn new DiffImpl(scanner.getTreeContext(), scanner.getTree(left), scanner.getTree(right));\n\t}"
] | [
"private LocatorSelectionStrategy getLocatorSelectionStrategy(String locatorSelectionStrategy) {\n if (null == locatorSelectionStrategy) {\n return locatorSelectionStrategyMap.get(DEFAULT_STRATEGY).getInstance();\n }\n\n if (LOG.isLoggable(Level.FINE)) {\n LOG.log(Level.FI... |
Pauses a given deployment
@param deployment The deployment to pause
@param listener The listener that will be notified when the pause is complete | [
"public synchronized void pauseDeployment(final String deployment, ServerActivityCallback listener) {\n final List<ControlPoint> eps = new ArrayList<ControlPoint>();\n for (ControlPoint ep : entryPoints.values()) {\n if (ep.getDeployment().equals(deployment)) {\n if(!ep.isPau... | [
"public static <E> Set<E> intersection(Set<E> s1, Set<E> s2) {\r\n Set<E> s = new HashSet<E>();\r\n s.addAll(s1);\r\n s.retainAll(s2);\r\n return s;\r\n }",
"private List<String> getMavenModules(MavenModuleSetBuild mavenBuild) throws IOException, InterruptedException {\n FilePath pathToModuleR... |
This method changes the value of an agent's belief through its external
access
@param agent_name
The name of the agent to change a belief
@param belief_name
The name of the belief to change
@param new_value
The new value of the belief to be changed
@param connector
The connector to get the external access | [
"public void setBeliefValue(String agent_name, final String belief_name,\n final Object new_value, Connector connector) {\n\n ((IExternalAccess) connector.getAgentsExternalAccess(agent_name))\n .scheduleStep(new IComponentStep<Integer>() {\n\n public IFuture<Integ... | [
"public Future<PutObjectResult> putAsync(String key, String value) {\n return Future.of(() -> put(key, value), this.uploadService)\n .flatMap(t->t.fold(p->Future.ofResult(p),e->Future.ofError(e)));\n }",
"public static long getMaxIdForClass(\r\n PersistenceBroker brokerFo... |
Parses the query facet configurations.
@param rangeFacetObject The JSON sub-node with the query facet configurations.
@return The query facet configurations. | [
"protected I_CmsSearchConfigurationFacetRange parseRangeFacet(JSONObject rangeFacetObject) {\n\n try {\n String range = rangeFacetObject.getString(JSON_KEY_RANGE_FACET_RANGE);\n String name = parseOptionalStringValue(rangeFacetObject, JSON_KEY_FACET_NAME);\n String label = pa... | [
"public <T extends OutputStream> T write(T os) throws IOException {\n close();\n\n if (!(this.os instanceof ByteArrayOutputStream))\n throw new IllegalStateException(\"Cannot write to another target if setOutputStream has been called\");\n final byte[] content = ((ByteArrayOutputStre... |
Method which performs strength checks on password. It returns outcome which can be used by CLI.
@param isAdminitrative - administrative checks are less restrictive. This means that weak password or one which violates restrictions is not indicated as failure.
Administrative checks are usually performed by admin changin... | [
"public PasswordCheckResult check(boolean isAdminitrative, String userName, String password) {\n // TODO: allow custom restrictions?\n List<PasswordRestriction> passwordValuesRestrictions = getPasswordRestrictions();\n final PasswordStrengthCheckResult strengthResult = this.passwordStrengthChec... | [
"public List<Class<?>> scanClasses(Predicate<String> filter)\n {\n List<Class<?>> discoveredClasses = new ArrayList<>(128);\n\n // For each Forge addon...\n for (Addon addon : furnace.getAddonRegistry().getAddons(AddonFilters.allStarted()))\n {\n List<String> discoveredFile... |
Add views to the tree.
@param parentNode parent tree node
@param file views container | [
"private void addViews(MpxjTreeNode parentNode, ProjectFile file)\n {\n for (View view : file.getViews())\n {\n final View v = view;\n MpxjTreeNode childNode = new MpxjTreeNode(view)\n {\n @Override public String toString()\n {\n return v.getNa... | [
"public Jar setJarPrefix(String value) {\n verifyNotSealed();\n if (jos != null)\n throw new IllegalStateException(\"Really executable cannot be set after entries are added.\");\n if (value != null && jarPrefixFile != null)\n throw new IllegalStateException(\"A prefix has ... |
Create a field map for enterprise custom fields.
@param props props data
@param c target class | [
"public void createEnterpriseCustomFieldMap(Props props, Class<?> c)\n {\n byte[] fieldMapData = null;\n for (Integer key : ENTERPRISE_CUSTOM_KEYS)\n {\n fieldMapData = props.getByteArray(key);\n if (fieldMapData != null)\n {\n break;\n }\n }\n\n ... | [
"public static boolean isSpreadSafe(Expression expression) {\r\n if (expression instanceof MethodCallExpression) {\r\n return ((MethodCallExpression) expression).isSpreadSafe();\r\n }\r\n if (expression instanceof PropertyExpression) {\r\n return ((PropertyExpression) expr... |
Answer the orderBy of all Criteria and Sub Criteria
the elements are of class Criteria.FieldHelper
@return List | [
"List getOrderby()\r\n {\r\n List result = _getOrderby();\r\n Iterator iter = getCriteria().iterator();\r\n Object crit;\r\n\r\n while (iter.hasNext())\r\n {\r\n crit = iter.next();\r\n if (crit instanceof Criteria)\r\n {\r\n resu... | [
"protected RdfSerializer createRdfSerializer() throws IOException {\n\n\t\tString outputDestinationFinal;\n\t\tif (this.outputDestination != null) {\n\t\t\toutputDestinationFinal = this.outputDestination;\n\t\t} else {\n\t\t\toutputDestinationFinal = \"{PROJECT}\" + this.taskName + \"{DATE}\"\n\t\t\t\t\t+ \".nt\";\... |
Configs created by this ConfigBuilder will have the given Redis hostname.
@param host the Redis hostname
@return this ConfigBuilder | [
"public ConfigBuilder withHost(final String host) {\n if (host == null || \"\".equals(host)) {\n throw new IllegalArgumentException(\"host must not be null or empty: \" + host);\n }\n this.host = host;\n return this;\n }"
] | [
"public AsciiTable setHtmlElementTranslator(HtmlElementTranslator htmlElementTranslator) {\r\n\t\tfor(AT_Row row : this.rows){\r\n\t\t\tif(row.getType()==TableRowType.CONTENT){\r\n\t\t\t\trow.setHtmlElementTranslator(htmlElementTranslator);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t}",
"public static base_resp... |
Returns true if the default profile for the specified uuid is active
@return true if active, otherwise false | [
"public boolean isActive(int profileId) {\n boolean active = false;\n PreparedStatement queryStatement = null;\n\n try (Connection sqlConnection = sqlService.getConnection()) {\n queryStatement = sqlConnection.prepareStatement(\n \"SELECT \" + Constants.CLIENT_IS_ACTIV... | [
"public static base_responses add(nitro_service client, cacheselector resources[]) throws Exception {\n\t\tbase_responses result = null;\n\t\tif (resources != null && resources.length > 0) {\n\t\t\tcacheselector addresources[] = new cacheselector[resources.length];\n\t\t\tfor (int i=0;i<resources.length;i++){\n\t\t... |
Notifies that multiple footer items are inserted.
@param positionStart the position.
@param itemCount the item count. | [
"public final void notifyFooterItemRangeInserted(int positionStart, int itemCount) {\n int newHeaderItemCount = getHeaderItemCount();\n int newContentItemCount = getContentItemCount();\n int newFooterItemCount = getFooterItemCount();\n if (positionStart < 0 || itemCount < 0 || positionSt... | [
"@NotNull\n private String getFQName(@NotNull final String localName, Object... params) {\n final StringBuilder builder = new StringBuilder();\n builder.append(storeName);\n builder.append('.');\n builder.append(localName);\n for (final Object param : params) {\n bui... |
Attempt to shutdown the server. As much shutdown as possible will be
completed, even if intermediate errors are encountered.
@throws VoldemortException | [
"@Override\n protected void stopInner() throws VoldemortException {\n List<VoldemortException> exceptions = new ArrayList<VoldemortException>();\n\n logger.info(\"Stopping services:\" + getIdentityNode().getId());\n /* Stop in reverse order */\n exceptions.addAll(stopOnlineServices())... | [
"public static Map<String, String> getContentMap(File file, String separator) throws IOException {\n List<String> content = getContentLines(file);\n Map<String, String> map = new LinkedHashMap<String, String>();\n \n for (String line : content) {\n String[] spl = line.split(separator);\n if ... |
Updates the value in HashMap and writeBack as Atomic step | [
"@Override\n synchronized public V put(K key, V value) {\n V oldValue = this.get(key);\n try {\n super.put(key, value);\n writeBack(key, value);\n return oldValue;\n } catch(Exception e) {\n super.put(key, oldValue);\n writeBack(key, old... | [
"public void initialize() {\n\t\tthis.enqueue(new SerialMessage(SerialMessage.SerialMessageClass.GetVersion, SerialMessage.SerialMessageType.Request, SerialMessage.SerialMessageClass.GetVersion, SerialMessage.SerialMessagePriority.High));\n\t\tthis.enqueue(new SerialMessage(SerialMessage.SerialMessageClass.MemoryGe... |
Convert this lattice to store data in the given convention.
Conversion involving receiver premium assumes zero wide collar.
@param targetConvention The convention to store the data in.
@param displacement The displacement to use, if applicable.
@param model The model for context.
@return The converted lattice. | [
"public SwaptionDataLattice convertLattice(QuotingConvention targetConvention, double displacement, AnalyticModel model) {\r\n\r\n\t\tif(displacement != 0 && targetConvention != QuotingConvention.PAYERVOLATILITYLOGNORMAL) {\r\n\t\t\tthrow new IllegalArgumentException(\"SwaptionDataLattice only supports displacement... | [
"@Deprecated\n public int getEntityTypeId(@NotNull final String entityType, final boolean allowCreate) {\n return getEntityTypeId(txnProvider, entityType, allowCreate);\n }",
"public Duration getWork(FastTrackField type)\n {\n Double value = (Double) getObject(type);\n return value == nul... |
Set the row, column, and value
@return this | [
"public FluoKeyValueGenerator set(RowColumnValue rcv) {\n setRow(rcv.getRow());\n setColumn(rcv.getColumn());\n setValue(rcv.getValue());\n return this;\n }"
] | [
"public void begin(String key)\n {\n if (key == null)\n {\n return;\n }\n TimingData data = executionInfo.get(key);\n if (data == null)\n {\n data = new TimingData(key);\n executionInfo.put(key, data);\n }\n data.begin();\n ... |
Gets the Kullback Leibler divergence.
@param p P vector.
@param q Q vector.
@return The Kullback Leibler divergence between u and v. | [
"public static double KullbackLeiblerDivergence(double[] p, double[] q) {\n boolean intersection = false;\n double k = 0;\n\n for (int i = 0; i < p.length; i++) {\n if (p[i] != 0 && q[i] != 0) {\n intersection = true;\n k += p[i] * Math.log(p[i] / q[i]);... | [
"private void digestInteger(MessageDigest digest, int value) {\n byte[] valueBytes = new byte[4];\n Util.numberToBytes(value, valueBytes, 0, 4);\n digest.update(valueBytes);\n }",
"private static int skipEndOfLine(String text, int offset)\n {\n char c;\n boolean finished = fals... |
Use this API to fetch all the nsrollbackcmd resources that are configured on netscaler. | [
"public static nsrollbackcmd get(nitro_service service) throws Exception{\n\t\tnsrollbackcmd obj = new nsrollbackcmd();\n\t\tnsrollbackcmd[] response = (nsrollbackcmd[])obj.get_resources(service);\n\t\treturn response[0];\n\t}"
] | [
"public static void closeMASCaseManager(File caseManager) {\n\n FileWriter caseManagerWriter;\n try {\n caseManagerWriter = new FileWriter(caseManager, true);\n caseManagerWriter.write(\"}\\n\");\n caseManagerWriter.flush();\n caseManagerWriter.close();\n ... |
Sets the top padding for all cells in the table.
@param paddingTop new padding, ignored if smaller than 0
@return this to allow chaining | [
"public AsciiTable setPaddingTop(int paddingTop) {\r\n\t\tfor(AT_Row row : this.rows){\r\n\t\t\tif(row.getType()==TableRowType.CONTENT){\r\n\t\t\t\trow.setPaddingTop(paddingTop);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t}"
] | [
"private <FT, FID> FT createForeignShell(ConnectionSource connectionSource, Object val, ObjectCache objectCache)\n\t\t\tthrows SQLException {\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tDao<FT, FID> castDao = (Dao<FT, FID>) foreignDao;\n\t\tFT foreignObject = castDao.createObjectInstance();\n\t\tforeignIdField.assig... |
Start the drag operation of a scene object with a rigid body.
@param sceneObject Scene object with a rigid body attached to it.
@param hitX rel position in x-axis.
@param hitY rel position in y-axis.
@param hitZ rel position in z-axis.
@return true if success, otherwise returns false. | [
"public boolean startDrag(final GVRSceneObject sceneObject,\n final float hitX, final float hitY, final float hitZ) {\n final GVRRigidBody dragMe = (GVRRigidBody)sceneObject.getComponent(GVRRigidBody.getComponentType());\n if (dragMe == null || dragMe.getSimulationType() !=... | [
"public static int findFirstNonAnnotationLine(ASTNode node, SourceCode sourceCode) {\r\n if (node instanceof AnnotatedNode && !((AnnotatedNode) node).getAnnotations().isEmpty()) {\r\n\r\n // HACK: Groovy line numbers are broken when annotations have a parameter :(\r\n // so we must look... |
Sets the global. Does not add the global to the ExecutionResults.
@param identifier
The identifier of the global
@param object
The instance to be set as the global.
@return | [
"public static Command newSetGlobal(String identifier,\n Object object) {\n return getCommandFactoryProvider().newSetGlobal( identifier,\n object );\n }"
] | [
"void setFilters(Map<Object, Object> filters) {\n\n for (Object column : filters.keySet()) {\n Object filterValue = filters.get(column);\n if ((filterValue != null) && !filterValue.toString().isEmpty() && !m_table.isColumnCollapsed(column)) {\n m_table.setFilterFieldValue... |
Compute singular values and U and V at the same time | [
"private boolean computeUWV() {\n bidiag.getDiagonal(diag,off);\n qralg.setMatrix(numRowsT,numColsT,diag,off);\n\n// long pointA = System.currentTimeMillis();\n // compute U and V matrices\n if( computeU )\n Ut = bidiag.getU(Ut,true,compact);\n if( computeV )\n ... | [
"public int readFrom(byte[] src, int srcOffset, long destOffset, int length) {\n int readLen = (int) Math.min(src.length - srcOffset, Math.min(size() - destOffset, length));\n ByteBuffer b = toDirectByteBuffer(destOffset, readLen);\n b.position(0);\n b.put(src, srcOffset, readLen);\n ... |
Return given duration in a human-friendly format. For example, "4
minutes" or "1 second". Returns only largest meaningful unit of time,
from seconds up to hours.
The longest duration it supports is hours.
This method assumes that there are 60 minutes in an hour,
60 seconds in a minute and 1000 milliseconds in a secon... | [
"public static CharSequence formatDuration(Context context, ReadableDuration readableDuration) {\n Resources res = context.getResources();\n Duration duration = readableDuration.toDuration();\n\n final int hours = (int) duration.getStandardHours();\n if (hours != 0) {\n return... | [
"public static void symmLowerToFull( DMatrixRMaj A )\n {\n if( A.numRows != A.numCols )\n throw new MatrixDimensionException(\"Must be a square matrix\");\n\n final int cols = A.numCols;\n\n for (int row = 0; row < A.numRows; row++) {\n for (int col = row+1; col < cols;... |
Get the correct google api key.
Tries to read a workplace key first.
@param cms CmsObject
@param sitePath site path
@return key value
@throws CmsException exception | [
"private String getApiKey(CmsObject cms, String sitePath) throws CmsException {\n\n String res = cms.readPropertyObject(\n sitePath,\n CmsPropertyDefinition.PROPERTY_GOOGLE_API_KEY_WORKPLACE,\n true).getValue();\n\n if (CmsStringUtil.isEmptyOrWhitespaceOnly(res)) {\n ... | [
"public void setMatrix(int[] matrix) {\n\t\tthis.matrix = matrix;\n\t\tsum = 0;\n\t\tfor (int i = 0; i < matrix.length; i++)\n\t\t\tsum += matrix[i];\n\t}",
"protected VelocityContext createContext()\n {\n VelocityContext context = new VelocityContext();\n context.put(META_KEY, META);\n co... |
Adds the complex number with a scalar value.
@param z1 Complex Number.
@param scalar Scalar value.
@return Returns new ComplexNumber instance containing the add of specified complex number with scalar value. | [
"public static ComplexNumber Add(ComplexNumber z1, double scalar) {\r\n return new ComplexNumber(z1.real + scalar, z1.imaginary);\r\n }"
] | [
"public static <T_Result, T_Source> List<T_Result> map(Collection<T_Source> source,\n Mapper<T_Result, T_Source> mapper) {\n List<T_Result> result = new LinkedList<T_Result>();\n for (T_Source element : source) {\n result.add(mapper.map(element));\n }\n return resul... |
Allocates a new next buffer and pending fetch. | [
"private void requestBlock() {\n next = ByteBuffer.allocate(blockSizeBytes);\n long requestTimeout = retryParams.getRequestTimeoutMillisForCurrentAttempt();\n pendingFetch = raw.readObjectAsync(next, filename, fetchPosition, requestTimeout);\n }"
] | [
"public Diff compare(String left, String right) {\n\t\treturn compare(getCtType(left), getCtType(right));\n\t}",
"@Nullable\n public ResultT first() {\n final CoreRemoteMongoCursor<ResultT> cursor = iterator();\n if (!cursor.hasNext()) {\n return null;\n }\n return cursor.next();\n }",
"publi... |
Checks a returned Javascript value where we expect a boolean but could
get null.
@param val The value from Javascript to be checked.
@param def The default return value, which can be null.
@return The actual value, or if null, returns false. | [
"protected Boolean checkBoolean(Object val, Boolean def) {\n return (val == null) ? def : (Boolean) val;\n }"
] | [
"public static void removeZeros( DMatrixSparseCSC input , DMatrixSparseCSC output , double tol ) {\n ImplCommonOps_DSCC.removeZeros(input,output,tol);\n }",
"private ClassNode getGenericsResolvedTypeOfFieldOrProperty(AnnotatedNode an, ClassNode type) {\n if (!type.isUsingGenerics()) return type;... |
Get the GroupDiscussInterface.
@return The GroupDiscussInterface | [
"@Override\n public GroupDiscussInterface getDiscussionInterface() {\n if (discussionInterface == null) {\n discussionInterface = new GroupDiscussInterface(apiKey, sharedSecret, transport);\n }\n return discussionInterface;\n }"
] | [
"@Override\n public CopticDate date(int prolepticYear, int month, int dayOfMonth) {\n return CopticDate.of(prolepticYear, month, dayOfMonth);\n }",
"public String readSnippet(String name) {\n\n String path = CmsStringUtil.joinPaths(\n m_context.getSetupBean().getWebAppRfsPath(),\n ... |
Performs a put operation with the specified composite request object
@param requestWrapper A composite request object containing the key and
value
@return Version of the value for the successful put | [
"public Version putWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) {\n validateTimeout(requestWrapper.getRoutingTimeoutInMs());\n List<Versioned<V>> versionedValues;\n long startTime = System.currentTimeMillis();\n String keyHexString = \"\";\n if(logger.isDebugE... | [
"public static String[] removeDuplicateStrings(String[] array) {\n if (isEmpty(array)) {\n return array;\n }\n Set<String> set = new TreeSet<String>();\n Collections.addAll(set, array);\n return toStringArray(set);\n }",
"private boolean initCheckTypeModifiers() {\... |
Increase the priority of an overrideId
@param overrideId ID of override
@param pathId ID of path containing override
@param clientUUID UUID of client | [
"public void increasePriority(int overrideId, int ordinal, int pathId, String clientUUID) {\n logger.info(\"Increase priority\");\n\n int origPriority = -1;\n int newPriority = -1;\n int origId = 0;\n int newId = 0;\n\n PreparedStatement statement = null;\n ResultSet... | [
"public static long crc32(byte[] bytes, int offset, int size) {\n CRC32 crc = new CRC32();\n crc.update(bytes, offset, size);\n return crc.getValue();\n }",
"public void clearResponseSettings(int pathId, String clientUUID) throws Exception {\n logger.info(\"clearing response setting... |
Return a new client that may be cached or not. Given properties are always use when not cached, and only used at creation time for
cached clients.
@param name
if null, default client. Otherwise, helpful to retrieve cached clients later.
@param p
a set of properties. Implementation specific. Unknown properties are sile... | [
"public static JqmClient getClient(String name, Properties p, boolean cached)\n {\n Properties p2 = null;\n if (binder == null)\n {\n bind();\n }\n if (p == null)\n {\n p2 = props;\n }\n else\n {\n p2 = new Properties... | [
"public static snmpuser get(nitro_service service, String name) throws Exception{\n\t\tsnmpuser obj = new snmpuser();\n\t\tobj.set_name(name);\n\t\tsnmpuser response = (snmpuser) obj.get_resource(service);\n\t\treturn response;\n\t}",
"public static vpnvserver_appcontroller_binding[] get(nitro_service service, St... |
Count the statements and property uses of an item or property document.
@param usageStatistics
statistics object to store counters in
@param statementDocument
document to count the statements of | [
"protected void countStatements(UsageStatistics usageStatistics,\n\t\t\tStatementDocument statementDocument) {\n\t\t// Count Statement data:\n\t\tfor (StatementGroup sg : statementDocument.getStatementGroups()) {\n\t\t\t// Count Statements:\n\t\t\tusageStatistics.countStatements += sg.size();\n\n\t\t\t// Count uses... | [
"public static synchronized void addCachedDatabaseConfigs(Collection<DatabaseTableConfig<?>> configs) {\n\t\tMap<Class<?>, DatabaseTableConfig<?>> newMap;\n\t\tif (configMap == null) {\n\t\t\tnewMap = new HashMap<Class<?>, DatabaseTableConfig<?>>();\n\t\t} else {\n\t\t\tnewMap = new HashMap<Class<?>, DatabaseTableC... |
Set the background color of the progress spinner disc.
@param colorRes Resource id of the color. | [
"public void setProgressBackgroundColor(int colorRes) {\n mCircleView.setBackgroundColor(colorRes);\n mProgress.setBackgroundColor(getResources().getColor(colorRes));\n }"
] | [
"public void start() {\n instanceLock.writeLock().lock();\n try {\n for (final Map.Entry<MongoNamespace, NamespaceChangeStreamListener> streamerEntry :\n nsStreamers.entrySet()) {\n streamerEntry.getValue().start();\n }\n } finally {\n instanceLock.writeLock().unlock();\n ... |
Returns the URL of a classpath resource.
@param resourceName
The name of the resource.
@return The URL. | [
"public static URL findConfigResource(String resourceName) {\n if (Strings.isNullOrEmpty(resourceName)) {\n return null;\n }\n\n final URL url = resourceName.startsWith(ROOT) ? DefaultConfiguration.class.getResource(resourceName)\n : DefaultConfiguration.class.getResource(... | [
"public static <T> IteratorFromReaderFactory<T> getFactory(String delim, Function<String,T> op) {\r\n return new DelimitRegExIteratorFactory<T>(delim, op);\r\n }",
"public Metadata replace(String path, String value) {\n this.values.set(this.pathToProperty(path), value);\n this.addOp(\"replace\",... |
Calculates the beginLine of a violation report.
@param pmdViolation The violation for which the beginLine should be calculated.
@return The beginLine is assumed to be the line with the smallest number. However, if the smallest number is
out-of-range (non-positive), it takes the other number. | [
"private static int calculateBeginLine(RuleViolation pmdViolation) {\n int minLine = Math.min(pmdViolation.getBeginLine(), pmdViolation.getEndLine());\n return minLine > 0 ? minLine : calculateEndLine(pmdViolation);\n }"
] | [
"public BufferedImage getBufferedImage(int width, int height) {\n // using the new approach of Java 2D API\n BufferedImage buf = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);\n Graphics2D g2d = (Graphics2D) buf.getGraphics();\n g2d.setRenderingHint(RenderingHints.KEY_INT... |
Clears out the statement handles.
@param internalClose if true, close the inner statement handle too. | [
"protected void clearStatementCaches(boolean internalClose) {\r\n\r\n\t\tif (this.statementCachingEnabled){ // safety\r\n\r\n\t\t\tif (internalClose){\r\n\t\t\t\tthis.callableStatementCache.clear();\r\n\t\t\t\tthis.preparedStatementCache.clear();\r\n\t\t\t} else {\r\n\t\t\t\tif (this.pool.closeConnectionWatch){ // ... | [
"public ParallelTaskBuilder prepareTcp(String command) {\n reinitIfClosed();\n ParallelTaskBuilder cb = new ParallelTaskBuilder();\n cb.setProtocol(RequestProtocol.TCP);\n cb.getTcpMeta().setCommand(command);\n return cb;\n }",
"public static final void setPosition(UIObject o... |
if you don't have an argument, choose the value that is going to be inserted into the map instead
@param commandLineOption specification of the command line options
@param value the value that is going to be inserted into the map instead of the argument | [
"public ConfigOptionBuilder setCommandLineOptionWithoutArgument( CommandLineOption commandLineOption, Object value ) {\n co.setCommandLineOption( commandLineOption );\n co.setValue( value );\n return this;\n }"
] | [
"private void readProjectExtendedAttributes(Project project)\n {\n Project.ExtendedAttributes attributes = project.getExtendedAttributes();\n if (attributes != null)\n {\n for (Project.ExtendedAttributes.ExtendedAttribute ea : attributes.getExtendedAttribute())\n {\n read... |
Allows the closure to be called for NullObject
@param closure the closure to call on the object
@return result of calling the closure | [
"public <T> T with( Closure<T> closure ) {\n return DefaultGroovyMethods.with( null, closure ) ;\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... |
Calculates the next snapshot version based on the current release version
@param fromVersion The version to bump to next development version
@return The next calculated development (snapshot) version | [
"protected String calculateNextVersion(String fromVersion) {\n // first turn it to release version\n fromVersion = calculateReleaseVersion(fromVersion);\n String nextVersion;\n int lastDotIndex = fromVersion.lastIndexOf('.');\n try {\n if (lastDotIndex != -1) {\n ... | [
"public void addSource(GVRAudioSource audioSource)\n {\n synchronized (mAudioSources)\n {\n if (!mAudioSources.contains(audioSource))\n {\n audioSource.setListener(this);\n mAudioSources.add(audioSource);\n }\n }\n }",
"publ... |
Checks whether a property can be added to a Properties.
@param typeManager
@param properties the properties object
@param typeId the type id
@param filter the property filter
@param id the property id
@return true if the property should be added | [
"public static boolean checkAddProperty(\r\n CmsCmisTypeManager typeManager,\r\n Properties properties,\r\n String typeId,\r\n Set<String> filter,\r\n String id) {\r\n\r\n if ((properties == null) || (properties.getProperties() == null)) {\r\n throw new IllegalAr... | [
"public void seekToSeasonYear(String seasonString, String yearString) {\n Season season = Season.valueOf(seasonString);\n assert(season != null);\n \n seekToIcsEventYear(SEASON_ICS_FILE, yearString, season.getSummary());\n }",
"@PostConstruct\n public final void init() throws URISyntaxException {\... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.