idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,352,626 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0".split(",");<NEW_LINE>String epl = "@name('s0') select nth(intPrimitive, 1, filter:theString like 'A%') as c0 from SupportBean";<NEW_LINE>env.compileDeploy<MASK><NEW_LINE>sendEventAssert(env, "X1", 0, fields, new Object[] { null });<NEW_LINE>sendEventAssert(env, "X2", 0, fields, new Object[] { null });<NEW_LINE>env.milestone(0);<NEW_LINE>sendEventAssert(env, "A3", 1, fields, new Object[] { null });<NEW_LINE>sendEventAssert(env, "A4", 2, fields, new Object[] { 1 });<NEW_LINE>env.milestone(1);<NEW_LINE>sendEventAssert(env, "X3", 0, fields, new Object[] { 1 });<NEW_LINE>sendEventAssert(env, "A5", 3, fields, new Object[] { 2 });<NEW_LINE>env.milestone(2);<NEW_LINE>sendEventAssert(env, "X4", 0, fields, new Object[] { 2 });<NEW_LINE>env.undeployAll();<NEW_LINE>} | (epl).addListener("s0"); |
435,855 | final DescribeJournalS3ExportResult executeDescribeJournalS3Export(DescribeJournalS3ExportRequest describeJournalS3ExportRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeJournalS3ExportRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeJournalS3ExportRequest> request = null;<NEW_LINE>Response<DescribeJournalS3ExportResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeJournalS3ExportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeJournalS3ExportRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeJournalS3Export");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeJournalS3ExportResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeJournalS3ExportResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "QLDB"); |
421,374 | public static GuiButtonBoolean buildColorButton(GuiButtonBoolean[] buttons, int posX, int posY, boolean active, DyeColor color, Consumer<GuiButtonBoolean> onClick) {<NEW_LINE>return new GuiButtonBoolean(posX, posY, 12, 12, "", active, TEXTURE, 194, 0, 1, btn -> {<NEW_LINE>if (btn.getNextState())<NEW_LINE>onClick<MASK><NEW_LINE>for (int j = 0; j < buttons.length; j++) if (j != color.ordinal())<NEW_LINE>buttons[j].setStateByInt(0);<NEW_LINE>}) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected boolean isValidClickButton(int button) {<NEW_LINE>return button == 0 && !getState();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void render(PoseStack transform, int mouseX, int mouseY, float partialTicks) {<NEW_LINE>super.render(transform, mouseX, mouseY, partialTicks);<NEW_LINE>if (this.visible) {<NEW_LINE>int col = color.getColorValue();<NEW_LINE>if (!getState())<NEW_LINE>col = ClientUtils.getDarkenedTextColour(col);<NEW_LINE>col = 0xff000000 | col;<NEW_LINE>this.fillGradient(transform, x + 3, y + 3, x + 9, y + 9, col, col);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | .accept((GuiButtonBoolean) btn); |
1,532,863 | private void initializeFF4J(ServletConfig servletConfig) {<NEW_LINE>String className = servletConfig.getInitParameter(SERVLETPARAM_FF4JPROVIDER);<NEW_LINE>try {<NEW_LINE>Class<?> c = Class.forName(className);<NEW_LINE>Method <MASK><NEW_LINE>Object o = method.invoke(null);<NEW_LINE>ff4jProvider = (FF4jProvider) o;<NEW_LINE>LOGGER.info("ff4j context has been successfully initialized - {} feature(s)", ff4jProvider.getFF4j().getFeatures().size());<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new IllegalArgumentException("Cannot load ff4jProvider as " + ff4jProvider, e);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new IllegalArgumentException("No static method getInstance in " + ff4jProvider, e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throw new IllegalArgumentException("Failed to invoke getInstance in " + ff4jProvider, e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new IllegalArgumentException("No public constructor for " + ff4jProvider + " as ff4jProvider", e);<NEW_LINE>} catch (ClassCastException ce) {<NEW_LINE>throw new IllegalArgumentException("ff4jProvider expected instance of " + FF4jProvider.class, ce);<NEW_LINE>}<NEW_LINE>ff4j = ff4jProvider.getFF4j();<NEW_LINE>servletConfig.getServletContext().setAttribute(FF4J_SESSIONATTRIBUTE_NAME, ff4j);<NEW_LINE>LOGGER.debug("Servlet has been initialized and ff4j store in session with {} ", ff4j.getFeatures().size());<NEW_LINE>String cssFile = servletConfig.getInitParameter(SERVLETPARAM_CSS);<NEW_LINE>if (cssFile != null) {<NEW_LINE>LOGGER.debug("A custom CSS has been defined [" + cssFile + "]");<NEW_LINE>servletConfig.getServletContext().setAttribute(CSS_SESSIONATTRIBUTE_NAME, cssFile);<NEW_LINE>}<NEW_LINE>} | method = c.getMethod("getInstance"); |
52,576 | public SummaryField mergeWith(SummaryField merge) {<NEW_LINE>if (merge == null)<NEW_LINE>return this;<NEW_LINE>if (this.isImplicit())<NEW_LINE>return merge;<NEW_LINE>if (merge.isImplicit())<NEW_LINE>return this;<NEW_LINE>if (!merge.getName().equals(getName()))<NEW_LINE>throw new IllegalArgumentException(merge + " conflicts with " + this + ": different names");<NEW_LINE>if (merge.getTransform() != getTransform())<NEW_LINE>throw new IllegalArgumentException(merge + " conflicts with " + this + ": different transforms");<NEW_LINE>if (!merge.getDataType().equals(getDataType()))<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>setImplicit(false);<NEW_LINE>if (isHeadOf(this.sourceIterator(), merge.sourceIterator())) {<NEW_LINE>// Ok<NEW_LINE>} else if (isHeadOf(merge.sourceIterator(), this.sourceIterator())) {<NEW_LINE>sources = new LinkedHashSet<>(merge.sources);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(merge + " conflicts with " + this + ": on source list must be the start of the other");<NEW_LINE>}<NEW_LINE>destinations.addAll(merge.destinations);<NEW_LINE>return this;<NEW_LINE>} | merge + " conflicts with " + this + ": different types"); |
711,181 | void processList(OrderedCompositeSpec spec, List<Object> inputList, WalkedPath walkedPath, Map<String, Object> output, Map<String, Object> context) {<NEW_LINE>Integer originalSize = walkedPath.lastElement()<MASK><NEW_LINE>for (int index = 0; index < inputList.size(); index++) {<NEW_LINE>Object subInput = inputList.get(index);<NEW_LINE>String subKeyStr = Integer.toString(index);<NEW_LINE>Optional<Object> subInputOptional;<NEW_LINE>if (subInput == null && originalSize != null && index >= originalSize) {<NEW_LINE>subInputOptional = Optional.empty();<NEW_LINE>} else {<NEW_LINE>subInputOptional = Optional.of(subInput);<NEW_LINE>}<NEW_LINE>applyKeyToComputed(spec.getComputedChildren(), walkedPath, output, subKeyStr, subInputOptional, context);<NEW_LINE>}<NEW_LINE>} | .getOrigSize().get(); |
531,397 | public void delete(Iterable<AllValueTypesTestRow> rows) {<NEW_LINE>List<byte[]> rowBytes = Persistables.persistAll(rows);<NEW_LINE>Set<Cell> cells = Sets.newHashSetWithExpectedSize(rowBytes.size() * 11);<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c0")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c1")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c10")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c2")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c3")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c4")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c5")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c6")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c7")));<NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, <MASK><NEW_LINE>cells.addAll(Cells.cellsWithConstantColumn(rowBytes, PtBytes.toCachedBytes("c9")));<NEW_LINE>t.delete(tableRef, cells);<NEW_LINE>} | PtBytes.toCachedBytes("c8"))); |
160,052 | public ColumnVector upperBound(Table valueTable, OrderByArg... args) {<NEW_LINE>boolean[] areNullsSmallest = new boolean[args.length];<NEW_LINE>boolean[] descFlags <MASK><NEW_LINE>ColumnVector[] inputColumns = new ColumnVector[args.length];<NEW_LINE>ColumnVector[] searchColumns = new ColumnVector[args.length];<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>areNullsSmallest[i] = args[i].isNullSmallest;<NEW_LINE>descFlags[i] = args[i].isDescending;<NEW_LINE>inputColumns[i] = columns[args[i].index];<NEW_LINE>searchColumns[i] = valueTable.columns[args[i].index];<NEW_LINE>}<NEW_LINE>try (Table input = new Table(inputColumns);<NEW_LINE>Table search = new Table(searchColumns)) {<NEW_LINE>return input.upperBound(areNullsSmallest, search, descFlags);<NEW_LINE>}<NEW_LINE>} | = new boolean[args.length]; |
387,070 | public ConstraintProperties addToHorizontalChain(int leftId, int rightId) {<NEW_LINE>connect(LEFT, leftId, (leftId == PARENT_ID) ? LEFT : RIGHT, 0);<NEW_LINE>connect(RIGHT, rightId, (rightId == PARENT_ID) ? RIGHT : LEFT, 0);<NEW_LINE>if (leftId != PARENT_ID) {<NEW_LINE>View leftView = ((ViewGroup) (mView.getParent())).findViewById(leftId);<NEW_LINE>ConstraintProperties leftProp = new ConstraintProperties(leftView);<NEW_LINE>leftProp.connect(RIGHT, mView.getId(), LEFT, 0);<NEW_LINE>}<NEW_LINE>if (rightId != PARENT_ID) {<NEW_LINE>View rightView = ((ViewGroup) (mView.getParent())).findViewById(rightId);<NEW_LINE>ConstraintProperties rightProp = new ConstraintProperties(rightView);<NEW_LINE>rightProp.connect(LEFT, mView.<MASK><NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | getId(), RIGHT, 0); |
524,636 | static Color[] topo(int n, float alpha) {<NEW_LINE>int j = n / 3;<NEW_LINE>int k = n / 3;<NEW_LINE>int i = n - j - k;<NEW_LINE>Color[] palette = new Color[n];<NEW_LINE>float h = 43 / 60.0f;<NEW_LINE>float hw = (31 / 60.0f - h) / (i - 1);<NEW_LINE>int l = 0;<NEW_LINE>for (; l < i; l++) {<NEW_LINE>palette[l] = hsv(h, 1.0f, 1.0f, alpha);<NEW_LINE>h += hw;<NEW_LINE>}<NEW_LINE>h = 23 / 60.0f;<NEW_LINE>hw = (11 / 60.0f - h) / (j - 1);<NEW_LINE>for (; l < i + j; l++) {<NEW_LINE>palette[l] = hsv(h, 1.0f, 1.0f, alpha);<NEW_LINE>h += hw;<NEW_LINE>}<NEW_LINE>h = 10 / 60.0f;<NEW_LINE>hw = (6 / 60.0f - <MASK><NEW_LINE>float s = 1.0f;<NEW_LINE>float sw = (0.3f - s) / (k - 1);<NEW_LINE>for (; l < n; l++) {<NEW_LINE>palette[l] = hsv(h, s, 1.0f, alpha);<NEW_LINE>h += hw;<NEW_LINE>s += sw;<NEW_LINE>}<NEW_LINE>return palette;<NEW_LINE>} | h) / (k - 1); |
1,151,754 | private void addOtherVariants(Consumer<ResolvedVariantResult> consumer) {<NEW_LINE>if (metadata.getVariantsForGraphTraversal().isPresent()) {<NEW_LINE>for (ConfigurationMetadata configurationMetadata : metadata.getVariantsForGraphTraversal().get()) {<NEW_LINE>for (VariantResolveMetadata variant : configurationMetadata.getVariants()) {<NEW_LINE>List<? extends Capability> capabilities = variant.getCapabilities().getCapabilities();<NEW_LINE>if (capabilities.isEmpty()) {<NEW_LINE>capabilities = ImmutableList.of(getImplicitCapability());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>consumer.accept(new DefaultResolvedVariantResult(metadata.getId(), Describables.of(variant.getName()), attributeDesugaring.desugar(variant.getAttributes().asImmutable()), capabilities, null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Fall-back if there's no graph data<NEW_LINE>for (NodeState node : nodes) {<NEW_LINE>for (VariantResolveMetadata variant : node.getMetadata().getVariants()) {<NEW_LINE>consumer.accept(new DefaultResolvedVariantResult(metadata.getId(), Describables.of(variant.getName()), node.desugar(variant.getAttributes().asImmutable()), ImmutableList.of(), null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | capabilities = ImmutableList.copyOf(capabilities); |
1,804,134 | protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, Params params) throws IOException {<NEW_LINE>builder.field("type", contentType());<NEW_LINE>if (includeDefaults || fieldType().boost() != 1.0f) {<NEW_LINE>builder.field("boost", fieldType().boost());<NEW_LINE>}<NEW_LINE>if (includeDefaults || mappedFieldType.isSearchable() != indexedByDefault()) {<NEW_LINE>builder.field("index", mappedFieldType.isSearchable());<NEW_LINE>}<NEW_LINE>if (includeDefaults || mappedFieldType.hasDocValues() != docValuesByDefault()) {<NEW_LINE>builder.field("doc_values", mappedFieldType.hasDocValues());<NEW_LINE>}<NEW_LINE>if (includeDefaults || fieldType.stored() != storedByDefault()) {<NEW_LINE>builder.field("store", fieldType.stored());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>copyTo.toXContent(builder, params);<NEW_LINE>if (includeDefaults || fieldType().meta().isEmpty() == false) {<NEW_LINE>// ensure consistent order<NEW_LINE>builder.field("meta", new TreeMap<>(fieldType().meta()));<NEW_LINE>}<NEW_LINE>} | multiFields.toXContent(builder, params); |
484,927 | private ReturningRunnable<ListDevicesResult> _listDevices(final Integer limit, final String paginationToken) {<NEW_LINE>return new ReturningRunnable<ListDevicesResult>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ListDevicesResult run() throws Exception {<NEW_LINE>final ListDevicesRequest listDevicesRequest = new ListDevicesRequest();<NEW_LINE>listDevicesRequest.setAccessToken(mobileClient.getTokens().getAccessToken().getTokenString());<NEW_LINE>listDevicesRequest.setLimit(limit);<NEW_LINE>listDevicesRequest.setPaginationToken(paginationToken);<NEW_LINE>final com.amazonaws.services.cognitoidentityprovider.model.ListDevicesResult <MASK><NEW_LINE>final ArrayList<Device> devices = new ArrayList<Device>(limit);<NEW_LINE>for (DeviceType deviceType : listDevicesResult.getDevices()) {<NEW_LINE>devices.add(marshallDeviceTypeToDevice(deviceType));<NEW_LINE>}<NEW_LINE>return new ListDevicesResult(devices, listDevicesResult.getPaginationToken());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | listDevicesResult = userpoolLL.listDevices(listDevicesRequest); |
1,633,151 | public static GetIoTCloudConnectorGatewayResponse unmarshall(GetIoTCloudConnectorGatewayResponse getIoTCloudConnectorGatewayResponse, UnmarshallerContext _ctx) {<NEW_LINE>getIoTCloudConnectorGatewayResponse.setRequestId(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.RequestId"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setSpec(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.Spec"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setResourceUid(_ctx.longValue("GetIoTCloudConnectorGatewayResponse.ResourceUid"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setDescription<MASK><NEW_LINE>getIoTCloudConnectorGatewayResponse.setState(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.State"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setScheduleFactor(_ctx.mapValue("GetIoTCloudConnectorGatewayResponse.ScheduleFactor"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setApn(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.Apn"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setForwardingUnitCount(_ctx.integerValue("GetIoTCloudConnectorGatewayResponse.ForwardingUnitCount"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setName(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.Name"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setIsp(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.Isp"));<NEW_LINE>getIoTCloudConnectorGatewayResponse.setIoTCloudConnectorGatewayId(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.IoTCloudConnectorGatewayId"));<NEW_LINE>List<String> forwardingUnitIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetIoTCloudConnectorGatewayResponse.ForwardingUnitIds.Length"); i++) {<NEW_LINE>forwardingUnitIds.add(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.ForwardingUnitIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>getIoTCloudConnectorGatewayResponse.setForwardingUnitIds(forwardingUnitIds);<NEW_LINE>List<String> featureList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetIoTCloudConnectorGatewayResponse.FeatureList.Length"); i++) {<NEW_LINE>featureList.add(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.FeatureList[" + i + "]"));<NEW_LINE>}<NEW_LINE>getIoTCloudConnectorGatewayResponse.setFeatureList(featureList);<NEW_LINE>List<String> zoneList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetIoTCloudConnectorGatewayResponse.ZoneList.Length"); i++) {<NEW_LINE>zoneList.add(_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.ZoneList[" + i + "]"));<NEW_LINE>}<NEW_LINE>getIoTCloudConnectorGatewayResponse.setZoneList(zoneList);<NEW_LINE>return getIoTCloudConnectorGatewayResponse;<NEW_LINE>} | (_ctx.stringValue("GetIoTCloudConnectorGatewayResponse.Description")); |
1,661,806 | public void paint(Graphics g) {<NEW_LINE>List target = (List) _target;<NEW_LINE>Dimension sz = target.getSize();<NEW_LINE>int w = sz.width;<NEW_LINE>int h = sz.height;<NEW_LINE>g.setColor(target.getBackground());<NEW_LINE>FakePeerUtils.drawLoweredBox(g, 0, 0, w, h);<NEW_LINE>int n = target.getItemCount();<NEW_LINE>if (n <= 0)<NEW_LINE>return;<NEW_LINE>if (target.isEnabled()) {<NEW_LINE>g.<MASK><NEW_LINE>} else {<NEW_LINE>g.setColor(SystemColor.controlShadow);<NEW_LINE>}<NEW_LINE>g.setFont(target.getFont());<NEW_LINE>g.setClip(1, 1, w - 5, h - 4);<NEW_LINE>FontMetrics fm = g.getFontMetrics();<NEW_LINE>int th = fm.getHeight(), ty = th + 2;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>g.drawString(target.getItem(i), 4, ty);<NEW_LINE>if (ty > h)<NEW_LINE>break;<NEW_LINE>ty += th;<NEW_LINE>}<NEW_LINE>} | setColor(target.getForeground()); |
1,195,684 | private <T extends FragmentViewModel> FragmentViewModel create(@NonNull final Context context, @NonNull final Class<T> viewModelClass, @Nullable final Bundle savedInstanceState, @NonNull final String id) {<NEW_LINE>final KSApplication application = (KSApplication) context.getApplicationContext();<NEW_LINE>final Environment environment = application<MASK><NEW_LINE>final FragmentViewModel viewModel;<NEW_LINE>try {<NEW_LINE>final Constructor constructor = viewModelClass.getConstructor(Environment.class);<NEW_LINE>viewModel = (FragmentViewModel) constructor.newInstance(environment);<NEW_LINE>// Need to catch these exceptions separately, otherwise the compiler turns them into `ReflectiveOperationException`.<NEW_LINE>// That exception is only available in API19+<NEW_LINE>} catch (IllegalAccessException exception) {<NEW_LINE>throw new RuntimeException(exception);<NEW_LINE>} catch (InvocationTargetException exception) {<NEW_LINE>throw new RuntimeException(exception);<NEW_LINE>} catch (InstantiationException exception) {<NEW_LINE>throw new RuntimeException(exception);<NEW_LINE>} catch (NoSuchMethodException exception) {<NEW_LINE>throw new RuntimeException(exception);<NEW_LINE>}<NEW_LINE>this.viewModels.put(id, viewModel);<NEW_LINE>viewModel.onCreate(context, BundleExtKt.maybeGetBundle(savedInstanceState, VIEW_MODEL_STATE_KEY));<NEW_LINE>return viewModel;<NEW_LINE>} | .component().environment(); |
1,535,772 | private static ValidationResult validate(String formatString, Object[] arguments) {<NEW_LINE>try {<NEW_LINE>String unused = String.format(formatString, arguments);<NEW_LINE>} catch (DuplicateFormatFlagsException e) {<NEW_LINE>return ValidationResult.create(e, String.format("duplicate format flags: %s", e.getFlags()));<NEW_LINE>} catch (FormatFlagsConversionMismatchException e) {<NEW_LINE>return ValidationResult.create(e, String.format("format specifier '%%%s' is not compatible with the given flag(s): %s", e.getConversion(), e.getFlags()));<NEW_LINE>} catch (IllegalFormatCodePointException e) {<NEW_LINE>return ValidationResult.create(e, String.format("invalid Unicode code point: %x", e.getCodePoint()));<NEW_LINE>} catch (IllegalFormatConversionException e) {<NEW_LINE>return ValidationResult.create(e, String.format("illegal format conversion: '%s' cannot be formatted using '%%%s'", e.getArgumentClass().getName(), e.getConversion()));<NEW_LINE>} catch (IllegalFormatFlagsException e) {<NEW_LINE>return ValidationResult.create(e, String.format("illegal format flags: %s", e.getFlags()));<NEW_LINE>} catch (IllegalFormatPrecisionException e) {<NEW_LINE>return ValidationResult.create(e, String.format("illegal format precision: %d", e.getPrecision()));<NEW_LINE>} catch (IllegalFormatWidthException e) {<NEW_LINE>return ValidationResult.create(e, String.format("illegal format width: %s", e.getWidth()));<NEW_LINE>} catch (MissingFormatArgumentException e) {<NEW_LINE>return ValidationResult.create(e, String.format("missing argument for format specifier '%s'", e.getFormatSpecifier()));<NEW_LINE>} catch (MissingFormatWidthException e) {<NEW_LINE>return ValidationResult.create(e, String.format("missing format width: %s", e.getFormatSpecifier()));<NEW_LINE>} catch (UnknownFormatConversionException e) {<NEW_LINE>return ValidationResult.create(e, unknownFormatConversion(e.getConversion()));<NEW_LINE>} catch (UnknownFormatFlagsException e) {<NEW_LINE>// TODO(cushon): I don't think the implementation ever throws this.<NEW_LINE>return ValidationResult.create(e, String.format("unknown format flag(s): %s", e.getFlags()));<NEW_LINE>} catch (IllegalFormatException e) {<NEW_LINE>// Fall back for other invalid format strings, e.g. IllegalFormatArgumentIndexException that<NEW_LINE>// was added in JDK 16<NEW_LINE>return ValidationResult.create(<MASK><NEW_LINE>}<NEW_LINE>return extraFormatArguments(formatString, asList(arguments));<NEW_LINE>} | e, e.getMessage()); |
1,423,263 | private Object retryMethod(RetriableMethod retryableMethod) throws StorageException {<NEW_LINE>tryCount = 0;<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>if (tryCount > 0) {<NEW_LINE>logger.log(Level.WARNING, "Retrying method: " + <MASK><NEW_LINE>}<NEW_LINE>Object result = retryableMethod.execute();<NEW_LINE>tryCount = 0;<NEW_LINE>return result;<NEW_LINE>} catch (StorageMoveException e) {<NEW_LINE>// StorageFileNotFoundException used to be caught here. It no longer is,<NEW_LINE>// since the transaction concept can cause some very ephemeral discrepancies.<NEW_LINE>// These can be caught by simply trying again.<NEW_LINE>// The reason this exists is a fuzzy stress test (#433)<NEW_LINE>logger.log(Level.INFO, "StorageException caused by missing file, not the connection. Not retrying.");<NEW_LINE>throw e;<NEW_LINE>} catch (StorageException e) {<NEW_LINE>tryCount++;<NEW_LINE>if (tryCount >= retryMaxCount) {<NEW_LINE>logger.log(Level.WARNING, "Transfer method failed. No retries left. Throwing exception.", e);<NEW_LINE>throw e;<NEW_LINE>} else {<NEW_LINE>logger.log(Level.WARNING, "Transfer method failed. " + tryCount + "/" + retryMaxCount + " retries. Sleeping " + retrySleepMillis + "ms ...", e);<NEW_LINE>try {<NEW_LINE>Thread.sleep(retrySleepMillis);<NEW_LINE>} catch (Exception e1) {<NEW_LINE>throw new StorageException(e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | tryCount + "/" + retryMaxCount + " ..."); |
1,285,138 | public static DescribeFabricChaincodeDefinitionTaskResponse unmarshall(DescribeFabricChaincodeDefinitionTaskResponse describeFabricChaincodeDefinitionTaskResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeFabricChaincodeDefinitionTaskResponse.setRequestId(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.RequestId"));<NEW_LINE>describeFabricChaincodeDefinitionTaskResponse.setSuccess(_ctx.booleanValue("DescribeFabricChaincodeDefinitionTaskResponse.Success"));<NEW_LINE>describeFabricChaincodeDefinitionTaskResponse.setErrorCode(_ctx.integerValue("DescribeFabricChaincodeDefinitionTaskResponse.ErrorCode"));<NEW_LINE>Result result = new Result();<NEW_LINE>result.setStatus(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Status"));<NEW_LINE>result.setType(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Type"));<NEW_LINE>result.setChannelName(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.ChannelName"));<NEW_LINE>result.setDescription(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Description"));<NEW_LINE>result.setCreateTime(_ctx.longValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.CreateTime"));<NEW_LINE>result.setTaskId(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.TaskId"));<NEW_LINE>result.setCreator(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Creator"));<NEW_LINE>List<String> approvers = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Approvers.Length"); i++) {<NEW_LINE>approvers.add(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Approvers[" + i + "]"));<NEW_LINE>}<NEW_LINE>result.setApprovers(approvers);<NEW_LINE>Content content = new Content();<NEW_LINE>ChaincodeDefinition chaincodeDefinition = new ChaincodeDefinition();<NEW_LINE>chaincodeDefinition.setEndorsementPolicy(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Content.ChaincodeDefinition.EndorsementPolicy"));<NEW_LINE>chaincodeDefinition.setSequence(_ctx.longValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Content.ChaincodeDefinition.Sequence"));<NEW_LINE>chaincodeDefinition.setVersion(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Content.ChaincodeDefinition.Version"));<NEW_LINE>chaincodeDefinition.setChaincodePackageId(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Content.ChaincodeDefinition.ChaincodePackageId"));<NEW_LINE>chaincodeDefinition.setName<MASK><NEW_LINE>chaincodeDefinition.setInitRequired(_ctx.booleanValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Content.ChaincodeDefinition.InitRequired"));<NEW_LINE>chaincodeDefinition.setCollectionConfig(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Content.ChaincodeDefinition.CollectionConfig"));<NEW_LINE>chaincodeDefinition.setUid(_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Content.ChaincodeDefinition.Uid"));<NEW_LINE>content.setChaincodeDefinition(chaincodeDefinition);<NEW_LINE>result.setContent(content);<NEW_LINE>describeFabricChaincodeDefinitionTaskResponse.setResult(result);<NEW_LINE>return describeFabricChaincodeDefinitionTaskResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeFabricChaincodeDefinitionTaskResponse.Result.Content.ChaincodeDefinition.Name")); |
439,212 | public static void displayAsBubble(@NonNull Context context, @NonNull RecipientId recipientId, long threadId) {<NEW_LINE>if (Build.VERSION.SDK_INT >= CONVERSATION_SUPPORT_VERSION) {<NEW_LINE>SignalExecutors.BOUNDED.execute(() -> {<NEW_LINE>if (canBubble(context, recipientId, threadId)) {<NEW_LINE>NotificationManager <MASK><NEW_LINE>StatusBarNotification[] notifications = notificationManager.getActiveNotifications();<NEW_LINE>int threadNotificationId = NotificationIds.getNotificationIdForThread(threadId);<NEW_LINE>Notification activeThreadNotification = Stream.of(notifications).filter(n -> n.getId() == threadNotificationId).findFirst().map(StatusBarNotification::getNotification).orElse(null);<NEW_LINE>if (activeThreadNotification != null && activeThreadNotification.deleteIntent != null) {<NEW_LINE>ApplicationDependencies.getMessageNotifier().updateNotification(context, threadId, BubbleState.SHOWN);<NEW_LINE>} else {<NEW_LINE>Recipient recipient = Recipient.resolved(recipientId);<NEW_LINE>NotificationFactory.notifyToBubbleConversation(context, recipient, threadId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | notificationManager = ServiceUtil.getNotificationManager(context); |
231,140 | public static DescribeDevicesResponse unmarshall(DescribeDevicesResponse describeDevicesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDevicesResponse.setRequestId(_ctx.stringValue("DescribeDevicesResponse.RequestId"));<NEW_LINE>describeDevicesResponse.setErrorCode(_ctx.stringValue("DescribeDevicesResponse.ErrorCode"));<NEW_LINE>describeDevicesResponse.setErrorMessage(_ctx.stringValue("DescribeDevicesResponse.ErrorMessage"));<NEW_LINE>describeDevicesResponse.setMessage(_ctx.stringValue("DescribeDevicesResponse.Message"));<NEW_LINE>describeDevicesResponse.setCode(_ctx.stringValue("DescribeDevicesResponse.Code"));<NEW_LINE>describeDevicesResponse.setDynamicCode(_ctx.stringValue("DescribeDevicesResponse.DynamicCode"));<NEW_LINE>describeDevicesResponse.setSuccess(_ctx.booleanValue("DescribeDevicesResponse.Success"));<NEW_LINE>describeDevicesResponse.setDynamicMessage(_ctx.stringValue("DescribeDevicesResponse.DynamicMessage"));<NEW_LINE>List<Device> devices = new ArrayList<Device>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDevicesResponse.Devices.Length"); i++) {<NEW_LINE>Device device = new Device();<NEW_LINE>device.setAgentStatus(_ctx.stringValue("DescribeDevicesResponse.Devices[" + i + "].AgentStatus"));<NEW_LINE>device.setIpcStatus(_ctx.stringValue("DescribeDevicesResponse.Devices[" + i + "].IpcStatus"));<NEW_LINE>device.setAgentIp(_ctx.stringValue("DescribeDevicesResponse.Devices[" + i + "].AgentIp"));<NEW_LINE>device.setIpcIp(_ctx.stringValue("DescribeDevicesResponse.Devices[" + i + "].IpcIp"));<NEW_LINE>device.setAgentReceiveTime(_ctx.longValue("DescribeDevicesResponse.Devices[" + i + "].AgentReceiveTime"));<NEW_LINE>device.setAgentMac(_ctx.stringValue("DescribeDevicesResponse.Devices[" + i + "].AgentMac"));<NEW_LINE>device.setIpcReceiveTime(_ctx.longValue("DescribeDevicesResponse.Devices[" + i + "].IpcReceiveTime"));<NEW_LINE>device.setIpcId(_ctx.longValue("DescribeDevicesResponse.Devices[" + i + "].IpcId"));<NEW_LINE>device.setIpcName(_ctx.stringValue<MASK><NEW_LINE>devices.add(device);<NEW_LINE>}<NEW_LINE>describeDevicesResponse.setDevices(devices);<NEW_LINE>return describeDevicesResponse;<NEW_LINE>} | ("DescribeDevicesResponse.Devices[" + i + "].IpcName")); |
214,660 | public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException {<NEW_LINE>final Map<Vault, Map<Path, TransferStatus>> vaults = new HashMap<>();<NEW_LINE>for (Map.Entry<Path, TransferStatus> file : files.entrySet()) {<NEW_LINE>final Vault vault = registry.find(session, file.getKey());<NEW_LINE>final Map<Path, TransferStatus> sorted;<NEW_LINE>if (vaults.containsKey(vault)) {<NEW_LINE>sorted = vaults.get(vault);<NEW_LINE>} else {<NEW_LINE>sorted = new LinkedHashMap<>();<NEW_LINE>}<NEW_LINE>sorted.put(file.getKey(), file.getValue());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>for (Map.Entry<Vault, Map<Path, TransferStatus>> entry : vaults.entrySet()) {<NEW_LINE>final Vault vault = entry.getKey();<NEW_LINE>final Delete feature = vault.getFeature(session, Delete.class, proxy);<NEW_LINE>feature.delete(entry.getValue(), prompt, callback);<NEW_LINE>}<NEW_LINE>} | vaults.put(vault, sorted); |
1,170,458 | public static Connection initConnection(PropertyExpansionContext context, String driver, String connectionString, String password) throws SQLException, SoapUIException {<NEW_LINE>if (JdbcUtils.missingConnSettings(driver, connectionString)) {<NEW_LINE>throw new SoapUIException("Some connections settings are missing");<NEW_LINE>}<NEW_LINE>String drvr = PropertyExpander.expandProperties(<MASK><NEW_LINE>String connStr = PropertyExpander.expandProperties(context, connectionString).trim();<NEW_LINE>String pass = StringUtils.hasContent(password) ? PropertyExpander.expandProperties(context, password).trim() : "";<NEW_LINE>String masskedPass = connStr.replace(PASS_TEMPLATE, "#####");<NEW_LINE>if (connStr.contains(PASS_TEMPLATE)) {<NEW_LINE>pass = Matcher.quoteReplacement(pass);<NEW_LINE>connStr = connStr.replaceFirst(PASS_TEMPLATE, pass);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>GroovyUtils.registerJdbcDriver(drvr);<NEW_LINE>DriverManager.getDriver(connStr);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>// SoapUI.logError( e );<NEW_LINE>try {<NEW_LINE>Class.forName(drvr).newInstance();<NEW_LINE>} catch (Exception e1) {<NEW_LINE>SoapUI.logError(e);<NEW_LINE>throw new SoapUIException("Failed to init connection for driver [" + drvr + "], connectionString [" + masskedPass + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return DriverManager.getConnection(connStr);<NEW_LINE>} | context, driver).trim(); |
1,563,804 | protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException {<NEW_LINE>ClassLoader cl = null;<NEW_LINE>try {<NEW_LINE>cl = getClassLoaderIncludingProjectClasspath();<NEW_LINE>Thread.currentThread().setContextClassLoader(cl);<NEW_LINE>} catch (MojoExecutionException e) {<NEW_LINE>throw new LiquibaseException("Could not create the class loader, " + e, e);<NEW_LINE>}<NEW_LINE>Database database = liquibase.getDatabase();<NEW_LINE>getLog().info(<MASK><NEW_LINE>try {<NEW_LINE>DiffOutputControl diffOutputControl = new DiffOutputControl(outputDefaultCatalog, outputDefaultSchema, true, null);<NEW_LINE>if ((diffExcludeObjects != null) && (diffIncludeObjects != null)) {<NEW_LINE>throw new UnexpectedLiquibaseException("Cannot specify both excludeObjects and includeObjects");<NEW_LINE>}<NEW_LINE>if (diffExcludeObjects != null) {<NEW_LINE>diffOutputControl.setObjectChangeFilter(new StandardObjectChangeFilter(StandardObjectChangeFilter.FilterType.EXCLUDE, diffExcludeObjects));<NEW_LINE>}<NEW_LINE>if (diffIncludeObjects != null) {<NEW_LINE>diffOutputControl.setObjectChangeFilter(new StandardObjectChangeFilter(StandardObjectChangeFilter.FilterType.INCLUDE, diffIncludeObjects));<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Set the global configuration option based on presence of the dataOutputDirectory<NEW_LINE>//<NEW_LINE>boolean b = dataDir != null;<NEW_LINE>Scope.child(GlobalConfiguration.SHOULD_SNAPSHOT_DATA.getKey(), b, () -> {<NEW_LINE>CommandLineUtils.doGenerateChangeLog(outputChangeLogFile, database, defaultCatalogName, defaultSchemaName, StringUtil.trimToNull(diffTypes), StringUtil.trimToNull(changeSetAuthor), StringUtil.trimToNull(changeSetContext), StringUtil.trimToNull(dataDir), diffOutputControl);<NEW_LINE>getLog().info("Output written to Change Log file, " + outputChangeLogFile);<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new LiquibaseException(e);<NEW_LINE>}<NEW_LINE>} | "Generating Change Log from database " + database.toString()); |
964,722 | public static ListAliyunRegionResponse unmarshall(ListAliyunRegionResponse listAliyunRegionResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAliyunRegionResponse.setRequestId(_ctx.stringValue("ListAliyunRegionResponse.RequestId"));<NEW_LINE>listAliyunRegionResponse.setCode<MASK><NEW_LINE>listAliyunRegionResponse.setMessage(_ctx.stringValue("ListAliyunRegionResponse.Message"));<NEW_LINE>List<RegionEntity> regionEntityList = new ArrayList<RegionEntity>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAliyunRegionResponse.RegionEntityList.Length"); i++) {<NEW_LINE>RegionEntity regionEntity = new RegionEntity();<NEW_LINE>regionEntity.setId(_ctx.stringValue("ListAliyunRegionResponse.RegionEntityList[" + i + "].Id"));<NEW_LINE>regionEntity.setName(_ctx.stringValue("ListAliyunRegionResponse.RegionEntityList[" + i + "].Name"));<NEW_LINE>regionEntityList.add(regionEntity);<NEW_LINE>}<NEW_LINE>listAliyunRegionResponse.setRegionEntityList(regionEntityList);<NEW_LINE>return listAliyunRegionResponse;<NEW_LINE>} | (_ctx.integerValue("ListAliyunRegionResponse.Code")); |
1,731,782 | public void printAllCriticalPaths(String[] precedenceConstraints) {<NEW_LINE>int jobs = precedenceConstraints.length;<NEW_LINE>EdgeWeightedDigraph edgeWeightedDigraph = new EdgeWeightedDigraph(2 * jobs + 2);<NEW_LINE>int source = 2 * jobs;<NEW_LINE>int target = 2 * jobs + 1;<NEW_LINE>for (int job = 0; job < jobs; job++) {<NEW_LINE>String[] jobInformation = precedenceConstraints[job].split("\\s+");<NEW_LINE>double duration = Double.parseDouble(jobInformation[0]);<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(job, job + jobs, duration));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(source, job, 0));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(job + jobs, target, 0));<NEW_LINE>for (int successors = 1; successors < jobInformation.length; successors++) {<NEW_LINE>int successor = Integer<MASK><NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(job + jobs, successor, 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Check if there is any cycle<NEW_LINE>EdgeWeightedDirectedCycle edgeWeightedDirectedCycle = new EdgeWeightedDirectedCycle(edgeWeightedDigraph);<NEW_LINE>if (edgeWeightedDirectedCycle.hasCycle()) {<NEW_LINE>throw new IllegalArgumentException("The jobs graph cannot contain cycles.");<NEW_LINE>}<NEW_LINE>PriorityQueueResize<Path> allPaths = getAllPaths(edgeWeightedDigraph, target);<NEW_LINE>printAllCriticalPaths(allPaths, target);<NEW_LINE>} | .parseInt(jobInformation[successors]); |
1,033,023 | public JavaInfo toJavaBinaryInfo(JavaInfo javaInfo, StarlarkThread thread) throws EvalException {<NEW_LINE>checkPrivateAccess(thread);<NEW_LINE>JavaRuleOutputJarsProvider ruleOutputs = JavaRuleOutputJarsProvider.builder().addJavaOutput(javaInfo.getJavaOutputs().stream().map(output -> JavaOutput.create(output.getClassJar(), null, null, output.getGeneratedClassJar(), output.getGeneratedSourceJar(), output.getNativeHeadersJar(), output.getManifestProto(), output.getJdeps(), output.getSourceJars())).collect(Collectors.toList())).build();<NEW_LINE>JavaInfo.Builder builder <MASK><NEW_LINE>if (javaInfo.getProvider(JavaCompilationInfoProvider.class) != null) {<NEW_LINE>builder.addProvider(JavaCompilationInfoProvider.class, javaInfo.getCompilationInfoProvider());<NEW_LINE>} else if (javaInfo.getProvider(JavaCompilationArgsProvider.class) != null) {<NEW_LINE>builder.addProvider(JavaCompilationInfoProvider.class, new JavaCompilationInfoProvider.Builder().setRuntimeClasspath(javaInfo.getProvider(JavaCompilationArgsProvider.class).getRuntimeJars()).build());<NEW_LINE>}<NEW_LINE>if (javaInfo.getProvider(JavaGenJarsProvider.class) != null) {<NEW_LINE>builder.addProvider(JavaGenJarsProvider.class, javaInfo.getGenJarsProvider());<NEW_LINE>}<NEW_LINE>return builder.addProvider(JavaCcInfoProvider.class, javaInfo.getProvider(JavaCcInfoProvider.class)).addProvider(JavaSourceJarsProvider.class, javaInfo.getProvider(JavaSourceJarsProvider.class)).addProvider(JavaRuleOutputJarsProvider.class, ruleOutputs).build();<NEW_LINE>} | = JavaInfo.Builder.create(); |
1,027,569 | public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>Activity activity = requireActivity();<NEW_LINE>ContextThemeWrapper theme = ThemeChanger.getDialogThemeWrapper(activity);<NEW_LINE>CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(theme);<NEW_LINE>LayoutInflater layoutInflater = LayoutInflater.from(theme);<NEW_LINE>@SuppressLint("InflateParams")<NEW_LINE>ViewGroup view = (ViewGroup) layoutInflater.inflate(R.layout.api_select_identity_key, null, false);<NEW_LINE>alert.setView(view);<NEW_LINE>buttonOverflow = view.findViewById(R.id.overflow_menu);<NEW_LINE>buttonKeyListCancel = view.findViewById(R.id.button_key_list_cancel);<NEW_LINE>buttonKeyListOther = view.findViewById(R.id.button_key_list_other);<NEW_LINE>buttonNoKeysNew = view.findViewById(R.id.button_no_keys_new);<NEW_LINE>buttonNoKeysExisting = view.findViewById(R.id.button_no_keys_existing);<NEW_LINE>buttonNoKeysCancel = view.findViewById(R.id.button_no_keys_cancel);<NEW_LINE>buttonExplBack = view.findViewById(R.id.button_expl_back);<NEW_LINE>buttonExplGotIt = view.findViewById(R.id.button_expl_got_it);<NEW_LINE>buttonGenOkBack = view.findViewById(R.id.button_genok_back);<NEW_LINE>buttonGenOkFinish = view.findViewById(R.id.button_genok_finish);<NEW_LINE>buttonGotoOpenKeychain = view.<MASK><NEW_LINE>keyChoiceList = view.findViewById(R.id.identity_key_list);<NEW_LINE>keyChoiceList.setLayoutManager(new LinearLayoutManager(activity));<NEW_LINE>keyChoiceList.addItemDecoration(new DividerItemDecoration(activity, DividerItemDecoration.VERTICAL_LIST, true));<NEW_LINE>setupListenersForPresenter();<NEW_LINE>mvpView = createMvpView(view, layoutInflater);<NEW_LINE>return alert.create();<NEW_LINE>} | findViewById(R.id.button_goto_openkeychain); |
1,692,428 | private void showPopup(@NonNull View view, @NonNull final LayoutElementParcelable rowItem) {<NEW_LINE>Context currentContext = this.context;<NEW_LINE>if (mainFrag.getMainActivity().getAppTheme().getSimpleTheme(mainFrag.requireContext()) == AppTheme.BLACK) {<NEW_LINE>currentContext = new ContextThemeWrapper(context, R.style.overflow_black);<NEW_LINE>}<NEW_LINE>PopupMenu popupMenu = new ItemPopupMenu(currentContext, mainFrag.requireMainActivity(), utilsProvider, mainFrag, rowItem, view, sharedPrefs);<NEW_LINE>popupMenu.<MASK><NEW_LINE>String description = rowItem.desc.toLowerCase();<NEW_LINE>if (rowItem.isDirectory) {<NEW_LINE>popupMenu.getMenu().findItem(R.id.open_with).setVisible(false);<NEW_LINE>popupMenu.getMenu().findItem(R.id.share).setVisible(false);<NEW_LINE>if (mainFrag.getMainActivity().mReturnIntent) {<NEW_LINE>popupMenu.getMenu().findItem(R.id.return_select).setVisible(true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>popupMenu.getMenu().findItem(R.id.book).setVisible(false);<NEW_LINE>if (description.endsWith(fileExtensionZip) || description.endsWith(fileExtensionJar) || description.endsWith(fileExtensionApk) || description.endsWith(fileExtensionApks) || description.endsWith(fileExtensionRar) || description.endsWith(fileExtensionTar) || description.endsWith(fileExtensionGzipTarLong) || description.endsWith(fileExtensionGzipTarShort) || description.endsWith(fileExtensionBzip2TarLong) || description.endsWith(fileExtensionBzip2TarShort) || description.endsWith(fileExtensionTarXz) || description.endsWith(fileExtensionTarLzma) || description.endsWith(fileExtension7zip) || description.endsWith(fileExtensionGz) || description.endsWith(fileExtensionBzip2) || description.endsWith(fileExtensionLzma) || description.endsWith(fileExtensionXz))<NEW_LINE>popupMenu.getMenu().findItem(R.id.ex).setVisible(true);<NEW_LINE>}<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {<NEW_LINE>if (description.endsWith(CryptUtil.CRYPT_EXTENSION) || description.endsWith(CryptUtil.AESCRYPT_EXTENSION)) {<NEW_LINE>popupMenu.getMenu().findItem(R.id.decrypt).setVisible(true);<NEW_LINE>} else {<NEW_LINE>popupMenu.getMenu().findItem(R.id.encrypt).setVisible(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>popupMenu.show();<NEW_LINE>} | inflate(R.menu.item_extras); |
702,422 | public MergeResult merge(String branch, Sequence<?> commits, Object msg) throws RepoException, ValidationException, EvalException, IOException {<NEW_LINE>ValidationException.checkCondition(!commits.isEmpty(), "At least one commit should be passed to merge");<NEW_LINE>GitRepository withWorktree = this.repo.withWorkTree<MASK><NEW_LINE>try {<NEW_LINE>withWorktree.forceCheckout(branch);<NEW_LINE>} catch (RepoException e) {<NEW_LINE>throw new ValidationException("Cannot merge commits " + commits + " into branch " + branch + " because of failure during merge checkout", e);<NEW_LINE>}<NEW_LINE>String strMsg = SkylarkUtil.convertFromNoneable(msg, null);<NEW_LINE>// Clean everything before the merge<NEW_LINE>withWorktree.simpleCommand("reset", "--hard");<NEW_LINE>withWorktree.forceClean();<NEW_LINE>List<String> cmd = Lists.newArrayList("merge");<NEW_LINE>if (strMsg != null) {<NEW_LINE>cmd.add("-m");<NEW_LINE>cmd.add(strMsg);<NEW_LINE>}<NEW_LINE>cmd.addAll(SkylarkUtil.convertStringList(commits, "commits"));<NEW_LINE>try {<NEW_LINE>withWorktree.simpleCommand(cmd);<NEW_LINE>} catch (RepoException e) {<NEW_LINE>logger.atWarning().withCause(e).log("Error running merge in action %s for branch %s and commits %s", getActionName(), branch, commits);<NEW_LINE>return MergeResult.error(e.getMessage());<NEW_LINE>}<NEW_LINE>return MergeResult.success();<NEW_LINE>} | (dirFactory.newTempDir("mirror")); |
1,400,626 | public void init() {<NEW_LINE>if (initialized)<NEW_LINE>return;<NEW_LINE>initialized = true;<NEW_LINE>if (oname == null) {<NEW_LINE>try {<NEW_LINE>StandardContext ctx = (StandardContext) this.getContainer();<NEW_LINE>domain = ctx.getEngineName();<NEW_LINE>distributable = ctx.getDistributable();<NEW_LINE>StandardHost hst = <MASK><NEW_LINE>String path = ctx.getEncodedPath();<NEW_LINE>if (path.equals("")) {<NEW_LINE>path = "/";<NEW_LINE>}<NEW_LINE>oname = new ObjectName(domain + ":type=Manager,path=" + path + ",host=" + hst.getName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, LogFacade.ERROR_REGISTERING_EXCEPTION_SEVERE, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (log.isLoggable(Level.FINE)) {<NEW_LINE>log.log(Level.FINE, "Registering {0}", oname);<NEW_LINE>}<NEW_LINE>} | (StandardHost) ctx.getParent(); |
962,895 | private void createPrintPackage(final I_C_Print_Job_Instructions printjobInstructions) {<NEW_LINE>final IPrintPackageBL printPackageBL = Services.get(IPrintPackageBL.class);<NEW_LINE>final Properties ctx = InterfaceWrapperHelper.getCtx(printjobInstructions);<NEW_LINE>final I_C_Print_Package printPackage = InterfaceWrapperHelper.create(ctx, I_C_Print_Package.class, ITrx.TRXNAME_ThreadInherited);<NEW_LINE>// Creating the Print Package template (request):<NEW_LINE>final String transactionId = UUID.randomUUID().toString();<NEW_LINE>printPackage.setTransactionID(transactionId);<NEW_LINE>InterfaceWrapperHelper.<MASK><NEW_LINE>final PrintPackageCtx printCtx = (PrintPackageCtx) printPackageBL.createEmptyInitialCtx();<NEW_LINE>printCtx.setHostKey(printjobInstructions.getHostKey());<NEW_LINE>printCtx.setTransactionId(printPackage.getTransactionID());<NEW_LINE>printPackageBL.addPrintingDataToPrintPackage(printPackage, printjobInstructions, printCtx);<NEW_LINE>} | save(printPackage, ITrx.TRXNAME_ThreadInherited); |
1,448,738 | public void updateFilters() {<NEW_LINE>updateList(R.id.domainlist, SettingValues.domainFilters, SettingValues.domainFilters::remove);<NEW_LINE>updateList(R.id.subredditlist, SettingValues.subredditFilters, SettingValues.subredditFilters::remove);<NEW_LINE>updateList(R.id.userlist, SettingValues.userFilters, SettingValues.userFilters::remove);<NEW_LINE>updateList(R.id.selftextlist, SettingValues.textFilters, SettingValues.textFilters::remove);<NEW_LINE>updateList(R.id.titlelist, SettingValues.titleFilters, SettingValues.titleFilters::remove);<NEW_LINE>((LinearLayout) findViewById(R.id<MASK><NEW_LINE>for (String s : SettingValues.flairFilters) {<NEW_LINE>final View t = getLayoutInflater().inflate(R.layout.account_textview, (LinearLayout) findViewById(R.id.domainlist), false);<NEW_LINE>SpannableStringBuilder b = new SpannableStringBuilder();<NEW_LINE>String subname = s.split(":")[0];<NEW_LINE>SpannableStringBuilder subreddit = new SpannableStringBuilder(" /r/" + subname + " ");<NEW_LINE>if ((SettingValues.colorSubName && Palette.getColor(subname) != Palette.getDefaultColor())) {<NEW_LINE>subreddit.setSpan(new ForegroundColorSpan(Palette.getColor(subname)), 0, subreddit.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>subreddit.setSpan(new StyleSpan(Typeface.BOLD), 0, subreddit.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>}<NEW_LINE>b.append(subreddit).append(s.split(":")[1]);<NEW_LINE>((TextView) t.findViewById(R.id.name)).setText(b);<NEW_LINE>t.findViewById(R.id.remove).setOnClickListener(v -> {<NEW_LINE>SettingValues.flairFilters.remove(s);<NEW_LINE>updateFilters();<NEW_LINE>});<NEW_LINE>((LinearLayout) findViewById(R.id.flairlist)).addView(t);<NEW_LINE>}<NEW_LINE>} | .flairlist)).removeAllViews(); |
1,618,307 | final UpdateScheduledAuditResult executeUpdateScheduledAudit(UpdateScheduledAuditRequest updateScheduledAuditRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateScheduledAuditRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateScheduledAuditRequest> request = null;<NEW_LINE>Response<UpdateScheduledAuditResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateScheduledAuditRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateScheduledAuditRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateScheduledAudit");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateScheduledAuditResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new UpdateScheduledAuditResultJsonUnmarshaller()); |
110,460 | final UpdateMultiplexProgramResult executeUpdateMultiplexProgram(UpdateMultiplexProgramRequest updateMultiplexProgramRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateMultiplexProgramRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateMultiplexProgramRequest> request = null;<NEW_LINE>Response<UpdateMultiplexProgramResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateMultiplexProgramRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateMultiplexProgramRequest));<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, "MediaLive");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateMultiplexProgram");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateMultiplexProgramResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateMultiplexProgramResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
637,718 | private List<MutationResultListener> createConfig(long t0, CoverageDatabase coverageData, HistoryStore history, MutationStatisticsListener stats, MutationEngine engine) {<NEW_LINE>final List<MutationResultListener> ls = new ArrayList<>();<NEW_LINE>ls.add(stats);<NEW_LINE>final ListenerArguments args = new ListenerArguments(this.strategies.output(), coverageData, new SmartSourceLocator(this.data.getSourceDirs()), engine, t0, this.data.isFullMutationMatrix(), data);<NEW_LINE>final MutationResultListener mutationReportListener = this.strategies.listenerFactory().getListener(this.<MASK><NEW_LINE>ls.add(mutationReportListener);<NEW_LINE>ls.add(new HistoryListener(history));<NEW_LINE>if (this.data.getVerbosity().showSpinner()) {<NEW_LINE>ls.add(new SpinnerListener(System.out));<NEW_LINE>}<NEW_LINE>return ls;<NEW_LINE>} | data.getFreeFormProperties(), args); |
1,757,481 | public void read(org.apache.thrift.protocol.TProtocol prot, revokeTablePermission_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(5);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.tinfo = new org.apache.accumulo.core.trace.thrift.TInfo();<NEW_LINE>struct.tinfo.read(iprot);<NEW_LINE>struct.setTinfoIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials();<NEW_LINE>struct.credentials.read(iprot);<NEW_LINE>struct.setCredentialsIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct<MASK><NEW_LINE>struct.setPrincipalIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(3)) {<NEW_LINE>struct.tableName = iprot.readString();<NEW_LINE>struct.setTableNameIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(4)) {<NEW_LINE>struct.permission = iprot.readByte();<NEW_LINE>struct.setPermissionIsSet(true);<NEW_LINE>}<NEW_LINE>} | .principal = iprot.readString(); |
1,043,268 | public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.manage_workouts);<NEW_LINE>PHONE_STRING = getResources().getString(R.string.my_phone);<NEW_LINE>mDB = DBHelper.getReadableDatabase(this);<NEW_LINE>syncManager = new SyncManager(this);<NEW_LINE>adapter = new WorkoutAccountListAdapter(this);<NEW_LINE>ExpandableListView list = <MASK><NEW_LINE>list.setAdapter(adapter);<NEW_LINE>deleteButton = findViewById(R.id.delete_workout_button);<NEW_LINE>deleteButton.setOnClickListener(deleteButtonClick);<NEW_LINE>createButton = findViewById(R.id.create_workout_button);<NEW_LINE>createButton.setOnClickListener(createButtonClick);<NEW_LINE>shareButton = findViewById(R.id.share_workout_button);<NEW_LINE>shareButton.setOnClickListener(shareButtonClick);<NEW_LINE>editButton = findViewById(R.id.edit_workout_button);<NEW_LINE>editButton.setOnClickListener(editButtonClick);<NEW_LINE>handleButtons();<NEW_LINE>requery();<NEW_LINE>listLocal();<NEW_LINE>list.expandGroup(0);<NEW_LINE>Uri data = getIntent().getData();<NEW_LINE>if (data != null) {<NEW_LINE>getIntent().setData(null);<NEW_LINE>String fileName = getFilename(data);<NEW_LINE>if (fileName == null)<NEW_LINE>fileName = "noname";<NEW_LINE>try {<NEW_LINE>importData(fileName, data);<NEW_LINE>} catch (Exception e) {<NEW_LINE>new AlertDialog.Builder(this).setTitle(R.string.Error).setMessage(getString(R.string.Failed_to_import) + ": " + fileName).setPositiveButton(R.string.OK, (dialog, which) -> {<NEW_LINE>dialog.dismiss();<NEW_LINE>ManageWorkoutsActivity.this.finish();<NEW_LINE>}).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// launch home Activity (with FLAG_ACTIVITY_CLEAR_TOP)<NEW_LINE>} | findViewById(R.id.expandable_list_view); |
1,410,994 | // --------------------------------------------- ServletInputStream Methods<NEW_LINE>@Override<NEW_LINE>public int read() throws IOException {<NEW_LINE>// Disallow operation if the object has gone out of scope<NEW_LINE>if (ib == null) {<NEW_LINE>throw new IllegalStateException(rb.getString(LogFacade.OBJECT_INVALID_SCOPE_EXCEPTION));<NEW_LINE>}<NEW_LINE>if (SecurityUtil.isPackageProtectionEnabled()) {<NEW_LINE>try {<NEW_LINE>Integer result = AccessController.doPrivileged(new PrivilegedExceptionAction<Integer>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer run() throws IOException {<NEW_LINE><MASK><NEW_LINE>return integer;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result;<NEW_LINE>} catch (PrivilegedActionException pae) {<NEW_LINE>Exception e = pae.getException();<NEW_LINE>if (e instanceof IOException) {<NEW_LINE>throw (IOException) e;<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return ib.readByte();<NEW_LINE>}<NEW_LINE>} | Integer integer = ib.readByte(); |
1,277,966 | private int parseInclude(Context context, int resourceId) {<NEW_LINE>Resources res = context.getResources();<NEW_LINE>XmlPullParser includeParser = res.getXml(resourceId);<NEW_LINE>try {<NEW_LINE>for (int eventType = includeParser.getEventType(); eventType != XmlResourceParser.END_DOCUMENT; eventType = includeParser.next()) {<NEW_LINE>String tagName = includeParser.getName();<NEW_LINE>if (XmlResourceParser.START_TAG == eventType && CONSTRAINTSET_TAG.equals(tagName)) {<NEW_LINE>return parseConstraintSet(context, includeParser);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (XmlPullParserException e) {<NEW_LINE>if (DEBUG) {<NEW_LINE>Log.v(TAG, getLine(context, resourceId, includeParser) + " " + e.getMessage());<NEW_LINE>}<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (IOException e) {<NEW_LINE>if (DEBUG) {<NEW_LINE>Log.v(TAG, getLine(context, resourceId, includeParser) + <MASK><NEW_LINE>}<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return UNSET;<NEW_LINE>} | " " + e.getMessage()); |
735,663 | static Component onCreateLayout(ComponentContext c, @State String selection, @State boolean isShowingDropDown, @Prop(resType = ResType.DIMEN_TEXT, optional = true) float selectedTextSize, @Prop(resType = ResType.COLOR, optional = true) int selectedTextColor, @Prop(resType = ResType.DRAWABLE, optional = true) @Nullable Drawable caret) {<NEW_LINE>caret = caret == null ? new CaretDrawable(c.<MASK><NEW_LINE>selectedTextSize = selectedTextSize == -1 ? spToPx(c.getAndroidContext(), DEFAULT_TEXT_SIZE_SP) : selectedTextSize;<NEW_LINE>return Row.create(c).minHeightDip(SPINNER_HEIGHT).justifyContent(YogaJustify.SPACE_BETWEEN).paddingDip(START, MARGIN_SMALL).backgroundAttr(android.R.attr.selectableItemBackground).clickHandler(Spinner.onClick(c)).child(createSelectedItemText(c, selection, (int) selectedTextSize, selectedTextColor)).child(createCaret(c, caret, isShowingDropDown)).accessibilityRole(AccessibilityRole.DROP_DOWN_LIST).build();<NEW_LINE>} | getAndroidContext(), DEFAULT_CARET_COLOR) : caret; |
733,337 | public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {<NEW_LINE>final ListCalc listCalc = compiler.compileList<MASK><NEW_LINE>final DoubleCalc doubleCalc = call.getArgCount() > 1 ? compiler.compileDouble(call.getArg(1)) : new ValueCalc(call);<NEW_LINE>return new AbstractDoubleCalc(call, new Calc[] { listCalc, doubleCalc }) {<NEW_LINE><NEW_LINE>public double evaluateDouble(Evaluator evaluator) {<NEW_LINE>final int savepoint = evaluator.savepoint();<NEW_LINE>try {<NEW_LINE>evaluator.setNonEmpty(false);<NEW_LINE>TupleList members = evaluateCurrentList(listCalc, evaluator);<NEW_LINE>return quartile(evaluator, members, doubleCalc, range);<NEW_LINE>} finally {<NEW_LINE>evaluator.restore(savepoint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>public boolean dependsOn(Hierarchy hierarchy) {<NEW_LINE>return anyDependsButFirst(getCalcs(), hierarchy);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | (call.getArg(0)); |
1,780,535 | public static BarPlot of(int[] data, int k, boolean prob, Color color) {<NEW_LINE>double[][] hist = smile.math.Histogram.of(data, k);<NEW_LINE>// The number of bins may be extended to cover all data.<NEW_LINE>k = hist[0].length;<NEW_LINE>double[][] freq = new double[k][2];<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>freq[i][0] = (hist[0][i] + hist[1][i]) / 2.0;<NEW_LINE>freq[i][1] = hist[2][i];<NEW_LINE>}<NEW_LINE>if (prob) {<NEW_LINE>double n = data.length;<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>freq<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new BarPlot(new Bar(freq, width(freq), color));<NEW_LINE>} | [i][1] /= n; |
1,346,791 | private void updateContext(Map<String, Object> value) {<NEW_LINE>if (value == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object values = value.get("values");<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>if (values instanceof ContextEntity) {<NEW_LINE>map = ((ContextEntity) values).getContextMap();<NEW_LINE>} else if (values instanceof Model) {<NEW_LINE>map = Mapper.toMap(value);<NEW_LINE>} else if (values instanceof Map) {<NEW_LINE>map = (Map<String, Object>) values;<NEW_LINE>}<NEW_LINE>values = value.get("attrs");<NEW_LINE>if (values instanceof Map) {<NEW_LINE>for (Object key : ((Map<String, Object>) values).keySet()) {<NEW_LINE>String name = key.toString();<NEW_LINE>Map<String, Object> attrs = (Map<String, Object>) ((Map<String, Object>) values).get(key);<NEW_LINE>if (attrs.containsKey("value")) {<NEW_LINE>map.put(name, attrs.get("value"));<NEW_LINE>}<NEW_LINE>if (attrs.containsKey("value:set")) {<NEW_LINE>map.put(name, attrs.get("value:set"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>context.putAll(map);<NEW_LINE>} | map = new HashMap<>(); |
1,414,933 | // Display header<NEW_LINE>private static void header(Comparable[] array) {<NEW_LINE>StdDraw.setPenColor(StdDraw.BLACK);<NEW_LINE>StdDraw.text(array.length <MASK><NEW_LINE>for (int i = 0; i < array.length; i++) {<NEW_LINE>StdDraw.text(i, -2, String.valueOf(i));<NEW_LINE>}<NEW_LINE>StdDraw.text(-2.50, -2, "i");<NEW_LINE>StdDraw.text(-1.25, -2, "j");<NEW_LINE>StdDraw.setPenColor(StdDraw.BOOK_RED);<NEW_LINE>StdDraw.line(-4, -1.65, array.length - 0.5, -1.65);<NEW_LINE>StdDraw.setPenColor(StdDraw.BLACK);<NEW_LINE>for (int i = 0; i < array.length; i++) {<NEW_LINE>StdDraw.text(i, -1, String.format("%.1f", Double.parseDouble(String.valueOf(array[i]))));<NEW_LINE>}<NEW_LINE>} | / 2.0, -3, "array[ ]"); |
1,462,603 | private void initComponents() {<NEW_LINE>lblAddress1 = new Label(Msg.getElement(Env.getCtx(), "Address1"));<NEW_LINE>lblAddress1.setStyle(LABEL_STYLE);<NEW_LINE>lblAddress2 = new Label(Msg.getElement(Env.getCtx(), "Address2"));<NEW_LINE>lblAddress2.setStyle(LABEL_STYLE);<NEW_LINE>lblAddress3 = new Label(Msg.getElement(Env.getCtx(), "Address3"));<NEW_LINE>lblAddress3.setStyle(LABEL_STYLE);<NEW_LINE>lblAddress4 = new Label(Msg.getElement(Env.getCtx(), "Address4"));<NEW_LINE>lblAddress4.setStyle(LABEL_STYLE);<NEW_LINE>lblCity = new Label(Msg.getMsg(Env.getCtx(), "City"));<NEW_LINE>lblCity.setStyle(LABEL_STYLE);<NEW_LINE>lblZip = new Label(Msg.getMsg(Env.getCtx(), "Postal"));<NEW_LINE>lblZip.setStyle(LABEL_STYLE);<NEW_LINE>lblRegion = new Label(Msg.getMsg(Env.getCtx(), "Region"));<NEW_LINE>lblRegion.setStyle(LABEL_STYLE);<NEW_LINE>lblPostal = new Label(Msg.getMsg(Env.getCtx(), "Postal"));<NEW_LINE>lblPostal.setStyle(LABEL_STYLE);<NEW_LINE>lblPostalAdd = new Label(Msg.getMsg(Env<MASK><NEW_LINE>lblPostalAdd.setStyle(LABEL_STYLE);<NEW_LINE>lblCountry = new Label(Msg.getMsg(Env.getCtx(), "Country"));<NEW_LINE>lblCountry.setStyle(LABEL_STYLE);<NEW_LINE>txtAddress1 = new Textbox();<NEW_LINE>txtAddress1.setCols(20);<NEW_LINE>txtAddress2 = new Textbox();<NEW_LINE>txtAddress2.setCols(20);<NEW_LINE>txtAddress3 = new Textbox();<NEW_LINE>txtAddress3.setCols(20);<NEW_LINE>txtAddress4 = new Textbox();<NEW_LINE>txtAddress4.setCols(20);<NEW_LINE>// autocomplete City<NEW_LINE>txtCity = new WAutoCompleterCity(m_WindowNo);<NEW_LINE>txtCity.setCols(20);<NEW_LINE>txtCity.setAutodrop(true);<NEW_LINE>txtCity.setAutocomplete(true);<NEW_LINE>txtCity.addEventListener(Events.ON_CHANGING, this);<NEW_LINE>// txtCity<NEW_LINE>txtPostal = new Textbox();<NEW_LINE>txtPostal.setCols(20);<NEW_LINE>txtPostalAdd = new Textbox();<NEW_LINE>txtPostalAdd.setCols(20);<NEW_LINE>lstRegion = new Listbox();<NEW_LINE>lstRegion.setMold("select");<NEW_LINE>lstRegion.setWidth("154px");<NEW_LINE>lstRegion.setRows(0);<NEW_LINE>lstCountry = new Listbox();<NEW_LINE>lstCountry.setMold("select");<NEW_LINE>lstCountry.setWidth("154px");<NEW_LINE>lstCountry.setRows(0);<NEW_LINE>btnOk = new Button();<NEW_LINE>btnOk.setImage("/images/Ok16.png");<NEW_LINE>btnOk.addEventListener(Events.ON_CLICK, this);<NEW_LINE>btnCancel = new Button();<NEW_LINE>btnCancel.setImage("/images/Cancel16.png");<NEW_LINE>btnCancel.addEventListener(Events.ON_CLICK, this);<NEW_LINE>toLink = new Button(TO_LINK);<NEW_LINE>toLink.setImage("/images/Online10.png");<NEW_LINE>toLink.addEventListener(Events.ON_CLICK, this);<NEW_LINE>toRoute = new Button(TO_ROUTE);<NEW_LINE>toRoute.setImage("/images/Route10.png");<NEW_LINE>toRoute.addEventListener(Events.ON_CLICK, this);<NEW_LINE>mainPanel = GridFactory.newGridLayout();<NEW_LINE>mainPanel.setStyle("padding:5px");<NEW_LINE>} | .getCtx(), "PostalAdd")); |
1,373,873 | public void onEndPage(PdfWriter writer, com.itextpdf.text.Document document) {<NEW_LINE>PdfContentByte cb = writer.getDirectContent();<NEW_LINE>cb.saveState();<NEW_LINE>Date date = new Date();<NEW_LINE>String textLeft = "Page " + writer.getPageNumber() + " of ";<NEW_LINE>String textRight = date + " " + "Page " + writer.getPageNumber() + " of ";<NEW_LINE>float textBase = document.bottom() - 20;<NEW_LINE>float textSizeLeft = helv.getWidthPoint(textLeft, 8);<NEW_LINE>float textSizeRigth = <MASK><NEW_LINE>cb.beginText();<NEW_LINE>cb.setFontAndSize(helv, 8);<NEW_LINE>if ((writer.getPageNumber() % 2) == 1) {<NEW_LINE>cb.setTextMatrix(document.left(), textBase);<NEW_LINE>cb.showText(textLeft + " " + date);<NEW_LINE>cb.endText();<NEW_LINE>cb.addTemplate(total, document.left() + textSizeLeft, textBase);<NEW_LINE>} else {<NEW_LINE>float adjust = helv.getWidthPoint("", 8);<NEW_LINE>cb.setTextMatrix(document.right() - textSizeRigth - adjust, textBase);<NEW_LINE>cb.showText(textRight);<NEW_LINE>cb.endText();<NEW_LINE>cb.addTemplate(total, document.right() - adjust, textBase);<NEW_LINE>}<NEW_LINE>cb.restoreState();<NEW_LINE>} | helv.getWidthPoint(textRight, 8); |
1,058,348 | public TcpServer<R, W> start(final ConnectionHandler<R, W> connectionHandler) {<NEW_LINE>if (!serverStateRef.compareAndSet(ServerStatus.Created, ServerStatus.Starting)) {<NEW_LINE>throw new IllegalStateException("Server already started");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Action1<ChannelPipeline> handlerFactory = new Action1<ChannelPipeline>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void call(ChannelPipeline pipeline) {<NEW_LINE>TcpServerState<R, W> tcpState = (TcpServerState<R, W>) state;<NEW_LINE>TcpServerConnectionToChannelBridge.addToPipeline(pipeline, connectionHandler, tcpState.getEventPublisher(), tcpState.isSecure());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final TcpServerState<R, W> newState = (TcpServerState<R, W>) state.pipelineConfigurator(handlerFactory);<NEW_LINE>bindFuture = newState.getBootstrap().bind(newState.getServerAddress()).sync();<NEW_LINE>if (!bindFuture.isSuccess()) {<NEW_LINE>throw new RuntimeException(bindFuture.cause());<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>// It will come here only if this was the thread that transitioned to Starting<NEW_LINE><MASK><NEW_LINE>logger.info("Rx server started at port: " + getServerPort());<NEW_LINE>return this;<NEW_LINE>} | serverStateRef.set(ServerStatus.Started); |
1,058,878 | protected String formatPartlyValidTooltip(java.util.List<DeckValidatorError> sortedErrorsList) {<NEW_LINE>return sortedErrorsList.stream().reduce("<html><body>" + "<p>Deck is <span style='color:#b8860b;font-weight:bold;'>PARTLY VALID</span></p>" + "<u>The following problems have been found (click to select problem cards):</u>" + "<br>" + "<table style=\"table-layout: fixed; width: " + TOOLTIP_TABLE_WIDTH + "px\">", (str, error) -> String.format("%s<tr><td style=\"word-wrap: break-word\"><b>%s</b></td><td style=\"word-wrap: break-word\">%s</td></tr>", str, escapeHtml(error.getGroup()), escapeHtml(error.getMessage())), <MASK><NEW_LINE>} | String::concat) + "</table>" + "</body></html>"; |
74,179 | protected final OperatorFactory createTableScanOperator(int operatorId, PlanNodeId planNodeId, String tableName, String... columnNames) {<NEW_LINE>checkArgument(session.getCatalog().isPresent(), "catalog not set");<NEW_LINE>checkArgument(session.getSchema().isPresent(), "schema not set");<NEW_LINE>// look up the table<NEW_LINE>Metadata metadata = localQueryRunner.getMetadata();<NEW_LINE>QualifiedObjectName qualifiedTableName = new QualifiedObjectName(session.getCatalog().get(), session.getSchema().get(), tableName);<NEW_LINE>TableHandle tableHandle = metadata.getTableHandle(session, qualifiedTableName).orElse(null);<NEW_LINE>checkArgument(tableHandle != null, "Table %s does not exist", qualifiedTableName);<NEW_LINE>// lookup the columns<NEW_LINE>Map<String, ColumnHandle> allColumnHandles = metadata.getColumnHandles(session, tableHandle);<NEW_LINE>ImmutableList.Builder<ColumnHandle> columnHandlesBuilder = ImmutableList.builder();<NEW_LINE>for (String columnName : columnNames) {<NEW_LINE>ColumnHandle columnHandle = allColumnHandles.get(columnName);<NEW_LINE>checkArgument(columnHandle != null, "Table %s does not have a column %s", tableName, columnName);<NEW_LINE>columnHandlesBuilder.add(columnHandle);<NEW_LINE>}<NEW_LINE>List<ColumnHandle> columnHandles = columnHandlesBuilder.build();<NEW_LINE>Split split = getLocalQuerySplit(session, tableHandle);<NEW_LINE>return new OperatorFactory() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Operator createOperator(DriverContext driverContext) {<NEW_LINE>OperatorContext operatorContext = driverContext.<MASK><NEW_LINE>ConnectorPageSource pageSource = localQueryRunner.getPageSourceManager().createPageSource(session, split, tableHandle.withDynamicFilter(TupleDomain::all), columnHandles);<NEW_LINE>return new PageSourceOperator(pageSource, operatorContext);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void noMoreOperators() {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OperatorFactory duplicate() {<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | addOperatorContext(operatorId, planNodeId, "BenchmarkSource"); |
412,493 | private List<PrivateTransactionWithMetadata> retrievePrivateTransactions(final Bytes32 privacyGroupId, final List<PrivateTransactionMetadata> privateTransactionMetadataList, final String privacyUserId) {<NEW_LINE>final ArrayList<PrivateTransactionWithMetadata> privateTransactions = new ArrayList<>();<NEW_LINE>privateStateStorage.getAddDataKey(privacyGroupId).ifPresent(key -> privateTransactions.addAll(retrieveAddBlob(<MASK><NEW_LINE>for (int i = privateTransactions.size(); i < privateTransactionMetadataList.size(); i++) {<NEW_LINE>final PrivateTransactionMetadata privateTransactionMetadata = privateTransactionMetadataList.get(i);<NEW_LINE>final Transaction privateMarkerTransaction = blockchain.getTransactionByHash(privateTransactionMetadata.getPrivateMarkerTransactionHash()).orElseThrow();<NEW_LINE>final ReceiveResponse receiveResponse = retrieveTransaction(privateMarkerTransaction.getPayload().slice(0, 32).toBase64String(), privacyUserId);<NEW_LINE>final BytesValueRLPInput input = new BytesValueRLPInput(Bytes.fromBase64String(new String(receiveResponse.getPayload(), UTF_8)), false);<NEW_LINE>input.enterList();<NEW_LINE>privateTransactions.add(new PrivateTransactionWithMetadata(PrivateTransaction.readFrom(input), privateTransactionMetadata));<NEW_LINE>input.leaveListLenient();<NEW_LINE>}<NEW_LINE>return privateTransactions;<NEW_LINE>} | key.toBase64String()))); |
131,781 | public void delete(final Role role) throws DotDataException, DotStateException {<NEW_LINE>final Role roleFromDB = loadRoleById(role.getId());<NEW_LINE>for (final String uid : roleFactory.findUserIdsForRole(role, true)) {<NEW_LINE>CacheLocator.getRoleCache().remove(uid);<NEW_LINE>}<NEW_LINE>if (roleFromDB.isLocked()) {<NEW_LINE>throw new DotStateException(String.format("Role %s (%s) is locked. It cannot be deleted.", role.getName(), role.getId()));<NEW_LINE>}<NEW_LINE>if (roleFromDB.isSystem()) {<NEW_LINE>throw new DotStateException(String.format("Role %s (%s) is a System Role. It cannot be deleted.", role.getName(), role.getId()));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>roleFromDB.setEditPermissions(true);<NEW_LINE>roleFromDB.setEditLayouts(true);<NEW_LINE>roleFromDB.setEditUsers(true);<NEW_LINE>roleFactory.save(roleFromDB);<NEW_LINE>final List<User> users = findUsersForRole(roleFromDB.getId());<NEW_LINE>if (users != null) {<NEW_LINE>for (final User u : users) {<NEW_LINE>removeRoleFromUser(roleFromDB, u);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>findDependentWorkflowActions(role);<NEW_LINE>final PermissionAPI permAPI = APILocator.getPermissionAPI();<NEW_LINE>permAPI.removePermissionsByRole(role.getId());<NEW_LINE>final LayoutAPI layoutAPI = APILocator.getLayoutAPI();<NEW_LINE>for (final Layout layout : layoutAPI.loadLayoutsForRole(role)) {<NEW_LINE>removeLayoutFromRole(layout, role);<NEW_LINE>}<NEW_LINE>SecurityLogger.logInfo(this.getClass(), "Deleting role '" + role.getName() + "': " + role);<NEW_LINE>roleFactory.delete(role);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>final String errorMsg = null != role ? String.format("Error deleting Role '%s' (%s): %s", role.getName(), role.getId(), e.getMessage()) : String.format(<MASK><NEW_LINE>Logger.error(this.getClass(), errorMsg, e);<NEW_LINE>throw new DotDataException(errorMsg);<NEW_LINE>}<NEW_LINE>} | "Error deleting Role: %s", e.getMessage()); |
95,911 | // Subroutine to register dependents<NEW_LINE>private void registerDependents(JMFType type) throws JMFSchemaIdException {<NEW_LINE>if (type instanceof JMFDynamicType) {<NEW_LINE>JMFSchema schema = ((JMFDynamicType) type).getExpectedSchema();<NEW_LINE>if (schema != null)<NEW_LINE>registerAll(schema);<NEW_LINE>} else if (type instanceof JMFRepeatedType)<NEW_LINE>registerDependents(((JMFRepeatedType<MASK><NEW_LINE>else if (type instanceof JMFTupleType) {<NEW_LINE>JMFTupleType tup = (JMFTupleType) type;<NEW_LINE>for (int i = 0; i < tup.getFieldCount(); i++) registerDependents(tup.getField(i));<NEW_LINE>} else if (type instanceof JMFVariantType) {<NEW_LINE>JMFVariantType var = (JMFVariantType) type;<NEW_LINE>for (int i = 0; i < var.getCaseCount(); i++) registerDependents(var.getCase(i));<NEW_LINE>}<NEW_LINE>// else there are no dependents and we do nothing<NEW_LINE>} | ) type).getItemType()); |
1,181,705 | public static DescribeCasterLayoutsResponse unmarshall(DescribeCasterLayoutsResponse describeCasterLayoutsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeCasterLayoutsResponse.setRequestId(_ctx.stringValue("DescribeCasterLayoutsResponse.RequestId"));<NEW_LINE>describeCasterLayoutsResponse.setTotal(_ctx.integerValue("DescribeCasterLayoutsResponse.Total"));<NEW_LINE>List<Layout> layouts = new ArrayList<Layout>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCasterLayoutsResponse.Layouts.Length"); i++) {<NEW_LINE>Layout layout = new Layout();<NEW_LINE>layout.setLayoutId(_ctx.stringValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].LayoutId"));<NEW_LINE>List<String> mixList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].MixList.Length"); j++) {<NEW_LINE>mixList.add(_ctx.stringValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].MixList[" + j + "]"));<NEW_LINE>}<NEW_LINE>layout.setMixList(mixList);<NEW_LINE>List<String> blendList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].BlendList.Length"); j++) {<NEW_LINE>blendList.add(_ctx.stringValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].BlendList[" + j + "]"));<NEW_LINE>}<NEW_LINE>layout.setBlendList(blendList);<NEW_LINE>List<VideoLayer> videoLayers <MASK><NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].VideoLayers.Length"); j++) {<NEW_LINE>VideoLayer videoLayer = new VideoLayer();<NEW_LINE>videoLayer.setWidthNormalized(_ctx.floatValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].VideoLayers[" + j + "].WidthNormalized"));<NEW_LINE>videoLayer.setFixedDelayDuration(_ctx.integerValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].VideoLayers[" + j + "].FixedDelayDuration"));<NEW_LINE>videoLayer.setHeightNormalized(_ctx.floatValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].VideoLayers[" + j + "].HeightNormalized"));<NEW_LINE>videoLayer.setFillMode(_ctx.stringValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].VideoLayers[" + j + "].FillMode"));<NEW_LINE>videoLayer.setPositionRefer(_ctx.stringValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].VideoLayers[" + j + "].PositionRefer"));<NEW_LINE>List<Float> positionNormalizeds = new ArrayList<Float>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].VideoLayers[" + j + "].PositionNormalizeds.Length"); k++) {<NEW_LINE>positionNormalizeds.add(_ctx.floatValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].VideoLayers[" + j + "].PositionNormalizeds[" + k + "]"));<NEW_LINE>}<NEW_LINE>videoLayer.setPositionNormalizeds(positionNormalizeds);<NEW_LINE>videoLayers.add(videoLayer);<NEW_LINE>}<NEW_LINE>layout.setVideoLayers(videoLayers);<NEW_LINE>List<AudioLayer> audioLayers = new ArrayList<AudioLayer>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].AudioLayers.Length"); j++) {<NEW_LINE>AudioLayer audioLayer = new AudioLayer();<NEW_LINE>audioLayer.setVolumeRate(_ctx.floatValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].AudioLayers[" + j + "].VolumeRate"));<NEW_LINE>audioLayer.setFixedDelayDuration(_ctx.integerValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].AudioLayers[" + j + "].FixedDelayDuration"));<NEW_LINE>audioLayer.setValidChannel(_ctx.stringValue("DescribeCasterLayoutsResponse.Layouts[" + i + "].AudioLayers[" + j + "].ValidChannel"));<NEW_LINE>audioLayers.add(audioLayer);<NEW_LINE>}<NEW_LINE>layout.setAudioLayers(audioLayers);<NEW_LINE>layouts.add(layout);<NEW_LINE>}<NEW_LINE>describeCasterLayoutsResponse.setLayouts(layouts);<NEW_LINE>return describeCasterLayoutsResponse;<NEW_LINE>} | = new ArrayList<VideoLayer>(); |
1,582,229 | private void saveWorkflowTaskInternal(final WorkflowTask task, final WorkflowProcessor processor, final boolean doIndex) throws DotDataException {<NEW_LINE>if (doIndex) {<NEW_LINE>this.saveWorkflowTask(task);<NEW_LINE>} else {<NEW_LINE>this.saveWorkflowTaskWithoutIndexing(task);<NEW_LINE>}<NEW_LINE>final WorkflowHistory history = new WorkflowHistory();<NEW_LINE>history.setWorkflowtaskId(task.getId());<NEW_LINE>history.setActionId(processor.getAction().getId());<NEW_LINE>history<MASK><NEW_LINE>history.setMadeBy(processor.getUser().getUserId());<NEW_LINE>history.setStepId(processor.getNextStep().getId());<NEW_LINE>final String comment = (UtilMethods.isSet(processor.getWorkflowMessage())) ? processor.getWorkflowMessage() : StringPool.BLANK;<NEW_LINE>final String nextAssignName = (UtilMethods.isSet(processor.getNextAssign())) ? processor.getNextAssign().getName() : StringPool.BLANK;<NEW_LINE>try {<NEW_LINE>String description = LanguageUtil.format(processor.getUser().getLocale(), "workflow.history.description", new String[] { processor.getUser().getFullName(), processor.getAction().getName(), processor.getNextStep().getName(), nextAssignName, comment }, false);<NEW_LINE>if (processor.getContextMap().containsKey("type") && WorkflowHistoryType.APPROVAL == processor.getContextMap().get("type")) {<NEW_LINE>description = "{\"description\":'" + description + "', \"type\":'" + WorkflowHistoryType.APPROVAL.name() + "', \"state\":'" + WorkflowHistoryState.NONE.name() + "\" }";<NEW_LINE>}<NEW_LINE>history.setChangeDescription(description);<NEW_LINE>} catch (LanguageException e) {<NEW_LINE>Logger.error(WorkflowAPIImpl.class, e.getMessage());<NEW_LINE>Logger.debug(WorkflowAPIImpl.class, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>saveWorkflowHistory(history);<NEW_LINE>} | .setCreationDate(new Date()); |
95,085 | final DeleteVirtualMFADeviceResult executeDeleteVirtualMFADevice(DeleteVirtualMFADeviceRequest deleteVirtualMFADeviceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteVirtualMFADeviceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteVirtualMFADeviceRequest> request = null;<NEW_LINE>Response<DeleteVirtualMFADeviceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteVirtualMFADeviceRequestMarshaller().marshall(super.beforeMarshalling(deleteVirtualMFADeviceRequest));<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, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteVirtualMFADevice");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteVirtualMFADeviceResult> responseHandler = new StaxResponseHandler<DeleteVirtualMFADeviceResult>(new DeleteVirtualMFADeviceResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,243,022 | public static CompIntFloatVector mergeSparseFloatCompVector(IndexGetParam param, List<PartitionGetResult> partResults) {<NEW_LINE>Map<PartitionKey, PartitionGetResult> partKeyToResultMap = mapPartKeyToResult(partResults);<NEW_LINE>List<PartitionKey> partKeys = getSortedPartKeys(param.matrixId, param.getRowId());<NEW_LINE>MatrixMeta meta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(param.matrixId);<NEW_LINE>int dim = (int) meta.getColNum();<NEW_LINE>int subDim = (int) meta.getBlockColNum();<NEW_LINE><MASK><NEW_LINE>IntFloatVector[] splitVecs = new IntFloatVector[size];<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (param.getPartKeyToIndexesMap().containsKey(partKeys.get(i))) {<NEW_LINE>float[] values = ((IndexPartGetFloatResult) partKeyToResultMap.get(partKeys.get(i))).getValues();<NEW_LINE>int[] indices = param.getPartKeyToIndexesMap().get(partKeys.get(i));<NEW_LINE>transformIndices(indices, partKeys.get(i));<NEW_LINE>splitVecs[i] = VFactory.sparseFloatVector(subDim, indices, values);<NEW_LINE>} else {<NEW_LINE>splitVecs[i] = VFactory.sparseFloatVector(subDim, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CompIntFloatVector vector = VFactory.compIntFloatVector(dim, splitVecs, subDim);<NEW_LINE>vector.setMatrixId(param.getMatrixId());<NEW_LINE>vector.setRowId(param.getRowId());<NEW_LINE>return vector;<NEW_LINE>} | int size = partKeys.size(); |
517,824 | public UserWithPasswordAndQRCode insertUser(@RequestBody UserModification userModification, @RequestParam("baseUrl") String baseUrl, Principal principal) {<NEW_LINE>Role requested = Role.valueOf(userModification.getRole());<NEW_LINE>Validate.isTrue(userManager.getAvailableRoles(principal.getName()).stream().anyMatch(requested::equals), String.format("Requested role %s is not available for current user", userModification.getRole()));<NEW_LINE>User.Type type = userModification.getType();<NEW_LINE>UserWithPassword userWithPassword = userManager.insertUser(userModification.getOrganizationId(), userModification.getUsername(), userModification.getFirstName(), userModification.getLastName(), userModification.getEmailAddress(), requested, type == null ? User.Type.INTERNAL : type, userModification.getValidToAsDateTime(), userModification.getDescription());<NEW_LINE>String qrCode = type != User.Type.API_KEY ? Base64.getEncoder().encodeToString(generateQRCode(userWithPassword, baseUrl)) : null;<NEW_LINE><MASK><NEW_LINE>} | return new UserWithPasswordAndQRCode(userWithPassword, qrCode); |
685,195 | public UpdateDomainConfigurationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateDomainConfigurationResult updateDomainConfigurationResult = new UpdateDomainConfigurationResult();<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 updateDomainConfigurationResult;<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("domainConfigurationName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateDomainConfigurationResult.setDomainConfigurationName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("domainConfigurationArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateDomainConfigurationResult.setDomainConfigurationArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return updateDomainConfigurationResult;<NEW_LINE>} | class).unmarshall(context)); |
1,723,566 | private void loadNode977() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_DeleteSubscriptionsCount, new QualifiedName(0, "DeleteSubscriptionsCount"), new LocalizedText("en", "DeleteSubscriptionsCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.ServiceCounterDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_DeleteSubscriptionsCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_DeleteSubscriptionsCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics_DeleteSubscriptionsCount, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionDiagnostics.expanded(), false));<NEW_LINE><MASK><NEW_LINE>} | this.nodeManager.addNode(node); |
45,994 | public boolean tryOnNext(T t) {<NEW_LINE>if (done) {<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>K k;<NEW_LINE>try {<NEW_LINE>k = Objects.requireNonNull(keyExtractor.apply(t), "The distinct extractor returned a null value.");<NEW_LINE>} catch (Throwable e) {<NEW_LINE>onError(Operators.onOperatorError(s, e, t, ctx));<NEW_LINE>Operators.onDiscard(t, ctx);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (null == lastKey) {<NEW_LINE>lastKey = k;<NEW_LINE>actual.onNext(t);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>boolean equiv;<NEW_LINE>try {<NEW_LINE>equiv = keyComparator.test(lastKey, k);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>onError(Operators.onOperatorError(s, e, t, ctx));<NEW_LINE>Operators.onDiscard(t, ctx);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (equiv) {<NEW_LINE>Operators.onDiscard(t, ctx);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>lastKey = k;<NEW_LINE>actual.onNext(t);<NEW_LINE>return true;<NEW_LINE>} | Operators.onNextDropped(t, ctx); |
163,109 | private MInOut createReceipt(MOrderLine orderLine, MWMInOutBound outbound) {<NEW_LINE>MOrder order = orderLine.getParent();<NEW_LINE>MDocType orderDocumentType = MDocType.get(getCtx(), order.getC_DocTypeTarget_ID());<NEW_LINE>int docTypeId = 0;<NEW_LINE>if (orderDocumentType.getC_DocTypeShipment_ID() > 0) {<NEW_LINE>docTypeId = orderDocumentType.getC_DocTypeShipment_ID();<NEW_LINE>} else {<NEW_LINE>docTypeId = MDocType.getDocType(MDocType.DOCBASETYPE_MaterialReceipt, orderLine.getAD_Org_ID());<NEW_LINE>}<NEW_LINE>MInOut shipment = new MInOut(order, docTypeId, getDateTrx());<NEW_LINE>shipment.setIsSOTrx(false);<NEW_LINE>shipment.setM_Shipper_ID(outbound.getM_Shipper_ID());<NEW_LINE>shipment.<MASK><NEW_LINE>shipment.setFreightCostRule(outbound.getFreightCostRule());<NEW_LINE>shipment.setFreightAmt(outbound.getFreightAmt());<NEW_LINE>shipment.saveEx();<NEW_LINE>return shipment;<NEW_LINE>} | setM_FreightCategory_ID(outbound.getM_FreightCategory_ID()); |
940,822 | public void onMessage(Message inMessage) {<NEW_LINE>// disposable exchange, swapped with real Exchange on correlation<NEW_LINE>inMessage.setExchange(new ExchangeImpl());<NEW_LINE>inMessage.getExchange().put(Bus.class, bus);<NEW_LINE>inMessage.put(DECOUPLED_CHANNEL_MESSAGE, Boolean.TRUE);<NEW_LINE>// REVISIT: how to get response headers?<NEW_LINE>// inMessage.put(Message.PROTOCOL_HEADERS, req.getXXX());<NEW_LINE>Headers.getSetProtocolHeaders(inMessage);<NEW_LINE>inMessage.put(Message.RESPONSE_CODE, HttpURLConnection.HTTP_OK);<NEW_LINE>// remove server-specific properties<NEW_LINE><MASK><NEW_LINE>inMessage.remove(AbstractHTTPDestination.HTTP_RESPONSE);<NEW_LINE>inMessage.remove(Message.ASYNC_POST_RESPONSE_DISPATCH);<NEW_LINE>// cache this inputstream since it's defer to use in case of async<NEW_LINE>try {<NEW_LINE>InputStream in = inMessage.getContent(InputStream.class);<NEW_LINE>if (in != null) {<NEW_LINE>CachedOutputStream cos = new CachedOutputStream();<NEW_LINE>IOUtils.copy(in, cos);<NEW_LINE>inMessage.setContent(InputStream.class, cos.getInputStream());<NEW_LINE>}<NEW_LINE>incomingObserver.onMessage(inMessage);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | inMessage.remove(AbstractHTTPDestination.HTTP_REQUEST); |
241,912 | public void handleDatastream(List<DatastreamGroup> datastreamGroups) {<NEW_LINE>if (!_enablePartitionAssignment) {<NEW_LINE>// We do not need to handle the datastreamGroup if there is no callback registered<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (_partitionChangeCallback == null) {<NEW_LINE>throw new DatastreamRuntimeException("Partition change callback is not defined");<NEW_LINE>}<NEW_LINE>LOG.info("handleDatastream: original datastream groups: {}, received datastream group {}", <MASK><NEW_LINE>List<String> dgNames = datastreamGroups.stream().map(DatastreamGroup::getName).collect(Collectors.toList());<NEW_LINE>List<String> obsoleteDgs = new ArrayList<>(_partitionDiscoveryThreadMap.keySet());<NEW_LINE>obsoleteDgs.removeAll(dgNames);<NEW_LINE>for (String name : obsoleteDgs) {<NEW_LINE>Optional.ofNullable(_partitionDiscoveryThreadMap.remove(name)).ifPresent(PartitionDiscoveryThread::shutdown);<NEW_LINE>}<NEW_LINE>datastreamGroups.forEach(datastreamGroup -> {<NEW_LINE>String datastreamGroupName = datastreamGroup.getName();<NEW_LINE>PartitionDiscoveryThread partitionDiscoveryThread;<NEW_LINE>if (!_partitionDiscoveryThreadMap.containsKey(datastreamGroupName)) {<NEW_LINE>partitionDiscoveryThread = new PartitionDiscoveryThread(datastreamGroup);<NEW_LINE>partitionDiscoveryThread.start();<NEW_LINE>_partitionDiscoveryThreadMap.put(datastreamGroupName, partitionDiscoveryThread);<NEW_LINE>LOG.info("PartitionDiscoveryThread for {} registered", datastreamGroupName);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>LOG.info("handleDatastream: new datastream groups: {}", _partitionDiscoveryThreadMap.keySet());<NEW_LINE>} | _partitionDiscoveryThreadMap.keySet(), datastreamGroups); |
1,247,345 | protected Long handleInternally(DataObject content) {<NEW_LINE>long guildId = content.getLong("guild_id");<NEW_LINE>if (api.getGuildSetupController().isLocked(guildId))<NEW_LINE>return guildId;<NEW_LINE>final long threadId = content.getLong("id");<NEW_LINE>ThreadChannelImpl thread = (ThreadChannelImpl) getJDA().getThreadChannelById(threadId);<NEW_LINE>if (thread == null) {<NEW_LINE>getJDA().getEventCache().cache(EventCache.Type.CHANNEL, threadId, responseNumber, allContent, this::handle);<NEW_LINE>EventCache.LOG.debug("THREAD_MEMBER_UPDATE attempted to update a thread that does not exist. JSON: {}", content);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Based on the docs it is expected that we will only ever receive THREAD_MEMBER_UPDATE when Discord needs to inform<NEW_LINE>// us that we are a member of a ThreadChannels that we might not have in memory. Currently this only happens<NEW_LINE>// for ThreadChannels that get unarchived.<NEW_LINE>// Details available at: https://discord.com/developers/docs/topics/threads#unarchiving-a-thread<NEW_LINE>long <MASK><NEW_LINE>if (userId != getJDA().getSelfUser().getIdLong()) {<NEW_LINE>JDAImpl.LOG.warn("Received a THREAD_MEMBER_UPDATE for a user that isn't the current bot user. " + "This validates assumptions that THREAD_MEMBER_UPDATE would ONLY be for the current bot user. " + "Skipping this dispatch for now. This should be reported as a bug." + "\nDetails: {}", content);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>CacheView.SimpleCacheView<ThreadMember> view = thread.getThreadMemberView();<NEW_LINE>try (UnlockHook lock = view.writeLock()) {<NEW_LINE>// We might have still had the ThreadChannel in memory, so our ThreadMember might still exist. Do an existence check.<NEW_LINE>ThreadMember threadMember = view.getMap().get(userId);<NEW_LINE>if (threadMember == null) {<NEW_LINE>threadMember = api.getEntityBuilder().createThreadMember(thread, thread.getGuild().getSelfMember(), content);<NEW_LINE>view.getMap().put(threadMember.getIdLong(), threadMember);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | userId = content.getLong("user_id"); |
1,405,178 | public <A> int choose(A options, ArrayAdapter<? extends SpatialComparable, A> getter, SpatialComparable obj, int height, int depth) {<NEW_LINE>final int size = getter.size(options);<NEW_LINE>assert (size > 0) : "Choose from empty set?";<NEW_LINE>// R*-Tree: overlap increase for leaves.<NEW_LINE>int best = -1;<NEW_LINE>double least_overlap = Double.POSITIVE_INFINITY;<NEW_LINE>double least_areainc = Double.POSITIVE_INFINITY;<NEW_LINE>double least_area = Double.POSITIVE_INFINITY;<NEW_LINE>// least overlap increase, on reduced candidate set:<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>// Existing object and extended rectangle:<NEW_LINE>SpatialComparable entry = getter.get(options, i);<NEW_LINE>HyperBoundingBox mbr = SpatialUtil.union(entry, obj);<NEW_LINE>// Compute relative overlap increase.<NEW_LINE>double overlap_wout = 0.0;<NEW_LINE>double overlap_with = 0.0;<NEW_LINE>for (int k = 0; k < size; k++) {<NEW_LINE>if (i != k) {<NEW_LINE>SpatialComparable other = getter.get(options, k);<NEW_LINE>overlap_wout += SpatialUtil.relativeOverlap(entry, other);<NEW_LINE>overlap_with += SpatialUtil.relativeOverlap(mbr, other);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double inc_overlap = overlap_with - overlap_wout;<NEW_LINE>if (inc_overlap < least_overlap) {<NEW_LINE>final double area = SpatialUtil.volume(entry);<NEW_LINE>final double inc_area = SpatialUtil.volume(mbr) - area;<NEW_LINE>// Volume increase and overlap increase:<NEW_LINE>least_overlap = inc_overlap;<NEW_LINE>least_areainc = inc_area;<NEW_LINE>least_area = area;<NEW_LINE>best = i;<NEW_LINE>} else if (inc_overlap == least_overlap) {<NEW_LINE>final double area = SpatialUtil.volume(entry);<NEW_LINE>final double inc_area = <MASK><NEW_LINE>if (inc_area < least_areainc || (inc_area == least_areainc && area < least_area)) {<NEW_LINE>least_overlap = inc_overlap;<NEW_LINE>least_areainc = inc_area;<NEW_LINE>least_area = area;<NEW_LINE>best = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert (best > -1) : "No split found? Volume outside of double precision?";<NEW_LINE>return best;<NEW_LINE>} | SpatialUtil.volume(mbr) - area; |
1,346,639 | private Model mapModel(springfox.documentation.schema.Model source) {<NEW_LINE>ModelImpl model = new ModelImpl().description(source.getDescription()).discriminator(source.getDiscriminator()).example(source.getExample()).name(source.getName()).xml(mapXml(source.getXml()));<NEW_LINE>SortedMap<String, springfox.documentation.schema.ModelProperty> sortedProperties = sort(source.getProperties());<NEW_LINE>Map<String, Property> modelProperties = mapProperties(sortedProperties);<NEW_LINE>model.setProperties(modelProperties);<NEW_LINE>Stream<String> requiredFields = source.getProperties().values().stream().filter(springfox.documentation.schema.ModelProperty::isRequired).map(springfox.documentation.schema.ModelProperty::getName);<NEW_LINE>model.setRequired(requiredFields.collect(toList()));<NEW_LINE>model.setSimple(false);<NEW_LINE>model.setType(ModelImpl.OBJECT);<NEW_LINE>model.setTitle(source.getName());<NEW_LINE>if (isMapType(source.getType())) {<NEW_LINE>Optional<Class> clazz = typeOfValue(source);<NEW_LINE>if (clazz.isPresent()) {<NEW_LINE>model.additionalProperties(springfox.documentation.swagger2.mappers.Properties.property(clazz.get<MASK><NEW_LINE>} else {<NEW_LINE>model.additionalProperties(new ObjectProperty());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>} | ().getSimpleName())); |
350,323 | protected Excuse<Regressor> innerGetExcuse(Example<Regressor> e, double[][] allFeatureWeights) {<NEW_LINE>Prediction<Regressor> prediction = predict(e);<NEW_LINE>Map<String, List<Pair<String, Double>>> weightMap = new HashMap<>();<NEW_LINE>for (int i = 0; i < allFeatureWeights.length; i++) {<NEW_LINE>List<Pair<String, Double>> scores = new ArrayList<>();<NEW_LINE>for (Feature f : e) {<NEW_LINE>int id = featureIDMap.getID(f.getName());<NEW_LINE>if (id > -1) {<NEW_LINE>double score = allFeatureWeights[i][id] * f.getValue();<NEW_LINE>scores.add(new Pair<>(f.getName(), score));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>scores.sort((o1, o2) -> o2.getB().compareTo(o1.getB()));<NEW_LINE>weightMap.put(dimensionNames[<MASK><NEW_LINE>}<NEW_LINE>return new Excuse<>(e, prediction, weightMap);<NEW_LINE>} | mapping[i]], scores); |
384,438 | /*<NEW_LINE>* Initializes the FlowController for this aggregate.<NEW_LINE>*/<NEW_LINE>protected void initFlowController(FlowControllerDeclaration aFlowControllerDeclaration, UimaContextAdmin aParentContext, AnalysisEngineMetaData aAggregateMetadata) throws ResourceInitializationException {<NEW_LINE><MASK><NEW_LINE>if (key == null || key.length() == 0) {<NEW_LINE>// default key<NEW_LINE>key = "_FlowController";<NEW_LINE>}<NEW_LINE>Map<String, Object> flowControllerParams = new HashMap<String, Object>(mInitParams);<NEW_LINE>// retrieve the sofa mappings for the FlowControler<NEW_LINE>Map<String, String> sofamap = new TreeMap<String, String>();<NEW_LINE>if (mSofaMappings != null && mSofaMappings.length > 0) {<NEW_LINE>for (int s = 0; s < mSofaMappings.length; s++) {<NEW_LINE>// the mapping is for this analysis engine<NEW_LINE>if (mSofaMappings[s].getComponentKey().equals(key)) {<NEW_LINE>// if component sofa name is null, replace it with the default for TCAS sofa name<NEW_LINE>// This is to support single-view annotators.<NEW_LINE>if (mSofaMappings[s].getComponentSofaName() == null)<NEW_LINE>mSofaMappings[s].setComponentSofaName(CAS.NAME_DEFAULT_SOFA);<NEW_LINE>sofamap.put(mSofaMappings[s].getComponentSofaName(), mSofaMappings[s].getAggregateSofaName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FlowControllerContext ctxt = new FlowControllerContext_impl(aParentContext, key, sofamap, getComponentAnalysisEngineMetaData(), aAggregateMetadata);<NEW_LINE>flowControllerParams.put(PARAM_UIMA_CONTEXT, ctxt);<NEW_LINE>flowControllerParams.put(PARAM_RESOURCE_MANAGER, getResourceManager());<NEW_LINE>mFlowControllerContainer = new FlowControllerContainer();<NEW_LINE>mFlowControllerContainer.initialize(aFlowControllerDeclaration.getSpecifier(), flowControllerParams);<NEW_LINE>} | String key = aFlowControllerDeclaration.getKey(); |
660,930 | public void copyToLocalFile(URI srcUri, File dstFile) throws Exception {<NEW_LINE>LOGGER.debug("starting to fetch segment from hdfs");<NEW_LINE>final String dstFilePath = dstFile.getAbsolutePath();<NEW_LINE>final Path remoteFile = new Path(srcUri);<NEW_LINE>final Path localFile = new Path(dstFile.toURI());<NEW_LINE>try {<NEW_LINE>if (_hadoopFS == null) {<NEW_LINE>throw new RuntimeException("_hadoopFS client is not initialized when trying to copy files");<NEW_LINE>}<NEW_LINE>if (_hadoopFS.isDirectory(remoteFile)) {<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>}<NEW_LINE>long startMs = System.currentTimeMillis();<NEW_LINE>_hadoopFS.copyToLocalFile(remoteFile, localFile);<NEW_LINE>LOGGER.debug("copied {} from hdfs to {} in local for size {}, take {} ms", srcUri, dstFilePath, dstFile.length(), System.currentTimeMillis() - startMs);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.warn("failed to fetch segment {} from hdfs to {}, might retry", srcUri, dstFile, e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | srcUri.toString() + " is a direactory"); |
678,613 | private static String toHexString(BigInteger value) {<NEW_LINE>int signum = value.signum();<NEW_LINE>// obvious shortcut<NEW_LINE>if (signum == 0) {<NEW_LINE>return "0";<NEW_LINE>}<NEW_LINE>// we want to work in absolute numeric value (negative sign is added afterward)<NEW_LINE>byte[] input = value.abs().toByteArray();<NEW_LINE>FormattingBuffer.StringFormattingBuffer sb = new FormattingBuffer.StringFormattingBuffer(input.length * 2);<NEW_LINE>int b;<NEW_LINE>for (int i = 0; i < input.length; i++) {<NEW_LINE>b = input[i] & 0xFF;<NEW_LINE>sb.append(LOOKUP.charAt(b >> 4));<NEW_LINE>sb.append(LOOKUP.charAt(b & 0x0F));<NEW_LINE>}<NEW_LINE>// before returning the char array as string, remove leading zeroes, but not the last one<NEW_LINE>String result = sb.toString().replaceFirst("^0+(?!$)", "");<NEW_LINE>return signum <MASK><NEW_LINE>} | < 0 ? "-" + result : result; |
501,905 | private ImageVersionMetadataResponseDTO convertToVersionMetadataResponse(final ImageVersionMetadata versionMetadata) {<NEW_LINE>List<RampupMetadata> rampups = new ArrayList<>();<NEW_LINE>if (!CollectionUtils.isEmpty(versionMetadata.getImageRampups())) {<NEW_LINE>rampups = versionMetadata.getImageRampups().stream().map(imageRampup -> new RampupMetadata(imageRampup.getImageVersion(), imageRampup.getRampupPercentage(), imageRampup.getStabilityTag(), imageRampup.getReleaseTag())).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final String version = imageVersion != null ? imageVersion.getVersion() : null;<NEW_LINE>final State state = imageVersion != null ? imageVersion.getState() : null;<NEW_LINE>final String path = imageVersion != null ? imageVersion.getPath() : null;<NEW_LINE>final String releaseTag = imageVersion != null ? imageVersion.getReleaseTag() : null;<NEW_LINE>return new ImageVersionMetadataResponseDTO(version, state, path, rampups, versionMetadata.getMessage(), releaseTag);<NEW_LINE>} | ImageVersion imageVersion = versionMetadata.getImageVersion(); |
146,898 | public Table metacatToHiveTable(final TableDto dto) {<NEW_LINE><MASK><NEW_LINE>final QualifiedName name = dto.getName();<NEW_LINE>if (name != null) {<NEW_LINE>table.setTableName(name.getTableName());<NEW_LINE>table.setDbName(name.getDatabaseName());<NEW_LINE>}<NEW_LINE>final StorageDto storageDto = dto.getSerde();<NEW_LINE>if (storageDto != null) {<NEW_LINE>table.setOwner(storageDto.getOwner());<NEW_LINE>}<NEW_LINE>final AuditDto auditDto = dto.getAudit();<NEW_LINE>if (auditDto != null && auditDto.getCreatedDate() != null) {<NEW_LINE>table.setCreateTime(dateToEpochSeconds(auditDto.getCreatedDate()));<NEW_LINE>}<NEW_LINE>Map<String, String> params = new HashMap<>();<NEW_LINE>if (dto.getMetadata() != null) {<NEW_LINE>params = dto.getMetadata();<NEW_LINE>}<NEW_LINE>table.setParameters(params);<NEW_LINE>updateTableTypeAndViewInfo(dto, table);<NEW_LINE>table.setSd(fromStorageDto(storageDto, table.getTableName()));<NEW_LINE>final List<FieldDto> fields = dto.getFields();<NEW_LINE>if (fields == null) {<NEW_LINE>table.setPartitionKeys(Collections.emptyList());<NEW_LINE>table.getSd().setCols(Collections.emptyList());<NEW_LINE>} else {<NEW_LINE>final List<FieldSchema> nonPartitionFields = Lists.newArrayListWithCapacity(fields.size());<NEW_LINE>final List<FieldSchema> partitionFields = Lists.newArrayListWithCapacity(fields.size());<NEW_LINE>for (FieldDto fieldDto : fields) {<NEW_LINE>final FieldSchema f = metacatToHiveField(fieldDto);<NEW_LINE>if (fieldDto.isPartition_key()) {<NEW_LINE>partitionFields.add(f);<NEW_LINE>} else {<NEW_LINE>nonPartitionFields.add(f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>table.setPartitionKeys(partitionFields);<NEW_LINE>table.getSd().setCols(nonPartitionFields);<NEW_LINE>}<NEW_LINE>return table;<NEW_LINE>} | final Table table = new Table(); |
231,679 | static List<Element> findSubElements(Element parent) throws IllegalArgumentException {<NEW_LINE>NodeList l = parent.getChildNodes();<NEW_LINE>List<Element> elements = new ArrayList<<MASK><NEW_LINE>for (int i = 0; i < l.getLength(); i++) {<NEW_LINE>Node n = l.item(i);<NEW_LINE>if (n.getNodeType() == Node.ELEMENT_NODE) {<NEW_LINE>elements.add((Element) n);<NEW_LINE>} else if (n.getNodeType() == Node.TEXT_NODE) {<NEW_LINE>String text = ((Text) n).getNodeValue();<NEW_LINE>if (text.trim().length() > 0) {<NEW_LINE>// NOI18N<NEW_LINE>throw new IllegalArgumentException("non-ws text encountered in " + parent + ": " + text);<NEW_LINE>}<NEW_LINE>} else if (n.getNodeType() == Node.COMMENT_NODE) {<NEW_LINE>// OK, ignore<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>throw new IllegalArgumentException("unexpected non-element child of " + parent + ": " + n);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return elements;<NEW_LINE>} | >(l.getLength()); |
259,857 | private void metricUnhealthyInstance(ClusterType clusterType, String dc, String activeDc, String cluster, String shard, HostPort hostPort, boolean isMaster) {<NEW_LINE>MetricData data = new MetricData(UNHEALTHY_INSTANCE_METRIC_TYPE, dc, cluster, shard);<NEW_LINE>data.setHostPort(hostPort);<NEW_LINE>data.setValue(1);<NEW_LINE>data.setClusterType(clusterType);<NEW_LINE>data.setTimestampMilli(System.currentTimeMillis());<NEW_LINE>data.addTag("role", isMaster ? Server.SERVER_ROLE.MASTER.name() : Server.SERVER_ROLE.SLAVE.name());<NEW_LINE>if (!StringUtil.isEmpty(activeDc)) {<NEW_LINE>data.addTag("activeDc", activeDc);<NEW_LINE>data.addTag("inActiveDc", activeDc.equalsIgnoreCase<MASK><NEW_LINE>} else {<NEW_LINE>data.addTag("activeDc", "NONE");<NEW_LINE>data.addTag("inActiveDc", "0");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>metricProxy.writeBinMultiDataPoint(data);<NEW_LINE>} catch (Throwable th) {<NEW_LINE>logger.info("[metricUnhealthyInstance] fail", th);<NEW_LINE>}<NEW_LINE>} | (dc) ? "1" : "0"); |
1,295,737 | private void cutCurrentCache() {<NEW_LINE>final File lock = Configuration.getInstance().getOsmdroidTileCache();<NEW_LINE>synchronized (lock) {<NEW_LINE>if (mUsedCacheSpace > Configuration.getInstance().getTileFileSystemCacheTrimBytes()) {<NEW_LINE>Log.d(IMapView.LOGTAG, "Trimming tile cache from " + mUsedCacheSpace + " to " + Configuration.getInstance().getTileFileSystemCacheTrimBytes());<NEW_LINE>final List<File> z = getDirectoryFileList(Configuration.getInstance().getOsmdroidTileCache());<NEW_LINE>// order list by files day created from old to new<NEW_LINE>final File[] files = z.toArray(new File[0]);<NEW_LINE>Arrays.sort(files, new Comparator<File>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(final File f1, final File f2) {<NEW_LINE>return Long.valueOf(f1.lastModified()).compareTo(f2.lastModified());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (final File file : files) {<NEW_LINE>if (mUsedCacheSpace <= Configuration.getInstance().getTileFileSystemCacheTrimBytes()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>final long length = file.length();<NEW_LINE>if (file.delete()) {<NEW_LINE>if (Configuration.getInstance().isDebugTileProviders()) {<NEW_LINE>Log.d(IMapView.LOGTAG, <MASK><NEW_LINE>}<NEW_LINE>mUsedCacheSpace -= length;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.d(IMapView.LOGTAG, "Finished trimming tile cache");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "Cache trim deleting " + file.getAbsolutePath()); |
546,543 | public static void maybeAskDirectly(Context context) {<NEW_LINE>try {<NEW_LINE>if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M && !Prefs.getBooleanPreference(context, Prefs.DOZE_ASKED_DIRECTLY, false) && ContextCompat.checkSelfPermission(context, Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS) == PackageManager.PERMISSION_GRANTED && !((PowerManager) context.getSystemService(Context.POWER_SERVICE)).isIgnoringBatteryOptimizations(context.getPackageName())) {<NEW_LINE>new AlertDialog.Builder(context).setTitle(R.string.pref_background_notifications).setMessage(R.string.pref_background_notifications_rationale).setPositiveButton(R.string.perm_continue, (dialog, which) -> {<NEW_LINE>Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, Uri.parse("package:" <MASK><NEW_LINE>context.startActivity(intent);<NEW_LINE>}).setCancelable(false).show();<NEW_LINE>}<NEW_LINE>// Prefs.DOZE_ASKED_DIRECTLY is also used above in isEligible().<NEW_LINE>// As long as Prefs.DOZE_ASKED_DIRECTLY is false, isEligible() will return false<NEW_LINE>// and no device message will be added.<NEW_LINE>Prefs.setBooleanPreference(context, Prefs.DOZE_ASKED_DIRECTLY, true);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | + context.getPackageName())); |
483,440 | public void init() {<NEW_LINE>ManagedContext managedContext = serializationService.getManagedContext();<NEW_LINE>if (managedContext != null) {<NEW_LINE>Processor toInit = processor instanceof ProcessorWrapper ? ((ProcessorWrapper) <MASK><NEW_LINE>Object initialized = null;<NEW_LINE>try {<NEW_LINE>initialized = managedContext.initialize(toInit);<NEW_LINE>toInit = (Processor) initialized;<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>throw new IllegalArgumentException(String.format("The initialized object(%s) should be an instance of %s", initialized, Processor.class), e);<NEW_LINE>}<NEW_LINE>if (processor instanceof ProcessorWrapper) {<NEW_LINE>((ProcessorWrapper) processor).setWrapped(toInit);<NEW_LINE>} else {<NEW_LINE>processor = toInit;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>processor.init(outbox, context);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw sneakyThrow(e);<NEW_LINE>}<NEW_LINE>} | processor).getWrapped() : processor; |
671,472 | public static DeleteSipAgentGroupResponse unmarshall(DeleteSipAgentGroupResponse deleteSipAgentGroupResponse, UnmarshallerContext context) {<NEW_LINE>deleteSipAgentGroupResponse.setRequestId(context.stringValue("DeleteSipAgentGroupResponse.RequestId"));<NEW_LINE>deleteSipAgentGroupResponse.setSuccess(context.booleanValue("DeleteSipAgentGroupResponse.Success"));<NEW_LINE>deleteSipAgentGroupResponse.setCode(context.stringValue("DeleteSipAgentGroupResponse.Code"));<NEW_LINE>deleteSipAgentGroupResponse.setMessage(context.stringValue("DeleteSipAgentGroupResponse.Message"));<NEW_LINE>deleteSipAgentGroupResponse.setHttpStatusCode(context.integerValue("DeleteSipAgentGroupResponse.HttpStatusCode"));<NEW_LINE>deleteSipAgentGroupResponse.setProvider<MASK><NEW_LINE>List<SipAgent> sipAgents = new ArrayList<SipAgent>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DeleteSipAgentGroupResponse.SipAgents.Length"); i++) {<NEW_LINE>SipAgent sipAgent = new SipAgent();<NEW_LINE>sipAgent.setId(context.longValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].Id"));<NEW_LINE>sipAgent.setName(context.stringValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].Name"));<NEW_LINE>sipAgent.setIp(context.stringValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].Ip"));<NEW_LINE>sipAgent.setPort(context.stringValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].Port"));<NEW_LINE>sipAgent.setSendInterface(context.integerValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].SendInterface"));<NEW_LINE>sipAgent.setStatus(context.booleanValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].Status"));<NEW_LINE>sipAgents.add(sipAgent);<NEW_LINE>}<NEW_LINE>deleteSipAgentGroupResponse.setSipAgents(sipAgents);<NEW_LINE>return deleteSipAgentGroupResponse;<NEW_LINE>} | (context.stringValue("DeleteSipAgentGroupResponse.Provider")); |
273,657 | // The tested exceptions cause FFDC so we have to allow for this.<NEW_LINE>@AllowedFFDC<NEW_LINE>public void launchConcurrentTCK() throws Exception {<NEW_LINE>String suiteXmlFile;<NEW_LINE>if (TestModeFilter.FRAMEWORK_TEST_MODE == Mode.TestMode.FULL) {<NEW_LINE>Log.info(getClass(), "launchConcurrentTCK", "Running full tests");<NEW_LINE>suiteXmlFile = "tck-suite-full.xml";<NEW_LINE>} else {<NEW_LINE>Log.info(getClass(), "launchConcurrentTCK", "Running lite tests");<NEW_LINE>suiteXmlFile = "tck-suite-lite.xml";<NEW_LINE>}<NEW_LINE>Map<String, String> resultInfo = MvnUtils.getResultInfo(server);<NEW_LINE>int result = // server to run on<NEW_LINE>MvnUtils.// server to run on<NEW_LINE>runTCKMvnCmd(// bucket name<NEW_LINE>server, // launching method<NEW_LINE>"io.openliberty.jakarta.concurrency.3.0_fat_tck", // tck suite<NEW_LINE>this.getClass() + ":launchConcurrentTCK", // additional props<NEW_LINE>suiteXmlFile, // additional jars<NEW_LINE><MASK><NEW_LINE>resultInfo.put("results_type", "Jakarta");<NEW_LINE>resultInfo.put("feature_name", "Concurrency");<NEW_LINE>resultInfo.put("feature_version", "3.0");<NEW_LINE>MvnUtils.preparePublicationFile(resultInfo);<NEW_LINE>assertEquals(0, result);<NEW_LINE>} | additionalProps, Collections.emptySet()); |
482,396 | // debugging<NEW_LINE>private void printObjs(List<Long> changedIds, List<Long> oldDomIds, List<Long> newDomIds, List<Boolean> addedByDirtySet, List<Long> changedIdx) {<NEW_LINE>if (changedIds.size() > 20)<NEW_LINE>return;<NEW_LINE>TreeMap<Integer, String> m = new TreeMap();<NEW_LINE>for (int i = 0; i < changedIds.size(); i++) {<NEW_LINE>Long iid = changedIds.get(i);<NEW_LINE>Long oldDom = oldDomIds.get(i);<NEW_LINE>Long <MASK><NEW_LINE>Long index = changedIdx.get(i);<NEW_LINE>Boolean addedByDirt = addedByDirtySet.get(i);<NEW_LINE>Instance ii = heap.getInstanceByID(iid.longValue());<NEW_LINE>int number = ii.getInstanceNumber();<NEW_LINE>String text = "Index: " + index + (addedByDirt ? " New " : " Old ") + printInstance(iid);<NEW_LINE>text += " OldDom " + printInstance(oldDom);<NEW_LINE>text += " NewDom: " + printInstance(newDom);<NEW_LINE>m.put(number, text);<NEW_LINE>}<NEW_LINE>for (Integer in : m.keySet()) {<NEW_LINE>System.out.println(m.get(in));<NEW_LINE>}<NEW_LINE>} | newDom = newDomIds.get(i); |
1,386,476 | public boolean initVRCompositor(boolean allowed) {<NEW_LINE>// clear the error store<NEW_LINE>hmdErrorStore.put(0, VR.EVRInitError_VRInitError_None);<NEW_LINE>if (allowed) {<NEW_LINE>long result = VR.VR_GetGenericInterface(VR.IVRCompositor_Version, hmdErrorStore);<NEW_LINE>if (result > 0) {<NEW_LINE>if (hmdErrorStore.get(0) == VR.EVRInitError_VRInitError_None) {<NEW_LINE>setTrackingSpace(environment.isSeatedExperience());<NEW_LINE>logger.config("OpenVR Compositor initialized");<NEW_LINE>} else {<NEW_LINE>logger.severe("OpenVR Compositor error: " + hmdErrorStore.get(0));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.log(Level.SEVERE, "Cannot get generic interface for \"" + VR.IVRCompositor_Version + "\", " + VR.VR_GetVRInitErrorAsEnglishDescription(hmdErrorStore.get(0)) + " (" + hmdErrorStore<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | .get(0) + ")"); |
1,416,694 | protected Void doInBackground(String... urls) {<NEW_LINE>String url = urls[0];<NEW_LINE>if (url.endsWith("/")) {<NEW_LINE>url = url.substring(0, url.length() - 1);<NEW_LINE>}<NEW_LINE>String hash = url.substring(url.lastIndexOf("/"));<NEW_LINE>try {<NEW_LINE>URL newUrl = new URL("https://www.reddit.com/video" + hash);<NEW_LINE>HttpURLConnection ucon = (HttpURLConnection) newUrl.openConnection();<NEW_LINE>ucon.setInstanceFollowRedirects(false);<NEW_LINE>String secondURL = new URL(ucon.getHeaderField("location")).toString();<NEW_LINE>LogUtil.v(secondURL);<NEW_LINE>OpenRedditLink.openUrl(contextActivity.get(), secondURL, true);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>LinkUtil.openUrl(url, Palette.getColor(subreddit<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ), contextActivity.get()); |
1,600,699 | public void adminForgetDevice(AdminForgetDeviceRequest adminForgetDeviceRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(adminForgetDeviceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AdminForgetDeviceRequest> request = null;<NEW_LINE>Response<Void> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AdminForgetDeviceRequestMarshaller().marshall(adminForgetDeviceRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>JsonResponseHandler<Void> responseHandler = new JsonResponseHandler<Void>(null);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
376,924 | public void visitPhpTernaryExpression(@NotNull TernaryExpression expression) {<NEW_LINE>final PsiElement rawCondition = expression.getCondition();<NEW_LINE>if (rawCondition != null) {<NEW_LINE>final PsiElement condition = ExpressionSemanticUtil.getExpressionTroughParenthesis(rawCondition);<NEW_LINE>if (condition instanceof BinaryExpression) {<NEW_LINE>final PsiElement trueVariant = ExpressionSemanticUtil.getExpressionTroughParenthesis(expression.getTrueVariant());<NEW_LINE>if (trueVariant != null) {<NEW_LINE>final PsiElement falseVariant = ExpressionSemanticUtil.getExpressionTroughParenthesis(expression.getFalseVariant());<NEW_LINE>if (falseVariant != null) {<NEW_LINE>final boolean isTarget = PhpLanguageUtil.isBoolean(trueVariant<MASK><NEW_LINE>if (isTarget) {<NEW_LINE>final String replacement = this.generateReplacement((BinaryExpression) condition, trueVariant);<NEW_LINE>if (replacement != null) {<NEW_LINE>holder.registerProblem(expression, MessagesPresentationUtil.prefixWithEa(String.format(messagePattern, replacement)), new SimplifyFix(replacement));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ) && PhpLanguageUtil.isBoolean(falseVariant); |
1,243,334 | public void visitListener(WebAppContext context, Descriptor descriptor, XmlParser.Node node) {<NEW_LINE>String className = node.<MASK><NEW_LINE>try {<NEW_LINE>if (className != null && className.length() > 0) {<NEW_LINE>// Servlet Spec 3.0 p 74<NEW_LINE>// Duplicate listener declarations don't result in duplicate listener instances<NEW_LINE>for (ListenerHolder holder : context.getServletHandler().getListeners()) {<NEW_LINE>if (holder.getClassName().equals(className))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>((WebDescriptor) descriptor).addClassName(className);<NEW_LINE>ListenerHolder h = context.getServletHandler().newListenerHolder(new Source(Source.Origin.DESCRIPTOR, descriptor.getResource().toString()));<NEW_LINE>h.setClassName(className);<NEW_LINE>context.getServletHandler().addListener(h);<NEW_LINE>context.getMetaData().setOrigin(className + ".listener", descriptor);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Could not instantiate listener {}", className, e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} | getString("listener-class", false, true); |
547,420 | public static ListBarcodesResponse unmarshall(ListBarcodesResponse listBarcodesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listBarcodesResponse.setRequestId(_ctx.stringValue("ListBarcodesResponse.RequestId"));<NEW_LINE>listBarcodesResponse.setPageSize(_ctx.integerValue("ListBarcodesResponse.PageSize"));<NEW_LINE>listBarcodesResponse.setPageNumber(_ctx.integerValue("ListBarcodesResponse.PageNumber"));<NEW_LINE>listBarcodesResponse.setSuccess(_ctx.booleanValue("ListBarcodesResponse.Success"));<NEW_LINE>listBarcodesResponse.setTotalCount(_ctx.integerValue("ListBarcodesResponse.TotalCount"));<NEW_LINE>List<BarcodeModel> barcodes = new ArrayList<BarcodeModel>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListBarcodesResponse.Barcodes.Length"); i++) {<NEW_LINE>BarcodeModel barcodeModel = new BarcodeModel();<NEW_LINE>barcodeModel.setDisable(_ctx.integerValue("ListBarcodesResponse.Barcodes[" + i + "].Disable"));<NEW_LINE>barcodeModel.setStyleId(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].StyleId"));<NEW_LINE>barcodeModel.setSizeName(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].SizeName"));<NEW_LINE>barcodeModel.setRetailPrice(_ctx.floatValue<MASK><NEW_LINE>barcodeModel.setSizeCode(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].SizeCode"));<NEW_LINE>barcodeModel.setColorCode(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].ColorCode"));<NEW_LINE>barcodeModel.setName(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].Name"));<NEW_LINE>barcodeModel.setColorId(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].ColorId"));<NEW_LINE>barcodeModel.setCode(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].Code"));<NEW_LINE>barcodeModel.setUpdateDate(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].UpdateDate"));<NEW_LINE>barcodeModel.setSizeId(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].SizeId"));<NEW_LINE>barcodeModel.setColorName(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].ColorName"));<NEW_LINE>barcodeModel.setCreateDate(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].CreateDate"));<NEW_LINE>barcodeModel.setStyleCode(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].StyleCode"));<NEW_LINE>barcodeModel.setStyleName(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].StyleName"));<NEW_LINE>barcodeModel.setDescription(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].Description"));<NEW_LINE>barcodeModel.setCurrentPrice(_ctx.floatValue("ListBarcodesResponse.Barcodes[" + i + "].CurrentPrice"));<NEW_LINE>barcodeModel.setBarcodeId(_ctx.stringValue("ListBarcodesResponse.Barcodes[" + i + "].BarcodeId"));<NEW_LINE>barcodes.add(barcodeModel);<NEW_LINE>}<NEW_LINE>listBarcodesResponse.setBarcodes(barcodes);<NEW_LINE>return listBarcodesResponse;<NEW_LINE>} | ("ListBarcodesResponse.Barcodes[" + i + "].RetailPrice")); |
534,961 | public void marshall(OpenZFSFileSystemConfiguration openZFSFileSystemConfiguration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (openZFSFileSystemConfiguration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(openZFSFileSystemConfiguration.getAutomaticBackupRetentionDays(), AUTOMATICBACKUPRETENTIONDAYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(openZFSFileSystemConfiguration.getCopyTagsToVolumes(), COPYTAGSTOVOLUMES_BINDING);<NEW_LINE>protocolMarshaller.marshall(openZFSFileSystemConfiguration.getDailyAutomaticBackupStartTime(), DAILYAUTOMATICBACKUPSTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(openZFSFileSystemConfiguration.getDeploymentType(), DEPLOYMENTTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(openZFSFileSystemConfiguration.getThroughputCapacity(), THROUGHPUTCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(openZFSFileSystemConfiguration.getWeeklyMaintenanceStartTime(), WEEKLYMAINTENANCESTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(openZFSFileSystemConfiguration.getDiskIopsConfiguration(), DISKIOPSCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(openZFSFileSystemConfiguration.getRootVolumeId(), ROOTVOLUMEID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | openZFSFileSystemConfiguration.getCopyTagsToBackups(), COPYTAGSTOBACKUPS_BINDING); |
249,848 | private Array createArrayOf(Object implObject, Method createArrayOf, Object[] args) throws SQLException {<NEW_LINE>final <MASK><NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(this, tc, "createArrayOf", args[0]);<NEW_LINE>Array ra;<NEW_LINE>try {<NEW_LINE>activate();<NEW_LINE>ra = (Array) createArrayOf.invoke(implObject, args);<NEW_LINE>if (freeResourcesOnClose)<NEW_LINE>arrays.add(ra);<NEW_LINE>} catch (SQLException sqlX) {<NEW_LINE>FFDCFilter.processException(sqlX, getClass().getName() + ".createArrayOf", "661", this);<NEW_LINE>throw proccessSQLException(sqlX);<NEW_LINE>} catch (NullPointerException nullX) {<NEW_LINE>// No FFDC code needed; we might be closed.<NEW_LINE>throw runtimeXIfNotClosed(nullX);<NEW_LINE>} catch (AbstractMethodError | IllegalAccessException | InvocationTargetException methError) {<NEW_LINE>// No FFDC code needed; wrong JDBC level or wrong driver<NEW_LINE>throw AdapterUtil.notSupportedX("Connection.createArrayOf", methError);<NEW_LINE>} catch (RuntimeException runX) {<NEW_LINE>FFDCFilter.processException(runX, getClass().getName() + ".createArrayOf", "671", this);<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "createArrayOf", runX);<NEW_LINE>throw runX;<NEW_LINE>} catch (Error err) {<NEW_LINE>FFDCFilter.processException(err, getClass().getName() + ".createArrayOf", "677", this);<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "createArrayOf", err);<NEW_LINE>throw err;<NEW_LINE>}<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(this, tc, "createArrayOf", AdapterUtil.toString(ra));<NEW_LINE>return ra;<NEW_LINE>} | boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); |
436,500 | public boolean add(T value) {<NEW_LINE>if (value == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (root == null) {<NEW_LINE>root = new <MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>KdNode node = root;<NEW_LINE>while (true) {<NEW_LINE>if (KdNode.compareTo(node.getDepth(), value, node.getPoint()) <= 0) {<NEW_LINE>// Lesser<NEW_LINE>if (node.getLesser() == null) {<NEW_LINE>KdNode newNode = new KdNode(value, node.getDepth() + 1, node);<NEW_LINE>node.setLesser(newNode);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>node = node.getLesser();<NEW_LINE>} else {<NEW_LINE>// Greater<NEW_LINE>if (node.getGreater() == null) {<NEW_LINE>KdNode newNode = new KdNode(value, node.getDepth() + 1, node);<NEW_LINE>node.setGreater(newNode);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>node = node.getGreater();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | KdNode(value, 0, null); |
1,613,924 | final StartConfigRulesEvaluationResult executeStartConfigRulesEvaluation(StartConfigRulesEvaluationRequest startConfigRulesEvaluationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startConfigRulesEvaluationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartConfigRulesEvaluationRequest> request = null;<NEW_LINE>Response<StartConfigRulesEvaluationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartConfigRulesEvaluationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startConfigRulesEvaluationRequest));<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, "Config Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartConfigRulesEvaluation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartConfigRulesEvaluationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartConfigRulesEvaluationResultJsonUnmarshaller());<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); |
206,961 | public void fire(ActionEvent event, ImageData<BufferedImage> imageData, DensityMapBuilder builder, String densityMapName) {<NEW_LINE>if (imageData == null || builder == null) {<NEW_LINE>Dialogs.showErrorMessage(title, "No density map found!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var densityServer = builder.buildServer(imageData);<NEW_LINE>ColorModelRenderer renderer = getRenderer();<NEW_LINE>saveColorModel();<NEW_LINE>try {<NEW_LINE>bandCounts = densityServer.nChannels() - 1;<NEW_LINE>var channel = densityServer.getChannel(band);<NEW_LINE>aboveThreshold = PathClassFactory.getPathClass(channel.getName(), channel.getColor());<NEW_LINE>if (!showDialog(densityServer, renderer, getOwner(event)))<NEW_LINE>return;<NEW_LINE>double radius = builder.buildParameters().getRadius();<NEW_LINE>int numHotspots = nHotspots.get();<NEW_LINE>double minDensity = thresholdCounts.get();<NEW_LINE>boolean peaksOnly = strictPeaks.get();<NEW_LINE>boolean deleteExisting = deletePrevious.get();<NEW_LINE>try {<NEW_LINE>var hierarchy = imageData.getHierarchy();<NEW_LINE>DensityMaps.findHotspots(hierarchy, densityServer, band, numHotspots, radius, <MASK><NEW_LINE>if (densityMapName != null) {<NEW_LINE>imageData.getHistoryWorkflow().addStep(new DefaultScriptableWorkflowStep("Density map find hotspots", String.format("findDensityMapHotspots(\"%s\", %d, %d, %f, %s, %s)", densityMapName, band, numHotspots, minDensity, deleteExisting, peaksOnly)));<NEW_LINE>} else<NEW_LINE>logger.warn("Density map not saved - cannot log step to workflow");<NEW_LINE>} catch (IOException e) {<NEW_LINE>Dialogs.showErrorNotification(title, e);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error(e.getLocalizedMessage(), e);<NEW_LINE>return;<NEW_LINE>} finally {<NEW_LINE>restoreColorModel();<NEW_LINE>aboveThreshold = null;<NEW_LINE>}<NEW_LINE>} | minDensity, aboveThreshold, deleteExisting, peaksOnly); |
1,563,664 | private void loadQueues() {<NEW_LINE>File file = new File(Config.getInstance().getDataFolder(), "queues.txt");<NEW_LINE>DownloadQueue defaultQ = new DownloadQueue("", StringResource.get("DEF_QUEUE"));<NEW_LINE>queueList.add(defaultQ);<NEW_LINE>if (!file.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd");<NEW_LINE>try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), Charset.forName("UTF-8")))) {<NEW_LINE><MASK><NEW_LINE>int count = Integer.parseInt((str == null ? "0" : str).trim());<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>String strLn = reader.readLine();<NEW_LINE>if (strLn == null) {<NEW_LINE>throw new IOException("Unexpected EOF");<NEW_LINE>}<NEW_LINE>String id = strLn.trim();<NEW_LINE>strLn = reader.readLine();<NEW_LINE>if (strLn == null) {<NEW_LINE>throw new IOException("Unexpected EOF");<NEW_LINE>}<NEW_LINE>String name = strLn.trim();<NEW_LINE>DownloadQueue queue = null;<NEW_LINE>if ("".equals(id)) {<NEW_LINE>queue = defaultQ;<NEW_LINE>} else {<NEW_LINE>queue = new DownloadQueue(id, name);<NEW_LINE>}<NEW_LINE>int c = Integer.parseInt(XDMUtils.readLineSafe(reader).trim());<NEW_LINE>for (int j = 0; j < c; j++) {<NEW_LINE>queue.getQueuedItems().add(XDMUtils.readLineSafe(reader).trim());<NEW_LINE>}<NEW_LINE>boolean hasStartTime = Integer.parseInt(reader.readLine()) == 1;<NEW_LINE>if (hasStartTime) {<NEW_LINE>queue.setStartTime(Long.parseLong(reader.readLine()));<NEW_LINE>boolean hasEndTime = Integer.parseInt(reader.readLine()) == 1;<NEW_LINE>if (hasEndTime) {<NEW_LINE>queue.setEndTime(Long.parseLong(reader.readLine()));<NEW_LINE>}<NEW_LINE>boolean isPeriodic = Integer.parseInt(reader.readLine()) == 1;<NEW_LINE>queue.setPeriodic(isPeriodic);<NEW_LINE>if (isPeriodic) {<NEW_LINE>queue.setDayMask(Integer.parseInt(reader.readLine()));<NEW_LINE>} else {<NEW_LINE>if (Integer.parseInt(reader.readLine()) == 1) {<NEW_LINE>String ln = reader.readLine();<NEW_LINE>if (ln != null)<NEW_LINE>queue.setExecDate(dateFormatter.parse(ln));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (queue.getQueueId().length() > 0) {<NEW_LINE>queueList.add(queue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.log(e);<NEW_LINE>}<NEW_LINE>} | String str = reader.readLine(); |
25,995 | public DescribeReplaceRootVolumeTasksResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeReplaceRootVolumeTasksResult describeReplaceRootVolumeTasksResult = new DescribeReplaceRootVolumeTasksResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return describeReplaceRootVolumeTasksResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("replaceRootVolumeTaskSet", targetDepth)) {<NEW_LINE>describeReplaceRootVolumeTasksResult.withReplaceRootVolumeTasks(new ArrayList<ReplaceRootVolumeTask>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("replaceRootVolumeTaskSet/item", targetDepth)) {<NEW_LINE>describeReplaceRootVolumeTasksResult.withReplaceRootVolumeTasks(ReplaceRootVolumeTaskStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>describeReplaceRootVolumeTasksResult.setNextToken(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeReplaceRootVolumeTasksResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
1,789,655 | private // /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>GridPane createInfoPopover() {<NEW_LINE>GridPane infoGridPane = new GridPane();<NEW_LINE>infoGridPane.setHgap(5);<NEW_LINE>infoGridPane.setVgap(5);<NEW_LINE>infoGridPane.setPadding(new Insets(10, 10, 10, 10));<NEW_LINE>int i = 0;<NEW_LINE>if (model.isSellOffer()) {<NEW_LINE>addPayInfoEntry(infoGridPane, i++, Res.getWithCol("shared.tradeAmount"), model.getTradeAmount());<NEW_LINE>}<NEW_LINE>addPayInfoEntry(infoGridPane, i++, Res.getWithCol("shared.yourSecurityDeposit"), model.getSecurityDepositInfo());<NEW_LINE>addPayInfoEntry(infoGridPane, i++, Res.getWithCol("createOffer.fundsBox.offerFee"), model.getTradeFee());<NEW_LINE>addPayInfoEntry(infoGridPane, i++, Res.getWithCol("createOffer.fundsBox.networkFee"), model.getTxFee());<NEW_LINE>Separator separator = new Separator();<NEW_LINE>separator.setOrientation(Orientation.HORIZONTAL);<NEW_LINE>separator.getStyleClass().add("offer-separator");<NEW_LINE>GridPane.setConstraints(separator, 1, i++);<NEW_LINE>infoGridPane.<MASK><NEW_LINE>addPayInfoEntry(infoGridPane, i, Res.getWithCol("shared.total"), model.getTotalToPayInfo());<NEW_LINE>return infoGridPane;<NEW_LINE>} | getChildren().add(separator); |
107,004 | private List<ContentProviderDescriptor> findMatchingProviders(URI uri) {<NEW_LINE>List<String> preferredProviderIds = preferenceManager.getPreferences().getPreferredContentProviderIds();<NEW_LINE>Set<ContentProviderDescriptor> descriptors = getDescriptors(preferredProviderIds);<NEW_LINE>if (descriptors.isEmpty()) {<NEW_LINE>JavaLanguageServerPlugin.logError("No content providers found");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String uriString = uri != null <MASK><NEW_LINE>List<ContentProviderDescriptor> matches = descriptors.stream().filter(d -> uriString != null ? d.uriPattern.matcher(uriString).find() : true).peek(d -> d.calculateEffectivePriority(preferredProviderIds)).sorted((d1, d2) -> d1.priority - d2.priority).collect(Collectors.toList());<NEW_LINE>if (matches.isEmpty()) {<NEW_LINE>JavaLanguageServerPlugin.logError("Unable to find content provider for URI " + uri);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return matches;<NEW_LINE>} | ? uri.toString() : null; |
1,124,431 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller != null) {<NEW_LINE>// In the case that the enchantment is blinked<NEW_LINE>Permanent enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);<NEW_LINE>if (enchantment == null) {<NEW_LINE>// It was not blinked, use the standard method<NEW_LINE>enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId());<NEW_LINE>}<NEW_LINE>if (enchantment != null && enchantment.getAttachedTo() != null) {<NEW_LINE>Permanent enchanted = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo());<NEW_LINE>if (enchanted != null) {<NEW_LINE>Player controllerEnchanted = game.getPlayer(enchanted.getControllerId());<NEW_LINE>if (controllerEnchanted != null) {<NEW_LINE>int damage <MASK><NEW_LINE>if (damage > 0) {<NEW_LINE>controllerEnchanted.loseLife(damage, game, source, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | = (Integer) getValue("damage"); |
1,771,287 | protected WindowedValue<T> decodeMessage(Windmill.Message message) throws IOException {<NEW_LINE>Instant timestampMillis = WindmillTimeUtils.windmillToHarnessTimestamp(message.getTimestamp());<NEW_LINE>InputStream data = message.getData().newInput();<NEW_LINE>InputStream metadata = message.getMetadata().newInput();<NEW_LINE>Collection<? extends BoundedWindow> windows = WindmillSink.decodeMetadataWindows(<MASK><NEW_LINE>PaneInfo pane = WindmillSink.decodeMetadataPane(message.getMetadata());<NEW_LINE>if (valueCoder instanceof KvCoder) {<NEW_LINE>KvCoder<?, ?> kvCoder = (KvCoder<?, ?>) valueCoder;<NEW_LINE>InputStream key = context.getSerializedKey().newInput();<NEW_LINE>notifyElementRead(key.available() + data.available() + metadata.available());<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>T result = (T) KV.of(decode(kvCoder.getKeyCoder(), key), decode(kvCoder.getValueCoder(), data));<NEW_LINE>return WindowedValue.of(result, timestampMillis, windows, pane);<NEW_LINE>} else {<NEW_LINE>notifyElementRead(data.available() + metadata.available());<NEW_LINE>return WindowedValue.of(decode(valueCoder, data), timestampMillis, windows, pane);<NEW_LINE>}<NEW_LINE>} | windowsCoder, message.getMetadata()); |
1,736,630 | public static void migrate() {<NEW_LINE>String configVersionRaw = DiscordSRV.config().getString("ConfigVersion");<NEW_LINE>if (configVersionRaw.contains("/"))<NEW_LINE>configVersionRaw = configVersionRaw.substring(0, configVersionRaw.indexOf("/"));<NEW_LINE>String pluginVersionRaw = DiscordSRV.getPlugin()<MASK><NEW_LINE>if (configVersionRaw.equals(pluginVersionRaw))<NEW_LINE>return;<NEW_LINE>Version configVersion = configVersionRaw.split("\\.").length == 3 ? Version.valueOf(configVersionRaw.replace("-SNAPSHOT", "")) : Version.valueOf("1." + configVersionRaw.replace("-SNAPSHOT", ""));<NEW_LINE>Version pluginVersion = Version.valueOf(pluginVersionRaw.replace("-SNAPSHOT", ""));<NEW_LINE>// no migration necessary<NEW_LINE>if (configVersion.equals(pluginVersion))<NEW_LINE>return;<NEW_LINE>if (configVersion.greaterThan(pluginVersion)) {<NEW_LINE>DiscordSRV.warning("You're attempting to use a higher config version than the plugin. Things probably won't work correctly.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String oldVersionName = configVersion.toString();<NEW_LINE>DiscordSRV.info("Your DiscordSRV config file was outdated; attempting migration...");<NEW_LINE>try {<NEW_LINE>Provider configProvider = DiscordSRV.config().getProvider("config");<NEW_LINE>Provider messageProvider = DiscordSRV.config().getProvider("messages");<NEW_LINE>Provider voiceProvider = DiscordSRV.config().getProvider("voice");<NEW_LINE>Provider linkingProvider = DiscordSRV.config().getProvider("linking");<NEW_LINE>Provider synchronizationProvider = DiscordSRV.config().getProvider("synchronization");<NEW_LINE>Provider alertsProvider = DiscordSRV.config().getProvider("alerts");<NEW_LINE>migrate("config.yml-build." + oldVersionName + ".old", DiscordSRV.getPlugin().getConfigFile(), configProvider);<NEW_LINE>migrate("messages.yml-build." + oldVersionName + ".old", DiscordSRV.getPlugin().getMessagesFile(), messageProvider);<NEW_LINE>migrate("voice.yml-build." + oldVersionName + ".old", DiscordSRV.getPlugin().getVoiceFile(), voiceProvider);<NEW_LINE>migrate("linking.yml-build." + oldVersionName + ".old", DiscordSRV.getPlugin().getLinkingFile(), linkingProvider);<NEW_LINE>migrate("synchronization.yml-build." + oldVersionName + ".old", DiscordSRV.getPlugin().getSynchronizationFile(), synchronizationProvider);<NEW_LINE>migrate("alerts.yml-build." + oldVersionName + ".old", DiscordSRV.getPlugin().getAlertsFile(), alertsProvider);<NEW_LINE>DiscordSRV.info("Successfully migrated configuration files to version " + pluginVersionRaw);<NEW_LINE>} catch (Exception e) {<NEW_LINE>DiscordSRV.error("Failed migrating configs: " + e.getMessage());<NEW_LINE>DiscordSRV.debug(ExceptionUtils.getStackTrace(e));<NEW_LINE>}<NEW_LINE>} | .getDescription().getVersion(); |
1,318,259 | public static SaiExportedAppMeta2 createForPackage(Context context, String pkg, long exportTimestamp) throws PackageManager.NameNotFoundException {<NEW_LINE>PackageManager pm = context.getPackageManager();<NEW_LINE>PackageInfo packageInfo = context.getPackageManager().getPackageInfo(pkg, 0);<NEW_LINE>SaiExportedAppMeta2 appMeta = new SaiExportedAppMeta2();<NEW_LINE>appMeta.mPackage = packageInfo.packageName;<NEW_LINE>appMeta.mLabel = packageInfo.applicationInfo.loadLabel(pm).toString();<NEW_LINE>appMeta.mVersionName = packageInfo.versionName;<NEW_LINE>if (Utils.apiIsAtLeast(Build.VERSION_CODES.P)) {<NEW_LINE>appMeta<MASK><NEW_LINE>} else {<NEW_LINE>appMeta.mVersionCode = (long) packageInfo.versionCode;<NEW_LINE>}<NEW_LINE>appMeta.mExportTimestamp = exportTimestamp;<NEW_LINE>if (Utils.apiIsAtLeast(Build.VERSION_CODES.N)) {<NEW_LINE>appMeta.mMinSdk = (long) packageInfo.applicationInfo.minSdkVersion;<NEW_LINE>appMeta.mTargetSdk = (long) packageInfo.applicationInfo.targetSdkVersion;<NEW_LINE>}<NEW_LINE>appMeta.mIsSplitApk = packageInfo.applicationInfo.splitPublicSourceDirs != null && packageInfo.applicationInfo.splitPublicSourceDirs.length > 0;<NEW_LINE>return appMeta;<NEW_LINE>} | .mVersionCode = packageInfo.getLongVersionCode(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.