idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,006,714 | protected void handleResult(Sentence sentence, List<RuleMatch> ruleMatches, Language language) {<NEW_LINE>if (ruleMatches.size() > 0) {<NEW_LINE>int i = 1;<NEW_LINE>System.out.println("\nTitle: " + sentence.getTitle());<NEW_LINE>for (RuleMatch match : ruleMatches) {<NEW_LINE>String output = // match.getRule().getId();<NEW_LINE>i + ".) Line " + (match.getLine() + 1) + ", column " + match.getColumn() + ", Rule ID: " + match.getSpecificRuleId();<NEW_LINE>if (match.getRule() instanceof AbstractPatternRule) {<NEW_LINE>AbstractPatternRule pRule = (AbstractPatternRule) match.getRule();<NEW_LINE>output += "[" + pRule.getSubId() + "]";<NEW_LINE>}<NEW_LINE>if (match.getRule().isDefaultTempOff()) {<NEW_LINE>output += " [temp_off]";<NEW_LINE>}<NEW_LINE>System.out.println(output);<NEW_LINE>String msg = match.getMessage();<NEW_LINE>msg = msg.replaceAll("<suggestion>", "'");<NEW_LINE>msg = <MASK><NEW_LINE>System.out.println("Message: " + msg);<NEW_LINE>List<String> replacements = match.getSuggestedReplacements();<NEW_LINE>if (!replacements.isEmpty()) {<NEW_LINE>System.out.println("Suggestion: " + String.join("; ", replacements.subList(0, Math.min(replacements.size(), 5))));<NEW_LINE>}<NEW_LINE>if (match.getRule() instanceof AbstractPatternRule) {<NEW_LINE>AbstractPatternRule pRule = (AbstractPatternRule) match.getRule();<NEW_LINE>if (pRule.getSourceFile() != null) {<NEW_LINE>System.out.println("Rule source: " + pRule.getSourceFile());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(contextTools.getPlainTextContext(match.getFromPos(), match.getToPos(), sentence.getText()));<NEW_LINE>// System.out.println(contextTools.getContext(match.getFromPos(), match.getToPos(), sentence.getText()));<NEW_LINE>i++;<NEW_LINE>checkMaxErrors(++errorCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>checkMaxSentences(++sentenceCount);<NEW_LINE>} | msg.replaceAll("</suggestion>", "'"); |
1,443,381 | public void draw(GraphicsContext ctx) {<NEW_LINE>Point c = getCenter();<NEW_LINE>double cx = c.x;<NEW_LINE>double cy = c.y;<NEW_LINE>ctx.ellipsemode(GraphicsContext.EllipseMode.CENTER);<NEW_LINE>ctx.nofill();<NEW_LINE>ctx.stroke(HANDLE_COLOR);<NEW_LINE>ctx.ellipse(cx, cy, handleLength * 2, handleLength * 2);<NEW_LINE>double[] xy;<NEW_LINE>if (dragState == DragState.NONE || dragState == DragState.HANDLE)<NEW_LINE>xy = Geometry.coordinates(cx, cy, handleLength, <MASK><NEW_LINE>else {<NEW_LINE>xy = Geometry.coordinates(cx, cy, handleLength, pa);<NEW_LINE>ctx.line(cx, cy, (float) xy[0], (float) xy[1]);<NEW_LINE>xy = Geometry.coordinates(cx, cy, handleLength, ca);<NEW_LINE>}<NEW_LINE>float x = (float) xy[0];<NEW_LINE>float y = (float) xy[1];<NEW_LINE>ctx.line(cx, cy, x, y);<NEW_LINE>ctx.fill(1);<NEW_LINE>ctx.ellipse(x, y, 6, 6);<NEW_LINE>if (dragState == DragState.HANDLE) {<NEW_LINE>xy = Geometry.coordinates(cx, cy, handleLength, oa);<NEW_LINE>ctx.line(cx, cy, (float) xy[0], (float) xy[1]);<NEW_LINE>}<NEW_LINE>} | (Double) getValue(angleName)); |
412,838 | private static boolean isNewerVersion(String latestVersion) {<NEW_LINE>int[] oldVersions = versionStringToInt(getThisJarVersion());<NEW_LINE>int<MASK><NEW_LINE>if (oldVersions.length < newVersions.length) {<NEW_LINE>System.err.println("Calculated: " + getThisJarVersion() + " < " + latestVersion);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < oldVersions.length; i++) {<NEW_LINE>if (newVersions[i] > oldVersions[i]) {<NEW_LINE>logger.debug("oldVersion " + getThisJarVersion() + " < latestVersion" + latestVersion);<NEW_LINE>return true;<NEW_LINE>} else if (newVersions[i] < oldVersions[i]) {<NEW_LINE>logger.debug("oldVersion " + getThisJarVersion() + " > latestVersion " + latestVersion);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// At this point, the version numbers are exactly the same.<NEW_LINE>// Assume any additional changes to the version text means a new version<NEW_LINE>return !(latestVersion.equals(getThisJarVersion()));<NEW_LINE>} | [] newVersions = versionStringToInt(latestVersion); |
381,848 | public TubeMQResult cloneBrokersWithTopic(CloneBrokersReq req) throws Exception {<NEW_LINE>int clusterId = req.getClusterId();<NEW_LINE>// 1. query source broker config<NEW_LINE>QueryBrokerCfgReq queryReq = QueryBrokerCfgReq.getReq(req.getSourceBrokerId());<NEW_LINE>MasterEntry masterEntry = masterRepository.findMasterEntryByClusterIdEquals(clusterId);<NEW_LINE>BrokerStatusInfo brokerStatusInfo = getBrokerStatusInfo(queryReq, masterEntry);<NEW_LINE>// 2. use source broker config to clone brokers<NEW_LINE>BrokerConf sourceBrokerConf = brokerStatusInfo.getData().get(0);<NEW_LINE>AddBrokersReq addBrokersReq = getBatchAddBrokersReq(req, clusterId, sourceBrokerConf);<NEW_LINE>// 3. request master, return broker ids generated by master<NEW_LINE>AddBrokerResult addBrokerResult = addBrokersToClusterWithId(addBrokersReq, masterEntry);<NEW_LINE>// might have duplicate brokers<NEW_LINE>if (addBrokerResult.getErrCode() != TubeConst.SUCCESS_CODE) {<NEW_LINE>return TubeMQResult.errorResult(addBrokerResult.getErrMsg());<NEW_LINE>}<NEW_LINE>List<Integer> brokerIds = getBrokerIds(addBrokerResult);<NEW_LINE>List<AddTopicReq> addTopicReqs = req.getAddTopicReqs();<NEW_LINE>// 4. add topic to brokers<NEW_LINE>return <MASK><NEW_LINE>} | addTopicsToBrokers(masterEntry, brokerIds, addTopicReqs); |
168,198 | public Map<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> superobjs) {<NEW_LINE>List<String> toRemove = new ArrayList<>();<NEW_LINE>for (Map.Entry<String, ModelsMap> modelEntry : superobjs.entrySet()) {<NEW_LINE>// process enum in models<NEW_LINE>List<ModelMap> models = modelEntry.getValue().getModels();<NEW_LINE>for (ModelMap mo : models) {<NEW_LINE>CodegenModel cm = mo.getModel();<NEW_LINE>// for enum model<NEW_LINE>if (Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) {<NEW_LINE>toRemove.add(modelEntry.getKey());<NEW_LINE>} else {<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getAllVars());<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getReadOnlyVars());<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getReadWriteVars());<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getRequiredVars());<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getOptionalVars());<NEW_LINE>enrichPropertiesWithEnumDefaultValues(cm.getVars());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String keyToRemove : toRemove) {<NEW_LINE>superobjs.remove(keyToRemove);<NEW_LINE>}<NEW_LINE>return superobjs;<NEW_LINE>} | enrichPropertiesWithEnumDefaultValues(cm.getParentVars()); |
1,815,390 | /* Build call for throttlingPoliciesAdvancedPolicyIdDelete */<NEW_LINE>private com.squareup.okhttp.Call throttlingPoliciesAdvancedPolicyIdDeleteCall(String policyId, String ifMatch, String ifUnmodifiedSince, 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 = "/throttling/policies/advanced/{policyId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "policyId" + "\\}", apiClient.escapeString(policyId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (ifMatch != null)<NEW_LINE>localVarHeaderParams.put("If-Match", apiClient.parameterToString(ifMatch));<NEW_LINE>if (ifUnmodifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Unmodified-Since", apiClient.parameterToString(ifUnmodifiedSince));<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><MASK><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, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>} | localVarHeaderParams.put("Accept", localVarAccept); |
339,791 | public boolean handleChange(final ChangeEvent event) {<NEW_LINE>if (event.getState() == State.DELETED) {<NEW_LINE>UIHelper.runUISync(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final Model model = event.getModel();<NEW_LINE>// getViewer().remove(...) internally (see<NEW_LINE>// org.eclipse.jface.viewers.StructuredViewer.findItems(Object)) tries to find<NEW_LINE>// the TreeItem corresponding to Spec (not TLCSpec). TLCSpec just wraps Spec but<NEW_LINE>// does not exist in the SpecExplorers content tree. With TLCSpec setSelection<NEW_LINE>// and remove are actually (silent) no-ops.<NEW_LINE>final Spec parent = model.getSpec().toSpec();<NEW_LINE>// The CommonViewer is stupid in that it accesses an element (model) even<NEW_LINE>// after it has been removed in order to update the viewer's current selection.<NEW_LINE>// Since we have to prevent this access to avoid a null pointer, we explicitly<NEW_LINE>// reset the selection.<NEW_LINE>getViewer().setSelection(new StructuredSelection(parent));<NEW_LINE>// ...still remove the element from the tree.<NEW_LINE>getViewer().remove(parent, new Object[] { model });<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else if (event.getState() == State.REMOTE_NOT_RUNNING) {<NEW_LINE>UIHelper.runUISync(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>getViewer().refresh(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | event.getModel(), true); |
843,238 | public boolean verifySignature(byte[] message, byte[] signature) {<NEW_LINE>// # Input: Message M, signature SIG, public key PK<NEW_LINE>// # Output: Boolean<NEW_LINE>// init<NEW_LINE>SPHINCSPlusEngine engine = pubKey.getParameters().getEngine();<NEW_LINE>ADRS adrs = new ADRS();<NEW_LINE>SIG sig = new SIG(engine.N, engine.K, engine.A, engine.D, engine.H_PRIME, engine.WOTS_LEN, signature);<NEW_LINE>byte[] R = sig.getR();<NEW_LINE>SIG_FORS[] sig_fors = sig.getSIG_FORS();<NEW_LINE>SIG_XMSS[<MASK><NEW_LINE>// compute message digest and index<NEW_LINE>IndexedDigest idxDigest = engine.H_msg(R, pubKey.getSeed(), pubKey.getRoot(), message);<NEW_LINE>byte[] mHash = idxDigest.digest;<NEW_LINE>long idx_tree = idxDigest.idx_tree;<NEW_LINE>int idx_leaf = idxDigest.idx_leaf;<NEW_LINE>// compute FORS public key<NEW_LINE>adrs.setLayerAddress(0);<NEW_LINE>adrs.setTreeAddress(idx_tree);<NEW_LINE>adrs.setType(ADRS.FORS_TREE);<NEW_LINE>adrs.setKeyPairAddress(idx_leaf);<NEW_LINE>byte[] PK_FORS = new Fors(engine).pkFromSig(sig_fors, mHash, pubKey.getSeed(), adrs);<NEW_LINE>// verify HT signature<NEW_LINE>adrs.setType(ADRS.TREE);<NEW_LINE>HT ht = new HT(engine, null, pubKey.getSeed());<NEW_LINE>return ht.verify(PK_FORS, SIG_HT, pubKey.getSeed(), idx_tree, idx_leaf, pubKey.getRoot());<NEW_LINE>} | ] SIG_HT = sig.getSIG_HT(); |
1,362,198 | public SearchTablesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SearchTablesResult searchTablesResult = new SearchTablesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return searchTablesResult;<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("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>searchTablesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TableList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>searchTablesResult.setTableList(new ListUnmarshaller<Table>(TableJsonUnmarshaller.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 searchTablesResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
121,408 | public static TransportStop findBestTransportStopForAmenity(OsmandApplication app, Amenity amenity) {<NEW_LINE>TransportStopAggregated stopAggregated;<NEW_LINE>boolean isSubwayEntrance = amenity.<MASK><NEW_LINE>LatLon loc = amenity.getLocation();<NEW_LINE>int radiusMeters = isSubwayEntrance ? SHOW_SUBWAY_STOPS_FROM_ENTRANCES_RADIUS_METERS : SHOW_STOPS_RADIUS_METERS;<NEW_LINE>List<TransportStop> transportStops = findTransportStopsAt(app, loc.getLatitude(), loc.getLongitude(), radiusMeters);<NEW_LINE>if (transportStops == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>sortTransportStops(loc, transportStops);<NEW_LINE>if (isSubwayEntrance) {<NEW_LINE>stopAggregated = processTransportStopsForAmenity(transportStops, amenity);<NEW_LINE>} else {<NEW_LINE>stopAggregated = new TransportStopAggregated();<NEW_LINE>stopAggregated.setAmenity(amenity);<NEW_LINE>TransportStop nearestStop = null;<NEW_LINE>String amenityName = amenity.getName().toLowerCase();<NEW_LINE>for (TransportStop stop : transportStops) {<NEW_LINE>stop.setTransportStopAggregated(stopAggregated);<NEW_LINE>String stopName = stop.getName().toLowerCase();<NEW_LINE>if (((stopName.contains(amenityName) || amenityName.contains(stopName)) && (nearestStop == null || nearestStop.getLocation().equals(stop.getLocation()))) || stop.getLocation().equals(loc)) {<NEW_LINE>stopAggregated.addLocalTransportStop(stop);<NEW_LINE>if (nearestStop == null) {<NEW_LINE>nearestStop = stop;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>stopAggregated.addNearbyTransportStop(stop);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<TransportStop> localStops = stopAggregated.getLocalTransportStops();<NEW_LINE>List<TransportStop> nearbyStops = stopAggregated.getNearbyTransportStops();<NEW_LINE>if (!localStops.isEmpty()) {<NEW_LINE>return localStops.get(0);<NEW_LINE>} else if (!nearbyStops.isEmpty()) {<NEW_LINE>return nearbyStops.get(0);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | getSubType().equals("subway_entrance"); |
1,635,197 | final CreateMeshResult executeCreateMesh(CreateMeshRequest createMeshRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createMeshRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateMeshRequest> request = null;<NEW_LINE>Response<CreateMeshResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateMeshRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createMeshRequest));<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, "App Mesh");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateMesh");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateMeshResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateMeshResultJsonUnmarshaller());<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,706,508 | public static ClientCompactionTaskQueryTuningConfig from(@Nullable UserCompactionTaskQueryTuningConfig userCompactionTaskQueryTuningConfig, @Nullable Integer maxRowsPerSegment) {<NEW_LINE>if (userCompactionTaskQueryTuningConfig == null) {<NEW_LINE>return new ClientCompactionTaskQueryTuningConfig(maxRowsPerSegment, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);<NEW_LINE>} else {<NEW_LINE>return new ClientCompactionTaskQueryTuningConfig(maxRowsPerSegment, userCompactionTaskQueryTuningConfig.getMaxRowsInMemory(), userCompactionTaskQueryTuningConfig.getMaxBytesInMemory(), userCompactionTaskQueryTuningConfig.getMaxTotalRows(), userCompactionTaskQueryTuningConfig.getSplitHintSpec(), userCompactionTaskQueryTuningConfig.getPartitionsSpec(), userCompactionTaskQueryTuningConfig.getIndexSpec(), userCompactionTaskQueryTuningConfig.getIndexSpecForIntermediatePersists(), userCompactionTaskQueryTuningConfig.getMaxPendingPersists(), userCompactionTaskQueryTuningConfig.getPushTimeout(), userCompactionTaskQueryTuningConfig.getSegmentWriteOutMediumFactory(), userCompactionTaskQueryTuningConfig.getMaxNumConcurrentSubTasks(), userCompactionTaskQueryTuningConfig.getMaxRetry(), userCompactionTaskQueryTuningConfig.getTaskStatusCheckPeriodMs(), userCompactionTaskQueryTuningConfig.getChatHandlerTimeout(), userCompactionTaskQueryTuningConfig.getChatHandlerNumRetries(), userCompactionTaskQueryTuningConfig.getMaxNumSegmentsToMerge(<MASK><NEW_LINE>}<NEW_LINE>} | ), userCompactionTaskQueryTuningConfig.getTotalNumMergeTasks()); |
105,175 | private void emitVectorLoad(AMD64MacroAssembler asm, Register dst, Register src, Register index, int displacement, Scale scale, AVXSize size) {<NEW_LINE>AMD64Address address = new AMD64Address(src, index, scale, displacement);<NEW_LINE>if (scale.value < maxScale.value) {<NEW_LINE>if (size == AVXSize.YMM) {<NEW_LINE>AMD64MacroAssembler.loadAndExtendAVX(asm, size, extendMode, dst, maxScale, address, scale);<NEW_LINE>} else {<NEW_LINE>AMD64MacroAssembler.loadAndExtendSSE(asm, extendMode, dst, maxScale, address, scale);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (size == AVXSize.YMM) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>asm.movdqu(dst, address);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | asm.vmovdqu(dst, address); |
939,882 | private void bumpPushNotificationsAnalytics(Stat stat, Bundle noteBundle, Map<String, Object> properties) {<NEW_LINE>// Bump Analytics for PNs if "Show notifications" setting is checked (default). Skip otherwise.<NEW_LINE>if (!NotificationsUtils.isNotificationsEnabled(WordPress.getContext())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (properties == null) {<NEW_LINE>properties = new HashMap<>();<NEW_LINE>}<NEW_LINE>String notificationID = noteBundle.getString(PUSH_ARG_NOTE_ID, "");<NEW_LINE>if (!TextUtils.isEmpty(notificationID)) {<NEW_LINE>for (String currentPropertyToCopy : PROPERTIES_TO_COPY_INTO_ANALYTICS) {<NEW_LINE>if (noteBundle.containsKey(currentPropertyToCopy)) {<NEW_LINE>properties.put("push_notification_" + currentPropertyToCopy, noteBundle.get(currentPropertyToCopy));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(WordPress.getContext());<NEW_LINE>String lastRegisteredGCMToken = preferences.<MASK><NEW_LINE>properties.put("push_notification_token", lastRegisteredGCMToken);<NEW_LINE>AnalyticsTracker.track(stat, properties);<NEW_LINE>}<NEW_LINE>} | getString(NotificationsUtils.WPCOM_PUSH_DEVICE_TOKEN, null); |
1,263,452 | public ListLayersResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListLayersResult listLayersResult = new ListLayersResult();<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 listLayersResult;<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("NextMarker", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listLayersResult.setNextMarker(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Layers", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listLayersResult.setLayers(new ListUnmarshaller<LayersListItem>(LayersListItemJsonUnmarshaller.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 listLayersResult;<NEW_LINE>} | class).unmarshall(context)); |
1,740,190 | final ListChannelsResult executeListChannels(ListChannelsRequest listChannelsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listChannelsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListChannelsRequest> request = null;<NEW_LINE>Response<ListChannelsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListChannelsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listChannelsRequest));<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, "MediaTailor");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListChannels");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListChannelsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListChannelsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
945,612 | final ListPendingInvitationResourcesResult executeListPendingInvitationResources(ListPendingInvitationResourcesRequest listPendingInvitationResourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPendingInvitationResourcesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPendingInvitationResourcesRequest> request = null;<NEW_LINE>Response<ListPendingInvitationResourcesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPendingInvitationResourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPendingInvitationResourcesRequest));<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, "RAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPendingInvitationResources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPendingInvitationResourcesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new ListPendingInvitationResourcesResultJsonUnmarshaller()); |
476,277 | public void autocompleteAddress(Address address) {<NEW_LINE>String zip = address.getZip();<NEW_LINE>if (zip == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Country country = address.getAddressL7Country();<NEW_LINE>List<City> cities = cityRepository.findByZipAndCountry(zip, country).fetch();<NEW_LINE>City city = cities.size() == 1 ? <MASK><NEW_LINE>address.setCity(city);<NEW_LINE>address.setAddressL6(city != null ? zip + " " + city.getName() : null);<NEW_LINE>if (appBaseService.getAppBase().getStoreStreets()) {<NEW_LINE>List<Street> streets = streetRepository.all().filter("self.city = :city").bind("city", city).fetch();<NEW_LINE>if (streets.size() == 1) {<NEW_LINE>Street street = streets.get(0);<NEW_LINE>address.setStreet(street);<NEW_LINE>String name = street.getName();<NEW_LINE>String num = address.getStreetNumber();<NEW_LINE>address.setAddressL4(num != null ? num + " " + name : name);<NEW_LINE>} else {<NEW_LINE>address.setStreet(null);<NEW_LINE>address.setAddressL4(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | cities.get(0) : null; |
1,234,958 | final GetContactResult executeGetContact(GetContactRequest getContactRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getContactRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetContactRequest> request = null;<NEW_LINE>Response<GetContactResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetContactRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getContactRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SSM Contacts");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetContact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetContactResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetContactResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
356,769 | private Map<String, List<BaseMethodBinding<?>>> collectMethodBindings(RequestDetails theRequestDetails) {<NEW_LINE>Map<String, List<BaseMethodBinding<?>>> resourceToMethods = new TreeMap<String, List<BaseMethodBinding<?>>>();<NEW_LINE>for (ResourceBinding next : getServerConfiguration(theRequestDetails).getResourceBindings()) {<NEW_LINE>String resourceName = next.getResourceName();<NEW_LINE>for (BaseMethodBinding<?> nextMethodBinding : next.getMethodBindings()) {<NEW_LINE>if (resourceToMethods.containsKey(resourceName) == false) {<NEW_LINE>resourceToMethods.put(resourceName, new ArrayList<BaseMethodBinding<?>>());<NEW_LINE>}<NEW_LINE>resourceToMethods.get(resourceName).add(nextMethodBinding);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (BaseMethodBinding<?> nextMethodBinding : getServerConfiguration(theRequestDetails).getServerBindings()) {<NEW_LINE>String resourceName = "";<NEW_LINE>if (resourceToMethods.containsKey(resourceName) == false) {<NEW_LINE>resourceToMethods.put(resourceName, new ArrayList<>());<NEW_LINE>}<NEW_LINE>resourceToMethods.get<MASK><NEW_LINE>}<NEW_LINE>return resourceToMethods;<NEW_LINE>} | (resourceName).add(nextMethodBinding); |
1,207,217 | int saveToBackendStore(ConsumerDto consumerDto, List<JSONObject> lines, JSONArray template, String partition) {<NEW_LINE>log.info(String.format("start save to backend, consumer is %s", consumerDto.getName()));<NEW_LINE>try {<NEW_LINE>if (CollectionUtils.isEmpty(lines)) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>List<List<JSONObject>> data = lines.parallelStream().map(jsonObject -> lineToBackendData(jsonObject, template)).flatMap(List::stream).collect(Collectors.toList());<NEW_LINE>if (!lines.isEmpty()) {<NEW_LINE>log.info(String.format("%s %s records are filtered!", consumerDto.getName(), lines.size() - data.size()));<NEW_LINE>if (!data.isEmpty()) {<NEW_LINE>backendStoreService.importData(consumerDto.getName(), data, partition, this.consumeStime, consumerDto);<NEW_LINE>}<NEW_LINE>return data.size();<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | log.error("saveToBackendStore ERROR: ", e); |
668,244 | public void processFlushQuery(ControlAreYouFlushed flushQuery) throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "processFlushQuery", new Object[] { flushQuery });<NEW_LINE>SIBUuid12 streamID = flushQuery.getGuaranteedStreamUUID();<NEW_LINE>try {<NEW_LINE>// synchronize to give a consistent view of the flushed state<NEW_LINE>synchronized (this) {<NEW_LINE>SIBUuid8 requestor = flushQuery.getGuaranteedSourceMessagingEngineUUID();<NEW_LINE>if (isFlushed(streamID)) {<NEW_LINE>// It's flushed. Send a message saying as much.<NEW_LINE>downControl.sendFlushedMessage(requestor, streamID);<NEW_LINE>} else {<NEW_LINE>// Not flushed. Send a message saying as much.<NEW_LINE>downControl.sendNotFlushedMessage(requestor, streamID, flushQuery.getRequestID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SIResourceException e) {<NEW_LINE>// FFDC<NEW_LINE>FFDCFilter.processException(<MASK><NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "processFlushQuery", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "processFlushQuery");<NEW_LINE>} | e, "com.ibm.ws.sib.processor.gd.InternalOutputStreamManager.processFlushQuery", "1:516:1.48.1.1", this); |
1,582,059 | private int processMessage(EmailMessage message, PurchaseContext purchaseContext) {<NEW_LINE>int messageId = message.getId();<NEW_LINE>ConfigurationLevel configurationLevel = ConfigurationLevel.purchaseContext(purchaseContext);<NEW_LINE>if (message.getAttempts() >= configurationManager.getFor(ConfigurationKeys.MAIL_ATTEMPTS_COUNT, configurationLevel).getValueAsIntOrDefault(10)) {<NEW_LINE>tx.execute(status -> emailMessageRepository.updateStatusAndAttempts(messageId, ERROR.name(), message.getAttempts(), Arrays.asList(IN_PROCESS.name(), WAITING.name(), RETRY.name())));<NEW_LINE><MASK><NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int result = Optional.ofNullable(tx.execute(status -> emailMessageRepository.updateStatus(messageId, message.getChecksum(), IN_PROCESS.name(), Arrays.asList(WAITING.name(), RETRY.name())))).orElse(0);<NEW_LINE>if (result > 0) {<NEW_LINE>return Optional.ofNullable(tx.execute(status -> {<NEW_LINE>sendMessage(purchaseContext, message);<NEW_LINE>return 1;<NEW_LINE>})).orElse(0);<NEW_LINE>} else {<NEW_LINE>log.debug("no messages have been updated on DB for the following criteria: id: {}, checksum: {}", messageId, message.getChecksum());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>tx.execute(status -> emailMessageRepository.updateStatusAndAttempts(message.getId(), RETRY.name(), ZonedDateTime.now(clockProvider.getClock()).plusMinutes(message.getAttempts() + 1L), message.getAttempts() + 1, Arrays.asList(IN_PROCESS.name(), WAITING.name(), RETRY.name())));<NEW_LINE>log.warn("could not send message: ", e);<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | log.warn("Message with id {} will be discarded", messageId); |
841,288 | public ConditionalExpression rewriteExpression(ConditionalExpression expression, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags) {<NEW_LINE>if (expression instanceof BooleanOperation) {<NEW_LINE>BooleanOperation bo = (BooleanOperation) expression;<NEW_LINE>if (bo.getOp() == BoolOp.AND && bo.getLhs() instanceof BooleanExpression && bo.getRhs() instanceof BooleanOperation) {<NEW_LINE>BooleanExpression bol = (BooleanExpression) bo.getLhs();<NEW_LINE>BooleanOperation bor = <MASK><NEW_LINE>if (bor.getOp() == BoolOp.AND && bol.getInner() instanceof InstanceOfExpression) {<NEW_LINE>expression = new BooleanOperation(expression.getLoc(), new BooleanOperation(expression.getLoc(), bo.getLhs(), bor.getLhs(), BoolOp.AND), bor.getRhs(), BoolOp.AND);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.rewriteExpression(expression, ssaIdentifiers, statementContainer, flags);<NEW_LINE>} | (BooleanOperation) bo.getRhs(); |
1,081,966 | public void json(SpiExpressionRequest request, String propName, String path, Op operator, Object value) {<NEW_LINE>StringBuilder sb = new StringBuilder(50);<NEW_LINE>String[] paths = path.split("\\.");<NEW_LINE>if (paths.length == 1) {<NEW_LINE>// (t0.content ->> 'title') = 'Some value'<NEW_LINE>sb.append("(").append(propName).append(" ->> '").append(path).append("')");<NEW_LINE>} else {<NEW_LINE>// (t0.content #>> '{path,inner}') = 'Some value'<NEW_LINE>sb.append("(").append<MASK><NEW_LINE>for (int i = 0; i < paths.length; i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>sb.append(",");<NEW_LINE>}<NEW_LINE>sb.append(paths[i]);<NEW_LINE>}<NEW_LINE>sb.append("}')");<NEW_LINE>}<NEW_LINE>request.append(sb.toString());<NEW_LINE>request.append(PostgresCast.cast(value));<NEW_LINE>request.append(operator.bind());<NEW_LINE>} | (propName).append(" #>> '{"); |
1,846,164 | private // }<NEW_LINE>void loadSubNode(VDBTreeNode pNode) {<NEW_LINE>try {<NEW_LINE>IVS vs = (IVS) pNode.getUserObject();<NEW_LINE>Sequence subNodes = vs.list("w");<NEW_LINE>if (subNodes == null || subNodes.length() == 0)<NEW_LINE>return;<NEW_LINE>pNode.removeAllChildren();<NEW_LINE>for (int i = 1; i <= subNodes.length(); i++) {<NEW_LINE>VS sub = (<MASK><NEW_LINE>VDBTreeNode node = new VDBTreeNode(sub);<NEW_LINE>Sequence subChilds = sub.list("w");<NEW_LINE>if (subChilds != null) {<NEW_LINE>for (int n = 1; n <= subChilds.length(); n++) {<NEW_LINE>VS child = (VS) subChilds.get(n);<NEW_LINE>VDBTreeNode nodeChild = new VDBTreeNode(child);<NEW_LINE>node.add(nodeChild);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pNode.add(node);<NEW_LINE>}<NEW_LINE>pNode.setLoaded(true);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>} | VS) subNodes.get(i); |
1,739,480 | final ListPricingPlansAssociatedWithPricingRuleResult executeListPricingPlansAssociatedWithPricingRule(ListPricingPlansAssociatedWithPricingRuleRequest listPricingPlansAssociatedWithPricingRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPricingPlansAssociatedWithPricingRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPricingPlansAssociatedWithPricingRuleRequest> request = null;<NEW_LINE>Response<ListPricingPlansAssociatedWithPricingRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPricingPlansAssociatedWithPricingRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPricingPlansAssociatedWithPricingRuleRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPricingPlansAssociatedWithPricingRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPricingPlansAssociatedWithPricingRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPricingPlansAssociatedWithPricingRuleResultJsonUnmarshaller());<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.SERVICE_ID, "billingconductor"); |
1,122,868 | private List<Result> findStaticModels(SmallRyeOpenApiConfig openApiConfig, List<Pattern> ignorePatterns, Path target) {<NEW_LINE>List<Result> results = new ArrayList<>();<NEW_LINE>// First check for the file in both META-INF and WEB-INF/classes/META-INF<NEW_LINE>addStaticModelIfExist(results, ignorePatterns, Format.YAML, META_INF_OPENAPI_YAML);<NEW_LINE>addStaticModelIfExist(results, ignorePatterns, Format.YAML, WEB_INF_CLASSES_META_INF_OPENAPI_YAML);<NEW_LINE>addStaticModelIfExist(results, <MASK><NEW_LINE>addStaticModelIfExist(results, ignorePatterns, Format.YAML, WEB_INF_CLASSES_META_INF_OPENAPI_YML);<NEW_LINE>addStaticModelIfExist(results, ignorePatterns, Format.JSON, META_INF_OPENAPI_JSON);<NEW_LINE>addStaticModelIfExist(results, ignorePatterns, Format.JSON, WEB_INF_CLASSES_META_INF_OPENAPI_JSON);<NEW_LINE>// Add any aditional directories if configured<NEW_LINE>if (openApiConfig.additionalDocsDirectory.isPresent()) {<NEW_LINE>List<Path> additionalStaticDocuments = openApiConfig.additionalDocsDirectory.get();<NEW_LINE>for (Path path : additionalStaticDocuments) {<NEW_LINE>// Scan all yaml and json files<NEW_LINE>try {<NEW_LINE>List<String> filesInDir = getResourceFiles(path, target);<NEW_LINE>for (String possibleModelFile : filesInDir) {<NEW_LINE>addStaticModelIfExist(results, ignorePatterns, possibleModelFile);<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>ioe.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | ignorePatterns, Format.YAML, META_INF_OPENAPI_YML); |
1,282,398 | private void parseAndBuildConfig(ClientFailoverConfig config) throws Exception {<NEW_LINE>YamlMapping yamlRootNode;<NEW_LINE>try {<NEW_LINE>yamlRootNode = ((YamlMapping) YamlLoader.load(in));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new InvalidConfigurationException("Invalid YAML configuration", ex);<NEW_LINE>}<NEW_LINE>String configRoot = getConfigRoot();<NEW_LINE>YamlNode clientFailoverRoot = yamlRootNode.childAsMapping(configRoot);<NEW_LINE>if (clientFailoverRoot == null) {<NEW_LINE>clientFailoverRoot = yamlRootNode;<NEW_LINE>}<NEW_LINE>YamlDomChecker.check(clientFailoverRoot);<NEW_LINE>Node w3cRootNode = asW3cNode(clientFailoverRoot);<NEW_LINE>replaceVariables(w3cRootNode);<NEW_LINE>importDocuments(clientFailoverRoot);<NEW_LINE>if (shouldValidateTheSchema()) {<NEW_LINE>new YamlConfigSchemaValidator().validate(yamlRootNode);<NEW_LINE>}<NEW_LINE>new YamlClientFailoverDomConfigProcessor(true<MASK><NEW_LINE>} | , config).buildConfig(w3cRootNode); |
101,013 | public void decode(BitReader _in, ICSInfo info, Profile profile) throws AACException {<NEW_LINE>lag = 0;<NEW_LINE>if (profile.equals(Profile.AAC_LD)) {<NEW_LINE>lagUpdate = _in.readBool();<NEW_LINE>if (lagUpdate)<NEW_LINE>lag = _in.readNBit(10);<NEW_LINE>} else<NEW_LINE>lag = _in.readNBit(11);<NEW_LINE>if (lag > (frameLength << 1))<NEW_LINE><MASK><NEW_LINE>coef = _in.readNBit(3);<NEW_LINE>final int windowCount = info.getWindowCount();<NEW_LINE>if (info.isEightShortFrame()) {<NEW_LINE>shortUsed = new boolean[windowCount];<NEW_LINE>shortLagPresent = new boolean[windowCount];<NEW_LINE>shortLag = new int[windowCount];<NEW_LINE>for (int w = 0; w < windowCount; w++) {<NEW_LINE>if ((shortUsed[w] = _in.readBool())) {<NEW_LINE>shortLagPresent[w] = _in.readBool();<NEW_LINE>if (shortLagPresent[w])<NEW_LINE>shortLag[w] = _in.readNBit(4);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>lastBand = Math.min(info.getMaxSFB(), MAX_LTP_SFB);<NEW_LINE>longUsed = new boolean[lastBand];<NEW_LINE>for (int i = 0; i < lastBand; i++) {<NEW_LINE>longUsed[i] = _in.readBool();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | throw new AACException("LTP lag too large: " + lag); |
1,846,668 | public static ICopyPolicy createCopyPolicy(RefactoringStatus status, JavaRefactoringArguments arguments) {<NEW_LINE>final String policy = arguments.getAttribute(ATTRIBUTE_POLICY);<NEW_LINE>if (policy != null && !"".equals(policy)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>if (CopyFilesFoldersAndCusPolicy.POLICY_COPY_RESOURCE.equals(policy)) {<NEW_LINE>return new <MASK><NEW_LINE>} else if (CopyPackageFragmentRootsPolicy.POLICY_COPY_ROOTS.equals(policy)) {<NEW_LINE>return new CopyPackageFragmentRootsPolicy(null);<NEW_LINE>} else if (CopyPackagesPolicy.POLICY_COPY_PACKAGES.equals(policy)) {<NEW_LINE>return new CopyPackagesPolicy(null);<NEW_LINE>} else if (CopySubCuElementsPolicy.POLICY_COPY_MEMBERS.equals(policy)) {<NEW_LINE>return new CopySubCuElementsPolicy(null);<NEW_LINE>} else {<NEW_LINE>status.merge(RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new String[] { policy, ATTRIBUTE_POLICY })));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>status.merge(RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_POLICY)));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | CopyFilesFoldersAndCusPolicy(null, null, null); |
1,382,574 | public void _Animation_1() {<NEW_LINE>Animation a;<NEW_LINE>a = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>a.setDuration(200);<NEW_LINE>box_settings_close.startAnimation(a);<NEW_LINE>a = null;<NEW_LINE>Animation b;<NEW_LINE>b = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>b.setDuration(300);<NEW_LINE>title_header.startAnimation(b);<NEW_LINE>b = null;<NEW_LINE>Animation c;<NEW_LINE>c = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>c.setDuration(300);<NEW_LINE>main_box_16.startAnimation(c);<NEW_LINE>c = null;<NEW_LINE>Animation d;<NEW_LINE>d = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>d.setDuration(400);<NEW_LINE>main_box_8.startAnimation(d);<NEW_LINE>d = null;<NEW_LINE>Animation e;<NEW_LINE>e = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>e.setDuration(500);<NEW_LINE>main_box_11.startAnimation(e);<NEW_LINE>e = null;<NEW_LINE>Animation f;<NEW_LINE>f = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>f.setDuration(600);<NEW_LINE>main_box_12.startAnimation(f);<NEW_LINE>f = null;<NEW_LINE>Animation g;<NEW_LINE>g = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>g.setDuration(700);<NEW_LINE>main_box_17.startAnimation(g);<NEW_LINE>g = null;<NEW_LINE>Animation h;<NEW_LINE>h = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>h.setDuration(800);<NEW_LINE>main_box_7.startAnimation(h);<NEW_LINE>h = null;<NEW_LINE>Animation i;<NEW_LINE>i = AnimationUtils.loadAnimation(getApplicationContext(), <MASK><NEW_LINE>i.setDuration(900);<NEW_LINE>main_box_5.startAnimation(i);<NEW_LINE>i = null;<NEW_LINE>Animation j;<NEW_LINE>j = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>j.setDuration(1000);<NEW_LINE>main_box_14.startAnimation(j);<NEW_LINE>j = null;<NEW_LINE>Animation k;<NEW_LINE>k = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>k.setDuration(1100);<NEW_LINE>main_box_9.startAnimation(k);<NEW_LINE>k = null;<NEW_LINE>Animation l;<NEW_LINE>l = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>l.setDuration(1200);<NEW_LINE>main_box_10.startAnimation(l);<NEW_LINE>l = null;<NEW_LINE>Animation m;<NEW_LINE>m = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.slide_in_left);<NEW_LINE>m.setDuration(1300);<NEW_LINE>main_box_13.startAnimation(m);<NEW_LINE>m = null;<NEW_LINE>} | android.R.anim.slide_in_left); |
1,214,365 | private static String sanitiseHTML(final String htmlString) {<NEW_LINE>String html = htmlString;<NEW_LINE>Matcher matcher = mHtmlPatter.matcher(htmlString);<NEW_LINE>Set<String> <MASK><NEW_LINE>while (matcher.find()) {<NEW_LINE>try {<NEW_LINE>String tag = htmlString.substring(matcher.start(1), matcher.end(1));<NEW_LINE>// test if the tag is not allowed<NEW_LINE>if (!mAllowedHTMLTags.contains(tag)) {<NEW_LINE>tagsToRemove.add(tag);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(LOG_TAG, "sanitiseHTML failed " + e.getLocalizedMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// some tags to remove ?<NEW_LINE>if (!tagsToRemove.isEmpty()) {<NEW_LINE>// append the tags to remove<NEW_LINE>String tagsToRemoveString = "";<NEW_LINE>for (String tag : tagsToRemove) {<NEW_LINE>if (!tagsToRemoveString.isEmpty()) {<NEW_LINE>tagsToRemoveString += "|";<NEW_LINE>}<NEW_LINE>tagsToRemoveString += tag;<NEW_LINE>}<NEW_LINE>html = html.replaceAll("<\\/?(" + tagsToRemoveString + ")[^>]*>", "");<NEW_LINE>}<NEW_LINE>return html;<NEW_LINE>} | tagsToRemove = new HashSet<>(); |
985,824 | // this function will give us the maximum sum<NEW_LINE>static int max_sum_by_sliding_window(int[] ar, int number, int K) {<NEW_LINE>int final_sum = 0;<NEW_LINE>if (number == K) {<NEW_LINE>int sum = 0;<NEW_LINE>// max_sum will be the sum of all elements of array.<NEW_LINE>for (int i = 0; i < number; i++) {<NEW_LINE>sum += ar[i];<NEW_LINE>}<NEW_LINE>final_sum = sum;<NEW_LINE>}<NEW_LINE>if (number > K) {<NEW_LINE>// calculate sum of first window of size K<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < K; i++) {<NEW_LINE>max_sum += ar[i];<NEW_LINE>}<NEW_LINE>win_sum = max_sum;<NEW_LINE>for (int i = K; i < number; i++) {<NEW_LINE>win_sum += (ar[i] - ar[i - K]);<NEW_LINE>if (win_sum > max_sum) {<NEW_LINE>max_sum = win_sum;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final_sum = max_sum;<NEW_LINE>}<NEW_LINE>return final_sum;<NEW_LINE>} | int max_sum = 0, win_sum = 0; |
414,983 | public boolean onKey(KeyEvent event) {<NEW_LINE>boolean consumed = false;<NEW_LINE>// logger.log(Level.INFO, "onKey event: {0}", event);<NEW_LINE>event.getDeviceId();<NEW_LINE>event.getSource();<NEW_LINE>AndroidJoystick joystick = joystickIndex.get(event.getDeviceId());<NEW_LINE>if (joystick != null) {<NEW_LINE>JoystickButton button = joystick.getButton(event.getKeyCode());<NEW_LINE>boolean pressed = event.getAction() == KeyEvent.ACTION_DOWN;<NEW_LINE>if (button != null) {<NEW_LINE>JoyButtonEvent buttonEvent = new JoyButtonEvent(button, pressed);<NEW_LINE>joyInput.addEvent(buttonEvent);<NEW_LINE>consumed = true;<NEW_LINE>} else {<NEW_LINE>JoystickButton newButton = joystick.addButton(event.getKeyCode());<NEW_LINE>JoyButtonEvent buttonEvent <MASK><NEW_LINE>joyInput.addEvent(buttonEvent);<NEW_LINE>consumed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return consumed;<NEW_LINE>} | = new JoyButtonEvent(newButton, pressed); |
1,122,529 | public void onSuccess(RpcResult result) {<NEW_LINE>messagesOutput.addMessages("Waiting for " + getElapsedMillis() / 1000 + " seconds.");<NEW_LINE>messagesOutput.addMessages(result.getOutput());<NEW_LINE>messagesOutput.addMessages(result.getError());<NEW_LINE>Tracking.trackEvent(Tracking.PROJECT_EVENT, Tracking.PROJECT_SUBACTION_BUILD_YA, node.getName(), getElapsedMillis());<NEW_LINE>if (result.succeeded()) {<NEW_LINE>ode.getTopToolbar().updateKeystoreFileMenuButtons();<NEW_LINE>executeNextCommand(node);<NEW_LINE>} else if (result.getResult() == 1) {<NEW_LINE>// General build error<NEW_LINE>String errorMsg = result.getError();<NEW_LINE>// This is not an internal App Inventor bug. The error should be<NEW_LINE>// reported in a yellow info box.<NEW_LINE>ErrorReporter.reportInfo(MESSAGES.buildFailedError() + (errorMsg.isEmpty() <MASK><NEW_LINE>executionFailedOrCanceled();<NEW_LINE>} else if (result.getResult() == 2) {<NEW_LINE>// Yail generation error<NEW_LINE>String formName = extractFormName(result);<NEW_LINE>ErrorReporter.reportError(MESSAGES.errorGeneratingYail(formName));<NEW_LINE>String blocksFileName = formName + YoungAndroidSourceAnalyzer.CODEBLOCKS_SOURCE_EXTENSION;<NEW_LINE>YoungAndroidBlocksNode blocksNode = findBlocksNode((YoungAndroidProjectNode) node, blocksFileName);<NEW_LINE>if (blocksNode != null) {<NEW_LINE>showProblemBlocks(blocksNode);<NEW_LINE>}<NEW_LINE>executionFailedOrCanceled();<NEW_LINE>} else {<NEW_LINE>// Build isn't done yet<NEW_LINE>Timer timer = new Timer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>execute(node);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// TODO(user): Maybe do an exponential backoff here.<NEW_LINE>timer.schedule(WAIT_INTERVAL_MILLIS);<NEW_LINE>}<NEW_LINE>} | ? "" : " " + errorMsg)); |
1,470,097 | public com.amazonaws.services.mgn.model.AccessDeniedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.mgn.model.AccessDeniedException accessDeniedException = new com.amazonaws.services.mgn.model.AccessDeniedException(null);<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("code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>accessDeniedException.setCode(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return accessDeniedException;<NEW_LINE>} | class).unmarshall(context)); |
694,118 | private static boolean splitVariablesClash(final Collection<? extends TreePath> statementsPaths, final Collection<? extends TreePath> tail, final Trees trees) {<NEW_LINE>if (tail == null || tail.isEmpty())<NEW_LINE>return false;<NEW_LINE>List<StatementTree> statements = new ArrayList<StatementTree>(statementsPaths.size());<NEW_LINE>for (TreePath tp : statementsPaths) {<NEW_LINE>statements.add((StatementTree) tp.getLeaf());<NEW_LINE>}<NEW_LINE>final Set<VariableTree> usedAfterCloseVarDecls = new HashSet<VariableTree>(findVarsUsages(findVariableDecls(statements, statementsPaths.isEmpty() ? null : statementsPaths.iterator().next().getParentPath().getLeaf()), ConvertToARMFix.<StatementTree>asList(tail), tail.iterator().next().getCompilationUnit(), trees));<NEW_LINE>final Set<String> usedAfterCloseVarNames = new HashSet<String>();<NEW_LINE>for (VariableTree vt : usedAfterCloseVarDecls) {<NEW_LINE>usedAfterCloseVarNames.add(vt.getName().toString());<NEW_LINE>}<NEW_LINE>ErrorAwareTreeScanner<Boolean, Void> scanner = new ErrorAwareTreeScanner<Boolean, Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean visitVariable(VariableTree node, Void p) {<NEW_LINE>if (usedAfterCloseVarNames.contains(node.getName().toString()) && !usedAfterCloseVarDecls.contains(node)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return super.visitVariable(node, p);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean reduce(Boolean r1, Boolean r2) {<NEW_LINE>return r1 == Boolean<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>return scanner.scan(statements, null) == Boolean.TRUE;<NEW_LINE>} | .TRUE || r2 == Boolean.TRUE; |
1,821,021 | protected void showForgotPasswordDialog() {<NEW_LINE>AlertDialog.Builder builder <MASK><NEW_LINE>builder.setTitle(getString(R.string.forgot_password));<NEW_LINE>// Set up the input<NEW_LINE>final EditText input = new EditText(this);<NEW_LINE>input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);<NEW_LINE>builder.setView(input);<NEW_LINE>builder.setPositiveButton(getString(R.string.submit), (dialog, which) -> {<NEW_LINE>showOrUpdateProgressDialog(getString(R.string.requesting));<NEW_LINE>dm.add(requestNewPassword(input.getText().toString()).observeOn(RX.main()).subscribe(() -> {<NEW_LINE>dismissProgressDialog();<NEW_LINE>showToast(getString(R.string.password_reset_success));<NEW_LINE>}, throwable -> {<NEW_LINE>showToast(throwable.getLocalizedMessage());<NEW_LINE>}));<NEW_LINE>});<NEW_LINE>builder.setNegativeButton(R.string.cancel, (dialog, which) -> {<NEW_LINE>dialog.cancel();<NEW_LINE>dismissProgressDialog();<NEW_LINE>});<NEW_LINE>builder.show();<NEW_LINE>} | = new AlertDialog.Builder(this); |
1,472,086 | private static List<String> parseExtends(JsonNode root) {<NEW_LINE>List<String> dependencies = new ArrayList<>();<NEW_LINE>if (!root.isObject()) {<NEW_LINE>return dependencies;<NEW_LINE>}<NEW_LINE>JsonNode extend = root.get(ModelsRepositoryConstants.DTDL_EXTENDS);<NEW_LINE>if (extend == null) {<NEW_LINE>return dependencies;<NEW_LINE>}<NEW_LINE>if (extend.isTextual()) {<NEW_LINE>dependencies.add(extend.textValue());<NEW_LINE>} else if (isOfDtdlType(extend, ModelsRepositoryConstants.DTDL_INTERFACE)) {<NEW_LINE>ModelMetadata metadata = parseInterface(extend);<NEW_LINE>dependencies.addAll(metadata.getDependencies());<NEW_LINE>} else if (extend.isArray()) {<NEW_LINE>for (JsonNode extendNode : extend) {<NEW_LINE>if (extendNode.isTextual()) {<NEW_LINE>dependencies.add(extendNode.textValue());<NEW_LINE>} else if (isOfDtdlType(extendNode, ModelsRepositoryConstants.DTDL_INTERFACE)) {<NEW_LINE>ModelMetadata metadata = parseInterface(extendNode);<NEW_LINE>dependencies.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dependencies;<NEW_LINE>} | addAll(metadata.getDependencies()); |
698,221 | public void caseIfStmt(IfStmt stmt) {<NEW_LINE>final ConditionExpr expr = (ConditionExpr) stmt.getCondition();<NEW_LINE>final Value lv = expr.getOp1();<NEW_LINE>final Value rv = expr.getOp2();<NEW_LINE>TypeNode lop;<NEW_LINE>TypeNode rop;<NEW_LINE>// ******** LEFT ********<NEW_LINE>if (lv instanceof Local) {<NEW_LINE>lop = hierarchy.typeNode(((Local) lv).getType());<NEW_LINE>} else if (lv instanceof DoubleConstant) {<NEW_LINE>lop = hierarchy.typeNode(DoubleType.v());<NEW_LINE>} else if (lv instanceof FloatConstant) {<NEW_LINE>lop = hierarchy.typeNode(FloatType.v());<NEW_LINE>} else if (lv instanceof IntConstant) {<NEW_LINE>lop = hierarchy.typeNode(IntType.v());<NEW_LINE>} else if (lv instanceof LongConstant) {<NEW_LINE>lop = hierarchy.typeNode(LongType.v());<NEW_LINE>} else if (lv instanceof NullConstant) {<NEW_LINE>lop = hierarchy.typeNode(NullType.v());<NEW_LINE>} else if (lv instanceof StringConstant) {<NEW_LINE>lop = hierarchy.typeNode(RefType.v("java.lang.String"));<NEW_LINE>} else if (lv instanceof ClassConstant) {<NEW_LINE>lop = hierarchy.typeNode(RefType.v("java.lang.Class"));<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unhandled binary expression left operand type: " + lv.getClass());<NEW_LINE>}<NEW_LINE>// ******** RIGHT ********<NEW_LINE>if (rv instanceof Local) {<NEW_LINE>rop = hierarchy.typeNode(((Local<MASK><NEW_LINE>} else if (rv instanceof DoubleConstant) {<NEW_LINE>rop = hierarchy.typeNode(DoubleType.v());<NEW_LINE>} else if (rv instanceof FloatConstant) {<NEW_LINE>rop = hierarchy.typeNode(FloatType.v());<NEW_LINE>} else if (rv instanceof IntConstant) {<NEW_LINE>rop = hierarchy.typeNode(IntType.v());<NEW_LINE>} else if (rv instanceof LongConstant) {<NEW_LINE>rop = hierarchy.typeNode(LongType.v());<NEW_LINE>} else if (rv instanceof NullConstant) {<NEW_LINE>rop = hierarchy.typeNode(NullType.v());<NEW_LINE>} else if (rv instanceof StringConstant) {<NEW_LINE>rop = hierarchy.typeNode(RefType.v("java.lang.String"));<NEW_LINE>} else if (rv instanceof ClassConstant) {<NEW_LINE>rop = hierarchy.typeNode(RefType.v("java.lang.Class"));<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unhandled binary expression right operand type: " + rv.getClass());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>lop.lca(rop);<NEW_LINE>} catch (TypeException e) {<NEW_LINE>error(e.getMessage());<NEW_LINE>}<NEW_LINE>} | ) rv).getType()); |
1,795,726 | public static DownloadFabricOrganizationSDKResponse unmarshall(DownloadFabricOrganizationSDKResponse downloadFabricOrganizationSDKResponse, UnmarshallerContext _ctx) {<NEW_LINE>downloadFabricOrganizationSDKResponse.setRequestId(_ctx.stringValue("DownloadFabricOrganizationSDKResponse.RequestId"));<NEW_LINE>downloadFabricOrganizationSDKResponse.setSuccess(_ctx.booleanValue("DownloadFabricOrganizationSDKResponse.Success"));<NEW_LINE>downloadFabricOrganizationSDKResponse.setErrorCode(_ctx.integerValue("DownloadFabricOrganizationSDKResponse.ErrorCode"));<NEW_LINE>List<ResultItem> result <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DownloadFabricOrganizationSDKResponse.Result.Length"); i++) {<NEW_LINE>ResultItem resultItem = new ResultItem();<NEW_LINE>resultItem.setPath(_ctx.stringValue("DownloadFabricOrganizationSDKResponse.Result[" + i + "].Path"));<NEW_LINE>resultItem.setContent(_ctx.stringValue("DownloadFabricOrganizationSDKResponse.Result[" + i + "].Content"));<NEW_LINE>result.add(resultItem);<NEW_LINE>}<NEW_LINE>downloadFabricOrganizationSDKResponse.setResult(result);<NEW_LINE>return downloadFabricOrganizationSDKResponse;<NEW_LINE>} | = new ArrayList<ResultItem>(); |
690,074 | public Mono<Response<LogProfileResourceInner>> createOrUpdateWithResponseAsync(String logProfileName, LogProfileResourceInner 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 (logProfileName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>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 apiVersion = "2016-03-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), logProfileName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter logProfileName is required and cannot be null.")); |
1,720,128 | public synchronized Map<String, Object> generateOverview() {<NEW_LINE>if (!overviewResult.isEmpty()) {<NEW_LINE>return overviewResult;<NEW_LINE>}<NEW_LINE>final List<Map<String, Object>> apis = Lists.newArrayList();<NEW_LINE>for (Class<?> clazz : getAnnotatedClasses()) {<NEW_LINE>Api info = <MASK><NEW_LINE>Path path = clazz.getAnnotation(Path.class);<NEW_LINE>if (info == null || path == null) {<NEW_LINE>LOG.debug("Skipping REST resource with no Api or Path annotation: <{}>", clazz.getCanonicalName());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final String prefixedPath = prefixedPath(clazz, path.value());<NEW_LINE>final Map<String, Object> apiDescription = Maps.newHashMap();<NEW_LINE>apiDescription.put("name", prefixedPath.startsWith(pluginPathPrefix) ? "Plugins/" + info.value() : info.value());<NEW_LINE>apiDescription.put("path", prefixedPath);<NEW_LINE>apiDescription.put("description", info.description());<NEW_LINE>apis.add(apiDescription);<NEW_LINE>}<NEW_LINE>Collections.sort(apis, (o1, o2) -> ComparisonChain.start().compare(o1.get("name").toString(), o2.get("name").toString()).result());<NEW_LINE>Map<String, String> info = Maps.newHashMap();<NEW_LINE>info.put("title", "Graylog REST API");<NEW_LINE>overviewResult.put("apiVersion", ServerVersion.VERSION.toString());<NEW_LINE>overviewResult.put("swaggerVersion", EMULATED_SWAGGER_VERSION);<NEW_LINE>overviewResult.put("apis", apis);<NEW_LINE>return overviewResult;<NEW_LINE>} | clazz.getAnnotation(Api.class); |
103,051 | public List<String> generate(final PolicyValues policyValues) {<NEW_LINE>final PasswordRuleReaderHelper ruleHelper = policyValues.getRuleHelper();<NEW_LINE>if (!ruleHelper.readBooleanValue(PwmPasswordRule.AllowSpecial)) {<NEW_LINE>return Collections.singletonList(getLocalString(Message.Requirement_AllowSpecial, null, policyValues));<NEW_LINE>} else {<NEW_LINE>final List<String> returnValues = new ArrayList<>();<NEW_LINE>final int minValue = ruleHelper.readIntValue(PwmPasswordRule.MinimumSpecial);<NEW_LINE>if (minValue > 0) {<NEW_LINE>returnValues.add(getLocalString(Message.Requirement_MinSpecial, minValue, policyValues));<NEW_LINE>}<NEW_LINE>final int maxValue = ruleHelper.readIntValue(PwmPasswordRule.MaximumSpecial);<NEW_LINE>if (maxValue > 0) {<NEW_LINE>returnValues.add(getLocalString(Message<MASK><NEW_LINE>}<NEW_LINE>if (!ruleHelper.readBooleanValue(PwmPasswordRule.AllowFirstCharSpecial)) {<NEW_LINE>returnValues.add(getLocalString(Message.Requirement_FirstSpecial, maxValue, policyValues));<NEW_LINE>}<NEW_LINE>if (!ruleHelper.readBooleanValue(PwmPasswordRule.AllowLastCharSpecial)) {<NEW_LINE>returnValues.add(getLocalString(Message.Requirement_LastSpecial, maxValue, policyValues));<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableList(returnValues);<NEW_LINE>}<NEW_LINE>} | .Requirement_MaxSpecial, maxValue, policyValues)); |
1,761,461 | public void checkAndFilterRestoreOlapTableExistInSnapshot(Map<String, BackupOlapTableInfo> backupOlapTableInfoMap, TableRef tableRef) throws DdlException {<NEW_LINE>String tblName = tableRef<MASK><NEW_LINE>BackupOlapTableInfo tblInfo = backupOlapTableInfoMap.get(tblName);<NEW_LINE>PartitionNames partitionNames = tableRef.getPartitionNames();<NEW_LINE>if (partitionNames != null) {<NEW_LINE>if (partitionNames.isTemp()) {<NEW_LINE>ErrorReport.reportDdlException(ErrorCode.ERR_COMMON_ERROR, "Do not support restoring temporary partitions");<NEW_LINE>}<NEW_LINE>// check the selected partitions<NEW_LINE>for (String partName : partitionNames.getPartitionNames()) {<NEW_LINE>if (!tblInfo.containsPart(partName)) {<NEW_LINE>ErrorReport.reportDdlException(ErrorCode.ERR_COMMON_ERROR, "Partition " + partName + " of table " + tblName + " does not exist in snapshot");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// only retain restore partitions<NEW_LINE>tblInfo.retainPartitions(partitionNames == null ? null : partitionNames.getPartitionNames());<NEW_LINE>} | .getName().getTbl(); |
1,307,047 | public // update delete menu<NEW_LINE>void removeTable() {<NEW_LINE>// NOI18N<NEW_LINE>Log.getLogger().entering("QueryBuilderGraphFrame", "removeTable");<NEW_LINE>QueryBuilder.showBusyCursor(true);<NEW_LINE>// Important: suppress bogus regeneration of the text query<NEW_LINE>_queryBuilder._updateText = false;<NEW_LINE>try {<NEW_LINE>removeTable(_selectedNode);<NEW_LINE>} finally {<NEW_LINE>_queryBuilder._updateText = true;<NEW_LINE>}<NEW_LINE>// enable/disable group_by menu item<NEW_LINE>if (_sqlTextArea.getText() == null) {<NEW_LINE>runQueryMenuItem.setEnabled(false);<NEW_LINE>groupByMenuItem.setEnabled(false);<NEW_LINE>_queryBuilder.getQueryBuilderPane().getQueryBuilderSqlTextArea().setRunQueryMenuEnabled(false);<NEW_LINE>_queryBuilder.getQueryBuilderPane().getQueryBuilderSqlTextArea().setParseQueryMenuEnabled(false);<NEW_LINE>} else if (_sqlTextArea.getText().trim().length() == 0) {<NEW_LINE>runQueryMenuItem.setEnabled(false);<NEW_LINE>groupByMenuItem.setEnabled(false);<NEW_LINE>_queryBuilder.getQueryBuilderPane().getQueryBuilderSqlTextArea().setRunQueryMenuEnabled(false);<NEW_LINE>_queryBuilder.getQueryBuilderPane().<MASK><NEW_LINE>} else {<NEW_LINE>runQueryMenuItem.setEnabled(true);<NEW_LINE>groupByMenuItem.setEnabled(true);<NEW_LINE>_queryBuilder.getQueryBuilderPane().getQueryBuilderSqlTextArea().setRunQueryMenuEnabled(true);<NEW_LINE>_queryBuilder.getQueryBuilderPane().getQueryBuilderSqlTextArea().setParseQueryMenuEnabled(true);<NEW_LINE>}<NEW_LINE>QueryBuilder.showBusyCursor(false);<NEW_LINE>} | getQueryBuilderSqlTextArea().setParseQueryMenuEnabled(false); |
1,231,692 | private void showMissingBookNotificationInternal(SyncData.ServerBookInfo info) {<NEW_LINE>final String errorTitle = MissingBookActivity.errorTitle();<NEW_LINE>final NotificationManager notificationManager = (NotificationManager) myActivity.getSystemService(Activity.NOTIFICATION_SERVICE);<NEW_LINE>final NotificationCompat.Builder builder = new NotificationCompat.Builder(myActivity).setSmallIcon(R.drawable.fbreader).setTicker(errorTitle).setContentTitle(errorTitle<MASK><NEW_LINE>if (info.ThumbnailUrl != null) {<NEW_LINE>SQLiteCookieDatabase.init(myActivity);<NEW_LINE>final NetworkImage thumbnail = new NetworkImage(info.ThumbnailUrl, Paths.systemInfo(myActivity));<NEW_LINE>thumbnail.synchronize();<NEW_LINE>try {<NEW_LINE>builder.setLargeIcon(BitmapFactory.decodeStream(thumbnail.getRealImage().inputStream()));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int notificationId = info.Hashes.size() > 0 ? info.Hashes.get(0).hashCode() : NotificationUtil.MISSING_BOOK_ID;<NEW_LINE>Uri uri = null;<NEW_LINE>try {<NEW_LINE>uri = Uri.parse(info.DownloadUrl);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>builder.setAutoCancel(uri == null);<NEW_LINE>if (uri != null) {<NEW_LINE>final Intent downloadIntent = new Intent(myActivity, MissingBookActivity.class);<NEW_LINE>downloadIntent.setData(uri).putExtra(BookDownloaderService.Key.FROM_SYNC, true).putExtra(BookDownloaderService.Key.BOOK_MIME, info.Mimetype).putExtra(BookDownloaderService.Key.BOOK_KIND, UrlInfo.Type.Book).putExtra(BookDownloaderService.Key.BOOK_TITLE, info.Title).putExtra(BookDownloaderService.Key.NOTIFICATION_TO_DISMISS_ID, notificationId);<NEW_LINE>builder.setContentIntent(PendingIntent.getActivity(myActivity, 0, downloadIntent, 0));<NEW_LINE>} else {<NEW_LINE>builder.setContentIntent(PendingIntent.getActivity(myActivity, 0, new Intent(), 0));<NEW_LINE>}<NEW_LINE>notificationManager.notify(notificationId, builder.build());<NEW_LINE>} | ).setContentText(info.Title); |
379,335 | /*<NEW_LINE>* The entry of replacing partitions with temp partitions.<NEW_LINE>*/<NEW_LINE>public void replaceTempPartition(Database db, OlapTable olapTable, ReplacePartitionClause clause) throws DdlException {<NEW_LINE>Preconditions.checkState(olapTable.isWriteLockHeldByCurrentThread());<NEW_LINE>List<String<MASK><NEW_LINE>List<String> tempPartitionNames = clause.getTempPartitionNames();<NEW_LINE>boolean isStrictRange = clause.isStrictRange();<NEW_LINE>boolean useTempPartitionName = clause.useTempPartitionName();<NEW_LINE>// check partition exist<NEW_LINE>for (String partName : partitionNames) {<NEW_LINE>if (!olapTable.checkPartitionNameExist(partName, false)) {<NEW_LINE>throw new DdlException("Partition[" + partName + "] does not exist");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String partName : tempPartitionNames) {<NEW_LINE>if (!olapTable.checkPartitionNameExist(partName, true)) {<NEW_LINE>throw new DdlException("Temp partition[" + partName + "] does not exist");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>olapTable.replaceTempPartitions(partitionNames, tempPartitionNames, isStrictRange, useTempPartitionName);<NEW_LINE>// write log<NEW_LINE>ReplacePartitionOperationLog info = new ReplacePartitionOperationLog(db.getId(), olapTable.getId(), partitionNames, tempPartitionNames, isStrictRange, useTempPartitionName);<NEW_LINE>editLog.logReplaceTempPartition(info);<NEW_LINE>LOG.info("finished to replace partitions {} with temp partitions {} from table: {}", clause.getPartitionNames(), clause.getTempPartitionNames(), olapTable.getName());<NEW_LINE>} | > partitionNames = clause.getPartitionNames(); |
521,742 | public VarNode verifyHoistedVarDeclarations() {<NEW_LINE>if (!hasHoistedVarDeclarations()) {<NEW_LINE>// nothing to do<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>for (Map.Entry<VarNode, Scope> entry : hoistedVarDeclarations) {<NEW_LINE>VarNode varDecl = entry.getKey();<NEW_LINE><MASK><NEW_LINE>TruffleString varName = varDecl.getName().getName();<NEW_LINE>for (Scope current = declScope; current != bodyScope; current = current.getParent()) {<NEW_LINE>Symbol existing = current.getExistingSymbol(varName);<NEW_LINE>if (existing != null && existing.isBlockScoped()) {<NEW_LINE>if (existing.isCatchParameter()) {<NEW_LINE>// B.3.5 VariableStatements in Catch Blocks<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// let the caller throw the error<NEW_LINE>return varDecl;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | Scope declScope = entry.getValue(); |
464,723 | public void visitBinaryExpression(final BinaryExpression expression) {<NEW_LINE>Expression lhs = expression.getLeftExpression();<NEW_LINE>Expression rhs = expression.getRightExpression();<NEW_LINE>if (lhs instanceof TemporaryVariableExpression) {<NEW_LINE>lhs = ReflectionUtils.getPrivateField(TemporaryVariableExpression.class, "expression", lhs);<NEW_LINE>}<NEW_LINE>if (rhs instanceof TemporaryVariableExpression) {<NEW_LINE>rhs = ReflectionUtils.getPrivateField(TemporaryVariableExpression.class, "expression", rhs);<NEW_LINE>}<NEW_LINE>// both sides of the binary expression are primary since we need<NEW_LINE>// access to both of them when inferring binary expression types<NEW_LINE>if (expr == lhs || expr == rhs) {<NEW_LINE>result[0] = true;<NEW_LINE>} else if (!(expr instanceof TupleExpression) && rhs instanceof ListOfExpressionsExpression) {<NEW_LINE>// statically-compiled assignment chains need a little help<NEW_LINE>List<Expression> list = ReflectionUtils.getPrivateField(<MASK><NEW_LINE>// list.get(0) should be TemporaryVariableExpression (skip)<NEW_LINE>result[0] = (expr != list.get(1) && list.get(1) instanceof MethodCallExpression);<NEW_LINE>}<NEW_LINE>} | ListOfExpressionsExpression.class, "expressions", rhs); |
1,541,490 | private boolean init(String funcString) {<NEW_LINE>int leftBracket = funcString.indexOf("(");<NEW_LINE>int rightBracket = funcString.lastIndexOf(")");<NEW_LINE>// see if there even is a comma<NEW_LINE>int comma = funcString.indexOf(",");<NEW_LINE>if (leftBracket > 1 && rightBracket > leftBracket + 1 && comma > leftBracket && comma < rightBracket) {<NEW_LINE>// test all commas<NEW_LINE>for (int i = leftBracket + 1; i < rightBracket; i++) {<NEW_LINE>if (funcString.charAt(i) == ',') {<NEW_LINE>comma = i;<NEW_LINE>}<NEW_LINE>String funcName = funcString.substring(0, leftBracket);<NEW_LINE>Pattern p = Pattern.compile("[^a-zA-Z0-9]");<NEW_LINE>boolean hasSpecialChar = p.matcher(funcName).find();<NEW_LINE>if (!hasSpecialChar && (funcName.length() > 0)) {<NEW_LINE>String leftExpressionString = funcString.substring(leftBracket + 1, comma);<NEW_LINE>String rightExpressionString = funcString.substring(comma + 1, rightBracket);<NEW_LINE>Expression leftExpressionInBrackets = new Expression(leftExpressionString, parser);<NEW_LINE>Expression rightExpressionInBrackets = new Expression(rightExpressionString, parser);<NEW_LINE>boolean isValidLeftExpression = leftExpressionInBrackets.getExpressionType() != Expression.ExpressionType.INVALID;<NEW_LINE>boolean isValidRightExpression = rightExpressionInBrackets.getExpressionType() != Expression.ExpressionType.INVALID;<NEW_LINE>if (isValidLeftExpression && isValidRightExpression) {<NEW_LINE>this<MASK><NEW_LINE>this.funcName = funcName;<NEW_LINE>this.expressionLeft = leftExpressionInBrackets;<NEW_LINE>this.expressionRight = rightExpressionInBrackets;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.atomType = Atom.AtomType.INVALID;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .atomType = Atom.AtomType.FUNCTION_X; |
43,699 | private void scanWithPredicate(Predicate predicate, BiConsumer consumer) {<NEW_LINE>// needed for optimization where key and value are not an instance of Data type<NEW_LINE>final boolean areKeyValueObjectType = !queryCacheConfig.isSerializeKeys() && InMemoryFormat.OBJECT == queryCacheConfig.getInMemoryFormat();<NEW_LINE>CachedQueryEntry queryEntry = new CachedQueryEntry(ss, extractors);<NEW_LINE>Set<Map.Entry<Object, QueryCacheRecord><MASK><NEW_LINE>for (Map.Entry<Object, QueryCacheRecord> entry : entries) {<NEW_LINE>Object queryCacheKey = entry.getKey();<NEW_LINE>Object rawValue = entry.getValue().getRawValue();<NEW_LINE>if (areKeyValueObjectType) {<NEW_LINE>queryEntry.initWithObjectKeyValue(queryCacheKey, rawValue);<NEW_LINE>} else {<NEW_LINE>queryEntry.init(queryCacheKey, rawValue);<NEW_LINE>}<NEW_LINE>if (!predicate.apply(queryEntry)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>consumer.accept(queryCacheKey, queryEntry.getByPrioritizingObjectValue());<NEW_LINE>}<NEW_LINE>} | > entries = recordStore.entrySet(); |
116,838 | public static ReadOnlyData deserialize(DataInput in) throws IOException {<NEW_LINE>int numKeys = in.readInt();<NEW_LINE>List<TagGroup> keys = Lists.newArrayList();<NEW_LINE>for (int j = 0; j < numKeys; j++) {<NEW_LINE>keys.add(TagGroup.Serializer.deserialize(ReaderConfig.getInstance(), in));<NEW_LINE>}<NEW_LINE>int num = in.readInt();<NEW_LINE>double[][] data = new double[num][];<NEW_LINE>for (int i = 0; i < num; i++) {<NEW_LINE>data[i] = new double[keys.size()];<NEW_LINE><MASK><NEW_LINE>if (hasData) {<NEW_LINE>for (int j = 0; j < keys.size(); j++) {<NEW_LINE>double v = in.readDouble();<NEW_LINE>if (v != 0) {<NEW_LINE>data[i][j] = v;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ReadOnlyData(data, keys);<NEW_LINE>} | boolean hasData = in.readBoolean(); |
1,362,140 | ArrayList<Object> new125() /* reduce AMultiNewExpr */<NEW_LINE>{<NEW_LINE>@SuppressWarnings("hiding")<NEW_LINE>ArrayList<Object> nodeList = new ArrayList<Object>();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList5 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList4 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList3 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList2 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList1 = pop();<NEW_LINE>PNewExpr pnewexprNode1;<NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>TNewmultiarray tnewmultiarrayNode2;<NEW_LINE>TLParen tlparenNode3;<NEW_LINE>PBaseType pbasetypeNode4;<NEW_LINE>TRParen trparenNode5;<NEW_LINE>LinkedList<Object> listNode7 = new LinkedList<Object>();<NEW_LINE>tnewmultiarrayNode2 = (TNewmultiarray) nodeArrayList1.get(0);<NEW_LINE>tlparenNode3 = (TLParen) nodeArrayList2.get(0);<NEW_LINE>pbasetypeNode4 = (<MASK><NEW_LINE>trparenNode5 = (TRParen) nodeArrayList4.get(0);<NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>LinkedList<Object> listNode6 = new LinkedList<Object>();<NEW_LINE>listNode6 = (LinkedList) nodeArrayList5.get(0);<NEW_LINE>if (listNode6 != null) {<NEW_LINE>listNode7.addAll(listNode6);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pnewexprNode1 = new AMultiNewExpr(tnewmultiarrayNode2, tlparenNode3, pbasetypeNode4, trparenNode5, listNode7);<NEW_LINE>}<NEW_LINE>nodeList.add(pnewexprNode1);<NEW_LINE>return nodeList;<NEW_LINE>} | PBaseType) nodeArrayList3.get(0); |
644,911 | public void executeWithRetry(Request request, Response response) {<NEW_LINE>RpcException exception = null;<NEW_LINE>int currentTryTimes = 0;<NEW_LINE>int maxTryTimes = rpcServer.getRpcServerOptions().getMaxTryTimes();<NEW_LINE>while (currentTryTimes < maxTryTimes) {<NEW_LINE>try {<NEW_LINE>// if it is a retry request, add the last selected instance to request,<NEW_LINE>// so that load balance strategy can exclude the selected instance.<NEW_LINE>// if it is the initial request, not init HashSet, so it is more fast.<NEW_LINE>// therefore, it need LoadBalanceStrategy to judge if selectInstances is null.<NEW_LINE>if (currentTryTimes > 0) {<NEW_LINE>if (request.getChannel() != null) {<NEW_LINE>if (request.getSelectedInstances() == null) {<NEW_LINE>request.setSelectedInstances(new HashSet<CommunicationClient>(maxTryTimes - 1));<NEW_LINE>}<NEW_LINE>request.getSelectedInstances().<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>selectChannel(request);<NEW_LINE>pushCore(request, response);<NEW_LINE>break;<NEW_LINE>} catch (RpcException ex) {<NEW_LINE>exception = ex;<NEW_LINE>if (exception.getCode() == RpcException.INTERCEPT_EXCEPTION) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>currentTryTimes++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (response.getResult() == null && response.getRpcFuture() == null) {<NEW_LINE>if (exception == null) {<NEW_LINE>exception = new RpcException(RpcException.UNKNOWN_EXCEPTION, "unknown error");<NEW_LINE>}<NEW_LINE>throw exception;<NEW_LINE>}<NEW_LINE>} | add(request.getCommunicationClient()); |
1,397,018 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String partnerRegistrationName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (partnerRegistrationName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter partnerRegistrationName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, partnerRegistrationName, this.client.getApiVersion(), context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
183,010 | public RelyingPartyRegistration resolve(HttpServletRequest request, String relyingPartyRegistrationId) {<NEW_LINE>if (relyingPartyRegistrationId == null) {<NEW_LINE>if (this.logger.isTraceEnabled()) {<NEW_LINE>this.logger.trace("Attempting to resolve from " + this.registrationRequestMatcher + " since registrationId is null");<NEW_LINE>}<NEW_LINE>relyingPartyRegistrationId = this.registrationRequestMatcher.matcher(request).getVariables().get("registrationId");<NEW_LINE>}<NEW_LINE>if (relyingPartyRegistrationId == null) {<NEW_LINE>if (this.logger.isTraceEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>RelyingPartyRegistration relyingPartyRegistration = this.relyingPartyRegistrationRepository.findByRegistrationId(relyingPartyRegistrationId);<NEW_LINE>if (relyingPartyRegistration == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String applicationUri = getApplicationUri(request);<NEW_LINE>Function<String, String> templateResolver = templateResolver(applicationUri, relyingPartyRegistration);<NEW_LINE>String relyingPartyEntityId = templateResolver.apply(relyingPartyRegistration.getEntityId());<NEW_LINE>String assertionConsumerServiceLocation = templateResolver.apply(relyingPartyRegistration.getAssertionConsumerServiceLocation());<NEW_LINE>String singleLogoutServiceLocation = templateResolver.apply(relyingPartyRegistration.getSingleLogoutServiceLocation());<NEW_LINE>String singleLogoutServiceResponseLocation = templateResolver.apply(relyingPartyRegistration.getSingleLogoutServiceResponseLocation());<NEW_LINE>return RelyingPartyRegistration.withRelyingPartyRegistration(relyingPartyRegistration).entityId(relyingPartyEntityId).assertionConsumerServiceLocation(assertionConsumerServiceLocation).singleLogoutServiceLocation(singleLogoutServiceLocation).singleLogoutServiceResponseLocation(singleLogoutServiceResponseLocation).build();<NEW_LINE>} | this.logger.trace("Returning null registration since registrationId is null"); |
160,595 | public static void main(String[] argv) {<NEW_LINE>assert Cuckoo.NNODES > 0;<NEW_LINE>int nthreads = 1;<NEW_LINE>int maxsols = 8;<NEW_LINE>String header = "";<NEW_LINE>int easipct = 50;<NEW_LINE>for (int i = 0; i < argv.length; i++) {<NEW_LINE>if (argv[i].equals("-e")) {<NEW_LINE>easipct = Integer.parseInt(argv[++i]);<NEW_LINE>} else if (argv[i].equals("-h")) {<NEW_LINE>header = argv[++i];<NEW_LINE>} else if (argv[i].equals("-m")) {<NEW_LINE>maxsols = Integer.parseInt(argv[++i]);<NEW_LINE>} else if (argv[i].equals("-t")) {<NEW_LINE>nthreads = Integer.parseInt(argv[++i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert easipct >= 0 && easipct <= 100;<NEW_LINE>System.out.println("Looking for " + Cuckoo.PROOFSIZE + "-cycle on cuckoo" + Cuckoo.NODEBITS + "(\"" + header + "\") with " + easipct + "% edges and " + nthreads + " threads");<NEW_LINE>CuckooSolve solve = new CuckooSolve(header.getBytes(), (int) (easipct * (long) Cuckoo.NNODES / 100), maxsols, nthreads);<NEW_LINE>Thread[] threads = new Thread[nthreads];<NEW_LINE>for (int t = 0; t < nthreads; t++) {<NEW_LINE>threads[t] = new Thread(new SimpleMiner(t, solve));<NEW_LINE>threads[t].start();<NEW_LINE>}<NEW_LINE>for (int t = 0; t < nthreads; t++) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>System.out.println(e);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int s = 0; s < solve.nsols; s++) {<NEW_LINE>System.out.print("Solution");<NEW_LINE>for (int i = 0; i < Cuckoo.PROOFSIZE; i++) System.out.print(String.format(" %x", solve.sols[s][i]));<NEW_LINE>System.out.println("");<NEW_LINE>}<NEW_LINE>} | threads[t].join(); |
115,962 | // This is the worker function for path{*} /counting (non_SPARQL) semantics.<NEW_LINE>private void ALP_N(Node node, Path path, Set<Node> visited, Collection<Node> output) {<NEW_LINE>if (visited.contains(node))<NEW_LINE>return;<NEW_LINE>// If output is a set, then no point going on if node has been added to<NEW_LINE>// the results.<NEW_LINE>// If output includes duplicates, more solutions are generated<NEW_LINE>// "visited" is nodes on this path (see the matching .remove).<NEW_LINE>if (!output.add(node))<NEW_LINE>return;<NEW_LINE>visited.add(node);<NEW_LINE>Iterator<Node> iter1 = eval(path, node);<NEW_LINE>// For each step, add to results and recurse.<NEW_LINE>for (; iter1.hasNext(); ) {<NEW_LINE><MASK><NEW_LINE>ALP_N(n1, path, visited, output);<NEW_LINE>}<NEW_LINE>visited.remove(node);<NEW_LINE>} | Node n1 = iter1.next(); |
814,869 | private void updateScrolledCompositeMinSize() {<NEW_LINE>// because this method can be called *after* calculating data in the<NEW_LINE>// background, all widgets can already be disposed<NEW_LINE>if (scrolledComposite.isDisposed())<NEW_LINE>return;<NEW_LINE><MASK><NEW_LINE>if (parent.isDisposed())<NEW_LINE>return;<NEW_LINE>Composite grandparent = parent.getParent();<NEW_LINE>if (grandparent.isDisposed())<NEW_LINE>return;<NEW_LINE>Rectangle clientArea = grandparent.getClientArea();<NEW_LINE>Point size = container.computeSize(clientArea.width, SWT.DEFAULT);<NEW_LINE>// On windows only, we do not have an overlay scrollbar and hence have<NEW_LINE>// to reduce the visible area to make room for the vertical scrollbar<NEW_LINE>if (Platform.OS_WIN32.equals(Platform.getOS()) && size.y > clientArea.height) {<NEW_LINE>int width = clientArea.width - scrolledComposite.getVerticalBar().getSize().x;<NEW_LINE>size = container.computeSize(width, SWT.DEFAULT);<NEW_LINE>}<NEW_LINE>scrolledComposite.setMinSize(size);<NEW_LINE>} | Composite parent = scrolledComposite.getParent(); |
1,261,075 | private // And for deleting redundant replica, also find out a tag which has redundant replica.<NEW_LINE>Tag chooseProperTag(TabletSchedCtx tabletCtx, boolean forMissingReplica) throws SchedException {<NEW_LINE>Tablet tablet = tabletCtx.getTablet();<NEW_LINE>List<Replica> replicas = tablet.getReplicas();<NEW_LINE>Map<Tag, Short> allocMap = tabletCtx<MASK><NEW_LINE>Map<Tag, Short> currentAllocMap = Maps.newHashMap();<NEW_LINE>for (Replica replica : replicas) {<NEW_LINE>Backend be = infoService.getBackend(replica.getBackendId());<NEW_LINE>if (be != null && be.isScheduleAvailable() && replica.isAlive() && !replica.tooSlow()) {<NEW_LINE>Short num = currentAllocMap.getOrDefault(be.getTag(), (short) 0);<NEW_LINE>currentAllocMap.put(be.getTag(), (short) (num + 1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<Tag, Short> entry : allocMap.entrySet()) {<NEW_LINE>short curNum = currentAllocMap.getOrDefault(entry.getKey(), (short) 0);<NEW_LINE>if (forMissingReplica && curNum < entry.getValue()) {<NEW_LINE>return entry.getKey();<NEW_LINE>}<NEW_LINE>if (!forMissingReplica && curNum > entry.getValue()) {<NEW_LINE>return entry.getKey();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new SchedException(Status.UNRECOVERABLE, "no proper tag is chose for tablet " + tablet.getId());<NEW_LINE>} | .getReplicaAlloc().getAllocMap(); |
1,166,305 | private void addFilesToArchive(CustomZipOutputStream out, ImmutableSet<Path> paths) throws IOException {<NEW_LINE>for (Path logFile : paths) {<NEW_LINE>Path destPath = logFile;<NEW_LINE>if (destPath.isAbsolute()) {<NEW_LINE>// If it's an absolute path, make it relative instead<NEW_LINE>destPath = destPath.subpath(<MASK><NEW_LINE>Preconditions.checkArgument(!destPath.isAbsolute(), "Should be a relative path", destPath);<NEW_LINE>}<NEW_LINE>if (destPath.getFileName().toString().startsWith(".")) {<NEW_LINE>// If the file is hidden(UNIX terms) save it as normal file.<NEW_LINE>destPath = Optional.ofNullable(destPath.getParent()).orElse(Paths.get("")).resolve(destPath.getFileName().toString().replaceAll("^\\.*", ""));<NEW_LINE>}<NEW_LINE>out.putNextEntry(new CustomZipEntry(destPath));<NEW_LINE>try (InputStream input = filesystem.newFileInputStream(logFile)) {<NEW_LINE>ByteStreams.copy(input, out);<NEW_LINE>}<NEW_LINE>out.closeEntry();<NEW_LINE>}<NEW_LINE>} | 0, logFile.getNameCount()); |
216,532 | public Runnable discriminate(HttpInboundConnectionExtended inboundConnection) {<NEW_LINE>String requestUri = inboundConnection<MASK><NEW_LINE>Runnable requestHandler = null;<NEW_LINE>// Find the container that can handle this URI.<NEW_LINE>// The first to return a non-null wins<NEW_LINE>for (HttpContainerContext ctx : httpContainers) {<NEW_LINE>requestHandler = ctx.container.createRunnableHandler(inboundConnection);<NEW_LINE>if (requestHandler != null) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>if (!requestUri.endsWith("/")) {<NEW_LINE>// Strip the query string and append a / to help the best match<NEW_LINE>int pos = requestUri.lastIndexOf('?');<NEW_LINE>if (pos >= 0) {<NEW_LINE>requestUri = requestUri.substring(0, pos);<NEW_LINE>}<NEW_LINE>requestUri += "/";<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(this, tc, "Discriminate " + requestUri, ctx.container);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return requestHandler;<NEW_LINE>} | .getRequest().getURI(); |
1,698,674 | private ChannelData addChannelInternal(String channelName, Class<?> factoryType, Map<Object, Object> inputPropertyBag, int weight) throws ChannelException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "addChannelInternal: channelName=" + channelName + ", factoryType=" + factoryType + ", weight=" + weight);<NEW_LINE>}<NEW_LINE>// Ensure the weight is non negative.<NEW_LINE>if (weight < 0) {<NEW_LINE>throw new InvalidWeightException("Invalid weight for channel, " + weight);<NEW_LINE>}<NEW_LINE>// Ensure the input channel name is not null<NEW_LINE>if (null == channelName) {<NEW_LINE>throw new InvalidChannelNameException("Input channel name is null");<NEW_LINE>}<NEW_LINE>// Check if the channel name already exists in the configuration.<NEW_LINE>ChannelData <MASK><NEW_LINE>if (null != channelData) {<NEW_LINE>throw new InvalidChannelNameException("Channel already exists: " + channelName);<NEW_LINE>}<NEW_LINE>// Check the factory type and its validity. No need to actually retrieve the<NEW_LINE>// factory. We don't want it to persist and be saved, potentially wasting<NEW_LINE>// memory.<NEW_LINE>// Rather, just do the check to ensure the factory type is valid.<NEW_LINE>getChannelFactoryInternal(factoryType, false);<NEW_LINE>// Prepare the property bag.<NEW_LINE>Map<Object, Object> propertyBag = inputPropertyBag;<NEW_LINE>if (null == propertyBag) {<NEW_LINE>propertyBag = new HashMap<Object, Object>();<NEW_LINE>}<NEW_LINE>channelData = createChannelData(channelName, factoryType, propertyBag, weight);<NEW_LINE>this.channelDataMap.put(channelName, channelData);<NEW_LINE>return channelData;<NEW_LINE>} | channelData = channelDataMap.get(channelName); |
540,161 | // this function will attempt to rip the provided url<NEW_LINE>public static void ripURL(String targetURL, boolean saveConfig) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>rip(url);<NEW_LINE>List<String> history = Utils.getConfigList("download.history");<NEW_LINE>if (!history.contains(url.toExternalForm())) {<NEW_LINE>history.add(url.toExternalForm());<NEW_LINE>Utils.setConfigList("download.history", Arrays.asList(history.toArray()));<NEW_LINE>if (saveConfig) {<NEW_LINE>Utils.saveConfig();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>logger.error("[!] Given URL is not valid. Expected URL format is http://domain.com/...");<NEW_LINE>// System.exit(-1);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("[!] Error while ripping URL " + targetURL, e);<NEW_LINE>// System.exit(-1);<NEW_LINE>}<NEW_LINE>} | URL url = new URL(targetURL); |
1,816,734 | protected boolean login(Subject clientSubject, String username, Credential credential, String authMethod, MessageInfo messageInfo) throws IOException, UnsupportedCallbackException {<NEW_LINE>CredentialValidationCallback credValidationCallback = new CredentialValidationCallback(clientSubject, username, credential);<NEW_LINE>callbackHandler.handle(new Callback[] { credValidationCallback });<NEW_LINE>if (credValidationCallback.getResult()) {<NEW_LINE>Set<LoginCallbackImpl> loginCallbacks = clientSubject.getPrivateCredentials(LoginCallbackImpl.class);<NEW_LINE>if (!loginCallbacks.isEmpty()) {<NEW_LINE>LoginCallbackImpl loginCallback = loginCallbacks.iterator().next();<NEW_LINE>CallerPrincipalCallback callerPrincipalCallback = new CallerPrincipalCallback(clientSubject, loginCallback.getUserPrincipal());<NEW_LINE>GroupPrincipalCallback groupPrincipalCallback = new GroupPrincipalCallback(clientSubject, loginCallback.getRoles());<NEW_LINE>callbackHandler.handle(new Callback<MASK><NEW_LINE>}<NEW_LINE>messageInfo.getMap().put(JaspiMessageInfo.AUTH_METHOD_KEY, authMethod);<NEW_LINE>}<NEW_LINE>return credValidationCallback.getResult();<NEW_LINE>} | [] { callerPrincipalCallback, groupPrincipalCallback }); |
84,231 | final DeleteBranchResult executeDeleteBranch(DeleteBranchRequest deleteBranchRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBranchRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBranchRequest> request = null;<NEW_LINE>Response<DeleteBranchResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteBranchRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBranchRequest));<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, "CodeCommit");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBranch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBranchResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBranchResultJsonUnmarshaller());<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); |
447,406 | public void runSearch(@NonNull String query) {<NEW_LINE>searching = true;<NEW_LINE>searchQuery = query;<NEW_LINE>SearchSettings searchSettings = setupSearchSettings(false);<NEW_LINE>searchUICore.setOnResultsComplete(() -> {<NEW_LINE>ItemList.Builder itemList = new ItemList.Builder();<NEW_LINE>SearchUICore.<MASK><NEW_LINE>int count = 0;<NEW_LINE>List<SearchResult> searchResults = new ArrayList<>();<NEW_LINE>for (SearchResult r : resultCollection.getCurrentSearchResults()) {<NEW_LINE>String name = QuickSearchListItem.getName(app, r);<NEW_LINE>if (Algorithms.isEmpty(name)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Drawable icon = QuickSearchListItem.getIcon(app, r);<NEW_LINE>String typeName = showDescription ? QuickSearchListItem.getTypeName(app, r) : "";<NEW_LINE>itemList.setNoItemsMessage(app.getString(R.string.search_nothing_found));<NEW_LINE>Row.Builder builder = buildSearchRow(searchSettings.getOriginalLocation(), r.location, name, icon, typeName);<NEW_LINE>if (builder != null) {<NEW_LINE>builder.setOnClickListener(() -> {<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onClickSearchResult(r);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>itemList.addItem(builder.build());<NEW_LINE>searchResults.add(r);<NEW_LINE>count++;<NEW_LINE>if (count >= contentLimit) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SearchPhrase phrase = searchUICore.getPhrase();<NEW_LINE>if (searchUICore.isSearchMoreAvailable(phrase)) {<NEW_LINE>Row.Builder builder = new Row.Builder();<NEW_LINE>builder.setTitle(app.getString(R.string.increase_search_radius));<NEW_LINE>int minimalSearchRadius = searchUICore.getMinimalSearchRadius(phrase);<NEW_LINE>if (count == 0 && minimalSearchRadius != Integer.MAX_VALUE) {<NEW_LINE>double rd = OsmAndFormatter.calculateRoundedDist(minimalSearchRadius, app);<NEW_LINE>builder.addText(app.getString(R.string.nothing_found_in_radius) + " " + OsmAndFormatter.getFormattedDistance((float) rd, app, false));<NEW_LINE>}<NEW_LINE>builder.setOnClickListener(this::onClickSearchMore);<NEW_LINE>builder.setBrowsable(true);<NEW_LINE>itemList.addItem(builder.build());<NEW_LINE>}<NEW_LINE>int resultsCount = count;<NEW_LINE>app.runInUIThread(() -> {<NEW_LINE>this.searchResults = searchResults;<NEW_LINE>searching = false;<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onSearchDone(phrase, searchResults, itemList.build(), resultsCount);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>searchUICore.search(searchQuery, true, null, searchSettings);<NEW_LINE>} | SearchResultCollection resultCollection = searchUICore.getCurrentSearchResult(); |
263,818 | public boolean initNewCluster() throws Exception {<NEW_LINE>String zkServers = ZKMetadataDriverBase.resolveZkServers(conf);<NEW_LINE>String instanceIdPath = ledgersRootPath + "/" + INSTANCEID;<NEW_LINE>log.info("Initializing ZooKeeper metadata for new cluster, ZKServers: {} ledger root path: {}", zkServers, ledgersRootPath);<NEW_LINE>boolean ledgerRootExists = null != zk.exists(ledgersRootPath, false);<NEW_LINE>if (ledgerRootExists) {<NEW_LINE>log.error("Ledger root path: {} already exists", ledgersRootPath);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<Op> multiOps = Lists.newArrayListWithExpectedSize(4);<NEW_LINE>// Create ledgers root node<NEW_LINE>multiOps.add(Op.create(ledgersRootPath, EMPTY_BYTE_ARRAY<MASK><NEW_LINE>// create available bookies node<NEW_LINE>multiOps.add(Op.create(bookieRegistrationPath, EMPTY_BYTE_ARRAY, zkAcls, CreateMode.PERSISTENT));<NEW_LINE>// create readonly bookies node<NEW_LINE>multiOps.add(Op.create(bookieReadonlyRegistrationPath, EMPTY_BYTE_ARRAY, zkAcls, CreateMode.PERSISTENT));<NEW_LINE>// create INSTANCEID<NEW_LINE>String instanceId = UUID.randomUUID().toString();<NEW_LINE>multiOps.add(Op.create(instanceIdPath, instanceId.getBytes(UTF_8), zkAcls, CreateMode.PERSISTENT));<NEW_LINE>// execute the multi ops<NEW_LINE>zk.multi(multiOps);<NEW_LINE>// creates the new layout and stores in zookeeper<NEW_LINE>AbstractZkLedgerManagerFactory.newLedgerManagerFactory(conf, layoutManager);<NEW_LINE>log.info("Successfully initiated cluster. ZKServers: {} ledger root path: {} instanceId: {}", zkServers, ledgersRootPath, instanceId);<NEW_LINE>return true;<NEW_LINE>} | , zkAcls, CreateMode.PERSISTENT)); |
825,659 | public void onLoadFinished(Loader<List<User>> listLoader, List<User> orgs) {<NEW_LINE>this.orgs = orgs;<NEW_LINE>int sharedPreferencesOrgId = sharedPreferences.getInt(PREF_ORG_ID, -1);<NEW_LINE>int targetOrgId = org == null ? sharedPreferencesOrgId : org.getId();<NEW_LINE>Menu menu = navigationView.getMenu();<NEW_LINE>menu.<MASK><NEW_LINE>for (int i = 0; i < orgs.size(); ++i) {<NEW_LINE>final MenuItem item = menu.add(R.id.user_select, i, Menu.NONE, orgs.get(i).getLogin());<NEW_LINE>avatars.bind(item, orgs.get(i));<NEW_LINE>if (orgs.get(i).getId() == targetOrgId) {<NEW_LINE>setOrg(orgs.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If the target org is invalid (e.g. first login), select the first one<NEW_LINE>if (targetOrgId == -1 && orgs.size() > 0) {<NEW_LINE>setOrg(orgs.get(0));<NEW_LINE>}<NEW_LINE>menu.setGroupVisible(R.id.user_select, false);<NEW_LINE>new StarForkHubTask(this).execute();<NEW_LINE>} | removeGroup(R.id.user_select); |
236,974 | protected List findByUserId(String userId) throws SystemException {<NEW_LINE>Session session = null;<NEW_LINE>try {<NEW_LINE>session = openSession();<NEW_LINE>StringBuffer query = new StringBuffer();<NEW_LINE>query.append("FROM UserTracker IN CLASS com.liferay.portal.ejb.UserTrackerHBM WHERE ");<NEW_LINE>query.append("userId = ?");<NEW_LINE>query.append(" ");<NEW_LINE>Query q = session.createQuery(query.toString());<NEW_LINE>int queryPos = 0;<NEW_LINE>q.setString(queryPos++, userId);<NEW_LINE>Iterator itr = q<MASK><NEW_LINE>List list = new ArrayList();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>UserTrackerHBM userTrackerHBM = (UserTrackerHBM) itr.next();<NEW_LINE>list.add(UserTrackerHBMUtil.model(userTrackerHBM));<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} catch (HibernateException he) {<NEW_LINE>throw new SystemException(he);<NEW_LINE>} finally {<NEW_LINE>HibernateUtil.closeSession(session);<NEW_LINE>}<NEW_LINE>} | .list().iterator(); |
20,438 | public boolean dbNeedsMigration() {<NEW_LINE>final Version dbVersion = Version.valueOf(dbVersionStr);<NEW_LINE>logger.info("AD_System.DBVersion is {}", dbVersion);<NEW_LINE>final Version rolloutVersion = Version.valueOf(rolloutVersionStr);<NEW_LINE>logger.info("Our own version is {}", rolloutVersion);<NEW_LINE>final int comp = dbVersion.compareTo(rolloutVersion);<NEW_LINE>if (comp == 0) {<NEW_LINE>logger.info("AD_System.DBVersion is equal to our version. Nothing to do.");<NEW_LINE>return false;<NEW_LINE>} else if (comp < 0) {<NEW_LINE>// dbVersion is lower than rolloutVersion<NEW_LINE>// => we need to do the migration to "elevate" it<NEW_LINE>logger.info("The DB version is lower than our own version. Going to migrate");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Check if we have the special case of issue https://github.com/metasfresh/metasfresh/issues/2260<NEW_LINE>final boolean sameMajorVersion = dbVersion.getMajorVersion<MASK><NEW_LINE>final boolean sameMinorVersion = dbVersion.getMinorVersion() == rolloutVersion.getMinorVersion();<NEW_LINE>final boolean //<NEW_LINE>//<NEW_LINE>//<NEW_LINE>patchVersionSwitchBetweenOneAndTwo = dbVersion.getPatchVersion() == 1 && rolloutVersion.getPatchVersion() == 2 || dbVersion.getPatchVersion() == 2 && rolloutVersion.getPatchVersion() == 1;<NEW_LINE>if (sameMajorVersion && sameMinorVersion && patchVersionSwitchBetweenOneAndTwo) {<NEW_LINE>logger.info("Detected a version switch between master (=> patchVersion=1) and release, issue etc (=> patchVersion=2). Assuming that the DB needs migration. Also see https://github.com/metasfresh/metasfresh/issues/2260");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// check if we have a switch between two non-master branches<NEW_LINE>if (!Objects.equals(dbVersion.getBuildMetadata(), rolloutVersion.getBuildMetadata())) {<NEW_LINE>logger.info("Detected a version switch between \"branches\" dbVersion={} and rolloutVersion={}. Assuming that the DB needs migration. Also see https://github.com/metasfresh/metasfresh/issues/2260", dbVersion.getPreReleaseVersion(), rolloutVersion.getPreReleaseVersion());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Issue https://github.com/metasfresh/metasfresh/issues/2260 does not apply..<NEW_LINE>// dbVersion higher....uh-ooh<NEW_LINE>final String msg = "The code has version " + rolloutVersionStr + " but the DB already has version " + dbVersionStr;<NEW_LINE>if (!failIfRolloutIsGreaterThanDB) {<NEW_LINE>// let's ignore the problem<NEW_LINE>logger.info(msg + ". *Not* throwing exception because of the +" + CommandlineParams.OPTION_DoNotFailIfRolloutIsGreaterThanDB + " parameter; but not going to attempt migration either.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>throw new InconsistentVersionsException(msg);<NEW_LINE>} | () == rolloutVersion.getMajorVersion(); |
482,574 | private static void updateEarServerProperties(String newServInstID, EditableProperties projectProps, EditableProperties privateProps) {<NEW_LINE>// NOI18N<NEW_LINE>assert newServInstID != null : "Server isntance id to set can't be null";<NEW_LINE>J2eePlatform j2eePlatform = Deployment.getDefault().getJ2eePlatform(newServInstID);<NEW_LINE>if (j2eePlatform == null) {<NEW_LINE>// remove J2eePlatform.TOOL_APP_CLIENT_RUNTIME classpath<NEW_LINE>privateProps.remove(APPCLIENT_TOOL_RUNTIME);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, String> roots = J2EEProjectProperties.extractPlatformLibrariesRoot(j2eePlatform);<NEW_LINE>// update j2ee.appclient.tool.runtime<NEW_LINE>if (j2eePlatform.isToolSupported(J2eePlatform.TOOL_APP_CLIENT_RUNTIME)) {<NEW_LINE>File[] wsClasspath = j2eePlatform.getToolClasspathEntries(J2eePlatform.TOOL_APP_CLIENT_RUNTIME);<NEW_LINE>privateProps.setProperty(APPCLIENT_TOOL_RUNTIME, J2EEProjectProperties.toClasspathString(wsClasspath, roots));<NEW_LINE>} else {<NEW_LINE>privateProps.remove(APPCLIENT_TOOL_RUNTIME);<NEW_LINE>}<NEW_LINE>String mainClassArgs = j2eePlatform.getToolProperty(J2eePlatform.TOOL_APP_CLIENT_RUNTIME, J2eePlatform.TOOL_PROP_MAIN_CLASS_ARGS);<NEW_LINE>if (mainClassArgs != null && !mainClassArgs.equals("")) {<NEW_LINE>projectProps.setProperty(APPCLIENT_MAINCLASS_ARGS, mainClassArgs);<NEW_LINE>projectProps.remove(CLIENT_NAME);<NEW_LINE>} else if ((mainClassArgs = j2eePlatform.getToolProperty(J2eePlatform.TOOL_APP_CLIENT_RUNTIME, CLIENT_NAME)) != null) {<NEW_LINE><MASK><NEW_LINE>projectProps.remove(APPCLIENT_MAINCLASS_ARGS);<NEW_LINE>} else {<NEW_LINE>projectProps.remove(APPCLIENT_MAINCLASS_ARGS);<NEW_LINE>projectProps.remove(CLIENT_NAME);<NEW_LINE>}<NEW_LINE>setAppClientPrivateProperties(j2eePlatform, newServInstID, privateProps);<NEW_LINE>} | projectProps.setProperty(CLIENT_NAME, mainClassArgs); |
1,648,252 | public Order create(String userId, String commodityCode, int orderCount) {<NEW_LINE>LOGGER.info("Order Service Begin ... xid: " + RootContext.getXID());<NEW_LINE>// calculate payment<NEW_LINE>int orderMoney = calculate(commodityCode, orderCount);<NEW_LINE>// debit from the account<NEW_LINE><MASK><NEW_LINE>final Order order = new Order();<NEW_LINE>order.userId = userId;<NEW_LINE>order.commodityCode = commodityCode;<NEW_LINE>order.count = orderCount;<NEW_LINE>order.money = orderMoney;<NEW_LINE>KeyHolder keyHolder = new GeneratedKeyHolder();<NEW_LINE>LOGGER.info("Order Service SQL: insert into order_tbl (user_id, commodity_code, count, money) values ({}, {}, {}, {})", userId, commodityCode, orderCount, orderMoney);<NEW_LINE>jdbcTemplate.update(con -> {<NEW_LINE>PreparedStatement pst = con.prepareStatement("insert into order_tbl (user_id, commodity_code, count, money) values (?, ?, ?, ?)", PreparedStatement.RETURN_GENERATED_KEYS);<NEW_LINE>pst.setObject(1, order.userId);<NEW_LINE>pst.setObject(2, order.commodityCode);<NEW_LINE>pst.setObject(3, order.count);<NEW_LINE>pst.setObject(4, order.money);<NEW_LINE>return pst;<NEW_LINE>}, keyHolder);<NEW_LINE>order.id = keyHolder.getKey().longValue();<NEW_LINE>LOGGER.info("Order Service End ... Created " + order);<NEW_LINE>return order;<NEW_LINE>} | accountService.debit(userId, orderMoney); |
1,134,343 | static private Instant parseSnapshot(JsonParser parser) throws IOException {<NEW_LINE>if (parser.getCurrentToken() != JsonToken.START_OBJECT) {<NEW_LINE>throw new IOException("Expected start of 'snapshot' object, got " + parser.currentToken());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (parser.nextToken(); parser.getCurrentToken() != JsonToken.END_OBJECT; parser.nextToken()) {<NEW_LINE>String fieldName = parser.getCurrentName();<NEW_LINE>JsonToken token = parser.nextToken();<NEW_LINE>if (fieldName.equals("to")) {<NEW_LINE>timestamp = Instant.ofEpochSecond(parser.getLongValue());<NEW_LINE>timestamp = Instant.ofEpochSecond(Metric.adjustTime(timestamp.getEpochSecond(), Instant.now().getEpochSecond()));<NEW_LINE>} else {<NEW_LINE>if (token == JsonToken.START_OBJECT || token == JsonToken.START_ARRAY) {<NEW_LINE>parser.skipChildren();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return timestamp;<NEW_LINE>} | Instant timestamp = Instant.now(); |
373,470 | ExportResult<PhotosContainerResource> exportOneDrivePhotos(TokensAndUrlAuthData authData, Optional<IdOnlyContainerResource> albumData, Optional<PaginationData> paginationData, UUID jobId) throws IOException {<NEW_LINE>Optional<String> albumId = Optional.empty();<NEW_LINE>if (albumData.isPresent()) {<NEW_LINE>albumId = Optional.of(albumData.get().getId());<NEW_LINE>}<NEW_LINE>Optional<String> paginationUrl = getDrivePaginationToken(paginationData);<NEW_LINE>MicrosoftDriveItemsResponse driveItemsResponse;<NEW_LINE>if (paginationData.isPresent() || albumData.isPresent()) {<NEW_LINE>driveItemsResponse = getOrCreatePhotosInterface(authData).getDriveItems(albumId, paginationUrl);<NEW_LINE>} else {<NEW_LINE>driveItemsResponse = getOrCreatePhotosInterface(authData).getDriveItemsFromSpecialFolder(MicrosoftSpecialFolder.FolderType.photos);<NEW_LINE>}<NEW_LINE>PaginationData nextPageData = SetNextPageToken(driveItemsResponse);<NEW_LINE>ContinuationData continuationData = new ContinuationData(nextPageData);<NEW_LINE>PhotosContainerResource containerResource;<NEW_LINE>MicrosoftDriveItem[] driveItems = driveItemsResponse.getDriveItems();<NEW_LINE>List<PhotoAlbum> albums = new ArrayList<>();<NEW_LINE>List<PhotoModel> <MASK><NEW_LINE>if (driveItems != null && driveItems.length > 0) {<NEW_LINE>for (MicrosoftDriveItem driveItem : driveItems) {<NEW_LINE>PhotoAlbum album = tryConvertDriveItemToPhotoAlbum(driveItem, jobId);<NEW_LINE>if (album != null) {<NEW_LINE>albums.add(album);<NEW_LINE>continuationData.addContainerResource(new IdOnlyContainerResource(driveItem.id));<NEW_LINE>}<NEW_LINE>PhotoModel photo = tryConvertDriveItemToPhotoModel(albumId, driveItem, jobId);<NEW_LINE>if (photo != null) {<NEW_LINE>photos.add(photo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ExportResult.ResultType result = nextPageData == null ? ExportResult.ResultType.END : ExportResult.ResultType.CONTINUE;<NEW_LINE>containerResource = new PhotosContainerResource(albums, photos);<NEW_LINE>return new ExportResult<>(result, containerResource, continuationData);<NEW_LINE>} | photos = new ArrayList<>(); |
785,685 | public LinkNode<K, V> enqueue(LinkNode<K, V> node) {<NEW_LINE>assert node != null;<NEW_LINE>assert node.prev == null || node.prev == this.empty;<NEW_LINE>assert node.next == null || node.next == this.empty;<NEW_LINE>while (true) {<NEW_LINE>LinkNode<K, V<MASK><NEW_LINE>// TODO: should we lock the new `node`?<NEW_LINE>List<Lock> locks = this.lock(last, this.rear);<NEW_LINE>try {<NEW_LINE>if (last != this.rear.prev) {<NEW_LINE>// The rear.prev has changed, try to get lock again<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Build the link between `node` and the rear<NEW_LINE>node.next = this.rear;<NEW_LINE>assert this.rear.prev == last : this.rear.prev;<NEW_LINE>this.rear.prev = node;<NEW_LINE>// Build the link between `last` and `node`<NEW_LINE>node.prev = last;<NEW_LINE>last.next = node;<NEW_LINE>return node;<NEW_LINE>} finally {<NEW_LINE>this.unlock(locks);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > last = this.rear.prev; |
58,069 | private void initView() {<NEW_LINE>mBtnMuteAudio = findViewById(R.id.btn_mute_audio);<NEW_LINE>mBtnDownMic = findViewById(R.id.btn_down_mic);<NEW_LINE>mTextTitle = <MASK><NEW_LINE>mImageBack = findViewById(R.id.iv_back);<NEW_LINE>mTextTitle.setText(getString(R.string.voicechatroom_roomid) + mRoomId);<NEW_LINE>mImageBack.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mBtnMuteAudio.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>muteAudio();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mBtnDownMic.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View view) {<NEW_LINE>upDownMic();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | findViewById(R.id.tv_room_number); |
1,146,624 | private static void showTree(StringBuilder builder, MetaPackage mp, boolean onlyCompiled) {<NEW_LINE>List<MetaPackage> childPackages = mp.getChildPackages();<NEW_LINE>for (MetaPackage childPackage : childPackages) {<NEW_LINE>showTree(builder, childPackage, onlyCompiled);<NEW_LINE>}<NEW_LINE>List<MetaClass> packageClasses = mp.getPackageClasses();<NEW_LINE>for (MetaClass metaClass : packageClasses) {<NEW_LINE>for (IMetaMember member : metaClass.getMetaMembers()) {<NEW_LINE><MASK><NEW_LINE>if (!onlyCompiled || isCompiled) {<NEW_LINE>builder.append(mp.getName()).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(metaClass.getName()).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(member.toStringUnqualifiedMethodName(true, true)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(isCompiled ? "Y" : "N").append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getCompiledAttributeOrNA(member, ATTR_COMPILER, S_HYPEN)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getQueuedAttributeOrNA(member, ATTR_STAMP, S_HYPEN)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getCompiledAttributeOrNA(member, ATTR_STAMP, S_HYPEN)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getLastCompilationTime(member)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getCompiledAttributeOrNA(member, ATTR_BYTES, S_HYPEN)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getCompiledAttributeOrNA(member, ATTR_NMSIZE, S_HYPEN)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getCompiledAttributeOrNA(member, ATTR_DECOMPILES, "0"));<NEW_LINE>builder.append(S_NEWLINE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | boolean isCompiled = member.isCompiled(); |
781,655 | public void registerBeansForRoot(BeanDefinitionRegistry registry, RepositoryConfigurationSource config) {<NEW_LINE>super.registerBeansForRoot(registry, config);<NEW_LINE>Object source = config.getSource();<NEW_LINE>registerLazyIfNotAlreadyRegistered(() -> new RootBeanDefinition(EntityManagerBeanDefinitionRegistrarPostProcessor.class), registry, EM_BEAN_DEFINITION_REGISTRAR_POST_PROCESSOR_BEAN_NAME, source);<NEW_LINE>registerLazyIfNotAlreadyRegistered(() -> new RootBeanDefinition(JpaMetamodelMappingContextFactoryBean.class<MASK><NEW_LINE>registerLazyIfNotAlreadyRegistered(() -> new RootBeanDefinition(PAB_POST_PROCESSOR), registry, AnnotationConfigUtils.PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME, source);<NEW_LINE>// Register bean definition for DefaultJpaContext<NEW_LINE>registerLazyIfNotAlreadyRegistered(() -> {<NEW_LINE>RootBeanDefinition contextDefinition = new RootBeanDefinition(DefaultJpaContext.class);<NEW_LINE>contextDefinition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_CONSTRUCTOR);<NEW_LINE>return contextDefinition;<NEW_LINE>}, registry, JPA_CONTEXT_BEAN_NAME, source);<NEW_LINE>registerIfNotAlreadyRegistered(() -> new RootBeanDefinition(JPA_METAMODEL_CACHE_CLEANUP_CLASSNAME), registry, JPA_METAMODEL_CACHE_CLEANUP_CLASSNAME, source);<NEW_LINE>// EvaluationContextExtension for JPA specific SpEL functions<NEW_LINE>registerIfNotAlreadyRegistered(() -> {<NEW_LINE>//<NEW_LINE>Object //<NEW_LINE>value = //<NEW_LINE>AnnotationRepositoryConfigurationSource.class.isInstance(config) ? config.getRequiredAttribute(ESCAPE_CHARACTER_PROPERTY, Character.class) : config.getAttribute(ESCAPE_CHARACTER_PROPERTY).orElse("\\");<NEW_LINE>BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(JpaEvaluationContextExtension.class);<NEW_LINE>builder.addConstructorArgValue(value);<NEW_LINE>return builder.getBeanDefinition();<NEW_LINE>}, registry, JpaEvaluationContextExtension.class.getName(), source);<NEW_LINE>} | ), registry, JPA_MAPPING_CONTEXT_BEAN_NAME, source); |
1,322,304 | protected void perform() {<NEW_LINE>try {<NEW_LINE>final GitClient client = getClient();<NEW_LINE>GitUtils.runWithoutIndexing(new Callable<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void call() throws Exception {<NEW_LINE>client.stashSave(saveStash.getMessage(), saveStash.isIncludeUncommitted(), getProgressMonitor());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}, <MASK><NEW_LINE>RepositoryInfo.getInstance(repository).refreshStashes();<NEW_LINE>} catch (GitException ex) {<NEW_LINE>GitClientExceptionHandler.notifyException(ex, true);<NEW_LINE>} finally {<NEW_LINE>if (modifications.length > 0) {<NEW_LINE>// NOI18N<NEW_LINE>setDisplayName(NbBundle.getMessage(GitAction.class, "LBL_Progress.RefreshingStatuses"));<NEW_LINE>Git.getInstance().getFileStatusCache().refreshAllRoots(Collections.<File, Collection<File>>singletonMap(repository, Arrays.asList(modifications)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | new File[] { repository }); |
1,074,189 | public boolean acquireLock() {<NEW_LINE>if (hasAcquiredLock) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>hasAcquiredLock = executeCommand(new LockCmd<MASK><NEW_LINE>if (hasAcquiredLock) {<NEW_LINE>LOGGER.debug("Successfully acquired lock {}", lockName);<NEW_LINE>}<NEW_LINE>} catch (FlowableOptimisticLockingException ex) {<NEW_LINE>LOGGER.debug("Failed to acquire lock {} due to optimistic locking", lockName, ex);<NEW_LINE>hasAcquiredLock = false;<NEW_LINE>} catch (FlowableException ex) {<NEW_LINE>if (ex.getClass().equals(FlowableException.class)) {<NEW_LINE>// If it is a FlowableException then log a warning and wait to try again<NEW_LINE>LOGGER.warn("Failed to acquire lock {} due to unknown exception", lockName, ex);<NEW_LINE>hasAcquiredLock = false;<NEW_LINE>} else {<NEW_LINE>// Re-throw any other Flowable specific exception<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>if (ex.getCause() instanceof SQLIntegrityConstraintViolationException) {<NEW_LINE>// This can happen if 2 nodes try to acquire a lock in the exact same time<NEW_LINE>LOGGER.debug("Failed to acquire lock {} due to constraint violation", lockName, ex);<NEW_LINE>} else {<NEW_LINE>LOGGER.info("Failed to acquire lock {} due to unknown exception", lockName, ex);<NEW_LINE>}<NEW_LINE>hasAcquiredLock = false;<NEW_LINE>}<NEW_LINE>return hasAcquiredLock;<NEW_LINE>} | (lockName, lockForceAcquireAfter, engineType)); |
246,383 | private // ****************************************************<NEW_LINE>void registerLinkDiscoveryDebugCounters() throws FloodlightModuleException {<NEW_LINE>if (debugCounterService == null) {<NEW_LINE>log.error("Debug Counter Service not found.");<NEW_LINE>}<NEW_LINE>debugCounterService.registerModule(PACKAGE);<NEW_LINE>ctrIncoming = debugCounterService.registerCounter(PACKAGE, "incoming", "All incoming packets seen by this module");<NEW_LINE>ctrLldpEol = debugCounterService.<MASK><NEW_LINE>ctrLinkLocalDrops = debugCounterService.registerCounter(PACKAGE, "linklocal-drops", "All link local packets dropped by this module");<NEW_LINE>ctrIgnoreSrcMacDrops = debugCounterService.registerCounter(PACKAGE, "ignore-srcmac-drops", "All packets whose srcmac is configured to be dropped by this module");<NEW_LINE>ctrQuarantineDrops = debugCounterService.registerCounter(PACKAGE, "quarantine-drops", "All packets arriving on quarantined ports dropped by this module", IDebugCounterService.MetaData.WARN);<NEW_LINE>counterPacketOut = debugCounterService.registerCounter(PACKAGE, "packet-outs-written", "Packet outs written by the LinkDiscovery", IDebugCounterService.MetaData.WARN);<NEW_LINE>} | registerCounter(PACKAGE, "lldp-eol", "End of Life for LLDP packets"); |
1,610,508 | public static void main(String[] args) {<NEW_LINE>JFrame view = new JFrame("airline2");<NEW_LINE>view.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<NEW_LINE>SDateField dep = new SDateField();<NEW_LINE>SDateField ret = new SDateField();<NEW_LINE>Rule r1 = new Rule((d, r) -> d.compareTo(r) <= 0);<NEW_LINE>Rule r2 = new Rule((d, r) -> !unlucky(d) && !unlucky(r));<NEW_LINE>Rule r = r1.and(r2);<NEW_LINE>Cell<Boolean> valid = r.reify(dep.date, ret.date);<NEW_LINE>SButton ok = new SButton("OK", valid);<NEW_LINE>GridBagLayout gridbag = new GridBagLayout();<NEW_LINE>view.setLayout(gridbag);<NEW_LINE>GridBagConstraints c = new GridBagConstraints();<NEW_LINE>c.fill = GridBagConstraints.HORIZONTAL;<NEW_LINE>c.gridwidth = 1;<NEW_LINE>c.gridheight = 1;<NEW_LINE>c.gridx = 0;<NEW_LINE>c.gridy = 0;<NEW_LINE>c.weightx = 0.0;<NEW_LINE>view.add(new JLabel("departure"), c);<NEW_LINE>c.gridx = 1;<NEW_LINE>c.gridy = 0;<NEW_LINE>c.weightx = 1.0;<NEW_LINE><MASK><NEW_LINE>c.gridwidth = 1;<NEW_LINE>c.gridheight = 1;<NEW_LINE>c.gridx = 0;<NEW_LINE>c.gridy = 1;<NEW_LINE>c.weightx = 0.0;<NEW_LINE>view.add(new JLabel("return"), c);<NEW_LINE>c.gridx = 1;<NEW_LINE>c.gridy = 1;<NEW_LINE>c.weightx = 1.0;<NEW_LINE>view.add(ret, c);<NEW_LINE>c.fill = GridBagConstraints.NONE;<NEW_LINE>c.gridwidth = 2;<NEW_LINE>c.gridx = 0;<NEW_LINE>c.gridy = 2;<NEW_LINE>c.weightx = 1.0;<NEW_LINE>view.add(ok, c);<NEW_LINE>view.setSize(380, 140);<NEW_LINE>view.setVisible(true);<NEW_LINE>} | view.add(dep, c); |
73,282 | private void doublingRatioExperiments() {<NEW_LINE>int digraphsPerExperiment = 5;<NEW_LINE>int initialVertices = 125;<NEW_LINE>int initialEdges = initialVertices * 10;<NEW_LINE>Exercise49_RandomSparseEdgeWeightedDigraphs.RandomEdgeWeightedDigraphs randomEdgeWeightedDigraphs = new Exercise49_RandomSparseEdgeWeightedDigraphs().new RandomEdgeWeightedDigraphs();<NEW_LINE>double totalTimePrevious = 0;<NEW_LINE>for (int digraph = 0; digraph < digraphsPerExperiment; digraph++) {<NEW_LINE>EdgeWeightedDigraphInterface randomEdgeWeightedDigraphUniformWeights = <MASK><NEW_LINE>totalTimePrevious += doExperiment(randomEdgeWeightedDigraphUniformWeights);<NEW_LINE>}<NEW_LINE>double averagePreviousTime = totalTimePrevious / digraphsPerExperiment;<NEW_LINE>StdOut.println("Doubling ratio experiments:\n");<NEW_LINE>StdOut.printf("%6s %6s %6s %6s\n", "Vertices | ", "Edges | ", "Time | ", "Ratio");<NEW_LINE>for (int vertices = 250; vertices <= 4000; vertices += vertices) {<NEW_LINE>int edges = vertices * 10;<NEW_LINE>double totalTimeSpent = 0;<NEW_LINE>for (int digraph = 0; digraph < digraphsPerExperiment; digraph++) {<NEW_LINE>EdgeWeightedDigraphInterface randomEdgeWeightedDigraphUniformWeights = randomEdgeWeightedDigraphs.erdosRenyiDigraphUniformWeights(vertices, edges);<NEW_LINE>totalTimeSpent += doExperiment(randomEdgeWeightedDigraphUniformWeights);<NEW_LINE>}<NEW_LINE>double averageTimeSpent = totalTimeSpent / digraphsPerExperiment;<NEW_LINE>StdOut.printf("%8d %8s %7.1f ", vertices, edges, averageTimeSpent);<NEW_LINE>StdOut.printf("%9.1f\n", averageTimeSpent / averagePreviousTime);<NEW_LINE>averagePreviousTime = averageTimeSpent;<NEW_LINE>}<NEW_LINE>} | randomEdgeWeightedDigraphs.erdosRenyiDigraphUniformWeights(initialVertices, initialEdges); |
757,473 | public void plot(Staff staff) {<NEW_LINE>final Sheet sheet = system.getSheet();<NEW_LINE>final String frameTitle = sheet.getId() <MASK><NEW_LINE>final ChartPlotter plotter = new ChartPlotter(frameTitle, "Abscissae - staff interline:" + staff.getSpecificInterline(), "Counts");<NEW_LINE>// Draw time sig portion<NEW_LINE>String timeString = timeColumn.addPlot(plotter, staff);<NEW_LINE>// Draw key sig portion<NEW_LINE>String keyString = keyColumn.addPlot(plotter, staff, maxHeaderWidth);<NEW_LINE>// Get clef info<NEW_LINE>ClefInter clef = staff.getHeader().clef;<NEW_LINE>String clefString = (clef != null) ? clef.getKind().toString() : null;<NEW_LINE>{<NEW_LINE>// Draw the zero reference line<NEW_LINE>final int xMin = staff.getHeaderStart();<NEW_LINE>final int xMax = xMin + maxHeaderWidth;<NEW_LINE>// No autosort<NEW_LINE>XYSeries series = new XYSeries("Zero", false);<NEW_LINE>series.add(xMin, 0);<NEW_LINE>series.add(xMax, 0);<NEW_LINE>plotter.add(series, Colors.CHART_ZERO, true);<NEW_LINE>}<NEW_LINE>// Build chart title: clef + key + time<NEW_LINE>StringBuilder chartTitle = new StringBuilder(frameTitle);<NEW_LINE>if (clefString != null) {<NEW_LINE>chartTitle.append(" ").append(clefString);<NEW_LINE>}<NEW_LINE>if (keyString != null) {<NEW_LINE>chartTitle.append(" ").append(keyString);<NEW_LINE>}<NEW_LINE>if (timeString != null) {<NEW_LINE>chartTitle.append(" ").append(timeString);<NEW_LINE>}<NEW_LINE>plotter.setChartTitle(chartTitle.toString());<NEW_LINE>// Display frame<NEW_LINE>plotter.display(frameTitle, new Point(20 * staff.getId(), 20 * staff.getId()));<NEW_LINE>} | + " header staff#" + staff.getId(); |
1,341,473 | protected Iterable<OIdentifiable> traversePatternEdge(OMatchStatement.MatchContext matchContext, OIdentifiable startingPoint, OCommandContext iCommandContext) {<NEW_LINE>Iterable possibleResults = null;<NEW_LINE>if (filter != null) {<NEW_LINE>OIdentifiable matchedNode = matchContext.matched.get(filter.getAlias());<NEW_LINE>if (matchedNode != null) {<NEW_LINE><MASK><NEW_LINE>} else if (matchContext.matched.containsKey(filter.getAlias())) {<NEW_LINE>// optional node, the matched element is a null value<NEW_LINE>possibleResults = Collections.emptySet();<NEW_LINE>} else {<NEW_LINE>possibleResults = matchContext.candidates == null ? null : matchContext.candidates.get(filter.getAlias());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object qR = this.method.execute(startingPoint, possibleResults, iCommandContext);<NEW_LINE>return (qR instanceof Iterable && !(qR instanceof ODocument)) ? (Iterable) qR : Collections.singleton((OIdentifiable) qR);<NEW_LINE>} | possibleResults = Collections.singleton(matchedNode); |
1,514,017 | protected void processStopped(GdbStoppedEvent evt, Void v) {<NEW_LINE>String stoppedThreadsStr = evt.assumeStoppedThreads();<NEW_LINE>Collection<GdbThreadImpl> stoppedThreads;<NEW_LINE>if (null == stoppedThreadsStr || "all".equals(stoppedThreadsStr)) {<NEW_LINE>stoppedThreads = threads.values();<NEW_LINE>} else {<NEW_LINE>stoppedThreads = new LinkedHashSet<>();<NEW_LINE>for (String stopped : stoppedThreadsStr.split(",")) {<NEW_LINE>stoppedThreads.add(threads.get(Integer.parseInt(stopped)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Integer tid = evt.getThreadId();<NEW_LINE>GdbThreadImpl evtThread = tid == null ? null : threads.get(tid);<NEW_LINE>Map<GdbInferior, Set<GdbThread>> byInf = new LinkedHashMap<>();<NEW_LINE>for (GdbThreadImpl thread : stoppedThreads) {<NEW_LINE>thread.setState(evt.newState(), evt.getCause(), evt.getReason());<NEW_LINE>byInf.computeIfAbsent(thread.getInferior(), i -> new LinkedHashSet<>()).add(thread);<NEW_LINE>}<NEW_LINE>for (Map.Entry<GdbInferior, Set<GdbThread>> ent : byInf.entrySet()) {<NEW_LINE>event(() -> {<NEW_LINE>listenersEvent.fire.inferiorStateChanged(ent.getKey(), ent.getValue(), evt.newState(), evtThread, evt.getCause(<MASK><NEW_LINE>}, "inferiorState-stopped");<NEW_LINE>}<NEW_LINE>if (evtThread != null) {<NEW_LINE>GdbStackFrameImpl frame = evt.getFrame(evtThread);<NEW_LINE>event(() -> listenersEvent.fire.threadSelected(evtThread, frame, evt), "inferiorState-stopped");<NEW_LINE>}<NEW_LINE>} | ), evt.getReason()); |
763,712 | boolean checkIndex(final long index, final long position) {<NEW_LINE>try {<NEW_LINE>final long seq1 = queue.rollCycle().toSequenceNumber(index + 1) - 1;<NEW_LINE>final long seq2 = store.sequenceForPosition(this, position, true);<NEW_LINE>if (seq1 != seq2) {<NEW_LINE>final long seq3 = store.indexing.linearScanByPosition(wireForIndex(), position, 0, 0, true);<NEW_LINE>Jvm.error().on(getClass(), "Thread=" + Thread.currentThread().getName() + " pos: " + position + " seq1: " + Long.toHexString(seq1) + " seq2: " + Long.toHexString(seq2) + " seq3: " + Long.toHexString(seq3));<NEW_LINE>// System.out.println(store.dump());<NEW_LINE>assert seq1 == seq3 : "seq1=" + seq1 + ", seq3=" + seq3;<NEW_LINE>assert seq1 == seq2 <MASK><NEW_LINE>}<NEW_LINE>} catch (@NotNull EOFException | UnrecoverableTimeoutException | StreamCorruptedException e) {<NEW_LINE>throw new AssertionError(e);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | : "seq1=" + seq1 + ", seq2=" + seq2; |
1,235,119 | public Cursor<T> peekLast() {<NEW_LINE>while (true) {<NEW_LINE>Node<T> tail = get();<NEW_LINE>final int enqidx = tail.enqidx.get();<NEW_LINE>final int deqidx = tail.deqidx;<NEW_LINE>if (deqidx >= enqidx || deqidx >= BUFFER_SIZE) {<NEW_LINE>// we remove only from the head, so if tail is empty it means that queue is<NEW_LINE>return null;<NEW_LINE>// empty<NEW_LINE>}<NEW_LINE>int idx = enqidx;<NEW_LINE>if (idx >= BUFFER_SIZE) {<NEW_LINE>idx = BUFFER_SIZE;<NEW_LINE>}<NEW_LINE>if (idx <= 0) {<NEW_LINE>// No more items in the node<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final T item = tail.<MASK><NEW_LINE>if (item == null || item == taken) {<NEW_LINE>// concurrent modification<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>return new Cursor<>(tail, idx - 1, item);<NEW_LINE>}<NEW_LINE>} | items.get(idx - 1); |
882,872 | public static void sendComment(Executor executor, Handler handler, String commentMarkdown, String thingFullname, int parentDepth, Retrofit newAuthenticatorOauthRetrofit, Account account, SendCommentListener sendCommentListener) {<NEW_LINE>Map<String, String> headers = APIUtils.getOAuthHeader(account.getAccessToken());<NEW_LINE>Map<String, String> params = new HashMap<>();<NEW_LINE>params.put(APIUtils.API_TYPE_KEY, "json");<NEW_LINE>params.put(APIUtils.RETURN_RTJSON_KEY, "true");<NEW_LINE>params.put(APIUtils.TEXT_KEY, commentMarkdown);<NEW_LINE>params.put(APIUtils.THING_ID_KEY, thingFullname);<NEW_LINE>newAuthenticatorOauthRetrofit.create(RedditAPI.class).sendCommentOrReplyToMessage(headers, params).enqueue(new Callback<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) {<NEW_LINE>if (response.isSuccessful()) {<NEW_LINE>ParseComment.parseSentComment(executor, handler, response.body(), parentDepth, new ParseComment.ParseSentCommentListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onParseSentCommentSuccess(Comment comment) {<NEW_LINE>sendCommentListener.sendCommentSuccess(comment);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onParseSentCommentFailed(@Nullable String errorMessage) {<NEW_LINE>sendCommentListener.sendCommentFailed(errorMessage);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>sendCommentListener.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) {<NEW_LINE>sendCommentListener.sendCommentFailed(t.getMessage());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | sendCommentFailed(response.message()); |
50,050 | public void handleRequest(RestRequest request, RequestContext requestContext, final Callback<RestResponse> callback) {<NEW_LINE>if (HttpMethod.POST != HttpMethod.valueOf(request.getMethod())) {<NEW_LINE>_log.error("POST is expected, but " + request.getMethod() + " received");<NEW_LINE>callback.onError(RestException.forError(HttpStatus.S_405_METHOD_NOT_ALLOWED<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Disable server-side latency instrumentation for multiplexed requests<NEW_LINE>requestContext.putLocalAttr(TimingContextUtil.TIMINGS_DISABLED_KEY_NAME, true);<NEW_LINE>IndividualRequestMap individualRequests;<NEW_LINE>try {<NEW_LINE>individualRequests = extractIndividualRequests(request);<NEW_LINE>if (_multiplexerSingletonFilter != null) {<NEW_LINE>individualRequests = _multiplexerSingletonFilter.filterRequests(individualRequests);<NEW_LINE>}<NEW_LINE>} catch (RestException e) {<NEW_LINE>_log.error("Invalid multiplexed request", e);<NEW_LINE>callback.onError(e);<NEW_LINE>return;<NEW_LINE>} catch (Exception e) {<NEW_LINE>_log.error("Invalid multiplexed request", e);<NEW_LINE>callback.onError(RestException.forError(HttpStatus.S_400_BAD_REQUEST.getCode(), e));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// prepare the map of individual responses to be collected<NEW_LINE>final IndividualResponseMap individualResponses = new IndividualResponseMap(individualRequests.size());<NEW_LINE>final Map<String, HttpCookie> responseCookies = new HashMap<>();<NEW_LINE>// all tasks are Void and side effect based, that will be useful when we add streaming<NEW_LINE>Task<?> requestProcessingTask = createParallelRequestsTask(request, requestContext, individualRequests, individualResponses, responseCookies);<NEW_LINE>Task<Void> responseAggregationTask = Task.action("send aggregated response", () -> {<NEW_LINE>RestResponse aggregatedResponse = aggregateResponses(individualResponses, responseCookies);<NEW_LINE>callback.onSuccess(aggregatedResponse);<NEW_LINE>});<NEW_LINE>_engine.run(requestProcessingTask.andThen(responseAggregationTask), MUX_PLAN_CLASS);<NEW_LINE>} | .getCode(), "Invalid method")); |
961,480 | public HarvestedCollectionRest update(Context context, HttpServletRequest request, Collection collection) throws SQLException {<NEW_LINE>HarvestedCollectionRest harvestedCollectionRest = parseHarvestedCollectionRest(context, request, collection);<NEW_LINE>HarvestedCollection harvestedCollection = harvestedCollectionService.find(context, collection);<NEW_LINE>// Delete harvestedCollectionService object if harvest type is not set<NEW_LINE>if (harvestedCollectionRest.getHarvestType() == HarvestTypeEnum.NONE.getValue() && harvestedCollection != null) {<NEW_LINE>harvestedCollectionService.delete(context, harvestedCollection);<NEW_LINE>return harvestedCollectionConverter.convert(null, utils.obtainProjection());<NEW_LINE>} else if (harvestedCollectionRest.getHarvestType() != HarvestTypeEnum.NONE.getValue()) {<NEW_LINE>List<String> errors = testHarvestSettings(harvestedCollectionRest);<NEW_LINE>if (errors.size() == 0) {<NEW_LINE>if (harvestedCollection == null) {<NEW_LINE>harvestedCollection = harvestedCollectionService.create(context, collection);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>harvestedCollection = harvestedCollectionService.find(context, collection);<NEW_LINE>List<Map<String, String>> configs = OAIHarvester.getAvailableMetadataFormats();<NEW_LINE>return harvestedCollectionConverter.fromModel(harvestedCollection, collection, configs, utils.obtainProjection());<NEW_LINE>} else {<NEW_LINE>throw new UnprocessableEntityException("Incorrect harvest settings in request. The following errors were found: " + errors.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | updateCollectionHarvestSettings(context, harvestedCollection, harvestedCollectionRest); |
1,326,430 | private void computeMSet() {<NEW_LINE>long min = 0;<NEW_LINE>long max = 0;<NEW_LINE>long nodes = 0;<NEW_LINE>long totalNodes = 0;<NEW_LINE>Set maps = unitToM.entrySet();<NEW_LINE>boolean first = true;<NEW_LINE>for (Iterator iter = maps.iterator(); iter.hasNext(); ) {<NEW_LINE>Map.Entry entry = (Map.Entry) iter.next();<NEW_LINE>Object obj = entry.getKey();<NEW_LINE>FlowSet fs = (FlowSet) entry.getValue();<NEW_LINE>if (fs.size() > 0) {<NEW_LINE>totalNodes += fs.size();<NEW_LINE>nodes++;<NEW_LINE>if (fs.size() > max) {<NEW_LINE>max = fs.size();<NEW_LINE>}<NEW_LINE>if (first) {<NEW_LINE>min = fs.size();<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>if (fs.size() < min) {<NEW_LINE>min = fs.size();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.err.<MASK><NEW_LINE>System.err.println("min: " + min);<NEW_LINE>System.err.println("max: " + max);<NEW_LINE>} | println("average: " + totalNodes / nodes); |
1,462,118 | public void writeProperty(DataType dataType, Object value) {<NEW_LINE>switch(dataType) {<NEW_LINE>case BOOLEAN:<NEW_LINE>this.writeVInt(((Boolean) value) ? 1 : 0);<NEW_LINE>break;<NEW_LINE>case BYTE:<NEW_LINE>this.writeVInt((Byte) value);<NEW_LINE>break;<NEW_LINE>case INT:<NEW_LINE>this<MASK><NEW_LINE>break;<NEW_LINE>case FLOAT:<NEW_LINE>this.writeFloat((Float) value);<NEW_LINE>break;<NEW_LINE>case LONG:<NEW_LINE>this.writeVLong((Long) value);<NEW_LINE>break;<NEW_LINE>case DATE:<NEW_LINE>this.writeVLong(((Date) value).getTime());<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>this.writeDouble((Double) value);<NEW_LINE>break;<NEW_LINE>case TEXT:<NEW_LINE>this.writeString((String) value);<NEW_LINE>break;<NEW_LINE>case BLOB:<NEW_LINE>byte[] bytes = value instanceof byte[] ? (byte[]) value : ((Blob) value).bytes();<NEW_LINE>this.writeBigBytes(bytes);<NEW_LINE>break;<NEW_LINE>case UUID:<NEW_LINE>UUID uuid = (UUID) value;<NEW_LINE>// Generally writeVLong(uuid) can't save space<NEW_LINE>this.writeLong(uuid.getMostSignificantBits());<NEW_LINE>this.writeLong(uuid.getLeastSignificantBits());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>this.writeBytes(KryoUtil.toKryoWithType(value));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | .writeVInt((Integer) value); |
1,523,552 | private void postProcessMethodAndRegisterEndpointIfAny(Object bean, String beanName, Method method, Class<? extends Annotation> annotationType, List<Annotation> annotations, MethodAnnotationPostProcessor<?> postProcessor, Method targetMethod) {<NEW_LINE>Object result = postProcessor.postProcess(bean, beanName, targetMethod, annotations);<NEW_LINE>ConfigurableListableBeanFactory beanFactory = getBeanFactory();<NEW_LINE>BeanDefinitionRegistry definitionRegistry = (BeanDefinitionRegistry) beanFactory;<NEW_LINE>if (result instanceof AbstractEndpoint) {<NEW_LINE>AbstractEndpoint endpoint = (AbstractEndpoint) result;<NEW_LINE>String autoStartup = MessagingAnnotationUtils.resolveAttribute(<MASK><NEW_LINE>if (StringUtils.hasText(autoStartup)) {<NEW_LINE>autoStartup = beanFactory.resolveEmbeddedValue(autoStartup);<NEW_LINE>if (StringUtils.hasText(autoStartup)) {<NEW_LINE>endpoint.setAutoStartup(Boolean.parseBoolean(autoStartup));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String phase = MessagingAnnotationUtils.resolveAttribute(annotations, "phase", String.class);<NEW_LINE>if (StringUtils.hasText(phase)) {<NEW_LINE>phase = beanFactory.resolveEmbeddedValue(phase);<NEW_LINE>if (StringUtils.hasText(phase)) {<NEW_LINE>endpoint.setPhase(Integer.parseInt(phase));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Role role = AnnotationUtils.findAnnotation(method, Role.class);<NEW_LINE>if (role != null) {<NEW_LINE>endpoint.setRole(role.value());<NEW_LINE>}<NEW_LINE>String endpointBeanName = generateBeanName(beanName, method, annotationType);<NEW_LINE>endpoint.setBeanName(endpointBeanName);<NEW_LINE>definitionRegistry.registerBeanDefinition(endpointBeanName, new RootBeanDefinition((Class<AbstractEndpoint>) endpoint.getClass(), () -> endpoint));<NEW_LINE>beanFactory.getBean(endpointBeanName);<NEW_LINE>}<NEW_LINE>} | annotations, "autoStartup", String.class); |
1,267,535 | public static DescribeDBInstanceMetricsResponse unmarshall(DescribeDBInstanceMetricsResponse describeDBInstanceMetricsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDBInstanceMetricsResponse.setRequestId(_ctx.stringValue("DescribeDBInstanceMetricsResponse.RequestId"));<NEW_LINE>describeDBInstanceMetricsResponse.setTotalRecordCount(_ctx.integerValue("DescribeDBInstanceMetricsResponse.TotalRecordCount"));<NEW_LINE>List<Metrics> items = new ArrayList<Metrics>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDBInstanceMetricsResponse.Items.Length"); i++) {<NEW_LINE>Metrics metrics = new Metrics();<NEW_LINE>metrics.setGroupKey(_ctx.stringValue("DescribeDBInstanceMetricsResponse.Items[" + i + "].GroupKey"));<NEW_LINE>metrics.setSortRule(_ctx.integerValue("DescribeDBInstanceMetricsResponse.Items[" + i + "].SortRule"));<NEW_LINE>metrics.setDescription(_ctx.stringValue("DescribeDBInstanceMetricsResponse.Items[" + i + "].Description"));<NEW_LINE>metrics.setUnit(_ctx.stringValue("DescribeDBInstanceMetricsResponse.Items[" + i + "].Unit"));<NEW_LINE>metrics.setDbType(_ctx.stringValue("DescribeDBInstanceMetricsResponse.Items[" + i + "].DbType"));<NEW_LINE>metrics.setMetricsKey(_ctx.stringValue("DescribeDBInstanceMetricsResponse.Items[" + i + "].MetricsKey"));<NEW_LINE>metrics.setGroupKeyType(_ctx.stringValue("DescribeDBInstanceMetricsResponse.Items[" + i + "].GroupKeyType"));<NEW_LINE>metrics.setBizMethod(_ctx.stringValue("DescribeDBInstanceMetricsResponse.Items[" + i + "].Method"));<NEW_LINE>metrics.setDimension(_ctx.stringValue<MASK><NEW_LINE>metrics.setMetricsKeyAlias(_ctx.stringValue("DescribeDBInstanceMetricsResponse.Items[" + i + "].MetricsKeyAlias"));<NEW_LINE>items.add(metrics);<NEW_LINE>}<NEW_LINE>describeDBInstanceMetricsResponse.setItems(items);<NEW_LINE>return describeDBInstanceMetricsResponse;<NEW_LINE>} | ("DescribeDBInstanceMetricsResponse.Items[" + i + "].Dimension")); |
1,328,895 | public void save(Context ctx, SharedPreferences prefs) {<NEW_LINE>SharedPreferences.Editor edit = prefs.edit();<NEW_LINE>edit.putString("osmdroid.basePath", getOsmdroidBasePath().getAbsolutePath());<NEW_LINE>edit.putString("osmdroid.cachePath", getOsmdroidTileCache().getAbsolutePath());<NEW_LINE>edit.putBoolean("osmdroid.DebugMode", isDebugMode());<NEW_LINE>edit.putBoolean("osmdroid.DebugDownloading", isDebugMapTileDownloader());<NEW_LINE>edit.putBoolean("osmdroid.DebugMapView", isDebugMapView());<NEW_LINE>edit.putBoolean("osmdroid.DebugTileProvider", isDebugTileProviders());<NEW_LINE>edit.putBoolean("osmdroid.HardwareAcceleration", isMapViewHardwareAccelerated());<NEW_LINE>edit.putBoolean("osmdroid.TileDownloaderFollowRedirects", isMapTileDownloaderFollowRedirects());<NEW_LINE>edit.putString("osmdroid.userAgentValue", getUserAgentValue());<NEW_LINE>save(prefs, edit, mAdditionalHttpRequestProperties, "osmdroid.additionalHttpRequestProperty.");<NEW_LINE>edit.putLong("osmdroid.gpsWaitTime", gpsWaitTime);<NEW_LINE>edit.putInt("osmdroid.cacheMapTileCount", cacheMapTileCount);<NEW_LINE>edit.putInt("osmdroid.tileDownloadThreads", tileDownloadThreads);<NEW_LINE>edit.putInt("osmdroid.tileFileSystemThreads", tileFileSystemThreads);<NEW_LINE>edit.putInt("osmdroid.tileDownloadMaxQueueSize", tileDownloadMaxQueueSize);<NEW_LINE>edit.putInt("osmdroid.tileFileSystemMaxQueueSize", tileFileSystemMaxQueueSize);<NEW_LINE>edit.putLong("osmdroid.ExpirationExtendedDuration", expirationAdder);<NEW_LINE>if (expirationOverride != null)<NEW_LINE><MASK><NEW_LINE>// TODO save other fields?<NEW_LINE>edit.putInt("osmdroid.ZoomSpeedDefault", animationSpeedDefault);<NEW_LINE>edit.putInt("osmdroid.animationSpeedShort", animationSpeedShort);<NEW_LINE>edit.putBoolean("osmdroid.mapViewRecycler", mapViewRecycler);<NEW_LINE>edit.putInt("osmdroid.cacheTileOvershoot", cacheTileOvershoot);<NEW_LINE>commit(edit);<NEW_LINE>} | edit.putLong("osmdroid.ExpirationOverride", expirationOverride); |
322,900 | public PreviousCompilationData read(Decoder decoder) throws Exception {<NEW_LINE>HierarchicalNameSerializer hierarchicalNameSerializer = new HierarchicalNameSerializer(interner);<NEW_LINE>Supplier<HierarchicalNameSerializer> classNameSerializerSupplier = () -> hierarchicalNameSerializer;<NEW_LINE>ClassSetAnalysisData.Serializer analysisSerializer = new ClassSetAnalysisData.Serializer(classNameSerializerSupplier);<NEW_LINE>AnnotationProcessingData.Serializer annotationProcessingDataSerializer = new AnnotationProcessingData.Serializer(classNameSerializerSupplier);<NEW_LINE>CompilerApiData.Serializer compilerApiDataSerializer = new CompilerApiData.Serializer(classNameSerializerSupplier);<NEW_LINE>ClassSetAnalysisData outputSnapshot = analysisSerializer.read(decoder);<NEW_LINE>AnnotationProcessingData <MASK><NEW_LINE>ClassSetAnalysisData classpathSnapshot = analysisSerializer.read(decoder);<NEW_LINE>CompilerApiData compilerApiData = compilerApiDataSerializer.read(decoder);<NEW_LINE>return new PreviousCompilationData(outputSnapshot, annotationProcessingData, classpathSnapshot, compilerApiData);<NEW_LINE>} | annotationProcessingData = annotationProcessingDataSerializer.read(decoder); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.