idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
179,637 | public FileActionEntity copy(CopyPathBody body, String path) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling copy");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'path' is set<NEW_LINE>if (path == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'path' when calling copy");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/file_actions/copy/{path}".replaceAll("\\{" + "path" + "\\}", apiClient.escapeString(path.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<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" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] <MASK><NEW_LINE>GenericType<FileActionEntity> localVarReturnType = new GenericType<FileActionEntity>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | localVarAuthNames = new String[] {}; |
5,826 | public static void cleanupSchemaMeta(String schemaName, Connection metaDbConn) {<NEW_LINE>TableInfoManager tableInfoManager = new TableInfoManager();<NEW_LINE>SchemaInfoCleaner schemaInfoCleaner = new SchemaInfoCleaner();<NEW_LINE>DdlPlanAccessor ddlPlanAccessor = new DdlPlanAccessor();<NEW_LINE>try {<NEW_LINE>assert metaDbConn != null;<NEW_LINE>tableInfoManager.setConnection(metaDbConn);<NEW_LINE>schemaInfoCleaner.setConnection(metaDbConn);<NEW_LINE>ddlPlanAccessor.setConnection(metaDbConn);<NEW_LINE>// If the schema has been dropped, then we have to do some cleanup.<NEW_LINE>String tableListDataId = MetaDbDataIdBuilder.getTableListDataId(schemaName);<NEW_LINE>MetaDbConfigManager.getInstance().unregister(tableListDataId, metaDbConn);<NEW_LINE>List<TablesExtRecord> records = tableInfoManager.queryTableExts(schemaName);<NEW_LINE>for (TablesExtRecord record : records) {<NEW_LINE>String tableDataId = MetaDbDataIdBuilder.getTableDataId(schemaName, record.tableName);<NEW_LINE>MetaDbConfigManager.getInstance().unbindListener(tableDataId);<NEW_LINE>MetaDbConfigManager.getInstance().unregister(tableDataId, metaDbConn);<NEW_LINE>}<NEW_LINE>tableInfoManager.removeAll(schemaName);<NEW_LINE>schemaInfoCleaner.removeAll(schemaName);<NEW_LINE><MASK><NEW_LINE>PolarDbXSystemTableLogicalTableStatistic.deleteAll(schemaName, metaDbConn);<NEW_LINE>PolarDbXSystemTableColumnStatistic.deleteAll(schemaName, metaDbConn);<NEW_LINE>PolarDbXSystemTableBaselineInfo.deleteAll(schemaName, metaDbConn);<NEW_LINE>PolarDbXSystemTablePlanInfo.deleteAll(schemaName, metaDbConn);<NEW_LINE>GsiBackfillManager.deleteAll(schemaName, metaDbConn);<NEW_LINE>CheckerManager.deleteAll(schemaName, metaDbConn);<NEW_LINE>ddlPlanAccessor.deleteAll(schemaName);<NEW_LINE>TableGroupUtils.deleteTableGroupInfoBySchema(schemaName, metaDbConn);<NEW_LINE>} catch (Exception e) {<NEW_LINE>MetaDbLogUtil.META_DB_LOG.error(e);<NEW_LINE>} finally {<NEW_LINE>tableInfoManager.setConnection(null);<NEW_LINE>schemaInfoCleaner.setConnection(null);<NEW_LINE>}<NEW_LINE>} | PolarDbXSystemTableView.deleteAll(schemaName, metaDbConn); |
130,282 | public String generateItemsAndGroups() throws IOException, OmniNotConnectedException, OmniInvalidResponseException, OmniUnknownMessageTypeException {<NEW_LINE>groups = new StringBuilder();<NEW_LINE>items = new StringBuilder();<NEW_LINE>rooms = new LinkedHashMap<String, LinkedList<SiteItem>>();<NEW_LINE>lights = new LinkedList<SiteItem>();<NEW_LINE>thermos = new LinkedList<SiteItem>();<NEW_LINE>audioZones = new LinkedList<SiteItem>();<NEW_LINE>audioSources <MASK><NEW_LINE>areas = new LinkedList<SiteItem>();<NEW_LINE>zones = new LinkedList<SiteItem>();<NEW_LINE>buttons = new LinkedList<SiteItem>();<NEW_LINE>existingGroups = new ArrayList<String>();<NEW_LINE>groups.append("Group All\n");<NEW_LINE>generateUnits();<NEW_LINE>items.append("\n");<NEW_LINE>generateThermos();<NEW_LINE>items.append("\n");<NEW_LINE>generateAudioZones();<NEW_LINE>items.append("\n");<NEW_LINE>generateAudioSource();<NEW_LINE>items.append("\n");<NEW_LINE>generateAreas();<NEW_LINE>items.append("\n");<NEW_LINE>generateZones();<NEW_LINE>items.append("\n");<NEW_LINE>generateButtons();<NEW_LINE>items.append("\n");<NEW_LINE>generateSiteMap();<NEW_LINE>return groups.append("\n\n").append(items).toString();<NEW_LINE>} | = new LinkedList<SiteItem>(); |
297,953 | private void regenerate() {<NEW_LINE>cmf = new CreatedModifiedFiles(getProject());<NEW_LINE>boolean osgi = false;<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>osgi = getProject().getLookup().lookup(NbModuleProvider.class).hasDependency("org.netbeans.libs.osgi");<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>// obtain unique class name<NEW_LINE>String className = INSTALLER_CLASS_NAME;<NEW_LINE>// NOI18N<NEW_LINE>String path = getDefaultPackagePath(className + ".java", false);<NEW_LINE>int i = 0;<NEW_LINE>while (alreadyExist(path)) {<NEW_LINE>className = INSTALLER_CLASS_NAME + '_' + ++i;<NEW_LINE>// NOI18N<NEW_LINE>path = getDefaultPackagePath(className + ".java", false);<NEW_LINE>}<NEW_LINE>// generate .java file for ModuleInstall<NEW_LINE>Map<String, String> basicTokens = new HashMap<String, String>();<NEW_LINE>// NOI18N<NEW_LINE>basicTokens.put("PACKAGE_NAME", getPackageName());<NEW_LINE>// NOI18N<NEW_LINE>basicTokens.put("CLASS_NAME", className);<NEW_LINE>// XXX use nbresloc URL protocol rather than<NEW_LINE>// DataModel.class.getResource(...) and all such a cases below<NEW_LINE>FileObject template;<NEW_LINE>if (osgi) {<NEW_LINE>// NOI18N<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>template = CreatedModifiedFiles.getTemplate("moduleInstall.java");<NEW_LINE>// NOI18N<NEW_LINE>cmf.add(cmf.addModuleDependency("org.openide.modules"));<NEW_LINE>// NOI18N<NEW_LINE>cmf.add(cmf.addModuleDependency("org.openide.util.ui"));<NEW_LINE>}<NEW_LINE>cmf.add(cmf.createFileWithSubstitutions(path, template, basicTokens));<NEW_LINE>// add manifest attribute<NEW_LINE>Map<String, String> attribs = new HashMap<String, String>();<NEW_LINE>if (osgi) {<NEW_LINE>attribs.put(BUNDLE_ACTIVATOR, getPackageName() + '.' + className);<NEW_LINE>// NOI18N<NEW_LINE>attribs.put(IMPORT_PACKAGE, "org.osgi.framework");<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>attribs.put(OPENIDE_MODULE_INSTALL, getPackageName().replace('.', '/') + '/' + className + ".class");<NEW_LINE>}<NEW_LINE>cmf.add(cmf.manifestModification(null, attribs));<NEW_LINE>} | template = CreatedModifiedFiles.getTemplate("moduleActivator.java"); |
77,153 | private void readAllFields(PageCursor cursor) throws IOException {<NEW_LINE>do {<NEW_LINE>creationTimeField = getRecordValue(cursor, Position.TIME);<NEW_LINE>randomNumberField = getRecordValue(cursor, Position.RANDOM_NUMBER);<NEW_LINE>versionField = getRecordValue(cursor, Position.LOG_VERSION);<NEW_LINE>long lastCommittedTxId = getRecordValue(cursor, Position.LAST_TRANSACTION_ID);<NEW_LINE>lastCommittingTxField.set(lastCommittedTxId);<NEW_LINE>storeVersionField = getRecordValue(cursor, Position.STORE_VERSION);<NEW_LINE><MASK><NEW_LINE>latestConstraintIntroducingTxField = getRecordValue(cursor, Position.LAST_CONSTRAINT_TRANSACTION);<NEW_LINE>upgradeTxIdField = getRecordValue(cursor, Position.UPGRADE_TRANSACTION_ID);<NEW_LINE>upgradeTxChecksumField = (int) getRecordValue(cursor, Position.UPGRADE_TRANSACTION_CHECKSUM);<NEW_LINE>upgradeTimeField = getRecordValue(cursor, Position.UPGRADE_TIME);<NEW_LINE>long lastClosedTransactionLogVersion = getRecordValue(cursor, Position.LAST_CLOSED_TRANSACTION_LOG_VERSION);<NEW_LINE>long lastClosedTransactionLogByteOffset = getRecordValue(cursor, Position.LAST_CLOSED_TRANSACTION_LOG_BYTE_OFFSET);<NEW_LINE>lastClosedTx.set(lastCommittedTxId, new long[] { lastClosedTransactionLogVersion, lastClosedTransactionLogByteOffset });<NEW_LINE>highestCommittedTransaction.set(lastCommittedTxId, (int) getRecordValue(cursor, Position.LAST_TRANSACTION_CHECKSUM), getRecordValue(cursor, Position.LAST_TRANSACTION_COMMIT_TIMESTAMP, UNKNOWN_TX_COMMIT_TIMESTAMP));<NEW_LINE>upgradeCommitTimestampField = getRecordValue(cursor, Position.UPGRADE_TRANSACTION_COMMIT_TIMESTAMP, BASE_TX_COMMIT_TIMESTAMP);<NEW_LINE>externalStoreUUID = readExternalStoreUUID(cursor);<NEW_LINE>databaseUUID = readDatabaseUUID(cursor);<NEW_LINE>upgradeTransaction = new TransactionId(upgradeTxIdField, upgradeTxChecksumField, upgradeCommitTimestampField);<NEW_LINE>checkpointLogVersionField = getRecordValue(cursor, CHECKPOINT_LOG_VERSION, 0);<NEW_LINE>kernelVersion = getRecordValue(cursor, KERNEL_VERSION);<NEW_LINE>} while (cursor.shouldRetry());<NEW_LINE>if (cursor.checkAndClearBoundsFlag()) {<NEW_LINE>throw new UnderlyingStorageException("Out of page bounds when reading all meta-data fields. The page in question is page " + cursor.getCurrentPageId() + " of file " + storageFile.toAbsolutePath() + ", which is " + cursor.getCurrentPageSize() + " bytes in size");<NEW_LINE>}<NEW_LINE>} | getRecordValue(cursor, Position.FIRST_GRAPH_PROPERTY); |
226,970 | private Mono<PagedResponse<ConfigurationProfileInner>> listChildResourcesSinglePageAsync(String configurationProfileName, String resourceGroupName, 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 (configurationProfileName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter configurationProfileName 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.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listChildResources(this.client.getEndpoint(), configurationProfileName, this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
1,478,315 | public boolean apply(Game game, Ability source) {<NEW_LINE>Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source));<NEW_LINE>if (spell != null) {<NEW_LINE>Player controller = game.getPlayer(spell.getControllerId());<NEW_LINE>if (controller != null) {<NEW_LINE>int count = 0;<NEW_LINE>String name = spell.getName();<NEW_LINE>FilterCard filterCardName = new FilterCard();<NEW_LINE>filterCardName.add(new NamePredicate(name));<NEW_LINE>for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {<NEW_LINE>Player <MASK><NEW_LINE>if (player != null) {<NEW_LINE>count += player.getGraveyard().count(filterCardName, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (count > 0) {<NEW_LINE>new SquirrelToken().putOntoBattlefield(count, game, source, spell.getControllerId());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | player = game.getPlayer(playerId); |
1,062,408 | public void onPlayerInteract(final PlayerInteractEvent event) {<NEW_LINE>// Do not return if cancelled, because the interact event has 2 cancelled states.<NEW_LINE>final User user = ess.getUser(event.getPlayer());<NEW_LINE>final ItemStack item = event.getItem();<NEW_LINE>if (item != null && prot.checkProtectionItems(AntiBuildConfig.blacklist_usage, item.getType()) && !user.isAuthorized("essentials.protect.exemptusage")) {<NEW_LINE>if (ess.getSettings().warnOnBuildDisallow()) {<NEW_LINE>user.sendMessage(tl("antiBuildUse", item.getType<MASK><NEW_LINE>}<NEW_LINE>event.setCancelled(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (item != null && prot.checkProtectionItems(AntiBuildConfig.alert_on_use, item.getType()) && !user.isAuthorized("essentials.protect.alerts.notrigger")) {<NEW_LINE>prot.getEssentialsConnect().alert(user, item.getType().toString(), tl("alertUsed"));<NEW_LINE>}<NEW_LINE>if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild()) {<NEW_LINE>if (event.hasItem() && !metaPermCheck(user, "interact", item)) {<NEW_LINE>event.setCancelled(true);<NEW_LINE>if (ess.getSettings().warnOnBuildDisallow()) {<NEW_LINE>user.sendMessage(tl("antiBuildUse", item.getType().toString()));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (event.hasBlock() && !metaPermCheck(user, "interact", event.getClickedBlock())) {<NEW_LINE>event.setCancelled(true);<NEW_LINE>if (ess.getSettings().warnOnBuildDisallow()) {<NEW_LINE>user.sendMessage(tl("antiBuildInteract", event.getClickedBlock().getType().toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().toString())); |
235,054 | void handleDnsResponse(IpPacket requestPacket, byte[] responsePayload) {<NEW_LINE>UdpPacket udpOutPacket = (UdpPacket) requestPacket.getPayload();<NEW_LINE>UdpPacket.Builder payLoadBuilder = new UdpPacket.Builder(udpOutPacket).srcPort(udpOutPacket.getHeader().getDstPort()).dstPort(udpOutPacket.getHeader().getSrcPort()).srcAddr(requestPacket.getHeader().getDstAddr()).dstAddr(requestPacket.getHeader().getSrcAddr()).correctChecksumAtBuild(true).correctLengthAtBuild(true).payloadBuilder(new UnknownPacket.Builder().rawData(responsePayload));<NEW_LINE>IpPacket ipOutPacket;<NEW_LINE>if (requestPacket instanceof IpV4Packet) {<NEW_LINE>ipOutPacket = new IpV4Packet.Builder((IpV4Packet) requestPacket).srcAddr((Inet4Address) requestPacket.getHeader().getDstAddr()).dstAddr((Inet4Address) requestPacket.getHeader().getSrcAddr()).correctChecksumAtBuild(true).correctLengthAtBuild(true).<MASK><NEW_LINE>} else {<NEW_LINE>ipOutPacket = new IpV6Packet.Builder((IpV6Packet) requestPacket).srcAddr((Inet6Address) requestPacket.getHeader().getDstAddr()).dstAddr((Inet6Address) requestPacket.getHeader().getSrcAddr()).correctLengthAtBuild(true).payloadBuilder(payLoadBuilder).build();<NEW_LINE>}<NEW_LINE>eventLoop.queueDeviceWrite(ipOutPacket);<NEW_LINE>} | payloadBuilder(payLoadBuilder).build(); |
1,107,884 | private // /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>void onPaymentReceived() {<NEW_LINE>// The confirmPaymentReceived call will trigger the trade protocol to do the payout tx. We want to be sure that we<NEW_LINE>// are well connected to the Bitcoin network before triggering the broadcast.<NEW_LINE>if (model.dataModel.isReadyForTxBroadcast()) {<NEW_LINE>String key = "confirmPaymentReceived";<NEW_LINE>if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {<NEW_LINE>PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();<NEW_LINE>String message = Res.get("portfolio.pending.step3_seller.onPaymentReceived.part1", getCurrencyName(trade));<NEW_LINE>if (!(paymentAccountPayload instanceof AssetsAccountPayload)) {<NEW_LINE>Optional<String> optionalHolderName = getOptionalHolderName();<NEW_LINE>if (optionalHolderName.isPresent()) {<NEW_LINE>message += Res.get(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>message += Res.get("portfolio.pending.step3_seller.onPaymentReceived.note");<NEW_LINE>if (model.dataModel.isSignWitnessTrade()) {<NEW_LINE>message += Res.get("portfolio.pending.step3_seller.onPaymentReceived.signer");<NEW_LINE>}<NEW_LINE>new Popup().headLine(Res.get("portfolio.pending.step3_seller.onPaymentReceived.confirm.headline")).confirmation(message).width(700).actionButtonText(Res.get("portfolio.pending.step3_seller.onPaymentReceived.confirm.yes")).onAction(this::confirmPaymentReceived).closeButtonText(Res.get("shared.cancel")).show();<NEW_LINE>} else {<NEW_LINE>confirmPaymentReceived();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "portfolio.pending.step3_seller.onPaymentReceived.name", optionalHolderName.get()); |
1,608,890 | final UpdateWorkGroupResult executeUpdateWorkGroup(UpdateWorkGroupRequest updateWorkGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateWorkGroupRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateWorkGroupRequest> request = null;<NEW_LINE>Response<UpdateWorkGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateWorkGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateWorkGroupRequest));<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, "Athena");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateWorkGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateWorkGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateWorkGroupResultJsonUnmarshaller());<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(); |
1,756,841 | protected Subtitle decode(byte[] bytes, int length, boolean reset) throws SubtitleDecoderException {<NEW_LINE>parsableByteArray.reset(bytes, length);<NEW_LINE>String cueTextString = readSubtitleText(parsableByteArray);<NEW_LINE>if (cueTextString.isEmpty()) {<NEW_LINE>return Tx3gSubtitle.EMPTY;<NEW_LINE>}<NEW_LINE>// Attach default styles.<NEW_LINE>SpannableStringBuilder cueText = new SpannableStringBuilder(cueTextString);<NEW_LINE>attachFontFace(cueText, defaultFontFace, DEFAULT_FONT_FACE, 0, cueText.length(), SPAN_PRIORITY_LOW);<NEW_LINE>attachColor(cueText, defaultColorRgba, DEFAULT_COLOR, 0, cueText.length(), SPAN_PRIORITY_LOW);<NEW_LINE>attachFontFamily(cueText, defaultFontFamily, 0, cueText.length());<NEW_LINE>float verticalPlacement = defaultVerticalPlacement;<NEW_LINE>// Find and attach additional styles.<NEW_LINE>while (parsableByteArray.bytesLeft() >= SIZE_ATOM_HEADER) {<NEW_LINE>int position = parsableByteArray.getPosition();<NEW_LINE>int atomSize = parsableByteArray.readInt();<NEW_LINE>int atomType = parsableByteArray.readInt();<NEW_LINE>if (atomType == TYPE_STYL) {<NEW_LINE>assertTrue(parsableByteArray.bytesLeft() >= SIZE_SHORT);<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < styleRecordCount; i++) {<NEW_LINE>applyStyleRecord(parsableByteArray, cueText);<NEW_LINE>}<NEW_LINE>} else if (atomType == TYPE_TBOX && customVerticalPlacement) {<NEW_LINE>assertTrue(parsableByteArray.bytesLeft() >= SIZE_SHORT);<NEW_LINE>int requestedVerticalPlacement = parsableByteArray.readUnsignedShort();<NEW_LINE>verticalPlacement = (float) requestedVerticalPlacement / calculatedVideoTrackHeight;<NEW_LINE>verticalPlacement = Util.constrainValue(verticalPlacement, 0.0f, 0.95f);<NEW_LINE>}<NEW_LINE>parsableByteArray.setPosition(position + atomSize);<NEW_LINE>}<NEW_LINE>return new Tx3gSubtitle(new Cue.Builder().setText(cueText).setLine(verticalPlacement, LINE_TYPE_FRACTION).setLineAnchor(ANCHOR_TYPE_START).build());<NEW_LINE>} | int styleRecordCount = parsableByteArray.readUnsignedShort(); |
651,317 | public void moveChild(String name, int index) throws NotFoundException {<NEW_LINE>lock.acquire();<NEW_LINE>try {<NEW_LINE>checkDeleted();<NEW_LINE>int currentIndex = 0;<NEW_LINE>boolean foundName = false;<NEW_LINE>Group group = null;<NEW_LINE>// TODO: this could be slow and may need monitor<NEW_LINE>List<DBRecord> list = getParentChildRecords();<NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>DBRecord rec = list.get(i);<NEW_LINE>long childID = rec.getLongValue(ParentChildDBAdapter.CHILD_ID_COL);<NEW_LINE>String childName = null;<NEW_LINE>DBRecord childRec = null;<NEW_LINE>if (childID < 0) {<NEW_LINE>childRec = fragmentAdapter.getFragmentRecord(-childID);<NEW_LINE>childName = childRec.getString(FragmentDBAdapter.FRAGMENT_NAME_COL);<NEW_LINE>} else {<NEW_LINE>childRec = moduleAdapter.getModuleRecord(childID);<NEW_LINE>childName = childRec.getString(ModuleDBAdapter.MODULE_NAME_COL);<NEW_LINE>}<NEW_LINE>if (childName.equals(name)) {<NEW_LINE>foundName = true;<NEW_LINE>currentIndex = i;<NEW_LINE>if (childID < 0) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>group = moduleMgr.getModuleDB(childRec);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!foundName) {<NEW_LINE>throw new NotFoundException(name + " is not a child of " + getName());<NEW_LINE>}<NEW_LINE>DBRecord pcRec = list.remove(currentIndex);<NEW_LINE>list.add(index, pcRec);<NEW_LINE>updateChildOrder(list);<NEW_LINE>moduleMgr.childReordered(this, group);<NEW_LINE>} catch (IOException e) {<NEW_LINE>moduleMgr.dbError(e);<NEW_LINE>} finally {<NEW_LINE>lock.release();<NEW_LINE>}<NEW_LINE>} | group = moduleMgr.getFragmentDB(childRec); |
1,291,137 | public Matrix3f normalize(Matrix3f store) {<NEW_LINE>if (store == null) {<NEW_LINE>store = new Matrix3f();<NEW_LINE>}<NEW_LINE>float mag = 1.0f / FastMath.sqrt(m00 * m00 + m10 * m10 + m20 * m20);<NEW_LINE>store.m00 = m00 * mag;<NEW_LINE>store.m10 = m10 * mag;<NEW_LINE>store.m20 = m20 * mag;<NEW_LINE>mag = 1.0f / FastMath.sqrt(m01 * m01 + <MASK><NEW_LINE>store.m01 = m01 * mag;<NEW_LINE>store.m11 = m11 * mag;<NEW_LINE>store.m21 = m21 * mag;<NEW_LINE>store.m02 = store.m10 * store.m21 - store.m11 * store.m20;<NEW_LINE>store.m12 = store.m01 * store.m20 - store.m00 * store.m21;<NEW_LINE>store.m22 = store.m00 * store.m11 - store.m01 * store.m10;<NEW_LINE>return store;<NEW_LINE>} | m11 * m11 + m21 * m21); |
1,378,092 | public void marshall(Meeting meeting, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (meeting == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(meeting.getMeetingId(), MEETINGID_BINDING);<NEW_LINE>protocolMarshaller.marshall(meeting.getMeetingHostId(), MEETINGHOSTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(meeting.getExternalMeetingId(), EXTERNALMEETINGID_BINDING);<NEW_LINE>protocolMarshaller.marshall(meeting.getMediaRegion(), MEDIAREGION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(meeting.getMeetingFeatures(), MEETINGFEATURES_BINDING);<NEW_LINE>protocolMarshaller.marshall(meeting.getPrimaryMeetingId(), PRIMARYMEETINGID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | meeting.getMediaPlacement(), MEDIAPLACEMENT_BINDING); |
1,295,718 | public void write(MySQLResponseService service) {<NEW_LINE>ByteBuffer buffer = service.allocate();<NEW_LINE>BufferUtil.writeUB3(buffer, calcPacketSize());<NEW_LINE>buffer.put(packetId);<NEW_LINE>// capability flags<NEW_LINE>BufferUtil.writeUB4(buffer, clientFlags);<NEW_LINE>// max-packet size<NEW_LINE>BufferUtil.writeUB4(buffer, maxPacketSize);<NEW_LINE>// character set<NEW_LINE>buffer.put((byte) charsetIndex);<NEW_LINE>// reserved (all [0])<NEW_LINE>buffer = service.writeToBuffer(FILLER, buffer);<NEW_LINE>if (user == null) {<NEW_LINE>buffer = service.checkWriteBuffer(buffer, 1, true);<NEW_LINE>buffer.put((byte) 0);<NEW_LINE>} else {<NEW_LINE>byte[] userData = user.getBytes();<NEW_LINE>buffer = service.checkWriteBuffer(buffer, userData.length + 1, true);<NEW_LINE>BufferUtil.writeWithNull(buffer, userData);<NEW_LINE>}<NEW_LINE>if (password == null) {<NEW_LINE>buffer = service.checkWriteBuffer(buffer, 1, true);<NEW_LINE>buffer.put((byte) 0);<NEW_LINE>} else {<NEW_LINE>buffer = service.checkWriteBuffer(buffer, BufferUtil.getLength(password), true);<NEW_LINE>BufferUtil.writeWithLength(buffer, password);<NEW_LINE>}<NEW_LINE>if (database == null) {<NEW_LINE>buffer = service.checkWriteBuffer(buffer, 1, true);<NEW_LINE>buffer.put((byte) 0);<NEW_LINE>} else {<NEW_LINE>byte[] databaseData = database.getBytes();<NEW_LINE>buffer = service.checkWriteBuffer(buffer, <MASK><NEW_LINE>BufferUtil.writeWithNull(buffer, databaseData);<NEW_LINE>}<NEW_LINE>if ((clientFlags & Capabilities.CLIENT_PLUGIN_AUTH) != 0) {<NEW_LINE>// if use the mysql_native_password is used for auth this need be replay<NEW_LINE>BufferUtil.writeWithNull(buffer, HandshakeV10Packet.NATIVE_PASSWORD_PLUGIN);<NEW_LINE>}<NEW_LINE>service.writeDirectly(buffer, getLastWriteFlag());<NEW_LINE>} | databaseData.length + 1, true); |
51,042 | public void rollback(boolean recovering) throws StoreAccessException, IllegalStateException {<NEW_LINE>boolean inDoubt = journal.isInDoubt(transactionId);<NEW_LINE>if (inDoubt) {<NEW_LINE>// phase 2 rollback<NEW_LINE>Collection<K> keys = journal.getInDoubtKeys(transactionId);<NEW_LINE>for (K key : keys) {<NEW_LINE>SoftLock<V> preparedSoftLock = getFromUnderlyingStore(key);<NEW_LINE>V oldValue = preparedSoftLock == null ? null : preparedSoftLock.getOldValue();<NEW_LINE>SoftLock<V> definitiveSoftLock = oldValue == null ? null : new SoftLock<>(null, oldValue, null);<NEW_LINE>if (preparedSoftLock != null) {<NEW_LINE>if (preparedSoftLock.getTransactionId() != null && !preparedSoftLock.getTransactionId().equals(transactionId)) {<NEW_LINE>LOGGER.debug("rollback skipping prepared softlock with non-matching TX ID (concurrent modification?)");<NEW_LINE>evictFromUnderlyingStore(key);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (definitiveSoftLock != null) {<NEW_LINE>boolean replaced = replaceInUnderlyingStore(key, preparedSoftLock, definitiveSoftLock);<NEW_LINE>if (!replaced) {<NEW_LINE>LOGGER.debug("rollback failed replace of softlock (concurrent modification?)");<NEW_LINE>evictFromUnderlyingStore(key);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>boolean <MASK><NEW_LINE>if (!removed) {<NEW_LINE>LOGGER.debug("rollback failed remove of softlock (concurrent modification?)");<NEW_LINE>evictFromUnderlyingStore(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("rollback skipping evicted prepared softlock");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>journal.saveRolledBack(transactionId, false);<NEW_LINE>} else if (recovering) {<NEW_LINE>throw new IllegalStateException("Cannot rollback unknown transaction : " + transactionId);<NEW_LINE>} else {<NEW_LINE>// phase 1 rollback<NEW_LINE>commands.clear();<NEW_LINE>}<NEW_LINE>} | removed = removeFromUnderlyingStore(key, preparedSoftLock); |
1,476,238 | final public void put(int key, int value) {<NEW_LINE>int hash = key & 0x7FFFFFFF;<NEW_LINE>if ((key == 0 && value == 0) || value == Integer.MIN_VALUE) {<NEW_LINE>throw new RuntimeException("key value pair not supported " + key + " " + value);<NEW_LINE>}<NEW_LINE>// putHash(key, value, hash); inline ..<NEW_LINE>if (mNumberOfElements * GROWFAC > mKeys.length) {<NEW_LINE>resize(mKeys.length * GROWFAC);<NEW_LINE>}<NEW_LINE>int idx = hash % mKeys.length;<NEW_LINE><MASK><NEW_LINE>if (// new<NEW_LINE>mKey == 0 && mValues[idx] == 0) {<NEW_LINE>mNumberOfElements++;<NEW_LINE>mValues[idx] = value;<NEW_LINE>mKeys[idx] = key;<NEW_LINE>} else if (// overwrite<NEW_LINE>mKey == key) {<NEW_LINE>mValues[idx] = value;<NEW_LINE>} else {<NEW_LINE>putNext(hash, key, value);<NEW_LINE>}<NEW_LINE>// end inline<NEW_LINE>} | final int mKey = mKeys[idx]; |
106,037 | private RValueInfo inferTypeForDestructuredTarget(DestructuredTarget target, Supplier<RValueInfo> patternTypeSupplier) {<NEW_LINE>// Currently we only do type inference for string key nodes in object patterns here, to<NEW_LINE>// handle aliasing types. e.g<NEW_LINE>// const {Foo} = ns;<NEW_LINE>// TypeInference takes care of the rest.<NEW_LINE>// Note that although DestructuredTarget includes logic for inferring types, we don't use<NEW_LINE>// it here because we only do some very limited type inference during TypedScopeCreation,<NEW_LINE>// and only return a non-null type here if we are accessing a declared property on a known<NEW_LINE>// type.<NEW_LINE>if (!target.hasStringKey() || target.hasDefaultValue()) {<NEW_LINE>return RValueInfo.empty();<NEW_LINE>}<NEW_LINE>RValueInfo rvalue = patternTypeSupplier.get();<NEW_LINE>JSType patternType = rvalue.type;<NEW_LINE>String propertyName = target.getStringKey().getString();<NEW_LINE>QualifiedName qname = rvalue.qualifiedName != null ? rvalue.qualifiedName.getprop(propertyName) : null;<NEW_LINE>if (patternType == null || patternType.isUnknownType()) {<NEW_LINE>return new RValueInfo(null, qname);<NEW_LINE>}<NEW_LINE>if (patternType.hasProperty(propertyName)) {<NEW_LINE>JSType <MASK><NEW_LINE>return new RValueInfo(type, qname);<NEW_LINE>}<NEW_LINE>return new RValueInfo(null, qname);<NEW_LINE>} | type = patternType.findPropertyType(propertyName); |
108,545 | private void commitModel(final ModuleModelImpl moduleModel, final Runnable runnable) {<NEW_LINE>myModuleModel.myModulesCache = null;<NEW_LINE>myModificationCount++;<NEW_LINE>ApplicationManager.getApplication().assertWriteAccessAllowed();<NEW_LINE>final Collection<Module> oldModules = myModuleModel.myModules;<NEW_LINE>final Collection<Module> newModules = moduleModel.myModules;<NEW_LINE>final List<Module> removedModules = new ArrayList<>(oldModules);<NEW_LINE>removedModules.removeAll(newModules);<NEW_LINE>final List<Module> addedModules = new ArrayList<>(newModules);<NEW_LINE>addedModules.removeAll(oldModules);<NEW_LINE>ProjectRootManagerEx.getInstanceEx(myProject).makeRootsChange(() -> {<NEW_LINE>for (Module removedModule : removedModules) {<NEW_LINE>fireBeforeModuleRemoved(removedModule);<NEW_LINE>cleanCachedStuff();<NEW_LINE>}<NEW_LINE>List<Module> neverAddedModules = new ArrayList<>(moduleModel.myModulesToDispose);<NEW_LINE>neverAddedModules.removeAll(myModuleModel.myModules);<NEW_LINE>for (final Module neverAddedModule : neverAddedModules) {<NEW_LINE>neverAddedModule.putUserData(DISPOSED_MODULE_NAME, neverAddedModule.getName());<NEW_LINE>Disposer.dispose(neverAddedModule);<NEW_LINE>}<NEW_LINE>if (runnable != null) {<NEW_LINE>runnable.run();<NEW_LINE>}<NEW_LINE>final Map<Module, String> modulesToNewNamesMap = moduleModel.myModuleToNewName;<NEW_LINE>final Set<Module> modulesToBeRenamed = modulesToNewNamesMap.keySet();<NEW_LINE>modulesToBeRenamed.removeAll(moduleModel.myModulesToDispose);<NEW_LINE>final List<Module> modules = new ArrayList<>();<NEW_LINE>for (final Module moduleToBeRenamed : modulesToBeRenamed) {<NEW_LINE>ModuleEx module = (ModuleEx) moduleToBeRenamed;<NEW_LINE><MASK><NEW_LINE>modules.add(moduleToBeRenamed);<NEW_LINE>module.rename(modulesToNewNamesMap.get(moduleToBeRenamed));<NEW_LINE>moduleModel.myModules.add(module);<NEW_LINE>}<NEW_LINE>moduleModel.myIsWritable = false;<NEW_LINE>myModuleModel = moduleModel;<NEW_LINE>for (Module module : removedModules) {<NEW_LINE>fireModuleRemoved(module);<NEW_LINE>cleanCachedStuff();<NEW_LINE>Disposer.dispose(module);<NEW_LINE>cleanCachedStuff();<NEW_LINE>}<NEW_LINE>for (Module addedModule : addedModules) {<NEW_LINE>((ModuleEx) addedModule).moduleAdded();<NEW_LINE>cleanCachedStuff();<NEW_LINE>fireModuleAdded(addedModule);<NEW_LINE>cleanCachedStuff();<NEW_LINE>}<NEW_LINE>cleanCachedStuff();<NEW_LINE>fireModulesRenamed(modules);<NEW_LINE>cleanCachedStuff();<NEW_LINE>}, false, true);<NEW_LINE>} | moduleModel.myModules.remove(moduleToBeRenamed); |
1,010,267 | public Request<CreateCustomAvailabilityZoneRequest> marshall(CreateCustomAvailabilityZoneRequest createCustomAvailabilityZoneRequest) {<NEW_LINE>if (createCustomAvailabilityZoneRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreateCustomAvailabilityZoneRequest> request = new DefaultRequest<CreateCustomAvailabilityZoneRequest>(createCustomAvailabilityZoneRequest, "AmazonRDS");<NEW_LINE>request.addParameter("Action", "CreateCustomAvailabilityZone");<NEW_LINE><MASK><NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (createCustomAvailabilityZoneRequest.getCustomAvailabilityZoneName() != null) {<NEW_LINE>request.addParameter("CustomAvailabilityZoneName", StringUtils.fromString(createCustomAvailabilityZoneRequest.getCustomAvailabilityZoneName()));<NEW_LINE>}<NEW_LINE>if (createCustomAvailabilityZoneRequest.getExistingVpnId() != null) {<NEW_LINE>request.addParameter("ExistingVpnId", StringUtils.fromString(createCustomAvailabilityZoneRequest.getExistingVpnId()));<NEW_LINE>}<NEW_LINE>if (createCustomAvailabilityZoneRequest.getNewVpnTunnelName() != null) {<NEW_LINE>request.addParameter("NewVpnTunnelName", StringUtils.fromString(createCustomAvailabilityZoneRequest.getNewVpnTunnelName()));<NEW_LINE>}<NEW_LINE>if (createCustomAvailabilityZoneRequest.getVpnTunnelOriginatorIP() != null) {<NEW_LINE>request.addParameter("VpnTunnelOriginatorIP", StringUtils.fromString(createCustomAvailabilityZoneRequest.getVpnTunnelOriginatorIP()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.addParameter("Version", "2014-10-31"); |
930,284 | public Response info() {<NEW_LINE>ResourceBundle configBundle = ConfigUtil.getConfigBundle();<NEW_LINE>String currentVersion = configBundle.getString("api.current_version");<NEW_LINE>String minVersion = configBundle.getString("api.min_version");<NEW_LINE>Boolean guestLogin = <MASK><NEW_LINE>String defaultLanguage = ConfigUtil.getConfigStringValue(ConfigType.DEFAULT_LANGUAGE);<NEW_LINE>UserDao userDao = new UserDao();<NEW_LINE>DocumentDao documentDao = new DocumentDao();<NEW_LINE>String globalQuotaStr = System.getenv(Constants.GLOBAL_QUOTA_ENV);<NEW_LINE>long globalQuota = 0;<NEW_LINE>if (!Strings.isNullOrEmpty(globalQuotaStr)) {<NEW_LINE>globalQuota = Long.valueOf(globalQuotaStr);<NEW_LINE>}<NEW_LINE>JsonObjectBuilder response = Json.createObjectBuilder().add("current_version", currentVersion.replace("-SNAPSHOT", "")).add("min_version", minVersion).add("guest_login", guestLogin).add("default_language", defaultLanguage).add("queued_tasks", AppContext.getInstance().getQueuedTaskCount()).add("total_memory", Runtime.getRuntime().totalMemory()).add("free_memory", Runtime.getRuntime().freeMemory()).add("document_count", documentDao.getDocumentCount()).add("active_user_count", userDao.getActiveUserCount()).add("global_storage_current", userDao.getGlobalStorageCurrent());<NEW_LINE>if (globalQuota > 0) {<NEW_LINE>response.add("global_storage_quota", globalQuota);<NEW_LINE>}<NEW_LINE>return Response.ok().entity(response.build()).build();<NEW_LINE>} | ConfigUtil.getConfigBooleanValue(ConfigType.GUEST_LOGIN); |
1,286,163 | private void paintMe(Graphics g) {<NEW_LINE>Font f = g.getFont();<NEW_LINE>g.setFont(getBoldFont());<NEW_LINE>FontMetrics fontMetrics = g.getFontMetrics(g.getFont());<NEW_LINE>int type = this.node.getType();<NEW_LINE>Color color;<NEW_LINE>switch(type) {<NEW_LINE>case PertChartAbstraction.Type.NORMAL:<NEW_LINE>color = NORMAL_COLOR;<NEW_LINE>break;<NEW_LINE>case PertChartAbstraction.Type.SUPER:<NEW_LINE>color = SUPER_COLOR;<NEW_LINE>break;<NEW_LINE>case PertChartAbstraction.Type.MILESTONE:<NEW_LINE>color = MILESTONE_COLOR;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>color = NORMAL_COLOR;<NEW_LINE>}<NEW_LINE>g.setColor(this.backgroundColor);<NEW_LINE>g.fillRoundRect(x, y, getNodeWidth(), getNodeHeight(), 16, 16);<NEW_LINE>g.setColor(color);<NEW_LINE>g.drawRoundRect(x, y, getNodeWidth(), getNodeHeight(), 16, 16);<NEW_LINE>g.drawRoundRect(x + 1, y + 1, getNodeWidth() - 2, getNodeHeight() - 2, 14, 14);<NEW_LINE>g.drawLine(x, y + getTextPaddingY() + fontMetrics.getHeight() + getYOffset(), x + getNodeWidth(), y + getTextPaddingY() + fontMetrics.getHeight() + getYOffset());<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE><MASK><NEW_LINE>g.drawString(StringUtils.getTruncatedString(name, getNodeWidth() - getTextPaddingX(), fontMetrics), x + getTextPaddingX(), y + getTextPaddingY() + fontMetrics.getHeight());<NEW_LINE>g.setFont(getBaseFont());<NEW_LINE>fontMetrics = g.getFontMetrics(g.getFont());<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>g.drawString(language.getText("start") + ": " + node.getStartDate().toString(), x + getTextPaddingX(), (int) (y + getTextPaddingY() + 2.3 * fontMetrics.getHeight()));<NEW_LINE>g.drawString(language.getText("end") + ": " + node.getEndDate().toString(), x + getTextPaddingX(), (int) (y + getTextPaddingY() + 3.3 * fontMetrics.getHeight()));<NEW_LINE>if (node.getDuration() != null)<NEW_LINE>g.drawString(language.getText("duration") + ": " + node.getDuration().getLength(), x + getTextPaddingX(), (int) (y + getTextPaddingY() + 4.3 * fontMetrics.getHeight()));<NEW_LINE>g.setFont(f);<NEW_LINE>} | String name = node.getName(); |
1,310,120 | /*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.commands.spi.ICommandExecutionEncoder#encodeSystemCommand(com.<NEW_LINE>* sitewhere.spi.device.command.ISystemCommand,<NEW_LINE>* com.sitewhere.spi.device.IDeviceNestingContext, java.util.List)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public byte[] encodeSystemCommand(ISystemCommand command, IDeviceNestingContext nested, List<? extends IDeviceAssignment> assignments) throws SiteWhereException {<NEW_LINE>switch(command.getType()) {<NEW_LINE>case RegistrationAck:<NEW_LINE>{<NEW_LINE>IRegistrationAckCommand ack = (IRegistrationAckCommand) command;<NEW_LINE>RegistrationAck.Builder builder = RegistrationAck.newBuilder();<NEW_LINE>switch(ack.getReason()) {<NEW_LINE>case AlreadyRegistered:<NEW_LINE>{<NEW_LINE>builder.setState(RegistrationAckState.ALREADY_REGISTERED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case NewRegistration:<NEW_LINE>{<NEW_LINE>builder.setState(RegistrationAckState.NEW_REGISTRATION);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return encodeRegistrationAck(builder.build());<NEW_LINE>}<NEW_LINE>case RegistrationFailure:<NEW_LINE>{<NEW_LINE>IRegistrationFailureCommand fail = (IRegistrationFailureCommand) command;<NEW_LINE>RegistrationAck.Builder builder = RegistrationAck.newBuilder();<NEW_LINE>builder.setState(RegistrationAckState.REGISTRATION_ERROR);<NEW_LINE>builder.setErrorMessage(GOptionalString.newBuilder().setValue(fail.getErrorMessage()));<NEW_LINE>switch(fail.getReason()) {<NEW_LINE>case NewDevicesNotAllowed:<NEW_LINE>{<NEW_LINE>builder.setErrorType(RegistrationAckError.NEW_DEVICES_NOT_ALLOWED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case InvalidDeviceTypeToken:<NEW_LINE>{<NEW_LINE>builder.setErrorType(RegistrationAckError.INVALID_SPECIFICATION);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case SiteTokenRequired:<NEW_LINE>{<NEW_LINE>builder.setErrorType(RegistrationAckError.SITE_TOKEN_REQUIRED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>case DeviceStreamAck:<NEW_LINE>{<NEW_LINE>IDeviceStreamAckCommand ack = (IDeviceStreamAckCommand) command;<NEW_LINE>DeviceStreamAck.Builder builder = DeviceStreamAck.newBuilder();<NEW_LINE>switch(ack.getStatus()) {<NEW_LINE>case DeviceStreamCreated:<NEW_LINE>{<NEW_LINE>builder.setState(DeviceStreamAckState.STREAM_CREATED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case DeviceStreamExists:<NEW_LINE>{<NEW_LINE>builder.setState(DeviceStreamAckState.STREAM_EXISTS);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case DeviceStreamFailed:<NEW_LINE>{<NEW_LINE>builder.setState(DeviceStreamAckState.STREAM_FAILED);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return encodeDeviceStreamAck(builder.build());<NEW_LINE>}<NEW_LINE>case SendDeviceStreamData:<NEW_LINE>{<NEW_LINE>ISendDeviceStreamDataCommand send = (ISendDeviceStreamDataCommand) command;<NEW_LINE>DeviceStreamData.Builder builder = DeviceStreamData.newBuilder();<NEW_LINE>builder.setDeviceToken(GOptionalString.newBuilder().setValue(send.getDeviceToken()));<NEW_LINE>builder.setSequenceNumber(GOptionalFixed64.newBuilder().setValue(send.getSequenceNumber()));<NEW_LINE>builder.setData(ByteString.copyFrom(send.getData()));<NEW_LINE>return encodeSendDeviceStreamData(builder.build());<NEW_LINE>}<NEW_LINE>case DeviceMappingAck:<NEW_LINE>{<NEW_LINE>String json = MarshalUtils.marshalJsonAsPrettyString(command);<NEW_LINE>getLogger().warn("No protocol buffer encoding implemented for sending device mapping acknowledgement.");<NEW_LINE>getLogger().info("JSON representation of command is:\n" + json + "\n");<NEW_LINE>return new byte[0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new SiteWhereException("Unable to encode command: " + command.getClass().getName());<NEW_LINE>} | encodeRegistrationAck(builder.build()); |
708,346 | public PolicyExecutor maxConcurrency(int max) {<NEW_LINE>if (max == -1)<NEW_LINE>max = Integer.MAX_VALUE;<NEW_LINE>else if (max < 1)<NEW_LINE>throw new IllegalArgumentException(Integer.toString(max));<NEW_LINE>synchronized (configLock) {<NEW_LINE>if (max < expedite)<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>if (state.get() != State.ACTIVE)<NEW_LINE>throw new IllegalStateException(Tr.formatMessage(tc, "CWWKE1203.config.update.after.shutdown", "maxConcurrency", identifier));<NEW_LINE>int increase = max - maxConcurrency;<NEW_LINE>if (increase > 0)<NEW_LINE>maxConcurrencyConstraint.release(increase);<NEW_LINE>else if (increase < 0)<NEW_LINE>maxConcurrencyConstraint.reducePermits(-increase);<NEW_LINE>maxConcurrency = max;<NEW_LINE>}<NEW_LINE>while (withheldConcurrency.get() > 0 && maxConcurrencyConstraint.tryAcquire()) {<NEW_LINE>decrementWithheldConcurrency();<NEW_LINE>enqueueGlobal(new GlobalPoolTask());<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | "maxConcurrency: " + max + " < expedite: " + expedite); |
60,870 | protected void doExecute(Task task, final MultiGetRequest request, final ActionListener<MultiGetResponse> listener) {<NEW_LINE>ClusterState clusterState = clusterService.state();<NEW_LINE>clusterState.blocks().globalBlockedRaiseException(ClusterBlockLevel.READ);<NEW_LINE>final AtomicArray<MultiGetItemResponse> responses = new AtomicArray<>(request.items.size());<NEW_LINE>final Map<ShardId, MultiGetShardRequest> shardRequests = new HashMap<>();<NEW_LINE>for (int i = 0; i < request.items.size(); i++) {<NEW_LINE>MultiGetRequest.Item item = request.items.get(i);<NEW_LINE>String concreteSingleIndex;<NEW_LINE>try {<NEW_LINE>concreteSingleIndex = indexNameExpressionResolver.concreteSingleIndex(clusterState, item).getName();<NEW_LINE>item.routing(clusterState.metadata().resolveIndexRouting(item.routing(), item.index()));<NEW_LINE>if ((item.routing() == null) && (clusterState.getMetadata().routingRequired(concreteSingleIndex))) {<NEW_LINE>responses.set(i, newItemFailure(concreteSingleIndex, item.id(), new RoutingMissingException(concreteSingleIndex, item.id())));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>responses.set(i, newItemFailure(item.index(), item.id(), e));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ShardId shardId = clusterService.operationRouting().getShards(clusterState, concreteSingleIndex, item.id(), item.routing(), null).shardId();<NEW_LINE>MultiGetShardRequest shardRequest = shardRequests.get(shardId);<NEW_LINE>if (shardRequest == null) {<NEW_LINE>shardRequest = new MultiGetShardRequest(request, shardId.getIndexName(<MASK><NEW_LINE>shardRequests.put(shardId, shardRequest);<NEW_LINE>}<NEW_LINE>shardRequest.add(i, item);<NEW_LINE>}<NEW_LINE>if (shardRequests.isEmpty()) {<NEW_LINE>// only failures..<NEW_LINE>listener.onResponse(new MultiGetResponse(responses.toArray(new MultiGetItemResponse[responses.length()])));<NEW_LINE>}<NEW_LINE>executeShardAction(listener, responses, shardRequests);<NEW_LINE>} | ), shardId.getId()); |
734,120 | public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext) throws AuthenticationException {<NEW_LINE>logger.entering(sourceClass, "validateRequest", new Object[] <MASK><NEW_LINE>AuthenticationStatus status = AuthenticationStatus.SEND_FAILURE;<NEW_LINE>Subject clientSubject = httpMessageContext.getClientSubject();<NEW_LINE>String authHeader = httpMessageContext.getRequest().getHeader("Authorization");<NEW_LINE>if (httpMessageContext.isAuthenticationRequest()) {<NEW_LINE>AuthenticationParameters authParams = httpMessageContext.getAuthParameters();<NEW_LINE>if (authParams != null) {<NEW_LINE>Credential credential = authParams.getCredential();<NEW_LINE>status = validateWithIdentityStore(clientSubject, credential, identityStoreHandler, httpMessageContext);<NEW_LINE>if (status == AuthenticationStatus.SUCCESS) {<NEW_LINE>httpMessageContext.getMessageInfo().getMap().put("javax.servlet.http.authType", "SERVLET10_AUTH_MECH");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (authHeader == null) {<NEW_LINE>status = setChallengeAuthorizationHeader(httpMessageContext.getResponse());<NEW_LINE>} else {<NEW_LINE>status = handleAuthorizationHeader(authHeader, clientSubject, httpMessageContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (authHeader == null) {<NEW_LINE>if (httpMessageContext.isProtected() == false) {<NEW_LINE>status = AuthenticationStatus.NOT_DONE;<NEW_LINE>} else {<NEW_LINE>status = setChallengeAuthorizationHeader(httpMessageContext.getResponse());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>status = handleAuthorizationHeader(authHeader, clientSubject, httpMessageContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.exiting(sourceClass, "validateRequest", status);<NEW_LINE>return status;<NEW_LINE>} | { request, response, httpMessageContext }); |
330,911 | public static Properties parseGrpcUrl(String url) {<NEW_LINE>if (isNullOrEmpty(url)) {<NEW_LINE>throw new RuntimeException("URL cannot be null or empty");<NEW_LINE>}<NEW_LINE>Properties props = new Properties();<NEW_LINE>Pattern p = Pattern.compile("([^:]+)[:]//([^:]+)[:]([0-9]+)", Pattern.CASE_INSENSITIVE);<NEW_LINE>Matcher m = p.matcher(url);<NEW_LINE>if (m.matches()) {<NEW_LINE>props.setProperty("protocol", m.group(1));<NEW_LINE>props.setProperty("host", m.group(2));<NEW_LINE>props.setProperty("port", m.group(3));<NEW_LINE>String <MASK><NEW_LINE>if (!"grpc".equals(protocol) && !"grpcs".equals(protocol)) {<NEW_LINE>throw new RuntimeException(format("Invalid protocol expected grpc or grpcs and found %s.", protocol));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("URL must be of the format protocol://host:port. Found: '" + url + "'");<NEW_LINE>}<NEW_LINE>// TODO: allow all possible formats of the URL<NEW_LINE>return props;<NEW_LINE>} | protocol = props.getProperty("protocol"); |
202,486 | void connectTypeHierarchy() {<NEW_LINE>SourceTypeBinding sourceType = this.referenceContext.binding;<NEW_LINE>CompilationUnitScope compilationUnitScope = compilationUnitScope();<NEW_LINE>boolean wasAlreadyConnecting = compilationUnitScope.connectingHierarchy;<NEW_LINE>compilationUnitScope.connectingHierarchy = true;<NEW_LINE>try {<NEW_LINE>if ((sourceType.tagBits & TagBits.BeginHierarchyCheck) == 0) {<NEW_LINE>sourceType.tagBits |= TagBits.BeginHierarchyCheck;<NEW_LINE>environment().typesBeingConnected.add(sourceType);<NEW_LINE>boolean noProblems = connectSuperclass();<NEW_LINE>noProblems &= connectSuperInterfaces();<NEW_LINE>environment().typesBeingConnected.remove(sourceType);<NEW_LINE>sourceType.tagBits |= TagBits.EndHierarchyCheck;<NEW_LINE>connectPermittedTypes();<NEW_LINE>noProblems &= connectTypeVariables(this.referenceContext.typeParameters, false);<NEW_LINE>sourceType.tagBits |= TagBits.TypeVariablesAreConnected;<NEW_LINE>if (noProblems && sourceType.isHierarchyInconsistent())<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>connectMemberTypes();<NEW_LINE>} finally {<NEW_LINE>compilationUnitScope.connectingHierarchy = wasAlreadyConnecting;<NEW_LINE>}<NEW_LINE>LookupEnvironment env = environment();<NEW_LINE>try {<NEW_LINE>env.missingClassFileLocation = this.referenceContext;<NEW_LINE>checkForInheritedMemberTypes(sourceType);<NEW_LINE>} catch (AbortCompilation e) {<NEW_LINE>e.updateContext(this.referenceContext, referenceCompilationUnit().compilationResult);<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>env.missingClassFileLocation = null;<NEW_LINE>}<NEW_LINE>} | problemReporter().hierarchyHasProblems(sourceType); |
276,051 | protected void perform(@Nonnull XDebugSession session, DataContext dataContext) {<NEW_LINE>Editor editor = dataContext.getData(CommonDataKeys.EDITOR);<NEW_LINE>if (editor == null || !(editor instanceof EditorEx)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int selectionStart = editor.getSelectionModel().getSelectionStart();<NEW_LINE>int selectionEnd = editor<MASK><NEW_LINE>String text;<NEW_LINE>TextRange range;<NEW_LINE>if (selectionStart != selectionEnd) {<NEW_LINE>range = new TextRange(selectionStart, selectionEnd);<NEW_LINE>text = editor.getDocument().getText(range);<NEW_LINE>} else {<NEW_LINE>XDebuggerEvaluator evaluator = session.getDebugProcess().getEvaluator();<NEW_LINE>if (evaluator != null) {<NEW_LINE>ExpressionInfo expressionInfo = evaluator.getExpressionInfoAtOffset(session.getProject(), editor.getDocument(), selectionStart, true);<NEW_LINE>if (expressionInfo == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// todo check - is it wrong in case of not-null expressionInfo.second - copied (to console history document) text (text range) could be not correct statement?<NEW_LINE>range = expressionInfo.getTextRange();<NEW_LINE>text = XDebuggerEvaluateActionHandler.getExpressionText(expressionInfo, editor.getDocument());<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtil.isEmptyOrSpaces(text)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ConsoleExecuteAction action = getConsoleExecuteAction(session);<NEW_LINE>if (action != null) {<NEW_LINE>action.execute(range, text, (EditorEx) editor);<NEW_LINE>}<NEW_LINE>} | .getSelectionModel().getSelectionEnd(); |
1,617,120 | private static void removeCustomLaunches(Document document, ManifestOptions manifestOptions) {<NEW_LINE>if (null == manifestOptions) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get the root node<NEW_LINE>Element root = document.getRootElement();<NEW_LINE>// Update launch information<NEW_LINE>if (manifestOptions.getRetainLaunches() != null && manifestOptions.getRetainLaunches().size() > 0) {<NEW_LINE>List<? extends Node> nodes = root.selectNodes("//activity/intent-filter/category|//activity-alias/intent-filter/category");<NEW_LINE>for (Node node : nodes) {<NEW_LINE>Element e = (Element) node;<NEW_LINE>if ("android.intent.category.LAUNCHER".equalsIgnoreCase(e.attributeValue("name"))) {<NEW_LINE>Element activityElement = e<MASK><NEW_LINE>String activiyName = activityElement.attributeValue("name");<NEW_LINE>if (!manifestOptions.getRetainLaunches().contains(activiyName)) {<NEW_LINE>if (activityElement.getName().equalsIgnoreCase("activity-alias")) {<NEW_LINE>activityElement.getParent().remove(activityElement);<NEW_LINE>} else {<NEW_LINE>e.getParent().remove(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getParent().getParent(); |
437,232 | public void putLong(long t, long v) {<NEW_LINE>if (writeCurArrayIndex == -1) {<NEW_LINE>if (capacity >= CAPACITY_THRESHOLD) {<NEW_LINE>((LinkedList<long[]>) timeRet).addFirst(new long[capacity]);<NEW_LINE>((LinkedList<long[]>) longRet).addFirst(new long[capacity]);<NEW_LINE>writeCurListIndex++;<NEW_LINE>writeCurArrayIndex = capacity - 1;<NEW_LINE>} else {<NEW_LINE>int newCapacity = capacity << 1;<NEW_LINE>long[] newTimeData = new long[newCapacity];<NEW_LINE>long[] newValueData = new long[newCapacity];<NEW_LINE>System.arraycopy(timeRet.get(0), 0, newTimeData, newCapacity - capacity, capacity);<NEW_LINE>System.arraycopy(longRet.get(0), 0, newValueData, newCapacity - capacity, capacity);<NEW_LINE><MASK><NEW_LINE>longRet.set(0, newValueData);<NEW_LINE>writeCurArrayIndex = newCapacity - capacity - 1;<NEW_LINE>capacity = newCapacity;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>timeRet.get(0)[writeCurArrayIndex] = t;<NEW_LINE>longRet.get(0)[writeCurArrayIndex] = v;<NEW_LINE>writeCurArrayIndex--;<NEW_LINE>count++;<NEW_LINE>} | timeRet.set(0, newTimeData); |
356,466 | public boolean requestAudFocus(Context context, ApplicationMode applicationMode, int streamType) {<NEW_LINE>AudioManager mAudioManager = (AudioManager) <MASK><NEW_LINE>routingHelper = ((OsmandApplication) context.getApplicationContext()).getRoutingHelper();<NEW_LINE>if (android.os.Build.VERSION.SDK_INT < 26) {<NEW_LINE>playbackAuthorized = AudioManager.AUDIOFOCUS_REQUEST_GRANTED == mAudioManager.requestAudioFocus(this, streamType, ((OsmandApplication) context.getApplicationContext()).getSettings().INTERRUPT_MUSIC.getModeValue(applicationMode) ? AudioManager.AUDIOFOCUS_GAIN_TRANSIENT : AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK);<NEW_LINE>} else {<NEW_LINE>AudioAttributes mAudioAttributes = new AudioAttributes.Builder().setUsage(((OsmandApplication) context.getApplicationContext()).getSettings().AUDIO_USAGE.get()).setContentType(AudioAttributes.CONTENT_TYPE_SPEECH).build();<NEW_LINE>AudioFocusRequest mAudioFocusRequest = new AudioFocusRequest.Builder(((OsmandApplication) context.getApplicationContext()).getSettings().INTERRUPT_MUSIC.getModeValue(applicationMode) ? AudioManager.AUDIOFOCUS_GAIN_TRANSIENT : AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK).setAudioAttributes(mAudioAttributes).setAcceptsDelayedFocusGain(false).setOnAudioFocusChangeListener(this).build();<NEW_LINE>final Object focusLock = new Object();<NEW_LINE>int res = mAudioManager.requestAudioFocus(mAudioFocusRequest);<NEW_LINE>synchronized (focusLock) {<NEW_LINE>if (res == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {<NEW_LINE>playbackAuthorized = true;<NEW_LINE>} else if (res == AudioManager.AUDIOFOCUS_REQUEST_FAILED) {<NEW_LINE>playbackAuthorized = false;<NEW_LINE>} else if (res == AudioManager.AUDIOFOCUS_REQUEST_DELAYED) {<NEW_LINE>playbackAuthorized = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return playbackAuthorized;<NEW_LINE>} | context.getSystemService(Context.AUDIO_SERVICE); |
134,964 | void morphologicalFeatures(String word, String featurePrefix, List<String> features) {<NEW_LINE>if (word == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>WordAnalysis analyses = morphology.analyze(word);<NEW_LINE>SingleAnalysis longest = analyses.analysisCount() > 0 ? analyses.getAnalysisResults().get(analyses.analysisCount() - 1) : SingleAnalysis.unknown(word);<NEW_LINE>for (SingleAnalysis analysis : analyses) {<NEW_LINE>if (analysis.isUnknown()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (analysis == longest) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<String> cLemmas = analysis.getLemmas();<NEW_LINE>List<String> lLemmas = longest.getLemmas();<NEW_LINE>if (cLemmas.get(cLemmas.size() - 1).length() > lLemmas.get(lLemmas.size() - 1).length()) {<NEW_LINE>longest = analysis;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> lemmas = longest.getLemmas();<NEW_LINE>features.add(featurePrefix + "Stem:" + longest.getStem());<NEW_LINE>String ending = longest.getEnding();<NEW_LINE>if (ending.length() > 0) {<NEW_LINE>features.<MASK><NEW_LINE>}<NEW_LINE>features.add(featurePrefix + "LongLemma:" + lemmas.get(lemmas.size() - 1));<NEW_LINE>features.add(featurePrefix + "POS:" + longest.getPos());<NEW_LINE>features.add(featurePrefix + "LastIg:" + longest.getLastGroup().lexicalForm());<NEW_LINE>// features.add(featurePrefix + "ContainsProper:" + containsProper);<NEW_LINE>} | add(featurePrefix + "Ending:" + ending); |
1,398,801 | public static void broadcastCommandMessage(CommandSender source, String message, boolean sendToSource) {<NEW_LINE>Set<Permissible> users = source.getServer().getPluginManager().getPermissionSubscriptions(Server.BROADCAST_CHANNEL_ADMINISTRATIVE);<NEW_LINE>TranslationContainer result = new TranslationContainer("chat.type.admin", source.getName(), message);<NEW_LINE>TranslationContainer colored = new TranslationContainer(TextFormat.GRAY + "" + TextFormat.ITALIC + "%chat.type.admin", <MASK><NEW_LINE>if (sendToSource && !(source instanceof ConsoleCommandSender)) {<NEW_LINE>source.sendMessage(message);<NEW_LINE>}<NEW_LINE>for (Permissible user : users) {<NEW_LINE>if (user instanceof CommandSender) {<NEW_LINE>if (user instanceof ConsoleCommandSender) {<NEW_LINE>((ConsoleCommandSender) user).sendMessage(result);<NEW_LINE>} else if (!user.equals(source)) {<NEW_LINE>((CommandSender) user).sendMessage(colored);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | source.getName(), message); |
1,211,192 | public Schema transform(Schema inputSchema) {<NEW_LINE>for (String s : newOrder) {<NEW_LINE>if (!inputSchema.hasColumn(s)) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (inputSchema.numColumns() < newOrder.size())<NEW_LINE>throw new IllegalArgumentException("Schema has " + inputSchema.numColumns() + " column but newOrder has " + newOrder.size() + " columns");<NEW_LINE>List<String> origNames = inputSchema.getColumnNames();<NEW_LINE>List<ColumnMetaData> origMeta = inputSchema.getColumnMetaData();<NEW_LINE>List<ColumnMetaData> outMeta = new ArrayList<>();<NEW_LINE>boolean[] taken = new boolean[origNames.size()];<NEW_LINE>for (String s : newOrder) {<NEW_LINE>int idx = inputSchema.getIndexOfColumn(s);<NEW_LINE>outMeta.add(origMeta.get(idx));<NEW_LINE>taken[idx] = true;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < taken.length; i++) {<NEW_LINE>if (taken[i])<NEW_LINE>continue;<NEW_LINE>outMeta.add(origMeta.get(i));<NEW_LINE>}<NEW_LINE>return inputSchema.newSchema(outMeta);<NEW_LINE>} | IllegalStateException("Input schema does not contain column with name \"" + s + "\""); |
62,241 | public Request<ModifyClusterIamRolesRequest> marshall(ModifyClusterIamRolesRequest modifyClusterIamRolesRequest) {<NEW_LINE>if (modifyClusterIamRolesRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ModifyClusterIamRolesRequest> request = new DefaultRequest<ModifyClusterIamRolesRequest>(modifyClusterIamRolesRequest, "AmazonRedshift");<NEW_LINE>request.addParameter("Action", "ModifyClusterIamRoles");<NEW_LINE>request.addParameter("Version", "2012-12-01");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (modifyClusterIamRolesRequest.getClusterIdentifier() != null) {<NEW_LINE>request.addParameter("ClusterIdentifier", StringUtils.fromString(modifyClusterIamRolesRequest.getClusterIdentifier()));<NEW_LINE>}<NEW_LINE>if (!modifyClusterIamRolesRequest.getAddIamRoles().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) modifyClusterIamRolesRequest.getAddIamRoles()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> addIamRolesList = (com.amazonaws.internal.SdkInternalList<<MASK><NEW_LINE>int addIamRolesListIndex = 1;<NEW_LINE>for (String addIamRolesListValue : addIamRolesList) {<NEW_LINE>if (addIamRolesListValue != null) {<NEW_LINE>request.addParameter("AddIamRoles.IamRoleArn." + addIamRolesListIndex, StringUtils.fromString(addIamRolesListValue));<NEW_LINE>}<NEW_LINE>addIamRolesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!modifyClusterIamRolesRequest.getRemoveIamRoles().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) modifyClusterIamRolesRequest.getRemoveIamRoles()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> removeIamRolesList = (com.amazonaws.internal.SdkInternalList<String>) modifyClusterIamRolesRequest.getRemoveIamRoles();<NEW_LINE>int removeIamRolesListIndex = 1;<NEW_LINE>for (String removeIamRolesListValue : removeIamRolesList) {<NEW_LINE>if (removeIamRolesListValue != null) {<NEW_LINE>request.addParameter("RemoveIamRoles.IamRoleArn." + removeIamRolesListIndex, StringUtils.fromString(removeIamRolesListValue));<NEW_LINE>}<NEW_LINE>removeIamRolesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (modifyClusterIamRolesRequest.getDefaultIamRoleArn() != null) {<NEW_LINE>request.addParameter("DefaultIamRoleArn", StringUtils.fromString(modifyClusterIamRolesRequest.getDefaultIamRoleArn()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | String>) modifyClusterIamRolesRequest.getAddIamRoles(); |
1,115,029 | public boolean intersects(MappeableRunContainer x) {<NEW_LINE>int rlepos = 0;<NEW_LINE>int xrlepos = 0;<NEW_LINE>int start = (this.getValue(rlepos));<NEW_LINE>int end = start + (this.getLength(rlepos)) + 1;<NEW_LINE>int xstart = (x.getValue(xrlepos));<NEW_LINE>int xend = xstart + (x.getLength(xrlepos)) + 1;<NEW_LINE>while ((rlepos < this.nbrruns) && (xrlepos < x.nbrruns)) {<NEW_LINE>if (end <= xstart) {<NEW_LINE>// exit the first run<NEW_LINE>rlepos++;<NEW_LINE>if (rlepos < this.nbrruns) {<NEW_LINE>start = (this.getValue(rlepos));<NEW_LINE>end = start + (this<MASK><NEW_LINE>}<NEW_LINE>} else if (xend <= start) {<NEW_LINE>// exit the second run<NEW_LINE>xrlepos++;<NEW_LINE>if (xrlepos < x.nbrruns) {<NEW_LINE>xstart = (x.getValue(xrlepos));<NEW_LINE>xend = xstart + (x.getLength(xrlepos)) + 1;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// they overlap<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .getLength(rlepos)) + 1; |
1,062,882 | public WeightedPath findSinglePath(Node start, Node end) {<NEW_LINE>lastMetadata = new Metadata();<NEW_LINE>AStarIterator iterator = new AStarIterator(start, end);<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Node node = iterator.next();<NEW_LINE>if (node.equals(end)) {<NEW_LINE>// Hit, return path<NEW_LINE>double weight = iterator.visitData.get(node.getId()).wayLength;<NEW_LINE>final Path path;<NEW_LINE>if (start.getId() == end.getId()) {<NEW_LINE>// Nothing to iterate over<NEW_LINE>path = PathImpl.singular(start);<NEW_LINE>} else {<NEW_LINE>LinkedList<Relationship> rels = new LinkedList<>();<NEW_LINE><MASK><NEW_LINE>Relationship rel = transaction.getRelationshipById(iterator.visitData.get(node.getId()).cameFromRelationship);<NEW_LINE>while (rel != null) {<NEW_LINE>rels.addFirst(rel);<NEW_LINE>node = rel.getOtherNode(node);<NEW_LINE>long nextRelId = iterator.visitData.get(node.getId()).cameFromRelationship;<NEW_LINE>rel = nextRelId == -1 ? null : transaction.getRelationshipById(nextRelId);<NEW_LINE>}<NEW_LINE>path = toPath(start, rels);<NEW_LINE>}<NEW_LINE>lastMetadata.paths++;<NEW_LINE>return new WeightedPathImpl(weight, path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | var transaction = context.transaction(); |
665,704 | final ListMobileDeviceAccessRulesResult executeListMobileDeviceAccessRules(ListMobileDeviceAccessRulesRequest listMobileDeviceAccessRulesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listMobileDeviceAccessRulesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListMobileDeviceAccessRulesRequest> request = null;<NEW_LINE>Response<ListMobileDeviceAccessRulesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListMobileDeviceAccessRulesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listMobileDeviceAccessRulesRequest));<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, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListMobileDeviceAccessRules");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListMobileDeviceAccessRulesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListMobileDeviceAccessRulesResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,452,052 | private void doAddToPalette(final TextImporterUI panel) {<NEW_LINE>// store new item<NEW_LINE>// NOI18N //NOI18N<NEW_LINE>final String fileName = FileUtil.findFreeFileName(categoryFolder, "ccc", "xml");<NEW_LINE>try {<NEW_LINE>categoryFolder.getFileSystem().runAtomicAction(new AtomicAction() {<NEW_LINE><NEW_LINE>public void run() throws IOException {<NEW_LINE>// NOI18N<NEW_LINE>FileObject itemFile = categoryFolder.createData(fileName, "xml");<NEW_LINE>PrintWriter w = new PrintWriter(itemFile.getOutputStream());<NEW_LINE>storeItem(w, panel);<NEW_LINE>w.close();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException ioE) {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger(TextImporter.class.getName()).// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.SEVERE, // NOI18N<NEW_LINE>NbBundle.getMessage(TextImporter.class, "Err_StoreItemToDisk"), ioE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// reorder<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (IOException ioE) {<NEW_LINE>Logger.getLogger(TextImporter.class.getName()).log(Level.INFO, null, ioE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | reorder(fileName, categoryFolder, dropIndex); |
880,927 | protected ActionCallback _execute(PlaybackContext context) {<NEW_LINE>String[] args = getText().substring(PREFIX.length()).trim().split(" ");<NEW_LINE>String syntaxText = "Syntax error, expected: " + PREFIX + " " + ON + "|" + OFF + " actionName";<NEW_LINE>if (args.length != 2) {<NEW_LINE>context.error(syntaxText, getLine());<NEW_LINE>return new ActionCallback.Rejected();<NEW_LINE>}<NEW_LINE>final boolean on;<NEW_LINE>if (ON.equalsIgnoreCase(args[0])) {<NEW_LINE>on = true;<NEW_LINE>} else if (OFF.equalsIgnoreCase(args[0])) {<NEW_LINE>on = false;<NEW_LINE>} else {<NEW_LINE>context.error(syntaxText, getLine());<NEW_LINE>return new ActionCallback.Rejected();<NEW_LINE>}<NEW_LINE>String actionId = args[1];<NEW_LINE>final AnAction action = ActionManager.getInstance().getAction(actionId);<NEW_LINE>if (action == null) {<NEW_LINE>context.error(<MASK><NEW_LINE>return new ActionCallback.Rejected();<NEW_LINE>}<NEW_LINE>if (!(action instanceof ToggleAction)) {<NEW_LINE>context.error("Action is not a toggle action id=" + actionId, getLine());<NEW_LINE>return new ActionCallback.Rejected();<NEW_LINE>}<NEW_LINE>final InputEvent inputEvent = ActionCommand.getInputEvent(actionId);<NEW_LINE>final ActionCallback result = new ActionCallback();<NEW_LINE>context.getRobot().delay(Registry.intValue("actionSystem.playback.delay"));<NEW_LINE>IdeFocusManager fm = IdeFocusManager.getGlobalInstance();<NEW_LINE>fm.doWhenFocusSettlesDown(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final Presentation presentation = (Presentation) action.getTemplatePresentation().clone();<NEW_LINE>AnActionEvent event = new AnActionEvent(inputEvent, DataManager.getInstance().getDataContext(KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()), ActionPlaces.UNKNOWN, presentation, ActionManager.getInstance(), 0);<NEW_LINE>ActionUtil.performDumbAwareUpdate(LaterInvocator.isInModalContext(), action, event, false);<NEW_LINE>Boolean state = (Boolean) event.getPresentation().getClientProperty(ToggleAction.SELECTED_PROPERTY);<NEW_LINE>if (state.booleanValue() != on) {<NEW_LINE>ActionManager.getInstance().tryToExecute(action, inputEvent, null, ActionPlaces.UNKNOWN, true).doWhenProcessed(result.createSetDoneRunnable());<NEW_LINE>} else {<NEW_LINE>result.setDone();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result;<NEW_LINE>} | "Unknown action id=" + actionId, getLine()); |
1,577,819 | private void createOrUpdateSchedule(User user, long projectCode, long processDefinitionCode, String schedule, String workerGroup) {<NEW_LINE>Schedule scheduleObj = scheduleMapper.queryByProcessDefinitionCode(processDefinitionCode);<NEW_LINE>// create or update schedule<NEW_LINE>int scheduleId;<NEW_LINE>if (scheduleObj == null) {<NEW_LINE>processDefinitionService.releaseProcessDefinition(user, projectCode, processDefinitionCode, ReleaseState.ONLINE);<NEW_LINE>Map<String, Object> result = schedulerService.insertSchedule(user, projectCode, processDefinitionCode, schedule, DEFAULT_WARNING_TYPE, DEFAULT_WARNING_GROUP_ID, DEFAULT_FAILURE_STRATEGY, DEFAULT_PRIORITY, workerGroup, DEFAULT_ENVIRONMENT_CODE);<NEW_LINE>scheduleId = (<MASK><NEW_LINE>} else {<NEW_LINE>scheduleId = scheduleObj.getId();<NEW_LINE>processDefinitionService.releaseProcessDefinition(user, projectCode, processDefinitionCode, ReleaseState.OFFLINE);<NEW_LINE>schedulerService.updateSchedule(user, projectCode, scheduleId, schedule, DEFAULT_WARNING_TYPE, DEFAULT_WARNING_GROUP_ID, DEFAULT_FAILURE_STRATEGY, DEFAULT_PRIORITY, workerGroup, DEFAULT_ENVIRONMENT_CODE);<NEW_LINE>}<NEW_LINE>schedulerService.setScheduleState(user, projectCode, scheduleId, ReleaseState.ONLINE);<NEW_LINE>} | int) result.get("scheduleId"); |
1,120,593 | public void completeMerge(long targetStreamSegmentId, long sourceStreamSegmentId) throws StreamSegmentNotExistsException {<NEW_LINE>Exceptions.checkNotClosed(this.<MASK><NEW_LINE>log.debug("{}: completeMerge (TargetId = {}, SourceId = {}.", this.traceObjectId, targetStreamSegmentId, sourceStreamSegmentId);<NEW_LINE>SegmentMetadata sourceMetadata;<NEW_LINE>synchronized (this.lock) {<NEW_LINE>sourceMetadata = this.metadata.getStreamSegmentMetadata(sourceStreamSegmentId);<NEW_LINE>}<NEW_LINE>Preconditions.checkState(sourceMetadata != null, "No Metadata found for Segment Id %s.", sourceStreamSegmentId);<NEW_LINE>StreamSegmentReadIndex targetIndex = getOrCreateIndex(targetStreamSegmentId);<NEW_LINE>targetIndex.completeMerge(sourceMetadata);<NEW_LINE>synchronized (this.lock) {<NEW_LINE>// Do not clear the Cache after merger - we are reusing the cache entries from the source index in the target one.<NEW_LINE>closeIndex(sourceStreamSegmentId, false);<NEW_LINE>}<NEW_LINE>} | closed.get(), this); |
1,253,910 | private static Map<String, Double> parseEncounterAdjustmentFactors(String resource) {<NEW_LINE>try {<NEW_LINE>String rawData = Utilities.readResource(resource);<NEW_LINE>List<LinkedHashMap<String, String>> lines = SimpleCSV.parse(rawData);<NEW_LINE>Map<String, Double> costMap = new HashMap<>();<NEW_LINE>for (Map<String, String> line : lines) {<NEW_LINE>String state = line.get("STATE");<NEW_LINE>String encounterType = line.get("ENCOUNTER").toLowerCase();<NEW_LINE>String key = state + "|" + encounterType;<NEW_LINE>String factorStr = line.get("ADJ_FACTOR");<NEW_LINE>try {<NEW_LINE>Double factor = Double.valueOf(factorStr);<NEW_LINE>costMap.put(key, factor);<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return costMap;<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new ExceptionInInitializerError("Unable to read required file: " + resource);<NEW_LINE>}<NEW_LINE>} | RuntimeException("Invalid cost adjustment factor: " + factorStr, nfe); |
232,302 | final GetLoadBalancerTlsCertificatesResult executeGetLoadBalancerTlsCertificates(GetLoadBalancerTlsCertificatesRequest getLoadBalancerTlsCertificatesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getLoadBalancerTlsCertificatesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetLoadBalancerTlsCertificatesRequest> request = null;<NEW_LINE>Response<GetLoadBalancerTlsCertificatesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetLoadBalancerTlsCertificatesRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetLoadBalancerTlsCertificates");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetLoadBalancerTlsCertificatesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetLoadBalancerTlsCertificatesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(getLoadBalancerTlsCertificatesRequest)); |
1,708,312 | public void testTransactionTimeout(HttpServletRequest request, PrintWriter out) throws Exception {<NEW_LINE>TenSecondTask task = new TenSecondTask();<NEW_LINE>task.getExecutionProperties().put(AutoPurge.PROPERTY_NAME, AutoPurge.NEVER.name());<NEW_LINE>task.getExecutionProperties().put(ManagedTask.IDENTITY_NAME, "testTransactionTimeout");<NEW_LINE>task.getExecutionProperties().put(PersistentExecutor.TRANSACTION_TIMEOUT, "1");<NEW_LINE>TaskStatus<Long> <MASK><NEW_LINE>for (long start = System.nanoTime(); !status.hasResult() && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(POLL_INTERVAL)) status = scheduler.getStatus(status.getTaskId());<NEW_LINE>try {<NEW_LINE>status.get();<NEW_LINE>throw new Exception("Task should have rolled back twice and aborted due to transaction timeout. " + status);<NEW_LINE>} catch (AbortedException x) {<NEW_LINE>if (x.getMessage() == null || !x.getMessage().startsWith("CWWKC1555E") || x.getCause() == null)<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>} | status = scheduler.submit(task); |
1,388,960 | public DescribeScheduledInstancesResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeScheduledInstancesResult describeScheduledInstancesResult = new DescribeScheduledInstancesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return describeScheduledInstancesResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>describeScheduledInstancesResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("scheduledInstanceSet", targetDepth)) {<NEW_LINE>describeScheduledInstancesResult.withScheduledInstanceSet(new ArrayList<ScheduledInstance>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("scheduledInstanceSet/item", targetDepth)) {<NEW_LINE>describeScheduledInstancesResult.withScheduledInstanceSet(ScheduledInstanceStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeScheduledInstancesResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
1,436,971 | public static ListSecretsResponse unmarshall(ListSecretsResponse listSecretsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listSecretsResponse.setRequestId(_ctx.stringValue("ListSecretsResponse.RequestId"));<NEW_LINE>listSecretsResponse.setPageNumber(_ctx.integerValue("ListSecretsResponse.PageNumber"));<NEW_LINE>listSecretsResponse.setPageSize(_ctx.integerValue("ListSecretsResponse.PageSize"));<NEW_LINE>listSecretsResponse.setTotalCount(_ctx.integerValue("ListSecretsResponse.TotalCount"));<NEW_LINE>List<Secret> secretList = new ArrayList<Secret>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListSecretsResponse.SecretList.Length"); i++) {<NEW_LINE>Secret secret = new Secret();<NEW_LINE>secret.setCreateTime(_ctx.stringValue("ListSecretsResponse.SecretList[" + i + "].CreateTime"));<NEW_LINE>secret.setPlannedDeleteTime(_ctx.stringValue("ListSecretsResponse.SecretList[" + i + "].PlannedDeleteTime"));<NEW_LINE>secret.setSecretName(_ctx.stringValue<MASK><NEW_LINE>secret.setUpdateTime(_ctx.stringValue("ListSecretsResponse.SecretList[" + i + "].UpdateTime"));<NEW_LINE>secret.setSecretType(_ctx.stringValue("ListSecretsResponse.SecretList[" + i + "].SecretType"));<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListSecretsResponse.SecretList[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setTagKey(_ctx.stringValue("ListSecretsResponse.SecretList[" + i + "].Tags[" + j + "].TagKey"));<NEW_LINE>tag.setTagValue(_ctx.stringValue("ListSecretsResponse.SecretList[" + i + "].Tags[" + j + "].TagValue"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>secret.setTags(tags);<NEW_LINE>secretList.add(secret);<NEW_LINE>}<NEW_LINE>listSecretsResponse.setSecretList(secretList);<NEW_LINE>return listSecretsResponse;<NEW_LINE>} | ("ListSecretsResponse.SecretList[" + i + "].SecretName")); |
414,551 | final GetDeploymentsResult executeGetDeployments(GetDeploymentsRequest getDeploymentsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDeploymentsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDeploymentsRequest> request = null;<NEW_LINE>Response<GetDeploymentsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDeploymentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDeploymentsRequest));<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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDeployments");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDeploymentsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDeploymentsResultJsonUnmarshaller());<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,092,858 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) != 0)) {<NEW_LINE>output.writeUInt32(1, sentenceIndex_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) != 0)) {<NEW_LINE>output.writeUInt32(2, tokenStartInSentenceInclusive_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) != 0)) {<NEW_LINE>output.writeUInt32(3, tokenEndInSentenceExclusive_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) != 0)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 4, ner_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) != 0)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 5, normalizedNER_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) != 0)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 6, entityType_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000040) != 0)) {<NEW_LINE>output.<MASK><NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000080) != 0)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 8, wikipediaEntity_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000100) != 0)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 9, gender_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000200) != 0)) {<NEW_LINE>output.writeUInt32(10, entityMentionIndex_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000400) != 0)) {<NEW_LINE>output.writeUInt32(11, canonicalEntityMentionIndex_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000800) != 0)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 12, entityMentionText_);<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>} | writeMessage(7, getTimex()); |
132,267 | public boolean compatibleVersion(String acceptableVersionRange, String actualVersion) {<NEW_LINE>V pluginVersion = parseVersion(actualVersion);<NEW_LINE>// Treat a single version "1.4" as a left bound, equivalent to "[1.4,)"<NEW_LINE>if (acceptableVersionRange.matches(VERSION_REGEX)) {<NEW_LINE>return ge(pluginVersion, parseVersion(acceptableVersionRange));<NEW_LINE>}<NEW_LINE>// Otherwise ensure it is a version range with bounds<NEW_LINE>Matcher matcher = INTERVAL_PATTERN.matcher(acceptableVersionRange);<NEW_LINE>Preconditions.checkArgument(<MASK><NEW_LINE>String leftBound = matcher.group("left");<NEW_LINE>String rightBound = matcher.group("right");<NEW_LINE>Preconditions.checkArgument(leftBound != null || rightBound != null, "left and right bounds cannot both be empty");<NEW_LINE>BiPredicate<V, V> leftComparator = acceptableVersionRange.startsWith("[") ? VersionChecker::ge : VersionChecker::gt;<NEW_LINE>BiPredicate<V, V> rightComparator = acceptableVersionRange.endsWith("]") ? VersionChecker::le : VersionChecker::lt;<NEW_LINE>if (leftBound != null && !leftComparator.test(pluginVersion, parseVersion(leftBound))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (rightBound != null && !rightComparator.test(pluginVersion, parseVersion(rightBound))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | matcher.matches(), "invalid version range"); |
1,054,109 | public static IRubyObject inject(ThreadContext context, IRubyObject self, IRubyObject init, IRubyObject method, final Block block) {<NEW_LINE>final Ruby runtime = context.runtime;<NEW_LINE>if (block.isGiven())<NEW_LINE>runtime.getWarnings().warn(ID.BLOCK_UNUSED, "given block not used");<NEW_LINE>final String methodId = method.asJavaString();<NEW_LINE>final IRubyObject[] result = new IRubyObject[] { init };<NEW_LINE>callEach(context, eachSite(context), self, Signature.OPTIONAL, new BlockCallback() {<NEW_LINE><NEW_LINE>final MonomorphicCallSite site = new MonomorphicCallSite(methodId);<NEW_LINE><NEW_LINE>public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) {<NEW_LINE>return call(ctx, packEnumValues<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public IRubyObject call(ThreadContext ctx, IRubyObject larg, Block blk) {<NEW_LINE>result[0] = result[0] == null ? larg : site.call(ctx, self, result[0], larg);<NEW_LINE>return ctx.nil;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public IRubyObject call(ThreadContext ctx, IRubyObject larg) {<NEW_LINE>result[0] = result[0] == null ? larg : site.call(ctx, self, result[0], larg);<NEW_LINE>return ctx.nil;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result[0] == null ? context.nil : result[0];<NEW_LINE>} | (ctx, largs), blk); |
1,068,966 | private void renameKilledApps(FileStatus[] intermediateDir) throws IOException, YarnException {<NEW_LINE>List<FileStatus> killedAppDirectories = new ArrayList<>();<NEW_LINE>List<String> killedAppIds = killedAppIds();<NEW_LINE>for (String killedAppId : killedAppIds) {<NEW_LINE>for (FileStatus jobDirFilePath : intermediateDir) {<NEW_LINE>if (jobDirFilePath.toString().contains(killedAppId)) {<NEW_LINE>killedAppDirectories.add(jobDirFilePath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (FileStatus killedAppDirectory : killedAppDirectories) {<NEW_LINE>String jhistFilePath = ParserUtils.getJhistFilePath(fs, killedAppDirectory.getPath());<NEW_LINE>if (jhistFilePath.endsWith(".jhist.inprogress")) {<NEW_LINE>// new file name will need an end time, set it to current time<NEW_LINE>long currentTimestamp = System.currentTimeMillis();<NEW_LINE>Path sourcePath = new Path(jhistFilePath);<NEW_LINE>String jhistFileName = jhistFilePath.substring(jhistFilePath.lastIndexOf('/') + 1);<NEW_LINE>// Section of filename that will be replaced --> username.jhist.inprogress<NEW_LINE>String oldJhistSubstring = jhistFileName.substring(jhistFileName.lastIndexOf('-') + 1);<NEW_LINE>String username = oldJhistSubstring.split("\\.")[0];<NEW_LINE>String newJhistSubstring = currentTimestamp + "-" + username + "-KILLED.jhist";<NEW_LINE>String killedJhistFilePath = jhistFilePath.replace(oldJhistSubstring, newJhistSubstring);<NEW_LINE>Path killedPath = new Path(killedJhistFilePath);<NEW_LINE>try {<NEW_LINE>fs.rename(sourcePath, killedPath);<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | LOG.error("Failed to rename KILLED apps", e); |
801,794 | public Object doQuery(Object[] objs) {<NEW_LINE>try {<NEW_LINE>if (objs.length < 1) {<NEW_LINE>throw new RQException("elastic function.paramTypeError");<NEW_LINE>}<NEW_LINE>// check param: cursor<NEW_LINE>boolean bCursor = false;<NEW_LINE>if (option != null) {<NEW_LINE>if (option.indexOf("c") != -1) {<NEW_LINE>bCursor = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String method = "POST";<NEW_LINE>String endpoint = objs[0].toString();<NEW_LINE>int <MASK><NEW_LINE>if (bCursor) {<NEW_LINE>return new ImCursor(m_ctx, m_restConn, objs);<NEW_LINE>} else {<NEW_LINE>Response response = doRun(method, endpoint, objs);<NEW_LINE>if (response != null) {<NEW_LINE>String result = EntityUtils.toString(response.getEntity());<NEW_LINE>return parseResponse(result, subModel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | subModel = getSubModel(method, endpoint); |
1,129,833 | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>MapActivity mapActivity = requireMapActivity();<NEW_LINE>nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightModeForMapControls();<NEW_LINE>View view = UiUtilities.getInflater(mapActivity, nightMode).inflate(R.layout.track_details, container, false);<NEW_LINE>if (!AndroidUiHelper.isOrientationPortrait(mapActivity)) {<NEW_LINE>AndroidUtils.addStatusBarPadding21v(mapActivity, view);<NEW_LINE>}<NEW_LINE>if (menu == null || menu.getGpxItem() == null) {<NEW_LINE>return view;<NEW_LINE>}<NEW_LINE>mainView = view.findViewById(R.id.main_view);<NEW_LINE>TextView topBarTitle = (TextView) mainView.findViewById(R.id.top_bar_title);<NEW_LINE>if (topBarTitle != null) {<NEW_LINE>if (menu.getGpxItem().group != null) {<NEW_LINE>topBarTitle.setText(menu.getGpxItem().group.getGpxName());<NEW_LINE>} else {<NEW_LINE>topBarTitle.setText(R.string.rendering_category_details);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ImageButton backButton = (ImageButton) mainView.findViewById(R.id.top_bar_back_button);<NEW_LINE>ImageButton closeButton = (ImageButton) mainView.findViewById(R.id.top_bar_close_button);<NEW_LINE>if (backButton != null) {<NEW_LINE>backButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>FragmentActivity activity = getActivity();<NEW_LINE>if (activity != null) {<NEW_LINE>activity.onBackPressed();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (closeButton != null) {<NEW_LINE>closeButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>menu.hide(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final boolean forceFitTrackOnMap;<NEW_LINE>if (contextMenu.isActive()) {<NEW_LINE>forceFitTrackOnMap = !(contextMenu.getPointDescription() != null && contextMenu.getPointDescription().isGpxPoint());<NEW_LINE>} else {<NEW_LINE>forceFitTrackOnMap = true;<NEW_LINE>}<NEW_LINE>updateInfo(forceFitTrackOnMap);<NEW_LINE>ViewTreeObserver vto = mainView.getViewTreeObserver();<NEW_LINE>vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onGlobalLayout() {<NEW_LINE>ViewTreeObserver obs = mainView.getViewTreeObserver();<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {<NEW_LINE>obs.removeOnGlobalLayoutListener(this);<NEW_LINE>} else {<NEW_LINE>obs.removeGlobalOnLayoutListener(this);<NEW_LINE>}<NEW_LINE>if (getMapActivity() != null) {<NEW_LINE>updateInfo(forceFitTrackOnMap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return view;<NEW_LINE>} | MapContextMenu contextMenu = mapActivity.getContextMenu(); |
356,288 | protected void addBlockSimulations(List<Permanent> blockers, TreeNode<CombatSimulator> node, Game game) {<NEW_LINE>int numGroups = node.getData<MASK><NEW_LINE>Copier<CombatSimulator> copier = new Copier<>();<NEW_LINE>for (Permanent blocker : blockers) {<NEW_LINE>List<Permanent> subList = remove(blockers, blocker);<NEW_LINE>for (int i = 0; i < numGroups; i++) {<NEW_LINE>if (node.getData().groups.get(i).canBlock(blocker, game)) {<NEW_LINE>CombatSimulator combat = copier.copy(node.getData());<NEW_LINE>combat.groups.get(i).blockers.add(new CreatureSimulator(blocker));<NEW_LINE>TreeNode<CombatSimulator> child = new TreeNode<>(combat);<NEW_LINE>node.addChild(child);<NEW_LINE>addBlockSimulations(subList, child, game);<NEW_LINE>combat.simulate(game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().groups.size(); |
1,630,203 | private CtBehavior compileMethod(Parser p, MethodDecl md) throws CompileError {<NEW_LINE>int mod = MemberResolver.<MASK><NEW_LINE>CtClass[] plist = gen.makeParamList(md);<NEW_LINE>CtClass[] tlist = gen.makeThrowsList(md);<NEW_LINE>recordParams(plist, Modifier.isStatic(mod));<NEW_LINE>md = p.parseMethod2(stable, md);<NEW_LINE>try {<NEW_LINE>if (md.isConstructor()) {<NEW_LINE>CtConstructor cons = new CtConstructor(plist, gen.getThisClass());<NEW_LINE>cons.setModifiers(mod);<NEW_LINE>md.accept(gen);<NEW_LINE>cons.getMethodInfo().setCodeAttribute(bytecode.toCodeAttribute());<NEW_LINE>cons.setExceptionTypes(tlist);<NEW_LINE>return cons;<NEW_LINE>}<NEW_LINE>Declarator r = md.getReturn();<NEW_LINE>CtClass rtype = gen.resolver.lookupClass(r);<NEW_LINE>recordReturnType(rtype, false);<NEW_LINE>CtMethod method = new CtMethod(rtype, r.getVariable().get(), plist, gen.getThisClass());<NEW_LINE>method.setModifiers(mod);<NEW_LINE>gen.setThisMethod(method);<NEW_LINE>md.accept(gen);<NEW_LINE>if (md.getBody() != null)<NEW_LINE>method.getMethodInfo().setCodeAttribute(bytecode.toCodeAttribute());<NEW_LINE>else<NEW_LINE>method.setModifiers(mod | Modifier.ABSTRACT);<NEW_LINE>method.setExceptionTypes(tlist);<NEW_LINE>return method;<NEW_LINE>} catch (NotFoundException e) {<NEW_LINE>throw new CompileError(e.toString());<NEW_LINE>}<NEW_LINE>} | getModifiers(md.getModifiers()); |
990,147 | protected final PathFragment appendSegment(PathFragment dir, String child, int maxLinks) throws IOException {<NEW_LINE>PathFragment naive = dir.getChild(child);<NEW_LINE>PathFragment linkTarget = resolveOneLink(naive);<NEW_LINE>if (linkTarget == null) {<NEW_LINE>// regular file or directory<NEW_LINE>return naive;<NEW_LINE>}<NEW_LINE>if (maxLinks-- == 0) {<NEW_LINE>throw new FileSymlinkLoopException(naive);<NEW_LINE>}<NEW_LINE>if (linkTarget.isAbsolute()) {<NEW_LINE>dir = PathFragment.createAlreadyNormalized(linkTarget.getDriveStr());<NEW_LINE>}<NEW_LINE>for (String name : linkTarget.segments()) {<NEW_LINE>if (name.equals(".") || name.isEmpty()) {<NEW_LINE>// no-op<NEW_LINE>} else if (name.equals("..")) {<NEW_LINE><MASK><NEW_LINE>// root's parent is root, when canonicalizing, so this is a no-op.<NEW_LINE>if (parent != null) {<NEW_LINE>dir = parent;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dir = appendSegment(dir, name, maxLinks);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dir;<NEW_LINE>} | PathFragment parent = dir.getParentDirectory(); |
683,369 | public void onActivityCreated(Bundle savedInstanceState) {<NEW_LINE>super.onActivityCreated(savedInstanceState);<NEW_LINE>sportsSpinner = getView().findViewById(R.id.customtargeting_spn_sport);<NEW_LINE>loadButton = getView().findViewById(R.id.customtargeting_btn_loadad);<NEW_LINE>adView = getView().findViewById(R.id.customtargeting_av_main);<NEW_LINE>ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getView().getContext(), R.array.customtargeting_sports, <MASK><NEW_LINE>adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);<NEW_LINE>sportsSpinner.setAdapter(adapter);<NEW_LINE>loadButton.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>AdManagerAdRequest adRequest = new AdManagerAdRequest.Builder().addCustomTargeting(getString(R.string.customtargeting_key), (String) sportsSpinner.getSelectedItem()).build();<NEW_LINE>adView.loadAd(adRequest);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | android.R.layout.simple_spinner_item); |
266,862 | public WorldSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>WorldSummary worldSummary = new WorldSummary();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>worldSummary.setArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("createdAt", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>worldSummary.setCreatedAt(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("generationJob", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>worldSummary.setGenerationJob(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("template", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>worldSummary.setTemplate(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return worldSummary;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,046,429 | public Builder mergeFrom(com.alibaba.alink.operator.batch.dl.ctr.protos.Dbmtl.DBMTL other) {<NEW_LINE>if (other == com.alibaba.alink.operator.batch.dl.ctr.protos.Dbmtl.DBMTL.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (other.hasBottomDnn()) {<NEW_LINE>mergeBottomDnn(other.getBottomDnn());<NEW_LINE>}<NEW_LINE>if (other.hasExpertDnn()) {<NEW_LINE>mergeExpertDnn(other.getExpertDnn());<NEW_LINE>}<NEW_LINE>if (other.hasNumExpert()) {<NEW_LINE>setNumExpert(other.getNumExpert());<NEW_LINE>}<NEW_LINE>if (taskTowersBuilder_ == null) {<NEW_LINE>if (!other.taskTowers_.isEmpty()) {<NEW_LINE>if (taskTowers_.isEmpty()) {<NEW_LINE>taskTowers_ = other.taskTowers_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>} else {<NEW_LINE>ensureTaskTowersIsMutable();<NEW_LINE>taskTowers_.addAll(other.taskTowers_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.taskTowers_.isEmpty()) {<NEW_LINE>if (taskTowersBuilder_.isEmpty()) {<NEW_LINE>taskTowersBuilder_.dispose();<NEW_LINE>taskTowersBuilder_ = null;<NEW_LINE>taskTowers_ = other.taskTowers_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>taskTowersBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getTaskTowersFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (other.hasL2Regularization()) {<NEW_LINE>setL2Regularization(other.getL2Regularization());<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>} | taskTowersBuilder_.addAllMessages(other.taskTowers_); |
1,700,761 | public BotExportSpecification unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BotExportSpecification botExportSpecification = new BotExportSpecification();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("botId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>botExportSpecification.setBotId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("botVersion", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>botExportSpecification.setBotVersion(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return botExportSpecification;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
651,404 | protected B deepMerge(MergingKey key, MergeableNode node) {<NEW_LINE>// compotes id from current key<NEW_LINE>ID id = id(key);<NEW_LINE>if (key.isLeaf()) {<NEW_LINE>// merges leaf nodes<NEW_LINE>merge(id, node);<NEW_LINE>} else {<NEW_LINE>// get current member associated with id<NEW_LINE>MergeableNode member = member(id);<NEW_LINE>// merges current member with specified node<NEW_LINE>switch(member.nodeType()) {<NEW_LINE>case OBJECT:<NEW_LINE>mergeObjectMember((ObjectNode) member, key, node, id);<NEW_LINE>break;<NEW_LINE>case LIST:<NEW_LINE>mergeListMember((ListNode) member, key, node, id);<NEW_LINE>break;<NEW_LINE>case VALUE:<NEW_LINE>mergeValueMember((ValueNode) <MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unsupported node type: " + member.getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return thisBuilder;<NEW_LINE>} | member, key, node, id); |
1,474,402 | public static void percentiles(long[] counts, double[] pcts, double[] results) {<NEW_LINE>Preconditions.checkArg(counts.length == BUCKET_VALUES.length, "counts is not the same size as buckets array");<NEW_LINE>Preconditions.checkArg(pcts.length > 0, "pct array cannot be empty");<NEW_LINE>Preconditions.checkArg(pcts.length == results.length, "pcts is not the same size as results array");<NEW_LINE>long total = 0L;<NEW_LINE>for (long c : counts) {<NEW_LINE>total += c;<NEW_LINE>}<NEW_LINE>int pctIdx = 0;<NEW_LINE>long prev = 0;<NEW_LINE>double prevP = 0.0;<NEW_LINE>long prevB = 0;<NEW_LINE>for (int i = 0; i < BUCKET_VALUES.length; ++i) {<NEW_LINE>long next = prev + counts[i];<NEW_LINE><MASK><NEW_LINE>long nextB = BUCKET_VALUES[i];<NEW_LINE>while (pctIdx < pcts.length && nextP >= pcts[pctIdx]) {<NEW_LINE>double f = (pcts[pctIdx] - prevP) / (nextP - prevP);<NEW_LINE>results[pctIdx] = f * (nextB - prevB) + prevB;<NEW_LINE>++pctIdx;<NEW_LINE>}<NEW_LINE>if (pctIdx >= pcts.length)<NEW_LINE>break;<NEW_LINE>prev = next;<NEW_LINE>prevP = nextP;<NEW_LINE>prevB = nextB;<NEW_LINE>}<NEW_LINE>double nextP = 100.0;<NEW_LINE>long nextB = Long.MAX_VALUE;<NEW_LINE>while (pctIdx < pcts.length) {<NEW_LINE>double f = (pcts[pctIdx] - prevP) / (nextP - prevP);<NEW_LINE>results[pctIdx] = f * (nextB - prevB) + prevB;<NEW_LINE>++pctIdx;<NEW_LINE>}<NEW_LINE>} | double nextP = 100.0 * next / total; |
538,818 | final UpdateWorkspaceResult executeUpdateWorkspace(UpdateWorkspaceRequest updateWorkspaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateWorkspaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateWorkspaceRequest> request = null;<NEW_LINE>Response<UpdateWorkspaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateWorkspaceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateWorkspaceRequest));<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, "IoTTwinMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateWorkspace");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "api.";<NEW_LINE>String resolvedHostPrefix = String.format("api.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateWorkspaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateWorkspaceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | responseHandler, executionContext, null, endpointTraitHost); |
232,070 | public void read(org.apache.thrift.protocol.TProtocol iprot, ByteArray struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // LENGTH<NEW_LINE>1:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.I64) {<NEW_LINE>struct<MASK><NEW_LINE>struct.setLengthIsSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>// check for required fields of primitive type, which can't be checked in the validate method<NEW_LINE>struct.validate();<NEW_LINE>} | .length = iprot.readI64(); |
863,914 | public void addSegment(String title) {<NEW_LINE>final Context context = getContext();<NEW_LINE>final LayoutInflater inflater = LayoutInflater.from(context);<NEW_LINE>if (mDividerDrawable != null && getSegmentCount() > 0) {<NEW_LINE>ImageView divider = new ImageView(context);<NEW_LINE>final int width = (mDividerWidth > 0) ? mDividerWidth : mDividerDrawable.getIntrinsicWidth();<NEW_LINE>final LinearLayout.LayoutParams lp = new LayoutParams(width, LayoutParams.FILL_PARENT);<NEW_LINE>lp.setMargins(0, 0, 0, 0);<NEW_LINE>divider.setLayoutParams(lp);<NEW_LINE>divider.setBackgroundDrawable(mDividerDrawable);<NEW_LINE>addView(divider);<NEW_LINE>}<NEW_LINE>CheckBox segment = (CheckBox) inflater.inflate(R.<MASK><NEW_LINE>segment.setText(title);<NEW_LINE>segment.setClickable(true);<NEW_LINE>segment.setFocusable(true);<NEW_LINE>segment.setOnFocusChangeListener(this);<NEW_LINE>segment.setOnCheckedChangeListener(new SegmentCheckedListener(getSegmentCount()));<NEW_LINE>segment.setOnClickListener(new SegmentClickedListener(getSegmentCount()));<NEW_LINE>addView(segment);<NEW_LINE>} | layout.gd_segment, this, false); |
491,339 | public ClientVpnAuthentication unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ClientVpnAuthentication clientVpnAuthentication = new ClientVpnAuthentication();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return clientVpnAuthentication;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("type", targetDepth)) {<NEW_LINE>clientVpnAuthentication.setType(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("activeDirectory", targetDepth)) {<NEW_LINE>clientVpnAuthentication.setActiveDirectory(DirectoryServiceAuthenticationStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("mutualAuthentication", targetDepth)) {<NEW_LINE>clientVpnAuthentication.setMutualAuthentication(CertificateAuthenticationStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("federatedAuthentication", targetDepth)) {<NEW_LINE>clientVpnAuthentication.setFederatedAuthentication(FederatedAuthenticationStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return clientVpnAuthentication;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
1,646,704 | public static DescribeVpcsResponse unmarshall(DescribeVpcsResponse describeVpcsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVpcsResponse.setRequestId(_ctx.stringValue("DescribeVpcsResponse.RequestId"));<NEW_LINE>describeVpcsResponse.setPageSize(_ctx.integerValue("DescribeVpcsResponse.PageSize"));<NEW_LINE>describeVpcsResponse.setPageNumber(_ctx.integerValue("DescribeVpcsResponse.PageNumber"));<NEW_LINE>describeVpcsResponse.setTotalCount(_ctx.integerValue("DescribeVpcsResponse.TotalCount"));<NEW_LINE>List<Vpc> vpcs = new ArrayList<Vpc>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVpcsResponse.Vpcs.Length"); i++) {<NEW_LINE>Vpc vpc = new Vpc();<NEW_LINE>vpc.setCreationTime(_ctx.stringValue("DescribeVpcsResponse.Vpcs[" + i + "].CreationTime"));<NEW_LINE>vpc.setVpcName(_ctx.stringValue("DescribeVpcsResponse.Vpcs[" + i + "].VpcName"));<NEW_LINE>vpc.setStatus(_ctx.stringValue("DescribeVpcsResponse.Vpcs[" + i + "].Status"));<NEW_LINE>vpc.setVpcId(_ctx.stringValue("DescribeVpcsResponse.Vpcs[" + i + "].VpcId"));<NEW_LINE>vpc.setVRouterId(_ctx.stringValue("DescribeVpcsResponse.Vpcs[" + i + "].VRouterId"));<NEW_LINE>vpc.setIsDefault(_ctx.booleanValue("DescribeVpcsResponse.Vpcs[" + i + "].IsDefault"));<NEW_LINE>vpc.setCidrBlock(_ctx.stringValue<MASK><NEW_LINE>vpc.setDescription(_ctx.stringValue("DescribeVpcsResponse.Vpcs[" + i + "].Description"));<NEW_LINE>vpc.setRegionId(_ctx.stringValue("DescribeVpcsResponse.Vpcs[" + i + "].RegionId"));<NEW_LINE>List<String> vSwitchIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeVpcsResponse.Vpcs[" + i + "].VSwitchIds.Length"); j++) {<NEW_LINE>vSwitchIds.add(_ctx.stringValue("DescribeVpcsResponse.Vpcs[" + i + "].VSwitchIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>vpc.setVSwitchIds(vSwitchIds);<NEW_LINE>List<String> userCidrs = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeVpcsResponse.Vpcs[" + i + "].UserCidrs.Length"); j++) {<NEW_LINE>userCidrs.add(_ctx.stringValue("DescribeVpcsResponse.Vpcs[" + i + "].UserCidrs[" + j + "]"));<NEW_LINE>}<NEW_LINE>vpc.setUserCidrs(userCidrs);<NEW_LINE>vpcs.add(vpc);<NEW_LINE>}<NEW_LINE>describeVpcsResponse.setVpcs(vpcs);<NEW_LINE>return describeVpcsResponse;<NEW_LINE>} | ("DescribeVpcsResponse.Vpcs[" + i + "].CidrBlock")); |
651,608 | public static void fireEvent(String eventType) {<NEW_LINE>BeanManager beanManager = null;<NEW_LINE>try {<NEW_LINE>beanManager = CDI.current().getBeanManager();<NEW_LINE>} catch (Exception e) {<NEW_LINE>log("Can't get instance of BeanManager to process TransactionScoped CDI Event!");<NEW_LINE>}<NEW_LINE>if (beanManager != null) {<NEW_LINE>// TransactionScopedCDIEventHelperImpl AnnotatedType is created in Extension<NEW_LINE>Set<Bean<?>> availableBeans = <MASK><NEW_LINE>if (null != availableBeans && !availableBeans.isEmpty()) {<NEW_LINE>Bean<?> bean = beanManager.resolve(availableBeans);<NEW_LINE>TransactionScopedCDIEventHelper eventHelper = (TransactionScopedCDIEventHelper) beanManager.getReference(bean, bean.getBeanClass(), beanManager.createCreationalContext(null));<NEW_LINE>if (eventType.equalsIgnoreCase(INITIALIZED_EVENT)) {<NEW_LINE>eventHelper.fireInitializedEvent(new TransactionScopedCDIEventPayload());<NEW_LINE>} else {<NEW_LINE>eventHelper.fireDestroyedEvent(new TransactionScopedCDIEventPayload());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log("Can't get instance of BeanManager to process TransactionScoped CDI Event!");<NEW_LINE>}<NEW_LINE>} | beanManager.getBeans(TransactionScopedCDIEventHelperImpl.class); |
1,472,932 | private boolean stepBackAndFindPrevPointInRoute(GpxRouteApproximation gctx, List<GpxPoint> gpxPoints, GpxPoint start, GpxPoint next) throws IOException {<NEW_LINE>// step back to find to be sure<NEW_LINE>// 1) route point is behind GpxPoint - minPointApproximation (end route point could slightly ahead)<NEW_LINE>// 2) we don't miss correct turn i.e. points could be attached to muliple routes<NEW_LINE>// 3) to make sure that we perfectly connect to RoadDataObject points<NEW_LINE>double STEP_BACK_DIST = Math.max(gctx.ctx.config.minPointApproximation, gctx.ctx.config.minStepApproximation);<NEW_LINE>double d = 0;<NEW_LINE>int segmendInd = start.routeToTarget.size() - 1;<NEW_LINE>boolean search = true;<NEW_LINE>start.stepBackRoute = new ArrayList<RouteSegmentResult>();<NEW_LINE>mainLoop: for (; segmendInd >= 0 && search; segmendInd--) {<NEW_LINE>RouteSegmentResult rr = start.routeToTarget.get(segmendInd);<NEW_LINE>boolean minus = rr.getStartPointIndex() < rr.getEndPointIndex();<NEW_LINE>int nextInd;<NEW_LINE>for (int j = rr.getEndPointIndex(); j != rr.getStartPointIndex(); j = nextInd) {<NEW_LINE>nextInd = minus ? j - 1 : j + 1;<NEW_LINE>d += MapUtils.getDistance(rr.getPoint(j), rr.getPoint(nextInd));<NEW_LINE>if (d > STEP_BACK_DIST) {<NEW_LINE>if (nextInd == rr.getStartPointIndex()) {<NEW_LINE>segmendInd--;<NEW_LINE>} else {<NEW_LINE>start.stepBackRoute.add(new RouteSegmentResult(rr.getObject(), nextInd<MASK><NEW_LINE>rr.setEndPointIndex(nextInd);<NEW_LINE>}<NEW_LINE>search = false;<NEW_LINE>break mainLoop;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (segmendInd == -1) {<NEW_LINE>// here all route segments - 1 is longer than needed distance to step back<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>while (start.routeToTarget.size() > segmendInd + 1) {<NEW_LINE>RouteSegmentResult removed = start.routeToTarget.remove(segmendInd + 1);<NEW_LINE>start.stepBackRoute.add(removed);<NEW_LINE>}<NEW_LINE>RouteSegmentResult res = start.routeToTarget.get(segmendInd);<NEW_LINE>next.pnt = new RouteSegmentPoint(res.getObject(), res.getEndPointIndex(), 0);<NEW_LINE>return true;<NEW_LINE>} | , rr.getEndPointIndex())); |
1,653,116 | protected void overrideClass(Class clazz) throws Exception {<NEW_LINE>if (null == getClassReloadingStrategy()) {<NEW_LINE>Logger.error(this, "bytebuddy ClassReloadingStrategy not set [java agent not set?]");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!clazz.getClassLoader().equals(getBundleClassloader())) {<NEW_LINE>Logger.error(this, "Class:" + clazz.getName() + " not loaded from bundle classloader, cannot override/inject into dotCMS");<NEW_LINE>}<NEW_LINE>Logger.info(this.getClass().getName(), "Injecting: " + clazz.getName(<MASK><NEW_LINE>Logger.debug(this.getClass().getName(), "bundle classloader :" + getBundleClassloader());<NEW_LINE>Logger.debug(this.getClass().getName(), "context classloader:" + getWebAppClassloader());<NEW_LINE>ByteBuddyAgent.install();<NEW_LINE>new ByteBuddy().rebase(clazz, ClassFileLocator.ForClassLoader.of(getBundleClassloader())).name(clazz.getName()).make().load(getWebAppClassloader(), this.getClassReloadingStrategy());<NEW_LINE>this.overriddenClasses.add(clazz.getName());<NEW_LINE>} | ) + " into classloader: " + getWebAppClassloader()); |
614,817 | private Builder addPutBlobHeaders(CreateBlobOptions options, Builder builder) {<NEW_LINE>builder = addOptionalHeader(builder, "Content-Type", options.getContentType());<NEW_LINE>if (options.getContentType() == null) {<NEW_LINE>// Note: Add content type here to enable proper HMAC signing<NEW_LINE>builder = builder.type("application/octet-stream");<NEW_LINE>}<NEW_LINE>builder = addOptionalHeader(builder, <MASK><NEW_LINE>builder = addOptionalHeader(builder, "Content-Language", options.getContentLanguage());<NEW_LINE>builder = addOptionalHeader(builder, "Content-MD5", options.getContentMD5());<NEW_LINE>builder = addOptionalHeader(builder, "Cache-Control", options.getCacheControl());<NEW_LINE>builder = addOptionalHeader(builder, "x-ms-blob-content-type", options.getBlobContentType());<NEW_LINE>builder = addOptionalHeader(builder, "x-ms-blob-content-encoding", options.getBlobContentEncoding());<NEW_LINE>builder = addOptionalHeader(builder, "x-ms-blob-content-language", options.getBlobContentLanguage());<NEW_LINE>builder = addOptionalHeader(builder, "x-ms-blob-content-md5", options.getBlobContentMD5());<NEW_LINE>builder = addOptionalHeader(builder, "x-ms-blob-cache-control", options.getBlobCacheControl());<NEW_LINE>builder = addOptionalHeader(builder, "x-ms-lease-id", options.getLeaseId());<NEW_LINE>builder = addOptionalMetadataHeader(builder, options.getMetadata());<NEW_LINE>builder = addOptionalAccessConditionHeader(builder, options.getAccessCondition());<NEW_LINE>return builder;<NEW_LINE>} | "Content-Encoding", options.getContentEncoding()); |
1,478,243 | public static void putInt64Uncheck(byte[] dest, int start, long l) {<NEW_LINE>if (ByteOrder.BIG_ENDIAN == PLATFORM_ENDIAN) {<NEW_LINE>dest[start + 7] = (byte) (l & 0xff);<NEW_LINE>dest[start + 6] = (byte) (l >> 8 & 0xff);<NEW_LINE>dest[start + 5] = (byte) (l >> 16 & 0xff);<NEW_LINE>dest[start + 4] = (byte) (l >> 24 & 0xff);<NEW_LINE>dest[start + 3] = (byte) (l >> 32 & 0xff);<NEW_LINE>dest[start + 2] = (byte) (l >> 40 & 0xff);<NEW_LINE>dest[start + 1] = (byte) (l >> 48 & 0xff);<NEW_LINE>dest[start] = (byte) (l >> 56 & 0xff);<NEW_LINE>} else {<NEW_LINE>dest[start] = <MASK><NEW_LINE>dest[start + 1] = (byte) (l >> 8 & 0xff);<NEW_LINE>dest[start + 2] = (byte) (l >> 16 & 0xff);<NEW_LINE>dest[start + 3] = (byte) (l >> 24 & 0xff);<NEW_LINE>dest[start + 4] = (byte) (l >> 32 & 0xff);<NEW_LINE>dest[start + 5] = (byte) (l >> 40 & 0xff);<NEW_LINE>dest[start + 6] = (byte) (l >> 48 & 0xff);<NEW_LINE>dest[start + 7] = (byte) (l >> 56 & 0xff);<NEW_LINE>}<NEW_LINE>} | (byte) (l & 0xff); |
1,187,868 | private void handle(final ChangeHostStateMsg msg) {<NEW_LINE>ChangeHostStateReply reply = new ChangeHostStateReply();<NEW_LINE>thdf.chainSubmit(new ChainTask(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getSyncSignature() {<NEW_LINE>return String.format("change-host-state-%s", self.getUuid());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(SyncTaskChain chain) {<NEW_LINE>doHostStateChange(msg, new Completion(msg, chain) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE>reply.setInventory(HostInventory.valueOf(self));<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>reply.setError(errorCode);<NEW_LINE><MASK><NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getName() {<NEW_LINE>return String.format("change-host-state-%s", self.getUuid());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | bus.reply(msg, reply); |
429,252 | private void scanInjectableFields(Class<?> beanClazz) {<NEW_LINE>InjectableFields fieldDecls = new InjectableFields();<NEW_LINE>List<Field> fieldsToScan = new ArrayList<>(Arrays.asList(beanClazz.getDeclaredFields()));<NEW_LINE>Class<?> superclazz = beanClazz.getSuperclass();<NEW_LINE>while (superclazz != Object.class) {<NEW_LINE>fieldsToScan.addAll(Arrays.asList(superclazz.getDeclaredFields()));<NEW_LINE>superclazz = superclazz.getSuperclass();<NEW_LINE>}<NEW_LINE>for (Field field : fieldsToScan) {<NEW_LINE>log.debug(" Scanning field " + field.getName());<NEW_LINE>if (field.getAnnotations().length > 0) {<NEW_LINE>// prefer more specific Named fields<NEW_LINE>Named namedAnno = <MASK><NEW_LINE>if (namedAnno != null) {<NEW_LINE>log.debug(" Using @Named: " + namedAnno.value());<NEW_LINE>fieldDecls.add(field, field.getType(), namedAnno.value());<NEW_LINE>} else {<NEW_LINE>log.debug(" Using @Inject");<NEW_LINE>Inject injectAnno = field.getAnnotation(Inject.class);<NEW_LINE>if (injectAnno != null) {<NEW_LINE>fieldDecls.add(field, field.getType(), null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_fieldDependencyDeclarations.put(beanClazz, fieldDecls);<NEW_LINE>} | field.getAnnotation(Named.class); |
207,312 | protected void drawSplitHalfFrame(Graphics2D g, CardPanelAttributes attribs, HalfCardProps half, int typeLineY) {<NEW_LINE>// Get the border paint<NEW_LINE>Color boxColor = getBoxColor(half.color, cardView.getCardTypes(), attribs.isTransformed);<NEW_LINE>Paint textboxPaint = getTextboxPaint(half.color, cardView.getCardTypes(), cardWidth, false);<NEW_LINE>Paint borderPaint = getBorderPaint(half.color, cardView.getCardTypes(), cardWidth);<NEW_LINE>// Draw main frame<NEW_LINE>g.setPaint(borderPaint);<NEW_LINE>g.drawRect(0, 0, half.cw - 1, half.ch - 1);<NEW_LINE>// Background of textbox<NEW_LINE>g.setPaint(textboxPaint);<NEW_LINE>g.fillRect(1, typeLineY, half.cw - 2, <MASK><NEW_LINE>// Draw the name line box<NEW_LINE>CardRendererUtils.drawRoundedBox(g, -borderWidth, 0, half.cw + 2 * borderWidth, boxHeight, contentInset, borderPaint, boxColor);<NEW_LINE>// Draw the type line box<NEW_LINE>CardRendererUtils.drawRoundedBox(g, -borderWidth, typeLineY, half.cw + 2 * borderWidth, boxHeight - 4, contentInset, borderPaint, boxColor);<NEW_LINE>// Draw the name line<NEW_LINE>drawNameLine(g, attribs, half.name, half.manaCostString, 0, 0, half.cw, boxHeight);<NEW_LINE>// Draw the type line<NEW_LINE>drawTypeLine(g, attribs, half.typeLineString, 0, typeLineY, half.cw, boxHeight - 4, true);<NEW_LINE>// Draw the textbox rules<NEW_LINE>drawRulesText(g, half.keywords, half.rules, 2, typeLineY + boxHeight + 2 - 4, half.cw - 4, half.ch - typeLineY - boxHeight, false);<NEW_LINE>} | half.ch - typeLineY - 1); |
1,267,012 | private static Map.Entry<Long, Integer> parseConcat(String concat) {<NEW_LINE>int <MASK><NEW_LINE>Preconditions.checkArgument(pos > 0 && pos < concat.length() - 1, "%s value '%s' is invalid.", KEY_CONCAT, concat);<NEW_LINE>String count = concat.substring(0, pos);<NEW_LINE>String offset = concat.substring(pos + CONCAT_SEPARATOR.length());<NEW_LINE>try {<NEW_LINE>val result = new AbstractMap.SimpleImmutableEntry<Long, Integer>(Long.parseLong(offset), Integer.parseInt(count));<NEW_LINE>Preconditions.checkArgument(result.getKey() >= 0 && result.getValue() >= 0, "%s value '%s' is invalid.", KEY_CONCAT, concat);<NEW_LINE>return result;<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>throw new IllegalArgumentException(String.format("%s value '%s' is invalid.", KEY_CONCAT, concat), nfe);<NEW_LINE>}<NEW_LINE>} | pos = concat.indexOf(CONCAT_SEPARATOR); |
1,321,034 | public static void init(ThreadContext context, IRubyObject self, IRubyObject[] args) {<NEW_LINE>int count = Arity.checkArgumentCount(context.getRuntime(), args, 1, 4);<NEW_LINE>if (count == 4) {<NEW_LINE>PApplet parent = (PApplet) args[0].toJava(PApplet.class);<NEW_LINE>double cx = (double) args[1].toJava(Double.class);<NEW_LINE>double cy = (double) args[2].toJava(Double.class);<NEW_LINE>double radius = (double) args[3].toJava(Double.class);<NEW_LINE>new Arcball(parent, cx, cy, radius).setActive(true);<NEW_LINE>}<NEW_LINE>if (count == 3) {<NEW_LINE>PApplet parent = (PApplet) args[0].toJava(PApplet.class);<NEW_LINE>double cx = (double) args[1].toJava(Double.class);<NEW_LINE>double cy = (double) args[2].toJava(Double.class);<NEW_LINE>new Arcball(parent, cx, cy, parent.width * 0.8f).setActive(true);<NEW_LINE>}<NEW_LINE>if (count == 1) {<NEW_LINE>PApplet parent = (PApplet) args[0<MASK><NEW_LINE>new Arcball(parent).setActive(true);<NEW_LINE>}<NEW_LINE>} | ].toJava(PApplet.class); |
1,357,113 | static public AuthChallenge parse(String authHeaderStr) {<NEW_LINE>Map<String, String> authHeader = null;<NEW_LINE>try {<NEW_LINE>authHeader = AuthStringTokenizer.parse(authHeaderStr);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!authHeader.containsKey(SCHEME))<NEW_LINE>return null;<NEW_LINE>AuthScheme authScheme = AuthScheme.scheme<MASK><NEW_LINE>switch(authScheme) {<NEW_LINE>case DIGEST:<NEW_LINE>nonNull(RFC2617.strNonce, authHeader.get(RFC2617.strNonce));<NEW_LINE>nonNull(RFC2617.strRealm, authHeader.get(RFC2617.strRealm));<NEW_LINE>break;<NEW_LINE>case BASIC:<NEW_LINE>nonNull(RFC2617.strRealm, authHeader.get(RFC2617.strRealm));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return new // Required for digest, not for basic.<NEW_LINE>AuthChallenge(// Required for digest, not for basic.<NEW_LINE>authScheme, // Required for digest, not for basic.<NEW_LINE>authHeader.get(RFC2617.strRealm), authHeader.get(RFC2617.strNonce), authHeader.get(RFC2617.strOpaque), authHeader.get(RFC2617.strQop), authHeader);<NEW_LINE>} catch (NullPointerException ex) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | (authHeader.get(SCHEME)); |
1,319,080 | private void ReadDocumentStreamed(XmlPullParser xpp) throws XmlPullParserException, IOException, InvalidDBException {<NEW_LINE>ctxGroups.clear();<NEW_LINE>KdbContext ctx = KdbContext.Null;<NEW_LINE>readNextNode = true;<NEW_LINE>while (true) {<NEW_LINE>if (readNextNode) {<NEW_LINE>if (xpp.next() == XmlPullParser.END_DOCUMENT)<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>readNextNode = true;<NEW_LINE>}<NEW_LINE>switch(xpp.getEventType()) {<NEW_LINE>case XmlPullParser.START_TAG:<NEW_LINE>ctx = ReadXmlElement(ctx, xpp);<NEW_LINE>break;<NEW_LINE>case XmlPullParser.END_TAG:<NEW_LINE>ctx = EndXmlElement(ctx, xpp);<NEW_LINE>break;<NEW_LINE>case XmlPullParser.TEXT:<NEW_LINE>// Only expect all whitespace text nodes<NEW_LINE>String text = xpp.getText();<NEW_LINE>assert (text.trim(<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>assert (false);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Error checks<NEW_LINE>if (ctx != KdbContext.Null)<NEW_LINE>throw new IOException("Malformed");<NEW_LINE>if (ctxGroups.size() != 0)<NEW_LINE>throw new IOException("Malformed");<NEW_LINE>} | ).length() == 0); |
741,120 | public void start() {<NEW_LINE>if (hasRedissonInstance) {<NEW_LINE>redisson = Redisson.create(config);<NEW_LINE>}<NEW_LINE>retrieveAddresses();<NEW_LINE>if (config.getRedissonNodeInitializer() != null) {<NEW_LINE>config.<MASK><NEW_LINE>}<NEW_LINE>int mapReduceWorkers = config.getMapReduceWorkers();<NEW_LINE>if (mapReduceWorkers != -1) {<NEW_LINE>if (mapReduceWorkers == 0) {<NEW_LINE>mapReduceWorkers = Runtime.getRuntime().availableProcessors();<NEW_LINE>}<NEW_LINE>WorkerOptions options = WorkerOptions.defaults().workers(mapReduceWorkers).beanFactory(config.getBeanFactory());<NEW_LINE>redisson.getExecutorService(RExecutorService.MAPREDUCE_NAME).registerWorkers(options);<NEW_LINE>log.info("{} map reduce worker(s) registered", mapReduceWorkers);<NEW_LINE>}<NEW_LINE>for (Entry<String, Integer> entry : config.getExecutorServiceWorkers().entrySet()) {<NEW_LINE>String name = entry.getKey();<NEW_LINE>int workers = entry.getValue();<NEW_LINE>WorkerOptions options = WorkerOptions.defaults().workers(workers).beanFactory(config.getBeanFactory());<NEW_LINE>redisson.getExecutorService(name).registerWorkers(options);<NEW_LINE>log.info("{} worker(s) registered for ExecutorService with '{}' name", workers, name);<NEW_LINE>}<NEW_LINE>log.info("Redisson node started!");<NEW_LINE>} | getRedissonNodeInitializer().onStartup(this); |
1,514,945 | public Conformity check(Cluster cluster) {<NEW_LINE>List<String> asgNames = Lists.newArrayList();<NEW_LINE>for (AutoScalingGroup asg : cluster.getAutoScalingGroups()) {<NEW_LINE>asgNames.add(asg.getName());<NEW_LINE>}<NEW_LINE>Collection<String> failedComponents = Lists.newArrayList();<NEW_LINE>for (AutoScalingGroup asg : cluster.getAutoScalingGroups()) {<NEW_LINE>List<String> asgZones = getAvailabilityZonesForAsg(cluster.getRegion(), asg.getName());<NEW_LINE>for (String lbName : getLoadBalancerNamesForAsg(cluster.getRegion(), asg.getName())) {<NEW_LINE>List<String> lbZones = getAvailabilityZonesForLoadBalancer(<MASK><NEW_LINE>if (!haveSameZones(asgZones, lbZones)) {<NEW_LINE>LOGGER.info(String.format("ASG %s and ELB %s do not have the same availability zones", asgZones, lbZones));<NEW_LINE>failedComponents.add(lbName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Conformity(getName(), failedComponents);<NEW_LINE>} | cluster.getRegion(), lbName); |
1,045,801 | public static void serialize(final LocalDate value, final JsonWriter sw) {<NEW_LINE>final int year = value.getYear();<NEW_LINE>if (year < 0) {<NEW_LINE>throw new SerializationException("Negative dates are not supported.");<NEW_LINE>} else if (year > 9999) {<NEW_LINE>sw.writeByte(JsonWriter.QUOTE);<NEW_LINE>NumberConverter.serialize(year, sw);<NEW_LINE>sw.writeByte((byte) '-');<NEW_LINE>NumberConverter.serialize(value.getMonthOfYear(), sw);<NEW_LINE>sw<MASK><NEW_LINE>NumberConverter.serialize(value.getDayOfMonth(), sw);<NEW_LINE>sw.writeByte(JsonWriter.QUOTE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final byte[] buf = sw.ensureCapacity(12);<NEW_LINE>final int pos = sw.size();<NEW_LINE>buf[pos] = '"';<NEW_LINE>NumberConverter.write4(year, buf, pos + 1);<NEW_LINE>buf[pos + 5] = '-';<NEW_LINE>NumberConverter.write2(value.getMonthOfYear(), buf, pos + 6);<NEW_LINE>buf[pos + 8] = '-';<NEW_LINE>NumberConverter.write2(value.getDayOfMonth(), buf, pos + 9);<NEW_LINE>buf[pos + 11] = '"';<NEW_LINE>sw.advance(12);<NEW_LINE>} | .writeByte((byte) '-'); |
676,914 | protected FGPrimaryViewer createPrimaryGraphViewer(VisualGraphLayout<FGVertex, FGEdge> layout, Dimension viewerSize) {<NEW_LINE>FGPrimaryViewer viewer = new FGPrimaryViewer(this, layout, viewerSize);<NEW_LINE>RenderContext<FGVertex, FGEdge> renderContext = viewer.getRenderContext();<NEW_LINE>FGEdgePaintTransformer edgePaintTransformer = new FGEdgePaintTransformer(getFucntionGraphOptions());<NEW_LINE>renderContext.setEdgeDrawPaintTransformer(edgePaintTransformer);<NEW_LINE>renderContext.setArrowDrawPaintTransformer(edgePaintTransformer);<NEW_LINE>renderContext.setArrowFillPaintTransformer(edgePaintTransformer);<NEW_LINE>Renderer<FGVertex, FGEdge> renderer = viewer.getRenderer();<NEW_LINE>renderer.setVertexRenderer(new FGVertexRenderer());<NEW_LINE>// for background colors when we are zoomed to far to render the listing<NEW_LINE>PickedState<FGVertex> pickedVertexState = viewer.getPickedVertexState();<NEW_LINE>renderContext.setVertexFillPaintTransformer(new FGVertexPickableBackgroundPaintTransformer(pickedVertexState, Color.YELLOW, START_COLOR, END_COLOR));<NEW_LINE>// edge label rendering<NEW_LINE>com.google.common.base.Function<FGEdge, String> edgeLabelTransformer <MASK><NEW_LINE>renderContext.setEdgeLabelTransformer(edgeLabelTransformer);<NEW_LINE>// note: this label renderer is the stamp for the label; we use another edge label<NEW_LINE>// renderer inside of the VisualGraphRenderer<NEW_LINE>VisualGraphEdgeLabelRenderer edgeLabelRenderer = new VisualGraphEdgeLabelRenderer(Color.BLACK);<NEW_LINE>edgeLabelRenderer.setNonPickedForegroundColor(Color.LIGHT_GRAY);<NEW_LINE>edgeLabelRenderer.setRotateEdgeLabels(false);<NEW_LINE>renderContext.setEdgeLabelRenderer(edgeLabelRenderer);<NEW_LINE>viewer.setGraphOptions(vgOptions);<NEW_LINE>Color bgColor = vgOptions.getGraphBackgroundColor();<NEW_LINE>if (bgColor.equals(VisualGraphOptions.DEFAULT_GRAPH_BACKGROUND_COLOR)) {<NEW_LINE>// Give user notice when seeing the graph for a non-function (such as an undefined<NEW_LINE>// function), as this is typical for Ghidra UI widgets.<NEW_LINE>// Don't do this if the user has manually set the background color (this would require<NEW_LINE>// another option).<NEW_LINE>Function function = functionGraphData.getFunction();<NEW_LINE>if (function instanceof UndefinedFunction) {<NEW_LINE>viewer.setBackground(UNDEFINED_FUNCTION_COLOR);<NEW_LINE>} else {<NEW_LINE>viewer.setBackground(Color.WHITE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return viewer;<NEW_LINE>} | = e -> e.getLabel(); |
1,577,253 | private void insertTimerScheduler(HttpServletRequest request, TimerSchedulerEntity timerSchedulerEntity) throws GovernanceException {<NEW_LINE>try {<NEW_LINE>if (!this.checkProcessorExist(request)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.setRuleDataBaseUrl(timerSchedulerEntity);<NEW_LINE>String url = new StringBuffer(this.getProcessorUrl()).append(ConstantProperties.TIMER_SCHEDULER_INSERT).toString();<NEW_LINE>String jsonString = JsonHelper.object2Json(timerSchedulerEntity);<NEW_LINE>Map map = JsonHelper.json2Object(jsonString, Map.class);<NEW_LINE>map.put("updatedTime", timerSchedulerEntity.getLastUpdate());<NEW_LINE>map.put("createdTime", timerSchedulerEntity.getCreateDate());<NEW_LINE>// updateCEPRuleById<NEW_LINE>log.info("insert timerScheduler ====map:{}", JsonHelper.object2Json(map));<NEW_LINE>CloseableHttpResponse closeResponse = commonService.getCloseResponse(request, url, JsonHelper.object2Json(map));<NEW_LINE>String updateMes = EntityUtils.toString(closeResponse.getEntity());<NEW_LINE>log.info("insert timerScheduler ====result:{}", updateMes);<NEW_LINE>// deal processor result<NEW_LINE>int statusCode = closeResponse.getStatusLine().getStatusCode();<NEW_LINE>if (200 != statusCode) {<NEW_LINE>throw new GovernanceException(ErrorCode.PROCESS_CONNECT_ERROR);<NEW_LINE>}<NEW_LINE>Map jsonObject = JsonHelper.json2Object(updateMes, Map.class);<NEW_LINE>Integer code = Integer.valueOf(jsonObject.get("errorCode").toString());<NEW_LINE>if (PROCESSOR_SUCCESS_CODE != code) {<NEW_LINE>String msg = jsonObject.get("errorMsg").toString();<NEW_LINE>throw new GovernanceException(msg);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>throw new GovernanceException("processor insert timerScheduler fail", e);<NEW_LINE>}<NEW_LINE>} | log.error("processor insert timerScheduler fail", e); |
1,246,363 | private void onQueueComplete(long handle) {<NEW_LINE>logDebug("onQueueComplete");<NEW_LINE>if ((lock != null) && (lock.isHeld()))<NEW_LINE>try {<NEW_LINE>lock.release();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>}<NEW_LINE>if ((wl != null) && (wl.isHeld()))<NEW_LINE>try {<NEW_LINE>wl.release();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>}<NEW_LINE>showCompleteNotification(handle);<NEW_LINE>stopForeground();<NEW_LINE>rootNode = null;<NEW_LINE>int pendingDownloads = getNumPendingDownloadsNonBackground(megaApi);<NEW_LINE>logDebug("onQueueComplete: total of files before reset " + pendingDownloads);<NEW_LINE>if (pendingDownloads <= 0) {<NEW_LINE>logDebug("onQueueComplete: reset total downloads");<NEW_LINE>// When download a single file by tapping it, and auto play is enabled.<NEW_LINE>int totalDownloads = megaApi.getTotalDownloads() - backgroundTransfers.size();<NEW_LINE>if (totalDownloads == 1 && Boolean.parseBoolean(dbH.getAutoPlayEnabled()) && autoPlayInfo != null && downloadByTap) {<NEW_LINE>sendBroadcast(new Intent(BROADCAST_ACTION_INTENT_SHOWSNACKBAR_TRANSFERS_FINISHED).putExtra(TRANSFER_TYPE, DOWNLOAD_TRANSFER_OPEN).putExtra(NODE_NAME, autoPlayInfo.getNodeName()).putExtra(NODE_HANDLE, autoPlayInfo.getNodeHandle()).putExtra(NUMBER_FILES, 1).putExtra(NODE_LOCAL_PATH<MASK><NEW_LINE>} else if (totalDownloads > 0) {<NEW_LINE>Intent intent = new Intent(BROADCAST_ACTION_INTENT_SHOWSNACKBAR_TRANSFERS_FINISHED).putExtra(TRANSFER_TYPE, DOWNLOAD_TRANSFER).putExtra(NUMBER_FILES, totalDownloads);<NEW_LINE>if (isDownloadForOffline) {<NEW_LINE>intent.putExtra(OFFLINE_AVAILABLE, true);<NEW_LINE>}<NEW_LINE>sendBroadcast(intent);<NEW_LINE>}<NEW_LINE>sendBroadcast(new Intent(BROADCAST_ACTION_INTENT_TRANSFER_UPDATE));<NEW_LINE>megaApi.resetTotalDownloads();<NEW_LINE>backgroundTransfers.clear();<NEW_LINE>errorEBloqued = 0;<NEW_LINE>errorCount = 0;<NEW_LINE>alreadyDownloaded = 0;<NEW_LINE>}<NEW_LINE>} | , autoPlayInfo.getLocalPath())); |
986,659 | final DeleteProjectVersionResult executeDeleteProjectVersion(DeleteProjectVersionRequest deleteProjectVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteProjectVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteProjectVersionRequest> request = null;<NEW_LINE>Response<DeleteProjectVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteProjectVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteProjectVersionRequest));<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, "Rekognition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteProjectVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteProjectVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteProjectVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
34,218 | public void UIInputReceiverClosed(UIInputReceiver receiver) {<NEW_LINE>if (!receiver.hasSubmittedInput()) {<NEW_LINE>l.manualSpeedValueResult(-1);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String sReturn = receiver.getSubmittedInput();<NEW_LINE>if (sReturn == null) {<NEW_LINE>l.manualSpeedValueResult(-1);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int result = (int) (Double.valueOf(sReturn).doubleValue() * DisplayFormatters.getKinB());<NEW_LINE>if (DisplayFormatters.isRateUsingBits()) {<NEW_LINE>result /= 8;<NEW_LINE>}<NEW_LINE>if (result <= 0) {<NEW_LINE>l.error("non-positive number entered");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>l.manualSpeedValueResult(result);<NEW_LINE>} catch (NumberFormatException er) {<NEW_LINE>MessageBox mb = new MessageBox(shell, <MASK><NEW_LINE>mb.setText(MessageText.getString("MyTorrentsView.dialog.NumberError.title"));<NEW_LINE>mb.setMessage(MessageText.getString("MyTorrentsView.dialog.NumberError.text"));<NEW_LINE>mb.open();<NEW_LINE>l.manualSpeedValueResult(-1);<NEW_LINE>}<NEW_LINE>} | SWT.ICON_ERROR | SWT.OK); |
186,381 | public String toJson() throws JsonProcessingException {<NEW_LINE>JsonObject retVal = new JsonObject();<NEW_LINE>ObjectMapper mapper = mapper();<NEW_LINE>Iterator<T> iter = vocabulary.values().iterator();<NEW_LINE>Class clazz = null;<NEW_LINE>if (iter.hasNext())<NEW_LINE>clazz = iter.next().getClass();<NEW_LINE>else<NEW_LINE>return retVal.getAsString();<NEW_LINE>retVal.addProperty(CLASS_FIELD, mapper.writeValueAsString(this.getClass().getName()));<NEW_LINE>JsonArray jsonValues = new JsonArray();<NEW_LINE>for (T value : vocabulary.values()) {<NEW_LINE>JsonObject item = new JsonObject();<NEW_LINE>item.addProperty(CLASS_FIELD, mapper.writeValueAsString(clazz));<NEW_LINE>item.addProperty(VOCAB_ITEM_FIELD, mapper.writeValueAsString(value));<NEW_LINE>jsonValues.add(item);<NEW_LINE>}<NEW_LINE>retVal.add(VOCAB_LIST_FIELD, jsonValues);<NEW_LINE>retVal.addProperty(DOC_CNT_FIELD, mapper.writeValueAsString(documentsCounter.longValue()));<NEW_LINE>retVal.addProperty(MINW_FREQ_FIELD, mapper.writeValueAsString(minWordFrequency));<NEW_LINE>retVal.addProperty(HUGE_MODEL_FIELD, mapper.writeValueAsString(hugeModelExpected));<NEW_LINE>retVal.addProperty(STOP_WORDS_FIELD<MASK><NEW_LINE>retVal.addProperty(SCAVENGER_FIELD, mapper.writeValueAsString(scavengerThreshold));<NEW_LINE>retVal.addProperty(RETENTION_FIELD, mapper.writeValueAsString(retentionDelay));<NEW_LINE>retVal.addProperty(TOTAL_WORD_FIELD, mapper.writeValueAsString(totalWordCount.longValue()));<NEW_LINE>return retVal.toString();<NEW_LINE>} | , mapper.writeValueAsString(stopWords)); |
1,414,956 | private boolean splitFreeNode(Rect freeNode, Rect usedNode) {<NEW_LINE>// Test with SAT if the rectangles even intersect.<NEW_LINE>if (usedNode.x >= freeNode.x + freeNode.width || usedNode.x + usedNode.width <= freeNode.x || usedNode.y >= freeNode.y + freeNode.height || usedNode.y + usedNode.height <= freeNode.y)<NEW_LINE>return false;<NEW_LINE>if (usedNode.x < freeNode.x + freeNode.width && usedNode.x + usedNode.width > freeNode.x) {<NEW_LINE>// New node at the top side of the used node.<NEW_LINE>if (usedNode.y > freeNode.y && usedNode.y < freeNode.y + freeNode.height) {<NEW_LINE>Rect newNode = new Rect(freeNode);<NEW_LINE>newNode.height = usedNode.y - newNode.y;<NEW_LINE>freeRectangles.add(newNode);<NEW_LINE>}<NEW_LINE>// New node at the bottom side of the used node.<NEW_LINE>if (usedNode.y + usedNode.height < freeNode.y + freeNode.height) {<NEW_LINE>Rect newNode = new Rect(freeNode);<NEW_LINE>newNode.y = usedNode.y + usedNode.height;<NEW_LINE>newNode.height = freeNode.y + freeNode.height - (usedNode.y + usedNode.height);<NEW_LINE>freeRectangles.add(newNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (usedNode.y < freeNode.y + freeNode.height && usedNode.y + usedNode.height > freeNode.y) {<NEW_LINE>// New node at the left side of the used node.<NEW_LINE>if (usedNode.x > freeNode.x && usedNode.x < freeNode.x + freeNode.width) {<NEW_LINE>Rect newNode = new Rect(freeNode);<NEW_LINE>newNode.width = usedNode.x - newNode.x;<NEW_LINE>freeRectangles.add(newNode);<NEW_LINE>}<NEW_LINE>// New node at the right side of the used node.<NEW_LINE>if (usedNode.x + usedNode.width < freeNode.x + freeNode.width) {<NEW_LINE>Rect newNode = new Rect(freeNode);<NEW_LINE>newNode.x = usedNode.x + usedNode.width;<NEW_LINE>newNode.width = freeNode.x + freeNode.width - (<MASK><NEW_LINE>freeRectangles.add(newNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | usedNode.x + usedNode.width); |
1,838,839 | private Mono<Void> executeInternal(URI url, HttpHeaders headers, WebSocketHandler handler) {<NEW_LINE>Sinks.Empty<Void> completion = Sinks.empty();<NEW_LINE>return Mono.deferContextual(contextView -> {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Connecting to " + url);<NEW_LINE>}<NEW_LINE>List<String> protocols = handler.getSubProtocols();<NEW_LINE>ConnectionBuilder builder = createConnectionBuilder(url);<NEW_LINE>DefaultNegotiation negotiation = new DefaultNegotiation(protocols, headers, builder);<NEW_LINE>builder.setClientNegotiation(negotiation);<NEW_LINE>builder.connect().addNotifier(new IoFuture.HandlingNotifier<WebSocketChannel, Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleDone(WebSocketChannel channel, Object attachment) {<NEW_LINE>handleChannel(url, ContextWebSocketHandler.decorate(handler, contextView<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleFailed(IOException ex, Object attachment) {<NEW_LINE>// Ignore result: can't overflow, ok if not first or no one listens<NEW_LINE>completion.tryEmitError(new IllegalStateException("Failed to connect to " + url, ex));<NEW_LINE>}<NEW_LINE>}, null);<NEW_LINE>return completion.asMono();<NEW_LINE>});<NEW_LINE>} | ), completion, negotiation, channel); |
350,126 | public StartPosition unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartPosition startPosition = new StartPosition();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("Id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startPosition.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("AbsoluteTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startPosition.setAbsoluteTime(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("MostRecent", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startPosition.setMostRecent(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return startPosition;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
639,118 | public List<RexNode> forMoveAround(Join join, PredicateType type) {<NEW_LINE><MASK><NEW_LINE>if (join instanceof SemiJoin && joinType == JoinRelType.LEFT) {<NEW_LINE>joinType = JoinRelType.LEFT_SEMI;<NEW_LINE>}<NEW_LINE>final List<RexNode> result = new ArrayList<>();<NEW_LINE>switch(joinType) {<NEW_LINE>case INNER:<NEW_LINE>if (type.columnEquality()) {<NEW_LINE>result.addAll(this.crossEquality);<NEW_LINE>result.addAll(this.leftEquality);<NEW_LINE>result.addAll(this.rightEquality);<NEW_LINE>}<NEW_LINE>if (type.sargable()) {<NEW_LINE>result.addAll(this.left);<NEW_LINE>result.addAll(this.right);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case LEFT:<NEW_LINE>if (type.columnEquality()) {<NEW_LINE>result.addAll(this.crossEquality);<NEW_LINE>result.addAll(this.rightEquality);<NEW_LINE>}<NEW_LINE>if (type.sargable()) {<NEW_LINE>result.addAll(this.right);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RIGHT:<NEW_LINE>if (type.columnEquality()) {<NEW_LINE>result.addAll(this.crossEquality);<NEW_LINE>result.addAll(this.leftEquality);<NEW_LINE>}<NEW_LINE>if (type.sargable()) {<NEW_LINE>result.addAll(this.left);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SEMI:<NEW_LINE>case LEFT_SEMI:<NEW_LINE>if (type.sargable()) {<NEW_LINE>result.addAll(this.left);<NEW_LINE>}<NEW_LINE>case ANTI:<NEW_LINE>if (type.columnEquality()) {<NEW_LINE>result.addAll(this.crossEquality);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | JoinRelType joinType = join.getJoinType(); |
1,827,175 | public PlanFragment visitPhysicalHiveScan(OptExpression optExpression, ExecPlan context) {<NEW_LINE>PhysicalHiveScanOperator node = (PhysicalHiveScanOperator) optExpression.getOp();<NEW_LINE>ScanOperatorPredicates predicates = node.getScanOperatorPredicates();<NEW_LINE>Table referenceTable = node.getTable();<NEW_LINE>context.getDescTbl().addReferencedTable(referenceTable);<NEW_LINE>TupleDescriptor tupleDescriptor = context.getDescTbl().createTupleDescriptor();<NEW_LINE>tupleDescriptor.setTable(referenceTable);<NEW_LINE>prepareContextSlots(node, context, tupleDescriptor);<NEW_LINE>HdfsScanNode hdfsScanNode = new HdfsScanNode(context.getNextNodeId(), tupleDescriptor, "HdfsScanNode");<NEW_LINE>hdfsScanNode.computeStatistics(optExpression.getStatistics());<NEW_LINE>try {<NEW_LINE>HDFSScanNodePredicates scanNodePredicates = hdfsScanNode.getPredictsExpr();<NEW_LINE>scanNodePredicates.setSelectedPartitionIds(predicates.getSelectedPartitionIds());<NEW_LINE>scanNodePredicates.setIdToPartitionKey(predicates.getIdToPartitionKey());<NEW_LINE>hdfsScanNode.setupScanRangeLocations(context.getDescTbl());<NEW_LINE>prepareCommonExpr(scanNodePredicates, predicates, context);<NEW_LINE>prepareMinMaxExpr(scanNodePredicates, predicates, context);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Hdfs scan node get scan range locations failed : " + e);<NEW_LINE>throw new StarRocksPlannerException(e.getMessage(), INTERNAL_ERROR);<NEW_LINE>}<NEW_LINE>hdfsScanNode.setLimit(node.getLimit());<NEW_LINE>tupleDescriptor.computeMemLayout();<NEW_LINE>context.getScanNodes().add(hdfsScanNode);<NEW_LINE>PlanFragment fragment = new PlanFragment(context.getNextFragmentId(), hdfsScanNode, DataPartition.RANDOM);<NEW_LINE>context.<MASK><NEW_LINE>return fragment;<NEW_LINE>} | getFragments().add(fragment); |
1,604,068 | public static void main(String[] args) throws Exception {<NEW_LINE>dataLocalPath = DownloaderUtility.NLPDATA.Download();<NEW_LINE>File resource = new File(dataLocalPath, "paravec/simple.pv");<NEW_LINE>TokenizerFactory t = new DefaultTokenizerFactory();<NEW_LINE>t.setTokenPreProcessor(new CommonPreprocessor());<NEW_LINE>// we load externally originated model<NEW_LINE>ParagraphVectors <MASK><NEW_LINE>vectors.setTokenizerFactory(t);<NEW_LINE>// please note, we set iterations to 1 here, just to speedup inference<NEW_LINE>vectors.getConfiguration().setIterations(1);<NEW_LINE>// we have to define tokenizer here, because restored model has no idea about it<NEW_LINE>INDArray inferredVectorA = vectors.inferVector("This is my world .");<NEW_LINE>INDArray inferredVectorA2 = vectors.inferVector("This is my world .");<NEW_LINE>INDArray inferredVectorB = vectors.inferVector("This is my way .");<NEW_LINE>// high similarity expected here, since in underlying corpus words WAY and WORLD have really close context<NEW_LINE>log.info("Cosine similarity A/B: {}", Transforms.cosineSim(inferredVectorA, inferredVectorB));<NEW_LINE>// equality expected here, since inference is happening for the same sentences<NEW_LINE>log.info("Cosine similarity A/A2: {}", Transforms.cosineSim(inferredVectorA, inferredVectorA2));<NEW_LINE>} | vectors = WordVectorSerializer.readParagraphVectors(resource); |
1,535,661 | final CreateTransitVirtualInterfaceResult executeCreateTransitVirtualInterface(CreateTransitVirtualInterfaceRequest createTransitVirtualInterfaceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTransitVirtualInterfaceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTransitVirtualInterfaceRequest> request = null;<NEW_LINE>Response<CreateTransitVirtualInterfaceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTransitVirtualInterfaceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTransitVirtualInterfaceRequest));<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, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTransitVirtualInterface");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateTransitVirtualInterfaceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTransitVirtualInterfaceResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
379,662 | public void onClick(DialogInterface dialogInterface, int which) {<NEW_LINE>switch(which) {<NEW_LINE>case 1:<NEW_LINE><MASK><NEW_LINE>ContentValues values = new ContentValues(1);<NEW_LINE>values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");<NEW_LINE>mPath = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);<NEW_LINE>getImageByCamera.putExtra(MediaStore.EXTRA_OUTPUT, mPath);<NEW_LINE>startActivityForResult(getImageByCamera, REQUEST_CODE_IMAGE_CAMERA);<NEW_LINE>break;<NEW_LINE>case 0:<NEW_LINE>Intent getImageByalbum = new Intent(Intent.ACTION_GET_CONTENT);<NEW_LINE>getImageByalbum.addCategory(Intent.CATEGORY_OPENABLE);<NEW_LINE>getImageByalbum.setType("image/jpeg");<NEW_LINE>startActivityForResult(getImageByalbum, REQUEST_CODE_IMAGE_OP);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>;<NEW_LINE>}<NEW_LINE>} | Intent getImageByCamera = new Intent("android.media.action.IMAGE_CAPTURE"); |
1,457,285 | public DescribeAuditSuppressionResult describeAuditSuppression(DescribeAuditSuppressionRequest describeAuditSuppressionRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAuditSuppressionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAuditSuppressionRequest> request = null;<NEW_LINE>Response<DescribeAuditSuppressionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAuditSuppressionRequestMarshaller().marshall(describeAuditSuppressionRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DescribeAuditSuppressionResult, JsonUnmarshallerContext> unmarshaller = new DescribeAuditSuppressionResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DescribeAuditSuppressionResult> responseHandler = <MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | new JsonResponseHandler<DescribeAuditSuppressionResult>(unmarshaller); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.