idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,135,197 | private ChannelFuture finishEncode(final ChannelHandlerContext ctx, ChannelPromise promise) {<NEW_LINE>if (finished) {<NEW_LINE>promise.setSuccess();<NEW_LINE>return promise;<NEW_LINE>}<NEW_LINE>finished = true;<NEW_LINE>final ByteBuf footer = ctx.alloc().heapBuffer(compressor.maxCompressedLength(buffer.readableBytes()) + HEADER_LENGTH);<NEW_LINE>flushBufferedData(footer);<NEW_LINE>footer.ensureWritable(HEADER_LENGTH);<NEW_LINE>final int idx = footer.writerIndex();<NEW_LINE>footer.setLong(idx, MAGIC_NUMBER);<NEW_LINE>footer.setByte(idx + TOKEN_OFFSET, (byte) (BLOCK_TYPE_NON_COMPRESSED | compressionLevel));<NEW_LINE>footer.setInt(idx + COMPRESSED_LENGTH_OFFSET, 0);<NEW_LINE>footer.setInt(idx + DECOMPRESSED_LENGTH_OFFSET, 0);<NEW_LINE>footer.setInt(idx + CHECKSUM_OFFSET, 0);<NEW_LINE><MASK><NEW_LINE>return ctx.writeAndFlush(footer, promise);<NEW_LINE>} | footer.writerIndex(idx + HEADER_LENGTH); |
645,382 | final UpdateRuleResult executeUpdateRule(UpdateRuleRequest updateRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateRuleRequest> request = null;<NEW_LINE>Response<UpdateRuleResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateRuleRequest));<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, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateRuleResultJsonUnmarshaller());<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,578,143 | public static Resource computeTotalResourceChange(TopologyAPI.Topology topology, Map<String, Integer> componentChanges, Resource defaultInstanceResources, ScalingDirection scalingDirection) {<NEW_LINE>double cpu = 0;<NEW_LINE>ByteAmount ram = ByteAmount.ZERO;<NEW_LINE>ByteAmount disk = ByteAmount.ZERO;<NEW_LINE>Map<String, ByteAmount> ramMap = TopologyUtils.getComponentRamMapConfig(topology);<NEW_LINE>Map<String, Integer> componentsToScale = PackingUtils.getComponentsToScale(componentChanges, scalingDirection);<NEW_LINE>for (String component : componentsToScale.keySet()) {<NEW_LINE>int parallelismChange = Math.abs(componentChanges.get(component));<NEW_LINE>cpu += parallelismChange * defaultInstanceResources.getCpu();<NEW_LINE>disk = disk.plus(defaultInstanceResources.getDisk().multiply(parallelismChange));<NEW_LINE>if (ramMap.containsKey(component)) {<NEW_LINE>ram = ram.plus(ramMap.get(component).multiply(parallelismChange));<NEW_LINE>} else {<NEW_LINE>ram = ram.plus(defaultInstanceResources.getRam<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Resource(cpu, ram, disk);<NEW_LINE>} | ().multiply(parallelismChange)); |
74,034 | protected void startCropActivity(Uri uri) {<NEW_LINE>final Context baseContext = getActivity();<NEW_LINE>if (baseContext != null) {<NEW_LINE>final Context context = new ContextThemeWrapper(baseContext, R.style.WordPress_NoActionBar);<NEW_LINE>UCrop.Options options = new UCrop.Options();<NEW_LINE>options.setShowCropGrid(false);<NEW_LINE>options.setStatusBarColor(ContextExtensionsKt.getColorFromAttribute(context, android.R.attr.statusBarColor));<NEW_LINE>options.setToolbarColor(ContextExtensionsKt.getColorFromAttribute(context<MASK><NEW_LINE>options.setToolbarWidgetColor(ContextExtensionsKt.getColorFromAttribute(context, R.attr.colorOnSurface));<NEW_LINE>options.setAllowedGestures(UCropActivity.SCALE, UCropActivity.NONE, UCropActivity.NONE);<NEW_LINE>options.setHideBottomControls(true);<NEW_LINE>UCrop.of(uri, Uri.fromFile(new File(context.getCacheDir(), "cropped.jpg"))).withAspectRatio(1, 1).withOptions(options).start(context, this);<NEW_LINE>}<NEW_LINE>} | , R.attr.wpColorAppBar)); |
726,919 | private boolean suppress(final PsiElement element, final CommonProblemDescriptor descriptor, final SuppressIntentionAction action, final RefEntity refEntity) {<NEW_LINE>final PsiModificationTracker tracker = PsiManager.getInstance(myProject).getModificationTracker();<NEW_LINE>ApplicationManager.getApplication().runWriteAction(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>PsiDocumentManager.<MASK><NEW_LINE>try {<NEW_LINE>final long startModificationCount = tracker.getModificationCount();<NEW_LINE>PsiElement container = null;<NEW_LINE>if (action instanceof SuppressIntentionActionFromFix) {<NEW_LINE>container = ((SuppressIntentionActionFromFix) action).getContainer(element);<NEW_LINE>}<NEW_LINE>if (container == null) {<NEW_LINE>container = element;<NEW_LINE>}<NEW_LINE>if (action.isAvailable(myProject, null, element)) {<NEW_LINE>action.invoke(myProject, null, element);<NEW_LINE>}<NEW_LINE>if (startModificationCount != tracker.getModificationCount()) {<NEW_LINE>final Set<GlobalInspectionContextImpl> globalInspectionContexts = myManager.getRunningContexts();<NEW_LINE>for (GlobalInspectionContextImpl context : globalInspectionContexts) {<NEW_LINE>context.ignoreElement(myToolWrapper.getTool(), container);<NEW_LINE>if (descriptor != null) {<NEW_LINE>context.getPresentation(myToolWrapper).ignoreCurrentElementProblem(refEntity, descriptor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IncorrectOperationException e1) {<NEW_LINE>LOG.error(e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>} | getInstance(myProject).commitAllDocuments(); |
1,394,359 | public static void main(final String[] args) throws Exception {<NEW_LINE>final PlacementDriverOptions pdOpts = // use a fake pd<NEW_LINE>PlacementDriverOptionsConfigured.newConfigured().// use a fake pd<NEW_LINE>withFake(true).config();<NEW_LINE>final //<NEW_LINE>StoreEngineOptions //<NEW_LINE>storeOpts = StoreEngineOptionsConfigured.newConfigured().withStorageType(StorageType.RocksDB).withRocksDBOptions(RocksDBOptionsConfigured.newConfigured().withDbPath(Configs.DB_PATH).config()).withRaftDataPath(Configs.RAFT_DATA_PATH).withServerAddress(new Endpoint("127.0.0.1", 8183)).config();<NEW_LINE>final //<NEW_LINE>RheaKVStoreOptions //<NEW_LINE>opts = //<NEW_LINE>RheaKVStoreOptionsConfigured.newConfigured().//<NEW_LINE>withClusterName(//<NEW_LINE>Configs.CLUSTER_NAME).//<NEW_LINE>withUseParallelCompress(true).withInitialServerList(//<NEW_LINE>Configs.ALL_NODE_ADDRESSES).//<NEW_LINE>withStoreEngineOptions(//<NEW_LINE>storeOpts).//<NEW_LINE>withPlacementDriverOptions(pdOpts).config();<NEW_LINE>System.out.println(opts);<NEW_LINE>final <MASK><NEW_LINE>node.start();<NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread(node::stop));<NEW_LINE>System.out.println("server3 start OK");<NEW_LINE>} | Node node = new Node(opts); |
221,603 | final CreateTestGridProjectResult executeCreateTestGridProject(CreateTestGridProjectRequest createTestGridProjectRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTestGridProjectRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTestGridProjectRequest> request = null;<NEW_LINE>Response<CreateTestGridProjectResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTestGridProjectRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTestGridProjectRequest));<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, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTestGridProject");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateTestGridProjectResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTestGridProjectResultJsonUnmarshaller());<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()); |
1,027,551 | private Mono<FeedResponse<T>> executeRequestAsync(RxDocumentServiceRequest request) {<NEW_LINE>if (this.operationContextAndListener == null) {<NEW_LINE>return client.readFeed(request).map(rsp -> BridgeInternal.toChangeFeedResponsePage(rsp, this.factoryMethod, klass));<NEW_LINE>} else {<NEW_LINE>final OperationListener listener = operationContextAndListener.getOperationListener();<NEW_LINE>final OperationContext operationContext = operationContextAndListener.getOperationContext();<NEW_LINE>request.getHeaders().put(HttpConstants.HttpHeaders.CORRELATED_ACTIVITY_ID, operationContext.getCorrelationActivityId());<NEW_LINE>listener.requestListener(operationContext, request);<NEW_LINE>return client.readFeed(request).map(rsp -> {<NEW_LINE><MASK><NEW_LINE>final FeedResponse<T> feedResponse = BridgeInternal.toChangeFeedResponsePage(rsp, this.factoryMethod, klass);<NEW_LINE>listener.feedResponseReceivedListener(operationContext, feedResponse);<NEW_LINE>return feedResponse;<NEW_LINE>}).doOnError(ex -> listener.exceptionListener(operationContext, ex));<NEW_LINE>}<NEW_LINE>} | listener.responseListener(operationContext, rsp); |
305,816 | public static HTMLPageAsset createPage(final Folder folder, final User user) throws DotDataException, DotSecurityException {<NEW_LINE>final User sysuser = APILocator.getUserAPI().getSystemUser();<NEW_LINE>final Host host = APILocator.getHostAPI().findDefaultHost(sysuser, false);<NEW_LINE>Template template = new Template();<NEW_LINE>template.setTitle("a template " + UUIDGenerator.generateUuid());<NEW_LINE>template.setBody("<html><body> I'm mostly empty </body></html>");<NEW_LINE>template = APILocator.getTemplateAPI().saveTemplate(template, host, sysuser, false);<NEW_LINE>final HTMLPageAsset page = new HTMLPageDataGen(folder, template).languageId(1).nextPersisted();<NEW_LINE>final HTMLPageAsset pageAsset = (HTMLPageAsset) APILocator.getHTMLPageAssetAPI().findPage(page.getInode(), sysuser, false);<NEW_LINE>pageAsset.setIndexPolicy(IndexPolicy.FORCE);<NEW_LINE>pageAsset.setIndexPolicyDependencies(IndexPolicy.FORCE);<NEW_LINE>pageAsset.<MASK><NEW_LINE>APILocator.getContentletAPI().publish(pageAsset, user, false);<NEW_LINE>pageAsset.setIndexPolicy(IndexPolicy.FORCE);<NEW_LINE>pageAsset.setIndexPolicyDependencies(IndexPolicy.FORCE);<NEW_LINE>pageAsset.setBoolProperty(Contentlet.IS_TEST_MODE, true);<NEW_LINE>APILocator.getContentletIndexAPI().addContentToIndex(pageAsset);<NEW_LINE>assertEquals(1, APILocator.getContentletAPI().indexCount("+inode:" + pageAsset.getInode() + " " + UUIDGenerator.ulid(), user, false));<NEW_LINE>return pageAsset;<NEW_LINE>} | setBoolProperty(Contentlet.IS_TEST_MODE, true); |
930,055 | public static DescribeDBNodePerformanceResponse unmarshall(DescribeDBNodePerformanceResponse describeDBNodePerformanceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDBNodePerformanceResponse.setRequestId(_ctx.stringValue("DescribeDBNodePerformanceResponse.RequestId"));<NEW_LINE>describeDBNodePerformanceResponse.setDBVersion(_ctx.stringValue("DescribeDBNodePerformanceResponse.DBVersion"));<NEW_LINE>describeDBNodePerformanceResponse.setEndTime(_ctx.stringValue("DescribeDBNodePerformanceResponse.EndTime"));<NEW_LINE>describeDBNodePerformanceResponse.setStartTime(_ctx.stringValue("DescribeDBNodePerformanceResponse.StartTime"));<NEW_LINE>describeDBNodePerformanceResponse.setDBType(_ctx.stringValue("DescribeDBNodePerformanceResponse.DBType"));<NEW_LINE>describeDBNodePerformanceResponse.setDBNodeId<MASK><NEW_LINE>describeDBNodePerformanceResponse.setEngine(_ctx.stringValue("DescribeDBNodePerformanceResponse.Engine"));<NEW_LINE>List<PerformanceItem> performanceKeys = new ArrayList<PerformanceItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDBNodePerformanceResponse.PerformanceKeys.Length"); i++) {<NEW_LINE>PerformanceItem performanceItem = new PerformanceItem();<NEW_LINE>performanceItem.setMetricName(_ctx.stringValue("DescribeDBNodePerformanceResponse.PerformanceKeys[" + i + "].MetricName"));<NEW_LINE>performanceItem.setMeasurement(_ctx.stringValue("DescribeDBNodePerformanceResponse.PerformanceKeys[" + i + "].Measurement"));<NEW_LINE>List<PerformanceItemValue> points = new ArrayList<PerformanceItemValue>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeDBNodePerformanceResponse.PerformanceKeys[" + i + "].Points.Length"); j++) {<NEW_LINE>PerformanceItemValue performanceItemValue = new PerformanceItemValue();<NEW_LINE>performanceItemValue.setValue(_ctx.stringValue("DescribeDBNodePerformanceResponse.PerformanceKeys[" + i + "].Points[" + j + "].Value"));<NEW_LINE>performanceItemValue.setTimestamp(_ctx.longValue("DescribeDBNodePerformanceResponse.PerformanceKeys[" + i + "].Points[" + j + "].Timestamp"));<NEW_LINE>points.add(performanceItemValue);<NEW_LINE>}<NEW_LINE>performanceItem.setPoints(points);<NEW_LINE>performanceKeys.add(performanceItem);<NEW_LINE>}<NEW_LINE>describeDBNodePerformanceResponse.setPerformanceKeys(performanceKeys);<NEW_LINE>return describeDBNodePerformanceResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeDBNodePerformanceResponse.DBNodeId")); |
1,244,844 | public String handle(Request request, Response response) {<NEW_LINE>PhotonRequest photonRequest = null;<NEW_LINE>try {<NEW_LINE>photonRequest = photonRequestFactory.create(request);<NEW_LINE>} catch (BadRequestException e) {<NEW_LINE>JSONObject json = new JSONObject();<NEW_LINE>json.put("message", e.getMessage());<NEW_LINE>halt(e.getHttpStatus(<MASK><NEW_LINE>}<NEW_LINE>List<PhotonResult> results = requestHandler.search(photonRequest);<NEW_LINE>// Futher filtering<NEW_LINE>results = new StreetDupesRemover(photonRequest.getLanguage()).execute(results);<NEW_LINE>// Restrict to the requested limit.<NEW_LINE>if (results.size() > photonRequest.getLimit()) {<NEW_LINE>results = results.subList(0, photonRequest.getLimit());<NEW_LINE>}<NEW_LINE>String debugInfo = null;<NEW_LINE>if (photonRequest.getDebug()) {<NEW_LINE>debugInfo = requestHandler.dumpQuery(photonRequest);<NEW_LINE>}<NEW_LINE>return new GeocodeJsonFormatter(photonRequest.getDebug(), photonRequest.getLanguage()).convert(results, debugInfo);<NEW_LINE>} | ), json.toString()); |
1,745,842 | static BufferedImage makeArrowImage(Color fillColor, Color backgroundColor, boolean flip) {<NEW_LINE>int height = 18, width = 18;<NEW_LINE>BufferedImage im = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>Graphics2D g = im.createGraphics();<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>// g.setColor(backgroundColor);<NEW_LINE>g.setColor(new Color(0, 0, 0, 0));<NEW_LINE>// g.setColor(new Color(0,0,255,128));<NEW_LINE>g.fillRect(0, 0, width, height);<NEW_LINE>if (flip) {<NEW_LINE>g.translate(width - 1, height / 2);<NEW_LINE>g.scale(-<MASK><NEW_LINE>} else {<NEW_LINE>g.translate(0, height / 2);<NEW_LINE>g.scale(height / 2, height / 2);<NEW_LINE>}<NEW_LINE>g.setStroke(new BasicStroke(0f));<NEW_LINE>GeneralPath gp = new GeneralPath();<NEW_LINE>gp.moveTo(0, -1);<NEW_LINE>gp.lineTo(1, 0);<NEW_LINE>gp.lineTo(0, 1);<NEW_LINE>gp.lineTo(0, -1);<NEW_LINE>g.setColor(fillColor);<NEW_LINE>g.fill(gp);<NEW_LINE>g.setColor(Color.black);<NEW_LINE>// g.draw(gp);<NEW_LINE>g.translate(.75, 0);<NEW_LINE>g.setColor(fillColor);<NEW_LINE>g.fill(gp);<NEW_LINE>g.setColor(Color.black);<NEW_LINE>// g.draw(gp);<NEW_LINE>return im;<NEW_LINE>} | height / 2, height / 2); |
1,265,071 | final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "GameLift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<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); |
757,373 | public void start(Stage stage) throws Exception {<NEW_LINE>final VBox pane = new VBox();<NEW_LINE>pane.setSpacing(30);<NEW_LINE>pane.setStyle("-fx-background-color:WHITE;-fx-padding:40;");<NEW_LINE>pane.getChildren().add(new TextField());<NEW_LINE>JFXTextField field = new JFXTextField();<NEW_LINE>field.setLabelFloat(true);<NEW_LINE>field.setPromptText("Type Something");<NEW_LINE>pane.getChildren().add(field);<NEW_LINE>JFXTextField disabledField = new JFXTextField();<NEW_LINE>disabledField.setStyle(FX_LABEL_FLOAT_TRUE);<NEW_LINE>disabledField.setPromptText("I'm disabled..");<NEW_LINE>disabledField.setDisable(true);<NEW_LINE>pane.getChildren().add(disabledField);<NEW_LINE>JFXTextField validationField = new JFXTextField();<NEW_LINE>validationField.setPromptText("With Validation..");<NEW_LINE>RequiredFieldValidator validator = new RequiredFieldValidator();<NEW_LINE>validator.setMessage("Input Required");<NEW_LINE>FontIcon warnIcon = new FontIcon(FontAwesomeSolid.EXCLAMATION_TRIANGLE);<NEW_LINE>warnIcon.getStyleClass().add(ERROR);<NEW_LINE>validator.setIcon(warnIcon);<NEW_LINE>validationField.getValidators().add(validator);<NEW_LINE>validationField.focusedProperty().addListener((o, oldVal, newVal) -> {<NEW_LINE>if (!newVal) {<NEW_LINE>validationField.validate();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>pane.<MASK><NEW_LINE>JFXPasswordField passwordField = new JFXPasswordField();<NEW_LINE>passwordField.setStyle(FX_LABEL_FLOAT_TRUE);<NEW_LINE>passwordField.setPromptText("Password");<NEW_LINE>validator = new RequiredFieldValidator();<NEW_LINE>validator.setMessage("Password Can't be empty");<NEW_LINE>warnIcon = new FontIcon(FontAwesomeSolid.EXCLAMATION_TRIANGLE);<NEW_LINE>warnIcon.getStyleClass().add(ERROR);<NEW_LINE>validator.setIcon(warnIcon);<NEW_LINE>passwordField.getValidators().add(validator);<NEW_LINE>passwordField.focusedProperty().addListener((o, oldVal, newVal) -> {<NEW_LINE>if (!newVal) {<NEW_LINE>passwordField.validate();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>pane.getChildren().add(passwordField);<NEW_LINE>final Scene scene = new Scene(pane, 600, 400, Color.WHITE);<NEW_LINE>scene.getStylesheets().add(TextFieldDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());<NEW_LINE>stage.setTitle("JFX TextField Demo ");<NEW_LINE>stage.setScene(scene);<NEW_LINE>stage.setResizable(false);<NEW_LINE>stage.show();<NEW_LINE>} | getChildren().add(validationField); |
1,474,895 | protected void select_instances() {<NEW_LINE>List<Object<MASK><NEW_LINE>if (selected_violations.size() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>java.util.Set<app.freerouting.board.Item> selected_items = new java.util.TreeSet<app.freerouting.board.Item>();<NEW_LINE>for (int i = 0; i < selected_violations.size(); ++i) {<NEW_LINE>ClearanceViolation curr_violation = ((ViolationInfo) selected_violations.get(i)).violation;<NEW_LINE>selected_items.add(curr_violation.first_item);<NEW_LINE>selected_items.add(curr_violation.second_item);<NEW_LINE>}<NEW_LINE>app.freerouting.interactive.BoardHandling board_handling = board_frame.board_panel.board_handling;<NEW_LINE>board_handling.select_items(selected_items);<NEW_LINE>board_handling.toggle_selected_item_violations();<NEW_LINE>board_handling.zoom_selection();<NEW_LINE>} | > selected_violations = list.getSelectedValuesList(); |
688,958 | protected void tr(OWLDeclarationAxiom axiom) {<NEW_LINE>OWLEntity entity = axiom.getEntity();<NEW_LINE>if (entity.isBottomEntity() || entity.isTopEntity()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<OWLAnnotationAssertionAxiom> set = asList(owlOntology.annotationAssertionAxioms(entity.getIRI()));<NEW_LINE>if (set.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean isClass = entity.isOWLClass();<NEW_LINE>boolean isObjectProperty = entity.isOWLObjectProperty();<NEW_LINE>// check whether the entity is an alt_id<NEW_LINE>Optional<OboAltIdCheckResult> altIdOptional = checkForOboAltId(set);<NEW_LINE>if (altIdOptional.isPresent()) {<NEW_LINE>// the entity will not be translated<NEW_LINE>// instead create the appropriate alt_id in the replaced_by frame<NEW_LINE>String currentId = getIdentifier(entity.getIRI());<NEW_LINE>addAltId(altIdOptional.get().replacedBy, currentId, isClass, isObjectProperty);<NEW_LINE>// add unrelated annotations to untranslatableAxioms axioms<NEW_LINE>untranslatableAxioms.addAll(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// translate<NEW_LINE>Frame f = null;<NEW_LINE>if (isClass) {<NEW_LINE>f = getTermFrame(entity.asOWLClass());<NEW_LINE>} else if (isObjectProperty) {<NEW_LINE>f = getTypedefFrame(entity.asOWLObjectProperty());<NEW_LINE>} else if (entity.isOWLAnnotationProperty()) {<NEW_LINE>for (OWLAnnotationAssertionAxiom ax : set) {<NEW_LINE>OWLAnnotationProperty prop = ax.getProperty();<NEW_LINE>String tag = owlObjectToTag(prop);<NEW_LINE>if (OboFormatTag.TAG_IS_METADATA_TAG.getTag().equals(tag)) {<NEW_LINE>f = getTypedefFrame(entity);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (f != null) {<NEW_LINE>Frame f1 = f;<NEW_LINE>set.forEach(a -> tr(a, f1));<NEW_LINE>add(f);<NEW_LINE>}<NEW_LINE>} | altIdOptional.get().unrelated); |
720,785 | public void save(RowBasedPartition part, MatrixPartitionMeta partMeta, PSMatrixSaveContext saveContext, DataOutputStream output) throws IOException {<NEW_LINE>List<Integer> rowIds = saveContext.getRowIndexes();<NEW_LINE>ServerRowsStorage rows = part.getRowsStorage();<NEW_LINE>if (rowIds == null || rowIds.isEmpty()) {<NEW_LINE>int rowStart = part.getPartitionKey().getStartRow();<NEW_LINE>int rowEnd = part<MASK><NEW_LINE>rowIds = new ArrayList<>(rowEnd - rowStart);<NEW_LINE>for (int i = rowStart; i < rowEnd; i++) {<NEW_LINE>rowIds.add(i);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>rowIds = filter(part, rowIds);<NEW_LINE>}<NEW_LINE>FSDataOutputStream dataOutputStream = new FSDataOutputStream(output, null, partMeta != null ? partMeta.getOffset() : 0);<NEW_LINE>partMeta.setSaveRowNum(rowIds.size());<NEW_LINE>for (int rowId : rowIds) {<NEW_LINE>ServerRow row = rows.getRow(rowId);<NEW_LINE>RowPartitionMeta rowMeta = new RowPartitionMeta(rowId, 0, 0);<NEW_LINE>if (row != null) {<NEW_LINE>rowMeta.setElementNum(row.size());<NEW_LINE>rowMeta.setOffset(dataOutputStream.getPos());<NEW_LINE>if (row.isDense()) {<NEW_LINE>rowMeta.setSaveType(SaveType.DENSE.getTypeId());<NEW_LINE>} else {<NEW_LINE>rowMeta.setSaveType(SaveType.SPARSE.getTypeId());<NEW_LINE>}<NEW_LINE>save(rows.getRow(rowId), saveContext, partMeta, output);<NEW_LINE>} else {<NEW_LINE>rowMeta.setElementNum(0);<NEW_LINE>rowMeta.setOffset(dataOutputStream.getPos());<NEW_LINE>}<NEW_LINE>partMeta.setRowMeta(rowMeta);<NEW_LINE>}<NEW_LINE>} | .getPartitionKey().getEndRow(); |
1,648,636 | protected Map<String, Object> convertMap(Map<String, Object> obj, long features, Set<String> ignoreProperty) {<NEW_LINE>if (ignoreProperty.isEmpty()) {<NEW_LINE>return obj;<NEW_LINE>}<NEW_LINE>boolean cover = ToString.Feature.hasFeature(features, coverIgnoreProperty);<NEW_LINE>boolean isNullPropertyToEmpty = ToString.Feature.hasFeature(features, nullPropertyToEmpty);<NEW_LINE>boolean isDisableNestProperty = ToString.Feature.hasFeature(features, disableNestProperty);<NEW_LINE>Map<String, Object> newMap = new HashMap<>(obj);<NEW_LINE>Set<String> ignore = new HashSet<<MASK><NEW_LINE>ignore.addAll(defaultIgnoreProperties);<NEW_LINE>for (Map.Entry<String, Object> entry : newMap.entrySet()) {<NEW_LINE>Object value = entry.getValue();<NEW_LINE>if (value == null) {<NEW_LINE>if (isNullPropertyToEmpty) {<NEW_LINE>entry.setValue("");<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Class<?> type = value.getClass();<NEW_LINE>if (simpleTypePredicate.test(type)) {<NEW_LINE>value = simpleConvertBuilder.apply(type).apply(value, null);<NEW_LINE>if (ignoreProperty.contains(entry.getKey())) {<NEW_LINE>if (cover) {<NEW_LINE>value = coverStringConvert.apply(value);<NEW_LINE>} else {<NEW_LINE>ignore.add(entry.getKey());<NEW_LINE>}<NEW_LINE>entry.setValue(value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isDisableNestProperty) {<NEW_LINE>ignore.add(entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ignore.forEach(newMap::remove);<NEW_LINE>return newMap;<NEW_LINE>} | >(ignoreProperty.size()); |
1,808,020 | protected CsvReporter createInstance() {<NEW_LINE>final CsvReporter.Builder reporter = CsvReporter.forRegistry(getMetricRegistry());<NEW_LINE>if (hasProperty(DURATION_UNIT)) {<NEW_LINE>reporter.convertDurationsTo(getProperty(DURATION_UNIT, TimeUnit.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(RATE_UNIT)) {<NEW_LINE>reporter.convertRatesTo(getProperty(RATE_UNIT, TimeUnit.class));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (hasProperty(CLOCK_REF)) {<NEW_LINE>reporter.withClock(getPropertyRef(CLOCK_REF, Clock.class));<NEW_LINE>}<NEW_LINE>if (hasProperty(LOCALE)) {<NEW_LINE>reporter.formatFor(parseLocale(getProperty(LOCALE)));<NEW_LINE>}<NEW_LINE>File dir = new File(getProperty(DIRECTORY));<NEW_LINE>if (!dir.mkdirs() && !dir.isDirectory()) {<NEW_LINE>throw new IllegalArgumentException("Directory doesn't exist or couldn't be created");<NEW_LINE>}<NEW_LINE>return reporter.build(dir);<NEW_LINE>} | reporter.filter(getMetricFilter()); |
1,666,547 | public static BenchmarkClassModel create(Class<?> clazz) {<NEW_LINE>if (!clazz.getSuperclass().equals(Object.class)) {<NEW_LINE>throw new InvalidBenchmarkException("Class '%s' must not extend any class other than %s. Prefer composition.", clazz, Object.class);<NEW_LINE>}<NEW_LINE>if (Modifier.isAbstract(clazz.getModifiers())) {<NEW_LINE>throw new InvalidBenchmarkException("Class '%s' is abstract", clazz);<NEW_LINE>}<NEW_LINE>BenchmarkClassModel.Builder builder = new AutoValue_BenchmarkClassModel.Builder().setName(clazz.getName()).setSimpleName(clazz.getSimpleName());<NEW_LINE>for (Method method : clazz.getDeclaredMethods()) {<NEW_LINE>builder.methodsBuilder().add(MethodModel.of(method));<NEW_LINE>}<NEW_LINE>for (Field field : clazz.getDeclaredFields()) {<NEW_LINE>if (field.isAnnotationPresent(Param.class)) {<NEW_LINE>builder.parametersBuilder().put(field.getName(), Parameters.validateAndGetDefaults(field));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>VmOptions vmOptions = <MASK><NEW_LINE>if (vmOptions != null) {<NEW_LINE>builder.vmOptionsBuilder().add(vmOptions.value());<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | clazz.getAnnotation(VmOptions.class); |
610,411 | public INDArray sample(long[] shape) {<NEW_LINE>long numRows = 1;<NEW_LINE>for (int i = 0; i < shape.length - 1; i++) numRows *= shape[i];<NEW_LINE>long numCols = shape[shape.length - 1];<NEW_LINE>val dtype = Nd4j.defaultFloatingPointType();<NEW_LINE>val flatShape = new <MASK><NEW_LINE>val flatRng = Nd4j.getExecutioner().exec(new GaussianDistribution(Nd4j.createUninitialized(dtype, flatShape, Nd4j.order()), 0.0, 1.0), random);<NEW_LINE>val m = flatRng.rows();<NEW_LINE>val n = flatRng.columns();<NEW_LINE>val s = Nd4j.create(dtype, m < n ? m : n);<NEW_LINE>val u = Nd4j.create(dtype, m, m);<NEW_LINE>val v = Nd4j.create(dtype, new long[] { n, n }, 'f');<NEW_LINE>Nd4j.exec(new Svd(flatRng, true, s, u, v));<NEW_LINE>if (gains == null) {<NEW_LINE>if (u.rows() >= numRows && u.columns() >= numCols) {<NEW_LINE>return u.get(NDArrayIndex.interval(0, numRows), NDArrayIndex.interval(0, numCols)).mul(gain).reshape(shape);<NEW_LINE>} else {<NEW_LINE>return v.get(NDArrayIndex.interval(0, numRows), NDArrayIndex.interval(0, numCols)).mul(gain).reshape(shape);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>}<NEW_LINE>} | long[] { numRows, numCols }; |
709,565 | public SolrQueryResponse query(SolrQueryRequest req) throws SolrException {<NEW_LINE>final long startTime = System.currentTimeMillis();<NEW_LINE>// during the solr query we set the thread name to the query string to get more debugging info in thread dumps<NEW_LINE>final String threadname = Thread.currentThread().getName();<NEW_LINE>String ql = "";<NEW_LINE>try {<NEW_LINE>ql = URLDecoder.decode(req.getParams().toString(), StandardCharsets.UTF_8.name());<NEW_LINE>} catch (final UnsupportedEncodingException e) {<NEW_LINE>}<NEW_LINE>// for debugging in Threaddump<NEW_LINE>Thread.currentThread().setName("Embedded solr query: " + ql);<NEW_LINE>ConcurrentLog.fine("EmbeddedSolrConnector.query", "QUERY: " + ql);<NEW_LINE><MASK><NEW_LINE>final NamedList<Object> responseHeader = new SimpleOrderedMap<>();<NEW_LINE>responseHeader.add("params", req.getOriginalParams().toNamedList());<NEW_LINE>rsp.add("responseHeader", responseHeader);<NEW_LINE>// SolrRequestInfo.setRequestInfo(new SolrRequestInfo(req, rsp));<NEW_LINE>// send request to solr and create a result<NEW_LINE>this.requestHandler.handleRequest(req, rsp);<NEW_LINE>// get statistics and add a header with that<NEW_LINE>final Exception exception = rsp.getException();<NEW_LINE>final int status = exception == null ? 0 : exception instanceof SolrException ? ((SolrException) exception).code() : 500;<NEW_LINE>responseHeader.add("status", status);<NEW_LINE>responseHeader.add("QTime", (int) (System.currentTimeMillis() - startTime));<NEW_LINE>Thread.currentThread().setName(threadname);<NEW_LINE>// return result<NEW_LINE>return rsp;<NEW_LINE>} | final SolrQueryResponse rsp = new SolrQueryResponse(); |
687,226 | private BaseExpireSnapshotsActionResult deleteFiles(Iterator<Row> expired) {<NEW_LINE>AtomicLong dataFileCount = new AtomicLong(0L);<NEW_LINE>AtomicLong manifestCount = new AtomicLong(0L);<NEW_LINE>AtomicLong manifestListCount = new AtomicLong(0L);<NEW_LINE>Tasks.foreach(expired).retry(3).stopRetryOn(NotFoundException.class).suppressFailureWhenFinished().executeWith(deleteExecutorService).onFailure((fileInfo, exc) -> {<NEW_LINE>String file = fileInfo.getString(0);<NEW_LINE>String type = fileInfo.getString(1);<NEW_LINE>LOG.warn("Delete failed for {}: {}", type, file, exc);<NEW_LINE>}).run(fileInfo -> {<NEW_LINE>String file = fileInfo.getString(0);<NEW_LINE>String type = fileInfo.getString(1);<NEW_LINE>deleteFunc.accept(file);<NEW_LINE>switch(type) {<NEW_LINE>case CONTENT_FILE:<NEW_LINE>dataFileCount.incrementAndGet();<NEW_LINE>LOG.trace("Deleted Content File: {}", file);<NEW_LINE>break;<NEW_LINE>case MANIFEST:<NEW_LINE>manifestCount.incrementAndGet();<NEW_LINE>LOG.debug("Deleted Manifest: {}", file);<NEW_LINE>break;<NEW_LINE>case MANIFEST_LIST:<NEW_LINE>manifestListCount.incrementAndGet();<NEW_LINE>LOG.debug("Deleted Manifest List: {}", file);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>LOG.info("Deleted {} total files", dataFileCount.get() + manifestCount.get() + manifestListCount.get());<NEW_LINE>return new BaseExpireSnapshotsActionResult(dataFileCount.get(), manifestCount.get(<MASK><NEW_LINE>} | ), manifestListCount.get()); |
1,260,613 | protected void configure() {<NEW_LINE>if (options.enablePreemptor) {<NEW_LINE>LOG.info("Preemptor Enabled.");<NEW_LINE>bind(PreemptorMetrics.class).in(Singleton.class);<NEW_LINE>bind(Preemptor.class).to(Preemptor.PreemptorImpl.class);<NEW_LINE>bind(Preemptor.PreemptorImpl.class<MASK><NEW_LINE>bind(new TypeLiteral<Amount<Long, Time>>() {<NEW_LINE>}).annotatedWith(PendingTaskProcessor.PreemptionDelay.class).toInstance(options.preemptionDelay);<NEW_LINE>bind(BiCacheSettings.class).toInstance(new BiCacheSettings(options.preemptionSlotHoldTime, "preemption_slot"));<NEW_LINE>bind(new TypeLiteral<BiCache<PreemptionProposal, TaskGroupKey>>() {<NEW_LINE>}).in(Singleton.class);<NEW_LINE>bind(new TypeLiteral<Integer>() {<NEW_LINE>}).annotatedWith(PendingTaskProcessor.ReservationBatchSize.class).toInstance(options.reservationMaxBatchSize);<NEW_LINE>for (Module module : MoreModules.instantiateAll(options.slotFinderModules, cliOptions)) {<NEW_LINE>install(module);<NEW_LINE>}<NEW_LINE>// We need to convert the initial delay time unit to be the same as the search interval<NEW_LINE>long preemptionSlotSearchInitialDelay = options.preemptionSlotSearchInitialDelay.as(options.preemptionSlotSearchInterval.getUnit());<NEW_LINE>bind(PreemptorService.class).in(Singleton.class);<NEW_LINE>bind(AbstractScheduledService.Scheduler.class).toInstance(AbstractScheduledService.Scheduler.newFixedRateSchedule(preemptionSlotSearchInitialDelay, options.preemptionSlotSearchInterval.getValue(), options.preemptionSlotSearchInterval.getUnit().getTimeUnit()));<NEW_LINE>expose(PreemptorService.class);<NEW_LINE>expose(Runnable.class).annotatedWith(PreemptionSlotFinder.class);<NEW_LINE>} else {<NEW_LINE>bind(Preemptor.class).toInstance(NULL_PREEMPTOR);<NEW_LINE>LOG.warn("Preemptor Disabled.");<NEW_LINE>}<NEW_LINE>expose(Preemptor.class);<NEW_LINE>} | ).in(Singleton.class); |
808,576 | public static Map<String, Object> encodeRuleDescriptionToMap(RuleDescription ruleDescription) {<NEW_LINE>HashMap<String, Object> descriptionMap = new HashMap<>();<NEW_LINE>if (ruleDescription.getFilter() instanceof SqlFilter) {<NEW_LINE>HashMap<String, Object> filterMap = new HashMap<>();<NEW_LINE>filterMap.put(ClientConstants.REQUEST_RESPONSE_EXPRESSION, ((SqlFilter) ruleDescription.getFilter()).getSqlExpression());<NEW_LINE>descriptionMap.put(ClientConstants.REQUEST_RESPONSE_SQLFILTER, filterMap);<NEW_LINE>} else if (ruleDescription.getFilter() instanceof CorrelationFilter) {<NEW_LINE>CorrelationFilter correlationFilter = (CorrelationFilter) ruleDescription.getFilter();<NEW_LINE>HashMap<String, Object> <MASK><NEW_LINE>filterMap.put(ClientConstants.REQUEST_RESPONSE_CORRELATION_ID, correlationFilter.getCorrelationId());<NEW_LINE>filterMap.put(ClientConstants.REQUEST_RESPONSE_MESSAGE_ID, correlationFilter.getMessageId());<NEW_LINE>filterMap.put(ClientConstants.REQUEST_RESPONSE_TO, correlationFilter.getTo());<NEW_LINE>filterMap.put(ClientConstants.REQUEST_RESPONSE_REPLY_TO, correlationFilter.getReplyTo());<NEW_LINE>filterMap.put(ClientConstants.REQUEST_RESPONSE_LABEL, correlationFilter.getLabel());<NEW_LINE>filterMap.put(ClientConstants.REQUEST_RESPONSE_SESSION_ID, correlationFilter.getSessionId());<NEW_LINE>filterMap.put(ClientConstants.REQUEST_RESPONSE_REPLY_TO_SESSION_ID, correlationFilter.getReplyToSessionId());<NEW_LINE>filterMap.put(ClientConstants.REQUEST_RESPONSE_CONTENT_TYPE, correlationFilter.getContentType());<NEW_LINE>filterMap.put(ClientConstants.REQUEST_RESPONSE_CORRELATION_FILTER_PROPERTIES, correlationFilter.getProperties());<NEW_LINE>descriptionMap.put(ClientConstants.REQUEST_RESPONSE_CORRELATION_FILTER, filterMap);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("This API supports the addition of only SQLFilters and CorrelationFilters.");<NEW_LINE>}<NEW_LINE>if (ruleDescription.getAction() == null) {<NEW_LINE>descriptionMap.put(ClientConstants.REQUEST_RESPONSE_SQLRULEACTION, null);<NEW_LINE>} else if (ruleDescription.getAction() instanceof SqlRuleAction) {<NEW_LINE>HashMap<String, Object> sqlActionMap = new HashMap<>();<NEW_LINE>sqlActionMap.put(ClientConstants.REQUEST_RESPONSE_EXPRESSION, ((SqlRuleAction) ruleDescription.getAction()).getSqlExpression());<NEW_LINE>descriptionMap.put(ClientConstants.REQUEST_RESPONSE_SQLRULEACTION, sqlActionMap);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("This API supports the addition of only filters with SqlRuleActions.");<NEW_LINE>}<NEW_LINE>descriptionMap.put(ClientConstants.REQUEST_RESPONSE_RULENAME, ruleDescription.getName());<NEW_LINE>return descriptionMap;<NEW_LINE>} | filterMap = new HashMap<>(); |
1,709,903 | private static void restoreResumedTaskReports(ResumeState resume, LoaderState state) {<NEW_LINE>int inputTaskCount = resume.getInputTaskReports().size();<NEW_LINE>int outputTaskCount = resume.getOutputTaskReports().size();<NEW_LINE>state.initialize(inputTaskCount, outputTaskCount);<NEW_LINE>for (int i = 0; i < inputTaskCount; i++) {<NEW_LINE>Optional<TaskReport> report = resume.getInputTaskReports().get(i);<NEW_LINE>if (report.isPresent()) {<NEW_LINE>TaskState task = state.getInputTaskState(i);<NEW_LINE>task.start();<NEW_LINE>task.setTaskReport(report.get());<NEW_LINE>task.finish();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < outputTaskCount; i++) {<NEW_LINE>Optional<TaskReport> report = resume.<MASK><NEW_LINE>if (report.isPresent()) {<NEW_LINE>TaskState task = state.getOutputTaskState(i);<NEW_LINE>task.start();<NEW_LINE>task.setTaskReport(report.get());<NEW_LINE>task.finish();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getOutputTaskReports().get(i); |
420,511 | public void __setitem__(org.python.Object index, org.python.Object value) {<NEW_LINE>try {<NEW_LINE>int idx;<NEW_LINE>if (index instanceof org.python.types.Bool) {<NEW_LINE>idx = (int) ((org.python.types.Bool) <MASK><NEW_LINE>} else {<NEW_LINE>idx = (int) ((org.python.types.Int) index).value;<NEW_LINE>}<NEW_LINE>if (idx < 0) {<NEW_LINE>if (-idx > this.value.size()) {<NEW_LINE>throw new org.python.exceptions.IndexError("list assignment index out of range");<NEW_LINE>} else {<NEW_LINE>this.value.set(this.value.size() + idx, value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (idx >= this.value.size()) {<NEW_LINE>throw new org.python.exceptions.IndexError("list assignment index out of range");<NEW_LINE>} else {<NEW_LINE>this.value.set(idx, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>if (org.Python.VERSION < 0x03050000) {<NEW_LINE>throw new org.python.exceptions.TypeError("list indices must be integers, not " + index.typeName());<NEW_LINE>} else {<NEW_LINE>throw new org.python.exceptions.TypeError("list indices must be integers or slices, not " + index.typeName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | index).__int__().value; |
1,289,447 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath pathA = new RegressionPath();<NEW_LINE>env.compileDeploy("module A;\n @name('createA') @protected create window MyWindow#keepall as SupportBean", pathA);<NEW_LINE>RegressionPath pathB = new RegressionPath();<NEW_LINE>env.compileDeploy("module B;\n @name('createB') @protected create window MyWindow#keepall as SupportBean", pathB);<NEW_LINE>env.compileDeploy("module B; @name('B1') select * from MyWindow", pathB);<NEW_LINE>env.compileDeploy("module A; @name('A1') select * from MyWindow", pathA);<NEW_LINE>env.compileDeploy("module A; @name('A2') select * from MyWindow", pathA);<NEW_LINE>env.compileDeploy("module B; @name('B2') select * from MyWindow", pathB);<NEW_LINE>assertProvided(env, env.deploymentId("createA"), makeProvided(EPObjectType.NAMEDWINDOW, "MyWindow", env.deploymentId("A1"), env.deploymentId("A2")));<NEW_LINE>assertProvided(env, env.deploymentId("createB"), makeProvided(EPObjectType.NAMEDWINDOW, "MyWindow", env.deploymentId("B1"), env.deploymentId("B2")));<NEW_LINE>for (String name : new String[] { "A1", "A2" }) {<NEW_LINE>assertConsumed(env, env.deploymentId(name), new EPDeploymentDependencyConsumed.Item(env.deploymentId("createA"), EPObjectType.NAMEDWINDOW, "MyWindow"));<NEW_LINE>}<NEW_LINE>for (String name : new String[] { "B1", "B2" }) {<NEW_LINE>assertConsumed(env, env.deploymentId(name), new EPDeploymentDependencyConsumed.Item(env.deploymentId("createB")<MASK><NEW_LINE>}<NEW_LINE>env.undeployAll();<NEW_LINE>} | , EPObjectType.NAMEDWINDOW, "MyWindow")); |
102,775 | private void placeSlimefunBlock(SlimefunItem sfItem, ItemStack item, Block block, Dispenser dispenser) {<NEW_LINE>BlockPlacerPlaceEvent e = new BlockPlacerPlaceEvent(dispenser.getBlock(), item, block);<NEW_LINE>Bukkit.getPluginManager().callEvent(e);<NEW_LINE>if (!e.isCancelled()) {<NEW_LINE>boolean hasItemHandler = sfItem.callItemHandler(BlockPlaceHandler.class, handler -> {<NEW_LINE>if (handler.isBlockPlacerAllowed()) {<NEW_LINE>schedulePlacement(block, dispenser.getInventory(), item, () -> {<NEW_LINE>block.<MASK><NEW_LINE>BlockStorage.store(block, sfItem.getId());<NEW_LINE>handler.onBlockPlacerPlace(e);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (!hasItemHandler) {<NEW_LINE>schedulePlacement(block, dispenser.getInventory(), item, () -> {<NEW_LINE>block.setType(item.getType());<NEW_LINE>BlockStorage.store(block, sfItem.getId());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setType(item.getType()); |
1,441,950 | final DeleteServiceResult executeDeleteService(DeleteServiceRequest deleteServiceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteServiceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteServiceRequest> request = null;<NEW_LINE>Response<DeleteServiceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteServiceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteServiceRequest));<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, "Proton");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteService");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteServiceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteServiceResultJsonUnmarshaller());<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()); |
1,745,019 | public ListAttachedIndicesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListAttachedIndicesResult listAttachedIndicesResult = new ListAttachedIndicesResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listAttachedIndicesResult;<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("IndexAttachments", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAttachedIndicesResult.setIndexAttachments(new ListUnmarshaller<IndexAttachment>(IndexAttachmentJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAttachedIndicesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listAttachedIndicesResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
325,737 | public static P createSmartArt(String layoutRelId, String dataRelId, String colorsRelId, String styleRelId, String cx, String cy) throws Exception {<NEW_LINE>String ml = "<w:p xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">" + "<w:r>" + "<w:rPr>" + "<w:noProof/>" + "<w:lang w:eastAsia=\"en-AU\"/>" + "</w:rPr>" + "<w:drawing>" + "<wp:inline distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" >" + "<wp:extent cx=\"${cx}\" cy=\"${cy}\"/>" + "<wp:effectExtent l=\"0\" t=\"0\" r=\"0\" b=\"0\"/>" + "<wp:docPr id=\"1\" name=\"Diagram 1\"/>" + "<wp:cNvGraphicFramePr/>" + "<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">" + "<a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/diagram\">" + "<dgm:relIds r:dm=\"${dataRelId}\" r:lo=\"${layoutRelId}\" r:qs=\"${styleRelId}\" r:cs=\"${colorsRelId}\" xmlns:dgm=\"http://schemas.openxmlformats.org/drawingml/2006/diagram\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"/>" + "</a:graphicData>" + "</a:graphic>" + "</wp:inline>" + "</w:drawing>" + "</w:r>" + "</w:p>";<NEW_LINE>java.util.HashMap<String, String> mappings = new java.util.HashMap<String, String>();<NEW_LINE>mappings.put("layoutRelId", layoutRelId);<NEW_LINE>mappings.put("dataRelId", dataRelId);<NEW_LINE>mappings.put("colorsRelId", colorsRelId);<NEW_LINE>mappings.put("styleRelId", styleRelId);<NEW_LINE>mappings.put("cx", cx);<NEW_LINE>mappings.put("cy", cy);<NEW_LINE>return (P) org.docx4j.<MASK><NEW_LINE>} | XmlUtils.unmarshallFromTemplate(ml, mappings); |
66,288 | public EmailSettings unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EmailSettings emailSettings = new EmailSettings();<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("emailMessage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>emailSettings.setEmailMessage(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("emailSubject", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>emailSettings.setEmailSubject(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 emailSettings;<NEW_LINE>} | class).unmarshall(context)); |
496,880 | private Layout createLayout(final float textWidth, @Nullable Layout previousLayout) {<NEW_LINE>Layout layout;<NEW_LINE>if (previousWidth != textWidth || previousLayout == null) {<NEW_LINE>layout = new StaticLayout(spanned, mTextPaint, (int) Math.ceil(textWidth), Layout.Alignment.ALIGN_NORMAL, 1, 0, false);<NEW_LINE>} else {<NEW_LINE>layout = previousLayout;<NEW_LINE>}<NEW_LINE>if (mNumberOfLines != UNSET && mNumberOfLines > 0 && mNumberOfLines < layout.getLineCount()) {<NEW_LINE>int lastLineStart, lastLineEnd;<NEW_LINE>lastLineStart = layout.getLineStart(mNumberOfLines - 1);<NEW_LINE>lastLineEnd = layout.getLineEnd(mNumberOfLines - 1);<NEW_LINE>if (lastLineStart < lastLineEnd) {<NEW_LINE>SpannableStringBuilder builder = null;<NEW_LINE>if (lastLineStart > 0) {<NEW_LINE>builder = new SpannableStringBuilder(spanned.subSequence(0, lastLineStart));<NEW_LINE>} else {<NEW_LINE>builder = new SpannableStringBuilder();<NEW_LINE>}<NEW_LINE>Editable lastLine = new SpannableStringBuilder(spanned.subSequence(lastLineStart, lastLineEnd));<NEW_LINE>builder.append(truncate(lastLine, mTextPaint, (int) Math.ceil(textWidth), textOverflow));<NEW_LINE>adjustSpansRange(spanned, builder);<NEW_LINE>spanned = builder;<NEW_LINE>return new StaticLayout(spanned, mTextPaint, (int) Math.ceil(textWidth), Layout.Alignment.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return layout;<NEW_LINE>} | ALIGN_NORMAL, 1, 0, false); |
1,679,737 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>// Inflate the layout for this fragment<NEW_LINE>View view = inflater.inflate(R.layout.fragment_arp_replay_dialog, container, false);<NEW_LINE>getDialog().setTitle("ARP Replay Attack");<NEW_LINE>btnArpStart = (Button) view.findViewById(R.id.btn_start_arpreplay);<NEW_LINE>spinnerStations = (Spinner) view.findViewById(R.id.spinner_arpreplay_stations);<NEW_LINE>// btnSelectArpFile = (Button) view.findViewById(R.id.btn_arpreplay_arp_file);<NEW_LINE>// cbUseArpFile = (CheckBox) view.findViewById(R.id.cb_arpreplay_use_arp_file);<NEW_LINE>ArrayList<String> stations = new ArrayList<String>();<NEW_LINE>stations.addAll(ap.getStations().keySet());<NEW_LINE>stationsAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_item, stations);<NEW_LINE>stationsAdapter.setDropDownViewResource(<MASK><NEW_LINE>spinnerStations.setAdapter(stationsAdapter);<NEW_LINE>btnArpStart.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>try {<NEW_LINE>String station = ((String) spinnerStations.getSelectedItem()).trim();<NEW_LINE>attack = new ArpReplayAttack(ap, station, false, "", false);<NEW_LINE>String ob = new Gson().toJson(attack);<NEW_LINE>Intent intent = new Intent("de.tu_darmstadt.seemoo.nexmon.ATTACK_SERVICE");<NEW_LINE>intent.putExtra("ATTACK", ob);<NEW_LINE>intent.putExtra("ATTACK_TYPE", Attack.ATTACK_ARP_REPLAY);<NEW_LINE>MyApplication.getAppContext().sendBroadcast(intent);<NEW_LINE>dismiss();<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return view;<NEW_LINE>} | android.R.layout.simple_spinner_dropdown_item); |
1,032,392 | public void visit(BLangErrorDestructure errorDeStmt, AnalyzerData data) {<NEW_LINE>BLangErrorVarRef varRef = errorDeStmt.varRef;<NEW_LINE>if (varRef.message != null) {<NEW_LINE>if (names.fromIdNode(((BLangSimpleVarRef) varRef.message).variableName) != Names.IGNORE) {<NEW_LINE><MASK><NEW_LINE>checkInvalidTypeDef(varRef.message);<NEW_LINE>} else {<NEW_LINE>// set message var refs type to no type if the variable name is '_'<NEW_LINE>varRef.message.setBType(symTable.noType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (varRef.cause != null) {<NEW_LINE>if (varRef.cause.getKind() != NodeKind.SIMPLE_VARIABLE_REF || names.fromIdNode(((BLangSimpleVarRef) varRef.cause).variableName) != Names.IGNORE) {<NEW_LINE>setTypeOfVarRefInErrorBindingAssignment(varRef.cause, data);<NEW_LINE>checkInvalidTypeDef(varRef.cause);<NEW_LINE>} else {<NEW_LINE>// set cause var refs type to no type if the variable name is '_'<NEW_LINE>varRef.cause.setBType(symTable.noType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>typeChecker.checkExpr(errorDeStmt.expr, data.env, symTable.noType, data.prevEnvs);<NEW_LINE>checkErrorVarRefEquivalency(varRef, errorDeStmt.expr.getBType(), errorDeStmt.expr.pos, data);<NEW_LINE>} | setTypeOfVarRefInErrorBindingAssignment(varRef.message, data); |
1,340,610 | public void collect(int doc, long bucket) throws IOException {<NEW_LINE>weights = bigArrays.<MASK><NEW_LINE>sums = bigArrays.grow(sums, bucket + 1);<NEW_LINE>sumCompensations = bigArrays.grow(sumCompensations, bucket + 1);<NEW_LINE>weightCompensations = bigArrays.grow(weightCompensations, bucket + 1);<NEW_LINE>if (docValues.advanceExact(doc) && docWeights.advanceExact(doc)) {<NEW_LINE>if (docWeights.docValueCount() > 1) {<NEW_LINE>throw new AggregationExecutionException("Encountered more than one weight for a " + "single document. Use a script to combine multiple weights-per-doc into a single value.");<NEW_LINE>}<NEW_LINE>// There should always be one weight if advanceExact lands us here, either<NEW_LINE>// a real weight or a `missing` weight<NEW_LINE>assert docWeights.docValueCount() == 1;<NEW_LINE>final double weight = docWeights.nextValue();<NEW_LINE>final int numValues = docValues.docValueCount();<NEW_LINE>assert numValues > 0;<NEW_LINE>for (int i = 0; i < numValues; i++) {<NEW_LINE>kahanSum(docValues.nextValue() * weight, sums, sumCompensations, bucket);<NEW_LINE>kahanSum(weight, weights, weightCompensations, bucket);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | grow(weights, bucket + 1); |
1,295,581 | public Status update(String table, String key, Map<String, ByteIterator> values) {<NEW_LINE>setTable(table);<NEW_LINE>if (debug) {<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>final byte[][] qualifiers = new byte[values.size()][];<NEW_LINE>final byte[][] byteValues = new byte[values.size()][];<NEW_LINE>int idx = 0;<NEW_LINE>for (final Entry<String, ByteIterator> entry : values.entrySet()) {<NEW_LINE>qualifiers[idx] = entry.getKey().getBytes();<NEW_LINE>byteValues[idx++] = entry.getValue().toArray();<NEW_LINE>if (debug) {<NEW_LINE>System.out.println("Adding field/value " + entry.getKey() + "/" + Bytes.pretty(entry.getValue().toArray()) + " to put request");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final PutRequest put = new PutRequest(lastTableBytes, key.getBytes(), columnFamilyBytes, qualifiers, byteValues);<NEW_LINE>if (!durability) {<NEW_LINE>put.setDurable(false);<NEW_LINE>}<NEW_LINE>if (!clientSideBuffering) {<NEW_LINE>put.setBufferable(false);<NEW_LINE>try {<NEW_LINE>client.put(put).join(joinTimeout);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>System.err.println("Thread interrupted");<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Failure reading from row with key " + key + ": " + e.getMessage());<NEW_LINE>return Status.ERROR;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// hooray! Asynchronous write. But without a callback and an async<NEW_LINE>// YCSB call we don't know whether it succeeded or not<NEW_LINE>client.put(put);<NEW_LINE>}<NEW_LINE>return Status.OK;<NEW_LINE>} | out.println("Setting up put for key: " + key); |
142,683 | private String render(Resource resource, Map<String, Object> model, Locale locale, PurchaseContext purchaseContext, TemplateOutput templateOutput) {<NEW_LINE>try {<NEW_LINE>ModelAndView mv = new ModelAndView();<NEW_LINE>mv.getModelMap().addAllAttributes(model);<NEW_LINE>mv.addObject("format-date", MustacheCustomTag.FORMAT_DATE);<NEW_LINE>mv.addObject("country-name", COUNTRY_NAME);<NEW_LINE>mv.addObject("render-markdown", RENDER_MARKDOWN);<NEW_LINE>mv.addObject("additional-field-value", ADDITIONAL_FIELD_VALUE.apply(model.get(ADDITIONAL_FIELDS_KEY)));<NEW_LINE>mv.addObject("metadata-value", ADDITIONAL_FIELD_VALUE.apply(model.get(METADATA_ATTRIBUTES_KEY)));<NEW_LINE>mv.addObject("i18n", new CustomLocalizationMessageInterceptor(locale, messageSourceManager.getMessageSourceFor(purchaseContext)).createTranslator());<NEW_LINE>var updatedModel = mv.getModel();<NEW_LINE>updatedModel.putIfAbsent("custom-header-text", "");<NEW_LINE>updatedModel.putIfAbsent("custom-body-text", "");<NEW_LINE><MASK><NEW_LINE>return compile(resource, templateOutput).execute(mv.getModel());<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("TemplateManager: got exception while generating a template", e);<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>} | updatedModel.putIfAbsent("custom-footer-text", ""); |
1,200,716 | public static ListCallOutDialogRecordsResponse unmarshall(ListCallOutDialogRecordsResponse listCallOutDialogRecordsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listCallOutDialogRecordsResponse.setRequestId(_ctx.stringValue("ListCallOutDialogRecordsResponse.RequestId"));<NEW_LINE>listCallOutDialogRecordsResponse.setTotalCount<MASK><NEW_LINE>listCallOutDialogRecordsResponse.setPageNumber(_ctx.integerValue("ListCallOutDialogRecordsResponse.PageNumber"));<NEW_LINE>listCallOutDialogRecordsResponse.setPageSize(_ctx.integerValue("ListCallOutDialogRecordsResponse.PageSize"));<NEW_LINE>listCallOutDialogRecordsResponse.setCode(_ctx.integerValue("ListCallOutDialogRecordsResponse.Code"));<NEW_LINE>listCallOutDialogRecordsResponse.setMessage(_ctx.stringValue("ListCallOutDialogRecordsResponse.Message"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListCallOutDialogRecordsResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setName(_ctx.stringValue("ListCallOutDialogRecordsResponse.Data[" + i + "].Name"));<NEW_LINE>dataItem.setContent(_ctx.stringValue("ListCallOutDialogRecordsResponse.Data[" + i + "].Content"));<NEW_LINE>dataItem.setBeginTimestamp(_ctx.longValue("ListCallOutDialogRecordsResponse.Data[" + i + "].BeginTimestamp"));<NEW_LINE>dataItem.setEndTimestamp(_ctx.longValue("ListCallOutDialogRecordsResponse.Data[" + i + "].EndTimestamp"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>listCallOutDialogRecordsResponse.setData(data);<NEW_LINE>return listCallOutDialogRecordsResponse;<NEW_LINE>} | (_ctx.longValue("ListCallOutDialogRecordsResponse.TotalCount")); |
255,583 | public CellInput unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CellInput cellInput = new CellInput();<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("fact", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cellInput.setFact(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("facts", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cellInput.setFacts(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return cellInput;<NEW_LINE>} | class).unmarshall(context)); |
667,888 | // Node Table.<NEW_LINE>public static void exec(String location, XLoaderFiles loaderFiles, List<String> datafiles, boolean collectStats) {<NEW_LINE>FmtLog.info(BulkLoaderX.LOG_Data, "Ingest data");<NEW_LINE>// Possible parser speed up. This has no effect if parsing in parallel<NEW_LINE>// because the parser isn't the slowest step when loading at scale.<NEW_LINE><MASK><NEW_LINE>// SystemIRIx.setProvider(new IRIProviderAny());<NEW_LINE>// Defaults.<NEW_LINE>// DatasetGraph dsg = DatabaseMgr.connectDatasetGraph(location);<NEW_LINE>DatasetGraph dsg = getDatasetGraph(location);<NEW_LINE>ProgressMonitor monitor = ProgressMonitorOutput.create(BulkLoaderX.LOG_Data, "Data", BulkLoaderX.DataTick, BulkLoaderX.DataSuperTick);<NEW_LINE>// WriteRows does it's own buffering and has direct write-to-buffer.<NEW_LINE>// Do not buffer here.<NEW_LINE>// Adds gzip processing if required.<NEW_LINE>// But we'll need the disk space eventually so we aren't space constrained to use gzip here.<NEW_LINE>OutputStream outputTriples = IO.openOutputFile(loaderFiles.triplesFile);<NEW_LINE>OutputStream outputQuads = IO.openOutputFile(loaderFiles.quadsFile);<NEW_LINE>OutputStream outT = outputTriples;<NEW_LINE>OutputStream outQ = outputQuads;<NEW_LINE>dsg.executeWrite(() -> {<NEW_LINE>Pair<Long, Long> p = build(dsg, monitor, outT, outQ, datafiles);<NEW_LINE>String str = DateTimeUtils.nowAsXSDDateTimeString();<NEW_LINE>long cTriple = p.getLeft();<NEW_LINE>long cQuad = p.getRight();<NEW_LINE>FmtLog.info(BulkLoaderX.LOG_Data, "Triples = %,d ; Quads = %,d", cTriple, cQuad);<NEW_LINE>JsonObject obj = JSON.buildObject(b -> {<NEW_LINE>b.pair("ingested", str);<NEW_LINE>b.key("data").startArray();<NEW_LINE>datafiles.forEach(fn -> b.value(fn));<NEW_LINE>b.finishArray();<NEW_LINE>b.pair("triples", cTriple);<NEW_LINE>b.pair("quads", cQuad);<NEW_LINE>});<NEW_LINE>try (OutputStream out = IO.openOutputFile(loaderFiles.loadInfo)) {<NEW_LINE>JSON.write(out, obj);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>IO.exception(ex);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>TDBInternal.expel(dsg);<NEW_LINE>SystemIRIx.setProvider(provider);<NEW_LINE>} | IRIProvider provider = SystemIRIx.getProvider(); |
1,279,368 | private static void printHelpExit(CmdLineParser parser) {<NEW_LINE>parser.getProperties().withUsageWidth(120);<NEW_LINE><MASK><NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Document Types");<NEW_LINE>for (PaperSize p : PaperSize.values()) {<NEW_LINE>System.out.printf(" %12s %5.0f %5.0f %s\n", p.getName(), p.width, p.height, p.unit.abbreviation);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Units");<NEW_LINE>for (Unit u : Unit.values()) {<NEW_LINE>System.out.printf(" %12s %3s\n", u, u.abbreviation);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Examples:");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("-t \"123-09494\" -t \"Hello There!\" -p LETTER -w 5 --GridFill -o document.pdf");<NEW_LINE>System.out.println(" creates PDF with a grid that will fill the entire page composed of two Aztec Codes on letter sized paper");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("-t \"123-09494\" -t \"Hello There!\" -o document.png");<NEW_LINE>System.out.println(" Creates two png images names document0.png and document1.png");<NEW_LINE>System.out.println();<NEW_LINE>System.exit(1);<NEW_LINE>} | parser.printUsage(System.out); |
575,495 | public Object visitTuple(Tuple node) throws Exception {<NEW_LINE>if (node.getInternalCtx() == expr_contextType.Store) {<NEW_LINE>return seqSet(node.getInternalElts());<NEW_LINE>}<NEW_LINE>if (node.getInternalCtx() == expr_contextType.Del) {<NEW_LINE>return seqDel(node.getInternalElts());<NEW_LINE>}<NEW_LINE>if (my_scope.generator) {<NEW_LINE>int content = makeArray(node.getInternalElts());<NEW_LINE>code.new_(p(PyTuple.class));<NEW_LINE>code.dup();<NEW_LINE>code.aload(content);<NEW_LINE>code.invokespecial(p(PyTuple.class), "<init>", sig(Void.TYPE, PyObject[].class));<NEW_LINE>freeArray(content);<NEW_LINE>} else {<NEW_LINE>code.new_(p(PyTuple.class));<NEW_LINE>code.dup();<NEW_LINE>loadArray(code, node.getInternalElts());<NEW_LINE>code.invokespecial(p(PyTuple.class), "<init>", sig(Void.TYPE<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | , PyObject[].class)); |
103,898 | public static Dataset<Row> alignDupes(Dataset<Row> dupesActual, Arguments args) {<NEW_LINE>dupesActual = dupesActual.cache();<NEW_LINE>List<Column> cols = new ArrayList<Column>();<NEW_LINE>cols.add(dupesActual.col(ColName.CLUSTER_COLUMN));<NEW_LINE>cols.add(dupesActual.col(ColName.ID_COL));<NEW_LINE>cols.add(dupesActual.col(ColName.PREDICTION_COL));<NEW_LINE>cols.add(dupesActual.col(ColName.SCORE_COL));<NEW_LINE>for (FieldDefinition def : args.getFieldDefinition()) {<NEW_LINE>cols.add(dupesActual.col(def.fieldName));<NEW_LINE>}<NEW_LINE>cols.add(dupesActual<MASK><NEW_LINE>Dataset<Row> dupes1 = dupesActual.select(JavaConverters.asScalaIteratorConverter(cols.iterator()).asScala().toSeq());<NEW_LINE>List<Column> cols1 = new ArrayList<Column>();<NEW_LINE>cols1.add(dupesActual.col(ColName.CLUSTER_COLUMN));<NEW_LINE>cols1.add(dupesActual.col(ColName.COL_PREFIX + ColName.ID_COL));<NEW_LINE>cols1.add(dupesActual.col(ColName.PREDICTION_COL));<NEW_LINE>// cols1.add(dupesActual.col(ColName.PROBABILITY_COL));<NEW_LINE>cols1.add(dupesActual.col(ColName.SCORE_COL));<NEW_LINE>for (FieldDefinition def : args.getFieldDefinition()) {<NEW_LINE>cols1.add(dupesActual.col(ColName.COL_PREFIX + def.fieldName));<NEW_LINE>}<NEW_LINE>cols1.add(dupesActual.col(ColName.COL_PREFIX + ColName.SOURCE_COL));<NEW_LINE>Dataset<Row> dupes2 = dupesActual.select(JavaConverters.asScalaIteratorConverter(cols1.iterator()).asScala().toSeq());<NEW_LINE>dupes2 = dupes2.toDF(dupes1.columns()).cache();<NEW_LINE>dupes1 = dupes1.union(dupes2);<NEW_LINE>dupes1 = dupes1.withColumn(ColName.MATCH_FLAG_COL, functions.lit(ColValues.MATCH_TYPE_UNKNOWN));<NEW_LINE>return dupes1;<NEW_LINE>} | .col(ColName.SOURCE_COL)); |
1,181,192 | public void actionPerformed(ActionEvent e) {<NEW_LINE>if (e.getSource() == loadButton) {<NEW_LINE>String title = "Load OSM Data";<NEW_LINE>if ((e.getModifiers() & KeyEvent.CTRL_DOWN_MASK) != 0)<NEW_LINE>title += " (Bounding Box Mode)";<NEW_LINE>if ((e.getModifiers() & KeyEvent.SHIFT_DOWN_MASK) != 0)<NEW_LINE>title += " (Overview Mode)";<NEW_LINE>fileChooser.setDialogTitle(title);<NEW_LINE>int returnVal = fileChooser.showDialog(this, "Load");<NEW_LINE>if (returnVal == JFileChooser.APPROVE_OPTION) {<NEW_LINE>if ((e.getModifiers() & KeyEvent.CTRL_DOWN_MASK) != 0) {<NEW_LINE>// ctrl+load -> ask the user for a bounding box.<NEW_LINE>BoundingBox bb = askForBoundingBox();<NEW_LINE>if (bb != null)<NEW_LINE>mapReader.setFilter(bb);<NEW_LINE>else<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((e.getModifiers() & KeyEvent.SHIFT_DOWN_MASK) != 0) {<NEW_LINE>EntityClassifier<Boolean> filter = createOverviewFilter();<NEW_LINE>mapReader.setFilter(filter);<NEW_LINE>}<NEW_LINE>readMap(fileChooser.getSelectedFile());<NEW_LINE>}<NEW_LINE>} else if (e.getSource() == saveButton) {<NEW_LINE>JFileChooser fc = new JFileChooser();<NEW_LINE>String[] exts = mapWriter.fileFormatDescriptions();<NEW_LINE>for (int i = 0; i < exts.length; i++) {<NEW_LINE>FileFilter filter = new FileNameExtensionFilter(exts[i], mapWriter.fileFormatExtensions()[i]);<NEW_LINE>fc.addChoosableFileFilter(filter);<NEW_LINE>}<NEW_LINE>fc.setFileFilter(fc.getChoosableFileFilters()[0]);<NEW_LINE>fc.setCurrentDirectory(fileChooser.getCurrentDirectory());<NEW_LINE>int returnVal = fc.showSaveDialog(this);<NEW_LINE>if (returnVal == JFileChooser.APPROVE_OPTION && (!fc.getSelectedFile().exists() || JOptionPane.showConfirmDialog(this, "File exists, overwrite?", "Confirm", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION)) {<NEW_LINE>mapWriter.writeMap(fc.getSelectedFile(), getMap(), view.getBoundingBox());<NEW_LINE>}<NEW_LINE>} else if (e.getSource() == statisticsButton) {<NEW_LINE>Object[][] data = getMap().getStatistics();<NEW_LINE>JTable table = new JTable(data, new String<MASK><NEW_LINE>JScrollPane scroller = new JScrollPane(table);<NEW_LINE>scroller.setPreferredSize(new Dimension(250, 300));<NEW_LINE>JOptionPane.showConfirmDialog(this, scroller, "Map Statistics", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>} else if (e.getSource() == sidebarCheckBox) {<NEW_LINE>showSidebar(sidebarCheckBox.isSelected());<NEW_LINE>}<NEW_LINE>} | [] { "Attribute", "Value" }); |
1,159,134 | public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>return srcSequence.minp(null, option, ctx);<NEW_LINE>} else if (param.isLeaf()) {<NEW_LINE>Expression exp = param.getLeafExpression();<NEW_LINE>return srcSequence.minp(exp, option, ctx);<NEW_LINE>} else {<NEW_LINE>if (param.getSubSize() != 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("minp" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>IParam param0 = param.getSub(0);<NEW_LINE>IParam param1 = param.getSub(1);<NEW_LINE>if (param0 == null || param1 == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("minp" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Expression exp = param0.getLeafExpression();<NEW_LINE>Object obj = param1.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(obj instanceof Number)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("minp" <MASK><NEW_LINE>}<NEW_LINE>int count = ((Number) obj).intValue();<NEW_LINE>return srcSequence.minp(exp, count, ctx);<NEW_LINE>}<NEW_LINE>} | + mm.getMessage("function.paramTypeError")); |
296,939 | public void close(TaskAttemptContext attempt) throws IOException, InterruptedException {<NEW_LINE>log.debug("mutations written: " + mutCount + ", values written: " + valCount);<NEW_LINE>if (simulate)<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>mtbw.close();<NEW_LINE>} catch (MutationsRejectedException e) {<NEW_LINE>if (!e.getSecurityErrorCodes().isEmpty()) {<NEW_LINE>var tables = new HashMap<String, Set<SecurityErrorCode>>();<NEW_LINE>e.getSecurityErrorCodes().forEach((table, code) -> tables.computeIfAbsent(table.getTable().canonical(), k -> new HashSet<>(<MASK><NEW_LINE>log.error("Not authorized to write to tables : " + tables);<NEW_LINE>}<NEW_LINE>if (!e.getConstraintViolationSummaries().isEmpty()) {<NEW_LINE>log.error("Constraint violations : " + e.getConstraintViolationSummaries().size());<NEW_LINE>}<NEW_LINE>throw new IOException(e);<NEW_LINE>} finally {<NEW_LINE>client.close();<NEW_LINE>}<NEW_LINE>} | )).addAll(code)); |
1,213,188 | private static // returns true if text converted with charset is equals to the bytes currently on disk<NEW_LINE>boolean isGoodCharset(@Nonnull VirtualFile virtualFile, @Nonnull Charset charset) {<NEW_LINE>FileDocumentManager documentManager = FileDocumentManager.getInstance();<NEW_LINE>Document document = documentManager.getDocument(virtualFile);<NEW_LINE>if (document == null)<NEW_LINE>return true;<NEW_LINE>byte[] loadedBytes;<NEW_LINE>byte[] bytesToSave;<NEW_LINE>try {<NEW_LINE>loadedBytes = virtualFile.contentsToByteArray();<NEW_LINE>bytesToSave = new String(loadedBytes, charset).getBytes(charset);<NEW_LINE>} catch (Exception e) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>byte[] bom = virtualFile.getBOM();<NEW_LINE>if (bom != null && !ArrayUtil.startsWith(bytesToSave, bom)) {<NEW_LINE>// for 2-byte encodings String.getBytes(Charset) adds BOM automatically<NEW_LINE>bytesToSave = ArrayUtil.mergeArrays(bom, bytesToSave);<NEW_LINE>}<NEW_LINE>boolean equals = Arrays.equals(bytesToSave, loadedBytes);<NEW_LINE>if (!equals && LOG.isDebugEnabled()) {<NEW_LINE>try {<NEW_LINE>FileUtil.writeToFile(<MASK><NEW_LINE>FileUtil.writeToFile(new File("C:\\temp\\loadedBytes"), loadedBytes);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return equals;<NEW_LINE>} | new File("C:\\temp\\bytesToSave"), bytesToSave); |
1,158,405 | private ExitCode installServerFeatures() {<NEW_LINE>ExitCode rc = ReturnCode.OK;<NEW_LINE>Collection<String> featuresToInstall = new HashSet<String>();<NEW_LINE>try {<NEW_LINE>// get original server features now<NEW_LINE>featuresToInstall.addAll(installKernel.getServerFeaturesToInstall(servers, false));<NEW_LINE><MASK><NEW_LINE>} catch (InstallException ie) {<NEW_LINE>logger.log(Level.SEVERE, ie.getMessage(), ie);<NEW_LINE>return FeatureUtilityExecutor.returnCode(ie.getRc());<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.log(Level.SEVERE, e.getMessage(), e);<NEW_LINE>rc = ReturnCode.RUNTIME_EXCEPTION;<NEW_LINE>}<NEW_LINE>if (featuresToInstall.isEmpty()) {<NEW_LINE>logger.info(InstallLogUtils.Messages.INSTALL_KERNEL_MESSAGES.getMessage("MSG_SERVER_NEW_FEATURES_NOT_REQUIRED"));<NEW_LINE>} else {<NEW_LINE>rc = assetInstallInit(featuresToInstall);<NEW_LINE>}<NEW_LINE>return rc;<NEW_LINE>} | logger.fine("all server features: " + featuresToInstall); |
1,192,955 | public PartialImportResults doImport(PartialImportRepresentation rep, RealmModel realm, KeycloakSession session) throws ErrorResponseException {<NEW_LINE>PartialImportResults results = new PartialImportResults();<NEW_LINE>if (!rep.hasRealmRoles() && !rep.hasClientRoles())<NEW_LINE>return results;<NEW_LINE>// finalize preparation and add results for skips<NEW_LINE>removeRealmRoleSkips(results, rep, realm, session);<NEW_LINE>removeClientRoleSkips(results, rep, realm);<NEW_LINE>if (rep.hasRealmRoles())<NEW_LINE>setUniqueIds(rep.getRoles().getRealm());<NEW_LINE>if (rep.hasClientRoles())<NEW_LINE>setUniqueIds(rep.getRoles().getClient());<NEW_LINE>try {<NEW_LINE>RepresentationToModel.importRoles(rep.getRoles(), realm);<NEW_LINE>} catch (Exception e) {<NEW_LINE>ServicesLogger.LOGGER.roleImportError(e);<NEW_LINE>throw new ErrorResponseException(ErrorResponse.error(e.getMessage()<MASK><NEW_LINE>}<NEW_LINE>// add "add" results for new roles created<NEW_LINE>realmRoleAdds(results, rep, realm, session);<NEW_LINE>clientRoleAdds(results, rep, realm);<NEW_LINE>// add "overwritten" results for roles overwritten<NEW_LINE>addResultsForOverwrittenRealmRoles(results, realm, session);<NEW_LINE>addResultsForOverwrittenClientRoles(results, realm);<NEW_LINE>return results;<NEW_LINE>} | , Response.Status.INTERNAL_SERVER_ERROR)); |
601,440 | private void createUI() {<NEW_LINE>uriField = new AugmentedJTextField("", 45, URL_FIELD_PLACEHOLDER);<NEW_LINE>uriField.getDocument().addDocumentListener(new DocumentListener() {<NEW_LINE><NEW_LINE>public void insertUpdate(DocumentEvent event) {<NEW_LINE>handleValueChanged();<NEW_LINE>}<NEW_LINE><NEW_LINE>public void removeUpdate(DocumentEvent event) {<NEW_LINE>handleValueChanged();<NEW_LINE>}<NEW_LINE><NEW_LINE>public void changedUpdate(DocumentEvent event) {<NEW_LINE>handleValueChanged();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JPanel upperGroup = new JPanel(new BorderLayout());<NEW_LINE>upperGroup.add(new FormLabel(URL_FIELD_LABEL), BorderLayout.NORTH);<NEW_LINE>upperGroup.<MASK><NEW_LINE>JPanel lowerGroup = new JPanel(new BorderLayout());<NEW_LINE>lowerGroup.add(new FormLabel(BOOKMARKED_URLS_LABEL), BorderLayout.NORTH);<NEW_LINE>bookmarksList = new MList() {<NEW_LINE><NEW_LINE>protected void handleAdd() {<NEW_LINE>addURI();<NEW_LINE>}<NEW_LINE><NEW_LINE>protected void handleDelete() {<NEW_LINE>deleteSelectedBookmark();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>bookmarksList.setCellRenderer(new BookmarkedItemListRenderer());<NEW_LINE>JScrollPane scrollPane = new JScrollPane(bookmarksList);<NEW_LINE>lowerGroup.add(scrollPane);<NEW_LINE>fillList();<NEW_LINE>bookmarksList.addListSelectionListener(e -> {<NEW_LINE>if (!e.getValueIsAdjusting()) {<NEW_LINE>updateTextField();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>setLayout(new BorderLayout(7, 7));<NEW_LINE>add(upperGroup, BorderLayout.NORTH);<NEW_LINE>add(lowerGroup, BorderLayout.CENTER);<NEW_LINE>setPreferredSize(new Dimension(PREF_WIDTH, PREF_HEIGHT));<NEW_LINE>} | add(uriField, BorderLayout.SOUTH); |
869,799 | private static Throwable esToCrateException(Throwable unwrappedError) {<NEW_LINE>if (unwrappedError instanceof IllegalArgumentException || unwrappedError instanceof ParsingException) {<NEW_LINE>return new SQLParseException(unwrappedError.getMessage(), (Exception) unwrappedError);<NEW_LINE>} else if (unwrappedError instanceof UnsupportedOperationException) {<NEW_LINE>return new UnsupportedFeatureException(unwrappedError.getMessage(), (Exception) unwrappedError);<NEW_LINE>} else if (isDocumentAlreadyExistsException(unwrappedError)) {<NEW_LINE>return new DuplicateKeyException(((EngineException) unwrappedError).getIndex().getName(), "A document with the same primary key exists already", unwrappedError);<NEW_LINE>} else if (unwrappedError instanceof ResourceAlreadyExistsException) {<NEW_LINE>return new RelationAlreadyExists(((ResourceAlreadyExistsException) unwrappedError).getIndex(), unwrappedError);<NEW_LINE>} else if ((unwrappedError instanceof InvalidIndexNameException)) {<NEW_LINE>if (unwrappedError.getMessage().contains("already exists as alias")) {<NEW_LINE>// treat an alias like a table as aliases are not officially supported<NEW_LINE>return new RelationAlreadyExists(((InvalidIndexNameException) unwrappedError).getIndex(), unwrappedError);<NEW_LINE>}<NEW_LINE>return new InvalidRelationName(((InvalidIndexNameException) unwrappedError).getIndex().getName(), unwrappedError);<NEW_LINE>} else if (unwrappedError instanceof InvalidIndexTemplateException) {<NEW_LINE>PartitionName partitionName = PartitionName.fromIndexOrTemplate(((InvalidIndexTemplateException) unwrappedError).name());<NEW_LINE>return new InvalidRelationName(partitionName.relationName().fqn(), unwrappedError);<NEW_LINE>} else if (unwrappedError instanceof IndexNotFoundException) {<NEW_LINE>return new RelationUnknown(((IndexNotFoundException) unwrappedError).getIndex().getName(), unwrappedError);<NEW_LINE>} else if (unwrappedError instanceof InterruptedException) {<NEW_LINE>return JobKilledException.of(unwrappedError.getMessage());<NEW_LINE>} else if (unwrappedError instanceof RepositoryMissingException) {<NEW_LINE>return new RepositoryUnknownException(((RepositoryMissingException<MASK><NEW_LINE>} else if (unwrappedError instanceof InvalidSnapshotNameException) {<NEW_LINE>return new SnapshotNameInvalidException(unwrappedError.getMessage());<NEW_LINE>} else if (unwrappedError instanceof SnapshotMissingException) {<NEW_LINE>SnapshotMissingException snapshotException = (SnapshotMissingException) unwrappedError;<NEW_LINE>return new SnapshotUnknownException(snapshotException.getRepositoryName(), snapshotException.getSnapshotName(), unwrappedError);<NEW_LINE>} else if (unwrappedError instanceof SnapshotCreationException) {<NEW_LINE>SnapshotCreationException creationException = (SnapshotCreationException) unwrappedError;<NEW_LINE>return new SnapshotAlreadyExistsException(creationException.getRepositoryName(), creationException.getSnapshotName());<NEW_LINE>}<NEW_LINE>return unwrappedError;<NEW_LINE>} | ) unwrappedError).repository()); |
748,426 | public static DescribeSQLLogFilesResponse unmarshall(DescribeSQLLogFilesResponse describeSQLLogFilesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSQLLogFilesResponse.setRequestId(_ctx.stringValue("DescribeSQLLogFilesResponse.RequestId"));<NEW_LINE>describeSQLLogFilesResponse.setTotalRecordCount<MASK><NEW_LINE>describeSQLLogFilesResponse.setPageRecordCount(_ctx.integerValue("DescribeSQLLogFilesResponse.PageRecordCount"));<NEW_LINE>describeSQLLogFilesResponse.setPageNumber(_ctx.integerValue("DescribeSQLLogFilesResponse.PageNumber"));<NEW_LINE>List<LogFile> items = new ArrayList<LogFile>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSQLLogFilesResponse.Items.Length"); i++) {<NEW_LINE>LogFile logFile = new LogFile();<NEW_LINE>logFile.setFileID(_ctx.stringValue("DescribeSQLLogFilesResponse.Items[" + i + "].FileID"));<NEW_LINE>logFile.setLogStartTime(_ctx.stringValue("DescribeSQLLogFilesResponse.Items[" + i + "].LogStartTime"));<NEW_LINE>logFile.setLogSize(_ctx.stringValue("DescribeSQLLogFilesResponse.Items[" + i + "].LogSize"));<NEW_LINE>logFile.setLogDownloadURL(_ctx.stringValue("DescribeSQLLogFilesResponse.Items[" + i + "].LogDownloadURL"));<NEW_LINE>logFile.setLogEndTime(_ctx.stringValue("DescribeSQLLogFilesResponse.Items[" + i + "].LogEndTime"));<NEW_LINE>logFile.setLogStatus(_ctx.stringValue("DescribeSQLLogFilesResponse.Items[" + i + "].LogStatus"));<NEW_LINE>items.add(logFile);<NEW_LINE>}<NEW_LINE>describeSQLLogFilesResponse.setItems(items);<NEW_LINE>return describeSQLLogFilesResponse;<NEW_LINE>} | (_ctx.integerValue("DescribeSQLLogFilesResponse.TotalRecordCount")); |
1,422,910 | private void updateGlobalNameDeclarationAtVariableNode(Name n, boolean canCollapseChildNames) {<NEW_LINE>if (!canCollapseChildNames) {<NEW_LINE>logDecisionForName(n, "cannot collapse child names: skipping");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>String name = ref.getNode().getString();<NEW_LINE>Node rvalue = ref.getNode().getFirstChild();<NEW_LINE>Node variableNode = ref.getNode().getParent();<NEW_LINE>Node grandparent = variableNode.getParent();<NEW_LINE>boolean isObjLit = rvalue.isObjectLit();<NEW_LINE>if (isObjLit) {<NEW_LINE>declareVariablesForObjLitValues(n, name, rvalue, variableNode, variableNode.getPrevious());<NEW_LINE>}<NEW_LINE>addStubsForUndeclaredProperties(n, name, grandparent, variableNode);<NEW_LINE>if (isObjLit && canEliminate(n)) {<NEW_LINE>ref.getNode().detach();<NEW_LINE>compiler.reportChangeToEnclosingScope(variableNode);<NEW_LINE>if (!variableNode.hasChildren()) {<NEW_LINE>variableNode.detach();<NEW_LINE>}<NEW_LINE>// Clear out the object reference, since we've eliminated it from the<NEW_LINE>// parse tree.<NEW_LINE>n.updateRefNode(ref, null);<NEW_LINE>}<NEW_LINE>} | Ref ref = n.getDeclaration(); |
652,635 | private static boolean isValidSectionOffset(final JTextField textField, final Section section) {<NEW_LINE>Preconditions.checkNotNull(textField, "Error: textField argument can not be null");<NEW_LINE>Preconditions.checkNotNull(section, "Error: section argument can not be null");<NEW_LINE>if (textField.getText().isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String textFieldString = textField.getText().toLowerCase();<NEW_LINE>boolean hex = false;<NEW_LINE>if (textFieldString.startsWith("0x")) {<NEW_LINE>textFieldString = textFieldString.substring(2);<NEW_LINE>hex = true;<NEW_LINE>}<NEW_LINE>final Long offset = textFieldString.matches("^[0-9A-Fa-f]+$") && hex == true ? Long.parseLong(textFieldString, 16) : <MASK><NEW_LINE>if (section.isValidOffset(offset)) {<NEW_LINE>sanitizedOffset = offset;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (section.isValidAddress(offset)) {<NEW_LINE>sanitizedOffset = offset - section.getStartAddress().toLong();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} catch (final NumberFormatException exception) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | Long.parseLong(textFieldString, 10); |
132,098 | private void calculatePosition(Rectangle2D textBounds) {<NEW_LINE>double textHeight = textBounds.getHeight();<NEW_LINE>double textWidth = textBounds.getWidth();<NEW_LINE>double widthAdjustment = textWidth + styler.getChartButtonMargin() * 3;<NEW_LINE>double heightAdjustment = textHeight + styler.getChartButtonMargin() * 3;<NEW_LINE>double boundsWidth = bounds.getWidth();<NEW_LINE>double boundsHeight = bounds.getHeight();<NEW_LINE>switch(styler.getChartButtonPosition()) {<NEW_LINE>case InsideNW:<NEW_LINE>xOffset = bounds.getX() + styler.getChartButtonMargin();<NEW_LINE>yOffset = bounds.getY() + styler.getChartButtonMargin();<NEW_LINE>break;<NEW_LINE>case InsideNE:<NEW_LINE>xOffset = bounds.getX() + boundsWidth - widthAdjustment;<NEW_LINE>yOffset = bounds.getY<MASK><NEW_LINE>break;<NEW_LINE>case InsideSE:<NEW_LINE>xOffset = bounds.getX() + boundsWidth - widthAdjustment;<NEW_LINE>yOffset = bounds.getY() + boundsHeight - heightAdjustment;<NEW_LINE>break;<NEW_LINE>case InsideSW:<NEW_LINE>xOffset = bounds.getX() + styler.getChartButtonMargin();<NEW_LINE>yOffset = bounds.getY() + boundsHeight - heightAdjustment;<NEW_LINE>break;<NEW_LINE>case InsideN:<NEW_LINE>xOffset = bounds.getX() + boundsWidth / 2 - textWidth / 2 - styler.getChartButtonMargin();<NEW_LINE>yOffset = bounds.getY() + styler.getChartButtonMargin();<NEW_LINE>break;<NEW_LINE>case InsideS:<NEW_LINE>xOffset = bounds.getX() + boundsWidth / 2 - textWidth / 2 - styler.getChartButtonMargin();<NEW_LINE>yOffset = bounds.getY() + boundsHeight - heightAdjustment;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | () + styler.getChartButtonMargin(); |
209,604 | static void xorReverse(byte[] x, byte[] y) {<NEW_LINE>x[0] = (byte) (x[0] ^ y[15]);<NEW_LINE>x[1] = (byte) (x[1] ^ y[14]);<NEW_LINE>x[2] = (byte) (x[2] ^ y[13]);<NEW_LINE>x[3] = (byte) (x[3] ^ y[12]);<NEW_LINE>x[4] = (byte) (x[4] ^ y[11]);<NEW_LINE>x[5] = (byte) (x[5] ^ y[10]);<NEW_LINE>x[6] = (byte) (x[<MASK><NEW_LINE>x[7] = (byte) (x[7] ^ y[8]);<NEW_LINE>x[8] = (byte) (x[8] ^ y[7]);<NEW_LINE>x[9] = (byte) (x[9] ^ y[6]);<NEW_LINE>x[10] = (byte) (x[10] ^ y[5]);<NEW_LINE>x[11] = (byte) (x[11] ^ y[4]);<NEW_LINE>x[12] = (byte) (x[12] ^ y[3]);<NEW_LINE>x[13] = (byte) (x[13] ^ y[2]);<NEW_LINE>x[14] = (byte) (x[14] ^ y[1]);<NEW_LINE>x[15] = (byte) (x[15] ^ y[0]);<NEW_LINE>} | 6] ^ y[9]); |
318,063 | private HdfsBlobStore createBlobstore(URI blobstoreUri, String path, Settings repositorySettings) {<NEW_LINE>Configuration hadoopConfiguration = new Configuration(repositorySettings.getAsBoolean("load_defaults", true));<NEW_LINE>hadoopConfiguration.setClassLoader(HdfsRepository.class.getClassLoader());<NEW_LINE>hadoopConfiguration.reloadConfiguration();<NEW_LINE>final Settings confSettings = repositorySettings.getByPrefix("conf.");<NEW_LINE>for (String key : confSettings.keySet()) {<NEW_LINE>logger.debug("Adding configuration to HDFS Client Configuration : {} = {}", key, confSettings.get(key));<NEW_LINE>hadoopConfiguration.set(key, confSettings.get(key));<NEW_LINE>}<NEW_LINE>// Disable FS cache<NEW_LINE>hadoopConfiguration.setBoolean("fs.hdfs.impl.disable.cache", true);<NEW_LINE>// Create a hadoop user<NEW_LINE>UserGroupInformation ugi = login(hadoopConfiguration, repositorySettings);<NEW_LINE>// Sense if HA is enabled<NEW_LINE>// HA requires elevated permissions during regular usage in the event that a failover operation<NEW_LINE>// occurs and a new connection is required.<NEW_LINE><MASK><NEW_LINE>String configKey = HdfsClientConfigKeys.Failover.PROXY_PROVIDER_KEY_PREFIX + "." + host;<NEW_LINE>Class<?> ret = hadoopConfiguration.getClass(configKey, null, FailoverProxyProvider.class);<NEW_LINE>boolean haEnabled = ret != null;<NEW_LINE>// Create the filecontext with our user information<NEW_LINE>// This will correctly configure the filecontext to have our UGI as its internal user.<NEW_LINE>FileContext fileContext = ugi.doAs((PrivilegedAction<FileContext>) () -> {<NEW_LINE>try {<NEW_LINE>AbstractFileSystem fs = AbstractFileSystem.get(blobstoreUri, hadoopConfiguration);<NEW_LINE>return FileContext.getFileContext(fs, hadoopConfiguration);<NEW_LINE>} catch (UnsupportedFileSystemException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>logger.debug("Using file-system [{}] for URI [{}], path [{}]", fileContext.getDefaultFileSystem(), fileContext.getDefaultFileSystem().getUri(), path);<NEW_LINE>try {<NEW_LINE>return new HdfsBlobStore(fileContext, path, bufferSize, isReadOnly(), haEnabled);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(String.format(Locale.ROOT, "Cannot create HDFS repository for uri [%s]", blobstoreUri), e);<NEW_LINE>}<NEW_LINE>} | String host = blobstoreUri.getHost(); |
1,459,875 | public boolean performAccessibilityAction(View host, int action, Bundle args) {<NEW_LINE>if (mAccessibilityActionsMap.containsKey(action)) {<NEW_LINE>final WritableMap event = Arguments.createMap();<NEW_LINE>event.putString("actionName", mAccessibilityActionsMap.get(action));<NEW_LINE>ReactContext reactContext = (ReactContext) host.getContext();<NEW_LINE>if (reactContext.hasActiveReactInstance()) {<NEW_LINE>final <MASK><NEW_LINE>final int surfaceId = UIManagerHelper.getSurfaceId(reactContext);<NEW_LINE>UIManager uiManager = UIManagerHelper.getUIManager(reactContext, reactTag);<NEW_LINE>if (uiManager != null) {<NEW_LINE>uiManager.<EventDispatcher>getEventDispatcher().dispatchEvent(new Event(surfaceId, reactTag) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getEventName() {<NEW_LINE>return TOP_ACCESSIBILITY_ACTION_EVENT;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected WritableMap getEventData() {<NEW_LINE>return event;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ReactSoftExceptionLogger.logSoftException(TAG, new ReactNoCrashSoftException("Cannot get RCTEventEmitter, no CatalystInstance"));<NEW_LINE>}<NEW_LINE>// In order to make Talkback announce the change of the adjustable's value,<NEW_LINE>// schedule to send a TYPE_VIEW_SELECTED event after performing the scroll actions.<NEW_LINE>final AccessibilityRole accessibilityRole = (AccessibilityRole) host.getTag(R.id.reactandroid_accessibility_role);<NEW_LINE>final ReadableMap accessibilityValue = (ReadableMap) host.getTag(R.id.reactandroid_accessibility_value);<NEW_LINE>if (accessibilityRole == AccessibilityRole.ADJUSTABLE && (action == AccessibilityActionCompat.ACTION_SCROLL_FORWARD.getId() || action == AccessibilityActionCompat.ACTION_SCROLL_BACKWARD.getId())) {<NEW_LINE>if (accessibilityValue != null && !accessibilityValue.hasKey("text")) {<NEW_LINE>scheduleAccessibilityEventSender(host);<NEW_LINE>}<NEW_LINE>return super.performAccessibilityAction(host, action, args);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return super.performAccessibilityAction(host, action, args);<NEW_LINE>} | int reactTag = host.getId(); |
148,930 | public static UserTrades adaptTradeHistory(LakeBTCTradeResponse[] transactions) {<NEW_LINE>List<UserTrade> trades = new ArrayList<>();<NEW_LINE>long lastTradeId = 0;<NEW_LINE>for (LakeBTCTradeResponse trade : transactions) {<NEW_LINE>final OrderType orderType = trade.getType().startsWith("buy") ? OrderType.BID : OrderType.ASK;<NEW_LINE>BigDecimal originalAmount = trade.getAmount();<NEW_LINE>BigDecimal price = trade.getTotal().abs();<NEW_LINE>Date timestamp = DateUtils.fromMillisUtc(trade.getAt() * 1000L);<NEW_LINE>final <MASK><NEW_LINE>final CurrencyPair currencyPair = CurrencyPair.BTC_CNY;<NEW_LINE>UserTrade userTrade = new UserTrade.Builder().type(orderType).originalAmount(originalAmount).currencyPair(currencyPair).price(price).timestamp(timestamp).feeCurrency(Currency.getInstance(currencyPair.counter.getCurrencyCode())).build();<NEW_LINE>trades.add(userTrade);<NEW_LINE>}<NEW_LINE>return new UserTrades(trades, lastTradeId, Trades.TradeSortType.SortByTimestamp);<NEW_LINE>} | String tradeId = trade.getId(); |
1,279,777 | public Response authenticationAction(String execution) {<NEW_LINE>logger.debug("authenticationAction");<NEW_LINE>checkClientSession(true);<NEW_LINE>String current = authenticationSession.getAuthNote(CURRENT_AUTHENTICATION_EXECUTION);<NEW_LINE>if (execution == null || !execution.equals(current)) {<NEW_LINE>logger.debug("Current execution does not equal executed execution. Might be a page refresh");<NEW_LINE>return new AuthenticationFlowURLHelper(session, realm, uriInfo).showPageExpired(authenticationSession);<NEW_LINE>}<NEW_LINE>UserModel authUser = authenticationSession.getAuthenticatedUser();<NEW_LINE>validateUser(authUser);<NEW_LINE>AuthenticationExecutionModel model = realm.getAuthenticationExecutionById(execution);<NEW_LINE>if (model == null) {<NEW_LINE>logger.debug("Cannot find execution, reseting flow");<NEW_LINE>logFailure();<NEW_LINE>resetFlow();<NEW_LINE>return authenticate();<NEW_LINE>}<NEW_LINE>event.client(authenticationSession.getClient().getClientId()).detail(Details.REDIRECT_URI, authenticationSession.getRedirectUri()).detail(Details.<MASK><NEW_LINE>String authType = authenticationSession.getAuthNote(Details.AUTH_TYPE);<NEW_LINE>if (authType != null) {<NEW_LINE>event.detail(Details.AUTH_TYPE, authType);<NEW_LINE>}<NEW_LINE>AuthenticationFlow authenticationFlow = createFlowExecution(this.flowId, model);<NEW_LINE>Response challenge = authenticationFlow.processAction(execution);<NEW_LINE>if (challenge != null)<NEW_LINE>return challenge;<NEW_LINE>if (authenticationSession.getAuthenticatedUser() == null) {<NEW_LINE>throw new AuthenticationFlowException(AuthenticationFlowError.UNKNOWN_USER);<NEW_LINE>}<NEW_LINE>if (!authenticationFlow.isSuccessful()) {<NEW_LINE>throw new AuthenticationFlowException(authenticationFlow.getFlowExceptions());<NEW_LINE>}<NEW_LINE>return authenticationComplete();<NEW_LINE>} | AUTH_METHOD, authenticationSession.getProtocol()); |
91,168 | protected void consumeNormalAnnotation(boolean isTypeAnnotation) {<NEW_LINE>// NormalTypeAnnotation ::= TypeAnnotationName '(' MemberValuePairsopt ')'<NEW_LINE>// NormalAnnotation ::= AnnotationName '(' MemberValuePairsopt ')'<NEW_LINE>NormalAnnotation normalAnnotation = null;<NEW_LINE>int oldIndex = this.identifierPtr;<NEW_LINE>TypeReference typeReference = getAnnotationType();<NEW_LINE>normalAnnotation = new NormalAnnotation(typeReference, this.intStack[this.intPtr--]);<NEW_LINE>int length;<NEW_LINE>if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) {<NEW_LINE>System.arraycopy(this.astStack, (this.astPtr -= length) + 1, normalAnnotation.memberValuePairs = new MemberValuePair<MASK><NEW_LINE>}<NEW_LINE>normalAnnotation.declarationSourceEnd = this.rParenPos;<NEW_LINE>if (isTypeAnnotation) {<NEW_LINE>pushOnTypeAnnotationStack(normalAnnotation);<NEW_LINE>} else {<NEW_LINE>pushOnExpressionStack(normalAnnotation);<NEW_LINE>}<NEW_LINE>if (this.currentElement != null) {<NEW_LINE>annotationRecoveryCheckPoint(normalAnnotation.sourceStart, normalAnnotation.declarationSourceEnd);<NEW_LINE>if (this.currentElement instanceof RecoveredAnnotation) {<NEW_LINE>this.currentElement = ((RecoveredAnnotation) this.currentElement).addAnnotation(normalAnnotation, oldIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!this.statementRecoveryActivated && this.options.sourceLevel < ClassFileConstants.JDK1_5 && this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {<NEW_LINE>problemReporter().invalidUsageOfAnnotation(normalAnnotation);<NEW_LINE>}<NEW_LINE>this.recordStringLiterals = true;<NEW_LINE>} | [length], 0, length); |
1,413,275 | protected HttpClient newHttpClient() {<NEW_LINE>ServletConfig config = getServletConfig();<NEW_LINE>String scriptRoot = config.getInitParameter(SCRIPT_ROOT_INIT_PARAM);<NEW_LINE>if (scriptRoot == null)<NEW_LINE>throw new IllegalArgumentException("Mandatory parameter '" + SCRIPT_ROOT_INIT_PARAM + "' not configured");<NEW_LINE>ClientConnector connector;<NEW_LINE>String <MASK><NEW_LINE>if (unixDomainPath != null) {<NEW_LINE>connector = ClientConnector.forUnixDomain(Path.of(unixDomainPath));<NEW_LINE>} else {<NEW_LINE>int selectors = Math.max(1, ProcessorUtils.availableProcessors() / 2);<NEW_LINE>String value = config.getInitParameter("selectors");<NEW_LINE>if (value != null)<NEW_LINE>selectors = Integer.parseInt(value);<NEW_LINE>connector = new ClientConnector();<NEW_LINE>connector.setSelectors(selectors);<NEW_LINE>}<NEW_LINE>return new HttpClient(new ProxyHttpClientTransportOverFCGI(connector, scriptRoot));<NEW_LINE>} | unixDomainPath = config.getInitParameter("unixDomainPath"); |
1,442,383 | private void importItems(String appId, Env env, String clusterName, String namespaceName, String configText, NamespaceDTO namespaceDTO, String operator) {<NEW_LINE>List<ItemDTO> toImportItems = gson.fromJson(configText, GsonType.ITEM_DTOS);<NEW_LINE>toImportItems.parallelStream().forEach(newItem -> {<NEW_LINE>String key = newItem.getKey();<NEW_LINE>newItem.setNamespaceId(namespaceDTO.getId());<NEW_LINE>newItem.setDataChangeCreatedBy(operator);<NEW_LINE>newItem.setDataChangeLastModifiedBy(operator);<NEW_LINE>newItem.setDataChangeCreatedTime(new Date());<NEW_LINE>newItem.setDataChangeLastModifiedTime(new Date());<NEW_LINE>if (StringUtils.hasText(key)) {<NEW_LINE>// create or update normal item<NEW_LINE>try {<NEW_LINE>ItemDTO oldItem = itemService.loadItem(env, appId, clusterName, namespaceName, key);<NEW_LINE>newItem.setId(oldItem.getId());<NEW_LINE>// existed<NEW_LINE>itemService.updateItem(appId, env, clusterName, namespaceName, newItem);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (e instanceof HttpStatusCodeException && ((HttpStatusCodeException) e).getStatusCode().equals(HttpStatus.NOT_FOUND)) {<NEW_LINE>// not existed<NEW_LINE>itemService.createItem(appId, env, clusterName, namespaceName, newItem);<NEW_LINE>} else {<NEW_LINE>LOGGER.error("Load or update item error. appId = {}, env = {}, cluster = {}, namespace = {}", appId, env, clusterName, namespaceDTO, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (StringUtils.hasText(newItem.getComment())) {<NEW_LINE>// create comment item<NEW_LINE>itemService.createCommentItem(appId, <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | env, clusterName, namespaceName, newItem); |
423,475 | public void marshall(Fleet fleet, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (fleet == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(fleet.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(fleet.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getImageName(), IMAGENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getImageArn(), IMAGEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getInstanceType(), INSTANCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getFleetType(), FLEETTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getComputeCapacityStatus(), COMPUTECAPACITYSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getMaxUserDurationInSeconds(), MAXUSERDURATIONINSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getDisconnectTimeoutInSeconds(), DISCONNECTTIMEOUTINSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getState(), STATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getVpcConfig(), VPCCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getCreatedTime(), CREATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getFleetErrors(), FLEETERRORS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getEnableDefaultInternetAccess(), ENABLEDEFAULTINTERNETACCESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getDomainJoinInfo(), DOMAINJOININFO_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getIdleDisconnectTimeoutInSeconds(), IDLEDISCONNECTTIMEOUTINSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getIamRoleArn(), IAMROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getStreamView(), STREAMVIEW_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getPlatform(), PLATFORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getMaxConcurrentSessions(), MAXCONCURRENTSESSIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(fleet.getUsbDeviceFilterStrings(), USBDEVICEFILTERSTRINGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | fleet.getDisplayName(), DISPLAYNAME_BINDING); |
121,441 | private String preprocessCreateResultWrapperShape(ServiceModel serviceModel, String operationName, OperationModifier modifier) {<NEW_LINE>String wrappedShapeName = modifier.getWrappedResultShape();<NEW_LINE>Shape wrappedShape = serviceModel.getShapes().get(wrappedShapeName);<NEW_LINE>String wrapperShapeName = operationName + Constant.RESPONSE_CLASS_SUFFIX;<NEW_LINE>String wrappedAsMember = modifier.getWrappedResultMember();<NEW_LINE>if (serviceModel.getShapes().containsKey(wrapperShapeName)) {<NEW_LINE>throw new IllegalStateException(wrapperShapeName + " shape already exists in the service model.");<NEW_LINE>}<NEW_LINE>Shape wrapperShape = createWrapperShape(wrapperShapeName, wrappedShapeName, wrappedShape, wrappedAsMember);<NEW_LINE>// Add the new shape to the model<NEW_LINE>serviceModel.getShapes().put(wrapperShapeName, wrapperShape);<NEW_LINE>// Update the operation model to point to this new shape<NEW_LINE>Operation operation = serviceModel.<MASK><NEW_LINE>operation.getOutput().setShape(wrapperShapeName);<NEW_LINE>return wrapperShapeName;<NEW_LINE>} | getOperations().get(operationName); |
736,420 | final ListWorkloadsResult executeListWorkloads(ListWorkloadsRequest listWorkloadsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listWorkloadsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListWorkloadsRequest> request = null;<NEW_LINE>Response<ListWorkloadsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListWorkloadsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listWorkloadsRequest));<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, "WellArchitected");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListWorkloads");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListWorkloadsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListWorkloadsResultJsonUnmarshaller());<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); |
970,710 | public synchronized void startup(Context context) {<NEW_LINE>if (mIsStarted) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mContext = context.getApplicationContext();<NEW_LINE>mIsStarted = true;<NEW_LINE>mBundle = null;<NEW_LINE>IntentFilter intentFilter = new IntentFilter();<NEW_LINE>intentFilter.addAction(WifiScanner.ACTION_WIFIS_SCANNED);<NEW_LINE>intentFilter.addAction(CellScanner.ACTION_CELLS_SCANNED);<NEW_LINE>intentFilter.addAction(GPSScanner.ACTION_GPS_UPDATED);<NEW_LINE>intentFilter.addAction(PressureScanner.ACTION_PRESSURE_SCANNED);<NEW_LINE>intentFilter.addAction(StumblerServiceIntentActions.SVC_REQ_OBSERVATION_PT);<NEW_LINE>intentFilter.addAction(StumblerServiceIntentActions.SVC_REQ_UNIQUE_CELL_COUNT);<NEW_LINE>intentFilter.addAction(StumblerServiceIntentActions.SVC_REQ_UNIQUE_WIFI_COUNT);<NEW_LINE>intentFilter.addAction(ACTION_FLUSH_TO_BUNDLE);<NEW_LINE>LocalBroadcastManager.getInstance(mContext<MASK><NEW_LINE>} | ).registerReceiver(this, intentFilter); |
1,157,387 | private Mono<PagedResponse<AutoScaleVCoreInner>> listSinglePageAsync() {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)).<PagedResponse<AutoScaleVCoreInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>} | )).readOnly())); |
298,447 | public Mono<ServiceBusMessageBatch> createMessageBatch(CreateMessageBatchOptions options) {<NEW_LINE>if (isDisposed.get()) {<NEW_LINE>return monoError(LOGGER, new IllegalStateException(String.format(INVALID_OPERATION_DISPOSED_SENDER, "createMessageBatch")));<NEW_LINE>}<NEW_LINE>if (Objects.isNull(options)) {<NEW_LINE>return monoError(<MASK><NEW_LINE>}<NEW_LINE>final int maxSize = options.getMaximumSizeInBytes();<NEW_LINE>return getSendLink().flatMap(link -> link.getLinkSize().flatMap(size -> {<NEW_LINE>final int maximumLinkSize = size > 0 ? size : MAX_MESSAGE_LENGTH_BYTES;<NEW_LINE>if (maxSize > maximumLinkSize) {<NEW_LINE>return monoError(LOGGER, new IllegalArgumentException(String.format(Locale.US, "CreateMessageBatchOptions.getMaximumSizeInBytes (%s bytes) is larger than the link size" + " (%s bytes).", maxSize, maximumLinkSize)));<NEW_LINE>}<NEW_LINE>final int batchSize = maxSize > 0 ? maxSize : maximumLinkSize;<NEW_LINE>return Mono.just(new ServiceBusMessageBatch(batchSize, link::getErrorContext, tracerProvider, messageSerializer, entityName, getFullyQualifiedNamespace()));<NEW_LINE>})).onErrorMap(this::mapError);<NEW_LINE>} | LOGGER, new NullPointerException("'options' cannot be null.")); |
1,640,061 | synchronized Map<String, String> properties(boolean resolveBase) {<NEW_LINE>if (properties == null) {<NEW_LINE>properties = new HashMap<String, String>();<NEW_LINE>String basedir = mainPropertiesFile.getParent();<NEW_LINE>for (Map.Entry<String, String> entry : loadProperties(mainPropertiesFile).entrySet()) {<NEW_LINE>String value = entry.getValue();<NEW_LINE>if (resolveBase) {<NEW_LINE>// NOI18N<NEW_LINE>value = value.replace("${base}", basedir);<NEW_LINE>}<NEW_LINE>properties.put(entry.getKey(), value.replace('/', File.separatorChar));<NEW_LINE>}<NEW_LINE>if (privatePropertiesFile != null) {<NEW_LINE>for (Map.Entry<String, String> entry : loadProperties(privatePropertiesFile).entrySet()) {<NEW_LINE>String value = entry.getValue();<NEW_LINE>if (resolveBase) {<NEW_LINE>// NOI18N<NEW_LINE>value = value.replace("${base}", basedir);<NEW_LINE>}<NEW_LINE>properties.put(entry.getKey(), value.replace<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return properties;<NEW_LINE>} | ('/', File.separatorChar)); |
1,193,637 | public boolean instantiateTo(int value, ICause cause) throws ContradictionException {<NEW_LINE>// BEWARE: THIS CODE SHOULD NOT BE MOVED TO THE DOMAIN TO NOT DECREASE PERFORMANCES!<NEW_LINE>assert cause != null;<NEW_LINE>if (!contains(value)) {<NEW_LINE>model.getSolver().getEventObserver().instantiateTo(this, value, cause, getLB(), getUB());<NEW_LINE>this.contradiction(cause, MSG_INST);<NEW_LINE>} else if (!isInstantiated()) {<NEW_LINE>model.getSolver().getEventObserver().instantiateTo(this, value, cause, getLB(), getUB());<NEW_LINE>int index = V2I.get(value);<NEW_LINE>assert index > -1 && this.INDICES.get(index);<NEW_LINE>if (reactOnRemoval) {<NEW_LINE>for (int i = INDICES.nextSetBit(LB.get()); i >= 0; i = INDICES.nextSetBit(i + 1)) {<NEW_LINE>if (i != index) {<NEW_LINE>delta.add(VALUES[i], cause);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.INDICES.clear();<NEW_LINE><MASK><NEW_LINE>this.LB.set(index);<NEW_LINE>this.UB.set(index);<NEW_LINE>this.SIZE.set(1);<NEW_LINE>assert !INDICES.isEmpty();<NEW_LINE>this.notifyPropagators(IntEventType.INSTANTIATE, cause);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | this.INDICES.set(index); |
1,224,974 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.contacts_preference);<NEW_LINE>// setup toolbar<NEW_LINE>setupToolbar();<NEW_LINE>// setup drawer<NEW_LINE>// setupDrawer(R.id.nav_contacts); // TODO needed?<NEW_LINE>// show sidebar?<NEW_LINE>boolean showSidebar = getIntent().getBooleanExtra(EXTRA_SHOW_SIDEBAR, true);<NEW_LINE>if (!showSidebar) {<NEW_LINE>setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);<NEW_LINE>if (getSupportActionBar() != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (mDrawerToggle != null) {<NEW_LINE>mDrawerToggle.setDrawerIndicatorEnabled(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Intent intent = getIntent();<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();<NEW_LINE>if (intent == null || intent.getParcelableExtra(EXTRA_FILE) == null || intent.getParcelableExtra(EXTRA_USER) == null) {<NEW_LINE>BackupFragment fragment = BackupFragment.create(showSidebar);<NEW_LINE>transaction.add(R.id.frame_container, fragment);<NEW_LINE>} else {<NEW_LINE>OCFile file = intent.getParcelableExtra(EXTRA_FILE);<NEW_LINE>User user = intent.getParcelableExtra(EXTRA_USER);<NEW_LINE>BackupListFragment contactListFragment = BackupListFragment.newInstance(file, user);<NEW_LINE>transaction.add(R.id.frame_container, contactListFragment);<NEW_LINE>}<NEW_LINE>transaction.commit();<NEW_LINE>}<NEW_LINE>} | getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
1,822,177 | protected BeanDefinitionBuilder buildBeanDefinition(Element element, ParserContext parserContext) {<NEW_LINE>BeanDefinitionBuilder builder = null;<NEW_LINE>Element queueElement;<NEW_LINE>String fixedSubscriberChannel = element.getAttribute("fixed-subscriber");<NEW_LINE>boolean isFixedSubscriber = "true".equalsIgnoreCase(fixedSubscriberChannel.trim());<NEW_LINE>// configure a queue-based channel if any queue sub-element is defined<NEW_LINE>String channel = element.getAttribute(ID_ATTRIBUTE);<NEW_LINE>if ((queueElement = DomUtils.getChildElementByTagName(element, "queue")) != null) {<NEW_LINE>// NOSONAR inner assignment<NEW_LINE>builder = queue(element, parserContext, queueElement, channel);<NEW_LINE>} else if ((queueElement = DomUtils.getChildElementByTagName(element, "priority-queue")) != null) {<NEW_LINE>// NOSONAR<NEW_LINE>builder = priorityQueue(element, parserContext, queueElement, channel);<NEW_LINE>} else if ((queueElement = DomUtils.getChildElementByTagName(element, "rendezvous-queue")) != null) {<NEW_LINE>// NOSONAR<NEW_LINE>builder = BeanDefinitionBuilder.genericBeanDefinition(RendezvousChannel.class);<NEW_LINE>}<NEW_LINE>Element dispatcherElement = DomUtils.getChildElementByTagName(element, "dispatcher");<NEW_LINE>// verify that a dispatcher is not provided if a queue sub-element exists<NEW_LINE>if (queueElement != null && dispatcherElement != null) {<NEW_LINE>parserContext.getReaderContext().error("The 'dispatcher' sub-element and any queue sub-element are mutually exclusive.", element);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (queueElement != null) {<NEW_LINE>if (isFixedSubscriber) {<NEW_LINE>parserContext.getReaderContext().error("The 'fixed-subscriber' attribute is not allowed when a <queue/> child element is present.", element);<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}<NEW_LINE>if (dispatcherElement == null) {<NEW_LINE>// configure the default DirectChannel with a RoundRobinLoadBalancingStrategy<NEW_LINE>builder = BeanDefinitionBuilder.genericBeanDefinition(isFixedSubscriber ? <MASK><NEW_LINE>} else {<NEW_LINE>builder = dispatcher(element, parserContext, isFixedSubscriber, dispatcherElement);<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>} | FixedSubscriberChannel.class : DirectChannel.class); |
942,796 | // GEN-LAST:event_btnCancelActionPerformed<NEW_LINE>private void btnRegisterActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_btnRegisterActionPerformed<NEW_LINE>if (!Arrays.equals(this.txtPassword.getPassword(), this.txtPasswordConfirmation.getPassword())) {<NEW_LINE>MageFrame.getInstance().showError("Passwords don't match.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>connection = new Connection();<NEW_LINE>connection.setHost(this.txtServer.getText().trim());<NEW_LINE>connection.setPort(Integer.valueOf(this.txtPort.getText().trim()));<NEW_LINE>connection.setUsername(this.txtUserName.getText().trim());<NEW_LINE>connection.setPassword(String.valueOf(this.txtPassword.getPassword<MASK><NEW_LINE>connection.setEmail(this.txtEmail.getText().trim());<NEW_LINE>PreferencesDialog.setProxyInformation(connection);<NEW_LINE>task = new ConnectTask();<NEW_LINE>task.execute();<NEW_LINE>} | ()).trim()); |
1,030,382 | protected void beforeCompletion(EJBContextImpl context) {<NEW_LINE>// SessionSync calls on TX_BEAN_MANAGED SessionBeans<NEW_LINE>// are not allowed<NEW_LINE>// Do not call beforeCompletion if it is a transactional lifecycle callback<NEW_LINE>if (isBeanManagedTran || beforeCompletionMethod == null || ((SessionContextImpl) context).getInLifeCycleCallback()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object ejb = context.getEJB();<NEW_LINE>// No need to check for a concurrent invocation<NEW_LINE>// because beforeCompletion can only be called after<NEW_LINE>// all business methods are completed.<NEW_LINE>EjbInvocation inv = super.createEjbInvocation(ejb, context);<NEW_LINE>invocationManager.preInvoke(inv);<NEW_LINE>try {<NEW_LINE>transactionManager.enlistComponentResources();<NEW_LINE><MASK><NEW_LINE>} catch (Exception ex) {<NEW_LINE>// Error during beforeCompletion, so discard bean: EJB2.0 18.3.3<NEW_LINE>try {<NEW_LINE>forceDestroyBean(context);<NEW_LINE>} catch (Exception e) {<NEW_LINE>_logger.log(Level.FINE, "error destroying bean", e);<NEW_LINE>}<NEW_LINE>throw new EJBException("Error during SessionSynchronization.beforeCompletion, EJB instance discarded", ex);<NEW_LINE>} finally {<NEW_LINE>invocationManager.postInvoke(inv);<NEW_LINE>}<NEW_LINE>} | beforeCompletionMethod.invoke(ejb, null); |
876,165 | public UpdateByQueryRequest updateByQueryRequest(UpdateQuery query, IndexCoordinates index) {<NEW_LINE>String indexName = index.getIndexName();<NEW_LINE>final UpdateByQueryRequest updateByQueryRequest = new UpdateByQueryRequest(indexName);<NEW_LINE>updateByQueryRequest.setScript(getScript(query));<NEW_LINE>if (query.getAbortOnVersionConflict() != null) {<NEW_LINE>updateByQueryRequest.setAbortOnVersionConflict(query.getAbortOnVersionConflict());<NEW_LINE>}<NEW_LINE>if (query.getBatchSize() != null) {<NEW_LINE>updateByQueryRequest.setBatchSize(query.getBatchSize());<NEW_LINE>}<NEW_LINE>if (query.getQuery() != null) {<NEW_LINE>final Query queryQuery = query.getQuery();<NEW_LINE>updateByQueryRequest<MASK><NEW_LINE>if (queryQuery.getIndicesOptions() != null) {<NEW_LINE>updateByQueryRequest.setIndicesOptions(toElasticsearchIndicesOptions(queryQuery.getIndicesOptions()));<NEW_LINE>}<NEW_LINE>if (queryQuery.getScrollTime() != null) {<NEW_LINE>updateByQueryRequest.setScroll(TimeValue.timeValueMillis(queryQuery.getScrollTime().toMillis()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (query.getMaxDocs() != null) {<NEW_LINE>updateByQueryRequest.setMaxDocs(query.getMaxDocs());<NEW_LINE>}<NEW_LINE>if (query.getMaxRetries() != null) {<NEW_LINE>updateByQueryRequest.setMaxRetries(query.getMaxRetries());<NEW_LINE>}<NEW_LINE>if (query.getPipeline() != null) {<NEW_LINE>updateByQueryRequest.setPipeline(query.getPipeline());<NEW_LINE>}<NEW_LINE>if (query.getRefreshPolicy() != null) {<NEW_LINE>updateByQueryRequest.setRefresh(query.getRefreshPolicy() == RefreshPolicy.IMMEDIATE);<NEW_LINE>}<NEW_LINE>if (query.getRequestsPerSecond() != null) {<NEW_LINE>updateByQueryRequest.setRequestsPerSecond(query.getRequestsPerSecond());<NEW_LINE>}<NEW_LINE>if (query.getRouting() != null) {<NEW_LINE>updateByQueryRequest.setRouting(query.getRouting());<NEW_LINE>}<NEW_LINE>if (query.getShouldStoreResult() != null) {<NEW_LINE>updateByQueryRequest.setShouldStoreResult(query.getShouldStoreResult());<NEW_LINE>}<NEW_LINE>if (query.getSlices() != null) {<NEW_LINE>updateByQueryRequest.setSlices(query.getSlices());<NEW_LINE>}<NEW_LINE>if (query.getTimeout() != null) {<NEW_LINE>updateByQueryRequest.setTimeout(query.getTimeout());<NEW_LINE>}<NEW_LINE>if (query.getWaitForActiveShards() != null) {<NEW_LINE>updateByQueryRequest.setWaitForActiveShards(ActiveShardCount.parseString(query.getWaitForActiveShards()));<NEW_LINE>}<NEW_LINE>return updateByQueryRequest;<NEW_LINE>} | .setQuery(getQuery(queryQuery)); |
978,625 | public synchronized List<SingleAnalysis> analyze(Token token) {<NEW_LINE>SecondaryPos sPos = guessSecondaryPosType(token);<NEW_LINE>String word = token.getText();<NEW_LINE>// TODO: for now, for regular words and numbers etc, use the analyze method.<NEW_LINE>if (sPos == SecondaryPos.None) {<NEW_LINE>if (word.contains("?")) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>if (alphabet.containsDigit(word)) {<NEW_LINE>return tryNumeral(token);<NEW_LINE>} else {<NEW_LINE>return analyzeWord(word, word.contains(".") ? SecondaryPos.Abbreviation : SecondaryPos.ProperNoun);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sPos == SecondaryPos.RomanNumeral) {<NEW_LINE>return getForRomanNumeral(token);<NEW_LINE>}<NEW_LINE>if (sPos == SecondaryPos.Date || sPos == SecondaryPos.Clock) {<NEW_LINE>return tryNumeral(token);<NEW_LINE>}<NEW_LINE>// TODO: consider returning analysis results without interfering with analyzer.<NEW_LINE>String normalized = nonLettersPattern.matcher<MASK><NEW_LINE>DictionaryItem item = new DictionaryItem(word, word, normalized, PrimaryPos.Noun, sPos);<NEW_LINE>if (sPos == SecondaryPos.HashTag || sPos == SecondaryPos.Email || sPos == SecondaryPos.Url || sPos == SecondaryPos.Mention) {<NEW_LINE>return analyzeWord(word, sPos);<NEW_LINE>}<NEW_LINE>boolean itemDoesNotExist = !lexicon.containsItem(item);<NEW_LINE>if (itemDoesNotExist) {<NEW_LINE>item.attributes.add(RootAttribute.Runtime);<NEW_LINE>analyzer.getStemTransitions().addDictionaryItem(item);<NEW_LINE>}<NEW_LINE>List<SingleAnalysis> results = analyzer.analyze(word);<NEW_LINE>if (itemDoesNotExist) {<NEW_LINE>analyzer.getStemTransitions().removeDictionaryItem(item);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | (word).replaceAll(""); |
431,811 | private void tryConnect() throws JSchException, IOException {<NEW_LINE>connectionAttempts++;<NEW_LINE>if (connectionAttempts > 1) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(2000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// ignored<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!session.isConnected()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>((ChannelExec) channel).setCommand("telnet localhost 6571");<NEW_LINE>InputStream inputStream = channel.getInputStream();<NEW_LINE>InputStream errStream = ((ChannelExec) channel).getErrStream();<NEW_LINE>channel.connect();<NEW_LINE>inputConsumer = new MessageSiphon(inputStream, this);<NEW_LINE>new MessageSiphon(errStream, this);<NEW_LINE>if (connectionAttempts > 1) {<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>if (channel.isConnected()) {<NEW_LINE>NetworkMonitor.this.message(tr("connected!") + '\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | channel = session.openChannel("exec"); |
928,564 | public static void _deleteChildrenAssetsFromFolder(Folder folder, Set<Inode> objectsList) throws DotDataException, DotStateException, DotSecurityException {<NEW_LINE>PermissionAPI perAPI = APILocator.getPermissionAPI();<NEW_LINE>FolderAPI fapi = APILocator.getFolderAPI();<NEW_LINE>List<Link> links = fapi.getLinks(folder, APILocator.getUserAPI(<MASK><NEW_LINE>for (Link link : links) {<NEW_LINE>if (link.isWorking()) {<NEW_LINE>Identifier identifier = APILocator.getIdentifierAPI().find(link);<NEW_LINE>if (!InodeUtils.isSet(identifier.getInode())) {<NEW_LINE>Logger.warn(FolderFactory.class, "_deleteChildrenAssetsFromFolder: link inode = " + link.getInode() + " doesn't have a valid identifier associated.");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>perAPI.removePermissions(link);<NEW_LINE>List<Versionable> versions = APILocator.getVersionableAPI().findAllVersions(identifier, APILocator.getUserAPI().getSystemUser(), false);<NEW_LINE>for (Versionable version : versions) {<NEW_LINE>new HibernateUtil().delete(version);<NEW_LINE>}<NEW_LINE>APILocator.getIdentifierAPI().delete(identifier);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).getSystemUser(), false); |
703,860 | public Route.Handler apply(@Nonnull Route.Handler next) {<NEW_LINE>long timestamp = System.currentTimeMillis();<NEW_LINE>return ctx -> {<NEW_LINE>// Take remote address here (less chances of loosing it on interrupted requests).<NEW_LINE>String remoteAddr = ctx.getRemoteAddress();<NEW_LINE>ctx.onComplete(context -> {<NEW_LINE>StringBuilder sb = new StringBuilder(MESSAGE_SIZE);<NEW_LINE>sb.append(remoteAddr);<NEW_LINE>sb.append(SP).append(DASH).append(SP);<NEW_LINE>sb.append(userId.apply(ctx));<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(BL).append(df.apply(timestamp)).append(BR);<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(Q).append(ctx.getMethod());<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(ctx.getRequestPath());<NEW_LINE>sb.append(ctx.queryString());<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(ctx.getProtocol());<NEW_LINE>sb.append<MASK><NEW_LINE>sb.append(ctx.getResponseCode().value());<NEW_LINE>sb.append(SP);<NEW_LINE>long responseLength = ctx.getResponseLength();<NEW_LINE>sb.append(responseLength >= 0 ? responseLength : DASH);<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(now - timestamp);<NEW_LINE>appendHeaders(sb, requestHeaders, h -> ctx.header(h).valueOrNull());<NEW_LINE>appendHeaders(sb, responseHeaders, h -> ctx.getResponseHeader(h));<NEW_LINE>logRecord.accept(sb.toString());<NEW_LINE>});<NEW_LINE>return next.apply(ctx);<NEW_LINE>};<NEW_LINE>} | (Q).append(SP); |
1,837,576 | private void sendModifyStoragePoolCommand(ModifyStoragePoolCommand cmd, StoragePool storagePool, long hostId) {<NEW_LINE>Answer answer = _agentMgr.easySend(hostId, cmd);<NEW_LINE>if (answer == null) {<NEW_LINE>throw new CloudRuntimeException("Unable to get an answer to the modify storage pool command (" + storagePool.getId() + ")");<NEW_LINE>}<NEW_LINE>if (!answer.getResult()) {<NEW_LINE>String msg = "Unable to attach storage pool " + storagePool<MASK><NEW_LINE>_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, storagePool.getDataCenterId(), storagePool.getPodId(), msg, msg);<NEW_LINE>throw new CloudRuntimeException("Unable to establish a connection from agent to storage pool " + storagePool.getId() + " due to " + answer.getDetails() + " (" + storagePool.getId() + ")");<NEW_LINE>}<NEW_LINE>assert (answer instanceof ModifyStoragePoolAnswer) : "ModifyStoragePoolAnswer expected ; Pool = " + storagePool.getId() + " Host = " + hostId;<NEW_LINE>s_logger.info("Connection established between storage pool " + storagePool + " and host: " + hostId);<NEW_LINE>} | .getId() + " to host " + hostId; |
868,297 | public static List<Allele> filterToMaxNumberOfAltAllelesBasedOnScores(int numAltAllelesToKeep, List<Allele> alleles, double[] likelihoodSums) {<NEW_LINE>final int nonRefAltAlleleIndex = alleles.indexOf(Allele.NON_REF_ALLELE);<NEW_LINE>final int numAlleles = alleles.size();<NEW_LINE>final Set<Integer> properAltIndexesToKeep = IntStream.range(1, numAlleles).filter(n -> n != nonRefAltAlleleIndex).boxed().sorted(Comparator.comparingDouble((Integer n) -> likelihoodSums[n]).reversed()).limit(numAltAllelesToKeep).collect(Collectors.toSet());<NEW_LINE>return IntStream.range(0, numAlleles).filter(i -> i == 0 || i == nonRefAltAlleleIndex || properAltIndexesToKeep.contains(i)).mapToObj(alleles::get).<MASK><NEW_LINE>} | collect(Collectors.toList()); |
291,338 | private void processMemoryReference(XmlElement element, boolean overwrite) {<NEW_LINE>try {<NEW_LINE>String fromAddrStr = element.getAttribute("ADDRESS");<NEW_LINE>if (fromAddrStr == null) {<NEW_LINE>throw new XmlAttributeException("ADDRESS attribute missing for MEMORY_REFERENCE element");<NEW_LINE>}<NEW_LINE>Address fromAddr = XmlProgramUtilities.parseAddress(factory, fromAddrStr);<NEW_LINE>if (fromAddr == null) {<NEW_LINE>throw new AddressFormatException("Incompatible Memory Reference FROM Address: " + fromAddrStr);<NEW_LINE>}<NEW_LINE>String toAddrStr = element.getAttribute("TO_ADDRESS");<NEW_LINE>if (toAddrStr == null) {<NEW_LINE>throw new XmlAttributeException("TO_ADDRESS attribute missing for MEMORY_REFERENCE element");<NEW_LINE>}<NEW_LINE>Address toAddr = XmlProgramUtilities.parseAddress(factory, toAddrStr);<NEW_LINE>if (toAddr == null) {<NEW_LINE>throw new AddressFormatException("Incompatible Memory Reference TO Address: " + toAddrStr);<NEW_LINE>}<NEW_LINE>int opIndex = CodeUnit.MNEMONIC;<NEW_LINE>if (element.hasAttribute("OPERAND_INDEX")) {<NEW_LINE>opIndex = XmlUtilities.parseInt(element.getAttribute("OPERAND_INDEX"));<NEW_LINE>if (opIndex < 0) {<NEW_LINE>throw new XmlAttributeException("Illegal OPERAND_INDEX value [" + opIndex + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean userDefined = true;<NEW_LINE>if (element.hasAttribute("USER_DEFINED")) {<NEW_LINE>userDefined = XmlUtilities.parseBoolean(element.getAttribute("USER_DEFINED"));<NEW_LINE>}<NEW_LINE>boolean primary = false;<NEW_LINE>if (element.hasAttribute("PRIMARY")) {<NEW_LINE>primary = XmlUtilities.parseBoolean(element.getAttribute("PRIMARY"));<NEW_LINE>}<NEW_LINE>Address baseAddr = null;<NEW_LINE>if (element.hasAttribute("BASE_ADDRESS")) {<NEW_LINE>baseAddr = XmlProgramUtilities.parseAddress(factory, element.getAttribute("BASE_ADDRESS"));<NEW_LINE>}<NEW_LINE>if (!overwrite) {<NEW_LINE>Reference existingMemRef = refManager.getReference(fromAddr, toAddr, opIndex);<NEW_LINE>if (existingMemRef != null) {<NEW_LINE>log.appendMsg("Memory reference already existed from [" + fromAddr + "] to [" + toAddr + "] on operand [" + opIndex + "]");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RefType refType = <MASK><NEW_LINE>Command cmd = null;<NEW_LINE>if (baseAddr != null) {<NEW_LINE>long offset = toAddr.subtract(baseAddr);<NEW_LINE>cmd = new AddOffsetMemRefCmd(fromAddr, toAddr, false, refType, userDefined ? SourceType.USER_DEFINED : SourceType.DEFAULT, opIndex, offset);<NEW_LINE>} else {<NEW_LINE>cmd = new AddMemRefCmd(fromAddr, toAddr, refType, userDefined ? SourceType.USER_DEFINED : SourceType.DEFAULT, opIndex);<NEW_LINE>}<NEW_LINE>cmd.applyTo(program);<NEW_LINE>cmd = new SetPrimaryRefCmd(fromAddr, opIndex, toAddr, primary);<NEW_LINE>cmd.applyTo(program);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.appendException(e);<NEW_LINE>}<NEW_LINE>} | getDefaultRefType(fromAddr, toAddr, opIndex); |
317,596 | private Instruction pseudoDisassemble(Address addr) throws UnknownInstructionException {<NEW_LINE>Instruction instr;<NEW_LINE>if (lastPseudoInstructionBlock != null) {<NEW_LINE>instr = lastPseudoInstructionBlock.getInstructionAt(addr);<NEW_LINE>if (instr != null) {<NEW_LINE>return instr;<NEW_LINE>}<NEW_LINE>InstructionError error = lastPseudoInstructionBlock.getInstructionConflict();<NEW_LINE>if (error != null && addr.equals(error.getInstructionAddress())) {<NEW_LINE>throw new UnknownInstructionException(error.getConflictMessage());<NEW_LINE>}<NEW_LINE>lastPseudoInstructionBlock = null;<NEW_LINE>}<NEW_LINE>if (pseudoDisassembler == null) {<NEW_LINE>pseudoDisassembler = Disassembler.getDisassembler(program, false, false, false, TaskMonitor.DUMMY, msg -> {<NEW_LINE>// TODO: Should we log errors?<NEW_LINE>});<NEW_LINE>}<NEW_LINE>RegisterValue entryContext = null;<NEW_LINE>ProgramContext programContext = program.getProgramContext();<NEW_LINE>Register baseContextRegister = programContext.getBaseContextRegister();<NEW_LINE>if (baseContextRegister != null) {<NEW_LINE>entryContext = programContext.getRegisterValue(baseContextRegister, funcEntry);<NEW_LINE>}<NEW_LINE>lastPseudoInstructionBlock = pseudoDisassembler.pseudoDisassembleBlock(addr, entryContext, 64);<NEW_LINE>if (lastPseudoInstructionBlock != null) {<NEW_LINE>// Look for zero-byte run first<NEW_LINE>InstructionError error = lastPseudoInstructionBlock.getInstructionConflict();<NEW_LINE>if (error != null && error.getConflictMessage().startsWith("Maximum run of Zero-Byte")) {<NEW_LINE>// Don't return any of the zero-byte instructions<NEW_LINE>throw new UnknownInstructionException(error.getConflictMessage());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (instr != null) {<NEW_LINE>return instr;<NEW_LINE>}<NEW_LINE>if (error != null && addr.equals(error.getInstructionAddress())) {<NEW_LINE>throw new UnknownInstructionException(error.getConflictMessage());<NEW_LINE>}<NEW_LINE>if (program.getMemory().isExternalBlockAddress(addr)) {<NEW_LINE>throw new UnknownInstructionException("Unable to disassemble EXTERNAL block location: " + addr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new UnknownInstructionException("Invalid instruction address (improperly aligned)");<NEW_LINE>} | instr = lastPseudoInstructionBlock.getInstructionAt(addr); |
541,996 | final CreateLagResult executeCreateLag(CreateLagRequest createLagRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLagRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateLagRequest> request = null;<NEW_LINE>Response<CreateLagResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLagRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLagRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLag");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateLagResult>> 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 CreateLagResultJsonUnmarshaller()); |
115,381 | static <T> T visit(SchemaZipFold<T> zipFold, Context context, FieldType left, FieldType right) {<NEW_LINE>if (left.getTypeName() != right.getTypeName()) {<NEW_LINE>return zipFold.accept(context, left, right);<NEW_LINE>}<NEW_LINE>Context newContext = context.withParent(left.getTypeName());<NEW_LINE>switch(left.getTypeName()) {<NEW_LINE>case ARRAY:<NEW_LINE>case ITERABLE:<NEW_LINE>return zipFold.accumulate(zipFold.accept(context, left, right), visit(zipFold, newContext, left.getCollectionElementType(), right.getCollectionElementType()));<NEW_LINE>case ROW:<NEW_LINE>return visitRow(zipFold, newContext, left.getRowSchema(), right.getRowSchema());<NEW_LINE>case MAP:<NEW_LINE>return zipFold.accumulate(zipFold.accept(context, left, right), visit(zipFold, newContext, left.getCollectionElementType()<MASK><NEW_LINE>default:<NEW_LINE>return zipFold.accept(context, left, right);<NEW_LINE>}<NEW_LINE>} | , right.getCollectionElementType())); |
1,684,271 | public static <T, X extends Throwable> Tuple3<CompletableFuture<Subscription>, Runnable, CompletableFuture<Boolean>> forEachX(final FutureStream<T> stream, final long x, final Consumer<? super T> consumerElement) {<NEW_LINE>final CompletableFuture<Subscription> subscription = new CompletableFuture<>();<NEW_LINE>final CompletableFuture<Boolean> <MASK><NEW_LINE>return tuple(subscription, () -> {<NEW_LINE>stream.subscribe(new Subscriber<T>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSubscribe(final Subscription s) {<NEW_LINE>Objects.requireNonNull(s);<NEW_LINE>if (x != 0)<NEW_LINE>s.request(x);<NEW_LINE>subscription.complete(s);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNext(final T t) {<NEW_LINE>consumerElement.accept(t);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(final Throwable t) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete() {<NEW_LINE>streamCompleted.complete(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}, streamCompleted);<NEW_LINE>} | streamCompleted = new CompletableFuture<>(); |
1,570,769 | protected JPanel initResultsTable() {<NEW_LINE>ResultsTableCellRenderer renderer = new ResultsTableCellRenderer();<NEW_LINE>resultsModel = new ResultsModel(renderer);<NEW_LINE>resultsModel.addTableModelListener(e -> updateProgressLabel());<NEW_LINE>resultsTable = new ResultsTable(resultsModel, renderer);<NEW_LINE>resultsTable.setShowHorizontalLines(false);<NEW_LINE>resultsTable.setDragEnabled(false);<NEW_LINE>resultsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);<NEW_LINE>resultsTable.setColumnSelectionAllowed(false);<NEW_LINE>resultsTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);<NEW_LINE>resultsTable.setAutoscrolls(false);<NEW_LINE>resultsTable.setDefaultRenderer(Object.class, renderer);<NEW_LINE>Enumeration<TableColumn> columns = resultsTable.getColumnModel().getColumns();<NEW_LINE>while (columns.hasMoreElements()) {<NEW_LINE>TableColumn column = columns.nextElement();<NEW_LINE>column.setCellRenderer(renderer);<NEW_LINE>}<NEW_LINE>resultsTable.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent evt) {<NEW_LINE>if (evt.getClickCount() == 2) {<NEW_LINE>openSelectedItem();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>resultsTable.addKeyListener(new KeyAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void keyPressed(KeyEvent e) {<NEW_LINE>if (e.getKeyCode() == KeyEvent.VK_ENTER) {<NEW_LINE>openSelectedItem();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// override copy action to copy long string of node column<NEW_LINE>resultsTable.getActionMap().put("copy", new AbstractAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>JNode selectedNode = getSelectedNode();<NEW_LINE>if (selectedNode != null) {<NEW_LINE>UiUtils.copyToClipboard(selectedNode.makeLongString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>warnLabel = new JLabel();<NEW_LINE><MASK><NEW_LINE>warnLabel.setVisible(false);<NEW_LINE>JPanel resultsPanel = new JPanel();<NEW_LINE>resultsPanel.setLayout(new BoxLayout(resultsPanel, BoxLayout.PAGE_AXIS));<NEW_LINE>resultsPanel.add(warnLabel);<NEW_LINE>resultsPanel.add(new JScrollPane(resultsTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED));<NEW_LINE>JPanel paginationPanel = new JPanel();<NEW_LINE>paginationPanel.setAlignmentX(Component.LEFT_ALIGNMENT);<NEW_LINE>paginationPanel.setLayout(new BoxLayout(paginationPanel, BoxLayout.X_AXIS));<NEW_LINE>resultsInfoLabel = new JLabel("");<NEW_LINE>JButton nextPageButton = new JButton("->");<NEW_LINE>nextPageButton.setToolTipText(NLS.str("search_dialog.next_page"));<NEW_LINE>nextPageButton.addActionListener(e -> {<NEW_LINE>if (resultsModel.nextPage()) {<NEW_LINE>switchPage(renderer);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JButton prevPageButton = new JButton("<-");<NEW_LINE>prevPageButton.setToolTipText(NLS.str("search_dialog.prev_page"));<NEW_LINE>prevPageButton.addActionListener(e -> {<NEW_LINE>if (resultsModel.prevPage()) {<NEW_LINE>switchPage(renderer);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>paginationPanel.add(prevPageButton);<NEW_LINE>paginationPanel.add(nextPageButton);<NEW_LINE>paginationPanel.add(resultsInfoLabel);<NEW_LINE>resultsPanel.add(paginationPanel);<NEW_LINE>resultsPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));<NEW_LINE>return resultsPanel;<NEW_LINE>} | warnLabel.setForeground(Color.RED); |
870,520 | private RelDataType sqlType(RelDataTypeFactory typeFactory, int dataType, int precision, int scale, String typeString) {<NEW_LINE>// Fall back to ANY if type is unknown<NEW_LINE>final SqlTypeName sqlTypeName = Util.first(SqlTypeName.getNameForJdbcType(dataType), SqlTypeName.ANY);<NEW_LINE>switch(sqlTypeName) {<NEW_LINE>case ARRAY:<NEW_LINE>RelDataType component = null;<NEW_LINE>if (typeString != null && typeString.endsWith(" ARRAY")) {<NEW_LINE>// E.g. hsqldb gives "INTEGER ARRAY", so we deduce the component type<NEW_LINE>// "INTEGER".<NEW_LINE>final String remaining = typeString.substring(0, typeString.length() - " ARRAY".length());<NEW_LINE>component = parseTypeString(typeFactory, remaining);<NEW_LINE>}<NEW_LINE>if (component == null) {<NEW_LINE>component = typeFactory.createTypeWithNullability(typeFactory.createSqlType(SqlTypeName.ANY), true);<NEW_LINE>}<NEW_LINE>return typeFactory.createArrayType(component, -1);<NEW_LINE>}<NEW_LINE>if (precision >= 0 && scale >= 0 && sqlTypeName.allowsPrecScale(true, true)) {<NEW_LINE>return typeFactory.createSqlType(sqlTypeName, precision, scale);<NEW_LINE>} else if (precision >= 0 && sqlTypeName.allowsPrecNoScale()) {<NEW_LINE>return <MASK><NEW_LINE>} else {<NEW_LINE>assert sqlTypeName.allowsNoPrecNoScale();<NEW_LINE>return typeFactory.createSqlType(sqlTypeName);<NEW_LINE>}<NEW_LINE>} | typeFactory.createSqlType(sqlTypeName, precision); |
1,213,711 | static <VB extends CompositeValuesSourceBuilder<VB>, T> void declareValuesSourceFields(AbstractObjectParser<VB, T> objectParser, ValueType targetValueType) {<NEW_LINE>objectParser.declareField(VB::field, XContentParser::text, new ParseField("field"), ObjectParser.ValueType.STRING);<NEW_LINE>objectParser.declareField(VB::missing, XContentParser::objectText, new ParseField("missing"), ObjectParser.ValueType.VALUE);<NEW_LINE>objectParser.declareBoolean(VB::missingBucket, new ParseField("missing_bucket"));<NEW_LINE>objectParser.declareField(VB::valueType, p -> {<NEW_LINE>ValueType valueType = ValueType.resolveForScript(p.text());<NEW_LINE>if (targetValueType != null && valueType.isNotA(targetValueType)) {<NEW_LINE>throw new ParsingException(p.getTokenLocation(), "Aggregation [" + objectParser.getName() + "] was configured with an incompatible value type [" + valueType + "]. It can only work on value of type [" + targetValueType + "]");<NEW_LINE>}<NEW_LINE>return valueType;<NEW_LINE>}, new ParseField("value_type"), ObjectParser.ValueType.STRING);<NEW_LINE>objectParser.declareField(VB::script, (parser, context) -> Script.parse(parser), Script.SCRIPT_PARSE_FIELD, ObjectParser.ValueType.OBJECT_OR_STRING);<NEW_LINE>objectParser.declareField(VB::order, XContentParser::text, new ParseField("order"<MASK><NEW_LINE>} | ), ObjectParser.ValueType.STRING); |
1,459,071 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>getDialog().setTitle(getActivity().getString(R.string.first_run_welcome_to_mozstumbler));<NEW_LINE>getDialog().getWindow().<MASK><NEW_LINE>getDialog().setCanceledOnTouchOutside(false);<NEW_LINE>root = inflater.inflate(R.layout.fragment_first_run, container, false);<NEW_LINE>TextView tv = (TextView) root.findViewById(R.id.textview2);<NEW_LINE>tv.setMovementMethod(LinkMovementMethod.getInstance());<NEW_LINE>Button button = (Button) root.findViewById(R.id.button);<NEW_LINE>button.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>FragmentActivity thisActivity = getActivity();<NEW_LINE>if (thisActivity == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MainApp theApp = (MainApp) thisActivity.getApplication();<NEW_LINE>if (theApp == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>theApp.startScanning();<NEW_LINE>ClientPrefs.getInstance(getActivity()).setFirstRun(false);<NEW_LINE>Dialog d = getDialog();<NEW_LINE>if (d != null) {<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return root;<NEW_LINE>} | setBackgroundDrawable(new ColorDrawable(0xaa000000)); |
526,451 | public IPointcut normalize() {<NEW_LINE>IPointcut newPointcut = super.normalize();<NEW_LINE>if (newPointcut instanceof OrPointcut) {<NEW_LINE>OrPointcut newOr = (OrPointcut) newPointcut;<NEW_LINE>OrPointcut newNewOr = new OrPointcut(getContainerIdentifier(), "or");<NEW_LINE>// flatten the ands<NEW_LINE>for (int i = 0; i < newOr.getArgumentValues().length; i++) {<NEW_LINE>String name = <MASK><NEW_LINE>Object argument = newOr.getArgumentValues()[i];<NEW_LINE>if (argument instanceof OrPointcut && name == null) {<NEW_LINE>OrPointcut other = (OrPointcut) argument;<NEW_LINE>Object[] argumentValues = other.getArgumentValues();<NEW_LINE>String[] argumentNames = other.getArgumentNames();<NEW_LINE>int argCount = argumentNames.length;<NEW_LINE>for (int j = 0; j < argCount; j++) {<NEW_LINE>newNewOr.addArgument(argumentNames[j], argumentValues[j]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>newNewOr.addArgument(name, argument);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newNewOr;<NEW_LINE>} else {<NEW_LINE>return newPointcut;<NEW_LINE>}<NEW_LINE>} | newOr.getArgumentNames()[i]; |
1,547,508 | private BeanRegistrationWriter createScopedProxyBeanRegistrationWriter(String beanName, BeanDefinition beanDefinition) {<NEW_LINE>Object targetBeanName = beanDefinition.getPropertyValues().get("targetBeanName");<NEW_LINE>BeanDefinition targetBeanDefinition = getTargetBeanDefinition(targetBeanName);<NEW_LINE>if (targetBeanDefinition == null) {<NEW_LINE>logger.warn("Could not handle " + ScopedProxyFactoryBean.class.getSimpleName() + ": no target bean definition found with name " + targetBeanName);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>RootBeanDefinition processedBeanDefinition = new RootBeanDefinition((RootBeanDefinition) beanDefinition);<NEW_LINE>processedBeanDefinition.setTargetType(targetBeanDefinition.getResolvableType());<NEW_LINE>processedBeanDefinition.<MASK><NEW_LINE>BeanInstanceDescriptor descriptor = BeanInstanceDescriptor.of(ScopedProxyFactoryBean.class).build();<NEW_LINE>return new DefaultBeanRegistrationWriter(beanName, processedBeanDefinition, descriptor) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void writeInstanceSupplier(Builder code) {<NEW_LINE>MultiStatement statements = new MultiStatement();<NEW_LINE>statements.add("$T factory = new $T()", ScopedProxyFactoryBean.class, ScopedProxyFactoryBean.class);<NEW_LINE>statements.add("factory.setTargetBeanName($S)", targetBeanName);<NEW_LINE>statements.add("factory.setBeanFactory(beanFactory)");<NEW_LINE>statements.add("return factory.getObject()");<NEW_LINE>code.add(statements.toCodeBlock("() -> "));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | getPropertyValues().removePropertyValue("targetBeanName"); |
416,384 | private Mono<PagedResponse<IncidentInner>> listByAlertRuleSinglePageAsync(String resourceGroupName, String ruleName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (ruleName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2016-03-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.listByAlertRule(this.client.getEndpoint(), resourceGroupName, ruleName, apiVersion, this.client.getSubscriptionId(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));<NEW_LINE>} | this.client.mergeContext(context); |
1,098,615 | public void run() {<NEW_LINE>for (AbstractVcs vcs : myVcsManager.getAllActiveVcss()) {<NEW_LINE>final CommittedChangesProvider provider = vcs.getCommittedChangesProvider();<NEW_LINE>if (provider == null)<NEW_LINE>continue;<NEW_LINE>final <MASK><NEW_LINE>CommittedListsSequencesZipper zipper = null;<NEW_LINE>if (vcsZipper != null) {<NEW_LINE>zipper = new CommittedListsSequencesZipper(vcsZipper);<NEW_LINE>}<NEW_LINE>boolean zipSupported = zipper != null;<NEW_LINE>final Map<VirtualFile, RepositoryLocation> map = myCachesHolder.getAllRootsUnderVcs(vcs);<NEW_LINE>for (VirtualFile root : map.keySet()) {<NEW_LINE>if (myProject.isDisposed())<NEW_LINE>return;<NEW_LINE>final RepositoryLocation location = map.get(root);<NEW_LINE>try {<NEW_LINE>final List<CommittedChangeList> lists = getChanges(mySettings, root, vcs, myMaxCount, myCacheOnly, provider, location);<NEW_LINE>if (lists != null) {<NEW_LINE>if (zipSupported) {<NEW_LINE>zipper.add(location, lists);<NEW_LINE>} else {<NEW_LINE>myResult.addAll(lists);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (VcsException e) {<NEW_LINE>myExceptions.add(e);<NEW_LINE>} catch (ProcessCanceledException e) {<NEW_LINE>myDisposed = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (zipSupported) {<NEW_LINE>myResult.addAll(zipper.execute());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ApplicationManager.getApplication().invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>LOG.info("FINISHED CommittedChangesCache.getProjectChangesAsync - execution in queue");<NEW_LINE>if (myProject.isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (myExceptions.size() > 0) {<NEW_LINE>myErrorConsumer.consume(myExceptions);<NEW_LINE>} else if (!myDisposed) {<NEW_LINE>myConsumer.consume(new ArrayList<CommittedChangeList>(myResult));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, ModalityState.NON_MODAL);<NEW_LINE>} | VcsCommittedListsZipper vcsZipper = provider.getZipper(); |
817,427 | private String treeToString(CompilationInfoImpl info, CompilationUnitTree cut) {<NEW_LINE>StringBuilder dump = new StringBuilder();<NEW_LINE>new CancellableTreePathScanner<Void, Void>(cancel) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void scan(Tree tree, Void p) {<NEW_LINE>if (tree == null) {<NEW_LINE>dump.append("null,");<NEW_LINE>} else {<NEW_LINE>TreePath tp = new TreePath(getCurrentPath(), tree);<NEW_LINE>dump.append(tree.getKind<MASK><NEW_LINE>dump.append(Trees.instance(info.getJavacTask()).getSourcePositions().getStartPosition(tp.getCompilationUnit(), tree)).append(":");<NEW_LINE>dump.append(Trees.instance(info.getJavacTask()).getSourcePositions().getEndPosition(tp.getCompilationUnit(), tree)).append(":");<NEW_LINE>dump.append(String.valueOf(Trees.instance(info.getJavacTask()).getElement(tp))).append(":");<NEW_LINE>dump.append(normalizeCapture(String.valueOf(Trees.instance(info.getJavacTask()).getTypeMirror(tp)))).append(":");<NEW_LINE>dump.append(",");<NEW_LINE>}<NEW_LINE>return super.scan(tree, p);<NEW_LINE>}<NEW_LINE>}.scan(cut, null);<NEW_LINE>return dump.toString();<NEW_LINE>} | ()).append(":"); |
188,409 | public Object childEvaluate(Parser parser, VariableResolver resolver, String functionName, List<Object> param) throws ParserException {<NEW_LINE>String infoType = param.<MASK><NEW_LINE>if (infoType.equalsIgnoreCase("map") || infoType.equalsIgnoreCase("zone")) {<NEW_LINE>return getMapInfo();<NEW_LINE>} else if (infoType.equalsIgnoreCase("client")) {<NEW_LINE>return getClientInfo();<NEW_LINE>} else if (infoType.equalsIgnoreCase("server")) {<NEW_LINE>return getServerInfo();<NEW_LINE>} else if (infoType.equalsIgnoreCase("campaign")) {<NEW_LINE>return getCampaignInfo();<NEW_LINE>} else if (infoType.equalsIgnoreCase("theme")) {<NEW_LINE>return getThemeInfo();<NEW_LINE>} else if (infoType.equalsIgnoreCase("debug")) {<NEW_LINE>return getDebugInfo();<NEW_LINE>} else {<NEW_LINE>throw new ParserException(I18N.getText("macro.function.getInfo.invalidArg", param.get(0).toString()));<NEW_LINE>}<NEW_LINE>} | get(0).toString(); |
812,751 | // DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static com.sun.jdi.ThreadReference thread(com.sun.jdi.event.ClassPrepareEvent a) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.event.ClassPrepareEvent", "thread", "JDI CALL: com.sun.jdi.event.ClassPrepareEvent({0}).thread()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>com.sun.jdi.ThreadReference ret;<NEW_LINE>ret = a.thread();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper(ex);<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.<MASK><NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.event.ClassPrepareEvent", "thread", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | jpda.jdi.VMDisconnectedExceptionWrapper(ex); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.