idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,469,531
final DeleteQueueResult executeDeleteQueue(DeleteQueueRequest deleteQueueRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteQueueRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteQueueRequest> request = null;<NEW_LINE>Response<DeleteQueueResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteQueueRequestMarshaller().marshall<MASK><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, "SQS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteQueue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteQueueResult> responseHandler = new StaxResponseHandler<DeleteQueueResult>(new DeleteQueueResultStaxUnmarshaller());<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>}
(super.beforeMarshalling(deleteQueueRequest));
265,015
public void initGUI() {<NEW_LINE>this.infoTextArea.setFont(infoTextArea.getFont().deriveFont(Font.BOLD));<NEW_LINE>this.infoTextArea.setLineWrap(true);<NEW_LINE>this.infoTextArea.setOpaque(false);<NEW_LINE>this.infoTextArea.setWrapStyleWord(true);<NEW_LINE>this.infoTextArea.setEditable(false);<NEW_LINE>this.northPanel.add(iconLabel, BorderLayout.WEST);<NEW_LINE>this.northPanel.add(infoTextArea, BorderLayout.CENTER);<NEW_LINE><MASK><NEW_LINE>this.reasonPanel.add(reasonLabel, BorderLayout.WEST);<NEW_LINE>this.reasonPanel.add(reasonField, BorderLayout.CENTER);<NEW_LINE>this.reasonPanel.setOpaque(false);<NEW_LINE>this.dataPanel.add(reasonPanel, BorderLayout.SOUTH);<NEW_LINE>this.dataPanel.setOpaque(false);<NEW_LINE>this.acceptButton.addActionListener(this);<NEW_LINE>this.rejectButton.addActionListener(this);<NEW_LINE>this.ignoreButton.addActionListener(this);<NEW_LINE>this.buttonsPanel.add(acceptButton);<NEW_LINE>this.buttonsPanel.add(rejectButton);<NEW_LINE>this.buttonsPanel.add(ignoreButton);<NEW_LINE>this.buttonsPanel.setOpaque(false);<NEW_LINE>this.getRootPane().setDefaultButton(acceptButton);<NEW_LINE>this.acceptButton.setMnemonic(GuiActivator.getResources().getI18nMnemonic("service.gui.ACCEPT"));<NEW_LINE>this.rejectButton.setMnemonic(GuiActivator.getResources().getI18nMnemonic("service.gui.REJECT"));<NEW_LINE>this.ignoreButton.setMnemonic(GuiActivator.getResources().getI18nMnemonic("service.gui.IGNORE"));<NEW_LINE>this.mainPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));<NEW_LINE>this.mainPanel.add(northPanel, BorderLayout.NORTH);<NEW_LINE>this.mainPanel.add(dataPanel, BorderLayout.CENTER);<NEW_LINE>this.mainPanel.add(buttonsPanel, BorderLayout.SOUTH);<NEW_LINE>this.mainPanel.setOpaque(false);<NEW_LINE>this.getContentPane().add(mainPanel);<NEW_LINE>this.pack();<NEW_LINE>}
this.northPanel.setOpaque(false);
267,001
public static List<double[]> independentHueSat(List<File> images) {<NEW_LINE>List<double[]> points = new ArrayList<>();<NEW_LINE>// The number of bins is an important parameter. Try adjusting it<NEW_LINE>TupleDesc_F64 histogramHue = new TupleDesc_F64(30);<NEW_LINE>TupleDesc_F64 histogramValue = new TupleDesc_F64(30);<NEW_LINE>List<TupleDesc_F64> histogramList = new ArrayList<>();<NEW_LINE>histogramList.add(histogramHue);<NEW_LINE>histogramList.add(histogramValue);<NEW_LINE>Planar<GrayF32> rgb = new Planar<>(GrayF32.class, 1, 1, 3);<NEW_LINE>Planar<GrayF32> hsv = new Planar<>(GrayF32.class, 1, 1, 3);<NEW_LINE>for (File f : images) {<NEW_LINE>BufferedImage buffered = UtilImageIO.loadImageNotNull(f.getPath());<NEW_LINE>rgb.reshape(buffered.getWidth(), buffered.getHeight());<NEW_LINE>hsv.reshape(buffered.getWidth(), buffered.getHeight());<NEW_LINE>ConvertBufferedImage.convertFrom(buffered, rgb, true);<NEW_LINE>ColorHsv.rgbToHsv(rgb, hsv);<NEW_LINE>GHistogramFeatureOps.histogram(hsv.getBand(0), 0, 2 * Math.PI, histogramHue);<NEW_LINE>GHistogramFeatureOps.histogram(hsv.getBand(1), 0, 1, histogramValue);<NEW_LINE>// need to combine them into a single descriptor for processing later on<NEW_LINE>TupleDesc_F64 imageHist = <MASK><NEW_LINE>// normalize so that image size doesn't matter<NEW_LINE>UtilFeature.normalizeL2(imageHist);<NEW_LINE>points.add(imageHist.data);<NEW_LINE>}<NEW_LINE>return points;<NEW_LINE>}
UtilFeature.combine(histogramList, null);
1,297,554
protected void hookMethod(CtClass ctClass) throws IOException, CannotCompileException, NotFoundException {<NEW_LINE>String src = getInvokeStaticSrc(NioFilesRenameHook.class, "checkFileRename", "$1,$2", Object.class, Object.class);<NEW_LINE>insertBefore(ctClass, "copy", "(Ljava/nio/file/Path;Ljava/nio/file/Path;[Ljava/nio/file/CopyOption;)Ljava/nio/file/Path;", src);<NEW_LINE>insertBefore(ctClass, "move", "(Ljava/nio/file/Path;Ljava/nio/file/Path;[Ljava/nio/file/CopyOption;)Ljava/nio/file/Path;", src);<NEW_LINE>String srcLinkHard = getInvokeStaticSrc(NioFilesRenameHook.class, "checkFileLink", "$1,$2," + "\"hard\"", Object.class, <MASK><NEW_LINE>insertBefore(ctClass, "createLink", "(Ljava/nio/file/Path;Ljava/nio/file/Path;)Ljava/nio/file/Path;", srcLinkHard);<NEW_LINE>// String srcLinkSoft = getInvokeStaticSrc(NioFilesRenameHook.class, "checkFileLink", "$1,$2," + "\"soft\"", Object.class, Object.class);<NEW_LINE>// insertBefore(ctClass, "createSymbolicLink", "(Ljava/nio/file/Path;Ljava/nio/file/Path;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path;", srcLinkSoft);<NEW_LINE>}
Object.class, String.class);
104,394
void encode(PgEncoder encoder) {<NEW_LINE>this.encoder = encoder;<NEW_LINE>if (cmd.isSuspended()) {<NEW_LINE>encoder.writeExecute(cmd.cursorId(<MASK><NEW_LINE>encoder.writeSync();<NEW_LINE>} else {<NEW_LINE>PgPreparedStatement ps = (PgPreparedStatement) cmd.preparedStatement();<NEW_LINE>if (cmd.isBatch()) {<NEW_LINE>if (cmd.paramsList().isEmpty()) {<NEW_LINE>// We set suspended to false as we won't get a command complete command back from Postgres<NEW_LINE>this.result = false;<NEW_LINE>completionHandler.handle(CommandResponse.failure("Can not execute batch query with 0 sets of batch parameters."));<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>for (Tuple param : cmd.paramsList()) {<NEW_LINE>encoder.writeBind(ps.bind, cmd.cursorId(), param);<NEW_LINE>encoder.writeExecute(cmd.cursorId(), cmd.fetch());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>encoder.writeBind(ps.bind, cmd.cursorId(), cmd.params());<NEW_LINE>encoder.writeExecute(cmd.cursorId(), cmd.fetch());<NEW_LINE>}<NEW_LINE>encoder.writeSync();<NEW_LINE>}<NEW_LINE>}
), cmd.fetch());
1,634,153
private static List<Integer> populateAllEOptions() {<NEW_LINE>List<Integer> allEOptions = new ArrayList<Integer>();<NEW_LINE>allEOptions.add(OptionNumberRegistry.IF_MATCH);<NEW_LINE>allEOptions.add(OptionNumberRegistry.ETAG);<NEW_LINE>allEOptions.add(OptionNumberRegistry.IF_NONE_MATCH);<NEW_LINE>allEOptions.add(OptionNumberRegistry.OBSERVE);<NEW_LINE>allEOptions.add(OptionNumberRegistry.LOCATION_PATH);<NEW_LINE>allEOptions.add(OptionNumberRegistry.URI_PATH);<NEW_LINE>allEOptions.add(OptionNumberRegistry.CONTENT_FORMAT);<NEW_LINE>allEOptions.add(OptionNumberRegistry.MAX_AGE);<NEW_LINE>allEOptions.add(OptionNumberRegistry.URI_QUERY);<NEW_LINE>allEOptions.add(OptionNumberRegistry.ACCEPT);<NEW_LINE><MASK><NEW_LINE>allEOptions.add(OptionNumberRegistry.BLOCK2);<NEW_LINE>allEOptions.add(OptionNumberRegistry.BLOCK1);<NEW_LINE>allEOptions.add(OptionNumberRegistry.SIZE2);<NEW_LINE>allEOptions.add(OptionNumberRegistry.SIZE1);<NEW_LINE>return allEOptions;<NEW_LINE>}
allEOptions.add(OptionNumberRegistry.LOCATION_QUERY);
1,624,189
private void scheduleSyncMonitoring() {<NEW_LINE>executor.scheduleAtFixedRate(() -> {<NEW_LINE>log.debug("Running the Sync Monitoring.");<NEW_LINE>try {<NEW_LINE>for (Map.Entry<String, DruidServerHolder> e : servers.entrySet()) {<NEW_LINE>DruidServerHolder serverHolder = e.getValue();<NEW_LINE>if (!serverHolder.syncer.isOK()) {<NEW_LINE>synchronized (servers) {<NEW_LINE>// check again that server is still there and only then reset.<NEW_LINE>if (servers.containsKey(e.getKey())) {<NEW_LINE>log.makeAlert("Server[%s] is not syncing properly. Current state is [%s]. Resetting it.", serverHolder.druidServer.getName(), serverHolder.syncer.getDebugInfo()).emit();<NEW_LINE>serverRemoved(serverHolder.druidServer);<NEW_LINE>serverAdded(new DruidServer(serverHolder.druidServer.getName(), serverHolder.druidServer.getHostAndPort(), serverHolder.druidServer.getHostAndTlsPort(), serverHolder.druidServer.getMaxSize(), serverHolder.druidServer.getType(), serverHolder.druidServer.getTier(), serverHolder.druidServer.getPriority()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (ex instanceof InterruptedException) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} else {<NEW_LINE>log.makeAlert(ex, "Exception in sync monitoring.").emit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, <MASK><NEW_LINE>}
1, 5, TimeUnit.MINUTES);
1,823,076
private void applyStartedShards(RoutingAllocation routingAllocation, List<ShardRouting> startedShardEntries) {<NEW_LINE>assert startedShardEntries<MASK><NEW_LINE>RoutingNodes routingNodes = routingAllocation.routingNodes();<NEW_LINE>for (ShardRouting startedShard : startedShardEntries) {<NEW_LINE>assert startedShard.initializing() : "only initializing shards can be started";<NEW_LINE>assert routingAllocation.metadata().index(startedShard.shardId().getIndex()) != null : "shard started for unknown index (shard entry: " + startedShard + ")";<NEW_LINE>assert startedShard == routingNodes.getByAllocationId(startedShard.shardId(), startedShard.allocationId().getId()) : "shard routing to start does not exist in routing table, expected: " + startedShard + " but was: " + routingNodes.getByAllocationId(startedShard.shardId(), startedShard.allocationId().getId());<NEW_LINE>routingNodes.startShard(LOGGER, startedShard, routingAllocation.changes());<NEW_LINE>}<NEW_LINE>}
.isEmpty() == false : "non-empty list of started shard entries expected";
1,568,592
private double computeTumbleDrag() {<NEW_LINE>// Computed based on Sampo's experimentation as documented in the pdf.<NEW_LINE>// compute the fin and body tube projected areas<NEW_LINE>double aFins = 0.0;<NEW_LINE>double aBt = 0.0;<NEW_LINE>Rocket r = this.getConfiguration().getRocket();<NEW_LINE>Iterator<RocketComponent> componentIterator = r.iterator();<NEW_LINE>while (componentIterator.hasNext()) {<NEW_LINE>RocketComponent component = componentIterator.next();<NEW_LINE>if (!component.isAerodynamic()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (component instanceof FinSet) {<NEW_LINE>final FinSet finComponent = ((FinSet) component);<NEW_LINE>final double finArea = finComponent.getPlanformArea();<NEW_LINE>int finCount = finComponent.getFinCount();<NEW_LINE>// check bounds on finCount.<NEW_LINE>if (finCount >= finEff.length) {<NEW_LINE>finCount = finEff.length - 1;<NEW_LINE>}<NEW_LINE>aFins += finArea * finEff[finCount];<NEW_LINE>} else if (component instanceof SymmetricComponent) {<NEW_LINE>aBt += ((SymmetricComponent) component).getComponentPlanformArea();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (<MASK><NEW_LINE>}
cDFin * aFins + cDBt * aBt);
1,147,193
public static void main(String[] args) throws IOException {<NEW_LINE>// exported as documented at https://dev.languagetool.org/developing-a-tagger-dictionary,<NEW_LINE>// then taking only the full form: awk '{print $1}' dictionary-nl.dump<NEW_LINE>String filename = "/home/dnaber/lt/dictionary-nl.dump";<NEW_LINE>MorfologikMultiSpeller speller = new MorfologikMultiSpeller("/nl/spelling/nl_NL.dict", Collections.singletonList("/nl/spelling/spelling.txt"<MASK><NEW_LINE>List<String> lines = Files.readAllLines(Paths.get(filename));<NEW_LINE>int lineCount = 0;<NEW_LINE>long lineTime = System.currentTimeMillis();<NEW_LINE>for (String line : lines) {<NEW_LINE>if (!speller.isMisspelled(line)) {<NEW_LINE>for (int i = 1; i < line.length(); i++) {<NEW_LINE>String part1 = line.substring(0, i);<NEW_LINE>String part2 = line.substring(i);<NEW_LINE>if (!speller.isMisspelled(part1) && !speller.isMisspelled(part2)) {<NEW_LINE>System.out.println(line + " => " + part1 + " " + part2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lineCount++;<NEW_LINE>if (lineCount % 1000 == 0) {<NEW_LINE>long runTime = System.currentTimeMillis() - lineTime;<NEW_LINE>lineTime = System.currentTimeMillis();<NEW_LINE>System.out.printf("lineCount: " + lineCount + " (%.2fs)\n", runTime / 1000.0f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), null, null, 1);
766,444
private void flush(ClusterDO clusterDO) {<NEW_LINE>ZkConfigImpl zkConfig = PhysicalClusterMetadataManager.getZKConfig(clusterDO.getId());<NEW_LINE>if (ValidateUtils.isNull(zkConfig)) {<NEW_LINE>LOGGER.error("flush topic properties, get zk config failed, clusterId:{}.", clusterDO.getId());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String topicName : PhysicalClusterMetadataManager.getTopicNameList(clusterDO.getId())) {<NEW_LINE>try {<NEW_LINE>Properties properties = <MASK><NEW_LINE>if (ValidateUtils.isNull(properties)) {<NEW_LINE>LOGGER.warn("get topic properties failed, clusterId:{} topicName:{}.", clusterDO.getId(), topicName);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>PhysicalClusterMetadataManager.putTopicProperties(clusterDO.getId(), topicName, properties);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("get topic properties failed, clusterId:{} topicName:{}.", clusterDO.getId(), topicName, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
KafkaZookeeperUtils.getTopicProperties(zkConfig, topicName);
35,019
protected void addForeignKeyStatements(AddColumnStatement statement, Database database, List<Sql> returnSql) {<NEW_LINE>for (ColumnConstraint constraint : statement.getConstraints()) {<NEW_LINE>if (constraint instanceof ForeignKeyConstraint) {<NEW_LINE>ForeignKeyConstraint fkConstraint = (ForeignKeyConstraint) constraint;<NEW_LINE>String refSchemaName = null;<NEW_LINE>String refTableName;<NEW_LINE>String refColName;<NEW_LINE>if (fkConstraint.getReferences() != null) {<NEW_LINE>Matcher referencesMatcher = Pattern.compile("([\\w\\._]+)\\(([\\w_]+)\\)").matcher(fkConstraint.getReferences());<NEW_LINE>if (!referencesMatcher.matches()) {<NEW_LINE>throw new UnexpectedLiquibaseException("Don't know how to find table and column names from " + fkConstraint.getReferences());<NEW_LINE>}<NEW_LINE>refTableName = referencesMatcher.group(1);<NEW_LINE>refColName = referencesMatcher.group(2);<NEW_LINE>} else {<NEW_LINE>refTableName = ((ForeignKeyConstraint) constraint).getReferencedTableName();<NEW_LINE>refColName = ((ForeignKeyConstraint) constraint).getReferencedColumnNames();<NEW_LINE>}<NEW_LINE>if (refTableName.indexOf(".") > 0) {<NEW_LINE>refSchemaName = refTableName.split("\\.")[0];<NEW_LINE>refTableName = refTableName.split("\\.")[1];<NEW_LINE>}<NEW_LINE>AddForeignKeyConstraintStatement addForeignKeyConstraintStatement = new AddForeignKeyConstraintStatement(fkConstraint.getForeignKeyName(), statement.getCatalogName(), statement.getSchemaName(), statement.getTableName(), ColumnConfig.arrayFromNames(statement.getColumnName()), null, refSchemaName, refTableName, ColumnConfig.arrayFromNames(refColName));<NEW_LINE>addForeignKeyConstraintStatement.setShouldValidate(fkConstraint.shouldValidateForeignKey());<NEW_LINE>returnSql.addAll(Arrays.asList(SqlGeneratorFactory.getInstance().<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
generateSql(addForeignKeyConstraintStatement, database)));
1,262,249
public void itemStateChanged(ItemEvent e) {<NEW_LINE>if (e.getItem() == webcam) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (webcam == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final WebcamPanel tmp = panel;<NEW_LINE>remove(panel);<NEW_LINE>webcam.removeWebcamListener(this);<NEW_LINE>webcam = (Webcam) e.getItem();<NEW_LINE>webcam.setViewSize(WebcamResolution.VGA.getSize());<NEW_LINE>webcam.addWebcamListener(this);<NEW_LINE>System.out.println("selected " + webcam.getName());<NEW_LINE>panel <MASK><NEW_LINE>add(panel, BorderLayout.CENTER);<NEW_LINE>Thread t = new Thread() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>tmp.stop();<NEW_LINE>panel.start();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>t.setDaemon(true);<NEW_LINE>t.setUncaughtExceptionHandler(this);<NEW_LINE>t.start();<NEW_LINE>}
= new WebcamPanel(webcam, false);
1,355,515
final GetGroupsResult executeGetGroups(GetGroupsRequest getGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetGroupsRequest> request = null;<NEW_LINE>Response<GetGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetGroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getGroupsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "XRay");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetGroupsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,281,644
public void deleteMember(String workspaceId, String userId) {<NEW_LINE>GroupExample groupExample = new GroupExample();<NEW_LINE>groupExample.createCriteria().andTypeEqualTo(UserGroupType.WORKSPACE);<NEW_LINE>List<Group> groups = groupMapper.selectByExample(groupExample);<NEW_LINE>List<String> groupIds = groups.stream().map(Group::getId).collect(Collectors.toList());<NEW_LINE>if (CollectionUtils.isEmpty(groupIds)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>UserGroupExample userGroupExample = new UserGroupExample();<NEW_LINE>userGroupExample.createCriteria().andUserIdEqualTo(userId).andSourceIdEqualTo(workspaceId).andGroupIdIn(groupIds);<NEW_LINE>User <MASK><NEW_LINE>if (StringUtils.equals(workspaceId, user.getLastWorkspaceId())) {<NEW_LINE>user.setLastWorkspaceId("");<NEW_LINE>userMapper.updateByPrimaryKeySelective(user);<NEW_LINE>}<NEW_LINE>userGroupMapper.deleteByExample(userGroupExample);<NEW_LINE>}
user = userMapper.selectByPrimaryKey(userId);
349,807
public static QueryOperationAuditInfoListResponse unmarshall(QueryOperationAuditInfoListResponse queryOperationAuditInfoListResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryOperationAuditInfoListResponse.setRequestId(_ctx.stringValue("QueryOperationAuditInfoListResponse.RequestId"));<NEW_LINE>queryOperationAuditInfoListResponse.setTotalItemNum(_ctx.integerValue("QueryOperationAuditInfoListResponse.TotalItemNum"));<NEW_LINE>queryOperationAuditInfoListResponse.setCurrentPageNum(_ctx.integerValue("QueryOperationAuditInfoListResponse.CurrentPageNum"));<NEW_LINE>queryOperationAuditInfoListResponse.setTotalPageNum(_ctx.integerValue("QueryOperationAuditInfoListResponse.TotalPageNum"));<NEW_LINE>queryOperationAuditInfoListResponse.setPageSize(_ctx.integerValue("QueryOperationAuditInfoListResponse.PageSize"));<NEW_LINE>queryOperationAuditInfoListResponse.setPrePage(_ctx.booleanValue("QueryOperationAuditInfoListResponse.PrePage"));<NEW_LINE>queryOperationAuditInfoListResponse.setNextPage(_ctx.booleanValue("QueryOperationAuditInfoListResponse.NextPage"));<NEW_LINE>List<OperationAuditRecord> data = new ArrayList<OperationAuditRecord>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryOperationAuditInfoListResponse.Data.Length"); i++) {<NEW_LINE>OperationAuditRecord operationAuditRecord = new OperationAuditRecord();<NEW_LINE>operationAuditRecord.setId(_ctx.longValue("QueryOperationAuditInfoListResponse.Data[" + i + "].Id"));<NEW_LINE>operationAuditRecord.setCreateTime(_ctx.longValue("QueryOperationAuditInfoListResponse.Data[" + i + "].CreateTime"));<NEW_LINE>operationAuditRecord.setUpdateTime(_ctx.longValue("QueryOperationAuditInfoListResponse.Data[" + i + "].UpdateTime"));<NEW_LINE>operationAuditRecord.setBusinessName(_ctx.stringValue("QueryOperationAuditInfoListResponse.Data[" + i + "].BusinessName"));<NEW_LINE>operationAuditRecord.setDomainName(_ctx.stringValue<MASK><NEW_LINE>operationAuditRecord.setAuditType(_ctx.integerValue("QueryOperationAuditInfoListResponse.Data[" + i + "].AuditType"));<NEW_LINE>operationAuditRecord.setAuditStatus(_ctx.integerValue("QueryOperationAuditInfoListResponse.Data[" + i + "].AuditStatus"));<NEW_LINE>operationAuditRecord.setAuditInfo(_ctx.stringValue("QueryOperationAuditInfoListResponse.Data[" + i + "].AuditInfo"));<NEW_LINE>operationAuditRecord.setRemark(_ctx.stringValue("QueryOperationAuditInfoListResponse.Data[" + i + "].Remark"));<NEW_LINE>data.add(operationAuditRecord);<NEW_LINE>}<NEW_LINE>queryOperationAuditInfoListResponse.setData(data);<NEW_LINE>return queryOperationAuditInfoListResponse;<NEW_LINE>}
("QueryOperationAuditInfoListResponse.Data[" + i + "].DomainName"));
428,625
public CamundaFormDefinition execute(CommandContext commandContext) {<NEW_LINE>String binding = camundaFormRef.getBinding();<NEW_LINE>String key = camundaFormRef.getKey();<NEW_LINE>CamundaFormDefinitionEntity definition = null;<NEW_LINE>CamundaFormDefinitionManager manager = commandContext.getCamundaFormDefinitionManager();<NEW_LINE>if (binding.equals(DefaultFormHandler.FORM_REF_BINDING_DEPLOYMENT)) {<NEW_LINE>definition = manager.findDefinitionByDeploymentAndKey(deploymentId, key);<NEW_LINE>} else if (binding.equals(DefaultFormHandler.FORM_REF_BINDING_LATEST)) {<NEW_LINE>definition = manager.findLatestDefinitionByKey(key);<NEW_LINE>} else if (binding.equals(DefaultFormHandler.FORM_REF_BINDING_VERSION)) {<NEW_LINE>definition = manager.findDefinitionByKeyVersionAndTenantId(key, <MASK><NEW_LINE>} else {<NEW_LINE>throw new BadUserRequestException("Unsupported binding type for camundaFormRef. Expected to be one of " + DefaultFormHandler.ALLOWED_FORM_REF_BINDINGS + " but was:" + binding);<NEW_LINE>}<NEW_LINE>return definition;<NEW_LINE>}
camundaFormRef.getVersion(), null);
1,769,123
ActionResult<Wo> execute(EffectivePerson effectivePerson, String workId, JsonElement jsonElement) throws Exception {<NEW_LINE>Work work = null;<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>work = emc.<MASK><NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(workId, Work.class);<NEW_LINE>}<NEW_LINE>if (!business.readableWithJob(effectivePerson, work.getJob())) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, work);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>wi.setPerson(effectivePerson.getDistinguishedName());<NEW_LINE>Wo wo = ThisApplication.context().applications().postQuery(x_processplatform_service_processing.class, Applications.joinQueryUri("documentversion", "work", work.getId()), wi, work.getJob()).getData(Wo.class);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}
find(workId, Work.class);
1,687,780
public synchronized void addAPIProvider(OASProviderWrapper inDoc) {<NEW_LINE>if (OpenAPIUtils.isEventEnabled(tc)) {<NEW_LINE>Tr.event(tc, "Started merging OASProvider: " + inDoc.getOpenAPIProvider());<NEW_LINE>}<NEW_LINE>conflictsMap.clear();<NEW_LINE>inDoc.getJsonPathKeys().clear();<NEW_LINE>OASProviders.add(inDoc);<NEW_LINE>incomingProvider = inDoc;<NEW_LINE>OpenAPI openAPI = inDoc.getOpenAPI();<NEW_LINE>OAInProgress = openAPI;<NEW_LINE>addServers();<NEW_LINE>addTags();<NEW_LINE>addPaths();<NEW_LINE>addComponents();<NEW_LINE>addSecurity();<NEW_LINE>addExtensions();<NEW_LINE>List<Operation> operations = getAllOperations(OAInProgress);<NEW_LINE>for (Operation operation : operations) {<NEW_LINE><MASK><NEW_LINE>if (operationId == null)<NEW_LINE>continue;<NEW_LINE>if (operationIds.contains(operationId)) {<NEW_LINE>int count = 0;<NEW_LINE>String newOperationId = operationId + "_" + count;<NEW_LINE>while (operationIds.contains(newOperationId)) {<NEW_LINE>count++;<NEW_LINE>newOperationId = operationId + "_" + count;<NEW_LINE>}<NEW_LINE>getConflictsMap(OA_OPERATION_ID).put(operationId, newOperationId);<NEW_LINE>operation.setOperationId(newOperationId);<NEW_LINE>operationIds.add(newOperationId);<NEW_LINE>} else {<NEW_LINE>operationIds.add(operationId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>renameReferences();<NEW_LINE>incomingProvider = null;<NEW_LINE>OAInProgress = null;<NEW_LINE>if (OpenAPIUtils.isEventEnabled(tc)) {<NEW_LINE>Tr.event(tc, "Done merging OASProvider: " + inDoc.getOpenAPIProvider());<NEW_LINE>}<NEW_LINE>}
String operationId = operation.getOperationId();
27,109
final CreateSuiteDefinitionResult executeCreateSuiteDefinition(CreateSuiteDefinitionRequest createSuiteDefinitionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSuiteDefinitionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSuiteDefinitionRequest> request = null;<NEW_LINE>Response<CreateSuiteDefinitionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSuiteDefinitionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSuiteDefinitionRequest));<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, "IotDeviceAdvisor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSuiteDefinition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSuiteDefinitionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSuiteDefinitionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,735,199
public com.squareup.okhttp.Call throttlingBlacklistConditionIdDeleteAsync(String conditionId, String ifMatch, String ifUnmodifiedSince, final ApiCallback<Void> callback) throws ApiException {<NEW_LINE>ProgressResponseBody.ProgressListener progressListener = null;<NEW_LINE>ProgressRequestBody.ProgressRequestListener progressRequestListener = null;<NEW_LINE>if (callback != null) {<NEW_LINE>progressListener = new ProgressResponseBody.ProgressListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void update(long bytesRead, long contentLength, boolean done) {<NEW_LINE>callback.onDownloadProgress(bytesRead, contentLength, done);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {<NEW_LINE>callback.<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>com.squareup.okhttp.Call call = throttlingBlacklistConditionIdDeleteValidateBeforeCall(conditionId, ifMatch, ifUnmodifiedSince, progressListener, progressRequestListener);<NEW_LINE>apiClient.executeAsync(call, callback);<NEW_LINE>return call;<NEW_LINE>}
onUploadProgress(bytesWritten, contentLength, done);
1,709,754
public ResponseEntity<JsonOLCandCreateBulkResponse> createOrderLineCandidates(@RequestBody @NonNull final JsonOLCandCreateBulkRequest bulkRequest) {<NEW_LINE>try {<NEW_LINE>bulkRequest.validate();<NEW_LINE>final MasterdataProvider masterdataProvider = MasterdataProvider.builder().permissionService(permissionServiceFactory.createPermissionService()).bpartnerRestController(bpartnerRestController).externalReferenceRestControllerService(externalReferenceRestControllerService).jsonRetrieverService(jsonRetrieverService).build();<NEW_LINE>final ITrxManager trxManager = Services.get(ITrxManager.class);<NEW_LINE>final JsonOLCandCreateBulkResponse response = trxManager.callInNewTrx(() -> orderCandidateRestControllerService.creatOrderLineCandidatesBulk(bulkRequest, masterdataProvider));<NEW_LINE>return new ResponseEntity<>(response, HttpStatus.CREATED);<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>logger.<MASK><NEW_LINE>final String adLanguage = Env.getADLanguageOrBaseLanguage();<NEW_LINE>return ResponseEntity.badRequest().body(JsonOLCandCreateBulkResponse.error(JsonErrors.ofThrowable(ex, adLanguage)));<NEW_LINE>}<NEW_LINE>}
warn("Got exception while processing {}", bulkRequest, ex);
717,960
public void drawAsOneDot(String prefix, String name) {<NEW_LINE>DotGraph dot = new DotGraph(name);<NEW_LINE>dot.setGraphLabel(name);<NEW_LINE>dot.setGraphAttribute("compound", "true");<NEW_LINE>dot.setGraphAttribute("rankdir", "LR");<NEW_LINE>Map<Unit, Integer> node = new HashMap<Unit, Integer>();<NEW_LINE>int id = 0;<NEW_LINE>for (Unit stmt : graph) {<NEW_LINE>DotGraph sub = dot.createSubGraph("cluster" + id);<NEW_LINE>DotGraphNode label = sub.drawNode("head" + id);<NEW_LINE>String lbl = stmt.toString();<NEW_LINE>if (lbl.startsWith("lookupswitch")) {<NEW_LINE>lbl = "lookupswitch...";<NEW_LINE>} else if (lbl.startsWith("tableswitch")) {<NEW_LINE>lbl = "tableswitch...";<NEW_LINE>}<NEW_LINE>sub.setGraphLabel(" ");<NEW_LINE>label.setLabel(lbl);<NEW_LINE>label.setAttribute("fontsize", "18");<NEW_LINE>label.setShape("box");<NEW_LINE>getFlowAfter(stmt).g.fillDotGraph("X" + id, sub);<NEW_LINE>node.put(stmt, id);<NEW_LINE>id++;<NEW_LINE>}<NEW_LINE>for (Unit src : graph) {<NEW_LINE>for (Unit dst : graph.getSuccsOf(src)) {<NEW_LINE>DotGraphEdge edge = dot.drawEdge("head" + node.get(src), "head" + node.get(dst));<NEW_LINE>edge.setAttribute("ltail", "cluster" + node.get(src));<NEW_LINE>edge.setAttribute("lhead", "cluster" <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>File f = new File(SourceLocator.v().getOutputDir(), prefix + name + DotGraph.DOT_EXTENSION);<NEW_LINE>dot.plot(f.getPath());<NEW_LINE>}
+ node.get(dst));
330,784
public static WorkspaceEdit handleWillRenameFiles(RenameFilesParams params, IProgressMonitor monitor) {<NEW_LINE>List<FileRename> files = params.getFiles();<NEW_LINE>if (files == null || files.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FileRename[] renameFiles = new FileRename[0];<NEW_LINE>FileRename[] renameFolders = new FileRename[0];<NEW_LINE>FileRename[] moveFiles = new FileRename[0];<NEW_LINE>if (files.size() == 1) {<NEW_LINE>FileRename renameEvent = files.get(0);<NEW_LINE>if (isFileNameRenameEvent(renameEvent)) {<NEW_LINE>renameFiles = new FileRename[] { renameEvent };<NEW_LINE>} else if (isFolderRenameEvent(renameEvent)) {<NEW_LINE>renameFolders = new FileRename[] { renameEvent };<NEW_LINE>} else if (isMoveEvent(renameEvent)) {<NEW_LINE>moveFiles = new FileRename[] { renameEvent };<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>moveFiles = files.stream().filter(event -> isMoveEvent(event)).toArray(FileRename[]::new);<NEW_LINE>}<NEW_LINE>if (renameFiles.length == 0 && renameFolders.length == 0 && moveFiles.length == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SourcePath[] sourcePaths = getSourcePaths();<NEW_LINE>if (sourcePaths == null || sourcePaths.length == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>WorkspaceEdit root = null;<NEW_LINE>SubMonitor submonitor = SubMonitor.convert(monitor, "Computing rename updates...", renameFiles.length + <MASK><NEW_LINE>if (renameFiles.length > 0) {<NEW_LINE>WorkspaceEdit edit = computeFileRenameEdit(renameFiles, submonitor.split(renameFiles.length));<NEW_LINE>root = ChangeUtil.mergeChanges(root, edit, true);<NEW_LINE>}<NEW_LINE>if (renameFolders.length > 0) {<NEW_LINE>WorkspaceEdit edit = computePackageRenameEdit(renameFolders, sourcePaths, submonitor.split(renameFolders.length));<NEW_LINE>root = ChangeUtil.mergeChanges(root, edit, true);<NEW_LINE>}<NEW_LINE>if (moveFiles.length > 0) {<NEW_LINE>WorkspaceEdit edit = computeMoveEdit(moveFiles, sourcePaths, submonitor.split(moveFiles.length));<NEW_LINE>root = ChangeUtil.mergeChanges(root, edit, true);<NEW_LINE>}<NEW_LINE>submonitor.done();<NEW_LINE>return ChangeUtil.hasChanges(root) ? root : null;<NEW_LINE>}
renameFolders.length + moveFiles.length);
1,631,340
private Mono<Response<FileServiceItemsInner>> listWithResponseAsync(String resourceGroupName, String accountName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (accountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.list(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
44,698
final StartMigrationResult executeStartMigration(StartMigrationRequest startMigrationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startMigrationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartMigrationRequest> request = null;<NEW_LINE>Response<StartMigrationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartMigrationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startMigrationRequest));<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, "Lex Model Building Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartMigration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartMigrationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartMigrationResultJsonUnmarshaller());<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,325,202
final CreateMembersResult executeCreateMembers(CreateMembersRequest createMembersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createMembersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateMembersRequest> request = null;<NEW_LINE>Response<CreateMembersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createMembersRequest));<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, "Detective");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateMembersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateMembersResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateMembers");
1,504,226
private SaturnJobReturn handleException(long timeoutSeconds, Exception e) {<NEW_LINE>SaturnJobReturn saturnJobReturn;<NEW_LINE>String errMsg = e.toString();<NEW_LINE>if (watchdog.isTimeout()) {<NEW_LINE>saturnJobReturn = new SaturnJobReturn(SaturnSystemReturnCode.SYSTEM_FAIL, String.format("execute job timeout(%sms), %s", timeoutSeconds * 1000, errMsg), SaturnSystemErrorGroup.TIMEOUT);<NEW_LINE>LogUtils.error(log, jobName, "{}-{} timeout, {}", jobName, item, errMsg);<NEW_LINE>return saturnJobReturn;<NEW_LINE>}<NEW_LINE>if (watchdog.isForceStop()) {<NEW_LINE>saturnJobReturn = new SaturnJobReturn(SaturnSystemReturnCode.SYSTEM_FAIL, "the job was forced to stop, " + errMsg, SaturnSystemErrorGroup.FAIL);<NEW_LINE>LogUtils.error(log, jobName, <MASK><NEW_LINE>return saturnJobReturn;<NEW_LINE>}<NEW_LINE>saturnJobReturn = new SaturnJobReturn(SaturnSystemReturnCode.USER_FAIL, "Exception: " + errMsg, SaturnSystemErrorGroup.FAIL);<NEW_LINE>LogUtils.error(log, jobName, "{}-{} Exception: {}", jobName, item, errMsg, e);<NEW_LINE>return saturnJobReturn;<NEW_LINE>}
"{}-{} force stopped, {}", jobName, item, errMsg);
1,722,054
public void actionPerformed(ActionEvent e) {<NEW_LINE>String root = ModelSupport.getResourceRoot(testStep);<NEW_LINE>File file = UISupport.getFileDialogs().open(this, "Set properties source", "properties", "Properties Files (*.properties)", root);<NEW_LINE>if (file != null) {<NEW_LINE>updatingSource = true;<NEW_LINE>testStep.setSource(file.getAbsolutePath());<NEW_LINE>sourceField.setText(testStep.getSource());<NEW_LINE>updatingSource = false;<NEW_LINE>try {<NEW_LINE>boolean createMissing = UISupport.confirm("Create missing properties?", "Set Properties Source");<NEW_LINE>int <MASK><NEW_LINE>UISupport.showInfoMessage("Loaded " + cnt + " properties from [" + testStep.getSource() + "]");<NEW_LINE>} catch (IOException e1) {<NEW_LINE>UISupport.showErrorMessage("Failed to load properties from [" + testStep.getSource() + "]; " + e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
cnt = testStep.loadProperties(createMissing);
1,610,582
public void draw(GLAutoDrawable drawable, boolean idle, Position machineCoord, Position workCoord, Position focusMin, Position focusMax, double scaleFactor, Position mouseCoordinates, Position rotation) {<NEW_LINE>if (points.isEmpty() && startLine > 0 && endLine > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Scale was changed since last render, regenerate points<NEW_LINE>if (this.scaleFactor != scaleFactor) {<NEW_LINE>this.scaleFactor = scaleFactor;<NEW_LINE>generateBufferedLines();<NEW_LINE>}<NEW_LINE>float[] c = VisualizerOptions.colorToFloatArray(highlightColor);<NEW_LINE>GL2 gl = drawable.getGL().getGL2();<NEW_LINE>gl.glBegin(GL2ES3.GL_QUADS);<NEW_LINE>gl.glColor4fv(c, 0);<NEW_LINE>points.forEach(point -> gl.glVertex3d(point.x, point<MASK><NEW_LINE>gl.glEnd();<NEW_LINE>}
.y, point.z));
1,096,906
private void rewriteWhenBlockForExceptionCondition(WhenBlock block) {<NEW_LINE>List<Statement> tryStats = block.getAst();<NEW_LINE>List<Statement> <MASK><NEW_LINE>block.setAst(blockStats);<NEW_LINE>blockStats.add(new ExpressionStatement(setThrownException(ConstantExpression.NULL)));<NEW_LINE>// ensure variables remain in same scope<NEW_LINE>// by moving variable defs to the very beginning of the method, they don't<NEW_LINE>// need to be moved again if feature method also has a cleanup-block<NEW_LINE>moveVariableDeclarations(tryStats, method.getStatements());<NEW_LINE>TryCatchStatement tryCatchStat = new TryCatchStatement(new BlockStatement(tryStats, null), new BlockStatement());<NEW_LINE>blockStats.add(tryCatchStat);<NEW_LINE>tryCatchStat.addCatch(new CatchStatement(new Parameter(nodeCache.Throwable, SpockNames.SPOCK_EX), new BlockStatement(Collections.singletonList(new ExpressionStatement(setThrownException(new VariableExpression(SpockNames.SPOCK_EX)))), null)));<NEW_LINE>}
blockStats = new ArrayList<>();
1,381,453
public void update() {<NEW_LINE>if (externalMetricsSupplier != null) {<NEW_LINE>Set<CompactionExecutorId> seenIds = new HashSet<>();<NEW_LINE>synchronized (exCeMetricsMap) {<NEW_LINE>externalMetricsSupplier.get().forEach(ecm -> {<NEW_LINE>seenIds.add(ecm.ceid);<NEW_LINE>ExMetrics exm = exCeMetricsMap.computeIfAbsent(ecm.ceid, id -> {<NEW_LINE>ExMetrics m = new ExMetrics();<NEW_LINE>if (registry != null) {<NEW_LINE>m.queued = registry.gauge(METRICS_MAJC_QUEUED, Tags.of("id", ecm.ceid.canonical()), new AtomicInteger(0));<NEW_LINE>m.running = registry.gauge(METRICS_MAJC_RUNNING, Tags.of("id", ecm.ceid.canonical()), new AtomicInteger(0));<NEW_LINE>}<NEW_LINE>return m;<NEW_LINE>});<NEW_LINE>exm.<MASK><NEW_LINE>exm.running.set(ecm.running);<NEW_LINE>});<NEW_LINE>Sets.difference(exCeMetricsMap.keySet(), seenIds).forEach(unusedId -> {<NEW_LINE>ExMetrics exm = exCeMetricsMap.get(unusedId);<NEW_LINE>exm.queued.set(0);<NEW_LINE>exm.running.set(0);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ceMetricsList.forEach(cem -> {<NEW_LINE>cem.running.set(cem.runningSupplier.getAsInt());<NEW_LINE>cem.queued.set(cem.queuedSupplier.getAsInt());<NEW_LINE>});<NEW_LINE>}
queued.set(ecm.queued);
1,019,944
private static void readGifExtensionBlock(SequentialReader reader, Metadata metadata) throws IOException {<NEW_LINE>byte extensionLabel = reader.getInt8();<NEW_LINE>short blockSizeBytes = reader.getUInt8();<NEW_LINE>long blockStartPos = reader.getPosition();<NEW_LINE>switch(extensionLabel) {<NEW_LINE>case (byte) 0x01:<NEW_LINE>Directory <MASK><NEW_LINE>if (plainTextBlock != null)<NEW_LINE>metadata.addDirectory(plainTextBlock);<NEW_LINE>break;<NEW_LINE>case (byte) 0xf9:<NEW_LINE>metadata.addDirectory(readControlBlock(reader));<NEW_LINE>break;<NEW_LINE>case (byte) 0xfe:<NEW_LINE>metadata.addDirectory(readCommentBlock(reader, blockSizeBytes));<NEW_LINE>break;<NEW_LINE>case (byte) 0xff:<NEW_LINE>readApplicationExtensionBlock(reader, blockSizeBytes, metadata);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>metadata.addDirectory(new ErrorDirectory(String.format("Unsupported GIF extension block with type 0x%02X.", extensionLabel)));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>long skipCount = blockStartPos + blockSizeBytes - reader.getPosition();<NEW_LINE>if (skipCount > 0)<NEW_LINE>reader.skip(skipCount);<NEW_LINE>}
plainTextBlock = readPlainTextBlock(reader, blockSizeBytes);
466,946
public synchronized void delete(@NonNull Context context, @NonNull Uri uri) {<NEW_LINE>waitUntilInitialized();<NEW_LINE>if (!isAuthority(uri)) {<NEW_LINE>Log.d(TAG, "Can't delete. Not the authority for uri: " + uri);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Log.d(TAG, "Deleting " + getId(uri));<NEW_LINE>try {<NEW_LINE>StorageType storageType = StorageType.decode(uri.getPathSegments().get(STORAGE_TYPE_PATH_SEGMENT));<NEW_LINE>if (storageType.isMemory()) {<NEW_LINE>memoryBlobs.remove(uri);<NEW_LINE>} else {<NEW_LINE>String id = uri.getPathSegments().get(ID_PATH_SEGMENT);<NEW_LINE>String directory = getDirectory(storageType);<NEW_LINE>File file = new File(getOrCreateDirectory(context, directory), buildFileName(id));<NEW_LINE>if (file.delete()) {<NEW_LINE>Log.d(TAG, "Successfully deleted " + getId(uri));<NEW_LINE>} else {<NEW_LINE>throw new IOException("File wasn't deleted.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.w(TAG, "Failed to delete uri: " <MASK><NEW_LINE>}<NEW_LINE>}
+ getId(uri), e);
1,259,876
private void createDashboard(VisualisCommonResponseRef dashboardCreateResponseRef, NodeRequestRef requestRef) throws ExternalOperationFailedException {<NEW_LINE>String url = getBaseUrl() + URLUtils.dashboardPortalUrl + "/" + dashboardCreateResponseRef.getDashboardId() + "/dashboards";<NEW_LINE>VisualisPostAction visualisPostAction = new VisualisPostAction();<NEW_LINE>visualisPostAction.setUser(requestRef.getUserName());<NEW_LINE>visualisPostAction.addRequestPayload("config", "");<NEW_LINE>visualisPostAction.addRequestPayload("dashboardPortalId", Long.parseLong(dashboardCreateResponseRef.getDashboardId()));<NEW_LINE>visualisPostAction.addRequestPayload("index", 0);<NEW_LINE>visualisPostAction.addRequestPayload("name", requestRef.getName());<NEW_LINE>visualisPostAction.addRequestPayload("parentId", 0);<NEW_LINE>visualisPostAction.addRequestPayload("type", 1);<NEW_LINE>SSOUrlBuilderOperation ssoUrlBuilderOperation = requestRef.getWorkspace().getSSOUrlBuilderOperation().copy();<NEW_LINE>ssoUrlBuilderOperation.setAppName(getAppName());<NEW_LINE>ssoUrlBuilderOperation.setReqUrl(url);<NEW_LINE>ssoUrlBuilderOperation.setWorkspace(requestRef.getWorkspace().getWorkspaceName());<NEW_LINE>Map<String, Object> resMap = Maps.newHashMap();<NEW_LINE>try {<NEW_LINE>visualisPostAction.setUrl(ssoUrlBuilderOperation.getBuiltUrl());<NEW_LINE>HttpResult httpResult = (HttpResult) this.ssoRequestOperation.requestWithSSO(ssoUrlBuilderOperation, visualisPostAction);<NEW_LINE>resMap = BDPJettyServerHelper.jacksonJson().readValue(httpResult.getResponseBody(), Map.class);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExternalOperationFailedException(90177, "Create Dashboard Exception", e);<NEW_LINE>}<NEW_LINE>Map<String, Object> header = (Map<String, Object>) resMap.get("header");<NEW_LINE>int code = (<MASK><NEW_LINE>if (code != 200) {<NEW_LINE>String errorMsg = header.toString();<NEW_LINE>throw new ExternalOperationFailedException(90176, errorMsg, null);<NEW_LINE>}<NEW_LINE>}
int) header.get("code");
806,443
private void createLinks(Composite composite) {<NEW_LINE>Composite links = new Composite(composite, SWT.NONE);<NEW_LINE>GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).applyTo(links);<NEW_LINE>GridLayoutFactory.fillDefaults().margins(5, 5).applyTo(links);<NEW_LINE>addSectionLabel(links, Messages.IntroLabelActions);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addLink(links, "action:open", <MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>addLink(links, "action:new", Messages.IntroNewFile, Messages.IntroNewFileText);<NEW_LINE>addSectionLabel(links, Messages.IntroLabelSamples);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addLink(links, "action:sample", Messages.IntroOpenSample, Messages.IntroOpenSampleText);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addLink(links, "action:daxsample", Messages.IntroOpenDaxSample, Messages.IntroOpenDaxSampleText);<NEW_LINE>addSectionLabel(links, Messages.IntroLabelHelp);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addLink(// $NON-NLS-1$<NEW_LINE>links, "https://forum.portfolio-performance.info/t/sunny-neues-nennenswertes/23/last", Messages.SystemMenuNewAndNoteworthy, Messages.IntroNewAndNoteworthyText);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addLink(// $NON-NLS-1$<NEW_LINE>links, "https://forum.portfolio-performance.info", Messages.IntroOpenForum, Messages.IntroOpenForumText);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addLink(// $NON-NLS-1$<NEW_LINE>links, "https://forum.portfolio-performance.info/c/how-to", Messages.IntroOpenHowtos, Messages.IntroOpenHowtosText);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>// $NON-NLS-1$<NEW_LINE>addLink(// $NON-NLS-1$<NEW_LINE>links, "https://forum.portfolio-performance.info/c/faq", Messages.IntroOpenFAQ, Messages.IntroOpenFAQText);<NEW_LINE>}
Messages.IntroOpenFile, Messages.IntroOpenFileText);
1,076,128
public int largestSumAfterKNegations(int[] nums, int k) {<NEW_LINE>int ans = 0;<NEW_LINE>Map<Integer, Integer> <MASK><NEW_LINE>for (int num : nums) {<NEW_LINE>ans += num;<NEW_LINE>counter.put(num, counter.getOrDefault(num, 0) + 1);<NEW_LINE>}<NEW_LINE>for (int i = -100; i < 0; ++i) {<NEW_LINE>if (counter.getOrDefault(i, 0) > 0) {<NEW_LINE>int ops = Math.min(counter.get(i), k);<NEW_LINE>ans -= (i * ops * 2);<NEW_LINE>counter.put(i, counter.getOrDefault(i, 0) - ops);<NEW_LINE>counter.put(-i, counter.getOrDefault(-i, 0) + ops);<NEW_LINE>k -= ops;<NEW_LINE>if (k == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (k > 0 && (k % 2) == 1 && counter.get(0) == null) {<NEW_LINE>for (int i = 1; i < 101; ++i) {<NEW_LINE>if (counter.getOrDefault(i, 0) > 0) {<NEW_LINE>ans -= 2 * i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ans;<NEW_LINE>}
counter = new HashMap<>();
1,046,533
private void handleDictionaryBasedColumn(SegmentDirectory.Writer segmentWriter, ColumnMetadata columnMetadata, RangeIndexCreatorProvider indexCreatorProvider) throws IOException {<NEW_LINE>int numDocs = columnMetadata.getTotalDocs();<NEW_LINE>try (ForwardIndexReader forwardIndexReader = LoaderUtils.getForwardIndexReader(segmentWriter, columnMetadata);<NEW_LINE>ForwardIndexReaderContext readerContext = forwardIndexReader.createContext();<NEW_LINE>CombinedInvertedIndexCreator rangeIndexCreator = newRangeIndexCreator(columnMetadata, indexCreatorProvider)) {<NEW_LINE>if (columnMetadata.isSingleValue()) {<NEW_LINE>// Single-value column<NEW_LINE>for (int i = 0; i < numDocs; i++) {<NEW_LINE>rangeIndexCreator.add(forwardIndexReader<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Multi-value column<NEW_LINE>int[] dictIds = new int[columnMetadata.getMaxNumberOfMultiValues()];<NEW_LINE>for (int i = 0; i < numDocs; i++) {<NEW_LINE>int length = forwardIndexReader.getDictIdMV(i, dictIds, readerContext);<NEW_LINE>rangeIndexCreator.add(dictIds, length);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rangeIndexCreator.seal();<NEW_LINE>}<NEW_LINE>}
.getDictId(i, readerContext));
139,928
static void createSampleDatabase(DBPDataSourceRegistry dsRegistry) {<NEW_LINE>DataSourceDescriptor dataSource = (DataSourceDescriptor) dsRegistry.getDataSource(SAMPLE_DB1_ID);<NEW_LINE>if (dataSource != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DataSourceProviderDescriptor genericDSProvider = DataSourceProviderRegistry.getInstance().getDataSourceProvider("generic");<NEW_LINE>if (genericDSProvider == null) {<NEW_LINE>log.error("Can't find generic data source provider");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DriverDescriptor sqliteDriver = genericDSProvider.getDriver("sqlite_jdbc");<NEW_LINE>if (sqliteDriver == null) {<NEW_LINE>log.error("Can't find SQLite driver is generic provider");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Extract bundled database to workspace metadata<NEW_LINE>File dbFolder = GeneralUtils.getMetadataFolder().resolve(SAMPLE_DB1_FOLDER).toFile();<NEW_LINE>if (!dbFolder.exists()) {<NEW_LINE>if (!dbFolder.mkdirs()) {<NEW_LINE>log.error("Can't create target database folder " + dbFolder.getAbsolutePath());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>File dbFile <MASK><NEW_LINE>try (InputStream is = WorkbenchInitializerCreateSampleDatabase.class.getClassLoader().getResourceAsStream(SAMPLE_DB_SOURCE_PATH)) {<NEW_LINE>try (OutputStream os = new FileOutputStream(dbFile)) {<NEW_LINE>IOUtils.copyStream(is, os);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Error extracting sample database to workspace", e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DBPConnectionConfiguration connectionInfo = new DBPConnectionConfiguration();<NEW_LINE>connectionInfo.setDatabaseName(dbFile.getAbsolutePath());<NEW_LINE>connectionInfo.setConnectionType(DBPConnectionType.DEV);<NEW_LINE>connectionInfo.setUrl(sqliteDriver.getConnectionURL(connectionInfo));<NEW_LINE>dataSource = new DataSourceDescriptor(dsRegistry, SAMPLE_DB1_ID, sqliteDriver, connectionInfo);<NEW_LINE>dataSource.setSavePassword(true);<NEW_LINE>dataSource.getNavigatorSettings().setShowSystemObjects(true);<NEW_LINE>dataSource.setName("DBeaver Sample Database (SQLite)");<NEW_LINE>dsRegistry.addDataSource(dataSource);<NEW_LINE>}
= new File(dbFolder, SAMPLE_DB_FILE_NAME);
177,336
public List<ValidateError> validate() {<NEW_LINE>List<ValidateError> errors = new ArrayList<>();<NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.knowledgeId, convLabelName("Knowledge Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.userId, convLabelName("User Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.userId, convLabelName("User Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.insertUser, convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this<MASK><NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.deleteFlag, convLabelName("Delete Flag"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>}
.updateUser, convLabelName("Update User"));
598,072
public static void writeParticle(ByteBuf buf, ParticleBuilder particle) throws IOException {<NEW_LINE>int particleId = GlowParticle.getId(particle.particle());<NEW_LINE>Object data = particle.data();<NEW_LINE>ByteBufUtils.writeVarInt(buf, particleId);<NEW_LINE>Class<?> dataType = particle.particle().getDataType();<NEW_LINE>if (data != null && !particle.particle().getDataType().equals(Void.class) && particle.particle().getDataType().isInstance(data)) {<NEW_LINE>if (dataType.equals(Particle.DustOptions.class)) {<NEW_LINE>Particle.DustOptions options = (Particle.DustOptions) data;<NEW_LINE>buf.writeFloat(options.getColor(<MASK><NEW_LINE>buf.writeFloat(options.getColor().getGreen() / 255.0F);<NEW_LINE>buf.writeFloat(options.getColor().getBlue() / 255.0F);<NEW_LINE>buf.writeFloat(options.getSize());<NEW_LINE>} else if (dataType.equals(ItemStack.class)) {<NEW_LINE>ItemStack stack = (ItemStack) data;<NEW_LINE>writeSlot(buf, stack);<NEW_LINE>} else if (dataType.equals(BlockState.class)) {<NEW_LINE>BlockState state = (BlockState) data;<NEW_LINE>// todo: convert state to int<NEW_LINE>ByteBufUtils.writeVarInt(buf, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).getRed() / 255.0F);
1,410,275
public static <T extends ArgumentType<?>> void serialize(FriendlyByteBuf buffer, T type) {<NEW_LINE>ArgumentTypes.Entry<T> entry = (ArgumentTypes.Entry<MASK><NEW_LINE>if (entry == null) {<NEW_LINE>LOGGER.error("Could not serialize {} ({}) - will not be sent to client!", type, type.getClass());<NEW_LINE>buffer.writeResourceLocation(new ResourceLocation(""));<NEW_LINE>} else {<NEW_LINE>boolean wrap;<NEW_LINE>if (!arclight$reentrant && SpigotConfig.bungee && !INTERNAL_TYPES.contains(entry.name)) {<NEW_LINE>arclight$reentrant = wrap = true;<NEW_LINE>} else {<NEW_LINE>wrap = false;<NEW_LINE>}<NEW_LINE>if (wrap) {<NEW_LINE>buffer.writeUtf("arclight:wrapped");<NEW_LINE>}<NEW_LINE>buffer.writeResourceLocation(entry.name);<NEW_LINE>FriendlyByteBuf buf = wrap ? new FriendlyByteBuf(Unpooled.buffer()) : buffer;<NEW_LINE>entry.serializer.serializeToNetwork(type, buf);<NEW_LINE>if (wrap) {<NEW_LINE>buffer.writeVarInt(buf.writerIndex());<NEW_LINE>buffer.writeBytes(buf);<NEW_LINE>arclight$reentrant = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
<T>) get(type);
1,218,011
public NodeValue exec(NodeValue v1, NodeValue v2, NodeValue v3, NodeValue v4) {<NEW_LINE>try {<NEW_LINE>if (!v1.isNumber()) {<NEW_LINE>throw new ExprEvalException("Not a Number: " + FmtUtils.stringForNode(v1.asNode()));<NEW_LINE>}<NEW_LINE>if (!v2.isNumber()) {<NEW_LINE>throw new ExprEvalException("Not a Number: " + FmtUtils.stringForNode<MASK><NEW_LINE>}<NEW_LINE>if (!v3.isNumber()) {<NEW_LINE>throw new ExprEvalException("Not a Number: " + FmtUtils.stringForNode(v3.asNode()));<NEW_LINE>}<NEW_LINE>if (!v4.isNumber()) {<NEW_LINE>throw new ExprEvalException("Not a Number: " + FmtUtils.stringForNode(v4.asNode()));<NEW_LINE>}<NEW_LINE>double x1 = v1.getDouble();<NEW_LINE>double y1 = v2.getDouble();<NEW_LINE>double x2 = v3.getDouble();<NEW_LINE>double y2 = v4.getDouble();<NEW_LINE>double radians = Angle.find(x1, y1, x2, y2);<NEW_LINE>double degrees = cleanUpPrecision(Math.toDegrees(radians));<NEW_LINE>return NodeValue.makeDouble(degrees);<NEW_LINE>} catch (DatatypeFormatException ex) {<NEW_LINE>throw new ExprEvalException(ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>}
(v2.asNode()));
1,640,668
final RestoreDomainAccessResult executeRestoreDomainAccess(RestoreDomainAccessRequest restoreDomainAccessRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(restoreDomainAccessRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RestoreDomainAccessRequest> request = null;<NEW_LINE>Response<RestoreDomainAccessResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RestoreDomainAccessRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(restoreDomainAccessRequest));<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, "WorkLink");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RestoreDomainAccess");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RestoreDomainAccessResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new RestoreDomainAccessResultJsonUnmarshaller());
1,584,683
// FIXME This type-by-string has to go, in favor of passing a class parameter.<NEW_LINE>public DvObject findByGlobalId(String globalIdString, String typeString, Boolean altId) {<NEW_LINE>try {<NEW_LINE>GlobalId gid = new GlobalId(globalIdString);<NEW_LINE>DvObject foundDvObject = null;<NEW_LINE>try {<NEW_LINE>Query query;<NEW_LINE>if (altId) {<NEW_LINE>query = em.createNamedQuery("DvObject.findByAlternativeGlobalId");<NEW_LINE>} else {<NEW_LINE>query = em.createNamedQuery("DvObject.findByGlobalId");<NEW_LINE>}<NEW_LINE>query.setParameter("identifier", gid.getIdentifier());<NEW_LINE>query.setParameter("protocol", gid.getProtocol());<NEW_LINE>query.setParameter("authority", gid.getAuthority());<NEW_LINE>query.setParameter("dtype", typeString);<NEW_LINE>foundDvObject = (DvObject) query.getSingleResult();<NEW_LINE>} catch (javax.persistence.NoResultException e) {<NEW_LINE>// (set to .info, this can fill the log file with thousands of<NEW_LINE>// these messages during a large harvest run)<NEW_LINE>logger.fine("no dvObject found: " + globalIdString);<NEW_LINE>// DO nothing, just return null.<NEW_LINE>return null;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.info("Exception caught in findByGlobalId: " + ex.getLocalizedMessage());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return foundDvObject;<NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
logger.info("Invalid identifier: " + globalIdString);
168,198
public Map<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> superobjs) {<NEW_LINE>List<String> toRemove = new ArrayList<>();<NEW_LINE>for (Map.Entry<String, ModelsMap> modelEntry : superobjs.entrySet()) {<NEW_LINE>// process enum in models<NEW_LINE>List<ModelMap> models = modelEntry.getValue().getModels();<NEW_LINE>for (ModelMap mo : models) {<NEW_LINE><MASK><NEW_LINE>// for enum model<NEW_LINE>if (Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) {<NEW_LINE>toRemove.add(modelEntry.getKey());<NEW_LINE>} else {<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getAllVars());<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getReadOnlyVars());<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getReadWriteVars());<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getRequiredVars());<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getOptionalVars());<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getVars());<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getParentVars());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String keyToRemove : toRemove) {<NEW_LINE>superobjs.remove(keyToRemove);<NEW_LINE>}<NEW_LINE>return superobjs;<NEW_LINE>}
CodegenModel cm = mo.getModel();
1,505,966
public static void process(GrayU8 src, final int kerA, final int kerB, GrayS16 derivX, GrayS16 derivY) {<NEW_LINE>final byte[] data = src.data;<NEW_LINE>final short[] imgX = derivX.data;<NEW_LINE>final short[] imgY = derivY.data;<NEW_LINE>final int width = src.getWidth();<NEW_LINE>final int height = src.getHeight() - 1;<NEW_LINE>final int strideSrc = src.getStride();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(1,height,y->{<NEW_LINE>for (int y = 1; y < height; y++) {<NEW_LINE>int indexSrc = src.startIndex + src.stride * y + 1;<NEW_LINE>final int endX = indexSrc + width - 2;<NEW_LINE>int indexX = derivX.startIndex + derivX.stride * y + 1;<NEW_LINE>int indexY = derivY.startIndex + derivY.stride * y + 1;<NEW_LINE>int a11, a12, a21, a22, a31, a32;<NEW_LINE>a11 = data[indexSrc - strideSrc - 1] & 0xFF;<NEW_LINE>a12 = data[indexSrc - strideSrc] & 0xFF;<NEW_LINE>a21 = data[indexSrc - 1] & 0xFF;<NEW_LINE>a22 = data[indexSrc] & 0xFF;<NEW_LINE>a31 = data[<MASK><NEW_LINE>a32 = data[indexSrc + strideSrc] & 0xFF;<NEW_LINE>for (; indexSrc < endX; indexSrc++) {<NEW_LINE>int a13 = data[indexSrc - strideSrc + 1] & 0xFF;<NEW_LINE>int a23 = data[indexSrc + 1] & 0xFF;<NEW_LINE>int a33 = data[indexSrc + strideSrc + 1] & 0xFF;<NEW_LINE>int v = (a33 - a11) * kerA;<NEW_LINE>int w = (a31 - a13) * kerA;<NEW_LINE>imgY[indexY++] = (short) ((a32 - a12) * kerB + v + w);<NEW_LINE>imgX[indexX++] = (short) ((a23 - a21) * kerB + v - w);<NEW_LINE>a11 = a12;<NEW_LINE>a12 = a13;<NEW_LINE>a21 = a22;<NEW_LINE>a22 = a23;<NEW_LINE>a31 = a32;<NEW_LINE>a32 = a33;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
indexSrc + strideSrc - 1] & 0xFF;
196,218
@ApiOperation(value = "Get all alert conditions of this stream")<NEW_LINE>@ApiResponses(value = { @ApiResponse(code = 404, message = "Stream not found."), @ApiResponse(code = 400, message = "Invalid ObjectId.") })<NEW_LINE>public AlertConditionListSummary list(@ApiParam(name = "streamId", value = "The id of the stream whose alert conditions we want.", required = true) @PathParam("streamId") String streamid) throws NotFoundException {<NEW_LINE>checkPermission(RestPermissions.STREAMS_READ, streamid);<NEW_LINE>final Stream stream = streamService.load(streamid);<NEW_LINE>final List<AlertCondition> alertConditions = streamService.getAlertConditions(stream);<NEW_LINE>final List<AlertConditionSummary> conditionSummaries = alertConditions.stream().map((condition) -> AlertConditionSummary.create(condition.getId(), condition.getType(), condition.getCreatorUserId(), condition.getCreatedAt().toDate(), condition.getParameters(), alertService.inGracePeriod(condition), condition.getTitle())).<MASK><NEW_LINE>return AlertConditionListSummary.create(conditionSummaries);<NEW_LINE>}
collect(Collectors.toList());
359,052
public void handle(OnlineUser user, JSONObject message) throws IOException {<NEW_LINE>if (message.get("t").equals("userInfo")) {<NEW_LINE>LogManager.LOGGER.fine("(WS) User info request from " + user.getUser().getUsername());<NEW_LINE>JSONObject json = new JSONObject();<NEW_LINE>if (user.getUser().isGuest()) {<NEW_LINE>json.put("worldX", GameServer.INSTANCE.getConfig().getInt("new_user_worldX"));<NEW_LINE>json.put("worldY", GameServer.INSTANCE.getConfig().getInt("new_user_worldY"));<NEW_LINE>json.put("dimension", GameServer.INSTANCE.getConfig().getString("new_user_dimension"));<NEW_LINE>} else {<NEW_LINE>GameObject object = (GameObject) user.getUser().getControlledUnit();<NEW_LINE>json.put("worldX", object.getWorld().getX());<NEW_LINE>json.put("worldY", object.getWorld().getY());<NEW_LINE>json.put("dimension", object.getWorld().getDimension());<NEW_LINE>json.put("id", object.<MASK><NEW_LINE>}<NEW_LINE>json.put("t", "userInfo");<NEW_LINE>json.put("maxWidth", GameServer.INSTANCE.getGameUniverse().getMaxWidth());<NEW_LINE>user.getWebSocket().getRemote().sendString(json.toJSONString());<NEW_LINE>}<NEW_LINE>}
getObjectId().toString());
437,657
public Optional<ProjectIssueIdentifier> parseIssueIdFromUrl(String issueUrl) {<NEW_LINE>URI <MASK><NEW_LINE>List<NameValuePair> parameters = URLEncodedUtils.parse(url, StandardCharsets.UTF_8);<NEW_LINE>Optional<String> optionalProjectId = parameters.stream().filter(parameter -> "id".equals(parameter.getName())).map(NameValuePair::getValue).findFirst();<NEW_LINE>if (optionalProjectId.isEmpty()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>String projectId = optionalProjectId.get();<NEW_LINE>if (url.getPath().endsWith("/dashboard")) {<NEW_LINE>return Optional.of(new ProjectIssueIdentifier(projectId, "decorator-summary-comment"));<NEW_LINE>} else if (url.getPath().endsWith("security_hotspots")) {<NEW_LINE>return parameters.stream().filter(parameter -> "hotspots".equals(parameter.getName())).map(NameValuePair::getValue).findFirst().map(issueId -> new ProjectIssueIdentifier(projectId, issueId));<NEW_LINE>} else {<NEW_LINE>return parameters.stream().filter(parameter -> "issues".equals(parameter.getName())).map(NameValuePair::getValue).findFirst().map(issueId -> new ProjectIssueIdentifier(projectId, issueId));<NEW_LINE>}<NEW_LINE>}
url = URI.create(issueUrl);
523,164
public static void moveUpgradedFiles(TsFileResource resource) throws IOException {<NEW_LINE>List<TsFileResource> upgradedResources = resource.getUpgradedResources();<NEW_LINE>for (TsFileResource upgradedResource : upgradedResources) {<NEW_LINE>File upgradedFile = upgradedResource.getTsFile();<NEW_LINE>long partition = upgradedResource.getTimePartition();<NEW_LINE>String virtualStorageGroupDir = upgradedFile.getParentFile()<MASK><NEW_LINE>File partitionDir = fsFactory.getFile(virtualStorageGroupDir, String.valueOf(partition));<NEW_LINE>if (!partitionDir.exists()) {<NEW_LINE>partitionDir.mkdir();<NEW_LINE>}<NEW_LINE>// move upgraded TsFile<NEW_LINE>if (upgradedFile.exists()) {<NEW_LINE>fsFactory.moveFile(upgradedFile, fsFactory.getFile(partitionDir, upgradedFile.getName()));<NEW_LINE>}<NEW_LINE>// get temp resource<NEW_LINE>File tempResourceFile = fsFactory.getFile(upgradedResource.getTsFile().toPath() + TsFileResource.RESOURCE_SUFFIX);<NEW_LINE>// move upgraded mods file<NEW_LINE>File newModsFile = fsFactory.getFile(upgradedResource.getTsFile().toPath() + ModificationFile.FILE_SUFFIX);<NEW_LINE>if (newModsFile.exists()) {<NEW_LINE>fsFactory.moveFile(newModsFile, fsFactory.getFile(partitionDir, newModsFile.getName()));<NEW_LINE>}<NEW_LINE>// re-serialize upgraded resource to correct place<NEW_LINE>upgradedResource.setFile(fsFactory.getFile(partitionDir, upgradedFile.getName()));<NEW_LINE>if (fsFactory.getFile(partitionDir, newModsFile.getName()).exists()) {<NEW_LINE>upgradedResource.getModFile();<NEW_LINE>}<NEW_LINE>upgradedResource.setStatus(TsFileResourceStatus.CLOSED);<NEW_LINE>upgradedResource.serialize();<NEW_LINE>// delete generated temp resource file<NEW_LINE>Files.delete(tempResourceFile.toPath());<NEW_LINE>}<NEW_LINE>}
.getParentFile().getParent();
1,583,765
public String initLoader(String className) throws Exception {<NEW_LINE>File modeDirectory = new File(folder, getTypeName());<NEW_LINE>if (modeDirectory.exists()) {<NEW_LINE>Messages.log("checking mode folder regarding " + className);<NEW_LINE>// If no class name specified, search the main <modename>.jar for the<NEW_LINE>// full name package and mode name.<NEW_LINE>if (className == null) {<NEW_LINE>String shortName = folder.getName();<NEW_LINE>File mainJar = new File(modeDirectory, shortName + ".jar");<NEW_LINE>if (mainJar.exists()) {<NEW_LINE>className = findClassInZipFile(shortName, mainJar);<NEW_LINE>} else {<NEW_LINE>throw new IgnorableException(mainJar.getAbsolutePath() + " does not exist.");<NEW_LINE>}<NEW_LINE>if (className == null) {<NEW_LINE>throw new IgnorableException("Could not find " + shortName + " class inside " + mainJar.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add .jar and .zip files from the "mode" folder into the classpath<NEW_LINE>File[] <MASK><NEW_LINE>if (archives != null && archives.length > 0) {<NEW_LINE>URL[] urlList = new URL[archives.length];<NEW_LINE>for (int j = 0; j < urlList.length; j++) {<NEW_LINE>Messages.log("Found archive " + archives[j] + " for " + getName());<NEW_LINE>urlList[j] = archives[j].toURI().toURL();<NEW_LINE>}<NEW_LINE>// loader = new URLClassLoader(urlList, Thread.currentThread().getContextClassLoader());<NEW_LINE>loader = new URLClassLoader(urlList);<NEW_LINE>Messages.log("loading above JARs with loader " + loader);<NEW_LINE>// System.out.println("listing classes for loader " + loader);<NEW_LINE>// listClasses(loader);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If no archives were found, just use the regular ClassLoader<NEW_LINE>if (loader == null) {<NEW_LINE>loader = Thread.currentThread().getContextClassLoader();<NEW_LINE>}<NEW_LINE>return className;<NEW_LINE>}
archives = Util.listJarFiles(modeDirectory);
1,686,077
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {<NEW_LINE>ServletContext context = this.getServletConfig().getServletContext();<NEW_LINE>response.setContentType("text/html");<NEW_LINE>PrintWriter out = response.getWriter();<NEW_LINE>try {<NEW_LINE>File reportFile = new File(context.getRealPath("/reports/WebappReport.jasper"));<NEW_LINE>if (!reportFile.exists())<NEW_LINE>throw new JRRuntimeException("File WebappReport.jasper not found. The report design must be compiled first.");<NEW_LINE>JasperReport jasperReport = (JasperReport) JRLoader.loadObjectFromFile(reportFile.getPath());<NEW_LINE>Map<String, Object> parameters = new HashMap<String, Object>();<NEW_LINE>parameters.put("ReportTitle", "Address Report");<NEW_LINE>parameters.put("BaseDir", reportFile.getParentFile());<NEW_LINE>JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new WebappDataSource());<NEW_LINE>HtmlExporter exporter = new HtmlExporter();<NEW_LINE>request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint);<NEW_LINE>exporter.setExporterInput(new SimpleExporterInput(jasperPrint));<NEW_LINE>SimpleHtmlExporterOutput output = new SimpleHtmlExporterOutput(out);<NEW_LINE>output.<MASK><NEW_LINE>exporter.setExporterOutput(output);<NEW_LINE>exporter.exportReport();<NEW_LINE>} catch (JRException e) {<NEW_LINE>out.println("<html>");<NEW_LINE>out.println("<head>");<NEW_LINE>out.println("<title>JasperReports - Web Application Sample</title>");<NEW_LINE>out.println("<link rel=\"stylesheet\" type=\"text/css\" href=\"../stylesheet.css\" title=\"Style\">");<NEW_LINE>out.println("</head>");<NEW_LINE>out.println("<body bgcolor=\"white\">");<NEW_LINE>out.println("<span class=\"bnew\">JasperReports encountered this error :</span>");<NEW_LINE>out.println("<pre>");<NEW_LINE>e.printStackTrace(out);<NEW_LINE>out.println("</pre>");<NEW_LINE>out.println("</body>");<NEW_LINE>out.println("</html>");<NEW_LINE>}<NEW_LINE>}
setImageHandler(new WebHtmlResourceHandler("image?image={0}"));
1,714,103
protected static void death(Person person, long time) {<NEW_LINE>if (ENABLE_DEATH_BY_NATURAL_CAUSES) {<NEW_LINE>double roll = person.rand();<NEW_LINE>double likelihoodOfDeath = likelihoodOfDeath(person.ageInYears(time));<NEW_LINE>if (roll < likelihoodOfDeath) {<NEW_LINE>person.recordDeath(time, NATURAL_CAUSES);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ENABLE_DEATH_BY_LOSS_OF_CARE && deathFromLossOfCare(person)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (person.attributes.containsKey(Person.DEATHDATE)) {<NEW_LINE>Long deathDate = (Long) person.attributes.get(Person.DEATHDATE);<NEW_LINE>long diff = deathDate - time;<NEW_LINE>long days = TimeUnit.MILLISECONDS.toDays(diff);<NEW_LINE>person.attributes.put(DAYS_UNTIL_DEATH, Long.valueOf(days));<NEW_LINE>}<NEW_LINE>}
person.recordDeath(time, LOSS_OF_CARE);
1,252,534
// ================================================================//<NEW_LINE>// MotionEvent methods<NEW_LINE>// ================================================================//<NEW_LINE>// ----------------------------------------------------------------//<NEW_LINE>@Override<NEW_LINE>public boolean onTouchEvent(MotionEvent event) {<NEW_LINE>boolean isDown = true;<NEW_LINE>switch(event.getActionMasked()) {<NEW_LINE>case MotionEvent.ACTION_CANCEL:<NEW_LINE>break;<NEW_LINE>case MotionEvent.ACTION_UP:<NEW_LINE>case MotionEvent.ACTION_POINTER_UP:<NEW_LINE>isDown = false;<NEW_LINE>case MotionEvent.ACTION_DOWN:<NEW_LINE>case MotionEvent.ACTION_POINTER_DOWN:<NEW_LINE>{<NEW_LINE>final <MASK><NEW_LINE>int pointerId = event.getPointerId(pointerIndex);<NEW_LINE>Moai.enqueueTouchEvent(Moai.InputDevice.INPUT_DEVICE.ordinal(), Moai.InputSensor.SENSOR_TOUCH.ordinal(), pointerId, isDown, Math.round(event.getX(pointerIndex)), Math.round(event.getY(pointerIndex)), 1);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case MotionEvent.ACTION_MOVE:<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>final int pointerCount = event.getPointerCount();<NEW_LINE>for (int pointerIndex = 0; pointerIndex < pointerCount; ++pointerIndex) {<NEW_LINE>int pointerId = event.getPointerId(pointerIndex);<NEW_LINE>Moai.enqueueTouchEvent(Moai.InputDevice.INPUT_DEVICE.ordinal(), Moai.InputSensor.SENSOR_TOUCH.ordinal(), pointerId, isDown, Math.round(event.getX(pointerIndex)), Math.round(event.getY(pointerIndex)), 1);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
int pointerIndex = event.getActionIndex();
1,770,909
public void computeStockMoveInvoicingStatus(StockMove stockMove) {<NEW_LINE>int invoicingStatus = StockMoveRepository.STATUS_NOT_INVOICED;<NEW_LINE>if (stockMove.getStockMoveLineList() != null && stockMove.getInvoiceSet() != null && !stockMove.getInvoiceSet().isEmpty()) {<NEW_LINE>BigDecimal totalInvoicedQty = stockMove.getStockMoveLineList().stream().map(StockMoveLine::getQtyInvoiced).reduce(BigDecimal::add<MASK><NEW_LINE>BigDecimal totalRealQty = stockMove.getStockMoveLineList().stream().map(StockMoveLine::getRealQty).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);<NEW_LINE>// the status will stay at not invoiced if totalInvoicedQty is at 0 (or negative) while<NEW_LINE>// realQty is > 0.<NEW_LINE>if (totalInvoicedQty.signum() == 0 && totalRealQty.signum() == 0) {<NEW_LINE>// special case where we invoice a stock move line with no quantities.<NEW_LINE>invoicingStatus = StockMoveRepository.STATUS_INVOICED;<NEW_LINE>} else if (totalInvoicedQty.signum() > 0 && totalRealQty.compareTo(totalInvoicedQty) > 0) {<NEW_LINE>invoicingStatus = StockMoveRepository.STATUS_PARTIALLY_INVOICED;<NEW_LINE>} else if (totalRealQty.compareTo(totalInvoicedQty) == 0) {<NEW_LINE>invoicingStatus = StockMoveRepository.STATUS_INVOICED;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stockMove.setInvoicingStatusSelect(invoicingStatus);<NEW_LINE>}
).orElse(BigDecimal.ZERO);
955,064
public static void mergeDependencies(final Dependency dependency, final Dependency relatedDependency, final Set<Dependency> dependenciesToRemove, final boolean copyVulnsAndIds) {<NEW_LINE>dependency.addRelatedDependency(relatedDependency);<NEW_LINE>relatedDependency.getRelatedDependencies().stream().forEach(dependency::addRelatedDependency);<NEW_LINE>relatedDependency.clearRelatedDependencies();<NEW_LINE>if (copyVulnsAndIds) {<NEW_LINE>relatedDependency.getSoftwareIdentifiers(<MASK><NEW_LINE>relatedDependency.getVulnerableSoftwareIdentifiers().forEach(dependency::addVulnerableSoftwareIdentifier);<NEW_LINE>relatedDependency.getVulnerabilities().forEach(dependency::addVulnerability);<NEW_LINE>}<NEW_LINE>// TODO this null check was added for #1296 - but I believe this to be related to virtual dependencies<NEW_LINE>// we may want to merge project references on virtual dependencies...<NEW_LINE>if (dependency.getSha1sum() != null && dependency.getSha1sum().equals(relatedDependency.getSha1sum())) {<NEW_LINE>dependency.addAllProjectReferences(relatedDependency.getProjectReferences());<NEW_LINE>}<NEW_LINE>if (dependenciesToRemove != null) {<NEW_LINE>dependenciesToRemove.add(relatedDependency);<NEW_LINE>}<NEW_LINE>}
).forEach(dependency::addSoftwareIdentifier);
1,002,955
private LookupsState<LookupExtractorFactoryMapContainer> doLookupManagementOnNode(HostAndPortWithScheme node, Map<String, LookupExtractorFactoryMapContainer> nodeTierLookupsToBe) throws IOException, InterruptedException, ExecutionException {<NEW_LINE><MASK><NEW_LINE>LookupsState<LookupExtractorFactoryMapContainer> currLookupsStateOnNode = lookupsCommunicator.getLookupStateForNode(node);<NEW_LINE>LOG.debug("Received lookups state from node [%s].", node);<NEW_LINE>// Compare currLookupsStateOnNode with nodeTierLookupsToBe to find what are the lookups<NEW_LINE>// we need to further ask node to load/drop<NEW_LINE>Map<String, LookupExtractorFactoryMapContainer> toLoad = getToBeLoadedOnNode(currLookupsStateOnNode, nodeTierLookupsToBe);<NEW_LINE>Set<String> toDrop = getToBeDroppedFromNode(currLookupsStateOnNode, nodeTierLookupsToBe);<NEW_LINE>if (!toLoad.isEmpty() || !toDrop.isEmpty()) {<NEW_LINE>// Send POST request to the node asking to load and drop the lookups necessary.<NEW_LINE>// no need to send "current" in the LookupsStateWithMap , that is not required<NEW_LINE>currLookupsStateOnNode = lookupsCommunicator.updateNode(node, new LookupsState<>(null, toLoad, toDrop));<NEW_LINE>LOG.debug("Sent lookup toAdd[%s] and toDrop[%s] updates to node [%s].", toLoad.keySet(), toDrop, node);<NEW_LINE>}<NEW_LINE>LOG.debug("Finished lookup sync for node [%s].", node);<NEW_LINE>return currLookupsStateOnNode;<NEW_LINE>}
LOG.debug("Starting lookup sync for node [%s].", node);
1,053,406
public static void copyDirectory(final File sourceDir, final File newDir) throws IOException {<NEW_LINE>final File[] srcFiles = sourceDir.listFiles();<NEW_LINE>if (srcFiles == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (newDir.exists() && !newDir.isDirectory()) {<NEW_LINE>throw new IOException("Destination '" + newDir + "' exists but is not a directory");<NEW_LINE>} else if (!newDir.mkdirs() && !newDir.isDirectory()) {<NEW_LINE>throw new IOException("Destination '" + newDir + "' directory cannot be created");<NEW_LINE>}<NEW_LINE>if (!newDir.canWrite()) {<NEW_LINE>throw new IOException("Destination '" + newDir + "' cannot be written to");<NEW_LINE>}<NEW_LINE>for (final File srcFile : srcFiles) {<NEW_LINE>final File dstFile = new File(newDir, srcFile.getName());<NEW_LINE>if (srcFile.isDirectory()) {<NEW_LINE>copyDirectory(srcFile, dstFile);<NEW_LINE>} else {<NEW_LINE>copyFileStreams(srcFile, dstFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
throw new IOException("Failed to list contents of " + sourceDir);
1,247,850
private void resetSelected() {<NEW_LINE>final List<Integer> <MASK><NEW_LINE>if (preferences.isChecked()) {<NEW_LINE>resetActions.add(RESET_PREFERENCES);<NEW_LINE>}<NEW_LINE>if (instances.isChecked()) {<NEW_LINE>resetActions.add(ProjectResetter.ResetAction.RESET_INSTANCES);<NEW_LINE>}<NEW_LINE>if (forms.isChecked()) {<NEW_LINE>resetActions.add(ProjectResetter.ResetAction.RESET_FORMS);<NEW_LINE>}<NEW_LINE>if (layers.isChecked()) {<NEW_LINE>resetActions.add(ProjectResetter.ResetAction.RESET_LAYERS);<NEW_LINE>}<NEW_LINE>if (cache.isChecked()) {<NEW_LINE>resetActions.add(ProjectResetter.ResetAction.RESET_CACHE);<NEW_LINE>}<NEW_LINE>if (!resetActions.isEmpty()) {<NEW_LINE>new AsyncTask<Void, Void, List<Integer>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onPreExecute() {<NEW_LINE>DialogFragmentUtils.showIfNotShowing(ResetProgressDialog.class, ((CollectAbstractActivity) context).getSupportFragmentManager());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected List<Integer> doInBackground(Void... voids) {<NEW_LINE>return projectResetter.reset(resetActions);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onPostExecute(List<Integer> failedResetActions) {<NEW_LINE>DialogFragmentUtils.dismissDialog(ResetProgressDialog.class, ((CollectAbstractActivity) context).getSupportFragmentManager());<NEW_LINE>handleResult(resetActions, failedResetActions);<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>}<NEW_LINE>}
resetActions = new ArrayList<>();
954,177
private Optional<Long> doStep(Supplier<Long> step) {<NEW_LINE>if (closed)<NEW_LINE>throw new IllegalStateException(this + "' is closed");<NEW_LINE>if (!isValid())<NEW_LINE>return Optional.empty();<NEW_LINE>try {<NEW_LINE>return Optional.of(step.get());<NEW_LINE>} catch (TransientException | ActivationConflictException e) {<NEW_LINE>metric.add("maintenanceDeployment.transientFailure", 1, metric.createContext(Map.of()));<NEW_LINE>log.log(Level.INFO, "Failed to maintenance deploy " + application + " with a transient error: " <MASK><NEW_LINE>return Optional.empty();<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>metric.add("maintenanceDeployment.failure", 1, metric.createContext(Map.of()));<NEW_LINE>log.log(Level.WARNING, "Exception on maintenance deploy of " + application, e);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}
+ Exceptions.toMessageString(e));
1,663,008
private springfox.documentation.schema.ModelProperty modelProperty(BeanPropertyDefinition jacksonProperty, ModelContext modelContext, String propertyName, BaseModelProperty beanModelProperty) {<NEW_LINE>LOG.debug("Adding property {} to model", propertyName);<NEW_LINE>ModelPropertyBuilder propertyBuilder = new ModelPropertyBuilder().name(beanModelProperty.getName()).type(beanModelProperty.getType()).qualifiedType(beanModelProperty.qualifiedTypeName()).position(beanModelProperty.position()).required(beanModelProperty.isRequired()).isHidden(false).description(beanModelProperty.propertyDescription()).allowableValues(beanModelProperty.allowableValues()).<MASK><NEW_LINE>return schemaPluginsManager.property(new ModelPropertyContext(propertyBuilder, jacksonProperty, typeResolver, modelContext, new PropertySpecificationBuilder(beanModelProperty.getName()))).updateModelRef(modelRefFactory(modelContext, enumTypeDeterminer, typeNameExtractor));<NEW_LINE>}
example(beanModelProperty.example());
737,650
private <T extends MessageWithID> ImmutableList<T> checkPayloadReference(@NotNull final ImmutableList<T> publishes, @NotNull final String queueId, final boolean shared) {<NEW_LINE>List<T> reducedList = null;<NEW_LINE>for (final T message : publishes) {<NEW_LINE>if (message instanceof PUBLISH) {<NEW_LINE>final PUBLISH publish = (PUBLISH) message;<NEW_LINE>try {<NEW_LINE>publish.dereferencePayload();<NEW_LINE>} catch (final PayloadPersistenceException e) {<NEW_LINE>messageDroppedService.failed(queueId, publish.getTopic(), publish.<MASK><NEW_LINE>if (shared) {<NEW_LINE>removeShared(queueId, publish.getUniqueId());<NEW_LINE>} else {<NEW_LINE>remove(queueId, publish.getPacketIdentifier());<NEW_LINE>}<NEW_LINE>if (reducedList == null) {<NEW_LINE>reducedList = new ArrayList<>(publishes);<NEW_LINE>}<NEW_LINE>reducedList.remove(message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (reducedList == null) {<NEW_LINE>return publishes;<NEW_LINE>}<NEW_LINE>return ImmutableList.copyOf(reducedList);<NEW_LINE>}
getQoS().getQosNumber());
1,364,793
public boolean finish(ManufOrder manufOrder) throws AxelorException {<NEW_LINE>if (manufOrder.getTypeSelect() != ManufOrderRepository.TYPE_MAINTENANCE) {<NEW_LINE>return super.finish(manufOrder);<NEW_LINE>} else {<NEW_LINE>if (manufOrder.getOperationOrderList() != null) {<NEW_LINE>for (OperationOrder operationOrder : manufOrder.getOperationOrderList()) {<NEW_LINE>if (operationOrder.getStatusSelect() != OperationOrderRepository.STATUS_FINISHED) {<NEW_LINE>if (operationOrder.getStatusSelect() != OperationOrderRepository.STATUS_IN_PROGRESS && operationOrder.getStatusSelect() != OperationOrderRepository.STATUS_STANDBY) {<NEW_LINE>operationOrderWorkflowService.start(operationOrder);<NEW_LINE>}<NEW_LINE>operationOrderWorkflowService.finish(operationOrder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>manufOrder.setRealEndDateT(Beans.get(AppProductionService.class).getTodayDateTime().toLocalDateTime());<NEW_LINE><MASK><NEW_LINE>manufOrder.setEndTimeDifference(new BigDecimal(ChronoUnit.MINUTES.between(manufOrder.getPlannedEndDateT(), manufOrder.getRealEndDateT())));<NEW_LINE>manufOrderRepo.save(manufOrder);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}
manufOrder.setStatusSelect(ManufOrderRepository.STATUS_FINISHED);
647,371
protected void populateBindings(Bindings bindings) {<NEW_LINE>final String label = getName();<NEW_LINE>final String fileName = getFilename();<NEW_LINE>final String scriptParameters = getParameters();<NEW_LINE>// Use actual class name for log<NEW_LINE>final Logger elementLogger = LoggerFactory.getLogger(getClass().getName() + "." + getName());<NEW_LINE>// $NON-NLS-1$ (this name is fixed)<NEW_LINE>bindings.put("log", elementLogger);<NEW_LINE>// $NON-NLS-1$ (this name is fixed)<NEW_LINE>bindings.put("Label", label);<NEW_LINE>// $NON-NLS-1$ (this name is fixed)<NEW_LINE>bindings.put("FileName", fileName);<NEW_LINE>// $NON-NLS-1$ (this name is fixed)<NEW_LINE>bindings.put("Parameters", scriptParameters);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String[] args = JOrphanUtils.split(scriptParameters, " ");<NEW_LINE>// $NON-NLS-1$ (this name is fixed)<NEW_LINE>bindings.put("args", args);<NEW_LINE>// Add variables for access to context and variables<NEW_LINE><MASK><NEW_LINE>// $NON-NLS-1$ (this name is fixed)<NEW_LINE>bindings.put("ctx", jmctx);<NEW_LINE>JMeterVariables vars = jmctx.getVariables();<NEW_LINE>// $NON-NLS-1$ (this name is fixed)<NEW_LINE>bindings.put("vars", vars);<NEW_LINE>Properties props = JMeterUtils.getJMeterProperties();<NEW_LINE>// $NON-NLS-1$ (this name is fixed)<NEW_LINE>bindings.put("props", props);<NEW_LINE>// For use in debugging:<NEW_LINE>// NOSONAR $NON-NLS-1$ (this name is fixed)<NEW_LINE>bindings.put("OUT", System.out);<NEW_LINE>// Most subclasses will need these:<NEW_LINE>Sampler sampler = jmctx.getCurrentSampler();<NEW_LINE>// $NON-NLS-1$ (this name is fixed)<NEW_LINE>bindings.put("sampler", sampler);<NEW_LINE>SampleResult prev = jmctx.getPreviousResult();<NEW_LINE>// $NON-NLS-1$ (this name is fixed)<NEW_LINE>bindings.put("prev", prev);<NEW_LINE>}
JMeterContext jmctx = JMeterContextService.getContext();
261,276
public void received(final Stack vmStack) {<NEW_LINE>ApplicationManager.getApplication().executeOnPooledThread(() -> {<NEW_LINE>InstanceRef exceptionToAddToFrame = exception;<NEW_LINE>// Check for async causal frames; fall back to using regular sync frames.<NEW_LINE>ElementList<Frame> elementList = vmStack.getAsyncCausalFrames();<NEW_LINE>if (elementList == null) {<NEW_LINE>elementList = vmStack.getFrames();<NEW_LINE>}<NEW_LINE>final List<Frame> vmFrames = Lists.newArrayList(elementList);<NEW_LINE>final List<XStackFrame> xStackFrames = new ArrayList<>(vmFrames.size());<NEW_LINE>for (final Frame vmFrame : vmFrames) {<NEW_LINE>if (vmFrame.getKind() == FrameKind.AsyncSuspensionMarker) {<NEW_LINE>// Render an asynchronous gap.<NEW_LINE>final XStackFrame markerFrame = new DartAsyncMarkerFrame();<NEW_LINE>xStackFrames.add(markerFrame);<NEW_LINE>} else {<NEW_LINE>final DartVmServiceStackFrame stackFrame = new DartVmServiceStackFrame(myDebugProcess, isolateId, vmFrame, vmFrames, exceptionToAddToFrame);<NEW_LINE>stackFrame.setIsDroppableFrame(vmFrame.<MASK><NEW_LINE>xStackFrames.add(stackFrame);<NEW_LINE>if (!stackFrame.isInDartSdkPatchFile()) {<NEW_LINE>// The exception (if any) is added to the frame where debugger stops and to the upper frames.<NEW_LINE>exceptionToAddToFrame = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>container.addStackFrames(firstFrameIndex == 0 ? xStackFrames : xStackFrames.subList(firstFrameIndex, xStackFrames.size()), true);<NEW_LINE>});<NEW_LINE>}
getKind() == FrameKind.Regular);
825,165
public int compareTo(ScriptFileReference other) {<NEW_LINE>try {<NEW_LINE>Path path1 = Paths.get(scriptFileURL.toURI());<NEW_LINE>String name1 = path1.getFileName().toString();<NEW_LINE>LOGGER.trace("o1 [{}], path1 [{}], name1 [{}]", scriptFileURL, path1, name1);<NEW_LINE>Path path2 = Paths.get(other.scriptFileURL.toURI());<NEW_LINE>String name2 = path2.getFileName().toString();<NEW_LINE>LOGGER.trace("o2 [{}], path2 [{}], name2 [{}]", other.scriptFileURL, path2, name2);<NEW_LINE>int nameCompare = name1.compareToIgnoreCase(name2);<NEW_LINE>if (nameCompare != 0) {<NEW_LINE>return nameCompare;<NEW_LINE>} else {<NEW_LINE>return path1.getParent().toString().compareToIgnoreCase(path2.getParent().toString());<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE><MASK><NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}
LOGGER.error("URI syntax exception", e);
330,810
public static String timeSpan(Context context, long time_s) {<NEW_LINE>// Time in unit x<NEW_LINE>int time_x;<NEW_LINE>Resources res = context.getResources();<NEW_LINE>if (Math.abs(time_s) < TIME_MINUTE) {<NEW_LINE>time_x = (int) time_s;<NEW_LINE>return res.getQuantityString(R.plurals.time_span_seconds, time_x, time_x);<NEW_LINE>} else if (Math.abs(time_s) < TIME_HOUR) {<NEW_LINE>time_x = (int) Math.round(time_s / TIME_MINUTE);<NEW_LINE>return res.getQuantityString(R.plurals.time_span_minutes, time_x, time_x);<NEW_LINE>} else if (Math.abs(time_s) < TIME_DAY) {<NEW_LINE>time_x = (int) Math.round(time_s / TIME_HOUR);<NEW_LINE>return res.getQuantityString(R.plurals.time_span_hours, time_x, time_x);<NEW_LINE>} else if (Math.abs(time_s) < TIME_MONTH) {<NEW_LINE>time_x = (int) Math.round(time_s / TIME_DAY);<NEW_LINE>return res.getQuantityString(R.plurals.time_span_days, time_x, time_x);<NEW_LINE>} else if (Math.abs(time_s) < TIME_YEAR) {<NEW_LINE>time_x = (int) Math.round(time_s / TIME_MONTH);<NEW_LINE>return res.getQuantityString(R.plurals.time_span_months, time_x, time_x);<NEW_LINE>} else {<NEW_LINE>time_x = (int) <MASK><NEW_LINE>return res.getQuantityString(R.plurals.time_span_years, time_x, time_x);<NEW_LINE>}<NEW_LINE>}
Math.round(time_s / TIME_YEAR);
42,120
public void visit(BLangWaitForAllExpr.BLangWaitLiteral waitLiteral) {<NEW_LINE>visitTypedesc(waitLiteral.pos, waitLiteral.getBType(), Collections.emptyList());<NEW_LINE>BIRBasicBlock thenBB = new BIRBasicBlock(this.env.nextBBId(names));<NEW_LINE>addToTrapStack(thenBB);<NEW_LINE>BIRVariableDcl tempVarDcl = new BIRVariableDcl(waitLiteral.getBType(), this.env.nextLocalVarId(names), VarScope.FUNCTION, VarKind.TEMP);<NEW_LINE>this.env.<MASK><NEW_LINE>BIROperand toVarRef = new BIROperand(tempVarDcl);<NEW_LINE>setScopeAndEmit(new BIRNonTerminator.NewStructure(waitLiteral.pos, toVarRef, this.env.targetOperand));<NEW_LINE>this.env.targetOperand = toVarRef;<NEW_LINE>List<String> keys = new ArrayList<>();<NEW_LINE>List<BIROperand> valueExprs = new ArrayList<>();<NEW_LINE>for (BLangWaitForAllExpr.BLangWaitKeyValue keyValue : waitLiteral.keyValuePairs) {<NEW_LINE>keys.add(keyValue.key.value);<NEW_LINE>BLangExpression expr = keyValue.valueExpr != null ? keyValue.valueExpr : keyValue.keyExpr;<NEW_LINE>expr.accept(this);<NEW_LINE>BIROperand valueRegIndex = this.env.targetOperand;<NEW_LINE>valueExprs.add(valueRegIndex);<NEW_LINE>}<NEW_LINE>this.env.enclBB.terminator = new BIRTerminator.WaitAll(waitLiteral.pos, toVarRef, keys, valueExprs, thenBB, this.currentScope);<NEW_LINE>this.env.targetOperand = toVarRef;<NEW_LINE>this.env.enclFunc.basicBlocks.add(thenBB);<NEW_LINE>this.env.enclBB = thenBB;<NEW_LINE>}
enclFunc.localVars.add(tempVarDcl);
1,727,909
final GetUsageStatisticsResult executeGetUsageStatistics(GetUsageStatisticsRequest getUsageStatisticsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getUsageStatisticsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetUsageStatisticsRequest> request = null;<NEW_LINE>Response<GetUsageStatisticsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetUsageStatisticsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getUsageStatisticsRequest));<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, "Macie2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetUsageStatistics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetUsageStatisticsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetUsageStatisticsResultJsonUnmarshaller());<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();
386,261
private ClusterState applyCreateIndexRequestWithExistingMetadata(final ClusterState currentState, final CreateIndexClusterStateUpdateRequest request, final boolean silent, final IndexMetadata sourceMetadata, final BiConsumer<Metadata.Builder, IndexMetadata> metadataTransformer) throws Exception {<NEW_LINE>logger.info("applying create index request using existing index [{}] metadata", sourceMetadata.<MASK><NEW_LINE>final Map<String, Object> mappings = MapperService.parseMapping(xContentRegistry, request.mappings());<NEW_LINE>if (mappings.isEmpty() == false) {<NEW_LINE>throw new IllegalArgumentException("mappings are not allowed when creating an index from a source index, " + "all mappings are copied from the source index");<NEW_LINE>}<NEW_LINE>final Settings aggregatedIndexSettings = aggregateIndexSettings(currentState, request, Settings.EMPTY, sourceMetadata, settings, indexScopedSettings, shardLimitValidator, indexSettingProviders);<NEW_LINE>final int routingNumShards = getIndexNumberOfRoutingShards(aggregatedIndexSettings, sourceMetadata);<NEW_LINE>IndexMetadata tmpImd = buildAndValidateTemporaryIndexMetadata(aggregatedIndexSettings, request, routingNumShards);<NEW_LINE>return applyCreateIndexWithTemporaryService(currentState, request, silent, sourceMetadata, tmpImd, List.of(), indexService -> // the context is only used for validation so it's fine to pass fake values for the<NEW_LINE>resolveAndValidateAliases(// the context is only used for validation so it's fine to pass fake values for the<NEW_LINE>request.index(), // the context is only used for validation so it's fine to pass fake values for the<NEW_LINE>request.aliases(), // the context is only used for validation so it's fine to pass fake values for the<NEW_LINE>Collections.emptyList(), // the context is only used for validation so it's fine to pass fake values for the<NEW_LINE>currentState.metadata(), // the context is only used for validation so it's fine to pass fake values for the<NEW_LINE>xContentRegistry, // shard id and the current timestamp<NEW_LINE>indexService.newSearchExecutionContext(0, 0, null, () -> 0L, null, emptyMap()), IndexService.dateMathExpressionResolverAt(request.getNameResolvedAt()), systemIndices::isSystemName), List.of(), metadataTransformer);<NEW_LINE>}
getIndex().getName());
653,679
private static Optional<Method> findPublicCopyMethod(Method defaultKotlinMethod) {<NEW_LINE>Class<?<MASK><NEW_LINE>KClass<?> kotlinClass = JvmClassMappingKt.getKotlinClass(type);<NEW_LINE>KFunction<?> primaryConstructor = KClasses.getPrimaryConstructor(kotlinClass);<NEW_LINE>if (primaryConstructor == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>List<KParameter> constructorArguments = getComponentArguments(primaryConstructor);<NEW_LINE>return Arrays.stream(type.getDeclaredMethods()).filter(//<NEW_LINE>it -> //<NEW_LINE>it.getName().equals("copy") && //<NEW_LINE>!it.isSynthetic() && //<NEW_LINE>!Modifier.isStatic(it.getModifiers()) && //<NEW_LINE>it.getReturnType().equals(type) && it.getParameterCount() == constructorArguments.size()).filter(it -> {<NEW_LINE>KFunction<?> kotlinFunction = ReflectJvmMapping.getKotlinFunction(it);<NEW_LINE>if (kotlinFunction == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return parameterMatches(constructorArguments, kotlinFunction);<NEW_LINE>}).findFirst();<NEW_LINE>}
> type = defaultKotlinMethod.getDeclaringClass();
299,744
public void run(RegressionEnvironment env) {<NEW_LINE>SupportDeploymentStateListener.reset();<NEW_LINE>SupportDeploymentStateListener listener = new SupportDeploymentStateListener();<NEW_LINE>env.deployment().addDeploymentStateListener(listener);<NEW_LINE>env.compileDeploy("@name('s0') select * from SupportBean");<NEW_LINE>String deploymentId = env.deploymentId("s0");<NEW_LINE>assertEvent(SupportDeploymentStateListener.getSingleEventAndReset(), true, deploymentId, "default", 1, -1);<NEW_LINE>env.undeployAll();<NEW_LINE>assertEvent(SupportDeploymentStateListener.getSingleEventAndReset(), false, deploymentId, "default", 1, -1);<NEW_LINE>env.deployment().getDeploymentStateListeners().next();<NEW_LINE>env.deployment().removeDeploymentStateListener(listener);<NEW_LINE>assertFalse(env.deployment().<MASK><NEW_LINE>env.deployment().addDeploymentStateListener(listener);<NEW_LINE>env.deployment().removeAllDeploymentStateListeners();<NEW_LINE>assertFalse(env.deployment().getDeploymentStateListeners().hasNext());<NEW_LINE>env.deployment().addDeploymentStateListener(listener);<NEW_LINE>EPCompiled compiledOne = env.compile("@name('s0') select * from SupportBean;\n @name('s1') select * from SupportBean;\n");<NEW_LINE>EPCompiled compiledTwo = env.compile("@name('s2') select * from SupportBean");<NEW_LINE>List<EPDeploymentRolloutCompiled> rolloutItems = Arrays.asList(new EPDeploymentRolloutCompiled(compiledOne), new EPDeploymentRolloutCompiled(compiledTwo));<NEW_LINE>env.rollout(rolloutItems, null);<NEW_LINE>List<DeploymentStateEvent> events = SupportDeploymentStateListener.getNEventsAndReset(2);<NEW_LINE>assertEvent(events.get(0), true, env.deploymentId("s0"), "default", 2, 0);<NEW_LINE>assertEvent(events.get(1), true, env.deploymentId("s2"), "default", 1, 1);<NEW_LINE>env.deployment().removeAllDeploymentStateListeners();<NEW_LINE>env.undeployAll();<NEW_LINE>}
getDeploymentStateListeners().hasNext());
678,300
public double treePred(IntIntVector splitFeatVec, IntDoubleVector splitValueVec, IntDoubleVector nodePredVec, IntDoubleVector ins) {<NEW_LINE>assert splitFeatVec.getDim() == splitValueVec.getDim() && splitValueVec.getDim() == nodePredVec.getDim();<NEW_LINE>int nid = 0;<NEW_LINE>int splitFeat = splitFeatVec.get(nid);<NEW_LINE>double splitValue = splitValueVec.get(nid);<NEW_LINE>double pred = nodePredVec.get(nid);<NEW_LINE>while (null != this.forest[this.currentTree].nodes.get(nid) && !this.forest[this.currentTree].nodes.get(nid).isLeaf() && -1 != splitFeat && nid < splitFeatVec.getDim()) {<NEW_LINE>if (ins.get(splitFeat) <= splitValue) {<NEW_LINE>nid = 2 * nid + 1;<NEW_LINE>} else {<NEW_LINE>nid = 2 * nid + 2;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>splitValue = splitValueVec.get(nid);<NEW_LINE>pred = nodePredVec.get(nid);<NEW_LINE>}<NEW_LINE>return pred;<NEW_LINE>}
splitFeat = splitFeatVec.get(nid);
902,789
public void send(final String serverIP, Message msg) {<NEW_LINE>if (serverIP == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, String> params = new HashMap<String, String>(10);<NEW_LINE>params.put("statuses", msg.getData());<NEW_LINE>params.put("clientIP", NetUtils.localServer());<NEW_LINE>String url = "http://" + serverIP + ":" + RunningConfig.getServerPort() + RunningConfig.getContextPath() + UtilsAndCommons.NACOS_NAMING_CONTEXT + "/service/status";<NEW_LINE>if (serverIP.contains(UtilsAndCommons.IP_PORT_SPLITER)) {<NEW_LINE>url = "http://" + serverIP + RunningConfig.getContextPath() + UtilsAndCommons.NACOS_NAMING_CONTEXT + "/service/status";<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>HttpClient.asyncHttpPostLarge(url, null, JSON.toJSONString(params), new AsyncCompletionHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer onCompleted(Response response) throws Exception {<NEW_LINE>if (response.getStatusCode() != HttpURLConnection.HTTP_OK) {<NEW_LINE>Loggers.SRV_LOG.warn("[STATUS-SYNCHRONIZE] failed to request serviceStatus, remote server: {}", serverIP);<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>Loggers.SRV_LOG.<MASK><NEW_LINE>}<NEW_LINE>}
warn("[STATUS-SYNCHRONIZE] failed to request serviceStatus, remote server: " + serverIP, e);
353,326
private List<Node> provisionHosts(int count, NodeResources nodeResources) {<NEW_LINE>try {<NEW_LINE>Version osVersion = nodeRepository().osVersions().targetFor(NodeType.host).orElse(Version.emptyVersion);<NEW_LINE>List<Integer> provisionIndices = nodeRepository().database().readProvisionIndices(count);<NEW_LINE>List<Node> hosts = hostProvisioner.provisionHosts(provisionIndices, NodeType.host, nodeResources, ApplicationId.defaultId(), osVersion, HostSharing.shared, Optional.empty()).stream().map(ProvisionedHost::generateHost).collect(Collectors.toList());<NEW_LINE>nodeRepository().nodes().<MASK><NEW_LINE>return hosts;<NEW_LINE>} catch (NodeAllocationException | IllegalArgumentException | IllegalStateException e) {<NEW_LINE>throw new NodeAllocationException("Failed to provision " + count + " " + nodeResources + ": " + e.getMessage());<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>throw new RuntimeException("Failed to provision " + count + " " + nodeResources + ", will retry in " + interval(), e);<NEW_LINE>}<NEW_LINE>}
addNodes(hosts, Agent.DynamicProvisioningMaintainer);
486,640
public void extract(byte[] segmentBytes, Metadata metadata, JpegSegmentType segmentType) {<NEW_LINE>JpegDirectory directory = new JpegDirectory();<NEW_LINE>metadata.addDirectory(directory);<NEW_LINE>// The value of TAG_COMPRESSION_TYPE is determined by the segment type found<NEW_LINE>directory.setInt(JpegDirectory.TAG_COMPRESSION_TYPE, segmentType.byteValue - JpegSegmentType.SOF0.byteValue);<NEW_LINE>SequentialReader reader = new SequentialByteArrayReader(segmentBytes);<NEW_LINE>try {<NEW_LINE>directory.setInt(JpegDirectory.TAG_DATA_PRECISION, reader.getUInt8());<NEW_LINE>directory.setInt(JpegDirectory.TAG_IMAGE_HEIGHT, reader.getUInt16());<NEW_LINE>directory.setInt(JpegDirectory.<MASK><NEW_LINE>short componentCount = reader.getUInt8();<NEW_LINE>directory.setInt(JpegDirectory.TAG_NUMBER_OF_COMPONENTS, componentCount);<NEW_LINE>// for each component, there are three bytes of data:<NEW_LINE>// 1 - Component ID: 1 = Y, 2 = Cb, 3 = Cr, 4 = I, 5 = Q<NEW_LINE>// 2 - Sampling factors: bit 0-3 vertical, 4-7 horizontal<NEW_LINE>// 3 - Quantization table number<NEW_LINE>for (int i = 0; i < (int) componentCount; i++) {<NEW_LINE>final int componentId = reader.getUInt8();<NEW_LINE>final int samplingFactorByte = reader.getUInt8();<NEW_LINE>final int quantizationTableNumber = reader.getUInt8();<NEW_LINE>final JpegComponent component = new JpegComponent(componentId, samplingFactorByte, quantizationTableNumber);<NEW_LINE>directory.setObject(JpegDirectory.TAG_COMPONENT_DATA_1 + i, component);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>directory.addError(ex.getMessage());<NEW_LINE>}<NEW_LINE>}
TAG_IMAGE_WIDTH, reader.getUInt16());
1,487,766
public static void main(String[] args) throws Exception {<NEW_LINE>ConvertInputStreamToStringBigBenchmark test = new ConvertInputStreamToStringBigBenchmark();<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("1. apacheToInputStream : " + test.apacheToInputStream().length());<NEW_LINE>System.out.println("2. guavaCharStreams : " + test.guavaCharStreams().length());<NEW_LINE>System.out.println("3. jdkScanner : " + test.<MASK><NEW_LINE>System.out.println("4. jdkJava8 : " + test.jdkJava8().length());<NEW_LINE>System.out.println("5. jdkJava8parallel : " + test.jdkJava8parallel().length());<NEW_LINE>System.out.println("6. inputStreamReaderAndStringBuilder : " + test.inputStreamReaderAndStringBuilder().length());<NEW_LINE>System.out.println("7. apacheStringWriterAndIOUtilsCopy : " + test.apacheStringWriterAndIOUtilsCopy().length());<NEW_LINE>System.out.println("8. readByteArrayOutputStream : " + test.readByteArrayOutputStream().length());<NEW_LINE>System.out.println("9. bufferedReaderReadLine : " + test.bufferedReaderReadLine().length());<NEW_LINE>System.out.println("10. bufferedInputStreamAndByteArrayOutputStream : " + test.bufferedInputStreamAndByteArrayOutputStream().length());<NEW_LINE>System.out.println("11. inputStreamReadAndStringBuilder : " + test.inputStreamReadAndStringBuilder().length());<NEW_LINE>System.out.println("12. test12_bufferedReaderReadLine2 : " + test.test12_bufferedReaderReadLine2().length());<NEW_LINE>System.out.println();<NEW_LINE>Options opt = new OptionsBuilder().include(ConvertInputStreamToStringBigBenchmark.class.getSimpleName()).build();<NEW_LINE>new Runner(opt).run();<NEW_LINE>}
jdkScanner().length());
237,307
private int createComplementDataCommand(Date scheduleDate) {<NEW_LINE>Command command = new Command();<NEW_LINE>command.setScheduleTime(scheduleDate);<NEW_LINE>command.setCommandType(CommandType.COMPLEMENT_DATA);<NEW_LINE>command.setProcessDefinitionCode(processInstance.getProcessDefinitionCode());<NEW_LINE>Map<String, String> cmdParam = JSONUtils.toMap(processInstance.getCommandParam());<NEW_LINE>if (cmdParam.containsKey(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING)) {<NEW_LINE>cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING);<NEW_LINE>}<NEW_LINE>cmdParam.replace(CMDPARAM_COMPLEMENT_DATA_START_DATE, DateUtils.format(scheduleDate, "yyyy-MM-dd HH:mm:ss", null));<NEW_LINE>command.setCommandParam(JSONUtils.toJsonString(cmdParam));<NEW_LINE>command.<MASK><NEW_LINE>command.setFailureStrategy(processInstance.getFailureStrategy());<NEW_LINE>command.setWarningType(processInstance.getWarningType());<NEW_LINE>command.setWarningGroupId(processInstance.getWarningGroupId());<NEW_LINE>command.setStartTime(new Date());<NEW_LINE>command.setExecutorId(processInstance.getExecutorId());<NEW_LINE>command.setUpdateTime(new Date());<NEW_LINE>command.setProcessInstancePriority(processInstance.getProcessInstancePriority());<NEW_LINE>command.setWorkerGroup(processInstance.getWorkerGroup());<NEW_LINE>command.setEnvironmentCode(processInstance.getEnvironmentCode());<NEW_LINE>command.setDryRun(processInstance.getDryRun());<NEW_LINE>command.setProcessInstanceId(0);<NEW_LINE>command.setProcessDefinitionVersion(processInstance.getProcessDefinitionVersion());<NEW_LINE>return processService.createCommand(command);<NEW_LINE>}
setTaskDependType(processInstance.getTaskDependType());
1,795,106
ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {<NEW_LINE>// logger.debug(effectivePerson, "receive:{}.", jsonElement);<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Portal exist = this.getPortal(business, wi.getId(), wi.getName(<MASK><NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(wi.getId());<NEW_LINE>wo.setName(wi.getName());<NEW_LINE>wo.setAlias(wi.getAlias());<NEW_LINE>wo.setExist(false);<NEW_LINE>if (null != exist) {<NEW_LINE>wo.setExist(true);<NEW_LINE>wo.setExistName(exist.getName());<NEW_LINE>wo.setExistAlias(exist.getAlias());<NEW_LINE>wo.setExistId(exist.getId());<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
), wi.getAlias());
321,482
public List<JoinActiveTraceBo> decodeValues(Buffer valueBuffer, ApplicationStatDecodingContext decodingContext) {<NEW_LINE>final String id = decodingContext.getApplicationId();<NEW_LINE>final long baseTimestamp = decodingContext.getBaseTimestamp();<NEW_LINE>final <MASK><NEW_LINE>final long initialTimestamp = baseTimestamp + timestampDelta;<NEW_LINE>int numValues = valueBuffer.readVInt();<NEW_LINE>List<Long> timestampList = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);<NEW_LINE>final byte[] header = valueBuffer.readPrefixedBytes();<NEW_LINE>AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);<NEW_LINE>EncodingStrategy<Short> versionEncodingStrategy = UnsignedShortEncodingStrategy.getFromCode(headerDecoder.getCode());<NEW_LINE>EncodingStrategy<Integer> schemaTypeEncodingStrategy = UnsignedIntegerEncodingStrategy.getFromCode(headerDecoder.getCode());<NEW_LINE>JoinIntFieldEncodingStrategy totalCountJoinIntValueEncodingStrategy = JoinIntFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());<NEW_LINE>List<Short> versionList = this.codec.decodeValues(valueBuffer, versionEncodingStrategy, numValues);<NEW_LINE>List<Integer> schemaTypeList = this.codec.decodeValues(valueBuffer, schemaTypeEncodingStrategy, numValues);<NEW_LINE>List<JoinIntFieldBo> totalCountJoinIntValueList = this.codec.decodeValues(valueBuffer, totalCountJoinIntValueEncodingStrategy, numValues);<NEW_LINE>List<JoinActiveTraceBo> joinActiveTraceBoList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < numValues; i++) {<NEW_LINE>JoinActiveTraceBo joinActiveTraceBo = new JoinActiveTraceBo();<NEW_LINE>joinActiveTraceBo.setId(id);<NEW_LINE>joinActiveTraceBo.setVersion(versionList.get(i));<NEW_LINE>joinActiveTraceBo.setTimestamp(timestampList.get(i));<NEW_LINE>joinActiveTraceBo.setHistogramSchemaType(schemaTypeList.get(i));<NEW_LINE>joinActiveTraceBo.setTotalCountJoinValue(totalCountJoinIntValueList.get(i));<NEW_LINE>joinActiveTraceBoList.add(joinActiveTraceBo);<NEW_LINE>}<NEW_LINE>return joinActiveTraceBoList;<NEW_LINE>}
long timestampDelta = decodingContext.getTimestampDelta();
131,301
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {<NEW_LINE>if (request.getRestApiVersion() == RestApiVersion.V_7) {<NEW_LINE>if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) {<NEW_LINE>request.param(INCLUDE_TYPE_NAME_PARAMETER);<NEW_LINE>deprecationLogger.compatibleCritical("get_mapping_with_types", INCLUDE_TYPE_DEPRECATION_MSG);<NEW_LINE>}<NEW_LINE>final String[] <MASK><NEW_LINE>if (request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY) == false && types.length > 0) {<NEW_LINE>throw new IllegalArgumentException("Types cannot be provided in get mapping requests, unless" + " include_type_name is set to true.");<NEW_LINE>}<NEW_LINE>if (request.method().equals(HEAD)) {<NEW_LINE>deprecationLogger.compatibleCritical("get_mapping_types_removal", "Type exists requests are deprecated, as types have been deprecated.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String[] indices = Strings.splitStringByCommaToArray(request.param("index"));<NEW_LINE>final GetMappingsRequest getMappingsRequest = new GetMappingsRequest();<NEW_LINE>getMappingsRequest.indices(indices);<NEW_LINE>getMappingsRequest.indicesOptions(IndicesOptions.fromRequest(request, getMappingsRequest.indicesOptions()));<NEW_LINE>final TimeValue timeout = request.paramAsTime("master_timeout", getMappingsRequest.masterNodeTimeout());<NEW_LINE>getMappingsRequest.masterNodeTimeout(timeout);<NEW_LINE>getMappingsRequest.local(request.paramAsBoolean("local", getMappingsRequest.local()));<NEW_LINE>final HttpChannel httpChannel = request.getHttpChannel();<NEW_LINE>return channel -> new RestCancellableNodeClient(client, httpChannel).admin().indices().getMappings(getMappingsRequest, new DispatchingRestToXContentListener<>(threadPool.executor(ThreadPool.Names.MANAGEMENT), channel, request).map(getMappingsResponse -> new RestGetMappingsResponse(getMappingsResponse, threadPool::relativeTimeInMillis, timeout)));<NEW_LINE>}
types = request.paramAsStringArrayOrEmptyIfAll("type");
51,453
public Result<Void> delete(final Iterable<com.google.cloud.datastore.Key> keys) {<NEW_LINE>for (com.google.cloud.datastore.Key key : keys) deferrer.undefer(ofy.getOptions(), Key.create(key));<NEW_LINE>final Future<Void> fut = datastore.delete(keys);<NEW_LINE>final Result<Void> adapted = new ResultAdapter<>(fut);<NEW_LINE>final Result<Void> result = new ResultWrapper<Void, Void>(adapted) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Void wrap(final Void orig) {<NEW_LINE>for (com.google.cloud.datastore.Key key : keys) session.addValue(Key<MASK><NEW_LINE>return orig;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (ofy.getTransaction() != null)<NEW_LINE>((PrivateAsyncTransaction) ofy.getTransaction()).enlist(result);<NEW_LINE>return result;<NEW_LINE>}
.create(key), null);
1,035,974
protected Optional<Relationship> findRelationship(String userId, String firstGUID, String secondGUID, String firstEntityTypeName, String relationshipTypeName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException {<NEW_LINE>final String methodName = "findRelationship";<NEW_LINE>invalidParameterHandler.validateUserId(userId, methodName);<NEW_LINE>invalidParameterHandler.validateName(firstGUID, CommonMapper.GUID_PROPERTY_NAME, methodName);<NEW_LINE>invalidParameterHandler.validateName(secondGUID, CommonMapper.GUID_PROPERTY_NAME, methodName);<NEW_LINE>TypeDef relationshipTypeDef = <MASK><NEW_LINE>Relationship relationshipBetweenEntities = repositoryHandler.getRelationshipBetweenEntities(userId, firstGUID, firstEntityTypeName, secondGUID, relationshipTypeDef.getGUID(), relationshipTypeDef.getName(), methodName);<NEW_LINE>if (relationshipBetweenEntities == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (firstGUID.equalsIgnoreCase(relationshipBetweenEntities.getEntityOneProxy().getGUID()) && secondGUID.equalsIgnoreCase(relationshipBetweenEntities.getEntityTwoProxy().getGUID())) {<NEW_LINE>return Optional.of(relationshipBetweenEntities);<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
repositoryHelper.getTypeDefByName(userId, relationshipTypeName);
694,044
private void fillPlaceArray(PlayerEntity target) {<NEW_LINE>placePositions.clear();<NEW_LINE>BlockPos targetPos = target.getBlockPos();<NEW_LINE>switch(topPlacement.get()) {<NEW_LINE>case Full -><NEW_LINE>{<NEW_LINE>add(targetPos.add(0, 2, 0));<NEW_LINE>add(targetPos.add(1, 1, 0));<NEW_LINE>add(targetPos.add(-1, 1, 0));<NEW_LINE>add(targetPos.add<MASK><NEW_LINE>add(targetPos.add(0, 1, -1));<NEW_LINE>}<NEW_LINE>case Face -><NEW_LINE>{<NEW_LINE>add(targetPos.add(1, 1, 0));<NEW_LINE>add(targetPos.add(-1, 1, 0));<NEW_LINE>add(targetPos.add(0, 1, 1));<NEW_LINE>add(targetPos.add(0, 1, -1));<NEW_LINE>}<NEW_LINE>case Top -><NEW_LINE>add(targetPos.add(0, 2, 0));<NEW_LINE>}<NEW_LINE>switch(bottomPlacement.get()) {<NEW_LINE>case Platform -><NEW_LINE>{<NEW_LINE>add(targetPos.add(0, -1, 0));<NEW_LINE>add(targetPos.add(1, -1, 0));<NEW_LINE>add(targetPos.add(0, -1, 0));<NEW_LINE>add(targetPos.add(0, -1, 1));<NEW_LINE>add(targetPos.add(0, -1, -1));<NEW_LINE>}<NEW_LINE>case Full -><NEW_LINE>{<NEW_LINE>add(targetPos.add(1, 0, 0));<NEW_LINE>add(targetPos.add(-1, 0, 0));<NEW_LINE>add(targetPos.add(0, 0, -1));<NEW_LINE>add(targetPos.add(0, 0, 1));<NEW_LINE>}<NEW_LINE>case Single -><NEW_LINE>add(targetPos.add(0, -1, 0));<NEW_LINE>}<NEW_LINE>}
(0, 1, 1));
681,463
protected void startDiscovering() {<NEW_LINE>mIsDiscovering = true;<NEW_LINE>mDiscoveredEndpoints.clear();<NEW_LINE>DiscoveryOptions.Builder discoveryOptions = new DiscoveryOptions.Builder();<NEW_LINE>discoveryOptions.setStrategy(getStrategy());<NEW_LINE>mConnectionsClient.startDiscovery(getServiceId(), new EndpointDiscoveryCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onEndpointFound(String endpointId, DiscoveredEndpointInfo info) {<NEW_LINE>logD(String.format("onEndpointFound(endpointId=%s, serviceId=%s, endpointName=%s)", endpointId, info.getServiceId(), info.getEndpointName()));<NEW_LINE>if (getServiceId().equals(info.getServiceId())) {<NEW_LINE>Endpoint endpoint = new Endpoint(endpointId, info.getEndpointName());<NEW_LINE>mDiscoveredEndpoints.put(endpointId, endpoint);<NEW_LINE>onEndpointDiscovered(endpoint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onEndpointLost(String endpointId) {<NEW_LINE>logD(String<MASK><NEW_LINE>}<NEW_LINE>}, discoveryOptions.build()).addOnSuccessListener(new OnSuccessListener<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(Void unusedResult) {<NEW_LINE>onDiscoveryStarted();<NEW_LINE>}<NEW_LINE>}).addOnFailureListener(new OnFailureListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(@NonNull Exception e) {<NEW_LINE>mIsDiscovering = false;<NEW_LINE>logW("startDiscovering() failed.", e);<NEW_LINE>onDiscoveryFailed();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.format("onEndpointLost(endpointId=%s)", endpointId));
496,759
public void read(org.apache.thrift.protocol.TProtocol prot, TSummary struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(5);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TMap _map110 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64);<NEW_LINE>struct.summary = new java.util.HashMap<java.lang.String, java.lang.Long>(2 * _map110.size);<NEW_LINE>@org.apache.thrift.annotation.Nullable<NEW_LINE>java.lang.String _key111;<NEW_LINE>long _val112;<NEW_LINE>for (int _i113 = 0; _i113 < _map110.size; ++_i113) {<NEW_LINE>_key111 = iprot.readString();<NEW_LINE>_val112 = iprot.readI64();<NEW_LINE>struct.summary.put(_key111, _val112);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.setSummaryIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.config = new TSummarizerConfiguration();<NEW_LINE>struct.config.read(iprot);<NEW_LINE>struct.setConfigIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct<MASK><NEW_LINE>struct.setFilesContainingIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(3)) {<NEW_LINE>struct.filesExceeding = iprot.readI64();<NEW_LINE>struct.setFilesExceedingIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(4)) {<NEW_LINE>struct.filesLarge = iprot.readI64();<NEW_LINE>struct.setFilesLargeIsSet(true);<NEW_LINE>}<NEW_LINE>}
.filesContaining = iprot.readI64();
535,117
public void init(IBatchConfig batchConfig) throws BatchContainerServiceException {<NEW_LINE>logger.log(Level.CONFIG, "Entering CLASSNAME.init(), batchConfig ={0}", batchConfig);<NEW_LINE>this.batchConfig = batchConfig;<NEW_LINE>schema = batchConfig.getDatabaseConfigurationBean().getSchema();<NEW_LINE>jndiName = batchConfig.getDatabaseConfigurationBean().getJndiName();<NEW_LINE>prefix = batchConfig.getConfigProperties().getProperty(PAYARA_TABLE_PREFIX_PROPERTY, "");<NEW_LINE>suffix = batchConfig.getConfigProperties().getProperty(PAYARA_TABLE_SUFFIX_PROPERTY, "");<NEW_LINE>try {<NEW_LINE>Context ctx = new InitialContext();<NEW_LINE>dataSource = (<MASK><NEW_LINE>} catch (NamingException e) {<NEW_LINE>logger.severe("Lookup failed for JNDI name: " + jndiName + ". One cause of this could be that the batch runtime is incorrectly configured to EE mode when it should be in SE mode.");<NEW_LINE>throw new BatchContainerServiceException(e);<NEW_LINE>}<NEW_LINE>// Load the table names and queries shared between different database<NEW_LINE>// types<NEW_LINE>tableNames = getSharedTableMap();<NEW_LINE>try {<NEW_LINE>queryStrings = getSharedQueryMap(batchConfig);<NEW_LINE>} catch (SQLException e1) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>throw new BatchContainerServiceException(e1);<NEW_LINE>}<NEW_LINE>logger.log(Level.CONFIG, "JNDI name = {0}", jndiName);<NEW_LINE>if (jndiName == null || jndiName.equals("")) {<NEW_LINE>throw new BatchContainerServiceException("JNDI name is not defined.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!isSchemaValid()) {<NEW_LINE>setDefaultSchema();<NEW_LINE>}<NEW_LINE>checkTables();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>logger.severe(e.getLocalizedMessage());<NEW_LINE>throw new BatchContainerServiceException(e);<NEW_LINE>}<NEW_LINE>logger.config("Exiting CLASSNAME.init()");<NEW_LINE>}
DataSource) ctx.lookup(jndiName);
1,393,881
public boolean visit(SwitchStatement node) {<NEW_LINE>if (!hasChildrenChanges(node)) {<NEW_LINE>return doVisitUnchangedChildren(node);<NEW_LINE>}<NEW_LINE>int pos = <MASK><NEW_LINE>ChildListPropertyDescriptor property = SwitchStatement.STATEMENTS_PROPERTY;<NEW_LINE>if (getChangeKind(node, property) != RewriteEvent.UNCHANGED) {<NEW_LINE>try {<NEW_LINE>pos = getScanner().getTokenEndOffset(TerminalTokens.TokenNameLBRACE, pos);<NEW_LINE>int insertIndent = getIndent(node.getStartPosition());<NEW_LINE>if (DefaultCodeFormatterConstants.TRUE.equals(this.options.get(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH))) {<NEW_LINE>insertIndent++;<NEW_LINE>}<NEW_LINE>ParagraphListRewriter listRewriter;<NEW_LINE>if ((node.getAST().isPreviewEnabled())) {<NEW_LINE>listRewriter = new SwitchListLabeledRuleRewriter(insertIndent);<NEW_LINE>} else {<NEW_LINE>listRewriter = new SwitchListRewriter(insertIndent);<NEW_LINE>}<NEW_LINE>StringBuffer leadString = new StringBuffer();<NEW_LINE>leadString.append(getLineDelimiter());<NEW_LINE>leadString.append(createIndentString(insertIndent));<NEW_LINE>listRewriter.rewriteList(node, property, pos, leadString.toString());<NEW_LINE>} catch (CoreException e) {<NEW_LINE>handleException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>voidVisit(node, SwitchStatement.STATEMENTS_PROPERTY);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
rewriteRequiredNode(node, SwitchStatement.EXPRESSION_PROPERTY);
1,196,235
private void drawPlaceholder(Canvas canvas) {<NEW_LINE>if (!isInEditMode())<NEW_LINE>return;<NEW_LINE>canvas.getClipBounds(rect);<NEW_LINE>int width = rect.width();<NEW_LINE>int verticalBlockNumber = 7;<NEW_LINE>int horizontalBlockNumber = <MASK><NEW_LINE>float marginBlock = (1.0F - 0.1F);<NEW_LINE>float blockWidth = width / (float) horizontalBlockNumber * marginBlock;<NEW_LINE>float spaceWidth = width / (float) horizontalBlockNumber - blockWidth;<NEW_LINE>float monthTextHeight = (displayMonth) ? blockWidth * 1.5F : 0;<NEW_LINE>float topMargin = (displayMonth) ? 7f : 0;<NEW_LINE>monthTextPaint.setTextSize(monthTextHeight);<NEW_LINE>int height = (int) ((blockWidth + spaceWidth) * 7 + topMargin + monthTextHeight);<NEW_LINE>// Background<NEW_LINE>blockPaint.setColor(backgroundBaseColor);<NEW_LINE>canvas.drawRect(0, (topMargin + monthTextHeight), width, height + monthTextHeight, blockPaint);<NEW_LINE>float x = 0;<NEW_LINE>float y = 0 * (blockWidth + spaceWidth) + (topMargin + monthTextHeight);<NEW_LINE>for (int i = 1; i < (lastWeeks * 7) + 1; i++) {<NEW_LINE>blockPaint.setColor(ColorsUtils.calculateLevelColor(baseColor, baseEmptyColor, 0));<NEW_LINE>canvas.drawRect(x, y, x + blockWidth, y + blockWidth, blockPaint);<NEW_LINE>if (i % 7 == 0) {<NEW_LINE>// another column<NEW_LINE>x += blockWidth + spaceWidth;<NEW_LINE>y = topMargin + monthTextHeight;<NEW_LINE>} else {<NEW_LINE>y += blockWidth + spaceWidth;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Resize component<NEW_LINE>ViewGroup.LayoutParams ll = getLayoutParams();<NEW_LINE>ll.height = height;<NEW_LINE>setLayoutParams(ll);<NEW_LINE>}
getHorizontalBlockNumber(lastWeeks * 7, verticalBlockNumber);
578,130
protected void doRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {<NEW_LINE>if (req instanceof MultipartHttpServletRequest) {<NEW_LINE>// We need to manually fix config if it's "form-data" by jetty's requirement,<NEW_LINE>// as this jetty is an embedded one, there's no XML config to read<NEW_LINE>req.setAttribute(Request.MULTIPART_CONFIG_ELEMENT, multipartConfig);<NEW_LINE>}<NEW_LINE>String charset = (req.getCharacterEncoding() == null) ? TBaseConstants.META_DEFAULT_CHARSET_NAME : req.getCharacterEncoding();<NEW_LINE>resp.setCharacterEncoding(charset);<NEW_LINE>RequestContext context = new RequestContext(<MASK><NEW_LINE>if (this.config.containsType(context.requestType())) {<NEW_LINE>if (dispatcher == null) {<NEW_LINE>resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>dispatcher.processRequest(context);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error("", t);<NEW_LINE>resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resp.flushBuffer();<NEW_LINE>}<NEW_LINE>}
this.config, req, resp);
858,179
public static void logOut(Simplenote application) {<NEW_LINE>application.getSimperium().deauthorizeUser();<NEW_LINE>application.getAccountBucket().reset();<NEW_LINE>application.getNotesBucket().reset();<NEW_LINE>application.getTagsBucket().reset();<NEW_LINE>application.getPreferencesBucket().reset();<NEW_LINE>application.getAccountBucket().stop();<NEW_LINE>AppLog.add(Type.SYNC, "Stopped account bucket (AuthUtils)");<NEW_LINE>application.getNotesBucket().stop();<NEW_LINE>AppLog.add(Type.SYNC, "Stopped note bucket (AuthUtils)");<NEW_LINE>application.getTagsBucket().stop();<NEW_LINE>AppLog.add(Type.SYNC, "Stopped tag bucket (AuthUtils)");<NEW_LINE>application.getPreferencesBucket().stop();<NEW_LINE>AppLog.add(Type.SYNC, "Stopped preference bucket (AuthUtils)");<NEW_LINE>// Resets analytics user back to 'anon' type<NEW_LINE>AnalyticsTracker.refreshMetadata(null);<NEW_LINE>// Remove wp.com token<NEW_LINE>SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(application).edit();<NEW_LINE>editor.remove(PrefUtils.PREF_WP_TOKEN);<NEW_LINE>// Remove WordPress sites<NEW_LINE>editor.remove(PrefUtils.PREF_WORDPRESS_SITES);<NEW_LINE>editor.apply();<NEW_LINE>// Remove note scroll positions<NEW_LINE>application.getSharedPreferences(SCROLL_POSITION_PREFERENCES, Context.MODE_PRIVATE).edit()<MASK><NEW_LINE>// Remove note last sync times<NEW_LINE>application.getSharedPreferences(SYNC_TIME_PREFERENCES, Context.MODE_PRIVATE).edit().clear().apply();<NEW_LINE>// Remove Passcode Lock password<NEW_LINE>AppLockManager.getInstance().getAppLock().setPassword("");<NEW_LINE>WidgetUtils.updateNoteWidgets(application);<NEW_LINE>}
.clear().apply();
946,326
public FulfillmentEstimationResponse estimateCostForFulfillmentGroup(FulfillmentGroup fulfillmentGroup, Set<FulfillmentOption> options) throws FulfillmentPriceException {<NEW_LINE>FulfillmentEstimationResponse response = new FulfillmentEstimationResponse();<NEW_LINE>HashMap<FulfillmentOption, Money> prices = new HashMap<FulfillmentOption, Money>();<NEW_LINE>response.setFulfillmentOptionPrices(prices);<NEW_LINE>for (FulfillmentPricingProvider provider : providers) {<NEW_LINE>// Leave it up to the providers to determine if they can respond to a pricing estimate. If they can't, or if one or more of the options that are passed in can't be responded<NEW_LINE>// to, then the response from the pricing provider should not include the options that it could not respond to.<NEW_LINE>try {<NEW_LINE>FulfillmentEstimationResponse processorResponse = provider.estimateCostForFulfillmentGroup(fulfillmentGroup, options);<NEW_LINE>if (processorResponse != null && processorResponse.getFulfillmentOptionPrices() != null && processorResponse.getFulfillmentOptionPrices().size() > 0) {<NEW_LINE>prices.putAll(processorResponse.getFulfillmentOptionPrices());<NEW_LINE>}<NEW_LINE>} catch (FulfillmentPriceException e) {<NEW_LINE>// Shouldn't completely fail the rest of the estimation on a pricing exception. Another provider might still<NEW_LINE>// be able to respond<NEW_LINE>String errorMessage = "FulfillmentPriceException thrown when trying to estimate fulfillment costs from ";<NEW_LINE>errorMessage += provider.getClass().getName();<NEW_LINE>errorMessage <MASK><NEW_LINE>LOG.error(errorMessage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
+= ". Underlying message was: " + e.getMessage();
1,332,398
private void resolveForInstallationV1LookupTable(EntityV1 entity, InputEntity input, Map<String, ValueReference> parameters, Map<EntityDescriptor, Entity> entities, MutableGraph<Entity> graph) {<NEW_LINE>final Set<String> lookupTableNames = input.extractors().stream().filter(e -> e.type().asString(parameters).equals(Extractor.Type.LOOKUP_TABLE.toString())).map(ExtractorEntity::configuration).map(c -> ((ValueReference) c.get(LookupTableExtractor.CONFIG_LUT_NAME)).asString(parameters)).collect(Collectors.toSet());<NEW_LINE>input.extractors().stream().flatMap(c -> c.converters().stream()).filter(con -> con.type().asString(parameters).equals(Converter.Type.LOOKUP_TABLE.name())).map(con -> ((ValueReference) con.configuration().get("lookup_table_name")).asString(parameters)).forEach(lookupTableNames::add);<NEW_LINE>entities.entrySet().stream().filter(x -> x.getValue().type().equals(ModelTypes.LOOKUP_TABLE_V1)).filter(x -> {<NEW_LINE>EntityV1 entityV1 = (EntityV1) x.getValue();<NEW_LINE>LookupTableEntity lookupTableEntity = objectMapper.convertValue(entityV1.<MASK><NEW_LINE>return lookupTableNames.contains(lookupTableEntity.name().asString(parameters));<NEW_LINE>}).forEach(x -> graph.putEdge(entity, x.getValue()));<NEW_LINE>}
data(), LookupTableEntity.class);
1,110,415
public static EnergyInventorySlot fillOrConvert(IEnergyContainer energyContainer, Supplier<Level> worldSupplier, @Nullable IContentsListener listener, int x, int y) {<NEW_LINE>Objects.requireNonNull(energyContainer, "Energy container cannot be null");<NEW_LINE>Objects.requireNonNull(worldSupplier, "World supplier cannot be null");<NEW_LINE>return new EnergyInventorySlot(energyContainer, worldSupplier, stack -> {<NEW_LINE>// Allow extraction if something went horribly wrong, and we are not an energy container item or no longer have any energy left to give,<NEW_LINE>// or we are no longer a valid conversion, this might happen after a reload for example<NEW_LINE>return !fillInsertCheck(stack) && getPotentialConversion(worldSupplier.get(), stack).isZero();<NEW_LINE>}, stack -> {<NEW_LINE>if (fillInsertCheck(stack)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Note: We recheck about this being empty and that it is still valid as the conversion list might have changed, such as after a reload<NEW_LINE>// Unlike with the chemical conversions, we don't check if the type is "valid" as we only have one "type" of energy.<NEW_LINE>return !getPotentialConversion(worldSupplier.get(), stack).isZero();<NEW_LINE>}, stack -> {<NEW_LINE>// Note: we mark all energy handler items as valid and have a more restrictive insert check so that we allow full containers when they are done being filled<NEW_LINE>// We also allow energy conversion of items that can be converted<NEW_LINE>return EnergyCompatUtils.hasStrictEnergyHandler(stack) || !getPotentialConversion(worldSupplier.get(<MASK><NEW_LINE>}, listener, x, y);<NEW_LINE>}
), stack).isZero();
65,021
public void stop() {<NEW_LINE>stopping = true;<NEW_LINE>taskExecutor.shutdown();<NEW_LINE>List<ListenableFuture<Void>> shutdownFutures = new ArrayList<>();<NEW_LINE>synchronized (tasks) {<NEW_LINE>for (ThreadingTaskRunnerWorkItem taskWorkItem : tasks.values()) {<NEW_LINE>shutdownFutures.add(scheduleTaskShutdown(taskWorkItem));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>controlThreadExecutor.shutdown();<NEW_LINE>try {<NEW_LINE>ListenableFuture<List<Void>> shutdownFuture = Futures.successfulAsList(shutdownFutures);<NEW_LINE>shutdownFuture.get();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(e, "Encountered exception when stopping all tasks.");<NEW_LINE>}<NEW_LINE>final DateTime start = DateTimes.nowUtc();<NEW_LINE>final long gracefulShutdownMillis = taskConfig.getGracefulShutdownTimeout().toStandardDuration().getMillis();<NEW_LINE>LOGGER.info("Waiting up to %,dms for shutdown.", gracefulShutdownMillis);<NEW_LINE>if (gracefulShutdownMillis > 0) {<NEW_LINE>try {<NEW_LINE>final boolean terminated = controlThreadExecutor.awaitTermination(gracefulShutdownMillis, TimeUnit.MILLISECONDS);<NEW_LINE>final long elapsed = System.currentTimeMillis<MASK><NEW_LINE>if (terminated) {<NEW_LINE>LOGGER.info("Finished stopping in %,dms.", elapsed);<NEW_LINE>} else {<NEW_LINE>final Set<String> stillRunning;<NEW_LINE>synchronized (tasks) {<NEW_LINE>stillRunning = ImmutableSet.copyOf(tasks.keySet());<NEW_LINE>}<NEW_LINE>LOGGER.makeAlert("Failed to stop task threads").addData("stillRunning", stillRunning).addData("elapsed", elapsed).emit();<NEW_LINE>LOGGER.warn("Executor failed to stop after %,dms, not waiting for it! Tasks still running: [%s]", elapsed, Joiner.on("; ").join(stillRunning));<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOGGER.warn(e, "Interrupted while waiting for executor to finish.");<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Ran out of time, not waiting for executor to finish!");<NEW_LINE>}<NEW_LINE>appenderatorsManager.shutdown();<NEW_LINE>}
() - start.getMillis();
1,304,653
public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {<NEW_LINE>final String id = request.param(MONITORING_ID);<NEW_LINE>if (Strings.isEmpty(id)) {<NEW_LINE>throw new IllegalArgumentException("no [" + MONITORING_ID + "] for monitoring bulk request");<NEW_LINE>}<NEW_LINE>final String version = request.param(MONITORING_VERSION);<NEW_LINE>if (Strings.isEmpty(version)) {<NEW_LINE>throw new IllegalArgumentException("no [" + MONITORING_VERSION + "] for monitoring bulk request");<NEW_LINE>}<NEW_LINE>final String intervalAsString = request.param(INTERVAL);<NEW_LINE>if (Strings.isEmpty(intervalAsString)) {<NEW_LINE>throw new IllegalArgumentException("no [" + INTERVAL + "] for monitoring bulk request");<NEW_LINE>}<NEW_LINE>if (false == request.hasContentOrSourceParam()) {<NEW_LINE>throw new ElasticsearchParseException("no body content for monitoring bulk request");<NEW_LINE>}<NEW_LINE>final MonitoredSystem system = MonitoredSystem.fromSystem(id);<NEW_LINE>if (isSupportedSystemVersion(system, version) == false) {<NEW_LINE>throw new IllegalArgumentException(MONITORING_VERSION + " [" + version + "] is not supported by " + MONITORING_ID + " [" + id + "]");<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final long intervalMillis = parseTimeValue(intervalAsString, INTERVAL).getMillis();<NEW_LINE>final MonitoringBulkRequestBuilder requestBuilder = new MonitoringBulkRequestBuilder(client);<NEW_LINE>requestBuilder.add(system, request.content(), request.getXContentType(), timestamp, intervalMillis);<NEW_LINE>return channel -> requestBuilder.execute(getRestBuilderListener(channel));<NEW_LINE>}
long timestamp = System.currentTimeMillis();
1,366,387
public int backfill(String schemaName, String tableName, ExecutionContext baseEc, Map<String, Set<String>> sourcePhyTables, Map<String, String> sourceTargetGroupMap) {<NEW_LINE>final long batchSize = baseEc.getParamManager().getLong(ConnectionParams.SCALEOUT_BACKFILL_BATCH_SIZE);<NEW_LINE>final long speedMin = baseEc.getParamManager().getLong(ConnectionParams.SCALEOUT_BACKFILL_SPEED_MIN);<NEW_LINE>final long speedLimit = baseEc.getParamManager().getLong(ConnectionParams.SCALEOUT_BACKFILL_SPEED_LIMITATION);<NEW_LINE>final long parallelism = baseEc.getParamManager(<MASK><NEW_LINE>if (null == baseEc.getServerVariables()) {<NEW_LINE>baseEc.setServerVariables(new HashMap<>());<NEW_LINE>}<NEW_LINE>// Init extractor and loader<NEW_LINE>final Extractor extractor = MoveTableExtractor.create(schemaName, tableName, batchSize, speedMin, speedLimit, parallelism, sourcePhyTables, baseEc);<NEW_LINE>final Loader loader = MoveTableLoader.create(schemaName, tableName, tableName, this.executeFunc, baseEc.isUseHint(), baseEc, sourceTargetGroupMap);<NEW_LINE>// Load latest extractor position mark<NEW_LINE>extractor.loadBackfillMeta(baseEc);<NEW_LINE>// Foreach row: lock batch -> fill into index -> release lock<NEW_LINE>final AtomicInteger affectRows = new AtomicInteger();<NEW_LINE>extractor.foreachBatch(baseEc, (batch, extractEcAndIndexPair) -> loader.fillIntoIndex(batch, Pair.of(baseEc, extractEcAndIndexPair.getValue()), () -> {<NEW_LINE>try {<NEW_LINE>// Commit and close extract statement<NEW_LINE>extractEcAndIndexPair.getKey().getTransaction().commit();<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Close extract statement failed!", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>return affectRows.get();<NEW_LINE>}
).getLong(ConnectionParams.SCALEOUT_BACKFILL_PARALLELISM);
1,390,183
private org.opendope.xpaths.Xpaths.Xpath createNewXPathObject(String newPath, org.opendope.xpaths.Xpaths.Xpath xpathObj, int index) {<NEW_LINE>// org.opendope.xpaths.Xpaths.Xpath newXPathObj = XmlUtils<NEW_LINE>// .deepCopy(xpathObj);<NEW_LINE>org.opendope.xpaths.Xpaths.Xpath newXPathObj = new org.opendope.xpaths.Xpaths.Xpath();<NEW_LINE>String newXPathId = xpathObj.getId() + "_" + index;<NEW_LINE>newXPathObj.setId(newXPathId);<NEW_LINE>org.opendope.xpaths.Xpaths.Xpath.DataBinding dataBinding = new org.opendope.xpaths.Xpaths.Xpath.DataBinding();<NEW_LINE>newXPathObj.setDataBinding(dataBinding);<NEW_LINE>dataBinding.setXpath(newPath);<NEW_LINE>dataBinding.setStoreItemID(xpathObj.getDataBinding().getStoreItemID());<NEW_LINE>dataBinding.setPrefixMappings(xpathObj.getDataBinding().getPrefixMappings());<NEW_LINE>Xpath oldKey = xpathsMap.put(newXPathId, newXPathObj);<NEW_LINE>if (oldKey != null) {<NEW_LINE>if (oldKey.getDataBinding().getXpath().equals(newPath)) {<NEW_LINE>// OK<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("New xpath entry overwrites existing identical xpath " + newXPathId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// bad<NEW_LINE><MASK><NEW_LINE>log.warn("Old: " + oldKey.getDataBinding().getXpath());<NEW_LINE>log.warn("New: " + newPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newXPathObj;<NEW_LINE>}
log.warn("New xpath entry overwrites existing different xpath " + newXPathId);
1,542,713
public void addStatesForHalfLabelsConnectedAsIn(InstanceList trainingSet) {<NEW_LINE><MASK><NEW_LINE>boolean[][] connections = labelConnectionsIn(trainingSet);<NEW_LINE>for (int i = 0; i < numLabels; i++) {<NEW_LINE>@Var<NEW_LINE>int numDestinations = 0;<NEW_LINE>for (int j = 0; j < numLabels; j++) if (connections[i][j])<NEW_LINE>numDestinations++;<NEW_LINE>String[] destinationNames = new String[numDestinations];<NEW_LINE>@Var<NEW_LINE>int destinationIndex = 0;<NEW_LINE>for (int j = 0; j < numLabels; j++) if (connections[i][j])<NEW_LINE>destinationNames[destinationIndex++] = (String) outputAlphabet.lookupObject(j);<NEW_LINE>addState((String) outputAlphabet.lookupObject(i), 0.0, 0.0, destinationNames, destinationNames);<NEW_LINE>}<NEW_LINE>}
int numLabels = outputAlphabet.size();