idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,668,446
public Rectangle rect(double minX, double maxX, double minY, double maxY) {<NEW_LINE>Rectangle bounds = ctx.getWorldBounds();<NEW_LINE>// Y<NEW_LINE>if (// NaN will pass<NEW_LINE>minY < bounds.getMinY() || maxY > bounds.getMaxY())<NEW_LINE>throw new InvalidShapeException("Y values [" + minY + " to " + maxY + "] not in boundary " + bounds);<NEW_LINE>if (minY > maxY)<NEW_LINE>throw new InvalidShapeException(<MASK><NEW_LINE>// X<NEW_LINE>if (ctx.isGeo()) {<NEW_LINE>verifyX(minX);<NEW_LINE>verifyX(maxX);<NEW_LINE>// TODO consider removing this logic so that there is no normalization here<NEW_LINE>// if (minX != maxX) { USUALLY TRUE, inline check below<NEW_LINE>// If an edge coincides with the dateline then don't make this rect cross it<NEW_LINE>if (minX == 180 && minX != maxX) {<NEW_LINE>minX = -180;<NEW_LINE>} else if (maxX == -180 && minX != maxX) {<NEW_LINE>maxX = 180;<NEW_LINE>}<NEW_LINE>// }<NEW_LINE>} else {<NEW_LINE>if (// NaN will pass<NEW_LINE>minX < bounds.getMinX() || maxX > bounds.getMaxX())<NEW_LINE>throw new InvalidShapeException("X values [" + minX + " to " + maxX + "] not in boundary " + bounds);<NEW_LINE>if (minX > maxX)<NEW_LINE>throw new InvalidShapeException("maxX must be >= minX: " + minX + " to " + maxX);<NEW_LINE>}<NEW_LINE>return new RectangleImpl(minX, maxX, minY, maxY, ctx);<NEW_LINE>}
"maxY must be >= minY: " + minY + " to " + maxY);
870,907
public void testRxFlowableInvoker_postReceiveTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>long timeout = messageTimeout;<NEW_LINE>if (isZOS()) {<NEW_LINE>timeout = zTimeout;<NEW_LINE>}<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>// cb.property("com.ibm.ws.jaxrs.client.receive.timeout", TIMEOUT);<NEW_LINE>cb.readTimeout(TIMEOUT, TimeUnit.MILLISECONDS);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(RxFlowableInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/post/" + SLEEP);<NEW_LINE>Builder builder = t.request();<NEW_LINE>Flowable<Response> flowable = builder.rx(RxFlowableInvoker.class).post(Entity.xml(Long.toString(SLEEP)));<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>final Holder<Response> holder = new Holder<Response>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>flowable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>}, throwable -> {<NEW_LINE>if (throwable.getMessage().contains("SocketTimeoutException")) {<NEW_LINE>// OnError<NEW_LINE>ret.append("Timeout as expected");<NEW_LINE>} else {<NEW_LINE>ret.append("throwable");<NEW_LINE>throwable.printStackTrace();<NEW_LINE>}<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, // OnCompleted<NEW_LINE>() -> ret.append("OnCompleted"));<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(timeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testRxFlowableInvoker_postReceiveTimeout: Response took too long. Waited " + timeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>long elapsed = System.currentTimeMillis() - startTime;<NEW_LINE>System.out.println(<MASK><NEW_LINE>c.close();<NEW_LINE>}
"testRxFlowableInvoker_postReceiveTimeout with TIMEOUT " + TIMEOUT + " OnError elapsed time " + elapsed);
257,458
public synchronized boolean start() {<NEW_LINE>if (State.IDLE != this.state) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (0 < getMaximumBackupFiles()) {<NEW_LINE>this.myFormat = new SimpleDateFormat("_yy.MM.dd_HH.mm.ss", Locale.US);<NEW_LINE>this.backups <MASK><NEW_LINE>// backups would convert access.log to access_date.log, but would<NEW_LINE>// convert http_access to just http_access_date<NEW_LINE>int index = getFileName().lastIndexOf('.');<NEW_LINE>if (-1 != index) {<NEW_LINE>index += (this.myFullName.length() - this.myName.length());<NEW_LINE>this.fileinfo = this.myFullName.substring(0, index);<NEW_LINE>this.extensioninfo = this.myFullName.substring(index);<NEW_LINE>} else {<NEW_LINE>this.fileinfo = this.myFullName;<NEW_LINE>this.extensioninfo = "";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.state = State.RUNNING;<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, getFileName() + ": started\n" + this);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
= new LinkedList<File>();
302,504
public Policy createPolicyFromJsonString(String jsonString) {<NEW_LINE>if (jsonString == null) {<NEW_LINE>throw new IllegalArgumentException("JSON string cannot be null");<NEW_LINE>}<NEW_LINE>JsonNode policyNode;<NEW_LINE>JsonNode idNode;<NEW_LINE>JsonNode statementsNode;<NEW_LINE>Policy policy = new Policy();<NEW_LINE>List<Statement> statements = new LinkedList<Statement>();<NEW_LINE>try {<NEW_LINE>policyNode = Jackson.jsonNodeOf(jsonString);<NEW_LINE>idNode = policyNode.get(JsonDocumentFields.POLICY_ID);<NEW_LINE>if (isNotNull(idNode)) {<NEW_LINE>policy.setId(idNode.asText());<NEW_LINE>}<NEW_LINE>statementsNode = policyNode.get(JsonDocumentFields.STATEMENT);<NEW_LINE>if (isNotNull(statementsNode)) {<NEW_LINE>if (statementsNode.isObject()) {<NEW_LINE>statements<MASK><NEW_LINE>} else if (statementsNode.isArray()) {<NEW_LINE>for (JsonNode statementNode : statementsNode) {<NEW_LINE>statements.add(statementOf(statementNode));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>String message = "Unable to generate policy object fron JSON string " + e.getMessage();<NEW_LINE>throw new IllegalArgumentException(message, e);<NEW_LINE>}<NEW_LINE>policy.setStatements(statements);<NEW_LINE>return policy;<NEW_LINE>}
.add(statementOf(statementsNode));
1,377,379
public void testXA012(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>final TransactionManager tm = TransactionManagerFactory.getTransactionManager();<NEW_LINE>tm.begin();<NEW_LINE>final Transaction tx = tm.getTransaction();<NEW_LINE>tx.enlistResource(new XAResourceImpl()<MASK><NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>tx.enlistResource(new XAResourceImpl().setPrepareAction(XAResource.XA_RDONLY));<NEW_LINE>tx.enlistResource(new XAResourceImpl().setRollbackAction(XAException.XA_HEURHAZ));<NEW_LINE>tx.enlistResource(new XAResourceImpl().setPrepareAction(XAResource.XA_RDONLY));<NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>tx.enlistResource(new XAResourceImpl().setPrepareAction(XAResource.XA_RDONLY));<NEW_LINE>tx.enlistResource(new XAResourceImpl());<NEW_LINE>try {<NEW_LINE>tm.commit();<NEW_LINE>throw new Exception();<NEW_LINE>} catch (HeuristicMixedException e) {<NEW_LINE>// As expected<NEW_LINE>}<NEW_LINE>}
.setPrepareAction(XAException.XA_RBROLLBACK));
1,350,273
// GEN-LAST:event_tfComponentListURLActionPerformed<NEW_LINE>private void miProxy1ActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_miProxy1ActionPerformed<NEW_LINE>ProxyPanel prp = new ProxyPanel(System.getProperty("http.proxyHost"), System.getProperty("http.proxyPort"));<NEW_LINE>final JOptionPane optionPane = new JOptionPane(prp, JOptionPane.PLAIN_MESSAGE, JOptionPane.YES_NO_OPTION, null, new String[] { "OK", "Cancel" }, "OK");<NEW_LINE>final JDialog dialog = new JDialog((Frame) null, "", true);<NEW_LINE>dialog.setContentPane(optionPane);<NEW_LINE>optionPane.addPropertyChangeListener(new PropertyChangeListener() {<NEW_LINE><NEW_LINE>public void propertyChange(PropertyChangeEvent e) {<NEW_LINE><MASK><NEW_LINE>if (dialog.isVisible() && (e.getSource() == optionPane) && (prop.equals(JOptionPane.VALUE_PROPERTY))) {<NEW_LINE>dialog.setVisible(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dialog.pack();<NEW_LINE>dialog.setVisible(true);<NEW_LINE>if ("OK".equals(optionPane.getValue())) {<NEW_LINE>System.setProperty("http.proxyHost", prp.getProxyHost());<NEW_LINE>System.setProperty("http.proxyPort", prp.getProxyPort());<NEW_LINE>}<NEW_LINE>}
String prop = e.getPropertyName();
196,673
protected RestChannelConsumer innerPrepareRequest(RestRequest request, NodeClient client) throws IOException {<NEW_LINE>try (XContentParser parser = request.contentParser()) {<NEW_LINE>final SamlInitiateSingleSignOnRequest initRequest = PARSER.parse(parser, null);<NEW_LINE>return channel -> client.execute(SamlInitiateSingleSignOnAction.INSTANCE, initRequest, new RestBuilderListener<SamlInitiateSingleSignOnResponse>(channel) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public RestResponse buildResponse(SamlInitiateSingleSignOnResponse response, XContentBuilder builder) throws Exception {<NEW_LINE>builder.startObject();<NEW_LINE>builder.field("post_url", response.getPostUrl());<NEW_LINE>builder.field("saml_response", response.getSamlResponse());<NEW_LINE>builder.field("saml_status", response.getSamlStatus());<NEW_LINE>builder.field(<MASK><NEW_LINE>builder.startObject("service_provider");<NEW_LINE>builder.field("entity_id", response.getEntityId());<NEW_LINE>builder.endObject();<NEW_LINE>builder.endObject();<NEW_LINE>return new BytesRestResponse(RestStatus.OK, builder);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
"error", response.getError());
1,551,915
void finish(final String tag) {<NEW_LINE>if (mRequestQueue != null) {<NEW_LINE>mRequestQueue.finish(this);<NEW_LINE>}<NEW_LINE>if (MarkerLog.ENABLED) {<NEW_LINE>final long threadId = Thread.currentThread().getId();<NEW_LINE>if (Looper.myLooper() != Looper.getMainLooper()) {<NEW_LINE>// If we finish marking off of the main thread, we need to<NEW_LINE>// actually do it on the main thread to ensure correct ordering.<NEW_LINE>Handler mainThread = new <MASK><NEW_LINE>mainThread.post(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>mEventLog.add(tag, threadId);<NEW_LINE>mEventLog.finish(Request.this.toString());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mEventLog.add(tag, threadId);<NEW_LINE>mEventLog.finish(this.toString());<NEW_LINE>}<NEW_LINE>}
Handler(Looper.getMainLooper());
1,519,875
private static <T, F extends Format<T>> F makeByOptOverview(Map<OptionID, List<Pair<Parameter<?>, Class<?>>>> byopt, F format) {<NEW_LINE>format.init("ELKI command line parameter overview by option");<NEW_LINE>for (OptionID oid : sorted(byopt.keySet(), SORT_BY_OPTIONID)) {<NEW_LINE>Parameter<?> firstopt = byopt.get(oid).get(0).getFirst();<NEW_LINE>T optdl = format.writeOptionD(format.topDList(), firstopt);<NEW_LINE>// class restriction?<NEW_LINE>Class<?> superclass = getRestrictionClass(oid, firstopt, byopt);<NEW_LINE>format.appendClassRestriction(optdl, superclass);<NEW_LINE>// default value<NEW_LINE><MASK><NEW_LINE>// known values?<NEW_LINE>format.appendKnownImplementationsIfNonempty(optdl, superclass);<NEW_LINE>// nested definition list for options<NEW_LINE>T classesul = format.makeUList(optdl, HEADER_PARAMETER_FOR);<NEW_LINE>for (Pair<Parameter<?>, Class<?>> clinst : sorted(byopt.get(oid), SORT_BY_OPTIONID_PRIORITY)) {<NEW_LINE>T classli = format.writeClassU(classesul, clinst.getSecond());<NEW_LINE>Class<?> ocls = getRestrictionClass(clinst.getFirst());<NEW_LINE>// TODO: re-add back reporting of *removed* class restrictions.<NEW_LINE>if (ocls != null && !ocls.equals(superclass)) {<NEW_LINE>format.appendClassRestriction(classli, ocls);<NEW_LINE>}<NEW_LINE>Parameter<?> param = clinst.getFirst();<NEW_LINE>// FIXME: re-add back if a subtype removes the default value<NEW_LINE>if (param.getDefaultValue() != null && !param.getDefaultValue().equals(firstopt.getDefaultValue())) {<NEW_LINE>format.appendDefaultValueIfSet(classli, param);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return format;<NEW_LINE>}
format.appendDefaultValueIfSet(optdl, firstopt);
1,262,946
public static DescribeCouponListResponse unmarshall(DescribeCouponListResponse describeCouponListResponse, UnmarshallerContext context) {<NEW_LINE>describeCouponListResponse.setRequestId(context.stringValue("DescribeCouponListResponse.RequestId"));<NEW_LINE>List<Coupon> coupons <MASK><NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeCouponListResponse.Coupons.Length"); i++) {<NEW_LINE>Coupon coupon = new Coupon();<NEW_LINE>coupon.setCouponTemplateId(context.longValue("DescribeCouponListResponse.Coupons[" + i + "].CouponTemplateId"));<NEW_LINE>coupon.setTotalAmount(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].TotalAmount"));<NEW_LINE>coupon.setBalanceAmount(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].BalanceAmount"));<NEW_LINE>coupon.setFrozenAmount(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].FrozenAmount"));<NEW_LINE>coupon.setExpiredAmount(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].ExpiredAmount"));<NEW_LINE>coupon.setDeliveryTime(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].DeliveryTime"));<NEW_LINE>coupon.setExpiredTime(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].ExpiredTime"));<NEW_LINE>coupon.setCouponNumber(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].CouponNumber"));<NEW_LINE>coupon.setStatus(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].Status"));<NEW_LINE>coupon.setDescription(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].Description"));<NEW_LINE>coupon.setCreationTime(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].CreationTime"));<NEW_LINE>coupon.setModificationTime(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].ModificationTime"));<NEW_LINE>coupon.setPriceLimit(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].PriceLimit"));<NEW_LINE>coupon.setApplication(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].Application"));<NEW_LINE>List<String> productCodes = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeCouponListResponse.Coupons[" + i + "].ProductCodes.Length"); j++) {<NEW_LINE>productCodes.add(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].ProductCodes[" + j + "]"));<NEW_LINE>}<NEW_LINE>coupon.setProductCodes(productCodes);<NEW_LINE>List<String> tradeTypes = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeCouponListResponse.Coupons[" + i + "].TradeTypes.Length"); j++) {<NEW_LINE>tradeTypes.add(context.stringValue("DescribeCouponListResponse.Coupons[" + i + "].TradeTypes[" + j + "]"));<NEW_LINE>}<NEW_LINE>coupon.setTradeTypes(tradeTypes);<NEW_LINE>coupons.add(coupon);<NEW_LINE>}<NEW_LINE>describeCouponListResponse.setCoupons(coupons);<NEW_LINE>return describeCouponListResponse;<NEW_LINE>}
= new ArrayList<Coupon>();
1,467,183
public Object postProcessAfterInitialization(Object bean, String beanName) {<NEW_LINE>if (MONGO_DB_FACTORY_AVAILABLE && bean instanceof MongoDbFactory) {<NEW_LINE>final MongoDbFactory mongoDbFactory = (MongoDbFactory) bean;<NEW_LINE>final InvocationHandler invocationHandler = new InvocationHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {<NEW_LINE>Object result = method.invoke(mongoDbFactory, args);<NEW_LINE>if (result instanceof MongoDatabase) {<NEW_LINE>result = MongoWrapper.createDatabaseProxy((MongoDatabase) result);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final MongoDbFactory factory = JdbcWrapper.createProxy(mongoDbFactory, invocationHandler);<NEW_LINE>LOG.debug("mongodb monitoring initialized");<NEW_LINE>return factory;<NEW_LINE>} else if (MONGO_DATABASE_FACTORY_AVAILABLE && bean instanceof MongoDatabaseFactory) {<NEW_LINE>final MongoDatabaseFactory mongoDatabaseFactory = (MongoDatabaseFactory) bean;<NEW_LINE>final InvocationHandler invocationHandler = new InvocationHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {<NEW_LINE>Object result = method.invoke(mongoDatabaseFactory, args);<NEW_LINE>if (result instanceof MongoDatabase) {<NEW_LINE>result = MongoWrapper<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final MongoDatabaseFactory factory = JdbcWrapper.createProxy(mongoDatabaseFactory, invocationHandler);<NEW_LINE>LOG.debug("mongodb monitoring initialized");<NEW_LINE>return factory;<NEW_LINE>}<NEW_LINE>return bean;<NEW_LINE>}
.createDatabaseProxy((MongoDatabase) result);
399,884
final SearchSystemInstancesResult executeSearchSystemInstances(SearchSystemInstancesRequest searchSystemInstancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(searchSystemInstancesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SearchSystemInstancesRequest> request = null;<NEW_LINE>Response<SearchSystemInstancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SearchSystemInstancesRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoTThingsGraph");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SearchSystemInstances");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SearchSystemInstancesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SearchSystemInstancesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(searchSystemInstancesRequest));
1,600,766
final UpdateNetworkResourceMetadataResult executeUpdateNetworkResourceMetadata(UpdateNetworkResourceMetadataRequest updateNetworkResourceMetadataRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateNetworkResourceMetadataRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateNetworkResourceMetadataRequest> request = null;<NEW_LINE>Response<UpdateNetworkResourceMetadataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateNetworkResourceMetadataRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateNetworkResourceMetadataRequest));<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, "NetworkManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateNetworkResourceMetadata");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateNetworkResourceMetadataResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateNetworkResourceMetadataResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,465,261
public PiecewisePolynomialResult interpolate(final double[] xValues, final double[][] yValuesMatrix) {<NEW_LINE>ArgChecker.notNull(xValues, "xValues");<NEW_LINE>ArgChecker.notNull(yValuesMatrix, "yValuesMatrix");<NEW_LINE>ArgChecker.isTrue(xValues.length == yValuesMatrix[0].length, "(xValues length = yValuesMatrix's row vector length)");<NEW_LINE>ArgChecker.isTrue(xValues.length > 1, "Data points should be more than 1");<NEW_LINE>final int nDataPts = xValues.length;<NEW_LINE>final int dim = yValuesMatrix.length;<NEW_LINE>for (int i = 0; i < nDataPts; ++i) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(xValues[i]), "xValues containing NaN");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(xValues[i]), "xValues containing Infinity");<NEW_LINE>for (int j = 0; j < dim; ++j) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(yValuesMatrix[j<MASK><NEW_LINE>ArgChecker.isFalse(Double.isInfinite(yValuesMatrix[j][i]), "yValuesMatrix containing Infinity");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double[] xValuesSrt = Arrays.copyOf(xValues, nDataPts);<NEW_LINE>int[] sortedPositions = IntStream.range(0, nDataPts).toArray();<NEW_LINE>DoubleArrayMath.sortPairs(xValuesSrt, sortedPositions);<NEW_LINE>ArgChecker.noDuplicatesSorted(xValuesSrt, "xValues");<NEW_LINE>DoubleMatrix[] coefMatrix = new DoubleMatrix[dim];<NEW_LINE>for (int i = 0; i < dim; ++i) {<NEW_LINE>double[] yValuesSrt = DoubleArrayMath.reorderedCopy(yValuesMatrix[i], sortedPositions);<NEW_LINE>coefMatrix[i] = solve(xValuesSrt, yValuesSrt);<NEW_LINE>}<NEW_LINE>final int nIntervals = coefMatrix[0].rowCount();<NEW_LINE>final int nCoefs = coefMatrix[0].columnCount();<NEW_LINE>double[][] resMatrix = new double[dim * nIntervals][nCoefs];<NEW_LINE>for (int i = 0; i < nIntervals; ++i) {<NEW_LINE>for (int j = 0; j < dim; ++j) {<NEW_LINE>resMatrix[dim * i + j] = coefMatrix[j].row(i).toArray();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < (nIntervals * dim); ++i) {<NEW_LINE>for (int j = 0; j < nCoefs; ++j) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(resMatrix[i][j]), "Too large input");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(resMatrix[i][j]), "Too large input");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new PiecewisePolynomialResult(DoubleArray.copyOf(xValuesSrt), DoubleMatrix.copyOf(resMatrix), nCoefs, dim);<NEW_LINE>}
][i]), "yValuesMatrix containing NaN");
183,344
public void onHostPause() {<NEW_LINE>// Need to create a copy here because it is possible for other code to modify playerPool<NEW_LINE>// at the same time which will lead to a ConcurrentModificationException being thrown<NEW_LINE>Map<Integer, MediaPlayer> playerPoolCopy = new HashMap<>(this.playerPool);<NEW_LINE>for (Map.Entry<Integer, MediaPlayer> entry : playerPoolCopy.entrySet()) {<NEW_LINE>Integer playerId = entry.getKey();<NEW_LINE>if (!this.playerContinueInBackground.get(playerId)) {<NEW_LINE>MediaPlayer player = entry.getValue();<NEW_LINE>if (player == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>player.pause();<NEW_LINE>WritableMap info = getInfo(player);<NEW_LINE>WritableMap data = new WritableNativeMap();<NEW_LINE>data.putString("message", "Playback paused due to onHostPause");<NEW_LINE><MASK><NEW_LINE>emitEvent(playerId, "pause", data);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(LOG_TAG, e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
data.putMap("info", info);
304,171
private boolean checkCSeq(SipServletRequestImpl request, boolean isAck, boolean isCancel) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>Object[] params = { _tuWrapper.getAppName(), _tuWrapper.getId(), isAck, isCancel };<NEW_LINE>c_logger.traceEntry(this, "checkCSeq", params);<NEW_LINE>}<NEW_LINE>boolean isOk = false;<NEW_LINE>if (isCancel) {<NEW_LINE>isOk = checkCSeqACK_Cancel(request);<NEW_LINE>} else if (isAck) {<NEW_LINE>isOk = true;<NEW_LINE>} else {<NEW_LINE>long receivedRemoteCseq = request.getRequest().getCSeqHeader().getSequenceNumber();<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>StringBuffer b = new StringBuffer();<NEW_LINE>b.append(" Expected remote CSeq: ");<NEW_LINE>b.append(m_remoteCseq);<NEW_LINE>b.append(" Received CSeq: ");<NEW_LINE>b.append(receivedRemoteCseq);<NEW_LINE>c_logger.traceDebug(this, "checkCSeq", b.toString());<NEW_LINE>}<NEW_LINE>if (receivedRemoteCseq > m_remoteCseq) {<NEW_LINE>m_remoteCseq = receivedRemoteCseq;<NEW_LINE>// We decide not to replicate here, to improve performances. The remoteCSeq is used for<NEW_LINE>// validity confirmation, if the server drops, the worst that can happen<NEW_LINE>// is that all client messages will regarded as valid. Its a tradeoff.<NEW_LINE>// replicate();<NEW_LINE>isOk = true;<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isOk) {<NEW_LINE>int responseCode;<NEW_LINE>String reasonPhrase;<NEW_LINE>if (isCancel) {<NEW_LINE>responseCode = SipServletResponse.SC_CALL_LEG_DONE;<NEW_LINE>reasonPhrase = null;<NEW_LINE>} else {<NEW_LINE>responseCode = SipServletResponse.SC_SERVER_INTERNAL_ERROR;<NEW_LINE>reasonPhrase = INCORRECT_CSEQ_REASON;<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "checkCSeq", "lower CSeq received. return error [" + responseCode + "] latest cseq [" + m_remoteCseq + ']');<NEW_LINE>}<NEW_LINE>sendResponse(request, responseCode, reasonPhrase);<NEW_LINE>}<NEW_LINE>return isOk;<NEW_LINE>}
this, "checkCSeq", " Is OK: " + isOk);
1,127,874
private AuthenticationResult processPasswordMessage(final ChannelHandlerContext context, final PostgreSQLPacketPayload payload) {<NEW_LINE>char messageType = (char) payload.readInt1();<NEW_LINE>if (PostgreSQLMessagePacketType.PASSWORD_MESSAGE.getValue() != messageType) {<NEW_LINE>throw new PostgreSQLProtocolViolationException("password", Character.toString(messageType));<NEW_LINE>}<NEW_LINE>PostgreSQLPasswordMessagePacket passwordMessagePacket = new PostgreSQLPasswordMessagePacket(payload);<NEW_LINE>PostgreSQLLoginResult loginResult = OpenGaussAuthenticationHandler.loginWithSCRAMSha256Password(currentAuthResult.getUsername(), currentAuthResult.getDatabase(), saltHexString, nonceHexString, serverIteration, passwordMessagePacket);<NEW_LINE>if (PostgreSQLErrorCode.SUCCESSFUL_COMPLETION != loginResult.getErrorCode()) {<NEW_LINE>throw new PostgreSQLAuthenticationException(loginResult.getErrorCode(<MASK><NEW_LINE>}<NEW_LINE>context.write(new PostgreSQLAuthenticationOKPacket());<NEW_LINE>context.write(new PostgreSQLParameterStatusPacket("server_version", PostgreSQLServerInfo.getServerVersion()));<NEW_LINE>context.write(new PostgreSQLParameterStatusPacket("client_encoding", clientEncoding));<NEW_LINE>context.write(new PostgreSQLParameterStatusPacket("server_encoding", "UTF8"));<NEW_LINE>context.write(new PostgreSQLParameterStatusPacket("integer_datetimes", "on"));<NEW_LINE>context.writeAndFlush(PostgreSQLReadyForQueryPacket.NOT_IN_TRANSACTION);<NEW_LINE>return AuthenticationResultBuilder.finished(currentAuthResult.getUsername(), "", currentAuthResult.getDatabase());<NEW_LINE>}
), loginResult.getErrorMessage());
1,570,902
public Request<RemoveAttributesRequest> marshall(RemoveAttributesRequest removeAttributesRequest) {<NEW_LINE>if (removeAttributesRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(RemoveAttributesRequest)");<NEW_LINE>}<NEW_LINE>Request<RemoveAttributesRequest> request = new DefaultRequest<RemoveAttributesRequest>(removeAttributesRequest, "AmazonPinpoint");<NEW_LINE>request.setHttpMethod(HttpMethodName.PUT);<NEW_LINE>String uriResourcePath = "/v1/apps/{application-id}/attributes/{attribute-type}";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{application-id}", (removeAttributesRequest.getApplicationId() == null) ? "" : StringUtils.fromString(removeAttributesRequest.getApplicationId()));<NEW_LINE>uriResourcePath = uriResourcePath.replace("{attribute-type}", (removeAttributesRequest.getAttributeType() == null) ? "" : StringUtils.fromString(removeAttributesRequest.getAttributeType()));<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>if (removeAttributesRequest.getUpdateAttributesRequest() != null) {<NEW_LINE>UpdateAttributesRequest updateAttributesRequest = removeAttributesRequest.getUpdateAttributesRequest();<NEW_LINE>UpdateAttributesRequestJsonMarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
).marshall(updateAttributesRequest, jsonWriter);
780,343
public void run() {<NEW_LINE>log.log(Level.INFO, "BEGIN mBtConnectThread SocketType:" + mSocketType);<NEW_LINE>// Make a connection to the BluetoothSocket<NEW_LINE>try {<NEW_LINE>log.log(Level.FINE, "Connect BT socket");<NEW_LINE>// This is a blocking call and will only return on a<NEW_LINE>// successful connection or an exception<NEW_LINE>mmSocket.connect();<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.log(Level.FINE, e.getMessage());<NEW_LINE>cancel();<NEW_LINE>log.log(Level.INFO, "Fallback attempt to create RfComm socket");<NEW_LINE>BluetoothSocket sockFallback;<NEW_LINE>Class<?> clazz = mmSocket<MASK><NEW_LINE>Class<?>[] paramTypes = new Class<?>[] { Integer.TYPE };<NEW_LINE>try {<NEW_LINE>// noinspection JavaReflectionMemberAccess<NEW_LINE>Method m = clazz.getMethod("createRfcommSocket", paramTypes);<NEW_LINE>Object[] params = new Object[] { 1 };<NEW_LINE>sockFallback = (BluetoothSocket) m.invoke(mmSocket.getRemoteDevice(), params);<NEW_LINE>mmSocket = sockFallback;<NEW_LINE>logSocketUuids(mmSocket, "Fallback socket");<NEW_LINE>// connect fallback socket<NEW_LINE>mmSocket.connect();<NEW_LINE>} catch (Exception e2) {<NEW_LINE>log.log(Level.SEVERE, e2.getMessage());<NEW_LINE>connectionFailed();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Reset the BtConnectThread because we're done<NEW_LINE>synchronized (BtCommService.this) {<NEW_LINE>mBtConnectThread = null;<NEW_LINE>}<NEW_LINE>// Start the connected thread<NEW_LINE>connected(mmSocket, mmDevice, mSocketType);<NEW_LINE>}
.getRemoteDevice().getClass();
825,291
private static ImageResult fixGifFps(byte[] imageData, ImageRequest request) throws IOException {<NEW_LINE>GifDecoderFMS gif = new GifDecoderFMS();<NEW_LINE>gif.read(new ByteArrayInputStream(imageData));<NEW_LINE>ByteArrayOutputStream bos = new ByteArrayOutputStream();<NEW_LINE>Dimension actualBaseSize;<NEW_LINE>try (ImageOutputStream output = ImageIO.createImageOutputStream(bos)) {<NEW_LINE>// Determine sizes<NEW_LINE>BufferedImage firstImage = gif.getFrame(0);<NEW_LINE>actualBaseSize = request.getSizeFromImage(firstImage);<NEW_LINE>Dimension scaledSize = request.getScaledSizeIfNecessary(actualBaseSize);<NEW_LINE>// Write frames<NEW_LINE>GifSequenceWriter w = GifSequenceWriter.create(output, firstImage);<NEW_LINE>for (int i = 0; i < gif.getFrameCount(); i++) {<NEW_LINE>BufferedImage <MASK><NEW_LINE>if (scaledSize != null) {<NEW_LINE>frame = resize(frame, scaledSize.width, scaledSize.height);<NEW_LINE>}<NEW_LINE>w.writeToSequence(frame, gif.getDelay(i));<NEW_LINE>}<NEW_LINE>w.close();<NEW_LINE>}<NEW_LINE>ImageIcon icon = new ImageIcon(bos.toByteArray());<NEW_LINE>icon.setDescription("GIF");<NEW_LINE>return new ImageResult(icon, actualBaseSize, true);<NEW_LINE>}
frame = gif.getFrame(i);
1,115,361
public void marshall(CreateFaqRequest createFaqRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createFaqRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createFaqRequest.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createFaqRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createFaqRequest.getS3Path(), S3PATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(createFaqRequest.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createFaqRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createFaqRequest.getFileFormat(), FILEFORMAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(createFaqRequest.getClientToken(), CLIENTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createFaqRequest.getLanguageCode(), LANGUAGECODE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createFaqRequest.getIndexId(), INDEXID_BINDING);
623,951
private static boolean dontUseHostName(String nonProxyHosts, String host) {<NEW_LINE>if (host == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean dontUseProxy = false;<NEW_LINE>StringTokenizer st = new StringTokenizer(nonProxyHosts, "|", false);<NEW_LINE>while (st.hasMoreTokens() && !dontUseProxy) {<NEW_LINE>String token = st.nextToken().trim();<NEW_LINE>int star = token.indexOf("*");<NEW_LINE>if (star == -1) {<NEW_LINE>dontUseProxy = token.equals(host);<NEW_LINE>if (dontUseProxy) {<NEW_LINE>LOG.log(Level.FINEST, "NbProxySelector[Type: {0}]. Host {1} found in nonProxyHosts: {2}", new Object[] { ProxySettings.getProxyType(), host, nonProxyHosts });<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String start = token.substring(0, star - 1 < 0 ? 0 : star - 1);<NEW_LINE>String end = token.substring(star + 1 > token.length() ? token.length() : star + 1);<NEW_LINE>// Compare left of * if and only if * is not first character in token<NEW_LINE>// not first character<NEW_LINE>boolean compareStart = star > 0;<NEW_LINE>// Compare right of * if and only if * is not the last character in token<NEW_LINE>// not last character<NEW_LINE>boolean compareEnd = star < (token.length() - 1);<NEW_LINE>dontUseProxy = (compareStart && host.startsWith(start)) || (compareEnd && host.endsWith(end));<NEW_LINE>if (dontUseProxy) {<NEW_LINE>LOG.log(Level.FINEST, "NbProxySelector[Type: {0}]. Host {1} found in nonProxyHosts: {2}", new Object[] { ProxySettings.getProxyType<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dontUseProxy;<NEW_LINE>}
(), host, nonProxyHosts });
1,034,233
static // power of a number x<NEW_LINE>void power(int x, int n) {<NEW_LINE>// printing value "1" for power = 0<NEW_LINE>if (n == 0) {<NEW_LINE>System.out.print("1");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int[] res = new int[MAX];<NEW_LINE>int res_size = 0;<NEW_LINE>int temp = x;<NEW_LINE>// Initialize result<NEW_LINE>while (temp != 0) {<NEW_LINE>res<MASK><NEW_LINE>temp = temp / 10;<NEW_LINE>}<NEW_LINE>// Multiply x n times<NEW_LINE>// (x^n = x*x*x....n times)<NEW_LINE>for (int i = 2; i <= n; i++) res_size = multiply(x, res, res_size);<NEW_LINE>System.out.print(x + "^" + n + " = ");<NEW_LINE>for (int i = res_size - 1; i >= 0; i--) System.out.print(res[i]);<NEW_LINE>}
[res_size++] = temp % 10;
1,262,310
public void prepare() throws IOException {<NEW_LINE>int1RuntimeSchema = RuntimeSchema.createFrom(Int1.class);<NEW_LINE>int10RuntimeSchema = RuntimeSchema.createFrom(Int10.class);<NEW_LINE>sparseInt1RuntimeSchema = RuntimeSchema.createFrom(SparseInt1.class);<NEW_LINE>sparseInt10RuntimeSchema = <MASK><NEW_LINE>generatedInt1Schema = GeneratedInt1.getSchema();<NEW_LINE>generatedInt10Schema = GeneratedInt10.getSchema();<NEW_LINE>int1 = new Int1();<NEW_LINE>int1.a0 = 1;<NEW_LINE>int10 = new Int10();<NEW_LINE>int10.a0 = 1;<NEW_LINE>int10.a1 = 2;<NEW_LINE>int10.a2 = 3;<NEW_LINE>int10.a3 = 4;<NEW_LINE>int10.a4 = 5;<NEW_LINE>int10.a5 = 6;<NEW_LINE>int10.a6 = 7;<NEW_LINE>int10.a7 = 8;<NEW_LINE>int10.a8 = 9;<NEW_LINE>int10.a9 = 10;<NEW_LINE>sparseInt1 = new SparseInt1();<NEW_LINE>sparseInt1.a0 = 1;<NEW_LINE>sparseInt10 = new SparseInt10();<NEW_LINE>sparseInt10.a0 = 1;<NEW_LINE>sparseInt10.a1 = 2;<NEW_LINE>sparseInt10.a2 = 3;<NEW_LINE>sparseInt10.a3 = 4;<NEW_LINE>sparseInt10.a4 = 5;<NEW_LINE>sparseInt10.a5 = 6;<NEW_LINE>sparseInt10.a6 = 7;<NEW_LINE>sparseInt10.a7 = 8;<NEW_LINE>sparseInt10.a8 = 9;<NEW_LINE>sparseInt10.a9 = 10;<NEW_LINE>generatedInt1 = new GeneratedInt1();<NEW_LINE>generatedInt1.setA0(1);<NEW_LINE>generatedInt10 = new GeneratedInt10();<NEW_LINE>generatedInt10.setA0(1);<NEW_LINE>generatedInt10.setA1(2);<NEW_LINE>generatedInt10.setA2(3);<NEW_LINE>generatedInt10.setA3(4);<NEW_LINE>generatedInt10.setA4(5);<NEW_LINE>generatedInt10.setA5(6);<NEW_LINE>generatedInt10.setA6(7);<NEW_LINE>generatedInt10.setA7(8);<NEW_LINE>generatedInt10.setA8(9);<NEW_LINE>generatedInt10.setA9(10);<NEW_LINE>buffer = LinkedBuffer.allocate();<NEW_LINE>ByteArrayOutputStream outputStream = new ByteArrayOutputStream();<NEW_LINE>ProtobufIOUtil.writeTo(outputStream, int1, int1RuntimeSchema, buffer);<NEW_LINE>data_1_int = outputStream.toByteArray();<NEW_LINE>outputStream.reset();<NEW_LINE>buffer.clear();<NEW_LINE>ProtobufIOUtil.writeTo(outputStream, int10, int10RuntimeSchema, buffer);<NEW_LINE>data_10_int = outputStream.toByteArray();<NEW_LINE>outputStream.reset();<NEW_LINE>buffer.clear();<NEW_LINE>}
RuntimeSchema.createFrom(SparseInt10.class);
629,974
protected String computeContentEncoding(HttpRequestHdr request, Map<String, String> pageEncodings, Map<String, String> formEncodings, String urlWithoutQuery) {<NEW_LINE>// Check if the request itself tells us what the encoding is<NEW_LINE>String contentEncoding;<NEW_LINE>String requestContentEncoding = ConversionUtils.getEncodingFromContentType(request.getContentType());<NEW_LINE>if (requestContentEncoding != null) {<NEW_LINE>contentEncoding = requestContentEncoding;<NEW_LINE>} else {<NEW_LINE>// Check if we know the encoding of the page<NEW_LINE>contentEncoding = pageEncodings.get(urlWithoutQuery);<NEW_LINE>log.<MASK><NEW_LINE>// Check if we know the encoding of the form<NEW_LINE>String formEncoding = formEncodings.get(urlWithoutQuery);<NEW_LINE>// Form encoding has priority over page encoding<NEW_LINE>if (formEncoding != null) {<NEW_LINE>contentEncoding = formEncoding;<NEW_LINE>log.debug("Computed encoding:{} for url:{}", contentEncoding, urlWithoutQuery);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (contentEncoding == null) {<NEW_LINE>contentEncoding = pageEncodings.get(DEFAULT_ENCODING_KEY);<NEW_LINE>log.debug("Defaulting to encoding:{} for url:{}", contentEncoding, urlWithoutQuery);<NEW_LINE>}<NEW_LINE>return contentEncoding;<NEW_LINE>}
debug("Computed encoding:{} for url:{}", contentEncoding, urlWithoutQuery);
190,374
private void replicate(CRDTReplicationAwareService service, Member target) {<NEW_LINE>if (Thread.currentThread().isInterrupted()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int targetIndex = getDataMemberListIndex(target);<NEW_LINE>final Map<String, VectorClock> lastSuccessfullyReplicatedClocks = replicationMigrationService.getReplicatedVectorClocks(service.getName(), target.getUuid());<NEW_LINE>final <MASK><NEW_LINE>final CRDTReplicationContainer replicationOperation = service.prepareReplicationOperation(lastSuccessfullyReplicatedClocks, targetIndex);<NEW_LINE>if (replicationOperation == null) {<NEW_LINE>logger.finest("Skipping replication of " + service.getName() + " for target " + target);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>logger.finest("Replicating " + service.getName() + " to " + target);<NEW_LINE>operationService.invokeOnTarget(null, replicationOperation.getOperation(), target.getAddress()).joinInternal();<NEW_LINE>replicationMigrationService.setReplicatedVectorClocks(service.getName(), target.getUuid(), replicationOperation.getVectorClocks());<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (logger.isFineEnabled()) {<NEW_LINE>logger.fine("Failed replication of " + service.getName() + " for target " + target, e);<NEW_LINE>} else {<NEW_LINE>logger.info("Failed replication of " + service.getName() + " for target " + target);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
OperationService operationService = nodeEngine.getOperationService();
747,658
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 = <MASK><NEW_LINE>redirectAttributes.addFlashAttribute("settings_toast", true);<NEW_LINE>redirectAttributes.addFlashAttribute("settings_reload", !settingsService.getIndexString().equals(command.getIndex()) || !settingsService.getIgnoredArticles().equals(command.getIgnoredArticles()) || !settingsService.getShortcuts().equals(command.getShortcuts()) || !settingsService.getThemeId().equals(theme.getId()) || !settingsService.getLocale().equals(locale));<NEW_LINE>settingsService.setIndexString(command.getIndex());<NEW_LINE>settingsService.setIgnoredArticles(command.getIgnoredArticles());<NEW_LINE>settingsService.setShortcuts(command.getShortcuts());<NEW_LINE>settingsService.setPlaylistFolder(command.getPlaylistFolder());<NEW_LINE>settingsService.setMusicFileTypes(command.getMusicFileTypes());<NEW_LINE>settingsService.setVideoFileTypes(command.getVideoFileTypes());<NEW_LINE>settingsService.setCoverArtFileTypes(command.getCoverArtFileTypes());<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.setThemeId(theme.getId());<NEW_LINE>settingsService.setLocale(locale);<NEW_LINE>settingsService.save();<NEW_LINE>return "redirect:generalSettings.view";<NEW_LINE>}
settingsService.getAvailableLocales()[localeIndex];
1,696,915
public List<Country> loadCountries() {<NEW_LINE>// To decode received country codes from SMSVerificationActivity<NEW_LINE>// Each string in ArrayList is "DO:1809,1829,1849,"<NEW_LINE>ArrayList<Country> countryCodeList = new ArrayList<>();<NEW_LINE>if (this.receivedCountryCodes != null) {<NEW_LINE>for (String countryString : receivedCountryCodes) {<NEW_LINE>int splitIndex = countryString.indexOf(":");<NEW_LINE>String countryCode = countryString.substring(0, countryString.indexOf(":"));<NEW_LINE>String[] dialCodes = countryString.substring(splitIndex <MASK><NEW_LINE>for (String dialCode : dialCodes) {<NEW_LINE>Locale locale = new Locale("", countryCode);<NEW_LINE>String countryName = locale.getDisplayName();<NEW_LINE>countryCodeList.add(new Country(countryName, ("+" + dialCode), countryCode));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return countryCodeList;<NEW_LINE>}
+ 1).split(",");
875,408
private void updateInProjectCombo(boolean show) {<NEW_LINE>if (show) {<NEW_LINE>// NOI18N<NEW_LINE>remoteCheckBox.setText(org.openide.util.NbBundle.getMessage<MASK><NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>remoteCheckBox.setText(org.openide.util.NbBundle.getMessage(EjbFacadeVisualPanel2.class, "LBL_Remote"));<NEW_LINE>}<NEW_LINE>inProjectCombo.setVisible(show);<NEW_LINE>if (show && projectsList == null) {<NEW_LINE>List<Project> projects = SessionEJBWizardPanel.getProjectsList(project);<NEW_LINE>projectsList = new DefaultComboBoxModel(projects.toArray(new Project[projects.size()]));<NEW_LINE>final ListCellRenderer defaultRenderer = inProjectCombo.getRenderer();<NEW_LINE>if (!projects.isEmpty()) {<NEW_LINE>inProjectCombo.setRenderer(new ListCellRenderer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {<NEW_LINE>String name = ProjectUtils.getInformation((Project) value).getDisplayName();<NEW_LINE>return defaultRenderer.getListCellRendererComponent(list, name, index, isSelected, cellHasFocus);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>inProjectCombo.setModel(projectsList);<NEW_LINE>inProjectCombo.setSelectedIndex(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(EjbFacadeVisualPanel2.class, "LBL_Remote_In_Project"));
1,192,389
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {<NEW_LINE>super.onActivityResult(requestCode, resultCode, intent);<NEW_LINE>if (resultCode == RESULT_MEDIA_EJECTED) {<NEW_LINE>onSdCardNotMounted();<NEW_LINE>return;<NEW_LINE>} else if (resultCode == RESULT_DB_ERROR) {<NEW_LINE>handleDbError();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (requestCode == SHOW_INFO_NEW_VERSION) {<NEW_LINE>showStartupScreensAndDialogs(AnkiDroidApp.getSharedPrefs(getBaseContext()), 3);<NEW_LINE>} else if (requestCode == LOG_IN_FOR_SYNC && resultCode == RESULT_OK) {<NEW_LINE>mSyncOnResume = true;<NEW_LINE>} else if (requestCode == REQUEST_REVIEW || requestCode == SHOW_STUDYOPTIONS) {<NEW_LINE>if (resultCode == Reviewer.RESULT_NO_MORE_CARDS) {<NEW_LINE>// Show a message when reviewing has finished<NEW_LINE>if (getCol().getSched().count() == 0) {<NEW_LINE>UIUtils.showSimpleSnackbar(this, R.string.studyoptions_congrats_finished, false);<NEW_LINE>} else {<NEW_LINE>UIUtils.showSimpleSnackbar(this, R.string.studyoptions_no_cards_due, false);<NEW_LINE>}<NEW_LINE>} else if (resultCode == Reviewer.RESULT_ABORT_AND_SYNC) {<NEW_LINE>Timber.i("Obtained Abort and Sync result");<NEW_LINE>TaskManager.waitForAllToFinish(4);<NEW_LINE>sync();<NEW_LINE>}<NEW_LINE>} else if (requestCode == REQUEST_PATH_UPDATE) {<NEW_LINE>// The collection path was inaccessible on startup so just close the activity and let user restart<NEW_LINE>finishWithoutAnimation();<NEW_LINE>} else if ((requestCode == PICK_APKG_FILE) && (resultCode == RESULT_OK)) {<NEW_LINE>ImportUtils.ImportResult importResult = <MASK><NEW_LINE>if (!importResult.isSuccess()) {<NEW_LINE>ImportUtils.showImportUnsuccessfulDialog(this, importResult.getHumanReadableMessage(), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ImportUtils.handleFileImport(this, intent);
1,224,449
public BExpressionValue evaluate() throws EvaluationException {<NEW_LINE>try {<NEW_LINE>// A new-expr constructs a new object or stream. The class-descriptor in an explicit-new-expr must refer to<NEW_LINE>// a class or a stream type.<NEW_LINE>//<NEW_LINE>// An explicit-type-expr specifying a class-descriptor T has static type T, except that if T is an class<NEW_LINE>// type and the type of the init method is E?, where E is a subtype of error, then it has static type T|E.<NEW_LINE>//<NEW_LINE>// An implicit-new-expr is equivalent to an explicit-new-expr that specifies the applicable contextually<NEW_LINE>// expected type as the class-descriptor. An implicit-new-expr consisting of just new is equivalent to<NEW_LINE>// new(). It is an error if the applicable contextually expected type is not a class or stream type.<NEW_LINE>if (syntaxNode instanceof ImplicitNewExpressionNode) {<NEW_LINE>throw createEvaluationException("Implicit new expressions are not supported by the evaluator. " + "Try using the equivalent explicit expression by specifying the class descriptor " + "(i.e. 'new T()') instead.");<NEW_LINE>}<NEW_LINE>Value value = invokeObjectInitMethod(((ExplicitNewExpressionNode) syntaxNode).typeDescriptor());<NEW_LINE>return new BExpressionValue(context, value);<NEW_LINE>} catch (EvaluationException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw createEvaluationException(INTERNAL_ERROR, syntaxNode.<MASK><NEW_LINE>}<NEW_LINE>}
toSourceCode().trim());
1,065,292
protected static void extractEnumerations(CoreMap s, List<Mention> mentions, Set<IntPair> mentionSpanSet, Set<IntPair> namedEntitySpanSet) {<NEW_LINE>List<CoreLabel> sent = s.get(CoreAnnotations.TokensAnnotation.class);<NEW_LINE>Tree tree = s.get(TreeCoreAnnotations.TreeAnnotation.class);<NEW_LINE>SemanticGraph basicDependency = s.get(SemanticGraphCoreAnnotations.BasicDependenciesAnnotation.class);<NEW_LINE>SemanticGraph enhancedDependency = s.get(SemanticGraphCoreAnnotations.EnhancedDependenciesAnnotation.class);<NEW_LINE>if (enhancedDependency == null) {<NEW_LINE>enhancedDependency = s.get(SemanticGraphCoreAnnotations.BasicDependenciesAnnotation.class);<NEW_LINE>}<NEW_LINE>TregexPattern tgrepPattern = enumerationsMentionPattern;<NEW_LINE>TregexMatcher matcher = tgrepPattern.matcher(tree);<NEW_LINE>Map<IntPair, Tree> spanToMentionSubTree = Generics.newHashMap();<NEW_LINE>while (matcher.find()) {<NEW_LINE>matcher.getMatch();<NEW_LINE>Tree m1 = matcher.getNode("m1");<NEW_LINE>Tree m2 = matcher.getNode("m2");<NEW_LINE>List<Tree> mLeaves = m1.getLeaves();<NEW_LINE>int beginIdx = ((CoreLabel) mLeaves.get(0).label()).get(CoreAnnotations.IndexAnnotation.class) - 1;<NEW_LINE>int endIdx = ((CoreLabel) mLeaves.get(mLeaves.size() - 1).label()).get(CoreAnnotations.IndexAnnotation.class);<NEW_LINE>spanToMentionSubTree.put(new IntPair(beginIdx, endIdx), m1);<NEW_LINE>mLeaves = m2.getLeaves();<NEW_LINE>beginIdx = ((CoreLabel) mLeaves.get(0).label()).get(CoreAnnotations.IndexAnnotation.class) - 1;<NEW_LINE>endIdx = ((CoreLabel) mLeaves.get(mLeaves.size() - 1).label()).<MASK><NEW_LINE>spanToMentionSubTree.put(new IntPair(beginIdx, endIdx), m2);<NEW_LINE>}<NEW_LINE>for (Map.Entry<IntPair, Tree> spanMention : spanToMentionSubTree.entrySet()) {<NEW_LINE>IntPair span = spanMention.getKey();<NEW_LINE>if (!mentionSpanSet.contains(span) && !insideNE(span, namedEntitySpanSet)) {<NEW_LINE>int dummyMentionId = -1;<NEW_LINE>Mention m = new Mention(dummyMentionId, span.get(0), span.get(1), sent, basicDependency, enhancedDependency, new ArrayList<>(sent.subList(span.get(0), span.get(1))), spanMention.getValue());<NEW_LINE>mentions.add(m);<NEW_LINE>mentionSpanSet.add(span);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
get(CoreAnnotations.IndexAnnotation.class);
1,296,083
public Observable<ServiceResponse<OperationStatus>> deletePrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId) {<NEW_LINE>if (this.client.endpoint() == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (appId == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter appId is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (versionId == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter versionId is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (entityId == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter entityId is required and cannot be null.");<NEW_LINE>}<NEW_LINE>if (roleId == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter roleId is required and cannot be null.");<NEW_LINE>}<NEW_LINE>String parameterizedHost = Joiner.on(", ").join("{Endpoint}", <MASK><NEW_LINE>return service.deletePrebuiltEntityRole(appId, versionId, entityId, roleId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<OperationStatus>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<ServiceResponse<OperationStatus>> call(Response<ResponseBody> response) {<NEW_LINE>try {<NEW_LINE>ServiceResponse<OperationStatus> clientResponse = deletePrebuiltEntityRoleDelegate(response);<NEW_LINE>return Observable.just(clientResponse);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>return Observable.error(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
this.client.endpoint());
1,601,838
private void ensureKeyboardsAreBuilt() {<NEW_LINE>if (mAlphabetKeyboards.length == 0 || mSymbolsKeyboardsArray.length == 0 || mAlphabetKeyboardsCreators.length == 0) {<NEW_LINE>if (mAlphabetKeyboards.length == 0 || mAlphabetKeyboardsCreators.length == 0) {<NEW_LINE>final List<KeyboardAddOnAndBuilder> enabledKeyboardBuilders = AnyApplication.getKeyboardFactory(mContext).getEnabledAddOns();<NEW_LINE>mAlphabetKeyboardsCreators = enabledKeyboardBuilders.toArray(new KeyboardAddOnAndBuilder[enabledKeyboardBuilders.size()]);<NEW_LINE>mInternetInputLayoutIndex = findIndexOfInternetInputLayout();<NEW_LINE>mAlphabetKeyboards <MASK><NEW_LINE>mLastSelectedKeyboardIndex = 0;<NEW_LINE>mKeyboardSwitchedListener.onAvailableKeyboardsChanged(enabledKeyboardBuilders);<NEW_LINE>}<NEW_LINE>if (mSymbolsKeyboardsArray.length == 0) {<NEW_LINE>mSymbolsKeyboardsArray = new AnyKeyboard[SYMBOLS_KEYBOARDS_COUNT];<NEW_LINE>if (mLastSelectedSymbolsKeyboard >= mSymbolsKeyboardsArray.length) {<NEW_LINE>mLastSelectedSymbolsKeyboard = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new AnyKeyboard[mAlphabetKeyboardsCreators.length];
1,506,993
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>// TODO Auto-generated method stub<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.csi1_layout);<NEW_LINE>th = (TabHost) findViewById(R.id.tabhost);<NEW_LINE>populateTable(this, dbPassword);<NEW_LINE>referenceXML();<NEW_LINE>Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);<NEW_LINE>ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.<MASK><NEW_LINE>drawer.setDrawerListener(toggle);<NEW_LINE>toggle.syncState();<NEW_LINE>NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);<NEW_LINE>navigationView.setNavigationItemSelectedListener(this);<NEW_LINE>th.setup();<NEW_LINE>generateKey(this, dbPassword);<NEW_LINE>TabSpec specs = th.newTabSpec("tag1");<NEW_LINE>specs.setContent(R.id.tab1);<NEW_LINE>specs.setIndicator("Login");<NEW_LINE>th.addTab(specs);<NEW_LINE>specs = th.newTabSpec("tag2");<NEW_LINE>specs.setContent(R.id.tab2);<NEW_LINE>specs.setIndicator("Key");<NEW_LINE>th.addTab(specs);<NEW_LINE>}
navigation_drawer_open, R.string.navigation_drawer_close);
976,393
public void prepare(Map<String, Object> conf, TopologyContext context, OutputCollector collector) {<NEW_LINE>String mdF = ConfUtils.getString(conf, metadataFilterParamName);<NEW_LINE>if (StringUtils.isNotBlank(mdF)) {<NEW_LINE>// split it in key value<NEW_LINE>int equals = mdF.indexOf('=');<NEW_LINE>if (equals != -1) {<NEW_LINE>String key = mdF.substring(0, equals);<NEW_LINE>String value = mdF.substring(equals + 1);<NEW_LINE>filterKeyValue = new String[] { key.trim(), value.trim() };<NEW_LINE>} else {<NEW_LINE>LOG.error("Can't split into key value : {}", mdF);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fieldNameForText = ConfUtils.getString(conf, textFieldParamName);<NEW_LINE>maxLengthText = ConfUtils.getInt(conf, textLengthParamName, -1);<NEW_LINE>fieldNameForURL = ConfUtils.getString(conf, urlFieldParamName);<NEW_LINE>canonicalMetadataName = ConfUtils.getString(conf, canonicalMetadataParamName);<NEW_LINE>for (String mapping : ConfUtils.loadListFromConf(metadata2fieldParamName, conf)) {<NEW_LINE>int equals = mapping.indexOf('=');<NEW_LINE>if (equals != -1) {<NEW_LINE>String key = mapping.substring(<MASK><NEW_LINE>String value = mapping.substring(equals + 1).trim();<NEW_LINE>metadata2field.put(key, value);<NEW_LINE>LOG.info("Mapping key {} to field {}", key, value);<NEW_LINE>} else {<NEW_LINE>mapping = mapping.trim();<NEW_LINE>metadata2field.put(mapping, mapping);<NEW_LINE>LOG.info("Mapping key {} to field {}", mapping, mapping);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
0, equals).trim();
1,231,355
public Events queryEvents(List<EventQueryCondition> conditionList) throws Exception {<NEW_LINE>// This method maybe have poor efficiency. It queries all data which meets a condition without select function.<NEW_LINE>// https://github.com/apache/iotdb/discussions/3888<NEW_LINE>StringBuilder query = new StringBuilder();<NEW_LINE>query.append("select * from ");<NEW_LINE>IoTDBUtils.addModelPath(client.getStorageGroup(), query, Event.INDEX_NAME);<NEW_LINE>IoTDBUtils.addQueryAsterisk(Event.INDEX_NAME, query);<NEW_LINE>StringBuilder where = whereSQL(conditionList);<NEW_LINE>if (where.length() > 0) {<NEW_LINE>query.append(" where ").append(where);<NEW_LINE>}<NEW_LINE>query.append(IoTDBClient.ALIGN_BY_DEVICE);<NEW_LINE>List<? super StorageData> storageDataList = client.filterQuery(Event.INDEX_NAME, query.toString(), storageBuilder);<NEW_LINE><MASK><NEW_LINE>EventQueryCondition condition = conditionList.get(0);<NEW_LINE>int limitCount = 0;<NEW_LINE>PaginationUtils.Page page = PaginationUtils.INSTANCE.exchange(condition.getPaging());<NEW_LINE>for (int i = page.getFrom(); i < storageDataList.size(); i++) {<NEW_LINE>if (limitCount < page.getLimit()) {<NEW_LINE>limitCount++;<NEW_LINE>Event event = (Event) storageDataList.get(i);<NEW_LINE>events.getEvents().add(parseEvent(event));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>events.setTotal(storageDataList.size());<NEW_LINE>// resort by self, because of the select query result order by time.<NEW_LINE>final Order order = Objects.isNull(condition.getOrder()) ? Order.DES : condition.getOrder();<NEW_LINE>if (Order.DES.equals(order)) {<NEW_LINE>events.getEvents().sort((org.apache.skywalking.oap.server.core.query.type.event.Event e1, org.apache.skywalking.oap.server.core.query.type.event.Event e2) -> Long.compare(e2.getStartTime(), e1.getStartTime()));<NEW_LINE>} else {<NEW_LINE>events.getEvents().sort(Comparator.comparingLong(org.apache.skywalking.oap.server.core.query.type.event.Event::getStartTime));<NEW_LINE>}<NEW_LINE>return events;<NEW_LINE>}
final Events events = new Events();
962,814
public static void updateFileExtension(@Nonnull Project project, @Nullable VirtualFile file) throws IOException {<NEW_LINE>ApplicationManager.getApplication().assertWriteAccessAllowed();<NEW_LINE>if (CommandProcessor.getInstance().getCurrentCommand() == null) {<NEW_LINE>throw new AssertionError("command required");<NEW_LINE>}<NEW_LINE>if (file == null)<NEW_LINE>return;<NEW_LINE>Language language = LanguageUtil.getLanguageForPsi(project, file);<NEW_LINE>FileType expected = getFileTypeFromName(file);<NEW_LINE>FileType actual = language == null ? null : language.getAssociatedFileType();<NEW_LINE>if (expected == actual || actual == null)<NEW_LINE>return;<NEW_LINE>String ext = actual.getDefaultExtension();<NEW_LINE>if (StringUtil.isEmpty(ext))<NEW_LINE>return;<NEW_LINE>String newName = PathUtil.makeFileName(<MASK><NEW_LINE>VirtualFile parent = file.getParent();<NEW_LINE>newName = parent != null && parent.findChild(newName) != null ? PathUtil.makeFileName(file.getName(), ext) : newName;<NEW_LINE>file.rename(ScratchUtil.class, newName);<NEW_LINE>}
file.getNameWithoutExtension(), ext);
1,771,717
public void initialize(GenericApplicationContext context) {<NEW_LINE>Supplier<R2dbcDataAutoConfiguration> r2dbcDataConfiguration = new Supplier<R2dbcDataAutoConfiguration>() {<NEW_LINE><NEW_LINE>private R2dbcDataAutoConfiguration configuration;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public R2dbcDataAutoConfiguration get() {<NEW_LINE>if (configuration == null) {<NEW_LINE>configuration = new R2dbcDataAutoConfiguration(context.getBean(DatabaseClient.class));<NEW_LINE>}<NEW_LINE>return configuration;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>context.registerBean(R2dbcEntityTemplate.class, () -> r2dbcDataConfiguration.get().r2dbcEntityTemplate(context.getBean(R2dbcConverter.class)));<NEW_LINE>context.registerBean(R2dbcCustomConversions.class, () -> r2dbcDataConfiguration.get().r2dbcCustomConversions());<NEW_LINE>context.registerBean(R2dbcMappingContext.class, () -> r2dbcDataConfiguration.get().r2dbcMappingContext(context.getBeanProvider(NamingStrategy.class), context.getBean(R2dbcCustomConversions.class)));<NEW_LINE>context.registerBean(MappingR2dbcConverter.class, () -> r2dbcDataConfiguration.get().r2dbcConverter(context.getBean(R2dbcMappingContext.class), context.<MASK><NEW_LINE>}
getBean(R2dbcCustomConversions.class)));
1,063,927
private Overlay createPolygon(BoundingBox key, Integer value, int redthreshold, int orangethreshold) {<NEW_LINE>Polygon polygon = new Polygon(mMapView);<NEW_LINE>if (value < orangethreshold)<NEW_LINE>polygon.getFillPaint().setColor(Color.parseColor(alpha + yellow));<NEW_LINE>else if (value < redthreshold)<NEW_LINE>polygon.getFillPaint().setColor(Color.parseColor(alpha + orange));<NEW_LINE>else if (value >= redthreshold)<NEW_LINE>polygon.getFillPaint().setColor(Color.parseColor(alpha + red));<NEW_LINE>else {<NEW_LINE>// no polygon<NEW_LINE>}<NEW_LINE>polygon.getOutlinePaint().setColor(polygon.getFillPaint().getColor());<NEW_LINE>// if you set this to something like 20f and have a low alpha setting,<NEW_LINE>// you'll end with a gaussian blur like effect<NEW_LINE>polygon.getOutlinePaint().setStrokeWidth(0f);<NEW_LINE>List<GeoPoint> pts = new ArrayList<GeoPoint>();<NEW_LINE>pts.add(new GeoPoint(key.getLatNorth()<MASK><NEW_LINE>pts.add(new GeoPoint(key.getLatNorth(), key.getLonEast()));<NEW_LINE>pts.add(new GeoPoint(key.getLatSouth(), key.getLonEast()));<NEW_LINE>pts.add(new GeoPoint(key.getLatSouth(), key.getLonWest()));<NEW_LINE>polygon.setPoints(pts);<NEW_LINE>return polygon;<NEW_LINE>}
, key.getLonWest()));
967,839
public void hitsExecute(SearchContext context, SearchHit[] hits) throws IOException {<NEW_LINE>if (context.version() == false || (context.storedFieldsContext() != null && context.storedFieldsContext().fetchFields() == false)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// don't modify the incoming hits<NEW_LINE>hits = hits.clone();<NEW_LINE>Arrays.sort(hits, Comparator.comparingInt(SearchHit::docId));<NEW_LINE>int lastReaderId = -1;<NEW_LINE>NumericDocValues versions = null;<NEW_LINE>for (SearchHit hit : hits) {<NEW_LINE>long version = Versions.NOT_FOUND;<NEW_LINE>if (context.indexShard().getEngine() instanceof InternalEngine) {<NEW_LINE>version = 1;<NEW_LINE>} else {<NEW_LINE>int readerId = ReaderUtil.subIndex(hit.docId(), context.searcher().<MASK><NEW_LINE>LeafReaderContext subReaderContext = context.searcher().getIndexReader().leaves().get(readerId);<NEW_LINE>if (lastReaderId != readerId) {<NEW_LINE>versions = subReaderContext.reader().getNumericDocValues(VersionFieldMapper.NAME);<NEW_LINE>lastReaderId = readerId;<NEW_LINE>}<NEW_LINE>int docId = hit.docId() - subReaderContext.docBase;<NEW_LINE>if (versions != null && versions.advanceExact(docId)) {<NEW_LINE>version = versions.longValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>hit.version(version < 0 ? -1 : version);<NEW_LINE>}<NEW_LINE>}
getIndexReader().leaves());
343,209
private GridPane createVotesTable() {<NEW_LINE>GridPane votesGridPane = new GridPane();<NEW_LINE>votesGridPane.setHgap(5);<NEW_LINE>votesGridPane.setVgap(5);<NEW_LINE>votesGridPane.setPadding(new Insets(15));<NEW_LINE>ColumnConstraints columnConstraints1 = new ColumnConstraints();<NEW_LINE>columnConstraints1.setHalignment(HPos.RIGHT);<NEW_LINE>columnConstraints1.setHgrow(Priority.ALWAYS);<NEW_LINE>votesGridPane.getColumnConstraints().addAll(columnConstraints1);<NEW_LINE>int gridRow = 0;<NEW_LINE>TableGroupHeadline votesTableHeader = new TableGroupHeadline(Res.get("dao.results.proposals.voting.detail.header"));<NEW_LINE>GridPane.setRowIndex(votesTableHeader, gridRow);<NEW_LINE>GridPane.setMargin(votesTableHeader, new Insets(8, 0, 0, 0));<NEW_LINE>GridPane.setColumnSpan(votesTableHeader, 2);<NEW_LINE>votesGridPane.getChildren().add(votesTableHeader);<NEW_LINE>TableView<VoteListItem> votesTableView = new TableView<>();<NEW_LINE>votesTableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noData")));<NEW_LINE>votesTableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);<NEW_LINE>createColumns(votesTableView);<NEW_LINE>GridPane.setRowIndex(votesTableView, gridRow);<NEW_LINE>GridPane.setMargin(votesTableView, new Insets(Layout.FIRST_ROW_DISTANCE<MASK><NEW_LINE>GridPane.setColumnSpan(votesTableView, 2);<NEW_LINE>GridPane.setVgrow(votesTableView, Priority.ALWAYS);<NEW_LINE>votesGridPane.getChildren().add(votesTableView);<NEW_LINE>votesTableView.setItems(sortedVotes);<NEW_LINE>addCloseButton(votesGridPane, ++gridRow);<NEW_LINE>return votesGridPane;<NEW_LINE>}
, 0, 0, 0));
444,046
public static Binomial binomial(double[][] x, int[] y, double lambda, double tol, int maxIter) {<NEW_LINE>if (x.length != y.length) {<NEW_LINE>throw new IllegalArgumentException(String.format("The sizes of X and Y don't match: %d != %d", x.length, y.length));<NEW_LINE>}<NEW_LINE>if (lambda < 0.0) {<NEW_LINE>throw new IllegalArgumentException("Invalid regularization factor: " + lambda);<NEW_LINE>}<NEW_LINE>if (tol <= 0.0) {<NEW_LINE>throw new IllegalArgumentException("Invalid tolerance: " + tol);<NEW_LINE>}<NEW_LINE>if (maxIter <= 0) {<NEW_LINE>throw new IllegalArgumentException("Invalid maximum number of iterations: " + maxIter);<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>ClassLabels codec = ClassLabels.fit(y);<NEW_LINE>int k = codec.k;<NEW_LINE>y = codec.y;<NEW_LINE>if (k != 2) {<NEW_LINE>throw new IllegalArgumentException("Fits binomial model on multi-class data.");<NEW_LINE>}<NEW_LINE>BinomialObjective objective = new BinomialObjective(x, y, lambda);<NEW_LINE>double[] w = new double[p + 1];<NEW_LINE>double L = -BFGS.minimize(objective, 5, w, tol, maxIter);<NEW_LINE>Binomial model = new Binomial(w, L, lambda, codec.classes);<NEW_LINE>model.setLearningRate(0.1 / x.length);<NEW_LINE>return model;<NEW_LINE>}
p = x[0].length;
1,617,257
private void init(CodegenVariable parent, String testDataPath, Map<String, CodegenModel> models) {<NEW_LINE>this.parent = parent;<NEW_LINE>this.isArray = dataType.endsWith("[]");<NEW_LINE>this.testDataPath = testDataPath;<NEW_LINE>CodegenModel cm = models.get(dataType);<NEW_LINE>if (cm != null && (cm.isArray || cm.isMap)) {<NEW_LINE>this.isContainer = true;<NEW_LINE>this.isListContainer = cm.isArray;<NEW_LINE>this.isMap = cm.isMap;<NEW_LINE>this.items = new CodegenVariable();<NEW_LINE>this.items.name = "item";<NEW_LINE>this.items.dataType = cm.additionalPropertiesType;<NEW_LINE>this.items.<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if ((isArray || isContainer) && testDataControlCache != null)<NEW_LINE>this.itemCount = testDataControlCache.getInt(getPointer("testItemCount", false, false), 1);<NEW_LINE>} catch (CacheException e) {<NEW_LINE>LOGGER.error("Error accessing test data control cache", e);<NEW_LINE>}<NEW_LINE>}
init(this, testDataPath, models);
963,902
public static void main(String[] args) {<NEW_LINE>InputReader in = new InputReader(System.in);<NEW_LINE>PrintWriter pw <MASK><NEW_LINE>// Code starts..<NEW_LINE>int n = in.nextInt();<NEW_LINE>int[] a = in.nextIntArray(n);<NEW_LINE>query[] qr1 = new query[n];<NEW_LINE>pair[] p = new pair[n];<NEW_LINE>q = n;<NEW_LINE>HashMap<Integer, Integer> map = new HashMap<>();<NEW_LINE>for (int i = 0; i < n; i++) map.put(a[i], i);<NEW_LINE>Arrays.sort(a);<NEW_LINE>for (int i = n - 1; i >= 0; i--) {<NEW_LINE>p[n - i - 1] = new pair(-a[i], map.get(a[i]));<NEW_LINE>int l = 0;<NEW_LINE>int r = map.get(a[i]) - 1;<NEW_LINE>int x = a[i];<NEW_LINE>qr1[n - i - 1] = new query(l, r, -a[i], map.get(a[i]));<NEW_LINE>// pw.println(qr1[n-i-1].l+" "+qr1[n-i-1].x+" "+p[n-i-1]);<NEW_LINE>}<NEW_LINE>int[] ans = answerQueries(n, qr1, q, p);<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>int l = map.get(a[i]) + 1;<NEW_LINE>int r = n - 1;<NEW_LINE>int x = a[i];<NEW_LINE>qr1[i].l = l;<NEW_LINE>qr1[i].r = r;<NEW_LINE>qr1[i].x = x;<NEW_LINE>qr1[i].idx = map.get(a[i]);<NEW_LINE>p[i].x = x;<NEW_LINE>p[i].y = map.get(a[i]);<NEW_LINE>// pw.println(qr1[i].l+" "+qr1[i].x+" "+p[i]+" ");<NEW_LINE>}<NEW_LINE>int[] ans2 = answerQueries(n, qr1, q, p);<NEW_LINE>long sum = 0;<NEW_LINE>for (int i = 0; i < q; i++) {<NEW_LINE>sum += (long) ans[i] * ans2[i];<NEW_LINE>// pw.println(ans[i]+" "+ans2[i]);<NEW_LINE>}<NEW_LINE>pw.print(sum);<NEW_LINE>// code ends...<NEW_LINE>pw.flush();<NEW_LINE>pw.close();<NEW_LINE>}
= new PrintWriter(System.out);
566,764
final PollForThirdPartyJobsResult executePollForThirdPartyJobs(PollForThirdPartyJobsRequest pollForThirdPartyJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(pollForThirdPartyJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PollForThirdPartyJobsRequest> request = null;<NEW_LINE>Response<PollForThirdPartyJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PollForThirdPartyJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(pollForThirdPartyJobsRequest));<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, "CodePipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PollForThirdPartyJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PollForThirdPartyJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new PollForThirdPartyJobsResultJsonUnmarshaller());
305,228
private static void writeThreadPoolMetrics(final HystrixThreadPoolMetrics threadPoolMetrics, JsonGenerator json) throws IOException {<NEW_LINE>HystrixThreadPoolKey key = threadPoolMetrics.getThreadPoolKey();<NEW_LINE>json.writeStartObject();<NEW_LINE>json.writeStringField("type", "HystrixThreadPool");<NEW_LINE>json.writeStringField("name", key.name());<NEW_LINE>json.writeNumberField("currentTime", System.currentTimeMillis());<NEW_LINE>json.writeNumberField("currentActiveCount", threadPoolMetrics.getCurrentActiveCount().intValue());<NEW_LINE>json.writeNumberField("currentCompletedTaskCount", threadPoolMetrics.getCurrentCompletedTaskCount().longValue());<NEW_LINE>json.writeNumberField("currentCorePoolSize", threadPoolMetrics.getCurrentCorePoolSize().intValue());<NEW_LINE>json.writeNumberField("currentLargestPoolSize", threadPoolMetrics.getCurrentLargestPoolSize().intValue());<NEW_LINE>json.writeNumberField("currentMaximumPoolSize", threadPoolMetrics.getCurrentMaximumPoolSize().intValue());<NEW_LINE>json.writeNumberField("currentPoolSize", threadPoolMetrics.getCurrentPoolSize().intValue());<NEW_LINE>json.writeNumberField("currentQueueSize", threadPoolMetrics.getCurrentQueueSize().intValue());<NEW_LINE>json.writeNumberField("currentTaskCount", threadPoolMetrics.<MASK><NEW_LINE>safelyWriteNumberField(json, "rollingCountThreadsExecuted", new Func0<Long>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Long call() {<NEW_LINE>return threadPoolMetrics.getRollingCount(HystrixEventType.ThreadPool.EXECUTED);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>json.writeNumberField("rollingMaxActiveThreads", threadPoolMetrics.getRollingMaxActiveThreads());<NEW_LINE>safelyWriteNumberField(json, "rollingCountCommandRejections", new Func0<Long>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Long call() {<NEW_LINE>return threadPoolMetrics.getRollingCount(HystrixEventType.ThreadPool.REJECTED);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>json.writeNumberField("propertyValue_queueSizeRejectionThreshold", threadPoolMetrics.getProperties().queueSizeRejectionThreshold().get());<NEW_LINE>json.writeNumberField("propertyValue_metricsRollingStatisticalWindowInMilliseconds", threadPoolMetrics.getProperties().metricsRollingStatisticalWindowInMilliseconds().get());<NEW_LINE>// this will get summed across all instances in a cluster<NEW_LINE>json.writeNumberField("reportingHosts", 1);<NEW_LINE>json.writeEndObject();<NEW_LINE>}
getCurrentTaskCount().longValue());
188,816
public void processOpts() {<NEW_LINE>super.processOpts();<NEW_LINE>String appPackage = invokerPackage + ".app";<NEW_LINE>supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));<NEW_LINE>supportingFiles.add(new SupportingFile("build.mustache", "", "build.sbt"));<NEW_LINE>supportingFiles.add(new SupportingFile("web.xml", "/src/main/webapp/WEB-INF", "web.xml"));<NEW_LINE>supportingFiles.add(new SupportingFile("logback.xml", "/src/main/resources", "logback.xml"));<NEW_LINE>supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore"));<NEW_LINE>supportingFiles.add(new SupportingFile("JettyMain.mustache", <MASK><NEW_LINE>supportingFiles.add(new SupportingFile("Bootstrap.mustache", sourceFolderByPackage(invokerPackage), "ScalatraBootstrap.scala"));<NEW_LINE>supportingFiles.add(new SupportingFile("ServletApp.mustache", sourceFolderByPackage(appPackage), "ServletApp.scala"));<NEW_LINE>supportingFiles.add(new SupportingFile("project/build.properties", "project", "build.properties"));<NEW_LINE>supportingFiles.add(new SupportingFile("project/plugins.sbt", "project", "plugins.sbt"));<NEW_LINE>supportingFiles.add(new SupportingFile("sbt", "", "sbt"));<NEW_LINE>additionalProperties.put("appName", appName);<NEW_LINE>additionalProperties.put("appDescription", appDescription);<NEW_LINE>additionalProperties.put("infoUrl", infoUrl);<NEW_LINE>additionalProperties.put("infoEmail", infoEmail);<NEW_LINE>additionalProperties.put("apiVersion", apiVersion);<NEW_LINE>additionalProperties.put("licenseInfo", licenseInfo);<NEW_LINE>additionalProperties.put("licenseUrl", licenseUrl);<NEW_LINE>additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);<NEW_LINE>additionalProperties.put(CodegenConstants.GROUP_ID, groupId);<NEW_LINE>additionalProperties.put(CodegenConstants.ARTIFACT_ID, artifactId);<NEW_LINE>additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, artifactVersion);<NEW_LINE>}
sourceFolderByPackage(invokerPackage), "JettyMain.scala"));
1,509,243
private Composite createBasicInfoGroup(Composite parent, IFileStore fileStore, IFileInfo fileInfo) {<NEW_LINE>Composite container = new Composite(parent, SWT.NULL);<NEW_LINE>container.setLayout(GridLayoutFactory.swtDefaults().numColumns(2).margins(0, 0).create());<NEW_LINE>Label label = new Label(container, SWT.NONE);<NEW_LINE>label.setText(IDEWorkbenchMessages.ResourceInfo_path);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.TOP).create());<NEW_LINE>Text pathText = new Text(container, SWT.WRAP | SWT.READ_ONLY);<NEW_LINE>pathText.setText(fileStore.toURI().getPath());<NEW_LINE>pathText.setBackground(pathText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>pathText.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).hint(convertWidthInCharsToPixels(MAX_VALUE_WIDTH), SWT.DEFAULT).create());<NEW_LINE>label = new Label(container, SWT.LEFT);<NEW_LINE>label.setText(IDEWorkbenchMessages.ResourceInfo_type);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.TOP).create());<NEW_LINE>Text typeText = new Text(container, SWT.LEFT | SWT.READ_ONLY);<NEW_LINE>typeText.setText(fileInfo.isDirectory() ? Messages.FileInfoPropertyPage_Folder : Messages.FileInfoPropertyPage_File);<NEW_LINE>typeText.setBackground(typeText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>typeText.setLayoutData(GridDataFactory.swtDefaults().create());<NEW_LINE>label = new <MASK><NEW_LINE>label.setText(IDEWorkbenchMessages.ResourceInfo_location);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.TOP).create());<NEW_LINE>Text locationText = new Text(container, SWT.WRAP | SWT.READ_ONLY);<NEW_LINE>locationText.setText(fileStore.toString());<NEW_LINE>locationText.setBackground(locationText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>locationText.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).hint(convertWidthInCharsToPixels(MAX_VALUE_WIDTH), SWT.DEFAULT).create());<NEW_LINE>if (!fileInfo.isDirectory()) {<NEW_LINE>label = new Label(container, SWT.LEFT);<NEW_LINE>label.setText(IDEWorkbenchMessages.ResourceInfo_size);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().create());<NEW_LINE>Text sizeText = new Text(container, SWT.LEFT | SWT.READ_ONLY);<NEW_LINE>sizeText.setText(MessageFormat.format(Messages.FileInfoPropertyPage_Bytes, Long.toString(fileInfo.getLength())));<NEW_LINE>sizeText.setBackground(sizeText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));<NEW_LINE>sizeText.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).hint(convertWidthInCharsToPixels(MAX_VALUE_WIDTH), SWT.DEFAULT).create());<NEW_LINE>}<NEW_LINE>return container;<NEW_LINE>}
Label(container, SWT.LEFT);
1,768,655
public void onEntityDeath(DestructEntityEvent.Death event) {<NEW_LINE>long time = System.currentTimeMillis();<NEW_LINE><MASK><NEW_LINE>if (dead instanceof Player) {<NEW_LINE>// Process Death<NEW_LINE>SessionCache.getCachedSession(dead.getUniqueId()).ifPresent(ActiveSession::addDeath);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<EntityDamageSource> causes = event.getCause().allOf(EntityDamageSource.class);<NEW_LINE>Optional<Player> foundKiller = findKiller(causes, 0);<NEW_LINE>if (!foundKiller.isPresent()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Player killer = foundKiller.get();<NEW_LINE>Runnable processor = dead instanceof Player ? new PlayerKillProcessor(getKiller(killer), getVictim((Player) dead), serverInfo.getServerIdentifier(), findWeapon(event), time) : new MobKillProcessor(killer.getUniqueId());<NEW_LINE>processing.submitCritical(processor);<NEW_LINE>} catch (Exception e) {<NEW_LINE>errorLogger.error(e, ErrorContext.builder().related(event, dead).build());<NEW_LINE>}<NEW_LINE>}
Living dead = event.getTargetEntity();
429,097
public Feature decodeLoc(final LineIterator lineIterator) {<NEW_LINE>final String line = lineIterator.next();<NEW_LINE>if (line.startsWith(COMMENT_LINE_CHARACTER)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final String[] <MASK><NEW_LINE>if (fields.length < MINIMUM_LINE_FIELD_COUNT) {<NEW_LINE>throw new TribbleException("RefSeq (decodeLoc) : Unable to parse line -> " + line + ", we expected at least 16 columns, we saw " + fields.length);<NEW_LINE>}<NEW_LINE>final String contig_name = fields[CONTIG_INDEX];<NEW_LINE>try {<NEW_LINE>return new RefSeqFeature(new SimpleInterval(contig_name, Integer.parseInt(fields[INTERVAL_LEFT_BOUND_INDEX]) + 1, Integer.parseInt(fields[INTERVAL_RIGHT_BOUND_INDEX])));<NEW_LINE>// TODO maybe except for malformed simple intervals? Genome locs had that<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new UserException.MalformedFile("Could not parse location from line: " + line);<NEW_LINE>}<NEW_LINE>}
fields = line.split(LINE_DELIMITER);
791,390
public Set<Integer> updateQuote(short siteId, Serializable id, CmsContentParameters contentParameters, CmsModel cmsModel, CmsCategory category, CmsContentAttribute attribute) {<NEW_LINE>CmsContent entity = getEntity(id);<NEW_LINE>Set<Integer> categoryIds = new HashSet<>();<NEW_LINE>if (null != entity) {<NEW_LINE>for (CmsContent quote : getListByQuoteId(siteId, entity.getId())) {<NEW_LINE>if (null != contentParameters.getContentIds() && contentParameters.getContentIds().contains(quote.getId())) {<NEW_LINE>quote.setUrl(entity.getUrl());<NEW_LINE>quote.setTitle(entity.getTitle());<NEW_LINE>quote.setDescription(entity.getDescription());<NEW_LINE>quote.setAuthor(entity.getAuthor());<NEW_LINE>quote.<MASK><NEW_LINE>quote.setEditor(entity.getEditor());<NEW_LINE>quote.setExpiryDate(entity.getExpiryDate());<NEW_LINE>quote.setStatus(entity.getStatus());<NEW_LINE>quote.setCheckUserId(entity.getCheckUserId());<NEW_LINE>quote.setCheckDate(entity.getCheckDate());<NEW_LINE>quote.setPublishDate(entity.getPublishDate());<NEW_LINE>quote.setHasStatic(entity.isHasStatic());<NEW_LINE>quote.setHasFiles(entity.isHasFiles());<NEW_LINE>quote.setHasImages(entity.isHasImages());<NEW_LINE>} else {<NEW_LINE>delete(quote.getId());<NEW_LINE>categoryIds.add(quote.getCategoryId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return categoryIds;<NEW_LINE>}
setCover(entity.getCover());
1,158,522
public void draw(DrawHandler drawHandler, DrawingInfo drawingInfo) {<NEW_LINE>PointDouble send = new PointDouble(getSendX(drawingInfo), drawingInfo.getVerticalCenter(sendTick));<NEW_LINE>PointDouble receive = new PointDouble(getReceiveX(drawingInfo), drawingInfo.getVerticalCenter(sendTick + duration));<NEW_LINE>RelationDrawer.ArrowEndType arrowEndType = ArrowEndType.NORMAL;<NEW_LINE>boolean fillArrow = false;<NEW_LINE>switch(arrowType) {<NEW_LINE>case OPEN:<NEW_LINE>arrowEndType = ArrowEndType.NORMAL;<NEW_LINE>fillArrow = false;<NEW_LINE>break;<NEW_LINE>case FILLED:<NEW_LINE>arrowEndType = ArrowEndType.CLOSED;<NEW_LINE>fillArrow = true;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>log.error("Encountered unhandled enumeration value '" + arrowType + "'.");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>drawHandler.setLineType(lineType);<NEW_LINE>if (from == to) {<NEW_LINE>drawSelfMessage(drawHandler, send, receive, arrowEndType, fillArrow, drawingInfo);<NEW_LINE>} else {<NEW_LINE>drawNormalMessage(drawHandler, send, receive, arrowEndType, fillArrow, drawingInfo);<NEW_LINE>}<NEW_LINE>drawHandler.setLineType(oldLt);<NEW_LINE>}
LineType oldLt = drawHandler.getLineType();
555,768
public List<MapTuple> join(final Iterable left, final Iterable right, final Match match, final MatchKey matchKey, final Boolean flatten) {<NEW_LINE>// For LEFT keyed Joins it's LEFT and vice versa for RIGHT.<NEW_LINE>final String keyName;<NEW_LINE>// the matching values name (opposite of keyName)<NEW_LINE>final String matchingValuesName;<NEW_LINE>// The key iterate over<NEW_LINE>final Iterable keys;<NEW_LINE>keyName = matchKey.name();<NEW_LINE>if (matchKey.equals(MatchKey.LEFT)) {<NEW_LINE>matchingValuesName = MatchKey.RIGHT.name();<NEW_LINE>keys = left;<NEW_LINE>match.init(right);<NEW_LINE>} else {<NEW_LINE>matchingValuesName = MatchKey.LEFT.name();<NEW_LINE>keys = right;<NEW_LINE>match.init(left);<NEW_LINE>}<NEW_LINE>List<MapTuple> resultList = new ArrayList<>();<NEW_LINE>List matching;<NEW_LINE>if (flatten) {<NEW_LINE>for (final Object keyObj : keys) {<NEW_LINE>matching = match.matching(keyObj);<NEW_LINE>final List<MapTuple> mapTuples = joinFlattened(<MASK><NEW_LINE>if (!mapTuples.isEmpty()) {<NEW_LINE>resultList.addAll(mapTuples);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (final Object keyObj : keys) {<NEW_LINE>matching = match.matching(keyObj);<NEW_LINE>final MapTuple mapTuple = joinAggregated(keyObj, matching, keyName, matchingValuesName);<NEW_LINE>if (mapTuple != null) {<NEW_LINE>resultList.add(mapTuple);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resultList;<NEW_LINE>}
keyObj, matching, keyName, matchingValuesName);
778,370
private static final ImmutableSet<String> extractColumnNamesToCheckForChanges(final Class<?> modelClass, final String[] changedColumnsArr, final String[] ignoredColumnsArr) {<NEW_LINE>final ImmutableSet<String> changedColumns = changedColumnsArr != null ? ImmutableSet.copyOf(changedColumnsArr) : ImmutableSet.of();<NEW_LINE>final ImmutableSet<String> ignoredColumns = ignoredColumnsArr != null ? ImmutableSet.copyOf(<MASK><NEW_LINE>//<NEW_LINE>// Case: specific columns to be checked for changes were specified<NEW_LINE>if (!changedColumns.isEmpty()) {<NEW_LINE>// Case: no columns to be ignored from the list of columns to be checked<NEW_LINE>if (ignoredColumns.isEmpty()) {<NEW_LINE>return ImmutableSet.copyOf(changedColumns);<NEW_LINE>} else // Case: columns to be excluded from the list of columns to be checked were set<NEW_LINE>// => return a copy of columns to be checked, but remove the columns to exclude from it<NEW_LINE>{<NEW_LINE>final ImmutableSet.Builder<String> columnsToCheckForChanges = ImmutableSet.builder();<NEW_LINE>for (final String columnName : changedColumns) {<NEW_LINE>if (ignoredColumns.contains(columnName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>columnsToCheckForChanges.add(columnName);<NEW_LINE>}<NEW_LINE>return columnsToCheckForChanges.build();<NEW_LINE>}<NEW_LINE>} else //<NEW_LINE>// Case: No particular columns to be checked for changes were specified<NEW_LINE>// => return a list of all columns of this model but without those that chall be ignored<NEW_LINE>if (!ignoredColumns.isEmpty()) {<NEW_LINE>final ImmutableSet<String> modelColumnNames = ImmutableSet.copyOf(InterfaceWrapperHelper.getModelColumnNames(modelClass));<NEW_LINE>final ImmutableSet.Builder<String> columnsToCheckForChanges = ImmutableSet.builder();<NEW_LINE>for (final String columnName : modelColumnNames) {<NEW_LINE>if (ignoredColumns.contains(columnName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>columnsToCheckForChanges.add(columnName);<NEW_LINE>}<NEW_LINE>return columnsToCheckForChanges.build();<NEW_LINE>} else //<NEW_LINE>// Case: no columns to be checked and no columns to be ignored were specified<NEW_LINE>// => return an empty set, there is nothing to be checked.<NEW_LINE>{<NEW_LINE>return ImmutableSet.of();<NEW_LINE>}<NEW_LINE>}
ignoredColumnsArr) : ImmutableSet.of();
1,288,583
public static void main(String[] args) {<NEW_LINE>CharsetDecoder dec = Charset.forName("UTF-8").newDecoder();<NEW_LINE>dec.onMalformedInput(CodingErrorAction.REPORT);<NEW_LINE>dec.onUnmappableCharacter(CodingErrorAction.REPORT);<NEW_LINE>byte[] bytes = { (byte) 0xF0, (byte) 0x9D, (byte) 0x80, (byte) 0x80 };<NEW_LINE>byte[] bytes2 = { (byte) 0xB8, (byte) 0x80, 0x63, 0x64, 0x65 };<NEW_LINE>ByteBuffer byteBuf = ByteBuffer.wrap(bytes);<NEW_LINE>ByteBuffer byteBuf2 = ByteBuffer.wrap(bytes2);<NEW_LINE>char[] chars = new char[1];<NEW_LINE>CharBuffer charBuf = CharBuffer.wrap(chars);<NEW_LINE>CoderResult cr = dec.decode(byteBuf, charBuf, false);<NEW_LINE>System.out.println(cr);<NEW_LINE>System.out.println(byteBuf);<NEW_LINE>// byteBuf.get();<NEW_LINE>cr = dec.decode(byteBuf2, charBuf, false);<NEW_LINE><MASK><NEW_LINE>System.out.println(byteBuf2);<NEW_LINE>}
System.out.println(cr);
164,739
private void addLocals(StyledDocument doc1, StyledDocument doc2, Function function1, Function function2) {<NEW_LINE>Variable[] vars1 = function1.getLocalVariables();<NEW_LINE>Variable[] vars2 = function2.getLocalVariables();<NEW_LINE>if (ProgramDiff.equivalentVariableArrays(vars1, vars2, false)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>addFrameInfo(doc2, "Local Variables: ", "");<NEW_LINE>MultiComparableArrayIterator<Variable> iter = new MultiComparableArrayIterator<>(new Variable[][] { vars1, vars2 });<NEW_LINE>// variables to print to the details for program 1.<NEW_LINE>ArrayList<Variable> varList1 = new ArrayList<>();<NEW_LINE>// variables to print to the details for program 2.<NEW_LINE>ArrayList<Variable> varList2 = new ArrayList<>();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Variable[] vars = iter.next();<NEW_LINE>Variable var1 = vars[0];<NEW_LINE>Variable var2 = vars[1];<NEW_LINE>if (var1 != null && var2 != null && ProgramDiff.equivalentVariables(var1, var2, true)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (var1 != null) {<NEW_LINE>varList1.add(var1);<NEW_LINE>}<NEW_LINE>if (var2 != null) {<NEW_LINE>varList2.add(var2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ArrayList<Variable> allVarsList = new ArrayList<>(varList1);<NEW_LINE>allVarsList.addAll(varList2);<NEW_LINE>Variable[] printVars1 = varList1.toArray(new Variable[varList1.size()]);<NEW_LINE>Variable[] printVars2 = varList2.toArray(new Variable[varList2.size()]);<NEW_LINE>Variable[] combinedVars = allVarsList.toArray(new Variable[allVarsList.size()]);<NEW_LINE>VariableLayout varLayout = getVariableLayout(combinedVars);<NEW_LINE>printLocals(doc1, printVars1, varLayout, vars1.length);<NEW_LINE>printLocals(doc2, printVars2, varLayout, vars2.length);<NEW_LINE>}
addFrameInfo(doc1, "Local Variables: ", "");
972,765
private void createNewPLV(final I_M_PriceList_Version oldCustomerPLV, final I_M_PriceList_Version newBasePLV, final UserId userId) {<NEW_LINE>final I_M_PriceList_Version newCustomerPLV = copy().setSkipCalculatedColumns(true).setFrom(oldCustomerPLV).copyToNew(I_M_PriceList_Version.class);<NEW_LINE>newCustomerPLV.setValidFrom(newBasePLV.getValidFrom());<NEW_LINE>newCustomerPLV.<MASK><NEW_LINE>newCustomerPLV.setM_Pricelist_Version_Base_ID(oldCustomerPLV.getM_PriceList_Version_ID());<NEW_LINE>final PriceListId pricelistId = PriceListId.ofRepoId(oldCustomerPLV.getM_PriceList_ID());<NEW_LINE>final LocalDate validFrom = TimeUtil.asLocalDate(newBasePLV.getValidFrom());<NEW_LINE>if (pricelistId != null && validFrom != null) {<NEW_LINE>final I_M_PriceList priceList = getById(pricelistId);<NEW_LINE>final String plvName = Services.get(IPriceListBL.class).createPLVName(priceList.getName(), validFrom);<NEW_LINE>newCustomerPLV.setName(plvName);<NEW_LINE>}<NEW_LINE>saveRecord(newCustomerPLV);<NEW_LINE>final PriceListVersionId newCustomerPLVId = PriceListVersionId.ofRepoId(newCustomerPLV.getM_PriceList_Version_ID());<NEW_LINE>createProductPricesForPLV(userId, newCustomerPLVId);<NEW_LINE>cloneASIs(newCustomerPLVId);<NEW_LINE>save(newCustomerPLV);<NEW_LINE>}
setM_DiscountSchema_ID(newBasePLV.getM_DiscountSchema_ID());
1,243,750
private static void asynchronousApiCall() {<NEW_LINE>SearchAsyncClient client = createBuilder().buildAsyncClient();<NEW_LINE>List<Hotel> hotels = new ArrayList<>();<NEW_LINE>hotels.add(new Hotel().setHotelId("100"));<NEW_LINE>hotels.add(new Hotel().setHotelId("200"));<NEW_LINE>hotels.add(new Hotel().setHotelId("300"));<NEW_LINE>// Setup context to pass custom x-ms-client-request-id.<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>headers.set("x-ms-client-request-id", UUID.randomUUID().toString());<NEW_LINE>reactor.util.context.Context subscriberContext = reactor.util.context.Context.<MASK><NEW_LINE>// Print out expected 'x-ms-client-request-id' header value.<NEW_LINE>System.out.printf("Sending request with 'x-ms-client-request-id': %s%n", headers.get("x-ms-client-request-id"));<NEW_LINE>// Perform index operations on a list of documents<NEW_LINE>client.mergeDocumentsWithResponse(hotels, null).subscriberContext(subscriberContext).doOnSuccess(response -> {<NEW_LINE>System.out.printf("Indexed %s documents%n", response.getValue().getResults().size());<NEW_LINE>// Print out verification of 'x-ms-client-request-id' returned in the service response.<NEW_LINE>System.out.printf("Received response with returned 'x-ms-client-request-id': %s%n", response.getHeaders().get("x-ms-client-request-id"));<NEW_LINE>}).block();<NEW_LINE>}
of(AddHeadersFromContextPolicy.AZURE_REQUEST_HTTP_HEADERS_KEY, headers);
1,770,273
private boolean isIFixFileListValid(IFixInfo iFixInfo, File wlpInstallationDirectory) throws ParseException {<NEW_LINE>// First get the list of files to check<NEW_LINE>Updates updates = iFixInfo.getUpdates();<NEW_LINE>if (updates == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Set<UpdatedFile> files = updates.getFiles();<NEW_LINE>// For each file work out if it is a feature JAR or not. Can do this based on the name as it will be in the format:<NEW_LINE>// <pathAndName>_1.0.0.v20120424-1111.jar<NEW_LINE>Pattern featureJarPattern = Pattern.compile(".*_([0-9]*\\.){3}v[0-9]{8}-[0-9]{4}\\.jar");<NEW_LINE>DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");<NEW_LINE>for (UpdatedFile file : files) {<NEW_LINE>String fileId = file.getId();<NEW_LINE>boolean isFeatureJar = featureJarPattern.<MASK><NEW_LINE>if (isFeatureJar) {<NEW_LINE>// If it's a feature JAR we just need to see if it is present<NEW_LINE>File jarFile = new File(wlpInstallationDirectory, fileId);<NEW_LINE>if (!jarFile.exists()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// If its not a feature JAR then it means you don't get a unique JAR per iFix so see if the file that is there is the one for this iFix or newer<NEW_LINE>File fileOnDisk = new File(wlpInstallationDirectory, fileId);<NEW_LINE>String fileDate = file.getDate();<NEW_LINE>long metaDataDate = dateFormat.parse(fileDate).getTime();<NEW_LINE>if (metaDataDate > fileOnDisk.lastModified()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
matcher(fileId).matches();
1,227,091
/* (non-Javadoc)<NEW_LINE>* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void modifyText(ModifyEvent arg0) {<NEW_LINE>String fName = file.getText();<NEW_LINE>wizard.savePath = fName;<NEW_LINE>String error = "";<NEW_LINE>if (!fName.equals("")) {<NEW_LINE>File f = new File(file.getText());<NEW_LINE>if (f.isDirectory() || (f.getParentFile() != null && !f.getParentFile().canWrite())) {<NEW_LINE>error = MessageText.getString("wizard.maketorrent.invalidfile");<NEW_LINE>} else {<NEW_LINE>String parent = f.getParent();<NEW_LINE>if (parent != null) {<NEW_LINE>wizard.setDefaultSaveDir(parent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>wizard.setErrorMessage(error);<NEW_LINE>wizard.setFinishEnabled(!wizard.savePath.equals("") <MASK><NEW_LINE>}
&& error.equals(""));
1,264,831
private void initListeners() {<NEW_LINE>selectedActionsList.addMouseListener(new DoubleClickDelegator((actionReference) -> {<NEW_LINE>selectedActionsListModel.removeElement(actionReference);<NEW_LINE>changer.changed();<NEW_LINE>}));<NEW_LINE>selectedActionsList.addListSelectionListener(e -> {<NEW_LINE>boolean hasSelection = e.getFirstIndex() != -1;<NEW_LINE>moveUpButton.setEnabled(hasSelection);<NEW_LINE>moveDownButton.setEnabled(hasSelection);<NEW_LINE>});<NEW_LINE>availableActionsList.addMouseListener(new DoubleClickDelegator((actionReference) -> {<NEW_LINE>selectedActionsListModel.addElement(actionReference);<NEW_LINE>changer.changed();<NEW_LINE>}));<NEW_LINE>moveUpButton.addActionListener(e -> {<NEW_LINE>int selectedIndex = selectedActionsList.getSelectedIndex();<NEW_LINE>swap(selectedIndex, selectedIndex - 1);<NEW_LINE>selectedActionsList.setSelectedIndex(selectedIndex - 1);<NEW_LINE>selectedActionsList.ensureIndexIsVisible(selectedIndex - 1);<NEW_LINE>changer.changed();<NEW_LINE>});<NEW_LINE>moveDownButton.addActionListener(e -> {<NEW_LINE>int selectedIndex = selectedActionsListModel.<MASK><NEW_LINE>swap(selectedIndex, selectedIndex + 1);<NEW_LINE>selectedActionsList.setSelectedIndex(selectedIndex + 1);<NEW_LINE>selectedActionsList.ensureIndexIsVisible(selectedIndex + 1);<NEW_LINE>changer.changed();<NEW_LINE>});<NEW_LINE>}
indexOf(selectedActionsList.getSelectedValue());
1,255,675
public void store() {<NEW_LINE>BrandingModel branding = getBranding();<NEW_LINE>SplashUISupport.setValue(branding.getSplashRunningTextFontSize(), SplashUISupport.numberToString((Number) fontSize.getValue()));<NEW_LINE>SplashUISupport.setValue(branding.getSplashRunningTextBounds(), SplashUISupport.boundsToString((Rectangle) runningTextBounds.getValue()));<NEW_LINE>SplashUISupport.setValue(branding.getSplashProgressBarBounds(), SplashUISupport.boundsToString((Rectangle) progressBarBounds.getValue()));<NEW_LINE>if (textColor.getColor() != null) {<NEW_LINE>SplashUISupport.setValue(branding.getSplashRunningTextColor(), SplashUISupport.colorToString(textColor.getColor()));<NEW_LINE>}<NEW_LINE>if (barColor.getColor() != null) {<NEW_LINE>SplashUISupport.setValue(branding.getSplashProgressBarColor(), SplashUISupport.colorToString(barColor.getColor()));<NEW_LINE>}<NEW_LINE>// these colors below has a little effect on resulting branded splash<NEW_LINE>// then user can't adjust it from UI<NEW_LINE>// edgeColor.setColor(SplashUISupport.stringToColor(branding.getSplashProgressBarEdgeColor().getValue()));<NEW_LINE>// cornerColor.setColor(SplashUISupport.stringToColor(branding.getSplashProgressBarCornerColor().getValue()));<NEW_LINE>SplashUISupport.setValue(branding.getSplashShowProgressBar(), Boolean.toString(progressBarEnabled.isSelected()));<NEW_LINE>BrandedFile splash = branding.getSplash();<NEW_LINE>if (splash != null) {<NEW_LINE>splash.setBrandingSource(splashSource);<NEW_LINE>}<NEW_LINE>Image image = splashImage.image;<NEW_LINE>if (image != null) {<NEW_LINE>SplashUISupport.setValue(branding.getSplashWidth(), Integer.toString(image.getWidth(null), 10));<NEW_LINE>SplashUISupport.setValue(branding.getSplashHeight(), Integer.toString(image.<MASK><NEW_LINE>}<NEW_LINE>}
getHeight(null), 10));
1,757,320
private V putInternal(K key, int hash, V value, Function<? super K, ? extends V> function, boolean onlyIfAbsent) {<NEW_LINE>removeStale();<NEW_LINE>int c = count;<NEW_LINE>// ensure capacity<NEW_LINE>if (c++ > threshold) {<NEW_LINE>int reduced = rehash();<NEW_LINE>// adjust from possible weak cleanups<NEW_LINE>if (reduced > 0) {<NEW_LINE>// write-volatile<NEW_LINE>count = (c -= reduced) - 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>HashEntry<K, V>[] tab = table;<NEW_LINE>int index = hash & (tab.length - 1);<NEW_LINE>HashEntry<K, V> first = tab[index];<NEW_LINE>HashEntry<K, V> e = first;<NEW_LINE>while (e != null && (e.hash != hash || !keyEq(key, e.key()))) {<NEW_LINE>e = e.next;<NEW_LINE>}<NEW_LINE>V resultValue;<NEW_LINE>if (e != null) {<NEW_LINE>resultValue = e.value();<NEW_LINE>if (!onlyIfAbsent) {<NEW_LINE>e.setValue(getValue(key, value<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>V v = getValue(key, value, function);<NEW_LINE>resultValue = function != null ? v : null;<NEW_LINE>if (v != null) {<NEW_LINE>++modCount;<NEW_LINE>tab[index] = newHashEntry(key, hash, first, v);<NEW_LINE>// write-volatile<NEW_LINE>count = c;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resultValue;<NEW_LINE>}
, function), valueType, refQueue);
215,181
public AwsCloudFrontDistributionOriginGroups unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsCloudFrontDistributionOriginGroups awsCloudFrontDistributionOriginGroups = new AwsCloudFrontDistributionOriginGroups();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Items", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>awsCloudFrontDistributionOriginGroups.setItems(new ListUnmarshaller<AwsCloudFrontDistributionOriginGroup>(AwsCloudFrontDistributionOriginGroupJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return awsCloudFrontDistributionOriginGroups;<NEW_LINE>}
)).unmarshall(context));
134,410
private void convertDocument(Schema schema, ParsedDocument parsed, ConvertParsedFields fieldConverter) {<NEW_LINE>SDDocumentType document = new SDDocumentType(parsed.name());<NEW_LINE>for (String inherit : parsed.getInherited()) {<NEW_LINE>var parent = convertedDocuments.get(inherit);<NEW_LINE>assert (parent != null);<NEW_LINE>document.inherit(parent);<NEW_LINE>}<NEW_LINE>for (var struct : parsed.getStructs()) {<NEW_LINE>var structProxy = fieldConverter.convertStructDeclaration(schema, document, struct);<NEW_LINE>var old = document.getType(struct.name());<NEW_LINE>if (old == null) {<NEW_LINE>document.addType(structProxy);<NEW_LINE>} else {<NEW_LINE>var oldFields = old.fieldSet();<NEW_LINE>var newFields = structProxy.fieldSet();<NEW_LINE>if (!newFields.equals(oldFields)) {<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>}<NEW_LINE>deployLogger.logApplicationPackage(Level.WARNING, "Duplicate struct declaration for: " + struct.name());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (var annotation : parsed.getAnnotations()) {<NEW_LINE>fieldConverter.convertAnnotation(schema, document, annotation);<NEW_LINE>}<NEW_LINE>for (var field : parsed.getFields()) {<NEW_LINE>var sdf = fieldConverter.convertDocumentField(schema, document, field);<NEW_LINE>if (field.hasIdOverride()) {<NEW_LINE>document.setFieldId(sdf, field.idOverride());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>convertedDocuments.put(parsed.name(), document);<NEW_LINE>schema.addDocument(document);<NEW_LINE>}
"Cannot modify already-existing struct: " + struct.name());
1,231,894
public JsonElement serialize(Object src, Type typeOfSrc, JsonSerializationContext context) {<NEW_LINE>JsonObject object = new JsonObject();<NEW_LINE>if (typeOfSrc.equals(AuditWrapper.class)) {<NEW_LINE>AuditWrapper auditWrapper = (AuditWrapper) src;<NEW_LINE>object.addProperty("user_id", auditWrapper.getUser().getId());<NEW_LINE>object.addProperty("username", auditWrapper.getUser().getUsername());<NEW_LINE>object.addProperty("user_type", auditWrapper.getUser().getUserType());<NEW_LINE>object.addProperty("first_nm", auditWrapper.getUser().getFirstNm());<NEW_LINE>object.addProperty("last_nm", auditWrapper.getUser().getLastNm());<NEW_LINE>object.addProperty("email", auditWrapper.getUser().getEmail());<NEW_LINE>object.addProperty("session_id", auditWrapper.getSessionOutput().getSessionId());<NEW_LINE>object.addProperty("instance_id", auditWrapper.getSessionOutput().getInstanceId());<NEW_LINE>object.addProperty("host_id", auditWrapper.<MASK><NEW_LINE>object.addProperty("host", auditWrapper.getSessionOutput().getDisplayLabel());<NEW_LINE>object.addProperty("output", auditWrapper.getSessionOutput().getOutput().toString());<NEW_LINE>object.addProperty("timestamp", new Date().getTime());<NEW_LINE>}<NEW_LINE>return object;<NEW_LINE>}
getSessionOutput().getId());
1,034,402
public Container copy(final Container source, Host destination, final User user, final boolean respectFrontendRoles) throws DotDataException, DotSecurityException {<NEW_LINE>if (!permissionAPI.doesUserHavePermission(source, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) {<NEW_LINE>throw new DotSecurityException("You don't have permission to read the source container.");<NEW_LINE>}<NEW_LINE>if (!permissionAPI.doesUserHavePermission(destination, PermissionAPI.PERMISSION_WRITE, user, respectFrontendRoles)) {<NEW_LINE>throw new DotSecurityException("You don't have permission to wirte in the destination folder.");<NEW_LINE>}<NEW_LINE>// gets the new information for the template from the request object<NEW_LINE>final Container newContainer = new Container();<NEW_LINE>newContainer.copy(source);<NEW_LINE>final String appendToName = getAppendToContainerTitle(source.getTitle(), destination);<NEW_LINE>newContainer.setFriendlyName(source.getFriendlyName() + appendToName);<NEW_LINE>newContainer.setTitle(source.getTitle() + appendToName);<NEW_LINE>// creates new identifier for this webasset and persists it<NEW_LINE>final Identifier newIdentifier = APILocator.getIdentifierAPI().createNew(newContainer, destination);<NEW_LINE>newContainer.setIdentifier(newIdentifier.getId());<NEW_LINE>// persists the webasset<NEW_LINE>save(newContainer);<NEW_LINE>if (source.isWorking()) {<NEW_LINE>APILocator.getVersionableAPI().setWorking(newContainer);<NEW_LINE>}<NEW_LINE>if (source.isLive()) {<NEW_LINE>APILocator.getVersionableAPI().setLive(newContainer);<NEW_LINE>}<NEW_LINE>// issue-2093 Copying multiple structures per container<NEW_LINE>if (source.getMaxContentlets() > 0) {<NEW_LINE>final List<<MASK><NEW_LINE>final List<ContainerStructure> newContainerCS = new LinkedList<ContainerStructure>();<NEW_LINE>for (final ContainerStructure oldCS : sourceCS) {<NEW_LINE>final ContainerStructure newCS = new ContainerStructure();<NEW_LINE>newCS.setContainerId(newContainer.getIdentifier());<NEW_LINE>newCS.setContainerInode(newContainer.getInode());<NEW_LINE>newCS.setStructureId(oldCS.getStructureId());<NEW_LINE>newCS.setCode(oldCS.getCode());<NEW_LINE>newContainerCS.add(newCS);<NEW_LINE>}<NEW_LINE>saveContainerStructures(newContainerCS);<NEW_LINE>}<NEW_LINE>// Copy permissions<NEW_LINE>permissionAPI.copyPermissions(source, newContainer);<NEW_LINE>// saves to working folder under velocity<NEW_LINE>new ContainerLoader().invalidate(newContainer);<NEW_LINE>return newContainer;<NEW_LINE>}
ContainerStructure> sourceCS = getContainerStructures(source);
598,346
private void handleSecurityPermissions(Node node, BeanDefinitionBuilder securityConfigBuilder) {<NEW_LINE>Set<BeanDefinition> permissions = new ManagedSet<>();<NEW_LINE>NamedNodeMap attributes = node.getAttributes();<NEW_LINE>Node onJoinOpAttribute = attributes.getNamedItem("on-join-operation");<NEW_LINE>if (onJoinOpAttribute != null) {<NEW_LINE>String onJoinOp = getTextContent(onJoinOpAttribute);<NEW_LINE>OnJoinPermissionOperationName onJoinPermissionOperation = OnJoinPermissionOperationName.valueOf(upperCaseInternal(onJoinOp));<NEW_LINE>securityConfigBuilder.addPropertyValue("onJoinPermissionOperation", onJoinPermissionOperation);<NEW_LINE>}<NEW_LINE>for (Node child : childElements(node)) {<NEW_LINE>String nodeName = cleanNodeName(child);<NEW_LINE>PermissionType type = PermissionType.getType(nodeName);<NEW_LINE>if (type == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>handleSecurityPermission(child, permissions, type);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
securityConfigBuilder.addPropertyValue("clientPermissionConfigs", permissions);
1,159,821
static void blickActionMapImpl(ActionMap map, Component[] focus) {<NEW_LINE>assert EventQueue.isDispatchThread();<NEW_LINE>Object obj = Lookup.getDefault(<MASK><NEW_LINE>if (obj instanceof GlobalActionContextImpl) {<NEW_LINE>GlobalActionContextImpl g = (GlobalActionContextImpl) obj;<NEW_LINE>Lookup[] arr = { map == null ? Lookup.EMPTY : Lookups.singleton(map), Lookups.exclude(g.getLookup(), new Class[] { javax.swing.ActionMap.class }) };<NEW_LINE>Lookup originalLkp = g.getLookup();<NEW_LINE>Lookup prev = temporary;<NEW_LINE>try {<NEW_LINE>temporary = new ProxyLookup(arr);<NEW_LINE>Lookup actionsGlobalContext = Utilities.actionsGlobalContext();<NEW_LINE>Object q = actionsGlobalContext.lookup(javax.swing.ActionMap.class);<NEW_LINE>assert q == map : dumpActionMapInfo(map, q, prev, temporary, actionsGlobalContext, originalLkp);<NEW_LINE>if (focus != null) {<NEW_LINE>setFocusOwner(focus[0]);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>temporary = prev;<NEW_LINE>// fire the changes about return of the values back<NEW_LINE>org.openide.util.Utilities.actionsGlobalContext().lookup(javax.swing.ActionMap.class);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).lookup(ContextGlobalProvider.class);
557,783
public void marshall(ImageRecipeSummary imageRecipeSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (imageRecipeSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(imageRecipeSummary.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(imageRecipeSummary.getPlatform(), PLATFORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(imageRecipeSummary.getOwner(), OWNER_BINDING);<NEW_LINE>protocolMarshaller.marshall(imageRecipeSummary.getParentImage(), PARENTIMAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(imageRecipeSummary.getDateCreated(), DATECREATED_BINDING);<NEW_LINE>protocolMarshaller.marshall(imageRecipeSummary.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
imageRecipeSummary.getName(), NAME_BINDING);
249,564
public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {<NEW_LINE>com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(this.getUnknownFields());<NEW_LINE>while (true) {<NEW_LINE>int tag = input.readTag();<NEW_LINE>switch(tag) {<NEW_LINE>case 0:<NEW_LINE>this.setUnknownFields(unknownFields.build());<NEW_LINE>return this;<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {<NEW_LINE>this.setUnknownFields(unknownFields.build());<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 10:<NEW_LINE>{<NEW_LINE>voldemort.client.protocol.pb.VProto.KeyedVersions.Builder subBuilder = voldemort.client.protocol.pb.VProto.KeyedVersions.newBuilder();<NEW_LINE>input.readMessage(subBuilder, extensionRegistry);<NEW_LINE>addValues(subBuilder.buildPartial());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case 18:<NEW_LINE>{<NEW_LINE>voldemort.client.protocol.pb.VProto.Error.Builder subBuilder = voldemort.client.protocol.pb<MASK><NEW_LINE>if (hasError()) {<NEW_LINE>subBuilder.mergeFrom(getError());<NEW_LINE>}<NEW_LINE>input.readMessage(subBuilder, extensionRegistry);<NEW_LINE>setError(subBuilder.buildPartial());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.VProto.Error.newBuilder();
223,252
private <T> MultiNodeResult<T> collectResults(Map<NodeExecution, Future<NodeResult<T>>> futures) {<NEW_LINE>boolean done = false;<NEW_LINE>MultiNodeResult<T> <MASK><NEW_LINE>Map<RedisClusterNode, Throwable> exceptions = new HashMap<>();<NEW_LINE>Set<String> saveGuard = new HashSet<>();<NEW_LINE>while (!done) {<NEW_LINE>done = true;<NEW_LINE>for (Map.Entry<NodeExecution, Future<NodeResult<T>>> entry : futures.entrySet()) {<NEW_LINE>if (!entry.getValue().isDone() && !entry.getValue().isCancelled()) {<NEW_LINE>done = false;<NEW_LINE>} else {<NEW_LINE>NodeExecution execution = entry.getKey();<NEW_LINE>try {<NEW_LINE>String futureId = ObjectUtils.getIdentityHexString(entry.getValue());<NEW_LINE>if (!saveGuard.contains(futureId)) {<NEW_LINE>if (execution.isPositional()) {<NEW_LINE>result.add(execution.getPositionalKey(), entry.getValue().get());<NEW_LINE>} else {<NEW_LINE>result.add(entry.getValue().get());<NEW_LINE>}<NEW_LINE>saveGuard.add(futureId);<NEW_LINE>}<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>RuntimeException ex = convertToDataAccessException((Exception) e.getCause());<NEW_LINE>exceptions.put(execution.getNode(), ex != null ? ex : e.getCause());<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>RuntimeException ex = convertToDataAccessException((Exception) e.getCause());<NEW_LINE>exceptions.put(execution.getNode(), ex != null ? ex : e.getCause());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(10);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>done = true;<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!exceptions.isEmpty()) {<NEW_LINE>throw new ClusterCommandExecutionFailureException(new ArrayList<>(exceptions.values()));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
result = new MultiNodeResult<>();
1,124,049
public void finishedFiltersWithNullTarget(ServletRequest request, ServletResponse response, RequestProcessor requestProcessor) throws NoTargetForURIException {<NEW_LINE>// a filter could potentially send on a ServletRequest instead of<NEW_LINE>// HttpServletRequest<NEW_LINE>HttpServletRequest httpRequest = (HttpServletRequest) ServletUtil.<MASK><NEW_LINE>HttpServletResponse httpResponse = (HttpServletResponse) ServletUtil.unwrapResponse(response, HttpServletResponse.class);<NEW_LINE>String requestURI = httpRequest.getRequestURI();<NEW_LINE>// WAS does this instead of the above:<NEW_LINE>NoTargetForURIException nt = new NoTargetForURIException(requestURI);<NEW_LINE>WebAppErrorReport r = new WebAppErrorReport(nt);<NEW_LINE>if (requestProcessor != null && requestProcessor instanceof ServletWrapper) {<NEW_LINE>r.setTargetServletName(((ServletWrapper) requestProcessor).getServletName());<NEW_LINE>} else {<NEW_LINE>r.setTargetServletName(requestURI);<NEW_LINE>}<NEW_LINE>r.setErrorCode(HttpServletResponse.SC_NOT_FOUND);<NEW_LINE>this.sendError(httpRequest, httpResponse, r);<NEW_LINE>}
unwrapRequest(request, HttpServletRequest.class);
68,627
public static long LLVMDIBuilderCreateStaticMemberType(@NativeType("LLVMDIBuilderRef") long Builder, @NativeType("LLVMMetadataRef") long Scope, @NativeType("char const *") CharSequence Name, @NativeType("LLVMMetadataRef") long File, @NativeType("unsigned int") int LineNumber, @NativeType("LLVMMetadataRef") long Type, @NativeType("LLVMDIFlags") int Flags, @NativeType("LLVMValueRef") long ConstantVal, @NativeType("uint32_t") int AlignInBits) {<NEW_LINE>MemoryStack stack = stackGet();<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>int NameEncodedLength = stack.nUTF8(Name, false);<NEW_LINE>long NameEncoded = stack.getPointerAddress();<NEW_LINE>return nLLVMDIBuilderCreateStaticMemberType(Builder, Scope, NameEncoded, NameEncodedLength, File, LineNumber, Type, Flags, ConstantVal, AlignInBits);<NEW_LINE>} finally {<NEW_LINE>stack.setPointer(stackPointer);<NEW_LINE>}<NEW_LINE>}
int stackPointer = stack.getPointer();
1,078,583
private boolean isSetpointHigh(Map<Clutch.Metric, UpdateDoublesSketch> sketches) {<NEW_LINE>double cpuMedian = sketches.get(Clutch.Metric.CPU).getQuantile(0.5);<NEW_LINE>double networkMedian = sketches.get(Clutch.Metric.NETWORK).getQuantile(0.5);<NEW_LINE>// TODO: How do we ensure we're not just always operating in a tight range?<NEW_LINE>boolean cpuTooHigh = cpuMedian > trueCpuMax.get() * 0.8 && cpuMedian > trueCpuMin.get() * 1.2;<NEW_LINE>boolean networkTooHigh = networkMedian > trueNetworkMax.get() * 0.8 && networkMedian > trueNetworkMin.get() * 1.2;<NEW_LINE>if (cpuTooHigh) {<NEW_LINE>logger.info("CPU running too hot for stage {} with median {} and max {}. Recommending reduction in setPoint.", stageNumber, cpuMedian, trueCpuMax.get());<NEW_LINE>}<NEW_LINE>if (networkTooHigh) {<NEW_LINE>logger.info("Network running too hot for stage {} with median {} and max {}. Recommending reduction in setPoint.", stageNumber, <MASK><NEW_LINE>}<NEW_LINE>return cpuTooHigh || networkTooHigh;<NEW_LINE>}
cpuMedian, trueNetworkMax.get());
562,910
default void populateDatastreamGroupIdInMetadata(Datastream datastream, List<Datastream> allDatastreams, Optional<Logger> logger) {<NEW_LINE>String <MASK><NEW_LINE>List<Datastream> existingDatastreamsWithGroupIdOverride = allDatastreams.stream().filter(DatastreamUtils::containsTaskPrefix).filter(ds -> DatastreamUtils.getTaskPrefix(ds).equals(datastreamTaskPrefix)).filter(ds -> ds.getMetadata().containsKey(DatastreamMetadataConstants.GROUP_ID)).collect(Collectors.toList());<NEW_LINE>String groupId;<NEW_LINE>// if group ID is specified in metadata, use it directly<NEW_LINE>if (datastream.getMetadata().containsKey(DatastreamMetadataConstants.GROUP_ID)) {<NEW_LINE>groupId = datastream.getMetadata().get(DatastreamMetadataConstants.GROUP_ID);<NEW_LINE>logger.ifPresent(log -> log.info("Datastream {} has group ID specified in metadata. Will use that ID: {}", datastream.getName(), groupId));<NEW_LINE>} else if (!existingDatastreamsWithGroupIdOverride.isEmpty()) {<NEW_LINE>// if existing datastream has group ID in it already, copy it over.<NEW_LINE>groupId = existingDatastreamsWithGroupIdOverride.get(0).getMetadata().get(DatastreamMetadataConstants.GROUP_ID);<NEW_LINE>logger.ifPresent(log -> log.info("Found existing datastream {} for datastream {} with group ID. Copying its group id: {}", existingDatastreamsWithGroupIdOverride.get(0).getName(), datastream.getName(), groupId));<NEW_LINE>} else {<NEW_LINE>// else create and and keep it in metadata.<NEW_LINE>groupId = constructGroupId(datastream);<NEW_LINE>logger.ifPresent(log -> log.info("Constructed group ID for datastream {}. Group id: {}", datastream.getName(), groupId));<NEW_LINE>}<NEW_LINE>datastream.getMetadata().put(DatastreamMetadataConstants.GROUP_ID, groupId);<NEW_LINE>}
datastreamTaskPrefix = DatastreamUtils.getTaskPrefix(datastream);
234,395
public void resolve(final ResolveContext resolveContext, final DependencyGraphVisitor modelVisitor, boolean includeSyntheticDependencies) {<NEW_LINE>IdGenerator<Long> idGenerator = new LongIdGenerator();<NEW_LINE>DefaultBuildableComponentResolveResult rootModule = new DefaultBuildableComponentResolveResult();<NEW_LINE>moduleResolver.resolve(resolveContext, rootModule);<NEW_LINE>int graphSize = estimateSize(resolveContext);<NEW_LINE>ResolutionStrategyInternal resolutionStrategy = resolveContext.getResolutionStrategy();<NEW_LINE>List<? extends DependencyMetadata> syntheticDependencies = includeSyntheticDependencies ? syntheticDependenciesOf(rootModule, resolveContext.getName()) : Collections.emptyList();<NEW_LINE>final ResolveState resolveState = new ResolveState(idGenerator, rootModule, resolveContext.getName(), idResolver, metaDataResolver, edgeFilter, attributesSchema, moduleExclusions, componentSelectorConverter, attributesFactory, dependencySubstitutionApplicator, versionSelectorScheme, versionComparator, versionParser, moduleConflictHandler.getResolver(), graphSize, resolveContext.getResolutionStrategy().getConflictResolution(), syntheticDependencies, conflictTracker);<NEW_LINE>Map<ModuleVersionIdentifier, ComponentIdentifier> componentIdentifierCache = Maps.newHashMapWithExpectedSize(graphSize / 2);<NEW_LINE>traverseGraph(resolveState, componentIdentifierCache);<NEW_LINE>validateGraph(resolveState, resolutionStrategy.isFailingOnDynamicVersions(<MASK><NEW_LINE>assembleResult(resolveState, modelVisitor);<NEW_LINE>}
), resolutionStrategy.isFailingOnChangingVersions());
134,188
public void initSubDevices() {<NEW_LINE>ModelFactory factory = ModelFactory.eINSTANCE;<NEW_LINE>ColorColor color = factory.createColorColor();<NEW_LINE><MASK><NEW_LINE>String subIdColor = "color";<NEW_LINE>color.setSubId(subIdColor);<NEW_LINE>logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdColor);<NEW_LINE>color.init();<NEW_LINE>color.setMbrick(this);<NEW_LINE>ColorColorTemperature temperature = factory.createColorColorTemperature();<NEW_LINE>temperature.setUid(getUid());<NEW_LINE>String subIdTemperature = "temperature";<NEW_LINE>temperature.setSubId(subIdTemperature);<NEW_LINE>logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdTemperature);<NEW_LINE>temperature.init();<NEW_LINE>temperature.setMbrick(this);<NEW_LINE>ColorIlluminance illuminance = factory.createColorIlluminance();<NEW_LINE>illuminance.setUid(getUid());<NEW_LINE>String subIdIlluminance = "illuminance";<NEW_LINE>illuminance.setSubId(subIdIlluminance);<NEW_LINE>logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdIlluminance);<NEW_LINE>illuminance.init();<NEW_LINE>illuminance.setMbrick(this);<NEW_LINE>ColorLed led = factory.createColorLed();<NEW_LINE>led.setUid(getUid());<NEW_LINE>String subIdLed = "led";<NEW_LINE>led.setSubId(subIdLed);<NEW_LINE>logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdLed);<NEW_LINE>led.init();<NEW_LINE>led.setMbrick(this);<NEW_LINE>}
color.setUid(getUid());
1,615,408
public static RestoreInProgress updateRestoreStateWithDeletedIndices(RestoreInProgress oldRestore, Set<Index> deletedIndices) {<NEW_LINE>boolean changesMade = false;<NEW_LINE>RestoreInProgress.Builder builder = new RestoreInProgress.Builder();<NEW_LINE>for (RestoreInProgress.Entry entry : oldRestore) {<NEW_LINE>ImmutableOpenMap.Builder<ShardId, ShardRestoreStatus> shardsBuilder = null;<NEW_LINE>for (ObjectObjectCursor<ShardId, ShardRestoreStatus> cursor : entry.shards()) {<NEW_LINE>ShardId shardId = cursor.key;<NEW_LINE>if (deletedIndices.contains(shardId.getIndex())) {<NEW_LINE>changesMade = true;<NEW_LINE>if (shardsBuilder == null) {<NEW_LINE>shardsBuilder = ImmutableOpenMap.builder(entry.shards());<NEW_LINE>}<NEW_LINE>shardsBuilder.put(shardId, new ShardRestoreStatus(null, RestoreInProgress<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (shardsBuilder != null) {<NEW_LINE>ImmutableOpenMap<ShardId, ShardRestoreStatus> shards = shardsBuilder.build();<NEW_LINE>builder.add(new RestoreInProgress.Entry(entry.uuid(), entry.snapshot(), overallState(RestoreInProgress.State.STARTED, shards), entry.indices(), shards));<NEW_LINE>} else {<NEW_LINE>builder.add(entry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changesMade) {<NEW_LINE>return builder.build();<NEW_LINE>} else {<NEW_LINE>return oldRestore;<NEW_LINE>}<NEW_LINE>}
.State.FAILURE, "index was deleted"));
357,937
private BeanDefinition buildListenerContainer(Element element, ParserContext parserContext) {<NEW_LINE>if (!element.hasAttribute("queue-names")) {<NEW_LINE>parserContext.getReaderContext().error("If no 'listener-container' reference is provided, " + "the 'queue-names' attribute is required.", element);<NEW_LINE>}<NEW_LINE>String consumersPerQueue = element.getAttribute("consumers-per-queue");<NEW_LINE>BeanDefinitionBuilder builder;<NEW_LINE>if (StringUtils.hasText(consumersPerQueue)) {<NEW_LINE>builder = BeanDefinitionBuilder.genericBeanDefinition(DirectMessageListenerContainer.class);<NEW_LINE>if (StringUtils.hasText(element.getAttribute("concurrent-consumers"))) {<NEW_LINE>parserContext.getReaderContext().error("'consumers-per-queue' and 'concurrent-consumers' are mutually " + "exclusive", element);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(element.getAttribute("tx-size"))) {<NEW_LINE>parserContext.getReaderContext().error("'tx-size' is not allowed with 'consumers-per-queue'", element);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(element.getAttribute("receive-timeout"))) {<NEW_LINE>parserContext.getReaderContext().error("'receive-timeout' is not allowed with 'consumers-per-queue'", element);<NEW_LINE>}<NEW_LINE>builder.addPropertyValue("consumersPerQueue", consumersPerQueue);<NEW_LINE>} else {<NEW_LINE>builder = BeanDefinitionBuilder.genericBeanDefinition(SimpleMessageListenerContainer.class);<NEW_LINE>}<NEW_LINE>String connectionFactoryRef = element.getAttribute("connection-factory");<NEW_LINE>if (!StringUtils.hasText(connectionFactoryRef)) {<NEW_LINE>connectionFactoryRef = "rabbitConnectionFactory";<NEW_LINE>}<NEW_LINE>builder.addConstructorArgReference(connectionFactoryRef);<NEW_LINE>for (String attributeName : CONTAINER_VALUE_ATTRIBUTES) {<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, attributeName);<NEW_LINE>}<NEW_LINE>for (String attributeName : CONTAINER_REFERENCE_ATTRIBUTES) {<NEW_LINE>IntegrationNamespaceUtils.<MASK><NEW_LINE>}<NEW_LINE>return builder.getBeanDefinition();<NEW_LINE>}
setReferenceIfAttributeDefined(builder, element, attributeName);
1,255,816
private void dynInit(boolean createNew) {<NEW_LINE>// Resource<NEW_LINE>fillResourceType();<NEW_LINE>fillResource();<NEW_LINE>fieldResourceType.<MASK><NEW_LINE>fieldResource.addEventListener(Events.ON_SELECT, this);<NEW_LINE>// Date - Elaine 2008/12/12<NEW_LINE>fieldDate.setValue(m_dateFrom);<NEW_LINE>fieldDate.getDatebox().addEventListener(Events.ON_BLUR, this);<NEW_LINE>fieldDate.getTimebox().addEventListener(Events.ON_BLUR, this);<NEW_LINE>// fieldDate.addEventListener(Events.ON_BLUR, this);<NEW_LINE>bPrevious.addEventListener(Events.ON_CLICK, this);<NEW_LINE>bNext.addEventListener(Events.ON_CLICK, this);<NEW_LINE>//<NEW_LINE>//<NEW_LINE>confirmPanel.addActionListener(Events.ON_CLICK, this);<NEW_LINE>if (createNew) {<NEW_LINE>Button btnNew = new Button();<NEW_LINE>btnNew.setName("btnNew");<NEW_LINE>btnNew.setId("New");<NEW_LINE>btnNew.setSrc("/images/New24.png");<NEW_LINE>confirmPanel.addComponentsLeft(btnNew);<NEW_LINE>btnNew.addEventListener(Events.ON_CLICK, this);<NEW_LINE>}<NEW_LINE>displayCalendar();<NEW_LINE>}
addEventListener(Events.ON_SELECT, this);
1,102,423
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudDirectory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,454,847
// Using the example in the book<NEW_LINE>public static void main(String[] args) {<NEW_LINE>List<String> students = new ArrayList<>();<NEW_LINE>students.add("Alice");<NEW_LINE>students.add("Bob");<NEW_LINE>students.add("Carol");<NEW_LINE>students.add("Dave");<NEW_LINE>students.add("Eliza");<NEW_LINE>students.add("Frank");<NEW_LINE>List<String> companies = new ArrayList<>();<NEW_LINE>companies.add("Adobe");<NEW_LINE>companies.add("Amazon");<NEW_LINE>companies.add("Facebook");<NEW_LINE>companies.add("Google");<NEW_LINE>companies.add("IBM");<NEW_LINE>companies.add("Yahoo");<NEW_LINE>SeparateChainingHashST<String, List<String>> preferences = new SeparateChainingHashST<>();<NEW_LINE>List<String> alicePreferences = new ArrayList<>();<NEW_LINE>alicePreferences.add("Adobe");<NEW_LINE>alicePreferences.add("Amazon");<NEW_LINE>alicePreferences.add("Facebook");<NEW_LINE>preferences.put("Alice", alicePreferences);<NEW_LINE>List<String> bobPreferences = new ArrayList<>();<NEW_LINE>bobPreferences.add("Adobe");<NEW_LINE>bobPreferences.add("Amazon");<NEW_LINE>bobPreferences.add("Yahoo");<NEW_LINE>preferences.put("Bob", bobPreferences);<NEW_LINE>List<String> carolPreferences = new ArrayList<>();<NEW_LINE>carolPreferences.add("Facebook");<NEW_LINE>carolPreferences.add("Google");<NEW_LINE>carolPreferences.add("IBM");<NEW_LINE>preferences.put("Carol", carolPreferences);<NEW_LINE>List<String> davePreferences = new ArrayList<>();<NEW_LINE>davePreferences.add("Adobe");<NEW_LINE>davePreferences.add("Amazon");<NEW_LINE>preferences.put("Dave", davePreferences);<NEW_LINE>List<String> elizaPreferences = new ArrayList<>();<NEW_LINE>elizaPreferences.add("Google");<NEW_LINE>elizaPreferences.add("IBM");<NEW_LINE>elizaPreferences.add("Yahoo");<NEW_LINE><MASK><NEW_LINE>List<String> frankPreferences = new ArrayList<>();<NEW_LINE>frankPreferences.add("IBM");<NEW_LINE>frankPreferences.add("Yahoo");<NEW_LINE>preferences.put("Frank", frankPreferences);<NEW_LINE>new Exercise45_JobPlacement().solveJobPlacement(students, companies, preferences);<NEW_LINE>}
preferences.put("Eliza", elizaPreferences);
380,783
public void layoutContainer(Container container) {<NEW_LINE>Insets insets = container.getInsets();<NEW_LINE>int i = container.getSize().height - (insets.top + insets.bottom + vGap * 2);<NEW_LINE>int j = container.getSize().width - (insets.left + insets.right + hGap * 2);<NEW_LINE>int k = container.getComponentCount();<NEW_LINE>int l = insets.left + hGap;<NEW_LINE>int i1 = 0;<NEW_LINE>int j1 = 0;<NEW_LINE>int k1 = 0;<NEW_LINE>for (int l1 = 0; l1 < k; l1++) {<NEW_LINE>Component <MASK><NEW_LINE>if (!component.isVisible())<NEW_LINE>continue;<NEW_LINE>Dimension dimension = component.getPreferredSize();<NEW_LINE>if (myVerticalFill && l1 == k - 1) {<NEW_LINE>dimension.height = Math.max(i - i1, component.getPreferredSize().height);<NEW_LINE>}<NEW_LINE>if (myHorizontalFill) {<NEW_LINE>component.setSize(j, dimension.height);<NEW_LINE>dimension.width = j;<NEW_LINE>} else {<NEW_LINE>component.setSize(dimension.width, dimension.height);<NEW_LINE>}<NEW_LINE>if (i1 + dimension.height > i) {<NEW_LINE>a(container, l, insets.top + vGap, j1, i - i1, k1, l1);<NEW_LINE>i1 = dimension.height;<NEW_LINE>l += hGap + j1;<NEW_LINE>j1 = dimension.width;<NEW_LINE>k1 = l1;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (i1 > 0) {<NEW_LINE>i1 += vGap;<NEW_LINE>}<NEW_LINE>i1 += dimension.height;<NEW_LINE>j1 = Math.max(j1, dimension.width);<NEW_LINE>}<NEW_LINE>a(container, l, insets.top + vGap, j1, i - i1, k1, k);<NEW_LINE>}
component = container.getComponent(l1);
566,376
final DeleteRepositoryResult executeDeleteRepository(DeleteRepositoryRequest deleteRepositoryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteRepositoryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteRepositoryRequest> request = null;<NEW_LINE>Response<DeleteRepositoryResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteRepositoryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteRepositoryRequest));<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, "Proton");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteRepository");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteRepositoryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteRepositoryResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
403,376
static void createExampleTable() {<NEW_LINE>// Provide the initial provisioned throughput values as Java long data<NEW_LINE>// types<NEW_LINE>ProvisionedThroughput provisionedThroughput = new ProvisionedThroughput().withReadCapacityUnits(5L).withWriteCapacityUnits(6L);<NEW_LINE>CreateTableRequest request = new CreateTableRequest().withTableName(tableName).withProvisionedThroughput(provisionedThroughput);<NEW_LINE>ArrayList<AttributeDefinition> attributeDefinitions = new ArrayList<AttributeDefinition>();<NEW_LINE>attributeDefinitions.add(new AttributeDefinition().withAttributeName("Id").withAttributeType("N"));<NEW_LINE>request.setAttributeDefinitions(attributeDefinitions);<NEW_LINE>ArrayList<KeySchemaElement> tableKeySchema = new ArrayList<KeySchemaElement>();<NEW_LINE>// Partition<NEW_LINE>tableKeySchema.add(new KeySchemaElement().withAttributeName("Id")<MASK><NEW_LINE>// key<NEW_LINE>request.setKeySchema(tableKeySchema);<NEW_LINE>client.createTable(request);<NEW_LINE>waitForTableToBecomeAvailable(tableName);<NEW_LINE>getTableInformation();<NEW_LINE>}
.withKeyType(KeyType.HASH));
1,662,780
public void keyPressed(KeyEvent e) {<NEW_LINE>// HACK for invoking tooltip using Ctrl+F1 because a condition in ToolTipManager.shouldRegisterBindings cannot be satisfied<NEW_LINE>if (e.getKeyCode() == KeyEvent.VK_F1 && (e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK) {<NEW_LINE>MouseContext context = new MouseContext();<NEW_LINE>resolveContext(scene.getFocusedWidget(), context);<NEW_LINE>context.commit(this);<NEW_LINE>Widget focusedWidget = scene.getFocusedWidget();<NEW_LINE>Point location = focusedWidget.getScene().convertSceneToView(focusedWidget.convertLocalToScene(focusedWidget.getBounds().getLocation()));<NEW_LINE>MouseEvent event = new MouseEvent(this, 0, 0, 0, location.x, location.y, 0, false);<NEW_LINE>ToolTipManager manager = ToolTipManager.sharedInstance();<NEW_LINE>manager.mouseEntered(event);<NEW_LINE>manager.mouseMoved(event);<NEW_LINE>}<NEW_LINE>WidgetAction.State state = processKeyOperator(Operator.KEY_PRESSED, new WidgetAction.<MASK><NEW_LINE>if (state.isConsumed())<NEW_LINE>e.consume();<NEW_LINE>}
WidgetKeyEvent(++eventIDcounter, e));
1,821,445
private void loadNode44() {<NEW_LINE>DataTypeEncodingTypeNode node = new DataTypeEncodingTypeNode(this.context, Identifiers.AddReferencesItem_Encoding_DefaultBinary, new QualifiedName(0, "Default Binary"), new LocalizedText("en", "Default Binary"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), UByte.valueOf(0));<NEW_LINE>node.addReference(new Reference(Identifiers.AddReferencesItem_Encoding_DefaultBinary, Identifiers.HasEncoding, Identifiers.AddReferencesItem.expanded(), false));<NEW_LINE>node.addReference(new Reference(Identifiers.AddReferencesItem_Encoding_DefaultBinary, Identifiers.HasDescription, Identifiers.OpcUa_BinarySchema_AddReferencesItem.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.AddReferencesItem_Encoding_DefaultBinary, Identifiers.HasTypeDefinition, Identifiers.DataTypeEncodingType<MASK><NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
406,085
public Pair<Boolean, byte[]> execute(byte[] data) {<NEW_LINE>if (data == null) {<NEW_LINE>return Pair.of(true, DataWord.ZERO().getData());<NEW_LINE>}<NEW_LINE>if (data.length != SIZE) {<NEW_LINE>return Pair.of(true, DataWord.ZERO().getData());<NEW_LINE>}<NEW_LINE>boolean result;<NEW_LINE>long ctx = JLibrustzcash.librustzcashSaplingVerificationCtxInit();<NEW_LINE>try {<NEW_LINE>byte[] nullifier = new byte[32];<NEW_LINE>byte[] anchor = new byte[32];<NEW_LINE>byte[] cv = new byte[32];<NEW_LINE>byte[] rk = new byte[32];<NEW_LINE>byte[] proof = new byte[192];<NEW_LINE>byte[] spendAuthSig = new byte[64];<NEW_LINE>byte[<MASK><NEW_LINE>byte[] signHash = new byte[32];<NEW_LINE>// spend<NEW_LINE>System.arraycopy(data, 0, nullifier, 0, 32);<NEW_LINE>System.arraycopy(data, 32, anchor, 0, 32);<NEW_LINE>System.arraycopy(data, 64, cv, 0, 32);<NEW_LINE>System.arraycopy(data, 96, rk, 0, 32);<NEW_LINE>System.arraycopy(data, 128, proof, 0, 192);<NEW_LINE>System.arraycopy(data, 320, spendAuthSig, 0, 64);<NEW_LINE>long value = parseLong(data, 384);<NEW_LINE>System.arraycopy(data, 416, bindingSig, 0, 64);<NEW_LINE>System.arraycopy(data, 480, signHash, 0, 32);<NEW_LINE>result = JLibrustzcash.librustzcashSaplingCheckSpend(new LibrustzcashParam.CheckSpendParams(ctx, cv, anchor, nullifier, rk, proof, spendAuthSig, signHash));<NEW_LINE>result = result && JLibrustzcash.librustzcashSaplingFinalCheck(new LibrustzcashParam.FinalCheckParams(ctx, value, bindingSig, signHash));<NEW_LINE>} catch (Throwable any) {<NEW_LINE>result = false;<NEW_LINE>String errorMsg = any.getMessage();<NEW_LINE>if (errorMsg == null && any.getCause() != null) {<NEW_LINE>errorMsg = any.getCause().getMessage();<NEW_LINE>}<NEW_LINE>logger.info("VerifyBurnProof exception " + errorMsg);<NEW_LINE>} finally {<NEW_LINE>JLibrustzcash.librustzcashSaplingVerificationCtxFree(ctx);<NEW_LINE>}<NEW_LINE>return Pair.of(true, dataBoolean(result));<NEW_LINE>}
] bindingSig = new byte[64];
199,064
private void create() {<NEW_LINE>buttonGroup = new ButtonGroup();<NEW_LINE>ItemListener listener = new ItemListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void itemStateChanged(ItemEvent e) {<NEW_LINE>if (e.getStateChange() == ItemEvent.SELECTED) {<NEW_LINE>mergeManager.clearStatusText();<NEW_LINE>mergeManager.setApplyEnabled(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>latestRB = new GRadioButton(MergeConstants.LATEST_TITLE);<NEW_LINE>latestRB.setName(LATEST_BUTTON_NAME);<NEW_LINE>latestRB.addItemListener(listener);<NEW_LINE>myRB = new GRadioButton(MergeConstants.MY_TITLE);<NEW_LINE>myRB.setName(CHECKED_OUT_BUTTON_NAME);<NEW_LINE>myRB.addItemListener(listener);<NEW_LINE>originalRB = new GRadioButton(MergeConstants.ORIGINAL_TITLE);<NEW_LINE>originalRB.setName(ORIGINAL_BUTTON_NAME);<NEW_LINE>originalRB.addItemListener(listener);<NEW_LINE>buttonGroup.add(latestRB);<NEW_LINE>buttonGroup.add(myRB);<NEW_LINE>buttonGroup.add(originalRB);<NEW_LINE>setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));<NEW_LINE>countPanel = new ConflictCountPanel();<NEW_LINE>JPanel dtPanel = new JPanel();<NEW_LINE>dtPanel.setLayout(new BoxLayout(dtPanel, BoxLayout.X_AXIS));<NEW_LINE>dtPanel.add(createSourceArchivePanel(latestRB));<NEW_LINE>dtPanel.add(createSourceArchivePanel(myRB));<NEW_LINE>dtPanel.add(createSourceArchivePanel(originalRB));<NEW_LINE>JPanel innerPanel = new JPanel();<NEW_LINE>innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.Y_AXIS));<NEW_LINE>innerPanel.add(createInfoPanel());<NEW_LINE>innerPanel.add(dtPanel);<NEW_LINE>innerPanel.add(Box.createVerticalStrut(10));<NEW_LINE>setLayout(new BorderLayout());<NEW_LINE>add(countPanel, BorderLayout.NORTH);<NEW_LINE>add(innerPanel, BorderLayout.CENTER);<NEW_LINE>add(<MASK><NEW_LINE>}
createUseForAllCheckBox(), BorderLayout.SOUTH);
1,575,411
public void handleError(final String errorMsg, final Throwable t) {<NEW_LINE>String stackTrace = "";<NEW_LINE>String title = "Error";<NEW_LINE>if (t != null) {<NEW_LINE>// Convert exception to string<NEW_LINE>StringWriter sw = new StringWriter(100);<NEW_LINE>t.printStackTrace(new PrintWriter(sw));<NEW_LINE>stackTrace = sw.toString();<NEW_LINE>title = t.toString();<NEW_LINE>}<NEW_LINE>final String finalTitle = title;<NEW_LINE>final String finalMsg = (errorMsg != null ? errorMsg : "Uncaught Exception") + "\n" + stackTrace;<NEW_LINE>logger.log(Level.SEVERE, finalMsg);<NEW_LINE>runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>// .setIcon(R.drawable.alert_dialog_icon)<NEW_LINE>AlertDialog // .setIcon(R.drawable.alert_dialog_icon)<NEW_LINE>dialog = new AlertDialog.Builder(AndroidHarness.this).setTitle(finalTitle).setPositiveButton("Kill", AndroidHarness.this).<MASK><NEW_LINE>dialog.show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
setMessage(finalMsg).create();
1,436,557
public Factory build() {<NEW_LINE>Set<String> extraKeyNames = new LinkedHashSet<>();<NEW_LINE>for (Map.Entry<String, Set<String>> entry : nameToKeyNames.entrySet()) {<NEW_LINE>BaggageField field = BaggageField.create(entry.getKey());<NEW_LINE>if (redactedNames.contains(field.name())) {<NEW_LINE>baggageFactory.add(SingleBaggageField.local(field));<NEW_LINE>} else {<NEW_LINE>extraKeyNames.<MASK><NEW_LINE>SingleBaggageField.Builder builder = SingleBaggageField.newBuilder(field);<NEW_LINE>for (String keyName : entry.getValue()) {<NEW_LINE>builder.addKeyName(keyName);<NEW_LINE>}<NEW_LINE>baggageFactory.add(builder.build());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Factory(baggageFactory.build(), extraKeyNames.toArray(new String[0]));<NEW_LINE>}
addAll(entry.getValue());
345,033
public static KeyPart[] split(MatrixMeta matrixMeta, int rowId, long[] keys) {<NEW_LINE>PartitionKey[] matrixParts = matrixMeta.getPartitionKeys();<NEW_LINE>int matrixPartNumMinus1 = matrixParts.length - 1;<NEW_LINE>KeyPart[] keyParts = new KeyPart[matrixParts.length];<NEW_LINE>int avgPartElemNum <MASK><NEW_LINE>for (int i = 0; i < keyParts.length; i++) {<NEW_LINE>keyParts[i] = new HashLongKeysPart(rowId, avgPartElemNum);<NEW_LINE>}<NEW_LINE>int[] hashCodes = computeHashCode(matrixMeta, keys);<NEW_LINE>if (isPow2(matrixParts.length)) {<NEW_LINE>for (int i = 0; i < hashCodes.length; i++) {<NEW_LINE>int partIndex = hashCodes[i] & (matrixPartNumMinus1);<NEW_LINE>((HashLongKeysPart) keyParts[partIndex]).add(keys[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < hashCodes.length; i++) {<NEW_LINE>int partIndex = hashCodes[i] % matrixParts.length;<NEW_LINE>((HashLongKeysPart) keyParts[partIndex]).add(keys[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return keyParts;<NEW_LINE>}
= keys.length / matrixParts.length;
865,426
public Matrix initMatrix(MatrixFilesMeta matrixFilesMeta) {<NEW_LINE>Map<Integer, MatrixPartitionMeta> partMetas = matrixFilesMeta.getPartMetas();<NEW_LINE>Int2LongOpenHashMap rowIdToElemNumMap = new Int2LongOpenHashMap();<NEW_LINE>for (MatrixPartitionMeta partMeta : partMetas.values()) {<NEW_LINE>Map<Integer, RowPartitionMeta> rowMetas = partMeta.getRowMetas();<NEW_LINE>for (Map.Entry<Integer, RowPartitionMeta> rowMetaEntry : rowMetas.entrySet()) {<NEW_LINE>rowIdToElemNumMap.addTo(rowMetaEntry.getKey(), rowMetaEntry.getValue().getElementNum());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RowType rowType = RowType.<MASK><NEW_LINE>RowBasedMatrix matrix = rbMatrix(rowType, matrixFilesMeta.getRow(), matrixFilesMeta.getCol());<NEW_LINE>ObjectIterator<Int2LongMap.Entry> iter = rowIdToElemNumMap.int2LongEntrySet().fastIterator();<NEW_LINE>Int2LongMap.Entry entry;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>entry = iter.next();<NEW_LINE>matrix.setRow(entry.getIntKey(), initRow(rowType, matrixFilesMeta.getCol(), entry.getLongValue()));<NEW_LINE>}<NEW_LINE>return matrix;<NEW_LINE>}
valueOf(matrixFilesMeta.getRowType());
177,787
private void rotateLocalSessionKeys() throws OtrException {<NEW_LINE>if (Debug.DEBUG_ENABLED)<NEW_LINE>Log.d(ImApp.LOG_TAG, "Rotating local keys.");<NEW_LINE>SessionKeys sess1 = getSessionKeysByIndex(SessionKeys.Previous, SessionKeys.Current);<NEW_LINE>if (sess1.getIsUsedReceivingMACKey()) {<NEW_LINE>if (Debug.DEBUG_ENABLED)<NEW_LINE>Log.<MASK><NEW_LINE>getOldMacKeys().add(sess1.getReceivingMACKey());<NEW_LINE>}<NEW_LINE>SessionKeys sess2 = getSessionKeysByIndex(SessionKeys.Previous, SessionKeys.Previous);<NEW_LINE>if (sess2.getIsUsedReceivingMACKey()) {<NEW_LINE>if (Debug.DEBUG_ENABLED)<NEW_LINE>Log.d(ImApp.LOG_TAG, "Detected used Receiving MAC key. Adding to old MAC keys to reveal it.");<NEW_LINE>getOldMacKeys().add(sess2.getReceivingMACKey());<NEW_LINE>}<NEW_LINE>SessionKeys sess3 = getSessionKeysByIndex(SessionKeys.Current, SessionKeys.Current);<NEW_LINE>sess1.setLocalPair(sess3.getLocalPair(), sess3.getLocalKeyID());<NEW_LINE>SessionKeys sess4 = getSessionKeysByIndex(SessionKeys.Current, SessionKeys.Previous);<NEW_LINE>sess2.setLocalPair(sess4.getLocalPair(), sess4.getLocalKeyID());<NEW_LINE>KeyPair newPair = new OtrCryptoEngineImpl().generateDHKeyPair();<NEW_LINE>sess3.setLocalPair(newPair, sess3.getLocalKeyID() + 1);<NEW_LINE>sess4.setLocalPair(newPair, sess4.getLocalKeyID() + 1);<NEW_LINE>}
d(ImApp.LOG_TAG, "Detected used Receiving MAC key. Adding to old MAC keys to reveal it.");
1,072,776
public ComplexSamples generateComplexSamples(int sampleCount) {<NEW_LINE>if (sampleCount % VECTOR_SPECIES.length() != 0) {<NEW_LINE>throw new IllegalArgumentException("Requested sample count [" + sampleCount + "] must be a power of 2 and a multiple of the SIMD lane width [" + VECTOR_SPECIES.length() + "]");<NEW_LINE>}<NEW_LINE>float[] iSamples = new float[sampleCount];<NEW_LINE>float[] qSamples = new float[sampleCount];<NEW_LINE>FloatVector previousInphase = FloatVector.fromArray(VECTOR_SPECIES, mPreviousInphases, 0);<NEW_LINE>FloatVector previousQuadrature = FloatVector.fromArray(VECTOR_SPECIES, mPreviousQuadratures, 0);<NEW_LINE>FloatVector gainInitials = FloatVector.fromArray(VECTOR_SPECIES, mGainInitials, 0);<NEW_LINE>// Sine and cosine angle per sample, with the rotation angle multiplied by the SIMD lane width<NEW_LINE>float cosAngle = (float) (FastMath.cos(getAnglePerSample() * VECTOR_SPECIES.length()));<NEW_LINE>float sinAngle = (float) (FastMath.sin(getAnglePerSample() * VECTOR_SPECIES.length()));<NEW_LINE>FloatVector gain, inphase, quadrature;<NEW_LINE>for (int samplePointer = 0; samplePointer < sampleCount; samplePointer += VECTOR_SPECIES.length()) {<NEW_LINE>gain = gainInitials.sub(previousInphase.pow(2.0f).add(previousQuadrature.pow(2.0f))).div(2.0f);<NEW_LINE>inphase = previousInphase.mul(cosAngle).sub(previousQuadrature.mul(sinAngle)).mul(gain);<NEW_LINE>quadrature = previousInphase.mul(sinAngle).add(previousQuadrature.mul(cosAngle)).mul(gain);<NEW_LINE>inphase.intoArray(iSamples, samplePointer);<NEW_LINE>quadrature.intoArray(qSamples, samplePointer);<NEW_LINE>previousInphase = inphase;<NEW_LINE>previousQuadrature = quadrature;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>previousQuadrature.intoArray(mPreviousQuadratures, 0);<NEW_LINE>return new ComplexSamples(iSamples, qSamples);<NEW_LINE>}
previousInphase.intoArray(mPreviousInphases, 0);
1,189,933
static Intent createExecuteIntent(String action) {<NEW_LINE>ExecutionCommand executionCommand = new ExecutionCommand();<NEW_LINE>executionCommand.executableUri = new Uri.Builder().scheme(TERMUX_SERVICE.URI_SCHEME_SERVICE_EXECUTE).path(BIN_SH).build();<NEW_LINE>executionCommand.arguments = new String[] { "-c", action };<NEW_LINE>executionCommand.runner = ExecutionCommand.Runner.APP_SHELL.getName();<NEW_LINE>// Create execution intent with the action TERMUX_SERVICE#ACTION_SERVICE_EXECUTE to be sent to the TERMUX_SERVICE<NEW_LINE>Intent executionIntent = new Intent(<MASK><NEW_LINE>executionIntent.setClassName(TermuxConstants.TERMUX_PACKAGE_NAME, TermuxConstants.TERMUX_APP.TERMUX_SERVICE_NAME);<NEW_LINE>executionIntent.putExtra(TERMUX_SERVICE.EXTRA_ARGUMENTS, executionCommand.arguments);<NEW_LINE>executionIntent.putExtra(TERMUX_SERVICE.EXTRA_RUNNER, executionCommand.runner);<NEW_LINE>// Also pass in case user using termux-app version < 0.119.0<NEW_LINE>executionIntent.putExtra(TERMUX_SERVICE.EXTRA_BACKGROUND, true);<NEW_LINE>return executionIntent;<NEW_LINE>}
TERMUX_SERVICE.ACTION_SERVICE_EXECUTE, executionCommand.executableUri);
1,658,835
public void afterPropertiesSet() {<NEW_LINE>this.factory = createRepositoryFactory();<NEW_LINE>this.factory.setQueryLookupStrategyKey(queryLookupStrategyKey);<NEW_LINE>this.factory.setNamedQueries(namedQueries);<NEW_LINE>this.factory.setEvaluationContextProvider(evaluationContextProvider.orElseGet(() -> QueryMethodEvaluationContextProvider.DEFAULT));<NEW_LINE>this.factory.setBeanClassLoader(classLoader);<NEW_LINE>this.factory.setBeanFactory(beanFactory);<NEW_LINE>if (publisher != null) {<NEW_LINE>this.factory.addRepositoryProxyPostProcessor(new EventPublishingRepositoryProxyPostProcessor(publisher));<NEW_LINE>}<NEW_LINE>repositoryBaseClass.ifPresent(this.factory::setRepositoryBaseClass);<NEW_LINE>this.repositoryFactoryCustomizers.forEach(customizer -> customizer.customize(this.factory));<NEW_LINE>//<NEW_LINE>RepositoryFragments //<NEW_LINE>customImplementationFragment = //<NEW_LINE>customImplementation.//<NEW_LINE>map(RepositoryFragments::just).orElseGet(RepositoryFragments::empty);<NEW_LINE>//<NEW_LINE>RepositoryFragments //<NEW_LINE>repositoryFragmentsToUse = //<NEW_LINE>this.repositoryFragments.//<NEW_LINE>orElseGet(RepositoryFragments::empty).append(customImplementationFragment);<NEW_LINE>this.repositoryMetadata = <MASK><NEW_LINE>this.repository = Lazy.of(() -> this.factory.getRepository(repositoryInterface, repositoryFragmentsToUse));<NEW_LINE>// Make sure the aggregate root type is present in the MappingContext (e.g. for auditing)<NEW_LINE>this.mappingContext.ifPresent(it -> it.getPersistentEntity(repositoryMetadata.getDomainType()));<NEW_LINE>if (!lazyInit) {<NEW_LINE>this.repository.get();<NEW_LINE>}<NEW_LINE>}
this.factory.getRepositoryMetadata(repositoryInterface);
1,042,276
public DocumentFilter unwrap(@NonNull final JSONDocumentFilter jsonFilter) {<NEW_LINE>final DocumentFilter.DocumentFilterBuilder filter = DocumentFilter.builder().setFilterId(jsonFilter.getFilterId()).setFacetFilter(isFacetFilter());<NEW_LINE>final Map<String, JSONDocumentFilterParam> jsonParams = Maps.uniqueIndex(jsonFilter.getParameters(), JSONDocumentFilterParam::getParameterName);<NEW_LINE>for (final DocumentFilterParamDescriptor paramDescriptor : getParameters()) {<NEW_LINE>final String parameterName = paramDescriptor.getParameterName();<NEW_LINE>final JSONDocumentFilterParam jsonParam = jsonParams.get(parameterName);<NEW_LINE>// If parameter is missing: skip it if no required, else throw exception<NEW_LINE>if (jsonParam == null) {<NEW_LINE>if (paramDescriptor.isMandatory()) {<NEW_LINE>throw new IllegalArgumentException("Parameter '" + parameterName + "' was not provided");<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final Object value = paramDescriptor.convertValueFromJson(jsonParam.getValue());<NEW_LINE>final Object valueTo = paramDescriptor.<MASK><NEW_LINE>// If there was no value/valueTo provided: skip it if no required, else throw exception<NEW_LINE>if (value == null && valueTo == null) {<NEW_LINE>if (paramDescriptor.isMandatory()) {<NEW_LINE>throw new IllegalArgumentException("Parameter '" + parameterName + "' has no value");<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>filter.addParameter(DocumentFilterParam.builder().setFieldName(paramDescriptor.getFieldName()).setOperator(paramDescriptor.getOperator()).setValue(value).setValueTo(valueTo).build());<NEW_LINE>}<NEW_LINE>for (final DocumentFilterParam internalParam : getInternalParameters()) {<NEW_LINE>filter.addInternalParameter(internalParam);<NEW_LINE>}<NEW_LINE>return filter.build();<NEW_LINE>}
convertValueFromJson(jsonParam.getValueTo());