idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,569,289 | public String primaryNetworkInterfaceId() {<NEW_LINE>final List<NetworkInterfaceReference> nicRefs = this.innerModel().networkProfile().networkInterfaces();<NEW_LINE>String primaryNicRefId = null;<NEW_LINE>if (nicRefs.size() == 1) {<NEW_LINE>// One NIC so assume it to be primary<NEW_LINE>primaryNicRefId = nicRefs.<MASK><NEW_LINE>} else if (nicRefs.size() == 0) {<NEW_LINE>// No NICs so null<NEW_LINE>primaryNicRefId = null;<NEW_LINE>} else {<NEW_LINE>// Find primary interface as flagged by Azure<NEW_LINE>for (NetworkInterfaceReference nicRef : innerModel().networkProfile().networkInterfaces()) {<NEW_LINE>if (nicRef.primary() != null && nicRef.primary()) {<NEW_LINE>primaryNicRefId = nicRef.id();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If Azure didn't flag any NIC as primary then assume the first one<NEW_LINE>if (primaryNicRefId == null) {<NEW_LINE>primaryNicRefId = nicRefs.get(0).id();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return primaryNicRefId;<NEW_LINE>} | get(0).id(); |
1,248,792 | public static JSONObject createFromNativeWindowsSource(JSONObject from) throws JSONException {<NEW_LINE>JSONObject node = new JSONObject();<NEW_LINE>node.put<MASK><NEW_LINE>node.put("id", getNodeTitle(from));<NEW_LINE>// add an id to the node to make them selectable by :reference<NEW_LINE>JSONObject attr = new JSONObject();<NEW_LINE>attr.put("id", from.getString("ref"));<NEW_LINE>node.put("attr", attr);<NEW_LINE>JSONObject metadata = new JSONObject();<NEW_LINE>metadata.put("type", from.getString("type"));<NEW_LINE>metadata.put("reference", from.getString("ref"));<NEW_LINE>metadata.put("id", from.getString("id"));<NEW_LINE>metadata.put("name", from.getString("name"));<NEW_LINE>metadata.put("value", from.opt("value"));<NEW_LINE>metadata.put("l10n", from.getJSONObject("l10n"));<NEW_LINE>metadata.put("shown", from.getBoolean("shown"));<NEW_LINE>metadata.put("source", from.optString("source"));<NEW_LINE>metadata.put("error", from.optString("error"));<NEW_LINE>node.put("metadata", metadata);<NEW_LINE>JSONObject rect = new JSONObject();<NEW_LINE>rect.put("x", from.getJSONObject("rect").getJSONObject("origin").getInt("x"));<NEW_LINE>rect.put("y", from.getJSONObject("rect").getJSONObject("origin").getInt("y"));<NEW_LINE>rect.put("h", from.getJSONObject("rect").getJSONObject("size").getInt("height"));<NEW_LINE>rect.put("w", from.getJSONObject("rect").getJSONObject("size").getInt("width"));<NEW_LINE>metadata.put("rect", rect);<NEW_LINE>JSONArray children = from.optJSONArray("children");<NEW_LINE>if (children != null && children.length() != 0) {<NEW_LINE>JSONArray jstreeChildren = new JSONArray();<NEW_LINE>node.put("children", jstreeChildren);<NEW_LINE>for (int i = 0; i < children.length(); i++) {<NEW_LINE>Object child = null;<NEW_LINE>try {<NEW_LINE>child = children.get(i);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>if (child != null) {<NEW_LINE>JSONObject jstreenode = createFromNativeWindowsSource((JSONObject) child);<NEW_LINE>jstreeChildren.put(jstreenode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return node;<NEW_LINE>} | ("data", getNodeTitle(from)); |
1,305,712 | public <T> FutureList<T> findFutureList(Query<T> query, Transaction transaction) {<NEW_LINE>SpiQuery<T> spiQuery = (SpiQuery<T>) query.copy();<NEW_LINE>spiQuery.setFutureFetch(true);<NEW_LINE>// FutureList query always run in it's own persistence content<NEW_LINE>spiQuery.setPersistenceContext(new DefaultPersistenceContext());<NEW_LINE>if (!spiQuery.isDisableReadAudit()) {<NEW_LINE>BeanDescriptor<T> desc = descriptorManager.descriptor(spiQuery.getBeanType());<NEW_LINE>desc.readAuditFutureList(spiQuery);<NEW_LINE>}<NEW_LINE>// Create a new transaction solely to execute the findList() at some future time<NEW_LINE>Transaction newTxn = createTransaction();<NEW_LINE>QueryFutureList<T> queryFuture = new QueryFutureList<>(new CallableQueryList<><MASK><NEW_LINE>backgroundExecutor.execute(queryFuture.getFutureTask());<NEW_LINE>return queryFuture;<NEW_LINE>} | (this, spiQuery, newTxn)); |
281,745 | public void preRemove(RealmModel realm) {<NEW_LINE>int num = em.createNamedQuery("deleteFederatedUserConsentClientScopesByRealm").setParameter("realmId", realm.getId()).executeUpdate();<NEW_LINE>num = em.createNamedQuery("deleteFederatedUserConsentsByRealm").setParameter("realmId", realm.getId()).executeUpdate();<NEW_LINE>num = em.createNamedQuery("deleteFederatedUserRoleMappingsByRealm").setParameter("realmId", realm.getId()).executeUpdate();<NEW_LINE>num = em.createNamedQuery("deleteFederatedUserRequiredActionsByRealm").setParameter("realmId", realm.<MASK><NEW_LINE>num = em.createNamedQuery("deleteBrokerLinkByRealm").setParameter("realmId", realm.getId()).executeUpdate();<NEW_LINE>num = em.createNamedQuery("deleteFederatedUserCredentialsByRealm").setParameter("realmId", realm.getId()).executeUpdate();<NEW_LINE>num = em.createNamedQuery("deleteUserFederatedAttributesByRealm").setParameter("realmId", realm.getId()).executeUpdate();<NEW_LINE>num = em.createNamedQuery("deleteFederatedUserGroupMembershipByRealm").setParameter("realmId", realm.getId()).executeUpdate();<NEW_LINE>num = em.createNamedQuery("deleteFederatedUsersByRealm").setParameter("realmId", realm.getId()).executeUpdate();<NEW_LINE>} | getId()).executeUpdate(); |
169,867 | private static final Options prepareOptions() {<NEW_LINE>Options options = new Options();<NEW_LINE>options.addOption(new Option("h", "help", false, "Print a help message and exit."));<NEW_LINE>options.addOption(new Option("c", "configDir", true, "Path for Configs Directory.\n" + "Expected Directory Structure under Configs Directory:\n" + "./models/security.hjson(optional)\n" + "./models/variables.hjson(optional)\n" + "./models/tables/(optional)\n" + "./models/tables/table1.hjson\n" + "./models/tables/table2.hjson\n" + "./models/tables/tableN.hjson\n" + "./db/variables.hjson(optional)\n" + "./db/sql/(optional)\n" <MASK><NEW_LINE>return options;<NEW_LINE>} | + "./db/sql/db1.hjson\n" + "./db/sql/db2.hjson\n" + "./db/sql/dbN.hjson\n")); |
1,812,162 | protected void cleanupCompensation() {<NEW_LINE>// The compensation is at the end here. Simply stop the execution.<NEW_LINE>commandContext.getHistoryManager().recordActivityEnd(execution, null);<NEW_LINE>commandContext.getExecutionEntityManager().deleteExecutionAndRelatedData(execution, null);<NEW_LINE>ExecutionEntity parentExecutionEntity = execution.getParent();<NEW_LINE>if (parentExecutionEntity.isScope() && !parentExecutionEntity.isProcessInstanceType()) {<NEW_LINE>if (allChildExecutionsEnded(parentExecutionEntity, null)) {<NEW_LINE>// Go up the hierarchy to check if the next scope is ended too.<NEW_LINE>// This could happen if only the compensation activity is still active, but the<NEW_LINE>// main process is already finished.<NEW_LINE>ExecutionEntity executionEntityToEnd = parentExecutionEntity;<NEW_LINE>ExecutionEntity scopeExecutionEntity = findNextParentScopeExecutionWithAllEndedChildExecutions(parentExecutionEntity, parentExecutionEntity);<NEW_LINE>while (scopeExecutionEntity != null) {<NEW_LINE>executionEntityToEnd = scopeExecutionEntity;<NEW_LINE>scopeExecutionEntity = findNextParentScopeExecutionWithAllEndedChildExecutions(scopeExecutionEntity, parentExecutionEntity);<NEW_LINE>}<NEW_LINE>if (executionEntityToEnd.isProcessInstanceType()) {<NEW_LINE>Context.getAgenda().planEndExecutionOperation(executionEntityToEnd);<NEW_LINE>} else {<NEW_LINE>Context.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getAgenda().planDestroyScopeOperation(executionEntityToEnd); |
152,770 | private TypeVariableBinding[] createTypeVariables(SignatureWrapper wrapper, boolean assignVariables, char[][][] missingTypeNames, ITypeAnnotationWalker walker, boolean isClassTypeParameter) {<NEW_LINE>if (!isPrototype())<NEW_LINE>throw new IllegalStateException();<NEW_LINE>// detect all type variables first<NEW_LINE><MASK><NEW_LINE>int depth = 0, length = typeSignature.length;<NEW_LINE>int rank = 0;<NEW_LINE>ArrayList variables = new ArrayList(1);<NEW_LINE>depth = 0;<NEW_LINE>boolean pendingVariable = true;<NEW_LINE>createVariables: {<NEW_LINE>for (int i = 1; i < length; i++) {<NEW_LINE>switch(typeSignature[i]) {<NEW_LINE>case Util.C_GENERIC_START:<NEW_LINE>depth++;<NEW_LINE>break;<NEW_LINE>case Util.C_GENERIC_END:<NEW_LINE>if (--depth < 0)<NEW_LINE>break createVariables;<NEW_LINE>break;<NEW_LINE>case Util.C_NAME_END:<NEW_LINE>if ((depth == 0) && (i + 1 < length) && (typeSignature[i + 1] != Util.C_COLON))<NEW_LINE>pendingVariable = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (pendingVariable) {<NEW_LINE>pendingVariable = false;<NEW_LINE>int colon = CharOperation.indexOf(Util.C_COLON, typeSignature, i);<NEW_LINE>char[] variableName = CharOperation.subarray(typeSignature, i, colon);<NEW_LINE>TypeVariableBinding typeVariable = new TypeVariableBinding(variableName, this, rank, this.environment);<NEW_LINE>AnnotationBinding[] annotations = BinaryTypeBinding.createAnnotations(walker.toTypeParameter(isClassTypeParameter, rank++).getAnnotationsAtCursor(0, false), this.environment, missingTypeNames);<NEW_LINE>if (annotations != null && annotations != Binding.NO_ANNOTATIONS)<NEW_LINE>typeVariable.setTypeAnnotations(annotations, this.environment.globalOptions.isAnnotationBasedNullAnalysisEnabled);<NEW_LINE>variables.add(typeVariable);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// initialize type variable bounds - may refer to forward variables<NEW_LINE>TypeVariableBinding[] result;<NEW_LINE>variables.toArray(result = new TypeVariableBinding[rank]);<NEW_LINE>// when creating the type variables for a type, the type must remember them before initializing each variable<NEW_LINE>// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=163680<NEW_LINE>if (assignVariables)<NEW_LINE>this.typeVariables = result;<NEW_LINE>for (int i = 0; i < rank; i++) {<NEW_LINE>initializeTypeVariable(result[i], result, wrapper, missingTypeNames, walker.toTypeParameterBounds(isClassTypeParameter, i));<NEW_LINE>if (this.externalAnnotationStatus.isPotentiallyUnannotatedLib() && result[i].hasNullTypeAnnotations())<NEW_LINE>this.externalAnnotationStatus = ExternalAnnotationStatus.TYPE_IS_ANNOTATED;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | char[] typeSignature = wrapper.signature; |
1,446,674 | public MockConfigResponse genMockConfig(MockConfigRequest request) {<NEW_LINE>MockConfigResponse returnRsp;<NEW_LINE>MockConfigExample example = new MockConfigExample();<NEW_LINE>MockConfigExample.Criteria criteria = example.createCriteria();<NEW_LINE>if (request.getId() != null) {<NEW_LINE>criteria.andIdEqualTo(request.getId());<NEW_LINE>}<NEW_LINE>if (request.getApiId() != null) {<NEW_LINE>criteria.andApiIdEqualTo(request.getApiId());<NEW_LINE>}<NEW_LINE>if (request.getProjectId() != null) {<NEW_LINE>criteria.andProjectIdEqualTo(request.getProjectId());<NEW_LINE>}<NEW_LINE>List<MockConfig> configList = mockConfigMapper.selectByExample(example);<NEW_LINE>if (configList.isEmpty()) {<NEW_LINE>long createTimeStmp = System.currentTimeMillis();<NEW_LINE>MockConfig config = new MockConfig();<NEW_LINE>config.setProjectId(request.getProjectId());<NEW_LINE>config.setId(UUID.randomUUID().toString());<NEW_LINE>config.setCreateUserId(SessionUtils.getUserId());<NEW_LINE>config.setCreateTime(createTimeStmp);<NEW_LINE>config.setUpdateTime(createTimeStmp);<NEW_LINE>if (request.getApiId() != null) {<NEW_LINE>config.setApiId(request.getApiId());<NEW_LINE>mockConfigMapper.insert(config);<NEW_LINE>}<NEW_LINE>returnRsp = new MockConfigResponse(config, new ArrayList<>());<NEW_LINE>} else {<NEW_LINE>MockConfig config = configList.get(0);<NEW_LINE>MockExpectConfigExample expectConfigExample = new MockExpectConfigExample();<NEW_LINE>expectConfigExample.createCriteria().<MASK><NEW_LINE>expectConfigExample.setOrderByClause("update_time DESC");<NEW_LINE>List<MockExpectConfigResponse> expectConfigResponseList = new ArrayList<>();<NEW_LINE>List<MockExpectConfigWithBLOBs> expectConfigList = mockExpectConfigMapper.selectByExampleWithBLOBs(expectConfigExample);<NEW_LINE>for (MockExpectConfigWithBLOBs expectConfig : expectConfigList) {<NEW_LINE>MockExpectConfigResponse response = new MockExpectConfigResponse(expectConfig);<NEW_LINE>expectConfigResponseList.add(response);<NEW_LINE>}<NEW_LINE>returnRsp = new MockConfigResponse(config, expectConfigResponseList);<NEW_LINE>}<NEW_LINE>return returnRsp;<NEW_LINE>} | andMockConfigIdEqualTo(config.getId()); |
613,912 | public Map<String, Object> toMap() {<NEW_LINE>HashMap<String, Object> map = new HashMap<>();<NEW_LINE>map.put("appName", appName);<NEW_LINE>map.put("appVersion", appVersion);<NEW_LINE>map.put("cacheDir", cacheDir);<NEW_LINE>map.put("deviceHeight", deviceHeight);<NEW_LINE>map.put("deviceModel", deviceModel);<NEW_LINE>map.put("deviceWidth", deviceWidth);<NEW_LINE>map.put("layoutDirection", layoutDirection);<NEW_LINE>map.put("libJssPath", libJssPath);<NEW_LINE>map.put("logLevel", logLevel);<NEW_LINE>map.put("needInitV8", needInitV8);<NEW_LINE>map.put("osVersion", osVersion);<NEW_LINE>map.put("platform", platform);<NEW_LINE>map.put("useSingleProcess", useSingleProcess);<NEW_LINE>map.put("shouldInfoCollect", shouldInfoCollect);<NEW_LINE>map.put("weexVersion", weexVersion);<NEW_LINE>map.put("crashFilePath", crashFilePath);<NEW_LINE>map.put("libJscPath", libJscPath);<NEW_LINE><MASK><NEW_LINE>map.put("libLdPath", libLdPath);<NEW_LINE>map.put("options", options);<NEW_LINE>map.put("useRunTimeApi", WXEnvironment.sUseRunTimeApi);<NEW_LINE>map.put("__enable_native_promise__", !WXEnvironment.sUseRunTimeApi);<NEW_LINE>return map;<NEW_LINE>} | map.put("libIcuPath", libIcuPath); |
860,745 | private static void filteringSimpleProbableThreats() {<NEW_LINE>LOGGER.info("### Filtering ProbabilisticThreatAwareSystem by probability ###");<NEW_LINE>var trojanArcBomb = new SimpleProbableThreat("Trojan-ArcBomb", 1, ThreatType.TROJAN, 0.99);<NEW_LINE>var rootkit = new SimpleProbableThreat("Rootkit-Kernel", 2, ThreatType.ROOTKIT, 0.8);<NEW_LINE>List<ProbableThreat> probableThreats = <MASK><NEW_LINE>var probabilisticThreatAwareSystem = new SimpleProbabilisticThreatAwareSystem("Sys-1", probableThreats);<NEW_LINE>LOGGER.info("Filtering ProbabilisticThreatAwareSystem. Initial : " + probabilisticThreatAwareSystem);<NEW_LINE>// Filtering using filterer<NEW_LINE>var filteredThreatAwareSystem = probabilisticThreatAwareSystem.filtered().by(probableThreat -> Double.compare(probableThreat.probability(), 0.99) == 0);<NEW_LINE>LOGGER.info("Filtered by probability = 0.99 : " + filteredThreatAwareSystem);<NEW_LINE>} | List.of(trojanArcBomb, rootkit); |
210,285 | public void receiveFileInfo(List<String> phase1FileNames, List<Long> phase1FileSizes, List<String> phase1ExistingFileNames, List<Long> phase1ExistingFileSizes, int totalTranslogOps, ActionListener<Void> listener) {<NEW_LINE>final String action = PeerRecoveryTargetService.Actions.FILES_INFO;<NEW_LINE>final long requestSeqNo = requestSeqNoGenerator.getAndIncrement();<NEW_LINE>RecoveryFilesInfoRequest request = new RecoveryFilesInfoRequest(recoveryId, requestSeqNo, shardId, phase1FileNames, phase1FileSizes, phase1ExistingFileNames, phase1ExistingFileSizes, totalTranslogOps);<NEW_LINE>final TransportRequestOptions options = TransportRequestOptions.builder().withTimeout(recoverySettings.internalActionTimeout()).build();<NEW_LINE>final Writeable.Reader<TransportResponse.Empty> reader <MASK><NEW_LINE>final ActionListener<TransportResponse.Empty> responseListener = ActionListener.map(listener, r -> null);<NEW_LINE>executeRetryableAction(action, request, options, responseListener, reader);<NEW_LINE>} | = in -> TransportResponse.Empty.INSTANCE; |
709,207 | public static void gradientInner(GrayS32 ii, double tl_x, double tl_y, double samplePeriod, int regionSize, double kernelSize, int[] derivX, int[] derivY) {<NEW_LINE>// add 0.5 to c_x and c_y to have it round when converted to an integer pixel<NEW_LINE>// this is faster than the straight forward method<NEW_LINE>tl_x += 0.5;<NEW_LINE>tl_y += 0.5;<NEW_LINE>// round the kernel size<NEW_LINE>int w = (int) (kernelSize + 0.5);<NEW_LINE>int r = w / 2;<NEW_LINE>if (r <= 0)<NEW_LINE>r = 1;<NEW_LINE>w = r * 2 + 1;<NEW_LINE>int i = 0;<NEW_LINE>for (int y = 0; y < regionSize; y++) {<NEW_LINE>int pixelsY = (int) (tl_y + y * samplePeriod);<NEW_LINE>int indexRow1 = ii.startIndex + (pixelsY - r - 1) * ii.stride - r - 1;<NEW_LINE>int indexRow2 = indexRow1 + r * ii.stride;<NEW_LINE>int indexRow3 = indexRow2 + ii.stride;<NEW_LINE>int indexRow4 = indexRow3 + r * ii.stride;<NEW_LINE>for (int x = 0; x < regionSize; x++, i++) {<NEW_LINE>int pixelsX = (int) (tl_x + x * samplePeriod);<NEW_LINE>final int indexSrc1 = indexRow1 + pixelsX;<NEW_LINE>final int indexSrc2 = indexRow2 + pixelsX;<NEW_LINE>final int indexSrc3 = indexRow3 + pixelsX;<NEW_LINE>final int indexSrc4 = indexRow4 + pixelsX;<NEW_LINE>final int p0 = ii.data[indexSrc1];<NEW_LINE>final int p1 = ii.data[indexSrc1 + r];<NEW_LINE>final int p2 = ii.data[indexSrc1 + r + 1];<NEW_LINE>final int p3 = ii.data[indexSrc1 + w];<NEW_LINE>final int p11 = ii.data[indexSrc2];<NEW_LINE>final int p4 = ii.data[indexSrc2 + w];<NEW_LINE>final int p10 = ii.data[indexSrc3];<NEW_LINE>final int p5 = ii.data[indexSrc3 + w];<NEW_LINE>final int p9 = ii.data[indexSrc4];<NEW_LINE>final int p8 = ii.data[indexSrc4 + r];<NEW_LINE>final int p7 = ii.data[indexSrc4 + r + 1];<NEW_LINE>final int p6 = ii.data[indexSrc4 + w];<NEW_LINE>final int left = p8 - p9 - p1 + p0;<NEW_LINE>final int right = p6 - p7 - p3 + p2;<NEW_LINE>final int top = p4 - p11 - p3 + p0;<NEW_LINE>final int bottom = p6 - p9 - p5 + p10;<NEW_LINE><MASK><NEW_LINE>derivY[i] = bottom - top;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | derivX[i] = right - left; |
1,397,412 | final ModifyLunaClientResult executeModifyLunaClient(ModifyLunaClientRequest modifyLunaClientRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyLunaClientRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyLunaClientRequest> request = null;<NEW_LINE>Response<ModifyLunaClientResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyLunaClientRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(modifyLunaClientRequest));<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, "CloudHSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyLunaClient");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ModifyLunaClientResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ModifyLunaClientResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
963,583 | private Supplier<Pair<Integer, JsonNode>> handleAddOp(String path, JsonNode patchValue, PatchRequestScope requestScope, PatchAction action) {<NEW_LINE>try {<NEW_LINE>JsonApiDocument value = requestScope.getMapper().readJsonApiPatchExtValue(patchValue);<NEW_LINE>Data<Resource> data = value.getData();<NEW_LINE>if (data == null || data.get() == null) {<NEW_LINE>throw new InvalidEntityBodyException("Expected an entity body but received none.");<NEW_LINE>}<NEW_LINE>Collection<Resource> resources = data.get();<NEW_LINE>if (!path.contains("relationships")) {<NEW_LINE>// Reserved key for relationships<NEW_LINE>String id = <MASK><NEW_LINE>if (StringUtils.isEmpty(id)) {<NEW_LINE>throw new InvalidEntityBodyException("Patch extension requires all objects to have an assigned " + "ID (temporary or permanent) when assigning relationships.");<NEW_LINE>}<NEW_LINE>String fullPath = path + "/" + id;<NEW_LINE>// Defer relationship updating until the end<NEW_LINE>getSingleResource(resources).setRelationships(null);<NEW_LINE>// Reparse since we mangle it first<NEW_LINE>action.doc = requestScope.getMapper().readJsonApiPatchExtValue(patchValue);<NEW_LINE>action.path = fullPath;<NEW_LINE>action.isPostProcessing = true;<NEW_LINE>}<NEW_LINE>PostVisitor visitor = new PostVisitor(new PatchRequestScope(path, value, requestScope));<NEW_LINE>return visitor.visit(JsonApiParser.parse(path));<NEW_LINE>} catch (HttpStatusException e) {<NEW_LINE>action.cause = e;<NEW_LINE>throw e;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new InvalidEntityBodyException("Could not parse patch extension value: " + patchValue);<NEW_LINE>}<NEW_LINE>} | getSingleResource(resources).getId(); |
91,563 | private List<com.intellij.formatting.Block> buildNoParenthesesKeywordPairChildren(@NotNull ASTNode noParenthesesKeywordPair) {<NEW_LINE>Wrap keywordKeyWrap = Wrap.createWrap(WrapType.CHOP_DOWN_IF_LONG, true);<NEW_LINE>Indent keywordKeyIndent = Indent.getIndent(Indent.Type.NONE, true, false);<NEW_LINE>Wrap keywordPairColonWrap = Wrap.createChildWrap(keywordKeyWrap, WrapType.NONE, true);<NEW_LINE>Wrap keywordValueWrap = Wrap.createChildWrap(keywordKeyWrap, WrapType.NONE, true);<NEW_LINE>return buildChildren(noParenthesesKeywordPair, (child, childElementType, blockList) -> {<NEW_LINE>if (childElementType == ACCESS_EXPRESSION) {<NEW_LINE>blockList.addAll(buildContainerValueAccessExpressionChildren(child, keywordValueWrap));<NEW_LINE>} else if (childElementType == KEYWORD_KEY) {<NEW_LINE>blockList.add(buildChild<MASK><NEW_LINE>} else if (childElementType == KEYWORD_PAIR_COLON) {<NEW_LINE>blockList.add(buildChild(child, keywordPairColonWrap));<NEW_LINE>} else {<NEW_LINE>blockList.add(buildChild(child, keywordValueWrap));<NEW_LINE>}<NEW_LINE>return blockList;<NEW_LINE>});<NEW_LINE>} | (child, keywordKeyWrap, keywordKeyIndent)); |
983,136 | private static void createNonAutoMenuItems(Menu menu, Tag tag, TagType tag_type, Menu[] menuShowHide) {<NEW_LINE>if (tag_type.hasTagTypeFeature(TagFeature.TF_PROPERTIES)) {<NEW_LINE>TagFeatureProperties props = (TagFeatureProperties) tag;<NEW_LINE>boolean has_ut = props.getProperty(TagFeatureProperties.PR_UNTAGGED) != null;<NEW_LINE>if (has_ut) {<NEW_LINE>has_ut = false;<NEW_LINE>for (Tag t : tag_type.getTags()) {<NEW_LINE>props = (TagFeatureProperties) t;<NEW_LINE>TagProperty prop = props.getProperty(TagFeatureProperties.PR_UNTAGGED);<NEW_LINE>if (prop != null) {<NEW_LINE>Boolean b = prop.getBoolean();<NEW_LINE>if (b != null && b) {<NEW_LINE>has_ut = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!has_ut) {<NEW_LINE>if (menuShowHide[0] == null) {<NEW_LINE>menuShowHide[0] = new Menu(menu.getShell(), SWT.DROP_DOWN);<NEW_LINE>MenuItem showhideitem = new MenuItem(menu, SWT.CASCADE);<NEW_LINE>showhideitem.setText(MessageText.getString("label.showhide.tag"));<NEW_LINE>showhideitem.setMenu(menuShowHide[0]);<NEW_LINE>} else {<NEW_LINE>new MenuItem(menuShowHide[0], SWT.SEPARATOR);<NEW_LINE>}<NEW_LINE>MenuItem showAll = new MenuItem(menuShowHide[0], SWT.PUSH);<NEW_LINE>Messages.setLanguageText(showAll, "label.untagged");<NEW_LINE>showAll.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>try {<NEW_LINE>String tag_name = MessageText.getString("label.untagged");<NEW_LINE>Tag ut_tag = tag_type.getTag(tag_name, true);<NEW_LINE>if (ut_tag == null) {<NEW_LINE>ut_tag = tag_type.createTag(tag_name, true);<NEW_LINE>}<NEW_LINE>TagFeatureProperties tp = (TagFeatureProperties) ut_tag;<NEW_LINE>tp.getProperty(TagFeatureProperties<MASK><NEW_LINE>} catch (TagException e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Tag> tags = new ArrayList<>();<NEW_LINE>tags.add(tag);<NEW_LINE>createTagGroupMenu(menu, tag_type, tags);<NEW_LINE>MenuItem itemDelete = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Utils.setMenuItemImage(itemDelete, "delete");<NEW_LINE>Messages.setLanguageText(itemDelete, "FileItem.delete");<NEW_LINE>itemDelete.addListener(SWT.Selection, event -> removeTags(tag));<NEW_LINE>} | .PR_UNTAGGED).setBoolean(true); |
1,640,526 | static void addStructureConfiguration(BiConsumer<StructureFeature<?>, StructureFeatureConfiguration> consumer) {<NEW_LINE>if (Config.COMMON.earthslimeIslands.doesGenerate()) {<NEW_LINE>consumer.accept(earthSlimeIsland.get(), Config.COMMON.earthslimeIslands.makeConfiguration());<NEW_LINE>} else {<NEW_LINE>consumer.accept(earthSlimeIsland.get(), null);<NEW_LINE>}<NEW_LINE>// sky<NEW_LINE>if (Config.COMMON.skyslimeIslands.doesGenerate()) {<NEW_LINE>consumer.accept(skySlimeIsland.get(), Config.COMMON.skyslimeIslands.makeConfiguration());<NEW_LINE>} else {<NEW_LINE>consumer.accept(skySlimeIsland.get(), null);<NEW_LINE>}<NEW_LINE>// clay<NEW_LINE>if (Config.COMMON.clayIslands.doesGenerate()) {<NEW_LINE>consumer.accept(clayIsland.get(), Config.COMMON.clayIslands.makeConfiguration());<NEW_LINE>} else {<NEW_LINE>consumer.accept(clayIsland.get(), null);<NEW_LINE>}<NEW_LINE>// nether //<NEW_LINE>if (Config.COMMON.bloodIslands.doesGenerate()) {<NEW_LINE>consumer.accept(bloodIsland.get(), Config.COMMON.bloodIslands.makeConfiguration());<NEW_LINE>} else {<NEW_LINE>consumer.accept(<MASK><NEW_LINE>}<NEW_LINE>// end //<NEW_LINE>if (Config.COMMON.endslimeIslands.doesGenerate()) {<NEW_LINE>consumer.accept(endSlimeIsland.get(), Config.COMMON.endslimeIslands.makeConfiguration());<NEW_LINE>} else {<NEW_LINE>consumer.accept(endSlimeIsland.get(), null);<NEW_LINE>}<NEW_LINE>} | bloodIsland.get(), null); |
1,550,057 | public <// readTimeout millisecond<NEW_LINE>T> ResponseEntity<T> exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, String requestId, long connectTimeout, long readTimeout) throws RestClientException {<NEW_LINE>assert connectTimeout >= 0;<NEW_LINE>assert readTimeout >= 0;<NEW_LINE>assert requestId != null;<NEW_LINE><MASK><NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>return this.exchange(url, method, requestEntity, responseType);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>long endTime = System.currentTimeMillis();<NEW_LINE>logger.warn(String.format("TimeoutRestTemplate exchange fail, requestId=%s, connectTimeout=%s, readTimeout=%s, spendTime=%s", requestId, connectTimeout, readTimeout, endTime - startTime), t);<NEW_LINE>throw t;<NEW_LINE>} finally {<NEW_LINE>long endTime = System.currentTimeMillis();<NEW_LINE>if (endTime - startTime > (connectTimeout + 3000) || endTime - startTime > (readTimeout + 3000)) {<NEW_LINE>logger.error(String.format("TimeoutRestTemplate timeout error, requestId=%s, connectTimeout=%s, readTimeout=%s, spendTime=%s", requestId, connectTimeout, readTimeout, endTime - startTime));<NEW_LINE>} else {<NEW_LINE>logger.debug(String.format("TimeoutRestTemplate exchange method:%s, url: %s", method, url));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | this.setRequestConfig(connectTimeout, readTimeout); |
1,619,505 | public void filter(ContainerRequestContext reqCtx, ContainerResponseContext resCtx) throws IOException {<NEW_LINE>if (!Constants.MEDIA_TYPE_JSON.equals(reqCtx.getHeaderString("Accept"))) {<NEW_LINE>// Don't wrap if using legacy mode<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if ((status >= 200) && (status <= 299)) {<NEW_LINE>// don't wrap success messages<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object entity = resCtx.getEntity();<NEW_LINE>if (!(entity instanceof String)) {<NEW_LINE>// don't wrap null and non-String entities<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Normally the cliend sends in an X-Skip-Resource-Links header<NEW_LINE>// to say that resource links should not be returned, and the resource<NEW_LINE>// looks for that header in the request and, if present, tells<NEW_LINE>// the ResponseBody constructor to ignore resource links.<NEW_LINE>// Since we never return links from this filter, instead of looking<NEW_LINE>// for the header, we can just always tell the ResponseBody to ignore links.<NEW_LINE>ResponseBody rb = new ResponseBody(false);<NEW_LINE>String errorMsg = (String) entity;<NEW_LINE>rb.addFailure(errorMsg);<NEW_LINE>resCtx.setEntity(rb, resCtx.getEntityAnnotations(), Constants.MEDIA_TYPE_JSON_TYPE);<NEW_LINE>} | int status = resCtx.getStatus(); |
784,969 | // @see com.biglybt.ui.swt.debug.ObfuscateImage#obfuscatedImage(org.eclipse.swt.graphics.Image)<NEW_LINE>@Override<NEW_LINE>public Image obfuscatedImage(Image image) {<NEW_LINE>Rectangle bounds = swt_getBounds();<NEW_LINE>if (bounds != null) {<NEW_LINE>TreeItem treeItem = getTreeItem();<NEW_LINE>Point location = Utils.getLocationRelativeToShell(treeItem.getParent());<NEW_LINE>bounds.x += location.x;<NEW_LINE>bounds.y += location.y;<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>map.put("image", image);<NEW_LINE>map.put("obfuscateTitle", false);<NEW_LINE>triggerEvent(UISWTViewEvent.TYPE_OBFUSCATE, map);<NEW_LINE>if (viewTitleInfo instanceof ObfuscateImage) {<NEW_LINE>((ObfuscateImage) viewTitleInfo).obfuscatedImage(image);<NEW_LINE>}<NEW_LINE>int ofs = IMAGELEFT_GAP + IMAGELEFT_SIZE;<NEW_LINE>if (treeItem.getParentItem() != null) {<NEW_LINE>ofs += 10 + SIDEBAR_SPACING;<NEW_LINE>}<NEW_LINE>bounds.x += ofs;<NEW_LINE>bounds.width -= ofs + SIDEBAR_SPACING + 1;<NEW_LINE>bounds.height -= 1;<NEW_LINE>if (viewTitleInfo instanceof ObfuscateTab) {<NEW_LINE>String header = ((ObfuscateTab) viewTitleInfo).getObfuscatedHeader();<NEW_LINE>if (header != null) {<NEW_LINE>UIDebugGenerator.obfuscateArea(image, bounds, header);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (MapUtils.getMapBoolean(map, "obfuscateTitle", false)) {<NEW_LINE>UIDebugGenerator.obfuscateArea(image, bounds);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return image;<NEW_LINE>} | map = new HashMap<>(); |
1,457,683 | public Object evaluate(EditorAdaptor vim, Queue<String> command) {<NEW_LINE>try {<NEW_LINE>StringBuilder args = new StringBuilder();<NEW_LINE>if (command.size() > 0) {<NEW_LINE>args.append(command.poll());<NEW_LINE>}<NEW_LINE>while (command.size() > 0) {<NEW_LINE>args.append(' ').<MASK><NEW_LINE>}<NEW_LINE>LineRange range;<NEW_LINE>TextRange nativeSelection = vim.getNativeSelection();<NEW_LINE>if (nativeSelection.getModelLength() > 0 && SelectionService.VRAPPER_SELECTION_ACTIVE.equals(nativeSelection)) {<NEW_LINE>range = SimpleLineRange.fromSelection(vim, vim.getSelection());<NEW_LINE>} else if (nativeSelection.getModelLength() > 0) {<NEW_LINE>// Native selection is exclusive, use the TextRange<NEW_LINE>range = SimpleLineRange.fromTextRange(vim, nativeSelection);<NEW_LINE>} else {<NEW_LINE>range = SimpleLineRange.singleLine(vim, vim.getPosition());<NEW_LINE>}<NEW_LINE>new AnonymousMacroOperation(args.toString()).execute(vim, range);<NEW_LINE>} catch (CommandExecutionException e) {<NEW_LINE>vim.getUserInterfaceService().setErrorMessage(e.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | append(command.poll()); |
1,350,473 | public static byte[] calculateMasterSecretSSL3(byte[] preMasterSecret, byte[] random) {<NEW_LINE>Digest md5 = TlsUtils.createHash(HashAlgorithm.md5);<NEW_LINE>Digest sha1 = <MASK><NEW_LINE>int md5Size = md5.getDigestSize();<NEW_LINE>byte[] shaTmp = new byte[sha1.getDigestSize()];<NEW_LINE>byte[] rval = new byte[md5Size * 3];<NEW_LINE>int pos = 0;<NEW_LINE>for (int i = 0; i < 3; ++i) {<NEW_LINE>byte[] ssl3Const = SSL3_CONST[i];<NEW_LINE>sha1.update(ssl3Const, 0, ssl3Const.length);<NEW_LINE>sha1.update(preMasterSecret, 0, preMasterSecret.length);<NEW_LINE>sha1.update(random, 0, random.length);<NEW_LINE>sha1.doFinal(shaTmp, 0);<NEW_LINE>md5.update(preMasterSecret, 0, preMasterSecret.length);<NEW_LINE>md5.update(shaTmp, 0, shaTmp.length);<NEW_LINE>md5.doFinal(rval, pos);<NEW_LINE>pos += md5Size;<NEW_LINE>}<NEW_LINE>return rval;<NEW_LINE>} | TlsUtils.createHash(HashAlgorithm.sha1); |
651,196 | private IQueryParameterType mapReferenceChainToRawParamType(String remainingChain, RuntimeSearchParam param, String theParamName, String qualifier, Class<? extends IBaseResource> nextType, String chain, boolean isMeta, String resourceId) {<NEW_LINE>IQueryParameterType chainValue;<NEW_LINE>if (remainingChain != null) {<NEW_LINE>if (param == null || param.getParamType() != RestSearchParameterTypeEnum.REFERENCE) {<NEW_LINE>ourLog.debug("Type {} parameter {} is not a reference, can not chain {}", nextType.getSimpleName(), chain, remainingChain);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>chainValue = new ReferenceParam();<NEW_LINE>chainValue.setValueAsQueryToken(myContext, theParamName, qualifier, resourceId);<NEW_LINE>((ReferenceParam<MASK><NEW_LINE>} else if (isMeta) {<NEW_LINE>IQueryParameterType type = myMatchUrlService.newInstanceType(chain);<NEW_LINE>type.setValueAsQueryToken(myContext, theParamName, qualifier, resourceId);<NEW_LINE>chainValue = type;<NEW_LINE>} else {<NEW_LINE>chainValue = toParameterType(param, qualifier, resourceId);<NEW_LINE>}<NEW_LINE>return chainValue;<NEW_LINE>} | ) chainValue).setChain(remainingChain); |
1,361,360 | static void genTypeInfoFolder(String folder, Type type) throws IOException {<NEW_LINE>final List<Class<?>> all = listSubtypeClasses(TYPE_BASES_CLASSES.get(type)).stream().filter(GeneratePyOp::shouldGenerate).sorted(Comparator.comparing(Class::getSimpleName)).<MASK><NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("# -*- coding: utf-8 -*-\n\n");<NEW_LINE>int idx = 0;<NEW_LINE>for (int i = 0; i < all.size(); i += MAX_CLASS_ONE_FILE) {<NEW_LINE>++idx;<NEW_LINE>String rawName = TYPE_FILENAME_PREFIX.get(type) + idx;<NEW_LINE>sb.append("from .").append(rawName).append(" import *\n");<NEW_LINE>String filename = Paths.get(folder, rawName + ".py").toFile().getAbsolutePath();<NEW_LINE>List<Class<?>> classes = all.subList(i, Math.min(i + MAX_CLASS_ONE_FILE, all.size()));<NEW_LINE>writeSingleFile(filename, TYPE_IMPORT_LINES.get(type), genOpsLines(classes));<NEW_LINE>}<NEW_LINE>Files.write(Paths.get(folder, "__init__.py"), sb.toString().getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);<NEW_LINE>} | collect(Collectors.toList()); |
1,826,004 | private void initialiseObjectPropertyFrameSections() {<NEW_LINE>// @formatter:off<NEW_LINE>initialiseSection(new AnnAxiom<OWLObjectProperty, OWLAnnotation>(x -> parseAnnotation(), ANNOTATIONS, (s, o, anns) -> df.getOWLAnnotationAssertionAxiom(s.getIRI(), <MASK><NEW_LINE>initialiseSection(new AnnAxiom<OWLObjectProperty, OWLObjectPropertyExpression>(x -> parseObjectPropertyExpression(false), SUB_PROPERTY_OF, (s, o, anns) -> df.getOWLSubObjectPropertyOfAxiom(s, o, anns)), objectPropertyFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLObjectProperty, OWLObjectPropertyExpression>(x -> parseObjectPropertyExpression(false), EQUIVALENT_TO, (s, o, anns) -> df.getOWLEquivalentObjectPropertiesAxiom(s, o, anns)), objectPropertyFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLObjectProperty, OWLObjectPropertyExpression>(x -> parseObjectPropertyExpression(false), DISJOINT_WITH, (s, o, anns) -> df.getOWLDisjointObjectPropertiesAxiom(s, o, anns)), objectPropertyFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLObjectProperty, OWLClassExpression>(x -> parseUnion(), DOMAIN, (s, o, anns) -> df.getOWLObjectPropertyDomainAxiom(s, o, anns)), objectPropertyFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLObjectProperty, OWLClassExpression>(x -> parseUnion(), RANGE, (s, o, anns) -> df.getOWLObjectPropertyRangeAxiom(s, o, anns)), objectPropertyFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLObjectProperty, OWLObjectPropertyExpression>(x -> parseObjectPropertyExpression(false), INVERSE_OF, (s, o, anns) -> df.getOWLInverseObjectPropertiesAxiom(s, o, anns)), objectPropertyFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLObjectProperty, OWLObjectPropertyCharacteristicAxiom>(this::parseObjectPropertyCharacteristic, CHARACTERISTICS, (s, o, anns) -> o.getAnnotatedAxiom(anns)), objectPropertyFrameSections);<NEW_LINE>initialiseSection(new AnnAxiom<OWLObjectProperty, List<OWLObjectPropertyExpression>>(x -> parseObjectPropertyChain(), SUB_PROPERTY_CHAIN, (s, o, anns) -> df.getOWLSubPropertyChainOfAxiom(o, s, anns)), objectPropertyFrameSections);<NEW_LINE>// Extensions<NEW_LINE>initialiseSection(new AnnAxiom<OWLObjectProperty, OWLObjectPropertyExpression>(x -> parseObjectPropertyExpression(false), SUPER_PROPERTY_OF, (s, o, anns) -> df.getOWLSubObjectPropertyOfAxiom(o, s, anns)), objectPropertyFrameSections);<NEW_LINE>// @formatter:on<NEW_LINE>} | o, anns)), objectPropertyFrameSections); |
870,194 | private void cleanupUnfinishedWork() {<NEW_LINE>Date before = new Date(System.currentTimeMillis() - 2 * _timeBetweenCleanups * 1000l);<NEW_LINE>List<SecurityGroupWorkVO> <MASK><NEW_LINE>if (unfinished.size() > 0) {<NEW_LINE>s_logger.info("Network Group Work cleanup found " + unfinished.size() + " unfinished work items older than " + before.toString());<NEW_LINE>ArrayList<Long> affectedVms = new ArrayList<Long>();<NEW_LINE>for (SecurityGroupWorkVO work : unfinished) {<NEW_LINE>affectedVms.add(work.getInstanceId());<NEW_LINE>work.setStep(Step.Error);<NEW_LINE>_workDao.update(work.getId(), work);<NEW_LINE>}<NEW_LINE>scheduleRulesetUpdateToHosts(affectedVms, false, null);<NEW_LINE>} else {<NEW_LINE>s_logger.debug("Network Group Work cleanup found no unfinished work items older than " + before.toString());<NEW_LINE>}<NEW_LINE>} | unfinished = _workDao.findUnfinishedWork(before); |
1,090,294 | public List<R> visit(final AnnotationMemberDeclaration n, final A arg) {<NEW_LINE>List<R> result = new ArrayList<>();<NEW_LINE>List<R> tmp;<NEW_LINE>if (n.getDefaultValue().isPresent()) {<NEW_LINE>tmp = n.getDefaultValue().get(<MASK><NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>tmp = n.getModifiers().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>tmp = n.getName().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>tmp = n.getType().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>tmp = n.getAnnotations().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>if (n.getComment().isPresent()) {<NEW_LINE>tmp = n.getComment().get().accept(this, arg);<NEW_LINE>if (tmp != null)<NEW_LINE>result.addAll(tmp);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ).accept(this, arg); |
1,231,687 | public static void main(String[] args) {<NEW_LINE>Exercise31_CuckooHashing exercise31_cuckooHashing = new Exercise31_CuckooHashing();<NEW_LINE>CuckooHashing<Integer, Integer> cuckooHashing = exercise31_cuckooHashing.new CuckooHashing<>(16);<NEW_LINE>for (int key = 1; key < 10; key++) {<NEW_LINE>int randomKey = StdRandom.uniform(Integer.MAX_VALUE);<NEW_LINE>cuckooHashing.put(randomKey, randomKey);<NEW_LINE>}<NEW_LINE>cuckooHashing.get(5);<NEW_LINE>for (Integer key : cuckooHashing.keys()) {<NEW_LINE>StdOut.print(key + " ");<NEW_LINE>}<NEW_LINE>StdOut.println();<NEW_LINE>for (int key = 1; key < 1000000; key++) {<NEW_LINE>cuckooHashing.put(key, key);<NEW_LINE>}<NEW_LINE>for (int key = 1; key < 1000000; key++) {<NEW_LINE>cuckooHashing.delete(key);<NEW_LINE>}<NEW_LINE>for (int key = 1; key < 1500000; key++) {<NEW_LINE>int randomKey = StdRandom.uniform(Integer.MAX_VALUE);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | cuckooHashing.put(randomKey, randomKey); |
1,016,093 | private static Object buildObject(ObjectDef def, ExecutionContext context) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {<NEW_LINE>Class clazz = Class.forName(def.getClassName());<NEW_LINE>Object obj = null;<NEW_LINE>if (def.hasConstructorArgs()) {<NEW_LINE>LOG.debug("Found constructor arguments in definition: " + def.getConstructorArgs().getClass().getName());<NEW_LINE>List<Object> cArgs = def.getConstructorArgs();<NEW_LINE>if (def.hasReferences()) {<NEW_LINE>cArgs = resolveReferences(cArgs, context);<NEW_LINE>}<NEW_LINE>Constructor con = findCompatibleConstructor(cArgs, clazz);<NEW_LINE>if (con != null) {<NEW_LINE>LOG.debug("Found something seemingly compatible, attempting invocation...");<NEW_LINE>obj = con.newInstance(getArgsWithListCoercian(cArgs, con.getParameterTypes()));<NEW_LINE>} else {<NEW_LINE>String msg = String.format("Couldn't find a suitable constructor for class '%s' with arguments '%s'.", <MASK><NEW_LINE>throw new IllegalArgumentException(msg);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>obj = clazz.newInstance();<NEW_LINE>}<NEW_LINE>applyProperties(def, obj, context);<NEW_LINE>invokeConfigMethods(def, obj, context);<NEW_LINE>return obj;<NEW_LINE>} | clazz.getName(), cArgs); |
1,198,767 | public void writeExternal(ObjectOutput oo) throws IOException {<NEW_LINE>oo.writeObject(new Integer(LOADER_VERSION));<NEW_LINE>SystemAction[] arr = (SystemAction[]) getProperty(PROP_ACTIONS);<NEW_LINE>if (arr == null) {<NEW_LINE>oo.writeObject(null);<NEW_LINE>} else {<NEW_LINE>// convert actions to class names<NEW_LINE>List<String> names = new LinkedList<String>();<NEW_LINE>for (int i = 0; i < arr.length; i++) {<NEW_LINE>if (arr[i] == null) {<NEW_LINE>names.add(null);<NEW_LINE>} else {<NEW_LINE>names.add(arr[i].<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>oo.writeObject(names.toArray());<NEW_LINE>}<NEW_LINE>String dn = (String) getProperty(PROP_DISPLAY_NAME);<NEW_LINE>if (dn == null)<NEW_LINE>// NOI18N<NEW_LINE>dn = "";<NEW_LINE>oo.writeUTF(dn);<NEW_LINE>} | getClass().getName()); |
1,593,522 | public static boolean implementsInterfaceOrIsSubclassOf(final ClassNode type, final ClassNode superOrInterface) {<NEW_LINE>boolean result = (type.equals(superOrInterface) || type.isDerivedFrom(superOrInterface) || type.implementsInterface(superOrInterface) || type == UNKNOWN_PARAMETER_TYPE);<NEW_LINE>if (result) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (superOrInterface instanceof WideningCategories.LowestUpperBoundClassNode) {<NEW_LINE>WideningCategories.LowestUpperBoundClassNode cn = (WideningCategories.LowestUpperBoundClassNode) superOrInterface;<NEW_LINE>result = implementsInterfaceOrIsSubclassOf(type, cn.getSuperClass());<NEW_LINE>if (result) {<NEW_LINE>for (ClassNode interfaceNode : cn.getInterfaces()) {<NEW_LINE><MASK><NEW_LINE>if (!result)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result)<NEW_LINE>return true;<NEW_LINE>} else if (superOrInterface instanceof UnionTypeClassNode) {<NEW_LINE>UnionTypeClassNode union = (UnionTypeClassNode) superOrInterface;<NEW_LINE>for (ClassNode delegate : union.getDelegates()) {<NEW_LINE>if (implementsInterfaceOrIsSubclassOf(type, delegate))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (type.isArray() && superOrInterface.isArray()) {<NEW_LINE>return implementsInterfaceOrIsSubclassOf(type.getComponentType(), superOrInterface.getComponentType());<NEW_LINE>}<NEW_LINE>if (GROOVY_OBJECT_TYPE.equals(superOrInterface) && !type.isInterface() && isBeingCompiled(type)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | result = type.implementsInterface(interfaceNode); |
1,795,490 | @NonNull<NEW_LINE>public final <@NonNull T1, @NonNull T2, @NonNull T3, @NonNull R> Observable<R> withLatestFrom(@NonNull ObservableSource<T1> source1, @NonNull ObservableSource<T2> source2, @NonNull ObservableSource<T3> source3, @NonNull Function4<? super T, ? super T1, ? super T2, ? super T3, R> combiner) {<NEW_LINE>Objects.requireNonNull(source1, "source1 is null");<NEW_LINE>Objects.requireNonNull(source2, "source2 is null");<NEW_LINE>Objects.requireNonNull(source3, "source3 is null");<NEW_LINE>Objects.requireNonNull(combiner, "combiner is null");<NEW_LINE>Function<Object[], R> f = Functions.toFunction(combiner);<NEW_LINE>return withLatestFrom(new ObservableSource[] { source1<MASK><NEW_LINE>} | , source2, source3 }, f); |
380,471 | public com.squareup.okhttp.Call userGetExecutionHistoryCall(String symbol, OffsetDateTime timestamp, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/user/executionHistory";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (symbol != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPair("symbol", symbol));<NEW_LINE>if (timestamp != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPair("timestamp", timestamp));<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/xml", "text/xml", "application/javascript", "text/javascript" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json", "application/x-www-form-urlencoded" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[<MASK><NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | ] { "apiExpires", "apiKey", "apiSignature" }; |
366,206 | public void contribute(BuildContext context, AotOptions aotOptions) {<NEW_LINE>TypeSystem typeSystem = new TypeSystem(context.getClasspath(), context.getMainClass());<NEW_LINE>typeSystem.setAotOptions(aotOptions);<NEW_LINE>SpringAnalyzer springAnalyzer = new SpringAnalyzer(typeSystem, aotOptions);<NEW_LINE>springAnalyzer.analyze();<NEW_LINE>ConfigurationCollector configurationCollector = springAnalyzer.getConfigurationCollector();<NEW_LINE>processBuildTimeClassProxyRequests(context, configurationCollector);<NEW_LINE>context.describeReflection(reflect -> reflect.merge(configurationCollector.getReflectionDescriptor()));<NEW_LINE>context.describeResources(resources -> resources.merge(configurationCollector.getResourcesDescriptors()));<NEW_LINE>context.describeProxies(proxies -> proxies.merge(configurationCollector.getProxyDescriptors()));<NEW_LINE>context.describeSerialization(serial -> serial.merge(configurationCollector.getSerializationDescriptor()));<NEW_LINE>context.describeJNIReflection(jniReflect -> jniReflect.merge(configurationCollector.getJNIReflectionDescriptor()));<NEW_LINE>context.describeInitialization(init -> init.merge(configurationCollector.getInitializationDescriptor()));<NEW_LINE>context.getOptions().forEach(configurationCollector::addOption);<NEW_LINE>String mainClass = getMainClass(context);<NEW_LINE>if (mainClass != null) {<NEW_LINE>configurationCollector.addOption("-H:Class=" + mainClass);<NEW_LINE>}<NEW_LINE>byte[] springComponentsFileContents = configurationCollector.getResources("META-INF/spring.components");<NEW_LINE>if (springComponentsFileContents != null) {<NEW_LINE>logger.debug("Storing synthesized META-INF/spring.components");<NEW_LINE>context.addResources((resourcesPath) -> {<NEW_LINE>Path metaInfFolder = resourcesPath.resolve<MASK><NEW_LINE>Files.createDirectories(metaInfFolder);<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(resourcesPath.resolve(ResourceFile.SPRING_COMPONENTS_PATH).toFile())) {<NEW_LINE>fos.write(springComponentsFileContents);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>// Create native-image.properties<NEW_LINE>context.addResources(new ResourceFile() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void writeTo(Path rootPath) throws IOException {<NEW_LINE>Path nativeConfigFolder = rootPath.resolve(ResourceFile.NATIVE_CONFIG_PATH);<NEW_LINE>Files.createDirectories(nativeConfigFolder);<NEW_LINE>Path nativeImagePropertiesFile = nativeConfigFolder.resolve("native-image.properties");<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(nativeImagePropertiesFile.toFile())) {<NEW_LINE>fos.write(configurationCollector.getNativeImagePropertiesContent().getBytes());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (Paths.get("META-INF")); |
1,032,048 | private static void typecheckCoerce(Concrete.UseDefinition def, FunctionDefinition typedDef, ErrorReporter errorReporter, Map<Definition, List<Pair<Expression, FunctionDefinition>>> fromMap, Map<Definition, List<Pair<Expression, FunctionDefinition>>> toMap) {<NEW_LINE>Definition useParent = def.getUseParent().getTypechecked();<NEW_LINE>if ((useParent instanceof DataDefinition || useParent instanceof ClassDefinition) && !def.getParameters().isEmpty()) {<NEW_LINE>DependentLink lastParam = DependentLink.Helper.getLast(typedDef.getParameters());<NEW_LINE>Expression paramType = lastParam.hasNext() ? lastParam.getTypeExpr() : null;<NEW_LINE>DefCallExpression paramDefCall = paramType == null ? null : paramType.cast(DefCallExpression.class);<NEW_LINE>Definition paramDef = paramDefCall == null ? null : paramDefCall.getDefinition();<NEW_LINE>DefCallExpression resultDefCall = typedDef.getResultType() == null ? null : typedDef.getResultType(<MASK><NEW_LINE>Definition resultDef = resultDefCall == null ? null : resultDefCall.getDefinition();<NEW_LINE>if ((resultDef == useParent) == (paramDef == useParent)) {<NEW_LINE>if (!(typedDef.getResultType() instanceof ErrorExpression || typedDef.getResultType() == null)) {<NEW_LINE>errorReporter.report(new TypecheckingError("Either the last parameter or the result type (but not both) of \\coerce must be the parent definition", def));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>typedDef.setVisibleParameter(DependentLink.Helper.size(typedDef.getParameters()) - 1);<NEW_LINE>if (resultDef == useParent) {<NEW_LINE>fromMap.computeIfAbsent(useParent, k -> new ArrayList<>()).add(new Pair<>(paramType, typedDef));<NEW_LINE>} else {<NEW_LINE>toMap.computeIfAbsent(useParent, k -> new ArrayList<>()).add(new Pair<>(typedDef.getResultType(), typedDef));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).cast(DefCallExpression.class); |
1,542,565 | public static void iteratePrev(final int startInstruction, @Nonnull final Instruction[] instructions, @Nonnull final Function<Instruction, Operation> closure) {<NEW_LINE>final IntStack stack = new IntStack(instructions.length);<NEW_LINE>final boolean[] visited = new boolean[instructions.length];<NEW_LINE>stack.push(startInstruction);<NEW_LINE>while (!stack.isEmpty()) {<NEW_LINE>ProgressManager.checkCanceled();<NEW_LINE>final int num = stack.pop();<NEW_LINE>final Instruction instr = instructions[num];<NEW_LINE>final Operation <MASK><NEW_LINE>// Just ignore previous instructions for current node and move further<NEW_LINE>if (nextOperation == Operation.CONTINUE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// STOP iteration<NEW_LINE>if (nextOperation == Operation.BREAK) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// If we are here, we should process previous nodes in natural way<NEW_LINE>assert nextOperation == Operation.NEXT;<NEW_LINE>for (Instruction pred : instr.allPred()) {<NEW_LINE>final int predNum = pred.num();<NEW_LINE>if (!visited[predNum]) {<NEW_LINE>visited[predNum] = true;<NEW_LINE>stack.push(predNum);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | nextOperation = closure.fun(instr); |
1,632,763 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE><MASK><NEW_LINE>// noinspection ConstantConditions<NEW_LINE>mRecyclerView = getView().findViewById(R.id.recycler_view);<NEW_LINE>mLayoutManager = new LinearLayoutManager(requireContext(), RecyclerView.VERTICAL, false);<NEW_LINE>// drag & drop manager<NEW_LINE>mRecyclerViewDragDropManager = new RecyclerViewDragDropManager();<NEW_LINE>mRecyclerViewDragDropManager.setDraggingItemShadowDrawable((NinePatchDrawable) ContextCompat.getDrawable(requireContext(), R.drawable.material_shadow_z3));<NEW_LINE>// !!! this method is required to use onCheckCanDrop()<NEW_LINE>mRecyclerViewDragDropManager.setCheckCanDropEnabled(true);<NEW_LINE>// adapter<NEW_LINE>final DraggableCheckCanDropExampleItemAdapter myItemAdapter = new DraggableCheckCanDropExampleItemAdapter(getDataProvider());<NEW_LINE>mAdapter = myItemAdapter;<NEW_LINE>// wrap for dragging<NEW_LINE>mWrappedAdapter = mRecyclerViewDragDropManager.createWrappedAdapter(myItemAdapter);<NEW_LINE>final GeneralItemAnimator animator = new DraggableItemAnimator();<NEW_LINE>mRecyclerView.setLayoutManager(mLayoutManager);<NEW_LINE>// requires *wrapped* adapter<NEW_LINE>mRecyclerView.setAdapter(mWrappedAdapter);<NEW_LINE>mRecyclerView.setItemAnimator(animator);<NEW_LINE>// additional decorations<NEW_LINE>// noinspection StatementWithEmptyBody<NEW_LINE>if (supportsViewElevation()) {<NEW_LINE>// Lollipop or later has native drop shadow feature. ItemShadowDecorator is not required.<NEW_LINE>} else {<NEW_LINE>mRecyclerView.addItemDecoration(new ItemShadowDecorator((NinePatchDrawable) ContextCompat.getDrawable(requireContext(), R.drawable.material_shadow_z1)));<NEW_LINE>}<NEW_LINE>mRecyclerView.addItemDecoration(new SimpleListDividerDecorator(ContextCompat.getDrawable(requireContext(), R.drawable.list_divider_h), true));<NEW_LINE>mRecyclerViewDragDropManager.attachRecyclerView(mRecyclerView);<NEW_LINE>// for debugging<NEW_LINE>// animator.setDebug(true);<NEW_LINE>// animator.setMoveDuration(2000);<NEW_LINE>} | super.onViewCreated(view, savedInstanceState); |
511,328 | private void dialogChanged() {<NEW_LINE>String location = getLocation();<NEW_LINE>String fileName = getFileName();<NEW_LINE>Path path = new Path(location);<NEW_LINE>if (location.length() == 0) {<NEW_LINE>updateStatus("File location must be specified");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fileName.length() == 0) {<NEW_LINE>updateStatus("File name must be specified");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int segmentCount = path.segmentCount();<NEW_LINE>if (segmentCount < 2) {<NEW_LINE>// this is a project - check for it's existance<NEW_LINE>IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(location);<NEW_LINE>if (!project.exists()) {<NEW_LINE>updateStatus("Project does not exist");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IFile <MASK><NEW_LINE>if (file.exists()) {<NEW_LINE>updateStatus("File Already Exists");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(path);<NEW_LINE>if (!folder.exists()) {<NEW_LINE>updateStatus("Location does not exist");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IFile file = folder.getFile(fileName);<NEW_LINE>if (file.exists()) {<NEW_LINE>updateStatus("File Already Exists");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int dotLoc = fileName.lastIndexOf('.');<NEW_LINE>if (dotLoc != -1) {<NEW_LINE>String ext = fileName.substring(dotLoc + 1);<NEW_LINE>if (ext.equalsIgnoreCase("xml") == false) {<NEW_LINE>updateStatus("File extension must be \"xml\"");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>updateStatus("File extension must be \"xml\"");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>updateStatus(null);<NEW_LINE>} | file = project.getFile(fileName); |
1,332,524 | private void sendStatementExecuteCommand(MySQLPreparedStatement statement, boolean sendTypesToServer, Tuple params, byte cursorType) {<NEW_LINE>ByteBuf packet = allocateBuffer();<NEW_LINE>// encode packet header<NEW_LINE>int packetStartIdx = packet.writerIndex();<NEW_LINE>// will set payload length later by calculation<NEW_LINE>packet.writeMediumLE(0);<NEW_LINE>packet.writeByte(sequenceId);<NEW_LINE>// encode packet payload<NEW_LINE>packet.writeByte(CommandType.COM_STMT_EXECUTE);<NEW_LINE>packet.writeIntLE((int) statement.statementId);<NEW_LINE>packet.writeByte(cursorType);<NEW_LINE>// iteration count, always 1<NEW_LINE>packet.writeIntLE(1);<NEW_LINE>int numOfParams = statement.bindingTypes().length;<NEW_LINE>int bitmapLength = (numOfParams + 7) / 8;<NEW_LINE>byte[] nullBitmap = new byte[bitmapLength];<NEW_LINE>int pos = packet.writerIndex();<NEW_LINE>if (numOfParams > 0) {<NEW_LINE>// write a dummy bitmap first<NEW_LINE>packet.writeBytes(nullBitmap);<NEW_LINE>packet.writeBoolean(sendTypesToServer);<NEW_LINE>if (sendTypesToServer) {<NEW_LINE>for (DataType bindingType : statement.bindingTypes()) {<NEW_LINE>packet.writeByte(bindingType.id);<NEW_LINE>// parameter flag: signed<NEW_LINE>packet.writeByte(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < numOfParams; i++) {<NEW_LINE>Object value = params.getValue(i);<NEW_LINE>if (value != null) {<NEW_LINE>DataTypeCodec.encodeBinary(statement.bindingTypes()[i], value, encoder.encodingCharset, packet);<NEW_LINE>} else {<NEW_LINE>nullBitmap[i / 8] |= (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// padding null-bitmap content<NEW_LINE>packet.setBytes(pos, nullBitmap);<NEW_LINE>}<NEW_LINE>// set payload length<NEW_LINE>int payloadLength = packet.writerIndex() - packetStartIdx - 4;<NEW_LINE>packet.setMediumLE(packetStartIdx, payloadLength);<NEW_LINE>sendPacket(packet, payloadLength);<NEW_LINE>} | 1 << (i & 7)); |
975,358 | public static void vp8_short_inv_walsh4x4(PositionableIntArrPointer ip, FullAccessIntArrPointer mb_dqcoeff) {<NEW_LINE>int inPos = ip.getPos();<NEW_LINE>FullAccessIntArrPointer op = new FullAccessIntArrPointer(16);<NEW_LINE>int i;<NEW_LINE>int a1, b1, c1, d1;<NEW_LINE>int a2, b2, c2, d2;<NEW_LINE>for (i = 0; i < 4; ++i) {<NEW_LINE>a1 = ip.get() + ip.getRel(12);<NEW_LINE>b1 = ip.getRel(4) + ip.getRel(8);<NEW_LINE>c1 = ip.getRel(4) - ip.getRel(8);<NEW_LINE>d1 = ip.get() - ip.getRel(12);<NEW_LINE>op.set((short) (a1 + b1));<NEW_LINE>op.setRel(4, (short) (c1 + d1));<NEW_LINE>op.setRel(8, (short) (a1 - b1));<NEW_LINE>op.setRel(12, (short) (d1 - c1));<NEW_LINE>ip.inc();<NEW_LINE>op.inc();<NEW_LINE>}<NEW_LINE>op.rewind();<NEW_LINE>ip.setPos(inPos);<NEW_LINE>for (i = 0; i < 4; ++i) {<NEW_LINE>a1 = op.get() + op.getRel(3);<NEW_LINE>b1 = op.getRel(1) + op.getRel(2);<NEW_LINE>c1 = op.getRel(1) - op.getRel(2);<NEW_LINE>d1 = op.get(<MASK><NEW_LINE>a2 = a1 + b1;<NEW_LINE>b2 = c1 + d1;<NEW_LINE>c2 = a1 - b1;<NEW_LINE>d2 = d1 - c1;<NEW_LINE>op.setAndInc((short) ((a2 + 3) >> 3));<NEW_LINE>op.setAndInc((short) ((b2 + 3) >> 3));<NEW_LINE>op.setAndInc((short) ((c2 + 3) >> 3));<NEW_LINE>op.setAndInc((short) ((d2 + 3) >> 3));<NEW_LINE>}<NEW_LINE>op.rewind();<NEW_LINE>for (i = 0; i < 16; ++i) {<NEW_LINE>mb_dqcoeff.setRel(i << 4, op.getRel(i));<NEW_LINE>}<NEW_LINE>} | ) - op.getRel(3); |
1,253,186 | public void print(StringBuilder toStringBuilder) {<NEW_LINE>toStringBuilder.append("MailConfiguration: [");<NEW_LINE>toStringBuilder.append("description=").append(description);<NEW_LINE>toStringBuilder.append(", jndiName=").append(jndiName);<NEW_LINE>toStringBuilder.append(", enabled=").append(enabled);<NEW_LINE>toStringBuilder.append(", storeProtocol=").append(storeProtocol);<NEW_LINE>toStringBuilder.append(", transportProtocol=").append(transportProtocol);<NEW_LINE>toStringBuilder.append(", storeProtocolClass=").append(storeProtocolClass);<NEW_LINE>toStringBuilder.append(", transportProtocolClass=").append(transportProtocolClass);<NEW_LINE>toStringBuilder.append(", mailHost=").append(mailHost);<NEW_LINE>toStringBuilder.append(", username=").append(username);<NEW_LINE>toStringBuilder.append(", mailFrom=").append(mailFrom);<NEW_LINE>toStringBuilder.append(", debug=").append(debug);<NEW_LINE>toStringBuilder.append(", mailProperties: [");<NEW_LINE>Enumeration e = mailProperties.propertyNames();<NEW_LINE>String name;<NEW_LINE>String value;<NEW_LINE>boolean isFirst = true;<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>name = <MASK><NEW_LINE>value = mailProperties.getProperty(name);<NEW_LINE>if (!isFirst)<NEW_LINE>toStringBuilder.append(", ");<NEW_LINE>toStringBuilder.append(name).append("=").append(value);<NEW_LINE>isFirst = false;<NEW_LINE>}<NEW_LINE>toStringBuilder.append("]]");<NEW_LINE>} | (String) e.nextElement(); |
1,133,387 | public boolean testDerivatives(double[] x, double functionTolerance) {<NEW_LINE>boolean ret = false;<NEW_LINE>boolean compareHess = true;<NEW_LINE>log.info("Making sure that the stochastic derivatives are ok.");<NEW_LINE><MASK><NEW_LINE>StochasticCalculateMethods tmpMethod = thisFunc.method;<NEW_LINE>// Make sure that our function is using ordered sampling. Otherwise we have no gaurentees.<NEW_LINE>thisFunc.sampleMethod = AbstractStochasticCachingDiffFunction.SamplingMethod.Ordered;<NEW_LINE>if (thisFunc.method == StochasticCalculateMethods.NoneSpecified) {<NEW_LINE>log.info("No calculate method has been specified");<NEW_LINE>} else if (!thisFunc.method.calculatesHessianVectorProduct()) {<NEW_LINE>compareHess = false;<NEW_LINE>}<NEW_LINE>approxValue = 0;<NEW_LINE>approxGrad = new double[x.length];<NEW_LINE>curGrad = new double[x.length];<NEW_LINE>Hv = new double[x.length];<NEW_LINE>double percent = 0.0;<NEW_LINE>// This loop runs through all the batches and sums of the calculations to compare against the full gradient<NEW_LINE>for (int i = 0; i < numBatches; i++) {<NEW_LINE>percent = 100 * ((double) i) / (numBatches);<NEW_LINE>// Can't figure out how to get a carriage return??? ohh well<NEW_LINE>System.err.printf("%5.1f percent complete\n", percent);<NEW_LINE>// update the "hopefully" correct Hessian<NEW_LINE>thisFunc.method = tmpMethod;<NEW_LINE>System.arraycopy(thisFunc.HdotVAt(x, v, testBatchSize), 0, Hv, 0, Hv.length);<NEW_LINE>// Now get the hessian through finite difference<NEW_LINE>thisFunc.method = StochasticCalculateMethods.ExternalFiniteDifference;<NEW_LINE>System.arraycopy(thisFunc.derivativeAt(x, v, testBatchSize), 0, gradFD, 0, gradFD.length);<NEW_LINE>thisFunc.recalculatePrevBatch = true;<NEW_LINE>System.arraycopy(thisFunc.HdotVAt(x, v, gradFD, testBatchSize), 0, HvFD, 0, HvFD.length);<NEW_LINE>// Compare the difference<NEW_LINE>double DiffHv = ArrayMath.norm_inf(ArrayMath.pairwiseSubtract(Hv, HvFD));<NEW_LINE>// Keep track of the biggest H.v error<NEW_LINE>if (DiffHv > maxHvDiff) {<NEW_LINE>maxHvDiff = DiffHv;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (maxHvDiff < functionTolerance) {<NEW_LINE>sayln("");<NEW_LINE>sayln("Success: Hessian approximations lined up");<NEW_LINE>ret = true;<NEW_LINE>} else {<NEW_LINE>sayln("");<NEW_LINE>sayln("Failure: Hessian approximation at somepoint was off by " + maxHvDiff);<NEW_LINE>ret = false;<NEW_LINE>}<NEW_LINE>thisFunc.sampleMethod = tmpSampleMethod;<NEW_LINE>thisFunc.method = tmpMethod;<NEW_LINE>return ret;<NEW_LINE>} | AbstractStochasticCachingDiffFunction.SamplingMethod tmpSampleMethod = thisFunc.sampleMethod; |
1,178,279 | private Mono<Response<Flux<ByteBuffer>>> revokeAccessWithResponseAsync(String resourceGroupName, String diskName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (diskName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-07-01";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.revokeAccess(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, diskName, apiVersion, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); |
192,268 | public static double crossGamma(double forward, double strike, double timeToExpiry, double lognormalVol) {<NEW_LINE>ArgChecker.isTrue(forward >= 0d, "negative/NaN forward; have {}", forward);<NEW_LINE>ArgChecker.isTrue(strike >= 0d, "negative/NaN strike; have {}", strike);<NEW_LINE>ArgChecker.isTrue(timeToExpiry >= 0d, "negative/NaN timeToExpiry; have {}", timeToExpiry);<NEW_LINE>ArgChecker.isTrue(lognormalVol >= 0d, "negative/NaN lognormalVol; have {}", lognormalVol);<NEW_LINE>double sigmaRootT = lognormalVol * Math.sqrt(timeToExpiry);<NEW_LINE>if (Double.isNaN(sigmaRootT)) {<NEW_LINE>log.info("lognormalVol * Math.sqrt(timeToExpiry) ambiguous");<NEW_LINE>sigmaRootT = 1d;<NEW_LINE>}<NEW_LINE>double d2 = 0d;<NEW_LINE>boolean bFwd = (forward > LARGE);<NEW_LINE>boolean bStr = (strike > LARGE);<NEW_LINE>boolean bSigRt = (sigmaRootT > LARGE);<NEW_LINE>if (bSigRt) {<NEW_LINE>return 0d;<NEW_LINE>}<NEW_LINE>if (sigmaRootT < SMALL) {<NEW_LINE>if (Math.abs(forward - strike) >= SMALL && !(bFwd && bStr)) {<NEW_LINE>return 0d;<NEW_LINE>}<NEW_LINE>log.info("(log 1d)/0d ambiguous");<NEW_LINE>return bFwd ? -NORMAL.getPDF(0d) : -NORMAL.getPDF(0d) / forward / sigmaRootT;<NEW_LINE>}<NEW_LINE>if (Math.abs(forward - strike) < SMALL | (bFwd && bStr)) {<NEW_LINE>d2 = -0.5 * sigmaRootT;<NEW_LINE>} else {<NEW_LINE>d2 = Math.log(forward / <MASK><NEW_LINE>}<NEW_LINE>double nVal = NORMAL.getPDF(d2);<NEW_LINE>return nVal == 0d ? 0d : -nVal / forward / sigmaRootT;<NEW_LINE>} | strike) / sigmaRootT - 0.5 * sigmaRootT; |
1,305,076 | public long sampleOneNeighbor(long vertexId) {<NEW_LINE>int <MASK><NEW_LINE>int start = localId == 0 ? 0 : srcEnds[localId - 1];<NEW_LINE>int end = srcEnds[localId];<NEW_LINE>if (start == end) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>int resLocalId = 0;<NEW_LINE>if (!isWeighted) {<NEW_LINE>// uniform sampling<NEW_LINE>resLocalId = random.nextInt(end - start) + start;<NEW_LINE>} else if (useAliasTable) {<NEW_LINE>// alias sampling<NEW_LINE>int k = random.nextInt(end - start);<NEW_LINE>resLocalId = random.nextDouble() < prob[start + k] ? start + k : alias[start + k];<NEW_LINE>} else {<NEW_LINE>// partialSum sampling<NEW_LINE>double next = random.nextDouble();<NEW_LINE>resLocalId = Arrays.binarySearch(partialSum, start, end, next);<NEW_LINE>resLocalId = Math.abs(resLocalId) - 1;<NEW_LINE>}<NEW_LINE>return dst[resLocalId];<NEW_LINE>} | localId = srcVertexId2LocalId.get(vertexId); |
1,345,827 | public RexNode convertOverlaps(SqlRexContext cx, SqlOverlapsOperator op, SqlCall call) {<NEW_LINE>// for intervals [t0, t1] overlaps [t2, t3], we can find if the<NEW_LINE>// intervals overlaps by: ~(t1 < t2 or t3 < t0)<NEW_LINE>assert call.getOperandList().size() == 2;<NEW_LINE>final Pair<RexNode, RexNode> left = convertOverlapsOperand(cx, call.getParserPosition(), call.operand(0));<NEW_LINE>final RexNode r0 = left.left;<NEW_LINE>final RexNode r1 = left.right;<NEW_LINE>final Pair<RexNode, RexNode> right = convertOverlapsOperand(cx, call.getParserPosition(), call.operand(1));<NEW_LINE>final RexNode r2 = right.left;<NEW_LINE>final RexNode r3 = right.right;<NEW_LINE>// Sort end points into start and end, such that (s0 <= e0) and (s1 <= e1).<NEW_LINE>final RexBuilder rexBuilder = cx.getRexBuilder();<NEW_LINE>RexNode leftSwap = le(rexBuilder, r0, r1);<NEW_LINE>final RexNode s0 = case_(rexBuilder, leftSwap, r0, r1);<NEW_LINE>final RexNode e0 = case_(rexBuilder, leftSwap, r1, r0);<NEW_LINE>RexNode rightSwap = <MASK><NEW_LINE>final RexNode s1 = case_(rexBuilder, rightSwap, r2, r3);<NEW_LINE>final RexNode e1 = case_(rexBuilder, rightSwap, r3, r2);<NEW_LINE>// (e0 >= s1) AND (e1 >= s0)<NEW_LINE>switch(op.kind) {<NEW_LINE>case OVERLAPS:<NEW_LINE>return and(rexBuilder, ge(rexBuilder, e0, s1), ge(rexBuilder, e1, s0));<NEW_LINE>case CONTAINS:<NEW_LINE>return and(rexBuilder, le(rexBuilder, s0, s1), ge(rexBuilder, e0, e1));<NEW_LINE>case PERIOD_EQUALS:<NEW_LINE>return and(rexBuilder, eq(rexBuilder, s0, s1), eq(rexBuilder, e0, e1));<NEW_LINE>case PRECEDES:<NEW_LINE>return le(rexBuilder, e0, s1);<NEW_LINE>case IMMEDIATELY_PRECEDES:<NEW_LINE>return eq(rexBuilder, e0, s1);<NEW_LINE>case SUCCEEDS:<NEW_LINE>return ge(rexBuilder, s0, e1);<NEW_LINE>case IMMEDIATELY_SUCCEEDS:<NEW_LINE>return eq(rexBuilder, s0, e1);<NEW_LINE>default:<NEW_LINE>throw new AssertionError(op);<NEW_LINE>}<NEW_LINE>} | le(rexBuilder, r2, r3); |
57,783 | private Mono<Response<Flux<ByteBuffer>>> listLearnedRoutesWithResponseAsync(String resourceGroupName, String hubName, String connectionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (hubName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (connectionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listLearnedRoutes(this.client.getEndpoint(), resourceGroupName, hubName, connectionName, apiVersion, this.client.getSubscriptionId(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter hubName is required and cannot be null.")); |
435,163 | protected String buildUndoSQL() {<NEW_LINE>TableRecords beforeImage = sqlUndoLog.getBeforeImage();<NEW_LINE>List<Row> beforeImageRows = beforeImage.getRows();<NEW_LINE>if (CollectionUtils.isEmpty(beforeImageRows)) {<NEW_LINE>// TODO<NEW_LINE>throw new ShouldNeverHappenException("Invalid UNDO LOG");<NEW_LINE>}<NEW_LINE>Row row = beforeImageRows.get(0);<NEW_LINE>List<Field> nonPkFields = row.nonPrimaryKeys();<NEW_LINE>// update sql undo log before image all field come from table meta. need add escape.<NEW_LINE>// see BaseTransactionalExecutor#buildTableRecords<NEW_LINE>String updateColumns = nonPkFields.stream().map(field -> ColumnUtils.addEscape(field.getName(), JdbcConstants.ORACLE) + " = ?").collect(Collectors.joining(", "));<NEW_LINE>List<String> pkNameList = getOrderedPkList(beforeImage, row, JdbcConstants.ORACLE).stream().map(e -> e.getName()).<MASK><NEW_LINE>String whereSql = SqlGenerateUtils.buildWhereConditionByPKs(pkNameList, JdbcConstants.ORACLE);<NEW_LINE>return String.format(UPDATE_SQL_TEMPLATE, sqlUndoLog.getTableName(), updateColumns, whereSql);<NEW_LINE>} | collect(Collectors.toList()); |
3,644 | public void actionPerformed(@Nonnull AnActionEvent e) {<NEW_LINE>List<ComponentManagerImpl> areas = new ArrayList<>();<NEW_LINE>areas.add((ComponentManagerImpl) Application.get());<NEW_LINE>final Project project = e.getData(CommonDataKeys.PROJECT);<NEW_LINE>if (project != null) {<NEW_LINE>areas<MASK><NEW_LINE>final Module[] modules = ModuleManager.getInstance(project).getModules();<NEW_LINE>if (modules.length > 0) {<NEW_LINE>areas.add((ComponentManagerImpl) modules[0]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.print(areas.size() + " extension areas: ");<NEW_LINE>for (ComponentManager area : areas) {<NEW_LINE>System.out.print(area + " ");<NEW_LINE>}<NEW_LINE>System.out.println("\n");<NEW_LINE>List<ExtensionPoint> points = new ArrayList<>();<NEW_LINE>for (ComponentManagerImpl area : areas) {<NEW_LINE>points.addAll(Arrays.asList(area.getExtensionPoints()));<NEW_LINE>}<NEW_LINE>System.out.println(points.size() + " extension points: ");<NEW_LINE>for (ExtensionPoint point : points) {<NEW_LINE>System.out.println(" " + point.getName());<NEW_LINE>}<NEW_LINE>List<Object> extensions = new ArrayList<>();<NEW_LINE>for (ExtensionPoint point : points) {<NEW_LINE>extensions.addAll(point.getExtensionList());<NEW_LINE>}<NEW_LINE>System.out.println("\n" + extensions.size() + " extensions:");<NEW_LINE>for (Object extension : extensions) {<NEW_LINE>if (extension instanceof Configurable) {<NEW_LINE>System.out.println("!!!! Configurable extension found. Kill it !!!");<NEW_LINE>}<NEW_LINE>System.out.println(extension);<NEW_LINE>}<NEW_LINE>} | .add((ComponentManagerImpl) project); |
1,222,671 | protected void before(XParam param) throws Throwable {<NEW_LINE>switch(mMethod) {<NEW_LINE>case getRecentTasks:<NEW_LINE>case getRunningAppProcesses:<NEW_LINE>case getRunningServices:<NEW_LINE>case getRunningTasks:<NEW_LINE>case Srv_getRecentTasks:<NEW_LINE>case Srv_getRunningAppProcesses:<NEW_LINE>case Srv_getServices:<NEW_LINE>case Srv_getTasks:<NEW_LINE>break;<NEW_LINE>case Srv_startActivities:<NEW_LINE>if (param.args.length > 2 && param.args[2] instanceof Intent[]) {<NEW_LINE>List<Intent> listIntent = new ArrayList<Intent>();<NEW_LINE>for (Intent intent : (Intent[]) param.args[2]) if (!isRestricted(param, intent))<NEW_LINE>listIntent.add(intent);<NEW_LINE>if (listIntent.size() == 0)<NEW_LINE>// ActivityManager.START_SUCCESS<NEW_LINE>param.setResult(0);<NEW_LINE>else<NEW_LINE>param.args[2] = listIntent.toArray(new Intent[0]);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case Srv_startActivity:<NEW_LINE>case Srv_startActivityAsCaller:<NEW_LINE>case Srv_startActivityAsUser:<NEW_LINE>case Srv_startActivityWithConfig:<NEW_LINE>if (param.args.length > 2 && param.args[2] instanceof Intent) {<NEW_LINE>Intent intent = (Intent) param.args[2];<NEW_LINE>if (isRestricted(param, intent))<NEW_LINE>// ActivityManager.START_SUCCESS<NEW_LINE>param.setResult(0);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case Srv_startActivityAndWait:<NEW_LINE>if (param.args.length > 2 && param.args[2] instanceof Intent) {<NEW_LINE>Intent intent = (Intent) param.args[2];<NEW_LINE>if (isRestricted(param, intent)) {<NEW_LINE>Class<?> cWaitResult = Class.forName("android.app.IActivityManager.WaitResult");<NEW_LINE>Field fWho = cWaitResult.getDeclaredField("who");<NEW_LINE>Class<?> we = this.getClass();<NEW_LINE>ComponentName component = new ComponentName(we.getPackage().getName(<MASK><NEW_LINE>Object waitResult = cWaitResult.getConstructor().newInstance();<NEW_LINE>fWho.set(waitResult, component);<NEW_LINE>param.setResult(waitResult);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | ), we.getName()); |
1,511,711 | final GetRepositoryPermissionsPolicyResult executeGetRepositoryPermissionsPolicy(GetRepositoryPermissionsPolicyRequest getRepositoryPermissionsPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRepositoryPermissionsPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRepositoryPermissionsPolicyRequest> request = null;<NEW_LINE>Response<GetRepositoryPermissionsPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRepositoryPermissionsPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRepositoryPermissionsPolicyRequest));<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, "codeartifact");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRepositoryPermissionsPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRepositoryPermissionsPolicyResultJsonUnmarshaller());<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.OPERATION_NAME, "GetRepositoryPermissionsPolicy"); |
1,475,315 | public void showMenuBuilderRecords(ActionRequest request, ActionResponse response) {<NEW_LINE>MenuBuilder menuBuilder = request.getContext().asType(MenuBuilder.class);<NEW_LINE>if (menuBuilder.getMetaMenu() == null || menuBuilder.getMetaMenu().getAction() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>MetaAction metaAction = menuBuilder.getMetaMenu().getAction();<NEW_LINE>ObjectViews objectViews = XMLViews.fromXML(metaAction.getXml());<NEW_LINE>ActionView actionView = (ActionView) objectViews.<MASK><NEW_LINE>ActionViewBuilder actionViewBuilder = ActionView.define(I18n.get(actionView.getTitle()));<NEW_LINE>actionViewBuilder.model(actionView.getModel());<NEW_LINE>actionViewBuilder.icon(actionView.getIcon());<NEW_LINE>actionViewBuilder.domain(actionView.getDomain());<NEW_LINE>actionViewBuilder.context("jsonModel", menuBuilder.getActionBuilder().getModel());<NEW_LINE>actionView.getViews().forEach(view -> actionViewBuilder.add(view.getType(), view.getName()));<NEW_LINE>if (ObjectUtils.notEmpty(actionView.getParams())) {<NEW_LINE>actionView.getParams().forEach(param -> actionViewBuilder.param(param.getName(), param.getValue()));<NEW_LINE>}<NEW_LINE>response.setView(actionViewBuilder.map());<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>} | getActions().get(0); |
34,175 | public static DescribeBackupsResponse unmarshall(DescribeBackupsResponse describeBackupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupsResponse.setRequestId(_ctx.stringValue("DescribeBackupsResponse.RequestId"));<NEW_LINE>describeBackupsResponse.setTotalRecordCount(_ctx.stringValue("DescribeBackupsResponse.TotalRecordCount"));<NEW_LINE>describeBackupsResponse.setPageNumber(_ctx.stringValue("DescribeBackupsResponse.PageNumber"));<NEW_LINE>describeBackupsResponse.setPageRecordCount(_ctx.stringValue("DescribeBackupsResponse.PageRecordCount"));<NEW_LINE>List<Backup> items = new ArrayList<Backup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupsResponse.Items.Length"); i++) {<NEW_LINE>Backup backup = new Backup();<NEW_LINE>backup.setBackupId(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupId"));<NEW_LINE>backup.setDBClusterId(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].DBClusterId"));<NEW_LINE>backup.setBackupStatus(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupStatus"));<NEW_LINE>backup.setBackupStartTime(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupStartTime"));<NEW_LINE>backup.setBackupEndTime(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupEndTime"));<NEW_LINE>backup.setBackupType(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupType"));<NEW_LINE>backup.setBackupMode(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupMode"));<NEW_LINE>backup.setBackupMethod(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupMethod"));<NEW_LINE>backup.setStoreStatus(_ctx.stringValue<MASK><NEW_LINE>backup.setBackupSetSize(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupSetSize"));<NEW_LINE>backup.setConsistentTime(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].ConsistentTime"));<NEW_LINE>backup.setBackupsLevel(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupsLevel"));<NEW_LINE>backup.setIsAvail(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].IsAvail"));<NEW_LINE>items.add(backup);<NEW_LINE>}<NEW_LINE>describeBackupsResponse.setItems(items);<NEW_LINE>return describeBackupsResponse;<NEW_LINE>} | ("DescribeBackupsResponse.Items[" + i + "].StoreStatus")); |
57,303 | protected Authentication doInternalAuthenticate(LoginCredential loginCredential) {<NEW_LINE>_logger.debug("authentication " + loginCredential);<NEW_LINE>sessionValid(loginCredential.getSessionId());<NEW_LINE>// jwtTokenValid(j_jwtToken);<NEW_LINE>authTypeValid(loginCredential.getAuthType());<NEW_LINE>Institutions inst = (Institutions) WebContext.getAttribute(WebConstants.CURRENT_INST);<NEW_LINE>if (inst.getCaptcha().equalsIgnoreCase("YES")) {<NEW_LINE>captchaValid(loginCredential.getCaptcha(), loginCredential.getAuthType());<NEW_LINE>}<NEW_LINE>emptyPasswordValid(loginCredential.getPassword());<NEW_LINE>UserInfo userInfo = null;<NEW_LINE><MASK><NEW_LINE>userInfo = loadUserInfo(loginCredential.getUsername(), loginCredential.getPassword());<NEW_LINE>statusValid(loginCredential, userInfo);<NEW_LINE>// mfa<NEW_LINE>tftcaptchaValid(loginCredential.getOtpCaptcha(), loginCredential.getAuthType(), userInfo);<NEW_LINE>// Validate PasswordPolicy<NEW_LINE>authenticationRealm.getPasswordPolicyValidator().passwordPolicyValid(userInfo);<NEW_LINE>if (loginCredential.getAuthType().equalsIgnoreCase(AuthType.MOBILE)) {<NEW_LINE>mobilecaptchaValid(loginCredential.getPassword(), loginCredential.getAuthType(), userInfo);<NEW_LINE>} else {<NEW_LINE>// Match password<NEW_LINE>authenticationRealm.passwordMatches(userInfo, loginCredential.getPassword());<NEW_LINE>}<NEW_LINE>// apply PasswordSetType and resetBadPasswordCount<NEW_LINE>authenticationRealm.getPasswordPolicyValidator().applyPasswordPolicy(userInfo);<NEW_LINE>UsernamePasswordAuthenticationToken authenticationToken = createOnlineSession(loginCredential, userInfo);<NEW_LINE>// RemeberMe Config check then set RemeberMe cookies<NEW_LINE>if (applicationConfig.getLoginConfig().isRemeberMe()) {<NEW_LINE>if (loginCredential.getRemeberMe() != null && loginCredential.getRemeberMe().equals("remeberMe")) {<NEW_LINE>WebContext.getSession().setAttribute(WebConstants.REMEBER_ME_SESSION, loginCredential.getUsername());<NEW_LINE>_logger.debug("do Remeber Me");<NEW_LINE>remeberMeService.createRemeberMe(userInfo.getUsername(), WebContext.getRequest(), ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return authenticationToken;<NEW_LINE>} | emptyUsernameValid(loginCredential.getUsername()); |
869,064 | final UpdateDomainNameResult executeUpdateDomainName(UpdateDomainNameRequest updateDomainNameRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDomainNameRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDomainNameRequest> request = null;<NEW_LINE>Response<UpdateDomainNameResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDomainNameRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDomainNameRequest));<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, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDomainName");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDomainNameResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new UpdateDomainNameResultJsonUnmarshaller()); |
1,587,674 | // TODO-BQ: this function may be refactored<NEW_LINE>private void updateBaseInfo(final BaseInfo baseInfo, final ResolveOptions resOpt) {<NEW_LINE>if (this.getExtendsTrait() != null) {<NEW_LINE>baseInfo.setTrait(this.getExtendsTrait().fetchObjectDefinition(resOpt));<NEW_LINE>if (baseInfo.getTrait() != null) {<NEW_LINE>baseInfo.setRts(this.getExtendsTrait().fetchResolvedTraits(resOpt));<NEW_LINE>if (baseInfo.getRts() != null && baseInfo.getRts().getSize() == 1) {<NEW_LINE>final ParameterValueSet basePv = baseInfo.getRts().get(baseInfo.getTrait()) != null ? baseInfo.getRts().get(baseInfo.getTrait()).getParameterValues() : null;<NEW_LINE>if (basePv != null) {<NEW_LINE>baseInfo.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setValues(basePv.getValues()); |
1,226,405 | protected List<Contentlet> findAllCurrent(final int offset, final int limit) throws ElasticsearchException {<NEW_LINE>final String indexToHit;<NEW_LINE>try {<NEW_LINE>indexToHit = APILocator.getIndiciesAPI().loadIndicies().getWorking();<NEW_LINE>} catch (DotDataException ee) {<NEW_LINE>Logger.fatal(this, "Can't get indicies information", ee);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final SearchRequest searchRequest = new SearchRequest(indexToHit);<NEW_LINE><MASK><NEW_LINE>searchSourceBuilder.query(QueryBuilders.matchAllQuery());<NEW_LINE>searchSourceBuilder.size(limit);<NEW_LINE>searchSourceBuilder.from(offset);<NEW_LINE>searchSourceBuilder.timeout(TimeValue.timeValueMillis(INDEX_OPERATIONS_TIMEOUT_IN_MS));<NEW_LINE>searchSourceBuilder.fetchSource(new String[] { "inode" }, null);<NEW_LINE>searchRequest.source(searchSourceBuilder);<NEW_LINE>final SearchHits hits = cachedIndexSearch(searchRequest);<NEW_LINE>final List<Contentlet> contentlets = new ArrayList<>();<NEW_LINE>for (final SearchHit hit : hits) {<NEW_LINE>try {<NEW_LINE>final Map<String, Object> sourceMap = hit.getSourceAsMap();<NEW_LINE>contentlets.add(find(sourceMap.get("inode").toString()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ElasticsearchException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return contentlets;<NEW_LINE>} | final SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); |
36,192 | public static ListMerchantResponse unmarshall(ListMerchantResponse listMerchantResponse, UnmarshallerContext _ctx) {<NEW_LINE>listMerchantResponse.setRequestId(_ctx.stringValue("ListMerchantResponse.RequestId"));<NEW_LINE>listMerchantResponse.setSuccess(_ctx.booleanValue("ListMerchantResponse.Success"));<NEW_LINE>listMerchantResponse.setPageSize(_ctx.stringValue("ListMerchantResponse.PageSize"));<NEW_LINE>listMerchantResponse.setPageNumber(_ctx.stringValue("ListMerchantResponse.PageNumber"));<NEW_LINE>listMerchantResponse.setTotalCount(_ctx.integerValue("ListMerchantResponse.TotalCount"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageSize<MASK><NEW_LINE>data.setPageNumber(_ctx.integerValue("ListMerchantResponse.Data.PageNumber"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListMerchantResponse.Data.TotalCount"));<NEW_LINE>List<ListItem> list = new ArrayList<ListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListMerchantResponse.Data.List.Length"); i++) {<NEW_LINE>ListItem listItem = new ListItem();<NEW_LINE>listItem.setMerchantId(_ctx.longValue("ListMerchantResponse.Data.List[" + i + "].MerchantId"));<NEW_LINE>listItem.setName(_ctx.stringValue("ListMerchantResponse.Data.List[" + i + "].Name"));<NEW_LINE>listItem.setType(_ctx.integerValue("ListMerchantResponse.Data.List[" + i + "].Type"));<NEW_LINE>listItem.setCompany(_ctx.stringValue("ListMerchantResponse.Data.List[" + i + "].Company"));<NEW_LINE>listItem.setPhone(_ctx.stringValue("ListMerchantResponse.Data.List[" + i + "].Phone"));<NEW_LINE>listItem.setAddress(_ctx.stringValue("ListMerchantResponse.Data.List[" + i + "].Address"));<NEW_LINE>listItem.setEmail(_ctx.stringValue("ListMerchantResponse.Data.List[" + i + "].Email"));<NEW_LINE>listItem.setStatus(_ctx.integerValue("ListMerchantResponse.Data.List[" + i + "].Status"));<NEW_LINE>listItem.setRemark(_ctx.stringValue("ListMerchantResponse.Data.List[" + i + "].Remark"));<NEW_LINE>list.add(listItem);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>listMerchantResponse.setData(data);<NEW_LINE>return listMerchantResponse;<NEW_LINE>} | (_ctx.integerValue("ListMerchantResponse.Data.PageSize")); |
1,612,465 | private List<IPair<IAllocationRequest, IAllocationResult>> unloadAll(final IHUContext huContext, final I_M_HU hu) {<NEW_LINE>final List<IPair<IAllocationRequest, IAllocationResult>> result = new ArrayList<>();<NEW_LINE>final HUIteratorListenerAdapter huIteratorListener = new HUIteratorListenerAdapter() {<NEW_LINE><NEW_LINE>private IAllocationRequest createAllocationRequest(final IProductStorage productStorage) {<NEW_LINE>final IAllocationRequest request = // date<NEW_LINE>AllocationUtils.// date<NEW_LINE>createQtyRequest(// date<NEW_LINE>huContext, // date<NEW_LINE>productStorage.getProductId(), // date<NEW_LINE>productStorage.getQty(), getHUIterator().getDate());<NEW_LINE>return request;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Result beforeHUItemStorage(final IMutable<IHUItemStorage> itemStorage) {<NEW_LINE>// don't go downstream because we don't care what's there<NEW_LINE>return Result.SKIP_DOWNSTREAM;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Result afterHUItemStorage(final IHUItemStorage itemStorage) {<NEW_LINE>final ZonedDateTime date = getHUIterator().getDate();<NEW_LINE>final I_M_HU_Item huItem = itemStorage.getM_HU_Item();<NEW_LINE>final I_M_HU_Item referenceModel = huItem;<NEW_LINE>for (final IProductStorage productStorage : itemStorage.getProductStorages(date)) {<NEW_LINE>final IAllocationRequest productStorageRequest = createAllocationRequest(productStorage);<NEW_LINE>final IAllocationSource productStorageAsSource = new GenericAllocationSourceDestination(productStorage, huItem, referenceModel);<NEW_LINE>final IAllocationResult productStorageResult = productStorageAsSource.unload(productStorageRequest);<NEW_LINE>result.add(ImmutablePair<MASK><NEW_LINE>}<NEW_LINE>return Result.CONTINUE;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final HUIterator iterator = new HUIterator();<NEW_LINE>iterator.setDate(huContext.getDate());<NEW_LINE>iterator.setStorageFactory(huContext.getHUStorageFactory());<NEW_LINE>iterator.setListener(huIteratorListener);<NEW_LINE>iterator.iterate(hu);<NEW_LINE>return result;<NEW_LINE>} | .of(productStorageRequest, productStorageResult)); |
937,931 | public void exitField(int initializationStart, int declarationEnd, int declarationSourceEnd) {<NEW_LINE>JavaElement handle = (JavaElement) this.handleStack.peek();<NEW_LINE>FieldInfo fieldInfo = (FieldInfo) this.infoStack.peek();<NEW_LINE>IJavaElement[] elements = getChildren(fieldInfo);<NEW_LINE>SourceFieldElementInfo info = elements.length == 0 ? new SourceFieldElementInfo() : new SourceFieldWithChildrenInfo(elements);<NEW_LINE>info.setNameSourceStart(fieldInfo.nameSourceStart);<NEW_LINE><MASK><NEW_LINE>info.setSourceRangeStart(fieldInfo.declarationStart);<NEW_LINE>info.setFlags(fieldInfo.modifiers);<NEW_LINE>char[] typeName = JavaModelManager.getJavaModelManager().intern(fieldInfo.type);<NEW_LINE>info.setTypeName(typeName);<NEW_LINE>this.newElements.put(handle, info);<NEW_LINE>if (fieldInfo.annotations != null) {<NEW_LINE>int length = fieldInfo.annotations.length;<NEW_LINE>this.unitInfo.annotationNumber += length;<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.Annotation annotation = fieldInfo.annotations[i];<NEW_LINE>acceptAnnotation(annotation, info, handle);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>info.setSourceRangeEnd(declarationSourceEnd);<NEW_LINE>this.handleStack.pop();<NEW_LINE>this.infoStack.pop();<NEW_LINE>// remember initializer source if field is a constant<NEW_LINE>if (initializationStart != -1) {<NEW_LINE>int flags = info.flags;<NEW_LINE>Object typeInfo;<NEW_LINE>if (Flags.isFinal(flags) || ((typeInfo = this.infoStack.peek()) instanceof TypeInfo && (Flags.isInterface(((TypeInfo) typeInfo).modifiers)))) {<NEW_LINE>int length = declarationEnd - initializationStart;<NEW_LINE>if (length > 0) {<NEW_LINE>char[] initializer = new char[length];<NEW_LINE>System.arraycopy(this.parser.scanner.source, initializationStart, initializer, 0, length);<NEW_LINE>info.initializationSource = initializer;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fieldInfo.typeAnnotated) {<NEW_LINE>this.unitInfo.annotationNumber = CompilationUnitElementInfo.ANNOTATION_THRESHOLD_FOR_DIET_PARSE;<NEW_LINE>}<NEW_LINE>} | info.setNameSourceEnd(fieldInfo.nameSourceEnd); |
214,824 | private void mergeModules(Map<String, Object> source) {<NEW_LINE>Set<String> newKeys = source.keySet();<NEW_LINE>for (String key : newKeys) {<NEW_LINE>Object newEntry = source.get(key);<NEW_LINE>if (!modules.containsKey(key)) {<NEW_LINE>modules.put(key, newEntry);<NEW_LINE>} else {<NEW_LINE>Object origEntry = modules.get(key);<NEW_LINE>if (!(origEntry instanceof Map) || !(newEntry instanceof Map)) {<NEW_LINE>// That would be odd indeed.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Map<Object, Object> newEntryMap = (Map<Object, Object>) newEntry;<NEW_LINE>Map<Object, Object> origEntryMap = (Map<Object, Object>) origEntry;<NEW_LINE>if (newEntryMap.containsKey("apiName") && !origEntryMap.containsKey("apiName")) {<NEW_LINE>origEntryMap.put("apiName", newEntryMap.get("apiName"));<NEW_LINE>}<NEW_LINE>String[] listNames = { "childModules", "createProxies" };<NEW_LINE>for (String listName : listNames) {<NEW_LINE>if (newEntryMap.containsKey(listName)) {<NEW_LINE>JSONArray list = (<MASK><NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>jsonUtils.appendUniqueObject(origEntryMap, listName, "id", (Map<Object, Object>) list.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | JSONArray) newEntryMap.get(listName); |
1,633,986 | public AttributeNode createAttributeNode(@NonNegative final long parentKey, @NonNull final QNm name, @NonNull final byte[] value, @NonNegative final long pathNodeKey, final SirixDeweyID id) {<NEW_LINE>final long revision = pageTrx.getRevisionNumber();<NEW_LINE>final int uriKey = pageTrx.createNameKey(name.getNamespaceURI(), NodeKind.NAMESPACE);<NEW_LINE>final int prefixKey = name.getPrefix() != null && !name.getPrefix().isEmpty() ? pageTrx.createNameKey(name.getPrefix(), NodeKind.ATTRIBUTE) : -1;<NEW_LINE>final int localNameKey = pageTrx.createNameKey(name.getLocalName(), NodeKind.ATTRIBUTE);<NEW_LINE>final NodeDelegate nodeDel = new NodeDelegate(pageTrx.getActualRevisionRootPage().getMaxNodeKeyInDocumentIndex() + 1, parentKey, <MASK><NEW_LINE>final NameNodeDelegate nameDel = new NameNodeDelegate(nodeDel, uriKey, prefixKey, localNameKey, pathNodeKey);<NEW_LINE>final ValueNodeDelegate valDel = new ValueNodeDelegate(nodeDel, value, false);<NEW_LINE>return pageTrx.createRecord(nodeDel.getNodeKey(), new AttributeNode(nodeDel, nameDel, valDel, name), IndexType.DOCUMENT, -1);<NEW_LINE>} | hashFunction, null, revision, id); |
1,092,722 | public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int position) {<NEW_LINE>boolean isSelected = false;<NEW_LINE>if (tracker != null) {<NEW_LINE>final Long itemId = getItemId(position);<NEW_LINE>if (tracker.isSelected(itemId)) {<NEW_LINE>tracker.select(itemId);<NEW_LINE>isSelected = true;<NEW_LINE>} else {<NEW_LINE>tracker.deselect(itemId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>switch(getItemViewType(position)) {<NEW_LINE>case TYPE_SECTION:<NEW_LINE>{<NEW_LINE>((SectionViewHolder) holder).bind((SectionItem) itemList.get(position));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TYPE_NOTE_WITH_EXCERPT:<NEW_LINE>case TYPE_NOTE_WITHOUT_EXCERPT:<NEW_LINE>case TYPE_NOTE_ONLY_TITLE:<NEW_LINE>{<NEW_LINE>((NoteViewHolder) holder).bind(isSelected, (Note) itemList.get(position), <MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | showCategory, mainColor, textColor, searchQuery); |
1,193,988 | public void start() {<NEW_LINE>if (current != null) {<NEW_LINE>current.show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Form hi = new Form("Hi World", new BorderLayout());<NEW_LINE><MASK><NEW_LINE>$(button1).selectAllStyles().setBgColor(0xff0000);<NEW_LINE>Button button2 = new Button("Button 2");<NEW_LINE>$(button2).selectAllStyles().setBgColor(0x00ff00);<NEW_LINE>Button doFade = new Button("Toggle");<NEW_LINE>doFade.addActionListener(evt -> {<NEW_LINE>Container contentPane = hi.getContentPane();<NEW_LINE>if (contentPane.contains(button1)) {<NEW_LINE>button2.remove();<NEW_LINE>Container wrapper = BorderLayout.center(button2);<NEW_LINE>contentPane.replace(button1.getParent(), wrapper, CommonTransitions.createFade(500));<NEW_LINE>} else if (contentPane.contains(button2)) {<NEW_LINE>Container empty = new Container();<NEW_LINE>$(empty).selectAllStyles().setBgColor(0xeaeaea).setBgTransparency(0xff);<NEW_LINE>contentPane.replace(button2.getParent(), empty, CommonTransitions.createFade(500));<NEW_LINE>// contentPane.removeComponent(empty);<NEW_LINE>} else {<NEW_LINE>Container empty = new Container();<NEW_LINE>button1.remove();<NEW_LINE>contentPane.add(CENTER, empty);<NEW_LINE>contentPane.revalidateWithAnimationSafety();<NEW_LINE>contentPane.replace(empty, BorderLayout.center(button1), CommonTransitions.createFade(500));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>hi.add(NORTH, doFade);<NEW_LINE>hi.show();<NEW_LINE>} | Button button1 = new Button("Button 1"); |
1,356,485 | public void modifyTestElement(TestElement te) {<NEW_LINE>te.clear();<NEW_LINE>super.configureTestElement(te);<NEW_LINE>te.setProperty(SmtpSampler.SERVER, smtpPanel.getServer());<NEW_LINE>te.setProperty(SmtpSampler.SERVER_PORT, smtpPanel.getPort());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>te.setProperty(SmtpSampler.SERVER_TIMEOUT, smtpPanel.getTimeout(), "");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>te.setProperty(SmtpSampler.SERVER_CONNECTION_TIMEOUT, smtpPanel.getConnectionTimeout(), "");<NEW_LINE>te.setProperty(SmtpSampler.MAIL_FROM, smtpPanel.getMailFrom());<NEW_LINE>te.setProperty(SmtpSampler.MAIL_REPLYTO, smtpPanel.getMailReplyTo());<NEW_LINE>te.setProperty(SmtpSampler.RECEIVER_TO, smtpPanel.getReceiverTo());<NEW_LINE>te.setProperty(SmtpSampler.RECEIVER_CC, smtpPanel.getReceiverCC());<NEW_LINE>te.setProperty(SmtpSampler.RECEIVER_BCC, smtpPanel.getReceiverBCC());<NEW_LINE>te.setProperty(SmtpSampler.SUBJECT, smtpPanel.getSubject());<NEW_LINE>te.setProperty(SmtpSampler.SUPPRESS_SUBJECT, Boolean.toString(smtpPanel.isSuppressSubject()));<NEW_LINE>te.setProperty(SmtpSampler.INCLUDE_TIMESTAMP, Boolean.toString(smtpPanel.isIncludeTimestamp()));<NEW_LINE>te.setProperty(SmtpSampler.MESSAGE, smtpPanel.getBody());<NEW_LINE>te.setProperty(SmtpSampler.PLAIN_BODY, Boolean.toString(smtpPanel.isPlainBody()));<NEW_LINE>te.setProperty(SmtpSampler.ATTACH_FILE, smtpPanel.getAttachments());<NEW_LINE>SecuritySettingsPanel secPanel = smtpPanel.getSecuritySettingsPanel();<NEW_LINE>secPanel.modifyTestElement(te);<NEW_LINE>te.setProperty(SmtpSampler.USE_EML, smtpPanel.isUseEmlMessage());<NEW_LINE>te.setProperty(SmtpSampler.EML_MESSAGE_TO_SEND, smtpPanel.getEmlMessage());<NEW_LINE>te.setProperty(SmtpSampler.USE_AUTH, Boolean.toString(smtpPanel.isUseAuth()));<NEW_LINE>te.setProperty(SmtpSampler.PASSWORD, smtpPanel.getPassword());<NEW_LINE>te.setProperty(SmtpSampler.USERNAME, smtpPanel.getUsername());<NEW_LINE>te.setProperty(SmtpSampler.MESSAGE_SIZE_STATS, Boolean.toString(smtpPanel.isMessageSizeStatistics()));<NEW_LINE>te.setProperty(SmtpSampler.ENABLE_DEBUG, Boolean.toString<MASK><NEW_LINE>te.setProperty(smtpPanel.getHeaderFields());<NEW_LINE>} | (smtpPanel.isEnableDebug())); |
1,052,370 | final ListTableRowsResult executeListTableRows(ListTableRowsRequest listTableRowsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTableRowsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTableRowsRequest> request = null;<NEW_LINE>Response<ListTableRowsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTableRowsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTableRowsRequest));<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, "Honeycode");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTableRows");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTableRowsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTableRowsResultJsonUnmarshaller());<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,474,976 | protected void initBottomNavDemoControls(View view) {<NEW_LINE>initAddNavItemButton(view.findViewById(R.id.add_button));<NEW_LINE>initRemoveNavItemButton(view.findViewById(R.id.remove_button));<NEW_LINE>initAddIncreaseBadgeNumberButton(view.findViewById(R.id.increment_badge_number_button));<NEW_LINE>Spinner badgeGravitySpinner = view.findViewById(R.id.badge_gravity_spinner);<NEW_LINE>ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(badgeGravitySpinner.getContext(), R.array.cat_bottom_nav_badge_gravity_titles, android.R.layout.simple_spinner_item);<NEW_LINE>adapter.setDropDownViewResource(<MASK><NEW_LINE>badgeGravitySpinner.setAdapter(adapter);<NEW_LINE>badgeGravitySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>updateBadgeGravity(badgeGravityValues[MathUtils.clamp(position, 0, badgeGravityValues.length - 1)]);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNothingSelected(AdapterView<?> parent) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | android.R.layout.simple_spinner_dropdown_item); |
877,269 | final DisableIpamOrganizationAdminAccountResult executeDisableIpamOrganizationAdminAccount(DisableIpamOrganizationAdminAccountRequest disableIpamOrganizationAdminAccountRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disableIpamOrganizationAdminAccountRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisableIpamOrganizationAdminAccountRequest> request = null;<NEW_LINE>Response<DisableIpamOrganizationAdminAccountResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DisableIpamOrganizationAdminAccountRequestMarshaller().marshall(super.beforeMarshalling(disableIpamOrganizationAdminAccountRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisableIpamOrganizationAdminAccount");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DisableIpamOrganizationAdminAccountResult> responseHandler = new StaxResponseHandler<DisableIpamOrganizationAdminAccountResult>(new DisableIpamOrganizationAdminAccountResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
577,271 | private static MapKey argumentToMapKeySpecifier(Node argument, AccessPathContext apContext) {<NEW_LINE>// Required to have Node type match Tree type in some instances.<NEW_LINE>if (argument instanceof WideningConversionNode) {<NEW_LINE>argument = ((WideningConversionNode) argument).getOperand();<NEW_LINE>}<NEW_LINE>// A switch at the Tree level should be faster than multiple if checks at the Node level.<NEW_LINE>switch(castToNonNull(argument.getTree()).getKind()) {<NEW_LINE>case STRING_LITERAL:<NEW_LINE>return new StringMapKey(((StringLiteralNode) argument).getValue());<NEW_LINE>case INT_LITERAL:<NEW_LINE>return new NumericMapKey(((IntegerLiteralNode) argument).getValue());<NEW_LINE>case LONG_LITERAL:<NEW_LINE>return new NumericMapKey(((LongLiteralNode) argument).getValue());<NEW_LINE>case METHOD_INVOCATION:<NEW_LINE>MethodAccessNode target = ((MethodInvocationNode) argument).getTarget();<NEW_LINE>Node receiver = stripCasts(target.getReceiver());<NEW_LINE>List<Node> arguments = ((<MASK><NEW_LINE>// Check for int/long boxing.<NEW_LINE>if (target.getMethod().getSimpleName().toString().equals("valueOf") && arguments.size() == 1 && castToNonNull(receiver.getTree()).getKind().equals(Tree.Kind.IDENTIFIER) && (receiver.toString().equals("Integer") || receiver.toString().equals("Long"))) {<NEW_LINE>return argumentToMapKeySpecifier(arguments.get(0), apContext);<NEW_LINE>}<NEW_LINE>// Fine to fallthrough:<NEW_LINE>default:<NEW_LINE>// Every other type of expression, including variables, field accesses, new A(...), etc.<NEW_LINE>return // Every AP is a MapKey too<NEW_LINE>getAccessPathForNodeNoMapGet(argument, apContext);<NEW_LINE>}<NEW_LINE>} | MethodInvocationNode) argument).getArguments(); |
799,735 | public JComponent config() {<NEW_LINE>poll();<NEW_LINE>JPanel top = new JPanel(new GridBagLayout());<NEW_LINE>GridBagConstraints c = new GridBagConstraints();<NEW_LINE>c.fill = GridBagConstraints.BOTH;<NEW_LINE>c.insets = new Insets(0, 5, 0, 5);<NEW_LINE>c.ipadx = 5;<NEW_LINE>c.gridx = 0;<NEW_LINE>c.gridy = 0;<NEW_LINE>for (Map.Entry<File, JCheckBox> item : items.entrySet()) {<NEW_LINE>File file = item.getKey();<NEW_LINE>boolean exists = file.exists();<NEW_LINE>JCheckBox box = item.getValue();<NEW_LINE>if (box == null) {<NEW_LINE>box = new JCheckBox(file.getName(), exists);<NEW_LINE>item.setValue(box);<NEW_LINE>}<NEW_LINE>if (!exists) {<NEW_LINE>box.setSelected(false);<NEW_LINE>box.setEnabled(false);<NEW_LINE>}<NEW_LINE>c.weightx = 1.0;<NEW_LINE>top.add(box, c);<NEW_LINE>CustomJButton open = exists ? new CustomJButton(MetalIconFactory.getTreeLeafIcon()) : new CustomJButton("+");<NEW_LINE>open.setActionCommand(file.getAbsolutePath());<NEW_LINE>open.setToolTipText((exists ? "" : Messages.getString("DbgPacker.1") + " ") + file.getAbsolutePath());<NEW_LINE>open.addActionListener(this);<NEW_LINE>c.gridx++;<NEW_LINE>c.weightx = 0.0;<NEW_LINE>top.add(open, c);<NEW_LINE>c.gridx--;<NEW_LINE>c.gridy++;<NEW_LINE>}<NEW_LINE>c.weightx = 2.0;<NEW_LINE>CustomJButton debugPack = new CustomJButton(Messages.getString("DbgPacker.2"));<NEW_LINE>debugPack.setActionCommand("pack");<NEW_LINE>debugPack.addActionListener(this);<NEW_LINE><MASK><NEW_LINE>openZip = new CustomJButton(MetalIconFactory.getTreeFolderIcon());<NEW_LINE>openZip.setActionCommand("showzip");<NEW_LINE>openZip.setToolTipText(Messages.getString("DbgPacker.3"));<NEW_LINE>openZip.setEnabled(false);<NEW_LINE>openZip.addActionListener(this);<NEW_LINE>c.gridx++;<NEW_LINE>c.weightx = 0.0;<NEW_LINE>top.add(openZip, c);<NEW_LINE>return top;<NEW_LINE>} | top.add(debugPack, c); |
1,203,106 | private void readHeaderFormat(int headerSize, byte[] buff) throws TTransportException {<NEW_LINE>ByteBuffer frame = ByteBuffer.wrap(buff);<NEW_LINE>// Advance past version, flags, seqid<NEW_LINE>frame.position(10);<NEW_LINE>headerSize = headerSize * 4;<NEW_LINE>int endHeader = headerSize + frame.position();<NEW_LINE>if (headerSize > frame.remaining()) {<NEW_LINE>throw new TTransportException("Header size is larger than frame");<NEW_LINE>}<NEW_LINE>protoId = readVarint32Buf(frame);<NEW_LINE>int numTransforms = readVarint32Buf(frame);<NEW_LINE>// Clear out any previous transforms<NEW_LINE>readTransforms = new ArrayList<Integer>(numTransforms);<NEW_LINE>if (protoId == T_JSON_PROTOCOL && clientType != ClientTypes.HTTP) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Read in the headers. Data for each varies. See<NEW_LINE>// doc/HeaderFormat.txt<NEW_LINE>int hmacSz = 0;<NEW_LINE>for (int i = 0; i < numTransforms; i++) {<NEW_LINE>int transId = readVarint32Buf(frame);<NEW_LINE>if (transId == Transforms.ZLIB_TRANSFORM.getValue()) {<NEW_LINE>readTransforms.add(transId);<NEW_LINE>} else {<NEW_LINE>throw new THeaderException("Unknown transform during recv");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Read the info section.<NEW_LINE>readHeaders.clear();<NEW_LINE>while (frame.position() < endHeader) {<NEW_LINE>int infoId = readVarint32Buf(frame);<NEW_LINE>if (infoId == Infos.INFO_KEYVALUE.getValue()) {<NEW_LINE>int numKeys = readVarint32Buf(frame);<NEW_LINE>for (int i = 0; i < numKeys; i++) {<NEW_LINE>String key = readString(frame);<NEW_LINE>String value = readString(frame);<NEW_LINE>readHeaders.put(key, value);<NEW_LINE>}<NEW_LINE>} else if (infoId == Infos.INFO_PKEYVALUE.getValue()) {<NEW_LINE>int numKeys = readVarint32Buf(frame);<NEW_LINE>for (int i = 0; i < numKeys; i++) {<NEW_LINE>String key = readString(frame);<NEW_LINE>String value = readString(frame);<NEW_LINE>readPersistentHeaders.put(key, value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Unknown info ID, continue on to reading data.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>readHeaders.remove(CLIENT_METADATA_HEADER);<NEW_LINE>readHeaders.putAll(readPersistentHeaders);<NEW_LINE>// Read in the data section.<NEW_LINE>frame.position(endHeader);<NEW_LINE>// limit to data without mac<NEW_LINE>frame.limit(frame.limit() - hmacSz);<NEW_LINE>frame = untransform(frame);<NEW_LINE>readBuffer_.reset(frame.array(), frame.position(), frame.remaining());<NEW_LINE>} | throw new TTransportException("Trying to recv JSON encoding " + "over binary"); |
1,343,676 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see<NEW_LINE>* com.amazonaws.services.s3.AmazonS3#deleteObjects(com.amazonaws.services<NEW_LINE>* .s3.model.DeleteObjectsRequest)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public DeleteObjectsResult deleteObjects(DeleteObjectsRequest deleteObjectsRequest) {<NEW_LINE>final Request<DeleteObjectsRequest> request = createRequest(deleteObjectsRequest.getBucketName(), null, deleteObjectsRequest, HttpMethodName.POST);<NEW_LINE>request.addParameter("delete", null);<NEW_LINE>if (deleteObjectsRequest.getMfa() != null) {<NEW_LINE>populateRequestWithMfaDetails(request, deleteObjectsRequest.getMfa());<NEW_LINE>}<NEW_LINE>populateRequesterPaysHeader(request, deleteObjectsRequest.isRequesterPays());<NEW_LINE>final byte[] content = new MultiObjectDeleteXmlFactory().convertToXmlByteArray(deleteObjectsRequest);<NEW_LINE>request.addHeader("Content-Length", String.valueOf(content.length));<NEW_LINE><MASK><NEW_LINE>request.setContent(new ByteArrayInputStream(content));<NEW_LINE>try {<NEW_LINE>final byte[] md5 = Md5Utils.computeMD5Hash(content);<NEW_LINE>final String md5Base64 = BinaryUtils.toBase64(md5);<NEW_LINE>request.addHeader("Content-MD5", md5Base64);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throw new AmazonClientException("Couldn't compute md5 sum", e);<NEW_LINE>}<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final ResponseHeaderHandlerChain<DeleteObjectsResponse> responseHandler = new ResponseHeaderHandlerChain<DeleteObjectsResponse>(new Unmarshallers.DeleteObjectsResultUnmarshaller(), new S3RequesterChargedHeaderHandler<DeleteObjectsResponse>());<NEW_LINE>final DeleteObjectsResponse response = invoke(request, responseHandler, deleteObjectsRequest.getBucketName(), null);<NEW_LINE>if (!response.getErrors().isEmpty()) {<NEW_LINE>final Map<String, String> headers = responseHandler.getResponseHeaders();<NEW_LINE>final MultiObjectDeleteException ex = new MultiObjectDeleteException(response.getErrors(), response.getDeletedObjects());<NEW_LINE>ex.setStatusCode(200);<NEW_LINE>ex.setRequestId(headers.get(Headers.REQUEST_ID));<NEW_LINE>ex.setExtendedRequestId(headers.get(Headers.EXTENDED_REQUEST_ID));<NEW_LINE>ex.setCloudFrontId(headers.get(Headers.CLOUD_FRONT_ID));<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>final DeleteObjectsResult result = new DeleteObjectsResult(response.getDeletedObjects(), response.isRequesterCharged());<NEW_LINE>return result;<NEW_LINE>} | request.addHeader("Content-Type", "application/xml"); |
114,810 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// authentication with an API key or named user is required to access basemaps and other<NEW_LINE>// location services<NEW_LINE>ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);<NEW_LINE>// inflate MapView from layout<NEW_LINE>mMapView = findViewById(R.id.mapView);<NEW_LINE>// create a map with the BasemapType topographic<NEW_LINE>ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_TOPOGRAPHIC);<NEW_LINE>// set the map to be displayed in this view<NEW_LINE>mMapView.setMap(map);<NEW_LINE>// set an initial viewpoint<NEW_LINE>Point point = new Point(-11662054, 4818336, SpatialReference.create(3857));<NEW_LINE>Viewpoint viewpoint <MASK><NEW_LINE>mMapView.setViewpoint(viewpoint);<NEW_LINE>// create a shapefile feature table from the local data<NEW_LINE>ShapefileFeatureTable shapefileFeatureTable = new ShapefileFeatureTable(getExternalFilesDir(null) + getString(R.string.subdivisions_shp));<NEW_LINE>// use the shapefile feature table to create a feature layer<NEW_LINE>FeatureLayer featureLayer = new FeatureLayer(shapefileFeatureTable);<NEW_LINE>// create the Symbol<NEW_LINE>SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, Color.RED, 1.0f);<NEW_LINE>SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, Color.YELLOW, lineSymbol);<NEW_LINE>// create the Renderer<NEW_LINE>SimpleRenderer renderer = new SimpleRenderer(fillSymbol);<NEW_LINE>// set the Renderer on the Layer<NEW_LINE>featureLayer.setRenderer(renderer);<NEW_LINE>// add the feature layer to the map<NEW_LINE>map.getOperationalLayers().add(featureLayer);<NEW_LINE>} | = new Viewpoint(point, 200000); |
50,036 | public final NumberContext number() throws RecognitionException {<NEW_LINE>NumberContext _localctx = new NumberContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 60, RULE_number);<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(477);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case NUMBER:<NEW_LINE>{<NEW_LINE>setState(471);<NEW_LINE><MASK><NEW_LINE>_localctx.n = Long.parseLong(_localctx.num.getText(), 10);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case BIN_NUMBER:<NEW_LINE>{<NEW_LINE>setState(473);<NEW_LINE>_localctx.num = match(BIN_NUMBER);<NEW_LINE>_localctx.n = Long.parseLong(_localctx.num.getText().substring(2), 2);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case HEX_NUMBER:<NEW_LINE>{<NEW_LINE>setState(475);<NEW_LINE>_localctx.num = match(HEX_NUMBER);<NEW_LINE>_localctx.n = Long.parseLong(_localctx.num.getText().substring(2), 16);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _localctx.num = match(NUMBER); |
904,100 | protected void editorCreated(@Nonnull EditorFactoryEvent event) {<NEW_LINE>final Editor editor = event.getEditor();<NEW_LINE>if ((editor.getProject() != null && editor.getProject() != myProject) || myProject.isDisposedOrDisposeInProgress()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final PsiFile psiFile = PsiDocumentManager.getInstance(myProject).getPsiFile(editor.getDocument());<NEW_LINE>if (psiFile == null)<NEW_LINE>return;<NEW_LINE>final <MASK><NEW_LINE>final JComponent contentComponent = editor.getContentComponent();<NEW_LINE>final PropertyChangeListener propertyChangeListener = evt -> {<NEW_LINE>if (evt.getOldValue() == null && evt.getNewValue() != null) {<NEW_LINE>registerEditor(editor);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>component.addPropertyChangeListener("ancestor", propertyChangeListener);<NEW_LINE>FocusListener focusListener = new FocusListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusGained(@Nonnull FocusEvent e) {<NEW_LINE>ApplicationManager.getApplication().assertIsDispatchThread();<NEW_LINE>Window window = myEditorToWindowMap.get(editor);<NEW_LINE>if (window == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Editor> list = myWindowToEditorsMap.get(window);<NEW_LINE>int index = list.indexOf(editor);<NEW_LINE>LOG.assertTrue(index >= 0);<NEW_LINE>if (list.isEmpty())<NEW_LINE>return;<NEW_LINE>for (int i = index - 1; i >= 0; i--) {<NEW_LINE>list.set(i + 1, list.get(i));<NEW_LINE>}<NEW_LINE>list.set(0, editor);<NEW_LINE>setActiveWindow(window);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void focusLost(@Nonnull FocusEvent e) {<NEW_LINE>}<NEW_LINE>};<NEW_LINE>contentComponent.addFocusListener(focusListener);<NEW_LINE>myExecuteOnEditorRelease.put(event.getEditor(), () -> {<NEW_LINE>component.removePropertyChangeListener("ancestor", propertyChangeListener);<NEW_LINE>contentComponent.removeFocusListener(focusListener);<NEW_LINE>});<NEW_LINE>} | JComponent component = editor.getComponent(); |
825,255 | void syncByMaster(TextSync textSync) {<NEW_LINE>beforeDocumentModification();<NEW_LINE>ignoreDocModifications++;<NEW_LINE>boolean oldTM = DocumentUtilities.isTypingModification(doc);<NEW_LINE>DocumentUtilities.setTypingModification(doc, false);<NEW_LINE>try {<NEW_LINE>TextRegion<?> masterRegion = textSync.validMasterRegion();<NEW_LINE>CharSequence docText = DocumentUtilities.getText(doc);<NEW_LINE>CharSequence masterRegionText = docText.subSequence(masterRegion.startOffset(<MASK><NEW_LINE>String masterRegionString = null;<NEW_LINE>for (TextRegion<?> region : textSync.regionsModifiable()) {<NEW_LINE>if (region == masterRegion)<NEW_LINE>continue;<NEW_LINE>int regionStartOffset = region.startOffset();<NEW_LINE>int regionEndOffset = region.endOffset();<NEW_LINE>CharSequence regionText = docText.subSequence(regionStartOffset, regionEndOffset);<NEW_LINE>if (!CharSequenceUtilities.textEquals(masterRegionText, regionText)) {<NEW_LINE>// Must re-insert<NEW_LINE>if (masterRegionString == null)<NEW_LINE>masterRegionString = masterRegionText.toString();<NEW_LINE>doc.remove(regionStartOffset, regionEndOffset - regionStartOffset);<NEW_LINE>doc.insertString(regionStartOffset, masterRegionString, null);<NEW_LINE>fixRegionStartOffset(region, regionStartOffset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.WARNING, "Invalid offset", e);<NEW_LINE>} finally {<NEW_LINE>DocumentUtilities.setTypingModification(doc, oldTM);<NEW_LINE>assert (ignoreDocModifications > 0);<NEW_LINE>ignoreDocModifications--;<NEW_LINE>afterDocumentModification();<NEW_LINE>}<NEW_LINE>updateMasterRegionBounds();<NEW_LINE>} | ), masterRegion.endOffset()); |
907,921 | /*<NEW_LINE>* TODO: Refactor to do one query to get rid and srckey from bootstrap_seeder_state<NEW_LINE>*/<NEW_LINE>public String geSrcKeyFromCheckpoint(OracleTriggerMonitoredSourceInfo sourceInfo) {<NEW_LINE>Connection conn = null;<NEW_LINE>PreparedStatement stmt = null;<NEW_LINE>ResultSet row = null;<NEW_LINE>String srcKey = null;<NEW_LINE>try {<NEW_LINE>StringBuilder sql = new StringBuilder();<NEW_LINE>sql.append("select srckey from bootstrap_seeder_state ");<NEW_LINE>sql.append("where srcid = ?");<NEW_LINE>conn = getConnection();<NEW_LINE>stmt = conn.prepareStatement(sql.toString());<NEW_LINE>stmt.setInt(1, sourceInfo.getSourceId());<NEW_LINE>row = stmt.executeQuery();<NEW_LINE>if (row.next()) {<NEW_LINE>srcKey = row.getString(1);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>DBHelper.close(row, stmt, null);<NEW_LINE>}<NEW_LINE>return srcKey;<NEW_LINE>} | LOG.error("Got exception while trying to fetch the srckey from bootstrap_seeder_state !!", e); |
205,353 | protected void deleteOtherEventsRelatedToEventBasedGateway(DelegateExecution execution, EventGateway eventGateway) {<NEW_LINE>// To clean up the other events behind the event based gateway, we must gather the<NEW_LINE>// activity ids of said events and check the _sibling_ executions of the incoming execution.<NEW_LINE>// Note that it can happen that there are multiple such execution in those activity ids,<NEW_LINE>// (for example a parallel gw going twice to the event based gateway, kinda silly, but valid)<NEW_LINE>// so we only take _one_ result of such a query for deletion.<NEW_LINE>// Gather all activity ids for the events after the event based gateway that need to be destroyed<NEW_LINE>List<SequenceFlow> outgoingSequenceFlows = eventGateway.getOutgoingFlows();<NEW_LINE>// -1, the event being triggered does not need to be deleted<NEW_LINE>Set<String> eventActivityIds = new HashSet<String>(outgoingSequenceFlows.size() - 1);<NEW_LINE>for (SequenceFlow outgoingSequenceFlow : outgoingSequenceFlows) {<NEW_LINE>if (outgoingSequenceFlow.getTargetFlowElement() != null && !outgoingSequenceFlow.getTargetFlowElement().getId().equals(execution.getCurrentActivityId())) {<NEW_LINE>eventActivityIds.add(outgoingSequenceFlow.getTargetFlowElement().getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CommandContext commandContext = Context.getCommandContext();<NEW_LINE>ExecutionEntityManager executionEntityManager = commandContext.getExecutionEntityManager();<NEW_LINE>// Find the executions<NEW_LINE>List<ExecutionEntity> executionEntities = executionEntityManager.findExecutionsByParentExecutionAndActivityIds(execution.getParentId(), eventActivityIds);<NEW_LINE>// Execute the cancel behaviour of the IntermediateCatchEvent<NEW_LINE>for (ExecutionEntity executionEntity : executionEntities) {<NEW_LINE>if (eventActivityIds.contains(executionEntity.getActivityId()) && execution.getCurrentFlowElement() instanceof IntermediateCatchEvent) {<NEW_LINE>IntermediateCatchEvent intermediateCatchEvent = (IntermediateCatchEvent) execution.getCurrentFlowElement();<NEW_LINE>if (intermediateCatchEvent.getBehavior() instanceof IntermediateCatchEventActivityBehavior) {<NEW_LINE>((IntermediateCatchEventActivityBehavior) intermediateCatchEvent.getBehavior<MASK><NEW_LINE>// We only need to delete ONE execution at the event.<NEW_LINE>eventActivityIds.remove(executionEntity.getActivityId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ()).eventCancelledByEventGateway(executionEntity); |
927,811 | protected void generateSampleSeries(DashboardContainer container, TimeSeriesCollection dataset) {<NEW_LINE>TimeSeries seriesSin = new TimeSeries("Sin");<NEW_LINE>long startTime = System.currentTimeMillis() <MASK><NEW_LINE>for (int i = 0; i < 100; i++) {<NEW_LINE>seriesSin.add(new TimeSeriesDataItem(new FixedMillisecond(startTime + i * 60 * 1000), Math.sin(0.1 * i) * 100));<NEW_LINE>}<NEW_LINE>dataset.addSeries(seriesSin);<NEW_LINE>TimeSeries seriesCos = new TimeSeries("Cos");<NEW_LINE>for (int i = 0; i < 100; i++) {<NEW_LINE>seriesCos.add(new TimeSeriesDataItem(new FixedMillisecond(startTime + i * 60 * 1000), Math.cos(0.1 * i) * 100));<NEW_LINE>}<NEW_LINE>dataset.addSeries(seriesCos);<NEW_LINE>} | - 1000 * 60 * 60 * 2; |
995,475 | public void onClick(View v) {<NEW_LINE>if (clickListener != null) {<NEW_LINE>clickListener.onClick(v);<NEW_LINE>}<NEW_LINE>// using 8dip on axisX offset to make dropdown view visually be at start of dropdown itself<NEW_LINE>// using 4dip on axisY offset to make space between dropdown view and dropdown itself<NEW_LINE>// all offsets are necessary because of the dialog_holo_light_frame to display correctly on screen(shadow was made by inset)<NEW_LINE>int gravity;<NEW_LINE>int axisXOffset;<NEW_LINE>if (dropDownViewWidth + getX() > screenWidth) {<NEW_LINE>gravity = Gravity.TOP | Gravity.END;<NEW_LINE>axisXOffset = DimenUtils.dpToPixels(8);<NEW_LINE>} else {<NEW_LINE>gravity = Gravity.TOP | Gravity.START;<NEW_LINE>axisXOffset <MASK><NEW_LINE>}<NEW_LINE>int axisYOffset = DimenUtils.dpToPixels(4);<NEW_LINE>switch(expandDirection) {<NEW_LINE>case UP:<NEW_LINE>PopupWindowCompat.showAsDropDown(dropdownWindow, v, axisXOffset, -dropDownViewHeight - getMeasuredHeight() - axisYOffset * 3, gravity);<NEW_LINE>break;<NEW_LINE>case DOWN:<NEW_LINE>PopupWindowCompat.showAsDropDown(dropdownWindow, v, axisXOffset, -axisYOffset, gravity);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>setSelected(true);<NEW_LINE>} | = -DimenUtils.dpToPixels(8); |
992,483 | private static void sortSam(final File input, final File output, final File reference, final ValidationStringency stringency) {<NEW_LINE>final SortSam sort = new SortSam();<NEW_LINE>// We can't use ArgumentsBuilder since it assumes GATK argument names, but we're running a Picard<NEW_LINE>// tool, which uses upper case argument names.<NEW_LINE>final List<String> args = new ArrayList<>(6);<NEW_LINE>args.add("-I");<NEW_LINE>args.add(input.getAbsolutePath());<NEW_LINE>args.add("-O");<NEW_LINE>args.add(output.getAbsolutePath());<NEW_LINE>args.add("-SO");<NEW_LINE>args.add(SAMFileHeader.SortOrder.coordinate.name());<NEW_LINE>args.add("--VALIDATION_STRINGENCY");<NEW_LINE>args.add(stringency.name());<NEW_LINE>if (reference != null) {<NEW_LINE>args.add("--REFERENCE_SEQUENCE");<NEW_LINE>args.<MASK><NEW_LINE>}<NEW_LINE>int returnCode = sort.instanceMain(args.toArray(new String[0]));<NEW_LINE>if (returnCode != 0) {<NEW_LINE>throw new RuntimeException("Failure running SortSam on inputs");<NEW_LINE>}<NEW_LINE>} | add(reference.getAbsolutePath()); |
1,735,151 | public void testFlowableRxInvoker_get1(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>final String threadName = "jaxrs21Thread";<NEW_LINE>ThreadFactory jaxrs21ThreadFactory = Executors.defaultThreadFactory();<NEW_LINE>Thread jaxrs21Thread = jaxrs21ThreadFactory.newThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String runThreadName = Thread.currentThread().getName();<NEW_LINE>if (!(runThreadName.equals(threadName))) {<NEW_LINE>throw new RuntimeException("testFlowableRxInvoker_get1: incorrect thread name");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jaxrs21Thread.setName(threadName);<NEW_LINE>ExecutorService executorService = Executors.newSingleThreadExecutor(jaxrs21ThreadFactory);<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder().executorService(executorService);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(FlowableRxInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/rxget1");<NEW_LINE>Builder builder = t.request();<NEW_LINE>Flowable<Response> flowable = builder.rx(FlowableRxInvoker.class<MASK><NEW_LINE>final Holder<Response> holder = new Holder<Response>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>flowable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, throwable -> {<NEW_LINE>// OnError<NEW_LINE>throw new RuntimeException("testFlowableRxInvoker_get1: onError " + throwable.getStackTrace());<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(basicTimeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testFlowableRxInvoker_get1: Response took too long. Waited " + basicTimeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>ret.append(holder.value.readEntity(String.class));<NEW_LINE>c.close();<NEW_LINE>} | ).get(Response.class); |
774,795 | private Collection<BPartnerId> extractBPartnerIds(@NonNull final TableRecordReference recordRef) {<NEW_LINE>final ImmutableList<BPartnerId> result;<NEW_LINE>if (I_C_BPartner.Table_Name.equals(recordRef.getTableName())) {<NEW_LINE>result = ImmutableList.of(BPartnerId.ofRepoId(recordRef.getRecord_ID()));<NEW_LINE>} else if (I_C_BPartner_Location.Table_Name.equals(recordRef.getTableName())) {<NEW_LINE>final I_C_BPartner_Location bpartnerLocationRecord = recordRef.getModel(I_C_BPartner_Location.class);<NEW_LINE>if (// can happen while we are in the process of storing a bpartner with locations and contacts<NEW_LINE>bpartnerLocationRecord == null) {<NEW_LINE>result = ImmutableList.of();<NEW_LINE>} else {<NEW_LINE>result = ImmutableList.of(BPartnerId.ofRepoId(bpartnerLocationRecord.getC_BPartner_ID()));<NEW_LINE>}<NEW_LINE>} else if (I_AD_User.Table_Name.equals(recordRef.getTableName())) {<NEW_LINE>final I_AD_User userRecord = recordRef.getModel(I_AD_User.class);<NEW_LINE>result = extractBPartnerIds(userRecord);<NEW_LINE>} else if (I_C_User_Assigned_Role.Table_Name.equals(recordRef.getTableName())) {<NEW_LINE>final I_C_User_Assigned_Role userRoleRecord = <MASK><NEW_LINE>if (// can happen while we are in the process of storing a bpartner with locations and contacts<NEW_LINE>userRoleRecord == null) {<NEW_LINE>result = ImmutableList.of();<NEW_LINE>} else {<NEW_LINE>final I_AD_User userRecord = userDAO.getById(UserId.ofRepoId(userRoleRecord.getAD_User_ID()));<NEW_LINE>result = extractBPartnerIds(userRecord);<NEW_LINE>}<NEW_LINE>} else if (I_C_User_Role.Table_Name.equals(recordRef.getTableName())) {<NEW_LINE>// isResetAll returned true<NEW_LINE>result = ImmutableList.of();<NEW_LINE>} else {<NEW_LINE>throw new AdempiereException("Given recordRef has unexpected tableName=" + recordRef.getTableName() + "; recordRef=" + recordRef);<NEW_LINE>}<NEW_LINE>logger.debug("extractBPartnerIds for recordRef={} returns result={}", recordRef, result);<NEW_LINE>return result;<NEW_LINE>} | recordRef.getModel(I_C_User_Assigned_Role.class); |
886,719 | public ODeleteExecutionPlan createExecutionPlan(OCommandContext ctx, boolean enableProfiling) {<NEW_LINE>ODeleteExecutionPlan result = new ODeleteExecutionPlan(ctx);<NEW_LINE>if (handleIndexAsTarget(result, fromClause.getItem().getIndex(), whereClause, ctx)) {<NEW_LINE>if (limit != null) {<NEW_LINE>throw new OCommandExecutionException("Cannot apply a LIMIT on a delete from index");<NEW_LINE>}<NEW_LINE>if (returnBefore) {<NEW_LINE>throw new OCommandExecutionException("Cannot apply a RETURN BEFORE on a delete from index");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>handleTarget(result, ctx, this.fromClause, this.whereClause, enableProfiling);<NEW_LINE>handleLimit(result, ctx, this.limit, enableProfiling);<NEW_LINE>}<NEW_LINE>handleCastToVertex(result, ctx, enableProfiling);<NEW_LINE><MASK><NEW_LINE>handleReturn(result, ctx, this.returnBefore, enableProfiling);<NEW_LINE>return result;<NEW_LINE>} | handleDelete(result, ctx, enableProfiling); |
408,358 | private void processPersonalBlockChanges() {<NEW_LINE>if (blockChanges.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// separate messages by chunk<NEW_LINE>// inner map is used to only send one entry for same coordinates<NEW_LINE>Map<Key, Map<BlockVector, BlockChangeMessage>> chunks = new HashMap<>();<NEW_LINE>BlockChangeMessage message;<NEW_LINE>while ((message = blockChanges.poll()) != null) {<NEW_LINE>Key key = GlowChunk.Key.of(message.getX() >> 4, message.getZ() >> 4);<NEW_LINE>if (canSeeChunk(key)) {<NEW_LINE>Map<BlockVector, BlockChangeMessage> map = chunks.computeIfAbsent(key, k -> new HashMap<>());<NEW_LINE>map.put(new BlockVector(message.getX(), message.getY(), message.getZ()), message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// send away<NEW_LINE>for (Map.Entry<Key, Map<BlockVector, BlockChangeMessage>> entry : chunks.entrySet()) {<NEW_LINE>Key key = entry.getKey();<NEW_LINE>List<BlockChangeMessage> value = new ArrayList<>(entry.getValue().values());<NEW_LINE>if (value.size() == 1) {<NEW_LINE>session.send(value.get(0));<NEW_LINE>} else if (value.size() > 1) {<NEW_LINE>session.send(new MultiBlockChangeMessage(key.getX(), key<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getZ(), value)); |
757,247 | public BatchScheduleActionDeleteRequest unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BatchScheduleActionDeleteRequest batchScheduleActionDeleteRequest = new BatchScheduleActionDeleteRequest();<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>if (context.testExpression("actionNames", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchScheduleActionDeleteRequest.setActionNames(new ListUnmarshaller<String>(context.getUnmarshaller(String.class<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 batchScheduleActionDeleteRequest;<NEW_LINE>} | )).unmarshall(context)); |
144,384 | public boolean execute(Object object) throws ContractExeException {<NEW_LINE>TransactionResultCapsule ret = (TransactionResultCapsule) object;<NEW_LINE>if (Objects.isNull(ret)) {<NEW_LINE>throw new RuntimeException(ActuatorConstant.TX_RESULT_NULL);<NEW_LINE>}<NEW_LINE>long fee = calcFee();<NEW_LINE>AccountStore accountStore = chainBaseManager.getAccountStore();<NEW_LINE>DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();<NEW_LINE>ExchangeStore exchangeStore = chainBaseManager.getExchangeStore();<NEW_LINE>ExchangeV2Store exchangeV2Store = chainBaseManager.getExchangeV2Store();<NEW_LINE>AssetIssueStore assetIssueStore = chainBaseManager.getAssetIssueStore();<NEW_LINE>try {<NEW_LINE>final ExchangeTransactionContract exchangeTransactionContract = this.any.unpack(ExchangeTransactionContract.class);<NEW_LINE>AccountCapsule accountCapsule = accountStore.get(exchangeTransactionContract.getOwnerAddress().toByteArray());<NEW_LINE>ExchangeCapsule exchangeCapsule = Commons.getExchangeStoreFinal(dynamicStore, exchangeStore, exchangeV2Store).get(ByteArray.fromLong(exchangeTransactionContract.getExchangeId()));<NEW_LINE>byte[] firstTokenID = exchangeCapsule.getFirstTokenId();<NEW_LINE>byte[] secondTokenID = exchangeCapsule.getSecondTokenId();<NEW_LINE>byte[] tokenID = exchangeTransactionContract.getTokenId().toByteArray();<NEW_LINE>long tokenQuant = exchangeTransactionContract.getQuant();<NEW_LINE>byte[] anotherTokenID;<NEW_LINE>long anotherTokenQuant = exchangeCapsule.transaction(tokenID, tokenQuant);<NEW_LINE>if (Arrays.equals(tokenID, firstTokenID)) {<NEW_LINE>anotherTokenID = secondTokenID;<NEW_LINE>} else {<NEW_LINE>anotherTokenID = firstTokenID;<NEW_LINE>}<NEW_LINE>long newBalance = accountCapsule.getBalance() - calcFee();<NEW_LINE>accountCapsule.setBalance(newBalance);<NEW_LINE>if (Arrays.equals(tokenID, TRX_SYMBOL_BYTES)) {<NEW_LINE>accountCapsule.setBalance(newBalance - tokenQuant);<NEW_LINE>} else {<NEW_LINE>accountCapsule.reduceAssetAmountV2(<MASK><NEW_LINE>}<NEW_LINE>if (Arrays.equals(anotherTokenID, TRX_SYMBOL_BYTES)) {<NEW_LINE>accountCapsule.setBalance(newBalance + anotherTokenQuant);<NEW_LINE>} else {<NEW_LINE>accountCapsule.addAssetAmountV2(anotherTokenID, anotherTokenQuant, dynamicStore, assetIssueStore);<NEW_LINE>}<NEW_LINE>accountStore.put(accountCapsule.createDbKey(), accountCapsule);<NEW_LINE>Commons.putExchangeCapsule(exchangeCapsule, dynamicStore, exchangeStore, exchangeV2Store, assetIssueStore);<NEW_LINE>ret.setExchangeReceivedAmount(anotherTokenQuant);<NEW_LINE>ret.setStatus(fee, code.SUCESS);<NEW_LINE>} catch (ItemNotFoundException | InvalidProtocolBufferException e) {<NEW_LINE>logger.debug(e.getMessage(), e);<NEW_LINE>ret.setStatus(fee, code.FAILED);<NEW_LINE>throw new ContractExeException(e.getMessage());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | tokenID, tokenQuant, dynamicStore, assetIssueStore); |
105,307 | public void addSchema(NamedReader reader) {<NEW_LINE>if (properties.featureFlags().experimentalSdParsing()) {<NEW_LINE>try {<NEW_LINE>var parsedName = mediator.addSchemaFromReader(reader);<NEW_LINE>addRankProfileFiles(parsedName);<NEW_LINE>} catch (ParseException e) {<NEW_LINE>throw new IllegalArgumentException("Could not parse schema file '" + reader.getName() + "'", e);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Schema schema = createSchema<MASK><NEW_LINE>add(schema);<NEW_LINE>String schemaName = schema.getName();<NEW_LINE>String schemaFileName = stripSuffix(reader.getName(), ApplicationPackage.SD_NAME_SUFFIX);<NEW_LINE>if (!schemaFileName.equals(schemaName)) {<NEW_LINE>throw new IllegalArgumentException("The file containing schema '" + schemaName + "' must be named '" + schemaName + ApplicationPackage.SD_NAME_SUFFIX + "', not " + reader.getName());<NEW_LINE>}<NEW_LINE>} catch (ParseException e) {<NEW_LINE>throw new IllegalArgumentException("Could not parse schema file '" + reader.getName() + "'", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalArgumentException("Could not read schema file '" + reader.getName() + "'", e);<NEW_LINE>} finally {<NEW_LINE>closeIgnoreException(reader.getReader());<NEW_LINE>}<NEW_LINE>} | (IOUtils.readAll(reader)); |
671,446 | final CreateNetworkProfileResult executeCreateNetworkProfile(CreateNetworkProfileRequest createNetworkProfileRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createNetworkProfileRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateNetworkProfileRequest> request = null;<NEW_LINE>Response<CreateNetworkProfileResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateNetworkProfileRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createNetworkProfileRequest));<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, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNetworkProfile");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateNetworkProfileResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new CreateNetworkProfileResultJsonUnmarshaller()); |
1,449,932 | private static MapModelCriteriaBuilder<Object, MapClientEntity, ClientModel> checkClientAttributes(MapModelCriteriaBuilder<Object, MapClientEntity, ClientModel> mcb, Operator op, Object[] values) {<NEW_LINE>if (values == null || values.length != 2) {<NEW_LINE>throw new CriterionNotSupportedException(ClientModel.SearchableFields.ATTRIBUTE, op, "Invalid arguments, expected attribute_name-value pair, got: " + Arrays.toString(values));<NEW_LINE>}<NEW_LINE>final Object attrName = values[0];<NEW_LINE>if (!(attrName instanceof String)) {<NEW_LINE>throw new CriterionNotSupportedException(ClientModel.SearchableFields.ATTRIBUTE, op, "Invalid arguments, expected (String attribute_name), got: " <MASK><NEW_LINE>}<NEW_LINE>String attrNameS = (String) attrName;<NEW_LINE>Object[] realValues = new Object[values.length - 1];<NEW_LINE>System.arraycopy(values, 1, realValues, 0, values.length - 1);<NEW_LINE>Predicate<Object> valueComparator = CriteriaOperator.predicateFor(op, realValues);<NEW_LINE>Function<MapClientEntity, ?> getter = ue -> {<NEW_LINE>final List<String> attrs = ue.getAttribute(attrNameS);<NEW_LINE>return attrs != null && attrs.stream().anyMatch(valueComparator);<NEW_LINE>};<NEW_LINE>return mcb.fieldCompare(Boolean.TRUE::equals, getter);<NEW_LINE>} | + Arrays.toString(values)); |
782,214 | private void loadNode318() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.FileDirectoryType_FileDirectoryName_Placeholder_CreateDirectory_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.FileDirectoryType_FileDirectoryName_Placeholder_CreateDirectory_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.FileDirectoryType_FileDirectoryName_Placeholder_CreateDirectory_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.FileDirectoryType_FileDirectoryName_Placeholder_CreateDirectory_InputArguments, Identifiers.HasProperty, Identifiers.FileDirectoryType_FileDirectoryName_Placeholder_CreateDirectory.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>DirectoryName</Name><DataType><Identifier>i=12</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).<MASK><NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | setInput(new StringReader(xml)); |
328,503 | protected void readObjStm(PRStream stream, IntHashtable map) throws IOException {<NEW_LINE>int first = stream.getAsNumber(PdfName.FIRST).intValue();<NEW_LINE>int n = stream.getAsNumber(<MASK><NEW_LINE>byte[] b = getStreamBytes(stream, tokens.getFile());<NEW_LINE>PRTokeniser saveTokens = tokens;<NEW_LINE>tokens = new PRTokeniser(b);<NEW_LINE>try {<NEW_LINE>int[] address = new int[n];<NEW_LINE>int[] objNumber = new int[n];<NEW_LINE>boolean ok = true;<NEW_LINE>for (int k = 0; k < n; ++k) {<NEW_LINE>ok = tokens.nextToken();<NEW_LINE>if (!ok)<NEW_LINE>break;<NEW_LINE>if (tokens.getTokenType() != PRTokeniser.TK_NUMBER) {<NEW_LINE>ok = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>objNumber[k] = tokens.intValue();<NEW_LINE>ok = tokens.nextToken();<NEW_LINE>if (!ok)<NEW_LINE>break;<NEW_LINE>if (tokens.getTokenType() != PRTokeniser.TK_NUMBER) {<NEW_LINE>ok = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>address[k] = tokens.intValue() + first;<NEW_LINE>}<NEW_LINE>if (!ok)<NEW_LINE>throw new InvalidPdfException(MessageLocalization.getComposedMessage("error.reading.objstm"));<NEW_LINE>for (int k = 0; k < n; ++k) {<NEW_LINE>if (map.containsKey(k)) {<NEW_LINE>tokens.seek(address[k]);<NEW_LINE>PdfObject obj = readPRObject();<NEW_LINE>xrefObj.set(objNumber[k], obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>tokens = saveTokens;<NEW_LINE>}<NEW_LINE>} | PdfName.N).intValue(); |
1,672,990 | final UpdateDocumentationPartResult executeUpdateDocumentationPart(UpdateDocumentationPartRequest updateDocumentationPartRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDocumentationPartRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDocumentationPartRequest> request = null;<NEW_LINE>Response<UpdateDocumentationPartResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDocumentationPartRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDocumentationPartRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDocumentationPart");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDocumentationPartResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDocumentationPartResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,253,757 | protected void close(final boolean hasFailed) {<NEW_LINE>try {<NEW_LINE>if (!hasFailed) {<NEW_LINE>LOGGER.info("Migration finished with no explicit errors. Copying data from tmp tables to permanent");<NEW_LINE>writeConfigs.values().forEach(mongodbWriteConfig -> Exceptions.toRuntime(() -> {<NEW_LINE>try {<NEW_LINE>copyTable(mongoDatabase, mongodbWriteConfig.getCollectionName(), mongodbWriteConfig.getTmpCollectionName());<NEW_LINE>} catch (final RuntimeException e) {<NEW_LINE>LOGGER.error("Failed to process a message for Streams numbers: {}, SyncMode: {}, CollectionName: {}, TmpCollectionName: {}", catalog.getStreams().size(), mongodbWriteConfig.getSyncMode(), mongodbWriteConfig.getCollectionName(), mongodbWriteConfig.getTmpCollectionName());<NEW_LINE>LOGGER.error("Failed with exception: {}", e.getMessage());<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>outputRecordCollector.accept(lastStateMessage);<NEW_LINE>} else {<NEW_LINE>LOGGER.error("Had errors while migrations");<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>LOGGER.info("Removing tmp collections...");<NEW_LINE>writeConfigs.values().forEach(mongodbWriteConfig -> mongoDatabase.getCollection(mongodbWriteConfig.getTmpCollectionName<MASK><NEW_LINE>LOGGER.info("Finishing destination process...completed");<NEW_LINE>}<NEW_LINE>} | ()).drop()); |
1,290,638 | public static ListClusterResponse unmarshall(ListClusterResponse listClusterResponse, UnmarshallerContext _ctx) {<NEW_LINE>listClusterResponse.setRequestId(_ctx.stringValue("ListClusterResponse.RequestId"));<NEW_LINE>listClusterResponse.setCode(_ctx.integerValue("ListClusterResponse.Code"));<NEW_LINE>listClusterResponse.setMessage(_ctx.stringValue("ListClusterResponse.Message"));<NEW_LINE>List<Cluster> clusterList = new ArrayList<Cluster>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListClusterResponse.ClusterList.Length"); i++) {<NEW_LINE>Cluster cluster = new Cluster();<NEW_LINE>cluster.setClusterId(_ctx.stringValue("ListClusterResponse.ClusterList[" + i + "].ClusterId"));<NEW_LINE>cluster.setRegionId(_ctx.stringValue("ListClusterResponse.ClusterList[" + i + "].RegionId"));<NEW_LINE>cluster.setDescription(_ctx.stringValue("ListClusterResponse.ClusterList[" + i + "].Description"));<NEW_LINE>cluster.setClusterName(_ctx.stringValue("ListClusterResponse.ClusterList[" + i + "].ClusterName"));<NEW_LINE>cluster.setClusterType(_ctx.integerValue("ListClusterResponse.ClusterList[" + i + "].ClusterType"));<NEW_LINE>cluster.setOversoldFactor(_ctx.integerValue("ListClusterResponse.ClusterList[" + i + "].OversoldFactor"));<NEW_LINE>cluster.setNetworkMode(_ctx.integerValue("ListClusterResponse.ClusterList[" + i + "].NetworkMode"));<NEW_LINE>cluster.setVpcId(_ctx.stringValue("ListClusterResponse.ClusterList[" + i + "].VpcId"));<NEW_LINE>cluster.setNodeNum(_ctx.integerValue("ListClusterResponse.ClusterList[" + i + "].NodeNum"));<NEW_LINE>cluster.setCpu(_ctx.integerValue("ListClusterResponse.ClusterList[" + i + "].Cpu"));<NEW_LINE>cluster.setMem(_ctx.integerValue<MASK><NEW_LINE>cluster.setCpuUsed(_ctx.integerValue("ListClusterResponse.ClusterList[" + i + "].CpuUsed"));<NEW_LINE>cluster.setMemUsed(_ctx.integerValue("ListClusterResponse.ClusterList[" + i + "].MemUsed"));<NEW_LINE>cluster.setCreateTime(_ctx.longValue("ListClusterResponse.ClusterList[" + i + "].CreateTime"));<NEW_LINE>cluster.setUpdateTime(_ctx.longValue("ListClusterResponse.ClusterList[" + i + "].UpdateTime"));<NEW_LINE>cluster.setIaasProvider(_ctx.stringValue("ListClusterResponse.ClusterList[" + i + "].IaasProvider"));<NEW_LINE>cluster.setCsClusterId(_ctx.stringValue("ListClusterResponse.ClusterList[" + i + "].CsClusterId"));<NEW_LINE>cluster.setResourceGroupId(_ctx.stringValue("ListClusterResponse.ClusterList[" + i + "].ResourceGroupId"));<NEW_LINE>clusterList.add(cluster);<NEW_LINE>}<NEW_LINE>listClusterResponse.setClusterList(clusterList);<NEW_LINE>return listClusterResponse;<NEW_LINE>} | ("ListClusterResponse.ClusterList[" + i + "].Mem")); |
1,767,976 | private TSStatus concludeFinalStatus(PhysicalPlan parentPlan, int totalRowNum, boolean noFailure, boolean isBatchRedirect, boolean isBatchFailure, TSStatus[] subStatus, List<String> errorCodePartitionGroups) {<NEW_LINE>if (parentPlan instanceof InsertMultiTabletPlan && !((InsertMultiTabletPlan) parentPlan).getResults().isEmpty()) {<NEW_LINE>if (subStatus == null) {<NEW_LINE>subStatus = new TSStatus[totalRowNum];<NEW_LINE>Arrays.fill(subStatus, RpcUtils.SUCCESS_STATUS);<NEW_LINE>}<NEW_LINE>noFailure = false;<NEW_LINE>isBatchFailure = true;<NEW_LINE>for (Map.Entry<Integer, TSStatus> integerTSStatusEntry : ((InsertMultiTabletPlan) parentPlan).getResults().entrySet()) {<NEW_LINE>subStatus[integerTSStatusEntry.getKey()] = integerTSStatusEntry.getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (parentPlan instanceof CreateMultiTimeSeriesPlan && !((CreateMultiTimeSeriesPlan) parentPlan).getResults().isEmpty()) {<NEW_LINE>if (subStatus == null) {<NEW_LINE>subStatus = new TSStatus[totalRowNum];<NEW_LINE>Arrays.fill(subStatus, RpcUtils.SUCCESS_STATUS);<NEW_LINE>}<NEW_LINE>noFailure = false;<NEW_LINE>isBatchFailure = true;<NEW_LINE>for (Map.Entry<Integer, TSStatus> integerTSStatusEntry : ((CreateMultiTimeSeriesPlan) parentPlan).getResults().entrySet()) {<NEW_LINE>subStatus[integerTSStatusEntry.getKey()] = integerTSStatusEntry.getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (parentPlan instanceof InsertRowsPlan && !((InsertRowsPlan) parentPlan).getResults().isEmpty()) {<NEW_LINE>if (subStatus == null) {<NEW_LINE>subStatus = new TSStatus[totalRowNum];<NEW_LINE>Arrays.fill(subStatus, RpcUtils.SUCCESS_STATUS);<NEW_LINE>}<NEW_LINE>noFailure = false;<NEW_LINE>isBatchFailure = true;<NEW_LINE>for (Map.Entry<Integer, TSStatus> integerTSStatusEntry : ((InsertRowsPlan) parentPlan).getResults().entrySet()) {<NEW_LINE>subStatus[integerTSStatusEntry.getKey()] = integerTSStatusEntry.getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TSStatus status;<NEW_LINE>if (noFailure) {<NEW_LINE>if (isBatchRedirect) {<NEW_LINE>status = RpcUtils.getStatus(Arrays.asList(subStatus));<NEW_LINE>status.setCode(TSStatusCode.NEED_REDIRECTION.getStatusCode());<NEW_LINE>} else {<NEW_LINE>status = StatusUtils.OK;<NEW_LINE>}<NEW_LINE>} else if (isBatchFailure) {<NEW_LINE>status = RpcUtils.getStatus<MASK><NEW_LINE>} else {<NEW_LINE>status = StatusUtils.getStatus(StatusUtils.EXECUTE_STATEMENT_ERROR, MSG_MULTIPLE_ERROR + errorCodePartitionGroups);<NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>} | (Arrays.asList(subStatus)); |
1,644,505 | final CreateCertificateFromCsrResult executeCreateCertificateFromCsr(CreateCertificateFromCsrRequest createCertificateFromCsrRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCertificateFromCsrRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCertificateFromCsrRequest> request = null;<NEW_LINE>Response<CreateCertificateFromCsrResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateCertificateFromCsrRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCertificateFromCsrRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCertificateFromCsr");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCertificateFromCsrResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCertificateFromCsrResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
86,411 | private byte[] createFlowControlPacket(Address member, Connection expectedConnection) throws IOException {<NEW_LINE>try (BufferObjectDataOutput output = createObjectDataOutput(nodeEngine, lastFlowPacketSize)) {<NEW_LINE>boolean hasData = false;<NEW_LINE>Map<Long, ExecutionContext> executionContexts = jobExecutionService.getExecutionContextsFor(member);<NEW_LINE>output.writeInt(executionContexts.size());<NEW_LINE>for (Entry<Long, ExecutionContext> executionIdAndCtx : executionContexts.entrySet()) {<NEW_LINE>output.writeLong(executionIdAndCtx.getKey());<NEW_LINE>// dest vertex id --> dest ordinal --> sender addr --> receiver tasklet<NEW_LINE>Map<Integer, Map<Integer, Map<Address, ReceiverTasklet>>> receiverMap = executionIdAndCtx.getValue().receiverMap();<NEW_LINE>output.writeInt(receiverMap.values().stream().mapToInt(Map::size).sum());<NEW_LINE>for (Entry<Integer, Map<Integer, Map<Address, ReceiverTasklet>>> e1 : receiverMap.entrySet()) {<NEW_LINE>int vertexId = e1.getKey();<NEW_LINE>Map<Integer, Map<Address, ReceiverTasklet><MASK><NEW_LINE>for (Entry<Integer, Map<Address, ReceiverTasklet>> e2 : ordinalToMemberToTasklet.entrySet()) {<NEW_LINE>int ordinal = e2.getKey();<NEW_LINE>Map<Address, ReceiverTasklet> memberToTasklet = e2.getValue();<NEW_LINE>output.writeInt(vertexId);<NEW_LINE>output.writeInt(ordinal);<NEW_LINE>ReceiverTasklet receiverTasklet = memberToTasklet.get(member);<NEW_LINE>output.writeInt(receiverTasklet.updateAndGetSendSeqLimitCompressed(expectedConnection));<NEW_LINE>hasData = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasData) {<NEW_LINE>byte[] payload = output.toByteArray();<NEW_LINE>lastFlowPacketSize = payload.length;<NEW_LINE>return payload;<NEW_LINE>} else {<NEW_LINE>return EMPTY_BYTES;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > ordinalToMemberToTasklet = e1.getValue(); |
842,219 | final UpdateProjectResult executeUpdateProject(UpdateProjectRequest updateProjectRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateProjectRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateProjectRequest> request = null;<NEW_LINE>Response<UpdateProjectResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateProjectRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateProjectRequest));<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, "IoT 1Click Projects");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateProject");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateProjectResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateProjectResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,048,373 | protected Tuple4<String[], String[], TypeInformation<?>[], String[]> prepareIoSchema(TableSchema modelSchema, TableSchema dataSchema, Params params) {<NEW_LINE>boolean isPredDetail = params.contains(KnnPredictParams.PREDICTION_DETAIL_COL);<NEW_LINE>TypeInformation<?> idType = modelSchema.getFieldTypes()[modelSchema.getFieldNames().length - 1];<NEW_LINE>String[] resultCols = isPredDetail ? new String[] { params.get(KnnPredictParams.PREDICTION_COL), params.get(KnnPredictParams.PREDICTION_DETAIL_COL) } : new String[] { params.get(KnnPredictParams.PREDICTION_COL) };<NEW_LINE>TypeInformation[] resultTypes = isPredDetail ? new TypeInformation[] { idType, Types.STRING } : new TypeInformation[] { idType };<NEW_LINE>return Tuple4.of(dataSchema.getFieldNames(), resultCols, resultTypes, params<MASK><NEW_LINE>} | .get(KnnPredictParams.RESERVED_COLS)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.