idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
759,399
public PPOrderRouting execute() {<NEW_LINE>if (!routing.isValid()) {<NEW_LINE>throw new LiberoException("@NotValid@ " + routing.getCode());<NEW_LINE>}<NEW_LINE>if (!routing.isValidAtDate(dateStartSchedule)) {<NEW_LINE>throw new RoutingExpiredException(routing, dateStartSchedule);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Order Routing header<NEW_LINE>final PPOrderRoutingBuilder orderRoutingBuilder = newPPOrderRouting();<NEW_LINE>//<NEW_LINE>// Order Routing Activities<NEW_LINE>final ImmutableList.Builder<PPOrderRoutingActivity> orderActivities = ImmutableList.builder();<NEW_LINE>for (final PPRoutingActivity activity : routing.getActivities()) {<NEW_LINE>if (!activity.isValidAtDate(dateStartSchedule)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final PPOrderRoutingActivity orderActivity = createPPOrderRoutingActivity(activity);<NEW_LINE>orderActivities.add(orderActivity);<NEW_LINE>}<NEW_LINE>orderRoutingBuilder.activities(orderActivities.build());<NEW_LINE>//<NEW_LINE>// Set first activity<NEW_LINE>{<NEW_LINE>final PPOrderRoutingActivityCode firstActivityCode = PPOrderRoutingActivityCode.ofString(routing.getFirstActivity().getCode());<NEW_LINE>orderRoutingBuilder.firstActivityCode(firstActivityCode);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Order Products<NEW_LINE>final ImmutableList.Builder<PPOrderRoutingProduct> orderProducts = ImmutableList.builder();<NEW_LINE>for (final PPRoutingProduct product : routing.getProducts()) {<NEW_LINE>final PPOrderRoutingProduct orderActivity = createPPOrderRoutingProduct(product);<NEW_LINE>orderProducts.add(orderActivity);<NEW_LINE>}<NEW_LINE>orderRoutingBuilder.<MASK><NEW_LINE>//<NEW_LINE>// Activity Transitions<NEW_LINE>orderRoutingBuilder.codeToNextCodeMap(extractCodeToNextCodeMap(routing));<NEW_LINE>return orderRoutingBuilder.build();<NEW_LINE>}
products(orderProducts.build());
1,405,503
private void createSchemas() throws RepositoryException {<NEW_LINE>NodeTypeManager manager = session.getWorkspace().getNodeTypeManager();<NEW_LINE>NodeTypeTemplate ntt = manager.createNodeTypeTemplate();<NEW_LINE>ntt.setName("nt:mondrianschema");<NEW_LINE>// ntt.setPrimaryItemName("nt:file");<NEW_LINE>String[] str = new String[] { "nt:file" };<NEW_LINE>ntt.setDeclaredSuperTypeNames(str);<NEW_LINE>ntt.setMixin(true);<NEW_LINE>PropertyDefinitionTemplate pdt = manager.createPropertyDefinitionTemplate();<NEW_LINE>pdt.setName("schemaname");<NEW_LINE>pdt.setRequiredType(PropertyType.STRING);<NEW_LINE>pdt.isMultiple();<NEW_LINE>PropertyDefinitionTemplate pdt2 = manager.createPropertyDefinitionTemplate();<NEW_LINE>pdt2.setName("cubenames");<NEW_LINE>pdt2.setRequiredType(PropertyType.STRING);<NEW_LINE>pdt2.isMultiple();<NEW_LINE>PropertyDefinitionTemplate pdt3 = manager.createPropertyDefinitionTemplate();<NEW_LINE>pdt3.setName("jcr:data");<NEW_LINE>pdt3.setRequiredType(PropertyType.STRING);<NEW_LINE>PropertyDefinitionTemplate pdt4 = manager.createPropertyDefinitionTemplate();<NEW_LINE>pdt4.setName("owner");<NEW_LINE><MASK><NEW_LINE>ntt.getPropertyDefinitionTemplates().add(pdt);<NEW_LINE>ntt.getPropertyDefinitionTemplates().add(pdt2);<NEW_LINE>ntt.getPropertyDefinitionTemplates().add(pdt3);<NEW_LINE>ntt.getPropertyDefinitionTemplates().add(pdt4);<NEW_LINE>try {<NEW_LINE>manager.registerNodeType(ntt, false);<NEW_LINE>} catch (NodeTypeExistsException ignored) {<NEW_LINE>}<NEW_LINE>}
pdt4.setRequiredType(PropertyType.STRING);
956,248
final DeleteLoadBalancerResult executeDeleteLoadBalancer(DeleteLoadBalancerRequest deleteLoadBalancerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteLoadBalancerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteLoadBalancerRequest> request = null;<NEW_LINE>Response<DeleteLoadBalancerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteLoadBalancerRequestMarshaller().marshall(super.beforeMarshalling(deleteLoadBalancerRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Elastic Load Balancing");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteLoadBalancer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteLoadBalancerResult> responseHandler = new StaxResponseHandler<DeleteLoadBalancerResult>(new DeleteLoadBalancerResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
700,223
private void validateIfRevisionMatchesTheCurrentConfigAndUpdateTheMaterialMap(FanInGraphContext context, Pair<StageIdentifier, List<FaninScmMaterial>> stageIdentifierScmPair) {<NEW_LINE>final Set<MaterialConfig> currentScmMaterials = context.pipelineScmDepMap.get(materialConfig);<NEW_LINE>final Set<FaninScmMaterial> scmMaterials = new HashSet<>(stageIdentifierScmPair.last());<NEW_LINE>final Set<String> currentScmFingerprint = new HashSet<>();<NEW_LINE>for (MaterialConfig currentScmMaterial : currentScmMaterials) {<NEW_LINE>currentScmFingerprint.add(currentScmMaterial.getFingerprint());<NEW_LINE>}<NEW_LINE>final Set<String> scmMaterialsFingerprint = new HashSet<>();<NEW_LINE>for (FaninScmMaterial scmMaterial : scmMaterials) {<NEW_LINE>scmMaterialsFingerprint.add(scmMaterial.fingerprint);<NEW_LINE>}<NEW_LINE>final Collection commonMaterials = CollectionUtils.intersection(currentScmFingerprint, scmMaterialsFingerprint);<NEW_LINE>if (commonMaterials.size() == scmMaterials.size() && commonMaterials.size() == currentScmMaterials.size()) {<NEW_LINE>stageIdentifierScmMaterial.put(stageIdentifierScmPair.first(), scmMaterials);<NEW_LINE>++currentCount;<NEW_LINE>} else {<NEW_LINE>Collection disjunctionWithConfig = <MASK><NEW_LINE>Collection disjunctionWithInstance = CollectionUtils.disjunction(scmMaterialsFingerprint, commonMaterials);<NEW_LINE>LOGGER.warn("[Fan-in] - Incompatible materials for {}. Config: {}. Instance: {}.", stageIdentifierScmPair.first().getStageLocator(), disjunctionWithConfig, disjunctionWithInstance);<NEW_LINE>// This is it. We will not go beyond this revision in history<NEW_LINE>totalInstanceCount = currentCount;<NEW_LINE>}<NEW_LINE>}
CollectionUtils.disjunction(currentScmFingerprint, commonMaterials);
236,882
public static List<String> extractTerms(IndexReader reader, String docid, int k, Analyzer analyzer) throws IOException {<NEW_LINE>// Fetch the raw JSON representation of the document.<NEW_LINE>IndexableField rawField = reader.document(IndexReaderUtils.convertDocidToLuceneDocid(reader, docid)).getField(IndexArgs.RAW);<NEW_LINE>if (rawField == null) {<NEW_LINE>throw new RuntimeException("Raw documents not stored!");<NEW_LINE>}<NEW_LINE>// Extract plain-text representation and analyze into terms.<NEW_LINE>List<String> documentTerms = AnalyzerUtils.analyze(analyzer, extractArticlePlainText(rawField.stringValue()));<NEW_LINE>// Priority queue for holding terms based on tf-idf scores.<NEW_LINE>class ScoreComparator implements Comparator<Pair<String, Double>> {<NEW_LINE><NEW_LINE>public int compare(Pair<String, Double> a, Pair<String, Double> b) {<NEW_LINE>int cmp = Double.compare(b.getRight(), a.getRight());<NEW_LINE>if (cmp == 0) {<NEW_LINE>return a.getLeft().compareToIgnoreCase(b.getLeft());<NEW_LINE>} else {<NEW_LINE>return cmp;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PriorityQueue<Pair<String, Double>> termsQueue = new PriorityQueue<>(new ScoreComparator());<NEW_LINE>// Build histogram of tf.<NEW_LINE>Map<String, Integer> tfMap = new HashMap<>();<NEW_LINE>documentTerms.forEach(token -> {<NEW_LINE>if ((token.length() >= 2) && (token.matches("[a-z]+")))<NEW_LINE>tfMap.merge(token, 1, Math::addExact);<NEW_LINE>});<NEW_LINE>// Compute the tf-idf.<NEW_LINE>final long docCount = reader.numDocs();<NEW_LINE>tfMap.forEach((term, tf) -> termsQueue.add(Pair.of(term, tf * Math.log((1.0f + docCount) / IndexReaderUtils.getDF(reader, term)))));<NEW_LINE>// Extract the top k terms.<NEW_LINE>List<String> <MASK><NEW_LINE>for (int j = 0; j < Math.min(termsQueue.size(), k); j++) {<NEW_LINE>extractedTerms.add(termsQueue.poll().getKey());<NEW_LINE>}<NEW_LINE>return extractedTerms;<NEW_LINE>}
extractedTerms = new ArrayList<>();
966,625
public void marshall(ListSlotsRequest listSlotsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (listSlotsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(listSlotsRequest.getBotVersion(), BOTVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(listSlotsRequest.getLocaleId(), LOCALEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(listSlotsRequest.getIntentId(), INTENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(listSlotsRequest.getSortBy(), SORTBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(listSlotsRequest.getFilters(), FILTERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listSlotsRequest.getMaxResults(), MAXRESULTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listSlotsRequest.getNextToken(), NEXTTOKEN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
listSlotsRequest.getBotId(), BOTID_BINDING);
1,811,543
public void reset(final Context context) {<NEW_LINE>final Config config = Config.get(context);<NEW_LINE>key_symbol_color = config.getColor("key_symbol_color");<NEW_LINE>hilited_key_symbol_color = config.getColor("hilited_key_symbol_color");<NEW_LINE>mShadowColor = config.getColor("shadow_color");<NEW_LINE>mSymbolSize = config.getPixel("symbol_text_size", 10);<NEW_LINE>mKeyTextSize = config.getPixel("key_text_size", 22);<NEW_LINE>mVerticalCorrection = config.getPixel("vertical_correction");<NEW_LINE>setProximityCorrectionEnabled(config.getBoolean("proximity_correction"));<NEW_LINE>mPreviewOffset = config.getPixel("preview_offset");<NEW_LINE>mPreviewHeight = config.getPixel("preview_height");<NEW_LINE>mLabelTextSize = config.getPixel("key_long_text_size");<NEW_LINE>if (mLabelTextSize == 0)<NEW_LINE>mLabelTextSize = mKeyTextSize;<NEW_LINE>mBackgroundDimAmount = config.getFloat("background_dim_amount");<NEW_LINE><MASK><NEW_LINE>final float mRoundCorner = config.getFloat("round_corner");<NEW_LINE>mKeyBackColor = new StateListDrawable();<NEW_LINE>mKeyBackColor.addState(Key.KEY_STATE_PRESSED_ON, config.getColorDrawable("hilited_on_key_back_color"));<NEW_LINE>mKeyBackColor.addState(Key.KEY_STATE_PRESSED_OFF, config.getColorDrawable("hilited_off_key_back_color"));<NEW_LINE>mKeyBackColor.addState(Key.KEY_STATE_NORMAL_ON, config.getColorDrawable("on_key_back_color"));<NEW_LINE>mKeyBackColor.addState(Key.KEY_STATE_NORMAL_OFF, config.getColorDrawable("off_key_back_color"));<NEW_LINE>mKeyBackColor.addState(Key.KEY_STATE_PRESSED, config.getColorDrawable("hilited_key_back_color"));<NEW_LINE>mKeyBackColor.addState(Key.KEY_STATE_NORMAL, config.getColorDrawable("key_back_color"));<NEW_LINE>mKeyTextColor = new ColorStateList(Key.KEY_STATES, new int[] { config.getColor("hilited_on_key_text_color"), config.getColor("hilited_off_key_text_color"), config.getColor("on_key_text_color"), config.getColor("off_key_text_color"), config.getColor("hilited_key_text_color"), config.getColor("key_text_color") });<NEW_LINE>final Integer color = config.getColor("preview_text_color");<NEW_LINE>if (color != null)<NEW_LINE>mPreviewText.setTextColor(color);<NEW_LINE>final Integer previewBackColor = config.getColor("preview_back_color");<NEW_LINE>if (previewBackColor != null) {<NEW_LINE>final GradientDrawable background = new GradientDrawable();<NEW_LINE>background.setColor(previewBackColor);<NEW_LINE>background.setCornerRadius(mRoundCorner);<NEW_LINE>mPreviewText.setBackground(background);<NEW_LINE>}<NEW_LINE>final int mPreviewTextSizeLarge = config.getInt("preview_text_size");<NEW_LINE>mPreviewText.setTextSize(mPreviewTextSizeLarge);<NEW_LINE>mShowPreview = getPrefs().getKeyboard().getPopupKeyPressEnabled();<NEW_LINE>mPaint.setTypeface(config.getFont("key_font"));<NEW_LINE>mPaintSymbol.setTypeface(config.getFont("symbol_font"));<NEW_LINE>mPaintSymbol.setColor(key_symbol_color);<NEW_LINE>mPaintSymbol.setTextSize(mSymbolSize);<NEW_LINE>mPreviewText.setTypeface(config.getFont("preview_font"));<NEW_LINE>REPEAT_INTERVAL = config.getRepeatInterval();<NEW_LINE>REPEAT_START_DELAY = config.getLongTimeout() + 1;<NEW_LINE>LONG_PRESS_TIMEOUT = config.getLongTimeout();<NEW_LINE>MULTI_TAP_INTERVAL = config.getLongTimeout();<NEW_LINE>invalidateAllKeys();<NEW_LINE>}
mShadowRadius = config.getFloat("shadow_radius");
554,950
private void onDeleteClickeddialogtext(String reason) {<NEW_LINE>applicationKvStore.putBoolean(String.format(NOMINATING_FOR_DELETION_MEDIA, media<MASK><NEW_LINE>enableProgressBar();<NEW_LINE>Single<Boolean> resultSingletext = reasonBuilder.getReason(media, reason).flatMap(reasonString -> deleteHelper.makeDeletion(getContext(), media, reason));<NEW_LINE>resultSingletext.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(s -> {<NEW_LINE>if (applicationKvStore.getBoolean(String.format(NOMINATING_FOR_DELETION_MEDIA, media.getImageUrl()), false)) {<NEW_LINE>applicationKvStore.remove(String.format(NOMINATING_FOR_DELETION_MEDIA, media.getImageUrl()));<NEW_LINE>callback.nominatingForDeletion(index);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.getImageUrl()), true);
999,152
private void updateJoinGapsInfo(@Nullable View view, int position) {<NEW_LINE>if (view != null && gpxItem != null) {<NEW_LINE>GPXTabItemType tabType = tabTypes[position];<NEW_LINE>boolean generalTrack = gpxItem.isGeneralTrack();<NEW_LINE>boolean joinSegments = displayHelper.isJoinSegments();<NEW_LINE>boolean showJoinGapsSwitch = !hideJoinGapsBottomButtons && generalTrack && analysis != null && tabType.equals(GPXTabItemType.GPX_TAB_ITEM_GENERAL);<NEW_LINE>AndroidUiHelper.updateVisibility(view.findViewById(R.id.gpx_join_gaps_container), showJoinGapsSwitch);<NEW_LINE>((SwitchCompat) view.findViewById(R.id.gpx_join_gaps_switch)).setChecked(joinSegments);<NEW_LINE>if (analysis != null) {<NEW_LINE>if (tabType == GPX_TAB_ITEM_GENERAL) {<NEW_LINE>updateGeneralTabInfo(view, <MASK><NEW_LINE>} else if (tabType == GPX_TAB_ITEM_ALTITUDE) {<NEW_LINE>updateAltitudeTabInfo(view, app, analysis);<NEW_LINE>} else if (tabType == GPX_TAB_ITEM_SPEED) {<NEW_LINE>updateSpeedTabInfo(view, app, analysis, joinSegments, generalTrack);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
app, analysis, joinSegments, generalTrack);
1,587,240
private ServiceCallResult createServiceCallResult(final Request request) {<NEW_LINE>ServiceCallResult resultRequest = new ServiceCallResult();<NEW_LINE>MetadataContext metadataContext = MetadataContextHolder.get();<NEW_LINE>String namespace = metadataContext.getSystemMetadata(SystemMetadataKey.PEER_NAMESPACE);<NEW_LINE>resultRequest.setNamespace(namespace);<NEW_LINE>String serviceName = metadataContext.getSystemMetadata(SystemMetadataKey.PEER_SERVICE);<NEW_LINE>resultRequest.setService(serviceName);<NEW_LINE>String method = metadataContext.getSystemMetadata(SystemMetadataKey.PEER_PATH);<NEW_LINE>resultRequest.setMethod(method);<NEW_LINE>resultRequest.setRetStatus(RetStatus.RetSuccess);<NEW_LINE>String sourceNamespace = MetadataContext.LOCAL_NAMESPACE;<NEW_LINE>String sourceService = MetadataContext.LOCAL_SERVICE;<NEW_LINE>if (StringUtils.isNotBlank(sourceNamespace) && StringUtils.isNotBlank(sourceService)) {<NEW_LINE>resultRequest.setCallerService(new ServiceKey(sourceNamespace, sourceService));<NEW_LINE>}<NEW_LINE>URI uri = URI.create(request.url());<NEW_LINE>resultRequest.<MASK><NEW_LINE>resultRequest.setPort(uri.getPort());<NEW_LINE>return resultRequest;<NEW_LINE>}
setHost(uri.getHost());
681,139
public static AnswerCallResponse unmarshall(AnswerCallResponse answerCallResponse, UnmarshallerContext _ctx) {<NEW_LINE>answerCallResponse.setRequestId(_ctx.stringValue("AnswerCallResponse.RequestId"));<NEW_LINE>answerCallResponse.setCode(_ctx.stringValue("AnswerCallResponse.Code"));<NEW_LINE>answerCallResponse.setHttpStatusCode(_ctx.integerValue("AnswerCallResponse.HttpStatusCode"));<NEW_LINE>answerCallResponse.setMessage(_ctx.stringValue("AnswerCallResponse.Message"));<NEW_LINE>List<String> params = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("AnswerCallResponse.Params.Length"); i++) {<NEW_LINE>params.add(_ctx.stringValue("AnswerCallResponse.Params[" + i + "]"));<NEW_LINE>}<NEW_LINE>answerCallResponse.setParams(params);<NEW_LINE>Data data = new Data();<NEW_LINE>data.setContextId(_ctx.longValue("AnswerCallResponse.Data.ContextId"));<NEW_LINE>CallContext callContext = new CallContext();<NEW_LINE>callContext.setJobId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.JobId"));<NEW_LINE>callContext.setInstanceId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.InstanceId"));<NEW_LINE>callContext.setCallType(_ctx.stringValue("AnswerCallResponse.Data.CallContext.CallType"));<NEW_LINE>List<ChannelContext> channelContexts = new ArrayList<ChannelContext>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("AnswerCallResponse.Data.CallContext.ChannelContexts.Length"); i++) {<NEW_LINE>ChannelContext channelContext = new ChannelContext();<NEW_LINE>channelContext.setReleaseInitiator(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].ReleaseInitiator"));<NEW_LINE>channelContext.setChannelState(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].ChannelState"));<NEW_LINE>channelContext.setDestination(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].Destination"));<NEW_LINE>channelContext.setUserId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].UserId"));<NEW_LINE>channelContext.setSkillGroupId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].SkillGroupId"));<NEW_LINE>channelContext.setTimestamp(_ctx.longValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].Timestamp"));<NEW_LINE>channelContext.setAssociatedData(_ctx.mapValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].AssociatedData"));<NEW_LINE>channelContext.setReleaseReason(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].ReleaseReason"));<NEW_LINE>channelContext.setCallType(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].CallType"));<NEW_LINE>channelContext.setJobId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].JobId"));<NEW_LINE>channelContext.setChannelId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].ChannelId"));<NEW_LINE>channelContext.setOriginator(_ctx.stringValue<MASK><NEW_LINE>channelContext.setUserExtension(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].UserExtension"));<NEW_LINE>channelContexts.add(channelContext);<NEW_LINE>}<NEW_LINE>callContext.setChannelContexts(channelContexts);<NEW_LINE>data.setCallContext(callContext);<NEW_LINE>UserContext userContext = new UserContext();<NEW_LINE>userContext.setExtension(_ctx.stringValue("AnswerCallResponse.Data.UserContext.Extension"));<NEW_LINE>userContext.setHeartbeat(_ctx.longValue("AnswerCallResponse.Data.UserContext.Heartbeat"));<NEW_LINE>userContext.setWorkMode(_ctx.stringValue("AnswerCallResponse.Data.UserContext.WorkMode"));<NEW_LINE>userContext.setDeviceId(_ctx.stringValue("AnswerCallResponse.Data.UserContext.DeviceId"));<NEW_LINE>userContext.setUserId(_ctx.stringValue("AnswerCallResponse.Data.UserContext.UserId"));<NEW_LINE>userContext.setReserved(_ctx.longValue("AnswerCallResponse.Data.UserContext.Reserved"));<NEW_LINE>userContext.setBreakCode(_ctx.stringValue("AnswerCallResponse.Data.UserContext.BreakCode"));<NEW_LINE>userContext.setInstanceId(_ctx.stringValue("AnswerCallResponse.Data.UserContext.InstanceId"));<NEW_LINE>userContext.setOutboundScenario(_ctx.booleanValue("AnswerCallResponse.Data.UserContext.OutboundScenario"));<NEW_LINE>userContext.setMobile(_ctx.stringValue("AnswerCallResponse.Data.UserContext.Mobile"));<NEW_LINE>userContext.setJobId(_ctx.stringValue("AnswerCallResponse.Data.UserContext.JobId"));<NEW_LINE>userContext.setUserState(_ctx.stringValue("AnswerCallResponse.Data.UserContext.UserState"));<NEW_LINE>List<String> signedSkillGroupIdList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("AnswerCallResponse.Data.UserContext.SignedSkillGroupIdList.Length"); i++) {<NEW_LINE>signedSkillGroupIdList.add(_ctx.stringValue("AnswerCallResponse.Data.UserContext.SignedSkillGroupIdList[" + i + "]"));<NEW_LINE>}<NEW_LINE>userContext.setSignedSkillGroupIdList(signedSkillGroupIdList);<NEW_LINE>data.setUserContext(userContext);<NEW_LINE>answerCallResponse.setData(data);<NEW_LINE>return answerCallResponse;<NEW_LINE>}
("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].Originator"));
1,759,295
public synchronized static void createTreatment(DataMap dataMap, Context context) {<NEW_LINE>Log.d(TAG, "createTreatment dataMap=" + dataMap);<NEW_LINE>double timeoffset = dataMap.getDouble("timeoffset", 0);<NEW_LINE>double carbs = dataMap.getDouble("carbs", 0);<NEW_LINE>double insulin = dataMap.getDouble("insulin", 0);<NEW_LINE>double bloodtest = dataMap.getDouble("bloodtest", 0);<NEW_LINE>String notes = dataMap.getString("notes", "");<NEW_LINE>long timestamp_ms = Treatments.getTimeStampWithOffset(timeoffset);<NEW_LINE>Treatments treatment = Treatments.create(carbs, insulin, notes, timestamp_ms);<NEW_LINE>if (bloodtest > 0) {<NEW_LINE>Log.d(TAG, "createTreatment bloodtest=" + bloodtest);<NEW_LINE>BloodTest.createFromCal(bloodtest, timeoffset, "Manual Entry", treatment.uuid);<NEW_LINE>} else<NEW_LINE>Log.d(TAG, "createTreatment bloodtest=0 " + bloodtest);<NEW_LINE>showTreatments(context, "all");<NEW_LINE><MASK><NEW_LINE>// requestData(context);//send to phone if connected<NEW_LINE>}
SendData(context, SYNC_TREATMENTS_PATH, null);
1,101,524
// Dump the content of this bean returning it as a String<NEW_LINE>public void dump(StringBuffer str, String indent) {<NEW_LINE>String s;<NEW_LINE>Object o;<NEW_LINE>org.netbeans.modules.schema2beans.BaseBean n;<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("Name");<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\t");<NEW_LINE>// NOI18N<NEW_LINE>str.append("<");<NEW_LINE>s = this.getName();<NEW_LINE>// NOI18N<NEW_LINE>str.append((s == null ? "null" : s.trim()));<NEW_LINE>// NOI18N<NEW_LINE>str.append(">\n");<NEW_LINE>this.dumpAttributes(NAME, 0, str, indent);<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("Value[" + this.sizeValue() + "]");<NEW_LINE>for (int i = 0; i < this.sizeValue(); i++) {<NEW_LINE>str.append(indent + "\t");<NEW_LINE>str.append("#" + i + ":");<NEW_LINE>// NOI18N<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>str.append("<");<NEW_LINE>s = this.getValue(i);<NEW_LINE>// NOI18N<NEW_LINE>str.append((s == null ? "null" : s.trim()));<NEW_LINE>// NOI18N<NEW_LINE>str.append(">\n");<NEW_LINE>this.dumpAttributes(VALUE, i, str, indent);<NEW_LINE>}<NEW_LINE>}
str.append(indent + "\t");
1,162,165
private void nextTablet() throws TableNotFoundException, AccumuloException, IOException {<NEW_LINE>Range nextRange;<NEW_LINE>if (currentExtent == null) {<NEW_LINE>Text startRow;<NEW_LINE>if (range.getStartKey() != null)<NEW_LINE>startRow = range.getStartKey().getRow();<NEW_LINE>else<NEW_LINE>startRow = new Text();<NEW_LINE>nextRange = new Range(TabletsSection.encodeRow(tableId, startRow), true, null, false);<NEW_LINE>} else {<NEW_LINE>if (currentExtent.endRow() == null || range.afterEndKey(new Key(currentExtent.endRow()).followingKey(PartialKey.ROW))) {<NEW_LINE>iter = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>nextRange = new Range(currentExtent.toMetaRow(), false, null, false);<NEW_LINE>}<NEW_LINE>TabletMetadata tablet = getTabletFiles(nextRange);<NEW_LINE>while (tablet.getLocation() != null) {<NEW_LINE>if (context.getTableState(tableId) != TableState.OFFLINE) {<NEW_LINE>context.clearTableListCache();<NEW_LINE>if (context.getTableState(tableId) != TableState.OFFLINE) {<NEW_LINE>throw new AccumuloException("Table is online " + tableId + " cannot scan tablet in offline mode " + tablet.getExtent());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sleepUninterruptibly(250, MILLISECONDS);<NEW_LINE>tablet = getTabletFiles(nextRange);<NEW_LINE>}<NEW_LINE>if (!tablet.getExtent().tableId().equals(tableId)) {<NEW_LINE>throw new AccumuloException(" did not find tablets for table " + tableId + " " + tablet.getExtent());<NEW_LINE>}<NEW_LINE>if (currentExtent != null && !tablet.getExtent().isPreviousExtent(currentExtent))<NEW_LINE>throw new AccumuloException(" " + currentExtent + " is not previous extent " + tablet.getExtent());<NEW_LINE>iter = createIterator(tablet.getExtent(<MASK><NEW_LINE>iter.seek(range, LocalityGroupUtil.families(options.fetchedColumns), !options.fetchedColumns.isEmpty());<NEW_LINE>currentExtent = tablet.getExtent();<NEW_LINE>}
), tablet.getFiles());
902,620
private // ----------------------------------------------------------------------<NEW_LINE>AttributeSet findAttribs(TokenItem tokenItem) {<NEW_LINE>synchronized (this) {<NEW_LINE>AttributeSet attribs = attribsCache.get(tokenItem.getTokenID());<NEW_LINE>if (attribs == null) {<NEW_LINE>FontColorSettings fcs = MimeLookup.getLookup(mimePath).lookup(FontColorSettings.class);<NEW_LINE>if (fcs != null) {<NEW_LINE>attribs = findFontAndColors(fcs, tokenItem);<NEW_LINE>if (attribs == null) {<NEW_LINE>attribs = SimpleAttributeSet.EMPTY;<NEW_LINE>}<NEW_LINE>attribsCache.put(tokenItem.getTokenID(), attribs);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>LOG.warning("Can't find FCS for mime path: '" + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return attribs == null ? SimpleAttributeSet.EMPTY : attribs;<NEW_LINE>}<NEW_LINE>}
mimePath.getPath() + "'");
972,822
protected CompletableFuture<SnapshotPhase1Result> doRun() {<NEW_LINE>JetService service = getService();<NEW_LINE>ExecutionContext ctx = service.getJobExecutionService().assertExecutionContext(getCallerAddress(), jobId(), executionId, <MASK><NEW_LINE>CompletableFuture<SnapshotPhase1Result> future = ctx.beginSnapshotPhase1(snapshotId, mapName, flags).exceptionally(exc -> new SnapshotPhase1Result(0, 0, 0, exc)).thenApply(result -> {<NEW_LINE>if (result.getError() == null) {<NEW_LINE>logFine(getLogger(), "Snapshot %s phase 1 for %s finished successfully on member", snapshotId, ctx.jobNameAndExecutionId());<NEW_LINE>} else {<NEW_LINE>getLogger().warning(String.format("Snapshot %d phase 1 for %s finished with an error on member: " + "%s", snapshotId, ctx.jobNameAndExecutionId(), result.getError()));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>});<NEW_LINE>if (!postponeResponses) {<NEW_LINE>return future;<NEW_LINE>}<NEW_LINE>return future.thenCompose(result -> {<NEW_LINE>CompletableFuture<SnapshotPhase1Result> f2 = new CompletableFuture<>();<NEW_LINE>tryCompleteLater(result, f2);<NEW_LINE>return f2;<NEW_LINE>});<NEW_LINE>}
getClass().getSimpleName());
544,342
private boolean allowMethod(Method method) {<NEW_LINE>// NinjaProperties-based route exclusions/inclusions<NEW_LINE>if (method.isAnnotationPresent(Requires.class)) {<NEW_LINE>String key = method.getAnnotation(Requires.class).value();<NEW_LINE>String value = ninjaProperties.get(key);<NEW_LINE>if (value == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NinjaMode-based route exclusions/inclusions<NEW_LINE>Set<NinjaMode> modes = Sets.newTreeSet();<NEW_LINE>for (Annotation annotation : method.getAnnotations()) {<NEW_LINE>Class<? extends Annotation> annotationClass = annotation.annotationType();<NEW_LINE>if (annotationClass.isAnnotationPresent(RuntimeMode.class)) {<NEW_LINE>RuntimeMode mode = annotationClass.getAnnotation(RuntimeMode.class);<NEW_LINE>modes.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return modes.isEmpty() || modes.contains(runtimeMode);<NEW_LINE>}
add(mode.value());
1,022,260
private static // -------------------------------------------------------------------------<NEW_LINE>void buildFilter(FileFilter filter, AssociationBuilder builder) throws CommandException {<NEW_LINE>// Filter on the file type.<NEW_LINE>if (filter instanceof AttributeFileFilter) {<NEW_LINE>AttributeFileFilter attributeFilter;<NEW_LINE>attributeFilter = (AttributeFileFilter) filter;<NEW_LINE>switch(attributeFilter.getAttribute()) {<NEW_LINE>case HIDDEN:<NEW_LINE>builder.setIsHidden(!attributeFilter.isInverted());<NEW_LINE>break;<NEW_LINE>case SYMLINK:<NEW_LINE>builder.setIsSymlink(!attributeFilter.isInverted());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else if (filter instanceof PermissionsFileFilter) {<NEW_LINE>PermissionsFileFilter permissionFilter = (PermissionsFileFilter) filter;<NEW_LINE>switch(permissionFilter.getPermission()) {<NEW_LINE>case READ:<NEW_LINE>builder.setIsReadable(permissionFilter.getFilter());<NEW_LINE>break;<NEW_LINE>case WRITE:<NEW_LINE>builder.setIsWritable(permissionFilter.getFilter());<NEW_LINE>break;<NEW_LINE>case EXECUTE:<NEW_LINE>builder.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else if (filter instanceof RegexpFilenameFilter) {<NEW_LINE>RegexpFilenameFilter regexpFilter = (RegexpFilenameFilter) filter;<NEW_LINE>builder.setMask(regexpFilter.getRegularExpression(), regexpFilter.isCaseSensitive());<NEW_LINE>}<NEW_LINE>}
setIsExecutable(permissionFilter.getFilter());
409,276
// TO DO --Use StoreCallback instead of SessionEventDispatcher??<NEW_LINE>@ProbeAtEntry<NEW_LINE>@ProbeSite(clazz = "com.ibm.ws.session.SessionEventDispatcher", method = "sessionLiveCountInc", args = "java.lang.Object")<NEW_LINE>public void IncrementLiveCount(@Args Object[] myargs) {<NEW_LINE>if (tc.isEntryEnabled()) {<NEW_LINE>Tr.entry(tc, "IncrementLiveCount");<NEW_LINE>}<NEW_LINE>if (myargs == null) {<NEW_LINE>if (tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(tc, "IncrementLiveCount", "Args list is null");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ISession session = (ISession) myargs[0];<NEW_LINE>if (session == null) {<NEW_LINE>if (tc.isEntryEnabled()) {<NEW_LINE>Tr.<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String appName = session.getIStore().getId();<NEW_LINE>SessionStats sStats = sessionCountByName.get(appName);<NEW_LINE>if (sStats == null) {<NEW_LINE>sStats = initializeSessionStats(appName, new SessionStats());<NEW_LINE>}<NEW_LINE>sStats.liveCountInc();<NEW_LINE>if (tc.isEntryEnabled()) {<NEW_LINE>Tr.exit(tc, "IncrementLiveCount");<NEW_LINE>}<NEW_LINE>}
exit(tc, "IncrementLiveCount", "session object is null");
268,289
public static void main(String[] args) {<NEW_LINE>StdDraw.setPenRadius(0.0025);<NEW_LINE>Exercise38_TreeDrawing treeDrawing = new Exercise38_TreeDrawing();<NEW_LINE>BinarySearchTreeDrawable<Integer, String> binarySearchTreeDrawable = treeDrawing.new BinarySearchTreeDrawable();<NEW_LINE>binarySearchTreeDrawable.put(10, "Value 10");<NEW_LINE>binarySearchTreeDrawable.put(4, "Value 4");<NEW_LINE>binarySearchTreeDrawable.put(6, "Value 6");<NEW_LINE>binarySearchTreeDrawable.put(1, "Value 1");<NEW_LINE>binarySearchTreeDrawable.put(2, "Value 2");<NEW_LINE>binarySearchTreeDrawable.put(15, "Value 15");<NEW_LINE><MASK><NEW_LINE>binarySearchTreeDrawable.put(20, "Value 20");<NEW_LINE>binarySearchTreeDrawable.put(25, "Value 25");<NEW_LINE>StdDraw.clear(StdDraw.WHITE);<NEW_LINE>binarySearchTreeDrawable.draw();<NEW_LINE>}
binarySearchTreeDrawable.put(12, "Value 12");
55,872
static Settings buildClientSettings(String tribeName, String parentNodeId, Settings globalSettings, Settings tribeSettings) {<NEW_LINE>for (String tribeKey : tribeSettings.keySet()) {<NEW_LINE>if (tribeKey.startsWith("path.")) {<NEW_LINE>throw new IllegalArgumentException("Setting [" + tribeKey + "] not allowed in tribe client [" + tribeName + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Settings.Builder sb = Settings.builder().put(tribeSettings);<NEW_LINE>sb.put(Node.NODE_NAME_SETTING.getKey(), Node.NODE_NAME_SETTING.get(globalSettings) + "/" + tribeName);<NEW_LINE>// pass through ES home dir<NEW_LINE>sb.put(Environment.PATH_HOME_SETTING.getKey(), Environment.PATH_HOME_SETTING.get(globalSettings));<NEW_LINE>if (Environment.PATH_LOGS_SETTING.exists(globalSettings)) {<NEW_LINE>sb.put(Environment.PATH_LOGS_SETTING.getKey(), Environment.PATH_LOGS_SETTING.get(globalSettings));<NEW_LINE>}<NEW_LINE>for (Setting<?> passthrough : PASS_THROUGH_SETTINGS) {<NEW_LINE>if (passthrough.exists(tribeSettings) == false && passthrough.exists(globalSettings)) {<NEW_LINE>sb.put(passthrough.getKey(), globalSettings.get(passthrough.getKey()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.put(TRIBE_NAME_SETTING.getKey(), tribeName);<NEW_LINE>if (sb.get(NetworkModule.HTTP_ENABLED.getKey()) == null) {<NEW_LINE>sb.put(NetworkModule.HTTP_ENABLED.getKey(), false);<NEW_LINE>}<NEW_LINE>sb.put(Node.<MASK><NEW_LINE>sb.put(Node.NODE_MASTER_SETTING.getKey(), false);<NEW_LINE>sb.put(Node.NODE_INGEST_SETTING.getKey(), false);<NEW_LINE>// node id of a tribe client node is determined by node id of parent node and tribe name<NEW_LINE>final BytesRef seedAsString = new BytesRef(parentNodeId + "/" + tribeName);<NEW_LINE>long nodeIdSeed = MurmurHash3.hash128(seedAsString.bytes, seedAsString.offset, seedAsString.length, 0, new MurmurHash3.Hash128()).h1;<NEW_LINE>sb.put(NodeEnvironment.NODE_ID_SEED_SETTING.getKey(), nodeIdSeed);<NEW_LINE>sb.put(Node.NODE_LOCAL_STORAGE_SETTING.getKey(), false);<NEW_LINE>return sb.build();<NEW_LINE>}
NODE_DATA_SETTING.getKey(), false);
915,515
public OutlierResult run(Relation<O> relation) {<NEW_LINE>QueryBuilder<O> qb = new QueryBuilder<>(relation, distance);<NEW_LINE>KNNSearcher<DBIDRef> <MASK><NEW_LINE>DistanceQuery<O> distFunc = qb.distanceQuery();<NEW_LINE>// track the maximum value for normalization<NEW_LINE>DoubleMinMax ldofminmax = new DoubleMinMax();<NEW_LINE>// compute the ldof values<NEW_LINE>WritableDoubleDataStore ldofs = DataStoreUtil.makeDoubleStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP);<NEW_LINE>// compute LOF_SCORE of each db object<NEW_LINE>if (LOG.isVerbose()) {<NEW_LINE>LOG.verbose("Computing LDOFs");<NEW_LINE>}<NEW_LINE>FiniteProgress progressLDOFs = LOG.isVerbose() ? new FiniteProgress("LDOF for objects", relation.size(), LOG) : null;<NEW_LINE>Mean dxp = new Mean(), Dxp = new Mean();<NEW_LINE>for (DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advance()) {<NEW_LINE>KNNList neighbors = knnQuery.getKNN(iditer, kplus);<NEW_LINE>dxp.reset();<NEW_LINE>Dxp.reset();<NEW_LINE>DoubleDBIDListIter neighbor1 = neighbors.iter(), neighbor2 = neighbors.iter();<NEW_LINE>for (; neighbor1.valid(); neighbor1.advance()) {<NEW_LINE>// skip the point itself<NEW_LINE>if (DBIDUtil.equal(neighbor1, iditer)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>dxp.put(neighbor1.doubleValue());<NEW_LINE>for (neighbor2.seek(neighbor1.getOffset() + 1); neighbor2.valid(); neighbor2.advance()) {<NEW_LINE>// skip the point itself<NEW_LINE>if (DBIDUtil.equal(neighbor2, iditer)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Dxp.put(distFunc.distance(neighbor1, neighbor2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double ldof = dxp.getMean() / Dxp.getMean();<NEW_LINE>if (Double.isNaN(ldof) || Double.isInfinite(ldof)) {<NEW_LINE>ldof = 1.0;<NEW_LINE>}<NEW_LINE>ldofs.putDouble(iditer, ldof);<NEW_LINE>// update maximum<NEW_LINE>ldofminmax.put(ldof);<NEW_LINE>LOG.incrementProcessed(progressLDOFs);<NEW_LINE>}<NEW_LINE>LOG.ensureCompleted(progressLDOFs);<NEW_LINE>// Build result representation.<NEW_LINE>DoubleRelation scoreResult = new MaterializedDoubleRelation("LDOF Outlier Score", relation.getDBIDs(), ldofs);<NEW_LINE>OutlierScoreMeta scoreMeta = new QuotientOutlierScoreMeta(ldofminmax.getMin(), ldofminmax.getMax(), 0.0, Double.POSITIVE_INFINITY, LDOF_BASELINE);<NEW_LINE>return new OutlierResult(scoreMeta, scoreResult);<NEW_LINE>}
knnQuery = qb.kNNByDBID(kplus);
1,098,199
public void load(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program, TaskMonitor monitor, MessageLog log) throws IOException {<NEW_LINE>monitor.setMessage(getMonitorMessagePrimary());<NEW_LINE>try {<NEW_LINE>Address start = program.getAddressFactory().getDefaultAddressSpace().getAddress(0x0);<NEW_LINE>long length = provider.length();<NEW_LINE>try (InputStream inputStream = provider.getInputStream(0)) {<NEW_LINE>program.getMemory().createInitializedBlock(getMemoryBlockName(), start, inputStream, length, monitor, false);<NEW_LINE>}<NEW_LINE>BinaryReader reader = new BinaryReader(provider, true);<NEW_LINE>DexHeader header = DexHeaderFactory.getDexHeader(reader);<NEW_LINE><MASK><NEW_LINE>createMethodLookupMemoryBlock(program, monitor);<NEW_LINE>createMethodByteCodeBlock(program, length, monitor);<NEW_LINE>for (ClassDefItem item : header.getClassDefs()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>ClassDataItem classDataItem = item.getClassDataItem();<NEW_LINE>if (classDataItem == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>createMethods(program, header, item, classDataItem.getDirectMethods(), monitor, log);<NEW_LINE>createMethods(program, header, item, classDataItem.getVirtualMethods(), monitor, log);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.appendException(e);<NEW_LINE>}<NEW_LINE>}
monitor.setMessage(getMonitorMessageSecondary());
994,415
void sendHeartbeatSync(Node node) {<NEW_LINE>HeartbeatHandler heartbeatHandler = new HeartbeatHandler(localMember, node);<NEW_LINE>HeartBeatRequest req = new HeartBeatRequest();<NEW_LINE><MASK><NEW_LINE>req.setCommitLogIndex(request.commitLogIndex);<NEW_LINE>req.setRegenerateIdentifier(request.regenerateIdentifier);<NEW_LINE>req.setRequireIdentifier(request.requireIdentifier);<NEW_LINE>req.setTerm(request.term);<NEW_LINE>req.setLeader(localMember.getThisNode());<NEW_LINE>if (request.isSetHeader()) {<NEW_LINE>req.setHeader(request.header);<NEW_LINE>}<NEW_LINE>if (request.isSetPartitionTableBytes()) {<NEW_LINE>req.partitionTableBytes = request.partitionTableBytes;<NEW_LINE>req.setPartitionTableBytesIsSet(true);<NEW_LINE>}<NEW_LINE>localMember.getSerialToParallelPool().submit(() -> {<NEW_LINE>Client client = localMember.getSyncHeartbeatClient(node);<NEW_LINE>if (client != null) {<NEW_LINE>try {<NEW_LINE>logger.debug("{}: Sending heartbeat to {}", memberName, node);<NEW_LINE>HeartBeatResponse heartBeatResponse = client.sendHeartbeat(req);<NEW_LINE>heartbeatHandler.onComplete(heartBeatResponse);<NEW_LINE>} catch (TTransportException e) {<NEW_LINE>if (ClusterIoTDB.getInstance().shouldPrintClientConnectionErrorStack()) {<NEW_LINE>logger.warn("{}: Cannot send heartbeat to node {} due to network", memberName, node, e);<NEW_LINE>} else {<NEW_LINE>logger.warn("{}: Cannot send heartbeat to node {} due to network", memberName, node);<NEW_LINE>}<NEW_LINE>client.getInputProtocol().getTransport().close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn(memberName + ": Cannot send heart beat to node " + node.toString(), e);<NEW_LINE>} finally {<NEW_LINE>localMember.returnSyncClient(client);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
req.setCommitLogTerm(request.commitLogTerm);
1,817,228
protected void initNode(MNode result) {<NEW_LINE>MBool renderable = (MBool) result.getAttr("rnd");<NEW_LINE>renderable.set(true);<NEW_LINE>MInt filmFit = (MInt) result.getAttr("ff");<NEW_LINE>// horizontal fit<NEW_LINE>filmFit.set(1);<NEW_LINE>MFloat centerOfInterest = (MFloat) result.getAttr("coi");<NEW_LINE>centerOfInterest.set(5.0f);<NEW_LINE>MFloat focalLength = (MFloat) result.getAttr("fl");<NEW_LINE>focalLength.set(35.0f);<NEW_LINE>MFloat orthographicWidth = (MFloat) result.getAttr("ow");<NEW_LINE>orthographicWidth.set(10.0f);<NEW_LINE>MFloat2 cameraAperture = (MFloat2) result.getAttr("cap");<NEW_LINE>cameraAperture.set(3.6f, 2.4f);<NEW_LINE>MFloat lensSqueezeRatio = (<MASK><NEW_LINE>lensSqueezeRatio.set(1.0f);<NEW_LINE>MFloat f = (MFloat) result.getAttr("fcp");<NEW_LINE>f.set(1000);<NEW_LINE>f = (MFloat) result.getAttr("ncp");<NEW_LINE>f.set(.1f);<NEW_LINE>}
MFloat) result.getAttr("lsr");
343,655
protected void drawShadow(mxGraphicsCanvas2D canvas, mxCellState state, double rotation, boolean flipH, boolean flipV, mxRectangle bounds, double alpha, boolean filled) {<NEW_LINE>// Requires background in generic shape for shadow, looks like only one<NEW_LINE>// fillAndStroke is allowed per current path, try working around that<NEW_LINE>// Computes rotated shadow offset<NEW_LINE>double rad = rotation * Math.PI / 180;<NEW_LINE>double cos = Math.cos(-rad);<NEW_LINE>double sin = Math.sin(-rad);<NEW_LINE>mxPoint offset = mxUtils.getRotatedPoint(new mxPoint(mxConstants.SHADOW_OFFSETX, mxConstants.SHADOW_OFFSETY), cos, sin);<NEW_LINE>if (flipH) {<NEW_LINE>offset.setX(offset.getX() * -1);<NEW_LINE>}<NEW_LINE>if (flipV) {<NEW_LINE>offset.setY(offset.getY() * -1);<NEW_LINE>}<NEW_LINE>// TODO: Use save/restore instead of negative offset to restore (requires fix for HTML canvas)<NEW_LINE>canvas.translate(offset.getX(<MASK><NEW_LINE>// Returns true if a shadow has been painted (path has been created)<NEW_LINE>if (drawShape(canvas, state, bounds, true)) {<NEW_LINE>canvas.setAlpha(mxConstants.STENCIL_SHADOW_OPACITY * alpha);<NEW_LINE>// TODO: Implement new shadow<NEW_LINE>// canvas.shadow(mxConstants.STENCIL_SHADOWCOLOR, filled);<NEW_LINE>}<NEW_LINE>canvas.translate(-offset.getX(), -offset.getY());<NEW_LINE>}
), offset.getY());
1,676,357
public int compare(MediaItem leftItem, MediaItem rightItem) {<NEW_LINE>if (leftItem.getGlobalSegmentList() != null || rightItem.getGlobalSegmentList() != null) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>if (mOrderType == ORDER_ASCENDANT) {<NEW_LINE>MediaItem tmpItem = leftItem;<NEW_LINE>leftItem = rightItem;<NEW_LINE>rightItem = tmpItem;<NEW_LINE>}<NEW_LINE>int leftItemBitrate = leftItem.getBitrate() == null ? 0 : parseInt(leftItem.getBitrate());<NEW_LINE>int rightItemBitrate = rightItem.getBitrate() == null ? 0 : parseInt(rightItem.getBitrate());<NEW_LINE>int leftItemHeight = leftItem.getSize() == null ? 0 : parseInt(MediaItemUtils.getHeight(leftItem));<NEW_LINE>int rightItemHeight = rightItem.getSize() == null ? 0 : parseInt<MASK><NEW_LINE>int delta = rightItemHeight - leftItemHeight;<NEW_LINE>if (delta == 0) {<NEW_LINE>delta = rightItemBitrate - leftItemBitrate;<NEW_LINE>}<NEW_LINE>return delta;<NEW_LINE>}
(MediaItemUtils.getHeight(rightItem));
1,834,114
public static QueryDomainListResponse unmarshall(QueryDomainListResponse queryDomainListResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryDomainListResponse.setRequestId(_ctx.stringValue("QueryDomainListResponse.RequestId"));<NEW_LINE>queryDomainListResponse.setTotalItemNum(_ctx.integerValue("QueryDomainListResponse.TotalItemNum"));<NEW_LINE>queryDomainListResponse.setCurrentPageNum(_ctx.integerValue("QueryDomainListResponse.CurrentPageNum"));<NEW_LINE>queryDomainListResponse.setTotalPageNum(_ctx.integerValue("QueryDomainListResponse.TotalPageNum"));<NEW_LINE>queryDomainListResponse.setPageSize(_ctx.integerValue("QueryDomainListResponse.PageSize"));<NEW_LINE>queryDomainListResponse.setPrePage(_ctx.booleanValue("QueryDomainListResponse.PrePage"));<NEW_LINE>queryDomainListResponse.setNextPage(_ctx.booleanValue("QueryDomainListResponse.NextPage"));<NEW_LINE>List<Domain> data = new ArrayList<Domain>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryDomainListResponse.Data.Length"); i++) {<NEW_LINE>Domain domain = new Domain();<NEW_LINE>domain.setDomainName(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].DomainName"));<NEW_LINE>domain.setInstanceId(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].InstanceId"));<NEW_LINE>domain.setExpirationDate(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].ExpirationDate"));<NEW_LINE>domain.setRegistrationDate(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].RegistrationDate"));<NEW_LINE>domain.setDomainType(_ctx.stringValue<MASK><NEW_LINE>domain.setDomainStatus(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].DomainStatus"));<NEW_LINE>domain.setProductId(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].ProductId"));<NEW_LINE>domain.setExpirationDateLong(_ctx.longValue("QueryDomainListResponse.Data[" + i + "].ExpirationDateLong"));<NEW_LINE>domain.setRegistrationDateLong(_ctx.longValue("QueryDomainListResponse.Data[" + i + "].RegistrationDateLong"));<NEW_LINE>domain.setPremium(_ctx.booleanValue("QueryDomainListResponse.Data[" + i + "].Premium"));<NEW_LINE>domain.setDomainAuditStatus(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].DomainAuditStatus"));<NEW_LINE>domain.setExpirationDateStatus(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].ExpirationDateStatus"));<NEW_LINE>domain.setRegistrantType(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].RegistrantType"));<NEW_LINE>domain.setDomainGroupId(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].DomainGroupId"));<NEW_LINE>domain.setRemark(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].Remark"));<NEW_LINE>domain.setDomainGroupName(_ctx.stringValue("QueryDomainListResponse.Data[" + i + "].DomainGroupName"));<NEW_LINE>domain.setExpirationCurrDateDiff(_ctx.integerValue("QueryDomainListResponse.Data[" + i + "].ExpirationCurrDateDiff"));<NEW_LINE>data.add(domain);<NEW_LINE>}<NEW_LINE>queryDomainListResponse.setData(data);<NEW_LINE>return queryDomainListResponse;<NEW_LINE>}
("QueryDomainListResponse.Data[" + i + "].DomainType"));
1,689,423
public void marshall(UpdateFleetMetricRequest updateFleetMetricRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateFleetMetricRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateFleetMetricRequest.getQueryString(), QUERYSTRING_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFleetMetricRequest.getAggregationType(), AGGREGATIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFleetMetricRequest.getPeriod(), PERIOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFleetMetricRequest.getAggregationField(), AGGREGATIONFIELD_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFleetMetricRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFleetMetricRequest.getQueryVersion(), QUERYVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFleetMetricRequest.getIndexName(), INDEXNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFleetMetricRequest.getUnit(), UNIT_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateFleetMetricRequest.getExpectedVersion(), EXPECTEDVERSION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updateFleetMetricRequest.getMetricName(), METRICNAME_BINDING);
416,723
public ResponseEntity<IdentityZone> createIdentityZone(@RequestBody @Valid IdentityZone body, BindingResult result) {<NEW_LINE>if (result.hasErrors()) {<NEW_LINE>throw new UnprocessableEntityException(getErrorMessages(result));<NEW_LINE>}<NEW_LINE>if (!IdentityZoneHolder.isUaa()) {<NEW_LINE>throw new AccessDeniedException("Zones can only be created by being authenticated in the default zone.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>body = validator.validate(body, IdentityZoneValidator.Mode.CREATE);<NEW_LINE>} catch (InvalidIdentityZoneDetailsException ex) {<NEW_LINE>String errorMessage = StringUtils.hasText(ex.getMessage()) ? ex.getMessage() : "";<NEW_LINE>throw new UnprocessableEntityException("The identity zone details are invalid. " + errorMessage, ex);<NEW_LINE>}<NEW_LINE>if (!StringUtils.hasText(body.getId())) {<NEW_LINE>body.setId(UUID.randomUUID().toString());<NEW_LINE>}<NEW_LINE>IdentityZone previous = IdentityZoneHolder.get();<NEW_LINE>try {<NEW_LINE>logger.debug("Zone - creating id[{}] subdomain[{}]", UaaStringUtils.getCleanedUserControlString(body.getId()), UaaStringUtils.getCleanedUserControlString(body.getSubdomain()));<NEW_LINE>IdentityZone created = zoneDao.create(body);<NEW_LINE>logger.debug("Zone - created id " + ID_SUBDOMAIN_LOGGING, created.getId(), created.getSubdomain());<NEW_LINE>IdentityZoneHolder.set(created);<NEW_LINE>IdentityProvider defaultIdp = new IdentityProvider();<NEW_LINE>defaultIdp.setName(OriginKeys.UAA);<NEW_LINE>defaultIdp.setType(OriginKeys.UAA);<NEW_LINE>defaultIdp.setOriginKey(OriginKeys.UAA);<NEW_LINE>defaultIdp.setIdentityZoneId(created.getId());<NEW_LINE>UaaIdentityProviderDefinition idpDefinition = new UaaIdentityProviderDefinition();<NEW_LINE>idpDefinition.setPasswordPolicy(null);<NEW_LINE>defaultIdp.setConfig(idpDefinition);<NEW_LINE>idpDao.create(<MASK><NEW_LINE>logger.debug("Created default IDP in zone - created id " + ID_SUBDOMAIN_LOGGING, created.getId(), created.getSubdomain());<NEW_LINE>createUserGroups(created);<NEW_LINE>return new ResponseEntity<>(removeKeys(created), CREATED);<NEW_LINE>} finally {<NEW_LINE>IdentityZoneHolder.set(previous);<NEW_LINE>}<NEW_LINE>}
defaultIdp, created.getId());
1,648,325
protected IStatus run(IProgressMonitor monitor) {<NEW_LINE>SubMonitor subMonitor = <MASK><NEW_LINE>if (!repo.enterWriteProcess()) {<NEW_LINE>return new Status(IStatus.ERROR, GitPlugin.getPluginId(), Messages.GitLaunchDelegate_FailedToAcquireWriteLock);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>ILaunch // $NON-NLS-1$<NEW_LINE>launch = // $NON-NLS-1$<NEW_LINE>Launcher.// $NON-NLS-1$<NEW_LINE>launch(// $NON-NLS-1$<NEW_LINE>repo, // $NON-NLS-1$<NEW_LINE>subMonitor.newChild(75), // $NON-NLS-1$<NEW_LINE>"merge", // $NON-NLS-1$<NEW_LINE>"--squash", branchName);<NEW_LINE>while (!launch.isTerminated()) {<NEW_LINE>Thread.sleep(50);<NEW_LINE>}<NEW_LINE>} catch (CoreException e) {<NEW_LINE>IdeLog.logError(GitUIPlugin.getDefault(), e);<NEW_LINE>return e.getStatus();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>IdeLog.logError(GitUIPlugin.getDefault(), e);<NEW_LINE>return new Status(IStatus.ERROR, GitUIPlugin.getPluginId(), e.getMessage());<NEW_LINE>} finally {<NEW_LINE>repo.exitWriteProcess();<NEW_LINE>}<NEW_LINE>subMonitor.done();<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}
SubMonitor.convert(monitor, 100);
1,389,577
public ActionType buildModuleType(String UID, Map<String, Set<ModuleInformation>> moduleInformation) {<NEW_LINE>Set<ModuleInformation> mis = moduleInformation.get(UID);<NEW_LINE>List<ConfigDescriptionParameter> configDescriptions = new ArrayList<>();<NEW_LINE>if (mis != null && mis.size() > 0) {<NEW_LINE>ModuleInformation mi = (ModuleInformation) mis.toArray()[0];<NEW_LINE>ActionModuleKind kind = ActionModuleKind.SINGLE;<NEW_LINE>if (mi.getConfigName() != null && mi.getThingUID() != null) {<NEW_LINE>logger.error("ModuleType with UID {} has thingUID ({}) and multi-service ({}) property set, ignoring it.", UID, mi.getConfigName(<MASK><NEW_LINE>return null;<NEW_LINE>} else if (mi.getConfigName() != null) {<NEW_LINE>kind = ActionModuleKind.SERVICE;<NEW_LINE>} else if (mi.getThingUID() != null) {<NEW_LINE>kind = ActionModuleKind.THING;<NEW_LINE>}<NEW_LINE>ConfigDescriptionParameter configParam = buildConfigParam(mis, kind);<NEW_LINE>if (configParam != null) {<NEW_LINE>configDescriptions.add(configParam);<NEW_LINE>}<NEW_LINE>ActionType at = new ActionType(UID, configDescriptions, mi.getLabel(), mi.getDescription(), mi.getTags(), mi.getVisibility(), mi.getInputs(), mi.getOutputs());<NEW_LINE>return at;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
), mi.getThingUID());
1,519,772
static AssertionError makeComparisonFailure(ImmutableList<String> messages, ImmutableList<Fact> facts, String expected, String actual, @Nullable Throwable cause) {<NEW_LINE>Class<?> comparisonFailureClass;<NEW_LINE>try {<NEW_LINE>comparisonFailureClass = Class.forName("com.google.common.truth.ComparisonFailureWithFacts");<NEW_LINE>} catch (LinkageError | ClassNotFoundException probablyJunitNotOnClasspath) {<NEW_LINE>return new AssertionErrorWithFacts(messages, facts, cause);<NEW_LINE>}<NEW_LINE>Class<? extends AssertionError> asAssertionErrorSubclass = comparisonFailureClass.asSubclass(AssertionError.class);<NEW_LINE>Constructor<? extends AssertionError> constructor;<NEW_LINE>try {<NEW_LINE>constructor = asAssertionErrorSubclass.getDeclaredConstructor(ImmutableList.class, ImmutableList.class, String.class, <MASK><NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>// That constructor exists.<NEW_LINE>throw newLinkageError(e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return constructor.newInstance(messages, facts, expected, actual, cause);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throwIfUnchecked(e.getCause());<NEW_LINE>// That constructor has no `throws` clause.<NEW_LINE>throw newLinkageError(e);<NEW_LINE>} catch (InstantiationException e) {<NEW_LINE>// The class is a concrete class.<NEW_LINE>throw newLinkageError(e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>// We're accessing a class from within its package.<NEW_LINE>throw newLinkageError(e);<NEW_LINE>}<NEW_LINE>}
String.class, Throwable.class);
293,962
public void showTooltipByMouseMove(@Nonnull final Editor editor, @Nonnull final RelativePoint point, final TooltipRenderer tooltipObject, final boolean alignToRight, @Nonnull final TooltipGroup group, @Nonnull HintHint hintHint) {<NEW_LINE>LightweightHint currentTooltip = myCurrentTooltip;<NEW_LINE>if (currentTooltip == null || !currentTooltip.isVisible()) {<NEW_LINE>if (currentTooltip != null) {<NEW_LINE>if (!IdeTooltipManager.getInstance().isQueuedToShow(currentTooltip.getCurrentIdeTooltip())) {<NEW_LINE>myCurrentTooltipObject = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>myCurrentTooltipObject = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Comparing.equal(tooltipObject, myCurrentTooltipObject)) {<NEW_LINE>IdeTooltipManager.getInstance().cancelAutoHide();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>hideCurrentTooltip();<NEW_LINE>if (tooltipObject != null) {<NEW_LINE>final Point p = point.getPointOn(editor.getComponent().getRootPane().getLayeredPane()).getPoint();<NEW_LINE>if (!hintHint.isAwtTooltip()) {<NEW_LINE>p.<MASK><NEW_LINE>}<NEW_LINE>Project project = editor.getProject();<NEW_LINE>if (project != null && !project.isOpen())<NEW_LINE>return;<NEW_LINE>if (editor.getContentComponent().isShowing()) {<NEW_LINE>showTooltip(editor, p, tooltipObject, alignToRight, group, hintHint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
x += alignToRight ? -10 : 10;
1,255,516
public RepositoryAggregationResponse unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RepositoryAggregationResponse repositoryAggregationResponse = new RepositoryAggregationResponse();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("accountId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>repositoryAggregationResponse.setAccountId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("affectedImages", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>repositoryAggregationResponse.setAffectedImages(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("repository", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>repositoryAggregationResponse.setRepository(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("severityCounts", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>repositoryAggregationResponse.setSeverityCounts(SeverityCountsJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return repositoryAggregationResponse;<NEW_LINE>}
class).unmarshall(context));
317,892
public static DescribeDataCountsResponse unmarshall(DescribeDataCountsResponse describeDataCountsResponse, UnmarshallerContext context) {<NEW_LINE>describeDataCountsResponse.setRequestId(context.stringValue("DescribeDataCountsResponse.RequestId"));<NEW_LINE>List<DataCount> dataCountList = new ArrayList<DataCount>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeDataCountsResponse.DataCountList.Length"); i++) {<NEW_LINE>DataCount dataCount = new DataCount();<NEW_LINE>dataCount.setProductId(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].ProductId"));<NEW_LINE>dataCount.setProductCode(context.stringValue("DescribeDataCountsResponse.DataCountList[" + i + "].ProductCode"));<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setTotalCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Instance.TotalCount"));<NEW_LINE>instance.setCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Instance.Count"));<NEW_LINE>instance.setSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Instance.SensitiveCount"));<NEW_LINE>instance.setLastCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Instance.LastCount"));<NEW_LINE>instance.setLastSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Instance.LastSensitiveCount"));<NEW_LINE>dataCount.setInstance(instance);<NEW_LINE>Table table = new Table();<NEW_LINE>table.setTotalCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Table.TotalCount"));<NEW_LINE>table.setCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Table.Count"));<NEW_LINE>table.setSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Table.SensitiveCount"));<NEW_LINE>table.setLastCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Table.LastCount"));<NEW_LINE>table.setLastSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Table.LastSensitiveCount"));<NEW_LINE>dataCount.setTable(table);<NEW_LINE>_Package _package = new _Package();<NEW_LINE>_package.setTotalCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Package.TotalCount"));<NEW_LINE>_package.setCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Package.Count"));<NEW_LINE>_package.setSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Package.SensitiveCount"));<NEW_LINE>_package.setLastCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Package.LastCount"));<NEW_LINE>_package.setLastSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Package.LastSensitiveCount"));<NEW_LINE>dataCount.set_Package(_package);<NEW_LINE>Column column = new Column();<NEW_LINE>column.setTotalCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Column.TotalCount"));<NEW_LINE>column.setCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Column.Count"));<NEW_LINE>column.setSensitiveCount(context.longValue<MASK><NEW_LINE>column.setLastCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Column.LastCount"));<NEW_LINE>column.setLastSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Column.LastSensitiveCount"));<NEW_LINE>dataCount.setColumn(column);<NEW_LINE>Oss oss = new Oss();<NEW_LINE>oss.setTotalCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Oss.TotalCount"));<NEW_LINE>oss.setCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Oss.Count"));<NEW_LINE>oss.setSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Oss.SensitiveCount"));<NEW_LINE>oss.setLastCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Oss.LastCount"));<NEW_LINE>oss.setLastSensitiveCount(context.longValue("DescribeDataCountsResponse.DataCountList[" + i + "].Oss.LastSensitiveCount"));<NEW_LINE>dataCount.setOss(oss);<NEW_LINE>dataCountList.add(dataCount);<NEW_LINE>}<NEW_LINE>describeDataCountsResponse.setDataCountList(dataCountList);<NEW_LINE>return describeDataCountsResponse;<NEW_LINE>}
("DescribeDataCountsResponse.DataCountList[" + i + "].Column.SensitiveCount"));
1,526,987
public static Classifications predict() throws IOException, ModelException, TranslateException {<NEW_LINE>Path imageFile = Paths.get("src/test/resources/0.png");<NEW_LINE>Image img = ImageFactory.<MASK><NEW_LINE>String modelName = "mlp";<NEW_LINE>try (Model model = Model.newInstance(modelName)) {<NEW_LINE>model.setBlock(new Mlp(28 * 28, 10, new int[] { 128, 64 }));<NEW_LINE>// Assume you have run TrainMnist.java example, and saved model in build/model folder.<NEW_LINE>Path modelDir = Paths.get("build/model");<NEW_LINE>model.load(modelDir);<NEW_LINE>List<String> classes = IntStream.range(0, 10).mapToObj(String::valueOf).collect(Collectors.toList());<NEW_LINE>Translator<Image, Classifications> translator = ImageClassificationTranslator.builder().addTransform(new ToTensor()).optSynset(classes).build();<NEW_LINE>try (Predictor<Image, Classifications> predictor = model.newPredictor(translator)) {<NEW_LINE>return predictor.predict(img);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getInstance().fromFile(imageFile);
1,608,000
protected void actionPerformed(ListingActionContext context) {<NEW_LINE>ListingActionContext programActionContext = (ListingActionContext) context.getContextObject();<NEW_LINE>PluginTool tool = plugin.getTool();<NEW_LINE>Program program = programActionContext.getProgram();<NEW_LINE>ProgramLocation loc = programActionContext.getLocation();<NEW_LINE>Data data = program.getListing().getDataContaining(loc.getAddress());<NEW_LINE>DataType type = data.getDataType();<NEW_LINE>if (type instanceof Composite) {<NEW_LINE>Composite comp = (Composite) type;<NEW_LINE>int[] compPath = loc.getComponentPath();<NEW_LINE>for (int i = 0; i < compPath.length - 1; i++) {<NEW_LINE>DataTypeComponent subComp = comp<MASK><NEW_LINE>type = subComp.getDataType();<NEW_LINE>if (type instanceof Composite)<NEW_LINE>comp = (Composite) type;<NEW_LINE>else<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Data instance = data.getComponent(compPath);<NEW_LINE>DataTypeComponent subComp = comp.getComponent(compPath[compPath.length - 1]);<NEW_LINE>dialog.setDataComponent(program, subComp, instance.getFieldName());<NEW_LINE>tool.showDialog(dialog, tool.getComponentProvider(PluginConstants.CODE_BROWSER));<NEW_LINE>}<NEW_LINE>}
.getComponent(compPath[i]);
1,317,710
public Object parseValidated(String str) {<NEW_LINE>int len = str.length();<NEW_LINE>int[] date = new int[TOTAL_SIZE];<NEW_LINE>int[] timeZone = new int[2];<NEW_LINE>// set constants<NEW_LINE>date[CY] = YEAR;<NEW_LINE>date[D] = DAY;<NEW_LINE>int stop = 4;<NEW_LINE>date[M] = parseInt(str, 2, stop);<NEW_LINE>// REVISIT: allow both --MM and --MM-- now.<NEW_LINE>// need to remove the following 4 lines to disallow --MM--<NEW_LINE>// when the errata is offically in the rec.<NEW_LINE>if (str.length() >= stop + 2 && str.charAt(stop) == '-' && str.charAt(stop + 1) == '-') {<NEW_LINE>stop += 2;<NEW_LINE>}<NEW_LINE>if (stop < len) {<NEW_LINE>int sign = findUTCSign(str, stop, len);<NEW_LINE>getTimeZone(str, date, sign, len, timeZone);<NEW_LINE>}<NEW_LINE>if (date[utc] != 0 && date[utc] != 'Z') {<NEW_LINE>AbstractDateTime.normalize(date, timeZone);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
return new XSDDateTime(date, MONTH_MASK);
1,468,328
protected void masterOperation(IndicesShardStoresRequest request, ClusterState state, ActionListener<IndicesShardStoresResponse> listener) {<NEW_LINE>final RoutingTable routingTables = state.routingTable();<NEW_LINE>final RoutingNodes routingNodes = state.getRoutingNodes();<NEW_LINE>final String[] concreteIndices = indexNameExpressionResolver.concreteIndexNames(state, request);<NEW_LINE>final Set<Tuple<ShardId, String>> shardsToFetch = new HashSet<>();<NEW_LINE>logger.trace(<MASK><NEW_LINE>// collect relevant shard ids of the requested indices for fetching store infos<NEW_LINE>for (String index : concreteIndices) {<NEW_LINE>IndexRoutingTable indexShardRoutingTables = routingTables.index(index);<NEW_LINE>if (indexShardRoutingTables == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final String customDataPath = IndexMetadata.INDEX_DATA_PATH_SETTING.get(state.metadata().index(index).getSettings());<NEW_LINE>for (IndexShardRoutingTable routing : indexShardRoutingTables) {<NEW_LINE>final int shardId = routing.shardId().id();<NEW_LINE>ClusterShardHealth shardHealth = new ClusterShardHealth(shardId, routing);<NEW_LINE>if (request.shardStatuses().contains(shardHealth.getStatus())) {<NEW_LINE>shardsToFetch.add(Tuple.tuple(routing.shardId(), customDataPath));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// async fetch store infos from all the nodes<NEW_LINE>// NOTE: instead of fetching shard store info one by one from every node (nShards * nNodes requests)<NEW_LINE>// we could fetch all shard store info from every node once (nNodes requests)<NEW_LINE>// we have to implement a TransportNodesAction instead of using TransportNodesListGatewayStartedShards<NEW_LINE>// for fetching shard stores info, that operates on a list of shards instead of a single shard<NEW_LINE>new AsyncShardStoresInfoFetches(state.nodes(), routingNodes, shardsToFetch, listener).start();<NEW_LINE>}
"using cluster state version [{}] to determine shards", state.version());
618,806
final ImportGameConfigurationResult executeImportGameConfiguration(ImportGameConfigurationRequest importGameConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(importGameConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ImportGameConfigurationRequest> request = null;<NEW_LINE>Response<ImportGameConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ImportGameConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(importGameConfigurationRequest));<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, "GameSparks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ImportGameConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ImportGameConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ImportGameConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
951,749
protected void onChanged(Change<PathElement> c) {<NEW_LINE>List<PathElement> list = c.getList();<NEW_LINE>boolean firstElementChanged = false;<NEW_LINE>while (c.next()) {<NEW_LINE>List<PathElement> removed = c.getRemoved();<NEW_LINE>for (int i = 0; i < c.getRemovedSize(); ++i) {<NEW_LINE>removed.get(i).removeNode(Path.this);<NEW_LINE>}<NEW_LINE>for (int i = c.getFrom(); i < c.getTo(); ++i) {<NEW_LINE>list.get(i).addNode(Path.this);<NEW_LINE>}<NEW_LINE>firstElementChanged <MASK><NEW_LINE>}<NEW_LINE>// Note: as ArcTo may create a various number of PathElements,<NEW_LINE>// we cannot count the number of PathElements removed (fast enough).<NEW_LINE>// Thus we can optimize only if some elements were added to the end<NEW_LINE>if (path2d != null) {<NEW_LINE>c.reset();<NEW_LINE>c.next();<NEW_LINE>// we just have to check the first change, as more changes cannot come after such change<NEW_LINE>if (c.getFrom() == c.getList().size() && !c.wasRemoved() && c.wasAdded()) {<NEW_LINE>// some elements added<NEW_LINE>for (int i = c.getFrom(); i < c.getTo(); ++i) {<NEW_LINE>PathElementHelper.addTo(list.get(i), path2d);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>path2d = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (firstElementChanged) {<NEW_LINE>isPathValid = isFirstPathElementValid();<NEW_LINE>}<NEW_LINE>NodeHelper.markDirty(Path.this, DirtyBits.NODE_CONTENTS);<NEW_LINE>NodeHelper.geomChanged(Path.this);<NEW_LINE>}
|= c.getFrom() == 0;
855,331
public static OnsMessagePageQueryByTopicResponse unmarshall(OnsMessagePageQueryByTopicResponse onsMessagePageQueryByTopicResponse, UnmarshallerContext _ctx) {<NEW_LINE>onsMessagePageQueryByTopicResponse.setRequestId(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.RequestId"));<NEW_LINE>onsMessagePageQueryByTopicResponse.setHelpUrl(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.HelpUrl"));<NEW_LINE>MsgFoundDo msgFoundDo = new MsgFoundDo();<NEW_LINE>msgFoundDo.setCurrentPage(_ctx.longValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.CurrentPage"));<NEW_LINE>msgFoundDo.setMaxPageCount(_ctx.longValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MaxPageCount"));<NEW_LINE>msgFoundDo.setTaskId(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.TaskId"));<NEW_LINE>List<OnsRestMessageDo> msgFoundList = new ArrayList<OnsRestMessageDo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList.Length"); i++) {<NEW_LINE>OnsRestMessageDo onsRestMessageDo = new OnsRestMessageDo();<NEW_LINE>onsRestMessageDo.setOffsetId(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].OffsetId"));<NEW_LINE>onsRestMessageDo.setStoreSize(_ctx.integerValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].StoreSize"));<NEW_LINE>onsRestMessageDo.setReconsumeTimes(_ctx.integerValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].ReconsumeTimes"));<NEW_LINE>onsRestMessageDo.setStoreTimestamp(_ctx.longValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].StoreTimestamp"));<NEW_LINE>onsRestMessageDo.setBody(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].Body"));<NEW_LINE>onsRestMessageDo.setInstanceId(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].InstanceId"));<NEW_LINE>onsRestMessageDo.setMsgId(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].MsgId"));<NEW_LINE>onsRestMessageDo.setFlag(_ctx.integerValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].Flag"));<NEW_LINE>onsRestMessageDo.setStoreHost(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].StoreHost"));<NEW_LINE>onsRestMessageDo.setTopic(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].Topic"));<NEW_LINE>onsRestMessageDo.setBornTimestamp(_ctx.longValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].BornTimestamp"));<NEW_LINE>onsRestMessageDo.setBodyCRC(_ctx.integerValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].BodyCRC"));<NEW_LINE>onsRestMessageDo.setBornHost(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].BornHost"));<NEW_LINE>List<MessageProperty> propertyList <MASK><NEW_LINE>for (int j = 0; j < _ctx.lengthValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].PropertyList.Length"); j++) {<NEW_LINE>MessageProperty messageProperty = new MessageProperty();<NEW_LINE>messageProperty.setValue(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].PropertyList[" + j + "].Value"));<NEW_LINE>messageProperty.setName(_ctx.stringValue("OnsMessagePageQueryByTopicResponse.MsgFoundDo.MsgFoundList[" + i + "].PropertyList[" + j + "].Name"));<NEW_LINE>propertyList.add(messageProperty);<NEW_LINE>}<NEW_LINE>onsRestMessageDo.setPropertyList(propertyList);<NEW_LINE>msgFoundList.add(onsRestMessageDo);<NEW_LINE>}<NEW_LINE>msgFoundDo.setMsgFoundList(msgFoundList);<NEW_LINE>onsMessagePageQueryByTopicResponse.setMsgFoundDo(msgFoundDo);<NEW_LINE>return onsMessagePageQueryByTopicResponse;<NEW_LINE>}
= new ArrayList<MessageProperty>();
558,322
public int compareTo(getBlobMeta_result other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.<MASK><NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_success()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_knf()).compareTo(other.is_set_knf());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_knf()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.knf, other.knf);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
getClass().getName());
623,375
public ResultData login(String username, String password) {<NEW_LINE>try {<NEW_LINE>UserModel user = userService.getUserByUserNameAndPassWord(username, password);<NEW_LINE>if (user == null) {<NEW_LINE>throw new AuthenticationException();<NEW_LINE>}<NEW_LINE>String token = JwtUtil.createToken(username);<NEW_LINE>Date tokenExpired = new Date(new Date().getTime() + JwtUtil.EXPIRE_TIME);<NEW_LINE>JwtToken jwtToken = new JwtToken(token);<NEW_LINE><MASK><NEW_LINE>subject.login(jwtToken);<NEW_LINE>Map<String, Object> userInfo = new HashMap<String, Object>();<NEW_LINE>userInfo.put("token", token);<NEW_LINE>userInfo.put("userName", username);<NEW_LINE>userInfo.put("tokenExpired", tokenExpired.getTime());<NEW_LINE>return ResultData.builder().data(userInfo).build();<NEW_LINE>} catch (AuthenticationException e) {<NEW_LINE>return ResultData.builder().code(200).msgCode("400").msgContent("login fail").build();<NEW_LINE>}<NEW_LINE>}
Subject subject = SecurityUtils.getSubject();
1,293,251
public final void allToAllw(Object sendBuf, int[] sendCount, int[] sDispls, Datatype[] sendTypes, Object recvBuf, int[] recvCount, int[] rDispls, Datatype[] recvTypes) throws MPIException {<NEW_LINE>MPI.check();<NEW_LINE>int[] sendoffs = new int[sendTypes.length];<NEW_LINE>int[] recvoffs = new int[recvTypes.length];<NEW_LINE>boolean sdb = false, rdb = false;<NEW_LINE>if (sendBuf instanceof Buffer && !(sdb = ((Buffer) sendBuf).isDirect())) {<NEW_LINE>for (int i = 0; i < sendTypes.length; i++) {<NEW_LINE>sendoffs[i] = sendTypes[i].getOffset(sendBuf);<NEW_LINE>}<NEW_LINE>sendBuf = ((Buffer) sendBuf).array();<NEW_LINE>}<NEW_LINE>if (recvBuf instanceof Buffer && !(rdb = ((Buffer) recvBuf).isDirect())) {<NEW_LINE>for (int i = 0; i < recvTypes.length; i++) {<NEW_LINE>recvoffs[i] = recvTypes<MASK><NEW_LINE>}<NEW_LINE>recvBuf = ((Buffer) recvBuf).array();<NEW_LINE>}<NEW_LINE>long[] sendHandles = convertTypeArray(sendTypes);<NEW_LINE>long[] recvHandles = convertTypeArray(recvTypes);<NEW_LINE>int[] sendHandles_btypes = convertTypeArrayBtype(sendTypes);<NEW_LINE>int[] recvHandles_btypes = convertTypeArrayBtype(recvTypes);<NEW_LINE>allToAllw(handle, sendBuf, sdb, sendoffs, sendCount, sDispls, sendHandles, sendHandles_btypes, recvBuf, rdb, recvoffs, recvCount, rDispls, recvHandles, recvHandles_btypes);<NEW_LINE>}
[i].getOffset(recvBuf);
38,965
protected void createMethods(Program program, DexHeader header, ClassDefItem item, List<EncodedMethod> methods, TaskMonitor monitor, MessageLog log) throws Exception {<NEW_LINE>for (int i = 0; i < methods.size(); ++i) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>EncodedMethod encodedMethod = methods.get(i);<NEW_LINE>CodeItem codeItem = encodedMethod.getCodeItem();<NEW_LINE>Address methodIndexAddress = DexUtil.toLookupAddress(program, encodedMethod.getMethodIndex());<NEW_LINE>if (codeItem == null) {<NEW_LINE>// external method<NEW_LINE>} else {<NEW_LINE>Address methodAddress = toAddr(program, DexUtil.METHOD_ADDRESS + encodedMethod.getCodeOffset());<NEW_LINE>byte[<MASK><NEW_LINE>program.getMemory().setBytes(methodAddress, instructionBytes);<NEW_LINE>program.getMemory().setInt(methodIndexAddress, (int) methodAddress.getOffset());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] instructionBytes = codeItem.getInstructionBytes();
245,150
/* Build call for apisApiIdSwaggerGet */<NEW_LINE>private com.squareup.okhttp.Call apisApiIdSwaggerGetCall(String apiId, String accept, String ifNoneMatch, String ifModifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/{apiId}/swagger".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "apiId" + "\\}", apiClient.escapeString(apiId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>if (accept != null)<NEW_LINE>localVarHeaderParams.put("Accept", apiClient.parameterToString(accept));<NEW_LINE>if (ifNoneMatch != null)<NEW_LINE>localVarHeaderParams.put("If-None-Match", apiClient.parameterToString(ifNoneMatch));<NEW_LINE>if (ifModifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Modified-Since", apiClient.parameterToString(ifModifiedSince));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
HashMap<String, String>();
1,670,438
private Position decode1G(Channel channel, SocketAddress remoteAddress, String sentence) {<NEW_LINE>Parser parser = new Parser(PATTERN_1G, sentence);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress);<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.set(Position.KEY_TYPE, parser.next());<NEW_LINE>position.setTime(parser.nextDateTime());<NEW_LINE>position.setValid(parser.next().equals("A"));<NEW_LINE>position.setLatitude(parser.nextCoordinate());<NEW_LINE>position.setLongitude(parser.nextCoordinate());<NEW_LINE>position.setSpeed(parser.nextDouble(0));<NEW_LINE>position.setCourse(parser.nextDouble(0));<NEW_LINE>position.set(Position.KEY_HDOP<MASK><NEW_LINE>position.set(Position.KEY_STATUS, parser.next());<NEW_LINE>return position;<NEW_LINE>}
, parser.nextDouble(0));
732,390
public FirewallRule createRuleForAllCidrs(long ipAddrId, Account caller, Integer startPort, Integer endPort, String protocol, Integer icmpCode, Integer icmpType, Long relatedRuleId, long networkId) throws NetworkRuleConflictException {<NEW_LINE>// If firwallRule for this port range already exists, return it<NEW_LINE>List<FirewallRuleVO> rules = _firewallDao.listByIpPurposeAndProtocolAndNotRevoked(ipAddrId, startPort, endPort, protocol, Purpose.Firewall);<NEW_LINE>if (!rules.isEmpty()) {<NEW_LINE>return rules.get(0);<NEW_LINE>}<NEW_LINE>List<String> oneCidr = new ArrayList<String>();<NEW_LINE><MASK><NEW_LINE>return createFirewallRule(ipAddrId, caller, null, startPort, endPort, protocol, oneCidr, null, icmpCode, icmpType, relatedRuleId, FirewallRule.FirewallRuleType.User, networkId, FirewallRule.TrafficType.Ingress, true);<NEW_LINE>}
oneCidr.add(NetUtils.ALL_IP4_CIDRS);
883,651
final AssociateServiceActionWithProvisioningArtifactResult executeAssociateServiceActionWithProvisioningArtifact(AssociateServiceActionWithProvisioningArtifactRequest associateServiceActionWithProvisioningArtifactRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateServiceActionWithProvisioningArtifactRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateServiceActionWithProvisioningArtifactRequest> request = null;<NEW_LINE>Response<AssociateServiceActionWithProvisioningArtifactResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateServiceActionWithProvisioningArtifactRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateServiceActionWithProvisioningArtifactRequest));<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, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateServiceActionWithProvisioningArtifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateServiceActionWithProvisioningArtifactResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateServiceActionWithProvisioningArtifactResultJsonUnmarshaller());<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);
38,364
synchronized public void writeMetadata(@NonNull BackupFiles.BackupFile backupFile) throws IOException {<NEW_LINE>if (metadata == null) {<NEW_LINE>throw new RuntimeException("Metadata not set for path " + backupFile.getBackupPath());<NEW_LINE>}<NEW_LINE>Path metadataFile = backupFile.getMetadataFile();<NEW_LINE>try (OutputStream outputStream = metadataFile.openOutputStream()) {<NEW_LINE>JSONObject rootObject = new JSONObject();<NEW_LINE>rootObject.put("label", metadata.label);<NEW_LINE>rootObject.put("package_name", metadata.packageName);<NEW_LINE>rootObject.put("version_name", metadata.versionName);<NEW_LINE>rootObject.put("version_code", metadata.versionCode);<NEW_LINE>rootObject.put("data_dirs", JSONUtils.getJSONArray(metadata.dataDirs));<NEW_LINE>rootObject.put("is_system", metadata.isSystem);<NEW_LINE>rootObject.put("is_split_apk", metadata.isSplitApk);<NEW_LINE>rootObject.put("split_configs", JSONUtils.getJSONArray(metadata.splitConfigs));<NEW_LINE>rootObject.<MASK><NEW_LINE>rootObject.put("backup_time", metadata.backupTime);<NEW_LINE>rootObject.put("checksum_algo", metadata.checksumAlgo);<NEW_LINE>rootObject.put("crypto", metadata.crypto);<NEW_LINE>rootObject.put("key_ids", metadata.keyIds);<NEW_LINE>rootObject.put("iv", metadata.iv == null ? null : HexEncoding.encodeToString(metadata.iv));<NEW_LINE>rootObject.put("aes", metadata.aes == null ? null : HexEncoding.encodeToString(metadata.aes));<NEW_LINE>rootObject.put("version", metadata.version);<NEW_LINE>rootObject.put("apk_name", metadata.apkName);<NEW_LINE>rootObject.put("instruction_set", metadata.instructionSet);<NEW_LINE>rootObject.put("flags", metadata.flags.getFlags());<NEW_LINE>rootObject.put("user_handle", metadata.userHandle);<NEW_LINE>rootObject.put("tar_type", metadata.tarType);<NEW_LINE>rootObject.put("key_store", metadata.keyStore);<NEW_LINE>rootObject.put("installer", metadata.installer);<NEW_LINE>outputStream.write(rootObject.toString(4).getBytes());<NEW_LINE>} catch (JSONException e) {<NEW_LINE>throw new IOException(e.getMessage() + " for path " + backupFile.getBackupPath());<NEW_LINE>}<NEW_LINE>}
put("has_rules", metadata.hasRules);
1,542,735
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "drs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
155,575
public void provideDynamicMetrics(MetricDescriptor descriptor, MetricsCollectionContext context) {<NEW_LINE>for (ManagedExecutorService executorService : executors.values()) {<NEW_LINE>MetricDescriptor executorDescriptor = descriptor.copy().withPrefix(EXECUTOR_PREFIX_INTERNAL).withDiscriminator(EXECUTOR_DISCRIMINATOR_NAME, executorService.getName<MASK><NEW_LINE>context.collect(executorDescriptor, executorService);<NEW_LINE>}<NEW_LINE>for (ManagedExecutorService executorService : durableExecutors.values()) {<NEW_LINE>MetricDescriptor executorDescriptor = descriptor.copy().withPrefix(EXECUTOR_PREFIX_DURABLE_INTERNAL).withDiscriminator(EXECUTOR_DISCRIMINATOR_NAME, executorService.getName()).withExcludedTarget(MANAGEMENT_CENTER);<NEW_LINE>context.collect(executorDescriptor, executorService);<NEW_LINE>}<NEW_LINE>for (ManagedExecutorService executorService : scheduleDurableExecutors.values()) {<NEW_LINE>MetricDescriptor executorDescriptor = descriptor.copy().withPrefix(EXECUTOR_PREFIX_SCHEDULED_INTERNAL).withDiscriminator(EXECUTOR_DISCRIMINATOR_NAME, executorService.getName()).withExcludedTarget(MANAGEMENT_CENTER);<NEW_LINE>context.collect(executorDescriptor, executorService);<NEW_LINE>}<NEW_LINE>}
()).withExcludedTarget(MANAGEMENT_CENTER);
1,538,273
public void parse(String result, Object data) {<NEW_LINE>JsonObject jobj = JsonParser.parseString(result).getAsJsonObject();<NEW_LINE>if (jobj.has("type")) {<NEW_LINE>String type = jobj.get("type").getAsString();<NEW_LINE>if (type.equals("error")) {<NEW_LINE>String desc = jobj.get("description").getAsString();<NEW_LINE>manager.getEventListeners().fire.consoleOutput(desc + "\n", 0);<NEW_LINE>Msg.error(this, desc);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (jobj.has("payload")) {<NEW_LINE>Object object = jobj.get("payload");<NEW_LINE>if (!(object instanceof JsonPrimitive)) {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + " not a String\n", 0);<NEW_LINE>Msg.error(this, object);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String value = ((JsonPrimitive) object).getAsString();<NEW_LINE>if (!value.startsWith("{")) {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + "\n", 0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JsonElement res = JsonParser.parseString(value);<NEW_LINE>if (res instanceof JsonObject) {<NEW_LINE>JsonObject keyValue = (JsonObject) res;<NEW_LINE>JsonElement <MASK><NEW_LINE>if (element != null) {<NEW_LINE>res = keyValue.get("value");<NEW_LINE>String key = element.getAsString();<NEW_LINE>if (!key.equals(name)) {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(res + "\n", 0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + "\n", 0);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + "\n", 0);<NEW_LINE>}<NEW_LINE>if (res.equals("[]")) {<NEW_LINE>Msg.error(this, "nothing returned for " + this);<NEW_LINE>}<NEW_LINE>if (res instanceof JsonArray) {<NEW_LINE>JsonArray arr = (JsonArray) res;<NEW_LINE>for (JsonElement l : arr) {<NEW_LINE>parseSpecifics(l);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>parseSpecifics(res);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cleanup();<NEW_LINE>}
element = keyValue.get("key");
906,846
public Memory __construct(Environment env, TraceInfo traceInfo, String isoString, int options) {<NEW_LINE>String[] parts = Arrays.stream(isoString.split("/")).filter(s -> !s.isEmpty()).toArray(String[]::new);<NEW_LINE>Messages.Item badFormat = new Messages.Item("DatePeriod::__construct(): Unknown or bad format (%s)");<NEW_LINE>Messages.Item notContain = new Messages.Item("DatePeriod::__construct(): The ISO interval '%s' did not contain %s.");<NEW_LINE>if (parts.length == 0 || parts.length > 3) {<NEW_LINE>env.exception(traceInfo<MASK><NEW_LINE>}<NEW_LINE>Matcher matcher = RECURRENCE_PATTERN.matcher(parts[0]);<NEW_LINE>if (!matcher.matches())<NEW_LINE>env.exception(traceInfo, badFormat.fetch(isoString));<NEW_LINE>if (parts.length == 1)<NEW_LINE>env.exception(traceInfo, notContain.fetch(isoString, "a start date"));<NEW_LINE>try {<NEW_LINE>ZonedDateTime parse = ZonedDateTime.parse(parts[1]);<NEW_LINE>if (parts.length == 2) {<NEW_LINE>env.exception(traceInfo, notContain.fetch(isoString, "an interval"));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.interval = new DateInterval(env).__construct(env, traceInfo, parts[2]);<NEW_LINE>this.start = DateTime.of(env, parse);<NEW_LINE>this.include_start_date = options != EXCLUDE_START_DATE;<NEW_LINE>long rec = Long.parseLong(matcher.group(1));<NEW_LINE>this.recurrences = LongMemory.valueOf(include_start_date ? ++rec : rec);<NEW_LINE>} catch (Exception e) {<NEW_LINE>env.exception(traceInfo, badFormat.fetch(isoString));<NEW_LINE>}<NEW_LINE>} catch (DateTimeParseException e) {<NEW_LINE>env.exception(traceInfo, badFormat.fetch(isoString));<NEW_LINE>}<NEW_LINE>return new ObjectMemory(this);<NEW_LINE>}
, badFormat.fetch(isoString));
155,401
static DriverWrapper loadDriver(final PwmApplication pwmApplication, final DBConfiguration dbConfiguration) throws DatabaseException {<NEW_LINE>final Set<ClassLoaderStrategy> strategies = dbConfiguration.getClassLoaderStrategies();<NEW_LINE>LOGGER.trace(() -> "attempting to load jdbc driver using strategies: " + JsonFactory.get().serializeCollection(strategies));<NEW_LINE>final List<String> errorMsgs = new ArrayList<>();<NEW_LINE>for (final ClassLoaderStrategy strategy : strategies) {<NEW_LINE>try {<NEW_LINE>final DriverLoader loader = strategy.getJdbcDriverDriverLoader();<NEW_LINE>final Driver driver = loader.loadDriver(pwmApplication, dbConfiguration);<NEW_LINE>if (driver != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (final PwmUnrecoverableException | DatabaseException e) {<NEW_LINE>errorMsgs.add(strategy + " error: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String errorMsg = " unable to load database driver: " + JsonFactory.get().serializeCollection(errorMsgs);<NEW_LINE>final ErrorInformation errorInformation = new ErrorInformation(PwmError.ERROR_DB_UNAVAILABLE, errorMsg);<NEW_LINE>LOGGER.error(() -> errorMsg);<NEW_LINE>throw new DatabaseException(errorInformation);<NEW_LINE>}
return new DriverWrapper(driver, loader);
1,112,080
final CreateRevisionResult executeCreateRevision(CreateRevisionRequest createRevisionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createRevisionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateRevisionRequest> request = null;<NEW_LINE>Response<CreateRevisionResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateRevisionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createRevisionRequest));<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, "DataExchange");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateRevision");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateRevisionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateRevisionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
445,122
public static FindOsVersionsResponse unmarshall(FindOsVersionsResponse findOsVersionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>findOsVersionsResponse.setRequestId(_ctx.stringValue("FindOsVersionsResponse.RequestId"));<NEW_LINE>OsVersionList osVersionList = new OsVersionList();<NEW_LINE>osVersionList.setTotalCount(_ctx.integerValue("FindOsVersionsResponse.OsVersionList.TotalCount"));<NEW_LINE>List<ItemsItem> items <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("FindOsVersionsResponse.OsVersionList.Items.Length"); i++) {<NEW_LINE>ItemsItem itemsItem = new ItemsItem();<NEW_LINE>itemsItem.setId(_ctx.longValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].Id"));<NEW_LINE>itemsItem.setDeviceModelId(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].DeviceModelId"));<NEW_LINE>itemsItem.setSystemVersion(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].SystemVersion"));<NEW_LINE>itemsItem.setStatus(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].Status"));<NEW_LINE>itemsItem.setIsMilestone(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].IsMilestone"));<NEW_LINE>itemsItem.setIsForceUpgrade(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].IsForceUpgrade"));<NEW_LINE>itemsItem.setIsSilentUpgrade(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].IsSilentUpgrade"));<NEW_LINE>itemsItem.setIsForceReboot(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].IsForceReboot"));<NEW_LINE>itemsItem.setIsForceNightUpgrade(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].IsForceNightUpgrade"));<NEW_LINE>itemsItem.setGmtCreate(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].GmtCreate"));<NEW_LINE>itemsItem.setGmtModify(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].GmtModify"));<NEW_LINE>itemsItem.setRemark(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].Remark"));<NEW_LINE>itemsItem.setStatusName(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].StatusName"));<NEW_LINE>itemsItem.setDeviceModelName(_ctx.stringValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].DeviceModelName"));<NEW_LINE>itemsItem.setGmtCreateTimestamp(_ctx.longValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].GmtCreateTimestamp"));<NEW_LINE>itemsItem.setGmtModifyTimestamp(_ctx.longValue("FindOsVersionsResponse.OsVersionList.Items[" + i + "].GmtModifyTimestamp"));<NEW_LINE>items.add(itemsItem);<NEW_LINE>}<NEW_LINE>osVersionList.setItems(items);<NEW_LINE>findOsVersionsResponse.setOsVersionList(osVersionList);<NEW_LINE>return findOsVersionsResponse;<NEW_LINE>}
= new ArrayList<ItemsItem>();
1,489,167
protected void buildBodyDeclarations(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration expression, AnonymousClassDeclaration anonymousClassDeclaration) {<NEW_LINE>// add body declaration in the lexical order<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.TypeDeclaration[] members = expression.memberTypes;<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = expression.fields;<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = expression.methods;<NEW_LINE>int fieldsLength = fields == null ? 0 : fields.length;<NEW_LINE>int methodsLength = methods == null ? 0 : methods.length;<NEW_LINE>int membersLength = members == null ? 0 : members.length;<NEW_LINE>int fieldsIndex = 0;<NEW_LINE>int methodsIndex = 0;<NEW_LINE>int membersIndex = 0;<NEW_LINE>while ((fieldsIndex < fieldsLength) || (membersIndex < membersLength) || (methodsIndex < methodsLength)) {<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null;<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null;<NEW_LINE>org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null;<NEW_LINE>int position = Integer.MAX_VALUE;<NEW_LINE>int nextDeclarationType = -1;<NEW_LINE>if (fieldsIndex < fieldsLength) {<NEW_LINE>nextFieldDeclaration = fields[fieldsIndex];<NEW_LINE>if (nextFieldDeclaration.declarationSourceStart < position) {<NEW_LINE>position = nextFieldDeclaration.declarationSourceStart;<NEW_LINE>// FIELD<NEW_LINE>nextDeclarationType = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (methodsIndex < methodsLength) {<NEW_LINE>nextMethodDeclaration = methods[methodsIndex];<NEW_LINE>if (nextMethodDeclaration.declarationSourceStart < position) {<NEW_LINE>position = nextMethodDeclaration.declarationSourceStart;<NEW_LINE>// METHOD<NEW_LINE>nextDeclarationType = 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (membersIndex < membersLength) {<NEW_LINE>nextMemberDeclaration = members[membersIndex];<NEW_LINE>if (nextMemberDeclaration.declarationSourceStart < position) {<NEW_LINE>position = nextMemberDeclaration.declarationSourceStart;<NEW_LINE>// MEMBER<NEW_LINE>nextDeclarationType = 2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>switch(nextDeclarationType) {<NEW_LINE>case 0:<NEW_LINE>if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {<NEW_LINE>anonymousClassDeclaration.bodyDeclarations()<MASK><NEW_LINE>} else {<NEW_LINE>checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, anonymousClassDeclaration.bodyDeclarations());<NEW_LINE>}<NEW_LINE>fieldsIndex++;<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>methodsIndex++;<NEW_LINE>if (!nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) {<NEW_LINE>anonymousClassDeclaration.bodyDeclarations().add(convert(false, nextMethodDeclaration));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>membersIndex++;<NEW_LINE>ASTNode node = convert(nextMemberDeclaration);<NEW_LINE>if (node == null) {<NEW_LINE>anonymousClassDeclaration.setFlags(anonymousClassDeclaration.getFlags() | ASTNode.MALFORMED);<NEW_LINE>} else {<NEW_LINE>anonymousClassDeclaration.bodyDeclarations().add(node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.add(convert(nextFieldDeclaration));
1,175,022
public void exitCfp_clone(Cfp_cloneContext ctx) {<NEW_LINE>String name = toString(ctx.name.str());<NEW_LINE>Policy existing = _c.getPolicies().get(name);<NEW_LINE>if (existing == null) {<NEW_LINE>warn(ctx, String.format("Cannot clone a non-existent policy %s", name));<NEW_LINE>_c.undefined(FortiosStructureType.POLICY, name, FortiosStructureUsage.POLICY_CLONE, ctx.start.getLine());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Optional<Long> to = toLong(ctx, ctx.to);<NEW_LINE>if (!to.isPresent()) {<NEW_LINE>warn(ctx, "Cannot create a cloned policy with an invalid name");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String toNumber = to.get().toString();<NEW_LINE>if (_c.getPolicies().containsKey(toNumber)) {<NEW_LINE>warn(ctx, String.format("Cannot clone, policy %s already exists", toNumber));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Policy clone = SerializationUtils.clone(existing);<NEW_LINE>clone.setNumber(toNumber);<NEW_LINE>_c.getPolicies(<MASK><NEW_LINE>_c.defineStructure(FortiosStructureType.POLICY, toNumber, ctx);<NEW_LINE>_c.referenceStructure(FortiosStructureType.POLICY, toNumber, FortiosStructureUsage.POLICY_SELF_REF, ctx.start.getLine());<NEW_LINE>}
).put(toNumber, clone);
664,370
public WorkspaceInfoFromDiff sync(ExtendedEventHandler eventHandler, PackageOptions packageOptions, PathPackageLocator pathPackageLocator, BuildLanguageOptions buildLanguageOptions, UUID commandId, Map<String, String> clientEnv, Map<String, String> repoEnvOption, TimestampGranularityMonitor tsgm, OptionsProvider options) throws InterruptedException, AbruptExitException {<NEW_LINE>getActionEnvFromOptions(options<MASK><NEW_LINE>PrecomputedValue.REPO_ENV.set(injectable(), new LinkedHashMap<>(repoEnvOption));<NEW_LINE>RemoteOptions remoteOptions = options.getOptions(RemoteOptions.class);<NEW_LINE>setRemoteExecutionEnabled(remoteOptions != null && remoteOptions.isRemoteExecutionEnabled());<NEW_LINE>updateSkyFunctionsSemaphoreSize(options);<NEW_LINE>AnalysisOptions analysisOptions = options.getOptions(AnalysisOptions.class);<NEW_LINE>keepBuildConfigurationNodesWhenDiscardingAnalysis = analysisOptions == null || analysisOptions.keepConfigNodes;<NEW_LINE>syncPackageLoading(packageOptions, pathPackageLocator, buildLanguageOptions, commandId, clientEnv, tsgm, options);<NEW_LINE>if (lastAnalysisDiscarded) {<NEW_LINE>dropConfiguredTargetsNow(eventHandler);<NEW_LINE>lastAnalysisDiscarded = false;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
.getOptions(CoreOptions.class));
363,731
static private String buildQuery(List<DataSource> dataSources, boolean showAll, int cntDaysFromRecent, boolean noTimeStamp) {<NEW_LINE>String mostRecentQuery = "";<NEW_LINE>if (!showAll && cntDaysFromRecent > 0) {<NEW_LINE>// MOST_RECENT_TIME<NEW_LINE>// SELECT MAX(value_int64) - (%d * 86400)<NEW_LINE>// FROM blackboard_attributes<NEW_LINE>// WHERE attribute_type_id IN(%s)<NEW_LINE>// AND artifact_id<NEW_LINE>// IN ( %s )<NEW_LINE>//<NEW_LINE>// NON-NLS<NEW_LINE>mostRecentQuery = // NON-NLS<NEW_LINE>String.// NON-NLS<NEW_LINE>format("AND value_int64 > (%s)", String.format(MOST_RECENT_TIME, cntDaysFromRecent, TIME_TYPE_IDS, getWaypointListQuery(dataSources)));<NEW_LINE>}<NEW_LINE>// GEO_ARTIFACT_QUERY<NEW_LINE>// SELECT artifact_id, artifact_type_id<NEW_LINE>// FROM blackboard_attributes<NEW_LINE>// WHERE attribute_type_id IN (%s)<NEW_LINE>String query = String.format(GEO_ARTIFACT_QUERY, TIME_TYPE_IDS);<NEW_LINE>// That are in the list of artifacts for the given data Sources<NEW_LINE>// NON-NLS<NEW_LINE>query += String.format<MASK><NEW_LINE>query += mostRecentQuery;<NEW_LINE>if (showAll || noTimeStamp) {<NEW_LINE>// NON-NLS<NEW_LINE>query = String.format("%s UNION %s", buildQueryForWaypointsWOTimeStamps(dataSources), query);<NEW_LINE>}<NEW_LINE>return query;<NEW_LINE>}
("AND artifact_id IN(%s)", getWaypointListQuery(dataSources));
447,982
/*<NEW_LINE>* Serialize parameter Object. Need to take special care of {@link Number} and<NEW_LINE>* {@link Date} instances since they should be of the correct type for late binding.<NEW_LINE>*/<NEW_LINE>private static void writeParam(Object v, DataOutput writer) throws IOException {<NEW_LINE>if (v instanceof Byte) {<NEW_LINE>writer.write(BYTE_ID);<NEW_LINE>writer.writeByte(((Byte) v).byteValue());<NEW_LINE>} else if (v instanceof Short) {<NEW_LINE>writer.write(SHORT_ID);<NEW_LINE>writer.writeShort(((Short) v).shortValue());<NEW_LINE>} else if (v instanceof Integer) {<NEW_LINE>writer.write(INTEGER_ID);<NEW_LINE>writer.writeInt(((Integer) v).intValue());<NEW_LINE>} else if (v instanceof Character) {<NEW_LINE>writer.write(CHAR_ID);<NEW_LINE>writer.writeChar(((Character) v).charValue());<NEW_LINE>} else if (v instanceof Long) {<NEW_LINE>writer.write(LONG_ID);<NEW_LINE>writer.writeLong(((Long<MASK><NEW_LINE>} else if (v instanceof Float) {<NEW_LINE>writer.write(FLOAT_ID);<NEW_LINE>writer.writeFloat(((Float) v).floatValue());<NEW_LINE>} else if (v instanceof Double) {<NEW_LINE>writer.write(DOUBLE_ID);<NEW_LINE>writer.writeDouble(((Double) v).doubleValue());<NEW_LINE>} else if (v instanceof Date) {<NEW_LINE>writer.write(DATE_ID);<NEW_LINE>writer.writeLong(((Date) v).getTime());<NEW_LINE>} else if (v != null) {<NEW_LINE>writer.write(STRING_ID);<NEW_LINE>if (v instanceof Throwable) {<NEW_LINE>if (v instanceof TruncatableThrowable) {<NEW_LINE>writeString(RasHelper.throwableToString(((TruncatableThrowable) v).getWrappedException()), writer);<NEW_LINE>} else {<NEW_LINE>writeString(RasHelper.throwableToString((Throwable) v), writer);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>writeString(v.toString(), writer);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>writer.write(NULL_ID);<NEW_LINE>}<NEW_LINE>}
) v).longValue());
540,283
public GatewayPlatform unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GatewayPlatform gatewayPlatform = new GatewayPlatform();<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("greengrass", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>gatewayPlatform.setGreengrass(GreengrassJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("greengrassV2", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>gatewayPlatform.setGreengrassV2(GreengrassV2JsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return gatewayPlatform;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,268,344
public static void main(String[] args) {<NEW_LINE>int[] input_itemsets, output_itemsets, referrence;<NEW_LINE>// the lengths of the two sequences should be able to divided by 16 and at<NEW_LINE>// current stage max_rows needs to equal max_cols<NEW_LINE>if (args.length != 3) {<NEW_LINE>usage();<NEW_LINE>}<NEW_LINE>final int max_rows = Integer.parseInt(args[0]) + 1;<NEW_LINE>final int max_cols = Integer.parseInt(args[0]) + 1;<NEW_LINE>final int penalty = Integer.parseInt(args[1]);<NEW_LINE>referrence = new int[max_rows * max_cols];<NEW_LINE>input_itemsets = new int[max_rows * max_cols];<NEW_LINE>Random random = new Random();<NEW_LINE>random.setSeed(7);<NEW_LINE>Arrays.fill(input_itemsets, 0);<NEW_LINE>TaskSchedule s0 = new TaskSchedule("s0").task("init-ref", NWTornado::initialiseReference, max_rows, max_cols, input_itemsets, referrence, blosum62).task("init-input1", NWTornado::initialiseInput, max_rows, max_cols, penalty, input_itemsets).task("init-input2", NWTornado::initialiseInput, max_cols, 1, penalty, input_itemsets).task("topleft", NWTornado::processTopLeft, max_rows, max_cols, penalty, input_itemsets, referrence).task("bottomright", NWTornado::processBottomRight, max_rows, max_cols, penalty, input_itemsets, referrence).streamOut(input_itemsets, referrence);<NEW_LINE>s0.warmup();<NEW_LINE><MASK><NEW_LINE>final long t0 = System.nanoTime();<NEW_LINE>for (int i = 1; i < max_rows; i++) {<NEW_LINE>// please define your own sequence.<NEW_LINE>input_itemsets[i * max_cols] = Math.abs(random.nextInt()) % 10 + 1;<NEW_LINE>}<NEW_LINE>for (int j = 1; j < max_cols; j++) {<NEW_LINE>// please define your own sequence.<NEW_LINE>input_itemsets[j] = Math.abs(random.nextInt()) % 10 + 1;<NEW_LINE>}<NEW_LINE>s0.execute();<NEW_LINE>final long t1 = System.nanoTime();<NEW_LINE>System.out.printf("elapsed: %.9f s\n", (t1 - t0) * 1e-9);<NEW_LINE>traceback(max_rows, max_cols, penalty, input_itemsets, referrence);<NEW_LINE>}
System.out.printf("Start Needleman-Wunsch\n");
1,594,137
protected void playImpl() {<NEW_LINE>if (isVideo) {<NEW_LINE>if (component == null && nativePlayer) {<NEW_LINE>// Mass source of confusion. If getVideoComponent() has been called, then<NEW_LINE>// we can't use the native player.<NEW_LINE>if (uri != null) {<NEW_LINE>moviePlayerPeer = nativeInstance.createNativeVideoComponent(uri, onCompletionCallbackId);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>long val = getNSData(stream);<NEW_LINE>if (val > 0) {<NEW_LINE>moviePlayerPeer = <MASK><NEW_LINE>Util.cleanup(stream);<NEW_LINE>} else {<NEW_LINE>byte[] data = Util.readInputStream(stream);<NEW_LINE>Util.cleanup(stream);<NEW_LINE>moviePlayerPeer = nativeInstance.createNativeVideoComponent(data, onCompletionCallbackId);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>fireMediaError(new MediaException(MediaErrorType.Decode, ex));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>nativeInstance.showNativePlayerController(moviePlayerPeer);<NEW_LINE>}<NEW_LINE>if (moviePlayerPeer != 0) {<NEW_LINE>nativeInstance.startVideoComponent(moviePlayerPeer);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>nativeInstance.playAudio(moviePlayerPeer);<NEW_LINE>}<NEW_LINE>markActive();<NEW_LINE>fireMediaStateChange(State.Playing);<NEW_LINE>}
nativeInstance.createNativeVideoComponentNSData(val, onCompletionCallbackId);
991,066
private static String etlGetPasswordHash(List<String> funArgs) throws Exception {<NEW_LINE>String userName = funArgs.get(0);<NEW_LINE>String password = funArgs.get(1);<NEW_LINE>DateFormat df = new SimpleDateFormat("yyyyMMdd");<NEW_LINE>Date today = Calendar.getInstance().getTime();<NEW_LINE>String todayStr = df.format(today);<NEW_LINE>String rawHash = String.format("%s%s%s", userName, todayStr, password);<NEW_LINE>byte[] bytesOfMessage = rawHash.getBytes("UTF-8");<NEW_LINE>MessageDigest md = MessageDigest.getInstance("MD5");<NEW_LINE>byte[] theDigest = md.digest(bytesOfMessage);<NEW_LINE>char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };<NEW_LINE>char[] str = new char[16 * 2];<NEW_LINE>int k = 0;<NEW_LINE>for (int i = 0; i < 16; i++) {<NEW_LINE>byte byte0 = theDigest[i];<NEW_LINE>str[k++] = hexDigits[<MASK><NEW_LINE>str[k++] = hexDigits[byte0 & 0xf];<NEW_LINE>}<NEW_LINE>return new String(str);<NEW_LINE>}
byte0 >>> 4 & 0xf];
493,939
public static void open(final DiskManagerFileInfo file, final boolean open_containing_folder_mode) {<NEW_LINE>if (file != null) {<NEW_LINE>LaunchManager launch_manager = LaunchManager.getManager();<NEW_LINE>LaunchManager.LaunchTarget target = launch_manager.createTarget(file);<NEW_LINE>launch_manager.launchRequest(target, new LaunchManager.LaunchAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionAllowed() {<NEW_LINE>Utils.execSWTThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>PlatformTorrentUtils.setHasBeenOpened(file.getDownloadManager(), file.getIndex(), true);<NEW_LINE>File this_file = file.getFile(true);<NEW_LINE>File parent_file = (open_containing_folder_mode) ? this_file.getParentFile() : null;<NEW_LINE>open((parent_file <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionDenied(Throwable reason) {<NEW_LINE>Debug.out("Launch request denied", reason);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
== null) ? this_file : parent_file);
1,662,127
public void updateRoutingProfileConcurrency(UpdateRoutingProfileConcurrencyRequest updateRoutingProfileConcurrencyRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateRoutingProfileConcurrencyRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateRoutingProfileConcurrencyRequest> request = null;<NEW_LINE>Response<Void> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateRoutingProfileConcurrencyRequestMarshaller().marshall(updateRoutingProfileConcurrencyRequest);<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>JsonResponseHandler<Void> responseHandler = new JsonResponseHandler<Void>(null);<NEW_LINE>invoke(request, responseHandler, executionContext);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,500,171
final UnregisterConnectorResult executeUnregisterConnector(UnregisterConnectorRequest unregisterConnectorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(unregisterConnectorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UnregisterConnectorRequest> request = null;<NEW_LINE>Response<UnregisterConnectorResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UnregisterConnectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(unregisterConnectorRequest));<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, "Appflow");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UnregisterConnector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UnregisterConnectorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UnregisterConnectorResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,081,382
// check if file can be loaded in the encoding correctly:<NEW_LINE>// returns ABSOLUTELY if bytes on disk, converted to text with the charset, converted back to bytes matched<NEW_LINE>// returns NO_WAY if the new encoding is incompatible (bytes on disk will differ)<NEW_LINE>// returns WELL_IF_YOU_INSIST if the bytes on disk remain the same but the text will change<NEW_LINE>@Nonnull<NEW_LINE>static Magic8 isSafeToReloadIn(@Nonnull VirtualFile virtualFile, @Nonnull CharSequence text, @Nonnull byte[] bytes, @Nonnull Charset charset) {<NEW_LINE>// file has BOM but the charset hasn't<NEW_LINE>byte[] bom = virtualFile.getBOM();<NEW_LINE>if (bom != null && !CharsetToolkit.canHaveBom(charset, bom))<NEW_LINE>return Magic8.NO_WAY;<NEW_LINE>// the charset has mandatory BOM (e.g. UTF-xx) but the file hasn't or has wrong<NEW_LINE>byte[] mandatoryBom = CharsetToolkit.getMandatoryBom(charset);<NEW_LINE>if (mandatoryBom != null && !ArrayUtil.startsWith(bytes, mandatoryBom))<NEW_LINE>return Magic8.NO_WAY;<NEW_LINE>String loaded = LoadTextUtil.getTextByBinaryPresentation(<MASK><NEW_LINE>String separator = FileDocumentManager.getInstance().getLineSeparator(virtualFile, null);<NEW_LINE>String toSave = StringUtil.convertLineSeparators(loaded, separator);<NEW_LINE>LoadTextUtil.AutoDetectionReason failReason = LoadTextUtil.getCharsetAutoDetectionReason(virtualFile);<NEW_LINE>if (failReason != null && StandardCharsets.UTF_8.equals(virtualFile.getCharset()) && !StandardCharsets.UTF_8.equals(charset)) {<NEW_LINE>// can't reload utf8-autodetected file in another charset<NEW_LINE>return Magic8.NO_WAY;<NEW_LINE>}<NEW_LINE>byte[] bytesToSave;<NEW_LINE>try {<NEW_LINE>bytesToSave = toSave.getBytes(charset);<NEW_LINE>}// turned out some crazy charsets have incorrectly implemented .newEncoder() returning null<NEW_LINE>catch (UnsupportedOperationException | NullPointerException e) {<NEW_LINE>return Magic8.NO_WAY;<NEW_LINE>}<NEW_LINE>if (bom != null && !ArrayUtil.startsWith(bytesToSave, bom)) {<NEW_LINE>// for 2-byte encodings String.getBytes(Charset) adds BOM automatically<NEW_LINE>bytesToSave = ArrayUtil.mergeArrays(bom, bytesToSave);<NEW_LINE>}<NEW_LINE>return !Arrays.equals(bytesToSave, bytes) ? Magic8.NO_WAY : StringUtil.equals(loaded, text) ? Magic8.ABSOLUTELY : Magic8.WELL_IF_YOU_INSIST;<NEW_LINE>}
bytes, charset).toString();
1,458,734
public static DescribeDBClusterAccessWhiteListResponse unmarshall(DescribeDBClusterAccessWhiteListResponse describeDBClusterAccessWhiteListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDBClusterAccessWhiteListResponse.setRequestId(_ctx.stringValue("DescribeDBClusterAccessWhiteListResponse.RequestId"));<NEW_LINE>List<IPArray> items <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDBClusterAccessWhiteListResponse.Items.Length"); i++) {<NEW_LINE>IPArray iPArray = new IPArray();<NEW_LINE>iPArray.setDBClusterIPArrayName(_ctx.stringValue("DescribeDBClusterAccessWhiteListResponse.Items[" + i + "].DBClusterIPArrayName"));<NEW_LINE>iPArray.setSecurityIPList(_ctx.stringValue("DescribeDBClusterAccessWhiteListResponse.Items[" + i + "].SecurityIPList"));<NEW_LINE>iPArray.setDBClusterIPArrayAttribute(_ctx.stringValue("DescribeDBClusterAccessWhiteListResponse.Items[" + i + "].DBClusterIPArrayAttribute"));<NEW_LINE>items.add(iPArray);<NEW_LINE>}<NEW_LINE>describeDBClusterAccessWhiteListResponse.setItems(items);<NEW_LINE>return describeDBClusterAccessWhiteListResponse;<NEW_LINE>}
= new ArrayList<IPArray>();
287,397
public static ErrorDescription switchExpression(HintContext ctx) {<NEW_LINE>TreePath select = ctx.getVariables().get("$select");<NEW_LINE>TypeMirror m = ctx.getInfo().getTrees().getTypeMirror(select);<NEW_LINE>if (m == null || m.getKind() != TypeKind.DECLARED) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>State r = computeExpressionsState(ctx).get(select.getLeaf());<NEW_LINE>if (r == NULL || r == NULL_HYPOTHETICAL) {<NEW_LINE>String displayName = NbBundle.getMessage(NPECheck.class, "ERR_DereferencingNull");<NEW_LINE>return ErrorDescriptionFactory.forName(ctx, ctx.getPath(), displayName);<NEW_LINE>}<NEW_LINE>if (r == State.POSSIBLE_NULL_REPORT || r == INSTANCE_OF_FALSE) {<NEW_LINE>String displayName = NbBundle.<MASK><NEW_LINE>return ErrorDescriptionFactory.forName(ctx, ctx.getPath(), displayName);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
getMessage(NPECheck.class, "ERR_PossiblyDereferencingNull");
459,855
public static String removeExtraSpaces(@NotNull String str) {<NEW_LINE>if (str.indexOf(' ') == -1) {<NEW_LINE>return str;<NEW_LINE>}<NEW_LINE>StringBuilder result = new StringBuilder(str.length());<NEW_LINE>int length = str.length();<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>char c = str.charAt(i);<NEW_LINE>if (Character.isWhitespace(c)) {<NEW_LINE>boolean needsSpace = i > 0 && Character.isLetterOrDigit(str<MASK><NEW_LINE>for (i = i + 1; i < length; i++) {<NEW_LINE>c = str.charAt(i);<NEW_LINE>if (Character.isWhitespace(c)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (needsSpace && Character.isLetterOrDigit(c)) {<NEW_LINE>// We need exactly one space before letter/digit<NEW_LINE>result.append(' ');<NEW_LINE>} else {<NEW_LINE>// We don't need spaces before control symbols<NEW_LINE>}<NEW_LINE>result.append(c);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>result.append(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result.toString();<NEW_LINE>}
.charAt(i - 1));
1,653,704
private void copyWindowTrl(@NonNull final AdWindowId targetWindowId, @NonNull final AdWindowId sourceWindowId) {<NEW_LINE>final String sqlDelete = "DELETE FROM AD_Window_Trl WHERE AD_Window_ID = " + targetWindowId.getRepoId();<NEW_LINE>final int countDelete = DB.executeUpdateEx(sqlDelete, ITrx.TRXNAME_ThreadInherited);<NEW_LINE><MASK><NEW_LINE>final String sqlInsert = "INSERT INTO AD_Window_Trl (AD_Window_ID, AD_Language, " + " AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, " + " Name, Description, Help, IsTranslated) " + " SELECT " + targetWindowId.getRepoId() + ", AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, " + " Updated, UpdatedBy, Name, Description, Help, IsTranslated " + " FROM AD_Window_Trl WHERE AD_Window_ID = " + sourceWindowId.getRepoId();<NEW_LINE>final int countInsert = DB.executeUpdateEx(sqlInsert, ITrx.TRXNAME_ThreadInherited);<NEW_LINE>logger.debug("AD_Window_Trl inserted: {}", countInsert);<NEW_LINE>}
logger.debug("AD_Window_Trl deleted: {}", countDelete);
1,140,515
public static void execMainClass(final Class<?> classWithMain, final String[] args) {<NEW_LINE>Method main = null;<NEW_LINE>try {<NEW_LINE>main = classWithMain.getMethod(<MASK><NEW_LINE>} catch (Exception t) {<NEW_LINE>log.error("Could not run main method on '" + classWithMain.getName() + "'.", t);<NEW_LINE>}<NEW_LINE>if (main == null || !Modifier.isPublic(main.getModifiers()) || !Modifier.isStatic(main.getModifiers())) {<NEW_LINE>System.out.println(classWithMain.getName() + " must implement a public static void main(String args[]) method");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>final Method finalMain = main;<NEW_LINE>Runnable r = () -> {<NEW_LINE>try {<NEW_LINE>finalMain.invoke(null, (Object) args);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>if (e.getCause() != null) {<NEW_LINE>die(e.getCause());<NEW_LINE>} else {<NEW_LINE>// Should never happen, but check anyway.<NEW_LINE>die(e);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>die(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>startThread(r, classWithMain.getName());<NEW_LINE>}
"main", args.getClass());
1,637,269
public static void main(String[] args) {<NEW_LINE>try {<NEW_LINE>final CanalKafkaClientExample kafkaCanalClientExample = new CanalKafkaClientExample(AbstractKafkaTest.zkServers, AbstractKafkaTest.servers, AbstractKafkaTest.topic, AbstractKafkaTest.partition, AbstractKafkaTest.groupId);<NEW_LINE>logger.info("## start the kafka consumer: {}-{}", AbstractKafkaTest.topic, AbstractKafkaTest.groupId);<NEW_LINE>kafkaCanalClientExample.start();<NEW_LINE>logger.info("## the canal kafka consumer is running now ......");<NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread(() -> {<NEW_LINE>try {<NEW_LINE>logger.info("## stop the kafka consumer");<NEW_LINE>kafkaCanalClientExample.stop();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.warn("##something goes wrong when stopping kafka consumer:", e);<NEW_LINE>} finally {<NEW_LINE>logger.info("## kafka consumer is down.");<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>while (running) ;<NEW_LINE>} catch (Throwable e) {<NEW_LINE><MASK><NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>}
logger.error("## Something goes wrong when starting up the kafka consumer:", e);
556,695
protected byte[] serializeRecords(List<IndexedRecord> records) throws IOException {<NEW_LINE>HFileContext context = new HFileContextBuilder().withBlockSize(DEFAULT_BLOCK_SIZE).withCompression(compressionAlgorithm.get()).withCellComparator(new HoodieHBaseKVComparator()).build();<NEW_LINE>Configuration conf = new Configuration();<NEW_LINE>CacheConfig cacheConfig = new CacheConfig(conf);<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>FSDataOutputStream ostream = new FSDataOutputStream(baos, null);<NEW_LINE>// Use simple incrementing counter as a key<NEW_LINE>boolean useIntegerKey = !getRecordKey(records.get(0)).isPresent();<NEW_LINE>// This is set here to avoid re-computing this in the loop<NEW_LINE>int keyWidth = useIntegerKey ? (int) Math.ceil(Math.log(records.size())) + 1 : -1;<NEW_LINE>// Serialize records into bytes<NEW_LINE>Map<String, byte[]> sortedRecordsMap = new TreeMap<>();<NEW_LINE>Iterator<IndexedRecord> itr = records.iterator();<NEW_LINE>int id = 0;<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>IndexedRecord record = itr.next();<NEW_LINE>String recordKey;<NEW_LINE>if (useIntegerKey) {<NEW_LINE>recordKey = String.format("%" + keyWidth + "s", id++);<NEW_LINE>} else {<NEW_LINE>recordKey = getRecordKey(record).get();<NEW_LINE>}<NEW_LINE>final byte[] recordBytes = serializeRecord(record);<NEW_LINE>ValidationUtils.checkState(!sortedRecordsMap.containsKey(recordKey), "Writing multiple records with same key not supported for " + this.getClass().getName());<NEW_LINE>sortedRecordsMap.put(recordKey, recordBytes);<NEW_LINE>}<NEW_LINE>HFile.Writer writer = HFile.getWriterFactory(conf, cacheConfig).withOutputStream(ostream).withFileContext(context).create();<NEW_LINE>// Write the records<NEW_LINE>sortedRecordsMap.forEach((recordKey, recordBytes) -> {<NEW_LINE>try {<NEW_LINE>KeyValue kv = new KeyValue(recordKey.getBytes(<MASK><NEW_LINE>writer.append(kv);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new HoodieIOException("IOException serializing records", e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>writer.appendFileInfo(HoodieHFileReader.SCHEMA_KEY.getBytes(), getSchema().toString().getBytes());<NEW_LINE>writer.close();<NEW_LINE>ostream.flush();<NEW_LINE>ostream.close();<NEW_LINE>return baos.toByteArray();<NEW_LINE>}
), null, null, recordBytes);
330,516
public ProtocolProviderService installAccount(ProtocolProviderFactory providerFactory, String user, String passwd) throws OperationFailedException {<NEW_LINE>Hashtable<String, String> accountProperties = new Hashtable<String, String>();<NEW_LINE>accountProperties.put(ProtocolProviderFactory.ACCOUNT_ICON_PATH, "resources/images/protocol/icq/icq32x32.png");<NEW_LINE>if (registration.isRememberPassword()) {<NEW_LINE>accountProperties.put(ProtocolProviderFactory.PASSWORD, passwd);<NEW_LINE>}<NEW_LINE>if (isModification()) {<NEW_LINE><MASK><NEW_LINE>setModification(false);<NEW_LINE>return protocolProvider;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>AccountID accountID = providerFactory.installAccount(user, accountProperties);<NEW_LINE>ServiceReference serRef = providerFactory.getProviderForAccount(accountID);<NEW_LINE>protocolProvider = (ProtocolProviderService) IcqAccRegWizzActivator.bundleContext.getService(serRef);<NEW_LINE>} catch (IllegalStateException exc) {<NEW_LINE>logger.warn(exc.getMessage());<NEW_LINE>throw new OperationFailedException("Account already exists.", OperationFailedException.IDENTIFICATION_CONFLICT);<NEW_LINE>} catch (Exception exc) {<NEW_LINE>logger.warn(exc.getMessage());<NEW_LINE>throw new OperationFailedException("Failed to add account", OperationFailedException.GENERAL_ERROR);<NEW_LINE>}<NEW_LINE>return protocolProvider;<NEW_LINE>}
providerFactory.modifyAccount(protocolProvider, accountProperties);
667,933
public Mono<Response<Void>> updateWithResponseAsync(String objectId, String tenantId, ServicePrincipalUpdateParameters parameters) {<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 (objectId == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter objectId is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (tenantId == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json, text/json";<NEW_LINE>return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), objectId, this.client.getApiVersion(), tenantId, parameters, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter tenantId is required and cannot be null."));
498,646
private static FuseMountOptions parseOptions(String[] args, AlluxioConfiguration alluxioConf) {<NEW_LINE>final CommandLineParser parser = new DefaultParser();<NEW_LINE>try {<NEW_LINE>CommandLine cli = parser.parse(OPTIONS, args);<NEW_LINE>if (cli.hasOption("h")) {<NEW_LINE>final HelpFormatter fmt = new HelpFormatter();<NEW_LINE>fmt.printHelp(AlluxioFuse.class.getName(), OPTIONS);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String mntPointValue = cli.getOptionValue("m");<NEW_LINE>String alluxioRootValue = cli.getOptionValue("r");<NEW_LINE>List<String> fuseOpts = parseFuseOptions(cli.hasOption("o") ? Arrays.asList(cli.getOptionValues("o")) : <MASK><NEW_LINE>final boolean fuseDebug = alluxioConf.getBoolean(PropertyKey.FUSE_DEBUG_ENABLED);<NEW_LINE>return new FuseMountOptions(mntPointValue, alluxioRootValue, fuseDebug, fuseOpts);<NEW_LINE>} catch (ParseException e) {<NEW_LINE>System.err.println("Error while parsing CLI: " + e.getMessage());<NEW_LINE>final HelpFormatter fmt = new HelpFormatter();<NEW_LINE>fmt.printHelp(AlluxioFuse.class.getName(), OPTIONS);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
ImmutableList.of(), alluxioConf);
637,048
protected String[] searchOnvifDevices() {<NEW_LINE>String localIP = null;<NEW_LINE>String[] list = null;<NEW_LINE>Enumeration<NetworkInterface> interfaces = null;<NEW_LINE>try {<NEW_LINE>interfaces = NetworkInterface.getNetworkInterfaces();<NEW_LINE>} catch (SocketException e) {<NEW_LINE>// handle error<NEW_LINE>}<NEW_LINE>if (interfaces != null) {<NEW_LINE>while (interfaces.hasMoreElements()) {<NEW_LINE>NetworkInterface i = interfaces.nextElement();<NEW_LINE>Enumeration<InetAddress> addresses = i.getInetAddresses();<NEW_LINE>while (addresses.hasMoreElements() && (localIP == null || localIP.isEmpty())) {<NEW_LINE>InetAddress address = addresses.nextElement();<NEW_LINE>if (!address.isLoopbackAddress() && address.isSiteLocalAddress()) {<NEW_LINE>localIP = address.getHostAddress();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (localIP != null) {<NEW_LINE>String[] ipAddrParts = localIP.split("\\.");<NEW_LINE>String ipAd = ipAddrParts[0] + "." + ipAddrParts[1] + "." + ipAddrParts[2] + ".";<NEW_LINE>ArrayList<String> addressList = new ArrayList<>();<NEW_LINE>for (int i = 2; i < 255; i++) {<NEW_LINE>addressList.add(ipAd + i);<NEW_LINE>}<NEW_LINE>List<URL> onvifDevices = OnvifDiscovery.discoverOnvifDevices(true, addressList);<NEW_LINE>list = getIPArray(onvifDevices);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
logger.info("IP Address: {} ", localIP);
1,725,518
static void c_6() throws Exception {<NEW_LINE>AkSourceBatchOp train_data = new AkSourceBatchOp().setFilePath(DATA_DIR + TRAIN_FILE);<NEW_LINE>AkSourceBatchOp test_data = new AkSourceBatchOp().setFilePath(DATA_DIR + TEST_FILE);<NEW_LINE>LinearSvmTrainBatchOp svmTrainer = new LinearSvmTrainBatchOp().setFeatureCols(FEATURE_COL_NAMES).setLabelCol(LABEL_COL_NAME);<NEW_LINE>LinearSvmPredictBatchOp svmPredictor = new LinearSvmPredictBatchOp().setPredictionCol(PREDICTION_COL_NAME).setPredictionDetailCol(PRED_DETAIL_COL_NAME);<NEW_LINE>train_data.link(svmTrainer);<NEW_LINE>svmPredictor.linkFrom(svmTrainer, test_data);<NEW_LINE>svmTrainer<MASK><NEW_LINE>svmPredictor.lazyPrint(5, "< Prediction >").link(new AkSinkBatchOp().setFilePath(DATA_DIR + SVM_PRED_FILE).setOverwriteSink(true));<NEW_LINE>BatchOperator.execute();<NEW_LINE>}
.lazyPrintTrainInfo().lazyPrintModelInfo();
1,567,889
private void openAsImage(Blob b) {<NEW_LINE>if (b == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ImageInputStream iis = ImageIO.createImageInputStream(b.getBinaryStream());<NEW_LINE>Iterator<ImageReader> irs = ImageIO.getImageReaders(iis);<NEW_LINE>if (irs.hasNext()) {<NEW_LINE>FileSystem fs = FileUtil.createMemoryFileSystem();<NEW_LINE>FileObject fob = fs.getRoot().createData(Long.toString(System.currentTimeMillis()), irs.next().getFormatName());<NEW_LINE>OutputStream os = fob.getOutputStream();<NEW_LINE>os.write(b.getBytes(1, (int) b.length()));<NEW_LINE>os.close();<NEW_LINE>DataObject <MASK><NEW_LINE>OpenCookie cookie = data.getLookup().lookup(OpenCookie.class);<NEW_LINE>if (cookie != null) {<NEW_LINE>cookie.open();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>displayErrorOpenImage("openImageErrorNotImage.message");<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.INFO, // NOI18N<NEW_LINE>"SQLException while opening BLOB as file", ex);<NEW_LINE>// NOI18N<NEW_LINE>displayErrorOpenImage("openImageErrorDB.message");<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>LOG.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.INFO, "IOError while opening BLOB as file", ex);<NEW_LINE>}<NEW_LINE>}
data = DataObject.find(fob);
1,319,316
private void loadOneRegistry(MergedEntityRegistry parentRegistry, String registryName, String registryVersionStr, String patchDirectory) {<NEW_LINE>ComparableVersion registryVersion = new ComparableVersion("0.0.0-dev");<NEW_LINE>try {<NEW_LINE>ComparableVersion maybeVersion = new ComparableVersion(registryVersionStr);<NEW_LINE>log.debug("{}: Found registry version {}", this, maybeVersion);<NEW_LINE>registryVersion = maybeVersion;<NEW_LINE>} catch (IllegalArgumentException ie) {<NEW_LINE>log.warn("Found un-parseable registry version {}, will default to {}", registryVersionStr, registryVersion);<NEW_LINE>}<NEW_LINE>if (registryExists(registryName, registryVersion)) {<NEW_LINE>log.<MASK><NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>log.info("{}: Registry {}:{} discovered. Loading...", this, registryName, registryVersion);<NEW_LINE>}<NEW_LINE>EntityRegistryLoadResult.EntityRegistryLoadResultBuilder loadResultBuilder = EntityRegistryLoadResult.builder().registryLocation(patchDirectory);<NEW_LINE>EntityRegistry entityRegistry = null;<NEW_LINE>try {<NEW_LINE>entityRegistry = new PatchEntityRegistry(patchDirectory, registryName, registryVersion);<NEW_LINE>parentRegistry.apply(entityRegistry);<NEW_LINE>loadResultBuilder.loadResult(LoadStatus.SUCCESS);<NEW_LINE>log.info("Loaded registry {} successfully", entityRegistry);<NEW_LINE>} catch (RuntimeException | EntityRegistryException | IOException e) {<NEW_LINE>log.debug("{}: Failed to load registry {} with {}", this, registryName, e.getMessage());<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>PrintWriter pw = new PrintWriter(sw);<NEW_LINE>e.printStackTrace(pw);<NEW_LINE>loadResultBuilder.loadResult(LoadStatus.FAILURE).failureReason(sw.toString()).failureCount(1);<NEW_LINE>}<NEW_LINE>addLoadResult(registryName, registryVersion, loadResultBuilder.build(), entityRegistry);<NEW_LINE>}
debug("Registry {}:{} already exists. Skipping loading...", registryName, registryVersion);
1,837,464
protected void onFinishInflate() {<NEW_LINE>super.onFinishInflate();<NEW_LINE>mButtonContainer = findViewById(R.id.button_container);<NEW_LINE>mButtonContainer.setBackground(mButtonBackground);<NEW_LINE>mNameView = mButtonContainer.findViewById(R.id.name);<NEW_LINE>mNameView.setTextColor(mButtonTextColor);<NEW_LINE>mPriceView = mButtonContainer.<MASK><NEW_LINE>mPriceView.setTextColor(mButtonTextColor);<NEW_LINE>mProgressBar = mButtonContainer.findViewById(R.id.progress);<NEW_LINE>setProgressBarColor();<NEW_LINE>mSaleView = findViewById(R.id.sale);<NEW_LINE>if (mShowSale) {<NEW_LINE>UiUtils.show(mSaleView);<NEW_LINE>mSaleView.setBackground(mSaleBackground);<NEW_LINE>mSaleView.setTextColor(mSaleTextColor);<NEW_LINE>} else {<NEW_LINE>UiUtils.hide(mSaleView);<NEW_LINE>MarginLayoutParams params = (MarginLayoutParams) mButtonContainer.getLayoutParams();<NEW_LINE>params.topMargin = 0;<NEW_LINE>}<NEW_LINE>}
findViewById(R.id.price);
1,258,908
public static File replaceTokensInScript(final String script, final Map<String, Map<String, String>> dataContext, final Framework framework, final ScriptfileUtils.LineEndingStyle style, final File destination) throws IOException {<NEW_LINE>if (null == script) {<NEW_LINE>throw new NullPointerException("script cannot be null");<NEW_LINE>}<NEW_LINE>// use ReplaceTokens to replace tokens within the content<NEW_LINE>final Reader read = new StringReader(script);<NEW_LINE>final Map<String, String> toks = flattenDataContext(dataContext);<NEW_LINE>final ReplaceTokenReader replaceTokens = new ReplaceTokenReader(read, toks::get, true, '@', '@');<NEW_LINE>final File temp;<NEW_LINE>if (null != destination) {<NEW_LINE>ScriptfileUtils.writeScriptFile(null, <MASK><NEW_LINE>temp = destination;<NEW_LINE>} else {<NEW_LINE>if (null == framework) {<NEW_LINE>throw new NullPointerException("framework cannot be null");<NEW_LINE>}<NEW_LINE>temp = ScriptfileUtils.writeScriptTempfile(framework, replaceTokens, style);<NEW_LINE>}<NEW_LINE>ScriptfileUtils.setExecutePermissions(temp);<NEW_LINE>return temp;<NEW_LINE>}
null, replaceTokens, style, destination);
229,275
public List<SecurityGroup> describeSecurityGroups(String... groupNames) {<NEW_LINE>AmazonEC2 ec2Client = ec2Client();<NEW_LINE>DescribeSecurityGroupsRequest request = new DescribeSecurityGroupsRequest();<NEW_LINE>if (groupNames == null || groupNames.length == 0) {<NEW_LINE>LOGGER.info(String.format("Getting all EC2 security groups in region %s.", region));<NEW_LINE>} else {<NEW_LINE>LOGGER.info(String.format("Getting EC2 security groups for %d names in region %s."<MASK><NEW_LINE>request.withGroupNames(groupNames);<NEW_LINE>}<NEW_LINE>DescribeSecurityGroupsResult result;<NEW_LINE>try {<NEW_LINE>result = ec2Client.describeSecurityGroups(request);<NEW_LINE>} catch (AmazonServiceException e) {<NEW_LINE>if (e.getErrorCode().equals("InvalidGroup.NotFound")) {<NEW_LINE>LOGGER.info("Got InvalidGroup.NotFound error for security groups; returning empty list");<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>List<SecurityGroup> securityGroups = result.getSecurityGroups();<NEW_LINE>LOGGER.info(String.format("Got %d EC2 security groups in region %s.", securityGroups.size(), region));<NEW_LINE>return securityGroups;<NEW_LINE>}
, groupNames.length, region));
1,467,170
public static void drawArrowSubPixel(Quadrilateral_F64 quad, double strokeSize, double scale, Graphics2D g2) {<NEW_LINE>Line2D.Double line = new Line2D.Double();<NEW_LINE>Color[] colors = new Color[] { Color.RED, Color.ORANGE, Color.CYAN, Color.BLUE };<NEW_LINE>Point2D_F64 start = new Point2D_F64();<NEW_LINE>Point2D_F64 end = new Point2D_F64();<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>int j = (i + 1) % 4;<NEW_LINE>Point2D_F64 a = quad.get(i);<NEW_LINE>Point2D_F64 b = quad.get(j);<NEW_LINE>double length = a.distance(b);<NEW_LINE>double dx = (b.x - a.x) / length;<NEW_LINE>double dy = (b.y - a.y) / length;<NEW_LINE>start.x = a.x * scale;<NEW_LINE>start.y = a.y * scale;<NEW_LINE>end.x = (length * scale - strokeSize * 2) * dx + start.x;<NEW_LINE>end.y = (length * scale - strokeSize * 2) * dy + start.y;<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.setStroke(new BasicStroke(<MASK><NEW_LINE>drawArrowSubPixel(start, end, line, g2);<NEW_LINE>g2.setColor(colors[i]);<NEW_LINE>g2.setStroke(new BasicStroke((float) strokeSize));<NEW_LINE>drawArrowSubPixel(start, end, line, g2);<NEW_LINE>}<NEW_LINE>}
(float) strokeSize * 2.0f));
1,637,630
private void accessEntries(Resource root, Multimap<String, Node> map, String user, List<Node> _graphs) {<NEW_LINE>// Convert string names for graphs to URIs.<NEW_LINE>Set<Node> graphs = _graphs.stream().map(n -> graphLabel(n, root)).collect(Collectors.toSet());<NEW_LINE>if (graphs.contains(SecurityContext.allGraphs)) {<NEW_LINE>map.removeAll(user);<NEW_LINE>map.put(user, SecurityContext.allGraphs);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (graphs.contains(SecurityContext.allNamedGraphs)) {<NEW_LINE>boolean dft = dftPresent(graphs);<NEW_LINE>Node x = SecurityContext.allNamedGraphs;<NEW_LINE>if (dft)<NEW_LINE>// Put in "*" instead.<NEW_LINE>x = SecurityContext.allGraphs;<NEW_LINE>map.removeAll(user);<NEW_LINE>map.put(user, x);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (SKIP_ALLGRAPH) {<NEW_LINE>if (graphs.contains(SecurityContext.allGraphs)) {<NEW_LINE>Log.warn(this, "Graph name '" + SecurityContext.allGraphsStr + "' not supported yet");<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (graphs.contains(SecurityContext.allNamedGraphs)) {<NEW_LINE>Log.warn(this, "Graph name '" + SecurityContext.allNamedGraphsStr + "' not supported yet");<NEW_LINE>graphs.remove(SecurityContext.allNamedGraphs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>map.putAll(user, graphs);<NEW_LINE>}
graphs.remove(SecurityContext.allGraphs);
342,224
protected boolean processPluginStream(SFPluginDetailsImpl details, InputStream is) {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>try {<NEW_LINE>properties.load(is);<NEW_LINE>String pid = details.getId();<NEW_LINE>String download_url = properties.getProperty(pid + ".dl_link", "");<NEW_LINE>if (download_url.length() == 0) {<NEW_LINE>download_url = "<unknown>";<NEW_LINE>} else if (!download_url.startsWith("http")) {<NEW_LINE>download_url = site_prefix + download_url;<NEW_LINE>}<NEW_LINE>String author = properties.getProperty(pid + ".author", "");<NEW_LINE>String desc = properties.getProperty(pid + ".description", "");<NEW_LINE>String cvs_download_url = properties.getProperty(pid + ".dl_link_cvs", null);<NEW_LINE>if (cvs_download_url == null || cvs_download_url.length() == 0) {<NEW_LINE>cvs_download_url = download_url;<NEW_LINE>} else if (!download_url.startsWith("http")) {<NEW_LINE>cvs_download_url = site_prefix + cvs_download_url;<NEW_LINE>}<NEW_LINE>String comment = properties.getProperty(pid + ".comment", "");<NEW_LINE>// I don't think this one is ever set (not even in the old html scraping code)<NEW_LINE>String info_url = properties.getProperty(pid + ".info_url", null);<NEW_LINE>details.setDetails(download_url, author, <MASK><NEW_LINE>return true;<NEW_LINE>} catch (IOException e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
cvs_download_url, desc, comment, info_url);
1,578,507
public void doMentionToSpeaker(Annotation doc) {<NEW_LINE>List<CoreMap> quotes = doc.get(CoreAnnotations.QuotationsAnnotation.class);<NEW_LINE>List<List<Pair<Integer, Integer>>> skipChains = new ArrayList<>();<NEW_LINE>// Pairs are (pred_idx, paragraph_idx)<NEW_LINE>List<Pair<Integer, Integer>> <MASK><NEW_LINE>for (int quote_idx = 0; quote_idx < quotes.size(); quote_idx++) {<NEW_LINE>CoreMap quote = quotes.get(quote_idx);<NEW_LINE>if (quote.get(QuoteAttributionAnnotator.SpeakerAnnotation.class) != null) {<NEW_LINE>int para_idx = getQuoteParagraph(quote);<NEW_LINE>if (currChain.size() != 0) {<NEW_LINE>if (currChain.get(currChain.size() - 1).second != para_idx - 2) {<NEW_LINE>skipChains.add(currChain);<NEW_LINE>currChain = new ArrayList<>();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>currChain.add(new Pair<>(quote_idx, para_idx));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currChain.size() != 0) {<NEW_LINE>skipChains.add(currChain);<NEW_LINE>}<NEW_LINE>for (List<Pair<Integer, Integer>> skipChain : skipChains) {<NEW_LINE>Pair<Integer, Integer> firstPair = skipChain.get(0);<NEW_LINE>int firstParagraph = firstPair.second;<NEW_LINE>// look for conversational chain candidate<NEW_LINE>for (int prev_idx = firstPair.first - 1; prev_idx >= 0; prev_idx--) {<NEW_LINE>CoreMap quote = quotes.get(prev_idx + 1);<NEW_LINE>CoreMap prevQuote = quotes.get(prev_idx);<NEW_LINE>if (getQuoteParagraph(prevQuote) == firstParagraph - 2) {<NEW_LINE>quote.set(QuoteAttributionAnnotator.SpeakerAnnotation.class, prevQuote.get(QuoteAttributionAnnotator.SpeakerAnnotation.class));<NEW_LINE>quote.set(QuoteAttributionAnnotator.SpeakerSieveAnnotation.class, "Loose Conversational Speaker");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
currChain = new ArrayList<>();
1,709,476
private void checkConsumedAndProducedValues(Instruction ins, ValueNumber[] consumedValueList, ValueNumber[] producedValueList) {<NEW_LINE>int numConsumed = ins.consumeStack(getCPG());<NEW_LINE>int numProduced = ins.produceStack(getCPG());<NEW_LINE>if (numConsumed == Const.UNPREDICTABLE) {<NEW_LINE>throw new InvalidBytecodeException("Unpredictable stack consumption for " + ins);<NEW_LINE>}<NEW_LINE>if (numProduced == Const.UNPREDICTABLE) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (consumedValueList.length != numConsumed) {<NEW_LINE>throw new IllegalStateException("Wrong number of values consumed for " + ins + ": expected " + numConsumed + ", got " + consumedValueList.length);<NEW_LINE>}<NEW_LINE>if (producedValueList.length != numProduced) {<NEW_LINE>throw new IllegalStateException("Wrong number of values produced for " + ins + ": expected " + numProduced + ", got " + producedValueList.length);<NEW_LINE>}<NEW_LINE>}
throw new InvalidBytecodeException("Unpredictable stack production for " + ins);
173,362
public static void disconnect() {<NEW_LINE>// Close UPnP port mapping if used<NEW_LINE>StartServerDialogPreferences serverProps = new StartServerDialogPreferences();<NEW_LINE>if (serverProps.getUseUPnP()) {<NEW_LINE>int port = serverProps.getPort();<NEW_LINE>UPnPUtil.closePort(port);<NEW_LINE>}<NEW_LINE>boolean isPersonalServer = isPersonalServer();<NEW_LINE>if (announcer != null) {<NEW_LINE>announcer.stop();<NEW_LINE>announcer = null;<NEW_LINE>}<NEW_LINE>// Unregister ourselves<NEW_LINE>if (server != null && server.getConfig().isServerRegistered() && !isPersonalServer) {<NEW_LINE>try {<NEW_LINE>MapToolRegistry<MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>MapTool.showError("While unregistering server instance", t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (conn != null && conn.isAlive()) {<NEW_LINE>conn.close();<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>// This isn't critical, we're closing it anyway<NEW_LINE>log.debug("While closing connection", ioe);<NEW_LINE>}<NEW_LINE>playerList.clear();<NEW_LINE>MapTool.getFrame().getConnectionStatusPanel().setStatus(ConnectionStatusPanel.Status.disconnected);<NEW_LINE>if (!isPersonalServer) {<NEW_LINE>addLocalMessage(MessageUtil.getFormattedSystemMsg(I18N.getText("msg.info.disconnected")));<NEW_LINE>}<NEW_LINE>}
.getInstance().unregisterInstance();
309,701
public void collect(LValue lValue, ReadWrite rw) {<NEW_LINE>Class<?> lValueClass = lValue.getClass();<NEW_LINE>if (lValueClass == LocalVariable.class) {<NEW_LINE>LocalVariable localVariable = (LocalVariable) lValue;<NEW_LINE>NamedVariable name = localVariable.getName();<NEW_LINE>if (name.getStringName().equals(MiscConstants.THIS))<NEW_LINE>return;<NEW_LINE>ScopeDefinition <MASK><NEW_LINE>// If it's in scope, no problem.<NEW_LINE>if (previousDef != null)<NEW_LINE>return;<NEW_LINE>// If it's out of scope, we have a variable defined but only assigned in an inner scope, but used in the<NEW_LINE>// outer scope later.... or EARLIER. (PairTest3b)<NEW_LINE>InferredJavaType inferredJavaType = lValue.getInferredJavaType();<NEW_LINE>ScopeDefinition scopeDefinition = new ScopeDefinition(currentDepth, currentBlock, currentBlock.peek(), lValue, inferredJavaType, name);<NEW_LINE>earliestDefinition.put(name, scopeDefinition);<NEW_LINE>earliestDefinitionsByLevel.get(currentDepth).put(name, true);<NEW_LINE>discoveredCreations.add(scopeDefinition);<NEW_LINE>} else if (lValueClass == FieldVariable.class) {<NEW_LINE>lValue.collectLValueUsage(this);<NEW_LINE>}<NEW_LINE>}
previousDef = earliestDefinition.get(name);
1,463,058
public AccessPathFragment append(AccessPathFragment toAppend) {<NEW_LINE>// If only one of the two operands contains actual data, we simply take that<NEW_LINE>// object and don't need to append anything<NEW_LINE>if (toAppend == null || toAppend.isEmpty()) {<NEW_LINE>if (this.isEmpty())<NEW_LINE>return null;<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>if (this.isEmpty())<NEW_LINE>return toAppend;<NEW_LINE>String[] toAppendFields = toAppend.getFields();<NEW_LINE>String[] toAppendFieldTypes = toAppend.getFieldTypes();<NEW_LINE>String[] appendedFields = new String[fields.length + toAppendFields.length];<NEW_LINE>System.arraycopy(fields, 0, appendedFields, 0, fields.length);<NEW_LINE>System.arraycopy(toAppendFields, 0, appendedFields, fields.length, toAppendFields.length);<NEW_LINE>String[] appendedTypes = new String[fieldTypes.length + toAppendFieldTypes.length];<NEW_LINE>System.arraycopy(fieldTypes, 0, <MASK><NEW_LINE>System.arraycopy(toAppendFieldTypes, 0, appendedTypes, fieldTypes.length, toAppendFieldTypes.length);<NEW_LINE>return new AccessPathFragment(appendedFields, appendedTypes);<NEW_LINE>}
appendedTypes, 0, fieldTypes.length);
1,342,479
public static String post(String httpUrl, String content) throws Exception {<NEW_LINE>Map<String, String> headers = new HashMap<>(1);<NEW_LINE>headers.put("Content-type", "application/json");<NEW_LINE>URL url = new URL(httpUrl);<NEW_LINE>HttpURLConnection conn = (HttpURLConnection) url.openConnection();<NEW_LINE>conn.setRequestMethod("POST");<NEW_LINE>conn.setDoOutput(true);<NEW_LINE>if (null != headers && !headers.isEmpty()) {<NEW_LINE>for (Entry<String, String> entry : headers.entrySet()) {<NEW_LINE>conn.setRequestProperty(entry.getKey(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(content)) {<NEW_LINE>conn.getOutputStream().write(content.getBytes(StandardCharsets.UTF_8));<NEW_LINE>}<NEW_LINE>conn.connect();<NEW_LINE>if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {<NEW_LINE>throw new RuntimeException("request failure, status code:" + conn.getResponseCode());<NEW_LINE>}<NEW_LINE>String result = CharStreams.toString(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));<NEW_LINE>conn.disconnect();<NEW_LINE>return result;<NEW_LINE>}
), entry.getValue());
1,212,458
public SegmentIdWithShardSpec allocate(InputRow row, String sequenceName, String previousSegmentId, boolean skipSegmentLineageCheck) {<NEW_LINE>return sequenceNameToSegmentId.computeIfAbsent(sequenceName, k -> {<NEW_LINE>final Pair<Interval, BucketNumberedShardSpec> pair = Preconditions.checkNotNull(sequenceNameToBucket.get(sequenceName), "Missing bucket for sequence[%s]", sequenceName);<NEW_LINE>final Interval interval = pair.lhs;<NEW_LINE>// Determines the partitionId if this segment allocator is used by the single-threaded task.<NEW_LINE>// In parallel ingestion, the partitionId is determined in the supervisor task.<NEW_LINE>// See ParallelIndexSupervisorTask.groupGenericPartitionLocationsPerPartition().<NEW_LINE>// This code... isn't pretty, but should be simple enough to understand.<NEW_LINE>final ShardSpec shardSpec = isParallel ? pair.rhs : pair.rhs.convert(intervalToNextPartitionId.computeInt(interval, (i, nextPartitionId) -> nextPartitionId == null <MASK><NEW_LINE>final String version = versionFinder.apply(interval);<NEW_LINE>return new SegmentIdWithShardSpec(dataSource, interval, version, shardSpec);<NEW_LINE>});<NEW_LINE>}
? 0 : nextPartitionId + 1));
1,199,639
protected void fixGlobalElementNames() {<NEW_LINE>// clear unique names map<NEW_LINE>namesMap.clear();<NEW_LINE>// create buckets<NEW_LINE>HashMap<GlobalElement, java.util.List<ElementReference>> erefMap = new HashMap<GlobalElement, java.util.List<ElementReference>>();<NEW_LINE>for (Entry<Integer, java.util.List<Object>> e : fixNamesMap.entrySet()) {<NEW_LINE>java.util.List<Object> scs = e.getValue();<NEW_LINE>if (scs != null && scs.size() > 1) {<NEW_LINE>GlobalElement ge = (GlobalElement) scs.get(1);<NEW_LINE>ElementReference eref = (<MASK><NEW_LINE>java.util.List<ElementReference> erefs = erefMap.get(ge);<NEW_LINE>if (erefs == null) {<NEW_LINE>erefs = new ArrayList<ElementReference>();<NEW_LINE>erefMap.put(ge, erefs);<NEW_LINE>}<NEW_LINE>if (eref != null && !erefs.contains(eref))<NEW_LINE>erefs.add(eref);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int count = 0;<NEW_LINE>Iterator it = erefMap.keySet().iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>if (commitRange > 0 && (count++) % commitRange == 0) {<NEW_LINE>sm.endTransaction();<NEW_LINE>sm.startTransaction();<NEW_LINE>}<NEW_LINE>GlobalElement ge = (GlobalElement) it.next();<NEW_LINE>java.util.List<ElementReference> erefs = erefMap.get(ge);<NEW_LINE>String name = findUniqueGlobalName(GlobalElement.class, ge, ge.getName());<NEW_LINE>ge.setName(name);<NEW_LINE>for (ElementReference eref : erefs) eref.setRef(eref.createReferenceTo(ge, GlobalElement.class));<NEW_LINE>}<NEW_LINE>erefMap.clear();<NEW_LINE>erefMap = null;<NEW_LINE>fixNamesMap.clear();<NEW_LINE>}
ElementReference) scs.get(2);