idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
317,505 | public int numDecodings(String s) {<NEW_LINE>if (s.length() == 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>int[] dp = new int[s.length() + 1];<NEW_LINE>dp[0] = 1;<NEW_LINE>dp[1] = s.charAt(0) == '0' ? 0 : 1;<NEW_LINE>for (int i = 2; i <= s.length(); i++) {<NEW_LINE>int first = Integer.valueOf(s.substring(i - 1, i));<NEW_LINE>int second = Integer.valueOf(s.substring(i - 2, i));<NEW_LINE>if (first >= 1 && first <= 9) {<NEW_LINE>dp[i] += dp[i - 1];<NEW_LINE>}<NEW_LINE>if (second >= 10 && second <= 26) {<NEW_LINE>dp[i<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dp[s.length()];<NEW_LINE>} | ] += dp[i - 2]; |
729,042 | public void closeTag(String elementName) {<NEW_LINE>int n = openElementStack.size();<NEW_LINE>for (int i = n; i > 0; ) {<NEW_LINE>i -= 2;<NEW_LINE>String openElementName = openElementStack.get(i);<NEW_LINE>if (elementName.equals(openElementName)) {<NEW_LINE>for (int j = n - 1; j > i; j -= 2) {<NEW_LINE>String tagNameToClose = openElementStack.get(j);<NEW_LINE>if (tagNameToClose != null) {<NEW_LINE>out.closeTag(tagNameToClose);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>openElementStack.subList(i, n).clear();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>skipText = false;<NEW_LINE>for (int i = openElementStack.size() - 1; i >= 0; i -= 2) {<NEW_LINE>String adjustedName = openElementStack.get(i);<NEW_LINE>if (adjustedName != null) {<NEW_LINE>skipText = !<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (allowedTextContainers.contains(adjustedName)); |
1,506,499 | private void putTransform(Request request, ActionListener<AcknowledgedResponse> listener) {<NEW_LINE>final TransformConfig config = request.getConfig();<NEW_LINE>// create the function for validation<NEW_LINE>final Function function = FunctionFactory.create(config);<NEW_LINE>// <2> Return to the listener<NEW_LINE>ActionListener<Boolean> putTransformConfigurationListener = ActionListener.wrap(putTransformConfigurationResult -> {<NEW_LINE>logger.debug("[{}] created transform", config.getId());<NEW_LINE>auditor.info(<MASK><NEW_LINE>List<String> warnings = TransformConfigLinter.getWarnings(function, config.getSource(), config.getSyncConfig());<NEW_LINE>for (String warning : warnings) {<NEW_LINE>logger.warn(new ParameterizedMessage("[{}] {}", config.getId(), warning));<NEW_LINE>auditor.warning(config.getId(), warning);<NEW_LINE>}<NEW_LINE>listener.onResponse(AcknowledgedResponse.TRUE);<NEW_LINE>}, listener::onFailure);<NEW_LINE>// <1> Put our transform<NEW_LINE>transformConfigManager.putTransformConfiguration(config, putTransformConfigurationListener);<NEW_LINE>} | config.getId(), "Created transform."); |
745,917 | protected void removeNode(final NodeType node) {<NEW_LINE>if (node.getNode().getGraph() == null) {<NEW_LINE>m_graph.reInsertNode(node.getNode());<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final Node n = node.getNode();<NEW_LINE>if (manager.isNormalNode(n)) {<NEW_LINE>m_graph.removeNode(node.getNode());<NEW_LINE>} else if (getGraph().getHierarchyManager().isFolderNode(node.getNode())) {<NEW_LINE>GroupHelpers.extractFolder(m_graph, node.getNode());<NEW_LINE>m_graph.removeNode(node.getNode());<NEW_LINE>} else if (getGraph().getHierarchyManager().isGroupNode(node.getNode())) {<NEW_LINE>GroupHelpers.extractGroup(m_graph, node.getNode());<NEW_LINE>m_graph.removeNode(node.getNode());<NEW_LINE>}<NEW_LINE>m_mappings.removeNode(node);<NEW_LINE>} | HierarchyManager manager = m_graph.getHierarchyManager(); |
1,739,419 | public ValueMatcher makeMatcher(final ColumnSelectorFactory factory) {<NEW_LINE>final ColumnValueSelector<ExprEval> selector = ExpressionSelectors.makeExprEvalSelector(<MASK><NEW_LINE>return new ValueMatcher() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean matches() {<NEW_LINE>final ExprEval eval = selector.getObject();<NEW_LINE>if (eval.type().isArray()) {<NEW_LINE>switch(eval.elementType().getType()) {<NEW_LINE>case LONG:<NEW_LINE>final Long[] lResult = eval.asLongArray();<NEW_LINE>if (lResult == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return Arrays.stream(lResult).filter(Objects::nonNull).anyMatch(Evals::asBoolean);<NEW_LINE>case STRING:<NEW_LINE>final String[] sResult = eval.asStringArray();<NEW_LINE>if (sResult == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return Arrays.stream(sResult).anyMatch(Evals::asBoolean);<NEW_LINE>case DOUBLE:<NEW_LINE>final Double[] dResult = eval.asDoubleArray();<NEW_LINE>if (dResult == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return Arrays.stream(dResult).filter(Objects::nonNull).anyMatch(Evals::asBoolean);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return eval.asBoolean();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void inspectRuntimeShape(final RuntimeShapeInspector inspector) {<NEW_LINE>inspector.visit("selector", selector);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | factory, expr.get()); |
1,045,283 | protected <T> T valueForMember(final String name, final Member injectionTarget, final Class<T> injectionType, final Channel channel) throws BeansException {<NEW_LINE>if (Channel.class.equals(injectionType)) {<NEW_LINE>return injectionType.cast(channel);<NEW_LINE>} else if (AbstractStub.class.isAssignableFrom(injectionType)) {<NEW_LINE>// Eclipse incorrectly marks this as not required<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>AbstractStub<?> stub = createStub((Class<? extends AbstractStub<?>>) injectionType.asSubclass(AbstractStub.class), channel);<NEW_LINE>for (final StubTransformer stubTransformer : getStubTransformers()) {<NEW_LINE>stub = <MASK><NEW_LINE>}<NEW_LINE>return injectionType.cast(stub);<NEW_LINE>} else {<NEW_LINE>if (injectionTarget != null) {<NEW_LINE>throw new InvalidPropertyException(injectionTarget.getDeclaringClass(), injectionTarget.getName(), "Unsupported type " + injectionType.getName());<NEW_LINE>} else {<NEW_LINE>throw new BeanInstantiationException(injectionType, "Unsupported grpc stub or channel type");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | stubTransformer.transform(name, stub); |
568,574 | public void loadPerfectArticles() {<NEW_LINE>final <MASK><NEW_LINE>final ArticleRepository articleRepository = beanManager.getReference(ArticleRepository.class);<NEW_LINE>final ArticleQueryService articleQueryService = beanManager.getReference(ArticleQueryService.class);<NEW_LINE>Stopwatchs.start("Query perfect articles");<NEW_LINE>try {<NEW_LINE>final Query query = new Query().addSort(Keys.OBJECT_ID, SortDirection.DESCENDING).setPageCount(1).setPage(1, 36);<NEW_LINE>query.setFilter(CompositeFilterOperator.and(new PropertyFilter(Article.ARTICLE_PERFECT, FilterOperator.EQUAL, Article.ARTICLE_PERFECT_C_PERFECT), new PropertyFilter(Article.ARTICLE_SHOW_IN_LIST, FilterOperator.NOT_EQUAL, Article.ARTICLE_SHOW_IN_LIST_C_NOT)));<NEW_LINE>query.select(Keys.OBJECT_ID, Article.ARTICLE_STICK, Article.ARTICLE_CREATE_TIME, Article.ARTICLE_UPDATE_TIME, Article.ARTICLE_LATEST_CMT_TIME, Article.ARTICLE_AUTHOR_ID, Article.ARTICLE_TITLE, Article.ARTICLE_STATUS, Article.ARTICLE_VIEW_CNT, Article.ARTICLE_TYPE, Article.ARTICLE_PERMALINK, Article.ARTICLE_TAGS, Article.ARTICLE_LATEST_CMTER_NAME, Article.ARTICLE_COMMENT_CNT, Article.ARTICLE_ANONYMOUS, Article.ARTICLE_PERFECT, Article.ARTICLE_QNA_OFFER_POINT, Article.ARTICLE_SHOW_IN_LIST);<NEW_LINE>final JSONObject result = articleRepository.get(query);<NEW_LINE>final List<JSONObject> articles = (List<JSONObject>) result.opt(Keys.RESULTS);<NEW_LINE>articleQueryService.organizeArticles(articles);<NEW_LINE>PERFECT_ARTICLES.clear();<NEW_LINE>PERFECT_ARTICLES.addAll(articles);<NEW_LINE>} catch (final RepositoryException e) {<NEW_LINE>LOGGER.log(Level.ERROR, "Loads perfect articles failed", e);<NEW_LINE>} finally {<NEW_LINE>Stopwatchs.end();<NEW_LINE>}<NEW_LINE>} | BeanManager beanManager = BeanManager.getInstance(); |
1,122,169 | private boolean shouldRun(TestDescriptor descriptor, boolean checkingParent) {<NEW_LINE>Optional<TestSource> source = descriptor.getSource();<NEW_LINE>if (!source.isPresent()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (source.get() instanceof MethodSource) {<NEW_LINE>MethodSource methodSource = (MethodSource) source.get();<NEW_LINE>return matcher.matchesTest(methodSource.getClassName(), methodSource.getMethodName()) || matchesParentMethod(descriptor, methodSource.getMethodName());<NEW_LINE>} else if (source.get() instanceof ClassSource) {<NEW_LINE>if (!checkingParent) {<NEW_LINE>for (TestDescriptor child : descriptor.getChildren()) {<NEW_LINE>if (shouldRun(child)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (descriptor.getChildren().isEmpty()) {<NEW_LINE>String className = ((ClassSource) source.get()).getClassName();<NEW_LINE>return matcher.matchesTest(className, null) || matcher.matchesTest(<MASK><NEW_LINE>} else {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return descriptor.getParent().isPresent() && shouldRun(descriptor.getParent().get(), true);<NEW_LINE>}<NEW_LINE>} | className, descriptor.getLegacyReportingName()); |
1,415,600 | public ProcessContext<CartOperationRequest> execute(ProcessContext<CartOperationRequest> context) throws Exception {<NEW_LINE>CartOperationRequest request = context.getSeedData();<NEW_LINE>OrderItemRequestDTO orderItemRequestDTO = request.getItemRequest();<NEW_LINE>if (orderItemRequestDTO instanceof NonDiscreteOrderItemRequestDTO) {<NEW_LINE>return context;<NEW_LINE>}<NEW_LINE>// No order item, this must be a new item add request<NEW_LINE>Long skuId = request.getItemRequest().getSkuId();<NEW_LINE>Sku sku = catalogService.findSkuById(skuId);<NEW_LINE>Order order = context.getSeedData().getOrder();<NEW_LINE>Integer requestedQuantity = request.getItemRequest().getQuantity();<NEW_LINE>Map<Sku, Integer> skuItems = new HashMap<>();<NEW_LINE>for (OrderItem orderItem : order.getOrderItems()) {<NEW_LINE>Sku skuFromOrder = null;<NEW_LINE>if (orderItem instanceof DiscreteOrderItem) {<NEW_LINE>skuFromOrder = ((DiscreteOrderItem) orderItem).getSku();<NEW_LINE>} else if (orderItem instanceof BundleOrderItem) {<NEW_LINE>skuFromOrder = ((BundleOrderItem) orderItem).getSku();<NEW_LINE>}<NEW_LINE>if (skuFromOrder != null && skuFromOrder.equals(sku)) {<NEW_LINE>skuItems.merge(sku, orderItem.getQuantity(), (oldVal, newVal) -> oldVal + newVal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>skuItems.merge(sku, requestedQuantity, (oldVal, newVal) -> oldVal + newVal);<NEW_LINE>for (Map.Entry<Sku, Integer> entry : skuItems.entrySet()) {<NEW_LINE>checkSkuAvailability(order, entry.getKey(<MASK><NEW_LINE>}<NEW_LINE>return context;<NEW_LINE>} | ), entry.getValue()); |
532,020 | private void runWithSequentialProfiler(Policy policy) {<NEW_LINE>final Timer timer = (TIME_IN_NANOSECONDS) ? new <MASK><NEW_LINE>int numDevices = getTornadoRuntime().getDriver(DEFAULT_DRIVER_INDEX).getDeviceCount();<NEW_LINE>final int totalTornadoDevices = numDevices + 1;<NEW_LINE>long[] totalTimers = new long[totalTornadoDevices];<NEW_LINE>// Run Sequential<NEW_LINE>runSequentialTaskSchedule(policy, timer, totalTimers, numDevices);<NEW_LINE>// Run Task Schedules on the accelerator<NEW_LINE>runAllTaskSchedulesInAcceleratorsSequentually(numDevices, timer, policy, totalTimers);<NEW_LINE>if (policy == Policy.PERFORMANCE || policy == Policy.END_2_END) {<NEW_LINE>int deviceWinnerIndex = synchronizeWithPolicy(policy, totalTimers);<NEW_LINE>policyTimeTable.put(policy, deviceWinnerIndex);<NEW_LINE>updateHistoryTables(policy, deviceWinnerIndex);<NEW_LINE>if (TornadoOptions.DEBUG_POLICY) {<NEW_LINE>System.out.println(getListDevices());<NEW_LINE>System.out.println("BEST Position: #" + deviceWinnerIndex + " " + Arrays.toString(totalTimers));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | NanoSecTimer() : new MilliSecTimer(); |
1,767,156 | private void startProcess(int segmentIndex) throws IOException {<NEW_LINE>String[] size = StringUtils.split(this.sessionKey.getSize(), "x");<NEW_LINE>VideoTranscodingSettings vts = new VideoTranscodingSettings(Integer.valueOf(size[0]), Integer.valueOf(size[1]), segmentIndex * this.sessionKey.getDuration(), this.sessionKey.getDuration(), (this.sessionKey.getAudioTrack() == null) ? 1 : this.sessionKey.getAudioTrack(), segmentIndex, getDirectory().resolve("%d.ts").toString(), getDirectory().resolve("out.m3u8").toString());<NEW_LINE>TranscodingService.Parameters parameters = transcodingService.getParameters(mediaFile, null, this.sessionKey.getMaxBitRate(), "ts", vts);<NEW_LINE>TranscodeInputStream in = (TranscodeInputStream) transcodingService.getTranscodedInputStream(parameters);<NEW_LINE>process = in.getProcess();<NEW_LINE>(new InputStreamReaderThread(process.getInputStream(), getClass().getSimpleName()<MASK><NEW_LINE>} | , true)).start(); |
645,121 | public void putValue(CellReference cellReference, CacheValue value) {<NEW_LINE>values.with(map -> map.put(cellReference, CacheEntry.unlocked(value), (oldValue, newValue) -> {<NEW_LINE>Preconditions.checkState(oldValue.status().isUnlocked() && oldValue.equals(newValue), "Trying to cache a value which is either locked or is not equal to a currently cached value", UnsafeArg.of("table", cellReference.tableRef()), UnsafeArg.of("cell", cellReference.cell()), UnsafeArg.of("oldValue", oldValue), UnsafeArg.of("newValue", newValue));<NEW_LINE>metrics.decreaseCacheSize(EntryWeigher.INSTANCE.weigh(cellReference, oldValue.value<MASK><NEW_LINE>return newValue;<NEW_LINE>}));<NEW_LINE>loadedValues.put(cellReference, value.size());<NEW_LINE>metrics.increaseCacheSize(EntryWeigher.INSTANCE.weigh(cellReference, value.size()));<NEW_LINE>} | ().size())); |
883,489 | // safe because it's a constructor of the typeLiteral<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>static <T> Constructor<? extends T> findThrowingConstructor(TypeLiteral<? extends T> typeLiteral, Binder binder) {<NEW_LINE>Class<?> rawType = typeLiteral.getRawType();<NEW_LINE>Errors errors = new Errors(rawType);<NEW_LINE>Constructor<?> cxtor = null;<NEW_LINE>for (Constructor<?> constructor : rawType.getDeclaredConstructors()) {<NEW_LINE>if (constructor.isAnnotationPresent(ThrowingInject.class)) {<NEW_LINE>if (cxtor != null) {<NEW_LINE>errors.addMessage("%s has more than one constructor annotated with @ThrowingInject. " + CONSTRUCTOR_RULES, rawType);<NEW_LINE>}<NEW_LINE>cxtor = constructor;<NEW_LINE>Annotation misplacedBindingAnnotation = Annotations.findBindingAnnotation(errors, cxtor, ((AnnotatedElement) cxtor).getAnnotations());<NEW_LINE>if (misplacedBindingAnnotation != null) {<NEW_LINE>errors.misplacedBindingAnnotation(cxtor, misplacedBindingAnnotation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cxtor == null) {<NEW_LINE>errors.addMessage("Could not find a suitable constructor in %s. " + CONSTRUCTOR_RULES, rawType);<NEW_LINE>}<NEW_LINE>for (Message msg : errors.getMessages()) {<NEW_LINE>binder.addError(msg);<NEW_LINE>}<NEW_LINE>return (<MASK><NEW_LINE>} | Constructor<? extends T>) cxtor; |
54,650 | public void deserialize(Message<RowData> message, Collector<RowData> collector) throws IOException {<NEW_LINE>// shortcut in case no output projection is required,<NEW_LINE>// also not for a cartesian product with the keys<NEW_LINE>if (keyDeserialization == null && !hasMetadata) {<NEW_LINE>valueDeserialization.deserialize(<MASK><NEW_LINE>if (sourceMetricData != null) {<NEW_LINE>sourceMetricData.getNumRecordsIn().inc(1L);<NEW_LINE>sourceMetricData.getNumBytesIn().inc(message.getData().length);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BufferingCollector keyCollector = new BufferingCollector();<NEW_LINE>// buffer key(s)<NEW_LINE>if (keyDeserialization != null) {<NEW_LINE>keyDeserialization.deserialize(message.getKeyBytes(), keyCollector);<NEW_LINE>}<NEW_LINE>// project output while emitting values<NEW_LINE>outputCollector.inputMessage = message;<NEW_LINE>outputCollector.physicalKeyRows = keyCollector.buffer;<NEW_LINE>outputCollector.outputCollector = collector;<NEW_LINE>if ((message.getData() == null || message.getData().length == 0) && upsertMode) {<NEW_LINE>// collect tombstone messages in upsert mode by hand<NEW_LINE>outputCollector.collect(null);<NEW_LINE>} else {<NEW_LINE>valueDeserialization.deserialize(message.getData(), outputCollector);<NEW_LINE>if (sourceMetricData != null) {<NEW_LINE>sourceMetricData.getNumRecordsIn().inc(1L);<NEW_LINE>sourceMetricData.getNumBytesIn().inc(message.getData().length);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>keyCollector.buffer.clear();<NEW_LINE>} | message.getData(), collector); |
919,812 | private boolean verifyGoogDefine(Node callNode) {<NEW_LINE>this.knownGoogDefineCalls.add(callNode);<NEW_LINE>Node parent = callNode.getParent();<NEW_LINE>Node methodName = callNode.getFirstChild();<NEW_LINE>Node args = callNode.getSecondChild();<NEW_LINE>// Calls to goog.define must be in the global hoist scope after module rewriting<NEW_LINE>if (NodeUtil.getEnclosingFunction(callNode) != null) {<NEW_LINE>compiler.report(JSError.make(methodName.getParent(), INVALID_CLOSURE_CALL_SCOPE_ERROR));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// It is an error for goog.define to show up anywhere except immediately after =.<NEW_LINE>if (parent.isAssign() && parent.getParent().isExprResult()) {<NEW_LINE>parent = parent.getParent();<NEW_LINE>} else if (parent.isName() && NodeUtil.isNameDeclaration(parent.getParent())) {<NEW_LINE>parent = parent.getParent();<NEW_LINE>} else {<NEW_LINE>compiler.report(JSError.make(methodName<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Verify first arg<NEW_LINE>Node arg = args;<NEW_LINE>if (!verifyNotNull(methodName, arg) || !verifyOfType(methodName, arg, Token.STRINGLIT)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Verify second arg<NEW_LINE>arg = arg.getNext();<NEW_LINE>if (!args.isFromExterns() && (!verifyNotNull(methodName, arg) || !verifyIsLast(methodName, arg))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String name = args.getString();<NEW_LINE>if (!NodeUtil.isValidQualifiedName(compiler.getOptions().getLanguageIn().toFeatureSet(), name)) {<NEW_LINE>compiler.report(JSError.make(args, INVALID_DEFINE_NAME_ERROR, name));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>JSDocInfo info = (parent.isExprResult() ? parent.getFirstChild() : parent).getJSDocInfo();<NEW_LINE>if (info == null || !info.isDefine()) {<NEW_LINE>compiler.report(JSError.make(parent, MISSING_DEFINE_ANNOTATION));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .getParent(), DEFINE_CALL_WITHOUT_ASSIGNMENT)); |
320,615 | // Overridden: different delays for filtered cards.<NEW_LINE>@NonNull<NEW_LINE>protected JSONObject _lapseConf(@NonNull Card card) {<NEW_LINE>DeckConfig conf = _cardConf(card);<NEW_LINE>if (!card.isInDynamicDeck()) {<NEW_LINE>return conf.getJSONObject("lapse");<NEW_LINE>}<NEW_LINE>// dynamic deck; override some attributes, use original deck for others<NEW_LINE>DeckConfig oconf = mCol.getDecks().confForDid(card.getODid());<NEW_LINE>JSONObject dict = new JSONObject();<NEW_LINE>// original deck<NEW_LINE>dict.put("minInt", oconf.getJSONObject("lapse").getInt("minInt"));<NEW_LINE>dict.put("leechFails", oconf.getJSONObject("lapse").getInt("leechFails"));<NEW_LINE>dict.put("leechAction", oconf.getJSONObject("lapse").getInt("leechAction"));<NEW_LINE>dict.put("mult", oconf.getJSONObject("lapse").getDouble("mult"));<NEW_LINE>dict.put("delays", oconf.getJSONObject(<MASK><NEW_LINE>// overrides<NEW_LINE>dict.put("resched", conf.getBoolean("resched"));<NEW_LINE>return dict;<NEW_LINE>} | "lapse").getJSONArray("delays")); |
569,778 | private List<Map<String, Integer>> crossedPoints(final Zone zone, final Token tokenInContext, final String pointsString, final List<Map<String, Integer>> pathPoints) {<NEW_LINE>List<Map<String, Integer>> returnPoints = new ArrayList<Map<String, Integer>>();<NEW_LINE>List<Map<String, Integer>> targetPoints = convertJSONStringToList(pointsString);<NEW_LINE>if (pathPoints == null) {<NEW_LINE>return returnPoints;<NEW_LINE>}<NEW_LINE>for (Map<String, Integer> entry : pathPoints) {<NEW_LINE>Map<String, Integer> thePoint = new HashMap<String, Integer>();<NEW_LINE><MASK><NEW_LINE>Rectangle originalArea = null;<NEW_LINE>Polygon targetArea = new Polygon();<NEW_LINE>for (Map<String, Integer> points : targetPoints) {<NEW_LINE>int x = points.get("x");<NEW_LINE>int y = points.get("y");<NEW_LINE>targetArea.addPoint(x, y);<NEW_LINE>}<NEW_LINE>if (tokenInContext.isSnapToGrid()) {<NEW_LINE>originalArea = tokenInContext.getFootprint(grid).getBounds(grid, grid.convert(new ZonePoint(entry.get("x"), entry.get("y"))));<NEW_LINE>} else {<NEW_LINE>originalArea = tokenInContext.getBounds(zone);<NEW_LINE>}<NEW_LINE>Rectangle2D oa = originalArea.getBounds2D();<NEW_LINE>if (targetArea.contains(oa) || targetArea.intersects(oa)) {<NEW_LINE>thePoint.put("x", entry.get("x"));<NEW_LINE>thePoint.put("y", entry.get("y"));<NEW_LINE>returnPoints.add(thePoint);<NEW_LINE>}<NEW_LINE>thePoint = null;<NEW_LINE>}<NEW_LINE>return returnPoints;<NEW_LINE>} | Grid grid = zone.getGrid(); |
1,245,859 | public List<HotPictureInfo> listForPage(String application, String infoId, String title, Integer first, Integer selectTotal) throws Exception {<NEW_LINE>EntityManager em = this.entityManagerContainer().get(HotPictureInfo.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<HotPictureInfo> cq = cb.createQuery(HotPictureInfo.class);<NEW_LINE>Root<HotPictureInfo> root = cq.from(HotPictureInfo.class);<NEW_LINE>Predicate p = cb.isNotNull(root.get(HotPictureInfo_.id));<NEW_LINE>if (application != null && !application.isEmpty()) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(HotPictureInfo_.application), application));<NEW_LINE>}<NEW_LINE>if (infoId != null && !infoId.isEmpty()) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(HotPictureInfo_.infoId), infoId));<NEW_LINE>}<NEW_LINE>if (title != null && !title.isEmpty()) {<NEW_LINE>p = cb.and(p, cb.like(root.get(HotPictureInfo_.title)<MASK><NEW_LINE>}<NEW_LINE>cq.orderBy(cb.desc(root.get(HotPictureInfo_.sequence)));<NEW_LINE>return em.createQuery(cq.where(p)).setFirstResult(first).setMaxResults(selectTotal).getResultList();<NEW_LINE>} | , "%" + title + "%")); |
1,600,701 | public void replaceMapLinksForDeletedSourceNode(MapLinks mapLinks, final NodeModel deletionRoot, NodeModel node) {<NEW_LINE>final ListIterator<NodeLinkModel<MASK><NEW_LINE>LINKS: while (linkIterator.hasNext()) {<NEW_LINE>NodeLinkModel link = linkIterator.next();<NEW_LINE>final NodeModel linkSource = link.getSource();<NEW_LINE>if (linkSource.equals(node)) {<NEW_LINE>mapLinks.remove(link);<NEW_LINE>for (NodeModel newSource : node.subtreeClones()) {<NEW_LINE>if (node != newSource && !newSource.isDescendantOf(deletionRoot)) {<NEW_LINE>final NodeLinkModel cloneForSource = link.cloneForSource(newSource);<NEW_LINE>if (cloneForSource != null) {<NEW_LINE>linkIterator.remove();<NEW_LINE>linkIterator.add(cloneForSource);<NEW_LINE>mapLinks.add(cloneForSource);<NEW_LINE>continue LINKS;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > linkIterator = links.listIterator(); |
1,086,831 | protected Property convertSimpleRuleToJson(MVELToDataWrapperTranslator translator, ObjectMapper mapper, SimpleRule simpleRule, String jsonProp, String fieldService) {<NEW_LINE>String matchRule = simpleRule.getMatchRule();<NEW_LINE>Entity[] matchCriteria = new Entity[1];<NEW_LINE>Property[] properties = new Property[3];<NEW_LINE>Property mvelProperty = new Property();<NEW_LINE>mvelProperty.setName("matchRule");<NEW_LINE>mvelProperty.setValue(matchRule == null ? "" : matchRule);<NEW_LINE>properties[0] = mvelProperty;<NEW_LINE>Entity criteria = new Entity();<NEW_LINE>criteria.setProperties(properties);<NEW_LINE>matchCriteria[0] = criteria;<NEW_LINE>EntityManager em = PersistenceManagerFactory.getDefaultPersistenceManager().getDynamicEntityDao().getStandardEntityManager();<NEW_LINE>Long <MASK><NEW_LINE>Property idProperty = new Property();<NEW_LINE>idProperty.setName("id");<NEW_LINE>idProperty.setValue(String.valueOf(id));<NEW_LINE>properties[1] = idProperty;<NEW_LINE>Long containedId = getContainedRuleId(simpleRule, em);<NEW_LINE>Property containedIdProperty = new Property();<NEW_LINE>containedIdProperty.setName("containedId");<NEW_LINE>containedIdProperty.setValue(String.valueOf(containedId));<NEW_LINE>properties[2] = containedIdProperty;<NEW_LINE>String json;<NEW_LINE>try {<NEW_LINE>DataWrapper orderWrapper = translator.createRuleData(matchCriteria, "matchRule", null, "id", "containedId", ruleBuilderFieldServiceFactory.createInstance(fieldService));<NEW_LINE>json = mapper.writeValueAsString(orderWrapper);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>Property p = new Property();<NEW_LINE>p.setName(jsonProp);<NEW_LINE>p.setValue(json);<NEW_LINE>return p;<NEW_LINE>} | id = getRuleId(simpleRule, em); |
161,235 | final PutInsightSelectorsResult executePutInsightSelectors(PutInsightSelectorsRequest putInsightSelectorsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putInsightSelectorsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutInsightSelectorsRequest> request = null;<NEW_LINE>Response<PutInsightSelectorsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutInsightSelectorsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putInsightSelectorsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudTrail");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutInsightSelectorsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutInsightSelectorsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutInsightSelectors"); |
465,154 | void paintDragFeedback(Graphics2D g) {<NEW_LINE>Stroke oldStroke = g.getStroke();<NEW_LINE>g.setStroke(dashedStroke1);<NEW_LINE>Color oldColor = g.getColor();<NEW_LINE>g.setColor(FormLoaderSettings.getInstance().getSelectionBorderColor());<NEW_LINE>List<LayoutConstraints> constraints = new ArrayList<LayoutConstraints>(selectedComponents.length);<NEW_LINE>List<Integer> indices = new ArrayList<Integer>(selectedComponents.length);<NEW_LINE>boolean constraintsOK = computeConstraints(mousePosition, constraints, indices);<NEW_LINE>Point contPos = null;<NEW_LINE>LayoutSupportManager layoutSupport = null;<NEW_LINE>if (constraintsOK) {<NEW_LINE>contPos = SwingUtilities.convertPoint(<MASK><NEW_LINE>layoutSupport = targetMetaContainer.getLayoutSupport();<NEW_LINE>if (resizeType == 0)<NEW_LINE>paintTargetContainerFeedback(g, targetContainerDel);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < selectedComponents.length; i++) {<NEW_LINE>RADVisualComponent metacomp = selectedComponents[i];<NEW_LINE>boolean drawn = false;<NEW_LINE>if (constraintsOK) {<NEW_LINE>Component comp = (Component) formDesigner.getComponent(metacomp);<NEW_LINE>LayoutConstraints constr = constraints.get(i);<NEW_LINE>int index = indices.get(i);<NEW_LINE>if (constr != null || index >= 0) {<NEW_LINE>g.translate(contPos.x, contPos.y);<NEW_LINE>drawn = layoutSupport.paintDragFeedback(targetContainer, targetContainerDel, comp, constr, index, g);<NEW_LINE>g.translate(-contPos.x, -contPos.y);<NEW_LINE>}<NEW_LINE>// else continue;<NEW_LINE>}<NEW_LINE>if (!drawn)<NEW_LINE>paintDragFeedback(g, metacomp);<NEW_LINE>}<NEW_LINE>g.setColor(oldColor);<NEW_LINE>g.setStroke(oldStroke);<NEW_LINE>} | targetContainerDel, 0, 0, handleLayer); |
865,190 | private static void try3TableJoin(RegressionEnvironment env) {<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "E1"));<NEW_LINE>env.sendEventBean(new SupportBean_S1(2, "E1"));<NEW_LINE>env.sendEventBean(new SupportBean_S2(3, "E1"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportBean_S1(20, "E2"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(10, "E2"));<NEW_LINE>env.sendEventBean(new SupportBean_S2(30, "E2"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportBean_S2(300, "E3"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(100, "E3"));<NEW_LINE>env.sendEventBean(new SupportBean_S1(200, "E3"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(new SupportBean_S2(31, "E4"));<NEW_LINE>env.sendEventBean(new SupportBean_S1(21, "E4"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>String[] fields = "s0.id,s1.id,s2.id".split(",");<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 11, 21, 31 });<NEW_LINE>env.sendEventBean(new SupportBean_S2(32, "E4"));<NEW_LINE>env.sendEventBean(new SupportBean_S1(22, "E4"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>} | new SupportBean_S0(11, "E4")); |
1,835,219 | public List<SocketObjectData> retrieveSocket(int objHash, int serverId) {<NEW_LINE>List<SocketObjectData> list = new ArrayList<>();<NEW_LINE>Server server = ServerManager.getInstance().getServerIfNullDefault(serverId);<NEW_LINE>try (TcpProxy tcp = TcpProxy.getTcpProxy(server)) {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put(ParamConstant.OBJ_HASH, objHash);<NEW_LINE>MapPack m = (MapPack) tcp.getSingle(RequestCmd.OBJECT_SOCKET, param);<NEW_LINE>ListValue keyLv = m.getList("key");<NEW_LINE>ListValue hostLv = m.getList("host");<NEW_LINE>ListValue portLv = m.getList("port");<NEW_LINE>ListValue countLv = m.getList("count");<NEW_LINE>ListValue serviceLv = m.getList("service");<NEW_LINE>ListValue txidLv = m.getList("txid");<NEW_LINE>ListValue orderLv = m.getList("order");<NEW_LINE>ListValue stackLv = m.getList("stack");<NEW_LINE>for (int i = 0; i < keyLv.size(); i++) {<NEW_LINE>SocketObjectData socketObj = new SocketObjectData();<NEW_LINE>socketObj.key = keyLv.getLong(i);<NEW_LINE>socketObj.host = IPUtil.toString(((BlobValue) hostLv.get(i)).value);<NEW_LINE>socketObj.port = portLv.getInt(i);<NEW_LINE>socketObj.<MASK><NEW_LINE>socketObj.service = TextProxy.service.getTextIfNullDefault(Long.parseLong(DateUtil.yyyymmdd()), serviceLv.getInt(i), serverId);<NEW_LINE>socketObj.txid = txidLv.getLong(i);<NEW_LINE>socketObj.standby = orderLv.getBoolean(i);<NEW_LINE>socketObj.stack = stackLv.getString(i);<NEW_LINE>list.add(socketObj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | count = countLv.getInt(i); |
879,249 | public Pack read(DataInputX din) throws IOException {<NEW_LINE>this.gxid = din.readLong();<NEW_LINE>this.txid = din.readLong();<NEW_LINE>this.caller = din.readLong();<NEW_LINE>this.timestamp = din.readLong();<NEW_LINE>this.elapsed = (int) din.readDecimal();<NEW_LINE>this.spanType = din.readByte();<NEW_LINE>this.name = (int) din.readDecimal();<NEW_LINE>this.objHash = (int) din.readDecimal();<NEW_LINE>this.error = <MASK><NEW_LINE>this.localEndpointServiceName = (int) din.readDecimal();<NEW_LINE>this.localEndpointIp = din.readBlob();<NEW_LINE>this.localEndpointPort = din.readShort();<NEW_LINE>this.remoteEndpointServiceName = (int) din.readDecimal();<NEW_LINE>this.remoteEndpointIp = din.readBlob();<NEW_LINE>this.remoteEndpointPort = din.readShort();<NEW_LINE>this.debug = din.readBoolean();<NEW_LINE>this.shared = din.readBoolean();<NEW_LINE>this.annotationTimestamps = (ListValue) din.readValue();<NEW_LINE>this.annotationValues = (ListValue) din.readValue();<NEW_LINE>this.tags = (MapValue) din.readValue();<NEW_LINE>return this;<NEW_LINE>} | (int) din.readDecimal(); |
621,737 | public void testPostGetCollectionGenericEntityAndType(Map<String, String> param, StringBuilder ret) throws Exception {<NEW_LINE>String endpointAddress = getAddress("bookstore/collections");<NEW_LINE>WebClient wc = WebClient.create(endpointAddress);<NEW_LINE>wc.accept("application/xml").type("application/xml");<NEW_LINE>GenericEntity<List<Book>> collectionEntity = createGenericEntity();<NEW_LINE>final Holder<List<Book>> holder = new Holder<List<Book>>();<NEW_LINE>InvocationCallback<List<Book>> callback = new CustomInvocationCallback(holder);<NEW_LINE>Future<List<Book>> future = wc.async().post(Entity.entity<MASK><NEW_LINE>List<Book> books2 = future.get();<NEW_LINE>assertNotNull(books2);<NEW_LINE>List<Book> books = collectionEntity.getEntity();<NEW_LINE>assertNotSame(books, books2);<NEW_LINE>assertEquals(2, books2.size());<NEW_LINE>Book b11 = books.get(0);<NEW_LINE>assertEquals(123L, b11.getId());<NEW_LINE>assertEquals("CXF in Action", b11.getName());<NEW_LINE>Book b22 = books.get(1);<NEW_LINE>assertEquals(124L, b22.getId());<NEW_LINE>assertEquals("CXF Rocks", b22.getName());<NEW_LINE>assertEquals(200, wc.getResponse().getStatus());<NEW_LINE>ret.append("OK");<NEW_LINE>} | (collectionEntity, "application/xml"), callback); |
284,852 | private List<ParameterObject> createPathParameters(Context<T> context, OperationShape operation) {<NEW_LINE>List<ParameterObject> result = new ArrayList<>();<NEW_LINE>HttpBindingIndex bindingIndex = HttpBindingIndex.of(context.getModel());<NEW_LINE>HttpTrait httpTrait = operation.expectTrait(HttpTrait.class);<NEW_LINE>for (HttpBinding binding : bindingIndex.getRequestBindings(operation, HttpBinding.Location.LABEL)) {<NEW_LINE>Schema schema = createPathParameterSchema(context, binding);<NEW_LINE>String memberName = binding.getMemberName();<NEW_LINE>SmithyPattern.Segment label = httpTrait.getUri().getLabel(memberName).orElseThrow(() -> new OpenApiException(String.format("Unable to find URI label on %s for %s: %s", operation.getId(), binding.getMemberName(), httpTrait.getUri())));<NEW_LINE>// Greedy labels in OpenAPI need to include the label in the generated parameter.<NEW_LINE>// For example, given "/{foo+}", the parameter name must be "foo+".<NEW_LINE>// Some vendors/tooling, require the "+" suffix be excluded in the generated parameter.<NEW_LINE>// If required, the setRemoveGreedyParameterSuffix config option should be set to `true`.<NEW_LINE>// When this option is enabled, given "/{foo+}", the parameter name will be "foo".<NEW_LINE>String name = label.getContent();<NEW_LINE>if (label.isGreedyLabel() && !context.getConfig().getRemoveGreedyParameterSuffix()) {<NEW_LINE>name = name + "+";<NEW_LINE>}<NEW_LINE>result.add(ModelUtils.createParameterMember(context, binding.getMember()).name(name).in("path").schema<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (schema).build()); |
301,073 | private void bakeImageToMetadata(ImageInventory img) {<NEW_LINE>setAllImagesSystemTags(Collections.singletonList(img));<NEW_LINE>SimpleQuery<CephBackupStorageVO> query = dbf.createQuery(CephBackupStorageVO.class);<NEW_LINE>query.add(CephBackupStorageVO_.uuid, SimpleQuery.Op.EQ, getBackupStorageUuidFromImageInventory(img));<NEW_LINE>CephBackupStorageVO cephBackupStorageVO = query.find();<NEW_LINE>CephBackupStorageInventory inv = CephBackupStorageInventory.valueOf(cephBackupStorageVO);<NEW_LINE>BakeImageMetadataMsg msg = new BakeImageMetadataMsg();<NEW_LINE>msg.setImg(img);<NEW_LINE><MASK><NEW_LINE>msg.setBackupStorageUuid(getBackupStorageUuidFromImageInventory(img));<NEW_LINE>msg.setPoolName(inv.getPoolName());<NEW_LINE>bus.makeLocalServiceId(msg, BackupStorageConstant.SERVICE_ID);<NEW_LINE>bus.send(msg, new CloudBusCallBack(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply reply) {<NEW_LINE>if (reply.isSuccess()) {<NEW_LINE>logger.info("add image info to metadata file successfully");<NEW_LINE>} else {<NEW_LINE>logger.warn(String.format("add image info to metadata file failed, %s", reply.getError().toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | msg.setOperation(CephConstants.AFTER_ADD_IMAGE); |
229,645 | protected void loadExtension() {<NEW_LINE>// @formatter:off<NEW_LINE>EclipseUtil.processConfigurationElements(getPluginId(), getExtensionPointId(), new IConfigurationElementProcessor() {<NEW_LINE><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public void processElement(IConfigurationElement element) {<NEW_LINE>try {<NEW_LINE>Object instance = element.createExecutableExtension(getAttributeName());<NEW_LINE>// would be nice if we could test that instance is of type T<NEW_LINE>processors.add((T) instance);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>String message = // $NON-NLS-1$<NEW_LINE>MessageFormat.// $NON-NLS-1$<NEW_LINE>format("Unable to create executable extension while processing attribute {0} on element {1} for the {2} extension point in the {3} plugin", getAttributeName(), element.getName(), <MASK><NEW_LINE>IdeLog.logError(IndexUiActivator.getDefault(), message, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>public Set<String> getSupportElementNames() {<NEW_LINE>return CollectionsUtil.newSet(getElementName());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// @formatter:on<NEW_LINE>} | getExtensionPointId(), getPluginId()); |
986,961 | private void updateFunctionDef(long sourceFunctionDefDtID, FunctionDefinition sourceFunctionDefDt, FunctionDefinition destDt, Map<Long, DataType> resolvedDataTypes) {<NEW_LINE>// NOTE: it is possible for the same function def to be updated more than once;<NEW_LINE>// therefor we must cleanup any previous obsolete fixups<NEW_LINE>removeFixUps(sourceFunctionDefDtID);<NEW_LINE>long oldLastChangeTime = sourceFunctionDefDt.getLastChangeTime();<NEW_LINE><MASK><NEW_LINE>DataTypeManager sourceDTM = sourceFunctionDefDt.getDataTypeManager();<NEW_LINE>DataType sourceReturnType = sourceFunctionDefDt.getReturnType();<NEW_LINE>ParameterDefinition[] sourceVars = sourceFunctionDefDt.getArguments();<NEW_LINE>ParameterDefinition[] destVars = new ParameterDefinition[sourceVars.length];<NEW_LINE>boolean sourceHasVarArgs = sourceFunctionDefDt.hasVarArgs();<NEW_LINE>DataType resolvedRDT = DataType.DEFAULT;<NEW_LINE>if (sourceReturnType != null) {<NEW_LINE>long returnTypeID = sourceDTM.getID(sourceReturnType);<NEW_LINE>resolvedRDT = getResolvedParam(sourceFunctionDefDtID, returnTypeID, -1, resolvedDataTypes);<NEW_LINE>}<NEW_LINE>destDt.setReturnType(resolvedRDT);<NEW_LINE>for (int i = 0; i < sourceVars.length; i++) {<NEW_LINE>DataType varDt = sourceVars[i].getDataType();<NEW_LINE>long varID = sourceDTM.getID(varDt);<NEW_LINE>DataType resolvedDt = getResolvedParam(sourceFunctionDefDtID, varID, i, resolvedDataTypes);<NEW_LINE>destVars[i] = new ParameterDefinitionImpl(sourceVars[i].getName(), resolvedDt, sourceVars[i].getComment());<NEW_LINE>}<NEW_LINE>destDt.setArguments(destVars);<NEW_LINE>destDt.setVarArgs(sourceHasVarArgs);<NEW_LINE>destDt.setLastChangeTime(oldLastChangeTime);<NEW_LINE>destDt.setLastChangeTimeInSourceArchive(oldLastChangeTimeInSourceArchive);<NEW_LINE>} | long oldLastChangeTimeInSourceArchive = sourceFunctionDefDt.getLastChangeTimeInSourceArchive(); |
269,255 | // ////////////////////////////////////////////////////////////<NEW_LINE>// QUADRATIC BEZIER VERTICES<NEW_LINE>// this method is almost wholesale copied from PGraphics.quadraticVertex()<NEW_LINE>// TODO: de-duplicate this code if there is a convenient way to do so<NEW_LINE>@Override<NEW_LINE>public void quadraticVertex(float cx, float cy, float x3, float y3) {<NEW_LINE>if (useParentImpl) {<NEW_LINE>super.quadraticVertex(cx, cy, x3, y3);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// (these are the only lines that are different)<NEW_LINE>float x1 = <MASK><NEW_LINE>float y1 = shapeVerts[vertCount - 1].y;<NEW_LINE>// TODO: optimize this?<NEW_LINE>bezierVertex(x1 + ((cx - x1) * 2 / 3.0f), y1 + ((cy - y1) * 2 / 3.0f), x3 + ((cx - x3) * 2 / 3.0f), y3 + ((cy - y3) * 2 / 3.0f), x3, y3);<NEW_LINE>} | shapeVerts[vertCount - 1].x; |
249,986 | public static void makePatchable(@Nullable /*@ApkPath*/<NEW_LINE>File apk) throws IOException {<NEW_LINE>ResourceTableChunk resourceTableChunk = providesResourceTableChunk(apk);<NEW_LINE>PackageChunk packageChunk = Iterables.getOnlyElement(resourceTableChunk.getPackages());<NEW_LINE>Collection<TypeChunk> typeChunks = packageChunk.getTypeChunks();<NEW_LINE>for (TypeChunk typeChunk : typeChunks) {<NEW_LINE>int totalEntryCount = typeChunk.getTotalEntryCount();<NEW_LINE>Entry lastEntry = typeChunk.getEntries().get(totalEntryCount - 1);<NEW_LINE>for (int i = 0; i < 256; i++) {<NEW_LINE>typeChunk.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collection<TypeSpecChunk> typeSpecChunks = packageChunk.getTypeSpecChunks();<NEW_LINE>for (TypeSpecChunk typeSpecChunk : typeSpecChunks) {<NEW_LINE>for (int i = 0; i < 256; i++) {<NEW_LINE>typeSpecChunk.add(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte[] bytes = resourceTableChunk.toByteArray();<NEW_LINE>File file = new File(apk.getParentFile(), "resources.arsc" + "_tmp");<NEW_LINE>FileUtils.writeByteArrayToFile(file, bytes);<NEW_LINE>File tmpFile = new File(apk.getParentFile(), apk.getName() + "_tmp");<NEW_LINE>ZipUtils.addFileToZipFile(apk, tmpFile, file, "resources.arsc", true);<NEW_LINE>apk.delete();<NEW_LINE>tmpFile.renameTo(apk);<NEW_LINE>} | put(totalEntryCount + i, lastEntry); |
589,992 | public void heartbeat() {<NEW_LINE>AtomicInteger removedSessions = new AtomicInteger(0);<NEW_LINE>mActiveRegisterContexts.entrySet().removeIf((entry) -> {<NEW_LINE>WorkerRegisterContext context = entry.getValue();<NEW_LINE>final <MASK><NEW_LINE>final long lastActivityTime = context.getLastActivityTimeMs();<NEW_LINE>final long staleTime = clockTime - lastActivityTime;<NEW_LINE>if (staleTime < mTimeout) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String msg = String.format("ClockTime: %d, LastActivityTime: %d. Worker %d register stream hanging for %sms!" + " Tune up %s if this is undesired.", clockTime, lastActivityTime, context.mWorker.getId(), staleTime, PropertyKey.MASTER_WORKER_REGISTER_STREAM_RESPONSE_TIMEOUT);<NEW_LINE>Exception e = new TimeoutException(msg);<NEW_LINE>try {<NEW_LINE>context.closeWithError(e);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>t.addSuppressed(e);<NEW_LINE>LOG.error("Failed to close an open register stream for worker {}. " + "The stream has been open for {}ms.", context.getWorkerId(), staleTime, t);<NEW_LINE>// Do not remove the entry so this will be retried<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>removedSessions.getAndDecrement();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>if (removedSessions.get() > 0) {<NEW_LINE>LOG.info("Removed {} stale worker registration streams", removedSessions.get());<NEW_LINE>}<NEW_LINE>} | long clockTime = mClock.millis(); |
1,232,926 | private void fillScoreBoard(ScoreBoard board) {<NEW_LINE>board.total++;<NEW_LINE>if (nonSvgRoot) {<NEW_LINE>board.nonSvgRoot++;<NEW_LINE>}<NEW_LINE>if (nonNamespaceSvgRoot) {<NEW_LINE>board.nonNamespaceSvgRoot++;<NEW_LINE>}<NEW_LINE>if (otherNamespaceSvgRoot) {<NEW_LINE>board.otherNamespaceSvgRoot++;<NEW_LINE>}<NEW_LINE>if (hasFlowRoot) {<NEW_LINE>board.hasFlowRoot++;<NEW_LINE>}<NEW_LINE>if (hasDoctype) {<NEW_LINE>board.hasDoctype++;<NEW_LINE>}<NEW_LINE>if (hasInternalSubset) {<NEW_LINE>board.hasInternalSubset++;<NEW_LINE>}<NEW_LINE>if (hasMetadata) {<NEW_LINE>board.hasMetadata++;<NEW_LINE>}<NEW_LINE>if (hasStyleAttribute) {<NEW_LINE>board.hasStyleAttribute++;<NEW_LINE>}<NEW_LINE>if (hasPresentationAttributes) {<NEW_LINE>board.hasPresentationAttributes++;<NEW_LINE>}<NEW_LINE>if (hasStyleElement) {<NEW_LINE>board.hasStyleElement++;<NEW_LINE>}<NEW_LINE>if (hasDefinitionElementsOutsideDefs) {<NEW_LINE>board.hasDefinitionElementsOutsideDefs++;<NEW_LINE>}<NEW_LINE>Integer creatorCount = board.creator.get(creator);<NEW_LINE>if (creatorCount == null) {<NEW_LINE>board.creator.put(creator, 1);<NEW_LINE>} else {<NEW_LINE>board.creator.put(creator, creatorCount.intValue() + 1);<NEW_LINE>}<NEW_LINE>fillMapFromSetTriple(board.prefixedSvgElements, prefixedSvgElements);<NEW_LINE>fillMapFromSetTriple(board.foreignElementsInMetadata, foreignElementsInMetadata);<NEW_LINE>fillMapFromSetTriple(board.foreignElementsElsewhere, foreignElementsElsewhere);<NEW_LINE>fillMapFromSetTriple(board.prefixedAttributes, prefixedAttributes);<NEW_LINE>fillMapFromSetTriple(board.fontAttributes, fontAttributes);<NEW_LINE>fillMapFromSetString(board.unconventionalXLinkPrefixes, unconventionalXLinkPrefixes);<NEW_LINE>fillMapFromSetString(board.fontParent, fontParent);<NEW_LINE><MASK><NEW_LINE>fillMapFromSetString(board.requiredExtensions, requiredExtensions);<NEW_LINE>fillMapFromSetString(board.internalEntities, internalEntities);<NEW_LINE>} | fillMapFromSetString(board.piTargets, piTargets); |
1,222,433 | public ParseException generateParseException() {<NEW_LINE>jj_expentries.clear();<NEW_LINE>boolean[] la1tokens = new boolean[130];<NEW_LINE>if (jj_kind >= 0) {<NEW_LINE>la1tokens[jj_kind] = true;<NEW_LINE>jj_kind = -1;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < 49; i++) {<NEW_LINE>if (jj_la1[i] == jj_gen) {<NEW_LINE>for (int j = 0; j < 32; j++) {<NEW_LINE>if ((jj_la1_0[i] & (1 << j)) != 0) {<NEW_LINE>la1tokens[j] = true;<NEW_LINE>}<NEW_LINE>if ((jj_la1_1[i] & (1 << j)) != 0) {<NEW_LINE>la1tokens[32 + j] = true;<NEW_LINE>}<NEW_LINE>if ((jj_la1_2[i] & (1 << j)) != 0) {<NEW_LINE>la1tokens[64 + j] = true;<NEW_LINE>}<NEW_LINE>if ((jj_la1_3[i] & (1 << j)) != 0) {<NEW_LINE>la1tokens[96 + j] = true;<NEW_LINE>}<NEW_LINE>if ((jj_la1_4[i] & (1 << j)) != 0) {<NEW_LINE>la1tokens[128 + j] = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < 130; i++) {<NEW_LINE>if (la1tokens[i]) {<NEW_LINE>jj_expentry = new int[1];<NEW_LINE>jj_expentry[0] = i;<NEW_LINE>jj_expentries.add(jj_expentry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[][] exptokseq = new int[jj_expentries.size()][];<NEW_LINE>for (int i = 0; i < jj_expentries.size(); i++) {<NEW_LINE>exptokseq[i<MASK><NEW_LINE>}<NEW_LINE>return new ParseException(token, exptokseq, tokenImage);<NEW_LINE>} | ] = jj_expentries.get(i); |
607,366 | protected StoreResult storeImpl(ArtifactInfo info, Path file) throws IOException {<NEW_LINE>ImmutableStoreResult.<MASK><NEW_LINE>// Build the request, hitting the multi-key endpoint.<NEW_LINE>Request.Builder builder = new Request.Builder();<NEW_LINE>HttpArtifactCacheBinaryProtocol.StoreRequest storeRequest = new HttpArtifactCacheBinaryProtocol.StoreRequest(info, new ByteSource() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public InputStream openStream() throws IOException {<NEW_LINE>return getProjectFilesystem().newFileInputStream(file);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>resultBuilder.setRequestSizeBytes(storeRequest.getContentLength());<NEW_LINE>// Wrap the file into a `RequestBody` which uses `ProjectFilesystem`.<NEW_LINE>builder.put(new RequestBody() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public MediaType contentType() {<NEW_LINE>return OCTET_STREAM_CONTENT_TYPE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public long contentLength() {<NEW_LINE>return storeRequest.getContentLength();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void writeTo(BufferedSink bufferedSink) throws IOException {<NEW_LINE>HttpArtifactCacheBinaryProtocol.StoreWriteResult writeResult = storeRequest.write(bufferedSink.outputStream());<NEW_LINE>resultBuilder.setArtifactContentHash(writeResult.getArtifactContentHashCode().toString());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Dispatch the store operation and verify it succeeded.<NEW_LINE>try (HttpResponse response = storeClient.makeRequest("/artifacts/key", builder)) {<NEW_LINE>boolean requestFailed = response.statusCode() != HttpURLConnection.HTTP_ACCEPTED;<NEW_LINE>if (requestFailed) {<NEW_LINE>reportFailureWithFormatKey("store(%s, %s): unexpected response: [%d:%s].", response.requestUrl(), info.getRuleKeys(), response.statusCode(), response.statusMessage());<NEW_LINE>}<NEW_LINE>resultBuilder.setWasStoreSuccessful(!requestFailed);<NEW_LINE>}<NEW_LINE>return resultBuilder.build();<NEW_LINE>} | Builder resultBuilder = ImmutableStoreResult.builder(); |
458,678 | private static void initialize(TypeDataBase db) {<NEW_LINE>Type type = db.lookupType("nmethod");<NEW_LINE>methodField = type.getAddressField("_method");<NEW_LINE>entryBCIField = type.getCIntegerField("_entry_bci");<NEW_LINE>osrLinkField = type.getAddressField("_osr_link");<NEW_LINE><MASK><NEW_LINE>scavengeRootStateField = type.getJByteField("_scavenge_root_state");<NEW_LINE>exceptionOffsetField = type.getCIntegerField("_exception_offset");<NEW_LINE>deoptOffsetField = type.getCIntegerField("_deoptimize_offset");<NEW_LINE>deoptMhOffsetField = type.getCIntegerField("_deoptimize_mh_offset");<NEW_LINE>origPCOffsetField = type.getCIntegerField("_orig_pc_offset");<NEW_LINE>stubOffsetField = type.getCIntegerField("_stub_offset");<NEW_LINE>oopsOffsetField = type.getCIntegerField("_oops_offset");<NEW_LINE>metadataOffsetField = type.getCIntegerField("_metadata_offset");<NEW_LINE>scopesDataOffsetField = type.getCIntegerField("_scopes_data_offset");<NEW_LINE>scopesPCsOffsetField = type.getCIntegerField("_scopes_pcs_offset");<NEW_LINE>dependenciesOffsetField = type.getCIntegerField("_dependencies_offset");<NEW_LINE>handlerTableOffsetField = type.getCIntegerField("_handler_table_offset");<NEW_LINE>nulChkTableOffsetField = type.getCIntegerField("_nul_chk_table_offset");<NEW_LINE>nmethodEndOffsetField = type.getCIntegerField("_nmethod_end_offset");<NEW_LINE>entryPointField = type.getAddressField("_entry_point");<NEW_LINE>verifiedEntryPointField = type.getAddressField("_verified_entry_point");<NEW_LINE>osrEntryPointField = type.getAddressField("_osr_entry_point");<NEW_LINE>lockCountField = type.getJIntField("_lock_count");<NEW_LINE>stackTraversalMarkField = type.getCIntegerField("_stack_traversal_mark");<NEW_LINE>compLevelField = type.getCIntegerField("_comp_level");<NEW_LINE>pcDescSize = db.lookupType("PcDesc").getSize();<NEW_LINE>} | scavengeRootLinkField = type.getAddressField("_scavenge_root_link"); |
1,546,644 | private static Dimension measureTextOverlay(Graphics2D g2d, String text) {<NEW_LINE>Insets insets = new Insets(10, 10, 10, 10);<NEW_LINE>int interLineSpacing = 4;<NEW_LINE>g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>g2d.<MASK><NEW_LINE>g2d.setFont(g2d.getFont().deriveFont(12.0f));<NEW_LINE>String[] lines = text.split("\n");<NEW_LINE>List<TextLayout> textLayouts = new ArrayList<>();<NEW_LINE>int textWidth = 0, textHeight = 0;<NEW_LINE>for (String line : lines) {<NEW_LINE>TextLayout textLayout = new TextLayout(line, g2d.getFont(), g2d.getFontRenderContext());<NEW_LINE>textWidth = (int) Math.max(textWidth, textLayout.getBounds().getWidth());<NEW_LINE>textHeight += (int) textLayout.getBounds().getHeight() + interLineSpacing;<NEW_LINE>textLayouts.add(textLayout);<NEW_LINE>}<NEW_LINE>textHeight -= interLineSpacing;<NEW_LINE>return new Dimension(textWidth + insets.left + insets.right, textHeight + insets.top + insets.bottom);<NEW_LINE>} | setStroke(new BasicStroke(1.0f)); |
1,789,256 | private Concrete.@Nullable Pattern translateNumberPatterns(Concrete.NumberPattern pattern, @NotNull Expression typeExpr) {<NEW_LINE>if (myVisitor == null) {<NEW_LINE>return DesugarVisitor.desugarNumberPattern(pattern, myErrorReporter);<NEW_LINE>}<NEW_LINE>var ext = myVisitor.getExtension();<NEW_LINE>if (ext == null) {<NEW_LINE>return DesugarVisitor.desugarNumberPattern(pattern, myErrorReporter);<NEW_LINE>}<NEW_LINE>var checker = ext.getLiteralTypechecker();<NEW_LINE>if (checker == null) {<NEW_LINE>return DesugarVisitor.desugarNumberPattern(pattern, myErrorReporter);<NEW_LINE>}<NEW_LINE>int numberOfErrors = myVisitor.getNumberOfErrors();<NEW_LINE>ConcretePattern result = checker.desugarNumberPattern(pattern, myVisitor, new PatternContextDataImpl(typeExpr, pattern));<NEW_LINE>if (result == null && myVisitor.getNumberOfErrors() == numberOfErrors) {<NEW_LINE>myErrorReporter.report(<MASK><NEW_LINE>}<NEW_LINE>if (result != null && !(result instanceof Concrete.Pattern)) {<NEW_LINE>throw new IllegalStateException("ConcretePattern must be created with ConcreteFactory");<NEW_LINE>}<NEW_LINE>if (result instanceof Concrete.NumberPattern) {<NEW_LINE>throw new IllegalStateException("desugarNumberPattern should not return ConcreteNumberPattern");<NEW_LINE>}<NEW_LINE>return (Concrete.Pattern) result;<NEW_LINE>} | new TypecheckingError("Cannot typecheck pattern", pattern)); |
188,754 | public EncryptionConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EncryptionConfig encryptionConfig = new EncryptionConfig();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("KeyId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>encryptionConfig.setKeyId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>encryptionConfig.setStatus(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>encryptionConfig.setType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return encryptionConfig;<NEW_LINE>} | class).unmarshall(context)); |
277,807 | private void ajaxChangePermissions(final Project project, final HashMap<String, Object> ret, final HttpServletRequest req, final User user) throws ServletException {<NEW_LINE>final boolean admin = Boolean.parseBoolean(getParam(req, "permissions[admin]"));<NEW_LINE>final boolean read = Boolean.parseBoolean(getParam(req, "permissions[read]"));<NEW_LINE>final boolean write = Boolean.parseBoolean(getParam(req, "permissions[write]"));<NEW_LINE>final boolean execute = Boolean.parseBoolean(getParam(req, "permissions[execute]"));<NEW_LINE>final boolean schedule = Boolean.parseBoolean(getParam(req, "permissions[schedule]"));<NEW_LINE>final boolean group = Boolean.parseBoolean(getParam(req, "group"));<NEW_LINE>final String name = getParam(req, "name");<NEW_LINE>final Permission perm;<NEW_LINE>if (group) {<NEW_LINE>perm = project.getGroupPermission(name);<NEW_LINE>} else {<NEW_LINE>perm = project.getUserPermission(name);<NEW_LINE>}<NEW_LINE>if (perm == null) {<NEW_LINE>ret.put(ERROR_PARAM, "Permissions for " + name + " cannot be found.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (admin || read || write || execute || schedule) {<NEW_LINE>if (admin) {<NEW_LINE>perm.setPermission(Type.ADMIN, true);<NEW_LINE>perm.setPermission(Type.READ, false);<NEW_LINE>perm.setPermission(Type.WRITE, false);<NEW_LINE>perm.setPermission(Type.EXECUTE, false);<NEW_LINE>perm.setPermission(Type.SCHEDULE, false);<NEW_LINE>} else {<NEW_LINE>perm.setPermission(Type.ADMIN, false);<NEW_LINE>perm.setPermission(Type.READ, read);<NEW_LINE>perm.setPermission(Type.WRITE, write);<NEW_LINE>perm.setPermission(Type.EXECUTE, execute);<NEW_LINE>perm.setPermission(Type.SCHEDULE, schedule);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.projectManager.updateProjectPermission(project, <MASK><NEW_LINE>} catch (final ProjectManagerException e) {<NEW_LINE>ret.put(ERROR_PARAM, e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>this.projectManager.removeProjectPermission(project, name, group, user);<NEW_LINE>} catch (final ProjectManagerException e) {<NEW_LINE>ret.put(ERROR_PARAM, e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | name, perm, group, user); |
1,131,127 | public void handleMessage(Message msg) {<NEW_LINE>if (msg.what == MSG_NEW_INPUT && isRunning()) {<NEW_LINE>int bytesRead = mProcessToTerminalIOQueue.read(mReceiveBuffer, false);<NEW_LINE>if (bytesRead > 0) {<NEW_LINE>mEmulator.append(mReceiveBuffer, bytesRead);<NEW_LINE>notifyScreenUpdate();<NEW_LINE>}<NEW_LINE>} else if (msg.what == MSG_PROCESS_EXITED) {<NEW_LINE>int <MASK><NEW_LINE>cleanupResources(exitCode);<NEW_LINE>mChangeCallback.onSessionFinished(TerminalSession.this);<NEW_LINE>String exitDescription = "\r\n[Process completed";<NEW_LINE>if (exitCode > 0) {<NEW_LINE>// Non-zero process exit.<NEW_LINE>exitDescription += " (code " + exitCode + ")";<NEW_LINE>} else if (exitCode < 0) {<NEW_LINE>// Negated signal.<NEW_LINE>exitDescription += " (signal " + (-exitCode) + ")";<NEW_LINE>}<NEW_LINE>exitDescription += " - press Enter]";<NEW_LINE>byte[] bytesToWrite = exitDescription.getBytes(StandardCharsets.UTF_8);<NEW_LINE>mEmulator.append(bytesToWrite, bytesToWrite.length);<NEW_LINE>notifyScreenUpdate();<NEW_LINE>}<NEW_LINE>} | exitCode = (Integer) msg.obj; |
601,887 | @POST<NEW_LINE>public Response add(User entity) throws StorageException {<NEW_LINE>if (!Context.getPermissionsManager().getUserAdmin(getUserId())) {<NEW_LINE>Context.getPermissionsManager().checkUserUpdate(getUserId(), new User(), entity);<NEW_LINE>if (Context.getPermissionsManager().getUserManager(getUserId())) {<NEW_LINE>Context.getPermissionsManager().checkUserLimit(getUserId());<NEW_LINE>} else {<NEW_LINE>Context.getPermissionsManager().checkRegistration(getUserId());<NEW_LINE>entity.setDeviceLimit(Context.getConfig().getInteger(Keys.USERS_DEFAULT_DEVICE_LIMIT));<NEW_LINE>int expirationDays = Context.getConfig().getInteger(Keys.USERS_DEFAULT_EXPIRATION_DAYS);<NEW_LINE>if (expirationDays > 0) {<NEW_LINE>entity.setExpirationTime(new Date(System.currentTimeMillis() + (long) expirationDays <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Context.getUsersManager().addItem(entity);<NEW_LINE>LogAction.create(getUserId(), entity);<NEW_LINE>if (Context.getPermissionsManager().getUserManager(getUserId())) {<NEW_LINE>Context.getDataManager().linkObject(User.class, getUserId(), ManagedUser.class, entity.getId(), true);<NEW_LINE>LogAction.link(getUserId(), User.class, getUserId(), ManagedUser.class, entity.getId());<NEW_LINE>}<NEW_LINE>Context.getUsersManager().refreshUserItems();<NEW_LINE>return Response.ok(entity).build();<NEW_LINE>} | * 24 * 3600 * 1000)); |
1,732,268 | public boolean close(int closedReason, SIBUuid8 qpoint) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "close", new Object[] { Integer.valueOf(closedReason), qpoint });<NEW_LINE>ConsumableKey ck = null;<NEW_LINE>synchronized (this) {<NEW_LINE>// Remove the consumerkey from our list<NEW_LINE>ck = consumerKeys.remove(qpoint);<NEW_LINE>// If this was the uuid we were attached to then close off the gathering consumer<NEW_LINE>closed = consumerKeys.isEmpty();<NEW_LINE>// The reason for closing the gathering consumer was the reason that the last<NEW_LINE>// partition got removed for so set the reason if this qpoint was the last to be<NEW_LINE>// removed.<NEW_LINE>if (closed)<NEW_LINE>this.closedReason = closedReason;<NEW_LINE>}<NEW_LINE>if (ck != null) {<NEW_LINE>// Close off the individual consumer.<NEW_LINE><MASK><NEW_LINE>// Take the lock on the consumerpoint and set it to notReady<NEW_LINE>consumerPoint.lock();<NEW_LINE>try {<NEW_LINE>ck.stop();<NEW_LINE>ck.notReady();<NEW_LINE>} finally {<NEW_LINE>consumerPoint.unlock();<NEW_LINE>}<NEW_LINE>// Finally detach the consumer key<NEW_LINE>try {<NEW_LINE>ck.detach();<NEW_LINE>} catch (SIException e) {<NEW_LINE>// No FFDC code needed<NEW_LINE>// Should never get here - we only throw exceptions from detach if we are pubsub<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "close", closed);<NEW_LINE>return closed;<NEW_LINE>} | ck.close(closedReason, null); |
1,050,100 | public boolean canRelease(MessageGroup messageGroup) {<NEW_LINE>boolean canRelease = false;<NEW_LINE>int size = messageGroup.size();<NEW_LINE>if (this.releasePartialSequences && size > 0) {<NEW_LINE>if (LOGGER.isTraceEnabled()) {<NEW_LINE>LOGGER.trace("Considering partial release of group [" + messageGroup + "]");<NEW_LINE>}<NEW_LINE>Collection<Message<?>> messages = messageGroup.getMessages();<NEW_LINE>Message<?> minMessage = Collections.min(messages, this.comparator);<NEW_LINE>int nextSequenceNumber = StaticMessageHeaderAccessor.getSequenceNumber(minMessage);<NEW_LINE><MASK><NEW_LINE>if (nextSequenceNumber - lastReleasedMessageSequence == 1) {<NEW_LINE>canRelease = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (size == 0) {<NEW_LINE>canRelease = true;<NEW_LINE>} else {<NEW_LINE>int sequenceSize = messageGroup.getSequenceSize();<NEW_LINE>// If there is no sequence then it must be incomplete....<NEW_LINE>if (sequenceSize == size) {<NEW_LINE>canRelease = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return canRelease;<NEW_LINE>} | int lastReleasedMessageSequence = messageGroup.getLastReleasedMessageSequenceNumber(); |
992,661 | private String contrast() {<NEW_LINE>final SelectorDO <MASK><NEW_LINE>Objects.requireNonNull(before);<NEW_LINE>final SelectorDO after = (SelectorDO) getAfter();<NEW_LINE>Objects.requireNonNull(after);<NEW_LINE>if (Objects.equals(before, after)) {<NEW_LINE>return "it no change";<NEW_LINE>}<NEW_LINE>final StringBuilder builder = new StringBuilder();<NEW_LINE>if (!Objects.equals(before.getName(), after.getName())) {<NEW_LINE>builder.append(String.format("name[%s => %s] ", before.getName(), after.getName()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getHandle(), after.getHandle())) {<NEW_LINE>builder.append(String.format("handle[%s => %s] ", before.getHandle(), after.getHandle()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getType(), after.getType())) {<NEW_LINE>builder.append(String.format("type[%s => %s] ", before.getType(), after.getType()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getEnabled(), after.getEnabled())) {<NEW_LINE>builder.append(String.format("enable[%s => %s] ", before.getEnabled(), after.getEnabled()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getSort(), after.getSort())) {<NEW_LINE>builder.append(String.format("sort[%s => %s] ", before.getSort(), after.getSort()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getLoged(), after.getLoged())) {<NEW_LINE>builder.append(String.format("loged[%s => %s] ", before.getLoged(), after.getLoged()));<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>} | before = (SelectorDO) getBefore(); |
1,170,230 | public final FileObject move(FileLock lock, FileObject target, String name, String ext) throws IOException {<NEW_LINE>if (FileUtil.isParentOf(this, target)) {<NEW_LINE>// NOI18N<NEW_LINE>FSException.io("EXC_MoveChild", this, target);<NEW_LINE>}<NEW_LINE>ProvidedExtensions extensions = getProvidedExtensions();<NEW_LINE>File to = getToFile(target, name, ext);<NEW_LINE>extensions.beforeMove(this, to);<NEW_LINE>FileObject result = null;<NEW_LINE>try {<NEW_LINE>if (!checkLock(lock)) {<NEW_LINE>// NOI18N<NEW_LINE>FSException.io("EXC_InvalidLock", lock, getPath());<NEW_LINE>}<NEW_LINE>Watcher.lock(target);<NEW_LINE>Watcher.lock(getParent());<NEW_LINE>final IOHandler moveHandler = extensions.getMoveHandler(getFileName(<MASK><NEW_LINE>if (moveHandler != null) {<NEW_LINE>if (target instanceof FolderObj) {<NEW_LINE>result = move(lock, (FolderObj) target, name, ext, moveHandler);<NEW_LINE>} else {<NEW_LINE>moveHandler.handle();<NEW_LINE>refresh(true);<NEW_LINE>// perfromance bottleneck to call refresh on folder<NEW_LINE>// (especially for many files to be moved)<NEW_LINE>target.refresh(true);<NEW_LINE>result = target.getFileObject(name, ext);<NEW_LINE>assert result != null : "Cannot find " + target + " with " + name + "." + ext;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MOVED_FILE_TIMESTAMP.set(lastModified().getTime());<NEW_LINE>try {<NEW_LINE>result = super.move(lock, target, name, ext);<NEW_LINE>} finally {<NEW_LINE>MOVED_FILE_TIMESTAMP.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FileUtil.copyAttributes(this, result);<NEW_LINE>Utils.reassignLkp(this, result);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>extensions.moveFailure(this, to);<NEW_LINE>throw ioe;<NEW_LINE>}<NEW_LINE>extensions.moveSuccess(this, to);<NEW_LINE>return result;<NEW_LINE>} | ).getFile(), to); |
1,755,470 | final CreatePlatformApplicationResult executeCreatePlatformApplication(CreatePlatformApplicationRequest createPlatformApplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPlatformApplicationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePlatformApplicationRequest> request = null;<NEW_LINE>Response<CreatePlatformApplicationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePlatformApplicationRequestMarshaller().marshall(super.beforeMarshalling(createPlatformApplicationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SNS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePlatformApplication");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreatePlatformApplicationResult> responseHandler = new StaxResponseHandler<CreatePlatformApplicationResult>(new CreatePlatformApplicationResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
251,719 | public EarlyFinishedVulnerabilityType performCheck() {<NEW_LINE>Config tlsConfig = config.createConfig();<NEW_LINE>tlsConfig.setFiltersKeepUserSettings(false);<NEW_LINE>WorkflowConfigurationFactory workflowConfigurationFactory = new WorkflowConfigurationFactory(tlsConfig);<NEW_LINE>OutboundConnection connection = tlsConfig.getDefaultClientConnection();<NEW_LINE>WorkflowTrace workflowTrace = workflowConfigurationFactory.createHelloWorkflow(connection);<NEW_LINE>workflowTrace.addTlsAction(new SendDynamicClientKeyExchangeAction(connection.getAlias()));<NEW_LINE>List<ProtocolMessage> <MASK><NEW_LINE>messages.add(new ChangeCipherSpecMessage(tlsConfig));<NEW_LINE>workflowTrace.addTlsAction(MessageActionFactory.createAction(tlsConfig, connection, ConnectionEndType.CLIENT, messages));<NEW_LINE>messages = new LinkedList<>();<NEW_LINE>messages.add(new ChangeCipherSpecMessage(tlsConfig));<NEW_LINE>messages.add(new FinishedMessage(tlsConfig));<NEW_LINE>workflowTrace.addTlsAction(MessageActionFactory.createAction(tlsConfig, connection, ConnectionEndType.SERVER, messages));<NEW_LINE>State state = new State(tlsConfig, workflowTrace);<NEW_LINE>WorkflowExecutor workflowExecutor = WorkflowExecutorFactory.createWorkflowExecutor(tlsConfig.getWorkflowExecutorType(), state);<NEW_LINE>workflowExecutor.executeWorkflow();<NEW_LINE>if (!workflowTrace.allActionsExecuted()) {<NEW_LINE>ConsoleLogger.CONSOLE.warn("Could not complete Workflow - Vulnerability unknown");<NEW_LINE>return EarlyFinishedVulnerabilityType.UNKNOWN;<NEW_LINE>}<NEW_LINE>if (WorkflowTraceUtil.didReceiveMessage(ProtocolMessageType.ALERT, workflowTrace)) {<NEW_LINE>ConsoleLogger.CONSOLE.info("Not vulnerable (definitely), Alert message found");<NEW_LINE>return EarlyFinishedVulnerabilityType.NOT_VULNERABLE;<NEW_LINE>} else if (WorkflowTraceUtil.didReceiveMessage(HandshakeMessageType.FINISHED, workflowTrace)) {<NEW_LINE>ConsoleLogger.CONSOLE.error("Vulnerable (definitely), Finished message found");<NEW_LINE>return EarlyFinishedVulnerabilityType.VULNERABLE;<NEW_LINE>} else {<NEW_LINE>ConsoleLogger.CONSOLE.info("Not vulnerable (probably), No Finished message found, yet also no alert");<NEW_LINE>return EarlyFinishedVulnerabilityType.NOT_VULNERABLE_PROBABLY;<NEW_LINE>}<NEW_LINE>} | messages = new LinkedList<>(); |
1,143,730 | public int compareTo(PartitionField o) {<NEW_LINE>Preconditions.checkArgument(mysqlStandardFieldType() == o.mysqlStandardFieldType());<NEW_LINE>Preconditions.checkArgument(packetLength(<MASK><NEW_LINE>Preconditions.checkArgument(field.dataType().getCollationName() == o.dataType().getCollationName() || (field.dataType().isUtf8Encoding() && o.dataType().isUtf8Encoding()));<NEW_LINE>CollationHandler collationHandler = field.getCollationHandler();<NEW_LINE>// Get the offset and length.<NEW_LINE>// todo handle unset var length<NEW_LINE>int leftLen = ((VarcharField) field).getVarLength();<NEW_LINE>int rightLen = ((VarcharField) ((AbstractPartitionField) o).field).getVarLength();<NEW_LINE>int leftStartPos = startPos();<NEW_LINE>int rightStartPos = ((VarcharPartitionField) o).startPos();<NEW_LINE>Slice left = Slices.wrappedBuffer(rawBytes(), leftStartPos, leftLen);<NEW_LINE>Slice right = Slices.wrappedBuffer(o.rawBytes(), rightStartPos, rightLen);<NEW_LINE>int res = collationHandler.compareSp(left, right);<NEW_LINE>return res;<NEW_LINE>} | ) == o.packetLength()); |
709,274 | public static void operator2(InterleavedI8 imgA, Function2_I8 function, InterleavedI8 imgB, InterleavedI8 output) {<NEW_LINE>InputSanityCheck.checkSameShape(imgA, imgB);<NEW_LINE>output.reshape(imgA.width, imgA.height);<NEW_LINE>int columns = imgA.width * imgA.numBands;<NEW_LINE>int N = imgA.width * imgA.height;<NEW_LINE>if (BoofConcurrency.USE_CONCURRENT && N > SMALL_IMAGE) {<NEW_LINE>ImplPixelMath_MT.operator2(imgA.data, imgA.startIndex, imgA.stride, imgB.data, imgB.startIndex, imgB.stride, output.data, output.startIndex, output.stride, imgA.height, columns, function);<NEW_LINE>} else {<NEW_LINE>ImplPixelMath.operator2(imgA.data, imgA.startIndex, imgA.stride, imgB.data, imgB.startIndex, imgB.stride, output.data, output.startIndex, output.stride, <MASK><NEW_LINE>}<NEW_LINE>} | imgA.height, columns, function); |
1,504,476 | public void breakpointReached(JPDABreakpointEvent event) {<NEW_LINE>Object bp = event.getSource();<NEW_LINE>JPDADebugger debugger = event.getDebugger();<NEW_LINE>if (execHaltedBP.get(debugger) == bp) {<NEW_LINE>LOG.log(<MASK><NEW_LINE>if (!setCurrentPosition(debugger, event.getThread())) {<NEW_LINE>event.resume();<NEW_LINE>} else {<NEW_LINE>StepActionProvider.killJavaStep(debugger);<NEW_LINE>}<NEW_LINE>} else if (execStepIntoBP.get(debugger) == bp) {<NEW_LINE>LOG.log(Level.FINE, "TruffleAccessBreakpoints.breakpointReached({0}), exec step into.", event);<NEW_LINE>if (!setCurrentPosition(debugger, event.getThread())) {<NEW_LINE>event.resume();<NEW_LINE>} else {<NEW_LINE>StepActionProvider.killJavaStep(debugger);<NEW_LINE>}<NEW_LINE>} else if (dbgAccessBP.get(debugger) == bp) {<NEW_LINE>LOG.log(Level.FINE, "TruffleAccessBreakpoints.breakpointReached({0}), debugger access.", event);<NEW_LINE>try {<NEW_LINE>synchronized (methodCallAccessLock) {<NEW_LINE>if (methodCallsRunnable != null) {<NEW_LINE>invokeMethodCalls(event.getThread(), methodCallsRunnable);<NEW_LINE>}<NEW_LINE>methodCallsRunnable = METHOD_CALLS_SUCCESSFUL;<NEW_LINE>methodCallAccessLock.notifyAll();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>event.resume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Level.FINE, "TruffleAccessBreakpoints.breakpointReached({0}), exec halted.", event); |
67,097 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String queryFlag) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Query query = business.pick(queryFlag, Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson);<NEW_LINE>}<NEW_LINE>CacheKey cacheKey = new CacheKey(this.getClass(), flag, queryFlag);<NEW_LINE>Optional<?> optional = CacheManager.get(business.cache(), cacheKey);<NEW_LINE>ImportModel model = null;<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>model = (ImportModel) optional.get();<NEW_LINE>} else {<NEW_LINE>String id = business.importModel().getWithQuery(flag, query);<NEW_LINE>model = business.pick(id, ImportModel.class);<NEW_LINE>if (null != model) {<NEW_LINE>business.entityManagerContainer().get(ImportModel.class).detach(model);<NEW_LINE>CacheManager.put(business.cache(), cacheKey, model);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == model) {<NEW_LINE>throw new ExceptionEntityNotExist(flag, ImportModel.class);<NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, model)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, model);<NEW_LINE>}<NEW_LINE>Wo wo = Wo.copier.copy(model);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | ExceptionEntityNotExist(queryFlag, Query.class); |
538,123 | public boolean handleTransfer(JTextComponent targetComponent) {<NEW_LINE>// NOI18N<NEW_LINE>Object mimeType = targetComponent.getDocument().getProperty("mimeType");<NEW_LINE>if (mimeType != null && ("text/x-java".equals(mimeType) || "text/x-jsp".equals(mimeType))) {<NEW_LINE>// NOI18N<NEW_LINE>try {<NEW_LINE>Node clientNode = operationNode.getParentNode().getParentNode().getParentNode();<NEW_LINE>FileObject srcRoot = clientNode.getLookup().lookup(FileObject.class);<NEW_LINE>Project clientProject = FileOwnerQuery.getOwner(srcRoot);<NEW_LINE>FileObject targetFo = NbEditorUtilities.getFileObject(targetComponent.getDocument());<NEW_LINE>if (JaxWsUtils.addProjectReference(clientProject, targetFo)) {<NEW_LINE>JaxWsCodeGenerator.insertMethod(targetComponent.getDocument(), targetComponent.getCaret().getDot(), operationNode);<NEW_LINE>// logging usage of action<NEW_LINE>Object[] params = new Object[2];<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>params[1] = "DRAG & DROP WS OPERATION";<NEW_LINE>LogUtils.logWsAction(params);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ErrorManager.getDefault().log(ex.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | params[0] = LogUtils.WS_STACK_JAXWS; |
280,379 | // Submit a group of tasks via untimed invokeAny, where one of the tasks promptly returns a null result, and another returns a non-null result after a delay.<NEW_LINE>// Verify that the result of invokeAny is null. This test verifies that the implementation is not limited to awaiting non-null results, and handles null properly.<NEW_LINE>// Also verifies that the other task ends before it otherwise would have due to the implicit cancel/interrupt upon return of invokeAny.<NEW_LINE>@Test<NEW_LINE>public void testInvokeAnyNullSuccessfulResult() throws Exception {<NEW_LINE>PolicyExecutor executor = provider.create("testInvokeAnyNullSuccessfulResult");<NEW_LINE>CountDownLatch blocker = new CountDownLatch(1);<NEW_LINE>CountDownLatch task1started = new CountDownLatch(1);<NEW_LINE>CountDownTask task1 = new CountDownTask(task1started, blocker, TIMEOUT_NS * 3);<NEW_LINE>Callable<Boolean> task2 = () -> task1started.await(TIMEOUT_NS * 2, TimeUnit.NANOSECONDS) ? null : false;<NEW_LINE>List<Callable<Boolean>> tasks = Arrays.asList(task1, task2);<NEW_LINE>assertNull(executor.invokeAny(tasks));<NEW_LINE>// Verify that task1 ends prior to when it would have otherwise completed. This is due to cancel/interruption upon return from invokeAny.<NEW_LINE>for (long start = System.nanoTime(); task1.executionThreads.peek() != null && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(100)) ;<NEW_LINE>assertNull(task1.executionThreads.peek());<NEW_LINE>List<Runnable> canceledFromQueue = executor.shutdownNow();<NEW_LINE>assertEquals(<MASK><NEW_LINE>} | 0, canceledFromQueue.size()); |
1,720,609 | // -----------//<NEW_LINE>// preRemove //<NEW_LINE>// -----------//<NEW_LINE>@Override<NEW_LINE>public Set<? extends Inter> preRemove(WrappedBoolean cancel) {<NEW_LINE>final Set<Inter> <MASK><NEW_LINE>inters.add(this);<NEW_LINE>// If this slur has an extension to another slur, remove that other slur (now an orphan).<NEW_LINE>// NOTA: We do this EVEN IF this other slur is a manual slur, because today we have no way<NEW_LINE>// to handle the del/undel lifecycle of this direct cross-system inter reference<NEW_LINE>// similar to the lifecycle we have for inter relations within the same SIG.<NEW_LINE>for (HorizontalSide hSide : HorizontalSide.values()) {<NEW_LINE>final SlurInter otherSlur = getExtension(hSide);<NEW_LINE>if (otherSlur != null) {<NEW_LINE>inters.add(otherSlur);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return inters;<NEW_LINE>} | inters = new LinkedHashSet<>(); |
235,240 | public void visit(BLangWorkerFlushExpr flushExpr) {<NEW_LINE>BIRBasicBlock thenBB = new BIRBasicBlock(this.env.nextBBId(names));<NEW_LINE>addToTrapStack(thenBB);<NEW_LINE>// create channelDetails array<NEW_LINE>BIRNode.ChannelDetails[] channels = new BIRNode.ChannelDetails[flushExpr.workerIdentifierList.size()];<NEW_LINE>int i = 0;<NEW_LINE>for (BLangIdentifier workerIdentifier : flushExpr.workerIdentifierList) {<NEW_LINE>String channelName = this.env.enclFunc.workerName.value + "->" + workerIdentifier.value;<NEW_LINE>boolean isOnSameStrand = DEFAULT_WORKER_NAME.equals(this.env.enclFunc.workerName.value);<NEW_LINE>channels[i] = new BIRNode.ChannelDetails(channelName, isOnSameStrand, true);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>BIRVariableDcl tempVarDcl = new BIRVariableDcl(flushExpr.getBType(), this.env.nextLocalVarId(names), VarScope.FUNCTION, VarKind.TEMP);<NEW_LINE>this.env.<MASK><NEW_LINE>BIROperand lhsOp = new BIROperand(tempVarDcl);<NEW_LINE>this.env.targetOperand = lhsOp;<NEW_LINE>this.env.enclBB.terminator = new BIRTerminator.Flush(flushExpr.pos, channels, lhsOp, thenBB, this.currentScope);<NEW_LINE>this.env.enclBasicBlocks.add(thenBB);<NEW_LINE>this.env.enclBB = thenBB;<NEW_LINE>} | enclFunc.localVars.add(tempVarDcl); |
57,209 | public InterleavedComplexSamples next() {<NEW_LINE>if (mSamplesPointer >= mSamples.length) {<NEW_LINE>throw new IllegalStateException("End of buffer exceeded");<NEW_LINE>}<NEW_LINE>int offset = mSamplesPointer;<NEW_LINE>for (int x = 0; x < FRAGMENT_SIZE; x++) {<NEW_LINE>mIBuffer[x + I_OVERLAP] = scale(mSamples[offset++], mAverageDc);<NEW_LINE>mQBuffer[x + Q_OVERLAP] = scale(<MASK><NEW_LINE>}<NEW_LINE>mSamplesPointer = offset;<NEW_LINE>float[] samples = new float[FRAGMENT_SIZE * 2];<NEW_LINE>float accumulator;<NEW_LINE>for (int x = 0; x < FRAGMENT_SIZE; x++) {<NEW_LINE>accumulator = 0;<NEW_LINE>for (int tap = 0; tap < COEFFICIENTS.length; tap++) {<NEW_LINE>accumulator += COEFFICIENTS[tap] * mQBuffer[x + tap];<NEW_LINE>}<NEW_LINE>// Perform FS/2 frequency translation on final filtered values ... multiply sequence by 1, -1, etc.<NEW_LINE>if (x % 2 == 0) {<NEW_LINE>samples[2 * x] = mIBuffer[x];<NEW_LINE>samples[2 * x + 1] = accumulator;<NEW_LINE>} else {<NEW_LINE>samples[2 * x] = -mIBuffer[x];<NEW_LINE>samples[2 * x + 1] = -accumulator;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Copy residual end samples to beginning of buffers for the next iteration<NEW_LINE>System.arraycopy(mIBuffer, FRAGMENT_SIZE, mIBuffer, 0, I_OVERLAP);<NEW_LINE>System.arraycopy(mQBuffer, FRAGMENT_SIZE, mQBuffer, 0, Q_OVERLAP);<NEW_LINE>return new InterleavedComplexSamples(samples, mTimestamp);<NEW_LINE>} | mSamples[offset++], mAverageDc); |
613,776 | public static BatchDeleteResourcesResponse unmarshall(BatchDeleteResourcesResponse batchDeleteResourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>batchDeleteResourcesResponse.setRequestId(_ctx.stringValue("BatchDeleteResourcesResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>List<ResourceItem> items = new ArrayList<ResourceItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("BatchDeleteResourcesResponse.Data.Items.Length"); i++) {<NEW_LINE>ResourceItem resourceItem = new ResourceItem();<NEW_LINE>resourceItem.setAppId(_ctx.stringValue("BatchDeleteResourcesResponse.Data.Items[" + i + "].AppId"));<NEW_LINE>resourceItem.setContent(_ctx.mapValue("BatchDeleteResourcesResponse.Data.Items[" + i + "].Content"));<NEW_LINE>resourceItem.setCreateTime(_ctx.stringValue("BatchDeleteResourcesResponse.Data.Items[" + i + "].CreateTime"));<NEW_LINE>resourceItem.setDescription(_ctx.stringValue("BatchDeleteResourcesResponse.Data.Items[" + i + "].Description"));<NEW_LINE>resourceItem.setModifiedTime(_ctx.stringValue("BatchDeleteResourcesResponse.Data.Items[" + i + "].ModifiedTime"));<NEW_LINE>resourceItem.setModuleId(_ctx.stringValue("BatchDeleteResourcesResponse.Data.Items[" + i + "].ModuleId"));<NEW_LINE>resourceItem.setResourceName(_ctx.stringValue("BatchDeleteResourcesResponse.Data.Items[" + i + "].ResourceName"));<NEW_LINE>resourceItem.setResourceId(_ctx.stringValue("BatchDeleteResourcesResponse.Data.Items[" + i + "].ResourceId"));<NEW_LINE>resourceItem.setRevision(_ctx.integerValue("BatchDeleteResourcesResponse.Data.Items[" + i + "].Revision"));<NEW_LINE>resourceItem.setSchemaVersion(_ctx.stringValue<MASK><NEW_LINE>resourceItem.setResourceType(_ctx.stringValue("BatchDeleteResourcesResponse.Data.Items[" + i + "].ResourceType"));<NEW_LINE>items.add(resourceItem);<NEW_LINE>}<NEW_LINE>data.setItems(items);<NEW_LINE>batchDeleteResourcesResponse.setData(data);<NEW_LINE>return batchDeleteResourcesResponse;<NEW_LINE>} | ("BatchDeleteResourcesResponse.Data.Items[" + i + "].SchemaVersion")); |
28,737 | public boolean onPrepareOptionsMenu(Menu menu) {<NEW_LINE>MenuItem closeIssue = menu.findItem(R.id.closeIssue);<NEW_LINE>MenuItem lockIssue = menu.findItem(R.id.lockIssue);<NEW_LINE>MenuItem milestone = menu.findItem(R.id.milestone);<NEW_LINE>MenuItem labels = menu.findItem(R.id.labels);<NEW_LINE>MenuItem assignees = menu.findItem(R.id.assignees);<NEW_LINE>MenuItem edit = menu.findItem(R.id.edit);<NEW_LINE>MenuItem editMenu = menu.findItem(R.id.editMenu);<NEW_LINE>MenuItem merge = menu.findItem(R.id.merge);<NEW_LINE>MenuItem reviewers = menu.findItem(R.id.reviewers);<NEW_LINE>MenuItem pinUnpin = menu.<MASK><NEW_LINE>boolean isOwner = getPresenter().isOwner();<NEW_LINE>boolean isLocked = getPresenter().isLocked();<NEW_LINE>boolean isCollaborator = getPresenter().isCollaborator();<NEW_LINE>boolean isRepoOwner = getPresenter().isRepoOwner();<NEW_LINE>boolean isMergable = getPresenter().isMergeable();<NEW_LINE>merge.setVisible(isMergable && (isRepoOwner || isCollaborator));<NEW_LINE>reviewers.setVisible((isRepoOwner || isCollaborator));<NEW_LINE>editMenu.setVisible(isOwner || isCollaborator || isRepoOwner);<NEW_LINE>milestone.setVisible(isCollaborator || isRepoOwner);<NEW_LINE>labels.setVisible(isCollaborator || isRepoOwner);<NEW_LINE>assignees.setVisible(isCollaborator || isRepoOwner);<NEW_LINE>edit.setVisible(isCollaborator || isRepoOwner || isOwner);<NEW_LINE>if (getPresenter().getPullRequest() != null) {<NEW_LINE>boolean isPinned = PinnedPullRequests.isPinned(getPresenter().getPullRequest().getId());<NEW_LINE>pinUnpin.setIcon(isPinned ? ContextCompat.getDrawable(this, R.drawable.ic_pin_filled) : ContextCompat.getDrawable(this, R.drawable.ic_pin));<NEW_LINE>closeIssue.setVisible(isRepoOwner || (isOwner || isCollaborator) && getPresenter().getPullRequest().getState() == IssueState.open);<NEW_LINE>lockIssue.setVisible(isRepoOwner || isCollaborator && getPresenter().getPullRequest().getState() == IssueState.open);<NEW_LINE>closeIssue.setTitle(getPresenter().getPullRequest().getState() == IssueState.closed ? getString(R.string.re_open) : getString(R.string.close));<NEW_LINE>lockIssue.setTitle(isLocked ? getString(R.string.unlock_issue) : getString(R.string.lock_issue));<NEW_LINE>} else {<NEW_LINE>closeIssue.setVisible(false);<NEW_LINE>lockIssue.setVisible(false);<NEW_LINE>}<NEW_LINE>return super.onPrepareOptionsMenu(menu);<NEW_LINE>} | findItem(R.id.pinUnpin); |
885,863 | public static <K, V extends Comparable<? super V>> List<KeyValue<K, V>> sortKeyValueListTopK(List<KeyValue<K, V>> data, final boolean inverse, int k) {<NEW_LINE>k = data.size() > k ? k : data.size();<NEW_LINE>if (k == 0) {<NEW_LINE>return new ArrayList<>();<NEW_LINE>}<NEW_LINE>PriorityQueue<KeyValue<K, V>> topKDataQueue = new PriorityQueue<>(k, new Comparator<KeyValue<K, V>>() {<NEW_LINE><NEW_LINE>public int compare(KeyValue<K, V> a, KeyValue<K, V> b) {<NEW_LINE>int res = (a.getValue()).compareTo(b.getValue());<NEW_LINE>return inverse ? res : -res;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Iterator<KeyValue<K, V>> iterator = data.iterator();<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>topKDataQueue.<MASK><NEW_LINE>}<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>KeyValue<K, V> entry = iterator.next();<NEW_LINE>int res = entry.getValue().compareTo(topKDataQueue.peek().getValue());<NEW_LINE>if ((inverse ? -res : res) < 0) {<NEW_LINE>topKDataQueue.poll();<NEW_LINE>topKDataQueue.add(entry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<KeyValue<K, V>> topKDataList = new ArrayList<>(topKDataQueue);<NEW_LINE>sortKeyValueList(topKDataList, inverse);<NEW_LINE>return topKDataList;<NEW_LINE>} | add(iterator.next()); |
1,762,649 | private void desiredCapabilityForCloud(String testMethodName, String platform, String jsonPath, DesiredCapabilities desiredCapabilities) {<NEW_LINE>JSONObject platFormCapabilities = new JsonParser(jsonPath).getObjectFromJSON().getJSONObject(platform);<NEW_LINE>platFormCapabilities.keySet().forEach(key -> {<NEW_LINE>capabilityObject(desiredCapabilities, platFormCapabilities, key);<NEW_LINE>});<NEW_LINE>AppiumDevice deviceProperty = AppiumDeviceManager.getAppiumDevice();<NEW_LINE>String deviceName = deviceProperty<MASK><NEW_LINE>if (deviceName != null) {<NEW_LINE>desiredCapabilities.setCapability("device", deviceName);<NEW_LINE>desiredCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);<NEW_LINE>}<NEW_LINE>String udid = deviceProperty.getDevice().getUdid();<NEW_LINE>if (udid != null) {<NEW_LINE>desiredCapabilities.setCapability(MobileCapabilityType.UDID, udid);<NEW_LINE>}<NEW_LINE>if (!desiredCapabilities.getCapabilityNames().contains("name")) {<NEW_LINE>desiredCapabilities.setCapability("name", testMethodName);<NEW_LINE>}<NEW_LINE>Object pCloudyApiKey = desiredCapabilities.getCapability("pCloudy_ApiKey");<NEW_LINE>if (null == pCloudyApiKey) {<NEW_LINE>desiredCapabilities.setCapability(CapabilityType.BROWSER_NAME, "");<NEW_LINE>String osVersion = deviceProperty.getDevice().getOsVersion();<NEW_LINE>if (osVersion != null) {<NEW_LINE>desiredCapabilities.setCapability(CapabilityType.VERSION, osVersion);<NEW_LINE>desiredCapabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, osVersion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.info("desiredCapabilityForCloud: ");<NEW_LINE>desiredCapabilities.getCapabilityNames().forEach(key -> LOGGER.info("\t" + key + ":: " + desiredCapabilities.getCapability(key)));<NEW_LINE>desiredCapabilitiesThreadLocal.set(desiredCapabilities);<NEW_LINE>} | .getDevice().getName(); |
1,663,213 | public ServiceStatus save(String userId, String json) {<NEW_LINE>JSONObject jsonObject = JSONObject.parseObject(json);<NEW_LINE>DashboardBoard board = new DashboardBoard();<NEW_LINE>board.setUserId(userId);<NEW_LINE>board.setName(jsonObject.getString("name"));<NEW_LINE>board.setCategoryId<MASK><NEW_LINE>board.setLayout(jsonObject.getString("layout"));<NEW_LINE>Map<String, Object> paramMap = new HashMap<String, Object>();<NEW_LINE>paramMap.put("user_id", board.getUserId());<NEW_LINE>paramMap.put("board_name", board.getName());<NEW_LINE>if (boardDao.countExistBoardName(paramMap) <= 0) {<NEW_LINE>boardDao.save(board);<NEW_LINE>return new ServiceStatus(ServiceStatus.Status.Success, "success", board.getId());<NEW_LINE>} else {<NEW_LINE>return new ServiceStatus(ServiceStatus.Status.Fail, "Duplicated name");<NEW_LINE>}<NEW_LINE>} | (jsonObject.getLong("categoryId")); |
335,006 | public synchronized void update(final CirculantTracker tracker) {<NEW_LINE>if (hasSelected) {<NEW_LINE>RectangleLength2D_F32 r = tracker.getTargetLocation();<NEW_LINE>selected.x0 = (int) r.x0;<NEW_LINE>selected.y0 = (int) r.y0;<NEW_LINE>selected.x1 = selected.x0 + (int) r.width;<NEW_LINE>selected.y1 = selected.y0 + (int) r.height;<NEW_LINE>GrayF64 template = tracker.getTargetTemplate();<NEW_LINE><MASK><NEW_LINE>if (this.template == null) {<NEW_LINE>this.template = new BufferedImage(template.width, template.height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>this.response = new BufferedImage(template.width, template.height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>tmp.reshape(template.width, template.height);<NEW_LINE>}<NEW_LINE>ConvertImage.convert(template, tmp);<NEW_LINE>PixelMath.plus(tmp, 0.5f, tmp);<NEW_LINE>PixelMath.multiply(tmp, 255, 0, 255, tmp);<NEW_LINE>ConvertBufferedImage.convertTo(tmp, this.template, true);<NEW_LINE>ConvertImage.convert(response, tmp);<NEW_LINE>VisualizeImageData.colorizeSign(tmp, this.response, -1);<NEW_LINE>}<NEW_LINE>repaint();<NEW_LINE>} | GrayF64 response = tracker.getResponse(); |
129,250 | public void drawU(UGraphic ug) {<NEW_LINE>final HColor borderColor;<NEW_LINE>if (UseStyle.useBetaStyle())<NEW_LINE>borderColor = getStyle().value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());<NEW_LINE>else<NEW_LINE>borderColor = new Rose().getHtmlColor(skinParam, stereotype, ColorParam.stateBorder);<NEW_LINE>final StringBounder stringBounder = ug.getStringBounder();<NEW_LINE>final Dimension2D dimTotal = calculateDimension(stringBounder);<NEW_LINE>for (int i = 0; i < inners.size(); i++) {<NEW_LINE>final IEntityImage <MASK><NEW_LINE>inner.drawU(ug);<NEW_LINE>final Dimension2D dim = inner.calculateDimension(stringBounder);<NEW_LINE>ug = ug.apply(separator.move(dim));<NEW_LINE>if (i < inners.size() - 1)<NEW_LINE>separator.drawSeparator(ug.apply(borderColor), dimTotal);<NEW_LINE>}<NEW_LINE>} | inner = inners.get(i); |
1,066,441 | public static InputLayout parse(Activity activity, Orientation orientation, String inputLayoutString) {<NEW_LINE>InputLayout inputLayout = new InputLayout(orientation);<NEW_LINE>try {<NEW_LINE>String[] <MASK><NEW_LINE>for (String buttonString : buttonStringList) {<NEW_LINE>// ButtonString format : "keyCode:size:posX:posY"<NEW_LINE>String[] buttonInfo = buttonString.split(":");<NEW_LINE>int keyCode = Integer.parseInt(buttonInfo[0]);<NEW_LINE>int size = Integer.parseInt(buttonInfo[1]);<NEW_LINE>double posX = Double.parseDouble(buttonInfo[2]);<NEW_LINE>double posY = Double.parseDouble(buttonInfo[3]);<NEW_LINE>if (keyCode == VirtualButton.DPAD) {<NEW_LINE>inputLayout.add(new VirtualCross(activity, posX, posY, size));<NEW_LINE>} else if (keyCode == MenuButton.MENU_BUTTON_KEY) {<NEW_LINE>inputLayout.add(new MenuButton(activity, posX, posY, size));<NEW_LINE>} else {<NEW_LINE>inputLayout.add(VirtualButton.Create(activity, keyCode, posX, posY, size));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return inputLayout;<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (orientation == Orientation.ORIENTATION_HORIZONTAL) {<NEW_LINE>return getDefaultInputLayoutHorizontal(activity);<NEW_LINE>} else {<NEW_LINE>return getDefaultInputLayoutVertical(activity);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | buttonStringList = inputLayoutString.split(";"); |
1,374,434 | public SsmActionDefinition unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SsmActionDefinition ssmActionDefinition = new SsmActionDefinition();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ActionSubType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ssmActionDefinition.setActionSubType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Region", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ssmActionDefinition.setRegion(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("InstanceIds", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ssmActionDefinition.setInstanceIds(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return ssmActionDefinition;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,646,009 | final AddTagsResult executeAddTags(AddTagsRequest addTagsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(addTagsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AddTagsRequest> request = null;<NEW_LINE>Response<AddTagsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AddTagsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(addTagsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudTrail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddTags");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AddTagsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AddTagsResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,106,582 | public static Object randomArray(Class type, int length, Random rand) {<NEW_LINE>Object ret;<NEW_LINE>if (type == byte[].class) {<NEW_LINE>byte[<MASK><NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>data[i] = (byte) (rand.nextInt(Byte.MAX_VALUE - Byte.MIN_VALUE) + Byte.MIN_VALUE);<NEW_LINE>}<NEW_LINE>ret = data;<NEW_LINE>} else if (type == short[].class) {<NEW_LINE>short[] data = new short[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>data[i] = (short) (rand.nextInt(Short.MAX_VALUE - Short.MIN_VALUE) + Short.MIN_VALUE);<NEW_LINE>}<NEW_LINE>ret = data;<NEW_LINE>} else if (type == int[].class) {<NEW_LINE>int[] data = new int[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>data[i] = rand.nextInt(1000) - 500;<NEW_LINE>}<NEW_LINE>ret = data;<NEW_LINE>} else if (type == long[].class) {<NEW_LINE>long[] data = new long[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>data[i] = rand.nextLong();<NEW_LINE>}<NEW_LINE>ret = data;<NEW_LINE>} else if (type == float[].class) {<NEW_LINE>float[] data = new float[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>data[i] = rand.nextFloat() - 0.5f;<NEW_LINE>}<NEW_LINE>ret = data;<NEW_LINE>} else if (type == double[].class) {<NEW_LINE>double[] data = new double[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>data[i] = rand.nextDouble() - 0.5;<NEW_LINE>}<NEW_LINE>ret = data;<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unknown. " + type.getSimpleName());<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | ] data = new byte[length]; |
1,667,345 | public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>query_cfg_result result = new query_cfg_result();<NEW_LINE>if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE><MASK><NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>} | _LOGGER.error("TApplicationException inside handler", e); |
468,663 | private Map<String, Object> toJson(Trigger trigger, ZoneId zoneId) throws SchedulerException {<NEW_LINE>Scheduler scheduler = getScheduler();<NEW_LINE>Trigger.TriggerState state = scheduler.getTriggerState(trigger.getKey());<NEW_LINE>Map<String, Object> json = new LinkedHashMap<>();<NEW_LINE>json.put("key", trigger.getKey().toString());<NEW_LINE>json.put("state", state);<NEW_LINE>json.put("priority", trigger.getPriority());<NEW_LINE>Optional.ofNullable(trigger.getCalendarName()).ifPresent(value -> json.put("calendarName", value));<NEW_LINE>Optional.ofNullable(trigger.getDescription()).ifPresent(value -> json<MASK><NEW_LINE>json.put("zoneId", zoneId);<NEW_LINE>json.put("startTime", format(trigger.getStartTime(), zoneId));<NEW_LINE>json.put("endTime", format(trigger.getEndTime(), zoneId));<NEW_LINE>json.put("finalFireTime", format(trigger.getFinalFireTime(), zoneId));<NEW_LINE>json.put("nextFireTime", format(trigger.getNextFireTime(), zoneId));<NEW_LINE>json.put("previousFireTime", format(trigger.getPreviousFireTime(), zoneId));<NEW_LINE>json.put("misfireInstruction", trigger.getMisfireInstruction());<NEW_LINE>json.put("mayFireAgain", trigger.mayFireAgain());<NEW_LINE>if (trigger instanceof CronTrigger) {<NEW_LINE>json.put("cron", ((CronTrigger) trigger).getCronExpression());<NEW_LINE>} else if (trigger instanceof SimpleTrigger) {<NEW_LINE>json.put("repeatCount", ((SimpleTrigger) trigger).getRepeatCount());<NEW_LINE>json.put("repeatInterval", ((SimpleTrigger) trigger).getRepeatInterval());<NEW_LINE>} else if (trigger instanceof CalendarIntervalTrigger) {<NEW_LINE>json.put("repeatInterval", ((CalendarIntervalTrigger) trigger).getRepeatInterval());<NEW_LINE>json.put("repeatIntervalUnit", ((CalendarIntervalTrigger) trigger).getRepeatIntervalUnit());<NEW_LINE>} else if (trigger instanceof DailyTimeIntervalTrigger) {<NEW_LINE>json.put("repeatInterval", ((DailyTimeIntervalTrigger) trigger).getRepeatInterval());<NEW_LINE>json.put("repeatIntervalUnit", ((DailyTimeIntervalTrigger) trigger).getRepeatIntervalUnit());<NEW_LINE>}<NEW_LINE>json.put("jobDataMap", trigger.getJobDataMap());<NEW_LINE>return json;<NEW_LINE>} | .put("description", value)); |
1,816,182 | public FillPrepareResult prepare(int availableHeight) {<NEW_LINE>FillPrepareResult result = null;<NEW_LINE>JRComponentElement element = fillContext.getComponentElement();<NEW_LINE>if (template == null) {<NEW_LINE>template = new JRTemplateGenericElement(fillContext.getElementOrigin(), fillContext.getDefaultStyleProvider(), SortElement.SORT_ELEMENT_TYPE);<NEW_LINE>template.setMode(sortComponent.getContext().getComponentElement().getModeValue());<NEW_LINE>template.setBackcolor(sortComponent.getContext().getComponentElement().getBackcolor());<NEW_LINE>template.setForecolor(sortComponent.getContext().getComponentElement().getForecolor());<NEW_LINE>template = deduplicate(template);<NEW_LINE>}<NEW_LINE>printElement = new JRTemplateGenericPrintElement(template, printElementOriginator);<NEW_LINE>printElement.setUUID(element.getUUID());<NEW_LINE>printElement.setX(element.getX());<NEW_LINE>printElement.<MASK><NEW_LINE>printElement.setHeight(element.getHeight());<NEW_LINE>if (isEvaluateNow()) {<NEW_LINE>copy(printElement);<NEW_LINE>} else {<NEW_LINE>fillContext.registerDelayedEvaluation(printElement, sortComponent.getEvaluationTime(), null);<NEW_LINE>}<NEW_LINE>result = FillPrepareResult.PRINT_NO_STRETCH;<NEW_LINE>return result;<NEW_LINE>} | setWidth(element.getWidth()); |
383,574 | protected void onValidSignature(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {<NEW_LINE>ConsumerAuthentication authentication = (ConsumerAuthentication) SecurityContextHolder.getContext().getAuthentication();<NEW_LINE>String token = authentication.getConsumerCredentials().getToken();<NEW_LINE>OAuthAccessProviderToken accessToken = null;<NEW_LINE>if (StringUtils.hasText(token)) {<NEW_LINE>OAuthProviderToken authToken = getTokenServices().getToken(token);<NEW_LINE>if (authToken == null) {<NEW_LINE>throw new AccessDeniedException("Invalid access token.");<NEW_LINE>} else if (!authToken.isAccessToken()) {<NEW_LINE>throw new AccessDeniedException("Token should be an access token.");<NEW_LINE>} else if (authToken instanceof OAuthAccessProviderToken) {<NEW_LINE>accessToken = (OAuthAccessProviderToken) authToken;<NEW_LINE>}<NEW_LINE>} else if ((!(authentication.getConsumerDetails() instanceof ExtraTrustConsumerDetails)) || ((ExtraTrustConsumerDetails) authentication.getConsumerDetails()).isRequiredToObtainAuthenticatedToken()) {<NEW_LINE>throw new InvalidOAuthParametersException(messages.getMessage("ProtectedResourceProcessingFilter.missingToken", "Missing auth token."));<NEW_LINE>}<NEW_LINE>Authentication userAuthentication = authHandler.<MASK><NEW_LINE>SecurityContextHolder.getContext().setAuthentication(userAuthentication);<NEW_LINE>chain.doFilter(request, response);<NEW_LINE>} | createAuthentication(request, authentication, accessToken); |
1,471,800 | private void buildAndShowDialog() {<NEW_LINE>FormLayout layout = new FormLayout("5px,100px,5px,left:default,5px:grow(1.0)");<NEW_LINE>final XFormDialog dialog = ADialogBuilder.buildDialog(AuthorizationTypeForm.class, null, layout);<NEW_LINE>profileNameField = (JTextFieldFormField) <MASK><NEW_LINE>profileNameField.addFormFieldListener(new ProfileNameFieldListener(dialog));<NEW_LINE>hintTextLabel = (JLabelFormField) dialog.getFormField(AuthorizationTypeForm.OAUTH2_PROFILE_NAME_HINT_TEXT_LABEL);<NEW_LINE>setHintTextColor();<NEW_LINE>setProfileNameAndHintTextVisibility(request.getAuthType());<NEW_LINE>List<String> authTypes = getBasicAuthenticationTypes();<NEW_LINE>authTypes.removeAll(request.getBasicAuthenticationProfiles());<NEW_LINE>if (request instanceof RestRequest) {<NEW_LINE>authTypes.add(CredentialsConfig.AuthType.O_AUTH_2_0.toString());<NEW_LINE>authTypes.add(CredentialsConfig.AuthType.O_AUTH_1_0.toString());<NEW_LINE>int nextProfileIndex = getOAuth2ProfileContainer().getOAuth2ProfileList().size() + 1;<NEW_LINE>profileNameField.setValue("Profile " + nextProfileIndex);<NEW_LINE>}<NEW_LINE>setAuthTypeComboBoxOptions(dialog, authTypes);<NEW_LINE>dialog.setValue(AuthorizationTypeForm.AUTHORIZATION_TYPE, request.getAuthType());<NEW_LINE>if (dialog.show()) {<NEW_LINE>createProfileForSelectedAuthType(dialog);<NEW_LINE>}<NEW_LINE>} | dialog.getFormField(AuthorizationTypeForm.OAUTH_PROFILE_NAME_FIELD); |
1,033,038 | private void displayDialog(JPanel parent, String title, String helpId) {<NEW_LINE>BetterInputDialog dialog = new BetterInputDialog(parent, title, helpId, this);<NEW_LINE>do {<NEW_LINE>int dialogChoice = dialog.display();<NEW_LINE>if (dialogChoice == dialog.CANCEL_OPTION) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (dialogChoice == dialog.OK_OPTION) {<NEW_LINE>Collection errors = getErrors();<NEW_LINE>String newPrincipalName = getPrincipalName();<NEW_LINE>String oldPrincipalName = getOriginalPrincipalName();<NEW_LINE>String newClassName = getClassName();<NEW_LINE>String oldClassName = getOriginalClassName();<NEW_LINE>if (dialog.hasErrors()) {<NEW_LINE>// !PW is this even necessary w/ new validation model?<NEW_LINE>dialog.showErrors();<NEW_LINE>} else {<NEW_LINE>// Add to security model of this descriptor<NEW_LINE>if (!Utils.strEquals(newPrincipalName, oldPrincipalName) || !Utils.strEquals(newClassName, oldClassName)) {<NEW_LINE>PrincipalNameMapping oldEntry <MASK><NEW_LINE>PrincipalNameMapping newEntry = new PrincipalNameMapping(newPrincipalName, newClassName);<NEW_LINE>principalModel.replaceElement(oldEntry, newEntry);<NEW_LINE>}<NEW_LINE>// Also add to global mapping list if not already present.<NEW_LINE>// PrincipalNameMapping tmpMapping = new PrincipalNameMapping(newPrincipalName, newClassName);<NEW_LINE>// if(!existingPrincipalsModel.contains(tmpMapping)) {<NEW_LINE>// existingPrincipalsModel.addElement(tmpMapping);<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (dialog.hasErrors());<NEW_LINE>} | = new PrincipalNameMapping(oldPrincipalName, oldClassName); |
694,341 | public BackgroundException map(final FailedRequestException e) {<NEW_LINE>final StringBuilder buffer = new StringBuilder();<NEW_LINE>if (null != e.getError()) {<NEW_LINE>this.append(buffer, e.getError().getMessage());<NEW_LINE>}<NEW_LINE>switch(e.getStatusCode()) {<NEW_LINE>case HttpStatus.SC_FORBIDDEN:<NEW_LINE>if (null != e.getError()) {<NEW_LINE>if (StringUtils.isNotBlank(e.getError().getCode())) {<NEW_LINE>switch(e.getError().getCode()) {<NEW_LINE>case "SignatureDoesNotMatch":<NEW_LINE>return new LoginFailureException(buffer.toString(), e);<NEW_LINE>case "InvalidAccessKeyId":<NEW_LINE>return new LoginFailureException(buffer.toString(), e);<NEW_LINE>case "InvalidClientTokenId":<NEW_LINE>return new LoginFailureException(buffer.toString(), e);<NEW_LINE>case "InvalidSecurity":<NEW_LINE>return new LoginFailureException(buffer.toString(), e);<NEW_LINE>case "MissingClientTokenId":<NEW_LINE>return new LoginFailureException(buffer.toString(), e);<NEW_LINE>case "MissingAuthenticationToken":<NEW_LINE>return new LoginFailureException(buffer.toString(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e.getCause() instanceof IOException) {<NEW_LINE>return new DefaultIOExceptionMappingService().map((<MASK><NEW_LINE>}<NEW_LINE>return new DefaultHttpResponseExceptionMappingService().map(new HttpResponseException(e.getStatusCode(), buffer.toString()));<NEW_LINE>} | IOException) e.getCause()); |
644,033 | private boolean parseLine(String line) {<NEW_LINE>if (line.startsWith("1..")) {<NEW_LINE>// NOI18N<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (line.startsWith("TAP version ")) {<NEW_LINE>// NOI18N<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (line.startsWith(OK_PREFIX)) {<NEW_LINE>processComments();<NEW_LINE>assert state == null : state;<NEW_LINE>line = line.substring(OK_PREFIX.length());<NEW_LINE>if (isSkippedTest(line)) {<NEW_LINE>List<String> parts = StringUtils.explode(line, SKIP_MARK);<NEW_LINE>addSuiteTest(parts.get(0));<NEW_LINE>if (parts.size() > 1) {<NEW_LINE>testCase.setMessage(parts.get<MASK><NEW_LINE>}<NEW_LINE>testCase.setStatus(TestCase.Status.SKIPPED);<NEW_LINE>testCase = null;<NEW_LINE>} else {<NEW_LINE>addSuiteTest(line);<NEW_LINE>testCase.setStatus(TestCase.Status.PASSED);<NEW_LINE>testCase = null;<NEW_LINE>}<NEW_LINE>} else if (line.startsWith(NOT_OK_PREFIX)) {<NEW_LINE>processComments();<NEW_LINE>assert state == null : state;<NEW_LINE>state = State.NOT_OK;<NEW_LINE>addSuiteTest(line.substring(NOT_OK_PREFIX.length()));<NEW_LINE>testCase.setStatus(TestCase.Status.FAILED);<NEW_LINE>} else {<NEW_LINE>processComment(line);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | (1).trim()); |
392,938 | private WebLogicConfiguration createConfiguration() {<NEW_LINE>InstanceProperties ip = getInstanceProperties();<NEW_LINE>WebLogicConfiguration.Credentials credentials = new InstancePropertiesCredentials(ip);<NEW_LINE>String serverHome = ip.getProperty(WLPluginProperties.SERVER_ROOT_ATTR);<NEW_LINE>String domainHome = ip.getProperty(WLPluginProperties.DOMAIN_ROOT_ATTR);<NEW_LINE>final WebLogicConfiguration config;<NEW_LINE>if (isRemote()) {<NEW_LINE>String uri = ip.getProperty(InstanceProperties.URL_ATTR);<NEW_LINE>// it is guaranteed it is WL<NEW_LINE>String[] parts = uri.substring(WLDeploymentFactory.URI_PREFIX.length<MASK><NEW_LINE>String host = parts[0];<NEW_LINE>String port = parts.length > 1 ? parts[1] : "";<NEW_LINE>int realPort;<NEW_LINE>try {<NEW_LINE>realPort = Integer.parseInt(port);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>realPort = 7001;<NEW_LINE>}<NEW_LINE>boolean secured = Boolean.valueOf(ip.getProperty(WLPluginProperties.SECURED_ATTR));<NEW_LINE>config = WebLogicConfiguration.forRemoteDomain(new File(serverHome), host, realPort, secured, credentials);<NEW_LINE>} else {<NEW_LINE>config = WebLogicConfiguration.forLocalDomain(new File(serverHome), new File(domainHome), credentials);<NEW_LINE>}<NEW_LINE>return config;<NEW_LINE>} | ()).split(":"); |
1,090,514 | public void doReportStat(SofaTracerSpan sofaTracerSpan) {<NEW_LINE>// tags<NEW_LINE>Map<String, String> tagsWithStr = sofaTracerSpan.getTagsWithStr();<NEW_LINE>StatMapKey statKey = new StatMapKey();<NEW_LINE>String appName = tagsWithStr.get(CommonSpanTags.LOCAL_APP);<NEW_LINE>// service name<NEW_LINE>String serviceName = tagsWithStr.get(CommonSpanTags.SERVICE);<NEW_LINE>// method name<NEW_LINE>String methodName = tagsWithStr.get(CommonSpanTags.METHOD);<NEW_LINE>statKey.addKey(CommonSpanTags.LOCAL_APP, appName);<NEW_LINE>statKey.addKey(CommonSpanTags.SERVICE, serviceName);<NEW_LINE>statKey.addKey(CommonSpanTags.METHOD, methodName);<NEW_LINE>String resultCode = tagsWithStr.get(CommonSpanTags.RESULT_CODE);<NEW_LINE>statKey.setResult(SofaTracerConstant.RESULT_CODE_SUCCESS.equals(resultCode) ? SofaTracerConstant.STAT_FLAG_SUCCESS : SofaTracerConstant.STAT_FLAG_FAILS);<NEW_LINE>statKey.setEnd(buildString(new String[] <MASK><NEW_LINE>statKey.setLoadTest(TracerUtils.isLoadTest(sofaTracerSpan));<NEW_LINE>long duration = sofaTracerSpan.getEndTime() - sofaTracerSpan.getStartTime();<NEW_LINE>long[] values = new long[] { 1, duration };<NEW_LINE>this.addStat(statKey, values);<NEW_LINE>} | { getLoadTestMark(sofaTracerSpan) })); |
1,588,153 | public ListServerNeighborsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListServerNeighborsResult listServerNeighborsResult = new ListServerNeighborsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listServerNeighborsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("neighbors", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listServerNeighborsResult.setNeighbors(new ListUnmarshaller<NeighborConnectionDetail>(NeighborConnectionDetailJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listServerNeighborsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("knownDependencyCount", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listServerNeighborsResult.setKnownDependencyCount(context.getUnmarshaller(Long.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listServerNeighborsResult;<NEW_LINE>} | class).unmarshall(context)); |
419,925 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>jComboBox1 = new javax.swing.JComboBox();<NEW_LINE>jLabel1 = new javax.swing.JLabel();<NEW_LINE>jLabel2 = new javax.swing.JLabel();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>jComboBox1.setEditable(true);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(6, 12, 0, 12);<NEW_LINE>add(jComboBox1, gridBagConstraints);<NEW_LINE>jLabel1.setDisplayedMnemonic(org.openide.util.NbBundle.getMessage(ServletUriPanel.class, "LBL_setServletURI_mnem").charAt(0));<NEW_LINE>jLabel1.setLabelFor(jComboBox1);<NEW_LINE>// NOI18N<NEW_LINE>jLabel1.setText(org.openide.util.NbBundle.getMessage(ServletUriPanel.class, "LBL_setServletURI"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor <MASK><NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 12);<NEW_LINE>add(jLabel1, gridBagConstraints);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridy = 2;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(12, 12, 12, 12);<NEW_LINE>add(jLabel2, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ServletUriPanel.class, "A11Y_desc_setServletURI"));<NEW_LINE>} | = java.awt.GridBagConstraints.WEST; |
1,122,646 | public Request<RemoveClientIDFromOpenIDConnectProviderRequest> marshall(RemoveClientIDFromOpenIDConnectProviderRequest removeClientIDFromOpenIDConnectProviderRequest) {<NEW_LINE>if (removeClientIDFromOpenIDConnectProviderRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<RemoveClientIDFromOpenIDConnectProviderRequest> request = new DefaultRequest<RemoveClientIDFromOpenIDConnectProviderRequest>(removeClientIDFromOpenIDConnectProviderRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "RemoveClientIDFromOpenIDConnectProvider");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (removeClientIDFromOpenIDConnectProviderRequest.getOpenIDConnectProviderArn() != null) {<NEW_LINE>request.addParameter("OpenIDConnectProviderArn", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (removeClientIDFromOpenIDConnectProviderRequest.getClientID() != null) {<NEW_LINE>request.addParameter("ClientID", StringUtils.fromString(removeClientIDFromOpenIDConnectProviderRequest.getClientID()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (removeClientIDFromOpenIDConnectProviderRequest.getOpenIDConnectProviderArn())); |
1,561,747 | public NetworkConnection createConnection(Object endpoint) throws FrameworkException {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "createConnection", endpoint);<NEW_LINE>NetworkConnection conn = null;<NEW_LINE>try {<NEW_LINE>// Create the connection from the VC Factory. As we are connecting using an EP, we must<NEW_LINE>// cast to the right VCF<NEW_LINE>// Romil liberty changes<NEW_LINE>VirtualConnectionFactory wsVcf = vcFactory;<NEW_LINE>OutboundVirtualConnection vc = <MASK><NEW_LINE>conn = new CFWNetworkConnection(vc);<NEW_LINE>} catch (ChannelFrameworkException e) {<NEW_LINE>FFDCFilter.processException(e, CLASS_NAME + ".createConnection", JFapChannelConstants.CFWNETWORKCONNECTIONFACT_CREATECONN_01, new Object[] { this, endpoint });<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>SibTr.debug(this, tc, "Unable to create connection", e);<NEW_LINE>throw new FrameworkException(e);<NEW_LINE>}<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "createConnection", conn);<NEW_LINE>return conn;<NEW_LINE>} | (OutboundVirtualConnection) wsVcf.createConnection(); |
1,809,165 | private static MetricEnrichedSeriesData fromInner(SeriesResult innerEnrichedSeriesData) {<NEW_LINE>final MetricEnrichedSeriesData enrichedSeriesData = new MetricEnrichedSeriesData();<NEW_LINE>DimensionKey seriesKey;<NEW_LINE>if (innerEnrichedSeriesData.getSeries().getDimension() != null) {<NEW_LINE>seriesKey = new DimensionKey(innerEnrichedSeriesData.getSeries().getDimension());<NEW_LINE>} else {<NEW_LINE>seriesKey = new DimensionKey();<NEW_LINE>}<NEW_LINE>MetricEnrichedSeriesDataHelper.setSeriesKey(enrichedSeriesData, seriesKey);<NEW_LINE>List<OffsetDateTime> timestampList = innerEnrichedSeriesData.getTimestampList();<NEW_LINE>if (timestampList == null) {<NEW_LINE>timestampList = new ArrayList<>();<NEW_LINE>}<NEW_LINE>MetricEnrichedSeriesDataHelper.setTimestamps(enrichedSeriesData, timestampList);<NEW_LINE>List<Double> valueList = innerEnrichedSeriesData.getValueList();<NEW_LINE>if (valueList == null) {<NEW_LINE>valueList = new ArrayList<>();<NEW_LINE>}<NEW_LINE>MetricEnrichedSeriesDataHelper.setMetricValues(enrichedSeriesData, valueList);<NEW_LINE>List<Boolean> isAnomalyList = innerEnrichedSeriesData.getIsAnomalyList();<NEW_LINE>if (isAnomalyList == null) {<NEW_LINE>isAnomalyList = new ArrayList<>();<NEW_LINE>}<NEW_LINE>MetricEnrichedSeriesDataHelper.setIsAnomalyList(enrichedSeriesData, isAnomalyList);<NEW_LINE>List<Integer> periodList = innerEnrichedSeriesData.getPeriodList();<NEW_LINE>if (periodList == null) {<NEW_LINE>periodList = new ArrayList<>();<NEW_LINE>}<NEW_LINE>MetricEnrichedSeriesDataHelper.setPeriods(enrichedSeriesData, periodList);<NEW_LINE>List<Double> expectedValueList = innerEnrichedSeriesData.getExpectedValueList();<NEW_LINE>if (expectedValueList == null) {<NEW_LINE>expectedValueList = new ArrayList<>();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>List<Double> lowerBoundList = innerEnrichedSeriesData.getLowerBoundaryList();<NEW_LINE>if (lowerBoundList == null) {<NEW_LINE>lowerBoundList = new ArrayList<>();<NEW_LINE>}<NEW_LINE>MetricEnrichedSeriesDataHelper.setLowerBoundaryValues(enrichedSeriesData, lowerBoundList);<NEW_LINE>List<Double> upperBoundList = innerEnrichedSeriesData.getUpperBoundaryList();<NEW_LINE>if (upperBoundList == null) {<NEW_LINE>upperBoundList = new ArrayList<>();<NEW_LINE>}<NEW_LINE>MetricEnrichedSeriesDataHelper.setUpperBoundaryValues(enrichedSeriesData, upperBoundList);<NEW_LINE>return enrichedSeriesData;<NEW_LINE>} | MetricEnrichedSeriesDataHelper.setExpectedMetricValues(enrichedSeriesData, expectedValueList); |
1,593,098 | public static void main(String[] argv) throws IOException {<NEW_LINE>FindBugs.setNoAnalysis();<NEW_LINE>final UnionResultsCommandLine commandLine = new UnionResultsCommandLine();<NEW_LINE>int argCount = commandLine.parse(argv, 2, Integer.MAX_VALUE, "Usage: " + UnionResults.class.getName() + " [options] [<results1> <results2> ... <resultsn>] ");<NEW_LINE>SortedBugCollection results = null;<NEW_LINE>HashSet<String> hashes = new HashSet<>();<NEW_LINE>for (int i = argCount; i < argv.length; i++) {<NEW_LINE>try {<NEW_LINE>SortedBugCollection more = new SortedBugCollection();<NEW_LINE>more<MASK><NEW_LINE>if (results == null) {<NEW_LINE>results = more.createEmptyCollectionWithMetadata();<NEW_LINE>}<NEW_LINE>merge(hashes, results, more);<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("Trouble reading/parsing " + argv[i]);<NEW_LINE>} catch (DocumentException e) {<NEW_LINE>System.err.println("Trouble reading/parsing " + argv[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (results == null) {<NEW_LINE>System.err.println("No files successfully read");<NEW_LINE>System.exit(1);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>results.setWithMessages(commandLine.withMessages);<NEW_LINE>if (commandLine.outputFile == null) {<NEW_LINE>results.writeXML(System.out);<NEW_LINE>} else {<NEW_LINE>results.writeXML(commandLine.outputFile);<NEW_LINE>}<NEW_LINE>} | .readXML(argv[i]); |
88,908 | private void acquire0(final Promise<Channel> promise) {<NEW_LINE>try {<NEW_LINE>assert executor.inEventLoop();<NEW_LINE>if (closed) {<NEW_LINE>promise.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (acquiredChannelCount.get() < maxConnections) {<NEW_LINE>assert acquiredChannelCount.get() >= 0;<NEW_LINE>// We need to create a new promise as we need to ensure the AcquireListener runs in the correct<NEW_LINE>// EventLoop<NEW_LINE>Promise<Channel> p = executor.newPromise();<NEW_LINE>AcquireListener l = new AcquireListener(promise);<NEW_LINE>l.acquired();<NEW_LINE>p.addListener(l);<NEW_LINE>super.acquire(p);<NEW_LINE>} else {<NEW_LINE>if (pendingAcquireCount >= maxPendingAcquires) {<NEW_LINE>tooManyOutstanding(promise);<NEW_LINE>} else {<NEW_LINE>AcquireTask task = new AcquireTask(promise);<NEW_LINE>if (pendingAcquireQueue.offer(task)) {<NEW_LINE>++pendingAcquireCount;<NEW_LINE>if (timeoutTask != null) {<NEW_LINE>task.timeoutFuture = executor.schedule(timeoutTask, acquireTimeoutNanos, TimeUnit.NANOSECONDS);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>tooManyOutstanding(promise);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert pendingAcquireCount > 0;<NEW_LINE>}<NEW_LINE>} catch (Throwable cause) {<NEW_LINE>promise.tryFailure(cause);<NEW_LINE>}<NEW_LINE>} | setFailure(new IllegalStateException("FixedChannelPool was closed")); |
1,607,679 | public void testTimeoutNonRoutable(Map<String, String> param, StringBuilder ret) {<NEW_LINE>// https://stackoverflow.com/a/904609/6575578<NEW_LINE>String timeout = param.get("timeout");<NEW_LINE>long longTimeout = 0L;<NEW_LINE>String res = null;<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>Client c = null;<NEW_LINE>try {<NEW_LINE>longTimeout = Long.parseLong(timeout);<NEW_LINE>cb.<MASK><NEW_LINE>cb.readTimeout(longTimeout * 2, TimeUnit.MILLISECONDS);<NEW_LINE>c = cb.build();<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>res = c.target("http://" + "192.168.0.0" + "/" + moduleName + "/JAXRS21TimeoutClientTest/BasicResource").path("echo").path(param.get("param")).request().get(String.class);<NEW_LINE>} catch (Exception e2) {<NEW_LINE>e2.printStackTrace();<NEW_LINE>long timeElapsed = System.currentTimeMillis() - startTime;<NEW_LINE>long fudgeFactorTime = 4000;<NEW_LINE>if (isWindows) {<NEW_LINE>fudgeFactorTime = 8000;<NEW_LINE>}<NEW_LINE>if (timeElapsed - fudgeFactorTime < longTimeout && timeElapsed + fudgeFactorTime > longTimeout) {<NEW_LINE>res = "[Basic Resource]:testTimeoutNonRoutable";<NEW_LINE>} else {<NEW_LINE>res = "[Basic Resource]:testExceptionUnrelatedToConnectTimeout " + e2.toString() + " timeElapsed: " + timeElapsed + " fudgeFactorTime: " + fudgeFactorTime + " longTimeout: " + longTimeout;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>res = "[Timeout Error]:" + e.toString();<NEW_LINE>} finally {<NEW_LINE>if (c != null) {<NEW_LINE>c.close();<NEW_LINE>}<NEW_LINE>ret.append(res);<NEW_LINE>}<NEW_LINE>} | connectTimeout(longTimeout, TimeUnit.MILLISECONDS); |
1,280,372 | public void createAndSplitGetValuesMethod(ClassWriter cw, Map<String, BField> fields, String className, JvmCastGen jvmCastGen) {<NEW_LINE>MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "values", MAP_VALUES, MAP_VALUES_WITH_COLLECTION, null);<NEW_LINE>mv.visitCode();<NEW_LINE>int selfIndex = 0;<NEW_LINE>int valuesVarIndex = 1;<NEW_LINE>mv.visitTypeInsn(NEW, ARRAY_LIST);<NEW_LINE>mv.visitInsn(DUP);<NEW_LINE>mv.visitMethodInsn(INVOKESPECIAL, ARRAY_LIST, JVM_INIT_METHOD, "()V", false);<NEW_LINE>mv.visitVarInsn(ASTORE, valuesVarIndex);<NEW_LINE>if (!fields.isEmpty()) {<NEW_LINE>mv.visitVarInsn(ALOAD, selfIndex);<NEW_LINE>mv.visitVarInsn(ALOAD, valuesVarIndex);<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, className, "values", COLLECTION_OP, false);<NEW_LINE>splitGetValuesMethod(cw, fields, className, jvmCastGen);<NEW_LINE>}<NEW_LINE>mv.visitVarInsn(ALOAD, valuesVarIndex);<NEW_LINE>// this<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitMethodInsn(INVOKESPECIAL, MAP_VALUE_IMPL, "values", MAP_VALUES, false);<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, <MASK><NEW_LINE>mv.visitInsn(POP);<NEW_LINE>mv.visitVarInsn(ALOAD, 1);<NEW_LINE>mv.visitInsn(ARETURN);<NEW_LINE>mv.visitMaxs(0, 0);<NEW_LINE>mv.visitEnd();<NEW_LINE>} | LIST, "addAll", ADD_COLLECTION, true); |
1,419,684 | private void updateButtons() {<NEW_LINE>final Tree tree = columnsViewer.getTree();<NEW_LINE>final TreeItem[] selection = tree.getSelection();<NEW_LINE>final boolean moveDownEnabled = selection.length > 0 && tree.indexOf(selection[selection.length - 1]) <MASK><NEW_LINE>final boolean moveUpEnabled = selection.length > 0 && tree.indexOf(selection[0]) != 0;<NEW_LINE>final boolean moveToBottomEnabled = selection.length > 0 && tree.indexOf(selection[0]) != tree.getItemCount() - selection.length;<NEW_LINE>final boolean moveToTopEnabled = selection.length > 0 && tree.indexOf(selection[selection.length - 1]) != selection.length - 1;<NEW_LINE>moveBottomButton.setEnabled(moveToBottomEnabled);<NEW_LINE>moveDownButton.setEnabled(moveDownEnabled);<NEW_LINE>moveTopButton.setEnabled(moveToTopEnabled);<NEW_LINE>moveUpButton.setEnabled(moveUpEnabled);<NEW_LINE>} | != tree.getItemCount() - 1; |
657,770 | public void marshall(IdentityMailFromDomainAttributes _identityMailFromDomainAttributes, Request<?> request, String _prefix) {<NEW_LINE>String prefix;<NEW_LINE>if (_identityMailFromDomainAttributes.getMailFromDomain() != null) {<NEW_LINE>prefix = _prefix + "MailFromDomain";<NEW_LINE>String mailFromDomain = _identityMailFromDomainAttributes.getMailFromDomain();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(mailFromDomain));<NEW_LINE>}<NEW_LINE>if (_identityMailFromDomainAttributes.getMailFromDomainStatus() != null) {<NEW_LINE>prefix = _prefix + "MailFromDomainStatus";<NEW_LINE>String mailFromDomainStatus = _identityMailFromDomainAttributes.getMailFromDomainStatus();<NEW_LINE>request.addParameter(prefix<MASK><NEW_LINE>}<NEW_LINE>if (_identityMailFromDomainAttributes.getBehaviorOnMXFailure() != null) {<NEW_LINE>prefix = _prefix + "BehaviorOnMXFailure";<NEW_LINE>String behaviorOnMXFailure = _identityMailFromDomainAttributes.getBehaviorOnMXFailure();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(behaviorOnMXFailure));<NEW_LINE>}<NEW_LINE>} | , StringUtils.fromString(mailFromDomainStatus)); |
754,193 | public T readArrayMappingJSONBObject(JSONReader jsonReader, Type fieldType, Object fieldName, long features) {<NEW_LINE>ObjectReader autoTypeReader = checkAutoType(jsonReader, this.objectClass, this.features | features);<NEW_LINE>if (autoTypeReader != null && autoTypeReader != this && autoTypeReader.getObjectClass() != this.objectClass) {<NEW_LINE>return (T) autoTypeReader.readArrayMappingJSONBObject(jsonReader, fieldType, fieldName, features);<NEW_LINE>}<NEW_LINE>jsonReader.startArray();<NEW_LINE><MASK><NEW_LINE>fieldReader0.readFieldValue(jsonReader, object);<NEW_LINE>fieldReader1.readFieldValue(jsonReader, object);<NEW_LINE>fieldReader2.readFieldValue(jsonReader, object);<NEW_LINE>fieldReader3.readFieldValue(jsonReader, object);<NEW_LINE>fieldReader4.readFieldValue(jsonReader, object);<NEW_LINE>fieldReader5.readFieldValue(jsonReader, object);<NEW_LINE>if (buildFunction != null) {<NEW_LINE>return (T) buildFunction.apply(object);<NEW_LINE>}<NEW_LINE>return (T) object;<NEW_LINE>} | Object object = defaultCreator.get(); |
1,353,729 | private static SerdeAndForgeables planBaseNestable(BaseNestableEventType eventType, StatementRawInfo raw, SerdeCompileTimeResolver resolver) {<NEW_LINE>String className;<NEW_LINE>if (eventType instanceof JsonEventType) {<NEW_LINE>String classNameFull = ((JsonEventType) eventType).getDetail().getSerdeClassName();<NEW_LINE>int lastDotIndex = classNameFull.lastIndexOf('.');<NEW_LINE>className = lastDotIndex == -1 ? classNameFull : classNameFull.substring(lastDotIndex + 1);<NEW_LINE>} else {<NEW_LINE>String uuid = generateClassNameUUID();<NEW_LINE>className = generateClassNameWithUUID(DataInputOutputSerde.class, eventType.getMetadata(<MASK><NEW_LINE>}<NEW_LINE>DataInputOutputSerdeForge optionalApplicationSerde = resolver.serdeForEventTypeExternalProvider(eventType, raw);<NEW_LINE>if (optionalApplicationSerde != null) {<NEW_LINE>return new SerdeAndForgeables(optionalApplicationSerde, Collections.emptyList());<NEW_LINE>}<NEW_LINE>DataInputOutputSerdeForge[] forges = new DataInputOutputSerdeForge[eventType.getTypes().size()];<NEW_LINE>int count = 0;<NEW_LINE>for (Map.Entry<String, Object> property : eventType.getTypes().entrySet()) {<NEW_LINE>SerdeEventPropertyDesc desc = forgeForEventProperty(eventType, property.getKey(), property.getValue(), raw, resolver);<NEW_LINE>forges[count] = desc.getForge();<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>StmtClassForgeableFactory forgeable = new StmtClassForgeableFactory() {<NEW_LINE><NEW_LINE>public StmtClassForgeable make(CodegenPackageScope packageScope, String classPostfix) {<NEW_LINE>return new StmtClassForgeableBaseNestableEventTypeSerde(className, packageScope, eventType, forges);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>DataInputOutputSerdeForgeOfForges forge = new DataInputOutputSerdeForgeOfForges(className, forges);<NEW_LINE>return new SerdeAndForgeables(forge, Collections.singletonList(forgeable));<NEW_LINE>} | ).getName(), uuid); |
402,367 | private Result createResultFromCompleteList(Repository repository, Set<String> rootFeatures) {<NEW_LINE>final Set<String> <MASK><NEW_LINE>final Set<String> resolved = new LinkedHashSet<>();<NEW_LINE>for (String featureName : rootFeatures) {<NEW_LINE>ProvisioningFeatureDefinition feature = repository.getFeature(featureName);<NEW_LINE>if (feature == null) {<NEW_LINE>missing.add(featureName);<NEW_LINE>} else {<NEW_LINE>resolved.add(feature.getFeatureName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Result() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasErrors() {<NEW_LINE>return !getMissing().isEmpty();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, Chain> getWrongProcessTypes() {<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Set<String> getResolvedFeatures() {<NEW_LINE>return resolved;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Set<String> getNonPublicRoots() {<NEW_LINE>return Collections.emptySet();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Set<String> getMissing() {<NEW_LINE>return missing;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, Collection<Chain>> getConflicts() {<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | missing = new HashSet<>(); |
1,466,285 | private Specification<Quote> createSpecification(QuoteCriteria criteria) {<NEW_LINE>Specification<Quote> specification = Specification.where(null);<NEW_LINE>if (criteria != null) {<NEW_LINE>if (criteria.getId() != null) {<NEW_LINE>specification = specification.and(buildSpecification(criteria.getId(), Quote_.id));<NEW_LINE>}<NEW_LINE>if (criteria.getSymbol() != null) {<NEW_LINE>specification = specification.and(buildStringSpecification(criteria.getSymbol<MASK><NEW_LINE>}<NEW_LINE>if (criteria.getPrice() != null) {<NEW_LINE>specification = specification.and(buildRangeSpecification(criteria.getPrice(), Quote_.price));<NEW_LINE>}<NEW_LINE>if (criteria.getLastTrade() != null) {<NEW_LINE>specification = specification.and(buildRangeSpecification(criteria.getLastTrade(), Quote_.lastTrade));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return specification;<NEW_LINE>} | (), Quote_.symbol)); |
1,042,290 | public Map<Integer, Long> queryMinOffsetInAllGroup(final String topic, final String filterGroups) {<NEW_LINE>Map<Integer, Long> queueMinOffset = new HashMap<Integer, Long>();<NEW_LINE>Set<String> topicGroups = this.offsetTable.keySet();<NEW_LINE>if (!UtilAll.isBlank(filterGroups)) {<NEW_LINE>for (String group : filterGroups.split(",")) {<NEW_LINE>Iterator<String> it = topicGroups.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>if (group.equals(it.next().split(TOPIC_GROUP_SEPARATOR)[1])) {<NEW_LINE>it.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, ConcurrentMap<Integer, Long>> offSetEntry : this.offsetTable.entrySet()) {<NEW_LINE><MASK><NEW_LINE>String[] topicGroupArr = topicGroup.split(TOPIC_GROUP_SEPARATOR);<NEW_LINE>if (topic.equals(topicGroupArr[0])) {<NEW_LINE>for (Entry<Integer, Long> entry : offSetEntry.getValue().entrySet()) {<NEW_LINE>long minOffset = this.brokerController.getMessageStore().getMinOffsetInQueue(topic, entry.getKey());<NEW_LINE>if (entry.getValue() >= minOffset) {<NEW_LINE>Long offset = queueMinOffset.get(entry.getKey());<NEW_LINE>if (offset == null) {<NEW_LINE>queueMinOffset.put(entry.getKey(), Math.min(Long.MAX_VALUE, entry.getValue()));<NEW_LINE>} else {<NEW_LINE>queueMinOffset.put(entry.getKey(), Math.min(entry.getValue(), offset));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return queueMinOffset;<NEW_LINE>} | String topicGroup = offSetEntry.getKey(); |
1,463,108 | private void appendInternalArchiveLabel(IPackageFragmentRoot root, long flags) {<NEW_LINE>IResource resource = root.getResource();<NEW_LINE>boolean rootQualified = getFlag(flags, JavaElementLabels.ROOT_QUALIFIED);<NEW_LINE>if (rootQualified) {<NEW_LINE>fBuilder.append(root.getPath().makeRelative().toString());<NEW_LINE>} else {<NEW_LINE>fBuilder.append(root.getElementName());<NEW_LINE>boolean referencedPostQualified = getFlag(flags, JavaElementLabels.REFERENCED_ROOT_POST_QUALIFIED);<NEW_LINE>if (referencedPostQualified && isReferenced(root)) {<NEW_LINE><MASK><NEW_LINE>fBuilder.append(resource.getParent().getFullPath().makeRelative().toString());<NEW_LINE>} else if (getFlag(flags, JavaElementLabels.ROOT_POST_QUALIFIED)) {<NEW_LINE>fBuilder.append(JavaElementLabels.CONCAT_STRING);<NEW_LINE>fBuilder.append(root.getParent().getPath().makeRelative().toString());<NEW_LINE>}<NEW_LINE>if (referencedPostQualified) {<NEW_LINE>try {<NEW_LINE>IClasspathEntry referencingEntry = JavaModelUtil.getClasspathEntry(root).getReferencingEntry();<NEW_LINE>if (referencingEntry != null) {<NEW_LINE>fBuilder.append(NLS.bind(" (from {0} of {1})", new Object[] { Name.CLASS_PATH.toString(), referencingEntry.getPath().lastSegment() }));<NEW_LINE>}<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | fBuilder.append(JavaElementLabels.CONCAT_STRING); |
488,863 | public void kill(DataSegment segment) throws SegmentLoadingException {<NEW_LINE>try {<NEW_LINE>Map<String, Object> loadSpec = segment.getLoadSpec();<NEW_LINE>String s3Bucket = MapUtils.getString(loadSpec, "bucket");<NEW_LINE>String s3Path = MapUtils.getString(loadSpec, "key");<NEW_LINE>String s3DescriptorPath = DataSegmentKiller.descriptorPath(s3Path);<NEW_LINE>final ServerSideEncryptingAmazonS3 s3Client = this.s3ClientSupplier.get();<NEW_LINE>if (s3Client.doesObjectExist(s3Bucket, s3Path)) {<NEW_LINE>log.info("Removing index file[s3://%s/%s] from s3!", s3Bucket, s3Path);<NEW_LINE>s3Client.deleteObject(s3Bucket, s3Path);<NEW_LINE>}<NEW_LINE>// descriptor.json is a file to store segment metadata in deep storage. This file is deprecated and not stored<NEW_LINE>// anymore, but we still delete them if exists.<NEW_LINE>if (s3Client.doesObjectExist(s3Bucket, s3DescriptorPath)) {<NEW_LINE>log.info("Removing descriptor file[s3://%s/%s] from s3!", s3Bucket, s3DescriptorPath);<NEW_LINE>s3Client.deleteObject(s3Bucket, s3DescriptorPath);<NEW_LINE>}<NEW_LINE>} catch (AmazonServiceException e) {<NEW_LINE>throw new SegmentLoadingException(e, "Couldn't kill segment[%s]: [%s]", <MASK><NEW_LINE>}<NEW_LINE>} | segment.getId(), e); |
1,236,335 | private static void createRecording(final Aeron aeron, final AeronArchive aeronArchive, final long startPosition, final long targetPosition) {<NEW_LINE>final int initialTermId = 7;<NEW_LINE>recordingNumber++;<NEW_LINE>final ChannelUriStringBuilder uriBuilder = new ChannelUriStringBuilder().media("udp").endpoint("localhost:" <MASK><NEW_LINE>if (startPosition > 0) {<NEW_LINE>uriBuilder.initialPosition(startPosition, initialTermId, TERM_LENGTH);<NEW_LINE>}<NEW_LINE>try (Publication publication = aeronArchive.addRecordedExclusivePublication(uriBuilder.build(), STREAM_ID)) {<NEW_LINE>final CountersReader counters = aeron.countersReader();<NEW_LINE>final int counterId = awaitRecordingCounterId(counters, publication.sessionId());<NEW_LINE>final long recordingId = RecordingPos.getRecordingId(counters, counterId);<NEW_LINE>System.out.println("recordingId=" + recordingId + " position " + publication.position() + " to " + targetPosition);<NEW_LINE>offerToPosition(publication, targetPosition);<NEW_LINE>awaitPosition(counters, counterId, publication.position());<NEW_LINE>aeronArchive.stopRecording(publication);<NEW_LINE>}<NEW_LINE>} | + recordingNumber).termLength(TERM_LENGTH); |
1,212,663 | public synchronized // sf@2005)<NEW_LINE>void // sf@2005)<NEW_LINE>writeSetPixelFormat(// sf@2005)<NEW_LINE>int bitsPerPixel, // sf@2005)<NEW_LINE>int depth, // sf@2005)<NEW_LINE>boolean bigEndian, // sf@2005)<NEW_LINE>boolean trueColour, // sf@2005)<NEW_LINE>int redMax, // sf@2005)<NEW_LINE>int greenMax, // sf@2005)<NEW_LINE>int blueMax, // sf@2005)<NEW_LINE>int redShift, // sf@2005)<NEW_LINE>int greenShift, // sf@2005)<NEW_LINE>int blueShift, boolean fGreyScale) {<NEW_LINE>byte[] b = new byte[20];<NEW_LINE>b[0] = (byte) SetPixelFormat;<NEW_LINE>b[4] = (byte) bitsPerPixel;<NEW_LINE>b[5] = (byte) depth;<NEW_LINE>b[6] = (byte) (bigEndian ? 1 : 0);<NEW_LINE>b[7] = (byte) (trueColour ? 1 : 0);<NEW_LINE>b[8] = (byte) ((redMax >> 8) & 0xff);<NEW_LINE>b[9] = (byte) (redMax & 0xff);<NEW_LINE>b[10] = (byte) ((greenMax >> 8) & 0xff);<NEW_LINE>b[11] = <MASK><NEW_LINE>b[12] = (byte) ((blueMax >> 8) & 0xff);<NEW_LINE>b[13] = (byte) (blueMax & 0xff);<NEW_LINE>b[14] = (byte) redShift;<NEW_LINE>b[15] = (byte) greenShift;<NEW_LINE>b[16] = (byte) blueShift;<NEW_LINE>// sf@2005<NEW_LINE>b[17] = (byte) (fGreyScale ? 1 : 0);<NEW_LINE>try {<NEW_LINE>os.write(b);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.e(TAG, "Could not write setPixelFormat message to VNC server.");<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | (byte) (greenMax & 0xff); |
1,346,155 | public boolean insertGlobalTransactionDO(GlobalTransactionDO globalTransactionDO) {<NEW_LINE>String sql = LogStoreSqlsFactory.getLogStoreSqls(dbType).getInsertGlobalTransactionSQL(globalTable);<NEW_LINE>Connection conn = null;<NEW_LINE>PreparedStatement ps = null;<NEW_LINE>try {<NEW_LINE>int index = 1;<NEW_LINE>conn = logStoreDataSource.getConnection();<NEW_LINE>conn.setAutoCommit(true);<NEW_LINE><MASK><NEW_LINE>ps.setString(index++, globalTransactionDO.getXid());<NEW_LINE>ps.setLong(index++, globalTransactionDO.getTransactionId());<NEW_LINE>ps.setInt(index++, globalTransactionDO.getStatus());<NEW_LINE>ps.setString(index++, globalTransactionDO.getApplicationId());<NEW_LINE>ps.setString(index++, globalTransactionDO.getTransactionServiceGroup());<NEW_LINE>String transactionName = globalTransactionDO.getTransactionName();<NEW_LINE>transactionName = transactionName.length() > transactionNameColumnSize ? transactionName.substring(0, transactionNameColumnSize) : transactionName;<NEW_LINE>ps.setString(index++, transactionName);<NEW_LINE>ps.setInt(index++, globalTransactionDO.getTimeout());<NEW_LINE>ps.setLong(index++, globalTransactionDO.getBeginTime());<NEW_LINE>ps.setString(index++, globalTransactionDO.getApplicationData());<NEW_LINE>return ps.executeUpdate() > 0;<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new StoreException(e);<NEW_LINE>} finally {<NEW_LINE>IOUtil.close(ps, conn);<NEW_LINE>}<NEW_LINE>} | ps = conn.prepareStatement(sql); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.