idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,225,902 | private Couple<Integer> computeHash(MultiChildDescriptor childDescriptor, PsiFragment parentFragment, NodeSpecificHasher nodeSpecificHasher) {<NEW_LINE>final PsiElement[<MASK><NEW_LINE>if (elements == null) {<NEW_LINE>return Couple.of(0, 0);<NEW_LINE>}<NEW_LINE>switch(childDescriptor.getType()) {<NEW_LINE>case OPTIONALLY_IN_PATTERN:<NEW_LINE>case DEFAULT:<NEW_LINE>TreeHashResult[] childResults = computeHashes(elements, parentFragment, nodeSpecificHasher);<NEW_LINE>int[] hashes = getHashes(childResults);<NEW_LINE>int[] costs = getCosts(childResults);<NEW_LINE>int hash = AbstractTreeHasher.vector(hashes, 31);<NEW_LINE>int cost = AbstractTreeHasher.vector(costs);<NEW_LINE>return Couple.of(hash, cost);<NEW_LINE>case IN_ANY_ORDER:<NEW_LINE>childResults = computeHashes(elements, parentFragment, nodeSpecificHasher);<NEW_LINE>hashes = getHashes(childResults);<NEW_LINE>costs = getCosts(childResults);<NEW_LINE>hash = AbstractTreeHasher.vector(hashes);<NEW_LINE>cost = AbstractTreeHasher.vector(costs);<NEW_LINE>return Couple.of(hash, cost);<NEW_LINE>default:<NEW_LINE>return Couple.of(0, 0);<NEW_LINE>}<NEW_LINE>} | ] elements = childDescriptor.getElements(); |
1,079,522 | private void addDates(Map<Field, String> hm, String lab, String val) {<NEW_LINE>if ("CRDT".equals(lab) && isCreateDateFormat(val)) {<NEW_LINE>hm.put(new UnknownField("create-date"), val);<NEW_LINE>} else if ("DEP".equals(lab) && isDateFormat(val)) {<NEW_LINE>hm.put(new UnknownField("electronic-publication"), val);<NEW_LINE>} else if ("DA".equals(lab) && isDateFormat(val)) {<NEW_LINE>hm.put(new UnknownField("date-created"), val);<NEW_LINE>} else if ("DCOM".equals(lab) && isDateFormat(val)) {<NEW_LINE>hm.put(<MASK><NEW_LINE>} else if ("LR".equals(lab) && isDateFormat(val)) {<NEW_LINE>hm.put(new UnknownField("revised"), val);<NEW_LINE>} else if ("DP".equals(lab)) {<NEW_LINE>String[] parts = val.split(" ");<NEW_LINE>hm.put(StandardField.YEAR, parts[0]);<NEW_LINE>if ((parts.length > 1) && !parts[1].isEmpty()) {<NEW_LINE>hm.put(StandardField.MONTH, parts[1]);<NEW_LINE>}<NEW_LINE>} else if ("EDAT".equals(lab) && isCreateDateFormat(val)) {<NEW_LINE>hm.put(new UnknownField("publication"), val);<NEW_LINE>} else if ("MHDA".equals(lab) && isCreateDateFormat(val)) {<NEW_LINE>hm.put(new UnknownField("mesh-date"), val);<NEW_LINE>}<NEW_LINE>} | new UnknownField("completed"), val); |
109,154 | void handleElementOnClick(final View view) {<NEW_LINE>final int itemPosition = getRecyclerView().getChildAdapterPosition(view);<NEW_LINE>VideoOnDemand item = <MASK><NEW_LINE>if (activity instanceof VODActivity) {<NEW_LINE>((VODActivity) activity).startNewVOD(item);<NEW_LINE>} else {<NEW_LINE>Intent intent = VODActivity.createVODIntent(item, getContext(), true);<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>intent.putExtra(getContext().getString(R.string.stream_preview_url), item.getMediumPreview());<NEW_LINE>intent.putExtra(getContext().getString(R.string.stream_preview_alpha), hasVodBeenWatched(item.getVideoId()) ? VOD_WATCHED_IMAGE_ALPHA : 1.0f);<NEW_LINE>final View sharedView = view.findViewById(R.id.image_stream_preview);<NEW_LINE>sharedView.setTransitionName(getContext().getString(R.string.stream_preview_transition));<NEW_LINE>final ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedView, getContext().getString(R.string.stream_preview_transition));<NEW_LINE>activity.setExitSharedElementCallback(new SharedElementCallback() {<NEW_LINE><NEW_LINE>@SuppressLint("NewApi")<NEW_LINE>@Override<NEW_LINE>public void onSharedElementEnd(List<String> sharedElementNames, List<View> sharedElements, List<View> sharedElementSnapshots) {<NEW_LINE>super.onSharedElementEnd(sharedElementNames, sharedElements, sharedElementSnapshots);<NEW_LINE>sharedView.animate().alpha(VOD_WATCHED_IMAGE_ALPHA).setDuration(300).start();<NEW_LINE>activity.setExitSharedElementCallback(null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>activity.startActivity(intent, options.toBundle());<NEW_LINE>} else {<NEW_LINE>getContext().startActivity(intent);<NEW_LINE>activity.overridePendingTransition(R.anim.slide_in_bottom_anim, R.anim.fade_out_semi_anim);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getElements().get(itemPosition); |
1,780,741 | public static void main(final String[] args) {<NEW_LINE>// Input data consists of one x-coordinate and one y-coordinate<NEW_LINE><MASK><NEW_LINE>cp.array[0] = cp.buildLocation(2, 3);<NEW_LINE>cp.array[1] = cp.buildLocation(2, 16);<NEW_LINE>cp.array[2] = cp.buildLocation(3, 9);<NEW_LINE>cp.array[3] = cp.buildLocation(6, 3);<NEW_LINE>cp.array[4] = cp.buildLocation(7, 7);<NEW_LINE>cp.array[5] = cp.buildLocation(19, 4);<NEW_LINE>cp.array[6] = cp.buildLocation(10, 11);<NEW_LINE>cp.array[7] = cp.buildLocation(15, 2);<NEW_LINE>cp.array[8] = cp.buildLocation(15, 19);<NEW_LINE>cp.array[9] = cp.buildLocation(16, 11);<NEW_LINE>cp.array[10] = cp.buildLocation(17, 13);<NEW_LINE>cp.array[11] = cp.buildLocation(9, 12);<NEW_LINE>System.out.println("Input data");<NEW_LINE>System.out.println("Number of points: " + cp.array.length);<NEW_LINE>for (int i = 0; i < cp.array.length; i++) {<NEW_LINE>System.out.println("x: " + cp.array[i].x + ", y: " + cp.array[i].y);<NEW_LINE>}<NEW_LINE>// Sorting by x value<NEW_LINE>cp.xQuickSort(cp.array, 0, cp.array.length - 1);<NEW_LINE>// minimum distance<NEW_LINE>double result;<NEW_LINE>result = cp.closestPair(cp.array, cp.array.length);<NEW_LINE>// ClosestPair start<NEW_LINE>// minimum distance coordinates and distance output<NEW_LINE>System.out.println("Output Data");<NEW_LINE>System.out.println("(" + cp.point1.x + ", " + cp.point1.y + ")");<NEW_LINE>System.out.println("(" + cp.point2.x + ", " + cp.point2.y + ")");<NEW_LINE>System.out.println("Minimum Distance : " + result);<NEW_LINE>} | ClosestPair cp = new ClosestPair(12); |
1,220,768 | // Package private methods -------------------------------------------------<NEW_LINE>@NonNull<NEW_LINE>private synchronized JavaFileManager createFileManager(@NullAllowed final String sourceLevel) {<NEW_LINE>final <MASK><NEW_LINE>final ProxyFileManager.Configuration cfg = ProxyFileManager.Configuration.create(moduleBootPath, cachedModuleCompilePath, cachedBootClassPath, moduleCompilePath.entries().isEmpty() ? cachedCompileClassPath : cachedModuleClassPath, srcClassPath, cachedSrcClassPath, moduleSrcPath, outputClassPath, cachedAptSrcClassPath, siblings, fmTx, pgTx);<NEW_LINE>cfg.setFilter(filter);<NEW_LINE>cfg.setIgnoreExcludes(ignoreExcludes);<NEW_LINE>cfg.setUseModifiedFiles(useModifiedFiles);<NEW_LINE>cfg.setCustomFileManagerProvider(jfmProvider);<NEW_LINE>for (Map.Entry<ClassPath, Function<URL, Collection<? extends URL>>> e : peerProviders.entrySet()) {<NEW_LINE>cfg.setPeers(e.getKey(), e.getValue());<NEW_LINE>}<NEW_LINE>cfg.setSourceLevel(sourceLevel);<NEW_LINE>return new ProxyFileManager(cfg);<NEW_LINE>} | SiblingSource siblings = SiblingSupport.create(); |
162,179 | public LogResult postLog(@NonNull final LogType logType, @NonNull final Calendar date, @NonNull final String log, @Nullable final String logPassword, @NonNull final List<TrackableLog> trackableLogs, @NonNull final ReportProblemType reportProblem) {<NEW_LINE>try {<NEW_LINE>final CheckBox favCheck = (CheckBox) activity.<MASK><NEW_LINE>final ImmutablePair<StatusCode, String> postResult = GCWebAPI.postLog(cache, logType, date.getTime(), log, trackableLogs, favCheck.isChecked());<NEW_LINE>if (postResult.left == StatusCode.NO_ERROR) {<NEW_LINE>DataStore.saveVisitDate(cache.getGeocode(), date.getTime().getTime());<NEW_LINE>if (logType.isFoundLog()) {<NEW_LINE>GCLogin.getInstance().increaseActualCachesFound();<NEW_LINE>} else if (logType == LogType.TEMP_DISABLE_LISTING) {<NEW_LINE>cache.setDisabled(true);<NEW_LINE>} else if (logType == LogType.ENABLE_LISTING) {<NEW_LINE>cache.setDisabled(false);<NEW_LINE>}<NEW_LINE>if (favCheck.isChecked()) {<NEW_LINE>cache.setFavorite(true);<NEW_LINE>cache.setFavoritePoints(cache.getFavoritePoints() + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (reportProblem != ReportProblemType.NO_PROBLEM) {<NEW_LINE>GCWebAPI.postLog(cache, reportProblem.logType, date.getTime(), CgeoApplication.getInstance().getString(reportProblem.textId), Collections.emptyList(), false);<NEW_LINE>}<NEW_LINE>return new LogResult(postResult.left, postResult.right);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>Log.e("GCLoggingManager.postLog", e);<NEW_LINE>}<NEW_LINE>return new LogResult(StatusCode.LOG_POST_ERROR, "");<NEW_LINE>} | findViewById(R.id.favorite_check); |
415,974 | private RequestBody convertFormDataToRequestBody(List<io.swagger.models.parameters.Parameter> formParams, List<String> consumes) {<NEW_LINE>RequestBody body = new RequestBody();<NEW_LINE>Schema formSchema = new Schema();<NEW_LINE>for (io.swagger.models.parameters.Parameter param : formParams) {<NEW_LINE>SerializableParameter sp;<NEW_LINE>Schema schema;<NEW_LINE>String name;<NEW_LINE>if (param instanceof RefParameter) {<NEW_LINE>RefParameter refParameter = (RefParameter) param;<NEW_LINE>String simpleRef = refParameter.getSimpleRef();<NEW_LINE>sp = (SerializableParameter) globalV2Parameters.get(simpleRef);<NEW_LINE>name = components.getSchemas().get("formData_" + simpleRef).getName();<NEW_LINE>schema = new Schema(<MASK><NEW_LINE>} else {<NEW_LINE>sp = (SerializableParameter) param;<NEW_LINE>schema = convert(sp);<NEW_LINE>name = schema.getName();<NEW_LINE>}<NEW_LINE>if (sp.getRequired()) {<NEW_LINE>formSchema.addRequiredItem(sp.getName());<NEW_LINE>}<NEW_LINE>formSchema.addProperties(name, schema);<NEW_LINE>}<NEW_LINE>List<String> mediaTypes = new ArrayList<>(globalConsumes);<NEW_LINE>if (consumes != null && consumes.size() > 0) {<NEW_LINE>mediaTypes.clear();<NEW_LINE>mediaTypes.addAll(consumes);<NEW_LINE>}<NEW_LINE>// Assume multipart/form-data if nothing is specified<NEW_LINE>if (mediaTypes.size() == 0) {<NEW_LINE>mediaTypes.add("multipart/form-data");<NEW_LINE>}<NEW_LINE>Content content = new Content();<NEW_LINE>for (String type : mediaTypes) {<NEW_LINE>content.addMediaType(type, new MediaType().schema(formSchema));<NEW_LINE>}<NEW_LINE>body.content(content);<NEW_LINE>return body;<NEW_LINE>} | ).$ref("#/components/schemas/formData_" + simpleRef); |
446,905 | public static void emit(org.xml.sax.ContentHandler contentHandler, nu.validator.servlet.VerifierServletTransaction t) throws org.xml.sax.SAXException {<NEW_LINE>org.xml.sax.helpers.AttributesImpl __attrs__ = new org.xml.sax.helpers.AttributesImpl();<NEW_LINE>contentHandler.startPrefixMapping("", "http://www.w3.org/1999/xhtml");<NEW_LINE>__attrs__.clear();<NEW_LINE>__attrs__.addAttribute("", "title", "title", "CDATA", "Space-separated list of namespace URIs.");<NEW_LINE>contentHandler.startElement("http://www.w3.org/1999/xhtml", "tr", "tr", __attrs__);<NEW_LINE>__attrs__.clear();<NEW_LINE>contentHandler.startElement("http://www.w3.org/1999/xhtml", "th", "th", __attrs__);<NEW_LINE>__attrs__.clear();<NEW_LINE>__attrs__.addAttribute("", "for", "for", "CDATA", "nsfilter");<NEW_LINE>contentHandler.startElement("http://www.w3.org/1999/xhtml", "label", "label", __attrs__);<NEW_LINE>__attrs__.clear();<NEW_LINE>__attrs__.addAttribute("", "title", "title", "CDATA", "XML namespace");<NEW_LINE>contentHandler.startElement("http://www.w3.org/1999/xhtml", "abbr", "abbr", __attrs__);<NEW_LINE>contentHandler.characters(__chars__, 0, 5);<NEW_LINE>contentHandler.endElement("http://www.w3.org/1999/xhtml", "abbr", "abbr");<NEW_LINE>contentHandler.characters(__chars__, 5, 1);<NEW_LINE>contentHandler.characters(__chars__, 6, 6);<NEW_LINE>contentHandler.endElement("http://www.w3.org/1999/xhtml", "label", "label");<NEW_LINE>contentHandler.endElement("http://www.w3.org/1999/xhtml", "th", "th");<NEW_LINE>__attrs__.clear();<NEW_LINE>contentHandler.startElement("http://www.w3.org/1999/xhtml", "td", "td", __attrs__);<NEW_LINE>t.emitNsfilterField();<NEW_LINE>contentHandler.endElement("http://www.w3.org/1999/xhtml", "td", "td");<NEW_LINE>contentHandler.<MASK><NEW_LINE>contentHandler.endPrefixMapping("");<NEW_LINE>} | endElement("http://www.w3.org/1999/xhtml", "tr", "tr"); |
1,281,728 | /*<NEW_LINE>private void readChoices(Element sourceElement,Source source) {<NEW_LINE>for (Element choiceElement : XML.children(sourceElement,"choice")) {<NEW_LINE>for (Element alternative : XML.children(choiceElement)) {<NEW_LINE>if ("alternative".equals(alternative.getNodeName())) // Explicit alternative container<NEW_LINE>source.renderer().alternatives().addAll(readRenderers(XML.children(alternative)));<NEW_LINE>else // Implicit alternative - yes implicit and explicit may be combined<NEW_LINE>source.renderer().alternatives().addAll(readRenderers(Collections.singletonList(alternative)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>private Map<String, String> readParameters(Element containingElement) {<NEW_LINE>List<Element> parameterElements = XML.getChildren(containingElement, "parameter");<NEW_LINE>// Shortcut<NEW_LINE>if (parameterElements.size() == 0)<NEW_LINE>return Collections.emptyMap();<NEW_LINE>Map<String, String> <MASK><NEW_LINE>for (Element parameter : parameterElements) {<NEW_LINE>String key = parameter.getAttribute("name");<NEW_LINE>String value = XML.getValue(parameter);<NEW_LINE>parameters.put(key, value);<NEW_LINE>}<NEW_LINE>return parameters;<NEW_LINE>} | parameters = new LinkedHashMap<>(); |
281,739 | public void testCaptureDebuggerTimeSelectionDialog() throws Throwable {<NEW_LINE>TraceThread thread;<NEW_LINE>try (UndoableTransaction tid = tb.startTransaction()) {<NEW_LINE>DBTraceTimeManager tm = tb.trace.getTimeManager();<NEW_LINE>thread = tb.getOrAddThread("main", 0);<NEW_LINE>tm.createSnapshot("Break on main").setEventThread(thread);<NEW_LINE>tm.createSnapshot("Game started").setEventThread(thread);<NEW_LINE>tm.createSnapshot("X's moved").setEventThread(thread);<NEW_LINE>tm.createSnapshot<MASK><NEW_LINE>}<NEW_LINE>traceManager.openTrace(tb.trace);<NEW_LINE>traceManager.activateThread(thread);<NEW_LINE>waitForSwing();<NEW_LINE>performAction(diffPlugin.actionCompare, false);<NEW_LINE>DebuggerTimeSelectionDialog dialog = waitForDialogComponent(DebuggerTimeSelectionDialog.class);<NEW_LINE>Swing.runNow(() -> dialog.setScheduleText("2"));<NEW_LINE>captureDialog(dialog);<NEW_LINE>} | ("O's moved").setEventThread(thread); |
707,529 | public ServletTimer createTimer(SipApplicationSession appSession, long delay, long period, boolean fixedDelay, boolean isPersistent, Serializable info) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>Object[] params = { appSession, new Long(delay), new Long(period), new Boolean(fixedDelay), new Boolean(isPersistent), info };<NEW_LINE>c_logger.traceEntry(this, "createTimer", params);<NEW_LINE>}<NEW_LINE>SipApplicationSessionImpl appSessionImpl = (SipApplicationSessionImpl) appSession;<NEW_LINE>checkIfSessionValid(appSessionImpl);<NEW_LINE>ServletTimerImpl timer = null;<NEW_LINE>timer = new ServletTimerImpl((SipApplicationSessionImpl) appSession, info);<NEW_LINE>timerService.schedule(timer, isPersistent, delay, period, fixedDelay);<NEW_LINE>appSessionImpl.addTimer(timer);<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.<MASK><NEW_LINE>}<NEW_LINE>return timer;<NEW_LINE>} | traceExit(this, "createTimer", timer); |
844,590 | protected void applyTableCustomAttributes(AbstractWmlConversionContext context, AbstractTableWriterModel table, TransformState transformState, Element tableRoot) {<NEW_LINE>int cellSpacing = ((table.getEffectiveTableStyle().getTblPr() != null) && (table.getEffectiveTableStyle().getTblPr().getTblCellSpacing() != null) && (table.getEffectiveTableStyle().getTblPr().getTblCellSpacing().getW() != null) ? table.getEffectiveTableStyle().getTblPr().getTblCellSpacing().getW().intValue() : 0);<NEW_LINE>// Set @class<NEW_LINE>if (table.getStyleId() == null) {<NEW_LINE>log.debug("table has no w:tblStyle?");<NEW_LINE>} else {<NEW_LINE>StyleTree styleTree = context.getWmlPackage().getMainDocumentPart().getStyleTree();<NEW_LINE>Tree<AugmentedStyle<MASK><NEW_LINE>org.docx4j.model.styles.Node<AugmentedStyle> asn = tTree.get(table.getStyleId());<NEW_LINE>tableRoot.setAttribute("class", StyleTree.getHtmlClassAttributeValue(tTree, asn));<NEW_LINE>}<NEW_LINE>tableRoot.setAttribute("id", getId(((TableModelTransformState) transformState).getIdx()));<NEW_LINE>((TableModelTransformState) transformState).incrementIdx();<NEW_LINE>// border model<NEW_LINE>// Handle cellSpacing as in xsl-fo to have a consistent look.<NEW_LINE>if (cellSpacing > 0) {<NEW_LINE>HtmlCssHelper.appendStyle(tableRoot, Property.composeCss(TABLE_BORDER_MODEL, "separate"));<NEW_LINE>// WW seems only to store cellSpacing/2 but displays and applies cellSpacing * 2<NEW_LINE>tableRoot.// WW seems only to store cellSpacing/2 but displays and applies cellSpacing * 2<NEW_LINE>setAttribute(// WW seems only to store cellSpacing/2 but displays and applies cellSpacing * 2<NEW_LINE>"cellspacing", convertToPixels(cellSpacing * 2));<NEW_LINE>} else {<NEW_LINE>HtmlCssHelper.appendStyle(tableRoot, Property.composeCss(TABLE_BORDER_MODEL, "collapse"));<NEW_LINE>}<NEW_LINE>// table width<NEW_LINE>if (table.getTableWidth() > 0) {<NEW_LINE>if (/* handle % */<NEW_LINE>table.getEffectiveTableStyle().getTblPr() != null && table.getEffectiveTableStyle().getTblPr().getTblW() != null && "pct".equals(table.getEffectiveTableStyle().getTblPr().getTblW().getType())) {<NEW_LINE>HtmlCssHelper.appendStyle(tableRoot, // fiftieths of a percent<NEW_LINE>Property.// fiftieths of a percent<NEW_LINE>composeCss(// fiftieths of a percent<NEW_LINE>"width", table.getEffectiveTableStyle().getTblPr().getTblW().getW().intValue() / 50 + "%"));<NEW_LINE>} else {<NEW_LINE>String widthProp = Property.composeCss("width", UnitsOfMeasurement.twipToBest(table.getTableWidth()));<NEW_LINE>HtmlCssHelper.appendStyle(tableRoot, widthProp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Hebrew: columns appear in reverse order<NEW_LINE>// see http://webapp.docx4java.org/OnlineDemo/ecma376/WordML/bidiVisual.html<NEW_LINE>// @since 3.0.2<NEW_LINE>if ((table.getEffectiveTableStyle().getTblPr() != null) && (table.getEffectiveTableStyle().getTblPr().getBidiVisual() != null) && (table.getEffectiveTableStyle().getTblPr().getBidiVisual().isVal())) {<NEW_LINE>HtmlCssHelper.appendStyle(tableRoot, Property.composeCss("direction", "rtl"));<NEW_LINE>}<NEW_LINE>} | > tTree = styleTree.getTableStylesTree(); |
30,200 | public <T> RunContext metric(AbstractMetricEntry<T> metricEntry) {<NEW_LINE>int index = this.metrics.indexOf(metricEntry);<NEW_LINE>if (index >= 0) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>AbstractMetricEntry<T> current = (AbstractMetricEntry<T>) this.metrics.get(index);<NEW_LINE>current.increment(metricEntry.getValue());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>metricEntry.register(this.meterRegistry, this.metricPrefix(), this.metricsTags());<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>// https://github.com/micrometer-metrics/micrometer/issues/877<NEW_LINE>// https://github.com/micrometer-metrics/micrometer/issues/2399<NEW_LINE>if (!e.getMessage().contains("Collector already registered")) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | this.metrics.add(metricEntry); |
1,606,695 | public CommandExecutionResult vlink(String name1, String x1, String y1, String name2, WLinkType type, WArrowDirection direction, HColor color, Display label) {<NEW_LINE>final WBlock block1 = this.root.getBlock(name1);<NEW_LINE>if (block1 == null)<NEW_LINE>return CommandExecutionResult.error("No such element " + name1);<NEW_LINE>final WBlock block2 = this.root.getBlock(name2);<NEW_LINE>if (block2 == null)<NEW_LINE>return CommandExecutionResult.error("No such element " + name2);<NEW_LINE>final UTranslate start = block1.getNextOutVertical(x1, y1, type);<NEW_LINE>final double destination = block2.getAbsolutePosition(<MASK><NEW_LINE>this.vlinks.add(new WLinkVertical(getSkinParam(), start, destination, type, direction, color, label));<NEW_LINE>return CommandExecutionResult.ok();<NEW_LINE>} | "0", "0").getDy(); |
1,524,395 | public Operation buildOperation(Map<String, String> parameterMap, InputStream artifactStream, String mimeType) {<NEW_LINE>String key = FilterTypeEnum.RESIZE.toString().toLowerCase();<NEW_LINE>if (!containsMyFilterParams(key, parameterMap)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Operation operation = new Operation();<NEW_LINE>operation.setName(key);<NEW_LINE>String factor = parameterMap.get(key + "-factor");<NEW_LINE>operation.setFactor(factor == null ? null : Double.valueOf(factor));<NEW_LINE>UnmarshalledParameter targetWidth = new UnmarshalledParameter();<NEW_LINE>String targetWidthApplyFactor = parameterMap.get(key + "-width-apply-factor");<NEW_LINE>targetWidth.setApplyFactor(targetWidthApplyFactor == null ? false : Boolean.valueOf(targetWidthApplyFactor));<NEW_LINE>targetWidth.setName("target-width");<NEW_LINE>targetWidth.setType(<MASK><NEW_LINE>targetWidth.setValue(parameterMap.get(key + "-width-amount"));<NEW_LINE>UnmarshalledParameter targetHeight = new UnmarshalledParameter();<NEW_LINE>String targetHeightApplyFactor = parameterMap.get(key + "-height-apply-factor");<NEW_LINE>targetHeight.setApplyFactor(targetHeightApplyFactor == null ? false : Boolean.valueOf(targetHeightApplyFactor));<NEW_LINE>targetHeight.setName("target-height");<NEW_LINE>targetHeight.setType(ParameterTypeEnum.INT.toString());<NEW_LINE>targetHeight.setValue(parameterMap.get(key + "-height-amount"));<NEW_LINE>UnmarshalledParameter highQuality = new UnmarshalledParameter();<NEW_LINE>highQuality.setName("high-quality");<NEW_LINE>highQuality.setType(ParameterTypeEnum.BOOLEAN.toString());<NEW_LINE>highQuality.setValue(parameterMap.get(key + "-high-quality") == null ? "false" : parameterMap.get(key + "-high-quality"));<NEW_LINE>UnmarshalledParameter maintainAspectRatio = new UnmarshalledParameter();<NEW_LINE>maintainAspectRatio.setName("maintain-aspect-ratio");<NEW_LINE>maintainAspectRatio.setType(ParameterTypeEnum.BOOLEAN.toString());<NEW_LINE>maintainAspectRatio.setValue(parameterMap.get(key + "-maintain-aspect-ratio") == null ? "false" : parameterMap.get(key + "-maintain-aspect-ratio"));<NEW_LINE>UnmarshalledParameter reduceOnly = new UnmarshalledParameter();<NEW_LINE>reduceOnly.setName("reduce-only");<NEW_LINE>reduceOnly.setType(ParameterTypeEnum.BOOLEAN.toString());<NEW_LINE>reduceOnly.setValue(parameterMap.get(key + "-reduce-only") == null ? "false" : parameterMap.get(key + "-reduce-only"));<NEW_LINE>UnmarshalledParameter remainUnderBoundsWhileKeepingAspectRatio = new UnmarshalledParameter();<NEW_LINE>remainUnderBoundsWhileKeepingAspectRatio.setName("remain-under-bounds-while-keeping-aspect-ratio");<NEW_LINE>remainUnderBoundsWhileKeepingAspectRatio.setType(ParameterTypeEnum.BOOLEAN.toString());<NEW_LINE>remainUnderBoundsWhileKeepingAspectRatio.setValue(parameterMap.get(key + "-remain-under-bounds-while-keeping-aspect-ratio") == null ? "false" : parameterMap.get(key + "-remain-under-bounds-while-keeping-aspect-ratio"));<NEW_LINE>operation.setParameters(new UnmarshalledParameter[] { targetWidth, targetHeight, highQuality, maintainAspectRatio, reduceOnly, remainUnderBoundsWhileKeepingAspectRatio });<NEW_LINE>return operation;<NEW_LINE>} | ParameterTypeEnum.INT.toString()); |
1,031,507 | public OrgPermissions retrieveOrgPermissions(final Role role, final UserId adUserId) {<NEW_LINE>final AdTreeId adTreeOrgId = role.getOrgTreeId();<NEW_LINE>if (role.isUseUserOrgAccess()) {<NEW_LINE>return getUserOrgPermissions(adUserId, adTreeOrgId);<NEW_LINE>} else {<NEW_LINE>if (role.isAccessAllOrgs()) {<NEW_LINE>final ClientId clientId = role.getClientId();<NEW_LINE>//<NEW_LINE>// if role has acces all org, then behave as would be * access<NEW_LINE>final OrgPermissions.Builder builder = OrgPermissions.builder(adTreeOrgId);<NEW_LINE>// org *<NEW_LINE>{<NEW_LINE>final OrgResource <MASK><NEW_LINE>final OrgPermission permission = OrgPermission.ofResourceAndReadOnly(resource, false);<NEW_LINE>builder.addPermission(permission);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// now add all orgs<NEW_LINE>final List<I_AD_Org> clientOrgs = orgDAO.retrieveClientOrgs(clientId.getRepoId());<NEW_LINE>for (final I_AD_Org org : clientOrgs) {<NEW_LINE>// skip inative orgs<NEW_LINE>if (!org.isActive()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final OrgId orgId = OrgId.ofRepoId(org.getAD_Org_ID());<NEW_LINE>final OrgResource orgResource = OrgResource.of(clientId, orgId, org.isSummary());<NEW_LINE>final OrgPermission orgPermission = OrgPermission.ofResourceAndReadOnly(orgResource, false);<NEW_LINE>builder.addPermission(orgPermission);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} else {<NEW_LINE>return getRoleOrgPermissions(role.getId(), adTreeOrgId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | resource = OrgResource.anyOrg(clientId); |
1,153,715 | private void sendRecipes(GlowMerchantInventory inventory, GlowPlayer player) {<NEW_LINE>// TODO: Move this to a new 'GlowMerchant' class, to allow custom Merchant windows<NEW_LINE>checkNotNull(inventory);<NEW_LINE>checkNotNull(player);<NEW_LINE>int windowId = player.getOpenWindowId();<NEW_LINE>if (windowId == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>payload.writeInt(windowId);<NEW_LINE>payload.writeByte(this.recipes.size());<NEW_LINE>for (MerchantRecipe recipe : this.recipes) {<NEW_LINE>if (recipe.getIngredients().isEmpty()) {<NEW_LINE>GlowBufUtils.writeSlot(payload, InventoryUtil.createEmptyStack());<NEW_LINE>} else {<NEW_LINE>GlowBufUtils.writeSlot(payload, recipe.getIngredients().get(0));<NEW_LINE>}<NEW_LINE>GlowBufUtils.writeSlot(payload, recipe.getResult());<NEW_LINE>boolean secondIngredient = recipe.getIngredients().size() > 1;<NEW_LINE>payload.writeBoolean(secondIngredient);<NEW_LINE>if (secondIngredient) {<NEW_LINE>GlowBufUtils.writeSlot(payload, recipe.getIngredients().get(1));<NEW_LINE>}<NEW_LINE>// todo: no isDisabled() in MerchantRecipe?<NEW_LINE>payload.writeBoolean(false);<NEW_LINE>payload.writeInt(recipe.getUses());<NEW_LINE>payload.writeInt(recipe.getMaxUses());<NEW_LINE>}<NEW_LINE>player.getSession().send(new PluginMessage("MC|TrList", payload.array()));<NEW_LINE>} | ByteBuf payload = Unpooled.buffer(); |
1,673,529 | public static ListCalcEnginesResponse unmarshall(ListCalcEnginesResponse listCalcEnginesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listCalcEnginesResponse.setRequestId(_ctx.stringValue("ListCalcEnginesResponse.RequestId"));<NEW_LINE>listCalcEnginesResponse.setHttpStatusCode(_ctx.integerValue("ListCalcEnginesResponse.HttpStatusCode"));<NEW_LINE>listCalcEnginesResponse.setSuccess(_ctx.booleanValue("ListCalcEnginesResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListCalcEnginesResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListCalcEnginesResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListCalcEnginesResponse.Data.TotalCount"));<NEW_LINE>List<CalcEnginesItem> calcEngines = new ArrayList<CalcEnginesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListCalcEnginesResponse.Data.CalcEngines.Length"); i++) {<NEW_LINE>CalcEnginesItem calcEnginesItem = new CalcEnginesItem();<NEW_LINE>calcEnginesItem.setBindingProjectName(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].BindingProjectName"));<NEW_LINE>calcEnginesItem.setIsDefault(_ctx.booleanValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].IsDefault"));<NEW_LINE>calcEnginesItem.setEngineId(_ctx.integerValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].EngineId"));<NEW_LINE>calcEnginesItem.setDwRegion(_ctx.stringValue<MASK><NEW_LINE>calcEnginesItem.setTaskAuthType(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].TaskAuthType"));<NEW_LINE>calcEnginesItem.setCalcEngineType(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].CalcEngineType"));<NEW_LINE>calcEnginesItem.setEngineInfo(_ctx.mapValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].EngineInfo"));<NEW_LINE>calcEnginesItem.setEnvType(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].EnvType"));<NEW_LINE>calcEnginesItem.setRegion(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].Region"));<NEW_LINE>calcEnginesItem.setGmtCreate(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].GmtCreate"));<NEW_LINE>calcEnginesItem.setBindingProjectId(_ctx.integerValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].BindingProjectId"));<NEW_LINE>calcEnginesItem.setName(_ctx.stringValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].Name"));<NEW_LINE>calcEnginesItem.setTenantId(_ctx.longValue("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].TenantId"));<NEW_LINE>calcEngines.add(calcEnginesItem);<NEW_LINE>}<NEW_LINE>data.setCalcEngines(calcEngines);<NEW_LINE>listCalcEnginesResponse.setData(data);<NEW_LINE>return listCalcEnginesResponse;<NEW_LINE>} | ("ListCalcEnginesResponse.Data.CalcEngines[" + i + "].DwRegion")); |
135,686 | public final ReferenceControlTypeContext referenceControlType() throws RecognitionException {<NEW_LINE>ReferenceControlTypeContext _localctx = new ReferenceControlTypeContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 88, RULE_referenceControlType);<NEW_LINE>try {<NEW_LINE>setState(1577);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case RESTRICT:<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(1571);<NEW_LINE>match(RESTRICT);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case CASCADE:<NEW_LINE>enterOuterAlt(_localctx, 2);<NEW_LINE>{<NEW_LINE>setState(1572);<NEW_LINE>match(CASCADE);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SET:<NEW_LINE>enterOuterAlt(_localctx, 3);<NEW_LINE>{<NEW_LINE>setState(1573);<NEW_LINE>match(SET);<NEW_LINE>setState(1574);<NEW_LINE>match(NULL_LITERAL);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case NO:<NEW_LINE>enterOuterAlt(_localctx, 4);<NEW_LINE>{<NEW_LINE>setState(1575);<NEW_LINE>match(NO);<NEW_LINE>setState(1576);<NEW_LINE>match(ACTION);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _errHandler.recover(this, re); |
397,186 | final SendProjectSessionActionResult executeSendProjectSessionAction(SendProjectSessionActionRequest sendProjectSessionActionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(sendProjectSessionActionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SendProjectSessionActionRequest> request = null;<NEW_LINE>Response<SendProjectSessionActionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SendProjectSessionActionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(sendProjectSessionActionRequest));<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, "DataBrew");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SendProjectSessionAction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SendProjectSessionActionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SendProjectSessionActionResultJsonUnmarshaller());<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>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
600,059 | public void append(final LogEvent event) {<NEW_LINE>if (null == event.getMessage()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Category name<NEW_LINE>final String logger = String.format("%s %s", event.getThreadName(), event.getLoggerName());<NEW_LINE>Level level = event.getLevel();<NEW_LINE>if (Level.FATAL.equals(level) || Level.ERROR.equals(level)) {<NEW_LINE>this.log(OS_LOG_TYPE_ERROR, logger, event.getMessage().toString());<NEW_LINE>} else if (Level.TRACE.equals(level)) {<NEW_LINE>this.log(OS_LOG_TYPE_DEBUG, logger, event.getMessage().toString());<NEW_LINE>} else if (Level.DEBUG.equals(level) || Level.INFO.equals(level)) {<NEW_LINE>this.log(OS_LOG_TYPE_INFO, logger, event.getMessage().toString());<NEW_LINE>} else {<NEW_LINE>this.log(OS_LOG_TYPE_DEFAULT, logger, event.getMessage().toString());<NEW_LINE>}<NEW_LINE>if (ignoreExceptions()) {<NEW_LINE>// Appender responsible for rendering<NEW_LINE>final Throwable thrown = event.getThrown();<NEW_LINE>if (thrown != null) {<NEW_LINE>final String[] trace = ExceptionUtils.getStackFrames(thrown);<NEW_LINE>for (final String t : trace) {<NEW_LINE>this.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | log(OS_LOG_TYPE_DEFAULT, logger, t); |
876,233 | private void loadBlock(ByteBuffer buffer) {<NEW_LINE><MASK><NEW_LINE>// Block size with 16 bits<NEW_LINE>this.readTotalCount = (int) reader.next(16);<NEW_LINE>// Number of reserved components with 16 bits<NEW_LINE>int m = (int) reader.next(16);<NEW_LINE>// Exponent of quantification level with 16 bits<NEW_LINE>int beta = (short) reader.next(16);<NEW_LINE>// Decode index sequence<NEW_LINE>int[] index = decodeIndex(m, reader);<NEW_LINE>// Decode value sequence<NEW_LINE>long[] value = decodeValue(m, reader);<NEW_LINE>reader.skip();<NEW_LINE>// Quantification<NEW_LINE>double eps = Math.pow(2, beta);<NEW_LINE>this.data = new double[readTotalCount];<NEW_LINE>for (int i = 0; i < m; i++) {<NEW_LINE>data[index[i]] = value[i] * eps;<NEW_LINE>}<NEW_LINE>DoubleDCT_1D dct = new DoubleDCT_1D(readTotalCount);<NEW_LINE>dct.inverse(data, true);<NEW_LINE>} | BitReader reader = new BitReader(buffer); |
309,028 | protected final // d446474<NEW_LINE>Class<?> loadClass(String className) throws InjectionConfigurationException {<NEW_LINE>ClassLoader classLoader = ivNameSpaceConfig.getClassLoader();<NEW_LINE>if (// F743-32443<NEW_LINE>className == null || className.equals("") || classLoader == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "loadClass : " + className);<NEW_LINE>Class<?> loadedClass = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>FFDCFilter.processException(ex, CLASS_NAME + ".loadClass", "675", this, new Object[] { className });<NEW_LINE>InjectionConfigurationException icex = new InjectionConfigurationException("Referenced class could not be loaded : " + className, ex);<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "loadClass : " + icex);<NEW_LINE>throw icex;<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "loadClass : " + loadedClass);<NEW_LINE>return loadedClass;<NEW_LINE>} | loadedClass = classLoader.loadClass(className); |
970,790 | public void parseAttributeClauses(IoTDBSqlParser.AttributeClausesContext ctx, CreateAlignedTimeSeriesOperator createAlignedTimeSeriesOperator) {<NEW_LINE>if (ctx.alias() != null) {<NEW_LINE>createAlignedTimeSeriesOperator.addAliasList(parseNodeName(ctx.alias().nodeNameCanInExpr().getText()));<NEW_LINE>} else {<NEW_LINE>createAlignedTimeSeriesOperator.addAliasList(null);<NEW_LINE>}<NEW_LINE>String dataTypeString = ctx.dataType<MASK><NEW_LINE>TSDataType dataType = TSDataType.valueOf(dataTypeString);<NEW_LINE>createAlignedTimeSeriesOperator.addDataType(dataType);<NEW_LINE>TSEncoding encoding = IoTDBDescriptor.getInstance().getDefaultEncodingByType(dataType);<NEW_LINE>if (Objects.nonNull(ctx.encoding)) {<NEW_LINE>String encodingString = ctx.encoding.getText().toUpperCase();<NEW_LINE>encoding = TSEncoding.valueOf(encodingString);<NEW_LINE>}<NEW_LINE>createAlignedTimeSeriesOperator.addEncoding(encoding);<NEW_LINE>CompressionType compressor = TSFileDescriptor.getInstance().getConfig().getCompressor();<NEW_LINE>if (ctx.compressor != null) {<NEW_LINE>String compressorString = ctx.compressor.getText().toUpperCase();<NEW_LINE>compressor = CompressionType.valueOf(compressorString);<NEW_LINE>}<NEW_LINE>createAlignedTimeSeriesOperator.addCompressor(compressor);<NEW_LINE>if (ctx.propertyClause(0) != null) {<NEW_LINE>throw new SQLParserException("create aligned timeseries: property is not supported yet.");<NEW_LINE>}<NEW_LINE>if (ctx.tagClause() != null) {<NEW_LINE>parseTagClause(ctx.tagClause(), createAlignedTimeSeriesOperator);<NEW_LINE>} else {<NEW_LINE>createAlignedTimeSeriesOperator.addTagsList(null);<NEW_LINE>}<NEW_LINE>if (ctx.attributeClause() != null) {<NEW_LINE>parseAttributeClause(ctx.attributeClause(), createAlignedTimeSeriesOperator);<NEW_LINE>} else {<NEW_LINE>createAlignedTimeSeriesOperator.addAttributesList(null);<NEW_LINE>}<NEW_LINE>} | .getText().toUpperCase(); |
293,309 | public void readSettings(Object settings) {<NEW_LINE>this.wizDescriptor = (WizardDescriptor) settings;<NEW_LINE>TemplateWizard wizard = (TemplateWizard) settings;<NEW_LINE>String targetName = wizard.getTargetName();<NEW_LINE>FileObject resFolder = ResourceUtils.getResourceDirectory(this.helper.getData().getTargetFileObject());<NEW_LINE>this.helper.getData().setTargetFileObject(resFolder);<NEW_LINE>if (resFolder != null) {<NEW_LINE>// NOI18N<NEW_LINE>String resourceName = helper.<MASK><NEW_LINE>if ((resourceName != null) && (!resourceName.equals(""))) {<NEW_LINE>targetName = resourceName;<NEW_LINE>}<NEW_LINE>targetName = ResourceUtils.createUniqueFileName(targetName, resFolder, __JMSResource);<NEW_LINE>this.helper.getData().setTargetFile(targetName);<NEW_LINE>if (component == null)<NEW_LINE>getComponent();<NEW_LINE>component.setHelper(this.helper);<NEW_LINE>} else<NEW_LINE>setupValid = false;<NEW_LINE>} | getData().getString("jndi-name"); |
1,069,060 | public List<CompletableFuture<StreamBucket>> prepareOnHandler(SessionSettings sessionInfo, Collection<? extends NodeOperation> nodeOperations, RootTask.Builder taskBuilder, List<Tuple<ExecutionPhase, RowConsumer>> handlerPhases, SharedShardContexts sharedShardContexts) {<NEW_LINE>Context context = new Context(clusterService.localNode().getId(), sessionInfo, taskBuilder, LOGGER, distributingConsumerFactory, nodeOperations, sharedShardContexts);<NEW_LINE>for (Tuple<ExecutionPhase, RowConsumer> handlerPhase : handlerPhases) {<NEW_LINE>context.registerLeaf(handlerPhase.v1(), handlerPhase.v2());<NEW_LINE>}<NEW_LINE>registerContextPhases(nodeOperations, context);<NEW_LINE>LOGGER.trace("prepareOnHandler: nodeOperations={}, handlerPhases={}, targetSourceMap={}", nodeOperations, handlerPhases, context.opCtx.targetToSourceMap);<NEW_LINE>IntHashSet leafs = new IntHashSet();<NEW_LINE>for (Tuple<ExecutionPhase, RowConsumer> handlerPhase : handlerPhases) {<NEW_LINE><MASK><NEW_LINE>createContexts(phase, context);<NEW_LINE>leafs.add(phase.phaseId());<NEW_LINE>}<NEW_LINE>leafs.addAll(context.opCtx.findLeafs());<NEW_LINE>for (IntCursor cursor : leafs) {<NEW_LINE>prepareSourceOperations(cursor.value, context);<NEW_LINE>}<NEW_LINE>assert context.opCtx.allNodeOperationContextsBuilt() : "some nodeOperations haven't been processed";<NEW_LINE>return context.directResponseFutures;<NEW_LINE>} | ExecutionPhase phase = handlerPhase.v1(); |
1,675,146 | public ServiceResponse serviceImpl(Query post, HttpServletResponse response, Authorization user, final JsonObjectWithDefault permissions) throws APIException {<NEW_LINE>String text = post.get("BODY", "").trim();<NEW_LINE>// for each line of this text, create an answer. Then output the text again with answers after each input line<NEW_LINE>String[] lines = text.split(System.lineSeparator());<NEW_LINE>StringBuffer sb = new StringBuffer(text.length() * 2);<NEW_LINE>lineloop: for (String line : lines) {<NEW_LINE>String s = line.trim();<NEW_LINE>if (s.length() == 0) {<NEW_LINE>sb.append(System.lineSeparator());<NEW_LINE>continue lineloop;<NEW_LINE>}<NEW_LINE>if (s.charAt(0) == '#') {<NEW_LINE>sb.append(s).append(System.lineSeparator());<NEW_LINE>continue lineloop;<NEW_LINE>}<NEW_LINE>SusiFace face = new SusiFace(s).setPost(post).setAuthorization(user).setDebug(false);<NEW_LINE>try {<NEW_LINE>SusiCognition cognition = face.call();<NEW_LINE>LinkedHashMap<String, List<String>> answers = cognition.getAnswers();<NEW_LINE>for (Map.Entry<String, List<String>> answer : answers.entrySet()) {<NEW_LINE>sb.append(s).append(System.lineSeparator());<NEW_LINE>sb.append("### ANSWER: ").append(answer.getKey()).append(System.lineSeparator());<NEW_LINE>for (String skill : answer.getValue()) {<NEW_LINE>sb.append("### SOURCE: ").append(skill).append(System.lineSeparator());<NEW_LINE>}<NEW_LINE>sb.<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>DAO.log(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ServiceResponse(sb.toString());<NEW_LINE>} | append(System.lineSeparator()); |
1,529,174 | public void marshall(VirtualInterface virtualInterface, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (virtualInterface == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getOwnerAccount(), OWNERACCOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getVirtualInterfaceId(), VIRTUALINTERFACEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getLocation(), LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getConnectionId(), CONNECTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getVirtualInterfaceType(), VIRTUALINTERFACETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getVirtualInterfaceName(), VIRTUALINTERFACENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getVlan(), VLAN_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getAsn(), ASN_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getAmazonSideAsn(), AMAZONSIDEASN_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getAuthKey(), AUTHKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getAmazonAddress(), AMAZONADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getCustomerAddress(), CUSTOMERADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getAddressFamily(), ADDRESSFAMILY_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getVirtualInterfaceState(), VIRTUALINTERFACESTATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getCustomerRouterConfig(), CUSTOMERROUTERCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getMtu(), MTU_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getJumboFrameCapable(), JUMBOFRAMECAPABLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getVirtualGatewayId(), VIRTUALGATEWAYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getDirectConnectGatewayId(), DIRECTCONNECTGATEWAYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getRouteFilterPrefixes(), ROUTEFILTERPREFIXES_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getBgpPeers(), BGPPEERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(virtualInterface.getAwsDeviceV2(), AWSDEVICEV2_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getAwsLogicalDeviceId(), AWSLOGICALDEVICEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(virtualInterface.getSiteLinkEnabled(), SITELINKENABLED_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | virtualInterface.getRegion(), REGION_BINDING); |
1,546,903 | public com.amazonaws.services.iotthingsgraph.model.InternalFailureException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.iotthingsgraph.model.InternalFailureException internalFailureException = new com.amazonaws.services.<MASK><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>} 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 internalFailureException;<NEW_LINE>} | iotthingsgraph.model.InternalFailureException(null); |
541,450 | public SDVariable updateVariableNameAndReference(SameDiffOp opToRename, SDVariable varToUpdate, String newVarName, boolean exactName) {<NEW_LINE>if (varToUpdate == null) {<NEW_LINE>throw new NullPointerException("Null input: No variable found for updating!");<NEW_LINE>}<NEW_LINE>if (newVarName != null) {<NEW_LINE>String nameScope = currentNameScope();<NEW_LINE>if (nameScope != null && !exactName) {<NEW_LINE>if (!newVarName.startsWith(nameScope + "/")) {<NEW_LINE>newVarName = nameScope + "/" + newVarName;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newVarName != null && variables.containsKey(newVarName) && varToUpdate != variables.get(newVarName).getVariable()) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (newVarName == null && variables.containsKey(varToUpdate.name()) && variables.get(varToUpdate.name()).getVariable() != varToUpdate && !exactName) {<NEW_LINE>// Edge case: suppose we do m1=sd.mean(in), m2=sd.mean(m1) -> both initially have the name<NEW_LINE>// "mean" and consequently a new variable name needs to be generated<NEW_LINE>newVarName = generateNewVarName(varToUpdate.name(), 0);<NEW_LINE>}<NEW_LINE>if (newVarName == null || varToUpdate.name().equals(newVarName)) {<NEW_LINE>return varToUpdate;<NEW_LINE>}<NEW_LINE>val oldVarName = varToUpdate.name();<NEW_LINE>varToUpdate.setVarName(newVarName);<NEW_LINE>renameVariable(opToRename, oldVarName, newVarName);<NEW_LINE>return varToUpdate;<NEW_LINE>} | IllegalStateException("Variable name \"" + newVarName + "\" already exists for a different SDVariable"); |
1,210,505 | private void cancelLongJob(String uuid, Completion completion) {<NEW_LINE>Tuple t = Q.New(LongJobVO.class).eq(LongJobVO_.uuid, uuid).select(LongJobVO_.state, LongJobVO_.jobName).findTuple();<NEW_LINE>LongJobState originState = t.get(0, LongJobState.class);<NEW_LINE>if (originState == LongJobState.Canceled) {<NEW_LINE>logger.info(String.format("longjob [uuid:%s] has been canceled before", uuid));<NEW_LINE>completion.success();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!longJobFactory.supportCancel(t.get(1, String.class))) {<NEW_LINE>completion.fail(err(LongJobErrors.NOT_SUPPORTED, "not supported"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LongJobVO vo = changeState(uuid, LongJobStateEvent.canceling);<NEW_LINE>LongJob job = longJobFactory.getLongJob(vo.getJobName());<NEW_LINE>logger.info(String.format("longjob [uuid:%s, name:%s] has been marked canceling", vo.getUuid(), vo.getName()));<NEW_LINE>job.cancel(vo, new ReturnValueCompletion<Boolean>(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(Boolean cancelled) {<NEW_LINE>boolean needClean = !cancelled && originState != LongJobState.Running && longJobFactory.supportClean(vo.getJobName());<NEW_LINE>if (needClean) {<NEW_LINE>doCleanJob(vo, completion);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (cancelled || originState != LongJobState.Running) {<NEW_LINE>changeState(uuid, LongJobStateEvent.canceled);<NEW_LINE>logger.info(String.format("longjob [uuid:%s, name:%s] has been canceled", vo.getUuid(), vo.getName()));<NEW_LINE>} else {<NEW_LINE>logger.debug(String.format("wait for canceling longjob [uuid:%s, name:%s] rollback", vo.getUuid(), vo.getName()));<NEW_LINE>}<NEW_LINE>completion.success();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>logger.error(String.format("failed to cancel longjob [uuid:%s, name:%s]", vo.getUuid()<MASK><NEW_LINE>completion.fail(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | , vo.getName())); |
998,598 | public static void main(String[] args) {<NEW_LINE>final String USAGE = "Usage:\n" + " CreateDataset <datasetName, dataset group arn, dataset type, schema arn>\n\n" + "Where:\n" + " name - The name for the dataset.\n" + " dataset group arn - The Amazon Resource Name (ARN) for the dataset group.\n" + " dataset type - The type of dataset (INTERACTIONS, USERS, or ITEMS).\n" + " schema arn - The ARN for the dataset's schema.\n\n";<NEW_LINE>if (args.length != 4) {<NEW_LINE>System.out.println(USAGE);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String datasetName = args[0];<NEW_LINE>String datasetGroupArn = args[1];<NEW_LINE>String datasetType = args[2];<NEW_LINE>String schemaArn = args[3];<NEW_LINE>// Change to the region where your resources are located<NEW_LINE>Region region = Region.US_WEST_2;<NEW_LINE>PersonalizeClient personalizeClient = PersonalizeClient.builder().region(region).build();<NEW_LINE>String datasetArn = createDataset(personalizeClient, datasetName, datasetGroupArn, datasetType, schemaArn);<NEW_LINE>System.<MASK><NEW_LINE>personalizeClient.close();<NEW_LINE>} | out.println("Dataset ARN: " + datasetArn); |
552,289 | public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {<NEW_LINE>final String[] nodesIds = Strings.splitStringByCommaToArray<MASK><NEW_LINE>final TaskId taskId = new TaskId(request.param("task_id"));<NEW_LINE>final String[] actions = Strings.splitStringByCommaToArray(request.param("actions"));<NEW_LINE>final TaskId parentTaskId = new TaskId(request.param("parent_task_id"));<NEW_LINE>final String groupBy = request.param("group_by", "nodes");<NEW_LINE>CancelTasksRequest cancelTasksRequest = new CancelTasksRequest();<NEW_LINE>cancelTasksRequest.setTaskId(taskId);<NEW_LINE>cancelTasksRequest.setNodes(nodesIds);<NEW_LINE>cancelTasksRequest.setActions(actions);<NEW_LINE>cancelTasksRequest.setParentTaskId(parentTaskId);<NEW_LINE>cancelTasksRequest.setWaitForCompletion(request.paramAsBoolean("wait_for_completion", cancelTasksRequest.waitForCompletion()));<NEW_LINE>return channel -> client.admin().cluster().cancelTasks(cancelTasksRequest, listTasksResponseListener(nodesInCluster, groupBy, channel));<NEW_LINE>} | (request.param("nodes")); |
1,514,976 | public static void processAnnotation(LoggingFramework framework, AnnotationValues<? extends java.lang.annotation.Annotation> annotation, Annotation source, EclipseNode annotationNode) {<NEW_LINE>EclipseNode owner = annotationNode.up();<NEW_LINE>switch(owner.getKind()) {<NEW_LINE>case TYPE:<NEW_LINE>IdentifierName logFieldName = annotationNode.getAst().readConfiguration(ConfigurationKeys.LOG_ANY_FIELD_NAME);<NEW_LINE>if (logFieldName == null)<NEW_LINE>logFieldName = LOG;<NEW_LINE>boolean useStatic = !Boolean.FALSE.equals(annotationNode.getAst().readConfiguration(ConfigurationKeys.LOG_ANY_FIELD_IS_STATIC));<NEW_LINE>TypeDeclaration typeDecl = null;<NEW_LINE>if (owner.get() instanceof TypeDeclaration)<NEW_LINE>typeDecl = (TypeDeclaration) owner.get();<NEW_LINE>int modifiers = typeDecl == null ? 0 : typeDecl.modifiers;<NEW_LINE>boolean notAClass = (modifiers & (ClassFileConstants.AccInterface | ClassFileConstants.AccAnnotation)) != 0;<NEW_LINE>if (typeDecl == null || notAClass) {<NEW_LINE>annotationNode.addError(framework.getAnnotationAsString() + " is legal only on classes and enums.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fieldExists(logFieldName.getName(), owner) != MemberExistsResult.NOT_EXISTS) {<NEW_LINE>annotationNode.addWarning("Field '" + logFieldName + "' already exists.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isRecord(owner) && !useStatic) {<NEW_LINE>annotationNode.addError("Logger fields must be static in records.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (useStatic && !isStaticAllowed(owner)) {<NEW_LINE>annotationNode.addError(framework.getAnnotationAsString() + " is not supported on non-static nested classes.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object valueGuess = annotation.getValueGuess("topic");<NEW_LINE>Expression loggerTopic = (Expression) annotation.getActualExpression("topic");<NEW_LINE>if (valueGuess instanceof String && ((String) valueGuess).trim().isEmpty())<NEW_LINE>loggerTopic = null;<NEW_LINE>if (framework.getDeclaration().getParametersWithTopic() == null && loggerTopic != null) {<NEW_LINE>annotationNode.addError(framework.getAnnotationAsString() + " does not allow a topic.");<NEW_LINE>loggerTopic = null;<NEW_LINE>}<NEW_LINE>if (framework.getDeclaration().getParametersWithoutTopic() == null && loggerTopic == null) {<NEW_LINE>annotationNode.addError(<MASK><NEW_LINE>loggerTopic = new StringLiteral(new char[] {}, 0, 0, 0);<NEW_LINE>}<NEW_LINE>ClassLiteralAccess loggingType = selfType(owner, source);<NEW_LINE>FieldDeclaration fieldDeclaration = createField(framework, source, loggingType, logFieldName.getName(), useStatic, loggerTopic);<NEW_LINE>fieldDeclaration.traverse(new SetGeneratedByVisitor(source), typeDecl.staticInitializerScope);<NEW_LINE>// TODO temporary workaround for issue 290. https://github.com/projectlombok/lombok/issues/290<NEW_LINE>// injectFieldSuppressWarnings(owner, fieldDeclaration);<NEW_LINE>injectField(owner, fieldDeclaration);<NEW_LINE>owner.rebuild();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | framework.getAnnotationAsString() + " requires a topic."); |
1,720,734 | public void marshall(CreatePipelineRequest createPipelineRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createPipelineRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createPipelineRequest.getPipelineName(), PIPELINENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createPipelineRequest.getPipelineDisplayName(), PIPELINEDISPLAYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createPipelineRequest.getPipelineDefinition(), PIPELINEDEFINITION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createPipelineRequest.getPipelineDefinitionS3Location(), PIPELINEDEFINITIONS3LOCATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createPipelineRequest.getPipelineDescription(), PIPELINEDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createPipelineRequest.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createPipelineRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createPipelineRequest.getParallelismConfiguration(), PARALLELISMCONFIGURATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createPipelineRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING); |
1,255,323 | public ImmutableSet<BPartnerId> retrieveBPartnerIdsBy(@NonNull final BPartnerQuery query) {<NEW_LINE>final IQueryBuilder<I_C_BPartner> queryBuilder = createQueryBuilder(I_C_BPartner.class);<NEW_LINE>if (!query.getOnlyOrgIds().isEmpty()) {<NEW_LINE>queryBuilder.addInArrayFilter(I_C_BPartner.COLUMNNAME_AD_Org_ID, query.getOnlyOrgIds());<NEW_LINE>}<NEW_LINE>if (query.getBPartnerId() != null) {<NEW_LINE>queryBuilder.addEqualsFilter(I_C_BPartner.COLUMNNAME_C_BPartner_ID, query.getBPartnerId());<NEW_LINE>}<NEW_LINE>// ..BPartner external-id<NEW_LINE>if (query.getExternalId() != null) {<NEW_LINE>queryBuilder.addEqualsFilter(I_C_BPartner.COLUMNNAME_ExternalId, query.getExternalId().getValue());<NEW_LINE>}<NEW_LINE>// ..BPartner code (aka value)<NEW_LINE>if (!isEmpty(query.getBpartnerValue(), true)) {<NEW_LINE>queryBuilder.addEqualsFilter(I_C_BPartner.COLUMNNAME_Value, query.getBpartnerValue());<NEW_LINE>}<NEW_LINE>// ..BPartner Name<NEW_LINE>if (!isEmpty(query.getBpartnerName(), true)) {<NEW_LINE>queryBuilder.addEqualsFilter(I_C_BPartner.COLUMNNAME_Name, query.getBpartnerName());<NEW_LINE>}<NEW_LINE>// BPLocation's GLN<NEW_LINE>if (!query.getGlns().isEmpty()) {<NEW_LINE>final ImmutableSet<BPartnerId> bpartnerIdsForGLN = glnsLoadingCache.getBPartnerIds(toGLNQuery(query));<NEW_LINE>if (bpartnerIdsForGLN.isEmpty()) {<NEW_LINE>return ImmutableSet.of();<NEW_LINE>}<NEW_LINE>queryBuilder.addInArrayFilter(I_C_BPartner.COLUMN_C_BPartner_ID, bpartnerIdsForGLN);<NEW_LINE>}<NEW_LINE>// UserSalesRepSet<NEW_LINE>if (BooleanUtils.isTrue(query.getUserSalesRepSet())) {<NEW_LINE>queryBuilder.addNotEqualsFilter(I_C_BPartner.COLUMNNAME_SalesRep_ID, null);<NEW_LINE>} else if (BooleanUtils.isFalse(query.getUserSalesRepSet())) {<NEW_LINE>queryBuilder.addEqualsFilter(I_C_BPartner.COLUMNNAME_SalesRep_ID, null);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Execute<NEW_LINE>final ImmutableSet<BPartnerId> bpartnerIds = queryBuilder.create().listIds(BPartnerId::ofRepoId);<NEW_LINE>if (bpartnerIds.isEmpty() && query.isFailIfNotExists()) {<NEW_LINE>throw new AdempiereException("@NotFound@ @C_BPartner_ID@"<MASK><NEW_LINE>}<NEW_LINE>return bpartnerIds;<NEW_LINE>} | ).setParameter("query", query); |
1,417,548 | protected List<ExecutionEntity> loadProcessInstance(String processInstanceId, CommandContext commandContext) {<NEW_LINE>List<ExecutionEntity> result = null;<NEW_LINE>// first try to load from cache<NEW_LINE>// check whether the process instance is already (partially) loaded in command context<NEW_LINE>List<ExecutionEntity> cachedExecutions = commandContext.getDbEntityManager().getCachedEntitiesByType(ExecutionEntity.class);<NEW_LINE>for (ExecutionEntity executionEntity : cachedExecutions) {<NEW_LINE>if (processInstanceId.equals(executionEntity.getProcessInstanceId())) {<NEW_LINE>// found one execution from process instance<NEW_LINE>result = new ArrayList<ExecutionEntity>();<NEW_LINE><MASK><NEW_LINE>// add process instance<NEW_LINE>result.add(processInstance);<NEW_LINE>loadChildExecutionsFromCache(processInstance, result);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>// if the process instance could not be found in cache, load from database<NEW_LINE>result = loadFromDb(processInstanceId, commandContext);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ExecutionEntity processInstance = executionEntity.getProcessInstance(); |
1,302,484 | public synchronized void paintComponent(Graphics g) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>g2.setStroke(new BasicStroke(5));<NEW_LINE>g2.setColor(Color.gray);<NEW_LINE>if (mode == Mode.PLACING_POINTS) {<NEW_LINE>if (numSelected == 1) {<NEW_LINE>drawCorner(g2, quad.a, Color.RED);<NEW_LINE>} else if (numSelected == 2) {<NEW_LINE>drawLine(g2, quad.a, quad.b);<NEW_LINE>drawCorner(g2, quad.a, Color.RED);<NEW_LINE>drawCorner(g2, quad.b, Color.ORANGE);<NEW_LINE>} else if (numSelected == 3) {<NEW_LINE>drawLine(g2, quad.a, quad.b);<NEW_LINE>drawLine(g2, quad.b, quad.c);<NEW_LINE>drawCorner(g2, quad.a, Color.RED);<NEW_LINE>drawCorner(g2, quad.b, Color.ORANGE);<NEW_LINE>drawCorner(g2, quad.c, Color.CYAN);<NEW_LINE>} else if (numSelected == 4) {<NEW_LINE>VisualizeShapes.drawQuad(quad, g2, scale, true, <MASK><NEW_LINE>drawCorner(g2, quad.a, Color.RED);<NEW_LINE>drawCorner(g2, quad.b, Color.ORANGE);<NEW_LINE>drawCorner(g2, quad.c, Color.CYAN);<NEW_LINE>drawCorner(g2, quad.d, Color.BLUE);<NEW_LINE>}<NEW_LINE>} else if (mode == Mode.DRAGGING_RECT) {<NEW_LINE>VisualizeShapes.drawQuad(quad, g2, scale, true, Color.gray, Color.gray);<NEW_LINE>drawCorner(g2, quad.a, Color.RED);<NEW_LINE>drawCorner(g2, quad.b, Color.RED);<NEW_LINE>drawCorner(g2, quad.c, Color.RED);<NEW_LINE>drawCorner(g2, quad.d, Color.RED);<NEW_LINE>} else if (mode == Mode.TRACKING) {<NEW_LINE>if (targetVisible) {<NEW_LINE>VisualizeShapes.drawQuad(quad, g2, scale, true, Color.gray, Color.CYAN);<NEW_LINE>drawCorner(g2, quad.a, Color.RED);<NEW_LINE>drawCorner(g2, quad.b, Color.RED);<NEW_LINE>drawCorner(g2, quad.c, Color.RED);<NEW_LINE>drawCorner(g2, quad.d, Color.RED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Color.gray, Color.CYAN); |
114,878 | protected Object superAroundInvoke(InvocationContext inv) throws Exception {<NEW_LINE>ResultsLocal results = ResultsLocalBean.getSFBean();<NEW_LINE>results.addAroundInvoke(CLASS_NAME, "superAroundInvoke");<NEW_LINE>// Validate and update context data.<NEW_LINE>Map<String, Object<MASK><NEW_LINE>String data;<NEW_LINE>if (map.containsKey("AroundInvoke")) {<NEW_LINE>data = (String) map.get("AroundInvoke");<NEW_LINE>data = data + ":" + CLASS_NAME;<NEW_LINE>} else {<NEW_LINE>data = CLASS_NAME;<NEW_LINE>}<NEW_LINE>map.put("AroundInvoke", data);<NEW_LINE>results.setAroundInvokeContextData(data);<NEW_LINE>// Verify around invoke does not see any context data from lifecycle<NEW_LINE>// callback events.<NEW_LINE>if (map.containsKey("PostConstruct")) {<NEW_LINE>throw new IllegalStateException("PostConstruct context data shared with AroundInvoke interceptor");<NEW_LINE>} else if (map.containsKey("PostActivate")) {<NEW_LINE>throw new IllegalStateException("PostActivate context data shared with AroundInvoke interceptor");<NEW_LINE>} else if (map.containsKey("PrePassivate")) {<NEW_LINE>throw new IllegalStateException("PrePassivate context data shared with AroundInvoke interceptor");<NEW_LINE>} else if (map.containsKey("PreDestroy")) {<NEW_LINE>throw new IllegalStateException("PreDestroy context data shared with AroundInvoke interceptor");<NEW_LINE>}<NEW_LINE>// Verify same InvocationContext passed to each AroundInvoke<NEW_LINE>// interceptor method.<NEW_LINE>InvocationContext ctxData;<NEW_LINE>if (map.containsKey("InvocationContext")) {<NEW_LINE>ctxData = (InvocationContext) map.get("InvocationContext");<NEW_LINE>if (inv != ctxData) {<NEW_LINE>throw new IllegalStateException("Same InvocationContext not passed to each AroundInvoke interceptor");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>map.put("InvocationContext", inv);<NEW_LINE>}<NEW_LINE>Object rv = inv.proceed();<NEW_LINE>return rv;<NEW_LINE>} | > map = inv.getContextData(); |
480,667 | private int fillbuf(InputStream localIn, byte[] localBuf) throws IOException {<NEW_LINE>if (markpos == -1 || pos - markpos >= marklimit) {<NEW_LINE>// Mark position not put or exceeded readlimit<NEW_LINE>int result = localIn.read(localBuf);<NEW_LINE>if (result > 0) {<NEW_LINE>markpos = -1;<NEW_LINE>pos = 0;<NEW_LINE>count = result;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>// Added count == localBuf.length so that we do not immediately double the buffer size before<NEW_LINE>// reading any data<NEW_LINE>// when marklimit > localBuf.length. Instead, we will double the buffer size only after<NEW_LINE>// reading the initial<NEW_LINE>// localBuf worth of data without finding what we're looking for in the stream. This allows<NEW_LINE>// us to put a<NEW_LINE>// relatively small initial buffer size and a large marklimit for safety without causing an<NEW_LINE>// allocation each time<NEW_LINE>// read is called.<NEW_LINE>if (markpos == 0 && marklimit > localBuf.length && count == localBuf.length) {<NEW_LINE>// Increase buffer size to accommodate the readlimit<NEW_LINE>int newLength = localBuf.length * 2;<NEW_LINE>if (newLength > marklimit) {<NEW_LINE>newLength = marklimit;<NEW_LINE>}<NEW_LINE>byte[] newbuf = byteArrayPool.get(newLength, byte[].class);<NEW_LINE>System.arraycopy(localBuf, 0, newbuf, 0, localBuf.length);<NEW_LINE>byte[] oldbuf = localBuf;<NEW_LINE>// Reassign buf, which will invalidate any local references<NEW_LINE>// FIXME: what if buf was null?<NEW_LINE>localBuf = buf = newbuf;<NEW_LINE>byteArrayPool.put(oldbuf);<NEW_LINE>} else if (markpos > 0) {<NEW_LINE>System.arraycopy(localBuf, markpos, localBuf, <MASK><NEW_LINE>}<NEW_LINE>// Set the new position and mark position<NEW_LINE>pos -= markpos;<NEW_LINE>count = markpos = 0;<NEW_LINE>int bytesread = localIn.read(localBuf, pos, localBuf.length - pos);<NEW_LINE>count = bytesread <= 0 ? pos : pos + bytesread;<NEW_LINE>return bytesread;<NEW_LINE>} | 0, localBuf.length - markpos); |
796,450 | private void createMergeAggInfo(Analyzer analyzer) {<NEW_LINE>Preconditions.checkState(mergeAggInfo_ == null);<NEW_LINE>TupleDescriptor inputDesc = intermediateTupleDesc_;<NEW_LINE>// construct grouping exprs<NEW_LINE>ArrayList<Expr> groupingExprs = Lists.newArrayList();<NEW_LINE>for (int i = 0; i < getGroupingExprs().size(); ++i) {<NEW_LINE>groupingExprs.add(new SlotRef(inputDesc.getSlots().get(i)));<NEW_LINE>}<NEW_LINE>// construct agg exprs<NEW_LINE>ArrayList<FunctionCallExpr<MASK><NEW_LINE>for (int i = 0; i < getAggregateExprs().size(); ++i) {<NEW_LINE>FunctionCallExpr inputExpr = getAggregateExprs().get(i);<NEW_LINE>Preconditions.checkState(inputExpr.isAggregateFunction());<NEW_LINE>Expr aggExprParam = new SlotRef(inputDesc.getSlots().get(i + getGroupingExprs().size()));<NEW_LINE>FunctionCallExpr aggExpr = FunctionCallExpr.createMergeAggCall(inputExpr, Lists.newArrayList(aggExprParam));<NEW_LINE>aggExpr.analyzeNoThrow(analyzer);<NEW_LINE>// ensure the update and merge agg fn child nullable info is consistent<NEW_LINE>aggExpr.setMergeAggFnHasNullableChild(inputExpr.hasNullableChild());<NEW_LINE>aggExprs.add(aggExpr);<NEW_LINE>}<NEW_LINE>AggPhase aggPhase = (aggPhase_ == AggPhase.FIRST) ? AggPhase.FIRST_MERGE : AggPhase.SECOND_MERGE;<NEW_LINE>mergeAggInfo_ = new AggregateInfo(groupingExprs, aggExprs, aggPhase, isMultiDistinct_);<NEW_LINE>mergeAggInfo_.intermediateTupleDesc_ = intermediateTupleDesc_;<NEW_LINE>mergeAggInfo_.outputTupleDesc_ = outputTupleDesc_;<NEW_LINE>mergeAggInfo_.intermediateTupleSmap_ = intermediateTupleSmap_;<NEW_LINE>mergeAggInfo_.outputTupleSmap_ = outputTupleSmap_;<NEW_LINE>mergeAggInfo_.materializedAggSlots = materializedAggSlots;<NEW_LINE>} | > aggExprs = Lists.newArrayList(); |
719,290 | public static OpenOrders adaptOpenOrders(BitcoindeMyOpenOrdersWrapper bitcoindeOpenOrdersWrapper) {<NEW_LINE><MASK><NEW_LINE>List<BitcoindeMyOrder> bitcoindeMyOrders = bitcoindeOpenOrdersWrapper.getOrders();<NEW_LINE>List<LimitOrder> orders = new ArrayList<>(bitcoindeMyOrders.size());<NEW_LINE>for (BitcoindeMyOrder bitcoindeMyOrder : bitcoindeMyOrders) {<NEW_LINE>CurrencyPair tradingPair = CurrencyPairDeserializer.getCurrencyPairFromString(bitcoindeMyOrder.getTradingPair());<NEW_LINE>Date timestamp = fromRfc3339DateStringQuietly(bitcoindeMyOrder.getCreatedAt());<NEW_LINE>OrderType otype = "buy".equals(bitcoindeMyOrder.getType()) ? OrderType.BID : OrderType.ASK;<NEW_LINE>LimitOrder limitOrder = new LimitOrder(otype, bitcoindeMyOrder.getMaxAmount(), tradingPair, bitcoindeMyOrder.getOrderId(), timestamp, bitcoindeMyOrder.getPrice());<NEW_LINE>orders.add(limitOrder);<NEW_LINE>}<NEW_LINE>return new OpenOrders(orders);<NEW_LINE>} | System.out.println(bitcoindeOpenOrdersWrapper); |
622,750 | public static void createSubTaskProgress(String fmt, Object... args) {<NEW_LINE>if (!ProgressGlobalConfig.PROGRESS_ON.value(Boolean.class)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!ThreadContext.containsKey(Constants.THREAD_CONTEXT_API)) {<NEW_LINE>if (args != null) {<NEW_LINE>logger.warn(String.format("no task uuid found for:" + fmt, args));<NEW_LINE>} else {<NEW_LINE>logger.warn(String.format("no task uuid found for:" + fmt, args));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ThreadContext.<MASK><NEW_LINE>String parentUuid = getParentUuid();<NEW_LINE>String taskUuid = Platform.getUuid();<NEW_LINE>ThreadContext.push(taskUuid);<NEW_LINE>ThreadContext.push(Platform.getUuid());<NEW_LINE>TaskProgressVO vo = new TaskProgressVO();<NEW_LINE>vo.setApiId(ThreadContext.get(Constants.THREAD_CONTEXT_API));<NEW_LINE>vo.setTaskUuid(taskUuid);<NEW_LINE>vo.setParentUuid(parentUuid);<NEW_LINE>vo.setContent(fmt);<NEW_LINE>if (args != null) {<NEW_LINE>vo.setArguments(JSONObjectUtil.toJsonString(args));<NEW_LINE>}<NEW_LINE>vo.setType(TaskType.Task);<NEW_LINE>vo.setTime(System.currentTimeMillis());<NEW_LINE>vo.setManagementUuid(Platform.getManagementServerId());<NEW_LINE>vo.setTaskName(ThreadContext.get(Constants.THREAD_CONTEXT_TASK_NAME));<NEW_LINE>Platform.getComponentLoader().getComponent(DatabaseFacade.class).persist(vo);<NEW_LINE>// use content as the subtask name<NEW_LINE>ThreadContext.put(Constants.THREAD_CONTEXT_TASK_NAME, vo.getContent());<NEW_LINE>} | put(Constants.THREAD_CONTEXT_PROGRESS_ENABLED, "true"); |
1,538,355 | public void deleteById(String id) {<NEW_LINE>String resourceGroupName = <MASK><NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String mobileNetworkName = Utils.getValueFromIdByName(id, "mobileNetworks");<NEW_LINE>if (mobileNetworkName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'mobileNetworks'.", id)));<NEW_LINE>}<NEW_LINE>String sliceName = Utils.getValueFromIdByName(id, "slices");<NEW_LINE>if (sliceName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'slices'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(resourceGroupName, mobileNetworkName, sliceName, Context.NONE);<NEW_LINE>} | Utils.getValueFromIdByName(id, "resourceGroups"); |
1,283,624 | private void updatePieChart(List<TaskProxy> tasks) {<NEW_LINE>if (pieChart == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Calculate the slices based on the due date.<NEW_LINE>double pastDue = 0;<NEW_LINE>double dueSoon = 0;<NEW_LINE>double onTime = 0;<NEW_LINE>double noDate = 0;<NEW_LINE>final Date now = new Date();<NEW_LINE>final Date tomorrow = new Date(now.getYear(), now.getMonth(), now.getDate() + 1, 23, 59, 59);<NEW_LINE>for (TaskProxy task : tasks) {<NEW_LINE>Date dueDate = task.getDueDate();<NEW_LINE>if (dueDate == null) {<NEW_LINE>noDate++;<NEW_LINE>} else if (dueDate.before(now)) {<NEW_LINE>pastDue++;<NEW_LINE>} else if (dueDate.before(tomorrow)) {<NEW_LINE>dueSoon++;<NEW_LINE>} else {<NEW_LINE>onTime++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Update the pie chart.<NEW_LINE>pieChart.clearSlices();<NEW_LINE>if (pastDue > 0) {<NEW_LINE>pieChart.addSlice(pastDue, CssColor.make(255, 100, 100));<NEW_LINE>}<NEW_LINE>if (dueSoon > 0) {<NEW_LINE>pieChart.addSlice(dueSoon, CssColor.make<MASK><NEW_LINE>}<NEW_LINE>if (onTime > 0) {<NEW_LINE>pieChart.addSlice(onTime, CssColor.make(100, 255, 100));<NEW_LINE>}<NEW_LINE>if (noDate > 0) {<NEW_LINE>pieChart.addSlice(noDate, CssColor.make(200, 200, 200));<NEW_LINE>}<NEW_LINE>pieChart.redraw();<NEW_LINE>} | (255, 200, 100)); |
1,182,542 | public static ListAppServicesPageResponse unmarshall(ListAppServicesPageResponse listAppServicesPageResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAppServicesPageResponse.setRequestId(_ctx.stringValue("ListAppServicesPageResponse.RequestId"));<NEW_LINE>listAppServicesPageResponse.setMessage<MASK><NEW_LINE>listAppServicesPageResponse.setTraceId(_ctx.stringValue("ListAppServicesPageResponse.TraceId"));<NEW_LINE>listAppServicesPageResponse.setErrorCode(_ctx.stringValue("ListAppServicesPageResponse.ErrorCode"));<NEW_LINE>listAppServicesPageResponse.setCode(_ctx.stringValue("ListAppServicesPageResponse.Code"));<NEW_LINE>listAppServicesPageResponse.setSuccess(_ctx.booleanValue("ListAppServicesPageResponse.Success"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAppServicesPageResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setCurrentPage(_ctx.stringValue("ListAppServicesPageResponse.Data[" + i + "].CurrentPage"));<NEW_LINE>dataItem.setTotalSize(_ctx.stringValue("ListAppServicesPageResponse.Data[" + i + "].TotalSize"));<NEW_LINE>dataItem.setPageNumber(_ctx.stringValue("ListAppServicesPageResponse.Data[" + i + "].PageNumber"));<NEW_LINE>dataItem.setPageSize(_ctx.stringValue("ListAppServicesPageResponse.Data[" + i + "].PageSize"));<NEW_LINE>List<MscAgentServiceResponse> result = new ArrayList<MscAgentServiceResponse>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListAppServicesPageResponse.Data[" + i + "].Result.Length"); j++) {<NEW_LINE>MscAgentServiceResponse mscAgentServiceResponse = new MscAgentServiceResponse();<NEW_LINE>mscAgentServiceResponse.setEdasAppName(_ctx.stringValue("ListAppServicesPageResponse.Data[" + i + "].Result[" + j + "].EdasAppName"));<NEW_LINE>mscAgentServiceResponse.setVersion(_ctx.stringValue("ListAppServicesPageResponse.Data[" + i + "].Result[" + j + "].Version"));<NEW_LINE>mscAgentServiceResponse.setInstanceNum(_ctx.longValue("ListAppServicesPageResponse.Data[" + i + "].Result[" + j + "].InstanceNum"));<NEW_LINE>mscAgentServiceResponse.setEdasAppId(_ctx.stringValue("ListAppServicesPageResponse.Data[" + i + "].Result[" + j + "].EdasAppId"));<NEW_LINE>mscAgentServiceResponse.setServiceName(_ctx.stringValue("ListAppServicesPageResponse.Data[" + i + "].Result[" + j + "].ServiceName"));<NEW_LINE>mscAgentServiceResponse.setGroup(_ctx.stringValue("ListAppServicesPageResponse.Data[" + i + "].Result[" + j + "].Group"));<NEW_LINE>result.add(mscAgentServiceResponse);<NEW_LINE>}<NEW_LINE>dataItem.setResult(result);<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>listAppServicesPageResponse.setData(data);<NEW_LINE>return listAppServicesPageResponse;<NEW_LINE>} | (_ctx.stringValue("ListAppServicesPageResponse.Message")); |
1,409,923 | private void applyToWST_XMLEditor(Theme theme, boolean revertToDefaults) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode("org.eclipse.wst.xml.ui");<NEW_LINE>setGeneralEditorValues(theme, prefs, revertToDefaults);<NEW_LINE>// FIXME These were adapted from our scopes for DTD, but those don't appear correct to me!<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "punctuation.definition.tag.xml", "tagBorder", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "entity.name.tag.xml", "tagName", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "entity.other.attribute-name.xml", "tagAttributeName", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "punctuation.separator.key-value.xml", "tagAttributeEquals", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "string.quoted.xml", "tagAttributeValue", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "text.xml", "xmlContent", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "comment.block.xml", "commentBorder", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, <MASK><NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "constant.character.entity.xml", "entityReference", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "source.dtd", "doctypeName", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "keyword.operator.dtd", "doctypeExternalPubref", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "keyword.operator.dtd", "doctypeExtrenalSysref", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "keyword.operator.dtd", "doctypeExternalId", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "source.dtd", "declBorder", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "string.unquoted.cdata.xml", "cdataBorder", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "string.unquoted.cdata.xml", "cdataText", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "meta.tag.preprocessor.xml", "piBorder", revertToDefaults);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>setWSTToken(prefs, theme, "meta.tag.preprocessor.xml", "piContent", revertToDefaults);<NEW_LINE>try {<NEW_LINE>prefs.flush();<NEW_LINE>} catch (BackingStoreException e) {<NEW_LINE>IdeLog.logError(ThemePlugin.getDefault(), e);<NEW_LINE>}<NEW_LINE>} | theme, "comment.block.xml", "commentText", revertToDefaults); |
1,744,821 | void checkSpecificAccessControl() throws UnauthorizedAccessException {<NEW_LINE>String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID);<NEW_LINE>FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackQuestionId);<NEW_LINE>if (feedbackQuestion == null) {<NEW_LINE>throw new EntityNotFoundException("The feedback question does not exist.");<NEW_LINE>}<NEW_LINE>verifyInstructorCanSeeQuestionIfInModeration(feedbackQuestion);<NEW_LINE>Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT));<NEW_LINE>FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackQuestion.getFeedbackSessionName(), feedbackQuestion.getCourseId());<NEW_LINE>switch(intent) {<NEW_LINE>case STUDENT_SUBMISSION:<NEW_LINE>gateKeeper.verifyAnswerableForStudent(feedbackQuestion);<NEW_LINE>StudentAttributes studentAttributes = getStudentOfCourseFromRequest(feedbackSession.getCourseId());<NEW_LINE>checkAccessControlForStudentFeedbackSubmission(studentAttributes, feedbackSession);<NEW_LINE>break;<NEW_LINE>case INSTRUCTOR_SUBMISSION:<NEW_LINE>gateKeeper.verifyAnswerableForInstructor(feedbackQuestion);<NEW_LINE>InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(feedbackSession.getCourseId());<NEW_LINE>checkAccessControlForInstructorFeedbackSubmission(instructorAttributes, feedbackSession);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new InvalidHttpParameterException("Unknown intent " + intent); |
95,712 | private ItemChangeSets parseChangeSets(NamespaceIdentifier namespace, List<ItemDTO> sourceItems) {<NEW_LINE>ItemChangeSets changeSets = new ItemChangeSets();<NEW_LINE>List<ItemDTO> targetItems = itemAPI.findItems(namespace.getAppId(), namespace.getEnv(), namespace.getClusterName(), namespace.getNamespaceName());<NEW_LINE>long namespaceId = getNamespaceId(namespace);<NEW_LINE>if (CollectionUtils.isEmpty(targetItems)) {<NEW_LINE>// all source items is added<NEW_LINE>int lineNum = 1;<NEW_LINE>for (ItemDTO sourceItem : sourceItems) {<NEW_LINE>changeSets.addCreateItem(buildItem(namespaceId, lineNum++, sourceItem));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Map<String, ItemDTO> targetItemMap = BeanUtils.mapByKey("key", targetItems);<NEW_LINE>String key, sourceValue, sourceComment;<NEW_LINE>ItemDTO targetItem = null;<NEW_LINE>// append to last<NEW_LINE>int maxLineNum = targetItems.size();<NEW_LINE>for (ItemDTO sourceItem : sourceItems) {<NEW_LINE>key = sourceItem.getKey();<NEW_LINE>sourceValue = sourceItem.getValue();<NEW_LINE>sourceComment = sourceItem.getComment();<NEW_LINE><MASK><NEW_LINE>if (targetItem == null) {<NEW_LINE>// added items<NEW_LINE>changeSets.addCreateItem(buildItem(namespaceId, ++maxLineNum, sourceItem));<NEW_LINE>} else if (isModified(sourceValue, targetItem.getValue(), sourceComment, targetItem.getComment())) {<NEW_LINE>// modified items<NEW_LINE>targetItem.setValue(sourceValue);<NEW_LINE>targetItem.setComment(sourceComment);<NEW_LINE>changeSets.addUpdateItem(targetItem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return changeSets;<NEW_LINE>} | targetItem = targetItemMap.get(key); |
1,549,840 | void write(String log, int flag) {<NEW_LINE>if (TextUtils.isEmpty(log)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LoganModel model = new LoganModel();<NEW_LINE>model.action = LoganModel.Action.WRITE;<NEW_LINE>WriteAction action = new WriteAction();<NEW_LINE>String threadName = Thread.currentThread().getName();<NEW_LINE>long threadLog = Thread<MASK><NEW_LINE>boolean isMain = false;<NEW_LINE>if (Looper.getMainLooper() == Looper.myLooper()) {<NEW_LINE>isMain = true;<NEW_LINE>}<NEW_LINE>action.log = log;<NEW_LINE>action.localTime = System.currentTimeMillis();<NEW_LINE>action.flag = flag;<NEW_LINE>action.isMainThread = isMain;<NEW_LINE>action.threadId = threadLog;<NEW_LINE>action.threadName = threadName;<NEW_LINE>model.writeAction = action;<NEW_LINE>if (mCacheLogQueue.size() < mMaxQueue) {<NEW_LINE>mCacheLogQueue.add(model);<NEW_LINE>if (mLoganThread != null) {<NEW_LINE>mLoganThread.notifyRun();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .currentThread().getId(); |
474,984 | AST replaceFoundAST(AST astNode, RevisionData revisionData, Map<IndexDef, List<Path<QNm>>> foundIndexDefs, Map<IndexDef, Integer> predicateLevels, Deque<QueryPathSegment> pathSegmentNamesToArrayIndexes, AST predicateLeafNode) {<NEW_LINE>final var indexExpr = new AST(XQExt.IndexExpr, XQExt<MASK><NEW_LINE>indexExpr.setProperty("indexType", foundIndexDefs.keySet().iterator().next().getType());<NEW_LINE>indexExpr.setProperty("indexDefs", foundIndexDefs);<NEW_LINE>indexExpr.setProperty("databaseName", revisionData.databaseName());<NEW_LINE>indexExpr.setProperty("resourceName", revisionData.resourceName());<NEW_LINE>indexExpr.setProperty("revision", revisionData.revision());<NEW_LINE>indexExpr.setProperty("pathSegmentNamesToArrayIndexes", pathSegmentNamesToArrayIndexes);<NEW_LINE>final var parentASTNode = astNode.getParent();<NEW_LINE>parentASTNode.replaceChild(astNode.getChildIndex(), indexExpr);<NEW_LINE>return indexExpr;<NEW_LINE>} | .toName(XQExt.IndexExpr)); |
1,078,302 | public ThemeValue unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ThemeValue themeValue = new ThemeValue();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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("children", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>themeValue.setChildren(new ListUnmarshaller<ThemeValues>(ThemeValuesJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>themeValue.setValue(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 themeValue;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,291,162 | protected List<EventSubscription> findEventSubscriptions(String scopeType, EventInstance eventInstance, Collection<CorrelationKey> correlationKeys) {<NEW_LINE>return commandExecutor.execute(commandContext -> {<NEW_LINE>EventSubscriptionQuery eventSubscriptionQuery = createEventSubscriptionQuery().eventType(eventInstance.getEventKey()).scopeType(scopeType);<NEW_LINE>if (!correlationKeys.isEmpty()) {<NEW_LINE>Set<String> allCorrelationKeyValues = correlationKeys.stream().map(CorrelationKey::getValue).<MASK><NEW_LINE>eventSubscriptionQuery.or().withoutConfiguration().configurations(allCorrelationKeyValues).endOr();<NEW_LINE>} else {<NEW_LINE>eventSubscriptionQuery.withoutConfiguration();<NEW_LINE>}<NEW_LINE>String eventInstanceTenantId = eventInstance.getTenantId();<NEW_LINE>if (eventInstanceTenantId != null && !AbstractEngineConfiguration.NO_TENANT_ID.equals(eventInstanceTenantId)) {<NEW_LINE>EventRegistryEngineConfiguration eventRegistryConfiguration = CommandContextUtil.getEventRegistryConfiguration();<NEW_LINE>if (eventRegistryConfiguration.isFallbackToDefaultTenant()) {<NEW_LINE>String defaultTenant = eventRegistryConfiguration.getDefaultTenantProvider().getDefaultTenant(eventInstance.getTenantId(), scopeType, eventInstance.getEventKey());<NEW_LINE>if (AbstractEngineConfiguration.NO_TENANT_ID.equals(defaultTenant)) {<NEW_LINE>eventSubscriptionQuery.or().tenantId(eventInstance.getTenantId()).withoutTenantId().endOr();<NEW_LINE>} else {<NEW_LINE>eventSubscriptionQuery.tenantIds(Arrays.asList(eventInstanceTenantId, defaultTenant));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>eventSubscriptionQuery.tenantId(eventInstanceTenantId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return eventSubscriptionQuery.list();<NEW_LINE>});<NEW_LINE>} | collect(Collectors.toSet()); |
1,006,375 | private Status handleOutOfMemory(OutOfMemoryError ex) {<NEW_LINE>// try to clean up a bit of space, hopefully, so we can report this error<NEW_LINE>System.gc();<NEW_LINE>String oomeMessage = ex.getMessage();<NEW_LINE>boolean heapError = false;<NEW_LINE>if (oomeMessage != null) {<NEW_LINE>if (oomeMessage.contains("unable to create new native thread")) {<NEW_LINE>// report thread exhaustion error<NEW_LINE>config.getError().println("Error: Your application demanded too many live threads, perhaps for Fiber or Enumerator.");<NEW_LINE>config.getError().println("Ensure your old Fibers and Enumerators are being cleaned up.");<NEW_LINE>} else {<NEW_LINE>heapError = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (heapError) {<NEW_LINE>// report heap memory error<NEW_LINE>String memoryMax = getRuntimeFlagValue("-Xmx");<NEW_LINE>if (memoryMax != null) {<NEW_LINE>config.getError().println("Error: Your application used more memory than the safety cap of " + memoryMax + ".");<NEW_LINE>} else {<NEW_LINE>config.getError().println("Error: Your application used more memory than the automatic cap of " + Runtime.getRuntime().maxMemory(<MASK><NEW_LINE>}<NEW_LINE>config.getError().println("Specify -J-Xmx####M to increase it (#### = cap size in MB).");<NEW_LINE>}<NEW_LINE>if (config.isVerbose()) {<NEW_LINE>ex.printStackTrace(config.getError());<NEW_LINE>} else {<NEW_LINE>config.getError().println("Specify -w for full " + ex + " stack trace");<NEW_LINE>}<NEW_LINE>return new Status(1);<NEW_LINE>} | ) / 1024 / 1024 + "MB."); |
931,192 | private void determineDetailedFunctionConflicts(ExternalLocation[] externalLocations, TaskMonitor monitor) throws CancelledException {<NEW_LINE>Function[] functions = new Function[4];<NEW_LINE>functions[RESULT] = externalLocations[RESULT].getFunction();<NEW_LINE>functions[LATEST] = externalLocations[LATEST].getFunction();<NEW_LINE>functions[MY] = externalLocations[MY].getFunction();<NEW_LINE>functions[ORIGINAL] = (externalLocations[ORIGINAL] != null) ? externalLocations[ORIGINAL].getFunction() : null;<NEW_LINE>boolean noLatestFunction = (functions[LATEST] == null);<NEW_LINE>boolean noMyFunction = <MASK><NEW_LINE>boolean noOriginalFunction = (functions[ORIGINAL] == null);<NEW_LINE>// If both removed it then the function should already be auto-merged.<NEW_LINE>if (noLatestFunction && noMyFunction) {<NEW_LINE>throw new AssertException("Shouldn't be here! Something is wrong.");<NEW_LINE>}<NEW_LINE>// If one removed it and one changed it, then save a remove function conflict.<NEW_LINE>if (!noOriginalFunction && (noLatestFunction != noMyFunction)) {<NEW_LINE>long originalID = externalLocations[ORIGINAL].getSymbol().getID();<NEW_LINE>saveExternalRemoveFunctionConflict(originalID);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Determine function conflicts and auto-merge changes that aren't in conflict.<NEW_LINE>determineFunctionConflicts(functions, true, monitor);<NEW_LINE>// If only one added then the function should already be auto-merged.<NEW_LINE>if (noOriginalFunction && (noLatestFunction || noMyFunction)) {<NEW_LINE>throw new AssertException("Shouldn't be here! It looks like only Latest or My added the function.");<NEW_LINE>}<NEW_LINE>} | (functions[MY] == null); |
637,003 | protected void didBecomeActive(@Nullable Bundle savedInstanceState) {<NEW_LINE>super.didBecomeActive(savedInstanceState);<NEW_LINE>presenter.squareClicks().subscribe(new Consumer<BoardCoordinate>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void accept(BoardCoordinate xy) throws Exception {<NEW_LINE>if (board.cells[xy.getX()][xy.getY()] == null) {<NEW_LINE>if (currentPlayer == MarkerType.CROSS) {<NEW_LINE>board.cells[xy.getX()][xy.getY()] = MarkerType.CROSS;<NEW_LINE>board.currentRow = xy.getX();<NEW_LINE>board.currentCol = xy.getY();<NEW_LINE>presenter.addCross(xy);<NEW_LINE>currentPlayer = MarkerType.NOUGHT;<NEW_LINE>} else {<NEW_LINE>board.cells[xy.getX()][xy.getY()] = MarkerType.NOUGHT;<NEW_LINE>board.currentRow = xy.getX();<NEW_LINE>board.currentCol = xy.getY();<NEW_LINE>presenter.addNought(xy);<NEW_LINE>currentPlayer = MarkerType.CROSS;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (board.hasWon(MarkerType.CROSS)) {<NEW_LINE>presenter.<MASK><NEW_LINE>listener.gameWon(playerOne);<NEW_LINE>} else if (board.hasWon(MarkerType.NOUGHT)) {<NEW_LINE>presenter.setPlayerWon(playerTwo.getUserName());<NEW_LINE>listener.gameWon(playerTwo);<NEW_LINE>} else if (board.isDraw()) {<NEW_LINE>presenter.setPlayerTie();<NEW_LINE>listener.gameWon(null);<NEW_LINE>} else {<NEW_LINE>updateCurrentPlayer();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>updateCurrentPlayer();<NEW_LINE>} | setPlayerWon(playerOne.getUserName()); |
483,547 | final CreateSubnetCidrReservationResult executeCreateSubnetCidrReservation(CreateSubnetCidrReservationRequest createSubnetCidrReservationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSubnetCidrReservationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSubnetCidrReservationRequest> request = null;<NEW_LINE>Response<CreateSubnetCidrReservationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSubnetCidrReservationRequestMarshaller().marshall(super.beforeMarshalling(createSubnetCidrReservationRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSubnetCidrReservation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateSubnetCidrReservationResult> responseHandler = new StaxResponseHandler<CreateSubnetCidrReservationResult>(new CreateSubnetCidrReservationResultStaxUnmarshaller());<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>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
356,427 | public Void visitType(CodeTypeElement e, Void p) {<NEW_LINE>boolean rootType = e.getEnclosingClass() == null;<NEW_LINE>if (rootType) {<NEW_LINE>suppressedWarnings.clear();<NEW_LINE>}<NEW_LINE>List<TypeElement> superTypes = ElementUtils.getSuperTypes(e);<NEW_LINE>for (TypeElement type : superTypes) {<NEW_LINE>String qualifiedName = ElementUtils.getQualifiedName(type);<NEW_LINE>if (qualifiedName.equals(Serializable.class.getCanonicalName())) {<NEW_LINE>if (!e.containsField("serialVersionUID")) {<NEW_LINE>suppressedWarnings.add("serial");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ElementUtils.isPackageDeprecated(e)) {<NEW_LINE>suppressedWarnings.add("deprecation");<NEW_LINE>}<NEW_LINE>super.visitType(e, p);<NEW_LINE>if (seenDeprecatedType && rootType) {<NEW_LINE>AnnotationMirror suppressWarnings = ElementUtils.findAnnotationMirror(generatedBy, SuppressWarnings.class);<NEW_LINE>if (suppressWarnings != null) {<NEW_LINE>List<String> currentValues = ElementUtils.getAnnotationValueList(String.class, suppressWarnings, "value");<NEW_LINE>if (currentValues.contains("deprecation")) {<NEW_LINE>suppressedWarnings.add("deprecation");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rootType && !suppressedWarnings.isEmpty()) {<NEW_LINE>GeneratorUtils.mergeSupressWarnings(e, suppressedWarnings.toArray<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | (new String[0])); |
1,574,685 | public Object toCompleteResponse(String rootUrl) {<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>if (skin != null && skin.getSkin() != null) {<NEW_LINE>if (skin.getModel() == TextureModel.ALEX) {<NEW_LINE>realTextures.put("SKIN", mapOf(pair("url", rootUrl + "/textures/" + skin.getSkin().getHash()), pair("metadata", mapOf(pair("model", "slim")))));<NEW_LINE>} else {<NEW_LINE>realTextures.put("SKIN", mapOf(pair("url", rootUrl + "/textures/" + skin.getSkin().getHash())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (skin != null && skin.getCape() != null) {<NEW_LINE>realTextures.put("CAPE", mapOf(pair("url", rootUrl + "/textures/" + skin.getCape().getHash())));<NEW_LINE>}<NEW_LINE>Map<String, Object> textureResponse = mapOf(pair("timestamp", System.currentTimeMillis()), pair("profileId", uuid), pair("profileName", name), pair("textures", realTextures));<NEW_LINE>return mapOf(pair("id", uuid), pair("name", name), pair("properties", properties(true, pair("textures", new String(Base64.getEncoder().encode(JsonUtils.GSON.toJson(textureResponse).getBytes(UTF_8)), UTF_8)))));<NEW_LINE>} | realTextures = new HashMap<>(); |
292,594 | private JSDynamicObject readJSArrayBufferView(JSContext context, JSRealm realm, JSDynamicObject arrayBuffer) {<NEW_LINE>assert JSArrayBuffer.isJSDirectOrSharedArrayBuffer(arrayBuffer);<NEW_LINE>SerializationTag arrayBufferViewTag = readTag();<NEW_LINE>assert arrayBufferViewTag == SerializationTag.ARRAY_BUFFER_VIEW;<NEW_LINE>ArrayBufferViewTag tag = readArrayBufferViewTag();<NEW_LINE>int offset = readVarInt();<NEW_LINE>int byteLength = readVarInt();<NEW_LINE>JSDynamicObject view;<NEW_LINE>if (tag == ArrayBufferViewTag.DATA_VIEW) {<NEW_LINE>view = JSDataView.createDataView(context, realm, arrayBuffer, offset, byteLength);<NEW_LINE>} else {<NEW_LINE>TypedArrayFactory factory = tag.getFactory();<NEW_LINE>TypedArray array = factory.<MASK><NEW_LINE>int length = byteLength / factory.getBytesPerElement();<NEW_LINE>view = JSArrayBufferView.createArrayBufferView(context, realm, arrayBuffer, array, offset, length);<NEW_LINE>}<NEW_LINE>return assignId(view);<NEW_LINE>} | createArrayType(true, offset != 0); |
1,349,564 | private synchronized void compact() {<NEW_LINE>BlockBuilder newHeapBlockBuilder = type.createBlockBuilder(null, heapBlockBuilder.getPositionCount());<NEW_LINE>// since block positions are changed, we need to update all data structures which are using block position as reference<NEW_LINE>LongBigArray newBlockPositionToCount = new LongBigArray();<NEW_LINE>hashCapacity = arraySize(heapCapacity, FILL_RATIO);<NEW_LINE>maxFill = calculateMaxFill(hashCapacity);<NEW_LINE>newBlockPositionToCount.ensureCapacity(hashCapacity);<NEW_LINE>IntBigArray newBlockToHeapIndex = new IntBigArray();<NEW_LINE>newBlockToHeapIndex.ensureCapacity(hashCapacity);<NEW_LINE>for (int heapPosition = 0; heapPosition < getHeapSize(); heapPosition++) {<NEW_LINE>int newBlockPos = newHeapBlockBuilder.getPositionCount();<NEW_LINE>StreamDataEntity heapEntry = minHeap.get(heapPosition);<NEW_LINE>int oldBlockPosition = getBlockPosition(heapEntry);<NEW_LINE>type.<MASK><NEW_LINE>newBlockPositionToCount.set(newBlockPos, blockPositionToCount.get(oldBlockPosition));<NEW_LINE>newBlockToHeapIndex.set(newBlockPos, heapPosition);<NEW_LINE>hashToBlockPosition.set(heapEntry.getHashPosition(), newBlockPos);<NEW_LINE>}<NEW_LINE>blockPositionToCount = newBlockPositionToCount;<NEW_LINE>heapBlockBuilder = newHeapBlockBuilder;<NEW_LINE>blockToHeapIndex = newBlockToHeapIndex;<NEW_LINE>rehash();<NEW_LINE>} | appendTo(heapBlockBuilder, oldBlockPosition, newHeapBlockBuilder); |
383,862 | final UpdateFileSystemResult executeUpdateFileSystem(UpdateFileSystemRequest updateFileSystemRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateFileSystemRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateFileSystemRequest> request = null;<NEW_LINE>Response<UpdateFileSystemResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateFileSystemRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateFileSystemRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateFileSystem");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateFileSystemResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateFileSystemResultJsonUnmarshaller());<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.SERVICE_ID, "EFS"); |
1,068,193 | private void createObjectsTable(Composite parent) {<NEW_LINE>Composite placeholder = UIUtils.createComposite(parent, 1);<NEW_LINE>placeholder.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>Group tableGroup = UIUtils.createControlGroup(placeholder, UINavigatorMessages.confirm_deleting_multiple_objects_table_group_name, 1, GridData.FILL_BOTH, 0);<NEW_LINE>tableGroup.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>Table objectsTable = new Table(tableGroup, SWT.BORDER | SWT.FULL_SELECTION);<NEW_LINE>objectsTable.setHeaderVisible(false);<NEW_LINE>objectsTable.setLinesVisible(true);<NEW_LINE>GridData gd = new GridData(GridData.FILL_BOTH);<NEW_LINE>int fontHeight = UIUtils.getFontHeight(objectsTable);<NEW_LINE>int rowCount = selectedObjects.size();<NEW_LINE>gd.widthHint = fontHeight * 7;<NEW_LINE>gd.heightHint = rowCount < 6 ? fontHeight <MASK><NEW_LINE>objectsTable.setLayoutData(gd);<NEW_LINE>UIUtils.createTableColumn(objectsTable, SWT.LEFT, UINavigatorMessages.confirm_deleting_multiple_objects_column_name);<NEW_LINE>UIUtils.createTableColumn(objectsTable, SWT.LEFT, "Type");<NEW_LINE>UIUtils.createTableColumn(objectsTable, SWT.LEFT, UINavigatorMessages.confirm_deleting_multiple_objects_column_description);<NEW_LINE>for (Object obj : selectedObjects) {<NEW_LINE>if (!(obj instanceof DBNNode)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>DBNNode node = (DBNNode) obj;<NEW_LINE>TableItem item = new TableItem(objectsTable, SWT.NONE);<NEW_LINE>item.setImage(DBeaverIcons.getImage(node.getNodeIcon()));<NEW_LINE>if (node instanceof DBNResource && ((DBNResource) node).getResource() != null) {<NEW_LINE>item.setText(0, node.getName());<NEW_LINE>IResource resource = ((DBNResource) node).getResource();<NEW_LINE>IPath resLocation = resource == null ? null : resource.getLocation();<NEW_LINE>item.setText(1, "File");<NEW_LINE>item.setText(2, resLocation == null ? "" : resLocation.toFile().getAbsolutePath());<NEW_LINE>} else {<NEW_LINE>item.setText(0, node.getNodeFullName());<NEW_LINE>item.setText(1, node.getNodeType());<NEW_LINE>item.setText(2, CommonUtils.toString(node.getNodeDescription()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UIUtils.asyncExec(() -> UIUtils.packColumns(objectsTable, true));<NEW_LINE>} | * 2 * rowCount : fontHeight * 10; |
106,793 | public boolean resourceUpdate(WSFloatingPointValue value) throws IhcExecption {<NEW_LINE>final String soapQuery = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + " <setResourceValue1 xmlns=\"utcs\">" + " <value xmlns:q1=\"utcs.values\" xsi:type=\"q1:WSFloatingPointValue\">" + " <q1:maximumValue>%s</q1:maximumValue>" + " <q1:minimumValue>%s</q1:minimumValue>" + " <q1:floatingPointValue>%s</q1:floatingPointValue>" + " </value>" + " <resourceID>%s</resourceID>" <MASK><NEW_LINE>String query = String.format(soapQuery, value.getMaximumValue(), value.getMinimumValue(), value.getFloatingPointValue(), value.getResourceID());<NEW_LINE>return doResourceUpdate(query);<NEW_LINE>} | + " <isValueRuntime>true</isValueRuntime>" + " </setResourceValue1>" + "</soap:Body>" + "</soap:Envelope>"; |
790,103 | private void updateIncomingCallScreen(final RtpEndUserState state, final Contact contact) {<NEW_LINE>if (state == RtpEndUserState.INCOMING_CALL || state == RtpEndUserState.ACCEPTING_CALL) {<NEW_LINE>final boolean show = getResources().getBoolean(R.bool.show_avatar_incoming_call);<NEW_LINE>if (show) {<NEW_LINE>binding.<MASK><NEW_LINE>if (contact == null) {<NEW_LINE>AvatarWorkerTask.loadAvatar(getWith(), binding.contactPhoto, R.dimen.publish_avatar_size);<NEW_LINE>} else {<NEW_LINE>AvatarWorkerTask.loadAvatar(contact, binding.contactPhoto, R.dimen.publish_avatar_size);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>binding.contactPhoto.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>final Account account = contact == null ? getWith().getAccount() : contact.getAccount();<NEW_LINE>binding.usingAccount.setVisibility(View.VISIBLE);<NEW_LINE>binding.usingAccount.setText(getString(R.string.using_account, account.getJid().asBareJid().toEscapedString()));<NEW_LINE>} else {<NEW_LINE>binding.usingAccount.setVisibility(View.GONE);<NEW_LINE>binding.contactPhoto.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>} | contactPhoto.setVisibility(View.VISIBLE); |
1,084,774 | public void testComplete() throws Exception {<NEW_LINE><MASK><NEW_LINE>CountDownLatch continueLatch = new CountDownLatch(1);<NEW_LINE>try {<NEW_LINE>BlockableSupplier<String> supplier = new BlockableSupplier<String>("testComplete", beginLatch, continueLatch);<NEW_LINE>CompletableFuture<String> cf = defaultManagedExecutor.supplyAsync(supplier);<NEW_LINE>assertTrue(beginLatch.await(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(cf.complete("Intentionally completed prematurely"));<NEW_LINE>assertFalse(cf.complete("Should be ignored because already complete"));<NEW_LINE>assertFalse(cf.completeExceptionally(new Exception("Ignore this exception because already complete")));<NEW_LINE>assertFalse(cf.cancel(true));<NEW_LINE>assertEquals("Intentionally completed prematurely", cf.getNow("Value to return if not done yet"));<NEW_LINE>assertTrue(cf.isDone());<NEW_LINE>assertFalse(cf.isCompletedExceptionally());<NEW_LINE>assertFalse(cf.isCancelled());<NEW_LINE>assertEquals("Intentionally completed prematurely", cf.get(1, TimeUnit.NANOSECONDS));<NEW_LINE>// Expect supplier thread to be interrupted due to premature completion<NEW_LINE>for (long start = System.nanoTime(); supplier.executionThread != null && System.nanoTime() - start < TIMEOUT_NS; TimeUnit.MILLISECONDS.sleep(200)) ;<NEW_LINE>assertNull(supplier.executionThread);<NEW_LINE>} finally {<NEW_LINE>// in case the test fails, unblock the thread that is running the supplier<NEW_LINE>continueLatch.countDown();<NEW_LINE>}<NEW_LINE>} | CountDownLatch beginLatch = new CountDownLatch(1); |
799,311 | public <T> EVCacheOperationFuture<CASValue<T>> asyncGetAndTouch(final String key, final int exp, final Transcoder<T> tc) {<NEW_LINE>final CountDownLatch latch = new CountDownLatch(1);<NEW_LINE>final EVCacheOperationFuture<CASValue<T>> rv = new EVCacheOperationFuture<CASValue<T>>(key, latch, new AtomicReference<CASValue<T>>(null), operationTimeout, executorService, client);<NEW_LINE>Operation op = opFact.getAndTouch(key, exp, new GetAndTouchOperation.Callback() {<NEW_LINE><NEW_LINE>private CASValue<T> val = null;<NEW_LINE><NEW_LINE>public void receivedStatus(OperationStatus status) {<NEW_LINE>if (log.isDebugEnabled())<NEW_LINE>log.debug("GetAndTouch Key : " + key + "; Status : " + status.getStatusCode().name() + (log.isTraceEnabled() ? " Node : " + getEVCacheNode(key) : "") + "; Message : " + status.getMessage() + "; Elapsed Time - " + (System.currentTimeMillis() - rv.getStartTime()));<NEW_LINE>rv.set(val, status);<NEW_LINE>}<NEW_LINE><NEW_LINE>public void complete() {<NEW_LINE>latch.countDown();<NEW_LINE>final String host = ((rv.getStatus().getStatusCode().equals(StatusCode.TIMEDOUT) && rv.getOperation() != null) ? getHostName(rv.getOperation().getHandlingNode().getSocketAddress()) : null);<NEW_LINE>getTimer(EVCacheMetricsFactory.GET_AND_TOUCH_OPERATION, EVCacheMetricsFactory.READ, rv.getStatus(), (val != null ? EVCacheMetricsFactory.YES : EVCacheMetricsFactory.NO), host, getReadMetricMaxValue()).record((System.currentTimeMillis() - rv.getStartTime()), TimeUnit.MILLISECONDS);<NEW_LINE>rv.signalComplete();<NEW_LINE>}<NEW_LINE><NEW_LINE>public void gotData(String k, int flags, long cas, byte[] data) {<NEW_LINE>if (isWrongKeyReturned(key, k))<NEW_LINE>return;<NEW_LINE>if (data != null)<NEW_LINE>getDataSizeDistributionSummary(EVCacheMetricsFactory.GET_AND_TOUCH_OPERATION, EVCacheMetricsFactory.READ, EVCacheMetricsFactory.IPC_SIZE_INBOUND).record(data.length);<NEW_LINE>val = new CASValue<T>(cas, tc.decode(new CachedData(flags, data, <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>rv.setOperation(op);<NEW_LINE>mconn.enqueueOperation(key, op);<NEW_LINE>return rv;<NEW_LINE>} | tc.getMaxSize()))); |
1,582,392 | public void onBeforeSave(final I_AD_WF_Node wfNodeRecord, final boolean newRecord) {<NEW_LINE>final I_AD_Workflow workflow = InterfaceWrapperHelper.load(wfNodeRecord.getAD_Workflow_ID(), I_AD_Workflow.class);<NEW_LINE>if (X_AD_Workflow.WORKFLOWTYPE_Manufacturing.equals(workflow.getWorkflowType())) {<NEW_LINE>wfNodeRecord.setAction(X_AD_WF_Node.ACTION_WaitSleep);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final WFNodeAction action = WFNodeAction.<MASK><NEW_LINE>if (action == WFNodeAction.WaitSleep) {<NEW_LINE>;<NEW_LINE>} else if (action == WFNodeAction.AppsProcess || action == WFNodeAction.AppsReport) {<NEW_LINE>if (wfNodeRecord.getAD_Process_ID() <= 0) {<NEW_LINE>throw new FillMandatoryException(I_AD_WF_Node.COLUMNNAME_AD_Process_ID);<NEW_LINE>}<NEW_LINE>} else if (action == WFNodeAction.AppsTask) {<NEW_LINE>if (wfNodeRecord.getAD_Task_ID() <= 0) {<NEW_LINE>throw new FillMandatoryException("AD_Task_ID");<NEW_LINE>}<NEW_LINE>} else if (action == WFNodeAction.DocumentAction) {<NEW_LINE>if (wfNodeRecord.getDocAction() == null || wfNodeRecord.getDocAction().length() == 0) {<NEW_LINE>throw new FillMandatoryException("DocAction");<NEW_LINE>}<NEW_LINE>} else if (action == WFNodeAction.EMail) {<NEW_LINE>if (wfNodeRecord.getR_MailText_ID() <= 0) {<NEW_LINE>throw new FillMandatoryException("R_MailText_ID");<NEW_LINE>}<NEW_LINE>} else if (action == WFNodeAction.SetVariable) {<NEW_LINE>if (wfNodeRecord.getAttributeValue() == null) {<NEW_LINE>throw new FillMandatoryException("AttributeValue");<NEW_LINE>}<NEW_LINE>} else if (action == WFNodeAction.SubWorkflow) {<NEW_LINE>if (wfNodeRecord.getAD_Workflow_ID() <= 0) {<NEW_LINE>throw new FillMandatoryException("AD_Workflow_ID");<NEW_LINE>}<NEW_LINE>} else if (action == WFNodeAction.UserChoice) {<NEW_LINE>if (wfNodeRecord.getAD_Column_ID() <= 0) {<NEW_LINE>throw new FillMandatoryException("AD_Column_ID");<NEW_LINE>}<NEW_LINE>} else if (action == WFNodeAction.UserForm) {<NEW_LINE>if (wfNodeRecord.getAD_Form_ID() <= 0) {<NEW_LINE>throw new FillMandatoryException("AD_Form_ID");<NEW_LINE>}<NEW_LINE>} else if (action == WFNodeAction.UserWindow) {<NEW_LINE>if (wfNodeRecord.getAD_Window_ID() <= 0) {<NEW_LINE>throw new FillMandatoryException("AD_Window_ID");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ofCode(wfNodeRecord.getAction()); |
1,050,484 | private void backup(String toolName, List<CheckerDetailEntity> fromCheckerList, String buildId) {<NEW_LINE>if (CollectionUtils.isEmpty(fromCheckerList)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<CheckerDetailHisEntity> hisCheckerHisEntities = checkerHisRepository.findByToolName(toolName);<NEW_LINE>if (CollectionUtils.isNotEmpty(hisCheckerHisEntities)) {<NEW_LINE>if (hisCheckerHisEntities.get(0).getBuildId().equals(buildId)) {<NEW_LINE>log.info("is the same back up build id, do nothing: {}", toolName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.info("start to back up checker in from checker key set: {}, {}", toolName, buildId);<NEW_LINE>List<CheckerDetailHisEntity> bakCheckerList = fromCheckerList.stream().map(it -> {<NEW_LINE>CheckerDetailHisEntity checkerDetailHisEntity = new CheckerDetailHisEntity();<NEW_LINE>BeanUtils.copyProperties(it, checkerDetailHisEntity);<NEW_LINE>checkerDetailHisEntity.setBuildId(buildId);<NEW_LINE>return checkerDetailHisEntity;<NEW_LINE>}).<MASK><NEW_LINE>checkerHisRepository.deleteByToolName(toolName);<NEW_LINE>checkerHisRepository.save(bakCheckerList);<NEW_LINE>} | collect(Collectors.toList()); |
979,321 | public final CollectionOptionsContext collectionOptions() throws RecognitionException {<NEW_LINE>CollectionOptionsContext _localctx = new <MASK><NEW_LINE>enterRule(_localctx, 544, RULE_collectionOptions);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(5637);<NEW_LINE>match(LR_BRACKET);<NEW_LINE>setState(5638);<NEW_LINE>match(STRING_LITERAL);<NEW_LINE>setState(5643);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>while (_la == COMMA) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(5639);<NEW_LINE>match(COMMA);<NEW_LINE>setState(5640);<NEW_LINE>match(STRING_LITERAL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(5645);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>}<NEW_LINE>setState(5646);<NEW_LINE>match(RR_BRACKET);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | CollectionOptionsContext(_ctx, getState()); |
1,361,111 | public static HotSwapClassInfo create(ObjectKlass klass, Symbol<Name> name, byte[] bytes, StaticObject definingLoader, EspressoContext context) {<NEW_LINE>Symbol<Type> type = context.getTypes().fromName(name);<NEW_LINE>ParserKlass parserKlass = ClassfileParser.parse(new ClassfileStream(bytes, null<MASK><NEW_LINE>StringBuilder hierarchy = new StringBuilder();<NEW_LINE>StringBuilder methods = new StringBuilder();<NEW_LINE>StringBuilder fields = new StringBuilder();<NEW_LINE>StringBuilder enclosing = new StringBuilder();<NEW_LINE>Matcher matcher = InnerClassRedefiner.ANON_INNER_CLASS_PATTERN.matcher(name.toString());<NEW_LINE>if (matcher.matches()) {<NEW_LINE>// fingerprints are only relevant for inner classes<NEW_LINE>hierarchy.append(parserKlass.getSuperKlass().toString()).append(";");<NEW_LINE>for (Symbol<Type> itf : parserKlass.getSuperInterfaces()) {<NEW_LINE>hierarchy.append(itf.toString()).append(";");<NEW_LINE>}<NEW_LINE>for (ParserMethod method : parserKlass.getMethods()) {<NEW_LINE>methods.append(method.getName().toString()).append(";");<NEW_LINE>methods.append(method.getSignature().toString()).append(";");<NEW_LINE>}<NEW_LINE>for (ParserField field : parserKlass.getFields()) {<NEW_LINE>fields.append(field.getType().toString()).append(";");<NEW_LINE>fields.append(field.getName().toString()).append(";");<NEW_LINE>}<NEW_LINE>ConstantPool pool = parserKlass.getConstantPool();<NEW_LINE>EnclosingMethodAttribute attr = (EnclosingMethodAttribute) parserKlass.getAttribute(EnclosingMethodAttribute.NAME);<NEW_LINE>NameAndTypeConstant nmt = pool.nameAndTypeAt(attr.getMethodIndex());<NEW_LINE>enclosing.append(nmt.getName(pool)).append(";").append(nmt.getDescriptor(pool));<NEW_LINE>}<NEW_LINE>return new HotSwapClassInfo(klass, name, definingLoader, hierarchy.toString(), methods.toString(), fields.toString(), enclosing.toString(), new ArrayList<>(1), bytes);<NEW_LINE>} | ), definingLoader, type, context); |
551,385 | public void scan() {<NEW_LINE>if (myLocalFileSystemRefreshWorker != null) {<NEW_LINE>myLocalFileSystemRefreshWorker.scan();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>NewVirtualFileSystem fs = root.getFileSystem();<NEW_LINE>if (root.isDirectory()) {<NEW_LINE>fs = PersistentFS.replaceWithNativeFS(fs);<NEW_LINE>}<NEW_LINE>PersistentFS persistence = PersistentFS.getInstance();<NEW_LINE>FileAttributes attributes = fs.getAttributes(root);<NEW_LINE>if (attributes == null) {<NEW_LINE>myHelper.scheduleDeletion(root);<NEW_LINE>root.markClean();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fs instanceof LocalFileSystemBase) {<NEW_LINE>DirectoryAccessChecker.refresh();<NEW_LINE>}<NEW_LINE>checkAndScheduleChildRefresh(fs, persistence, root.getParent(), root, attributes);<NEW_LINE>if (root.isDirty()) {<NEW_LINE>if (myRefreshQueue.isEmpty()) {<NEW_LINE>queueDirectory(root);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>processQueue(fs, persistence);<NEW_LINE>} catch (RefreshCancelledException e) {<NEW_LINE>LOG.trace("refresh cancelled");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | NewVirtualFile root = myRefreshQueue.pullFirst(); |
1,727,583 | public void onMatch(RelOptRuleCall call) {<NEW_LINE>final Aggregate aggregate = call.rel(0);<NEW_LINE>final Project project = call.rel(1);<NEW_LINE>final RexBuilder rexBuilder = aggregate.getCluster().getRexBuilder();<NEW_LINE>final List<AggregateCall> newCalls = new ArrayList<>(aggregate.getAggCallList().size());<NEW_LINE>final List<RexNode> newProjects = new ArrayList<>(project.getProjects());<NEW_LINE>final List<RexNode> newCasts = new ArrayList<>();<NEW_LINE>for (int fieldNumber : aggregate.getGroupSet()) {<NEW_LINE>newCasts.add(rexBuilder.makeInputRef(project.getProjects().get(fieldNumber).getType(), fieldNumber));<NEW_LINE>}<NEW_LINE>for (AggregateCall aggregateCall : aggregate.getAggCallList()) {<NEW_LINE>AggregateCall newCall = transform(aggregateCall, project, newProjects);<NEW_LINE>// Possibly CAST the new aggregator to an appropriate type.<NEW_LINE>final int i = newCasts.size();<NEW_LINE>final RelDataType oldType = aggregate.getRowType().getFieldList().<MASK><NEW_LINE>if (newCall == null) {<NEW_LINE>newCalls.add(aggregateCall);<NEW_LINE>newCasts.add(rexBuilder.makeInputRef(oldType, i));<NEW_LINE>} else {<NEW_LINE>newCalls.add(newCall);<NEW_LINE>newCasts.add(rexBuilder.makeCast(oldType, rexBuilder.makeInputRef(newCall.getType(), i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newCalls.equals(aggregate.getAggCallList())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RelBuilder relBuilder = call.builder().push(project.getInput()).project(newProjects);<NEW_LINE>final RelBuilder.GroupKey groupKey = relBuilder.groupKey(aggregate.getGroupSet(), aggregate.getGroupSets());<NEW_LINE>relBuilder.aggregate(groupKey, newCalls).convert(aggregate.getRowType(), false);<NEW_LINE>call.transformTo(relBuilder.build());<NEW_LINE>call.getPlanner().setImportance(aggregate, 0.0);<NEW_LINE>} | get(i).getType(); |
823,818 | private static Serializer resolveSerializerInstance(Kryo k, Class superClass, Class<? extends Serializer> serializerClass) {<NEW_LINE>Constructor<? extends Serializer> ctor;<NEW_LINE>try {<NEW_LINE>ctor = serializerClass.getConstructor(Kryo.class, Class.class);<NEW_LINE>return <MASK><NEW_LINE>} catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException ex) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ctor = serializerClass.getConstructor(Kryo.class);<NEW_LINE>return ctor.newInstance(k);<NEW_LINE>} catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException ex) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ctor = serializerClass.getConstructor(Class.class);<NEW_LINE>return ctor.newInstance(k);<NEW_LINE>} catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException ex) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return serializerClass.getDeclaredConstructor().newInstance();<NEW_LINE>} catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ex) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(String.format("Unable to create serializer \"%s\" for class: %s", serializerClass.getName(), superClass.getName()));<NEW_LINE>} | ctor.newInstance(k, superClass); |
1,535,385 | private void elaborateInputAttributes(XhtmlSaxEmitter xhtmlSaxEmitter, Name elt, Name badAttribute) throws SAXException {<NEW_LINE>attributesImpl.clear();<NEW_LINE>attributesImpl.addAttribute("class", "inputattrs");<NEW_LINE>xhtmlSaxEmitter.startElement("dl", attributesImpl);<NEW_LINE>emitElementSpecificAttributesDt(xhtmlSaxEmitter, elt);<NEW_LINE>xhtmlSaxEmitter.startElement("dd");<NEW_LINE>attributesImpl.clear();<NEW_LINE>addHyperlink(xhtmlSaxEmitter, "Global attributes", SPEC_LINK_URI + "#global-attributes");<NEW_LINE>attributesImpl.addAttribute("class", "inputattrtypes");<NEW_LINE>xhtmlSaxEmitter.startElement("span", attributesImpl);<NEW_LINE>xhtmlSaxEmitter.endElement("span");<NEW_LINE>xhtmlSaxEmitter.endElement("dd");<NEW_LINE>for (Map.Entry<String, String[]> entry : validInputTypesByAttributeName.entrySet()) {<NEW_LINE>String attributeName = entry.getKey();<NEW_LINE>xhtmlSaxEmitter.startElement("dd");<NEW_LINE>attributesImpl.clear();<NEW_LINE>attributesImpl.addAttribute("class", "inputattrname");<NEW_LINE>xhtmlSaxEmitter.startElement("code", attributesImpl);<NEW_LINE>attributesImpl.clear();<NEW_LINE>attributesImpl.addAttribute("href", SPEC_LINK_URI + entry<MASK><NEW_LINE>xhtmlSaxEmitter.startElement("a", attributesImpl);<NEW_LINE>addText(xhtmlSaxEmitter, attributeName);<NEW_LINE>xhtmlSaxEmitter.endElement("a");<NEW_LINE>xhtmlSaxEmitter.endElement("code");<NEW_LINE>attributesImpl.addAttribute("class", "inputattrtypes");<NEW_LINE>if (badAttribute != null && attributeName.equals(badAttribute.getLocalName())) {<NEW_LINE>listInputTypesForAttribute(xhtmlSaxEmitter, attributeName, true);<NEW_LINE>} else {<NEW_LINE>listInputTypesForAttribute(xhtmlSaxEmitter, attributeName, false);<NEW_LINE>}<NEW_LINE>xhtmlSaxEmitter.endElement("dd");<NEW_LINE>}<NEW_LINE>xhtmlSaxEmitter.endElement("dl");<NEW_LINE>} | .getValue()[0]); |
484,981 | protected Answer execute(final CreateIpAliasCommand cmd) {<NEW_LINE>if (s_logger.isInfoEnabled()) {<NEW_LINE>s_logger.info("Executing createIpAlias command: " + s_gson.toJson(cmd));<NEW_LINE>}<NEW_LINE>cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP);<NEW_LINE>final List<IpAliasTO> ipAliasTOs = cmd.getIpAliasList();<NEW_LINE>final StringBuilder args = new StringBuilder();<NEW_LINE>for (final IpAliasTO ipaliasto : ipAliasTOs) {<NEW_LINE>args.append(ipaliasto.getAlias_count());<NEW_LINE>args.append(":");<NEW_LINE>args.append(ipaliasto.getRouterip());<NEW_LINE>args.append(":");<NEW_LINE>args.append(ipaliasto.getNetmask());<NEW_LINE>args.append("-");<NEW_LINE>}<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /root/createIpAlias " + args);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final String controlIp = getRouterSshControlIp(cmd);<NEW_LINE>final Pair<Boolean, String> result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", getSystemVMKeyFile(), null, "/root/createIpAlias.sh " + args);<NEW_LINE>if (!result.first()) {<NEW_LINE>s_logger.error("CreateIpAlias command on domr " + controlIp + <MASK><NEW_LINE>return new Answer(cmd, false, "createipAlias failed due to " + result.second());<NEW_LINE>}<NEW_LINE>if (s_logger.isInfoEnabled()) {<NEW_LINE>s_logger.info("createIpAlias command on domain router " + controlIp + " completed");<NEW_LINE>}<NEW_LINE>} catch (final Throwable e) {<NEW_LINE>final String msg = "createIpAlias failed due to " + e;<NEW_LINE>s_logger.error(msg, e);<NEW_LINE>return new Answer(cmd, false, msg);<NEW_LINE>}<NEW_LINE>return new Answer(cmd);<NEW_LINE>} | " failed, message: " + result.second()); |
1,418,263 | private void init() {<NEW_LINE>inflate(getContext(), R.layout.title_bar_layout, this);<NEW_LINE>mTitleLayout = findViewById(R.id.page_title_layout);<NEW_LINE>mLeftGroup = findViewById(R.id.page_title_left_group);<NEW_LINE>mRightGroup = findViewById(R.id.page_title_right_group);<NEW_LINE>mLeftTitle = findViewById(R.id.page_title_left_text);<NEW_LINE>mRightTitle = findViewById(R.id.page_title_right_text);<NEW_LINE>mCenterTitle = <MASK><NEW_LINE>mLeftIcon = findViewById(R.id.page_title_left_icon);<NEW_LINE>mRightIcon = findViewById(R.id.page_title_right_icon);<NEW_LINE>unreadCountTextView = findViewById(R.id.new_message_total_unread);<NEW_LINE>LayoutParams params = (LayoutParams) mTitleLayout.getLayoutParams();<NEW_LINE>params.height = ScreenUtil.getPxByDp(50);<NEW_LINE>mTitleLayout.setLayoutParams(params);<NEW_LINE>setBackgroundResource(TUIThemeManager.getAttrResId(getContext(), R.attr.core_title_bar_bg));<NEW_LINE>int iconSize = ScreenUtil.dip2px(20);<NEW_LINE>ViewGroup.LayoutParams iconParams = mLeftIcon.getLayoutParams();<NEW_LINE>iconParams.width = iconSize;<NEW_LINE>iconParams.height = iconSize;<NEW_LINE>mLeftIcon.setLayoutParams(iconParams);<NEW_LINE>iconParams = mRightIcon.getLayoutParams();<NEW_LINE>iconParams.width = iconSize;<NEW_LINE>iconParams.height = iconSize;<NEW_LINE>mRightIcon.setLayoutParams(iconParams);<NEW_LINE>} | findViewById(R.id.page_title); |
1,651,439 | public void unsetup() {<NEW_LINE>if (model.getTimeFormat().equals(TimeFormat.DATE) || model.getTimeFormat().equals(TimeFormat.DATETIME)) {<NEW_LINE>double min = AttributeUtils.parseDateTime(minTextField.getText());<NEW_LINE>double max = AttributeUtils.<MASK><NEW_LINE>double start = AttributeUtils.parseDateTime(startTextField.getText());<NEW_LINE>double end = AttributeUtils.parseDateTime(endTextField.getText());<NEW_LINE>start = Math.max(min, start);<NEW_LINE>end = Math.min(max, end);<NEW_LINE>controller.setCustomBounds(min, max);<NEW_LINE>controller.setInterval(start, end);<NEW_LINE>} else {<NEW_LINE>double min = Double.parseDouble(minTextField.getText());<NEW_LINE>double max = Double.parseDouble(maxTextField.getText());<NEW_LINE>double start = Double.parseDouble(startTextField.getText());<NEW_LINE>double end = Double.parseDouble(endTextField.getText());<NEW_LINE>start = Math.max(min, start);<NEW_LINE>end = Math.min(max, end);<NEW_LINE>controller.setCustomBounds(min, max);<NEW_LINE>controller.setInterval(start, end);<NEW_LINE>}<NEW_LINE>} | parseDateTime(maxTextField.getText()); |
382,806 | public CreateLicenseManagerReportGeneratorResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateLicenseManagerReportGeneratorResult createLicenseManagerReportGeneratorResult = new CreateLicenseManagerReportGeneratorResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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 createLicenseManagerReportGeneratorResult;<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("LicenseManagerReportGeneratorArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createLicenseManagerReportGeneratorResult.setLicenseManagerReportGeneratorArn(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 createLicenseManagerReportGeneratorResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,162,571 | public static DescribeVulMachineListResponse unmarshall(DescribeVulMachineListResponse describeVulMachineListResponse, UnmarshallerContext context) {<NEW_LINE>describeVulMachineListResponse.setRequestId(context.stringValue("DescribeVulMachineListResponse.RequestId"));<NEW_LINE>describeVulMachineListResponse.setTotalCount(context.integerValue("DescribeVulMachineListResponse.TotalCount"));<NEW_LINE>List<MachineStatistic> machineStatistics = new ArrayList<MachineStatistic>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeVulMachineListResponse.MachineStatistics.Length"); i++) {<NEW_LINE>MachineStatistic machineStatistic = new MachineStatistic();<NEW_LINE>machineStatistic.setUuid(context.stringValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].Uuid"));<NEW_LINE>machineStatistic.setCveNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].CveNum"));<NEW_LINE>machineStatistic.setEmgNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].EmgNum"));<NEW_LINE>machineStatistic.setSysNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].SysNum"));<NEW_LINE>machineStatistic.setCmsNum(context.integerValue<MASK><NEW_LINE>machineStatistic.setCmsDealedTotalNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].CmsDealedTotalNum"));<NEW_LINE>machineStatistic.setVulDealedTotalNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulDealedTotalNum"));<NEW_LINE>machineStatistic.setVulAsapSum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulAsapSum"));<NEW_LINE>machineStatistic.setVulLaterSum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulLaterSum"));<NEW_LINE>machineStatistic.setVulNntfSum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulNntfSum"));<NEW_LINE>machineStatistic.setVulSeriousTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulSeriousTotal"));<NEW_LINE>machineStatistic.setVulHighTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulHighTotal"));<NEW_LINE>machineStatistic.setVulMediumTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulMediumTotal"));<NEW_LINE>machineStatistic.setVulLowTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulLowTotal"));<NEW_LINE>machineStatistics.add(machineStatistic);<NEW_LINE>}<NEW_LINE>describeVulMachineListResponse.setMachineStatistics(machineStatistics);<NEW_LINE>return describeVulMachineListResponse;<NEW_LINE>} | ("DescribeVulMachineListResponse.MachineStatistics[" + i + "].CmsNum")); |
1,334,498 | public static DescribeRegionsResponse unmarshall(DescribeRegionsResponse describeRegionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeRegionsResponse.setRequestId(_ctx.stringValue("DescribeRegionsResponse.RequestId"));<NEW_LINE>describeRegionsResponse.setErrorCode(_ctx.integerValue("DescribeRegionsResponse.ErrorCode"));<NEW_LINE>describeRegionsResponse.setSuccess(_ctx.booleanValue("DescribeRegionsResponse.Success"));<NEW_LINE>List<Result> regions = new ArrayList<Result>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRegionsResponse.Regions.Length"); i++) {<NEW_LINE>Result result = new Result();<NEW_LINE>result.setLocalName(_ctx.stringValue("DescribeRegionsResponse.Regions[" + i + "].LocalName"));<NEW_LINE>result.setRegionEndpoint(_ctx.stringValue("DescribeRegionsResponse.Regions[" + i + "].RegionEndpoint"));<NEW_LINE>result.setRegionId(_ctx.stringValue<MASK><NEW_LINE>regions.add(result);<NEW_LINE>}<NEW_LINE>describeRegionsResponse.setRegions(regions);<NEW_LINE>return describeRegionsResponse;<NEW_LINE>} | ("DescribeRegionsResponse.Regions[" + i + "].RegionId")); |
1,343,929 | public static void response(ShardingService shardingService) {<NEW_LINE>HEADER.setPacketId(shardingService.nextPacketId());<NEW_LINE>FIELDS[0] = PacketUtil.getField("DATABASE()", Fields.FIELD_TYPE_VAR_STRING);<NEW_LINE>FIELDS[0].<MASK><NEW_LINE>EOF.setPacketId(shardingService.nextPacketId());<NEW_LINE>ByteBuffer buffer = shardingService.allocate();<NEW_LINE>buffer = HEADER.write(buffer, shardingService, true);<NEW_LINE>for (FieldPacket field : FIELDS) {<NEW_LINE>buffer = field.write(buffer, shardingService, true);<NEW_LINE>}<NEW_LINE>buffer = EOF.write(buffer, shardingService, true);<NEW_LINE>RowDataPacket row = new RowDataPacket(FIELD_COUNT);<NEW_LINE>row.add(StringUtil.encode(shardingService.getSchema(), shardingService.getCharset().getResults()));<NEW_LINE>row.setPacketId(shardingService.nextPacketId());<NEW_LINE>buffer = row.write(buffer, shardingService, true);<NEW_LINE>EOFRowPacket lastEof = new EOFRowPacket();<NEW_LINE>lastEof.setPacketId(shardingService.nextPacketId());<NEW_LINE>lastEof.write(buffer, shardingService);<NEW_LINE>} | setPacketId(shardingService.nextPacketId()); |
1,329,716 | public static void log(XHook hook, int priority, String msg) {<NEW_LINE>// Check if logging enabled<NEW_LINE>int uid = Process.myUid();<NEW_LINE>if (!mLogDetermined && uid > 0) {<NEW_LINE>mLogDetermined = true;<NEW_LINE>try {<NEW_LINE>mLog = PrivacyManager.getSettingBool(0, PrivacyManager.cSettingLog, false);<NEW_LINE>} catch (Throwable ignored) {<NEW_LINE>mLog = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Log if enabled<NEW_LINE>if (priority != Log.DEBUG && (priority == Log.INFO ? mLog : true))<NEW_LINE>if (hook == null)<NEW_LINE>Log.<MASK><NEW_LINE>else<NEW_LINE>Log.println(priority, String.format("XPrivacy/%s", hook.getClass().getSimpleName()), msg);<NEW_LINE>// Report to service<NEW_LINE>if (uid > 0 && priority == Log.ERROR)<NEW_LINE>if (PrivacyService.isRegistered())<NEW_LINE>PrivacyService.reportErrorInternal(msg);<NEW_LINE>else<NEW_LINE>try {<NEW_LINE>IPrivacyService client = PrivacyService.getClient();<NEW_LINE>if (client != null)<NEW_LINE>client.reportError(msg);<NEW_LINE>} catch (RemoteException ignored) {<NEW_LINE>}<NEW_LINE>} | println(priority, "XPrivacy", msg); |
655,814 | protected void handleGet(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException {<NEW_LINE>if (hasParam(req, "project")) {<NEW_LINE>if (hasParam(req, "ajax")) {<NEW_LINE>handleAJAXAction(req, resp, session);<NEW_LINE>} else if (hasParam(req, "logs")) {<NEW_LINE>handleProjectLogsPage(req, resp, session);<NEW_LINE>} else if (hasParam(req, "permissions")) {<NEW_LINE>handlePermissionPage(req, resp, session);<NEW_LINE>} else if (hasParam(req, "prop")) {<NEW_LINE>handlePropertyPage(req, resp, session);<NEW_LINE>} else if (hasParam(req, "history")) {<NEW_LINE>handleJobHistoryPage(req, resp, session);<NEW_LINE>} else if (hasParam(req, "job")) {<NEW_LINE>handleJobPage(req, resp, session);<NEW_LINE>} else if (hasParam(req, "flow")) {<NEW_LINE>handleFlowPage(req, resp, session);<NEW_LINE>} else if (hasParam(req, "delete")) {<NEW_LINE>handleRemoveProject(req, resp, session);<NEW_LINE>} else if (hasParam(req, "purge")) {<NEW_LINE>handlePurgeProject(req, resp, session);<NEW_LINE>} else if (hasParam(req, "download")) {<NEW_LINE>handleDownloadProject(req, resp, session);<NEW_LINE>} else {<NEW_LINE>handleProjectPage(req, resp, session);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} else if (hasParam(req, "reloadProjectWhitelist")) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Page page = newPage(req, resp, session, "azkaban/webapp/servlet/velocity/projectpage.vm");<NEW_LINE>page.add("errorMsg", "No project set.");<NEW_LINE>page.render();<NEW_LINE>} | handleReloadProjectWhitelist(req, resp, session); |
822,701 | private void interpolate(long lo, long hi, Record mapRecord, long x1, long x2, MapValue x1Value, MapValue x2value) {<NEW_LINE>computeYPoints(x1Value, x2value);<NEW_LINE>for (long x = lo; x < hi; x = sampler.nextTimestamp(x)) {<NEW_LINE>final MapValue result = findDataMapValue3(mapRecord, x);<NEW_LINE>assert result != null && result.getByte(0) == 1;<NEW_LINE>for (int i = 0; i < groupByTwoPointFunctionCount; i++) {<NEW_LINE>GroupByFunction <MASK><NEW_LINE>InterpolationUtil.interpolateGap(function, result, sampler.getBucketSize(), x1Value, x2value);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < groupByScalarFunctionCount; i++) {<NEW_LINE>GroupByFunction function = groupByScalarFunctions.getQuick(i);<NEW_LINE>interpolatorFunctions.getQuick(i).interpolateAndStore(function, result, x, x1, x2, yData + i * 16L, yData + i * 16L + 8);<NEW_LINE>}<NEW_LINE>// fill the value, change flag from 'gap' to 'fill'<NEW_LINE>result.putByte(0, (byte) 0);<NEW_LINE>}<NEW_LINE>} | function = groupByTwoPointFunctions.getQuick(i); |
1,121,292 | public void execute(final JobExecutionContext jobCtx) throws JobExecutionException {<NEW_LINE>Connection conn = null;<NEW_LINE>Session sess = null;<NEW_LINE>MessageProducer producer = null;<NEW_LINE>try {<NEW_LINE>final JobDataMap dataMap = jobCtx.getMergedJobDataMap();<NEW_LINE>final Context namingCtx = JmsHelper.getInitialContext(dataMap);<NEW_LINE>final ConnectionFactory connFactory = (ConnectionFactory) namingCtx.lookup(dataMap.getString(JmsHelper.JMS_CONNECTION_FACTORY_JNDI));<NEW_LINE>if (!JmsHelper.isDestinationSecure(dataMap)) {<NEW_LINE>conn = connFactory.createConnection();<NEW_LINE>} else {<NEW_LINE>final String user = <MASK><NEW_LINE>final String password = dataMap.getString(JmsHelper.JMS_PASSWORD);<NEW_LINE>conn = connFactory.createConnection(user, password);<NEW_LINE>}<NEW_LINE>final boolean useTransaction = JmsHelper.useTransaction(dataMap);<NEW_LINE>final int ackMode = dataMap.getInt(JmsHelper.JMS_ACK_MODE);<NEW_LINE>sess = conn.createSession(useTransaction, ackMode);<NEW_LINE>final Destination destination = (Destination) namingCtx.lookup(dataMap.getString(JmsHelper.JMS_DESTINATION_JNDI));<NEW_LINE>producer = sess.createProducer(destination);<NEW_LINE>final JmsMessageFactory messageFactory = JmsHelper.getMessageFactory(dataMap.getString(JmsHelper.JMS_MSG_FACTORY_CLASS_NAME));<NEW_LINE>final Message msg = messageFactory.createMessage(dataMap, sess);<NEW_LINE>producer.send(msg);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new JobExecutionException(e);<NEW_LINE>} finally {<NEW_LINE>JmsHelper.closeResource(producer);<NEW_LINE>JmsHelper.closeResource(sess);<NEW_LINE>JmsHelper.closeResource(conn);<NEW_LINE>}<NEW_LINE>} | dataMap.getString(JmsHelper.JMS_USER); |
1,785,441 | public void actionPerformed(@Nonnull final AnActionEvent e) {<NEW_LINE>final Project project = e.getData(CommonDataKeys.PROJECT);<NEW_LINE>final Change[] changes = e.getData(VcsDataKeys.CHANGES);<NEW_LINE>if (project == null || !canShowDiff(project, changes))<NEW_LINE>return;<NEW_LINE>if (ChangeListManager.getInstance(project).isFreezedWithNotification(null))<NEW_LINE>return;<NEW_LINE>final boolean needsConversion = checkIfThereAreFakeRevisions(project, changes);<NEW_LINE>final List<Change> changesInList = e.getData(VcsDataKeys.CHANGES_IN_LIST_KEY);<NEW_LINE>// this trick is essential since we are under some conditions to refresh changes;<NEW_LINE>// but we can only rely on callback after refresh<NEW_LINE>final Runnable performer = new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>Change[] convertedChanges;<NEW_LINE>if (needsConversion) {<NEW_LINE>convertedChanges = loadFakeRevisions(project, changes);<NEW_LINE>} else {<NEW_LINE>convertedChanges = changes;<NEW_LINE>}<NEW_LINE>if (convertedChanges == null || convertedChanges.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Change selectedChane = null;<NEW_LINE>List<Change> result = null;<NEW_LINE>if (convertedChanges.length == 1) {<NEW_LINE>selectedChane = convertedChanges[0];<NEW_LINE>ChangeList changeList = ((ChangeListManagerImpl) ChangeListManager.getInstance(project)).getIdentityChangeList(selectedChane);<NEW_LINE>if (changeList != null) {<NEW_LINE>result = changesInList != null ? changesInList : new ArrayList<>(changeList.getChanges());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result == null)<NEW_LINE>result = ContainerUtil.newArrayList(convertedChanges);<NEW_LINE>// ContainerUtil.sort(result, ChangesComparator.getInstance(false));<NEW_LINE>int index = selectedChane == null ? 0 : Math.max(0, ContainerUtil.indexOfIdentity(result, selectedChane));<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (needsConversion) {<NEW_LINE>ChangeListManager.getInstance(project).invokeAfterUpdate(performer, InvokeAfterUpdateMode.BACKGROUND_CANCELLABLE, ActionsBundle.actionText("ChangesView.Diff"), ModalityState.current());<NEW_LINE>} else {<NEW_LINE>performer.run();<NEW_LINE>}<NEW_LINE>} | showDiffForChange(project, result, index); |
1,159,664 | private AssemblyRegion makeAssemblyRegionFromVariantReads(final List<ReadsContext> readsContexts, final VariantContext vc) {<NEW_LINE>final Set<String> variantReadNames = readsContexts.stream().flatMap(Utils::stream).filter(read -> RealignmentEngine.supportsVariant(read, vc, indelStartTolerance)).map(GATKRead::getName).collect(Collectors.toSet());<NEW_LINE>final List<GATKRead> variantReads = readsContexts.stream().flatMap(Utils::stream).filter(read -> variantReadNames.contains(read.getName())).sorted(Comparator.comparingInt(GATKRead::getStart)).collect(Collectors.toList());<NEW_LINE>final int firstReadStart = variantReads.stream().mapToInt(GATKRead::getStart).min().orElse(vc.getStart());<NEW_LINE>final int lastReadEnd = variantReads.stream().mapToInt(GATKRead::getEnd).max().orElse(vc.getEnd());<NEW_LINE>final SimpleInterval assemblyWindow = new SimpleInterval(vc.getContig(), Math.max(firstReadStart - ASSEMBLY_PADDING, 1), lastReadEnd + ASSEMBLY_PADDING);<NEW_LINE>final AssemblyRegion assemblyRegion = new <MASK><NEW_LINE>assemblyRegion.addAll(variantReads);<NEW_LINE>return assemblyRegion;<NEW_LINE>} | AssemblyRegion(assemblyWindow, 0, bamHeader); |
1,326,482 | public BytesRef encodeEdgeKey(GraphVertex srcType, Map<Integer, PropertyValue> srcPkMap, GraphVertex dstType, Map<Integer, PropertyValue> dstPkMap, GraphEdge type, Map<Integer, PropertyValue> propertiesMap, long tableId, boolean outEdge) {<NEW_LINE>scratch.clear();<NEW_LINE>List<Integer> srcPkIds = labelPkIds.computeIfAbsent(srcType, k -> SchemaUtils.getVertexPrimaryKeyList(srcType));<NEW_LINE>long srcId = getHashId(srcType.getLabelId(), srcPkMap, srcPkIds);<NEW_LINE>List<Integer> dstPkIds = labelPkIds.computeIfAbsent(dstType, k -> SchemaUtils.getVertexPrimaryKeyList(dstType));<NEW_LINE>long dstId = getHashId(dstType.<MASK><NEW_LINE>List<Integer> edgePkIds = labelPkIds.computeIfAbsent(type, k -> SchemaUtils.getEdgePrimaryKeyList(type));<NEW_LINE>long eid;<NEW_LINE>if (edgePkIds != null && edgePkIds.size() > 0) {<NEW_LINE>eid = getHashId(type.getLabelId(), propertiesMap, edgePkIds);<NEW_LINE>} else {<NEW_LINE>eid = System.nanoTime();<NEW_LINE>}<NEW_LINE>if (outEdge) {<NEW_LINE>scratch.putLong(tableId << 1);<NEW_LINE>scratch.putLong(srcId);<NEW_LINE>scratch.putLong(dstId);<NEW_LINE>} else {<NEW_LINE>scratch.putLong(tableId << 1 | 1);<NEW_LINE>scratch.putLong(dstId);<NEW_LINE>scratch.putLong(srcId);<NEW_LINE>}<NEW_LINE>scratch.putLong(eid);<NEW_LINE>scratch.putLong(SNAPSHOT_ID);<NEW_LINE>scratch.flip();<NEW_LINE>return new BytesRef(scratch.array(), 0, scratch.limit());<NEW_LINE>} | getLabelId(), dstPkMap, dstPkIds); |
903,890 | protected void fillMapFromExecutable(final Map<String, Object> objMap) {<NEW_LINE>objMap.put(ID_PARAM, this.id);<NEW_LINE>objMap.put(STATUS_PARAM, this.status.toString());<NEW_LINE>objMap.put(START_TIME_PARAM, this.startTime);<NEW_LINE>objMap.put(END_TIME_PARAM, this.endTime);<NEW_LINE>objMap.put(UPDATE_TIME_PARAM, this.updateTime);<NEW_LINE>objMap.put(TYPE_PARAM, this.type);<NEW_LINE>objMap.put(CONDITION_PARAM, this.condition);<NEW_LINE>if (this.clusterInfo != null) {<NEW_LINE>objMap.put(CLUSTER_PARAM, ClusterInfo.toObject(this.clusterInfo));<NEW_LINE>}<NEW_LINE>if (this.conditionOnJobStatus != null) {<NEW_LINE>objMap.put(CONDITION_ON_JOB_STATUS_PARAM, this.conditionOnJobStatus.toString());<NEW_LINE>}<NEW_LINE>objMap.put(ATTEMPT_PARAM, this.attempt);<NEW_LINE>if (this.inNodes != null && !this.inNodes.isEmpty()) {<NEW_LINE>objMap.put(IN_NODES_PARAM, this.inNodes);<NEW_LINE>}<NEW_LINE>if (this.outNodes != null && !this.outNodes.isEmpty()) {<NEW_LINE>objMap.put(OUT_NODES_PARAM, this.outNodes);<NEW_LINE>}<NEW_LINE>if (hasPropsSource()) {<NEW_LINE>objMap.put(PROPS_SOURCE_PARAM, this.propsSource);<NEW_LINE>}<NEW_LINE>if (hasJobSource()) {<NEW_LINE>objMap.put(JOB_SOURCE_PARAM, this.jobSource);<NEW_LINE>}<NEW_LINE>if (this.outputProps != null && this.outputProps.size() > 0) {<NEW_LINE>objMap.put(OUTPUT_PROPS_PARAM, PropsUtils.toStringMap(this.outputProps, true));<NEW_LINE>}<NEW_LINE>if (this.pastAttempts != null) {<NEW_LINE>final List<Object> attemptsList = new ArrayList<>(<MASK><NEW_LINE>for (final ExecutionAttempt attempts : this.pastAttempts) {<NEW_LINE>attemptsList.add(attempts.toObject());<NEW_LINE>}<NEW_LINE>objMap.put(PAST_ATTEMPTS_PARAM, attemptsList);<NEW_LINE>}<NEW_LINE>} | this.pastAttempts.size()); |
1,577,917 | private void maybeVerifyTargetIsExecutable(ActionExecutionContext actionExecutionContext) throws ActionExecutionException {<NEW_LINE>if (targetType != TargetType.EXECUTABLE) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Path inputPath = actionExecutionContext.getInputPath(getPrimaryInput());<NEW_LINE>try {<NEW_LINE>// Validate that input path is a file with the executable bit set.<NEW_LINE>if (!inputPath.isFile()) {<NEW_LINE>String message = String.format("'%s' is not a file", getInputs().getSingleton().prettyPrint());<NEW_LINE>throw new ActionExecutionException(message, this, false, createDetailedExitCode(message, Code.EXECUTABLE_INPUT_NOT_FILE));<NEW_LINE>}<NEW_LINE>if (!inputPath.isExecutable()) {<NEW_LINE>String message = String.format("failed to create symbolic link '%s': file '%s' is not executable", Iterables.getOnlyElement(getOutputs()).prettyPrint(), getInputs().<MASK><NEW_LINE>throw new ActionExecutionException(message, this, false, createDetailedExitCode(message, Code.EXECUTABLE_INPUT_IS_NOT));<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>String message = String.format("failed to create symbolic link '%s' to the '%s' due to I/O error: %s", Iterables.getOnlyElement(getOutputs()).prettyPrint(), getInputs().getSingleton().prettyPrint(), e.getMessage());<NEW_LINE>DetailedExitCode detailedExitCode = createDetailedExitCode(message, Code.EXECUTABLE_INPUT_CHECK_IO_EXCEPTION);<NEW_LINE>throw new ActionExecutionException(message, e, this, false, detailedExitCode);<NEW_LINE>}<NEW_LINE>} | getSingleton().prettyPrint()); |
1,033,817 | public Location deleteLocation(int position) {<NEW_LINE>assert mTotalList != null;<NEW_LINE>List<Location> totalList = new ArrayList<>(mTotalList);<NEW_LINE>Location <MASK><NEW_LINE>if (location.getFormattedId().equals(mFormattedId)) {<NEW_LINE>setFormattedId(totalList.get(0).getFormattedId());<NEW_LINE>}<NEW_LINE>List<Location> validList = Location.excludeInvalidResidentLocation(getApplication(), totalList);<NEW_LINE>int validIndex = indexLocation(validList, mFormattedId);<NEW_LINE>setInnerData(totalList, validList, validIndex);<NEW_LINE>Location current = validList.get(validIndex);<NEW_LINE>Indicator indicator = new Indicator(validList.size(), validIndex);<NEW_LINE>boolean defaultLocation = validIndex == 0;<NEW_LINE>setLocationResourceWithVerification(current, defaultLocation, LocationResource.Event.UPDATE, indicator, location.getFormattedId(), new SelectableLocationListResource.DataSetChanged());<NEW_LINE>mRepository.deleteLocation(getApplication(), location);<NEW_LINE>return location;<NEW_LINE>} | location = totalList.remove(position); |
466,441 | // ----- private methods -----<NEW_LINE>private void init() {<NEW_LINE>factories.put(NotEmptyQuery.class, new NotEmptyQueryFactory(this));<NEW_LINE>factories.put(FulltextQuery.class, new KeywordQueryFactory(this));<NEW_LINE>factories.put(SpatialQuery.class, new SpatialQueryFactory(this));<NEW_LINE>factories.put(GroupQuery.class, new GroupQueryFactory(this));<NEW_LINE>factories.put(RangeQuery.class, new RangeQueryFactory(this));<NEW_LINE>factories.put(ExactQuery.class, new KeywordQueryFactory(this));<NEW_LINE>factories.put(ArrayQuery.class, new ArrayQueryFactory(this));<NEW_LINE>factories.put(EmptyQuery.class, new EmptyQueryFactory(this));<NEW_LINE>factories.put(TypeQuery.class, new TypeQueryFactory(this));<NEW_LINE>factories.put(UuidQuery.<MASK><NEW_LINE>factories.put(RelationshipQuery.class, new RelationshipQueryFactory(this));<NEW_LINE>factories.put(ComparisonQuery.class, new ComparisonQueryFactory(this));<NEW_LINE>converters.put(Boolean.class, new BooleanTypeConverter());<NEW_LINE>converters.put(String.class, new StringTypeConverter());<NEW_LINE>converters.put(Date.class, new DateTypeConverter());<NEW_LINE>converters.put(Long.class, new LongTypeConverter());<NEW_LINE>converters.put(Short.class, new ShortTypeConverter());<NEW_LINE>converters.put(Integer.class, new IntTypeConverter());<NEW_LINE>converters.put(Float.class, new FloatTypeConverter());<NEW_LINE>converters.put(Double.class, new DoubleTypeConverter());<NEW_LINE>converters.put(byte.class, new ByteTypeConverter());<NEW_LINE>} | class, new UuidQueryFactory(this)); |
812,173 | private void initList() {<NEW_LINE>// initList() may be called multiple times within one dialog showing,<NEW_LINE>// and some files may have been changed, so we need to update the list<NEW_LINE>files = checkForUnsavedFiles(files);<NEW_LINE>checkboxes = new GCheckBox[files.size()];<NEW_LINE>saveable = new boolean[files.size()];<NEW_LINE>String readOnlyString = " (Read-Only)";<NEW_LINE>yesButton.setEnabled(false);<NEW_LINE>for (int i = 0; i < files.size(); i++) {<NEW_LINE>checkboxes[i] = new GCheckBox(files.get(i).getName());<NEW_LINE>checkboxes[i].setBackground(Color.white);<NEW_LINE>saveable[i] = files.get(i).canSave();<NEW_LINE>if (!saveable[i]) {<NEW_LINE>String text = files.get(i).getName() + readOnlyString;<NEW_LINE>if (!files.get(i).isInWritableProject()) {<NEW_LINE>ProjectLocator projectLocator = files.get(i).getProjectLocator();<NEW_LINE>if (projectLocator != null) {<NEW_LINE>text = files.get(i).getName() + " (Read-Only from " + files.get(i).getProjectLocator().getName() + ")";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>checkboxes<MASK><NEW_LINE>} else {<NEW_LINE>checkboxes[i].setSelected(true);<NEW_LINE>yesButton.setEnabled(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>listPanel.refreshList(checkboxes);<NEW_LINE>// .requestFocusInWindow();<NEW_LINE>setFocusComponent(yesButton);<NEW_LINE>} | [i].setText(text); |
1,653,695 | public static ConvexHull2D.PointF[] calculateConvexHull(Raster alphaRaster, int hullTargetVertexCount, int dilateCount) {<NEW_LINE><MASK><NEW_LINE>int height = alphaRaster.getHeight();<NEW_LINE>int[] alpha = new int[width * height];<NEW_LINE>alpha = alphaRaster.getPixels(0, 0, width, height, alpha);<NEW_LINE>if (isEmpty(alpha, width, height))<NEW_LINE>return null;<NEW_LINE>if (dilateCount > 0) {<NEW_LINE>alpha = dilate(alpha, width, height, dilateCount * 2 + 1);<NEW_LINE>}<NEW_LINE>ConvexHull2D.PointF[] points = ConvexHull2D.imageConvexHullCorners(alpha, width, height, hullTargetVertexCount);<NEW_LINE>// Check the vertices, and if they're outside of the rectangle, fallback to the tight rect<NEW_LINE>if (!isHullValid(points)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return points;<NEW_LINE>} | int width = alphaRaster.getWidth(); |
1,712,427 | private static POInfoColumn retrievePOInfoColumn(@NonNull final ResultSet rs) throws SQLException {<NEW_LINE>final String m_TableName = rs.getString(I_AD_Table.COLUMNNAME_TableName);<NEW_LINE>final String ColumnName = rs.getString(2);<NEW_LINE>final int AD_Reference_ID = rs.getInt(3);<NEW_LINE>final boolean IsMandatory = StringUtils.toBoolean(rs.getString(4));<NEW_LINE>final boolean IsUpdateable = StringUtils.toBoolean(rs.getString(5));<NEW_LINE>final String DefaultLogic = rs.getString(6);<NEW_LINE>final String Name = rs.getString(7);<NEW_LINE>final String Description = rs.getString(8);<NEW_LINE>final int AD_Column_ID = rs.getInt(9);<NEW_LINE>final boolean isKeyColumn = StringUtils.toBoolean(rs.getString(10));<NEW_LINE>final boolean isParentColumn = StringUtils.toBoolean(rs.getString(11));<NEW_LINE>final int AD_Reference_Value_ID = rs.getInt(12);<NEW_LINE>// String ValidationCode = rs.getString(13);<NEW_LINE>final int FieldLength = rs.getInt(14);<NEW_LINE>final String ValueMin = rs.getString(15);<NEW_LINE>final String ValueMax = rs.getString(16);<NEW_LINE>final boolean IsTranslated = StringUtils.toBoolean(rs.getString(17));<NEW_LINE>//<NEW_LINE>final String ColumnSQL = rs.getString(19);<NEW_LINE>final boolean IsEncrypted = StringUtils.toBoolean(rs.getString(20));<NEW_LINE>final boolean IsAllowLogging = StringUtils.toBoolean(rs.getString(21));<NEW_LINE>// metas<NEW_LINE>final boolean IsLazyLoading = StringUtils.toBoolean<MASK><NEW_LINE>// metas<NEW_LINE>final boolean IsCalculated = StringUtils.toBoolean(rs.getString(24));<NEW_LINE>// metas<NEW_LINE>final int AD_Val_Rule_ID = rs.getInt(25);<NEW_LINE>// metas: 05133<NEW_LINE>final boolean isUseDocumentSequence = StringUtils.toBoolean(rs.getString(I_AD_Column.COLUMNNAME_IsUseDocSequence));<NEW_LINE>// metas: 01537<NEW_LINE>final boolean isStaleableColumn = StringUtils.toBoolean(rs.getString(I_AD_Column.COLUMNNAME_IsStaleable));<NEW_LINE>final boolean isSelectionColumn = StringUtils.toBoolean(rs.getString(I_AD_Column.COLUMNNAME_IsSelectionColumn));<NEW_LINE>final POInfoColumn col = new // ColumnLabel<NEW_LINE>POInfoColumn(// ColumnLabel<NEW_LINE>AD_Column_ID, // ColumnLabel<NEW_LINE>m_TableName, // ColumnLabel<NEW_LINE>ColumnName, // ColumnLabel<NEW_LINE>ColumnSQL, // ColumnLabel<NEW_LINE>AD_Reference_ID, // ColumnLabel<NEW_LINE>IsMandatory, // ColumnLabel<NEW_LINE>IsUpdateable, // ColumnLabel<NEW_LINE>DefaultLogic, // ColumnDescription<NEW_LINE>Name, Description, isKeyColumn, isParentColumn, AD_Reference_Value_ID, AD_Val_Rule_ID, FieldLength, ValueMin, ValueMax, IsTranslated, IsEncrypted, IsAllowLogging);<NEW_LINE>// metas<NEW_LINE>col.IsLazyLoading = IsLazyLoading;<NEW_LINE>// metas<NEW_LINE>col.IsCalculated = IsCalculated;<NEW_LINE>// metas: _05133<NEW_LINE>col.IsUseDocumentSequence = isUseDocumentSequence;<NEW_LINE>// metas: 01537<NEW_LINE>col.IsStaleable = isStaleableColumn;<NEW_LINE>col.IsSelectionColumn = isSelectionColumn;<NEW_LINE>return col;<NEW_LINE>} | (rs.getString(23)); |
263,607 | static void validateVector(Vector[] mvs, MPEG4DecodingContext ctx, int xPos, int yPos) {<NEW_LINE>int shift = 5 + (ctx.quarterPel ? 1 : 0);<NEW_LINE>int xHigh = (ctx.mbWidth - xPos) << shift;<NEW_LINE>int xLow = <MASK><NEW_LINE>int yHigh = (ctx.mbHeight - yPos) << shift;<NEW_LINE>int yLow = (-yPos - 1) << shift;<NEW_LINE>checkMV(mvs[0], xHigh, xLow, yHigh, yLow);<NEW_LINE>checkMV(mvs[1], xHigh, xLow, yHigh, yLow);<NEW_LINE>checkMV(mvs[2], xHigh, xLow, yHigh, yLow);<NEW_LINE>checkMV(mvs[3], xHigh, xLow, yHigh, yLow);<NEW_LINE>} | (-xPos - 1) << shift; |
1,565,900 | public int deserialize(final byte[] stream, int offset) {<NEW_LINE>this.size = OIntegerSerializer.INSTANCE.deserializeLiteral(stream, offset);<NEW_LINE>int entriesSize = OIntegerSerializer.<MASK><NEW_LINE>offset += OIntegerSerializer.INT_SIZE;<NEW_LINE>for (int i = 0; i < entriesSize; i++) {<NEW_LINE>ORID rid = OLinkSerializer.INSTANCE.deserialize(stream, offset);<NEW_LINE>offset += OLinkSerializer.RID_SIZE;<NEW_LINE>OIdentifiable identifiable = null;<NEW_LINE>if (rid.isTemporary())<NEW_LINE>identifiable = rid.getRecord();<NEW_LINE>if (identifiable == null)<NEW_LINE>identifiable = rid;<NEW_LINE>if (identifiable == null)<NEW_LINE>OLogManager.instance().warn(this, "Found null reference during ridbag deserialization (rid=%s)", rid);<NEW_LINE>else<NEW_LINE>addInternal(identifiable);<NEW_LINE>}<NEW_LINE>return offset;<NEW_LINE>} | INSTANCE.deserializeLiteral(stream, offset); |
787,972 | private void renderList(FacesContext facesContext, UIComponent messages, MessagesIterator messagesIterator) throws IOException {<NEW_LINE>ResponseWriter writer = facesContext.getResponseWriter();<NEW_LINE>writer.startElement(HTML.UL_ELEM, messages);<NEW_LINE>Map<String, List<ClientBehavior>> behaviors = null;<NEW_LINE>if (messages instanceof ClientBehaviorHolder) {<NEW_LINE>behaviors = ((<MASK><NEW_LINE>}<NEW_LINE>if (behaviors != null && !behaviors.isEmpty()) {<NEW_LINE>writer.writeAttribute(HTML.ID_ATTR, messages.getClientId(facesContext), null);<NEW_LINE>} else {<NEW_LINE>HtmlRendererUtils.writeIdIfNecessary(writer, messages, facesContext);<NEW_LINE>}<NEW_LINE>HtmlRendererUtils.renderHTMLAttributes(writer, messages, HTML.UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE);<NEW_LINE>HtmlRendererUtils.renderHTMLAttribute(writer, HTML.STYLE_ATTR, HTML.STYLE_ATTR, getComponentStyle(messages));<NEW_LINE>HtmlRendererUtils.renderHTMLAttribute(writer, HTML.STYLE_CLASS_ATTR, HTML.STYLE_CLASS_ATTR, getComponentStyleClass(messages));<NEW_LINE>while (messagesIterator.hasNext()) {<NEW_LINE>// messages);<NEW_LINE>writer.startElement(org.apache.myfaces.shared.renderkit.html.HTML.LI_ELEM, null);<NEW_LINE>FacesMessage facesMessage = (FacesMessage) messagesIterator.next();<NEW_LINE>// determine style and style class<NEW_LINE>String[] styleAndClass = getStyleAndStyleClass(messages, facesMessage.getSeverity());<NEW_LINE>String style = styleAndClass[0];<NEW_LINE>String styleClass = styleAndClass[1];<NEW_LINE>HtmlRendererUtils.renderHTMLAttribute(writer, HTML.STYLE_ATTR, HTML.STYLE_ATTR, style);<NEW_LINE>HtmlRendererUtils.renderHTMLAttribute(writer, HTML.STYLE_CLASS_ATTR, HTML.STYLE_CLASS_ATTR, styleClass);<NEW_LINE>renderSingleFacesMessage(facesContext, messages, facesMessage, messagesIterator.getClientId(), false, false, false);<NEW_LINE>writer.endElement(HTML.LI_ELEM);<NEW_LINE>}<NEW_LINE>writer.endElement(HTML.UL_ELEM);<NEW_LINE>} | ClientBehaviorHolder) messages).getClientBehaviors(); |
107,420 | // checked by primitiveKind()<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>private void readKeyFromResult(Attribute<E, ?> key, Settable<E> proxy, ResultSet results) throws SQLException {<NEW_LINE>Object generatedKey;<NEW_LINE>String column = key.getName();<NEW_LINE>int resultIndex = 1;<NEW_LINE>try {<NEW_LINE>// try find column if driver supports it<NEW_LINE>resultIndex = results.findColumn(column);<NEW_LINE>} catch (SQLException ignored) {<NEW_LINE>}<NEW_LINE>if (key.getPrimitiveKind() != null) {<NEW_LINE>switch(key.getPrimitiveKind()) {<NEW_LINE>case INT:<NEW_LINE>int intValue = mapping.readInt(results, resultIndex);<NEW_LINE>proxy.setInt((Attribute<E, Integer>) key, intValue, PropertyState.LOADED);<NEW_LINE>break;<NEW_LINE>case LONG:<NEW_LINE>long longValue = mapping.readLong(results, resultIndex);<NEW_LINE>proxy.setLong((Attribute<E, Long>) key, longValue, PropertyState.LOADED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>generatedKey = mapping.read((<MASK><NEW_LINE>if (generatedKey == null) {<NEW_LINE>throw new MissingKeyException();<NEW_LINE>}<NEW_LINE>proxy.setObject(key, generatedKey, PropertyState.LOADED);<NEW_LINE>}<NEW_LINE>} | Expression) key, results, resultIndex); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.