idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
242,525 | public void onReceive(Context context, Intent intent) {<NEW_LINE>final String action = intent.getAction();<NEW_LINE>// Only listen for Bluetooth server changes<NEW_LINE>if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {<NEW_LINE>final int state = intent.getIntExtra(<MASK><NEW_LINE>final int oldState = intent.getIntExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, BluetoothAdapter.ERROR);<NEW_LINE>debugLog("Bluetooth Service state changed from " + getStateDescription(oldState) + " to " + getStateDescription(state));<NEW_LINE>switch(state) {<NEW_LINE>case BluetoothAdapter.ERROR:<NEW_LINE>beaconServiceNotifier.didChangeAuthorizationStatus("AuthorizationStatusNotDetermined");<NEW_LINE>break;<NEW_LINE>case BluetoothAdapter.STATE_OFF:<NEW_LINE>case BluetoothAdapter.STATE_TURNING_OFF:<NEW_LINE>if (oldState == BluetoothAdapter.STATE_ON)<NEW_LINE>beaconServiceNotifier.didChangeAuthorizationStatus("AuthorizationStatusDenied");<NEW_LINE>break;<NEW_LINE>case BluetoothAdapter.STATE_ON:<NEW_LINE>beaconServiceNotifier.didChangeAuthorizationStatus("AuthorizationStatusAuthorized");<NEW_LINE>break;<NEW_LINE>case BluetoothAdapter.STATE_TURNING_ON:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); |
1,062,788 | public E relaxedPeek() {<NEW_LINE>final int chunkMask = this.chunkMask;<NEW_LINE>final int chunkShift = this.chunkShift;<NEW_LINE>final long cIndex = this.lvConsumerIndex();<NEW_LINE>final int ciChunkOffset = (int) (cIndex & chunkMask);<NEW_LINE>final long ciChunkIndex = cIndex >> chunkShift;<NEW_LINE>MpmcUnboundedXaddChunk<E<MASK><NEW_LINE>final int chunkSize = chunkMask + 1;<NEW_LINE>final boolean firstElementOfNewChunk = ciChunkOffset == 0 && cIndex >= chunkSize;<NEW_LINE>if (firstElementOfNewChunk) {<NEW_LINE>final long expectedChunkIndex = ciChunkIndex - 1;<NEW_LINE>if (expectedChunkIndex != consumerBuffer.lvIndex()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final MpmcUnboundedXaddChunk<E> next = consumerBuffer.lvNext();<NEW_LINE>if (next == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>consumerBuffer = next;<NEW_LINE>}<NEW_LINE>if (consumerBuffer.isPooled()) {<NEW_LINE>if (consumerBuffer.lvSequence(ciChunkOffset) != ciChunkIndex) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (consumerBuffer.lvIndex() != ciChunkIndex) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final E e = consumerBuffer.lvElement(ciChunkOffset);<NEW_LINE>// checking again vs consumerIndex changes is necessary to verify that e is still valid<NEW_LINE>if (cIndex != lvConsumerIndex()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return e;<NEW_LINE>} | > consumerBuffer = this.lvConsumerChunk(); |
1,474,052 | public void loadLayout(DockLayout layout) {<NEW_LINE>if (layout == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<DockContent> currentContents = getContents();<NEW_LINE>currentContents.forEach(c <MASK><NEW_LINE>// Close current popouts<NEW_LINE>applyToPopoutsSafe(p -> closePopout(p));<NEW_LINE>for (DockLayoutPopout p : layout.main) {<NEW_LINE>if (p.id == null) {<NEW_LINE>main.createLayout(p.child, main);<NEW_LINE>} else {<NEW_LINE>PopoutType type = p.id.startsWith("d") ? PopoutType.DIALOG : PopoutType.FRAME;<NEW_LINE>DockPopout popout = openPopout(type, p.location, p.size, p.state);<NEW_LINE>popout.setId(p.id);<NEW_LINE>// Creating the layout should also apply current settings<NEW_LINE>popout.getBase().createLayout(p.child, popout.getBase());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>currentlyActive = null;<NEW_LINE>active.clear();<NEW_LINE>// New layout, so previous paths should probably be reset<NEW_LINE>pathOnRemove.clear();<NEW_LINE>} | -> c.setDockParent(null)); |
70,240 | private static void removeTrackerPeerSources(List<TrackerPeerSource> list) {<NEW_LINE>int numLeft = list.size();<NEW_LINE>if (numLeft == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TrackerPeerSource toRemove = list.get(0);<NEW_LINE>if (toRemove == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MessageBoxShell mb = new MessageBoxShell(MessageText.getString("message.confirm.delete.title"), MessageText.getString("message.confirm.delete.text", new String[] { toRemove.getName() }), new String[] { MessageText.getString("Button.yes"), MessageText.getString("Button.no") }, 1);<NEW_LINE>if (numLeft > 1) {<NEW_LINE>String sDeleteAll = MessageText.getString("v3.deleteContent.applyToAll", new String<MASK><NEW_LINE>mb.addCheckBox("!" + sDeleteAll + "!", Parameter.MODE_BEGINNER, false);<NEW_LINE>}<NEW_LINE>mb.setRememberOnlyIfButton(0);<NEW_LINE>mb.setRemember("removeTracker", false, MessageText.getString("MessageBoxWindow.nomoreprompting"));<NEW_LINE>mb.open(result -> {<NEW_LINE>if (result == -1) {<NEW_LINE>// cancel<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean remove = result == 0;<NEW_LINE>boolean doAll = mb.getCheckBoxEnabled();<NEW_LINE>if (doAll) {<NEW_LINE>if (remove) {<NEW_LINE>for (TrackerPeerSource tps : list) {<NEW_LINE>if (tps.canDelete()) {<NEW_LINE>tps.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (remove) {<NEW_LINE>toRemove.delete();<NEW_LINE>}<NEW_LINE>// Loop with remaining tags to be removed<NEW_LINE>list.remove(0);<NEW_LINE>removeTrackerPeerSources(list);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | [] { "" + numLeft }); |
411,221 | public void center_display(Point2D p_new_center) {<NEW_LINE>java.awt<MASK><NEW_LINE>java.awt.geom.Point2D new_center = get_viewport_center();<NEW_LINE>java.awt.Point new_mouse_location = new java.awt.Point((int) (new_center.getX() - delta.getX()), (int) (new_center.getY() - delta.getY()));<NEW_LINE>move_mouse(new_mouse_location);<NEW_LINE>repaint();<NEW_LINE>this.board_handling.activityReplayFile.start_scope(ActivityReplayFileScope.CENTER_DISPLAY);<NEW_LINE>app.freerouting.geometry.planar.FloatPoint curr_corner = new app.freerouting.geometry.planar.FloatPoint(p_new_center.getX(), p_new_center.getY());<NEW_LINE>this.board_handling.activityReplayFile.add_corner(curr_corner);<NEW_LINE>} | .Point delta = set_viewport_center(p_new_center); |
112,102 | public static void applyStyledFormat(StyledText text, String sql) {<NEW_LINE>if (StringUtil.isEmpty(sql))<NEW_LINE>return;<NEW_LINE>text.setText(sql);<NEW_LINE>text.addLineStyleListener(new LineStyleListener() {<NEW_LINE><NEW_LINE>public void lineGetStyle(LineStyleEvent event) {<NEW_LINE>String line = event.lineText;<NEW_LINE>LinkedList<StyleRange> list = new LinkedList<StyleRange>();<NEW_LINE>line = line.toLowerCase();<NEW_LINE>String[] tokens = <MASK><NEW_LINE>if (tokens == null)<NEW_LINE>return;<NEW_LINE>HashSet<String> set = new HashSet<String>();<NEW_LINE>for (int i = 0; i < tokens.length; i++) {<NEW_LINE>set.add(tokens[i]);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < key.length; i++) {<NEW_LINE>if (set.contains(key[i])) {<NEW_LINE>int cursor = -1;<NEW_LINE>while ((cursor = line.indexOf(key[i], cursor + 1)) > -1) {<NEW_LINE>StyleRange sr = new StyleRange();<NEW_LINE>sr.start = event.lineOffset + cursor;<NEW_LINE>sr.length = key[i].length();<NEW_LINE>sr.foreground = Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);<NEW_LINE>list.add(sr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>event.styles = list.toArray(new StyleRange[list.size()]);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | StringUtil.tokenizer(line, " \n\r\f\t()+*/-=<>'`\"[],"); |
1,320,423 | public void detectModifiedOutputFiles(ModifiedFileSet modifiedOutputFiles, @Nullable Range<Long> lastExecutionTimeRange, boolean trustRemoteArtifacts, int fsvcThreads) throws InterruptedException {<NEW_LINE>long startTime = System.nanoTime();<NEW_LINE>FilesystemValueChecker fsvc = new FilesystemValueChecker(Preconditions.checkNotNull(tsgm.get()), perCommandSyscallCache, fsvcThreads);<NEW_LINE>BatchStat batchStatter = outputService == null ? null : outputService.getBatchStatter();<NEW_LINE>recordingDiffer.invalidate(fsvc.getDirtyActionValues(memoizingEvaluator.getValues(), batchStatter, modifiedOutputFiles, trustRemoteArtifacts, (maybeModifiedTime, artifact) -> {<NEW_LINE>modifiedFiles.incrementAndGet();<NEW_LINE>int dirtyOutputsCount = outputDirtyFiles.incrementAndGet();<NEW_LINE>if (lastExecutionTimeRange != null && lastExecutionTimeRange.contains(maybeModifiedTime)) {<NEW_LINE>modifiedFilesDuringPreviousBuild.incrementAndGet();<NEW_LINE>}<NEW_LINE>if (dirtyOutputsCount <= MODIFIED_OUTPUT_PATHS_SAMPLE_SIZE) {<NEW_LINE>outputDirtyFilesExecPathSample.offer(artifact.getExecPathString());<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>logger.atInfo().log("Found %d modified files from last build", modifiedFiles.get());<NEW_LINE>long stopTime = System.nanoTime();<NEW_LINE>Profiler.instance().logSimpleTask(startTime, stopTime, ProfilerTask.INFO, "detectModifiedOutputFiles");<NEW_LINE>long duration = stopTime - startTime;<NEW_LINE>outputTreeDiffCheckingDuration = duration > 0 ? Duration.<MASK><NEW_LINE>} | ofNanos(duration) : Duration.ZERO; |
1,359,514 | public static QueryClusterDetailResponse unmarshall(QueryClusterDetailResponse queryClusterDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryClusterDetailResponse.setRequestId(_ctx.stringValue("QueryClusterDetailResponse.RequestId"));<NEW_LINE>queryClusterDetailResponse.setMessage(_ctx.stringValue("QueryClusterDetailResponse.Message"));<NEW_LINE>queryClusterDetailResponse.setErrorCode(_ctx.stringValue("QueryClusterDetailResponse.ErrorCode"));<NEW_LINE>queryClusterDetailResponse.setSuccess(_ctx.booleanValue("QueryClusterDetailResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setVpcId(_ctx.stringValue("QueryClusterDetailResponse.Data.VpcId"));<NEW_LINE>data.setCreateTime(_ctx.stringValue("QueryClusterDetailResponse.Data.CreateTime"));<NEW_LINE>data.setIntranetAddress(_ctx.stringValue("QueryClusterDetailResponse.Data.IntranetAddress"));<NEW_LINE>data.setDiskType(_ctx.stringValue("QueryClusterDetailResponse.Data.DiskType"));<NEW_LINE>data.setPubNetworkFlow(_ctx.stringValue("QueryClusterDetailResponse.Data.PubNetworkFlow"));<NEW_LINE>data.setDiskCapacity(_ctx.longValue("QueryClusterDetailResponse.Data.DiskCapacity"));<NEW_LINE>data.setMemoryCapacity(_ctx.longValue("QueryClusterDetailResponse.Data.MemoryCapacity"));<NEW_LINE>data.setClusterAliasName(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterAliasName"));<NEW_LINE>data.setInstanceCount(_ctx.integerValue("QueryClusterDetailResponse.Data.InstanceCount"));<NEW_LINE>data.setIntranetPort(_ctx.stringValue("QueryClusterDetailResponse.Data.IntranetPort"));<NEW_LINE>data.setClusterId(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterId"));<NEW_LINE>data.setIntranetDomain(_ctx.stringValue("QueryClusterDetailResponse.Data.IntranetDomain"));<NEW_LINE>data.setInternetDomain(_ctx.stringValue("QueryClusterDetailResponse.Data.InternetDomain"));<NEW_LINE>data.setPayInfo<MASK><NEW_LINE>data.setInternetAddress(_ctx.stringValue("QueryClusterDetailResponse.Data.InternetAddress"));<NEW_LINE>data.setInstanceId(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceId"));<NEW_LINE>data.setAclEntryList(_ctx.stringValue("QueryClusterDetailResponse.Data.AclEntryList"));<NEW_LINE>data.setHealthStatus(_ctx.stringValue("QueryClusterDetailResponse.Data.HealthStatus"));<NEW_LINE>data.setInitCostTime(_ctx.longValue("QueryClusterDetailResponse.Data.InitCostTime"));<NEW_LINE>data.setRegionId(_ctx.stringValue("QueryClusterDetailResponse.Data.RegionId"));<NEW_LINE>data.setAclId(_ctx.stringValue("QueryClusterDetailResponse.Data.AclId"));<NEW_LINE>data.setCpu(_ctx.integerValue("QueryClusterDetailResponse.Data.Cpu"));<NEW_LINE>data.setClusterType(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterType"));<NEW_LINE>data.setClusterName(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterName"));<NEW_LINE>data.setInitStatus(_ctx.stringValue("QueryClusterDetailResponse.Data.InitStatus"));<NEW_LINE>data.setInternetPort(_ctx.stringValue("QueryClusterDetailResponse.Data.InternetPort"));<NEW_LINE>data.setAppVersion(_ctx.stringValue("QueryClusterDetailResponse.Data.AppVersion"));<NEW_LINE>data.setNetType(_ctx.stringValue("QueryClusterDetailResponse.Data.NetType"));<NEW_LINE>data.setClusterVersion(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterVersion"));<NEW_LINE>data.setClusterSpecification(_ctx.stringValue("QueryClusterDetailResponse.Data.ClusterSpecification"));<NEW_LINE>data.setVSwitchId(_ctx.stringValue("QueryClusterDetailResponse.Data.VSwitchId"));<NEW_LINE>data.setConnectionType(_ctx.stringValue("QueryClusterDetailResponse.Data.ConnectionType"));<NEW_LINE>data.setMseVersion(_ctx.stringValue("QueryClusterDetailResponse.Data.MseVersion"));<NEW_LINE>data.setChargeType(_ctx.stringValue("QueryClusterDetailResponse.Data.ChargeType"));<NEW_LINE>List<InstanceModel> instanceModels = new ArrayList<InstanceModel>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryClusterDetailResponse.Data.InstanceModels.Length"); i++) {<NEW_LINE>InstanceModel instanceModel = new InstanceModel();<NEW_LINE>instanceModel.setPodName(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].PodName"));<NEW_LINE>instanceModel.setSingleTunnelVip(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].SingleTunnelVip"));<NEW_LINE>instanceModel.setInternetIp(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].InternetIp"));<NEW_LINE>instanceModel.setIp(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].Ip"));<NEW_LINE>instanceModel.setRole(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].Role"));<NEW_LINE>instanceModel.setHealthStatus(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].HealthStatus"));<NEW_LINE>instanceModel.setCreationTimestamp(_ctx.stringValue("QueryClusterDetailResponse.Data.InstanceModels[" + i + "].CreationTimestamp"));<NEW_LINE>instanceModels.add(instanceModel);<NEW_LINE>}<NEW_LINE>data.setInstanceModels(instanceModels);<NEW_LINE>queryClusterDetailResponse.setData(data);<NEW_LINE>return queryClusterDetailResponse;<NEW_LINE>} | (_ctx.stringValue("QueryClusterDetailResponse.Data.PayInfo")); |
934,603 | private void describeNewTitle(@NonNull DecryptedGroupChange change, @NonNull List<UpdateDescription> updates) {<NEW_LINE>boolean editorIsYou = change.getEditor().equals(selfUuidBytes);<NEW_LINE>if (change.hasNewTitle()) {<NEW_LINE>String newTitle = StringUtil.isolateBidi(change.getNewTitle().getValue());<NEW_LINE>if (editorIsYou) {<NEW_LINE>updates.add(updateDescription(context.getString(R.string.MessageRecord_you_changed_the_group_name_to_s, newTitle)<MASK><NEW_LINE>} else {<NEW_LINE>updates.add(updateDescription(change.getEditor(), editor -> context.getString(R.string.MessageRecord_s_changed_the_group_name_to_s, editor, newTitle), R.drawable.ic_update_group_name_16));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , R.drawable.ic_update_group_name_16)); |
544,307 | public void run(FlowTrigger trigger, Map data) {<NEW_LINE>try {<NEW_LINE>String filename = "input-json";<NEW_LINE>new JsonParser().parse(jsonContent);<NEW_LINE>List<ErrorCodeElaboration> errs = JSONObjectUtil.toCollection(jsonContent, ArrayList.class, ErrorCodeElaboration.class);<NEW_LINE>contents.put(filename, errs);<NEW_LINE>} catch (JsonSyntaxException e) {<NEW_LINE>results.add(new ElaborationCheckResult(filename, null, ElaborationFailedReason.InValidJsonSchema.toString()));<NEW_LINE>} catch (JSONException e) {<NEW_LINE>results.add(new ElaborationCheckResult(filename, null, ElaborationFailedReason<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.debug(e.getMessage());<NEW_LINE>results.add(new ElaborationCheckResult(filename, null, ElaborationFailedReason.InValidJsonArraySchema.toString()));<NEW_LINE>}<NEW_LINE>trigger.next();<NEW_LINE>} | .InValidJsonArraySchema.toString())); |
752,803 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>View root = UiUtilities.getInflater(inflater.getContext(), nightMode).inflate(R.layout.fragment_terrain, container, false);<NEW_LINE>showHideTopShadow(root);<NEW_LINE>TextView emptyStateDescriptionTv = root.findViewById(R.id.empty_state_description);<NEW_LINE>TextView slopeReadMoreTv = root.findViewById(R.id.slope_read_more_tv);<NEW_LINE>TextView titleTv = root.findViewById(R.id.title_tv);<NEW_LINE>downloadDescriptionTv = root.findViewById(R.id.download_description_tv);<NEW_LINE>transparencyValueTv = root.findViewById(R.id.transparency_value_tv);<NEW_LINE>legendBottomDivider = root.findViewById(R.id.legend_bottom_divider);<NEW_LINE>transparencySlider = root.findViewById(R.id.transparency_slider);<NEW_LINE>titleBottomDivider = root.findViewById(R.id.titleBottomDivider);<NEW_LINE>legendTopDivider = root.<MASK><NEW_LINE>contentContainer = root.findViewById(R.id.content_container);<NEW_LINE>legendContainer = root.findViewById(R.id.legend_container);<NEW_LINE>switchCompat = root.findViewById(R.id.switch_compat);<NEW_LINE>descriptionTv = root.findViewById(R.id.description);<NEW_LINE>emptyState = root.findViewById(R.id.empty_state);<NEW_LINE>stateTv = root.findViewById(R.id.state_tv);<NEW_LINE>iconIv = root.findViewById(R.id.icon_iv);<NEW_LINE>zoomSlider = root.findViewById(R.id.zoom_slider);<NEW_LINE>minZoomTv = root.findViewById(R.id.zoom_value_min);<NEW_LINE>maxZoomTv = root.findViewById(R.id.zoom_value_max);<NEW_LINE>customRadioButton = root.findViewById(R.id.custom_radio_buttons);<NEW_LINE>TextView hillshadeBtn = root.findViewById(R.id.left_button);<NEW_LINE>TextView slopeBtn = root.findViewById(R.id.right_button);<NEW_LINE>downloadContainer = root.findViewById(R.id.download_container);<NEW_LINE>downloadTopDivider = root.findViewById(R.id.download_container_top_divider);<NEW_LINE>downloadBottomDivider = root.findViewById(R.id.download_container_bottom_divider);<NEW_LINE>observableListView = root.findViewById(R.id.list_view);<NEW_LINE>titleTv.setText(R.string.shared_string_terrain);<NEW_LINE>String wikiString = getString(R.string.shared_string_wikipedia);<NEW_LINE>String readMoreText = String.format(getString(R.string.slope_read_more), wikiString);<NEW_LINE>String emptyStateText = getString(R.string.terrain_empty_state_text) + "\n" + PLUGIN_URL;<NEW_LINE>setupClickableText(slopeReadMoreTv, readMoreText, wikiString, SLOPES_WIKI_URL, false);<NEW_LINE>setupClickableText(emptyStateDescriptionTv, emptyStateText, PLUGIN_URL, PLUGIN_URL, true);<NEW_LINE>switchCompat.setChecked(terrainEnabled);<NEW_LINE>hillshadeBtn.setOnClickListener(this);<NEW_LINE>hillshadeBtn.setText(R.string.shared_string_hillshade);<NEW_LINE>switchCompat.setOnClickListener(this);<NEW_LINE>slopeBtn.setOnClickListener(this);<NEW_LINE>slopeBtn.setText(R.string.shared_string_slope);<NEW_LINE>UiUtilities.setupSlider(transparencySlider, nightMode, colorProfile);<NEW_LINE>UiUtilities.setupSlider(zoomSlider, nightMode, colorProfile, true);<NEW_LINE>transparencySlider.addOnChangeListener(transparencySliderChangeListener);<NEW_LINE>zoomSlider.addOnChangeListener(zoomSliderChangeListener);<NEW_LINE>transparencySlider.setValueTo(100);<NEW_LINE>transparencySlider.setValueFrom(0);<NEW_LINE>zoomSlider.setValueTo(TERRAIN_MAX_ZOOM);<NEW_LINE>zoomSlider.setValueFrom(TERRAIN_MIN_ZOOM);<NEW_LINE>UiUtilities.setupCompoundButton(switchCompat, nightMode, UiUtilities.CompoundButtonType.PROFILE_DEPENDENT);<NEW_LINE>updateUiMode();<NEW_LINE>return root;<NEW_LINE>} | findViewById(R.id.legend_top_divider); |
1,505,939 | private TableWriter createWriter(CharSequence name, Entry e, long thread, CharSequence lockReason) {<NEW_LINE>try {<NEW_LINE>checkClosed();<NEW_LINE>LOG.info().$("open [table=`").utf8(name).$("`, thread=").$(thread).$(']').$();<NEW_LINE>e.writer = new TableWriter(configuration, name, messageBus, null, <MASK><NEW_LINE>e.ownershipReason = lockReason;<NEW_LINE>return logAndReturn(e, PoolListener.EV_CREATE);<NEW_LINE>} catch (CairoException ex) {<NEW_LINE>LOG.error().$("could not open [table=`").utf8(name).$("`, thread=").$(e.owner).$(", ex=").$(ex.getFlyweightMessage()).$(", errno=").$(ex.getErrno()).$(']').$();<NEW_LINE>e.ex = ex;<NEW_LINE>e.ownershipReason = OWNERSHIP_REASON_WRITER_ERROR;<NEW_LINE>e.owner = UNALLOCATED;<NEW_LINE>notifyListener(e.owner, name, PoolListener.EV_CREATE_EX);<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} | true, e, root, metrics); |
196,262 | private void open(String path, int memSize) throws FileNotFoundException, IOException {<NEW_LINE>this.path = path;<NEW_LINE>this.memBufferSize = memSize;<NEW_LINE>this.file = new File(this.path + ".hfile");<NEW_LINE>boolean isNew = this.file.exists() == false || this.file.length() < _memHeadReserved;<NEW_LINE>if (isNew) {<NEW_LINE>this.memBuffer = new byte[_memHeadReserved + memBufferSize];<NEW_LINE>this.memBuffer[0] = (byte) 0xCA;<NEW_LINE>this.memBuffer[1] = (byte) 0xFE;<NEW_LINE>} else {<NEW_LINE>this.memBufferSize = (int) (this.file.length() - _memHeadReserved);<NEW_LINE>this.memBuffer = FileUtil.readAll(this.file);<NEW_LINE>this.count = DataInputX.toInt(this.memBuffer, _countPos);<NEW_LINE>}<NEW_LINE>this.capacity = <MASK><NEW_LINE>FlushCtr.getInstance().regist(this);<NEW_LINE>} | (int) (memBufferSize / _keyLength); |
773,704 | protected void handleRedirect(FacesContext context, Throwable rootCause, ExceptionInfo info, boolean responseResetted) throws IOException {<NEW_LINE>ExternalContext externalContext = context.getExternalContext();<NEW_LINE>externalContext.getSessionMap().put(ExceptionInfo.ATTRIBUTE_NAME, info);<NEW_LINE>Map<String, String> errorPages = PrimeApplicationContext.getCurrentInstance(context).getConfig().getErrorPages();<NEW_LINE>String errorPage = evaluateErrorPage(errorPages, rootCause);<NEW_LINE>String url = constructRedirectUrl(context, errorPage);<NEW_LINE>// workaround for mojarra -> mojarra doesn't reset PartialResponseWriter#inChanges if we call externalContext#resetResponse<NEW_LINE>if (responseResetted && context.getPartialViewContext().isAjaxRequest()) {<NEW_LINE>PartialResponseWriter writer = context<MASK><NEW_LINE>externalContext.addResponseHeader("Content-Type", "text/xml; charset=" + externalContext.getResponseCharacterEncoding());<NEW_LINE>externalContext.addResponseHeader("Cache-Control", "no-cache");<NEW_LINE>externalContext.setResponseContentType("text/xml");<NEW_LINE>writer.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");<NEW_LINE>writer.startElement("partial-response", null);<NEW_LINE>writer.startElement("redirect", null);<NEW_LINE>writer.writeAttribute("url", url, null);<NEW_LINE>writer.endElement("redirect");<NEW_LINE>writer.endElement("partial-response");<NEW_LINE>} else {<NEW_LINE>// workaround for IllegalStateException from redirect of committed response<NEW_LINE>if (externalContext.isResponseCommitted() && !context.getPartialViewContext().isAjaxRequest()) {<NEW_LINE>PartialResponseWriter writer = context.getPartialViewContext().getPartialResponseWriter();<NEW_LINE>writer.startElement("script", null);<NEW_LINE>writer.write("window.location.href = '" + url + "';");<NEW_LINE>writer.endElement("script");<NEW_LINE>writer.getWrapped().endDocument();<NEW_LINE>} else {<NEW_LINE>externalContext.redirect(url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>context.responseComplete();<NEW_LINE>} | .getPartialViewContext().getPartialResponseWriter(); |
556,520 | public ODocument toNetworkStream() {<NEW_LINE>ODocument document = new ODocument();<NEW_LINE>document.setTrackingChanges(false);<NEW_LINE>document.field("name", getName());<NEW_LINE>document.field("type", getType().id);<NEW_LINE>document.field("globalId", globalRef.getId());<NEW_LINE>document.field("mandatory", mandatory);<NEW_LINE>document.field("readonly", readonly);<NEW_LINE>document.field("notNull", notNull);<NEW_LINE>document.field("defaultValue", defaultValue);<NEW_LINE>document.field("min", min);<NEW_LINE>document.field("max", max);<NEW_LINE>if (regexp != null) {<NEW_LINE>document.field("regexp", regexp);<NEW_LINE>} else {<NEW_LINE>document.removeField("regexp");<NEW_LINE>}<NEW_LINE>if (linkedType != null)<NEW_LINE>document.field("linkedType", linkedType.id);<NEW_LINE>if (linkedClass != null || linkedClassName != null)<NEW_LINE>document.field("linkedClass", linkedClass != null ? linkedClass.getName() : linkedClassName);<NEW_LINE>document.field("customFields", customFields != null && customFields.size() > 0 ? customFields : null, OType.EMBEDDEDMAP);<NEW_LINE>if (collate != null) {<NEW_LINE>document.field(<MASK><NEW_LINE>}<NEW_LINE>document.field("description", description);<NEW_LINE>return document;<NEW_LINE>} | "collate", collate.getName()); |
503,406 | protected static void fromHistoricVariableUpdate(HistoricVariableUpdateDto dto, HistoricVariableUpdate historicVariableUpdate) {<NEW_LINE>dto<MASK><NEW_LINE>dto.variableName = historicVariableUpdate.getVariableName();<NEW_LINE>dto.variableInstanceId = historicVariableUpdate.getVariableInstanceId();<NEW_LINE>dto.initial = historicVariableUpdate.isInitial();<NEW_LINE>if (historicVariableUpdate.getErrorMessage() == null) {<NEW_LINE>try {<NEW_LINE>VariableValueDto variableValueDto = VariableValueDto.fromTypedValue(historicVariableUpdate.getTypedValue());<NEW_LINE>dto.value = variableValueDto.getValue();<NEW_LINE>dto.variableType = variableValueDto.getType();<NEW_LINE>dto.valueInfo = variableValueDto.getValueInfo();<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>dto.errorMessage = e.getMessage();<NEW_LINE>dto.variableType = VariableValueDto.toRestApiTypeName(historicVariableUpdate.getTypeName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dto.errorMessage = historicVariableUpdate.getErrorMessage();<NEW_LINE>dto.variableType = VariableValueDto.toRestApiTypeName(historicVariableUpdate.getTypeName());<NEW_LINE>}<NEW_LINE>} | .revision = historicVariableUpdate.getRevision(); |
783,433 | private final void encipher(int[] lr, int off) {<NEW_LINE>int i, n, l = lr[off], r = lr[off + 1];<NEW_LINE>l ^= P[0];<NEW_LINE>for (i = 0; i <= BLOWFISH_NUM_ROUNDS - 2; ) {<NEW_LINE>// Feistel substitution on left word<NEW_LINE>n = S[(l >> 24) & 0xff];<NEW_LINE>n += S[0x100 | ((l >> 16) & 0xff)];<NEW_LINE>n ^= S[0x200 | ((l >> 8) & 0xff)];<NEW_LINE>n += S[0x300 | (l & 0xff)];<NEW_LINE>r ^= n ^ P[++i];<NEW_LINE>// Feistel substitution on right word<NEW_LINE>n = S[(r >> 24) & 0xff];<NEW_LINE>n += S[0x100 | ((r >> 16) & 0xff)];<NEW_LINE>n ^= S[0x200 | ((r >> 8) & 0xff)];<NEW_LINE>n += S[0x300 | (r & 0xff)];<NEW_LINE>l ^= n ^ P[++i];<NEW_LINE>}<NEW_LINE>lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1];<NEW_LINE><MASK><NEW_LINE>} | lr[off + 1] = l; |
1,816,248 | private boolean extractCalibration(DMatrixRMaj x, CameraPinhole calibration) {<NEW_LINE>double s = x.data[5];<NEW_LINE>double cx = calibration.cx = x.data[2] / s;<NEW_LINE>double cy = calibration.cy = x.data[4] / s;<NEW_LINE>double fy = calibration.fy = Math.sqrt(x.data[3<MASK><NEW_LINE>double sk = calibration.skew = (x.data[1] / s - cx * cy) / fy;<NEW_LINE>calibration.fx = Math.sqrt(x.data[0] / s - sk * sk - cx * cx);<NEW_LINE>if (calibration.fx < 0 || calibration.fy < 0)<NEW_LINE>return false;<NEW_LINE>if (UtilEjml.isUncountable(fy) || UtilEjml.isUncountable(calibration.fx))<NEW_LINE>return false;<NEW_LINE>if (UtilEjml.isUncountable(sk))<NEW_LINE>return false;<NEW_LINE>return true;<NEW_LINE>} | ] / s - cy * cy); |
1,134,550 | private short calcChecksum(InetAddress srcAddr, InetAddress dstAddr, byte[] header, byte[] payload) {<NEW_LINE>byte[] data;<NEW_LINE>int destPos;<NEW_LINE>int totalLength = payload.length + length();<NEW_LINE>boolean lowerLayerIsIpV4 = srcAddr instanceof Inet4Address;<NEW_LINE><MASK><NEW_LINE>if ((totalLength % 2) != 0) {<NEW_LINE>data = new byte[totalLength + 1 + pseudoHeaderSize];<NEW_LINE>destPos = totalLength + 1;<NEW_LINE>} else {<NEW_LINE>data = new byte[totalLength + pseudoHeaderSize];<NEW_LINE>destPos = totalLength;<NEW_LINE>}<NEW_LINE>System.arraycopy(header, 0, data, 0, header.length);<NEW_LINE>System.arraycopy(payload, 0, data, header.length, payload.length);<NEW_LINE>// pseudo header<NEW_LINE>System.arraycopy(srcAddr.getAddress(), 0, data, destPos, srcAddr.getAddress().length);<NEW_LINE>destPos += srcAddr.getAddress().length;<NEW_LINE>System.arraycopy(dstAddr.getAddress(), 0, data, destPos, dstAddr.getAddress().length);<NEW_LINE>destPos += dstAddr.getAddress().length;<NEW_LINE>if (lowerLayerIsIpV4) {<NEW_LINE>// data[destPos] = (byte)0;<NEW_LINE>destPos++;<NEW_LINE>} else {<NEW_LINE>destPos += 3;<NEW_LINE>}<NEW_LINE>data[destPos] = IpNumber.TCP.value();<NEW_LINE>destPos++;<NEW_LINE>System.arraycopy(ByteArrays.toByteArray((short) totalLength), 0, data, destPos, SHORT_SIZE_IN_BYTES);<NEW_LINE>destPos += SHORT_SIZE_IN_BYTES;<NEW_LINE>return ByteArrays.calcChecksum(data);<NEW_LINE>} | int pseudoHeaderSize = lowerLayerIsIpV4 ? IPV4_PSEUDO_HEADER_SIZE : IPV6_PSEUDO_HEADER_SIZE; |
19,049 | public void syncVMMetaData(final Map<String, String> vmMetadatum) {<NEW_LINE>if (vmMetadatum == null || vmMetadatum.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Pair<Pair<String, VirtualMachine.Type>, Pair<Long, String>>> vmDetails = _userVmDao.getVmsDetailByNames(vmMetadatum.keySet(), "platform");<NEW_LINE>for (final Map.Entry<String, String> entry : vmMetadatum.entrySet()) {<NEW_LINE>final String name = entry.getKey();<NEW_LINE>final String platform = entry.getValue();<NEW_LINE>if (platform == null || platform.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean found = false;<NEW_LINE>for (Pair<Pair<String, VirtualMachine.Type>, Pair<Long, String>> vmDetail : vmDetails) {<NEW_LINE>Pair<String, VirtualMachine.Type> vmNameTypePair = vmDetail.first();<NEW_LINE>if (vmNameTypePair.first().equals(name)) {<NEW_LINE>found = true;<NEW_LINE>if (vmNameTypePair.second() == VirtualMachine.Type.User) {<NEW_LINE>Pair<Long, String> detailPair = vmDetail.second();<NEW_LINE>String platformDetail = detailPair.second();<NEW_LINE>if (platformDetail != null && platformDetail.equals(platform)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>updateVmMetaData(detailPair.first(), platform);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>VMInstanceVO <MASK><NEW_LINE>if (vm != null && vm.getType() == VirtualMachine.Type.User) {<NEW_LINE>updateVmMetaData(vm.getId(), platform);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | vm = _vmDao.findVMByInstanceName(name); |
1,641,898 | public static IntLongVector mergeSparseLongVector(IndexGetParam param, List<PartitionGetResult> partResults) {<NEW_LINE>int dim = (int) PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(param.getMatrixId()).getColNum();<NEW_LINE>IntLongVector vector = VFactory.sparseLongVector(dim, param.size());<NEW_LINE>for (PartitionGetResult part : partResults) {<NEW_LINE>PartitionKey partKey = ((IndexPartGetLongResult) part).getPartKey();<NEW_LINE>int[] indexes = param.<MASK><NEW_LINE>long[] values = ((IndexPartGetLongResult) part).getValues();<NEW_LINE>for (int i = 0; i < indexes.length; i++) {<NEW_LINE>if (i < 10) {<NEW_LINE>LOG.debug("merge index = " + indexes[i] + ", value = " + values[i]);<NEW_LINE>}<NEW_LINE>vector.set(indexes[i], values[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>vector.setMatrixId(param.getMatrixId());<NEW_LINE>vector.setRowId(param.getRowId());<NEW_LINE>return vector;<NEW_LINE>} | getPartKeyToIndexesMap().get(partKey); |
1,087,903 | public final VsplatparameterContext vsplatparameter(ArgDefListBuilder args) throws RecognitionException {<NEW_LINE>VsplatparameterContext _localctx = new VsplatparameterContext(_ctx, getState(), args);<NEW_LINE>enterRule(_localctx, 32, RULE_vsplatparameter);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(555);<NEW_LINE>match(STAR);<NEW_LINE>String name = null;<NEW_LINE>setState(559);<NEW_LINE>_errHandler.sync(this);<NEW_LINE><MASK><NEW_LINE>if (_la == NAME) {<NEW_LINE>{<NEW_LINE>setState(557);<NEW_LINE>_localctx.NAME = match(NAME);<NEW_LINE>name = (_localctx.NAME != null ? _localctx.NAME.getText() : null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>args.addSplat(name != null ? factory.mangleNameInCurrentScope(name) : null, null);<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>} | _la = _input.LA(1); |
443,274 | public static boolean isJoinKeyHaveSameType(Join join) {<NEW_LINE>JoinInfo joinInfo = join.analyzeCondition();<NEW_LINE>RelDataType keyDataType = CalciteUtils.getJoinKeyDataType(join.getCluster().getTypeFactory(), join, joinInfo.leftKeys, joinInfo.rightKeys);<NEW_LINE>List<RelDataTypeField<MASK><NEW_LINE>RelNode left = join.getLeft();<NEW_LINE>RelNode right = join.getRight();<NEW_LINE>for (int i = 0; i < keyDataFieldList.size(); i++) {<NEW_LINE>RelDataType t1 = keyDataFieldList.get(i).getType();<NEW_LINE>RelDataTypeField t2Field = left.getRowType().getFieldList().get(joinInfo.leftKeys.get(i));<NEW_LINE>RelDataType t2 = t2Field.getType();<NEW_LINE>// only compare sql type name<NEW_LINE>if (!t1.getSqlTypeName().equals(t2.getSqlTypeName())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < keyDataFieldList.size(); i++) {<NEW_LINE>RelDataType t1 = keyDataFieldList.get(i).getType();<NEW_LINE>RelDataTypeField t2Field = right.getRowType().getFieldList().get(joinInfo.rightKeys.get(i));<NEW_LINE>RelDataType t2 = t2Field.getType();<NEW_LINE>// only compare sql type name<NEW_LINE>if (!t1.getSqlTypeName().equals(t2.getSqlTypeName())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | > keyDataFieldList = keyDataType.getFieldList(); |
950,389 | public Layer1Topology loadLayer1Topology(NetworkId network, SnapshotId snapshot) {<NEW_LINE>// Prefer runtime data inside of batfish/ subfolder over top level<NEW_LINE>Path insideBatfish = Paths.get(RELPATH_INPUT, RELPATH_BATFISH_CONFIGS_DIR, BfConsts.RELPATH_L1_TOPOLOGY_PATH);<NEW_LINE>Path topLevel = Paths.get(RELPATH_INPUT, BfConsts.RELPATH_L1_TOPOLOGY_PATH);<NEW_LINE>Path deprecated = Paths.get(RELPATH_INPUT, "testrig_layer1_topology");<NEW_LINE>Optional<Path> path = Stream.of(insideBatfish, topLevel, deprecated).map(p -> getSnapshotDir(network, snapshot).resolve(p)).filter(Files::exists).findFirst();<NEW_LINE>if (!path.isPresent()) {<NEW_LINE>// Neither file was present in input.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>AtomicInteger counter = _newBatch.apply("Reading layer-1 topology", 1);<NEW_LINE>try {<NEW_LINE>return BatfishObjectMapper.mapper().readValue(path.get().toFile(), Layer1Topology.class);<NEW_LINE>} catch (IOException e) {<NEW_LINE>_logger.warnf("Unexpected exception caught while loading layer-1 topology for snapshot %s: %s", snapshot, Throwables.getStackTraceAsString(e));<NEW_LINE>LOGGER.warn(String.format<MASK><NEW_LINE>return null;<NEW_LINE>} finally {<NEW_LINE>counter.incrementAndGet();<NEW_LINE>}<NEW_LINE>} | ("Unexpected exception caught while loading layer-1 topology for snapshot %s", snapshot), e); |
162,878 | private void registerTrustStore(String trustStorePath, RestClientBuilder builder) {<NEW_LINE>Optional<String> maybeTrustStorePassword = oneOf(clientConfigByClassName().trustStorePassword, clientConfigByConfigKey().trustStorePassword);<NEW_LINE>Optional<String> maybeTrustStoreType = oneOf(clientConfigByClassName().trustStoreType, clientConfigByConfigKey().trustStoreType);<NEW_LINE>try {<NEW_LINE>KeyStore trustStore = KeyStore.getInstance(maybeTrustStoreType.orElse("JKS"));<NEW_LINE>if (maybeTrustStorePassword.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("No password provided for truststore");<NEW_LINE>}<NEW_LINE>String password = maybeTrustStorePassword.get();<NEW_LINE>try (InputStream input = locateStream(trustStorePath)) {<NEW_LINE>trustStore.load(input, password.toCharArray());<NEW_LINE>} catch (IOException | CertificateException | NoSuchAlgorithmException e) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>builder.trustStore(trustStore);<NEW_LINE>} catch (KeyStoreException e) {<NEW_LINE>throw new IllegalArgumentException("Failed to initialize trust store from " + trustStorePath, e);<NEW_LINE>}<NEW_LINE>} | IllegalArgumentException("Failed to initialize trust store from classpath resource " + trustStorePath, e); |
1,324,886 | final GetParametersForImportResult executeGetParametersForImport(GetParametersForImportRequest getParametersForImportRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getParametersForImportRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetParametersForImportRequest> request = null;<NEW_LINE>Response<GetParametersForImportResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetParametersForImportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getParametersForImportRequest));<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, "KMS");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetParametersForImportResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetParametersForImportResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetParametersForImport"); |
461,583 | public static LiveChannelStat parseGetLiveChannelStat(InputStream responseBody) throws ResponseParseException {<NEW_LINE>try {<NEW_LINE>Element root = getXmlRootElement(responseBody);<NEW_LINE>LiveChannelStat result = new LiveChannelStat();<NEW_LINE>result.setPushflowStatus(PushflowStatus.parse(root.getChildText("Status")));<NEW_LINE>if (root.getChild("ConnectedTime") != null) {<NEW_LINE>result.setConnectedDate(DateUtil.parseIso8601Date(root.getChildText("ConnectedTime")));<NEW_LINE>}<NEW_LINE>if (root.getChild("RemoteAddr") != null) {<NEW_LINE>result.setRemoteAddress(root.getChildText("RemoteAddr"));<NEW_LINE>}<NEW_LINE>Element videoElem = root.getChild("Video");<NEW_LINE>if (videoElem != null) {<NEW_LINE>VideoStat videoStat = new VideoStat();<NEW_LINE>videoStat.setWidth(Integer.parseInt(videoElem.getChildText("Width")));<NEW_LINE>videoStat.setHeight(Integer.parseInt(videoElem.getChildText("Height")));<NEW_LINE>videoStat.setFrameRate(Integer.parseInt(videoElem.getChildText("FrameRate")));<NEW_LINE>videoStat.setBandWidth(Integer.parseInt(videoElem.getChildText("Bandwidth")));<NEW_LINE>videoStat.setCodec<MASK><NEW_LINE>result.setVideoStat(videoStat);<NEW_LINE>}<NEW_LINE>Element audioElem = root.getChild("Audio");<NEW_LINE>if (audioElem != null) {<NEW_LINE>AudioStat audioStat = new AudioStat();<NEW_LINE>audioStat.setBandWidth(Integer.parseInt(audioElem.getChildText("Bandwidth")));<NEW_LINE>audioStat.setSampleRate(Integer.parseInt(audioElem.getChildText("SampleRate")));<NEW_LINE>audioStat.setCodec(audioElem.getChildText("Codec"));<NEW_LINE>result.setAudioStat(audioStat);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (JDOMParseException e) {<NEW_LINE>throw new ResponseParseException(e.getPartialDocument() + ": " + e.getMessage(), e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ResponseParseException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | (videoElem.getChildText("Codec")); |
1,213,388 | public void execute(List<EventWithContext> eventsWithContext, Map<String, EventFieldSpec> fieldSpec) {<NEW_LINE>for (final Map.Entry<String, EventFieldSpec> entry : fieldSpec.entrySet()) {<NEW_LINE>final String fieldName = entry.getKey();<NEW_LINE>final <MASK><NEW_LINE>for (final FieldValueProvider.Config providerConfig : spec.providers()) {<NEW_LINE>final FieldValueProvider.Factory providerFactory = fieldValueProviders.get(providerConfig.type());<NEW_LINE>if (providerFactory == null) {<NEW_LINE>LOG.error("Couldn't find field provider factory for type {}", providerConfig.type());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final FieldValueProvider provider = providerFactory.create(providerConfig);<NEW_LINE>for (final EventWithContext eventWithContext : eventsWithContext) {<NEW_LINE>final Event event = eventWithContext.event();<NEW_LINE>event.setField(fieldName, provider.get(fieldName, eventWithContext));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | EventFieldSpec spec = entry.getValue(); |
702,489 | public void connect(ByteBuffer initial_data, ConnectionListener listener) {<NEW_LINE>if (TRACE) {<NEW_LINE>trace("outbound connect to " + endpoint.getNotionalAddress());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Map message = new HashMap();<NEW_LINE>byte[] initial_data_bytes = new byte[initial_data.remaining()];<NEW_LINE>initial_data.get(initial_data_bytes);<NEW_LINE>List initial_messages = new ArrayList();<NEW_LINE>initial_messages.add(initial_data_bytes);<NEW_LINE>message.put("type", new Long(MESSAGE_TYPE_CONNECT));<NEW_LINE>message.put("msg_id", msg_id);<NEW_LINE>message.put("msg_desc", msg_desc);<NEW_LINE>message.put("data", initial_messages);<NEW_LINE>Map reply = nat_traverser.sendMessage(message_manager, rendezvous, target, message);<NEW_LINE>last_message_sent = SystemTime.getCurrentTime();<NEW_LINE>if (reply == null || !reply.containsKey("type")) {<NEW_LINE>listener.connectFailure(new Throwable("Indirect connect failed (response=" + reply + ")"));<NEW_LINE>} else {<NEW_LINE>int reply_type = ((Long) reply.get("type")).intValue();<NEW_LINE>if (reply_type == MESSAGE_TYPE_ERROR) {<NEW_LINE>listener.connectFailure(new Throwable(new String((byte[]) reply.get("error"))));<NEW_LINE>} else if (reply_type == MESSAGE_TYPE_DISCONNECT) {<NEW_LINE>listener.connectFailure(new Throwable("Disconnected"));<NEW_LINE>} else if (reply_type == MESSAGE_TYPE_CONNECT) {<NEW_LINE>connection_id = ((Long) reply.get<MASK><NEW_LINE>synchronized (local_connections) {<NEW_LINE>local_connections.put(new Long(connection_id), this);<NEW_LINE>}<NEW_LINE>listener.connectSuccess();<NEW_LINE>List<byte[]> replies = (List<byte[]>) reply.get("data");<NEW_LINE>for (int i = 0; i < replies.size(); i++) {<NEW_LINE>owner.receive(new GenericMessage(msg_id, msg_desc, new DirectByteBuffer(ByteBuffer.wrap(replies.get(i))), false));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Debug.out("Unexpected reply type - " + reply_type);<NEW_LINE>listener.connectFailure(new Throwable("Unexpected reply type - " + reply_type));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>listener.connectFailure(e);<NEW_LINE>}<NEW_LINE>} | ("con_id")).longValue(); |
881,228 | public ListUsersInGroupResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListUsersInGroupResult listUsersInGroupResult = new ListUsersInGroupResult();<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 listUsersInGroupResult;<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("Users", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listUsersInGroupResult.setUsers(new ListUnmarshaller<UserType>(UserTypeJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listUsersInGroupResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listUsersInGroupResult;<NEW_LINE>} | class).unmarshall(context)); |
1,096,784 | public void marshall(ServiceUpdate serviceUpdate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (serviceUpdate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(serviceUpdate.getServiceUpdateName(), SERVICEUPDATENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(serviceUpdate.getReleaseDate(), RELEASEDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(serviceUpdate.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(serviceUpdate.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(serviceUpdate.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(serviceUpdate.getNodesUpdated(), NODESUPDATED_BINDING);<NEW_LINE>protocolMarshaller.marshall(serviceUpdate.getAutoUpdateStartDate(), AUTOUPDATESTARTDATE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | serviceUpdate.getClusterName(), CLUSTERNAME_BINDING); |
483,194 | private String processPaymentInitializationResponse(HttpResponse<String> response, PaymentSpecification spec, int retryCount) {<NEW_LINE>var reservationId = spec.getReservationId();<NEW_LINE>var responseBody = JsonParser.parseString(response.body()).getAsJsonObject();<NEW_LINE>var paymentToken = responseBody.get("Token").getAsString();<NEW_LINE>var expiration = ZonedDateTime.parse(responseBody.get<MASK><NEW_LINE>ticketReservationRepository.updateReservationStatus(reservationId, EXTERNAL_PROCESSING_PAYMENT.toString());<NEW_LINE>ticketReservationRepository.updateValidity(reservationId, Date.from(expiration.toInstant()));<NEW_LINE>invalidateExistingTransactions(reservationId, transactionRepository);<NEW_LINE>transactionRepository.insert(paymentToken, paymentToken, reservationId, ZonedDateTime.now(clockProvider.withZone(spec.getPurchaseContext().getZoneId())), spec.getPriceWithVAT(), spec.getPurchaseContext().getCurrency(), "Saferpay Payment", PaymentProxy.SAFERPAY.name(), 0L, 0L, Transaction.Status.PENDING, Map.of(RETRY_COUNT, String.valueOf(retryCount)));<NEW_LINE>return responseBody.get("RedirectUrl").getAsString();<NEW_LINE>} | ("Expiration").getAsString()); |
811,142 | final CreateLunaClientResult executeCreateLunaClient(CreateLunaClientRequest createLunaClientRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLunaClientRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateLunaClientRequest> request = null;<NEW_LINE>Response<CreateLunaClientResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLunaClientRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLunaClientRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudHSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLunaClient");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateLunaClientResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLunaClientResultJsonUnmarshaller());<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.CLIENT_ENDPOINT, endpoint); |
849,797 | public static boolean usesScrollbars() {<NEW_LINE>if (usesScrollbars_ != null)<NEW_LINE>return usesScrollbars_;<NEW_LINE>if (!BrowseCap.isMacintosh()) {<NEW_LINE>usesScrollbars_ = true;<NEW_LINE>} else {<NEW_LINE>Element parent = Document.get().createElement("div");<NEW_LINE>parent.getStyle().setWidth(100, Unit.PX);<NEW_LINE>parent.getStyle().setHeight(100, Unit.PX);<NEW_LINE>parent.getStyle().setOverflow(Overflow.AUTO);<NEW_LINE>parent.getStyle().setVisibility(Visibility.HIDDEN);<NEW_LINE>parent.getStyle(<MASK><NEW_LINE>parent.getStyle().setLeft(-300, Unit.PX);<NEW_LINE>parent.getStyle().setTop(-300, Unit.PX);<NEW_LINE>Element content = Document.get().createElement("div");<NEW_LINE>content.getStyle().setWidth(100, Unit.PX);<NEW_LINE>content.getStyle().setHeight(200, Unit.PX);<NEW_LINE>parent.appendChild(content);<NEW_LINE>Document.get().getBody().appendChild(parent);<NEW_LINE>boolean hasScrollbars = parent.getOffsetWidth() - parent.getClientWidth() > 0;<NEW_LINE>parent.removeFromParent();<NEW_LINE>usesScrollbars_ = hasScrollbars;<NEW_LINE>}<NEW_LINE>return usesScrollbars_;<NEW_LINE>} | ).setPosition(Position.FIXED); |
235,979 | protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>Parser parser = new Parser(PATTERN, (String) msg);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>String time = parser.next();<NEW_LINE>position.setTime(new Date(Long.<MASK><NEW_LINE>position.setLatitude(parser.nextDouble());<NEW_LINE>position.setLongitude(parser.nextDouble());<NEW_LINE>position.setSpeed(parser.nextInt());<NEW_LINE>position.setCourse(parser.nextInt());<NEW_LINE>position.setAccuracy(parser.nextInt());<NEW_LINE>position.setAltitude(parser.nextInt());<NEW_LINE>position.set(Position.KEY_STATUS, parser.nextInt());<NEW_LINE>position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt());<NEW_LINE>position.set(Position.PREFIX_TEMP + 1, parser.nextInt());<NEW_LINE>position.set(Position.KEY_CHARGE, parser.nextInt() == 1);<NEW_LINE>if (channel != null) {<NEW_LINE>channel.writeAndFlush(new NetworkMessage(time, remoteAddress));<NEW_LINE>}<NEW_LINE>return position;<NEW_LINE>} | parseLong(time) * 1000)); |
280,963 | public static AutogenVersionEnvironmentDiff fromProto(ai.verta.modeldb.versioning.VersionEnvironmentDiff blob) {<NEW_LINE>if (blob == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>AutogenVersionEnvironmentDiff obj = new AutogenVersionEnvironmentDiff();<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.VersionEnvironmentDiff, AutogenVersionEnvironmentBlob> f = x -> AutogenVersionEnvironmentBlob.fromProto(blob.getA());<NEW_LINE>obj.setA(f.apply(blob));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.VersionEnvironmentDiff, AutogenVersionEnvironmentBlob> f = x -> AutogenVersionEnvironmentBlob.fromProto(blob.getB());<NEW_LINE>obj.setB(f.apply(blob));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.VersionEnvironmentDiff, AutogenVersionEnvironmentBlob> f = x -> AutogenVersionEnvironmentBlob.fromProto(blob.getC());<NEW_LINE>obj.setC(f.apply(blob));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>Function<ai.verta.modeldb.versioning.VersionEnvironmentDiff, AutogenDiffStatusEnumDiffStatus> f = x -> AutogenDiffStatusEnumDiffStatus.<MASK><NEW_LINE>obj.setStatus(f.apply(blob));<NEW_LINE>}<NEW_LINE>return obj;<NEW_LINE>} | fromProto(blob.getStatus()); |
237,282 | static void updateVideoInfo(final VideoFile thisVideo, final SecurityContext ctx) {<NEW_LINE>try (final Tx tx = StructrApp.getInstance(ctx).tx()) {<NEW_LINE>final Map<String, Object> info = AVConv.newInstance(ctx, thisVideo).getVideoInfo();<NEW_LINE>if (info != null && info.containsKey("streams")) {<NEW_LINE>final List<Map<String, Object>> streams = (List<Map<String, Object>>) info.get("streams");<NEW_LINE>for (final Map<String, Object> stream : streams) {<NEW_LINE>final String codecType = (String) stream.get("codec_type");<NEW_LINE>if (codecType != null) {<NEW_LINE>if ("video".equals(codecType)) {<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "videoCodecName"), stream.get("codec_long_name"));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "videoCodec"), stream.get("codec_name"));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "pixelFormat"), stream.get("pix_fmt"));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "width"), VideoFile.toInt(stream.get("width")));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "height"), VideoFile.toInt(stream.get("height")));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "duration"), VideoFile.toDouble(stream.get("duration")));<NEW_LINE>} else if ("audio".equals(codecType)) {<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "audioCodecName"), stream.get("codec_long_name"));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "audioCodec"), stream.get("codec_name"));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "sampleRate"), VideoFile.toInt(stream.get("sampleRate")));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>} catch (FrameworkException fex) {<NEW_LINE>final Logger logger = LoggerFactory.getLogger(VideoFile.class);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | logger.warn("", fex); |
1,177,382 | private Token includeFiltered() {<NEW_LINE>Matcher matcher = Pattern.compile("^include:([\\w\\-]+)([\\( ])").matcher(scanner.getInput());<NEW_LINE>if (matcher.find(0) && matcher.groupCount() > 1) {<NEW_LINE>this.consume(matcher.end() - 1);<NEW_LINE>String filter = matcher.group(1);<NEW_LINE>Token attrs = matcher.group(2).equals("(") ? this.attrs() : null;<NEW_LINE>if (!(matcher.group(2).equals(" ") || scanner.getInput().charAt(0) == ' ')) {<NEW_LINE>throw new JadeLexerException("expected space after include:filter but got " + String.valueOf(scanner.getInput().charAt(0)), filename, getLineno(), templateLoader);<NEW_LINE>}<NEW_LINE>matcher = Pattern.compile("^ *([^\\n]+)").matcher(scanner.getInput());<NEW_LINE>if (!(matcher.find(0) && matcher.groupCount() > 0) || matcher.group(1).trim().equals("")) {<NEW_LINE>throw new JadeLexerException("missing path for include:filter", filename, getLineno(), templateLoader);<NEW_LINE>}<NEW_LINE>this.consume(matcher.end());<NEW_LINE>String path = matcher.group(1);<NEW_LINE>Include tok <MASK><NEW_LINE>tok.setFilter(filter);<NEW_LINE>tok.setAttrs(attrs);<NEW_LINE>return tok;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | = new Include(path, lineno); |
337,388 | public static RoomGuestCounts toCounts(@NonNull BookingFilterParams.Room... rooms) {<NEW_LINE>final int roomsCount = rooms.length;<NEW_LINE>int adultsCount = 0;<NEW_LINE>int infantsCount = 0;<NEW_LINE>int childrenCount = 0;<NEW_LINE>for (Room room : rooms) {<NEW_LINE>adultsCount += room.getAdultsCount();<NEW_LINE>int[<MASK><NEW_LINE>if (ageOfChildren == null)<NEW_LINE>continue;<NEW_LINE>for (int age : ageOfChildren) {<NEW_LINE>if (age == AGE_OF_INFANT)<NEW_LINE>infantsCount++;<NEW_LINE>else if (age == AGE_OF_CHILD)<NEW_LINE>childrenCount++;<NEW_LINE>else<NEW_LINE>throw new AssertionError("Unexpected age '" + age + "' detected!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new RoomGuestCounts(roomsCount, adultsCount, childrenCount, infantsCount);<NEW_LINE>} | ] ageOfChildren = room.getAgeOfChildren(); |
1,032,321 | private void okPressed() {<NEW_LINE>if (!jcbDigitalSignature.isSelected() && !jcbNonRepudiation.isSelected() && !jcbKeyEncipherment.isSelected() && !jcbDataEncipherment.isSelected() && !jcbKeyAgreement.isSelected() && !jcbCertificateSigning.isSelected() && !jcbCrlSign.isSelected() && !jcbEncipherOnly.isSelected() && !jcbDecipherOnly.isSelected()) {<NEW_LINE>JOptionPane.showMessageDialog(this, res.getString("DKeyUsage.ValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int keyUsageIntValue = 0;<NEW_LINE>keyUsageIntValue |= jcbDigitalSignature.isSelected() ? KeyUsage.digitalSignature : 0;<NEW_LINE>keyUsageIntValue |= jcbNonRepudiation.isSelected<MASK><NEW_LINE>keyUsageIntValue |= jcbKeyEncipherment.isSelected() ? KeyUsage.keyEncipherment : 0;<NEW_LINE>keyUsageIntValue |= jcbDataEncipherment.isSelected() ? KeyUsage.dataEncipherment : 0;<NEW_LINE>keyUsageIntValue |= jcbKeyAgreement.isSelected() ? KeyUsage.keyAgreement : 0;<NEW_LINE>keyUsageIntValue |= jcbCertificateSigning.isSelected() ? KeyUsage.keyCertSign : 0;<NEW_LINE>keyUsageIntValue |= jcbCrlSign.isSelected() ? KeyUsage.cRLSign : 0;<NEW_LINE>keyUsageIntValue |= jcbEncipherOnly.isSelected() ? KeyUsage.encipherOnly : 0;<NEW_LINE>keyUsageIntValue |= jcbDecipherOnly.isSelected() ? KeyUsage.decipherOnly : 0;<NEW_LINE>KeyUsage keyUsage = new KeyUsage(keyUsageIntValue);<NEW_LINE>try {<NEW_LINE>value = keyUsage.getEncoded(ASN1Encoding.DER);<NEW_LINE>} catch (IOException e) {<NEW_LINE>DError.displayError(this, e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>closeDialog();<NEW_LINE>} | () ? KeyUsage.nonRepudiation : 0; |
1,567,444 | private void assembleShare(Share share, Business business, Wi wi, EffectivePerson effectivePerson) throws Exception {<NEW_LINE>Attachment2 attachment = business.entityManagerContainer().find(wi.getFileId(), Attachment2.class);<NEW_LINE>if (attachment == null) {<NEW_LINE>Folder2 folder = business.entityManagerContainer().find(wi.getFileId(), Folder2.class);<NEW_LINE>if (folder == null) {<NEW_LINE>throw new ExceptionShareNotExist(wi.getFileId());<NEW_LINE>} else {<NEW_LINE>if (!business.controlAble(effectivePerson) && !StringUtils.equals(folder.getPerson(), effectivePerson.getDistinguishedName())) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, folder);<NEW_LINE>}<NEW_LINE>share.setFileType(Share.FILE_TYPE_FOLDER);<NEW_LINE>share.setName(folder.getName());<NEW_LINE>share.setPerson(folder.getPerson());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!business.controlAble(effectivePerson) && !StringUtils.equals(attachment.getPerson(), effectivePerson.getDistinguishedName())) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, attachment);<NEW_LINE>}<NEW_LINE>share.setFileType(Share.FILE_TYPE_ATTACHMENT);<NEW_LINE>share.setName(attachment.getName());<NEW_LINE>share.setLength(attachment.getLength());<NEW_LINE>share.setExtension(attachment.getExtension());<NEW_LINE>share.setPerson(attachment.getPerson());<NEW_LINE>}<NEW_LINE>share.setLastUpdateTime(new Date());<NEW_LINE>if (share.getValidTime() == null) {<NEW_LINE>share.setValidTime(DateTools.getDateAfterYearAdjust(new Date()<MASK><NEW_LINE>}<NEW_LINE>} | , 100, null, null)); |
895,448 | private void defaultHandlers() {<NEW_LINE>handlerMap.putVoid(GdbCommandEchoInterruptEvent.class, this::pushCmdInterrupt);<NEW_LINE>handlerMap.putVoid(GdbCommandEchoEvent.class, this::ignoreCmdEcho);<NEW_LINE>handlerMap.putVoid(GdbConsoleOutputEvent.class, this::processStdOut);<NEW_LINE>handlerMap.putVoid(GdbTargetOutputEvent.class, this::processTargetOut);<NEW_LINE>handlerMap.putVoid(GdbDebugOutputEvent.class, this::processStdErr);<NEW_LINE>handlerMap.putVoid(GdbCommandDoneEvent.class, this::processCommandDone);<NEW_LINE>handlerMap.putVoid(GdbCommandRunningEvent.class, this::processCommandRunning);<NEW_LINE>handlerMap.putVoid(GdbCommandConnectedEvent.class, this::processCommandConnected);<NEW_LINE>handlerMap.putVoid(GdbCommandExitEvent.class, this::processCommandExit);<NEW_LINE>handlerMap.putVoid(GdbCommandErrorEvent.class, this::processCommandError);<NEW_LINE>handlerMap.putVoid(GdbRunningEvent.class, this::processRunning);<NEW_LINE>handlerMap.putVoid(GdbStoppedEvent.class, this::processStopped);<NEW_LINE>handlerMap.putVoid(GdbThreadGroupAddedEvent.class, this::processThreadGroupAdded);<NEW_LINE>handlerMap.putVoid(GdbThreadGroupRemovedEvent.class, this::processThreadGroupRemoved);<NEW_LINE>handlerMap.putVoid(GdbThreadGroupStartedEvent.class, this::processThreadGroupStarted);<NEW_LINE>handlerMap.putVoid(<MASK><NEW_LINE>handlerMap.putVoid(GdbThreadCreatedEvent.class, this::processThreadCreated);<NEW_LINE>handlerMap.putVoid(GdbThreadExitedEvent.class, this::processThreadExited);<NEW_LINE>handlerMap.putVoid(GdbThreadSelectedEvent.class, this::processThreadSelected);<NEW_LINE>handlerMap.putVoid(GdbLibraryLoadedEvent.class, this::processLibraryLoaded);<NEW_LINE>handlerMap.putVoid(GdbLibraryUnloadedEvent.class, this::processLibraryUnloaded);<NEW_LINE>handlerMap.putVoid(GdbBreakpointCreatedEvent.class, this::processBreakpointCreated);<NEW_LINE>handlerMap.putVoid(GdbBreakpointModifiedEvent.class, this::processBreakpointModified);<NEW_LINE>handlerMap.putVoid(GdbBreakpointDeletedEvent.class, this::processBreakpointDeleted);<NEW_LINE>handlerMap.putVoid(GdbMemoryChangedEvent.class, this::processMemoryChanged);<NEW_LINE>handlerMap.putVoid(GdbParamChangedEvent.class, this::processParamChanged);<NEW_LINE>} | GdbThreadGroupExitedEvent.class, this::processThreadGroupExited); |
26,201 | private static boolean implVerify(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte phflag, byte[] m, int mOff, int mLen) {<NEW_LINE>if (!checkContextVar(ctx)) {<NEW_LINE>throw new IllegalArgumentException("ctx");<NEW_LINE>}<NEW_LINE>byte[] R = <MASK><NEW_LINE>byte[] S = copy(sig, sigOff + POINT_BYTES, SCALAR_BYTES);<NEW_LINE>if (!checkPointVar(R)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int[] nS = new int[SCALAR_INTS];<NEW_LINE>if (!checkScalarVar(S, nS)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>PointExt pA = new PointExt();<NEW_LINE>if (!decodePointVar(pk, pkOff, true, pA)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Xof d = createXof();<NEW_LINE>byte[] h = new byte[SCALAR_BYTES * 2];<NEW_LINE>dom4(d, phflag, ctx);<NEW_LINE>d.update(R, 0, POINT_BYTES);<NEW_LINE>d.update(pk, pkOff, POINT_BYTES);<NEW_LINE>d.update(m, mOff, mLen);<NEW_LINE>d.doFinal(h, 0, h.length);<NEW_LINE>byte[] k = reduceScalar(h);<NEW_LINE>int[] nA = new int[SCALAR_INTS];<NEW_LINE>decodeScalar(k, 0, nA);<NEW_LINE>PointExt pR = new PointExt();<NEW_LINE>scalarMultStrausVar(nS, nA, pA, pR);<NEW_LINE>byte[] check = new byte[POINT_BYTES];<NEW_LINE>return 0 != encodePoint(pR, check, 0) && Arrays.areEqual(check, R);<NEW_LINE>} | copy(sig, sigOff, POINT_BYTES); |
59,248 | private static FSRL fromPartString(FSRL containerFile, String partStr) throws MalformedURLException {<NEW_LINE>partStr = partStr.trim();<NEW_LINE>int colonSlashSlash = partStr.indexOf("://");<NEW_LINE>if (colonSlashSlash <= 0) {<NEW_LINE>throw new MalformedURLException("Missing protocol in " + partStr);<NEW_LINE>}<NEW_LINE>String proto = partStr.substring(0, colonSlashSlash);<NEW_LINE>String path = partStr.substring(colonSlashSlash + 3);<NEW_LINE>int paramStart = path.indexOf("?");<NEW_LINE>String md5 = null;<NEW_LINE>if (paramStart >= 0) {<NEW_LINE>String params = path.substring(paramStart + 1);<NEW_LINE>path = path.substring(0, paramStart);<NEW_LINE>Map<String, String> paramMap = getParamMapFromString(params);<NEW_LINE>md5 = <MASK><NEW_LINE>}<NEW_LINE>FSRLRoot fsRoot = FSRLRoot.nestedFS(containerFile, proto);<NEW_LINE>String decodedPath = FSUtilities.escapeDecode(path);<NEW_LINE>decodedPath = decodedPath.replace('\\', '/');<NEW_LINE>if (decodedPath.isEmpty()) {<NEW_LINE>decodedPath = null;<NEW_LINE>}<NEW_LINE>return new FSRL(fsRoot, decodedPath, md5);<NEW_LINE>} | paramMap.get(FSRL.PARAM_MD5); |
1,287,201 | private byte[] readImage() throws IOException {<NEW_LINE>final StringBuffer sb = new StringBuffer();<NEW_LINE>int c;<NEW_LINE>// read http subheader<NEW_LINE>while ((c = input.read()) != -1) {<NEW_LINE>if (c > 0) {<NEW_LINE>sb.append((char) c);<NEW_LINE>if (c == 13) {<NEW_LINE>// '10'+<NEW_LINE>sb.append((char) input.read());<NEW_LINE>c = input.read();<NEW_LINE>sb.append((char) c);<NEW_LINE>if (c == 13) {<NEW_LINE>// '10'<NEW_LINE>sb.append((char) input.read());<NEW_LINE>// done with subheader<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// find embedded jpeg in stream<NEW_LINE>final String subheader = sb<MASK><NEW_LINE>// log.debug(subheader);<NEW_LINE>// Yay! - server was nice and sent content length<NEW_LINE>int c0 = subheader.indexOf("content-length: ");<NEW_LINE>final int c1 = subheader.indexOf('\r', c0);<NEW_LINE>if (c0 < 0) {<NEW_LINE>// log.info("no content length returning null");<NEW_LINE>throw new EOFException("The camera stream ended unexpectedly");<NEW_LINE>}<NEW_LINE>c0 += 16;<NEW_LINE>final int contentLength = Integer.parseInt(subheader.substring(c0, c1).trim());<NEW_LINE>// log.debug("Content-Length: " + contentLength);<NEW_LINE>// adaptive size - careful - don't want a 2G jpeg<NEW_LINE>ensureBufferCapacity(contentLength);<NEW_LINE>input.readFully(pixelBuffer, 0, contentLength);<NEW_LINE>// \r<NEW_LINE>input.read();<NEW_LINE>// \n<NEW_LINE>input.read();<NEW_LINE>// \r<NEW_LINE>input.read();<NEW_LINE>// \n<NEW_LINE>input.read();<NEW_LINE>return pixelBuffer;<NEW_LINE>} | .toString().toLowerCase(); |
574,155 | public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {<NEW_LINE>SceneTransToPointReq req = SceneTransToPointReq.parseFrom(payload);<NEW_LINE>String code = req.getSceneId() + "_" + req.getPointId();<NEW_LINE>ScenePointEntry scenePointEntry = GenshinData.getScenePointEntries().get(code);<NEW_LINE>if (scenePointEntry != null) {<NEW_LINE>float x = scenePointEntry.getPointData().getTranPos().getX();<NEW_LINE>float y = scenePointEntry.getPointData().getTranPos().getY();<NEW_LINE>float z = scenePointEntry.getPointData().getTranPos().getZ();<NEW_LINE>session.getPlayer().getWorld().transferPlayerToScene(session.getPlayer(), req.getSceneId(), new Position(x, y, z));<NEW_LINE>session.send(new PacketSceneTransToPointRsp(session.getPlayer(), req.getPointId()<MASK><NEW_LINE>} else {<NEW_LINE>session.send(new PacketSceneTransToPointRsp());<NEW_LINE>}<NEW_LINE>} | , req.getSceneId())); |
1,251,021 | public static Type discoverFunctionType(Object function, String functionName, GenericApplicationContext applicationContext) {<NEW_LINE>if (function instanceof RoutingFunction) {<NEW_LINE>return FunctionContextUtils.findType(applicationContext.getBeanFactory(), functionName);<NEW_LINE>} else if (function instanceof FunctionRegistration) {<NEW_LINE>return ((FunctionRegistration) function).getType();<NEW_LINE>}<NEW_LINE>if (applicationContext.containsBean(functionName + FunctionRegistration.REGISTRATION_NAME_SUFFIX)) {<NEW_LINE>// for Kotlin primarily<NEW_LINE>FunctionRegistration fr = applicationContext.getBean(functionName + <MASK><NEW_LINE>return fr.getType();<NEW_LINE>}<NEW_LINE>boolean beanDefinitionExists = false;<NEW_LINE>String functionBeanDefinitionName = discoverDefinitionName(functionName, applicationContext);<NEW_LINE>beanDefinitionExists = applicationContext.getBeanFactory().containsBeanDefinition(functionBeanDefinitionName);<NEW_LINE>if (applicationContext.containsBean("&" + functionName)) {<NEW_LINE>Class<?> objectType = applicationContext.getBean("&" + functionName, FactoryBean.class).getObjectType();<NEW_LINE>return FunctionTypeUtils.discoverFunctionTypeFromClass(objectType);<NEW_LINE>}<NEW_LINE>Type type = FunctionTypeUtils.discoverFunctionTypeFromClass(function.getClass());<NEW_LINE>if (beanDefinitionExists) {<NEW_LINE>Type t = FunctionTypeUtils.getImmediateGenericType(type, 0);<NEW_LINE>if (t == null || t == Object.class) {<NEW_LINE>type = FunctionContextUtils.findType(applicationContext.getBeanFactory(), functionBeanDefinitionName);<NEW_LINE>}<NEW_LINE>} else if (!(type instanceof ParameterizedType)) {<NEW_LINE>String beanDefinitionName = discoverBeanDefinitionNameByQualifier(applicationContext.getBeanFactory(), functionName);<NEW_LINE>if (StringUtils.hasText(beanDefinitionName)) {<NEW_LINE>type = FunctionContextUtils.findType(applicationContext.getBeanFactory(), beanDefinitionName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return type;<NEW_LINE>} | FunctionRegistration.REGISTRATION_NAME_SUFFIX, FunctionRegistration.class); |
1,195,190 | public void run() {<NEW_LINE>VCSFileProxy file = null;<NEW_LINE>boolean originalValue = false;<NEW_LINE>// get another file<NEW_LINE>synchronized (refreshedFiles) {<NEW_LINE>Iterator<Entry<VCSFileProxy, Boolean>> it = refreshedFiles.entrySet().iterator();<NEW_LINE>if (it.hasNext()) {<NEW_LINE>Entry<VCSFileProxy, Boolean<MASK><NEW_LINE>file = e.getKey();<NEW_LINE>originalValue = e.getValue();<NEW_LINE>it.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (file == null) {<NEW_LINE>// no files to refresh, finish<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean visible = true;<NEW_LINE>VersioningSystem system = VersioningManager.getInstance().getOwner(file, !file.isDirectory());<NEW_LINE>if (system != null) {<NEW_LINE>VCSVisibilityQuery vqi = system.getVisibilityQuery();<NEW_LINE>if (vqi == null) {<NEW_LINE>visible = true;<NEW_LINE>} else {<NEW_LINE>visible = vqi.isVisible(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronized (cache) {<NEW_LINE>cache.remove(file);<NEW_LINE>if (!visible) {<NEW_LINE>cache.put(file, System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (originalValue != visible) {<NEW_LINE>vsChangedTask.schedule(file);<NEW_LINE>}<NEW_LINE>refreshTask.schedule(0);<NEW_LINE>} | > e = it.next(); |
380,179 | public void execute(JobExecutionContext jobExecutionContext) {<NEW_LINE>ExecutorService executorService = ExecutorUtils.getJobWorkers();<NEW_LINE>ExecutorUtils.printThreadPoolStatus(executorService, "JOB_WORKERS", scheduleLogger);<NEW_LINE>executorService.submit(() -> {<NEW_LINE>TriggerKey triggerKey = jobExecutionContext<MASK><NEW_LINE>ScheduleJob scheduleJob = (ScheduleJob) jobExecutionContext.getMergedJobDataMap().get(QuartzHandler.getJobDataKey(triggerKey));<NEW_LINE>if (scheduleJob == null) {<NEW_LINE>scheduleLogger.warn("ScheduleJob({}) is not found", triggerKey.getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Long id = scheduleJob.getId();<NEW_LINE>if (scheduleJob.getStartDate().getTime() > System.currentTimeMillis() || scheduleJob.getEndDate().getTime() < System.currentTimeMillis()) {<NEW_LINE>Object[] args = { id, DateUtils.toyyyyMMddHHmmss(System.currentTimeMillis()), DateUtils.toyyyyMMddHHmmss(scheduleJob.getStartDate()), DateUtils.toyyyyMMddHHmmss(scheduleJob.getEndDate()), scheduleJob.getCronExpression() };<NEW_LINE>scheduleLogger.warn("ScheduleJob({}), currentTime:{} is not within the planned execution time, startTime:{}, endTime:{}, cronExpression:{}", args);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String jobType = scheduleJob.getJobType().trim();<NEW_LINE>ScheduleService scheduleService = (ScheduleService) SpringContextHolder.getBean(jobType + "ScheduleService");<NEW_LINE>if (StringUtils.isEmpty(jobType) || scheduleService == null) {<NEW_LINE>scheduleLogger.warn("Unknown job type {}, jobId:{}", jobType, scheduleJob.getId());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String lockKey = CheckEntityEnum.CRONJOB.getSource().toUpperCase() + Constants.AT_SYMBOL + id + Constants.AT_SYMBOL + "EXECUTED";<NEW_LINE>if (!LockFactory.getLock(lockKey, 500, LockType.REDIS).getLock()) {<NEW_LINE>scheduleLogger.warn("ScheduleJob({}) has been executed by other instance", id);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>scheduleService.execute(id);<NEW_LINE>} catch (Exception e) {<NEW_LINE>scheduleLogger.error("ScheduleJob({}) execute error:{}", id, e.getMessage());<NEW_LINE>scheduleLogger.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | .getTrigger().getKey(); |
1,176,916 | private void countComponentsInCollectionRecursively(Project project, CollectionDesc.Builder builder, Map<String, Integer> target) throws IOException, CompileExceptionError {<NEW_LINE>for (InstanceDesc inst : builder.getInstancesList()) {<NEW_LINE>IResource res = project.getResource(inst.getPrototype());<NEW_LINE>countComponentInResource(project, res, target);<NEW_LINE>}<NEW_LINE>for (EmbeddedInstanceDesc desc : builder.getEmbeddedInstancesList()) {<NEW_LINE>byte[] data = desc.getData().getBytes();<NEW_LINE>long hash = MurmurHash.hash64(data, data.length);<NEW_LINE>IResource res = <MASK><NEW_LINE>countComponentInResource(project, res, target);<NEW_LINE>}<NEW_LINE>for (CollectionInstanceDesc collInst : builder.getCollectionInstancesList()) {<NEW_LINE>IResource collResource = project.getResource(collInst.getCollection());<NEW_LINE>CollectionDesc.Builder subCollBuilder = CollectionDesc.newBuilder();<NEW_LINE>ProtoUtil.merge(collResource, subCollBuilder);<NEW_LINE>countComponentsInCollectionRecursively(project, subCollBuilder, target);<NEW_LINE>}<NEW_LINE>} | project.getGeneratedResource(hash, "go"); |
312,236 | public void read(org.apache.thrift.protocol.TProtocol prot, RDF_VarTuple struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(1);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.<MASK><NEW_LINE>struct.vars = new java.util.ArrayList<RDF_VAR>(_list5.size);<NEW_LINE>@org.apache.thrift.annotation.Nullable<NEW_LINE>RDF_VAR _elem6;<NEW_LINE>for (int _i7 = 0; _i7 < _list5.size; ++_i7) {<NEW_LINE>_elem6 = new RDF_VAR();<NEW_LINE>_elem6.read(iprot);<NEW_LINE>struct.vars.add(_elem6);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.setVarsIsSet(true);<NEW_LINE>}<NEW_LINE>} | STRUCT, iprot.readI32()); |
373,427 | private JComponent createActionsToolbar() {<NEW_LINE>DefaultActionGroup toolbarGroup = new DefaultActionGroup();<NEW_LINE>toolbarGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.TOOLBAR_ACTION_GROUP));<NEW_LINE>DefaultActionGroup mainGroup = new DefaultActionGroup();<NEW_LINE>mainGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_TEXT_FILTER_SETTINGS_ACTION));<NEW_LINE>mainGroup.add(new AnSeparator());<NEW_LINE>mainGroup.add(myFilterUi.createActionGroup());<NEW_LINE>mainGroup.addSeparator();<NEW_LINE>if (BekUtil.isBekEnabled()) {<NEW_LINE>if (BekUtil.isLinearBekEnabled()) {<NEW_LINE>mainGroup.add(new IntelliSortChooserPopupAction());<NEW_LINE>// can not register both of the actions in xml file, choosing to register an action for the "outer world"<NEW_LINE>// I can of course if linear bek is enabled replace the action on start but why bother<NEW_LINE>} else {<NEW_LINE>mainGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_INTELLI_SORT_ACTION));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mainGroup.add(toolbarGroup);<NEW_LINE>ActionToolbar toolbar = createActionsToolbar(mainGroup);<NEW_LINE>Wrapper textFilter = new Wrapper(myTextFilter);<NEW_LINE>textFilter.setVerticalSizeReferent(toolbar.getComponent());<NEW_LINE>textFilter.setBorder(JBUI.Borders.emptyLeft(5));<NEW_LINE>ActionToolbar settings = createActionsToolbar(new DefaultActionGroup(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_QUICK_SETTINGS_ACTION)));<NEW_LINE>settings.setReservePlaceAutoPopupIcon(false);<NEW_LINE>settings.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY);<NEW_LINE>JPanel panel = new JPanel(new MigLayout<MASK><NEW_LINE>panel.add(textFilter);<NEW_LINE>panel.add(toolbar.getComponent());<NEW_LINE>panel.add(settings.getComponent());<NEW_LINE>return panel;<NEW_LINE>} | ("ins 0, fill", "[left]0[left, fill]push[right]", "center")); |
1,564,968 | public Predicate unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Predicate predicate = new Predicate();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Logical", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>predicate.setLogical(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Conditions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>predicate.setConditions(new ListUnmarshaller<Condition>(ConditionJsonUnmarshaller.getInstance()).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 predicate;<NEW_LINE>} | class).unmarshall(context)); |
1,689,099 | private void insertWord(String word) {<NEW_LINE>try {<NEW_LINE>// remove any currently selected text - this is the default behaviour<NEW_LINE>// of the editor when typing manually<NEW_LINE>int selStart = textComponent.getSelectionStart();<NEW_LINE>int selEnd = textComponent.getSelectionEnd();<NEW_LINE>int selLen = selEnd - selStart;<NEW_LINE>if (selLen > 0) {<NEW_LINE>textComponent.getDocument().remove(selStart, selLen);<NEW_LINE>}<NEW_LINE>int index = getWordIndex();<NEW_LINE>int caretIndex = textComponent.getCaretPosition();<NEW_LINE>if (caretIndex > 0 && caretIndex > index) {<NEW_LINE>textComponent.getDocument().<MASK><NEW_LINE>}<NEW_LINE>textComponent.getDocument().insertString(index, word, null);<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>logger.error("A BadLocationException was thrown when the auto-completer was attempting to insert a word.\n", e);<NEW_LINE>}<NEW_LINE>} | remove(index, caretIndex - index); |
1,332,613 | private List<OrderLineCandidate> execute0() {<NEW_LINE>final ProductId bomProductId = initialCandidate.getProductId();<NEW_LINE>final I_PP_Product_BOM bom = bomRepo.getDefaultBOMByProductId(bomProductId).orElse(null);<NEW_LINE>if (bom == null) {<NEW_LINE>return ImmutableList.of(initialCandidate);<NEW_LINE>}<NEW_LINE>final BOMUse bomUse = BOMUse.ofNullableCode(bom.getBOMUse());<NEW_LINE>if (bomToUse != null && !Objects.equals(bomToUse, bomUse)) {<NEW_LINE>return ImmutableList.of(initialCandidate);<NEW_LINE>}<NEW_LINE>GroupId compensationGroupId = null;<NEW_LINE>final ArrayList<OrderLineCandidate> result = new ArrayList<>();<NEW_LINE>final List<I_PP_Product_BOMLine> bomLines = bomRepo.retrieveLines(bom);<NEW_LINE>for (final I_PP_Product_BOMLine bomLine : bomLines) {<NEW_LINE>final Optional<BOMComponentType> bomLineComponentType = BOMComponentType.optionalOfNullableCode(bomLine.getComponentType());<NEW_LINE>if (bomLineComponentType.isPresent() && !explodeOnlyComponentTypes.contains(bomLineComponentType.get())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final ProductBOMLineId bomLineId = ProductBOMLineId.ofRepoId(bomLine.getPP_Product_BOMLine_ID());<NEW_LINE>final ProductId bomLineProductId = ProductId.ofRepoId(bomLine.getM_Product_ID());<NEW_LINE>final UomId bomUomId = UomId.ofRepoId(bomLine.getC_UOM_ID());<NEW_LINE>final Quantity bomLineQty = Quantitys.create(bomService.computeQtyRequired(bomLine, bomProductId, initialCandidate.getQty()<MASK><NEW_LINE>final AttributeSetInstanceId bomLineAsiId = AttributeSetInstanceId.ofRepoIdOrNone(bomLine.getM_AttributeSetInstance_ID());<NEW_LINE>final ImmutableAttributeSet attributes = asiBL.getImmutableAttributeSetById(bomLineAsiId);<NEW_LINE>if (compensationGroupId == null) {<NEW_LINE>compensationGroupId = orderGroupsRepo.createNewGroupId(GroupCreateRequest.builder().orderId(initialCandidate.getOrderId()).name(productBL.getProductName(bomProductId)).build());<NEW_LINE>}<NEW_LINE>final OrderLineCandidate lineCandidate = initialCandidate.toBuilder().productId(bomLineProductId).attributes(attributes).qty(bomLineQty).compensationGroupId(compensationGroupId).explodedFromBOMLineId(bomLineId).build();<NEW_LINE>result.addAll(// recurse<NEW_LINE>this.toBuilder().initialCandidate(lineCandidate).build().execute0());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | .toBigDecimal()), bomUomId); |
970,198 | public OutputDataConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>OutputDataConfig outputDataConfig = new OutputDataConfig();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("KmsKeyId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>outputDataConfig.setKmsKeyId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("S3Uri", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>outputDataConfig.setS3Uri(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 outputDataConfig;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,247,882 | public int read(byte[] bytes, int off, int len) throws IOException {<NEW_LINE>if (bytes == null)<NEW_LINE>throw new NullPointerException();<NEW_LINE>if (ras != null)<NEW_LINE>return ras.read(bytes, off, len);<NEW_LINE>if (off < 0 || len < 0 || off + len > bytes.length)<NEW_LINE>throw new IndexOutOfBoundsException();<NEW_LINE>if (len == 0)<NEW_LINE>return 0;<NEW_LINE>long l = readUntil(pointer + len);<NEW_LINE>if (l <= pointer)<NEW_LINE>return -1;<NEW_LINE>else {<NEW_LINE>byte[] abyte1 = (byte[]) data.elementAt((int) (pointer >> BLOCK_SHIFT));<NEW_LINE>int k = Math.min(len, BLOCK_SIZE - (int) (pointer & BLOCK_MASK));<NEW_LINE>System.arraycopy(abyte1, (int) (pointer & BLOCK_MASK<MASK><NEW_LINE>pointer += k;<NEW_LINE>return k;<NEW_LINE>}<NEW_LINE>} | ), bytes, off, k); |
1,011,438 | public static String computeConfigRootDocFileName(String configRootClassName, String rootName) {<NEW_LINE>String sanitizedClassName;<NEW_LINE>final Matcher matcher = <MASK><NEW_LINE>if (!matcher.find()) {<NEW_LINE>sanitizedClassName = rootName + Constants.DASH + hyphenate(configRootClassName);<NEW_LINE>} else {<NEW_LINE>String deployment = Constants.DOT + Constants.DEPLOYMENT + Constants.DOT;<NEW_LINE>String runtime = Constants.DOT + Constants.RUNTIME + Constants.DOT;<NEW_LINE>if (configRootClassName.contains(deployment)) {<NEW_LINE>sanitizedClassName = configRootClassName.substring(configRootClassName.indexOf(deployment) + deployment.length());<NEW_LINE>} else if (configRootClassName.contains(runtime)) {<NEW_LINE>sanitizedClassName = configRootClassName.substring(configRootClassName.indexOf(runtime) + runtime.length());<NEW_LINE>} else {<NEW_LINE>sanitizedClassName = configRootClassName.replaceFirst("io.quarkus.", "");<NEW_LINE>}<NEW_LINE>sanitizedClassName = rootName + Constants.DASH + sanitizedClassName;<NEW_LINE>}<NEW_LINE>return hyphenate(sanitizedClassName).replaceAll("[\\.-]+", Constants.DASH) + Constants.ADOC_EXTENSION;<NEW_LINE>} | Constants.PKG_PATTERN.matcher(configRootClassName); |
1,058,294 | protected void doStartRender(String target, Action action, Controller controller, Invocation invocation, boolean[] isHandled) {<NEW_LINE>invocation.invoke();<NEW_LINE>Render render = controller.getRender();<NEW_LINE>if (render instanceof ForwardActionRender) {<NEW_LINE>String actionUrl = ((ForwardActionRender) render).getActionUrl();<NEW_LINE>if (target.equals(actionUrl)) {<NEW_LINE>throw new RuntimeException("The forward action url is the same as before.");<NEW_LINE>} else {<NEW_LINE>handle(actionUrl, controller.getRequest(), controller.getResponse(), isHandled);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (render == null && void.class != action.getMethod().getReturnType() && renderManager.getRenderFactory() instanceof JbootRenderFactory) {<NEW_LINE>JbootRenderFactory factory = (JbootRenderFactory) renderManager.getRenderFactory();<NEW_LINE>JbootReturnValueRender returnValueRender = factory.getReturnValueRender(action, invocation.getReturnValue());<NEW_LINE>String forwardTo = returnValueRender.getForwardTo();<NEW_LINE>if (forwardTo != null) {<NEW_LINE>handle(getRealForwrdTo(forwardTo, target, action), controller.getRequest(), controller.getResponse(), isHandled);<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>render = returnValueRender;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (render == null) {<NEW_LINE>render = renderManager.getRenderFactory().getDefaultRender(action.getViewPath(<MASK><NEW_LINE>}<NEW_LINE>render.setContext(controller.getRequest(), controller.getResponse(), action.getViewPath()).render();<NEW_LINE>}<NEW_LINE>} | ) + action.getMethodName()); |
1,429,897 | public void marshall(HlsGroupSettings hlsGroupSettings, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (hlsGroupSettings == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getAdMarkers(), ADMARKERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getAdditionalManifests(), ADDITIONALMANIFESTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getAudioOnlyHeader(), AUDIOONLYHEADER_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getCaptionLanguageMappings(), CAPTIONLANGUAGEMAPPINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getCaptionLanguageSetting(), CAPTIONLANGUAGESETTING_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getCaptionSegmentLengthControl(), CAPTIONSEGMENTLENGTHCONTROL_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getClientCache(), CLIENTCACHE_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getCodecSpecification(), CODECSPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getDestination(), DESTINATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getDestinationSettings(), DESTINATIONSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getDirectoryStructure(), DIRECTORYSTRUCTURE_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getEncryption(), ENCRYPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getImageBasedTrickPlay(), IMAGEBASEDTRICKPLAY_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getImageBasedTrickPlaySettings(), IMAGEBASEDTRICKPLAYSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getManifestCompression(), MANIFESTCOMPRESSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getManifestDurationFormat(), MANIFESTDURATIONFORMAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getMinFinalSegmentLength(), MINFINALSEGMENTLENGTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getMinSegmentLength(), MINSEGMENTLENGTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getOutputSelection(), OUTPUTSELECTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getProgramDateTime(), PROGRAMDATETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getProgramDateTimePeriod(), PROGRAMDATETIMEPERIOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getSegmentControl(), SEGMENTCONTROL_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getSegmentLength(), SEGMENTLENGTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getSegmentLengthControl(), SEGMENTLENGTHCONTROL_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getSegmentsPerSubdirectory(), SEGMENTSPERSUBDIRECTORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getStreamInfResolution(), STREAMINFRESOLUTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getTargetDurationCompatibilityMode(), TARGETDURATIONCOMPATIBILITYMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getTimedMetadataId3Frame(), TIMEDMETADATAID3FRAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getTimedMetadataId3Period(), TIMEDMETADATAID3PERIOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsGroupSettings.getTimestampDeltaMilliseconds(), TIMESTAMPDELTAMILLISECONDS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | hlsGroupSettings.getBaseUrl(), BASEURL_BINDING); |
1,385,352 | final DescribeMountTargetSecurityGroupsResult executeDescribeMountTargetSecurityGroups(DescribeMountTargetSecurityGroupsRequest describeMountTargetSecurityGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeMountTargetSecurityGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeMountTargetSecurityGroupsRequest> request = null;<NEW_LINE>Response<DescribeMountTargetSecurityGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeMountTargetSecurityGroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeMountTargetSecurityGroupsRequest));<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, "EFS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeMountTargetSecurityGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeMountTargetSecurityGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeMountTargetSecurityGroupsResultJsonUnmarshaller());<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.startEvent(Field.ClientExecuteTime); |
172,965 | public void marshall(CreateDataIntegrationRequest createDataIntegrationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createDataIntegrationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createDataIntegrationRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataIntegrationRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataIntegrationRequest.getKmsKey(), KMSKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataIntegrationRequest.getSourceURI(), SOURCEURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createDataIntegrationRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataIntegrationRequest.getClientToken(), CLIENTTOKEN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createDataIntegrationRequest.getScheduleConfig(), SCHEDULECONFIG_BINDING); |
348,442 | public static Environment createOrGetDefaultEnvironment(PortablePipelineOptions options) {<NEW_LINE>verifyEnvironmentOptions(options);<NEW_LINE>String type = options.getDefaultEnvironmentType();<NEW_LINE>String config = options.getDefaultEnvironmentConfig();<NEW_LINE>Environment defaultEnvironment;<NEW_LINE>if (Strings.isNullOrEmpty(type)) {<NEW_LINE>defaultEnvironment = JAVA_SDK_HARNESS_ENVIRONMENT;<NEW_LINE>} else {<NEW_LINE>switch(type) {<NEW_LINE>case ENVIRONMENT_EMBEDDED:<NEW_LINE>defaultEnvironment = createEmbeddedEnvironment(config);<NEW_LINE>break;<NEW_LINE>case ENVIRONMENT_EXTERNAL:<NEW_LINE>case ENVIRONMENT_LOOPBACK:<NEW_LINE>defaultEnvironment = createExternalEnvironment(getExternalServiceAddress(options));<NEW_LINE>break;<NEW_LINE>case ENVIRONMENT_PROCESS:<NEW_LINE>defaultEnvironment = createProcessEnvironment(options);<NEW_LINE>break;<NEW_LINE>case ENVIRONMENT_DOCKER:<NEW_LINE>default:<NEW_LINE>defaultEnvironment = createDockerEnvironment(getDockerContainerImage(options));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return defaultEnvironment.toBuilder().addAllDependencies(getDeferredArtifacts(options)).addAllCapabilities(<MASK><NEW_LINE>} | getJavaCapabilities()).build(); |
819,789 | public static void nv21ToInterleaved_F32(byte[] dataNV, InterleavedF32 output) {<NEW_LINE>final int yStride = output.width;<NEW_LINE>final int uvStride = output.width / 2;<NEW_LINE>final int startUV = yStride * output.height;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, output.height, row -> {<NEW_LINE>for (int row = 0; row < output.height; row++) {<NEW_LINE>int indexY = row * yStride;<NEW_LINE>int indexUV = startUV + (row / 2) * (2 * uvStride);<NEW_LINE>int indexOut = output<MASK><NEW_LINE>for (int col = 0; col < output.width; col++) {<NEW_LINE>int y = 1191 * ((dataNV[indexY++] & 0xFF) - 16);<NEW_LINE>int cr = (dataNV[indexUV] & 0xFF) - 128;<NEW_LINE>int cb = (dataNV[indexUV + 1] & 0xFF) - 128;<NEW_LINE>// if( y < 0 ) y = 0;<NEW_LINE>y = ((y >>> 31) ^ 1) * y;<NEW_LINE>int r = (y + 1836 * cr) >> 10;<NEW_LINE>int g = (y - 547 * cr - 218 * cb) >> 10;<NEW_LINE>int b = (y + 2165 * cb) >> 10;<NEW_LINE>// if( r < 0 ) r = 0; else if( r > 255 ) r = 255;<NEW_LINE>// if( g < 0 ) g = 0; else if( g > 255 ) g = 255;<NEW_LINE>// if( b < 0 ) b = 0; else if( b > 255 ) b = 255;<NEW_LINE>r *= ((r >>> 31) ^ 1);<NEW_LINE>g *= ((g >>> 31) ^ 1);<NEW_LINE>b *= ((b >>> 31) ^ 1);<NEW_LINE>// The bitwise code below isn't faster than than the if statement below<NEW_LINE>// r |= (((255-r) >>> 31)*0xFF);<NEW_LINE>// g |= (((255-g) >>> 31)*0xFF);<NEW_LINE>// b |= (((255-b) >>> 31)*0xFF);<NEW_LINE>if (r > 255)<NEW_LINE>r = 255;<NEW_LINE>if (g > 255)<NEW_LINE>g = 255;<NEW_LINE>if (b > 255)<NEW_LINE>b = 255;<NEW_LINE>output.data[indexOut++] = r;<NEW_LINE>output.data[indexOut++] = g;<NEW_LINE>output.data[indexOut++] = b;<NEW_LINE>indexUV += 2 * (col & 0x1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | .startIndex + row * output.stride; |
30,347 | // Process HeronDataTuple and insert it into cache<NEW_LINE>protected void copyDataOutBound(int sourceTaskId, boolean isLocalSpout, TopologyAPI.StreamId streamId, HeronTuples.HeronDataTuple tuple, List<Integer> outTasks) {<NEW_LINE>boolean firstIteration = true;<NEW_LINE>boolean isAnchored = tuple.getRootsCount() > 0;<NEW_LINE>for (Integer outTask : outTasks) {<NEW_LINE>long tupleKey = tupleCache.addDataTuple(sourceTaskId, outTask, streamId, tuple, isAnchored);<NEW_LINE>if (isAnchored) {<NEW_LINE>// Anchored tuple<NEW_LINE>if (isLocalSpout) {<NEW_LINE>// This is from a local spout. We need to maintain xors<NEW_LINE>if (firstIteration) {<NEW_LINE>xorManager.create(sourceTaskId, tuple.getRoots(0).getKey(), tupleKey);<NEW_LINE>} else {<NEW_LINE>xorManager.anchor(sourceTaskId, tuple.getRoots(0).getKey(), tupleKey);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Anchored emits from local bolt<NEW_LINE>for (HeronTuples.RootId rootId : tuple.getRootsList()) {<NEW_LINE>HeronTuples.AckTuple t = HeronTuples.AckTuple.newBuilder().addRoots(rootId).<MASK><NEW_LINE>tupleCache.addEmitTuple(sourceTaskId, rootId.getTaskid(), t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>firstIteration = false;<NEW_LINE>}<NEW_LINE>} | setAckedtuple(tupleKey).build(); |
1,064,504 | final ListIPSetsResult executeListIPSets(ListIPSetsRequest listIPSetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listIPSetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListIPSetsRequest> request = null;<NEW_LINE>Response<ListIPSetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListIPSetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listIPSetsRequest));<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, "GuardDuty");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListIPSetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListIPSetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListIPSets"); |
1,599,225 | final ListMeetingTagsResult executeListMeetingTags(ListMeetingTagsRequest listMeetingTagsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listMeetingTagsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListMeetingTagsRequest> request = null;<NEW_LINE>Response<ListMeetingTagsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListMeetingTagsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listMeetingTagsRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListMeetingTags");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListMeetingTagsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListMeetingTagsResultJsonUnmarshaller());<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.startEvent(Field.RequestMarshallTime); |
1,303,640 | public void execute(AdminCommandContext adminCommandContext) {<NEW_LINE>Node node = nodes.getNode(nodeName);<NEW_LINE>Server server = servers.getServer(instanceName);<NEW_LINE>Client client = ClientBuilder.newClient();<NEW_LINE>WebTarget webTarget;<NEW_LINE>if (Boolean.valueOf(node.getUseTls())) {<NEW_LINE>webTarget = client.target("https://" + node.getNodeHost() + ":" + node.getDockerPort() + "/containers/" + <MASK><NEW_LINE>} else {<NEW_LINE>webTarget = client.target("http://" + node.getNodeHost() + ":" + node.getDockerPort() + "/containers/" + server.getDockerContainerId() + "/stop");<NEW_LINE>}<NEW_LINE>// Send the POST request<NEW_LINE>Response response = webTarget.request(MediaType.APPLICATION_JSON).post(Entity.entity(Json.createObjectBuilder().build(), MediaType.APPLICATION_JSON));<NEW_LINE>// Check status of response and act on result, ignoring 304 (NOT MODIFIED)<NEW_LINE>Response.StatusType responseStatus = response.getStatusInfo();<NEW_LINE>if (!responseStatus.getFamily().equals(Response.Status.Family.SUCCESSFUL) && responseStatus.getStatusCode() != Response.Status.NOT_MODIFIED.getStatusCode()) {<NEW_LINE>adminCommandContext.getActionReport().failure(adminCommandContext.getLogger(), "Failed to stop Docker Container: \n" + responseStatus.getReasonPhrase());<NEW_LINE>}<NEW_LINE>} | server.getDockerContainerId() + "/stop"); |
208,516 | private void updateApplicationWithJobStatusCV(Application app, JobStatusCV jobStatus) {<NEW_LINE>// infer the final flink job state<NEW_LINE>Enumeration.Value state = jobStatus.jobState();<NEW_LINE>Enumeration.Value preState = toK8sFlinkJobState(FlinkAppState.of<MASK><NEW_LINE>state = FlinkJobStatusWatcher.inferFlinkJobStateFromPersist(state, preState);<NEW_LINE>app.setState(fromK8sFlinkJobState(state).getValue());<NEW_LINE>// update relevant fields of Application from JobStatusCV<NEW_LINE>app.setJobId(jobStatus.jobId());<NEW_LINE>app.setTotalTask(jobStatus.taskTotal());<NEW_LINE>if (FlinkJobState.isEndState(state)) {<NEW_LINE>app.setOptionState(OptionState.NONE.getValue());<NEW_LINE>}<NEW_LINE>// corrective start-time / end-time / duration<NEW_LINE>long preStartTime = app.getStartTime() != null ? app.getStartTime().getTime() : 0;<NEW_LINE>long startTime = Math.max(jobStatus.jobStartTime(), preStartTime);<NEW_LINE>long preEndTime = app.getEndTime() != null ? app.getEndTime().getTime() : 0;<NEW_LINE>long endTime = Math.max(jobStatus.jobEndTime(), preEndTime);<NEW_LINE>long duration = jobStatus.duration();<NEW_LINE>if (FlinkJobState.isEndState(state)) {<NEW_LINE>if (endTime < startTime) {<NEW_LINE>endTime = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>if (duration <= 0) {<NEW_LINE>duration = endTime - startTime;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>app.setStartTime(new Date(startTime > 0 ? startTime : 0));<NEW_LINE>app.setEndTime(endTime > 0 && endTime >= startTime ? new Date(endTime) : null);<NEW_LINE>app.setDuration(duration > 0 ? duration : 0);<NEW_LINE>} | (app.getState())); |
690,016 | private String coverage(RandomNumberGenerator rand, String personID, long start, long stop, String payerId, String type, UUID groupId, String groupName, String name, String planId) throws IOException {<NEW_LINE>StringBuilder s = new StringBuilder();<NEW_LINE>String coverageID = rand.randUUID().toString();<NEW_LINE>s.append(coverageID).append(',');<NEW_LINE>s.append(personID).append(',');<NEW_LINE>s.append(personID).append(',');<NEW_LINE>s.append('0').append(',');<NEW_LINE>s.append(type).append(',');<NEW_LINE>if (stop != 0L) {<NEW_LINE>s.append("inactive").append(',');<NEW_LINE>} else {<NEW_LINE>s.append("active").append(',');<NEW_LINE>}<NEW_LINE>s.append(dateFromTimestamp(<MASK><NEW_LINE>if (stop != 0L) {<NEW_LINE>s.append(dateFromTimestamp(stop));<NEW_LINE>}<NEW_LINE>s.append(',');<NEW_LINE>s.append(groupId).append(',');<NEW_LINE>s.append(groupName).append(',');<NEW_LINE>s.append(planId).append(',');<NEW_LINE>s.append(name).append(',');<NEW_LINE>s.append(payerId).append(',');<NEW_LINE>s.append(payerId).append(',');<NEW_LINE>s.append("self");<NEW_LINE>s.append(NEWLINE);<NEW_LINE>write(s.toString(), coverages);<NEW_LINE>return coverageID;<NEW_LINE>} | start)).append(','); |
374,953 | private void write(MinimalVirtualObject object) throws IOException {<NEW_LINE>if (object.eClass().getEAnnotation("wrapped") != null) {<NEW_LINE>EStructuralFeature wrappedFeature = object.eClass().getEStructuralFeature("wrappedValue");<NEW_LINE>print("{");<NEW_LINE>print("\"_t\":\"" + object.eClass().getName() + "\",");<NEW_LINE>print("\"_v\":");<NEW_LINE>Object wrappedValue = object.eGet(wrappedFeature);<NEW_LINE>if (wrappedValue instanceof List) {<NEW_LINE>print("[");<NEW_LINE>List<?> list = (List<?>) wrappedValue;<NEW_LINE>boolean f = true;<NEW_LINE>for (Object o : list) {<NEW_LINE>if (!f) {<NEW_LINE>print(", ");<NEW_LINE>}<NEW_LINE>f = false;<NEW_LINE>writePrimitive(wrappedFeature, o);<NEW_LINE>}<NEW_LINE>print("]");<NEW_LINE>} else {<NEW_LINE>writePrimitive(wrappedFeature, wrappedValue);<NEW_LINE>}<NEW_LINE>print("}");<NEW_LINE>} else if (object instanceof HashMapVirtualObject) {<NEW_LINE>EStructuralFeature eStructuralFeature = object.eClass().getEStructuralFeature("List");<NEW_LINE>if (eStructuralFeature != null) {<NEW_LINE>print("[");<NEW_LINE>List<?> l = (List<?>) object.eGet(eStructuralFeature);<NEW_LINE>boolean f = true;<NEW_LINE>for (Object o : l) {<NEW_LINE>if (!f) {<NEW_LINE>print(", ");<NEW_LINE>}<NEW_LINE>f = false;<NEW_LINE>if (eStructuralFeature instanceof EReference) {<NEW_LINE>if (o instanceof Long) {<NEW_LINE>long ref = (Long) o;<NEW_LINE>print("{\"_r\":" + ref + ",\"_t\":\"" + objectProvider.getEClassForOid(ref).getName() + "\"}");<NEW_LINE>} else {<NEW_LINE>writeWrapper((MinimalVirtualObject) o);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>print("]");<NEW_LINE>} else {<NEW_LINE>print("" + ((HashMapVirtualObject) object).getOid());<NEW_LINE>}<NEW_LINE>} else if (object instanceof HashMapWrappedVirtualObject) {<NEW_LINE>writeWrapper(object);<NEW_LINE>}<NEW_LINE>} | print(o.toString()); |
1,510,315 | public static void main(String[] args) {<NEW_LINE>// Create a section file.<NEW_LINE>Report rep = new ErrReport();<NEW_LINE>DuckContext duck = new DuckContext(rep);<NEW_LINE>SectionFile file1 = new SectionFile(duck);<NEW_LINE>// Loading inline XML table.<NEW_LINE>file1.loadXML("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<tsduck>\n" + " <PAT transport_stream_id=\"10\">\n" + <MASK><NEW_LINE>// Convert to binary.<NEW_LINE>byte[] data = file1.toBinary();<NEW_LINE>System.out.println("---- Binary content ----");<NEW_LINE>System.out.println(SampleUtils.bytesToHex(data));<NEW_LINE>System.out.println();<NEW_LINE>// Build another section file and load the binary data.<NEW_LINE>SectionFile file2 = new SectionFile(duck);<NEW_LINE>file2.fromBinary(data);<NEW_LINE>// Convert the second section file to XML.<NEW_LINE>System.out.println("---- XML content ----");<NEW_LINE>System.out.println(file2.toXML());<NEW_LINE>// Deallocate C++ resources (in reverse order from creation).<NEW_LINE>file2.delete();<NEW_LINE>file1.delete();<NEW_LINE>rep.delete();<NEW_LINE>duck.delete();<NEW_LINE>} | " <service service_id=\"1\" program_map_PID=\"100\"/>\n" + " <service service_id=\"2\" program_map_PID=\"200\"/>\n" + " </PAT>\n" + "</tsduck>"); |
591,467 | private void drawIcon(Graphics graphics) {<NEW_LINE>if (!isIconVisible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>graphics.pushState();<NEW_LINE>graphics.setLineWidth(1);<NEW_LINE>graphics.setForegroundColor(isEnabled() ? ColorConstants.black : ColorConstants.gray);<NEW_LINE>graphics.setBackgroundColor(isEnabled() ? ColorConstants.black : ColorConstants.gray);<NEW_LINE>Point pt = getIconOrigin();<NEW_LINE>graphics.drawRoundRectangle(new Rectangle(pt.x, pt.y, 12, 14), 4, 4);<NEW_LINE>Path path = new Path(null);<NEW_LINE>path.moveTo(pt.x + 5.5f, pt.y + 2);<NEW_LINE>path.lineTo(pt.x + 5.5f, pt.y + 9);<NEW_LINE>path.moveTo(pt.x + 6.5f, pt.y + 2);<NEW_LINE>path.lineTo(pt.x + 6.5f, pt.y + 9);<NEW_LINE>path.moveTo(pt.x + <MASK><NEW_LINE>path.lineTo(pt.x + 5.5f, pt.y + 12.5f);<NEW_LINE>path.moveTo(pt.x + 6.5f, pt.y + 10.5f);<NEW_LINE>path.lineTo(pt.x + 6.5f, pt.y + 12.5f);<NEW_LINE>graphics.drawPath(path);<NEW_LINE>path.dispose();<NEW_LINE>graphics.popState();<NEW_LINE>} | 5.5f, pt.y + 10.5f); |
316,844 | public void layoutContainer(Container parent) {<NEW_LINE>int maxWidth = 0;<NEW_LINE>for (JLabel label : labelMap.values()) {<NEW_LINE>int labelPrefWidth = label.getPreferredSize().width;<NEW_LINE>if (labelPrefWidth > maxWidth) {<NEW_LINE>maxWidth = labelPrefWidth;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Insets insets = parent.getInsets();<NEW_LINE>int curY = 0;<NEW_LINE>int curX = 0;<NEW_LINE>int maxY = parent.getHeight();<NEW_LINE>int maxCompWidth = parent.getWidth() - maxWidth - insets.left - insets.right - GUTTER_WIDTH;<NEW_LINE>curY = insets.top;<NEW_LINE>curX = insets.left;<NEW_LINE>maxY = maxY - insets.bottom;<NEW_LINE>for (Component c : compList) {<NEW_LINE>if (!(c instanceof PreferencesPanel)) {<NEW_LINE>JLabel label = labelMap.get(c);<NEW_LINE>if (label != null) {<NEW_LINE>Dimension labelPrefSize = label.getPreferredSize();<NEW_LINE>label.setSize(labelPrefSize);<NEW_LINE>label.setLocation(curX + maxWidth - labelPrefSize.width, curY + 2);<NEW_LINE>}<NEW_LINE>Dimension prefCompSize = c.getPreferredSize();<NEW_LINE>c.setSize(prefCompSize.width < maxCompWidth ? prefCompSize.width : maxCompWidth, prefCompSize.height);<NEW_LINE>c.setLocation(curX + maxWidth + GUTTER_WIDTH, curY);<NEW_LINE>curY = curY + prefCompSize.height + ROW_MARGIN;<NEW_LINE>} else {<NEW_LINE>c.setLocation(curX, curY);<NEW_LINE><MASK><NEW_LINE>c.setSize(parent.getWidth(), prefSize.height);<NEW_LINE>curY = curY + prefSize.height + ROW_MARGIN;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Dimension prefSize = c.getPreferredSize(); |
1,660,022 | boolean ensureAvailableSpaceUsed(boolean useCached) {<NEW_LINE>if (mdl.size() == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean result = false;<NEW_LINE>if (changed && !useCached) {<NEW_LINE>result = true;<NEW_LINE>change();<NEW_LINE>}<NEW_LINE>int last = mdl.size() - 1;<NEW_LINE>int lastTab = useCached ? getCachedLastVisibleTab() : getLastVisibleTab(width);<NEW_LINE>if (lastTab == last || lastTab == mdl.size() && last > -1) {<NEW_LINE>// one has been removed<NEW_LINE>int off = offset;<NEW_LINE>int availableWidth = width - (getX(<MASK><NEW_LINE>while (availableWidth > 0 && off > -1) {<NEW_LINE>availableWidth -= getWrapped().getW(off);<NEW_LINE>if (availableWidth > 0) {<NEW_LINE>off--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setOffset(off);<NEW_LINE>if (changed) {<NEW_LINE>result = true;<NEW_LINE>change();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | last) + getW(last)); |
953,317 | private void addHolderNameAndId() {<NEW_LINE>Tuple2<InputTextField, InputTextField> tuple = addInputTextFieldInputTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), BankUtil.getHolderIdLabel(""));<NEW_LINE>holderNameInputTextField = tuple.first;<NEW_LINE>holderNameInputTextField.setMinWidth(250);<NEW_LINE>holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {<NEW_LINE>bankAccountPayload.setHolderName(newValue.trim());<NEW_LINE>updateFromInputs();<NEW_LINE>});<NEW_LINE>holderNameInputTextField.minWidthProperty().<MASK><NEW_LINE>holderNameInputTextField.setValidator(inputValidator);<NEW_LINE>useHolderID = true;<NEW_LINE>holderIdInputTextField = tuple.second;<NEW_LINE>holderIdInputTextField.setVisible(false);<NEW_LINE>holderIdInputTextField.setManaged(false);<NEW_LINE>holderIdInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {<NEW_LINE>bankAccountPayload.setHolderTaxId(newValue);<NEW_LINE>updateFromInputs();<NEW_LINE>});<NEW_LINE>} | bind(currencyComboBox.widthProperty()); |
850,196 | public void addHeaders(ContainerRequestContext requestContext, ContainerResponseContext responseContext) {<NEW_LINE>if (options != null && options.isSkipHeaders()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MediaType requestType = requestContext.getMediaType();<NEW_LINE><MASK><NEW_LINE>MultivaluedMap<String, Object> headers = responseContext.getHeaders();<NEW_LINE>if (responseType == null && !isEmptyMediaTypeAllowed(requestContext, responseContext)) {<NEW_LINE>LOGGER.errorv("MediaType not set on path {0}, with response status {1}", session.getContext().getUri().getRequestUri().getPath(), responseContext.getStatus());<NEW_LINE>throw new InternalServerErrorException();<NEW_LINE>}<NEW_LINE>if (isRest(requestType, responseType)) {<NEW_LINE>addRestHeaders(headers);<NEW_LINE>} else if (isHtml(requestType, responseType)) {<NEW_LINE>addHtmlHeaders(headers);<NEW_LINE>} else {<NEW_LINE>addGenericHeaders(headers);<NEW_LINE>}<NEW_LINE>} | MediaType responseType = responseContext.getMediaType(); |
1,211,299 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>unbinder = ButterKnife.bind(this);<NEW_LINE>toolbar.setTitle("Mosby MVI");<NEW_LINE>toolbar.inflateMenu(R.menu.activity_main_toolbar);<NEW_LINE>toolbar.setOnMenuItemClickListener(item -> {<NEW_LINE>getSupportFragmentManager().beginTransaction().setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out, android.R.anim.fade_in, android.R.anim.fade_out).add(R.id.drawerLayout, new SearchFragment()).addToBackStack("Search").commit();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);<NEW_LINE>drawer.addDrawerListener(toggle);<NEW_LINE>toggle.syncState();<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>showCategoryItems(MainMenuItem.HOME);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>toolbar.setTitle(title);<NEW_LINE>}<NEW_LINE>// TODO Create a Presenter & ViewState for this Activity<NEW_LINE>DependencyInjection dependencyInjection = SampleApplication.getDependencyInjection(this);<NEW_LINE>disposable = dependencyInjection.getMainMenuPresenter().getViewStateObservable().filter(state -> state instanceof MenuViewState.DataState).cast(MenuViewState.DataState.class).map(this::findSelectedMenuItem).subscribe(this::showCategoryItems);<NEW_LINE>clearSelectionRelay = dependencyInjection.getClearSelectionRelay();<NEW_LINE>} | title = savedInstanceState.getString(KEY_TOOLBAR_TITLE); |
1,327,114 | public Tree transformTree(Tree tree) {<NEW_LINE>Label l = tree.label();<NEW_LINE>if (tree.isLeaf()) {<NEW_LINE>return tf.newLeaf(l);<NEW_LINE>}<NEW_LINE>String s = l.value();<NEW_LINE>s = tlpp.treebankLanguagePack().basicCategory(s);<NEW_LINE>if (deletePunct) {<NEW_LINE>// this is broken as it's not the right thing to do when there<NEW_LINE>// is any tag ambiguity -- and there is for ' (POS/''). Sentences<NEW_LINE>// can then have more or less words. It's also unnecessary for EVALB,<NEW_LINE>// since it ignores punctuation anyway<NEW_LINE>if (tree.isPreTerminal() && tlpp.treebankLanguagePack().isEvalBIgnoredPunctuationTag(s)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TEMPORARY: eliminate the TOPP constituent<NEW_LINE>if (tree.children()[0].label().value().equals("TOPP")) {<NEW_LINE>log.info("Found a TOPP");<NEW_LINE>tree.setChildren(tree.children()[0].children());<NEW_LINE>}<NEW_LINE>// Negra has lots of non-unary roots; delete unary roots<NEW_LINE>if (tlpp.treebankLanguagePack().isStartSymbol(s) && tree.numChildren() == 1) {<NEW_LINE>// NB: This deletes the boundary symbol, which is in the tree!<NEW_LINE>return transformTree(tree.getChild(0));<NEW_LINE>}<NEW_LINE>List<Tree> <MASK><NEW_LINE>for (int cNum = 0, numC = tree.numChildren(); cNum < numC; cNum++) {<NEW_LINE>Tree child = tree.getChild(cNum);<NEW_LINE>Tree newChild = transformTree(child);<NEW_LINE>if (newChild != null) {<NEW_LINE>children.add(newChild);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (children.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return tf.newTreeNode(new StringLabel(s), children);<NEW_LINE>} | children = new ArrayList<>(); |
1,259,388 | public static void convolve(Kernel2D_S32 kernel, InterleavedS32 input, InterleavedS32 output) {<NEW_LINE>final int offset = kernel.getOffset();<NEW_LINE>final int width = input.getWidth();<NEW_LINE>final int height = input.getHeight();<NEW_LINE>final int numBands = input.getNumBands();<NEW_LINE>final int[] pixel = new int[numBands];<NEW_LINE>final int[] total = new int[numBands];<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>int startX = x - offset;<NEW_LINE>int endX <MASK><NEW_LINE>if (startX < 0)<NEW_LINE>startX = 0;<NEW_LINE>if (endX > width)<NEW_LINE>endX = width;<NEW_LINE>int startY = y - offset;<NEW_LINE>int endY = startY + kernel.getWidth();<NEW_LINE>if (startY < 0)<NEW_LINE>startY = 0;<NEW_LINE>if (endY > height)<NEW_LINE>endY = height;<NEW_LINE>Arrays.fill(total, 0);<NEW_LINE>int weight = 0;<NEW_LINE>for (int i = startY; i < endY; i++) {<NEW_LINE>for (int j = startX; j < endX; j++) {<NEW_LINE>input.get(j, i, pixel);<NEW_LINE>int v = kernel.get(j - x + offset, i - y + offset);<NEW_LINE>for (int band = 0; band < numBands; band++) {<NEW_LINE>total[band] += pixel[band] * v;<NEW_LINE>}<NEW_LINE>weight += v;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int band = 0; band < numBands; band++) {<NEW_LINE>total[band] = (total[band] + weight / 2) / weight;<NEW_LINE>}<NEW_LINE>output.set(x, y, total);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = startX + kernel.getWidth(); |
1,535,226 | public void run() {<NEW_LINE>Map<NodePortTuple, PortDesc> portDesc = new HashMap<>();<NEW_LINE>if (statisticsService != null) {<NEW_LINE>statisticsService.collectStatistics(true);<NEW_LINE>portDesc = statisticsService.getPortDesc();<NEW_LINE>if (vips != null && monitors != null && members != null && pools != null) {<NEW_LINE>for (LBMonitor monitor : monitors.values()) {<NEW_LINE>if (monitor.poolId != null && pools.get(monitor.poolId) != null) {<NEW_LINE>LBPool pool = pools.get(monitor.poolId);<NEW_LINE>collectSwitchPortBandwidth(pool);<NEW_LINE>if (pool.vipId != null && vips.containsKey(pool.vipId) && !memberIdToSwitchPort.isEmpty()) {<NEW_LINE>for (NodePortTuple allNpts : portDesc.keySet()) {<NEW_LINE>for (String memberId : pool.members) {<NEW_LINE>SwitchPort sp = memberIdToSwitchPort.get(memberId);<NEW_LINE>if (sp != null) {<NEW_LINE>NodePortTuple memberNpt = new NodePortTuple(sp.getNodeId(), sp.getPortId());<NEW_LINE>if (portDesc.get(allNpts).isUp()) {<NEW_LINE>if (memberNpt.equals(allNpts)) {<NEW_LINE>members.get(memberId).status = 0;<NEW_LINE>vipMembersHealthCheck(memberNpt, members.get(memberId).macString, IPv4Address.of(members.get(memberId).address), monitor.type, pool.vipId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (memberNpt.equals(allNpts)) {<NEW_LINE>members.get<MASK><NEW_LINE>log.warn("Member " + memberId + " has been determined inactive by the health monitor");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (memberId).status = -1; |
1,772,546 | private void addTravertineEnrichingRecipes(Consumer<FinishedRecipe> consumer, String basePath) {<NEW_LINE>// Travertine -> Polished Travertine<NEW_LINE>enriching(consumer, BYGBlocks.TRAVERTINE, <MASK><NEW_LINE>enriching(consumer, BYGBlocks.TRAVERTINE_SLAB, BYGBlocks.POLISHED_TRAVERTINE_SLAB, basePath + "slabs_to_polished_slabs");<NEW_LINE>enriching(consumer, BYGBlocks.TRAVERTINE_STAIRS, BYGBlocks.POLISHED_TRAVERTINE_STAIRS, basePath + "stairs_to_polished_stairs");<NEW_LINE>enriching(consumer, BYGBlocks.TRAVERTINE_WALL, BYGBlocks.POLISHED_TRAVERTINE_WALL, basePath + "walls_to_polished_walls");<NEW_LINE>// Polished Travertine -> Chiseled Travertine<NEW_LINE>enriching(consumer, BYGBlocks.POLISHED_TRAVERTINE, BYGBlocks.CHISELED_TRAVERTINE, basePath + "polished_to_chiseled");<NEW_LINE>enriching(consumer, BYGBlocks.POLISHED_TRAVERTINE_SLAB, BYGBlocks.CHISELED_TRAVERTINE_SLAB, basePath + "polished_slabs_to_chiseled_slabs");<NEW_LINE>enriching(consumer, BYGBlocks.POLISHED_TRAVERTINE_STAIRS, BYGBlocks.CHISELED_TRAVERTINE_STAIRS, basePath + "polished_stairs_to_chiseled_stairs");<NEW_LINE>enriching(consumer, BYGBlocks.POLISHED_TRAVERTINE_WALL, BYGBlocks.CHISELED_TRAVERTINE_WALL, basePath + "polished_walls_to_chiseled_walls");<NEW_LINE>} | BYGBlocks.POLISHED_TRAVERTINE, basePath + "to_polished"); |
549,983 | public Map<String, ? extends MethodSymbol> methods() {<NEW_LINE>if (methods != null) {<NEW_LINE>return this.methods;<NEW_LINE>}<NEW_LINE>BServiceSymbol symbol = (BServiceSymbol) getInternalSymbol();<NEW_LINE>BClassSymbol classSymbol = symbol.getAssociatedClassSymbol();<NEW_LINE>SymbolFactory symbolFactory = <MASK><NEW_LINE>Map<String, MethodSymbol> methods = new LinkedHashMap<>();<NEW_LINE>for (BAttachedFunction method : classSymbol.attachedFuncs) {<NEW_LINE>if (method instanceof BResourceFunction) {<NEW_LINE>BResourceFunction resFn = (BResourceFunction) method;<NEW_LINE>StringJoiner stringJoiner = new StringJoiner("/");<NEW_LINE>for (Name name : resFn.resourcePath) {<NEW_LINE>stringJoiner.add(name.value);<NEW_LINE>}<NEW_LINE>methods.put(resFn.accessor.value + " " + stringJoiner.toString(), symbolFactory.createResourceMethodSymbol(method.symbol));<NEW_LINE>} else {<NEW_LINE>methods.put(method.funcName.value, symbolFactory.createMethodSymbol(method.symbol, method.symbol.getOriginalName().value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.methods = Collections.unmodifiableMap(methods);<NEW_LINE>return this.methods;<NEW_LINE>} | SymbolFactory.getInstance(this.context); |
587,245 | private static String keyToStringV2(Object key, URLEscaper.Escaping escaping, UriComponent.Type componentType, boolean full) {<NEW_LINE>if (key == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (key instanceof ComplexResourceKey) {<NEW_LINE>Object convertedKey;<NEW_LINE>ComplexResourceKey<?, ?> complexResourceKey = (ComplexResourceKey<?, ?>) key;<NEW_LINE>if (full) {<NEW_LINE>convertedKey = complexResourceKey.toDataMap();<NEW_LINE>} else {<NEW_LINE>convertedKey = complexResourceKey.getKey().data();<NEW_LINE>}<NEW_LINE>return URIParamUtils.encodeElement(convertedKey, escaping, componentType);<NEW_LINE>} else if (key instanceof CompoundKey) {<NEW_LINE>return URIParamUtils.encodeElement(URIParamUtils.compoundKeyToDataMap((CompoundKey<MASK><NEW_LINE>} else {<NEW_LINE>return simpleKeyToStringV2(key, escaping, componentType);<NEW_LINE>}<NEW_LINE>} | ) key), escaping, componentType); |
1,575,514 | public static void main(String[] args) {<NEW_LINE>Webcam w = Webcam.getDefault();<NEW_LINE>w.open(true);<NEW_LINE>Vector<BufferedImage> images = new Vector<BufferedImage>();<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < 100; i++) {<NEW_LINE>images.add(w.getImage());<NEW_LINE>try {<NEW_LINE>Thread.sleep(100);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>w.close();<NEW_LINE>System.out.println("play");<NEW_LINE>PlayerPanel panel = new PlayerPanel(images);<NEW_LINE>JFrame f = new JFrame("Take pictures and play example");<NEW_LINE>f.add(panel);<NEW_LINE>f.pack();<NEW_LINE>f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<NEW_LINE>f.setVisible(true);<NEW_LINE>panel.play();<NEW_LINE>try {<NEW_LINE>Thread.sleep(100 * images.size());<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} | System.out.println("recording, please wait"); |
1,516,123 | public InnerLiteral extractInnerLiteral() {<NEW_LINE>assert properties.hasInnerLiteral();<NEW_LINE>int literalEnd = properties.getInnerLiteralEnd();<NEW_LINE>int literalStart = properties.getInnerLiteralStart();<NEW_LINE>AbstractStringBuffer literal = getEncoding().createStringBuffer(literalEnd - literalStart);<NEW_LINE>AbstractStringBuffer mask = getEncoding().createStringBuffer(literalEnd - literalStart);<NEW_LINE>boolean hasMask = false;<NEW_LINE>for (int i = literalStart; i < literalEnd; i++) {<NEW_LINE>CharacterClass cc = root.getFirstAlternative().getTerms().get(i).asCharacterClass();<NEW_LINE>assert cc.getCharSet().matchesSingleChar() || cc<MASK><NEW_LINE>assert getEncoding().isFixedCodePointWidth(cc.getCharSet());<NEW_LINE>cc.extractSingleChar(literal, mask);<NEW_LINE>hasMask |= cc.getCharSet().matches2CharsWith1BitDifference();<NEW_LINE>}<NEW_LINE>return new InnerLiteral(literal.materialize(), hasMask ? mask.materialize() : null, root.getFirstAlternative().get(literalStart).getMaxPath() - 1);<NEW_LINE>} | .getCharSet().matches2CharsWith1BitDifference(); |
1,541,432 | private void enforceChildDistribution(DistributionSpec distributionSpec, GroupExpression child, PhysicalPropertySet childOutputProperty) {<NEW_LINE>double childCosts = child.getCost(childOutputProperty);<NEW_LINE>Group childGroup = child.getGroup();<NEW_LINE>if (child.getOp() instanceof PhysicalDistributionOperator) {<NEW_LINE>DistributionProperty newDistributionProperty = new DistributionProperty(distributionSpec);<NEW_LINE>PhysicalPropertySet newOutputProperty = new PhysicalPropertySet(newDistributionProperty);<NEW_LINE>GroupExpression enforcer = newDistributionProperty.appendEnforcers(childGroup);<NEW_LINE>enforcer.setOutputPropertySatisfyRequiredProperty(newOutputProperty, newOutputProperty);<NEW_LINE>context.getMemo().insertEnforceExpression(enforcer, childGroup);<NEW_LINE>enforcer.updatePropertyWithCost(newOutputProperty, child.getInputProperties(childOutputProperty), childCosts);<NEW_LINE>childGroup.<MASK><NEW_LINE>if (ConnectContext.get().getSessionVariable().isSetUseNthExecPlan()) {<NEW_LINE>enforcer.addValidOutputInputProperties(newOutputProperty, Lists.newArrayList(PhysicalPropertySet.EMPTY));<NEW_LINE>enforcer.getGroup().addSatisfyRequiredPropertyGroupExpression(newOutputProperty, enforcer);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// add physical distribution operator<NEW_LINE>addChildEnforcer(childOutputProperty, new DistributionProperty(distributionSpec), childCosts, child.getGroup());<NEW_LINE>}<NEW_LINE>} | setBestExpression(enforcer, childCosts, newOutputProperty); |
652,660 | public void visitFilterMapping(WebAppContext context, Descriptor descriptor, XmlParser.Node node) {<NEW_LINE>// Servlet Spec 3.0, p74<NEW_LINE>// filter-mappings are always additive, whether from web xml descriptors (web.xml/web-default.xml/web-override.xml) or web-fragments.<NEW_LINE>// Maintenance update 3.0a to spec:<NEW_LINE>// Updated 8.2.3.g.v to say <servlet-mapping> elements are additive across web-fragments.<NEW_LINE>String filterName = node.getString("filter-name", false, true);<NEW_LINE>Origin origin = context.getMetaData().getOrigin(filterName + ".filter.mappings");<NEW_LINE>switch(origin) {<NEW_LINE>case NotSet:<NEW_LINE>{<NEW_LINE>// no filtermappings for this filter yet defined<NEW_LINE>context.getMetaData().setOrigin(filterName + ".filter.mappings", descriptor);<NEW_LINE>addFilterMapping(filterName, node, context, descriptor);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case WebDefaults:<NEW_LINE>case WebOverride:<NEW_LINE>case WebXml:<NEW_LINE>{<NEW_LINE>// filter mappings defined in a web xml file. If we're processing a fragment, we ignore filter mappings.<NEW_LINE>if (!(descriptor instanceof FragmentDescriptor)) {<NEW_LINE>addFilterMapping(<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case WebFragment:<NEW_LINE>{<NEW_LINE>// filter mappings first defined in a web-fragment, allow other fragments to add<NEW_LINE>addFilterMapping(filterName, node, context, descriptor);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>unknownOrigin(origin);<NEW_LINE>}<NEW_LINE>} | filterName, node, context, descriptor); |
1,086,823 | public io.kubernetes.client.proto.V1Policy.PodDisruptionBudgetList buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1Policy.PodDisruptionBudgetList result = new io.kubernetes.client.proto.V1Policy.PodDisruptionBudgetList(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>if (metadataBuilder_ == null) {<NEW_LINE>result.metadata_ = metadata_;<NEW_LINE>} else {<NEW_LINE>result.metadata_ = metadataBuilder_.build();<NEW_LINE>}<NEW_LINE>if (itemsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>items_ = java.util.Collections.unmodifiableList(items_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.items_ = items_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | .items_ = itemsBuilder_.build(); |
1,799,030 | public boolean mapChords() {<NEW_LINE>boolean ok = true;<NEW_LINE>// Chords grouped with previous chords<NEW_LINE>// Check time consistency of grouped chords in the same narrow slot<NEW_LINE>for (MeasureSlot narrow : slot.getMembers()) {<NEW_LINE>TreeMap<Rational, List<AbstractChordInter>> times = readSlotTimes(narrow);<NEW_LINE>if (times.size() == 1) {<NEW_LINE>// All grouped chords in narrow slot agree, set slot time accordingly<NEW_LINE>Rational time = times.keySet()<MASK><NEW_LINE>narrow.setTimeOffset(time);<NEW_LINE>} else if (times.size() > 1) {<NEW_LINE>// Time problem detected in a narrow slot<NEW_LINE>// Some data is wrong (recognition problem or implicit tuplet)<NEW_LINE>// TODO: check if some tuplet factor could explain the difference<NEW_LINE>logger.info("{} Time inconsistency in {}", measure, times);<NEW_LINE>ok &= analyzeTimes(times);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Purge rookies which have voice already defined (via tie or beam group)<NEW_LINE>purgeRookiesSet();<NEW_LINE>if (rookies.isEmpty()) {<NEW_LINE>return ok;<NEW_LINE>}<NEW_LINE>// Map some rookies to some actives<NEW_LINE>mapRookies();<NEW_LINE>if (rookies.isEmpty()) {<NEW_LINE>return ok;<NEW_LINE>}<NEW_LINE>// Create a brand new voice for each rookie left<NEW_LINE>createNewVoices();<NEW_LINE>return ok;<NEW_LINE>} | .iterator().next(); |
862,186 | public Object readObject() {<NEW_LINE>int type = readByte();<NEW_LINE>switch(type) {<NEW_LINE>case NULL:<NEW_LINE>return null;<NEW_LINE>case ENUMED:<NEW_LINE>{<NEW_LINE>Class clazz = readEnum(Class.class);<NEW_LINE>assert clazz != null;<NEW_LINE>return readEnum(clazz);<NEW_LINE>}<NEW_LINE>case SERIALIZED:<NEW_LINE>{<NEW_LINE>try {<NEW_LINE>int length = readInt();<NEW_LINE>if (length < 0 || length > 16 << 20)<NEW_LINE><MASK><NEW_LINE>int end = position() + length;<NEW_LINE>Object o = new ObjectInputStream(this.inputStream()).readObject();<NEW_LINE>assert position() == end : "index: " + index + ", position: " + position() + ", end: " + end + " o: " + o;<NEW_LINE>return o;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unknown type " + (char) type);<NEW_LINE>}<NEW_LINE>} | throw new IllegalStateException("Unexpected length: " + length); |
1,743,978 | public Widget onInitialize() {<NEW_LINE>// Create a vertical panel to layout the contents<NEW_LINE>VerticalPanel layout = new VerticalPanel();<NEW_LINE>// Show the HTML variable that defines the dictionary<NEW_LINE>HTML source = new HTML("<pre>var userInfo = {\n" + " name: \"Amelie Crutcher\",\n" + " timeZone: \"EST\",\n" + " userID: \"123\",\n" + " lastLogOn: \"2/2/2006\"\n" + "};</pre>\n");<NEW_LINE>source.getElement().setDir("ltr");<NEW_LINE>source.getElement().getStyle().setProperty("textAlign", "left");<NEW_LINE>layout.add(new HTML(constants.cwDictionaryExampleLinkText()));<NEW_LINE>layout.add(source);<NEW_LINE>// Create the Dictionary of data<NEW_LINE>FlexTable userInfoGrid = new FlexTable();<NEW_LINE>CellFormatter formatter = userInfoGrid.getCellFormatter();<NEW_LINE>Dictionary userInfo = Dictionary.getDictionary("userInfo");<NEW_LINE>Set<String> keySet = userInfo.keySet();<NEW_LINE>int columnCount = 0;<NEW_LINE>for (String key : keySet) {<NEW_LINE>// Get the value from the set<NEW_LINE>String value = userInfo.get(key);<NEW_LINE>// Add a column with the data<NEW_LINE>userInfoGrid.setHTML(0, columnCount, key);<NEW_LINE>formatter.addStyleName(0, columnCount, "cw-DictionaryExample-header");<NEW_LINE>userInfoGrid.setHTML(1, columnCount, value);<NEW_LINE>formatter.addStyleName(1, columnCount, "cw-DictionaryExample-data");<NEW_LINE>// Go to the next column<NEW_LINE>columnCount++;<NEW_LINE>}<NEW_LINE>layout.<MASK><NEW_LINE>layout.add(userInfoGrid);<NEW_LINE>// Return the layout Widget<NEW_LINE>return layout;<NEW_LINE>} | add(new HTML("<br><br>")); |
3,876 | protected void writeClassIdTo(Output output, Class<?> componentType, boolean array) throws IOException {<NEW_LINE>// shouldn't happen<NEW_LINE>assert !componentType.isArray();<NEW_LINE>final int id = array <MASK><NEW_LINE>final RegisteredDelegate<?> rd = getRegisteredDelegate(componentType);<NEW_LINE>if (rd != null) {<NEW_LINE>output.writeUInt32(id, (rd.id << 5) | CID_DELEGATE, false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RuntimeFieldFactory<?> inline = RuntimeFieldFactory.getInline(componentType);<NEW_LINE>if (inline != null) {<NEW_LINE>output.writeUInt32(id, getPrimitiveOrScalarId(componentType, inline.id), false);<NEW_LINE>} else if (componentType.isEnum()) {<NEW_LINE>output.writeUInt32(id, getEnumId(componentType), false);<NEW_LINE>} else if (Object.class == componentType) {<NEW_LINE>output.writeUInt32(id, CID_OBJECT, false);<NEW_LINE>} else if (Class.class == componentType) {<NEW_LINE>output.writeUInt32(id, CID_CLASS, false);<NEW_LINE>} else if (!componentType.isInterface() && !Modifier.isAbstract(componentType.getModifiers())) {<NEW_LINE>output.writeUInt32(id, getId(componentType), false);<NEW_LINE>} else {<NEW_LINE>// too many possible interfaces and abstract types that it would be costly<NEW_LINE>// to index it at runtime (Not all subclasses allow dynamic indexing)<NEW_LINE>// mapped class ids are +1 from regular the regular ones<NEW_LINE>output.writeString(id + 1, componentType.getName(), false);<NEW_LINE>}<NEW_LINE>} | ? RuntimeFieldFactory.ID_CLASS_ARRAY : RuntimeFieldFactory.ID_CLASS; |
1,190,319 | public static ListDeploymentsResponse unmarshall(ListDeploymentsResponse listDeploymentsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDeploymentsResponse.setRequestId(_ctx.stringValue("ListDeploymentsResponse.RequestId"));<NEW_LINE>listDeploymentsResponse.setTotalCount(_ctx.integerValue("ListDeploymentsResponse.TotalCount"));<NEW_LINE>listDeploymentsResponse.setNextToken(_ctx.stringValue("ListDeploymentsResponse.NextToken"));<NEW_LINE>listDeploymentsResponse.setMaxResults(_ctx.integerValue("ListDeploymentsResponse.MaxResults"));<NEW_LINE>List<Deployment> deployments = new ArrayList<Deployment>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDeploymentsResponse.Deployments.Length"); i++) {<NEW_LINE>Deployment deployment = new Deployment();<NEW_LINE>deployment.setDeploymentId(_ctx.stringValue<MASK><NEW_LINE>deployment.setName(_ctx.stringValue("ListDeploymentsResponse.Deployments[" + i + "].Name"));<NEW_LINE>deployment.setDeployType(_ctx.stringValue("ListDeploymentsResponse.Deployments[" + i + "].DeployType"));<NEW_LINE>deployment.setServiceId(_ctx.stringValue("ListDeploymentsResponse.Deployments[" + i + "].ServiceId"));<NEW_LINE>deployment.setDefaultVersion(_ctx.stringValue("ListDeploymentsResponse.Deployments[" + i + "].DefaultVersion"));<NEW_LINE>deployments.add(deployment);<NEW_LINE>}<NEW_LINE>listDeploymentsResponse.setDeployments(deployments);<NEW_LINE>return listDeploymentsResponse;<NEW_LINE>} | ("ListDeploymentsResponse.Deployments[" + i + "].DeploymentId")); |
1,284,358 | final CreateConfigurationSetResult executeCreateConfigurationSet(CreateConfigurationSetRequest createConfigurationSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createConfigurationSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateConfigurationSetRequest> request = null;<NEW_LINE>Response<CreateConfigurationSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateConfigurationSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createConfigurationSetRequest));<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, "Pinpoint SMS Voice");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateConfigurationSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateConfigurationSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateConfigurationSetResultJsonUnmarshaller());<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.startEvent(Field.ClientExecuteTime); |
522,405 | public static void main(final String[] args) {<NEW_LINE>if (args.length < 7) {<NEW_LINE>LOG.error("Args: [initialServerList], [configPath], [threads], [writeRatio], [readRatio], [valueSize] are needed.");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>final String initialServerList = args[1];<NEW_LINE>final String configPath = args[2];<NEW_LINE>final int threads = Integer.parseInt(args[3]);<NEW_LINE>final int writeRatio = Integer.parseInt(args[4]);<NEW_LINE>final int readRatio = Integer.parseInt(args[5]);<NEW_LINE>final int valueSize = Integer.parseInt(args[6]);<NEW_LINE>final RheaKVStoreOptions opts = Yaml.readConfig(configPath);<NEW_LINE>opts.setInitialServerList(initialServerList);<NEW_LINE>final RheaKVStore rheaKVStore = new DefaultRheaKVStore();<NEW_LINE>if (!rheaKVStore.init(opts)) {<NEW_LINE>LOG.error("Fail to init [RheaKVStore]");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>final List<RegionRouteTableOptions> regionRouteTableOptionsList = opts.getPlacementDriverOptions().getRegionRouteTableOptionsList();<NEW_LINE>rebalance(rheaKVStore, initialServerList, regionRouteTableOptionsList);<NEW_LINE>rheaKVStore.bPut("benchmark", BytesUtil.writeUtf8("benchmark start at: " + new Date()));<NEW_LINE>LOG.info(BytesUtil.readUtf8(rheaKVStore.bGet("benchmark")));<NEW_LINE>//<NEW_LINE>//<NEW_LINE>ConsoleReporter.forRegistry(KVMetrics.metricRegistry()).build().<MASK><NEW_LINE>LOG.info("Start benchmark...");<NEW_LINE>startBenchmark(rheaKVStore, threads, writeRatio, readRatio, valueSize, regionRouteTableOptionsList);<NEW_LINE>} | start(30, TimeUnit.SECONDS); |
618,490 | public void initScene() {<NEW_LINE>DirectionalLight light = new DirectionalLight();<NEW_LINE>light.setLookAt(0, 0, -1);<NEW_LINE>light.enableLookAt();<NEW_LINE>getCurrentScene().addLight(light);<NEW_LINE>//<NEW_LINE>// -- Create a material for all cubes<NEW_LINE>//<NEW_LINE>Material material = new Material();<NEW_LINE>material.enableLighting(true);<NEW_LINE>material.setDiffuseMethod(new DiffuseMethod.Lambert());<NEW_LINE>getCurrentCamera().setZ(10);<NEW_LINE>Random random = new Random();<NEW_LINE>//<NEW_LINE>// -- Generate cubes with random x, y, z<NEW_LINE>//<NEW_LINE>for (int i = 0; i < 10; i++) {<NEW_LINE>Cube cube = new Cube(1);<NEW_LINE>cube.setPosition(-5 + random.nextFloat() * 10, -5 + random.nextFloat() * 10, random.nextFloat() * -10);<NEW_LINE>cube.setMaterial(material);<NEW_LINE>cube.setColor(0x666666 + random.nextInt(0x999999));<NEW_LINE>getCurrentScene().addChild(cube);<NEW_LINE>Vector3 randomAxis = new Vector3(random.nextFloat(), random.nextFloat(), random.nextFloat());<NEW_LINE>randomAxis.normalize();<NEW_LINE>RotateOnAxisAnimation anim = new RotateOnAxisAnimation(randomAxis, 360);<NEW_LINE>anim.setTransformable3D(cube);<NEW_LINE>anim.setDurationMilliseconds(3000 + (int) (random.nextDouble() * 5000));<NEW_LINE>anim.<MASK><NEW_LINE>getCurrentScene().registerAnimation(anim);<NEW_LINE>anim.play();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// -- Create a post processing manager. We can add multiple passes to this.<NEW_LINE>//<NEW_LINE>mEffects = new PostProcessingManager(this);<NEW_LINE>//<NEW_LINE>// -- A render pass renders the current scene to a texture. This texture will<NEW_LINE>// be used for post processing<NEW_LINE>//<NEW_LINE>RenderPass renderPass = new RenderPass(getCurrentScene(), getCurrentCamera(), 0);<NEW_LINE>mEffects.addPass(renderPass);<NEW_LINE>//<NEW_LINE>// -- Add a Sepia effect<NEW_LINE>//<NEW_LINE>EffectPass sepiaPass = new SepiaPass();<NEW_LINE>mEffects.addPass(sepiaPass);<NEW_LINE>//<NEW_LINE>// -- Add a Gaussian blur effect. This requires a horizontal and a vertical pass.<NEW_LINE>//<NEW_LINE>EffectPass horizontalPass = new BlurPass(BlurPass.Direction.HORIZONTAL, 6, getViewportWidth(), getViewportHeight());<NEW_LINE>mEffects.addPass(horizontalPass);<NEW_LINE>EffectPass verticalPass = new BlurPass(BlurPass.Direction.VERTICAL, 6, getViewportWidth(), getViewportHeight());<NEW_LINE>//<NEW_LINE>// -- Important. The last pass should render to screen or nothing will happen.<NEW_LINE>//<NEW_LINE>verticalPass.setRenderToScreen(true);<NEW_LINE>mEffects.addPass(verticalPass);<NEW_LINE>} | setRepeatMode(Animation.RepeatMode.INFINITE); |
39,323 | private int checkIsolatedAlters() {<NEW_LINE>logger.debug("S#{} checkIsolatedAlters", system.getId());<NEW_LINE>int modifs = 0;<NEW_LINE>final List<Inter> alters = sig.inters(ShapeSet.Accidentals.getShapes());<NEW_LINE>for (Inter inter : alters) {<NEW_LINE>if (inter instanceof KeyAlterInter) {<NEW_LINE>// Don't consider alters within a key-sig<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final AlterInter alter = (AlterInter) inter;<NEW_LINE>// Connected to a note head?<NEW_LINE>if (sig.hasRelation(alter, AlterHeadRelation.class)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Within a cautionary measure?<NEW_LINE>Point center = inter.getCenter();<NEW_LINE>Staff staff = alter.getStaff();<NEW_LINE>if (staff == null) {<NEW_LINE>// 1 or 2 staves<NEW_LINE>List<Staff> <MASK><NEW_LINE>staff = stavesAround.get(0);<NEW_LINE>}<NEW_LINE>Part part = staff.getPart();<NEW_LINE>Measure measure = part.getMeasureAt(center);<NEW_LINE>if ((measure != null) && (measure == part.getLastMeasure()) && (measure.getPartBarlineOn(HorizontalSide.RIGHT) == null)) {<NEW_LINE>// Empty measure?<NEW_LINE>// Measure width?<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (alter.isVip()) {<NEW_LINE>logger.info("VIP deleting isolated {}", alter);<NEW_LINE>}<NEW_LINE>alter.remove();<NEW_LINE>modifs++;<NEW_LINE>}<NEW_LINE>return modifs;<NEW_LINE>} | stavesAround = system.getStavesAround(center); |
1,454,123 | private boolean testSourceTargetDifferent() {<NEW_LINE>boolean result = false;<NEW_LINE>String sourceVendor = "";<NEW_LINE>String targetVendor = "";<NEW_LINE>String sourceHost = "";<NEW_LINE>String targetHost = "";<NEW_LINE>String sourcePort = "";<NEW_LINE>String targetPort = "";<NEW_LINE>String sourceName = "";<NEW_LINE>String targetName = "";<NEW_LINE>String sourceCatalog = "";<NEW_LINE>String targetCatalog = "";<NEW_LINE>String sourceSchema = "";<NEW_LINE>String targetSchema = "";<NEW_LINE>if (m_sourceVendor.getSelectedItem() != null)<NEW_LINE>sourceVendor = m_sourceVendor.getSelectedItem().toString().trim();<NEW_LINE>if (m_targetVendor.getSelectedItem() != null)<NEW_LINE>targetVendor = m_targetVendor.getSelectedItem().toString().trim();<NEW_LINE>if (m_sourceHost.getText() != null)<NEW_LINE>sourceHost = m_sourceHost.getText().trim();<NEW_LINE>if (m_targetHost.getText() != null)<NEW_LINE>targetHost = m_targetHost.getText().trim();<NEW_LINE>if (m_sourcePort.getText() != null)<NEW_LINE>sourcePort = m_sourcePort.getText().trim();<NEW_LINE>if (m_targetPort.getText() != null)<NEW_LINE>targetPort = m_targetPort.getText().trim();<NEW_LINE>if (m_sourceName.getSelectedItem() != null)<NEW_LINE>sourceName = m_sourceName.getSelectedItem().toString().trim();<NEW_LINE>if (m_targetName.getSelectedItem() != null)<NEW_LINE>targetName = m_targetName.getSelectedItem().toString().trim();<NEW_LINE>if (m_sourceCatalog.getSelectedItem() != null)<NEW_LINE>sourceCatalog = m_sourceCatalog.getSelectedItem()<MASK><NEW_LINE>if (m_targetCatalog.getSelectedItem() != null)<NEW_LINE>targetCatalog = m_targetCatalog.getSelectedItem().toString().trim();<NEW_LINE>if (m_sourceSchema.getSelectedItem() != null)<NEW_LINE>sourceSchema = m_sourceSchema.getSelectedItem().toString().trim();<NEW_LINE>if (m_targetSchema.getSelectedItem() != null)<NEW_LINE>targetSchema = m_targetSchema.getSelectedItem().toString().trim();<NEW_LINE>if (!sourceVendor.equalsIgnoreCase(targetVendor))<NEW_LINE>result = true;<NEW_LINE>else if (!sourceHost.equalsIgnoreCase(targetHost))<NEW_LINE>result = true;<NEW_LINE>else if (!sourcePort.equalsIgnoreCase(targetPort))<NEW_LINE>result = true;<NEW_LINE>else if (!sourceName.equalsIgnoreCase(targetName))<NEW_LINE>result = true;<NEW_LINE>else if (!sourceCatalog.equalsIgnoreCase(targetCatalog))<NEW_LINE>result = true;<NEW_LINE>else if (!sourceSchema.equalsIgnoreCase(targetSchema))<NEW_LINE>result = true;<NEW_LINE>return result;<NEW_LINE>} | .toString().trim(); |
896,234 | public HelixTaskResult handleMessage() throws InterruptedException {<NEW_LINE>HelixTaskResult helixTaskResult = new HelixTaskResult();<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>if (_segmentName.equals("")) {<NEW_LINE>// NOTE: the method aborts if any segment reload encounters an unhandled exception,<NEW_LINE>// and can lead to inconsistent state across segments.<NEW_LINE>// we don't acquire any permit here as they'll be acquired by worked threads later<NEW_LINE>_instanceDataManager.reloadAllSegments(_tableNameWithType, _forceDownload, _segmentRefreshSemaphore);<NEW_LINE>} else {<NEW_LINE>// Reload one segment<NEW_LINE>_segmentRefreshSemaphore.acquireSema(_segmentName, _logger);<NEW_LINE>try {<NEW_LINE>_instanceDataManager.reloadSegment(_tableNameWithType, _segmentName, _forceDownload);<NEW_LINE>} finally {<NEW_LINE>_segmentRefreshSemaphore.releaseSema();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>helixTaskResult.setSuccess(true);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>_metrics.addMeteredTableValue(_tableNameWithType, ServerMeter.RELOAD_FAILURES, 1);<NEW_LINE>// catch all Errors and Exceptions: if we only catch Exception, Errors go completely unhandled<NEW_LINE>// (without any corresponding logs to indicate failure!) in the callable path<NEW_LINE>throw new RuntimeException("Caught exception while reloading segment: " + _segmentName + " in table: " + _tableNameWithType, e);<NEW_LINE>}<NEW_LINE>return helixTaskResult;<NEW_LINE>} | _logger.info("Handling message: {}", _message); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.