idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,526,223 | public void checkIsConstant() throws ContractValidateException, VMIllegalException {<NEW_LINE>if (dynamicPropertiesStore.getAllowTvmConstantinople() == 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TriggerSmartContract triggerContractFromTransaction = ContractCapsule.getTriggerContractFromTransaction(this.getTrx().getInstance());<NEW_LINE>if (TRX_CONTRACT_CALL_TYPE == this.trxType) {<NEW_LINE>ContractCapsule contract = contractStore.get(triggerContractFromTransaction.getContractAddress().toByteArray());<NEW_LINE>if (contract == null) {<NEW_LINE>logger.info("contract: {} is not in contract store", StringUtil.encode58Check(triggerContractFromTransaction.getContractAddress().toByteArray()));<NEW_LINE>throw new ContractValidateException("contract: " + StringUtil.encode58Check(triggerContractFromTransaction.getContractAddress()<MASK><NEW_LINE>}<NEW_LINE>ABI abi = contract.getInstance().getAbi();<NEW_LINE>if (WalletUtil.isConstant(abi, triggerContractFromTransaction)) {<NEW_LINE>throw new VMIllegalException("cannot call constant method");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .toByteArray()) + " is not in contract store"); |
942,342 | void invoke() {<NEW_LINE>final String definition = streamFunctionProperties.getDefinition();<NEW_LINE>final String[] functionUnits = StringUtils.hasText(definition) ? definition.split(";") : new String[] {};<NEW_LINE>if (functionUnits.length == 0) {<NEW_LINE>resolvableTypeMap.forEach((key, value) -> {<NEW_LINE>Optional<KafkaStreamsBindableProxyFactory> proxyFactory = Arrays.stream(kafkaStreamsBindableProxyFactories).filter(p -> p.getFunctionName().equals(key)).findFirst();<NEW_LINE>this.kafkaStreamsFunctionProcessor.setupFunctionInvokerForKafkaStreams(value, key, proxyFactory.get(), methods.get(key), null);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>for (String functionUnit : functionUnits) {<NEW_LINE>if (functionUnit.contains("|")) {<NEW_LINE>final String[] <MASK><NEW_LINE>String[] derivedNameFromComposed = new String[] { "" };<NEW_LINE>for (String split : composedFunctions) {<NEW_LINE>derivedNameFromComposed[0] = derivedNameFromComposed[0].concat(split);<NEW_LINE>}<NEW_LINE>Optional<KafkaStreamsBindableProxyFactory> proxyFactory = Arrays.stream(kafkaStreamsBindableProxyFactories).filter(p -> p.getFunctionName().equals(derivedNameFromComposed[0])).findFirst();<NEW_LINE>proxyFactory.ifPresent(kafkaStreamsBindableProxyFactory -> this.kafkaStreamsFunctionProcessor.setupFunctionInvokerForKafkaStreams(resolvableTypeMap.get(composedFunctions[0]), derivedNameFromComposed[0], kafkaStreamsBindableProxyFactory, methods.get(derivedNameFromComposed[0]), resolvableTypeMap.get(composedFunctions[composedFunctions.length - 1]), composedFunctions));<NEW_LINE>} else {<NEW_LINE>Optional<KafkaStreamsBindableProxyFactory> proxyFactory = Arrays.stream(kafkaStreamsBindableProxyFactories).filter(p -> p.getFunctionName().equals(functionUnit)).findFirst();<NEW_LINE>proxyFactory.ifPresent(kafkaStreamsBindableProxyFactory -> this.kafkaStreamsFunctionProcessor.setupFunctionInvokerForKafkaStreams(resolvableTypeMap.get(functionUnit), functionUnit, kafkaStreamsBindableProxyFactory, methods.get(functionUnit), null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | composedFunctions = functionUnit.split("\\|"); |
1,421,501 | private void init(String userName, char[] password, String server, boolean isUserNameEditable, ImageIcon icon, String errorMessage) {<NEW_LINE>this.server = server;<NEW_LINE>initIcon(icon);<NEW_LINE>if (!isUserNameEditable)<NEW_LINE>this.uinValue = new JLabel();<NEW_LINE>else<NEW_LINE>this.uinValue = new JTextField();<NEW_LINE>this.init(isUserNameEditable);<NEW_LINE>this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);<NEW_LINE>this.enableKeyActions();<NEW_LINE>this.setResizable(false);<NEW_LINE>this.addWindowListener(new WindowAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void windowOpened(WindowEvent e) {<NEW_LINE>pack();<NEW_LINE>removeWindowListener(this);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (OSUtils.IS_MAC)<NEW_LINE>getRootPane().<MASK><NEW_LINE>if (userName != null) {<NEW_LINE>if (uinValue instanceof JLabel)<NEW_LINE>((JLabel) uinValue).setText(userName);<NEW_LINE>else if (uinValue instanceof JTextField)<NEW_LINE>((JTextField) uinValue).setText(userName);<NEW_LINE>}<NEW_LINE>if (password != null)<NEW_LINE>passwdField.setText(new String(password));<NEW_LINE>if (errorMessage != null) {<NEW_LINE>this.infoTextArea.setForeground(Color.RED);<NEW_LINE>this.infoTextArea.setText(errorMessage);<NEW_LINE>}<NEW_LINE>} | putClientProperty("apple.awt.brushMetalLook", Boolean.TRUE); |
1,620,627 | public static void main(String[] args) throws Exception {<NEW_LINE>String country = "", configfile = "", runtimeDataDir = "", licensePlate = "";<NEW_LINE>if (args.length == 4) {<NEW_LINE>country = args[0];<NEW_LINE>configfile = args[1];<NEW_LINE>runtimeDataDir = args[2];<NEW_LINE>licensePlate = args[3];<NEW_LINE>} else {<NEW_LINE>System.err.println("Program requires 4 arguments: Country, Config File, runtime_data dir, and license plate image");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>Alpr alpr = new Alpr(country, configfile, runtimeDataDir);<NEW_LINE>alpr.setTopN(10);<NEW_LINE>alpr.setDefaultRegion("wa");<NEW_LINE>// Read an image into a byte array and send it to OpenALPR<NEW_LINE>Path path = Paths.get(licensePlate);<NEW_LINE>byte[] imagedata = Files.readAllBytes(path);<NEW_LINE>AlprResults <MASK><NEW_LINE>System.out.println("OpenALPR Version: " + alpr.getVersion());<NEW_LINE>System.out.println("Image Size: " + results.getImgWidth() + "x" + results.getImgHeight());<NEW_LINE>System.out.println("Processing Time: " + results.getTotalProcessingTimeMs() + " ms");<NEW_LINE>System.out.println("Found " + results.getPlates().size() + " results");<NEW_LINE>System.out.format(" %-15s%-8s\n", "Plate Number", "Confidence");<NEW_LINE>for (AlprPlateResult result : results.getPlates()) {<NEW_LINE>for (AlprPlate plate : result.getTopNPlates()) {<NEW_LINE>if (plate.isMatchesTemplate())<NEW_LINE>System.out.print(" * ");<NEW_LINE>else<NEW_LINE>System.out.print(" - ");<NEW_LINE>System.out.format("%-15s%-8f\n", plate.getCharacters(), plate.getOverallConfidence());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Make sure to call this to release memory<NEW_LINE>alpr.unload();<NEW_LINE>} | results = alpr.recognize(imagedata); |
499,048 | final public TregexPattern ChildrenDisj() throws ParseException {<NEW_LINE>TregexPattern child;<NEW_LINE>List<TregexPattern> children = new ArrayList<TregexPattern>();<NEW_LINE>// When we keep track of the known variables to assert that<NEW_LINE>// variables are not redefined, or that links are only set to known<NEW_LINE>// variables, we want to separate those done in different parts of the<NEW_LINE>// disjunction. Variables set in one part won't be set in the next<NEW_LINE>// part if it gets there, since disjunctions exit once known.<NEW_LINE>Set<String> originalKnownVariables = Generics.newHashSet(knownVariables);<NEW_LINE>// However, we want to keep track of all the known variables, so that after<NEW_LINE>// the disjunction is over, we know them all.<NEW_LINE>Set<String> allKnownVariables = Generics.newHashSet(knownVariables);<NEW_LINE>child = ChildrenConj();<NEW_LINE>children.add(child);<NEW_LINE>allKnownVariables.addAll(knownVariables);<NEW_LINE>label_3: while (true) {<NEW_LINE>if (jj_2_2(2)) {<NEW_LINE>;<NEW_LINE>} else {<NEW_LINE>break label_3;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>jj_consume_token(12);<NEW_LINE>child = ChildrenConj();<NEW_LINE>children.add(child);<NEW_LINE>allKnownVariables.addAll(knownVariables);<NEW_LINE>}<NEW_LINE>knownVariables = allKnownVariables;<NEW_LINE>if (children.size() == 1) {<NEW_LINE>if ("" != null)<NEW_LINE>return child;<NEW_LINE>} else {<NEW_LINE>if ("" != null)<NEW_LINE>return new CoordinationPattern(children, false);<NEW_LINE>}<NEW_LINE>throw new Error("Missing return statement in function");<NEW_LINE>} | knownVariables = Generics.newHashSet(originalKnownVariables); |
824,973 | public static DescribeRDSPerformanceResponse unmarshall(DescribeRDSPerformanceResponse describeRDSPerformanceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeRDSPerformanceResponse.setRequestId(_ctx.stringValue("DescribeRDSPerformanceResponse.RequestId"));<NEW_LINE>describeRDSPerformanceResponse.setSuccess<MASK><NEW_LINE>List<PartialPerformanceData> data = new ArrayList<PartialPerformanceData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRDSPerformanceResponse.Data.Length"); i++) {<NEW_LINE>PartialPerformanceData partialPerformanceData = new PartialPerformanceData();<NEW_LINE>partialPerformanceData.setKey(_ctx.stringValue("DescribeRDSPerformanceResponse.Data[" + i + "].Key"));<NEW_LINE>partialPerformanceData.setUnit(_ctx.stringValue("DescribeRDSPerformanceResponse.Data[" + i + "].Unit"));<NEW_LINE>partialPerformanceData.setNodeNum(_ctx.integerValue("DescribeRDSPerformanceResponse.Data[" + i + "].NodeNum"));<NEW_LINE>partialPerformanceData.setNodeName(_ctx.stringValue("DescribeRDSPerformanceResponse.Data[" + i + "].NodeName"));<NEW_LINE>List<PerformanceValue> values = new ArrayList<PerformanceValue>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeRDSPerformanceResponse.Data[" + i + "].Values.Length"); j++) {<NEW_LINE>PerformanceValue performanceValue = new PerformanceValue();<NEW_LINE>performanceValue.setValue(_ctx.stringValue("DescribeRDSPerformanceResponse.Data[" + i + "].Values[" + j + "].Value"));<NEW_LINE>performanceValue.setDate(_ctx.longValue("DescribeRDSPerformanceResponse.Data[" + i + "].Values[" + j + "].Date"));<NEW_LINE>values.add(performanceValue);<NEW_LINE>}<NEW_LINE>partialPerformanceData.setValues(values);<NEW_LINE>data.add(partialPerformanceData);<NEW_LINE>}<NEW_LINE>describeRDSPerformanceResponse.setData(data);<NEW_LINE>return describeRDSPerformanceResponse;<NEW_LINE>} | (_ctx.booleanValue("DescribeRDSPerformanceResponse.Success")); |
1,846,294 | public ImmutableMap<InOutLineId, I_M_InOut> retrieveInOutByLineIds(@NonNull final Set<InOutLineId> inOutLineIds) {<NEW_LINE>final List<I_M_InOutLine> inOutLines = queryBL.createQueryBuilder(I_M_InOutLine.class).addOnlyActiveRecordsFilter().addInArrayFilter(I_M_InOutLine.COLUMNNAME_M_InOutLine_ID, inOutLineIds).create().list();<NEW_LINE>final Set<Integer> inOutIds = inOutLines.stream().map(I_M_InOutLine::getM_InOut_ID).collect(ImmutableSet.toImmutableSet());<NEW_LINE>final Map<Integer, I_M_InOut> inOutRecordsById = queryBL.createQueryBuilder(I_M_InOut.class).addOnlyActiveRecordsFilter().addInArrayFilter(I_M_InOut.COLUMNNAME_M_InOut_ID, inOutIds).create().mapById();<NEW_LINE>final ImmutableMap.Builder<InOutLineId, I_M_InOut> lineId2InOutBuilder = ImmutableMap.builder();<NEW_LINE>inOutLines.forEach(inOutLine -> {<NEW_LINE>final InOutLineId inOutLineId = InOutLineId.ofRepoId(inOutLine.getM_InOutLine_ID());<NEW_LINE>lineId2InOutBuilder.put(inOutLineId, inOutRecordsById.get<MASK><NEW_LINE>});<NEW_LINE>return lineId2InOutBuilder.build();<NEW_LINE>} | (inOutLine.getM_InOut_ID())); |
168,144 | public void handleRequest(HttpServerExchange exchange) throws Exception {<NEW_LINE>var request = MongoRequest.of(exchange);<NEW_LINE>var <MASK><NEW_LINE>if (request.isInError()) {<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>UUID sid = Sid.randomUUID(options(request));<NEW_LINE>response.getHeaders().add(HttpString.tryFromString("Location"), RepresentationUtils.getReferenceLink(URLUtils.getRemappedRequestURL(exchange), new BsonString(sid.toString())));<NEW_LINE>response.setContentTypeAsJson();<NEW_LINE>response.setStatusCode(HttpStatus.SC_CREATED);<NEW_LINE>} catch (MongoClientException mce) {<NEW_LINE>LOGGER.error("Error {}", mce.getMessage());<NEW_LINE>// check if server supports sessions<NEW_LINE>if (!replicaSet(MongoClientSingleton.get().client())) {<NEW_LINE>response.setInError(HttpStatus.SC_BAD_GATEWAY, mce.getMessage());<NEW_LINE>} else {<NEW_LINE>throw mce;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>next(exchange);<NEW_LINE>} | response = MongoResponse.of(exchange); |
1,082,096 | public void endVisit(MethodDeclaration node) {<NEW_LINE>ExecutableElement element = node.getExecutableElement();<NEW_LINE>if (!ElementUtil.getName(element).equals("compareTo") || node.getBody() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DeclaredType comparableType = typeUtil.findSupertype(ElementUtil.getDeclaringClass(element).asType(), "java.lang.Comparable");<NEW_LINE>if (comparableType == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<? extends TypeMirror> typeArguments = comparableType.getTypeArguments();<NEW_LINE>List<? extends VariableElement> parameters = element.getParameters();<NEW_LINE>if (typeArguments.size() != 1 || parameters.size() != 1 || !typeArguments.get(0).equals(parameters.get(0).asType())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VariableElement param = node.<MASK><NEW_LINE>FunctionInvocation castCheck = createCastCheck(typeArguments.get(0), new SimpleName(param));<NEW_LINE>if (castCheck != null) {<NEW_LINE>node.getBody().addStatement(0, new ExpressionStatement(castCheck));<NEW_LINE>}<NEW_LINE>} | getParameter(0).getVariableElement(); |
1,422,410 | private static Map<String, MetadataFieldMapper.TypeParser> initBuiltInMetadataMappers() {<NEW_LINE>Map<String, MetadataFieldMapper.TypeParser> builtInMetadataMappers;<NEW_LINE>// Use a LinkedHashMap for metadataMappers because iteration order matters<NEW_LINE>builtInMetadataMappers = new LinkedHashMap<>();<NEW_LINE>// _ignored first so that we always load it, even if only _id is requested<NEW_LINE>builtInMetadataMappers.put(IgnoredFieldMapper.NAME, new IgnoredFieldMapper.TypeParser());<NEW_LINE>// UID second so it will be the first (if no ignored fields) stored field to load<NEW_LINE>// (so will benefit from "fields: []" early termination<NEW_LINE>builtInMetadataMappers.put(UidFieldMapper.NAME, new UidFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(IdFieldMapper.NAME, new IdFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(RoutingFieldMapper.NAME, new RoutingFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(IndexFieldMapper.NAME, new IndexFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(SourceFieldMapper.NAME<MASK><NEW_LINE>builtInMetadataMappers.put(TypeFieldMapper.NAME, new TypeFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(AllFieldMapper.NAME, new AllFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(VersionFieldMapper.NAME, new VersionFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(ParentFieldMapper.NAME, new ParentFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(SeqNoFieldMapper.NAME, new SeqNoFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(TokenFieldMapper.NAME, new TokenFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(HostFieldMapper.NAME, new HostFieldMapper.TypeParser());<NEW_LINE>// _field_names must be added last so that it has a chance to see all the other mappers<NEW_LINE>builtInMetadataMappers.put(FieldNamesFieldMapper.NAME, new FieldNamesFieldMapper.TypeParser());<NEW_LINE>return Collections.unmodifiableMap(builtInMetadataMappers);<NEW_LINE>} | , new SourceFieldMapper.TypeParser()); |
1,691,142 | public void destroyVolume(long volumeId) {<NEW_LINE>// mark volume entry in volumes table as destroy state<NEW_LINE>VolumeInfo vol = volFactory.getVolume(volumeId);<NEW_LINE>vol.stateTransit(Volume.Event.DestroyRequested);<NEW_LINE>snapshotMgr.deletePoliciesForVolume(volumeId);<NEW_LINE>annotationDao.removeByEntityType(AnnotationService.EntityType.VOLUME.name(), vol.getUuid());<NEW_LINE>vol.<MASK><NEW_LINE>if (vol.getAttachedVM() == null || vol.getAttachedVM().getType() == VirtualMachine.Type.User) {<NEW_LINE>// Decrement the resource count for volumes and primary storage belonging user VM's only<NEW_LINE>_resourceLimitMgr.decrementResourceCount(vol.getAccountId(), ResourceType.volume, vol.isDisplay());<NEW_LINE>_resourceLimitMgr.decrementResourceCount(vol.getAccountId(), ResourceType.primary_storage, vol.isDisplay(), new Long(vol.getSize()));<NEW_LINE>}<NEW_LINE>} | stateTransit(Volume.Event.OperationSucceeded); |
1,469,879 | public PCollection<T> expand(PBegin input) {<NEW_LINE>checkArgument(getScanResponseMapperFn() != null, "withScanResponseMapperFn() is required");<NEW_LINE>checkArgument(getScanRequestFn() != null, "withScanRequestFn() is required");<NEW_LINE>ScanRequest scanRequest = getScanRequestFn().apply(null);<NEW_LINE>checkArgument((scanRequest.totalSegments() != null && scanRequest.totalSegments() > 0), "TotalSegments is required with withScanRequestFn() and greater zero");<NEW_LINE>if (getDynamoDbClientProvider() == null) {<NEW_LINE>checkNotNull(getClientConfiguration(), "clientConfiguration cannot be null");<NEW_LINE>AwsOptions awsOptions = input.getPipeline().getOptions().as(AwsOptions.class);<NEW_LINE>ClientBuilderFactory.validate(awsOptions, getClientConfiguration());<NEW_LINE>}<NEW_LINE>PCollection<Read<T>> splits = input.apply("Create", Create.of(this)).apply("Split", ParDo.of(new SplitFn<>()));<NEW_LINE>splits.setCoder(SerializableCoder.of(new TypeDescriptor<Read<T>>() {<NEW_LINE>}));<NEW_LINE>PCollection<T> output = splits.apply("Reshuffle", Reshuffle.viaRandomKey()).apply("Read", ParDo.of(<MASK><NEW_LINE>output.setCoder(getCoder());<NEW_LINE>return output;<NEW_LINE>} | new ReadFn<>())); |
320,229 | private CompletableFuture<Void> performCommit(MetadataTransaction txn, boolean lazyWrite, Map<String, TransactionData> txnData, ArrayList<String> modifiedKeys, ArrayList<TransactionData> modifiedValues) {<NEW_LINE>return CompletableFuture.runAsync(() -> {<NEW_LINE>// Step 2 : Check whether transaction is safe to commit.<NEW_LINE>validateCommit(txn, txnData, modifiedKeys, modifiedValues);<NEW_LINE>}, executor).thenComposeAsync(v -> {<NEW_LINE>// Step 3: Commit externally.<NEW_LINE>// This operation may call external storage.<NEW_LINE>return writeToMetadataStore(lazyWrite, modifiedValues);<NEW_LINE>}, executor).thenComposeAsync(v -> executeExternalCommitAction(txn), executor).thenRunAsync(() -> {<NEW_LINE>// If we reach here then it means transaction is safe to commit.<NEW_LINE>// Step 4: Update buffer.<NEW_LINE>val committedVersion = version.incrementAndGet();<NEW_LINE>val toAdd = new HashMap<String, TransactionData>();<NEW_LINE>int delta = 0;<NEW_LINE>for (String key : modifiedKeys) {<NEW_LINE>TransactionData data = getDeepCopy(txnData.get(key));<NEW_LINE>data.setVersion(committedVersion);<NEW_LINE><MASK><NEW_LINE>if (data.isCreated()) {<NEW_LINE>delta++;<NEW_LINE>}<NEW_LINE>if (data.isDeleted()) {<NEW_LINE>delta--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bufferedTxnData.putAll(toAdd);<NEW_LINE>bufferCount.addAndGet(delta);<NEW_LINE>}, executor);<NEW_LINE>} | toAdd.put(key, data); |
963,457 | public static int run(String[] args) {<NEW_LINE>Args parameters = new Args();<NEW_LINE>JCommander jc = JCommander.newBuilder().addObject(parameters).build();<NEW_LINE>jc.parse(args);<NEW_LINE>if (parameters.help) {<NEW_LINE>jc.usage();<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>File dbDirectory = new File(parameters.databaseDirectory);<NEW_LINE>if (!dbDirectory.exists()) {<NEW_LINE>logger.info("Directory {} does not exist.", parameters.databaseDirectory);<NEW_LINE>return 404;<NEW_LINE>}<NEW_LINE>List<File> files = Arrays.stream(Objects.requireNonNull(dbDirectory.listFiles())).filter(File::isDirectory).collect(Collectors.toList());<NEW_LINE>if (files.isEmpty()) {<NEW_LINE>logger.info("Directory {} does not contain any database.", parameters.databaseDirectory);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>final long time = System.currentTimeMillis();<NEW_LINE>final List<Future<Boolean>> res = new ArrayList<>();<NEW_LINE>final ThreadPoolExecutor executor = new ThreadPoolExecutor(CPUS, 16 * CPUS, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<>(CPUS, true), Executors.defaultThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy());<NEW_LINE>executor.allowCoreThreadTimeOut(true);<NEW_LINE>files.forEach(f -> res.add(executor.submit(new ArchiveManifest(parameters.databaseDirectory, f.getName(), parameters.maxManifestSize, parameters.maxBatchSize))));<NEW_LINE><MASK><NEW_LINE>for (Future<Boolean> re : res) {<NEW_LINE>try {<NEW_LINE>if (Boolean.TRUE.equals(re.get())) {<NEW_LINE>fails--;<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error("{}", e);<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>logger.error("{}", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>executor.shutdown();<NEW_LINE>logger.info("DatabaseDirectory:{}, maxManifestSize:{}, maxBatchSize:{}," + "database reopen use {} seconds total.", parameters.databaseDirectory, parameters.maxManifestSize, parameters.maxBatchSize, (System.currentTimeMillis() - time) / 1000);<NEW_LINE>if (fails > 0) {<NEW_LINE>logger.error("Failed!!!!!!!!!!!!!!!!!!!!!!!! size:{}", fails);<NEW_LINE>}<NEW_LINE>return fails;<NEW_LINE>} | int fails = res.size(); |
1,589,962 | public void marshall(TransformJob transformJob, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (transformJob == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(transformJob.getTransformJobName(), TRANSFORMJOBNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getTransformJobArn(), TRANSFORMJOBARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getTransformJobStatus(), TRANSFORMJOBSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(transformJob.getModelName(), MODELNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getMaxConcurrentTransforms(), MAXCONCURRENTTRANSFORMS_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getModelClientConfig(), MODELCLIENTCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getMaxPayloadInMB(), MAXPAYLOADINMB_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getBatchStrategy(), BATCHSTRATEGY_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getEnvironment(), ENVIRONMENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getTransformInput(), TRANSFORMINPUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getTransformOutput(), TRANSFORMOUTPUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getTransformResources(), TRANSFORMRESOURCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getTransformStartTime(), TRANSFORMSTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getTransformEndTime(), TRANSFORMENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getLabelingJobArn(), LABELINGJOBARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getAutoMLJobArn(), AUTOMLJOBARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getDataProcessing(), DATAPROCESSING_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getExperimentConfig(), EXPERIMENTCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(transformJob.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | transformJob.getFailureReason(), FAILUREREASON_BINDING); |
655,912 | public Map.Entry<K, V> next() {<NEW_LINE>Map.Entry<K, ReplicatedRecord<K, V>> entry = this.entry;<NEW_LINE>Object key = entry != null ? entry.getKey() : null;<NEW_LINE>Object value = entry != null && entry.getValue() != null ? entry.getValue<MASK><NEW_LINE>while (entry == null) {<NEW_LINE>entry = findNextEntry();<NEW_LINE>key = entry.getKey();<NEW_LINE>ReplicatedRecord<K, V> record = entry.getValue();<NEW_LINE>value = record != null ? record.getValue() : null;<NEW_LINE>if (key != null && value != null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.entry = null;<NEW_LINE>if (key == null || value == null) {<NEW_LINE>throw new NoSuchElementException();<NEW_LINE>}<NEW_LINE>key = recordStore.unmarshall(key);<NEW_LINE>value = recordStore.unmarshall(value);<NEW_LINE>return new AbstractMap.SimpleEntry<>((K) key, (V) value);<NEW_LINE>} | ().getValue() : null; |
1,494,018 | public static DescribeDcdnDomainIpaBpsDataResponse unmarshall(DescribeDcdnDomainIpaBpsDataResponse describeDcdnDomainIpaBpsDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDcdnDomainIpaBpsDataResponse.setRequestId(_ctx.stringValue("DescribeDcdnDomainIpaBpsDataResponse.RequestId"));<NEW_LINE>describeDcdnDomainIpaBpsDataResponse.setDomainName(_ctx.stringValue("DescribeDcdnDomainIpaBpsDataResponse.DomainName"));<NEW_LINE>describeDcdnDomainIpaBpsDataResponse.setStartTime(_ctx.stringValue("DescribeDcdnDomainIpaBpsDataResponse.StartTime"));<NEW_LINE>describeDcdnDomainIpaBpsDataResponse.setEndTime(_ctx.stringValue("DescribeDcdnDomainIpaBpsDataResponse.EndTime"));<NEW_LINE>describeDcdnDomainIpaBpsDataResponse.setDataInterval(_ctx.stringValue("DescribeDcdnDomainIpaBpsDataResponse.DataInterval"));<NEW_LINE>List<DataModule> bpsDataPerInterval = new ArrayList<DataModule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDcdnDomainIpaBpsDataResponse.BpsDataPerInterval.Length"); i++) {<NEW_LINE>DataModule dataModule = new DataModule();<NEW_LINE>dataModule.setTimeStamp(_ctx.stringValue("DescribeDcdnDomainIpaBpsDataResponse.BpsDataPerInterval[" + i + "].TimeStamp"));<NEW_LINE>dataModule.setIpaBps(_ctx.floatValue<MASK><NEW_LINE>bpsDataPerInterval.add(dataModule);<NEW_LINE>}<NEW_LINE>describeDcdnDomainIpaBpsDataResponse.setBpsDataPerInterval(bpsDataPerInterval);<NEW_LINE>return describeDcdnDomainIpaBpsDataResponse;<NEW_LINE>} | ("DescribeDcdnDomainIpaBpsDataResponse.BpsDataPerInterval[" + i + "].IpaBps")); |
1,313,087 | private static void runEveryDistinctOverNot(RegressionEnvironment env, String expression, AtomicInteger milestone) {<NEW_LINE>env.compileDeploy(expression).addListener("s0");<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("A1", 1));<NEW_LINE>env.assertPropsNew("s0", "a.theString".split(","), new Object[] { "A1" });<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("A2", 1));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("A3", 2));<NEW_LINE>env.assertPropsNew("s0", "a.theString".split(","), new Object[] { "A3" });<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("B1", 1));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("A4", 1));<NEW_LINE>env.assertPropsNew("s0", "a.theString".split(","), <MASK><NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>env.sendEventBean(new SupportBean("A5", 1));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.undeployAll();<NEW_LINE>} | new Object[] { "A4" }); |
163,552 | public <R, V extends Validation<E, R>> V apply(Function5<T1, T2, T3, T4, T5, R> f) {<NEW_LINE>final Validation<E, Function1<T2, Function1<T3, Function1<T4, Function1<T5, R>>>>> apply1 = v1.apply(Validation.success(Functions.curry(f)));<NEW_LINE>final Validation<E, Function1<T3, Function1<T4, Function1<T5, R>>>> apply2 = v2.apply(apply1);<NEW_LINE>final Validation<E, Function1<T4, Function1<T5, R>>> <MASK><NEW_LINE>final Validation<E, Function1<T5, R>> apply4 = v4.apply(apply3);<NEW_LINE>return v5.apply(apply4);<NEW_LINE>} | apply3 = v3.apply(apply2); |
1,414,614 | public void accept(final String fieldName, final Object fieldValue) {<NEW_LINE>if (IoTDBIndexes.isIndex(fieldName)) {<NEW_LINE>List<String<MASK><NEW_LINE>List<String> indexValues = request.getIndexValues();<NEW_LINE>// To avoid indexValue be "null" when inserting, replace null to empty string<NEW_LINE>if (indexes.contains(fieldName)) {<NEW_LINE>indexValues.set(indexes.indexOf(fieldName), fieldValue == null ? Const.EMPTY_STRING : fieldValue.toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// time_bucket has changed to timestamp before calling this method,<NEW_LINE>// and IoTDB v0.12 doesn't allow insert null value,<NEW_LINE>// so they don't need to be stored.<NEW_LINE>if (fieldName.equals(IoTDBClient.TIME_BUCKET) || fieldValue == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> measurements = request.getMeasurements();<NEW_LINE>List<TSDataType> measurementTypes = request.getMeasurementTypes();<NEW_LINE>List<Object> measurementValues = request.getMeasurementValues();<NEW_LINE>// IoTDB doesn't allow a measurement named `timestamp` or contains `.`<NEW_LINE>if (fieldName.equals(IoTDBClient.TIMESTAMP) || fieldName.contains(".")) {<NEW_LINE>measurements.add(IoTDBUtils.addQuotationMark(fieldName));<NEW_LINE>} else {<NEW_LINE>measurements.add(fieldName);<NEW_LINE>}<NEW_LINE>measurementTypes.add(tableMetaInfo.getColumnAndTypeMap().get(fieldName));<NEW_LINE>if (fieldValue instanceof StorageDataComplexObject) {<NEW_LINE>measurementValues.add(((StorageDataComplexObject) fieldValue).toStorageData());<NEW_LINE>} else {<NEW_LINE>measurementValues.add(fieldValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > indexes = request.getIndexes(); |
1,796,068 | private Mono<Response<Void>> deleteSwiftVirtualNetworkWithResponseAsync(String resourceGroupName, String name, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.deleteSwiftVirtualNetwork(this.client.getEndpoint(), resourceGroupName, name, this.client.getSubscriptionId(), this.client.getApiVersion(), context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
399,213 | public static URLParam parse(Map<String, String> params, String rawParam) {<NEW_LINE>if (CollectionUtils.isNotEmptyMap(params)) {<NEW_LINE>int capacity = (int) (params.size() / .75f) + 1;<NEW_LINE>BitSet keyBit = new BitSet(capacity);<NEW_LINE>Map<Integer, Integer> valueMap = new HashMap<>(capacity);<NEW_LINE>Map<String, String> extraParam <MASK><NEW_LINE>Map<String, Map<String, String>> methodParameters = new HashMap<>(capacity);<NEW_LINE>for (Map.Entry<String, String> entry : params.entrySet()) {<NEW_LINE>addParameter(keyBit, valueMap, extraParam, methodParameters, entry.getKey(), entry.getValue(), false);<NEW_LINE>}<NEW_LINE>return new URLParam(keyBit, valueMap, extraParam, methodParameters, rawParam);<NEW_LINE>} else {<NEW_LINE>return EMPTY_PARAM;<NEW_LINE>}<NEW_LINE>} | = new HashMap<>(capacity); |
1,786,388 | private boolean process(String targetStr, String charStr, String numStr) {<NEW_LINE>double result;<NEW_LINE>double target;<NEW_LINE>try {<NEW_LINE>target = Double.parseDouble(targetStr);<NEW_LINE>if (numStr.startsWith("-")) {<NEW_LINE>result = -Double.parseDouble(numStr.substring(1));<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new IllegalArgsOperatorException("operator " + charStr + numStr + " is illegal.");<NEW_LINE>}<NEW_LINE>switch(charStr) {<NEW_LINE>case ">":<NEW_LINE>return target > result;<NEW_LINE>case "<":<NEW_LINE>return target < result;<NEW_LINE>case "=":<NEW_LINE>return doubleEquals(target, result);<NEW_LINE>case ">=":<NEW_LINE>return target >= result;<NEW_LINE>case "<=":<NEW_LINE>return target <= result;<NEW_LINE>case "!":<NEW_LINE>case "!=":<NEW_LINE>return !doubleEquals(target, result);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgsOperatorException("operator " + charStr + numStr + " is illegal.");<NEW_LINE>}<NEW_LINE>} | result = Double.parseDouble(numStr); |
814,046 | public static DescribeGrantRulesResponse unmarshall(DescribeGrantRulesResponse describeGrantRulesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGrantRulesResponse.setRequestId(_ctx.stringValue("DescribeGrantRulesResponse.RequestId"));<NEW_LINE>describeGrantRulesResponse.setTotalCount(_ctx.integerValue("DescribeGrantRulesResponse.TotalCount"));<NEW_LINE>describeGrantRulesResponse.setPageSize(_ctx.integerValue("DescribeGrantRulesResponse.PageSize"));<NEW_LINE>describeGrantRulesResponse.setPageNumber<MASK><NEW_LINE>List<GrantRule> grantRules = new ArrayList<GrantRule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGrantRulesResponse.GrantRules.Length"); i++) {<NEW_LINE>GrantRule grantRule = new GrantRule();<NEW_LINE>grantRule.setCenInstanceId(_ctx.stringValue("DescribeGrantRulesResponse.GrantRules[" + i + "].CenInstanceId"));<NEW_LINE>grantRule.setCenUid(_ctx.longValue("DescribeGrantRulesResponse.GrantRules[" + i + "].CenUid"));<NEW_LINE>grantRule.setGmtCreate(_ctx.longValue("DescribeGrantRulesResponse.GrantRules[" + i + "].GmtCreate"));<NEW_LINE>grantRule.setGrantRuleId(_ctx.stringValue("DescribeGrantRulesResponse.GrantRules[" + i + "].GrantRuleId"));<NEW_LINE>grantRule.setGrantTrafficService(_ctx.booleanValue("DescribeGrantRulesResponse.GrantRules[" + i + "].GrantTrafficService"));<NEW_LINE>grantRule.setGmtModified(_ctx.longValue("DescribeGrantRulesResponse.GrantRules[" + i + "].GmtModified"));<NEW_LINE>grantRule.setCcnUid(_ctx.longValue("DescribeGrantRulesResponse.GrantRules[" + i + "].CcnUid"));<NEW_LINE>grantRule.setRegionId(_ctx.stringValue("DescribeGrantRulesResponse.GrantRules[" + i + "].RegionId"));<NEW_LINE>grantRule.setCcnInstanceId(_ctx.stringValue("DescribeGrantRulesResponse.GrantRules[" + i + "].CcnInstanceId"));<NEW_LINE>grantRules.add(grantRule);<NEW_LINE>}<NEW_LINE>describeGrantRulesResponse.setGrantRules(grantRules);<NEW_LINE>return describeGrantRulesResponse;<NEW_LINE>} | (_ctx.integerValue("DescribeGrantRulesResponse.PageNumber")); |
1,340,147 | protected void parseJobAcquisition(XMLExtendedStreamReader reader, List<ModelNode> operations, ModelNode parentAddress) throws XMLStreamException {<NEW_LINE>String acquisitionName = null;<NEW_LINE>// Add the 'add' operation for each 'job-acquisition' child<NEW_LINE>ModelNode addJobAcquisitionOp = new ModelNode();<NEW_LINE>addJobAcquisitionOp.get(OP).set(ADD);<NEW_LINE>for (int i = 0; i < reader.getAttributeCount(); i++) {<NEW_LINE>Attribute attribute = Attribute.forName<MASK><NEW_LINE>switch(attribute) {<NEW_LINE>case NAME:<NEW_LINE>{<NEW_LINE>acquisitionName = rawAttributeText(reader, NAME.getLocalName());<NEW_LINE>if (acquisitionName != null && !acquisitionName.equals("null")) {<NEW_LINE>SubsystemAttributeDefinitons.NAME.parseAndSetParameter(acquisitionName, addJobAcquisitionOp, reader);<NEW_LINE>} else {<NEW_LINE>throw missingRequiredElement(reader, Collections.singleton(NAME.getLocalName()));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw unexpectedAttribute(reader, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ModelNode jobAcquisitionAddress = parentAddress.get(OP_ADDR).clone();<NEW_LINE>jobAcquisitionAddress.add(ModelConstants.JOB_ACQUISITIONS, acquisitionName);<NEW_LINE>addJobAcquisitionOp.get(OP_ADDR).set(jobAcquisitionAddress);<NEW_LINE>operations.add(addJobAcquisitionOp);<NEW_LINE>// iterate deeper<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>switch(reader.nextTag()) {<NEW_LINE>case END_ELEMENT:<NEW_LINE>{<NEW_LINE>if (Element.forName(reader.getLocalName()) == Element.JOB_AQUISITION) {<NEW_LINE>// should mean we're done, so ignore it.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>case START_ELEMENT:<NEW_LINE>{<NEW_LINE>switch(Element.forName(reader.getLocalName())) {<NEW_LINE>case PROPERTIES:<NEW_LINE>{<NEW_LINE>parseProperties(reader, operations, addJobAcquisitionOp);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case ACQUISITION_STRATEGY:<NEW_LINE>{<NEW_LINE>parseElement(SubsystemAttributeDefinitons.ACQUISITION_STRATEGY, addJobAcquisitionOp, reader);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw unexpectedElement(reader);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (reader.getAttributeLocalName(i)); |
63,891 | private void writeHeaders(DataOutputStream os, ProducerOptionalBlobPartConfig.OptionalBlobPartOutputStreams partStreams, boolean isReverseDelta, HollowBlobHeaderWrapper hollowBlobHeaderWrapper) throws IOException {<NEW_LINE>headerWriter.<MASK><NEW_LINE>VarInt.writeVInt(os, hollowBlobHeaderWrapper.header.getSchemas().size());<NEW_LINE>if (partStreams != null) {<NEW_LINE>// / write part headers<NEW_LINE>for (Map.Entry<String, ConfiguredOutputStream> entry : partStreams.getPartStreams().entrySet()) {<NEW_LINE>String partName = entry.getKey();<NEW_LINE>HollowBlobOptionalPartHeader partHeader = new HollowBlobOptionalPartHeader(partName);<NEW_LINE>if (isReverseDelta) {<NEW_LINE>partHeader.setOriginRandomizedTag(stateEngine.getNextStateRandomizedTag());<NEW_LINE>partHeader.setDestinationRandomizedTag(stateEngine.getPreviousStateRandomizedTag());<NEW_LINE>} else {<NEW_LINE>partHeader.setOriginRandomizedTag(stateEngine.getPreviousStateRandomizedTag());<NEW_LINE>partHeader.setDestinationRandomizedTag(stateEngine.getNextStateRandomizedTag());<NEW_LINE>}<NEW_LINE>List<HollowSchema> partSchemas = hollowBlobHeaderWrapper.schemasByPartName.get(partName);<NEW_LINE>if (partSchemas == null)<NEW_LINE>partSchemas = Collections.emptyList();<NEW_LINE>partHeader.setSchemas(partSchemas);<NEW_LINE>headerWriter.writePartHeader(partHeader, entry.getValue().getStream());<NEW_LINE>VarInt.writeVInt(entry.getValue().getStream(), partSchemas.size());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | writeHeader(hollowBlobHeaderWrapper.header, os); |
445,962 | public JRDataSource createDatasource() throws JRException {<NEW_LINE>try {<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>Workbook workbook = (<MASK><NEW_LINE>if (workbook == null) {<NEW_LINE>workbook = (Workbook) getParameterValue(AbstractXlsQueryExecuterFactory.XLS_WORKBOOK, true);<NEW_LINE>}<NEW_LINE>if (workbook != null) {<NEW_LINE>datasource = new JRXlsxDataSource(workbook);<NEW_LINE>} else {<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>InputStream xlsxInputStream = (InputStream) getParameterValue(JRXlsxQueryExecuterFactory.XLSX_INPUT_STREAM);<NEW_LINE>if (xlsxInputStream == null) {<NEW_LINE>xlsxInputStream = (InputStream) getParameterValue(AbstractXlsQueryExecuterFactory.XLS_INPUT_STREAM, true);<NEW_LINE>}<NEW_LINE>if (xlsxInputStream != null) {<NEW_LINE>datasource = new JRXlsxDataSource(xlsxInputStream);<NEW_LINE>} else {<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>File xlsxFile = (File) getParameterValue(JRXlsxQueryExecuterFactory.XLSX_FILE);<NEW_LINE>if (xlsxFile == null) {<NEW_LINE>xlsxFile = (File) getParameterValue(AbstractXlsQueryExecuterFactory.XLS_FILE, true);<NEW_LINE>}<NEW_LINE>if (xlsxFile != null) {<NEW_LINE>datasource = new JRXlsxDataSource(xlsxFile);<NEW_LINE>} else {<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>String xlsxSource = getStringParameterOrProperty(JRXlsxQueryExecuterFactory.XLSX_SOURCE);<NEW_LINE>if (xlsxSource == null) {<NEW_LINE>xlsxSource = getStringParameterOrProperty(AbstractXlsQueryExecuterFactory.XLS_SOURCE);<NEW_LINE>}<NEW_LINE>if (xlsxSource != null) {<NEW_LINE>// TODO<NEW_LINE>datasource = new JRXlsxDataSource(getRepositoryContext(), xlsxSource);<NEW_LINE>} else {<NEW_LINE>if (log.isWarnEnabled()) {<NEW_LINE>log.warn("No XLS source was provided.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new JRException(e);<NEW_LINE>}<NEW_LINE>if (datasource != null) {<NEW_LINE>initDatasource(datasource);<NEW_LINE>}<NEW_LINE>return datasource;<NEW_LINE>} | Workbook) getParameterValue(JRXlsxQueryExecuterFactory.XLSX_WORKBOOK); |
410,206 | void start(ResumeFollowAction.Request request, String clusterNameAlias, IndexMetadata leaderIndexMetadata, IndexMetadata followIndexMetadata, String[] leaderIndexHistoryUUIDs, ActionListener<AcknowledgedResponse> listener) throws IOException {<NEW_LINE>MapperService mapperService = followIndexMetadata != null ? indicesService.createIndexMapperService(followIndexMetadata) : null;<NEW_LINE>validate(request, leaderIndexMetadata, followIndexMetadata, leaderIndexHistoryUUIDs, mapperService);<NEW_LINE>final int numShards = followIndexMetadata.getNumberOfShards();<NEW_LINE>final ResponseHandler handler <MASK><NEW_LINE>Map<String, String> filteredHeaders = ClientHelper.getPersistableSafeSecurityHeaders(threadPool.getThreadContext(), clusterService.state());<NEW_LINE>for (int shardId = 0; shardId < numShards; shardId++) {<NEW_LINE>String taskId = followIndexMetadata.getIndexUUID() + "-" + shardId;<NEW_LINE>final ShardFollowTask shardFollowTask = createShardFollowTask(shardId, clusterNameAlias, request.getParameters(), leaderIndexMetadata, followIndexMetadata, filteredHeaders);<NEW_LINE>persistentTasksService.sendStartRequest(taskId, ShardFollowTask.NAME, shardFollowTask, handler.getActionListener(shardId));<NEW_LINE>}<NEW_LINE>} | = new ResponseHandler(numShards, listener); |
568,598 | /*<NEW_LINE>// We cannot convert this into a NoCallResultInstr<NEW_LINE>@Override<NEW_LINE>public Instr discardResult() {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) {<NEW_LINE>IRubyObject[] args = prepareArguments(context, self, currScope, currDynScope, temp);<NEW_LINE>Block block = prepareBlock(context, self, currScope, currDynScope, temp);<NEW_LINE>RubyModule definingModule = ((RubyModule) getDefiningModule().retrieve(context, self, currScope, currDynScope, temp));<NEW_LINE>if (isLiteralBlock) {<NEW_LINE>return IRRuntimeHelpers.instanceSuperIter(context, self, getId(), definingModule, args, block);<NEW_LINE>} else {<NEW_LINE>return IRRuntimeHelpers.instanceSuper(context, self, getId(<MASK><NEW_LINE>}<NEW_LINE>} | ), definingModule, args, block); |
219,641 | public ByteQueue build(CompressionManager compressionManager) {<NEW_LINE>if (!compressionManager.isCompressionEnabled()) {<NEW_LINE>return build();<NEW_LINE>}<NEW_LINE>byte[] original = bytes.toArray();<NEW_LINE>byte[] compressed = compressionManager.compressPacket(original);<NEW_LINE>// no compression happened<NEW_LINE>if (compressed == original) {<NEW_LINE>// without compression the prefix is packet length + 0 byte<NEW_LINE>ByteQueue prefix = createVarInt(original.length + 1);<NEW_LINE>prefix.insert((byte) 0);<NEW_LINE>this.bytes.prepend(prefix);<NEW_LINE>} else {<NEW_LINE>// with compression we need to first prefix a varInt of the uncompressed data length<NEW_LINE>ByteQueue dataLen = createVarInt(original.length);<NEW_LINE>// ...and then prefix the length of the entire packet<NEW_LINE>ByteQueue packetLen = createVarInt(dataLen.size() + compressed.length);<NEW_LINE>byte[] res = new byte[compressed.length + dataLen.size(<MASK><NEW_LINE>System.arraycopy(packetLen.toArray(), 0, res, 0, packetLen.size());<NEW_LINE>System.arraycopy(dataLen.toArray(), 0, res, packetLen.size(), dataLen.size());<NEW_LINE>System.arraycopy(compressed, 0, res, packetLen.size() + dataLen.size(), compressed.length);<NEW_LINE>return new ByteQueue(res);<NEW_LINE>}<NEW_LINE>return bytes;<NEW_LINE>} | ) + packetLen.size()]; |
1,310,289 | private static List<String> determineModifiedDisplayKeysSettings(final DomainID domainID, final PwmLocaleBundle bundle, final StoredConfiguration storedConfiguration) {<NEW_LINE>final List<Locale> knownLocales = Collections.unmodifiableList(new AppConfig(storedConfiguration).getKnownLocales());<NEW_LINE>final List<String> modifiedKeys = new ArrayList<>();<NEW_LINE>for (final String key : bundle.getDisplayKeys()) {<NEW_LINE>final Map<String, String> storedBundle = storedConfiguration.readLocaleBundleMap(bundle, key, domainID);<NEW_LINE>if (!storedBundle.isEmpty()) {<NEW_LINE>for (final Locale locale : knownLocales) {<NEW_LINE>final ResourceBundle defaultBundle = ResourceBundle.getBundle(bundle.getTheClass().getName(), locale);<NEW_LINE>final String localeKeyString = PwmConstants.DEFAULT_LOCALE.toString().equals(locale.toString()) <MASK><NEW_LINE>{<NEW_LINE>final String value = storedBundle.get(localeKeyString);<NEW_LINE>if (value != null && !value.equals(defaultBundle.getString(key))) {<NEW_LINE>modifiedKeys.add(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableList(modifiedKeys);<NEW_LINE>} | ? "" : locale.toString(); |
1,284,605 | private void mergeWith(DoubleExponentialHistogramBuckets other, boolean additive) {<NEW_LINE>if (other.counts.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Find the common scale, and the extended window required to merge the two bucket sets<NEW_LINE>int commonScale = Math.min(this.scale, other.scale);<NEW_LINE>// Deltas are changes in scale<NEW_LINE>int deltaThis = this.scale - commonScale;<NEW_LINE>int deltaOther = other.scale - commonScale;<NEW_LINE>long newWindowStart;<NEW_LINE>long newWindowEnd;<NEW_LINE>if (this.counts.isEmpty()) {<NEW_LINE>newWindowStart = other.getOffset() >> deltaOther;<NEW_LINE>newWindowEnd = other.counts.getIndexEnd() >> deltaOther;<NEW_LINE>} else {<NEW_LINE>newWindowStart = Math.min(this.getOffset() >> deltaThis, other.getOffset() >> deltaOther);<NEW_LINE>newWindowEnd = Math.max((this.counts.getIndexEnd() >> deltaThis), (other.counts.getIndexEnd() >> deltaOther));<NEW_LINE>}<NEW_LINE>// downscale to fit new window<NEW_LINE>deltaThis += getScaleReduction(newWindowStart, newWindowEnd);<NEW_LINE>this.downscale(deltaThis);<NEW_LINE>// since we changed scale of this, we need to know the new difference between the two scales<NEW_LINE>deltaOther <MASK><NEW_LINE>// do actual merging of other into this. Will decrement or increment depending on sign.<NEW_LINE>int sign = additive ? 1 : -1;<NEW_LINE>for (int i = other.getOffset(); i <= other.counts.getIndexEnd(); i++) {<NEW_LINE>if (!this.counts.increment(i >> deltaOther, sign * other.counts.get(i))) {<NEW_LINE>// This should never occur if scales and windows are calculated without bugs<NEW_LINE>throw new IllegalStateException("Failed to merge exponential histogram buckets.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.totalCount += sign * other.totalCount;<NEW_LINE>} | = other.scale - this.scale; |
324,931 | final DescribeParametersResult executeDescribeParameters(DescribeParametersRequest describeParametersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeParametersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeParametersRequest> request = null;<NEW_LINE>Response<DescribeParametersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeParametersRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "DAX");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeParameters");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeParametersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeParametersResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(describeParametersRequest)); |
1,052,886 | public void onFragmentActivated() {<NEW_LINE>EditPoiData data = getData();<NEW_LINE>if (data == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>basicTagsInitialized = false;<NEW_LINE>Map<String, String> tagValues = data.getTagValues();<NEW_LINE>streetEditText.setText(tagValues.get(OSMTagKey.ADDR_STREET.getValue()));<NEW_LINE>houseNumberEditText.setText(tagValues.get(OSMTagKey<MASK><NEW_LINE>phoneEditText.setText(tagValues.get(OSMTagKey.PHONE.getValue()));<NEW_LINE>webSiteEditText.setText(tagValues.get(OSMTagKey.WEBSITE.getValue()));<NEW_LINE>descriptionEditText.setText(tagValues.get(OSMTagKey.DESCRIPTION.getValue()));<NEW_LINE>OpeningHours openingHours = OpeningHoursParser.parseOpenedHoursHandleErrors(tagValues.get(OSMTagKey.OPENING_HOURS.getValue()));<NEW_LINE>if (openingHours == null) {<NEW_LINE>openingHours = new OpeningHours();<NEW_LINE>}<NEW_LINE>openingHoursAdapter.replaceOpeningHours(openingHours);<NEW_LINE>openingHoursAdapter.updateViews();<NEW_LINE>basicTagsInitialized = true;<NEW_LINE>} | .ADDR_HOUSE_NUMBER.getValue())); |
1,746,984 | private String createFolder(Document targetFolder, String displayName) throws FileNotFoundException {<NEW_LINE>Context context = getNonNullContext();<NEW_LINE>String newDirPath = targetFolder.getRemotePath() + displayName + PATH_SEPARATOR;<NEW_LINE>FileDataStorageManager storageManager = targetFolder.getStorageManager();<NEW_LINE>RemoteOperationResult result = new CreateFolderOperation(newDirPath, accountManager.getUser(), context, storageManager).execute(targetFolder.getClient());<NEW_LINE>if (!result.isSuccess()) {<NEW_LINE>Log_OC.e(TAG, result.toString());<NEW_LINE>throw new FileNotFoundException("Failed to create document with name " + displayName + " and documentId " + targetFolder.getDocumentId());<NEW_LINE>}<NEW_LINE>RemoteOperationResult updateParent = new RefreshFolderOperation(targetFolder.getFile(), System.currentTimeMillis(), false, false, true, storageManager, targetFolder.getUser(), context).execute(targetFolder.getClient());<NEW_LINE>if (!updateParent.isSuccess()) {<NEW_LINE>Log_OC.e(<MASK><NEW_LINE>throw new FileNotFoundException("Failed to create document with documentId " + targetFolder.getDocumentId());<NEW_LINE>}<NEW_LINE>Document newFolder = new Document(storageManager, newDirPath);<NEW_LINE>context.getContentResolver().notifyChange(toNotifyUri(targetFolder), null, false);<NEW_LINE>return newFolder.getDocumentId();<NEW_LINE>} | TAG, updateParent.toString()); |
1,067,570 | protected void genBitsets(Vector bitsetList, int maxVocabulary, String prefix) {<NEW_LINE>TokenManager tm = grammar.tokenManager;<NEW_LINE>println("");<NEW_LINE>for (int i = 0; i < bitsetList.size(); i++) {<NEW_LINE>BitSet p = (BitSet) bitsetList.elementAt(i);<NEW_LINE>// Ensure that generated BitSet is large enough for vocabulary<NEW_LINE>p.growToInclude(maxVocabulary);<NEW_LINE>// initialization data<NEW_LINE>println("const unsigned long " + prefix + getBitsetName(i) + "_data_" + "[] = { " + p.toStringOfHalfWords() + " };");<NEW_LINE>// Dump the contents of the bitset in readable format...<NEW_LINE>String t = "// ";<NEW_LINE>for (int j = 0; j < tm.getVocabulary().size(); j++) {<NEW_LINE>if (p.member(j)) {<NEW_LINE>if ((grammar instanceof LexerGrammar)) {<NEW_LINE>// only dump out for pure printable ascii.<NEW_LINE>if ((0x20 <= j) && (j < 0x7F))<NEW_LINE>t += charFormatter.<MASK><NEW_LINE>else<NEW_LINE>t += "0x" + Integer.toString(j, 16) + " ";<NEW_LINE>} else<NEW_LINE>t += tm.getTokenStringAt(j) + " ";<NEW_LINE>if (t.length() > 70) {<NEW_LINE>println(t);<NEW_LINE>t = "// ";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (t != "// ")<NEW_LINE>println(t);<NEW_LINE>// BitSet object<NEW_LINE>println("const " + namespaceAntlr + "BitSet " + prefix + getBitsetName(i) + "(" + getBitsetName(i) + "_data_," + p.size() / 32 + ");");<NEW_LINE>}<NEW_LINE>} | escapeChar(j, true) + " "; |
821,489 | static IkePhase1Policy toIkePhase1Policy(IsakmpProfile isakmpProfile, AristaConfiguration oldConfig, Configuration config, Warnings w) {<NEW_LINE>IkePhase1Policy ikePhase1Policy = new IkePhase1Policy(isakmpProfile.getName());<NEW_LINE>ImmutableList.Builder<String> ikePhase1ProposalBuilder = ImmutableList.builder();<NEW_LINE>for (Entry<Integer, IsakmpPolicy> entry : oldConfig.getIsakmpPolicies().entrySet()) {<NEW_LINE>ikePhase1ProposalBuilder.add(entry.<MASK><NEW_LINE>}<NEW_LINE>ikePhase1Policy.setIkePhase1Proposals(ikePhase1ProposalBuilder.build());<NEW_LINE>ikePhase1Policy.setSelfIdentity(isakmpProfile.getSelfIdentity());<NEW_LINE>if (isakmpProfile.getMatchIdentity() != null) {<NEW_LINE>ikePhase1Policy.setRemoteIdentity(isakmpProfile.getMatchIdentity().toIpSpace());<NEW_LINE>}<NEW_LINE>ikePhase1Policy.setLocalInterface(isakmpProfile.getLocalInterfaceName());<NEW_LINE>ikePhase1Policy.setIkePhase1Key(getMatchingPsk(isakmpProfile, w, config.getIkePhase1Keys()));<NEW_LINE>return ikePhase1Policy;<NEW_LINE>} | getKey().toString()); |
948,030 | public void handleNotification(Notification notification) {<NEW_LINE>super.handleNotification(notification);<NEW_LINE>Sandbox sandbox = Sandbox.getInstance();<NEW_LINE>UIStage uiStage = sandbox.getUIStage();<NEW_LINE>switch(notification.getName()) {<NEW_LINE>case Overlap2DMenuBar.CUSTOM_VARIABLES_EDITOR_OPEN:<NEW_LINE>viewComponent.show(uiStage);<NEW_LINE>break;<NEW_LINE>case UIBasicItemProperties.CUSTOM_VARS_BUTTON_CLICKED:<NEW_LINE>viewComponent.show(uiStage);<NEW_LINE>break;<NEW_LINE>case MsgAPI.ITEM_SELECTION_CHANGED:<NEW_LINE>Set<Entity<MASK><NEW_LINE>if (selection.size() == 1) {<NEW_LINE>setObservable(selection.iterator().next());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MsgAPI.EMPTY_SPACE_CLICKED:<NEW_LINE>setObservable(null);<NEW_LINE>break;<NEW_LINE>case CustomVariablesDialog.ADD_BUTTON_PRESSED:<NEW_LINE>setVariable();<NEW_LINE>break;<NEW_LINE>case CustomVariablesDialog.DELETE_BUTTON_PRESSED:<NEW_LINE>removeVariable(notification.getBody());<NEW_LINE>break;<NEW_LINE>case CustomVariableModifyCommand.DONE:<NEW_LINE>updateView();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | > selection = notification.getBody(); |
1,730,659 | public void onMediaClick(Album album, ArrayList<Media> media, int position) {<NEW_LINE>if (!pickMode) {<NEW_LINE>Intent intent = new Intent(getApplicationContext(), SingleMediaActivity.class);<NEW_LINE>intent.putExtra(SingleMediaActivity.EXTRA_ARGS_ALBUM, album);<NEW_LINE>try {<NEW_LINE>intent.setAction(SingleMediaActivity.ACTION_OPEN_ALBUM);<NEW_LINE>intent.putExtra(SingleMediaActivity.EXTRA_ARGS_MEDIA, media);<NEW_LINE>intent.putExtra(SingleMediaActivity.EXTRA_ARGS_POSITION, position);<NEW_LINE>startActivity(intent);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Putting too much data into the Bundle<NEW_LINE>// TODO: Find a better way to pass data between the activities - possibly a key to<NEW_LINE>// access a HashMap or a unique value of a singleton Data Repository of some sort.<NEW_LINE>intent.setAction(SingleMediaActivity.ACTION_OPEN_ALBUM_LAZY);<NEW_LINE>intent.putExtra(SingleMediaActivity.EXTRA_ARGS_MEDIA, media.get(position));<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Media <MASK><NEW_LINE>Uri uri = LegacyCompatFileProvider.getUri(getApplicationContext(), m.getFile());<NEW_LINE>Intent res = new Intent();<NEW_LINE>res.setData(uri);<NEW_LINE>res.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);<NEW_LINE>setResult(RESULT_OK, res);<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>} | m = media.get(position); |
122,771 | protected void handleInboundPubRel(MqttPubRel pubRel) throws MqttException {<NEW_LINE>final String methodName = "handleInboundPubRel";<NEW_LINE>if (pubRel.getReasonCodes()[0] > MqttReturnCode.RETURN_CODE_UNSPECIFIED_ERROR) {<NEW_LINE>// @TRACE 667=MqttPubRel was received with an error code: key={0} message={1},<NEW_LINE>// Reason Code={2}<NEW_LINE>log.severe(CLASS_NAME, methodName, "667", new Object[] { pubRel.getMessageId(), pubRel.toString(), pubRel.getReasonCodes()[0] });<NEW_LINE>throw new MqttException(pubRel.getReasonCodes()[0]);<NEW_LINE>} else {<NEW_LINE>// Currently this client has no need of the properties, so this is left empty.<NEW_LINE>MqttPubComp pubComp = new MqttPubComp(MqttReturnCode.RETURN_CODE_SUCCESS, pubRel.getMessageId(), new MqttProperties());<NEW_LINE>// @TRACE 668=Creating MqttPubComp: {0}<NEW_LINE>log.info(CLASS_NAME, methodName, "668", new Object[] { pubComp.toString() });<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | this.send(pubComp, null); |
1,105,235 | private void createMarginFields() {<NEW_LINE>NumericTextField topField = new NumericTextField();<NEW_LINE>NumericTextField rightField = new NumericTextField();<NEW_LINE>NumericTextField bottomField = new NumericTextField();<NEW_LINE>NumericTextField leftField = new NumericTextField();<NEW_LINE>StringConverter<Number> converter = new NumberStringConverter();<NEW_LINE>leftField.textProperty().bindBidirectional(getSkinnable().leftMarginProperty(), converter);<NEW_LINE>rightField.textProperty().bindBidirectional(getSkinnable().rightMarginProperty(), converter);<NEW_LINE>topField.textProperty().bindBidirectional(getSkinnable().topMarginProperty(), converter);<NEW_LINE>bottomField.textProperty().bindBidirectional(getSkinnable().bottomMarginProperty(), converter);<NEW_LINE>marginsGridPane = new GridPane();<NEW_LINE>marginsGridPane.getStyleClass().add("custom-fields");<NEW_LINE>marginsGridPane.add(new Label(Messages.getString("MarginSelector.TOP")), 0, 0);<NEW_LINE>marginsGridPane.add(topField, 1, 0);<NEW_LINE>marginsGridPane.add(new Label(Messages.getString("MarginSelector.RIGHT")), 2, 0);<NEW_LINE>marginsGridPane.add(rightField, 3, 0);<NEW_LINE>marginsGridPane.add(new Label(Messages.getString("MarginSelector.BOTTOM")), 0, 1);<NEW_LINE>marginsGridPane.<MASK><NEW_LINE>marginsGridPane.add(new Label(Messages.getString("MarginSelector.LEFT")), 2, 1);<NEW_LINE>marginsGridPane.add(leftField, 3, 1);<NEW_LINE>} | add(bottomField, 1, 1); |
433,124 | public static void registerType(ModelBuilder modelBuilder) {<NEW_LINE>ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Process.class, BPMN_ELEMENT_PROCESS).namespaceUri(BPMN20_NS).extendsType(CallableElement.class).instanceProvider(new ModelTypeInstanceProvider<Process>() {<NEW_LINE><NEW_LINE>public Process newInstance(ModelTypeInstanceContext instanceContext) {<NEW_LINE>return new ProcessImpl(instanceContext);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>processTypeAttribute = typeBuilder.enumAttribute(BPMN_ATTRIBUTE_PROCESS_TYPE, ProcessType.class).defaultValue(ProcessType.None).build();<NEW_LINE>isClosedAttribute = typeBuilder.booleanAttribute(BPMN_ATTRIBUTE_IS_CLOSED).defaultValue(false).build();<NEW_LINE>isExecutableAttribute = typeBuilder.booleanAttribute(BPMN_ATTRIBUTE_IS_EXECUTABLE).build();<NEW_LINE>// TODO: definitionalCollaborationRef<NEW_LINE>SequenceBuilder sequenceBuilder = typeBuilder.sequence();<NEW_LINE>auditingChild = sequenceBuilder.element(Auditing.class).build();<NEW_LINE>monitoringChild = sequenceBuilder.element(Monitoring.class).build();<NEW_LINE>propertyCollection = sequenceBuilder.elementCollection(Property.class).build();<NEW_LINE>laneSetCollection = sequenceBuilder.elementCollection(LaneSet.class).build();<NEW_LINE>flowElementCollection = sequenceBuilder.elementCollection(FlowElement.class).build();<NEW_LINE>artifactCollection = sequenceBuilder.elementCollection(Artifact.class).build();<NEW_LINE>resourceRoleCollection = sequenceBuilder.elementCollection(ResourceRole.class).build();<NEW_LINE>correlationSubscriptionCollection = sequenceBuilder.elementCollection(CorrelationSubscription.class).build();<NEW_LINE>supportsCollection = sequenceBuilder.elementCollection(Supports.class).qNameElementReferenceCollection(Process.class).build();<NEW_LINE>camundaCandidateStarterGroupsAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CANDIDATE_STARTER_GROUPS).<MASK><NEW_LINE>camundaCandidateStarterUsersAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CANDIDATE_STARTER_USERS).namespace(CAMUNDA_NS).build();<NEW_LINE>camundaJobPriorityAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_JOB_PRIORITY).namespace(CAMUNDA_NS).build();<NEW_LINE>camundaTaskPriorityAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_TASK_PRIORITY).namespace(CAMUNDA_NS).build();<NEW_LINE>camundaHistoryTimeToLiveAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_HISTORY_TIME_TO_LIVE).namespace(CAMUNDA_NS).build();<NEW_LINE>camundaIsStartableInTasklistAttribute = typeBuilder.booleanAttribute(CAMUNDA_ATTRIBUTE_IS_STARTABLE_IN_TASKLIST).defaultValue(true).namespace(CAMUNDA_NS).build();<NEW_LINE>camundaVersionTagAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_VERSION_TAG).namespace(CAMUNDA_NS).build();<NEW_LINE>typeBuilder.build();<NEW_LINE>} | namespace(CAMUNDA_NS).build(); |
1,149,930 | public boolean apply(Game game, Ability source) {<NEW_LINE>Set<Player> playersThatSearched = new HashSet<>(1);<NEW_LINE>for (UUID opponentId : game.getOpponents(source.getControllerId())) {<NEW_LINE>Player opponent = game.getPlayer(opponentId);<NEW_LINE>if (opponent != null && opponent.chooseUse(Outcome.PutCreatureInPlay, "Search your library for a creature card and put it onto the battlefield?", source, game)) {<NEW_LINE>TargetCardInLibrary target <MASK><NEW_LINE>if (opponent.searchLibrary(target, source, game)) {<NEW_LINE>Card targetCard = opponent.getLibrary().getCard(target.getFirstTarget(), game);<NEW_LINE>if (targetCard != null) {<NEW_LINE>opponent.moveCards(targetCard, Zone.BATTLEFIELD, source, game);<NEW_LINE>playersThatSearched.add(opponent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Player opponent : playersThatSearched) {<NEW_LINE>opponent.shuffleLibrary(source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | = new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE); |
950,555 | private void recordRequest(SpanRecorder recorder, Object target, Object[] args) {<NEW_LINE>final RpcInvocation invocation = (RpcInvocation) args[0];<NEW_LINE>final RpcContext rpcContext = RpcContext.getContext();<NEW_LINE><MASK><NEW_LINE>// Record rpc name, client address, server address.<NEW_LINE>recorder.recordRpcName(invoker.getInterface().getSimpleName() + ":" + invocation.getMethodName());<NEW_LINE>recorder.recordEndPoint(rpcContext.getLocalAddressString());<NEW_LINE>if (rpcContext.getRemoteHost() != null) {<NEW_LINE>recorder.recordRemoteAddress(rpcContext.getRemoteAddressString());<NEW_LINE>} else {<NEW_LINE>recorder.recordRemoteAddress("Unknown");<NEW_LINE>}<NEW_LINE>// If this transaction did not begin here, record parent(client who sent this request) information<NEW_LINE>if (!recorder.isRoot()) {<NEW_LINE>final String parentApplicationName = invocation.getAttachment(DubboConstants.META_PARENT_APPLICATION_NAME);<NEW_LINE>if (parentApplicationName != null) {<NEW_LINE>final short parentApplicationType = NumberUtils.parseShort(invocation.getAttachment(DubboConstants.META_PARENT_APPLICATION_TYPE), ServiceType.UNDEFINED.getCode());<NEW_LINE>recorder.recordParentApplication(parentApplicationName, parentApplicationType);<NEW_LINE>final String host = invocation.getAttachment(DubboConstants.META_HOST);<NEW_LINE>if (host != null) {<NEW_LINE>recorder.recordAcceptorHost(host);<NEW_LINE>} else {<NEW_LINE>// old version fallback<NEW_LINE>final String estimatedLocalHost = getLocalHost(rpcContext);<NEW_LINE>if (estimatedLocalHost != null) {<NEW_LINE>recorder.recordAcceptorHost(estimatedLocalHost);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// clear attachments<NEW_LINE>this.clearAttachments(rpcContext);<NEW_LINE>} | final Invoker invoker = (Invoker) target; |
1,404,120 | public GlmEvaluationBatchOp linkFrom(BatchOperator<?>... inputs) {<NEW_LINE>checkOpSize(2, inputs);<NEW_LINE>BatchOperator<?> model = inputs[0];<NEW_LINE>BatchOperator<?> in = inputs[1];<NEW_LINE>String[] featureColNames = getFeatureCols();<NEW_LINE>String labelColName = getLabelCol();<NEW_LINE>String weightColName = getWeightCol();<NEW_LINE>String offsetColName = getOffsetCol();<NEW_LINE>Family familyName = getFamily();<NEW_LINE>Link linkName = getLink();<NEW_LINE>double variancePower = getVariancePower();<NEW_LINE>double linkPower = getLinkPower();<NEW_LINE>int numIter = getMaxIter();<NEW_LINE>double epsilon = getEpsilon();<NEW_LINE>boolean fitIntercept = getFitIntercept();<NEW_LINE>double regParam = getRegParam();<NEW_LINE>FamilyLink familyLink = new FamilyLink(familyName, variancePower, linkName, linkPower);<NEW_LINE>int numFeature = featureColNames.length;<NEW_LINE>DataSet<Row> data = GlmUtil.preProc(in, featureColNames, offsetColName, weightColName, labelColName);<NEW_LINE>DataSet<GlmUtil.WeightedLeastSquaresModel> wlsModel = model.getDataSet().mapPartition(new GlmUtil.GlmModelToWlsModel());<NEW_LINE>DataSet<Row> residual = GlmUtil.residual(wlsModel, data, numFeature, familyLink);<NEW_LINE>DataSet<GlmModelSummary> aggSummay = GlmUtil.aggSummary(residual, wlsModel, numFeature, familyLink, regParam, numIter, epsilon, fitIntercept);<NEW_LINE>// residual<NEW_LINE>String[] residualColNames = new String[numFeature + 4 + 4];<NEW_LINE>TypeInformation[] residualColTypes = new TypeInformation[numFeature + 4 + 4];<NEW_LINE>for (int i = 0; i < numFeature; i++) {<NEW_LINE>residualColNames[i] = featureColNames[i];<NEW_LINE>residualColTypes[i] = Types.DOUBLE;<NEW_LINE>}<NEW_LINE>residualColNames[numFeature] = "label";<NEW_LINE>residualColTypes[numFeature] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 1] = "weight";<NEW_LINE>residualColTypes[numFeature + 1] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 2] = "offset";<NEW_LINE>residualColTypes[numFeature + 2] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 3] = "pred";<NEW_LINE>residualColTypes[numFeature + 3] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 4] = "residualdevianceResiduals";<NEW_LINE>residualColTypes[numFeature + 4] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 5] = "pearsonResiduals";<NEW_LINE>residualColTypes[numFeature + 5] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 6] = "workingResiduals";<NEW_LINE>residualColTypes[numFeature + 6] = Types.DOUBLE;<NEW_LINE>residualColNames[numFeature + 7] = "responseResiduals";<NEW_LINE>residualColTypes[numFeature + 7] = Types.DOUBLE;<NEW_LINE>this.setSideOutputTables(new Table[] { DataSetConversionUtil.toTable(getMLEnvironmentId(), residual, residualColNames, residualColTypes) });<NEW_LINE>// summary<NEW_LINE>String[<MASK><NEW_LINE>TypeInformation[] summaryColTypes = new TypeInformation[1];<NEW_LINE>summaryColNames[0] = "summary";<NEW_LINE>summaryColTypes[0] = Types.STRING;<NEW_LINE>this.setOutput(aggSummay.map(new MapFunction<GlmModelSummary, Row>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Row map(GlmModelSummary value) throws Exception {<NEW_LINE>return Row.of(JsonConverter.toJson(value));<NEW_LINE>}<NEW_LINE>}), summaryColNames, summaryColTypes);<NEW_LINE>return this;<NEW_LINE>} | ] summaryColNames = new String[1]; |
215,859 | public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>Linklist list = new Linklist();<NEW_LINE>boolean flag = true;<NEW_LINE>int valu;<NEW_LINE>int posi = 0;<NEW_LINE>while (flag) {<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("1. Add item to the list at start");<NEW_LINE><MASK><NEW_LINE>System.out.println("3. Add item to the list at position");<NEW_LINE>System.out.println("4. Delete First node");<NEW_LINE>System.out.println("5. Delete last node");<NEW_LINE>System.out.println("6. Delete node at position");<NEW_LINE>System.out.println("7. Update node at position");<NEW_LINE>System.out.println("8. Reverse link list");<NEW_LINE>System.out.println("9. View List");<NEW_LINE>System.out.println("10. Get List Size");<NEW_LINE>System.out.println("11. Exit");<NEW_LINE>System.out.println("Enter Choice");<NEW_LINE>int choice = sc.nextInt();<NEW_LINE>switch(choice) {<NEW_LINE>case 1:<NEW_LINE>System.out.println("Enter value");<NEW_LINE>valu = sc.nextInt();<NEW_LINE>list.insertAtFirst(valu);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>System.out.println("Enter value");<NEW_LINE>valu = sc.nextInt();<NEW_LINE>list.insertAtLast(valu);<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>System.out.println("Enter value");<NEW_LINE>valu = sc.nextInt();<NEW_LINE>System.out.println("Enter position");<NEW_LINE>posi = sc.nextInt();<NEW_LINE>list.insertAtPos(valu, posi);<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>list.deleteFirst();<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>list.deleteLast();<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE>System.out.println("Enter position");<NEW_LINE>posi = sc.nextInt();<NEW_LINE>list.deleteAtPos(posi);<NEW_LINE>break;<NEW_LINE>case 7:<NEW_LINE>System.out.println("Enter value");<NEW_LINE>valu = sc.nextInt();<NEW_LINE>System.out.println("Enter position");<NEW_LINE>posi = sc.nextInt();<NEW_LINE>list.updateData(valu, posi);<NEW_LINE>break;<NEW_LINE>case 8:<NEW_LINE>list.reverseList();<NEW_LINE>break;<NEW_LINE>case 9:<NEW_LINE>list.viewList();<NEW_LINE>break;<NEW_LINE>case 10:<NEW_LINE>System.out.println(list.getListSize());<NEW_LINE>break;<NEW_LINE>case 11:<NEW_LINE>flag = false;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>System.out.println("invalid choice");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | System.out.println("2. Add item to the list at last"); |
1,283,387 | protected mxRectangle revalidateState(mxCellState parentState, mxCellState state, double dx, double dy) {<NEW_LINE>mxRectangle dirty = null;<NEW_LINE>if (state != null) {<NEW_LINE>mxGraph graph = graphComponent.getGraph();<NEW_LINE>mxIGraphModel model = graph.getModel();<NEW_LINE>Object cell = state.getCell();<NEW_LINE>// Updates the edge terminal points and restores the<NEW_LINE>// (relative) positions of any (relative) children<NEW_LINE>state.setInvalid(true);<NEW_LINE>dirty = graph.getView().validatePoints(parentState, cell);<NEW_LINE>// Moves selection vertices which are relative<NEW_LINE>mxGeometry geo = graph.getCellGeometry(cell);<NEW_LINE>if ((dx != 0 || dy != 0) && geo != null && geo.isRelative() && model.isVertex(cell) && (parentState == null || model.isVertex(parentState.getCell()) || deltas.get(state) != null)) {<NEW_LINE>state.setX(state.getX() + dx);<NEW_LINE>state.setY(state.getY() + dy);<NEW_LINE>// TODO: Check this change<NEW_LINE>dirty.setX(dirty.getX() + dx);<NEW_LINE>dirty.setY(dirty.getY() + dy);<NEW_LINE>graph.<MASK><NEW_LINE>}<NEW_LINE>int childCount = model.getChildCount(cell);<NEW_LINE>for (int i = 0; i < childCount; i++) {<NEW_LINE>mxRectangle tmp = revalidateState(state, graph.getView().getState(model.getChildAt(cell, i)), dx, dy);<NEW_LINE>if (dirty != null) {<NEW_LINE>dirty.add(tmp);<NEW_LINE>} else {<NEW_LINE>dirty = tmp;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dirty;<NEW_LINE>} | getView().updateLabelBounds(state); |
1,611,088 | private float drawThirdVerticalLineWithWidth(int leftX, int leftY, int w, int h, int steph) {<NEW_LINE>float levelMaxLineWidth = 0;<NEW_LINE>for (int i = 0; i < node4CalcPos.childrenIdx.length; i++) {<NEW_LINE>TreeModelViz.Node4CalcPos tmp = all[node4CalcPos.childrenIdx[i]];<NEW_LINE>int x2 = tmp.gNode.posCenter - leftX;<NEW_LINE>int y2 = tmp.gNode.posTop - leftY;<NEW_LINE>int x1 = x2;<NEW_LINE>int y1 = steph;<NEW_LINE>double linepercent = all[node4CalcPos.childrenIdx[i]].node.getCounter().getWeightSum() / node4CalcPos.node<MASK><NEW_LINE>if (linepercent > 1.0) {<NEW_LINE>linepercent = 0.0;<NEW_LINE>}<NEW_LINE>// if node is not root , multiply node<NEW_LINE>if (node4CalcPos.parentIdx >= 0) {<NEW_LINE>linepercent *= node4CalcPos.gNode.linepercent;<NEW_LINE>}<NEW_LINE>tmp.gNode.linepercent = linepercent;<NEW_LINE>float linewidth = (float) linepercent * this.nd.getEdgeMaxWidth();<NEW_LINE>if (levelMaxLineWidth < linewidth) {<NEW_LINE>levelMaxLineWidth = linewidth;<NEW_LINE>}<NEW_LINE>int secordlinewidth = linewidth < 1.0 ? 1 : (int) linewidth;<NEW_LINE>String showLabel;<NEW_LINE>if (node4CalcPos.node.getCategoricalSplit() == null) {<NEW_LINE>if (i == 0) {<NEW_LINE>showLabel = String.format("%s %s", "<=", String.valueOf(node4CalcPos.node.getContinuousSplit()));<NEW_LINE>} else {<NEW_LINE>showLabel = String.format("%s %s", ">", String.valueOf(node4CalcPos.node.getContinuousSplit()));<NEW_LINE>;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>StringBuilder sbd = new StringBuilder();<NEW_LINE>int inSize = 0;<NEW_LINE>for (int j = 0; j < node4CalcPos.node.getCategoricalSplit().length; ++j) {<NEW_LINE>if (node4CalcPos.node.getCategoricalSplit()[j] == i) {<NEW_LINE>if (inSize > 0) {<NEW_LINE>sbd.append(",");<NEW_LINE>}<NEW_LINE>sbd.append(stringIndexerModelData.getToken(model.meta.get(HasFeatureCols.FEATURE_COLS)[node4CalcPos.node.getFeatureIndex()], Long.valueOf(j)));<NEW_LINE>inSize++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>showLabel = String.format("%s %s", "IN", sbd.toString());<NEW_LINE>}<NEW_LINE>this.drawOneVericalLine(x1, y1, w, h, secordlinewidth, showLabel);<NEW_LINE>}<NEW_LINE>return levelMaxLineWidth;<NEW_LINE>} | .getCounter().getWeightSum(); |
1,108,260 | public void permissionTicketUpdated(String id, String owner, String requester, String resource, String resourceName, String scope, String serverId, Set<String> invalidations) {<NEW_LINE>invalidations.add(id);<NEW_LINE>invalidations.add(StoreFactoryCacheSession.getPermissionTicketByOwner(owner, serverId));<NEW_LINE>invalidations.add(StoreFactoryCacheSession<MASK><NEW_LINE>invalidations.add(StoreFactoryCacheSession.getPermissionTicketByGranted(requester, serverId));<NEW_LINE>invalidations.add(StoreFactoryCacheSession.getPermissionTicketByGranted(requester, null));<NEW_LINE>invalidations.add(StoreFactoryCacheSession.getPermissionTicketByResourceNameAndGranted(resourceName, requester, serverId));<NEW_LINE>invalidations.add(StoreFactoryCacheSession.getPermissionTicketByResourceNameAndGranted(resourceName, requester, null));<NEW_LINE>if (scope != null) {<NEW_LINE>invalidations.add(StoreFactoryCacheSession.getPermissionTicketByScope(scope, serverId));<NEW_LINE>}<NEW_LINE>} | .getPermissionTicketByResource(resource, serverId)); |
1,723,629 | private <T> BindingImpl<T> createImplementedByBinding(Key<T> key, Scoping scoping, ImplementedBy implementedBy, Errors errors) throws ErrorsException {<NEW_LINE>Class<?> rawType = key.getTypeLiteral().getRawType();<NEW_LINE>Class<?> implementationType = implementedBy.value();<NEW_LINE>// Make sure it's not the same type. TODO: Can we check for deeper cycles?<NEW_LINE>if (implementationType == rawType) {<NEW_LINE>throw errors.recursiveImplementationType().toException();<NEW_LINE>}<NEW_LINE>// Make sure implementationType extends type.<NEW_LINE>if (!rawType.isAssignableFrom(implementationType)) {<NEW_LINE>throw errors.notASubtype(implementationType, rawType).toException();<NEW_LINE>}<NEW_LINE>// After the preceding check, this cast is safe.<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Class<? extends T> subclass = (<MASK><NEW_LINE>// Look up the target binding.<NEW_LINE>final Key<? extends T> targetKey = Key.get(subclass);<NEW_LINE>final BindingImpl<? extends T> targetBinding = getBindingOrThrow(targetKey, errors, JitLimitation.NEW_OR_EXISTING_JIT);<NEW_LINE>InternalFactory<T> internalFactory = new InternalFactory<T>() {<NEW_LINE><NEW_LINE>public T get(Errors errors, InternalContext context, Dependency<?> dependency, boolean linked) throws ErrorsException {<NEW_LINE>context.pushState(targetKey, targetBinding.getSource());<NEW_LINE>try {<NEW_LINE>return targetBinding.getInternalFactory().get(errors.withSource(targetKey), context, dependency, true);<NEW_LINE>} finally {<NEW_LINE>context.popState();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Object source = rawType;<NEW_LINE>return new LinkedBindingImpl<T>(this, key, source, Scoping.<T>scope(key, this, internalFactory, source, scoping), scoping, targetKey);<NEW_LINE>} | Class<? extends T>) implementationType; |
1,137,988 | public List<Future<?>> insert(String agentId, long captureTime) throws Exception {<NEW_LINE>AgentConfig agentConfig = agentConfigDao.read(agentId);<NEW_LINE>if (agentConfig == null) {<NEW_LINE>// have yet to receive collectInit()<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>List<RollupConfig> rollupConfigs = configRepository.getRollupConfigs();<NEW_LINE>List<Integer> rollupExpirationHours = configRepository.getCentralStorageConfig().rollupExpirationHours();<NEW_LINE>int index = agentId.indexOf("::");<NEW_LINE>String topLevelId;<NEW_LINE>String childAgentId;<NEW_LINE>if (index == -1) {<NEW_LINE>topLevelId = agentId;<NEW_LINE>childAgentId = null;<NEW_LINE>} else {<NEW_LINE>topLevelId = agentId.substring(0, index + 2);<NEW_LINE>childAgentId = agentId.substring(index + 2);<NEW_LINE>}<NEW_LINE>List<Future<?>> futures = new ArrayList<>();<NEW_LINE>for (int rollupLevel = 0; rollupLevel < rollupConfigs.size(); rollupLevel++) {<NEW_LINE>long rollupIntervalMillis = getRollupIntervalMillis(rollupConfigs, rollupLevel);<NEW_LINE>long rollupCaptureTime = CaptureTimes.getRollup(captureTime, rollupIntervalMillis);<NEW_LINE>int ttl = Ints.saturatedCast(HOURS.toSeconds(rollupExpirationHours.get(rollupLevel)));<NEW_LINE>int adjustedTTL = Common.getAdjustedTTL(ttl, rollupCaptureTime, clock);<NEW_LINE>BoundStatement boundStatement = insertTopLevelPS.get(rollupLevel).bind();<NEW_LINE>int i = 0;<NEW_LINE>boundStatement.setTimestamp(i++, new Date(rollupCaptureTime));<NEW_LINE>boundStatement.setString(i++, topLevelId);<NEW_LINE>boundStatement<MASK><NEW_LINE>futures.add(session.writeAsync(boundStatement));<NEW_LINE>if (childAgentId != null) {<NEW_LINE>boundStatement = insertChildPS.get(rollupLevel).bind();<NEW_LINE>i = 0;<NEW_LINE>boundStatement.setString(i++, topLevelId);<NEW_LINE>boundStatement.setTimestamp(i++, new Date(rollupCaptureTime));<NEW_LINE>boundStatement.setString(i++, childAgentId);<NEW_LINE>boundStatement.setInt(i++, adjustedTTL);<NEW_LINE>futures.add(session.writeAsync(boundStatement));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return futures;<NEW_LINE>} | .setInt(i++, adjustedTTL); |
173,238 | public byte[] serialize() {<NEW_LINE>byte[] data = createHeaderDataArray();<NEW_LINE>ByteBuffer bb = ByteBuffer.wrap(data);<NEW_LINE>int version = (this.version << AbstractGTP.GTP_VERSION_SHIFT);<NEW_LINE>byte flags = (byte) (version + (this.protocolType ? 16 : 0) + (this.reserved ? 8 : 0) + (this.extHeaderFlag ? 4 : 0) + (this.sequenceNumberFlag ? 2 : 0) + (this.nPDUNumberFlag ? 1 : 0));<NEW_LINE>bb.put(flags);<NEW_LINE>bb.put(this.messageType);<NEW_LINE>bb.putShort(this.totalLength);<NEW_LINE>bb.putInt(this.teid);<NEW_LINE>if (this.extHeaderFlag || this.sequenceNumberFlag || this.nPDUNumberFlag) {<NEW_LINE>// Extra fields are present<NEW_LINE>// They should be read, but interpreted only if<NEW_LINE>// Specific flags are set<NEW_LINE>bb.put(this.sequenceNumber);<NEW_LINE>bb.put(this.nPDUNumber);<NEW_LINE>bb.put(this.nextExtHeader);<NEW_LINE>for (GTPV1ExtHeader extHeader : extHeaders) {<NEW_LINE>bb.put(extHeader.serialize());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// According to section 7.7.11 in 3GPP TS 29.060 V13.1.0 (2015-06)<NEW_LINE>if (this.messageType == ECHO_RESPONSE_TYPE) {<NEW_LINE>// Mandatory fields for Echo Response messages according to Section 7.2.2<NEW_LINE>// from 3GPP TS 29.060 V13.1.0 (2015-06)<NEW_LINE><MASK><NEW_LINE>bb.put(this.recoveryRestartCounter);<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>} | bb.put(this.recoveryType); |
1,358,281 | public static void main(String[] args) throws Exception {<NEW_LINE>final ConfigBuilder configBuilder = new ConfigBuilder();<NEW_LINE>configBuilder.withWatchReconnectInterval(500);<NEW_LINE>configBuilder.withWatchReconnectLimit(5);<NEW_LINE>try (KubernetesClient client = new KubernetesClientBuilder().withConfig(configBuilder.build()).build()) {<NEW_LINE>String namespace = "default";<NEW_LINE>CustomResourceDefinition prometheousRuleCrd = client.apiextensions().v1beta1().customResourceDefinitions().load(GenericKubernetesResourceExample.class.getResourceAsStream("/prometheous-rule-crd.yml")).get();<NEW_LINE>client.apiextensions().v1beta1().customResourceDefinitions().createOrReplace(prometheousRuleCrd);<NEW_LINE>logger.info("Successfully created Prometheous custom resource definition");<NEW_LINE>// Creating Custom Resources Now:<NEW_LINE>ResourceDefinitionContext <MASK><NEW_LINE>client.load(GenericKubernetesResourceExample.class.getResourceAsStream("/prometheous-rule-cr.yml")).inNamespace(namespace).createOrReplace();<NEW_LINE>logger.info("Created Custom Resource successfully too");<NEW_LINE>// Listing all custom resources in given namespace:<NEW_LINE>NonNamespaceOperation<GenericKubernetesResource, GenericKubernetesResourceList, Resource<GenericKubernetesResource>> resourcesInNamespace = client.genericKubernetesResources(crdContext).inNamespace(namespace);<NEW_LINE>GenericKubernetesResourceList list = resourcesInNamespace.list();<NEW_LINE>List<GenericKubernetesResource> items = list.getItems();<NEW_LINE>logger.info("Custom Resources :- ");<NEW_LINE>for (GenericKubernetesResource customResource : items) {<NEW_LINE>ObjectMeta metadata = customResource.getMetadata();<NEW_LINE>final String name = metadata.getName();<NEW_LINE>logger.info(name);<NEW_LINE>}<NEW_LINE>// Watching custom resources now<NEW_LINE>logger.info("Watching custom resources now");<NEW_LINE>final CountDownLatch closeLatch = new CountDownLatch(1);<NEW_LINE>resourcesInNamespace.watch(new Watcher<GenericKubernetesResource>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void eventReceived(Action action, GenericKubernetesResource resource) {<NEW_LINE>logger.info("{}: {}", action, resource);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClose(WatcherException e) {<NEW_LINE>logger.debug("Watcher onClose");<NEW_LINE>closeLatch.countDown();<NEW_LINE>if (e != null) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>closeLatch.await(10, TimeUnit.MINUTES);<NEW_LINE>// Cleanup<NEW_LINE>logger.info("Deleting custom resources...");<NEW_LINE>resourcesInNamespace.withName("prometheus-example-rules").delete();<NEW_LINE>client.apiextensions().v1beta1().customResourceDefinitions().withName(prometheousRuleCrd.getMetadata().getName()).delete();<NEW_LINE>} catch (KubernetesClientException e) {<NEW_LINE>logger.error("Could not create resource: {}", e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | crdContext = CustomResourceDefinitionContext.fromCrd(prometheousRuleCrd); |
1,822,303 | public okhttp3.Call connectPutNodeProxyCall(String name, String path, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/nodes/{name}/proxy".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (path != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path));<NEW_LINE>}<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 = { "*/*" };<NEW_LINE>final String <MASK><NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); |
139,996 | static Map<Contig, List<TransitPairCount>> collectTransitPairCounts(final List<ContigImpl> contigs, final List<Path> readPaths) {<NEW_LINE>final Map<Contig, List<TransitPairCount>> contigTransitsMap = new HashMap<>(3 * contigs.size());<NEW_LINE>for (final Path path : readPaths) {<NEW_LINE>final List<PathPart> parts = path.getParts();<NEW_LINE>final int lastPart <MASK><NEW_LINE>for (int partIdx = 1; partIdx < lastPart; ++partIdx) {<NEW_LINE>final Contig prevContig = parts.get(partIdx - 1).getContig();<NEW_LINE>if (prevContig == null)<NEW_LINE>continue;<NEW_LINE>final Contig curContig = parts.get(partIdx).getContig();<NEW_LINE>if (curContig == null) {<NEW_LINE>partIdx += 1;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final Contig nextContig = parts.get(partIdx + 1).getContig();<NEW_LINE>if (nextContig == null) {<NEW_LINE>partIdx += 2;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final TransitPairCount tpc = new TransitPairCount(prevContig, nextContig);<NEW_LINE>final List<TransitPairCount> tpcList = contigTransitsMap.computeIfAbsent(curContig, tig -> new ArrayList<>(4));<NEW_LINE>final int idx = tpcList.indexOf(tpc);<NEW_LINE>if (idx != -1) {<NEW_LINE>tpcList.get(idx).observe();<NEW_LINE>} else {<NEW_LINE>tpcList.add(tpc);<NEW_LINE>contigTransitsMap.computeIfAbsent(curContig.rc(), tig -> new ArrayList<>(4)).add(tpc.getRC());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return contigTransitsMap;<NEW_LINE>} | = parts.size() - 1; |
1,340,914 | public static Scriptable jsConstructor(final Context cx, final Object[] args, final Function ctorObj, final boolean inNewExpr) {<NEW_LINE>final PointerEvent event = new PointerEvent();<NEW_LINE>if (args.length != 0) {<NEW_LINE>event.setType(Context.<MASK><NEW_LINE>event.setBubbles(false);<NEW_LINE>event.setCancelable(false);<NEW_LINE>event.width_ = 1;<NEW_LINE>event.height_ = 1;<NEW_LINE>}<NEW_LINE>if (args.length > 1) {<NEW_LINE>final NativeObject object = (NativeObject) args[1];<NEW_LINE>event.setBubbles((boolean) getValue(object, "bubbles", event.isBubbles()));<NEW_LINE>event.pointerId_ = (int) getValue(object, "pointerId", event.pointerId_);<NEW_LINE>event.width_ = (int) getValue(object, "width", event.width_);<NEW_LINE>event.height_ = (int) getValue(object, "height", event.height_);<NEW_LINE>event.pressure_ = (double) getValue(object, "pressure", event.pressure_);<NEW_LINE>event.tiltX_ = (int) getValue(object, "tiltX", event.tiltX_);<NEW_LINE>event.tiltY_ = (int) getValue(object, "tiltY", event.tiltY_);<NEW_LINE>event.pointerType_ = (String) getValue(object, "pointerType", event.pointerType_);<NEW_LINE>event.isPrimary_ = (boolean) getValue(object, "isPrimary", event.isPrimary_);<NEW_LINE>}<NEW_LINE>return event;<NEW_LINE>} | toString(args[0])); |
169,930 | public static ListChangeSetsResponse unmarshall(ListChangeSetsResponse listChangeSetsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listChangeSetsResponse.setRequestId(_ctx.stringValue("ListChangeSetsResponse.RequestId"));<NEW_LINE>listChangeSetsResponse.setPageNumber<MASK><NEW_LINE>listChangeSetsResponse.setPageSize(_ctx.integerValue("ListChangeSetsResponse.PageSize"));<NEW_LINE>listChangeSetsResponse.setTotalCount(_ctx.integerValue("ListChangeSetsResponse.TotalCount"));<NEW_LINE>List<ChangeSet> changeSets = new ArrayList<ChangeSet>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListChangeSetsResponse.ChangeSets.Length"); i++) {<NEW_LINE>ChangeSet changeSet = new ChangeSet();<NEW_LINE>changeSet.setChangeSetId(_ctx.stringValue("ListChangeSetsResponse.ChangeSets[" + i + "].ChangeSetId"));<NEW_LINE>changeSet.setChangeSetName(_ctx.stringValue("ListChangeSetsResponse.ChangeSets[" + i + "].ChangeSetName"));<NEW_LINE>changeSet.setChangeSetType(_ctx.stringValue("ListChangeSetsResponse.ChangeSets[" + i + "].ChangeSetType"));<NEW_LINE>changeSet.setCreateTime(_ctx.stringValue("ListChangeSetsResponse.ChangeSets[" + i + "].CreateTime"));<NEW_LINE>changeSet.setDescription(_ctx.stringValue("ListChangeSetsResponse.ChangeSets[" + i + "].Description"));<NEW_LINE>changeSet.setExecutionStatus(_ctx.stringValue("ListChangeSetsResponse.ChangeSets[" + i + "].ExecutionStatus"));<NEW_LINE>changeSet.setRegionId(_ctx.stringValue("ListChangeSetsResponse.ChangeSets[" + i + "].RegionId"));<NEW_LINE>changeSet.setStackId(_ctx.stringValue("ListChangeSetsResponse.ChangeSets[" + i + "].StackId"));<NEW_LINE>changeSet.setStackName(_ctx.stringValue("ListChangeSetsResponse.ChangeSets[" + i + "].StackName"));<NEW_LINE>changeSet.setStatus(_ctx.stringValue("ListChangeSetsResponse.ChangeSets[" + i + "].Status"));<NEW_LINE>changeSet.setStatusReason(_ctx.stringValue("ListChangeSetsResponse.ChangeSets[" + i + "].StatusReason"));<NEW_LINE>changeSets.add(changeSet);<NEW_LINE>}<NEW_LINE>listChangeSetsResponse.setChangeSets(changeSets);<NEW_LINE>return listChangeSetsResponse;<NEW_LINE>} | (_ctx.integerValue("ListChangeSetsResponse.PageNumber")); |
1,158,122 | protected JFreeChart createTimeSeriesChart() throws JRException {<NEW_LINE>String timeAxisLabel = evaluateTextExpression(((JRTimeSeriesPlot) getPlot()).getTimeAxisLabelExpression());<NEW_LINE>String valueAxisLabel = evaluateTextExpression(((JRTimeSeriesPlot) getPlot()).getValueAxisLabelExpression());<NEW_LINE>ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());<NEW_LINE>JFreeChart jfreeChart = ChartFactory.createTimeSeriesChart(evaluateTextExpression(getChart().getTitleExpression()), timeAxisLabel, valueAxisLabel, (TimeSeriesCollection) getDataset(), isShowLegend(), true, false);<NEW_LINE><MASK><NEW_LINE>XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();<NEW_LINE>JRTimeSeriesPlot timeSeriesPlot = (JRTimeSeriesPlot) getPlot();<NEW_LINE>XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer) xyPlot.getRenderer();<NEW_LINE>boolean isShowShapes = timeSeriesPlot.getShowShapes() == null ? true : timeSeriesPlot.getShowShapes();<NEW_LINE>boolean isShowLines = timeSeriesPlot.getShowLines() == null ? true : timeSeriesPlot.getShowLines();<NEW_LINE>lineRenderer.setBaseLinesVisible(isShowLines);<NEW_LINE>lineRenderer.setBaseShapesVisible(isShowShapes);<NEW_LINE>// Handle the axis formating for the category axis<NEW_LINE>configureAxis(xyPlot.getDomainAxis(), timeSeriesPlot.getTimeAxisLabelFont(), timeSeriesPlot.getTimeAxisLabelColor(), timeSeriesPlot.getTimeAxisTickLabelFont(), timeSeriesPlot.getTimeAxisTickLabelColor(), timeSeriesPlot.getTimeAxisTickLabelMask(), timeSeriesPlot.getTimeAxisVerticalTickLabels(), timeSeriesPlot.getOwnTimeAxisLineColor(), getDomainAxisSettings(), DateTickUnitType.DAY, (Comparable<?>) evaluateExpression(timeSeriesPlot.getDomainAxisMinValueExpression()), (Comparable<?>) evaluateExpression(timeSeriesPlot.getDomainAxisMaxValueExpression()));<NEW_LINE>// Handle the axis formating for the value axis<NEW_LINE>configureAxis(xyPlot.getRangeAxis(), timeSeriesPlot.getValueAxisLabelFont(), timeSeriesPlot.getValueAxisLabelColor(), timeSeriesPlot.getValueAxisTickLabelFont(), timeSeriesPlot.getValueAxisTickLabelColor(), timeSeriesPlot.getValueAxisTickLabelMask(), timeSeriesPlot.getValueAxisVerticalTickLabels(), timeSeriesPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(), DateTickUnitType.DAY, (Comparable<?>) evaluateExpression(timeSeriesPlot.getRangeAxisMinValueExpression()), (Comparable<?>) evaluateExpression(timeSeriesPlot.getRangeAxisMaxValueExpression()));<NEW_LINE>return jfreeChart;<NEW_LINE>} | configureChart(jfreeChart, getPlot()); |
215,259 | private HttpTokens.Token next(ByteBuffer buffer) {<NEW_LINE><MASK><NEW_LINE>HttpTokens.Token t = HttpTokens.TOKENS[0xff & ch];<NEW_LINE>switch(t.getType()) {<NEW_LINE>case CNTL:<NEW_LINE>throw new IllegalCharacterException(_state, t, buffer);<NEW_LINE>case LF:<NEW_LINE>_cr = false;<NEW_LINE>break;<NEW_LINE>case CR:<NEW_LINE>if (_cr)<NEW_LINE>throw new BadMessageException("Bad EOL");<NEW_LINE>_cr = true;<NEW_LINE>if (buffer.hasRemaining()) {<NEW_LINE>// Don't count the CRs and LFs of the chunked encoding.<NEW_LINE>if (_maxHeaderBytes > 0 && (_state == State.HEADER || _state == State.TRAILER))<NEW_LINE>_headerBytes++;<NEW_LINE>return next(buffer);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>case ALPHA:<NEW_LINE>case DIGIT:<NEW_LINE>case TCHAR:<NEW_LINE>case VCHAR:<NEW_LINE>case HTAB:<NEW_LINE>case SPACE:<NEW_LINE>case OTEXT:<NEW_LINE>case COLON:<NEW_LINE>if (_cr)<NEW_LINE>throw new BadMessageException("Bad EOL");<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return t;<NEW_LINE>} | byte ch = buffer.get(); |
600,840 | protected void initBlockEntity() {<NEW_LINE>if (this.namedTag.contains("TransferCooldown")) {<NEW_LINE>this.transferCooldown = this.namedTag.getInt("TransferCooldown");<NEW_LINE>} else {<NEW_LINE>this.transferCooldown = 8;<NEW_LINE>}<NEW_LINE>this.inventory = new HopperInventory(this);<NEW_LINE>if (!this.namedTag.contains("Items") || !(this.namedTag.get("Items") instanceof ListTag)) {<NEW_LINE>this.namedTag.putList(new <MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < this.getSize(); i++) {<NEW_LINE>this.inventory.setItem(i, this.getItem(i));<NEW_LINE>}<NEW_LINE>this.pickupArea = new SimpleAxisAlignedBB(this.x, this.y, this.z, this.x + 1, this.y + 2, this.z + 1);<NEW_LINE>this.scheduleUpdate();<NEW_LINE>super.initBlockEntity();<NEW_LINE>} | ListTag<CompoundTag>("Items")); |
628,827 | public static IFile readProjectRootFile(IProject project) {<NEW_LINE><MASK><NEW_LINE>if (projectPrefs != null) {<NEW_LINE>String rootFileName = projectPrefs.get(IPreferenceConstants.P_PROJECT_ROOT_FILE, IPreferenceConstants.DEFAULT_NOT_SET);<NEW_LINE>if (!IPreferenceConstants.DEFAULT_NOT_SET.equals(rootFileName)) {<NEW_LINE>final IPath path = new Path(rootFileName);<NEW_LINE>if (path.isAbsolute()) {<NEW_LINE>// Convert a legacy (absolute) path to the new relative one<NEW_LINE>// with the magic PARENT_PROJECT_LOC prefix.<NEW_LINE>rootFileName = ResourceHelper.PARENT_ONE_PROJECT_LOC + path.lastSegment();<NEW_LINE>convertAbsoluteToRelative(projectPrefs, rootFileName);<NEW_LINE>}<NEW_LINE>return ResourceHelper.getLinkedFile(project, rootFileName);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Activator.getDefault().logInfo("projectPrefs is null");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | final IEclipsePreferences projectPrefs = getProjectPreferences(project); |
811,917 | private <T> List<T> retrieveAnyModelForHU(@NonNull final I_M_HU hu, @NonNull final Class<T> clazz) {<NEW_LINE>final IQueryBL queryBL = <MASK><NEW_LINE>final ICompositeQueryFilter<I_M_HU_Assignment> filter = queryBL.createCompositeQueryFilter(I_M_HU_Assignment.class).setJoinOr().addEqualsFilter(I_M_HU_Assignment.COLUMNNAME_M_HU_ID, hu.getM_HU_ID()).addEqualsFilter(I_M_HU_Assignment.COLUMNNAME_M_LU_HU_ID, hu.getM_HU_ID()).addEqualsFilter(I_M_HU_Assignment.COLUMNNAME_M_TU_HU_ID, hu.getM_HU_ID()).addEqualsFilter(I_M_HU_Assignment.COLUMNNAME_VHU_ID, hu.getM_HU_ID());<NEW_LINE>final List<T> result = queryBL.createQueryBuilder(I_M_HU_Assignment.class).addOnlyActiveRecordsFilter().addEqualsFilter(I_M_HU_Assignment.COLUMNNAME_AD_Table_ID, InterfaceWrapperHelper.getTableId(clazz)).filter(filter).create().stream().map(huAssignment -> TableRecordReference.ofReferenced(huAssignment)).sorted(Comparator.comparing(TableRecordReference::getRecord_ID)).distinct().map(ref -> ref.getModel(this, clazz)).collect(Collectors.toList());<NEW_LINE>return result;<NEW_LINE>} | Services.get(IQueryBL.class); |
854,394 | public static <T extends IServerConduit> boolean connectConduits(@Nonnull T con, @Nonnull EnumFacing faceHit) {<NEW_LINE>BlockPos pos = con.getBundle().getLocation().offset(faceHit);<NEW_LINE>IConduit neighbour = ConduitUtil.getConduit(con.getBundle().getEntity().getWorld(), pos, con.getBaseConduitType());<NEW_LINE>if (neighbour instanceof IServerConduit && con.canConnectToConduit(faceHit, neighbour) && ((IServerConduit) neighbour).canConnectToConduit(faceHit.getOpposite(), con)) {<NEW_LINE>con.conduitConnectionAdded(faceHit);<NEW_LINE>((IServerConduit) neighbour).conduitConnectionAdded(faceHit.getOpposite());<NEW_LINE>final IConduitNetwork<?, ?> network = con.getNetwork();<NEW_LINE>if (network != null) {<NEW_LINE>network.destroyNetwork();<NEW_LINE>}<NEW_LINE>final IConduitNetwork<?, ?> neighbourNetwork = ((<MASK><NEW_LINE>if (neighbourNetwork != null) {<NEW_LINE>neighbourNetwork.destroyNetwork();<NEW_LINE>}<NEW_LINE>con.connectionsChanged();<NEW_LINE>((IServerConduit) neighbour).connectionsChanged();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | IServerConduit) neighbour).getNetwork(); |
419,891 | private boolean checkEncryptionAlgorithms(WSSecurityEngineResult result, AlgorithmSuite algorithmPolicy, AssertionInfo ai) {<NEW_LINE>AlgorithmSuiteType algorithmSuiteType = algorithmPolicy.getAlgorithmSuiteType();<NEW_LINE>String transportMethod = (String) result.get(WSSecurityEngineResult.TAG_ENCRYPTED_KEY_TRANSPORT_METHOD);<NEW_LINE>if (transportMethod != null && !algorithmSuiteType.getSymmetricKeyWrap().equals(transportMethod) && !algorithmSuiteType.getAsymmetricKeyWrap().equals(transportMethod)) {<NEW_LINE>ai.setNotAsserted("The Key transport method does not match the requirement");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<WSDataRef> dataRefs = CastUtils.cast((List<?>) result.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));<NEW_LINE>if (dataRefs != null) {<NEW_LINE>for (WSDataRef dataRef : dataRefs) {<NEW_LINE>String encryptionAlgorithm = dataRef.getAlgorithm();<NEW_LINE>if (!algorithmSuiteType.getEncryption().equals(encryptionAlgorithm)) {<NEW_LINE>ai.setNotAsserted("The encryption algorithm does not match the requirement");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return checkKeyLengths(<MASK><NEW_LINE>} | result, algorithmPolicy, ai, false); |
1,837,646 | private void parseLaunchConfigurations() throws IOException, ProjectImporterException {<NEW_LINE>List<LaunchConfiguration> configs = new ArrayList<LaunchConfiguration>();<NEW_LINE>File[] launches = new File(workspace.getDirectory(), ".metadata/.plugins/org.eclipse.debug.core/.launches").listFiles(new // NOI18N<NEW_LINE>FilenameFilter() {<NEW_LINE><NEW_LINE>public boolean accept(File dir, String name) {<NEW_LINE>// NOI18N<NEW_LINE>return name.endsWith(".launch");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (launches != null) {<NEW_LINE>for (File launch : launches) {<NEW_LINE>Document doc;<NEW_LINE>try {<NEW_LINE>doc = XMLUtil.parse(new InputSource(Utilities.toURI(launch).toString()), false, false, null, null);<NEW_LINE>} catch (SAXException x) {<NEW_LINE>throw new ProjectImporterException("Could not parse " + launch, x);<NEW_LINE>}<NEW_LINE>Element launchConfiguration = doc.getDocumentElement();<NEW_LINE>// NOI18N<NEW_LINE>String type = launchConfiguration.getAttribute("type");<NEW_LINE>Map<String, String> attrs = new HashMap<String, String>();<NEW_LINE>// NOI18N<NEW_LINE>NodeList <MASK><NEW_LINE>for (int i = 0; i < nl.getLength(); i++) {<NEW_LINE>Element stringAttribute = (Element) nl.item(i);<NEW_LINE>// NOI18N<NEW_LINE>attrs.put(stringAttribute.getAttribute("key"), stringAttribute.getAttribute("value"));<NEW_LINE>}<NEW_LINE>configs.add(new // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>LaunchConfiguration(// NOI18N<NEW_LINE>launch.getName().replaceFirst("\\.launch$", ""), // NOI18N<NEW_LINE>type, // NOI18N<NEW_LINE>attrs.get("org.eclipse.jdt.launching.PROJECT_ATTR"), // NOI18N<NEW_LINE>attrs.get("org.eclipse.jdt.launching.MAIN_TYPE"), // NOI18N<NEW_LINE>attrs.get("org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"), attrs.get("org.eclipse.jdt.launching.VM_ARGUMENTS")));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>workspace.setLaunchConfigurations(configs);<NEW_LINE>} | nl = launchConfiguration.getElementsByTagName("stringAttribute"); |
1,217,383 | public void export(List<Meter> meters) {<NEW_LINE>String customDeviceMetricEndpoint = config.uri() + "/api/v1/entity/infrastructure/custom/" + config.deviceId() + "?api-token=" + config.apiToken();<NEW_LINE>for (List<Meter> batch : new MeterPartition(meters, config.batchSize())) {<NEW_LINE>final List<DynatraceCustomMetric> series = batch.stream().flatMap(meter -> meter.match(this::writeMeter, this::writeMeter, this::writeTimer, this::writeSummary, this::writeLongTaskTimer, this::writeMeter, this::writeMeter, this::writeFunctionTimer, this::writeMeter)).collect(Collectors.toList());<NEW_LINE>// TODO is there a way to batch submissions of multiple metrics?<NEW_LINE>series.stream().map(DynatraceCustomMetric::getMetricDefinition).filter(this::isCustomMetricNotCreated<MASK><NEW_LINE>if (!createdCustomMetrics.isEmpty() && !series.isEmpty()) {<NEW_LINE>postCustomMetricValues(config.technologyType(), config.group(), series.stream().map(DynatraceCustomMetric::getTimeSeries).filter(this::isCustomMetricCreated).collect(Collectors.toList()), customDeviceMetricEndpoint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).forEach(this::putCustomMetric); |
1,117,391 | public FileAssetTemplate persist(FileAssetTemplate object) {<NEW_LINE>try {<NEW_LINE>final Folder templateFolder = createFileAsTemplateFolderIfNeeded();<NEW_LINE>String templateDefinitionFileName = "layout.json";<NEW_LINE>String templateDefinitionFileCode = layoutFile();<NEW_LINE>if (!isDesignTemplate) {<NEW_LINE>templateDefinitionFileName = "body.vtl";<NEW_LINE>templateDefinitionFileCode = bodyFile();<NEW_LINE>}<NEW_LINE>final java.io.File file = java.io.File.createTempFile(templateDefinitionFileName.split("\\.")[0], templateDefinitionFileName.split("\\.")[1]);<NEW_LINE>FileUtil.write(file, templateDefinitionFileCode);<NEW_LINE>final Contentlet templateCodeFileAsset = new FileAssetDataGen(templateFolder, file).host(host).setProperty("title", templateDefinitionFileName).setProperty("fileName", templateDefinitionFileName).nextPersisted();<NEW_LINE>templateCode = APILocator.<MASK><NEW_LINE>final java.io.File fileMetaData = java.io.File.createTempFile(Constants.TEMPLATE_META_INFO_FILE_NAME.split("\\.")[0], Constants.TEMPLATE_META_INFO_FILE_NAME.split("\\.")[1]);<NEW_LINE>FileUtil.write(fileMetaData, isDesignTemplate ? metaDataDesign : metaDataBasic);<NEW_LINE>final Contentlet templateMetaDataFileAsset = new FileAssetDataGen(templateFolder, fileMetaData).host(host).setProperty("title", Constants.TEMPLATE_META_INFO_FILE_NAME).setProperty("fileName", Constants.TEMPLATE_META_INFO_FILE_NAME).nextPersisted();<NEW_LINE>metaData = APILocator.getFileAssetAPI().fromContentlet(templateMetaDataFileAsset);<NEW_LINE>return toFileAssetTemplate(object, templateFolder, metaData, templateCode);<NEW_LINE>} catch (DotDataException | DotSecurityException | IOException e) {<NEW_LINE>Logger.warnAndDebug(TemplateAsFileDataGen.class, e.getMessage(), e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | getFileAssetAPI().fromContentlet(templateCodeFileAsset); |
952,928 | public void generateTasks(TeamTask teamTask, Frequency frequency) {<NEW_LINE>List<LocalDate> taskDates = Beans.get(FrequencyService.class).getDates(frequency, teamTask.getTaskDate(), frequency.getEndDate());<NEW_LINE>taskDates.removeIf(date -> date.equals<MASK><NEW_LINE>// limit how many TeamTask will be generated at once<NEW_LINE>Integer limitNumberTasksGenerated = Beans.get(AppBaseService.class).getAppBase().getLimitNumberTasksGenerated();<NEW_LINE>if (taskDates.size() > limitNumberTasksGenerated) {<NEW_LINE>taskDates = taskDates.subList(0, limitNumberTasksGenerated);<NEW_LINE>}<NEW_LINE>TeamTask lastTask = teamTask;<NEW_LINE>for (LocalDate date : taskDates) {<NEW_LINE>TeamTask newTeamTask = teamTaskRepo.copy(teamTask, false);<NEW_LINE>setModuleFields(teamTask, date, newTeamTask);<NEW_LINE>teamTaskRepo.save(newTeamTask);<NEW_LINE>lastTask.setNextTeamTask(newTeamTask);<NEW_LINE>teamTaskRepo.save(lastTask);<NEW_LINE>lastTask = newTeamTask;<NEW_LINE>}<NEW_LINE>} | (teamTask.getTaskDate())); |
1,775,848 | /* write a chunk at (x,z) with length bytes of data to disk */<NEW_LINE>protected void write(int x, int z, byte[] data, int length) throws IOException {<NEW_LINE>int offset = getOffset(x, z);<NEW_LINE>int sectorNumber = offset >> 8;<NEW_LINE>int sectorsAllocated = offset & 0xFF;<NEW_LINE>int sectorsNeeded = (length + CHUNK_HEADER_SIZE) / SECTOR_BYTES + 1;<NEW_LINE>// maximum chunk size is 1MB<NEW_LINE>if (sectorsNeeded >= 256) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (sectorNumber != 0 && sectorsAllocated == sectorsNeeded) {<NEW_LINE>if (sectorNumber != 0) {<NEW_LINE>sectorsUsed.clear(sectorNumber, sectorNumber + sectorsAllocated + 1);<NEW_LINE>}<NEW_LINE>file.<MASK><NEW_LINE>for (int i = 0; i < sectorsNeeded; ++i) {<NEW_LINE>file.write(emptySector);<NEW_LINE>}<NEW_LINE>sizeDelta.addAndGet(SECTOR_BYTES * sectorsNeeded);<NEW_LINE>sectorNumber = sectorsUsed.length();<NEW_LINE>}<NEW_LINE>sectorsUsed.set(sectorNumber, sectorNumber + sectorsNeeded + 1);<NEW_LINE>writeSector(sectorNumber, data, length);<NEW_LINE>setOffset(x, z, sectorNumber << 8 | sectorsNeeded);<NEW_LINE>setTimestamp(x, z, (int) (System.currentTimeMillis() / 1000L));<NEW_LINE>}<NEW_LINE>} | seek(file.length()); |
1,544,862 | protected void generate(Project project) {<NEW_LINE>BuildClientMetaData metaData = getClientMetaData();<NEW_LINE>StyledTextOutput textOutput = getRenderer().getTextOutput();<NEW_LINE>render(project, new GraphRenderer(textOutput), true, textOutput);<NEW_LINE>if (project.getChildProjects().isEmpty()) {<NEW_LINE>textOutput.withStyle(Info).text("No sub-projects");<NEW_LINE>textOutput.println();<NEW_LINE>}<NEW_LINE>if (project == project.getRootProject()) {<NEW_LINE>int i = 0;<NEW_LINE>Collection<? extends IncludedBuildState> includedBuilds = getBuildStateRegistry().getIncludedBuilds();<NEW_LINE>if (!includedBuilds.isEmpty()) {<NEW_LINE>GraphRenderer renderer = new GraphRenderer(textOutput);<NEW_LINE>textOutput.println();<NEW_LINE>textOutput.text("Included builds");<NEW_LINE>textOutput.println();<NEW_LINE>renderer.startChildren();<NEW_LINE>for (IncludedBuildState includedBuildState : includedBuilds) {<NEW_LINE>renderer.visit(text -> {<NEW_LINE>textOutput.text("Included build '" + includedBuildState.getIdentityPath() + "'");<NEW_LINE>}, (i + 1) == includedBuilds.size());<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>renderer.completeChildren();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>textOutput.println();<NEW_LINE>textOutput.text("To see a list of the tasks of a project, run ");<NEW_LINE>metaData.describeCommand(textOutput.withStyle(UserInput), "<project-path>:" + ProjectInternal.TASKS_TASK);<NEW_LINE>textOutput.println();<NEW_LINE>textOutput.text("For example, try running ");<NEW_LINE>Project exampleProject = project.getChildProjects().isEmpty() ? project : getChildren<MASK><NEW_LINE>metaData.describeCommand(textOutput.withStyle(UserInput), exampleProject.absoluteProjectPath(ProjectInternal.TASKS_TASK));<NEW_LINE>textOutput.println();<NEW_LINE>if (project != project.getRootProject()) {<NEW_LINE>textOutput.println();<NEW_LINE>textOutput.text("To see a list of all the projects in this build, run ");<NEW_LINE>metaData.describeCommand(textOutput.withStyle(UserInput), project.getRootProject().absoluteProjectPath(ProjectInternal.PROJECTS_TASK));<NEW_LINE>textOutput.println();<NEW_LINE>}<NEW_LINE>} | (project).get(0); |
1,158,106 | private String classToSourceURL(FileObject fo, OutputWriter logger) {<NEW_LINE>ClassPath cp = ClassPath.getClassPath(fo, ClassPath.EXECUTE);<NEW_LINE>if (cp == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FileObject root = cp.findOwnerRoot(fo);<NEW_LINE>String resourceName = cp.<MASK><NEW_LINE>if (resourceName == null) {<NEW_LINE>logger.println("Can not find classpath resource for " + fo + ", skipping...");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int i = resourceName.indexOf('$');<NEW_LINE>if (i > 0) {<NEW_LINE>resourceName = resourceName.substring(0, i);<NEW_LINE>}<NEW_LINE>FileObject[] sRoots = SourceForBinaryQuery.findSourceRoots(root.toURL()).getRoots();<NEW_LINE>ClassPath sourcePath = ClassPathSupport.createClassPath(sRoots);<NEW_LINE>FileObject rfo = sourcePath.findResource(resourceName + ".java");<NEW_LINE>if (rfo == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return rfo.toURL().toExternalForm();<NEW_LINE>} | getResourceName(fo, '/', false); |
1,838,294 | private void showFolderField(final ConfigurationType type, final DefaultMutableTreeNode node, final String folderName) {<NEW_LINE>myRightPanel.removeAll();<NEW_LINE>JPanel panel = new JPanel(new VerticalFlowLayout(0, 0));<NEW_LINE>final JTextField textField = new JTextField(folderName);<NEW_LINE>textField.getDocument().addDocumentListener(new DocumentAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void textChanged(DocumentEvent e) {<NEW_LINE>node.setUserObject(textField.getText());<NEW_LINE>myTreeModel.reload(node);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>panel.add(LabeledComponent<MASK><NEW_LINE>panel.add(new JLabel(ExecutionBundle.message("run.configuration.rename.folder.disclaimer")));<NEW_LINE>myRightPanel.add(panel);<NEW_LINE>myRightPanel.revalidate();<NEW_LINE>myRightPanel.repaint();<NEW_LINE>if (isFolderCreating) {<NEW_LINE>textField.selectAll();<NEW_LINE>IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(textField);<NEW_LINE>}<NEW_LINE>} | .left(textField, "Folder name")); |
1,702,710 | public void print(ActionRequest request, ActionResponse response) throws AxelorException {<NEW_LINE>EmployeeBonusMgt bonus = Beans.get(EmployeeBonusMgtRepository.class).find(request.getContext().asType(EmployeeBonusMgt<MASK><NEW_LINE>String name = I18n.get("Employee bonus management") + " : " + bonus.getEmployeeBonusType().getLabel();<NEW_LINE>String fileLink = ReportFactory.createReport(IReport.EMPLOYEE_BONUS_MANAGEMENT, name).addParam("EmployeeBonusMgtId", bonus.getId()).addParam("Timezone", bonus.getCompany() != null ? bonus.getCompany().getTimezone() : null).addParam("Locale", ReportSettings.getPrintingLocale(null)).toAttach(bonus).generate().getFileLink();<NEW_LINE>response.setView(ActionView.define(name).add("html", fileLink).map());<NEW_LINE>} | .class).getId()); |
633,861 | public static DisableApplicationScalingRuleResponse unmarshall(DisableApplicationScalingRuleResponse disableApplicationScalingRuleResponse, UnmarshallerContext _ctx) {<NEW_LINE>disableApplicationScalingRuleResponse.setRequestId(_ctx.stringValue("DisableApplicationScalingRuleResponse.RequestId"));<NEW_LINE>disableApplicationScalingRuleResponse.setCode(_ctx.integerValue("DisableApplicationScalingRuleResponse.Code"));<NEW_LINE>disableApplicationScalingRuleResponse.setMessage(_ctx.stringValue("DisableApplicationScalingRuleResponse.Message"));<NEW_LINE>AppScalingRule appScalingRule = new AppScalingRule();<NEW_LINE>appScalingRule.setAppId(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.AppId"));<NEW_LINE>appScalingRule.setScaleRuleName(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleName"));<NEW_LINE>appScalingRule.setScaleRuleType(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleType"));<NEW_LINE>appScalingRule.setScaleRuleEnabled(_ctx.booleanValue("DisableApplicationScalingRuleResponse.AppScalingRule.ScaleRuleEnabled"));<NEW_LINE>appScalingRule.setMinReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.MinReplicas"));<NEW_LINE>appScalingRule.setMaxReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.MaxReplicas"));<NEW_LINE>appScalingRule.setCreateTime(_ctx.longValue("DisableApplicationScalingRuleResponse.AppScalingRule.CreateTime"));<NEW_LINE>appScalingRule.setUpdateTime<MASK><NEW_LINE>appScalingRule.setLastDisableTime(_ctx.longValue("DisableApplicationScalingRuleResponse.AppScalingRule.LastDisableTime"));<NEW_LINE>Metric metric = new Metric();<NEW_LINE>metric.setMaxReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.MaxReplicas"));<NEW_LINE>metric.setMinReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.MinReplicas"));<NEW_LINE>List<Metric1> metrics = new ArrayList<Metric1>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics.Length"); i++) {<NEW_LINE>Metric1 metric1 = new Metric1();<NEW_LINE>metric1.setMetricType(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics[" + i + "].MetricType"));<NEW_LINE>metric1.setMetricTargetAverageUtilization(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Metric.Metrics[" + i + "].MetricTargetAverageUtilization"));<NEW_LINE>metrics.add(metric1);<NEW_LINE>}<NEW_LINE>metric.setMetrics(metrics);<NEW_LINE>appScalingRule.setMetric(metric);<NEW_LINE>Trigger trigger = new Trigger();<NEW_LINE>trigger.setMaxReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.MaxReplicas"));<NEW_LINE>trigger.setMinReplicas(_ctx.integerValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.MinReplicas"));<NEW_LINE>List<Trigger2> triggers = new ArrayList<Trigger2>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers.Length"); i++) {<NEW_LINE>Trigger2 trigger2 = new Trigger2();<NEW_LINE>trigger2.setType(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].Type"));<NEW_LINE>trigger2.setName(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].Name"));<NEW_LINE>trigger2.setMetaData(_ctx.stringValue("DisableApplicationScalingRuleResponse.AppScalingRule.Trigger.Triggers[" + i + "].MetaData"));<NEW_LINE>triggers.add(trigger2);<NEW_LINE>}<NEW_LINE>trigger.setTriggers(triggers);<NEW_LINE>appScalingRule.setTrigger(trigger);<NEW_LINE>disableApplicationScalingRuleResponse.setAppScalingRule(appScalingRule);<NEW_LINE>return disableApplicationScalingRuleResponse;<NEW_LINE>} | (_ctx.longValue("DisableApplicationScalingRuleResponse.AppScalingRule.UpdateTime")); |
139,390 | public void processChannelGrant(APCO25Channel apco25Channel, ServiceOptions serviceOptions, IdentifierCollection identifierCollection, Opcode opcode, long timestamp) {<NEW_LINE>if (apco25Channel.isTDMAChannel()) {<NEW_LINE>if (apco25Channel.getTimeslotCount() == 2) {<NEW_LINE>// Data channels may be granted as a phase 2 channel grant but are still phase 1 channels<NEW_LINE>if (opcode.isDataChannelGrant()) {<NEW_LINE>APCO25Channel phase1Channel = convertPhase2ToPhase1(apco25Channel);<NEW_LINE>processPhase1ChannelGrant(phase1Channel, <MASK><NEW_LINE>} else {<NEW_LINE>processPhase2ChannelGrant(apco25Channel, serviceOptions, identifierCollection, opcode, timestamp);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mLog.warn("Cannot process TDMA channel grant - unrecognized timeslot count: " + apco25Channel.getTimeslotCount());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>processPhase1ChannelGrant(apco25Channel, serviceOptions, identifierCollection, opcode, timestamp);<NEW_LINE>}<NEW_LINE>} | serviceOptions, identifierCollection, opcode, timestamp); |
1,635,598 | public void act(float delta) {<NEW_LINE>super.act(delta);<NEW_LINE>if (Core.scene.getKeyboardFocus() == null || !(Core.scene.getKeyboardFocus() instanceof TextField) && !Core.input.keyDown(KeyCode.controlLeft)) {<NEW_LINE>float ax = Core.input.axis(Binding.move_x);<NEW_LINE>float ay = Core.<MASK><NEW_LINE>offsetx -= ax * 15 * Time.delta / zoom;<NEW_LINE>offsety -= ay * 15 * Time.delta / zoom;<NEW_LINE>}<NEW_LINE>if (Core.input.keyTap(KeyCode.shiftLeft)) {<NEW_LINE>lastTool = tool;<NEW_LINE>tool = EditorTool.pick;<NEW_LINE>}<NEW_LINE>if (Core.input.keyRelease(KeyCode.shiftLeft) && lastTool != null) {<NEW_LINE>tool = lastTool;<NEW_LINE>lastTool = null;<NEW_LINE>}<NEW_LINE>if (Core.scene.getScrollFocus() != this)<NEW_LINE>return;<NEW_LINE>zoom += Core.input.axis(Binding.zoom) / 10f * zoom;<NEW_LINE>clampZoom();<NEW_LINE>} | input.axis(Binding.move_y); |
1,508,286 | default void renderBackground(GuiRenderer renderer, WWidget widget, boolean pressed, boolean mouseOver) {<NEW_LINE>MeteorGuiTheme theme = theme();<NEW_LINE>double s = theme.scale(2);<NEW_LINE>renderer.quad(widget.x + s, widget.y + s, widget.width - s * 2, widget.height - s * 2, theme.backgroundColor.get(pressed, mouseOver));<NEW_LINE>Color outlineColor = theme.<MASK><NEW_LINE>renderer.quad(widget.x, widget.y, widget.width, s, outlineColor);<NEW_LINE>renderer.quad(widget.x, widget.y + widget.height - s, widget.width, s, outlineColor);<NEW_LINE>renderer.quad(widget.x, widget.y + s, s, widget.height - s * 2, outlineColor);<NEW_LINE>renderer.quad(widget.x + widget.width - s, widget.y + s, s, widget.height - s * 2, outlineColor);<NEW_LINE>} | outlineColor.get(pressed, mouseOver); |
899,309 | public List<Map.Entry<String, String>> scan(ClassFile classFile) {<NEW_LINE>List<Map.Entry<String, String>> entries = new ArrayList<>();<NEW_LINE><MASK><NEW_LINE>if (resultFilter.test(className) && isPublic(classFile)) {<NEW_LINE>entries.add(entry(className, ""));<NEW_LINE>if (includeFields) {<NEW_LINE>classFile.getFields().forEach(field -> entries.add(entry(className, field.getName())));<NEW_LINE>}<NEW_LINE>if (includeMethods) {<NEW_LINE>classFile.getMethods().stream().filter(this::isPublic).forEach(method -> entries.add(entry(className, method.getName() + "(" + String.join(", ", JavassistHelper.getParameters(method)) + ")")));<NEW_LINE>}<NEW_LINE>if (includeAnnotations) {<NEW_LINE>JavassistHelper.getAnnotations(classFile::getAttribute).stream().filter(resultFilter).forEach(annotation -> entries.add(entry(className, "@" + annotation)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return entries;<NEW_LINE>} | String className = classFile.getName(); |
1,708,869 | final ExportTransitGatewayRoutesResult executeExportTransitGatewayRoutes(ExportTransitGatewayRoutesRequest exportTransitGatewayRoutesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(exportTransitGatewayRoutesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ExportTransitGatewayRoutesRequest> request = null;<NEW_LINE>Response<ExportTransitGatewayRoutesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ExportTransitGatewayRoutesRequestMarshaller().marshall(super.beforeMarshalling(exportTransitGatewayRoutesRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ExportTransitGatewayRoutes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ExportTransitGatewayRoutesResult> responseHandler = new StaxResponseHandler<ExportTransitGatewayRoutesResult>(new ExportTransitGatewayRoutesResultStaxUnmarshaller());<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); |
987,048 | private AbstractJClass retrieveDecoratedResponseClass(DeclaredType declaredType, TypeElement typeElement, RestHolder holder) {<NEW_LINE>String classTypeBaseName = typeElement.toString();<NEW_LINE>// Looking for basic java.util interfaces to set a default<NEW_LINE>// implementation<NEW_LINE>String decoratedClassName = null;<NEW_LINE>if (typeElement.getKind() == ElementKind.INTERFACE) {<NEW_LINE>if (classTypeBaseName.equals(CanonicalNameConstants.MAP)) {<NEW_LINE>decoratedClassName = LinkedHashMap.class.getCanonicalName();<NEW_LINE>} else if (classTypeBaseName.equals(CanonicalNameConstants.SET)) {<NEW_LINE>decoratedClassName = TreeSet.class.getCanonicalName();<NEW_LINE>} else if (classTypeBaseName.equals(CanonicalNameConstants.LIST)) {<NEW_LINE>decoratedClassName = ArrayList.class.getCanonicalName();<NEW_LINE>} else if (classTypeBaseName.equals(CanonicalNameConstants.COLLECTION)) {<NEW_LINE>decoratedClassName = ArrayList.class.getCanonicalName();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>decoratedClassName = typeElement.getQualifiedName().toString();<NEW_LINE>}<NEW_LINE>if (decoratedClassName != null) {<NEW_LINE>// Configure the super class of the final decorated class<NEW_LINE>String decoratedClassNameSuffix = "";<NEW_LINE>AbstractJClass decoratedSuperClass = getEnvironment().getJClass(decoratedClassName);<NEW_LINE>for (TypeMirror typeArgument : declaredType.getTypeArguments()) {<NEW_LINE>TypeMirror actualTypeArgument = typeArgument;<NEW_LINE>if (typeArgument instanceof WildcardType) {<NEW_LINE>WildcardType wildcardType = (WildcardType) typeArgument;<NEW_LINE>if (wildcardType.getExtendsBound() != null) {<NEW_LINE>actualTypeArgument = wildcardType.getExtendsBound();<NEW_LINE>} else if (wildcardType.getSuperBound() != null) {<NEW_LINE>actualTypeArgument = wildcardType.getSuperBound();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AbstractJClass narrowJClass = codeModelHelper.typeMirrorToJClass(actualTypeArgument);<NEW_LINE>decoratedSuperClass = decoratedSuperClass.narrow(narrowJClass);<NEW_LINE>decoratedClassNameSuffix += plainName(narrowJClass);<NEW_LINE>}<NEW_LINE>String decoratedFinalClassName = classTypeBaseName + "_" + decoratedClassNameSuffix;<NEW_LINE>decoratedFinalClassName = decoratedFinalClassName.replaceAll("\\[\\]", "s");<NEW_LINE>String packageName = holder.getGeneratedClass()._package().name();<NEW_LINE>decoratedFinalClassName = packageName + "." + decoratedFinalClassName;<NEW_LINE>JDefinedClass decoratedJClass = <MASK><NEW_LINE>decoratedJClass._extends(decoratedSuperClass);<NEW_LINE>return decoratedJClass;<NEW_LINE>}<NEW_LINE>// Try to find the superclass and make a recursive call to the this<NEW_LINE>// method<NEW_LINE>TypeMirror enclosingSuperJClass = typeElement.getSuperclass();<NEW_LINE>if (enclosingSuperJClass != null && enclosingSuperJClass.getKind() == TypeKind.DECLARED) {<NEW_LINE>DeclaredType declaredEnclosingSuperJClass = (DeclaredType) enclosingSuperJClass;<NEW_LINE>return retrieveDecoratedResponseClass(declaredType, (TypeElement) declaredEnclosingSuperJClass.asElement(), holder);<NEW_LINE>}<NEW_LINE>// Falling back to the current enclosingJClass if Class can't be found<NEW_LINE>return null;<NEW_LINE>} | getEnvironment().getDefinedClass(decoratedFinalClassName); |
1,598,974 | private void statInit() {<NEW_LINE>lDocumentNo.setLabelFor(fDocumentNo);<NEW_LINE>fDocumentNo.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDocumentNo.addActionListener(this);<NEW_LINE>lDescription.setLabelFor(fDescription);<NEW_LINE>fDescription.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDescription.addActionListener(this);<NEW_LINE>lPOReference.setLabelFor(fPOReference);<NEW_LINE>fPOReference.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fPOReference.addActionListener(this);<NEW_LINE>fIsSOTrx.setSelected(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx")));<NEW_LINE>fIsSOTrx.addActionListener(this);<NEW_LINE>//<NEW_LINE>fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInOut.Table_Name, MInOut.COLUMNNAME_C_BPartner_ID), DisplayType.Search));<NEW_LINE>lBPartner_ID.setLabelFor(fBPartner_ID);<NEW_LINE>fBPartner_ID.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fBPartner_ID.addActionListener(this);<NEW_LINE>//<NEW_LINE>fShipper_ID = new VLookup("M_Shipper_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MInOut.Table_Name, MInOut.COLUMNNAME_M_Shipper_ID), DisplayType.TableDir));<NEW_LINE>lShipper_ID.setLabelFor(fShipper_ID);<NEW_LINE>fShipper_ID.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fShipper_ID.addActionListener(this);<NEW_LINE>//<NEW_LINE>lDateFrom.setLabelFor(fDateFrom);<NEW_LINE>fDateFrom.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDateFrom.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom"));<NEW_LINE>fDateFrom.addActionListener(this);<NEW_LINE>lDateTo.setLabelFor(fDateTo);<NEW_LINE>fDateTo.setBackground(AdempierePLAF.getInfoBackground());<NEW_LINE>fDateTo.setToolTipText(Msg.translate(Env.getCtx(), "DateTo"));<NEW_LINE>fDateTo.addActionListener(this);<NEW_LINE>//<NEW_LINE>CPanel datePanel = new CPanel();<NEW_LINE>datePanel.setLayout(new ALayout<MASK><NEW_LINE>datePanel.add(fDateFrom, new ALayoutConstraint(0, 0));<NEW_LINE>datePanel.add(lDateTo, null);<NEW_LINE>datePanel.add(fDateTo, null);<NEW_LINE>// First Row<NEW_LINE>p_criteriaGrid.add(lDocumentNo, new ALayoutConstraint(0, 0));<NEW_LINE>p_criteriaGrid.add(fDocumentNo, null);<NEW_LINE>p_criteriaGrid.add(lBPartner_ID, null);<NEW_LINE>p_criteriaGrid.add(fBPartner_ID, null);<NEW_LINE>p_criteriaGrid.add(fIsSOTrx, new ALayoutConstraint(0, 5));<NEW_LINE>// 2nd Row<NEW_LINE>p_criteriaGrid.add(lDescription, new ALayoutConstraint(1, 0));<NEW_LINE>p_criteriaGrid.add(fDescription, null);<NEW_LINE>p_criteriaGrid.add(lDateFrom, null);<NEW_LINE>p_criteriaGrid.add(datePanel, null);<NEW_LINE>// 3rd Row<NEW_LINE>p_criteriaGrid.add(lPOReference, new ALayoutConstraint(2, 0));<NEW_LINE>p_criteriaGrid.add(fPOReference, null);<NEW_LINE>p_criteriaGrid.add(lShipper_ID, null);<NEW_LINE>p_criteriaGrid.add(fShipper_ID, null);<NEW_LINE>} | (0, 0, true)); |
189,990 | public ImmutableSet<TableRecordReference> extractRecordRefs(final BPartnerComposite dataItem) {<NEW_LINE>try (final MDCCloseable ignored = TableRecordMDC.putTableRecordReference(I_C_BPartner.Table_Name, dataItem.getBpartner() == null ? null : dataItem.getBpartner().getId())) {<NEW_LINE>final ImmutableSet.Builder<TableRecordReference> recordRefs = ImmutableSet.builder();<NEW_LINE>recordRefs.add(TableRecordReference.of(I_C_BPartner.Table_Name, dataItem.getBpartner().getId()));<NEW_LINE>for (final BPartnerLocation location : dataItem.getLocations()) {<NEW_LINE>recordRefs.add(TableRecordReference.of(I_C_BPartner_Location.Table_Name<MASK><NEW_LINE>}<NEW_LINE>for (final BPartnerContact contact : dataItem.getContacts()) {<NEW_LINE>recordRefs.add(TableRecordReference.of(I_AD_User.Table_Name, contact.getId()));<NEW_LINE>recordRefs.addAll(getRecordRefsRoles(contact.getRoles()));<NEW_LINE>}<NEW_LINE>final ImmutableSet<TableRecordReference> result = recordRefs.build();<NEW_LINE>logger.debug("extractRecordRefs - extracted record refs for given bpartnerComposite: {}", result);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | , location.getId())); |
441,618 | public void testAuthenticateMethodFL_UnprotectedServlet3() throws Exception {<NEW_LINE>METHODS = "testMethod=authenticate,logout,login,authenticate,logout_once,authenticate";<NEW_LINE>String url = "http://" + server.getHostname() + ":" + server.getHttpDefaultPort() + "/formlogin/UnprotectedProgrammaticAPIServlet?" + METHODS + "&user=" + managerUser + "&password=" + managerPassword;<NEW_LINE>HttpClient client = new DefaultHttpClient();<NEW_LINE>String response = authenticateWithValidAuthDataFLTwice(client, validUser, validPassword, url);<NEW_LINE>// Get servlet output to verify each test<NEW_LINE>String test1 = response.substring(response.indexOf("STARTTEST1"), response.indexOf("ENDTEST1"));<NEW_LINE>String test2 = response.substring(response.indexOf("STARTTEST2"), response.indexOf("ENDTEST2"));<NEW_LINE>String test3 = response.substring(response.indexOf("STARTTEST3"), response.indexOf("ENDTEST3"));<NEW_LINE>String test4 = response.substring(response.indexOf("STARTTEST4")<MASK><NEW_LINE>// Skip test 5 because logout_once will not run logout on the 2nd pass<NEW_LINE>String test6 = response.substring(response.indexOf("STARTTEST6"), response.indexOf("ENDTEST6"));<NEW_LINE>// TEST1 - check values after 1st authenticate<NEW_LINE>testHelper.verifyProgrammaticAPIValues(authTypeForm, validUser, test1, NOT_MANAGER_ROLE, IS_EMPLOYEE_ROLE);<NEW_LINE>// TEST2 - check values after logout<NEW_LINE>testHelper.verifyNullValuesAfterLogout(validUser, test2, NOT_MANAGER_ROLE, IS_EMPLOYEE_ROLE);<NEW_LINE>// TEST3 - check values after 1st login<NEW_LINE>testHelper.verifyProgrammaticAPIValues(authTypeForm, managerUser, test3, IS_MANAGER_ROLE, NOT_EMPLOYEE_ROLE);<NEW_LINE>// TEST4 - check values after 2nd authenticate<NEW_LINE>testHelper.verifyProgrammaticAPIValues(authTypeForm, managerUser, test4, IS_MANAGER_ROLE, NOT_EMPLOYEE_ROLE);<NEW_LINE>// Skip test 5 because logout_once will not run logout on the 2nd pass<NEW_LINE>// TEST6 - check values after 3rd authenticate<NEW_LINE>testHelper.verifyProgrammaticAPIValues(authTypeForm, managerUser, test6, IS_MANAGER_ROLE, NOT_EMPLOYEE_ROLE);<NEW_LINE>} | , response.indexOf("ENDTEST4")); |
765,663 | /* (non-Javadoc)<NEW_LINE>* @see tlc2.tool.liveness.ILiveCheck#checkTrace(tlc2.tool.StateVec)<NEW_LINE>*/<NEW_LINE>public void checkTrace(ITool tool, final Supplier<StateVec> traceSupplier) throws InterruptedException, IOException {<NEW_LINE>final StateVec stateTrace = traceSupplier.get();<NEW_LINE>// Add the first state to the LiveCheck as the current init state<NEW_LINE>addInitState(tool, stateTrace.elementAt(0), stateTrace.elementAt(0).fingerPrint());<NEW_LINE>// Add the remaining states...<NEW_LINE>final SetOfStates successors = new SetOfStates(stateTrace.size() * 2);<NEW_LINE>// For all states except last one add the successor<NEW_LINE>// (which is the next state in stateTrace).<NEW_LINE>for (int i = 0; i < stateTrace.size() - 1; i++) {<NEW_LINE>// Empty out old successors.<NEW_LINE>successors.clear();<NEW_LINE>// Calculate the current state's fingerprint<NEW_LINE>final TLCState tlcState = stateTrace.elementAt(i);<NEW_LINE>final long fingerPrint = tlcState.fingerPrint();<NEW_LINE>// Add state itself to allow stuttering<NEW_LINE>successors.put(tlcState);<NEW_LINE>// Add the successor in the trace<NEW_LINE>final TLCState successor = <MASK><NEW_LINE>successors.put(successor);<NEW_LINE>addNextState(tool, tlcState, fingerPrint, successors);<NEW_LINE>}<NEW_LINE>// Add last state in trace for which *no* successors have been generated<NEW_LINE>final TLCState lastState = stateTrace.elementAt(stateTrace.size() - 1);<NEW_LINE>addNextState(tool, lastState, lastState.fingerPrint(), new SetOfStates(0));<NEW_LINE>// Do *not* re-create the nodePtrTbl when it is thrown away anyway.<NEW_LINE>final int result = check0(tool, true);<NEW_LINE>if (result != EC.NO_ERROR) {<NEW_LINE>throw new LiveException(result);<NEW_LINE>}<NEW_LINE>// We are done with the current subsequence of the behavior. Reset LiveCheck<NEW_LINE>// for the next behavior simulation is going to create.<NEW_LINE>reset();<NEW_LINE>} | stateTrace.elementAt(i + 1); |
404,163 | public void onBinaryFrame(byte[] message, boolean finalFragment, int rsv) {<NEW_LINE>FeedMessage feedMessage;<NEW_LINE>List<FeedEntity> feedEntityList;<NEW_LINE>List<TripUpdate> updates = null;<NEW_LINE>boolean fullDataset = true;<NEW_LINE>try {<NEW_LINE>// Decode message<NEW_LINE>feedMessage = FeedMessage.PARSER.parseFrom(message);<NEW_LINE>feedEntityList = feedMessage.getEntityList();<NEW_LINE>// Change fullDataset value if this is an incremental update<NEW_LINE>if (feedMessage.hasHeader() && feedMessage.getHeader().hasIncrementality() && feedMessage.getHeader().getIncrementality().equals(GtfsRealtime.FeedHeader.Incrementality.DIFFERENTIAL)) {<NEW_LINE>fullDataset = false;<NEW_LINE>}<NEW_LINE>// Create List of TripUpdates<NEW_LINE>updates = new ArrayList<<MASK><NEW_LINE>for (FeedEntity feedEntity : feedEntityList) {<NEW_LINE>if (feedEntity.hasTripUpdate()) {<NEW_LINE>updates.add(feedEntity.getTripUpdate());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>LOG.error("Could not decode gtfs-rt message:", e);<NEW_LINE>}<NEW_LINE>if (updates != null) {<NEW_LINE>// Handle trip updates via graph writer runnable<NEW_LINE>TripUpdateGraphWriterRunnable runnable = new TripUpdateGraphWriterRunnable(fullDataset, updates, feedId);<NEW_LINE>saveResultOnGraph.execute(runnable);<NEW_LINE>}<NEW_LINE>} | >(feedEntityList.size()); |
1,064,504 | final ListIPSetsResult executeListIPSets(ListIPSetsRequest listIPSetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listIPSetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListIPSetsRequest> request = null;<NEW_LINE>Response<ListIPSetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListIPSetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listIPSetsRequest));<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, "GuardDuty");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListIPSets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListIPSetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListIPSetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,291,376 | public WorksheetTaskWrapper<Void> doAction(String id, WorksheetContext ctx) {<NEW_LINE>ExampleActionTask task = null;<NEW_LINE>switch(id) {<NEW_LINE>case ACTION_BOTH_ID:<NEW_LINE>task = new ExampleActionTask(ExtensionResources.get(ExtensionResources.WORKSHEET_ACTION_BOTH), ctx.getConnectionName(), ctx.<MASK><NEW_LINE>break;<NEW_LINE>case ACTION_CONTEXT_MENU_ONLY_ID:<NEW_LINE>task = new ExampleActionTask(ExtensionResources.get(ExtensionResources.WORKSHEET_ACTION_CONTEXT_MENU_ONLY), ctx.getConnectionName(), ctx.getCallback(), id, true);<NEW_LINE>break;<NEW_LINE>case ACTION_TOOLBAR_ONLY_ID:<NEW_LINE>task = new ExampleActionTask(ExtensionResources.get(ExtensionResources.WORKSHEET_ACTION_TOOLBAR_ONLY), ctx.getConnectionName(), ctx.getCallback(), id, false);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>task = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (null == task) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new WorksheetTaskWrapper<Void>(task, getTaskListenerList(), getTaskUIListenerList(), Collections.singletonList(ctx.getTaskViewer()), ctx);<NEW_LINE>} | getCallback(), id, false); |
1,466,604 | public GetProvisionedProductOutputsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetProvisionedProductOutputsResult getProvisionedProductOutputsResult = new GetProvisionedProductOutputsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getProvisionedProductOutputsResult;<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("Outputs", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getProvisionedProductOutputsResult.setOutputs(new ListUnmarshaller<RecordOutput>(RecordOutputJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextPageToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getProvisionedProductOutputsResult.setNextPageToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getProvisionedProductOutputsResult;<NEW_LINE>} | class).unmarshall(context)); |
1,037,550 | final StartExportLabelsTaskRunResult executeStartExportLabelsTaskRun(StartExportLabelsTaskRunRequest startExportLabelsTaskRunRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startExportLabelsTaskRunRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartExportLabelsTaskRunRequest> request = null;<NEW_LINE>Response<StartExportLabelsTaskRunResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartExportLabelsTaskRunRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startExportLabelsTaskRunRequest));<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, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartExportLabelsTaskRun");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartExportLabelsTaskRunResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartExportLabelsTaskRunResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
176,020 | private void writeAttributesGenerateContent(final ITreeWriter writer, final NodeModel node) {<NEW_LINE>xmlNode = new XMLElement();<NEW_LINE>EncryptionModel encryptionModel = EncryptionModel.getModel(node);<NEW_LINE>mayWriteChildren = true;<NEW_LINE>final Object mode = mode(writer);<NEW_LINE>final boolean isNodeAlreadyWritten = isAlreadyWritten(node);<NEW_LINE>if (encryptionModel != null && !(encryptionModel.isAccessible() && Mode.EXPORT.equals(mode)) && !isNodeAlreadyWritten) {<NEW_LINE>final String enctyptedContent = encryptionModel.calculateEncryptedContent(mapController.getMapWriter());<NEW_LINE>if (enctyptedContent != null) {<NEW_LINE>writer.addAttribute(NodeBuilder.XML_NODE_ENCRYPTED_CONTENT, enctyptedContent);<NEW_LINE>mayWriteChildren = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mayWriteChildren && (writeFolded || !mode(writer).equals(Mode.FILE))) {<NEW_LINE>if (mapController.isFolded(node) && !isNodeAlreadyWritten) {<NEW_LINE>writer.addAttribute("FOLDED", "true");<NEW_LINE>} else if (node.isRoot() && !Mode.STYLE.equals(mode)) {<NEW_LINE>writer.addAttribute("FOLDED", "false");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final NodeModel parentNode = node.getParentNode();<NEW_LINE>if (parentNode != null && parentNode.isRoot()) {<NEW_LINE>writer.addAttribute("POSITION", node.isLeft() ? "left" : "right");<NEW_LINE>}<NEW_LINE>final boolean shouldCreateId = !<MASK><NEW_LINE>final String id = shouldCreateId ? node.createID() : node.getID();<NEW_LINE>if (id != null) {<NEW_LINE>writer.addAttribute("ID", id);<NEW_LINE>writeReferenceNodeId(writer, node);<NEW_LINE>}<NEW_LINE>if (!isNodeAlreadyWritten) {<NEW_LINE>if (!mode.equals(Mode.STYLE) && node.getHistoryInformation() != null && ResourceController.getResourceController().getBooleanProperty(NodeBuilder.RESOURCES_SAVE_MODIFICATION_TIMES)) {<NEW_LINE>writer.addAttribute(NodeBuilder.XML_NODE_HISTORY_CREATED_AT, TreeXmlWriter.dateToString(node.getHistoryInformation().getCreatedAt()));<NEW_LINE>writer.addAttribute(NodeBuilder.XML_NODE_HISTORY_LAST_MODIFIED_AT, TreeXmlWriter.dateToString(node.getHistoryInformation().getLastModifiedAt()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isNodeAlreadyWritten || Mode.EXPORT.equals(mode)) {<NEW_LINE>writeIconSize(writer, node);<NEW_LINE>linkBuilder.writeAttributes(writer, node);<NEW_LINE>writer.addExtensionAttributes(node, node.getSharedExtensions().values());<NEW_LINE>}<NEW_LINE>writer.addExtensionAttributes(node, node.getIndividualExtensionValues());<NEW_LINE>} | mode.equals(Mode.STYLE); |
854,907 | public void gera(NoDeclaracaoVetor vetor, PrintWriter saida, VisitanteASA visitor, int nivelEscopo, boolean podeInicializar) throws ExcecaoVisitaASA {<NEW_LINE>String nome = vetor.getNome();<NEW_LINE>String tipo = Utils.getNomeTipoJava(vetor.getTipoDado());<NEW_LINE>saida.format("%s %s[]", tipo, nome);<NEW_LINE>if (podeInicializar || vetor.constante()) {<NEW_LINE>if (vetor.temInicializacao()) {<NEW_LINE>saida.append(" = ");<NEW_LINE>vetor.getInicializacao().aceitar(visitor);<NEW_LINE>} else {<NEW_LINE>NoExpressao tamanho = vetor.getTamanho();<NEW_LINE>if (tamanho != null) {<NEW_LINE><MASK><NEW_LINE>tamanho.aceitar(visitor);<NEW_LINE>saida.append("]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | saida.format(" = new %s[", tipo); |
94,752 | public Node writeDescriptor(Node parent, String nodeName, JMSConnectionFactoryDefinitionDescriptor desc) {<NEW_LINE>Node node = appendChild(parent, nodeName);<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_DESCRIPTION, desc.getDescription());<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_NAME, desc.getName());<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_INTERFACE_NAME, desc.getInterfaceName());<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_CLASS_NAME, desc.getClassName());<NEW_LINE>// change the resource adapter name from internal format to standard format<NEW_LINE>String resourceAdapter = desc.getResourceAdapter();<NEW_LINE>if (resourceAdapter != null) {<NEW_LINE>int poundIndex = resourceAdapter.indexOf('#');<NEW_LINE>if (poundIndex > 0) {<NEW_LINE>// the internal format of resource adapter name is "appName#raName", remove the appName part<NEW_LINE>resourceAdapter = resourceAdapter.substring(poundIndex);<NEW_LINE>} else if (poundIndex == 0) {<NEW_LINE>// the resource adapter name should not be the standard format "#raName" here<NEW_LINE>DOLUtils.getDefaultLogger().log(Level.WARNING, RESOURCE_ADAPTER_NAME_INVALID, new Object[] { desc.getName(), desc.getResourceAdapter() });<NEW_LINE>} else {<NEW_LINE>// the resource adapter name represent the standalone RA in this case.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_RESOURCE_ADAPTER, resourceAdapter);<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_USER, desc.getUser());<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_PASSWORD, desc.getPassword());<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_CLIENT_ID, desc.getClientId());<NEW_LINE>ResourcePropertyNode propertyNode = new ResourcePropertyNode();<NEW_LINE><MASK><NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_TRANSACTIONAL, String.valueOf(desc.isTransactional()));<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_MAX_POOL_SIZE, desc.getMaxPoolSize());<NEW_LINE>appendTextChild(node, TagNames.JMS_CONNECTION_FACTORY_MIN_POOL_SIZE, desc.getMinPoolSize());<NEW_LINE>return node;<NEW_LINE>} | propertyNode.writeDescriptor(node, desc); |
1,743,211 | final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig); |
54,474 | public static Type toJimpleType(String desc, Optional<String> moduleName) {<NEW_LINE>int idx = desc.lastIndexOf('[');<NEW_LINE>int nrDims = idx + 1;<NEW_LINE>if (nrDims > 0) {<NEW_LINE>if (desc.charAt(0) != '[') {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>desc = desc.substring(idx + 1);<NEW_LINE>}<NEW_LINE>Type baseType;<NEW_LINE>switch(desc.charAt(0)) {<NEW_LINE>case 'Z':<NEW_LINE>baseType = BooleanType.v();<NEW_LINE>break;<NEW_LINE>case 'B':<NEW_LINE>baseType = ByteType.v();<NEW_LINE>break;<NEW_LINE>case 'C':<NEW_LINE>baseType = CharType.v();<NEW_LINE>break;<NEW_LINE>case 'S':<NEW_LINE>baseType = ShortType.v();<NEW_LINE>break;<NEW_LINE>case 'I':<NEW_LINE>baseType = IntType.v();<NEW_LINE>break;<NEW_LINE>case 'F':<NEW_LINE>baseType = FloatType.v();<NEW_LINE>break;<NEW_LINE>case 'J':<NEW_LINE>baseType = LongType.v();<NEW_LINE>break;<NEW_LINE>case 'D':<NEW_LINE>baseType = DoubleType.v();<NEW_LINE>break;<NEW_LINE>case 'L':<NEW_LINE>if (desc.charAt(desc.length() - 1) != ';') {<NEW_LINE>throw new AssertionError("Invalid reference descriptor: " + desc);<NEW_LINE>}<NEW_LINE>String name = desc.substring(1, desc.length() - 1);<NEW_LINE>name = toQualifiedName(name);<NEW_LINE>baseType = makeRefType(name, moduleName);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new AssertionError("Unknown descriptor: " + desc);<NEW_LINE>}<NEW_LINE>if (!(baseType instanceof RefLikeType) && desc.length() > 1) {<NEW_LINE>throw new AssertionError("Invalid primitive type descriptor: " + desc);<NEW_LINE>}<NEW_LINE>return nrDims > 0 ? ArrayType.v(baseType, nrDims) : baseType;<NEW_LINE>} | throw new AssertionError("Invalid array descriptor: " + desc); |
1,596,251 | public void onDataReceived(@NonNull final BluetoothDevice device, @NonNull final Data data) {<NEW_LINE>super.onDataReceived(device, data);<NEW_LINE>if (data.size() < 4) {<NEW_LINE>onInvalidDataReceived(device, data);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int offset = 0;<NEW_LINE>final int flags = data.getIntValue(Data.FORMAT_UINT8, offset);<NEW_LINE>final boolean instantaneousStrideLengthPresent = (flags & 0x01) != 0;<NEW_LINE>final boolean totalDistancePresent = (flags & 0x02) != 0;<NEW_LINE>final boolean statusRunning = (flags & 0x04) != 0;<NEW_LINE>offset += 1;<NEW_LINE>// [m/s]<NEW_LINE>final float speed = data.getIntValue(Data.FORMAT_UINT16_LE, offset) / 256.f;<NEW_LINE>offset += 2;<NEW_LINE>final int cadence = data.getIntValue(Data.FORMAT_UINT8, offset);<NEW_LINE>offset += 1;<NEW_LINE>if (data.size() < 4 + (instantaneousStrideLengthPresent ? 2 : 0) + (totalDistancePresent ? 4 : 0)) {<NEW_LINE>onInvalidDataReceived(device, data);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Integer strideLength = null;<NEW_LINE>if (instantaneousStrideLengthPresent) {<NEW_LINE>strideLength = data.<MASK><NEW_LINE>offset += 2;<NEW_LINE>}<NEW_LINE>Long totalDistance = null;<NEW_LINE>if (totalDistancePresent) {<NEW_LINE>totalDistance = data.getLongValue(Data.FORMAT_UINT32_LE, offset);<NEW_LINE>// offset += 4;<NEW_LINE>}<NEW_LINE>onRSCMeasurementReceived(device, statusRunning, speed, cadence, strideLength, totalDistance);<NEW_LINE>} | getIntValue(Data.FORMAT_UINT16_LE, offset); |
1,471,834 | public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {<NEW_LINE>RequestMetricInfo requestMetric = getRequestMetric(requestContext);<NEW_LINE>if (requestMetric != null) {<NEW_LINE>String templatePath = (String) requestContext.getProperty("UrlPathTemplate");<NEW_LINE>String requestPath = requestMetric.getNormalizedUriPath(httpMetricsConfig.getClientMatchPatterns(), httpMetricsConfig.getClientIgnorePatterns(), templatePath == null ? requestContext.getUri().getPath() : templatePath);<NEW_LINE>if (requestPath != null) {<NEW_LINE>Timer.Sample sample = requestMetric.getSample();<NEW_LINE><MASK><NEW_LINE>Timer.Builder builder = Timer.builder(httpMetricsConfig.getHttpClientRequestsName()).tags(Tags.of(HttpCommonTags.method(requestContext.getMethod()), HttpCommonTags.uri(requestPath, statusCode), HttpCommonTags.outcome(statusCode), HttpCommonTags.status(statusCode), clientName(requestContext)));<NEW_LINE>sample.stop(builder.register(registry));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int statusCode = responseContext.getStatus(); |
1,569,661 | public Disposable loadImages(final View parentView, final Collection<Image> images) {<NEW_LINE>// Start with a fresh disposable because of this method can be called several times if the<NEW_LINE>// enclosing activity is stopped/restarted.<NEW_LINE>final CompositeDisposable disposables = new CompositeDisposable(new CancellableDisposable(this::removeAllViews));<NEW_LINE>imagesView = parentView.findViewById(R.id.spoiler_list);<NEW_LINE>imagesView.removeAllViews();<NEW_LINE>final HtmlImage imgGetter = new HtmlImage(geocode, true, false, false);<NEW_LINE>for (final Image img : images) {<NEW_LINE>final LinearLayout rowView = (LinearLayout) inflater.inflate(R.layout.cache_image_item, imagesView, false);<NEW_LINE>assert rowView != null;<NEW_LINE>if (StringUtils.isNotBlank(img.getTitle())) {<NEW_LINE>final TextView titleView = rowView.findViewById(R.id.title);<NEW_LINE>titleView.setText(HtmlCompat.fromHtml(img.getTitle(), HtmlCompat.FROM_HTML_MODE_LEGACY));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(img.getDescription())) {<NEW_LINE>final TextView descView = rowView.<MASK><NEW_LINE>descView.setText(HtmlCompat.fromHtml(img.getDescription(), HtmlCompat.FROM_HTML_MODE_LEGACY), TextView.BufferType.SPANNABLE);<NEW_LINE>descView.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>final RelativeLayout imageView = (RelativeLayout) inflater.inflate(R.layout.image_item, rowView, false);<NEW_LINE>assert imageView != null;<NEW_LINE>rowView.addView(imageView);<NEW_LINE>imagesView.addView(rowView);<NEW_LINE>disposables.add(AndroidRxUtils.bindActivity(activity, imgGetter.fetchDrawable(img.getUrl())).subscribe(image -> display(imageView, image, img, rowView)));<NEW_LINE>}<NEW_LINE>return disposables;<NEW_LINE>} | findViewById(R.id.description); |
1,232,237 | protected void bindImplementationSpecificMetrics(MeterRegistry registry) {<NEW_LINE>StatisticsGateway stats = getStats();<NEW_LINE>Gauge.builder("cache.remoteSize", stats, StatisticsGateway::getRemoteSize).tags(getTagsWithCacheName()).description<MASK><NEW_LINE>FunctionCounter.builder("cache.removals", stats, StatisticsGateway::cacheRemoveCount).tags(getTagsWithCacheName()).description("Cache removals").register(registry);<NEW_LINE>FunctionCounter.builder("cache.puts.added", stats, StatisticsGateway::cachePutAddedCount).tags(getTagsWithCacheName()).tags("result", "added").description("Cache puts resulting in a new key/value pair").register(registry);<NEW_LINE>FunctionCounter.builder("cache.puts.added", stats, StatisticsGateway::cachePutUpdatedCount).tags(getTagsWithCacheName()).tags("result", "updated").description("Cache puts resulting in an updated value").register(registry);<NEW_LINE>missMetrics(registry);<NEW_LINE>commitTransactionMetrics(registry);<NEW_LINE>rollbackTransactionMetrics(registry);<NEW_LINE>recoveryTransactionMetrics(registry);<NEW_LINE>Gauge.builder("cache.local.offheap.size", stats, StatisticsGateway::getLocalOffHeapSizeInBytes).tags(getTagsWithCacheName()).description("Local off-heap size").baseUnit(BaseUnits.BYTES).register(registry);<NEW_LINE>Gauge.builder("cache.local.heap.size", stats, StatisticsGateway::getLocalHeapSizeInBytes).tags(getTagsWithCacheName()).description("Local heap size").baseUnit(BaseUnits.BYTES).register(registry);<NEW_LINE>Gauge.builder("cache.local.disk.size", stats, StatisticsGateway::getLocalDiskSizeInBytes).tags(getTagsWithCacheName()).description("Local disk size").baseUnit(BaseUnits.BYTES).register(registry);<NEW_LINE>} | ("The number of entries held remotely in this cache").register(registry); |
243,062 | protected void popContextData() {<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.entering(CLASS_NAME, "popContextData", this);<NEW_LINE>}<NEW_LINE>// save off this thread's class loader and use the class loader of the thread that launch this thread.<NEW_LINE>this.originalCL = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ClassLoader run() {<NEW_LINE>ClassLoader old = Thread.currentThread().getContextClassLoader();<NEW_LINE>Thread.currentThread().setContextClassLoader(newCL);<NEW_LINE>return old;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.logp(Level.FINEST, CLASS_NAME, "popContextData", "old context class loader [" + this.originalCL + "] , new context class loader [" + newCL + "]");<NEW_LINE>}<NEW_LINE>if (this.contextData != null) {<NEW_LINE>// pop data for other components that we already have hooks into<NEW_LINE>ComponentMetaDataAccessorImpl cmdai = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor();<NEW_LINE>ComponentMetaData cmd = (ComponentMetaData) this.contextData.get(ComponentMetaData);<NEW_LINE>if (cmd != null) {<NEW_LINE>cmdai.beginContext(cmd);<NEW_LINE>}<NEW_LINE>// each producer service of the Transfer service is accessed in order to get the thread context data<NEW_LINE>Iterator<ITransferContextService> TransferIterator = com.ibm.ws.webcontainer.osgi.WebContainer.getITransferContextServices();<NEW_LINE>if (TransferIterator != null) {<NEW_LINE>while (TransferIterator.hasNext()) {<NEW_LINE>ITransferContextService tcs = TransferIterator.next();<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.logp(Level.FINEST, CLASS_NAME, "popContextData", "calling restoreState on: " + tcs);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINEST)) {<NEW_LINE>logger.exiting(CLASS_NAME, "popContextData", this);<NEW_LINE>}<NEW_LINE>} | tcs.restoreState(this.contextData); |
498,625 | private void capabilityObject(DesiredCapabilities desiredCapabilities, JSONObject platFormCapabilities, String key) {<NEW_LINE>String appCapability = "app";<NEW_LINE>if (appCapability.equals(key)) {<NEW_LINE>Object values = platFormCapabilities.get(appCapability);<NEW_LINE>List<HostArtifact> hostArtifacts = ArtifactsUploader.getInstance().getHostArtifacts();<NEW_LINE>String hostAppPath = hostAppPath(values, hostArtifacts);<NEW_LINE>if (AppiumDeviceManager.getAppiumDevice().getDevice().isCloud() || new UrlValidator().isValid(hostAppPath)) {<NEW_LINE>desiredCapabilities.setCapability(appCapability, hostAppPath);<NEW_LINE>} else {<NEW_LINE>Path path = FileSystems.getDefault().getPath(hostAppPath);<NEW_LINE>desiredCapabilities.setCapability(appCapability, path.normalize().<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>desiredCapabilities.setCapability(key, platFormCapabilities.get(key));<NEW_LINE>}<NEW_LINE>} | toAbsolutePath().toString()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.