idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,534,534 | private Map executeUDP(Map data_to_send, InetAddress bind_ip, int bind_port, boolean v6) throws Exception {<NEW_LINE>if (COConfigurationManager.getBooleanParameter("update.anonymous")) {<NEW_LINE>throw (new Exception("UDP disabled for anonymous updates"));<NEW_LINE>}<NEW_LINE>if (v6 && !enable_v6) {<NEW_LINE>throw (new Exception("IPv6 is disabled"));<NEW_LINE>}<NEW_LINE>String host = getHost(v6, UDP_SERVER_ADDRESS_V6, UDP_SERVER_ADDRESS_V4);<NEW_LINE>PRUDPReleasablePacketHandler handler = PRUDPPacketHandlerFactory.getReleasableHandler(bind_port);<NEW_LINE>PRUDPPacketHandler packet_handler = handler.getHandler();<NEW_LINE>long timeout = 5;<NEW_LINE>Random random = new Random();<NEW_LINE>try {<NEW_LINE>Exception last_error = null;<NEW_LINE>packet_handler.setExplicitBindAddress(bind_ip, false);<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>try {<NEW_LINE>// connection ids for requests must always have their msb set...<NEW_LINE>// apart from the original darn udp tracker spec....<NEW_LINE>long connection_id = 0x8000000000000000L | random.nextLong();<NEW_LINE>VersionCheckClientUDPRequest request_packet = new VersionCheckClientUDPRequest(connection_id);<NEW_LINE>request_packet.setPayload(data_to_send);<NEW_LINE>VersionCheckClientUDPReply reply_packet = (VersionCheckClientUDPReply) packet_handler.sendAndReceive(null, request_packet, new InetSocketAddress(host, UDP_SERVER_PORT), timeout);<NEW_LINE><MASK><NEW_LINE>preProcessReply(reply, v6);<NEW_LINE>return (reply);<NEW_LINE>} catch (Exception e) {<NEW_LINE>last_error = e;<NEW_LINE>timeout = timeout * 2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (last_error != null) {<NEW_LINE>throw (last_error);<NEW_LINE>}<NEW_LINE>throw (new Exception("Timeout"));<NEW_LINE>} finally {<NEW_LINE>packet_handler.setExplicitBindAddress(null, false);<NEW_LINE>handler.release();<NEW_LINE>}<NEW_LINE>} | Map reply = reply_packet.getPayload(); |
230,262 | private static Pair<ExprNode, ExprTableAccessNode> handleTableSubchain(List<ExprNode> tableKeys, List<Chainable> chain, TableMetaData table, Function<List<Chainable>, ExprDotNodeImpl> dotNodeFunction) {<NEW_LINE>if (chain.isEmpty()) {<NEW_LINE>ExprTableAccessNodeTopLevel node = new ExprTableAccessNodeTopLevel(table.getTableName());<NEW_LINE>node.addChildNodes(tableKeys);<NEW_LINE>return new Pair<>(node, node);<NEW_LINE>}<NEW_LINE>// We make an exception when the table is keyed and the column is found and there are no table keys provided.<NEW_LINE>// This accommodates the case "select MyTable.a from MyTable".<NEW_LINE>String columnOrOtherName = chain.get(0).getRootNameOrEmptyString();<NEW_LINE>TableMetadataColumn tableColumn = table.getColumns().get(columnOrOtherName);<NEW_LINE>if (tableColumn != null && table.isKeyed() && tableKeys.isEmpty()) {<NEW_LINE>// let this be resolved as an identifier<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (chain.size() == 1) {<NEW_LINE>if (chain.get(0) instanceof ChainableName) {<NEW_LINE>ExprTableAccessNodeSubprop node = new ExprTableAccessNodeSubprop(table.getTableName(), columnOrOtherName);<NEW_LINE>node.addChildNodes(tableKeys);<NEW_LINE>return new Pair<>(node, node);<NEW_LINE>}<NEW_LINE>if (columnOrOtherName.toLowerCase(Locale.ENGLISH).equals("keys")) {<NEW_LINE>ExprTableAccessNodeKeys node = new ExprTableAccessNodeKeys(table.getTableName());<NEW_LINE>node.addChildNodes(tableKeys);<NEW_LINE>return new Pair<>(node, node);<NEW_LINE>} else {<NEW_LINE>throw new ValidationException("Invalid use of table '" + table.getTableName() + "', unrecognized use of function '" + columnOrOtherName + "', expected 'keys()'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ExprTableAccessNodeSubprop node = new ExprTableAccessNodeSubprop(table.getTableName(), columnOrOtherName);<NEW_LINE>node.addChildNodes(tableKeys);<NEW_LINE>List<Chainable> subchain = chain.subList(<MASK><NEW_LINE>ExprNode exprNode = dotNodeFunction.apply(subchain);<NEW_LINE>exprNode.addChildNode(node);<NEW_LINE>return new Pair<>(exprNode, node);<NEW_LINE>} | 1, chain.size()); |
472,627 | public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {<NEW_LINE>this.phaseType = in.readBoolean() ? PhaseType.valueOf(in.readUTF()) : null;<NEW_LINE>this.fromProduct = (DefaultProduct) in.readObject();<NEW_LINE>this.fromProductCategory = in.readBoolean() ? ProductCategory.valueOf(in.readUTF()) : null;<NEW_LINE>this.fromBillingPeriod = in.readBoolean() ? BillingPeriod.valueOf(in.readUTF()) : null;<NEW_LINE>this.fromPriceList = <MASK><NEW_LINE>this.toProduct = (DefaultProduct) in.readObject();<NEW_LINE>this.toProductCategory = in.readBoolean() ? ProductCategory.valueOf(in.readUTF()) : null;<NEW_LINE>this.toBillingPeriod = in.readBoolean() ? BillingPeriod.valueOf(in.readUTF()) : null;<NEW_LINE>this.toPriceList = (DefaultPriceList) in.readObject();<NEW_LINE>} | (DefaultPriceList) in.readObject(); |
816,271 | public void removeMarker(BlockPos pos) {<NEW_LINE>if (positions.getFirst().equals(pos)) {<NEW_LINE>positions.removeFirst();<NEW_LINE>loop = false;<NEW_LINE>if (positions.size() < 2) {<NEW_LINE>positions.clear();<NEW_LINE>}<NEW_LINE>subCache.refreshConnection(this);<NEW_LINE>} else if (positions.getLast().equals(pos)) {<NEW_LINE>positions.removeLast();<NEW_LINE>loop = false;<NEW_LINE>if (positions.size() < 2) {<NEW_LINE>positions.clear();<NEW_LINE>}<NEW_LINE>subCache.refreshConnection(this);<NEW_LINE>} else if (positions.contains(pos)) {<NEW_LINE>List<BlockPos> a = new ArrayList<>();<NEW_LINE>List<BlockPos> b = new ArrayList<>();<NEW_LINE>boolean hasReached = false;<NEW_LINE>for (BlockPos p : positions) {<NEW_LINE>if (p.equals(pos)) {<NEW_LINE>hasReached = true;<NEW_LINE>} else if (hasReached) {<NEW_LINE>b.add(p);<NEW_LINE>} else {<NEW_LINE>a.add(p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>loop = false;<NEW_LINE>PathConnection conA = new PathConnection(subCache);<NEW_LINE><MASK><NEW_LINE>conA.positions.addAll(a);<NEW_LINE>conB.positions.addAll(b);<NEW_LINE>positions.clear();<NEW_LINE>subCache.destroyConnection(this);<NEW_LINE>subCache.addConnection(conA);<NEW_LINE>subCache.addConnection(conB);<NEW_LINE>}<NEW_LINE>} | PathConnection conB = new PathConnection(subCache); |
388,501 | public void rollbackToSavepoint(long savepointId) {<NEW_LINE>long lastState = setStatus(STATUS_ROLLING_BACK);<NEW_LINE>long logId = getLogId(lastState);<NEW_LINE>boolean success;<NEW_LINE>try {<NEW_LINE>store.<MASK><NEW_LINE>} finally {<NEW_LINE>notifyAllWaitingTransactions();<NEW_LINE>long expectedState = composeState(STATUS_ROLLING_BACK, logId, hasRollback(lastState));<NEW_LINE>long newState = composeState(STATUS_OPEN, savepointId, true);<NEW_LINE>do {<NEW_LINE>success = statusAndLogId.compareAndSet(expectedState, newState);<NEW_LINE>} while (!success && statusAndLogId.get() == expectedState);<NEW_LINE>}<NEW_LINE>// this is moved outside of finally block to avert masking original exception, if any<NEW_LINE>if (!success) {<NEW_LINE>throw DataUtils.newMVStoreException(DataUtils.ERROR_TRANSACTION_ILLEGAL_STATE, "Transaction {0} concurrently modified while rollback to savepoint was in progress", transactionId);<NEW_LINE>}<NEW_LINE>} | rollbackTo(this, logId, savepointId); |
873,030 | public void save(ServerRow row, PSMatrixSaveContext saveContext, MatrixPartitionMeta meta, DataOutputStream out) throws IOException {<NEW_LINE>if (saveContext.cloneFirst()) {<NEW_LINE>row = (ServerRow) row.adaptiveClone();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>row.startWrite();<NEW_LINE>if (row instanceof ServerIntFloatRow) {<NEW_LINE>save((ServerIntFloatRow) <MASK><NEW_LINE>} else if (row instanceof ServerIntDoubleRow) {<NEW_LINE>save((ServerIntDoubleRow) row, saveContext, meta, out);<NEW_LINE>} else if (row instanceof ServerIntIntRow) {<NEW_LINE>save((ServerIntIntRow) row, saveContext, meta, out);<NEW_LINE>} else if (row instanceof ServerIntLongRow) {<NEW_LINE>save((ServerIntLongRow) row, saveContext, meta, out);<NEW_LINE>} else if (row instanceof ServerLongFloatRow) {<NEW_LINE>save((ServerLongFloatRow) row, saveContext, meta, out);<NEW_LINE>} else if (row instanceof ServerLongDoubleRow) {<NEW_LINE>save((ServerLongDoubleRow) row, saveContext, meta, out);<NEW_LINE>} else if (row instanceof ServerLongIntRow) {<NEW_LINE>save((ServerLongIntRow) row, saveContext, meta, out);<NEW_LINE>} else if (row instanceof ServerLongLongRow) {<NEW_LINE>save((ServerLongLongRow) row, saveContext, meta, out);<NEW_LINE>} else if (row instanceof ServerIntAnyRow) {<NEW_LINE>save((ServerIntAnyRow) row, saveContext, meta, out);<NEW_LINE>} else if (row instanceof ServerLongAnyRow) {<NEW_LINE>save((ServerLongAnyRow) row, saveContext, meta, out);<NEW_LINE>} else if (row instanceof ServerStringAnyRow) {<NEW_LINE>save((ServerStringAnyRow) row, saveContext, meta, out);<NEW_LINE>} else if (row instanceof ServerAnyAnyRow) {<NEW_LINE>save((ServerAnyAnyRow) row, saveContext, meta, out);<NEW_LINE>} else {<NEW_LINE>throw new IOException("Unknown vector type " + row.getRowType());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>row.endWrite();<NEW_LINE>}<NEW_LINE>} | row, saveContext, meta, out); |
429,050 | private void loadSkinFile(String f, JFrame frm) {<NEW_LINE>try {<NEW_LINE>File fsFile = new File(f);<NEW_LINE>if (fsFile.exists()) {<NEW_LINE>f = fsFile.toURI().toString();<NEW_LINE>}<NEW_LINE>if (f.contains("://") || f.startsWith("file:")) {<NEW_LINE>try {<NEW_LINE>// load Via URL loading<NEW_LINE>loadSkinFile(new URL(f<MASK><NEW_LINE>} catch (FileNotFoundException ex) {<NEW_LINE>String d = System.getProperty("dskin");<NEW_LINE>loadSkinFile(d, frm);<NEW_LINE>return;<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>loadSkinFile(getResourceAsStream(getClass(), DEFAULT_SKIN), frm);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>InputStream is = getResourceAsStream(getClass(), f);<NEW_LINE>if (is != null) {<NEW_LINE>loadSkinFile(is, frm);<NEW_LINE>} else {<NEW_LINE>loadSkinFile(getResourceAsStream(getClass(), DEFAULT_SKIN), frm);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Preferences pref = Preferences.userNodeForPackage(JavaSEPort.class);<NEW_LINE>pref.put("skin", f);<NEW_LINE>addSkinName(f);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>System.out.println("Failed loading the skin file: " + f);<NEW_LINE>t.printStackTrace();<NEW_LINE>Preferences pref = Preferences.userNodeForPackage(JavaSEPort.class);<NEW_LINE>pref.remove("skin");<NEW_LINE>}<NEW_LINE>} | ).openStream(), frm); |
574,924 | private boolean validateOwnership(final ImageTypeDTO imageType) throws ImageMgmtValidationException {<NEW_LINE>// Check if ownership record exists<NEW_LINE>if (CollectionUtils.isEmpty(imageType.getOwnerships()) || imageType.getOwnerships().size() < 2) {<NEW_LINE>log.error("Please specify at least two owners for the image type: {} ", imageType.getName());<NEW_LINE>throw new ImageMgmtValidationException(ErrorCode.BAD_REQUEST, String.format("Please specify" + " at least two owners for the image type: %s. ", imageType.getName()));<NEW_LINE>}<NEW_LINE>// Check if one of the owner is admin<NEW_LINE>if (!hasAdminRole(imageType)) {<NEW_LINE>log.error(<MASK><NEW_LINE>throw new ImageMgmtValidationException(ErrorCode.BAD_REQUEST, String.format("Please specify" + " at least one ADMIN owner for image type: %s. ", imageType.getName()));<NEW_LINE>}<NEW_LINE>// Ownership metadata must not contain duplicate owners.<NEW_LINE>if (hasDuplicateOwner(imageType)) {<NEW_LINE>log.error("The ownership data contains duplicate owners.");<NEW_LINE>throw new ImageMgmtValidationException(ErrorCode.BAD_REQUEST, "The ownership data contains duplicate owners.");<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | "Please specify at least one ADMIN owner for image type: {} ", imageType.getName()); |
369,807 | private void initButtons() {<NEW_LINE>buttonXneg = createJogButton("X-");<NEW_LINE>buttonXneg.addActionListener(event -> moveMachine(-1, 0, 0));<NEW_LINE>buttonXpos = createJogButton("X+");<NEW_LINE>buttonXpos.addActionListener(event -> moveMachine(1, 0, 0));<NEW_LINE>buttonYneg = createJogButton("Y-");<NEW_LINE>buttonYneg.addActionListener(event -> moveMachine(0, -1, 0));<NEW_LINE>buttonYpos = createJogButton("Y+");<NEW_LINE>buttonYpos.addActionListener(event -> moveMachine(0, 1, 0));<NEW_LINE>buttonZneg = createJogButton("Z-");<NEW_LINE>buttonZneg.addActionListener(event -> moveMachine(0, 0, -1));<NEW_LINE>buttonZpos = createJogButton("Z+");<NEW_LINE>buttonZpos.addActionListener(event -> moveMachine<MASK><NEW_LINE>} | (0, 0, 1)); |
1,597,196 | public final MergeMatchedContext mergeMatched() throws RecognitionException {<NEW_LINE>MergeMatchedContext _localctx = new MergeMatchedContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 46, RULE_mergeMatched);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(787);<NEW_LINE>match(WHEN);<NEW_LINE>setState(788);<NEW_LINE>match(MATCHED);<NEW_LINE>setState(791);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == AND_EXPR) {<NEW_LINE>{<NEW_LINE>setState(789);<NEW_LINE>match(AND_EXPR);<NEW_LINE>setState(790);<NEW_LINE>expression();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(794);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>do {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(793);<NEW_LINE>mergeMatchedItem();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(796);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>} while (_la == THEN);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE><MASK><NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _errHandler.reportError(this, re); |
1,803,254 | public void loadProperties(Properties properties) {<NEW_LINE>Reader reader = new Reader(properties);<NEW_LINE>this.server = reader.get("ebean.redis.server", server);<NEW_LINE>this.port = reader.getInt("ebean.redis.port", port);<NEW_LINE>this.ssl = reader.getBool("ebean.redis.ssl", ssl);<NEW_LINE>this.minIdle = reader.getInt("ebean.redis.minIdle", minIdle);<NEW_LINE>this.maxIdle = reader.getInt("ebean.redis.maxIdle", maxIdle);<NEW_LINE>this.maxTotal = reader.getInt("ebean.redis.maxTotal", maxTotal);<NEW_LINE>this.maxWaitMillis = reader.getLong("ebean.redis.maxWaitMillis", maxWaitMillis);<NEW_LINE>this.timeout = <MASK><NEW_LINE>this.username = reader.get("ebean.redis.username", username);<NEW_LINE>this.password = reader.get("ebean.redis.password", password);<NEW_LINE>this.blockWhenExhausted = reader.getBool("ebean.redis.blockWhenExhausted", blockWhenExhausted);<NEW_LINE>} | reader.getInt("ebean.redis.timeout", timeout); |
1,806,623 | private void createLocFileSymlinks(final IlluminaFileUtil fileUtil, final int lane) {<NEW_LINE>final File baseFile = new File(BASECALLS_DIR.getParentFile().getAbsolutePath() + File.separator + AbstractIlluminaPositionFileReader.S_LOCS_FILE);<NEW_LINE>final File newFileBase = new File(baseFile.getParent() + File.separator + IlluminaFileUtil.longLaneStr(lane) + File.separator);<NEW_LINE>if (baseFile.exists()) {<NEW_LINE>boolean success = true;<NEW_LINE>if (!newFileBase.exists()) {<NEW_LINE>success = newFileBase.mkdirs();<NEW_LINE>}<NEW_LINE>if (success) {<NEW_LINE>for (final Integer tile : fileUtil.getExpectedTiles()) {<NEW_LINE>final String newName = newFileBase + File.separator + String.<MASK><NEW_LINE>final ProcessExecutor.ExitStatusAndOutput output = ProcessExecutor.executeAndReturnInterleavedOutput(new String[] { "ln", "-fs", baseFile.getAbsolutePath(), newName });<NEW_LINE>if (output.exitStatus != 0) {<NEW_LINE>throw new PicardException("Could not create symlink: " + output.stdout);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new PicardException(String.format("Could not create lane directory: %s.", newFileBase.getAbsolutePath()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new PicardException(String.format("Locations file %s does not exist.", baseFile.getAbsolutePath()));<NEW_LINE>}<NEW_LINE>} | format("s_%d_%d.locs", lane, tile); |
385,186 | public Builder config(Config config) {<NEW_LINE>config.get("optional").asBoolean().ifPresent(this::optional);<NEW_LINE>config.get("authenticate").asBoolean(<MASK><NEW_LINE>config.get("propagate").asBoolean().ifPresent(this::propagate);<NEW_LINE>config.get("allow-impersonation").asBoolean().ifPresent(this::allowImpersonation);<NEW_LINE>config.get("principal-type").asString().map(SubjectType::valueOf).ifPresent(this::subjectType);<NEW_LINE>config.get("atn-token.handler").as(TokenHandler::create).ifPresent(this::atnTokenHandler);<NEW_LINE>config.get("atn-token").ifExists(this::verifyKeys);<NEW_LINE>config.get("atn-token.jwt-audience").asString().ifPresent(this::expectedAudience);<NEW_LINE>config.get("atn-token.verify-signature").asBoolean().ifPresent(this::verifySignature);<NEW_LINE>config.get("sign-token").ifExists(outbound -> outboundConfig(OutboundConfig.create(outbound)));<NEW_LINE>config.get("sign-token").ifExists(this::outbound);<NEW_LINE>config.get("allow-unsigned").asBoolean().ifPresent(this::allowUnsigned);<NEW_LINE>config.get("use-jwt-groups").asBoolean().ifPresent(this::useJwtGroups);<NEW_LINE>return this;<NEW_LINE>} | ).ifPresent(this::authenticate); |
1,000,407 | public boolean matchesAsSource(final IZoomSource zoomSource) {<NEW_LINE>if (tableRecordIdTarget) {<NEW_LINE>// the source always matches if the target is ReferenceTarget<NEW_LINE>logger.debug("matchesAsSource - return true because tableRecordIdTarget=true; this={}", this);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!zoomSource.isGenericZoomOrigin()) {<NEW_LINE>logger.warn("matchesAsSource - return false because zoomSource.isGenericZoomOrigin()==false; this={}; zoomSource={}", this, zoomSource);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final String keyColumnName = zoomSource.getKeyColumnNameOrNull();<NEW_LINE>if (Check.isEmpty(keyColumnName, true)) {<NEW_LINE>logger.warn("matchesAsSource - return false because zoomSource.getKeyColumnNameOrNull()==null; this={}; zoomSource={}", this, zoomSource);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final String whereClause = tableRefInfo.getWhereClause();<NEW_LINE>if (Check.isEmpty(whereClause, true)) {<NEW_LINE>logger.debug("matchesAsSource - return true because tableRefInfo.whereClause is empty; this={}", this);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final String parsedWhere = parseWhereClause(zoomSource, whereClause, false);<NEW_LINE>if (Check.isEmpty(parsedWhere)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final StringBuilder whereClauseEffective = new StringBuilder();<NEW_LINE>whereClauseEffective.append(parsedWhere);<NEW_LINE>whereClauseEffective.append(" AND ( ").append(keyColumnName).append("=").append(zoomSource.getRecord_ID()).append(" )");<NEW_LINE>final boolean match = new Query(zoomSource.getCtx(), zoomSource.getTableName(), whereClauseEffective.toString(), zoomSource.getTrxName()).anyMatch();<NEW_LINE>logger.debug(<MASK><NEW_LINE>return match;<NEW_LINE>} | "whereClause='{}' matches source='{}': {}", parsedWhere, zoomSource, match); |
1,504,272 | private String buildGlobalDictAndEncodeSourceTable(EtlTable table, long tableId) {<NEW_LINE>// dict column map<NEW_LINE>MultiValueMap dictColumnMap = new MultiValueMap();<NEW_LINE>for (String dictColumn : tableToBitmapDictColumns.get(tableId)) {<NEW_LINE>dictColumnMap.put(dictColumn, null);<NEW_LINE>}<NEW_LINE>// hive db and tables<NEW_LINE>EtlFileGroup fileGroup = table.fileGroups.get(0);<NEW_LINE>List<String> intermediateTableColumnList = fileGroup.fileFieldNames;<NEW_LINE>String sourceHiveDBTableName = fileGroup.hiveDbTableName;<NEW_LINE>String starrocksHiveDB = sourceHiveDBTableName.split("\\.")[0];<NEW_LINE>String taskId = etlJobConfig.outputPath.substring(etlJobConfig.outputPath.lastIndexOf("/") + 1);<NEW_LINE>String globalDictTableName = String.format(EtlJobConfig.GLOBAL_DICT_TABLE_NAME, tableId);<NEW_LINE>String dorisGlobalDictTableName = String.format(EtlJobConfig.DORIS_GLOBAL_DICT_TABLE_NAME, tableId);<NEW_LINE>String distinctKeyTableName = String.format(EtlJobConfig.DISTINCT_KEY_TABLE_NAME, tableId, taskId);<NEW_LINE>String starrocksIntermediateHiveTable = String.format(EtlJobConfig.STARROCKS_INTERMEDIATE_HIVE_TABLE_NAME, tableId, taskId);<NEW_LINE>String sourceHiveFilter = fileGroup.where;<NEW_LINE>// others<NEW_LINE>List<String<MASK><NEW_LINE>int buildConcurrency = 1;<NEW_LINE>List<String> veryHighCardinalityColumn = Lists.newArrayList();<NEW_LINE>int veryHighCardinalityColumnSplitNum = 1;<NEW_LINE>LOG.info("global dict builder args, dictColumnMap: " + dictColumnMap + ", intermediateTableColumnList: " + intermediateTableColumnList + ", sourceHiveDBTableName: " + sourceHiveDBTableName + ", sourceHiveFilter: " + sourceHiveFilter + ", distinctKeyTableName: " + distinctKeyTableName + ", globalDictTableName: " + globalDictTableName + ", starrocksIntermediateHiveTable: " + starrocksIntermediateHiveTable);<NEW_LINE>try {<NEW_LINE>GlobalDictBuilder globalDictBuilder = new GlobalDictBuilder(dictColumnMap, intermediateTableColumnList, mapSideJoinColumns, sourceHiveDBTableName, sourceHiveFilter, starrocksHiveDB, distinctKeyTableName, globalDictTableName, starrocksIntermediateHiveTable, buildConcurrency, veryHighCardinalityColumn, veryHighCardinalityColumnSplitNum, spark);<NEW_LINE>globalDictBuilder.checkGlobalDictTableName(dorisGlobalDictTableName);<NEW_LINE>globalDictBuilder.createHiveIntermediateTable();<NEW_LINE>globalDictBuilder.extractDistinctColumn();<NEW_LINE>globalDictBuilder.buildGlobalDict();<NEW_LINE>globalDictBuilder.encodeStarRocksIntermediateHiveTable();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>return String.format("%s.%s", starrocksHiveDB, starrocksIntermediateHiveTable);<NEW_LINE>} | > mapSideJoinColumns = Lists.newArrayList(); |
1,173,373 | final UnlabelParameterVersionResult executeUnlabelParameterVersion(UnlabelParameterVersionRequest unlabelParameterVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(unlabelParameterVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UnlabelParameterVersionRequest> request = null;<NEW_LINE>Response<UnlabelParameterVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UnlabelParameterVersionRequestProtocolMarshaller(protocolFactory).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, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UnlabelParameterVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UnlabelParameterVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UnlabelParameterVersionResultJsonUnmarshaller());<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(unlabelParameterVersionRequest)); |
1,101,879 | public static EObject hibernate(EProc self, EObject a1, EObject a2, EObject a3) {<NEW_LINE>EAtom m = a1.testAtom();<NEW_LINE>EAtom f = a2.testAtom();<NEW_LINE>ESeq a = a3.testSeq();<NEW_LINE>if (m == null || f == null || a == null) {<NEW_LINE>throw ERT.badarg(a1, a2, a3);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>EFun target = EModuleManager.resolve(new FunID(m, f, arity));<NEW_LINE>if (target == null) {<NEW_LINE>throw new ErlangUndefined(m, f, new ESmall(arity));<NEW_LINE>}<NEW_LINE>self.tail = target;<NEW_LINE>a = a.reverse();<NEW_LINE>switch(arity) {<NEW_LINE>default:<NEW_LINE>throw new NotImplemented("hibernate w/" + arity + " args");<NEW_LINE>case 7:<NEW_LINE>self.arg6 = a.head();<NEW_LINE>a = a.tail();<NEW_LINE>case 6:<NEW_LINE>self.arg5 = a.head();<NEW_LINE>a = a.tail();<NEW_LINE>case 5:<NEW_LINE>self.arg4 = a.head();<NEW_LINE>a = a.tail();<NEW_LINE>case 4:<NEW_LINE>self.arg3 = a.head();<NEW_LINE>a = a.tail();<NEW_LINE>case 3:<NEW_LINE>self.arg2 = a.head();<NEW_LINE>a = a.tail();<NEW_LINE>case 2:<NEW_LINE>self.arg1 = a.head();<NEW_LINE>a = a.tail();<NEW_LINE>case 1:<NEW_LINE>// a = a.tail();<NEW_LINE>self.arg0 = a.head();<NEW_LINE>case 0:<NEW_LINE>}<NEW_LINE>throw ErjangHibernateException.INSTANCE;<NEW_LINE>} | int arity = a.length(); |
1,283,286 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.ibm.ws.sib.msgstore.transactions.TransactionCallback#afterCompletion(com.ibm.ws.sib.msgstore.transactions.Transaction, boolean)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void afterCompletion(TransactionCommon transaction, boolean committed) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "afterCompletion", new Object[] { transaction, <MASK><NEW_LINE>if (committed) {<NEW_LINE>// Register the control adapters after the destination has been committed.<NEW_LINE>registerControlAdapters();<NEW_LINE>// Move the destination into ACTIVE state<NEW_LINE>destinationManager.activateDestination(BaseDestinationHandler.this);<NEW_LINE>// sanjay liberty change<NEW_LINE>// if (isPubSub())<NEW_LINE>// {<NEW_LINE>// try<NEW_LINE>// {<NEW_LINE>// messageProcessor.getProxyHandler().topicSpaceCreatedEvent(<NEW_LINE>// BaseDestinationHandler.this);<NEW_LINE>// }<NEW_LINE>// catch (SIResourceException e)<NEW_LINE>// {<NEW_LINE>// // Shouldn't occur as the destination now exists.<NEW_LINE>// FFDCFilter.processException(<NEW_LINE>// e,<NEW_LINE>// "com.ibm.ws.sib.processor.impl.BaseDestinationHandler.DestinationAddTransactionCallback.afterCompletion",<NEW_LINE>// "1:4023:1.700.3.45",<NEW_LINE>// this);<NEW_LINE>//<NEW_LINE>// SibTr.exception(tc, e);<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// If this is a local Queue, advertise in WLM<NEW_LINE>if (_ptoPRealization != null)<NEW_LINE>_ptoPRealization.registerDestination(hasLocal(), isDeleted());<NEW_LINE>} else {<NEW_LINE>// !committed<NEW_LINE>destinationManager.removeDestination(BaseDestinationHandler.this);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "afterCompletion");<NEW_LINE>} | Boolean.valueOf(committed) }); |
609,096 | public void execute(CommandContext commandContext, PlanItemInstanceEntity planItemInstanceEntity) {<NEW_LINE>RepetitionRule repetitionRule = ExpressionUtil.getRepetitionRule(planItemInstanceEntity);<NEW_LINE>if (repetitionRule != null && ExpressionUtil.evaluateRepetitionRule(commandContext, planItemInstanceEntity, planItemInstanceEntity.getStagePlanItemInstanceEntity())) {<NEW_LINE>PlanItemInstanceEntity eventPlanItemInstanceEntity = PlanItemInstanceUtil.copyAndInsertPlanItemInstance(commandContext, planItemInstanceEntity, false, false);<NEW_LINE><MASK><NEW_LINE>CmmnEngineAgenda agenda = CommandContextUtil.getAgenda(commandContext);<NEW_LINE>agenda.planCreatePlanItemInstanceWithoutEvaluationOperation(eventPlanItemInstanceEntity);<NEW_LINE>agenda.planOccurPlanItemInstanceOperation(eventPlanItemInstanceEntity);<NEW_LINE>CommandContextUtil.getCmmnEngineConfiguration(commandContext).getListenerNotificationHelper().executeLifecycleListeners(commandContext, planItemInstanceEntity, null, PlanItemInstanceState.AVAILABLE);<NEW_LINE>} else {<NEW_LINE>CommandContextUtil.getAgenda(commandContext).planOccurPlanItemInstanceOperation(planItemInstanceEntity);<NEW_LINE>}<NEW_LINE>} | eventPlanItemInstanceEntity.setState(PlanItemInstanceState.AVAILABLE); |
616,288 | public static FeedbackQuestionAttributes valueOf(FeedbackQuestion fq) {<NEW_LINE>FeedbackQuestionAttributes faq = new FeedbackQuestionAttributes();<NEW_LINE>faq<MASK><NEW_LINE>faq.courseId = fq.getCourseId();<NEW_LINE>faq.questionDetails = deserializeFeedbackQuestionDetails(fq.getQuestionText(), fq.getQuestionType());<NEW_LINE>faq.questionDescription = fq.getQuestionDescription();<NEW_LINE>faq.questionNumber = fq.getQuestionNumber();<NEW_LINE>faq.giverType = fq.getGiverType();<NEW_LINE>faq.recipientType = fq.getRecipientType();<NEW_LINE>faq.numberOfEntitiesToGiveFeedbackTo = fq.getNumberOfEntitiesToGiveFeedbackTo();<NEW_LINE>if (fq.getShowResponsesTo() != null) {<NEW_LINE>faq.showResponsesTo = new ArrayList<>(fq.getShowResponsesTo());<NEW_LINE>}<NEW_LINE>if (fq.getShowGiverNameTo() != null) {<NEW_LINE>faq.showGiverNameTo = new ArrayList<>(fq.getShowGiverNameTo());<NEW_LINE>}<NEW_LINE>if (fq.getShowRecipientNameTo() != null) {<NEW_LINE>faq.showRecipientNameTo = new ArrayList<>(fq.getShowRecipientNameTo());<NEW_LINE>}<NEW_LINE>faq.createdAt = fq.getCreatedAt();<NEW_LINE>faq.updatedAt = fq.getUpdatedAt();<NEW_LINE>faq.feedbackQuestionId = fq.getId();<NEW_LINE>return faq;<NEW_LINE>} | .feedbackSessionName = fq.getFeedbackSessionName(); |
423,064 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String applicationFlag) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Application application = emc.find(applicationFlag, Application.class);<NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionEntityNotExist(applicationFlag, Application.class);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, application)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, application);<NEW_LINE>}<NEW_LINE>DataItemConverter<Item> converter = new DataItemConverter<>(Item.class);<NEW_LINE>List<String> ids = new ArrayList<>();<NEW_LINE>WorkCompleted workCompleted = null;<NEW_LINE>int count = 0;<NEW_LINE>do {<NEW_LINE>ids = this.list(business, application);<NEW_LINE>for (String id : ids) {<NEW_LINE>workCompleted = emc.find(id, WorkCompleted.class);<NEW_LINE>if (null != workCompleted) {<NEW_LINE>emc.beginTransaction(WorkCompleted.class);<NEW_LINE>List<Item> items = this.items(business, workCompleted);<NEW_LINE>List<Record> records = emc.listEqual(Record.class, Record.job_FIELDNAME, workCompleted.getJob());<NEW_LINE>records = records.stream().sorted(Comparator.comparing(Record::getOrder, Comparator.nullsLast(Long::compareTo))).collect(Collectors.toList());<NEW_LINE>workCompleted.getProperties().setRecordList(records);<NEW_LINE>JsonElement <MASK><NEW_LINE>workCompleted.getProperties().setData(gson.fromJson(jsonElement, Data.class));<NEW_LINE>workCompleted.setMerged(true);<NEW_LINE>emc.commit();<NEW_LINE>emc.beginTransaction(Item.class);<NEW_LINE>emc.beginTransaction(Record.class);<NEW_LINE>for (Item item : items) {<NEW_LINE>emc.remove(item, CheckRemoveType.all);<NEW_LINE>}<NEW_LINE>for (Record record : records) {<NEW_LINE>emc.remove(record, CheckRemoveType.all);<NEW_LINE>}<NEW_LINE>emc.commit();<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (ListTools.isNotEmpty(ids));<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setValue(count);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | jsonElement = converter.assemble(items); |
87,967 | public void arrangeSheet(short cmd) throws Exception {<NEW_LINE>JInternalFrame[] frames = desk.getAllFrames();<NEW_LINE>if (frames.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int x = 0, y = 0, w = 450, h = 280;<NEW_LINE>switch(cmd) {<NEW_LINE>case GC.iCASCADE:<NEW_LINE>for (int i = 0; i < frames.length; i++) {<NEW_LINE>if (!frames[i].isIcon()) {<NEW_LINE>frames[i].setMaximum(false);<NEW_LINE>frames[i].setBounds(x, y, w, h);<NEW_LINE>frames[i].setSelected(true);<NEW_LINE>x += 20;<NEW_LINE>y += 20;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case GC.iTILEHORIZONTAL:<NEW_LINE><MASK><NEW_LINE>w = deskWidth / frames.length;<NEW_LINE>h = desk.getHeight();<NEW_LINE>for (int i = 0; i < frames.length; i++) {<NEW_LINE>x = i * w;<NEW_LINE>if (!frames[i].isIcon()) {<NEW_LINE>frames[i].setMaximum(false);<NEW_LINE>frames[i].setBounds(x, y, w, h);<NEW_LINE>frames[i].update(frames[i].getGraphics());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case GC.iTILEVERTICAL:<NEW_LINE>int deskHeight = desk.getHeight();<NEW_LINE>h = deskHeight / frames.length;<NEW_LINE>w = desk.getWidth();<NEW_LINE>for (int i = 0; i < frames.length; i++) {<NEW_LINE>y = i * h;<NEW_LINE>if (!frames[i].isIcon()) {<NEW_LINE>frames[i].setMaximum(false);<NEW_LINE>frames[i].setBounds(x, y, w, h);<NEW_LINE>frames[i].update(frames[i].getGraphics());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case GC.iLAYER:<NEW_LINE>JInternalFrame f = desk.getSelectedFrame();<NEW_LINE>if (f != null) {<NEW_LINE>f.setMaximum(true);<NEW_LINE>f.setBounds(0, 0, desk.getWidth(), desk.getHeight());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>desk.invalidate();<NEW_LINE>desk.update(desk.getGraphics());<NEW_LINE>} | int deskWidth = desk.getWidth(); |
1,474,217 | public Result render(Context ctx, Throwable cause, StatusCode code) {<NEW_LINE>try {<NEW_LINE>List<Frame> frames = Frame.toFrames(locator, cause);<NEW_LINE>if (frames.isEmpty()) {<NEW_LINE>return Result.skip();<NEW_LINE>}<NEW_LINE>StringWriter stacktrace = new StringWriter();<NEW_LINE>cause.printStackTrace(new PrintWriter(stacktrace));<NEW_LINE>Map<String, Object> model = new HashMap<>();<NEW_LINE>String cpath = ctx.getContextPath();<NEW_LINE>if (cpath.equals("/")) {<NEW_LINE>cpath = "";<NEW_LINE>}<NEW_LINE>model.put("stylesheet", cpath + "/whoops/css/whoops.base.css");<NEW_LINE>model.put("prettify", cpath + "/whoops/js/prettify.min.js");<NEW_LINE>model.put("clipboard", cpath + "/whoops/js/clipboard.min.js");<NEW_LINE>model.put("zepto", cpath + "/whoops/js/zepto.min.js");<NEW_LINE>model.put("javascript", cpath + "/whoops/js/whoops.base.js");<NEW_LINE><MASK><NEW_LINE>model.put("cause", cause);<NEW_LINE>model.put("causeName", Arrays.asList(cause.getClass().getName().split("\\.")));<NEW_LINE>model.put("stacktrace", stacktrace.toString());<NEW_LINE>model.put("code", code);<NEW_LINE>// environment<NEW_LINE>model.put("env", environment(ctx, code));<NEW_LINE>StringWriter writer = new StringWriter();<NEW_LINE>engine.getTemplate("layout").evaluate(writer, model);<NEW_LINE>return Result.success(writer.toString());<NEW_LINE>} catch (Exception x) {<NEW_LINE>return Result.failure(x);<NEW_LINE>}<NEW_LINE>} | model.put("frames", frames); |
753,978 | public void readFromFile(java.io.File configurationFile) {<NEW_LINE>try {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>if (configurationFile.getName().endsWith(".xml")) {<NEW_LINE>properties.loadFromXML(new FileInputStream(configurationFile));<NEW_LINE>} else {<NEW_LINE>properties.load(new FileInputStream(configurationFile));<NEW_LINE>}<NEW_LINE>Enumeration keys = properties.propertyNames();<NEW_LINE>while (keys.hasMoreElements()) {<NEW_LINE>java.lang.String key = (java.lang.String) keys.nextElement();<NEW_LINE>java.lang.String[] values = properties.getProperty<MASK><NEW_LINE>@Var<NEW_LINE>boolean foundValue = false;<NEW_LINE>for (int i = 0; i < options.size(); i++) {<NEW_LINE>CommandOption option = (CommandOption) options.get(i);<NEW_LINE>if (option.name.equals(key)) {<NEW_LINE>foundValue = true;<NEW_LINE>option.parseArg(values, 0);<NEW_LINE>option.invoked = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Unable to process configuration file: " + e.getMessage());<NEW_LINE>}<NEW_LINE>} | (key).split("\\s+"); |
142,563 | public void encode(SerializationContext context, UaEncoder encoder, SubscriptionDiagnosticsDataType value) {<NEW_LINE>encoder.writeNodeId("SessionId", value.getSessionId());<NEW_LINE>encoder.writeUInt32("SubscriptionId", value.getSubscriptionId());<NEW_LINE>encoder.writeByte("Priority", value.getPriority());<NEW_LINE>encoder.writeDouble("PublishingInterval", value.getPublishingInterval());<NEW_LINE>encoder.writeUInt32("MaxKeepAliveCount", value.getMaxKeepAliveCount());<NEW_LINE>encoder.writeUInt32("MaxLifetimeCount", value.getMaxLifetimeCount());<NEW_LINE>encoder.writeUInt32("MaxNotificationsPerPublish", value.getMaxNotificationsPerPublish());<NEW_LINE>encoder.writeBoolean("PublishingEnabled", value.getPublishingEnabled());<NEW_LINE>encoder.writeUInt32("ModifyCount", value.getModifyCount());<NEW_LINE>encoder.writeUInt32("EnableCount", value.getEnableCount());<NEW_LINE>encoder.writeUInt32("DisableCount", value.getDisableCount());<NEW_LINE>encoder.writeUInt32("RepublishRequestCount", value.getRepublishRequestCount());<NEW_LINE>encoder.writeUInt32("RepublishMessageRequestCount", value.getRepublishMessageRequestCount());<NEW_LINE>encoder.writeUInt32("RepublishMessageCount", value.getRepublishMessageCount());<NEW_LINE>encoder.writeUInt32("TransferRequestCount", value.getTransferRequestCount());<NEW_LINE>encoder.writeUInt32("TransferredToAltClientCount", value.getTransferredToAltClientCount());<NEW_LINE>encoder.writeUInt32("TransferredToSameClientCount", value.getTransferredToSameClientCount());<NEW_LINE>encoder.writeUInt32("PublishRequestCount", value.getPublishRequestCount());<NEW_LINE>encoder.writeUInt32("DataChangeNotificationsCount", value.getDataChangeNotificationsCount());<NEW_LINE>encoder.writeUInt32("EventNotificationsCount", value.getEventNotificationsCount());<NEW_LINE>encoder.writeUInt32("NotificationsCount", value.getNotificationsCount());<NEW_LINE>encoder.writeUInt32(<MASK><NEW_LINE>encoder.writeUInt32("CurrentKeepAliveCount", value.getCurrentKeepAliveCount());<NEW_LINE>encoder.writeUInt32("CurrentLifetimeCount", value.getCurrentLifetimeCount());<NEW_LINE>encoder.writeUInt32("UnacknowledgedMessageCount", value.getUnacknowledgedMessageCount());<NEW_LINE>encoder.writeUInt32("DiscardedMessageCount", value.getDiscardedMessageCount());<NEW_LINE>encoder.writeUInt32("MonitoredItemCount", value.getMonitoredItemCount());<NEW_LINE>encoder.writeUInt32("DisabledMonitoredItemCount", value.getDisabledMonitoredItemCount());<NEW_LINE>encoder.writeUInt32("MonitoringQueueOverflowCount", value.getMonitoringQueueOverflowCount());<NEW_LINE>encoder.writeUInt32("NextSequenceNumber", value.getNextSequenceNumber());<NEW_LINE>encoder.writeUInt32("EventQueueOverflowCount", value.getEventQueueOverflowCount());<NEW_LINE>} | "LatePublishRequestCount", value.getLatePublishRequestCount()); |
321,828 | // If the class of an object is "type", the object must be a class and as "type" is the base<NEW_LINE>// metaclass, which defines only certain type slots, it can not have inherited other<NEW_LINE>// attributes via metaclass inheritance. For all non-type-slot attributes it therefore<NEW_LINE>// suffices to only check for inheritance via super classes.<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>@Specialization(guards = { "isTypeGetAttribute(type)", "isBuiltinTypeType(type)", "!isTypeSlot(name)" }, limit = "1")<NEW_LINE>static final Object doBuiltinTypeType(VirtualFrame frame, Object object, String name, @Cached GetClassNode getClass, @Bind("getClass.execute(object)") Object type, @Cached LookupAttributeInMRONode.Dynamic readNode, @Cached ConditionProfile valueFound, @Cached("create(Get)") LookupInheritedSlotNode lookupValueGet, @Cached ConditionProfile noGetMethod, @Cached CallTernaryMethodNode invokeValueGet, @Shared("errorProfile") @Cached IsBuiltinClassProfile errorProfile) {<NEW_LINE>Object value = readNode.execute(object, name);<NEW_LINE>if (valueFound.profile(value != PNone.NO_VALUE)) {<NEW_LINE>Object <MASK><NEW_LINE>if (noGetMethod.profile(valueGet == PNone.NO_VALUE)) {<NEW_LINE>return value;<NEW_LINE>} else if (PGuards.isCallableOrDescriptor(valueGet)) {<NEW_LINE>try {<NEW_LINE>return invokeValueGet.execute(frame, valueGet, value, PNone.NONE, object);<NEW_LINE>} catch (PException e) {<NEW_LINE>e.expect(PythonBuiltinClassType.AttributeError, errorProfile);<NEW_LINE>return PNone.NO_VALUE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return PNone.NO_VALUE;<NEW_LINE>} | valueGet = lookupValueGet.execute(value); |
1,603,125 | final DBClusterSnapshotAttributesResult executeDescribeDBClusterSnapshotAttributes(DescribeDBClusterSnapshotAttributesRequest describeDBClusterSnapshotAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDBClusterSnapshotAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDBClusterSnapshotAttributesRequest> request = null;<NEW_LINE>Response<DBClusterSnapshotAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDBClusterSnapshotAttributesRequestMarshaller().marshall(super.beforeMarshalling(describeDBClusterSnapshotAttributesRequest));<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, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDBClusterSnapshotAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBClusterSnapshotAttributesResult> responseHandler = new StaxResponseHandler<DBClusterSnapshotAttributesResult>(new DBClusterSnapshotAttributesResultStaxUnmarshaller());<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); |
362,158 | public long recv_initiateFlush() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException {<NEW_LINE>initiateFlush_result result = new initiateFlush_result();<NEW_LINE>receiveBase(result, "initiateFlush");<NEW_LINE>if (result.isSetSuccess()) {<NEW_LINE>return result.success;<NEW_LINE>}<NEW_LINE>if (result.sec != null) {<NEW_LINE>throw result.sec;<NEW_LINE>}<NEW_LINE>if (result.tope != null) {<NEW_LINE>throw result.tope;<NEW_LINE>}<NEW_LINE>if (result.tnase != null) {<NEW_LINE>throw result.tnase;<NEW_LINE>}<NEW_LINE>throw new org.apache.thrift.TApplicationException(org.apache.<MASK><NEW_LINE>} | thrift.TApplicationException.MISSING_RESULT, "initiateFlush failed: unknown result"); |
342,905 | public Boolean call(String question) {<NEW_LINE>final Stage dialogStage = new Stage();<NEW_LINE>dialogStage.initModality(Modality.WINDOW_MODAL);<NEW_LINE>dialogStage.initOwner(stage);<NEW_LINE>// NOI18N<NEW_LINE>ResourceBundle r = NbBundle.getBundle(NbBrowsers.class);<NEW_LINE>// NOI18N<NEW_LINE>dialogStage.setTitle(r.getString("ConfirmTitle"));<NEW_LINE>// NOI18N<NEW_LINE>final Button ok = new Button(r.getString("ConfirmOKButton"));<NEW_LINE>// NOI18N<NEW_LINE>final Button cancel = new Button(r.getString("ConfirmCancelButton"));<NEW_LINE>final Text text = new Text(question);<NEW_LINE>final Insets ins = new Insets(10);<NEW_LINE>final VBox box = new VBox();<NEW_LINE>box.setAlignment(Pos.CENTER);<NEW_LINE>box.setSpacing(10);<NEW_LINE>box.setPadding(ins);<NEW_LINE>final HBox buttons = new HBox(10);<NEW_LINE>buttons.getChildren().addAll(ok, cancel);<NEW_LINE>buttons.setAlignment(Pos.CENTER);<NEW_LINE>buttons.setPadding(ins);<NEW_LINE>box.getChildren().addAll(text, buttons);<NEW_LINE>dialogStage.setScene(new Scene(box));<NEW_LINE>ok.setCancelButton(false);<NEW_LINE>final boolean[] res = new boolean[1];<NEW_LINE>ok.setOnAction(new CloseDialogHandler(dialogStage, res));<NEW_LINE>cancel.setCancelButton(true);<NEW_LINE>cancel.setOnAction(<MASK><NEW_LINE>dialogStage.centerOnScreen();<NEW_LINE>dialogStage.showAndWait();<NEW_LINE>return res[0];<NEW_LINE>} | new CloseDialogHandler(dialogStage, null)); |
322,889 | private void writeServiceIndex(SortedMap<String, SortedMap<String, Set<String>>> serviceImpls, final Map<String, Integer> servicePositions) throws IOException {<NEW_LINE>try (PrintWriter pw = new PrintWriter(serviceOutput, "UTF-8")) {<NEW_LINE>for (Map.Entry<String, SortedMap<String, Set<String>>> mainEntry : serviceImpls.entrySet()) {<NEW_LINE>String path = mainEntry.getKey();<NEW_LINE>for (Map.Entry<String, Set<String>> entry : mainEntry.getValue().entrySet()) {<NEW_LINE>pw.print("SERVICE " + entry.getKey());<NEW_LINE>if (path.length() > 0) {<NEW_LINE>pw.println(" under " + path);<NEW_LINE>} else {<NEW_LINE>pw.println();<NEW_LINE>}<NEW_LINE>SortedSet<String> impls = new TreeSet<>(new ServiceComparator(servicePositions));<NEW_LINE>impls.addAll(entry.getValue());<NEW_LINE>Set<String> masked = new HashSet<>();<NEW_LINE>for (String impl : impls) {<NEW_LINE>if (impl.startsWith("#-")) {<NEW_LINE>masked.add(impl);<NEW_LINE>masked.add(impl.substring(2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>impls.removeAll(masked);<NEW_LINE>for (String impl : impls) {<NEW_LINE>if (servicePositions.containsKey(impl)) {<NEW_LINE>impl += <MASK><NEW_LINE>}<NEW_LINE>pw.println(" PROVIDER " + impl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log(serviceOutput + ": service index written");<NEW_LINE>} | " @" + servicePositions.get(impl); |
1,032,053 | public static <T extends ImageGray<T>, D extends ImageGray<D>> FeaturePyramid<T, D> harrisPyramid(int extractRadius, float detectThreshold, int maxFeatures, Class<T> imageType, Class<D> derivType) {<NEW_LINE>GradientCornerIntensity<D> harris = FactoryIntensityPointAlg.harris(extractRadius, 0.04f, false, derivType);<NEW_LINE>GeneralFeatureIntensity<T, D> intensity = new WrapperGradientCornerIntensity<>(harris);<NEW_LINE>NonMaxSuppression extractorMin = intensity.localMinimums() ? FactoryFeatureExtractor.nonmax(ConfigExtract.min(extractRadius, detectThreshold, extractRadius, true)) : null;<NEW_LINE>NonMaxSuppression extractorMax = intensity.localMaximums() ? FactoryFeatureExtractor.nonmax(ConfigExtract.max(extractRadius, detectThreshold, extractRadius, true)) : null;<NEW_LINE>FeatureSelectLimitIntensity<Point2D_I16> selector = new FeatureSelectNBest<>(new SampleIntensityImage.I16());<NEW_LINE>GeneralFeatureDetector<T, D> detector = new GeneralFeatureDetector<>(intensity, extractorMin, extractorMax, selector);<NEW_LINE>detector.setFeatureLimit(maxFeatures);<NEW_LINE>AnyImageDerivative<T, D> deriv = GImageDerivativeOps.derivativeForScaleSpace(imageType, derivType);<NEW_LINE>return new FeaturePyramid<<MASK><NEW_LINE>} | >(detector, deriv, 2); |
1,524,129 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>maxAllowedLinesLabel = new javax.swing.JLabel();<NEW_LINE>maxAllowedLinesSpinner = new javax.swing.JSpinner();<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(maxAllowedLinesLabel, org.openide.util.NbBundle.getMessage(InterfaceLinesCustomizer.class, "InterfaceLinesCustomizer.maxAllowedLinesLabel.text"));<NEW_LINE>maxAllowedLinesSpinner.setModel(new javax.swing.SpinnerNumberModel(100, 1, 1000, 1));<NEW_LINE>maxAllowedLinesSpinner.addChangeListener(new javax.swing.event.ChangeListener() {<NEW_LINE><NEW_LINE>public void stateChanged(javax.swing.event.ChangeEvent evt) {<NEW_LINE>maxAllowedLinesSpinnerStateChanged(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(maxAllowedLinesLabel).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(maxAllowedLinesSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap(javax.swing.GroupLayout.<MASK><NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(maxAllowedLinesLabel).addComponent(maxAllowedLinesSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));<NEW_LINE>} | DEFAULT_SIZE, Short.MAX_VALUE))); |
1,283,373 | public String sendHttpJsonDownstreamMessage(String destination, Message message) throws IOException {<NEW_LINE>JSONObject jsonBody = new JSONObject();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>jsonBody.putOpt(PARAM_COLLAPSE_KEY, message.getCollapseKey());<NEW_LINE>jsonBody.putOpt(PARAM_RESTRICTED_PACKAGE_NAME, message.getRestrictedPackageName());<NEW_LINE>jsonBody.putOpt(PARAM_TIME_TO_LIVE, message.getTimeToLive());<NEW_LINE>jsonBody.putOpt(PARAM_DELAY_WHILE_IDLE, message.isDelayWhileIdle());<NEW_LINE>jsonBody.putOpt(PARAM_DRY_RUN, message.isDryRun());<NEW_LINE>if (message.getData().size() > 0) {<NEW_LINE>JSONObject jsonPayload = new JSONObject(message.getData());<NEW_LINE>jsonBody.put(PARAM_JSON_PAYLOAD, jsonPayload);<NEW_LINE>}<NEW_LINE>if (message.getNotificationParams().size() > 0) {<NEW_LINE>JSONObject jsonNotificationParams = new JSONObject(message.getNotificationParams());<NEW_LINE>jsonBody.put(PARAM_JSON_NOTIFICATION_PARAMS, jsonNotificationParams);<NEW_LINE>}<NEW_LINE>} catch (JSONException e) {<NEW_LINE>logger.log(Log.ERROR, "Failed to build JSON body");<NEW_LINE>throw new IOException("Failed to build JSON body");<NEW_LINE>}<NEW_LINE>HttpRequest httpRequest = new HttpRequest();<NEW_LINE>httpRequest.setHeader(HEADER_CONTENT_TYPE, CONTENT_TYPE_JSON);<NEW_LINE>httpRequest.setHeader(HEADER_AUTHORIZATION, "key=" + key);<NEW_LINE>httpRequest.doPost(GCM_SEND_ENDPOINT, jsonBody.toString());<NEW_LINE>if (httpRequest.getResponseCode() != 200) {<NEW_LINE>throw new IOException("Invalid request." + " status: " + httpRequest.getResponseCode() + " response: " + httpRequest.getResponseBody());<NEW_LINE>}<NEW_LINE>JSONObject jsonResponse;<NEW_LINE>try {<NEW_LINE>jsonResponse = new JSONObject(httpRequest.getResponseBody());<NEW_LINE>logger.log(Log.INFO, "Send message:\n" + jsonResponse.toString(2));<NEW_LINE>} catch (JSONException e) {<NEW_LINE>logger.log(Log.ERROR, "Failed to parse server response:\n" + httpRequest.getResponseBody());<NEW_LINE>}<NEW_LINE>return httpRequest.getResponseBody();<NEW_LINE>} | jsonBody.put(PARAM_TO, destination); |
1,487,932 | private static void decodeUnreserved(StringBuilder path, int start) {<NEW_LINE>if (start + 3 <= path.length()) {<NEW_LINE>// these are latin chars so there is no danger of falling into some special unicode char that requires more<NEW_LINE>// than 1 byte<NEW_LINE>final String escapeSequence = path.substring(start + 1, start + 3);<NEW_LINE>int unescaped;<NEW_LINE>try {<NEW_LINE>unescaped = Integer.parseInt(escapeSequence, 16);<NEW_LINE>if (unescaped < 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new IllegalArgumentException("Invalid escape sequence: %" + escapeSequence);<NEW_LINE>}<NEW_LINE>// validate if the octet is within the allowed ranges<NEW_LINE>if (// ALPHA<NEW_LINE>// DIGIT<NEW_LINE>(unescaped >= 0x41 && unescaped <= 0x5A) || (unescaped >= 0x61 && unescaped <= 0x7A) || // HYPHEN<NEW_LINE>(unescaped >= 0x30 && unescaped <= 0x39) || // PERIOD<NEW_LINE>(unescaped == 0x2D) || // UNDERSCORE<NEW_LINE>(unescaped == 0x2E) || // TILDE<NEW_LINE>(unescaped == 0x5F) || (unescaped == 0x7E)) {<NEW_LINE>path.setCharAt(start, (char) unescaped);<NEW_LINE>path.delete(start + 1, start + 3);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Invalid position for escape character: " + start);<NEW_LINE>}<NEW_LINE>} | throw new IllegalArgumentException("Invalid escape sequence: %" + escapeSequence); |
374,426 | private void logHeadersConfig() {<NEW_LINE>// If tracing is enabled, print out the state of these maps.<NEW_LINE>if (this.isHeadersConfigEnabled && (TraceComponent.isAnyTracingEnabled()) && (tc.isEventEnabled())) {<NEW_LINE>List<String> addHeaders <MASK><NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("Http Channel Config: Headers configuration complete. The following values are set:\n");<NEW_LINE>for (List<Entry<String, String>> headerList : this.configuredHeadersToAdd.values()) {<NEW_LINE>for (Entry<String, String> header : headerList) {<NEW_LINE>addHeaders.add(header.getKey() + ":" + header.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Construct the lax names<NEW_LINE>sb.append("Headers Remove ").append(this.configuredHeadersToRemove.values()).append("\n");<NEW_LINE>sb.append("Headers Add ").append(addHeaders).append("\n");<NEW_LINE>sb.append("Headers Set ").append(this.configuredHeadersToSet.values()).append("\n");<NEW_LINE>sb.append("Headers SetIfMissing ").append(this.configuredHeadersToSetIfMissing.values());<NEW_LINE>if (!this.configuredHeadersErrorSet.isEmpty()) {<NEW_LINE>sb.append("\n").append("Misconfigured headers ").append(this.configuredHeadersErrorSet);<NEW_LINE>}<NEW_LINE>Tr.event(tc, sb.toString());<NEW_LINE>}<NEW_LINE>} | = new LinkedList<String>(); |
707,588 | static void c_4() throws Exception {<NEW_LINE>AkSourceBatchOp train_data = new AkSourceBatchOp().setFilePath(DATA_DIR + TRAIN_FILE);<NEW_LINE>AkSourceBatchOp test_data = new AkSourceBatchOp(<MASK><NEW_LINE>new OneVsRest().setClassifier(new LogisticRegression().setFeatureCols(FEATURE_COL_NAMES).setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME)).setNumClass(3).fit(train_data).transform(test_data).link(new EvalMultiClassBatchOp().setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).lazyPrintMetrics("OneVsRest_LogisticRegression"));<NEW_LINE>new OneVsRest().setClassifier(new GbdtClassifier().setFeatureCols(FEATURE_COL_NAMES).setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME)).setNumClass(3).fit(train_data).transform(test_data).link(new EvalMultiClassBatchOp().setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).lazyPrintMetrics("OneVsRest_GBDT"));<NEW_LINE>new OneVsRest().setClassifier(new LinearSvm().setFeatureCols(FEATURE_COL_NAMES).setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME)).setNumClass(3).fit(train_data).transform(test_data).link(new EvalMultiClassBatchOp().setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).lazyPrintMetrics("OneVsRest_LinearSvm"));<NEW_LINE>BatchOperator.execute();<NEW_LINE>} | ).setFilePath(DATA_DIR + TEST_FILE); |
1,665,215 | private void updateUsers(AuthConfig authConfig) {<NEW_LINE>users.clear();<NEW_LINE>for (UserAuthConfig userAuthConfig : authConfig.getUsers()) {<NEW_LINE>// Add a role either if it's actively assigned to him or if the right isn't restricted at all<NEW_LINE>List<GrantedAuthority> userRoles = new ArrayList<>();<NEW_LINE>if (userAuthConfig.isMaySeeAdmin() || !authConfig.isRestrictAdmin()) {<NEW_LINE>userRoles.add(new SimpleGrantedAuthority("ROLE_ADMIN"));<NEW_LINE>userRoles.<MASK><NEW_LINE>userRoles.add(new SimpleGrantedAuthority("ROLE_DETAILS"));<NEW_LINE>userRoles.add(new SimpleGrantedAuthority("ROLE_SHOW_INDEXERS"));<NEW_LINE>} else {<NEW_LINE>if (userAuthConfig.isMaySeeStats() || !authConfig.isRestrictStats()) {<NEW_LINE>userRoles.add(new SimpleGrantedAuthority("ROLE_STATS"));<NEW_LINE>}<NEW_LINE>if (userAuthConfig.isMaySeeDetailsDl() || !authConfig.isRestrictDetailsDl()) {<NEW_LINE>userRoles.add(new SimpleGrantedAuthority("ROLE_DETAILS"));<NEW_LINE>}<NEW_LINE>if (userAuthConfig.isShowIndexerSelection() || !authConfig.isRestrictIndexerSelection()) {<NEW_LINE>userRoles.add(new SimpleGrantedAuthority("ROLE_SHOW_INDEXERS"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>userRoles.add(new SimpleGrantedAuthority("ROLE_USER"));<NEW_LINE>User user = new User(userAuthConfig.getUsername(), userAuthConfig.getPassword(), userRoles);<NEW_LINE>users.put(userAuthConfig.getUsername(), user);<NEW_LINE>}<NEW_LINE>} | add(new SimpleGrantedAuthority("ROLE_STATS")); |
350,323 | protected Excuse<Regressor> innerGetExcuse(Example<Regressor> e, double[][] allFeatureWeights) {<NEW_LINE>Prediction<Regressor> prediction = predict(e);<NEW_LINE>Map<String, List<Pair<String, Double>>> <MASK><NEW_LINE>for (int i = 0; i < allFeatureWeights.length; i++) {<NEW_LINE>List<Pair<String, Double>> scores = new ArrayList<>();<NEW_LINE>for (Feature f : e) {<NEW_LINE>int id = featureIDMap.getID(f.getName());<NEW_LINE>if (id > -1) {<NEW_LINE>double score = allFeatureWeights[i][id] * f.getValue();<NEW_LINE>scores.add(new Pair<>(f.getName(), score));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>scores.sort((o1, o2) -> o2.getB().compareTo(o1.getB()));<NEW_LINE>weightMap.put(dimensionNames[mapping[i]], scores);<NEW_LINE>}<NEW_LINE>return new Excuse<>(e, prediction, weightMap);<NEW_LINE>} | weightMap = new HashMap<>(); |
635,573 | private static <U1 extends Comparable<? super U1>, U2 extends Comparable<? super U2>, U3 extends Comparable<? super U3>, U4 extends Comparable<? super U4>, U5 extends Comparable<? super U5>> int compareTo(Tuple5<?, ?, ?, ?, ?> o1, Tuple5<?, ?, ?, ?, ?> o2) {<NEW_LINE>final Tuple5<U1, U2, U3, U4, U5> t1 = (Tuple5<U1, U2, U3, U4, U5>) o1;<NEW_LINE>final Tuple5<U1, U2, U3, U4, U5> t2 = (Tuple5<U1, U2, <MASK><NEW_LINE>final int check1 = t1._1.compareTo(t2._1);<NEW_LINE>if (check1 != 0) {<NEW_LINE>return check1;<NEW_LINE>}<NEW_LINE>final int check2 = t1._2.compareTo(t2._2);<NEW_LINE>if (check2 != 0) {<NEW_LINE>return check2;<NEW_LINE>}<NEW_LINE>final int check3 = t1._3.compareTo(t2._3);<NEW_LINE>if (check3 != 0) {<NEW_LINE>return check3;<NEW_LINE>}<NEW_LINE>final int check4 = t1._4.compareTo(t2._4);<NEW_LINE>if (check4 != 0) {<NEW_LINE>return check4;<NEW_LINE>}<NEW_LINE>final int check5 = t1._5.compareTo(t2._5);<NEW_LINE>if (check5 != 0) {<NEW_LINE>return check5;<NEW_LINE>}<NEW_LINE>// all components are equal<NEW_LINE>return 0;<NEW_LINE>} | U3, U4, U5>) o2; |
755,749 | public Scope visitTable(TableRelation node, Scope outerScope) {<NEW_LINE>TableName tableName = node.getAlias();<NEW_LINE>Table table = node.getTable();<NEW_LINE>ImmutableList.Builder<Field> fields = ImmutableList.builder();<NEW_LINE>ImmutableMap.Builder<Field, Column<MASK><NEW_LINE>for (Column column : table.getFullSchema()) {<NEW_LINE>Field field;<NEW_LINE>if (table.getBaseSchema().contains(column)) {<NEW_LINE>field = new Field(column.getName(), column.getType(), tableName, new SlotRef(tableName, column.getName(), column.getName()), true);<NEW_LINE>} else {<NEW_LINE>field = new Field(column.getName(), column.getType(), tableName, new SlotRef(tableName, column.getName(), column.getName()), false);<NEW_LINE>}<NEW_LINE>columns.put(field, column);<NEW_LINE>fields.add(field);<NEW_LINE>}<NEW_LINE>node.setColumns(columns.build());<NEW_LINE>session.getDumpInfo().addTable(node.getName().getDb().split(":")[1], table);<NEW_LINE>Scope scope = new Scope(RelationId.of(node), new RelationFields(fields.build()));<NEW_LINE>node.setScope(scope);<NEW_LINE>return scope;<NEW_LINE>} | > columns = ImmutableMap.builder(); |
1,263,995 | public static DescribeDrdsDbInstanceResponse unmarshall(DescribeDrdsDbInstanceResponse describeDrdsDbInstanceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDrdsDbInstanceResponse.setRequestId(_ctx.stringValue("DescribeDrdsDbInstanceResponse.RequestId"));<NEW_LINE>describeDrdsDbInstanceResponse.setSuccess(_ctx.booleanValue("DescribeDrdsDbInstanceResponse.Success"));<NEW_LINE>DbInstance dbInstance = new DbInstance();<NEW_LINE>dbInstance.setDBInstanceId(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.DBInstanceId"));<NEW_LINE>dbInstance.setDmInstanceId(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.DmInstanceId"));<NEW_LINE>dbInstance.setConnectUrl(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ConnectUrl"));<NEW_LINE>dbInstance.setPort(_ctx.integerValue("DescribeDrdsDbInstanceResponse.DbInstance.Port"));<NEW_LINE>dbInstance.setDBInstanceStatus(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.DBInstanceStatus"));<NEW_LINE>dbInstance.setDbInstType(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.DbInstType"));<NEW_LINE>dbInstance.setReadWeight(_ctx.integerValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadWeight"));<NEW_LINE>dbInstance.setEngine(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.Engine"));<NEW_LINE>dbInstance.setEngineVersion(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.EngineVersion"));<NEW_LINE>dbInstance.setRdsInstType(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.RdsInstType"));<NEW_LINE>dbInstance.setPayType(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.PayType"));<NEW_LINE>dbInstance.setExpireTime(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ExpireTime"));<NEW_LINE>dbInstance.setRemainDays(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.RemainDays"));<NEW_LINE>dbInstance.setNetworkType(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.NetworkType"));<NEW_LINE>List<ReadOnlyInstance> readOnlyInstances = new ArrayList<ReadOnlyInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances.Length"); i++) {<NEW_LINE>ReadOnlyInstance readOnlyInstance = new ReadOnlyInstance();<NEW_LINE>readOnlyInstance.setDBInstanceId(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].DBInstanceId"));<NEW_LINE>readOnlyInstance.setDmInstanceId(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].DmInstanceId"));<NEW_LINE>readOnlyInstance.setConnectUrl(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].ConnectUrl"));<NEW_LINE>readOnlyInstance.setPort(_ctx.integerValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].Port"));<NEW_LINE>readOnlyInstance.setDBInstanceStatus(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].DBInstanceStatus"));<NEW_LINE>readOnlyInstance.setDbInstType(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].DbInstType"));<NEW_LINE>readOnlyInstance.setReadWeight(_ctx.integerValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].ReadWeight"));<NEW_LINE>readOnlyInstance.setEngine(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].Engine"));<NEW_LINE>readOnlyInstance.setEngineVersion(_ctx.stringValue<MASK><NEW_LINE>readOnlyInstance.setRdsInstType(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].RdsInstType"));<NEW_LINE>readOnlyInstance.setPayType(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].PayType"));<NEW_LINE>readOnlyInstance.setExpireTime(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].ExpireTime"));<NEW_LINE>readOnlyInstance.setRemainDays(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].RemainDays"));<NEW_LINE>readOnlyInstance.setNetworkType(_ctx.stringValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].NetworkType"));<NEW_LINE>readOnlyInstance.setVersionAction(_ctx.integerValue("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].VersionAction"));<NEW_LINE>readOnlyInstances.add(readOnlyInstance);<NEW_LINE>}<NEW_LINE>dbInstance.setReadOnlyInstances(readOnlyInstances);<NEW_LINE>describeDrdsDbInstanceResponse.setDbInstance(dbInstance);<NEW_LINE>return describeDrdsDbInstanceResponse;<NEW_LINE>} | ("DescribeDrdsDbInstanceResponse.DbInstance.ReadOnlyInstances[" + i + "].EngineVersion")); |
1,563,636 | private I_SEPA_Export createExportHeader(@NonNull final I_C_PaySelection paySelectionHeader) {<NEW_LINE>final PaySelectionTrxType paySelectionTrxType = PaySelectionTrxType.ofNullableCode(paySelectionHeader.getPaySelectionTrxType());<NEW_LINE>if (paySelectionTrxType == null) {<NEW_LINE>throw new FillMandatoryException(false, I_C_PaySelection.COLUMNNAME_PaySelectionTrxType);<NEW_LINE>}<NEW_LINE>final I_SEPA_Export header = newInstance(I_SEPA_Export.class, paySelectionHeader);<NEW_LINE>final SEPAProtocol sepaProtocol = SEPAProtocol.ofPaySelectionTrxType(paySelectionTrxType);<NEW_LINE>header.setSEPA_Protocol(sepaProtocol.getCode());<NEW_LINE>//<NEW_LINE>// We need the source org BP.<NEW_LINE>final I_C_BPartner orgBP = partnerOrgBL.retrieveLinkedBPartner(paySelectionHeader.getAD_Org_ID());<NEW_LINE>final org.compiere.model.I_C_BP_BankAccount bankAccountSource = paySelectionHeader.getC_BP_BankAccount();<NEW_LINE>// mandatory column<NEW_LINE>Check.assumeNotNull(bankAccountSource, "bankAccountSource not null");<NEW_LINE>final I_C_BP_BankAccount bpBankAccount = create(bankAccountSource, I_C_BP_BankAccount.class);<NEW_LINE>// task 09923: In case the bp bank account does not have a bank set, it cannot be used in a SEPA Export<NEW_LINE>final BankId bankId = BankId.ofRepoIdOrNull(bpBankAccount.getC_Bank_ID());<NEW_LINE>if (bankId == null) {<NEW_LINE>throw new AdempiereException(ERR_C_BP_BankAccount_BankNotSet, new Object[] { bpBankAccount.toString() });<NEW_LINE>}<NEW_LINE>// Set corresponding data<NEW_LINE>header.setAD_Org_ID(paySelectionHeader.getAD_Org_ID());<NEW_LINE>final String iban = bpBankAccount.getIBAN();<NEW_LINE>if (Check.isNotBlank(iban)) {<NEW_LINE>header.setIBAN(iban.replaceAll(" ", ""));<NEW_LINE>}<NEW_LINE>header.setPaymentDate(paySelectionHeader.getPayDate());<NEW_LINE>header.setProcessed(false);<NEW_LINE>header.setSEPA_CreditorName(orgBP.getName());<NEW_LINE>if (SEPAProtocol.DIRECT_DEBIT_PAIN_008_003_02.equals(sepaProtocol) && Check.isBlank(bpBankAccount.getSEPA_CreditorIdentifier())) {<NEW_LINE>throw new AdempiereException(ERR_C_BP_BankAccount_SEPA_CreditorIdentifierNotSet, new Object[] { bpBankAccount.toString() });<NEW_LINE>}<NEW_LINE>header.setSEPA_CreditorIdentifier(bpBankAccount.getSEPA_CreditorIdentifier());<NEW_LINE>final Bank <MASK><NEW_LINE>if (Check.isBlank(bank.getSwiftCode())) {<NEW_LINE>throw new AdempiereException(ERR_C_Bank_SwiftCodeNotSet, new Object[] { bank.getBankName() });<NEW_LINE>}<NEW_LINE>header.setSwiftCode(bank.getSwiftCode());<NEW_LINE>final int paySelectionTableID = getTableId(I_C_PaySelection.class);<NEW_LINE>header.setAD_Table_ID(paySelectionTableID);<NEW_LINE>header.setRecord_ID(paySelectionHeader.getC_PaySelection_ID());<NEW_LINE>header.setDescription(paySelectionHeader.getDescription());<NEW_LINE>header.setIsExportBatchBookings(paySelectionHeader.isExportBatchBookings());<NEW_LINE>save(header);<NEW_LINE>return header;<NEW_LINE>} | bank = bankRepo.getById(bankId); |
987,802 | private void removeObsoleteRemoteCheckpoints(long successBatchId) {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>if (lastSuccessBatchId != -1 && lastSuccessBatchId != (successBatchId - 1)) {<NEW_LINE>LOG.warn("Some ack msgs from TM were lost!. Last success batch Id: {}, Current success batch Id: {}", lastSuccessBatchId, successBatchId);<NEW_LINE>}<NEW_LINE>lastSuccessBatchId = successBatchId;<NEW_LINE>long obsoleteBatchId = successBatchId - 1;<NEW_LINE>try {<NEW_LINE>Collection<String> lastSuccessSStFiles = dfs.readLines(getDfsCheckpointSstListFile(successBatchId));<NEW_LINE>if (dfs.exist(getDfsCheckpointPath(obsoleteBatchId))) {<NEW_LINE>// remove obsolete sst files<NEW_LINE>Collection<String> obsoleteSstFiles = dfs.readLines(getDfsCheckpointSstListFile(obsoleteBatchId));<NEW_LINE>obsoleteSstFiles.removeAll(lastSuccessSStFiles);<NEW_LINE>for (String sstFile : obsoleteSstFiles) {<NEW_LINE>dfs.remove(dfsDbPath + "/" + sstFile, false);<NEW_LINE>}<NEW_LINE>// remove checkpoint dir<NEW_LINE>dfs.remove(getDfsCheckpointPath(obsoleteBatchId), true);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("Failed to remove obsolete checkpoint data for batch-" + obsoleteBatchId, e);<NEW_LINE>}<NEW_LINE>if (isEnableMetrics && JStormMetrics.enabled)<NEW_LINE>this.hdfsDeleteLatency.update(<MASK><NEW_LINE>} | System.currentTimeMillis() - startTime); |
864,968 | public void closeElement(String element, HashMap<String, String> attributes, String content, WarningSet warnings) throws SAXException {<NEW_LINE>// DEBUG ONLY<NEW_LINE>// System.err.println("closing MotorMount element: "+ element);<NEW_LINE>if (element.equals("motor")) {<NEW_LINE>FlightConfigurationId fcid = new FlightConfigurationId(attributes.get("configid"));<NEW_LINE>if (!fcid.isValid()) {<NEW_LINE>warnings.add(Warning.fromString("Illegal motor specification, ignoring."));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Motor motor = motorHandler.getMotor(warnings);<NEW_LINE>MotorConfiguration motorConfig = new MotorConfiguration(mount, fcid, mount.getDefaultMotorConfig());<NEW_LINE>motorConfig.setMotor(motor);<NEW_LINE>motorConfig.setEjectionDelay(motorHandler.getDelay(warnings));<NEW_LINE>mount.setMotorConfig(motorConfig, fcid);<NEW_LINE>Rocket rkt = ((RocketComponent) mount).getRocket();<NEW_LINE>rkt.createFlightConfiguration(fcid);<NEW_LINE>rkt.getFlightConfiguration(fcid).addMotor(motorConfig);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (element.equals("ignitionconfiguration")) {<NEW_LINE>FlightConfigurationId fcid = new FlightConfigurationId(attributes.get("configid"));<NEW_LINE>if (!fcid.isValid()) {<NEW_LINE>warnings.add(Warning.fromString("Illegal motor specification, ignoring."));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MotorConfiguration inst = mount.getMotorConfig(fcid);<NEW_LINE>inst.setIgnitionDelay(ignitionConfigHandler.ignitionDelay);<NEW_LINE>inst.setIgnitionEvent(ignitionConfigHandler.ignitionEvent);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (element.equals("ignitionevent")) {<NEW_LINE>IgnitionEvent event = null;<NEW_LINE>for (IgnitionEvent ie : IgnitionEvent.values()) {<NEW_LINE>if (ie.equals(content)) {<NEW_LINE>event = ie;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (event == null) {<NEW_LINE>warnings.add(Warning.fromString("Unknown ignition event type '" + content + "', ignoring."));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mount.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (element.equals("ignitiondelay")) {<NEW_LINE>double d;<NEW_LINE>try {<NEW_LINE>d = Double.parseDouble(content);<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>warnings.add(Warning.fromString("Illegal ignition delay specified, ignoring."));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mount.getDefaultMotorConfig().setIgnitionDelay(d);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (element.equals("overhang")) {<NEW_LINE>double d;<NEW_LINE>try {<NEW_LINE>d = Double.parseDouble(content);<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>warnings.add(Warning.fromString("Illegal overhang specified, ignoring."));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mount.setMotorOverhang(d);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>super.closeElement(element, attributes, content, warnings);<NEW_LINE>} | getDefaultMotorConfig().setIgnitionEvent(event); |
758,853 | public static // p must be a direct parent of all of (b1,b2)<NEW_LINE>void identifyLoops1(Method method, List<Op03SimpleStatement> statements, BlockIdentifierFactory blockIdentifierFactory) {<NEW_LINE>// Find back references.<NEW_LINE>// Verify that they belong to jump instructions (otherwise something has gone wrong)<NEW_LINE>// (if, goto).<NEW_LINE>List<Op03SimpleStatement> pathtests = Functional.filter(statements, new TypeFilter<GotoStatement>(GotoStatement.class));<NEW_LINE>for (Op03SimpleStatement start : pathtests) {<NEW_LINE>considerAsPathologicalLoop(start, statements);<NEW_LINE>}<NEW_LINE>List<Op03SimpleStatement> backjumps = Functional.filter(statements, new Misc.HasBackJump());<NEW_LINE>List<Op03SimpleStatement> starts = Functional.uniqAll(Functional.map(backjumps, new Misc.GetBackJump()));<NEW_LINE>Map<BlockIdentifier, Op03SimpleStatement> blockEndsCache = MapFactory.newMap();<NEW_LINE>Collections.sort(starts, new CompareByIndex());<NEW_LINE>List<LoopResult> loopResults = ListFactory.newList();<NEW_LINE>Set<BlockIdentifier> relevantBlocks = SetFactory.newSet();<NEW_LINE>for (Op03SimpleStatement start : starts) {<NEW_LINE>BlockIdentifier blockIdentifier = considerAsWhileLoopStart(method, start, statements, blockIdentifierFactory, blockEndsCache);<NEW_LINE>if (blockIdentifier == null) {<NEW_LINE>blockIdentifier = considerAsDoLoopStart(start, statements, blockIdentifierFactory, blockEndsCache);<NEW_LINE>}<NEW_LINE>if (blockIdentifier != null) {<NEW_LINE>loopResults.add(new LoopResult(blockIdentifier, start));<NEW_LINE>relevantBlocks.add(blockIdentifier);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (loopResults.isEmpty())<NEW_LINE>return;<NEW_LINE>Collections.reverse(loopResults);<NEW_LINE><MASK><NEW_LINE>} | fixLoopOverlaps(statements, loopResults, relevantBlocks); |
1,332,388 | void sendFile(Http.RequestMethod method, Path pathParam, ServerRequest request, ServerResponse response, String welcomePage) throws IOException {<NEW_LINE>LOGGER.fine(() -> "Sending static content from file: " + pathParam);<NEW_LINE>Path path = pathParam;<NEW_LINE>// we know the file exists, though it may be a directory<NEW_LINE>// First doHandle a directory case<NEW_LINE>if (Files.isDirectory(path)) {<NEW_LINE>String rawFullPath = request.uri().getRawPath();<NEW_LINE>if (rawFullPath.endsWith("/")) {<NEW_LINE>// Try to found welcome file<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// Or redirect to slash ended<NEW_LINE>redirect(request, response, rawFullPath + "/");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now it exists and is a file<NEW_LINE>if (!Files.isRegularFile(path) || !Files.isReadable(path) || Files.isHidden(path)) {<NEW_LINE>throw new HttpException("File is not accessible", Http.Status.FORBIDDEN_403);<NEW_LINE>}<NEW_LINE>// Caching headers support<NEW_LINE>try {<NEW_LINE>Instant lastMod = Files.getLastModifiedTime(path).toInstant();<NEW_LINE>processEtag(String.valueOf(lastMod.toEpochMilli()), request.headers(), response.headers());<NEW_LINE>processModifyHeaders(lastMod, request.headers(), response.headers());<NEW_LINE>} catch (IOException | SecurityException e) {<NEW_LINE>// Cannot get mod time or size - well, we cannot tell if it was modified or not. Don't support cache headers<NEW_LINE>}<NEW_LINE>processContentType(fileName(path), request.headers(), response.headers());<NEW_LINE>if (method == Http.Method.HEAD) {<NEW_LINE>response.send();<NEW_LINE>} else {<NEW_LINE>send(response, path);<NEW_LINE>}<NEW_LINE>} | path = resolveWelcomeFile(path, welcomePage); |
136,434 | /*<NEW_LINE>* Ensures that this.macInstance is initialized<NEW_LINE>* In-case of credential change, optimistically will try to refresh the macInstance<NEW_LINE>*<NEW_LINE>* Implementation is non-blocking, the one which acquire the lock will try to refresh<NEW_LINE>* with new credentials<NEW_LINE>*<NEW_LINE>* NOTE: Calling it CTOR ensured that default is initialized.<NEW_LINE>*/<NEW_LINE>private void reInitializeIfPossible() {<NEW_LINE>// Java == operator is reference equals not content<NEW_LINE>// leveraging reference comparison avoid hash computation<NEW_LINE>if (this.currentCredentialKey != this.credential.getKey()) {<NEW_LINE>// Try to acquire the lock, the one who got lock will try to refresh the macInstance<NEW_LINE>boolean lockAcquired <MASK><NEW_LINE>if (lockAcquired) {<NEW_LINE>try {<NEW_LINE>if (this.currentCredentialKey != this.credential.getKey()) {<NEW_LINE>byte[] masterKeyBytes = this.credential.getKey().getBytes(StandardCharsets.UTF_8);<NEW_LINE>byte[] masterKeyDecodedBytes = Utils.Base64Decoder.decode(masterKeyBytes);<NEW_LINE>SecretKey signingKey = new SecretKeySpec(masterKeyDecodedBytes, "HMACSHA256");<NEW_LINE>try {<NEW_LINE>Mac macInstance = Mac.getInstance("HMACSHA256");<NEW_LINE>macInstance.init(signingKey);<NEW_LINE>this.currentCredentialKey = this.credential.getKey();<NEW_LINE>this.macPool = new MacPool(macInstance);<NEW_LINE>} catch (NoSuchAlgorithmException | InvalidKeyException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>this.macInstanceLock.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = this.macInstanceLock.tryLock(); |
1,838,543 | private void appendStringify(Writer writer, HollowDataAccess dataAccess, String type, int ordinal, int indentation) throws IOException {<NEW_LINE>if (excludeObjectTypes.contains(type)) {<NEW_LINE>writer.append("null");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HollowTypeDataAccess typeDataAccess = dataAccess.getTypeDataAccess(type);<NEW_LINE>if (typeDataAccess == null) {<NEW_LINE>writer.append("{ }");<NEW_LINE>} else if (ordinal == ORDINAL_NONE) {<NEW_LINE>writer.append("null");<NEW_LINE>} else {<NEW_LINE>if (typeDataAccess instanceof HollowObjectTypeDataAccess) {<NEW_LINE>appendObjectStringify(writer, dataAccess, (<MASK><NEW_LINE>} else if (typeDataAccess instanceof HollowListTypeDataAccess) {<NEW_LINE>appendListStringify(writer, dataAccess, (HollowListTypeDataAccess) typeDataAccess, ordinal, indentation);<NEW_LINE>} else if (typeDataAccess instanceof HollowSetTypeDataAccess) {<NEW_LINE>appendSetStringify(writer, dataAccess, (HollowSetTypeDataAccess) typeDataAccess, ordinal, indentation);<NEW_LINE>} else if (typeDataAccess instanceof HollowMapTypeDataAccess) {<NEW_LINE>appendMapStringify(writer, dataAccess, (HollowMapTypeDataAccess) typeDataAccess, ordinal, indentation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | HollowObjectTypeDataAccess) typeDataAccess, ordinal, indentation); |
839,688 | private static void exportMultiPointToJson(MultiPoint mpt, SpatialReference spatialReference, JsonWriter jsonWriter, Map<String, Object> exportProperties) {<NEW_LINE>boolean bExportZs = mpt.hasAttribute(Semantics.Z);<NEW_LINE>boolean bExportMs = <MASK><NEW_LINE>boolean bPositionAsF = false;<NEW_LINE>int decimals = 17;<NEW_LINE>if (exportProperties != null) {<NEW_LINE>Object numberOfDecimalsXY = exportProperties.get("numberOfDecimalsXY");<NEW_LINE>if (numberOfDecimalsXY != null && numberOfDecimalsXY instanceof Number) {<NEW_LINE>bPositionAsF = true;<NEW_LINE>decimals = ((Number) numberOfDecimalsXY).intValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.startObject();<NEW_LINE>if (bExportZs) {<NEW_LINE>jsonWriter.addPairBoolean("hasZ", true);<NEW_LINE>}<NEW_LINE>if (bExportMs) {<NEW_LINE>jsonWriter.addPairBoolean("hasM", true);<NEW_LINE>}<NEW_LINE>jsonWriter.addPairArray("points");<NEW_LINE>if (!mpt.isEmpty()) {<NEW_LINE>// get impl<NEW_LINE>MultiPointImpl mpImpl = (MultiPointImpl) mpt._getImpl();<NEW_LINE>// for<NEW_LINE>// faster<NEW_LINE>// access<NEW_LINE>AttributeStreamOfDbl zs = null;<NEW_LINE>AttributeStreamOfDbl ms = null;<NEW_LINE>if (bExportZs) {<NEW_LINE>zs = (AttributeStreamOfDbl) mpImpl.getAttributeStreamRef(Semantics.Z);<NEW_LINE>}<NEW_LINE>if (bExportMs) {<NEW_LINE>ms = (AttributeStreamOfDbl) mpImpl.getAttributeStreamRef(Semantics.M);<NEW_LINE>}<NEW_LINE>Point2D pt = new Point2D();<NEW_LINE>int n = mpt.getPointCount();<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>mpt.getXY(i, pt);<NEW_LINE>jsonWriter.addValueArray();<NEW_LINE>if (bPositionAsF) {<NEW_LINE>jsonWriter.addValueDouble(pt.x, decimals, true);<NEW_LINE>jsonWriter.addValueDouble(pt.y, decimals, true);<NEW_LINE>} else {<NEW_LINE>jsonWriter.addValueDouble(pt.x);<NEW_LINE>jsonWriter.addValueDouble(pt.y);<NEW_LINE>}<NEW_LINE>if (bExportZs) {<NEW_LINE>double z = zs.get(i);<NEW_LINE>jsonWriter.addValueDouble(z);<NEW_LINE>}<NEW_LINE>if (bExportMs) {<NEW_LINE>double m = ms.get(i);<NEW_LINE>jsonWriter.addValueDouble(m);<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>if (spatialReference != null) {<NEW_LINE>writeSR(spatialReference, jsonWriter);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>} | mpt.hasAttribute(Semantics.M); |
144,900 | private void writeNamespacesToZip(Stream<ConfigBO> configBOStream, ZipOutputStream zipOutputStream) {<NEW_LINE>final Consumer<ConfigBO> configBOConsumer = configBO -> {<NEW_LINE>try {<NEW_LINE>synchronized (zipOutputStream) {<NEW_LINE>String appId = configBO.getAppId();<NEW_LINE>String clusterName = configBO.getClusterName();<NEW_LINE>String namespace = configBO.getNamespace();<NEW_LINE>String configFileContent = configBO.getConfigFileContent();<NEW_LINE>ConfigFileFormat configFileFormat = configBO.getFormat();<NEW_LINE>String configFileName = ConfigFileUtils.toFilename(appId, clusterName, namespace, configFileFormat);<NEW_LINE>String filePath = ConfigFileUtils.genNamespacePath(configBO.getOwnerName(), appId, <MASK><NEW_LINE>writeToZip(filePath, configFileContent, zipOutputStream);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("Write error. {}", configBO);<NEW_LINE>throw new ServiceException("Write namespace error. {}", e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>configBOStream.forEach(configBOConsumer);<NEW_LINE>} | configBO.getEnv(), configFileName); |
461,974 | // visible for testing<NEW_LINE>static void shiftLeftDestructive(Slice decimal, int leftShifts) {<NEW_LINE>if (leftShifts == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int wordShifts = leftShifts / 64;<NEW_LINE>int bitShiftsInWord = leftShifts % 64;<NEW_LINE>int shiftRestore = 64 - bitShiftsInWord;<NEW_LINE>// check overflow<NEW_LINE>if (bitShiftsInWord != 0) {<NEW_LINE>if ((getLong(decimal, 1 - wordShifts) & (-1L << shiftRestore)) != 0) {<NEW_LINE>throwOverflowException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (wordShifts == 1) {<NEW_LINE>if (getLong(decimal, 1) != 0) {<NEW_LINE>throwOverflowException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Store negative before settings values to result.<NEW_LINE>boolean negative = isNegative(decimal);<NEW_LINE>long low;<NEW_LINE>long high;<NEW_LINE>switch(wordShifts) {<NEW_LINE>case 0:<NEW_LINE><MASK><NEW_LINE>high = getLong(decimal, 1);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>low = 0;<NEW_LINE>high = getLong(decimal, 0);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>if (bitShiftsInWord > 0) {<NEW_LINE>high = (high << bitShiftsInWord) | (low >>> shiftRestore);<NEW_LINE>low = (low << bitShiftsInWord);<NEW_LINE>}<NEW_LINE>pack(decimal, low, high, negative);<NEW_LINE>} | low = getLong(decimal, 0); |
1,106,442 | final BatchExecuteStatementResult executeBatchExecuteStatement(BatchExecuteStatementRequest batchExecuteStatementRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchExecuteStatementRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchExecuteStatementRequest> request = null;<NEW_LINE>Response<BatchExecuteStatementResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchExecuteStatementRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchExecuteStatementRequest));<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, "Redshift Data");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchExecuteStatement");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchExecuteStatementResult>> 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 BatchExecuteStatementResultJsonUnmarshaller()); |
872,890 | private void exportXML(ExportDataDumper eDD, boolean combine, String viewName) {<NEW_LINE>// Header<NEW_LINE>// NOI18N<NEW_LINE>String newline = System.getProperty("line.separator");<NEW_LINE>StringBuffer result;<NEW_LINE><MASK><NEW_LINE>if (!combine) {<NEW_LINE>// NOI18N<NEW_LINE>result = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + newline + "<ExportedView Name=\"" + viewName + "\" type=\"table\">" + newline + " <TableData NumRows=\"" + flatProfileContainer.getNRows() + "\" NumColumns=\"4\">" + newline + " <TableHeader>");<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>result = new StringBuffer(newline + "<TableData NumRows=\"" + flatProfileContainer.getNRows() + "\" NumColumns=\"4\">" + newline + " <TableHeader>");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < (columnCount); i++) {<NEW_LINE>result.append(" <TableColumn><![CDATA[").append(columnNames[i]).append("]]></TableColumn>").append(newline);<NEW_LINE>}<NEW_LINE>result.append(" </TableHeader>").append(newline).append(" <TableBody>").append(newline);<NEW_LINE>eDD.dumpData(result);<NEW_LINE>for (int i = 0; i < flatProfileContainer.getNRows(); i++) {<NEW_LINE>result = new StringBuffer(" <TableRow>" + newline + " <TableColumn><![CDATA[" + flatProfileContainer.getMethodNameAtRow(i) + "]]></TableColumn>" + newline);<NEW_LINE>result.append(" <TableColumn><![CDATA[").append(percentFormat.format(((double) flatProfileContainer.getPercentAtRow(i)) / 100)).append("]]></TableColumn>").append(newline);<NEW_LINE>result.append(" <TableColumn><![CDATA[").append(((double) flatProfileContainer.getTimeInMcs0AtRow(i)) / 1000).append(" ms]]></TableColumn>").append(newline);<NEW_LINE>if (iCTTS) {<NEW_LINE>result.append(" <TableColumn><![CDATA[").append(((double) flatProfileContainer.getTimeInMcs1AtRow(i)) / 1000).append(" ms]]></TableColumn>").append(newline);<NEW_LINE>}<NEW_LINE>result.append(" <TableColumn><![CDATA[").append(((double) flatProfileContainer.getTotalTimeInMcs0AtRow(i)) / 1000).append(" ms]]></TableColumn>").append(newline);<NEW_LINE>if (iCTTS) {<NEW_LINE>result.append(" <TableColumn><![CDATA[").append(((double) flatProfileContainer.getTotalTimeInMcs1AtRow(i)) / 1000).append(" ms]]></TableColumn>").append(newline);<NEW_LINE>}<NEW_LINE>result.append(" <TableColumn><![CDATA[").append(flatProfileContainer.getNInvocationsAtRow(i)).append("]]></TableColumn>").append(newline).append(" </TableRow>").append(newline);<NEW_LINE>eDD.dumpData(result);<NEW_LINE>}<NEW_LINE>eDD.dumpDataAndClose(new StringBuffer(" </TableBody>" + " </TableData>" + newline + "</ExportedView>"));<NEW_LINE>} | boolean iCTTS = flatProfileContainer.isCollectingTwoTimeStamps(); |
611,821 | protected void applyDefaultsToWsdlRequest(SubmitContext context, AbstractHttpRequestInterface<?> wsdlRequest, EndpointDefaults def) {<NEW_LINE>String requestUsername = PropertyExpander.expandProperties(context, wsdlRequest.getUsername());<NEW_LINE>String requestPassword = PropertyExpander.expandProperties(context, wsdlRequest.getPassword());<NEW_LINE>String requestDomain = PropertyExpander.expandProperties(context, wsdlRequest.getDomain());<NEW_LINE>String defUsername = PropertyExpander.expandProperties(context, def.getUsername());<NEW_LINE>String defPassword = PropertyExpander.expandProperties(context, def.getPassword());<NEW_LINE>String defDomain = PropertyExpander.expandProperties(context, def.getDomain());<NEW_LINE>Enum authType = AuthType.Enum.forString(wsdlRequest.getAuthType());<NEW_LINE>if (def.getMode() == EndpointConfig.Mode.OVERRIDE) {<NEW_LINE>overrideRequest(context, wsdlRequest, def, requestUsername, requestPassword, requestDomain, defUsername, defPassword, defDomain, authType);<NEW_LINE>} else if (def.getMode() == EndpointConfig.Mode.COPY) {<NEW_LINE>copyToRequest(context, wsdlRequest, def, requestUsername, requestPassword, requestDomain, defUsername, defPassword, defDomain, authType);<NEW_LINE>} else if (def.getMode() == EndpointConfig.Mode.COMPLEMENT) {<NEW_LINE>complementRequest(context, wsdlRequest, def, requestUsername, requestPassword, requestDomain, <MASK><NEW_LINE>}<NEW_LINE>} | defUsername, defPassword, defDomain, authType); |
300,152 | public boolean performCommand(ConsoleInput ci, DownloadManager dm, List<String> args) {<NEW_LINE>if (args.size() < 1) {<NEW_LINE>ci.out.println("> Command 'hack': Not enough parameters for subcommand '" + getCommandName() + "'");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>if (op.equals("set")) {<NEW_LINE>if (args.size() < 2) {<NEW_LINE>ci.out.println("> Command 'hack': Not enough parameters for subcommand '" + getCommandName() + "'");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String cat_name = args.get(1);<NEW_LINE>Category cat = CategoryManager.getCategory(cat_name);<NEW_LINE>if (cat == null) {<NEW_LINE>cat = CategoryManager.createCategory(cat_name);<NEW_LINE>}<NEW_LINE>dm.getDownloadState().setCategory(cat);<NEW_LINE>} else if (op.equals("clear")) {<NEW_LINE>dm.getDownloadState().setCategory(null);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | op = args.get(0); |
497,939 | protected void checkAndGenerateFieldAssignment(FlowContext flowContext, FlowInfo flowInfo, FieldBinding[] fields) {<NEW_LINE>this.scope.isCompactConstructorScope = false;<NEW_LINE>if (fields == null)<NEW_LINE>return;<NEW_LINE>List<Statement> fieldAssignments = new ArrayList<>();<NEW_LINE>for (FieldBinding field : fields) {<NEW_LINE>if (field.isStatic())<NEW_LINE>continue;<NEW_LINE>assert field.isFinal();<NEW_LINE>FieldReference lhs = new FieldReference(field.name, 0);<NEW_LINE>lhs.receiver = new ThisReference(0, 0);<NEW_LINE>// TODO: Check whether anything has to be done for null analysis.<NEW_LINE>Assignment assignment = new Assignment(lhs, new SingleNameReference(field<MASK><NEW_LINE>assignment.resolveType(this.scope);<NEW_LINE>assignment.analyseCode(this.scope, flowContext, flowInfo);<NEW_LINE>assignment.bits |= ASTNode.IsImplicit;<NEW_LINE>assert flowInfo.isDefinitelyAssigned(field);<NEW_LINE>fieldAssignments.add(assignment);<NEW_LINE>}<NEW_LINE>if (fieldAssignments.isEmpty())<NEW_LINE>return;<NEW_LINE>Statement[] fa = fieldAssignments.toArray(new Statement[0]);<NEW_LINE>if (this.statements == null) {<NEW_LINE>this.statements = fa;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int len = this.statements.length;<NEW_LINE>int fLen = fa.length;<NEW_LINE>Statement[] stmts = new Statement[len + fLen];<NEW_LINE>System.arraycopy(this.statements, 0, stmts, 0, len);<NEW_LINE>System.arraycopy(fa, 0, stmts, len, fLen);<NEW_LINE>this.statements = stmts;<NEW_LINE>} | .name, 0), 0); |
423,056 | public ApiResponse<String> syncGetPolicyWithHttpInfo() throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/sync/policy";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<String> localVarReturnType = new GenericType<String>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
744,802 | private void addBodyElements(XmlTokenSource source, IBody part, List<IBodyElement> bodyElements) {<NEW_LINE>// parse the document with cursor and add<NEW_LINE>// the XmlObject to its lists<NEW_LINE>XmlCursor cursor = source.newCursor();<NEW_LINE>cursor.selectPath("./*");<NEW_LINE>while (cursor.toNextSelection()) {<NEW_LINE>XmlObject o = cursor.getObject();<NEW_LINE>if (o instanceof CTSdtBlock) {<NEW_LINE>// <w:sdt><w:sdtContent><p...<NEW_LINE>CTSdtBlock block = (CTSdtBlock) o;<NEW_LINE>CTSdtContentBlock contentBlock = block.getSdtContent();<NEW_LINE>if (contentBlock != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else if (o instanceof CTP) {<NEW_LINE>XWPFParagraph p = new XWPFParagraph((CTP) o, part);<NEW_LINE>bodyElements.add(p);<NEW_LINE>} else if (o instanceof CTTbl) {<NEW_LINE>XWPFTable t = new XWPFTable((CTTbl) o, part);<NEW_LINE>bodyElements.add(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cursor.dispose();<NEW_LINE>} | addBodyElements(contentBlock, part, bodyElements); |
1,582,089 | protected String doIt() throws Exception {<NEW_LINE>// Instance current Payment Selection<NEW_LINE>if (getRecord_ID() > 0) {<NEW_LINE>// Already exists<NEW_LINE>paymentSelection = new MPaySelection(getCtx(), getRecord_ID(), get_TrxName());<NEW_LINE>seqNo = paymentSelection.getLastLineNo();<NEW_LINE>} else {<NEW_LINE>// Is a new Payment Selection<NEW_LINE>paymentSelection = new MPaySelection(getCtx(), 0, get_TrxName());<NEW_LINE><MASK><NEW_LINE>paymentSelection.setDateDoc(getDateDoc());<NEW_LINE>paymentSelection.setPayDate(getPayDate());<NEW_LINE>if (getDocTypeTargetId() > 0)<NEW_LINE>paymentSelection.setC_DocType_ID(getDocTypeTargetId());<NEW_LINE>MUser user = MUser.get(getCtx(), getAD_User_ID());<NEW_LINE>String userName = "";<NEW_LINE>if (user != null)<NEW_LINE>userName = user.getName();<NEW_LINE>// Set description<NEW_LINE>paymentSelection.setDescription(Msg.getMsg(Env.getCtx(), "VPaySelect") + " - " + userName + " - " + DisplayType.getDateFormat(DisplayType.Date).format(getPayDate()));<NEW_LINE>// Save<NEW_LINE>paymentSelection.saveEx();<NEW_LINE>isNew = true;<NEW_LINE>}<NEW_LINE>// Loop for keys<NEW_LINE>for (Integer key : getSelectionKeys()) {<NEW_LINE>// get values from result set<NEW_LINE>int C_Invoice_ID = key;<NEW_LINE>int C_InvoicePaySchedule_ID = getSelectionAsInt(key, "INV_C_InvoicePaySchedule_ID");<NEW_LINE>String PaymentRule = getSelectionAsString(key, "INV_PaymentRule");<NEW_LINE>BigDecimal AmtSource = getSelectionAsBigDecimal(key, "INV_AmtSource");<NEW_LINE>BigDecimal OpenAmt = getSelectionAsBigDecimal(key, "INV_OpenAmt");<NEW_LINE>BigDecimal PayAmt = getSelectionAsBigDecimal(key, "INV_PayAmt");<NEW_LINE>BigDecimal DiscountAmt = getSelectionAsBigDecimal(key, "INV_DiscountAmt");<NEW_LINE>seqNo += 10;<NEW_LINE>MPaySelectionLine line = new MPaySelectionLine(paymentSelection, seqNo, PaymentRule);<NEW_LINE>// Add Order<NEW_LINE>line.setInvoice(C_Invoice_ID, C_InvoicePaySchedule_ID, AmtSource, OpenAmt, PayAmt, DiscountAmt);<NEW_LINE>// Save<NEW_LINE>line.saveEx();<NEW_LINE>}<NEW_LINE>// For new<NEW_LINE>if (isNew) {<NEW_LINE>// Load Record<NEW_LINE>paymentSelection.load(get_TrxName());<NEW_LINE>// Process Selection<NEW_LINE>if (!paymentSelection.processIt(MPaySelection.DOCACTION_Complete)) {<NEW_LINE>throw new AdempiereException("@Error@ " + paymentSelection.getProcessMsg());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>paymentSelection.saveEx();<NEW_LINE>// Notify<NEW_LINE>return paymentSelection.getDescription();<NEW_LINE>}<NEW_LINE>// Default Ok<NEW_LINE>return "@OK@";<NEW_LINE>} | paymentSelection.setC_BankAccount_ID(getBankAccountId()); |
1,173,130 | public void onListArchivedWorkers(final ListArchivedWorkersRequest request) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("In onListArchiveWorkers {}", request);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<IMantisWorkerMetadata> workerList = jobStore.getArchivedWorkers(request.getJobId().getId());<NEW_LINE>if (workerList.size() > request.getLimit()) {<NEW_LINE>workerList = workerList.subList(0, request.getLimit());<NEW_LINE>}<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("Returning {} archived Workers", workerList.size());<NEW_LINE>}<NEW_LINE>getSender().tell(new ListArchivedWorkersResponse(request.requestId, SUCCESS, "", workerList), getSelf());<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Exception listing archived workers", e);<NEW_LINE>getSender().tell(new ListArchivedWorkersResponse(request.requestId, SERVER_ERROR, "Exception getting archived workers for job " + request.getJobId() + " -> " + e.getMessage(), Lists.newArrayList<MASK><NEW_LINE>}<NEW_LINE>} | ()), getSelf()); |
1,517,830 | /*<NEW_LINE>* Performs a two-way or three-way diff on the current selection.<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public Object prepareInput(IProgressMonitor pm) throws InvocationTargetException {<NEW_LINE>try {<NEW_LINE>// fix for PR 1GFMLFB: ITPUI:WIN2000 - files that are out of sync with the file system appear as empty<NEW_LINE>fLeftResource.prepare(pm);<NEW_LINE>fRightResource.prepare(pm);<NEW_LINE>if (fThreeWay && fAncestorResource != null)<NEW_LINE>fAncestorResource.refreshLocal(IResource.DEPTH_INFINITE, pm);<NEW_LINE>// end fix<NEW_LINE>// $NON-NLS-1$<NEW_LINE>pm.beginTask(Utilities.getString("ResourceCompare.taskName"), IProgressMonitor.UNKNOWN);<NEW_LINE>String leftLabel = fLeftResource.name();<NEW_LINE><MASK><NEW_LINE>String title;<NEW_LINE>if (fThreeWay) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String format = Utilities.getString("ResourceCompare.threeWay.title");<NEW_LINE>String ancestorLabel = fAncestorResource.getName();<NEW_LINE>title = MessageFormat.format(format, ancestorLabel, leftLabel, rightLabel);<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String format = Utilities.getString("ResourceCompare.twoWay.title");<NEW_LINE>title = MessageFormat.format(format, leftLabel, rightLabel);<NEW_LINE>}<NEW_LINE>setTitle(title);<NEW_LINE>Differencer d = new Differencer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Object visit(Object parent, int description, Object ancestor, Object left, Object right) {<NEW_LINE>return new MyDiffNode((IDiffContainer) parent, description, (ITypedElement) ancestor, (ITypedElement) left, (ITypedElement) right);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>fRoot = (MyDiffNode) d.findDifferences(fThreeWay, pm, null, fAncestor, fLeft, fRight);<NEW_LINE>cleanDifferences(fRoot);<NEW_LINE>return fRoot;<NEW_LINE>} catch (CoreException ex) {<NEW_LINE>throw new InvocationTargetException(ex);<NEW_LINE>} finally {<NEW_LINE>pm.done();<NEW_LINE>}<NEW_LINE>} | String rightLabel = fRightResource.name(); |
1,025,028 | public static DescribeDrdsInstanceResponse unmarshall(DescribeDrdsInstanceResponse describeDrdsInstanceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDrdsInstanceResponse.setRequestId(_ctx.stringValue("DescribeDrdsInstanceResponse.RequestId"));<NEW_LINE>describeDrdsInstanceResponse.setSuccess(_ctx.booleanValue("DescribeDrdsInstanceResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setDrdsInstanceId(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.DrdsInstanceId"));<NEW_LINE>data.setType(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.Type"));<NEW_LINE>data.setRegionId(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.RegionId"));<NEW_LINE>data.setZoneId(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.ZoneId"));<NEW_LINE>data.setDescription(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.Description"));<NEW_LINE>data.setNetworkType(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.NetworkType"));<NEW_LINE>data.setStatus(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.Status"));<NEW_LINE>data.setCreateTime(_ctx.longValue("DescribeDrdsInstanceResponse.Data.CreateTime"));<NEW_LINE>data.setVersion(_ctx.longValue("DescribeDrdsInstanceResponse.Data.Version"));<NEW_LINE>data.setInstanceSeries(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.InstanceSeries"));<NEW_LINE>data.setInstanceSpec(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.InstanceSpec"));<NEW_LINE>data.setVpcCloudInstanceId(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.VpcCloudInstanceId"));<NEW_LINE>data.setInstRole(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.InstRole"));<NEW_LINE>data.setCommodityCode(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.CommodityCode"));<NEW_LINE>data.setExpireDate(_ctx.longValue("DescribeDrdsInstanceResponse.Data.ExpireDate"));<NEW_LINE>data.setVersionAction<MASK><NEW_LINE>data.setLabel(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.Label"));<NEW_LINE>data.setMasterInstanceId(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.MasterInstanceId"));<NEW_LINE>data.setMachineType(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.MachineType"));<NEW_LINE>data.setOrderInstanceId(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.OrderInstanceId"));<NEW_LINE>data.setMysqlVersion(_ctx.integerValue("DescribeDrdsInstanceResponse.Data.MysqlVersion"));<NEW_LINE>data.setStorageType(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.StorageType"));<NEW_LINE>data.setResourceGroupId(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.ResourceGroupId"));<NEW_LINE>data.setProductVersion(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.ProductVersion"));<NEW_LINE>List<String> readOnlyDBInstanceIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDrdsInstanceResponse.Data.ReadOnlyDBInstanceIds.Length"); i++) {<NEW_LINE>readOnlyDBInstanceIds.add(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.ReadOnlyDBInstanceIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>data.setReadOnlyDBInstanceIds(readOnlyDBInstanceIds);<NEW_LINE>List<Vip> vips = new ArrayList<Vip>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDrdsInstanceResponse.Data.Vips.Length"); i++) {<NEW_LINE>Vip vip = new Vip();<NEW_LINE>vip.setDns(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.Vips[" + i + "].Dns"));<NEW_LINE>vip.setExpireDays(_ctx.longValue("DescribeDrdsInstanceResponse.Data.Vips[" + i + "].ExpireDays"));<NEW_LINE>vip.setPort(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.Vips[" + i + "].Port"));<NEW_LINE>vip.setType(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.Vips[" + i + "].Type"));<NEW_LINE>vip.setVpcId(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.Vips[" + i + "].VpcId"));<NEW_LINE>vip.setVswitchId(_ctx.stringValue("DescribeDrdsInstanceResponse.Data.Vips[" + i + "].VswitchId"));<NEW_LINE>vips.add(vip);<NEW_LINE>}<NEW_LINE>data.setVips(vips);<NEW_LINE>describeDrdsInstanceResponse.setData(data);<NEW_LINE>return describeDrdsInstanceResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeDrdsInstanceResponse.Data.VersionAction")); |
1,293,460 | public PerRoleOutliersAnswerElement answer(NetworkSnapshot snapshot) {<NEW_LINE>PerRoleOutliersQuestion question = (PerRoleOutliersQuestion) _question;<NEW_LINE>_answerElement = new PerRoleOutliersAnswerElement();<NEW_LINE>OutliersQuestion innerQ = new OutliersQuestionPlugin().createQuestion();<NEW_LINE>innerQ.setNamedStructTypes(question.getNamedStructTypes());<NEW_LINE>innerQ.setHypothesis(question.getHypothesis());<NEW_LINE>PerRoleQuestion outerQ = new PerRoleQuestion(null, innerQ, question.getRoleDimension(), question.getRoles());<NEW_LINE>PerRoleQuestionPlugin outerPlugin = new PerRoleQuestionPlugin();<NEW_LINE>PerRoleAnswerElement roleAE = outerPlugin.createAnswerer(outerQ, _batfish).answer(snapshot);<NEW_LINE>SortedMap<String, AnswerElement<MASK><NEW_LINE>SortedSet<NamedStructureOutlierSet<?>> nsOutliers = new TreeSet<>();<NEW_LINE>SortedSet<OutlierSet<NavigableSet<String>>> serverOutliers = new TreeSet<>();<NEW_LINE>for (Map.Entry<String, AnswerElement> entry : roleAnswers.entrySet()) {<NEW_LINE>String role = entry.getKey();<NEW_LINE>OutliersAnswerElement oae = (OutliersAnswerElement) entry.getValue();<NEW_LINE>for (NamedStructureOutlierSet<?> nsos : oae.getNamedStructureOutliers()) {<NEW_LINE>nsos.setRole(role);<NEW_LINE>nsOutliers.add(nsos);<NEW_LINE>}<NEW_LINE>for (OutlierSet<NavigableSet<String>> os : oae.getServerOutliers()) {<NEW_LINE>os.setRole(role);<NEW_LINE>serverOutliers.add(os);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_answerElement.setNamedStructureOutliers(nsOutliers);<NEW_LINE>_answerElement.setServerOutliers(serverOutliers);<NEW_LINE>return _answerElement;<NEW_LINE>} | > roleAnswers = roleAE.getAnswers(); |
23,776 | public static void triggerIntegrityDataGeneration(final String key, final String integrityDataRequestId) {<NEW_LINE><MASK><NEW_LINE>jobDataMap.put(IntegrityUtil.REQUESTER_KEY, key);<NEW_LINE>jobDataMap.put(IntegrityUtil.INTEGRITY_DATA_REQUEST_ID, integrityDataRequestId);<NEW_LINE>final JobDetail jobDetail = new JobDetail(JOB_NAME, JOB_GROUP, IntegrityDataGenerationJob.class);<NEW_LINE>jobDetail.setJobDataMap(jobDataMap);<NEW_LINE>jobDetail.setDurability(false);<NEW_LINE>jobDetail.setVolatility(false);<NEW_LINE>jobDetail.setRequestsRecovery(true);<NEW_LINE>final SimpleTrigger trigger = new SimpleTrigger(TRIGGER_NAME, TRIGGER_GROUP, new Date(System.currentTimeMillis()));<NEW_LINE>HibernateUtil.addCommitListenerNoThrow(Sneaky.sneaked(() -> {<NEW_LINE>getJobScheduler().scheduleJob(jobDetail, trigger);<NEW_LINE>}));<NEW_LINE>} | final JobDataMap jobDataMap = new JobDataMap(); |
996,430 | public void run() {<NEW_LINE>try {<NEW_LINE>File selectedFile = getFile();<NEW_LINE>BufferProject bufferProject = new BufferProject(getProject(), getUiFacade());<NEW_LINE>ProjectFileImporter importer = new ProjectFileImporter(bufferProject, getUiFacade().getTaskColumnList(), selectedFile);<NEW_LINE>importer.run();<NEW_LINE>List<Pair<Level, String>> errors = importer.getErrors();<NEW_LINE>getTaskManager().getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm().setEnabled(false);<NEW_LINE>getTaskManager().getAlgorithmCollection().getRecalculateTaskCompletionPercentageAlgorithm().setEnabled(false);<NEW_LINE>getTaskManager().getAlgorithmCollection().getScheduler().setEnabled(false);<NEW_LINE>Map<Task, Task> buffer2realTask = importBufferProject(getProject(), bufferProject, BufferProjectImportKt.asImportBufferProjectApi(getUiFacade()), myMergeResourcesOption, myImportCalendarOption);<NEW_LINE>Map<GanttTask, Date> originalDates = importer.getOriginalStartDates();<NEW_LINE><MASK><NEW_LINE>reportErrors(errors, "Import.MSProject");<NEW_LINE>} catch (Exception e) {<NEW_LINE>getUiFacade().showErrorDialog(e);<NEW_LINE>} finally {<NEW_LINE>getTaskManager().getAlgorithmCollection().getRecalculateTaskCompletionPercentageAlgorithm().setEnabled(true);<NEW_LINE>getTaskManager().getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm().setEnabled(true);<NEW_LINE>getTaskManager().getAlgorithmCollection().getScheduler().setEnabled(true);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>getTaskManager().getAlgorithmCollection().getRecalculateTaskCompletionPercentageAlgorithm().run();<NEW_LINE>getTaskManager().getAlgorithmCollection().getRecalculateTaskScheduleAlgorithm().run();<NEW_LINE>} catch (TaskDependencyException e) {<NEW_LINE>getUiFacade().showErrorDialog(e);<NEW_LINE>}<NEW_LINE>} | findChangedDates(originalDates, buffer2realTask, errors); |
931,693 | private Mono<Response<AddressResponseInner>> listVipsWithResponseAsync(String resourceGroupName, String name, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name 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.listVips(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
1,135,749 | public static DescribeGatherStatsResultResponse unmarshall(DescribeGatherStatsResultResponse describeGatherStatsResultResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGatherStatsResultResponse.setRequestId(_ctx.stringValue("DescribeGatherStatsResultResponse.RequestId"));<NEW_LINE>describeGatherStatsResultResponse.setCode(_ctx.stringValue("DescribeGatherStatsResultResponse.Code"));<NEW_LINE>describeGatherStatsResultResponse.setMessage(_ctx.stringValue("DescribeGatherStatsResultResponse.Message"));<NEW_LINE>GatherStatsResult gatherStatsResult = new GatherStatsResult();<NEW_LINE>Change change = new Change();<NEW_LINE>change.setChangeId(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeId"));<NEW_LINE>change.setEnvId(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.EnvId"));<NEW_LINE>change.setChangeName(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeName"));<NEW_LINE>change.setChangeDescription(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeDescription"));<NEW_LINE>change.setChangeFinished(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeFinished"));<NEW_LINE>change.setChangeSucceeded(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeSucceeded"));<NEW_LINE>change.setChangeAborted(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeAborted"));<NEW_LINE>change.setChangePaused(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangePaused"));<NEW_LINE>change.setChangeTimedout(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeTimedout"));<NEW_LINE>change.setCreateTime(_ctx.longValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.CreateTime"));<NEW_LINE>change.setUpdateTime(_ctx.longValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.UpdateTime"));<NEW_LINE>change.setFinishTime(_ctx.longValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.FinishTime"));<NEW_LINE>change.setActionName<MASK><NEW_LINE>change.setCreateUsername(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.CreateUsername"));<NEW_LINE>change.setChangeMessage(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ChangeMessage"));<NEW_LINE>gatherStatsResult.setChange(change);<NEW_LINE>List<InstanceResult> instanceResults = new ArrayList<InstanceResult>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults.Length"); i++) {<NEW_LINE>InstanceResult instanceResult = new InstanceResult();<NEW_LINE>instanceResult.setInstanceId(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].InstanceId"));<NEW_LINE>instanceResult.setStorageKey(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].StorageKey"));<NEW_LINE>instanceResult.setTaskSucceeded(_ctx.booleanValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].TaskSucceeded"));<NEW_LINE>instanceResult.setTaskMessage(_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.InstanceResults[" + i + "].TaskMessage"));<NEW_LINE>instanceResults.add(instanceResult);<NEW_LINE>}<NEW_LINE>gatherStatsResult.setInstanceResults(instanceResults);<NEW_LINE>describeGatherStatsResultResponse.setGatherStatsResult(gatherStatsResult);<NEW_LINE>return describeGatherStatsResultResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeGatherStatsResultResponse.GatherStatsResult.Change.ActionName")); |
898,223 | private boolean dropProcessInfo(Pair<Target, Parameters> key, @Nullable String errorMessage, @Nullable ProcessHandler handler) {<NEW_LINE>Info info;<NEW_LINE>synchronized (myProcMap) {<NEW_LINE><MASK><NEW_LINE>if (info != null && (handler == null || info.handler == handler)) {<NEW_LINE>myProcMap.remove(key);<NEW_LINE>myProcMap.notifyAll();<NEW_LINE>} else {<NEW_LINE>// different processHandler<NEW_LINE>info = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (info instanceof PendingInfo) {<NEW_LINE>PendingInfo pendingInfo = (PendingInfo) info;<NEW_LINE>if (pendingInfo.stderr.length() > 0 || pendingInfo.ref.isNull()) {<NEW_LINE>if (errorMessage != null)<NEW_LINE>pendingInfo.stderr.append(errorMessage);<NEW_LINE>pendingInfo.ref.set(new RunningInfo(null, -1, pendingInfo.stderr.toString()));<NEW_LINE>}<NEW_LINE>synchronized (pendingInfo.ref) {<NEW_LINE>pendingInfo.ref.notifyAll();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return info != null;<NEW_LINE>} | info = myProcMap.get(key); |
1,281,886 | public void showAtNotifications(final RequestContext context) {<NEW_LINE>final <MASK><NEW_LINE>final JSONObject currentUser = Sessions.getUser();<NEW_LINE>if (null == currentUser) {<NEW_LINE>context.sendError(403);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "home/notifications/at.ftl");<NEW_LINE>final Map<String, Object> dataModel = renderer.getDataModel();<NEW_LINE>final String userId = currentUser.optString(Keys.OBJECT_ID);<NEW_LINE>final int pageNum = Paginator.getPage(request);<NEW_LINE>final int pageSize = Symphonys.NOTIFICATION_LIST_CNT;<NEW_LINE>final int windowSize = Symphonys.NOTIFICATION_LIST_WIN_SIZE;<NEW_LINE>final JSONObject result = notificationQueryService.getAtNotifications(userId, pageNum, pageSize);<NEW_LINE>final List<JSONObject> atNotifications = (List<JSONObject>) result.get(Keys.RESULTS);<NEW_LINE>dataModel.put(Common.AT_NOTIFICATIONS, atNotifications);<NEW_LINE>final List<JSONObject> articleFollowAndWatchNotifications = new ArrayList<>();<NEW_LINE>for (final JSONObject notification : atNotifications) {<NEW_LINE>if (Notification.DATA_TYPE_C_AT != notification.optInt(Notification.NOTIFICATION_DATA_TYPE)) {<NEW_LINE>articleFollowAndWatchNotifications.add(notification);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>notificationMgmtService.makeRead(articleFollowAndWatchNotifications);<NEW_LINE>fillNotificationCount(userId, dataModel);<NEW_LINE>final int recordCnt = result.getInt(Pagination.PAGINATION_RECORD_COUNT);<NEW_LINE>final int pageCount = (int) Math.ceil((double) recordCnt / (double) pageSize);<NEW_LINE>final List<Integer> pageNums = Paginator.paginate(pageNum, pageSize, pageCount, windowSize);<NEW_LINE>if (!pageNums.isEmpty()) {<NEW_LINE>dataModel.put(Pagination.PAGINATION_FIRST_PAGE_NUM, pageNums.get(0));<NEW_LINE>dataModel.put(Pagination.PAGINATION_LAST_PAGE_NUM, pageNums.get(pageNums.size() - 1));<NEW_LINE>}<NEW_LINE>dataModel.put(Pagination.PAGINATION_CURRENT_PAGE_NUM, pageNum);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_COUNT, pageCount);<NEW_LINE>dataModel.put(Pagination.PAGINATION_PAGE_NUMS, pageNums);<NEW_LINE>dataModelService.fillHeaderAndFooter(context, dataModel);<NEW_LINE>} | Request request = context.getRequest(); |
287,555 | public TByteBuffer putLong(int index, long value) {<NEW_LINE>if (readOnly) {<NEW_LINE>throw new TReadOnlyBufferException();<NEW_LINE>}<NEW_LINE>if (index < 0 || index + 3 >= limit) {<NEW_LINE>throw new IndexOutOfBoundsException("Index " + index + " is outside of range [0;" + (limit - 3) + ")");<NEW_LINE>}<NEW_LINE>if (order == TByteOrder.BIG_ENDIAN) {<NEW_LINE>array[start + index + 0] = (byte) (value >> 56);<NEW_LINE>array[start + index + 1] = (byte) (value >> 48);<NEW_LINE>array[start + index + 2] = (byte) (value >> 40);<NEW_LINE>array[start + index + 3] = (byte) (value >> 32);<NEW_LINE>array[start + index + 4] = (byte) (value >> 24);<NEW_LINE>array[start + index + 5] = (byte) (value >> 16);<NEW_LINE>array[start + index + 6] = (byte) (value >> 8);<NEW_LINE>array[start + index + 7] = (byte) value;<NEW_LINE>} else {<NEW_LINE>array[start + index + 0] = (byte) value;<NEW_LINE>array[start + index + 1] = (byte) (value >> 8);<NEW_LINE>array[start + index + 2] = (byte) (value >> 16);<NEW_LINE>array[start + index + 3] = (byte) (value >> 24);<NEW_LINE>array[start + index + 4] = (byte) (value >> 24);<NEW_LINE>array[start + index + 5] = (<MASK><NEW_LINE>array[start + index + 6] = (byte) (value >> 24);<NEW_LINE>array[start + index + 7] = (byte) (value >> 24);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | byte) (value >> 24); |
1,157,030 | public CodegenExpression makeCodegen(CodegenClassScope classScope, CodegenMethodScope parent, SAIFFInitializeSymbolWEventType symbols) {<NEW_LINE>CodegenMethod method = parent.makeChild(FilterSpecParam.EPTYPE, FilterSpecParamConstantForge.class, classScope);<NEW_LINE>method.getBlock().declareVar(ExprFilterSpecLookupable.EPTYPE, "lookupable", localMethod(lookupable.makeCodegen(method, symbols, classScope))).declareVar(ExprFilterSpecLookupable.EPTYPE_FILTEROPERATOR, "op", enumValue(FilterOperator.class, filterOperator.name()));<NEW_LINE>CodegenExpressionNewAnonymousClass inner = newAnonymousClass(method.getBlock(), FilterSpecParam.EPTYPE, Arrays.asList(ref("lookupable"), ref("op")));<NEW_LINE>CodegenMethod getFilterValue = CodegenMethod.makeParentNode(FilterValueSetParam.EPTYPE, this.getClass(), classScope).addParam(FilterSpecParam.GET_FILTER_VALUE_FP);<NEW_LINE>inner.addMethod("getFilterValue", getFilterValue);<NEW_LINE>getFilterValue.getBlock().methodReturn(FilterValueSetParamImpl.<MASK><NEW_LINE>method.getBlock().methodReturn(inner);<NEW_LINE>return localMethod(method);<NEW_LINE>} | codegenNew(constant(filterConstant))); |
878,716 | protected void initializeProcess() throws IOException, DecompileException {<NEW_LINE>if (decompCallback == null) {<NEW_LINE>throw new IOException("Program not opened in decompiler");<NEW_LINE>}<NEW_LINE>if (decompProcess == null) {<NEW_LINE>decompProcess = DecompileProcessFactory.get();<NEW_LINE>} else if (!decompProcess.isReady()) {<NEW_LINE>DecompileProcessFactory.release(decompProcess);<NEW_LINE>decompProcess = DecompileProcessFactory.get();<NEW_LINE>}<NEW_LINE>long uniqueBase = UniqueLayout.SLEIGH_BASE.getOffset(pcodelanguage);<NEW_LINE>String tspec = pcodelanguage.buildTranslatorTag(program.getAddressFactory(), uniqueBase, null);<NEW_LINE>String coretypes = dtmanage.buildCoreTypes();<NEW_LINE>SleighLanguageDescription sleighdescription = <MASK><NEW_LINE>ResourceFile pspecfile = sleighdescription.getSpecFile();<NEW_LINE>String pspecxml = fileToString(pspecfile);<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>compilerSpec.saveXml(buffer);<NEW_LINE>String cspecxml = buffer.toString();<NEW_LINE>decompCallback.setNativeMessage(null);<NEW_LINE>decompProcess.registerProgram(decompCallback, pspecxml, cspecxml, tspec, coretypes);<NEW_LINE>String nativeMessage = decompCallback.getNativeMessage();<NEW_LINE>if ((nativeMessage != null) && (nativeMessage.length() != 0)) {<NEW_LINE>throw new IOException("Could not register program: " + nativeMessage);<NEW_LINE>}<NEW_LINE>if (xmlOptions != null) {<NEW_LINE>decompProcess.setMaxResultSize(xmlOptions.getMaxPayloadMBytes());<NEW_LINE>if (!decompProcess.sendCommand1Param("setOptions", xmlOptions.getXML(this)).toString().equals("t")) {<NEW_LINE>throw new IOException("Did not accept decompiler options");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (actionname == null) {<NEW_LINE>throw new IOException("Decompile action not specified");<NEW_LINE>}<NEW_LINE>if (!actionname.equals("decompile")) {<NEW_LINE>if (!decompProcess.sendCommand2Params("setAction", actionname, "").toString().equals("t")) {<NEW_LINE>throw new IOException("Could not set decompile action");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!printSyntaxTree) {<NEW_LINE>if (!decompProcess.sendCommand2Params("setAction", "", "notree").toString().equals("t")) {<NEW_LINE>throw new IOException("Could not turn off syntax tree");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!printCCode) {<NEW_LINE>if (!decompProcess.sendCommand2Params("setAction", "", "noc").toString().equals("t")) {<NEW_LINE>throw new IOException("Could not turn off C printing");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sendParamMeasures) {<NEW_LINE>if (!decompProcess.sendCommand2Params("setAction", "", "parammeasures").toString().equals("t")) {<NEW_LINE>throw new IOException("Could not turn on sending of parameter measures");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (jumpLoad) {<NEW_LINE>if (!decompProcess.sendCommand2Params("setAction", "", "jumpload").toString().equals("t")) {<NEW_LINE>throw new IOException("Could not turn on jumptable loads");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (SleighLanguageDescription) pcodelanguage.getLanguageDescription(); |
1,374,676 | private static Map<TypeAlias, jnr.ffi.NativeType> buildTypeMap() {<NEW_LINE>Map<TypeAlias, jnr.ffi.NativeType> m = new EnumMap<TypeAlias, jnr.ffi.NativeType>(TypeAlias.class);<NEW_LINE>m.put(<MASK><NEW_LINE>m.put(TypeAlias.u_int8_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.int16_t, NativeType.SSHORT);<NEW_LINE>m.put(TypeAlias.u_int16_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.int32_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.u_int32_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.int64_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.u_int64_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.intptr_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.uintptr_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.caddr_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.dev_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.blkcnt_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.blksize_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.gid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_addr_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_port_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.ino_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.key_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.mode_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.nlink_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.id_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.pid_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.off_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.swblk_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.uid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.clock_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.size_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.ssize_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.time_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.fsblkcnt_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.fsfilcnt_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.sa_family_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.socklen_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.rlim_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.cc_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.speed_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.tcflag_t, NativeType.UINT);<NEW_LINE>return m;<NEW_LINE>} | TypeAlias.int8_t, NativeType.SCHAR); |
1,271,993 | protected void encodeMarkup(FacesContext context, Terminal terminal) throws IOException {<NEW_LINE>String clientId = terminal.getClientId(context);<NEW_LINE>String style = terminal.getStyle();<NEW_LINE>String styleClass = terminal.getStyleClass();<NEW_LINE>styleClass = (styleClass == null) ? Terminal.CONTAINER_CLASS : Terminal.CONTAINER_CLASS + " " + styleClass;<NEW_LINE>String welcomeMessage = terminal.getWelcomeMessage();<NEW_LINE>String prompt = terminal.getPrompt();<NEW_LINE>String inputId = clientId + "_input";<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>writer.startElement("div", terminal);<NEW_LINE>writer.writeAttribute("id", clientId, "id");<NEW_LINE>writer.writeAttribute("class", styleClass, "styleClass");<NEW_LINE>if (style != null) {<NEW_LINE>writer.writeAttribute("style", style, "style");<NEW_LINE>}<NEW_LINE>if (welcomeMessage != null) {<NEW_LINE>writer.startElement("div", null);<NEW_LINE>if (terminal.isEscape()) {<NEW_LINE>writer.writeText(welcomeMessage, null);<NEW_LINE>} else {<NEW_LINE>writer.write(welcomeMessage);<NEW_LINE>}<NEW_LINE>writer.endElement("div");<NEW_LINE>}<NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.writeAttribute(<MASK><NEW_LINE>writer.endElement("div");<NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.writeAttribute("class", Terminal.PROMPT_CLASS, null);<NEW_LINE>if (terminal.isEscape()) {<NEW_LINE>writer.writeText(prompt, null);<NEW_LINE>} else {<NEW_LINE>writer.write(prompt);<NEW_LINE>}<NEW_LINE>writer.endElement("span");<NEW_LINE>writer.startElement("input", null);<NEW_LINE>writer.writeAttribute("id", inputId, null);<NEW_LINE>writer.writeAttribute("name", inputId, null);<NEW_LINE>writer.writeAttribute("type", "text", null);<NEW_LINE>writer.writeAttribute("autocomplete", "off", null);<NEW_LINE>writer.writeAttribute("class", Terminal.INPUT_CLASS, null);<NEW_LINE>writer.endElement("input");<NEW_LINE>writer.endElement("div");<NEW_LINE>writer.endElement("div");<NEW_LINE>} | "class", Terminal.CONTENT_CLASS, null); |
1,552,684 | private void processProvideCall(NodeTraversal t, Node call, Node parent) {<NEW_LINE>checkState(call.isCall());<NEW_LINE>if (!verifyOnlyArgumentIsString(call)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Node left = call.getFirstChild();<NEW_LINE>Node arg = left.getNext();<NEW_LINE>String ns = arg.getString();<NEW_LINE>JSDocInfo info = NodeUtil.getBestJSDocInfo(call);<NEW_LINE>boolean isImplicitlyInitialized = info != null && info.isProvideAlreadyProvided();<NEW_LINE>if (providedNames.containsKey(ns)) {<NEW_LINE>ProvidedName previouslyProvided = providedNames.get(ns);<NEW_LINE>if (!previouslyProvided.isExplicitlyProvided()) {<NEW_LINE>previouslyProvided.addProvide(parent, t.getChunk(), true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>registerAnyProvidedPrefixes(ns, parent, t.getChunk());<NEW_LINE>providedNames.put(ns, new ProvidedNameBuilder().setNamespace(ns).setNode(parent).setChunk(t.getChunk()).setExplicit(true).setHasImplicitInitialization<MASK><NEW_LINE>}<NEW_LINE>} | (isImplicitlyInitialized).build()); |
292,047 | public List<QuotaBalanceVO> doInTransaction(final TransactionStatus status) {<NEW_LINE>if ((lastbalancedate != null) && (beforeThis != null) && lastbalancedate.before(beforeThis)) {<NEW_LINE>Filter filter = new Filter(QuotaBalanceVO.class, "updatedOn", <MASK><NEW_LINE>QueryBuilder<QuotaBalanceVO> qb = QueryBuilder.create(QuotaBalanceVO.class);<NEW_LINE>qb.and(qb.entity().getAccountId(), SearchCriteria.Op.EQ, accountId);<NEW_LINE>qb.and(qb.entity().getDomainId(), SearchCriteria.Op.EQ, domainId);<NEW_LINE>qb.and(qb.entity().getCreditsId(), SearchCriteria.Op.GT, 0);<NEW_LINE>qb.and(qb.entity().getUpdatedOn(), SearchCriteria.Op.BETWEEN, lastbalancedate, beforeThis);<NEW_LINE>return search(qb.create(), filter);<NEW_LINE>} else {<NEW_LINE>return new ArrayList<QuotaBalanceVO>();<NEW_LINE>}<NEW_LINE>} | true, 0L, Long.MAX_VALUE); |
437,081 | public static void init(List<String> classPathEntries, Problems problems) {<NEW_LINE>checkState(packageInfoCacheStorage.get() == null, "PackageInfoCache should only be initialized once per thread.");<NEW_LINE>// Constructs a URLClassLoader to do the dirty work of finding package-info.class files in the<NEW_LINE>// classpath of the compile.<NEW_LINE>List<URL> classPathUrls = new ArrayList<>();<NEW_LINE>for (String classPathEntry : classPathEntries) {<NEW_LINE>try {<NEW_LINE>classPathUrls.add(<MASK><NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>problems.fatal(FatalError.CANNOT_OPEN_FILE, e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>URLClassLoader resourcesClassLoader = new URLClassLoader(Iterables.toArray(classPathUrls, URL.class), PackageInfoCache.class.getClassLoader());<NEW_LINE>packageInfoCacheStorage.set(new PackageInfoCache(resourcesClassLoader, problems));<NEW_LINE>} | new URL("file:" + classPathEntry)); |
74,261 | private void delegateResource(byte[] ownerAddress, byte[] receiverAddress, long frozenBalance, long expireTime, boolean isBandwidth, Repository repo) {<NEW_LINE>byte[] key = DelegatedResourceCapsule.createDbKey(ownerAddress, receiverAddress);<NEW_LINE>// insert or update DelegateResource<NEW_LINE>DelegatedResourceCapsule delegatedResourceCapsule = repo.getDelegatedResource(key);<NEW_LINE>if (delegatedResourceCapsule == null) {<NEW_LINE>delegatedResourceCapsule = new DelegatedResourceCapsule(ByteString.copyFrom(ownerAddress), ByteString.copyFrom(receiverAddress));<NEW_LINE>}<NEW_LINE>if (isBandwidth) {<NEW_LINE>delegatedResourceCapsule.addFrozenBalanceForBandwidth(frozenBalance, expireTime);<NEW_LINE>} else {<NEW_LINE>delegatedResourceCapsule.addFrozenBalanceForEnergy(frozenBalance, expireTime);<NEW_LINE>}<NEW_LINE>repo.updateDelegatedResource(key, delegatedResourceCapsule);<NEW_LINE>// do delegating resource to receiver account<NEW_LINE>AccountCapsule receiverCapsule = repo.getAccount(receiverAddress);<NEW_LINE>if (isBandwidth) {<NEW_LINE>receiverCapsule.addAcquiredDelegatedFrozenBalanceForBandwidth(frozenBalance);<NEW_LINE>} else {<NEW_LINE>receiverCapsule.addAcquiredDelegatedFrozenBalanceForEnergy(frozenBalance);<NEW_LINE>}<NEW_LINE>repo.updateAccount(<MASK><NEW_LINE>} | receiverCapsule.createDbKey(), receiverCapsule); |
1,270,371 | protected List<Element> expandDateMonth(Document doc, String s) {<NEW_LINE>ArrayList<Element> exp = new ArrayList<Element>();<NEW_LINE>Matcher reMatcher = reMonth.matcher(s);<NEW_LINE>boolean found = reMatcher.find();<NEW_LINE>// month == (0)1, (0)2, ... , 12<NEW_LINE>int monthType = 1;<NEW_LINE>if (!found) {<NEW_LINE>reMatcher = reMonthword.matcher(s);<NEW_LINE>found = reMatcher.find();<NEW_LINE>// month == Januar, Februar, ...<NEW_LINE>monthType = 2;<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE><MASK><NEW_LINE>found = reMatcher.find();<NEW_LINE>// month == Jan, Feb, ...<NEW_LINE>monthType = 3;<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String month = reMatcher.group(1);<NEW_LINE>// Leading Zero must be deleted to get month from monthabbr.<NEW_LINE>if (month.charAt(0) == '0')<NEW_LINE>month = month.substring(1);<NEW_LINE>if (monthType == 1 || monthType == 3) {<NEW_LINE>String expandedMonth = (String) monthabbr.get(month);<NEW_LINE>exp.addAll(makeNewTokens(doc, expandedMonth));<NEW_LINE>} else if (monthType == 2) {<NEW_LINE>exp.addAll(makeNewTokens(doc, month));<NEW_LINE>}<NEW_LINE>// StringBuffer sb<NEW_LINE>return exp;<NEW_LINE>} | reMatcher = reMonthabbr.matcher(s); |
946,433 | final DeleteReportResult executeDeleteReport(DeleteReportRequest deleteReportRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteReportRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteReportRequest> request = null;<NEW_LINE>Response<DeleteReportResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteReportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteReportRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CodeBuild");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteReport");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteReportResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteReportResultJsonUnmarshaller());<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>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,577,131 | // private Gson gson = new GsonBuilder()<NEW_LINE>// .setLenient()<NEW_LINE>// .serializeSpecialFloatingPointValues()<NEW_LINE>// .setPrettyPrinting()<NEW_LINE>// .registerTypeAdapterFactory(serverBuilderFactory)<NEW_LINE>// // .registerTypeAdapterFactory(new ImageServerTypeAdapterFactory())<NEW_LINE>// .create();<NEW_LINE>@Override<NEW_LINE>public void write(JsonWriter out, ImageServer<BufferedImage> server) throws IOException {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>out.setLenient(true);<NEW_LINE>var builder = server.getBuilder();<NEW_LINE>out.beginObject();<NEW_LINE>out.name("builder");<NEW_LINE>GsonTools.getInstance().toJson(builder, ServerBuilder.class, out);<NEW_LINE>if (includeMetadata) {<NEW_LINE>out.name("metadata");<NEW_LINE>var metadata = server.getMetadata();<NEW_LINE>GsonTools.getInstance().toJson(metadata, ImageServerMetadata.class, out);<NEW_LINE>}<NEW_LINE>out.endObject();<NEW_LINE>return;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>} finally {<NEW_LINE>out.setLenient(lenient);<NEW_LINE>}<NEW_LINE>} | boolean lenient = out.isLenient(); |
1,551,463 | private int reversePairsHelper2(int[] nums, int left, int right) {<NEW_LINE>if (left >= right)<NEW_LINE>return 0;<NEW_LINE>int mid = (left + right) >> 1;<NEW_LINE>int count = reversePairsHelper2(nums, left, mid) + reversePairsHelper2(nums, mid + 1, right);<NEW_LINE>int[] tmp = new int[right - left + 1];<NEW_LINE>int k = 0, j = mid + 1, p = mid + 1;<NEW_LINE>for (int i = left; i <= mid; i++) {<NEW_LINE>while (j <= right && nums[i] > (long) nums[j] << 1) j++;<NEW_LINE>while (p <= right && nums[i] > nums[p]) tmp[k++] = nums[p++];<NEW_LINE>tmp[k++] = nums[i];<NEW_LINE>count += j - mid - 1;<NEW_LINE>}<NEW_LINE>while (p <= right) tmp[k<MASK><NEW_LINE>System.arraycopy(tmp, 0, nums, left, tmp.length);<NEW_LINE>return count;<NEW_LINE>} | ++] = nums[p++]; |
224,747 | public RedisSink genStreamSink(AbstractTargetTableInfo targetTableInfo) {<NEW_LINE>RedisTableInfo redisTableInfo = (RedisTableInfo) targetTableInfo;<NEW_LINE>this.url = redisTableInfo.getUrl();<NEW_LINE>this.database = redisTableInfo.getDatabase();<NEW_LINE>this.password = redisTableInfo.getPassword();<NEW_LINE>this.tableName = redisTableInfo.getTablename();<NEW_LINE>this.primaryKeys = redisTableInfo.getPrimaryKeys();<NEW_LINE>this.redisType = redisTableInfo.getRedisType();<NEW_LINE>this.maxTotal = redisTableInfo.getMaxTotal();<NEW_LINE>this.maxIdle = redisTableInfo.getMaxIdle();<NEW_LINE>this.minIdle = redisTableInfo.getMinIdle();<NEW_LINE>this.masterName = redisTableInfo.getMasterName();<NEW_LINE>this<MASK><NEW_LINE>this.parallelism = Objects.isNull(redisTableInfo.getParallelism()) ? parallelism : redisTableInfo.getParallelism();<NEW_LINE>this.registerTableName = redisTableInfo.getName();<NEW_LINE>this.keyExpiredTime = redisTableInfo.getKeyExpiredTime();<NEW_LINE>return this;<NEW_LINE>} | .timeout = redisTableInfo.getTimeout(); |
1,171,696 | public TBigInteger toBigIntegerExact() {<NEW_LINE>if ((scale == 0) || (isZero())) {<NEW_LINE>return getUnscaledValue();<NEW_LINE>} else if (scale < 0) {<NEW_LINE>return getUnscaledValue().multiply(TMultiplication.powerOf10<MASK><NEW_LINE>} else {<NEW_LINE>// (scale > 0)<NEW_LINE>TBigInteger[] integerAndFraction;<NEW_LINE>// An optimization before do a heavy division<NEW_LINE>if ((scale > aproxPrecision()) || (scale > getUnscaledValue().getLowestSetBit())) {<NEW_LINE>throw new ArithmeticException("Rounding necessary");<NEW_LINE>}<NEW_LINE>integerAndFraction = getUnscaledValue().divideAndRemainder(TMultiplication.powerOf10(scale));<NEW_LINE>if (integerAndFraction[1].signum() != 0) {<NEW_LINE>// It exists a non-zero fractional part<NEW_LINE>throw new ArithmeticException("Rounding necessary");<NEW_LINE>}<NEW_LINE>return integerAndFraction[0];<NEW_LINE>}<NEW_LINE>} | (-(long) scale)); |
1,678,983 | private Mono<Response<FactoryInner>> updateWithResponseAsync(String resourceGroupName, String factoryName, FactoryUpdateParameters factoryUpdateParameters, 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 (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>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (factoryName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (factoryUpdateParameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter factoryUpdateParameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>factoryUpdateParameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, factoryName, this.client.getApiVersion(), factoryUpdateParameters, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter factoryName is required and cannot be null.")); |
946,797 | public boolean isExposed(String itemName) {<NEW_LINE>NeeoUtil.requireNotEmpty(itemName, "itemName cannot be empty");<NEW_LINE>logger.trace("isExposed: {}", itemName);<NEW_LINE>for (NeeoDeviceChannel channel : channels) {<NEW_LINE>final boolean notExcluded = channel.getType() != NeeoCapabilityType.EXCLUDE;<NEW_LINE>final boolean notEmpty = !channel.getType().toString().isEmpty();<NEW_LINE>final boolean isItemMatch = itemName.<MASK><NEW_LINE>logger.trace("isExposed(channel): {} --- notExcluded({}) -- notEmpty({}) -- isItemMatch({}) -- {}", itemName, notExcluded, notEmpty, isItemMatch, channel);<NEW_LINE>if (notExcluded && notEmpty && isItemMatch) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.trace("isExposed (FALSE): {}", itemName);<NEW_LINE>return false;<NEW_LINE>} | equalsIgnoreCase(channel.getItemName()); |
1,593,064 | public void addDependencies(String[] typeNameDependencies) {<NEW_LINE>// if each qualified type name is already known then all of its subNames can be skipped<NEW_LINE>// and its expected that very few qualified names in typeNameDependencies need to be added<NEW_LINE>// but could always take 'p1.p2.p3.X' and make all qualified names 'p1' 'p1.p2' 'p1.p2.p3' 'p1.p2.p3.X', then intern<NEW_LINE>next: for (String typeNameDependency : typeNameDependencies) {<NEW_LINE>char[][] qualifiedTypeName = CharOperation.splitOn('.', typeNameDependency.toCharArray());<NEW_LINE>if (!isWellKnownQualifiedName(qualifiedTypeName)) {<NEW_LINE>int qLength = qualifiedTypeName.length;<NEW_LINE>QualifiedNameSet internedNames = InternedQualifiedNames[qLength <= MaxQualifiedNames ? qLength - 1 : 0];<NEW_LINE>qualifiedTypeName = internSimpleNames(qualifiedTypeName, false, false);<NEW_LINE>qualifiedTypeName = internedNames.add(qualifiedTypeName);<NEW_LINE>int idx;<NEW_LINE>while ((idx = Arrays.binarySearch(this.qualifiedNameReferences, qualifiedTypeName, SortedCharArrays.CHAR_CHAR_ARR_COMPARATOR)) < 0) {<NEW_LINE>this.simpleNameReferences = ensureContainedInSortedOrder(this.simpleNameReferences, qualifiedTypeName<MASK><NEW_LINE>this.rootReferences = ensureContainedInSortedOrder(this.rootReferences, qualifiedTypeName[0]);<NEW_LINE>int length = this.qualifiedNameReferences.length;<NEW_LINE>idx = -(idx + 1);<NEW_LINE>this.qualifiedNameReferences = SortedCharArrays.insertIntoArray(this.qualifiedNameReferences, new char[length + 1][][], qualifiedTypeName, idx, this.qualifiedNameReferences.length);<NEW_LINE>qualifiedTypeName = CharOperation.subarray(qualifiedTypeName, 0, qualifiedTypeName.length - 1);<NEW_LINE>char[][][] temp = internQualifiedNames(new char[][][] { qualifiedTypeName }, false);<NEW_LINE>if (temp == EmptyQualifiedNames)<NEW_LINE>// qualifiedTypeName is a well known name<NEW_LINE>continue next;<NEW_LINE>qualifiedTypeName = temp[0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | [qualifiedTypeName.length - 1]); |
122,279 | static public void resizeImage(PImage img, int w, int h) {<NEW_LINE>// ignore<NEW_LINE>if (w <= 0 && h <= 0) {<NEW_LINE>throw new IllegalArgumentException("width or height must be > 0 for resize");<NEW_LINE>}<NEW_LINE>if (w == 0) {<NEW_LINE>// Use height to determine relative size<NEW_LINE>float diff = (float) h / (float) img.height;<NEW_LINE>w = (int) (img.width * diff);<NEW_LINE>} else if (h == 0) {<NEW_LINE>// Use the width to determine relative size<NEW_LINE>float diff = (float) w / (float) img.width;<NEW_LINE>h = (int) (img.height * diff);<NEW_LINE>}<NEW_LINE>BufferedImage bimg = shrinkImage((BufferedImage) img.getNative(), w * img.pixelDensity, h * img.pixelDensity);<NEW_LINE>PImage temp = new PImageAWT(bimg);<NEW_LINE>img.pixelWidth = temp.width;<NEW_LINE>img.pixelHeight = temp.height;<NEW_LINE>// Get the resized pixel array<NEW_LINE>img.pixels = temp.pixels;<NEW_LINE>img.width <MASK><NEW_LINE>img.height = img.pixelHeight / img.pixelDensity;<NEW_LINE>// Mark the pixels array as altered<NEW_LINE>img.updatePixels();<NEW_LINE>} | = img.pixelWidth / img.pixelDensity; |
258,730 | private void processBeanPropertyValues(Object bean, String beanName) {<NEW_LINE>Collection<SpringValueDefinition> propertySpringValues = beanName2SpringValueDefinitions.get(beanName);<NEW_LINE>if (propertySpringValues == null || propertySpringValues.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (SpringValueDefinition definition : propertySpringValues) {<NEW_LINE>try {<NEW_LINE>PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(bean.getClass(), definition.getPropertyName());<NEW_LINE>Method method = pd.getWriteMethod();<NEW_LINE>if (method == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>SpringValue springValue = new SpringValue(definition.getKey(), definition.getPlaceholder(), bean, beanName, method, false);<NEW_LINE>springValueRegistry.register(beanFactory, definition.getKey(), springValue);<NEW_LINE>logger.debug("Monitoring {}", springValue);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>logger.error("Failed to enable auto update feature for {}.{}", bean.getClass(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// clear<NEW_LINE>beanName2SpringValueDefinitions.removeAll(beanName);<NEW_LINE>} | ), definition.getPropertyName()); |
1,744,425 | public void render(Map<String, Object> context, String templateFile, Handler<AsyncResult<Buffer>> handler) {<NEW_LINE>try {<NEW_LINE>String src = adjustLocation(templateFile);<NEW_LINE>TemplateHolder<CompiledTemplate> template = getTemplate(src);<NEW_LINE>if (template == null) {<NEW_LINE>int idx = src.lastIndexOf('/');<NEW_LINE>String baseDir = "";<NEW_LINE>if (idx != -1) {<NEW_LINE>baseDir = <MASK><NEW_LINE>}<NEW_LINE>if (!vertx.fileSystem().existsBlocking(src)) {<NEW_LINE>handler.handle(Future.failedFuture("Cannot find template " + src));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>template = new TemplateHolder<>(TemplateCompiler.compileTemplate(vertx.fileSystem().readFileBlocking(src).toString(Charset.defaultCharset())), baseDir);<NEW_LINE>putTemplate(src, template);<NEW_LINE>}<NEW_LINE>final CompiledTemplate mvel = template.template();<NEW_LINE>final String baseDir = template.baseDir();<NEW_LINE>handler.handle(Future.succeededFuture(Buffer.buffer((String) new TemplateRuntime(mvel.getTemplate(), null, mvel.getRoot(), baseDir).execute(new StringAppender(), context, new ImmutableDefaultFactory()))));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>handler.handle(Future.failedFuture(ex));<NEW_LINE>}<NEW_LINE>} | src.substring(0, idx); |
30,240 | protected void triggerNow(GCCompletion completion) {<NEW_LINE>if (!dbf.isExist(primaryStorageUuid, PrimaryStorageVO.class)) {<NEW_LINE>completion.cancel();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!dbf.isExist(hostUuid, HostVO.class)) {<NEW_LINE>completion.cancel();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LocalStorageKvmBackend.DeleteBitsCmd cmd = new LocalStorageKvmBackend.DeleteBitsCmd();<NEW_LINE>cmd.setPath(installPath);<NEW_LINE>cmd.setHostUuid(hostUuid);<NEW_LINE>cmd.storagePath = Q.New(PrimaryStorageVO.class).eq(PrimaryStorageVO_.uuid, primaryStorageUuid).select(<MASK><NEW_LINE>String path = isDir ? LocalStorageKvmBackend.DELETE_DIR_PATH : LocalStorageKvmBackend.DELETE_BITS_PATH;<NEW_LINE>new KvmCommandSender(hostUuid).send(cmd, path, new KvmCommandFailureChecker() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ErrorCode getError(KvmResponseWrapper wrapper) {<NEW_LINE>LocalStorageKvmBackend.DeleteBitsRsp rsp = wrapper.getResponse(LocalStorageKvmBackend.DeleteBitsRsp.class);<NEW_LINE>return rsp.isSuccess() ? null : operr("operation error, because:%s", rsp.getError());<NEW_LINE>}<NEW_LINE>}, new ReturnValueCompletion<KvmResponseWrapper>(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(KvmResponseWrapper ret) {<NEW_LINE>completion.success();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>completion.fail(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | PrimaryStorageVO_.url).findValue(); |
52,287 | private void loadNode93() {<NEW_LINE>UaMethodNode node = new UaMethodNode(this.context, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_OpenWithMasks, new QualifiedName(0, "OpenWithMasks"), new LocalizedText("en", "OpenWithMasks"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), true, true);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_OpenWithMasks, Identifiers.HasProperty, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_OpenWithMasks_InputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_OpenWithMasks, Identifiers.HasProperty, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_OpenWithMasks_OutputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_OpenWithMasks, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_OpenWithMasks, Identifiers.HasComponent, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
1,425,433 | private void appendParagraph(String text, Element root, Locale defaultLocale) {<NEW_LINE>Element insertHere = root;<NEW_LINE>String rootLanguage = root.getAttribute("xml:lang");<NEW_LINE>String textLanguage = MaryUtils.locale2xmllang(determineLocale(text, defaultLocale));<NEW_LINE>if (!textLanguage.equals(rootLanguage)) {<NEW_LINE>Element voiceElement = MaryXML.appendChildElement(root, MaryXML.VOICE);<NEW_LINE>voiceElement.setAttribute("xml:lang", textLanguage);<NEW_LINE>insertHere = voiceElement;<NEW_LINE>}<NEW_LINE>insertHere = MaryXML.<MASK><NEW_LINE>// Now insert the entire plain text as a single text node<NEW_LINE>insertHere.appendChild(root.getOwnerDocument().createTextNode(text));<NEW_LINE>// And, for debugging, read it:<NEW_LINE>Text textNode = (Text) insertHere.getFirstChild();<NEW_LINE>String textNodeString = textNode.getData();<NEW_LINE>logger.debug("textNodeString=`" + textNodeString + "'");<NEW_LINE>} | appendChildElement(insertHere, MaryXML.PARAGRAPH); |
191,548 | private Mono<Void> v2Push(CFPushArguments params) {<NEW_LINE>String appName = params.getAppName();<NEW_LINE>// Routes are set AFTER push, so for initial push, make sure no route is set<NEW_LINE>boolean noRoute = true;<NEW_LINE>// Environment variables require app start, so for initial push, do not start app.<NEW_LINE>// This will happen afterwards<NEW_LINE>boolean noStart = true;<NEW_LINE>PushApplicationManifestRequest req = PushApplicationManifestRequest.builder().manifest(// resource matching occurs under the hood in the push operation<NEW_LINE>ApplicationManifest.builder().name(appName).path(params.getApplicationDataAsFile().toPath()).memory(params.getMemory()).disk(params.getDiskQuota()).timeout(params.getTimeout()).healthCheckType(resolveHealthCheckType(params.getHealthCheckType()).orElse(null)).healthCheckHttpEndpoint(params.getHealthCheckHttpEndpoint() == null ? "/" : params.getHealthCheckHttpEndpoint()).buildpack(params.getBuildpack()).command(params.getCommand()).stack(params.getStack()).noRoute(noRoute).instances(params.getInstances()).build()).noStart(noStart).build();<NEW_LINE>return log("client.applications.pushManifest(" + req + ")", _operations.applications().pushManifest(req)).then(mono_debug("Updating routes, bound services, and environment variables...")).then(getApplicationDetail(appName)).flatMap((appDetail) -> {<NEW_LINE>return // This requires app restart<NEW_LINE>Flux.// This requires app restart<NEW_LINE>merge(// This requires app restart<NEW_LINE>setRoutes(appDetail, params.getRoutes(), params.getRandomRoute()), // This requires app restart<NEW_LINE>bindAndUnbindServices(appName, params.getServices()), setEnvVars(appDetail, params.getEnv())).then();<NEW_LINE>}).// Start app only after environment variables are set<NEW_LINE>then(params.isNoStart() ? stopApp(appName) : restartApp(appName)).<MASK><NEW_LINE>} | then(Mono.empty()); |
1,235,276 | private void traverseFilesystem(File file) {<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)<NEW_LINE>return;<NEW_LINE>File[] list = file.listFiles();<NEW_LINE>if (list == null)<NEW_LINE>return;<NEW_LINE>List<String> availableCores = Arrays.asList(getAvailableCores());<NEW_LINE>// Check each file in a directory to see if it's a native library.<NEW_LINE>for (int i = 0; i < list.length; i++) {<NEW_LINE>File child = list[i];<NEW_LINE>String name = child.getName();<NEW_LINE>if (name.startsWith("lib") && name.endsWith(".so") && !name.contains("retroarch-activity")) {<NEW_LINE>// Found a native library!<NEW_LINE>String core = name.subSequence(3, name.length() - 3).toString();<NEW_LINE>String filename = child.getAbsolutePath();<NEW_LINE>SharedPreferences prefs = UserPreferences.getPreferences(this);<NEW_LINE>if (!prefs.getBoolean("core_deleted_" + core, false) && availableCores.contains(core)) {<NEW_LINE>// Generate the destination filename and delete any existing symlinks / cores<NEW_LINE>String newFilename = getCorePath() + core + "_libretro_android.so";<NEW_LINE>new <MASK><NEW_LINE>try {<NEW_LINE>Os.symlink(filename, newFilename);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Symlink failed to be created. Should never happen.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (file.isDirectory()) {<NEW_LINE>// Found another directory, so traverse it<NEW_LINE>traverseFilesystem(child);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | File(newFilename).delete(); |
764,420 | void applyTo(TaskMonitor monitor, MessageLog log) {<NEW_LINE>while (xmlParser.hasNext()) {<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>XmlElement elem = xmlParser.peek();<NEW_LINE>if (elem.isEnd() && elem.getName().equals("function")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// line number start tag<NEW_LINE>elem = xmlParser.next();<NEW_LINE>String sourcefileName = elem.getAttribute("source_file");<NEW_LINE>int start = XmlUtilities.parseInt(elem.getAttribute("start"));<NEW_LINE>int addr = XmlUtilities.parseInt(elem.getAttribute("addr"));<NEW_LINE>Address address = <MASK><NEW_LINE>// The following line was changed from getCodeUnitAt(address) to<NEW_LINE>// getCodeUnitContaining(address) in order to fix an issue where the PDB associates<NEW_LINE>// a line number with base part of an instruction instead of the prefix part of an<NEW_LINE>// instruction. In particular, Microsoft emits a "REP RET" (f3 c3) sequence, where<NEW_LINE>// the "REP" is an instruction prefix, in order to avoid a branch prediction penalty<NEW_LINE>// for AMD processors. However, Microsoft associates the line number of the<NEW_LINE>// instruction with the address of the "RET" (c3) instead of with the address of the<NEW_LINE>// "REP" (f3) portion (beginning) of the instruction.<NEW_LINE>CodeUnit cu = program.getListing().getCodeUnitContaining(address);<NEW_LINE>if (cu == null) {<NEW_LINE>log.appendMsg("PDB", "Could not apply source code line number (no code unit found at " + address + ")");<NEW_LINE>} else {<NEW_LINE>cu.setProperty("Source Path", sourcefileName);<NEW_LINE>cu.setProperty("Source File", new File(sourcefileName).getName());<NEW_LINE>cu.setProperty("Source Line", start);<NEW_LINE>}<NEW_LINE>// String comment = sourcefile.getName()+":"+start;<NEW_LINE>// setComment(CodeUnit.PRE_COMMENT, program.getListing(), address, comment);<NEW_LINE>// line number end tag<NEW_LINE>elem = xmlParser.next();<NEW_LINE>}<NEW_LINE>} | PdbUtil.reladdr(program, addr); |
807,453 | private Object legacyEvaluate(DocumentOperation op) {<NEW_LINE>DocumentType doct;<NEW_LINE>if (op instanceof DocumentPut) {<NEW_LINE>doct = ((DocumentPut) op).getDocument().getDataType();<NEW_LINE>} else if (op instanceof DocumentUpdate) {<NEW_LINE>doct = ((<MASK><NEW_LINE>} else if (op instanceof DocumentRemove) {<NEW_LINE>DocumentRemove removeOp = (DocumentRemove) op;<NEW_LINE>return (removeOp.getId().getDocType().equals(type) ? op : Boolean.FALSE);<NEW_LINE>} else if (op instanceof DocumentGet) {<NEW_LINE>DocumentGet getOp = (DocumentGet) op;<NEW_LINE>return (getOp.getId().getDocType().equals(type) ? op : Boolean.FALSE);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Document class '" + op.getClass().getName() + "' is not supported.");<NEW_LINE>}<NEW_LINE>return doct.isA(this.type) ? op : Boolean.FALSE;<NEW_LINE>} | DocumentUpdate) op).getDocumentType(); |
1,443,243 | // endregion<NEW_LINE>// region RequestProcessor Implementation<NEW_LINE>@Override<NEW_LINE>public void readSegment(ReadSegment readSegment) {<NEW_LINE>Timer timer = new Timer();<NEW_LINE>final String segment = readSegment.getSegment();<NEW_LINE>final String operation = "readSegment";<NEW_LINE>if (!verifyToken(segment, readSegment.getOffset(), readSegment.getDelegationToken(), operation)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int readSize = min(MAX_READ_SIZE, max(TYPE_PLUS_LENGTH_SIZE, readSegment.getSuggestedLength()));<NEW_LINE>long trace = LoggerHelpers.<MASK><NEW_LINE>segmentStore.read(segment, readSegment.getOffset(), readSize, TIMEOUT).thenAccept(readResult -> {<NEW_LINE>LoggerHelpers.traceLeave(log, operation, trace, readResult);<NEW_LINE>handleReadResult(readSegment, readResult);<NEW_LINE>this.statsRecorder.readComplete(timer.getElapsed());<NEW_LINE>}).exceptionally(ex -> handleException(readSegment.getRequestId(), segment, readSegment.getOffset(), operation, wrapCancellationException(ex)));<NEW_LINE>} | traceEnter(log, operation, readSegment); |
37,152 | public <T> void save(final T model) {<NEW_LINE>throwExceptionIfMissingAnnotation(model.getClass());<NEW_LINE>cacheMeasurementClass(model.getClass());<NEW_LINE>ConcurrentMap<String, Field> colNameAndFieldMap = getColNameAndFieldMap(model.getClass());<NEW_LINE>try {<NEW_LINE>Class<?> modelType = model.getClass();<NEW_LINE>String measurement = getMeasurementName(modelType);<NEW_LINE>String database = getDatabaseName(modelType);<NEW_LINE>String retentionPolicy = getRetentionPolicy(modelType);<NEW_LINE>TimeUnit timeUnit = getTimeUnit(modelType);<NEW_LINE>long time = timeUnit.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS);<NEW_LINE>Point.Builder pointBuilder = Point.measurement(measurement).time(time, timeUnit);<NEW_LINE>for (String key : colNameAndFieldMap.keySet()) {<NEW_LINE>Field field = colNameAndFieldMap.get(key);<NEW_LINE>Column column = field.getAnnotation(Column.class);<NEW_LINE>String columnName = column.name();<NEW_LINE>Class<?> fieldType = field.getType();<NEW_LINE>if (!field.isAccessible()) {<NEW_LINE>field.setAccessible(true);<NEW_LINE>}<NEW_LINE>Object value = field.get(model);<NEW_LINE>if (column.tag()) {<NEW_LINE>pointBuilder.tag(columnName, value.toString());<NEW_LINE>} else if ("time".equals(columnName)) {<NEW_LINE>if (value != null) {<NEW_LINE>setTime(pointBuilder, fieldType, timeUnit, value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setField(pointBuilder, fieldType, columnName, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Point point = pointBuilder.build();<NEW_LINE>if ("[unassigned]".equals(database)) {<NEW_LINE>influxDB.write(point);<NEW_LINE>} else {<NEW_LINE>influxDB.<MASK><NEW_LINE>}<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new InfluxDBMapperException(e);<NEW_LINE>}<NEW_LINE>} | write(database, retentionPolicy, point); |
723,371 | ArrayList<Object> new138() /* reduce AAdynamicinvokeexpr3InvokeExpr */<NEW_LINE>{<NEW_LINE>@SuppressWarnings("hiding")<NEW_LINE>ArrayList<Object> nodeList = new ArrayList<Object>();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList9 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList8 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList7 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList6 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList5 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList4 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList3 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList2 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList1 = pop();<NEW_LINE>PInvokeExpr pinvokeexprNode1;<NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>TDynamicinvoke tdynamicinvokeNode2;<NEW_LINE>TStringConstant tstringconstantNode3;<NEW_LINE>PUnnamedMethodSignature punnamedmethodsignatureNode4;<NEW_LINE>TLParen tlparenNode5;<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>Object nullNode6 = null;<NEW_LINE>TRParen trparenNode7;<NEW_LINE>PMethodSignature pmethodsignatureNode8;<NEW_LINE>TLParen tlparenNode9;<NEW_LINE>PArgList parglistNode10;<NEW_LINE>TRParen trparenNode11;<NEW_LINE>tdynamicinvokeNode2 = (TDynamicinvoke) nodeArrayList1.get(0);<NEW_LINE>tstringconstantNode3 = (TStringConstant) nodeArrayList2.get(0);<NEW_LINE>punnamedmethodsignatureNode4 = (PUnnamedMethodSignature) nodeArrayList3.get(0);<NEW_LINE>tlparenNode5 = (TLParen) nodeArrayList4.get(0);<NEW_LINE>trparenNode7 = (TRParen) nodeArrayList5.get(0);<NEW_LINE>pmethodsignatureNode8 = (PMethodSignature) nodeArrayList6.get(0);<NEW_LINE>tlparenNode9 = (TLParen) nodeArrayList7.get(0);<NEW_LINE>parglistNode10 = (PArgList) nodeArrayList8.get(0);<NEW_LINE>trparenNode11 = (<MASK><NEW_LINE>pinvokeexprNode1 = new ADynamicInvokeExpr(tdynamicinvokeNode2, tstringconstantNode3, punnamedmethodsignatureNode4, tlparenNode5, null, trparenNode7, pmethodsignatureNode8, tlparenNode9, parglistNode10, trparenNode11);<NEW_LINE>}<NEW_LINE>nodeList.add(pinvokeexprNode1);<NEW_LINE>return nodeList;<NEW_LINE>} | TRParen) nodeArrayList9.get(0); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.