idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
236,012
final GetNetworkAnalyzerConfigurationResult executeGetNetworkAnalyzerConfiguration(GetNetworkAnalyzerConfigurationRequest getNetworkAnalyzerConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getNetworkAnalyzerConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetNetworkAnalyzerConfigurationRequest> request = null;<NEW_LINE>Response<GetNetworkAnalyzerConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetNetworkAnalyzerConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getNetworkAnalyzerConfigurationRequest));<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, "IoT Wireless");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetNetworkAnalyzerConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetNetworkAnalyzerConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetNetworkAnalyzerConfigurationResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,234,658
final DeleteReceiptRuleResult executeDeleteReceiptRule(DeleteReceiptRuleRequest deleteReceiptRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteReceiptRuleRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteReceiptRuleRequest> request = null;<NEW_LINE>Response<DeleteReceiptRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteReceiptRuleRequestMarshaller().marshall(super.beforeMarshalling(deleteReceiptRuleRequest));<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, "SES");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteReceiptRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteReceiptRuleResult> responseHandler = new StaxResponseHandler<DeleteReceiptRuleResult>(new DeleteReceiptRuleResultStaxUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,450,831
public void renderTrack(RenderContext ctx, Repainter repainter, double w, double h) {<NEW_LINE>ctx.trace("CpuSummary", () -> {<NEW_LINE>CpuSummaryTrack.Data data = track.getData(state.toRequest<MASK><NEW_LINE>drawLoading(ctx, data, state, h);<NEW_LINE>if (data == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO: dedupe with CpuRenderer<NEW_LINE>long tStart = data.request.range.start;<NEW_LINE>int start = Math.max(0, (int) ((state.getVisibleTime().start - tStart) / data.bucketSize));<NEW_LINE>mainGradient().applyBaseAndBorder(ctx);<NEW_LINE>ctx.path(path -> {<NEW_LINE>path.moveTo(0, h);<NEW_LINE>double y = h, x = 0;<NEW_LINE>for (int i = start; i < data.utilizations.length && x < w; i++) {<NEW_LINE>x = state.timeToPx(tStart + i * data.bucketSize);<NEW_LINE>double nextY = h * (1 - data.utilizations[i]);<NEW_LINE>path.lineTo(x, y);<NEW_LINE>path.lineTo(x, nextY);<NEW_LINE>y = nextY;<NEW_LINE>}<NEW_LINE>path.lineTo(x, h);<NEW_LINE>path.close();<NEW_LINE>ctx.fillPath(path);<NEW_LINE>ctx.drawPath(path);<NEW_LINE>});<NEW_LINE>if (hovered != null && hovered.bucket >= start) {<NEW_LINE>double x = state.timeToPx(tStart + hovered.bucket * data.bucketSize + data.bucketSize / 2);<NEW_LINE>if (x < w) {<NEW_LINE>double dx = HOVER_PADDING + hovered.size.w + HOVER_PADDING;<NEW_LINE>double dy = HOVER_PADDING + hovered.size.h + HOVER_PADDING;<NEW_LINE>ctx.setBackgroundColor(colors().hoverBackground);<NEW_LINE>ctx.fillRect(x + HOVER_MARGIN, h - HOVER_PADDING - dy, dx, dy);<NEW_LINE>ctx.setForegroundColor(colors().textMain);<NEW_LINE>ctx.drawText(Fonts.Style.Normal, hovered.text, x + HOVER_MARGIN + HOVER_PADDING, h - dy);<NEW_LINE>ctx.setForegroundColor(colors().textMain);<NEW_LINE>ctx.drawCircle(x, h * (1 - hovered.utilization), CURSOR_SIZE / 2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
(), onUiThread(repainter));
719,581
protected void removeBean(EjbInvocation inv) throws RemoveException {<NEW_LINE>try {<NEW_LINE>//<NEW_LINE>//<NEW_LINE>ejbProbeNotifier.ejbBeanDestroyedEvent(getContainerId(), containerInfo.appName, containerInfo.modName, containerInfo.ejbName);<NEW_LINE>// Note: if there are concurrent invocations/transactions in<NEW_LINE>// progress for this ejbObject, they will be serialized along with<NEW_LINE>// this remove by the database. So we optimistically do ejbRemove.<NEW_LINE>// call ejbRemove on the EJB<NEW_LINE>// the EJB is allowed to veto the remove by throwing RemoveException<NEW_LINE>EntityBean ejb = (EntityBean) inv.ejb;<NEW_LINE>EntityContextImpl context = (EntityContextImpl) inv.context;<NEW_LINE>callEJBRemove(ejb, context);<NEW_LINE>// inv.ejbObject could be a EJBObject or a EJBLocalObject<NEW_LINE>Object primaryKey = getInvocationKey(inv);<NEW_LINE>if (isRemote) {<NEW_LINE>removeEJBObjectFromStore(primaryKey);<NEW_LINE>}<NEW_LINE>if (isLocal) {<NEW_LINE>// Remove the EJBLocalObject from ejbLocalObjectStore<NEW_LINE>ejbLocalObjectStore.remove(primaryKey);<NEW_LINE>}<NEW_LINE>// Mark EJB as removed. Now releaseContext will add bean to pool<NEW_LINE>containerStateManager.markObjectRemoved(context, true);<NEW_LINE>// Remove any timers for this entity bean identity.<NEW_LINE>cancelTimers(primaryKey);<NEW_LINE>} catch (RemoveException ex) {<NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.log(Level.FINE, "entitybean.container.local_remove_exception", logParams);<NEW_LINE>_logger.log(Level.FINE, "", ex);<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.log(<MASK><NEW_LINE>_logger.log(Level.FINE, "", ex);<NEW_LINE>}<NEW_LINE>throw new EJBException(ex);<NEW_LINE>}<NEW_LINE>}
Level.FINE, "entitybean.container.remove_bean_exception", logParams);
221,138
public static GetMetaProductListResponse unmarshall(GetMetaProductListResponse getMetaProductListResponse, UnmarshallerContext _ctx) {<NEW_LINE>getMetaProductListResponse.setRequestId(_ctx.stringValue("GetMetaProductListResponse.RequestId"));<NEW_LINE>getMetaProductListResponse.setSuccess(_ctx.booleanValue("GetMetaProductListResponse.Success"));<NEW_LINE>getMetaProductListResponse.setCode(_ctx.integerValue("GetMetaProductListResponse.Code"));<NEW_LINE>getMetaProductListResponse.setMessage(_ctx.stringValue("GetMetaProductListResponse.Message"));<NEW_LINE>MetaData metaData = new MetaData();<NEW_LINE>metaData.setNames(_ctx.mapValue("GetMetaProductListResponse.MetaData.Names"));<NEW_LINE>List<SpecVO> productsNormal = new ArrayList<SpecVO>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetMetaProductListResponse.MetaData.ProductsNormal.Length"); i++) {<NEW_LINE>SpecVO specVO = new SpecVO();<NEW_LINE>specVO.setRegionId(_ctx.stringValue("GetMetaProductListResponse.MetaData.ProductsNormal[" + i + "].RegionId"));<NEW_LINE>specVO.setSpecType(_ctx.stringValue("GetMetaProductListResponse.MetaData.ProductsNormal[" + i + "].SpecType"));<NEW_LINE>specVO.setIoMax(_ctx.longValue("GetMetaProductListResponse.MetaData.ProductsNormal[" + i + "].IoMax"));<NEW_LINE>specVO.setDiskType(_ctx.stringValue("GetMetaProductListResponse.MetaData.ProductsNormal[" + i + "].DiskType"));<NEW_LINE>specVO.setDiskSize(_ctx.stringValue("GetMetaProductListResponse.MetaData.ProductsNormal[" + i + "].DiskSize"));<NEW_LINE>specVO.setTopicQuota(_ctx.stringValue("GetMetaProductListResponse.MetaData.ProductsNormal[" + i + "].TopicQuota"));<NEW_LINE>specVO.setDeployType(_ctx.stringValue("GetMetaProductListResponse.MetaData.ProductsNormal[" + i + "].DeployType"));<NEW_LINE>productsNormal.add(specVO);<NEW_LINE>}<NEW_LINE>metaData.setProductsNormal(productsNormal);<NEW_LINE>List<SpecVO> productsProfessional = new ArrayList<SpecVO>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetMetaProductListResponse.MetaData.ProductsProfessional.Length"); i++) {<NEW_LINE>SpecVO specVO_ = new SpecVO();<NEW_LINE>specVO_.setRegionId(_ctx.stringValue("GetMetaProductListResponse.MetaData.ProductsProfessional[" + i + "].RegionId"));<NEW_LINE>specVO_.setSpecType(_ctx.stringValue("GetMetaProductListResponse.MetaData.ProductsProfessional[" + i + "].SpecType"));<NEW_LINE>specVO_.setIoMax(_ctx.longValue("GetMetaProductListResponse.MetaData.ProductsProfessional[" + i + "].IoMax"));<NEW_LINE>specVO_.setDiskType(_ctx.stringValue("GetMetaProductListResponse.MetaData.ProductsProfessional[" + i + "].DiskType"));<NEW_LINE>specVO_.setDiskSize(_ctx.stringValue("GetMetaProductListResponse.MetaData.ProductsProfessional[" + i + "].DiskSize"));<NEW_LINE>specVO_.setTopicQuota(_ctx.stringValue("GetMetaProductListResponse.MetaData.ProductsProfessional[" + i + "].TopicQuota"));<NEW_LINE>specVO_.setDeployType(_ctx.stringValue<MASK><NEW_LINE>productsProfessional.add(specVO_);<NEW_LINE>}<NEW_LINE>metaData.setProductsProfessional(productsProfessional);<NEW_LINE>getMetaProductListResponse.setMetaData(metaData);<NEW_LINE>return getMetaProductListResponse;<NEW_LINE>}
("GetMetaProductListResponse.MetaData.ProductsProfessional[" + i + "].DeployType"));
657,763
void peerSplitComponent(int orientation, MultiViewPeer mvPeer, MultiViewDescription defaultDesc, MultiViewDescription defaultDescClone, int splitPosition) {<NEW_LINE>MultiViewDescription[] descriptions = model.getDescriptions();<NEW_LINE>MultiViewDescription activeDescription = model.getActiveDescription();<NEW_LINE>if (splitPane == null) {<NEW_LINE>splitPane = new JSplitPane();<NEW_LINE>topBottomDescriptions = new MultiViewDescription[2];<NEW_LINE>if (defaultDesc != null && defaultDescClone != null) {<NEW_LINE>// called during deserialization<NEW_LINE>topBottomDescriptions[0] = defaultDesc;<NEW_LINE>topBottomDescriptions[1] = defaultDescClone;<NEW_LINE>} else {<NEW_LINE>int activeDescIndex = 0;<NEW_LINE>for (int i = 0; i < descriptions.length; i++) {<NEW_LINE>MultiViewDescription multiViewDescription = descriptions[i];<NEW_LINE>if (multiViewDescription.getDisplayName().equals(activeDescription.getDisplayName())) {<NEW_LINE>activeDescIndex = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>topBottomDescriptions[0] = descriptions[activeDescIndex];<NEW_LINE>topBottomDescriptions[1] = descriptions[activeDescIndex + 1];<NEW_LINE>}<NEW_LINE>setupSplit();<NEW_LINE>splitPane.setOneTouchExpandable(false);<NEW_LINE>splitPane.setContinuousLayout(true);<NEW_LINE>splitPane.setResizeWeight(0.5);<NEW_LINE>splitPane.setBorder(BorderFactory.createEmptyBorder());<NEW_LINE>removeAll();<NEW_LINE>Toolkit.getDefaultToolkit().addAWTEventListener(getAWTEventListener(), MouseEvent.MOUSE_EVENT_MASK | MouseEvent.MOUSE_MOTION_EVENT_MASK);<NEW_LINE>add(splitPane, BorderLayout.CENTER);<NEW_LINE>MultiViewDescription bottomDescription = topBottomDescriptions[1];<NEW_LINE>isTopLeft = false;<NEW_LINE>model.setActiveDescription(bottomDescription);<NEW_LINE>syncSplitButtonsWithModel();<NEW_LINE>MultiViewDescription topDescription = topBottomDescriptions[0];<NEW_LINE>isTopLeft = true;<NEW_LINE>model.setActiveDescription(topDescription);<NEW_LINE>syncSplitButtonsWithModel();<NEW_LINE>} else {<NEW_LINE>topLeftComponent = (JPanel) splitPane.getTopComponent();<NEW_LINE>bottomRightComponent = (JPanel) splitPane.getBottomComponent();<NEW_LINE>}<NEW_LINE>if (orientation != splitPane.getOrientation()) {<NEW_LINE>splitPane.removePropertyChangeListener(splitterPropertyChangeListener);<NEW_LINE>splitterPropertyChangeListener = null;<NEW_LINE>}<NEW_LINE>bar.<MASK><NEW_LINE>splitPane.setOrientation(orientation);<NEW_LINE>splitPane.setTopComponent(topLeftComponent);<NEW_LINE>splitPane.setBottomComponent(bottomRightComponent);<NEW_LINE>splitPane.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, getSplitterPropertyChangeListener(orientation));<NEW_LINE>topLeftComponent.setMinimumSize(new Dimension(0, 0));<NEW_LINE>bottomRightComponent.setMinimumSize(new Dimension(0, 0));<NEW_LINE>if (splitPosition > 0)<NEW_LINE>splitPane.setDividerLocation(splitPosition);<NEW_LINE>}
remove(layerUI.getSplitDragger());
178,491
public DummyVertex<N> insertDummyVertex(Edge<?> edge, DummyVertex.Type type) {<NEW_LINE>Edge<E> originalEdge;<NEW_LINE>if (edge instanceof DummyEdge) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Edge<E> tmp = (Edge<E>) ((DummyEdge<?>) edge).getOriginalEdge();<NEW_LINE>originalEdge = tmp;<NEW_LINE>} else {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Edge<E> tmp = (Edge<E>) edge;<NEW_LINE>originalEdge = tmp;<NEW_LINE>}<NEW_LINE>DummyVertex<N> dv = createDummyVertex(originalEdge, type);<NEW_LINE>vertices.add(dv);<NEW_LINE>Vertex<?> v = edge.getV();<NEW_LINE>Vertex<?> w = edge.getW();<NEW_LINE>v.removeEdge(edge);<NEW_LINE>v.removeNeighbor(w);<NEW_LINE>v.addNeighbor(dv);<NEW_LINE>dv.addNeighbor(v);<NEW_LINE>DummyEdge<E> de = <MASK><NEW_LINE>v.addEdge(de);<NEW_LINE>dv.addEdge(de);<NEW_LINE>w.removeEdge(edge);<NEW_LINE>w.removeNeighbor(v);<NEW_LINE>w.addNeighbor(dv);<NEW_LINE>dv.addNeighbor(w);<NEW_LINE>de = createDummyEdge(dv, w, originalEdge);<NEW_LINE>w.addEdge(de);<NEW_LINE>dv.addEdge(de);<NEW_LINE>return dv;<NEW_LINE>}
createDummyEdge(v, dv, originalEdge);
1,434,996
public Trait createTrait(ShapeId target, Node value) {<NEW_LINE><MASK><NEW_LINE>Builder builder = builder().sourceLocation(value);<NEW_LINE>String sdkId = objectNode.getStringMember("sdkId").map(StringNode::getValue).orElseThrow(() -> new SourceException(String.format("No sdkId was provided. Perhaps you could set this to %s?", target.getName()), value));<NEW_LINE>builder.sdkId(sdkId);<NEW_LINE>objectNode.getStringMember("arnNamespace").map(StringNode::getValue).ifPresent(builder::arnNamespace);<NEW_LINE>objectNode.getStringMember("cloudFormationName").map(StringNode::getValue).ifPresent(builder::cloudFormationName);<NEW_LINE>objectNode.getStringMember("cloudTrailEventSource").map(StringNode::getValue).ifPresent(builder::cloudTrailEventSource);<NEW_LINE>objectNode.getStringMember("endpointPrefix").map(StringNode::getValue).ifPresent(builder::endpointPrefix);<NEW_LINE>ServiceTrait result = builder.build(target);<NEW_LINE>result.setNodeCache(value);<NEW_LINE>return result;<NEW_LINE>}
ObjectNode objectNode = value.expectObjectNode();
356,438
private void generateQuarkusExtensionDescriptor(Path inputMetaInfDirectory, Path outputMetaInfDirectory) throws IOException {<NEW_LINE>File extensionFile = new File(inputMetaInfDirectory.toFile(), BootstrapConstants.QUARKUS_EXTENSION_FILE_NAME);<NEW_LINE>ObjectMapper mapper = getMapper();<NEW_LINE>ObjectNode extObject;<NEW_LINE>if (extensionFile.exists()) {<NEW_LINE>extObject = readExtensionFile(extensionFile.toPath(), mapper);<NEW_LINE>} else {<NEW_LINE>extObject = mapper.createObjectNode();<NEW_LINE>}<NEW_LINE>computeArtifactCoords(extObject);<NEW_LINE>computeProjectName(extObject);<NEW_LINE>computeQuarkusCoreVersion(extObject);<NEW_LINE>computeQuarkusExtensions(extObject);<NEW_LINE>if (!extObject.has("description") && getProject().getDescription() != null) {<NEW_LINE>extObject.put("description", getProject().getDescription());<NEW_LINE>}<NEW_LINE>final DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter();<NEW_LINE>prettyPrinter.indentArraysWith(DefaultIndenter.SYSTEM_LINEFEED_INSTANCE);<NEW_LINE>try (BufferedWriter bw = Files.newBufferedWriter(outputMetaInfDirectory.resolve(BootstrapConstants.QUARKUS_EXTENSION_FILE_NAME))) {<NEW_LINE>bw.write(getMapper().writer(<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new GradleException("Failed to persist " + outputMetaInfDirectory.resolve(BootstrapConstants.QUARKUS_EXTENSION_FILE_NAME), e);<NEW_LINE>}<NEW_LINE>}
prettyPrinter).writeValueAsString(extObject));
1,758,283
public static void tearDown() throws Exception {<NEW_LINE>try {<NEW_LINE>// Clean up database<NEW_LINE>try {<NEW_LINE>final Set<String> ddlSet = new HashSet<String>();<NEW_LINE>for (String ddlName : dropSet) {<NEW_LINE>ddlSet.add(ddlName.replace("${dbvendor}", getDbVendor().name()));<NEW_LINE>}<NEW_LINE>executeDDL(server, ddlSet, true);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>t.printStackTrace();<NEW_LINE>}<NEW_LINE>// From Eclipselink drop-and-create tables option<NEW_LINE>// From Eclipselink drop-and-create tables option<NEW_LINE>server.// From Eclipselink drop-and-create tables option<NEW_LINE>stopServer(// RuntimeException test, expected<NEW_LINE>"CWWJP9991W", // TODO: OpenJPA throws a MetaDataException while parsing the XML nested embeddables<NEW_LINE>"WTRN0074E: Exception caught from before_completion synchronization operation", "CWWJP0055E");<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>sc.getApplications().clear();<NEW_LINE>server.updateServerConfiguration(sc);<NEW_LINE>server.saveServerConfiguration();<NEW_LINE>server.deleteFileFromLibertyServerRoot("apps/" + appNameEar);<NEW_LINE>server.deleteFileFromLibertyServerRoot("apps/DatabaseManagement.war");<NEW_LINE>} catch (Throwable t) {<NEW_LINE>t.printStackTrace();<NEW_LINE>}<NEW_LINE>bannerEnd(JPA10EmbeddableNested_WEB.class, timestart);<NEW_LINE>}<NEW_LINE>}
ServerConfiguration sc = server.getServerConfiguration();
1,805,819
public void write(DataOutput out) throws IOException {<NEW_LINE>// ATTN: must write type first<NEW_LINE>Text.writeString(out, dataSourceType.name());<NEW_LINE>out.writeLong(id);<NEW_LINE>Text.writeString(out, name);<NEW_LINE>Text.writeString(out, clusterName);<NEW_LINE>out.writeLong(dbId);<NEW_LINE>out.writeLong(tableId);<NEW_LINE>out.writeInt(desireTaskConcurrentNum);<NEW_LINE>Text.writeString(out, state.name());<NEW_LINE>out.writeLong(maxErrorNum);<NEW_LINE>out.writeLong(taskSchedIntervalS);<NEW_LINE>out.writeLong(maxBatchRows);<NEW_LINE>out.writeLong(maxBatchSizeBytes);<NEW_LINE>progress.write(out);<NEW_LINE>out.writeLong(createTimestamp);<NEW_LINE>out.writeLong(pauseTimestamp);<NEW_LINE>out.writeLong(endTimestamp);<NEW_LINE>out.writeLong(currentErrorRows);<NEW_LINE>out.writeLong(currentTotalRows);<NEW_LINE>out.writeLong(errorRows);<NEW_LINE>out.writeLong(totalRows);<NEW_LINE>out.writeLong(unselectedRows);<NEW_LINE>out.writeLong(receivedBytes);<NEW_LINE>out.writeLong(totalTaskExcutionTimeMs);<NEW_LINE>out.writeLong(committedTaskNum);<NEW_LINE>out.writeLong(abortedTaskNum);<NEW_LINE>origStmt.write(out);<NEW_LINE>out.writeInt(jobProperties.size());<NEW_LINE>for (Map.Entry<String, String> entry : jobProperties.entrySet()) {<NEW_LINE>Text.writeString(out, entry.getKey());<NEW_LINE>Text.writeString(<MASK><NEW_LINE>}<NEW_LINE>out.writeInt(sessionVariables.size());<NEW_LINE>for (Map.Entry<String, String> entry : sessionVariables.entrySet()) {<NEW_LINE>Text.writeString(out, entry.getKey());<NEW_LINE>Text.writeString(out, entry.getValue());<NEW_LINE>}<NEW_LINE>}
out, entry.getValue());
1,136,365
public void visitHistogram(StringBuilder sb, String prefix, String name, Histogram histogram) {<NEW_LINE>if (!CORE_METRICS.containsKey(name)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Snapshot snapshot = histogram.getSnapshot();<NEW_LINE>sb.append(Joiner.on(" ").join(prefix + name + "_75", CORE_METRICS.get(name), String.format("%.0f", snapshot.get75thPercentile()<MASK><NEW_LINE>sb.append(Joiner.on(" ").join(prefix + name + "_95", CORE_METRICS.get(name), String.format("%.0f", snapshot.get95thPercentile()))).append("\n");<NEW_LINE>sb.append(Joiner.on(" ").join(prefix + name + "_99", CORE_METRICS.get(name), String.format("%.0f", snapshot.get99thPercentile()))).append("\n");<NEW_LINE>return;<NEW_LINE>}
))).append("\n");
627,336
void takeScreenshot(Canvas canvas, SingleObserver<String> observer) {<NEW_LINE>canvas.getScreenShot().subscribeOn(Schedulers.computation()).observeOn(Schedulers.io()).map(bitmap -> {<NEW_LINE><MASK><NEW_LINE>Date now = calendar.getTime();<NEW_LINE>// noinspection SpellCheckingInspection<NEW_LINE>SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd-HHmmss", Locale.US);<NEW_LINE>String fileName = "Screenshot_" + simpleDateFormat.format(now) + ".png";<NEW_LINE>File screenshotDir = new File(Config.SCREENSHOTS_DIR);<NEW_LINE>File screenshotFile = new File(screenshotDir, fileName);<NEW_LINE>if (!screenshotDir.exists() && !screenshotDir.mkdirs()) {<NEW_LINE>throw new IOException("Can't create directory: " + screenshotDir);<NEW_LINE>}<NEW_LINE>FileOutputStream out = new FileOutputStream(screenshotFile);<NEW_LINE>bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);<NEW_LINE>return screenshotFile.getAbsolutePath();<NEW_LINE>}).observeOn(AndroidSchedulers.mainThread()).subscribe(observer);<NEW_LINE>}
Calendar calendar = Calendar.getInstance();
810,274
public void updateGCPConfig(Provider provider, Map<String, String> config) throws IOException {<NEW_LINE>// Remove the key to avoid generating a credentials file unnecessarily.<NEW_LINE>config.remove("GCE_HOST_PROJECT");<NEW_LINE>// If we were not given a config file, then no need to do anything here.<NEW_LINE>if (config.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String gcpCredentialsFile = accessManager.createCredentialsFile(provider.uuid<MASK><NEW_LINE>Map<String, String> newConfig = new HashMap<>();<NEW_LINE>if (config.get("project_id") != null) {<NEW_LINE>newConfig.put("GCE_PROJECT", config.get("project_id"));<NEW_LINE>}<NEW_LINE>if (config.get("client_email") != null) {<NEW_LINE>newConfig.put("GCE_EMAIL", config.get("client_email"));<NEW_LINE>}<NEW_LINE>if (gcpCredentialsFile != null) {<NEW_LINE>newConfig.put("GOOGLE_APPLICATION_CREDENTIALS", gcpCredentialsFile);<NEW_LINE>}<NEW_LINE>provider.setConfig(newConfig);<NEW_LINE>provider.save();<NEW_LINE>}
, Json.toJson(config));
1,661,280
public void processElement(ProcessContext context) {<NEW_LINE>FailsafeElement<PubsubMessage, String> failsafeElement = context.element();<NEW_LINE>PubsubMessage pubsubMessage = failsafeElement.getOriginalPayload();<NEW_LINE>String message = pubsubMessage.getPayload().length > 0 ? new String(pubsubMessage.getPayload()) : pubsubMessage.getAttributeMap().toString();<NEW_LINE>// Format the timestamp for insertion<NEW_LINE>String timestamp;<NEW_LINE>try {<NEW_LINE>timestamp = ElasticsearchUtils.getTimestampFromOriginalPayload<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>timestamp = new java.sql.Timestamp(System.currentTimeMillis()).toInstant().toString();<NEW_LINE>}<NEW_LINE>// Build the output PubSub message<NEW_LINE>ObjectNode outputMessage = OBJECT_MAPPER.createObjectNode();<NEW_LINE>outputMessage.put(ERROR_TIMESTAMP, timestamp).put(ERROR_MESSAGE, failsafeElement.getErrorMessage()).put(ERROR_STACKTRACE, failsafeElement.getStacktrace()).put(ERROR_PAYLOAD_STRING, message);<NEW_LINE>ERROR_MESSAGES_COUNTER.inc();<NEW_LINE>Map<String, String> attributes = new HashMap<>(pubsubMessage.getAttributeMap());<NEW_LINE>attributes.put(ERROR_MESSAGE, failsafeElement.getErrorMessage());<NEW_LINE>context.output(new PubsubMessage(outputMessage.toString().getBytes(StandardCharsets.UTF_8), attributes));<NEW_LINE>}
(OBJECT_MAPPER.readTree(message));
735,202
protected AsyncState finish() {<NEW_LINE>boolean someIndicesWereDropped = dropUnregisteredIndices(state);<NEW_LINE>StringBuilder updated = new StringBuilder();<NEW_LINE>String updatedIndices = indicesRegistrationSink.changedIndices();<NEW_LINE>if (!updatedIndices.isEmpty())<NEW_LINE>updated.append(updatedIndices);<NEW_LINE>if (someIndicesWereDropped)<NEW_LINE>updated.append(" and some indices were dropped");<NEW_LINE>indicesRegistrationSink.logChangedAndFullyBuiltIndices(LOG, "Following stub indices will be updated:", "Following stub indices will be built:");<NEW_LINE>if (updated.length() > 0) {<NEW_LINE>final Throwable e = new <MASK><NEW_LINE>// avoid direct forceRebuild as it produces dependency cycle (IDEA-105485)<NEW_LINE>ApplicationManager.getApplication().invokeLater(() -> forceRebuild(e), ModalityState.NON_MODAL);<NEW_LINE>}<NEW_LINE>myInitialized = true;<NEW_LINE>return state;<NEW_LINE>}
Throwable(updated.toString());
676,737
final GetEvaluationResult executeGetEvaluation(GetEvaluationRequest getEvaluationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getEvaluationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetEvaluationRequest> request = null;<NEW_LINE>Response<GetEvaluationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetEvaluationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getEvaluationRequest));<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, "Machine Learning");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetEvaluation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetEvaluationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetEvaluationResultJsonUnmarshaller());<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);
115,450
public static DescribeIngressResponse unmarshall(DescribeIngressResponse describeIngressResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeIngressResponse.setRequestId(_ctx.stringValue("DescribeIngressResponse.RequestId"));<NEW_LINE>describeIngressResponse.setCode(_ctx.stringValue("DescribeIngressResponse.Code"));<NEW_LINE>describeIngressResponse.setMessage(_ctx.stringValue("DescribeIngressResponse.Message"));<NEW_LINE>describeIngressResponse.setSuccess(_ctx.booleanValue("DescribeIngressResponse.Success"));<NEW_LINE>describeIngressResponse.setErrorCode(_ctx.stringValue("DescribeIngressResponse.ErrorCode"));<NEW_LINE>describeIngressResponse.setTraceId(_ctx.stringValue("DescribeIngressResponse.TraceId"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setId(_ctx.longValue("DescribeIngressResponse.Data.Id"));<NEW_LINE>data.setName(_ctx.stringValue("DescribeIngressResponse.Data.Name"));<NEW_LINE>data.setNamespaceId(_ctx.stringValue("DescribeIngressResponse.Data.NamespaceId"));<NEW_LINE>data.setDescription(_ctx.stringValue("DescribeIngressResponse.Data.Description"));<NEW_LINE>data.setSlbId(_ctx.stringValue("DescribeIngressResponse.Data.SlbId"));<NEW_LINE>data.setListenerPort(_ctx.integerValue("DescribeIngressResponse.Data.ListenerPort"));<NEW_LINE>data.setCertId(_ctx.stringValue("DescribeIngressResponse.Data.CertId"));<NEW_LINE>data.setSlbType(_ctx.stringValue("DescribeIngressResponse.Data.SlbType"));<NEW_LINE>DefaultRule defaultRule = new DefaultRule();<NEW_LINE>defaultRule.setAppId<MASK><NEW_LINE>defaultRule.setContainerPort(_ctx.integerValue("DescribeIngressResponse.Data.DefaultRule.ContainerPort"));<NEW_LINE>defaultRule.setAppName(_ctx.stringValue("DescribeIngressResponse.Data.DefaultRule.AppName"));<NEW_LINE>data.setDefaultRule(defaultRule);<NEW_LINE>List<Rule> rules = new ArrayList<Rule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeIngressResponse.Data.Rules.Length"); i++) {<NEW_LINE>Rule rule = new Rule();<NEW_LINE>rule.setAppId(_ctx.stringValue("DescribeIngressResponse.Data.Rules[" + i + "].AppId"));<NEW_LINE>rule.setContainerPort(_ctx.integerValue("DescribeIngressResponse.Data.Rules[" + i + "].ContainerPort"));<NEW_LINE>rule.setDomain(_ctx.stringValue("DescribeIngressResponse.Data.Rules[" + i + "].Domain"));<NEW_LINE>rule.setPath(_ctx.stringValue("DescribeIngressResponse.Data.Rules[" + i + "].Path"));<NEW_LINE>rule.setAppName(_ctx.stringValue("DescribeIngressResponse.Data.Rules[" + i + "].AppName"));<NEW_LINE>rules.add(rule);<NEW_LINE>}<NEW_LINE>data.setRules(rules);<NEW_LINE>describeIngressResponse.setData(data);<NEW_LINE>return describeIngressResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeIngressResponse.Data.DefaultRule.AppId"));
894,452
public ProjectInternal findProject(String projectPath, ProjectInternal startProject) throws ProjectLookupException {<NEW_LINE>// We save the original path, as we are going to mangle the variable<NEW_LINE>String originalProjectPath = projectPath;<NEW_LINE>MatchedProject matchedProject;<NEW_LINE>if (projectPath.startsWith(Project.PATH_SEPARATOR)) {<NEW_LINE>// If a path start with a separator, we handle it as an absolute path,<NEW_LINE>// and get the root project instead of the current project<NEW_LINE>matchedProject = new MatchedProject(startProject.getRootProject(), false);<NEW_LINE>// As we already got the root project, we should handle the path as a relative one,<NEW_LINE>// by cutting the path separator off<NEW_LINE>projectPath = projectPath.substring(1);<NEW_LINE>} else {<NEW_LINE>matchedProject = new MatchedProject(startProject, false);<NEW_LINE>}<NEW_LINE>String[] components = projectPath.split(Project.PATH_SEPARATOR);<NEW_LINE>for (final String component : components) {<NEW_LINE>// Should be checked, as split above can cause troubles,<NEW_LINE>// if the input is only an empty string<NEW_LINE>if (!component.isEmpty()) {<NEW_LINE>// Descend, and try to resolve the child project<NEW_LINE>matchedProject = resolveProject(component, matchedProject);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matchedProject.isPatternMatched()) {<NEW_LINE>LOGGER.info("Abbreviated project name '{}' matched '{}'", originalProjectPath, matchedProject.<MASK><NEW_LINE>} else {<NEW_LINE>LOGGER.info("Project name matched '{}'", matchedProject.getProject().getPath());<NEW_LINE>}<NEW_LINE>return (ProjectInternal) matchedProject.getProject();<NEW_LINE>}
getProject().getPath());
703,691
private TypeBindings _bindingsForSubtype(JavaType baseType, int typeParamCount, Class<?> subclass, boolean relaxedCompatibilityCheck) {<NEW_LINE>PlaceholderForType[] placeholders = new PlaceholderForType[typeParamCount];<NEW_LINE>for (int i = 0; i < typeParamCount; ++i) {<NEW_LINE>placeholders[i] = new PlaceholderForType(i);<NEW_LINE>}<NEW_LINE>TypeBindings b = TypeBindings.create(subclass, placeholders);<NEW_LINE>// First: pseudo-resolve to get placeholders in place:<NEW_LINE>JavaType tmpSub = _fromClass(null, subclass, b);<NEW_LINE>// Then find super-type<NEW_LINE>JavaType baseWithPlaceholders = tmpSub.findSuperType(baseType.getRawClass());<NEW_LINE>if (baseWithPlaceholders == null) {<NEW_LINE>// should be found but...<NEW_LINE>throw new IllegalArgumentException(String.format("Internal error: unable to locate supertype (%s) from resolved subtype %s", baseType.getRawClass().getName()<MASK><NEW_LINE>}<NEW_LINE>// and traverse type hierarchies to both verify and to resolve placeholders<NEW_LINE>String error = _resolveTypePlaceholders(baseType, baseWithPlaceholders);<NEW_LINE>if (error != null) {<NEW_LINE>// 28-Mar-2020, tatu: As per [databind#2632], need to ignore the issue in<NEW_LINE>// some cases. For now, just fully ignore; may need to refine in future<NEW_LINE>if (!relaxedCompatibilityCheck) {<NEW_LINE>throw new IllegalArgumentException("Failed to specialize base type " + baseType.toCanonical() + " as " + subclass.getName() + ", problem: " + error);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final JavaType[] typeParams = new JavaType[typeParamCount];<NEW_LINE>for (int i = 0; i < typeParamCount; ++i) {<NEW_LINE>JavaType t = placeholders[i].actualType();<NEW_LINE>// 18-Oct-2017, tatu: Looks like sometimes we have incomplete bindings (even if not<NEW_LINE>// common, it is possible if subtype is type-erased class with added type<NEW_LINE>// variable -- see test(s) with "bogus" type(s)).<NEW_LINE>if (t == null) {<NEW_LINE>t = unknownType();<NEW_LINE>}<NEW_LINE>typeParams[i] = t;<NEW_LINE>}<NEW_LINE>return TypeBindings.create(subclass, typeParams);<NEW_LINE>}
, subclass.getName()));
1,570,287
/* Filtering functionality */<NEW_LINE>@Override<NEW_LINE>public void addContainerFilter(Filter filter) throws UnsupportedFilterException {<NEW_LINE>if (filterableContainer == null) {<NEW_LINE>throw new UnsupportedOperationException("Wrapped container is not filterable");<NEW_LINE>}<NEW_LINE>List<Filter> addedFilters = new ArrayList<Filter>();<NEW_LINE>for (Entry<?, PropertyValueGenerator<?>> entry : propertyGenerators.entrySet()) {<NEW_LINE><MASK><NEW_LINE>if (filter.appliesToProperty(property)) {<NEW_LINE>// Have generated property modify filter to fit the original<NEW_LINE>// data in the container.<NEW_LINE>Filter modifiedFilter = entry.getValue().modifyFilter(filter);<NEW_LINE>filterableContainer.addContainerFilter(modifiedFilter);<NEW_LINE>// Keep track of added filters<NEW_LINE>addedFilters.add(modifiedFilter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (addedFilters.isEmpty()) {<NEW_LINE>// No generated property modified this filter, use it as is<NEW_LINE>addedFilters.add(filter);<NEW_LINE>filterableContainer.addContainerFilter(filter);<NEW_LINE>}<NEW_LINE>// Map filter to actually added filters<NEW_LINE>activeFilters.put(filter, addedFilters);<NEW_LINE>}
Object property = entry.getKey();
1,411,800
private void createTransformSettingsArea(Composite composite) {<NEW_LINE>Composite settingsPanel = UIUtils.createComposite(composite, 1);<NEW_LINE>if (composite.getLayout() instanceof GridLayout) {<NEW_LINE>settingsPanel.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>}<NEW_LINE>final Composite placeholder = UIUtils.createComposite(settingsPanel, 2);<NEW_LINE>UIUtils.createLabelText(placeholder, "Transformer", transformer.getName(), SWT.READ_ONLY);<NEW_LINE>Label infoLabel = UIUtils.createControlLabel(placeholder, "Info");<NEW_LINE>infoLabel.setLayoutData(<MASK><NEW_LINE>infoText = new Text(placeholder, SWT.READ_ONLY | SWT.WRAP);<NEW_LINE>GridData gd = new GridData(GridData.FILL_HORIZONTAL);<NEW_LINE>gd.widthHint = 300;<NEW_LINE>infoText.setLayoutData(gd);<NEW_LINE>propertiesEditor = new PropertyTreeViewer(settingsPanel, SWT.BORDER);<NEW_LINE>propertiesEditor.getControl().setFocus();<NEW_LINE>}
new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
1,833,579
public static List<Star> findClosestKStars(Iterator<Star> stars, int k) {<NEW_LINE>// maxHeap to store the closest k stars seen so far.<NEW_LINE>PriorityQueue<Star> maxHeap = new PriorityQueue<>(k, Collections.reverseOrder());<NEW_LINE>while (stars.hasNext()) {<NEW_LINE>// Add each star to the max-heap. If the max-heap size exceeds k, remove<NEW_LINE>// the maximum element from the max-heap.<NEW_LINE><MASK><NEW_LINE>maxHeap.add(star);<NEW_LINE>if (maxHeap.size() == k + 1) {<NEW_LINE>maxHeap.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Iteratively extract from the max-heap, which yields the stars sorted<NEW_LINE>// according from furthest to closest.<NEW_LINE>return Stream.generate(maxHeap::remove).limit(maxHeap.size()).collect(Collectors.toList());<NEW_LINE>}
Star star = stars.next();
1,445,397
public static void vaccinate(Person person, long time, int series) {<NEW_LINE>HealthRecord.Code encounterCode = new HealthRecord.Code("http://snomed.info/sct", "33879002", "Administration of vaccine to produce active immunity (procedure)");<NEW_LINE>EncounterModule.createEncounter(person, time, HealthRecord.EncounterType.OUTPATIENT, ClinicianSpecialty.GENERAL_PRACTICE, encounterCode);<NEW_LINE>HealthRecord.Immunization immunization = person.record.immunization(time, "COVID19");<NEW_LINE>immunization.series = series;<NEW_LINE>C19Vaccine vaccine = C19Vaccine.EUAs.get(person.attributes.get(C19_VACCINE));<NEW_LINE>HealthRecord.Code immCode = new HealthRecord.Code("http://hl7.org/fhir/sid/cvx", vaccine.getCvx(), vaccine.getDisplay());<NEW_LINE>immunization.codes.add(immCode);<NEW_LINE>Map<String, List<Long>> immunizationHistory = (Map<String, List<Long>>) person.attributes.get(Immunizations.IMMUNIZATIONS);<NEW_LINE>if (immunizationHistory == null) {<NEW_LINE>immunizationHistory = new HashMap<>();<NEW_LINE>person.attributes.put(Immunizations.IMMUNIZATIONS, immunizationHistory);<NEW_LINE>}<NEW_LINE>List<Long> <MASK><NEW_LINE>if (covidImmunizationHistory == null) {<NEW_LINE>covidImmunizationHistory = new ArrayList<>();<NEW_LINE>immunizationHistory.put(C19_PERSON_ATTRS_KEY, covidImmunizationHistory);<NEW_LINE>}<NEW_LINE>covidImmunizationHistory.add(time);<NEW_LINE>person.record.encounterEnd(time + Utilities.convertTime("minutes", 15), HealthRecord.EncounterType.OUTPATIENT);<NEW_LINE>}
covidImmunizationHistory = immunizationHistory.get(C19_PERSON_ATTRS_KEY);
58,939
public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {<NEW_LINE>// ajax<NEW_LINE>if (AjaxUtils.isAjaxRequest(request)) {<NEW_LINE>PrintWriter writer = null;<NEW_LINE>try {<NEW_LINE>writer = response.getWriter();<NEW_LINE>RestfulResponse restfulResponse = new RestfulResponse();<NEW_LINE>restfulResponse.setSuccess(false);<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>ex.printStackTrace(new PrintWriter(sw));<NEW_LINE>restfulResponse.setMsg(sw.toString());<NEW_LINE>String json = JSON.toJSONString(restfulResponse);<NEW_LINE>assert json != null;<NEW_LINE>writer.write(json);<NEW_LINE>writer.flush();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.error(<MASK><NEW_LINE>// request.setAttribute("message", ex.getMessage());<NEW_LINE>// return new ModelAndView("common/error");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
ex.getMessage(), ex);
309,703
private Map<String, Long> estimateRootEntries(Map<String, String> aliasClasses, Map<String, OWhereClause> aliasFilters, OCommandContext ctx) {<NEW_LINE>Set<String> allAliases = new LinkedHashSet<String>();<NEW_LINE>allAliases.addAll(aliasClasses.keySet());<NEW_LINE>allAliases.addAll(aliasFilters.keySet());<NEW_LINE>OSchema schema = getDatabase().getMetadata().getSchema();<NEW_LINE>Map<String, Long> result = new LinkedHashMap<String, Long>();<NEW_LINE>for (String alias : allAliases) {<NEW_LINE>String <MASK><NEW_LINE>if (className == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!schema.existsClass(className)) {<NEW_LINE>throw new OCommandExecutionException("class not defined: " + className);<NEW_LINE>}<NEW_LINE>OClass oClass = schema.getClass(className);<NEW_LINE>long upperBound;<NEW_LINE>OWhereClause filter = aliasFilters.get(alias);<NEW_LINE>if (filter != null) {<NEW_LINE>List<String> aliasesOnPattern = filter.baseExpression.getMatchPatternInvolvedAliases();<NEW_LINE>if (aliasesOnPattern != null && aliasesOnPattern.size() > 0) {<NEW_LINE>// skip root nodes that have a condition on $matched, because they have to be calculated<NEW_LINE>// as downstream<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>upperBound = filter.estimate(oClass, this.threshold, ctx);<NEW_LINE>} else {<NEW_LINE>upperBound = oClass.count();<NEW_LINE>}<NEW_LINE>result.put(alias, upperBound);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
className = aliasClasses.get(alias);
1,803,930
private static String memoryToString(final Memory srcMem, final boolean isDoublesSketch) {<NEW_LINE>// either 1 or 2<NEW_LINE>final int preLongs = extractPreLongs(srcMem);<NEW_LINE>final int serVer = extractSerVer(srcMem);<NEW_LINE>final int familyID = extractFamilyID(srcMem);<NEW_LINE>final String famName = idToFamily(familyID).toString();<NEW_LINE>final int flags = extractFlags(srcMem);<NEW_LINE>final boolean bigEndian = (flags & BIG_ENDIAN_FLAG_MASK) > 0;<NEW_LINE>final String nativeOrder = ByteOrder.nativeOrder().toString();<NEW_LINE>final boolean readOnly = (flags & READ_ONLY_FLAG_MASK) > 0;<NEW_LINE>final boolean empty = (flags & EMPTY_FLAG_MASK) > 0;<NEW_LINE>final boolean compact = (flags & COMPACT_FLAG_MASK) > 0;<NEW_LINE>final boolean ordered = (flags & ORDERED_FLAG_MASK) > 0;<NEW_LINE>final int k = extractK(srcMem);<NEW_LINE>final long n = (preLongs == 1) ? 0L : extractN(srcMem);<NEW_LINE>double minDouble = Double.NaN;<NEW_LINE>double maxDouble = Double.NaN;<NEW_LINE>if ((preLongs > 1) && isDoublesSketch) {<NEW_LINE>// preLongs = 2 or 3<NEW_LINE>minDouble = extractMinDouble(srcMem);<NEW_LINE>maxDouble = extractMaxDouble(srcMem);<NEW_LINE>}<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(LS);<NEW_LINE>sb.append("### QUANTILES SKETCH PREAMBLE SUMMARY:").append(LS);<NEW_LINE>sb.append("Byte 0: Preamble Longs : ").append(preLongs).append(LS);<NEW_LINE>sb.append("Byte 1: Serialization Version: ").append(serVer).append(LS);<NEW_LINE>sb.append("Byte 2: Family : ").append(famName).append(LS);<NEW_LINE>sb.append("Byte 3: Flags Field : ").append(String.format("%02o", flags)).append(LS);<NEW_LINE>sb.append(" BIG ENDIAN : ").append(bigEndian).append(LS);<NEW_LINE>sb.append(" (Native Byte Order) : ").append(nativeOrder).append(LS);<NEW_LINE>sb.append(" READ ONLY : ").append<MASK><NEW_LINE>sb.append(" EMPTY : ").append(empty).append(LS);<NEW_LINE>sb.append(" COMPACT : ").append(compact).append(LS);<NEW_LINE>sb.append(" ORDERED : ").append(ordered).append(LS);<NEW_LINE>sb.append("Bytes 4-5 : K : ").append(k).append(LS);<NEW_LINE>if (preLongs == 1) {<NEW_LINE>sb.append(" --ABSENT, ASSUMED:").append(LS);<NEW_LINE>}<NEW_LINE>sb.append("Bytes 8-15 : N : ").append(n).append(LS);<NEW_LINE>if (isDoublesSketch) {<NEW_LINE>sb.append("MinDouble : ").append(minDouble).append(LS);<NEW_LINE>sb.append("MaxDouble : ").append(maxDouble).append(LS);<NEW_LINE>}<NEW_LINE>sb.append("Retained Items : ").append(computeRetainedItems(k, n)).append(LS);<NEW_LINE>sb.append("Total Bytes : ").append(srcMem.getCapacity()).append(LS);<NEW_LINE>sb.append("### END SKETCH PREAMBLE SUMMARY").append(LS);<NEW_LINE>return sb.toString();<NEW_LINE>}
(readOnly).append(LS);
1,714,433
public static void drawImage(int width, int height, String text, OutputStream outputStream) throws IOException {<NEW_LINE>BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>Graphics g = bufferedImage.getGraphics();<NEW_LINE>g.setColor(getRandColor(210, 255));<NEW_LINE>g.fillRect(0, 0, width, height);<NEW_LINE>if (CommonUtils.notEmpty(text)) {<NEW_LINE>int fontWidth = width / text.length();<NEW_LINE>int fontSize = fontWidth <MASK><NEW_LINE>Font font1 = getFont(fontSize);<NEW_LINE>Font font2 = getFont(fontSize / 2);<NEW_LINE>for (int i = 0; i < text.length(); i++) {<NEW_LINE>g.setFont(font1);<NEW_LINE>g.setColor(getRandColor(0, 200));<NEW_LINE>g.drawString(String.valueOf(text.charAt(i)), i * fontWidth + 3, height - Constants.random.nextInt(height - fontSize));<NEW_LINE>g.setFont(font2);<NEW_LINE>for (int j = 0; j < 4; j++) {<NEW_LINE>g.setColor(getRandColor(100, 250));<NEW_LINE>g.drawString(String.valueOf(text.charAt(i)), Constants.random.nextInt(width), Constants.random.nextInt(height));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ImageIO.write(bufferedImage, "png", outputStream);<NEW_LINE>}
>= height ? height - 1 : fontWidth;
1,472,390
private ListenableFuture<?> rollupThroughputFromRows(RollupParams rollup, AggregateQuery query, Iterable<Row> rows) throws Exception {<NEW_LINE>long transactionCount = 0;<NEW_LINE>// error_count is null for data inserted prior to glowroot central 0.9.18<NEW_LINE>// rolling up any interval with null error_count should result in null error_count<NEW_LINE>boolean hasMissingErrorCount = false;<NEW_LINE>long errorCount = 0;<NEW_LINE>for (Row row : rows) {<NEW_LINE>transactionCount += row.getLong(0);<NEW_LINE>if (row.isNull(1)) {<NEW_LINE>hasMissingErrorCount = true;<NEW_LINE>} else {<NEW_LINE>errorCount += row.getLong(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BoundStatement boundStatement;<NEW_LINE>if (query.transactionName() == null) {<NEW_LINE>boundStatement = getInsertOverallPS(throughputTable, rollup.rollupLevel()).bind();<NEW_LINE>} else {<NEW_LINE>boundStatement = getInsertTransactionPS(throughputTable, rollup.<MASK><NEW_LINE>}<NEW_LINE>int i = 0;<NEW_LINE>boundStatement.setString(i++, rollup.agentRollupId());<NEW_LINE>boundStatement.setString(i++, query.transactionType());<NEW_LINE>if (query.transactionName() != null) {<NEW_LINE>boundStatement.setString(i++, query.transactionName());<NEW_LINE>}<NEW_LINE>boundStatement.setTimestamp(i++, new Date(query.to()));<NEW_LINE>boundStatement.setLong(i++, transactionCount);<NEW_LINE>if (hasMissingErrorCount) {<NEW_LINE>boundStatement.setToNull(i++);<NEW_LINE>} else {<NEW_LINE>boundStatement.setLong(i++, errorCount);<NEW_LINE>}<NEW_LINE>boundStatement.setInt(i++, rollup.adjustedTTL().generalTTL());<NEW_LINE>return session.writeAsync(boundStatement);<NEW_LINE>}
rollupLevel()).bind();
352,266
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>View rootView = inflater.inflate(R.layout.fragment_navigation_drawer, container, false);<NEW_LINE>View btn = requireViewById(<MASK><NEW_LINE>btn.setOnClickListener(v -> onAboutClick());<NEW_LINE>btn = requireViewById(rootView, R.id.drawer_app_prefs_btn);<NEW_LINE>btn.setOnClickListener(v -> onPrefsClick());<NEW_LINE>btn = requireViewById(rootView, R.id.drawer_tools_btn);<NEW_LINE>btn.setOnClickListener(v -> onToolsClick());<NEW_LINE>btn = requireViewById(rootView, R.id.drawer_app_queue_btn);<NEW_LINE>btn.setOnClickListener(v -> onQueueClick());<NEW_LINE>aboutBadge = requireViewById(rootView, R.id.drawer_about_badge_btn);<NEW_LINE>fastAdapter.setOnClickListener((v, a, i, p) -> onItemClick(p));<NEW_LINE>recyclerView = requireViewById(rootView, R.id.drawer_list);<NEW_LINE>recyclerView.setAdapter(fastAdapter);<NEW_LINE>updateItems();<NEW_LINE>Preferences.registerPrefsChangedListener(prefsListener);<NEW_LINE>return rootView;<NEW_LINE>}
rootView, R.id.drawer_about_btn);
1,177,153
private void registerAttributeHandlers(final ReadManager reader) {<NEW_LINE>final IAttributeHandler vShiftHandler = new IAttributeHandler() {<NEW_LINE><NEW_LINE>public void setAttribute(final Object userObject, final String value) {<NEW_LINE>final NodeModel node = (NodeModel) userObject;<NEW_LINE>LocationModel.createLocationModel(node).setShiftY(Quantity.fromString(value, LengthUnit.px));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_NODE, "VSHIFT", vShiftHandler);<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_NODE, "VSHIFT_QUANTITY", vShiftHandler);<NEW_LINE>final IAttributeHandler vgapHandler = new IAttributeHandler() {<NEW_LINE><NEW_LINE>public void setAttribute(final Object userObject, final String value) {<NEW_LINE>final NodeModel node = (NodeModel) userObject;<NEW_LINE>LocationModel.createLocationModel(node).setVGap(Quantity.fromString<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_NODE, "VGAP", vgapHandler);<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_NODE, "VGAP_QUANTITY", vgapHandler);<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_STYLENODE, "VGAP", vgapHandler);<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_STYLENODE, "VGAP_QUANTITY", vgapHandler);<NEW_LINE>final IAttributeHandler hgapHandler = new IAttributeHandler() {<NEW_LINE><NEW_LINE>public void setAttribute(final Object userObject, final String value) {<NEW_LINE>final NodeModel node = (NodeModel) userObject;<NEW_LINE>LocationModel.createLocationModel(node).setHGap(Quantity.fromString(value, LengthUnit.px));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_NODE, "HGAP_QUANTITY", hgapHandler);<NEW_LINE>reader.addAttributeHandler(NodeBuilder.XML_NODE, "HGAP", hgapHandler);<NEW_LINE>}
(value, LengthUnit.px));
832,750
public ExecutionContext deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {<NEW_LINE>ObjectCodec oc = jsonParser.getCodec();<NEW_LINE>JsonNode node = oc.readTree(jsonParser);<NEW_LINE>final ExecutionContext executionContext = new ExecutionContext();<NEW_LINE>final boolean dirty = node.get("dirty").asBoolean();<NEW_LINE>for (JsonNode valueNode : node.get("values")) {<NEW_LINE>final JsonNode nodeValue = valueNode.fields().next().getValue();<NEW_LINE>final String nodeKey = valueNode.fields().next().getKey();<NEW_LINE>if (nodeValue.isNumber() && !nodeValue.isFloatingPointNumber() && nodeValue.canConvertToInt()) {<NEW_LINE>executionContext.putInt(nodeKey, nodeValue.asInt());<NEW_LINE>} else if (nodeValue.isNumber() && !nodeValue.isFloatingPointNumber() && nodeValue.canConvertToLong()) {<NEW_LINE>executionContext.putLong(nodeKey, nodeValue.asLong());<NEW_LINE>} else if (nodeValue.isFloatingPointNumber()) {<NEW_LINE>executionContext.putDouble(nodeKey, nodeValue.asDouble());<NEW_LINE>} else if (nodeValue.isBoolean()) {<NEW_LINE>executionContext.putString(nodeKey, String.valueOf<MASK><NEW_LINE>} else if (nodeValue.isTextual()) {<NEW_LINE>executionContext.putString(nodeKey, nodeValue.asText());<NEW_LINE>} else {<NEW_LINE>executionContext.put(nodeKey, nodeValue.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!dirty && executionContext.isDirty()) {<NEW_LINE>executionContext.clearDirtyFlag();<NEW_LINE>}<NEW_LINE>return executionContext;<NEW_LINE>}
(nodeValue.asBoolean()));
26,742
protected boolean verifyEnvironMarkerData(Map<String, String> markerData, Environment env, Iterable<String> keys) throws InterruptedException {<NEW_LINE>Map<String, String> environ = <MASK><NEW_LINE>if (env.valuesMissing()) {<NEW_LINE>// Returns false so caller knows to return immediately<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Map<String, String> repoEnvOverride = PrecomputedValue.REPO_ENV.get(env);<NEW_LINE>if (repoEnvOverride == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Only depend on --repo_env values that are specified in the "environ" attribute.<NEW_LINE>Map<String, String> repoEnv = new LinkedHashMap<>(environ);<NEW_LINE>for (String key : keys) {<NEW_LINE>String value = repoEnvOverride.get(key);<NEW_LINE>if (value != null) {<NEW_LINE>repoEnv.put(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Verify that all environment variable in the marker file are also in keys<NEW_LINE>for (String key : markerData.keySet()) {<NEW_LINE>if (key.startsWith("ENV:") && !repoEnv.containsKey(key.substring(4))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Now verify the values of the marker data<NEW_LINE>for (Map.Entry<String, String> value : repoEnv.entrySet()) {<NEW_LINE>if (!markerData.containsKey("ENV:" + value.getKey())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String markerValue = markerData.get("ENV:" + value.getKey());<NEW_LINE>if (!Objects.equals(markerValue, value.getValue())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
ActionEnvironmentFunction.getEnvironmentView(env, keys);
1,048,910
public ByteBuffer readBinaryValue(long chain) {<NEW_LINE>// first get total element size and allocate buffer<NEW_LINE>long element = chain + this.totalChainHeaderSize;<NEW_LINE>int totalLength = DETACHED_CONTIGUOUS_CHAIN_HEADER_SIZE;<NEW_LINE>do {<NEW_LINE>totalLength += ELEMENT_HEADER_SIZE + readElementLength(element);<NEW_LINE>element = storage.readLong(element + ELEMENT_HEADER_NEXT_OFFSET);<NEW_LINE>} while (element != chain);<NEW_LINE>final ByteBuffer <MASK><NEW_LINE>// one way for layers above to extract encoding is to put the encoding of the chain address in the value<NEW_LINE>detachedContiguousBuffer.putLong(chain);<NEW_LINE>// now add the elements to the buffer<NEW_LINE>element = chain + this.totalChainHeaderSize;<NEW_LINE>do {<NEW_LINE>final int startPosition = detachedContiguousBuffer.position();<NEW_LINE>detachedContiguousBuffer.put(storage.readBuffer(element, ELEMENT_HEADER_SIZE + readElementLength(element)));<NEW_LINE>detachedContiguousBuffer.mark();<NEW_LINE>detachedContiguousBuffer.putLong(startPosition + ELEMENT_HEADER_NEXT_OFFSET, -1L);<NEW_LINE>detachedContiguousBuffer.reset();<NEW_LINE>element = storage.readLong(element + ELEMENT_HEADER_NEXT_OFFSET);<NEW_LINE>} while (element != chain);<NEW_LINE>return (ByteBuffer) detachedContiguousBuffer.flip();<NEW_LINE>}
detachedContiguousBuffer = ByteBuffer.allocate(totalLength);
1,524,990
public void compute(double[][] seasonMatrix, int sP, int sQ, int season) {<NEW_LINE>// step 1: find CSS result<NEW_LINE>SCSSEstimate scssEstimate = new SCSSEstimate();<NEW_LINE>scssEstimate.compute(seasonMatrix, sP, sQ, season);<NEW_LINE>ArrayList<double[]> initCoef = new ArrayList<>();<NEW_LINE>initCoef.add(scssEstimate.sARCoef);<NEW_LINE>initCoef.add(scssEstimate.sMACoef);<NEW_LINE>initCoef.add(new double[] { scssEstimate.variance });<NEW_LINE>// step 2: set residual[i]=0, if i<initPoint; set data[i]=0, if i<initPoint<NEW_LINE>double[] cResidual = new double[seasonMatrix[0].length];<NEW_LINE>SMLEGradientTarget smleGT = new SMLEGradientTarget();<NEW_LINE>smleGT.fit(seasonMatrix, cResidual, initCoef, season);<NEW_LINE>AbstractGradientTarget problem = BFGS.solve(smleGT, 1000, 0.01, 0.000001, new int[] { 1, 2, 3 }, -1);<NEW_LINE>this.sResidual = problem.getResidual();<NEW_LINE>this.logLikelihood = -problem.getMinValue();<NEW_LINE>DenseMatrix result = problem.getFinalCoef();<NEW_LINE>this.warn = problem.getWarn();<NEW_LINE>this.sARCoef = new double[sP];<NEW_LINE>this.sMACoef = new double[sQ];<NEW_LINE>for (int i = 0; i < sP; i++) {<NEW_LINE>this.sARCoef[i] = result.get(i, 0);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < sQ; i++) {<NEW_LINE>this.sMACoef[i] = result.get(i + sP, 0);<NEW_LINE>}<NEW_LINE>this.variance = result.get(sP + sQ, 0);<NEW_LINE>boolean gradientSuccess = Boolean.TRUE;<NEW_LINE>if (problem.getIter() < 2) {<NEW_LINE>gradientSuccess = Boolean.FALSE;<NEW_LINE>}<NEW_LINE>if (gradientSuccess) {<NEW_LINE>DenseMatrix information = problem.getH();<NEW_LINE>this.sArStdError = new double[sP];<NEW_LINE>this.sMaStdError = new double[sQ];<NEW_LINE>for (int i = 0; i < sP; i++) {<NEW_LINE>this.sArStdError[i] = Math.sqrt(information.get(i, i));<NEW_LINE>if (Double.isNaN(this.sArStdError[i])) {<NEW_LINE>this.sArStdError[i] = -99;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < sQ; i++) {<NEW_LINE>this.sMaStdError[i] = Math.sqrt(information.get(i + sP, i + sP));<NEW_LINE>if (Double.isNaN(this.sMaStdError[i])) {<NEW_LINE>this.sMaStdError[i] = -99;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.varianceStdError = Math.sqrt(information.get(sP <MASK><NEW_LINE>if (Double.isNaN(this.varianceStdError)) {<NEW_LINE>this.varianceStdError = -99;<NEW_LINE>} else {<NEW_LINE>this.sArStdError = scssEstimate.sArStdError;<NEW_LINE>this.sMaStdError = scssEstimate.sMaStdError;<NEW_LINE>this.varianceStdError = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+ sQ, sP + sQ));
1,486,907
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>Display display = ((Activity) context).getWindowManager().getDefaultDisplay();<NEW_LINE>outMetrics = new DisplayMetrics();<NEW_LINE>display.getMetrics(outMetrics);<NEW_LINE>if (megaApi == null) {<NEW_LINE>megaApi = ((MegaApplication) ((Activity) context).getApplication()).getMegaApi();<NEW_LINE>}<NEW_LINE>if (megaApi.getRootNode() == null)<NEW_LINE>return null;<NEW_LINE>recentsItems = new ArrayList<>();<NEW_LINE>buckets = megaApi.getRecentActions();<NEW_LINE>View v = inflater.inflate(R.layout.fragment_recents, container, false);<NEW_LINE>emptyLayout = v.findViewById(R.id.empty_state_recents);<NEW_LINE>ImageView emptyImage = v.findViewById(R.id.empty_image_recents);<NEW_LINE>ConstraintLayout emptyView = v.findViewById(R.id.empty_layout);<NEW_LINE>ConstraintSet constraintSet = new ConstraintSet();<NEW_LINE>constraintSet.clone(emptyView);<NEW_LINE>if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {<NEW_LINE>emptyImage.setImageResource(R.drawable.empty_recents_landscape);<NEW_LINE>constraintSet.connect(R.id.empty_image_recents, ConstraintSet.TOP, R.id.parent, ConstraintSet.TOP, LANDSCAPE_EMPTY_IMAGE_MARGIN);<NEW_LINE>} else {<NEW_LINE>emptyImage.setImageResource(R.drawable.empty_recents_portrait);<NEW_LINE>constraintSet.connect(R.id.empty_image_recents, ConstraintSet.TOP, R.id.guideline, ConstraintSet.BOTTOM, 0);<NEW_LINE>}<NEW_LINE>constraintSet.applyTo(emptyView);<NEW_LINE>emptyText = v.findViewById(R.id.empty_text_recents);<NEW_LINE>showActivityButton = v.findViewById(R.id.show_activity_button);<NEW_LINE>showActivityButton.<MASK><NEW_LINE>String emptyString = formatEmptyScreenText(requireContext(), StringResourcesUtils.getString(R.string.context_empty_recents));<NEW_LINE>emptySpanned = HtmlCompat.fromHtml(emptyString, HtmlCompat.FROM_HTML_MODE_LEGACY);<NEW_LINE>String activityHiddenString = formatEmptyScreenText(requireContext(), StringResourcesUtils.getString(R.string.recents_activity_hidden));<NEW_LINE>activityHiddenSpanned = HtmlCompat.fromHtml(activityHiddenString, HtmlCompat.FROM_HTML_MODE_LEGACY);<NEW_LINE>listView = v.findViewById(R.id.list_view_recents);<NEW_LINE>fastScroller = v.findViewById(R.id.fastscroll);<NEW_LINE>stickyLayoutManager = new TopSnappedStickyLayoutManager(context, this);<NEW_LINE>listView.setLayoutManager(stickyLayoutManager);<NEW_LINE>listView.setClipToPadding(false);<NEW_LINE>listView.setItemAnimator(new DefaultItemAnimator());<NEW_LINE>fillRecentItems(buckets);<NEW_LINE>setRecentsView();<NEW_LINE>return v;<NEW_LINE>}
setOnClickListener(v1 -> showRecentActivity());
407,012
/* We need to play a little dance here.<NEW_LINE>* task hooks are a list of class names that need to be invoked at various times during a topology run.<NEW_LINE>* However because Heron operates in org.apache world and Strom in backtype.storm world, we<NEW_LINE>* pass a ITaskHookDelegate to Heron and remember the actual task hooks in an internal<NEW_LINE>* variable STORMCOMPAT_TOPOLOGY_AUTO_TASK_HOOKS<NEW_LINE>*/<NEW_LINE>private static void doTaskHooksTranslation(Config heronConfig) {<NEW_LINE>List<String> hooks = heronConfig.getAutoTaskHooks();<NEW_LINE>if (hooks != null && !hooks.isEmpty()) {<NEW_LINE>heronConfig.put(backtype.storm.Config.STORMCOMPAT_TOPOLOGY_AUTO_TASK_HOOKS, hooks);<NEW_LINE>List<String> <MASK><NEW_LINE>translationHooks.add(ITaskHookDelegate.class.getName());<NEW_LINE>heronConfig.setAutoTaskHooks(translationHooks);<NEW_LINE>}<NEW_LINE>}
translationHooks = new LinkedList<>();
693,274
private static BufferedImage joinBufferedImage(BufferedImage img1, BufferedImage img2) {<NEW_LINE>int wid = img1.getWidth() + img2.getWidth();<NEW_LINE>int height = Math.max(img1.getHeight(), img2.getHeight());<NEW_LINE>// create a new buffer and draw two image into the new image<NEW_LINE>BufferedImage newImage = new BufferedImage(wid, height, BufferedImage.TYPE_3BYTE_BGR);<NEW_LINE>Graphics2D g2 = newImage.createGraphics();<NEW_LINE>Color oldColor = g2.getColor();<NEW_LINE>// fill background<NEW_LINE><MASK><NEW_LINE>g2.fillRect(0, 0, wid, height);<NEW_LINE>// draw image<NEW_LINE>g2.setColor(oldColor);<NEW_LINE>g2.drawImage(img1, null, 0, 0);<NEW_LINE>g2.drawImage(img2, null, img1.getWidth(), 0);<NEW_LINE>g2.dispose();<NEW_LINE>return newImage;<NEW_LINE>}
g2.setPaint(Color.WHITE);
710,806
public void handleApplicationCommandRequest(SerialMessage serialMessage, int offset, int endpoint) {<NEW_LINE>logger.debug("NODE {}: Received Manufacture Specific Information", this.<MASK><NEW_LINE>int command = serialMessage.getMessagePayloadByte(offset);<NEW_LINE>switch(command) {<NEW_LINE>case MANUFACTURER_SPECIFIC_GET:<NEW_LINE>logger.warn("NODE {}: Command {} not implemented.", this.getNode().getNodeId(), command);<NEW_LINE>return;<NEW_LINE>case MANUFACTURER_SPECIFIC_REPORT:<NEW_LINE>logger.trace("Process Manufacturer Specific Report");<NEW_LINE>int tempMan = ((serialMessage.getMessagePayloadByte(offset + 1)) << 8) | (serialMessage.getMessagePayloadByte(offset + 2));<NEW_LINE>int tempDeviceType = ((serialMessage.getMessagePayloadByte(offset + 3)) << 8) | (serialMessage.getMessagePayloadByte(offset + 4));<NEW_LINE>int tempDeviceId = ((serialMessage.getMessagePayloadByte(offset + 5)) << 8) | (serialMessage.getMessagePayloadByte(offset + 6));<NEW_LINE>this.getNode().setManufacturer(tempMan);<NEW_LINE>this.getNode().setDeviceType(tempDeviceType);<NEW_LINE>this.getNode().setDeviceId(tempDeviceId);<NEW_LINE>logger.debug(String.format("NODE %d: Manufacturer ID = 0x%04x", this.getNode().getNodeId(), this.getNode().getManufacturer()));<NEW_LINE>logger.debug(String.format("NODE %d: Device Type = 0x%04x", this.getNode().getNodeId(), this.getNode().getDeviceType()));<NEW_LINE>logger.debug(String.format("NODE %d: Device ID = 0x%04x", this.getNode().getNodeId(), this.getNode().getDeviceId()));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.warn(String.format("NODE %d: Unsupported Command 0x%02X for command class %s (0x%02X).", this.getNode().getNodeId(), command, this.getCommandClass().getLabel(), this.getCommandClass().getKey()));<NEW_LINE>}<NEW_LINE>}
getNode().getNodeId());
1,006,942
public Request<MergeShardsRequest> marshall(MergeShardsRequest mergeShardsRequest) {<NEW_LINE>if (mergeShardsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(MergeShardsRequest)");<NEW_LINE>}<NEW_LINE>Request<MergeShardsRequest> request = new DefaultRequest<MergeShardsRequest>(mergeShardsRequest, "AmazonKinesis");<NEW_LINE>String target = "Kinesis_20131202.MergeShards";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (mergeShardsRequest.getStreamName() != null) {<NEW_LINE>String streamName = mergeShardsRequest.getStreamName();<NEW_LINE>jsonWriter.name("StreamName");<NEW_LINE>jsonWriter.value(streamName);<NEW_LINE>}<NEW_LINE>if (mergeShardsRequest.getShardToMerge() != null) {<NEW_LINE>String shardToMerge = mergeShardsRequest.getShardToMerge();<NEW_LINE>jsonWriter.name("ShardToMerge");<NEW_LINE>jsonWriter.value(shardToMerge);<NEW_LINE>}<NEW_LINE>if (mergeShardsRequest.getAdjacentShardToMerge() != null) {<NEW_LINE>String adjacentShardToMerge = mergeShardsRequest.getAdjacentShardToMerge();<NEW_LINE>jsonWriter.name("AdjacentShardToMerge");<NEW_LINE>jsonWriter.value(adjacentShardToMerge);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer<MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
.toString(content.length));
52,307
private List<Field> convert(FieldDeclaration fieldDeclaration) {<NEW_LINE>List<Field> fields = new ArrayList<>();<NEW_LINE>for (Object object : fieldDeclaration.fragments()) {<NEW_LINE>org.eclipse.jdt.core.dom.VariableDeclarationFragment fragment = (org.eclipse.jdt.core.dom.VariableDeclarationFragment) object;<NEW_LINE>Expression initializer;<NEW_LINE><MASK><NEW_LINE>if (variableBinding.getConstantValue() == null) {<NEW_LINE>initializer = convertOrNull(fragment.getInitializer());<NEW_LINE>} else {<NEW_LINE>initializer = convertConstantToLiteral(variableBinding.getConstantValue(), JdtUtils.createTypeDescriptor(variableBinding.getType()));<NEW_LINE>}<NEW_LINE>Field field = Field.Builder.from(JdtUtils.createFieldDescriptor(variableBinding)).setInitializer(initializer).setSourcePosition(getSourcePosition(fieldDeclaration)).setNameSourcePosition(getSourcePosition(fragment.getName())).build();<NEW_LINE>fields.add(field);<NEW_LINE>}<NEW_LINE>return fields;<NEW_LINE>}
IVariableBinding variableBinding = fragment.resolveBinding();
1,435,921
public static void down(GrayF64 input, GrayF64 output) {<NEW_LINE>int maxY = input.height - input.height % 2;<NEW_LINE>int maxX = input.width - input.width % 2;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxY, 2, y -> {<NEW_LINE>for (int y = 0; y < maxY; y += 2) {<NEW_LINE>int indexOut = output.startIndex + (y / 2) * output.stride;<NEW_LINE>int indexIn0 = input.startIndex + y * input.stride;<NEW_LINE>int indexIn1 = indexIn0 + input.stride;<NEW_LINE>for (int x = 0; x < maxX; x += 2) {<NEW_LINE>double total <MASK><NEW_LINE>total += input.data[indexIn0++];<NEW_LINE>total += input.data[indexIn1++];<NEW_LINE>total += input.data[indexIn1++];<NEW_LINE>output.data[indexOut++] = (total / 4);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>if (maxX != input.width) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxY, 2, y -> {<NEW_LINE>for (int y = 0; y < maxY; y += 2) {<NEW_LINE>int indexOut = output.startIndex + (y / 2) * output.stride + output.width - 1;<NEW_LINE>int indexIn0 = input.startIndex + y * input.stride + maxX;<NEW_LINE>int indexIn1 = indexIn0 + input.stride;<NEW_LINE>double total = input.data[indexIn0];<NEW_LINE>total += input.data[indexIn1];<NEW_LINE>output.data[indexOut] = (total / 2);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>if (maxY != input.height) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, maxX, 2, x -> {<NEW_LINE>for (int x = 0; x < maxX; x += 2) {<NEW_LINE>int indexOut = output.startIndex + (output.height - 1) * output.stride + x / 2;<NEW_LINE>int indexIn0 = input.startIndex + (input.height - 1) * input.stride + x;<NEW_LINE>double total = input.data[indexIn0++];<NEW_LINE>total += input.data[indexIn0++];<NEW_LINE>output.data[indexOut++] = (total / 2);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>if (maxX != input.width && maxY != input.height) {<NEW_LINE>int indexOut = output.startIndex + (output.height - 1) * output.stride + output.width - 1;<NEW_LINE>int indexIn = input.startIndex + (input.height - 1) * input.stride + input.width - 1;<NEW_LINE>output.data[indexOut] = input.data[indexIn];<NEW_LINE>}<NEW_LINE>}
= input.data[indexIn0++];
249,140
/*<NEW_LINE>* Parses the reference pointer to an index array that contains document, sentence, and opinion indexes.<NEW_LINE>*/<NEW_LINE>public static int[] parseRefPointerToIndexArray(String assessmentPointer) {<NEW_LINE>// The pattern always start with character '#', the assessment index will existing in specified sentence, which<NEW_LINE>// is under specified document.<NEW_LINE>// example: #/documents/0/sentences/0/assessments/0<NEW_LINE>final Matcher matcher = PATTERN.matcher(assessmentPointer);<NEW_LINE>final boolean isMatched = matcher.find();<NEW_LINE>// The first index represents the document index, second one represents the sentence index,<NEW_LINE>// third ond represents the assessment index.<NEW_LINE>final int[] result = new int[3];<NEW_LINE>if (isMatched) {<NEW_LINE>result[0] = Integer.parseInt(matcher.group(1));<NEW_LINE>result[1] = Integer.parseInt(matcher.group(2));<NEW_LINE>result[2] = Integer.parseInt<MASK><NEW_LINE>} else {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalStateException(String.format("'%s' is not a valid assessment pointer.", assessmentPointer)));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(matcher.group(3));
632,369
public float[] eval(float[] input) throws IOException {<NEW_LINE>// This involves linear interpolation based on a set of sample points.<NEW_LINE>// Theoretically it's not that difficult ... see section 3.9.1 of the PDF Reference.<NEW_LINE>float[] sizeValues = getSize().toFloatArray();<NEW_LINE>int bitsPerSample = getBitsPerSample();<NEW_LINE>float maxSample = (float) (Math.pow(2, bitsPerSample) - 1.0);<NEW_LINE>int numberOfInputValues = input.length;<NEW_LINE>int numberOfOutputValues = getNumberOfOutputParameters();<NEW_LINE>int[] inputPrev = new int[numberOfInputValues];<NEW_LINE>int[] inputNext = new int[numberOfInputValues];<NEW_LINE>// PDFBOX-4461<NEW_LINE>input = input.clone();<NEW_LINE>for (int i = 0; i < numberOfInputValues; i++) {<NEW_LINE>PDRange domain = getDomainForInput(i);<NEW_LINE>PDRange encodeValues = getEncodeForParameter(i);<NEW_LINE>input[i] = clipToRange(input[i], domain.getMin(<MASK><NEW_LINE>input[i] = interpolate(input[i], domain.getMin(), domain.getMax(), encodeValues.getMin(), encodeValues.getMax());<NEW_LINE>input[i] = clipToRange(input[i], 0, sizeValues[i] - 1);<NEW_LINE>inputPrev[i] = (int) Math.floor(input[i]);<NEW_LINE>inputNext[i] = (int) Math.ceil(input[i]);<NEW_LINE>}<NEW_LINE>float[] outputValues = new Rinterpol(input, inputPrev, inputNext).rinterpolate();<NEW_LINE>for (int i = 0; i < numberOfOutputValues; i++) {<NEW_LINE>PDRange range = getRangeForOutput(i);<NEW_LINE>PDRange decodeValues = getDecodeForParameter(i);<NEW_LINE>outputValues[i] = interpolate(outputValues[i], 0, maxSample, decodeValues.getMin(), decodeValues.getMax());<NEW_LINE>outputValues[i] = clipToRange(outputValues[i], range.getMin(), range.getMax());<NEW_LINE>}<NEW_LINE>return outputValues;<NEW_LINE>}
), domain.getMax());
1,007,038
private void addMarkers() {<NEW_LINE>map.addMarker(new MarkerOptions().position(BRISBANE).title("Brisbane"));<NEW_LINE>map.addMarker(new MarkerOptions().position(MELBOURNE).title("Melbourne").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE)));<NEW_LINE>map.addMarker(new MarkerOptions().position(SYDNEY).title("Sydney").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)));<NEW_LINE>map.addMarker(new MarkerOptions().position(ADELAIDE).title("Adelaide").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_YELLOW)));<NEW_LINE>map.addMarker(new MarkerOptions().position(PERTH).title("Perth").icon(BitmapDescriptorFactory.<MASK><NEW_LINE>}
defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA)));
166,898
// returns a tight rect with CW winding<NEW_LINE>public static ConvexHull2D.PointF[] calculateRect(Raster alphaRaster, int inflate) {<NEW_LINE>int width = alphaRaster.getWidth();<NEW_LINE>int height = alphaRaster.getHeight();<NEW_LINE>int[] alpha = new int[width * height];<NEW_LINE>alpha = alphaRaster.getPixels(0, 0, width, height, alpha);<NEW_LINE>ConvexHull2D.Point[] ipoints = calcRect(alpha, width, height, inflate);<NEW_LINE>ConvexHull2D.PointF[] points <MASK><NEW_LINE>// make sure we don't change winding<NEW_LINE>points[1] = new ConvexHull2D.PointF(ipoints[0].x / (double) width - 0.5, -(ipoints[0].y / (double) height - 0.5));<NEW_LINE>points[0] = new ConvexHull2D.PointF(ipoints[1].x / (double) width - 0.5, -(ipoints[1].y / (double) height - 0.5));<NEW_LINE>points[3] = new ConvexHull2D.PointF(ipoints[2].x / (double) width - 0.5, -(ipoints[2].y / (double) height - 0.5));<NEW_LINE>points[2] = new ConvexHull2D.PointF(ipoints[3].x / (double) width - 0.5, -(ipoints[3].y / (double) height - 0.5));<NEW_LINE>return points;<NEW_LINE>}
= new ConvexHull2D.PointF[4];
354,082
public void testMultipleObtrude() throws Exception {<NEW_LINE>BlockableIncrementFunction increment = new BlockableIncrementFunction("testMultipleObtrude", null, null);<NEW_LINE>CompletableFuture<Integer> cf1 = defaultManagedExecutor.supplyAsync(() -> 80);<NEW_LINE>cf1.obtrudeValue(90);<NEW_LINE>CompletableFuture<Integer> cf2 = cf1.thenApplyAsync(increment);<NEW_LINE>assertEquals(Integer.valueOf(91), cf2.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(cf1.isDone());<NEW_LINE>assertTrue(cf2.isDone());<NEW_LINE>assertFalse(cf1.isCompletedExceptionally());<NEW_LINE>assertFalse(cf2.isCompletedExceptionally());<NEW_LINE>assertFalse(cf1.isCancelled());<NEW_LINE>assertFalse(cf2.isCancelled());<NEW_LINE>cf1.obtrudeValue(100);<NEW_LINE>CompletableFuture<Integer> cf3 = cf1.thenApplyAsync(increment);<NEW_LINE>assertEquals(Integer.valueOf(101), cf3.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(cf1.isDone());<NEW_LINE>assertTrue(cf3.isDone());<NEW_LINE>assertFalse(cf1.isCompletedExceptionally());<NEW_LINE>assertFalse(cf3.isCompletedExceptionally());<NEW_LINE>assertFalse(cf1.isCancelled());<NEW_LINE>assertFalse(cf3.isCancelled());<NEW_LINE>cf1.obtrudeException(new IllegalAccessException("Intentionally raising exception for test."));<NEW_LINE>CompletableFuture<Integer> cf4 = cf1.thenApplyAsync(increment);<NEW_LINE>try {<NEW_LINE>Integer i = cf4.get(TIMEOUT_NS, TimeUnit.NANOSECONDS);<NEW_LINE>throw new Exception("Should fail after result obtruded with an exception. Instead: " + i);<NEW_LINE>} catch (ExecutionException x) {<NEW_LINE>if (!(x.getCause() instanceof IllegalAccessException) || !"Intentionally raising exception for test.".equals(x.getCause().getMessage()))<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>assertTrue(cf1.isDone());<NEW_LINE>assertTrue(cf4.isDone());<NEW_LINE>assertTrue(cf1.isCompletedExceptionally());<NEW_LINE>assertFalse(cf3.isCompletedExceptionally());<NEW_LINE>assertTrue(cf4.isCompletedExceptionally());<NEW_LINE>assertFalse(cf1.isCancelled());<NEW_LINE>assertFalse(cf4.isCancelled());<NEW_LINE>cf3.obtrudeValue(110);<NEW_LINE>CompletableFuture<Integer> cf5 = cf3.thenApplyAsync(increment);<NEW_LINE>assertEquals(Integer.valueOf(111), cf5.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>cf4<MASK><NEW_LINE>assertTrue(cf4.isCancelled());<NEW_LINE>cf4.obtrudeValue(120);<NEW_LINE>assertEquals(Integer.valueOf(120), cf4.getNow(121));<NEW_LINE>}
.obtrudeException(new CancellationException());
1,337,519
private boolean fromSubjectTest(StringBuffer sb) {<NEW_LINE>boolean pass = false;<NEW_LINE>try {<NEW_LINE>Subject subject = WSSubject.getCallerSubject();<NEW_LINE>// set delegate to false for s4u2proxy testing<NEW_LINE>String token = SpnegoTokenHelper.buildSpnegoAuthorizationFromSubject(spn, subject, lifetime, false);<NEW_LINE>GSSCredential gssCred = SubjectHelper.getGSSCredentialFromSubject(subject);<NEW_LINE>GSSName gssName = gssCred.getName();<NEW_LINE>writeLine(sb, "Call to SpnegoTokenHelper.buildSpnegoAuthorizationFromSubject Succeeded ");<NEW_LINE>writeLine(sb, "GSSCredential: " + gssCred);<NEW_LINE>writeLine(sb, "GSSCredential name is: " + gssName);<NEW_LINE>writeLine(sb, "token:" + token);<NEW_LINE>pass = true;<NEW_LINE>} catch (WSSecurityException e) {<NEW_LINE>writeLine(sb, <MASK><NEW_LINE>} catch (GSSException e) {<NEW_LINE>writeLine(sb, "Call to SpnegoTokenHelper.buildSpnegoAuthorizationFromSubject failed. Unexpected GSSException thrown Major=" + e.getMajor());<NEW_LINE>} catch (PrivilegedActionException e) {<NEW_LINE>writeLine(sb, "Call to SpnegoTokenHelper.buildSpnegoAuthorizationFromSubject failed. Unexpected PrivilegedActionException thrown " + e.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>writeLine(sb, "Call to SpnegoTokenHelper.buildSpnegoAuthorizationFromSubject failed. Unexpected Exception thrown " + e.getMessage());<NEW_LINE>}<NEW_LINE>return pass;<NEW_LINE>}
"Call to SpnegoTokenHelper.buildSpnegoAuthorizationFromSubject failed. Unexpected WSSecurityException thrown " + e.getMessage());
675,252
private void printParameterDeclarations(JavaWriter out, List<ParameterDefinition> parameters, boolean parametersAsField, String separator) {<NEW_LINE>for (ParameterDefinition parameter : parameters) {<NEW_LINE>final String memberName = getStrategy().getJavaMemberName(parameter);<NEW_LINE>if (scala) {<NEW_LINE>if (parametersAsField)<NEW_LINE>out.println("%s%s: %s[%s]", separator, scalaWhitespaceSuffix(memberName), Field.class, refExtendsNumberType(out, parameter.getType<MASK><NEW_LINE>else<NEW_LINE>out.println("%s%s: %s", separator, scalaWhitespaceSuffix(memberName), refNumberType(out, parameter.getType(resolver(out))));<NEW_LINE>} else if (kotlin) {<NEW_LINE>if (parametersAsField)<NEW_LINE>out.println("%s%s: %s<%s?>", separator, memberName, Field.class, refExtendsNumberType(out, parameter.getType(resolver(out))));<NEW_LINE>else<NEW_LINE>out.println("%s%s: %s%s", separator, memberName, refNumberType(out, parameter.getType(resolver(out))), kotlinNullability(parameter));<NEW_LINE>} else {<NEW_LINE>if (parametersAsField)<NEW_LINE>out.println("%s%s<%s> %s", separator, Field.class, refExtendsNumberType(out, parameter.getType(resolver(out))), memberName);<NEW_LINE>else<NEW_LINE>out.println("%s%s %s", separator, refNumberType(out, parameter.getType(resolver(out))), memberName);<NEW_LINE>}<NEW_LINE>separator = ", ";<NEW_LINE>}<NEW_LINE>}
(resolver(out))));
1,666,442
public void onRefresh(CallbackInfo ci, String string, StringReader reader) {<NEW_LINE>String prefix = Config.get().prefix.get();<NEW_LINE>int length = prefix.length();<NEW_LINE>if (reader.canRead(length) && reader.getString().startsWith(prefix, reader.getCursor())) {<NEW_LINE>reader.setCursor(reader.getCursor() + length);<NEW_LINE>assert this.client.player != null;<NEW_LINE>// Pretty much copy&paste from the refresh method<NEW_LINE>CommandDispatcher<CommandSource> commandDispatcher = Commands<MASK><NEW_LINE>if (this.parse == null) {<NEW_LINE>this.parse = commandDispatcher.parse(reader, Commands.get().getCommandSource());<NEW_LINE>}<NEW_LINE>int cursor = textField.getCursor();<NEW_LINE>if (cursor >= 1 && (this.window == null || !this.completingSuggestions)) {<NEW_LINE>this.pendingSuggestions = commandDispatcher.getCompletionSuggestions(this.parse, cursor);<NEW_LINE>this.pendingSuggestions.thenRun(() -> {<NEW_LINE>if (this.pendingSuggestions.isDone()) {<NEW_LINE>this.show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>ci.cancel();<NEW_LINE>}<NEW_LINE>}
.get().getDispatcher();
296,733
private void buildColorPickerView(View view, int colorCode) {<NEW_LINE>view.setVisibility(View.VISIBLE);<NEW_LINE>ShapeDrawable biggerCircle = new ShapeDrawable(new OvalShape());<NEW_LINE>biggerCircle.setIntrinsicHeight(20);<NEW_LINE>biggerCircle.setIntrinsicWidth(20);<NEW_LINE>biggerCircle.setBounds(new Rect(0, 0, 20, 20));<NEW_LINE>biggerCircle.getPaint().setColor(colorCode);<NEW_LINE>ShapeDrawable smallerCircle = <MASK><NEW_LINE>smallerCircle.setIntrinsicHeight(5);<NEW_LINE>smallerCircle.setIntrinsicWidth(5);<NEW_LINE>smallerCircle.setBounds(new Rect(0, 0, 5, 5));<NEW_LINE>smallerCircle.getPaint().setColor(Color.WHITE);<NEW_LINE>smallerCircle.setPadding(10, 10, 10, 10);<NEW_LINE>Drawable[] drawables = { smallerCircle, biggerCircle };<NEW_LINE>LayerDrawable layerDrawable = new LayerDrawable(drawables);<NEW_LINE>view.setBackgroundDrawable(layerDrawable);<NEW_LINE>}
new ShapeDrawable(new OvalShape());
201,210
protected TupleList makeList(Evaluator evaluator) {<NEW_LINE>evaluator.getTiming().markStart(TIMING_NAME);<NEW_LINE>final int savepoint = evaluator.savepoint();<NEW_LINE>try {<NEW_LINE>Calc[] calcs = getCalcs();<NEW_LINE>ListCalc lcalc = (ListCalc) calcs[0];<NEW_LINE>BooleanCalc bcalc = (BooleanCalc) calcs[1];<NEW_LINE>TupleList members0 = lcalc.evaluateList(evaluator);<NEW_LINE>// Not mutable, must create new list;<NEW_LINE>// for capacity planning, guess selectivity = .5<NEW_LINE>TupleList result = members0.cloneList(members0.size() / 2);<NEW_LINE>evaluator.setNonEmpty(false);<NEW_LINE>final TupleCursor cursor = members0.tupleCursor();<NEW_LINE>int currentIteration = 0;<NEW_LINE>Execution execution = evaluator.getQuery()<MASK><NEW_LINE>while (cursor.forward()) {<NEW_LINE>CancellationChecker.checkCancelOrTimeout(currentIteration++, execution);<NEW_LINE>cursor.setContext(evaluator);<NEW_LINE>if (bcalc.evaluateBoolean(evaluator)) {<NEW_LINE>result.addCurrent(cursor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>evaluator.restore(savepoint);<NEW_LINE>evaluator.getTiming().markEnd(TIMING_NAME);<NEW_LINE>}<NEW_LINE>}
.getStatement().getCurrentExecution();
1,226,820
private MockResponse doCreateOrModify(String path, String initial, HasMetadata value, Action event) {<NEW_LINE>MockResponse mockResponse = new MockResponse();<NEW_LINE>// workaround for mockserver https://github.com/fabric8io/mockwebserver/pull/59<NEW_LINE>Map<String, String> pathValues = kubernetesAttributesExtractor.fromKubernetesPath(path);<NEW_LINE>AttributeSet attributes = attributeExtractor.fromPath(path);<NEW_LINE>try {<NEW_LINE>int responseCode = HttpURLConnection.HTTP_OK;<NEW_LINE>boolean statusSubresource = crdProcessor.isStatusSubresource(pathValues);<NEW_LINE>JsonNode updated = context.<MASK><NEW_LINE>AttributeSet existingAttributes = null;<NEW_LINE>if (event == Action.ADDED) {<NEW_LINE>attributes = attributes.add(new Attribute(KubernetesAttributesExtractor.NAME, KubernetesResourceUtil.getName(value)));<NEW_LINE>List<AttributeSet> items = findItems(attributes);<NEW_LINE>if (items.isEmpty()) {<NEW_LINE>if (statusSubresource) {<NEW_LINE>removeStatus(updated);<NEW_LINE>}<NEW_LINE>setDefaultMetadata(updated, pathValues, null);<NEW_LINE>} else {<NEW_LINE>responseCode = HttpURLConnection.HTTP_CONFLICT;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>List<AttributeSet> items = findItems(attributes);<NEW_LINE>if (items.isEmpty()) {<NEW_LINE>responseCode = HttpURLConnection.HTTP_NOT_FOUND;<NEW_LINE>} else {<NEW_LINE>existingAttributes = items.get(0);<NEW_LINE>String existing = map.get(existingAttributes);<NEW_LINE>JsonNode existingNode = context.getMapper().readTree(existing);<NEW_LINE>if (isStatusPath(path)) {<NEW_LINE>JsonNode status = removeStatus(updated);<NEW_LINE>// set the status on the existing node<NEW_LINE>updated = existingNode;<NEW_LINE>setStatus(updated, status);<NEW_LINE>} else {<NEW_LINE>// preserve status and generated fields<NEW_LINE>if (statusSubresource) {<NEW_LINE>setStatus(updated, removeStatus(existingNode));<NEW_LINE>}<NEW_LINE>setDefaultMetadata(updated, pathValues, existingNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (responseCode == HttpURLConnection.HTTP_OK) {<NEW_LINE>String s = context.getMapper().writeValueAsString(updated);<NEW_LINE>processEvent(path, attributes, existingAttributes, s);<NEW_LINE>mockResponse.setBody(s);<NEW_LINE>}<NEW_LINE>mockResponse.setResponseCode(responseCode);<NEW_LINE>return mockResponse;<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>throw new IllegalArgumentException(e);<NEW_LINE>}<NEW_LINE>}
getMapper().readTree(initial);
355,255
protected void moveViewport(boolean isInFlingMode) {<NEW_LINE>mScrollableWidth = mLayout.getContentWidth() - getWidth();<NEW_LINE>if (mScrollableWidth < 0) {<NEW_LINE>mScrollableWidth = 0;<NEW_LINE>}<NEW_LINE>mScrollableHeight = mLayout.getContentHeight() - getHeight();<NEW_LINE>if (mScrollableHeight < 0) {<NEW_LINE>mScrollableHeight = 0;<NEW_LINE>}<NEW_LINE>if (isInFlingMode) {<NEW_LINE>if (viewPortX < 0 || viewPortX > mScrollableWidth || viewPortY < 0 || viewPortY > mScrollableHeight) {<NEW_LINE>mTouchMode = TOUCH_MODE_OVERFLING;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (viewPortX < -overflingDistance) {<NEW_LINE>viewPortX = -overflingDistance;<NEW_LINE>} else if (viewPortX > mScrollableWidth + overflingDistance) {<NEW_LINE>viewPortX = (mScrollableWidth + overflingDistance);<NEW_LINE>}<NEW_LINE>if (viewPortY < (int) (-overflingDistance)) {<NEW_LINE>viewPortY = (int) -overflingDistance;<NEW_LINE>} else if (viewPortY > mScrollableHeight + overflingDistance) {<NEW_LINE>viewPortY = <MASK><NEW_LINE>}<NEW_LINE>if (mEdgeEffectsEnabled && overflingDistance > 0) {<NEW_LINE>if (viewPortX <= 0) {<NEW_LINE>mLeftEdge.onPull(viewPortX / (-overflingDistance));<NEW_LINE>} else if (viewPortX >= mScrollableWidth) {<NEW_LINE>mRightEdge.onPull((viewPortX - mScrollableWidth) / (-overflingDistance));<NEW_LINE>}<NEW_LINE>if (viewPortY <= 0) {<NEW_LINE>mTopEdge.onPull(viewPortY / (-overflingDistance));<NEW_LINE>} else if (viewPortY >= mScrollableHeight) {<NEW_LINE>mBottomEdge.onPull((viewPortY - mScrollableHeight) / (-overflingDistance));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LinkedHashMap<Object, FreeFlowItem> oldFrames = new LinkedHashMap<Object, FreeFlowItem>();<NEW_LINE>copyFrames(frames, oldFrames);<NEW_LINE>frames = new LinkedHashMap<Object, FreeFlowItem>();<NEW_LINE>copyFrames(mLayout.getItemProxies(viewPortX, viewPortY), frames);<NEW_LINE>LayoutChangeset changeSet = getViewChanges(oldFrames, frames, true);<NEW_LINE>for (FreeFlowItem freeflowItem : changeSet.added) {<NEW_LINE>addAndMeasureViewIfNeeded(freeflowItem);<NEW_LINE>doLayout(freeflowItem);<NEW_LINE>}<NEW_LINE>for (Pair<FreeFlowItem, Rect> freeflowItemPair : changeSet.moved) {<NEW_LINE>doLayout(freeflowItemPair.first);<NEW_LINE>}<NEW_LINE>for (FreeFlowItem freeflowItem : changeSet.removed) {<NEW_LINE>removeViewInLayout(freeflowItem.view);<NEW_LINE>returnItemToPoolIfNeeded(freeflowItem);<NEW_LINE>}<NEW_LINE>invalidate();<NEW_LINE>invokeOnItemScrollListeners();<NEW_LINE>}
(int) (mScrollableHeight + overflingDistance);
1,474,720
public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) {<NEW_LINE>String message;<NEW_LINE>switch(error.getPrimaryError()) {<NEW_LINE>case SslError.SSL_UNTRUSTED:<NEW_LINE>message = "\"Certificate authority is not trusted.\"";<NEW_LINE>break;<NEW_LINE>case SslError.SSL_EXPIRED:<NEW_LINE>message = "\"Certificate has expired.\"";<NEW_LINE>break;<NEW_LINE>case SslError.SSL_IDMISMATCH:<NEW_LINE>message = "\"Certificate Hostname mismatch.\"";<NEW_LINE>break;<NEW_LINE>case SslError.SSL_NOTYETVALID:<NEW_LINE>message = "\"Certificate is not yet valid.\"";<NEW_LINE>break;<NEW_LINE>case SslError.SSL_DATE_INVALID:<NEW_LINE>message = "\"Certificate date is invalid.\"";<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>message = "\"Certificate is invalid.\"";<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>String text = message + " - " + context.getString(R.string.dialog_content_ssl_error);<NEW_LINE>MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);<NEW_LINE>builder.setIcon(R.drawable.icon_alert);<NEW_LINE>builder.setTitle(R.string.app_warning);<NEW_LINE>builder.setMessage(text);<NEW_LINE>builder.setPositiveButton(R.string.app_ok, (dialog, whichButton) -> handler.proceed());<NEW_LINE>builder.setNegativeButton(R.string.app_cancel, (dialog, whichButton) -> dialog.cancel());<NEW_LINE>AlertDialog dialog = builder.create();<NEW_LINE>dialog.show();<NEW_LINE>dialog.setOnCancelListener(dialog1 -> handler.cancel());<NEW_LINE><MASK><NEW_LINE>}
HelperUnit.setupDialog(context, dialog);
652,635
private static boolean isValidSectionOffset(final JTextField textField, final Section section) {<NEW_LINE><MASK><NEW_LINE>Preconditions.checkNotNull(section, "Error: section argument can not be null");<NEW_LINE>if (textField.getText().isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String textFieldString = textField.getText().toLowerCase();<NEW_LINE>boolean hex = false;<NEW_LINE>if (textFieldString.startsWith("0x")) {<NEW_LINE>textFieldString = textFieldString.substring(2);<NEW_LINE>hex = true;<NEW_LINE>}<NEW_LINE>final Long offset = textFieldString.matches("^[0-9A-Fa-f]+$") && hex == true ? Long.parseLong(textFieldString, 16) : Long.parseLong(textFieldString, 10);<NEW_LINE>if (section.isValidOffset(offset)) {<NEW_LINE>sanitizedOffset = offset;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (section.isValidAddress(offset)) {<NEW_LINE>sanitizedOffset = offset - section.getStartAddress().toLong();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} catch (final NumberFormatException exception) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
Preconditions.checkNotNull(textField, "Error: textField argument can not be null");
1,818,685
public void changeRoleOfStorageNode(String instanceId, String replica, StorageRole newRole) {<NEW_LINE>assert StringUtils.isNotEmpty(replica);<NEW_LINE>StorageInstHaContext storageNode = null;<NEW_LINE>if (instanceId.equals(metaDbStorageHaCtx.storageInstId)) {<NEW_LINE>storageNode = metaDbStorageHaCtx;<NEW_LINE>} else {<NEW_LINE>storageNode = storageHaCtxCache.get(instanceId);<NEW_LINE>}<NEW_LINE>if (storageNode == null) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_GMS_GENERIC, String.format("could not find instance %s", instanceId));<NEW_LINE>}<NEW_LINE>StorageInfoRecord replicaInfo = storageNode.getNodeInfoByAddress(replica);<NEW_LINE>StorageNodeHaInfo <MASK><NEW_LINE>if (replicaInfo == null) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_GMS_GENERIC, String.format("replica %s not exists in datanode(%s)", replica, instanceId));<NEW_LINE>}<NEW_LINE>String oldLeaderAddr = storageNode.getLeaderNode().getHostPort();<NEW_LINE>String user = storageNode.getUser();<NEW_LINE>String passwd = PasswdUtil.decrypt(storageNode.getEncPasswd());<NEW_LINE>StorageRole currentRole = replicaHaInfo.getRole();<NEW_LINE>try {<NEW_LINE>if (currentRole.equals(newRole)) {<NEW_LINE>logger.warn(String.format("storage node already %s, no need to change", newRole));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StorageHaChecker.changePaxosRoleOfNode(oldLeaderAddr, user, passwd, replica, currentRole, newRole);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_GMS_GENERIC, e, String.format("change role of %s@%s from %s to %s failed", replica, instanceId, currentRole, newRole));<NEW_LINE>}<NEW_LINE>}
replicaHaInfo = storageNode.getNodeHaInfoByAddress(replica);
960,618
public Policy putPolicy(String domainName, String policyName, String auditRef, Policy policy) {<NEW_LINE>WebTarget target = base.path("/domain/{domainName}/policy/{policyName}").resolveTemplate("domainName", domainName).resolveTemplate("policyName", policyName);<NEW_LINE>Invocation.Builder invocationBuilder = target.request("application/json");<NEW_LINE>if (credsHeader != null) {<NEW_LINE>invocationBuilder = credsHeader.startsWith("Cookie.") ? invocationBuilder.cookie(credsHeader.substring(7), credsToken) : invocationBuilder.header(credsHeader, credsToken);<NEW_LINE>}<NEW_LINE>if (auditRef != null) {<NEW_LINE>invocationBuilder = invocationBuilder.header("Y-Audit-Ref", auditRef);<NEW_LINE>}<NEW_LINE>Response response = invocationBuilder.put(javax.ws.rs.client.Entity.entity(policy, "application/json"));<NEW_LINE><MASK><NEW_LINE>switch(code) {<NEW_LINE>case 204:<NEW_LINE>return null;<NEW_LINE>default:<NEW_LINE>throw new ResourceException(code, response.readEntity(ResourceError.class));<NEW_LINE>}<NEW_LINE>}
int code = response.getStatus();
103,272
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// authentication with an API key or named user is required to access basemaps and other<NEW_LINE>// location services<NEW_LINE>ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);<NEW_LINE>// load plane model from assets into cache directory<NEW_LINE>copyFileFromAssetsToCache(getString(R.string.bristol_model));<NEW_LINE>copyFileFromAssetsToCache(getString(R.string.bristol_skin));<NEW_LINE>setupToolbar();<NEW_LINE>// create a scene and add it to the scene view<NEW_LINE>mSceneView = findViewById(R.id.sceneView);<NEW_LINE>ArcGISScene scene = new ArcGISScene(BasemapStyle.ARCGIS_IMAGERY);<NEW_LINE>mSceneView.setScene(scene);<NEW_LINE>// add base surface for elevation data<NEW_LINE>Surface surface = new Surface();<NEW_LINE>ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource(getString(R.string.world_elevation_service_url));<NEW_LINE>surface.getElevationSources().add(elevationSource);<NEW_LINE>scene.setBaseSurface(surface);<NEW_LINE>// create a graphics overlay for the scene<NEW_LINE>mSceneOverlay = new GraphicsOverlay();<NEW_LINE>mSceneOverlay.getSceneProperties().setSurfacePlacement(LayerSceneProperties.SurfacePlacement.ABSOLUTE);<NEW_LINE>mSceneView.getGraphicsOverlays().add(mSceneOverlay);<NEW_LINE>// create a camera and set it as the viewpoint for when the scene loads<NEW_LINE>Camera camera = new Camera(38.459291, -109.937576, <MASK><NEW_LINE>mSceneView.setViewpointCamera(camera);<NEW_LINE>// instantiate a new camera controller which orbits a target location<NEW_LINE>Point locationPoint = new Point(-109.929589, 38.437304, 1700, SpatialReferences.getWgs84());<NEW_LINE>mOrbitLocationCameraController = new OrbitLocationCameraController(locationPoint, 5000);<NEW_LINE>mOrbitLocationCameraController.setCameraPitchOffset(3);<NEW_LINE>mOrbitLocationCameraController.setCameraHeadingOffset(150);<NEW_LINE>loadModel().addDoneLoadingListener(() -> {<NEW_LINE>// instantiate a new camera controller which orbits the plane at a set distance<NEW_LINE>mOrbitPlaneCameraController = new OrbitGeoElementCameraController(mPlane3D, 100.0);<NEW_LINE>mOrbitPlaneCameraController.setCameraPitchOffset(30);<NEW_LINE>mOrbitPlaneCameraController.setCameraHeadingOffset(150);<NEW_LINE>});<NEW_LINE>}
5500, 150.0, 20.0, 0.0);
1,794,731
private static RuntimeConverter createRuntimeConverter(TypeInformation<?> info) {<NEW_LINE>if (info.equals(Types.VOID)) {<NEW_LINE>return (csvMapper, container, obj) -> container.nullNode();<NEW_LINE>} else if (info.equals(Types.STRING)) {<NEW_LINE>return (csvMapper, container, obj) -> container.textNode((String) obj);<NEW_LINE>} else if (info.equals(Types.BOOLEAN)) {<NEW_LINE>return (csvMapper, container, obj) -> container.booleanNode((Boolean) obj);<NEW_LINE>} else if (info.equals(Types.BYTE)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((Byte) obj);<NEW_LINE>} else if (info.equals(Types.SHORT)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((Short) obj);<NEW_LINE>} else if (info.equals(Types.INT)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((Integer) obj);<NEW_LINE>} else if (info.equals(Types.LONG)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((Long) obj);<NEW_LINE>} else if (info.equals(Types.FLOAT)) {<NEW_LINE>return (csvMapper, container, obj) -> container<MASK><NEW_LINE>} else if (info.equals(Types.DOUBLE)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((Double) obj);<NEW_LINE>} else if (info.equals(Types.BIG_DEC)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((BigDecimal) obj);<NEW_LINE>} else if (info.equals(Types.BIG_INT)) {<NEW_LINE>return (csvMapper, container, obj) -> container.numberNode((BigInteger) obj);<NEW_LINE>} else if (info.equals(Types.SQL_DATE)) {<NEW_LINE>return (csvMapper, container, obj) -> container.textNode(obj.toString());<NEW_LINE>} else if (info.equals(Types.SQL_TIME)) {<NEW_LINE>return (csvMapper, container, obj) -> container.textNode(obj.toString());<NEW_LINE>} else if (info.equals(Types.SQL_TIMESTAMP)) {<NEW_LINE>return (csvMapper, container, obj) -> container.textNode(obj.toString());<NEW_LINE>} else if (info instanceof RowTypeInfo) {<NEW_LINE>return createRowRuntimeConverter((RowTypeInfo) info, false);<NEW_LINE>} else if (info instanceof BasicArrayTypeInfo) {<NEW_LINE>return createObjectArrayRuntimeConverter(((BasicArrayTypeInfo) info).getComponentInfo());<NEW_LINE>} else if (info instanceof ObjectArrayTypeInfo) {<NEW_LINE>return createObjectArrayRuntimeConverter(((ObjectArrayTypeInfo) info).getComponentInfo());<NEW_LINE>} else if (info instanceof PrimitiveArrayTypeInfo && ((PrimitiveArrayTypeInfo) info).getComponentType() == Types.BYTE) {<NEW_LINE>return createByteArrayRuntimeConverter();<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unsupported type information '" + info + "'.");<NEW_LINE>}<NEW_LINE>}
.numberNode((Float) obj);
26,040
public void changeVariables(Object source, Map<String, Object> variables) {<NEW_LINE>// Get new size<NEW_LINE>final Integer newWidth = (Integer) variables.get("width");<NEW_LINE>final Integer newHeight = (Integer) variables.get("height");<NEW_LINE>if (newWidth != null && newWidth.intValue() != getWidth()) {<NEW_LINE>setWidth(<MASK><NEW_LINE>}<NEW_LINE>if (newHeight != null && newHeight.intValue() != getHeight()) {<NEW_LINE>setHeight(newHeight.intValue(), UNITS_PIXELS);<NEW_LINE>}<NEW_LINE>// Scrolling<NEW_LINE>final Integer newScrollX = (Integer) variables.get("scrollLeft");<NEW_LINE>final Integer newScrollY = (Integer) variables.get("scrollTop");<NEW_LINE>if (newScrollX != null && newScrollX.intValue() != getScrollLeft()) {<NEW_LINE>// set internally, not to fire request repaint<NEW_LINE>getState().scrollLeft = newScrollX.intValue();<NEW_LINE>}<NEW_LINE>if (newScrollY != null && newScrollY.intValue() != getScrollTop()) {<NEW_LINE>// set internally, not to fire request repaint<NEW_LINE>getState().scrollTop = newScrollY.intValue();<NEW_LINE>}<NEW_LINE>// Actions<NEW_LINE>if (actionManager != null) {<NEW_LINE>actionManager.handleActions(variables, this);<NEW_LINE>}<NEW_LINE>}
newWidth.intValue(), UNITS_PIXELS);
1,695,404
@Override<NEW_LINE>public JComponent createComponent() {<NEW_LINE>PostfixTemplateProvider postfixTemplateProvider = myExtensionPoint.getInstance();<NEW_LINE>if (postfixTemplateProvider == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>OnePixelSplitter splitter = new OnePixelSplitter();<NEW_LINE>splitter.setSplitterProportionKey("PostfixTemplatesChildConfigurable.splitter");<NEW_LINE>myCheckBoxList = new CheckBoxList<>();<NEW_LINE>splitter.setFirstComponent(ScrollPaneFactory.createScrollPane(myCheckBoxList, true));<NEW_LINE>myPostfixDescriptionPanel = new PostfixDescriptionPanel();<NEW_LINE><MASK><NEW_LINE>component.setBorder(JBUI.Borders.empty(0, 8, 0, 0));<NEW_LINE>splitter.setSecondComponent(component);<NEW_LINE>myCheckBoxList.setItems(new ArrayList<>(postfixTemplateProvider.getTemplates()), PostfixTemplate::getPresentableName, postfixTemplate -> Boolean.TRUE);<NEW_LINE>myCheckBoxList.addListSelectionListener(new ListSelectionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void valueChanged(ListSelectionEvent e) {<NEW_LINE>PostfixTemplate itemAt = myCheckBoxList.getItemAt(myCheckBoxList.getSelectedIndex());<NEW_LINE>myPostfixDescriptionPanel.reset(PostfixTemplateMetaData.createMetaData(itemAt));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return splitter;<NEW_LINE>}
JPanel component = myPostfixDescriptionPanel.getComponent();
536,798
public ByteBuffer encode(RemotingCommand remotingCommand) throws Exception {<NEW_LINE>RemotingSerializable serializable = getRemotingSerializable(remotingCommand.getSid());<NEW_LINE>// header length size<NEW_LINE>int length = 4;<NEW_LINE>// serializable id (int)<NEW_LINE>length += 4;<NEW_LINE>// header data length<NEW_LINE>byte[] headerData = serializable.serialize(remotingCommand);<NEW_LINE>length += headerData.length;<NEW_LINE>byte[] bodyData = null;<NEW_LINE>byte[] bodyClass = null;<NEW_LINE>RemotingCommandBody body = remotingCommand.getBody();<NEW_LINE>if (body != null) {<NEW_LINE>// body data<NEW_LINE>bodyData = serializable.serialize(body);<NEW_LINE>length += bodyData.length;<NEW_LINE>bodyClass = body.getClass().getName().getBytes();<NEW_LINE>length += bodyClass.length;<NEW_LINE>length += 4;<NEW_LINE>}<NEW_LINE>ByteBuffer result = ByteBuffer.allocate(4 + length);<NEW_LINE>// length<NEW_LINE>result.putInt(length);<NEW_LINE>// serializable Id<NEW_LINE>result.<MASK><NEW_LINE>// header length<NEW_LINE>result.putInt(headerData.length);<NEW_LINE>// header data<NEW_LINE>result.put(headerData);<NEW_LINE>if (bodyData != null) {<NEW_LINE>// body length<NEW_LINE>result.putInt(bodyData.length);<NEW_LINE>// body data<NEW_LINE>result.put(bodyData);<NEW_LINE>// body class<NEW_LINE>result.put(bodyClass);<NEW_LINE>}<NEW_LINE>result.flip();<NEW_LINE>return result;<NEW_LINE>}
putInt(serializable.getId());
1,821,747
protected void addMethodParameterAnnotation(String cName, String mName, String mSig, boolean isStatic, int param, AnnotationEnum annotation) {<NEW_LINE>// if (!Subtypes.DO_NOT_USE) {<NEW_LINE>// subtypes.addNamedClass(cName);<NEW_LINE>// }<NEW_LINE>if (addClassOnly) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SignatureParser parser = new SignatureParser(mSig);<NEW_LINE>if (param < 0 || param >= parser.getNumParameters()) {<NEW_LINE>throw new IllegalArgumentException("can't annotation parameter #" + param + " of " + cName + "." + mName + mSig);<NEW_LINE>}<NEW_LINE>String signature = parser.getParameter(param);<NEW_LINE>char firstChar = signature.charAt(0);<NEW_LINE>boolean isReference = firstChar == 'L' || firstChar == '[';<NEW_LINE>if (onlyAppliesToReferenceParameters(annotation) && !isReference) {<NEW_LINE>AnalysisContext.logError("Can't apply " + annotation + " to parameter " + param + " with signature " + signature + " of " + cName + "." + mName + " : " + mSig);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>XMethod m = XFactory.createXMethod(cName, mName, mSig, isStatic);<NEW_LINE>addDirectAnnotation(new XMethodParameter<MASK><NEW_LINE>}
(m, param), annotation);
41,261
public static void configureJNA() {<NEW_LINE>// Set JNA "jnidispatch" resolution rules<NEW_LINE>try {<NEW_LINE>if (System.getProperty("os.name") != null && System.getProperty("os.name").startsWith("Windows") && isNotBlank(System.getProperty("os.version")) && Double.parseDouble(System.getProperty("os.version")) < 5.2) {<NEW_LINE>String developmentPath = "src\\main\\external-resources\\lib\\winxp";<NEW_LINE>if (new File(developmentPath).exists()) {<NEW_LINE>System.setProperty("jna.boot.library.path", developmentPath);<NEW_LINE>} else {<NEW_LINE>System.setProperty("jna.boot.library.path", "win32\\winxp");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.setProperty("jna.nosys", "true");<NEW_LINE>}<NEW_LINE>} catch (NullPointerException | NumberFormatException e) {<NEW_LINE>System.setProperty("jna.nosys", "true");<NEW_LINE>System.err.println("Could not determine Windows version from " + System<MASK><NEW_LINE>}<NEW_LINE>}
.getProperty("os.version") + ". Not applying Windows XP hack");
969,522
public void performHealthCheck(HttpServletRequest request, HttpServletResponse httpResponse) {<NEW_LINE>Set<HealthCheckResponse> hcResponses = null;<NEW_LINE>Set<String> apps = appTracker.getAppNames();<NEW_LINE>Iterator<String> appsIt = apps.iterator();<NEW_LINE>HealthCheckHttpResponseBuilder hcHttpResponseBuilder = new HealthCheckHttpResponseBuilder();<NEW_LINE>while (appsIt.hasNext()) {<NEW_LINE>String appName = appsIt.next();<NEW_LINE>Set<String> modules = appTracker.getModuleNames(appName);<NEW_LINE>Iterator<String> moduleIt = modules.iterator();<NEW_LINE>while (moduleIt.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "In performHealthCheck(): appName = " + appName + ", moduleName = " + moduleName);<NEW_LINE>try {<NEW_LINE>hcResponses = hcExecutor.runHealthChecks(appName, moduleName);<NEW_LINE>} catch (HealthCheckBeanCallException e) {<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "In performHealthCheck(): Caught the exception " + e + " for appName = " + appName + ", moduleName = " + moduleName);<NEW_LINE>hcHttpResponseBuilder.handleUndeterminedResponse(httpResponse);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "In performHealthCheck(): hcResponses = " + hcResponses);<NEW_LINE>if (!hcResponses.isEmpty())<NEW_LINE>hcHttpResponseBuilder.addResponses(hcResponses);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>hcHttpResponseBuilder.setHttpResponse(httpResponse);<NEW_LINE>}
String moduleName = moduleIt.next();
1,039,234
/* Merges a and b<NEW_LINE>Lists are merged: a + b = [*a, *b]<NEW_LINE>Strings are not allowed, they will throw an error<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public static Map<String, Object> mergeManifestContext(Map<String, Object> a, Map<String, Object> b) throws RuntimeException {<NEW_LINE>Map<String, Object> merged = new HashMap<String, Object>();<NEW_LINE>Set<String> allKeys = new HashSet<String>();<NEW_LINE>allKeys.addAll(a.keySet());<NEW_LINE>allKeys.addAll(b.keySet());<NEW_LINE>for (String key : allKeys) {<NEW_LINE>Object objA = a.getOrDefault(key, null);<NEW_LINE>Object objB = b.getOrDefault(key, null);<NEW_LINE>if (objA == null || objB == null) {<NEW_LINE>merged.put(key, objA == null ? objB : objA);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!isSameClass(objA, objB)) {<NEW_LINE>throw new RuntimeException(String.format("Class types differ: '%s' != '%s' for values '%s' and '%s'", objA.getClass(), objB.getClass(), objA, objB));<NEW_LINE>}<NEW_LINE>if (isListOfStrings(objA)) {<NEW_LINE>List<String> listA = (List<String>) objA;<NEW_LINE>List<String> listB = (List<String>) objB;<NEW_LINE>List<String> list = new ArrayList<String>();<NEW_LINE>list.addAll(listA);<NEW_LINE>list.addAll(listB);<NEW_LINE>merged.put(key, list);<NEW_LINE>} else if (isMap(objA)) {<NEW_LINE>Map<String, Object> mergedChildren = ExtenderUtil.mergeManifestContext((Map<String, Object>) objA, (Map<String, Object>) objB);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>throw new RuntimeException(String.format("Unsupported value types: '%s' != '%s' for values '%s' and '%s'", objA.getClass(), objB.getClass(), objA, objB));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return merged;<NEW_LINE>}
merged.put(key, mergedChildren);
508,005
void add(View view, boolean insertNextToCenterItem) {<NEW_LINE>// view.setBackgroundColor(mViews.size() % 2 == 0 ? 0xff660066 : 0xff666600);<NEW_LINE>view.setOnClickListener(mViewOnClickListener);<NEW_LINE>view.setOnTouchListener(mViewOnTouchListener);<NEW_LINE>int centerIndex = getCenterIndex();<NEW_LINE>int insertAtIndex = insertNextToCenterItem ? centerIndex + 1 : mViews.size();<NEW_LINE>if (view.getParent() != null) {<NEW_LINE>((ViewGroup) view.getParent()).removeView(view);<NEW_LINE>}<NEW_LINE>FrameLayout.LayoutParams lp = new LayoutParams(mItemWidth, mItemHeight, Gravity.TOP | Gravity.LEFT);<NEW_LINE>lp<MASK><NEW_LINE>mContent.addView(view, lp);<NEW_LINE>mContent.invalidate();<NEW_LINE>if (insertNextToCenterItem) {<NEW_LINE>mViews.add(centerIndex + 1, view);<NEW_LINE>} else {<NEW_LINE>mViews.add(view);<NEW_LINE>}<NEW_LINE>updatePositions();<NEW_LINE>updateScales(getScrollX());<NEW_LINE>if (insertNextToCenterItem) {<NEW_LINE>TranslateAnimation slideOnAnim = new TranslateAnimation(0, 0, -mItemHeight, 0);<NEW_LINE>slideOnAnim.setDuration(Constant.BUBBLE_FLOW_ANIM_TIME);<NEW_LINE>slideOnAnim.setFillAfter(true);<NEW_LINE>view.startAnimation(slideOnAnim);<NEW_LINE>for (int i = centerIndex + 2; i < mViews.size(); i++) {<NEW_LINE>View viewToShift = mViews.get(i);<NEW_LINE>TranslateAnimation slideRightAnim = new TranslateAnimation(-mItemWidth, 0, 0, 0);<NEW_LINE>slideRightAnim.setDuration(Constant.BUBBLE_FLOW_ANIM_TIME);<NEW_LINE>slideRightAnim.setFillAfter(true);<NEW_LINE>viewToShift.startAnimation(slideRightAnim);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ViewGroup.LayoutParams contentLP = mContent.getLayoutParams();<NEW_LINE>contentLP.width = (mViews.size() * mItemWidth) + mItemWidth + (2 * mEdgeMargin);<NEW_LINE>mContent.setLayoutParams(contentLP);<NEW_LINE>}
.leftMargin = mEdgeMargin + insertAtIndex * mItemWidth;
525,606
protected void endNode(int node) throws org.xml.sax.SAXException {<NEW_LINE>switch(m_dtm.getNodeType(node)) {<NEW_LINE>case DTM.DOCUMENT_NODE:<NEW_LINE>this.m_contentHandler.endDocument();<NEW_LINE>break;<NEW_LINE>case DTM.ELEMENT_NODE:<NEW_LINE>String ns = m_dtm.getNamespaceURI(node);<NEW_LINE>if (null == ns)<NEW_LINE>ns = "";<NEW_LINE>this.m_contentHandler.endElement(ns, m_dtm.getLocalName(node), m_dtm.getNodeName(node));<NEW_LINE>for (int nsn = m_dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn; nsn = m_dtm.getNextNamespaceNode(node, nsn, true)) {<NEW_LINE>// String prefix = m_dtm.getPrefix(nsn);<NEW_LINE>String prefix = m_dtm.getNodeNameX(nsn);<NEW_LINE>this.m_contentHandler.endPrefixMapping(prefix);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case DTM.CDATA_SECTION_NODE:<NEW_LINE>break;<NEW_LINE>case DTM.ENTITY_REFERENCE_NODE:<NEW_LINE>{<NEW_LINE>if (m_contentHandler instanceof LexicalHandler) {<NEW_LINE>LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);<NEW_LINE>lh.endEntity<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}
(m_dtm.getNodeName(node));
1,503,878
public OResult calculateSingle(OCommandContext iContext, OResult iRecord) {<NEW_LINE>initExcludes(iContext);<NEW_LINE>if (isExpand()) {<NEW_LINE>throw new IllegalStateException("This is an expand projection, it cannot be calculated as a single result" + toString());<NEW_LINE>}<NEW_LINE>if (items.size() == 0 || (items.size() == 1 && items.get(0).isAll()) && items.get(0).nestedProjection == null) {<NEW_LINE>return iRecord;<NEW_LINE>}<NEW_LINE>OResultInternal result = new OResultInternal();<NEW_LINE>for (OProjectionItem item : items) {<NEW_LINE>if (item.exclude) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (item.isAll()) {<NEW_LINE>for (String alias : iRecord.getPropertyNames()) {<NEW_LINE>if (this.excludes.contains(alias)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Object val = item.convert(iRecord.getProperty(alias));<NEW_LINE>if (item.nestedProjection != null) {<NEW_LINE>val = item.nestedProjection.apply(item.expression, val, iContext);<NEW_LINE>}<NEW_LINE>result.setProperty(alias, val);<NEW_LINE>}<NEW_LINE>if (iRecord.getElement().isPresent()) {<NEW_LINE>OElement x = iRecord.getElement().get();<NEW_LINE>if (!this.excludes.contains("@rid")) {<NEW_LINE>result.setProperty("@rid", x.getIdentity());<NEW_LINE>}<NEW_LINE>if (!this.excludes.contains("@version")) {<NEW_LINE>result.setProperty("@version", x.getVersion());<NEW_LINE>}<NEW_LINE>if (!this.excludes.contains("@class")) {<NEW_LINE>result.setProperty("@class", x.getSchemaType().map(clazz -> clazz.getName()).orElse(null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result.setProperty(item.getProjectionAliasAsString(), item<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String key : iRecord.getMetadataKeys()) {<NEW_LINE>if (!result.getMetadataKeys().contains(key)) {<NEW_LINE>result.setMetadata(key, iRecord.getMetadata(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
.execute(iRecord, iContext));
1,619,990
public static void main(String[] args) throws UnknownHostException {<NEW_LINE>Configuration config = Configuration.createWithFile(CONFIG_FILE, CONFIG_HEADER, DEFAULTS);<NEW_LINE>Configuration.setStandard(config);<NEW_LINE>int unicastPort = config.get(CoapConfig.COAP_PORT);<NEW_LINE>int multicastPort = unicastPort;<NEW_LINE>switch(args.length) {<NEW_LINE>default:<NEW_LINE>System.out.println("usage: MulticastTestServer [unicast-port [multicast-port]]");<NEW_LINE>case 2:<NEW_LINE>multicastPort = Integer.parseInt(args[1]);<NEW_LINE>case 1:<NEW_LINE>unicastPort = Integer.parseInt(args[0]);<NEW_LINE>case 0:<NEW_LINE>}<NEW_LINE>CoapServer server = new CoapServer(config);<NEW_LINE>createEndpoints(server, unicastPort, multicastPort, config);<NEW_LINE>server<MASK><NEW_LINE>server.add(new MyIpResource(MyIpResource.RESOURCE_NAME, true));<NEW_LINE>server.start();<NEW_LINE>}
.add(new HelloWorldResource());
342,026
public void eventOccured(String message) {<NEW_LINE>// normally there comes only one line to the baseStation<NEW_LINE>// except when station is restarted<NEW_LINE>// Filter out the lines that contain garbage data<NEW_LINE>if (message.contains("(CRC wrong after decryption)")) {<NEW_LINE>logger.debug("BaseStation eventOccurred: CRC wrong after decryption");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (message.contains("Base Station")) {<NEW_LINE>StringTokenizer strTok = new StringTokenizer(message, "\n");<NEW_LINE>String data = null;<NEW_LINE>versionInfo = new String[strTok.countTokens()];<NEW_LINE>logger.debug("BaseStation eventOccurred - initial message ( {} )", strTok.countTokens());<NEW_LINE>int i = 0;<NEW_LINE>while (strTok.hasMoreTokens()) {<NEW_LINE>versionInfo[i] = strTok.nextToken();<NEW_LINE>logger.debug("<BaseStation>[ {} ]: {}", i, versionInfo[i]);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String logResult = message.replaceAll("\n", "\\\\n").replaceAll("\r", "\\\\r").substring(0, 40);<NEW_LINE><MASK><NEW_LINE>if (bindingEventWorker != null) {<NEW_LINE>bindingEventWorker.eventOccured(message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
logger.debug("BaseStation eventOccurred - giving to Binding {}", logResult);
446,401
private void doUIandUsageLogging() {<NEW_LINE>if ((addedFrameworks != null) && (addedFrameworks.size() > 0)) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (int i = 0; i < addedFrameworks.size(); i++) {<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>// NOI18N<NEW_LINE>sb.append("|");<NEW_LINE>}<NEW_LINE>sb.append(addedFrameworks.get(i));<NEW_LINE>}<NEW_LINE>String addedFrameworksNames = sb.toString();<NEW_LINE>// NOI18N<NEW_LINE>LoggingUtils.logUI(this.getClass(), "UI_PROJECT_CONFIG_MAVEN_FRAMEWORK_ADDED", new Object<MASK><NEW_LINE>// NOI18N<NEW_LINE>LoggingUtils.logUsage(this.getClass(), "USG_PROJECT_CONFIG_WEB", new Object[] { findServerName(), addedFrameworksNames }, "web.project");<NEW_LINE>}<NEW_LINE>}
[] { addedFrameworksNames }, "web.project");
238,361
public void writeExternal(ObjectOutput oo) throws IOException {<NEW_LINE>// backward compatibility must be ensured... (table model was implemented using arrays sooner)<NEW_LINE>oo.writeInt(rowCount);<NEW_LINE>int colCount = columns.size();<NEW_LINE>oo.writeInt(colCount);<NEW_LINE>String[] titles = new String[colCount];<NEW_LINE>boolean[] editable = new boolean[colCount];<NEW_LINE>for (int i = 0; i < colCount; i++) {<NEW_LINE>ColumnItem ci = columns.get(i);<NEW_LINE>titles[i] = ci.title;<NEW_LINE>editable[i] = ci.editable;<NEW_LINE>}<NEW_LINE>oo.writeObject(titles);<NEW_LINE>oo.writeObject(editable);<NEW_LINE>for (int i = 0; i < colCount; i++) {<NEW_LINE>ColumnItem ci = columns.get(i);<NEW_LINE>oo.writeObject(<MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < rowCount; i++) for (int j = 0; j < colCount; j++) {<NEW_LINE>ColumnItem ci = columns.get(j);<NEW_LINE>if (ci.rows.get(i) instanceof Serializable)<NEW_LINE>oo.writeObject(ci.rows.get(i));<NEW_LINE>else<NEW_LINE>oo.writeObject(null);<NEW_LINE>}<NEW_LINE>}
ci.type.getName());
970,320
public void marshall(CreateLocationObjectStorageRequest createLocationObjectStorageRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createLocationObjectStorageRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createLocationObjectStorageRequest.getServerHostname(), SERVERHOSTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLocationObjectStorageRequest.getServerPort(), SERVERPORT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createLocationObjectStorageRequest.getSubdirectory(), SUBDIRECTORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLocationObjectStorageRequest.getBucketName(), BUCKETNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLocationObjectStorageRequest.getAccessKey(), ACCESSKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLocationObjectStorageRequest.getSecretKey(), SECRETKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLocationObjectStorageRequest.getAgentArns(), AGENTARNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createLocationObjectStorageRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createLocationObjectStorageRequest.getServerProtocol(), SERVERPROTOCOL_BINDING);
997,283
public int compare(T o1, T o2) {<NEW_LINE>Matcher m1 = parts.matcher<MASK><NEW_LINE>Matcher m2 = parts.matcher(converter.apply(o2));<NEW_LINE>while (m1.find() && m2.find()) {<NEW_LINE>int compareCharGroup = m1.group(ALPHA_PART).compareTo(m2.group(ALPHA_PART));<NEW_LINE>if (compareCharGroup != 0) {<NEW_LINE>return compareCharGroup;<NEW_LINE>}<NEW_LINE>String numberPart1 = m1.group(NUM_PART);<NEW_LINE>String numberPart2 = m2.group(NUM_PART);<NEW_LINE>if (numberPart1.isEmpty() || numberPart2.isEmpty()) {<NEW_LINE>return compareOneEmptyPart(numberPart1, numberPart2);<NEW_LINE>}<NEW_LINE>String nonZeroNumberPart1 = trimLeadingZeroes(numberPart1);<NEW_LINE>String nonZeroNumberPart2 = trimLeadingZeroes(numberPart2);<NEW_LINE>int lengthNumber1 = nonZeroNumberPart1.length();<NEW_LINE>int lengthNumber2 = nonZeroNumberPart2.length();<NEW_LINE>if (lengthNumber1 != lengthNumber2) {<NEW_LINE>if (lengthNumber1 < lengthNumber2) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>int compareNumber = nonZeroNumberPart1.compareTo(nonZeroNumberPart2);<NEW_LINE>if (compareNumber != 0) {<NEW_LINE>return compareNumber;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (m1.hitEnd() && m2.hitEnd()) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (m1.hitEnd()) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}
(converter.apply(o1));
839,741
public void marshall(UpdateMatchmakingConfigurationRequest updateMatchmakingConfigurationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateMatchmakingConfigurationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getGameSessionQueueArns(), GAMESESSIONQUEUEARNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getRequestTimeoutSeconds(), REQUESTTIMEOUTSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getAcceptanceTimeoutSeconds(), ACCEPTANCETIMEOUTSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getAcceptanceRequired(), ACCEPTANCEREQUIRED_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getRuleSetName(), RULESETNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getNotificationTarget(), NOTIFICATIONTARGET_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getAdditionalPlayerCount(), ADDITIONALPLAYERCOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getCustomEventData(), CUSTOMEVENTDATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getGameProperties(), GAMEPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getGameSessionData(), GAMESESSIONDATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateMatchmakingConfigurationRequest.getFlexMatchMode(), FLEXMATCHMODE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updateMatchmakingConfigurationRequest.getBackfillMode(), BACKFILLMODE_BINDING);
1,285,813
public void onGetRgbaFrame(byte[] data, int width, int height) {<NEW_LINE>if (mPausetime > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Check video frame cache number to judge the networking situation.<NEW_LINE>// Just cache GOP / FPS seconds data according to latency.<NEW_LINE>AtomicInteger videoFrameCacheNumber = flvMuxer.getVideoFrameCacheNumber();<NEW_LINE>if (videoFrameCacheNumber != null && videoFrameCacheNumber.get() < VGOP / 2) {<NEW_LINE>long pts = System.nanoTime() / 1000 - mPresentTimeUs;<NEW_LINE>if (useSoftEncoder) {<NEW_LINE>swRgbaFrame(data, width, height, pts);<NEW_LINE>} else {<NEW_LINE>byte[] processedData = <MASK><NEW_LINE>if (processedData != null) {<NEW_LINE>onProcessedYuvFrame(processedData, pts);<NEW_LINE>} else {<NEW_LINE>mHandler.notifyEncodeIllegalArgumentException(new IllegalArgumentException("libyuv failure"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (networkWeakTriggered) {<NEW_LINE>networkWeakTriggered = false;<NEW_LINE>mHandler.notifyNetworkResume();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mHandler.notifyNetworkWeak();<NEW_LINE>networkWeakTriggered = true;<NEW_LINE>}<NEW_LINE>}
hwRgbaFrame(data, width, height);
140,370
private void validateFingerprintUniqueness() {<NEW_LINE>HashMap<String, SCMs> map = new HashMap<>();<NEW_LINE>for (SCM scm : this) {<NEW_LINE>String fingerprint = scm.getFingerprint();<NEW_LINE>if (!map.containsKey(fingerprint)) {<NEW_LINE>map.put(fingerprint, new SCMs());<NEW_LINE>}<NEW_LINE>map.get(fingerprint).add(scm);<NEW_LINE>}<NEW_LINE>for (String fingerprint : map.keySet()) {<NEW_LINE>SCMs scmsWithSameFingerprint = map.get(fingerprint);<NEW_LINE>if (scmsWithSameFingerprint.size() > 1) {<NEW_LINE>List<String> <MASK><NEW_LINE>for (SCM scm : scmsWithSameFingerprint) {<NEW_LINE>scmNames.add(scm.getName());<NEW_LINE>}<NEW_LINE>for (SCM scm : scmsWithSameFingerprint) {<NEW_LINE>scm.addError(SCM.SCM_ID, String.format("Cannot save SCM, found duplicate SCMs. %s", StringUtils.join(scmNames, ", ")));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
scmNames = new ArrayList<>();
150,856
public void detect() {<NEW_LINE>getPredictLabel().addAll(<MASK><NEW_LINE>this.startTime = getTime().get(0);<NEW_LINE>int i = 0;<NEW_LINE>int windowSize = minLength / 2;<NEW_LINE>double[][] data = new double[windowSize][2];<NEW_LINE>SimpleRegression regression = new SimpleRegression();<NEW_LINE>while (i + windowSize < getLen()) {<NEW_LINE>for (int j = 0; j < windowSize; j++) {<NEW_LINE>data[j][0] = getTime().get(i + j) - startTime;<NEW_LINE>data[j][1] = getValue().get(i + j);<NEW_LINE>}<NEW_LINE>regression.addData(data);<NEW_LINE>double alpha = regression.getRSquare();<NEW_LINE>if (Double.isNaN(alpha) || alpha >= threshold) {<NEW_LINE>i = extend(regression, i, i + windowSize);<NEW_LINE>} else {<NEW_LINE>i += windowSize;<NEW_LINE>}<NEW_LINE>regression.clear();<NEW_LINE>r2 += Double.isNaN(alpha) ? 1 : alpha;<NEW_LINE>windowCnt++;<NEW_LINE>}<NEW_LINE>label();<NEW_LINE>}
new int[getLen()]);
1,427,514
private void searchMatchInSet(CtRole role, Set<? extends CtElement> set) {<NEW_LINE>if (!set.isEmpty()) {<NEW_LINE>// copy targets, because it might be modified by call of matchConsumer, when refactoring spoon model<NEW_LINE>// use List, because Spoon uses Sets with predictable order - so keep the order<NEW_LINE>TobeMatched tobeMatched = TobeMatched.create(new ImmutableMapImpl(), ContainerKind.SET, set);<NEW_LINE>while (tobeMatched.hasTargets()) {<NEW_LINE>TobeMatched <MASK><NEW_LINE>if (nextTobeMatched != null) {<NEW_LINE>List<?> matchedTargets = tobeMatched.getMatchedTargets(nextTobeMatched);<NEW_LINE>if (!matchedTargets.isEmpty()) {<NEW_LINE>// send information about match to client<NEW_LINE>matchConsumer.accept(new Match(matchedTargets, nextTobeMatched.getParameters()));<NEW_LINE>// do not scan children of matched elements. They already matched, so we must not scan them again<NEW_LINE>tobeMatched = nextTobeMatched;<NEW_LINE>// we have found a match. Try next match<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// else the template matches nothing. Understand it as no more match in this context<NEW_LINE>}<NEW_LINE>// there was no match. Do not try it again<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// scan remaining not matched items of the Set<NEW_LINE>for (Object object : tobeMatched.getTargets()) {<NEW_LINE>// scan children of each not matched element too<NEW_LINE>super.scan(role, object);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
nextTobeMatched = pattern.matchAllWith(tobeMatched);
820,074
@Secured(action = ActionTypes.WRITE)<NEW_LINE>public ObjectNode batchUpdateInstanceMetadata(HttpServletRequest request) throws Exception {<NEW_LINE>final String namespaceId = WebUtils.optional(request, CommonParams.NAMESPACE_ID, Constants.DEFAULT_NAMESPACE_ID);<NEW_LINE>String serviceName = WebUtils.required(request, CommonParams.SERVICE_NAME);<NEW_LINE>String consistencyType = WebUtils.optional(request, "consistencyType", StringUtils.EMPTY);<NEW_LINE>String instances = WebUtils.optional(request, "instances", StringUtils.EMPTY);<NEW_LINE>List<Instance> targetInstances = parseBatchInstances(instances);<NEW_LINE>String metadata = WebUtils.required(request, METADATA);<NEW_LINE>Map<String, String> targetMetadata = UtilsAndCommons.parseMetadata(metadata);<NEW_LINE>InstanceOperationInfo instanceOperationInfo = buildOperationInfo(serviceName, consistencyType, targetInstances);<NEW_LINE>List<String> operatedInstances = getInstanceOperator().<MASK><NEW_LINE>ObjectNode result = JacksonUtils.createEmptyJsonNode();<NEW_LINE>ArrayNode ipArray = JacksonUtils.createEmptyArrayNode();<NEW_LINE>for (String ip : operatedInstances) {<NEW_LINE>ipArray.add(ip);<NEW_LINE>}<NEW_LINE>result.replace("updated", ipArray);<NEW_LINE>return result;<NEW_LINE>}
batchUpdateMetadata(namespaceId, instanceOperationInfo, targetMetadata);
1,418,384
public void visit(Code obj) {<NEW_LINE>if (!getMethod().isPublic() && !getMethod().isProtected()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SignatureParser p = new SignatureParser(getMethodSig());<NEW_LINE>LocalVariableTable t = obj.getLocalVariableTable();<NEW_LINE>if (t == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ParameterProperty property = new ParameterProperty();<NEW_LINE>int index = getMethod().isStatic() ? 0 : 1;<NEW_LINE>int parameterNumber = 0;<NEW_LINE>for (Iterator<String> i = p.parameterSignatureIterator(); i.hasNext(); ) {<NEW_LINE>String s = i.next();<NEW_LINE>LocalVariable localVariable = t.getLocalVariable(index, 0);<NEW_LINE>if (localVariable != null) {<NEW_LINE><MASK><NEW_LINE>if ("J".equals(s) && (name.toLowerCase().indexOf("instant") >= 0 || name.startsWith("date"))) {<NEW_LINE>// System.out.println(getFullyQualifiedMethodName() + " " + s + " " + index + " " + name);<NEW_LINE>property.setParamWithProperty(parameterNumber, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ("J".equals(s) || "D".equals(s)) {<NEW_LINE>index += 2;<NEW_LINE>} else {<NEW_LINE>index += 1;<NEW_LINE>}<NEW_LINE>parameterNumber++;<NEW_LINE>}<NEW_LINE>if (!property.isEmpty()) {<NEW_LINE>// System.out.println(getFullyQualifiedMethodName() + " " + property);<NEW_LINE>database.setProperty(getMethodDescriptor(), property);<NEW_LINE>}<NEW_LINE>}
String name = localVariable.getName();
1,174,764
private static CompletableFuture<Suggestions> suggest(CommandContext<CommandSourceStack> context, SuggestionsBuilder builder) throws CommandSyntaxException {<NEW_LINE>CommandSuggestionEvent event = new CommandSuggestionEvent(ForgeAdapter.adaptPlayer(context.getSource().getPlayerOrException()), builder.getInput());<NEW_LINE>WorldEdit.getInstance().getEventBus().post(event);<NEW_LINE>List<Substring> suggestions = event.getSuggestions();<NEW_LINE>ImmutableList.Builder<Suggestion<MASK><NEW_LINE>for (Substring suggestion : suggestions) {<NEW_LINE>String suggestionText = suggestion.getSubstring();<NEW_LINE>// If at end, we are actually suggesting the next argument<NEW_LINE>// Ensure there is a space!<NEW_LINE>if (suggestion.getStart() == suggestion.getEnd() && suggestion.getEnd() == builder.getInput().length() && !builder.getInput().endsWith(" ") && !builder.getInput().endsWith("\"")) {<NEW_LINE>suggestionText = " " + suggestionText;<NEW_LINE>}<NEW_LINE>result.add(new Suggestion(StringRange.between(suggestion.getStart(), suggestion.getEnd()), suggestionText));<NEW_LINE>}<NEW_LINE>return CompletableFuture.completedFuture(Suggestions.create(builder.getInput(), result.build()));<NEW_LINE>}
> result = ImmutableList.builder();
946,571
public void parseAndInject(String[] args, T injectee) throws InvalidCommandException {<NEW_LINE>this.injectee = injectee;<NEW_LINE>pendingInjections.clear();<NEW_LINE>Iterator<String> <MASK><NEW_LINE>ImmutableList.Builder<String> builder = ImmutableList.builder();<NEW_LINE>while (argsIter.hasNext()) {<NEW_LINE>String arg = argsIter.next();<NEW_LINE>if (arg.equals("--")) {<NEW_LINE>// "--" marks the end of options and the beginning of positional arguments.<NEW_LINE>break;<NEW_LINE>} else if (arg.startsWith("--")) {<NEW_LINE>parseLongOption(arg, argsIter);<NEW_LINE>} else if (arg.startsWith("-")) {<NEW_LINE>parseShortOptions(arg, argsIter);<NEW_LINE>} else {<NEW_LINE>builder.add(arg);<NEW_LINE>// allow positional arguments to mix with options since many linux commands do<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (PendingInjection pi : pendingInjections) {<NEW_LINE>pi.injectableOption.inject(pi.value, injectee);<NEW_LINE>}<NEW_LINE>ImmutableList<String> leftovers = builder.addAll(argsIter).build();<NEW_LINE>invokeMethod(injectee, injectionMap.leftoversMethod, leftovers);<NEW_LINE>}
argsIter = Iterators.forArray(args);
1,297,564
private void pull() throws GitAPIException {<NEW_LINE>Git git = recordGit(Git.wrap(repository));<NEW_LINE>PullCommand pull = git.pull().setCredentialsProvider(endpoint.credentialsProvider()).setRebase(true);<NEW_LINE>PullResult result = pull.call();<NEW_LINE>if (!result.isSuccessful()) {<NEW_LINE>LOGGER.log(Level.WARNING, () -> String.format("Cannot pull from git '%s', branch '%s'", uri.toASCIIString(), branch));<NEW_LINE>if (LOGGER.isLoggable(Level.FINEST)) {<NEW_LINE>Status status = git.status().call();<NEW_LINE>LOGGER.finest(() -> <MASK><NEW_LINE>if (!status.isClean()) {<NEW_LINE>LOGGER.finest(() -> "git status uncommitted changes: " + status.getUncommittedChanges());<NEW_LINE>LOGGER.finest(() -> "git status untracked: " + status.getUntracked());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.fine("Pull was successful.");<NEW_LINE>}<NEW_LINE>LOGGER.finest(() -> "git rebase result: " + result.getRebaseResult().getStatus().name());<NEW_LINE>LOGGER.finest(() -> "git fetch result: " + result.getFetchResult().getMessages());<NEW_LINE>}
"git status cleanliness: " + status.isClean());
331,369
private void storedNameIdMapToV3() throws IOException {<NEW_LINE>final Path nameIdMapHolderFileV3T = storagePath.resolve(NAME_ID_MAP_V3_T);<NEW_LINE>if (Files.exists(nameIdMapHolderFileV3T)) {<NEW_LINE>Files.delete(nameIdMapHolderFileV3T);<NEW_LINE>}<NEW_LINE>final FileChannel v3NameIdMapHolder = FileChannel.open(nameIdMapHolderFileV3T, StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.READ);<NEW_LINE>for (final Map.Entry<String, Integer> nameIdEntry : nameIdMap.entrySet()) {<NEW_LINE>if (nameIdEntry.getValue() >= 0) {<NEW_LINE>final OFile fileClassic = files.get(externalFileId<MASK><NEW_LINE>final String fileSystemName = fileClassic.getName();<NEW_LINE>final NameFileIdEntry nameFileIdEntry = new NameFileIdEntry(nameIdEntry.getKey(), nameIdEntry.getValue(), fileSystemName);<NEW_LINE>writeNameIdEntry(v3NameIdMapHolder, nameFileIdEntry, false);<NEW_LINE>} else {<NEW_LINE>final NameFileIdEntry nameFileIdEntry = new NameFileIdEntry(nameIdEntry.getKey(), nameIdEntry.getValue(), "");<NEW_LINE>writeNameIdEntry(v3NameIdMapHolder, nameFileIdEntry, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>v3NameIdMapHolder.force(true);<NEW_LINE>v3NameIdMapHolder.close();<NEW_LINE>try {<NEW_LINE>Files.move(nameIdMapHolderFileV3T, storagePath.resolve(NAME_ID_MAP_V3), StandardCopyOption.ATOMIC_MOVE);<NEW_LINE>} catch (AtomicMoveNotSupportedException e) {<NEW_LINE>Files.move(nameIdMapHolderFileV3T, storagePath.resolve(NAME_ID_MAP_V3));<NEW_LINE>}<NEW_LINE>}
(nameIdEntry.getValue()));
993,203
public void add(String rule, String value) {<NEW_LINE>if (rule.equals("sitemap")) {<NEW_LINE>if (this.sitemap == null) {<NEW_LINE>this.sitemap = new ArrayList<String>();<NEW_LINE>}<NEW_LINE>this.sitemap.add(value);<NEW_LINE>} else if (rule.equals("crawl-delay")) {<NEW_LINE>try {<NEW_LINE>this.crawlDelay = Double.parseDouble(value);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>logger.warn("Invalid number format for crawl-delay robots.txt: {}", value);<NEW_LINE>}<NEW_LINE>} else if (rule.equals("host")) {<NEW_LINE>this.preferredHost = value;<NEW_LINE>} else if (rule.equals("allow")) {<NEW_LINE>this.pathRules.add(new PathRule(HostDirectives.ALLOWED, value));<NEW_LINE>} else if (rule.equals("disallow")) {<NEW_LINE>this.pathRules.add(new PathRule(HostDirectives.DISALLOWED, value));<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
logger.error("Invalid key in robots.txt passed to UserAgentRules: {}", rule);
466,898
public static ListUserSolutionsResponse unmarshall(ListUserSolutionsResponse listUserSolutionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listUserSolutionsResponse.setRequestId(_ctx.stringValue("ListUserSolutionsResponse.RequestId"));<NEW_LINE>listUserSolutionsResponse.setCurrentPageNum(_ctx.integerValue("ListUserSolutionsResponse.CurrentPageNum"));<NEW_LINE>listUserSolutionsResponse.setTotalPageNum(_ctx.integerValue("ListUserSolutionsResponse.TotalPageNum"));<NEW_LINE>listUserSolutionsResponse.setPageSize(_ctx.integerValue("ListUserSolutionsResponse.PageSize"));<NEW_LINE>listUserSolutionsResponse.setTotalItemNum(_ctx.integerValue("ListUserSolutionsResponse.TotalItemNum"));<NEW_LINE>List<Solution> data = new ArrayList<Solution>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListUserSolutionsResponse.Data.Length"); i++) {<NEW_LINE>Solution solution = new Solution();<NEW_LINE>solution.setStatus(_ctx.integerValue("ListUserSolutionsResponse.Data[" + i + "].Status"));<NEW_LINE>solution.setUpdateTime(_ctx.longValue("ListUserSolutionsResponse.Data[" + i + "].UpdateTime"));<NEW_LINE>solution.setDeliveryOrderBizId(_ctx.stringValue("ListUserSolutionsResponse.Data[" + i + "].DeliveryOrderBizId"));<NEW_LINE>solution.setCreateTime(_ctx.longValue("ListUserSolutionsResponse.Data[" + i + "].CreateTime"));<NEW_LINE>solution.setUserId(_ctx.stringValue("ListUserSolutionsResponse.Data[" + i + "].UserId"));<NEW_LINE>solution.setBizId(_ctx.stringValue<MASK><NEW_LINE>solution.setPartnerCode(_ctx.stringValue("ListUserSolutionsResponse.Data[" + i + "].PartnerCode"));<NEW_LINE>solution.setReason(_ctx.stringValue("ListUserSolutionsResponse.Data[" + i + "].Reason"));<NEW_LINE>solution.setIntentionAssignBizId(_ctx.stringValue("ListUserSolutionsResponse.Data[" + i + "].IntentionAssignBizId"));<NEW_LINE>solution.setIntentionBizId(_ctx.stringValue("ListUserSolutionsResponse.Data[" + i + "].IntentionBizId"));<NEW_LINE>solution.setBizType(_ctx.stringValue("ListUserSolutionsResponse.Data[" + i + "].BizType"));<NEW_LINE>data.add(solution);<NEW_LINE>}<NEW_LINE>listUserSolutionsResponse.setData(data);<NEW_LINE>return listUserSolutionsResponse;<NEW_LINE>}
("ListUserSolutionsResponse.Data[" + i + "].BizId"));
1,053,801
private void updatePlayerMedia() {<NEW_LINE>if (answerFile != null) {<NEW_LINE>Clip clip = new Clip("audio:" + getFormEntryPrompt().getIndex().toString(), answerFile.getAbsolutePath());<NEW_LINE>audioPlayer.onPlayingChanged(clip.getClipID(), <MASK><NEW_LINE>audioPlayer.onPositionChanged(clip.getClipID(), binding.audioPlayer.audioController::setPosition);<NEW_LINE>binding.audioPlayer.audioController.setDuration(getDurationOfFile(clip.getURI()));<NEW_LINE>binding.audioPlayer.audioController.setListener(new AudioControllerView.Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPlayClicked() {<NEW_LINE>audioPlayer.play(clip);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPauseClicked() {<NEW_LINE>audioPlayer.pause();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPositionChanged(Integer newPosition) {<NEW_LINE>AnalyticsUtils.logFormEvent(AnalyticsEvents.AUDIO_PLAYER_SEEK);<NEW_LINE>audioPlayer.setPosition(clip.getClipID(), newPosition);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRemoveClicked() {<NEW_LINE>new MaterialAlertDialogBuilder(getContext()).setTitle(R.string.delete_answer_file_question).setMessage(R.string.answer_file_delete_warning).setPositiveButton(R.string.delete_answer_file, (dialog, which) -> clearAnswer()).setNegativeButton(R.string.cancel, null).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
binding.audioPlayer.audioController::setPlaying);
1,406,584
public void tick() {<NEW_LINE>super.tick();<NEW_LINE>if (!running || level == null) {<NEW_LINE>if (hasLevel() && !level.isClientSide) {<NEW_LINE>if (getSpeed() == 0)<NEW_LINE>return;<NEW_LINE>if (entityScanCooldown > 0)<NEW_LINE>entityScanCooldown--;<NEW_LINE>if (entityScanCooldown <= 0) {<NEW_LINE>entityScanCooldown = ENTITY_SCAN;<NEW_LINE>if (TileEntityBehaviour.get(level, worldPosition.below(2), TransportedItemStackHandlerBehaviour.TYPE) != null)<NEW_LINE>return;<NEW_LINE>if (AllBlocks.BASIN.has(level.getBlockState(worldPosition.below(2))))<NEW_LINE>return;<NEW_LINE>for (ItemEntity itemEntity : level.getEntitiesOfClass(ItemEntity.class, new AABB(worldPosition.below()).deflate(.125f))) {<NEW_LINE>if (!itemEntity.isAlive() || !itemEntity.isOnGround())<NEW_LINE>continue;<NEW_LINE>ItemStack stack = itemEntity.getItem();<NEW_LINE>Optional<PressingRecipe> recipe = getRecipe(stack);<NEW_LINE>if (!recipe.isPresent())<NEW_LINE>continue;<NEW_LINE>start(Mode.WORLD);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (level.isClientSide && runningTicks == -CYCLE / 2) {<NEW_LINE>prevRunningTicks = CYCLE / 2;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (runningTicks == CYCLE / 2 && getSpeed() != 0) {<NEW_LINE>if (inWorld())<NEW_LINE>applyPressingInWorld();<NEW_LINE>if (onBasin())<NEW_LINE>applyCompactingOnBasin();<NEW_LINE>if (level.getBlockState(worldPosition.below(2)).getSoundType() == SoundType.WOOL)<NEW_LINE>AllSoundEvents.MECHANICAL_PRESS_ACTIVATION_ON_BELT.playOnServer(level, worldPosition);<NEW_LINE>else<NEW_LINE>AllSoundEvents.MECHANICAL_PRESS_ACTIVATION.playOnServer(level, worldPosition, .5f, .75f + (Math.abs(<MASK><NEW_LINE>if (!level.isClientSide)<NEW_LINE>sendData();<NEW_LINE>}<NEW_LINE>if (!level.isClientSide && runningTicks > CYCLE) {<NEW_LINE>finished = true;<NEW_LINE>running = false;<NEW_LINE>if (onBasin() && matchBasinRecipe(currentRecipe) && getBasin().filter(BasinTileEntity::canContinueProcessing).isPresent())<NEW_LINE>startProcessingBasin();<NEW_LINE>else<NEW_LINE>basinChecker.scheduleUpdate();<NEW_LINE>pressedItems.clear();<NEW_LINE>sendData();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>prevRunningTicks = runningTicks;<NEW_LINE>runningTicks += getRunningTickSpeed();<NEW_LINE>if (prevRunningTicks < CYCLE / 2 && runningTicks >= CYCLE / 2) {<NEW_LINE>runningTicks = CYCLE / 2;<NEW_LINE>// Pause the ticks until a packet is received<NEW_LINE>if (level.isClientSide && !isVirtual())<NEW_LINE>runningTicks = -(CYCLE / 2);<NEW_LINE>}<NEW_LINE>}
getSpeed()) / 1024f));
495,632
public static PreLoadedApk loadModule(String path) {<NEW_LINE>if (path == null)<NEW_LINE>return null;<NEW_LINE>var file = new PreLoadedApk();<NEW_LINE>var preLoadedDexes <MASK><NEW_LINE>var moduleClassNames = new ArrayList<String>(1);<NEW_LINE>var moduleLibraryNames = new ArrayList<String>(1);<NEW_LINE>try (var apkFile = new ZipFile(path)) {<NEW_LINE>readDexes(apkFile, preLoadedDexes);<NEW_LINE>readName(apkFile, "assets/xposed_init", moduleClassNames);<NEW_LINE>readName(apkFile, "assets/native_init", moduleLibraryNames);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.e(TAG, "Can not open " + path, e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (preLoadedDexes.isEmpty())<NEW_LINE>return null;<NEW_LINE>if (moduleClassNames.isEmpty())<NEW_LINE>return null;<NEW_LINE>file.preLoadedDexes = preLoadedDexes;<NEW_LINE>file.moduleClassNames = moduleClassNames;<NEW_LINE>file.moduleLibraryNames = moduleLibraryNames;<NEW_LINE>return file;<NEW_LINE>}
= new ArrayList<SharedMemory>();
760,273
public static boolean downloadNodeSources(Version version, boolean iojs) throws NetworkException, IOException {<NEW_LINE>assert !EventQueue.isDispatchThread();<NEW_LINE>assert version != null;<NEW_LINE>deleteExistingNodeSources(version);<NEW_LINE>File nodeSources = NodeJsUtils.getNodeSources();<NEW_LINE>String nodeVersion = version.toString();<NEW_LINE>// NOI18N<NEW_LINE>File archive = new File(nodeSources, (iojs ? "iojs" : "nodejs") + "-" + nodeVersion + ".tar.gz");<NEW_LINE>if (!downloadNodeSources(archive, nodeVersion, iojs)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// unpack<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>String foldername = decompressTarGz(archive, nodeSources, false);<NEW_LINE>assert foldername != null : version;<NEW_LINE>success = new File(nodeSources, foldername).renameTo(<MASK><NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.log(Level.INFO, archive.getAbsolutePath(), ex);<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>if (!archive.delete()) {<NEW_LINE>archive.deleteOnExit();<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}
new File(nodeSources, nodeVersion));
602,646
public boolean load(String date, Collection<Integer> hashs, int serverId) {<NEW_LINE>if (hashs == null || hashs.size() == 0)<NEW_LINE>return false;<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("date", date);<NEW_LINE>param.put("type", type);<NEW_LINE>ListValue hashLv = param.newList("hash");<NEW_LINE>Iterator<Integer> itr = hashs.iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>int key = itr.next();<NEW_LINE>if (entries.containsKey(key) == false) {<NEW_LINE>hashLv.add(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hashLv.size() == 0)<NEW_LINE>return false;<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>List<Pack> packList = null;<NEW_LINE>try {<NEW_LINE>packList = tcp.process(cmd, param);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>if (packList == null)<NEW_LINE>return false;<NEW_LINE>for (Pack pack : packList) {<NEW_LINE>MapPack re = (MapPack) pack;<NEW_LINE>Iterator<String> en = re.keys();<NEW_LINE>while (en.hasNext()) {<NEW_LINE>String key = en.next();<NEW_LINE>String value = re.getText(key);<NEW_LINE>if (StringUtil.isNotEmpty(value)) {<NEW_LINE>entries.put((int) Hexa32<MASK><NEW_LINE>if (entries.size() > limit) {<NEW_LINE>entries.removeFirst();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.toLong32(key), value);
274,692
private void buildWriterList(TupleMetadata schema) {<NEW_LINE>int colIndex = 0;<NEW_LINE>for (MaterializedField field : schema.toFieldList()) {<NEW_LINE>String fieldName = field.getName();<NEW_LINE>MinorType type = field<MASK><NEW_LINE>if (type == MinorType.FLOAT8) {<NEW_LINE>writerList.add(new DoubleSasColumnWriter(colIndex, fieldName, rowWriter));<NEW_LINE>} else if (type == MinorType.DATE) {<NEW_LINE>writerList.add(new DateSasColumnWriter(colIndex, fieldName, rowWriter));<NEW_LINE>} else if (type == MinorType.TIME) {<NEW_LINE>writerList.add(new TimeSasColumnWriter(colIndex, fieldName, rowWriter));<NEW_LINE>} else if (type == MinorType.VARCHAR) {<NEW_LINE>writerList.add(new StringSasColumnWriter(colIndex, fieldName, rowWriter));<NEW_LINE>} else if (type == MinorType.TIMESTAMP) {<NEW_LINE>writerList.add(new TimestampSasColumnWriter(colIndex, fieldName, rowWriter));<NEW_LINE>} else {<NEW_LINE>throw UserException.dataReadError().message(fieldName + " is an unparsable data type: " + type.name() + ". The SAS reader does not support this data type.").addContext(errorContext).build(logger);<NEW_LINE>}<NEW_LINE>colIndex++;<NEW_LINE>}<NEW_LINE>}
.getType().getMinorType();
687,707
protected void init() {<NEW_LINE>setRowHeaderView(foldingSideBar = new FoldingSideBar(textView, this));<NEW_LINE>setViewportView(textView);<NEW_LINE>textView.setEditable(false);<NEW_LINE>textView.addMouseListener(this);<NEW_LINE>textView.addMouseMotionListener(this);<NEW_LINE>textView.addKeyListener(this);<NEW_LINE>textView.addMouseWheelListener(this);<NEW_LINE>// #107354<NEW_LINE>OCaret oc = new OCaret();<NEW_LINE>oc.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);<NEW_LINE>textView.setCaret(oc);<NEW_LINE>getCaret().setSelectionVisible(true);<NEW_LINE>getVerticalScrollBar().getModel().addChangeListener(this);<NEW_LINE>getVerticalScrollBar().addMouseMotionListener(this);<NEW_LINE>getViewport().addMouseListener(this);<NEW_LINE>getVerticalScrollBar().addMouseListener(this);<NEW_LINE>setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_AS_NEEDED);<NEW_LINE>setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS);<NEW_LINE>addMouseListener(this);<NEW_LINE>getCaret().addChangeListener(this);<NEW_LINE>textView.setFont(OutputOptions.getDefault().getFont(isWrapped()));<NEW_LINE><MASK><NEW_LINE>setViewportBorder(BorderFactory.createEmptyBorder());<NEW_LINE>Color c = UIManager.getColor("nb.output.selectionBackground");<NEW_LINE>if (c != null) {<NEW_LINE>textView.setSelectionColor(c);<NEW_LINE>}<NEW_LINE>}
setBorder(BorderFactory.createEmptyBorder());
1,281,494
public void adjustCost(BigDecimal deltaAmt, BigDecimal deltaQty, boolean reset) {<NEW_LINE>BigDecimal newCost = Env.ZERO;<NEW_LINE>BigDecimal newQty = Env.ZERO;<NEW_LINE>if (!reset) {<NEW_LINE>newCost = getA_Asset_Cost();<NEW_LINE>newQty = getA_QTY_Current();<NEW_LINE>}<NEW_LINE>newCost = newCost.add(deltaAmt);<NEW_LINE>newQty = newQty.add(deltaQty);<NEW_LINE>// TODO: crashes if I cancel an Issue:<NEW_LINE>// if (newQty.signum() < 0) {<NEW_LINE>// throw new ArhRuntimeException(getCtx(), "@A_QTY_Current@ < 0");<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// There must be verified that the remaining value to be greater than the amount diminished<NEW_LINE>// total devaluation because if the entire asset value (A_Asset_Cost) must be brought to 0.<NEW_LINE>// if (deltaAmt.signum() < 0)<NEW_LINE>// {<NEW_LINE>// BigDecimal remainingAmt_C = getRemainingCost(null, false);<NEW_LINE>// if (remainingAmt_C.compareTo(deltaAmt.negate()) < 0)<NEW_LINE>// {<NEW_LINE>// throw new ArhRuntimeException(getCtx(), "@A_Asset_Remaining@ < @DeltaAmt@")<NEW_LINE>// .addInfo("@A_Asset_Cost@=", getA_Asset_Cost())<NEW_LINE>// .addInfo("@A_Accumulated_Depr@=", getA_Accumulated_Depr());<NEW_LINE>// }<NEW_LINE>// BigDecimal remainingAmt_F = getRemainingCost(null, true);<NEW_LINE>// if (remainingAmt_F.compareTo(deltaAmt.negate()) < 0)<NEW_LINE>// {<NEW_LINE>// throw new ArhRuntimeException(getCtx(), "@A_Asset_Remaining_F@ < @DeltaAmt@")<NEW_LINE>// .addInfo("@A_Asset_Cost=@", getA_Asset_Cost())<NEW_LINE>// .addInfo("@A_Accumulated_Depr@=", getA_Accumulated_Depr_F());<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>setA_Asset_Cost(newCost);<NEW_LINE>setA_QTY_Current(newQty);<NEW_LINE>if (CLogMgt.isLevelFine())<NEW_LINE>log.fine("adjustCost(" + deltaAmt + ", " + deltaQty + ", reset=" + reset + ") => amt=" + getA_Asset_Cost(<MASK><NEW_LINE>}
) + ", qty=" + getA_QTY_Current());
709,097
public <T> boolean tryExecute(Class<T> remoteInterface, T object, ExecutorService executorService, long timeout, TimeUnit timeUnit) throws InterruptedException {<NEW_LINE>String requestQueueName = getRequestQueueName(remoteInterface);<NEW_LINE>RBlockingQueue<String> requestQueue = getBlockingQueue(requestQueueName, StringCodec.INSTANCE);<NEW_LINE>String requestId = requestQueue.poll(timeout, timeUnit);<NEW_LINE>if (requestId == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>RMap<String, RemoteServiceRequest> tasks = getMap(((RedissonObject) requestQueue).getRawName() + ":tasks");<NEW_LINE>RFuture<RemoteServiceRequest> taskFuture = getTask(requestId, tasks);<NEW_LINE>RemoteServiceRequest <MASK><NEW_LINE>if (request == null) {<NEW_LINE>throw new IllegalStateException("Task can't be found for request: " + requestId);<NEW_LINE>}<NEW_LINE>RFuture<RRemoteServiceResponse> r = executeMethod(remoteInterface, requestQueue, executorService, request, object);<NEW_LINE>commandExecutor.getInterrupted(r);<NEW_LINE>return true;<NEW_LINE>}
request = commandExecutor.getInterrupted(taskFuture);
807,886
protected void permissionsCheck(Player player) {<NEW_LINE>canBeastLore = canUseSubskill(player, SubSkillType.TAMING_BEAST_LORE);<NEW_LINE>canCallWild = Permissions.callOfTheWild(player, EntityType.HORSE) || Permissions.callOfTheWild(player, EntityType.WOLF) || Permissions.callOfTheWild(player, EntityType.OCELOT);<NEW_LINE>canEnvironmentallyAware = canUseSubskill(player, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE);<NEW_LINE>canFastFood = <MASK><NEW_LINE>canGore = canUseSubskill(player, SubSkillType.TAMING_GORE);<NEW_LINE>canSharpenedClaws = canUseSubskill(player, SubSkillType.TAMING_SHARPENED_CLAWS);<NEW_LINE>canShockProof = canUseSubskill(player, SubSkillType.TAMING_SHOCK_PROOF);<NEW_LINE>canThickFur = canUseSubskill(player, SubSkillType.TAMING_THICK_FUR);<NEW_LINE>canHolyHound = canUseSubskill(player, SubSkillType.TAMING_HOLY_HOUND);<NEW_LINE>}
canUseSubskill(player, SubSkillType.TAMING_FAST_FOOD_SERVICE);
827,000
private static boolean extendsType(ReferenceType t1, ReferenceType t2) {<NEW_LINE>if (t2 instanceof InterfaceType) {<NEW_LINE>List<InterfaceType> superInterfaces;<NEW_LINE>if (t1 instanceof ClassType) {<NEW_LINE>superInterfaces = ((ClassType) t1).allInterfaces();<NEW_LINE>} else if (t1 instanceof InterfaceType) {<NEW_LINE>superInterfaces = ((<MASK><NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return superInterfaces.contains((InterfaceType) t2);<NEW_LINE>}<NEW_LINE>if (t2 instanceof ClassType) {<NEW_LINE>if (t1 instanceof ClassType) {<NEW_LINE>ClassType superClass = ((ClassType) t1).superclass();<NEW_LINE>if (superClass != null) {<NEW_LINE>if (superClass.equals((ClassType) t2)) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return extendsType(superClass, t2);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (t2 instanceof ArrayType) {<NEW_LINE>if (t1 instanceof ArrayType) {<NEW_LINE>try {<NEW_LINE>Type ct1 = ((ArrayType) t1).componentType();<NEW_LINE>Type ct2 = ((ArrayType) t2).componentType();<NEW_LINE>return extendsType(ct1, ct2);<NEW_LINE>} catch (ClassNotLoadedException cnlex) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unknown ReferenceType: " + t2);<NEW_LINE>}<NEW_LINE>}
InterfaceType) t1).superinterfaces();