idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
961,196 | private void copyHeaders(Map<String, Object> source, Map<String, Object> target, HeaderMatcher headerMatcher) {<NEW_LINE>if (!CollectionUtils.isEmpty(source)) {<NEW_LINE>for (Map.Entry<String, Object> entry : source.entrySet()) {<NEW_LINE>try {<NEW_LINE>String headerName = createTargetPropertyName(entry.getKey(), false);<NEW_LINE>if (shouldMapHeader(headerName, headerMatcher)) {<NEW_LINE>Object value = entry.getValue();<NEW_LINE>target.put(headerName, value);<NEW_LINE>if (this.replyHeaderMatcher.equals(headerMatcher) && JsonHeaders.TYPE_ID.equals(headerName) && value != null) {<NEW_LINE>ResolvableType resolvableType = createJsonResolvableTypHeaderInAny(value, source.get(JsonHeaders.CONTENT_TYPE_ID), source<MASK><NEW_LINE>if (resolvableType != null) {<NEW_LINE>target.put(JsonHeaders.RESOLVABLE_TYPE, resolvableType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (this.logger.isWarnEnabled()) {<NEW_LINE>this.logger.warn("error occurred while mapping header '" + entry.getKey() + "' to Message header", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .get(JsonHeaders.KEY_TYPE_ID)); |
1,156,016 | final GetCloudFrontOriginAccessIdentityResult executeGetCloudFrontOriginAccessIdentity(GetCloudFrontOriginAccessIdentityRequest getCloudFrontOriginAccessIdentityRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getCloudFrontOriginAccessIdentityRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetCloudFrontOriginAccessIdentityRequest> request = null;<NEW_LINE>Response<GetCloudFrontOriginAccessIdentityResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetCloudFrontOriginAccessIdentityRequestMarshaller().marshall(super.beforeMarshalling(getCloudFrontOriginAccessIdentityRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetCloudFrontOriginAccessIdentity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetCloudFrontOriginAccessIdentityResult> responseHandler = new StaxResponseHandler<GetCloudFrontOriginAccessIdentityResult>(new GetCloudFrontOriginAccessIdentityResultStaxUnmarshaller());<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); |
336,515 | private I_C_Invoice_Candidate createCand(final Properties ctx, final I_C_Flatrate_Term term, final I_C_Flatrate_DataEntry dataEntry, final int productId, final BigDecimal priceActual, final String trxName) {<NEW_LINE>final I_C_Invoice_Candidate newCand = InterfaceWrapperHelper.create(ctx, I_C_Invoice_Candidate.class, trxName);<NEW_LINE>Check.assume(newCand.getAD_Client_ID() == dataEntry.getAD_Client_ID(), "ctx contains the correct AD_Client_ID");<NEW_LINE>final OrgId orgId = OrgId.ofRepoId(dataEntry.getAD_Org_ID());<NEW_LINE>newCand.setAD_Org_ID(orgId.getRepoId());<NEW_LINE>final I_C_Flatrate_Conditions fc = term.getC_Flatrate_Conditions();<NEW_LINE>newCand.setM_PricingSystem_ID(fc.getM_PricingSystem_ID());<NEW_LINE>newCand.setM_Product_ID(productId);<NEW_LINE>newCand.setQtyOrdered(BigDecimal.ONE);<NEW_LINE>// to be computed<NEW_LINE>newCand.setQtyToInvoice(BigDecimal.ZERO);<NEW_LINE>newCand.setPriceActual(priceActual);<NEW_LINE>// 07090 when we set PiceActual, we shall also set PriceUOM.<NEW_LINE>newCand.setPrice_UOM_ID(term.getC_UOM_ID());<NEW_LINE>// cg : task 04917 -- same as price actual<NEW_LINE>newCand.setPriceEntered(priceActual);<NEW_LINE>newCand.setDiscount(BigDecimal.ZERO);<NEW_LINE>newCand.setInvoiceRule(fc.getInvoiceRule());<NEW_LINE>newCand.<MASK><NEW_LINE>InvoiceCandidateLocationAdapterFactory.billLocationAdapter(newCand).setFrom(ContractLocationHelper.extractBillLocation(term));<NEW_LINE>newCand.setDateOrdered(dataEntry.getC_Period().getEndDate());<NEW_LINE>newCand.setAD_Table_ID(adTableDAO.retrieveTableId(I_C_Flatrate_DataEntry.Table_Name));<NEW_LINE>newCand.setRecord_ID(dataEntry.getC_Flatrate_DataEntry_ID());<NEW_LINE>// 07442 activity and tax<NEW_LINE>final ActivityId activityId = findActivityIdOrNull(term, productId);<NEW_LINE>newCand.setC_Activity_ID(ActivityId.toRepoId(activityId));<NEW_LINE>newCand.setIsTaxIncluded(term.isTaxIncluded());<NEW_LINE>final TaxCategoryId taxCategoryId = TaxCategoryId.ofRepoIdOrNull(term.getC_TaxCategory_ID());<NEW_LINE>final BPartnerLocationAndCaptureId shipToLocationId = CoalesceUtil.coalesceSuppliers(() -> ContractLocationHelper.extractDropshipLocationId(term), () -> ContractLocationHelper.extractBillToLocationId(term));<NEW_LINE>final TaxId taxId = // shipDate<NEW_LINE>Services.get(ITaxBL.class).// shipDate<NEW_LINE>getTaxNotNull(// shipDate<NEW_LINE>term, // shipDate<NEW_LINE>taxCategoryId, // shipDate<NEW_LINE>productId, dataEntry.getDate_Reported(), orgId, null, shipToLocationId, SOTrx.SALES);<NEW_LINE>newCand.setC_Tax_ID(taxId.getRepoId());<NEW_LINE>setILCandHandler(ctx, newCand);<NEW_LINE>InterfaceWrapperHelper.save(newCand);<NEW_LINE>return newCand;<NEW_LINE>} | setC_Currency_ID(term.getC_Currency_ID()); |
535,151 | public AVBSFContext initVideoBitstreamFilter(AVCodecParameters codecParameters, AVRational timebase) {<NEW_LINE>AVBitStreamFilter bsfilter = av_bsf_get_by_name(bsfVideoName);<NEW_LINE>videoBsfFilterContext = new AVBSFContext(null);<NEW_LINE>int ret = av_bsf_alloc(bsfilter, videoBsfFilterContext);<NEW_LINE>if (ret < 0) {<NEW_LINE>logger.<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ret = avcodec_parameters_copy(videoBsfFilterContext.par_in(), codecParameters);<NEW_LINE>if (ret < 0) {<NEW_LINE>logger.info("cannot copy input codec parameters for {}", getOutputURL());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>videoBsfFilterContext.time_base_in(timebase);<NEW_LINE>ret = av_bsf_init(videoBsfFilterContext);<NEW_LINE>if (ret < 0) {<NEW_LINE>logger.info("cannot init bit stream filter context for {}", getOutputURL());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return videoBsfFilterContext;<NEW_LINE>} | info("cannot allocate bsf context for {}", getOutputURL()); |
1,532,353 | private void resolveExternalLibs(List<Program> programs, DomainFolder domainFolder, boolean saveIfModified, MessageLog messageLog, TaskMonitor monitor) throws CancelledException, IOException {<NEW_LINE>Map<String, Program> progsByName = programs.stream().filter(Objects::nonNull).collect(Collectors.toMap((p) -> p.getDomainFile().getName(), (p) -> p));<NEW_LINE>monitor.initialize(progsByName.size());<NEW_LINE>for (Program program : progsByName.values()) {<NEW_LINE>monitor.incrementProgress(1);<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ExternalManager extManager = program.getExternalManager();<NEW_LINE>String[] extLibNames = extManager.getExternalLibraryNames();<NEW_LINE>if (extLibNames.length == 0 || (extLibNames.length == 1 && Library.UNKNOWN.equals(extLibNames[0]))) {<NEW_LINE>// skip program if no libraries defined<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>monitor.setMessage("Resolving..." + program.getName());<NEW_LINE>int <MASK><NEW_LINE>try {<NEW_LINE>resolveExternalLibs(program, progsByName, domainFolder, monitor, messageLog);<NEW_LINE>} finally {<NEW_LINE>program.endTransaction(id, true);<NEW_LINE>if (saveIfModified && program.canSave() && program.isChanged()) {<NEW_LINE>program.save("Resolve external references", monitor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | id = program.startTransaction("resolving external references"); |
1,255,646 | private ListenableFuture<ExecutionResult> handleActionInfo(BuildRule rule, BuildStrategyContext strategyContext, RemoteExecutionActionInfo actionInfo, RemoteRuleContext guardContext) throws IOException {<NEW_LINE>Objects.requireNonNull(actionInfo);<NEW_LINE>// The actionInfo may be very large, so explicitly capture just the parts that we need and clear<NEW_LINE>// it (to hopefully catch future bad uses). actionInfo.getRequiredData() in particular may be<NEW_LINE>// very, very large.<NEW_LINE>Digest actionDigest = actionInfo.getActionDigest();<NEW_LINE>Iterable<? extends Path> actionOutputs = actionInfo.getOutputs();<NEW_LINE>if (guardContext.isCancelled()) {<NEW_LINE>throw new ActionCancelledException(guardContext.getCancelReason());<NEW_LINE>}<NEW_LINE>Scope uploadingInputsScope = guardContext.enterState(State.UPLOADING_ACTION, Optional.of(actionDigest));<NEW_LINE>ListenableFuture<Unit> inputsUploadedFuture = executionClients.getContentAddressedStorage().addMissing(actionInfo.getRequiredData());<NEW_LINE>inputsUploadedFuture.addListener(uploadingInputsScope::<MASK><NEW_LINE>return Futures.transformAsync(inputsUploadedFuture, ignored -> executeNowThatInputsAreReady(strategyContext, rule, guardContext, actionDigest, actionOutputs, rule.getFullyQualifiedName()), service);<NEW_LINE>} | close, MoreExecutors.directExecutor()); |
114,677 | public void updated(String pid, @SuppressWarnings("rawtypes") Dictionary properties) throws ConfigurationException {<NEW_LINE>if (pid == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>deleted(pid);<NEW_LINE>String url = (String) properties.get("url");<NEW_LINE>String name = (String) properties.get("name");<NEW_LINE>Matcher matcher = url == null ? null : Pattern.compile(url).matcher("");<NEW_LINE>String p = (String) properties.get("order");<NEW_LINE>int order = 50;<NEW_LINE>if (p != null) {<NEW_LINE>order = Integer.parseInt(p);<NEW_LINE>}<NEW_LINE>PidInfo info = new PidInfo(properties, matcher, order);<NEW_LINE><MASK><NEW_LINE>if (url != null) {<NEW_LINE>props.put(url, info);<NEW_LINE>}<NEW_LINE>if (name != null) {<NEW_LINE>props.put(name, info);<NEW_LINE>}<NEW_LINE>if (matcher != null) {<NEW_LINE>addToSortedInfos(info);<NEW_LINE>}<NEW_LINE>} | props.put(pid, info); |
1,202,776 | public void resourceChanged(IResourceChangeEvent event) {<NEW_LINE>IResourceDelta delta = event.getDelta();<NEW_LINE>if (delta == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IPath localPath = null;<NEW_LINE>IEditorInput input = getEditorInput();<NEW_LINE>if (input instanceof IPathEditorInput) {<NEW_LINE>localPath = ((<MASK><NEW_LINE>}<NEW_LINE>if (localPath == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>localPath = ContentUtils.convertPathToWorkspacePath(localPath);<NEW_LINE>if (localPath == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>delta = delta.findMember(localPath);<NEW_LINE>if (delta == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (delta.getKind() == IResourceDelta.CHANGED) {<NEW_LINE>// Refresh editor<NEW_LINE>UIUtils.asyncExec(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (manager != null) {<NEW_LINE>loadBinaryContent();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | IPathEditorInput) input).getPath(); |
1,533,916 | public ImportApiKeysResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ImportApiKeysResult importApiKeysResult = new ImportApiKeysResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return importApiKeysResult;<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("ids", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>importApiKeysResult.setIds(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("warnings", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>importApiKeysResult.setWarnings(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return importApiKeysResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,612,145 | private void captureFullSpeedInitialize(String channel, int samples, double timeGap, List<String> args, Integer interval) {<NEW_LINE>if (interval == null)<NEW_LINE>interval = 1000;<NEW_LINE>timeGap = (int) (timeGap * 8) / 8;<NEW_LINE>if (timeGap < 0.5)<NEW_LINE>timeGap = (int) (0.5 * 8) / 8;<NEW_LINE>if (samples > this.MAX_SAMPLES) {<NEW_LINE>Log.v(TAG, "Sample limit exceeded. 10,000 max");<NEW_LINE>samples = this.MAX_SAMPLES;<NEW_LINE>}<NEW_LINE>this.timebase = (int) (timeGap * 8) / 8;<NEW_LINE>this.samples = samples;<NEW_LINE>int CHOSA = this.<MASK><NEW_LINE>this.aChannels.get(0).setParams(channel, samples, this.timebase, 10, this.analogInputSources.get(channel), null);<NEW_LINE>this.channelsInBuffer = 1;<NEW_LINE>try {<NEW_LINE>mPacketHandler.sendByte(mCommandsProto.ADC);<NEW_LINE>if (args.contains("SET_LOW"))<NEW_LINE>mPacketHandler.sendByte(mCommandsProto.SET_LO_CAPTURE);<NEW_LINE>else if (args.contains("SET_HIGH"))<NEW_LINE>mPacketHandler.sendByte(mCommandsProto.SET_HI_CAPTURE);<NEW_LINE>else if (args.contains("FIRE_PULSES")) {<NEW_LINE>mPacketHandler.sendByte(mCommandsProto.PULSE_TRAIN);<NEW_LINE>Log.v(TAG, "Firing SQR1 pulses for " + interval + " uSec");<NEW_LINE>} else<NEW_LINE>mPacketHandler.sendByte(mCommandsProto.CAPTURE_DMASPEED);<NEW_LINE>mPacketHandler.sendByte(CHOSA);<NEW_LINE>mPacketHandler.sendInt(samples);<NEW_LINE>mPacketHandler.sendInt((int) timeGap * 8);<NEW_LINE>if (args.contains("FIRE_PULSES")) {<NEW_LINE>mPacketHandler.sendInt(interval);<NEW_LINE>Thread.sleep((long) (interval * 1e-6));<NEW_LINE>}<NEW_LINE>mPacketHandler.getAcknowledgement();<NEW_LINE>} catch (IOException | InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | analogInputSources.get(channel).CHOSA; |
215,090 | public synchronized void notifyHandshakeComplete() throws IOException {<NEW_LINE>super.notifyHandshakeComplete();<NEW_LINE>this.handshakeComplete = true;<NEW_LINE><MASK><NEW_LINE>if (null == sslSession || sslSession.getTlsSession() != connectionTlsSession) {<NEW_LINE>ProvSSLSessionContext sslSessionContext = manager.getContextData().getClientSessionContext();<NEW_LINE>String peerHost = manager.getPeerHost();<NEW_LINE>int peerPort = manager.getPeerPort();<NEW_LINE>JsseSessionParameters jsseSessionParameters = new JsseSessionParameters(sslParameters.getEndpointIdentificationAlgorithm(), null);<NEW_LINE>// TODO[tls13] Resumption/PSK<NEW_LINE>boolean addToCache = provClientEnableSessionResumption && !TlsUtils.isTLSv13(context);<NEW_LINE>this.sslSession = sslSessionContext.reportSession(peerHost, peerPort, connectionTlsSession, jsseSessionParameters, addToCache);<NEW_LINE>}<NEW_LINE>manager.notifyHandshakeComplete(new ProvSSLConnection(context, sslSession));<NEW_LINE>} | TlsSession connectionTlsSession = context.getSession(); |
777,276 | private TableFilter readDerivedTableWithCorrelation() {<NEW_LINE>Query query = parseQueryExpression();<NEW_LINE>read(CLOSE_PAREN);<NEW_LINE>Table table;<NEW_LINE>String alias;<NEW_LINE>ArrayList<String> derivedColumnNames = null;<NEW_LINE>IndexHints indexHints = null;<NEW_LINE>if (readIfUseIndex()) {<NEW_LINE>alias = session.getNextSystemIdentifier(sqlCommand);<NEW_LINE>table = query.toTable(alias, null, parameters, createView != null, currentSelect);<NEW_LINE>indexHints = parseIndexHints(table);<NEW_LINE>} else {<NEW_LINE>alias = readFromAlias(null);<NEW_LINE>if (alias != null) {<NEW_LINE>derivedColumnNames = readDerivedColumnNames();<NEW_LINE>Column[] columnTemplates = null;<NEW_LINE>if (derivedColumnNames != null) {<NEW_LINE>query.init();<NEW_LINE>columnTemplates = QueryExpressionTable.createQueryColumnTemplateList(derivedColumnNames.toArray(new String[0]), query, new String[1]).toArray(new Column[0]);<NEW_LINE>}<NEW_LINE>table = query.toTable(alias, columnTemplates, parameters, createView != null, currentSelect);<NEW_LINE>if (readIfUseIndex()) {<NEW_LINE>indexHints = parseIndexHints(table);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>table = query.toTable(alias, null, parameters, createView != null, currentSelect);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buildTableFilter(table, alias, derivedColumnNames, indexHints);<NEW_LINE>} | alias = session.getNextSystemIdentifier(sqlCommand); |
263,382 | protected Number run(AbstractEmulator<?> emulator) {<NEW_LINE>Backend backend = emulator.getBackend();<NEW_LINE>if (action.needSigInfo() && infoBlock == null) {<NEW_LINE>infoBlock = emulator.getMemory().malloc(128, true);<NEW_LINE>infoBlock.getPointer().setInt(0, signum);<NEW_LINE>}<NEW_LINE>UnidbgPointer stack = allocateStack(emulator);<NEW_LINE>if (emulator.is32Bit()) {<NEW_LINE>backend.reg_write(ArmConst.UC_ARM_REG_SP, stack.peer);<NEW_LINE>backend.reg_write(ArmConst.UC_ARM_REG_R0, signum);<NEW_LINE>// siginfo_t *info<NEW_LINE>backend.reg_write(ArmConst.UC_ARM_REG_R1, infoBlock == null ? 0 : <MASK><NEW_LINE>// void *ucontext<NEW_LINE>backend.reg_write(ArmConst.UC_ARM_REG_R2, 0);<NEW_LINE>backend.reg_write(ArmConst.UC_ARM_REG_LR, until);<NEW_LINE>} else {<NEW_LINE>backend.reg_write(Arm64Const.UC_ARM64_REG_SP, stack.peer);<NEW_LINE>backend.reg_write(Arm64Const.UC_ARM64_REG_X0, signum);<NEW_LINE>// siginfo_t *info<NEW_LINE>backend.reg_write(Arm64Const.UC_ARM64_REG_X1, infoBlock == null ? 0 : infoBlock.getPointer().peer);<NEW_LINE>// void *ucontext<NEW_LINE>backend.reg_write(Arm64Const.UC_ARM64_REG_X2, 0);<NEW_LINE>backend.reg_write(Arm64Const.UC_ARM64_REG_LR, until);<NEW_LINE>}<NEW_LINE>return emulator.emulate(action.getSaHandler(), until);<NEW_LINE>} | infoBlock.getPointer().peer); |
714,006 | // completeIt<NEW_LINE>private void createDropShip() {<NEW_LINE>// Create movement delivery<NEW_LINE>Date date = Date.from(LocalDate.now().atStartOfDay().atZone(ZoneId.systemDefault()).toInstant());<NEW_LINE>Timestamp today = new Timestamp(date.getTime());<NEW_LINE>List<Integer> recordIds = new ArrayList<>();<NEW_LINE>recordIds.add(getDD_Order_ID());<NEW_LINE>ProcessInfo processInfo = ProcessBuilder.create(getCtx()).process(GenerateMovement.getProcessId()).withTitle(GenerateMovement.getProcessName()).withRecordId(MDDOrder.Table_ID, 0).withSelectedRecordsIds(MDDOrder.Table_ID, recordIds).withParameter(MMovement.COLUMNNAME_MovementDate, today).withParameter(MMovement.COLUMNNAME_DocAction, DocAction.ACTION_Complete).withoutTransactionClose().execute(get_TrxName());<NEW_LINE>if (processInfo.isError())<NEW_LINE>throw new AdempiereException(processInfo.getSummary());<NEW_LINE>List<Integer> <MASK><NEW_LINE>LinkedHashMap<Integer, LinkedHashMap<String, Object>> selection = new LinkedHashMap<Integer, LinkedHashMap<String, Object>>();<NEW_LINE>getLines().stream().filter(orderLine -> orderLine != null).forEach(orderLine -> {<NEW_LINE>orderLinesIds.add(orderLine.get_ID());<NEW_LINE>LinkedHashMap<String, Object> values = new LinkedHashMap<String, Object>();<NEW_LINE>values.put("LINE_" + MDDOrderLine.COLUMNNAME_QtyInTransit, orderLine.getQtyInTransit());<NEW_LINE>selection.put(orderLine.get_ID(), values);<NEW_LINE>});<NEW_LINE>processInfo = ProcessBuilder.create(getCtx()).process(GenerateMovementMaterial.getProcessId()).withTitle(GenerateMovementMaterial.getProcessName()).withRecordId(MDDOrderLine.Table_ID, 0).withSelectedRecordsIds(MDDOrderLine.Table_ID, orderLinesIds, selection).withParameter(MMovement.COLUMNNAME_MovementDate, today).withoutTransactionClose().execute(get_TrxName());<NEW_LINE>if (processInfo.isError())<NEW_LINE>throw new AdempiereException(processInfo.getSummary());<NEW_LINE>} | orderLinesIds = new ArrayList<>(); |
1,397,438 | protected boolean put(K key, @Nullable V value) {<NEW_LINE>if (key == null)<NEW_LINE>return false;<NEW_LINE>int i = indexOfExistingKey(state(), key);<NEW_LINE>if (i == -1 && factory.maxDynamicEntries == 0) {<NEW_LINE>Platform.get().log("Ignoring request to add a dynamic key", null);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>synchronized (lock) {<NEW_LINE>Object[] prior = state();<NEW_LINE>// double-check lost race in dynamic case<NEW_LINE>if (i == -1)<NEW_LINE>i = indexOfDynamicKey(prior, key);<NEW_LINE>if (i == -1)<NEW_LINE>return <MASK><NEW_LINE>if (equal(value, prior[i + 1]))<NEW_LINE>return false;<NEW_LINE>// copy-on-write<NEW_LINE>Object[] newState = Arrays.copyOf(prior, prior.length);<NEW_LINE>newState[i + 1] = value;<NEW_LINE>this.state = newState;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} | addNewEntry(prior, key, value); |
654,155 | private void createWrap(TypeElement source, String fqn, List<Tree> members) throws IllegalStateException {<NEW_LINE>Set<Modifier> mods = EnumSet.of(Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL);<NEW_LINE>final String name = decapitalize(source.getSimpleName());<NEW_LINE>// NOI18N<NEW_LINE>List<VariableTree> params = Collections.singletonList(make.Variable(make.Modifiers(EnumSet.noneOf(Modifier.class)), name, make.QualIdent(source), null));<NEW_LINE>// NOI18N<NEW_LINE>String bodyText = preparePattern(workingCopy, source.asType(), WRAP_PATTERNS, name, source.getSimpleName().toString(), fqn);<NEW_LINE>SourcePositions[] positions = new SourcePositions[1];<NEW_LINE>StatementTree body = workingCopy.getTreeUtilities(<MASK><NEW_LINE>ModifiersTree modifiers = prepareModifiers(workingCopy, mods, make, false);<NEW_LINE>// NOI18N<NEW_LINE>MethodTree wrap = make.Method(modifiers, "wrap", make.ArrayType(make.QualIdent(fqn)), Collections.<TypeParameterTree>emptyList(), params, Collections.<ExpressionTree>emptyList(), (BlockTree) body, null, true);<NEW_LINE>members.add(wrap);<NEW_LINE>} | ).parseStatement(bodyText, positions); |
414,256 | private Mono<Response<Void>> deleteHybridConnectionWithResponseAsync(String resourceGroupName, String name, String namespaceName, String relayName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.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 (namespaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (relayName == null) {<NEW_LINE>return Mono.<MASK><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.deleteHybridConnection(this.client.getEndpoint(), resourceGroupName, name, namespaceName, relayName, this.client.getSubscriptionId(), this.client.getApiVersion(), context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter relayName is required and cannot be null.")); |
1,041,508 | private StackFrame computeDapStackFrame() {<NEW_LINE>try {<NEW_LINE>if (!isBalStackFrame(jStackFrame.getStackFrame())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StackFrame dapStackFrame = new StackFrame();<NEW_LINE>dapStackFrame.setId(frameId);<NEW_LINE>dapStackFrame.setName(getStackFrameName(jStackFrame));<NEW_LINE>dapStackFrame.setLine(jStackFrame.location().lineNumber());<NEW_LINE>dapStackFrame.setColumn(0);<NEW_LINE>Optional<Map.Entry<Path, DebugSourceType>> sourcePathAndType = PackageUtils.getStackFrameSourcePath(jStackFrame.location(), context.getSourceProject());<NEW_LINE>if (sourcePathAndType.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Path frameLocationPath = sourcePathAndType.get().getKey();<NEW_LINE>DebugSourceType sourceType = sourcePathAndType.get().getValue();<NEW_LINE>Source source = new Source();<NEW_LINE>source.setName(jStackFrame.location().sourceName());<NEW_LINE>URI uri = frameLocationPath.toAbsolutePath().toUri();<NEW_LINE>// If the corresponding source file of the stack frame is a bala source, the source should be readonly in<NEW_LINE>// the editor side. Therefore adds a custom URI scheme to the file path, after verifying that the connected<NEW_LINE>// debug client support custom URI schemes.<NEW_LINE>Optional<ClientConfigHolder.ExtendedClientCapabilities> capabilities = context.getAdapter().getClientConfigHolder().getExtendedCapabilities();<NEW_LINE>boolean supportsReadOnlyEditors = capabilities.isPresent() && capabilities<MASK><NEW_LINE>if (supportsReadOnlyEditors && sourceType == DebugSourceType.DEPENDENCY) {<NEW_LINE>// Note: Since we are using a Ballerina-specific custom URI scheme, the future DAP client<NEW_LINE>// implementations may have to implement custom editor providers in order to support URIs coming<NEW_LINE>// from the debug server.<NEW_LINE>source.setPath(PackageUtils.covertToBalaUri(uri).toString());<NEW_LINE>} else {<NEW_LINE>source.setPath(uri.toString());<NEW_LINE>}<NEW_LINE>dapStackFrame.setSource(source);<NEW_LINE>return dapStackFrame;<NEW_LINE>} catch (Exception e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | .get().supportsReadOnlyEditors(); |
863,420 | private static boolean collectArrayProperty(Node arrayLiteral, Node propertyCandidate) {<NEW_LINE>Node assignment = propertyCandidate.getFirstChild();<NEW_LINE>final int sizeOfArrayAtStart = arrayLiteral.getChildCount();<NEW_LINE>int maxIndexAssigned = sizeOfArrayAtStart - 1;<NEW_LINE><MASK><NEW_LINE>Node rhs = lhs.getNext();<NEW_LINE>if (!lhs.isGetElem()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Node obj = lhs.getFirstChild();<NEW_LINE>Node property = obj.getNext();<NEW_LINE>// The left hand side must have a numeric index<NEW_LINE>if (!property.isNumber()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// that is a valid array index<NEW_LINE>double dindex = property.getDouble();<NEW_LINE>if (// Handles NaN and negatives.<NEW_LINE>!(dindex >= 0) || Double.isInfinite(dindex) || dindex > 0x7fffffffL) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int index = (int) dindex;<NEW_LINE>if (dindex != index) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// that would not make the array so sparse that they take more space<NEW_LINE>// when rendered than x[9]=1.<NEW_LINE>if (maxIndexAssigned + 4 < index) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (index > maxIndexAssigned) {<NEW_LINE>while (maxIndexAssigned < index - 1) {<NEW_LINE>// Pad the array if it is sparse.<NEW_LINE>// So if array is [0] and integer 3 is assigned at index is 2, then<NEW_LINE>// we want to produce [0,,2].<NEW_LINE>Node emptyNode = IR.empty().srcref(arrayLiteral);<NEW_LINE>arrayLiteral.addChildToBack(emptyNode);<NEW_LINE>++maxIndexAssigned;<NEW_LINE>}<NEW_LINE>arrayLiteral.addChildToBack(rhs.detach());<NEW_LINE>} else {<NEW_LINE>// An out of order assignment. Allow it if it's a hole.<NEW_LINE>Node currentValue = arrayLiteral.getChildAtIndex(index);<NEW_LINE>if (!currentValue.isEmpty()) {<NEW_LINE>// We've already collected a value for this index.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>currentValue.replaceWith(rhs.detach());<NEW_LINE>}<NEW_LINE>propertyCandidate.detach();<NEW_LINE>return true;<NEW_LINE>} | Node lhs = assignment.getFirstChild(); |
971,919 | public void exitAdvertise_map_bgp_tail(Advertise_map_bgp_tailContext ctx) {<NEW_LINE>// TODO: https://github.com/batfish/batfish/issues/1836<NEW_LINE>warn(ctx, "BGP advertise-map is not currently supported");<NEW_LINE>String advertiseMapName = ctx.am_name.getText();<NEW_LINE>_configuration.referenceStructure(ROUTE_MAP, advertiseMapName, BGP_ROUTE_MAP_ADVERTISE, ctx.am_name.getStart().getLine());<NEW_LINE>if (ctx.em_name != null) {<NEW_LINE>warn(ctx, "BGP exist-map is not currently supported");<NEW_LINE>String existMapName = ctx.em_name.getText();<NEW_LINE>_configuration.referenceStructure(ROUTE_MAP, existMapName, BGP_ADVERTISE_MAP_EXIST_MAP, ctx.em_name.<MASK><NEW_LINE>}<NEW_LINE>} | getStart().getLine()); |
990,533 | private void addDemoView(LayoutInflater layoutInflater, ViewGroup demoContainer, Demo demo, boolean isAdditional) {<NEW_LINE>View demoView = layoutInflater.inflate(R.layout.cat_demo_landing_row, demoContainer, false);<NEW_LINE>View rootView = demoView.findViewById(R.id.cat_demo_landing_row_root);<NEW_LINE>TextView titleTextView = demoView.findViewById(R.id.cat_demo_landing_row_title);<NEW_LINE>TextView subtitleTextView = demoView.findViewById(R.id.cat_demo_landing_row_subtitle);<NEW_LINE>String transitionName = getString(demo.getTitleResId());<NEW_LINE><MASK><NEW_LINE>rootView.setOnClickListener(v -> startDemo(v, demo, transitionName));<NEW_LINE>titleTextView.setText(demo.getTitleResId());<NEW_LINE>subtitleTextView.setText(getDemoClassName(demo));<NEW_LINE>if (isAdditional) {<NEW_LINE>setMarginStart(titleTextView, R.dimen.cat_list_text_margin_from_icon_large);<NEW_LINE>setMarginStart(subtitleTextView, R.dimen.cat_list_text_margin_from_icon_large);<NEW_LINE>}<NEW_LINE>demoContainer.addView(demoView);<NEW_LINE>} | ViewCompat.setTransitionName(rootView, transitionName); |
1,577,204 | public void measure(BaseDanmaku danmaku, TextPaint paint, boolean fromWorkerThread) {<NEW_LINE>if (danmaku.text instanceof Spanned) {<NEW_LINE>CharSequence text = danmaku.text;<NEW_LINE>if (text != null) {<NEW_LINE>StaticLayout staticLayout = new StaticLayout(text, paint, (int) Math.ceil(StaticLayout.getDesiredWidth(danmaku.text, paint)), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, true);<NEW_LINE>danmaku<MASK><NEW_LINE>danmaku.paintHeight = staticLayout.getHeight();<NEW_LINE>danmaku.obj = new SoftReference<>(staticLayout);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.measure(danmaku, paint, fromWorkerThread);<NEW_LINE>} | .paintWidth = staticLayout.getWidth(); |
1,549,516 | private Object decodeExtended(Channel channel, SocketAddress remoteAddress, String sentence) {<NEW_LINE>Parser parser = new Parser(PATTERN_EXTENDED, sentence);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.setValid(!parser.next().equals("L"));<NEW_LINE>position.setTime(parser.nextDateTime());<NEW_LINE>position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG_MIN));<NEW_LINE>position.setLongitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG_MIN));<NEW_LINE>position.setSpeed(UnitsConverter.knotsFromKph(parser.nextInt()));<NEW_LINE>position.setCourse(parser.nextInt());<NEW_LINE>position.set(Position.PREFIX_TEMP + <MASK><NEW_LINE>position.set(Position.KEY_FUEL_LEVEL, parser.nextInt());<NEW_LINE>position.set(Position.KEY_SATELLITES, parser.nextInt());<NEW_LINE>position.set(Position.KEY_RSSI, parser.nextInt());<NEW_LINE>position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000);<NEW_LINE>position.set(Position.KEY_DRIVER_UNIQUE_ID, parser.next());<NEW_LINE>position.set(Position.KEY_STATUS, parser.nextHexLong());<NEW_LINE>position.set(Position.KEY_EVENT, parser.nextInt());<NEW_LINE>return position;<NEW_LINE>} | 1, parser.next()); |
482,641 | public static void addBranchToCurrentBlock(Blk currentBlock, String jumpSiteAddress, String gotoAddress) {<NEW_LINE>int artificialJmpIndex = 1;<NEW_LINE>if (currentBlock.getDefs().size() > 0) {<NEW_LINE>artificialJmpIndex = currentBlock.getDefs().get(currentBlock.getDefs().size() - 1).getTerm<MASK><NEW_LINE>}<NEW_LINE>Tid jmpTid = new Tid(String.format("instr_%s_%s", jumpSiteAddress, artificialJmpIndex), jumpSiteAddress);<NEW_LINE>Tid gotoTid = new Tid(String.format("blk_%s", gotoAddress), gotoAddress);<NEW_LINE>currentBlock.addJmp(new Term<Jmp>(jmpTid, new Jmp(ExecutionType.JmpType.GOTO, "BRANCH", new Label((Tid) gotoTid), artificialJmpIndex)));<NEW_LINE>} | ().getPcodeIndex() + 1; |
12,878 | final CreateOrganizationResult executeCreateOrganization(CreateOrganizationRequest createOrganizationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createOrganizationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateOrganizationRequest> request = null;<NEW_LINE>Response<CreateOrganizationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateOrganizationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createOrganizationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateOrganization");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateOrganizationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateOrganizationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,816,596 | public void visit(NodeTraversal t, Node n, Node parent) {<NEW_LINE>if (!n.isName()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Scope scope = t.getScope();<NEW_LINE>if (!NodeUtil.isLValue(n) || scope.getClosestHoistScope().isModuleScope()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Export> exports = exportsByLocalName.get(n.getString());<NEW_LINE>if (exports.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Var var = scope.getVar(n.getString());<NEW_LINE>// A var declared in the module scope with the same name as an export must be the<NEW_LINE>// export. And we know we're setting it in a function scope, so this cannot be the<NEW_LINE>// declaration itself. We must be mutating.<NEW_LINE>if (var == null || !var.getScope().isModuleScope()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Export e : new ArrayList<>(exports)) {<NEW_LINE>int i = this.exports.indexOf(e);<NEW_LINE><MASK><NEW_LINE>this.exports.set(i, mutated);<NEW_LINE>exportsByLocalName.remove(e.localName(), e);<NEW_LINE>exportsByLocalName.put(e.localName(), mutated);<NEW_LINE>}<NEW_LINE>} | Export mutated = e.mutatedCopy(); |
64,082 | public void validateAndInsertVersionedInputs(Handle handle, String runId, VersioningEntry versioningEntry, Map<String, Map.Entry<BlobExpanded, String>> locationBlobWithHashMap) {<NEW_LINE>if (versioningEntry == null) {<NEW_LINE>throw new InvalidArgumentException("VersionedInput not found in request");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>locationBlobWithHashMap = validateVersioningEntity(versioningEntry).get();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (ex.getCause() != null && ex.getCause().getCause() != null) {<NEW_LINE>throw (ModelDBException) ex<MASK><NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>// Insert version input for run in versioning_modeldb_entity_mapping mapping table<NEW_LINE>insertVersioningInput(handle, versioningEntry, locationBlobWithHashMap, runId);<NEW_LINE>// Insert config blob and version input mapping in<NEW_LINE>// versioning_modeldb_entity_mapping_config_blob mapping table<NEW_LINE>insertVersioningInputMappingConfigBlob(handle, versioningEntry, locationBlobWithHashMap, runId);<NEW_LINE>// Insert hyperparameter element and run mapping in<NEW_LINE>// hyperparameter_element_mapping table<NEW_LINE>insertHyperparameterElementMapping(handle, versioningEntry, locationBlobWithHashMap, runId);<NEW_LINE>}<NEW_LINE>} | .getCause().getCause(); |
1,154,632 | public String convertStatement(String oraStatement) {<NEW_LINE>String[] retValue = m_convert.convert(oraStatement);<NEW_LINE>// Valid null<NEW_LINE>if (retValue == null) {<NEW_LINE>log.log(Level.SEVERE, ("DB_MariaDB.convertStatement - Not Converted (" + oraStatement + ") - " + m_convert.getConversionError()));<NEW_LINE>throw new IllegalArgumentException("DB_MariaDB.convertStatement - Not Converted (" + oraStatement + ") - " + m_convert.getConversionError());<NEW_LINE>}<NEW_LINE>if (retValue.length == 0)<NEW_LINE>return oraStatement;<NEW_LINE>//<NEW_LINE>if (retValue.length != 1) {<NEW_LINE>log.log(Level.SEVERE, ("DB_MariaDB.convertStatement - Convert Command Number=" + retValue.length + " (" + oraStatement + ") - " + m_convert.getConversionError()));<NEW_LINE>throw new IllegalArgumentException("DB_MariaDB.convertStatement - Convert Command Number=" + retValue.length + " (" + oraStatement + ") - " + m_convert.getConversionError());<NEW_LINE>}<NEW_LINE>// Diagnostics (show changed, but not if AD_Error<NEW_LINE>if (!oraStatement.equals(retValue[0]) && retValue[0].indexOf("AD_Error") == -1)<NEW_LINE>// System.out.println("PostgreSQL =>" + retValue[0] + "<= <" + oraStatement + ">");<NEW_LINE>log.log(Level.ALL, "MariaDB =>" + retValue[0<MASK><NEW_LINE>//<NEW_LINE>Convert.logMigrationScript(oraStatement, null, retValue[0]);<NEW_LINE>return retValue[0];<NEW_LINE>} | ] + "<= <" + oraStatement + ">"); |
1,550,434 | /* ITANKCONTAINER */<NEW_LINE>@Override<NEW_LINE>public int fill(EnumFacing from, FluidStack resource, boolean doFill) {<NEW_LINE>if (isNotReady())<NEW_LINE>return 0;<NEW_LINE>if (resource == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>FluidStack resourceCopy = resource.copy();<NEW_LINE>int totalUsed = 0;<NEW_LINE>TileTank tankToFill = getBottomTank();<NEW_LINE>FluidStack liquid <MASK><NEW_LINE>if (liquid != null && liquid.amount > 0 && !liquid.isFluidEqual(resourceCopy)) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>int oldComparator = getComparatorInputOverride();<NEW_LINE>while (tankToFill != null && resourceCopy.amount > 0) {<NEW_LINE>int used = tankToFill.tank.fill(resourceCopy, doFill);<NEW_LINE>resourceCopy.amount -= used;<NEW_LINE>if (used > 0) {<NEW_LINE>tankToFill.hasNetworkUpdate = true;<NEW_LINE>}<NEW_LINE>totalUsed += used;<NEW_LINE>tankToFill = getTankAbove(tankToFill);<NEW_LINE>}<NEW_LINE>if (oldComparator != calculateComparatorInputOverride()) {<NEW_LINE>updateComparators();<NEW_LINE>}<NEW_LINE>return totalUsed;<NEW_LINE>} | = tankToFill.tank.getFluid(); |
946,375 | public HistoryRecordEntry unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>HistoryRecordEntry historyRecordEntry = new HistoryRecordEntry();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return historyRecordEntry;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("eventInformation", targetDepth)) {<NEW_LINE>historyRecordEntry.setEventInformation(EventInformationStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("eventType", targetDepth)) {<NEW_LINE>historyRecordEntry.setEventType(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("timestamp", targetDepth)) {<NEW_LINE>historyRecordEntry.setTimestamp(DateStaxUnmarshallerFactory.getInstance(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return historyRecordEntry;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "iso8601").unmarshall(context)); |
1,016,290 | public void print(DebugContext debug, Graph graph, Map<Object, Object> properties, int id, String format, Object... args) throws IOException {<NEW_LINE>if (graph instanceof StructuredGraph) {<NEW_LINE>OptionValues options = graph.getOptions();<NEW_LINE>StructuredGraph structuredGraph = (StructuredGraph) graph;<NEW_LINE>String outDirectory = getDirectory(debug, structuredGraph);<NEW_LINE>String title = String.format("%03d-%s.txt", id, String.format(<MASK><NEW_LINE>String filePath = PathUtilities.getPath(outDirectory, PathUtilities.sanitizeFileName(title));<NEW_LINE>try (PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(PathUtilities.openOutputStream(filePath))))) {<NEW_LINE>switch(PrintCanonicalGraphStringFlavor.getValue(options)) {<NEW_LINE>case 1:<NEW_LINE>writeCanonicalExpressionCFGString(structuredGraph, CanonicalGraphStringsCheckConstants.getValue(options), CanonicalGraphStringsRemoveIdentities.getValue(options), writer);<NEW_LINE>break;<NEW_LINE>case 0:<NEW_LINE>default:<NEW_LINE>writeCanonicalGraphString(structuredGraph, CanonicalGraphStringsExcludeVirtuals.getValue(options), CanonicalGraphStringsCheckConstants.getValue(options), writer);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | format, simplifyClassArgs(args))); |
1,254,002 | private void registerOrReplaceActionInner(@Nonnull SimpleXmlElement element, @Nonnull String id, @Nonnull AnAction action, @Nullable PluginId pluginId) {<NEW_LINE>synchronized (myLock) {<NEW_LINE>if (Boolean.parseBoolean(element.getAttributeValue(OVERRIDES_ATTR_NAME))) {<NEW_LINE>if (getActionOrStub(id) == null) {<NEW_LINE>LOG.error(element.getName() + " '" + id + "' doesn't override anything");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AnAction prev = <MASK><NEW_LINE>if (action instanceof DefaultActionGroup && prev instanceof DefaultActionGroup) {<NEW_LINE>if (Boolean.parseBoolean(element.getAttributeValue(KEEP_CONTENT_ATTR_NAME))) {<NEW_LINE>((DefaultActionGroup) action).copyFromGroup((DefaultActionGroup) prev);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>registerAction(id, action, pluginId, element.getAttributeValue(PROJECT_TYPE));<NEW_LINE>}<NEW_LINE>// ActionsCollectorImpl.onActionLoadedFromXml(action, id, pluginId);<NEW_LINE>}<NEW_LINE>} | replaceAction(id, action, pluginId); |
396,600 | public void publishAvatar(Account account, final Avatar avatar, final Bundle options, final boolean retry, final OnAvatarPublication callback) {<NEW_LINE>Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": publishing avatar. options=" + options);<NEW_LINE>IqPacket packet = this.mIqGenerator.publishAvatar(avatar, options);<NEW_LINE>this.sendIqPacket(account, packet, new OnIqPacketReceived() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onIqPacketReceived(Account account, IqPacket result) {<NEW_LINE>if (result.getType() == IqPacket.TYPE.RESULT) {<NEW_LINE>publishAvatarMetadata(account, avatar, options, true, callback);<NEW_LINE>} else if (retry && PublishOptions.preconditionNotMet(result)) {<NEW_LINE>pushNodeConfiguration(account, "urn:xmpp:avatar:data", options, new OnConfigurationPushed() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPushSucceeded() {<NEW_LINE>Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": changed node configuration for avatar node");<NEW_LINE>publishAvatar(account, avatar, options, false, callback);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPushFailed() {<NEW_LINE>Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": unable to change node configuration for avatar node");<NEW_LINE>publishAvatar(account, avatar, null, false, callback);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>Element <MASK><NEW_LINE>Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": server rejected avatar " + (avatar.size / 1024) + "KiB " + (error != null ? error.toString() : ""));<NEW_LINE>if (callback != null) {<NEW_LINE>callback.onAvatarPublicationFailed(R.string.error_publish_avatar_server_reject);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | error = result.findChild("error"); |
811,313 | private static void assign(StarlarkThread.Frame fr, Expression lhs, Object value) throws EvalException, InterruptedException {<NEW_LINE>if (lhs instanceof Identifier) {<NEW_LINE>// x = ...<NEW_LINE>assignIdentifier(fr, (Identifier) lhs, value);<NEW_LINE>} else if (lhs instanceof IndexExpression) {<NEW_LINE>// x[i] = ...<NEW_LINE>Object object = eval(fr, ((IndexExpression) lhs).getObject());<NEW_LINE>Object key = eval(fr, ((IndexExpression<MASK><NEW_LINE>EvalUtils.setIndex(object, key, value);<NEW_LINE>} else if (lhs instanceof ListExpression) {<NEW_LINE>// a, b, c = ...<NEW_LINE>ListExpression list = (ListExpression) lhs;<NEW_LINE>assignSequence(fr, list.getElements(), value);<NEW_LINE>} else if (lhs instanceof DotExpression) {<NEW_LINE>// x.f = ...<NEW_LINE>DotExpression dot = (DotExpression) lhs;<NEW_LINE>Object object = eval(fr, dot.getObject());<NEW_LINE>String field = dot.getField().getName();<NEW_LINE>try {<NEW_LINE>EvalUtils.setField(object, field, value);<NEW_LINE>} catch (EvalException ex) {<NEW_LINE>fr.setErrorLocation(dot.getDotLocation());<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Not possible for resolved ASTs.<NEW_LINE>throw Starlark.errorf("cannot assign to '%s'", lhs);<NEW_LINE>}<NEW_LINE>} | ) lhs).getKey()); |
1,245,910 | public static void onBlockHarvest(HarvestDropsEvent event) {<NEW_LINE>if ((!ZooConfig.direSlimeEnabled.get() && !ZooConfig.direSlimeEnabledHand.get()) || event.isCanceled() || event.getWorld() == null || event.getWorld().isRemote || event.getHarvester() == null || event.getHarvester().capabilities.isCreativeMode || !(event.getState().getBlock() instanceof BlockDirt || event.getState().getBlock() instanceof BlockGrass)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!isToolEffective(event.getState(), event.getHarvester().getHeldItemMainhand()) && event.getWorld().rand.nextFloat() < ZooConfig.direSlime1Chance.get()) {<NEW_LINE>EntityDireSlime direSlime = new EntityDireSlime(event.getWorld());<NEW_LINE>direSlime.setPosition(event.getPos().getX() + 0.5, event.getPos().getY() + 0.0, event.getPos().getZ() + 0.5);<NEW_LINE>event.getWorld().spawnEntity(direSlime);<NEW_LINE>direSlime.playLivingSound();<NEW_LINE>for (ItemStack drop : event.getDrops()) {<NEW_LINE>if (drop != null && drop.getItem() == Item.getItemFromBlock(Blocks.DIRT)) {<NEW_LINE>if (drop.getCount() > 1) {<NEW_LINE>drop.shrink(1);<NEW_LINE>} else if (event.getDrops().size() == 1) {<NEW_LINE>event.getDrops().clear();<NEW_LINE>} else {<NEW_LINE>event.<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getDrops().remove(drop); |
1,515,301 | public void validate(HttpAction action) {<NEW_LINE>// HttpServletRequest request = action.getRequest();<NEW_LINE>if (HttpNames.METHOD_OPTIONS.equals(action.getRequestMethod()))<NEW_LINE>return;<NEW_LINE>if (!HttpNames.METHOD_POST.equalsIgnoreCase(action.getRequestMethod()))<NEW_LINE>ServletOps.errorMethodNotAllowed("SPARQL Update : use POST");<NEW_LINE>ContentType ct = ActionLib.getContentType(action);<NEW_LINE>if (ct == null)<NEW_LINE>ct = ctSPARQLUpdate;<NEW_LINE>if (matchContentType(ctSPARQLUpdate, ct)) {<NEW_LINE>String charset = action.getRequestCharacterEncoding();<NEW_LINE>if (charset != null && !charset.equalsIgnoreCase(charsetUTF8))<NEW_LINE><MASK><NEW_LINE>validate(action, paramsPOST);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isHtmlForm(ct)) {<NEW_LINE>int x = countParamOccurences(action.getRequest(), paramUpdate) + countParamOccurences(action.getRequest(), paramRequest);<NEW_LINE>if (x == 0)<NEW_LINE>ServletOps.errorBadRequest("SPARQL Update: No 'update=' parameter");<NEW_LINE>if (x != 1)<NEW_LINE>ServletOps.errorBadRequest("SPARQL Update: Multiple 'update=' parameters");<NEW_LINE>String requestStr = action.getRequestParameter(paramUpdate);<NEW_LINE>if (requestStr == null)<NEW_LINE>requestStr = action.getRequestParameter(paramRequest);<NEW_LINE>if (requestStr == null)<NEW_LINE>ServletOps.errorBadRequest("SPARQL Update: No update= in HTML form");<NEW_LINE>validate(action, paramsForm);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ServletOps.error(HttpSC.UNSUPPORTED_MEDIA_TYPE_415, "Must be " + contentTypeSPARQLUpdate + " or " + contentTypeHTMLForm + " (got " + ct.getContentTypeStr() + ")");<NEW_LINE>} | ServletOps.errorBadRequest("Bad charset: " + charset); |
198,944 | public void checkField(Field field) {<NEW_LINE>GraphQLFieldDefinition fieldDef = getValidationContext().getFieldDef();<NEW_LINE>if (fieldDef == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, Argument> argumentMap = argumentMap(field.getArguments());<NEW_LINE>for (GraphQLArgument graphQLArgument : fieldDef.getArguments()) {<NEW_LINE>Argument argument = argumentMap.get(graphQLArgument.getName());<NEW_LINE>boolean nonNullType = isNonNull(graphQLArgument.getType());<NEW_LINE>boolean noDefaultValue = graphQLArgument<MASK><NEW_LINE>if (argument == null && nonNullType && noDefaultValue) {<NEW_LINE>String message = String.format("Missing field argument %s", graphQLArgument.getName());<NEW_LINE>addError(ValidationErrorType.MissingFieldArgument, field.getSourceLocation(), message);<NEW_LINE>}<NEW_LINE>if (argument != null) {<NEW_LINE>Value value = argument.getValue();<NEW_LINE>if ((value == null || value instanceof NullValue) && nonNullType && noDefaultValue) {<NEW_LINE>String message = String.format("null value for non-null field argument %s", graphQLArgument.getName());<NEW_LINE>addError(ValidationErrorType.NullValueForNonNullArgument, field.getSourceLocation(), message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getArgumentDefaultValue().isNotSet(); |
974,894 | private void run(List<String> dumpFileNames, Language language) throws IOException {<NEW_LINE>MixingSentenceSource mixingSource = MixingSentenceSource.create(dumpFileNames, language);<NEW_LINE>while (mixingSource.hasNext()) {<NEW_LINE>if (stopped) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (sentenceCount % 10_000 == 0) {<NEW_LINE>// System.out.println("Indexing sentence #" + sentenceCount + " (" + mixingSource.getSourceDistribution() + "):"); // doesn't work well with URLs as source<NEW_LINE>System.out.println("Indexing sentence #" + sentenceCount + ":");<NEW_LINE>System.out.println(" [" + sentence.getSource() + "] " + sentence);<NEW_LINE>}<NEW_LINE>indexer.indexSentence(sentence, sentenceCount);<NEW_LINE>sentenceCount++;<NEW_LINE>if (maxSentences > 0 && sentenceCount >= maxSentences) {<NEW_LINE>throw new DocumentLimitReachedException(maxSentences);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Sentence sentence = mixingSource.next(); |
306,300 | public static ListTaskResponse unmarshall(ListTaskResponse listTaskResponse, UnmarshallerContext _ctx) {<NEW_LINE>listTaskResponse.setRequestId(_ctx.stringValue("ListTaskResponse.RequestId"));<NEW_LINE>listTaskResponse.setTotalCount(_ctx.integerValue("ListTaskResponse.TotalCount"));<NEW_LINE>listTaskResponse.setPageNumber(_ctx.integerValue("ListTaskResponse.PageNumber"));<NEW_LINE>listTaskResponse.setPageSize(_ctx.integerValue("ListTaskResponse.PageSize"));<NEW_LINE>List<TasksItem> tasks = new ArrayList<TasksItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListTaskResponse.Tasks.Length"); i++) {<NEW_LINE>TasksItem tasksItem = new TasksItem();<NEW_LINE>tasksItem.setId(_ctx.integerValue("ListTaskResponse.Tasks[" + i + "].Id"));<NEW_LINE>tasksItem.setTaskName(_ctx.stringValue<MASK><NEW_LINE>tasksItem.setTaskType(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskType"));<NEW_LINE>tasksItem.setTaskOwner(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskOwner"));<NEW_LINE>tasksItem.setTaskAdder(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskAdder"));<NEW_LINE>tasksItem.setTaskRunner(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskRunner"));<NEW_LINE>tasksItem.setTaskProgress(_ctx.integerValue("ListTaskResponse.Tasks[" + i + "].TaskProgress"));<NEW_LINE>tasksItem.setTaskProgressDescription(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskProgressDescription"));<NEW_LINE>tasksItem.setTaskStatus(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskStatus"));<NEW_LINE>tasksItem.setClientToken(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].ClientToken"));<NEW_LINE>tasksItem.setCreatedTime(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].CreatedTime"));<NEW_LINE>tasksItem.setCompletionTime(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].CompletionTime"));<NEW_LINE>tasksItem.setPriority(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].Priority"));<NEW_LINE>tasksItem.setMaxRetry(_ctx.integerValue("ListTaskResponse.Tasks[" + i + "].MaxRetry"));<NEW_LINE>tasksItem.setNextExecutionTime(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].NextExecutionTime"));<NEW_LINE>tasksItem.setTaskExecutionCounts(_ctx.integerValue("ListTaskResponse.Tasks[" + i + "].TaskExecutionCounts"));<NEW_LINE>tasksItem.setTaskErrorReason(_ctx.stringValue("ListTaskResponse.Tasks[" + i + "].TaskErrorReason"));<NEW_LINE>tasksItem.setTaskStatusCode(_ctx.integerValue("ListTaskResponse.Tasks[" + i + "].TaskStatusCode"));<NEW_LINE>tasks.add(tasksItem);<NEW_LINE>}<NEW_LINE>listTaskResponse.setTasks(tasks);<NEW_LINE>return listTaskResponse;<NEW_LINE>} | ("ListTaskResponse.Tasks[" + i + "].TaskName")); |
823,340 | protected static <A, B> double[] computeBivariateRanks(NumberArrayAdapter<?, A> adapter1, A data1, NumberArrayAdapter<?, B> adapter2, B data2, int len) {<NEW_LINE>double[] ret = new double[len];<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>for (int j = i + 1; j < len; j++) {<NEW_LINE>double xi = adapter1.getDouble(data1, i), xj = <MASK><NEW_LINE>double yi = adapter2.getDouble(data2, i), yj = adapter2.getDouble(data2, j);<NEW_LINE>if (xi < xj) {<NEW_LINE>ret[j] += (yi < yj) ? 1 : (yi == yj) ? .5 : 0;<NEW_LINE>} else if (xj < xi) {<NEW_LINE>ret[i] += (yj < yi) ? 1 : (yj == yi) ? .5 : 0;<NEW_LINE>} else {<NEW_LINE>// tied on x<NEW_LINE>if (yi < yj) {<NEW_LINE>ret[j] += .5;<NEW_LINE>} else if (yj < yi) {<NEW_LINE>ret[i] += .5;<NEW_LINE>} else {<NEW_LINE>// Double tied<NEW_LINE>ret[i] += .25;<NEW_LINE>ret[j] += .25;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | adapter1.getDouble(data1, j); |
933,008 | private ProductLookupDescriptor createProductLookupDescriptor(@NonNull final Optional<SOTrx> soTrx) {<NEW_LINE>if (soTrx.orElse(SOTrx.PURCHASE).isSales()) {<NEW_LINE>return ProductLookupDescriptor.builderWithStockInfo().bpartnerParamName(I_C_Order.COLUMNNAME_C_BPartner_ID).pricingDateParamName(I_C_Order.COLUMNNAME_DatePromised).hideDiscontinued(true).availableStockDateParamName(I_C_Order.COLUMNNAME_PreparationDate).availableToPromiseAdapter(availableToPromiseAdapter).availableForSaleAdapter(availableForSaleAdapter).<MASK><NEW_LINE>} else {<NEW_LINE>return ProductLookupDescriptor.builderWithStockInfo().bpartnerParamName(I_C_Order.COLUMNNAME_C_BPartner_ID).pricingDateParamName(I_C_Order.COLUMNNAME_DatePromised).hideDiscontinued(true).availableStockDateParamName(I_C_Order.COLUMNNAME_DatePromised).availableToPromiseAdapter(availableToPromiseAdapter).availableForSaleAdapter(availableForSaleAdapter).availableForSalesConfigRepo(availableForSalesConfigRepo).build();<NEW_LINE>}<NEW_LINE>} | availableForSalesConfigRepo(availableForSalesConfigRepo).build(); |
1,490,568 | public boolean reassociateInvariants() {<NEW_LINE>int count = 0;<NEW_LINE>StructuredGraph graph = loopBegin().graph();<NEW_LINE>InvariantPredicate invariant = new InvariantPredicate();<NEW_LINE>NodeBitMap newLoopNodes = graph.createNodeBitMap();<NEW_LINE>for (BinaryArithmeticNode<?> binary : whole().nodes().filter(BinaryArithmeticNode.class)) {<NEW_LINE>if (!binary.isAssociative()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ValueNode result = BinaryArithmeticNode.reassociateMatchedValues(binary, invariant, binary.getX(), binary.getY(), NodeView.DEFAULT);<NEW_LINE>if (result == binary) {<NEW_LINE>result = BinaryArithmeticNode.reassociateUnmatchedValues(binary, invariant, NodeView.DEFAULT);<NEW_LINE>}<NEW_LINE>if (result != binary) {<NEW_LINE>if (!result.isAlive()) {<NEW_LINE>assert !result.isDeleted();<NEW_LINE><MASK><NEW_LINE>// Save all new added loop variants.<NEW_LINE>newLoopNodes.markAndGrow(result);<NEW_LINE>for (Node input : result.inputs()) {<NEW_LINE>if (whole().nodes().isNew(input) && !invariant.apply(input)) {<NEW_LINE>newLoopNodes.markAndGrow(input);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DebugContext debug = graph.getDebug();<NEW_LINE>if (debug.isLogEnabled()) {<NEW_LINE>debug.log("%s : Re-associated %s into %s", graph.method().format("%H::%n"), binary, result);<NEW_LINE>}<NEW_LINE>binary.replaceAtUsages(result);<NEW_LINE>GraphUtil.killWithUnusedFloatingInputs(binary);<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newLoopNodes.isNotEmpty()) {<NEW_LINE>whole().nodes().union(newLoopNodes);<NEW_LINE>}<NEW_LINE>return count != 0;<NEW_LINE>} | result = graph.addOrUniqueWithInputs(result); |
652,908 | public GetReportGroupTrendResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetReportGroupTrendResult getReportGroupTrendResult = new GetReportGroupTrendResult();<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 getReportGroupTrendResult;<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("stats", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getReportGroupTrendResult.setStats(ReportGroupTrendStatsJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("rawData", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getReportGroupTrendResult.setRawData(new ListUnmarshaller<ReportWithRawData>(ReportWithRawDataJsonUnmarshaller.getInstance(<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 getReportGroupTrendResult;<NEW_LINE>} | )).unmarshall(context)); |
1,823,238 | private void addPrefetchAttribute(Attribute attribute, SDField field, Schema schema) {<NEW_LINE>if (attribute.getPrefetchValue() == null) {<NEW_LINE>// Prefetch by default - unless any summary makes this dynamic<NEW_LINE>// Check if there is an implicit dynamic definition<NEW_LINE>SummaryField fieldSummaryField = field.<MASK><NEW_LINE>if (fieldSummaryField != null && fieldSummaryField.getTransform().isDynamic())<NEW_LINE>return;<NEW_LINE>// Check if an explicit class makes it dynamic (first is enough, as all must be the same, checked later)<NEW_LINE>SummaryField explicitSummaryField = schema.getExplicitSummaryField(attribute.getName());<NEW_LINE>if (explicitSummaryField != null && explicitSummaryField.getTransform().isDynamic())<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DocumentSummary summary = getOrCreateAttributePrefetchSummary(schema);<NEW_LINE>SummaryField attributeSummaryField = new SummaryField(attribute.getName(), attribute.getDataType());<NEW_LINE>attributeSummaryField.addSource(attribute.getName());<NEW_LINE>attributeSummaryField.addDestination("attributeprefetch");<NEW_LINE>attributeSummaryField.setTransform(SummaryTransform.ATTRIBUTE);<NEW_LINE>summary.add(attributeSummaryField);<NEW_LINE>} | getSummaryField(attribute.getName()); |
861,754 | private Map<WorkflowScheme, Map<CountWorkflowStep, List<CountWorkflowAction>>> normalizeBulkActions(final Map<WorkflowScheme, Map<CountWorkflowStep, List<CountWorkflowAction>>> bulkActions) {<NEW_LINE>final Set<WorkflowScheme> workflowSchemes = bulkActions.keySet();<NEW_LINE>for (final WorkflowScheme scheme : workflowSchemes) {<NEW_LINE>final Map<CountWorkflowAction, List<CountWorkflowAction>> dupeActionsMap = new HashMap<>();<NEW_LINE>// Actions are only allowed to appear once per workflow. So we need to merge every other instance that might popup.<NEW_LINE>final Map<CountWorkflowStep, List<CountWorkflowAction>> stepsAndActions = bulkActions.get(scheme);<NEW_LINE>final Set<CountWorkflowStep> steps = stepsAndActions.keySet();<NEW_LINE>for (final CountWorkflowStep step : steps) {<NEW_LINE>final List<CountWorkflowAction> countWorkflowActions = stepsAndActions.get(step);<NEW_LINE>final Iterator<CountWorkflowAction<MASK><NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>final CountWorkflowAction action = iterator.next();<NEW_LINE>if (!dupeActionsMap.containsKey(action)) {<NEW_LINE>dupeActionsMap.put(action, countWorkflowActions);<NEW_LINE>} else {<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bulkActions;<NEW_LINE>} | > iterator = countWorkflowActions.iterator(); |
1,787,775 | public void marshall(TableInput tableInput, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (tableInput == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(tableInput.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getOwner(), OWNER_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getLastAccessTime(), LASTACCESSTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getLastAnalyzedTime(), LASTANALYZEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getRetention(), RETENTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getStorageDescriptor(), STORAGEDESCRIPTOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getPartitionKeys(), PARTITIONKEYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getViewOriginalText(), VIEWORIGINALTEXT_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getViewExpandedText(), VIEWEXPANDEDTEXT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(tableInput.getParameters(), PARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getTargetTable(), TARGETTABLE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | tableInput.getTableType(), TABLETYPE_BINDING); |
303,158 | public static String initToken(String consumerKey, String consumerSecret) {<NEW_LINE>ConnectionRequest auth = new ConnectionRequest() {<NEW_LINE><NEW_LINE>protected void readResponse(InputStream input) throws IOException {<NEW_LINE>JSONParser p = new JSONParser();<NEW_LINE>Hashtable h = p.parse(new InputStreamReader(input));<NEW_LINE>authToken = (String) h.get("access_token");<NEW_LINE>if (authToken == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>auth.setPost(true);<NEW_LINE>auth.setUrl("https://api.twitter.com/oauth2/token");<NEW_LINE>// YOU MUST CHANGE THIS IF YOU BUILD YOUR OWN APP<NEW_LINE>String encoded = Base64.encodeNoNewline((consumerKey + ":" <MASK><NEW_LINE>auth.addRequestHeader("Authorization", "Basic " + encoded);<NEW_LINE>auth.setContentType("application/x-www-form-urlencoded;charset=UTF-8");<NEW_LINE>auth.addArgument("grant_type", "client_credentials");<NEW_LINE>NetworkManager.getInstance().addToQueueAndWait(auth);<NEW_LINE>return authToken;<NEW_LINE>} | + consumerSecret).getBytes()); |
541,870 | private void showJumpResults(InitialJumpConditions initial, JumpResult jump) {<NEW_LINE>if (jump.isSplat()) {<NEW_LINE>showSplatMessage(initial, jump);<NEW_LINE>showCleverSplatMessage();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.println("CHUTE OPEN");<NEW_LINE>int worseJumpCount = countWorseHistoricalJumps(jump);<NEW_LINE>int successfulJumpCt = pastSuccessfulJumpDistances.size();<NEW_LINE>pastSuccessfulJumpDistances.add(jump.getDistance());<NEW_LINE>if (pastSuccessfulJumpDistances.size() <= 2) {<NEW_LINE>List<String> ordinals = Arrays.asList("1ST", "2ND", "3RD");<NEW_LINE>System.out.printf("AMAZING!!! NOT BAD FOR YOUR %s SUCCESSFUL JUMP!!!\n", ordinals.get(successfulJumpCt));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int betterThanCount = successfulJumpCt - worseJumpCount;<NEW_LINE>if (betterThanCount <= 0.1 * successfulJumpCt) {<NEW_LINE>System.out.printf("WOW! THAT'S SOME JUMPING. OF THE %d SUCCESSFUL JUMPS\n", successfulJumpCt);<NEW_LINE>System.<MASK><NEW_LINE>System.out.println("YOU DID.");<NEW_LINE>} else if (betterThanCount <= 0.25 * successfulJumpCt) {<NEW_LINE>System.out.printf("PRETTY GOOD! %d SUCCESSFUL JUMPS PRECEDED YOURS AND ONLY\n", successfulJumpCt);<NEW_LINE>System.out.printf("%d OF THEM GOT LOWER THAN YOU DID BEFORE THEIR CHUTES\n", betterThanCount);<NEW_LINE>System.out.println("OPENED.");<NEW_LINE>} else if (betterThanCount <= 0.5 * successfulJumpCt) {<NEW_LINE>System.out.printf("NOT BAD. THERE HAVE BEEN %d SUCCESSFUL JUMPS BEFORE YOURS.\n", successfulJumpCt);<NEW_LINE>System.out.printf("YOU WERE BEATEN OUT BY %d OF THEM.\n", betterThanCount);<NEW_LINE>} else if (betterThanCount <= 0.75 * successfulJumpCt) {<NEW_LINE>System.out.printf("CONSERVATIVE, AREN'T YOU? YOU RANKED ONLY %d IN THE\n", betterThanCount);<NEW_LINE>System.out.printf("%d SUCCESSFUL JUMPS BEFORE YOURS.\n", successfulJumpCt);<NEW_LINE>} else if (betterThanCount <= -0.9 * successfulJumpCt) {<NEW_LINE>System.out.println("HUMPH! DON'T YOU HAVE ANY SPORTING BLOOD? THERE WERE");<NEW_LINE>System.out.printf("%d SUCCESSFUL JUMPS BEFORE YOURS AND YOU CAME IN %d JUMPS\n", successfulJumpCt, worseJumpCount);<NEW_LINE>System.out.println("BETTER THAN THE WORST. SHAPE UP!!!\n");<NEW_LINE>} else {<NEW_LINE>System.out.printf("HEY! YOU PULLED THE RIP CORD MUCH TOO SOON. %d SUCCESSFUL\n", successfulJumpCt);<NEW_LINE>System.out.printf("JUMPS BEFORE YOURS AND YOU CAME IN NUMBER %d! GET WITH IT!\n", betterThanCount);<NEW_LINE>}<NEW_LINE>} | out.printf("BEFORE YOURS, ONLY %d OPENED THEIR CHUTES LOWER THAN\n", betterThanCount); |
232,290 | public com.squareup.okhttp.Call globalPoliciesGetCall(String xWSO2Tenant, String policyName, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/global-policies";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (policyName != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPair("policyName", policyName));<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (xWSO2Tenant != null)<NEW_LINE>localVarHeaderParams.put("xWSO2Tenant", apiClient.parameterToString(xWSO2Tenant));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.<MASK><NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | proceed(chain.request()); |
332,535 | public GatewayGroup unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GatewayGroup gatewayGroup = new GatewayGroup();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>gatewayGroup.setArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>gatewayGroup.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Description", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>gatewayGroup.setDescription(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return gatewayGroup;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,692,921 | public static Double resolveBucketValue(MultiBucketsAggregation agg, InternalMultiBucketAggregation.InternalBucket bucket, List<String> aggPathAsList, GapPolicy gapPolicy) {<NEW_LINE>try {<NEW_LINE>Object propertyValue = bucket.getProperty(agg.getName(), aggPathAsList);<NEW_LINE>if (propertyValue == null) {<NEW_LINE>throw new AggregationExecutionException(AbstractPipelineAggregationBuilder.BUCKETS_PATH_FIELD.getPreferredName() + " must reference either a number value or a single value numeric metric aggregation");<NEW_LINE>} else {<NEW_LINE>double value;<NEW_LINE>if (propertyValue instanceof Number) {<NEW_LINE>value = ((Number) propertyValue).doubleValue();<NEW_LINE>} else if (propertyValue instanceof InternalNumericMetricsAggregation.SingleValue) {<NEW_LINE>value = ((InternalNumericMetricsAggregation.<MASK><NEW_LINE>} else {<NEW_LINE>throw formatResolutionError(agg, aggPathAsList, propertyValue);<NEW_LINE>}<NEW_LINE>// doc count never has missing values so gap policy doesn't apply here<NEW_LINE>if (aggPathAsList.size() == 1 && "_count".equals(aggPathAsList.get(0))) {<NEW_LINE>return value;<NEW_LINE>} else {<NEW_LINE>return gapPolicy.processValue(bucket.getDocCount(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InvalidAggregationPathException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | SingleValue) propertyValue).value(); |
1,621,078 | public void onViewAttachedToWindow(@NonNull AbstractViewHolder holder) {<NEW_LINE>super.onViewAttachedToWindow(holder);<NEW_LINE>CellRowViewHolder viewHolder = (CellRowViewHolder) holder;<NEW_LINE>ScrollHandler scrollHandler = mTableView.getScrollHandler();<NEW_LINE>// The below code helps to display a new attached recyclerView on exact scrolled position.<NEW_LINE>((ColumnLayoutManager) viewHolder.recyclerView.getLayoutManager()).scrollToPositionWithOffset(scrollHandler.getColumnPosition(), scrollHandler.getColumnPositionOffset());<NEW_LINE>SelectionHandler selectionHandler = mTableView.getSelectionHandler();<NEW_LINE>if (selectionHandler.isAnyColumnSelected()) {<NEW_LINE>AbstractViewHolder cellViewHolder = (AbstractViewHolder) viewHolder.recyclerView.<MASK><NEW_LINE>if (cellViewHolder != null) {<NEW_LINE>// Control to ignore selection color<NEW_LINE>if (!mTableView.isIgnoreSelectionColors()) {<NEW_LINE>cellViewHolder.setBackgroundColor(mTableView.getSelectedColor());<NEW_LINE>}<NEW_LINE>cellViewHolder.setSelected(SelectionState.SELECTED);<NEW_LINE>}<NEW_LINE>} else if (selectionHandler.isRowSelected(holder.getBindingAdapterPosition())) {<NEW_LINE>selectionHandler.changeSelectionOfRecyclerView(viewHolder.recyclerView, SelectionState.SELECTED, mTableView.getSelectedColor());<NEW_LINE>}<NEW_LINE>} | findViewHolderForAdapterPosition(selectionHandler.getSelectedColumnPosition()); |
720,976 | public JWSHeader convert(JoseHeader headers) {<NEW_LINE>JWSHeader.Builder builder = new JWSHeader.Builder(JWSAlgorithm.parse(headers.getAlgorithm().getName()));<NEW_LINE>if (headers.getJwkSetUrl() != null) {<NEW_LINE>builder.jwkURL(convertAsURI(JoseHeaderNames.JKU, headers.getJwkSetUrl()));<NEW_LINE>}<NEW_LINE>Map<String, Object> jwk = headers.getJwk();<NEW_LINE>if (!CollectionUtils.isEmpty(jwk)) {<NEW_LINE>try {<NEW_LINE>builder.jwk(JWK.parse(jwk));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new JwtEncodingException(String.format(ENCODING_ERROR_MESSAGE_TEMPLATE, "Unable to convert '" + JoseHeaderNames.JWK + "' JOSE header"), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String keyId = headers.getKeyId();<NEW_LINE>if (StringUtils.hasText(keyId)) {<NEW_LINE>builder.keyID(keyId);<NEW_LINE>}<NEW_LINE>if (headers.getX509Url() != null) {<NEW_LINE>builder.x509CertURL(convertAsURI(JoseHeaderNames.X5U, headers.getX509Url()));<NEW_LINE>}<NEW_LINE>List<String> x509CertificateChain = headers.getX509CertificateChain();<NEW_LINE>if (!CollectionUtils.isEmpty(x509CertificateChain)) {<NEW_LINE>List<Base64> x5cList = new ArrayList<>();<NEW_LINE>x509CertificateChain.forEach((x5c) -> x5cList.add(new Base64(x5c)));<NEW_LINE>if (!x5cList.isEmpty()) {<NEW_LINE>builder.x509CertChain(x5cList);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String x509SHA1Thumbprint = headers.getX509SHA1Thumbprint();<NEW_LINE>if (StringUtils.hasText(x509SHA1Thumbprint)) {<NEW_LINE>builder.<MASK><NEW_LINE>}<NEW_LINE>String x509SHA256Thumbprint = headers.getX509SHA256Thumbprint();<NEW_LINE>if (StringUtils.hasText(x509SHA256Thumbprint)) {<NEW_LINE>builder.x509CertSHA256Thumbprint(new Base64URL(x509SHA256Thumbprint));<NEW_LINE>}<NEW_LINE>String type = headers.getType();<NEW_LINE>if (StringUtils.hasText(type)) {<NEW_LINE>builder.type(new JOSEObjectType(type));<NEW_LINE>}<NEW_LINE>String contentType = headers.getContentType();<NEW_LINE>if (StringUtils.hasText(contentType)) {<NEW_LINE>builder.contentType(contentType);<NEW_LINE>}<NEW_LINE>Set<String> critical = headers.getCritical();<NEW_LINE>if (!CollectionUtils.isEmpty(critical)) {<NEW_LINE>builder.criticalParams(critical);<NEW_LINE>}<NEW_LINE>Map<String, Object> customHeaders = new HashMap<>();<NEW_LINE>headers.getHeaders().forEach((name, value) -> {<NEW_LINE>if (!JWSHeader.getRegisteredParameterNames().contains(name)) {<NEW_LINE>customHeaders.put(name, value);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (!customHeaders.isEmpty()) {<NEW_LINE>builder.customParams(customHeaders);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | x509CertThumbprint(new Base64URL(x509SHA1Thumbprint)); |
1,716,785 | private static void sortHandlers(MethodNode mth, List<TryCatchBlockAttr> tryBlocks) {<NEW_LINE>TypeCompare typeCompare = mth<MASK><NEW_LINE>Comparator<ArgType> comparator = typeCompare.getReversedComparator();<NEW_LINE>for (TryCatchBlockAttr tryBlock : tryBlocks) {<NEW_LINE>for (ExceptionHandler handler : tryBlock.getHandlers()) {<NEW_LINE>handler.getCatchTypes().sort((first, second) -> compareByTypeAndName(comparator, first, second));<NEW_LINE>}<NEW_LINE>tryBlock.getHandlers().sort((first, second) -> {<NEW_LINE>if (first.equals(second)) {<NEW_LINE>throw new JadxRuntimeException("Same handlers in try block: " + tryBlock);<NEW_LINE>}<NEW_LINE>if (first.isCatchAll()) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>if (second.isCatchAll()) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>return compareByTypeAndName(comparator, ListUtils.first(first.getCatchTypes()), ListUtils.first(second.getCatchTypes()));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | .root().getTypeCompare(); |
1,188,511 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>jLabelTarget = new javax.swing.JLabel();<NEW_LINE>jComboBoxTarget = new javax.swing.JComboBox();<NEW_LINE>jButton1 = new javax.swing.JButton();<NEW_LINE>jLabelTarget.setLabelFor(jComboBoxTarget);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabelTarget, org.openide.util.NbBundle.getMessage<MASK><NEW_LINE>jComboBoxTarget.setMinimumSize(this.jComboBoxTarget.getPreferredSize());<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(LibrariesCustomizerPanel.class, "LBL_CustomizeGeneral_Platform_JButton"));<NEW_LINE>jButton1.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>createNewPlatform(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(jLabelTarget).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jComboBoxTarget, 0, 317, Short.MAX_VALUE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jButton1)));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabelTarget).addComponent(jButton1).addComponent(jComboBoxTarget, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)));<NEW_LINE>// NOI18N<NEW_LINE>jLabelTarget.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LibrariesCustomizerPanel.class, "ACSD_CustomizerGeneral_jLabelTarget"));<NEW_LINE>// NOI18N<NEW_LINE>jButton1.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(LibrariesCustomizerPanel.class, "ACSD_CustomizerGeneral_jButton1"));<NEW_LINE>} | (LibrariesCustomizerPanel.class, "LBL_CustomizeGeneral_Platform_JLabel")); |
282,532 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.<MASK><NEW_LINE>int xValue = source.getManaCostsToPay().getX();<NEW_LINE>if (controller != null && xValue > 0) {<NEW_LINE>Token tokenCopy = new TemptWithVengeanceElementalToken();<NEW_LINE>tokenCopy.putOntoBattlefield(xValue, game, source, source.getControllerId(), false, false);<NEW_LINE>int opponentsAddedTokens = 0;<NEW_LINE>for (UUID playerId : game.getOpponents(controller.getId())) {<NEW_LINE>Player opponent = game.getPlayer(playerId);<NEW_LINE>if (opponent != null) {<NEW_LINE>if (opponent.chooseUse(outcome, "Create " + xValue + " Elemental tokens?", source, game)) {<NEW_LINE>opponentsAddedTokens += xValue;<NEW_LINE>tokenCopy.putOntoBattlefield(xValue, game, source, playerId, false, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (opponentsAddedTokens > 0) {<NEW_LINE>tokenCopy.putOntoBattlefield(opponentsAddedTokens, game, source, source.getControllerId(), false, false);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getPlayer(source.getControllerId()); |
1,250,033 | public static Map<String, String> projectEntriesList(SensitiveInfoExposureAssertion sensitiveInfoExposureAssertion) {<NEW_LINE>Project <MASK><NEW_LINE>AbstractWsdlModelItem<ModelItemConfig> modelItem = (AbstractWsdlModelItem<ModelItemConfig>) project.getModelItem();<NEW_LINE>XmlObjectConfigurationReader reader = new XmlObjectConfigurationReader(((ProjectConfig) modelItem.getConfig()).getSensitiveInformation());<NEW_LINE>String[] strngArray = reader.readStrings(ProjectSensitiveInformationPanel.PROJECT_SPECIFIC_EXPOSURE_LIST);<NEW_LINE>if (strngArray != null) {<NEW_LINE>Map<String, String> map = new HashMap<String, String>();<NEW_LINE>for (String str : strngArray) {<NEW_LINE>String[] tokens = str.split("###");<NEW_LINE>if (tokens.length == 2) {<NEW_LINE>map.put(tokens[0], tokens[1]);<NEW_LINE>} else {<NEW_LINE>map.put(tokens[0], "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} else {<NEW_LINE>return new HashMap<String, String>();<NEW_LINE>}<NEW_LINE>} | project = ModelSupport.getModelItemProject(sensitiveInfoExposureAssertion); |
733,142 | protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite parentComposite = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite composite = new Composite(parentComposite, SWT.NULL);<NEW_LINE>GridLayout layout = new GridLayout();<NEW_LINE>layout.marginHeight = 10;<NEW_LINE>layout.marginWidth = 10;<NEW_LINE>layout.numColumns = 2;<NEW_LINE>layout.makeColumnsEqualWidth = false;<NEW_LINE>composite.setLayout(layout);<NEW_LINE>composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>extensionsList = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);<NEW_LINE>stylers = new Stylers(extensionsList.getTree().getFont());<NEW_LINE>extensionsList.getTree().addDisposeListener(<MASK><NEW_LINE>extensionsList.setLabelProvider(new ExtensionLabelProvider());<NEW_LINE>extensionsList.setContentProvider(EXTENSIONS_CONTENT_PROVIDER_INSTANCE);<NEW_LINE>extensionsList.getTree().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>extensionsList.addSelectionChangedListener(selectionEvent -> selectionChanged());<NEW_LINE>Composite actionsComposite = new Composite(composite, SWT.NULL);<NEW_LINE>actionsComposite.setLayout(GridLayoutFactory.fillDefaults().create());<NEW_LINE>actionsComposite.setLayoutData(GridDataFactory.fillDefaults().create());<NEW_LINE>installButton = new Button(actionsComposite, SWT.PUSH);<NEW_LINE>installButton.setText("Install");<NEW_LINE>installButton.setLayoutData(GridDataFactory.fillDefaults().create());<NEW_LINE>installButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>if (selected != null) {<NEW_LINE>selected.install();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>uninstallButton = new Button(actionsComposite, SWT.PUSH);<NEW_LINE>uninstallButton.setText("Uninstall");<NEW_LINE>uninstallButton.setLayoutData(GridDataFactory.fillDefaults().create());<NEW_LINE>uninstallButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>if (selected != null) {<NEW_LINE>selected.uninstall();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>GridData gridData = GridDataFactory.copyData((GridData) actionsComposite.getLayoutData());<NEW_LINE>gridData.widthHint = actionsComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;<NEW_LINE>actionsComposite.setLayoutData(gridData);<NEW_LINE>updateButtons();<NEW_LINE>setTitle("Spring Boot CLI Extensions");<NEW_LINE>if (install instanceof ZippedBootInstall) {<NEW_LINE>setMessage("Read-only list of extensions installed automatically", IMessageProvider.INFORMATION);<NEW_LINE>} else {<NEW_LINE>setMessage("Manage extensions for Spring Boot CLI installations");<NEW_LINE>}<NEW_LINE>loadExtensions();<NEW_LINE>return parentComposite;<NEW_LINE>} | e -> stylers.dispose()); |
314,801 | public static List<String> listResourceDirectory(String directoryName) throws IOException, ResourceNotFoundException {<NEW_LINE>URL url = Thread.currentThread().<MASK><NEW_LINE>if (url == null) {<NEW_LINE>throw new ResourceNotFoundException(directoryName);<NEW_LINE>}<NEW_LINE>URI uri;<NEW_LINE>try {<NEW_LINE>uri = url.toURI();<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>if (url.getProtocol().equals("file")) {<NEW_LINE>File dir = new File(uri);<NEW_LINE>String[] filenames = dir.list();<NEW_LINE>if (filenames != null) {<NEW_LINE>return List.of(filenames);<NEW_LINE>}<NEW_LINE>} else if (url.getProtocol().equals("jar")) {<NEW_LINE>try (FileSystem fileSystem = FileSystems.newFileSystem(uri, Collections.emptyMap());<NEW_LINE>Stream<Path> filePaths = java.nio.file.Files.walk(fileSystem.getPath(directoryName), 1)) {<NEW_LINE>// NOPMD<NEW_LINE>return filePaths.skip(1).map(path -> path.getFileName().toString()).collect(Collectors.toUnmodifiableList());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IOException("Failed to list resource directory: " + directoryName);<NEW_LINE>} | getContextClassLoader().getResource(directoryName); |
1,603,727 | public static DescribeDownloadRecordsResponse unmarshall(DescribeDownloadRecordsResponse describeDownloadRecordsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDownloadRecordsResponse.setRequestId(_ctx.stringValue("DescribeDownloadRecordsResponse.RequestId"));<NEW_LINE>List<Items> records = new ArrayList<Items>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDownloadRecordsResponse.Records.Length"); i++) {<NEW_LINE>Items items = new Items();<NEW_LINE>items.setStatus(_ctx.stringValue<MASK><NEW_LINE>items.setDownloadId(_ctx.longValue("DescribeDownloadRecordsResponse.Records[" + i + "].DownloadId"));<NEW_LINE>items.setExceptionMsg(_ctx.stringValue("DescribeDownloadRecordsResponse.Records[" + i + "].ExceptionMsg"));<NEW_LINE>items.setUrl(_ctx.stringValue("DescribeDownloadRecordsResponse.Records[" + i + "].Url"));<NEW_LINE>items.setFileName(_ctx.stringValue("DescribeDownloadRecordsResponse.Records[" + i + "].FileName"));<NEW_LINE>records.add(items);<NEW_LINE>}<NEW_LINE>describeDownloadRecordsResponse.setRecords(records);<NEW_LINE>return describeDownloadRecordsResponse;<NEW_LINE>} | ("DescribeDownloadRecordsResponse.Records[" + i + "].Status")); |
454,922 | public void onClick(View view) {<NEW_LINE>int id = view.getId();<NEW_LINE>if (id == R.id.subject) {<NEW_LINE>toggleSubjectViewMaxLines();<NEW_LINE>} else if (id == R.id.from) {<NEW_LINE>onAddSenderToContacts();<NEW_LINE>} else if (id == R.id.to || id == R.id.cc || id == R.id.bcc) {<NEW_LINE>expand((TextView) view, ((TextView) view).getEllipsize() != null);<NEW_LINE>} else if (id == R.id.crypto_status_icon) {<NEW_LINE>onCryptoClickListener.onCryptoClick();<NEW_LINE>} else if (id == R.id.icon_single_message_options) {<NEW_LINE>PopupMenu popupMenu = new <MASK><NEW_LINE>popupMenu.setOnMenuItemClickListener(onMenuItemClickListener);<NEW_LINE>popupMenu.inflate(R.menu.single_message_options);<NEW_LINE>popupMenu.show();<NEW_LINE>}<NEW_LINE>} | PopupMenu(getContext(), view); |
1,058,632 | public IdentityOperationResult deleteUser(final String userId) {<NEW_LINE>checkAuthorization(Permissions.DELETE, Resources.USER, userId);<NEW_LINE>UserEntity user = findUserById(userId);<NEW_LINE>if (user != null) {<NEW_LINE>deleteMembershipsByUserId(userId);<NEW_LINE>deleteTenantMembershipsOfUser(userId);<NEW_LINE>deleteAuthorizations(Resources.USER, userId);<NEW_LINE>Context.getCommandContext().runWithoutAuthorization(new Callable<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void call() throws Exception {<NEW_LINE>final List<Tenant> tenants = createTenantQuery().userMember(userId).list();<NEW_LINE>if (tenants != null && !tenants.isEmpty()) {<NEW_LINE>for (Tenant tenant : tenants) {<NEW_LINE>deleteAuthorizationsForUser(Resources.TENANT, tenant.getId(), userId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>getDbEntityManager().delete(user);<NEW_LINE>return new IdentityOperationResult(null, IdentityOperationResult.OPERATION_DELETE);<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>} | IdentityOperationResult(null, IdentityOperationResult.OPERATION_NONE); |
45,121 | public void run() {<NEW_LINE>// batch<NEW_LINE>WriteBatch writeBatch = LEVEL_DB.createWriteBatch();<NEW_LINE>DBIterator iterator = LEVEL_DB.iterator();<NEW_LINE>long currentTimeMillis = System.currentTimeMillis();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Map.Entry<byte[], byte[]> next = iterator.next();<NEW_LINE>if (next.getKey() == null || next.getValue() == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String valueJson = bytesToString(next.getValue());<NEW_LINE>Optional<CacheWrapper<String>> stringCacheWrapper = StringUtils.isEmpty(valueJson) ? Optional.empty() : jsonToCacheWrapper(valueJson);<NEW_LINE>if (stringCacheWrapper.isPresent()) {<NEW_LINE>// get expireat time<NEW_LINE>long expireAtTime = stringCacheWrapper.map(CacheWrapper::getExpireAt).map(Date<MASK><NEW_LINE>// if expire<NEW_LINE>if (expireAtTime != 0 && currentTimeMillis > expireAtTime) {<NEW_LINE>writeBatch.delete(next.getKey());<NEW_LINE>log.debug("deleted the cache: [{}] for expiration", bytesToString(next.getKey()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LEVEL_DB.write(writeBatch);<NEW_LINE>} | ::getTime).orElse(0L); |
562,880 | public Answer createVolume(final CreateObjectCommand cmd) {<NEW_LINE>final DataTO data = cmd.getData();<NEW_LINE>final VolumeObjectTO volume = (VolumeObjectTO) data;<NEW_LINE>try {<NEW_LINE>final Connection conn = hypervisorResource.getConnection();<NEW_LINE>final PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO) data.getDataStore();<NEW_LINE>final SR poolSr = hypervisorResource.getStorageRepository(conn, CitrixHelper.getSRNameLabel(primaryStore.getUuid(), primaryStore.getPoolType(), primaryStore.getPath()));<NEW_LINE>VDI.Record vdir = new VDI.Record();<NEW_LINE>vdir.nameLabel = volume.getName();<NEW_LINE>vdir.SR = poolSr;<NEW_LINE>vdir<MASK><NEW_LINE>vdir.virtualSize = volume.getSize();<NEW_LINE>VDI vdi;<NEW_LINE>vdi = VDI.create(conn, vdir);<NEW_LINE>vdir = vdi.getRecord(conn);<NEW_LINE>final VolumeObjectTO newVol = new VolumeObjectTO();<NEW_LINE>newVol.setName(vdir.nameLabel);<NEW_LINE>newVol.setSize(vdir.virtualSize);<NEW_LINE>newVol.setPath(vdir.uuid);<NEW_LINE>return new CreateObjectAnswer(newVol);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>s_logger.debug("create volume failed: " + e.toString());<NEW_LINE>return new CreateObjectAnswer(e.toString());<NEW_LINE>}<NEW_LINE>} | .type = Types.VdiType.USER; |
1,043,283 | public static <T extends IBaseResource> T apply(FhirContext theCtx, T theResourceToUpdate, @Language("JSON") String thePatchBody) {<NEW_LINE>// Parse the patch<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>mapper.configure(JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION, false);<NEW_LINE>JsonFactory factory = mapper.getFactory();<NEW_LINE>final JsonPatch patch;<NEW_LINE>try {<NEW_LINE>com.fasterxml.jackson.core.JsonParser parser = factory.createParser(thePatchBody);<NEW_LINE>JsonNode <MASK><NEW_LINE>patch = JsonPatch.fromJson(jsonPatchNode);<NEW_LINE>JsonNode originalJsonDocument = mapper.readTree(theCtx.newJsonParser().encodeResourceToString(theResourceToUpdate));<NEW_LINE>JsonNode after = patch.apply(originalJsonDocument);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Class<T> clazz = (Class<T>) theResourceToUpdate.getClass();<NEW_LINE>String postPatchedContent = mapper.writeValueAsString(after);<NEW_LINE>IParser fhirJsonParser = theCtx.newJsonParser();<NEW_LINE>fhirJsonParser.setParserErrorHandler(new StrictErrorHandler());<NEW_LINE>T retVal;<NEW_LINE>try {<NEW_LINE>retVal = fhirJsonParser.parseResource(clazz, postPatchedContent);<NEW_LINE>} catch (DataFormatException e) {<NEW_LINE>String resourceId = theResourceToUpdate.getIdElement().toUnqualifiedVersionless().getValue();<NEW_LINE>String resourceType = theCtx.getResourceDefinition(theResourceToUpdate).getName();<NEW_LINE>resourceId = defaultString(resourceId, resourceType);<NEW_LINE>String msg = theCtx.getLocalizer().getMessage(JsonPatchUtils.class, "failedToApplyPatch", resourceId, e.getMessage());<NEW_LINE>throw new InvalidRequestException(Msg.code(1271) + msg);<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>} catch (IOException | JsonPatchException theE) {<NEW_LINE>throw new InvalidRequestException(Msg.code(1272) + theE.getMessage());<NEW_LINE>}<NEW_LINE>} | jsonPatchNode = mapper.readTree(parser); |
1,367,325 | public S3AccessControlPolicy unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>S3AccessControlPolicy s3AccessControlPolicy = new S3AccessControlPolicy();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return s3AccessControlPolicy;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("AccessControlList", targetDepth)) {<NEW_LINE>s3AccessControlPolicy.setAccessControlList(S3AccessControlListStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("CannedAccessControlList", targetDepth)) {<NEW_LINE>s3AccessControlPolicy.setCannedAccessControlList(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return s3AccessControlPolicy;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | XMLEvent xmlEvent = context.nextEvent(); |
1,312,272 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>response.setContentType("text/html");<NEW_LINE>response.encodeRedirectURL("/");<NEW_LINE><MASK><NEW_LINE>File warPath = new File(conf.getString(SubmarineConfVars.ConfVars.WORKBENCH_WEB_WAR));<NEW_LINE>File indexFile = null;<NEW_LINE>if (warPath.isDirectory()) {<NEW_LINE>// Development mode, read from FS<NEW_LINE>indexFile = new File(warPath.getAbsolutePath() + "/index.html");<NEW_LINE>} else {<NEW_LINE>// Product mode, read from war file<NEW_LINE>File warFile = webApp.getTempDirectory();<NEW_LINE>if (!warFile.exists()) {<NEW_LINE>throw new ServletException("Can't found war directory!");<NEW_LINE>}<NEW_LINE>indexFile = new File(warFile.getAbsolutePath() + "/webapp/index.html");<NEW_LINE>}<NEW_LINE>// If index.html does not exist, throw ServletException<NEW_LINE>if (!(indexFile.isFile() && indexFile.exists())) {<NEW_LINE>throw new ServletException("Can't found index html!");<NEW_LINE>}<NEW_LINE>StringBuilder sbIndexBuf = new StringBuilder();<NEW_LINE>try (InputStreamReader reader = new InputStreamReader(new FileInputStream(indexFile), "GBK");<NEW_LINE>BufferedReader bufferedReader = new BufferedReader(reader)) {<NEW_LINE>String lineTxt = null;<NEW_LINE>while ((lineTxt = bufferedReader.readLine()) != null) {<NEW_LINE>sbIndexBuf.append(lineTxt);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>response.getWriter().print(sbIndexBuf.toString());<NEW_LINE>} | response.setStatus(HttpServletResponse.SC_OK); |
1,582,607 | public void handleLine(String line, PropertiesParserState state) {<NEW_LINE>Stack<<MASK><NEW_LINE>DrawHandler drawer = state.getDrawer();<NEW_LINE>if (line.equals(START)) {<NEW_LINE>ClassSettings settings = new ClassSettings(state.getAlignment().getHorizontal(), state.getAlignment().getVertical(), getDividerPos(drawer, state));<NEW_LINE>innerClassStartPoints.add(settings);<NEW_LINE>state.getBuffer().addToLeftAndRight(BUFFER_PIXEL_PER_INNER);<NEW_LINE>state.increaseTextPrintPosition(H_SPACE);<NEW_LINE>state.getAlignment().reset();<NEW_LINE>} else if (line.equals(END)) {<NEW_LINE>ClassSettings previousClassSettings = innerClassStartPoints.pop();<NEW_LINE>double start = previousClassSettings.start;<NEW_LINE>double height = getDividerPos(drawer, state) - start;<NEW_LINE>XValues xLimit = state.getXLimits(height);<NEW_LINE>ColorOwn oldColor = drawer.getBackgroundColor();<NEW_LINE>drawer.setBackgroundColor(ThemeFactory.getCurrentTheme().getColor(Theme.PredefinedColors.TRANSPARENT));<NEW_LINE>drawer.drawRectangle(xLimit.getLeft(), start, xLimit.getSpace(), height);<NEW_LINE>drawer.setBackgroundColor(oldColor);<NEW_LINE>state.increaseTextPrintPosition(H_SPACE);<NEW_LINE>state.getBuffer().addToLeftAndRight(-BUFFER_PIXEL_PER_INNER);<NEW_LINE>Alignment alignment = state.getAlignment();<NEW_LINE>alignment.setHorizontal(false, previousClassSettings.hAlign);<NEW_LINE>alignment.setVertical(false, previousClassSettings.vAlign);<NEW_LINE>}<NEW_LINE>} | ClassSettings> innerClassStartPoints = getOrInit(state); |
1,256,605 | private void addObservationCodeCriteria(BoolQueryBuilder theBoolQueryBuilder, SearchParameterMap theSearchParameterMap, FhirContext theFhirContext) {<NEW_LINE>String codeParamName = LastNParameterHelper.getCodeParamName(theFhirContext);<NEW_LINE>if (theSearchParameterMap.containsKey(codeParamName)) {<NEW_LINE>ArrayList<String> codeSystemHashList = new ArrayList<>();<NEW_LINE>ArrayList<String> codeOnlyList = new ArrayList<>();<NEW_LINE>ArrayList<String> systemOnlyList = new ArrayList<>();<NEW_LINE>ArrayList<String> <MASK><NEW_LINE>List<List<IQueryParameterType>> andOrParams = theSearchParameterMap.get(codeParamName);<NEW_LINE>for (List<? extends IQueryParameterType> nextAnd : andOrParams) {<NEW_LINE>codeSystemHashList.addAll(getCodingCodeSystemValues(nextAnd));<NEW_LINE>codeOnlyList.addAll(getCodingCodeOnlyValues(nextAnd));<NEW_LINE>systemOnlyList.addAll(getCodingSystemOnlyValues(nextAnd));<NEW_LINE>textOnlyList.addAll(getCodingTextOnlyValues(nextAnd));<NEW_LINE>}<NEW_LINE>if (codeSystemHashList.size() > 0) {<NEW_LINE>theBoolQueryBuilder.must(QueryBuilders.termsQuery(OBSERVATION_CODEHASH_FIELD_NAME, codeSystemHashList));<NEW_LINE>}<NEW_LINE>if (codeOnlyList.size() > 0) {<NEW_LINE>theBoolQueryBuilder.must(QueryBuilders.termsQuery(OBSERVATION_CODEVALUE_FIELD_NAME, codeOnlyList));<NEW_LINE>}<NEW_LINE>if (systemOnlyList.size() > 0) {<NEW_LINE>theBoolQueryBuilder.must(QueryBuilders.termsQuery(OBSERVATION_CODESYSTEM_FIELD_NAME, systemOnlyList));<NEW_LINE>}<NEW_LINE>if (textOnlyList.size() > 0) {<NEW_LINE>BoolQueryBuilder myTextBoolQueryBuilder = QueryBuilders.boolQuery();<NEW_LINE>for (String textOnlyParam : textOnlyList) {<NEW_LINE>myTextBoolQueryBuilder.should(QueryBuilders.matchPhrasePrefixQuery(OBSERVATION_CODEDISPLAY_FIELD_NAME, textOnlyParam));<NEW_LINE>myTextBoolQueryBuilder.should(QueryBuilders.matchPhrasePrefixQuery(OBSERVATION_CODE_TEXT_FIELD_NAME, textOnlyParam));<NEW_LINE>}<NEW_LINE>theBoolQueryBuilder.must(myTextBoolQueryBuilder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | textOnlyList = new ArrayList<>(); |
412,699 | public void load() {<NEW_LINE>Timber.d("load()");<NEW_LINE>try (Cursor cursor = mCol.getDb().query("SELECT guid, mid, mod, usn, tags, flds, flags, data FROM notes WHERE id = ?", mId)) {<NEW_LINE>if (!cursor.moveToFirst()) {<NEW_LINE>throw new WrongId(mId, "note");<NEW_LINE>}<NEW_LINE>mGuId = cursor.getString(0);<NEW_LINE>mMid = cursor.getLong(1);<NEW_LINE>mMod = cursor.getLong(2);<NEW_LINE>mUsn = cursor.getInt(3);<NEW_LINE>mTags = new ArrayList<>(mCol.getTags().split(<MASK><NEW_LINE>mFields = Utils.splitFields(cursor.getString(5));<NEW_LINE>mFlags = cursor.getInt(6);<NEW_LINE>mData = cursor.getString(7);<NEW_LINE>mModel = mCol.getModels().get(mMid);<NEW_LINE>mFMap = Models.fieldMap(mModel);<NEW_LINE>mScm = mCol.getScm();<NEW_LINE>}<NEW_LINE>} | cursor.getString(4))); |
1,550,039 | public synchronized void startSubmittedJobs() {<NEW_LINE>if (!myDaoConfig.isEnableTaskBulkExportJobExecution()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Optional<BulkExportJobEntity> jobToProcessOpt = myTxTemplate.execute(t -> {<NEW_LINE>Pageable page = <MASK><NEW_LINE>Slice<BulkExportJobEntity> submittedJobs = myBulkExportJobDao.findByStatus(page, BulkExportJobStatusEnum.SUBMITTED);<NEW_LINE>if (submittedJobs.isEmpty()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>return Optional.of(submittedJobs.getContent().get(0));<NEW_LINE>});<NEW_LINE>if (!jobToProcessOpt.isPresent()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BulkExportJobEntity bulkExportJobEntity = jobToProcessOpt.get();<NEW_LINE>String jobUuid = bulkExportJobEntity.getJobId();<NEW_LINE>try {<NEW_LINE>processJob(bulkExportJobEntity);<NEW_LINE>} catch (Exception e) {<NEW_LINE>ourLog.error("Failure while preparing bulk export extract", e);<NEW_LINE>myTxTemplate.execute(t -> {<NEW_LINE>Optional<BulkExportJobEntity> submittedJobs = myBulkExportJobDao.findByJobId(jobUuid);<NEW_LINE>if (submittedJobs.isPresent()) {<NEW_LINE>BulkExportJobEntity jobEntity = submittedJobs.get();<NEW_LINE>jobEntity.setStatus(BulkExportJobStatusEnum.ERROR);<NEW_LINE>jobEntity.setStatusMessage(e.getMessage());<NEW_LINE>myBulkExportJobDao.save(jobEntity);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | PageRequest.of(0, 1); |
156,834 | public void configure(DatagramChannel channel, DatagramSocketOptions options) {<NEW_LINE>channel.config().setAllocator(PartialPooledByteBufAllocator.INSTANCE);<NEW_LINE>if (options.getSendBufferSize() != -1) {<NEW_LINE>channel.config().setSendBufferSize(options.getSendBufferSize());<NEW_LINE>}<NEW_LINE>if (options.getReceiveBufferSize() != -1) {<NEW_LINE>channel.config().setReceiveBufferSize(options.getReceiveBufferSize());<NEW_LINE>channel.config().setRecvByteBufAllocator(new FixedRecvByteBufAllocator(options.getReceiveBufferSize()));<NEW_LINE>}<NEW_LINE>channel.config().setOption(ChannelOption.<MASK><NEW_LINE>if (options.getTrafficClass() != -1) {<NEW_LINE>channel.config().setTrafficClass(options.getTrafficClass());<NEW_LINE>}<NEW_LINE>channel.config().setBroadcast(options.isBroadcast());<NEW_LINE>if (this == Transport.JDK) {<NEW_LINE>channel.config().setLoopbackModeDisabled(options.isLoopbackModeDisabled());<NEW_LINE>if (options.getMulticastTimeToLive() != -1) {<NEW_LINE>channel.config().setTimeToLive(options.getMulticastTimeToLive());<NEW_LINE>}<NEW_LINE>if (options.getMulticastNetworkInterface() != null) {<NEW_LINE>try {<NEW_LINE>channel.config().setNetworkInterface(NetworkInterface.getByName(options.getMulticastNetworkInterface()));<NEW_LINE>} catch (SocketException e) {<NEW_LINE>throw new IllegalArgumentException("Could not find network interface with name " + options.getMulticastNetworkInterface());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | SO_REUSEADDR, options.isReuseAddress()); |
23,645 | public static DrawingCache buildDanmakuDrawingCache(BaseDanmaku danmaku, IDisplayer disp, DrawingCache cache, int bitsPerPixel) {<NEW_LINE>if (cache == null)<NEW_LINE>cache = new DrawingCache();<NEW_LINE>cache.build((int) Math.ceil(danmaku.paintWidth), (int) Math.ceil(danmaku.paintHeight), disp.getDensityDpi(), false, bitsPerPixel);<NEW_LINE>DrawingCacheHolder holder = cache.get();<NEW_LINE>if (holder != null) {<NEW_LINE>((AbsDisplayer) disp).drawDanmaku(danmaku, holder.<MASK><NEW_LINE>if (disp.isHardwareAccelerated()) {<NEW_LINE>holder.splitWith(disp.getWidth(), disp.getHeight(), disp.getMaximumCacheWidth(), disp.getMaximumCacheHeight());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return cache;<NEW_LINE>} | canvas, 0, 0, true); |
1,814,942 | // scan all the tiles and find the smallest and largest coordinate (x & y) in that tile.<NEW_LINE>private void fillTileMinMaxCoord() {<NEW_LINE>final SamReader in = SamReaderFactory.makeDefault().referenceSequence(REFERENCE_SEQUENCE).open(INPUT);<NEW_LINE>final ProgressLogger progress = new ProgressLogger(log, (int) 1e7, "Read");<NEW_LINE>int total = 0;<NEW_LINE>for (final SAMRecord rec : in) {<NEW_LINE>if (STOP_AFTER != null && total >= STOP_AFTER)<NEW_LINE>break;<NEW_LINE>total++;<NEW_LINE>progress.record(rec);<NEW_LINE>final PhysicalLocationInt location = getSamRecordLocation(rec);<NEW_LINE>// Defaulting map will create a new Coord if it's not there.<NEW_LINE>final Coord Pos = tileCoord.get(location.getTile());<NEW_LINE>Pos.maxX = Math.max(Pos.maxX, location.getX());<NEW_LINE>Pos.minX = Math.min(Pos.minX, location.getX());<NEW_LINE>Pos.maxY = Math.max(Pos.maxY, location.getY());<NEW_LINE>Pos.minY = Math.min(Pos.minY, location.getY());<NEW_LINE>Pos.count++;<NEW_LINE>}<NEW_LINE>// now that we know what the maximal/minimal numbers were, we should increase/decrease them a little, to account for sampling error<NEW_LINE>for (final Coord coord : tileCoord.values()) {<NEW_LINE>final int diffX = coord.maxX - coord.minX;<NEW_LINE>final int diffY = coord.maxY - coord.minY;<NEW_LINE>coord.maxX += diffX / coord.count;<NEW_LINE>coord.minX -= diffX / coord.count;<NEW_LINE>coord.maxY += diffY / coord.count;<NEW_LINE>coord<MASK><NEW_LINE>}<NEW_LINE>CloserUtil.close(in);<NEW_LINE>} | .minY -= diffY / coord.count; |
1,780,655 | public void run(RegressionEnvironment env) {<NEW_LINE>// test for JIRA ESPER-332<NEW_LINE>sendTimer(0, env);<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String stmtTextCreate = namedWindow ? "@public create window MyInfraPTS#keepall as select * from SupportBean" : "@public create table MyInfraPTS as (theString string)";<NEW_LINE>env.compileDeploy(stmtTextCreate, path);<NEW_LINE>String stmtCount = "on pattern[every timer:interval(10 sec)] select count(eve), eve from MyInfraPTS as eve";<NEW_LINE>env.compileDeploy(stmtCount, path);<NEW_LINE>String stmtTextOnSelect = "@name('select') on pattern [every timer:interval(10 sec)] select theString from MyInfraPTS having count(theString) > 0";<NEW_LINE>env.compileDeploy(stmtTextOnSelect<MASK><NEW_LINE>String stmtTextInsertOne = namedWindow ? "insert into MyInfraPTS select * from SupportBean" : "insert into MyInfraPTS select theString from SupportBean";<NEW_LINE>env.compileDeploy(stmtTextInsertOne, path);<NEW_LINE>sendTimer(11000, env);<NEW_LINE>env.assertListenerNotInvoked("select");<NEW_LINE>env.milestone(0);<NEW_LINE>sendTimer(21000, env);<NEW_LINE>env.assertListenerNotInvoked("select");<NEW_LINE>sendSupportBean(env, "E1", 1);<NEW_LINE>sendTimer(31000, env);<NEW_LINE>env.assertEqualsNew("select", "theString", "E1");<NEW_LINE>env.undeployAll();<NEW_LINE>} | , path).addListener("select"); |
850,341 | public ProviderDescription unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ProviderDescription providerDescription = new ProviderDescription();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (name.equals("ProviderName")) {<NEW_LINE>providerDescription.setProviderName(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("ProviderType")) {<NEW_LINE>providerDescription.setProviderType(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("LastModifiedDate")) {<NEW_LINE>providerDescription.setLastModifiedDate(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("CreationDate")) {<NEW_LINE>providerDescription.setCreationDate(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return providerDescription;<NEW_LINE>} | String name = reader.nextName(); |
1,514,114 | public static DescribeDeviceInfoResponse unmarshall(DescribeDeviceInfoResponse describeDeviceInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDeviceInfoResponse.setRequestId(_ctx.stringValue("DescribeDeviceInfoResponse.RequestId"));<NEW_LINE>describeDeviceInfoResponse.setPageSize(_ctx.integerValue("DescribeDeviceInfoResponse.PageSize"));<NEW_LINE>describeDeviceInfoResponse.setCurrentPage(_ctx.integerValue("DescribeDeviceInfoResponse.CurrentPage"));<NEW_LINE>describeDeviceInfoResponse.setTotalCount(_ctx.integerValue("DescribeDeviceInfoResponse.TotalCount"));<NEW_LINE>List<DeviceInfo> deviceInfoList = new ArrayList<DeviceInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDeviceInfoResponse.DeviceInfoList.Length"); i++) {<NEW_LINE>DeviceInfo deviceInfo = new DeviceInfo();<NEW_LINE>deviceInfo.setDeviceId(_ctx.stringValue("DescribeDeviceInfoResponse.DeviceInfoList[" + i + "].DeviceId"));<NEW_LINE>deviceInfo.setUserDeviceId(_ctx.stringValue<MASK><NEW_LINE>deviceInfo.setBizType(_ctx.stringValue("DescribeDeviceInfoResponse.DeviceInfoList[" + i + "].BizType"));<NEW_LINE>deviceInfo.setBeginDay(_ctx.stringValue("DescribeDeviceInfoResponse.DeviceInfoList[" + i + "].BeginDay"));<NEW_LINE>deviceInfo.setExpiredDay(_ctx.stringValue("DescribeDeviceInfoResponse.DeviceInfoList[" + i + "].ExpiredDay"));<NEW_LINE>deviceInfoList.add(deviceInfo);<NEW_LINE>}<NEW_LINE>describeDeviceInfoResponse.setDeviceInfoList(deviceInfoList);<NEW_LINE>return describeDeviceInfoResponse;<NEW_LINE>} | ("DescribeDeviceInfoResponse.DeviceInfoList[" + i + "].UserDeviceId")); |
1,647,379 | protected void performAction(final IAdaptable[] files, final ISiteConnection site) throws CoreException {<NEW_LINE>final IConnectionPoint source = site.getSource();<NEW_LINE>final IConnectionPoint dest = site.getDestination();<NEW_LINE>UIUtils.getDisplay().asyncExec(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>IFileStore[] fileStores = SyncUtils.getFileStores(files);<NEW_LINE>ConnectionPointSyncPair cpsp = new ConnectionPointSyncPair(source, dest);<NEW_LINE>SmartSyncDialog dialog = new SmartSyncDialog(getShell(), cpsp, fileStores, null);<NEW_LINE>dialog.open();<NEW_LINE>dialog.setHandler(new SyncEventHandlerAdapter() {<NEW_LINE><NEW_LINE>public void syncDone(VirtualFileSyncPair item, IProgressMonitor monitor) {<NEW_LINE>IResource resource = (IResource) source.getAdapter(IResource.class);<NEW_LINE>if (resource != null) {<NEW_LINE>try {<NEW_LINE>resource.refreshLocal(IResource.DEPTH_INFINITE, null);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (CoreException e) {<NEW_LINE>MessageBox error = new MessageBox(UIUtils.getActiveShell(), <MASK><NEW_LINE>error.setMessage(Messages.SynchronizeProjectAction_ERR_OpeningSyncDialog);<NEW_LINE>error.open();<NEW_LINE>} finally {<NEW_LINE>Map<String, String> payload = new HashMap<String, String>(2);<NEW_LINE>// $NON-NLS-1$}<NEW_LINE>payload.put("sourceType", site.getSource().getType());<NEW_LINE>// $NON-NLS-1$}<NEW_LINE>sendEvent(new FeatureEvent("remote.sync." + site.getDestination().getType(), payload));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | SWT.ICON_ERROR | SWT.OK); |
410,555 | // javadoc:Mat::put(idx,data)<NEW_LINE>public int put(int[] idx, byte[] data) {<NEW_LINE>int t = type();<NEW_LINE>if (data == null || data.length % CvType.channels(t) != 0)<NEW_LINE>throw new UnsupportedOperationException("Provided data element number (" + (data == null ? 0 : data.length) + ") should be multiple of the Mat channels count (" + CvType.channels(t) + ")");<NEW_LINE>if (idx.length != dims())<NEW_LINE>throw new IllegalArgumentException("Incorrect number of indices");<NEW_LINE>if (CvType.depth(t) == CvType.CV_8U || CvType.depth(t) == CvType.CV_8S) {<NEW_LINE>return nPutBIdx(nativeObj, <MASK><NEW_LINE>}<NEW_LINE>throw new UnsupportedOperationException("Mat data type is not compatible: " + t);<NEW_LINE>} | idx, data.length, data); |
677,414 | public synchronized void syncMappingInfo() {<NEW_LINE>List<MetricMappingInfo> infos = null;<NEW_LINE>try {<NEW_LINE>BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder();<NEW_LINE>boolQueryBuilder.filter(new TermQueryBuilder("metric_pk", true));<NEW_LINE>infos = MappingUtil.scanMappingInfo(highLevelClient, metricMappingIndexName, boolQueryBuilder);<NEW_LINE>log.info("end to real syncMappingInfo, info size " + infos.size());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>try {<NEW_LINE>handleException(e);<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>log.error(String.format("syncMappingInfo of index %s error %s", metricMappingIndexName, throwable.getMessage()), throwable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (infos != null) {<NEW_LINE>Map<String, MetricMappingInfo> tempMetricToMappingInfo = Maps.newConcurrentMap();<NEW_LINE>Map<String, Set<Integer>> tempTenantToNumbers = Maps.newConcurrentMap();<NEW_LINE>for (MetricMappingInfo metricMappingInfo : infos) {<NEW_LINE>String metric = metricMappingInfo.getMetric();<NEW_LINE>String tenant = metricMappingInfo.getTenant();<NEW_LINE>int number = metricMappingInfo.getNumber();<NEW_LINE>tempMetricToMappingInfo.put(metric, metricMappingInfo);<NEW_LINE>if (needKeepTenantNumber(tenant)) {<NEW_LINE>Set<Integer> numbers = tempTenantToNumbers.computeIfAbsent(tenant, <MASK><NEW_LINE>numbers.add(number);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>metricToMappingInfo = tempMetricToMappingInfo;<NEW_LINE>tenantToNumbers = tempTenantToNumbers;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>MappingUtil.updateTenantAccessTime(highLevelClient, tenantAccessTimes, metricMappingIndexName);<NEW_LINE>tenantAccessTimes.clear();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>log.error(String.format("update access time error %s", e.getMessage()), e);<NEW_LINE>}<NEW_LINE>} | t -> Sets.newConcurrentHashSet()); |
407,833 | public void updateClob(String columnLabel, Reader x) throws SQLException {<NEW_LINE>try {<NEW_LINE>rsetImpl.updateClob(columnLabel, x);<NEW_LINE>} catch (SQLException sqlX) {<NEW_LINE>FFDCFilter.processException(sqlX, getClass().getName() + ".updateClob", "3857", this);<NEW_LINE>throw <MASK><NEW_LINE>} catch (NullPointerException nullX) {<NEW_LINE>// No FFDC code needed; we might be closed.<NEW_LINE>throw runtimeXIfNotClosed(nullX);<NEW_LINE>} catch (AbstractMethodError methError) {<NEW_LINE>// No FFDC code needed; wrong JDBC level.<NEW_LINE>throw AdapterUtil.notSupportedX("ResultSet.updateClob", methError);<NEW_LINE>} catch (RuntimeException runX) {<NEW_LINE>FFDCFilter.processException(runX, getClass().getName() + ".updateClob", "4503", this);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "updateClob", runX);<NEW_LINE>throw runX;<NEW_LINE>} catch (Error err) {<NEW_LINE>FFDCFilter.processException(err, getClass().getName() + ".updateClob", "4510", this);<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "updateClob", err);<NEW_LINE>throw err;<NEW_LINE>}<NEW_LINE>} | WSJdbcUtil.mapException(this, sqlX); |
442,814 | private List<LayerDeclaration> createDeclarations(AmidstSettings settings, List<Integer> enabledLayers) {<NEW_LINE>LayerDeclaration[] declarations = new LayerDeclaration[LayerIds.NUMBER_OF_LAYERS];<NEW_LINE>// @formatter:off<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.ALPHA, null, false, Setting.createImmutable(true));<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.BIOME_DATA, Dimension.OVERWORLD, false, Setting.createImmutable(true));<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.END_ISLANDS, Dimension.END, false, Setting.createImmutable(true));<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.BACKGROUND, null, false<MASK><NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.SLIME, Dimension.OVERWORLD, false, settings.showSlimeChunks);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.GRID, null, true, settings.showGrid);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.SPAWN, Dimension.OVERWORLD, false, settings.showSpawn);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.STRONGHOLD, Dimension.OVERWORLD, false, settings.showStrongholds);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.PLAYER, null, false, settings.showPlayers);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.VILLAGE, Dimension.OVERWORLD, false, settings.showVillages);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.TEMPLE, Dimension.OVERWORLD, false, settings.showTemples);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.MINESHAFT, Dimension.OVERWORLD, false, settings.showMineshafts);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.OCEAN_MONUMENT, Dimension.OVERWORLD, false, settings.showOceanMonuments);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.WOODLAND_MANSION, Dimension.OVERWORLD, false, settings.showWoodlandMansions);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.OCEAN_FEATURES, Dimension.OVERWORLD, false, settings.showOceanFeatures);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.NETHER_FEATURES, Dimension.OVERWORLD, false, settings.showNetherFortresses);<NEW_LINE>declare(settings, declarations, enabledLayers, LayerIds.END_CITY, Dimension.END, false, settings.showEndCities);<NEW_LINE>// @formatter:on<NEW_LINE>return Collections.unmodifiableList(Arrays.asList(declarations));<NEW_LINE>} | , Setting.createImmutable(true)); |
1,646,338 | public static ASTNode findNode(CompilationUnit cu, int offset, IJavaElement element) {<NEW_LINE>ASTNode node = findNode(cu, offset);<NEW_LINE>if (node == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (element.getElementType() == IJavaElement.TYPE_PARAMETER) {<NEW_LINE>element = element.getParent();<NEW_LINE>}<NEW_LINE>switch(element.getElementType()) {<NEW_LINE>case IJavaElement.PACKAGE_DECLARATION:<NEW_LINE>node = resolveNode(node, PackageDeclaration.class);<NEW_LINE>break;<NEW_LINE>case IJavaElement.IMPORT_DECLARATION:<NEW_LINE>node = resolveNode(node, ImportDeclaration.class);<NEW_LINE>break;<NEW_LINE>case IJavaElement.TYPE:<NEW_LINE>node = resolveNode(node, AbstractTypeDeclaration.class);<NEW_LINE>break;<NEW_LINE>case IJavaElement.INITIALIZER:<NEW_LINE>node = <MASK><NEW_LINE>break;<NEW_LINE>case IJavaElement.FIELD:<NEW_LINE>node = resolveNode(node, FieldDeclaration.class);<NEW_LINE>break;<NEW_LINE>case IJavaElement.METHOD:<NEW_LINE>node = resolveNode(node, MethodDeclaration.class);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.info("findNode(CompilationUnit,int,IJavaElement) - " + "unrecognized element type " + element.getElementType());<NEW_LINE>}<NEW_LINE>return node;<NEW_LINE>} | resolveNode(node, Initializer.class); |
893,184 | private static Optional<File> extractPlugin(File pluginArchive, PluginInfo info) throws IOException {<NEW_LINE>logger.info("Extracting {} plugin from zip file ", info.getLabel());<NEW_LINE>File tempDir = new File(pluginArchive.getParentFile(), <MASK><NEW_LINE>tempDir.deleteOnExit();<NEW_LINE>tempDir.mkdir();<NEW_LINE>ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(pluginArchive)));<NEW_LINE>ZipEntry entry;<NEW_LINE>byte[] buffer = new byte[4068];<NEW_LINE>while ((entry = zis.getNextEntry()) != null) {<NEW_LINE>// Skip Mac rubbish!<NEW_LINE>if (entry.getName().contains(".DS_Store")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (entry.getName().contains("__MACOSX")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>File curFile = new File(tempDir, entry.getName());<NEW_LINE>if (entry.isDirectory()) {<NEW_LINE>curFile.mkdirs();<NEW_LINE>} else {<NEW_LINE>OutputStream os = new BufferedOutputStream(new FileOutputStream(curFile));<NEW_LINE>int count = 0;<NEW_LINE>while ((count = zis.read(buffer)) != -1) {<NEW_LINE>os.write(buffer, 0, count);<NEW_LINE>}<NEW_LINE>os.flush();<NEW_LINE>os.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return getPluginDir(tempDir);<NEW_LINE>} | pluginArchive.getName() + "-extracted"); |
1,577,289 | final TestAlarmResult executeTestAlarm(TestAlarmRequest testAlarmRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(testAlarmRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TestAlarmRequest> request = null;<NEW_LINE>Response<TestAlarmResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new TestAlarmRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(testAlarmRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TestAlarm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TestAlarmResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TestAlarmResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
429,226 | public void run() {<NEW_LINE>DenseMatrix BB = (DenseMatrix) b;<NEW_LINE>DenseMatrix CC = (DenseMatrix) C;<NEW_LINE>for (int i0 = blockStep * threadID; i0 < iLimit; i0 += blockStep * LogicalCores) for (int k0 = 0; k0 < kLimit; k0 += blockStep) for (int j0 = 0; j0 < jLimit; j0 += blockStep) {<NEW_LINE>for (int k = k0; k < min(k0 + blockStep, kLimit); k++) {<NEW_LINE>double[] A_row_k = A.matrix[k];<NEW_LINE>double[] B_row_k = BB.matrix[k];<NEW_LINE>for (int i = i0; i < min(i0 + blockStep, iLimit); i++) {<NEW_LINE>final double a = A_row_k[i];<NEW_LINE>final double[] <MASK><NEW_LINE>for (int j = j0; j < min(j0 + blockStep, jLimit); j++) c_row_i[j] += a * B_row_k[j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cdl.countDown();<NEW_LINE>} | c_row_i = CC.matrix[i]; |
764,895 | public void deserialize(ByteBuffer buffer) throws IllegalPathException {<NEW_LINE>// adapt to old version based on version mark<NEW_LINE>int length = buffer.getInt();<NEW_LINE>boolean isOldVersion = true;<NEW_LINE>if (length == PLAN_SINCE_0_14) {<NEW_LINE>length = buffer.getInt();<NEW_LINE>isOldVersion = false;<NEW_LINE>}<NEW_LINE>byte[] bytes = new byte[length];<NEW_LINE>buffer.get(bytes);<NEW_LINE>prefixPath = new <MASK><NEW_LINE>int size = ReadWriteIOUtils.readInt(buffer);<NEW_LINE>measurements = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>measurements.add(ReadWriteIOUtils.readString(buffer));<NEW_LINE>}<NEW_LINE>dataTypes = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>dataTypes.add(TSDataType.values()[buffer.get()]);<NEW_LINE>}<NEW_LINE>encodings = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>encodings.add(TSEncoding.values()[buffer.get()]);<NEW_LINE>}<NEW_LINE>compressors = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>compressors.add(CompressionType.values()[buffer.get()]);<NEW_LINE>}<NEW_LINE>if (!isOldVersion) {<NEW_LINE>tagOffsets = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>tagOffsets.add(buffer.getLong());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// alias<NEW_LINE>if (buffer.get() == 1) {<NEW_LINE>aliasList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>aliasList.add(ReadWriteIOUtils.readString(buffer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isOldVersion) {<NEW_LINE>// tags<NEW_LINE>if (buffer.get() == 1) {<NEW_LINE>tagsList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>tagsList.add(ReadWriteIOUtils.readMap(buffer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// attributes<NEW_LINE>if (buffer.get() == 1) {<NEW_LINE>attributesList = new ArrayList<>();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>attributesList.add(ReadWriteIOUtils.readMap(buffer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.index = buffer.getLong();<NEW_LINE>} | PartialPath(new String(bytes)); |
1,124,011 | public static void vertical9(Kernel1D_S32 kernel, GrayU8 input, GrayI16 output, int skip) {<NEW_LINE>final byte[] dataSrc = input.data;<NEW_LINE>final short[] dataDst = output.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int k8 = kernel.data[7];<NEW_LINE>final int k9 = kernel.data[8];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int width = input.width;<NEW_LINE>final int heightEnd = UtilDownConvolve.computeMaxSide(input.height, skip, radius);<NEW_LINE>final int offsetY = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>for (int y = offsetY; y <= heightEnd; y += skip) {<NEW_LINE>int indexDst = output.startIndex + (y / skip) * output.stride;<NEW_LINE>int i = input.startIndex + (y - radius) * input.stride;<NEW_LINE>final int iEnd = i + width;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc] & 0xFF) * k1;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k2;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc<MASK><NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k4;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k5;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k6;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k7;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k8;<NEW_LINE>indexSrc += input.stride;<NEW_LINE>total += (dataSrc[indexSrc] & 0xFF) * k9;<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | [indexSrc] & 0xFF) * k3; |
783,849 | public static void main(String[] args) {<NEW_LINE>Exercise30_DynamicMedianFinding.DynamicMedianFindingHeap<Integer> dynamicMedianFindingHeap = new Exercise30_DynamicMedianFinding().new DynamicMedianFindingHeap<>();<NEW_LINE>dynamicMedianFindingHeap.insert(1);<NEW_LINE>dynamicMedianFindingHeap.insert(2);<NEW_LINE>dynamicMedianFindingHeap.insert(3);<NEW_LINE>dynamicMedianFindingHeap.insert(4);<NEW_LINE>dynamicMedianFindingHeap.insert(5);<NEW_LINE>dynamicMedianFindingHeap.insert(6);<NEW_LINE>dynamicMedianFindingHeap.insert(7);<NEW_LINE>StdOut.println("Median: " + dynamicMedianFindingHeap.findTheMedian() + " Expected: 4");<NEW_LINE>StdOut.println("Delete Median: " + <MASK><NEW_LINE>// When we have an even number of values, pick the left one<NEW_LINE>StdOut.println("Median: " + dynamicMedianFindingHeap.findTheMedian() + " Expected: 3");<NEW_LINE>dynamicMedianFindingHeap.deleteMedian();<NEW_LINE>dynamicMedianFindingHeap.insert(99);<NEW_LINE>dynamicMedianFindingHeap.insert(100);<NEW_LINE>StdOut.println("Median: " + dynamicMedianFindingHeap.findTheMedian() + " Expected: 6");<NEW_LINE>} | dynamicMedianFindingHeap.deleteMedian() + " Expected: 4"); |
1,431,634 | public void addMethod(RubyContext context, Node currentNode, InternalMethod method) {<NEW_LINE>assert // TODO (pitr-ch 24-Jul-2016): find out why undefined methods sometimes do not match above assertion<NEW_LINE>ModuleOperations.canBindMethodTo(method, rubyModule) || ModuleOperations.assignableTo(context.getCoreLibrary().objectClass, method.getDeclaringModule()) || // e.g. "block in _routes route_set.rb:525" in rails/actionpack/lib/action_dispatch/routing/<NEW_LINE>(method.isUndefined() && methods.get(method.getName()) != null);<NEW_LINE>checkFrozen(context, currentNode);<NEW_LINE>if (SharedObjects.isShared(rubyModule)) {<NEW_LINE>Set<Object> adjacent = ObjectGraph.newObjectSet();<NEW_LINE>ObjectGraph.addProperty(adjacent, method);<NEW_LINE>for (Object object : adjacent) {<NEW_LINE>SharedObjects.writeBarrier(context.getLanguageSlow(), object);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MethodEntry previousMethodEntry = methods.put(method.getName(), new MethodEntry(method));<NEW_LINE>if (!context.getCoreLibrary().isInitializing()) {<NEW_LINE>if (previousMethodEntry != null) {<NEW_LINE>previousMethodEntry.invalidate(rubyModule, method.getName());<NEW_LINE>}<NEW_LINE>if (includedBy != null && !includedBy.isEmpty()) {<NEW_LINE>invalidateMethodIncludedBy(method.getName());<NEW_LINE>}<NEW_LINE>// invalidate assumptions to not use an AST-inlined methods<NEW_LINE>changedMethod(method.getName());<NEW_LINE>if (refinedModule != null) {<NEW_LINE>refinedModule.fields.changedMethod(method.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (context.getCoreLibrary().isLoaded() && !method.isUndefined()) {<NEW_LINE>final RubySymbol methodSymbol = context.getLanguageSlow().getSymbol(method.getName());<NEW_LINE>if (RubyGuards.isSingletonClass(rubyModule)) {<NEW_LINE>RubyDynamicObject receiver = ((RubyClass) rubyModule).attached;<NEW_LINE>RubyContext.send(currentNode, receiver, "singleton_method_added", methodSymbol);<NEW_LINE>} else {<NEW_LINE>RubyContext.send(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | currentNode, rubyModule, "method_added", methodSymbol); |
493,241 | public void marshall(DescribedServer describedServer, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (describedServer == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(describedServer.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getCertificate(), CERTIFICATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getProtocolDetails(), PROTOCOLDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getDomain(), DOMAIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getEndpointDetails(), ENDPOINTDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getEndpointType(), ENDPOINTTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getHostKeyFingerprint(), HOSTKEYFINGERPRINT_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getIdentityProviderDetails(), IDENTITYPROVIDERDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getIdentityProviderType(), IDENTITYPROVIDERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getLoggingRole(), LOGGINGROLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getPostAuthenticationLoginBanner(), POSTAUTHENTICATIONLOGINBANNER_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getPreAuthenticationLoginBanner(), PREAUTHENTICATIONLOGINBANNER_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(describedServer.getSecurityPolicyName(), SECURITYPOLICYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getServerId(), SERVERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getState(), STATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getUserCount(), USERCOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(describedServer.getWorkflowDetails(), WORKFLOWDETAILS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | describedServer.getProtocols(), PROTOCOLS_BINDING); |
644,283 | public static DescribeSlowSQLLogsResponse unmarshall(DescribeSlowSQLLogsResponse describeSlowSQLLogsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSlowSQLLogsResponse.setRequestId(_ctx.stringValue("DescribeSlowSQLLogsResponse.RequestId"));<NEW_LINE>describeSlowSQLLogsResponse.setPageRecordCount(_ctx.integerValue("DescribeSlowSQLLogsResponse.PageRecordCount"));<NEW_LINE>describeSlowSQLLogsResponse.setPageNumber<MASK><NEW_LINE>List<Item> items = new ArrayList<Item>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSlowSQLLogsResponse.Items.Length"); i++) {<NEW_LINE>Item item = new Item();<NEW_LINE>item.setOperationClass(_ctx.stringValue("DescribeSlowSQLLogsResponse.Items[" + i + "].OperationClass"));<NEW_LINE>item.setExecuteState(_ctx.stringValue("DescribeSlowSQLLogsResponse.Items[" + i + "].ExecuteState"));<NEW_LINE>item.setExecuteCost(_ctx.floatValue("DescribeSlowSQLLogsResponse.Items[" + i + "].ExecuteCost"));<NEW_LINE>item.setSQLText(_ctx.stringValue("DescribeSlowSQLLogsResponse.Items[" + i + "].SQLText"));<NEW_LINE>item.setSourcePort(_ctx.integerValue("DescribeSlowSQLLogsResponse.Items[" + i + "].SourcePort"));<NEW_LINE>item.setDBRole(_ctx.stringValue("DescribeSlowSQLLogsResponse.Items[" + i + "].DBRole"));<NEW_LINE>item.setOperationType(_ctx.stringValue("DescribeSlowSQLLogsResponse.Items[" + i + "].OperationType"));<NEW_LINE>item.setSourceIP(_ctx.stringValue("DescribeSlowSQLLogsResponse.Items[" + i + "].SourceIP"));<NEW_LINE>item.setSQLPlan(_ctx.stringValue("DescribeSlowSQLLogsResponse.Items[" + i + "].SQLPlan"));<NEW_LINE>item.setReturnRowCounts(_ctx.longValue("DescribeSlowSQLLogsResponse.Items[" + i + "].ReturnRowCounts"));<NEW_LINE>item.setDBName(_ctx.stringValue("DescribeSlowSQLLogsResponse.Items[" + i + "].DBName"));<NEW_LINE>item.setOperationExecuteTime(_ctx.stringValue("DescribeSlowSQLLogsResponse.Items[" + i + "].OperationExecuteTime"));<NEW_LINE>item.setScanRowCounts(_ctx.longValue("DescribeSlowSQLLogsResponse.Items[" + i + "].ScanRowCounts"));<NEW_LINE>item.setAccountName(_ctx.stringValue("DescribeSlowSQLLogsResponse.Items[" + i + "].AccountName"));<NEW_LINE>item.setQueryId(_ctx.stringValue("DescribeSlowSQLLogsResponse.Items[" + i + "].QueryId"));<NEW_LINE>items.add(item);<NEW_LINE>}<NEW_LINE>describeSlowSQLLogsResponse.setItems(items);<NEW_LINE>return describeSlowSQLLogsResponse;<NEW_LINE>} | (_ctx.integerValue("DescribeSlowSQLLogsResponse.PageNumber")); |
1,397,925 | private void sendListing(ChannelHandlerContext ctx, File dir, String dirPath) {<NEW_LINE>StringBuilder buf = new StringBuilder().append("<!DOCTYPE html>\r\n").append("<html><head><meta charset='utf-8' /><title>").append("Listing of: ").append(dirPath).append("</title></head><body>\r\n").append("<h3>Listing of: ").append(dirPath).append("</h3>\r\n").append("<ul>").append("<li><a href=\"../\">..</a></li>\r\n");<NEW_LINE>File[] files = dir.listFiles();<NEW_LINE>if (files != null) {<NEW_LINE>for (File f : files) {<NEW_LINE>if (f.isHidden() || !f.canRead()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String name = f.getName();<NEW_LINE>if (!ALLOWED_FILE_NAME.matcher(name).matches()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>buf.append("<li><a href=\"").append(name).append("\">").append(name).append("</a></li>\r\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buf.append("</ul></body></html>\r\n");<NEW_LINE>ByteBuf buffer = ctx.alloc().<MASK><NEW_LINE>buffer.writeCharSequence(buf.toString(), CharsetUtil.UTF_8);<NEW_LINE>Http2Headers headers = new DefaultHttp2Headers();<NEW_LINE>headers.status(OK.toString());<NEW_LINE>headers.add(HttpHeaderNames.CONTENT_TYPE, "text/html; charset=UTF-8");<NEW_LINE>ctx.write(new DefaultHttp2HeadersFrame(headers).stream(stream));<NEW_LINE>ctx.writeAndFlush(new DefaultHttp2DataFrame(buffer, true).stream(stream));<NEW_LINE>} | buffer(buf.length()); |
1,055,560 | public void levelOrderInput() {<NEW_LINE>LinkedList<Integer> inputData = new LinkedList<>();<NEW_LINE>LinkedList<Node> nodes = new LinkedList<>();<NEW_LINE>Node root = new Node();<NEW_LINE>int data = scan.nextInt();<NEW_LINE>root.data = data;<NEW_LINE>nodes.addLast(root);<NEW_LINE>int flag = 1;<NEW_LINE>int total = 1;<NEW_LINE>while (flag <= total) {<NEW_LINE>data = scan.nextInt();<NEW_LINE>inputData.addLast(data);<NEW_LINE>if (data != -1)<NEW_LINE>total += 1;<NEW_LINE>data = scan.nextInt();<NEW_LINE>inputData.addLast(data);<NEW_LINE>if (data != -1)<NEW_LINE>total += 1;<NEW_LINE><MASK><NEW_LINE>Node lchild = new Node();<NEW_LINE>Node rchild = new Node();<NEW_LINE>int ldata = inputData.removeFirst();<NEW_LINE>int rdata = inputData.removeFirst();<NEW_LINE>if (ldata == -1)<NEW_LINE>lchild = null;<NEW_LINE>else<NEW_LINE>lchild.data = ldata;<NEW_LINE>if (rdata == -1)<NEW_LINE>rchild = null;<NEW_LINE>else<NEW_LINE>rchild.data = rdata;<NEW_LINE>pos.left = lchild;<NEW_LINE>pos.right = rchild;<NEW_LINE>if (lchild != null)<NEW_LINE>nodes.addLast(lchild);<NEW_LINE>if (rchild != null)<NEW_LINE>nodes.addLast(rchild);<NEW_LINE>flag++;<NEW_LINE>}<NEW_LINE>this.root = root;<NEW_LINE>} | Node pos = nodes.removeFirst(); |
1,049,575 | private static SpanContext extractContextFromTraceParent(String traceparent) {<NEW_LINE>// TODO(bdrutu): Do we need to verify that version is hex and that<NEW_LINE>// for the version the length is the expected one?<NEW_LINE>boolean isValid = (traceparent.length() == TRACEPARENT_HEADER_SIZE || (traceparent.length() > TRACEPARENT_HEADER_SIZE && traceparent.charAt(TRACEPARENT_HEADER_SIZE) == TRACEPARENT_DELIMITER)) && traceparent.charAt(TRACE_ID_OFFSET - 1) == TRACEPARENT_DELIMITER && traceparent.charAt(SPAN_ID_OFFSET - 1) == TRACEPARENT_DELIMITER && traceparent.charAt(TRACE_OPTION_OFFSET - 1) == TRACEPARENT_DELIMITER;<NEW_LINE>if (!isValid) {<NEW_LINE>logger.fine("Unparseable traceparent header. Returning INVALID span context.");<NEW_LINE>return SpanContext.getInvalid();<NEW_LINE>}<NEW_LINE>String version = traceparent.substring(0, 2);<NEW_LINE>if (!VALID_VERSIONS.contains(version)) {<NEW_LINE>return SpanContext.getInvalid();<NEW_LINE>}<NEW_LINE>if (version.equals(VERSION_00) && traceparent.length() > TRACEPARENT_HEADER_SIZE) {<NEW_LINE>return SpanContext.getInvalid();<NEW_LINE>}<NEW_LINE>String traceId = traceparent.substring(TRACE_ID_OFFSET, TRACE_ID_OFFSET + TraceId.getLength());<NEW_LINE>String spanId = traceparent.substring(SPAN_ID_OFFSET, <MASK><NEW_LINE>char firstTraceFlagsChar = traceparent.charAt(TRACE_OPTION_OFFSET);<NEW_LINE>char secondTraceFlagsChar = traceparent.charAt(TRACE_OPTION_OFFSET + 1);<NEW_LINE>if (!OtelEncodingUtils.isValidBase16Character(firstTraceFlagsChar) || !OtelEncodingUtils.isValidBase16Character(secondTraceFlagsChar)) {<NEW_LINE>return SpanContext.getInvalid();<NEW_LINE>}<NEW_LINE>TraceFlags traceFlags = TraceFlags.fromByte(OtelEncodingUtils.byteFromBase16(firstTraceFlagsChar, secondTraceFlagsChar));<NEW_LINE>return SpanContext.createFromRemoteParent(traceId, spanId, traceFlags, TraceState.getDefault());<NEW_LINE>} | SPAN_ID_OFFSET + SpanId.getLength()); |
552,106 | private void fillIssues(Report report) {<NEW_LINE>final List<Issue> issues = new ArrayList<>();<NEW_LINE>Iterator<Issue> itr = report.getIssues(ISSUES_LIMIT);<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>issues.<MASK><NEW_LINE>}<NEW_LINE>if (issues.isEmpty()) {<NEW_LINE>JLabel label = new JLabel(NbBundle.getMessage(getClass(), "ReportPanel.noIssues"));<NEW_LINE>label.setHorizontalAlignment(SwingConstants.CENTER);<NEW_LINE>tab1ScrollPane.setViewportView(label);<NEW_LINE>} else {<NEW_LINE>// Busy label<NEW_LINE>final BusyUtils.BusyLabel busyLabel = BusyUtils.createCenteredBusyLabel(tab1ScrollPane, "Retrieving issues...", issuesOutline);<NEW_LINE>// Thread<NEW_LINE>Thread thread = new Thread(fillingThreads, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>busyLabel.setBusy(true);<NEW_LINE>final TreeModel treeMdl = new IssueTreeModel(issues);<NEW_LINE>final OutlineModel mdl = DefaultOutlineModel.createOutlineModel(treeMdl, new IssueRowModel(), true);<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>issuesOutline.setRootVisible(false);<NEW_LINE>issuesOutline.setRenderDataProvider(new IssueRenderer());<NEW_LINE>issuesOutline.setModel(mdl);<NEW_LINE>busyLabel.setBusy(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}, "Report Panel Issues Outline");<NEW_LINE>if (NbPreferences.forModule(ReportPanel.class).getBoolean(SHOW_ISSUES, true)) {<NEW_LINE>thread.start();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | add(itr.next()); |
1,218,899 | public static void showFontSizeDialog(final Activity activity, final int currentSize, final Callback.a1<Integer> callback) {<NEW_LINE>SearchOrCustomTextDialog.DialogOptions dopt = new SearchOrCustomTextDialog.DialogOptions();<NEW_LINE>baseConf(activity, dopt);<NEW_LINE>dopt.callback = (selectedDialogValueAsString -> callback.callback(Integer.parseInt(selectedDialogValueAsString)));<NEW_LINE>final int minFontSize = 1;<NEW_LINE>final int maxFontSize = 36;<NEW_LINE>final List<String> <MASK><NEW_LINE>for (int i = minFontSize; i <= maxFontSize; i++) {<NEW_LINE>sizes.add(Integer.toString(i));<NEW_LINE>}<NEW_LINE>dopt.data = sizes;<NEW_LINE>dopt.highlightData = Collections.singletonList(Integer.toString(currentSize));<NEW_LINE>dopt.isSearchEnabled = false;<NEW_LINE>dopt.dialogWidthDp = WindowManager.LayoutParams.WRAP_CONTENT;<NEW_LINE>dopt.dialogHeightDp = 400;<NEW_LINE>dopt.titleText = R.string.font_size;<NEW_LINE>SearchOrCustomTextDialog.showMultiChoiceDialogWithSearchFilterUI(activity, dopt);<NEW_LINE>} | sizes = new ArrayList<>(); |
546,408 | private Collection<? extends ShipmentScheduleWithHU> createShipmentScheduleWithHUForPick(@NonNull final I_M_ShipmentSchedule schedule, @NonNull final IHUContext huContext, @NonNull final M_ShipmentSchedule_QuantityTypeToUse quantityType) {<NEW_LINE>List<I_M_ShipmentSchedule_QtyPicked> qtyPickedRecords = retrieveQtyPickedRecords(schedule);<NEW_LINE>if (qtyPickedRecords.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>final List<ShipmentScheduleWithHU> <MASK><NEW_LINE>//<NEW_LINE>// Create necessary LUs (if any)<NEW_LINE>createLUsIfNeeded(schedule, quantityType);<NEW_LINE>// retrieve the qty picked entries again, some new ones might have been created on LU creation<NEW_LINE>qtyPickedRecords = retrieveQtyPickedRecords(schedule);<NEW_LINE>//<NEW_LINE>// Iterate all QtyPicked records and create candidates from them<NEW_LINE>for (final de.metas.inoutcandidate.model.I_M_ShipmentSchedule_QtyPicked qtyPickedRecord : qtyPickedRecords) {<NEW_LINE>final I_M_ShipmentSchedule_QtyPicked qtyPickedRecordHU = InterfaceWrapperHelper.create(qtyPickedRecord, I_M_ShipmentSchedule_QtyPicked.class);<NEW_LINE>// guard: Skip inactive records.<NEW_LINE>if (!qtyPickedRecordHU.isActive()) {<NEW_LINE>Loggables.withLogger(logger, Level.INFO).addLog("Skipped inactive qtyPickedRecordHU={}", qtyPickedRecordHU);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Create ShipmentSchedule+HU candidate and add it to our list<NEW_LINE>final ShipmentScheduleWithHU //<NEW_LINE>//<NEW_LINE>candidate = ShipmentScheduleWithHU.ofShipmentScheduleQtyPickedWithHuContext(qtyPickedRecordHU, huContext, quantityType);<NEW_LINE>candidatesForPick.add(candidate);<NEW_LINE>}<NEW_LINE>return candidatesForPick;<NEW_LINE>} | candidatesForPick = new ArrayList<>(); |
960,526 | public static DescribeDisksFullStatusResponse unmarshall(DescribeDisksFullStatusResponse describeDisksFullStatusResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDisksFullStatusResponse.setRequestId(_ctx.stringValue("DescribeDisksFullStatusResponse.RequestId"));<NEW_LINE>describeDisksFullStatusResponse.setPageSize(_ctx.integerValue("DescribeDisksFullStatusResponse.PageSize"));<NEW_LINE>describeDisksFullStatusResponse.setPageNumber(_ctx.integerValue("DescribeDisksFullStatusResponse.PageNumber"));<NEW_LINE>describeDisksFullStatusResponse.setTotalCount(_ctx.integerValue("DescribeDisksFullStatusResponse.TotalCount"));<NEW_LINE>List<DiskFullStatusType> diskFullStatusSet = new ArrayList<DiskFullStatusType>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDisksFullStatusResponse.DiskFullStatusSet.Length"); i++) {<NEW_LINE>DiskFullStatusType diskFullStatusType = new DiskFullStatusType();<NEW_LINE>diskFullStatusType.setDiskId(_ctx.stringValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].DiskId"));<NEW_LINE>diskFullStatusType.setInstanceId(_ctx.stringValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].InstanceId"));<NEW_LINE>diskFullStatusType.setDevice(_ctx.stringValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].Device"));<NEW_LINE>Status status = new Status();<NEW_LINE>status.setName(_ctx.stringValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].Status.Name"));<NEW_LINE>status.setCode(_ctx.integerValue<MASK><NEW_LINE>diskFullStatusType.setStatus(status);<NEW_LINE>HealthStatus healthStatus = new HealthStatus();<NEW_LINE>healthStatus.setName(_ctx.stringValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].HealthStatus.Name"));<NEW_LINE>healthStatus.setCode(_ctx.integerValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].HealthStatus.Code"));<NEW_LINE>diskFullStatusType.setHealthStatus(healthStatus);<NEW_LINE>List<DiskEventType> diskEventSet = new ArrayList<DiskEventType>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].DiskEventSet.Length"); j++) {<NEW_LINE>DiskEventType diskEventType = new DiskEventType();<NEW_LINE>diskEventType.setEventId(_ctx.stringValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].DiskEventSet[" + j + "].EventId"));<NEW_LINE>diskEventType.setEventEndTime(_ctx.stringValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].DiskEventSet[" + j + "].EventEndTime"));<NEW_LINE>diskEventType.setEventTime(_ctx.stringValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].DiskEventSet[" + j + "].EventTime"));<NEW_LINE>diskEventType.setImpactLevel(_ctx.stringValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].DiskEventSet[" + j + "].ImpactLevel"));<NEW_LINE>EventType eventType = new EventType();<NEW_LINE>eventType.setName(_ctx.stringValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].DiskEventSet[" + j + "].EventType.Name"));<NEW_LINE>eventType.setCode(_ctx.integerValue("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].DiskEventSet[" + j + "].EventType.Code"));<NEW_LINE>diskEventType.setEventType(eventType);<NEW_LINE>diskEventSet.add(diskEventType);<NEW_LINE>}<NEW_LINE>diskFullStatusType.setDiskEventSet(diskEventSet);<NEW_LINE>diskFullStatusSet.add(diskFullStatusType);<NEW_LINE>}<NEW_LINE>describeDisksFullStatusResponse.setDiskFullStatusSet(diskFullStatusSet);<NEW_LINE>return describeDisksFullStatusResponse;<NEW_LINE>} | ("DescribeDisksFullStatusResponse.DiskFullStatusSet[" + i + "].Status.Code")); |
1,291,926 | protected String doIt() throws Exception {<NEW_LINE>// Instance current Payment Selection<NEW_LINE>MPaySelection paySelection = new MPaySelection(getCtx(), getRecord_ID(), get_TrxName());<NEW_LINE>sequence.set(paySelection.getLastLineNo());<NEW_LINE>// Loop for keys<NEW_LINE>getSelectionKeys().forEach(key -> {<NEW_LINE>// get values from result set<NEW_LINE>int movementId = key;<NEW_LINE>String <MASK><NEW_LINE>BigDecimal sourceAmount = getSelectionAsBigDecimal(key, "HRM_Amount");<NEW_LINE>BigDecimal convertedAmount = getSelectionAsBigDecimal(key, "HRM_ConvertedAmount");<NEW_LINE>MPaySelectionLine line = new MPaySelectionLine(paySelection, sequence.getAndAdd(10), paymentRule);<NEW_LINE>// Add Order<NEW_LINE>X_HR_Movement payrollMovement = new X_HR_Movement(getCtx(), movementId, get_TrxName());<NEW_LINE>Optional<X_HR_Process> mybePayrollProcess = Optional.ofNullable(payrollProcessMap.get(payrollMovement.getHR_Process_ID()));<NEW_LINE>X_HR_Process payrollProcess = mybePayrollProcess.orElseGet(() -> {<NEW_LINE>X_HR_Process processFromMovement = (X_HR_Process) payrollMovement.getHR_Process();<NEW_LINE>payrollProcessMap.put(payrollMovement.getHR_Process_ID(), processFromMovement);<NEW_LINE>return processFromMovement;<NEW_LINE>});<NEW_LINE>// Set from Payroll Movement and conversion type<NEW_LINE>line.setHRMovement(payrollMovement, payrollProcess.getC_ConversionType_ID(), sourceAmount, convertedAmount);<NEW_LINE>// Save<NEW_LINE>line.saveEx();<NEW_LINE>});<NEW_LINE>// Default Ok<NEW_LINE>return "@OK@";<NEW_LINE>} | paymentRule = getSelectionAsString(key, "HRM_PaymentRule"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.