idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,330,408 | public void listDeletedSecretsCodeSnippets() {<NEW_LINE>SecretClient secretClient = getSecretClient();<NEW_LINE>// BEGIN: com.azure.security.keyvault.secretclient.listDeletedSecrets<NEW_LINE>for (DeletedSecret deletedSecret : secretClient.listDeletedSecrets()) {<NEW_LINE>System.out.printf("Deleted secret's recovery Id %s", deletedSecret.getRecoveryId());<NEW_LINE>}<NEW_LINE>// END: com.azure.security.keyvault.secretclient.listDeletedSecrets<NEW_LINE>// BEGIN: com.azure.security.keyvault.secretclient.listDeletedSecrets#Context<NEW_LINE>for (DeletedSecret deletedSecret : secretClient.listDeletedSecrets(new Context(key1, value2))) {<NEW_LINE>System.out.printf("Deleted secret's recovery Id %s", deletedSecret.getRecoveryId());<NEW_LINE>}<NEW_LINE>// END: com.azure.security.keyvault.secretclient.listDeletedSecrets#Context<NEW_LINE>// BEGIN: com.azure.security.keyvault.secretclient.listDeletedSecrets.iterableByPage<NEW_LINE>secretClient.listDeletedSecrets().iterableByPage().forEach(resp -> {<NEW_LINE>System.out.printf("Got response headers . Url: %s, Status code: %d %n", resp.getRequest().getUrl(), resp.getStatusCode());<NEW_LINE>resp.getItems().forEach(value -> {<NEW_LINE>System.out.printf(<MASK><NEW_LINE>});<NEW_LINE>});<NEW_LINE>// END: com.azure.security.keyvault.secretclient.listDeletedSecrets.iterableByPage<NEW_LINE>} | "Deleted secret's recovery Id %s", value.getRecoveryId()); |
395,864 | protected void doActivate() {<NEW_LINE>if (!isActivated) {<NEW_LINE>isActivated = true;<NEW_LINE>currencyComboBox.setPrefWidth(250);<NEW_LINE>paymentAccountsComboBox.setPrefWidth(250);<NEW_LINE>addBindings();<NEW_LINE>addListeners();<NEW_LINE>addSubscriptions();<NEW_LINE>// temporarily disabled due to high CPU usage (per issue #4649)<NEW_LINE>// if (waitingForFundsSpinner != null)<NEW_LINE>// waitingForFundsSpinner.play();<NEW_LINE>amountDescriptionLabel.setText(model.getAmountDescription());<NEW_LINE>addressTextField.setAddress(model.getAddressAsString());<NEW_LINE>addressTextField.setPaymentLabel(model.getPaymentLabel());<NEW_LINE>paymentAccountsComboBox.setItems(model.getDataModel().getPaymentAccounts());<NEW_LINE>paymentAccountsComboBox.getSelectionModel().select(model.getPaymentAccount());<NEW_LINE>currencyComboBox.getSelectionModel().select(model.getTradeCurrency());<NEW_LINE>onPaymentAccountsComboBoxSelected();<NEW_LINE>balanceTextField.setTargetAmount(model.getDataModel().totalToPayAsCoinProperty().get());<NEW_LINE>updatePriceToggle();<NEW_LINE>boolean currencyForMakerFeeBtc = model<MASK><NEW_LINE>tradeFeeInBtcToggle.setSelected(currencyForMakerFeeBtc);<NEW_LINE>tradeFeeInBsqToggle.setSelected(!currencyForMakerFeeBtc);<NEW_LINE>if (!DevEnv.isDaoActivated()) {<NEW_LINE>tradeFeeInBtcToggle.setVisible(false);<NEW_LINE>tradeFeeInBtcToggle.setManaged(false);<NEW_LINE>tradeFeeInBsqToggle.setVisible(false);<NEW_LINE>tradeFeeInBsqToggle.setManaged(false);<NEW_LINE>buyBsqBox.setVisible(false);<NEW_LINE>buyBsqBox.setManaged(false);<NEW_LINE>} else {<NEW_LINE>buyBsqBox.setVisible(model.isShowBuyBsqHint());<NEW_LINE>buyBsqBox.setManaged(model.isShowBuyBsqHint());<NEW_LINE>}<NEW_LINE>Label popOverLabel = OfferViewUtil.createPopOverLabel(Res.get("createOffer.triggerPrice.tooltip"));<NEW_LINE>triggerPriceInfoInputTextField.setContentForPopOver(popOverLabel, AwesomeIcon.SHIELD);<NEW_LINE>}<NEW_LINE>} | .getDataModel().isCurrencyForMakerFeeBtc(); |
1,378,215 | private void outputUniqueMemberName(final OlapConnection connection, final Catalog catalog, Cube cube, List<Row> rows) throws SQLException {<NEW_LINE>final Object unameRestrictions = restrictions.get(MemberUniqueName.name);<NEW_LINE>List<String> list;<NEW_LINE>if (unameRestrictions instanceof String) {<NEW_LINE>list = Collections.singletonList((String) unameRestrictions);<NEW_LINE>} else {<NEW_LINE>list = (List<String>) unameRestrictions;<NEW_LINE>}<NEW_LINE>for (String memberUniqueName : list) {<NEW_LINE>final IdentifierNode identifierNode = IdentifierNode.parseIdentifier(memberUniqueName);<NEW_LINE>Member member = cube.<MASK><NEW_LINE>if (member == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isRestricted(TreeOp_)) {<NEW_LINE>int treeOp = getRestrictionValueAsInt(TreeOp_);<NEW_LINE>if (treeOp == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>populateMember(connection, catalog, cube, member, treeOp, rows);<NEW_LINE>} else {<NEW_LINE>outputMember(connection, member, catalog, cube, rows);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | lookupMember(identifierNode.getSegmentList()); |
1,349,793 | private void loadNode73() {<NEW_LINE>UaMethodNode node = new UaMethodNode(this.context, Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Open, new QualifiedName(0, "Open"), new LocalizedText("en", "Open"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), true, true);<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Open, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Open_InputArguments<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Open, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Open_OutputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Open, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_Open, Identifiers.HasComponent, Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
29,340 | public TBSCertList generateTBSCertList() {<NEW_LINE>if ((signature == null) || (issuer == null) || (thisUpdate == null)) {<NEW_LINE>throw new IllegalStateException("Not all mandatory fields set in V2 TBSCertList generator.");<NEW_LINE>}<NEW_LINE>ASN1EncodableVector v = new ASN1EncodableVector(7);<NEW_LINE>v.add(version);<NEW_LINE>v.add(signature);<NEW_LINE>v.add(issuer);<NEW_LINE>v.add(thisUpdate);<NEW_LINE>if (nextUpdate != null) {<NEW_LINE>v.add(nextUpdate);<NEW_LINE>}<NEW_LINE>// Add CRLEntries if they exist<NEW_LINE>if (crlentries.size() != 0) {<NEW_LINE>v.<MASK><NEW_LINE>}<NEW_LINE>if (extensions != null) {<NEW_LINE>v.add(new DERTaggedObject(0, extensions));<NEW_LINE>}<NEW_LINE>return new TBSCertList(new DERSequence(v));<NEW_LINE>} | add(new DERSequence(crlentries)); |
1,294,240 | final DeleteFHIRDatastoreResult executeDeleteFHIRDatastore(DeleteFHIRDatastoreRequest deleteFHIRDatastoreRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteFHIRDatastoreRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteFHIRDatastoreRequest> request = null;<NEW_LINE>Response<DeleteFHIRDatastoreResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteFHIRDatastoreRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteFHIRDatastoreRequest));<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, "HealthLake");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteFHIRDatastore");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteFHIRDatastoreResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteFHIRDatastoreResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,268,446 | public void update(final String path, final byte[] bytes) {<NEW_LINE>synchronized (toAnnounce) {<NEW_LINE>if (!started) {<NEW_LINE>// removeParentsIfCreated is not relevant for updates; use dummy value "false".<NEW_LINE>toUpdate.add(new Announceable<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ZKPaths.PathAndNode pathAndNode = ZKPaths.getPathAndNode(path);<NEW_LINE>final String parentPath = pathAndNode.getPath();<NEW_LINE>final String nodePath = pathAndNode.getNode();<NEW_LINE>ConcurrentMap<String, byte[]> subPaths = announcements.get(parentPath);<NEW_LINE>if (subPaths == null || subPaths.get(nodePath) == null) {<NEW_LINE>throw new ISE("Cannot update a path[%s] that hasn't been announced!", path);<NEW_LINE>}<NEW_LINE>synchronized (toAnnounce) {<NEW_LINE>try {<NEW_LINE>byte[] oldBytes = subPaths.get(nodePath);<NEW_LINE>if (!Arrays.equals(oldBytes, bytes)) {<NEW_LINE>subPaths.put(nodePath, bytes);<NEW_LINE>updateAnnouncement(path, bytes);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (path, bytes, false)); |
1,595,389 | ActionResult<Wo> execute(String id, String path0, String path1, String path2, String path3, String path4, JsonElement jsonElement) throws Exception {<NEW_LINE>Callable<ActionResult<Wo>> callable = new Callable<ActionResult<Wo>>() {<NEW_LINE><NEW_LINE>public ActionResult<Wo> call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>ApplicationDict dict = emc.find(id, ApplicationDict.class);<NEW_LINE>if (null == dict) {<NEW_LINE>throw new ExceptionEntityNotExist(id, ApplicationDict.class);<NEW_LINE>}<NEW_LINE>create(business, dict, jsonElement, path0, path1, path2, path3, path4);<NEW_LINE>emc.commit();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.<MASK><NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return ProcessPlatformExecutorFactory.get(id).submit(callable).get(300, TimeUnit.SECONDS);<NEW_LINE>} | setId(dict.getId()); |
1,360,961 | public void validate(final ConfigurationItem citem) {<NEW_LINE>Set<String> classNames = new LinkedHashSet<String>(Arrays.asList(COMMA_SPLITTER.split(citem.getValue())));<NEW_LINE>if (classNames.isEmpty())<NEW_LINE>return;<NEW_LINE>for (final Iterator<String> iter = classNames.iterator(); iter.hasNext(); ) {<NEW_LINE>String fileName = iter.next().trim();<NEW_LINE>if (fileName.isEmpty())<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>if (classNames.isEmpty())<NEW_LINE>return;<NEW_LINE>String className = null;<NEW_LINE>try {<NEW_LINE>final ClassLoader CL;<NEW_LINE>final ObjectName on = new ObjectName(String.format(CLASSLOADER_OBJECTNAME<MASK><NEW_LINE>if (server.isRegistered(on)) {<NEW_LINE>CL = server.getClassLoader(on);<NEW_LINE>} else {<NEW_LINE>CL = Thread.currentThread().getContextClassLoader();<NEW_LINE>}<NEW_LINE>for (String cl : classNames) {<NEW_LINE>className = cl.trim();<NEW_LINE>Class.forName(className, true, CL);<NEW_LINE>}<NEW_LINE>Class.forName(citem.getValue().trim(), true, ConfigMetaType.class.getClassLoader());<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new IllegalArgumentException("Failed to load boot time class [" + className + "] for " + citem.getName());<NEW_LINE>}<NEW_LINE>} | , citem.getKey())); |
1,837,237 | public synchronized Network configureTunnelNetwork(final Connection conn, final Long networkId, final long hostId, final String bridgeName) {<NEW_LINE>try {<NEW_LINE>final Network nw = findOrCreateTunnelNetwork(conn, bridgeName);<NEW_LINE>// Invoke plugin to setup the bridge which will be used by this<NEW_LINE>// network<NEW_LINE>final String bridge = nw.getBridge(conn);<NEW_LINE>String result;<NEW_LINE>if (bridgeName.startsWith("OVS-DR-VPC-Bridge")) {<NEW_LINE>result = callHostPlugin(conn, "ovstunnel", "setup_ovs_bridge_for_distributed_routing", "bridge", bridge, "key", bridgeName, "xs_nw_uuid", nw.getUuid(conn), "cs_host_id", ((Long) hostId).toString());<NEW_LINE>} else {<NEW_LINE>result = callHostPlugin(conn, "ovstunnel", "setup_ovs_bridge", "bridge", bridge, "key", bridgeName, "xs_nw_uuid", nw.getUuid(conn), "cs_host_id", ((Long) hostId).toString());<NEW_LINE>}<NEW_LINE>// Note down the fact that the ovs bridge has been setup<NEW_LINE>final String[] res = result.split(":");<NEW_LINE>if (res.length != 2 || !res[0].equalsIgnoreCase("SUCCESS")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return nw;<NEW_LINE>} catch (final Exception e) {<NEW_LINE>s_logger.warn("createandConfigureTunnelNetwork failed", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | throw new CloudRuntimeException("Unable to pre-configure OVS bridge " + bridge); |
214,860 | public List<String> build() throws IOException {<NEW_LINE>List<String> command = new ArrayList<>();<NEW_LINE>command.add(NORMALIZE_PATH);<NEW_LINE>addIfNotNull(bucketSpan, BUCKET_SPAN_ARG, command);<NEW_LINE>command.add(AutodetectBuilder.LENGTH_ENCODED_INPUT_ARG);<NEW_LINE>if (quantilesState != null) {<NEW_LINE>Path quantilesStateFilePath = AutodetectBuilder.writeNormalizerInitState(jobId, quantilesState, env);<NEW_LINE>String stateFileArg = AutodetectBuilder.QUANTILES_STATE_PATH_ARG + quantilesStateFilePath;<NEW_LINE>command.add(stateFileArg);<NEW_LINE>command.add(AutodetectBuilder.DELETE_STATE_FILES_ARG);<NEW_LINE>}<NEW_LINE>if (ProcessBuilderUtils.modelConfigFilePresent(env)) {<NEW_LINE>String modelConfigFile = XPackPlugin.resolveConfigFile(env, ProcessBuilderUtils.ML_MODEL_CONF).toString();<NEW_LINE>command.<MASK><NEW_LINE>}<NEW_LINE>// License was validated when the corresponding job was opened<NEW_LINE>command.add(AutodetectBuilder.LICENSE_KEY_VALIDATED_ARG + true);<NEW_LINE>return command;<NEW_LINE>} | add(AutodetectBuilder.MODEL_CONFIG_ARG + modelConfigFile); |
240,638 | public void afterMarshalling(Context.AfterMarshalling context, ExecutionAttributes executionAttributes) {<NEW_LINE>io.opentelemetry.context.Context parentOtelContext = io.opentelemetry.context.Context.current();<NEW_LINE>if (!instrumenter.shouldStart(parentOtelContext, executionAttributes)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SdkHttpRequest httpRequest = context.httpRequest();<NEW_LINE>executionAttributes.putAttribute(SDK_HTTP_REQUEST_ATTRIBUTE, httpRequest);<NEW_LINE>io.opentelemetry.context.Context otelContext = instrumenter.start(parentOtelContext, executionAttributes);<NEW_LINE>executionAttributes.putAttribute(CONTEXT_ATTRIBUTE, otelContext);<NEW_LINE>if (executionAttributes.getAttribute(SdkExecutionAttribute.CLIENT_TYPE).equals(ClientType.SYNC)) {<NEW_LINE>// We can only activate context for synchronous clients, which allows downstream<NEW_LINE>// instrumentation like Apache to know about the SDK span.<NEW_LINE>executionAttributes.putAttribute(SCOPE_ATTRIBUTE, otelContext.makeCurrent());<NEW_LINE>}<NEW_LINE>Span span = Span.fromContext(otelContext);<NEW_LINE>try {<NEW_LINE>AwsSdkRequest awsSdkRequest = AwsSdkRequest.ofSdkRequest(context.request());<NEW_LINE>if (awsSdkRequest != null) {<NEW_LINE>executionAttributes.putAttribute(AWS_SDK_REQUEST_ATTRIBUTE, awsSdkRequest);<NEW_LINE>populateRequestAttributes(span, awsSdkRequest, context.request(), executionAttributes);<NEW_LINE>}<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>instrumenter.end(<MASK><NEW_LINE>clearAttributes(executionAttributes);<NEW_LINE>throw throwable;<NEW_LINE>}<NEW_LINE>} | otelContext, executionAttributes, null, throwable); |
702,411 | public List<AttachmentEntry> migrateAndGetByReferencedRecord(@NonNull final Object referencedRecord) {<NEW_LINE>final TableRecordReference tableRecordReference = TableRecordReference.of(referencedRecord);<NEW_LINE>final IQueryBL queryBL = Services.get(IQueryBL.class);<NEW_LINE>final List<I_AD_Attachment> attachmentRecords = // .addOnlyActiveRecordsFilter() attempt to also migrate inactive records<NEW_LINE>queryBL.createQueryBuilder(I_AD_Attachment.class).addEqualsFilter(I_AD_Attachment.COLUMN_Record_ID, tableRecordReference.getRecord_ID()).addEqualsFilter(I_AD_Attachment.COLUMN_AD_Table_ID, tableRecordReference.getAD_Table_ID()).addEqualsFilter(I_AD_Attachment.COLUMN_MigrationDate, null).create().list();<NEW_LINE>final ImmutableList.Builder<AttachmentEntry> result = ImmutableList.builder();<NEW_LINE>for (final I_AD_Attachment attachmentRecord : attachmentRecords) {<NEW_LINE>final boolean attachmentRecordIsActive = attachmentRecord.isActive();<NEW_LINE>final List<<MASK><NEW_LINE>if (attachmentRecordIsActive) {<NEW_LINE>result.addAll(migratedEntries);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result.build();<NEW_LINE>} | AttachmentEntry> migratedEntries = convertAttachmentLOBToEntries(attachmentRecord); |
738,426 | public Path parsePath(String path) {<NEW_LINE>LOGGER.trace(String.format("parsePath(%s)", path));<NEW_LINE>if ("".equals(path)) {<NEW_LINE>return new File(cwd).toPath();<NEW_LINE>}<NEW_LINE>File file;<NEW_LINE>try {<NEW_LINE>URI resolved = mapper.resolve(path);<NEW_LINE>LOGGER.trace(String.format("import-map.resolve(%s) : %s", path, resolved));<NEW_LINE>switch(resolved.getScheme()) {<NEW_LINE>case "file":<NEW_LINE>file = vertx.resolveFile(resolved.getPath());<NEW_LINE>break;<NEW_LINE>case "http":<NEW_LINE>case "https":<NEW_LINE>try {<NEW_LINE>return <MASK><NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw new InvalidPathException(path, e.getMessage());<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("unsupported scheme: " + resolved.getScheme());<NEW_LINE>}<NEW_LINE>} catch (UnmappedBareSpecifierException e) {<NEW_LINE>LOGGER.debug("Failed to resolve module", e);<NEW_LINE>// bare specifier<NEW_LINE>file = new File(baseDir, path);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new InvalidPathException(path, e.getMessage());<NEW_LINE>}<NEW_LINE>// if it's a download, get the file to the download dir<NEW_LINE>// if not, continue the processing...<NEW_LINE>if (!fetchIfNeeded(file, path)) {<NEW_LINE>// force resolve through vertx, this allows fixing paths from cache back to the right location<NEW_LINE>file = vertx.resolveFile(file.getPath());<NEW_LINE>}<NEW_LINE>return file.toPath();<NEW_LINE>} | parsePath(resolved.toURL()); |
1,049,599 | public void writeFileVersions(Connection connection, FileHistoryId fileHistoryId, long databaseVersionId, Collection<FileVersion> fileVersions) throws SQLException {<NEW_LINE>PreparedStatement preparedStatement = getStatement(connection, "fileversion.insert.writeFileVersions.sql");<NEW_LINE>for (FileVersion fileVersion : fileVersions) {<NEW_LINE>String fileContentChecksumStr = (fileVersion.getChecksum() != null) ? fileVersion.getChecksum().toString() : null;<NEW_LINE>preparedStatement.setString(1, fileHistoryId.toString());<NEW_LINE>preparedStatement.setInt(2, Integer.parseInt("" + fileVersion.getVersion()));<NEW_LINE>preparedStatement.setLong(3, databaseVersionId);<NEW_LINE>preparedStatement.setString(4, fileVersion.getPath());<NEW_LINE>preparedStatement.setString(5, fileVersion.getType().toString());<NEW_LINE>preparedStatement.setString(6, fileVersion.getStatus().toString());<NEW_LINE>preparedStatement.setLong(7, fileVersion.getSize());<NEW_LINE>preparedStatement.setTimestamp(8, new Timestamp(fileVersion.getLastModified().getTime()));<NEW_LINE>preparedStatement.setString(9, fileVersion.getLinkTarget());<NEW_LINE><MASK><NEW_LINE>preparedStatement.setTimestamp(11, new Timestamp(fileVersion.getUpdated().getTime()));<NEW_LINE>preparedStatement.setString(12, fileVersion.getPosixPermissions());<NEW_LINE>preparedStatement.setString(13, fileVersion.getDosAttributes());<NEW_LINE>preparedStatement.addBatch();<NEW_LINE>}<NEW_LINE>preparedStatement.executeBatch();<NEW_LINE>preparedStatement.close();<NEW_LINE>} | preparedStatement.setString(10, fileContentChecksumStr); |
1,848,903 | void updatePowerSavingsLabels() {<NEW_LINE>boolean isMotionSensorOn = ClientPrefs.getInstance(mView.<MASK><NEW_LINE>int battPct = ClientPrefs.getInstance(mView.getContext()).getMinBatteryPercent();<NEW_LINE>TextView tv = (TextView) mView.findViewById(R.id.textview_stop_at_battery);<NEW_LINE>String s = String.format(mView.getResources().getString(R.string.stop_at_x_battery), battPct);<NEW_LINE>tv.setText(s);<NEW_LINE>tv = (TextView) mView.findViewById(R.id.textview_motion_detection);<NEW_LINE>final String onOrOff = isMotionSensorOn ? mView.getResources().getString(R.string.on) : mView.getResources().getString(R.string.off);<NEW_LINE>s = String.format(mView.getResources().getString(R.string.motion_detection_onoff), onOrOff);<NEW_LINE>tv.setText(s);<NEW_LINE>} | getContext()).isMotionSensorEnabled(); |
159,382 | private void createTypeSignature(TypeMirror type, Map<String, Integer> typeVariableIndexes, Map<String, TypeMirror> genericSignatures, StringBuilder builder) {<NEW_LINE>String typeName = typeWithoutAnnotations(type.toString());<NEW_LINE>if (type.getKind() == TypeKind.DECLARED) {<NEW_LINE>DeclaredType declaredType = (DeclaredType) type;<NEW_LINE>if (declaredType.getTypeArguments().isEmpty()) {<NEW_LINE>builder.append(typeName).append(".class");<NEW_LINE>} else {<NEW_LINE>TypeElement typeElement = (TypeElement) declaredType.asElement();<NEW_LINE>builder.append("com.dslplatform.json.runtime.Generics.makeParameterizedType(").append(typeElement.getQualifiedName()).append(".class");<NEW_LINE>for (TypeMirror typeArgument : declaredType.getTypeArguments()) {<NEW_LINE>builder.append(", ");<NEW_LINE>createTypeSignature(typeArgument, typeVariableIndexes, genericSignatures, builder);<NEW_LINE>}<NEW_LINE>builder.append(")");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (type.getKind() == TypeKind.ARRAY) {<NEW_LINE>ArrayType arrayType = (ArrayType) type;<NEW_LINE>builder.append("com.dslplatform.json.runtime.Generics.makeArrayType(");<NEW_LINE>createTypeSignature(arrayType.getComponentType(), typeVariableIndexes, genericSignatures, builder);<NEW_LINE>builder.append(")");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (type instanceof WildcardType) {<NEW_LINE>WildcardType wt = (WildcardType) type;<NEW_LINE>createTypeSignature(wt.getExtendsBound(), typeVariableIndexes, genericSignatures, builder);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO: not sure if there are some shenanigans with type signatures, so try the original one first<NEW_LINE>if (typeVariableIndexes.containsKey(type.toString())) {<NEW_LINE>Integer index = typeVariableIndexes.get(type.toString());<NEW_LINE>if (index != null && index >= 0) {<NEW_LINE>builder.append("actualTypes[").append(index).append("]");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (type instanceof TypeVariable) {<NEW_LINE>if (typeVariableIndexes.containsKey(typeName)) {<NEW_LINE>Integer index = typeVariableIndexes.get(typeName);<NEW_LINE>if (index != null && index >= 0) {<NEW_LINE>builder.append("actualTypes[").append(index).append("]");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TypeMirror <MASK><NEW_LINE>if (mirror != null && mirror != type) {<NEW_LINE>createTypeSignature(mirror, typeVariableIndexes, genericSignatures, builder);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.append(typeName).append(".class");<NEW_LINE>} | mirror = genericSignatures.get(typeName); |
1,077,602 | public Map doAnalysis(Map<String, String> header, String log) {<NEW_LINE>List<String> logfields = Lists.newArrayList(separator.split(log));<NEW_LINE>Map<String, String> resultMap = Maps.newHashMap();<NEW_LINE>int i = 0;<NEW_LINE>// collection specified fields<NEW_LINE>for (int point : SpecifiedFields) {<NEW_LINE>// add irregular process<NEW_LINE>if (logfields.size() >= point)<NEW_LINE>resultMap.put(fieldsName[i++], logfields.get(point - 1));<NEW_LINE>}<NEW_LINE>// add line number<NEW_LINE>resultMap.put("_lnum", header.get(TaildirSourceConfigurationConstants.READ_LINE_NUMBER));<NEW_LINE>// add timestamp<NEW_LINE>if (timeStampField == TIMESTAMP_NEED) {<NEW_LINE>resultMap.put("_timestamp", header.get(TaildirSourceConfigurationConstants.READ_TIMESTAMP));<NEW_LINE>} else if (timeStampField > TIMESTAMP_NEED) {<NEW_LINE>resultMap.put("_timestamp", logfields.get(timeStampField - 1));<NEW_LINE>}<NEW_LINE>this.<MASK><NEW_LINE>return resultMap;<NEW_LINE>} | getMainlogs().add(resultMap); |
1,078,142 | public String format(final LogRecord record) {<NEW_LINE>OffsetDateTime date = fromMillis(record.getMillis());<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>// Minimize memory allocations here.<NEW_LINE>sb.append("[").append(Thread.currentThread().getName()).append("] ");<NEW_LINE>sb.append(date.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)).append(" ");<NEW_LINE>sb.append(record.getLevel()).append(" [");<NEW_LINE>sb.append(record.getLoggerName()).append("]").append(" ");<NEW_LINE>sb.<MASK><NEW_LINE>sb.append(Utils.LINE_SEPARATOR);<NEW_LINE>if (record.getThrown() != null) {<NEW_LINE>try {<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>PrintWriter pw = new PrintWriter(sw);<NEW_LINE>record.getThrown().printStackTrace(pw);<NEW_LINE>pw.close();<NEW_LINE>sb.append(sw.toString());<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | append(record.getMessage()); |
592,242 | private static ResourceDO buildPluginButtonResource(final String parentId, final String pluginName, final ConfigGroupEnum configGroupEnum, final AdminPluginOperateEnum adminPluginOperateEnum) {<NEW_LINE>ResourceDO resourceDO = ResourceDO.buildResourceDO(ResourceDTO.builder().parentId(parentId).name(StringUtils.EMPTY).url(StringUtils.EMPTY).component(StringUtils.EMPTY).resourceType(AdminResourceEnum.THREE_MENU.getCode()).isLeaf(Boolean.TRUE).status(1).sort(0).icon(StringUtils.EMPTY).isRoute(0).build());<NEW_LINE>switch(configGroupEnum) {<NEW_LINE>case SELECTOR:<NEW_LINE>resourceDO.setTitle("SHENYU.BUTTON.PLUGIN." + ConfigGroupEnum.SELECTOR.name() + "." + adminPluginOperateEnum.name());<NEW_LINE>resourceDO.setPerms("plugin:" + pluginName + "Selector:" + adminPluginOperateEnum.getName());<NEW_LINE>break;<NEW_LINE>case RULE:<NEW_LINE>resourceDO.setTitle("SHENYU.BUTTON.PLUGIN." + ConfigGroupEnum.RULE.name() + "." + adminPluginOperateEnum.name());<NEW_LINE>resourceDO.setPerms("plugin:" + pluginName + "Rule:" + adminPluginOperateEnum.getName());<NEW_LINE>break;<NEW_LINE>case PLUGIN:<NEW_LINE>resourceDO.setTitle("SHENYU.BUTTON.PLUGIN." + adminPluginOperateEnum.name());<NEW_LINE>resourceDO.setPerms("plugin:" + pluginName + <MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return resourceDO;<NEW_LINE>} | ":" + adminPluginOperateEnum.getName()); |
1,684,375 | private <R extends Request, T> Callback<T> decorateCallbackWithBackupRequest(R request, RequestContext requestContext, DecoratorClient<R, T> client, Callback<T> callback, TrackingBackupRequestsStrategy strategy, String serviceName, String operation) {<NEW_LINE>final <MASK><NEW_LINE>URI targetHostUri = KeyMapper.TargetHostHints.getRequestContextTargetHost(requestContext);<NEW_LINE>Boolean backupRequestAcceptable = KeyMapper.TargetHostHints.getRequestContextOtherHostAcceptable(requestContext);<NEW_LINE>if (targetHostUri == null || (backupRequestAcceptable != null && backupRequestAcceptable)) {<NEW_LINE>Optional<Long> delayNano = strategy.getTimeUntilBackupRequestNano();<NEW_LINE>if (delayNano.isPresent()) {<NEW_LINE>return new DecoratedCallback<>(request, requestContext, client, callback, strategy, delayNano.get(), _executorService, startNano, serviceName, operation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// return callback that updates backup strategy about latency if<NEW_LINE>// 1. caller specified concrete target host but didn't set the flag to accept other hosts<NEW_LINE>// 2. backup strategy is not ready yet<NEW_LINE>return new Callback<T>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(T result) {<NEW_LINE>recordLatency();<NEW_LINE>callback.onSuccess(result);<NEW_LINE>}<NEW_LINE><NEW_LINE>private void recordLatency() {<NEW_LINE>long latency = System.nanoTime() - startNano;<NEW_LINE>strategy.recordCompletion(latency);<NEW_LINE>strategy.getLatencyWithoutBackup().record(latency, histogram -> notifyLatency(serviceName, operation, histogram, false));<NEW_LINE>strategy.getLatencyWithBackup().record(latency, histogram -> notifyLatency(serviceName, operation, histogram, true));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable e) {<NEW_LINE>// disregard latency if request was not made<NEW_LINE>if (!(e instanceof ServiceUnavailableException)) {<NEW_LINE>recordLatency();<NEW_LINE>}<NEW_LINE>callback.onError(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | long startNano = System.nanoTime(); |
517,150 | private void updateEnabled() {<NEW_LINE>ModeImpl contextMode = mode;<NEW_LINE>if (contextMode == null) {<NEW_LINE>// the updating instance will get the TC to close from winsys<NEW_LINE>TopComponent tc = TopComponent.getRegistry().getActivated();<NEW_LINE>if (null != tc)<NEW_LINE>contextMode = (ModeImpl) WindowManagerImpl.getInstance().findMode(tc);<NEW_LINE>}<NEW_LINE>if (null == contextMode) {<NEW_LINE>setEnabled(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean enable = contextMode.getState() == Constants.MODE_STATE_JOINED;<NEW_LINE>enable &= contextMode<MASK><NEW_LINE>boolean hasOtherEditorMode = false;<NEW_LINE>for (ModeImpl m : WindowManagerImpl.getInstance().getModes()) {<NEW_LINE>if (m.getKind() == Constants.MODE_KIND_EDITOR && m.getState() == Constants.MODE_STATE_JOINED && m != contextMode) {<NEW_LINE>hasOtherEditorMode = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>enable &= hasOtherEditorMode;<NEW_LINE>setEnabled(enable);<NEW_LINE>} | .getKind() == Constants.MODE_KIND_EDITOR; |
1,142,945 | private void buildConstantDeclarations(ElementInfo nodeCtxInfo, FileScopeImpl fileScope, final List<Occurence> occurences) {<NEW_LINE>String idName = nodeCtxInfo.getName();<NEW_LINE>for (Entry<ASTNodeInfo<Scalar>, ConstantElement> entry : constDeclarations.entrySet()) {<NEW_LINE>if (CancelSupport.getDefault().isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ASTNodeInfo<Scalar> nodeInfo = entry.getKey();<NEW_LINE>if (idName.equalsIgnoreCase(nodeInfo.getName())) {<NEW_LINE>occurences.add(new OccurenceImpl(entry.getValue(), nodeInfo.getRange()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Entry<ConstantDeclarationInfo, ConstantElement> entry : constDeclarations53.entrySet()) {<NEW_LINE>if (CancelSupport.getDefault().isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (idName.equalsIgnoreCase(nodeInfo.getName())) {<NEW_LINE>occurences.add(new OccurenceImpl(entry.getValue(), nodeInfo.getRange()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ClassConstantDeclarationInfo nodeInfo = entry.getKey(); |
391,346 | private void loadNode137() {<NEW_LINE>TrustListTypeNode node = new TrustListTypeNode(this.context, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, new QualifiedName(0, "TrustList"), new LocalizedText("en", "TrustList"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), UByte.valueOf(0));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Size.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Writable.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_UserWritable.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_OpenCount.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasComponent, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Open.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasComponent, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Close.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasComponent, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Read<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasComponent, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Write.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasComponent, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_GetPosition.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasComponent, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_SetPosition.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_LastUpdateTime.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasComponent, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_OpenWithMasks.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasTypeDefinition, Identifiers.TrustListType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList, Identifiers.HasComponent, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
82,872 | public ExecutionContext assertExecutionContext(Address callerAddress, long jobId, long executionId, String callerOpName) {<NEW_LINE>Address masterAddress = nodeEngine.getMasterAddress();<NEW_LINE>if (!callerAddress.equals(masterAddress)) {<NEW_LINE>failIfNotRunning();<NEW_LINE>throw new IllegalStateException(String.format("Caller %s cannot do '%s' for %s: it is not the master, the master is %s", callerAddress, callerOpName, jobIdAndExecutionId(jobId, executionId), masterAddress));<NEW_LINE>}<NEW_LINE>failIfNotRunning();<NEW_LINE>ExecutionContext <MASK><NEW_LINE>if (executionContext == null) {<NEW_LINE>throw new TopologyChangedException(String.format("%s not found for coordinator %s for '%s'", jobIdAndExecutionId(jobId, executionId), callerAddress, callerOpName));<NEW_LINE>} else if (!(executionContext.coordinator().equals(callerAddress) && executionContext.jobId() == jobId)) {<NEW_LINE>throw new IllegalStateException(String.format("%s, originally from coordinator %s, cannot do '%s' by coordinator %s and execution %s", executionContext.jobNameAndExecutionId(), executionContext.coordinator(), callerOpName, callerAddress, idToString(executionId)));<NEW_LINE>}<NEW_LINE>return executionContext;<NEW_LINE>} | executionContext = executionContexts.get(executionId); |
361,258 | public View initializeForView(ApplicationListener listener, AndroidApplicationConfiguration config) {<NEW_LINE>if (this.getVersion() < MINIMUM_SDK) {<NEW_LINE>throw new GdxRuntimeException("libGDX requires Android API Level " + MINIMUM_SDK + " or later.");<NEW_LINE>}<NEW_LINE>GdxNativesLoader.load();<NEW_LINE>setApplicationLogger(new AndroidApplicationLogger());<NEW_LINE>graphics = new AndroidGraphics(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy() : config.resolutionStrategy);<NEW_LINE>input = createInput(this, getActivity(), graphics.view, config);<NEW_LINE>audio = createAudio(getActivity(), config);<NEW_LINE>files = createFiles();<NEW_LINE>net = new AndroidNet(this, config);<NEW_LINE>this.listener = listener;<NEW_LINE>this.handler = new Handler();<NEW_LINE>this.clipboard = new AndroidClipboard(getActivity());<NEW_LINE>// Add a specialized audio lifecycle listener<NEW_LINE>addLifecycleListener(new LifecycleListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void resume() {<NEW_LINE>audio.resume();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void pause() {<NEW_LINE>audio.pause();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void dispose() {<NEW_LINE>audio.dispose();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Gdx.app = this;<NEW_LINE>Gdx.input = this.getInput();<NEW_LINE>Gdx<MASK><NEW_LINE>Gdx.files = this.getFiles();<NEW_LINE>Gdx.graphics = this.getGraphics();<NEW_LINE>Gdx.net = this.getNet();<NEW_LINE>createWakeLock(config.useWakelock);<NEW_LINE>useImmersiveMode(config.useImmersiveMode);<NEW_LINE>if (config.useImmersiveMode && getVersion() >= Build.VERSION_CODES.KITKAT) {<NEW_LINE>AndroidVisibilityListener vlistener = new AndroidVisibilityListener();<NEW_LINE>vlistener.createListener(this);<NEW_LINE>}<NEW_LINE>// detect an already connected bluetooth keyboardAvailable<NEW_LINE>if (getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS)<NEW_LINE>input.setKeyboardAvailable(true);<NEW_LINE>return graphics.getView();<NEW_LINE>} | .audio = this.getAudio(); |
240,257 | public void load(Path modelPath, String prefix, Map<String, ?> options) throws IOException, MalformedModelException {<NEW_LINE>if (Files.notExists(modelPath)) {<NEW_LINE>throw new FileNotFoundException("Model directory doesn't exist: " + modelPath.toAbsolutePath());<NEW_LINE>}<NEW_LINE>modelDir = modelPath.toAbsolutePath();<NEW_LINE>Path modelFile = findModelFile(prefix);<NEW_LINE>if (modelFile == null) {<NEW_LINE>modelFile = findModelFile(modelDir.toFile().getName());<NEW_LINE>if (modelFile == null) {<NEW_LINE>throw new FileNotFoundException("No .ftz or .bin file found in : " + modelPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String modelFilePath = modelFile.toString();<NEW_LINE>FtWrapper fta = FtWrapper.newInstance();<NEW_LINE>if (!fta.checkModel(modelFilePath)) {<NEW_LINE>throw new MalformedModelException("Malformed FastText model file:" + modelFilePath);<NEW_LINE>}<NEW_LINE>fta.loadModel(modelFilePath);<NEW_LINE>if (options != null) {<NEW_LINE>for (Map.Entry<String, ?> entry : options.entrySet()) {<NEW_LINE>properties.put(entry.getKey(), entry.getValue().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String modelType = fta.getModelType();<NEW_LINE>properties.put("model-type", modelType);<NEW_LINE>if ("sup".equals(modelType)) {<NEW_LINE>String labelPrefix = properties.getOrDefault("label-prefix", FtTextClassification.DEFAULT_LABEL_PREFIX);<NEW_LINE>block <MASK><NEW_LINE>modelDir = block.getModelFile();<NEW_LINE>} else if ("cbow".equals(modelType) || "sg".equals(modelType)) {<NEW_LINE>block = new FtWordEmbeddingBlock(fta);<NEW_LINE>modelDir = block.getModelFile();<NEW_LINE>} else {<NEW_LINE>throw new MalformedModelException("Unexpected FastText model type: " + modelType);<NEW_LINE>}<NEW_LINE>} | = new FtTextClassification(fta, labelPrefix); |
1,125,336 | private void validate() throws IOException {<NEW_LINE>Map<String, Object> alwaysMatch = getAlwaysMatch();<NEW_LINE>if (alwaysMatch == null) {<NEW_LINE>alwaysMatch = ImmutableMap.of();<NEW_LINE>}<NEW_LINE>Map<String, Object> always = alwaysMatch;<NEW_LINE>Collection<Map<String, Object>> firsts = getFirstMatches();<NEW_LINE>if (firsts == null) {<NEW_LINE>firsts = ImmutableList.of(ImmutableMap.of());<NEW_LINE>}<NEW_LINE>if (firsts.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("First match w3c capabilities is zero length");<NEW_LINE>}<NEW_LINE>firsts.stream().peek(map -> {<NEW_LINE>Set<String> overlap = Sets.intersection(always.keySet(), map.keySet());<NEW_LINE>if (!overlap.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Overlapping keys between w3c always and first match capabilities: " + overlap);<NEW_LINE>}<NEW_LINE>}).map(first -> {<NEW_LINE>Map<String, Object> toReturn = new HashMap<>();<NEW_LINE>toReturn.putAll(always);<NEW_LINE>toReturn.putAll(first);<NEW_LINE>return toReturn;<NEW_LINE>}).peek(map -> {<NEW_LINE>ImmutableSortedSet<String> nullKeys = map.entrySet().stream().filter(entry -> entry.getValue() == null).map(Map.Entry::getKey).collect(ImmutableSortedSet.toImmutableSortedSet<MASK><NEW_LINE>if (!nullKeys.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Null values found in w3c capabilities. Keys are: " + nullKeys);<NEW_LINE>}<NEW_LINE>}).peek(map -> {<NEW_LINE>ImmutableSortedSet<String> illegalKeys = map.keySet().stream().filter(ACCEPTED_W3C_PATTERNS.negate()).collect(ImmutableSortedSet.toImmutableSortedSet(Ordering.natural()));<NEW_LINE>if (!illegalKeys.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Illegal key values seen in w3c capabilities: " + illegalKeys);<NEW_LINE>}<NEW_LINE>}).forEach(map -> {<NEW_LINE>});<NEW_LINE>} | (Ordering.natural())); |
1,513,741 | private void processAction(ActionAnalysisMetadata action) throws InterruptedException {<NEW_LINE>if (!AqueryUtils.matchesAqueryFilters(action, actionFilters)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mnemonicToCount.merge(action.getMnemonic(), 1, Integer::sum);<NEW_LINE><MASK><NEW_LINE>if (actionOwner != null) {<NEW_LINE>BuildEvent configuration = actionOwner.getConfiguration();<NEW_LINE>BuildEventStreamProtos.Configuration configProto = configuration.asStreamProto(/*context=*/<NEW_LINE>null).getConfiguration();<NEW_LINE>configurationToCount.merge(configProto.getMnemonic(), 1, Integer::sum);<NEW_LINE>if (actionOwner.getExecutionPlatform() != null) {<NEW_LINE>execPlatformToCount.merge(actionOwner.getExecutionPlatform().label().toString(), 1, Integer::sum);<NEW_LINE>}<NEW_LINE>// In the case of aspect-on-aspect, AspectDescriptors are listed in<NEW_LINE>// topological order of the dependency graph.<NEW_LINE>// e.g. [A -> B] would imply that aspect A is applied on top of aspect B.<NEW_LINE>ImmutableList<AspectDescriptor> aspectDescriptors = actionOwner.getAspectDescriptors().reverse();<NEW_LINE>if (!aspectDescriptors.isEmpty()) {<NEW_LINE>aspectDescriptors.forEach(aspectDescriptor -> aspectToCount.merge(aspectDescriptor.getAspectClass().getName(), 1, Integer::sum));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ActionOwner actionOwner = action.getOwner(); |
727,641 | private static // detect this and print a more useful error message.<NEW_LINE>void handleClassloadingError(Throwable throwable, LuckPermsPlugin plugin) {<NEW_LINE>List<String> noteworthyClasses = ImmutableList.of("org.slf4j.LoggerFactory", "org.slf4j.ILoggerFactory", "org.apache.logging.slf4j.Log4jLoggerFactory", <MASK><NEW_LINE>PluginLogger logger = plugin.getLogger();<NEW_LINE>logger.warn("A " + throwable.getClass().getSimpleName() + " has occurred whilst initialising Hikari. This is likely due to classloading conflicts between other plugins.");<NEW_LINE>logger.warn("Please check for other plugins below (and try loading LuckPerms without them installed) before reporting the issue.");<NEW_LINE>for (String className : noteworthyClasses) {<NEW_LINE>Class<?> clazz;<NEW_LINE>try {<NEW_LINE>clazz = Class.forName(className);<NEW_LINE>} catch (Exception e) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ClassLoader loader = clazz.getClassLoader();<NEW_LINE>String loaderName;<NEW_LINE>try {<NEW_LINE>loaderName = plugin.getBootstrap().identifyClassLoader(loader) + " (" + loader.toString() + ")";<NEW_LINE>} catch (Throwable e) {<NEW_LINE>loaderName = loader.toString();<NEW_LINE>}<NEW_LINE>logger.warn("Class " + className + " has been loaded by: " + loaderName);<NEW_LINE>}<NEW_LINE>} | "org.apache.logging.log4j.spi.LoggerContext", "org.apache.logging.log4j.spi.AbstractLoggerAdapter", "org.slf4j.impl.StaticLoggerBinder", "org.slf4j.helpers.MessageFormatter"); |
229,345 | private void decompileJar(String jarFilePath, String outputDir) throws IOException {<NEW_LINE>DecompilationOptions decompilationOptions = new DecompilationOptions();<NEW_LINE>decompilationOptions.setSettings(DecompilerSettings.javaDefaults());<NEW_LINE>decompilationOptions.setFullDecompilation(true);<NEW_LINE>final File jarFile = new File(jarFilePath);<NEW_LINE>if (!jarFile.exists()) {<NEW_LINE>throw new FileNotFoundException("File not found: " + jarFilePath);<NEW_LINE>}<NEW_LINE>final DecompilerSettings settings = decompilationOptions.getSettings();<NEW_LINE>settings.setTypeLoader(new InputTypeLoader());<NEW_LINE>settings.setExcludeNestedTypes(false);<NEW_LINE>final JarFile jar = new JarFile(jarFile);<NEW_LINE>final Enumeration<JarEntry> entries = jar.entries();<NEW_LINE>final boolean oldShowSyntheticMembers = settings.getShowSyntheticMembers();<NEW_LINE>final ITypeLoader oldTypeLoader = settings.getTypeLoader();<NEW_LINE>settings.setShowSyntheticMembers(false);<NEW_LINE>settings.setTypeLoader(new CompositeTypeLoader(new JarTypeLoader(jar), oldTypeLoader));<NEW_LINE>try {<NEW_LINE>MetadataSystem metadataSystem = new NoRetryMetadataSystem(settings.getTypeLoader());<NEW_LINE>int classesDecompiled = 0;<NEW_LINE>while (entries.hasMoreElements()) {<NEW_LINE>final JarEntry entry = entries.nextElement();<NEW_LINE>final String name = entry.getName();<NEW_LINE>if (!name.endsWith(".class")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final String internalName = <MASK><NEW_LINE>try {<NEW_LINE>decompileType(metadataSystem, internalName, decompilationOptions, outputDir);<NEW_LINE>if (++classesDecompiled % 100 == 0) {<NEW_LINE>metadataSystem = new NoRetryMetadataSystem(settings.getTypeLoader());<NEW_LINE>}<NEW_LINE>} catch (final Throwable t) {<NEW_LINE>t.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>settings.setShowSyntheticMembers(oldShowSyntheticMembers);<NEW_LINE>settings.setTypeLoader(oldTypeLoader);<NEW_LINE>}<NEW_LINE>} | StringUtilities.removeRight(name, ".class"); |
930,211 | private static EjbJarModel generate1211() {<NEW_LINE>org.netbeans.modules.j2ee.weblogic9.dd.ejb1211.WeblogicEjbJar webLogicEjbJar = new org.netbeans.modules.j2ee.weblogic9.dd.ejb1211.WeblogicEjbJar();<NEW_LINE>// NOI18N<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>webLogicEjbJar.setAttributeValue("xsi:schemaLocation", "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.3/weblogic-ejb-jar.xsd");<NEW_LINE>return new EjbJarModel(webLogicEjbJar);<NEW_LINE>} | webLogicEjbJar.setAttributeValue("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); |
41,194 | public void render(PoseStack transform, int mx, int my, float partial) {<NEW_LINE>super.render(transform, mx, my, partial);<NEW_LINE>List<Component> tooltip = new ArrayList<>();<NEW_LINE>if (mx >= leftPos + 187 && mx < leftPos + 194 && my >= topPos + 12 && my < topPos + 59)<NEW_LINE>tooltip.add(new TextComponent(tile.getEnergyStored(null) + "/" + tile.<MASK><NEW_LINE>GuiHelper.handleGuiTank(transform, tile.tanks[0], leftPos + 204, topPos + 13, 16, 46, 250, 0, 20, 50, mx, my, TEXTURE, tooltip);<NEW_LINE>GuiHelper.handleGuiTank(transform, tile.tanks[1], leftPos + 182, topPos + 70, 16, 46, 250, 0, 20, 50, mx, my, TEXTURE, tooltip);<NEW_LINE>GuiHelper.handleGuiTank(transform, tile.tanks[2], leftPos + 204, topPos + 70, 16, 46, 250, 0, 20, 50, mx, my, TEXTURE, tooltip);<NEW_LINE>for (int i = 0; i < tile.patterns.length; i++) if (tile.inventory.get(18 + i).isEmpty() && !tile.patterns[i].inv.get(9).isEmpty())<NEW_LINE>if (mx >= leftPos + 27 + i * 58 && mx < leftPos + 43 + i * 58 && my >= topPos + 64 && my < topPos + 80) {<NEW_LINE>tooltip.add(tile.patterns[i].inv.get(9).getHoverName());<NEW_LINE>tile.patterns[i].inv.get(9).getItem().appendHoverText(tile.patterns[i].inv.get(9), ClientUtils.mc().level, tooltip, Default.NORMAL);<NEW_LINE>for (int j = 0; j < tooltip.size(); j++) TextUtils.applyFormat(tooltip.get(j), j == 0 ? tile.patterns[i].inv.get(9).getRarity().color : ChatFormatting.GRAY);<NEW_LINE>}<NEW_LINE>if (((mx >= leftPos + 11 && mx < leftPos + 21) || (mx >= leftPos + 69 && mx < leftPos + 79) || (mx >= leftPos + 127 && mx < leftPos + 137)) && my > topPos + 67 && my < topPos + 77)<NEW_LINE>tooltip.add(new TranslatableComponent(Lib.GUI_CONFIG + "assembler.clearRecipe"));<NEW_LINE>if (mx >= leftPos + 162 && mx < leftPos + 178 && my > topPos + 69 && my < topPos + 85)<NEW_LINE>tooltip.add(new TranslatableComponent(Lib.GUI_CONFIG + "assembler." + (tile.recursiveIngredients ? "recursiveIngredients" : "nonRecursiveIngredients")));<NEW_LINE>if (!tooltip.isEmpty())<NEW_LINE>GuiUtils.drawHoveringText(transform, tooltip, mx, my, width, height, -1, font);<NEW_LINE>} | getMaxEnergyStored(null) + " IF")); |
541,211 | private void addHyperlinkToDocFrag(JaxbXmlPart sourcePart, List<Object> contents, String url) throws JAXBException {<NEW_LINE>// We need to add a relationship to word/_rels/document.xml.rels<NEW_LINE>// but since its external, we don't use the<NEW_LINE>// usual wordMLPackage.getMainDocumentPart().addTargetPart<NEW_LINE>// mechanism<NEW_LINE>org.docx4j.relationships.ObjectFactory factory = new org.docx4j.relationships.ObjectFactory();<NEW_LINE>org.docx4j.relationships.Relationship rel = factory.createRelationship();<NEW_LINE><MASK><NEW_LINE>rel.setTarget(url);<NEW_LINE>rel.setTargetMode("External");<NEW_LINE>sourcePart.getRelationshipsPart().addRelationship(rel);<NEW_LINE>// addRelationship sets the rel's @Id<NEW_LINE>String hpl = // TODO: enable this style in the document!<NEW_LINE>"<w:hyperlink r:id=\"" + rel.getId() + "\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" " + "xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" >" + "<w:r>" + "<w:rPr>" + "<w:rStyle w:val=\"" + BindingHandler.getHyperlinkStyleId() + "\" />" + "</w:rPr>" + "<w:t>" + url + "</w:t>" + "</w:r>" + "</w:hyperlink>";<NEW_LINE>contents.add((Hyperlink) XmlUtils.unmarshalString(hpl));<NEW_LINE>} | rel.setType(Namespaces.HYPERLINK); |
1,453,733 | private static AnnotationBinding buildTargetAnnotation(long bits, LookupEnvironment env) {<NEW_LINE>ReferenceBinding target = env.<MASK><NEW_LINE>if ((bits & TagBits.AnnotationTarget) != 0)<NEW_LINE>return new AnnotationBinding(target, Binding.NO_ELEMENT_VALUE_PAIRS);<NEW_LINE>int arraysize = 0;<NEW_LINE>if ((bits & TagBits.AnnotationForAnnotationType) != 0)<NEW_LINE>arraysize++;<NEW_LINE>if ((bits & TagBits.AnnotationForConstructor) != 0)<NEW_LINE>arraysize++;<NEW_LINE>if ((bits & TagBits.AnnotationForField) != 0)<NEW_LINE>arraysize++;<NEW_LINE>if ((bits & TagBits.AnnotationForLocalVariable) != 0)<NEW_LINE>arraysize++;<NEW_LINE>if ((bits & TagBits.AnnotationForMethod) != 0)<NEW_LINE>arraysize++;<NEW_LINE>if ((bits & TagBits.AnnotationForPackage) != 0)<NEW_LINE>arraysize++;<NEW_LINE>if ((bits & TagBits.AnnotationForParameter) != 0)<NEW_LINE>arraysize++;<NEW_LINE>if ((bits & TagBits.AnnotationForType) != 0)<NEW_LINE>arraysize++;<NEW_LINE>if ((bits & TagBits.AnnotationForTypeUse) != 0)<NEW_LINE>arraysize++;<NEW_LINE>if ((bits & TagBits.AnnotationForTypeParameter) != 0)<NEW_LINE>arraysize++;<NEW_LINE>if ((bits & TagBits.AnnotationForModule) != 0)<NEW_LINE>arraysize++;<NEW_LINE>if ((bits & TagBits.AnnotationForRecordComponent) != 0)<NEW_LINE>arraysize++;<NEW_LINE>Object[] value = new Object[arraysize];<NEW_LINE>if (arraysize > 0) {<NEW_LINE>ReferenceBinding elementType = env.getResolvedType(TypeConstants.JAVA_LANG_ANNOTATION_ELEMENTTYPE, null);<NEW_LINE>int index = 0;<NEW_LINE>if ((bits & TagBits.AnnotationForTypeUse) != 0)<NEW_LINE>value[index++] = elementType.getField(TypeConstants.TYPE_USE_TARGET, true);<NEW_LINE>if ((bits & TagBits.AnnotationForAnnotationType) != 0)<NEW_LINE>value[index++] = elementType.getField(TypeConstants.UPPER_ANNOTATION_TYPE, true);<NEW_LINE>if ((bits & TagBits.AnnotationForConstructor) != 0)<NEW_LINE>value[index++] = elementType.getField(TypeConstants.UPPER_CONSTRUCTOR, true);<NEW_LINE>if ((bits & TagBits.AnnotationForField) != 0)<NEW_LINE>value[index++] = elementType.getField(TypeConstants.UPPER_FIELD, true);<NEW_LINE>if ((bits & TagBits.AnnotationForRecordComponent) != 0)<NEW_LINE>value[index++] = elementType.getField(TypeConstants.UPPER_RECORD_COMPONENT, true);<NEW_LINE>if ((bits & TagBits.AnnotationForMethod) != 0)<NEW_LINE>value[index++] = elementType.getField(TypeConstants.UPPER_METHOD, true);<NEW_LINE>if ((bits & TagBits.AnnotationForPackage) != 0)<NEW_LINE>value[index++] = elementType.getField(TypeConstants.UPPER_PACKAGE, true);<NEW_LINE>if ((bits & TagBits.AnnotationForParameter) != 0)<NEW_LINE>value[index++] = elementType.getField(TypeConstants.UPPER_PARAMETER, true);<NEW_LINE>if ((bits & TagBits.AnnotationForTypeParameter) != 0)<NEW_LINE>value[index++] = elementType.getField(TypeConstants.TYPE_PARAMETER_TARGET, true);<NEW_LINE>if ((bits & TagBits.AnnotationForType) != 0)<NEW_LINE>value[index++] = elementType.getField(TypeConstants.TYPE, true);<NEW_LINE>if ((bits & TagBits.AnnotationForLocalVariable) != 0)<NEW_LINE>value[index++] = elementType.getField(TypeConstants.UPPER_LOCAL_VARIABLE, true);<NEW_LINE>}<NEW_LINE>return env.createAnnotation(target, new ElementValuePair[] { new ElementValuePair(TypeConstants.VALUE, value, null) });<NEW_LINE>} | getResolvedJavaBaseType(TypeConstants.JAVA_LANG_ANNOTATION_TARGET, null); |
437,117 | private static List<Tuple2<IndexPair<String>, Integer>> handlePairs(final List<Pair> pairs, final OpticalDuplicateFinder finder, final boolean markOpticalDups) {<NEW_LINE>// save ourselves the trouble when there are no optical duplicates to worry about<NEW_LINE>if (pairs.size() == 1) {<NEW_LINE>return Collections.singletonList(new Tuple2<>(new IndexPair<>(pairs.get(0).getName(), pairs.get(0).getPartitionIndex()), 0));<NEW_LINE>}<NEW_LINE>List<Tuple2<IndexPair<String>, Integer>> output = new ArrayList<>();<NEW_LINE>final Pair bestPair = pairs.stream().peek(pair -> finder.addLocationInformation(pair.getName(), pair)).max(PAIRED_ENDS_SCORE_COMPARATOR).orElseThrow(() -> <MASK><NEW_LINE>// Split by orientation and count duplicates in each group separately.<NEW_LINE>final Map<Byte, List<Pair>> groupByOrientation = pairs.stream().collect(Collectors.groupingBy(Pair::getOrientationForOpticalDuplicates));<NEW_LINE>final int numOpticalDuplicates;<NEW_LINE>if (groupByOrientation.containsKey(ReadEnds.FR) && groupByOrientation.containsKey(ReadEnds.RF)) {<NEW_LINE>final List<Pair> peFR = new ArrayList<>(groupByOrientation.get(ReadEnds.FR));<NEW_LINE>final List<Pair> peRF = new ArrayList<>(groupByOrientation.get(ReadEnds.RF));<NEW_LINE>numOpticalDuplicates = countOpticalDuplicates(finder, peFR, bestPair, markOpticalDups ? output : null) + countOpticalDuplicates(finder, peRF, bestPair, markOpticalDups ? output : null);<NEW_LINE>} else {<NEW_LINE>numOpticalDuplicates = countOpticalDuplicates(finder, pairs, bestPair, markOpticalDups ? output : null);<NEW_LINE>}<NEW_LINE>output.add(new Tuple2<>(new IndexPair<>(bestPair.getName(), bestPair.getPartitionIndex()), numOpticalDuplicates));<NEW_LINE>return output;<NEW_LINE>} | new GATKException.ShouldNeverReachHereException("There was no best pair because the stream was empty, but it shouldn't have been empty.")); |
969,477 | public void check(ResourceCheckRule... rules) {<NEW_LINE>if (null == rules) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AgentFeatureComponent afc = (AgentFeatureComponent) getConfigManager().getComponent("procscan", "ProcDetectAgent");<NEW_LINE>if (afc != null) {<NEW_LINE>String pid = JVMToolHelper.getCurrentProcId();<NEW_LINE>OSProcess procState = (OSProcess) <MASK><NEW_LINE>if (procState == null) {<NEW_LINE>log.warn(this, "This component can't work as its dependent Feature[procscan] out of running");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (ResourceCheckRule rt : rules) {<NEW_LINE>AuditChecker ac = auditCheckerMap.get(rt.getResType());<NEW_LINE>ac.setRule(rt);<NEW_LINE>ac.setProcState(procState);<NEW_LINE>try {<NEW_LINE>boolean checkResult = ac.isOverLimit();<NEW_LINE>if (checkResult) {<NEW_LINE>ac.doLimitation();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.err(this, "RUN AuditChecker[" + ac.getResourceType() + "] FAIL:", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | afc.exchange("procscan.query.procstate", pid); |
294,093 | public Object invokeWithArguments(Object... args) throws Throwable, WrongMethodTypeException, ClassCastException {<NEW_LINE>int argsLength = 0;<NEW_LINE>if (args != null) {<NEW_LINE>argsLength = args.length;<NEW_LINE>}<NEW_LINE>int mhLength = this.type.parameterCount();<NEW_LINE>if (argsLength > mhLength) {<NEW_LINE>int numTrailingArgs = argsLength - mhLength + 1;<NEW_LINE>Class<?> trailingArrayType = this.arrayType.getComponentType();<NEW_LINE>Object trailingArgs = Array.newInstance(trailingArrayType, numTrailingArgs);<NEW_LINE>MethodHandle arraySetter = MethodHandles.arrayElementSetter(this.arrayType);<NEW_LINE>for (int i = 0; i < numTrailingArgs; i++) {<NEW_LINE>arraySetter.invoke(trailingArgs, i, args[mhLength - 1 + i]);<NEW_LINE>}<NEW_LINE>Object[] newArgs = new Object[mhLength];<NEW_LINE>for (int i = 0; i < mhLength - 1; i++) {<NEW_LINE>newArgs[i] = args[i];<NEW_LINE>}<NEW_LINE>newArgs[mhLength - 1] = trailingArgs;<NEW_LINE>return this.asFixedArity().invokeWithArguments(newArgs);<NEW_LINE>} else /*[ENDIF] JAVA_SPEC_VERSION >= 11 */<NEW_LINE>{<NEW_LINE>if (argsLength < 253) {<NEW_LINE>MethodHandle mh = IWAContainer.getMH(argsLength);<NEW_LINE>return mh.invokeExact((MethodHandle) this, args);<NEW_LINE>}<NEW_LINE>MethodHandle mh = this.asType(MethodType.genericMethodType(argsLength));<NEW_LINE>mh = mh.asSpreader(<MASK><NEW_LINE>return mh.invokeExact(args);<NEW_LINE>}<NEW_LINE>} | Object[].class, argsLength); |
1,067,994 | public void onDrop(TimelineDragDropEvent<Event> e) {<NEW_LINE>// get dragged model object (event class) if draggable item is within a data iteration component,<NEW_LINE>// update event's start and end dates.<NEW_LINE>Event dndEvent = e.getData();<NEW_LINE>dndEvent.setStart(e.getStartDate());<NEW_LINE>dndEvent.setEnd(e.getEndDate());<NEW_LINE>// create a timeline event (not editable)<NEW_LINE>TimelineEvent event = TimelineEvent.builder().data(dndEvent).startDate(e.getStartDate()).endDate(e.getEndDate()).editable(false).group(e.getGroup()).build();<NEW_LINE>// add a new event<NEW_LINE>TimelineUpdater timelineUpdater = TimelineUpdater.getCurrentInstance(":form:timeline");<NEW_LINE><MASK><NEW_LINE>// remove from the list of all events<NEW_LINE>events.remove(dndEvent);<NEW_LINE>FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "The " + dndEvent.getName() + " was added", null);<NEW_LINE>FacesContext.getCurrentInstance().addMessage(null, msg);<NEW_LINE>} | model.add(event, timelineUpdater); |
494,162 | final AcceptDomainTransferFromAnotherAwsAccountResult executeAcceptDomainTransferFromAnotherAwsAccount(AcceptDomainTransferFromAnotherAwsAccountRequest acceptDomainTransferFromAnotherAwsAccountRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(acceptDomainTransferFromAnotherAwsAccountRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AcceptDomainTransferFromAnotherAwsAccountRequest> request = null;<NEW_LINE>Response<AcceptDomainTransferFromAnotherAwsAccountResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AcceptDomainTransferFromAnotherAwsAccountRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(acceptDomainTransferFromAnotherAwsAccountRequest));<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, "Route 53 Domains");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptDomainTransferFromAnotherAwsAccount");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AcceptDomainTransferFromAnotherAwsAccountResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AcceptDomainTransferFromAnotherAwsAccountResultJsonUnmarshaller());<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()); |
507,637 | public Future<Boolean> execute(String byName, Callable<Boolean> callable, Invocation inv) {<NEW_LINE>if (StrUtil.isBlank(byName)) {<NEW_LINE>FutureTask<Boolean> task = new FutureTask<>(callable);<NEW_LINE>threadFactory.newThread(task).start();<NEW_LINE>return task;<NEW_LINE>}<NEW_LINE>ExecutorService executorService = executorServiceMap.get(byName);<NEW_LINE>if (executorService != null) {<NEW_LINE>return executorService.submit(callable);<NEW_LINE>}<NEW_LINE>if (!runDefaultWithoutConfigName) {<NEW_LINE>throw new IllegalStateException("Can not find threadPoolName: \"" + byName + "\" for @Transactional() in method: " + ClassUtil.buildMethodString(inv.getMethod()) + ".\n Please invoke TransactionalManager.me().addExecutorService() to configure transactional threadPool on application started.");<NEW_LINE>}<NEW_LINE>FutureTask<Boolean> task <MASK><NEW_LINE>threadFactory.newThread(task).start();<NEW_LINE>return task;<NEW_LINE>} | = new FutureTask<>(callable); |
47,537 | private void unregisterClient(final String producerGroup, final String consumerGroup) {<NEW_LINE>Iterator<Entry<String, HashMap<Long, String>>> it = this.brokerAddrTable.entrySet().iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Entry<String, HashMap<Long, String>> entry = it.next();<NEW_LINE>String brokerName = entry.getKey();<NEW_LINE>HashMap<Long, String> oneTable = entry.getValue();<NEW_LINE>if (oneTable != null) {<NEW_LINE>for (Map.Entry<Long, String> entry1 : oneTable.entrySet()) {<NEW_LINE><MASK><NEW_LINE>if (addr != null) {<NEW_LINE>try {<NEW_LINE>this.mQClientAPIImpl.unregisterClient(addr, this.clientId, producerGroup, consumerGroup, clientConfig.getMqClientApiTimeout());<NEW_LINE>log.info("unregister client[Producer: {} Consumer: {}] from broker[{} {} {}] success", producerGroup, consumerGroup, brokerName, entry1.getKey(), addr);<NEW_LINE>} catch (RemotingException e) {<NEW_LINE>log.warn("unregister client RemotingException from broker: {}, {}", addr, e.getMessage());<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.warn("unregister client InterruptedException from broker: {}, {}", addr, e.getMessage());<NEW_LINE>} catch (MQBrokerException e) {<NEW_LINE>log.warn("unregister client MQBrokerException from broker: {}, {}", addr, e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String addr = entry1.getValue(); |
248,052 | private void createStream(MediaStreamTrack[] tracks, BiConsumer<String, ArrayList<WritableMap>> successCallback) {<NEW_LINE>String streamId = UUID.randomUUID().toString();<NEW_LINE>MediaStream mediaStream = webRTCModule.mFactory.createLocalMediaStream(streamId);<NEW_LINE>ArrayList<WritableMap> tracksInfo = new ArrayList<>();<NEW_LINE>for (MediaStreamTrack track : tracks) {<NEW_LINE>if (track == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (track instanceof AudioTrack) {<NEW_LINE>mediaStream.addTrack((AudioTrack) track);<NEW_LINE>} else {<NEW_LINE>mediaStream.addTrack((VideoTrack) track);<NEW_LINE>}<NEW_LINE>WritableMap trackInfo = Arguments.createMap();<NEW_LINE>String trackId = track.id();<NEW_LINE>trackInfo.putBoolean("enabled", track.enabled());<NEW_LINE>trackInfo.putString("id", trackId);<NEW_LINE>trackInfo.putString("kind", track.kind());<NEW_LINE>trackInfo.putString("label", trackId);<NEW_LINE>trackInfo.putString("readyState", track.state().toString());<NEW_LINE>trackInfo.putBoolean("remote", false);<NEW_LINE>if (track instanceof VideoTrack) {<NEW_LINE>TrackPrivate tp = this.tracks.get(trackId);<NEW_LINE>AbstractVideoCaptureController vcc = tp.videoCaptureController;<NEW_LINE><MASK><NEW_LINE>settings.putInt("height", vcc.getHeight());<NEW_LINE>settings.putInt("width", vcc.getWidth());<NEW_LINE>settings.putInt("frameRate", vcc.getFrameRate());<NEW_LINE>trackInfo.putMap("settings", settings);<NEW_LINE>}<NEW_LINE>tracksInfo.add(trackInfo);<NEW_LINE>}<NEW_LINE>Log.d(TAG, "MediaStream id: " + streamId);<NEW_LINE>webRTCModule.localStreams.put(streamId, mediaStream);<NEW_LINE>successCallback.accept(streamId, tracksInfo);<NEW_LINE>} | WritableMap settings = Arguments.createMap(); |
50,182 | protected PurityGraphBox summaryOfUnanalysedMethod(SootMethod method) {<NEW_LINE>PurityGraphBox b = new PurityGraphBox();<NEW_LINE>String c = method<MASK><NEW_LINE>String m = method.getName();<NEW_LINE>// impure with side-effect, unless otherwise specified<NEW_LINE>b.g = PurityGraph.conservativeGraph(method, true);<NEW_LINE>for (String[] element : PurityInterproceduralAnalysis.pureMethods) {<NEW_LINE>if (m.equals(element[1]) && c.startsWith(element[0])) {<NEW_LINE>b.g = PurityGraph.freshGraph(method);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String[] element : PurityInterproceduralAnalysis.alterMethods) {<NEW_LINE>if (m.equals(element[1]) && c.startsWith(element[0])) {<NEW_LINE>b.g = PurityGraph.conservativeGraph(method, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return b;<NEW_LINE>} | .getDeclaringClass().toString(); |
282,902 | public UpdatePackageResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdatePackageResult updatePackageResult = new UpdatePackageResult();<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 updatePackageResult;<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("PackageDetails", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updatePackageResult.setPackageDetails(PackageDetailsJsonUnmarshaller.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 updatePackageResult;<NEW_LINE>} | ().unmarshall(context)); |
1,497,607 | public Tuple2<Boolean, Row> write(Map<String, String> in) {<NEW_LINE>StringBuilder sbd = new StringBuilder();<NEW_LINE>boolean isFirstPair = true;<NEW_LINE>if (valDelimiter != null) {<NEW_LINE>for (Map.Entry entry : in.entrySet()) {<NEW_LINE>if (isFirstPair) {<NEW_LINE>isFirstPair = false;<NEW_LINE>} else {<NEW_LINE>sbd.append(colDelimiter);<NEW_LINE>}<NEW_LINE>sbd.append(entry.getKey() + valDelimiter + entry.getValue());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>int[] indices = new int[itemSize];<NEW_LINE>double[] values = new double[itemSize];<NEW_LINE>int count = 0;<NEW_LINE>for (Map.Entry<String, String> entry : in.entrySet()) {<NEW_LINE>indices[count] = ((Double) Double.parseDouble(entry.getKey())).intValue();<NEW_LINE>values[count] = Double.parseDouble(entry.getValue());<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>values = new SparseVector(-1, indices, values).getValues();<NEW_LINE>for (double value : values) {<NEW_LINE>if (isFirstPair) {<NEW_LINE>isFirstPair = false;<NEW_LINE>} else {<NEW_LINE>sbd.append(colDelimiter);<NEW_LINE>}<NEW_LINE>sbd.append(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Tuple2<>(true, Row.of(sbd.toString()));<NEW_LINE>} | int itemSize = in.size(); |
1,173,691 | public static void registerEnvironments(Registry<LevelStem> registry) {<NEW_LINE>int i = World.Environment.values().length;<NEW_LINE>List<World.Environment> newTypes = new ArrayList<>();<NEW_LINE>for (Map.Entry<ResourceKey<LevelStem>, LevelStem> entry : registry.entrySet()) {<NEW_LINE>ResourceKey<LevelStem> key = entry.getKey();<NEW_LINE>World.Environment environment = DIM_MAP.get(key);<NEW_LINE>if (environment == null) {<NEW_LINE>String name = ResourceLocationUtil.standardize(key.location());<NEW_LINE>environment = EnumHelper.makeEnum(World.Environment.class, name, i, ENV_CTOR, ImmutableList.of(i - 1));<NEW_LINE>newTypes.add(environment);<NEW_LINE>ENVIRONMENT_MAP.put(i - 1, environment);<NEW_LINE>DIM_MAP.put(key, environment);<NEW_LINE>ArclightMod.LOGGER.debug("Registered {} as environment {}", <MASK><NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EnumHelper.addEnums(World.Environment.class, newTypes);<NEW_LINE>ArclightMod.LOGGER.info("registry.environment", newTypes.size());<NEW_LINE>} | key.location(), environment); |
1,719,477 | public static void main(String[] args) throws Exception {<NEW_LINE>CommandLineParser parser = new DefaultParser();<NEW_LINE>CommandLine cmd = parser.parse(ManagerConf.constructManagerOptions(), args);<NEW_LINE>if (cmd.getOptions().length == 0 || cmd.hasOption("help")) {<NEW_LINE>HelpFormatter f = new HelpFormatter();<NEW_LINE>f.printHelp(<MASK><NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>final ManagerStarter managerStarter = ManagerStarter.init(cmd);<NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>managerStarter.stop();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Caught error during shutdown! ", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>managerStarter.start();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Cannot start uReplicator-Manager: ", e);<NEW_LINE>}<NEW_LINE>} | "OptionsTip", ManagerConf.constructManagerOptions()); |
10,384 | public void startPublish(String streamId, long absoluteStartTimeMs, String publishType) {<NEW_LINE>vertx.executeBlocking(handler -> {<NEW_LINE>try {<NEW_LINE>Broadcast broadcast = updateBroadcastStatus(streamId, absoluteStartTimeMs, publishType, getDataStore().get(streamId));<NEW_LINE>final String listenerHookURL = broadcast.getListenerHookURL();<NEW_LINE>if (listenerHookURL != null && !listenerHookURL.isEmpty()) {<NEW_LINE>final String name = broadcast.getName();<NEW_LINE>final String category = broadcast.getCategory();<NEW_LINE><MASK><NEW_LINE>vertx.setTimer(10, e -> notifyHook(listenerHookURL, streamId, HOOK_ACTION_START_LIVE_STREAM, name, category, null, null, null));<NEW_LINE>}<NEW_LINE>int ingestingStreamLimit = appSettings.getIngestingStreamLimit();<NEW_LINE>long activeBroadcastNumber = dataStore.getActiveBroadcastCount();<NEW_LINE>if (ingestingStreamLimit != -1 && activeBroadcastNumber > ingestingStreamLimit) {<NEW_LINE>logger.info("Active broadcast count({}) is more than ingesting stream limit:{} so stopping broadcast:{}", activeBroadcastNumber, ingestingStreamLimit, broadcast.getStreamId());<NEW_LINE>stopStreaming(broadcast);<NEW_LINE>}<NEW_LINE>for (IStreamListener listener : streamListeners) {<NEW_LINE>listener.streamStarted(broadcast.getStreamId());<NEW_LINE>}<NEW_LINE>handler.complete();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(ExceptionUtils.getStackTrace(e));<NEW_LINE>handler.fail(ExceptionUtils.getStackTrace(e));<NEW_LINE>}<NEW_LINE>}, null);<NEW_LINE>if (absoluteStartTimeMs == 0) {<NEW_LINE>vertx.setTimer(2000, h -> {<NEW_LINE>IBroadcastStream broadcastStream = getBroadcastStream(getScope(), streamId);<NEW_LINE>if (broadcastStream instanceof ClientBroadcastStream) {<NEW_LINE>long absoluteStarTime = ((ClientBroadcastStream) broadcastStream).getAbsoluteStartTimeMs();<NEW_LINE>if (absoluteStarTime != 0) {<NEW_LINE>Broadcast broadcast = getDataStore().get(streamId);<NEW_LINE>if (broadcast != null) {<NEW_LINE>broadcast.setAbsoluteStartTimeMs(absoluteStarTime);<NEW_LINE>getDataStore().save(broadcast);<NEW_LINE>logger.info("Updating broadcast absolute time {} ms for stream:{}", absoluteStarTime, streamId);<NEW_LINE>} else {<NEW_LINE>logger.info("Broadcast is not available in the database to update the absolute start time for stream:{}", streamId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.info("Broadcast absolute time is not available for stream:{}", streamId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>logger.info("start publish leaved for stream:{}", streamId);<NEW_LINE>} | logger.info("Setting timer to call live stream started hook for stream:{}", streamId); |
1,617,628 | public int failInProgressUploads(UploadResult fail) {<NEW_LINE>Log_OC.v(TAG, "Updating state of any killed upload");<NEW_LINE>ContentValues cv = new ContentValues();<NEW_LINE>cv.put(ProviderTableMeta.UPLOADS_STATUS, <MASK><NEW_LINE>cv.put(ProviderTableMeta.UPLOADS_LAST_RESULT, fail != null ? fail.getValue() : UploadResult.UNKNOWN.getValue());<NEW_LINE>cv.put(ProviderTableMeta.UPLOADS_UPLOAD_END_TIMESTAMP, Calendar.getInstance().getTimeInMillis());<NEW_LINE>int result = getDB().update(ProviderTableMeta.CONTENT_URI_UPLOADS, cv, ProviderTableMeta.UPLOADS_STATUS + "=?", new String[] { String.valueOf(UploadStatus.UPLOAD_IN_PROGRESS.getValue()) });<NEW_LINE>if (result == 0) {<NEW_LINE>Log_OC.v(TAG, "No upload was killed");<NEW_LINE>} else {<NEW_LINE>Log_OC.w(TAG, Integer.toString(result) + " uploads where abruptly interrupted");<NEW_LINE>notifyObserversNow();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | UploadStatus.UPLOAD_FAILED.getValue()); |
281,320 | private static void copyInputKeys(org.apache.hadoop.conf.Configuration hadoopConf, org.apache.commons.configuration.Configuration source) {<NEW_LINE>// Copy IndexUpdateJob settings into the hadoop-backed cfg<NEW_LINE>Iterator<String> keyIter = source.getKeys();<NEW_LINE>while (keyIter.hasNext()) {<NEW_LINE>String key = keyIter.next();<NEW_LINE>ConfigElement.PathIdentifier pid;<NEW_LINE>try {<NEW_LINE>pid = ConfigElement.parse(ROOT_NS, key);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>log.debug("[inputkeys] Skipping {}", key, e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!pid.element.isOption())<NEW_LINE>continue;<NEW_LINE>String k = ConfigElement.getPath(TitanHadoopConfiguration.GRAPH_CONFIG_KEYS, true) + "." + key;<NEW_LINE>String v = source.<MASK><NEW_LINE>hadoopConf.set(k, v);<NEW_LINE>log.debug("[inputkeys] Set {}={}", k, v);<NEW_LINE>}<NEW_LINE>} | getProperty(key).toString(); |
1,264,555 | // snippet-start:[sqs.java2.add_tags.main]<NEW_LINE>public static void addTags(SqsClient sqsClient, String queueName) {<NEW_LINE>try {<NEW_LINE>GetQueueUrlRequest urlRequest = GetQueueUrlRequest.builder().queueName(queueName).build();<NEW_LINE>GetQueueUrlResponse getQueueUrlResponse = sqsClient.getQueueUrl(urlRequest);<NEW_LINE>String queueUrl = getQueueUrlResponse.queueUrl();<NEW_LINE>HashMap<String, String> addedTags = new HashMap<>();<NEW_LINE>addedTags.put("Team", "Development");<NEW_LINE>addedTags.put("Priority", "Beta");<NEW_LINE><MASK><NEW_LINE>TagQueueRequest tagQueueRequest = TagQueueRequest.builder().queueUrl(queueUrl).tags(addedTags).build();<NEW_LINE>sqsClient.tagQueue(tagQueueRequest);<NEW_LINE>System.out.println("Tags have been applied to " + queueName);<NEW_LINE>} catch (SqsException e) {<NEW_LINE>System.err.println(e.awsErrorDetails().errorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>} | addedTags.put("Accounting ID", "456def"); |
1,545,051 | private void postSanityCheck(boolean utilizationOverLimit, Broker broker, double brokerCapacityLimit, double hostCapacityLimit) throws OptimizationFailureException {<NEW_LINE>// 1. Capacity violation check -- note that this check also ensures that no replica resides on dead brokers.<NEW_LINE>if (utilizationOverLimit) {<NEW_LINE>Resource currentResource = resource();<NEW_LINE>ProvisionRecommendation recommendation = new ProvisionRecommendation.Builder(ProvisionStatus.UNDER_PROVISIONED).numBrokers(1).resource(currentResource).build();<NEW_LINE>if (!currentResource.isHostResource()) {<NEW_LINE>// Utilization is above the capacity limit after all replicas in the given source broker were checked.<NEW_LINE>throw new OptimizationFailureException(String.format("[%s] Utilization (%.2f) of broker %d violated capacity limit (%.2f) for resource %s.", name(), broker.load().expectedUtilizationFor(currentResource), broker.id()<MASK><NEW_LINE>} else {<NEW_LINE>throw new OptimizationFailureException(String.format("[%s] Utilization (%.2f) of host %s violated capacity limit (%.2f) for resource %s.", name(), broker.host().load().expectedUtilizationFor(currentResource), broker.host().name(), hostCapacityLimit, currentResource), recommendation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// 2. Ensure that no offline replicas remain in the broker.<NEW_LINE>if (!broker.currentOfflineReplicas().isEmpty()) {<NEW_LINE>ProvisionRecommendation recommendation = new ProvisionRecommendation.Builder(ProvisionStatus.UNDER_PROVISIONED).numBrokers(1).resource(resource()).build();<NEW_LINE>throw new OptimizationFailureException(String.format("[%s] Cannot remove offline replicas from broker %d.", name(), broker.id()), recommendation);<NEW_LINE>}<NEW_LINE>} | , brokerCapacityLimit, currentResource), recommendation); |
742,891 | public static DescribePropertyUsageNewestResponse unmarshall(DescribePropertyUsageNewestResponse describePropertyUsageNewestResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePropertyUsageNewestResponse.setRequestId(_ctx.stringValue("DescribePropertyUsageNewestResponse.RequestId"));<NEW_LINE>describePropertyUsageNewestResponse.setItemCount(_ctx.integerValue("DescribePropertyUsageNewestResponse.ItemCount"));<NEW_LINE>describePropertyUsageNewestResponse.setType(_ctx.stringValue("DescribePropertyUsageNewestResponse.Type"));<NEW_LINE>List<NewestStatisticItem> newestStatisticItems = new ArrayList<NewestStatisticItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePropertyUsageNewestResponse.NewestStatisticItems.Length"); i++) {<NEW_LINE>NewestStatisticItem newestStatisticItem = new NewestStatisticItem();<NEW_LINE>newestStatisticItem.setName(_ctx.stringValue("DescribePropertyUsageNewestResponse.NewestStatisticItems[" + i + "].Name"));<NEW_LINE>newestStatisticItem.setCreate(_ctx.longValue<MASK><NEW_LINE>newestStatisticItems.add(newestStatisticItem);<NEW_LINE>}<NEW_LINE>describePropertyUsageNewestResponse.setNewestStatisticItems(newestStatisticItems);<NEW_LINE>return describePropertyUsageNewestResponse;<NEW_LINE>} | ("DescribePropertyUsageNewestResponse.NewestStatisticItems[" + i + "].Create")); |
1,450,600 | protected void applyPressingInWorld() {<NEW_LINE>AABB bb = new AABB(worldPosition.below(1));<NEW_LINE>boolean bulk = canProcessInBulk();<NEW_LINE>pressedItems.clear();<NEW_LINE>if (level.isClientSide)<NEW_LINE>return;<NEW_LINE>for (Entity entity : level.getEntities(null, bb)) {<NEW_LINE>if (!(entity instanceof ItemEntity))<NEW_LINE>continue;<NEW_LINE>if (!entity.isAlive() || !entity.isOnGround())<NEW_LINE>continue;<NEW_LINE>ItemEntity itemEntity = (ItemEntity) entity;<NEW_LINE>ItemStack item = itemEntity.getItem();<NEW_LINE>pressedItems.add(item);<NEW_LINE>sendData();<NEW_LINE>Optional<PressingRecipe> recipe = getRecipe(item);<NEW_LINE>if (!recipe.isPresent())<NEW_LINE>continue;<NEW_LINE>if (bulk || item.getCount() == 1) {<NEW_LINE>InWorldProcessing.applyRecipeOn(<MASK><NEW_LINE>} else {<NEW_LINE>for (ItemStack result : InWorldProcessing.applyRecipeOn(ItemHandlerHelper.copyStackWithSize(item, 1), recipe.get())) {<NEW_LINE>ItemEntity created = new ItemEntity(level, itemEntity.getX(), itemEntity.getY(), itemEntity.getZ(), result);<NEW_LINE>created.setDefaultPickUpDelay();<NEW_LINE>created.setDeltaMovement(VecHelper.offsetRandomly(Vec3.ZERO, Create.RANDOM, .05f));<NEW_LINE>level.addFreshEntity(created);<NEW_LINE>}<NEW_LINE>item.shrink(1);<NEW_LINE>}<NEW_LINE>AllTriggers.triggerForNearbyPlayers(AllTriggers.BONK, level, worldPosition, 4);<NEW_LINE>entityScanCooldown = 0;<NEW_LINE>if (!bulk)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | itemEntity, recipe.get()); |
1,560,022 | /* View action functions */<NEW_LINE>public void onButtonClick(View view) {<NEW_LINE>assert view.getClass().isInstance(Button.class);<NEW_LINE>Button button = (Button) view;<NEW_LINE>switch(button.getId()) {<NEW_LINE>case R.id.buttonCancel:<NEW_LINE>finish();<NEW_LINE>break;<NEW_LINE>case R.id.buttonSave:<NEW_LINE>DatePicker datePicker = (DatePicker) this.findViewById(R.id.datePicker);<NEW_LINE>TimePicker timePicker = (TimePicker) this.findViewById(R.id.timePicker);<NEW_LINE>Settings.pickedDate.setYear(<MASK><NEW_LINE>Settings.pickedDate.setMonth(datePicker.getMonth());<NEW_LINE>Settings.pickedDate.setDate(datePicker.getDayOfMonth());<NEW_LINE>Settings.pickedDate.setHours(timePicker.getCurrentHour());<NEW_LINE>Settings.pickedDate.setMinutes(timePicker.getCurrentMinute());<NEW_LINE>Settings.pickedDate.setSeconds(0);<NEW_LINE>finish();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | datePicker.getYear() - 1900); |
537,605 | private UserModel createUser(RealmModel realm, String username) {<NEW_LINE>UserModel user;<NEW_LINE>if (isImportEnabled()) {<NEW_LINE>user = session.userLocalStorage().addUser(realm, username);<NEW_LINE>user.setEnabled(true);<NEW_LINE>user.setFederationLink(model.getId());<NEW_LINE>} else {<NEW_LINE>user = new AbstractUserAdapterFederatedStorage.Streams(session, realm, model) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getUsername() {<NEW_LINE>return username.toLowerCase();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setUsername(String innerUsername) {<NEW_LINE>if (!Objects.equals(innerUsername, username.toLowerCase())) {<NEW_LINE>throw new RuntimeException("Unsupported");<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void leaveGroup(GroupModel group) {<NEW_LINE>UserMapStorage.this.leaveGroup(<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void joinGroup(GroupModel group) {<NEW_LINE>UserMapStorage.this.joinGroup(realm, getUsername(), group);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getFederationLink() {<NEW_LINE>return model.getId();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>return user;<NEW_LINE>} | realm, getUsername(), group); |
814,484 | public void channelRead(ChannelHandlerContext ctx, Object msg) {<NEW_LINE>if (msg instanceof ClientTransferDataProtoc) {<NEW_LINE>ClientTransferDataProtoc clientTransferData = (ClientTransferDataProtoc) msg;<NEW_LINE>if (!clientTransferData.getInfo().isEmpty()) {<NEW_LINE>SimplePrinter.printNotice(clientTransferData.getInfo());<NEW_LINE>}<NEW_LINE>ClientEventCode code = ClientEventCode.valueOf(clientTransferData.getCode());<NEW_LINE>if (User.INSTANCE.isWatching()) {<NEW_LINE>Map<String, Object> wrapMap = new HashMap<>(3);<NEW_LINE>wrapMap.put("code", code);<NEW_LINE>wrapMap.put("data", clientTransferData.getData());<NEW_LINE>ClientEventListener.get(ClientEventCode.CODE_GAME_WATCH).call(ctx.channel(), Noson.reversal(wrapMap));<NEW_LINE>} else {<NEW_LINE>ClientEventListener.get(code).call(ctx.channel(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), clientTransferData.getData()); |
1,191,207 | private Collection<Object> buildAutoTableRowData(final ShardingAutoTableRuleConfiguration shardingAutoTableRuleConfig) {<NEW_LINE>Collection<Object> result = new LinkedList<>();<NEW_LINE>result.add(shardingAutoTableRuleConfig.getLogicTable());<NEW_LINE>result.add("");<NEW_LINE>result.add(shardingAutoTableRuleConfig.getActualDataSources());<NEW_LINE>result.add("");<NEW_LINE>result.add("");<NEW_LINE>result.add("");<NEW_LINE>result.add("");<NEW_LINE>result.add(getTableStrategyType(shardingAutoTableRuleConfig.getShardingStrategy()));<NEW_LINE>result.add(getTableShardingColumn<MASK><NEW_LINE>Optional<ShardingStrategyConfiguration> tableShardingStrategyConfig = getTableShardingStrategy(shardingAutoTableRuleConfig.getShardingStrategy());<NEW_LINE>result.add(tableShardingStrategyConfig.map(this::getAlgorithmType).orElse(""));<NEW_LINE>result.add(tableShardingStrategyConfig.map(this::getAlgorithmProperties).orElse(""));<NEW_LINE>result.add(getKeyGenerateColumn(shardingAutoTableRuleConfig.getKeyGenerateStrategy()));<NEW_LINE>result.add(getKeyGeneratorType(shardingAutoTableRuleConfig.getKeyGenerateStrategy()));<NEW_LINE>result.add(getKeyGeneratorProps(shardingAutoTableRuleConfig.getKeyGenerateStrategy()));<NEW_LINE>return result;<NEW_LINE>} | (shardingAutoTableRuleConfig.getShardingStrategy())); |
1,071,225 | public PiecewisePolynomialResult interpolate(double[] xValues, double[] yValues) {<NEW_LINE>ArgChecker.notEmpty(xValues, "xValues");<NEW_LINE>ArgChecker.notEmpty(yValues, "yValues");<NEW_LINE>int nDataPts = xValues.length;<NEW_LINE>ArgChecker.isTrue(nDataPts > 1, "at least two data points required");<NEW_LINE>ArgChecker.isTrue(nDataPts == yValues.length, "xValues length = yValues length");<NEW_LINE>for (int i = 0; i < nDataPts; ++i) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(xValues[i]), "xData containing NaN");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(xValues[i]), "xData containing Infinity");<NEW_LINE>ArgChecker.isFalse(Double.isNaN(yValues[i]), "yData containing NaN");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(yValues[i]), "yData containing Infinity");<NEW_LINE>}<NEW_LINE>if (nDataPts == 1) {<NEW_LINE>return new PiecewisePolynomialResult(DoubleArray.copyOf(xValues), DoubleMatrix.filled(1, 1, yValues[0]), 1, 1);<NEW_LINE>}<NEW_LINE>double[] xValuesSrt = Arrays.copyOf(xValues, nDataPts);<NEW_LINE>double[] yValuesSrt = Arrays.copyOf(yValues, nDataPts);<NEW_LINE>DoubleArrayMath.sortPairs(xValuesSrt, yValuesSrt);<NEW_LINE>ArgChecker.noDuplicatesSorted(xValuesSrt, "xValues");<NEW_LINE>DoubleMatrix coefMatrix = solve(xValuesSrt, yValuesSrt);<NEW_LINE>for (int i = 0; i < coefMatrix.rowCount(); ++i) {<NEW_LINE>for (int j = 0; j < coefMatrix.columnCount(); ++j) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(coefMatrix.get(i, j)), "Too large input");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(coefMatrix.get(i, j)), "Too large input");<NEW_LINE>}<NEW_LINE>double ref = 0.;<NEW_LINE>double interval = xValuesSrt[i + 1] - xValuesSrt[i];<NEW_LINE>for (int j = 0; j < 2; ++j) {<NEW_LINE>ref += coefMatrix.get(i, j) * Math.pow(interval, 1 - j);<NEW_LINE>ArgChecker.isFalse(Double.isNaN(coefMatrix.get(i, j)), "Too large input");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(coefMatrix.get(<MASK><NEW_LINE>}<NEW_LINE>double bound = Math.max(Math.abs(ref) + Math.abs(yValuesSrt[i + 1]), 1.e-1);<NEW_LINE>ArgChecker.isTrue(Math.abs(ref - yValuesSrt[i + 1]) < ERROR * bound, "Input is too large/small or data are not distinct enough");<NEW_LINE>}<NEW_LINE>return new PiecewisePolynomialResult(DoubleArray.copyOf(xValuesSrt), coefMatrix, coefMatrix.columnCount(), 1);<NEW_LINE>} | i, j)), "Too large input"); |
791,168 | public void fitSelectionToLines(boolean expand) {<NEW_LINE>Range range = getSession().getSelection().getRange();<NEW_LINE>Position start = range.getStart();<NEW_LINE>Position newStart = start;<NEW_LINE>if (start.getColumn() > 0) {<NEW_LINE>if (expand) {<NEW_LINE>newStart = Position.create(start.getRow(), 0);<NEW_LINE>} else {<NEW_LINE>String firstLine = getSession().getLine(start.getRow());<NEW_LINE>if (firstLine.substring(0, start.getColumn()).trim().length() == 0)<NEW_LINE>newStart = Position.create(start.getRow(), 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Position end = range.getEnd();<NEW_LINE>Position newEnd = end;<NEW_LINE>if (expand) {<NEW_LINE>int endRow = end.getRow();<NEW_LINE>if (endRow == newStart.getRow() || end.getColumn() > 0) {<NEW_LINE>// If selection ends at the start of a line, keep the selection<NEW_LINE>// there--unless that means less than one line will be selected<NEW_LINE>// in total.<NEW_LINE>newEnd = Position.create(endRow, getSession().getLine(endRow).length());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>while (newEnd.getRow() != newStart.getRow()) {<NEW_LINE>String line = getSession().getLine(newEnd.getRow());<NEW_LINE>if (line.substring(0, newEnd.getColumn()).trim().length() != 0)<NEW_LINE>break;<NEW_LINE>int prevRow = newEnd.getRow() - 1;<NEW_LINE>int len = getSession().getLine(prevRow).length();<NEW_LINE>newEnd = Position.create(prevRow, len);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getSession().getSelection().setSelectionRange(Range<MASK><NEW_LINE>} | .fromPoints(newStart, newEnd)); |
935,064 | public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RequestOptions obj) {<NEW_LINE>for (java.util.Map.Entry<String, Object> member : json) {<NEW_LINE>switch(member.getKey()) {<NEW_LINE>case "absoluteURI":<NEW_LINE>if (member.getValue() instanceof String) {<NEW_LINE>obj.setAbsoluteURI((String) member.getValue());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "followRedirects":<NEW_LINE>if (member.getValue() instanceof Boolean) {<NEW_LINE>obj.setFollowRedirects((Boolean) member.getValue());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "host":<NEW_LINE>if (member.getValue() instanceof String) {<NEW_LINE>obj.setHost((String) member.getValue());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "port":<NEW_LINE>if (member.getValue() instanceof Number) {<NEW_LINE>obj.setPort(((Number) member.getValue()).intValue());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "proxyOptions":<NEW_LINE>if (member.getValue() instanceof JsonObject) {<NEW_LINE>obj.setProxyOptions(new io.vertx.core.net.ProxyOptions((io.vertx.core.json.JsonObject) member.getValue()));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "ssl":<NEW_LINE>if (member.getValue() instanceof Boolean) {<NEW_LINE>obj.setSsl((Boolean) member.getValue());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "timeout":<NEW_LINE>if (member.getValue() instanceof Number) {<NEW_LINE>obj.setTimeout(((Number) member.getValue<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "traceOperation":<NEW_LINE>if (member.getValue() instanceof String) {<NEW_LINE>obj.setTraceOperation((String) member.getValue());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "uri":<NEW_LINE>if (member.getValue() instanceof String) {<NEW_LINE>obj.setURI((String) member.getValue());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ()).longValue()); |
1,296,073 | public static void thinAndExtractApplications() throws Exception {<NEW_LINE>installDir = System.setProperty(PROPERTY_KEY_INSTALL_DIR, server.getInstallRoot());<NEW_LINE>// make sure the usr/shared/resources folder exists<NEW_LINE>sharedResourcesDir = new RemoteFile(server.getFileFromLibertyInstallRoot(""), "usr/shared/resources");<NEW_LINE>sharedResourcesDir.mkdirs();<NEW_LINE>appsDir = server.getFileFromLibertyServerRoot("apps");<NEW_LINE>RemoteFile sourceApp = new RemoteFile(server.getFileFromLibertyServerRoot("/apps"), SPRING_BOOT_20_APP_BASE);<NEW_LINE>RemoteFile thinApp = new RemoteFile(server.getFileFromLibertyServerRoot("/apps"), SPRING_BOOT_20_APP_BASE_THIN);<NEW_LINE>List<String> cmd = new ArrayList<>();<NEW_LINE>cmd.add("thin");<NEW_LINE>cmd.add("--sourceAppPath=" + sourceApp.getAbsolutePath());<NEW_LINE>cmd.add("--targetLibCachePath=" + new RemoteFile(sharedResourcesDir, SPRING_LIB_INDEX_CACHE).getAbsolutePath());<NEW_LINE>cmd.add("--targetThinAppPath=" + thinApp.getAbsolutePath());<NEW_LINE>List<String> output = SpringBootUtilityScriptUtils.execute(null, cmd);<NEW_LINE>Assert.assertTrue("Failed to thin the application", SpringBootUtilityScriptUtils.findMatchingLine(output, "Thin application: .*\\." + SPRING_APP_TYPE));<NEW_LINE>RemoteFile baseExtracted = new RemoteFile(server<MASK><NEW_LINE>extract(sourceApp, baseExtracted);<NEW_LINE>extract(thinApp, new RemoteFile(server.getFileFromLibertyServerRoot("/apps"), SPRING_BOOT_20_APP_BASE_THIN_EXTRACTED));<NEW_LINE>createLoose(baseExtracted, new RemoteFile(server.getFileFromLibertyServerRoot("/apps"), SPRING_BOOT_20_APP_BASE_LOOSE));<NEW_LINE>} | .getFileFromLibertyServerRoot("/apps"), SPRING_BOOT_20_APP_BASE_EXTRACTED); |
831,622 | static void rethrow(Throwable cause, BugReporter bugReporter, EvaluationResult<?> resultForDebugging) throws BuildFailedException, TestExecException {<NEW_LINE>Throwables.throwIfUnchecked(cause);<NEW_LINE>Throwable innerCause = cause.getCause();<NEW_LINE>if (innerCause instanceof TestExecException) {<NEW_LINE>throw (TestExecException) innerCause;<NEW_LINE>}<NEW_LINE>if (cause instanceof ActionExecutionException) {<NEW_LINE>ActionExecutionException actionExecutionCause = (ActionExecutionException) cause;<NEW_LINE>String message = cause.getMessage();<NEW_LINE>if (actionExecutionCause.getAction() != null) {<NEW_LINE>message = actionExecutionCause.getAction()<MASK><NEW_LINE>}<NEW_LINE>// Sometimes ActionExecutionExceptions are caused by Actions with no owner.<NEW_LINE>if (actionExecutionCause.getLocation() != null) {<NEW_LINE>message = actionExecutionCause.getLocation() + " " + message;<NEW_LINE>}<NEW_LINE>throw new BuildFailedException(message, actionExecutionCause.isCatastrophe(), /*errorAlreadyShown=*/<NEW_LINE>!actionExecutionCause.showError(), actionExecutionCause.getDetailedExitCode());<NEW_LINE>}<NEW_LINE>if (cause instanceof InputFileErrorException) {<NEW_LINE>throw (InputFileErrorException) cause;<NEW_LINE>}<NEW_LINE>// We encountered an exception we don't think we should have encountered. This can indicate<NEW_LINE>// an exception-processing bug in our code, such as lower level exceptions not being properly<NEW_LINE>// handled, or in our expectations in this method.<NEW_LINE>if (cause instanceof DetailedException) {<NEW_LINE>// The exception escaped Skyframe error bubbling, but its failure detail can still be used.<NEW_LINE>bugReporter.logUnexpected((Exception) cause, "action terminated with unexpected exception with result %s", resultForDebugging);<NEW_LINE>throw new BuildFailedException(cause.getMessage(), ((DetailedException) cause).getDetailedExitCode());<NEW_LINE>}<NEW_LINE>// An undetailed exception means we may incorrectly attribute responsibility for the failure:<NEW_LINE>// we need to fix that.<NEW_LINE>bugReporter.sendBugReport(new IllegalStateException("action terminated with unexpected exception with result " + resultForDebugging, cause));<NEW_LINE>String message = "Unexpected exception, please file an issue with the Bazel team: " + cause.getMessage();<NEW_LINE>throw new BuildFailedException(message, createDetailedExecutionExitCode(message, UNKONW_EXECUTION));<NEW_LINE>} | .describe() + " failed: " + message; |
856,311 | public com.amazonaws.services.connect.model.ThrottlingException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.connect.model.ThrottlingException throttlingException = new com.amazonaws.services.<MASK><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 null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return throttlingException;<NEW_LINE>} | connect.model.ThrottlingException(null); |
1,778,944 | public final PairList<String, Shape> describeOutput() {<NEW_LINE>if (outputDescriptions == null) {<NEW_LINE>outputDescriptions = new PairList<>();<NEW_LINE>Map<String, TensorInfo> outputsMap = servingDefault.getOutputsMap();<NEW_LINE>List<String> keys = new ArrayList<>(outputsMap.keySet());<NEW_LINE>Collections.sort(keys);<NEW_LINE>List<TF_Operation> outputOpHandlesList = new ArrayList<>();<NEW_LINE>List<Integer> outputOpIndicesList = new ArrayList<>();<NEW_LINE>for (String key : keys) {<NEW_LINE>TensorInfo tensorInfo = outputsMap.get(key);<NEW_LINE><MASK><NEW_LINE>// does not support string tensors<NEW_LINE>if (tensorInfo.getDtype() == org.tensorflow.proto.framework.DataType.DT_STRING) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>outputDescriptions.add(key, new Shape(shapeProto.getDimList().stream().mapToLong(TensorShapeProto.Dim::getSize).toArray()));<NEW_LINE>Pair<TF_Operation, Integer> pair = JavacppUtils.getGraphOperationByName(graphHandle, tensorInfo.getName());<NEW_LINE>outputOpHandlesList.add(pair.getKey());<NEW_LINE>outputOpIndicesList.add(pair.getValue());<NEW_LINE>}<NEW_LINE>outputOpHandles = outputOpHandlesList.toArray(new TF_Operation[0]);<NEW_LINE>outputOpIndices = outputOpIndicesList.stream().mapToInt(i -> i).toArray();<NEW_LINE>}<NEW_LINE>return outputDescriptions;<NEW_LINE>} | TensorShapeProto shapeProto = tensorInfo.getTensorShape(); |
1,355,648 | public boolean generate(List<AssociatedPair> dataSet, ScaleTranslateRotate2D output) {<NEW_LINE>if (!generateAffine.generate(dataSet, affine))<NEW_LINE>return false;<NEW_LINE>R.data[0] = affine.a11;<NEW_LINE>R.data[1] = affine.a12;<NEW_LINE>R.data[2] = affine.a21;<NEW_LINE>R.<MASK><NEW_LINE>if (!svd.decompose(R))<NEW_LINE>return false;<NEW_LINE>// determinant of a rotation matrix is 1. Assume that scale makes it not one<NEW_LINE>double[] sv = svd.getSingularValues();<NEW_LINE>output.scale = (sv[0] + sv[1]) / 2.0;<NEW_LINE>if (output.scale < 0)<NEW_LINE>throw new RuntimeException("Handle this case");<NEW_LINE>svd.getU(U, false);<NEW_LINE>svd.getV(V, false);<NEW_LINE>CommonOps_DDRM.multTransB(U, V, R);<NEW_LINE>if (CommonOps_DDRM.det(R) < 0) {<NEW_LINE>// There are situations where R might not have a determinant of one and is instead<NEW_LINE>// a reflection is returned<NEW_LINE>for (int i = 0; i < 2; i++) V.set(i, 1, -V.get(i, 1));<NEW_LINE>CommonOps_DDRM.mult(U, V, R);<NEW_LINE>}<NEW_LINE>// theta = atan2( sin(theta) , cos(theta) )<NEW_LINE>output.theta = Math.atan2(-R.data[1], R.data[0]);<NEW_LINE>output.transX = affine.tx;<NEW_LINE>output.transY = affine.ty;<NEW_LINE>return true;<NEW_LINE>} | data[3] = affine.a22; |
1,685,348 | protected void startPersistThread() {<NEW_LINE>final Granularity segmentGranularity = schema.getGranularitySpec().getSegmentGranularity();<NEW_LINE>final Period windowPeriod = config.getWindowPeriod();<NEW_LINE>final DateTime truncatedNow = segmentGranularity.bucketStart(DateTimes.nowUtc());<NEW_LINE>final long windowMillis = windowPeriod.toStandardDuration().getMillis();<NEW_LINE>log.info("Expect to run at [%s]", DateTimes.nowUtc().plus(new Duration(System.currentTimeMillis(), segmentGranularity.increment(truncatedNow).<MASK><NEW_LINE>String threadName = StringUtils.format("%s-overseer-%d", schema.getDataSource(), config.getShardSpec().getPartitionNum());<NEW_LINE>ThreadRenamingCallable<ScheduledExecutors.Signal> threadRenamingCallable = new ThreadRenamingCallable<ScheduledExecutors.Signal>(threadName) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ScheduledExecutors.Signal doCall() {<NEW_LINE>if (stopped) {<NEW_LINE>log.info("Stopping merge-n-push overseer thread");<NEW_LINE>return ScheduledExecutors.Signal.STOP;<NEW_LINE>}<NEW_LINE>mergeAndPush();<NEW_LINE>if (stopped) {<NEW_LINE>log.info("Stopping merge-n-push overseer thread");<NEW_LINE>return ScheduledExecutors.Signal.STOP;<NEW_LINE>} else {<NEW_LINE>return ScheduledExecutors.Signal.REPEAT;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Duration initialDelay = new Duration(System.currentTimeMillis(), segmentGranularity.increment(truncatedNow).getMillis() + windowMillis);<NEW_LINE>Duration rate = new Duration(truncatedNow, segmentGranularity.increment(truncatedNow));<NEW_LINE>ScheduledExecutors.scheduleAtFixedRate(scheduledExecutor, initialDelay, rate, threadRenamingCallable);<NEW_LINE>} | getMillis() + windowMillis))); |
1,833,777 | public boolean visit(RecordDeclaration node) {<NEW_LINE>ASTNode javadoc = getChildNode(node, RecordDeclaration.JAVADOC_PROPERTY);<NEW_LINE>if (javadoc != null) {<NEW_LINE>javadoc.accept(this);<NEW_LINE>}<NEW_LINE>visitList(node, RecordDeclaration.MODIFIERS2_PROPERTY, String.valueOf(' '), Util.EMPTY_STRING, String.valueOf(' '));<NEW_LINE>// $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>getChildNode(node, RecordDeclaration.NAME_PROPERTY).accept(this);<NEW_LINE>this.result.append(' ');<NEW_LINE>visitList(node, RecordDeclaration.TYPE_PARAMETERS_PROPERTY, String.valueOf(','), String.valueOf('<'), String.valueOf('>'));<NEW_LINE>this.result.append('(');<NEW_LINE>visitList(node, RecordDeclaration.RECORD_COMPONENTS_PROPERTY, String.valueOf(','));<NEW_LINE>this.result.append(')');<NEW_LINE>this.result.append(' ');<NEW_LINE>// $NON-NLS-1$<NEW_LINE>visitList(node, RecordDeclaration.SUPER_INTERFACE_TYPES_PROPERTY, String.valueOf(','), "implements ", Util.EMPTY_STRING);<NEW_LINE>this.result.append('{');<NEW_LINE>visitList(node, RecordDeclaration.BODY_DECLARATIONS_PROPERTY, Util.EMPTY_STRING, String.valueOf(';'), Util.EMPTY_STRING);<NEW_LINE>this.result.append('}');<NEW_LINE>return false;<NEW_LINE>} | this.result.append("record "); |
740,776 | public void connect(IGenericType type, IType typeHandle, IType superclassHandle, IType[] superinterfaceHandles) {<NEW_LINE>if (typeHandle == null)<NEW_LINE>return;<NEW_LINE>if (TypeHierarchy.DEBUG) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.// $NON-NLS-1$<NEW_LINE>println("Connecting: " + ((JavaElement) typeHandle).toStringWithAncestors());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.// $NON-NLS-1$<NEW_LINE>println(" to superclass: " + (// $NON-NLS-1$<NEW_LINE>superclassHandle == null ? "<None>" : ((JavaElement) <MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.print(" and superinterfaces:");<NEW_LINE>if (superinterfaceHandles == null || superinterfaceHandles.length == 0) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.println(" <None>");<NEW_LINE>} else {<NEW_LINE>System.out.println();<NEW_LINE>for (int i = 0, length = superinterfaceHandles.length; i < length; i++) {<NEW_LINE>if (superinterfaceHandles[i] == null)<NEW_LINE>continue;<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.// $NON-NLS-1$<NEW_LINE>println(" " + ((JavaElement) superinterfaceHandles[i]).toStringWithAncestors());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now do the caching<NEW_LINE>switch(TypeDeclaration.kind(type.getModifiers())) {<NEW_LINE>case TypeDeclaration.CLASS_DECL:<NEW_LINE>case TypeDeclaration.ENUM_DECL:<NEW_LINE>if (superclassHandle == null) {<NEW_LINE>this.hierarchy.addRootClass(typeHandle);<NEW_LINE>} else {<NEW_LINE>this.hierarchy.cacheSuperclass(typeHandle, superclassHandle);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case TypeDeclaration.INTERFACE_DECL:<NEW_LINE>case TypeDeclaration.ANNOTATION_TYPE_DECL:<NEW_LINE>// https://bugs.eclipse.org/bugs/show_bug.cgi?id=329663<NEW_LINE>if (this.hierarchy.typeToSuperInterfaces.get(typeHandle) == null)<NEW_LINE>this.hierarchy.addInterface(typeHandle);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (superinterfaceHandles == null) {<NEW_LINE>superinterfaceHandles = TypeHierarchy.NO_TYPE;<NEW_LINE>}<NEW_LINE>this.hierarchy.cacheSuperInterfaces(typeHandle, superinterfaceHandles);<NEW_LINE>// record flags<NEW_LINE>this.hierarchy.cacheFlags(typeHandle, type.getModifiers());<NEW_LINE>} | superclassHandle).toStringWithAncestors())); |
563,939 | static String fixWindowsBug(String input, String version) {<NEW_LINE>if (IS_WINDOWS && version.equals("1.1")) {<NEW_LINE>int firstImport = input.indexOf("\nimport ");<NEW_LINE>if (firstImport == 0) {<NEW_LINE>return input;<NEW_LINE>} else if (firstImport > 0) {<NEW_LINE>int numToTrim = 0;<NEW_LINE>char prevChar;<NEW_LINE>do {<NEW_LINE>++numToTrim;<NEW_LINE>prevChar = input.charAt(firstImport - numToTrim);<NEW_LINE>} while (Character.isWhitespace(prevChar) && (firstImport - numToTrim) > 0);<NEW_LINE>if (firstImport - numToTrim == 0) {<NEW_LINE>// import was the very first line, and we'd like to maintain a one-line gap<NEW_LINE>++numToTrim;<NEW_LINE>} else if (prevChar == ';' || prevChar == '/') {<NEW_LINE>// import came after either license or a package declaration<NEW_LINE>--numToTrim;<NEW_LINE>}<NEW_LINE>if (numToTrim > 0) {<NEW_LINE>return input.substring(0, firstImport - numToTrim + 2) + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return input;<NEW_LINE>} | input.substring(firstImport + 1); |
853,063 | protected Set<HuId> retrieveHUsToReceive() {<NEW_LINE>// https://github.com/metasfresh/metasfresh/issues/1863<NEW_LINE>// if the queryFilter is empty, then *do not* return everything to avoid an OOME<NEW_LINE>final IQueryFilter<I_M_HU> processInfoFilter = getProcessInfo().getQueryFilterOrElse(ConstantQueryFilter.of(false));<NEW_LINE>final IQuery<I_M_HU> query = Services.get(IQueryBL.class).createQueryBuilder(I_M_HU.class, this).filter(processInfoFilter)<MASK><NEW_LINE>final Set<HuId> huIds = query.listIds().stream().map(HuId::ofRepoId).collect(ImmutableSet.toImmutableSet());<NEW_LINE>if (huIds.isEmpty()) {<NEW_LINE>throw new AdempiereException("@NoSelection@ @M_HU_ID@").appendParametersToMessage().setParameter("query", query);<NEW_LINE>}<NEW_LINE>return huIds;<NEW_LINE>} | .addOnlyActiveRecordsFilter().create(); |
699,728 | public static DescribeResetRecordListResponse unmarshall(DescribeResetRecordListResponse describeResetRecordListResponse, UnmarshallerContext context) {<NEW_LINE>describeResetRecordListResponse.setRequestId(context.stringValue("DescribeResetRecordListResponse.RequestId"));<NEW_LINE>describeResetRecordListResponse.setModule(context.stringValue("DescribeResetRecordListResponse.Module"));<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setTotal(context.integerValue("DescribeResetRecordListResponse.PageInfo.total"));<NEW_LINE>pageInfo.setPageSize(context.integerValue("DescribeResetRecordListResponse.PageInfo.pageSize"));<NEW_LINE>pageInfo.setCurrentPage(context.integerValue("DescribeResetRecordListResponse.PageInfo.currentPage"));<NEW_LINE>describeResetRecordListResponse.setPageInfo(pageInfo);<NEW_LINE>List<Data> dataList = new ArrayList<Data>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeResetRecordListResponse.DataList.Length"); i++) {<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPunishType(context.stringValue("DescribeResetRecordListResponse.DataList[" + i + "].PunishType"));<NEW_LINE>data.setDstIP(context.stringValue("DescribeResetRecordListResponse.DataList[" + i + "].DstIP"));<NEW_LINE>data.setPunishResult(context.stringValue<MASK><NEW_LINE>data.setDstPort(context.integerValue("DescribeResetRecordListResponse.DataList[" + i + "].DstPort"));<NEW_LINE>data.setSrcIP(context.stringValue("DescribeResetRecordListResponse.DataList[" + i + "].SrcIP"));<NEW_LINE>data.setPunishCount(context.integerValue("DescribeResetRecordListResponse.DataList[" + i + "].PunishCount"));<NEW_LINE>dataList.add(data);<NEW_LINE>}<NEW_LINE>describeResetRecordListResponse.setDataList(dataList);<NEW_LINE>return describeResetRecordListResponse;<NEW_LINE>} | ("DescribeResetRecordListResponse.DataList[" + i + "].PunishResult")); |
1,228,676 | private static ClassLoader internalGetConciergeBundleClassLoader(Bundle bundle) {<NEW_LINE>if (osgiContainer == OSGiContainerType.Concierge) {<NEW_LINE>try {<NEW_LINE>if (Concierge_BundleWiring_Class == null) {<NEW_LINE>Concierge_BundleWiring_Class = bundle.getClass().getClassLoader().loadClass("org.osgi.framework.wiring.BundleWiring");<NEW_LINE>Concierge_BundleImpl_Adapt_Method = Concierge_BundleImpl_Class.getMethod("adapt", new Class[] { Class.class });<NEW_LINE>Concierge_BundleImpl_Adapt_Method.setAccessible(true);<NEW_LINE><MASK><NEW_LINE>Concierge_BundleWiring_getClassLoader_Method.setAccessible(true);<NEW_LINE>}<NEW_LINE>Object wiring = Concierge_BundleImpl_Adapt_Method.invoke(bundle, new Object[] { Concierge_BundleWiring_Class });<NEW_LINE>ClassLoader cl = (ClassLoader) Concierge_BundleWiring_getClassLoader_Method.invoke(wiring);<NEW_LINE>return cl;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Unable to load Concierge platform", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.warn("No classloader for Concierge platform for bundle {}", bundle.getSymbolicName());<NEW_LINE>return null;<NEW_LINE>} | Concierge_BundleWiring_getClassLoader_Method = Concierge_BundleWiring_Class.getMethod("getClassLoader"); |
1,539,095 | private void addPositions(final PostingsEnum in, final DataOutput out) throws IOException {<NEW_LINE>int freq = in.freq();<NEW_LINE>out.writeVInt(freq);<NEW_LINE>int previousPosition = 0;<NEW_LINE>int previousEndOffset = 0;<NEW_LINE>for (int i = 0; i < freq; i++) {<NEW_LINE>final int pos = in.nextPosition();<NEW_LINE>final BytesRef payload = in.getPayload();<NEW_LINE>// The low-order bit of token is set only if there is a payload, the<NEW_LINE>// previous bits are the delta-encoded position.<NEW_LINE>final int token = (pos - previousPosition) << 1 | (payload == null ? 0 : 1);<NEW_LINE>out.writeVInt(token);<NEW_LINE>previousPosition = pos;<NEW_LINE>if (storeOffsets) {<NEW_LINE>// don't encode offsets if they are not stored<NEW_LINE>final int startOffset = in.startOffset();<NEW_LINE>final int endOffset = in.endOffset();<NEW_LINE>out.writeVInt(startOffset - previousEndOffset);<NEW_LINE>out.writeVInt(endOffset - startOffset);<NEW_LINE>previousEndOffset = endOffset;<NEW_LINE>}<NEW_LINE>if (payload != null) {<NEW_LINE>out.writeVInt(payload.length);<NEW_LINE>out.writeBytes(payload.bytes, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | payload.offset, payload.length); |
861,025 | final ExportEBSVolumeRecommendationsResult executeExportEBSVolumeRecommendations(ExportEBSVolumeRecommendationsRequest exportEBSVolumeRecommendationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(exportEBSVolumeRecommendationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ExportEBSVolumeRecommendationsRequest> request = null;<NEW_LINE>Response<ExportEBSVolumeRecommendationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ExportEBSVolumeRecommendationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(exportEBSVolumeRecommendationsRequest));<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, "Compute Optimizer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ExportEBSVolumeRecommendations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ExportEBSVolumeRecommendationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ExportEBSVolumeRecommendationsResultJsonUnmarshaller());<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); |
973,005 | public static void updateKeyForBlobStore(Map conf, BlobStore blobStore, CuratorFramework zkClient, String key, NimbusInfo nimbusDetails, Set<NimbusInfo> nimbusInfoList) {<NEW_LINE>try {<NEW_LINE>// Most of clojure tests currently try to access the blobs using getBlob. Since, updateKeyForBlobStore<NEW_LINE>// checks for updating the correct version of the blob as a part of nimbus ha before performing any<NEW_LINE>// operation on it, there is a neccessity to stub several test cases to ignore this method. It is a valid<NEW_LINE>// trade off to return if nimbusDetails which include the details of the current nimbus host port data are<NEW_LINE>// not initialized as a part of the test. Moreover, this applies to only local blobstore when used along with<NEW_LINE>// nimbus ha.<NEW_LINE>if (nimbusDetails == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean isListContainsCurrentNimbusInfo = false;<NEW_LINE>List<String> stateInfo;<NEW_LINE>if (zkClient.checkExists().forPath(BLOBSTORE_SUBTREE + "/" + key) == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>stateInfo = zkClient.getChildren().forPath(BLOBSTORE_SUBTREE + "/" + key);<NEW_LINE><MASK><NEW_LINE>if (nimbusInfoList == null) {<NEW_LINE>nimbusInfoList = getNimbodesWithLatestSequenceNumberOfBlob(zkClient, key);<NEW_LINE>}<NEW_LINE>for (NimbusInfo nimbusInfo : nimbusInfoList) {<NEW_LINE>if (nimbusInfo.getHostPort().equals(nimbusDetails.getHostPort())) {<NEW_LINE>isListContainsCurrentNimbusInfo = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isListContainsCurrentNimbusInfo && downloadUpdatedBlob(conf, blobStore, key, nimbusInfoList)) {<NEW_LINE>LOG.debug("Updating state inside zookeeper for an update");<NEW_LINE>createStateInZookeeper(conf, key, nimbusDetails);<NEW_LINE>}<NEW_LINE>} catch (Exception exp) {<NEW_LINE>throw new RuntimeException(exp);<NEW_LINE>}<NEW_LINE>} | LOG.debug("StateInfo for update {}", stateInfo); |
374,295 | public void processEmbeddings(Mapper fontMapper) {<NEW_LINE>Fonts fonts = (org.docx4j.wml.Fonts) this.getJaxbElement();<NEW_LINE>if (fonts == null) {<NEW_LINE>log.warn("No content in font table part");<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>filenamePrefix = "" + System.currentTimeMillis();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>for (Fonts.Font font : fonts.getFont()) {<NEW_LINE>String fontName = font.getName();<NEW_LINE>FontRel embedRegular = font.getEmbedRegular();<NEW_LINE>FontRel embedBold = font.getEmbedBold();<NEW_LINE>FontRel embedBoldItalic = font.getEmbedBoldItalic();<NEW_LINE>FontRel embedItalic = font.getEmbedItalic();<NEW_LINE>PhysicalFont pfRegular = getFontFromRelationship(fontName, fontName, embedRegular);<NEW_LINE>PhysicalFont pfBold = getFontFromRelationship(fontName, fontName + "-bold", embedBold);<NEW_LINE>PhysicalFont pfItalic = getFontFromRelationship(fontName, fontName + "-italic", embedItalic);<NEW_LINE>PhysicalFont pfBoldItalic = getFontFromRelationship(fontName, fontName + "-bold-italic", embedBoldItalic);<NEW_LINE>if (fontMapper != null) {<NEW_LINE>// && pfRegular != null) {<NEW_LINE>fontMapper.registerRegularForm(fontName, pfRegular);<NEW_LINE>fontMapper.registerBoldForm(fontName, pfBold);<NEW_LINE>fontMapper.registerItalicForm(fontName, pfItalic);<NEW_LINE>fontMapper.registerBoldItalicForm(fontName, pfBoldItalic);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | log.info("Writing temp embedded fonts " + filenamePrefix); |
1,059,289 | public static DescribeSystemEventCountResponse unmarshall(DescribeSystemEventCountResponse describeSystemEventCountResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSystemEventCountResponse.setRequestId<MASK><NEW_LINE>describeSystemEventCountResponse.setCode(_ctx.stringValue("DescribeSystemEventCountResponse.Code"));<NEW_LINE>describeSystemEventCountResponse.setMessage(_ctx.stringValue("DescribeSystemEventCountResponse.Message"));<NEW_LINE>describeSystemEventCountResponse.setSuccess(_ctx.stringValue("DescribeSystemEventCountResponse.Success"));<NEW_LINE>List<SystemEventCount> systemEventCounts = new ArrayList<SystemEventCount>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSystemEventCountResponse.SystemEventCounts.Length"); i++) {<NEW_LINE>SystemEventCount systemEventCount = new SystemEventCount();<NEW_LINE>systemEventCount.setStatus(_ctx.stringValue("DescribeSystemEventCountResponse.SystemEventCounts[" + i + "].Status"));<NEW_LINE>systemEventCount.setTime(_ctx.longValue("DescribeSystemEventCountResponse.SystemEventCounts[" + i + "].Time"));<NEW_LINE>systemEventCount.setGroupId(_ctx.stringValue("DescribeSystemEventCountResponse.SystemEventCounts[" + i + "].GroupId"));<NEW_LINE>systemEventCount.setProduct(_ctx.stringValue("DescribeSystemEventCountResponse.SystemEventCounts[" + i + "].Product"));<NEW_LINE>systemEventCount.setInstanceName(_ctx.stringValue("DescribeSystemEventCountResponse.SystemEventCounts[" + i + "].InstanceName"));<NEW_LINE>systemEventCount.setNum(_ctx.longValue("DescribeSystemEventCountResponse.SystemEventCounts[" + i + "].Num"));<NEW_LINE>systemEventCount.setResourceId(_ctx.stringValue("DescribeSystemEventCountResponse.SystemEventCounts[" + i + "].ResourceId"));<NEW_LINE>systemEventCount.setName(_ctx.stringValue("DescribeSystemEventCountResponse.SystemEventCounts[" + i + "].Name"));<NEW_LINE>systemEventCount.setContent(_ctx.stringValue("DescribeSystemEventCountResponse.SystemEventCounts[" + i + "].Content"));<NEW_LINE>systemEventCount.setLevel(_ctx.stringValue("DescribeSystemEventCountResponse.SystemEventCounts[" + i + "].Level"));<NEW_LINE>systemEventCount.setRegionId(_ctx.stringValue("DescribeSystemEventCountResponse.SystemEventCounts[" + i + "].RegionId"));<NEW_LINE>systemEventCounts.add(systemEventCount);<NEW_LINE>}<NEW_LINE>describeSystemEventCountResponse.setSystemEventCounts(systemEventCounts);<NEW_LINE>return describeSystemEventCountResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeSystemEventCountResponse.RequestId")); |
45,109 | ActionResult<Wo> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>if (BooleanUtils.isNotTrue(Config.nodes().centerServers().first().getValue().getConfigApiEnable())) {<NEW_LINE>throw new ExceptionModifyConfig();<NEW_LINE>}<NEW_LINE>String name = wi.getName();<NEW_LINE>String mobile = wi.getMobile();<NEW_LINE>String codeAnswer = wi.getCodeAnswer();<NEW_LINE>String newName = wi.getNewName();<NEW_LINE>if (BooleanUtils.isNotTrue(this.connect())) {<NEW_LINE>throw new ExceptionUnableConnect();<NEW_LINE>}<NEW_LINE>if (BooleanUtils.isNotTrue(this.exist(name))) {<NEW_LINE>throw new ExceptionNameNotExist(name);<NEW_LINE>}<NEW_LINE>if (!Config.person().isMobile(mobile)) {<NEW_LINE>throw new ExceptionInvalidMobile(mobile);<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(codeAnswer)) {<NEW_LINE>throw new CodeAnswerEmptyException();<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(newName)) {<NEW_LINE>throw new ExceptionNameEmpty();<NEW_LINE>}<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setValue(this.update(name, newName, mobile, codeAnswer, wi.getKey(), wi.getSecret()));<NEW_LINE>if (BooleanUtils.isTrue(wo.getValue()) && name.equals(Config.collect().getName())) {<NEW_LINE>Config.collect().setEnable(true);<NEW_LINE>Config.<MASK><NEW_LINE>Config.collect().setKey(wi.getKey());<NEW_LINE>Config.collect().setSecret(wi.getSecret());<NEW_LINE>Config.collect().save();<NEW_LINE>this.configFlush(effectivePerson);<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>} | collect().setName(newName); |
820,284 | public double aggregate(final double current, final BaseObjectColumnValueSelector[] selectorList) {<NEW_LINE>Context cx = Context.getCurrentContext();<NEW_LINE>if (cx == null) {<NEW_LINE>cx = contextFactory.enterContext();<NEW_LINE>// Disable primitive wrapping- we want Java strings and primitives to behave like JS entities.<NEW_LINE>cx.getWrapFactory().setJavaPrimitiveWrap(false);<NEW_LINE>}<NEW_LINE>final int size = selectorList.length;<NEW_LINE>final Object[] args = new Object[size + 1];<NEW_LINE>args[0] = current;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>final BaseObjectColumnValueSelector selector = selectorList[i];<NEW_LINE>if (selector != null) {<NEW_LINE>final Object arg = selector.getObject();<NEW_LINE>if (arg != null && arg.getClass().isArray()) {<NEW_LINE>// Context.javaToJS on an array sort of works, although it returns false for Array.isArray(...) and<NEW_LINE>// may have other issues too. Let's just copy the array and wrap that.<NEW_LINE>args[i + 1] = cx.newArray<MASK><NEW_LINE>} else if (arg instanceof List) {<NEW_LINE>// Using toArray(Object[]), instead of just toArray(), because Arrays.asList()'s impl and similar List<NEW_LINE>// impls could clone the underlying array in toArray(), that could be not Object[], but e. g. String[].<NEW_LINE>args[i + 1] = cx.newArray(scope, ((List) arg).toArray(ObjectArrays.EMPTY_ARRAY));<NEW_LINE>} else {<NEW_LINE>args[i + 1] = Context.javaToJS(arg, scope);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Object res = fnAggregate.call(cx, scope, scope, args);<NEW_LINE>return Context.toNumber(res);<NEW_LINE>} | (scope, arrayToObjectArray(arg)); |
1,760,663 | public ListNode reverseEvenLengthGroups(ListNode head) {<NEW_LINE>List<Integer> list = new ArrayList<>();<NEW_LINE>ListNode tmp = head;<NEW_LINE>while (tmp != null) {<NEW_LINE>list.add(tmp.val);<NEW_LINE>tmp = tmp.next;<NEW_LINE>}<NEW_LINE>int len = 1;<NEW_LINE>int start = 0;<NEW_LINE>List<Integer> reversed = new ArrayList<>();<NEW_LINE>while (start + len <= list.size()) {<NEW_LINE>if (len % 2 == 0) {<NEW_LINE>List<Integer> sub = list.<MASK><NEW_LINE>Collections.reverse(sub);<NEW_LINE>reversed.addAll(sub);<NEW_LINE>} else {<NEW_LINE>reversed.addAll(list.subList(start, start + len));<NEW_LINE>}<NEW_LINE>start += len;<NEW_LINE>len++;<NEW_LINE>}<NEW_LINE>if (start < list.size()) {<NEW_LINE>List<Integer> sublist = list.subList(start, list.size());<NEW_LINE>if (sublist.size() % 2 == 0) {<NEW_LINE>Collections.reverse(sublist);<NEW_LINE>}<NEW_LINE>reversed.addAll(sublist);<NEW_LINE>}<NEW_LINE>ListNode pre = new ListNode(-1);<NEW_LINE>head = new ListNode(reversed.get(0));<NEW_LINE>pre.next = head;<NEW_LINE>for (int i = 1; i < reversed.size(); i++) {<NEW_LINE>head.next = new ListNode(reversed.get(i));<NEW_LINE>head = head.next;<NEW_LINE>}<NEW_LINE>return pre.next;<NEW_LINE>} | subList(start, start + len); |
1,362,024 | private void extractFilterFromFile(final File xsltFile) {<NEW_LINE>try (BufferedReader xsl = new BufferedReader(new FileReader(xsltFile))) {<NEW_LINE>String line;<NEW_LINE>int l = 0;<NEW_LINE>boolean keyFound = false;<NEW_LINE>// ...we open it and check if it contains the right marker<NEW_LINE>while ((line = xsl.readLine()) != null && l < MAX_READ_LINES) {<NEW_LINE>final Matcher m = COMPILED_EXPORT_FILTER_PATTERN.matcher(line);<NEW_LINE>if (m.matches()) {<NEW_LINE>// if it does<NEW_LINE>keyFound = true;<NEW_LINE>final String[] extensions = m.group(1).split("\\s*;\\s*");<NEW_LINE>String description = m.group(2).trim();<NEW_LINE>if (description.startsWith("%")) {<NEW_LINE>description = TextUtils.getText(description.substring(1));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// we want to allow for more than one filter line per XSLT file<NEW_LINE>// so we don't exit once we've found one and even account for<NEW_LINE>// the fact that we might trespass the MAX_READ_LINES limit<NEW_LINE>l--;<NEW_LINE>}<NEW_LINE>l++;<NEW_LINE>}<NEW_LINE>if (keyFound) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Matcher m = COMPILED_FILE_NAME_PATTERN.matcher(xsltFile.getName());<NEW_LINE>if (m.matches()) {<NEW_LINE>// if it does<NEW_LINE>final String extension = m.group(1);<NEW_LINE>final String description = TextUtils.format("exported_file", extension);<NEW_LINE>addXsltFile(new String[] { extension }, description, xsltFile);<NEW_LINE>}<NEW_LINE>} catch (final IOException e) {<NEW_LINE>LogUtils.warn(e);<NEW_LINE>UITools.errorMessage(TextUtils.getText("export_failed"));<NEW_LINE>}<NEW_LINE>} | addXsltFile(extensions, description, xsltFile); |
888,769 | public void initBindings() {<NEW_LINE>addFunction("getrlimit", liburl(), newTuple(BaseNum, BaseNum));<NEW_LINE>addFunction("getrlimit", liburl(), unknown());<NEW_LINE>String[] constants = { "RLIMIT_CORE", "RLIMIT_CPU", "RLIMIT_FSIZE", "RLIMIT_DATA", "RLIMIT_STACK", "RLIMIT_RSS", "RLIMIT_NPROC", "RLIMIT_NOFILE", "RLIMIT_OFILE", "RLIMIT_MEMLOCK", "RLIMIT_VMEM", "RLIMIT_AS" };<NEW_LINE>for (String c : constants) {<NEW_LINE>addAttr(c<MASK><NEW_LINE>}<NEW_LINE>NClassType ru = newClass("struct_rusage", table, Object);<NEW_LINE>String[] ru_fields = { "ru_utime", "ru_stime", "ru_maxrss", "ru_ixrss", "ru_idrss", "ru_isrss", "ru_minflt", "ru_majflt", "ru_nswap", "ru_inblock", "ru_oublock", "ru_msgsnd", "ru_msgrcv", "ru_nsignals", "ru_nvcsw", "ru_nivcsw" };<NEW_LINE>for (String ruf : ru_fields) {<NEW_LINE>ru.getTable().update(ruf, liburl("resource-usage"), BaseNum, ATTRIBUTE);<NEW_LINE>}<NEW_LINE>addFunction("getrusage", liburl("resource-usage"), ru);<NEW_LINE>addFunction("getpagesize", liburl("resource-usage"), BaseNum);<NEW_LINE>for (String s : list("RUSAGE_SELF", "RUSAGE_CHILDREN", "RUSAGE_BOTH")) {<NEW_LINE>addAttr(s, liburl("resource-usage"), BaseNum);<NEW_LINE>}<NEW_LINE>} | , liburl("resource-limits"), BaseNum); |
48,059 | public void showStoppingMessage(String host) {<NEW_LINE>if (stoppingMessage != null) {<NEW_LINE>stoppingMessage.dispose();<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>stoppingMessage = new EscapeDialog(this, JMeterUtils.getResString("stopping_test_title"), true);<NEW_LINE>// $NON-NLS-1<NEW_LINE>String label = JMeterUtils.getResString("stopping_test");<NEW_LINE>if (!StringUtils.isEmpty(host)) {<NEW_LINE>label = label + JMeterUtils.getResString("stopping_test_host") + ": " + host;<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$$NON-NLS-2$<NEW_LINE><MASK><NEW_LINE>stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));<NEW_LINE>stoppingMessage.getContentPane().add(stopLabel);<NEW_LINE>stoppingMessage.pack();<NEW_LINE>ComponentUtil.centerComponentInComponent(this, stoppingMessage);<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>if (stoppingMessage != null) {<NEW_LINE>stoppingMessage.setVisible(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | JLabel stopLabel = new JLabel(label); |
386,691 | public DeregisterTransitGatewayResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeregisterTransitGatewayResult deregisterTransitGatewayResult = new DeregisterTransitGatewayResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return deregisterTransitGatewayResult;<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("TransitGatewayRegistration", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deregisterTransitGatewayResult.setTransitGatewayRegistration(TransitGatewayRegistrationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deregisterTransitGatewayResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
908,265 | public void configure(Binder binder) {<NEW_LINE>binder.bind(TypeManager.class).toInstance(typeManager);<NEW_LINE>configBinder(binder).bindConfig(FileMergeCacheConfig.class);<NEW_LINE>configBinder(binder).bindConfig(CacheConfig.class);<NEW_LINE>binder.bind(CacheStats.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(CacheFactory.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(DeltaConnector.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(DeltaConnectorId.class).toInstance(new DeltaConnectorId(connectorId));<NEW_LINE>binder.bind(DeltaMetadata.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(DeltaClient.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(DeltaSplitManager.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(DeltaPageSourceProvider.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(DeltaSessionProperties.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(DeltaPlanOptimizerProvider.class).in(Scopes.SINGLETON);<NEW_LINE>configBinder(binder).bindConfig(DeltaConfig.class);<NEW_LINE>configBinder(binder).bindConfig(MetastoreConfig.class);<NEW_LINE>configBinder(binder).bindConfig(HiveClientConfig.class);<NEW_LINE>configBinder(binder).bindConfig(MetastoreClientConfig.class);<NEW_LINE>binder.bind(ExtendedHiveMetastore.class).to(CachingHiveMetastore.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(HdfsConfiguration.class).annotatedWith(ForMetastoreHdfsEnvironment.class).to(HiveCachingHdfsConfiguration.class).in(Scopes.SINGLETON);<NEW_LINE>configBinder(binder).bindConfig(HiveGcsConfig.class);<NEW_LINE>binder.bind(GcsConfigurationInitializer.class).to(HiveGcsConfigurationInitializer.class<MASK><NEW_LINE>binder.bind(HdfsConfigurationInitializer.class).in(Scopes.SINGLETON);<NEW_LINE>newSetBinder(binder, DynamicConfigurationProvider.class);<NEW_LINE>binder.bind(HdfsEnvironment.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(HdfsConfiguration.class).annotatedWith(ForCachingFileSystem.class).to(HiveHdfsConfiguration.class).in(Scopes.SINGLETON);<NEW_LINE>binder.bind(PartitionMutator.class).to(HivePartitionMutator.class).in(Scopes.SINGLETON);<NEW_LINE>jsonBinder(binder).addDeserializerBinding(Type.class).to(TypeDeserializer.class);<NEW_LINE>jsonCodecBinder(binder).bindMapJsonCodec(String.class, listJsonCodec(DeltaTable.class));<NEW_LINE>binder.bind(FileFormatDataSourceStats.class).in(Scopes.SINGLETON);<NEW_LINE>newExporter(binder).export(FileFormatDataSourceStats.class).as(generatedNameOf(FileFormatDataSourceStats.class, connectorId));<NEW_LINE>} | ).in(Scopes.SINGLETON); |
1,641,292 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>autoCompletionSmartQuotesDelimitersLabel = new javax.swing.JLabel();<NEW_LINE>autoCompletionSmartDelimitersCheckBox = <MASK><NEW_LINE>autoCompletionSmartQuotesCheckBox = new javax.swing.JCheckBox();<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(autoCompletionSmartQuotesDelimitersLabel, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.autoCompletionSmartQuotesDelimitersLabel.text"));<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(autoCompletionSmartDelimitersCheckBox, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.autoCompletionSmartDelimitersCheckBox.text"));<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(autoCompletionSmartQuotesCheckBox, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.autoCompletionSmartQuotesCheckBox.text"));<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().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(autoCompletionSmartQuotesDelimitersLabel).addComponent(autoCompletionSmartDelimitersCheckBox).addComponent(autoCompletionSmartQuotesCheckBox)).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(autoCompletionSmartQuotesDelimitersLabel).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(autoCompletionSmartQuotesCheckBox).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(autoCompletionSmartDelimitersCheckBox).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));<NEW_LINE>} | new javax.swing.JCheckBox(); |
340,403 | public void intercept(IMethodInvocation invocation) throws Throwable {<NEW_LINE>AtomicReference<StackTraceElement[]> featureStackTrace = new AtomicReference<>();<NEW_LINE>AtomicBoolean success = new AtomicBoolean(false);<NEW_LINE><MASK><NEW_LINE>AtomicBoolean unexpectedFailure = new AtomicBoolean(false);<NEW_LINE>invocation.getFeature().getFeatureMethod().addInterceptor(new InnerIterationInterceptor(featureStackTrace, success, expectedFailure, unexpectedFailure, expectedExceptions, reason, annotationUsed));<NEW_LINE>invocation.proceed();<NEW_LINE>// unexpected failure happened => do nothing, iteration is red<NEW_LINE>if (!unexpectedFailure.get()) {<NEW_LINE>if (expectedFailure.get()) {<NEW_LINE>// no unexpected failure, at least one expected failure and feature is rolled up => abort, feature is pending<NEW_LINE>if (!invocation.getFeature().isReportIterations()) {<NEW_LINE>throw testAborted(featureStackTrace.get());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// no unexpected failure, no expected failure and at least one success,<NEW_LINE>// that is not all iterations are aborted => fail, annotation should be removed<NEW_LINE>if (success.get()) {<NEW_LINE>throw featurePassedUnexpectedly(featureStackTrace.get());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | AtomicBoolean expectedFailure = new AtomicBoolean(false); |
568,180 | public void run() throws Exception {<NEW_LINE>if (currentAddress == null) {<NEW_LINE>println("No Location.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MemoryBlock memoryBlock = currentProgram.getMemory().getBlock(currentAddress);<NEW_LINE>if (!memoryBlock.isInitialized()) {<NEW_LINE>println("Script cannot run in uninitialized memory.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Listing listing = currentProgram.getListing();<NEW_LINE>Address currentAddr = currentAddress;<NEW_LINE>boolean isInitializedBlock = memoryBlock.isInitialized();<NEW_LINE>if (isInitializedBlock) {<NEW_LINE>currentAddr = memoryBlock.getEnd();<NEW_LINE>println("end of byte addr is " + currentAddr);<NEW_LINE>byte repeatingByte = currentProgram.getMemory().getByte(currentAddr);<NEW_LINE>MemoryBlock currentMemoryBlock = null;<NEW_LINE>// search for next repeatedByte from the end of memory<NEW_LINE>// until it hits defined area or different byte<NEW_LINE>byte prevByte = repeatingByte;<NEW_LINE>int repeatLen = 0;<NEW_LINE>boolean noCollisions = listing.isUndefined(currentAddr, currentAddr);<NEW_LINE>boolean hasLabels = currentProgram.getSymbolTable().hasSymbol(currentAddr);<NEW_LINE>println("no collisions at end = " + noCollisions);<NEW_LINE>currentMemoryBlock = currentProgram.getMemory().getBlock(currentAddr);<NEW_LINE>while ((prevByte == repeatingByte) && (noCollisions) && (currentMemoryBlock.equals(memoryBlock)) && (!hasLabels)) {<NEW_LINE>repeatLen++;<NEW_LINE>currentAddr = currentAddr.addNoWrap(-1);<NEW_LINE>prevByte = currentProgram.getMemory().getByte(currentAddr);<NEW_LINE>noCollisions = <MASK><NEW_LINE>hasLabels = currentProgram.getSymbolTable().hasSymbol(currentAddr);<NEW_LINE>currentMemoryBlock = currentProgram.getMemory().getBlock(currentAddr);<NEW_LINE>}<NEW_LINE>if (repeatLen > 0) {<NEW_LINE>// this takes care of the last one tested that failed<NEW_LINE>currentAddr = currentAddr.addNoWrap(1);<NEW_LINE>listing.createData(currentAddr, new AlignmentDataType(), repeatLen);<NEW_LINE>println("Applied Alignment datatype at " + currentAddr.toString());<NEW_LINE>} else {<NEW_LINE>println("No repeating bytes OR data already defined at end of " + memoryBlock);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>println("Cannot condense uninitialized memory.");<NEW_LINE>}<NEW_LINE>} | listing.isUndefined(currentAddr, currentAddr); |
744,890 | public IntVector lexQuickSort(BufferAllocator allocator, VectorSchemaRoot input, List<SortPlan.SortColumn> physicalSortExprs) {<NEW_LINE>VectorValueComparator[] comparators = physicalSortExprs.stream().map(p -> buildCompare(p)).toArray(size -> new VectorValueComparator[size]);<NEW_LINE>CompositeVectorComparator compositeVectorComparator = new CompositeVectorComparator(comparators);<NEW_LINE>int valueCount = physicalSortExprs.get(<MASK><NEW_LINE>IntVector valueVectors = new IntVector("", allocator);<NEW_LINE>valueVectors.setInitialCapacity(valueCount);<NEW_LINE>valueVectors.allocateNew(valueCount);<NEW_LINE>valueVectors.setValueCount(valueCount);<NEW_LINE>for (int index = 0; index < valueCount; index++) {<NEW_LINE>valueVectors.set(index, index);<NEW_LINE>}<NEW_LINE>FixedWidthInPlaceVectorSorter fixedWidthInPlaceVectorSorter = new FixedWidthInPlaceVectorSorter();<NEW_LINE>fixedWidthInPlaceVectorSorter.sortInPlace(valueVectors, compositeVectorComparator);<NEW_LINE>return valueVectors;<NEW_LINE>} | 0).values.getValueCount(); |
1,741,775 | public void initiate(@RequestParam(value = "sp", required = false) String sp, HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>if (!hasText(sp)) {<NEW_LINE>throw new ProviderNotFoundException("Missing sp request parameter. sp parameter must be a valid and configured entity ID");<NEW_LINE>}<NEW_LINE>log.debug("IDP is initiating authentication request to SP[{}]", UaaStringUtils.getCleanedUserControlString(sp));<NEW_LINE>Optional<SamlServiceProviderHolder> holder = configurator.getSamlServiceProviders().stream().filter(serviceProvider -> sp.equals(serviceProvider.getSamlServiceProvider().getEntityId())).findFirst();<NEW_LINE>if (holder.isEmpty()) {<NEW_LINE>log.debug("SP[{}] was not found, aborting saml response", UaaStringUtils.getCleanedUserControlString(sp));<NEW_LINE>throw new ProviderNotFoundException("Invalid sp entity ID. sp parameter must be a valid and configured entity ID");<NEW_LINE>}<NEW_LINE>if (!holder.get().getSamlServiceProvider().isActive()) {<NEW_LINE>log.debug("SP[{}] is disabled, aborting saml response", UaaStringUtils.getCleanedUserControlString(sp));<NEW_LINE>throw new ProviderNotFoundException("Service provider is disabled.");<NEW_LINE>}<NEW_LINE>if (!holder.get().getSamlServiceProvider().getConfig().isEnableIdpInitiatedSso()) {<NEW_LINE>log.debug("SP[{}] initiated login is disabled, aborting saml response", UaaStringUtils.getCleanedUserControlString(sp));<NEW_LINE>throw new ProviderNotFoundException("IDP initiated login is disabled for this service provider.");<NEW_LINE>}<NEW_LINE>String nameId = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";<NEW_LINE>try {<NEW_LINE>String assertionLocation = getAssertionConsumerURL(sp);<NEW_LINE>log.debug("IDP is sending assertion for SP[{}] to {}", UaaStringUtils.getCleanedUserControlString(sp), UaaStringUtils.getCleanedUserControlString(assertionLocation));<NEW_LINE>AuthnRequest authnRequest = idpWebSsoProfile.buildIdpInitiatedAuthnRequest(nameId, sp, assertionLocation);<NEW_LINE>SAMLMessageContext samlContext = getSamlContext(<MASK><NEW_LINE>idpWebSsoProfile.sendResponse(SecurityContextHolder.getContext().getAuthentication(), samlContext, getIdpIniatedOptions());<NEW_LINE>log.debug("IDP initiated authentication and responded to SP[{}]", UaaStringUtils.getCleanedUserControlString(sp));<NEW_LINE>} catch (MetadataProviderException | SAMLException | SecurityException | MessageEncodingException | MarshallingException | SignatureException e) {<NEW_LINE>log.debug("IDP is unable to process assertion for SP[{}]", UaaStringUtils.getCleanedUserControlString(sp), e);<NEW_LINE>throw new ProviderNotFoundException("Unable to process SAML assertion. Response not sent.");<NEW_LINE>}<NEW_LINE>} | sp, authnRequest, request, response); |
1,744,863 | public static void sendFileTo(final Activity a, final File file) {<NEW_LINE>if (!isValidFile(file)) {<NEW_LINE>Toast.makeText(a, R.string.file_not_found, Toast.LENGTH_LONG).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Intent intent = new Intent(Intent.ACTION_SEND);<NEW_LINE>intent.putExtra(Intent.EXTRA_EMAIL, new String[] { "" });<NEW_LINE>intent.setType(getMimeType(file));<NEW_LINE>intent.putExtra(Intent.EXTRA_STREAM, getUriProvider(a, file));<NEW_LINE>intent.putExtra(Intent.EXTRA_SUBJECT, "");<NEW_LINE>intent.putExtra(Intent.EXTRA_TEXT, "");<NEW_LINE><MASK><NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>a.startActivity(Intent.createChooser(intent, a.getString(R.string.send_file_to)));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.e(e);<NEW_LINE>Toast.makeText(a, "" + e.getMessage(), Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>} | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
723,916 | public JobExecution updateJobExecutionAndInstanceOnStopBeforeServerAssigned(long jobExecutionId, Date lastUpdatedTime) throws NoSuchJobExecutionException, ExecutionAssignedToServerException {<NEW_LINE>JobExecutionEntity exec = getJobExecution(jobExecutionId);<NEW_LINE>if (exec.getServerId().equals("")) {<NEW_LINE>try {<NEW_LINE>verifyStatusTransitionIsValid(exec, BatchStatus.STOPPED);<NEW_LINE>} catch (BatchIllegalJobStatusTransitionException e) {<NEW_LINE>throw new PersistenceException(e);<NEW_LINE>}<NEW_LINE>exec.setBatchStatus(BatchStatus.STOPPED);<NEW_LINE>exec.getJobInstance(<MASK><NEW_LINE>exec.getJobInstance().setBatchStatus(BatchStatus.STOPPED);<NEW_LINE>exec.getJobInstance().setLastUpdatedTime(lastUpdatedTime);<NEW_LINE>exec.setLastUpdatedTime(lastUpdatedTime);<NEW_LINE>} else {<NEW_LINE>String msg = "Job execution " + jobExecutionId + " is in an invalid state";<NEW_LINE>throw new ExecutionAssignedToServerException(msg);<NEW_LINE>}<NEW_LINE>return exec;<NEW_LINE>} | ).setInstanceState(InstanceState.STOPPED); |
1,336,108 | private String prepareUrl(String url, LocationConfig locationConfig) {<NEW_LINE>ProviderConfig providerConfig = config.getProviderConfig(getProviderName());<NEW_LINE>if (providerConfig != null) {<NEW_LINE>url = StringUtils.replace(url, "[API_KEY]", providerConfig.getApiKey());<NEW_LINE>url = StringUtils.replace(url, <MASK><NEW_LINE>}<NEW_LINE>if (locationConfig.getLatitude() != null) {<NEW_LINE>url = StringUtils.replace(url, "[LATITUDE]", locationConfig.getLatitude().toString());<NEW_LINE>}<NEW_LINE>if (locationConfig.getLongitude() != null) {<NEW_LINE>url = StringUtils.replace(url, "[LONGITUDE]", locationConfig.getLongitude().toString());<NEW_LINE>}<NEW_LINE>if (locationConfig.getMeasurementUnits() != null) {<NEW_LINE>url = StringUtils.replace(url, "[UNITS]", locationConfig.getMeasurementUnits());<NEW_LINE>}<NEW_LINE>url = StringUtils.replace(url, "[LANGUAGE]", locationConfig.getLanguage());<NEW_LINE>return url;<NEW_LINE>} | "[API_KEY_2]", providerConfig.getApiKey2()); |
1,714,904 | public String extract(final HttpRequest request) throws HttpException {<NEW_LINE>String auth = null;<NEW_LINE>Header h = request.getFirstHeader(AUTH.WWW_AUTH_RESP);<NEW_LINE>if (h != null) {<NEW_LINE>String s = h.getValue();<NEW_LINE>if (s != null) {<NEW_LINE>auth = s.trim();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (auth != null) {<NEW_LINE>int i = auth.indexOf(' ');<NEW_LINE>if (i == -1) {<NEW_LINE>throw new ProtocolException("Invalid Authorization header: " + auth);<NEW_LINE>}<NEW_LINE>String authscheme = auth.substring(0, i);<NEW_LINE>if (authscheme.equalsIgnoreCase("basic")) {<NEW_LINE>String s = auth.substring(<MASK><NEW_LINE>try {<NEW_LINE>byte[] credsRaw = EncodingUtils.getAsciiBytes(s);<NEW_LINE>BinaryDecoder codec = new Base64();<NEW_LINE>auth = EncodingUtils.getAsciiString(codec.decode(credsRaw));<NEW_LINE>} catch (DecoderException ex) {<NEW_LINE>throw new ProtocolException("Malformed BASIC credentials");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return auth;<NEW_LINE>} | i + 1).trim(); |
81,685 | public SuggestionValue unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SuggestionValue suggestionValue = new SuggestionValue();<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("Text", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>suggestionValue.setText(SuggestionTextWithHighlightsJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return suggestionValue;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
644,871 | protected void debug() {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.<MASK><NEW_LINE>Tr.debug(tc, KEY_clientId + " = " + clientId);<NEW_LINE>Tr.debug(tc, KEY_clientSecret + " is null = " + (clientSecret == null));<NEW_LINE>Tr.debug(tc, KEY_displayName + " = " + displayName);<NEW_LINE>Tr.debug(tc, KEY_website + " = " + website);<NEW_LINE>Tr.debug(tc, KEY_authorizationEndpoint + " = " + authorizationEndpoint);<NEW_LINE>Tr.debug(tc, KEY_tokenEndpoint + " = " + tokenEndpoint);<NEW_LINE>Tr.debug(tc, KEY_jwksUri + " = " + jwksUri);<NEW_LINE>Tr.debug(tc, KEY_responseType + " = " + responseType);<NEW_LINE>Tr.debug(tc, KEY_tokenEndpointAuthMethod + " = " + tokenEndpointAuthMethod);<NEW_LINE>Tr.debug(tc, KEY_sslRef + " = " + sslRef);<NEW_LINE>Tr.debug(tc, KEY_scope + " = " + scope);<NEW_LINE>Tr.debug(tc, KEY_authFilterRef + " = " + authFilterRef);<NEW_LINE>Tr.debug(tc, KEY_redirectToRPHostAndPort + " = " + redirectToRPHostAndPort);<NEW_LINE>Tr.debug(tc, KEY_userNameAttribute + " = " + userNameAttribute);<NEW_LINE>Tr.debug(tc, KEY_INTROSPECTION_TOKEN_TYPE_HINT + " = " + introspectionTokenTypeHint);<NEW_LINE>Tr.debug(tc, KEY_userApi + " = " + userApi);<NEW_LINE>Tr.debug(tc, "userApiConfigs = " + (userApiConfigs == null ? "null" : userApiConfigs.length));<NEW_LINE>Tr.debug(tc, KEY_realmName + " = " + realmName);<NEW_LINE>Tr.debug(tc, KEY_realmNameAttribute + " = " + realmNameAttribute);<NEW_LINE>Tr.debug(tc, KEY_accessTokenHeaderName + " = " + accessTokenHeaderName);<NEW_LINE>Tr.debug(tc, KEY_groupNameAttribute + " = " + groupNameAttribute);<NEW_LINE>Tr.debug(tc, KEY_userUniqueIdAttribute + " = " + userUniqueIdAttribute);<NEW_LINE>Tr.debug(tc, KEY_mapToUserRegistry + " = " + mapToUserRegistry);<NEW_LINE>Tr.debug(tc, CFG_KEY_jwtRef + " = " + jwtRef);<NEW_LINE>Tr.debug(tc, CFG_KEY_jwtClaims + " = " + ((jwtClaims == null) ? null : Arrays.toString(jwtClaims)));<NEW_LINE>Tr.debug(tc, KEY_isClientSideRedirectSupported + " = " + isClientSideRedirectSupported);<NEW_LINE>Tr.debug(tc, KEY_nonce + " = " + nonce);<NEW_LINE>Tr.debug(tc, KEY_userApiNeedsSpecialHeader + " = " + userApiNeedsSpecialHeader);<NEW_LINE>}<NEW_LINE>} | debug(tc, "" + this); |
1,043,014 | public void internalOpen(final String iUserName, final String iUserPassword, boolean checkPassword) {<NEW_LINE>try {<NEW_LINE>OSecurityInternal security = sharedContext.getSecurity();<NEW_LINE>if (user == null || user.getVersion() != security.getVersion(this) || !user.getName().equalsIgnoreCase(iUserName)) {<NEW_LINE>final OSecurityUser usr;<NEW_LINE>if (checkPassword) {<NEW_LINE>usr = security.securityAuthenticate(this, iUserName, iUserPassword);<NEW_LINE>} else {<NEW_LINE>usr = security.getUser(this, iUserName);<NEW_LINE>}<NEW_LINE>if (usr != null)<NEW_LINE>user = new OImmutableUser(security.getVersion(this), usr);<NEW_LINE>else<NEW_LINE>user = null;<NEW_LINE>checkSecurity(ORule.ResourceGeneric.DATABASE, ORole.PERMISSION_READ);<NEW_LINE>}<NEW_LINE>} catch (OException e) {<NEW_LINE>ODatabaseRecordThreadLocal.instance().remove();<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>ODatabaseRecordThreadLocal.instance().remove();<NEW_LINE>throw OException.wrapException(new ODatabaseException("Cannot open database url=" <MASK><NEW_LINE>}<NEW_LINE>} | + getURL()), e); |
1,741,894 | public static void main(String[] args) {<NEW_LINE>try {<NEW_LINE>COConfigurationManager.initialise();<NEW_LINE>COConfigurationManager.setParameter("IPV6 Enable Support", true);<NEW_LINE>boolean v6 = true;<NEW_LINE>// Test connectivity.<NEW_LINE>if (true) {<NEW_LINE>// System.out.println( "UDP: " + getSingleton().getExternalIpAddressUDP(null,0,v6));<NEW_LINE>// System.out.println( "TCP: " + getSingleton().getExternalIpAddressTCP(null,0,v6));<NEW_LINE>System.out.println("HTTP: " + getSingleton<MASK><NEW_LINE>}<NEW_LINE>Map data = constructVersionCheckMessage(VersionCheckClient.REASON_UPDATE_CHECK_START);<NEW_LINE>System.out.println("Sending (pre-initialisation):");<NEW_LINE>printDataMap(data);<NEW_LINE>System.out.println("-----------");<NEW_LINE>System.out.println("Receiving (pre-initialisation):");<NEW_LINE>printDataMap(getSingleton().getVersionCheckInfo(VersionCheckClient.REASON_UPDATE_CHECK_START));<NEW_LINE>System.out.println("-----------");<NEW_LINE>System.out.println();<NEW_LINE>System.out.print("Initialising core... ");<NEW_LINE>DownloadManagerStateImpl.SUPPRESS_FIXUP_ERRORS = true;<NEW_LINE>Core core = CoreFactory.create();<NEW_LINE>core.start();<NEW_LINE>System.out.println("done.");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("-----------");<NEW_LINE>data = constructVersionCheckMessage(VersionCheckClient.REASON_UPDATE_CHECK_START);<NEW_LINE>System.out.println("Sending (post-initialisation):");<NEW_LINE>printDataMap(data);<NEW_LINE>System.out.println("-----------");<NEW_LINE>System.out.println("Receiving (post-initialisation):");<NEW_LINE>printDataMap(getSingleton().getVersionCheckInfo(VersionCheckClient.REASON_UPDATE_CHECK_START));<NEW_LINE>System.out.println("-----------");<NEW_LINE>System.out.println();<NEW_LINE>System.out.print("Shutting down core... ");<NEW_LINE>core.stop();<NEW_LINE>System.out.println("done.");<NEW_LINE>} catch (Throwable e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | ().getExternalIpAddressHTTP(v6)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.