idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
706,660 | public void run(final FlowTrigger trigger, Map data) {<NEW_LINE>final ParamOut out = (ParamOut) data.get(ParamOut.class);<NEW_LINE>CreateTemporaryVolumeFromSnapshotMsg msg = new CreateTemporaryVolumeFromSnapshotMsg();<NEW_LINE>msg.setPrimaryStorageUuid(paramIn.getPrimaryStorageUuid());<NEW_LINE>msg.setSnapshot(paramIn.getSnapshot());<NEW_LINE>msg.setTemporaryVolumeUuid(paramIn.getImage().getUuid());<NEW_LINE>msg.setHypervisorType(hvtype.toString());<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(msg, PrimaryStorageConstant.SERVICE_ID, paramIn.getPrimaryStorageUuid());<NEW_LINE>bus.send(msg, new CloudBusCallBack(trigger) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>trigger.fail(reply.getError());<NEW_LINE>} else {<NEW_LINE>CreateTemporaryVolumeFromSnapshotReply r = reply.castReply();<NEW_LINE>ctx.tempInstallPath = r.getInstallPath();<NEW_LINE>out.<MASK><NEW_LINE>out.setSize(r.getSize());<NEW_LINE>trigger.next();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | setActualSize(r.getActualSize()); |
1,102,364 | private void updateControlsEnablement() {<NEW_LINE>boolean isBinary = getWizard().getSettings().getProcessor().isBinaryFormat();<NEW_LINE>boolean clipboard = !isBinary && clipboardCheck.getSelection();<NEW_LINE>boolean isMulti = getWizard().getSettings().getDataPipes<MASK><NEW_LINE>boolean singleFile = singleFileCheck.getSelection();<NEW_LINE>boolean addToEnd = appendToEndOfFileCheck.getSelection();<NEW_LINE>boolean compress = compressCheckbox.getSelection();<NEW_LINE>clipboardCheck.setEnabled(!isBinary);<NEW_LINE>singleFileCheck.setEnabled(isMulti && !clipboard && getWizard().getSettings().getMaxJobCount() <= 1);<NEW_LINE>directoryText.setEnabled(!clipboard);<NEW_LINE>fileNameText.setEnabled(!clipboard);<NEW_LINE>compressCheckbox.setEnabled(!clipboard && !addToEnd);<NEW_LINE>splitFilesCheckbox.setEnabled(!clipboard);<NEW_LINE>appendToEndOfFileCheck.setEnabled(!isBinary && !clipboard && !compress);<NEW_LINE>maximumFileSizeLabel.setEnabled(!clipboard && splitFilesCheckbox.getSelection());<NEW_LINE>maximumFileSizeText.setEnabled(!clipboard && splitFilesCheckbox.getSelection());<NEW_LINE>encodingCombo.setEnabled(!isBinary && !clipboard);<NEW_LINE>encodingBOMCheckbox.setEnabled(!isBinary && !clipboard);<NEW_LINE>timestampPattern.setEnabled(!clipboard);<NEW_LINE>for (EventProcessorComposite processor : processors.values()) {<NEW_LINE>processor.setProcessorAvailable(processor.isProcessorApplicable());<NEW_LINE>}<NEW_LINE>} | ().size() > 1; |
1,393,591 | public Hcl visitForObject(Hcl.ForObject forObject, PrintOutputCapture<P> p) {<NEW_LINE>visitSpace(forObject.getPrefix(), Space.Location.FOR_OBJECT, p);<NEW_LINE>visitMarkers(forObject.getMarkers(), p);<NEW_LINE>p.out.append("{");<NEW_LINE>visit(forObject.getIntro(), p);<NEW_LINE>visitLeftPadded(":", forObject.getPadding().getUpdateName(), HclLeftPadded.Location.FOR_UPDATE, p);<NEW_LINE>visitLeftPadded("=>", forObject.getPadding().getUpdateValue(), HclLeftPadded.Location.FOR_UPDATE_VALUE, p);<NEW_LINE>if (forObject.getEllipsis() != null) {<NEW_LINE>visitSpace(forObject.getEllipsis().getPrefix(), Space.Location.FOR_UPDATE_VALUE_ELLIPSIS, p);<NEW_LINE>p.out.append("...");<NEW_LINE>}<NEW_LINE>if (forObject.getPadding().getCondition() != null) {<NEW_LINE>visitLeftPadded("if", forObject.getPadding().getCondition(), HclLeftPadded.Location.FOR_CONDITION, p);<NEW_LINE>}<NEW_LINE>visitSpace(forObject.getEnd(), Space.Location.FOR_OBJECT_SUFFIX, p);<NEW_LINE><MASK><NEW_LINE>return forObject;<NEW_LINE>} | p.out.append("}"); |
161,073 | public static DescribeBandwidthLimitationResponse unmarshall(DescribeBandwidthLimitationResponse describeBandwidthLimitationResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBandwidthLimitationResponse.setRequestId<MASK><NEW_LINE>List<Bandwidth> bandwidths = new ArrayList<Bandwidth>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBandwidthLimitationResponse.Bandwidths.Length"); i++) {<NEW_LINE>Bandwidth bandwidth = new Bandwidth();<NEW_LINE>bandwidth.setInternetChargeType(_ctx.stringValue("DescribeBandwidthLimitationResponse.Bandwidths[" + i + "].InternetChargeType"));<NEW_LINE>bandwidth.setMax(_ctx.integerValue("DescribeBandwidthLimitationResponse.Bandwidths[" + i + "].Max"));<NEW_LINE>bandwidth.setMin(_ctx.integerValue("DescribeBandwidthLimitationResponse.Bandwidths[" + i + "].Min"));<NEW_LINE>bandwidth.setUnit(_ctx.stringValue("DescribeBandwidthLimitationResponse.Bandwidths[" + i + "].Unit"));<NEW_LINE>bandwidths.add(bandwidth);<NEW_LINE>}<NEW_LINE>describeBandwidthLimitationResponse.setBandwidths(bandwidths);<NEW_LINE>return describeBandwidthLimitationResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeBandwidthLimitationResponse.RequestId")); |
847,883 | private PreviewRouteLineInfo createPreviewRouteLineInfo() {<NEW_LINE>OsmandSettings settings = requireSettings();<NEW_LINE>int colorDay = settings.CUSTOM_ROUTE_COLOR_DAY.getModeValue(appMode);<NEW_LINE>int colorNight = settings.CUSTOM_ROUTE_COLOR_NIGHT.getModeValue(appMode);<NEW_LINE>ColoringType coloringType = settings.ROUTE_COLORING_TYPE.getModeValue(appMode);<NEW_LINE>String routeInfoAttribute = settings.ROUTE_INFO_ATTRIBUTE.getModeValue(appMode);<NEW_LINE>String widthKey = settings.ROUTE_LINE_WIDTH.getModeValue(appMode);<NEW_LINE>boolean showTurnArrows = <MASK><NEW_LINE>PreviewRouteLineInfo previewRouteLineInfo = new PreviewRouteLineInfo(colorDay, colorNight, coloringType, routeInfoAttribute, widthKey, showTurnArrows);<NEW_LINE>previewRouteLineInfo.setIconId(appMode.getNavigationIcon().getIconId());<NEW_LINE>previewRouteLineInfo.setIconColor(appMode.getProfileColor(isNightMode()));<NEW_LINE>return previewRouteLineInfo;<NEW_LINE>} | settings.ROUTE_SHOW_TURN_ARROWS.getModeValue(appMode); |
1,664,177 | final DBCluster executeStopDBCluster(StopDBClusterRequest stopDBClusterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopDBClusterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopDBClusterRequest> request = null;<NEW_LINE>Response<DBCluster> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopDBClusterRequestMarshaller().marshall(super.beforeMarshalling(stopDBClusterRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopDBCluster");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBCluster> responseHandler = new StaxResponseHandler<DBCluster>(new DBClusterStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,109,382 | protected void actionPerformed(FrontEndProjectTreeContext context) {<NEW_LINE>DomainFolder domainFolder = context.<MASK><NEW_LINE>ProjectData projectData = domainFolder.getProjectData();<NEW_LINE>RepositoryAdapter repository = projectData.getRepository();<NEW_LINE>if (repository != null && !repository.isConnected()) {<NEW_LINE>if (OptionDialog.OPTION_ONE != OptionDialog.showOptionDialogWithCancelAsDefaultButton(null, "Find Checkouts...", "Action requires connection to repository.\nWould you like to connect now?", "Connect", OptionDialog.QUESTION_MESSAGE)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>repository.connect();<NEW_LINE>} catch (NotConnectedException e) {<NEW_LINE>// ignore - likely caused by cancellation<NEW_LINE>return;<NEW_LINE>} catch (IOException e) {<NEW_LINE>ClientUtil.handleException(repository, e, "Find Checkouts", null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>findCheckouts(domainFolder, context.getTree());<NEW_LINE>} | getSelectedFolders().get(0); |
351,529 | public LocalSessionFactoryBuilder scanPackages(String... packagesToScan) throws HibernateException {<NEW_LINE>Set<String> entityClassNames = new TreeSet<>();<NEW_LINE>Set<String> <MASK><NEW_LINE>Set<String> packageNames = new TreeSet<>();<NEW_LINE>try {<NEW_LINE>for (String pkg : packagesToScan) {<NEW_LINE>String pattern = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + ClassUtils.convertClassNameToResourcePath(pkg) + RESOURCE_PATTERN;<NEW_LINE>Resource[] resources = this.resourcePatternResolver.getResources(pattern);<NEW_LINE>MetadataReaderFactory readerFactory = new CachingMetadataReaderFactory(this.resourcePatternResolver);<NEW_LINE>for (Resource resource : resources) {<NEW_LINE>try {<NEW_LINE>MetadataReader reader = readerFactory.getMetadataReader(resource);<NEW_LINE>String className = reader.getClassMetadata().getClassName();<NEW_LINE>if (matchesEntityTypeFilter(reader, readerFactory)) {<NEW_LINE>entityClassNames.add(className);<NEW_LINE>} else if (CONVERTER_TYPE_FILTER.match(reader, readerFactory)) {<NEW_LINE>converterClassNames.add(className);<NEW_LINE>} else if (className.endsWith(PACKAGE_INFO_SUFFIX)) {<NEW_LINE>packageNames.add(className.substring(0, className.length() - PACKAGE_INFO_SUFFIX.length()));<NEW_LINE>}<NEW_LINE>} catch (FileNotFoundException ex) {<NEW_LINE>// Ignore non-readable resource<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new MappingException("Failed to scan classpath for unlisted classes", ex);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ClassLoader cl = this.resourcePatternResolver.getClassLoader();<NEW_LINE>for (String className : entityClassNames) {<NEW_LINE>addAnnotatedClass(ClassUtils.forName(className, cl));<NEW_LINE>}<NEW_LINE>for (String className : converterClassNames) {<NEW_LINE>addAttributeConverter((Class<? extends AttributeConverter<?, ?>>) ClassUtils.forName(className, cl));<NEW_LINE>}<NEW_LINE>for (String packageName : packageNames) {<NEW_LINE>addPackage(packageName);<NEW_LINE>}<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>throw new MappingException("Failed to load annotated classes from classpath", ex);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | converterClassNames = new TreeSet<>(); |
140,102 | public static HashMap<J9ObjectPointer, Object> readObjectMonitors(J9JavaVMPointer vm) throws CorruptDataException {<NEW_LINE>HashMap<J9ObjectPointer, Object> objectMonitorsMap = new HashMap<J9ObjectPointer, Object>();<NEW_LINE>MonitorIterator iterator = new MonitorIterator(vm);<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Object current = iterator.next();<NEW_LINE>if (current instanceof ObjectMonitor) {<NEW_LINE>ObjectMonitor mon = (ObjectMonitor) current;<NEW_LINE><MASK><NEW_LINE>objectMonitorsMap.put(object, mon);<NEW_LINE>} else if (current instanceof J9ThreadMonitorPointer) {<NEW_LINE>// System Monitor<NEW_LINE>J9ThreadMonitorPointer mon = (J9ThreadMonitorPointer) current;<NEW_LINE>J9ThreadAbstractMonitorPointer lock = J9ThreadAbstractMonitorPointer.cast(mon);<NEW_LINE>if (false == lock.userData().eq(0)) {<NEW_LINE>// this is an object monitor in the system monitor table<NEW_LINE>J9ObjectPointer object = J9ObjectPointer.cast(lock.userData());<NEW_LINE>objectMonitorsMap.put(object, mon);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return objectMonitorsMap;<NEW_LINE>} | J9ObjectPointer object = mon.getObject(); |
1,168,212 | public void send(Event event, EntityRef target) {<NEW_LINE>try {<NEW_LINE>BlockComponent blockComp = target.getComponent(BlockComponent.class);<NEW_LINE>if (blockComp != null) {<NEW_LINE>if (relevantChunks.contains(Chunks.toChunkPos(blockComp.getPosition(), new Vector3i()))) {<NEW_LINE>queuedOutgoingEvents.add(NetData.EventMessage.newBuilder().setTargetBlockPos(NetMessageUtil.convert(blockComp.getPosition())).setEvent(eventSerializer.serialize(event)).build());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>NetworkComponent networkComponent = target.getComponent(NetworkComponent.class);<NEW_LINE>if (networkComponent != null) {<NEW_LINE>if (netRelevant.contains(networkComponent.getNetworkId()) || netInitial.contains(networkComponent.getNetworkId())) {<NEW_LINE>queuedOutgoingEvents.add(NetData.EventMessage.newBuilder().setTargetId(networkComponent.getNetworkId()).setEvent(eventSerializer.serialize(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SerializationException e) {<NEW_LINE>logger.error("Failed to serialize event", e);<NEW_LINE>}<NEW_LINE>} | event)).build()); |
351,406 | private int processBlock192or256(byte[] in, int inOff, byte[] out, int outOff) {<NEW_LINE>int[] state = new int[4];<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>state[i] = bytes2int(in, inOff + (i * 4)) ^ kw[i];<NEW_LINE>}<NEW_LINE>camelliaF2(state, subkey, 0);<NEW_LINE>camelliaF2(state, subkey, 4);<NEW_LINE>camelliaF2(state, subkey, 8);<NEW_LINE>camelliaFLs(state, ke, 0);<NEW_LINE>camelliaF2(state, subkey, 12);<NEW_LINE>camelliaF2(state, subkey, 16);<NEW_LINE>camelliaF2(state, subkey, 20);<NEW_LINE>camelliaFLs(state, ke, 4);<NEW_LINE><MASK><NEW_LINE>camelliaF2(state, subkey, 28);<NEW_LINE>camelliaF2(state, subkey, 32);<NEW_LINE>camelliaFLs(state, ke, 8);<NEW_LINE>camelliaF2(state, subkey, 36);<NEW_LINE>camelliaF2(state, subkey, 40);<NEW_LINE>camelliaF2(state, subkey, 44);<NEW_LINE>state[2] ^= kw[4];<NEW_LINE>state[3] ^= kw[5];<NEW_LINE>state[0] ^= kw[6];<NEW_LINE>state[1] ^= kw[7];<NEW_LINE>int2bytes(state[2], out, outOff);<NEW_LINE>int2bytes(state[3], out, outOff + 4);<NEW_LINE>int2bytes(state[0], out, outOff + 8);<NEW_LINE>int2bytes(state[1], out, outOff + 12);<NEW_LINE>return BLOCK_SIZE;<NEW_LINE>} | camelliaF2(state, subkey, 24); |
847,985 | final ListDistributionsByWebACLIdResult executeListDistributionsByWebACLId(ListDistributionsByWebACLIdRequest listDistributionsByWebACLIdRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDistributionsByWebACLIdRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListDistributionsByWebACLIdRequest> request = null;<NEW_LINE>Response<ListDistributionsByWebACLIdResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDistributionsByWebACLIdRequestMarshaller().marshall(super.beforeMarshalling(listDistributionsByWebACLIdRequest));<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, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDistributionsByWebACLId");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListDistributionsByWebACLIdResult> responseHandler = new StaxResponseHandler<ListDistributionsByWebACLIdResult>(new ListDistributionsByWebACLIdResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
648,671 | public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>if (keyed) {<NEW_LINE>builder.startObject(key);<NEW_LINE>} else {<NEW_LINE>builder.startObject();<NEW_LINE>builder.field(CommonFields.KEY.getPreferredName(), key);<NEW_LINE>}<NEW_LINE>if (!Double.isInfinite(from)) {<NEW_LINE>builder.field(CommonFields.FROM.getPreferredName(), from);<NEW_LINE>if (format != DocValueFormat.RAW) {<NEW_LINE>builder.field(CommonFields.FROM_AS_STRING.getPreferredName(), format.format(from));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!Double.isInfinite(to)) {<NEW_LINE>builder.field(CommonFields.TO.getPreferredName(), to);<NEW_LINE>if (format != DocValueFormat.RAW) {<NEW_LINE>builder.field(CommonFields.TO_AS_STRING.getPreferredName(), format.format(to));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.field(CommonFields.<MASK><NEW_LINE>aggregations.toXContentInternal(builder, params);<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>} | DOC_COUNT.getPreferredName(), docCount); |
1,263,487 | private static Pair<NewExpressionCall, NewExpression> matchesMethodCall(@NotNull ArrayCreationExpression arrayCreationExpression, @NotNull NewExpressionCall[] classes) {<NEW_LINE>// get parameter, we less then 0 we are not inside method reference<NEW_LINE>int parameterIndex = PsiElementUtils.getParameterIndexValue(arrayCreationExpression);<NEW_LINE>if (parameterIndex < 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// filter index<NEW_LINE>List<NewExpressionCall> filter = ContainerUtil.filter(classes, expressionCall -> expressionCall.getIndex() == parameterIndex);<NEW_LINE>if (filter.size() == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>PsiElement parameterList = arrayCreationExpression.getParent();<NEW_LINE>if (!(parameterList instanceof ParameterList)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>PsiElement newExpression = parameterList.getParent();<NEW_LINE>if (!(newExpression instanceof NewExpression)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>for (NewExpressionCall aClass : filter) {<NEW_LINE>if (PhpElementsUtil.getNewExpressionPhpClassWithInstance((NewExpression) newExpression, aClass.getClazz()) == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>return Pair.create<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | (aClass, (NewExpression) newExpression); |
824,115 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<Integer> results = controller.rollDice(outcome, source, game, 4, 2, 0);<NEW_LINE>int <MASK><NEW_LINE>int secondResult = results.get(1);<NEW_LINE>int first, second;<NEW_LINE>if (firstResult != secondResult && controller.chooseUse(outcome, "Choose the amount of 3/3 green Beast creature tokens.", "The other number is the amount of basic lands you search from your library and put on the battlefield tapped.", "" + firstResult, "" + secondResult, source, game)) {<NEW_LINE>first = firstResult;<NEW_LINE>second = secondResult;<NEW_LINE>} else {<NEW_LINE>first = secondResult;<NEW_LINE>second = firstResult;<NEW_LINE>}<NEW_LINE>new BeastToken().putOntoBattlefield(first, game, source, source.getControllerId());<NEW_LINE>TargetCardInLibrary target = new TargetCardInLibrary(0, second, StaticFilters.FILTER_CARD_BASIC_LAND);<NEW_LINE>controller.searchLibrary(target, source, game);<NEW_LINE>Set<Card> cards = target.getTargets().stream().map(game::getCard).filter(Objects::nonNull).collect(Collectors.toSet());<NEW_LINE>controller.moveCards(cards, Zone.BATTLEFIELD, source, game, true, false, false, null);<NEW_LINE>controller.shuffleLibrary(source, game);<NEW_LINE>return true;<NEW_LINE>} | firstResult = results.get(0); |
875,560 | protected void apply(RelOptRuleCall call, Project project, TableScan scan) {<NEW_LINE>final RelOptTable table = scan.getTable();<NEW_LINE>assert table.unwrap(ProjectableFilterableTable.class) != null;<NEW_LINE>final List<Integer> selectedColumns = new ArrayList<>();<NEW_LINE>project.getProjects().forEach(proj -> {<NEW_LINE>proj.accept(new RexVisitorImpl<Void>(true) {<NEW_LINE><NEW_LINE>public Void visitInputRef(RexInputRef inputRef) {<NEW_LINE>if (!selectedColumns.contains(inputRef.getIndex())) {<NEW_LINE>selectedColumns.add(inputRef.getIndex());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>final List<RexNode> filtersPushDown;<NEW_LINE>final List<Integer> projectsPushDown;<NEW_LINE>if (scan instanceof Bindables.BindableTableScan) {<NEW_LINE>final Bindables.BindableTableScan bindableScan = (Bindables.BindableTableScan) scan;<NEW_LINE>filtersPushDown = bindableScan.filters;<NEW_LINE>projectsPushDown = selectedColumns.stream().map(col -> bindableScan.projects.get(col)).collect(Collectors.toList());<NEW_LINE>} else {<NEW_LINE>filtersPushDown = ImmutableList.of();<NEW_LINE>projectsPushDown = selectedColumns;<NEW_LINE>}<NEW_LINE>final List<String> aliases = new ArrayList<>();<NEW_LINE>List<String> col_names = table.getRowType().getFieldNames();<NEW_LINE>int count_cols = 0;<NEW_LINE>for (Pair<RexNode, String> value : project.getNamedProjects()) {<NEW_LINE>// We want to mantain column names when no aliases where provided<NEW_LINE>// If we have in the future issues with aliases we can review:<NEW_LINE>// PR related to this -> https://github.com/BlazingDB/blazingsql/pull/1400<NEW_LINE>// Issue related to this -> https://github.com/BlazingDB/blazingsql/issues/1393<NEW_LINE>if (value.right.length() > 1 && value.right.substring(0, 2).equals("$f") && count_cols < projectsPushDown.size()) {<NEW_LINE>aliases.add(col_names.get(projectsPushDown.get(count_cols)));<NEW_LINE>} else {<NEW_LINE>aliases.add(value.right);<NEW_LINE>}<NEW_LINE>count_cols++;<NEW_LINE>}<NEW_LINE>BindableTableScan newScan = BindableTableScan.create(scan.getCluster(), scan.getTable(), filtersPushDown, projectsPushDown, aliases);<NEW_LINE>Mapping mapping = Mappings.target(selectedColumns, scan.getRowType().getFieldCount());<NEW_LINE>final List<RexNode> newProjectRexNodes = ImmutableList.copyOf(RexUtil.apply(mapping<MASK><NEW_LINE>if (RexUtil.isIdentity(newProjectRexNodes, newScan.getRowType())) {<NEW_LINE>call.transformTo(newScan);<NEW_LINE>} else {<NEW_LINE>call.transformTo(call.builder().push(newScan).project(newProjectRexNodes, aliases).build());<NEW_LINE>}<NEW_LINE>} | , project.getProjects())); |
1,654,814 | private static PipelineResult run(BigQueryToParquetOptions options) {<NEW_LINE>// Create the pipeline.<NEW_LINE>Pipeline pipeline = Pipeline.create(options);<NEW_LINE>TableReadOptions.<MASK><NEW_LINE>pipeline./*<NEW_LINE>* Step 1: Read records via BigQueryIO using supplied schema as a PCollection of<NEW_LINE>* {@link GenericRecord}.<NEW_LINE>*/<NEW_LINE>apply("ReadFromBigQuery", readFromBQ)./*<NEW_LINE>* Step 2: Write records to Google Cloud Storage as one or more Parquet files<NEW_LINE>* via {@link ParquetIO}.<NEW_LINE>*/<NEW_LINE>apply("WriteToParquet", FileIO.<GenericRecord>write().via(ParquetIO.sink(schema)).to(options.getBucket()).withNumShards(options.getNumShards()).withSuffix(FILE_SUFFIX));<NEW_LINE>// Execute the pipeline and return the result.<NEW_LINE>return pipeline.run();<NEW_LINE>} | Builder builder = TableReadOptions.newBuilder(); |
850,283 | protected void encodeMarkup(FacesContext context, Dialog dialog) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = dialog.getClientId(context);<NEW_LINE>String positionType = dialog.getPositionType();<NEW_LINE>String style = dialog.getStyle();<NEW_LINE>String styleClass = dialog.getStyleClass();<NEW_LINE>styleClass = styleClass == null ? Dialog.CONTAINER_CLASS <MASK><NEW_LINE>if (ComponentUtils.isRTL(context, dialog)) {<NEW_LINE>styleClass += " ui-dialog-rtl";<NEW_LINE>}<NEW_LINE>if ("absolute".equals(positionType)) {<NEW_LINE>styleClass += " ui-dialog-absolute";<NEW_LINE>}<NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.writeAttribute("id", clientId, null);<NEW_LINE>writer.writeAttribute("class", styleClass, null);<NEW_LINE>if (style != null) {<NEW_LINE>writer.writeAttribute("style", style, null);<NEW_LINE>}<NEW_LINE>if (dialog.isShowHeader()) {<NEW_LINE>encodeHeader(context, dialog);<NEW_LINE>}<NEW_LINE>encodeContent(context, dialog);<NEW_LINE>encodeFooter(context, dialog);<NEW_LINE>writer.endElement("div");<NEW_LINE>} | : Dialog.CONTAINER_CLASS + " " + styleClass; |
444,289 | public static Quaternion stripToYaw(Quaternion q) {<NEW_LINE>float yaw;<NEW_LINE>float w = q.getW();<NEW_LINE>float x = q.getX();<NEW_LINE>float y = q.getY();<NEW_LINE>float z = q.getZ();<NEW_LINE>float sqx = x * x;<NEW_LINE>float sqy = y * y;<NEW_LINE>float sqz = z * z;<NEW_LINE>float sqw = w * w;<NEW_LINE>// if normalized is one, otherwise<NEW_LINE>float unit = sqx + sqy + sqz + sqw;<NEW_LINE>// is correction factor<NEW_LINE>float test = x * y + z * w;<NEW_LINE>if (test > 0.499 * unit) {<NEW_LINE>// singularity at north pole<NEW_LINE>yaw = 2 * FastMath.atan2(x, w);<NEW_LINE>} else if (test < -0.499 * unit) {<NEW_LINE>// singularity at south pole<NEW_LINE>yaw = -2 * FastMath.atan2(x, w);<NEW_LINE>} else {<NEW_LINE>// roll or heading<NEW_LINE>yaw = FastMath.atan2(2 * y * w - 2 * x * z, sqx - sqy - sqz + sqw);<NEW_LINE>}<NEW_LINE>FastFullAngles(<MASK><NEW_LINE>return q;<NEW_LINE>} | q, yaw, 0f, 0f); |
1,048,782 | private static void customize(AbstractBreakpoint ab) {<NEW_LINE>JComponent <MASK><NEW_LINE>HelpCtx helpCtx = HelpCtx.findHelp(c);<NEW_LINE>if (helpCtx == null) {<NEW_LINE>// NOI18N<NEW_LINE>helpCtx = new HelpCtx("debug.add.breakpoint");<NEW_LINE>}<NEW_LINE>Controller cc;<NEW_LINE>if (c instanceof ControllerProvider) {<NEW_LINE>cc = ((ControllerProvider) c).getController();<NEW_LINE>} else {<NEW_LINE>cc = (Controller) c;<NEW_LINE>}<NEW_LINE>final Controller[] cPtr = new Controller[] { cc };<NEW_LINE>final DialogDescriptor[] descriptorPtr = new DialogDescriptor[1];<NEW_LINE>final Dialog[] dialogPtr = new Dialog[1];<NEW_LINE>ActionListener buttonsActionListener = new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent ev) {<NEW_LINE>if (descriptorPtr[0].getValue() == DialogDescriptor.OK_OPTION) {<NEW_LINE>boolean ok = cPtr[0].ok();<NEW_LINE>if (ok) {<NEW_LINE>dialogPtr[0].setVisible(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dialogPtr[0].setVisible(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>DialogDescriptor descriptor = new DialogDescriptor(c, Bundle.CTL_Breakpoint_Customizer_Title(), true, DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION, DialogDescriptor.DEFAULT_ALIGN, helpCtx, buttonsActionListener);<NEW_LINE>descriptor.setClosingOptions(new Object[] {});<NEW_LINE>Dialog d = DialogDisplayer.getDefault().createDialog(descriptor);<NEW_LINE>d.pack();<NEW_LINE>descriptorPtr[0] = descriptor;<NEW_LINE>dialogPtr[0] = d;<NEW_LINE>d.setVisible(true);<NEW_LINE>} | c = AbstractBreakpointCustomizer.getCustomizerComponent(ab); |
585,650 | public Dimension preferredLayoutSize(Container target) {<NEW_LINE>synchronized (target.getTreeLock()) {<NEW_LINE>Dimension dim <MASK><NEW_LINE>int nmembers = target.getComponentCount();<NEW_LINE>boolean firstVisibleComponent = true;<NEW_LINE>for (int i = 0; i < nmembers; i++) {<NEW_LINE>Component m = target.getComponent(i);<NEW_LINE>if (m.isVisible()) {<NEW_LINE>Dimension d = m.getPreferredSize();<NEW_LINE>dim.width = Math.max(dim.width, d.width);<NEW_LINE>if (firstVisibleComponent) {<NEW_LINE>firstVisibleComponent = false;<NEW_LINE>} else {<NEW_LINE>dim.height += vgap;<NEW_LINE>}<NEW_LINE>dim.height += d.height;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Insets insets = target.getInsets();<NEW_LINE>dim.width += insets.left + insets.right + hgap * 2;<NEW_LINE>dim.height += insets.top + insets.bottom + vgap * 2;<NEW_LINE>return dim;<NEW_LINE>}<NEW_LINE>} | = new Dimension(0, 0); |
1,812,034 | public Object call(ExecutionContext context, Object self, Object... args) {<NEW_LINE>// 15.4.4.8<NEW_LINE>JSObject o = Types.toObject(context, self);<NEW_LINE>long len = Types.toUint32(context, o.get(context, "length"));<NEW_LINE>long middle = (long) Math.floor(len / 2);<NEW_LINE>long lower = 0;<NEW_LINE>while (lower != middle) {<NEW_LINE>long upper = len - lower - 1;<NEW_LINE>Object lowerValue = o.get(context, "" + lower);<NEW_LINE>Object upperValue = o.get(context, "" + upper);<NEW_LINE>boolean lowerExists = o.hasProperty(context, "" + lower);<NEW_LINE>boolean upperExists = o.<MASK><NEW_LINE>if (lowerExists && upperExists) {<NEW_LINE>o.put(context, "" + lower, upperValue, true);<NEW_LINE>o.put(context, "" + upper, lowerValue, true);<NEW_LINE>} else if (upperExists) {<NEW_LINE>o.put(context, "" + lower, upperValue, true);<NEW_LINE>o.delete(context, "" + upper, true);<NEW_LINE>} else if (lowerExists) {<NEW_LINE>o.put(context, "" + upper, lowerValue, true);<NEW_LINE>o.delete(context, "" + lower, true);<NEW_LINE>} else {<NEW_LINE>// no action required<NEW_LINE>}<NEW_LINE>++lower;<NEW_LINE>}<NEW_LINE>return o;<NEW_LINE>} | hasProperty(context, "" + upper); |
1,318,095 | public void doNotifyDelFlAndSave(Object[] ptr) {<NEW_LINE>dirtySerializedFlag = true;<NEW_LINE>mConfig.putLong("lastUpdateFl", lastUpdateTimeSec);<NEW_LINE>saveConfigure();<NEW_LINE>try {<NEW_LINE>if (isNotifyWhenDeleted() && ((int) ptr[0]) > 0) {<NEW_LINE>Context app = HostInfo.getApplication();<NEW_LINE>Intent inner = SettingsUiFragmentHostActivity.createStartActivityForFragmentIntent(app, ExfriendListFragment.class, null);<NEW_LINE>Intent wrapper = new Intent();<NEW_LINE>wrapper.setClassName(HostInfo.getApplication().getPackageName(), ActProxyMgr.STUB_DEFAULT_ACTIVITY);<NEW_LINE>wrapper.<MASK><NEW_LINE>PendingIntent pi = PendingIntent.getActivity(HostInfo.getApplication(), 0, wrapper, PendingIntent.FLAG_IMMUTABLE);<NEW_LINE>NotificationManager nm = (NotificationManager) app.getSystemService(Context.NOTIFICATION_SERVICE);<NEW_LINE>Notification n = createNotiComp(nm, (String) ptr[1], (String) ptr[2], (String) ptr[3], new long[] { 100, 200, 200, 100 }, pi);<NEW_LINE>nm.notify(ID_EX_NOTIFY, n);<NEW_LINE>setRedDot();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(e);<NEW_LINE>}<NEW_LINE>} | putExtra(ActProxyMgr.ACTIVITY_PROXY_INTENT, inner); |
1,803,147 | // Implement JSCoder.decode<NEW_LINE>public Object decode(byte[] frame, int offset, int indirect, JMFMessageData msg) throws JMFMessageCorruptionException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.entry(this, tc, "decode", new Object[] { frame, offset, indirect, msg });<NEW_LINE>Object result = null;<NEW_LINE>if (indirect < 0) {<NEW_LINE>indirect = this.indirect;<NEW_LINE>}<NEW_LINE>if (indirect > 0) {<NEW_LINE>result = new JSVaryingListImpl(frame, offset, element, indirect);<NEW_LINE>} else if (varying) {<NEW_LINE>result = new JSVaryingListImpl(frame, offset, element, 0);<NEW_LINE>} else {<NEW_LINE>result = new <MASK><NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.exit(this, tc, "decode", result);<NEW_LINE>return result;<NEW_LINE>} | JSFixedListImpl(frame, offset, element); |
226,167 | private static <T> T safeCast(Object obj, ObjectCodec<T> codec) throws SerializationException {<NEW_LINE>if (obj == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ImmutableSet<Class<? extends T>> expectedTypes = codec.additionalEncodedClasses().isEmpty() ? ImmutableSet.of(codec.getEncodedClass()) : ImmutableSet.<Class<? extends T>>builderWithExpectedSize(codec.additionalEncodedClasses().size() + 1).add(codec.getEncodedClass()).addAll(codec.additionalEncodedClasses()).build();<NEW_LINE>Class<?> objectClass = obj.getClass();<NEW_LINE>if (expectedTypes.contains(objectClass)) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>T checkedResult = (T) obj;<NEW_LINE>return checkedResult;<NEW_LINE>}<NEW_LINE>for (Class<? extends T> expectedType : expectedTypes) {<NEW_LINE>if (expectedType.isAssignableFrom(objectClass)) {<NEW_LINE>return expectedType.cast(obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new SerializationException("Object " + obj + ") has type " + objectClass.<MASK><NEW_LINE>} | getName() + " but expected type one of " + expectedTypes); |
1,263,711 | protected Element windowInternal(Predicate<String> condition) {<NEW_LINE>IUIAutomationCondition isWindow = UIA.createPropertyCondition(Property.<MASK><NEW_LINE>IUIAutomationElementArray windows = UIA.getRootElement().findAll(TreeScope.Descendants, isWindow);<NEW_LINE>int count = windows.getLength();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>IUIAutomationElement child = windows.getElement(i);<NEW_LINE>if (!child.isValid()) {<NEW_LINE>logger.warn("invalid window: {}", child);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String name = child.getCurrentName();<NEW_LINE>if (name == null) {<NEW_LINE>logger.warn("name is null for window: {}", child);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("scanning window: {}", name);<NEW_LINE>}<NEW_LINE>if (condition.test(name)) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("found window: {}", name);<NEW_LINE>}<NEW_LINE>return new WinWindow(this, child).focus();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.warn("failed to find window: {}", condition);<NEW_LINE>return null;<NEW_LINE>} | ControlType, ControlType.Window.value); |
1,198,611 | private Query handleItems(QueryShardContext context, MoreLikeThisQuery mltQuery, Item[] likeItems, Item[] unlikeItems, boolean include, List<String> moreLikeFields, boolean useDefaultField) throws IOException {<NEW_LINE>// set default index, type and fields if not specified<NEW_LINE>for (Item item : likeItems) {<NEW_LINE>setDefaultIndexTypeFields(context, item, moreLikeFields, useDefaultField);<NEW_LINE>}<NEW_LINE>for (Item item : unlikeItems) {<NEW_LINE>setDefaultIndexTypeFields(context, item, moreLikeFields, useDefaultField);<NEW_LINE>}<NEW_LINE>// fetching the items with multi-termvectors API<NEW_LINE>MultiTermVectorsResponse likeItemsResponse = fetchResponse(context.getClient(), likeItems);<NEW_LINE>// getting the Fields for liked items<NEW_LINE>mltQuery<MASK><NEW_LINE>// getting the Fields for unliked items<NEW_LINE>if (unlikeItems.length > 0) {<NEW_LINE>MultiTermVectorsResponse unlikeItemsResponse = fetchResponse(context.getClient(), unlikeItems);<NEW_LINE>org.apache.lucene.index.Fields[] unlikeFields = getFieldsFor(unlikeItemsResponse);<NEW_LINE>if (unlikeFields.length > 0) {<NEW_LINE>mltQuery.setUnlikeFields(unlikeFields);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BooleanQuery.Builder boolQuery = new BooleanQuery.Builder();<NEW_LINE>boolQuery.add(mltQuery, BooleanClause.Occur.SHOULD);<NEW_LINE>// exclude the items from the search<NEW_LINE>if (!include) {<NEW_LINE>handleExclude(boolQuery, likeItems, context);<NEW_LINE>}<NEW_LINE>return boolQuery.build();<NEW_LINE>} | .setLikeFields(getFieldsFor(likeItemsResponse)); |
308,506 | public final void refresh() {<NEW_LINE>final String[] results = new String[4];<NEW_LINE>BigDecimal version = null;<NEW_LINE>try {<NEW_LINE>version = model.runReadAction(new MetadataModelAction<EjbJarMetadata, BigDecimal>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public BigDecimal run(EjbJarMetadata metadata) throws Exception {<NEW_LINE>EntityAndSession model = (EntityAndSession) metadata.findByEjbClass(ejbClass);<NEW_LINE>if (model != null) {<NEW_LINE>results[LOCAL] = model.getLocal();<NEW_LINE>results[REMOTE] = model.getRemote();<NEW_LINE>results[<MASK><NEW_LINE>results[REMOTE_HOME] = model.getHome();<NEW_LINE>}<NEW_LINE>return metadata.getRoot().getVersion();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>Exceptions.printStackTrace(ioe);<NEW_LINE>}<NEW_LINE>this.simplified = version == null ? true : (version.doubleValue() > 2.1);<NEW_LINE>local = results[LOCAL];<NEW_LINE>remote = results[REMOTE];<NEW_LINE>localHome = results[LOCAL_HOME];<NEW_LINE>remoteHome = results[REMOTE_HOME];<NEW_LINE>} | LOCAL_HOME] = model.getLocalHome(); |
1,072,849 | public static Object[] fromTensor(Tensor<?> tensor) {<NEW_LINE>Preconditions.checkArgument(tensor.shape().numDimensions() == 1, "Can only convert tensors with shape long[]");<NEW_LINE>final int size = (int) tensor.shape().size(0);<NEW_LINE>Object[] res = new Object[size];<NEW_LINE>if (TInt32.DTYPE.equals(tensor.dataType())) {<NEW_LINE>int[] data = StdArrays.array1dCopyOf((<MASK><NEW_LINE>for (int i = 0; i < size; i += 1) {<NEW_LINE>res[i] = data[i];<NEW_LINE>}<NEW_LINE>} else if (TFloat32.DTYPE.equals(tensor.dataType())) {<NEW_LINE>float[] data = StdArrays.array1dCopyOf((FloatNdArray) tensor.data());<NEW_LINE>for (int i = 0; i < size; i += 1) {<NEW_LINE>res[i] = data[i];<NEW_LINE>}<NEW_LINE>} else if (TInt64.DTYPE.equals(tensor.dataType())) {<NEW_LINE>long[] data = StdArrays.array1dCopyOf((LongNdArray) tensor.data());<NEW_LINE>for (int i = 0; i < size; i += 1) {<NEW_LINE>res[i] = data[i];<NEW_LINE>}<NEW_LINE>} else if (TFloat64.DTYPE.equals(tensor.dataType())) {<NEW_LINE>double[] data = StdArrays.array1dCopyOf((DoubleNdArray) tensor.data());<NEW_LINE>for (int i = 0; i < size; i += 1) {<NEW_LINE>res[i] = data[i];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("Type can't be converted from tensor: " + tensor.dataType().name());<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | IntNdArray) tensor.data()); |
147,386 | private void applyStyle(HTMLElement element, CSSElement selector, HTMLComponent htmlC) {<NEW_LINE>if ((element.getUi() != null) && (element.getUi().size() > 0)) {<NEW_LINE>if (!HTMLComponent.PROCESS_HTML_MP1_ONLY) {<NEW_LINE>String reset = selector.getAttributeById(CSSElement.CSS_COUNTER_RESET);<NEW_LINE>if (reset != null) {<NEW_LINE>htmlC.incCounter(reset, true);<NEW_LINE>}<NEW_LINE>String inc = selector.getAttributeById(CSSElement.CSS_COUNTER_INCREMENT);<NEW_LINE>if (inc != null) {<NEW_LINE>htmlC.incCounter(inc, false);<NEW_LINE>}<NEW_LINE>if ((selector.getSelectorPseudoClass() & (CSSElement.PC_BEFORE | CSSElement.PC_AFTER)) != 0) {<NEW_LINE>handleContentProperty(element, selector, htmlC);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int iter = 0; iter < element.getUi().size(); iter++) {<NEW_LINE>Object o = element.getUi().elementAt(iter);<NEW_LINE>if (o != null && o instanceof Component) {<NEW_LINE>final Component cmp = (Component) o;<NEW_LINE>applyStyleToUIElement(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | cmp, selector, element, htmlC); |
24,054 | public PriorityQueue<T> deserialize(final String s, final byte[] bytes) {<NEW_LINE>if (bytes == null || bytes.length == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final PriorityQueue<T> priorityQueue = new PriorityQueue<>(comparator);<NEW_LINE>final DataInputStream dataInputStream = new <MASK><NEW_LINE>try {<NEW_LINE>final int records = dataInputStream.readInt();<NEW_LINE>for (int i = 0; i < records; i++) {<NEW_LINE>final byte[] valueBytes = new byte[dataInputStream.readInt()];<NEW_LINE>if (dataInputStream.read(valueBytes) != valueBytes.length) {<NEW_LINE>throw new BufferUnderflowException();<NEW_LINE>}<NEW_LINE>;<NEW_LINE>priorityQueue.add(valueDeserializer.deserialize(s, valueBytes));<NEW_LINE>}<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new RuntimeException("Unable to deserialize PriorityQueue", e);<NEW_LINE>}<NEW_LINE>return priorityQueue;<NEW_LINE>} | DataInputStream(new ByteArrayInputStream(bytes)); |
944,544 | protected void readBinaryChildren(ClassFile classFile, HashMap newElements, IBinaryType typeInfo) {<NEW_LINE>ArrayList childrenHandles = new ArrayList();<NEW_LINE>BinaryType type = (BinaryType) classFile.getType();<NEW_LINE>ArrayList typeParameterHandles = new ArrayList();<NEW_LINE>if (typeInfo != null) {<NEW_LINE>// may not be a valid class file<NEW_LINE>generateAnnotationsInfos(type, typeInfo.getAnnotations(), typeInfo.getTagBits(), newElements);<NEW_LINE>generateTypeParameterInfos(type, typeInfo.getGenericSignature(), newElements, typeParameterHandles);<NEW_LINE>generateFieldInfos(type, typeInfo, newElements, childrenHandles);<NEW_LINE>generateRecordComponentInfos(type, typeInfo, newElements, childrenHandles);<NEW_LINE>generateMethodInfos(type, typeInfo, newElements, childrenHandles, typeParameterHandles);<NEW_LINE>// Note inner class are separate openables that are not opened here: no need to pass in newElements<NEW_LINE>generateInnerClassHandles(type, typeInfo, childrenHandles);<NEW_LINE>}<NEW_LINE>this.binaryChildren = new JavaElement[childrenHandles.size()];<NEW_LINE>childrenHandles.toArray(this.binaryChildren);<NEW_LINE>int typeParameterHandleSize = typeParameterHandles.size();<NEW_LINE>if (typeParameterHandleSize == 0) {<NEW_LINE>this.typeParameters = TypeParameter.NO_TYPE_PARAMETERS;<NEW_LINE>} else {<NEW_LINE>this<MASK><NEW_LINE>typeParameterHandles.toArray(this.typeParameters);<NEW_LINE>}<NEW_LINE>} | .typeParameters = new ITypeParameter[typeParameterHandleSize]; |
1,283,532 | protected void storagePermissionGranted() {<NEW_LINE>mHasStoragePermission = true;<NEW_LINE>if (mAttachFileWithoutPermission != null && mAttachFileWithoutPermission.size() > 0) {<NEW_LINE>mProcessingAttachmentLayout.setVisibility(View.VISIBLE);<NEW_LINE>String[] uriStrings = new String[mAttachFileWithoutPermission.size()];<NEW_LINE>for (int i = 0; i < mAttachFileWithoutPermission.size(); i++) {<NEW_LINE>uriStrings[i] = mAttachFileWithoutPermission.<MASK><NEW_LINE>}<NEW_LINE>Data workerData = new Data.Builder().putStringArray(KEY_INPUT_DATA_FILE_URIS_STRING_ARRAY, uriStrings).build();<NEW_LINE>OneTimeWorkRequest importAttachmentsWork = new OneTimeWorkRequest.Builder(ImportAttachmentsWorker.class).setInputData(workerData).build();<NEW_LINE>workManager.enqueue(importAttachmentsWork);<NEW_LINE>mAttachFileWithoutPermission = null;<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(mAttachTakePhotoWithoutPermission)) {<NEW_LINE>mProcessingAttachmentLayout.setVisibility(View.VISIBLE);<NEW_LINE>handleTakePhotoRequest(mAttachTakePhotoWithoutPermission);<NEW_LINE>mAttachTakePhotoWithoutPermission = null;<NEW_LINE>}<NEW_LINE>} | get(i).toString(); |
281,356 | private List<MediaSessionCompat.QueueItem> buildQueue() {<NEW_LINE>List<MediaSessionCompat.QueueItem> queue = null;<NEW_LINE>if (mPlaybackManager.getPlaylist() != null) {<NEW_LINE><MASK><NEW_LINE>int currentIndex = mPlaybackManager.getCurrentIndex();<NEW_LINE>for (int i = Math.max(0, currentIndex - 1); i < Math.min(mPlaybackManager.getPlaybackListSize(), currentIndex + 40); i++) {<NEW_LINE>PlaylistEntry entry = mPlaybackManager.getPlaybackListEntry(i);<NEW_LINE>MediaDescriptionCompat.Builder descBuilder = new MediaDescriptionCompat.Builder();<NEW_LINE>descBuilder.setMediaId(entry.getCacheKey());<NEW_LINE>descBuilder.setTitle(entry.getQuery().getPrettyName());<NEW_LINE>descBuilder.setSubtitle(entry.getArtist().getPrettyName());<NEW_LINE>MediaSessionCompat.QueueItem item = new MediaSessionCompat.QueueItem(descBuilder.build(), i);<NEW_LINE>queue.add(item);<NEW_LINE>mQueueMap.put(i, entry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return queue;<NEW_LINE>} | queue = new ArrayList<>(); |
1,678,475 | public static boolean maybeUpdateTopicConfig(AdminClient adminClient, NewTopic topicToUpdateConfigs) {<NEW_LINE>String topicName = topicToUpdateConfigs.name();<NEW_LINE>// Retrieve topic config to check if it needs an update.<NEW_LINE>ConfigResource topicResource = new ConfigResource(ConfigResource.Type.TOPIC, topicName);<NEW_LINE>DescribeConfigsResult describeConfigsResult = adminClient.describeConfigs(Collections.singleton(topicResource));<NEW_LINE>Config topicConfig;<NEW_LINE>try {<NEW_LINE>topicConfig = describeConfigsResult.values().get(topicResource).get(CLIENT_REQUEST_TIMEOUT_MS, TimeUnit.MILLISECONDS);<NEW_LINE>} catch (InterruptedException | ExecutionException | TimeoutException e) {<NEW_LINE>LOG.<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Update configs if needed.<NEW_LINE>Map<String, String> desiredConfig = topicToUpdateConfigs.configs();<NEW_LINE>if (desiredConfig != null) {<NEW_LINE>Set<AlterConfigOp> alterConfigOps = new HashSet<>();<NEW_LINE>maybeUpdateConfig(alterConfigOps, desiredConfig, topicConfig);<NEW_LINE>if (!alterConfigOps.isEmpty()) {<NEW_LINE>AlterConfigsResult alterConfigsResult = adminClient.incrementalAlterConfigs(Collections.singletonMap(topicResource, alterConfigOps));<NEW_LINE>try {<NEW_LINE>alterConfigsResult.values().get(topicResource).get(CLIENT_REQUEST_TIMEOUT_MS, TimeUnit.MILLISECONDS);<NEW_LINE>} catch (InterruptedException | ExecutionException | TimeoutException e) {<NEW_LINE>LOG.warn("Config change for topic {} failed.", topicName, e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | warn("Config check for topic {} failed due to failure to describe its configs.", topicName, e); |
506,156 | public void suspend() throws JRException {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Fill " + subreportFiller.fillerId + ": notifying on suspend");<NEW_LINE>}<NEW_LINE>// signals to the master filler that is has finished the page<NEW_LINE>subreportFiller.notifyAll();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Fill " + subreportFiller.fillerId + ": waiting to continue");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// waits until the master filler notifies it that can continue with the next page<NEW_LINE>subreportFiller.wait();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>if (subreportFiller.fillContext.isCanceled() || subreportFiller.isDeliberatelyInterrupted()) {<NEW_LINE>// only log a debug message if cancel was requested<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Fill " + subreportFiller.fillerId + ": exception", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (log.isErrorEnabled()) {<NEW_LINE>log.error("Fill " + subreportFiller.fillerId + ": exception", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Fill " + subreportFiller.fillerId + ": notified to continue");<NEW_LINE>}<NEW_LINE>} | JRException(EXCEPTION_MESSAGE_KEY_THREAD_SUBREPORT_RUNNER_WAIT_ERROR, null, e); |
1,206,947 | public int codePointBefore(int index) {<NEW_LINE>int currentLength = lengthInternal();<NEW_LINE>if (index > 0 && index <= currentLength) {<NEW_LINE>// Check if the StringBuilder is compressed<NEW_LINE>if (String.COMPACT_STRINGS && count >= 0) {<NEW_LINE>return helpers.byteToCharUnsigned(helpers.getByteFromArrayByIndex(value, index - 1));<NEW_LINE>} else {<NEW_LINE>int low = value[index - 1];<NEW_LINE>if (index > 1 && low >= Character.MIN_LOW_SURROGATE && low <= Character.MAX_LOW_SURROGATE) {<NEW_LINE>int high = value[index - 2];<NEW_LINE>if (high >= Character.MIN_HIGH_SURROGATE && high <= Character.MAX_HIGH_SURROGATE) {<NEW_LINE>return 0x10000 + ((high - Character.MIN_HIGH_SURROGATE) << 10) <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return low;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new StringIndexOutOfBoundsException(index);<NEW_LINE>}<NEW_LINE>} | + (low - Character.MIN_LOW_SURROGATE); |
1,550,331 | public void execute(RenderHandler handler) throws IOException, Exception {<NEW_LINE>Long <MASK><NEW_LINE>boolean absoluteURL = handler.getBoolean("absoluteURL", true);<NEW_LINE>SysSite site = getSite(handler);<NEW_LINE>if (CommonUtils.notEmpty(id)) {<NEW_LINE>CmsContentProduct entity = service.getEntity(id);<NEW_LINE>if (null != entity && site.getId() == entity.getSiteId()) {<NEW_LINE>if (absoluteURL) {<NEW_LINE>entity.setCover(templateComponent.getUrl(site, true, entity.getCover()));<NEW_LINE>}<NEW_LINE>handler.put("object", entity).render();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Long[] ids = handler.getLongArray("ids");<NEW_LINE>if (CommonUtils.notEmpty(ids)) {<NEW_LINE>List<CmsContentProduct> entityList = service.getEntitys(ids);<NEW_LINE>Consumer<CmsContentProduct> consumer = e -> {<NEW_LINE>if (absoluteURL) {<NEW_LINE>e.setCover(templateComponent.getUrl(site, true, e.getCover()));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Map<String, CmsContentProduct> map = CommonUtils.listToMap(entityList, k -> k.getId().toString(), consumer, entity -> site.getId() == entity.getSiteId());<NEW_LINE>handler.put("map", map).render();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | id = handler.getLong("id"); |
706,220 | protected void dataCalculations(Player player, float skillValue) {<NEW_LINE>// BLAST MINING<NEW_LINE>if (canBlast || canDemoExpert || canBiggerBombs) {<NEW_LINE>MiningManager miningManager = UserManager.getPlayer(player).getMiningManager();<NEW_LINE>blastMiningRank = miningManager.getBlastMiningTier();<NEW_LINE>bonusTNTDrops = miningManager.getDropMultiplier();<NEW_LINE>// Base received in TNT is 30%<NEW_LINE>oreBonus = percent.format(miningManager.getOreBonus() / 30.0D);<NEW_LINE>// debrisReduction = percent.format(miningManager.getDebrisReduction() / 30.0D); // Base received in TNT is 30%<NEW_LINE>blastDamageDecrease = percent.format(<MASK><NEW_LINE>blastRadiusIncrease = miningManager.getBlastRadiusModifier();<NEW_LINE>}<NEW_LINE>// DOUBLE DROPS<NEW_LINE>if (canDoubleDrop) {<NEW_LINE>String[] doubleDropStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.MINING_DOUBLE_DROPS);<NEW_LINE>doubleDropChance = doubleDropStrings[0];<NEW_LINE>doubleDropChanceLucky = doubleDropStrings[1];<NEW_LINE>}<NEW_LINE>// SUPER BREAKER<NEW_LINE>if (canSuperBreaker) {<NEW_LINE>String[] superBreakerStrings = calculateLengthDisplayValues(player, skillValue);<NEW_LINE>superBreakerLength = superBreakerStrings[0];<NEW_LINE>superBreakerLengthEndurance = superBreakerStrings[1];<NEW_LINE>}<NEW_LINE>} | miningManager.getBlastDamageModifier() / 100.0D); |
1,612,216 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<Wo> <MASK><NEW_LINE>Work work = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>work = emc.find(id, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, work)) {<NEW_LINE>throw new ExceptionWorkAccessDenied(effectivePerson.getDistinguishedName(), work.getTitle(), work.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Wo wo = ThisApplication.context().applications().putQuery(x_processplatform_service_processing.class, Applications.joinQueryUri("data", "work", work.getId(), path0, path1, path2), jsonElement, work.getJob()).getData(Wo.class);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>} | result = new ActionResult<>(); |
1,116,296 | private Mono<Response<Flux<ByteBuffer>>> reimageAllWithResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (vmScaleSetName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (instanceId == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-06-01";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.reimageAll(this.client.getEndpoint(), resourceGroupName, vmScaleSetName, instanceId, apiVersion, this.client.getSubscriptionId(), context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
104,953 | public void compare() {<NEW_LINE>Map<Long, ClusterMeta> currentClustersMap = current.getClusters().values().stream().collect(Collectors.toMap(ClusterMeta<MASK><NEW_LINE>Map<Long, ClusterMeta> futureClustersMap = future.getClusters().values().stream().collect(Collectors.toMap(ClusterMeta::getDbId, clusterMeta -> clusterMeta));<NEW_LINE>Triple<Set<Long>, Set<Long>, Set<Long>> result = getDiff(currentClustersMap.keySet(), futureClustersMap.keySet());<NEW_LINE>Set<Long> addedClusterDbIds = result.getFirst();<NEW_LINE>Set<Long> intersectionClusterDbIds = result.getMiddle();<NEW_LINE>Set<Long> deletedClusterDbIds = result.getLast();<NEW_LINE>for (Long clusterDbId : addedClusterDbIds) {<NEW_LINE>added.add(futureClustersMap.get(clusterDbId));<NEW_LINE>}<NEW_LINE>for (Long clusterDbId : deletedClusterDbIds) {<NEW_LINE>removed.add(currentClustersMap.get(clusterDbId));<NEW_LINE>}<NEW_LINE>for (Long clusterDbId : intersectionClusterDbIds) {<NEW_LINE>ClusterMeta currentMeta = currentClustersMap.get(clusterDbId);<NEW_LINE>ClusterMeta futureMeta = futureClustersMap.get(clusterDbId);<NEW_LINE>if (!reflectionEquals(currentMeta, futureMeta)) {<NEW_LINE>ClusterMetaComparator clusterMetaComparator = new ClusterMetaComparator(currentMeta, futureMeta);<NEW_LINE>clusterMetaComparator.compare();<NEW_LINE>modified.add(clusterMetaComparator);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ::getDbId, clusterMeta -> clusterMeta)); |
666,874 | final GetNetworkProfileResult executeGetNetworkProfile(GetNetworkProfileRequest getNetworkProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getNetworkProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetNetworkProfileRequest> request = null;<NEW_LINE>Response<GetNetworkProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetNetworkProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getNetworkProfileRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetNetworkProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetNetworkProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetNetworkProfileResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
7,791 | public IRubyObject run(ThreadContext context, ChannelFD channelFD) throws InterruptedException {<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE><MASK><NEW_LINE>ByteBuffer wrap = ByteBuffer.wrap(strByteList.unsafeBytes(), strByteList.begin(), length);<NEW_LINE>int written = 0;<NEW_LINE>try {<NEW_LINE>if (fd.chFile != null) {<NEW_LINE>written = fd.chFile.write(wrap, off);<NEW_LINE>} else if (fd.chNative != null) {<NEW_LINE>written = (int) runtime.getPosix().pwrite(fd.chNative.getFD(), wrap, length, off);<NEW_LINE>} else if (fd.chWrite != null) {<NEW_LINE>written = fd.chWrite.write(wrap);<NEW_LINE>} else {<NEW_LINE>throw runtime.newIOError("not opened for writing");<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw Helpers.newIOErrorFromException(runtime, ioe);<NEW_LINE>}<NEW_LINE>return runtime.newFixnum(written);<NEW_LINE>} | int length = strByteList.realSize(); |
240,742 | private void fixupSegment(SegmentCommand segment, boolean is64bit) throws IOException {<NEW_LINE>long adjustment = <MASK><NEW_LINE>if (segment.getFileOffset() > 0) {<NEW_LINE>fixup(segment.getStartIndex() + (is64bit ? 0x28 : 0x20), adjustment, is64bit ? 8 : 4, segment);<NEW_LINE>}<NEW_LINE>long sectionStartIndex = segment.getStartIndex() + (is64bit ? 0x48 : 0x38);<NEW_LINE>for (Section section : segment.getSections()) {<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// For some reason the section file offsets in the iOS 10 DYLD cache do not want<NEW_LINE>// the adjustment despite the segment needed it. We can expect to see warnings<NEW_LINE>// in that particular version.<NEW_LINE>if (section.getOffset() > 0 && section.getSize() > 0) {<NEW_LINE>fixup(sectionStartIndex + (is64bit ? 0x30 : 0x28), adjustment, 4, segment);<NEW_LINE>}<NEW_LINE>if (section.getRelocationOffset() > 0) {<NEW_LINE>fixup(sectionStartIndex + (is64bit ? 0x38 : 0x30), adjustment, 4, segment);<NEW_LINE>}<NEW_LINE>sectionStartIndex += is64bit ? 0x50 : 0x44;<NEW_LINE>}<NEW_LINE>} | packedSegmentAdjustments.getOrDefault(segment, 0); |
1,101,323 | public static boolean isOneToOneMapping(@Nonnull Project ideProject, @Nonnull DataNode<ProjectData> externalProject) {<NEW_LINE>String linkedExternalProjectPath = null;<NEW_LINE>for (ExternalSystemManager<?, ?, ?, ?, ?> manager : ExternalSystemApiUtil.getAllManagers()) {<NEW_LINE><MASK><NEW_LINE>AbstractExternalSystemSettings systemSettings = ExternalSystemApiUtil.getSettings(ideProject, externalSystemId);<NEW_LINE>Collection projectsSettings = systemSettings.getLinkedProjectsSettings();<NEW_LINE>int linkedProjectsNumber = projectsSettings.size();<NEW_LINE>if (linkedProjectsNumber > 1) {<NEW_LINE>// More than one external project of the same external system type is linked to the given ide project.<NEW_LINE>return false;<NEW_LINE>} else if (linkedProjectsNumber == 1) {<NEW_LINE>if (linkedExternalProjectPath == null) {<NEW_LINE>// More than one external project of different external system types is linked to the current ide project.<NEW_LINE>linkedExternalProjectPath = ((ExternalProjectSettings) projectsSettings.iterator().next()).getExternalProjectPath();<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ProjectData projectData = externalProject.getData();<NEW_LINE>if (linkedExternalProjectPath != null && !linkedExternalProjectPath.equals(projectData.getLinkedExternalProjectPath())) {<NEW_LINE>// New external project is being linked.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<String> externalModulePaths = ContainerUtilRt.newHashSet();<NEW_LINE>for (DataNode<ModuleData> moduleNode : ExternalSystemApiUtil.findAll(externalProject, ProjectKeys.MODULE)) {<NEW_LINE>externalModulePaths.add(moduleNode.getData().getLinkedExternalProjectPath());<NEW_LINE>}<NEW_LINE>externalModulePaths.remove(linkedExternalProjectPath);<NEW_LINE>for (Module module : ModuleManager.getInstance(ideProject).getModules()) {<NEW_LINE>String path = ExternalSystemApiUtil.getExtensionSystemOption(module, ExternalSystemConstants.LINKED_PROJECT_PATH_KEY);<NEW_LINE>if (!StringUtil.isEmpty(path) && !externalModulePaths.remove(path)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return externalModulePaths.isEmpty();<NEW_LINE>} | ProjectSystemId externalSystemId = manager.getSystemId(); |
1,039,484 | private void ins_chars(ByteBuffer buf) {<NEW_LINE>final String string = new String(buf.array(), buf.arrayOffset() + buf.position(), buf.remaining(), IO.UTF8);<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>Document doc = area.getDocument();<NEW_LINE>int pos = area.getCaretPosition();<NEW_LINE>doc.insertString(pos, string, inputStyle);<NEW_LINE>area.setCaretPosition(pos + string.length());<NEW_LINE>area.select(area.getCaretPosition(<MASK><NEW_LINE>// Cut the document to fit into the MAX_DOC_SIZE.<NEW_LINE>// See JRUBY-4237.<NEW_LINE>int extra = doc.getLength() - MAX_DOC_SIZE;<NEW_LINE>if (extra > 0) {<NEW_LINE>int removeBytes = extra + MAX_DOC_SIZE / 10;<NEW_LINE>doc.remove(0, removeBytes);<NEW_LINE>startPos -= removeBytes;<NEW_LINE>}<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ), area.getCaretPosition()); |
872,949 | public void marshall(OpsItemSummary opsItemSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (opsItemSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getCreatedBy(), CREATEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getCreatedTime(), CREATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getLastModifiedBy(), LASTMODIFIEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getLastModifiedTime(), LASTMODIFIEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getPriority(), PRIORITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getSource(), SOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getOpsItemId(), OPSITEMID_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getTitle(), TITLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getOperationalData(), OPERATIONALDATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getCategory(), CATEGORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getSeverity(), SEVERITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getActualStartTime(), ACTUALSTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getActualEndTime(), ACTUALENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getPlannedStartTime(), PLANNEDSTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemSummary.getPlannedEndTime(), PLANNEDENDTIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | opsItemSummary.getOpsItemType(), OPSITEMTYPE_BINDING); |
558,645 | static NettyServerHandler newHandler(ChannelPromise channelUnused, Http2FrameReader frameReader, Http2FrameWriter frameWriter, ServerTransportListener transportListener, List<? extends ServerStreamTracer.Factory> streamTracerFactories, TransportTracer transportTracer, int maxStreams, boolean autoFlowControl, int flowControlWindow, int maxHeaderListSize, int maxMessageSize, long keepAliveTimeInNanos, long keepAliveTimeoutInNanos, long maxConnectionIdleInNanos, long maxConnectionAgeInNanos, long maxConnectionAgeGraceInNanos, boolean permitKeepAliveWithoutCalls, long permitKeepAliveTimeInNanos, Attributes eagAttributes) {<NEW_LINE>Preconditions.checkArgument(maxStreams > 0, "maxStreams must be positive: %s", maxStreams);<NEW_LINE>Preconditions.checkArgument(flowControlWindow > 0, "flowControlWindow must be positive: %s", flowControlWindow);<NEW_LINE>Preconditions.checkArgument(maxHeaderListSize > 0, "maxHeaderListSize must be positive: %s", maxHeaderListSize);<NEW_LINE>Preconditions.checkArgument(maxMessageSize > 0, "maxMessageSize must be positive: %s", maxMessageSize);<NEW_LINE>final Http2Connection connection = new DefaultHttp2Connection(true);<NEW_LINE>WeightedFairQueueByteDistributor dist = new WeightedFairQueueByteDistributor(connection);<NEW_LINE>// Make benchmarks fast again.<NEW_LINE>dist.allocationQuantum(16 * 1024);<NEW_LINE>DefaultHttp2RemoteFlowController controller = new DefaultHttp2RemoteFlowController(connection, dist);<NEW_LINE>connection.remote().flowController(controller);<NEW_LINE>final KeepAliveEnforcer keepAliveEnforcer = new KeepAliveEnforcer(permitKeepAliveWithoutCalls, permitKeepAliveTimeInNanos, TimeUnit.NANOSECONDS);<NEW_LINE>// Create the local flow controller configured to auto-refill the connection window.<NEW_LINE>connection.local().flowController(new DefaultHttp2LocalFlowController(connection, DEFAULT_WINDOW_UPDATE_RATIO, true));<NEW_LINE>frameWriter = new WriteMonitoringFrameWriter(frameWriter, keepAliveEnforcer);<NEW_LINE>Http2ConnectionEncoder encoder = new DefaultHttp2ConnectionEncoder(connection, frameWriter);<NEW_LINE>encoder = new Http2ControlFrameLimitEncoder(encoder, 10000);<NEW_LINE>Http2ConnectionDecoder decoder = new DefaultHttp2ConnectionDecoder(connection, encoder, frameReader);<NEW_LINE>Http2Settings settings = new Http2Settings();<NEW_LINE>settings.initialWindowSize(flowControlWindow);<NEW_LINE>settings.maxConcurrentStreams(maxStreams);<NEW_LINE>settings.maxHeaderListSize(maxHeaderListSize);<NEW_LINE>return new NettyServerHandler(channelUnused, connection, transportListener, streamTracerFactories, transportTracer, decoder, encoder, settings, maxMessageSize, keepAliveTimeInNanos, keepAliveTimeoutInNanos, maxConnectionIdleInNanos, maxConnectionAgeInNanos, <MASK><NEW_LINE>} | maxConnectionAgeGraceInNanos, keepAliveEnforcer, autoFlowControl, eagAttributes); |
1,656,103 | public byte[] validateRetrieveKeyWithService(UUID universeUUID, UUID configUUID, byte[] keyRef, EncryptionAtRestConfig config, ObjectNode authConfig) {<NEW_LINE>byte[] keyVal = null;<NEW_LINE>final String endpoint = String.format("/crypto/v1/keys/%s/export", new String(keyRef));<NEW_LINE>final String sessionToken = retrieveSessionAuthorization(authConfig);<NEW_LINE>final Map<String, String> headers = ImmutableMap.of("Authorization", sessionToken);<NEW_LINE>final String baseUrl = authConfig.get("base_url").asText();<NEW_LINE>final String url = <MASK><NEW_LINE>final JsonNode response = this.apiHelper.getRequest(url, headers);<NEW_LINE>final JsonNode errors = response.get("error");<NEW_LINE>if (errors != null)<NEW_LINE>throw new RuntimeException(errors.toString());<NEW_LINE>keyVal = Base64.getDecoder().decode(response.get("value").asText());<NEW_LINE>return keyVal;<NEW_LINE>} | Util.buildURL(baseUrl, endpoint); |
567,894 | public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {<NEW_LINE>if (actionId == EditorInfo.IME_ACTION_DONE) {<NEW_LINE>String voltageValue = displayPV1.getText().toString();<NEW_LINE>voltageValue = voltageValue.replace("V", "");<NEW_LINE>float <MASK><NEW_LINE>if (voltage < -5.00f) {<NEW_LINE>voltage = -5.00f;<NEW_LINE>displayPV1.setText(voltage + " V");<NEW_LINE>}<NEW_LINE>if (voltage > 5.00f) {<NEW_LINE>voltage = 5.00f;<NEW_LINE>displayPV1.setText(voltage + " V");<NEW_LINE>}<NEW_LINE>controllerPV1.setProgress(mapPowerToProgress(voltage, PV1_CONTROLLER_MAX, 5.00f, -5.00f));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | voltage = Float.parseFloat(voltageValue); |
741,097 | @NanoTimeGranularity<NEW_LINE>static ShortDuration testNanoTimeGranularity() {<NEW_LINE>long total = 0L;<NEW_LINE>for (int i = 0; i < TRIALS; i++) {<NEW_LINE>long first = System.nanoTime();<NEW_LINE>long second = System.nanoTime();<NEW_LINE>long third = System.nanoTime();<NEW_LINE>long fourth = System.nanoTime();<NEW_LINE>long fifth = System.nanoTime();<NEW_LINE>long sixth = System.nanoTime();<NEW_LINE>long seventh = System.nanoTime();<NEW_LINE><MASK><NEW_LINE>long ninth = System.nanoTime();<NEW_LINE>total += second - first;<NEW_LINE>total += third - second;<NEW_LINE>total += fourth - third;<NEW_LINE>total += fifth - fourth;<NEW_LINE>total += sixth - fifth;<NEW_LINE>total += seventh - sixth;<NEW_LINE>total += eighth - seventh;<NEW_LINE>total += ninth - eighth;<NEW_LINE>}<NEW_LINE>return ShortDuration.of(LongMath.divide(total, TRIALS * 8, CEILING), NANOSECONDS);<NEW_LINE>} | long eighth = System.nanoTime(); |
237,137 | static Ip inferRouterId(Configuration c) {<NEW_LINE>if (c.getAllInterfaces().containsKey(LOOPBACK_INTERFACE_NAME)) {<NEW_LINE>Optional<ConcreteInterfaceAddress> maxLoIp = c.getAllInterfaces().get(LOOPBACK_INTERFACE_NAME).getAllConcreteAddresses().stream().filter(addr -> !LOOPBACK_PREFIX.containsIp(addr.getIp())).max(ConcreteInterfaceAddress::compareTo);<NEW_LINE>if (maxLoIp.isPresent()) {<NEW_LINE>return maxLoIp.get().getIp();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Optional<ConcreteInterfaceAddress> biggestInterfaceIp = c.getAllInterfaces().values().stream().filter(iface -> !iface.getName().equals(LOOPBACK_INTERFACE_NAME)).flatMap(iface -> iface.getAllConcreteAddresses().stream()).max(InterfaceAddress::compareTo);<NEW_LINE>return biggestInterfaceIp.map(ConcreteInterfaceAddress::getIp).orElseGet(() <MASK><NEW_LINE>} | -> Ip.parse("0.0.0.0")); |
844,524 | final ListServiceTemplateVersionsResult executeListServiceTemplateVersions(ListServiceTemplateVersionsRequest listServiceTemplateVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listServiceTemplateVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListServiceTemplateVersionsRequest> request = null;<NEW_LINE>Response<ListServiceTemplateVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListServiceTemplateVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listServiceTemplateVersionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Proton");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListServiceTemplateVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListServiceTemplateVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListServiceTemplateVersionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
25,065 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View view = View.inflate(getContext(), R.layout.fragment_base, null);<NEW_LINE>mJzvdStd = view.findViewById(R.id.jz_video);<NEW_LINE>mOrientation = view.findViewById(R.id.orientation);<NEW_LINE>mRotationAndVideoSize = view.findViewById(R.id.rotation_and_videosize);<NEW_LINE>mCustomMediaPlayer = view.findViewById(R.id.custom_mediaplayer);<NEW_LINE>mPreLoading = view.findViewById(R.id.preloading);<NEW_LINE>mScreenRotate = view.findViewById(R.id.screen_rotate);<NEW_LINE>serverCn = view.findViewById(R.id.server_cn);<NEW_LINE>serverUs = view.findViewById(R.id.server_us);<NEW_LINE>mOrientation.setOnClickListener(this);<NEW_LINE>mRotationAndVideoSize.setOnClickListener(this);<NEW_LINE>mCustomMediaPlayer.setOnClickListener(this);<NEW_LINE>mPreLoading.setOnClickListener(this);<NEW_LINE>mScreenRotate.setOnClickListener(this);<NEW_LINE>serverCn.setOnClickListener(this);<NEW_LINE>serverUs.setOnClickListener(this);<NEW_LINE>mSensorManager = (SensorManager) <MASK><NEW_LINE>mSensorEventListener = new Jzvd.JZAutoFullscreenListener();<NEW_LINE>return view;<NEW_LINE>} | getContext().getSystemService(SENSOR_SERVICE); |
542,567 | public void addTuner(Tuner tuner) {<NEW_LINE>if (!mTuners.contains(tuner)) {<NEW_LINE>// Get the tuner configuration and apply it to the tuner - this<NEW_LINE>// call should always produce a tuner configuration<NEW_LINE>TunerConfiguration config = mTunerConfigurationModel.getTunerConfiguration(tuner.getTunerType(), tuner.getUniqueID());<NEW_LINE>try {<NEW_LINE>tuner.getTunerController().apply(config);<NEW_LINE>mTuners.add(tuner);<NEW_LINE>int index = mTuners.indexOf(tuner);<NEW_LINE>fireTableRowsInserted(index, index);<NEW_LINE>tuner.addTunerChangeListener(this);<NEW_LINE>} catch (SourceException se) {<NEW_LINE>mLog.error("Couldn't apply tuner configuration to tuner - [" + tuner.getTunerType().name() + "] with id [" + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | tuner.getUniqueID() + "] - tuner will not be included"); |
616,655 | public List<ProjectFileHandler> handle(final ResultSet rs) throws SQLException {<NEW_LINE>if (!rs.next()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final List<ProjectFileHandler> handlers = new ArrayList<>();<NEW_LINE>do {<NEW_LINE>final int <MASK><NEW_LINE>final int version = rs.getInt(2);<NEW_LINE>final long uploadTime = rs.getLong(3);<NEW_LINE>final String uploader = rs.getString(4);<NEW_LINE>final String fileType = rs.getString(5);<NEW_LINE>final String fileName = rs.getString(6);<NEW_LINE>final byte[] md5 = rs.getBytes(7);<NEW_LINE>final int numChunks = rs.getInt(8);<NEW_LINE>final String resourceId = rs.getString(9);<NEW_LINE>final Blob startupDependenciesBlob = rs.getBlob(10);<NEW_LINE>final String uploaderIpAddr = rs.getString(11);<NEW_LINE>Set<Dependency> startupDependencies = Collections.emptySet();<NEW_LINE>if (startupDependenciesBlob != null) {<NEW_LINE>try {<NEW_LINE>startupDependencies = ThinArchiveUtils.parseStartupDependencies(IOUtils.toString(startupDependenciesBlob.getBinaryStream(), StandardCharsets.UTF_8));<NEW_LINE>} catch (IOException | InvalidHashException e) {<NEW_LINE>// This should never happen unless the file is malformed in the database.<NEW_LINE>// The file was already validated when the project was uploaded.<NEW_LINE>throw new SQLException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ProjectFileHandler handler = new ProjectFileHandler(projectId, version, uploadTime, uploader, fileType, fileName, numChunks, md5, startupDependencies, resourceId, uploaderIpAddr);<NEW_LINE>handlers.add(handler);<NEW_LINE>} while (rs.next());<NEW_LINE>return handlers;<NEW_LINE>} | projectId = rs.getInt(1); |
226,201 | public void configure(TestElement el) {<NEW_LINE>super.configure(el);<NEW_LINE>AbstractTestElement samplerBase = (AbstractTestElement) el;<NEW_LINE>urlConfigGui.configure(el);<NEW_LINE>retrieveEmbeddedResources.setSelected(samplerBase.getPropertyAsBoolean(HTTPSamplerBase.IMAGE_PARSER));<NEW_LINE>concurrentDwn.setSelected(samplerBase<MASK><NEW_LINE>concurrentPool.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.CONCURRENT_POOL));<NEW_LINE>useMD5.setSelected(samplerBase.getPropertyAsBoolean(HTTPSamplerBase.MD5, false));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>embeddedAllowRE.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.EMBEDDED_URL_RE, ""));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>embeddedExcludeRE.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.EMBEDDED_URL_EXCLUDE_RE, ""));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>sourceIpAddr.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.IP_SOURCE));<NEW_LINE>sourceIpType.setSelectedIndex(samplerBase.getPropertyAsInt(HTTPSamplerBase.IP_SOURCE_TYPE, HTTPSamplerBase.SOURCE_TYPE_DEFAULT));<NEW_LINE>proxyScheme.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.PROXYSCHEME));<NEW_LINE>proxyHost.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.PROXYHOST));<NEW_LINE>proxyPort.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.PROXYPORT));<NEW_LINE>proxyUser.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.PROXYUSER));<NEW_LINE>proxyPass.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.PROXYPASS));<NEW_LINE>httpImplementation.setSelectedItem(samplerBase.getPropertyAsString(HTTPSamplerBase.IMPLEMENTATION));<NEW_LINE>connectTimeOut.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.CONNECT_TIMEOUT));<NEW_LINE>responseTimeOut.setText(samplerBase.getPropertyAsString(HTTPSamplerBase.RESPONSE_TIMEOUT));<NEW_LINE>} | .getPropertyAsBoolean(HTTPSamplerBase.CONCURRENT_DWN)); |
263,891 | protected PreparedStatement createStatement(boolean withKeys) throws SQLException {<NEW_LINE>boolean addBatches = !configuration.getUseLiterals();<NEW_LINE>listeners.preRender(context);<NEW_LINE>SQLSerializer serializer = createSerializer();<NEW_LINE>PreparedStatement stmt = null;<NEW_LINE>if (batches.isEmpty()) {<NEW_LINE>serializer.serializeMerge(metadata, entity, keys, columns, values, subQuery);<NEW_LINE>context.addSQL(createBindings(metadata, serializer));<NEW_LINE>listeners.rendered(context);<NEW_LINE>listeners.prePrepare(context);<NEW_LINE>stmt = prepareStatementAndSetParameters(serializer, withKeys);<NEW_LINE>context.addPreparedStatement(stmt);<NEW_LINE>listeners.prepared(context);<NEW_LINE>} else {<NEW_LINE>serializer.serializeMerge(metadata, entity, batches.get(0).getKeys(), batches.get(0).getColumns(), batches.get(0).getValues(), batches.get(0).getSubQuery());<NEW_LINE>context.addSQL(createBindings(metadata, serializer));<NEW_LINE>listeners.rendered(context);<NEW_LINE>stmt = prepareStatementAndSetParameters(serializer, withKeys);<NEW_LINE>// add first batch<NEW_LINE>if (addBatches) {<NEW_LINE>stmt.addBatch();<NEW_LINE>}<NEW_LINE>// add other batches<NEW_LINE>for (int i = 1; i < batches.size(); i++) {<NEW_LINE>SQLMergeBatch <MASK><NEW_LINE>listeners.preRender(context);<NEW_LINE>serializer = createSerializer();<NEW_LINE>serializer.serializeMerge(metadata, entity, batch.getKeys(), batch.getColumns(), batch.getValues(), batch.getSubQuery());<NEW_LINE>context.addSQL(createBindings(metadata, serializer));<NEW_LINE>listeners.rendered(context);<NEW_LINE>setParameters(stmt, serializer.getConstants(), serializer.getConstantPaths(), metadata.getParams());<NEW_LINE>if (addBatches) {<NEW_LINE>stmt.addBatch();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return stmt;<NEW_LINE>} | batch = batches.get(i); |
1,510,918 | private // /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>void requestHashesFromSeedNode(int fromHeight, NodeAddress nodeAddress) {<NEW_LINE>RequestStateHashesHandler.Listener<Res> listener = new RequestStateHashesHandler.Listener<>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete(Res getStateHashesResponse, Optional<NodeAddress> peersNodeAddress) {<NEW_LINE>requestStateHashHandlerMap.remove(nodeAddress);<NEW_LINE>List<StH<MASK><NEW_LINE>listeners.forEach(e -> e.onPeersStateHashes(stateHashes, peersNodeAddress));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFault(String errorMessage, @Nullable Connection connection) {<NEW_LINE>log.warn("requestDaoStateHashesHandler with outbound connection failed.\n\tnodeAddress={}\n\t" + "ErrorMessage={}", nodeAddress, errorMessage);<NEW_LINE>requestStateHashHandlerMap.remove(nodeAddress);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Han requestStateHashesHandler = getRequestStateHashesHandler(nodeAddress, listener);<NEW_LINE>requestStateHashHandlerMap.put(nodeAddress, requestStateHashesHandler);<NEW_LINE>requestStateHashesHandler.requestStateHashes(fromHeight);<NEW_LINE>} | > stateHashes = getStateHashesResponse.getStateHashes(); |
826 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1,c2".split(",");<NEW_LINE>String epl = "@name('s0') select " + "window(sb, filter:theString like 'A%') as c0," + "window(sb) as c1," + "window(filter:theString like 'B%', sb) as c2" + " from SupportBean#keepall as sb";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>SupportBean x1 = <MASK><NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { null, new SupportBean[] { x1 }, null });<NEW_LINE>SupportBean a2 = sendEvent(env, "A2", 2);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { new SupportBean[] { a2 }, new SupportBean[] { x1, a2 }, null });<NEW_LINE>env.milestone(0);<NEW_LINE>SupportBean b3 = sendEvent(env, "B3", 3);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { new SupportBean[] { a2 }, new SupportBean[] { x1, a2, b3 }, new SupportBean[] { b3 } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | sendEvent(env, "X1", 1); |
1,376,259 | private Function createDestinationFunction(Program program, Address addr, Address flowFromAddr, RegisterValue regValue, TaskMonitor monitor) {<NEW_LINE><MASK><NEW_LINE>BookmarkManager bookmarkMgr = program.getBookmarkManager();<NEW_LINE>if (!program.getMemory().contains(addr)) {<NEW_LINE>bookmarkMgr.setBookmark(flowFromAddr, BookmarkType.ERROR, "Bad Reference", "No memory for call stub destination at " + addr);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Function function = listing.getFunctionAt(addr);<NEW_LINE>if (regValue != null && regValue.hasValue()) {<NEW_LINE>ProgramContext programContext = program.getProgramContext();<NEW_LINE>RegisterValue oldValue = programContext.getRegisterValue(regValue.getRegister(), addr);<NEW_LINE>if (oldValue == null || !oldValue.hasValue()) {<NEW_LINE>try {<NEW_LINE>programContext.setRegisterValue(addr, addr, regValue);<NEW_LINE>} catch (ContextChangeException e) {<NEW_LINE>throw new AssertException(e);<NEW_LINE>}<NEW_LINE>if (function != null) {<NEW_LINE>AutoAnalysisManager.getAnalysisManager(program).functionDefined(addr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (function != null) {<NEW_LINE>return function;<NEW_LINE>}<NEW_LINE>CodeUnit cu = listing.getCodeUnitContaining(addr);<NEW_LINE>if (cu == null) {<NEW_LINE>throw new AssertException("expected code unit in memory");<NEW_LINE>}<NEW_LINE>if (!addr.equals(cu.getMinAddress())) {<NEW_LINE>bookmarkMgr.setBookmark(cu.getMinAddress(), BookmarkType.ERROR, "Code Unit Conflict", "Expected function entry at " + addr + " referenced by call stub from " + flowFromAddr);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (cu instanceof Data) {<NEW_LINE>Data d = (Data) cu;<NEW_LINE>if (d.isDefined()) {<NEW_LINE>bookmarkMgr.setBookmark(addr, BookmarkType.ERROR, "Code Unit Conflict", "Expected function entry referenced by call stub from " + flowFromAddr);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DisassembleCommand cmd = new DisassembleCommand(addr, null, true);<NEW_LINE>if (!cmd.applyTo(program, monitor)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CreateFunctionCmd cmd = new CreateFunctionCmd(addr);<NEW_LINE>if (cmd.applyTo(program, monitor)) {<NEW_LINE>return cmd.getFunction();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | Listing listing = program.getListing(); |
553,049 | public void loginAsync(long accountId, String passwordTemp, long providerId, boolean retry) {<NEW_LINE>mAccountId = accountId;<NEW_LINE>mPassword = passwordTemp;<NEW_LINE>mProviderId = providerId;<NEW_LINE>mRetryLogin = retry;<NEW_LINE>ContentResolver contentResolver = mContext.getContentResolver();<NEW_LINE>if (mPassword == null)<NEW_LINE>mPassword = Imps.Account.getPassword(contentResolver, mAccountId);<NEW_LINE>mIsGoogleAuth = <MASK><NEW_LINE>if (mIsGoogleAuth) {<NEW_LINE>mPassword = mPassword.split(":")[1];<NEW_LINE>}<NEW_LINE>Cursor cursor = contentResolver.query(Imps.ProviderSettings.CONTENT_URI, new String[] { Imps.ProviderSettings.NAME, Imps.ProviderSettings.VALUE }, Imps.ProviderSettings.PROVIDER + "=?", new String[] { Long.toString(mProviderId) }, null);<NEW_LINE>if (cursor == null)<NEW_LINE>return;<NEW_LINE>Imps.ProviderSettings.QueryMap providerSettings = new Imps.ProviderSettings.QueryMap(cursor, contentResolver, mProviderId, false, null);<NEW_LINE>mUser = makeUser(providerSettings, contentResolver);<NEW_LINE>providerSettings.close();<NEW_LINE>execute(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>do_login();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | mPassword.startsWith(GTalkOAuth2.NAME); |
208,537 | public void presentLocalNotificationWithChannel(final ReadableMap data, final ReadableMap legacyChannelData, final Promise promise) {<NEW_LINE>HashMap<String, java.io.Serializable> details = new HashMap<>();<NEW_LINE>HashMap<String, Object> hashMap = data.toHashMap();<NEW_LINE>if (data.hasKey("categoryId")) {<NEW_LINE>hashMap.put("categoryId", getScopedIdIfNotDetached(data.getString("categoryId")));<NEW_LINE>}<NEW_LINE>details.put("data", hashMap);<NEW_LINE>details.put(NotificationConstants.<MASK><NEW_LINE>details.put(NotificationConstants.NOTIFICATION_EXPERIENCE_SCOPE_KEY_KEY, mExperienceKey.getScopeKey());<NEW_LINE>if (legacyChannelData != null) {<NEW_LINE>String channelId = data.getString("channelId");<NEW_LINE>if (channelId == null) {<NEW_LINE>promise.reject("E_FAILED_PRESENTING_NOTIFICATION", "legacyChannelData was nonnull with no channelId");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NotificationHelper.maybeCreateLegacyStoredChannel(getReactApplicationContext(), mExperienceKey, channelId, legacyChannelData.toHashMap());<NEW_LINE>}<NEW_LINE>int notificationId = new Random().nextInt();<NEW_LINE>NotificationHelper.showNotification(getReactApplicationContext(), notificationId, details, mExponentManifest, new NotificationHelper.Listener() {<NEW_LINE><NEW_LINE>public void onSuccess(int id) {<NEW_LINE>promise.resolve(id);<NEW_LINE>}<NEW_LINE><NEW_LINE>public void onFailure(Exception e) {<NEW_LINE>promise.reject(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | NOTIFICATION_EXPERIENCE_ID_KEY, mExperienceKey.getScopeKey()); |
1,587,455 | public void initialize(Canvas canvas) {<NEW_LINE>this.drawCanvas = canvas;<NEW_LINE>lightGrey = ColorCache.getColor(canvas.getDisplay(), 250, 250, 250);<NEW_LINE>lightGrey2 = ColorCache.getColor(canvas.getDisplay(), 233, 233, 233);<NEW_LINE>colorWhite = ColorCache.getColor(canvas.getDisplay(), 255, 255, 255);<NEW_LINE>Menu menu = new Menu(canvas);<NEW_LINE>final MenuItem mi_binary = new MenuItem(menu, SWT.CHECK);<NEW_LINE>mi_binary.setText<MASK><NEW_LINE>mi_binary.setSelection(COConfigurationManager.getBooleanParameter("ui.scaled.graphics.binary.based"));<NEW_LINE>mi_binary.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event e) {<NEW_LINE>COConfigurationManager.setParameter("ui.scaled.graphics.binary.based", mi_binary.getSelection());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (isSIIECSensitive) {<NEW_LINE>final MenuItem mi_iec = new MenuItem(menu, SWT.CHECK);<NEW_LINE>mi_iec.setText(MessageText.getString("ConfigView.section.style.useSIUnits"));<NEW_LINE>mi_iec.setSelection(COConfigurationManager.getBooleanParameter("config.style.useSIUnits"));<NEW_LINE>mi_iec.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event e) {<NEW_LINE>COConfigurationManager.setParameter("config.style.useSIUnits", mi_iec.getSelection());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>addMenuItems(menu);<NEW_LINE>canvas.setMenu(menu);<NEW_LINE>} | (MessageText.getString("label.binary.scale.basis")); |
431,825 | public static NinePatchIcon createShadeIcon(final int shadeWidth, final int round, final float shadeOpacity) {<NEW_LINE>// Making round value into real rounding radius<NEW_LINE>final int r = round * 2;<NEW_LINE>// Calculating width for temporary image<NEW_LINE>final int inner = Math.max(shadeWidth, round);<NEW_LINE>final int w = shadeWidth * 2 + inner * 2;<NEW_LINE>// Creating shade image<NEW_LINE>final Shape shape = new RoundRectangle2D.Double(shadeWidth, shadeWidth, w - shadeWidth * 2, w - shadeWidth * 2, r, r);<NEW_LINE>final BufferedImage shade = ImageUtils.createShadowImage(w, w, shape, shadeWidth, shadeOpacity, true);<NEW_LINE>// Creating nine-patch icon based on shade image<NEW_LINE>final NinePatchIcon ninePatchIcon = new NinePatchIcon(shade, false);<NEW_LINE>ninePatchIcon.addHorizontalStretch(0, shadeWidth + inner, true);<NEW_LINE>ninePatchIcon.addHorizontalStretch(shadeWidth + inner + 1, w - shadeWidth - inner - 1, false);<NEW_LINE>ninePatchIcon.addHorizontalStretch(w - shadeWidth - inner, w, true);<NEW_LINE>ninePatchIcon.addVerticalStretch(0, shadeWidth + inner, true);<NEW_LINE>ninePatchIcon.addVerticalStretch(shadeWidth + inner + 1, w - <MASK><NEW_LINE>ninePatchIcon.addVerticalStretch(w - shadeWidth - inner, w, true);<NEW_LINE>ninePatchIcon.setMargin(shadeWidth);<NEW_LINE>return ninePatchIcon;<NEW_LINE>} | shadeWidth - inner - 1, false); |
107,131 | public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("attach" + mm.getMessage("function.missingParam"));<NEW_LINE>} else if (param.isLeaf()) {<NEW_LINE>String tableName = param.getLeafExpression().getIdentifierName();<NEW_LINE>ITableMetaData table = this.table;<NEW_LINE>table = table.getAnnexTable(tableName);<NEW_LINE>if (table == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException(tableName + mm.getMessage("dw.tableNotExist"));<NEW_LINE>}<NEW_LINE>return table;<NEW_LINE>}<NEW_LINE>IParam sub0 = param.getSub(0);<NEW_LINE>if (sub0 == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("attach" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>String tableName = sub0.getLeafExpression().getIdentifierName();<NEW_LINE>int size = param.getSubSize();<NEW_LINE>String[] fields <MASK><NEW_LINE>int[] serialBytesLen = new int[size - 1];<NEW_LINE>for (int i = 1; i < size; ++i) {<NEW_LINE>IParam sub = param.getSub(i);<NEW_LINE>if (sub == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("attach" + mm.getMessage("function.invalidParam"));<NEW_LINE>} else if (sub.isLeaf()) {<NEW_LINE>fields[i - 1] = sub.getLeafExpression().getIdentifierName();<NEW_LINE>} else {<NEW_LINE>IParam p0 = sub.getSub(0);<NEW_LINE>IParam p1 = sub.getSub(1);<NEW_LINE>if (p0 == null || p1 == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("attach" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>fields[i - 1] = p0.getLeafExpression().getIdentifierName();<NEW_LINE>Object obj = p1.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(obj instanceof Number)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("attach" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>serialBytesLen[i - 1] = ((Number) obj).intValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return table.createAnnexTable(fields, serialBytesLen, tableName);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RQException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | = new String[size - 1]; |
852,146 | private SeekableStreamDataSourceMetadata<String, String> createDataSourceMetadataWithClosedOrExpiredPartitions(SeekableStreamDataSourceMetadata<String, String> currentMetadata, Set<String> terminatedPartitionIds, String terminationMarker) {<NEW_LINE>final KinesisDataSourceMetadata dataSourceMetadata = (KinesisDataSourceMetadata) currentMetadata;<NEW_LINE>SeekableStreamSequenceNumbers<String, String> old = dataSourceMetadata.getSeekableStreamSequenceNumbers();<NEW_LINE>Map<String, String> oldPartitionSequenceNumberMap = old.getPartitionSequenceNumberMap();<NEW_LINE>Map<String, String> newPartitionSequenceNumberMap = new HashMap<>();<NEW_LINE>for (Map.Entry<String, String> entry : oldPartitionSequenceNumberMap.entrySet()) {<NEW_LINE>if (!terminatedPartitionIds.contains(entry.getKey())) {<NEW_LINE>newPartitionSequenceNumberMap.put(entry.getKey(), entry.getValue());<NEW_LINE>} else {<NEW_LINE>newPartitionSequenceNumberMap.put(entry.getKey(), terminationMarker);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SeekableStreamSequenceNumbers<String, String> newSequences;<NEW_LINE>if (old instanceof SeekableStreamStartSequenceNumbers) {<NEW_LINE>Set<String> oldExclusiveStartPartitions;<NEW_LINE>Set<String> newExclusiveStartPartitions;<NEW_LINE><MASK><NEW_LINE>oldExclusiveStartPartitions = ((SeekableStreamStartSequenceNumbers<String, String>) old).getExclusivePartitions();<NEW_LINE>for (String partitionId : oldExclusiveStartPartitions) {<NEW_LINE>if (!terminatedPartitionIds.contains(partitionId)) {<NEW_LINE>newExclusiveStartPartitions.add(partitionId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>newSequences = new SeekableStreamStartSequenceNumbers<>(old.getStream(), null, newPartitionSequenceNumberMap, null, newExclusiveStartPartitions);<NEW_LINE>} else {<NEW_LINE>newSequences = new SeekableStreamEndSequenceNumbers<>(old.getStream(), null, newPartitionSequenceNumberMap, null);<NEW_LINE>}<NEW_LINE>return new KinesisDataSourceMetadata(newSequences);<NEW_LINE>} | newExclusiveStartPartitions = new HashSet<>(); |
553,436 | public static Set<javax.lang.model.element.Modifier> reflectionModifiersToModel(int modifiers) {<NEW_LINE>Set<javax.lang.model.element.Modifier> ret = new HashSet<javax.lang.model.element.Modifier>();<NEW_LINE>if (java.lang.reflect.Modifier.isAbstract(modifiers)) {<NEW_LINE>ret.add(javax.lang.model.element.Modifier.ABSTRACT);<NEW_LINE>}<NEW_LINE>if (java.lang.reflect.Modifier.isFinal(modifiers)) {<NEW_LINE>ret.add(javax.lang.model.element.Modifier.FINAL);<NEW_LINE>}<NEW_LINE>if (java.lang.reflect.Modifier.isNative(modifiers)) {<NEW_LINE>ret.add(javax.lang.model.element.Modifier.NATIVE);<NEW_LINE>}<NEW_LINE>if (java.lang.reflect.Modifier.isStatic(modifiers)) {<NEW_LINE>ret.add(javax.lang.model.element.Modifier.STATIC);<NEW_LINE>}<NEW_LINE>if (java.lang.reflect.Modifier.isStrict(modifiers)) {<NEW_LINE>ret.add(javax.lang.model.element.Modifier.STRICTFP);<NEW_LINE>}<NEW_LINE>if (java.lang.reflect.Modifier.isSynchronized(modifiers)) {<NEW_LINE>ret.add(javax.lang.model.element.Modifier.SYNCHRONIZED);<NEW_LINE>}<NEW_LINE>if (java.lang.reflect.Modifier.isTransient(modifiers)) {<NEW_LINE>ret.add(javax.lang.model.element.Modifier.TRANSIENT);<NEW_LINE>}<NEW_LINE>if (java.lang.reflect.Modifier.isVolatile(modifiers)) {<NEW_LINE>ret.add(javax.lang.model.element.Modifier.VOLATILE);<NEW_LINE>}<NEW_LINE>if (java.lang.reflect.Modifier.isPrivate(modifiers)) {<NEW_LINE>ret.add(javax.lang.<MASK><NEW_LINE>} else if (java.lang.reflect.Modifier.isProtected(modifiers)) {<NEW_LINE>ret.add(javax.lang.model.element.Modifier.PROTECTED);<NEW_LINE>} else if (java.lang.reflect.Modifier.isPublic(modifiers)) {<NEW_LINE>ret.add(javax.lang.model.element.Modifier.PUBLIC);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | model.element.Modifier.PRIVATE); |
1,399,491 | public void parse(DLNAMediaInfo media, InputFile file, Format ext, int type, RendererConfiguration renderer) {<NEW_LINE>if (file.getFile() != null) {<NEW_LINE>if (ext.getIdentifier() == Identifier.RA) {<NEW_LINE>// Special parsing for RealAudio 1.0 and 2.0 which isn't handled by MediaInfo or JAudioTagger<NEW_LINE>FileChannel channel;<NEW_LINE>try {<NEW_LINE>channel = FileChannel.open(file.getFile().<MASK><NEW_LINE>if (AudioUtils.parseRealAudio(channel, media)) {<NEW_LINE>// If successful parsing is done, if not continue parsing the standard way<NEW_LINE>media.postParse(type, file);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.warn("An error occurred when trying to open \"{}\" for reading: {}", file, e.getMessage());<NEW_LINE>LOGGER.trace("", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// MediaInfo can't correctly parse ADPCM, DFF, DSF or PNM<NEW_LINE>if (renderer.isUseMediaInfo() && ext.getIdentifier() != Identifier.ADPCM && ext.getIdentifier() != Identifier.DFF && ext.getIdentifier() != Identifier.DSF && ext.getIdentifier() != Identifier.PNM) {<NEW_LINE>LibMediaInfoParser.parse(media, file, type, renderer);<NEW_LINE>} else {<NEW_LINE>media.parse(file, ext, type, false, false, renderer);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>media.parse(file, ext, type, false, false, renderer);<NEW_LINE>}<NEW_LINE>} | toPath(), StandardOpenOption.READ); |
1,266,116 | public ListJobsByPipelineResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListJobsByPipelineResult listJobsByPipelineResult = new ListJobsByPipelineResult();<NEW_LINE><MASK><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 listJobsByPipelineResult;<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("Jobs", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listJobsByPipelineResult.setJobs(new ListUnmarshaller<Job>(JobJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextPageToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listJobsByPipelineResult.setNextPageToken(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 listJobsByPipelineResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
735,823 | protected DoubleArray[] combinedMatrixEqnSolver(double[][] doubMat1, double[] doubVec, double[][] doubMat2) {<NEW_LINE>int size = doubVec.length;<NEW_LINE>DoubleArray[] res = new DoubleArray[size + 1];<NEW_LINE>DoubleMatrix doubMat2Matrix = DoubleMatrix.copyOf(doubMat2);<NEW_LINE>double[] u = new double[size - 1];<NEW_LINE>double[] d = new double[size];<NEW_LINE>double[] l = new double[size - 1];<NEW_LINE>for (int i = 0; i < size - 1; ++i) {<NEW_LINE>u[i] = doubMat1<MASK><NEW_LINE>d[i] = doubMat1[i][i];<NEW_LINE>l[i] = doubMat1[i + 1][i];<NEW_LINE>}<NEW_LINE>d[size - 1] = doubMat1[size - 1][size - 1];<NEW_LINE>TridiagonalMatrix m = new TridiagonalMatrix(d, u, l);<NEW_LINE>res[0] = DoubleArray.copyOf(TridiagonalSolver.solvTriDag(m, doubVec));<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>DoubleArray doubMat2Colum = doubMat2Matrix.column(i);<NEW_LINE>res[i + 1] = TridiagonalSolver.solvTriDag(m, doubMat2Colum);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | [i][i + 1]; |
937,368 | public void transform() {<NEW_LINE>File destinationFile = getDestinationFile().get().getAsFile();<NEW_LINE>getFs().copy(copySpec -> {<NEW_LINE>copySpec.from(getHtmlFile());<NEW_LINE>copySpec.into(destinationFile.getParentFile());<NEW_LINE>copySpec.rename(s -> destinationFile.getName());<NEW_LINE>// TODO: Maybe this could be simplified by not using the copy infrastructure and just<NEW_LINE>// calling the FilterReader ourselves. We're just taking one file and turning it into another.<NEW_LINE>// The order here is important! tokens are inserted by the transformer<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>// NOTE: These parameter names _must_ match the setter names in ReleaseNotesTransformer<NEW_LINE>parameters.put("baseCss", getBaseCssFile().get().getAsFile());<NEW_LINE>parameters.put("releaseNotesCss", getReleaseNotesCssFile().get().getAsFile());<NEW_LINE>parameters.put("releaseNotesJavascript", getReleaseNotesJavascriptFile().get().getAsFile());<NEW_LINE>parameters.put("jqueryFiles", getJquery().getFiles());<NEW_LINE>copySpec.filter(parameters, ReleaseNotesTransformer.class);<NEW_LINE>copySpec.filter(Collections.singletonMap("tokens", getReplacementTokens().get()), ReplaceTokens.class);<NEW_LINE>});<NEW_LINE>} | parameters = new HashMap<>(); |
1,258,899 | private void handle(AllocateIpMsg msg) {<NEW_LINE>IpAllocatorType strategyType = getIpAllocatorType(msg);<NEW_LINE>IpAllocatorStrategy ias = l3NwMgr.getIpAllocatorStrategy(strategyType);<NEW_LINE>AllocateIpReply reply = new AllocateIpReply();<NEW_LINE>UsedIpInventory ip = ias.allocateIp(msg);<NEW_LINE>if (ip == null) {<NEW_LINE>String reason = msg.getRequiredIp() == null ? String.format("no ip is available in this l3Network[name:%s, uuid:%s]", self.getName(), self.getUuid()) : String.format("IP[%s] is not available", msg.getRequiredIp());<NEW_LINE>reply.setError(err(L3Errors.ALLOCATE_IP_ERROR, "IP allocator strategy[%s] failed, because %s", strategyType, reason));<NEW_LINE>} else {<NEW_LINE>logger.debug(String.format("Ip allocator strategy[%s] successfully allocates an ip[%s]", strategyType, printer.print(ip)));<NEW_LINE>reply.setIpInventory(ip);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | bus.reply(msg, reply); |
1,841,425 | private Expression verifyAssignment(final long op, final Expression lhs, final Expression rhs) {<NEW_LINE>final TokenType opType = Token.descType(op);<NEW_LINE>switch(opType) {<NEW_LINE>case ASSIGN:<NEW_LINE>case ASSIGN_ADD:<NEW_LINE>case ASSIGN_BIT_AND:<NEW_LINE>case ASSIGN_BIT_OR:<NEW_LINE>case ASSIGN_BIT_XOR:<NEW_LINE>case ASSIGN_DIV:<NEW_LINE>case ASSIGN_MOD:<NEW_LINE>case ASSIGN_MUL:<NEW_LINE>case ASSIGN_SAR:<NEW_LINE>case ASSIGN_SHL:<NEW_LINE>case ASSIGN_SHR:<NEW_LINE>case ASSIGN_SUB:<NEW_LINE>if (!(lhs instanceof AccessNode || lhs instanceof IndexNode || lhs instanceof IdentNode)) {<NEW_LINE>return referenceError(lhs, rhs, env._early_lvalue_error);<NEW_LINE>}<NEW_LINE>if (lhs instanceof IdentNode) {<NEW_LINE>if (!checkIdentLValue((IdentNode) lhs)) {<NEW_LINE>return referenceError(lhs, rhs, false);<NEW_LINE>}<NEW_LINE>verifyStrictIdent((IdentNode) lhs, "assignment");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Build up node.<NEW_LINE>if (BinaryNode.isLogical(opType)) {<NEW_LINE>return new BinaryNode(op, new JoinPredecessorExpression(lhs<MASK><NEW_LINE>}<NEW_LINE>return new BinaryNode(op, lhs, rhs);<NEW_LINE>} | ), new JoinPredecessorExpression(rhs)); |
1,773,486 | public void log(TraceComponent tc) {<NEW_LINE>Tr.debug(tc, MessageFormat.format("Delayed Class [ {0} ]", getHashText()));<NEW_LINE>Tr.debug(tc, MessageFormat.format(" classInfo [ {0} ]", ((classInfo != null) ? classInfo.getHashText() : null)));<NEW_LINE>Tr.debug(tc, MessageFormat.format(" isArtificial [ {0} ]", Boolean.valueOf(isArtificial)));<NEW_LINE>// only write out the remainder of the messages if 'all' trace is enabled<NEW_LINE>if (!tc.isDumpEnabled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isModifiersSet [ {0} ]", Boolean.valueOf(isModifiersSet)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" modifiers [ {0} ]", Integer.valueOf(modifiers)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" packageName [ {0} ]", packageName));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" packageInfo [ {0} ]", ((packageInfo != null) ? packageInfo.getHashText() : null)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isJavaClass [ {0} ]", Boolean.valueOf(isJavaClass)));<NEW_LINE>if (interfaceNames != null) {<NEW_LINE>for (String interfaceName : interfaceNames) {<NEW_LINE>Tr.dump(tc, MessageFormat.format(" [ {0} ]", interfaceName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isInterface [ {0} ]", isInterface));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isAnnotationClass [ {0} ]", isAnnotationClass));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" superclassName [ {0} ]", superclassName));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" superclass [ {0} ]", ((superclass != null) ? superclass.<MASK><NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredFields [ {0} ]", isEmptyDeclaredFields));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredConstructors [ {0} ]", isEmptyDeclaredConstructors));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredMethods [ {0} ]", isEmptyDeclaredMethods));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyMethods [ {0} ]", isEmptyMethods));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isDeclaredAnnotationPresent [ {0} ]", isDeclaredAnnotationPresent));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isAnnotationPresent [ {0} ]", isAnnotationPresent));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isFieldAnnotationPresent [ {0} ]", isFieldAnnotationPresent));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isMethodAnnotationPresent [ {0} ]", isMethodAnnotationPresent));<NEW_LINE>// Don't log the underlying non-delayed class.<NEW_LINE>// Don't log the annotations.<NEW_LINE>} | getHashText() : null))); |
1,100,006 | public synchronized // find all initilizable spi and init it.<NEW_LINE>void init() {<NEW_LINE>if (!inited) {<NEW_LINE>try {<NEW_LINE>LoggerUtil.info("AllSpiInitialization init.");<NEW_LINE>ExtensionLoader<Initializable> extensionLoader = ExtensionLoader.getExtensionLoader(Initializable.class);<NEW_LINE>List<Initializable> allInit = extensionLoader.getExtensions(null);<NEW_LINE>if (allInit != null && !allInit.isEmpty()) {<NEW_LINE>for (Initializable initializable : allInit) {<NEW_LINE>try {<NEW_LINE>initializable.init();<NEW_LINE>LoggerUtil.info(initializable.getClass().getName() + " is init.");<NEW_LINE>} catch (Exception initErr) {<NEW_LINE>LoggerUtil.error(initializable.getClass().getName() + " init fail!", initErr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>inited = true;<NEW_LINE>LoggerUtil.info("AllSpiInitialization init finish.");<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | LoggerUtil.error("Initializable spi init fail!", e); |
388,215 | public Tuple3<Boolean, Double, Map<String, String>>[] detect(MTable series, boolean detectLast) throws Exception {<NEW_LINE>MTable mt = OutlierUtil.getMTable(series, this.params);<NEW_LINE>TableSummary summary = mt.summary();<NEW_LINE>int num = mt.getNumRow();<NEW_LINE>Tuple3<Boolean, Double, Map<String, String>>[] results = new Tuple3[num];<NEW_LINE>double[] scores = new double[num];<NEW_LINE>double[] p_l = new double[num];<NEW_LINE>double[] p_r = new double[num];<NEW_LINE>double[] p_s = new double[num];<NEW_LINE>Arrays.fill(p_l, 0.0);<NEW_LINE>Arrays.fill(p_r, 0.0);<NEW_LINE>Arrays.fill(p_s, 0.0);<NEW_LINE>for (String selectedCol : mt.getColNames()) {<NEW_LINE>List<Object> values = MTableUtil.getColumn(mt, selectedCol);<NEW_LINE>double[<MASK><NEW_LINE>for (int i = 0; i < num; i++) {<NEW_LINE>data[i] = ((Number) values.get(i)).doubleValue();<NEW_LINE>}<NEW_LINE>Arrays.sort(data);<NEW_LINE>double m2 = summary.centralMoment2(selectedCol);<NEW_LINE>double m3 = summary.centralMoment3(selectedCol);<NEW_LINE>double val = m3 / Math.pow(m2, 1.5);<NEW_LINE>boolean skewness = val < 0 ? false : true;<NEW_LINE>for (int i = 0; i < num; i++) {<NEW_LINE>int pos = Arrays.binarySearch(data, ((Number) values.get(i)).doubleValue());<NEW_LINE>int s = pos;<NEW_LINE>int t = pos;<NEW_LINE>while (s < num - 1 && data[s] == data[pos]) {<NEW_LINE>s++;<NEW_LINE>}<NEW_LINE>while (t > 0 && data[t] == data[pos]) {<NEW_LINE>t--;<NEW_LINE>}<NEW_LINE>double f0 = -Math.log(Math.min(1.0, (double) s / num));<NEW_LINE>double f1 = -Math.log(Math.min(1.0, (double) (num - t) / num));<NEW_LINE>double p = skewness ? f1 : f0;<NEW_LINE>p_l[i] += f0;<NEW_LINE>p_r[i] += f1;<NEW_LINE>p_s[i] += p;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double threshold;<NEW_LINE>threshold = -Math.log(0.3) * mt.getNumCol();<NEW_LINE>for (int i = 0; i < num; i++) {<NEW_LINE>scores[i] = Math.max((p_l[i] + p_r[i]) / 2, p_s[i]);<NEW_LINE>results[i] = Tuple3.of(scores[i] > threshold ? true : false, 1.0 - Math.pow(2, -Math.abs(scores[i]) / threshold), null);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | ] data = new double[num]; |
89,880 | public ListMitigationActionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListMitigationActionsResult listMitigationActionsResult = new ListMitigationActionsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listMitigationActionsResult;<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("actionIdentifiers", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listMitigationActionsResult.setActionIdentifiers(new ListUnmarshaller<MitigationActionIdentifier>(MitigationActionIdentifierJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listMitigationActionsResult.setNextToken(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 listMitigationActionsResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
995,436 | public static ListNodeLabelsResponse unmarshall(ListNodeLabelsResponse listNodeLabelsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listNodeLabelsResponse.setRequestId(_ctx.stringValue("ListNodeLabelsResponse.RequestId"));<NEW_LINE>listNodeLabelsResponse.setCode(_ctx.integerValue("ListNodeLabelsResponse.Code"));<NEW_LINE>listNodeLabelsResponse.setErrorMsg(_ctx.stringValue("ListNodeLabelsResponse.ErrorMsg"));<NEW_LINE>listNodeLabelsResponse.setPageNumber(_ctx.integerValue("ListNodeLabelsResponse.PageNumber"));<NEW_LINE>listNodeLabelsResponse.setPageSize(_ctx.integerValue("ListNodeLabelsResponse.PageSize"));<NEW_LINE>listNodeLabelsResponse.setTotalCount(_ctx.longValue("ListNodeLabelsResponse.TotalCount"));<NEW_LINE>List<ListNodeLabelResponse> data = new ArrayList<ListNodeLabelResponse>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListNodeLabelsResponse.Data.Length"); i++) {<NEW_LINE>ListNodeLabelResponse listNodeLabelResponse = new ListNodeLabelResponse();<NEW_LINE>listNodeLabelResponse.setLabelKey(_ctx.stringValue("ListNodeLabelsResponse.Data[" + i + "].LabelKey"));<NEW_LINE>listNodeLabelResponse.setLabelValue(_ctx.stringValue<MASK><NEW_LINE>listNodeLabelResponse.setId(_ctx.longValue("ListNodeLabelsResponse.Data[" + i + "].Id"));<NEW_LINE>listNodeLabelResponse.setClusterId(_ctx.stringValue("ListNodeLabelsResponse.Data[" + i + "].ClusterId"));<NEW_LINE>data.add(listNodeLabelResponse);<NEW_LINE>}<NEW_LINE>listNodeLabelsResponse.setData(data);<NEW_LINE>return listNodeLabelsResponse;<NEW_LINE>} | ("ListNodeLabelsResponse.Data[" + i + "].LabelValue")); |
351,822 | public ResponseEntity<Void> deletePetWithHttpInfo(Long petId, String apiKey) throws RestClientException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'petId' is set<NEW_LINE>if (petId == null) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>final Map<String, Object> uriVariables = new HashMap<String, Object>();<NEW_LINE>uriVariables.put("petId", petId);<NEW_LINE>final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders localVarHeaderParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> localVarCookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> localVarFormParams = new LinkedMultiValueMap<String, Object>();<NEW_LINE>if (apiKey != null)<NEW_LINE>localVarHeaderParams.add("api_key", apiClient.parameterToString(apiKey));<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "petstore_auth" };<NEW_LINE>ParameterizedTypeReference<Void> localReturnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);<NEW_LINE>} | HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling deletePet"); |
392,333 | protected void updateLayoutState() {<NEW_LINE>if (list.getLayoutOrientation() != JList.VERTICAL) {<NEW_LINE>super.updateLayoutState();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// pasted from BasicListUI to provide min-height<NEW_LINE><MASK><NEW_LINE>int fixedCellWidth = list.getFixedCellWidth();<NEW_LINE>cellWidth = fixedCellWidth;<NEW_LINE>if (fixedCellHeight != -1) {<NEW_LINE>cellHeight = fixedCellHeight;<NEW_LINE>cellHeights = null;<NEW_LINE>} else {<NEW_LINE>cellHeight = -1;<NEW_LINE>cellHeights = new int[list.getModel().getSize()];<NEW_LINE>}<NEW_LINE>if ((fixedCellWidth == -1) || (fixedCellHeight == -1)) {<NEW_LINE>ListModel<Object> dataModel = list.getModel();<NEW_LINE>int dataModelSize = dataModel.getSize();<NEW_LINE>ListCellRenderer<Object> renderer = list.getCellRenderer();<NEW_LINE>if (renderer != null) {<NEW_LINE>for (int index = 0; index < dataModelSize; index++) {<NEW_LINE>Object value = dataModel.getElementAt(index);<NEW_LINE>Component c = renderer.getListCellRendererComponent(list, value, index, false, false);<NEW_LINE>rendererPane.add(c);<NEW_LINE>Dimension cellSize = UIUtil.updateListRowHeight(c.getPreferredSize());<NEW_LINE>if (fixedCellWidth == -1) {<NEW_LINE>cellWidth = Math.max(cellSize.width, cellWidth);<NEW_LINE>}<NEW_LINE>if (fixedCellHeight == -1) {<NEW_LINE>cellHeights[index] = cellSize.height;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (cellWidth == -1) {<NEW_LINE>cellWidth = 0;<NEW_LINE>}<NEW_LINE>if (cellHeights == null) {<NEW_LINE>cellHeights = new int[dataModelSize];<NEW_LINE>}<NEW_LINE>for (int index = 0; index < dataModelSize; index++) {<NEW_LINE>cellHeights[index] = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int fixedCellHeight = list.getFixedCellHeight(); |
1,699,355 | ImmutableSet<AdTableId> retrieveDistinctIds(@NonNull final String tableName, @NonNull final String idColumnName) {<NEW_LINE>final String sql = "SELECT " + DB_FUNCTION_RETRIEVE_DISTINCT_IDS + "(?,?)";<NEW_LINE>final Object[] sqlParams = new Object[] { tableName, idColumnName };<NEW_LINE>final PreparedStatement pstmt = DB.prepareStatement(sql, ITrx.TRXNAME_None);<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>DB.setParameters(pstmt, ImmutableList<MASK><NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>final ImmutableSet.Builder<AdTableId> result = ImmutableSet.builder();<NEW_LINE>while (rs.next()) {<NEW_LINE>final AdTableId adTableId = AdTableId.ofRepoIdOrNull(rs.getInt(1));<NEW_LINE>if (adTableId != null) {<NEW_LINE>result.add(adTableId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result.build();<NEW_LINE>} catch (final SQLException ex) {<NEW_LINE>throw DBException.wrapIfNeeded(ex).appendParametersToMessage().setParameter("sql", sql).setParameter("sqlParams", sqlParams);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>} | .of(tableName, idColumnName)); |
601,751 | public String sayHello(String vote, int expectedDirection) {<NEW_LINE>if (expectedDirection < 0) {<NEW_LINE>return "Hello, this is HelloImplTwowayService";<NEW_LINE>} else {<NEW_LINE>boolean result = false;<NEW_LINE>try {<NEW_LINE>if (vote.endsWith("clear")) {<NEW_LINE>XAResourceImpl.clear();<NEW_LINE>}<NEW_LINE>final ExtendedTransactionManager TM = TransactionManagerFactory.getTransactionManager();<NEW_LINE>final Serializable xaResInfo = XAResourceInfoFactory.getXAResourceInfo(0);<NEW_LINE>XAResourceImpl xaRes;<NEW_LINE>if (vote.startsWith("rollback")) {<NEW_LINE>xaRes = XAResourceFactoryImpl.instance().getXAResourceImpl(xaResInfo).setPrepareAction(XAException.XA_RBROLLBACK);<NEW_LINE>} else {<NEW_LINE>xaRes = XAResourceFactoryImpl.instance().getXAResourceImpl(xaResInfo);<NEW_LINE>}<NEW_LINE>final int recoveryId = TM.registerResourceInfo("xaResInfo", xaResInfo);<NEW_LINE>xaRes.setExpectedDirection(expectedDirection);<NEW_LINE>result = TM.enlist(xaRes, recoveryId);<NEW_LINE>} catch (XAResourceNotAvailableException e) {<NEW_LINE>return "Catch XAResourceNotAvailableException:" + e.toString();<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>return "Catch IllegalStateException:" + e.toString();<NEW_LINE>} catch (RollbackException e) {<NEW_LINE>return "Catch RollbackException:" + e.toString();<NEW_LINE>} catch (SystemException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return "Enlist XAResourse result: " + result;<NEW_LINE>}<NEW_LINE>} | return "Catch SystemException:" + e.toString(); |
1,003,823 | public void update(DataPoint dataPoint, double weight, int targetClass) {<NEW_LINE>double y_t = targetClass * 2 - 1;<NEW_LINE>Vec x_t = dataPoint.getNumericalValues();<NEW_LINE>double pre = getPreScore(x_t);<NEW_LINE>double score = getScore(y_t, pre);<NEW_LINE>switch(mode) {<NEW_LINE>case NC:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>double pt = mode.pt(y_t, score, pre, eta, gamma);<NEW_LINE>if (rand.nextDouble() > pt)<NEW_LINE>return;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>double alpha_i = -eta * y_t * mode.grad(y_t, score, pre, gamma) * weight;<NEW_LINE>alpha.add(alpha_i);<NEW_LINE>vecs.add(x_t);<NEW_LINE><MASK><NEW_LINE>curNorm += Math.abs(alpha_i) * k.eval(vecs.size(), vecs.size(), vecs, accelCache);<NEW_LINE>// projection step<NEW_LINE>if (curNorm > R) {<NEW_LINE>double coef = R / curNorm;<NEW_LINE>for (int i = 0; i < alpha.size(); i++) alpha.set(i, alpha.get(i) * coef);<NEW_LINE>curNorm = coef;<NEW_LINE>}<NEW_LINE>} | k.addToCache(x_t, accelCache); |
1,496,523 | private Stream<Observation> convertToObservations(final MetricData metricData) {<NEW_LINE>List<Observation> observations = new ArrayList<>();<NEW_LINE>MetricCategory category = categoryNameToMetricCategory(metricData.getInstrumentationLibraryInfo().getName());<NEW_LINE>Collection<?> points;<NEW_LINE>switch(metricData.getType()) {<NEW_LINE>case DOUBLE_GAUGE:<NEW_LINE>points = metricData.getDoubleGaugeData().getPoints();<NEW_LINE>break;<NEW_LINE>case DOUBLE_SUM:<NEW_LINE>points = metricData.getDoubleSumData().getPoints();<NEW_LINE>break;<NEW_LINE>case SUMMARY:<NEW_LINE>points = metricData.getDoubleSummaryData().getPoints();<NEW_LINE>break;<NEW_LINE>case LONG_SUM:<NEW_LINE>points = metricData.getLongSumData().getPoints();<NEW_LINE>break;<NEW_LINE>case HISTOGRAM:<NEW_LINE>points = metricData.getDoubleHistogramData().getPoints();<NEW_LINE>break;<NEW_LINE>case LONG_GAUGE:<NEW_LINE>points = metricData.getLongGaugeData().getPoints();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Unsupported type " + metricData.getType().name());<NEW_LINE>}<NEW_LINE>for (Object ptObj : points) {<NEW_LINE>PointData point = (PointData) ptObj;<NEW_LINE>List<String> <MASK><NEW_LINE>point.getAttributes().forEach((k, v) -> labels.add(v.toString()));<NEW_LINE>observations.add(new Observation(category, metricData.getName(), extractValue(metricData.getType(), point), labels));<NEW_LINE>}<NEW_LINE>return observations.stream();<NEW_LINE>} | labels = new ArrayList<>(); |
1,180,259 | public void emitSwitch(SwitchNode x) {<NEW_LINE>Logger.traceBuildLIR(<MASK><NEW_LINE>assert x.defaultSuccessor() != null;<NEW_LINE>LabelRef defaultTarget = getLIRBlock(x.defaultSuccessor());<NEW_LINE>int keyCount = x.keyCount();<NEW_LINE>if (keyCount == 0) {<NEW_LINE>gen.emitJump(defaultTarget);<NEW_LINE>} else {<NEW_LINE>Variable value = gen.load(operand(x.value()));<NEW_LINE>if (keyCount == 1) {<NEW_LINE>assert defaultTarget != null;<NEW_LINE>unimplemented();<NEW_LINE>} else {<NEW_LINE>LabelRef[] keyTargets = new LabelRef[keyCount];<NEW_LINE>JavaConstant[] keyConstants = new JavaConstant[keyCount];<NEW_LINE>double[] keyProbabilities = new double[keyCount];<NEW_LINE>for (int i = 0; i < keyCount; i++) {<NEW_LINE>keyTargets[i] = getLIRBlock(x.keySuccessor(i));<NEW_LINE>keyConstants[i] = (JavaConstant) x.keyAt(i);<NEW_LINE>keyProbabilities[i] = x.keyProbability(i);<NEW_LINE>}<NEW_LINE>gen.emitStrategySwitch(keyConstants, keyProbabilities, keyTargets, defaultTarget, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Logger.BACKEND.OpenCL, "SWITCH NODE OCL:"); |
342,965 | public void onApiOfflineEvent(ApiOfflineEvent event) {<NEW_LINE>if (mCurrentActivity != null) {<NEW_LINE>final Activity activity = mCurrentActivity.get();<NEW_LINE>if (activity != null && !activity.isFinishing()) {<NEW_LINE>if (apiOfflineSnackBar == null || !apiOfflineSnackBar.isShown()) {<NEW_LINE>String message = event.getMessage();<NEW_LINE>if (TextUtils.isEmpty(message)) {<NEW_LINE>message = getResources().getString(R.string.api_offline);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>Linkify.addLinks(s, Linkify.ALL);<NEW_LINE>apiOfflineSnackBar = Snackbar.make(((ViewGroup) activity.findViewById(android.R.id.content)).getChildAt(0), message, Snackbar.LENGTH_INDEFINITE);<NEW_LINE>View view = apiOfflineSnackBar.getView();<NEW_LINE>TextView tv = view.findViewById(com.google.android.material.R.id.snackbar_text);<NEW_LINE>tv.setMaxLines(4);<NEW_LINE>tv.setTextColor(getResources().getColor(R.color.icon_purple));<NEW_LINE>apiOfflineSnackBar.setAction(getString(R.string.okay), v -> {<NEW_LINE>if (apiOfflineSnackBar != null) {<NEW_LINE>apiOfflineSnackBar.dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>apiOfflineSnackBar.setActionTextColor(getResources().getColor(R.color.white));<NEW_LINE>apiOfflineSnackBar.show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | SpannableString s = new SpannableString(message); |
520,543 | private static Text _findMax(Scanner scanner, Text start, boolean inclStart, Text end, boolean inclEnd) {<NEW_LINE>// System.out.printf("findMax(%s, %s, %s, %s)%n", Key.toPrintableString(start.getBytes(), 0,<NEW_LINE>// start.getLength(), 1000), inclStart,<NEW_LINE>// Key.toPrintableString(end.getBytes(), 0, end.getLength(), 1000), inclEnd);<NEW_LINE>int cmp = start.compareTo(end);<NEW_LINE>if (cmp >= 0) {<NEW_LINE>if (inclStart && inclEnd && cmp == 0) {<NEW_LINE>scanner.setRange(new Range(start, true, end, true));<NEW_LINE>Iterator<Entry<Key, Value>> iter = scanner.iterator();<NEW_LINE>if (iter.hasNext())<NEW_LINE>return iter.next().getKey().getRow();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Text mid = findMidPoint(start, end);<NEW_LINE>// System.out.println("mid = :"+Key.toPrintableString(mid.getBytes(), 0, mid.getLength(),<NEW_LINE>// 1000)+":");<NEW_LINE>scanner.setRange(new Range(mid, mid.equals(start) ? inclStart : true, end, inclEnd));<NEW_LINE>Iterator<Entry<Key, Value>> iter = scanner.iterator();<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>Key next = iter.next().getKey();<NEW_LINE>int count = 0;<NEW_LINE>while (count < 10 && iter.hasNext()) {<NEW_LINE>next = iter.next().getKey();<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>if (!iter.hasNext())<NEW_LINE>return next.getRow();<NEW_LINE>Text ret = _findMax(scanner, next.followingKey(PartialKey.ROW).getRow(<MASK><NEW_LINE>if (ret == null)<NEW_LINE>return next.getRow();<NEW_LINE>else<NEW_LINE>return ret;<NEW_LINE>} else {<NEW_LINE>return _findMax(scanner, start, inclStart, mid, mid.equals(start) ? inclStart : false);<NEW_LINE>}<NEW_LINE>} | ), true, end, inclEnd); |
511,311 | public static void centerEdgeLabel(final ZyGraph graph, final NaviEdge edge, final boolean zoom) {<NEW_LINE>Preconditions.checkNotNull(graph, "IE02101: Graph argument can not be null");<NEW_LINE><MASK><NEW_LINE>final double oldZoom = graph.getView().getZoom();<NEW_LINE>if (!edge.isVisible()) {<NEW_LINE>final NaviNode sourceNode = edge.getSource();<NEW_LINE>final NaviNode targetNode = edge.getTarget();<NEW_LINE>final boolean autoLayout = graph.getSettings().getLayoutSettings().getAutomaticLayouting();<NEW_LINE>graph.getSettings().getLayoutSettings().setAutomaticLayouting(false);<NEW_LINE>graph.showNode(sourceNode, true);<NEW_LINE>graph.showNode(targetNode, true);<NEW_LINE>graph.getSettings().getLayoutSettings().setAutomaticLayouting(autoLayout);<NEW_LINE>}<NEW_LINE>if (zoom) {<NEW_LINE>ZoomFunctions.zoomToEdgeLabel(graph, edge);<NEW_LINE>} else {<NEW_LINE>MoveFunctions.centerEdgeLable(graph, edge);<NEW_LINE>focusView(graph, oldZoom, graph.getView().getCenter());<NEW_LINE>}<NEW_LINE>} | Preconditions.checkNotNull(edge, "IE02102: Edge argument can not be null"); |
2,612 | public void addDelivery(String endpointName, int deliveryMethod, Method method, int instanceID) {<NEW_LINE>svLogger.entering(CLASSNAME, "addDelivery", new Object[] { this, endpointName, new Integer(deliveryMethod), method, new Integer(instanceID) });<NEW_LINE>checkEndpointName(endpointName);<NEW_LINE>if (instanceID < 0) {<NEW_LINE>svLogger.exiting(CLASSNAME, "addDelivery", "MessageException -- instance ID " + instanceID + "is not a positive number");<NEW_LINE>throw new MessageException("instance number can only be a non-positive number");<NEW_LINE>}<NEW_LINE>switch(deliveryMethod) {<NEW_LINE>case BEFORE_DELIVERY:<NEW_LINE>messages.add(BEFORE_DELIVERY_STRING + <MASK><NEW_LINE>messages.add(method);<NEW_LINE>break;<NEW_LINE>case AFTER_DELIVERY:<NEW_LINE>messages.add(AFTER_DELIVERY_STRING + ":" + endpointName + ":" + instanceID);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>svLogger.exiting(CLASSNAME, "addDelivery", "Exception");<NEW_LINE>throw new MessageException("The only permitted values are FVTMessage.BEFORE_DELIVERY and FVTMessage.BEFORE_DELIVERY");<NEW_LINE>}<NEW_LINE>svLogger.exiting(CLASSNAME, "addDelivery");<NEW_LINE>} | ":" + endpointName + ":" + instanceID); |
1,630,487 | private void testDistinct() {<NEW_LINE>Flowable<Person> personFlowable = realm.asFlowable().map(realm -> realm.where(Person.class).sort("name").findAll<MASK><NEW_LINE>// distinct() and distinctUntilChanged() uses standard equals with older objects stored in a HashMap.<NEW_LINE>// Realm objects auto-update which means the objects stored will also auto-update.<NEW_LINE>// This makes comparing against older objects impossible (even if the new object has changed) because the<NEW_LINE>// cached object will also have changed.<NEW_LINE>// Use a keySelector function to work around this.<NEW_LINE>Disposable distinctDisposable = // Because old == new. This will only allow the first version of the "Chris" object to pass.<NEW_LINE>personFlowable.distinct().subscribe(person -> showStatus("distinct(): " + person.getName() + ":" + person.getAge()));<NEW_LINE>compositeDisposable.add(distinctDisposable);<NEW_LINE>Disposable distinctKeySelectorDisposable = personFlowable.distinct(person -> person.getAge()).subscribe(person -> showStatus("distinct(keySelector): " + person.getName() + ":" + person.getAge()));<NEW_LINE>compositeDisposable.add(distinctKeySelectorDisposable);<NEW_LINE>} | ().get(0)); |
88,432 | public void loadCreditPanel() {<NEW_LINE>v_CreditPanel = GridFactory.newGridLayout();<NEW_LINE>v_CreditPanel.setWidth("100%");<NEW_LINE>v_CreditPanel.setHeight("175px");<NEW_LINE>Rows rows = v_CreditPanel.newRows();<NEW_LINE>Row row = rows.newRow();<NEW_LINE>row.setStyle("303px");<NEW_LINE>// C_Payment_v.TenderType<NEW_LINE>int AD_Column_ID = 8374;<NEW_LINE>MLookup cardlookup = MLookupFactory.get(Env.getCtx(), 0, 0, AD_Column_ID, DisplayType.List);<NEW_LINE>ArrayList<Object> cards = cardlookup.getData(true, false, true, true);<NEW_LINE>row = rows.newRow();<NEW_LINE>fCCardType = ListboxFactory.newDropdownListbox();<NEW_LINE>row.appendChild(fCCardType);<NEW_LINE>fCCardType.setStyle(HEIGHT + WIDTH + FONT_SIZE);<NEW_LINE>fCCardType.setValue(Msg.translate(p_ctx, "CreditCardType"));<NEW_LINE>fCCardType.addActionListener(this);<NEW_LINE>for (Object obj : cards) {<NEW_LINE>if (obj instanceof ValueNamePair) {<NEW_LINE>ValueNamePair key = (ValueNamePair) obj;<NEW_LINE>fCCardType.appendItem(key.getName(), key.getID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>row.setSpans("1,2");<NEW_LINE>fCCardNo = new WPOSTextField(Msg.translate(p_ctx, "CreditCardNumber"), keyboard);<NEW_LINE>fCCardNo.setStyle(HEIGHT + WIDTH + FONT_SIZE);<NEW_LINE>row.appendChild(fCCardNo);<NEW_LINE>fCCardNo.addEventListener("onFocus", this);<NEW_LINE>fCCardName = new WPOSTextField(Msg.translate(p_ctx, "Name"), keyboard);<NEW_LINE>row = rows.newRow();<NEW_LINE>row.appendChild(fCCardName);<NEW_LINE>fCCardName.setStyle(HEIGHT + WIDTH + FONT_SIZE);<NEW_LINE>fCCardName.addEventListener("onFocus", this);<NEW_LINE>// For Card Month<NEW_LINE>fCreditCardExpMM = ListboxFactory.newDropdownListbox();<NEW_LINE><MASK><NEW_LINE>for (ValueNamePair pp : data) {<NEW_LINE>fCreditCardExpMM.appendItem(String.valueOf(pp.getName()), pp.getID());<NEW_LINE>fCreditCardExpMM.setName(String.valueOf(pp.getID()));<NEW_LINE>}<NEW_LINE>fCreditCardExpMM.setName("CreditCardExpMM");<NEW_LINE>fCreditCardExpMM.addActionListener(this);<NEW_LINE>fCreditCardExpMM.setStyle(HEIGHT + "width:" + 75 + "px;" + FONT_SIZE);<NEW_LINE>// For Card Year<NEW_LINE>fCreditCardExpYY = ListboxFactory.newDropdownListbox();<NEW_LINE>data = getCCYears();<NEW_LINE>for (ValueNamePair pp : data) {<NEW_LINE>fCreditCardExpYY.appendItem(String.valueOf(pp.getName()), pp.getID());<NEW_LINE>fCreditCardExpYY.setName(String.valueOf(pp.getID()));<NEW_LINE>}<NEW_LINE>fCreditCardExpYY.setName("CreditCardExpYY");<NEW_LINE>fCreditCardExpYY.addActionListener(this);<NEW_LINE>fCreditCardExpYY.setStyle("margin: 0px 50px 0px 0px;" + HEIGHT + "width:" + 60 + "px;" + FONT_SIZE);<NEW_LINE>// For Card VV<NEW_LINE>row.appendChild(fCreditCardExpMM);<NEW_LINE>row.appendChild(fCreditCardExpYY);<NEW_LINE>fCCardVC = new WPOSTextField(Msg.translate(p_ctx, "CVC"), keyboard);<NEW_LINE>row = rows.newRow();<NEW_LINE>row.appendChild(fCCardVC);<NEW_LINE>fCCardVC.addEventListener("onFocus", this);<NEW_LINE>fCCardVC.setStyle(HEIGHT + WIDTH + FONT_SIZE);<NEW_LINE>} | ValueNamePair[] data = getCCMonths(); |
201,568 | public void handleCommand(InsteonPLMBindingConfig conf, Command cmd, InsteonDevice dev) {<NEW_LINE>try {<NEW_LINE>if (cmd == OnOffType.ON) {<NEW_LINE>int <MASK><NEW_LINE>Msg m = dev.makeStandardMessage((byte) 0x0f, (byte) 0x12, (byte) level, s_getGroup(conf));<NEW_LINE>dev.enqueueMessage(m, m_feature);<NEW_LINE>logger.info("{}: sent fast on to switch {} level {}", nm(), dev.getAddress(), level == 0xff ? "on" : level);<NEW_LINE>} else if (cmd == OnOffType.OFF) {<NEW_LINE>Msg m = dev.makeStandardMessage((byte) 0x0f, (byte) 0x14, (byte) 0x00, s_getGroup(conf));<NEW_LINE>dev.enqueueMessage(m, m_feature);<NEW_LINE>logger.info("{}: sent fast off to switch {}", nm(), dev.getAddress());<NEW_LINE>}<NEW_LINE>// expect to get a direct ack after this!<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("{}: command send i/o error: ", nm(), e);<NEW_LINE>} catch (FieldException e) {<NEW_LINE>logger.error("{}: command send message creation error ", nm(), e);<NEW_LINE>}<NEW_LINE>} | level = getMaxLightLevel(conf, 0xff); |
395,885 | private SourceMethodElementInfo createMethodInfo(MethodInfo methodInfo, SourceMethod handle) {<NEW_LINE>IJavaElement[] elements = getChildren(methodInfo);<NEW_LINE>SourceMethodElementInfo info;<NEW_LINE>if (methodInfo.isConstructor) {<NEW_LINE>info = elements.length == 0 ? new SourceConstructorInfo() : new SourceConstructorWithChildrenInfo(elements);<NEW_LINE>} else if (methodInfo.isAnnotation) {<NEW_LINE>info = new SourceAnnotationMethodInfo();<NEW_LINE>} else {<NEW_LINE>info = elements.length == 0 ? new SourceMethodInfo() : new SourceMethodWithChildrenInfo(elements);<NEW_LINE>}<NEW_LINE>info.isCanonicalConstructor = methodInfo.isCanonicalConstr;<NEW_LINE><MASK><NEW_LINE>int flags = methodInfo.modifiers;<NEW_LINE>info.setNameSourceStart(methodInfo.nameSourceStart);<NEW_LINE>info.setNameSourceEnd(methodInfo.nameSourceEnd);<NEW_LINE>info.setFlags(flags);<NEW_LINE>JavaModelManager manager = JavaModelManager.getJavaModelManager();<NEW_LINE>char[][] parameterNames = methodInfo.parameterNames;<NEW_LINE>for (int i = 0, length = parameterNames.length; i < length; i++) parameterNames[i] = manager.intern(parameterNames[i]);<NEW_LINE>info.setArgumentNames(parameterNames);<NEW_LINE>char[] returnType = methodInfo.returnType == null ? new char[] { 'v', 'o', 'i', 'd' } : methodInfo.returnType;<NEW_LINE>info.setReturnType(manager.intern(returnType));<NEW_LINE>char[][] exceptionTypes = methodInfo.exceptionTypes;<NEW_LINE>info.setExceptionTypeNames(exceptionTypes);<NEW_LINE>for (int i = 0, length = exceptionTypes.length; i < length; i++) exceptionTypes[i] = manager.intern(exceptionTypes[i]);<NEW_LINE>this.newElements.put(handle, info);<NEW_LINE>if (methodInfo.typeParameters != null) {<NEW_LINE>for (int i = 0, length = methodInfo.typeParameters.length; i < length; i++) {<NEW_LINE>TypeParameterInfo typeParameterInfo = methodInfo.typeParameters[i];<NEW_LINE>acceptTypeParameter(typeParameterInfo, info);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (methodInfo.annotations != null) {<NEW_LINE>int length = methodInfo.annotations.length;<NEW_LINE>this.unitInfo.annotationNumber += length;<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.Annotation annotation = methodInfo.annotations[i];<NEW_LINE>acceptAnnotation(annotation, info, handle);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// https://bugs.eclipse.org/bugs/show_bug.cgi?id=334783<NEW_LINE>// Process the parameter annotations from the arguments<NEW_LINE>if (methodInfo.node != null && methodInfo.node.arguments != null) {<NEW_LINE>info.arguments = acceptMethodParameters(methodInfo.node.arguments, handle, methodInfo);<NEW_LINE>}<NEW_LINE>if (methodInfo.typeAnnotated) {<NEW_LINE>this.unitInfo.annotationNumber = CompilationUnitElementInfo.ANNOTATION_THRESHOLD_FOR_DIET_PARSE;<NEW_LINE>}<NEW_LINE>return info;<NEW_LINE>} | info.setSourceRangeStart(methodInfo.declarationStart); |
1,000,407 | public boolean matchesAsSource(final IZoomSource zoomSource) {<NEW_LINE>if (tableRecordIdTarget) {<NEW_LINE>// the source always matches if the target is ReferenceTarget<NEW_LINE>logger.debug("matchesAsSource - return true because tableRecordIdTarget=true; this={}", this);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!zoomSource.isGenericZoomOrigin()) {<NEW_LINE>logger.<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final String keyColumnName = zoomSource.getKeyColumnNameOrNull();<NEW_LINE>if (Check.isEmpty(keyColumnName, true)) {<NEW_LINE>logger.warn("matchesAsSource - return false because zoomSource.getKeyColumnNameOrNull()==null; this={}; zoomSource={}", this, zoomSource);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final String whereClause = tableRefInfo.getWhereClause();<NEW_LINE>if (Check.isEmpty(whereClause, true)) {<NEW_LINE>logger.debug("matchesAsSource - return true because tableRefInfo.whereClause is empty; this={}", this);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final String parsedWhere = parseWhereClause(zoomSource, whereClause, false);<NEW_LINE>if (Check.isEmpty(parsedWhere)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final StringBuilder whereClauseEffective = new StringBuilder();<NEW_LINE>whereClauseEffective.append(parsedWhere);<NEW_LINE>whereClauseEffective.append(" AND ( ").append(keyColumnName).append("=").append(zoomSource.getRecord_ID()).append(" )");<NEW_LINE>final boolean match = new Query(zoomSource.getCtx(), zoomSource.getTableName(), whereClauseEffective.toString(), zoomSource.getTrxName()).anyMatch();<NEW_LINE>logger.debug("whereClause='{}' matches source='{}': {}", parsedWhere, zoomSource, match);<NEW_LINE>return match;<NEW_LINE>} | warn("matchesAsSource - return false because zoomSource.isGenericZoomOrigin()==false; this={}; zoomSource={}", this, zoomSource); |
71,731 | public void start(final BundleContext context) throws Exception {<NEW_LINE>if (System.getProperty("netbeans.home") != null) {<NEW_LINE>throw new IllegalStateException("Should not be run from inside regular NetBeans module system");<NEW_LINE>}<NEW_LINE>String storage = context.getProperty(Constants.FRAMEWORK_STORAGE);<NEW_LINE>if (storage != null) {<NEW_LINE>System.setProperty("netbeans.user", storage);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>NbBundle.setBranding(System.getProperty("branding.token"));<NEW_LINE>OSGiMainLookup.initialize(context);<NEW_LINE>queue = new DependencyQueue<String, Bundle>();<NEW_LINE>this.context = context;<NEW_LINE>framework = ((Framework) context.getBundle(0));<NEW_LINE>if (framework.getState() == Bundle.STARTING) {<NEW_LINE>LOG.fine("framework still starting");<NEW_LINE>final AtomicReference<FrameworkListener> frameworkListener = new AtomicReference<FrameworkListener>();<NEW_LINE>frameworkListener.set(new FrameworkListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void frameworkEvent(FrameworkEvent event) {<NEW_LINE>if (event.getType() == FrameworkEvent.STARTED) {<NEW_LINE>// System.err.println("framework started");<NEW_LINE>context.removeFrameworkListener(frameworkListener.get());<NEW_LINE>context.addBundleListener(Activator.this);<NEW_LINE>processLoadedBundles();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>context.addFrameworkListener(frameworkListener.get());<NEW_LINE>} else {<NEW_LINE>LOG.fine("framework already started");<NEW_LINE>context.addBundleListener(this);<NEW_LINE>processLoadedBundles();<NEW_LINE>}<NEW_LINE>} | System.setProperty("TopSecurityManager.disable", "true"); |
973,220 | public okhttp3.Call createBranchProtectionRuleCall(String repository, BranchProtectionRule branchProtectionRule, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = branchProtectionRule;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/repositories/{repository}/branch_protection".replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams <MASK><NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | = new ArrayList<Pair>(); |
23,873 | void paint(ParagraphView pView, Graphics2D g, Shape pAlloc, Rectangle clipBounds) {<NEW_LINE>Rectangle2D.Double pRect = ViewUtils.shape2Bounds(pAlloc);<NEW_LINE>if (wrapInfo != null) {<NEW_LINE>int startWrapLineIndex;<NEW_LINE>int endWrapLineIndex;<NEW_LINE>double wrapY = clipBounds.y - pRect.y;<NEW_LINE>float wrapLineHeight = wrapInfo.wrapLineHeight(this);<NEW_LINE>if (wrapY < wrapLineHeight) {<NEW_LINE>startWrapLineIndex = 0;<NEW_LINE>} else {<NEW_LINE>startWrapLineIndex = (int) (wrapY / wrapLineHeight);<NEW_LINE>}<NEW_LINE>// Find end index<NEW_LINE>wrapY += clipBounds<MASK><NEW_LINE>if (wrapY >= height()) {<NEW_LINE>endWrapLineIndex = wrapInfo.wrapLineCount();<NEW_LINE>} else {<NEW_LINE>endWrapLineIndex = (int) (wrapY / wrapLineHeight) + 1;<NEW_LINE>}<NEW_LINE>wrapInfo.paintWrapLines(this, pView, startWrapLineIndex, endWrapLineIndex, g, pAlloc, clipBounds);<NEW_LINE>} else {<NEW_LINE>// Regular paint<NEW_LINE>double startX = clipBounds.x - pRect.x;<NEW_LINE>double endX = startX + clipBounds.width;<NEW_LINE>if (size() > 0) {<NEW_LINE>// y ignored<NEW_LINE>int startIndex = viewIndexNoWrap(pView, startX, pAlloc);<NEW_LINE>// y ignored<NEW_LINE>int endIndex = viewIndexNoWrap(pView, endX, pAlloc) + 1;<NEW_LINE>paintChildren(pView, g, pAlloc, clipBounds, startIndex, endIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .height + (wrapLineHeight - 1); |
1,394,379 | public Response<Void> deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String hubName = Utils.getValueFromIdByName(id, "hubs");<NEW_LINE>if (hubName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'hubs'.", id)));<NEW_LINE>}<NEW_LINE>String assignmentName = Utils.getValueFromIdByName(id, "roleAssignments");<NEW_LINE>if (assignmentName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroupName, hubName, assignmentName, context);<NEW_LINE>} | format("The resource ID '%s' is not valid. Missing path segment 'roleAssignments'.", id))); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.