idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
810,888 | public Kryo create() {<NEW_LINE>Kryo kryo = new Kryo();<NEW_LINE>kryo.setRegistrationRequired(false);<NEW_LINE>// register serializer<NEW_LINE>kryo.register(Arrays.asList("").getClass<MASK><NEW_LINE>kryo.register(GregorianCalendar.class, new GregorianCalendarSerializer());<NEW_LINE>kryo.register(InvocationHandler.class, new JdkProxySerializer());<NEW_LINE>kryo.register(BigDecimal.class, new DefaultSerializers.BigDecimalSerializer());<NEW_LINE>kryo.register(BigInteger.class, new DefaultSerializers.BigIntegerSerializer());<NEW_LINE>kryo.register(Pattern.class, new RegexSerializer());<NEW_LINE>kryo.register(BitSet.class, new BitSetSerializer());<NEW_LINE>kryo.register(URI.class, new URISerializer());<NEW_LINE>kryo.register(UUID.class, new UUIDSerializer());<NEW_LINE>// register commonly class<NEW_LINE>SerializerClassRegistry.getRegisteredClasses().keySet().forEach(kryo::register);<NEW_LINE>return kryo;<NEW_LINE>} | (), new ArraysAsListSerializer()); |
180,611 | protected Map<Region, AccountInfo> operate(final PasswordCallback callback, final Path file) throws BackgroundException {<NEW_LINE>final Map<Region, AccountInfo> <MASK><NEW_LINE>for (Region region : session.getClient().getRegions()) {<NEW_LINE>try {<NEW_LINE>final AccountInfo info = session.getClient().getAccountInfo(region);<NEW_LINE>if (log.isInfoEnabled()) {<NEW_LINE>log.info(String.format("Signing key is %s", info.getTempUrlKey()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(info.getTempUrlKey())) {<NEW_LINE>// Update account info setting temporary URL key<NEW_LINE>try {<NEW_LINE>final String key = new AsciiRandomStringService().random();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Set acccount temp URL key to %s", key));<NEW_LINE>}<NEW_LINE>session.getClient().updateAccountMetadata(region, Collections.singletonMap("X-Account-Meta-Temp-URL-Key", key));<NEW_LINE>info.setTempUrlKey(key);<NEW_LINE>} catch (GenericException e) {<NEW_LINE>log.warn(String.format("Ignore failure %s updating account metadata", e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>accounts.put(region, info);<NEW_LINE>} catch (GenericException e) {<NEW_LINE>if (e.getHttpStatusCode() == HttpStatus.SC_SERVICE_UNAVAILABLE) {<NEW_LINE>log.warn(String.format("Ignore failure %s for region %s", e, region));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>throw new SwiftExceptionMappingService().map(e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new DefaultIOExceptionMappingService().map(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return accounts;<NEW_LINE>} | accounts = new ConcurrentHashMap<>(); |
861,395 | public String toRemoteTableName(ConnectorIdentity identity, Connection connection, String remoteSchema, String tableName) {<NEW_LINE>requireNonNull(remoteSchema, "remoteSchema is null");<NEW_LINE>requireNonNull(tableName, "tableName is null");<NEW_LINE>verify(CharMatcher.forPredicate(Character::isUpperCase).matchesNoneOf(tableName), "Expected table name from internal metadata to be lowercase: %s", tableName);<NEW_LINE>try {<NEW_LINE>RemoteTableNameCacheKey cacheKey = new RemoteTableNameCacheKey(identity, remoteSchema);<NEW_LINE>Mapping mapping = remoteTableNames.getIfPresent(cacheKey);<NEW_LINE>if (mapping != null && !mapping.hasRemoteObject(tableName)) {<NEW_LINE>// This might be a table that has just been created. Force reload.<NEW_LINE>mapping = null;<NEW_LINE>}<NEW_LINE>if (mapping == null) {<NEW_LINE><MASK><NEW_LINE>remoteTableNames.put(cacheKey, mapping);<NEW_LINE>}<NEW_LINE>String remoteTable = mapping.get(tableName);<NEW_LINE>if (remoteTable != null) {<NEW_LINE>return remoteTable;<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>throw new TrinoException(JDBC_ERROR, "Failed to find remote table name: " + firstNonNull(e.getMessage(), e), e);<NEW_LINE>}<NEW_LINE>return identifierMapping.toRemoteTableName(identity, connection, remoteSchema, tableName);<NEW_LINE>} | mapping = createTableMapping(connection, remoteSchema); |
250,357 | public Object submitToAuthServer(String testcase, WebClient webClient, Object startPage, TestSettings settings, List<validationData> expectations, String submit_type) throws Exception {<NEW_LINE>String thisMethod = "submitToAuthServer - webClient";<NEW_LINE>msgUtils.printMethodName(thisMethod);<NEW_LINE>Object thePage = null;<NEW_LINE>try {<NEW_LINE>// set the mark to the end of all logs to ensure that any<NEW_LINE>// checking for<NEW_LINE>// messages is done only for this step of the testing<NEW_LINE>setMarkToEndOfAllServersLogs();<NEW_LINE>final HtmlForm form = formTools.fillClientForm(testcase, ((HtmlPage) startPage).getFormByName("authform"), settings);<NEW_LINE>msgUtils.printAllCookies(webClient);<NEW_LINE>Log.info(thisClass, thisMethod, "new prop:" + settings.getTokenEndpt());<NEW_LINE>webClient.getCookieManager().setCookiesEnabled(true);<NEW_LINE>HtmlButton button1 = form.getButtonByName("processAzn");<NEW_LINE>thePage = button1.click();<NEW_LINE>msgUtils.<MASK><NEW_LINE>msgUtils.printAllCookies(webClient);<NEW_LINE>if (AutomationTools.getResponseTitle(thePage).contains("Code Grant")) {<NEW_LINE>Log.info(thisClass, thisMethod, "Need to submit the form a second time");<NEW_LINE>webClient.getCookieManager().setCookiesEnabled(true);<NEW_LINE>HtmlForm form2 = ((HtmlPage) thePage).getFormByName("authform");<NEW_LINE>HtmlButton button2 = form2.getButtonByName("processAzn");<NEW_LINE>thePage = button2.click();<NEW_LINE>msgUtils.printAllCookies(webClient);<NEW_LINE>msgUtils.printResponseParts(thePage, thisMethod, "Response2 from Authorization server: ");<NEW_LINE>}<NEW_LINE>validationTools.validateResult(thePage, Constants.SUBMIT_TO_AUTH_SERVER, expectations, settings);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.error(thisClass, testcase, e, "Exception occurred in " + thisMethod);<NEW_LINE>System.err.println("Exception: " + e);<NEW_LINE>validationTools.validateException(expectations, Constants.SUBMIT_TO_AUTH_SERVER, e);<NEW_LINE>}<NEW_LINE>return thePage;<NEW_LINE>} | printResponseParts(thePage, thisMethod, "Response1 from Authorization server: "); |
806,375 | public void write(@Nonnull Map<ByteArrayWrapper, byte[]> map) throws IOException {<NEW_LINE>Objects.requireNonNull(map);<NEW_LINE>int count = map.size();<NEW_LINE>dataOutput.writeInt(count);<NEW_LINE>for (Map.Entry<ByteArrayWrapper, byte[]> entry : map.entrySet()) {<NEW_LINE>byte[] key = entry.getKey().getData();<NEW_LINE>dataOutput.writeInt(key.length);<NEW_LINE>dataOutput.write(key);<NEW_LINE>byte[] value = entry.getValue();<NEW_LINE>if (value == null) {<NEW_LINE>dataOutput.writeInt(-1);<NEW_LINE>} else {<NEW_LINE>dataOutput.writeInt(value.length);<NEW_LINE>if (value.length > 0) {<NEW_LINE>dataOutput.write(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte[] digest = cloneArray(digestOutput.<MASK><NEW_LINE>if (digest == null) {<NEW_LINE>dataOutput.writeInt(-1);<NEW_LINE>} else {<NEW_LINE>dataOutput.writeInt(digest.length);<NEW_LINE>if (digest.length > 0) {<NEW_LINE>dataOutput.write(digest);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getMessageDigest().digest()); |
899,088 | private int insertIntoTargets(@Nonnull ItemStack toInsert) {<NEW_LINE>if (Prep.isInvalid(toInsert)) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>final int totalToInsert = toInsert.getCount();<NEW_LINE>// when true, a sticky filter has claimed this item and so only sticky outputs are allowed to handle it. sticky outputs are first in the target<NEW_LINE>// list, so all sticky outputs are queried before any non-sticky one.<NEW_LINE>boolean matchedStickyOutput = false;<NEW_LINE>for (Target target : getTargetIterator()) {<NEW_LINE>final IItemFilter filter = valid(target.inv.getCon().getOutputFilter(target.inv.getConDir()));<NEW_LINE>if (target.stickyInput && !matchedStickyOutput && filter != null) {<NEW_LINE>matchedStickyOutput = filter.doesItemPassFilter(target.inv.getInventory(), toInsert);<NEW_LINE>}<NEW_LINE>if (target.stickyInput || !matchedStickyOutput) {<NEW_LINE>toInsert.shrink(positive(target.inv.<MASK><NEW_LINE>if (Prep.isInvalid(toInsert)) {<NEW_LINE>// everything has been inserted. we're done.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else if (!target.stickyInput && matchedStickyOutput) {<NEW_LINE>// item has been claimed by a sticky output but there are no sticky outputs left in targets, so we can stop checking<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return totalToInsert - toInsert.getCount();<NEW_LINE>} | insertItem(toInsert, filter))); |
1,010,510 | void sendTransactionData() {<NEW_LINE>ConcurrentHashMap<String, ConcurrentHashMap<String, <MASK><NEW_LINE>boolean hasData = false;<NEW_LINE>for (Map<String, TransactionData> entry : transactions.values()) {<NEW_LINE>for (TransactionData data : entry.values()) {<NEW_LINE>if (data.getCount().get() > 0) {<NEW_LINE>hasData = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasData) {<NEW_LINE>Transaction t = Cat.newTransaction(CatConstants.CAT_SYSTEM, this.getClass().getSimpleName());<NEW_LINE>MessageTree tree = Cat.getManager().getThreadLocalMessageTree();<NEW_LINE>tree.setDomain(getDomain());<NEW_LINE>tree.setDiscardPrivate(false);<NEW_LINE>for (Map<String, TransactionData> entry : transactions.values()) {<NEW_LINE>for (TransactionData data : entry.values()) {<NEW_LINE>if (data.getCount().get() > 0) {<NEW_LINE>Transaction tmp = Cat.newTransaction(data.getType(), data.getName());<NEW_LINE>StringBuilder sb = new StringBuilder(32);<NEW_LINE>sb.append(CatConstants.BATCH_FLAG).append(data.getCount().get()).append(CatConstants.SPLIT);<NEW_LINE>sb.append(data.getFail().get()).append(CatConstants.SPLIT);<NEW_LINE>sb.append(data.getSum().get()).append(CatConstants.SPLIT);<NEW_LINE>sb.append(data.getDurationString()).append(CatConstants.SPLIT).append(data.getLongDurationString());<NEW_LINE>tmp.addData(sb.toString());<NEW_LINE>tmp.setSuccessStatus();<NEW_LINE>tmp.complete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>t.setSuccessStatus();<NEW_LINE>t.complete();<NEW_LINE>}<NEW_LINE>} | TransactionData>> transactions = getAndResetTransactions(); |
1,745,813 | public Bytes compute(final Bytes input, @Nonnull final MessageFrame messageFrame) {<NEW_LINE>final byte[] result = new byte[LibEthPairings.EIP2537_PREALLOCATE_FOR_RESULT_BYTES];<NEW_LINE>final byte[] error = new byte[LibEthPairings.EIP2537_PREALLOCATE_FOR_ERROR_BYTES];<NEW_LINE>final IntByReference o_len = new IntByReference(LibEthPairings.EIP2537_PREALLOCATE_FOR_RESULT_BYTES);<NEW_LINE>final IntByReference err_len = new IntByReference(LibEthPairings.EIP2537_PREALLOCATE_FOR_ERROR_BYTES);<NEW_LINE>final int inputSize = Math.min(inputLen, input.size());<NEW_LINE>final int errorNo = LibEthPairings.eip2537_perform_operation(operationId, input.slice(0, inputSize).toArrayUnsafe(), inputSize, result, o_len, error, err_len);<NEW_LINE>if (errorNo == 0) {<NEW_LINE>return Bytes.wrap(result, 0, o_len.getValue());<NEW_LINE>} else {<NEW_LINE>final String errorMessage = new String(error, 0, err_len.getValue(), UTF_8);<NEW_LINE>messageFrame.setRevertReason(Bytes.wrap(error, 0<MASK><NEW_LINE>LOG.trace("Error executing precompiled contract {}: '{}'", name, errorMessage);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | , err_len.getValue())); |
1,575,605 | public Map<Long, Long> loadScheduleOffsetCheckpoint() {<NEW_LINE>File file = new File(config.getScheduleOffsetCheckpointPath(), SCHEDULE_OFFSET_CHECKPOINT);<NEW_LINE>if (!file.exists()) {<NEW_LINE>return new HashMap<>(0);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final byte[] data = Files.toByteArray(file);<NEW_LINE>if (data != null && data.length == 0) {<NEW_LINE>if (!file.delete())<NEW_LINE>throw new RuntimeException("remove checkpoint error. filename=" + file);<NEW_LINE>return new HashMap<>(0);<NEW_LINE>}<NEW_LINE>Map<Long, Long> offsets = SERDE.fromBytes(data);<NEW_LINE>if (null == offsets || !file.delete()) {<NEW_LINE>throw new RuntimeException("Load checkpoint error. filename=" + file);<NEW_LINE>}<NEW_LINE>return offsets;<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>throw new RuntimeException("Load checkpoint failed. filename=" + file);<NEW_LINE>} | LOGGER.error("Load checkpoint file failed.", e); |
1,461,107 | protected IRubyObject fillCommon(ThreadContext context, int beg, long len, Block block) {<NEW_LINE>unpack();<NEW_LINE>modify();<NEW_LINE>// See [ruby-core:17483]<NEW_LINE>if (len <= 0)<NEW_LINE>return this;<NEW_LINE>if (len > Integer.MAX_VALUE - beg)<NEW_LINE>throw context.runtime.newArgumentError("argument too big");<NEW_LINE>int end = <MASK><NEW_LINE>if (end > realLength) {<NEW_LINE>int valuesLength = values.length - begin;<NEW_LINE>if (end >= valuesLength)<NEW_LINE>realloc(end, valuesLength);<NEW_LINE>realLength = end;<NEW_LINE>}<NEW_LINE>final Ruby runtime = context.runtime;<NEW_LINE>for (int i = beg; i < end; i++) {<NEW_LINE>IRubyObject v = block.yield(context, runtime.newFixnum(i));<NEW_LINE>if (i >= realLength)<NEW_LINE>break;<NEW_LINE>safeArraySet(runtime, values, begin + i, v);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | (int) (beg + len); |
1,738,563 | public void offsetRateGraphAjax(HttpServletResponse response, HttpServletRequest request) {<NEW_LINE>HttpSession session = request.getSession();<NEW_LINE>String clusterAlias = session.getAttribute(KConstants.SessionAlias.CLUSTER_ALIAS).toString();<NEW_LINE>try {<NEW_LINE>String group = StrUtils.convertNull(request.getParameter("group"));<NEW_LINE>String topic = StrUtils.convertNull(request.getParameter("topic"));<NEW_LINE>try {<NEW_LINE>group = URLDecoder.decode(group, "UTF-8");<NEW_LINE>topic = URLDecoder.decode(topic, "UTF-8");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>Map<String, Object> params = new HashMap<>();<NEW_LINE>params.put("cluster", clusterAlias);<NEW_LINE><MASK><NEW_LINE>params.put("topic", topic);<NEW_LINE>byte[] output = offsetService.getOffsetRate(params).getBytes();<NEW_LINE>BaseController.response(output, response);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>} | params.put("group", group); |
63,811 | public static DescribeHaVipsResponse unmarshall(DescribeHaVipsResponse describeHaVipsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeHaVipsResponse.setRequestId(_ctx.stringValue("DescribeHaVipsResponse.RequestId"));<NEW_LINE>describeHaVipsResponse.setPageSize(_ctx.integerValue("DescribeHaVipsResponse.PageSize"));<NEW_LINE>describeHaVipsResponse.setPageNumber(_ctx.integerValue("DescribeHaVipsResponse.PageNumber"));<NEW_LINE>describeHaVipsResponse.setTotalCount(_ctx.integerValue("DescribeHaVipsResponse.TotalCount"));<NEW_LINE>List<HaVip> haVips = new ArrayList<HaVip>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeHaVipsResponse.HaVips.Length"); i++) {<NEW_LINE>HaVip haVip = new HaVip();<NEW_LINE>haVip.setVpcId(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].VpcId"));<NEW_LINE>haVip.setStatus(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].Status"));<NEW_LINE>haVip.setHaVipId(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].HaVipId"));<NEW_LINE>haVip.setAssociatedInstanceType(_ctx.stringValue<MASK><NEW_LINE>haVip.setCreateTime(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].CreateTime"));<NEW_LINE>haVip.setChargeType(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].ChargeType"));<NEW_LINE>haVip.setRegionId(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].RegionId"));<NEW_LINE>haVip.setVSwitchId(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].VSwitchId"));<NEW_LINE>haVip.setIpAddress(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].IpAddress"));<NEW_LINE>haVip.setDescription(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].Description"));<NEW_LINE>haVip.setMasterInstanceId(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].MasterInstanceId"));<NEW_LINE>haVip.setName(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].Name"));<NEW_LINE>List<String> associatedEipAddresses = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeHaVipsResponse.HaVips[" + i + "].AssociatedEipAddresses.Length"); j++) {<NEW_LINE>associatedEipAddresses.add(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].AssociatedEipAddresses[" + j + "]"));<NEW_LINE>}<NEW_LINE>haVip.setAssociatedEipAddresses(associatedEipAddresses);<NEW_LINE>List<String> associatedInstances = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeHaVipsResponse.HaVips[" + i + "].AssociatedInstances.Length"); j++) {<NEW_LINE>associatedInstances.add(_ctx.stringValue("DescribeHaVipsResponse.HaVips[" + i + "].AssociatedInstances[" + j + "]"));<NEW_LINE>}<NEW_LINE>haVip.setAssociatedInstances(associatedInstances);<NEW_LINE>haVips.add(haVip);<NEW_LINE>}<NEW_LINE>describeHaVipsResponse.setHaVips(haVips);<NEW_LINE>return describeHaVipsResponse;<NEW_LINE>} | ("DescribeHaVipsResponse.HaVips[" + i + "].AssociatedInstanceType")); |
807,939 | private Color[][] createAllColors(int rows, int columns) {<NEW_LINE>Color[][] colors = <MASK><NEW_LINE>for (int row = 0; row < rows; row++) {<NEW_LINE>for (int col = 0; col < columns; col++) {<NEW_LINE>// Create the color grid by varying the saturation and value<NEW_LINE>if (row < (rows - 1)) {<NEW_LINE>// Calculate new hue value<NEW_LINE>float hue = ((float) col / (float) columns);<NEW_LINE>float saturation = 1f;<NEW_LINE>float value = 1f;<NEW_LINE>// For the upper half use value=1 and variable<NEW_LINE>// saturation<NEW_LINE>if (row < (rows / 2)) {<NEW_LINE>saturation = ((row + 1f) / (rows / 2f));<NEW_LINE>} else {<NEW_LINE>value = 1f - ((row - (rows / 2f)) / (rows / 2f));<NEW_LINE>}<NEW_LINE>colors[row][col] = new Color(Color.HSVtoRGB(hue, saturation, value));<NEW_LINE>} else {<NEW_LINE>// The last row should have the black&white gradient<NEW_LINE>float hue = 0f;<NEW_LINE>float saturation = 0f;<NEW_LINE>float value = 1f - ((float) col / (float) columns);<NEW_LINE>colors[row][col] = new Color(Color.HSVtoRGB(hue, saturation, value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return colors;<NEW_LINE>} | new Color[rows][columns]; |
1,593,825 | public static final List<INaviRawModule> loadRawModules(final AbstractSQLProvider provider) throws CouldntLoadDataException {<NEW_LINE>Preconditions.checkNotNull(provider, "IE00416: Provider argument can not be null");<NEW_LINE>final CConnection connection = provider.getConnection();<NEW_LINE>final List<INaviRawModule> modules = new ArrayList<INaviRawModule>();<NEW_LINE>if (!PostgreSQLHelpers.hasTable(connection, CTableNames.RAW_MODULES_TABLE)) {<NEW_LINE>return modules;<NEW_LINE>}<NEW_LINE>final String query <MASK><NEW_LINE>try (ResultSet resultSet = connection.executeQuery(query, true)) {<NEW_LINE>while (resultSet.next()) {<NEW_LINE>final int rawModuleId = resultSet.getInt("id");<NEW_LINE>final String name = PostgreSQLHelpers.readString(resultSet, "name");<NEW_LINE>final boolean isComplete = PostgreSQLDatabaseFunctions.checkRawModulesTables(provider.getConnection(), PostgreSQLHelpers.getDatabaseName(provider.getConnection()), rawModuleId);<NEW_LINE>final int functionCount = isComplete ? PostgreSQLDatabaseFunctions.getRawModuleFunctionCount(connection, rawModuleId) : 0;<NEW_LINE>final CRawModule module = new CRawModule(rawModuleId, name, functionCount, isComplete, provider);<NEW_LINE>modules.add(module);<NEW_LINE>}<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>throw new CouldntLoadDataException(e);<NEW_LINE>}<NEW_LINE>return modules;<NEW_LINE>} | = "SELECT id, name FROM " + CTableNames.RAW_MODULES_TABLE + " ORDER BY id"; |
956,393 | public static IRubyObject lutime(ThreadContext context, IRubyObject recv, IRubyObject[] args) {<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE>long[] atimeval = null;<NEW_LINE>long[] mtimeval = null;<NEW_LINE>if (args[0] != context.nil || args[1] != context.nil) {<NEW_LINE>atimeval = extractTimespec(context, args[0]);<NEW_LINE>mtimeval = extractTimespec(context, args[1]);<NEW_LINE>}<NEW_LINE>for (int i = 2, j = args.length; i < j; i++) {<NEW_LINE>RubyString filename = StringSupport.checkEmbeddedNulls(runtime, get_path(context, args[i]));<NEW_LINE>JRubyFile fileToTouch = JRubyFile.create(runtime.getCurrentDirectory(), filename.getUnicodeValue());<NEW_LINE>if (!fileToTouch.exists()) {<NEW_LINE>throw runtime.newErrnoENOENTError(filename.toString());<NEW_LINE>}<NEW_LINE>int result = runtime.getPosix().lutimes(fileToTouch.getAbsolutePath(), atimeval, mtimeval);<NEW_LINE>if (result == -1) {<NEW_LINE>throw runtime.newErrnoFromInt(runtime.getPosix().errno());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return runtime.<MASK><NEW_LINE>} | newFixnum(args.length - 2); |
814,462 | // Draws the image and text bounding box.<NEW_LINE>public void paintComponent(Graphics g) {<NEW_LINE>int height = image.getHeight(this);<NEW_LINE>int width = image.getWidth(this);<NEW_LINE>// Create a Java2D version of g.<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE>// Draw the image.<NEW_LINE>g2d.drawImage(image, 0, 0, image.getWidth(this), image.getHeight(this), this);<NEW_LINE>// Iterate through blocks and display bounding boxes around everything.<NEW_LINE>List<Block> blocks = result.getBlocks();<NEW_LINE>for (Block block : blocks) {<NEW_LINE>DisplayBlockInfo(block);<NEW_LINE>switch(block.getBlockType()) {<NEW_LINE>case "KEY_VALUE_SET":<NEW_LINE>if (block.getEntityTypes().contains("KEY")) {<NEW_LINE>ShowBoundingBox(height, width, block.getGeometry().getBoundingBox(), g2d, new Color(255, 0, 0));<NEW_LINE>} else {<NEW_LINE>// VALUE<NEW_LINE>ShowBoundingBox(height, width, block.getGeometry().getBoundingBox(), g2d, new Color<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "TABLE":<NEW_LINE>ShowBoundingBox(height, width, block.getGeometry().getBoundingBox(), g2d, new Color(0, 0, 255));<NEW_LINE>break;<NEW_LINE>case "CELL":<NEW_LINE>ShowBoundingBox(height, width, block.getGeometry().getBoundingBox(), g2d, new Color(255, 255, 0));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// uncomment to show polygon around all blocks<NEW_LINE>// ShowPolygon(height,width,block.getGeometry().getPolygon(),g2d);<NEW_LINE>} | (0, 255, 0)); |
922,923 | public boolean scry(int value, Ability source, Game game) {<NEW_LINE>GameEvent event = new GameEvent(GameEvent.EventType.SCRY, getId(), source, getId(), value, true);<NEW_LINE>if (game.replaceEvent(event)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>game.informPlayers(getLogName() + " scries " + event.getAmount() + CardUtil.getSourceLogName(game, source));<NEW_LINE>Cards cards = new CardsImpl();<NEW_LINE>cards.addAll(getLibrary().getTopCards(game, event.getAmount()));<NEW_LINE>if (!cards.isEmpty()) {<NEW_LINE>TargetCard target = new TargetCard(0, cards.size(), Zone.LIBRARY, new FilterCard("card" + (cards.size() == 1 ? "" : "s") + " to PUT on the BOTTOM of your library (Scry)"));<NEW_LINE>chooseTarget(Outcome.Benefit, <MASK><NEW_LINE>putCardsOnBottomOfLibrary(new CardsImpl(target.getTargets()), game, source, true);<NEW_LINE>cards.removeAll(target.getTargets());<NEW_LINE>putCardsOnTopOfLibrary(cards, game, source, true);<NEW_LINE>}<NEW_LINE>game.fireEvent(new GameEvent(GameEvent.EventType.SCRIED, getId(), source, getId(), event.getAmount(), true));<NEW_LINE>return true;<NEW_LINE>} | cards, target, source, game); |
1,329,539 | final ListSecurityProfilesResult executeListSecurityProfiles(ListSecurityProfilesRequest listSecurityProfilesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listSecurityProfilesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListSecurityProfilesRequest> request = null;<NEW_LINE>Response<ListSecurityProfilesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListSecurityProfilesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listSecurityProfilesRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListSecurityProfiles");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListSecurityProfilesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListSecurityProfilesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
595,724 | public void init(List<TransformFunction> arguments, Map<String, DataSource> dataSourceMap) {<NEW_LINE>// Check that there are more than 1 arguments<NEW_LINE>if (arguments.size() % 2 != 1 || arguments.size() < 3) {<NEW_LINE>throw new IllegalArgumentException("At least 3 odd number of arguments are required for CASE-WHEN-ELSE function");<NEW_LINE>}<NEW_LINE>int numWhenStatements = arguments.size() / 2;<NEW_LINE>_whenStatements = new ArrayList<>(numWhenStatements);<NEW_LINE>for (int i = 0; i < numWhenStatements; i++) {<NEW_LINE>_whenStatements.add(arguments.get(i));<NEW_LINE>}<NEW_LINE>// Add ELSE Statement first<NEW_LINE>_elseThenStatements = new ArrayList<>(numWhenStatements + 1);<NEW_LINE>_elseThenStatements.add(arguments.get(numWhenStatements * 2));<NEW_LINE>for (int i = numWhenStatements; i < numWhenStatements * 2; i++) {<NEW_LINE>_elseThenStatements.add(arguments.get(i));<NEW_LINE>}<NEW_LINE>_selections = new <MASK><NEW_LINE>_resultMetadata = calculateResultMetadata();<NEW_LINE>} | boolean[_elseThenStatements.size()]; |
532,996 | private Attributes storeTo(ConfigurationChanges.ModifiedObject ldapObj, KeycloakClient client, Attributes attrs) {<NEW_LINE>attrs.put("objectclass", "dcmKeycloakClient");<NEW_LINE>attrs.put("dcmKeycloakClientID", client.getKeycloakClientID());<NEW_LINE>LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dcmURI", client.getKeycloakServerURL(), null);<NEW_LINE>LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dcmKeycloakRealm", client.getKeycloakRealm(), null);<NEW_LINE>LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dcmKeycloakGrantType", client.getKeycloakGrantType(), KeycloakClient.GrantType.client_credentials);<NEW_LINE>LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dcmKeycloakClientSecret", client.getKeycloakClientSecret(), null);<NEW_LINE>LdapUtils.storeNotDef(ldapObj, attrs, "dcmTLSAllowAnyHostname", client.isTLSAllowAnyHostname(), false);<NEW_LINE>LdapUtils.storeNotDef(ldapObj, attrs, "dcmTLSDisableTrustManager", client.isTLSDisableTrustManager(), false);<NEW_LINE>LdapUtils.storeNotNullOrDef(ldapObj, attrs, "uid", <MASK><NEW_LINE>LdapUtils.storeNotNullOrDef(ldapObj, attrs, "userPassword", client.getPassword(), null);<NEW_LINE>return attrs;<NEW_LINE>} | client.getUserID(), null); |
467,365 | protected void append(E eventObject) {<NEW_LINE>if (!checkEntryConditions()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String key = discriminator.getDiscriminatingValue(eventObject);<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>final CyclicBuffer<E> cb = cbTracker.getOrCreate(key, now);<NEW_LINE>subAppend(cb, eventObject);<NEW_LINE>try {<NEW_LINE>if (eventEvaluator.evaluate(eventObject)) {<NEW_LINE>// clone the CyclicBuffer before sending out asynchronously<NEW_LINE>CyclicBuffer<E> cbClone = <MASK><NEW_LINE>// see http://jira.qos.ch/browse/LBCLASSIC-221<NEW_LINE>cb.clear();<NEW_LINE>if (asynchronousSending) {<NEW_LINE>// perform actual sending asynchronously<NEW_LINE>SenderRunnable senderRunnable = new SenderRunnable(cbClone, eventObject);<NEW_LINE>context.getScheduledExecutorService().execute(senderRunnable);<NEW_LINE>} else {<NEW_LINE>// synchronous sending<NEW_LINE>sendBuffer(cbClone, eventObject);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (EvaluationException ex) {<NEW_LINE>errorCount++;<NEW_LINE>if (errorCount < CoreConstants.MAX_ERROR_COUNT) {<NEW_LINE>addError("SMTPAppender's EventEvaluator threw an Exception-", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// immediately remove the buffer if asked by the user<NEW_LINE>if (eventMarksEndOfLife(eventObject)) {<NEW_LINE>cbTracker.endOfLife(key);<NEW_LINE>}<NEW_LINE>cbTracker.removeStaleComponents(now);<NEW_LINE>if (lastTrackerStatusPrint + delayBetweenStatusMessages < now) {<NEW_LINE>addInfo("SMTPAppender [" + name + "] is tracking [" + cbTracker.getComponentCount() + "] buffers");<NEW_LINE>lastTrackerStatusPrint = now;<NEW_LINE>// quadruple 'delay' assuming less than max delay<NEW_LINE>if (delayBetweenStatusMessages < MAX_DELAY_BETWEEN_STATUS_MESSAGES) {<NEW_LINE>delayBetweenStatusMessages *= 4;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | new CyclicBuffer<E>(cb); |
1,637,072 | public void execute(@NonNull final MapActivity mapActivity) {<NEW_LINE>final LatLon latLon = mapActivity.getMapView()<MASK><NEW_LINE>final String title = getParams().get(KEY_NAME);<NEW_LINE>if (title == null || title.isEmpty()) {<NEW_LINE>progressDialog = createProgressDialog(mapActivity, new DialogOnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void skipOnClick() {<NEW_LINE>onClick(mapActivity.getString(R.string.favorite), !Boolean.valueOf(getParams().get(KEY_DIALOG)));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void enterNameOnClick() {<NEW_LINE>onClick("", false);<NEW_LINE>}<NEW_LINE><NEW_LINE>private void onClick(String title, boolean autoFill) {<NEW_LINE>mapActivity.getMyApplication().getGeocodingLookupService().cancel(lookupRequest);<NEW_LINE>dismissProgressDialog();<NEW_LINE>addFavorite(mapActivity, latLon, title, autoFill);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>progressDialog.show();<NEW_LINE>lookupRequest = new AddressLookupRequest(latLon, new OnAddressLookupResult() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void geocodingDone(String address) {<NEW_LINE>dismissProgressDialog();<NEW_LINE>addFavorite(mapActivity, latLon, address, !Boolean.valueOf(getParams().get(KEY_DIALOG)));<NEW_LINE>}<NEW_LINE>}, null);<NEW_LINE>mapActivity.getMyApplication().getGeocodingLookupService().lookupAddress(lookupRequest);<NEW_LINE>} else {<NEW_LINE>addFavorite(mapActivity, latLon, title, !Boolean.valueOf(getParams().get(KEY_DIALOG)));<NEW_LINE>}<NEW_LINE>} | .getCurrentRotatedTileBox().getCenterLatLon(); |
769,004 | private void auditEventJMXMBean01(Object[] methodParams) {<NEW_LINE>Object[] varargs = (Object[]) methodParams[1];<NEW_LINE>ObjectName name = (ObjectName) varargs[0];<NEW_LINE>String className = (String) varargs[1];<NEW_LINE>ObjectName loader <MASK><NEW_LINE>String operationName = (String) varargs[3];<NEW_LINE>Object[] params = (Object[]) varargs[4];<NEW_LINE>String[] signature = (String[]) varargs[5];<NEW_LINE>QueryExp query = (QueryExp) varargs[6];<NEW_LINE>String action = (String) varargs[7];<NEW_LINE>String outcome = (String) varargs[8];<NEW_LINE>String outcomeReason = (String) varargs[9];<NEW_LINE>if (auditServiceRef.getService() != null && auditServiceRef.getService().isAuditRequired(AuditConstants.JMX_MBEAN, outcome)) {<NEW_LINE>JMXMBeanEvent je = new JMXMBeanEvent(name, className, loader, operationName, params, signature, query, action, outcome, outcomeReason);<NEW_LINE>auditServiceRef.getService().sendEvent(je);<NEW_LINE>}<NEW_LINE>} | = (ObjectName) varargs[2]; |
1,132,976 | boolean cmpItems(VirtualFrame frame, PArray left, PArray right, @Cached PyObjectRichCompareBool.EqNode eqNode, @Cached("createComparison()") BinaryComparisonNode compareNode, @Cached("createIfTrueNode()") CoerceToBooleanNode coerceToBooleanNode, @Cached ArrayNodes.GetValueNode getLeft, @Cached ArrayNodes.GetValueNode getRight) {<NEW_LINE>int commonLength = Math.min(left.getLength(), right.getLength());<NEW_LINE>for (int i = 0; i < commonLength; i++) {<NEW_LINE>Object leftValue = <MASK><NEW_LINE>Object rightValue = getRight.execute(right, i);<NEW_LINE>if (!eqNode.execute(frame, leftValue, rightValue)) {<NEW_LINE>return coerceToBooleanNode.executeBoolean(frame, compareNode.executeObject(frame, leftValue, rightValue));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return compareLengths(left.getLength(), right.getLength());<NEW_LINE>} | getLeft.execute(left, i); |
1,182,845 | public void shutdown(final String taskId, String reason) {<NEW_LINE>log.info("Shutdown [%s] because: [%s]", taskId, reason);<NEW_LINE>if (!lifecycleLock.awaitStarted(1, TimeUnit.SECONDS)) {<NEW_LINE>log.info("This TaskRunner is stopped or not yet started. Ignoring shutdown command for task: %s", taskId);<NEW_LINE>} else if (pendingTasks.remove(taskId) != null) {<NEW_LINE>pendingTaskPayloads.remove(taskId);<NEW_LINE>log.info("Removed task from pending queue: %s", taskId);<NEW_LINE>} else if (completeTasks.containsKey(taskId)) {<NEW_LINE>cleanup(taskId);<NEW_LINE>} else {<NEW_LINE>final ZkWorker zkWorker = findWorkerRunningTask(taskId);<NEW_LINE>if (zkWorker == null) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>URL url = null;<NEW_LINE>try {<NEW_LINE>url = TaskRunnerUtils.makeWorkerURL(zkWorker.getWorker(), "/druid/worker/v1/task/%s/shutdown", taskId);<NEW_LINE>final StatusResponseHolder response = httpClient.go(new Request(HttpMethod.POST, url), StatusResponseHandler.getInstance(), shutdownTimeout).get();<NEW_LINE>log.info("Sent shutdown message to worker: %s, status %s, response: %s", zkWorker.getWorker().getHost(), response.getStatus(), response.getContent());<NEW_LINE>if (!HttpResponseStatus.OK.equals(response.getStatus())) {<NEW_LINE>log.error("Shutdown failed for %s! Are you sure the task was running?", taskId);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>throw new RE(e, "Interrupted posting shutdown to [%s] for task [%s]", url, taskId);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RE(e, "Error in handling post to [%s] for task [%s]", zkWorker.getWorker().getHost(), taskId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | log.info("Can't shutdown! No worker running task %s", taskId); |
1,090,415 | private String expandRedirectUri(HttpServletRequest request, ClientRegistration clientRegistration, String action) {<NEW_LINE>Map<String, String> uriVariables = new HashMap<>();<NEW_LINE>uriVariables.put("registrationId", clientRegistration.getRegistrationId());<NEW_LINE>UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl(UrlUtils.buildFullRequestUrl(request)).replacePath(request.getContextPath()).replaceQuery(null).fragment(null).build();<NEW_LINE>String scheme = uriComponents.getScheme();<NEW_LINE>uriVariables.put("baseScheme", scheme == null ? "" : scheme);<NEW_LINE>String host = uriComponents.getHost();<NEW_LINE>uriVariables.put("baseHost", <MASK><NEW_LINE>// following logic is based on HierarchicalUriComponents#toUriString()<NEW_LINE>int port = uriComponents.getPort();<NEW_LINE>uriVariables.put("basePort", port == -1 ? "" : ":" + port);<NEW_LINE>String path = uriComponents.getPath();<NEW_LINE>if (StringUtils.hasLength(path)) {<NEW_LINE>if (path.charAt(0) != PATH_DELIMITER) {<NEW_LINE>path = PATH_DELIMITER + path;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>uriVariables.put("basePath", path == null ? "" : path);<NEW_LINE>uriVariables.put("baseUrl", uriComponents.toUriString());<NEW_LINE>uriVariables.put("action", action == null ? "" : action);<NEW_LINE>String redirectUri = getRedirectUri(request);<NEW_LINE>log.trace("Redirect URI - {}.", redirectUri);<NEW_LINE>return UriComponentsBuilder.fromUriString(redirectUri).buildAndExpand(uriVariables).toUriString();<NEW_LINE>} | host == null ? "" : host); |
149,526 | protected static ExtractedInfo extractProvenanceInfo(Map<String, Provenance> map) {<NEW_LINE>Map<String, Provenance> configuredParameters = new HashMap<>(map);<NEW_LINE>String className = ObjectProvenance.checkAndExtractProvenance(configuredParameters, CLASS_NAME, StringProvenance.class, SimpleStringDataSourceProvenance.class.getSimpleName()).getValue();<NEW_LINE>String hostTypeStringName = ObjectProvenance.checkAndExtractProvenance(configuredParameters, HOST_SHORT_NAME, StringProvenance.class, SimpleStringDataSourceProvenance.class.getSimpleName()).getValue();<NEW_LINE>Map<String, PrimitiveProvenance<?>> instanceParameters = new HashMap<>();<NEW_LINE>instanceParameters.put(DATASOURCE_CREATION_TIME, ObjectProvenance.checkAndExtractProvenance(configuredParameters, DATASOURCE_CREATION_TIME, DateTimeProvenance.class, SimpleStringDataSourceProvenance.class.getSimpleName()));<NEW_LINE>instanceParameters.put(RESOURCE_HASH, ObjectProvenance.checkAndExtractProvenance(configuredParameters, RESOURCE_HASH, HashProvenance.class, SimpleStringDataSourceProvenance<MASK><NEW_LINE>return new ExtractedInfo(className, hostTypeStringName, configuredParameters, instanceParameters);<NEW_LINE>} | .class.getSimpleName())); |
1,413,255 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_like_a_medium);<NEW_LINE>Demo demo = getDemo();<NEW_LINE>Toolbar toolbar = (Toolbar) <MASK><NEW_LINE>toolbar.setTitle(demo.titleResId);<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>getSupportActionBar().setDisplayHomeAsUpEnabled(true);<NEW_LINE>ViewGroup tab = (ViewGroup) findViewById(R.id.tab);<NEW_LINE>tab.addView(LayoutInflater.from(this).inflate(demo.layoutResId, tab, false));<NEW_LINE>ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);<NEW_LINE>SmartTabLayout viewPagerTab = (SmartTabLayout) findViewById(R.id.viewpagertab);<NEW_LINE>demo.setup(viewPagerTab);<NEW_LINE>FragmentPagerItems pages = new FragmentPagerItems(this);<NEW_LINE>for (int titleResId : demo.tabs()) {<NEW_LINE>pages.add(FragmentPagerItem.of(getString(titleResId), DemoFragment.class));<NEW_LINE>}<NEW_LINE>FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(getSupportFragmentManager(), pages);<NEW_LINE>viewPager.setAdapter(adapter);<NEW_LINE>viewPagerTab.setViewPager(viewPager);<NEW_LINE>} | findViewById(R.id.toolbar); |
1,369,302 | public void process() {<NEW_LINE>JMeterContext context = getThreadContext();<NEW_LINE>Sampler sam = context.getCurrentSampler();<NEW_LINE>SampleResult res = context.getPreviousResult();<NEW_LINE>HTTPSamplerBase sampler;<NEW_LINE>HTTPSampleResult result;<NEW_LINE>if (!(sam instanceof HTTPSamplerBase) || !(res instanceof HTTPSampleResult)) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>sampler = (HTTPSamplerBase) sam;<NEW_LINE>result = (HTTPSampleResult) res;<NEW_LINE>}<NEW_LINE>List<HTTPSamplerBase> potentialLinks = new ArrayList<>();<NEW_LINE>String responseText = result.getResponseDataAsString();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>int index = responseText.indexOf('<');<NEW_LINE>if (index == -1) {<NEW_LINE>index = 0;<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Check for matches against: " + sampler.toString());<NEW_LINE>}<NEW_LINE>Document html = (Document) HtmlParsingUtils.getDOM(responseText.substring(index));<NEW_LINE>addAnchorUrls(html, result, sampler, potentialLinks);<NEW_LINE>addFormUrls(html, result, sampler, potentialLinks);<NEW_LINE>addFramesetUrls(html, result, sampler, potentialLinks);<NEW_LINE>if (!potentialLinks.isEmpty()) {<NEW_LINE>HTTPSamplerBase url = potentialLinks.get(ThreadLocalRandom.current().nextInt(potentialLinks.size()));<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Selected: " + url.toString());<NEW_LINE>}<NEW_LINE>sampler.setDomain(url.getDomain());<NEW_LINE>sampler.setPath(url.getPath());<NEW_LINE>if (url.getMethod().equals(HTTPConstants.POST)) {<NEW_LINE>for (JMeterProperty jMeterProperty : sampler.getArguments()) {<NEW_LINE>Argument arg = (Argument) jMeterProperty.getObjectValue();<NEW_LINE>modifyArgument(arg, url.getArguments());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>sampler.setArguments(url.getArguments());<NEW_LINE>}<NEW_LINE>sampler.setProtocol(url.getProtocol());<NEW_LINE>} else {<NEW_LINE>log.debug("No matches found");<NEW_LINE>}<NEW_LINE>} | log.info("Can't apply HTML Link Parser when the previous" + " sampler run is not an HTTP Request."); |
419,772 | private Mono<Response<ApiManagementServiceNameAvailabilityResultInner>> checkNameAvailabilityWithResponseAsync(ApiManagementServiceCheckNameAvailabilityParameters parameters, 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 (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(<MASK><NEW_LINE>} | ), parameters, accept, context); |
1,065,676 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl = "@public create window Win#keepall as (key string, value int);\n" + "@public create window WinSB#lastevent as SupportBean;\n" + "insert into WinSB select * from SupportBean;\n";<NEW_LINE>env.compileDeploy(epl, path);<NEW_LINE>compileExecute(env, path, "insert into Win select 'k1' as key, 1 as value");<NEW_LINE>compileExecute(env, path, "insert into Win select 'k2' as key, 2 as value");<NEW_LINE>compileExecute(env, path, "insert into Win select 'k3' as key, 3 as value");<NEW_LINE>String delete = "delete from Win where value = (select intPrimitive from WinSB)";<NEW_LINE>String query = "select * from Win";<NEW_LINE>assertQueryMultirowAnyOrder(env, path, query, "key,value", new Object[][] { { "k1", 1 }, { "k2", 2 }, { "k3", 3 } });<NEW_LINE>compileExecute(env, path, delete);<NEW_LINE>assertQueryMultirowAnyOrder(env, path, query, "key,value", new Object[][] { { "k1", 1 }, { "k2", 2 }<MASK><NEW_LINE>sendSB(env, "E1", 2);<NEW_LINE>compileExecute(env, path, delete);<NEW_LINE>assertQueryMultirowAnyOrder(env, path, query, "key,value", new Object[][] { { "k1", 1 }, { "k3", 3 } });<NEW_LINE>sendSB(env, "E1", 1);<NEW_LINE>compileExecute(env, path, delete);<NEW_LINE>assertQueryMultirowAnyOrder(env, path, query, "key,value", new Object[][] { { "k3", 3 } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | , { "k3", 3 } }); |
1,256,317 | public static boolean VRRenderModels_GetComponentStateForDevicePath(@NativeType("char const *") CharSequence pchRenderModelName, @NativeType("char const *") CharSequence pchComponentName, @NativeType("VRInputValueHandle_t") long devicePath, @NativeType("RenderModel_ControllerMode_State_t const *") RenderModelControllerModeState pState, @NativeType("RenderModel_ComponentState_t *") RenderModelComponentState pComponentState) {<NEW_LINE>MemoryStack stack = stackGet();<NEW_LINE>int stackPointer = stack.getPointer();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>long pchRenderModelNameEncoded = stack.getPointerAddress();<NEW_LINE>stack.nASCII(pchComponentName, true);<NEW_LINE>long pchComponentNameEncoded = stack.getPointerAddress();<NEW_LINE>return nVRRenderModels_GetComponentStateForDevicePath(pchRenderModelNameEncoded, pchComponentNameEncoded, devicePath, pState.address(), pComponentState.address());<NEW_LINE>} finally {<NEW_LINE>stack.setPointer(stackPointer);<NEW_LINE>}<NEW_LINE>} | stack.nASCII(pchRenderModelName, true); |
895,782 | public void readEntity(Cursor cursor, Message entity, int offset) {<NEW_LINE>entity.setId(cursor.isNull(offset + 0) ? null : cursor<MASK><NEW_LINE>entity.setEntityID(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));<NEW_LINE>entity.setDate(cursor.isNull(offset + 2) ? null : new java.util.Date(cursor.getLong(offset + 2)));<NEW_LINE>entity.setType(cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3));<NEW_LINE>entity.setStatus(cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4));<NEW_LINE>entity.setSenderId(cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5));<NEW_LINE>entity.setThreadId(cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6));<NEW_LINE>entity.setNextMessageId(cursor.isNull(offset + 7) ? null : cursor.getLong(offset + 7));<NEW_LINE>entity.setPreviousMessageId(cursor.isNull(offset + 8) ? null : cursor.getLong(offset + 8));<NEW_LINE>entity.setEncryptedText(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));<NEW_LINE>} | .getLong(offset + 0)); |
576,057 | private // refactored to use a common method.<NEW_LINE>void loadOnlyEjbCreateMethod(List<CallbackInterceptor>[] metaArray, int numPostConstructFrameworkCallbacks) {<NEW_LINE>int sz = lcAnnotationClasses.length;<NEW_LINE>for (int i = 0; i < sz; i++) {<NEW_LINE>if (lcAnnotationClasses[i] != PostConstruct.class) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean needToScan = true;<NEW_LINE>if (metaArray[i] != null) {<NEW_LINE>List<CallbackInterceptor> al = metaArray[i];<NEW_LINE>needToScan = (al.size() == numPostConstructFrameworkCallbacks);<NEW_LINE>}<NEW_LINE>if (!needToScan) {<NEW_LINE>// We already have found a @PostConstruct method<NEW_LINE>// So just ignore any ejbCreate() method<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Method method = beanClass.getMethod(pre30LCMethodNames[i], (Class[]) null);<NEW_LINE>if (method != null) {<NEW_LINE>CallbackInterceptor meta = new BeanCallbackInterceptor(method);<NEW_LINE>metaArray[i].add(meta);<NEW_LINE>_logger.log(<MASK><NEW_LINE>}<NEW_LINE>} catch (NoSuchMethodException nsmEx) {<NEW_LINE>// TODO: Log exception<NEW_LINE>// Error for a 2.x bean????<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Level.FINE, "**##[ejbCreate] bean has 2.x style ejbCreate: " + meta); |
1,244,861 | public RemotingCommand queryBrokerTopicConfig(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException {<NEW_LINE>final RemotingCommand response = RemotingCommand.createResponseCommand(QueryDataVersionResponseHeader.class);<NEW_LINE>final QueryDataVersionResponseHeader responseHeader = (QueryDataVersionResponseHeader) response.readCustomHeader();<NEW_LINE>final QueryDataVersionRequestHeader requestHeader = (QueryDataVersionRequestHeader) request.decodeCommandCustomHeader(QueryDataVersionRequestHeader.class);<NEW_LINE>DataVersion dataVersion = DataVersion.decode(request.getBody(), DataVersion.class);<NEW_LINE>Boolean changed = this.namesrvController.getRouteInfoManager().isBrokerTopicConfigChanged(requestHeader.getBrokerAddr(), dataVersion);<NEW_LINE>if (!changed) {<NEW_LINE>this.namesrvController.getRouteInfoManager().updateBrokerInfoUpdateTimestamp(requestHeader.getBrokerAddr(<MASK><NEW_LINE>}<NEW_LINE>DataVersion nameSeverDataVersion = this.namesrvController.getRouteInfoManager().queryBrokerTopicConfig(requestHeader.getBrokerAddr());<NEW_LINE>response.setCode(ResponseCode.SUCCESS);<NEW_LINE>response.setRemark(null);<NEW_LINE>if (nameSeverDataVersion != null) {<NEW_LINE>response.setBody(nameSeverDataVersion.encode());<NEW_LINE>}<NEW_LINE>responseHeader.setChanged(changed);<NEW_LINE>return response;<NEW_LINE>} | ), System.currentTimeMillis()); |
1,728,233 | protected void testMetadata() {<NEW_LINE>try {<NEW_LINE>testWithFactory(testFactory -> {<NEW_LINE>// must auto-load modules to ensure all tested module dependencies are present...<NEW_LINE>BQRuntime runtime = testFactory.app().autoLoadModules().createRuntime();<NEW_LINE>BQModuleProvider provider = matchingProvider();<NEW_LINE>String providerName = provider.name();<NEW_LINE>// loading metadata ensures that all annotations are properly applied...<NEW_LINE>Optional<ModuleMetadata> moduleMetadata = runtime.getInstance(ModulesMetadata.class).getModules().stream().filter(mmd -> providerName.equals(mmd.getProviderName<MASK><NEW_LINE>assertTrue(moduleMetadata.isPresent(), "No module metadata available for provider: '" + providerName + "'");<NEW_LINE>moduleMetadata.get().getConfigs();<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>Assertions.fail("Fail to test metadata.");<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | ())).findFirst(); |
1,605,936 | protected Mono<Endpoints> convert(List<DetectedEndpoint> endpoints) {<NEW_LINE>if (endpoints.isEmpty()) {<NEW_LINE>return Mono.empty();<NEW_LINE>}<NEW_LINE>Map<String, List<DetectedEndpoint>> endpointsById = endpoints.stream().collect(groupingBy((e) -> e.getDefinition().getId()));<NEW_LINE>List<Endpoint> result = endpointsById.values().stream().map((endpointList) -> {<NEW_LINE>endpointList.sort(comparingInt((e) -> this.endpoints.indexOf(e.getDefinition())));<NEW_LINE>if (endpointList.size() > 1) {<NEW_LINE>log.warn("Duplicate endpoints for id '{}' detected. Omitting: {}", endpointList.get(0).getDefinition().getId(), endpointList.subList(1, endpointList.size()));<NEW_LINE>}<NEW_LINE>return endpointList.get(0).getEndpoint();<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>return Mono.just<MASK><NEW_LINE>} | (Endpoints.of(result)); |
1,325,495 | private void createDefaultNamespaces() throws Exception {<NEW_LINE>String serviceUri = String.format("bk://%s/", getRpcEndpoints().stream().map(endpoint -> NetUtils.endpointToString(endpoint)).collect(Collectors.joining(",")));<NEW_LINE>StorageClientSettings settings = StorageClientSettings.newBuilder().serviceUri(serviceUri).usePlaintext(true).build();<NEW_LINE>log.info("Service uri are : {}", serviceUri);<NEW_LINE>String namespaceName = "default";<NEW_LINE>try (StorageAdminClient admin = StorageClientBuilder.newBuilder().withSettings(settings).buildAdmin()) {<NEW_LINE>boolean created = false;<NEW_LINE>while (!created) {<NEW_LINE>try {<NEW_LINE>NamespaceProperties nsProps = result(admin.getNamespace(namespaceName));<NEW_LINE>log.info("Namespace '{}':\n{}", namespaceName, nsProps);<NEW_LINE>created = true;<NEW_LINE>} catch (NamespaceNotFoundException nnfe) {<NEW_LINE><MASK><NEW_LINE>log.info("Creating namespace '{}' ...", namespaceName);<NEW_LINE>try {<NEW_LINE>NamespaceProperties nsProps = result(admin.createNamespace(namespaceName, NamespaceConfiguration.newBuilder().setDefaultStreamConf(DEFAULT_STREAM_CONF).build()));<NEW_LINE>log.info("Successfully created namespace '{}':", namespaceName);<NEW_LINE>log.info("{}", nsProps);<NEW_LINE>} catch (ClientException ce) {<NEW_LINE>// encountered exception, try to fetch the namespace again<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | log.info("Namespace '{}' is not found.", namespaceName); |
1,537,037 | public void read(org.apache.thrift.protocol.TProtocol prot, grayUpgrade_args struct) throws org.apache.thrift.TException {<NEW_LINE>TTupleProtocol iprot = (TTupleProtocol) prot;<NEW_LINE>BitSet incoming = iprot.readBitSet(4);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct<MASK><NEW_LINE>struct.set_topologyName_isSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.component = iprot.readString();<NEW_LINE>struct.set_component_isSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list317 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());<NEW_LINE>struct.workers = new ArrayList<String>(_list317.size);<NEW_LINE>String _elem318;<NEW_LINE>for (int _i319 = 0; _i319 < _list317.size; ++_i319) {<NEW_LINE>_elem318 = iprot.readString();<NEW_LINE>struct.workers.add(_elem318);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.set_workers_isSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(3)) {<NEW_LINE>struct.workerNum = iprot.readI32();<NEW_LINE>struct.set_workerNum_isSet(true);<NEW_LINE>}<NEW_LINE>} | .topologyName = iprot.readString(); |
1,493,963 | private final DataType<?> parseDataTypeEnum() {<NEW_LINE>parse('(');<NEW_LINE>List<String> <MASK><NEW_LINE>int length = 0;<NEW_LINE>do {<NEW_LINE>String literal = parseStringLiteral();<NEW_LINE>length = Math.max(length, literal.length());<NEW_LINE>literals.add(literal);<NEW_LINE>} while (parseIf(','));<NEW_LINE>parse(')');<NEW_LINE>// [#7025] TODO, replace this by a dynamic enum data type encoding, once available<NEW_LINE>String className = "GeneratedEnum" + (literals.hashCode() & 0x7FFFFFF);<NEW_LINE>StringBuilder content = new StringBuilder();<NEW_LINE>content.append("package org.jooq.impl;\n" + "enum ").append(className).append(" implements org.jooq.EnumType {\n");<NEW_LINE>for (int i = 0; i < literals.size(); i++) content.append(" E").append(i).append("(\"").append(literals.get(i).replace("\"", "\\\"")).append("\"),\n");<NEW_LINE>content.append(" ;\n" + " final String literal;\n" + " private ").append(className).append("(String literal) { this.literal = literal; }\n" + " @Override\n" + " public String getName() {\n" + " return getClass().getName();\n" + " }\n" + " @Override\n" + " public String getLiteral() {\n" + " return literal;\n" + " }\n" + "}");<NEW_LINE>return VARCHAR(length).asEnumDataType(Reflect.compile("org.jooq.impl." + className, content.toString()).get());<NEW_LINE>} | literals = new ArrayList<>(); |
804,673 | public GetRateBasedRuleManagedKeysResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetRateBasedRuleManagedKeysResult getRateBasedRuleManagedKeysResult = new GetRateBasedRuleManagedKeysResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getRateBasedRuleManagedKeysResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ManagedKeys", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getRateBasedRuleManagedKeysResult.setManagedKeys(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextMarker", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getRateBasedRuleManagedKeysResult.setNextMarker(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getRateBasedRuleManagedKeysResult;<NEW_LINE>} | class).unmarshall(context)); |
1,380,316 | // From Main Presentation Part<NEW_LINE>public static List<Style> generateWordStylesFromPresentationPart(CTTextListStyle textStyles, String suffix, FontScheme fontScheme) {<NEW_LINE>List<Style> styles = new ArrayList<Style>();<NEW_LINE>if (textStyles == null)<NEW_LINE>return styles;<NEW_LINE>styles.add(TextStyles.convertToWordStyle(textStyles.getLvl1PPr(), "Lvl1" + suffix, "Lvl1" + suffix, "DocDefaults", fontScheme));<NEW_LINE>styles.add(TextStyles.convertToWordStyle(textStyles.getLvl2PPr(), "Lvl2" + suffix, "Lvl2" + suffix, "DocDefaults", fontScheme));<NEW_LINE>styles.add(TextStyles.convertToWordStyle(textStyles.getLvl3PPr(), "Lvl3" + suffix, "Lvl3" <MASK><NEW_LINE>styles.add(TextStyles.convertToWordStyle(textStyles.getLvl4PPr(), "Lvl4" + suffix, "Lvl4" + suffix, "DocDefaults", fontScheme));<NEW_LINE>styles.add(TextStyles.convertToWordStyle(textStyles.getLvl5PPr(), "Lvl5" + suffix, "Lvl5" + suffix, "DocDefaults", fontScheme));<NEW_LINE>styles.add(TextStyles.convertToWordStyle(textStyles.getLvl6PPr(), "Lvl6" + suffix, "Lvl6" + suffix, "DocDefaults", fontScheme));<NEW_LINE>styles.add(TextStyles.convertToWordStyle(textStyles.getLvl7PPr(), "Lvl7" + suffix, "Lvl7" + suffix, "DocDefaults", fontScheme));<NEW_LINE>styles.add(TextStyles.convertToWordStyle(textStyles.getLvl8PPr(), "Lvl8" + suffix, "Lvl8" + suffix, "DocDefaults", fontScheme));<NEW_LINE>styles.add(TextStyles.convertToWordStyle(textStyles.getLvl9PPr(), "Lvl9" + suffix, "Lvl9" + suffix, "DocDefaults", fontScheme));<NEW_LINE>return styles;<NEW_LINE>} | + suffix, "DocDefaults", fontScheme)); |
1,271,941 | private MapUserSessionEntity createUserSessionEntityInstance(UserSessionModel userSession, boolean offline) {<NEW_LINE>MapUserSessionEntity entity = new MapUserSessionEntity(null, userSession.getRealm().getId());<NEW_LINE>entity.setAuthMethod(userSession.getAuthMethod());<NEW_LINE>entity.setBrokerSessionId(userSession.getBrokerSessionId());<NEW_LINE>entity.setBrokerUserId(userSession.getBrokerUserId());<NEW_LINE>entity.setIpAddress(userSession.getIpAddress());<NEW_LINE>entity.setNotes(new ConcurrentHashMap<>(userSession.getNotes()));<NEW_LINE>entity.addNote(CORRESPONDING_SESSION_ID, userSession.getId());<NEW_LINE>entity.clearAuthenticatedClientSessions();<NEW_LINE>entity.setRememberMe(userSession.isRememberMe());<NEW_LINE>entity.setState(userSession.getState());<NEW_LINE>entity.setLoginUsername(userSession.getLoginUsername());<NEW_LINE>entity.setUserId(userSession.getUser().getId());<NEW_LINE>entity.setStarted(userSession.getStarted());<NEW_LINE>entity.<MASK><NEW_LINE>entity.setOffline(offline);<NEW_LINE>return entity;<NEW_LINE>} | setLastSessionRefresh(userSession.getLastSessionRefresh()); |
1,537,613 | Pair<AggregatedAccountStorageStats, AggregatedAccountStorageStats> aggregateHostAccountStorageStatsWrappers(Map<String, HostAccountStorageStatsWrapper> statsWrappers) throws IOException {<NEW_LINE>Map<Long, Map<Short, Map<Short, ContainerStorageStats>>> combinedHostAccountStorageStatsMap = new HashMap<>();<NEW_LINE>Map<Long, Map<Short, Map<Short, ContainerStorageStats>>> <MASK><NEW_LINE>Map<Long, Long> partitionTimestampMap = new HashMap<>();<NEW_LINE>Map<Long, Long> partitionPhysicalStorageMap = new HashMap<>();<NEW_LINE>for (Map.Entry<String, HostAccountStorageStatsWrapper> statsWrapperEntry : statsWrappers.entrySet()) {<NEW_LINE>if (statsWrapperEntry.getValue() == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String instanceName = statsWrapperEntry.getKey();<NEW_LINE>HostAccountStorageStatsWrapper hostAccountStorageStatsWrapper = statsWrapperEntry.getValue();<NEW_LINE>HostAccountStorageStats hostAccountStorageStats = hostAccountStorageStatsWrapper.getStats();<NEW_LINE>HostAccountStorageStats hostAccountStorageStatsCopy1 = new HostAccountStorageStats(hostAccountStorageStats);<NEW_LINE>HostAccountStorageStats hostAccountStorageStatsCopy2 = new HostAccountStorageStats(hostAccountStorageStats);<NEW_LINE>combineRawHostAccountStorageStatsMap(combinedHostAccountStorageStatsMap, hostAccountStorageStatsCopy1.getStorageStats());<NEW_LINE>selectRawHostAccountStorageStatsMap(selectedHostAccountStorageStatsMap, hostAccountStorageStatsCopy2.getStorageStats(), partitionTimestampMap, partitionPhysicalStorageMap, hostAccountStorageStatsWrapper.getHeader().getTimestamp(), instanceName);<NEW_LINE>}<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("Combined raw HostAccountStorageStats {}", mapper.writeValueAsString(combinedHostAccountStorageStatsMap));<NEW_LINE>logger.trace("Selected raw HostAccountStorageStats {}", mapper.writeValueAsString(selectedHostAccountStorageStatsMap));<NEW_LINE>}<NEW_LINE>AggregatedAccountStorageStats combinedAggregated = new AggregatedAccountStorageStats(aggregateHostAccountStorageStats(combinedHostAccountStorageStatsMap));<NEW_LINE>AggregatedAccountStorageStats selectedAggregated = new AggregatedAccountStorageStats(aggregateHostAccountStorageStats(selectedHostAccountStorageStatsMap));<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("Aggregated combined {}", mapper.writeValueAsString(combinedAggregated));<NEW_LINE>logger.trace("Aggregated selected {}", mapper.writeValueAsString(selectedAggregated));<NEW_LINE>}<NEW_LINE>return new Pair<>(combinedAggregated, selectedAggregated);<NEW_LINE>} | selectedHostAccountStorageStatsMap = new HashMap<>(); |
214,234 | private void callInit(Object newInstance, Object self, VirtualFrame frame, boolean doCreateArgs, Object[] arguments, PKeyword[] keywords) {<NEW_LINE>Object newInstanceKlass = getInstanceClass(newInstance);<NEW_LINE>if (isSubType(newInstanceKlass, self)) {<NEW_LINE>Object initMethod = getInitNode().<MASK><NEW_LINE>if (hasInit.profile(initMethod != PNone.NO_VALUE)) {<NEW_LINE>Object[] initArgs;<NEW_LINE>if (doCreateArgs) {<NEW_LINE>initArgs = PositionalArgumentsNode.prependArgument(newInstance, arguments);<NEW_LINE>} else {<NEW_LINE>// XXX: (tfel) is this valid? I think it should be fine...<NEW_LINE>arguments[0] = newInstance;<NEW_LINE>initArgs = arguments;<NEW_LINE>}<NEW_LINE>Object initResult = getDispatchNode().execute(frame, initMethod, initArgs, keywords);<NEW_LINE>if (gotInitResult.profile(initResult != PNone.NONE && initResult != PNone.NO_VALUE)) {<NEW_LINE>throw raise(TypeError, ErrorMessages.SHOULD_RETURN_NONE, "__init__()");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | execute(frame, newInstanceKlass, newInstance); |
745,985 | <T> Mono<PagedResponse<T>> listRelationshipsNextPage(String nextLink, Class<T> clazz, Context context) {<NEW_LINE>if (context == null) {<NEW_LINE>context = Context.NONE;<NEW_LINE>}<NEW_LINE>return protocolLayer.getDigitalTwins().listRelationshipsNextSinglePageAsync(nextLink, null, context.addData(AZ_TRACING_NAMESPACE_KEY, DIGITAL_TWINS_TRACING_NAMESPACE_VALUE)).map(objectPagedResponse -> {<NEW_LINE>List<T> stringList = objectPagedResponse.getValue().stream().map(object -> {<NEW_LINE>try {<NEW_LINE>return DeserializationHelpers.deserializeObject(MAPPER, object, clazz, this.serializer);<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE><MASK><NEW_LINE>throw LOGGER.logExceptionAsError(new RuntimeException("JsonProcessingException occurred while deserializing the list relationship response", e));<NEW_LINE>}<NEW_LINE>}).filter(Objects::nonNull).collect(Collectors.toList());<NEW_LINE>return new PagedResponseBase<>(objectPagedResponse.getRequest(), objectPagedResponse.getStatusCode(), objectPagedResponse.getHeaders(), stringList, objectPagedResponse.getContinuationToken(), ((PagedResponseBase) objectPagedResponse).getDeserializedHeaders());<NEW_LINE>});<NEW_LINE>} | LOGGER.error("JsonProcessingException occurred while deserializing the list relationship response: ", e); |
21,054 | public int calculatePointOffsetDistance(Point point) {<NEW_LINE>int right = left + width;<NEW_LINE>int bottom = top + height;<NEW_LINE><MASK><NEW_LINE>int pointTop = point.getTop();<NEW_LINE>if (contains(point)) {<NEW_LINE>return max(top - pointTop, pointTop - bottom, left - pointLeft, pointLeft - right);<NEW_LINE>} else if (isQuadrant1(point)) {<NEW_LINE>return max(abs(left - pointLeft), abs(top - pointTop));<NEW_LINE>} else if (isQuadrant2(point)) {<NEW_LINE>return abs(top - pointTop);<NEW_LINE>} else if (isQuadrant3(point)) {<NEW_LINE>return max(abs(pointLeft - right), abs(top - pointTop));<NEW_LINE>} else if (isQuadrant4(point)) {<NEW_LINE>return abs(pointLeft - right);<NEW_LINE>} else if (isQuadrant5(point)) {<NEW_LINE>return max(abs(pointLeft - right), abs(pointTop - bottom));<NEW_LINE>} else if (isQuadrant6(point)) {<NEW_LINE>return abs(pointTop - bottom);<NEW_LINE>} else if (isQuadrant7(point)) {<NEW_LINE>return max(abs(left - pointLeft), abs(pointTop - bottom));<NEW_LINE>} else {<NEW_LINE>return abs(left - pointLeft);<NEW_LINE>}<NEW_LINE>} | int pointLeft = point.getLeft(); |
615,581 | private void tryMergePreviousGap(final long thisSeek) throws IOException {<NEW_LINE>// this is called after a record has been removed. That may cause that a new<NEW_LINE>// empty record was surrounded by gaps. We merge with a previous gap, if this<NEW_LINE>// is also empty, but don't do that recursively<NEW_LINE>// If this is successful, it removes the given marker for thisSeed and<NEW_LINE>// because of this, this method MUST be called AFTER tryMergeNextGaps was called.<NEW_LINE>// first find the gap entry for the closest gap in front of the give gap<NEW_LINE>SortedMap<Long, Integer> head = this.free.headMap(thisSeek);<NEW_LINE>if (head.isEmpty())<NEW_LINE>return;<NEW_LINE>long previousSeek = head<MASK><NEW_LINE>int previousSize = head.get(previousSeek).intValue();<NEW_LINE>// check if this is directly in front<NEW_LINE>if (previousSeek + previousSize + 4 == thisSeek) {<NEW_LINE>// right in front! merge the gaps<NEW_LINE>Integer thisSize = this.free.get(thisSeek);<NEW_LINE>assert thisSize != null;<NEW_LINE>mergeGaps(previousSeek, previousSize, thisSeek, thisSize.intValue());<NEW_LINE>}<NEW_LINE>} | .lastKey().longValue(); |
1,613,624 | private void collectConfigStatistics(@NotNull final Statistic statistic) {<NEW_LINE>final <MASK><NEW_LINE>statistic.setTcpListeners(listenerConfiguration.getTcpListeners().size());<NEW_LINE>statistic.setTlsListeners(listenerConfiguration.getTlsTcpListeners().size());<NEW_LINE>statistic.setWsListeners(listenerConfiguration.getWebsocketListeners().size());<NEW_LINE>statistic.setWssListeners(listenerConfiguration.getTlsWebsocketListeners().size());<NEW_LINE>final MqttConfigurationService mqttConfigurationService = fullConfigurationService.mqttConfiguration();<NEW_LINE>statistic.setMaxQueue(mqttConfigurationService.maxQueuedMessages());<NEW_LINE>statistic.setMaxKeepalive(mqttConfigurationService.keepAliveMax());<NEW_LINE>statistic.setSessionExpiry(mqttConfigurationService.maxSessionExpiryInterval());<NEW_LINE>statistic.setMessageExpiry(mqttConfigurationService.maxMessageExpiryInterval());<NEW_LINE>statistic.setConnectionThrottling(fullConfigurationService.restrictionsConfiguration().maxConnections());<NEW_LINE>statistic.setBandwithIncoming(fullConfigurationService.restrictionsConfiguration().incomingLimit());<NEW_LINE>} | ListenerConfigurationService listenerConfiguration = fullConfigurationService.listenerConfiguration(); |
876,219 | public void onClick(DialogInterface dialog, int selectedColor, Integer[] allColors) {<NEW_LINE>String hex = Utils.getHexString(selectedColor, false).toLowerCase();<NEW_LINE>int pos = _hlEditor.getSelectionStart();<NEW_LINE>switch(colorInsertType) {<NEW_LINE>case R.string.hexcode:<NEW_LINE>{<NEW_LINE>_hlEditor.getText(<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case R.string.foreground:<NEW_LINE>{<NEW_LINE>_hlEditor.getText().insert(pos, "<span style='color:" + hex + ";'></span>");<NEW_LINE>_hlEditor.setSelection(_hlEditor.getSelectionStart() - 7);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case R.string.background:<NEW_LINE>{<NEW_LINE>_hlEditor.getText().insert(pos, "<span style='background-color:" + hex + ";'></span>");<NEW_LINE>_hlEditor.setSelection(_hlEditor.getSelectionStart() - 7);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).insert(pos, hex); |
766,729 | public void reset(Library srcLib, Library destLib, int destHeader) throws IOException {<NEW_LINE>HeaderBlock dest = new HeaderBlock();<NEW_LINE>dest.sign = sign;<NEW_LINE>dest.commitTime = commitTime;<NEW_LINE>int outerSeq = destLib.getOuterTxSeq();<NEW_LINE>long innerSeq = destLib.getNextInnerTxSeq();<NEW_LINE>Zone zone = getFileZone();<NEW_LINE>if (zone != null) {<NEW_LINE>Object data = zone.getData(srcLib);<NEW_LINE>int block = <MASK><NEW_LINE>Zone destZone = new Zone(block);<NEW_LINE>destZone.setTxSeq(outerSeq, innerSeq);<NEW_LINE>dest.fileZones = new ArrayList<Zone>(1);<NEW_LINE>dest.fileZones.add(destZone);<NEW_LINE>}<NEW_LINE>ArrayList<Dir> srcSubDirs = subDirs;<NEW_LINE>ArrayList<Dir> destSubDirs = null;<NEW_LINE>if (srcSubDirs != null) {<NEW_LINE>int subCount = srcSubDirs.size();<NEW_LINE>destSubDirs = new ArrayList<Dir>(subCount);<NEW_LINE>for (Dir srcDir : srcSubDirs) {<NEW_LINE>DirZone srcDirZone = srcDir.getLastZone();<NEW_LINE>if (srcDirZone != null && srcDirZone.valid()) {<NEW_LINE>Dir destDir = new Dir(srcDir.getValue(), srcDir.getName(), null);<NEW_LINE>destSubDirs.add(destDir);<NEW_LINE>DirZone destDirZone = destDir.getLastZone();<NEW_LINE>destDirZone.setBlock(destLib.applyHeaderBlock());<NEW_LINE>destDirZone.setTxSeq(outerSeq, innerSeq);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int subDirCount = destSubDirs != null ? destSubDirs.size() : 0;<NEW_LINE>if (subDirCount > 0) {<NEW_LINE>dest.subDirs = destSubDirs;<NEW_LINE>}<NEW_LINE>byte[] bytes = dest.toBytes();<NEW_LINE>destLib.writeHeaderBlock(destHeader, null, bytes);<NEW_LINE>if (subDirCount > 0) {<NEW_LINE>int q = 0;<NEW_LINE>for (Dir srcDir : srcSubDirs) {<NEW_LINE>DirZone srcDirZone = srcDir.getLastZone();<NEW_LINE>if (srcDirZone != null && srcDirZone.valid()) {<NEW_LINE>ISection srcSection = srcDirZone.getSection(srcLib, srcDir);<NEW_LINE>Dir destDir = destSubDirs.get(q++);<NEW_LINE>int destSubHeader = destDir.getLastZone().getBlock();<NEW_LINE>srcSection.reset(srcLib, destLib, destSubHeader);<NEW_LINE>srcDirZone.releaseSection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | destLib.writeDataBlock(destHeader, data); |
1,346,404 | public void jacobian(double X, double Y, double Z, double[] inputX, double[] inputY, boolean computeIntrinsic, @Nullable double[] calibX, @Nullable double[] calibY) {<NEW_LINE>Z = -Z;<NEW_LINE>double normX = X / Z;<NEW_LINE>double normY = Y / Z;<NEW_LINE>double n2 = normX * normX + normY * normY;<NEW_LINE>double n2_X = 2 * normX / Z;<NEW_LINE>double n2_Y = 2 * normY / Z;<NEW_LINE>double n2_Z = -2 * n2 / Z;<NEW_LINE>double r = 1.0 + (k1 + k2 * n2) * n2;<NEW_LINE>double kk = k1 + 2 * k2 * n2;<NEW_LINE>double r_Z = n2_Z * kk;<NEW_LINE>// partial X<NEW_LINE>inputX[0] = (f / Z) * (r + 2 * normX * normX * kk);<NEW_LINE>inputY[0] = f * normY * n2_X * kk;<NEW_LINE>// partial Y<NEW_LINE>inputX[1] = f * normX * n2_Y * kk;<NEW_LINE>inputY[1] = (f / Z) * (r + 2 * normY * normY * kk);<NEW_LINE>// partial Z<NEW_LINE>// you have no idea how many hours I lost before I realized the mistake here<NEW_LINE>inputX[2] = f * normX * (r / Z - r_Z);<NEW_LINE>inputY[2] = f * normY * (r / Z - r_Z);<NEW_LINE>if (!computeIntrinsic || calibX == null || calibY == null)<NEW_LINE>return;<NEW_LINE>// partial f<NEW_LINE>calibX[0] = r * normX;<NEW_LINE>calibY[0] = r * normY;<NEW_LINE>// partial k1<NEW_LINE>calibX[1] = f * normX * n2;<NEW_LINE>calibY[<MASK><NEW_LINE>// partial k2<NEW_LINE>calibX[2] = f * normX * n2 * n2;<NEW_LINE>calibY[2] = f * normY * n2 * n2;<NEW_LINE>} | 1] = f * normY * n2; |
1,044,267 | public void dump(StringBuffer buf) {<NEW_LINE>buf.append("\n$$$\t");<NEW_LINE>buf.append(getDesc());<NEW_LINE>buf.append('\t');<NEW_LINE>if (_id != null) {<NEW_LINE>buf.append("id: ");<NEW_LINE>buf.append(_id);<NEW_LINE>buf.append('\n');<NEW_LINE>buf.append("Severity: ");<NEW_LINE><MASK><NEW_LINE>buf.append('\n');<NEW_LINE>buf.append("Log length: ");<NEW_LINE>buf.append(_log.size());<NEW_LINE>buf.append('\t');<NEW_LINE>buf.append("is complete: ");<NEW_LINE>buf.append((_severity & LogEvent.COMPLETED) == LogEvent.COMPLETED ? "true" : "false");<NEW_LINE>buf.append("\n\n");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < _log.size(); i++) {<NEW_LINE>buf.append('(');<NEW_LINE>buf.append(i);<NEW_LINE>buf.append(") ");<NEW_LINE>((LogEvent) _log.elementAt(i)).dump(buf, this);<NEW_LINE>buf.append('\n');<NEW_LINE>}<NEW_LINE>buf.append("\t~~~\n");<NEW_LINE>} | LogEvent.dumpLevelAsString(buf, _severity); |
1,807,130 | public void marshall(DocumentVersionMetadata documentVersionMetadata, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (documentVersionMetadata == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getContentType(), CONTENTTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getSize(), SIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getCreatedTimestamp(), CREATEDTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getModifiedTimestamp(), MODIFIEDTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getContentCreatedTimestamp(), CONTENTCREATEDTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getContentModifiedTimestamp(), CONTENTMODIFIEDTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getCreatorId(), CREATORID_BINDING);<NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getThumbnail(), THUMBNAIL_BINDING);<NEW_LINE>protocolMarshaller.marshall(documentVersionMetadata.getSource(), SOURCE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | documentVersionMetadata.getSignature(), SIGNATURE_BINDING); |
1,719,530 | CompletableFuture<Version> updateHistoryTimeSeriesChunkData(int historyChunk, VersionedMetadata<HistoryTimeSeries> updated, OperationContext context) {<NEW_LINE>Preconditions.checkNotNull(updated);<NEW_LINE>Preconditions.checkNotNull(updated.getObject());<NEW_LINE>final CompletableFuture<Version> result = new CompletableFuture<>();<NEW_LINE>VersionedMetadata<<MASK><NEW_LINE>synchronized (lock) {<NEW_LINE>if (!historyTimeSeries.containsKey(historyChunk)) {<NEW_LINE>result.completeExceptionally(StoreException.create(StoreException.Type.DATA_NOT_FOUND, "History timeseries chunk for stream: " + getName()));<NEW_LINE>} else if (historyTimeSeries.get(historyChunk).getVersion().equals(updated.getVersion())) {<NEW_LINE>this.historyTimeSeries.put(historyChunk, copy);<NEW_LINE>result.complete(copy.getVersion());<NEW_LINE>} else {<NEW_LINE>result.completeExceptionally(StoreException.create(StoreException.Type.WRITE_CONFLICT, "History time series for stream: " + getName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | HistoryTimeSeries> copy = updatedCopy(updated); |
1,689,762 | public void propagate(int evtmask) throws ContradictionException {<NEW_LINE>int lbSum = 0;<NEW_LINE>int ubPosSum = 0;<NEW_LINE>int ubNegSum = 0;<NEW_LINE>ISetIterator iter = set<MASK><NEW_LINE>while (iter.hasNext()) {<NEW_LINE>int j = iter.nextInt();<NEW_LINE>if (outOfScope(j)) {<NEW_LINE>set.remove(j, this);<NEW_LINE>} else {<NEW_LINE>if (set.getLB().contains(j)) {<NEW_LINE>lbSum += get(j);<NEW_LINE>} else if (get(j) >= 0) {<NEW_LINE>ubPosSum += get(j);<NEW_LINE>} else {<NEW_LINE>ubNegSum += get(j);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int min = lbSum + ubNegSum;<NEW_LINE>int max = lbSum + ubPosSum;<NEW_LINE>sum.updateBounds(min, max, this);<NEW_LINE>// filter set<NEW_LINE>int lb = sum.getLB();<NEW_LINE>int ub = sum.getUB();<NEW_LINE>if (lb == min && ub == max) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>iter = set.getUB().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>int j = iter.nextInt();<NEW_LINE>if (!set.getLB().contains(j)) {<NEW_LINE>if (min + get(j) > ub) {<NEW_LINE>if (set.remove(j, this)) {<NEW_LINE>// weights[j] is positive<NEW_LINE>ubPosSum -= get(j);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (max + get(j) < lb) {<NEW_LINE>if (set.remove(j, this)) {<NEW_LINE>// weights[j] is negative<NEW_LINE>ubNegSum -= get(j);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (max - get(j) < lb || min - get(j) > ub) {<NEW_LINE>if (set.force(j, this)) {<NEW_LINE>// weight[j] is positive<NEW_LINE>lbSum += get(j);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>min = lbSum + ubNegSum;<NEW_LINE>max = lbSum + ubPosSum;<NEW_LINE>sum.updateBounds(min, max, this);<NEW_LINE>} | .getUB().iterator(); |
1,741,929 | private SqlTree createNativeSqlTree(OrmQueryRequest<?> request, CQueryPredicates predicates) {<NEW_LINE>SpiQuery<?> query = request.query();<NEW_LINE>// parse named parameters returning the final sql to execute<NEW_LINE>String sql = predicates.parseBindParams(query.getNativeSql());<NEW_LINE>if (query.hasMaxRowsOrFirstRow()) {<NEW_LINE>sql = nativeQueryPaging(query, sql);<NEW_LINE>}<NEW_LINE>query.setGeneratedSql(sql);<NEW_LINE>Connection connection = request.transaction().connection();<NEW_LINE>BeanDescriptor<?> desc = request.descriptor();<NEW_LINE>try {<NEW_LINE>// For SqlServer we need either "selectMethod=cursor" in the connection string or fetch explicitly a cursorable<NEW_LINE>// statement here by specifying ResultSet.CONCUR_UPDATABLE<NEW_LINE>PreparedStatement statement = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, dbPlatform.isSupportsResultSetConcurrencyModeUpdatable() ? ResultSet.CONCUR_UPDATABLE : ResultSet.CONCUR_READ_ONLY);<NEW_LINE>predicates.bind(statement, connection);<NEW_LINE>ResultSet resultSet = statement.executeQuery();<NEW_LINE>ResultSetMetaData metaData = resultSet.getMetaData();<NEW_LINE>int cols = 1 + metaData.getColumnCount();<NEW_LINE>List<String> propertyNames = new <MASK><NEW_LINE>for (int i = 1; i < cols; i++) {<NEW_LINE>String schemaName = lower(metaData.getSchemaName(i));<NEW_LINE>String tableName = lower(metaData.getTableName(i));<NEW_LINE>String columnName = lower(metaData.getColumnName(i));<NEW_LINE>String path = desc.findBeanPath(schemaName, tableName, columnName);<NEW_LINE>if (path != null) {<NEW_LINE>propertyNames.add(path);<NEW_LINE>} else {<NEW_LINE>propertyNames.add(SpiRawSql.IGNORE_COLUMN);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RawSql rawSql = RawSqlBuilder.resultSet(resultSet, propertyNames.toArray(new String[0]));<NEW_LINE>query.setRawSql(rawSql);<NEW_LINE>return createRawSqlSqlTree(request, predicates);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | ArrayList<>(cols - 1); |
1,196,815 | private void updateFormat() {<NEW_LINE>fmt = new MediaFormat();<NEW_LINE>Format format = listFormat.getSelectedValue();<NEW_LINE>fmt.setFormat(format.getExt());<NEW_LINE>fmt.setDescription(format.getDesc());<NEW_LINE>fmt.setResolution(Format.getSize((String) cmbResolution.getSelectedItem()));<NEW_LINE>fmt.setVideo_codec((Format.getCodecName((String) cmbVideoCodec.getSelectedItem())));<NEW_LINE>fmt.setVideo_bitrate(Format.getBitRate(getCmbVal(cmbVBR)));<NEW_LINE>String fr = getCmbVal(cmbFrameRate);<NEW_LINE>fmt.setFramerate(fr);<NEW_LINE>fmt.setAspectRatio(Format.getAspec(getCmbVal(cmbSize)));<NEW_LINE>fmt.setAudio_codec(Format.getCodecName(getCmbVal(cmbAudioCodec)));<NEW_LINE>fmt.setAudio_bitrate(Format.getBitRate(getCmbVal(cmbAbr)));<NEW_LINE>fmt<MASK><NEW_LINE>fmt.setAudio_channel(getCmbVal(cmbAc));<NEW_LINE>fmt.setVideo_param_extra(format.getVidExtra());<NEW_LINE>} | .setSamplerate(getCmbVal(cmbAsr)); |
977,333 | public static void init(String[] args) throws Exception {<NEW_LINE>parseArgs(args);<NEW_LINE><MASK><NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>PhysicalSourceConfig physicalSourceConfig = mapper.readValue(sourcesJson, PhysicalSourceConfig.class);<NEW_LINE>physicalSourceConfig.checkForNulls();<NEW_LINE>Config config = new Config();<NEW_LINE>ConfigLoader<StaticConfig> configLoader = new ConfigLoader<StaticConfig>("databus.seed.", config);<NEW_LINE>_sStaticConfig = configLoader.loadConfig(_sBootstrapConfigProps);<NEW_LINE>// Make sure the URI from the configuration file identifies an Oracle JDBC source.<NEW_LINE>String uri = physicalSourceConfig.getUri();<NEW_LINE>if (!uri.startsWith("jdbc:oracle")) {<NEW_LINE>throw new InvalidConfigException("Invalid source URI (" + physicalSourceConfig.getUri() + "). Only jdbc:oracle: URIs are supported.");<NEW_LINE>}<NEW_LINE>OracleEventProducerFactory factory = new BootstrapSeederOracleEventProducerFactory(_sStaticConfig.getController().getPKeyNameMap());<NEW_LINE>// Parse each one of the logical sources<NEW_LINE>_sources = new ArrayList<OracleTriggerMonitoredSourceInfo>();<NEW_LINE>FileSystemSchemaRegistryService schemaRegistryService = FileSystemSchemaRegistryService.build(_sStaticConfig.getSchemaRegistry().getFileSystem());<NEW_LINE>for (LogicalSourceConfig sourceConfig : physicalSourceConfig.getSources()) {<NEW_LINE>OracleTriggerMonitoredSourceInfo source = factory.buildOracleMonitoredSourceInfo(sourceConfig.build(), physicalSourceConfig.build(), schemaRegistryService);<NEW_LINE>_sources.add(source);<NEW_LINE>}<NEW_LINE>_sSeeder = new BootstrapDBSeeder(_sStaticConfig.getBootstrap(), _sources);<NEW_LINE>_sBootstrapBuffer = new BootstrapEventBuffer(_sStaticConfig.getController().getCommitInterval() * 2);<NEW_LINE>_sWriterThread = new BootstrapSeederWriterThread(_sBootstrapBuffer, _sSeeder);<NEW_LINE>_sReader = new BootstrapAvroFileEventReader(_sStaticConfig.getController(), _sources, _sSeeder.getLastRows(), _sBootstrapBuffer);<NEW_LINE>} | File sourcesJson = new File(_sSourcesConfigFile); |
864,030 | public void eventHappened(MapEvent event) {<NEW_LINE>if (event.getType() == MapEvent.Type.MAP_NEW) {<NEW_LINE>infoField.setText("Ways: " + map.getWayCount() + ", Nodes: " + map.getNodeCount() + ", POIs: " + map.getPoiCount());<NEW_LINE>} else if (event.getType() == MapEvent.Type.MARKER_ADDED) {<NEW_LINE>List<MapNode> nodes = map.getMarkers();<NEW_LINE>DecimalFormat f1 = new DecimalFormat("#0.00");<NEW_LINE>MapNode marker = nodes.get(nodes.size() - 1);<NEW_LINE>infoField.setText("Marker " + marker.getName() + ": Lat " + f1.format(marker.getLat()) + "; Lon " + f1.format(marker.getLon()));<NEW_LINE>} else if (event.getType() == MapEvent.Type.TRACK_MODIFIED) {<NEW_LINE>Track track = map.getTrack(event.getObjId());<NEW_LINE>if (track != null) {<NEW_LINE>List<MapNode> nodes = track.getNodes();<NEW_LINE>DecimalFormat f1 = new DecimalFormat("#0.00");<NEW_LINE>double <MASK><NEW_LINE>String info = track.getName() + ": Length " + f1.format(km) + " km";<NEW_LINE>if (nodes.size() == 2) {<NEW_LINE>DecimalFormat f2 = new DecimalFormat("#000");<NEW_LINE>MapNode m1 = nodes.get(nodes.size() - 2);<NEW_LINE>MapNode m2 = nodes.get(nodes.size() - 1);<NEW_LINE>int course = new Position(m1).getCourseTo(m2);<NEW_LINE>info += "; Direction " + f2.format(course);<NEW_LINE>}<NEW_LINE>infoField.setText(info);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>infoField.setText("");<NEW_LINE>}<NEW_LINE>} | km = Position.getTrackLengthKM(nodes); |
1,730,314 | public static DescribePhysicalConnectionsResponse unmarshall(DescribePhysicalConnectionsResponse describePhysicalConnectionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePhysicalConnectionsResponse.setRequestId(_ctx.stringValue("DescribePhysicalConnectionsResponse.RequestId"));<NEW_LINE>describePhysicalConnectionsResponse.setPageNumber(_ctx.integerValue("DescribePhysicalConnectionsResponse.PageNumber"));<NEW_LINE>describePhysicalConnectionsResponse.setPageSize(_ctx.integerValue("DescribePhysicalConnectionsResponse.PageSize"));<NEW_LINE>describePhysicalConnectionsResponse.setTotalCount(_ctx.integerValue("DescribePhysicalConnectionsResponse.TotalCount"));<NEW_LINE>List<PhysicalConnectionType> physicalConnectionSet = new ArrayList<PhysicalConnectionType>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet.Length"); i++) {<NEW_LINE>PhysicalConnectionType physicalConnectionType = new PhysicalConnectionType();<NEW_LINE>physicalConnectionType.setAdLocation(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].AdLocation"));<NEW_LINE>physicalConnectionType.setCreationTime(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].CreationTime"));<NEW_LINE>physicalConnectionType.setStatus(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].Status"));<NEW_LINE>physicalConnectionType.setType(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].Type"));<NEW_LINE>physicalConnectionType.setPortNumber(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].PortNumber"));<NEW_LINE>physicalConnectionType.setCircuitCode(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].CircuitCode"));<NEW_LINE>physicalConnectionType.setSpec(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].Spec"));<NEW_LINE>physicalConnectionType.setBandwidth(_ctx.longValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].Bandwidth"));<NEW_LINE>physicalConnectionType.setDescription(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].Description"));<NEW_LINE>physicalConnectionType.setPortType(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].PortType"));<NEW_LINE>physicalConnectionType.setEnabledTime(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].EnabledTime"));<NEW_LINE>physicalConnectionType.setBusinessStatus(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].BusinessStatus"));<NEW_LINE>physicalConnectionType.setLineOperator(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].LineOperator"));<NEW_LINE>physicalConnectionType.setName(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].Name"));<NEW_LINE>physicalConnectionType.setRedundantPhysicalConnectionId(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].RedundantPhysicalConnectionId"));<NEW_LINE>physicalConnectionType.setPeerLocation(_ctx.stringValue<MASK><NEW_LINE>physicalConnectionType.setAccessPointId(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].AccessPointId"));<NEW_LINE>physicalConnectionType.setPhysicalConnectionId(_ctx.stringValue("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].PhysicalConnectionId"));<NEW_LINE>physicalConnectionSet.add(physicalConnectionType);<NEW_LINE>}<NEW_LINE>describePhysicalConnectionsResponse.setPhysicalConnectionSet(physicalConnectionSet);<NEW_LINE>return describePhysicalConnectionsResponse;<NEW_LINE>} | ("DescribePhysicalConnectionsResponse.PhysicalConnectionSet[" + i + "].PeerLocation")); |
455,050 | public void fetchRow(DBCSession session, DBCResultSet resultSet) throws DBCException {<NEW_LINE>Object[] row = new Object[bindings.length];<NEW_LINE>for (int i = 0; i < bindings.length; i++) {<NEW_LINE>DBDAttributeBinding binding = bindings[i];<NEW_LINE>try {<NEW_LINE>Object cellValue = binding.getValueHandler().fetchValueObject(resultSet.getSession(), resultSet, binding.getMetaAttribute(), i);<NEW_LINE>row[i] = cellValue;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>row[i] = new DBDValueError(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rows.add(row);<NEW_LINE>if (rowLimit != null && rows.size() > rowLimit.longValue()) {<NEW_LINE>throw new DBQuotaException("Result set rows quota exceeded", WebSQLConstants.QUOTA_PROP_ROW_LIMIT, rowLimit.longValue(<MASK><NEW_LINE>}<NEW_LINE>} | ), rows.size()); |
1,051,953 | public DescribeStepResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeStepResult describeStepResult = new DescribeStepResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeStepResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Step", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeStepResult.setStep(StepJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeStepResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,655,387 | public static CreateBatchOperation create(URI serviceUri, Creator creator) {<NEW_LINE>CreateBatchOperation createBatchOperation = new CreateBatchOperation(serviceUri);<NEW_LINE>JobType jobType = new JobType();<NEW_LINE>jobType.setName(creator.getName());<NEW_LINE>jobType.setPriority(creator.getPriority());<NEW_LINE>for (JobNotificationSubscription jobNotificationSubscription : creator.getJobNotificationSubscription()) {<NEW_LINE>JobNotificationSubscriptionType jobNotificationSubscriptionType = new JobNotificationSubscriptionType();<NEW_LINE>jobNotificationSubscriptionType.setNotificationEndPointId(jobNotificationSubscription.getNotificationEndPointId());<NEW_LINE>jobNotificationSubscriptionType.setTargetJobState(jobNotificationSubscription.getTargetJobState().getCode());<NEW_LINE>jobType.addJobNotificationSubscriptionType(jobNotificationSubscriptionType);<NEW_LINE>}<NEW_LINE>for (String inputMediaAsset : creator.getInputMediaAssets()) {<NEW_LINE>createBatchOperation.addLink("InputMediaAssets", String.format("%s/Assets('%s')", createBatchOperation.getServiceUri().toString()<MASK><NEW_LINE>}<NEW_LINE>createBatchOperation.addContentObject(jobType);<NEW_LINE>return createBatchOperation;<NEW_LINE>} | , inputMediaAsset), "application/atom+xml;type=feed", "http://schemas.microsoft.com/ado/2007/08/dataservices/related/InputMediaAssets"); |
1,794,213 | private boolean metaEqual(Schema schema1, Schema schema2, Map<IdentityPair<Schema, Schema>, Boolean> cache) {<NEW_LINE>if (schema1 == schema2) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (schema1 == null || schema2 == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Schema.Type type1 = schema1.getType();<NEW_LINE>Schema.Type type2 = schema2.getType();<NEW_LINE>if (type1 != type2) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>switch(type1) {<NEW_LINE>case RECORD:<NEW_LINE>// Add a temporary value to the cache to avoid cycles.<NEW_LINE>// As long as we recurse only at the end of the method, we can safely default to true here.<NEW_LINE>// The cache is updated at the end of the method with the actual comparison result.<NEW_LINE>IdentityPair<Schema, Schema> sp = new IdentityPair<>(schema1, schema2);<NEW_LINE>Boolean cacheHit = cache.putIfAbsent(sp, true);<NEW_LINE>if (cacheHit != null) {<NEW_LINE>return cacheHit;<NEW_LINE>}<NEW_LINE>boolean equals = Objects.equals(schema1.getAliases(), schema2.getAliases()) && Objects.equals(schema1.getDoc(), schema2.getDoc()) && fieldMetaEqual(schema1.getFields(), <MASK><NEW_LINE>cache.put(sp, equals);<NEW_LINE>return equals;<NEW_LINE>case ENUM:<NEW_LINE>return Objects.equals(schema1.getAliases(), schema2.getAliases()) && Objects.equals(schema1.getDoc(), schema2.getDoc()) && Objects.equals(schema1.getEnumDefault(), schema2.getEnumDefault());<NEW_LINE>case FIXED:<NEW_LINE>return Objects.equals(schema1.getAliases(), schema2.getAliases()) && Objects.equals(schema1.getDoc(), schema2.getDoc());<NEW_LINE>case UNION:<NEW_LINE>List<Schema> types1 = schema1.getTypes();<NEW_LINE>List<Schema> types2 = schema2.getTypes();<NEW_LINE>if (types1.size() != types2.size()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < types1.size(); i++) {<NEW_LINE>if (!metaEqual(types1.get(i), types2.get(i), cache)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>default:<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} | schema2.getFields(), cache); |
14,146 | protected void compute() {<NEW_LINE>try {<NEW_LINE>try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()))) {<NEW_LINE>while (true) {<NEW_LINE>String line = reader.readLine();<NEW_LINE>if (line == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (line.length() == 0 || line.charAt(0) == '#') {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!lineCondition.test(line)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (i > -1) {<NEW_LINE>line = line.substring(0, i);<NEW_LINE>}<NEW_LINE>ServiceInstanceLoader<S> task = new ServiceInstanceLoader<>(line, transformer);<NEW_LINE>tasks.add(task);<NEW_LINE>task.fork();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException | UncheckedIOException e) {<NEW_LINE>// ignore, can't do anything here and can't log because class used in compiler<NEW_LINE>}<NEW_LINE>} | i = line.indexOf('#'); |
61,014 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_map_realtime);<NEW_LINE>Toolbar toolbar = <MASK><NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>ButterKnife.bind(this);<NEW_LINE>mHandler = new Handler(Looper.getMainLooper());<NEW_LINE>mMap = findViewById(R.id.map);<NEW_LINE>scrollView.setVisibility(View.GONE);<NEW_LINE>SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);<NEW_LINE>mToken = mSharedPreferences.getString(USER_TOKEN, null);<NEW_LINE>initMap();<NEW_LINE>setTitle("Map View");<NEW_LINE>// Get user's current location<NEW_LINE>tracker = new GPSTracker(this);<NEW_LINE>if (!tracker.canGetLocation()) {<NEW_LINE>tracker.displayLocationRequest(this, mMap);<NEW_LINE>} else {<NEW_LINE>mCurlat = Double.toString(tracker.getLatitude());<NEW_LINE>mCurlon = Double.toString(tracker.getLongitude());<NEW_LINE>showDialogToSelectitems();<NEW_LINE>}<NEW_LINE>Objects.requireNonNull(getSupportActionBar()).setHomeButtonEnabled(true);<NEW_LINE>getSupportActionBar().setDisplayHomeAsUpEnabled(true);<NEW_LINE>} | findViewById(R.id.toolbar); |
1,297,195 | protected OutputStream open(OutputStream out, ASN1EncodableVector recipientInfos, OutputEncryptor encryptor) throws CMSException {<NEW_LINE>try {<NEW_LINE>//<NEW_LINE>// ContentInfo<NEW_LINE>//<NEW_LINE>BERSequenceGenerator cGen = new BERSequenceGenerator(out);<NEW_LINE>cGen.addObject(CMSObjectIdentifiers.envelopedData);<NEW_LINE>//<NEW_LINE>// Encrypted Data<NEW_LINE>//<NEW_LINE>BERSequenceGenerator envGen = new BERSequenceGenerator(cGen.getRawOutputStream(), 0, true);<NEW_LINE>ASN1Set recipients;<NEW_LINE>if (_berEncodeRecipientSet) {<NEW_LINE>recipients = new BERSet(recipientInfos);<NEW_LINE>} else {<NEW_LINE>recipients = new DERSet(recipientInfos);<NEW_LINE>}<NEW_LINE>envGen.addObject(getVersion(recipientInfos));<NEW_LINE>if (originatorInfo != null) {<NEW_LINE>envGen.addObject(new DERTaggedObject(false, 0, originatorInfo));<NEW_LINE>}<NEW_LINE>envGen.getRawOutputStream().write(recipients.getEncoded());<NEW_LINE>BERSequenceGenerator eiGen = new BERSequenceGenerator(envGen.getRawOutputStream());<NEW_LINE>eiGen.addObject(CMSObjectIdentifiers.data);<NEW_LINE>AlgorithmIdentifier encAlgId = encryptor.getAlgorithmIdentifier();<NEW_LINE>eiGen.getRawOutputStream().<MASK><NEW_LINE>OutputStream octetStream = CMSUtils.createBEROctetOutputStream(eiGen.getRawOutputStream(), 0, false, _bufferSize);<NEW_LINE>return new CmsEnvelopedDataOutputStream(encryptor, octetStream, cGen, envGen, eiGen);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new CMSException("exception decoding algorithm parameters.", e);<NEW_LINE>}<NEW_LINE>} | write(encAlgId.getEncoded()); |
1,709,897 | public void removeNonLeafEntry(final int entryIndex, final byte[] key, final int prevChild) {<NEW_LINE>if (isLeaf()) {<NEW_LINE>throw new IllegalStateException("Remove is applied to non-leaf buckets only");<NEW_LINE>}<NEW_LINE>final int entryPosition = getIntValue(POSITIONS_ARRAY_OFFSET + entryIndex * OIntegerSerializer.INT_SIZE);<NEW_LINE>final int entrySize = key.length + 2 * OIntegerSerializer.INT_SIZE;<NEW_LINE>int size = getIntValue(SIZE_OFFSET);<NEW_LINE>final int leftChild = getIntValue(entryPosition);<NEW_LINE>final int rightChild = getIntValue(entryPosition + OIntegerSerializer.INT_SIZE);<NEW_LINE>if (entryIndex < size - 1) {<NEW_LINE>moveData(POSITIONS_ARRAY_OFFSET + (entryIndex + 1) * OIntegerSerializer.INT_SIZE, POSITIONS_ARRAY_OFFSET + entryIndex * OIntegerSerializer.INT_SIZE, (size - entryIndex - 1) * OIntegerSerializer.INT_SIZE);<NEW_LINE>}<NEW_LINE>size--;<NEW_LINE>setIntValue(SIZE_OFFSET, size);<NEW_LINE><MASK><NEW_LINE>assert freePointer <= ODurablePage.MAX_PAGE_SIZE_BYTES;<NEW_LINE>if (size > 0 && entryPosition > freePointer) {<NEW_LINE>moveData(freePointer, freePointer + entrySize, entryPosition - freePointer);<NEW_LINE>}<NEW_LINE>assert freePointer + entrySize <= ODurablePage.MAX_PAGE_SIZE_BYTES;<NEW_LINE>setIntValue(FREE_POINTER_OFFSET, freePointer + entrySize);<NEW_LINE>int currentPositionOffset = POSITIONS_ARRAY_OFFSET;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>final int currentEntryPosition = getIntValue(currentPositionOffset);<NEW_LINE>if (currentEntryPosition < entryPosition) {<NEW_LINE>setIntValue(currentPositionOffset, currentEntryPosition + entrySize);<NEW_LINE>}<NEW_LINE>currentPositionOffset += OIntegerSerializer.INT_SIZE;<NEW_LINE>}<NEW_LINE>if (prevChild >= 0) {<NEW_LINE>if (entryIndex > 0) {<NEW_LINE>final int prevEntryPosition = getIntValue(POSITIONS_ARRAY_OFFSET + (entryIndex - 1) * OIntegerSerializer.INT_SIZE);<NEW_LINE>setIntValue(prevEntryPosition + OIntegerSerializer.INT_SIZE, prevChild);<NEW_LINE>}<NEW_LINE>if (entryIndex < size) {<NEW_LINE>final int nextEntryPosition = getIntValue(POSITIONS_ARRAY_OFFSET + entryIndex * OIntegerSerializer.INT_SIZE);<NEW_LINE>setIntValue(nextEntryPosition, prevChild);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | final int freePointer = getIntValue(FREE_POINTER_OFFSET); |
587,787 | private static void returnExceptVoidAndLuaValue(MethodSpec.Builder mb, final String call, TypeName returnType, boolean initGlobals) {<NEW_LINE>if (isBoolean(returnType)) {<NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb, getLuaBoolean(call), LuaValue, LuaValue);<NEW_LINE>} else if (isInt(returnType)) {<NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb, getLuaNumberI(call), LuaNumber);<NEW_LINE>} else if (isDouble(returnType)) {<NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb, getLuaNumberD(call), LuaNumber);<NEW_LINE>} else if (isString(returnType)) {<NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb, getLuaString(call), LuaString);<NEW_LINE>} else if (isLuaValue(returnType)) {<NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb, call);<NEW_LINE>} else if (returnType instanceof ArrayTypeName) {<NEW_LINE>TypeName ct = ((ArrayTypeName) returnType).componentType;<NEW_LINE>if (!initGlobals)<NEW_LINE>mb.addStatement("$T globals = $T.getGlobalsByLState(L)", Globals, Globals);<NEW_LINE>mb.addCode("return ");<NEW_LINE>if (ct.isPrimitive()) {<NEW_LINE>LuaValue_varargsOf(mb, "$T.toTable(globals, " + call + ")", PrimitiveArrayUtils);<NEW_LINE>} else {<NEW_LINE>LuaValue_varargsOf(mb, "$T.toLuaArray(globals, " + call + ")", ObjectArrayUtils);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!initGlobals)<NEW_LINE>mb.<MASK><NEW_LINE>mb.addCode("return ");<NEW_LINE>LuaValue_varargsOf(mb, translateJavaToLua(call), UserdataTranslator);<NEW_LINE>}<NEW_LINE>} | addStatement("$T globals = $T.getGlobalsByLState(L)", Globals, Globals); |
1,210,008 | private JPanel buildPluginPathsPanel() {<NEW_LINE>// create the UP and DOWN arrows panel<NEW_LINE>upButton = ButtonPanelFactory.createButton(ButtonPanelFactory.ARROW_UP_TYPE);<NEW_LINE>upButton.setName("UpArrow");<NEW_LINE>upButton.addActionListener(e -> handleSelection(UP));<NEW_LINE>downButton = ButtonPanelFactory.createButton(ButtonPanelFactory.ARROW_DOWN_TYPE);<NEW_LINE>downButton.setName("DownArrow");<NEW_LINE>downButton.addActionListener(e -> handleSelection(DOWN));<NEW_LINE>JPanel arrowButtonsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 10));<NEW_LINE>arrowButtonsPanel.add(upButton);<NEW_LINE>arrowButtonsPanel.add(downButton);<NEW_LINE>// create the Add and Remove panel<NEW_LINE>JButton addJarButton = ButtonPanelFactory.createButton(ADD_JAR_BUTTON_TEXT);<NEW_LINE>addJarButton.addActionListener(e -> addJarCallback());<NEW_LINE>JButton addDirButton = ButtonPanelFactory.createButton(ADD_DIR_BUTTON_TEXT);<NEW_LINE>addDirButton.addActionListener(e -> addDirCallback());<NEW_LINE>removeButton = ButtonPanelFactory.createButton("Remove");<NEW_LINE>removeButton.addActionListener(e -> handleSelection(REMOVE));<NEW_LINE>Dimension d = addJarButton.getPreferredSize();<NEW_LINE>addDirButton.setPreferredSize(d);<NEW_LINE>removeButton.setPreferredSize(d);<NEW_LINE>JPanel otherButtonsPanel = ButtonPanelFactory.createButtonPanel(new JButton[] { addJarButton, addDirButton, removeButton }, SIDE_MARGIN);<NEW_LINE>// put the right-side buttons panel together<NEW_LINE>JPanel listButtonPanel = new JPanel(new BorderLayout(0, 0));<NEW_LINE>listButtonPanel.add(arrowButtonsPanel, BorderLayout.NORTH);<NEW_LINE>listButtonPanel.add(otherButtonsPanel, BorderLayout.CENTER);<NEW_LINE>//<NEW_LINE>// construct the plugin paths list<NEW_LINE>//<NEW_LINE>JPanel scrollListPanel = new JPanel(new BorderLayout(10, 15));<NEW_LINE>pluginPathsList = new JList<>();<NEW_LINE>pluginPathsList.addListSelectionListener(new PathListSelectionListener());<NEW_LINE>pluginPathsList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);<NEW_LINE>// give the list a custom cell renderer that shows invalid paths<NEW_LINE>// in red (may be preference paths set previously that are no longer<NEW_LINE>// available<NEW_LINE>pluginPathsList.setCellRenderer(new PluginPathRenderer());<NEW_LINE>// component used for sizing all the text fields on the main panel<NEW_LINE>scrollPane = new JScrollPane(pluginPathsList);<NEW_LINE>scrollPane.setPreferredSize(<MASK><NEW_LINE>scrollListPanel.add(scrollPane, BorderLayout.CENTER);<NEW_LINE>//<NEW_LINE>// construct the plugin text panel<NEW_LINE>//<NEW_LINE>JPanel pluginPathListPanel = new JPanel(new BorderLayout(0, 0));<NEW_LINE>pluginPathListPanel.add(scrollListPanel, BorderLayout.CENTER);<NEW_LINE>pluginPathListPanel.add(listButtonPanel, BorderLayout.EAST);<NEW_LINE>pluginPathListPanel.setBorder(new TitledBorder("User Plugin Paths"));<NEW_LINE>// set tooltips after adding all components to get around swing<NEW_LINE>// tooltip text problem where the text is obscured by a component<NEW_LINE>// added after tooltip has been added<NEW_LINE>//<NEW_LINE>upButton.setToolTipText("Changes the order of search for plugins");<NEW_LINE>downButton.setToolTipText("Changes the order of search for plugins");<NEW_LINE>pluginPathListPanel.validate();<NEW_LINE>return pluginPathListPanel;<NEW_LINE>} | new Dimension(250, 150)); |
892,815 | private PrintElement createBarcodeElement(MPrintFormatItem item, PrintData printData) {<NEW_LINE>// Get Data<NEW_LINE>Object obj = printData.getNode(new Integer(item.getAD_Column_ID()));<NEW_LINE>if (obj == null)<NEW_LINE>return null;<NEW_LINE>else if (obj instanceof PrintDataElement)<NEW_LINE>;<NEW_LINE>else {<NEW_LINE>log.log(Level.SEVERE, <MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Convert DataElement to String<NEW_LINE>PrintDataElement data = (PrintDataElement) obj;<NEW_LINE>if (data.isNull() && item.isSuppressNull())<NEW_LINE>return null;<NEW_LINE>String stringContent = data.getValueDisplay(m_format.getLanguage());<NEW_LINE>if ((stringContent == null || stringContent.length() == 0) && item.isSuppressNull())<NEW_LINE>return null;<NEW_LINE>// Add Support for QR Code<NEW_LINE>if (item.getBarcodeType() != null && MPrintFormatItem.BARCODETYPE_QuickResponseCode.equals(item.getBarcodeType())) {<NEW_LINE>QRCodeElement element = new QRCodeElement(stringContent, item);<NEW_LINE>return element;<NEW_LINE>} else {<NEW_LINE>BarcodeElement element = new BarcodeElement(stringContent, item);<NEW_LINE>if (element.isValid())<NEW_LINE>return element;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | "Element not PrintDataElement " + obj.getClass()); |
266,071 | public void onRequest(boolean https, String address, String hostname, ArrayList<String> headers) {<NEW_LINE>ArrayList<HttpCookie> cookies = RequestParser.getCookiesFromHeaders(headers);<NEW_LINE>// got any cookie ?<NEW_LINE>if (cookies != null && cookies.size() > 0) {<NEW_LINE>String domain = cookies.get(0).getDomain();<NEW_LINE>if (domain == null || domain.isEmpty()) {<NEW_LINE>domain = RequestParser.getBaseDomain(hostname);<NEW_LINE>for (HttpCookie cooky : cookies) cooky.setDomain(domain);<NEW_LINE>}<NEW_LINE>Session session = mAdapter.getSession(address, domain, https);<NEW_LINE>// new session ^^<NEW_LINE>if (session == null) {<NEW_LINE>session = new Session();<NEW_LINE>session.mHTTPS = https;<NEW_LINE>session.mAddress = address;<NEW_LINE>session.mDomain = domain;<NEW_LINE>session.mUserAgent = RequestParser.getHeaderValue("User-Agent", headers);<NEW_LINE>}<NEW_LINE>// update/initialize session cookies<NEW_LINE>for (HttpCookie cookie : cookies) {<NEW_LINE>session.mCookies.put(<MASK><NEW_LINE>}<NEW_LINE>final Session fsession = session;<NEW_LINE>Hijacker.this.runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>mAdapter.addSession(fsession);<NEW_LINE>mAdapter.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | cookie.getName(), cookie); |
1,151,134 | public static WorkerReportRequest buildWorkerReportRequest(Worker worker) {<NEW_LINE>WorkerReportRequest.Builder builder = WorkerReportRequest.newBuilder();<NEW_LINE>builder.<MASK><NEW_LINE>if (!worker.isWorkerInitFinished()) {<NEW_LINE>return builder.build();<NEW_LINE>}<NEW_LINE>Map<TaskId, Task> tasks = worker.getTaskManager().getRunningTask();<NEW_LINE>if (tasks != null && !tasks.isEmpty()) {<NEW_LINE>for (Entry<TaskId, Task> entry : tasks.entrySet()) {<NEW_LINE>builder.addTaskReports(buildTaskReport(entry.getKey(), entry.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Pair.Builder kvBuilder = Pair.newBuilder();<NEW_LINE>Map<String, String> props = worker.getMetrics();<NEW_LINE>for (Entry<String, String> kv : props.entrySet()) {<NEW_LINE>kvBuilder.setKey(kv.getKey());<NEW_LINE>kvBuilder.setValue(kv.getValue());<NEW_LINE>builder.addPairs(kvBuilder.build());<NEW_LINE>}<NEW_LINE>// add the PSAgentContext,need fix<NEW_LINE>props = PSAgentContext.get().getMetrics();<NEW_LINE>for (Entry<String, String> kv : props.entrySet()) {<NEW_LINE>kvBuilder.setKey(kv.getKey());<NEW_LINE>kvBuilder.setValue(kv.getValue());<NEW_LINE>builder.addPairs(kvBuilder.build());<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | setWorkerAttemptId(worker.getWorkerAttemptIdProto()); |
1,648,570 | public Object execute(VirtualFrame frame) {<NEW_LINE>JSDynamicObject functionObject = JSFrameUtil.getFunctionObject(frame);<NEW_LINE>JSDynamicObject promise = (JSDynamicObject) getPromise(functionObject);<NEW_LINE>Object resolution = resolutionNode.execute(frame);<NEW_LINE>AlreadyResolved alreadyResolved = (<MASK><NEW_LINE>if (alreadyResolvedProfile.profile(alreadyResolved.value)) {<NEW_LINE>context.notifyPromiseRejectionTracker(promise, JSPromise.REJECTION_TRACKER_OPERATION_RESOLVE_AFTER_RESOLVED, resolution);<NEW_LINE>return Undefined.instance;<NEW_LINE>}<NEW_LINE>alreadyResolved.value = true;<NEW_LINE>context.notifyPromiseHook(PromiseHook.TYPE_RESOLVE, promise);<NEW_LINE>if (resolution == promise) {<NEW_LINE>enterErrorBranch();<NEW_LINE>return rejectPromise(promise, Errors.createTypeError("self resolution!"));<NEW_LINE>}<NEW_LINE>if (!isObjectNode.executeBoolean(resolution)) {<NEW_LINE>return fulfillPromise(promise, resolution);<NEW_LINE>}<NEW_LINE>Object then;<NEW_LINE>try {<NEW_LINE>then = getThen(resolution);<NEW_LINE>} catch (AbstractTruffleException ex) {<NEW_LINE>enterErrorBranch();<NEW_LINE>return rejectPromise(promise, ex);<NEW_LINE>}<NEW_LINE>if (!isCallableNode.executeBoolean(then)) {<NEW_LINE>return fulfillPromise(promise, resolution);<NEW_LINE>}<NEW_LINE>JSFunctionObject job = promiseResolveThenableJob(promise, resolution, then);<NEW_LINE>context.promiseEnqueueJob(getRealm(), job);<NEW_LINE>return Undefined.instance;<NEW_LINE>} | AlreadyResolved) getAlreadyResolvedNode.getValue(functionObject); |
1,363,252 | public void init(List<Pair<Double, Integer>> dataScores) {<NEW_LINE>PriorityQueue<Pair<Integer, Pair<Double, Integer>>> q = new BinaryHeapPriorityQueue<>();<NEW_LINE>for (int i = 0; i < dataScores.size(); i++) {<NEW_LINE>q.add(new Pair<>(Integer.valueOf(i), dataScores.get(i)), -dataScores.get(i).first().doubleValue());<NEW_LINE>}<NEW_LINE>List<Pair<Integer, Pair<Double, Integer>>> sorted = q.toSortedList();<NEW_LINE>scores = new double[sorted.size()];<NEW_LINE>classes = new <MASK><NEW_LINE>logger.info("incoming size " + dataScores.size() + " resulting " + sorted.size());<NEW_LINE>for (int i = 0; i < sorted.size(); i++) {<NEW_LINE>Pair<Double, Integer> next = sorted.get(i).second();<NEW_LINE>scores[i] = next.first().doubleValue();<NEW_LINE>classes[i] = next.second().intValue();<NEW_LINE>}<NEW_LINE>init();<NEW_LINE>} | int[sorted.size()]; |
750,360 | public void updateShadowNodeProp(ReactShadowNode nodeToUpdate, Object value) {<NEW_LINE>try {<NEW_LINE>if (mIndex == null) {<NEW_LINE>SHADOW_ARGS[0] = getValueOrDefault(<MASK><NEW_LINE>mSetter.invoke(nodeToUpdate, SHADOW_ARGS);<NEW_LINE>Arrays.fill(SHADOW_ARGS, null);<NEW_LINE>} else {<NEW_LINE>SHADOW_GROUP_ARGS[0] = mIndex;<NEW_LINE>SHADOW_GROUP_ARGS[1] = getValueOrDefault(value, nodeToUpdate.getThemedContext());<NEW_LINE>mSetter.invoke(nodeToUpdate, SHADOW_GROUP_ARGS);<NEW_LINE>Arrays.fill(SHADOW_GROUP_ARGS, null);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>FLog.e(ViewManager.class, "Error while updating prop " + mPropName, t);<NEW_LINE>throw new JSApplicationIllegalArgumentException("Error while updating property '" + mPropName + "' in shadow node of type: " + nodeToUpdate.getViewClass(), t);<NEW_LINE>}<NEW_LINE>} | value, nodeToUpdate.getThemedContext()); |
1,713,281 | public synchronized void queryStarted(String id, OResultSet rs) {<NEW_LINE>if (this.activeQueries.size() > 1 && this.activeQueries.size() % 10 == 0) {<NEW_LINE>StringBuilder msg = new StringBuilder();<NEW_LINE>msg.append("This database instance has ");<NEW_LINE>msg.<MASK><NEW_LINE>msg.append(" open command/query result sets, please make sure you close them with OResultSet.close()");<NEW_LINE>OLogManager.instance().warn(this, msg.toString(), null);<NEW_LINE>if (OLogManager.instance().isDebugEnabled()) {<NEW_LINE>activeQueries.values().stream().map(pendingQuery -> pendingQuery.getExecutionPlan()).filter(plan -> plan != null).forEach(plan -> OLogManager.instance().debug(this, plan.toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.activeQueries.put(id, rs);<NEW_LINE>getListeners().forEach((it) -> it.onCommandStart(this, rs));<NEW_LINE>} | append(activeQueries.size()); |
1,515,754 | protected void selectBestRegionsFern(double totalP, double totalN) {<NEW_LINE>for (int i = 0; i < fernInfo.size; i++) {<NEW_LINE>TldRegionFernInfo <MASK><NEW_LINE>double probP = info.sumP / totalP;<NEW_LINE>double probN = info.sumN / totalN;<NEW_LINE>// only consider regions with a higher P likelihood<NEW_LINE>if (probP > probN) {<NEW_LINE>// reward regions with a large difference between the P and N values<NEW_LINE>storageMetric.add(-(probP - probN));<NEW_LINE>storageRect.add(info.r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Select the N regions with the highest fern probability<NEW_LINE>if (config.maximumCascadeConsider < storageMetric.size) {<NEW_LINE>int N = Math.min(config.maximumCascadeConsider, storageMetric.size);<NEW_LINE>storageIndexes.resize(storageMetric.size);<NEW_LINE>QuickSelect.selectIndex(storageMetric.data, N - 1, storageMetric.size, storageIndexes.data);<NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>fernRegions.add(storageRect.get(storageIndexes.get(i)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>fernRegions.addAll(storageRect);<NEW_LINE>}<NEW_LINE>} | info = fernInfo.get(i); |
1,071,683 | final DeleteCustomRoutingEndpointGroupResult executeDeleteCustomRoutingEndpointGroup(DeleteCustomRoutingEndpointGroupRequest deleteCustomRoutingEndpointGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteCustomRoutingEndpointGroupRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteCustomRoutingEndpointGroupRequest> request = null;<NEW_LINE>Response<DeleteCustomRoutingEndpointGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteCustomRoutingEndpointGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteCustomRoutingEndpointGroupRequest));<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, "Global Accelerator");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteCustomRoutingEndpointGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteCustomRoutingEndpointGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteCustomRoutingEndpointGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
917,115 | public final boolean apply(Context context, Object object) {<NEW_LINE>if (object == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (object instanceof Map) {<NEW_LINE>Object fieldValue = fieldName == null ? object : ((Map<?, ?><MASK><NEW_LINE>if (fieldValue == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (function != null) {<NEW_LINE>fieldValue = function.apply(fieldValue);<NEW_LINE>}<NEW_LINE>return apply(fieldValue);<NEW_LINE>}<NEW_LINE>ObjectWriter objectWriter = context.path.getWriterContext().getObjectWriter(object.getClass());<NEW_LINE>if (objectWriter instanceof ObjectWriterAdapter) {<NEW_LINE>FieldWriter fieldWriter = objectWriter.getFieldWriter(fieldNameNameHash);<NEW_LINE>Object fieldValue = fieldWriter.getFieldValue(object);<NEW_LINE>if (function != null) {<NEW_LINE>fieldValue = function.apply(fieldValue);<NEW_LINE>}<NEW_LINE>return apply(fieldValue);<NEW_LINE>}<NEW_LINE>if (function != null) {<NEW_LINE>Object fieldValue = function.apply(object);<NEW_LINE>return apply(fieldValue);<NEW_LINE>}<NEW_LINE>if (fieldName == null) {<NEW_LINE>return apply(object);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ) object).get(fieldName); |
1,069,448 | public com.amazonaws.services.detective.model.InternalServerException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.detective.model.InternalServerException internalServerException = new com.amazonaws.services.detective.model.InternalServerException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return internalServerException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,542,695 | private void tryFlushEvents(List<ComplexEventChunk> outputEventChunks, ComplexEvent event, RateLimiterState state) {<NEW_LINE>if (event.getTimestamp() >= state.scheduledTime) {<NEW_LINE>ComplexEventChunk<ComplexEvent> outputEventChunk = new ComplexEventChunk<>();<NEW_LINE>for (Iterator<Map.Entry<String, LastEventHolder>> iterator = state.groupByKeyEvents.entrySet().iterator(); iterator.hasNext(); ) {<NEW_LINE>Map.Entry<String, LastEventHolder> lastEventHolderEntry = iterator.next();<NEW_LINE>// clearing expired events after update<NEW_LINE>lastEventHolderEntry.getValue().checkAndClearLastInEvent();<NEW_LINE>if (lastEventHolderEntry.getValue().lastEvent == null) {<NEW_LINE>iterator.remove();<NEW_LINE>} else {<NEW_LINE>outputEventChunk.add(cloneComplexEvent(lastEventHolderEntry<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>outputEventChunks.add(outputEventChunk);<NEW_LINE>state.scheduledTime += value;<NEW_LINE>scheduler.notifyAt(state.scheduledTime);<NEW_LINE>}<NEW_LINE>} | .getValue().lastEvent)); |
688,632 | protected void consumeLambdaExpression() {<NEW_LINE>// LambdaExpression ::= LambdaHeader LambdaBody<NEW_LINE>this.nestedType--;<NEW_LINE>// pop length for LambdaBody (always 1)<NEW_LINE>this.astLengthPtr--;<NEW_LINE>Statement body = (Statement) this.astStack[this.astPtr--];<NEW_LINE>if (body instanceof Block) {<NEW_LINE>if (this.options.ignoreMethodBodies) {<NEW_LINE>Statement oldBody = body;<NEW_LINE>body = new Block(0);<NEW_LINE>body.sourceStart = oldBody.sourceStart;<NEW_LINE>body.sourceEnd = oldBody.sourceEnd;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LambdaExpression lexp = (LambdaExpression) this.astStack[this.astPtr--];<NEW_LINE>this.astLengthPtr--;<NEW_LINE>lexp.setBody(body);<NEW_LINE>lexp.sourceEnd = body.sourceEnd;<NEW_LINE>if (body instanceof Expression) {<NEW_LINE>Expression expression = (Expression) body;<NEW_LINE>expression.statementEnd = body.sourceEnd;<NEW_LINE>}<NEW_LINE>if (!this.parsingJava8Plus) {<NEW_LINE>problemReporter().lambdaExpressionsNotBelow18(lexp);<NEW_LINE>}<NEW_LINE>pushOnExpressionStack(lexp);<NEW_LINE>if (this.currentElement != null) {<NEW_LINE>this<MASK><NEW_LINE>this.currentElement.lambdaNestLevel--;<NEW_LINE>}<NEW_LINE>this.referenceContext.compilationResult().hasFunctionalTypes = true;<NEW_LINE>markEnclosingMemberWithLocalOrFunctionalType(LocalTypeKind.LAMBDA);<NEW_LINE>if (lexp.compilationResult.getCompilationUnit() == null) {<NEW_LINE>// unit built out of model. Stash a textual representation of lambda to enable LE.copy().<NEW_LINE>int length = lexp.sourceEnd - lexp.sourceStart + 1;<NEW_LINE>System.arraycopy(this.scanner.getSource(), lexp.sourceStart, lexp.text = new char[length], 0, length);<NEW_LINE>}<NEW_LINE>} | .lastCheckPoint = body.sourceEnd + 1; |
977,373 | public void applyProperties(Object arg) {<NEW_LINE>if (!(arg instanceof HashMap)) {<NEW_LINE>Log.w(TAG, "Cannot apply properties: invalid type for properties", Log.DEBUG_MODE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HashMap props = (HashMap) arg;<NEW_LINE>if (modelListener == null) {<NEW_LINE>for (Object name : props.keySet()) {<NEW_LINE>setProperty(TiConvert.toString(name), props.get(name));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (TiApplication.isUIThread()) {<NEW_LINE>for (Object key : props.keySet()) {<NEW_LINE>String name = TiConvert.toString(key);<NEW_LINE>Object <MASK><NEW_LINE>Object current = getProperty(name);<NEW_LINE>setProperty(name, value);<NEW_LINE>if (shouldFireChange(current, value)) {<NEW_LINE>modelListener.propertyChanged(name, current, value, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>KrollPropertyChangeSet changes = new KrollPropertyChangeSet(props.size());<NEW_LINE>for (Object key : props.keySet()) {<NEW_LINE>String name = TiConvert.toString(key);<NEW_LINE>Object value = props.get(key);<NEW_LINE>Object current = getProperty(name);<NEW_LINE>setProperty(name, value);<NEW_LINE>if (shouldFireChange(current, value)) {<NEW_LINE>changes.addChange(name, current, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changes.entryCount > 0) {<NEW_LINE>getMainHandler().obtainMessage(MSG_MODEL_PROPERTY_CHANGE, changes).sendToTarget();<NEW_LINE>}<NEW_LINE>} | value = props.get(key); |
100,421 | public Response generateInstallation(KeycloakSession session, RealmModel realm, ClientModel client, URI baseUri) {<NEW_LINE>ClientManager.InstallationAdapterConfig rep = new ClientManager.InstallationAdapterConfig();<NEW_LINE>rep.setAuthServerUrl(baseUri.toString());<NEW_LINE>rep.setRealm(realm.getName());<NEW_LINE>rep.setSslRequired(realm.getSslRequired().name().toLowerCase());<NEW_LINE>if (client.isPublicClient() && !client.isBearerOnly())<NEW_LINE>rep.setPublicClient(true);<NEW_LINE>if (client.isBearerOnly())<NEW_LINE>rep.setBearerOnly(true);<NEW_LINE>if (client.getRolesStream().count() > 0)<NEW_LINE>rep.setUseResourceRoleMappings(true);<NEW_LINE>rep.setResource(client.getClientId());<NEW_LINE>if (showClientCredentialsAdapterConfig(client)) {<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>rep.setCredentials(adapterConfig);<NEW_LINE>}<NEW_LINE>if (showVerifyTokenAudience(client)) {<NEW_LINE>rep.setVerifyTokenAudience(true);<NEW_LINE>}<NEW_LINE>configureAuthorizationSettings(session, client, rep);<NEW_LINE>String json = null;<NEW_LINE>try {<NEW_LINE>json = JsonSerialization.writeValueAsPrettyString(rep);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>return Response.ok(json, MediaType.TEXT_PLAIN_TYPE).build();<NEW_LINE>} | adapterConfig = getClientCredentialsAdapterConfig(session, client); |
301,649 | public static List<IndexItem> listLocalRecordedVoiceIndexes(OsmandApplication app) {<NEW_LINE>File voiceDirPath = <MASK><NEW_LINE>LocalIndexHelper localIndexHelper = new LocalIndexHelper(app);<NEW_LINE>List<LocalIndexInfo> localIndexes = new ArrayList<>();<NEW_LINE>List<IndexItem> recordedVoiceList = new ArrayList<>();<NEW_LINE>localIndexHelper.loadVoiceData(voiceDirPath, localIndexes, false, true, true, app.getResourceManager().getIndexFiles(), null);<NEW_LINE>for (LocalIndexInfo indexInfo : localIndexes) {<NEW_LINE>if (indexInfo.getType() != LocalIndexType.VOICE_DATA || indexInfo.getFileName().contains("tts")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String recordedZipName = indexInfo.getFileName() + "_0" + IndexConstants.VOICE_INDEX_EXT_ZIP;<NEW_LINE>String ttsFileName = indexInfo.getFileName() + "_" + IndexConstants.TTSVOICE_INDEX_EXT_JS;<NEW_LINE>File ttsFile = new File(voiceDirPath, indexInfo.getFileName() + "/" + ttsFileName);<NEW_LINE>long installDate = ttsFile.lastModified();<NEW_LINE>IndexItem localRecordedVoiceIndex = new IndexItem(recordedZipName, "", installDate, "", 0, 0, DownloadActivityType.VOICE_FILE);<NEW_LINE>localRecordedVoiceIndex.setDownloaded(true);<NEW_LINE>recordedVoiceList.add(localRecordedVoiceIndex);<NEW_LINE>}<NEW_LINE>return recordedVoiceList;<NEW_LINE>} | app.getAppPath(IndexConstants.VOICE_INDEX_DIR); |
304,195 | final GetCSVHeaderResult executeGetCSVHeader(GetCSVHeaderRequest getCSVHeaderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCSVHeaderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetCSVHeaderRequest> request = null;<NEW_LINE>Response<GetCSVHeaderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCSVHeaderRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getCSVHeaderRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCSVHeader");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetCSVHeaderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetCSVHeaderResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,438,331 | public AnalyticsModelingOMASAPIResponse createArtifact(String serverName, String userId, String serverCapability, String serverCapabilityGUID, AnalyticsAsset artifact) {<NEW_LINE>String methodName = "createArtifact";<NEW_LINE>AnalyticsModelingOMASAPIResponse ret;<NEW_LINE>RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);<NEW_LINE>try {<NEW_LINE>validateUrlParameters(serverName, userId, null, <MASK><NEW_LINE>AssetsResponse response = new AssetsResponse();<NEW_LINE>AnalyticsArtifactHandler handler = getHandler().getAnalyticsArtifactHandler(serverName, userId, methodName);<NEW_LINE>ResponseContainerAssets assets = handler.createAssets(userId, serverCapability, serverCapabilityGUID, artifact);<NEW_LINE>response.setAssetList(assets);<NEW_LINE>response.setMeta(handler.getMessages());<NEW_LINE>ret = response;<NEW_LINE>} catch (Exception e) {<NEW_LINE>ret = handleErrorResponse(e, methodName);<NEW_LINE>}<NEW_LINE>restCallLogger.logRESTCallReturn(token, ret.toString());<NEW_LINE>return ret;<NEW_LINE>} | null, null, null, methodName); |
895,926 | /* (non-Javadoc)<NEW_LINE>* @see com.ibm.ws.sib.processor.impl.interfaces.UpstreamControl#sendNackMessage(com.ibm.ws.sib.trm.topology.Cellule, long, long, boolean, int, com.ibm.websphere.sib.Reliability, com.ibm.ws.sib.utils.SIBUuid12)<NEW_LINE>*/<NEW_LINE>public void sendNackMessage(SIBUuid8 meUuid, SIBUuid12 destUuid, SIBUuid8 busUuid, long startTick, long endTick, int priority, Reliability reliability, SIBUuid12 streamID) throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "sendNackMessage", new Object[] { meUuid, new Long(startTick), new Long(endTick), new Integer(priority), reliability, streamID });<NEW_LINE>ControlNack newNackMsg = createControlNackMessage(priority, reliability, streamID);<NEW_LINE>newNackMsg.setStartTick(startTick);<NEW_LINE>newNackMsg.setEndTick(endTick);<NEW_LINE>try {<NEW_LINE>_parentInputHandler.handleControlMessage(null, newNackMsg);<NEW_LINE>} catch (SIException e) {<NEW_LINE>// FFDC<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.sib.processor.impl.PubSubOutputHandler.sendNackMessage", "1:1639:1.164.1.5", this);<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>SibTr.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "sendNackMessage");<NEW_LINE>} | exit(tc, "sendNackMessage", e); |
1,583,277 | protected static GenericObjectPool<Engine> newPoolInstance() {<NEW_LINE>if (grobidEnginePool == null) {<NEW_LINE>// initialize grobidEnginePool<NEW_LINE>LOGGER.debug("synchronized newPoolInstance");<NEW_LINE>synchronized (grobidEnginePoolControl) {<NEW_LINE>if (grobidEnginePool == null) {<NEW_LINE>grobidEnginePool = new GenericObjectPool<>(GrobidPoolingFactory.newInstance());<NEW_LINE>// grobidEnginePool.setFactory(GrobidPoolingFactory.newInstance());<NEW_LINE>grobidEnginePool.setWhenExhaustedAction(GenericObjectPool.WHEN_EXHAUSTED_BLOCK);<NEW_LINE>grobidEnginePool.setMaxWait(GrobidProperties.getPoolMaxWait());<NEW_LINE>grobidEnginePool.<MASK><NEW_LINE>grobidEnginePool.setTestWhileIdle(false);<NEW_LINE>grobidEnginePool.setLifo(false);<NEW_LINE>grobidEnginePool.setTimeBetweenEvictionRunsMillis(2000);<NEW_LINE>grobidEnginePool.setMaxIdle(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return grobidEnginePool;<NEW_LINE>} | setMaxActive(GrobidProperties.getMaxConcurrency()); |
405,750 | private IntermediateRepresentation readIntermediateRep(final InputStream inputStream) throws IOException {<NEW_LINE>final Map<String, ImmutableByteArray> exRefs = new HashMap<>();<NEW_LINE>final List<SerializedValue> serializedValues = new ArrayList<>();<NEW_LINE>final List<SerializedMetaValue> serializedMetaValues = new ArrayList<>();<NEW_LINE>MetaData metaData = null;<NEW_LINE>final ZipInputStream zipInputStream = new ZipInputStream(inputStream);<NEW_LINE>ZipEntry zipEntry;<NEW_LINE>while ((zipEntry = zipInputStream.getNextEntry()) != null) {<NEW_LINE>if (SETTINGS_FILENAME.equals(zipEntry.getName())) {<NEW_LINE>final String stringData = JavaHelper.copyToString(zipInputStream, PwmConstants.DEFAULT_CHARSET);<NEW_LINE>final List<SerializedValue> readComponents = JsonFactory.get().deserializeList(stringData, SerializedValue.class);<NEW_LINE>serializedValues.addAll(readComponents);<NEW_LINE>} else if (META_VALUES_FILENAME.equals(zipEntry.getName())) {<NEW_LINE>final String stringData = JavaHelper.copyToString(zipInputStream, PwmConstants.DEFAULT_CHARSET);<NEW_LINE>final List<SerializedMetaValue> readMetaValues = JsonFactory.get().<MASK><NEW_LINE>serializedMetaValues.addAll(readMetaValues);<NEW_LINE>} else if (META_FILENAME.equals(zipEntry.getName())) {<NEW_LINE>final String stringData = JavaHelper.copyToString(zipInputStream, PwmConstants.DEFAULT_CHARSET);<NEW_LINE>metaData = JsonFactory.get().deserialize(stringData, MetaData.class);<NEW_LINE>} else if (zipEntry.getName().endsWith(XREF_SUFFIX)) {<NEW_LINE>final String hash = zipEntry.getName().substring(0, zipEntry.getName().length() - XREF_SUFFIX.length());<NEW_LINE>final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();<NEW_LINE>JavaHelper.copy(inputStream, byteArrayOutputStream);<NEW_LINE>final byte[] contents = byteArrayOutputStream.toByteArray();<NEW_LINE>exRefs.put(hash, ImmutableByteArray.of(contents));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new IntermediateRepresentation(serializedValues, serializedMetaValues, exRefs, metaData);<NEW_LINE>} | deserializeList(stringData, SerializedMetaValue.class); |
676,313 | public static List<ZabbixConfig> loadConfigs(String path, List<String> fileNames) throws ModuleStartException {<NEW_LINE>if (CollectionUtils.isEmpty(fileNames)) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>File[] configs;<NEW_LINE>try {<NEW_LINE>configs = ResourceUtils.getPathFiles(path);<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>throw new ModuleStartException("Load zabbix configs failed", e);<NEW_LINE>}<NEW_LINE>return Arrays.stream(configs).filter(File::isFile).map(f -> {<NEW_LINE>String fileName = f.getName();<NEW_LINE>int dotIndex = fileName.lastIndexOf('.');<NEW_LINE>fileName = (dotIndex == -1) ? fileName : fileName.substring(0, dotIndex);<NEW_LINE>if (!fileNames.contains(fileName)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try (Reader r = new FileReader(f)) {<NEW_LINE>return new Yaml().loadAs(r, ZabbixConfig.class);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}).filter(Objects::nonNull).collect(Collectors.toList());<NEW_LINE>} | warn("Reading file {} failed", f, e); |
1,481,389 | public AnnotationDeclarationNode transform(AnnotationDeclarationNode annotationDeclarationNode) {<NEW_LINE>MetadataNode metadata = modifyNode(annotationDeclarationNode.metadata().orElse(null));<NEW_LINE>Token visibilityQualifier = modifyToken(annotationDeclarationNode.visibilityQualifier<MASK><NEW_LINE>Token constKeyword = modifyToken(annotationDeclarationNode.constKeyword().orElse(null));<NEW_LINE>Token annotationKeyword = modifyToken(annotationDeclarationNode.annotationKeyword());<NEW_LINE>Node typeDescriptor = modifyNode(annotationDeclarationNode.typeDescriptor().orElse(null));<NEW_LINE>Token annotationTag = modifyToken(annotationDeclarationNode.annotationTag());<NEW_LINE>Token onKeyword = modifyToken(annotationDeclarationNode.onKeyword().orElse(null));<NEW_LINE>SeparatedNodeList<Node> attachPoints = modifySeparatedNodeList(annotationDeclarationNode.attachPoints());<NEW_LINE>Token semicolonToken = modifyToken(annotationDeclarationNode.semicolonToken());<NEW_LINE>return annotationDeclarationNode.modify(metadata, visibilityQualifier, constKeyword, annotationKeyword, typeDescriptor, annotationTag, onKeyword, attachPoints, semicolonToken);<NEW_LINE>} | ().orElse(null)); |
1,724,452 | public void draw(Canvas canvas) {<NEW_LINE>super.draw(canvas);<NEW_LINE>// Do not draw any bars while we're capturing a screenshot.<NEW_LINE>if (capturing) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int width = getMeasuredWidth();<NEW_LINE>int height = getMeasuredHeight();<NEW_LINE>if (progressFraction > 0) {<NEW_LINE>// Top (left to right).<NEW_LINE>canvas.drawLine(0, halfStrokeWidth, <MASK><NEW_LINE>// Right (top to bottom).<NEW_LINE>canvas.drawLine(width - halfStrokeWidth, 0, width - halfStrokeWidth, height * progressFraction, progressPaint);<NEW_LINE>// Bottom (right to left).<NEW_LINE>canvas.drawLine(width, height - halfStrokeWidth, width - (width * progressFraction), height - halfStrokeWidth, progressPaint);<NEW_LINE>// Left (bottom to top).<NEW_LINE>canvas.drawLine(halfStrokeWidth, height, halfStrokeWidth, height - (height * progressFraction), progressPaint);<NEW_LINE>}<NEW_LINE>if (doneFraction < 1) {<NEW_LINE>// Top (left to right).<NEW_LINE>canvas.drawLine(width * doneFraction, halfStrokeWidth, width, halfStrokeWidth, progressPaint);<NEW_LINE>// Right (top to bottom).<NEW_LINE>canvas.drawLine(width - halfStrokeWidth, height * doneFraction, width - halfStrokeWidth, height, progressPaint);<NEW_LINE>// Bottom (right to left).<NEW_LINE>canvas.drawLine(width - (width * doneFraction), height - halfStrokeWidth, 0, height - halfStrokeWidth, progressPaint);<NEW_LINE>// Left (bottom to top).<NEW_LINE>canvas.drawLine(halfStrokeWidth, height - (height * doneFraction), halfStrokeWidth, 0, progressPaint);<NEW_LINE>}<NEW_LINE>} | width * progressFraction, halfStrokeWidth, progressPaint); |
1,420,066 | public static void loadLibraryFromJar(String path) throws Exception {<NEW_LINE>com.google.common.base.Preconditions.checkArgument(path.startsWith("/"), "absolute path must start with /");<NEW_LINE>String[] parts = path.split("/");<NEW_LINE>String filename = (parts.length > 0) ? parts[parts.length - 1] : null;<NEW_LINE>File dir = File.createTempFile("native", "");<NEW_LINE>if (!(dir.mkdir())) {<NEW_LINE>throw new IOException("Failed to create temp directory " + dir.getAbsolutePath());<NEW_LINE>}<NEW_LINE>dir.deleteOnExit();<NEW_LINE>File temp = new File(dir, filename);<NEW_LINE>temp.deleteOnExit();<NEW_LINE>byte[] buffer = new byte[1024];<NEW_LINE>int read;<NEW_LINE>try (InputStream input = <MASK><NEW_LINE>OutputStream out = new FileOutputStream(temp)) {<NEW_LINE>if (input == null) {<NEW_LINE>throw new FileNotFoundException("Couldn't find file into jar " + path);<NEW_LINE>}<NEW_LINE>while ((read = input.read(buffer)) != -1) {<NEW_LINE>out.write(buffer, 0, read);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!temp.exists()) {<NEW_LINE>throw new FileNotFoundException("Failed to copy file from jar at " + temp.getAbsolutePath());<NEW_LINE>}<NEW_LINE>System.load(temp.getAbsolutePath());<NEW_LINE>} | NativeUtils.class.getResourceAsStream(path); |
241,009 | ParsingStage doParse() {<NEW_LINE>int i = beginIdx;<NEW_LINE>for (; i < connectionUri.length(); i++) {<NEW_LINE>char c = connectionUri.charAt(i);<NEW_LINE>if (c == '/' || c == '?') {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (beginIdx == i) {<NEW_LINE>throw new VertxException("Empty server mode", true);<NEW_LINE>}<NEW_LINE>io.vertx.oracleclient.ServerMode mode = of(decodeUrl(connectionUri.substring(beginIdx, i)));<NEW_LINE>if (mode == null) {<NEW_LINE>throw new VertxException("Invalid server mode", true);<NEW_LINE>}<NEW_LINE>configuration.put("serverMode", mode.toString());<NEW_LINE>if (i == connectionUri.length()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>char c = connectionUri.charAt(i);<NEW_LINE>if (c == '/') {<NEW_LINE>return new InstanceName(connectionUri, i + 1, configuration);<NEW_LINE>}<NEW_LINE>if (c == '?') {<NEW_LINE>return new ConnectionProps(<MASK><NEW_LINE>}<NEW_LINE>throw new IllegalStateException();<NEW_LINE>} | connectionUri, i + 1, configuration); |
735,723 | public void testRetryCountWrap_3(PrintWriter out, Long id) throws Exception {<NEW_LINE>// Wait for our task to start running<NEW_LINE>for (long start = System.nanoTime(); ((RetryCallable.getCallCount(id) < 5) && (System.nanoTime() - start < TIMEOUT_NS)); Thread.sleep(POLL_INTERVAL)) ;<NEW_LINE>if (RetryCallable.getCallCount(id) < 5) {<NEW_LINE>throw new Exception("Our task did not run. ID=" + id);<NEW_LINE>}<NEW_LINE>// Go get the status of our task.<NEW_LINE>TaskStatus<Void> status = scheduler.getStatus(id);<NEW_LINE>if (status == null) {<NEW_LINE>throw new Exception("Could not retrieve status for our task id " + id);<NEW_LINE>}<NEW_LINE>// Make sure we're not done somehow.<NEW_LINE>if (status.getNextExecutionTime() == null)<NEW_LINE>throw new Exception("Task should not have completed. " + status);<NEW_LINE>// Check on the retry count. After 5 intervals we should have reached the max<NEW_LINE>// value.<NEW_LINE>Context ic = new javax.naming.InitialContext();<NEW_LINE>DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/db");<NEW_LINE><MASK><NEW_LINE>c.setAutoCommit(true);<NEW_LINE>String query = new String("SELECT RFAILS FROM APP.SCHDTASK WHERE ID=" + id.toString());<NEW_LINE>System.out.println("Running SQL: " + query);<NEW_LINE>Statement s = c.createStatement();<NEW_LINE>boolean sqlResult = s.execute(query);<NEW_LINE>if (sqlResult == false) {<NEW_LINE>throw new Exception("Could not retrieve failure count from database.");<NEW_LINE>}<NEW_LINE>ResultSet rs = s.getResultSet();<NEW_LINE>rs.next();<NEW_LINE>short retryCount = rs.getShort(1);<NEW_LINE>rs.close();<NEW_LINE>s.close();<NEW_LINE>c.close();<NEW_LINE>if (retryCount != Short.MAX_VALUE) {<NEW_LINE>throw new Exception("Retry count for task " + id + " should have been " + Short.MAX_VALUE + ", but it was " + retryCount);<NEW_LINE>}<NEW_LINE>// Go be nice and cancel our task.<NEW_LINE>scheduler.remove(id);<NEW_LINE>} | Connection c = ds.getConnection(); |
453,304 | protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException {<NEW_LINE>// TODO: add support for other types.<NEW_LINE>if (wrappedKeyType != Cipher.SECRET_KEY) {<NEW_LINE>throw new InvalidKeyException("only SECRET_KEY supported");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>CMCEKEMExtractor kemExt = new CMCEKEMExtractor(unwrapKey.getKeyParams());<NEW_LINE>byte[] secret = kemExt.extractSecret(Arrays.copyOfRange(wrappedKey, 0, kemExt.getInputSize()));<NEW_LINE>Wrapper kWrap = WrapUtil.getWrapper(kemParameterSpec.getKeyAlgorithmName());<NEW_LINE><MASK><NEW_LINE>Arrays.clear(secret);<NEW_LINE>kWrap.init(false, keyParameter);<NEW_LINE>byte[] keyEncBytes = Arrays.copyOfRange(wrappedKey, kemExt.getInputSize(), wrappedKey.length);<NEW_LINE>SecretKey rv = new SecretKeySpec(kWrap.unwrap(keyEncBytes, 0, keyEncBytes.length), wrappedKeyAlgorithm);<NEW_LINE>Arrays.clear(keyParameter.getKey());<NEW_LINE>return rv;<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new NoSuchAlgorithmException("unable to extract KTS secret: " + e.getMessage());<NEW_LINE>} catch (InvalidCipherTextException e) {<NEW_LINE>throw new InvalidKeyException("unable to extract KTS secret: " + e.getMessage());<NEW_LINE>}<NEW_LINE>} | KeyParameter keyParameter = new KeyParameter(secret); |
1,108,775 | public void deserialize(DataInputStream input) throws IOException {<NEW_LINE>int featsFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (featsFlag > 0) {<NEW_LINE>feats = (IntFloatVector) StreamSerdeUtils.deserializeVector(input);<NEW_LINE>}<NEW_LINE>int neighborsFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (neighborsFlag > 0) {<NEW_LINE>neighbors = StreamSerdeUtils.deserializeLongs(input);<NEW_LINE>}<NEW_LINE>int typesFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (typesFlag > 0) {<NEW_LINE>types = StreamSerdeUtils.deserializeInts(input);<NEW_LINE>}<NEW_LINE>int edgeTypesFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (edgeTypesFlag > 0) {<NEW_LINE>edgeTypes = StreamSerdeUtils.deserializeInts(input);<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (edgeFeaturesFlag > 0) {<NEW_LINE>int len = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>edgeFeatures = new IntFloatVector[len];<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>edgeFeatures[i] = (IntFloatVector) StreamSerdeUtils.deserializeVector(input);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int weightsFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (weightsFlag > 0) {<NEW_LINE>weights = StreamSerdeUtils.deserializeFloats(input);<NEW_LINE>}<NEW_LINE>int labelsFlag = StreamSerdeUtils.deserializeInt(input);<NEW_LINE>if (labelsFlag > 0) {<NEW_LINE>weights = StreamSerdeUtils.deserializeFloats(input);<NEW_LINE>}<NEW_LINE>} | edgeFeaturesFlag = StreamSerdeUtils.deserializeInt(input); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.