idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
354,756 | public Comic parseInfo(String html, Comic comic) {<NEW_LINE>Node body = new Node(html);<NEW_LINE>String title = body.text("#ct > div.detail_info > a._btnInfo > p.subj");<NEW_LINE>String cover = body.src("#_episodeList > li > a > div.row > div.pic > img");<NEW_LINE>String update = body.text("#_episodeList > li > a > div.row > div.info > p.date");<NEW_LINE>if (update != null) {<NEW_LINE>String[] args = update.split("\\D");<NEW_LINE>update = StringUtils.format("%4d-%02d-%02d", Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]));<NEW_LINE>}<NEW_LINE>String author = body.text("#ct > div.detail_info > a._btnInfo > p.author");<NEW_LINE>String intro = body.text("#_informationLayer > p.summary_area");<NEW_LINE>boolean status = isFinish(body.text("#_informationLayer > div.info_update"));<NEW_LINE>comic.setInfo(title, cover, <MASK><NEW_LINE>return comic;<NEW_LINE>} | update, intro, author, status); |
1,614,138 | boolean onTouchEvent(MotionEvent event) {<NEW_LINE>final int x = (int) event.getX();<NEW_LINE>final int y = (int) event.getY();<NEW_LINE>final Rect delegateBounds = getDelegateBounds();<NEW_LINE>if (delegateBounds == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final int slop = ViewConfiguration.get(mDelegateView.getContext()).getScaledTouchSlop();<NEW_LINE>final Rect delegateSlopBounds = new Rect();<NEW_LINE>delegateSlopBounds.set(delegateBounds);<NEW_LINE>delegateSlopBounds.inset(-slop, -slop);<NEW_LINE>boolean shouldDelegateTouchEvent = false;<NEW_LINE>boolean touchWithinViewBounds = true;<NEW_LINE>boolean handled = false;<NEW_LINE>switch(event.getAction()) {<NEW_LINE>case MotionEvent.ACTION_DOWN:<NEW_LINE>mIsHandlingTouch = <MASK><NEW_LINE>shouldDelegateTouchEvent = mIsHandlingTouch;<NEW_LINE>break;<NEW_LINE>case MotionEvent.ACTION_UP:<NEW_LINE>case MotionEvent.ACTION_MOVE:<NEW_LINE>shouldDelegateTouchEvent = mIsHandlingTouch;<NEW_LINE>if (mIsHandlingTouch) {<NEW_LINE>if (!delegateSlopBounds.contains(x, y)) {<NEW_LINE>touchWithinViewBounds = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (event.getAction() == MotionEvent.ACTION_UP) {<NEW_LINE>mIsHandlingTouch = false;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MotionEvent.ACTION_CANCEL:<NEW_LINE>shouldDelegateTouchEvent = mIsHandlingTouch;<NEW_LINE>mIsHandlingTouch = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (shouldDelegateTouchEvent) {<NEW_LINE>if (touchWithinViewBounds) {<NEW_LINE>// Offset event coordinates to be inside the target view.<NEW_LINE>event.setLocation(mDelegateView.getWidth() / 2, mDelegateView.getHeight() / 2);<NEW_LINE>} else {<NEW_LINE>// Offset event coordinates to be outside the target view (in case it does<NEW_LINE>// something like tracking pressed state).<NEW_LINE>event.setLocation(-(slop * 2), -(slop * 2));<NEW_LINE>}<NEW_LINE>handled = mDelegateView.dispatchTouchEvent(event);<NEW_LINE>}<NEW_LINE>return handled;<NEW_LINE>} | delegateBounds.contains(x, y); |
1,167,975 | private void authorizeAuthenticationStatement(CQLStatement statement, AuthenticationSubject authenticationSubject, AuthorizationService authorization) {<NEW_LINE>AuthenticationStatement castStatement = (AuthenticationStatement) statement;<NEW_LINE>Scope scope = null;<NEW_LINE>String role = null;<NEW_LINE>if (statement instanceof RoleManagementStatement) {<NEW_LINE>RoleManagementStatement stmt = (RoleManagementStatement) castStatement;<NEW_LINE>scope = Scope.AUTHORIZE;<NEW_LINE>role = getRoleResourceFromStatement(stmt, "role");<NEW_LINE>String grantee = getRoleResourceFromStatement(stmt, "grantee");<NEW_LINE>logger.debug("preparing to authorize statement of type {} on {}", castStatement.getClass().toString(), role);<NEW_LINE>try {<NEW_LINE>authorization.authorizeRoleManagement(authenticationSubject, role, grantee, scope, SourceAPI.CQL);<NEW_LINE>} catch (io.stargate.auth.UnauthorizedException e) {<NEW_LINE>throw new UnauthorizedException(String.format("Missing correct permission on role %s: %s", role, e.getMessage()), e);<NEW_LINE>}<NEW_LINE>logger.debug("authorized statement of type {} on {}", castStatement.getClass(), role);<NEW_LINE>return;<NEW_LINE>} else if (statement instanceof DropRoleStatement) {<NEW_LINE>DropRoleStatement stmt = (DropRoleStatement) castStatement;<NEW_LINE>scope = Scope.DROP;<NEW_LINE>role = getRoleResourceFromStatement(stmt, "role");<NEW_LINE>} else if (statement instanceof CreateRoleStatement) {<NEW_LINE>CreateRoleStatement stmt = (CreateRoleStatement) castStatement;<NEW_LINE>scope = Scope.CREATE;<NEW_LINE>role = getRoleResourceFromStatement(stmt, "role");<NEW_LINE>} else if (statement instanceof AlterRoleStatement) {<NEW_LINE>AlterRoleStatement stmt = (AlterRoleStatement) castStatement;<NEW_LINE>scope = Scope.ALTER;<NEW_LINE>role = getRoleResourceFromStatement(stmt, "role");<NEW_LINE>}<NEW_LINE>logger.debug("preparing to authorize statement of type {} on {}", castStatement.getClass().toString(), role);<NEW_LINE>try {<NEW_LINE>authorization.authorizeRoleManagement(authenticationSubject, role, scope, SourceAPI.CQL);<NEW_LINE>} catch (io.stargate.auth.UnauthorizedException e) {<NEW_LINE>throw new UnauthorizedException(String.format("Missing correct permission on role %s: %s", role, e<MASK><NEW_LINE>}<NEW_LINE>logger.debug("authorized statement of type {} on {}", castStatement.getClass(), role);<NEW_LINE>} | .getMessage()), e); |
339,328 | public void onContext(PseudoStateContext<S, E> context) {<NEW_LINE>PseudoState<S, E> pseudoState = context.getPseudoState();<NEW_LINE>State<S, E> toStateOrig = findStateWithPseudoState(pseudoState);<NEW_LINE>StateContext<S, E> stateContext = buildStateContext(Stage.STATE_EXIT, <MASK><NEW_LINE>Mono<State<S, E>> toState = followLinkedPseudoStates(toStateOrig, stateContext);<NEW_LINE>// TODO: try to find matching transition based on direct link.<NEW_LINE>// should make this built-in in pseudostates<NEW_LINE>toState.flatMap(toState2 -> {<NEW_LINE>return Mono.defer(() -> {<NEW_LINE>Transition<S, E> t = findTransition(toStateOrig, toState2);<NEW_LINE>return switchToState(toState2, null, t, getRelayStateMachine());<NEW_LINE>});<NEW_LINE>}).then().and(// TODO: REACTOR should remove fire and forget sub<NEW_LINE>pseudoState.exit(stateContext)).subscribe();<NEW_LINE>} | null, null, getRelayStateMachine()); |
1,485,687 | public static QueryOrderInfoAfterSaleResponse unmarshall(QueryOrderInfoAfterSaleResponse queryOrderInfoAfterSaleResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryOrderInfoAfterSaleResponse.setRequestId<MASK><NEW_LINE>queryOrderInfoAfterSaleResponse.setCode(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Code"));<NEW_LINE>queryOrderInfoAfterSaleResponse.setMessage(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Message"));<NEW_LINE>Model model = new Model();<NEW_LINE>model.setLmOrderId(_ctx.longValue("QueryOrderInfoAfterSaleResponse.Model.LmOrderId"));<NEW_LINE>model.setTbOrderId(_ctx.longValue("QueryOrderInfoAfterSaleResponse.Model.TbOrderId"));<NEW_LINE>model.setCreateDate(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.CreateDate"));<NEW_LINE>model.setCashAmount(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.CashAmount"));<NEW_LINE>model.setPoints(_ctx.longValue("QueryOrderInfoAfterSaleResponse.Model.Points"));<NEW_LINE>model.setPointsAmount(_ctx.longValue("QueryOrderInfoAfterSaleResponse.Model.PointsAmount"));<NEW_LINE>model.setOrderStatus(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.OrderStatus"));<NEW_LINE>model.setShopName(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.ShopName"));<NEW_LINE>model.setRefundStatus(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.RefundStatus"));<NEW_LINE>model.setRefundAmount(_ctx.longValue("QueryOrderInfoAfterSaleResponse.Model.RefundAmount"));<NEW_LINE>model.setRefundRate(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.RefundRate"));<NEW_LINE>model.setXiaomiCode(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.XiaomiCode"));<NEW_LINE>model.setShopServiceTelephone(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.ShopServiceTelephone"));<NEW_LINE>model.setExtJson(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.ExtJson"));<NEW_LINE>model.setRefundPoints(_ctx.longValue("QueryOrderInfoAfterSaleResponse.Model.RefundPoints"));<NEW_LINE>List<Logistics> logisticsList = new ArrayList<Logistics>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryOrderInfoAfterSaleResponse.Model.LogisticsList.Length"); i++) {<NEW_LINE>Logistics logistics = new Logistics();<NEW_LINE>logistics.setLogisticsNo(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.LogisticsList[" + i + "].LogisticsNo"));<NEW_LINE>logistics.setLogisticsStatus(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.LogisticsList[" + i + "].LogisticsStatus"));<NEW_LINE>logistics.setLogisticsCompanyName(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.LogisticsList[" + i + "].LogisticsCompanyName"));<NEW_LINE>logistics.setLogisticsCompanyCode(_ctx.stringValue("QueryOrderInfoAfterSaleResponse.Model.LogisticsList[" + i + "].LogisticsCompanyCode"));<NEW_LINE>logisticsList.add(logistics);<NEW_LINE>}<NEW_LINE>model.setLogisticsList(logisticsList);<NEW_LINE>queryOrderInfoAfterSaleResponse.setModel(model);<NEW_LINE>return queryOrderInfoAfterSaleResponse;<NEW_LINE>} | (_ctx.stringValue("QueryOrderInfoAfterSaleResponse.RequestId")); |
542,050 | private void createDesignDocForAggregations() throws URISyntaxException, UnsupportedEncodingException, IOException, ClientProtocolException {<NEW_LINE>HttpResponse response = null;<NEW_LINE>URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(), CouchDBConstants.URL_SEPARATOR + databaseName.toLowerCase() + CouchDBConstants.URL_SEPARATOR + "_design/" + CouchDBConstants.AGGREGATIONS, null, null);<NEW_LINE>HttpPut put = new HttpPut(uri);<NEW_LINE>CouchDBDesignDocument designDocument = new CouchDBDesignDocument();<NEW_LINE>Map<String, MapReduce> views = new HashMap<String, CouchDBDesignDocument.MapReduce>();<NEW_LINE><MASK><NEW_LINE>createViewForCount(views);<NEW_LINE>createViewForSum(views);<NEW_LINE>createViewForMax(views);<NEW_LINE>createViewForMin(views);<NEW_LINE>createViewForAvg(views);<NEW_LINE>designDocument.setViews(views);<NEW_LINE>String jsonObject = gson.toJson(designDocument);<NEW_LINE>StringEntity entity = new StringEntity(jsonObject);<NEW_LINE>put.setEntity(entity);<NEW_LINE>try {<NEW_LINE>response = httpClient.execute(httpHost, put, CouchDBUtils.getContext(httpHost));<NEW_LINE>} finally {<NEW_LINE>CouchDBUtils.closeContent(response);<NEW_LINE>}<NEW_LINE>} | designDocument.setLanguage(CouchDBConstants.LANGUAGE); |
697,800 | public boolean apply(Game game, Ability source) {<NEW_LINE>int tappedAmount = 0;<NEW_LINE>Player you = game.<MASK><NEW_LINE>TargetCreaturePermanent target = new TargetCreaturePermanent(0, Integer.MAX_VALUE, filter, true);<NEW_LINE>if (target.canChoose(source.getControllerId(), source, game) && target.choose(Outcome.Tap, source.getControllerId(), source.getSourceId(), source, game)) {<NEW_LINE>for (UUID creatureId : target.getTargets()) {<NEW_LINE>Permanent creature = game.getPermanent(creatureId);<NEW_LINE>if (creature != null) {<NEW_LINE>creature.tap(source, game);<NEW_LINE>tappedAmount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tappedAmount > 0 && you != null) {<NEW_LINE>you.gainLife(tappedAmount * 2, game, source);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getPlayer(source.getControllerId()); |
333,440 | final DeleteAttributesResult executeDeleteAttributes(DeleteAttributesRequest deleteAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteAttributesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteAttributesRequest> request = null;<NEW_LINE>Response<DeleteAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteAttributesRequestMarshaller().marshall(super.beforeMarshalling(deleteAttributesRequest));<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, "SimpleDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteAttributesResult> responseHandler = new com.amazonaws.services.simpledb.internal.SimpleDBStaxResponseHandler<DeleteAttributesResult>(new DeleteAttributesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
331,346 | static Throwable wrapIfNecessary(final Throwable cause) {<NEW_LINE>if (cause instanceof io.netty.handler.codec.http2.Http2Exception) {<NEW_LINE>final int streamId = (cause instanceof StreamException) ? ((StreamException) <MASK><NEW_LINE>final io.netty.handler.codec.http2.Http2Exception h2Cause = (io.netty.handler.codec.http2.Http2Exception) cause;<NEW_LINE>return isRetryable(h2Cause) ? new RetryableStacklessHttp2Exception(streamId, h2Cause) : new StacklessHttp2Exception(streamId, h2Cause);<NEW_LINE>}<NEW_LINE>if (cause instanceof io.netty.handler.codec.http2.Http2FrameStreamException) {<NEW_LINE>io.netty.handler.codec.http2.Http2FrameStreamException streamException = (io.netty.handler.codec.http2.Http2FrameStreamException) cause;<NEW_LINE>return isRetryable(streamException) ? new RetryableStacklessHttp2Exception(streamException.stream().id(), streamException) : new StacklessHttp2Exception(streamException.stream().id(), streamException);<NEW_LINE>}<NEW_LINE>return cause;<NEW_LINE>} | cause).streamId() : 0; |
1,216,649 | public ChangeInfo implement() throws Exception {<NEW_LINE>final FileObject file = handle.getFileObject();<NEW_LINE>final JTextComponent comp = EditorRegistry.lastFocusedComponent();<NEW_LINE>if (file != null && file == getFileObject(comp)) {<NEW_LINE>final int[] pos = <MASK><NEW_LINE>JavaSource.forFileObject(file).runUserActionTask(new Task<CompilationController>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(CompilationController info) throws Exception {<NEW_LINE>info.toPhase(JavaSource.Phase.PARSED);<NEW_LINE>final TreePath tp = handle.resolve(info);<NEW_LINE>if (tp != null && tp.getLeaf().getKind() == Tree.Kind.VARIABLE) {<NEW_LINE>pos[0] = (int) info.getTrees().getSourcePositions().getEndPosition(tp.getCompilationUnit(), ((VariableTree) tp.getLeaf()).getType()) + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, true);<NEW_LINE>invokeRefactoring(comp, pos[0]);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | new int[] { -1 }; |
828,628 | public Container xor(final ArrayContainer value2) {<NEW_LINE>final ArrayContainer value1 = this;<NEW_LINE>final int totalCardinality = value1.getCardinality() + value2.getCardinality();<NEW_LINE>if (totalCardinality > DEFAULT_MAX_SIZE) {<NEW_LINE>// it could be a bitmap!<NEW_LINE>BitmapContainer bc = new BitmapContainer();<NEW_LINE>for (int k = 0; k < value2.cardinality; ++k) {<NEW_LINE>char v = value2.content[k];<NEW_LINE>final int i = (v) >>> 6;<NEW_LINE>bc.bitmap[i] ^= (1L << v);<NEW_LINE>}<NEW_LINE>for (int k = 0; k < this.cardinality; ++k) {<NEW_LINE>char <MASK><NEW_LINE>final int i = (v) >>> 6;<NEW_LINE>bc.bitmap[i] ^= (1L << v);<NEW_LINE>}<NEW_LINE>bc.cardinality = 0;<NEW_LINE>for (long k : bc.bitmap) {<NEW_LINE>bc.cardinality += Long.bitCount(k);<NEW_LINE>}<NEW_LINE>if (bc.cardinality <= DEFAULT_MAX_SIZE) {<NEW_LINE>return bc.toArrayContainer();<NEW_LINE>}<NEW_LINE>return bc;<NEW_LINE>}<NEW_LINE>ArrayContainer answer = new ArrayContainer(totalCardinality);<NEW_LINE>answer.cardinality = Util.unsignedExclusiveUnion2by2(value1.content, value1.getCardinality(), value2.content, value2.getCardinality(), answer.content);<NEW_LINE>return answer;<NEW_LINE>} | v = this.content[k]; |
1,627,660 | private void loadNode407() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_LastUpdateTime, new QualifiedName(0, "LastUpdateTime"), new LocalizedText("en", "LastUpdateTime"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UtcTime, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_LastUpdateTime, Identifiers.HasTypeDefinition, Identifiers.PropertyType<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_LastUpdateTime, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_LastUpdateTime, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
32,403 | protected void updateTrackables() {<NEW_LINE>Collection<Plane> planes = surfar.frame.getUpdatedTrackables(Plane.class);<NEW_LINE>for (Plane plane : planes) {<NEW_LINE>if (plane.getSubsumedBy() != null)<NEW_LINE>continue;<NEW_LINE>float[] mat;<NEW_LINE>if (trackMatrices.containsKey(plane)) {<NEW_LINE>mat = trackMatrices.get(plane);<NEW_LINE>} else {<NEW_LINE>mat = new float[16];<NEW_LINE>trackMatrices.put(plane, mat);<NEW_LINE>trackPlanes.add(plane);<NEW_LINE>trackIds.put(plane, ++lastTrackableId);<NEW_LINE>newPlanes.add(plane);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>pose.toMatrix(mat, 0);<NEW_LINE>}<NEW_LINE>// Remove stopped and subsummed trackables<NEW_LINE>for (int i = trackPlanes.size() - 1; i >= 0; i--) {<NEW_LINE>Plane plane = trackPlanes.get(i);<NEW_LINE>if (plane.getTrackingState() == TrackingState.STOPPED || plane.getSubsumedBy() != null) {<NEW_LINE>trackPlanes.remove(i);<NEW_LINE>trackMatrices.remove(plane);<NEW_LINE>int pid = trackIds.remove(plane);<NEW_LINE>trackIdx.remove(pid);<NEW_LINE>for (ARTracker t : trackers) t.remove(pid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Update indices<NEW_LINE>for (int i = 0; i < trackPlanes.size(); i++) {<NEW_LINE>Plane plane = trackPlanes.get(i);<NEW_LINE>int pid = trackIds.get(plane);<NEW_LINE>trackIdx.put(pid, i);<NEW_LINE>if (newPlanes.contains(plane)) {<NEW_LINE>for (ARTracker t : trackers) t.create(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Pose pose = plane.getCenterPose(); |
1,333,996 | public List<Feature> bind(StructType schema) {<NEW_LINE>List<Feature> features = new ArrayList<>();<NEW_LINE>for (Feature feature : x.bind(schema)) {<NEW_LINE>StructField xfield = feature.field();<NEW_LINE>DataType type = xfield.type;<NEW_LINE>if (!(type.isDouble() || type.isFloat() || type.isInt() || type.isLong() || type.isShort() || type.isByte())) {<NEW_LINE>throw new IllegalStateException(String.format("Invalid expression: %s(%s)", name, type));<NEW_LINE>}<NEW_LINE>features.add(new Feature() {<NEW_LINE><NEW_LINE>final StructField field = new StructField(String.format("%s(%s)", name, xfield.name), type.id() == DataType.ID.Object ? DataTypes.DoubleObjectType : <MASK><NEW_LINE><NEW_LINE>@Override<NEW_LINE>public StructField field() {<NEW_LINE>return field;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Double apply(Tuple o) {<NEW_LINE>Object y = feature.apply(o);<NEW_LINE>if (y == null)<NEW_LINE>return null;<NEW_LINE>else<NEW_LINE>return lambda.apply(((Number) y).doubleValue());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double applyAsDouble(Tuple o) {<NEW_LINE>return lambda.apply(feature.applyAsDouble(o));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return features;<NEW_LINE>} | DataTypes.DoubleType, xfield.measure); |
1,489,667 | final UpdateParameterGroupResult executeUpdateParameterGroup(UpdateParameterGroupRequest updateParameterGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateParameterGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateParameterGroupRequest> request = null;<NEW_LINE>Response<UpdateParameterGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateParameterGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateParameterGroupRequest));<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, "MemoryDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateParameterGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateParameterGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateParameterGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
678,764 | private void calculate() throws UnknownHostException {<NEW_LINE>ByteBuffer maskBuffer;<NEW_LINE>int targetSize;<NEW_LINE>if (inetAddress.getAddress().length == 4) {<NEW_LINE>maskBuffer = ByteBuffer.allocate(4).putInt(-1);<NEW_LINE>targetSize = 4;<NEW_LINE>} else {<NEW_LINE>maskBuffer = ByteBuffer.allocate(16).putLong(-1L).putLong(-1L);<NEW_LINE>targetSize = 16;<NEW_LINE>}<NEW_LINE>BigInteger mask = (new BigInteger(1, maskBuffer.array())).not().shiftRight(prefixLength);<NEW_LINE>ByteBuffer buffer = ByteBuffer.wrap(inetAddress.getAddress());<NEW_LINE>BigInteger ipVal = new BigInteger(1, buffer.array());<NEW_LINE>BigInteger startIp = ipVal.and(mask);<NEW_LINE>BigInteger endIp = startIp.add(mask.not());<NEW_LINE>byte[] startIpArr = toBytes(startIp.toByteArray(), targetSize);<NEW_LINE>byte[] endIpArr = toBytes(<MASK><NEW_LINE>this.startAddress = InetAddress.getByAddress(startIpArr);<NEW_LINE>this.endAddress = InetAddress.getByAddress(endIpArr);<NEW_LINE>} | endIp.toByteArray(), targetSize); |
347,457 | public static Story from(Cursor cursor) {<NEW_LINE>Long internalId = cursor.getLong(HNewsContract.StoryEntry.COLUMN_ID);<NEW_LINE>Long id = cursor.getLong(HNewsContract.StoryEntry.COLUMN_ITEM_ID);<NEW_LINE>String type = cursor.getString(HNewsContract.StoryEntry.COLUMN_TYPE);<NEW_LINE>String by = cursor.getString(HNewsContract.StoryEntry.COLUMN_BY);<NEW_LINE>int comments = cursor.getInt(HNewsContract.StoryEntry.COLUMN_COMMENTS);<NEW_LINE>String url = cursor.getString(HNewsContract.StoryEntry.COLUMN_URL);<NEW_LINE>int score = cursor.getInt(HNewsContract.StoryEntry.COLUMN_SCORE);<NEW_LINE>String title = cursor.getString(HNewsContract.StoryEntry.COLUMN_TITLE);<NEW_LINE>Long time = cursor.<MASK><NEW_LINE>Long timestamp = cursor.getLong(HNewsContract.StoryEntry.COLUMN_TIMESTAMP);<NEW_LINE>int rank = cursor.getInt(HNewsContract.StoryEntry.COLUMN_RANK);<NEW_LINE>int bookmark = cursor.getInt(HNewsContract.StoryEntry.COLUMN_BOOKMARK);<NEW_LINE>int read = cursor.getInt(HNewsContract.StoryEntry.COLUMN_READ);<NEW_LINE>int voted = cursor.getInt(HNewsContract.StoryEntry.COLUMN_VOTED);<NEW_LINE>String filter = cursor.getString(HNewsContract.StoryEntry.COLUMN_FILTER);<NEW_LINE>return new Story(internalId, by, id, type, time, score, title, url, comments, timestamp, rank, bookmark, read, voted, filter);<NEW_LINE>} | getLong(HNewsContract.StoryEntry.COLUMN_TIME_AGO); |
98,031 | // ----------------------------------------------------------------<NEW_LINE>private static // returns line-counter<NEW_LINE>// returns line-counter<NEW_LINE>int handleStream(BufferedReader reader, String filename, MIH256<String> mihWithCenters, Map<Hash256, Integer> centersToIndices, int distanceThreshold, int lineCounter, int traceCount, boolean doBruteForceQuery) {<NEW_LINE>while (true) {<NEW_LINE>Hash256AndMetadata<String> inputPair = null;<NEW_LINE>try {<NEW_LINE>inputPair = HashReaderUtil.loadHashAndMetadataFromStream(reader, lineCounter);<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.printf("%s: could not read line %d of file \"%s\".\n", PROGNAME, lineCounter, filename);<NEW_LINE>System.exit(1);<NEW_LINE>} catch (PDQHashFormatException e) {<NEW_LINE>System.err.printf("%s: unparseable hash \"%s\" at line %d of file \"%s\".\n", PROGNAME, e.getUnacceptableInput(), lineCounter + 1, filename);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>if (inputPair == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (traceCount > 0) {<NEW_LINE>if ((lineCounter % traceCount) == 0) {<NEW_LINE>System.err.printf("-- %d\n", lineCounter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lineCounter++;<NEW_LINE>Vector<Hash256AndMetadata<String>> matches = new Vector<MASK><NEW_LINE>Hash256AndMetadata<String> centerPair = null;<NEW_LINE>try {<NEW_LINE>centerPair = doBruteForceQuery ? mihWithCenters.bruteForceQueryAny(inputPair.hash, distanceThreshold) : mihWithCenters.queryAny(inputPair.hash, distanceThreshold);<NEW_LINE>} catch (MIHDimensionExceededException e) {<NEW_LINE>System.err.printf("%s: %s\n", PROGNAME, e.getErrorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>boolean isCenter = false;<NEW_LINE>int matchClusterIndex = -1;<NEW_LINE>if (centerPair == null) {<NEW_LINE>isCenter = true;<NEW_LINE>int insertionClusterIndex = mihWithCenters.size();<NEW_LINE>mihWithCenters.insert(inputPair.hash, inputPair.metadata);<NEW_LINE>centersToIndices.put(inputPair.hash, insertionClusterIndex);<NEW_LINE>matchClusterIndex = insertionClusterIndex;<NEW_LINE>centerPair = inputPair;<NEW_LINE>} else {<NEW_LINE>matchClusterIndex = centersToIndices.get(centerPair.hash);<NEW_LINE>}<NEW_LINE>System.out.printf("clidx=%d,hash1=%s,hash2=%s,is_center=%d,d=%d,%s\n", matchClusterIndex, inputPair.hash.toString(), centerPair.hash.toString(), isCenter ? 1 : 0, centerPair.hash.hammingDistance(inputPair.hash), inputPair.metadata);<NEW_LINE>}<NEW_LINE>return lineCounter;<NEW_LINE>} | <Hash256AndMetadata<String>>(); |
412,446 | public final void emit(AMD64Assembler asm, OperandSize size, Register dst, Register nds, Register src) {<NEW_LINE>assert verify(<MASK><NEW_LINE>int pre;<NEW_LINE>int opc;<NEW_LINE>boolean rexVexW = (size == QWORD) ? true : false;<NEW_LINE>AMD64InstructionAttr attributes = new AMD64InstructionAttr(AvxVectorLen.AVX_128bit, rexVexW, /* legacyMode */<NEW_LINE>false, /* noMaskReg */<NEW_LINE>false, /* usesVl */<NEW_LINE>false, asm.target);<NEW_LINE>int curPrefix = size.sizePrefix | prefix1;<NEW_LINE>switch(curPrefix) {<NEW_LINE>case 0x66:<NEW_LINE>pre = VexSimdPrefix.VEX_SIMD_66;<NEW_LINE>break;<NEW_LINE>case 0xF2:<NEW_LINE>pre = VexSimdPrefix.VEX_SIMD_F2;<NEW_LINE>break;<NEW_LINE>case 0xF3:<NEW_LINE>pre = VexSimdPrefix.VEX_SIMD_F3;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>pre = VexSimdPrefix.VEX_SIMD_NONE;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(prefix2) {<NEW_LINE>case P_0F:<NEW_LINE>opc = VexOpcode.VEX_OPCODE_0F;<NEW_LINE>break;<NEW_LINE>case P_0F38:<NEW_LINE>opc = VexOpcode.VEX_OPCODE_0F_38;<NEW_LINE>break;<NEW_LINE>case P_0F3A:<NEW_LINE>opc = VexOpcode.VEX_OPCODE_0F_3A;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw GraalError.shouldNotReachHere("invalid VEX instruction prefix");<NEW_LINE>}<NEW_LINE>int encode;<NEW_LINE>encode = asm.simdPrefixAndEncode(dst, nds, src, pre, opc, attributes);<NEW_LINE>asm.emitByte(op);<NEW_LINE>asm.emitByte(0xC0 | encode);<NEW_LINE>} | asm, size, dst, src); |
1,731,513 | private static void insertAlignedRecords() throws IoTDBConnectionException, StatementExecutionException {<NEW_LINE>List<String> multiSeriesIds = new ArrayList<>();<NEW_LINE>List<List<String>> multiMeasurementComponentsList = new ArrayList<>();<NEW_LINE>List<List<TSDataType>> typeList = new ArrayList<>();<NEW_LINE>List<Long> times = new ArrayList<>();<NEW_LINE>List<List<Object>> valueList = new ArrayList<>();<NEW_LINE>for (long time = 1; time < 5; time++) {<NEW_LINE>List<String> multiMeasurementComponents = new ArrayList<>();<NEW_LINE>multiMeasurementComponents.add("s1");<NEW_LINE>multiMeasurementComponents.add("s2");<NEW_LINE>List<TSDataType> types = new ArrayList<>();<NEW_LINE>types.add(TSDataType.INT64);<NEW_LINE><MASK><NEW_LINE>List<Object> values = new ArrayList<>();<NEW_LINE>values.add(1L);<NEW_LINE>values.add(2);<NEW_LINE>multiSeriesIds.add(ROOT_SG2_D1_VECTOR4);<NEW_LINE>times.add(time);<NEW_LINE>multiMeasurementComponentsList.add(multiMeasurementComponents);<NEW_LINE>typeList.add(types);<NEW_LINE>valueList.add(values);<NEW_LINE>}<NEW_LINE>session.insertAlignedRecords(multiSeriesIds, times, multiMeasurementComponentsList, typeList, valueList);<NEW_LINE>} | types.add(TSDataType.INT32); |
70,117 | void outerHtmlHead(Appendable accum, int depth, Document.OutputSettings out) throws IOException {<NEW_LINE>final <MASK><NEW_LINE>final Element parent = parentNode instanceof Element ? ((Element) parentNode) : null;<NEW_LINE>final boolean parentIndent = parent != null && parent.shouldIndent(out);<NEW_LINE>final boolean blank = isBlank();<NEW_LINE>if (// we are skippable whitespace<NEW_LINE>parentIndent && StringUtil.startsWithNewline(coreValue()) && blank)<NEW_LINE>return;<NEW_LINE>if (prettyPrint && ((siblingIndex == 0 && parent != null && parent.tag().formatAsBlock() && !blank) || (out.outline() && siblingNodes().size() > 0 && !blank)))<NEW_LINE>indent(accum, depth, out);<NEW_LINE>final boolean normaliseWhite = prettyPrint && !Element.preserveWhitespace(parentNode);<NEW_LINE>final boolean stripWhite = prettyPrint && parentNode instanceof Document;<NEW_LINE>Entities.escape(accum, coreValue(), out, false, normaliseWhite, stripWhite);<NEW_LINE>} | boolean prettyPrint = out.prettyPrint(); |
142,910 | static OrientDBInternal remote(String[] hosts, OrientDBConfig configuration) {<NEW_LINE>OrientDBInternal factory;<NEW_LINE>try {<NEW_LINE>String className = "com.orientechnologies.orient.core.db.OrientDBRemote";<NEW_LINE>ClassLoader loader;<NEW_LINE>if (configuration != null) {<NEW_LINE>loader = configuration.getClassLoader();<NEW_LINE>} else {<NEW_LINE>loader = OrientDBInternal.class.getClassLoader();<NEW_LINE>}<NEW_LINE>Class<?> kass = loader.loadClass(className);<NEW_LINE>Constructor<?> constructor = kass.getConstructor(String[].class, OrientDBConfig.class, Orient.class);<NEW_LINE>factory = (OrientDBInternal) constructor.newInstance(hosts, <MASK><NEW_LINE>} catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException e) {<NEW_LINE>throw OException.wrapException(new ODatabaseException("OrientDB client API missing"), e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>// noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException<NEW_LINE>throw OException.wrapException(new ODatabaseException("Error creating OrientDB remote factory"), e.getTargetException());<NEW_LINE>}<NEW_LINE>return factory;<NEW_LINE>} | configuration, Orient.instance()); |
790,934 | public <T> InternalCompletableFuture<ReadResultSet<T>> readFromEventJournal(long startSequence, int minSize, int maxSize, int partitionId, java.util.function.Predicate<? super EventJournalMapEvent<K, V>> predicate, java.util.function.Function<? super EventJournalMapEvent<K, V>, ? extends T> projection) {<NEW_LINE>if (maxSize < minSize) {<NEW_LINE>throw new IllegalArgumentException("maxSize " + maxSize + " must be greater or equal to minSize " + minSize);<NEW_LINE>}<NEW_LINE>final SerializationService ss = getSerializationService();<NEW_LINE>final ClientMessage request = MapEventJournalReadCodec.encodeRequest(name, startSequence, minSize, maxSize, ss.toData(predicate)<MASK><NEW_LINE>final ClientInvocationFuture fut = new ClientInvocation(getClient(), request, getName(), partitionId).invoke();<NEW_LINE>return new ClientDelegatingFuture<>(fut, ss, message -> {<NEW_LINE>MapEventJournalReadCodec.ResponseParameters params = MapEventJournalReadCodec.decodeResponse(message);<NEW_LINE>ReadResultSetImpl resultSet = new ReadResultSetImpl<>(params.readCount, params.items, params.itemSeqs, params.nextSeq);<NEW_LINE>resultSet.setSerializationService(getSerializationService());<NEW_LINE>return resultSet;<NEW_LINE>});<NEW_LINE>} | , ss.toData(projection)); |
1,315,518 | private Collection<RemoteTransaction> attemptResumeTransactions(Collection<Long> versions) {<NEW_LINE>try {<NEW_LINE>Collection<RemoteTransaction> remoteTransactions = new ArrayList<>();<NEW_LINE>for (Long version : versions) {<NEW_LINE>File transactionFile = config.getTransactionFile(version);<NEW_LINE>// If a single transaction file is missing, we should restart<NEW_LINE>if (!transactionFile.exists()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TransactionTO transactionTO = TransactionTO.load(null, transactionFile);<NEW_LINE>// Verify if all files needed are in cache.<NEW_LINE>for (ActionTO action : transactionTO.getActions()) {<NEW_LINE>if (action.getType() == ActionType.UPLOAD) {<NEW_LINE>if (action.getStatus() == ActionStatus.UNSTARTED) {<NEW_LINE>if (!action.getLocalTempLocation().exists()) {<NEW_LINE>// Unstarted upload has no cached local copy, abort<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>remoteTransactions.add(new RemoteTransaction<MASK><NEW_LINE>}<NEW_LINE>return remoteTransactions;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.log(Level.WARNING, "Invalid transaction file. Cannot resume!");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | (config, transferManager, transactionTO)); |
1,413,801 | final DescribeWorkforceResult executeDescribeWorkforce(DescribeWorkforceRequest describeWorkforceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeWorkforceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeWorkforceRequest> request = null;<NEW_LINE>Response<DescribeWorkforceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeWorkforceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeWorkforceRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeWorkforce");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeWorkforceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeWorkforceResultJsonUnmarshaller());<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.ClientExecuteTime); |
1,063,319 | public static void testStaticMethodNotFirst() {<NEW_LINE>// multiple arguments.<NEW_LINE>assertTrue(f1(10, 1, 2) == 30);<NEW_LINE>assertTrue(Main.f1(10<MASK><NEW_LINE>// no argument for varargs.<NEW_LINE>assertTrue(f1(10) == 0);<NEW_LINE>assertTrue(Main.f1(10) == 0);<NEW_LINE>// array literal for varargs.<NEW_LINE>assertTrue(f1(10, new int[] { 1, 2 }) == 30);<NEW_LINE>assertTrue(Main.f1(10, new int[] { 1, 2 }) == 30);<NEW_LINE>// empty array literal for varargs.<NEW_LINE>assertTrue(f1(10, new int[] {}) == 0);<NEW_LINE>assertTrue(Main.f1(10, new int[] {}) == 0);<NEW_LINE>// array object for varargs.<NEW_LINE>int[] ints = new int[] { 1, 2 };<NEW_LINE>assertTrue(f1(10, ints) == 30);<NEW_LINE>assertTrue(Main.f1(10, ints) == 30);<NEW_LINE>// call by JS.<NEW_LINE>assertTrue(callF1() == 30);<NEW_LINE>} | , 1, 2) == 30); |
537,747 | public List<String> expendGroupRoleToGroup(List<String> groupList, List<String> roleList) throws Exception {<NEW_LINE>List<String> groupIds = new ArrayList<>();<NEW_LINE>List<String> expendGroupIds = new ArrayList<>();<NEW_LINE>if (ListTools.isNotEmpty(groupList)) {<NEW_LINE>for (String s : groupList) {<NEW_LINE>Group g = this.group().pick(s);<NEW_LINE>if (null != g) {<NEW_LINE>groupIds.add(g.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(roleList)) {<NEW_LINE>for (String s : roleList) {<NEW_LINE>Role r = this.role().pick(s);<NEW_LINE>if (null != r) {<NEW_LINE>groupIds.addAll(r.getGroupList());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(groupIds)) {<NEW_LINE>groupIds = ListTools.<MASK><NEW_LINE>for (String s : groupIds) {<NEW_LINE>expendGroupIds.add(s);<NEW_LINE>expendGroupIds.addAll(this.group().listSubNested(s));<NEW_LINE>}<NEW_LINE>expendGroupIds = ListTools.trim(expendGroupIds, true, true);<NEW_LINE>}<NEW_LINE>return this.group().listGroupDistinguishedNameSorted(expendGroupIds);<NEW_LINE>} | trim(groupIds, true, true); |
1,245,447 | public Organization unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Organization organization = new Organization();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("asn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>organization.setAsn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("asnOrg", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>organization.setAsnOrg(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("isp", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>organization.setIsp(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("org", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>organization.setOrg(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 organization;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
247,773 | public ConcurrentMap<String, Object> deserializeAttributes(final byte[] in) {<NEW_LINE>ByteArrayInputStream bis = null;<NEW_LINE>ObjectInputStream ois = null;<NEW_LINE>try {<NEW_LINE>bis = new ByteArrayInputStream(in);<NEW_LINE>ois = createObjectInputStream(bis);<NEW_LINE>final ConcurrentMap<String, Object> attributes = new ConcurrentHashMap<String, Object>();<NEW_LINE>final int n = ((Integer) ois.readObject()).intValue();<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>final String name = (String) ois.readObject();<NEW_LINE>final Object value = ois.readObject();<NEW_LINE>if ((value instanceof String) && (value.equals(NOT_SERIALIZED))) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug(" loading attribute '" + name + "' with value '" + value + "'");<NEW_LINE>}<NEW_LINE>attributes.put(name, value);<NEW_LINE>}<NEW_LINE>return attributes;<NEW_LINE>} catch (final ClassNotFoundException e) {<NEW_LINE>LOG.warn("Caught CNFE decoding " + in.length + " bytes of data", e);<NEW_LINE>throw new TranscoderDeserializationException("Caught CNFE decoding data", e);<NEW_LINE>} catch (final IOException e) {<NEW_LINE>LOG.warn("Caught IOException decoding " + <MASK><NEW_LINE>throw new TranscoderDeserializationException("Caught IOException decoding data", e);<NEW_LINE>} finally {<NEW_LINE>closeSilently(bis);<NEW_LINE>closeSilently(ois);<NEW_LINE>}<NEW_LINE>} | in.length + " bytes of data", e); |
1,419,618 | final CreateCaseResult executeCreateCase(CreateCaseRequest createCaseRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCaseRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCaseRequest> request = null;<NEW_LINE>Response<CreateCaseResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateCaseRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCaseRequest));<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, "Support");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCase");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCaseResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCaseResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,467,858 | private void addToServerContextBindingMap(String interfaceName) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "addToServerContextBindingMap : " + interfaceName + " (implicit)");<NEW_LINE>// Re-wrote method to only add short-form default (implicit). d457053.1<NEW_LINE>BindingData <MASK><NEW_LINE>if (bdata == null) {<NEW_LINE>bdata = new BindingData();<NEW_LINE>ivServerContextBindingMap.put(interfaceName, bdata);<NEW_LINE>}<NEW_LINE>ArrayList<J2EEName> beans = bdata.ivImplicitBeans;<NEW_LINE>if (beans != null) {<NEW_LINE>beans.add(ivHomeRecord.j2eeName);<NEW_LINE>} else {<NEW_LINE>beans = new ArrayList<J2EEName>(1);<NEW_LINE>beans.add(ivHomeRecord.j2eeName);<NEW_LINE>bdata.ivImplicitBeans = beans;<NEW_LINE>}<NEW_LINE>} | bdata = ivServerContextBindingMap.get(interfaceName); |
469,168 | // -------------------------------------<NEW_LINE>public static void register() {<NEW_LINE>// Check JEI recipes are enabled<NEW_LINE>if (!PersonalConfig.enableZombieGenJEIRecipes.get()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MachinesPlugin.iModRegistry.addRecipeCategories(new ZombieGeneratorRecipeCategory(MachinesPlugin.iGuiHelper));<NEW_LINE>MachinesPlugin.iModRegistry.addRecipeCategoryCraftingItem(new ItemStack(MachineObject.block_zombie_generator.getBlockNN(), 1, 0), ZombieGeneratorRecipeCategory.UID);<NEW_LINE>MachinesPlugin.iModRegistry.addRecipeCategoryCraftingItem(new ItemStack(MachineObject.block_franken_zombie_generator.getBlockNN(), 1, 0), ZombieGeneratorRecipeCategory.UID);<NEW_LINE>MachinesPlugin.iModRegistry.addRecipeClickArea(GuiZombieGenerator.class, 155, 42, 16, 16, ZombieGeneratorRecipeCategory.UID);<NEW_LINE>MachinesPlugin.iModRegistry.addRecipes(Collections.singletonList(<MASK><NEW_LINE>} | new ZombieGeneratorRecipeWrapper()), UID); |
77,114 | public void processResult(int rc, String path, Object ctx) {<NEW_LINE>if (BKException.Code.OK != rc) {<NEW_LINE>if (skipUnrecoverableLedgers) {<NEW_LINE>LOG.warn("Failed to recover ledger: {} : {}, skip recover it.", lId, BKException.codeLogger(rc));<NEW_LINE>rc = BKException.Code.OK;<NEW_LINE>} else {<NEW_LINE>LOG.error("Failed to recover ledger {} : {}", lId, BKException.codeLogger(rc));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.info("Recovered ledger {}.", lId);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>lh.close();<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} catch (BKException bke) {<NEW_LINE>LOG.warn("Error on closing ledger handle for {}.", lId);<NEW_LINE>}<NEW_LINE>finalLedgerIterCb.<MASK><NEW_LINE>} | processResult(rc, path, ctx); |
1,540,700 | public void toggleLovedItem(final Query query) {<NEW_LINE>boolean doSweetSweetLovin = !DatabaseHelper.get().isItemLoved(query);<NEW_LINE>Log.d(TAG, "Hatchet sync - " + (doSweetSweetLovin ? "loved" : "unloved") + " track " + query.getName() + " by " + query.getArtist().getName() + " on " + query.getAlbum().getName());<NEW_LINE>DatabaseHelper.get().setLovedItem(query, doSweetSweetLovin);<NEW_LINE>UpdatedEvent event = new UpdatedEvent();<NEW_LINE>event.mUpdatedItemIds = new HashSet<>();<NEW_LINE>event.mUpdatedItemIds.add(query.getCacheKey());<NEW_LINE>EventBus.<MASK><NEW_LINE>final AuthenticatorUtils hatchetAuthUtils = AuthenticatorManager.get().getAuthenticatorUtils(TomahawkApp.PLUGINNAME_HATCHET);<NEW_LINE>if (doSweetSweetLovin) {<NEW_LINE>InfoSystem.get().sendRelationshipPostStruct(hatchetAuthUtils, query);<NEW_LINE>} else {<NEW_LINE>User.getSelf().done(new DoneCallback<User>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDone(User result) {<NEW_LINE>Relationship relationship = result.getRelationship(query);<NEW_LINE>if (relationship == null) {<NEW_LINE>Log.e(TAG, "Can't unlove track, because there's no relationshipId" + " associated with it.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InfoSystem.get().deleteRelationship(hatchetAuthUtils, relationship.getCacheKey());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | getDefault().post(event); |
226,925 | protected void vertical(GrayF32 intensity) {<NEW_LINE>float[] hXX = horizXX.data;<NEW_LINE>float[] hXY = horizXY.data;<NEW_LINE>float[] hYY = horizYY.data;<NEW_LINE>final float[] inten = intensity.data;<NEW_LINE>final int imgHeight = horizXX.getHeight();<NEW_LINE>final int imgWidth = horizXX.getWidth();<NEW_LINE>final int kernelWidth = radius * 2 + 1;<NEW_LINE>final int startX = radius;<NEW_LINE>final int endX = imgWidth - radius;<NEW_LINE>final int backStep = kernelWidth * imgWidth;<NEW_LINE>// CONCURRENT_REMOVE_LINE<NEW_LINE>WorkSpace work = workspaces.grow();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(radius,imgHeight-radius,workspaces,(work,y0,y1)->{<NEW_LINE>int y0 = radius, y1 = imgHeight - radius;<NEW_LINE>final float[] tempXX = work.xx;<NEW_LINE>final float[] tempXY = work.yy;<NEW_LINE>final <MASK><NEW_LINE>for (int x = startX; x < endX; x++) {<NEW_LINE>// defines the A matrix, from which the eigenvalues are computed<NEW_LINE>int srcIndex = x + (y0 - radius) * imgWidth;<NEW_LINE>int destIndex = imgWidth * y0 + x;<NEW_LINE>float totalXX = 0, totalXY = 0, totalYY = 0;<NEW_LINE>int indexEnd = srcIndex + imgWidth * kernelWidth;<NEW_LINE>for (; srcIndex < indexEnd; srcIndex += imgWidth) {<NEW_LINE>totalXX += hXX[srcIndex];<NEW_LINE>totalXY += hXY[srcIndex];<NEW_LINE>totalYY += hYY[srcIndex];<NEW_LINE>}<NEW_LINE>tempXX[x] = totalXX;<NEW_LINE>tempXY[x] = totalXY;<NEW_LINE>tempYY[x] = totalYY;<NEW_LINE>// compute the eigen values<NEW_LINE>inten[destIndex] = this.intensity.compute(totalXX, totalXY, totalYY);<NEW_LINE>destIndex += imgWidth;<NEW_LINE>}<NEW_LINE>// change the order it is processed in to reduce cache misses<NEW_LINE>for (int y = y0 + 1; y < y1; y++) {<NEW_LINE>int srcIndex = (y + radius) * imgWidth + startX;<NEW_LINE>int destIndex = y * imgWidth + startX;<NEW_LINE>for (int x = startX; x < endX; x++, srcIndex++, destIndex++) {<NEW_LINE>float totalXX = tempXX[x] - hXX[srcIndex - backStep];<NEW_LINE>tempXX[x] = totalXX += hXX[srcIndex];<NEW_LINE>float totalXY = tempXY[x] - hXY[srcIndex - backStep];<NEW_LINE>tempXY[x] = totalXY += hXY[srcIndex];<NEW_LINE>float totalYY = tempYY[x] - hYY[srcIndex - backStep];<NEW_LINE>tempYY[x] = totalYY += hYY[srcIndex];<NEW_LINE>inten[destIndex] = this.intensity.compute(totalXX, totalXY, totalYY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>} | float[] tempYY = work.zz; |
644,565 | private ObjectNode dumpInclude(Include include) {<NEW_LINE>ObjectNode includeNode = OBJECT_MAPPER.createObjectNode();<NEW_LINE>ArrayNode typesNode = OBJECT_MAPPER.createArrayNode();<NEW_LINE>if (include.hasTypes()) {<NEW_LINE>for (TypeDef type : include.getTypes()) {<NEW_LINE>ObjectNode typeDefNode = OBJECT_MAPPER.createObjectNode();<NEW_LINE>typeDefNode.put("name", type.geteClass().getName());<NEW_LINE>typeDefNode.put("includeAllSubTypes", type.isIncludeSubTypes());<NEW_LINE>if (type.getExcluded() != null) {<NEW_LINE>ArrayNode excludesNode = OBJECT_MAPPER.createArrayNode();<NEW_LINE>for (EClass eClass : type.getExcluded()) {<NEW_LINE>excludesNode.<MASK><NEW_LINE>}<NEW_LINE>typeDefNode.set("exlude", excludesNode);<NEW_LINE>}<NEW_LINE>typesNode.add(typeDefNode);<NEW_LINE>}<NEW_LINE>includeNode.set("types", typesNode);<NEW_LINE>}<NEW_LINE>if (include.hasFields()) {<NEW_LINE>ArrayNode fieldsNode = OBJECT_MAPPER.createArrayNode();<NEW_LINE>for (EReference eReference : include.getFields()) {<NEW_LINE>fieldsNode.add(eReference.getName());<NEW_LINE>}<NEW_LINE>includeNode.set("fields", fieldsNode);<NEW_LINE>}<NEW_LINE>if (include.hasDirectFields()) {<NEW_LINE>ArrayNode fieldsNode = OBJECT_MAPPER.createArrayNode();<NEW_LINE>for (EReference eReference : include.getFieldsDirect()) {<NEW_LINE>fieldsNode.add(eReference.getName());<NEW_LINE>}<NEW_LINE>includeNode.set("fieldsDirect", fieldsNode);<NEW_LINE>}<NEW_LINE>if (include.hasIncludes() || include.hasIncludesToResolve() || include.hasReferences()) {<NEW_LINE>ArrayNode includes = OBJECT_MAPPER.createArrayNode();<NEW_LINE>includeNode.set("includes", includes);<NEW_LINE>if (include.hasIncludes()) {<NEW_LINE>for (Include nextInclude : include.getIncludes()) {<NEW_LINE>includes.add(dumpInclude(nextInclude));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (include.hasIncludesToResolve()) {<NEW_LINE>for (String nextInclude : include.getIncludesToResolve()) {<NEW_LINE>includes.add(nextInclude);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (include.hasReferences()) {<NEW_LINE>for (Reference reference : include.getReferences()) {<NEW_LINE>includes.add(reference.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (include.hasOutputTypes()) {<NEW_LINE>throw new RuntimeException("Not implemented");<NEW_LINE>}<NEW_LINE>return includeNode;<NEW_LINE>} | add(eClass.getName()); |
1,463,286 | public static void execute(ManagerService service, boolean isClear) {<NEW_LINE><MASK><NEW_LINE>// write header<NEW_LINE>buffer = HEADER.write(buffer, service, true);<NEW_LINE>// write fields<NEW_LINE>for (FieldPacket field : FIELDS) {<NEW_LINE>buffer = field.write(buffer, service, true);<NEW_LINE>}<NEW_LINE>// write eof<NEW_LINE>buffer = EOF.write(buffer, service, true);<NEW_LINE>// write rows<NEW_LINE>byte packetId = EOF.getPacketId();<NEW_LINE>int i = 0;<NEW_LINE>Map<UserName, UserStat> statMap = UserStatAnalyzer.getInstance().getUserStatMap();<NEW_LINE>for (UserStat userStat : statMap.values()) {<NEW_LINE>i++;<NEW_LINE>RowDataPacket row = getRow(userStat, i, service.getCharset().getResults());<NEW_LINE>row.setPacketId(++packetId);<NEW_LINE>buffer = row.write(buffer, service, true);<NEW_LINE>}<NEW_LINE>if (isClear) {<NEW_LINE>UserStatAnalyzer.getInstance().reset();<NEW_LINE>}<NEW_LINE>// write last eof<NEW_LINE>EOFRowPacket lastEof = new EOFRowPacket();<NEW_LINE>lastEof.setPacketId(++packetId);<NEW_LINE>lastEof.write(buffer, service);<NEW_LINE>} | ByteBuffer buffer = service.allocate(); |
415,288 | public Answer createVolumeFromSnapshot(final CopyCommand cmd) {<NEW_LINE>try {<NEW_LINE>final DataTO srcData = cmd.getSrcTO();<NEW_LINE>final SnapshotObjectTO snapshot = (SnapshotObjectTO) srcData;<NEW_LINE>final DataTO destData = cmd.getDestTO();<NEW_LINE>final PrimaryDataStoreTO pool = (PrimaryDataStoreTO) destData.getDataStore();<NEW_LINE>final DataStoreTO imageStore = srcData.getDataStore();<NEW_LINE>final VolumeObjectTO volume = snapshot.getVolume();<NEW_LINE>if (!(imageStore instanceof NfsTO || imageStore instanceof PrimaryDataStoreTO)) {<NEW_LINE>return new CopyCmdAnswer("unsupported protocol");<NEW_LINE>}<NEW_LINE>final String snapshotFullPath = snapshot.getPath();<NEW_LINE>final int index = snapshotFullPath.lastIndexOf("/");<NEW_LINE>final String snapshotPath = snapshotFullPath.substring(0, index);<NEW_LINE>final String snapshotName = snapshotFullPath.substring(index + 1);<NEW_LINE>KVMPhysicalDisk disk = null;<NEW_LINE>if (imageStore instanceof NfsTO) {<NEW_LINE>disk = createVolumeFromSnapshotOnNFS(cmd, pool, imageStore, volume, snapshotPath, snapshotName);<NEW_LINE>} else {<NEW_LINE>disk = createVolumeFromRBDSnapshot(cmd, destData, pool, imageStore, volume, snapshotName, disk);<NEW_LINE>}<NEW_LINE>if (disk == null) {<NEW_LINE>return new CopyCmdAnswer("Could not create volume from snapshot");<NEW_LINE>}<NEW_LINE>final VolumeObjectTO newVol = new VolumeObjectTO();<NEW_LINE>newVol.setPath(disk.getName());<NEW_LINE>newVol.setSize(disk.getVirtualSize());<NEW_LINE>newVol.setFormat(ImageFormat.valueOf(disk.getFormat().toString<MASK><NEW_LINE>return new CopyCmdAnswer(newVol);<NEW_LINE>} catch (final CloudRuntimeException e) {<NEW_LINE>s_logger.debug("Failed to createVolumeFromSnapshot: ", e);<NEW_LINE>return new CopyCmdAnswer(e.toString());<NEW_LINE>}<NEW_LINE>} | ().toUpperCase())); |
1,533,864 | public JUnitResult build(List<Pair<TestIdentifier, TestExecutionResult>> results) {<NEW_LINE>boolean wasSuccessful = results.stream().map(Pair::getRight).noneMatch(r -> r.getStatus() != TestExecutionResult.Status.SUCCESSFUL);<NEW_LINE>int failureCount = (int) results.stream().map(Pair::getRight).filter(r -> r.getStatus() != TestExecutionResult.Status.SUCCESSFUL).count();<NEW_LINE>int runCount = results.size();<NEW_LINE>JUnitResult jUnitResult = new <MASK><NEW_LINE>List<Pair<TestIdentifier, TestExecutionResult>> failures = results.stream().filter(r -> r.getRight().getStatus() == TestExecutionResult.Status.FAILED).collect(Collectors.toList());<NEW_LINE>failures.stream().map(f -> toFailure(f.getLeft(), f.getRight())).forEach(jUnitResult::addFailure);<NEW_LINE>return jUnitResult;<NEW_LINE>} | JUnitResult(wasSuccessful, failureCount, runCount); |
204,707 | private static Sld extractFromLayout(SldLayout sldLayout) {<NEW_LINE>Sld sld = Context.getpmlObjectFactory().createSld();<NEW_LINE>// Clone first<NEW_LINE>sld.setCSld(XmlUtils.deepCopy(sldLayout.getCSld(), Context.jcPML));<NEW_LINE>sld.setClrMapOvr(XmlUtils.deepCopy(sldLayout.getClrMapOvr(), Context.jcPML));<NEW_LINE>// Then delete stuff<NEW_LINE>sld.getCSld().setName(null);<NEW_LINE>// Remove p:sp, if cNvPr name contains "Date Placeholder", "Footer Placeholder", "Slide Number Placeholder"<NEW_LINE>// (and these are on the master?)<NEW_LINE>List<Shape> deletions = new ArrayList<Shape>();<NEW_LINE>for (Object o : sld.getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame()) {<NEW_LINE>// System.out.println(o.getClass().getName());<NEW_LINE>if (o instanceof org.pptx4j.pml.Shape) {<NEW_LINE>Shape shape = (Shape) o;<NEW_LINE>if (shape.getNvSpPr() != null && shape.getNvSpPr().getCNvPr() != null && shape.getNvSpPr().getCNvPr().getName() != null) {<NEW_LINE>String name = shape.getNvSpPr()<MASK><NEW_LINE>if (name.startsWith("Date Placeholder") || name.startsWith("Footer Placeholder") || name.startsWith("Slide Number Placeholder")) {<NEW_LINE>deletions.add(shape);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sld.getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().removeAll(deletions);<NEW_LINE>// From remaining shapes ..<NEW_LINE>for (Object o : sld.getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame()) {<NEW_LINE>if (o instanceof org.pptx4j.pml.Shape) {<NEW_LINE>Shape shape = (Shape) o;<NEW_LINE>shape.setSpPr(new CTShapeProperties());<NEW_LINE>if (shape.getTxBody() != null) {<NEW_LINE>shape.getTxBody().setLstStyle(null);<NEW_LINE>for (CTTextParagraph p : shape.getTxBody().getP()) {<NEW_LINE>p.getEGTextRun().clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sld;<NEW_LINE>} | .getCNvPr().getName(); |
462,134 | public void packetReceived(DHTUDPPacketReply packet, InetSocketAddress from_address, long elapsed_time) {<NEW_LINE>try {<NEW_LINE>if (packet.getConnectionId() != connection_id) {<NEW_LINE>throw (new Exception("connection id mismatch"));<NEW_LINE>}<NEW_LINE>contact.setInstanceIDAndVersion(packet.getTargetInstanceID(), packet.getProtocolVersion());<NEW_LINE>requestSendReplyProcessor(contact, handler, packet, elapsed_time);<NEW_LINE>DHTUDPPacketReplyFindValue reply = (DHTUDPPacketReplyFindValue) packet;<NEW_LINE>stats.findValueOK();<NEW_LINE>DHTTransportValue[] res = reply.getValues();<NEW_LINE>if (res != null) {<NEW_LINE>boolean continuation = reply.hasContinuation();<NEW_LINE>handler.findValueReply(contact, res, reply.getDiversificationType(), continuation);<NEW_LINE>} else {<NEW_LINE>handler.findValueReply(contact, reply.getContacts());<NEW_LINE>}<NEW_LINE>} catch (DHTUDPPacketHandlerException e) {<NEW_LINE>error(e);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.printStackTrace(e);<NEW_LINE>error(<MASK><NEW_LINE>}<NEW_LINE>} | new DHTUDPPacketHandlerException("findValue failed", e)); |
692,622 | final GetHostedConfigurationVersionResult executeGetHostedConfigurationVersion(GetHostedConfigurationVersionRequest getHostedConfigurationVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getHostedConfigurationVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetHostedConfigurationVersionRequest> request = null;<NEW_LINE>Response<GetHostedConfigurationVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetHostedConfigurationVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getHostedConfigurationVersionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetHostedConfigurationVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetHostedConfigurationVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(false).withHasStreamingSuccessResponse(false), new GetHostedConfigurationVersionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,238,982 | private boolean isLocationInExpandControl(TreePath path, Point location) {<NEW_LINE>if (tree.getModel().isLeaf(path.getLastPathComponent()))<NEW_LINE>return false;<NEW_LINE>Rectangle r = tree.getPathBounds(path);<NEW_LINE>int boxWidth = 8;<NEW_LINE>Insets i = tree.getInsets();<NEW_LINE>int indent = 0;<NEW_LINE>if (tree.getUI() instanceof BasicTreeUI) {<NEW_LINE>BasicTreeUI ui = (BasicTreeUI) tree.getUI();<NEW_LINE>if (null != ui.getExpandedIcon())<NEW_LINE>boxWidth = ui.getExpandedIcon().getIconWidth();<NEW_LINE>indent = ui.getLeftChildIndent();<NEW_LINE>}<NEW_LINE>int boxX;<NEW_LINE>if (tree.getComponentOrientation().isLeftToRight()) {<NEW_LINE>boxX = r<MASK><NEW_LINE>} else {<NEW_LINE>boxX = r.x - positionX + indent + r.width;<NEW_LINE>}<NEW_LINE>return location.getX() >= boxX && location.getX() <= (boxX + boxWidth);<NEW_LINE>} | .x - positionX - indent - boxWidth; |
1,519,253 | public void run(WorkingCopy workingCopy) throws Exception {<NEW_LINE>workingCopy.toPhase(JavaSource.Phase.RESOLVED);<NEW_LINE>Element elem = elementHandle.resolve(workingCopy);<NEW_LINE>if (elem != null) {<NEW_LINE>Tree tree = workingCopy.getTrees().getTree(elem);<NEW_LINE>TreeMaker make = workingCopy.getTreeMaker();<NEW_LINE>ModifiersTree modifiersTree = null;<NEW_LINE>if (tree.getKind() == Tree.Kind.VARIABLE) {<NEW_LINE>modifiersTree = ((VariableTree) tree).getModifiers();<NEW_LINE>} else if (tree.getKind() == Tree.Kind.METHOD) {<NEW_LINE>modifiersTree = ((MethodTree) tree).getModifiers();<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>TypeElement temporalAnnType = workingCopy.getElements().getTypeElement(JPAAnnotations.TEMPORAL);<NEW_LINE>Tree <MASK><NEW_LINE>AnnotationTree temporalAnn = make.Annotation(annType, Collections.singletonList(make.Identifier("javax.persistence.TemporalType.DATE")));<NEW_LINE>List<AnnotationTree> newAnnots = new ArrayList<AnnotationTree>();<NEW_LINE>newAnnots.addAll(modifiersTree.getAnnotations());<NEW_LINE>newAnnots.add(temporalAnn);<NEW_LINE>ModifiersTree newModifiers = make.Modifiers(modifiersTree, newAnnots);<NEW_LINE>workingCopy.rewrite(modifiersTree, newModifiers);<NEW_LINE>}<NEW_LINE>} | annType = make.QualIdent(temporalAnnType); |
1,110,353 | protected String doSubmitAction(@ModelAttribute("command") GeneralSettingsCommand command, RedirectAttributes redirectAttributes) {<NEW_LINE>int themeIndex = Integer.parseInt(command.getThemeIndex());<NEW_LINE>Theme theme = settingsService.getAvailableThemes()[themeIndex];<NEW_LINE>int localeIndex = Integer.parseInt(command.getLocaleIndex());<NEW_LINE>Locale locale = settingsService.getAvailableLocales()[localeIndex];<NEW_LINE>redirectAttributes.addFlashAttribute("settings_toast", true);<NEW_LINE>// if cover art source is changing then we need to do at least one full scan<NEW_LINE>if (settingsService.getCoverArtSource() != command.getCoverArtSource() && !settingsService.getFullScan()) {<NEW_LINE>settingsService.setFullScan(true);<NEW_LINE>settingsService.setClearFullScanSettingAfterScan(true);<NEW_LINE>}<NEW_LINE>settingsService.setIndexString(command.getIndex());<NEW_LINE>settingsService.setIgnoredArticles(command.getIgnoredArticles());<NEW_LINE>settingsService.setGenreSeparators(command.getGenreSeparators());<NEW_LINE>settingsService.setShortcuts(command.getShortcuts());<NEW_LINE>settingsService.setPlaylistFolder(command.getPlaylistFolder());<NEW_LINE>playlistService.addPlaylistFolderWatcher();<NEW_LINE>playlistService.importPlaylists();<NEW_LINE>settingsService.setMusicFileTypes(command.getMusicFileTypes());<NEW_LINE>settingsService.<MASK><NEW_LINE>settingsService.setCoverArtFileTypes(command.getCoverArtFileTypes());<NEW_LINE>settingsService.setCoverArtSource(command.getCoverArtSource());<NEW_LINE>settingsService.setCoverArtConcurrency(command.getCoverArtConcurrency());<NEW_LINE>settingsService.setCoverArtQuality(command.getCoverArtQuality());<NEW_LINE>settingsService.setSortAlbumsByYear(command.isSortAlbumsByYear());<NEW_LINE>settingsService.setGettingStartedEnabled(command.isGettingStartedEnabled());<NEW_LINE>settingsService.setWelcomeTitle(command.getWelcomeTitle());<NEW_LINE>settingsService.setWelcomeSubtitle(command.getWelcomeSubtitle());<NEW_LINE>settingsService.setWelcomeMessage(command.getWelcomeMessage());<NEW_LINE>settingsService.setLoginMessage(command.getLoginMessage());<NEW_LINE>settingsService.setSessionDuration(command.getSessionDuration());<NEW_LINE>settingsService.setThemeId(theme.getId());<NEW_LINE>settingsService.setLocale(locale);<NEW_LINE>settingsService.save();<NEW_LINE>return "redirect:generalSettings.view";<NEW_LINE>} | setVideoFileTypes(command.getVideoFileTypes()); |
259,286 | public Object visitMemberSelect(MemberSelectTree node, Object p) {<NEW_LINE>String exp = node.getExpression().toString();<NEW_LINE>// ClassName.this<NEW_LINE>if (exp.equals("this") || exp.endsWith(".this")) {<NEW_LINE>// NOI18N<NEW_LINE>addInstanceForType(findType(node.getExpression()));<NEW_LINE>} else if (exp.equals("super")) {<NEW_LINE>// NOI18N<NEW_LINE>// reference to superclass of this type<NEW_LINE>addSuperInstance(enclosingType);<NEW_LINE>} else if (exp.endsWith(".super")) {<NEW_LINE>// NOI18N<NEW_LINE>// this is a reference to the superclass of some enclosing type.<NEW_LINE>if (node.getExpression().getKind() == Tree.Kind.MEMBER_SELECT) {<NEW_LINE>Tree t = ((MemberSelectTree) node.<MASK><NEW_LINE>addSuperInstance(findType(t));<NEW_LINE>}<NEW_LINE>} else if (node.getIdentifier().contentEquals("this")) {<NEW_LINE>// NOI18N<NEW_LINE>// reference to this<NEW_LINE>addInstanceForType(findType(node.getExpression()));<NEW_LINE>} else {<NEW_LINE>// references to Clazz.super are invalid, references to Clazz.super.whatever() must be<NEW_LINE>// a pert of a broader memberSelect, which will be caught one level up.<NEW_LINE>return super.visitMemberSelect(node, p);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | getExpression()).getExpression(); |
1,373,818 | final UpdateWorkloadResult executeUpdateWorkload(UpdateWorkloadRequest updateWorkloadRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateWorkloadRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateWorkloadRequest> request = null;<NEW_LINE>Response<UpdateWorkloadResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateWorkloadRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateWorkloadRequest));<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, "UpdateWorkload");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateWorkloadResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateWorkloadResultJsonUnmarshaller());<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.ClientExecuteTime); |
304,380 | private HmilyParticipant buildParticipant(final HmilyTransactionContext context, final Invoker<?> invoker, final Invocation invocation) throws HmilyRuntimeException {<NEW_LINE>if (HmilyActionEnum.TRYING.getCode() != context.getAction()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>HmilyParticipant hmilyParticipant = new HmilyParticipant();<NEW_LINE>hmilyParticipant.setTransId(context.getTransId());<NEW_LINE>hmilyParticipant.setParticipantId(IdWorkerUtils.getInstance().createUUID());<NEW_LINE>hmilyParticipant.setTransType(context.getTransType());<NEW_LINE>String methodName = invocation.getMethodName();<NEW_LINE>Class<?> clazz = invoker.getInterface();<NEW_LINE>Class<?>[] args = invocation.getParameterTypes();<NEW_LINE>final Object[] arguments = invocation.getArguments();<NEW_LINE>HmilyInvocation hmilyInvocation = new HmilyInvocation(<MASK><NEW_LINE>hmilyParticipant.setConfirmHmilyInvocation(hmilyInvocation);<NEW_LINE>hmilyParticipant.setCancelHmilyInvocation(hmilyInvocation);<NEW_LINE>return hmilyParticipant;<NEW_LINE>} | clazz, methodName, args, arguments); |
1,633,996 | public static NeighborQueue search(float[] query, int topK, RandomAccessVectorValues vectors, VectorSimilarityFunction similarityFunction, HnswGraph graph, Bits acceptOrds, int visitedLimit) throws IOException {<NEW_LINE>HnswGraphSearcher graphSearcher = new HnswGraphSearcher(similarityFunction, new NeighborQueue(topK, similarityFunction.reversed == false), new SparseFixedBitSet(vectors.size()));<NEW_LINE>NeighborQueue results;<NEW_LINE>int[] eps = new int[] { graph.entryNode() };<NEW_LINE>int numVisited = 0;<NEW_LINE>for (int level = graph.numLevels() - 1; level >= 1; level--) {<NEW_LINE>results = graphSearcher.searchLevel(query, 1, level, eps, vectors, graph, null, visitedLimit);<NEW_LINE>eps[0] = results.pop();<NEW_LINE>numVisited += results.visitedCount();<NEW_LINE>visitedLimit -= results.visitedCount();<NEW_LINE>}<NEW_LINE>results = graphSearcher.searchLevel(query, topK, 0, eps, <MASK><NEW_LINE>results.setVisitedCount(results.visitedCount() + numVisited);<NEW_LINE>return results;<NEW_LINE>} | vectors, graph, acceptOrds, visitedLimit); |
1,331,435 | void initialize(TransactionUserWrapper tuWrapper, SipServletRequestImpl sipMessage, SipApplicationSessionImpl sipApp) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>if (sipMessage != null && sipApp != null) {<NEW_LINE>Object[] params = { tuWrapper, sipMessage.getMethod(), sipApp.getId() };<NEW_LINE>c_logger.<MASK><NEW_LINE>} else {<NEW_LINE>c_logger.traceEntry(this, "initialize");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_tuWrapper = tuWrapper;<NEW_LINE>if (sipApp != null) {<NEW_LINE>// This Transaction User relates to Application Session that is already exist<NEW_LINE>synchronized (sipApp.getSynchronizer()) {<NEW_LINE>if (sipApp.isValid()) {<NEW_LINE>m_applicationId = sipApp.getSharedId();<NEW_LINE>setSynchronizer(sipApp.getSynchronizer());<NEW_LINE>setServiceSynchronizer(sipApp.getServiceSynchronizer());<NEW_LINE>} else {<NEW_LINE>sipApp = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (_synchronizer == null) {<NEW_LINE>setSynchronizer(new Object());<NEW_LINE>setServiceSynchronizer(new Object());<NEW_LINE>}<NEW_LINE>createTUId(sipApp);<NEW_LINE>if (SipSessionSeqLog.isEnabled()) {<NEW_LINE>m_contextLog = SipSessionSeqLog.getInstance();<NEW_LINE>m_contextLog.setId(getSharedId());<NEW_LINE>}<NEW_LINE>String method = sipMessage.getMethod();<NEW_LINE>_dialogState.reset();<NEW_LINE>_dialogState.setDialogState(method);<NEW_LINE>if (isDialog()) {<NEW_LINE>if (method.equals("INVITE") || method.equals("SUBSCRIBE")) {<NEW_LINE>setCanCreateDS(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "initialize", "New BaseTU was created. ID = " + getSharedId());<NEW_LINE>}<NEW_LINE>logToContext(SipSessionSeqLog.INIT, getSharedId());<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceExit(this, "initialize");<NEW_LINE>}<NEW_LINE>} | traceEntry(this, "initialize", params); |
1,368,654 | public void onClick(View v) {<NEW_LINE>String accountType = mAccountList[pos][2];<NEW_LINE>if (TextUtils.equals(accountType, EXISTING_ACCOUNT)) {<NEW_LINE>// otherwise support the actual plugin-type<NEW_LINE>showSetupAccountForm(helper.getProviderNames().get(0), null, null, false, helper.getProviderNames()<MASK><NEW_LINE>} else if (TextUtils.equals(accountType, BONJOUR_ACCOUNT)) {<NEW_LINE>String username = "";<NEW_LINE>// zeroconf doesn't need a password<NEW_LINE>String passwordPlaceholder = "password";<NEW_LINE>showSetupAccountForm(helper.getProviderNames().get(1), username, passwordPlaceholder, false, helper.getProviderNames().get(1), true);<NEW_LINE>} else if (TextUtils.equals(accountType, NEW_ACCOUNT)) {<NEW_LINE>showSetupAccountForm(helper.getProviderNames().get(0), null, null, true, null, false);<NEW_LINE>} else if (TextUtils.equals(accountType, BURNER_ACCOUNT)) {<NEW_LINE>createBurnerAccount();<NEW_LINE>} else if (TextUtils.equals(accountType, GOOGLE_ACCOUNT)) {<NEW_LINE>addGoogleAccount();<NEW_LINE>} else<NEW_LINE>throw new IllegalArgumentException("Mystery account type!");<NEW_LINE>} | .get(0), false); |
534,184 | public void renderByItem(ItemStack stack, TransformType transformType, PoseStack matrixStackIn, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) {<NEW_LINE>float partialTicks = mc().getFrameTime();<NEW_LINE>if (stack.getItem() instanceof IOBJModelCallback) {<NEW_LINE>IOBJModelCallback<ItemStack> callback = (IOBJModelCallback<ItemStack>) stack.getItem();<NEW_LINE>Level w = IESmartObjModel.tempEntityStatic != null ? IESmartObjModel.tempEntityStatic.level : null;<NEW_LINE>BakedModel model = mc().getItemRenderer().getModel(stack, w, IESmartObjModel.tempEntityStatic);<NEW_LINE>if (model instanceof IESmartObjModel) {<NEW_LINE>ItemStack shader;<NEW_LINE>ShaderCase sCase;<NEW_LINE>{<NEW_LINE>Pair<ItemStack, ShaderCase> tmp = stack.getCapability(CapabilityShader.SHADER_CAPABILITY).map(wrapper -> {<NEW_LINE>ItemStack shaderInner = wrapper.getShaderItem();<NEW_LINE>ShaderCase sCaseInner = null;<NEW_LINE>if (!shaderInner.isEmpty() && shaderInner.getItem() instanceof IShaderItem)<NEW_LINE>sCaseInner = ((IShaderItem) shaderInner.getItem()).getShaderCase(shaderInner, stack, wrapper.getShaderType());<NEW_LINE>return new ImmutablePair<>(shaderInner, sCaseInner);<NEW_LINE>}).orElse(new ImmutablePair<>(ItemStack.EMPTY, null));<NEW_LINE>shader = tmp.getLeft();<NEW_LINE>sCase = tmp.getRight();<NEW_LINE>}<NEW_LINE>IESmartObjModel obj = (IESmartObjModel) model;<NEW_LINE>Set<String> visible = new HashSet<>();<NEW_LINE>for (String g : OBJHelper.getGroups(obj.baseModel).keySet()) if (callback.shouldRenderGroup(stack, g))<NEW_LINE>visible.add(g);<NEW_LINE>for (String[] groups : callback.getSpecialGroups(stack, transformType, IESmartObjModel.tempEntityStatic)) {<NEW_LINE>Transformation mat = callback.getTransformForGroups(stack, groups, transformType, <MASK><NEW_LINE>mat.push(matrixStackIn);<NEW_LINE>renderQuadsForGroups(groups, callback, obj, stack, sCase, matrixStackIn, bufferIn, visible, combinedLightIn, combinedOverlayIn);<NEW_LINE>matrixStackIn.popPose();<NEW_LINE>}<NEW_LINE>renderQuadsForGroups(visible.toArray(new String[0]), callback, obj, stack, sCase, matrixStackIn, bufferIn, visible, combinedLightIn, combinedOverlayIn);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | mc().player, partialTicks); |
481,290 | public void onChanged(Change<? extends E> c) {<NEW_LINE>while (c.next()) {<NEW_LINE>if (c.wasAdded() || c.wasRemoved()) {<NEW_LINE>final int removedSize = c.getRemovedSize();<NEW_LINE>final List<? extends E> removed = c.getRemoved();<NEW_LINE>for (int i = 0; i < removedSize; ++i) {<NEW_LINE>observer.detachListener(removed.get(i));<NEW_LINE>}<NEW_LINE>if (decoratedList instanceof RandomAccess) {<NEW_LINE>final int to = c.getTo();<NEW_LINE>for (int i = c.getFrom(); i < to; ++i) {<NEW_LINE>observer.attachListener<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (E e : c.getAddedSubList()) {<NEW_LINE>observer.attachListener(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>c.reset();<NEW_LINE>fireChange(c);<NEW_LINE>} | (decoratedList.get(i)); |
867,934 | public static <KK extends RecordTemplate, KP extends RecordTemplate, V extends RecordTemplate> BatchKVResponse<ComplexResourceKey<KK, KP>, V> createWithComplexKey(Class<V> valueClass, Class<KK> keyKeyClass, Class<KP> keyParamsClass, Map<ComplexResourceKey<KK, KP>, V> recordTemplates, Map<ComplexResourceKey<KK, KP>, ErrorResponse> errorResponses) {<NEW_LINE>ProtocolVersion version = AllProtocolVersions.BASELINE_PROTOCOL_VERSION;<NEW_LINE>DataMap batchResponseDataMap = <MASK><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>BatchKVResponse<ComplexResourceKey<KK, KP>, V> response = (BatchKVResponse<ComplexResourceKey<KK, KP>, V>) (Object) new BatchKVResponse<>(batchResponseDataMap, ComplexResourceKey.class, valueClass, null, keyKeyClass, keyParamsClass, version);<NEW_LINE>return response;<NEW_LINE>} | buildDataMap(recordTemplates, errorResponses, version); |
1,687,497 | private void checkAliases(Class<?> parent, String classname, String[] parts) {<NEW_LINE>Class<?> c = ELKIServiceRegistry.findImplementation((Class<Object>) parent, classname);<NEW_LINE>if (c == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Alias ann = c.getAnnotation(Alias.class);<NEW_LINE>if (ann == null) {<NEW_LINE>if (parts.length > 1) {<NEW_LINE>//<NEW_LINE>StringBuilder //<NEW_LINE>buf = //<NEW_LINE>new StringBuilder(100).append("Class ").//<NEW_LINE>append(classname).append(//<NEW_LINE>" in ").//<NEW_LINE>append(parent.getCanonicalName()).append(" has the following extraneous aliases:");<NEW_LINE>for (int i = 1; i < parts.length; i++) {<NEW_LINE>buf.append(' ').append(parts[i]);<NEW_LINE>}<NEW_LINE>LOG.warning(buf);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HashSet<String> aliases = new HashSet<>();<NEW_LINE>for (int i = 1; i < parts.length; i++) {<NEW_LINE>aliases.add(parts[i]);<NEW_LINE>}<NEW_LINE>StringBuilder buf = null;<NEW_LINE>for (String a : ann.value()) {<NEW_LINE>if (!aliases.remove(a)) {<NEW_LINE>if (buf == null) {<NEW_LINE>//<NEW_LINE>buf = //<NEW_LINE>new StringBuilder(100).append("Class ").//<NEW_LINE>append(classname).append(//<NEW_LINE>" in ").//<NEW_LINE>append(parent.getCanonicalName()).append(" is missing the following aliases:");<NEW_LINE>}<NEW_LINE>buf.append(' ').append(a);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!aliases.isEmpty()) {<NEW_LINE>//<NEW_LINE>buf = //<NEW_LINE>(buf == null ? new StringBuilder() : buf.append(FormatUtil.NEWLINE)).append("Class ").//<NEW_LINE>append(classname).append(//<NEW_LINE>" in ").//<NEW_LINE>append(parent.getCanonicalName()).append(" has the following extraneous aliases:");<NEW_LINE>for (String a : aliases) {<NEW_LINE>buf.append<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (buf != null) {<NEW_LINE>LOG.warning(buf);<NEW_LINE>}<NEW_LINE>} | (' ').append(a); |
357,382 | public static ListScaleOutEcuResponse unmarshall(ListScaleOutEcuResponse listScaleOutEcuResponse, UnmarshallerContext _ctx) {<NEW_LINE>listScaleOutEcuResponse.setRequestId(_ctx.stringValue("ListScaleOutEcuResponse.RequestId"));<NEW_LINE>listScaleOutEcuResponse.setCode(_ctx.integerValue("ListScaleOutEcuResponse.Code"));<NEW_LINE>listScaleOutEcuResponse.setMessage(_ctx.stringValue("ListScaleOutEcuResponse.Message"));<NEW_LINE>List<EcuInfo> ecuInfoList = new ArrayList<EcuInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListScaleOutEcuResponse.EcuInfoList.Length"); i++) {<NEW_LINE>EcuInfo ecuInfo = new EcuInfo();<NEW_LINE>ecuInfo.setEcuId(_ctx.stringValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].EcuId"));<NEW_LINE>ecuInfo.setOnline(_ctx.booleanValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].Online"));<NEW_LINE>ecuInfo.setDockerEnv(_ctx.booleanValue<MASK><NEW_LINE>ecuInfo.setCreateTime(_ctx.longValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].CreateTime"));<NEW_LINE>ecuInfo.setUpdateTime(_ctx.longValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].UpdateTime"));<NEW_LINE>ecuInfo.setIpAddr(_ctx.stringValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].IpAddr"));<NEW_LINE>ecuInfo.setHeartbeatTime(_ctx.longValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].HeartbeatTime"));<NEW_LINE>ecuInfo.setUserId(_ctx.stringValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].UserId"));<NEW_LINE>ecuInfo.setName(_ctx.stringValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].Name"));<NEW_LINE>ecuInfo.setZoneId(_ctx.stringValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].ZoneId"));<NEW_LINE>ecuInfo.setRegionId(_ctx.stringValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].RegionId"));<NEW_LINE>ecuInfo.setInstanceId(_ctx.stringValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].InstanceId"));<NEW_LINE>ecuInfo.setVpcId(_ctx.stringValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].VpcId"));<NEW_LINE>ecuInfo.setAvailableCpu(_ctx.integerValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].AvailableCpu"));<NEW_LINE>ecuInfo.setAvailableMem(_ctx.integerValue("ListScaleOutEcuResponse.EcuInfoList[" + i + "].AvailableMem"));<NEW_LINE>ecuInfoList.add(ecuInfo);<NEW_LINE>}<NEW_LINE>listScaleOutEcuResponse.setEcuInfoList(ecuInfoList);<NEW_LINE>return listScaleOutEcuResponse;<NEW_LINE>} | ("ListScaleOutEcuResponse.EcuInfoList[" + i + "].DockerEnv")); |
96,934 | final ListReusableDelegationSetsResult executeListReusableDelegationSets(ListReusableDelegationSetsRequest listReusableDelegationSetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listReusableDelegationSetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListReusableDelegationSetsRequest> request = null;<NEW_LINE>Response<ListReusableDelegationSetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListReusableDelegationSetsRequestMarshaller().marshall(super.beforeMarshalling(listReusableDelegationSetsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Route 53");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListReusableDelegationSets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListReusableDelegationSetsResult> responseHandler = new StaxResponseHandler<ListReusableDelegationSetsResult>(new ListReusableDelegationSetsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
826,454 | public void createWithByForField(AccessLevel level, EclipseNode fieldNode, EclipseNode sourceNode, boolean whineIfExists, List<Annotation> onMethod) {<NEW_LINE>ASTNode source = sourceNode.get();<NEW_LINE>if (fieldNode.getKind() != Kind.FIELD) {<NEW_LINE>sourceNode.addError("@WithBy is only supported on a class or a field.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>EclipseNode typeNode = fieldNode.up();<NEW_LINE>boolean makeAbstract = typeNode != null && typeNode.getKind() == Kind.TYPE && (((TypeDeclaration) typeNode.get()).modifiers & ClassFileConstants.AccAbstract) != 0;<NEW_LINE>FieldDeclaration field = (FieldDeclaration) fieldNode.get();<NEW_LINE>TypeReference fieldType = copyType(field.type, source);<NEW_LINE>boolean isBoolean = isBoolean(fieldType);<NEW_LINE>AnnotationValues<Accessors> accessors = getAccessorsForField(fieldNode);<NEW_LINE>String withName = toWithByName(fieldNode, isBoolean, accessors);<NEW_LINE>if (withName == null) {<NEW_LINE>fieldNode.addWarning("Not generating a withXBy method for this field: It does not fit your @Accessors prefix list.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((field.modifiers & ClassFileConstants.AccStatic) != 0) {<NEW_LINE>fieldNode.addWarning("Not generating " + withName + " for this field: With methods cannot be generated for static fields.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((field.modifiers & ClassFileConstants.AccFinal) != 0 && field.initialization != null) {<NEW_LINE>fieldNode.addWarning("Not generating " + withName + " for this field: With methods cannot be generated for final, initialized fields.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (field.name != null && field.name.length > 0 && field.name[0] == '$') {<NEW_LINE>fieldNode.addWarning("Not generating " + withName + " for this field: With methods cannot be generated for fields starting with $.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String altName : toAllWithByNames(fieldNode, isBoolean, accessors)) {<NEW_LINE>switch(methodExists(altName, fieldNode, false, 1)) {<NEW_LINE>case EXISTS_BY_LOMBOK:<NEW_LINE>return;<NEW_LINE>case EXISTS_BY_USER:<NEW_LINE>if (whineIfExists) {<NEW_LINE>String altNameExpl = "";<NEW_LINE>if (!altName.equals(withName))<NEW_LINE>altNameExpl = <MASK><NEW_LINE>fieldNode.addWarning(String.format("Not generating %s(): A method with that name already exists%s", withName, altNameExpl));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>case NOT_EXISTS:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int modifier = toEclipseModifier(level);<NEW_LINE>MethodDeclaration method = createWithBy((TypeDeclaration) fieldNode.up().get(), fieldNode, withName, modifier, sourceNode, onMethod, makeAbstract);<NEW_LINE>injectMethod(fieldNode.up(), method);<NEW_LINE>} | String.format(" (%s)", altName); |
1,826,205 | protected void calculateErrorCorrection(int dest) {<NEW_LINE>if (errorLevel < 0 || errorLevel > 8)<NEW_LINE>errorLevel = 0;<NEW_LINE>int[] A = ERROR_LEVEL[errorLevel];<NEW_LINE>int Alength = 2 << errorLevel;<NEW_LINE>for (int k = 0; k < Alength; ++k) codewords[dest + k] = 0;<NEW_LINE>int lastE = Alength - 1;<NEW_LINE>for (int k = 0; k < lenCodewords; ++k) {<NEW_LINE>int t1 = codewords[k] + codewords[dest];<NEW_LINE>for (int e = 0; e <= lastE; ++e) {<NEW_LINE>int t2 = (t1 * A[lastE - e]) % MOD;<NEW_LINE>int t3 = MOD - t2;<NEW_LINE>codewords[dest + e] = ((e == lastE ? 0 : codewords[dest + e + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int k = 0; k < Alength; ++k) codewords[dest + k] = (MOD - codewords[dest + k]) % MOD;<NEW_LINE>} | 1]) + t3) % MOD; |
1,465,368 | public void CreateIndexes() {<NEW_LINE>try (Connection connection = GetConnection()) {<NEW_LINE>String[] tableNames = GetFileList();<NEW_LINE>try (Statement statement = connection.createStatement()) {<NEW_LINE>for (String tableName : tableNames) {<NEW_LINE>tableName = validateFname(tableName);<NEW_LINE>try {<NEW_LINE>statement.execute("CREATE UNIQUE INDEX IF NOT EXISTS " + tableName + "_idx on phantombot_" + tableName + " (section, variable);");<NEW_LINE>} catch (SQLiteException ex) {<NEW_LINE>if (ex.getResultCode() == SQLiteErrorCode.SQLITE_CONSTRAINT) {<NEW_LINE>statement.execute("DELETE FROM phantombot_" + tableName + " WHERE rowid NOT IN (SELECT MIN(rowid) FROM phantombot_" + tableName + " GROUP BY section, variable);");<NEW_LINE>statement.execute("CREATE UNIQUE INDEX IF NOT EXISTS " + <MASK><NEW_LINE>} else {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>com.gmt2001.Console.err.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>} | tableName + "_idx on phantombot_" + tableName + " (section, variable);"); |
31,453 | public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked, @Nullable Direction face) {<NEW_LINE>int ox = clicked.getBlockX();<NEW_LINE>int oy = clicked.getBlockY();<NEW_LINE>int oz = clicked.getBlockZ();<NEW_LINE>BlockType initialType = clicked.getExtent().getBlock(clicked.toVector().toBlockPoint()).getBlockType();<NEW_LINE>if (initialType.getMaterial().isAir()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (initialType == BlockTypes.BEDROCK && !player.canDestroyBedrock()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try (EditSession editSession = session.createEditSession(player)) {<NEW_LINE>editSession.getSurvivalExtent().setToolUse(config.superPickaxeManyDrop);<NEW_LINE>try {<NEW_LINE>for (int x = ox - range; x <= ox + range; ++x) {<NEW_LINE>for (int y = oy - range; y <= oy + range; ++y) {<NEW_LINE>for (int z = oz - range; z <= oz + range; ++z) {<NEW_LINE>BlockVector3 pos = BlockVector3.at(x, y, z);<NEW_LINE>if (editSession.getBlock(pos).getBlockType() != initialType) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>editSession.setBlock(pos, BlockTypes.AIR.getDefaultState());<NEW_LINE>((World) clicked.getExtent()).queueBlockBreakEffect(server, pos, initialType, clicked.toVector().toBlockPoint<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (MaxChangedBlocksException e) {<NEW_LINE>player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes"));<NEW_LINE>} finally {<NEW_LINE>session.remember(editSession);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | ().distanceSq(pos)); |
888,852 | StaticObject doCached(@JavaType(internalName = "Ljava/lang/invoke/MemberName;") StaticObject self, @JavaType(value = Class.class) StaticObject caller, int lookupMode, boolean speculativeResolve, @Bind("getContext()") EspressoContext context, @Cached ResolveNode resolve) {<NEW_LINE>StaticObject result = StaticObject.NULL;<NEW_LINE>EspressoException error = null;<NEW_LINE>try {<NEW_LINE>return resolve.execute(self, caller, lookupMode);<NEW_LINE>} catch (EspressoException e) {<NEW_LINE>error = e;<NEW_LINE>}<NEW_LINE>Meta meta = context.getMeta();<NEW_LINE>if (StaticObject.isNull(result)) {<NEW_LINE>int refKind = getRefKind(meta<MASK><NEW_LINE>if (!isValidRefKind(refKind)) {<NEW_LINE>throw meta.throwExceptionWithMessage(meta.java_lang_InternalError, "obsolete MemberName format");<NEW_LINE>}<NEW_LINE>if (!speculativeResolve && error != null) {<NEW_LINE>throw error;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | .java_lang_invoke_MemberName_flags.getInt(self)); |
1,607,118 | public String toDebugString(final Locale locale) {<NEW_LINE>if (values == null) {<NEW_LINE>return "No Email Item";<NEW_LINE>}<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>for (final Map.Entry<String, EmailItemBean> entry : values.entrySet()) {<NEW_LINE>final String localeKey = entry.getKey();<NEW_LINE>final EmailItemBean emailItemBean = entry.getValue();<NEW_LINE>sb.append("EmailItem ").append(LocaleHelper.debugLabel(LocaleHelper.parseLocaleString(localeKey))).append(": \n");<NEW_LINE>sb.append(" To:").append(emailItemBean.getTo()).append('\n');<NEW_LINE>sb.append("From:").append(emailItemBean.getFrom<MASK><NEW_LINE>sb.append("Subj:").append(emailItemBean.getSubject()).append('\n');<NEW_LINE>sb.append("Body:").append(emailItemBean.getBodyPlain()).append('\n');<NEW_LINE>sb.append("Html:").append(emailItemBean.getBodyHtml()).append('\n');<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | ()).append('\n'); |
257,225 | private void updateTwinnedDeclaration(String alias, Name refName, Ref ref) {<NEW_LINE>checkNotNull(ref.getTwin());<NEW_LINE>// Don't handle declarations of an already flat name, just qualified names.<NEW_LINE>if (!ref.getNode().isGetProp()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Node rvalue = ref<MASK><NEW_LINE>Node parent = ref.getNode().getParent();<NEW_LINE>Node grandparent = parent.getParent();<NEW_LINE>if (rvalue != null && rvalue.isFunction()) {<NEW_LINE>checkForReceiverAffectedByCollapse(rvalue, refName.getJSDocInfo(), refName);<NEW_LINE>}<NEW_LINE>// Create the new alias node.<NEW_LINE>Node nameNode = NodeUtil.newName(compiler, alias, grandparent.getFirstChild(), refName.getFullName());<NEW_LINE>NodeUtil.copyNameAnnotations(ref.getNode(), nameNode);<NEW_LINE>// BEFORE:<NEW_LINE>// ... (x.y = 3);<NEW_LINE>//<NEW_LINE>// AFTER:<NEW_LINE>// var x$y;<NEW_LINE>// ... (x$y = 3);<NEW_LINE>Node current = grandparent;<NEW_LINE>Node currentParent = grandparent.getParent();<NEW_LINE>for (; !currentParent.isScript() && !currentParent.isBlock(); current = currentParent, currentParent = currentParent.getParent()) {<NEW_LINE>}<NEW_LINE>// Create a stub variable declaration right<NEW_LINE>// before the current statement.<NEW_LINE>Node stubVar = IR.var(nameNode.cloneTree()).srcrefIfMissing(nameNode);<NEW_LINE>stubVar.insertBefore(current);<NEW_LINE>ref.getNode().replaceWith(nameNode);<NEW_LINE>compiler.reportChangeToEnclosingScope(nameNode);<NEW_LINE>} | .getNode().getNext(); |
1,106,473 | public void recordProcessInstanceDeleted(String processInstanceId, String processDefinitionId, String processTenantId) {<NEW_LINE>if (isHistoryEnabled(processDefinitionId)) {<NEW_LINE>HistoricProcessInstanceEntity historicProcessInstance = getHistoricProcessInstanceEntityManager().findById(processInstanceId);<NEW_LINE>getHistoricDetailEntityManager().deleteHistoricDetailsByProcessInstanceId(processInstanceId);<NEW_LINE>processEngineConfiguration.getVariableServiceConfiguration().getHistoricVariableService().deleteHistoricVariableInstancesByProcessInstanceId(processInstanceId);<NEW_LINE>getHistoricActivityInstanceEntityManager().deleteHistoricActivityInstancesByProcessInstanceId(processInstanceId);<NEW_LINE>TaskHelper.deleteHistoricTaskInstancesByProcessInstanceId(processInstanceId);<NEW_LINE>processEngineConfiguration.getIdentityLinkServiceConfiguration().getHistoricIdentityLinkService().deleteHistoricIdentityLinksByProcessInstanceId(processInstanceId);<NEW_LINE>if (processEngineConfiguration.isEnableEntityLinks()) {<NEW_LINE>processEngineConfiguration.getEntityLinkServiceConfiguration().getHistoricEntityLinkService().deleteHistoricEntityLinksByScopeIdAndScopeType(processInstanceId, ScopeTypes.BPMN);<NEW_LINE>}<NEW_LINE>getCommentEntityManager().deleteCommentsByProcessInstanceId(processInstanceId);<NEW_LINE>if (historicProcessInstance != null) {<NEW_LINE>getHistoricProcessInstanceEntityManager().delete(historicProcessInstance, false);<NEW_LINE>}<NEW_LINE>// Also delete any sub-processes that may be active (ACT-821)<NEW_LINE>List<HistoricProcessInstance> selectList = getHistoricProcessInstanceEntityManager().findHistoricProcessInstancesBySuperProcessInstanceId(processInstanceId);<NEW_LINE>for (HistoricProcessInstance child : selectList) {<NEW_LINE>recordProcessInstanceDeleted(child.getId(), <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | processDefinitionId, child.getTenantId()); |
1,477,481 | private void readFromFile() throws TextIndexMetadataException {<NEW_LINE>try {<NEW_LINE>DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();<NEW_LINE>Document doc = builder.parse(metadataFilePath.toFile());<NEW_LINE>doc.getDocumentElement().normalize();<NEW_LINE>Element rootElement = doc.getDocumentElement();<NEW_LINE>if (!rootElement.getNodeName().equals(ROOT_ELEMENT_NAME)) {<NEW_LINE>throw new TextIndexMetadataException("Text index metadata file corrupted");<NEW_LINE>}<NEW_LINE>NodeList coreElements = doc.getElementsByTagName(CORE_ELEMENT_NAME);<NEW_LINE>if (coreElements.getLength() == 0) {<NEW_LINE>throw new TextIndexMetadataException("Text index metadata file corrupted");<NEW_LINE>}<NEW_LINE>int coreIndx = 0;<NEW_LINE>while (coreIndx < coreElements.getLength()) {<NEW_LINE>Element coreElement = (<MASK><NEW_LINE>String coreName = getElementTextContent(coreElement, CORE_NAME_ELEMENT_NAME, true);<NEW_LINE>String solrVersion = getElementTextContent(coreElement, SOLR_VERSION_ELEMENT_NAME, true);<NEW_LINE>String schemaVersion = getElementTextContent(coreElement, SCHEMA_VERSION_ELEMENT_NAME, true);<NEW_LINE>String relativeTextIndexPath = getElementTextContent(coreElement, TEXT_INDEX_PATH_ELEMENT_NAME, true);<NEW_LINE>Path absoluteDatabasePath = caseDirectoryPath.resolve(relativeTextIndexPath);<NEW_LINE>Index index = new Index(absoluteDatabasePath.toString(), solrVersion, schemaVersion, coreName, "");<NEW_LINE>indexes.add(index);<NEW_LINE>coreIndx++;<NEW_LINE>}<NEW_LINE>} catch (ParserConfigurationException | SAXException | IOException ex) {<NEW_LINE>throw new TextIndexMetadataException(String.format("Error reading from text index metadata file %s", metadataFilePath), ex);<NEW_LINE>}<NEW_LINE>} | Element) coreElements.item(coreIndx); |
1,768,076 | /*<NEW_LINE>* Restore values when a playback ends<NEW_LINE>*/<NEW_LINE>private void completionMediaPlayer(long msgId) {<NEW_LINE>if (messages == null || messages.isEmpty() || messagesPlaying == null || messagesPlaying.isEmpty())<NEW_LINE>return;<NEW_LINE>for (MessageVoiceClip m : messagesPlaying) {<NEW_LINE>if (m.getIdMessage() == msgId) {<NEW_LINE>logDebug("completionMediaPlayer ");<NEW_LINE>m.setProgress(0);<NEW_LINE>m.setPaused(false);<NEW_LINE>if (m.getMediaPlayer().isPlaying()) {<NEW_LINE>m<MASK><NEW_LINE>}<NEW_LINE>m.getMediaPlayer().seekTo(m.getProgress());<NEW_LINE>for (int i = 0; i < messages.size(); i++) {<NEW_LINE>if (messages.get(i).getMessage().getMsgId() == msgId) {<NEW_LINE>int positionInAdapter = i + 1;<NEW_LINE>notifyItemChanged(positionInAdapter);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getMediaPlayer().stop(); |
1,072,499 | public void init(final ServletConfig config) throws ServletException {<NEW_LINE>super.init(config);<NEW_LINE>final ServletContext context = config.getServletContext();<NEW_LINE>if (null == registry) {<NEW_LINE>final Object registryAttr = context.getAttribute(METRICS_REGISTRY);<NEW_LINE>if (registryAttr instanceof MetricRegistry) {<NEW_LINE>this.registry = (MetricRegistry) registryAttr;<NEW_LINE>} else {<NEW_LINE>throw new ServletException("Couldn't find a MetricRegistry instance.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final TimeUnit rateUnit = parseTimeUnit(context.getInitParameter(RATE_UNIT), TimeUnit.SECONDS);<NEW_LINE>final TimeUnit durationUnit = parseTimeUnit(context.getInitParameter(DURATION_UNIT), TimeUnit.SECONDS);<NEW_LINE>final boolean showSamples = Boolean.parseBoolean(context.getInitParameter(SHOW_SAMPLES));<NEW_LINE>MetricFilter filter = (MetricFilter) context.getAttribute(METRIC_FILTER);<NEW_LINE>if (filter == null) {<NEW_LINE>filter = MetricFilter.ALL;<NEW_LINE>}<NEW_LINE>this.mapper = new ObjectMapper().registerModule(new NakadiMetricsModule(rateUnit, durationUnit, showSamples, filter));<NEW_LINE>this.allowedOrigin = context.getInitParameter(ALLOWED_ORIGIN);<NEW_LINE>this.<MASK><NEW_LINE>} | jsonpParamName = context.getInitParameter(CALLBACK_PARAM); |
246,697 | public boolean isPreAuthorizedScope(OAuth20Provider provider, String clientId, String[] scopes) throws OAuth20Exception {<NEW_LINE>if (scopes == null || scopes.length == 0) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Null or no scopes provided");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (provider == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>OidcOAuth20ClientProvider clientProvider = provider.getClientProvider();<NEW_LINE>if (clientProvider == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>OidcOAuth20Client client = clientProvider.get(clientId);<NEW_LINE>if (client == null) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>String preAuthzScopes = client.getPreAuthorizedScope();<NEW_LINE>if (preAuthzScopes == null || preAuthzScopes.isEmpty()) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "No pre-authorized scopes found in the client configuration");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>OidcBaseClientScopeReducer reducer = new OidcBaseClientScopeReducer((OidcBaseClient) client);<NEW_LINE>for (int i = 0; i < scopes.length; i++) {<NEW_LINE>String scope = scopes[i].trim();<NEW_LINE>if (scope != null && scope.length() > 0) {<NEW_LINE>if (!reducer.hasClientPreAuthorizedScope(scope)) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Scope [" + scope + "] was not a client pre-authorized scope");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | OAuth20InvalidClientException("security.oauth20.error.invalid.client", clientId, false); |
1,092,531 | public static void YUV420pToRGBH2H(byte yh, byte yl, byte uh, byte ul, byte vh, byte vl, int nlbi, byte[] data, byte[] lowBits, int nlbo, int off) {<NEW_LINE>int clipMax = ((1 << nlbo) << 8) - 1;<NEW_LINE>int round = (1 << nlbo) >> 1;<NEW_LINE>int c = ((yh + 128) << nlbi) + yl - 64;<NEW_LINE>int d = ((uh + 128) << nlbi) + ul - 512;<NEW_LINE>int e = ((vh + 128) << nlbi) + vl - 512;<NEW_LINE>int r = MathUtil.clip((298 * c + 409 * e + 128) >> 8, 0, clipMax);<NEW_LINE>int g = MathUtil.clip((298 * c - 100 * d - 208 * e + 128) <MASK><NEW_LINE>int b = MathUtil.clip((298 * c + 516 * d + 128) >> 8, 0, clipMax);<NEW_LINE>int valR = MathUtil.clip((r + round) >> nlbo, 0, 255);<NEW_LINE>data[off] = (byte) (valR - 128);<NEW_LINE>lowBits[off] = (byte) (r - (valR << nlbo));<NEW_LINE>int valG = MathUtil.clip((g + round) >> nlbo, 0, 255);<NEW_LINE>data[off + 1] = (byte) (valG - 128);<NEW_LINE>lowBits[off + 1] = (byte) (g - (valG << nlbo));<NEW_LINE>int valB = MathUtil.clip((b + round) >> nlbo, 0, 255);<NEW_LINE>data[off + 2] = (byte) (valB - 128);<NEW_LINE>lowBits[off + 2] = (byte) (b - (valB << nlbo));<NEW_LINE>} | >> 8, 0, clipMax); |
1,286,796 | public static JsonObject execute(ValidationAction action) {<NEW_LINE>JsonBuilder obj = new JsonBuilder();<NEW_LINE>obj.startObject();<NEW_LINE>final String queryString = getArg(action, paramQuery);<NEW_LINE>String querySyntax = getArgOrNull(action, paramSyntax);<NEW_LINE>if (querySyntax == null || querySyntax.equals(""))<NEW_LINE>querySyntax = "SPARQL";<NEW_LINE>Syntax language = Syntax.lookup(querySyntax);<NEW_LINE>if (language == null) {<NEW_LINE>ServletOps.errorBadRequest("Unknown syntax: " + querySyntax);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>boolean outputSPARQL = true;<NEW_LINE>boolean outputAlgebra = true;<NEW_LINE>boolean outputQuads = true;<NEW_LINE>boolean outputOptimized = true;<NEW_LINE>boolean outputOptimizedQuads = true;<NEW_LINE>obj.key(jInput).value(queryString);<NEW_LINE>// Attempt to parse it.<NEW_LINE>Query query = null;<NEW_LINE>try {<NEW_LINE>query = QueryFactory.create(queryString, "http://example/base/", language);<NEW_LINE>} catch (QueryParseException ex) {<NEW_LINE>obj.key(jErrors);<NEW_LINE>// Errors array<NEW_LINE>obj.startArray();<NEW_LINE>obj.startObject();<NEW_LINE>obj.key(jParseError).<MASK><NEW_LINE>obj.key(jParseErrorLine).value(ex.getLine());<NEW_LINE>obj.key(jParseErrorCol).value(ex.getColumn());<NEW_LINE>obj.finishObject();<NEW_LINE>obj.finishArray();<NEW_LINE>// Outer object<NEW_LINE>obj.finishObject();<NEW_LINE>return obj.build().getAsObject();<NEW_LINE>}<NEW_LINE>if (query != null) {<NEW_LINE>if (outputSPARQL)<NEW_LINE>formatted(obj, query);<NEW_LINE>if (outputAlgebra)<NEW_LINE>algebra(obj, query);<NEW_LINE>if (outputQuads)<NEW_LINE>algebraQuads(obj, query);<NEW_LINE>if (outputOptimized)<NEW_LINE>algebraOpt(obj, query);<NEW_LINE>if (outputOptimizedQuads)<NEW_LINE>algebraOptQuads(obj, query);<NEW_LINE>}<NEW_LINE>obj.finishObject();<NEW_LINE>return obj.build().getAsObject();<NEW_LINE>} | value(ex.getMessage()); |
900,352 | private static void print(@Nonnull ConsoleView consoleView, @Nullable Notification notification, @Nonnull String text) {<NEW_LINE>String content = StringUtil.convertLineSeparators(text);<NEW_LINE>while (true) {<NEW_LINE>Matcher tagMatcher = TAG_PATTERN.matcher(content);<NEW_LINE>if (!tagMatcher.find()) {<NEW_LINE>consoleView.print(content, ConsoleViewContentType.ERROR_OUTPUT);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>String tagStart = tagMatcher.group();<NEW_LINE>consoleView.print(content.substring(0, tagMatcher.start()), ConsoleViewContentType.ERROR_OUTPUT);<NEW_LINE>Matcher aMatcher = A_PATTERN.matcher(tagStart);<NEW_LINE>if (aMatcher.matches()) {<NEW_LINE>final String <MASK><NEW_LINE>int linkEnd = content.indexOf(A_CLOSING, tagMatcher.end());<NEW_LINE>if (linkEnd > 0) {<NEW_LINE>String linkText = content.substring(tagMatcher.end(), linkEnd).replaceAll(TAG_PATTERN.pattern(), "");<NEW_LINE>consoleView.printHyperlink(linkText, new HyperlinkInfo() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void navigate(Project project) {<NEW_LINE>if (notification != null && notification.getListener() != null) {<NEW_LINE>notification.getListener().hyperlinkUpdate(notification, IJSwingUtilities.createHyperlinkEvent(href, consoleView.getComponent()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>content = content.substring(linkEnd + A_CLOSING.length());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (NEW_LINES.contains(tagStart)) {<NEW_LINE>consoleView.print("\n", ConsoleViewContentType.SYSTEM_OUTPUT);<NEW_LINE>} else {<NEW_LINE>consoleView.print(content.substring(tagMatcher.start(), tagMatcher.end()), ConsoleViewContentType.ERROR_OUTPUT);<NEW_LINE>}<NEW_LINE>content = content.substring(tagMatcher.end());<NEW_LINE>}<NEW_LINE>consoleView.print("\n", ConsoleViewContentType.SYSTEM_OUTPUT);<NEW_LINE>} | href = aMatcher.group(2); |
1,287,504 | public void refresh(Object inventory, Object locator, Object product, Object aislex, Object lineFrom, Object lineTo, IStatusBar statusBar, Boolean isSecondCount) {<NEW_LINE>m_mTab.dataSave(true);<NEW_LINE>MQuery query = m_staticQuery.deepCopy();<NEW_LINE>// Physical Inventory<NEW_LINE>if (inventory == null || inventory.toString().length() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>query.addRestriction("M_Inventory_ID", MQuery.EQUAL, inventory);<NEW_LINE>// Locator<NEW_LINE>if (locator != null && locator.toString().length() > 0)<NEW_LINE>query.addRestriction("M_Locator_ID", MQuery.EQUAL, locator);<NEW_LINE>// Product<NEW_LINE>if (product != null && product.toString().length() > 0)<NEW_LINE>query.addRestriction("M_Product_ID", MQuery.EQUAL, product);<NEW_LINE>// aislex<NEW_LINE>if (aislex != null && aislex.toString().length() > 0)<NEW_LINE>query.addRestriction("M_Locator_ID IN (SELECT M_Locator_ID FROM M_Locator WHERE X='" + aislex.toString() + "')");<NEW_LINE>// DateFrom<NEW_LINE>if (lineFrom != null)<NEW_LINE>query.addRestriction("Line", MQuery.GREATER_EQUAL, lineFrom);<NEW_LINE>// DateTO<NEW_LINE>if (lineTo != null)<NEW_LINE>query.addRestriction(<MASK><NEW_LINE>if (isSecondCount) {<NEW_LINE>// Hardcoded Window: Physical Inventory<NEW_LINE>int AD_Window_ID = 168;<NEW_LINE>GridWindowVO wVO = AEnv.getMWindowVO(m_WindowNo, AD_Window_ID, 0);<NEW_LINE>if (wVO == null)<NEW_LINE>return;<NEW_LINE>GridWindow m_mWindow2 = new GridWindow(wVO);<NEW_LINE>// second count tab<NEW_LINE>GridTab m_mTab2 = m_mWindow2.getTab(3);<NEW_LINE>String sql = m_mTab2.getWhereClause();<NEW_LINE>query.addRestriction(sql);<NEW_LINE>}<NEW_LINE>log.info("VTrxMaterial.refresh query=" + query.toString());<NEW_LINE>statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), "StartSearch"), false);<NEW_LINE>//<NEW_LINE>m_mTab.setQuery(query);<NEW_LINE>m_mTab.query(false);<NEW_LINE>//<NEW_LINE>int no = m_mTab.getRowCount();<NEW_LINE>statusBar.setStatusLine(" ", false);<NEW_LINE>statusBar.setStatusDB(Integer.toString(no));<NEW_LINE>} | "Line", MQuery.LESS_EQUAL, lineTo); |
1,173,682 | static Span generateSpan(SpanData spanData, Endpoint localEndpoint) {<NEW_LINE>SpanContext context = spanData.getContext();<NEW_LINE>long startTimestamp = toEpochMicros(spanData.getStartTimestamp());<NEW_LINE>// TODO(sebright): Fix the Checker Framework warning.<NEW_LINE>@SuppressWarnings("nullness")<NEW_LINE>long endTimestamp = toEpochMicros(spanData.getEndTimestamp());<NEW_LINE>// TODO(bdrutu): Fix the Checker Framework warning.<NEW_LINE>@SuppressWarnings("nullness")<NEW_LINE>Span.Builder spanBuilder = Span.newBuilder().traceId(context.getTraceId().toLowerBase16()).id(context.getSpanId().toLowerBase16()).kind(toSpanKind(spanData)).name(spanData.getName()).timestamp(toEpochMicros(spanData.getStartTimestamp())).duration(endTimestamp - startTimestamp).localEndpoint(localEndpoint);<NEW_LINE>if (spanData.getParentSpanId() != null && spanData.getParentSpanId().isValid()) {<NEW_LINE>spanBuilder.parentId(spanData.<MASK><NEW_LINE>}<NEW_LINE>for (Map.Entry<String, AttributeValue> label : spanData.getAttributes().getAttributeMap().entrySet()) {<NEW_LINE>spanBuilder.putTag(label.getKey(), attributeValueToString(label.getValue()));<NEW_LINE>}<NEW_LINE>Status status = spanData.getStatus();<NEW_LINE>if (status != null) {<NEW_LINE>spanBuilder.putTag(STATUS_CODE, status.getCanonicalCode().toString());<NEW_LINE>if (status.getDescription() != null) {<NEW_LINE>spanBuilder.putTag(STATUS_DESCRIPTION, status.getDescription());<NEW_LINE>}<NEW_LINE>if (!status.isOk()) {<NEW_LINE>spanBuilder.putTag(STATUS_ERROR, status.getCanonicalCode().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (TimedEvent<Annotation> annotation : spanData.getAnnotations().getEvents()) {<NEW_LINE>spanBuilder.addAnnotation(toEpochMicros(annotation.getTimestamp()), annotation.getEvent().getDescription());<NEW_LINE>}<NEW_LINE>for (TimedEvent<io.opencensus.trace.MessageEvent> messageEvent : spanData.getMessageEvents().getEvents()) {<NEW_LINE>spanBuilder.addAnnotation(toEpochMicros(messageEvent.getTimestamp()), messageEvent.getEvent().getType().name());<NEW_LINE>}<NEW_LINE>return spanBuilder.build();<NEW_LINE>} | getParentSpanId().toLowerBase16()); |
860,905 | protected void ended(GENASubscription subscription, CancelReason reason, UpnpResponse response) {<NEW_LINE>final Service service = subscription.getService();<NEW_LINE>if (service != null) {<NEW_LINE>final ServiceId serviceId = service.getServiceId();<NEW_LINE>final Device device = service.getDevice();<NEW_LINE>if (device != null) {<NEW_LINE>final Device deviceRoot = device.getRoot();<NEW_LINE>if (deviceRoot != null) {<NEW_LINE>final <MASK><NEW_LINE>if (deviceRootIdentity != null) {<NEW_LINE>final UDN deviceRootUdn = deviceRootIdentity.getUdn();<NEW_LINE>logger.debug("A GENA subscription '{}' for device '{}' was ended", serviceId.getId(), deviceRootUdn);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((CancelReason.EXPIRED.equals(reason) || CancelReason.RENEWAL_FAILED.equals(reason)) && upnpService != null) {<NEW_LINE>final ControlPoint cp = upnpService.getControlPoint();<NEW_LINE>if (cp != null) {<NEW_LINE>final UpnpSubscriptionCallback callback = new UpnpSubscriptionCallback(service, subscription.getActualDurationSeconds());<NEW_LINE>cp.execute(callback);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | DeviceIdentity deviceRootIdentity = deviceRoot.getIdentity(); |
474,294 | public void unboxVar(UnboxState state, Class reqdType, Map<Variable, TemporaryLocalVariable> unboxMap, Variable v, List<Instr> newInstrs) {<NEW_LINE>Variable unboxedV = getUnboxedVar(reqdType, unboxMap, v);<NEW_LINE>if (reqdType == java.lang.Boolean.class) {<NEW_LINE>newInstrs.add(new UnboxBooleanInstr(unboxedV, v));<NEW_LINE>} else if (reqdType == Float.class) {<NEW_LINE>// SSS FIXME: This is broken<NEW_LINE>newInstrs.add(new UnboxFloatInstr(unboxedV, v));<NEW_LINE>} else if (reqdType == Fixnum.class) {<NEW_LINE>// CON FIXME: So this is probably broken too<NEW_LINE>newInstrs.add(<MASK><NEW_LINE>}<NEW_LINE>state.unboxedVars.put(v, reqdType);<NEW_LINE>// System.out.println("UNBOXING for " + v + " with type " + vType);<NEW_LINE>} | new UnboxFixnumInstr(unboxedV, v)); |
1,132,927 | private void extractEmbeddedOverlays(int frameIndex, BufferedImage bi) {<NEW_LINE>for (int gg0000 : embeddedOverlays) {<NEW_LINE>int ovlyRow = dataset.getInt(Tag.OverlayRows | gg0000, 0);<NEW_LINE>int ovlyColumns = dataset.getInt(Tag.OverlayColumns | gg0000, 0);<NEW_LINE>int ovlyBitPosition = dataset.getInt(Tag.OverlayBitPosition | gg0000, 0);<NEW_LINE>int mask = 1 << ovlyBitPosition;<NEW_LINE>int ovlyLength = ovlyRow * ovlyColumns;<NEW_LINE>byte[] ovlyData = dataset.getSafeBytes(Tag.OverlayData | gg0000);<NEW_LINE>if (ovlyData == null) {<NEW_LINE>ovlyData = new byte[(((ovlyLength * frames + 7) >>> 3) + 1) & (~1)];<NEW_LINE>dataset.setBytes(Tag.OverlayData | <MASK><NEW_LINE>}<NEW_LINE>Overlays.extractFromPixeldata(bi.getRaster(), mask, ovlyData, ovlyLength * frameIndex, ovlyLength);<NEW_LINE>LOG.debug("Extracted embedded overlay #{} from bit #{} of frame #{}", new Object[] { (gg0000 >>> 17) + 1, ovlyBitPosition, frameIndex + 1 });<NEW_LINE>}<NEW_LINE>} | gg0000, VR.OB, ovlyData); |
1,239,120 | public static ListInuseServicesResponse unmarshall(ListInuseServicesResponse listInuseServicesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listInuseServicesResponse.setRequestId(_ctx.stringValue("ListInuseServicesResponse.RequestId"));<NEW_LINE>listInuseServicesResponse.setNextToken(_ctx.stringValue("ListInuseServicesResponse.NextToken"));<NEW_LINE>listInuseServicesResponse.setTotalCount(_ctx.stringValue("ListInuseServicesResponse.TotalCount"));<NEW_LINE>listInuseServicesResponse.setMaxResults(_ctx.stringValue("ListInuseServicesResponse.MaxResults"));<NEW_LINE>List<Service> services = new ArrayList<Service>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListInuseServicesResponse.Services.Length"); i++) {<NEW_LINE>Service service = new Service();<NEW_LINE>service.setStatus(_ctx.stringValue<MASK><NEW_LINE>service.setPublishTime(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].PublishTime"));<NEW_LINE>service.setVersion(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].Version"));<NEW_LINE>service.setDeployType(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].DeployType"));<NEW_LINE>service.setServiceId(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].ServiceId"));<NEW_LINE>service.setSupplierUrl(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].SupplierUrl"));<NEW_LINE>service.setServiceType(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].ServiceType"));<NEW_LINE>service.setSupplierName(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].SupplierName"));<NEW_LINE>service.setCommodityCode(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].CommodityCode"));<NEW_LINE>List<ServiceInfo> serviceInfos = new ArrayList<ServiceInfo>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListInuseServicesResponse.Services[" + i + "].ServiceInfos.Length"); j++) {<NEW_LINE>ServiceInfo serviceInfo = new ServiceInfo();<NEW_LINE>serviceInfo.setLocale(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].ServiceInfos[" + j + "].Locale"));<NEW_LINE>serviceInfo.setImage(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].ServiceInfos[" + j + "].Image"));<NEW_LINE>serviceInfo.setName(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].ServiceInfos[" + j + "].Name"));<NEW_LINE>serviceInfo.setShortDescription(_ctx.stringValue("ListInuseServicesResponse.Services[" + i + "].ServiceInfos[" + j + "].ShortDescription"));<NEW_LINE>serviceInfos.add(serviceInfo);<NEW_LINE>}<NEW_LINE>service.setServiceInfos(serviceInfos);<NEW_LINE>services.add(service);<NEW_LINE>}<NEW_LINE>listInuseServicesResponse.setServices(services);<NEW_LINE>return listInuseServicesResponse;<NEW_LINE>} | ("ListInuseServicesResponse.Services[" + i + "].Status")); |
1,017,488 | public CredentialValidationResult validate(Credential credential) {<NEW_LINE>if (!(credential instanceof YubikeyCredential)) {<NEW_LINE>return CredentialValidationResult.NOT_VALIDATED_RESULT;<NEW_LINE>}<NEW_LINE>YubikeyCredential yubikeyCredential = ((YubikeyCredential) credential);<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (!YubicoClient.isValidOTPFormat(oneTimePassword)) {<NEW_LINE>return CredentialValidationResult.INVALID_RESULT;<NEW_LINE>}<NEW_LINE>RequestTraceSpan span = beginTrace(yubikeyCredential);<NEW_LINE>ResponseStatus responseStatus = yubicoAPI.verify(oneTimePassword).getStatus();<NEW_LINE>doTrace(span, responseStatus);<NEW_LINE>LOG.log(Level.FINE, "Yubico server reported {0}", responseStatus.name());<NEW_LINE>switch(responseStatus) {<NEW_LINE>case BAD_OTP:<NEW_LINE>case REPLAYED_OTP:<NEW_LINE>case BAD_SIGNATURE:<NEW_LINE>case NO_SUCH_CLIENT:<NEW_LINE>return CredentialValidationResult.INVALID_RESULT;<NEW_LINE>case MISSING_PARAMETER:<NEW_LINE>case OPERATION_NOT_ALLOWED:<NEW_LINE>case BACKEND_ERROR:<NEW_LINE>case NOT_ENOUGH_ANSWERS:<NEW_LINE>case REPLAYED_REQUEST:<NEW_LINE>LOG.log(Level.WARNING, "Yubico reported {0}", responseStatus.name());<NEW_LINE>return CredentialValidationResult.NOT_VALIDATED_RESULT;<NEW_LINE>case OK:<NEW_LINE>// carry on.<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>LOG.log(Level.SEVERE, "Unknown/new yubico return status");<NEW_LINE>}<NEW_LINE>return new CredentialValidationResult(yubikeyCredential.getPublicID());<NEW_LINE>} catch (YubicoVerificationException | YubicoValidationFailure ex) {<NEW_LINE>LOG.log(Level.SEVERE, null, ex);<NEW_LINE>return CredentialValidationResult.NOT_VALIDATED_RESULT;<NEW_LINE>}<NEW_LINE>} | String oneTimePassword = yubikeyCredential.getOneTimePasswordString(); |
1,110,308 | public static BatchGetEdgeInstanceChannelResponse unmarshall(BatchGetEdgeInstanceChannelResponse batchGetEdgeInstanceChannelResponse, UnmarshallerContext _ctx) {<NEW_LINE>batchGetEdgeInstanceChannelResponse.setRequestId(_ctx.stringValue("BatchGetEdgeInstanceChannelResponse.RequestId"));<NEW_LINE>batchGetEdgeInstanceChannelResponse.setSuccess(_ctx.booleanValue("BatchGetEdgeInstanceChannelResponse.Success"));<NEW_LINE>batchGetEdgeInstanceChannelResponse.setCode(_ctx.stringValue("BatchGetEdgeInstanceChannelResponse.Code"));<NEW_LINE>batchGetEdgeInstanceChannelResponse.setErrorMessage(_ctx.stringValue("BatchGetEdgeInstanceChannelResponse.ErrorMessage"));<NEW_LINE>List<Channel> data = new ArrayList<Channel>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("BatchGetEdgeInstanceChannelResponse.Data.Length"); i++) {<NEW_LINE>Channel channel = new Channel();<NEW_LINE>channel.setChannelId(_ctx.stringValue("BatchGetEdgeInstanceChannelResponse.Data[" + i + "].ChannelId"));<NEW_LINE>channel.setChannelName(_ctx.stringValue("BatchGetEdgeInstanceChannelResponse.Data[" + i + "].ChannelName"));<NEW_LINE>List<Config> configList = new ArrayList<Config>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("BatchGetEdgeInstanceChannelResponse.Data[" + i + "].ConfigList.Length"); j++) {<NEW_LINE>Config config = new Config();<NEW_LINE>config.setConfigId(_ctx.stringValue("BatchGetEdgeInstanceChannelResponse.Data[" + i + "].ConfigList[" + j + "].ConfigId"));<NEW_LINE>config.setFormat(_ctx.stringValue("BatchGetEdgeInstanceChannelResponse.Data[" + i + "].ConfigList[" + j + "].Format"));<NEW_LINE>config.setContent(_ctx.stringValue("BatchGetEdgeInstanceChannelResponse.Data[" + i <MASK><NEW_LINE>config.setKey(_ctx.stringValue("BatchGetEdgeInstanceChannelResponse.Data[" + i + "].ConfigList[" + j + "].Key"));<NEW_LINE>configList.add(config);<NEW_LINE>}<NEW_LINE>channel.setConfigList(configList);<NEW_LINE>data.add(channel);<NEW_LINE>}<NEW_LINE>batchGetEdgeInstanceChannelResponse.setData(data);<NEW_LINE>return batchGetEdgeInstanceChannelResponse;<NEW_LINE>} | + "].ConfigList[" + j + "].Content")); |
1,855,040 | public Void visitFibForward(FibForward fibForward) {<NEW_LINE>assert !routeInfos.isEmpty();<NEW_LINE>RouteInfo primaryRouteInfo = routeInfos.get(0);<NEW_LINE>if (primaryRouteInfo.getNextHop() instanceof NextHopVtep) {<NEW_LINE>NextHopVtep nhVtep = (NextHopVtep) primaryRouteInfo.getNextHop();<NEW_LINE>routingStepDetailBuilder.setForwardingDetail(ForwardedIntoVxlanTunnel.of(nhVtep.getVni(), nhVtep.getVtepIp()));<NEW_LINE>} else {<NEW_LINE>Optional<Ip> maybeResolvedNextHopIp = fibForward.getArpIp();<NEW_LINE>if (!maybeResolvedNextHopIp.isPresent()) {<NEW_LINE>routingStepDetailBuilder.setForwardingDetail(ForwardedOutInterface.of(fibForward.getInterfaceName()));<NEW_LINE>} else {<NEW_LINE>Ip resolvedNextHopIp = maybeResolvedNextHopIp.get();<NEW_LINE>// TODO: remove deprecated arpIp<NEW_LINE>routingStepDetailBuilder.setForwardingDetail(ForwardedOutInterface.of(fibForward.getInterfaceName(), resolvedNextHopIp)).setArpIp(resolvedNextHopIp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>routingStepDetailBuilder.<MASK><NEW_LINE>routingStepBuilder.setAction(FORWARDED);<NEW_LINE>return null;<NEW_LINE>} | setOutputInterface(fibForward.getInterfaceName()); |
1,746,347 | public static void register(String userName, String userPassword, String session) {<NEW_LINE><MASK><NEW_LINE>SharedPreferences userPrefs = context.getSharedPreferences(getSharedPrefName(context), 0);<NEW_LINE>if (userName != null && userName.length() != 0 && userPassword != null && userPassword.length() != 0) {<NEW_LINE>Editor userEditor = userPrefs.edit();<NEW_LINE>userEditor.putString(ANS_USER_PREF_USER, userName);<NEW_LINE>userEditor.putString(ANS_USER_PREF_PASS, userPassword);<NEW_LINE>userEditor.putString(ANS_USER_PREF_SESSION, session);<NEW_LINE>userEditor.commit();<NEW_LINE>} else {<NEW_LINE>userName = userPrefs.getString(ANS_USER_PREF_USER, "");<NEW_LINE>userPassword = userPrefs.getString(ANS_USER_PREF_PASS, "");<NEW_LINE>if (session == null || session.length() == 0) {<NEW_LINE>session = userPrefs.getString(ANS_USER_PREF_SESSION, "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (userName == null || userName.length() == 0 || userPassword == null || userPassword.length() == 0 || session == null || session.length() == 0) {<NEW_LINE>PushContract.handleError(context, "Incomplete registration credentials", ANS_PUSH_CLIENT);<NEW_LINE>}<NEW_LINE>ANSManager.register(context, RhoConf.getString(ANS_APP_NAME), userName, userPassword, session, RhoConf.getString(ANS_SERVER));<NEW_LINE>} | Context context = ContextFactory.getContext(); |
1,063,785 | public Builder mergeFrom(voldemort.client.protocol.pb.VAdminProto.GetConfigResponse other) {<NEW_LINE>if (other == voldemort.client.protocol.pb.VAdminProto.GetConfigResponse.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (!other.configMap_.isEmpty()) {<NEW_LINE>if (result.configMap_.isEmpty()) {<NEW_LINE>result.configMap_ = new java.util.ArrayList<voldemort.client.protocol.pb.VAdminProto.MapFieldEntry>();<NEW_LINE>}<NEW_LINE>result.configMap_.addAll(other.configMap_);<NEW_LINE>}<NEW_LINE>if (!other.invalidConfigMap_.isEmpty()) {<NEW_LINE>if (result.invalidConfigMap_.isEmpty()) {<NEW_LINE>result.invalidConfigMap_ = new java.util.ArrayList<voldemort.client.protocol.pb.VAdminProto.MapFieldEntry>();<NEW_LINE>}<NEW_LINE>result.<MASK><NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.getUnknownFields());<NEW_LINE>return this;<NEW_LINE>} | invalidConfigMap_.addAll(other.invalidConfigMap_); |
56,551 | final UpdateGeoMatchSetResult executeUpdateGeoMatchSet(UpdateGeoMatchSetRequest updateGeoMatchSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateGeoMatchSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateGeoMatchSetRequest> request = null;<NEW_LINE>Response<UpdateGeoMatchSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateGeoMatchSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateGeoMatchSetRequest));<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, "UpdateGeoMatchSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateGeoMatchSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateGeoMatchSetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
19,610 | private void createHeaderRow(Sheet sheet, DecisionTable table) throws AxelorException {<NEW_LINE>Row titleRow = sheet.createRow(sheet.getLastRowNum());<NEW_LINE>Cell titleCell = titleRow.createCell(0);<NEW_LINE>titleCell.setCellValue(table.getParentElement().getAttributeValue("name"));<NEW_LINE>sheet.autoSizeColumn(0);<NEW_LINE>Row row = sheet.createRow(sheet.getLastRowNum() + 1);<NEW_LINE>int inputIndex = 0;<NEW_LINE>for (Input input : table.getInputs()) {<NEW_LINE>if (Strings.isNullOrEmpty(input.getLabel())) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_NO_VALUE, IExceptionMessage.MISSING_INPUT_LABEL);<NEW_LINE>}<NEW_LINE>Cell cell = row.createCell(inputIndex);<NEW_LINE>cell.setCellValue(input.getLabel() + "(" + input.getId() + ")");<NEW_LINE>sheet.autoSizeColumn(inputIndex);<NEW_LINE>inputIndex++;<NEW_LINE>}<NEW_LINE>int outputIndex = row.getLastCellNum();<NEW_LINE>for (Output output : table.getOutputs()) {<NEW_LINE>if (Strings.isNullOrEmpty(output.getLabel())) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_NO_VALUE, IExceptionMessage.MISSING_OUTPUT_LABEL);<NEW_LINE>}<NEW_LINE>Cell cell = row.createCell(outputIndex);<NEW_LINE>cell.setCellValue(output.getLabel() + "(" + <MASK><NEW_LINE>sheet.autoSizeColumn(outputIndex);<NEW_LINE>outputIndex++;<NEW_LINE>}<NEW_LINE>Cell cell = row.createCell(outputIndex);<NEW_LINE>cell.setCellValue("Annotation");<NEW_LINE>sheet.autoSizeColumn(outputIndex);<NEW_LINE>} | output.getId() + ")"); |
598,321 | public void configure(ConfigurableProvider provider) {<NEW_LINE>provider.addAlgorithm("KeyFactory.SPHINCSPLUS", PREFIX + "SPHINCSPlusKeyFactorySpi");<NEW_LINE>provider.addAlgorithm("KeyPairGenerator.SPHINCSPLUS", PREFIX + "SPHINCSPlusKeyPairGeneratorSpi");<NEW_LINE>provider.addAlgorithm("Alg.Alias.KeyFactory.SPHINCS+", "SPHINCSPLUS");<NEW_LINE>provider.addAlgorithm("Alg.Alias.KeyPairGenerator.SPHINCS+", "SPHINCSPLUS");<NEW_LINE>addSignatureAlgorithm(provider, "SPHINCSPLUS", PREFIX + "SignatureSpi$Direct", BCObjectIdentifiers.sphincsPlus);<NEW_LINE>provider.addAlgorithm("Alg.Alias.Signature." + BCObjectIdentifiers.sphincsPlus_shake_256.getId(), "SPHINCSPLUS");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Signature." + BCObjectIdentifiers.sphincsPlus_sha_256.getId(), "SPHINCSPLUS");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Signature." + BCObjectIdentifiers.sphincsPlus_sha_512.getId(), "SPHINCSPLUS");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Signature.OID." + BCObjectIdentifiers.sphincsPlus_shake_256.getId(), "SPHINCSPLUS");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Signature.OID." + BCObjectIdentifiers.sphincsPlus_sha_256.getId(), "SPHINCSPLUS");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Signature.OID." + BCObjectIdentifiers.sphincsPlus_sha_512.getId(), "SPHINCSPLUS");<NEW_LINE>provider.addAlgorithm("Alg.Alias.Signature.SPHINCS+", "SPHINCSPLUS");<NEW_LINE>AsymmetricKeyInfoConverter keyFact = new SPHINCSPlusKeyFactorySpi();<NEW_LINE>registerOid(provider, BCObjectIdentifiers.sphincsPlus, "SPHINCSPLUS", keyFact);<NEW_LINE>registerOid(provider, BCObjectIdentifiers.sphincsPlus_shake_256, "SPHINCSPLUS", keyFact);<NEW_LINE>registerOid(provider, BCObjectIdentifiers.sphincsPlus_sha_256, "SPHINCSPLUS", keyFact);<NEW_LINE>registerOid(provider, BCObjectIdentifiers.sphincsPlus_sha_512, "SPHINCSPLUS", keyFact);<NEW_LINE>registerOidAlgorithmParameters(<MASK><NEW_LINE>} | provider, BCObjectIdentifiers.sphincsPlus, "SPHINCSPLUS"); |
527,576 | public static void main(String[] args) {<NEW_LINE>// TODO Auto-generated method stub<NEW_LINE>char[][] board = { { '5', '3', '.', '.', '7', '.', '.', '.', '.' }, { '6', '.', '.', '1', '9', '5', '.', '.', '.' }, { '.', '9', '8', '.', '.', '.', '.', '6', '.' }, { '8', '.', '.', '.', '6', '.', '.', '.', '3' }, { '4', '.', '.', '8', '.', '3', '.', '.', '1' }, { '7', '.', '.', '.', '2', '.', '.', '.', '6' }, { '.', '6', '.', '.', '.', '.', '2', '8', '.' }, { '.', '.', '.', '4', '1', '9', '.', '.', '5' }, { '.', '.', '.', '.', '8', '.', '.', '7', '9' } };<NEW_LINE>r = board.length;<NEW_LINE>c = board[0].length;<NEW_LINE><MASK><NEW_LINE>for (char[] b : board) {<NEW_LINE>System.out.println(Arrays.toString(b));<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("---solving suduko---");<NEW_LINE>if (validSudoku(board, 0, 0) != true) {<NEW_LINE>System.out.println("Solving Sudoku not possible");<NEW_LINE>} else {<NEW_LINE>for (char[] b : board) {<NEW_LINE>System.out.println(Arrays.toString(b));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | System.out.println("--Suduko board---"); |
602,682 | public MergedWarpMessageProto convert2Proto(MergedWarpMessage mergedWarpMessage) {<NEW_LINE>final short typeCode = mergedWarpMessage.getTypeCode();<NEW_LINE>final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();<NEW_LINE>List<Any> lists = new ArrayList<>();<NEW_LINE>for (AbstractMessage msg : mergedWarpMessage.msgs) {<NEW_LINE>final PbConvertor pbConvertor = ProtobufConvertManager.getInstance().fetchConvertor(msg.<MASK><NEW_LINE>lists.add(Any.pack((Message) pbConvertor.convert2Proto(msg)));<NEW_LINE>}<NEW_LINE>MergedWarpMessageProto mergedWarpMessageProto = MergedWarpMessageProto.newBuilder().setAbstractMessage(abstractMessage).addAllMsgs(lists).addAllMsgIds(mergedWarpMessage.msgIds).build();<NEW_LINE>return mergedWarpMessageProto;<NEW_LINE>} | getClass().getName()); |
404,771 | final EvaluateFeatureResult executeEvaluateFeature(EvaluateFeatureRequest evaluateFeatureRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(evaluateFeatureRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EvaluateFeatureRequest> request = null;<NEW_LINE>Response<EvaluateFeatureResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EvaluateFeatureRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(evaluateFeatureRequest));<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, "Evidently");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EvaluateFeature");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "dataplane.";<NEW_LINE>String resolvedHostPrefix = String.format("dataplane.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<EvaluateFeatureResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EvaluateFeatureResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
944,388 | private T[] deleteRecursiveRoot() {<NEW_LINE>// Store the point to remove<NEW_LINE><MASK><NEW_LINE>// Set the root to null if it has no children<NEW_LINE>if (root.left == null && root.right == null) {<NEW_LINE>root = null;<NEW_LINE>return replacedPoint;<NEW_LINE>} else // If a right child exists, find a minimum to replace the root point<NEW_LINE>if (root.right != null) {<NEW_LINE>root.point = findMinRecursive(0, root.right, 1 % k);<NEW_LINE>deleteRecursiveSearch(new KDNode<T>(root.point), root, 0);<NEW_LINE>return replacedPoint;<NEW_LINE>} else // Otherwise, get the minimum from the left subtree and make it the right subtree<NEW_LINE>{<NEW_LINE>root.point = findMinRecursive(0, root.left, 1 % k);<NEW_LINE>deleteRecursiveSearch(new KDNode<T>(root.point), root, 0);<NEW_LINE>root.right = root.left;<NEW_LINE>root.left = null;<NEW_LINE>return replacedPoint;<NEW_LINE>}<NEW_LINE>} | T[] replacedPoint = root.point; |
1,761,662 | private MetaDataContexts buildChangedMetaDataContextWithChangedDataSource(final ShardingSphereMetaData originalMetaData, final Map<String, DataSourceProperties> newDataSourceProps) throws SQLException {<NEW_LINE>Collection<String> deletedDataSources = getDeletedDataSources(originalMetaData, newDataSourceProps).keySet();<NEW_LINE>Map<String, DataSource> changedDataSources = buildChangedDataSources(originalMetaData, newDataSourceProps);<NEW_LINE>Properties props = metaDataContexts<MASK><NEW_LINE>MetaDataContextsBuilder metaDataContextsBuilder = new MetaDataContextsBuilder(metaDataContexts.getGlobalRuleMetaData().getConfigurations(), props);<NEW_LINE>metaDataContextsBuilder.addSchema(originalMetaData.getName(), originalMetaData.getResource().getDatabaseType(), new DataSourceProvidedSchemaConfiguration(getNewDataSources(originalMetaData.getResource().getDataSources(), getAddedDataSources(originalMetaData, newDataSourceProps), changedDataSources, deletedDataSources), originalMetaData.getRuleMetaData().getConfigurations()), props);<NEW_LINE>metaDataContexts.getMetaDataPersistService().ifPresent(optional -> optional.getSchemaMetaDataService().persist(originalMetaData.getName(), originalMetaData.getName(), metaDataContextsBuilder.getSchemaMap(originalMetaData.getName())));<NEW_LINE>return metaDataContextsBuilder.build(metaDataContexts.getMetaDataPersistService().orElse(null));<NEW_LINE>} | .getProps().getProps(); |
599,244 | public void parseLoginAddressValue(String option) throws IllegalArgumentException {<NEW_LINE>// <user>:<password>@<host>:<port><NEW_LINE>int <MASK><NEW_LINE>if (uphpdelimiter >= 0) {<NEW_LINE>// @found<NEW_LINE>isLocal = false;<NEW_LINE>String userpass = inputAddress.substring(0, uphpdelimiter);<NEW_LINE>String hostport = inputAddress.substring(uphpdelimiter + 1, inputAddress.length());<NEW_LINE>if (userpass.length() > 1) {<NEW_LINE>int userindex = userpass.indexOf(":");<NEW_LINE>if (userindex >= 0) {<NEW_LINE>// :found<NEW_LINE>userName = userpass.substring(0, userindex);<NEW_LINE>if (userName.length() == 0) {<NEW_LINE>this.promptForUser(option);<NEW_LINE>}<NEW_LINE>password = userpass.substring(userindex + 1, userpass.length());<NEW_LINE>if (password.length() == 0) {<NEW_LINE>this.promptForPassword(option);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// : notfound<NEW_LINE>this.promptForUser(option);<NEW_LINE>this.promptForPassword(option);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.promptForUser(option);<NEW_LINE>this.promptForPassword(option);<NEW_LINE>}<NEW_LINE>if (hostport.length() > 1) {<NEW_LINE>int hostindex = hostport.indexOf(":");<NEW_LINE>if (hostindex >= 0) {<NEW_LINE>// :found<NEW_LINE>host = hostport.substring(0, hostindex);<NEW_LINE>if (host.length() == 0) {<NEW_LINE>// host not found<NEW_LINE>this.throwIAE(MISSING_HOST_VALUE_MESSAGE, option);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// : not found<NEW_LINE>this.throwIAE(MISSING_HOSTPORT_VALUE_MESSAGE, option);<NEW_LINE>}<NEW_LINE>port = hostport.substring(hostindex + 1, hostport.length());<NEW_LINE>if (port.length() == 0) {<NEW_LINE>this.throwIAE(MISSING_PORT_VALUE_MESSAGE, option);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Ensure port is a number<NEW_LINE>Double.parseDouble(port);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new NumberFormatException(CommandUtils.getMessage(INVALID_PORT_ARG_MESSAGE, port, option));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// @ found but no value after that<NEW_LINE>this.throwIAE(MISSING_HOSTPORT_VALUE_MESSAGE, option);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// @ not found<NEW_LINE>isLocal = true;<NEW_LINE>serverName = inputAddress;<NEW_LINE>}<NEW_LINE>} | uphpdelimiter = inputAddress.lastIndexOf("@"); |
1,415,808 | public ImmutableAttributes mapAttributesFor(ImmutableAttributes attributes, Iterable<? extends ComponentArtifactMetadata> artifacts) {<NEW_LINE>// Add attributes to be applied given the extension<NEW_LINE>if (artifactTypeDefinitions != null) {<NEW_LINE>String extension = null;<NEW_LINE>for (ComponentArtifactMetadata artifact : artifacts) {<NEW_LINE>String candidateExtension = artifact.getName().getExtension();<NEW_LINE>if (extension == null) {<NEW_LINE>extension = candidateExtension;<NEW_LINE>} else if (!extension.equals(candidateExtension)) {<NEW_LINE>extension = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (extension != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add artifact format as an implicit attribute when all artifacts have the same format<NEW_LINE>if (!attributes.contains(ARTIFACT_TYPE_ATTRIBUTE)) {<NEW_LINE>String format = null;<NEW_LINE>for (ComponentArtifactMetadata artifact : artifacts) {<NEW_LINE>String candidateFormat = artifact.getName().getType();<NEW_LINE>if (format == null) {<NEW_LINE>format = candidateFormat;<NEW_LINE>} else if (!format.equals(candidateFormat)) {<NEW_LINE>format = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (format != null) {<NEW_LINE>attributes = attributesFactory.concat(attributes.asImmutable(), ARTIFACT_TYPE_ATTRIBUTE, format);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return attributes;<NEW_LINE>} | attributes = applyForExtension(attributes, extension); |
109,239 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 1, registry_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 2, volume_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>output.writeBool(3, readOnly_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 4, user_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 5, group_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.<MASK><NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>} | writeString(output, 6, tenant_); |
1,450,783 | public void open() throws IOException {<NEW_LINE>boolean opened = false;<NEW_LINE>try {<NEW_LINE>for (int i = 0; i < mDevice.getInterfaceCount(); i++) {<NEW_LINE>UsbInterface usbIface = mDevice.getInterface(i);<NEW_LINE>if (mConnection.claimInterface(usbIface, true)) {<NEW_LINE>Log.d(TAG, "claimInterface " + i + " SUCCESS");<NEW_LINE>} else {<NEW_LINE>Log.d(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>UsbInterface dataIface = mDevice.getInterface(mDevice.getInterfaceCount() - 1);<NEW_LINE>for (int i = 0; i < dataIface.getEndpointCount(); i++) {<NEW_LINE>UsbEndpoint ep = dataIface.getEndpoint(i);<NEW_LINE>if (ep.getType() == UsbConstants.USB_ENDPOINT_XFER_BULK) {<NEW_LINE>if (ep.getDirection() == UsbConstants.USB_DIR_IN) {<NEW_LINE>mReadEndpoint = ep;<NEW_LINE>} else {<NEW_LINE>mWriteEndpoint = ep;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setConfigSingle(SILABSER_IFC_ENABLE_REQUEST_CODE, UART_ENABLE);<NEW_LINE>setConfigSingle(SILABSER_SET_MHS_REQUEST_CODE, MCR_ALL | CONTROL_WRITE_DTR | CONTROL_WRITE_RTS);<NEW_LINE>setConfigSingle(SILABSER_SET_BAUDDIV_REQUEST_CODE, BAUD_RATE_GEN_FREQ / DEFAULT_BAUD_RATE);<NEW_LINE>// setParameters(DEFAULT_BAUD_RATE, DEFAULT_DATA_BITS, DEFAULT_STOP_BITS, DEFAULT_PARITY);<NEW_LINE>opened = true;<NEW_LINE>} finally {<NEW_LINE>if (!opened) {<NEW_LINE>close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | TAG, "claimInterface " + i + " FAIL"); |
649,228 | public void aggregate(int length, AggregationResultHolder aggregationResultHolder, Map<ExpressionContext, BlockValSet> blockValSetMap) {<NEW_LINE>BlockValSet blockValSet = blockValSetMap.get(_expression);<NEW_LINE>BlockValSet <MASK><NEW_LINE>if (blockValSet.getValueType() != DataType.BYTES) {<NEW_LINE>aggregateResultWithRawData(length, aggregationResultHolder, blockValSet, blockTimeSet);<NEW_LINE>} else {<NEW_LINE>ValueLongPair<V> defaultValueLongPair = getDefaultValueTimePair();<NEW_LINE>V lastData = defaultValueLongPair.getValue();<NEW_LINE>long lastTime = defaultValueLongPair.getTime();<NEW_LINE>// Serialized LastPair<NEW_LINE>byte[][] bytesValues = blockValSet.getBytesValuesSV();<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>ValueLongPair<V> lastWithTimePair = _objectSerDe.deserialize(bytesValues[i]);<NEW_LINE>V data = lastWithTimePair.getValue();<NEW_LINE>long time = lastWithTimePair.getTime();<NEW_LINE>if (time >= lastTime) {<NEW_LINE>lastTime = time;<NEW_LINE>lastData = data;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setAggregationResult(aggregationResultHolder, lastData, lastTime);<NEW_LINE>}<NEW_LINE>} | blockTimeSet = blockValSetMap.get(_timeCol); |
4,076 | public static List<Object> createInputParams(ExpressionFactoryManager expressionFactoryManager, StateInstanceImpl stateInstance, AbstractTaskState serviceTaskState, Object variablesFrom) {<NEW_LINE>List<Object> inputAssignments = serviceTaskState.getInput();<NEW_LINE>if (CollectionUtils.isEmpty(inputAssignments)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>List<Object> inputExpressions = serviceTaskState.getInputExpressions();<NEW_LINE>if (inputExpressions == null) {<NEW_LINE>synchronized (serviceTaskState) {<NEW_LINE>inputExpressions = serviceTaskState.getInputExpressions();<NEW_LINE>if (inputExpressions == null) {<NEW_LINE>inputExpressions = new ArrayList<>(inputAssignments.size());<NEW_LINE>for (Object inputAssignment : inputAssignments) {<NEW_LINE>inputExpressions.add(createValueExpression(expressionFactoryManager, inputAssignment));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>serviceTaskState.setInputExpressions(inputExpressions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Object> inputValues = new ArrayList<>(inputExpressions.size());<NEW_LINE>for (Object valueExpression : inputExpressions) {<NEW_LINE>Object value = getValue(valueExpression, variablesFrom, stateInstance);<NEW_LINE>inputValues.add(value);<NEW_LINE>}<NEW_LINE>return inputValues;<NEW_LINE>} | return new ArrayList<>(0); |
501,655 | public GetLabelsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetLabelsResult getLabelsResult = new GetLabelsResult();<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 getLabelsResult;<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("labels", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getLabelsResult.setLabels(new ListUnmarshaller<Label>(LabelJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getLabelsResult.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 getLabelsResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
545,613 | public ClickHouseResponse deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {<NEW_LINE>ClickHouseResponse result = new ClickHouseResponse();<NEW_LINE>JsonObject jsonObject = json.getAsJsonObject();<NEW_LINE>JsonArray metaNode = jsonObject.getAsJsonArray("meta");<NEW_LINE>if (metaNode != null) {<NEW_LINE>List<ClickHouseResponse.Meta> meta = new ArrayList<>();<NEW_LINE>metaNode.forEach(e -> meta.add(parseMeta(e)));<NEW_LINE>result.setMeta(meta);<NEW_LINE>}<NEW_LINE>JsonArray dataNode = jsonObject.getAsJsonArray("data");<NEW_LINE>if (dataNode != null) {<NEW_LINE>List<List<String>> data = new ArrayList<>();<NEW_LINE>dataNode.forEach(row -> {<NEW_LINE>List<String> rowList = getAsStringArray(row);<NEW_LINE>data.add(rowList);<NEW_LINE>});<NEW_LINE>result.setData(data);<NEW_LINE>}<NEW_LINE>JsonArray totalsNode = jsonObject.getAsJsonArray("totals");<NEW_LINE>if (totalsNode != null) {<NEW_LINE>List<String> totals = getAsStringArray(totalsNode);<NEW_LINE>result.setTotals(totals);<NEW_LINE>}<NEW_LINE>JsonObject extremesNode = jsonObject.getAsJsonObject("extremes");<NEW_LINE>if (extremesNode != null) {<NEW_LINE>ClickHouseResponse.Extremes extremes = new ClickHouseResponse.Extremes();<NEW_LINE>extremes.setMax(getAsStringArray(extremesNode.get("max")));<NEW_LINE>extremes.setMin(getAsStringArray(<MASK><NEW_LINE>result.setExtremes(extremes);<NEW_LINE>}<NEW_LINE>JsonElement rowsNode = jsonObject.get("rows");<NEW_LINE>if (rowsNode != null) {<NEW_LINE>result.setRows(rowsNode.getAsInt());<NEW_LINE>}<NEW_LINE>JsonElement rows_before_limit_at_leastNode = jsonObject.get("rows_before_limit_at_least");<NEW_LINE>if (rows_before_limit_at_leastNode != null) {<NEW_LINE>result.setRows_before_limit_at_least(rows_before_limit_at_leastNode.getAsInt());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | extremesNode.get("min"))); |
70,995 | protected AbstractValidator loadValidatorWithoutAttributes(Element element, String messagePack) {<NEW_LINE>AbstractValidator validator;<NEW_LINE>switch(element.getName()) {<NEW_LINE>case "negativeOrZero":<NEW_LINE>validator = <MASK><NEW_LINE>break;<NEW_LINE>case "negative":<NEW_LINE>validator = beanLocator.getPrototype(NegativeValidator.NAME);<NEW_LINE>break;<NEW_LINE>case "notBlank":<NEW_LINE>validator = beanLocator.getPrototype(NotBlankValidator.NAME);<NEW_LINE>break;<NEW_LINE>case "notEmpty":<NEW_LINE>validator = beanLocator.getPrototype(NotEmptyValidator.NAME);<NEW_LINE>break;<NEW_LINE>case "notNull":<NEW_LINE>validator = beanLocator.getPrototype(NotNullValidator.NAME);<NEW_LINE>break;<NEW_LINE>case "positiveOrZero":<NEW_LINE>validator = beanLocator.getPrototype(PositiveOrZeroValidator.NAME);<NEW_LINE>break;<NEW_LINE>case "positive":<NEW_LINE>validator = beanLocator.getPrototype(PositiveValidator.NAME);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown validator element: " + element.getName());<NEW_LINE>}<NEW_LINE>validator.setMessage(loadMessage(element, messagePack));<NEW_LINE>return validator;<NEW_LINE>} | beanLocator.getPrototype(NegativeOrZeroValidator.NAME); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.